From 852e1fd700994b49c39bba83654797ad03bdcb74 Mon Sep 17 00:00:00 2001 From: Ernest Cui Date: Sun, 12 May 2024 19:01:32 +0800 Subject: [PATCH] build: build --- cli/build/irvm.mjs | 2 +- ...ssMode-e9a916a7.js => cssMode-f75e3f37.js} | 2 +- ...r2-64c2a106.js => freemarker2-c400ccc3.js} | 2 +- ...ars-37d070d1.js => handlebars-c10cb1ca.js} | 2 +- .../{html-7ea466f3.js => html-83ec7cfd.js} | 2 +- ...lMode-ed1d179b.js => htmlMode-414a2305.js} | 2 +- .../{index-e4c81506.js => index-7745a004.js} | 258 +++++++++--------- ...ipt-4363171e.js => javascript-608a8482.js} | 2 +- ...nMode-c06ea4cb.js => jsonMode-b0407c2e.js} | 2 +- ...{liquid-87315f86.js => liquid-3fca3ef0.js} | 2 +- .../{mdx-0ce00991.js => mdx-f7a52d23.js} | 2 +- ...{python-54b0304d.js => python-b8459894.js} | 2 +- .../{razor-93d55a7c.js => razor-0763a92b.js} | 2 +- ...{tsMode-15682ab2.js => tsMode-74a44fcf.js} | 2 +- ...ipt-8089b405.js => typescript-4b89e88c.js} | 2 +- .../{xml-978d1915.js => xml-968dcc32.js} | 2 +- .../{yaml-74f5320e.js => yaml-8a69e9dd.js} | 2 +- docs/index.html | 2 +- 18 files changed, 146 insertions(+), 146 deletions(-) rename docs/assets/{cssMode-e9a916a7.js => cssMode-f75e3f37.js} (99%) rename docs/assets/{freemarker2-64c2a106.js => freemarker2-c400ccc3.js} (99%) rename docs/assets/{handlebars-37d070d1.js => handlebars-c10cb1ca.js} (99%) rename docs/assets/{html-7ea466f3.js => html-83ec7cfd.js} (98%) rename docs/assets/{htmlMode-ed1d179b.js => htmlMode-414a2305.js} (99%) rename docs/assets/{index-e4c81506.js => index-7745a004.js} (96%) rename docs/assets/{javascript-4363171e.js => javascript-608a8482.js} (89%) rename docs/assets/{jsonMode-c06ea4cb.js => jsonMode-b0407c2e.js} (99%) rename docs/assets/{liquid-87315f86.js => liquid-3fca3ef0.js} (98%) rename docs/assets/{mdx-0ce00991.js => mdx-f7a52d23.js} (98%) rename docs/assets/{python-54b0304d.js => python-b8459894.js} (98%) rename docs/assets/{razor-93d55a7c.js => razor-0763a92b.js} (99%) rename docs/assets/{tsMode-15682ab2.js => tsMode-74a44fcf.js} (99%) rename docs/assets/{typescript-8089b405.js => typescript-4b89e88c.js} (98%) rename docs/assets/{xml-978d1915.js => xml-968dcc32.js} (97%) rename docs/assets/{yaml-74f5320e.js => yaml-8a69e9dd.js} (98%) diff --git a/cli/build/irvm.mjs b/cli/build/irvm.mjs index 2c58a9d..c51a130 100644 --- a/cli/build/irvm.mjs +++ b/cli/build/irvm.mjs @@ -6,4 +6,4 @@ import t from"fs";import e from"readline";import r from"assert";import n from"ut * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */je=ze,Ve=ze.exports,function(){var t,e="Expected a function",r="__lodash_hash_undefined__",n="__lodash_placeholder__",i=16,o=32,a=64,u=128,l=256,c=1/0,h=9007199254740991,f=NaN,_=4294967295,p=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",i],["flip",512],["partial",o],["partialRight",a],["rearg",l]],g="[object Arguments]",d="[object Array]",m="[object Boolean]",E="[object Date]",v="[object Error]",y="[object Function]",A="[object GeneratorFunction]",b="[object Map]",R="[object Number]",T="[object Object]",I="[object Promise]",L="[object RegExp]",O="[object Set]",S="[object String]",N="[object Symbol]",w="[object WeakMap]",C="[object ArrayBuffer]",D="[object DataView]",M="[object Float32Array]",B="[object Float64Array]",P="[object Int8Array]",x="[object Int16Array]",U="[object Int32Array]",G="[object Uint8Array]",k="[object Uint8ClampedArray]",F="[object Uint16Array]",H="[object Uint32Array]",j=/\b__p \+= '';/g,V=/\b(__p \+=) '' \+/g,z=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,K=/[&<>"']/g,Y=RegExp(W.source),X=RegExp(K.source),Z=/<%-([\s\S]+?)%>/g,q=/<%([\s\S]+?)%>/g,$=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,J=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/[\\^$.*+?()[\]{}|]/g,rt=RegExp(et.source),nt=/^\s+/,it=/\s/,st=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ot=/\{\n\/\* \[wrapped with (.+)\] \*/,at=/,? & /,ut=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,lt=/[()=,{}\[\]\/\s]/,ct=/\\(\\)?/g,ht=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ft=/\w*$/,_t=/^[-+]0x[0-9a-f]+$/i,pt=/^0b[01]+$/i,gt=/^\[object .+?Constructor\]$/,dt=/^0o[0-7]+$/i,mt=/^(?:0|[1-9]\d*)$/,Et=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,vt=/($^)/,yt=/['\n\r\u2028\u2029\\]/g,At="\\ud800-\\udfff",bt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Rt="\\u2700-\\u27bf",Tt="a-z\\xdf-\\xf6\\xf8-\\xff",It="A-Z\\xc0-\\xd6\\xd8-\\xde",Lt="\\ufe0e\\ufe0f",Ot="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",St="['’]",Nt="["+At+"]",wt="["+Ot+"]",Ct="["+bt+"]",Dt="\\d+",Mt="["+Rt+"]",Bt="["+Tt+"]",Pt="[^"+At+Ot+Dt+Rt+Tt+It+"]",xt="\\ud83c[\\udffb-\\udfff]",Ut="[^"+At+"]",Gt="(?:\\ud83c[\\udde6-\\uddff]){2}",kt="[\\ud800-\\udbff][\\udc00-\\udfff]",Ft="["+It+"]",Ht="\\u200d",jt="(?:"+Bt+"|"+Pt+")",Vt="(?:"+Ft+"|"+Pt+")",zt="(?:['’](?:d|ll|m|re|s|t|ve))?",Wt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Kt="(?:"+Ct+"|"+xt+")?",Yt="["+Lt+"]?",Xt=Yt+Kt+"(?:"+Ht+"(?:"+[Ut,Gt,kt].join("|")+")"+Yt+Kt+")*",Zt="(?:"+[Mt,Gt,kt].join("|")+")"+Xt,qt="(?:"+[Ut+Ct+"?",Ct,Gt,kt,Nt].join("|")+")",$t=RegExp(St,"g"),Qt=RegExp(Ct,"g"),Jt=RegExp(xt+"(?="+xt+")|"+qt+Xt,"g"),te=RegExp([Ft+"?"+Bt+"+"+zt+"(?="+[wt,Ft,"$"].join("|")+")",Vt+"+"+Wt+"(?="+[wt,Ft+jt,"$"].join("|")+")",Ft+"?"+jt+"+"+zt,Ft+"+"+Wt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Dt,Zt].join("|"),"g"),ee=RegExp("["+Ht+At+bt+Lt+"]"),re=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ne=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ie=-1,se={};se[M]=se[B]=se[P]=se[x]=se[U]=se[G]=se[k]=se[F]=se[H]=!0,se[g]=se[d]=se[C]=se[m]=se[D]=se[E]=se[v]=se[y]=se[b]=se[R]=se[T]=se[L]=se[O]=se[S]=se[w]=!1;var oe={};oe[g]=oe[d]=oe[C]=oe[D]=oe[m]=oe[E]=oe[M]=oe[B]=oe[P]=oe[x]=oe[U]=oe[b]=oe[R]=oe[T]=oe[L]=oe[O]=oe[S]=oe[N]=oe[G]=oe[k]=oe[F]=oe[H]=!0,oe[v]=oe[y]=oe[w]=!1;var ae={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ue=parseFloat,le=parseInt,ce="object"==typeof s&&s&&s.Object===Object&&s,he="object"==typeof self&&self&&self.Object===Object&&self,fe=ce||he||Function("return this")(),_e=Ve&&!Ve.nodeType&&Ve,pe=_e&&je&&!je.nodeType&&je,ge=pe&&pe.exports===_e,de=ge&&ce.process,me=function(){try{var t=pe&&pe.require&&pe.require("util").types;return t||de&&de.binding&&de.binding("util")}catch(t){}}(),Ee=me&&me.isArrayBuffer,ve=me&&me.isDate,ye=me&&me.isMap,Ae=me&&me.isRegExp,be=me&&me.isSet,Re=me&&me.isTypedArray;function Te(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Ie(t,e,r,n){for(var i=-1,s=null==t?0:t.length;++i-1}function Ce(t,e,r){for(var n=-1,i=null==t?0:t.length;++n-1;);return r}function rr(t,e){for(var r=t.length;r--&&Fe(e,t[r],0)>-1;);return r}var nr=Ye({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),ir=Ye({"&":"&","<":"<",">":">",'"':""","'":"'"});function sr(t){return"\\"+ae[t]}function or(t){return ee.test(t)}function ar(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function ur(t,e){return function(r){return t(e(r))}}function lr(t,e){for(var r=-1,i=t.length,s=0,o=[];++r",""":'"',"'":"'"}),dr=function s(it){var At,bt=(it=null==it?fe:dr.defaults(fe.Object(),it,dr.pick(fe,ne))).Array,Rt=it.Date,Tt=it.Error,It=it.Function,Lt=it.Math,Ot=it.Object,St=it.RegExp,Nt=it.String,wt=it.TypeError,Ct=bt.prototype,Dt=It.prototype,Mt=Ot.prototype,Bt=it["__core-js_shared__"],Pt=Dt.toString,xt=Mt.hasOwnProperty,Ut=0,Gt=(At=/[^.]+$/.exec(Bt&&Bt.keys&&Bt.keys.IE_PROTO||""))?"Symbol(src)_1."+At:"",kt=Mt.toString,Ft=Pt.call(Ot),Ht=fe._,jt=St("^"+Pt.call(xt).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Vt=ge?it.Buffer:t,zt=it.Symbol,Wt=it.Uint8Array,Kt=Vt?Vt.allocUnsafe:t,Yt=ur(Ot.getPrototypeOf,Ot),Xt=Ot.create,Zt=Mt.propertyIsEnumerable,qt=Ct.splice,Jt=zt?zt.isConcatSpreadable:t,ee=zt?zt.iterator:t,ae=zt?zt.toStringTag:t,ce=function(){try{var t=fs(Ot,"defineProperty");return t({},"",{}),t}catch(t){}}(),he=it.clearTimeout!==fe.clearTimeout&&it.clearTimeout,_e=Rt&&Rt.now!==fe.Date.now&&Rt.now,pe=it.setTimeout!==fe.setTimeout&&it.setTimeout,de=Lt.ceil,me=Lt.floor,Ue=Ot.getOwnPropertySymbols,je=Vt?Vt.isBuffer:t,Ve=it.isFinite,Ye=Ct.join,mr=ur(Ot.keys,Ot),Er=Lt.max,vr=Lt.min,yr=Rt.now,Ar=it.parseInt,br=Lt.random,Rr=Ct.reverse,Tr=fs(it,"DataView"),Ir=fs(it,"Map"),Lr=fs(it,"Promise"),Or=fs(it,"Set"),Sr=fs(it,"WeakMap"),Nr=fs(Ot,"create"),wr=Sr&&new Sr,Cr={},Dr=Gs(Tr),Mr=Gs(Ir),Br=Gs(Lr),Pr=Gs(Or),xr=Gs(Sr),Ur=zt?zt.prototype:t,Gr=Ur?Ur.valueOf:t,kr=Ur?Ur.toString:t;function Fr(t){if(ra(t)&&!Wo(t)&&!(t instanceof zr)){if(t instanceof Vr)return t;if(xt.call(t,"__wrapped__"))return ks(t)}return new Vr(t)}var Hr=function(){function e(){}return function(r){if(!ea(r))return{};if(Xt)return Xt(r);e.prototype=r;var n=new e;return e.prototype=t,n}}();function jr(){}function Vr(e,r){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!r,this.__index__=0,this.__values__=t}function zr(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=_,this.__views__=[]}function Wr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e=r?e:r)),e}function ln(e,r,n,i,s,o){var a,u=1&r,l=2&r,c=4&r;if(n&&(a=s?n(e,i,s,o):n(e)),a!==t)return a;if(!ea(e))return e;var h=Wo(e);if(h){if(a=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&xt.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(e),!u)return wi(e,a)}else{var f=gs(e),_=f==y||f==A;if(Zo(e))return Ti(e,u);if(f==T||f==g||_&&!s){if(a=l||_?{}:ms(e),!u)return l?function(t,e){return Ci(t,ps(t),e)}(e,function(t,e){return t&&Ci(e,Ma(e),t)}(a,e)):function(t,e){return Ci(t,_s(t),e)}(e,sn(a,e))}else{if(!oe[f])return s?e:{};a=function(t,e,r){var n,i=t.constructor;switch(e){case C:return Ii(t);case m:case E:return new i(+t);case D:return function(t,e){var r=e?Ii(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case M:case B:case P:case x:case U:case G:case k:case F:case H:return Li(t,r);case b:return new i;case R:case S:return new i(t);case L:return function(t){var e=new t.constructor(t.source,ft.exec(t));return e.lastIndex=t.lastIndex,e}(t);case O:return new i;case N:return n=t,Gr?Ot(Gr.call(n)):{}}}(e,f,u)}}o||(o=new Zr);var p=o.get(e);if(p)return p;o.set(e,a),aa(e)?e.forEach((function(t){a.add(ln(t,r,n,t,e,o))})):na(e)&&e.forEach((function(t,i){a.set(i,ln(t,r,n,i,e,o))}));var d=h?t:(c?l?ss:is:l?Ma:Da)(e);return Le(d||e,(function(t,i){d&&(t=e[i=t]),en(a,i,ln(t,r,n,i,e,o))})),a}function cn(e,r,n){var i=n.length;if(null==e)return!i;for(e=Ot(e);i--;){var s=n[i],o=r[s],a=e[s];if(a===t&&!(s in e)||!o(a))return!1}return!0}function hn(r,n,i){if("function"!=typeof r)throw new wt(e);return Cs((function(){r.apply(t,i)}),n)}function fn(t,e,r,n){var i=-1,s=we,o=!0,a=t.length,u=[],l=e.length;if(!a)return u;r&&(e=De(e,Qe(r))),n?(s=Ce,o=!1):e.length>=200&&(s=tr,o=!1,e=new Xr(e));t:for(;++i-1},Kr.prototype.set=function(t,e){var r=this.__data__,n=rn(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},Yr.prototype.clear=function(){this.size=0,this.__data__={hash:new Wr,map:new(Ir||Kr),string:new Wr}},Yr.prototype.delete=function(t){var e=cs(this,t).delete(t);return this.size-=e?1:0,e},Yr.prototype.get=function(t){return cs(this,t).get(t)},Yr.prototype.has=function(t){return cs(this,t).has(t)},Yr.prototype.set=function(t,e){var r=cs(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},Xr.prototype.add=Xr.prototype.push=function(t){return this.__data__.set(t,r),this},Xr.prototype.has=function(t){return this.__data__.has(t)},Zr.prototype.clear=function(){this.__data__=new Kr,this.size=0},Zr.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Zr.prototype.get=function(t){return this.__data__.get(t)},Zr.prototype.has=function(t){return this.__data__.has(t)},Zr.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Kr){var n=r.__data__;if(!Ir||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Yr(n)}return r.set(t,e),this.size=r.size,this};var _n=Bi(An),pn=Bi(bn,!0);function gn(t,e){var r=!0;return _n(t,(function(t,n,i){return r=!!e(t,n,i)})),r}function dn(e,r,n){for(var i=-1,s=e.length;++i0&&r(a)?e>1?En(a,e-1,r,n,i):Me(i,a):n||(i[i.length]=a)}return i}var vn=Pi(),yn=Pi(!0);function An(t,e){return t&&vn(t,e,Da)}function bn(t,e){return t&&yn(t,e,Da)}function Rn(t,e){return Ne(e,(function(e){return Qo(t[e])}))}function Tn(e,r){for(var n=0,i=(r=yi(r,e)).length;null!=e&&ne}function Sn(t,e){return null!=t&&xt.call(t,e)}function Nn(t,e){return null!=t&&e in Ot(t)}function wn(e,r,n){for(var i=n?Ce:we,s=e[0].length,o=e.length,a=o,u=bt(o),l=1/0,c=[];a--;){var h=e[a];a&&r&&(h=De(h,Qe(r))),l=vr(h.length,l),u[a]=!n&&(r||s>=120&&h.length>=120)?new Xr(a&&h):t}h=e[0];var f=-1,_=u[0];t:for(;++f=a?u:u*("desc"==r[n]?-1:1)}return t.index-e.index}(t,e,r)}))}function Kn(t,e,r){for(var n=-1,i=e.length,s={};++n-1;)a!==t&&qt.call(a,u,1),qt.call(t,u,1);return t}function Xn(t,e){for(var r=t?e.length:0,n=r-1;r--;){var i=e[r];if(r==n||i!==s){var s=i;vs(i)?qt.call(t,i,1):fi(t,i)}}return t}function Zn(t,e){return t+me(br()*(e-t+1))}function qn(t,e){var r="";if(!t||e<1||e>h)return r;do{e%2&&(r+=t),(e=me(e/2))&&(t+=t)}while(e);return r}function $n(t,e){return Ds(Os(t,e,iu),t+"")}function Qn(t){return $r(Ha(t))}function Jn(t,e){var r=Ha(t);return Ps(r,un(e,0,r.length))}function ti(e,r,n,i){if(!ea(e))return e;for(var s=-1,o=(r=yi(r,e)).length,a=o-1,u=e;null!=u&&++si?0:i+e),(r=r>i?i:r)<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var s=bt(i);++n>>1,o=t[s];null!==o&&!la(o)&&(r?o<=e:o=200){var l=e?null:qi(t);if(l)return cr(l);o=!1,i=tr,u=new Xr}else u=e?[]:a;t:for(;++n=i?e:ii(e,r,n)}var Ri=he||function(t){return fe.clearTimeout(t)};function Ti(t,e){if(e)return t.slice();var r=t.length,n=Kt?Kt(r):new t.constructor(r);return t.copy(n),n}function Ii(t){var e=new t.constructor(t.byteLength);return new Wt(e).set(new Wt(t)),e}function Li(t,e){var r=e?Ii(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Oi(e,r){if(e!==r){var n=e!==t,i=null===e,s=e==e,o=la(e),a=r!==t,u=null===r,l=r==r,c=la(r);if(!u&&!c&&!o&&e>r||o&&a&&l&&!u&&!c||i&&a&&l||!n&&l||!s)return 1;if(!i&&!o&&!c&&e1?n[s-1]:t,a=s>2?n[2]:t;for(o=e.length>3&&"function"==typeof o?(s--,o):t,a&&ys(n[0],n[1],a)&&(o=s<3?t:o,s=1),r=Ot(r);++i-1?s[o?r[a]:a]:t}}function Fi(r){return ns((function(n){var i=n.length,s=i,o=Vr.prototype.thru;for(r&&n.reverse();s--;){var a=n[s];if("function"!=typeof a)throw new wt(e);if(o&&!u&&"wrapper"==as(a))var u=new Vr([],!0)}for(s=u?s:i;++s1&&v.reverse(),f&&cu))return!1;var c=o.get(e),h=o.get(r);if(c&&h)return c==r&&h==e;var f=-1,_=!0,p=2&n?new Xr:t;for(o.set(e,r),o.set(r,e);++f-1&&t%1==0&&t1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(st,"{\n/* [wrapped with "+e+"] */\n")}(n,function(t,e){return Le(p,(function(r){var n="_."+r[0];e&r[1]&&!we(t,n)&&t.push(n)})),t.sort()}(function(t){var e=t.match(ot);return e?e[1].split(at):[]}(n),r)))}function Bs(e){var r=0,n=0;return function(){var i=yr(),s=16-(i-n);if(n=i,s>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(t,arguments)}}function Ps(e,r){var n=-1,i=e.length,s=i-1;for(r=r===t?i:r;++n1?e[r-1]:t;return n="function"==typeof n?(e.pop(),n):t,so(e,n)}));function fo(t){var e=Fr(t);return e.__chain__=!0,e}function _o(t,e){return e(t)}var po=ns((function(e){var r=e.length,n=r?e[0]:0,i=this.__wrapped__,s=function(t){return an(t,e)};return!(r>1||this.__actions__.length)&&i instanceof zr&&vs(n)?((i=i.slice(n,+n+(r?1:0))).__actions__.push({func:_o,args:[s],thisArg:t}),new Vr(i,this.__chain__).thru((function(e){return r&&!e.length&&e.push(t),e}))):this.thru(s)})),go=Di((function(t,e,r){xt.call(t,r)?++t[r]:on(t,r,1)})),mo=ki(Vs),Eo=ki(zs);function vo(t,e){return(Wo(t)?Le:_n)(t,ls(e,3))}function yo(t,e){return(Wo(t)?Oe:pn)(t,ls(e,3))}var Ao=Di((function(t,e,r){xt.call(t,r)?t[r].push(e):on(t,r,[e])})),bo=$n((function(t,e,r){var n=-1,i="function"==typeof e,s=Yo(t)?bt(t.length):[];return _n(t,(function(t){s[++n]=i?Te(e,t,r):Cn(t,e,r)})),s})),Ro=Di((function(t,e,r){on(t,r,e)}));function To(t,e){return(Wo(t)?De:Fn)(t,ls(e,3))}var Io=Di((function(t,e,r){t[r?0:1].push(e)}),(function(){return[[],[]]})),Lo=$n((function(t,e){if(null==t)return[];var r=e.length;return r>1&&ys(t,e[0],e[1])?e=[]:r>2&&ys(e[0],e[1],e[2])&&(e=[e[0]]),Wn(t,En(e,1),[])})),Oo=_e||function(){return fe.Date.now()};function So(e,r,n){return r=n?t:r,r=e&&null==r?e.length:r,Qi(e,u,t,t,t,t,r)}function No(r,n){var i;if("function"!=typeof n)throw new wt(e);return r=ga(r),function(){return--r>0&&(i=n.apply(this,arguments)),r<=1&&(n=t),i}}var wo=$n((function(t,e,r){var n=1;if(r.length){var i=lr(r,us(wo));n|=o}return Qi(t,n,e,r,i)})),Co=$n((function(t,e,r){var n=3;if(r.length){var i=lr(r,us(Co));n|=o}return Qi(e,n,t,r,i)}));function Do(r,n,i){var s,o,a,u,l,c,h=0,f=!1,_=!1,p=!0;if("function"!=typeof r)throw new wt(e);function g(e){var n=s,i=o;return s=o=t,h=e,u=r.apply(i,n)}function d(e){var r=e-c;return c===t||r>=n||r<0||_&&e-h>=a}function m(){var t=Oo();if(d(t))return E(t);l=Cs(m,function(t){var e=n-(t-c);return _?vr(e,a-(t-h)):e}(t))}function E(e){return l=t,p&&s?g(e):(s=o=t,u)}function v(){var e=Oo(),r=d(e);if(s=arguments,o=this,c=e,r){if(l===t)return function(t){return h=t,l=Cs(m,n),f?g(t):u}(c);if(_)return Ri(l),l=Cs(m,n),g(c)}return l===t&&(l=Cs(m,n)),u}return n=ma(n)||0,ea(i)&&(f=!!i.leading,a=(_="maxWait"in i)?Er(ma(i.maxWait)||0,n):a,p="trailing"in i?!!i.trailing:p),v.cancel=function(){l!==t&&Ri(l),h=0,s=c=o=l=t},v.flush=function(){return l===t?u:E(Oo())},v}var Mo=$n((function(t,e){return hn(t,1,e)})),Bo=$n((function(t,e,r){return hn(t,ma(e)||0,r)}));function Po(t,r){if("function"!=typeof t||null!=r&&"function"!=typeof r)throw new wt(e);var n=function(){var e=arguments,i=r?r.apply(this,e):e[0],s=n.cache;if(s.has(i))return s.get(i);var o=t.apply(this,e);return n.cache=s.set(i,o)||s,o};return n.cache=new(Po.Cache||Yr),n}function xo(t){if("function"!=typeof t)throw new wt(e);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Po.Cache=Yr;var Uo=Ai((function(t,e){var r=(e=1==e.length&&Wo(e[0])?De(e[0],Qe(ls())):De(En(e,1),Qe(ls()))).length;return $n((function(n){for(var i=-1,s=vr(n.length,r);++i=e})),zo=Dn(function(){return arguments}())?Dn:function(t){return ra(t)&&xt.call(t,"callee")&&!Zt.call(t,"callee")},Wo=bt.isArray,Ko=Ee?Qe(Ee):function(t){return ra(t)&&Ln(t)==C};function Yo(t){return null!=t&&ta(t.length)&&!Qo(t)}function Xo(t){return ra(t)&&Yo(t)}var Zo=je||mu,qo=ve?Qe(ve):function(t){return ra(t)&&Ln(t)==E};function $o(t){if(!ra(t))return!1;var e=Ln(t);return e==v||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!sa(t)}function Qo(t){if(!ea(t))return!1;var e=Ln(t);return e==y||e==A||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Jo(t){return"number"==typeof t&&t==ga(t)}function ta(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=h}function ea(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ra(t){return null!=t&&"object"==typeof t}var na=ye?Qe(ye):function(t){return ra(t)&&gs(t)==b};function ia(t){return"number"==typeof t||ra(t)&&Ln(t)==R}function sa(t){if(!ra(t)||Ln(t)!=T)return!1;var e=Yt(t);if(null===e)return!0;var r=xt.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&Pt.call(r)==Ft}var oa=Ae?Qe(Ae):function(t){return ra(t)&&Ln(t)==L},aa=be?Qe(be):function(t){return ra(t)&&gs(t)==O};function ua(t){return"string"==typeof t||!Wo(t)&&ra(t)&&Ln(t)==S}function la(t){return"symbol"==typeof t||ra(t)&&Ln(t)==N}var ca=Re?Qe(Re):function(t){return ra(t)&&ta(t.length)&&!!se[Ln(t)]},ha=Yi(kn),fa=Yi((function(t,e){return t<=e}));function _a(t){if(!t)return[];if(Yo(t))return ua(t)?_r(t):wi(t);if(ee&&t[ee])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[ee]());var e=gs(t);return(e==b?ar:e==O?cr:Ha)(t)}function pa(t){return t?(t=ma(t))===c||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ga(t){var e=pa(t),r=e%1;return e==e?r?e-r:e:0}function da(t){return t?un(ga(t),0,_):0}function ma(t){if("number"==typeof t)return t;if(la(t))return f;if(ea(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ea(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=$e(t);var r=pt.test(t);return r||dt.test(t)?le(t.slice(2),r?2:8):_t.test(t)?f:+t}function Ea(t){return Ci(t,Ma(t))}function va(t){return null==t?"":ci(t)}var ya=Mi((function(t,e){if(Ts(e)||Yo(e))Ci(e,Da(e),t);else for(var r in e)xt.call(e,r)&&en(t,r,e[r])})),Aa=Mi((function(t,e){Ci(e,Ma(e),t)})),ba=Mi((function(t,e,r,n){Ci(e,Ma(e),t,n)})),Ra=Mi((function(t,e,r,n){Ci(e,Da(e),t,n)})),Ta=ns(an),Ia=$n((function(e,r){e=Ot(e);var n=-1,i=r.length,s=i>2?r[2]:t;for(s&&ys(r[0],r[1],s)&&(i=1);++n1),e})),Ci(t,ss(t),r),n&&(r=ln(r,7,es));for(var i=e.length;i--;)fi(r,e[i]);return r})),Ua=ns((function(t,e){return null==t?{}:function(t,e){return Kn(t,e,(function(e,r){return Sa(t,r)}))}(t,e)}));function Ga(t,e){if(null==t)return{};var r=De(ss(t),(function(t){return[t]}));return e=ls(e),Kn(t,r,(function(t,r){return e(t,r[0])}))}var ka=$i(Da),Fa=$i(Ma);function Ha(t){return null==t?[]:Je(t,Da(t))}var ja=Ui((function(t,e,r){return e=e.toLowerCase(),t+(r?Va(e):e)}));function Va(t){return $a(va(t).toLowerCase())}function za(t){return(t=va(t))&&t.replace(Et,nr).replace(Qt,"")}var Wa=Ui((function(t,e,r){return t+(r?"-":"")+e.toLowerCase()})),Ka=Ui((function(t,e,r){return t+(r?" ":"")+e.toLowerCase()})),Ya=xi("toLowerCase"),Xa=Ui((function(t,e,r){return t+(r?"_":"")+e.toLowerCase()})),Za=Ui((function(t,e,r){return t+(r?" ":"")+$a(e)})),qa=Ui((function(t,e,r){return t+(r?" ":"")+e.toUpperCase()})),$a=xi("toUpperCase");function Qa(e,r,n){return e=va(e),(r=n?t:r)===t?function(t){return re.test(t)}(e)?function(t){return t.match(te)||[]}(e):function(t){return t.match(ut)||[]}(e):e.match(r)||[]}var Ja=$n((function(e,r){try{return Te(e,t,r)}catch(t){return $o(t)?t:new Tt(t)}})),tu=ns((function(t,e){return Le(e,(function(e){e=Us(e),on(t,e,wo(t[e],t))})),t}));function eu(t){return function(){return t}}var ru=Fi(),nu=Fi(!0);function iu(t){return t}function su(t){return xn("function"==typeof t?t:ln(t,1))}var ou=$n((function(t,e){return function(r){return Cn(r,t,e)}})),au=$n((function(t,e){return function(r){return Cn(t,r,e)}}));function uu(t,e,r){var n=Da(e),i=Rn(e,n);null!=r||ea(e)&&(i.length||!n.length)||(r=e,e=t,t=this,i=Rn(e,Da(e)));var s=!(ea(r)&&"chain"in r&&!r.chain),o=Qo(t);return Le(i,(function(r){var n=e[r];t[r]=n,o&&(t.prototype[r]=function(){var e=this.__chain__;if(s||e){var r=t(this.__wrapped__);return(r.__actions__=wi(this.__actions__)).push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}return n.apply(t,Me([this.value()],arguments))})})),t}function lu(){}var cu=zi(De),hu=zi(Se),fu=zi(xe);function _u(t){return As(t)?Ke(Us(t)):function(t){return function(e){return Tn(e,t)}}(t)}var pu=Ki(),gu=Ki(!0);function du(){return[]}function mu(){return!1}var Eu,vu=Vi((function(t,e){return t+e}),0),yu=Zi("ceil"),Au=Vi((function(t,e){return t/e}),1),bu=Zi("floor"),Ru=Vi((function(t,e){return t*e}),1),Tu=Zi("round"),Iu=Vi((function(t,e){return t-e}),0);return Fr.after=function(t,r){if("function"!=typeof r)throw new wt(e);return t=ga(t),function(){if(--t<1)return r.apply(this,arguments)}},Fr.ary=So,Fr.assign=ya,Fr.assignIn=Aa,Fr.assignInWith=ba,Fr.assignWith=Ra,Fr.at=Ta,Fr.before=No,Fr.bind=wo,Fr.bindAll=tu,Fr.bindKey=Co,Fr.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Wo(t)?t:[t]},Fr.chain=fo,Fr.chunk=function(e,r,n){r=(n?ys(e,r,n):r===t)?1:Er(ga(r),0);var i=null==e?0:e.length;if(!i||r<1)return[];for(var s=0,o=0,a=bt(de(i/r));ss?0:s+n),(i=i===t||i>s?s:ga(i))<0&&(i+=s),i=n>i?0:da(i);n>>0)?(e=va(e))&&("string"==typeof r||null!=r&&!oa(r))&&!(r=ci(r))&&or(e)?bi(_r(e),0,n):e.split(r,n):[]},Fr.spread=function(t,r){if("function"!=typeof t)throw new wt(e);return r=null==r?0:Er(ga(r),0),$n((function(e){var n=e[r],i=bi(e,0,r);return n&&Me(i,n),Te(t,this,i)}))},Fr.tail=function(t){var e=null==t?0:t.length;return e?ii(t,1,e):[]},Fr.take=function(e,r,n){return e&&e.length?ii(e,0,(r=n||r===t?1:ga(r))<0?0:r):[]},Fr.takeRight=function(e,r,n){var i=null==e?0:e.length;return i?ii(e,(r=i-(r=n||r===t?1:ga(r)))<0?0:r,i):[]},Fr.takeRightWhile=function(t,e){return t&&t.length?pi(t,ls(e,3),!1,!0):[]},Fr.takeWhile=function(t,e){return t&&t.length?pi(t,ls(e,3)):[]},Fr.tap=function(t,e){return e(t),t},Fr.throttle=function(t,r,n){var i=!0,s=!0;if("function"!=typeof t)throw new wt(e);return ea(n)&&(i="leading"in n?!!n.leading:i,s="trailing"in n?!!n.trailing:s),Do(t,r,{leading:i,maxWait:r,trailing:s})},Fr.thru=_o,Fr.toArray=_a,Fr.toPairs=ka,Fr.toPairsIn=Fa,Fr.toPath=function(t){return Wo(t)?De(t,Us):la(t)?[t]:wi(xs(va(t)))},Fr.toPlainObject=Ea,Fr.transform=function(t,e,r){var n=Wo(t),i=n||Zo(t)||ca(t);if(e=ls(e,4),null==r){var s=t&&t.constructor;r=i?n?new s:[]:ea(t)&&Qo(s)?Hr(Yt(t)):{}}return(i?Le:An)(t,(function(t,n,i){return e(r,t,n,i)})),r},Fr.unary=function(t){return So(t,1)},Fr.union=eo,Fr.unionBy=ro,Fr.unionWith=no,Fr.uniq=function(t){return t&&t.length?hi(t):[]},Fr.uniqBy=function(t,e){return t&&t.length?hi(t,ls(e,2)):[]},Fr.uniqWith=function(e,r){return r="function"==typeof r?r:t,e&&e.length?hi(e,t,r):[]},Fr.unset=function(t,e){return null==t||fi(t,e)},Fr.unzip=io,Fr.unzipWith=so,Fr.update=function(t,e,r){return null==t?t:_i(t,e,vi(r))},Fr.updateWith=function(e,r,n,i){return i="function"==typeof i?i:t,null==e?e:_i(e,r,vi(n),i)},Fr.values=Ha,Fr.valuesIn=function(t){return null==t?[]:Je(t,Ma(t))},Fr.without=oo,Fr.words=Qa,Fr.wrap=function(t,e){return Go(vi(e),t)},Fr.xor=ao,Fr.xorBy=uo,Fr.xorWith=lo,Fr.zip=co,Fr.zipObject=function(t,e){return mi(t||[],e||[],en)},Fr.zipObjectDeep=function(t,e){return mi(t||[],e||[],ti)},Fr.zipWith=ho,Fr.entries=ka,Fr.entriesIn=Fa,Fr.extend=Aa,Fr.extendWith=ba,uu(Fr,Fr),Fr.add=vu,Fr.attempt=Ja,Fr.camelCase=ja,Fr.capitalize=Va,Fr.ceil=yu,Fr.clamp=function(e,r,n){return n===t&&(n=r,r=t),n!==t&&(n=(n=ma(n))==n?n:0),r!==t&&(r=(r=ma(r))==r?r:0),un(ma(e),r,n)},Fr.clone=function(t){return ln(t,4)},Fr.cloneDeep=function(t){return ln(t,5)},Fr.cloneDeepWith=function(e,r){return ln(e,5,r="function"==typeof r?r:t)},Fr.cloneWith=function(e,r){return ln(e,4,r="function"==typeof r?r:t)},Fr.conformsTo=function(t,e){return null==e||cn(t,e,Da(e))},Fr.deburr=za,Fr.defaultTo=function(t,e){return null==t||t!=t?e:t},Fr.divide=Au,Fr.endsWith=function(e,r,n){e=va(e),r=ci(r);var i=e.length,s=n=n===t?i:un(ga(n),0,i);return(n-=r.length)>=0&&e.slice(n,s)==r},Fr.eq=Ho,Fr.escape=function(t){return(t=va(t))&&X.test(t)?t.replace(K,ir):t},Fr.escapeRegExp=function(t){return(t=va(t))&&rt.test(t)?t.replace(et,"\\$&"):t},Fr.every=function(e,r,n){var i=Wo(e)?Se:gn;return n&&ys(e,r,n)&&(r=t),i(e,ls(r,3))},Fr.find=mo,Fr.findIndex=Vs,Fr.findKey=function(t,e){return Ge(t,ls(e,3),An)},Fr.findLast=Eo,Fr.findLastIndex=zs,Fr.findLastKey=function(t,e){return Ge(t,ls(e,3),bn)},Fr.floor=bu,Fr.forEach=vo,Fr.forEachRight=yo,Fr.forIn=function(t,e){return null==t?t:vn(t,ls(e,3),Ma)},Fr.forInRight=function(t,e){return null==t?t:yn(t,ls(e,3),Ma)},Fr.forOwn=function(t,e){return t&&An(t,ls(e,3))},Fr.forOwnRight=function(t,e){return t&&bn(t,ls(e,3))},Fr.get=Oa,Fr.gt=jo,Fr.gte=Vo,Fr.has=function(t,e){return null!=t&&ds(t,e,Sn)},Fr.hasIn=Sa,Fr.head=Ks,Fr.identity=iu,Fr.includes=function(t,e,r,n){t=Yo(t)?t:Ha(t),r=r&&!n?ga(r):0;var i=t.length;return r<0&&(r=Er(i+r,0)),ua(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&Fe(t,e,r)>-1},Fr.indexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:ga(r);return i<0&&(i=Er(n+i,0)),Fe(t,e,i)},Fr.inRange=function(e,r,n){return r=pa(r),n===t?(n=r,r=0):n=pa(n),function(t,e,r){return t>=vr(e,r)&&t=-9007199254740991&&t<=h},Fr.isSet=aa,Fr.isString=ua,Fr.isSymbol=la,Fr.isTypedArray=ca,Fr.isUndefined=function(e){return e===t},Fr.isWeakMap=function(t){return ra(t)&&gs(t)==w},Fr.isWeakSet=function(t){return ra(t)&&"[object WeakSet]"==Ln(t)},Fr.join=function(t,e){return null==t?"":Ye.call(t,e)},Fr.kebabCase=Wa,Fr.last=qs,Fr.lastIndexOf=function(e,r,n){var i=null==e?0:e.length;if(!i)return-1;var s=i;return n!==t&&(s=(s=ga(n))<0?Er(i+s,0):vr(s,i-1)),r==r?function(t,e,r){for(var n=r+1;n--;)if(t[n]===e)return n;return n}(e,r,s):ke(e,ze,s,!0)},Fr.lowerCase=Ka,Fr.lowerFirst=Ya,Fr.lt=ha,Fr.lte=fa,Fr.max=function(e){return e&&e.length?dn(e,iu,On):t},Fr.maxBy=function(e,r){return e&&e.length?dn(e,ls(r,2),On):t},Fr.mean=function(t){return We(t,iu)},Fr.meanBy=function(t,e){return We(t,ls(e,2))},Fr.min=function(e){return e&&e.length?dn(e,iu,kn):t},Fr.minBy=function(e,r){return e&&e.length?dn(e,ls(r,2),kn):t},Fr.stubArray=du,Fr.stubFalse=mu,Fr.stubObject=function(){return{}},Fr.stubString=function(){return""},Fr.stubTrue=function(){return!0},Fr.multiply=Ru,Fr.nth=function(e,r){return e&&e.length?zn(e,ga(r)):t},Fr.noConflict=function(){return fe._===this&&(fe._=Ht),this},Fr.noop=lu,Fr.now=Oo,Fr.pad=function(t,e,r){t=va(t);var n=(e=ga(e))?fr(t):0;if(!e||n>=e)return t;var i=(e-n)/2;return Wi(me(i),r)+t+Wi(de(i),r)},Fr.padEnd=function(t,e,r){t=va(t);var n=(e=ga(e))?fr(t):0;return e&&nr){var i=e;e=r,r=i}if(n||e%1||r%1){var s=br();return vr(e+s*(r-e+ue("1e-"+((s+"").length-1))),r)}return Zn(e,r)},Fr.reduce=function(t,e,r){var n=Wo(t)?Be:Xe,i=arguments.length<3;return n(t,ls(e,4),r,i,_n)},Fr.reduceRight=function(t,e,r){var n=Wo(t)?Pe:Xe,i=arguments.length<3;return n(t,ls(e,4),r,i,pn)},Fr.repeat=function(e,r,n){return r=(n?ys(e,r,n):r===t)?1:ga(r),qn(va(e),r)},Fr.replace=function(){var t=arguments,e=va(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Fr.result=function(e,r,n){var i=-1,s=(r=yi(r,e)).length;for(s||(s=1,e=t);++ih)return[];var r=_,n=vr(t,_);e=ls(e),t-=_;for(var i=qe(n,e);++r=o)return e;var u=n-fr(i);if(u<1)return i;var l=a?bi(a,0,u).join(""):e.slice(0,u);if(s===t)return l+i;if(a&&(u+=l.length-u),oa(s)){if(e.slice(u).search(s)){var c,h=l;for(s.global||(s=St(s.source,va(ft.exec(s))+"g")),s.lastIndex=0;c=s.exec(h);)var f=c.index;l=l.slice(0,f===t?u:f)}}else if(e.indexOf(ci(s),u)!=u){var _=l.lastIndexOf(s);_>-1&&(l=l.slice(0,_))}return l+i},Fr.unescape=function(t){return(t=va(t))&&Y.test(t)?t.replace(W,gr):t},Fr.uniqueId=function(t){var e=++Ut;return va(t)+e},Fr.upperCase=qa,Fr.upperFirst=$a,Fr.each=vo,Fr.eachRight=yo,Fr.first=Ks,uu(Fr,(Eu={},An(Fr,(function(t,e){xt.call(Fr.prototype,e)||(Eu[e]=t)})),Eu),{chain:!1}),Fr.VERSION="4.17.21",Le(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Fr[t].placeholder=Fr})),Le(["drop","take"],(function(e,r){zr.prototype[e]=function(n){n=n===t?1:Er(ga(n),0);var i=this.__filtered__&&!r?new zr(this):this.clone();return i.__filtered__?i.__takeCount__=vr(n,i.__takeCount__):i.__views__.push({size:vr(n,_),type:e+(i.__dir__<0?"Right":"")}),i},zr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Le(["filter","map","takeWhile"],(function(t,e){var r=e+1,n=1==r||3==r;zr.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:ls(t,3),type:r}),e.__filtered__=e.__filtered__||n,e}})),Le(["head","last"],(function(t,e){var r="take"+(e?"Right":"");zr.prototype[t]=function(){return this[r](1).value()[0]}})),Le(["initial","tail"],(function(t,e){var r="drop"+(e?"":"Right");zr.prototype[t]=function(){return this.__filtered__?new zr(this):this[r](1)}})),zr.prototype.compact=function(){return this.filter(iu)},zr.prototype.find=function(t){return this.filter(t).head()},zr.prototype.findLast=function(t){return this.reverse().find(t)},zr.prototype.invokeMap=$n((function(t,e){return"function"==typeof t?new zr(this):this.map((function(r){return Cn(r,t,e)}))})),zr.prototype.reject=function(t){return this.filter(xo(ls(t)))},zr.prototype.slice=function(e,r){e=ga(e);var n=this;return n.__filtered__&&(e>0||r<0)?new zr(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),r!==t&&(n=(r=ga(r))<0?n.dropRight(-r):n.take(r-e)),n)},zr.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},zr.prototype.toArray=function(){return this.take(_)},An(zr.prototype,(function(e,r){var n=/^(?:filter|find|map|reject)|While$/.test(r),i=/^(?:head|last)$/.test(r),s=Fr[i?"take"+("last"==r?"Right":""):r],o=i||/^find/.test(r);s&&(Fr.prototype[r]=function(){var r=this.__wrapped__,a=i?[1]:arguments,u=r instanceof zr,l=a[0],c=u||Wo(r),h=function(t){var e=s.apply(Fr,Me([t],a));return i&&f?e[0]:e};c&&n&&"function"==typeof l&&1!=l.length&&(u=c=!1);var f=this.__chain__,_=!!this.__actions__.length,p=o&&!f,g=u&&!_;if(!o&&c){r=g?r:new zr(this);var d=e.apply(r,a);return d.__actions__.push({func:_o,args:[h],thisArg:t}),new Vr(d,f)}return p&&g?e.apply(this,a):(d=this.thru(h),p?i?d.value()[0]:d.value():d)})})),Le(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Ct[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);Fr.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var i=this.value();return e.apply(Wo(i)?i:[],t)}return this[r]((function(r){return e.apply(Wo(r)?r:[],t)}))}})),An(zr.prototype,(function(t,e){var r=Fr[e];if(r){var n=r.name+"";xt.call(Cr,n)||(Cr[n]=[]),Cr[n].push({name:e,func:r})}})),Cr[Hi(t,2).name]=[{name:"wrapper",func:t}],zr.prototype.clone=function(){var t=new zr(this.__wrapped__);return t.__actions__=wi(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=wi(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=wi(this.__views__),t},zr.prototype.reverse=function(){if(this.__filtered__){var t=new zr(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},zr.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=Wo(t),n=e<0,i=r?t.length:0,s=function(t,e,r){for(var n=-1,i=r.length;++n=this.__values__.length;return{done:e,value:e?t:this.__values__[this.__index__++]}},Fr.prototype.plant=function(e){for(var r,n=this;n instanceof jr;){var i=ks(n);i.__index__=0,i.__values__=t,r?s.__wrapped__=i:r=i;var s=i;n=n.__wrapped__}return s.__wrapped__=e,r},Fr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof zr){var r=e;return this.__actions__.length&&(r=new zr(this)),(r=r.reverse()).__actions__.push({func:_o,args:[to],thisArg:t}),new Vr(r,this.__chain__)}return this.thru(to)},Fr.prototype.toJSON=Fr.prototype.valueOf=Fr.prototype.value=function(){return gi(this.__wrapped__,this.__actions__)},Fr.prototype.first=Fr.prototype.head,ee&&(Fr.prototype[ee]=function(){return this}),Fr}();pe?((pe.exports=dr)._=dr,_e._=dr):fe._=dr}.call(s);var We=ze.exports;const Ke=1048576;var Ye;!function(t){t[t.INITIAL=0]="INITIAL",t[t.BUSY=1]="BUSY",t[t.WAIT_INPUT=2]="WAIT_INPUT",t[t.FREE=3]="FREE",t[t.STATIC_CHECK_FAILED=4]="STATIC_CHECK_FAILED",t[t.RUNTIME_ERROR=5]="RUNTIME_ERROR",t[t.MAX_STEP_REACHED=6]="MAX_STEP_REACHED",t[t.EXITED_NORMALLY=7]="EXITED_NORMALLY",t[t.EXITED_ABNORMALLY=8]="EXITED_ABNORMALLY",t[t.CLOSED=9]="CLOSED"}(Ye||(Ye={}));const Xe={instructions:[],text:[],memory:new Uint8Array},Ze={total:0,stack:0,globalVariable:0},qe={mainFunctionAddressBefore:-1,globalVariableTable:{},variableTableStack:[],assignCallLValueStack:[]},$e={stepCount:0,timeElapsed:0,state:Ye.INITIAL,callStack:[],staticErrors:[],runtimeErrors:[]};var Qe;!function(t){t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.WARNING=2]="WARNING",t[t.INPUT=3]="INPUT",t[t.OUTPUT=4]="OUTPUT",t[t.PROMPT=5]="PROMPT",t[t.ARROW=6]="ARROW"}(Qe||(Qe={}));const Je={maxExecutionStepCount:{min:0,max:999999999},memorySize:{min:1024,max:32*Ke},stackSize:{min:512,max:33553920}},tr={maxExecutionStepCount:5e6,memorySize:1572864,stackSize:1*Ke};const er=new f.ArgumentParser({description:"IR Virtual Machine CLI"});er.add_argument("irFile",{nargs:1,help:"path to IR file that will be run"}),er.add_argument("-p",{action:"store_true",dest:"prompt",help:"print input prompt to stdout"}),er.add_argument("-s",{action:"store_true",dest:"stepCount",help:"print machine-readable execution step count to stdout after execution finishes"}),er.add_argument("-t",{action:"store_true",dest:"timeElapsed",help:"print machine-readable execution time in milliseconds to stdout after execution finishes"}),er.add_argument("-r",{action:"store_true",dest:"summary",help:"print human-readable execution summary to stdout after execution finishes"}),er.add_argument("-l",{action:"store",dest:"locale",choices:["en","zh-cn"],default:"zh-cn",help:"CLI message locale, defaults to 'zh-cn'"});const rr=er.parse_args(),nr={dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}};let ir;if("en"===rr.locale)ir=Re({locale:"en",messages:Te[1].locale},nr);else ir=Re({locale:"zh-cn",messages:Te[0].locale},nr);const sr=e.createInterface({input:process.stdin});let or;try{or=t.readFileSync(rr.irFile[0],{encoding:"utf-8"})}catch(t){console.error(t),process.exit(1)}function ar(){ur.flushWriteBuffer((t=>{for(const e of t){let t=!1,r=!1;for(const n of e)switch(n.type){case Qe.OUTPUT:process.stdout.write(ir.formatMessage({id:n.key},n.values)),t=!0;break;case Qe.ERROR:process.stderr.write(ir.formatMessage({id:n.key},n.values)),t=!0,r=!0;break;case Qe.SUCCESS:case Qe.WARNING:if(rr.summary){process.stdout.write(ir.formatMessage({id:n.key},n.values)),t=!0;break}}t&&(r?process.stderr:process.stdout).write("\n")}}))}const ur=new class{initialRegisters={eax:0,ebx:0,ecx:0,edx:0,ebp:0,esp:tr.memorySize,eip:0};decoder=new He;memory=We.cloneDeep(Xe);registers=We.cloneDeep(this.initialRegisters);tables=We.cloneDeep(qe);executionStatus=We.cloneDeep($e);peakMemoryUsage=We.cloneDeep(Ze);options=We.cloneDeep(tr);executionStartTime=new Date;writeBuffer=[];readConsole=()=>Promise.resolve("");entryFunctionName="main";setReadConsoleFn(t){this.readConsole=t}getSingleVariableValues(t){const e=[];for(let r=t.address;r=this.memory.text.length?-1:this.memory.text[this.registers.eip].lineNumber}get instructions(){return this.memory.instructions}get globalVariableDetails(){return this.getSingleTableVariableDetails(this.tables.globalVariableTable)}get localVariableDetailsStack(){const t=[];for(let e=0;e(t=Math.max(t,e.min),t=Math.min(t,e.max));void 0!==t.maxExecutionStepCount&&(t.maxExecutionStepCount=e(t.maxExecutionStepCount,Je.maxExecutionStepCount),this.options.maxExecutionStepCount=t.maxExecutionStepCount),void 0!==t.memorySize&&(t.memorySize=e(t.memorySize,Je.memorySize),t.memorySize=e(t.memorySize,{min:this.options.stackSize,max:Je.memorySize.max}),this.options.memorySize=t.memorySize,this.initialRegisters.esp=Le(t.memorySize),this.registers.esp=Le(t.memorySize),this.updatePeakMemoryUsage()),void 0!==t.stackSize&&(t.stackSize=e(t.stackSize,Je.stackSize),t.stackSize=e(t.stackSize,{min:Je.stackSize.min,max:this.options.memorySize}),this.options.stackSize=t.stackSize)}reset(){this.memory.text=[],this.memory.memory=new Uint8Array,this.registers=We.cloneDeep(this.initialRegisters),this.tables=We.cloneDeep(qe),this.executionStatus=We.cloneDeep($e),this.peakMemoryUsage=We.cloneDeep(Ze),this.writeBuffer=[]}close(){this.executionStatus.state=Ye.CLOSED}loadNewInstructions(t){this.reset(),this.memory.instructions=t}loadAndDecodeNewInstructions(t){this.loadNewInstructions(t),this.decodeInstructions(!0)}decodeInstructions(t){const e=new Map,r=new Map;for(let n=0;nr.length?we.OUT_OF_BOUND:(r[e]=255&t,r[e+1]=(65280&t)>>>8,r[e+2]=(16711680&t)>>>16,r[e+3]=(4278190080&t)>>>24,we.SUCCESS)}(t,e,this.memory.memory);return r!==we.OUT_OF_BOUND||(this.writeRuntimeError({key:"MEMORY_WRITE_OUT_OF_BOUND",values:{address:e}}),!1)}pushl(t){return this.checkStackSize(4)?(this.registers.esp=Se(this.registers.esp,4),this.updatePeakMemoryUsage(),!!this.storeMemory32(t,this.registers.esp)):(this.writeRuntimeError({key:"STACK_OVERFLOW"}),!1)}popl(){const t=this.loadMemory32(this.registers.esp);return null===t?null:(this.registers.esp=Oe(this.registers.esp,4),this.updatePeakMemoryUsage(),t)}getVariableById(t,e){return 0===this.tables.variableTableStack.length?(this.writeRuntimeError({key:"EMPTY_VARIABLE_TABLE_STACK"}),null):t in this.tables.variableTableStack[this.tables.variableTableStack.length-1]?this.tables.variableTableStack[this.tables.variableTableStack.length-1][t]:t in this.tables.globalVariableTable?this.tables.globalVariableTable[t]:(e&&this.writeRuntimeError({key:"VARIABLE_NOT_FOUND",values:{id:t}}),null)}getSingularValue(t){if(t.type===Ce.IMM)return t.imm;{const e=this.getVariableById(t.id,!0);if(null===e)return null;if(t.type===Ce.ADDRESS_ID)return e.address;const r=this.loadMemory32(e.address);if(null===r)return null;if(t.type===Ce.ID)return r;const n=this.loadMemory32(r);return null===n?null:n}}getRValue(t){switch(t.type){case Pe.SINGULAR:return this.getSingularValue(t.singular);case Pe.BINARY_MATH_OP:{const e=this.getSingularValue(t.singularL);if(null===e)return null;const r=this.getSingularValue(t.singularR);if(null===r)return null;switch(t.binaryMathOp){case De.ADD:return Oe(e,r);case De.SUB:return Se(e,r);case De.MUL:return function(t,e){const r=65535&t,n=65535&e;return Le((((4294901760&t)>>>16)*n+r*((4294901760&e)>>>16)<<16)+r*n)}(e,r);case De.DIV:return 0===r?(this.writeRuntimeError({key:"DIVIDE_BY_ZERO"}),null):Le(e/r)}}}}createStackVariable(t,e){if(!this.checkStackSize(e))return this.writeRuntimeError({key:"STACK_OVERFLOW"}),null;this.registers.esp=Se(this.registers.esp,e),this.updatePeakMemoryUsage();const r={address:this.registers.esp,size:e,lineNumber:this.memory.text[this.registers.eip].lineNumber};return 0===this.tables.variableTableStack.length?(this.writeRuntimeError({key:"EMPTY_VARIABLE_TABLE_STACK"}),null):t in this.tables.variableTableStack[this.tables.variableTableStack.length-1]?(this.writeRuntimeError({key:"DUPLICATE_DEC_ID",values:{id:t,lastLineNumber:this.tables.variableTableStack[this.tables.variableTableStack.length-1][t].lineNumber}}),null):(this.tables.variableTableStack[this.tables.variableTableStack.length-1][t]=r,r)}getLValueAddress(t){let e=this.getVariableById(t.id,t.type===Be.DEREF_ID);if(null===e){if(t.type!==Be.ID)return null;if(e=this.createStackVariable(t.id,4),null===e)return null}let r=e.address;if(t.type===Be.DEREF_ID){const t=this.loadMemory32(e.address);if(null===t)return null;r=t}return r}getCondValue(t){const e=this.getSingularValue(t.singularL);if(null===e)return null;const r=this.getSingularValue(t.singularR);if(null===r)return null;switch(t.binaryRelOp){case Me.EQ:return e===r;case Me.NE:return e!==r;case Me.LT:return er;case Me.GE:return e>=r}}async execute(t){do{if(this.executionStatus.state!==Ye.EXITED_NORMALLY&&this.executionStatus.state!==Ye.EXITED_ABNORMALLY&&this.executionStatus.state!==Ye.INITIAL||(this.reset(),this.prepareExcution()),this.executionStatus.state!==Ye.FREE)return;if(this.executionStatus.state=Ye.BUSY,this.options.maxExecutionStepCount>0&&this.executionStatus.stepCount>=this.options.maxExecutionStepCount)return this.executionStatus.state=Ye.MAX_STEP_REACHED,void this.writeBuffer.push([{key:"MAX_STEP_REACHED",values:{maxExecutionStepCount:this.options.maxExecutionStepCount},type:Qe.ERROR}]);if(this.registers.eip>=this.memory.text.length||this.registers.eip<0)return this.executionStatus.state=Ye.RUNTIME_ERROR,void this.writeBuffer.push([{key:"RUNTIME_ERROR_PREFIX_NO_LN",type:Qe.ERROR},{key:"INSTRUCTION_READ_OUT_OF_BOUND",values:{address:this.registers.eip},type:Qe.ERROR}]);this.executionStatus.stepCount++;const t=this.memory.text[this.registers.eip];switch(t.type){case Ue.ARG:{const e=this.getSingularValue(t.value.value);if(null===e||!this.pushl(e))return;this.registers.ecx=Oe(this.registers.ecx,4);break}case Ue.ASSIGN:{const e=this.getRValue(t.value.rValue);if(null===e)return;const r=this.getLValueAddress(t.value.lValue);if(null===r)return;if(!this.storeMemory32(e,r))return;break}case Ue.ASSIGN_CALL:case Ue.CALL:{const e=t.type===Ue.CALL?t.value.id:t.value.functionId;if(this.registers.ebx=this.registers.esp,!this.pushl(this.registers.ecx))return;if(this.registers.ecx=0,!this.pushl(this.registers.eip))return;if(!this.pushl(this.registers.ebp))return;this.registers.ebp=this.registers.esp,t.type===Ue.ASSIGN_CALL?this.tables.assignCallLValueStack.push(t.value.lValue):this.tables.assignCallLValueStack.push(null),this.tables.variableTableStack.push({}),this.executionStatus.callStack.push(e),this.registers.eip=t.value.functionAddressBefore;break}case Ue.DEC:if(null===this.createStackVariable(t.value.id,t.value.size))return;break;case Ue.GOTO:this.registers.eip=t.value.gotoAddressBefore;break;case Ue.IF:{const e=this.getCondValue(t.value.condition);if(null===e)return;e&&(this.registers.eip=t.value.gotoAddressBefore);break}case Ue.PARAM:{const e=t.value.id;if(e in this.tables.variableTableStack[this.tables.variableTableStack.length-1])return void this.writeRuntimeError({key:"DUPLICATE_PARAM_ID",values:{id:e,lastLineNumber:this.tables.variableTableStack[this.tables.variableTableStack.length-1][e].lineNumber}});if(null===this.loadMemory32(this.registers.ebx))return;this.tables.variableTableStack[this.tables.variableTableStack.length-1][e]={address:this.registers.ebx,size:4,lineNumber:t.lineNumber},this.registers.ebx=Oe(this.registers.ebx,4);break}case Ue.RETURN:{const e=this.getSingularValue(t.value.value);if(null===e)return;this.registers.eax=e,this.registers.esp=this.registers.ebp,this.updatePeakMemoryUsage();const r=this.popl();if(null===r)return;this.registers.ebp=r;const n=this.popl();if(null===n)return;this.registers.eip=n;const i=this.popl();if(null===i)return;if(this.registers.esp=Oe(this.registers.esp,i),this.updatePeakMemoryUsage(),this.registers.ecx=0,0===this.tables.variableTableStack.length)return void this.writeRuntimeError({key:"EMPTY_VARIABLE_TABLE_STACK"});if(this.executionStatus.callStack.pop(),this.tables.variableTableStack.pop(),this.registers.eip===this.memory.text.length)return void this.finalizeExcution();const s=this.tables.assignCallLValueStack.pop();if(null!==s){const t=this.getLValueAddress(s);if(null===t)return;if(!this.storeMemory32(this.registers.eax,t))return}break}case Ue.READ:{const e=t.value,r=this.getLValueAddress(e.lValue);if(null===r)return;const n=e.lValue.type===Be.ID?e.lValue.id:"*"+e.lValue.id;this.executionStatus.state=Ye.WAIT_INPUT;const i=await this.readConsole([{key:"READ_PROMPT",values:{name:n}}]);if(this.state!==Ye.WAIT_INPUT)return;this.executionStatus.state=Ye.BUSY;const s=parseInt(i);if(isNaN(s))return void this.writeRuntimeError({key:"INPUT_INT_ILLEGAL"});if(!Number.isSafeInteger(s))return void this.writeRuntimeError({key:"INPUT_INT_ABS_TOO_LARGE"});if(!this.storeMemory32(Le(s),r))return;break}case Ue.WRITE:{const e=this.getSingularValue(t.value.value);if(null===e)return;this.writeBuffer.push([{key:"WRITE_OUTPUT",values:{value:e},type:Qe.OUTPUT}]);break}}for(this.registers.eip=Oe(this.registers.eip,1);this.registers.eip=0&&this.memory.text[this.registers.eip].type===Ue.GLOBAL_DEC;)this.registers.eip=Oe(this.registers.eip,1);this.executionStatus.state=Ye.FREE}while(t)}async executeSingleStep(){await this.execute(!1)}async executeContinuously(){await this.execute(!0)}};ur.configure({maxExecutionStepCount:0,memorySize:32*Ke,stackSize:31*Ke});const lr=[];let cr=0,hr=null;sr.on("line",(t=>{const e=t.trim().split(/\s/).filter((t=>t.length>0));lr.push(...e),null!==hr&&cr(ar(),rr.prompt&&console.log(t.reduce(((t,e)=>t+ir.formatMessage({id:e.key},e.values)),"")),cr{hr=t}))))),ur.loadNewInstructions(or.split(/\r\n|[\r\n]/)),await ur.executeContinuously(),ar(),rr.stepCount&&console.log(ur.stepCount),rr.timeElapsed&&console.log(ur.timeElapsed);const fr=ur.state;switch(ur.close(),fr){case Ye.EXITED_NORMALLY:process.exit(0);case Ye.EXITED_ABNORMALLY:process.exit(ur.returnValue);case Ye.STATIC_CHECK_FAILED:case Ye.RUNTIME_ERROR:process.exit(1)} + */je=ze,Ve=ze.exports,function(){var t,e="Expected a function",r="__lodash_hash_undefined__",n="__lodash_placeholder__",i=16,o=32,a=64,u=128,l=256,c=1/0,h=9007199254740991,f=NaN,_=4294967295,p=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",i],["flip",512],["partial",o],["partialRight",a],["rearg",l]],g="[object Arguments]",d="[object Array]",m="[object Boolean]",E="[object Date]",v="[object Error]",y="[object Function]",A="[object GeneratorFunction]",b="[object Map]",R="[object Number]",T="[object Object]",I="[object Promise]",L="[object RegExp]",O="[object Set]",S="[object String]",N="[object Symbol]",w="[object WeakMap]",C="[object ArrayBuffer]",D="[object DataView]",M="[object Float32Array]",B="[object Float64Array]",P="[object Int8Array]",x="[object Int16Array]",U="[object Int32Array]",G="[object Uint8Array]",k="[object Uint8ClampedArray]",F="[object Uint16Array]",H="[object Uint32Array]",j=/\b__p \+= '';/g,V=/\b(__p \+=) '' \+/g,z=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,K=/[&<>"']/g,Y=RegExp(W.source),X=RegExp(K.source),Z=/<%-([\s\S]+?)%>/g,q=/<%([\s\S]+?)%>/g,$=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,J=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/[\\^$.*+?()[\]{}|]/g,rt=RegExp(et.source),nt=/^\s+/,it=/\s/,st=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ot=/\{\n\/\* \[wrapped with (.+)\] \*/,at=/,? & /,ut=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,lt=/[()=,{}\[\]\/\s]/,ct=/\\(\\)?/g,ht=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ft=/\w*$/,_t=/^[-+]0x[0-9a-f]+$/i,pt=/^0b[01]+$/i,gt=/^\[object .+?Constructor\]$/,dt=/^0o[0-7]+$/i,mt=/^(?:0|[1-9]\d*)$/,Et=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,vt=/($^)/,yt=/['\n\r\u2028\u2029\\]/g,At="\\ud800-\\udfff",bt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Rt="\\u2700-\\u27bf",Tt="a-z\\xdf-\\xf6\\xf8-\\xff",It="A-Z\\xc0-\\xd6\\xd8-\\xde",Lt="\\ufe0e\\ufe0f",Ot="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",St="['’]",Nt="["+At+"]",wt="["+Ot+"]",Ct="["+bt+"]",Dt="\\d+",Mt="["+Rt+"]",Bt="["+Tt+"]",Pt="[^"+At+Ot+Dt+Rt+Tt+It+"]",xt="\\ud83c[\\udffb-\\udfff]",Ut="[^"+At+"]",Gt="(?:\\ud83c[\\udde6-\\uddff]){2}",kt="[\\ud800-\\udbff][\\udc00-\\udfff]",Ft="["+It+"]",Ht="\\u200d",jt="(?:"+Bt+"|"+Pt+")",Vt="(?:"+Ft+"|"+Pt+")",zt="(?:['’](?:d|ll|m|re|s|t|ve))?",Wt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Kt="(?:"+Ct+"|"+xt+")?",Yt="["+Lt+"]?",Xt=Yt+Kt+"(?:"+Ht+"(?:"+[Ut,Gt,kt].join("|")+")"+Yt+Kt+")*",Zt="(?:"+[Mt,Gt,kt].join("|")+")"+Xt,qt="(?:"+[Ut+Ct+"?",Ct,Gt,kt,Nt].join("|")+")",$t=RegExp(St,"g"),Qt=RegExp(Ct,"g"),Jt=RegExp(xt+"(?="+xt+")|"+qt+Xt,"g"),te=RegExp([Ft+"?"+Bt+"+"+zt+"(?="+[wt,Ft,"$"].join("|")+")",Vt+"+"+Wt+"(?="+[wt,Ft+jt,"$"].join("|")+")",Ft+"?"+jt+"+"+zt,Ft+"+"+Wt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Dt,Zt].join("|"),"g"),ee=RegExp("["+Ht+At+bt+Lt+"]"),re=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ne=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ie=-1,se={};se[M]=se[B]=se[P]=se[x]=se[U]=se[G]=se[k]=se[F]=se[H]=!0,se[g]=se[d]=se[C]=se[m]=se[D]=se[E]=se[v]=se[y]=se[b]=se[R]=se[T]=se[L]=se[O]=se[S]=se[w]=!1;var oe={};oe[g]=oe[d]=oe[C]=oe[D]=oe[m]=oe[E]=oe[M]=oe[B]=oe[P]=oe[x]=oe[U]=oe[b]=oe[R]=oe[T]=oe[L]=oe[O]=oe[S]=oe[N]=oe[G]=oe[k]=oe[F]=oe[H]=!0,oe[v]=oe[y]=oe[w]=!1;var ae={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ue=parseFloat,le=parseInt,ce="object"==typeof s&&s&&s.Object===Object&&s,he="object"==typeof self&&self&&self.Object===Object&&self,fe=ce||he||Function("return this")(),_e=Ve&&!Ve.nodeType&&Ve,pe=_e&&je&&!je.nodeType&&je,ge=pe&&pe.exports===_e,de=ge&&ce.process,me=function(){try{var t=pe&&pe.require&&pe.require("util").types;return t||de&&de.binding&&de.binding("util")}catch(t){}}(),Ee=me&&me.isArrayBuffer,ve=me&&me.isDate,ye=me&&me.isMap,Ae=me&&me.isRegExp,be=me&&me.isSet,Re=me&&me.isTypedArray;function Te(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Ie(t,e,r,n){for(var i=-1,s=null==t?0:t.length;++i-1}function Ce(t,e,r){for(var n=-1,i=null==t?0:t.length;++n-1;);return r}function rr(t,e){for(var r=t.length;r--&&Fe(e,t[r],0)>-1;);return r}var nr=Ye({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),ir=Ye({"&":"&","<":"<",">":">",'"':""","'":"'"});function sr(t){return"\\"+ae[t]}function or(t){return ee.test(t)}function ar(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function ur(t,e){return function(r){return t(e(r))}}function lr(t,e){for(var r=-1,i=t.length,s=0,o=[];++r",""":'"',"'":"'"}),dr=function s(it){var At,bt=(it=null==it?fe:dr.defaults(fe.Object(),it,dr.pick(fe,ne))).Array,Rt=it.Date,Tt=it.Error,It=it.Function,Lt=it.Math,Ot=it.Object,St=it.RegExp,Nt=it.String,wt=it.TypeError,Ct=bt.prototype,Dt=It.prototype,Mt=Ot.prototype,Bt=it["__core-js_shared__"],Pt=Dt.toString,xt=Mt.hasOwnProperty,Ut=0,Gt=(At=/[^.]+$/.exec(Bt&&Bt.keys&&Bt.keys.IE_PROTO||""))?"Symbol(src)_1."+At:"",kt=Mt.toString,Ft=Pt.call(Ot),Ht=fe._,jt=St("^"+Pt.call(xt).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Vt=ge?it.Buffer:t,zt=it.Symbol,Wt=it.Uint8Array,Kt=Vt?Vt.allocUnsafe:t,Yt=ur(Ot.getPrototypeOf,Ot),Xt=Ot.create,Zt=Mt.propertyIsEnumerable,qt=Ct.splice,Jt=zt?zt.isConcatSpreadable:t,ee=zt?zt.iterator:t,ae=zt?zt.toStringTag:t,ce=function(){try{var t=fs(Ot,"defineProperty");return t({},"",{}),t}catch(t){}}(),he=it.clearTimeout!==fe.clearTimeout&&it.clearTimeout,_e=Rt&&Rt.now!==fe.Date.now&&Rt.now,pe=it.setTimeout!==fe.setTimeout&&it.setTimeout,de=Lt.ceil,me=Lt.floor,Ue=Ot.getOwnPropertySymbols,je=Vt?Vt.isBuffer:t,Ve=it.isFinite,Ye=Ct.join,mr=ur(Ot.keys,Ot),Er=Lt.max,vr=Lt.min,yr=Rt.now,Ar=it.parseInt,br=Lt.random,Rr=Ct.reverse,Tr=fs(it,"DataView"),Ir=fs(it,"Map"),Lr=fs(it,"Promise"),Or=fs(it,"Set"),Sr=fs(it,"WeakMap"),Nr=fs(Ot,"create"),wr=Sr&&new Sr,Cr={},Dr=Gs(Tr),Mr=Gs(Ir),Br=Gs(Lr),Pr=Gs(Or),xr=Gs(Sr),Ur=zt?zt.prototype:t,Gr=Ur?Ur.valueOf:t,kr=Ur?Ur.toString:t;function Fr(t){if(ra(t)&&!Wo(t)&&!(t instanceof zr)){if(t instanceof Vr)return t;if(xt.call(t,"__wrapped__"))return ks(t)}return new Vr(t)}var Hr=function(){function e(){}return function(r){if(!ea(r))return{};if(Xt)return Xt(r);e.prototype=r;var n=new e;return e.prototype=t,n}}();function jr(){}function Vr(e,r){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!r,this.__index__=0,this.__values__=t}function zr(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=_,this.__views__=[]}function Wr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e=r?e:r)),e}function ln(e,r,n,i,s,o){var a,u=1&r,l=2&r,c=4&r;if(n&&(a=s?n(e,i,s,o):n(e)),a!==t)return a;if(!ea(e))return e;var h=Wo(e);if(h){if(a=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&xt.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(e),!u)return wi(e,a)}else{var f=gs(e),_=f==y||f==A;if(Zo(e))return Ti(e,u);if(f==T||f==g||_&&!s){if(a=l||_?{}:ms(e),!u)return l?function(t,e){return Ci(t,ps(t),e)}(e,function(t,e){return t&&Ci(e,Ma(e),t)}(a,e)):function(t,e){return Ci(t,_s(t),e)}(e,sn(a,e))}else{if(!oe[f])return s?e:{};a=function(t,e,r){var n,i=t.constructor;switch(e){case C:return Ii(t);case m:case E:return new i(+t);case D:return function(t,e){var r=e?Ii(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case M:case B:case P:case x:case U:case G:case k:case F:case H:return Li(t,r);case b:return new i;case R:case S:return new i(t);case L:return function(t){var e=new t.constructor(t.source,ft.exec(t));return e.lastIndex=t.lastIndex,e}(t);case O:return new i;case N:return n=t,Gr?Ot(Gr.call(n)):{}}}(e,f,u)}}o||(o=new Zr);var p=o.get(e);if(p)return p;o.set(e,a),aa(e)?e.forEach((function(t){a.add(ln(t,r,n,t,e,o))})):na(e)&&e.forEach((function(t,i){a.set(i,ln(t,r,n,i,e,o))}));var d=h?t:(c?l?ss:is:l?Ma:Da)(e);return Le(d||e,(function(t,i){d&&(t=e[i=t]),en(a,i,ln(t,r,n,i,e,o))})),a}function cn(e,r,n){var i=n.length;if(null==e)return!i;for(e=Ot(e);i--;){var s=n[i],o=r[s],a=e[s];if(a===t&&!(s in e)||!o(a))return!1}return!0}function hn(r,n,i){if("function"!=typeof r)throw new wt(e);return Cs((function(){r.apply(t,i)}),n)}function fn(t,e,r,n){var i=-1,s=we,o=!0,a=t.length,u=[],l=e.length;if(!a)return u;r&&(e=De(e,Qe(r))),n?(s=Ce,o=!1):e.length>=200&&(s=tr,o=!1,e=new Xr(e));t:for(;++i-1},Kr.prototype.set=function(t,e){var r=this.__data__,n=rn(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},Yr.prototype.clear=function(){this.size=0,this.__data__={hash:new Wr,map:new(Ir||Kr),string:new Wr}},Yr.prototype.delete=function(t){var e=cs(this,t).delete(t);return this.size-=e?1:0,e},Yr.prototype.get=function(t){return cs(this,t).get(t)},Yr.prototype.has=function(t){return cs(this,t).has(t)},Yr.prototype.set=function(t,e){var r=cs(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},Xr.prototype.add=Xr.prototype.push=function(t){return this.__data__.set(t,r),this},Xr.prototype.has=function(t){return this.__data__.has(t)},Zr.prototype.clear=function(){this.__data__=new Kr,this.size=0},Zr.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Zr.prototype.get=function(t){return this.__data__.get(t)},Zr.prototype.has=function(t){return this.__data__.has(t)},Zr.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Kr){var n=r.__data__;if(!Ir||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Yr(n)}return r.set(t,e),this.size=r.size,this};var _n=Bi(An),pn=Bi(bn,!0);function gn(t,e){var r=!0;return _n(t,(function(t,n,i){return r=!!e(t,n,i)})),r}function dn(e,r,n){for(var i=-1,s=e.length;++i0&&r(a)?e>1?En(a,e-1,r,n,i):Me(i,a):n||(i[i.length]=a)}return i}var vn=Pi(),yn=Pi(!0);function An(t,e){return t&&vn(t,e,Da)}function bn(t,e){return t&&yn(t,e,Da)}function Rn(t,e){return Ne(e,(function(e){return Qo(t[e])}))}function Tn(e,r){for(var n=0,i=(r=yi(r,e)).length;null!=e&&ne}function Sn(t,e){return null!=t&&xt.call(t,e)}function Nn(t,e){return null!=t&&e in Ot(t)}function wn(e,r,n){for(var i=n?Ce:we,s=e[0].length,o=e.length,a=o,u=bt(o),l=1/0,c=[];a--;){var h=e[a];a&&r&&(h=De(h,Qe(r))),l=vr(h.length,l),u[a]=!n&&(r||s>=120&&h.length>=120)?new Xr(a&&h):t}h=e[0];var f=-1,_=u[0];t:for(;++f=a?u:u*("desc"==r[n]?-1:1)}return t.index-e.index}(t,e,r)}))}function Kn(t,e,r){for(var n=-1,i=e.length,s={};++n-1;)a!==t&&qt.call(a,u,1),qt.call(t,u,1);return t}function Xn(t,e){for(var r=t?e.length:0,n=r-1;r--;){var i=e[r];if(r==n||i!==s){var s=i;vs(i)?qt.call(t,i,1):fi(t,i)}}return t}function Zn(t,e){return t+me(br()*(e-t+1))}function qn(t,e){var r="";if(!t||e<1||e>h)return r;do{e%2&&(r+=t),(e=me(e/2))&&(t+=t)}while(e);return r}function $n(t,e){return Ds(Os(t,e,iu),t+"")}function Qn(t){return $r(Ha(t))}function Jn(t,e){var r=Ha(t);return Ps(r,un(e,0,r.length))}function ti(e,r,n,i){if(!ea(e))return e;for(var s=-1,o=(r=yi(r,e)).length,a=o-1,u=e;null!=u&&++si?0:i+e),(r=r>i?i:r)<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var s=bt(i);++n>>1,o=t[s];null!==o&&!la(o)&&(r?o<=e:o=200){var l=e?null:qi(t);if(l)return cr(l);o=!1,i=tr,u=new Xr}else u=e?[]:a;t:for(;++n=i?e:ii(e,r,n)}var Ri=he||function(t){return fe.clearTimeout(t)};function Ti(t,e){if(e)return t.slice();var r=t.length,n=Kt?Kt(r):new t.constructor(r);return t.copy(n),n}function Ii(t){var e=new t.constructor(t.byteLength);return new Wt(e).set(new Wt(t)),e}function Li(t,e){var r=e?Ii(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Oi(e,r){if(e!==r){var n=e!==t,i=null===e,s=e==e,o=la(e),a=r!==t,u=null===r,l=r==r,c=la(r);if(!u&&!c&&!o&&e>r||o&&a&&l&&!u&&!c||i&&a&&l||!n&&l||!s)return 1;if(!i&&!o&&!c&&e1?n[s-1]:t,a=s>2?n[2]:t;for(o=e.length>3&&"function"==typeof o?(s--,o):t,a&&ys(n[0],n[1],a)&&(o=s<3?t:o,s=1),r=Ot(r);++i-1?s[o?r[a]:a]:t}}function Fi(r){return ns((function(n){var i=n.length,s=i,o=Vr.prototype.thru;for(r&&n.reverse();s--;){var a=n[s];if("function"!=typeof a)throw new wt(e);if(o&&!u&&"wrapper"==as(a))var u=new Vr([],!0)}for(s=u?s:i;++s1&&v.reverse(),f&&cu))return!1;var c=o.get(e),h=o.get(r);if(c&&h)return c==r&&h==e;var f=-1,_=!0,p=2&n?new Xr:t;for(o.set(e,r),o.set(r,e);++f-1&&t%1==0&&t1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(st,"{\n/* [wrapped with "+e+"] */\n")}(n,function(t,e){return Le(p,(function(r){var n="_."+r[0];e&r[1]&&!we(t,n)&&t.push(n)})),t.sort()}(function(t){var e=t.match(ot);return e?e[1].split(at):[]}(n),r)))}function Bs(e){var r=0,n=0;return function(){var i=yr(),s=16-(i-n);if(n=i,s>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(t,arguments)}}function Ps(e,r){var n=-1,i=e.length,s=i-1;for(r=r===t?i:r;++n1?e[r-1]:t;return n="function"==typeof n?(e.pop(),n):t,so(e,n)}));function fo(t){var e=Fr(t);return e.__chain__=!0,e}function _o(t,e){return e(t)}var po=ns((function(e){var r=e.length,n=r?e[0]:0,i=this.__wrapped__,s=function(t){return an(t,e)};return!(r>1||this.__actions__.length)&&i instanceof zr&&vs(n)?((i=i.slice(n,+n+(r?1:0))).__actions__.push({func:_o,args:[s],thisArg:t}),new Vr(i,this.__chain__).thru((function(e){return r&&!e.length&&e.push(t),e}))):this.thru(s)})),go=Di((function(t,e,r){xt.call(t,r)?++t[r]:on(t,r,1)})),mo=ki(Vs),Eo=ki(zs);function vo(t,e){return(Wo(t)?Le:_n)(t,ls(e,3))}function yo(t,e){return(Wo(t)?Oe:pn)(t,ls(e,3))}var Ao=Di((function(t,e,r){xt.call(t,r)?t[r].push(e):on(t,r,[e])})),bo=$n((function(t,e,r){var n=-1,i="function"==typeof e,s=Yo(t)?bt(t.length):[];return _n(t,(function(t){s[++n]=i?Te(e,t,r):Cn(t,e,r)})),s})),Ro=Di((function(t,e,r){on(t,r,e)}));function To(t,e){return(Wo(t)?De:Fn)(t,ls(e,3))}var Io=Di((function(t,e,r){t[r?0:1].push(e)}),(function(){return[[],[]]})),Lo=$n((function(t,e){if(null==t)return[];var r=e.length;return r>1&&ys(t,e[0],e[1])?e=[]:r>2&&ys(e[0],e[1],e[2])&&(e=[e[0]]),Wn(t,En(e,1),[])})),Oo=_e||function(){return fe.Date.now()};function So(e,r,n){return r=n?t:r,r=e&&null==r?e.length:r,Qi(e,u,t,t,t,t,r)}function No(r,n){var i;if("function"!=typeof n)throw new wt(e);return r=ga(r),function(){return--r>0&&(i=n.apply(this,arguments)),r<=1&&(n=t),i}}var wo=$n((function(t,e,r){var n=1;if(r.length){var i=lr(r,us(wo));n|=o}return Qi(t,n,e,r,i)})),Co=$n((function(t,e,r){var n=3;if(r.length){var i=lr(r,us(Co));n|=o}return Qi(e,n,t,r,i)}));function Do(r,n,i){var s,o,a,u,l,c,h=0,f=!1,_=!1,p=!0;if("function"!=typeof r)throw new wt(e);function g(e){var n=s,i=o;return s=o=t,h=e,u=r.apply(i,n)}function d(e){var r=e-c;return c===t||r>=n||r<0||_&&e-h>=a}function m(){var t=Oo();if(d(t))return E(t);l=Cs(m,function(t){var e=n-(t-c);return _?vr(e,a-(t-h)):e}(t))}function E(e){return l=t,p&&s?g(e):(s=o=t,u)}function v(){var e=Oo(),r=d(e);if(s=arguments,o=this,c=e,r){if(l===t)return function(t){return h=t,l=Cs(m,n),f?g(t):u}(c);if(_)return Ri(l),l=Cs(m,n),g(c)}return l===t&&(l=Cs(m,n)),u}return n=ma(n)||0,ea(i)&&(f=!!i.leading,a=(_="maxWait"in i)?Er(ma(i.maxWait)||0,n):a,p="trailing"in i?!!i.trailing:p),v.cancel=function(){l!==t&&Ri(l),h=0,s=c=o=l=t},v.flush=function(){return l===t?u:E(Oo())},v}var Mo=$n((function(t,e){return hn(t,1,e)})),Bo=$n((function(t,e,r){return hn(t,ma(e)||0,r)}));function Po(t,r){if("function"!=typeof t||null!=r&&"function"!=typeof r)throw new wt(e);var n=function(){var e=arguments,i=r?r.apply(this,e):e[0],s=n.cache;if(s.has(i))return s.get(i);var o=t.apply(this,e);return n.cache=s.set(i,o)||s,o};return n.cache=new(Po.Cache||Yr),n}function xo(t){if("function"!=typeof t)throw new wt(e);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Po.Cache=Yr;var Uo=Ai((function(t,e){var r=(e=1==e.length&&Wo(e[0])?De(e[0],Qe(ls())):De(En(e,1),Qe(ls()))).length;return $n((function(n){for(var i=-1,s=vr(n.length,r);++i=e})),zo=Dn(function(){return arguments}())?Dn:function(t){return ra(t)&&xt.call(t,"callee")&&!Zt.call(t,"callee")},Wo=bt.isArray,Ko=Ee?Qe(Ee):function(t){return ra(t)&&Ln(t)==C};function Yo(t){return null!=t&&ta(t.length)&&!Qo(t)}function Xo(t){return ra(t)&&Yo(t)}var Zo=je||mu,qo=ve?Qe(ve):function(t){return ra(t)&&Ln(t)==E};function $o(t){if(!ra(t))return!1;var e=Ln(t);return e==v||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!sa(t)}function Qo(t){if(!ea(t))return!1;var e=Ln(t);return e==y||e==A||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Jo(t){return"number"==typeof t&&t==ga(t)}function ta(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=h}function ea(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ra(t){return null!=t&&"object"==typeof t}var na=ye?Qe(ye):function(t){return ra(t)&&gs(t)==b};function ia(t){return"number"==typeof t||ra(t)&&Ln(t)==R}function sa(t){if(!ra(t)||Ln(t)!=T)return!1;var e=Yt(t);if(null===e)return!0;var r=xt.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&Pt.call(r)==Ft}var oa=Ae?Qe(Ae):function(t){return ra(t)&&Ln(t)==L},aa=be?Qe(be):function(t){return ra(t)&&gs(t)==O};function ua(t){return"string"==typeof t||!Wo(t)&&ra(t)&&Ln(t)==S}function la(t){return"symbol"==typeof t||ra(t)&&Ln(t)==N}var ca=Re?Qe(Re):function(t){return ra(t)&&ta(t.length)&&!!se[Ln(t)]},ha=Yi(kn),fa=Yi((function(t,e){return t<=e}));function _a(t){if(!t)return[];if(Yo(t))return ua(t)?_r(t):wi(t);if(ee&&t[ee])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[ee]());var e=gs(t);return(e==b?ar:e==O?cr:Ha)(t)}function pa(t){return t?(t=ma(t))===c||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ga(t){var e=pa(t),r=e%1;return e==e?r?e-r:e:0}function da(t){return t?un(ga(t),0,_):0}function ma(t){if("number"==typeof t)return t;if(la(t))return f;if(ea(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ea(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=$e(t);var r=pt.test(t);return r||dt.test(t)?le(t.slice(2),r?2:8):_t.test(t)?f:+t}function Ea(t){return Ci(t,Ma(t))}function va(t){return null==t?"":ci(t)}var ya=Mi((function(t,e){if(Ts(e)||Yo(e))Ci(e,Da(e),t);else for(var r in e)xt.call(e,r)&&en(t,r,e[r])})),Aa=Mi((function(t,e){Ci(e,Ma(e),t)})),ba=Mi((function(t,e,r,n){Ci(e,Ma(e),t,n)})),Ra=Mi((function(t,e,r,n){Ci(e,Da(e),t,n)})),Ta=ns(an),Ia=$n((function(e,r){e=Ot(e);var n=-1,i=r.length,s=i>2?r[2]:t;for(s&&ys(r[0],r[1],s)&&(i=1);++n1),e})),Ci(t,ss(t),r),n&&(r=ln(r,7,es));for(var i=e.length;i--;)fi(r,e[i]);return r})),Ua=ns((function(t,e){return null==t?{}:function(t,e){return Kn(t,e,(function(e,r){return Sa(t,r)}))}(t,e)}));function Ga(t,e){if(null==t)return{};var r=De(ss(t),(function(t){return[t]}));return e=ls(e),Kn(t,r,(function(t,r){return e(t,r[0])}))}var ka=$i(Da),Fa=$i(Ma);function Ha(t){return null==t?[]:Je(t,Da(t))}var ja=Ui((function(t,e,r){return e=e.toLowerCase(),t+(r?Va(e):e)}));function Va(t){return $a(va(t).toLowerCase())}function za(t){return(t=va(t))&&t.replace(Et,nr).replace(Qt,"")}var Wa=Ui((function(t,e,r){return t+(r?"-":"")+e.toLowerCase()})),Ka=Ui((function(t,e,r){return t+(r?" ":"")+e.toLowerCase()})),Ya=xi("toLowerCase"),Xa=Ui((function(t,e,r){return t+(r?"_":"")+e.toLowerCase()})),Za=Ui((function(t,e,r){return t+(r?" ":"")+$a(e)})),qa=Ui((function(t,e,r){return t+(r?" ":"")+e.toUpperCase()})),$a=xi("toUpperCase");function Qa(e,r,n){return e=va(e),(r=n?t:r)===t?function(t){return re.test(t)}(e)?function(t){return t.match(te)||[]}(e):function(t){return t.match(ut)||[]}(e):e.match(r)||[]}var Ja=$n((function(e,r){try{return Te(e,t,r)}catch(t){return $o(t)?t:new Tt(t)}})),tu=ns((function(t,e){return Le(e,(function(e){e=Us(e),on(t,e,wo(t[e],t))})),t}));function eu(t){return function(){return t}}var ru=Fi(),nu=Fi(!0);function iu(t){return t}function su(t){return xn("function"==typeof t?t:ln(t,1))}var ou=$n((function(t,e){return function(r){return Cn(r,t,e)}})),au=$n((function(t,e){return function(r){return Cn(t,r,e)}}));function uu(t,e,r){var n=Da(e),i=Rn(e,n);null!=r||ea(e)&&(i.length||!n.length)||(r=e,e=t,t=this,i=Rn(e,Da(e)));var s=!(ea(r)&&"chain"in r&&!r.chain),o=Qo(t);return Le(i,(function(r){var n=e[r];t[r]=n,o&&(t.prototype[r]=function(){var e=this.__chain__;if(s||e){var r=t(this.__wrapped__);return(r.__actions__=wi(this.__actions__)).push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}return n.apply(t,Me([this.value()],arguments))})})),t}function lu(){}var cu=zi(De),hu=zi(Se),fu=zi(xe);function _u(t){return As(t)?Ke(Us(t)):function(t){return function(e){return Tn(e,t)}}(t)}var pu=Ki(),gu=Ki(!0);function du(){return[]}function mu(){return!1}var Eu,vu=Vi((function(t,e){return t+e}),0),yu=Zi("ceil"),Au=Vi((function(t,e){return t/e}),1),bu=Zi("floor"),Ru=Vi((function(t,e){return t*e}),1),Tu=Zi("round"),Iu=Vi((function(t,e){return t-e}),0);return Fr.after=function(t,r){if("function"!=typeof r)throw new wt(e);return t=ga(t),function(){if(--t<1)return r.apply(this,arguments)}},Fr.ary=So,Fr.assign=ya,Fr.assignIn=Aa,Fr.assignInWith=ba,Fr.assignWith=Ra,Fr.at=Ta,Fr.before=No,Fr.bind=wo,Fr.bindAll=tu,Fr.bindKey=Co,Fr.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Wo(t)?t:[t]},Fr.chain=fo,Fr.chunk=function(e,r,n){r=(n?ys(e,r,n):r===t)?1:Er(ga(r),0);var i=null==e?0:e.length;if(!i||r<1)return[];for(var s=0,o=0,a=bt(de(i/r));ss?0:s+n),(i=i===t||i>s?s:ga(i))<0&&(i+=s),i=n>i?0:da(i);n>>0)?(e=va(e))&&("string"==typeof r||null!=r&&!oa(r))&&!(r=ci(r))&&or(e)?bi(_r(e),0,n):e.split(r,n):[]},Fr.spread=function(t,r){if("function"!=typeof t)throw new wt(e);return r=null==r?0:Er(ga(r),0),$n((function(e){var n=e[r],i=bi(e,0,r);return n&&Me(i,n),Te(t,this,i)}))},Fr.tail=function(t){var e=null==t?0:t.length;return e?ii(t,1,e):[]},Fr.take=function(e,r,n){return e&&e.length?ii(e,0,(r=n||r===t?1:ga(r))<0?0:r):[]},Fr.takeRight=function(e,r,n){var i=null==e?0:e.length;return i?ii(e,(r=i-(r=n||r===t?1:ga(r)))<0?0:r,i):[]},Fr.takeRightWhile=function(t,e){return t&&t.length?pi(t,ls(e,3),!1,!0):[]},Fr.takeWhile=function(t,e){return t&&t.length?pi(t,ls(e,3)):[]},Fr.tap=function(t,e){return e(t),t},Fr.throttle=function(t,r,n){var i=!0,s=!0;if("function"!=typeof t)throw new wt(e);return ea(n)&&(i="leading"in n?!!n.leading:i,s="trailing"in n?!!n.trailing:s),Do(t,r,{leading:i,maxWait:r,trailing:s})},Fr.thru=_o,Fr.toArray=_a,Fr.toPairs=ka,Fr.toPairsIn=Fa,Fr.toPath=function(t){return Wo(t)?De(t,Us):la(t)?[t]:wi(xs(va(t)))},Fr.toPlainObject=Ea,Fr.transform=function(t,e,r){var n=Wo(t),i=n||Zo(t)||ca(t);if(e=ls(e,4),null==r){var s=t&&t.constructor;r=i?n?new s:[]:ea(t)&&Qo(s)?Hr(Yt(t)):{}}return(i?Le:An)(t,(function(t,n,i){return e(r,t,n,i)})),r},Fr.unary=function(t){return So(t,1)},Fr.union=eo,Fr.unionBy=ro,Fr.unionWith=no,Fr.uniq=function(t){return t&&t.length?hi(t):[]},Fr.uniqBy=function(t,e){return t&&t.length?hi(t,ls(e,2)):[]},Fr.uniqWith=function(e,r){return r="function"==typeof r?r:t,e&&e.length?hi(e,t,r):[]},Fr.unset=function(t,e){return null==t||fi(t,e)},Fr.unzip=io,Fr.unzipWith=so,Fr.update=function(t,e,r){return null==t?t:_i(t,e,vi(r))},Fr.updateWith=function(e,r,n,i){return i="function"==typeof i?i:t,null==e?e:_i(e,r,vi(n),i)},Fr.values=Ha,Fr.valuesIn=function(t){return null==t?[]:Je(t,Ma(t))},Fr.without=oo,Fr.words=Qa,Fr.wrap=function(t,e){return Go(vi(e),t)},Fr.xor=ao,Fr.xorBy=uo,Fr.xorWith=lo,Fr.zip=co,Fr.zipObject=function(t,e){return mi(t||[],e||[],en)},Fr.zipObjectDeep=function(t,e){return mi(t||[],e||[],ti)},Fr.zipWith=ho,Fr.entries=ka,Fr.entriesIn=Fa,Fr.extend=Aa,Fr.extendWith=ba,uu(Fr,Fr),Fr.add=vu,Fr.attempt=Ja,Fr.camelCase=ja,Fr.capitalize=Va,Fr.ceil=yu,Fr.clamp=function(e,r,n){return n===t&&(n=r,r=t),n!==t&&(n=(n=ma(n))==n?n:0),r!==t&&(r=(r=ma(r))==r?r:0),un(ma(e),r,n)},Fr.clone=function(t){return ln(t,4)},Fr.cloneDeep=function(t){return ln(t,5)},Fr.cloneDeepWith=function(e,r){return ln(e,5,r="function"==typeof r?r:t)},Fr.cloneWith=function(e,r){return ln(e,4,r="function"==typeof r?r:t)},Fr.conformsTo=function(t,e){return null==e||cn(t,e,Da(e))},Fr.deburr=za,Fr.defaultTo=function(t,e){return null==t||t!=t?e:t},Fr.divide=Au,Fr.endsWith=function(e,r,n){e=va(e),r=ci(r);var i=e.length,s=n=n===t?i:un(ga(n),0,i);return(n-=r.length)>=0&&e.slice(n,s)==r},Fr.eq=Ho,Fr.escape=function(t){return(t=va(t))&&X.test(t)?t.replace(K,ir):t},Fr.escapeRegExp=function(t){return(t=va(t))&&rt.test(t)?t.replace(et,"\\$&"):t},Fr.every=function(e,r,n){var i=Wo(e)?Se:gn;return n&&ys(e,r,n)&&(r=t),i(e,ls(r,3))},Fr.find=mo,Fr.findIndex=Vs,Fr.findKey=function(t,e){return Ge(t,ls(e,3),An)},Fr.findLast=Eo,Fr.findLastIndex=zs,Fr.findLastKey=function(t,e){return Ge(t,ls(e,3),bn)},Fr.floor=bu,Fr.forEach=vo,Fr.forEachRight=yo,Fr.forIn=function(t,e){return null==t?t:vn(t,ls(e,3),Ma)},Fr.forInRight=function(t,e){return null==t?t:yn(t,ls(e,3),Ma)},Fr.forOwn=function(t,e){return t&&An(t,ls(e,3))},Fr.forOwnRight=function(t,e){return t&&bn(t,ls(e,3))},Fr.get=Oa,Fr.gt=jo,Fr.gte=Vo,Fr.has=function(t,e){return null!=t&&ds(t,e,Sn)},Fr.hasIn=Sa,Fr.head=Ks,Fr.identity=iu,Fr.includes=function(t,e,r,n){t=Yo(t)?t:Ha(t),r=r&&!n?ga(r):0;var i=t.length;return r<0&&(r=Er(i+r,0)),ua(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&Fe(t,e,r)>-1},Fr.indexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:ga(r);return i<0&&(i=Er(n+i,0)),Fe(t,e,i)},Fr.inRange=function(e,r,n){return r=pa(r),n===t?(n=r,r=0):n=pa(n),function(t,e,r){return t>=vr(e,r)&&t=-9007199254740991&&t<=h},Fr.isSet=aa,Fr.isString=ua,Fr.isSymbol=la,Fr.isTypedArray=ca,Fr.isUndefined=function(e){return e===t},Fr.isWeakMap=function(t){return ra(t)&&gs(t)==w},Fr.isWeakSet=function(t){return ra(t)&&"[object WeakSet]"==Ln(t)},Fr.join=function(t,e){return null==t?"":Ye.call(t,e)},Fr.kebabCase=Wa,Fr.last=qs,Fr.lastIndexOf=function(e,r,n){var i=null==e?0:e.length;if(!i)return-1;var s=i;return n!==t&&(s=(s=ga(n))<0?Er(i+s,0):vr(s,i-1)),r==r?function(t,e,r){for(var n=r+1;n--;)if(t[n]===e)return n;return n}(e,r,s):ke(e,ze,s,!0)},Fr.lowerCase=Ka,Fr.lowerFirst=Ya,Fr.lt=ha,Fr.lte=fa,Fr.max=function(e){return e&&e.length?dn(e,iu,On):t},Fr.maxBy=function(e,r){return e&&e.length?dn(e,ls(r,2),On):t},Fr.mean=function(t){return We(t,iu)},Fr.meanBy=function(t,e){return We(t,ls(e,2))},Fr.min=function(e){return e&&e.length?dn(e,iu,kn):t},Fr.minBy=function(e,r){return e&&e.length?dn(e,ls(r,2),kn):t},Fr.stubArray=du,Fr.stubFalse=mu,Fr.stubObject=function(){return{}},Fr.stubString=function(){return""},Fr.stubTrue=function(){return!0},Fr.multiply=Ru,Fr.nth=function(e,r){return e&&e.length?zn(e,ga(r)):t},Fr.noConflict=function(){return fe._===this&&(fe._=Ht),this},Fr.noop=lu,Fr.now=Oo,Fr.pad=function(t,e,r){t=va(t);var n=(e=ga(e))?fr(t):0;if(!e||n>=e)return t;var i=(e-n)/2;return Wi(me(i),r)+t+Wi(de(i),r)},Fr.padEnd=function(t,e,r){t=va(t);var n=(e=ga(e))?fr(t):0;return e&&nr){var i=e;e=r,r=i}if(n||e%1||r%1){var s=br();return vr(e+s*(r-e+ue("1e-"+((s+"").length-1))),r)}return Zn(e,r)},Fr.reduce=function(t,e,r){var n=Wo(t)?Be:Xe,i=arguments.length<3;return n(t,ls(e,4),r,i,_n)},Fr.reduceRight=function(t,e,r){var n=Wo(t)?Pe:Xe,i=arguments.length<3;return n(t,ls(e,4),r,i,pn)},Fr.repeat=function(e,r,n){return r=(n?ys(e,r,n):r===t)?1:ga(r),qn(va(e),r)},Fr.replace=function(){var t=arguments,e=va(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Fr.result=function(e,r,n){var i=-1,s=(r=yi(r,e)).length;for(s||(s=1,e=t);++ih)return[];var r=_,n=vr(t,_);e=ls(e),t-=_;for(var i=qe(n,e);++r=o)return e;var u=n-fr(i);if(u<1)return i;var l=a?bi(a,0,u).join(""):e.slice(0,u);if(s===t)return l+i;if(a&&(u+=l.length-u),oa(s)){if(e.slice(u).search(s)){var c,h=l;for(s.global||(s=St(s.source,va(ft.exec(s))+"g")),s.lastIndex=0;c=s.exec(h);)var f=c.index;l=l.slice(0,f===t?u:f)}}else if(e.indexOf(ci(s),u)!=u){var _=l.lastIndexOf(s);_>-1&&(l=l.slice(0,_))}return l+i},Fr.unescape=function(t){return(t=va(t))&&Y.test(t)?t.replace(W,gr):t},Fr.uniqueId=function(t){var e=++Ut;return va(t)+e},Fr.upperCase=qa,Fr.upperFirst=$a,Fr.each=vo,Fr.eachRight=yo,Fr.first=Ks,uu(Fr,(Eu={},An(Fr,(function(t,e){xt.call(Fr.prototype,e)||(Eu[e]=t)})),Eu),{chain:!1}),Fr.VERSION="4.17.21",Le(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Fr[t].placeholder=Fr})),Le(["drop","take"],(function(e,r){zr.prototype[e]=function(n){n=n===t?1:Er(ga(n),0);var i=this.__filtered__&&!r?new zr(this):this.clone();return i.__filtered__?i.__takeCount__=vr(n,i.__takeCount__):i.__views__.push({size:vr(n,_),type:e+(i.__dir__<0?"Right":"")}),i},zr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Le(["filter","map","takeWhile"],(function(t,e){var r=e+1,n=1==r||3==r;zr.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:ls(t,3),type:r}),e.__filtered__=e.__filtered__||n,e}})),Le(["head","last"],(function(t,e){var r="take"+(e?"Right":"");zr.prototype[t]=function(){return this[r](1).value()[0]}})),Le(["initial","tail"],(function(t,e){var r="drop"+(e?"":"Right");zr.prototype[t]=function(){return this.__filtered__?new zr(this):this[r](1)}})),zr.prototype.compact=function(){return this.filter(iu)},zr.prototype.find=function(t){return this.filter(t).head()},zr.prototype.findLast=function(t){return this.reverse().find(t)},zr.prototype.invokeMap=$n((function(t,e){return"function"==typeof t?new zr(this):this.map((function(r){return Cn(r,t,e)}))})),zr.prototype.reject=function(t){return this.filter(xo(ls(t)))},zr.prototype.slice=function(e,r){e=ga(e);var n=this;return n.__filtered__&&(e>0||r<0)?new zr(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),r!==t&&(n=(r=ga(r))<0?n.dropRight(-r):n.take(r-e)),n)},zr.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},zr.prototype.toArray=function(){return this.take(_)},An(zr.prototype,(function(e,r){var n=/^(?:filter|find|map|reject)|While$/.test(r),i=/^(?:head|last)$/.test(r),s=Fr[i?"take"+("last"==r?"Right":""):r],o=i||/^find/.test(r);s&&(Fr.prototype[r]=function(){var r=this.__wrapped__,a=i?[1]:arguments,u=r instanceof zr,l=a[0],c=u||Wo(r),h=function(t){var e=s.apply(Fr,Me([t],a));return i&&f?e[0]:e};c&&n&&"function"==typeof l&&1!=l.length&&(u=c=!1);var f=this.__chain__,_=!!this.__actions__.length,p=o&&!f,g=u&&!_;if(!o&&c){r=g?r:new zr(this);var d=e.apply(r,a);return d.__actions__.push({func:_o,args:[h],thisArg:t}),new Vr(d,f)}return p&&g?e.apply(this,a):(d=this.thru(h),p?i?d.value()[0]:d.value():d)})})),Le(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Ct[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);Fr.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var i=this.value();return e.apply(Wo(i)?i:[],t)}return this[r]((function(r){return e.apply(Wo(r)?r:[],t)}))}})),An(zr.prototype,(function(t,e){var r=Fr[e];if(r){var n=r.name+"";xt.call(Cr,n)||(Cr[n]=[]),Cr[n].push({name:e,func:r})}})),Cr[Hi(t,2).name]=[{name:"wrapper",func:t}],zr.prototype.clone=function(){var t=new zr(this.__wrapped__);return t.__actions__=wi(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=wi(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=wi(this.__views__),t},zr.prototype.reverse=function(){if(this.__filtered__){var t=new zr(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},zr.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=Wo(t),n=e<0,i=r?t.length:0,s=function(t,e,r){for(var n=-1,i=r.length;++n=this.__values__.length;return{done:e,value:e?t:this.__values__[this.__index__++]}},Fr.prototype.plant=function(e){for(var r,n=this;n instanceof jr;){var i=ks(n);i.__index__=0,i.__values__=t,r?s.__wrapped__=i:r=i;var s=i;n=n.__wrapped__}return s.__wrapped__=e,r},Fr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof zr){var r=e;return this.__actions__.length&&(r=new zr(this)),(r=r.reverse()).__actions__.push({func:_o,args:[to],thisArg:t}),new Vr(r,this.__chain__)}return this.thru(to)},Fr.prototype.toJSON=Fr.prototype.valueOf=Fr.prototype.value=function(){return gi(this.__wrapped__,this.__actions__)},Fr.prototype.first=Fr.prototype.head,ee&&(Fr.prototype[ee]=function(){return this}),Fr}();pe?((pe.exports=dr)._=dr,_e._=dr):fe._=dr}.call(s);var We=ze.exports;const Ke=1048576;var Ye;!function(t){t[t.INITIAL=0]="INITIAL",t[t.BUSY=1]="BUSY",t[t.WAIT_INPUT=2]="WAIT_INPUT",t[t.FREE=3]="FREE",t[t.STATIC_CHECK_FAILED=4]="STATIC_CHECK_FAILED",t[t.RUNTIME_ERROR=5]="RUNTIME_ERROR",t[t.MAX_STEP_REACHED=6]="MAX_STEP_REACHED",t[t.EXITED_NORMALLY=7]="EXITED_NORMALLY",t[t.EXITED_ABNORMALLY=8]="EXITED_ABNORMALLY",t[t.CLOSED=9]="CLOSED"}(Ye||(Ye={}));const Xe={instructions:[],text:[],memory:new Uint8Array},Ze={total:0,stack:0,globalVariable:0},qe={mainFunctionAddressBefore:-1,globalVariableTable:{},variableTableStack:[],assignCallLValueStack:[]},$e={stepCount:0,timeElapsed:0,state:Ye.INITIAL,callStack:[],staticErrors:[],runtimeErrors:[]};var Qe;!function(t){t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.WARNING=2]="WARNING",t[t.INPUT=3]="INPUT",t[t.OUTPUT=4]="OUTPUT",t[t.PROMPT=5]="PROMPT",t[t.ARROW=6]="ARROW"}(Qe||(Qe={}));const Je={maxExecutionStepCount:{min:0,max:999999999},memorySize:{min:1024,max:32*Ke},stackSize:{min:512,max:33553920}},tr={maxExecutionStepCount:5e6,memorySize:2*Ke,stackSize:1*Ke};const er=new f.ArgumentParser({description:"IR Virtual Machine CLI"});er.add_argument("irFile",{nargs:1,help:"path to IR file that will be run"}),er.add_argument("-p",{action:"store_true",dest:"prompt",help:"print input prompt to stdout"}),er.add_argument("-s",{action:"store_true",dest:"stepCount",help:"print machine-readable execution step count to stdout after execution finishes"}),er.add_argument("-t",{action:"store_true",dest:"timeElapsed",help:"print machine-readable execution time in milliseconds to stdout after execution finishes"}),er.add_argument("-r",{action:"store_true",dest:"summary",help:"print human-readable execution summary to stdout after execution finishes"}),er.add_argument("-l",{action:"store",dest:"locale",choices:["en","zh-cn"],default:"zh-cn",help:"CLI message locale, defaults to 'zh-cn'"});const rr=er.parse_args(),nr={dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}};let ir;if("en"===rr.locale)ir=Re({locale:"en",messages:Te[1].locale},nr);else ir=Re({locale:"zh-cn",messages:Te[0].locale},nr);const sr=e.createInterface({input:process.stdin});let or;try{or=t.readFileSync(rr.irFile[0],{encoding:"utf-8"})}catch(t){console.error(t),process.exit(1)}function ar(){ur.flushWriteBuffer((t=>{for(const e of t){let t=!1,r=!1;for(const n of e)switch(n.type){case Qe.OUTPUT:process.stdout.write(ir.formatMessage({id:n.key},n.values)),t=!0;break;case Qe.ERROR:process.stderr.write(ir.formatMessage({id:n.key},n.values)),t=!0,r=!0;break;case Qe.SUCCESS:case Qe.WARNING:if(rr.summary){process.stdout.write(ir.formatMessage({id:n.key},n.values)),t=!0;break}}t&&(r?process.stderr:process.stdout).write("\n")}}))}const ur=new class{initialRegisters={eax:0,ebx:0,ecx:0,edx:0,ebp:0,esp:tr.memorySize,eip:0};decoder=new He;memory=We.cloneDeep(Xe);registers=We.cloneDeep(this.initialRegisters);tables=We.cloneDeep(qe);executionStatus=We.cloneDeep($e);peakMemoryUsage=We.cloneDeep(Ze);options=We.cloneDeep(tr);executionStartTime=new Date;writeBuffer=[];readConsole=()=>Promise.resolve("");entryFunctionName="main";setReadConsoleFn(t){this.readConsole=t}getSingleVariableValues(t){const e=[];for(let r=t.address;r=this.memory.text.length?-1:this.memory.text[this.registers.eip].lineNumber}get instructions(){return this.memory.instructions}get globalVariableDetails(){return this.getSingleTableVariableDetails(this.tables.globalVariableTable)}get localVariableDetailsStack(){const t=[];for(let e=0;e(t=Math.max(t,e.min),t=Math.min(t,e.max));void 0!==t.maxExecutionStepCount&&(t.maxExecutionStepCount=e(t.maxExecutionStepCount,Je.maxExecutionStepCount),this.options.maxExecutionStepCount=t.maxExecutionStepCount),void 0!==t.memorySize&&(t.memorySize=e(t.memorySize,Je.memorySize),t.memorySize=e(t.memorySize,{min:this.options.stackSize,max:Je.memorySize.max}),this.options.memorySize=t.memorySize,this.initialRegisters.esp=Le(t.memorySize),this.registers.esp=Le(t.memorySize),this.updatePeakMemoryUsage()),void 0!==t.stackSize&&(t.stackSize=e(t.stackSize,Je.stackSize),t.stackSize=e(t.stackSize,{min:Je.stackSize.min,max:this.options.memorySize}),this.options.stackSize=t.stackSize)}reset(){this.memory.text=[],this.memory.memory=new Uint8Array,this.registers=We.cloneDeep(this.initialRegisters),this.tables=We.cloneDeep(qe),this.executionStatus=We.cloneDeep($e),this.peakMemoryUsage=We.cloneDeep(Ze),this.writeBuffer=[]}close(){this.executionStatus.state=Ye.CLOSED}loadNewInstructions(t){this.reset(),this.memory.instructions=t}loadAndDecodeNewInstructions(t){this.loadNewInstructions(t),this.decodeInstructions(!0)}decodeInstructions(t){const e=new Map,r=new Map;for(let n=0;nr.length?we.OUT_OF_BOUND:(r[e]=255&t,r[e+1]=(65280&t)>>>8,r[e+2]=(16711680&t)>>>16,r[e+3]=(4278190080&t)>>>24,we.SUCCESS)}(t,e,this.memory.memory);return r!==we.OUT_OF_BOUND||(this.writeRuntimeError({key:"MEMORY_WRITE_OUT_OF_BOUND",values:{address:e}}),!1)}pushl(t){return this.checkStackSize(4)?(this.registers.esp=Se(this.registers.esp,4),this.updatePeakMemoryUsage(),!!this.storeMemory32(t,this.registers.esp)):(this.writeRuntimeError({key:"STACK_OVERFLOW"}),!1)}popl(){const t=this.loadMemory32(this.registers.esp);return null===t?null:(this.registers.esp=Oe(this.registers.esp,4),this.updatePeakMemoryUsage(),t)}getVariableById(t,e){return 0===this.tables.variableTableStack.length?(this.writeRuntimeError({key:"EMPTY_VARIABLE_TABLE_STACK"}),null):t in this.tables.variableTableStack[this.tables.variableTableStack.length-1]?this.tables.variableTableStack[this.tables.variableTableStack.length-1][t]:t in this.tables.globalVariableTable?this.tables.globalVariableTable[t]:(e&&this.writeRuntimeError({key:"VARIABLE_NOT_FOUND",values:{id:t}}),null)}getSingularValue(t){if(t.type===Ce.IMM)return t.imm;{const e=this.getVariableById(t.id,!0);if(null===e)return null;if(t.type===Ce.ADDRESS_ID)return e.address;const r=this.loadMemory32(e.address);if(null===r)return null;if(t.type===Ce.ID)return r;const n=this.loadMemory32(r);return null===n?null:n}}getRValue(t){switch(t.type){case Pe.SINGULAR:return this.getSingularValue(t.singular);case Pe.BINARY_MATH_OP:{const e=this.getSingularValue(t.singularL);if(null===e)return null;const r=this.getSingularValue(t.singularR);if(null===r)return null;switch(t.binaryMathOp){case De.ADD:return Oe(e,r);case De.SUB:return Se(e,r);case De.MUL:return function(t,e){const r=65535&t,n=65535&e;return Le((((4294901760&t)>>>16)*n+r*((4294901760&e)>>>16)<<16)+r*n)}(e,r);case De.DIV:return 0===r?(this.writeRuntimeError({key:"DIVIDE_BY_ZERO"}),null):Le(e/r)}}}}createStackVariable(t,e){if(!this.checkStackSize(e))return this.writeRuntimeError({key:"STACK_OVERFLOW"}),null;this.registers.esp=Se(this.registers.esp,e),this.updatePeakMemoryUsage();const r={address:this.registers.esp,size:e,lineNumber:this.memory.text[this.registers.eip].lineNumber};return 0===this.tables.variableTableStack.length?(this.writeRuntimeError({key:"EMPTY_VARIABLE_TABLE_STACK"}),null):t in this.tables.variableTableStack[this.tables.variableTableStack.length-1]?(this.writeRuntimeError({key:"DUPLICATE_DEC_ID",values:{id:t,lastLineNumber:this.tables.variableTableStack[this.tables.variableTableStack.length-1][t].lineNumber}}),null):(this.tables.variableTableStack[this.tables.variableTableStack.length-1][t]=r,r)}getLValueAddress(t){let e=this.getVariableById(t.id,t.type===Be.DEREF_ID);if(null===e){if(t.type!==Be.ID)return null;if(e=this.createStackVariable(t.id,4),null===e)return null}let r=e.address;if(t.type===Be.DEREF_ID){const t=this.loadMemory32(e.address);if(null===t)return null;r=t}return r}getCondValue(t){const e=this.getSingularValue(t.singularL);if(null===e)return null;const r=this.getSingularValue(t.singularR);if(null===r)return null;switch(t.binaryRelOp){case Me.EQ:return e===r;case Me.NE:return e!==r;case Me.LT:return er;case Me.GE:return e>=r}}async execute(t){do{if(this.executionStatus.state!==Ye.EXITED_NORMALLY&&this.executionStatus.state!==Ye.EXITED_ABNORMALLY&&this.executionStatus.state!==Ye.INITIAL||(this.reset(),this.prepareExcution()),this.executionStatus.state!==Ye.FREE)return;if(this.executionStatus.state=Ye.BUSY,this.options.maxExecutionStepCount>0&&this.executionStatus.stepCount>=this.options.maxExecutionStepCount)return this.executionStatus.state=Ye.MAX_STEP_REACHED,void this.writeBuffer.push([{key:"MAX_STEP_REACHED",values:{maxExecutionStepCount:this.options.maxExecutionStepCount},type:Qe.ERROR}]);if(this.registers.eip>=this.memory.text.length||this.registers.eip<0)return this.executionStatus.state=Ye.RUNTIME_ERROR,void this.writeBuffer.push([{key:"RUNTIME_ERROR_PREFIX_NO_LN",type:Qe.ERROR},{key:"INSTRUCTION_READ_OUT_OF_BOUND",values:{address:this.registers.eip},type:Qe.ERROR}]);this.executionStatus.stepCount++;const t=this.memory.text[this.registers.eip];switch(t.type){case Ue.ARG:{const e=this.getSingularValue(t.value.value);if(null===e||!this.pushl(e))return;this.registers.ecx=Oe(this.registers.ecx,4);break}case Ue.ASSIGN:{const e=this.getRValue(t.value.rValue);if(null===e)return;const r=this.getLValueAddress(t.value.lValue);if(null===r)return;if(!this.storeMemory32(e,r))return;break}case Ue.ASSIGN_CALL:case Ue.CALL:{const e=t.type===Ue.CALL?t.value.id:t.value.functionId;if(this.registers.ebx=this.registers.esp,!this.pushl(this.registers.ecx))return;if(this.registers.ecx=0,!this.pushl(this.registers.eip))return;if(!this.pushl(this.registers.ebp))return;this.registers.ebp=this.registers.esp,t.type===Ue.ASSIGN_CALL?this.tables.assignCallLValueStack.push(t.value.lValue):this.tables.assignCallLValueStack.push(null),this.tables.variableTableStack.push({}),this.executionStatus.callStack.push(e),this.registers.eip=t.value.functionAddressBefore;break}case Ue.DEC:if(null===this.createStackVariable(t.value.id,t.value.size))return;break;case Ue.GOTO:this.registers.eip=t.value.gotoAddressBefore;break;case Ue.IF:{const e=this.getCondValue(t.value.condition);if(null===e)return;e&&(this.registers.eip=t.value.gotoAddressBefore);break}case Ue.PARAM:{const e=t.value.id;if(e in this.tables.variableTableStack[this.tables.variableTableStack.length-1])return void this.writeRuntimeError({key:"DUPLICATE_PARAM_ID",values:{id:e,lastLineNumber:this.tables.variableTableStack[this.tables.variableTableStack.length-1][e].lineNumber}});if(null===this.loadMemory32(this.registers.ebx))return;this.tables.variableTableStack[this.tables.variableTableStack.length-1][e]={address:this.registers.ebx,size:4,lineNumber:t.lineNumber},this.registers.ebx=Oe(this.registers.ebx,4);break}case Ue.RETURN:{const e=this.getSingularValue(t.value.value);if(null===e)return;this.registers.eax=e,this.registers.esp=this.registers.ebp,this.updatePeakMemoryUsage();const r=this.popl();if(null===r)return;this.registers.ebp=r;const n=this.popl();if(null===n)return;this.registers.eip=n;const i=this.popl();if(null===i)return;if(this.registers.esp=Oe(this.registers.esp,i),this.updatePeakMemoryUsage(),this.registers.ecx=0,0===this.tables.variableTableStack.length)return void this.writeRuntimeError({key:"EMPTY_VARIABLE_TABLE_STACK"});if(this.executionStatus.callStack.pop(),this.tables.variableTableStack.pop(),this.registers.eip===this.memory.text.length)return void this.finalizeExcution();const s=this.tables.assignCallLValueStack.pop();if(null!==s){const t=this.getLValueAddress(s);if(null===t)return;if(!this.storeMemory32(this.registers.eax,t))return}break}case Ue.READ:{const e=t.value,r=this.getLValueAddress(e.lValue);if(null===r)return;const n=e.lValue.type===Be.ID?e.lValue.id:"*"+e.lValue.id;this.executionStatus.state=Ye.WAIT_INPUT;const i=await this.readConsole([{key:"READ_PROMPT",values:{name:n}}]);if(this.state!==Ye.WAIT_INPUT)return;this.executionStatus.state=Ye.BUSY;const s=parseInt(i);if(isNaN(s))return void this.writeRuntimeError({key:"INPUT_INT_ILLEGAL"});if(!Number.isSafeInteger(s))return void this.writeRuntimeError({key:"INPUT_INT_ABS_TOO_LARGE"});if(!this.storeMemory32(Le(s),r))return;break}case Ue.WRITE:{const e=this.getSingularValue(t.value.value);if(null===e)return;this.writeBuffer.push([{key:"WRITE_OUTPUT",values:{value:e},type:Qe.OUTPUT}]);break}}for(this.registers.eip=Oe(this.registers.eip,1);this.registers.eip=0&&this.memory.text[this.registers.eip].type===Ue.GLOBAL_DEC;)this.registers.eip=Oe(this.registers.eip,1);this.executionStatus.state=Ye.FREE}while(t)}async executeSingleStep(){await this.execute(!1)}async executeContinuously(){await this.execute(!0)}};ur.configure({maxExecutionStepCount:0,memorySize:32*Ke,stackSize:31*Ke});const lr=[];let cr=0,hr=null;sr.on("line",(t=>{const e=t.trim().split(/\s/).filter((t=>t.length>0));lr.push(...e),null!==hr&&cr(ar(),rr.prompt&&console.log(t.reduce(((t,e)=>t+ir.formatMessage({id:e.key},e.values)),"")),cr{hr=t}))))),ur.loadNewInstructions(or.split(/\r\n|[\r\n]/)),await ur.executeContinuously(),ar(),rr.stepCount&&console.log(ur.stepCount),rr.timeElapsed&&console.log(ur.timeElapsed);const fr=ur.state;switch(ur.close(),fr){case Ye.EXITED_NORMALLY:process.exit(0);case Ye.EXITED_ABNORMALLY:process.exit(ur.returnValue);case Ye.STATIC_CHECK_FAILED:case Ye.RUNTIME_ERROR:process.exit(1)} diff --git a/docs/assets/cssMode-e9a916a7.js b/docs/assets/cssMode-f75e3f37.js similarity index 99% rename from docs/assets/cssMode-e9a916a7.js rename to docs/assets/cssMode-f75e3f37.js index 8f89828..2792839 100644 --- a/docs/assets/cssMode-e9a916a7.js +++ b/docs/assets/cssMode-f75e3f37.js @@ -1,4 +1,4 @@ -import{m as je}from"./index-e4c81506.js";/*!----------------------------------------------------------------------------- +import{m as je}from"./index-7745a004.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/freemarker2-64c2a106.js b/docs/assets/freemarker2-c400ccc3.js similarity index 99% rename from docs/assets/freemarker2-64c2a106.js rename to docs/assets/freemarker2-c400ccc3.js index 415c77b..8f05d96 100644 --- a/docs/assets/freemarker2-64c2a106.js +++ b/docs/assets/freemarker2-c400ccc3.js @@ -1,4 +1,4 @@ -import{m as F}from"./index-e4c81506.js";/*!----------------------------------------------------------------------------- +import{m as F}from"./index-7745a004.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/handlebars-37d070d1.js b/docs/assets/handlebars-c10cb1ca.js similarity index 99% rename from docs/assets/handlebars-37d070d1.js rename to docs/assets/handlebars-c10cb1ca.js index 1a29aa9..d894394 100644 --- a/docs/assets/handlebars-37d070d1.js +++ b/docs/assets/handlebars-c10cb1ca.js @@ -1,4 +1,4 @@ -import{m as i}from"./index-e4c81506.js";/*!----------------------------------------------------------------------------- +import{m as i}from"./index-7745a004.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/html-7ea466f3.js b/docs/assets/html-83ec7cfd.js similarity index 98% rename from docs/assets/html-7ea466f3.js rename to docs/assets/html-83ec7cfd.js index f37cfa2..e4bb2ef 100644 --- a/docs/assets/html-7ea466f3.js +++ b/docs/assets/html-83ec7cfd.js @@ -1,4 +1,4 @@ -import{m as d}from"./index-e4c81506.js";/*!----------------------------------------------------------------------------- +import{m as d}from"./index-7745a004.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/htmlMode-ed1d179b.js b/docs/assets/htmlMode-414a2305.js similarity index 99% rename from docs/assets/htmlMode-ed1d179b.js rename to docs/assets/htmlMode-414a2305.js index 1767667..b8cd881 100644 --- a/docs/assets/htmlMode-ed1d179b.js +++ b/docs/assets/htmlMode-414a2305.js @@ -1,4 +1,4 @@ -import{m as qe}from"./index-e4c81506.js";/*!----------------------------------------------------------------------------- +import{m as qe}from"./index-7745a004.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/index-e4c81506.js b/docs/assets/index-7745a004.js similarity index 96% rename from docs/assets/index-e4c81506.js rename to docs/assets/index-7745a004.js index 0255773..1acd112 100644 --- a/docs/assets/index-e4c81506.js +++ b/docs/assets/index-7745a004.js @@ -30,14 +30,14 @@ var A2e=Object.defineProperty;var P2e=(i,e,t)=>e in i?A2e(i,e,{enumerable:!0,con * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var che=C,iu=X7;function Et(i){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+i,t=1;t"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Y7=Object.prototype.hasOwnProperty,lMe=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,nte={},ite={};function cMe(i){return Y7.call(ite,i)?!0:Y7.call(nte,i)?!1:lMe.test(i)?ite[i]=!0:(nte[i]=!0,!1)}function uMe(i,e,t,n){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:t!==null?!t.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function dMe(i,e,t,n){if(e===null||typeof e>"u"||uMe(i,e,t,n))return!0;if(n)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Ml(i,e,t,n,r,o,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=r,this.mustUseProperty=t,this.propertyName=i,this.type=e,this.sanitizeURL=o,this.removeEmptyString=s}var Ea={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){Ea[i]=new Ml(i,0,!1,i,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var e=i[0];Ea[e]=new Ml(e,1,!1,i[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(i){Ea[i]=new Ml(i,2,!1,i.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){Ea[i]=new Ml(i,2,!1,i,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){Ea[i]=new Ml(i,3,!1,i.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(i){Ea[i]=new Ml(i,3,!0,i,null,!1,!1)});["capture","download"].forEach(function(i){Ea[i]=new Ml(i,4,!1,i,null,!1,!1)});["cols","rows","size","span"].forEach(function(i){Ea[i]=new Ml(i,6,!1,i,null,!1,!1)});["rowSpan","start"].forEach(function(i){Ea[i]=new Ml(i,5,!1,i.toLowerCase(),null,!1,!1)});var JK=/[\-:]([a-z])/g;function eG(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var e=i.replace(JK,eG);Ea[e]=new Ml(e,1,!1,i,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var e=i.replace(JK,eG);Ea[e]=new Ml(e,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(i){var e=i.replace(JK,eG);Ea[e]=new Ml(e,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(i){Ea[i]=new Ml(i,1,!1,i.toLowerCase(),null,!1,!1)});Ea.xlinkHref=new Ml("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(i){Ea[i]=new Ml(i,1,!1,i.toLowerCase(),null,!0,!0)});function tG(i,e,t,n){var r=Ea.hasOwnProperty(e)?Ea[e]:null;(r!==null?r.type!==0:n||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Y7=Object.prototype.hasOwnProperty,lMe=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,nte={},ite={};function cMe(i){return Y7.call(ite,i)?!0:Y7.call(nte,i)?!1:lMe.test(i)?ite[i]=!0:(nte[i]=!0,!1)}function uMe(i,e,t,n){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:t!==null?!t.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function dMe(i,e,t,n){if(e===null||typeof e>"u"||uMe(i,e,t,n))return!0;if(n)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Ml(i,e,t,n,r,o,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=r,this.mustUseProperty=t,this.propertyName=i,this.type=e,this.sanitizeURL=o,this.removeEmptyString=s}var Ea={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){Ea[i]=new Ml(i,0,!1,i,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var e=i[0];Ea[e]=new Ml(e,1,!1,i[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(i){Ea[i]=new Ml(i,2,!1,i.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){Ea[i]=new Ml(i,2,!1,i,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){Ea[i]=new Ml(i,3,!1,i.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(i){Ea[i]=new Ml(i,3,!0,i,null,!1,!1)});["capture","download"].forEach(function(i){Ea[i]=new Ml(i,4,!1,i,null,!1,!1)});["cols","rows","size","span"].forEach(function(i){Ea[i]=new Ml(i,6,!1,i,null,!1,!1)});["rowSpan","start"].forEach(function(i){Ea[i]=new Ml(i,5,!1,i.toLowerCase(),null,!1,!1)});var JK=/[\-:]([a-z])/g;function eG(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var e=i.replace(JK,eG);Ea[e]=new Ml(e,1,!1,i,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var e=i.replace(JK,eG);Ea[e]=new Ml(e,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(i){var e=i.replace(JK,eG);Ea[e]=new Ml(e,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(i){Ea[i]=new Ml(i,1,!1,i.toLowerCase(),null,!1,!1)});Ea.xlinkHref=new Ml("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(i){Ea[i]=new Ml(i,1,!1,i.toLowerCase(),null,!0,!0)});function tG(i,e,t,n){var r=Ea.hasOwnProperty(e)?Ea[e]:null;(r!==null?r.type!==0:n||!(2a||r[s]!==o[a]){var l=` -`+r[s].replace(" at new "," at ");return i.displayName&&l.includes("")&&(l=l.replace("",i.displayName)),l}while(1<=s&&0<=a);break}}}finally{m8=!1,Error.prepareStackTrace=t}return(i=i?i.displayName||i.name:"")?mL(i):""}function hMe(i){switch(i.tag){case 5:return mL(i.type);case 16:return mL("Lazy");case 13:return mL("Suspense");case 19:return mL("SuspenseList");case 0:case 2:case 15:return i=v8(i.type,!1),i;case 11:return i=v8(i.type.render,!1),i;case 1:return i=v8(i.type,!0),i;default:return""}}function eW(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case $1:return"Fragment";case W1:return"Portal";case Z7:return"Profiler";case nG:return"StrictMode";case Q7:return"Suspense";case J7:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case hhe:return(i.displayName||"Context")+".Consumer";case dhe:return(i._context.displayName||"Context")+".Provider";case iG:var e=i.render;return i=i.displayName,i||(i=e.displayName||e.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case rG:return e=i.displayName||null,e!==null?e:eW(i.type)||"Memo";case Lm:e=i._payload,i=i._init;try{return eW(i(e))}catch{}}return null}function fMe(i){var e=i.type;switch(i.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=e.render,i=i.displayName||i.name||"",e.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return eW(e);case 8:return e===nG?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Bv(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function ghe(i){var e=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function gMe(i){var e=ghe(i)?"checked":"value",t=Object.getOwnPropertyDescriptor(i.constructor.prototype,e),n=""+i[e];if(!i.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var r=t.get,o=t.set;return Object.defineProperty(i,e,{configurable:!0,get:function(){return r.call(this)},set:function(s){n=""+s,o.call(this,s)}}),Object.defineProperty(i,e,{enumerable:t.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){i._valueTracker=null,delete i[e]}}}}function NN(i){i._valueTracker||(i._valueTracker=gMe(i))}function phe(i){if(!i)return!1;var e=i._valueTracker;if(!e)return!0;var t=e.getValue(),n="";return i&&(n=ghe(i)?i.checked?"true":"false":i.value),i=n,i!==t?(e.setValue(i),!0):!1}function sA(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function tW(i,e){var t=e.checked;return ko({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??i._wrapperState.initialChecked})}function ote(i,e){var t=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;t=Bv(e.value!=null?e.value:t),i._wrapperState={initialChecked:n,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function mhe(i,e){e=e.checked,e!=null&&tG(i,"checked",e,!1)}function nW(i,e){mhe(i,e);var t=Bv(e.value),n=e.type;if(t!=null)n==="number"?(t===0&&i.value===""||i.value!=t)&&(i.value=""+t):i.value!==""+t&&(i.value=""+t);else if(n==="submit"||n==="reset"){i.removeAttribute("value");return}e.hasOwnProperty("value")?iW(i,e.type,t):e.hasOwnProperty("defaultValue")&&iW(i,e.type,Bv(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(i.defaultChecked=!!e.defaultChecked)}function ste(i,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+i._wrapperState.initialValue,t||e===i.value||(i.value=e),i.defaultValue=e}t=i.name,t!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,t!==""&&(i.name=t)}function iW(i,e,t){(e!=="number"||sA(i.ownerDocument)!==i)&&(t==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+t&&(i.defaultValue=""+t))}var vL=Array.isArray;function xy(i,e,t,n){if(i=i.options,e){e={};for(var r=0;r"+e.valueOf().toString()+"",e=RN.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;e.firstChild;)i.appendChild(e.firstChild)}});function eD(i,e){if(e){var t=i.firstChild;if(t&&t===i.lastChild&&t.nodeType===3){t.nodeValue=e;return}}i.textContent=e}var ZL={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},pMe=["Webkit","ms","Moz","O"];Object.keys(ZL).forEach(function(i){pMe.forEach(function(e){e=e+i.charAt(0).toUpperCase()+i.substring(1),ZL[e]=ZL[i]})});function Che(i,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||ZL.hasOwnProperty(i)&&ZL[i]?(""+e).trim():e+"px"}function yhe(i,e){i=i.style;for(var t in e)if(e.hasOwnProperty(t)){var n=t.indexOf("--")===0,r=Che(t,e[t],n);t==="float"&&(t="cssFloat"),n?i.setProperty(t,r):i[t]=r}}var mMe=ko({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function sW(i,e){if(e){if(mMe[i]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Et(137,i));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Et(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Et(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Et(62))}}function aW(i,e){if(i.indexOf("-")===-1)return typeof e.is=="string";switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var lW=null;function oG(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var cW=null,Ly=null,Ey=null;function cte(i){if(i=yk(i)){if(typeof cW!="function")throw Error(Et(280));var e=i.stateNode;e&&(e=yF(e),cW(i.stateNode,i.type,e))}}function whe(i){Ly?Ey?Ey.push(i):Ey=[i]:Ly=i}function She(){if(Ly){var i=Ly,e=Ey;if(Ey=Ly=null,cte(i),e)for(i=0;i>>=0,i===0?32:31-(DMe(i)/IMe|0)|0}var MN=64,AN=4194304;function _L(i){switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function uA(i,e){var t=i.pendingLanes;if(t===0)return 0;var n=0,r=i.suspendedLanes,o=i.pingedLanes,s=t&268435455;if(s!==0){var a=s&~r;a!==0?n=_L(a):(o&=s,o!==0&&(n=_L(o)))}else s=t&~r,s!==0?n=_L(s):o!==0&&(n=_L(o));if(n===0)return 0;if(e!==0&&e!==n&&!(e&r)&&(r=n&-n,o=e&-e,r>=o||r===16&&(o&4194240)!==0))return e;if(n&4&&(n|=t&16),e=i.entangledLanes,e!==0)for(i=i.entanglements,e&=n;0t;t++)e.push(i);return e}function bk(i,e,t){i.pendingLanes|=e,e!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,e=31-Zd(e),i[e]=t}function RMe(i,e){var t=i.pendingLanes&~e;i.pendingLanes=e,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=e,i.mutableReadLanes&=e,i.entangledLanes&=e,e=i.entanglements;var n=i.eventTimes;for(i=i.expirationTimes;0=JL),_te=String.fromCharCode(32),bte=!1;function zhe(i,e){switch(i){case"keyup":return sAe.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Uhe(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var H1=!1;function lAe(i,e){switch(i){case"compositionend":return Uhe(e);case"keypress":return e.which!==32?null:(bte=!0,_te);case"textInput":return i=e.data,i===_te&&bte?null:i;default:return null}}function cAe(i,e){if(H1)return i==="compositionend"||!fG&&zhe(i,e)?(i=Hhe(),X2=uG=$m=null,H1=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-i};i=n}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=Ste(t)}}function qhe(i,e){return i&&e?i===e?!0:i&&i.nodeType===3?!1:e&&e.nodeType===3?qhe(i,e.parentNode):"contains"in i?i.contains(e):i.compareDocumentPosition?!!(i.compareDocumentPosition(e)&16):!1:!1}function Xhe(){for(var i=window,e=sA();e instanceof i.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)i=e.contentWindow;else break;e=sA(i.document)}return e}function gG(i){var e=i&&i.nodeName&&i.nodeName.toLowerCase();return e&&(e==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||e==="textarea"||i.contentEditable==="true")}function _Ae(i){var e=Xhe(),t=i.focusedElem,n=i.selectionRange;if(e!==t&&t&&t.ownerDocument&&qhe(t.ownerDocument.documentElement,t)){if(n!==null&&gG(t)){if(e=n.start,i=n.end,i===void 0&&(i=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(i,t.value.length);else if(i=(e=t.ownerDocument||document)&&e.defaultView||window,i.getSelection){i=i.getSelection();var r=t.textContent.length,o=Math.min(n.start,r);n=n.end===void 0?o:Math.min(n.end,r),!i.extend&&o>n&&(r=n,n=o,o=r),r=xte(t,o);var s=xte(t,n);r&&s&&(i.rangeCount!==1||i.anchorNode!==r.node||i.anchorOffset!==r.offset||i.focusNode!==s.node||i.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(r.node,r.offset),i.removeAllRanges(),o>n?(i.addRange(e),i.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),i.addRange(e)))}}for(e=[],i=t;i=i.parentNode;)i.nodeType===1&&e.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t=document.documentMode,V1=null,pW=null,tE=null,mW=!1;function Lte(i,e,t){var n=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;mW||V1==null||V1!==sA(n)||(n=V1,"selectionStart"in n&&gG(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),tE&&sD(tE,n)||(tE=n,n=fA(pW,"onSelect"),0j1||(i.current=wW[j1],wW[j1]=null,j1--)}function Xr(i,e){j1++,wW[j1]=i.current,i.current=e}var Wv={},el=y_(Wv),lc=y_(!1),bb=Wv;function hw(i,e){var t=i.type.contextTypes;if(!t)return Wv;var n=i.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var r={},o;for(o in t)r[o]=e[o];return n&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=e,i.__reactInternalMemoizedMaskedChildContext=r),r}function cc(i){return i=i.childContextTypes,i!=null}function pA(){so(lc),so(el)}function Rte(i,e,t){if(el.current!==Wv)throw Error(Et(168));Xr(el,e),Xr(lc,t)}function rfe(i,e,t){var n=i.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return t;n=n.getChildContext();for(var r in n)if(!(r in e))throw Error(Et(108,fMe(i)||"Unknown",r));return ko({},t,n)}function mA(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Wv,bb=el.current,Xr(el,i),Xr(lc,lc.current),!0}function Mte(i,e,t){var n=i.stateNode;if(!n)throw Error(Et(169));t?(i=rfe(i,e,bb),n.__reactInternalMemoizedMergedChildContext=i,so(lc),so(el),Xr(el,i)):so(lc),Xr(lc,t)}var Rg=null,wF=!1,N8=!1;function ofe(i){Rg===null?Rg=[i]:Rg.push(i)}function TAe(i){wF=!0,ofe(i)}function w_(){if(!N8&&Rg!==null){N8=!0;var i=0,e=yr;try{var t=Rg;for(yr=1;i>=s,r-=s,jg=1<<32-Zd(e)+r|t<k?(T=D,D=null):T=D.sibling;var M=h(m,D,y[k],S);if(M===null){D===null&&(D=T);break}i&&D&&M.alternate===null&&e(m,D),_=o(M,_,k),E===null?L=M:E.sibling=M,E=M,D=T}if(k===y.length)return t(m,D),po&&u0(m,k),L;if(D===null){for(;kk?(T=D,D=null):T=D.sibling;var A=h(m,D,M.value,S);if(A===null){D===null&&(D=T);break}i&&D&&A.alternate===null&&e(m,D),_=o(A,_,k),E===null?L=A:E.sibling=A,E=A,D=T}if(M.done)return t(m,D),po&&u0(m,k),L;if(D===null){for(;!M.done;k++,M=y.next())M=d(m,M.value,S),M!==null&&(_=o(M,_,k),E===null?L=M:E.sibling=M,E=M);return po&&u0(m,k),L}for(D=n(m,D);!M.done;k++,M=y.next())M=f(D,m,k,M.value,S),M!==null&&(i&&M.alternate!==null&&D.delete(M.key===null?k:M.key),_=o(M,_,k),E===null?L=M:E.sibling=M,E=M);return i&&D.forEach(function(N){return e(m,N)}),po&&u0(m,k),L}function v(m,_,y,S){if(typeof y=="object"&&y!==null&&y.type===$1&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case TN:e:{for(var L=y.key,E=_;E!==null;){if(E.key===L){if(L=y.type,L===$1){if(E.tag===7){t(m,E.sibling),_=r(E,y.props.children),_.return=m,m=_;break e}}else if(E.elementType===L||typeof L=="object"&&L!==null&&L.$$typeof===Lm&&$te(L)===E.type){t(m,E.sibling),_=r(E,y.props),_.ref=Lx(m,E,y),_.return=m,m=_;break e}t(m,E);break}else e(m,E);E=E.sibling}y.type===$1?(_=tb(y.props.children,m.mode,S,y.key),_.return=m,m=_):(S=iM(y.type,y.key,y.props,null,m.mode,S),S.ref=Lx(m,_,y),S.return=m,m=S)}return s(m);case W1:e:{for(E=y.key;_!==null;){if(_.key===E)if(_.tag===4&&_.stateNode.containerInfo===y.containerInfo&&_.stateNode.implementation===y.implementation){t(m,_.sibling),_=r(_,y.children||[]),_.return=m,m=_;break e}else{t(m,_);break}else e(m,_);_=_.sibling}_=W8(y,m.mode,S),_.return=m,m=_}return s(m);case Lm:return E=y._init,v(m,_,E(y._payload),S)}if(vL(y))return g(m,_,y,S);if(Cx(y))return p(m,_,y,S);HN(m,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,_!==null&&_.tag===6?(t(m,_.sibling),_=r(_,y),_.return=m,m=_):(t(m,_),_=B8(y,m.mode,S),_.return=m,m=_),s(m)):t(m,_)}return v}var gw=ffe(!0),gfe=ffe(!1),wk={},Df=y_(wk),uD=y_(wk),dD=y_(wk);function F0(i){if(i===wk)throw Error(Et(174));return i}function SG(i,e){switch(Xr(dD,e),Xr(uD,i),Xr(Df,wk),i=e.nodeType,i){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:oW(null,"");break;default:i=i===8?e.parentNode:e,e=i.namespaceURI||null,i=i.tagName,e=oW(e,i)}so(Df),Xr(Df,e)}function pw(){so(Df),so(uD),so(dD)}function pfe(i){F0(dD.current);var e=F0(Df.current),t=oW(e,i.type);e!==t&&(Xr(uD,i),Xr(Df,t))}function xG(i){uD.current===i&&(so(Df),so(uD))}var wo=y_(0);function wA(i){for(var e=i;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===i)break;for(;e.sibling===null;){if(e.return===null||e.return===i)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var R8=[];function LG(){for(var i=0;it?t:4,i(!0);var n=M8.transition;M8.transition={};try{i(!1),e()}finally{yr=t,M8.transition=n}}function Nfe(){return td().memoizedState}function AAe(i,e,t){var n=fv(i);if(t={lane:n,action:t,hasEagerState:!1,eagerState:null,next:null},Rfe(i))Mfe(e,t);else if(t=cfe(i,e,t,n),t!==null){var r=Sl();Qd(t,i,n,r),Afe(t,e,n)}}function PAe(i,e,t){var n=fv(i),r={lane:n,action:t,hasEagerState:!1,eagerState:null,next:null};if(Rfe(i))Mfe(e,r);else{var o=i.alternate;if(i.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var s=e.lastRenderedState,a=o(s,t);if(r.hasEagerState=!0,r.eagerState=a,ah(a,s)){var l=e.interleaved;l===null?(r.next=r,yG(e)):(r.next=l.next,l.next=r),e.interleaved=r;return}}catch{}finally{}t=cfe(i,e,r,n),t!==null&&(r=Sl(),Qd(t,i,n,r),Afe(t,e,n))}}function Rfe(i){var e=i.alternate;return i===Do||e!==null&&e===Do}function Mfe(i,e){nE=SA=!0;var t=i.pending;t===null?e.next=e:(e.next=t.next,t.next=e),i.pending=e}function Afe(i,e,t){if(t&4194240){var n=e.lanes;n&=i.pendingLanes,t|=n,e.lanes=t,aG(i,t)}}var xA={readContext:ed,useCallback:Ha,useContext:Ha,useEffect:Ha,useImperativeHandle:Ha,useInsertionEffect:Ha,useLayoutEffect:Ha,useMemo:Ha,useReducer:Ha,useRef:Ha,useState:Ha,useDebugValue:Ha,useDeferredValue:Ha,useTransition:Ha,useMutableSource:Ha,useSyncExternalStore:Ha,useId:Ha,unstable_isNewReconciler:!1},OAe={readContext:ed,useCallback:function(i,e){return Yh().memoizedState=[i,e===void 0?null:e],i},useContext:ed,useEffect:Vte,useImperativeHandle:function(i,e,t){return t=t!=null?t.concat([i]):null,J2(4194308,4,Efe.bind(null,e,i),t)},useLayoutEffect:function(i,e){return J2(4194308,4,i,e)},useInsertionEffect:function(i,e){return J2(4,2,i,e)},useMemo:function(i,e){var t=Yh();return e=e===void 0?null:e,i=i(),t.memoizedState=[i,e],i},useReducer:function(i,e,t){var n=Yh();return e=t!==void 0?t(e):e,n.memoizedState=n.baseState=e,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:e},n.queue=i,i=i.dispatch=AAe.bind(null,Do,i),[n.memoizedState,i]},useRef:function(i){var e=Yh();return i={current:i},e.memoizedState=i},useState:Hte,useDebugValue:TG,useDeferredValue:function(i){return Yh().memoizedState=i},useTransition:function(){var i=Hte(!1),e=i[0];return i=MAe.bind(null,i[1]),Yh().memoizedState=i,[e,i]},useMutableSource:function(){},useSyncExternalStore:function(i,e,t){var n=Do,r=Yh();if(po){if(t===void 0)throw Error(Et(407));t=t()}else{if(t=e(),Xs===null)throw Error(Et(349));yb&30||_fe(n,e,t)}r.memoizedState=t;var o={value:t,getSnapshot:e};return r.queue=o,Vte(Cfe.bind(null,n,o,i),[i]),n.flags|=2048,gD(9,bfe.bind(null,n,o,t,e),void 0,null),t},useId:function(){var i=Yh(),e=Xs.identifierPrefix;if(po){var t=Kg,n=jg;t=(n&~(1<<32-Zd(n)-1)).toString(32)+t,e=":"+e+"R"+t,t=hD++,0")&&(l=l.replace("",i.displayName)),l}while(1<=s&&0<=a);break}}}finally{m8=!1,Error.prepareStackTrace=t}return(i=i?i.displayName||i.name:"")?mL(i):""}function hMe(i){switch(i.tag){case 5:return mL(i.type);case 16:return mL("Lazy");case 13:return mL("Suspense");case 19:return mL("SuspenseList");case 0:case 2:case 15:return i=v8(i.type,!1),i;case 11:return i=v8(i.type.render,!1),i;case 1:return i=v8(i.type,!0),i;default:return""}}function eW(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case $1:return"Fragment";case W1:return"Portal";case Z7:return"Profiler";case nG:return"StrictMode";case Q7:return"Suspense";case J7:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case hhe:return(i.displayName||"Context")+".Consumer";case dhe:return(i._context.displayName||"Context")+".Provider";case iG:var e=i.render;return i=i.displayName,i||(i=e.displayName||e.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case rG:return e=i.displayName||null,e!==null?e:eW(i.type)||"Memo";case Em:e=i._payload,i=i._init;try{return eW(i(e))}catch{}}return null}function fMe(i){var e=i.type;switch(i.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=e.render,i=i.displayName||i.name||"",e.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return eW(e);case 8:return e===nG?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Fv(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function ghe(i){var e=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function gMe(i){var e=ghe(i)?"checked":"value",t=Object.getOwnPropertyDescriptor(i.constructor.prototype,e),n=""+i[e];if(!i.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var r=t.get,o=t.set;return Object.defineProperty(i,e,{configurable:!0,get:function(){return r.call(this)},set:function(s){n=""+s,o.call(this,s)}}),Object.defineProperty(i,e,{enumerable:t.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){i._valueTracker=null,delete i[e]}}}}function NN(i){i._valueTracker||(i._valueTracker=gMe(i))}function phe(i){if(!i)return!1;var e=i._valueTracker;if(!e)return!0;var t=e.getValue(),n="";return i&&(n=ghe(i)?i.checked?"true":"false":i.value),i=n,i!==t?(e.setValue(i),!0):!1}function sA(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function tW(i,e){var t=e.checked;return ko({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??i._wrapperState.initialChecked})}function ote(i,e){var t=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;t=Fv(e.value!=null?e.value:t),i._wrapperState={initialChecked:n,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function mhe(i,e){e=e.checked,e!=null&&tG(i,"checked",e,!1)}function nW(i,e){mhe(i,e);var t=Fv(e.value),n=e.type;if(t!=null)n==="number"?(t===0&&i.value===""||i.value!=t)&&(i.value=""+t):i.value!==""+t&&(i.value=""+t);else if(n==="submit"||n==="reset"){i.removeAttribute("value");return}e.hasOwnProperty("value")?iW(i,e.type,t):e.hasOwnProperty("defaultValue")&&iW(i,e.type,Fv(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(i.defaultChecked=!!e.defaultChecked)}function ste(i,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+i._wrapperState.initialValue,t||e===i.value||(i.value=e),i.defaultValue=e}t=i.name,t!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,t!==""&&(i.name=t)}function iW(i,e,t){(e!=="number"||sA(i.ownerDocument)!==i)&&(t==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+t&&(i.defaultValue=""+t))}var vL=Array.isArray;function xy(i,e,t,n){if(i=i.options,e){e={};for(var r=0;r"+e.valueOf().toString()+"",e=RN.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;e.firstChild;)i.appendChild(e.firstChild)}});function eD(i,e){if(e){var t=i.firstChild;if(t&&t===i.lastChild&&t.nodeType===3){t.nodeValue=e;return}}i.textContent=e}var ZL={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},pMe=["Webkit","ms","Moz","O"];Object.keys(ZL).forEach(function(i){pMe.forEach(function(e){e=e+i.charAt(0).toUpperCase()+i.substring(1),ZL[e]=ZL[i]})});function Che(i,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||ZL.hasOwnProperty(i)&&ZL[i]?(""+e).trim():e+"px"}function yhe(i,e){i=i.style;for(var t in e)if(e.hasOwnProperty(t)){var n=t.indexOf("--")===0,r=Che(t,e[t],n);t==="float"&&(t="cssFloat"),n?i.setProperty(t,r):i[t]=r}}var mMe=ko({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function sW(i,e){if(e){if(mMe[i]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Et(137,i));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Et(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Et(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Et(62))}}function aW(i,e){if(i.indexOf("-")===-1)return typeof e.is=="string";switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var lW=null;function oG(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var cW=null,Ly=null,Ey=null;function cte(i){if(i=yk(i)){if(typeof cW!="function")throw Error(Et(280));var e=i.stateNode;e&&(e=yF(e),cW(i.stateNode,i.type,e))}}function whe(i){Ly?Ey?Ey.push(i):Ey=[i]:Ly=i}function She(){if(Ly){var i=Ly,e=Ey;if(Ey=Ly=null,cte(i),e)for(i=0;i>>=0,i===0?32:31-(DMe(i)/IMe|0)|0}var MN=64,AN=4194304;function _L(i){switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function uA(i,e){var t=i.pendingLanes;if(t===0)return 0;var n=0,r=i.suspendedLanes,o=i.pingedLanes,s=t&268435455;if(s!==0){var a=s&~r;a!==0?n=_L(a):(o&=s,o!==0&&(n=_L(o)))}else s=t&~r,s!==0?n=_L(s):o!==0&&(n=_L(o));if(n===0)return 0;if(e!==0&&e!==n&&!(e&r)&&(r=n&-n,o=e&-e,r>=o||r===16&&(o&4194240)!==0))return e;if(n&4&&(n|=t&16),e=i.entangledLanes,e!==0)for(i=i.entanglements,e&=n;0t;t++)e.push(i);return e}function bk(i,e,t){i.pendingLanes|=e,e!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,e=31-Zd(e),i[e]=t}function RMe(i,e){var t=i.pendingLanes&~e;i.pendingLanes=e,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=e,i.mutableReadLanes&=e,i.entangledLanes&=e,e=i.entanglements;var n=i.eventTimes;for(i=i.expirationTimes;0=JL),_te=String.fromCharCode(32),bte=!1;function zhe(i,e){switch(i){case"keyup":return sAe.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Uhe(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var H1=!1;function lAe(i,e){switch(i){case"compositionend":return Uhe(e);case"keypress":return e.which!==32?null:(bte=!0,_te);case"textInput":return i=e.data,i===_te&&bte?null:i;default:return null}}function cAe(i,e){if(H1)return i==="compositionend"||!fG&&zhe(i,e)?(i=Hhe(),X2=uG=Hm=null,H1=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-i};i=n}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=Ste(t)}}function qhe(i,e){return i&&e?i===e?!0:i&&i.nodeType===3?!1:e&&e.nodeType===3?qhe(i,e.parentNode):"contains"in i?i.contains(e):i.compareDocumentPosition?!!(i.compareDocumentPosition(e)&16):!1:!1}function Xhe(){for(var i=window,e=sA();e instanceof i.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)i=e.contentWindow;else break;e=sA(i.document)}return e}function gG(i){var e=i&&i.nodeName&&i.nodeName.toLowerCase();return e&&(e==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||e==="textarea"||i.contentEditable==="true")}function _Ae(i){var e=Xhe(),t=i.focusedElem,n=i.selectionRange;if(e!==t&&t&&t.ownerDocument&&qhe(t.ownerDocument.documentElement,t)){if(n!==null&&gG(t)){if(e=n.start,i=n.end,i===void 0&&(i=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(i,t.value.length);else if(i=(e=t.ownerDocument||document)&&e.defaultView||window,i.getSelection){i=i.getSelection();var r=t.textContent.length,o=Math.min(n.start,r);n=n.end===void 0?o:Math.min(n.end,r),!i.extend&&o>n&&(r=n,n=o,o=r),r=xte(t,o);var s=xte(t,n);r&&s&&(i.rangeCount!==1||i.anchorNode!==r.node||i.anchorOffset!==r.offset||i.focusNode!==s.node||i.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(r.node,r.offset),i.removeAllRanges(),o>n?(i.addRange(e),i.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),i.addRange(e)))}}for(e=[],i=t;i=i.parentNode;)i.nodeType===1&&e.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t=document.documentMode,V1=null,pW=null,tE=null,mW=!1;function Lte(i,e,t){var n=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;mW||V1==null||V1!==sA(n)||(n=V1,"selectionStart"in n&&gG(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),tE&&sD(tE,n)||(tE=n,n=fA(pW,"onSelect"),0j1||(i.current=wW[j1],wW[j1]=null,j1--)}function Xr(i,e){j1++,wW[j1]=i.current,i.current=e}var Bv={},el=C_(Bv),lc=C_(!1),bb=Bv;function hw(i,e){var t=i.type.contextTypes;if(!t)return Bv;var n=i.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var r={},o;for(o in t)r[o]=e[o];return n&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=e,i.__reactInternalMemoizedMaskedChildContext=r),r}function cc(i){return i=i.childContextTypes,i!=null}function pA(){so(lc),so(el)}function Rte(i,e,t){if(el.current!==Bv)throw Error(Et(168));Xr(el,e),Xr(lc,t)}function rfe(i,e,t){var n=i.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return t;n=n.getChildContext();for(var r in n)if(!(r in e))throw Error(Et(108,fMe(i)||"Unknown",r));return ko({},t,n)}function mA(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Bv,bb=el.current,Xr(el,i),Xr(lc,lc.current),!0}function Mte(i,e,t){var n=i.stateNode;if(!n)throw Error(Et(169));t?(i=rfe(i,e,bb),n.__reactInternalMemoizedMergedChildContext=i,so(lc),so(el),Xr(el,i)):so(lc),Xr(lc,t)}var Rg=null,wF=!1,N8=!1;function ofe(i){Rg===null?Rg=[i]:Rg.push(i)}function TAe(i){wF=!0,ofe(i)}function y_(){if(!N8&&Rg!==null){N8=!0;var i=0,e=yr;try{var t=Rg;for(yr=1;i>=s,r-=s,jg=1<<32-Zd(e)+r|t<k?(T=D,D=null):T=D.sibling;var M=h(m,D,y[k],S);if(M===null){D===null&&(D=T);break}i&&D&&M.alternate===null&&e(m,D),_=o(M,_,k),E===null?L=M:E.sibling=M,E=M,D=T}if(k===y.length)return t(m,D),po&&c0(m,k),L;if(D===null){for(;kk?(T=D,D=null):T=D.sibling;var A=h(m,D,M.value,S);if(A===null){D===null&&(D=T);break}i&&D&&A.alternate===null&&e(m,D),_=o(A,_,k),E===null?L=A:E.sibling=A,E=A,D=T}if(M.done)return t(m,D),po&&c0(m,k),L;if(D===null){for(;!M.done;k++,M=y.next())M=d(m,M.value,S),M!==null&&(_=o(M,_,k),E===null?L=M:E.sibling=M,E=M);return po&&c0(m,k),L}for(D=n(m,D);!M.done;k++,M=y.next())M=f(D,m,k,M.value,S),M!==null&&(i&&M.alternate!==null&&D.delete(M.key===null?k:M.key),_=o(M,_,k),E===null?L=M:E.sibling=M,E=M);return i&&D.forEach(function(N){return e(m,N)}),po&&c0(m,k),L}function v(m,_,y,S){if(typeof y=="object"&&y!==null&&y.type===$1&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case TN:e:{for(var L=y.key,E=_;E!==null;){if(E.key===L){if(L=y.type,L===$1){if(E.tag===7){t(m,E.sibling),_=r(E,y.props.children),_.return=m,m=_;break e}}else if(E.elementType===L||typeof L=="object"&&L!==null&&L.$$typeof===Em&&$te(L)===E.type){t(m,E.sibling),_=r(E,y.props),_.ref=Lx(m,E,y),_.return=m,m=_;break e}t(m,E);break}else e(m,E);E=E.sibling}y.type===$1?(_=eb(y.props.children,m.mode,S,y.key),_.return=m,m=_):(S=iM(y.type,y.key,y.props,null,m.mode,S),S.ref=Lx(m,_,y),S.return=m,m=S)}return s(m);case W1:e:{for(E=y.key;_!==null;){if(_.key===E)if(_.tag===4&&_.stateNode.containerInfo===y.containerInfo&&_.stateNode.implementation===y.implementation){t(m,_.sibling),_=r(_,y.children||[]),_.return=m,m=_;break e}else{t(m,_);break}else e(m,_);_=_.sibling}_=W8(y,m.mode,S),_.return=m,m=_}return s(m);case Em:return E=y._init,v(m,_,E(y._payload),S)}if(vL(y))return g(m,_,y,S);if(Cx(y))return p(m,_,y,S);HN(m,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,_!==null&&_.tag===6?(t(m,_.sibling),_=r(_,y),_.return=m,m=_):(t(m,_),_=B8(y,m.mode,S),_.return=m,m=_),s(m)):t(m,_)}return v}var gw=ffe(!0),gfe=ffe(!1),wk={},Df=C_(wk),uD=C_(wk),dD=C_(wk);function O0(i){if(i===wk)throw Error(Et(174));return i}function SG(i,e){switch(Xr(dD,e),Xr(uD,i),Xr(Df,wk),i=e.nodeType,i){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:oW(null,"");break;default:i=i===8?e.parentNode:e,e=i.namespaceURI||null,i=i.tagName,e=oW(e,i)}so(Df),Xr(Df,e)}function pw(){so(Df),so(uD),so(dD)}function pfe(i){O0(dD.current);var e=O0(Df.current),t=oW(e,i.type);e!==t&&(Xr(uD,i),Xr(Df,t))}function xG(i){uD.current===i&&(so(Df),so(uD))}var wo=C_(0);function wA(i){for(var e=i;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===i)break;for(;e.sibling===null;){if(e.return===null||e.return===i)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var R8=[];function LG(){for(var i=0;it?t:4,i(!0);var n=M8.transition;M8.transition={};try{i(!1),e()}finally{yr=t,M8.transition=n}}function Nfe(){return td().memoizedState}function AAe(i,e,t){var n=gv(i);if(t={lane:n,action:t,hasEagerState:!1,eagerState:null,next:null},Rfe(i))Mfe(e,t);else if(t=cfe(i,e,t,n),t!==null){var r=Sl();Qd(t,i,n,r),Afe(t,e,n)}}function PAe(i,e,t){var n=gv(i),r={lane:n,action:t,hasEagerState:!1,eagerState:null,next:null};if(Rfe(i))Mfe(e,r);else{var o=i.alternate;if(i.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var s=e.lastRenderedState,a=o(s,t);if(r.hasEagerState=!0,r.eagerState=a,ah(a,s)){var l=e.interleaved;l===null?(r.next=r,yG(e)):(r.next=l.next,l.next=r),e.interleaved=r;return}}catch{}finally{}t=cfe(i,e,r,n),t!==null&&(r=Sl(),Qd(t,i,n,r),Afe(t,e,n))}}function Rfe(i){var e=i.alternate;return i===Do||e!==null&&e===Do}function Mfe(i,e){nE=SA=!0;var t=i.pending;t===null?e.next=e:(e.next=t.next,t.next=e),i.pending=e}function Afe(i,e,t){if(t&4194240){var n=e.lanes;n&=i.pendingLanes,t|=n,e.lanes=t,aG(i,t)}}var xA={readContext:ed,useCallback:Ha,useContext:Ha,useEffect:Ha,useImperativeHandle:Ha,useInsertionEffect:Ha,useLayoutEffect:Ha,useMemo:Ha,useReducer:Ha,useRef:Ha,useState:Ha,useDebugValue:Ha,useDeferredValue:Ha,useTransition:Ha,useMutableSource:Ha,useSyncExternalStore:Ha,useId:Ha,unstable_isNewReconciler:!1},OAe={readContext:ed,useCallback:function(i,e){return Yh().memoizedState=[i,e===void 0?null:e],i},useContext:ed,useEffect:Vte,useImperativeHandle:function(i,e,t){return t=t!=null?t.concat([i]):null,J2(4194308,4,Efe.bind(null,e,i),t)},useLayoutEffect:function(i,e){return J2(4194308,4,i,e)},useInsertionEffect:function(i,e){return J2(4,2,i,e)},useMemo:function(i,e){var t=Yh();return e=e===void 0?null:e,i=i(),t.memoizedState=[i,e],i},useReducer:function(i,e,t){var n=Yh();return e=t!==void 0?t(e):e,n.memoizedState=n.baseState=e,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:e},n.queue=i,i=i.dispatch=AAe.bind(null,Do,i),[n.memoizedState,i]},useRef:function(i){var e=Yh();return i={current:i},e.memoizedState=i},useState:Hte,useDebugValue:TG,useDeferredValue:function(i){return Yh().memoizedState=i},useTransition:function(){var i=Hte(!1),e=i[0];return i=MAe.bind(null,i[1]),Yh().memoizedState=i,[e,i]},useMutableSource:function(){},useSyncExternalStore:function(i,e,t){var n=Do,r=Yh();if(po){if(t===void 0)throw Error(Et(407));t=t()}else{if(t=e(),Xs===null)throw Error(Et(349));yb&30||_fe(n,e,t)}r.memoizedState=t;var o={value:t,getSnapshot:e};return r.queue=o,Vte(Cfe.bind(null,n,o,i),[i]),n.flags|=2048,gD(9,bfe.bind(null,n,o,t,e),void 0,null),t},useId:function(){var i=Yh(),e=Xs.identifierPrefix;if(po){var t=Kg,n=jg;t=(n&~(1<<32-Zd(n)-1)).toString(32)+t,e=":"+e+"R"+t,t=hD++,0<\/script>",i=i.removeChild(i.firstChild)):typeof n.is=="string"?i=s.createElement(t,{is:n.is}):(i=s.createElement(t),t==="select"&&(s=i,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):i=s.createElementNS(i,t),i[cf]=e,i[cD]=n,zfe(i,e,!1,!1),e.stateNode=i;e:{switch(s=aW(t,n),t){case"dialog":eo("cancel",i),eo("close",i),r=n;break;case"iframe":case"object":case"embed":eo("load",i),r=n;break;case"video":case"audio":for(r=0;rvw&&(e.flags|=128,n=!0,Ex(o,!1),e.lanes=4194304)}else{if(!n)if(i=wA(s),i!==null){if(e.flags|=128,n=!0,t=i.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),Ex(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!po)return Va(e),null}else 2*Zo()-o.renderingStartTime>vw&&t!==1073741824&&(e.flags|=128,n=!0,Ex(o,!1),e.lanes=4194304);o.isBackwards?(s.sibling=e.child,e.child=s):(t=o.last,t!==null?t.sibling=s:e.child=s,o.last=s)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Zo(),e.sibling=null,t=wo.current,Xr(wo,n?t&1|2:t&1),e):(Va(e),null);case 22:case 23:return OG(),n=e.memoizedState!==null,i!==null&&i.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?$c&1073741824&&(Va(e),e.subtreeFlags&6&&(e.flags|=8192)):Va(e),null;case 24:return null;case 25:return null}throw Error(Et(156,e.tag))}function UAe(i,e){switch(mG(e),e.tag){case 1:return cc(e.type)&&pA(),i=e.flags,i&65536?(e.flags=i&-65537|128,e):null;case 3:return pw(),so(lc),so(el),LG(),i=e.flags,i&65536&&!(i&128)?(e.flags=i&-65537|128,e):null;case 5:return xG(e),null;case 13:if(so(wo),i=e.memoizedState,i!==null&&i.dehydrated!==null){if(e.alternate===null)throw Error(Et(340));fw()}return i=e.flags,i&65536?(e.flags=i&-65537|128,e):null;case 19:return so(wo),null;case 4:return pw(),null;case 10:return CG(e.type._context),null;case 22:case 23:return OG(),null;case 24:return null;default:return null}}var zN=!1,qa=!1,jAe=typeof WeakSet=="function"?WeakSet:Set,on=null;function X1(i,e){var t=i.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(n){Bo(i,e,n)}else t.current=null}function AW(i,e,t){try{t()}catch(n){Bo(i,e,n)}}var Zte=!1;function KAe(i,e){if(vW=dA,i=Xhe(),gG(i)){if("selectionStart"in i)var t={start:i.selectionStart,end:i.selectionEnd};else e:{t=(t=i.ownerDocument)&&t.defaultView||window;var n=t.getSelection&&t.getSelection();if(n&&n.rangeCount!==0){t=n.anchorNode;var r=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{t.nodeType,o.nodeType}catch{t=null;break e}var s=0,a=-1,l=-1,c=0,u=0,d=i,h=null;t:for(;;){for(var f;d!==t||r!==0&&d.nodeType!==3||(a=s+r),d!==o||n!==0&&d.nodeType!==3||(l=s+n),d.nodeType===3&&(s+=d.nodeValue.length),(f=d.firstChild)!==null;)h=d,d=f;for(;;){if(d===i)break t;if(h===t&&++c===r&&(a=s),h===o&&++u===n&&(l=s),(f=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=f}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(_W={focusedElem:i,selectionRange:t},dA=!1,on=e;on!==null;)if(e=on,i=e.child,(e.subtreeFlags&1028)!==0&&i!==null)i.return=e,on=i;else for(;on!==null;){e=on;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var p=g.memoizedProps,v=g.memoizedState,m=e.stateNode,_=m.getSnapshotBeforeUpdate(e.elementType===e.type?p:kd(e.type,p),v);m.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var y=e.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Et(163))}}catch(S){Bo(e,e.return,S)}if(i=e.sibling,i!==null){i.return=e.return,on=i;break}on=e.return}return g=Zte,Zte=!1,g}function iE(i,e,t){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var r=n=n.next;do{if((r.tag&i)===i){var o=r.destroy;r.destroy=void 0,o!==void 0&&AW(e,t,o)}r=r.next}while(r!==n)}}function LF(i,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&i)===i){var n=t.create;t.destroy=n()}t=t.next}while(t!==e)}}function PW(i){var e=i.ref;if(e!==null){var t=i.stateNode;switch(i.tag){case 5:i=t;break;default:i=t}typeof e=="function"?e(i):e.current=i}}function Kfe(i){var e=i.alternate;e!==null&&(i.alternate=null,Kfe(e)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(e=i.stateNode,e!==null&&(delete e[cf],delete e[cD],delete e[yW],delete e[IAe],delete e[kAe])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function Gfe(i){return i.tag===5||i.tag===3||i.tag===4}function Qte(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Gfe(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function OW(i,e,t){var n=i.tag;if(n===5||n===6)i=i.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(i,e):t.insertBefore(i,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(i,t)):(e=t,e.appendChild(i)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=gA));else if(n!==4&&(i=i.child,i!==null))for(OW(i,e,t),i=i.sibling;i!==null;)OW(i,e,t),i=i.sibling}function FW(i,e,t){var n=i.tag;if(n===5||n===6)i=i.stateNode,e?t.insertBefore(i,e):t.appendChild(i);else if(n!==4&&(i=i.child,i!==null))for(FW(i,e,t),i=i.sibling;i!==null;)FW(i,e,t),i=i.sibling}var aa=null,Rd=!1;function im(i,e,t){for(t=t.child;t!==null;)qfe(i,e,t),t=t.sibling}function qfe(i,e,t){if(Ef&&typeof Ef.onCommitFiberUnmount=="function")try{Ef.onCommitFiberUnmount(vF,t)}catch{}switch(t.tag){case 5:qa||X1(t,e);case 6:var n=aa,r=Rd;aa=null,im(i,e,t),aa=n,Rd=r,aa!==null&&(Rd?(i=aa,t=t.stateNode,i.nodeType===8?i.parentNode.removeChild(t):i.removeChild(t)):aa.removeChild(t.stateNode));break;case 18:aa!==null&&(Rd?(i=aa,t=t.stateNode,i.nodeType===8?T8(i.parentNode,t):i.nodeType===1&&T8(i,t),rD(i)):T8(aa,t.stateNode));break;case 4:n=aa,r=Rd,aa=t.stateNode.containerInfo,Rd=!0,im(i,e,t),aa=n,Rd=r;break;case 0:case 11:case 14:case 15:if(!qa&&(n=t.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){r=n=n.next;do{var o=r,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&AW(t,e,s),r=r.next}while(r!==n)}im(i,e,t);break;case 1:if(!qa&&(X1(t,e),n=t.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=t.memoizedProps,n.state=t.memoizedState,n.componentWillUnmount()}catch(a){Bo(t,e,a)}im(i,e,t);break;case 21:im(i,e,t);break;case 22:t.mode&1?(qa=(n=qa)||t.memoizedState!==null,im(i,e,t),qa=n):im(i,e,t);break;default:im(i,e,t)}}function Jte(i){var e=i.updateQueue;if(e!==null){i.updateQueue=null;var t=i.stateNode;t===null&&(t=i.stateNode=new jAe),e.forEach(function(n){var r=tPe.bind(null,i,n);t.has(n)||(t.add(n),n.then(r,r))})}}function bd(i,e){var t=e.deletions;if(t!==null)for(var n=0;nr&&(r=s),n&=~o}if(n=r,n=Zo()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*qAe(n/1960))-n,10i?16:i,Hm===null)var n=!1;else{if(i=Hm,Hm=null,DA=0,Yi&6)throw Error(Et(331));var r=Yi;for(Yi|=4,on=i.current;on!==null;){var o=on,s=o.child;if(on.flags&16){var a=o.deletions;if(a!==null){for(var l=0;lZo()-AG?eb(i,0):MG|=t),uc(i,e)}function nge(i,e){e===0&&(i.mode&1?(e=AN,AN<<=1,!(AN&130023424)&&(AN=4194304)):e=1);var t=Sl();i=Sp(i,e),i!==null&&(bk(i,e,t),uc(i,t))}function ePe(i){var e=i.memoizedState,t=0;e!==null&&(t=e.retryLane),nge(i,t)}function tPe(i,e){var t=0;switch(i.tag){case 13:var n=i.stateNode,r=i.memoizedState;r!==null&&(t=r.retryLane);break;case 19:n=i.stateNode;break;default:throw Error(Et(314))}n!==null&&n.delete(e),nge(i,t)}var ige;ige=function(i,e,t){if(i!==null)if(i.memoizedProps!==e.pendingProps||lc.current)sc=!0;else{if(!(i.lanes&t)&&!(e.flags&128))return sc=!1,VAe(i,e,t);sc=!!(i.flags&131072)}else sc=!1,po&&e.flags&1048576&&sfe(e,_A,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;eM(i,e),i=e.pendingProps;var r=hw(e,el.current);Iy(e,t),r=DG(null,e,n,i,r,t);var o=IG();return e.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,cc(n)?(o=!0,mA(e)):o=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,wG(e),r.updater=SF,e.stateNode=r,r._reactInternals=e,DW(e,n,i,t),e=TW(null,e,n,!0,o,t)):(e.tag=0,po&&o&&pG(e),_l(null,e,r,t),e=e.child),e;case 16:n=e.elementType;e:{switch(eM(i,e),i=e.pendingProps,r=n._init,n=r(n._payload),e.type=n,r=e.tag=iPe(n),i=kd(n,i),r){case 0:e=kW(null,e,n,i,t);break e;case 1:e=qte(null,e,n,i,t);break e;case 11:e=Kte(null,e,n,i,t);break e;case 14:e=Gte(null,e,n,kd(n.type,i),t);break e}throw Error(Et(306,n,""))}return e;case 0:return n=e.type,r=e.pendingProps,r=e.elementType===n?r:kd(n,r),kW(i,e,n,r,t);case 1:return n=e.type,r=e.pendingProps,r=e.elementType===n?r:kd(n,r),qte(i,e,n,r,t);case 3:e:{if($fe(e),i===null)throw Error(Et(387));n=e.pendingProps,o=e.memoizedState,r=o.element,ufe(i,e),yA(e,n,null,t);var s=e.memoizedState;if(n=s.element,o.isDehydrated)if(o={element:n,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){r=mw(Error(Et(423)),e),e=Xte(i,e,n,t,r);break e}else if(n!==r){r=mw(Error(Et(424)),e),e=Xte(i,e,n,t,r);break e}else for(Kc=uv(e.stateNode.containerInfo.firstChild),Qc=e,po=!0,Fd=null,t=gfe(e,null,n,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(fw(),n===r){e=xp(i,e,t);break e}_l(i,e,n,t)}e=e.child}return e;case 5:return pfe(e),i===null&&xW(e),n=e.type,r=e.pendingProps,o=i!==null?i.memoizedProps:null,s=r.children,bW(n,r)?s=null:o!==null&&bW(n,o)&&(e.flags|=32),Wfe(i,e),_l(i,e,s,t),e.child;case 6:return i===null&&xW(e),null;case 13:return Hfe(i,e,t);case 4:return SG(e,e.stateNode.containerInfo),n=e.pendingProps,i===null?e.child=gw(e,null,n,t):_l(i,e,n,t),e.child;case 11:return n=e.type,r=e.pendingProps,r=e.elementType===n?r:kd(n,r),Kte(i,e,n,r,t);case 7:return _l(i,e,e.pendingProps,t),e.child;case 8:return _l(i,e,e.pendingProps.children,t),e.child;case 12:return _l(i,e,e.pendingProps.children,t),e.child;case 10:e:{if(n=e.type._context,r=e.pendingProps,o=e.memoizedProps,s=r.value,Xr(bA,n._currentValue),n._currentValue=s,o!==null)if(ah(o.value,s)){if(o.children===r.children&&!lc.current){e=xp(i,e,t);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(o.tag===1){l=up(-1,t&-t),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}o.lanes|=t,l=o.alternate,l!==null&&(l.lanes|=t),LW(o.return,t,e),a.lanes|=t;break}l=l.next}}else if(o.tag===10)s=o.type===e.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(Et(341));s.lanes|=t,a=s.alternate,a!==null&&(a.lanes|=t),LW(s,t,e),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===e){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}_l(i,e,r.children,t),e=e.child}return e;case 9:return r=e.type,n=e.pendingProps.children,Iy(e,t),r=ed(r),n=n(r),e.flags|=1,_l(i,e,n,t),e.child;case 14:return n=e.type,r=kd(n,e.pendingProps),r=kd(n.type,r),Gte(i,e,n,r,t);case 15:return Ffe(i,e,e.type,e.pendingProps,t);case 17:return n=e.type,r=e.pendingProps,r=e.elementType===n?r:kd(n,r),eM(i,e),e.tag=1,cc(n)?(i=!0,mA(e)):i=!1,Iy(e,t),hfe(e,n,r),DW(e,n,r,t),TW(null,e,n,!0,i,t);case 19:return Vfe(i,e,t);case 22:return Bfe(i,e,t)}throw Error(Et(156,e.tag))};function rge(i,e){return The(i,e)}function nPe(i,e,t,n){this.tag=i,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Vu(i,e,t,n){return new nPe(i,e,t,n)}function BG(i){return i=i.prototype,!(!i||!i.isReactComponent)}function iPe(i){if(typeof i=="function")return BG(i)?1:0;if(i!=null){if(i=i.$$typeof,i===iG)return 11;if(i===rG)return 14}return 2}function gv(i,e){var t=i.alternate;return t===null?(t=Vu(i.tag,e,i.key,i.mode),t.elementType=i.elementType,t.type=i.type,t.stateNode=i.stateNode,t.alternate=i,i.alternate=t):(t.pendingProps=e,t.type=i.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=i.flags&14680064,t.childLanes=i.childLanes,t.lanes=i.lanes,t.child=i.child,t.memoizedProps=i.memoizedProps,t.memoizedState=i.memoizedState,t.updateQueue=i.updateQueue,e=i.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=i.sibling,t.index=i.index,t.ref=i.ref,t}function iM(i,e,t,n,r,o){var s=2;if(n=i,typeof i=="function")BG(i)&&(s=1);else if(typeof i=="string")s=5;else e:switch(i){case $1:return tb(t.children,r,o,e);case nG:s=8,r|=8;break;case Z7:return i=Vu(12,t,e,r|2),i.elementType=Z7,i.lanes=o,i;case Q7:return i=Vu(13,t,e,r),i.elementType=Q7,i.lanes=o,i;case J7:return i=Vu(19,t,e,r),i.elementType=J7,i.lanes=o,i;case fhe:return DF(t,r,o,e);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case dhe:s=10;break e;case hhe:s=9;break e;case iG:s=11;break e;case rG:s=14;break e;case Lm:s=16,n=null;break e}throw Error(Et(130,i==null?i:typeof i,""))}return e=Vu(s,t,e,r),e.elementType=i,e.type=n,e.lanes=o,e}function tb(i,e,t,n){return i=Vu(7,i,n,e),i.lanes=t,i}function DF(i,e,t,n){return i=Vu(22,i,n,e),i.elementType=fhe,i.lanes=t,i.stateNode={isHidden:!1},i}function B8(i,e,t){return i=Vu(6,i,null,e),i.lanes=t,i}function W8(i,e,t){return e=Vu(4,i.children!==null?i.children:[],i.key,e),e.lanes=t,e.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},e}function rPe(i,e,t,n,r){this.tag=e,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=b8(0),this.expirationTimes=b8(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=b8(0),this.identifierPrefix=n,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function WG(i,e,t,n,r,o,s,a,l){return i=new rPe(i,e,t,a,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=Vu(3,null,null,e),i.current=o,o.stateNode=i,o.memoizedState={element:n,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},wG(o),i}function oPe(i,e,t){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}e(),i.exports=cu})(sMe);const _w=qK(sh),uPe=Qde({__proto__:null,default:_w},[sh]);var ane=sh;q7.createRoot=ane.createRoot,q7.hydrateRoot=ane.hydrateRoot;var VW={},dPe={get exports(){return VW},set exports(i){VW=i}},lge={};/** +`+o.stack}return{value:i,source:e,stack:r,digest:null}}function O8(i,e,t){return{value:i,source:null,stack:t??null,digest:e??null}}function IW(i,e){try{console.error(e.value)}catch(t){setTimeout(function(){throw t})}}var WAe=typeof WeakMap=="function"?WeakMap:Map;function Pfe(i,e,t){t=up(-1,t),t.tag=3,t.payload={element:null};var n=e.value;return t.callback=function(){EA||(EA=!0,BW=n),IW(i,e)},t}function Ofe(i,e,t){t=up(-1,t),t.tag=3;var n=i.type.getDerivedStateFromError;if(typeof n=="function"){var r=e.value;t.payload=function(){return n(r)},t.callback=function(){IW(i,e)}}var o=i.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(t.callback=function(){IW(i,e),typeof n!="function"&&(fv===null?fv=new Set([this]):fv.add(this));var s=e.stack;this.componentDidCatch(e.value,{componentStack:s!==null?s:""})}),t}function zte(i,e,t){var n=i.pingCache;if(n===null){n=i.pingCache=new WAe;var r=new Set;n.set(e,r)}else r=n.get(e),r===void 0&&(r=new Set,n.set(e,r));r.has(t)||(r.add(t),i=JAe.bind(null,i,e,t),e.then(i,i))}function Ute(i){do{var e;if((e=i.tag===13)&&(e=i.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return i;i=i.return}while(i!==null);return null}function jte(i,e,t,n,r){return i.mode&1?(i.flags|=65536,i.lanes=r,i):(i===e?i.flags|=65536:(i.flags|=128,t.flags|=131072,t.flags&=-52805,t.tag===1&&(t.alternate===null?t.tag=17:(e=up(-1,1),e.tag=2,hv(t,e,1))),t.lanes|=1),i)}var $Ae=Hp.ReactCurrentOwner,sc=!1;function _l(i,e,t,n){e.child=i===null?gfe(e,null,t,n):gw(e,i.child,t,n)}function Kte(i,e,t,n,r){t=t.render;var o=e.ref;return Iy(e,r),n=DG(i,e,t,n,o,r),t=IG(),i!==null&&!sc?(e.updateQueue=i.updateQueue,e.flags&=-2053,i.lanes&=~r,Lp(i,e,r)):(po&&t&&pG(e),e.flags|=1,_l(i,e,n,r),e.child)}function Gte(i,e,t,n,r){if(i===null){var o=t.type;return typeof o=="function"&&!BG(o)&&o.defaultProps===void 0&&t.compare===null&&t.defaultProps===void 0?(e.tag=15,e.type=o,Ffe(i,e,o,n,r)):(i=iM(t.type,null,n,e,e.mode,r),i.ref=e.ref,i.return=e,e.child=i)}if(o=i.child,!(i.lanes&r)){var s=o.memoizedProps;if(t=t.compare,t=t!==null?t:sD,t(s,n)&&i.ref===e.ref)return Lp(i,e,r)}return e.flags|=1,i=pv(o,n),i.ref=e.ref,i.return=e,e.child=i}function Ffe(i,e,t,n,r){if(i!==null){var o=i.memoizedProps;if(sD(o,n)&&i.ref===e.ref)if(sc=!1,e.pendingProps=n=o,(i.lanes&r)!==0)i.flags&131072&&(sc=!0);else return e.lanes=i.lanes,Lp(i,e,r)}return kW(i,e,t,n,r)}function Bfe(i,e,t){var n=e.pendingProps,r=n.children,o=i!==null?i.memoizedState:null;if(n.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Xr(Y1,$c),$c|=t;else{if(!(t&1073741824))return i=o!==null?o.baseLanes|t:t,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:i,cachePool:null,transitions:null},e.updateQueue=null,Xr(Y1,$c),$c|=i,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=o!==null?o.baseLanes:t,Xr(Y1,$c),$c|=n}else o!==null?(n=o.baseLanes|t,e.memoizedState=null):n=t,Xr(Y1,$c),$c|=n;return _l(i,e,r,t),e.child}function Wfe(i,e){var t=e.ref;(i===null&&t!==null||i!==null&&i.ref!==t)&&(e.flags|=512,e.flags|=2097152)}function kW(i,e,t,n,r){var o=cc(t)?bb:el.current;return o=hw(e,o),Iy(e,r),t=DG(i,e,t,n,o,r),n=IG(),i!==null&&!sc?(e.updateQueue=i.updateQueue,e.flags&=-2053,i.lanes&=~r,Lp(i,e,r)):(po&&n&&pG(e),e.flags|=1,_l(i,e,t,r),e.child)}function qte(i,e,t,n,r){if(cc(t)){var o=!0;mA(e)}else o=!1;if(Iy(e,r),e.stateNode===null)eM(i,e),hfe(e,t,n),DW(e,t,n,r),n=!0;else if(i===null){var s=e.stateNode,a=e.memoizedProps;s.props=a;var l=s.context,c=t.contextType;typeof c=="object"&&c!==null?c=ed(c):(c=cc(t)?bb:el.current,c=hw(e,c));var u=t.getDerivedStateFromProps,d=typeof u=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==n||l!==c)&&Wte(e,s,n,c),Dm=!1;var h=e.memoizedState;s.state=h,yA(e,n,s,r),l=e.memoizedState,a!==n||h!==l||lc.current||Dm?(typeof u=="function"&&(EW(e,t,u,n),l=e.memoizedState),(a=Dm||Bte(e,t,a,n,h,l,c))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(e.flags|=4194308)):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=n,e.memoizedState=l),s.props=n,s.state=l,s.context=c,n=a):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),n=!1)}else{s=e.stateNode,ufe(i,e),a=e.memoizedProps,c=e.type===e.elementType?a:kd(e.type,a),s.props=c,d=e.pendingProps,h=s.context,l=t.contextType,typeof l=="object"&&l!==null?l=ed(l):(l=cc(t)?bb:el.current,l=hw(e,l));var f=t.getDerivedStateFromProps;(u=typeof f=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==d||h!==l)&&Wte(e,s,n,l),Dm=!1,h=e.memoizedState,s.state=h,yA(e,n,s,r);var g=e.memoizedState;a!==d||h!==g||lc.current||Dm?(typeof f=="function"&&(EW(e,t,f,n),g=e.memoizedState),(c=Dm||Bte(e,t,c,n,h,g,l)||!1)?(u||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(n,g,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(n,g,l)),typeof s.componentDidUpdate=="function"&&(e.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===i.memoizedProps&&h===i.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===i.memoizedProps&&h===i.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=g),s.props=n,s.state=g,s.context=l,n=c):(typeof s.componentDidUpdate!="function"||a===i.memoizedProps&&h===i.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===i.memoizedProps&&h===i.memoizedState||(e.flags|=1024),n=!1)}return TW(i,e,t,n,o,r)}function TW(i,e,t,n,r,o){Wfe(i,e);var s=(e.flags&128)!==0;if(!n&&!s)return r&&Mte(e,t,!1),Lp(i,e,o);n=e.stateNode,$Ae.current=e;var a=s&&typeof t.getDerivedStateFromError!="function"?null:n.render();return e.flags|=1,i!==null&&s?(e.child=gw(e,i.child,null,o),e.child=gw(e,null,a,o)):_l(i,e,a,o),e.memoizedState=n.state,r&&Mte(e,t,!0),e.child}function $fe(i){var e=i.stateNode;e.pendingContext?Rte(i,e.pendingContext,e.pendingContext!==e.context):e.context&&Rte(i,e.context,!1),SG(i,e.containerInfo)}function Xte(i,e,t,n,r){return fw(),vG(r),e.flags|=256,_l(i,e,t,n),e.child}var NW={dehydrated:null,treeContext:null,retryLane:0};function RW(i){return{baseLanes:i,cachePool:null,transitions:null}}function Hfe(i,e,t){var n=e.pendingProps,r=wo.current,o=!1,s=(e.flags&128)!==0,a;if((a=s)||(a=i!==null&&i.memoizedState===null?!1:(r&2)!==0),a?(o=!0,e.flags&=-129):(i===null||i.memoizedState!==null)&&(r|=1),Xr(wo,r&1),i===null)return xW(e),i=e.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?(e.mode&1?i.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(s=n.children,i=n.fallback,o?(n=e.mode,o=e.child,s={mode:"hidden",children:s},!(n&1)&&o!==null?(o.childLanes=0,o.pendingProps=s):o=DF(s,n,0,null),i=eb(i,n,t,null),o.return=e,i.return=e,o.sibling=i,e.child=o,e.child.memoizedState=RW(t),e.memoizedState=NW,i):NG(e,s));if(r=i.memoizedState,r!==null&&(a=r.dehydrated,a!==null))return HAe(i,e,s,n,a,r,t);if(o){o=n.fallback,s=e.mode,r=i.child,a=r.sibling;var l={mode:"hidden",children:n.children};return!(s&1)&&e.child!==r?(n=e.child,n.childLanes=0,n.pendingProps=l,e.deletions=null):(n=pv(r,l),n.subtreeFlags=r.subtreeFlags&14680064),a!==null?o=pv(a,o):(o=eb(o,s,t,null),o.flags|=2),o.return=e,n.return=e,n.sibling=o,e.child=n,n=o,o=e.child,s=i.child.memoizedState,s=s===null?RW(t):{baseLanes:s.baseLanes|t,cachePool:null,transitions:s.transitions},o.memoizedState=s,o.childLanes=i.childLanes&~t,e.memoizedState=NW,n}return o=i.child,i=o.sibling,n=pv(o,{mode:"visible",children:n.children}),!(e.mode&1)&&(n.lanes=t),n.return=e,n.sibling=null,i!==null&&(t=e.deletions,t===null?(e.deletions=[i],e.flags|=16):t.push(i)),e.child=n,e.memoizedState=null,n}function NG(i,e){return e=DF({mode:"visible",children:e},i.mode,0,null),e.return=i,i.child=e}function VN(i,e,t,n){return n!==null&&vG(n),gw(e,i.child,null,t),i=NG(e,e.pendingProps.children),i.flags|=2,e.memoizedState=null,i}function HAe(i,e,t,n,r,o,s){if(t)return e.flags&256?(e.flags&=-257,n=O8(Error(Et(422))),VN(i,e,s,n)):e.memoizedState!==null?(e.child=i.child,e.flags|=128,null):(o=n.fallback,r=e.mode,n=DF({mode:"visible",children:n.children},r,0,null),o=eb(o,r,s,null),o.flags|=2,n.return=e,o.return=e,n.sibling=o,e.child=n,e.mode&1&&gw(e,i.child,null,s),e.child.memoizedState=RW(s),e.memoizedState=NW,o);if(!(e.mode&1))return VN(i,e,s,null);if(r.data==="$!"){if(n=r.nextSibling&&r.nextSibling.dataset,n)var a=n.dgst;return n=a,o=Error(Et(419)),n=O8(o,n,void 0),VN(i,e,s,n)}if(a=(s&i.childLanes)!==0,sc||a){if(n=Xs,n!==null){switch(s&-s){case 4:r=2;break;case 16:r=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:r=32;break;case 536870912:r=268435456;break;default:r=0}r=r&(n.suspendedLanes|s)?0:r,r!==0&&r!==o.retryLane&&(o.retryLane=r,xp(i,r),Qd(n,i,r,-1))}return FG(),n=O8(Error(Et(421))),VN(i,e,s,n)}return r.data==="$?"?(e.flags|=128,e.child=i.child,e=ePe.bind(null,i),r._reactRetry=e,null):(i=o.treeContext,Kc=dv(r.nextSibling),Qc=e,po=!0,Fd=null,i!==null&&(Bu[Wu++]=jg,Bu[Wu++]=Kg,Bu[Wu++]=Cb,jg=i.id,Kg=i.overflow,Cb=e),e=NG(e,n.children),e.flags|=4096,e)}function Yte(i,e,t){i.lanes|=e;var n=i.alternate;n!==null&&(n.lanes|=e),LW(i.return,e,t)}function F8(i,e,t,n,r){var o=i.memoizedState;o===null?i.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:t,tailMode:r}:(o.isBackwards=e,o.rendering=null,o.renderingStartTime=0,o.last=n,o.tail=t,o.tailMode=r)}function Vfe(i,e,t){var n=e.pendingProps,r=n.revealOrder,o=n.tail;if(_l(i,e,n.children,t),n=wo.current,n&2)n=n&1|2,e.flags|=128;else{if(i!==null&&i.flags&128)e:for(i=e.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Yte(i,t,e);else if(i.tag===19)Yte(i,t,e);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===e)break e;for(;i.sibling===null;){if(i.return===null||i.return===e)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}n&=1}if(Xr(wo,n),!(e.mode&1))e.memoizedState=null;else switch(r){case"forwards":for(t=e.child,r=null;t!==null;)i=t.alternate,i!==null&&wA(i)===null&&(r=t),t=t.sibling;t=r,t===null?(r=e.child,e.child=null):(r=t.sibling,t.sibling=null),F8(e,!1,r,t,o);break;case"backwards":for(t=null,r=e.child,e.child=null;r!==null;){if(i=r.alternate,i!==null&&wA(i)===null){e.child=r;break}i=r.sibling,r.sibling=t,t=r,r=i}F8(e,!0,t,null,o);break;case"together":F8(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function eM(i,e){!(e.mode&1)&&i!==null&&(i.alternate=null,e.alternate=null,e.flags|=2)}function Lp(i,e,t){if(i!==null&&(e.dependencies=i.dependencies),wb|=e.lanes,!(t&e.childLanes))return null;if(i!==null&&e.child!==i.child)throw Error(Et(153));if(e.child!==null){for(i=e.child,t=pv(i,i.pendingProps),e.child=t,t.return=e;i.sibling!==null;)i=i.sibling,t=t.sibling=pv(i,i.pendingProps),t.return=e;t.sibling=null}return e.child}function VAe(i,e,t){switch(e.tag){case 3:$fe(e),fw();break;case 5:pfe(e);break;case 1:cc(e.type)&&mA(e);break;case 4:SG(e,e.stateNode.containerInfo);break;case 10:var n=e.type._context,r=e.memoizedProps.value;Xr(bA,n._currentValue),n._currentValue=r;break;case 13:if(n=e.memoizedState,n!==null)return n.dehydrated!==null?(Xr(wo,wo.current&1),e.flags|=128,null):t&e.child.childLanes?Hfe(i,e,t):(Xr(wo,wo.current&1),i=Lp(i,e,t),i!==null?i.sibling:null);Xr(wo,wo.current&1);break;case 19:if(n=(t&e.childLanes)!==0,i.flags&128){if(n)return Vfe(i,e,t);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Xr(wo,wo.current),n)break;return null;case 22:case 23:return e.lanes=0,Bfe(i,e,t)}return Lp(i,e,t)}var zfe,MW,Ufe,jfe;zfe=function(i,e){for(var t=e.child;t!==null;){if(t.tag===5||t.tag===6)i.appendChild(t.stateNode);else if(t.tag!==4&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return;t=t.return}t.sibling.return=t.return,t=t.sibling}};MW=function(){};Ufe=function(i,e,t,n){var r=i.memoizedProps;if(r!==n){i=e.stateNode,O0(Df.current);var o=null;switch(t){case"input":r=tW(i,r),n=tW(i,n),o=[];break;case"select":r=ko({},r,{value:void 0}),n=ko({},n,{value:void 0}),o=[];break;case"textarea":r=rW(i,r),n=rW(i,n),o=[];break;default:typeof r.onClick!="function"&&typeof n.onClick=="function"&&(i.onclick=gA)}sW(t,n);var s;t=null;for(c in r)if(!n.hasOwnProperty(c)&&r.hasOwnProperty(c)&&r[c]!=null)if(c==="style"){var a=r[c];for(s in a)a.hasOwnProperty(s)&&(t||(t={}),t[s]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(JE.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in n){var l=n[c];if(a=r!=null?r[c]:void 0,n.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(t||(t={}),t[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(t||(t={}),t[s]=l[s])}else t||(o||(o=[]),o.push(c,t)),t=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(o=o||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(JE.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&eo("scroll",i),o||a===l||(o=[])):(o=o||[]).push(c,l))}t&&(o=o||[]).push("style",t);var c=o;(e.updateQueue=c)&&(e.flags|=4)}};jfe=function(i,e,t,n){t!==n&&(e.flags|=4)};function Ex(i,e){if(!po)switch(i.tailMode){case"hidden":e=i.tail;for(var t=null;e!==null;)e.alternate!==null&&(t=e),e=e.sibling;t===null?i.tail=null:t.sibling=null;break;case"collapsed":t=i.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e||i.tail===null?i.tail=null:i.tail.sibling=null:n.sibling=null}}function Va(i){var e=i.alternate!==null&&i.alternate.child===i.child,t=0,n=0;if(e)for(var r=i.child;r!==null;)t|=r.lanes|r.childLanes,n|=r.subtreeFlags&14680064,n|=r.flags&14680064,r.return=i,r=r.sibling;else for(r=i.child;r!==null;)t|=r.lanes|r.childLanes,n|=r.subtreeFlags,n|=r.flags,r.return=i,r=r.sibling;return i.subtreeFlags|=n,i.childLanes=t,e}function zAe(i,e,t){var n=e.pendingProps;switch(mG(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Va(e),null;case 1:return cc(e.type)&&pA(),Va(e),null;case 3:return n=e.stateNode,pw(),so(lc),so(el),LG(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(i===null||i.child===null)&&($N(e)?e.flags|=4:i===null||i.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Fd!==null&&(HW(Fd),Fd=null))),MW(i,e),Va(e),null;case 5:xG(e);var r=O0(dD.current);if(t=e.type,i!==null&&e.stateNode!=null)Ufe(i,e,t,n,r),i.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!n){if(e.stateNode===null)throw Error(Et(166));return Va(e),null}if(i=O0(Df.current),$N(e)){n=e.stateNode,t=e.type;var o=e.memoizedProps;switch(n[cf]=e,n[cD]=o,i=(e.mode&1)!==0,t){case"dialog":eo("cancel",n),eo("close",n);break;case"iframe":case"object":case"embed":eo("load",n);break;case"video":case"audio":for(r=0;r<\/script>",i=i.removeChild(i.firstChild)):typeof n.is=="string"?i=s.createElement(t,{is:n.is}):(i=s.createElement(t),t==="select"&&(s=i,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):i=s.createElementNS(i,t),i[cf]=e,i[cD]=n,zfe(i,e,!1,!1),e.stateNode=i;e:{switch(s=aW(t,n),t){case"dialog":eo("cancel",i),eo("close",i),r=n;break;case"iframe":case"object":case"embed":eo("load",i),r=n;break;case"video":case"audio":for(r=0;rvw&&(e.flags|=128,n=!0,Ex(o,!1),e.lanes=4194304)}else{if(!n)if(i=wA(s),i!==null){if(e.flags|=128,n=!0,t=i.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),Ex(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!po)return Va(e),null}else 2*Zo()-o.renderingStartTime>vw&&t!==1073741824&&(e.flags|=128,n=!0,Ex(o,!1),e.lanes=4194304);o.isBackwards?(s.sibling=e.child,e.child=s):(t=o.last,t!==null?t.sibling=s:e.child=s,o.last=s)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Zo(),e.sibling=null,t=wo.current,Xr(wo,n?t&1|2:t&1),e):(Va(e),null);case 22:case 23:return OG(),n=e.memoizedState!==null,i!==null&&i.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?$c&1073741824&&(Va(e),e.subtreeFlags&6&&(e.flags|=8192)):Va(e),null;case 24:return null;case 25:return null}throw Error(Et(156,e.tag))}function UAe(i,e){switch(mG(e),e.tag){case 1:return cc(e.type)&&pA(),i=e.flags,i&65536?(e.flags=i&-65537|128,e):null;case 3:return pw(),so(lc),so(el),LG(),i=e.flags,i&65536&&!(i&128)?(e.flags=i&-65537|128,e):null;case 5:return xG(e),null;case 13:if(so(wo),i=e.memoizedState,i!==null&&i.dehydrated!==null){if(e.alternate===null)throw Error(Et(340));fw()}return i=e.flags,i&65536?(e.flags=i&-65537|128,e):null;case 19:return so(wo),null;case 4:return pw(),null;case 10:return CG(e.type._context),null;case 22:case 23:return OG(),null;case 24:return null;default:return null}}var zN=!1,qa=!1,jAe=typeof WeakSet=="function"?WeakSet:Set,on=null;function X1(i,e){var t=i.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(n){Bo(i,e,n)}else t.current=null}function AW(i,e,t){try{t()}catch(n){Bo(i,e,n)}}var Zte=!1;function KAe(i,e){if(vW=dA,i=Xhe(),gG(i)){if("selectionStart"in i)var t={start:i.selectionStart,end:i.selectionEnd};else e:{t=(t=i.ownerDocument)&&t.defaultView||window;var n=t.getSelection&&t.getSelection();if(n&&n.rangeCount!==0){t=n.anchorNode;var r=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{t.nodeType,o.nodeType}catch{t=null;break e}var s=0,a=-1,l=-1,c=0,u=0,d=i,h=null;t:for(;;){for(var f;d!==t||r!==0&&d.nodeType!==3||(a=s+r),d!==o||n!==0&&d.nodeType!==3||(l=s+n),d.nodeType===3&&(s+=d.nodeValue.length),(f=d.firstChild)!==null;)h=d,d=f;for(;;){if(d===i)break t;if(h===t&&++c===r&&(a=s),h===o&&++u===n&&(l=s),(f=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=f}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(_W={focusedElem:i,selectionRange:t},dA=!1,on=e;on!==null;)if(e=on,i=e.child,(e.subtreeFlags&1028)!==0&&i!==null)i.return=e,on=i;else for(;on!==null;){e=on;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var p=g.memoizedProps,v=g.memoizedState,m=e.stateNode,_=m.getSnapshotBeforeUpdate(e.elementType===e.type?p:kd(e.type,p),v);m.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var y=e.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Et(163))}}catch(S){Bo(e,e.return,S)}if(i=e.sibling,i!==null){i.return=e.return,on=i;break}on=e.return}return g=Zte,Zte=!1,g}function iE(i,e,t){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var r=n=n.next;do{if((r.tag&i)===i){var o=r.destroy;r.destroy=void 0,o!==void 0&&AW(e,t,o)}r=r.next}while(r!==n)}}function LF(i,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&i)===i){var n=t.create;t.destroy=n()}t=t.next}while(t!==e)}}function PW(i){var e=i.ref;if(e!==null){var t=i.stateNode;switch(i.tag){case 5:i=t;break;default:i=t}typeof e=="function"?e(i):e.current=i}}function Kfe(i){var e=i.alternate;e!==null&&(i.alternate=null,Kfe(e)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(e=i.stateNode,e!==null&&(delete e[cf],delete e[cD],delete e[yW],delete e[IAe],delete e[kAe])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function Gfe(i){return i.tag===5||i.tag===3||i.tag===4}function Qte(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Gfe(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function OW(i,e,t){var n=i.tag;if(n===5||n===6)i=i.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(i,e):t.insertBefore(i,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(i,t)):(e=t,e.appendChild(i)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=gA));else if(n!==4&&(i=i.child,i!==null))for(OW(i,e,t),i=i.sibling;i!==null;)OW(i,e,t),i=i.sibling}function FW(i,e,t){var n=i.tag;if(n===5||n===6)i=i.stateNode,e?t.insertBefore(i,e):t.appendChild(i);else if(n!==4&&(i=i.child,i!==null))for(FW(i,e,t),i=i.sibling;i!==null;)FW(i,e,t),i=i.sibling}var aa=null,Rd=!1;function rm(i,e,t){for(t=t.child;t!==null;)qfe(i,e,t),t=t.sibling}function qfe(i,e,t){if(Ef&&typeof Ef.onCommitFiberUnmount=="function")try{Ef.onCommitFiberUnmount(vF,t)}catch{}switch(t.tag){case 5:qa||X1(t,e);case 6:var n=aa,r=Rd;aa=null,rm(i,e,t),aa=n,Rd=r,aa!==null&&(Rd?(i=aa,t=t.stateNode,i.nodeType===8?i.parentNode.removeChild(t):i.removeChild(t)):aa.removeChild(t.stateNode));break;case 18:aa!==null&&(Rd?(i=aa,t=t.stateNode,i.nodeType===8?T8(i.parentNode,t):i.nodeType===1&&T8(i,t),rD(i)):T8(aa,t.stateNode));break;case 4:n=aa,r=Rd,aa=t.stateNode.containerInfo,Rd=!0,rm(i,e,t),aa=n,Rd=r;break;case 0:case 11:case 14:case 15:if(!qa&&(n=t.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){r=n=n.next;do{var o=r,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&AW(t,e,s),r=r.next}while(r!==n)}rm(i,e,t);break;case 1:if(!qa&&(X1(t,e),n=t.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=t.memoizedProps,n.state=t.memoizedState,n.componentWillUnmount()}catch(a){Bo(t,e,a)}rm(i,e,t);break;case 21:rm(i,e,t);break;case 22:t.mode&1?(qa=(n=qa)||t.memoizedState!==null,rm(i,e,t),qa=n):rm(i,e,t);break;default:rm(i,e,t)}}function Jte(i){var e=i.updateQueue;if(e!==null){i.updateQueue=null;var t=i.stateNode;t===null&&(t=i.stateNode=new jAe),e.forEach(function(n){var r=tPe.bind(null,i,n);t.has(n)||(t.add(n),n.then(r,r))})}}function bd(i,e){var t=e.deletions;if(t!==null)for(var n=0;nr&&(r=s),n&=~o}if(n=r,n=Zo()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*qAe(n/1960))-n,10i?16:i,Vm===null)var n=!1;else{if(i=Vm,Vm=null,DA=0,Yi&6)throw Error(Et(331));var r=Yi;for(Yi|=4,on=i.current;on!==null;){var o=on,s=o.child;if(on.flags&16){var a=o.deletions;if(a!==null){for(var l=0;lZo()-AG?J0(i,0):MG|=t),uc(i,e)}function nge(i,e){e===0&&(i.mode&1?(e=AN,AN<<=1,!(AN&130023424)&&(AN=4194304)):e=1);var t=Sl();i=xp(i,e),i!==null&&(bk(i,e,t),uc(i,t))}function ePe(i){var e=i.memoizedState,t=0;e!==null&&(t=e.retryLane),nge(i,t)}function tPe(i,e){var t=0;switch(i.tag){case 13:var n=i.stateNode,r=i.memoizedState;r!==null&&(t=r.retryLane);break;case 19:n=i.stateNode;break;default:throw Error(Et(314))}n!==null&&n.delete(e),nge(i,t)}var ige;ige=function(i,e,t){if(i!==null)if(i.memoizedProps!==e.pendingProps||lc.current)sc=!0;else{if(!(i.lanes&t)&&!(e.flags&128))return sc=!1,VAe(i,e,t);sc=!!(i.flags&131072)}else sc=!1,po&&e.flags&1048576&&sfe(e,_A,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;eM(i,e),i=e.pendingProps;var r=hw(e,el.current);Iy(e,t),r=DG(null,e,n,i,r,t);var o=IG();return e.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,cc(n)?(o=!0,mA(e)):o=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,wG(e),r.updater=SF,e.stateNode=r,r._reactInternals=e,DW(e,n,i,t),e=TW(null,e,n,!0,o,t)):(e.tag=0,po&&o&&pG(e),_l(null,e,r,t),e=e.child),e;case 16:n=e.elementType;e:{switch(eM(i,e),i=e.pendingProps,r=n._init,n=r(n._payload),e.type=n,r=e.tag=iPe(n),i=kd(n,i),r){case 0:e=kW(null,e,n,i,t);break e;case 1:e=qte(null,e,n,i,t);break e;case 11:e=Kte(null,e,n,i,t);break e;case 14:e=Gte(null,e,n,kd(n.type,i),t);break e}throw Error(Et(306,n,""))}return e;case 0:return n=e.type,r=e.pendingProps,r=e.elementType===n?r:kd(n,r),kW(i,e,n,r,t);case 1:return n=e.type,r=e.pendingProps,r=e.elementType===n?r:kd(n,r),qte(i,e,n,r,t);case 3:e:{if($fe(e),i===null)throw Error(Et(387));n=e.pendingProps,o=e.memoizedState,r=o.element,ufe(i,e),yA(e,n,null,t);var s=e.memoizedState;if(n=s.element,o.isDehydrated)if(o={element:n,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){r=mw(Error(Et(423)),e),e=Xte(i,e,n,t,r);break e}else if(n!==r){r=mw(Error(Et(424)),e),e=Xte(i,e,n,t,r);break e}else for(Kc=dv(e.stateNode.containerInfo.firstChild),Qc=e,po=!0,Fd=null,t=gfe(e,null,n,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(fw(),n===r){e=Lp(i,e,t);break e}_l(i,e,n,t)}e=e.child}return e;case 5:return pfe(e),i===null&&xW(e),n=e.type,r=e.pendingProps,o=i!==null?i.memoizedProps:null,s=r.children,bW(n,r)?s=null:o!==null&&bW(n,o)&&(e.flags|=32),Wfe(i,e),_l(i,e,s,t),e.child;case 6:return i===null&&xW(e),null;case 13:return Hfe(i,e,t);case 4:return SG(e,e.stateNode.containerInfo),n=e.pendingProps,i===null?e.child=gw(e,null,n,t):_l(i,e,n,t),e.child;case 11:return n=e.type,r=e.pendingProps,r=e.elementType===n?r:kd(n,r),Kte(i,e,n,r,t);case 7:return _l(i,e,e.pendingProps,t),e.child;case 8:return _l(i,e,e.pendingProps.children,t),e.child;case 12:return _l(i,e,e.pendingProps.children,t),e.child;case 10:e:{if(n=e.type._context,r=e.pendingProps,o=e.memoizedProps,s=r.value,Xr(bA,n._currentValue),n._currentValue=s,o!==null)if(ah(o.value,s)){if(o.children===r.children&&!lc.current){e=Lp(i,e,t);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(o.tag===1){l=up(-1,t&-t),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}o.lanes|=t,l=o.alternate,l!==null&&(l.lanes|=t),LW(o.return,t,e),a.lanes|=t;break}l=l.next}}else if(o.tag===10)s=o.type===e.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(Et(341));s.lanes|=t,a=s.alternate,a!==null&&(a.lanes|=t),LW(s,t,e),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===e){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}_l(i,e,r.children,t),e=e.child}return e;case 9:return r=e.type,n=e.pendingProps.children,Iy(e,t),r=ed(r),n=n(r),e.flags|=1,_l(i,e,n,t),e.child;case 14:return n=e.type,r=kd(n,e.pendingProps),r=kd(n.type,r),Gte(i,e,n,r,t);case 15:return Ffe(i,e,e.type,e.pendingProps,t);case 17:return n=e.type,r=e.pendingProps,r=e.elementType===n?r:kd(n,r),eM(i,e),e.tag=1,cc(n)?(i=!0,mA(e)):i=!1,Iy(e,t),hfe(e,n,r),DW(e,n,r,t),TW(null,e,n,!0,i,t);case 19:return Vfe(i,e,t);case 22:return Bfe(i,e,t)}throw Error(Et(156,e.tag))};function rge(i,e){return The(i,e)}function nPe(i,e,t,n){this.tag=i,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Vu(i,e,t,n){return new nPe(i,e,t,n)}function BG(i){return i=i.prototype,!(!i||!i.isReactComponent)}function iPe(i){if(typeof i=="function")return BG(i)?1:0;if(i!=null){if(i=i.$$typeof,i===iG)return 11;if(i===rG)return 14}return 2}function pv(i,e){var t=i.alternate;return t===null?(t=Vu(i.tag,e,i.key,i.mode),t.elementType=i.elementType,t.type=i.type,t.stateNode=i.stateNode,t.alternate=i,i.alternate=t):(t.pendingProps=e,t.type=i.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=i.flags&14680064,t.childLanes=i.childLanes,t.lanes=i.lanes,t.child=i.child,t.memoizedProps=i.memoizedProps,t.memoizedState=i.memoizedState,t.updateQueue=i.updateQueue,e=i.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=i.sibling,t.index=i.index,t.ref=i.ref,t}function iM(i,e,t,n,r,o){var s=2;if(n=i,typeof i=="function")BG(i)&&(s=1);else if(typeof i=="string")s=5;else e:switch(i){case $1:return eb(t.children,r,o,e);case nG:s=8,r|=8;break;case Z7:return i=Vu(12,t,e,r|2),i.elementType=Z7,i.lanes=o,i;case Q7:return i=Vu(13,t,e,r),i.elementType=Q7,i.lanes=o,i;case J7:return i=Vu(19,t,e,r),i.elementType=J7,i.lanes=o,i;case fhe:return DF(t,r,o,e);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case dhe:s=10;break e;case hhe:s=9;break e;case iG:s=11;break e;case rG:s=14;break e;case Em:s=16,n=null;break e}throw Error(Et(130,i==null?i:typeof i,""))}return e=Vu(s,t,e,r),e.elementType=i,e.type=n,e.lanes=o,e}function eb(i,e,t,n){return i=Vu(7,i,n,e),i.lanes=t,i}function DF(i,e,t,n){return i=Vu(22,i,n,e),i.elementType=fhe,i.lanes=t,i.stateNode={isHidden:!1},i}function B8(i,e,t){return i=Vu(6,i,null,e),i.lanes=t,i}function W8(i,e,t){return e=Vu(4,i.children!==null?i.children:[],i.key,e),e.lanes=t,e.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},e}function rPe(i,e,t,n,r){this.tag=e,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=b8(0),this.expirationTimes=b8(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=b8(0),this.identifierPrefix=n,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function WG(i,e,t,n,r,o,s,a,l){return i=new rPe(i,e,t,a,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=Vu(3,null,null,e),i.current=o,o.stateNode=i,o.memoizedState={element:n,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},wG(o),i}function oPe(i,e,t){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}e(),i.exports=cu})(sMe);const _w=qK(sh),uPe=Qde({__proto__:null,default:_w},[sh]);var ane=sh;q7.createRoot=ane.createRoot,q7.hydrateRoot=ane.hydrateRoot;var VW={},dPe={get exports(){return VW},set exports(i){VW=i}},lge={};/** * @license React * use-sync-external-store-shim.production.min.js * @@ -53,7 +53,7 @@ Error generating stack: `+o.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var RF=C,wPe=VW;function SPe(i,e){return i===e&&(i!==0||1/i===1/e)||i!==i&&e!==e}var xPe=typeof Object.is=="function"?Object.is:SPe,LPe=wPe.useSyncExternalStore,EPe=RF.useRef,DPe=RF.useEffect,IPe=RF.useMemo,kPe=RF.useDebugValue;cge.useSyncExternalStoreWithSelector=function(i,e,t,n,r){var o=EPe(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=IPe(function(){function l(f){if(!c){if(c=!0,u=f,f=n(f),r!==void 0&&s.hasValue){var g=s.value;if(r(g,f))return d=g}return d=f}if(g=d,xPe(u,f))return g;var p=n(f);return r!==void 0&&r(g,p)?g:(u=f,d=p)}var c=!1,u,d,h=t===void 0?null:t;return[function(){return l(e())},h===null?void 0:function(){return l(h())}]},[e,t,n,r]);var a=LPe(i,o[0],o[1]);return DPe(function(){s.hasValue=!0,s.value=a},[a]),kPe(a),a};(function(i){i.exports=cge})(yPe);function TPe(i){i()}let uge=TPe;const NPe=i=>uge=i,RPe=()=>uge,$v=C.createContext(null);function dge(){return C.useContext($v)}const MPe=()=>{throw new Error("uSES not initialized!")};let hge=MPe;const APe=i=>{hge=i},PPe=(i,e)=>i===e;function OPe(i=$v){const e=i===$v?dge:()=>C.useContext(i);return function(n,r=PPe){const{store:o,subscription:s,getServerState:a}=e(),l=hge(s.addNestedSub,o.getState,a||o.getState,n,r);return C.useDebugValue(l),l}}const FPe=OPe();function St(){return St=Object.assign?Object.assign.bind():function(i){for(var e=1;e=0)&&(t[r]=i[r]);return t}var mD={},WPe={get exports(){return mD},set exports(i){mD=i}},xr={};/** @license React v16.13.1 + */var RF=C,wPe=VW;function SPe(i,e){return i===e&&(i!==0||1/i===1/e)||i!==i&&e!==e}var xPe=typeof Object.is=="function"?Object.is:SPe,LPe=wPe.useSyncExternalStore,EPe=RF.useRef,DPe=RF.useEffect,IPe=RF.useMemo,kPe=RF.useDebugValue;cge.useSyncExternalStoreWithSelector=function(i,e,t,n,r){var o=EPe(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=IPe(function(){function l(f){if(!c){if(c=!0,u=f,f=n(f),r!==void 0&&s.hasValue){var g=s.value;if(r(g,f))return d=g}return d=f}if(g=d,xPe(u,f))return g;var p=n(f);return r!==void 0&&r(g,p)?g:(u=f,d=p)}var c=!1,u,d,h=t===void 0?null:t;return[function(){return l(e())},h===null?void 0:function(){return l(h())}]},[e,t,n,r]);var a=LPe(i,o[0],o[1]);return DPe(function(){s.hasValue=!0,s.value=a},[a]),kPe(a),a};(function(i){i.exports=cge})(yPe);function TPe(i){i()}let uge=TPe;const NPe=i=>uge=i,RPe=()=>uge,Wv=C.createContext(null);function dge(){return C.useContext(Wv)}const MPe=()=>{throw new Error("uSES not initialized!")};let hge=MPe;const APe=i=>{hge=i},PPe=(i,e)=>i===e;function OPe(i=Wv){const e=i===Wv?dge:()=>C.useContext(i);return function(n,r=PPe){const{store:o,subscription:s,getServerState:a}=e(),l=hge(s.addNestedSub,o.getState,a||o.getState,n,r);return C.useDebugValue(l),l}}const FPe=OPe();function St(){return St=Object.assign?Object.assign.bind():function(i){for(var e=1;e=0)&&(t[r]=i[r]);return t}var mD={},WPe={get exports(){return mD},set exports(i){mD=i}},xr={};/** @license React v16.13.1 * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. @@ -68,7 +68,7 @@ Error generating stack: `+o.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var KG=Symbol.for("react.element"),GG=Symbol.for("react.portal"),zF=Symbol.for("react.fragment"),UF=Symbol.for("react.strict_mode"),jF=Symbol.for("react.profiler"),KF=Symbol.for("react.provider"),GF=Symbol.for("react.context"),qPe=Symbol.for("react.server_context"),qF=Symbol.for("react.forward_ref"),XF=Symbol.for("react.suspense"),YF=Symbol.for("react.suspense_list"),ZF=Symbol.for("react.memo"),QF=Symbol.for("react.lazy"),XPe=Symbol.for("react.offscreen"),mge;mge=Symbol.for("react.module.reference");function sd(i){if(typeof i=="object"&&i!==null){var e=i.$$typeof;switch(e){case KG:switch(i=i.type,i){case zF:case jF:case UF:case XF:case YF:return i;default:switch(i=i&&i.$$typeof,i){case qPe:case GF:case qF:case QF:case ZF:case KF:return i;default:return e}}case GG:return e}}}Lr.ContextConsumer=GF;Lr.ContextProvider=KF;Lr.Element=KG;Lr.ForwardRef=qF;Lr.Fragment=zF;Lr.Lazy=QF;Lr.Memo=ZF;Lr.Portal=GG;Lr.Profiler=jF;Lr.StrictMode=UF;Lr.Suspense=XF;Lr.SuspenseList=YF;Lr.isAsyncMode=function(){return!1};Lr.isConcurrentMode=function(){return!1};Lr.isContextConsumer=function(i){return sd(i)===GF};Lr.isContextProvider=function(i){return sd(i)===KF};Lr.isElement=function(i){return typeof i=="object"&&i!==null&&i.$$typeof===KG};Lr.isForwardRef=function(i){return sd(i)===qF};Lr.isFragment=function(i){return sd(i)===zF};Lr.isLazy=function(i){return sd(i)===QF};Lr.isMemo=function(i){return sd(i)===ZF};Lr.isPortal=function(i){return sd(i)===GG};Lr.isProfiler=function(i){return sd(i)===jF};Lr.isStrictMode=function(i){return sd(i)===UF};Lr.isSuspense=function(i){return sd(i)===XF};Lr.isSuspenseList=function(i){return sd(i)===YF};Lr.isValidElementType=function(i){return typeof i=="string"||typeof i=="function"||i===zF||i===jF||i===UF||i===XF||i===YF||i===XPe||typeof i=="object"&&i!==null&&(i.$$typeof===QF||i.$$typeof===ZF||i.$$typeof===KF||i.$$typeof===GF||i.$$typeof===qF||i.$$typeof===mge||i.getModuleId!==void 0)};Lr.typeOf=sd;(function(i){i.exports=Lr})(GPe);function YPe(){const i=RPe();let e=null,t=null;return{clear(){e=null,t=null},notify(){i(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){let n=[],r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0,o=t={callback:n,next:null,prev:t};return o.prev?o.prev.next=o:e=o,function(){!r||e===null||(r=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}const cne={notify(){},get:()=>[]};function ZPe(i,e){let t,n=cne;function r(d){return l(),n.subscribe(d)}function o(){n.notify()}function s(){u.onStateChange&&u.onStateChange()}function a(){return!!t}function l(){t||(t=e?e.addNestedSub(s):i.subscribe(s),n=YPe())}function c(){t&&(t(),t=void 0,n.clear(),n=cne)}const u={addNestedSub:r,notifyNestedSubs:o,handleChangeWrapper:s,isSubscribed:a,trySubscribe:l,tryUnsubscribe:c,getListeners:()=>n};return u}const QPe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",JPe=QPe?C.useLayoutEffect:C.useEffect;function eOe({store:i,context:e,children:t,serverState:n}){const r=C.useMemo(()=>{const a=ZPe(i);return{store:i,subscription:a,getServerState:n?()=>n:void 0}},[i,n]),o=C.useMemo(()=>i.getState(),[i]);JPe(()=>{const{subscription:a}=r;return a.onStateChange=a.notifyNestedSubs,a.trySubscribe(),o!==i.getState()&&a.notifyNestedSubs(),()=>{a.tryUnsubscribe(),a.onStateChange=void 0}},[r,o]);const s=e||$v;return $e.createElement(s.Provider,{value:r},t)}function vge(i=$v){const e=i===$v?dge:()=>C.useContext(i);return function(){const{store:n}=e();return n}}const tOe=vge();function nOe(i=$v){const e=i===$v?tOe:vge(i);return function(){return e().dispatch}}const iOe=nOe();APe(zW.useSyncExternalStoreWithSelector);NPe(sh.unstable_batchedUpdates);const yS=iOe,Gr=FPe;var UW=function(i,e){return UW=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])},UW(i,e)};function ad(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");UW(i,e);function t(){this.constructor=i}i.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var un=function(){return un=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0}),t=[],n=0,r=e;n1)throw new RangeError("integer-width stems only accept a single optional option");r.options[0].replace(dOe,function(l,c,u,d,h,f){if(c)e.minimumIntegerDigits=u.length;else{if(d&&h)throw new Error("We currently do not support maximum integer digits");if(f)throw new Error("We currently do not support exact integer digits")}return""});continue}if(Ige.test(r.stem)){e.minimumIntegerDigits=r.stem.length;continue}if(dne.test(r.stem)){if(r.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");r.stem.replace(dne,function(l,c,u,d,h,f){return u==="*"?e.minimumFractionDigits=c.length:d&&d[0]==="#"?e.maximumFractionDigits=d.length:h&&f?(e.minimumFractionDigits=h.length,e.maximumFractionDigits=h.length+f.length):(e.minimumFractionDigits=c.length,e.maximumFractionDigits=c.length),""});var o=r.options[0];o==="w"?e=un(un({},e),{trailingZeroDisplay:"stripIfInteger"}):o&&(e=un(un({},e),hne(o)));continue}if(Dge.test(r.stem)){e=un(un({},e),hne(r.stem));continue}var s=kge(r.stem);s&&(e=un(un({},e),s));var a=hOe(r.stem);a&&(e=un(un({},e),a))}return e}var KN={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};function gOe(i,e){for(var t="",n=0;n>1),l="a",c=pOe(e);for((c=="H"||c=="k")&&(a=0);a-- >0;)t+=l;for(;s-- >0;)t=c+t}else r==="J"?t+="H":t+=r}return t}function pOe(i){var e=i.hourCycle;if(e===void 0&&i.hourCycles&&i.hourCycles.length&&(e=i.hourCycles[0]),e)switch(e){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var t=i.language,n;t!=="root"&&(n=i.maximize().region);var r=KN[n||""]||KN[t||""]||KN["".concat(t,"-001")]||KN["001"];return r[0]}var H8,mOe=new RegExp("^".concat(Ege.source,"*")),vOe=new RegExp("".concat(Ege.source,"*$"));function Bi(i,e){return{start:i,end:e}}var _Oe=!!String.prototype.startsWith,bOe=!!String.fromCodePoint,COe=!!Object.fromEntries,yOe=!!String.prototype.codePointAt,wOe=!!String.prototype.trimStart,SOe=!!String.prototype.trimEnd,xOe=!!Number.isSafeInteger,LOe=xOe?Number.isSafeInteger:function(i){return typeof i=="number"&&isFinite(i)&&Math.floor(i)===i&&Math.abs(i)<=9007199254740991},KW=!0;try{var EOe=Nge("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");KW=((H8=EOe.exec("a"))===null||H8===void 0?void 0:H8[0])==="a"}catch{KW=!1}var gne=_Oe?function(e,t,n){return e.startsWith(t,n)}:function(e,t,n){return e.slice(n,n+t.length)===t},GW=bOe?String.fromCodePoint:function(){for(var e=[],t=0;to;){if(s=e[o++],s>1114111)throw RangeError(s+" is not a valid code point");n+=s<65536?String.fromCharCode(s):String.fromCharCode(((s-=65536)>>10)+55296,s%1024+56320)}return n},pne=COe?Object.fromEntries:function(e){for(var t={},n=0,r=e;n=n)){var r=e.charCodeAt(t),o;return r<55296||r>56319||t+1===n||(o=e.charCodeAt(t+1))<56320||o>57343?r:(r-55296<<10)+(o-56320)+65536}},DOe=wOe?function(e){return e.trimStart()}:function(e){return e.replace(mOe,"")},IOe=SOe?function(e){return e.trimEnd()}:function(e){return e.replace(vOe,"")};function Nge(i,e){return new RegExp(i,e)}var qW;if(KW){var mne=Nge("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");qW=function(e,t){var n;mne.lastIndex=t;var r=mne.exec(e);return(n=r[1])!==null&&n!==void 0?n:""}}else qW=function(e,t){for(var n=[];;){var r=Tge(e,t);if(r===void 0||Rge(r)||ROe(r))break;n.push(r),t+=r>=65536?2:1}return GW.apply(void 0,n)};var kOe=function(){function i(e,t){t===void 0&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}return i.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},i.prototype.parseMessage=function(e,t,n){for(var r=[];!this.isEOF();){var o=this.char();if(o===123){var s=this.parseArgument(e,n);if(s.err)return s;r.push(s.val)}else{if(o===125&&e>0)break;if(o===35&&(t==="plural"||t==="selectordinal")){var a=this.clonePosition();this.bump(),r.push({type:io.pound,location:Bi(a,this.clonePosition())})}else if(o===60&&!this.ignoreTag&&this.peek()===47){if(n)break;return this.error(Ti.UNMATCHED_CLOSING_TAG,Bi(this.clonePosition(),this.clonePosition()))}else if(o===60&&!this.ignoreTag&&XW(this.peek()||0)){var s=this.parseTag(e,t);if(s.err)return s;r.push(s.val)}else{var s=this.parseLiteral(e,t);if(s.err)return s;r.push(s.val)}}}return{val:r,err:null}},i.prototype.parseTag=function(e,t){var n=this.clonePosition();this.bump();var r=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:io.literal,value:"<".concat(r,"/>"),location:Bi(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(e+1,t,!0);if(o.err)return o;var s=o.val,a=this.clonePosition();if(this.bumpIf("")?{val:{type:io.tag,value:r,children:s,location:Bi(n,this.clonePosition())},err:null}:this.error(Ti.INVALID_TAG,Bi(a,this.clonePosition())))}else return this.error(Ti.UNCLOSED_TAG,Bi(n,this.clonePosition()))}else return this.error(Ti.INVALID_TAG,Bi(n,this.clonePosition()))},i.prototype.parseTagName=function(){var e=this.offset();for(this.bump();!this.isEOF()&&NOe(this.char());)this.bump();return this.message.slice(e,this.offset())},i.prototype.parseLiteral=function(e,t){for(var n=this.clonePosition(),r="";;){var o=this.tryParseQuote(t);if(o){r+=o;continue}var s=this.tryParseUnquoted(e,t);if(s){r+=s;continue}var a=this.tryParseLeftAngleBracket();if(a){r+=a;continue}break}var l=Bi(n,this.clonePosition());return{val:{type:io.literal,value:r,location:l},err:null}},i.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!TOe(this.peek()||0))?(this.bump(),"<"):null},i.prototype.tryParseQuote=function(e){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(e==="plural"||e==="selectordinal")break;return null;default:return null}this.bump();var t=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(n===39)if(this.peek()===39)t.push(39),this.bump();else{this.bump();break}else t.push(n);this.bump()}return GW.apply(void 0,t)},i.prototype.tryParseUnquoted=function(e,t){if(this.isEOF())return null;var n=this.char();return n===60||n===123||n===35&&(t==="plural"||t==="selectordinal")||n===125&&e>0?null:(this.bump(),GW(n))},i.prototype.parseArgument=function(e,t){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(Ti.EXPECT_ARGUMENT_CLOSING_BRACE,Bi(n,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(Ti.EMPTY_ARGUMENT,Bi(n,this.clonePosition()));var r=this.parseIdentifierIfPossible().value;if(!r)return this.error(Ti.MALFORMED_ARGUMENT,Bi(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(Ti.EXPECT_ARGUMENT_CLOSING_BRACE,Bi(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:io.argument,value:r,location:Bi(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(Ti.EXPECT_ARGUMENT_CLOSING_BRACE,Bi(n,this.clonePosition())):this.parseArgumentOptions(e,t,r,n);default:return this.error(Ti.MALFORMED_ARGUMENT,Bi(n,this.clonePosition()))}},i.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),n=qW(this.message,t),r=t+n.length;this.bumpTo(r);var o=this.clonePosition(),s=Bi(e,o);return{value:n,location:s}},i.prototype.parseArgumentOptions=function(e,t,n,r){var o,s=this.clonePosition(),a=this.parseIdentifierIfPossible().value,l=this.clonePosition();switch(a){case"":return this.error(Ti.EXPECT_ARGUMENT_TYPE,Bi(s,l));case"number":case"date":case"time":{this.bumpSpace();var c=null;if(this.bumpIf(",")){this.bumpSpace();var u=this.clonePosition(),d=this.parseSimpleArgStyleIfPossible();if(d.err)return d;var h=IOe(d.val);if(h.length===0)return this.error(Ti.EXPECT_ARGUMENT_STYLE,Bi(this.clonePosition(),this.clonePosition()));var f=Bi(u,this.clonePosition());c={style:h,styleLocation:f}}var g=this.tryParseArgumentClose(r);if(g.err)return g;var p=Bi(r,this.clonePosition());if(c&&gne(c==null?void 0:c.style,"::",0)){var v=DOe(c.style.slice(2));if(a==="number"){var d=this.parseNumberSkeletonFromString(v,c.styleLocation);return d.err?d:{val:{type:io.number,value:n,location:p,style:d.val},err:null}}else{if(v.length===0)return this.error(Ti.EXPECT_DATE_TIME_SKELETON,p);var m=v;this.locale&&(m=gOe(v,this.locale));var h={type:Cw.dateTime,pattern:m,location:c.styleLocation,parsedOptions:this.shouldParseSkeletons?aOe(m):{}},_=a==="date"?io.date:io.time;return{val:{type:_,value:n,location:p,style:h},err:null}}}return{val:{type:a==="number"?io.number:a==="date"?io.date:io.time,value:n,location:p,style:(o=c==null?void 0:c.style)!==null&&o!==void 0?o:null},err:null}}case"plural":case"selectordinal":case"select":{var y=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(Ti.EXPECT_SELECT_ARGUMENT_OPTIONS,Bi(y,un({},y)));this.bumpSpace();var S=this.parseIdentifierIfPossible(),L=0;if(a!=="select"&&S.value==="offset"){if(!this.bumpIf(":"))return this.error(Ti.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Bi(this.clonePosition(),this.clonePosition()));this.bumpSpace();var d=this.tryParseDecimalInteger(Ti.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Ti.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(d.err)return d;this.bumpSpace(),S=this.parseIdentifierIfPossible(),L=d.val}var E=this.tryParsePluralOrSelectOptions(e,a,t,S);if(E.err)return E;var g=this.tryParseArgumentClose(r);if(g.err)return g;var D=Bi(r,this.clonePosition());return a==="select"?{val:{type:io.select,value:n,options:pne(E.val),location:D},err:null}:{val:{type:io.plural,value:n,options:pne(E.val),offset:L,pluralType:a==="plural"?"cardinal":"ordinal",location:D},err:null}}default:return this.error(Ti.INVALID_ARGUMENT_TYPE,Bi(s,l))}},i.prototype.tryParseArgumentClose=function(e){return this.isEOF()||this.char()!==125?this.error(Ti.EXPECT_ARGUMENT_CLOSING_BRACE,Bi(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},i.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();){var n=this.char();switch(n){case 39:{this.bump();var r=this.clonePosition();if(!this.bumpUntil("'"))return this.error(Ti.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Bi(r,this.clonePosition()));this.bump();break}case 123:{e+=1,this.bump();break}case 125:{if(e>0)e-=1;else return{val:this.message.slice(t.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(t.offset,this.offset()),err:null}},i.prototype.parseNumberSkeletonFromString=function(e,t){var n=[];try{n=cOe(e)}catch{return this.error(Ti.INVALID_NUMBER_SKELETON,t)}return{val:{type:Cw.number,tokens:n,location:t,parsedOptions:this.shouldParseSkeletons?fOe(n):{}},err:null}},i.prototype.tryParsePluralOrSelectOptions=function(e,t,n,r){for(var o,s=!1,a=[],l=new Set,c=r.value,u=r.location;;){if(c.length===0){var d=this.clonePosition();if(t!=="select"&&this.bumpIf("=")){var h=this.tryParseDecimalInteger(Ti.EXPECT_PLURAL_ARGUMENT_SELECTOR,Ti.INVALID_PLURAL_ARGUMENT_SELECTOR);if(h.err)return h;u=Bi(d,this.clonePosition()),c=this.message.slice(d.offset,this.offset())}else break}if(l.has(c))return this.error(t==="select"?Ti.DUPLICATE_SELECT_ARGUMENT_SELECTOR:Ti.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,u);c==="other"&&(s=!0),this.bumpSpace();var f=this.clonePosition();if(!this.bumpIf("{"))return this.error(t==="select"?Ti.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:Ti.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Bi(this.clonePosition(),this.clonePosition()));var g=this.parseMessage(e+1,t,n);if(g.err)return g;var p=this.tryParseArgumentClose(f);if(p.err)return p;a.push([c,{value:g.val,location:Bi(f,this.clonePosition())}]),l.add(c),this.bumpSpace(),o=this.parseIdentifierIfPossible(),c=o.value,u=o.location}return a.length===0?this.error(t==="select"?Ti.EXPECT_SELECT_ARGUMENT_SELECTOR:Ti.EXPECT_PLURAL_ARGUMENT_SELECTOR,Bi(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!s?this.error(Ti.MISSING_OTHER_CLAUSE,Bi(this.clonePosition(),this.clonePosition())):{val:a,err:null}},i.prototype.tryParseDecimalInteger=function(e,t){var n=1,r=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var o=!1,s=0;!this.isEOF();){var a=this.char();if(a>=48&&a<=57)o=!0,s=s*10+(a-48),this.bump();else break}var l=Bi(r,this.clonePosition());return o?(s*=n,LOe(s)?{val:s,err:null}:this.error(t,l)):this.error(e,l)},i.prototype.offset=function(){return this.position.offset},i.prototype.isEOF=function(){return this.offset()===this.message.length},i.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},i.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=Tge(this.message,e);if(t===void 0)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return t},i.prototype.error=function(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}},i.prototype.bump=function(){if(!this.isEOF()){var e=this.char();e===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},i.prototype.bumpIf=function(e){if(gne(this.message,e,this.offset())){for(var t=0;t=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},i.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var t=this.offset();if(t===e)break;if(t>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},i.prototype.bumpSpace=function(){for(;!this.isEOF()&&Rge(this.char());)this.bump()},i.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),n=this.message.charCodeAt(t+(e>=65536?2:1));return n??null},i}();function XW(i){return i>=97&&i<=122||i>=65&&i<=90}function TOe(i){return XW(i)||i===47}function NOe(i){return i===45||i===46||i>=48&&i<=57||i===95||i>=97&&i<=122||i>=65&&i<=90||i==183||i>=192&&i<=214||i>=216&&i<=246||i>=248&&i<=893||i>=895&&i<=8191||i>=8204&&i<=8205||i>=8255&&i<=8256||i>=8304&&i<=8591||i>=11264&&i<=12271||i>=12289&&i<=55295||i>=63744&&i<=64975||i>=65008&&i<=65533||i>=65536&&i<=983039}function Rge(i){return i>=9&&i<=13||i===32||i===133||i>=8206&&i<=8207||i===8232||i===8233}function ROe(i){return i>=33&&i<=35||i===36||i>=37&&i<=39||i===40||i===41||i===42||i===43||i===44||i===45||i>=46&&i<=47||i>=58&&i<=59||i>=60&&i<=62||i>=63&&i<=64||i===91||i===92||i===93||i===94||i===96||i===123||i===124||i===125||i===126||i===161||i>=162&&i<=165||i===166||i===167||i===169||i===171||i===172||i===174||i===176||i===177||i===182||i===187||i===191||i===215||i===247||i>=8208&&i<=8213||i>=8214&&i<=8215||i===8216||i===8217||i===8218||i>=8219&&i<=8220||i===8221||i===8222||i===8223||i>=8224&&i<=8231||i>=8240&&i<=8248||i===8249||i===8250||i>=8251&&i<=8254||i>=8257&&i<=8259||i===8260||i===8261||i===8262||i>=8263&&i<=8273||i===8274||i===8275||i>=8277&&i<=8286||i>=8592&&i<=8596||i>=8597&&i<=8601||i>=8602&&i<=8603||i>=8604&&i<=8607||i===8608||i>=8609&&i<=8610||i===8611||i>=8612&&i<=8613||i===8614||i>=8615&&i<=8621||i===8622||i>=8623&&i<=8653||i>=8654&&i<=8655||i>=8656&&i<=8657||i===8658||i===8659||i===8660||i>=8661&&i<=8691||i>=8692&&i<=8959||i>=8960&&i<=8967||i===8968||i===8969||i===8970||i===8971||i>=8972&&i<=8991||i>=8992&&i<=8993||i>=8994&&i<=9e3||i===9001||i===9002||i>=9003&&i<=9083||i===9084||i>=9085&&i<=9114||i>=9115&&i<=9139||i>=9140&&i<=9179||i>=9180&&i<=9185||i>=9186&&i<=9254||i>=9255&&i<=9279||i>=9280&&i<=9290||i>=9291&&i<=9311||i>=9472&&i<=9654||i===9655||i>=9656&&i<=9664||i===9665||i>=9666&&i<=9719||i>=9720&&i<=9727||i>=9728&&i<=9838||i===9839||i>=9840&&i<=10087||i===10088||i===10089||i===10090||i===10091||i===10092||i===10093||i===10094||i===10095||i===10096||i===10097||i===10098||i===10099||i===10100||i===10101||i>=10132&&i<=10175||i>=10176&&i<=10180||i===10181||i===10182||i>=10183&&i<=10213||i===10214||i===10215||i===10216||i===10217||i===10218||i===10219||i===10220||i===10221||i===10222||i===10223||i>=10224&&i<=10239||i>=10240&&i<=10495||i>=10496&&i<=10626||i===10627||i===10628||i===10629||i===10630||i===10631||i===10632||i===10633||i===10634||i===10635||i===10636||i===10637||i===10638||i===10639||i===10640||i===10641||i===10642||i===10643||i===10644||i===10645||i===10646||i===10647||i===10648||i>=10649&&i<=10711||i===10712||i===10713||i===10714||i===10715||i>=10716&&i<=10747||i===10748||i===10749||i>=10750&&i<=11007||i>=11008&&i<=11055||i>=11056&&i<=11076||i>=11077&&i<=11078||i>=11079&&i<=11084||i>=11085&&i<=11123||i>=11124&&i<=11125||i>=11126&&i<=11157||i===11158||i>=11159&&i<=11263||i>=11776&&i<=11777||i===11778||i===11779||i===11780||i===11781||i>=11782&&i<=11784||i===11785||i===11786||i===11787||i===11788||i===11789||i>=11790&&i<=11798||i===11799||i>=11800&&i<=11801||i===11802||i===11803||i===11804||i===11805||i>=11806&&i<=11807||i===11808||i===11809||i===11810||i===11811||i===11812||i===11813||i===11814||i===11815||i===11816||i===11817||i>=11818&&i<=11822||i===11823||i>=11824&&i<=11833||i>=11834&&i<=11835||i>=11836&&i<=11839||i===11840||i===11841||i===11842||i>=11843&&i<=11855||i>=11856&&i<=11857||i===11858||i>=11859&&i<=11903||i>=12289&&i<=12291||i===12296||i===12297||i===12298||i===12299||i===12300||i===12301||i===12302||i===12303||i===12304||i===12305||i>=12306&&i<=12307||i===12308||i===12309||i===12310||i===12311||i===12312||i===12313||i===12314||i===12315||i===12316||i===12317||i>=12318&&i<=12319||i===12320||i===12336||i===64830||i===64831||i>=65093&&i<=65094}function YW(i){i.forEach(function(e){if(delete e.location,wge(e)||Sge(e))for(var t in e.options)delete e.options[t].location,YW(e.options[t].value);else bge(e)&&Lge(e.style)||(Cge(e)||yge(e))&&jW(e.style)?delete e.style.location:xge(e)&&YW(e.children)})}function MOe(i,e){e===void 0&&(e={}),e=un({shouldParseSkeletons:!0,requiresOtherClause:!0},e);var t=new kOe(i,e).parse();if(t.err){var n=SyntaxError(Ti[t.err.kind]);throw n.location=t.err.location,n.originalMessage=t.err.message,n}return e!=null&&e.captureLocation||YW(t.val),t.val}function Qh(i,e){var t=e&&e.cache?e.cache:WOe,n=e&&e.serializer?e.serializer:BOe,r=e&&e.strategy?e.strategy:POe;return r(i,{cache:t,serializer:n})}function AOe(i){return i==null||typeof i=="number"||typeof i=="boolean"}function Mge(i,e,t,n){var r=AOe(n)?n:t(n),o=e.get(r);return typeof o>"u"&&(o=i.call(this,n),e.set(r,o)),o}function Age(i,e,t){var n=Array.prototype.slice.call(arguments,3),r=t(n),o=e.get(r);return typeof o>"u"&&(o=i.apply(this,n),e.set(r,o)),o}function qG(i,e,t,n,r){return t.bind(e,i,n,r)}function POe(i,e){var t=i.length===1?Mge:Age;return qG(i,this,t,e.cache.create(),e.serializer)}function OOe(i,e){return qG(i,this,Age,e.cache.create(),e.serializer)}function FOe(i,e){return qG(i,this,Mge,e.cache.create(),e.serializer)}var BOe=function(){return JSON.stringify(arguments)};function XG(){this.cache=Object.create(null)}XG.prototype.get=function(i){return this.cache[i]};XG.prototype.set=function(i,e){this.cache[i]=e};var WOe={create:function(){return new XG}},Jh={variadic:OOe,monadic:FOe},Bf;(function(i){i.MISSING_VALUE="MISSING_VALUE",i.INVALID_VALUE="INVALID_VALUE",i.MISSING_INTL_API="MISSING_INTL_API"})(Bf||(Bf={}));var S_=function(i){ad(e,i);function e(t,n,r){var o=i.call(this,t)||this;return o.code=n,o.originalMessage=r,o}return e.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},e}(Error),vne=function(i){ad(e,i);function e(t,n,r,o){return i.call(this,'Invalid values for "'.concat(t,'": "').concat(n,'". Options are "').concat(Object.keys(r).join('", "'),'"'),Bf.INVALID_VALUE,o)||this}return e}(S_),$Oe=function(i){ad(e,i);function e(t,n,r){return i.call(this,'Value for "'.concat(t,'" must be of type ').concat(n),Bf.INVALID_VALUE,r)||this}return e}(S_),HOe=function(i){ad(e,i);function e(t,n){return i.call(this,'The intl string context variable "'.concat(t,'" was not provided to the string "').concat(n,'"'),Bf.MISSING_VALUE,n)||this}return e}(S_),ml;(function(i){i[i.literal=0]="literal",i[i.object=1]="object"})(ml||(ml={}));function VOe(i){return i.length<2?i:i.reduce(function(e,t){var n=e[e.length-1];return!n||n.type!==ml.literal||t.type!==ml.literal?e.push(t):n.value+=t.value,e},[])}function Pge(i){return typeof i=="function"}function rM(i,e,t,n,r,o,s){if(i.length===1&&une(i[0]))return[{type:ml.literal,value:i[0].value}];for(var a=[],l=0,c=i;l{let n=e;for(;n;)n.callback(),n=n.next})},get(){let n=[],r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0,o=t={callback:n,next:null,prev:t};return o.prev?o.prev.next=o:e=o,function(){!r||e===null||(r=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}const cne={notify(){},get:()=>[]};function ZPe(i,e){let t,n=cne;function r(d){return l(),n.subscribe(d)}function o(){n.notify()}function s(){u.onStateChange&&u.onStateChange()}function a(){return!!t}function l(){t||(t=e?e.addNestedSub(s):i.subscribe(s),n=YPe())}function c(){t&&(t(),t=void 0,n.clear(),n=cne)}const u={addNestedSub:r,notifyNestedSubs:o,handleChangeWrapper:s,isSubscribed:a,trySubscribe:l,tryUnsubscribe:c,getListeners:()=>n};return u}const QPe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",JPe=QPe?C.useLayoutEffect:C.useEffect;function eOe({store:i,context:e,children:t,serverState:n}){const r=C.useMemo(()=>{const a=ZPe(i);return{store:i,subscription:a,getServerState:n?()=>n:void 0}},[i,n]),o=C.useMemo(()=>i.getState(),[i]);JPe(()=>{const{subscription:a}=r;return a.onStateChange=a.notifyNestedSubs,a.trySubscribe(),o!==i.getState()&&a.notifyNestedSubs(),()=>{a.tryUnsubscribe(),a.onStateChange=void 0}},[r,o]);const s=e||Wv;return $e.createElement(s.Provider,{value:r},t)}function vge(i=Wv){const e=i===Wv?dge:()=>C.useContext(i);return function(){const{store:n}=e();return n}}const tOe=vge();function nOe(i=Wv){const e=i===Wv?tOe:vge(i);return function(){return e().dispatch}}const iOe=nOe();APe(zW.useSyncExternalStoreWithSelector);NPe(sh.unstable_batchedUpdates);const yS=iOe,Gr=FPe;var UW=function(i,e){return UW=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])},UW(i,e)};function ad(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");UW(i,e);function t(){this.constructor=i}i.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var un=function(){return un=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0}),t=[],n=0,r=e;n1)throw new RangeError("integer-width stems only accept a single optional option");r.options[0].replace(dOe,function(l,c,u,d,h,f){if(c)e.minimumIntegerDigits=u.length;else{if(d&&h)throw new Error("We currently do not support maximum integer digits");if(f)throw new Error("We currently do not support exact integer digits")}return""});continue}if(Ige.test(r.stem)){e.minimumIntegerDigits=r.stem.length;continue}if(dne.test(r.stem)){if(r.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");r.stem.replace(dne,function(l,c,u,d,h,f){return u==="*"?e.minimumFractionDigits=c.length:d&&d[0]==="#"?e.maximumFractionDigits=d.length:h&&f?(e.minimumFractionDigits=h.length,e.maximumFractionDigits=h.length+f.length):(e.minimumFractionDigits=c.length,e.maximumFractionDigits=c.length),""});var o=r.options[0];o==="w"?e=un(un({},e),{trailingZeroDisplay:"stripIfInteger"}):o&&(e=un(un({},e),hne(o)));continue}if(Dge.test(r.stem)){e=un(un({},e),hne(r.stem));continue}var s=kge(r.stem);s&&(e=un(un({},e),s));var a=hOe(r.stem);a&&(e=un(un({},e),a))}return e}var KN={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};function gOe(i,e){for(var t="",n=0;n>1),l="a",c=pOe(e);for((c=="H"||c=="k")&&(a=0);a-- >0;)t+=l;for(;s-- >0;)t=c+t}else r==="J"?t+="H":t+=r}return t}function pOe(i){var e=i.hourCycle;if(e===void 0&&i.hourCycles&&i.hourCycles.length&&(e=i.hourCycles[0]),e)switch(e){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var t=i.language,n;t!=="root"&&(n=i.maximize().region);var r=KN[n||""]||KN[t||""]||KN["".concat(t,"-001")]||KN["001"];return r[0]}var H8,mOe=new RegExp("^".concat(Ege.source,"*")),vOe=new RegExp("".concat(Ege.source,"*$"));function Bi(i,e){return{start:i,end:e}}var _Oe=!!String.prototype.startsWith,bOe=!!String.fromCodePoint,COe=!!Object.fromEntries,yOe=!!String.prototype.codePointAt,wOe=!!String.prototype.trimStart,SOe=!!String.prototype.trimEnd,xOe=!!Number.isSafeInteger,LOe=xOe?Number.isSafeInteger:function(i){return typeof i=="number"&&isFinite(i)&&Math.floor(i)===i&&Math.abs(i)<=9007199254740991},KW=!0;try{var EOe=Nge("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");KW=((H8=EOe.exec("a"))===null||H8===void 0?void 0:H8[0])==="a"}catch{KW=!1}var gne=_Oe?function(e,t,n){return e.startsWith(t,n)}:function(e,t,n){return e.slice(n,n+t.length)===t},GW=bOe?String.fromCodePoint:function(){for(var e=[],t=0;to;){if(s=e[o++],s>1114111)throw RangeError(s+" is not a valid code point");n+=s<65536?String.fromCharCode(s):String.fromCharCode(((s-=65536)>>10)+55296,s%1024+56320)}return n},pne=COe?Object.fromEntries:function(e){for(var t={},n=0,r=e;n=n)){var r=e.charCodeAt(t),o;return r<55296||r>56319||t+1===n||(o=e.charCodeAt(t+1))<56320||o>57343?r:(r-55296<<10)+(o-56320)+65536}},DOe=wOe?function(e){return e.trimStart()}:function(e){return e.replace(mOe,"")},IOe=SOe?function(e){return e.trimEnd()}:function(e){return e.replace(vOe,"")};function Nge(i,e){return new RegExp(i,e)}var qW;if(KW){var mne=Nge("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");qW=function(e,t){var n;mne.lastIndex=t;var r=mne.exec(e);return(n=r[1])!==null&&n!==void 0?n:""}}else qW=function(e,t){for(var n=[];;){var r=Tge(e,t);if(r===void 0||Rge(r)||ROe(r))break;n.push(r),t+=r>=65536?2:1}return GW.apply(void 0,n)};var kOe=function(){function i(e,t){t===void 0&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}return i.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},i.prototype.parseMessage=function(e,t,n){for(var r=[];!this.isEOF();){var o=this.char();if(o===123){var s=this.parseArgument(e,n);if(s.err)return s;r.push(s.val)}else{if(o===125&&e>0)break;if(o===35&&(t==="plural"||t==="selectordinal")){var a=this.clonePosition();this.bump(),r.push({type:io.pound,location:Bi(a,this.clonePosition())})}else if(o===60&&!this.ignoreTag&&this.peek()===47){if(n)break;return this.error(Ti.UNMATCHED_CLOSING_TAG,Bi(this.clonePosition(),this.clonePosition()))}else if(o===60&&!this.ignoreTag&&XW(this.peek()||0)){var s=this.parseTag(e,t);if(s.err)return s;r.push(s.val)}else{var s=this.parseLiteral(e,t);if(s.err)return s;r.push(s.val)}}}return{val:r,err:null}},i.prototype.parseTag=function(e,t){var n=this.clonePosition();this.bump();var r=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:io.literal,value:"<".concat(r,"/>"),location:Bi(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(e+1,t,!0);if(o.err)return o;var s=o.val,a=this.clonePosition();if(this.bumpIf("")?{val:{type:io.tag,value:r,children:s,location:Bi(n,this.clonePosition())},err:null}:this.error(Ti.INVALID_TAG,Bi(a,this.clonePosition())))}else return this.error(Ti.UNCLOSED_TAG,Bi(n,this.clonePosition()))}else return this.error(Ti.INVALID_TAG,Bi(n,this.clonePosition()))},i.prototype.parseTagName=function(){var e=this.offset();for(this.bump();!this.isEOF()&&NOe(this.char());)this.bump();return this.message.slice(e,this.offset())},i.prototype.parseLiteral=function(e,t){for(var n=this.clonePosition(),r="";;){var o=this.tryParseQuote(t);if(o){r+=o;continue}var s=this.tryParseUnquoted(e,t);if(s){r+=s;continue}var a=this.tryParseLeftAngleBracket();if(a){r+=a;continue}break}var l=Bi(n,this.clonePosition());return{val:{type:io.literal,value:r,location:l},err:null}},i.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!TOe(this.peek()||0))?(this.bump(),"<"):null},i.prototype.tryParseQuote=function(e){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(e==="plural"||e==="selectordinal")break;return null;default:return null}this.bump();var t=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(n===39)if(this.peek()===39)t.push(39),this.bump();else{this.bump();break}else t.push(n);this.bump()}return GW.apply(void 0,t)},i.prototype.tryParseUnquoted=function(e,t){if(this.isEOF())return null;var n=this.char();return n===60||n===123||n===35&&(t==="plural"||t==="selectordinal")||n===125&&e>0?null:(this.bump(),GW(n))},i.prototype.parseArgument=function(e,t){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(Ti.EXPECT_ARGUMENT_CLOSING_BRACE,Bi(n,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(Ti.EMPTY_ARGUMENT,Bi(n,this.clonePosition()));var r=this.parseIdentifierIfPossible().value;if(!r)return this.error(Ti.MALFORMED_ARGUMENT,Bi(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(Ti.EXPECT_ARGUMENT_CLOSING_BRACE,Bi(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:io.argument,value:r,location:Bi(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(Ti.EXPECT_ARGUMENT_CLOSING_BRACE,Bi(n,this.clonePosition())):this.parseArgumentOptions(e,t,r,n);default:return this.error(Ti.MALFORMED_ARGUMENT,Bi(n,this.clonePosition()))}},i.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),n=qW(this.message,t),r=t+n.length;this.bumpTo(r);var o=this.clonePosition(),s=Bi(e,o);return{value:n,location:s}},i.prototype.parseArgumentOptions=function(e,t,n,r){var o,s=this.clonePosition(),a=this.parseIdentifierIfPossible().value,l=this.clonePosition();switch(a){case"":return this.error(Ti.EXPECT_ARGUMENT_TYPE,Bi(s,l));case"number":case"date":case"time":{this.bumpSpace();var c=null;if(this.bumpIf(",")){this.bumpSpace();var u=this.clonePosition(),d=this.parseSimpleArgStyleIfPossible();if(d.err)return d;var h=IOe(d.val);if(h.length===0)return this.error(Ti.EXPECT_ARGUMENT_STYLE,Bi(this.clonePosition(),this.clonePosition()));var f=Bi(u,this.clonePosition());c={style:h,styleLocation:f}}var g=this.tryParseArgumentClose(r);if(g.err)return g;var p=Bi(r,this.clonePosition());if(c&&gne(c==null?void 0:c.style,"::",0)){var v=DOe(c.style.slice(2));if(a==="number"){var d=this.parseNumberSkeletonFromString(v,c.styleLocation);return d.err?d:{val:{type:io.number,value:n,location:p,style:d.val},err:null}}else{if(v.length===0)return this.error(Ti.EXPECT_DATE_TIME_SKELETON,p);var m=v;this.locale&&(m=gOe(v,this.locale));var h={type:Cw.dateTime,pattern:m,location:c.styleLocation,parsedOptions:this.shouldParseSkeletons?aOe(m):{}},_=a==="date"?io.date:io.time;return{val:{type:_,value:n,location:p,style:h},err:null}}}return{val:{type:a==="number"?io.number:a==="date"?io.date:io.time,value:n,location:p,style:(o=c==null?void 0:c.style)!==null&&o!==void 0?o:null},err:null}}case"plural":case"selectordinal":case"select":{var y=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(Ti.EXPECT_SELECT_ARGUMENT_OPTIONS,Bi(y,un({},y)));this.bumpSpace();var S=this.parseIdentifierIfPossible(),L=0;if(a!=="select"&&S.value==="offset"){if(!this.bumpIf(":"))return this.error(Ti.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Bi(this.clonePosition(),this.clonePosition()));this.bumpSpace();var d=this.tryParseDecimalInteger(Ti.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Ti.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(d.err)return d;this.bumpSpace(),S=this.parseIdentifierIfPossible(),L=d.val}var E=this.tryParsePluralOrSelectOptions(e,a,t,S);if(E.err)return E;var g=this.tryParseArgumentClose(r);if(g.err)return g;var D=Bi(r,this.clonePosition());return a==="select"?{val:{type:io.select,value:n,options:pne(E.val),location:D},err:null}:{val:{type:io.plural,value:n,options:pne(E.val),offset:L,pluralType:a==="plural"?"cardinal":"ordinal",location:D},err:null}}default:return this.error(Ti.INVALID_ARGUMENT_TYPE,Bi(s,l))}},i.prototype.tryParseArgumentClose=function(e){return this.isEOF()||this.char()!==125?this.error(Ti.EXPECT_ARGUMENT_CLOSING_BRACE,Bi(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},i.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();){var n=this.char();switch(n){case 39:{this.bump();var r=this.clonePosition();if(!this.bumpUntil("'"))return this.error(Ti.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Bi(r,this.clonePosition()));this.bump();break}case 123:{e+=1,this.bump();break}case 125:{if(e>0)e-=1;else return{val:this.message.slice(t.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(t.offset,this.offset()),err:null}},i.prototype.parseNumberSkeletonFromString=function(e,t){var n=[];try{n=cOe(e)}catch{return this.error(Ti.INVALID_NUMBER_SKELETON,t)}return{val:{type:Cw.number,tokens:n,location:t,parsedOptions:this.shouldParseSkeletons?fOe(n):{}},err:null}},i.prototype.tryParsePluralOrSelectOptions=function(e,t,n,r){for(var o,s=!1,a=[],l=new Set,c=r.value,u=r.location;;){if(c.length===0){var d=this.clonePosition();if(t!=="select"&&this.bumpIf("=")){var h=this.tryParseDecimalInteger(Ti.EXPECT_PLURAL_ARGUMENT_SELECTOR,Ti.INVALID_PLURAL_ARGUMENT_SELECTOR);if(h.err)return h;u=Bi(d,this.clonePosition()),c=this.message.slice(d.offset,this.offset())}else break}if(l.has(c))return this.error(t==="select"?Ti.DUPLICATE_SELECT_ARGUMENT_SELECTOR:Ti.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,u);c==="other"&&(s=!0),this.bumpSpace();var f=this.clonePosition();if(!this.bumpIf("{"))return this.error(t==="select"?Ti.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:Ti.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Bi(this.clonePosition(),this.clonePosition()));var g=this.parseMessage(e+1,t,n);if(g.err)return g;var p=this.tryParseArgumentClose(f);if(p.err)return p;a.push([c,{value:g.val,location:Bi(f,this.clonePosition())}]),l.add(c),this.bumpSpace(),o=this.parseIdentifierIfPossible(),c=o.value,u=o.location}return a.length===0?this.error(t==="select"?Ti.EXPECT_SELECT_ARGUMENT_SELECTOR:Ti.EXPECT_PLURAL_ARGUMENT_SELECTOR,Bi(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!s?this.error(Ti.MISSING_OTHER_CLAUSE,Bi(this.clonePosition(),this.clonePosition())):{val:a,err:null}},i.prototype.tryParseDecimalInteger=function(e,t){var n=1,r=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var o=!1,s=0;!this.isEOF();){var a=this.char();if(a>=48&&a<=57)o=!0,s=s*10+(a-48),this.bump();else break}var l=Bi(r,this.clonePosition());return o?(s*=n,LOe(s)?{val:s,err:null}:this.error(t,l)):this.error(e,l)},i.prototype.offset=function(){return this.position.offset},i.prototype.isEOF=function(){return this.offset()===this.message.length},i.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},i.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=Tge(this.message,e);if(t===void 0)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return t},i.prototype.error=function(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}},i.prototype.bump=function(){if(!this.isEOF()){var e=this.char();e===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},i.prototype.bumpIf=function(e){if(gne(this.message,e,this.offset())){for(var t=0;t=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},i.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var t=this.offset();if(t===e)break;if(t>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},i.prototype.bumpSpace=function(){for(;!this.isEOF()&&Rge(this.char());)this.bump()},i.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),n=this.message.charCodeAt(t+(e>=65536?2:1));return n??null},i}();function XW(i){return i>=97&&i<=122||i>=65&&i<=90}function TOe(i){return XW(i)||i===47}function NOe(i){return i===45||i===46||i>=48&&i<=57||i===95||i>=97&&i<=122||i>=65&&i<=90||i==183||i>=192&&i<=214||i>=216&&i<=246||i>=248&&i<=893||i>=895&&i<=8191||i>=8204&&i<=8205||i>=8255&&i<=8256||i>=8304&&i<=8591||i>=11264&&i<=12271||i>=12289&&i<=55295||i>=63744&&i<=64975||i>=65008&&i<=65533||i>=65536&&i<=983039}function Rge(i){return i>=9&&i<=13||i===32||i===133||i>=8206&&i<=8207||i===8232||i===8233}function ROe(i){return i>=33&&i<=35||i===36||i>=37&&i<=39||i===40||i===41||i===42||i===43||i===44||i===45||i>=46&&i<=47||i>=58&&i<=59||i>=60&&i<=62||i>=63&&i<=64||i===91||i===92||i===93||i===94||i===96||i===123||i===124||i===125||i===126||i===161||i>=162&&i<=165||i===166||i===167||i===169||i===171||i===172||i===174||i===176||i===177||i===182||i===187||i===191||i===215||i===247||i>=8208&&i<=8213||i>=8214&&i<=8215||i===8216||i===8217||i===8218||i>=8219&&i<=8220||i===8221||i===8222||i===8223||i>=8224&&i<=8231||i>=8240&&i<=8248||i===8249||i===8250||i>=8251&&i<=8254||i>=8257&&i<=8259||i===8260||i===8261||i===8262||i>=8263&&i<=8273||i===8274||i===8275||i>=8277&&i<=8286||i>=8592&&i<=8596||i>=8597&&i<=8601||i>=8602&&i<=8603||i>=8604&&i<=8607||i===8608||i>=8609&&i<=8610||i===8611||i>=8612&&i<=8613||i===8614||i>=8615&&i<=8621||i===8622||i>=8623&&i<=8653||i>=8654&&i<=8655||i>=8656&&i<=8657||i===8658||i===8659||i===8660||i>=8661&&i<=8691||i>=8692&&i<=8959||i>=8960&&i<=8967||i===8968||i===8969||i===8970||i===8971||i>=8972&&i<=8991||i>=8992&&i<=8993||i>=8994&&i<=9e3||i===9001||i===9002||i>=9003&&i<=9083||i===9084||i>=9085&&i<=9114||i>=9115&&i<=9139||i>=9140&&i<=9179||i>=9180&&i<=9185||i>=9186&&i<=9254||i>=9255&&i<=9279||i>=9280&&i<=9290||i>=9291&&i<=9311||i>=9472&&i<=9654||i===9655||i>=9656&&i<=9664||i===9665||i>=9666&&i<=9719||i>=9720&&i<=9727||i>=9728&&i<=9838||i===9839||i>=9840&&i<=10087||i===10088||i===10089||i===10090||i===10091||i===10092||i===10093||i===10094||i===10095||i===10096||i===10097||i===10098||i===10099||i===10100||i===10101||i>=10132&&i<=10175||i>=10176&&i<=10180||i===10181||i===10182||i>=10183&&i<=10213||i===10214||i===10215||i===10216||i===10217||i===10218||i===10219||i===10220||i===10221||i===10222||i===10223||i>=10224&&i<=10239||i>=10240&&i<=10495||i>=10496&&i<=10626||i===10627||i===10628||i===10629||i===10630||i===10631||i===10632||i===10633||i===10634||i===10635||i===10636||i===10637||i===10638||i===10639||i===10640||i===10641||i===10642||i===10643||i===10644||i===10645||i===10646||i===10647||i===10648||i>=10649&&i<=10711||i===10712||i===10713||i===10714||i===10715||i>=10716&&i<=10747||i===10748||i===10749||i>=10750&&i<=11007||i>=11008&&i<=11055||i>=11056&&i<=11076||i>=11077&&i<=11078||i>=11079&&i<=11084||i>=11085&&i<=11123||i>=11124&&i<=11125||i>=11126&&i<=11157||i===11158||i>=11159&&i<=11263||i>=11776&&i<=11777||i===11778||i===11779||i===11780||i===11781||i>=11782&&i<=11784||i===11785||i===11786||i===11787||i===11788||i===11789||i>=11790&&i<=11798||i===11799||i>=11800&&i<=11801||i===11802||i===11803||i===11804||i===11805||i>=11806&&i<=11807||i===11808||i===11809||i===11810||i===11811||i===11812||i===11813||i===11814||i===11815||i===11816||i===11817||i>=11818&&i<=11822||i===11823||i>=11824&&i<=11833||i>=11834&&i<=11835||i>=11836&&i<=11839||i===11840||i===11841||i===11842||i>=11843&&i<=11855||i>=11856&&i<=11857||i===11858||i>=11859&&i<=11903||i>=12289&&i<=12291||i===12296||i===12297||i===12298||i===12299||i===12300||i===12301||i===12302||i===12303||i===12304||i===12305||i>=12306&&i<=12307||i===12308||i===12309||i===12310||i===12311||i===12312||i===12313||i===12314||i===12315||i===12316||i===12317||i>=12318&&i<=12319||i===12320||i===12336||i===64830||i===64831||i>=65093&&i<=65094}function YW(i){i.forEach(function(e){if(delete e.location,wge(e)||Sge(e))for(var t in e.options)delete e.options[t].location,YW(e.options[t].value);else bge(e)&&Lge(e.style)||(Cge(e)||yge(e))&&jW(e.style)?delete e.style.location:xge(e)&&YW(e.children)})}function MOe(i,e){e===void 0&&(e={}),e=un({shouldParseSkeletons:!0,requiresOtherClause:!0},e);var t=new kOe(i,e).parse();if(t.err){var n=SyntaxError(Ti[t.err.kind]);throw n.location=t.err.location,n.originalMessage=t.err.message,n}return e!=null&&e.captureLocation||YW(t.val),t.val}function Qh(i,e){var t=e&&e.cache?e.cache:WOe,n=e&&e.serializer?e.serializer:BOe,r=e&&e.strategy?e.strategy:POe;return r(i,{cache:t,serializer:n})}function AOe(i){return i==null||typeof i=="number"||typeof i=="boolean"}function Mge(i,e,t,n){var r=AOe(n)?n:t(n),o=e.get(r);return typeof o>"u"&&(o=i.call(this,n),e.set(r,o)),o}function Age(i,e,t){var n=Array.prototype.slice.call(arguments,3),r=t(n),o=e.get(r);return typeof o>"u"&&(o=i.apply(this,n),e.set(r,o)),o}function qG(i,e,t,n,r){return t.bind(e,i,n,r)}function POe(i,e){var t=i.length===1?Mge:Age;return qG(i,this,t,e.cache.create(),e.serializer)}function OOe(i,e){return qG(i,this,Age,e.cache.create(),e.serializer)}function FOe(i,e){return qG(i,this,Mge,e.cache.create(),e.serializer)}var BOe=function(){return JSON.stringify(arguments)};function XG(){this.cache=Object.create(null)}XG.prototype.get=function(i){return this.cache[i]};XG.prototype.set=function(i,e){this.cache[i]=e};var WOe={create:function(){return new XG}},Jh={variadic:OOe,monadic:FOe},Bf;(function(i){i.MISSING_VALUE="MISSING_VALUE",i.INVALID_VALUE="INVALID_VALUE",i.MISSING_INTL_API="MISSING_INTL_API"})(Bf||(Bf={}));var w_=function(i){ad(e,i);function e(t,n,r){var o=i.call(this,t)||this;return o.code=n,o.originalMessage=r,o}return e.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},e}(Error),vne=function(i){ad(e,i);function e(t,n,r,o){return i.call(this,'Invalid values for "'.concat(t,'": "').concat(n,'". Options are "').concat(Object.keys(r).join('", "'),'"'),Bf.INVALID_VALUE,o)||this}return e}(w_),$Oe=function(i){ad(e,i);function e(t,n,r){return i.call(this,'Value for "'.concat(t,'" must be of type ').concat(n),Bf.INVALID_VALUE,r)||this}return e}(w_),HOe=function(i){ad(e,i);function e(t,n){return i.call(this,'The intl string context variable "'.concat(t,'" was not provided to the string "').concat(n,'"'),Bf.MISSING_VALUE,n)||this}return e}(w_),ml;(function(i){i[i.literal=0]="literal",i[i.object=1]="object"})(ml||(ml={}));function VOe(i){return i.length<2?i:i.reduce(function(e,t){var n=e[e.length-1];return!n||n.type!==ml.literal||t.type!==ml.literal?e.push(t):n.value+=t.value,e},[])}function Pge(i){return typeof i=="function"}function rM(i,e,t,n,r,o,s){if(i.length===1&&une(i[0]))return[{type:ml.literal,value:i[0].value}];for(var a=[],l=0,c=i;l"u")){var t=Intl.NumberFormat.supportedLocalesOf(e);return t.length>0?new Intl.Locale(t[0]):new Intl.Locale(typeof e=="string"?e:e[0])}},i.__parse=MOe,i.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},i}(),xb;(function(i){i.FORMAT_ERROR="FORMAT_ERROR",i.UNSUPPORTED_FORMATTER="UNSUPPORTED_FORMATTER",i.INVALID_CONFIG="INVALID_CONFIG",i.MISSING_DATA="MISSING_DATA",i.MISSING_TRANSLATION="MISSING_TRANSLATION"})(xb||(xb={}));var Sk=function(i){ad(e,i);function e(t,n,r){var o=this,s=r?r instanceof Error?r:new Error(String(r)):void 0;return o=i.call(this,"[@formatjs/intl Error ".concat(t,"] ").concat(n,` `).concat(s?` @@ -79,18 +79,18 @@ Locale: `).concat(n,` MessageID: `).concat(r==null?void 0:r.id,` Default Message: `).concat(r==null?void 0:r.defaultMessage,` Description: `).concat(r==null?void 0:r.description,` -`),n,o)||this;return s.descriptor=r,s.locale=n,s}return e}(ld),qOe=function(i){ad(e,i);function e(t,n){var r=i.call(this,xb.MISSING_TRANSLATION,'Missing message: "'.concat(t.id,'" for locale "').concat(n,'", using ').concat(t.defaultMessage?"default message (".concat(typeof t.defaultMessage=="string"?t.defaultMessage:t.defaultMessage.map(function(o){var s;return(s=o.value)!==null&&s!==void 0?s:JSON.stringify(o)}).join(),")"):"id"," as fallback."))||this;return r.descriptor=t,r}return e}(Sk);function lC(i,e,t){return t===void 0&&(t={}),e.reduce(function(n,r){return r in i?n[r]=i[r]:r in t&&(n[r]=t[r]),n},{})}var XOe=function(i){},YOe=function(i){},Fge={formats:{},messages:{},timeZone:void 0,defaultLocale:"en",defaultFormats:{},fallbackOnEmptyString:!0,onError:XOe,onWarn:YOe};function Bge(){return{dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}}}function Z_(i){return{create:function(){return{get:function(e){return i[e]},set:function(e,t){i[e]=t}}}}}function ZOe(i){i===void 0&&(i=Bge());var e=Intl.RelativeTimeFormat,t=Intl.ListFormat,n=Intl.DisplayNames,r=Qh(function(){for(var a,l=[],c=0;c needs to exist in the component ancestry.")}var zge=un(un({},Fge),{textComponent:C.Fragment});function bFe(i){return function(e){return i(C.Children.toArray(e))}}function CFe(i,e){if(i===e)return!0;if(!i||!e)return!1;var t=Object.keys(i),n=Object.keys(e),r=t.length;if(n.length!==r)return!1;for(var o=0;o=0)&&(t[r]=i[r]);return t}function IFe(i,e){if(i==null)return{};var t=DFe(i,e),n,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(i);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(i,n)&&(t[n]=i[n])}return t}function kFe(i,e){return TFe(i)||NFe(i,e)||RFe(i,e)||MFe()}function TFe(i){if(Array.isArray(i))return i}function NFe(i,e){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(i)))){var t=[],n=!0,r=!1,o=void 0;try{for(var s=i[Symbol.iterator](),a;!(n=(a=s.next()).done)&&(t.push(a.value),!(e&&t.length===e));n=!0);}catch(l){r=!0,o=l}finally{try{!n&&s.return!=null&&s.return()}finally{if(r)throw o}}return t}}function RFe(i,e){if(i){if(typeof i=="string")return Ene(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Ene(i,e)}}function Ene(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,n=new Array(e);t=i.length?i.apply(this,r):function(){for(var s=arguments.length,a=new Array(s),l=0;l1&&arguments[1]!==void 0?arguments[1]:{};qN.initial(i),qN.handler(e);var t={current:i},n=CL(GFe)(t,e),r=CL(KFe)(t),o=CL(qN.changes)(i),s=CL(jFe)(t);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(u){return u};return qN.selector(c),c(t.current)}function l(c){PFe(n,r,o,s)(c)}return[a,l]}function jFe(i,e){return vD(e)?e(i.current):e}function KFe(i,e){return i.current=Ine(Ine({},i.current),e),e}function GFe(i,e,t){return vD(e)?e(i.current):Object.keys(t).forEach(function(n){var r;return(r=e[n])===null||r===void 0?void 0:r.call(e,i.current[n])}),t}var qFe={create:UFe},XFe={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function YFe(i){return function e(){for(var t=this,n=arguments.length,r=new Array(n),o=0;o=i.length?i.apply(this,r):function(){for(var s=arguments.length,a=new Array(s),l=0;l=i.length?i.apply(this,r):function(){for(var s=arguments.length,a=new Array(s),l=0;l1&&arguments[1]!==void 0?arguments[1]:{};qN.initial(i),qN.handler(e);var t={current:i},n=CL(GFe)(t,e),r=CL(KFe)(t),o=CL(qN.changes)(i),s=CL(jFe)(t);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(u){return u};return qN.selector(c),c(t.current)}function l(c){PFe(n,r,o,s)(c)}return[a,l]}function jFe(i,e){return vD(e)?e(i.current):e}function KFe(i,e){return i.current=Ine(Ine({},i.current),e),e}function GFe(i,e,t){return vD(e)?e(i.current):Object.keys(t).forEach(function(n){var r;return(r=e[n])===null||r===void 0?void 0:r.call(e,i.current[n])}),t}var qFe={create:UFe},XFe={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function YFe(i){return function e(){for(var t=this,n=arguments.length,r=new Array(n),o=0;o=i.length?i.apply(this,r):function(){for(var s=arguments.length,a=new Array(s),l=0;l{n.current=!1}:i,e)}var Hc=y4e;function sE(){}function Z1(i,e,t,n){return w4e(i,n)||S4e(i,e,t,n)}function w4e(i,e){return i.editor.getModel(Qge(i,e))}function S4e(i,e,t,n){return i.editor.createModel(e,t,n?Qge(i,n):void 0)}function Qge(i,e){return i.Uri.parse(e)}function x4e({original:i,modified:e,language:t,originalLanguage:n,modifiedLanguage:r,originalModelPath:o,modifiedModelPath:s,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:u="Loading...",options:d={},height:h="100%",width:f="100%",className:g,wrapperProps:p={},beforeMount:v=sE,onMount:m=sE}){let[_,y]=C.useState(!1),[S,L]=C.useState(!0),E=C.useRef(null),D=C.useRef(null),k=C.useRef(null),T=C.useRef(m),M=C.useRef(v),A=C.useRef(!1);Zge(()=>{let W=n4.init();return W.then(H=>(D.current=H)&&L(!1)).catch(H=>(H==null?void 0:H.type)!=="cancelation"&&console.error("Monaco initialization: error:",H)),()=>E.current?F():W.cancel()}),Hc(()=>{if(E.current&&D.current){let W=E.current.getOriginalEditor(),H=Z1(D.current,i||"",n||t||"text",o||"");H!==W.getModel()&&W.setModel(H)}},[o],_),Hc(()=>{if(E.current&&D.current){let W=E.current.getModifiedEditor(),H=Z1(D.current,e||"",r||t||"text",s||"");H!==W.getModel()&&W.setModel(H)}},[s],_),Hc(()=>{let W=E.current.getModifiedEditor();W.getOption(D.current.editor.EditorOption.readOnly)?W.setValue(e||""):e!==W.getValue()&&(W.executeEdits("",[{range:W.getModel().getFullModelRange(),text:e||"",forceMoveMarkers:!0}]),W.pushUndoStop())},[e],_),Hc(()=>{var W,H;(H=(W=E.current)==null?void 0:W.getModel())==null||H.original.setValue(i||"")},[i],_),Hc(()=>{let{original:W,modified:H}=E.current.getModel();D.current.editor.setModelLanguage(W,n||t||"text"),D.current.editor.setModelLanguage(H,r||t||"text")},[t,n,r],_),Hc(()=>{var W;(W=D.current)==null||W.editor.setTheme(c)},[c],_),Hc(()=>{var W;(W=E.current)==null||W.updateOptions(d)},[d],_);let N=C.useCallback(()=>{var G;if(!D.current)return;M.current(D.current);let W=Z1(D.current,i||"",n||t||"text",o||""),H=Z1(D.current,e||"",r||t||"text",s||"");(G=E.current)==null||G.setModel({original:W,modified:H})},[t,e,r,i,n,o,s]),R=C.useCallback(()=>{var W;!A.current&&k.current&&(E.current=D.current.editor.createDiffEditor(k.current,{automaticLayout:!0,...d}),N(),(W=D.current)==null||W.editor.setTheme(c),y(!0),A.current=!0)},[d,c,N]);C.useEffect(()=>{_&&T.current(E.current,D.current)},[_]),C.useEffect(()=>{!S&&!_&&R()},[S,_,R]);function F(){var H,G,U,K;let W=(H=E.current)==null?void 0:H.getModel();a||((G=W==null?void 0:W.original)==null||G.dispose()),l||((U=W==null?void 0:W.modified)==null||U.dispose()),(K=E.current)==null||K.dispose()}return $e.createElement(Yge,{width:f,height:h,isEditorReady:_,loading:u,_ref:k,className:g,wrapperProps:p})}var L4e=x4e;C.memo(L4e);function E4e(i){let e=C.useRef();return C.useEffect(()=>{e.current=i},[i]),e.current}var D4e=E4e,XN=new Map;function I4e({defaultValue:i,defaultLanguage:e,defaultPath:t,value:n,language:r,path:o,theme:s="light",line:a,loading:l="Loading...",options:c={},overrideServices:u={},saveViewState:d=!0,keepCurrentModel:h=!1,width:f="100%",height:g="100%",className:p,wrapperProps:v={},beforeMount:m=sE,onMount:_=sE,onChange:y,onValidate:S=sE}){let[L,E]=C.useState(!1),[D,k]=C.useState(!0),T=C.useRef(null),M=C.useRef(null),A=C.useRef(null),N=C.useRef(_),R=C.useRef(m),F=C.useRef(),W=C.useRef(n),H=D4e(o),G=C.useRef(!1),U=C.useRef(!1);Zge(()=>{let Y=n4.init();return Y.then(J=>(T.current=J)&&k(!1)).catch(J=>(J==null?void 0:J.type)!=="cancelation"&&console.error("Monaco initialization: error:",J)),()=>M.current?re():Y.cancel()}),Hc(()=>{var J,Q,ue,de;let Y=Z1(T.current,i||n||"",e||r||"",o||t||"");Y!==((J=M.current)==null?void 0:J.getModel())&&(d&&XN.set(H,(Q=M.current)==null?void 0:Q.saveViewState()),(ue=M.current)==null||ue.setModel(Y),d&&((de=M.current)==null||de.restoreViewState(XN.get(o))))},[o],L),Hc(()=>{var Y;(Y=M.current)==null||Y.updateOptions(c)},[c],L),Hc(()=>{!M.current||n===void 0||(M.current.getOption(T.current.editor.EditorOption.readOnly)?M.current.setValue(n):n!==M.current.getValue()&&(U.current=!0,M.current.executeEdits("",[{range:M.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),M.current.pushUndoStop(),U.current=!1))},[n],L),Hc(()=>{var J,Q;let Y=(J=M.current)==null?void 0:J.getModel();Y&&r&&((Q=T.current)==null||Q.editor.setModelLanguage(Y,r))},[r],L),Hc(()=>{var Y;a!==void 0&&((Y=M.current)==null||Y.revealLine(a))},[a],L),Hc(()=>{var Y;(Y=T.current)==null||Y.editor.setTheme(s)},[s],L);let K=C.useCallback(()=>{var Y;if(!(!A.current||!T.current)&&!G.current){R.current(T.current);let J=o||t,Q=Z1(T.current,n||i||"",e||r||"",J||"");M.current=(Y=T.current)==null?void 0:Y.editor.create(A.current,{model:Q,automaticLayout:!0,...c},u),d&&M.current.restoreViewState(XN.get(J)),T.current.editor.setTheme(s),a!==void 0&&M.current.revealLine(a),E(!0),G.current=!0}},[i,e,t,n,r,o,c,u,d,s,a]);C.useEffect(()=>{L&&N.current(M.current,T.current)},[L]),C.useEffect(()=>{!D&&!L&&K()},[D,L,K]),W.current=n,C.useEffect(()=>{var Y,J;L&&y&&((Y=F.current)==null||Y.dispose(),F.current=(J=M.current)==null?void 0:J.onDidChangeModelContent(Q=>{U.current||y(M.current.getValue(),Q)}))},[L,y]),C.useEffect(()=>{if(L){let Y=T.current.editor.onDidChangeMarkers(J=>{var ue;let Q=(ue=M.current.getModel())==null?void 0:ue.uri;if(Q&&J.find(de=>de.path===Q.path)){let de=T.current.editor.getModelMarkers({resource:Q});S==null||S(de)}});return()=>{Y==null||Y.dispose()}}return()=>{}},[L,S]);function re(){var Y,J;(Y=F.current)==null||Y.dispose(),h?d&&XN.set(o,M.current.saveViewState()):(J=M.current.getModel())==null||J.dispose(),M.current.dispose()}return $e.createElement(Yge,{width:f,height:g,isEditorReady:L,loading:l,_ref:A,className:p,wrapperProps:v})}var k4e=I4e,T4e=C.memo(k4e);function Rc(i,e=0){return i[i.length-(1+e)]}function N4e(i){if(i.length===0)throw new Error("Invalid tail call");return[i.slice(0,i.length-1),i[i.length-1]]}function or(i,e,t=(n,r)=>n===r){if(i===e)return!0;if(!i||!e||i.length!==e.length)return!1;for(let n=0,r=i.length;nt(i[n],e))}function M4e(i,e){let t=0,n=i-1;for(;t<=n;){const r=(t+n)/2|0,o=e(r);if(o<0)t=r+1;else if(o>0)n=r-1;else return r}return-(t+1)}function e$(i,e,t){if(i=i|0,i>=e.length)throw new TypeError("invalid index");const n=e[Math.floor(e.length*Math.random())],r=[],o=[],s=[];for(const a of e){const l=t(a,n);l<0?r.push(a):l>0?o.push(a):s.push(a)}return i!!e)}function Nne(i){let e=0;for(let t=0;t0}function Lp(i,e=t=>t){const t=new Set;return i.filter(n=>{const r=e(n);return t.has(r)?!1:(t.add(r),!0)})}function JG(i,e){return i.length>0?i[0]:e}function la(i,e){let t=typeof e=="number"?i:0;typeof e=="number"?t=i:(t=0,e=i);const n=[];if(t<=e)for(let r=t;re;r--)n.push(r);return n}function i4(i,e,t){const n=i.slice(0,e),r=i.slice(e);return n.concat(t,r)}function q8(i,e){const t=i.indexOf(e);t>-1&&(i.splice(t,1),i.unshift(e))}function YN(i,e){const t=i.indexOf(e);t>-1&&(i.splice(t,1),i.push(e))}function t$(i,e){for(const t of e)i.push(t)}function eq(i){return Array.isArray(i)?i:[i]}function P4e(i,e,t){const n=tpe(i,e),r=i.length,o=t.length;i.length=r+o;for(let s=r-1;s>=n;s--)i[s+o]=i[s];for(let s=0;s0}i.isGreaterThan=n;function r(o){return o===0}i.isNeitherLessOrGreaterThan=r,i.greaterThan=1,i.lessThan=-1,i.neitherLessOrGreaterThan=0})(bD||(bD={}));function Jc(i,e){return(t,n)=>e(i(t),i(n))}function O4e(...i){return(e,t)=>{for(const n of i){const r=n(e,t);if(!bD.isNeitherLessOrGreaterThan(r))return r}return bD.neitherLessOrGreaterThan}}const dp=(i,e)=>i-e,F4e=(i,e)=>dp(i?1:0,e?1:0);function npe(i){return(e,t)=>-i(e,t)}class Ep{constructor(e){this.items=e,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t=0&&e(this.items[t]);)t--;const n=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,n}peek(){if(this.length!==0)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}class If{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new If(t=>this.iterate(n=>e(n)?t(n):!0))}map(e){return new If(t=>this.iterate(n=>t(e(n))))}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(r=>((n||bD.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}}If.empty=new If(i=>{});function Sa(i){return typeof i=="string"}function va(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)&&!(i instanceof RegExp)&&!(i instanceof Date)}function B4e(i){const e=Object.getPrototypeOf(Uint8Array);return typeof i=="object"&&i instanceof e}function Hv(i){return typeof i=="number"&&!isNaN(i)}function Mne(i){return!!i&&typeof i[Symbol.iterator]=="function"}function ipe(i){return i===!0||i===!1}function Cl(i){return typeof i>"u"}function kf(i){return!nc(i)}function nc(i){return Cl(i)||i===null}function Xn(i,e){if(!i)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function Vm(i){if(nc(i))throw new Error("Assertion Failed: argument is undefined or null");return i}function CD(i){return typeof i=="function"}function W4e(i,e){const t=Math.min(i.length,e.length);for(let n=0;n{e[t]=n&&typeof n=="object"?Mg(n):n}),e}function H4e(i){if(!i||typeof i!="object")return i;const e=[i];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const n in t)if(rpe.call(t,n)){const r=t[n];typeof r=="object"&&!Object.isFrozen(r)&&!B4e(r)&&e.push(r)}}return i}const rpe=Object.prototype.hasOwnProperty;function ope(i,e){return n$(i,e,new Set)}function n$(i,e,t){if(nc(i))return i;const n=e(i);if(typeof n<"u")return n;if(Array.isArray(i)){const r=[];for(const o of i)r.push(n$(o,e,t));return r}if(va(i)){if(t.has(i))throw new Error("Cannot clone recursive data-structure");t.add(i);const r={};for(const o in i)rpe.call(i,o)&&(r[o]=n$(i[o],e,t));return t.delete(i),r}return i}function r4(i,e,t=!0){return va(i)?(va(e)&&Object.keys(e).forEach(n=>{n in i?t&&(va(i[n])&&va(e[n])?r4(i[n],e[n],t):i[n]=e[n]):i[n]=e[n]}),i):e}function dc(i,e){if(i===e)return!0;if(i==null||e===null||e===void 0||typeof i!=typeof e||typeof i!="object"||Array.isArray(i)!==Array.isArray(e))return!1;let t,n;if(Array.isArray(i)){if(i.length!==e.length)return!1;for(t=0;tfunction(){const o=Array.prototype.slice.call(arguments,0);return e(r,o)},n={};for(const r of i)n[r]=t(r);return n}let U4e=typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function spe(i,e){let t;return e.length===0?t=i:t=i.replace(/\{(\d+)\}/g,(n,r)=>{const o=r[0],s=e[o];let a=n;return typeof s=="string"?a=s:(typeof s=="number"||typeof s=="boolean"||s===void 0||s===null)&&(a=String(s)),a}),U4e&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function w(i,e,...t){return spe(e,t)}function $n(i,e,...t){const n=spe(e,t);return{value:n,original:n}}var X8;const Q1="en";let NA=!1,RA=!1,oM=!1,ape=!1,nq=!1,iq=!1,lpe=!1,ZN,sM=Q1,Ane=Q1,j4e,wd;const hp=globalThis;let ca;typeof hp.vscode<"u"&&typeof hp.vscode.process<"u"?ca=hp.vscode.process:typeof process<"u"&&(ca=process);const K4e=typeof((X8=ca==null?void 0:ca.versions)===null||X8===void 0?void 0:X8.electron)=="string",G4e=K4e&&(ca==null?void 0:ca.type)==="renderer";if(typeof ca=="object"){NA=ca.platform==="win32",RA=ca.platform==="darwin",oM=ca.platform==="linux",oM&&ca.env.SNAP&&ca.env.SNAP_REVISION,ca.env.CI||ca.env.BUILD_ARTIFACTSTAGINGDIRECTORY,ZN=Q1,sM=Q1;const i=ca.env.VSCODE_NLS_CONFIG;if(i)try{const e=JSON.parse(i),t=e.availableLanguages["*"];ZN=e.locale,Ane=e.osLocale,sM=t||Q1,j4e=e._translationsConfigFile}catch{}ape=!0}else typeof navigator=="object"&&!G4e?(wd=navigator.userAgent,NA=wd.indexOf("Windows")>=0,RA=wd.indexOf("Macintosh")>=0,iq=(wd.indexOf("Macintosh")>=0||wd.indexOf("iPad")>=0||wd.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,oM=wd.indexOf("Linux")>=0,lpe=(wd==null?void 0:wd.indexOf("Mobi"))>=0,nq=!0,w({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"),ZN=Q1,sM=ZN,Ane=navigator.language):console.error("Unable to resolve platform.");const Rs=NA,Ln=RA,Da=oM,Jd=ape,x_=nq,q4e=nq&&typeof hp.importScripts=="function",X4e=q4e?hp.origin:void 0,ch=iq,cpe=lpe,Wf=wd,Y4e=sM,Z4e=typeof hp.postMessage=="function"&&!hp.importScripts,upe=(()=>{if(Z4e){const i=[];hp.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,r=i.length;n{const n=++e;i.push({id:n,callback:t}),hp.postMessage({vscodeScheduleAsyncWork:n},"*")}}return i=>setTimeout(i)})(),yl=RA||iq?2:NA?1:3;let Pne=!0,One=!1;function dpe(){if(!One){One=!0;const i=new Uint8Array(2);i[0]=1,i[1]=2,Pne=new Uint16Array(i.buffer)[0]===(2<<8)+1}return Pne}const hpe=!!(Wf&&Wf.indexOf("Chrome")>=0),Q4e=!!(Wf&&Wf.indexOf("Firefox")>=0),J4e=!!(!hpe&&Wf&&Wf.indexOf("Safari")>=0),e3e=!!(Wf&&Wf.indexOf("Edg/")>=0),t3e=!!(Wf&&Wf.indexOf("Android")>=0),Ds={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var En;(function(i){function e(y){return y&&typeof y=="object"&&typeof y[Symbol.iterator]=="function"}i.is=e;const t=Object.freeze([]);function n(){return t}i.empty=n;function*r(y){yield y}i.single=r;function o(y){return e(y)?y:r(y)}i.wrap=o;function s(y){return y||t}i.from=s;function*a(y){for(let S=y.length-1;S>=0;S--)yield y[S]}i.reverse=a;function l(y){return!y||y[Symbol.iterator]().next().done===!0}i.isEmpty=l;function c(y){return y[Symbol.iterator]().next().value}i.first=c;function u(y,S){for(const L of y)if(S(L))return!0;return!1}i.some=u;function d(y,S){for(const L of y)if(S(L))return L}i.find=d;function*h(y,S){for(const L of y)S(L)&&(yield L)}i.filter=h;function*f(y,S){let L=0;for(const E of y)yield S(E,L++)}i.map=f;function*g(...y){for(const S of y)yield*S}i.concat=g;function p(y,S,L){let E=L;for(const D of y)E=S(E,D);return E}i.reduce=p;function*v(y,S,L=y.length){for(S<0&&(S+=y.length),L<0?L+=y.length:L>y.length&&(L=y.length);S{r||(r=!0,this._remove(n))}}shift(){if(this._first!==no.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==no.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==no.Undefined&&e.next!==no.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===no.Undefined&&e.next===no.Undefined?(this._first=no.Undefined,this._last=no.Undefined):e.next===no.Undefined?(this._last=this._last.prev,this._last.next=no.Undefined):e.prev===no.Undefined&&(this._first=this._first.next,this._first.prev=no.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==no.Undefined;)yield e.element,e=e.next}}const fpe="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function n3e(i=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of fpe)i.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const rq=n3e();function oq(i){let e=rq;if(i&&i instanceof RegExp)if(i.global)e=i;else{let t="g";i.ignoreCase&&(t+="i"),i.multiline&&(t+="m"),i.unicode&&(t+="u"),e=new RegExp(i.source,t)}return e.lastIndex=0,e}const gpe=new _a;gpe.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function yD(i,e,t,n,r){if(e=oq(e),r||(r=En.first(gpe)),t.length>r.maxLen){let c=i-r.maxLen/2;return c<0?c=0:n+=c,t=t.substring(c,i+r.maxLen/2),yD(i,e,t,n,r)}const o=Date.now(),s=i-1-n;let a=-1,l=null;for(let c=1;!(Date.now()-o>=r.timeBudget);c++){const u=s-r.windowSize*c;e.lastIndex=Math.max(0,u);const d=i3e(e,t,s,a);if(!d&&l||(l=d,u<=0))break;a=u}if(l){const c={word:l[0],startColumn:n+1+l.index,endColumn:n+1+l.index+l[0].length};return e.lastIndex=0,c}return null}function i3e(i,e,t,n){let r;for(;r=i.exec(e);){const o=r.index||0;if(o<=t&&i.lastIndex>=t)return r;if(n>0&&o>n)return null}return null}const gm=8;class ppe{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class mpe{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class er{constructor(e,t,n,r){this.id=e,this.name=t,this.defaultValue=n,this.schema=r}applyUpdate(e,t){return o4(e,t)}compute(e,t,n){return n}}class aE{constructor(e,t){this.newValue=e,this.didChange=t}}function o4(i,e){if(typeof i!="object"||typeof e!="object"||!i||!e)return new aE(e,i!==e);if(Array.isArray(i)||Array.isArray(e)){const n=Array.isArray(i)&&Array.isArray(e)&&or(i,e);return new aE(e,!n)}let t=!1;for(const n in e)if(e.hasOwnProperty(n)){const r=o4(i[n],e[n]);r.didChange&&(i[n]=r.newValue,t=!0)}return new aE(i,t)}class Ek{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return o4(e,t)}validate(e){return this.defaultValue}}class wS{constructor(e,t,n,r){this.id=e,this.name=t,this.defaultValue=n,this.schema=r}applyUpdate(e,t){return o4(e,t)}validate(e){return typeof e>"u"?this.defaultValue:e}compute(e,t,n){return n}}function Lt(i,e){return typeof i>"u"?e:i==="false"?!1:!!i}class Bn extends wS{constructor(e,t,n,r=void 0){typeof r<"u"&&(r.type="boolean",r.default=n),super(e,t,n,r)}validate(e){return Lt(e,this.defaultValue)}}function h0(i,e,t,n){if(typeof i>"u")return e;let r=parseInt(i,10);return isNaN(r)?e:(r=Math.max(t,r),r=Math.min(n,r),r|0)}class _i extends wS{static clampedInt(e,t,n,r){return h0(e,t,n,r)}constructor(e,t,n,r,o,s=void 0){typeof s<"u"&&(s.type="integer",s.default=n,s.minimum=r,s.maximum=o),super(e,t,n,s),this.minimum=r,this.maximum=o}validate(e){return _i.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function r3e(i,e,t,n){if(typeof i>"u")return e;const r=zu.float(i,e);return zu.clamp(r,t,n)}class zu extends wS{static clamp(e,t,n){return en?n:e}static float(e,t){if(typeof e=="number")return e;if(typeof e>"u")return t;const n=parseFloat(e);return isNaN(n)?t:n}constructor(e,t,n,r,o){typeof o<"u"&&(o.type="number",o.default=n),super(e,t,n,o),this.validationFn=r}validate(e){return this.validationFn(zu.float(e,this.defaultValue))}}class ha extends wS{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,n,r=void 0){typeof r<"u"&&(r.type="string",r.default=n),super(e,t,n,r)}validate(e){return ha.string(e,this.defaultValue)}}function _r(i,e,t,n){return typeof i!="string"?e:n&&i in n?n[i]:t.indexOf(i)===-1?e:i}class dr extends wS{constructor(e,t,n,r,o=void 0){typeof o<"u"&&(o.type="string",o.enum=r,o.default=n),super(e,t,n,o),this._allowedValues=r}validate(e){return _r(e,this.defaultValue,this._allowedValues)}}class QN extends er{constructor(e,t,n,r,o,s,a=void 0){typeof a<"u"&&(a.type="string",a.enum=o,a.default=r),super(e,t,n,a),this._allowedValues=o,this._convert=s}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function o3e(i){switch(i){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class s3e extends er{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[w("accessibilitySupport.auto","Use platform APIs to detect when a Screen Reader is attached."),w("accessibilitySupport.on","Optimize for usage with a Screen Reader."),w("accessibilitySupport.off","Assume a screen reader is not attached.")],default:"auto",tags:["accessibility"],description:w("accessibilitySupport","Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,n){return n===0?e.accessibilitySupport:n}}class a3e extends er{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:w("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:w("comments.ignoreEmptyLines","Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertSpace:Lt(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:Lt(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function l3e(i){switch(i){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var Qo;(function(i){i[i.Line=1]="Line",i[i.Block=2]="Block",i[i.Underline=3]="Underline",i[i.LineThin=4]="LineThin",i[i.BlockOutline=5]="BlockOutline",i[i.UnderlineThin=6]="UnderlineThin"})(Qo||(Qo={}));function c3e(i){switch(i){case"line":return Qo.Line;case"block":return Qo.Block;case"underline":return Qo.Underline;case"line-thin":return Qo.LineThin;case"block-outline":return Qo.BlockOutline;case"underline-thin":return Qo.UnderlineThin}}class u3e extends Ek{constructor(){super(141)}compute(e,t,n){const r=["monaco-editor"];return t.get(39)&&r.push(t.get(39)),e.extraEditorClassName&&r.push(e.extraEditorClassName),t.get(74)==="default"?r.push("mouse-default"):t.get(74)==="copy"&&r.push("mouse-copy"),t.get(111)&&r.push("showUnused"),t.get(139)&&r.push("showDeprecated"),r.join(" ")}}class d3e extends Bn{constructor(){super(37,"emptySelectionClipboard",!0,{description:w("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,n){return n&&e.emptySelectionClipboard}}class h3e extends er{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(41,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:w("find.cursorMoveOnType","Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[w("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),w("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),w("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:w("find.seedSearchStringFromSelection","Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[w("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),w("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),w("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:w("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:w("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:Ln},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:w("find.addExtraSpaceOnTop","Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:w("find.loop","Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{cursorMoveOnType:Lt(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":_r(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":_r(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:Lt(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:Lt(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:Lt(t.loop,this.defaultValue.loop)}}}class ic extends er{constructor(){super(51,"fontLigatures",ic.OFF,{anyOf:[{type:"boolean",description:w("fontLigatures","Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:w("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:w("fontLigaturesGeneral","Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"||e.length===0?ic.OFF:e==="true"?ic.ON:e:e?ic.ON:ic.OFF}}ic.OFF='"liga" off, "calt" off';ic.ON='"liga" on, "calt" on';class Ud extends er{constructor(){super(54,"fontVariations",Ud.OFF,{anyOf:[{type:"boolean",description:w("fontVariations","Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")},{type:"string",description:w("fontVariationSettings","Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")}],description:w("fontVariationsGeneral","Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?Ud.OFF:e==="true"?Ud.TRANSLATE:e:e?Ud.TRANSLATE:Ud.OFF}compute(e,t,n){return e.fontInfo.fontVariationSettings}}Ud.OFF="normal";Ud.TRANSLATE="translate";class f3e extends Ek{constructor(){super(50)}compute(e,t,n){return e.fontInfo}}class g3e extends wS{constructor(){super(52,"fontSize",Qa.fontSize,{type:"number",minimum:6,maximum:100,default:Qa.fontSize,description:w("fontSize","Controls the font size in pixels.")})}validate(e){const t=zu.float(e,this.defaultValue);return t===0?Qa.fontSize:zu.clamp(t,6,100)}compute(e,t,n){return e.fontInfo.fontSize}}class uf extends er{constructor(){super(53,"fontWeight",Qa.fontWeight,{anyOf:[{type:"number",minimum:uf.MINIMUM_VALUE,maximum:uf.MAXIMUM_VALUE,errorMessage:w("fontWeightErrorMessage",'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:uf.SUGGESTION_VALUES}],default:Qa.fontWeight,description:w("fontWeight",'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return e==="normal"||e==="bold"?e:String(_i.clampedInt(e,Qa.fontWeight,uf.MINIMUM_VALUE,uf.MAXIMUM_VALUE))}}uf.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"];uf.MINIMUM_VALUE=1;uf.MAXIMUM_VALUE=1e3;class p3e extends er{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:[w("editor.gotoLocation.multiple.peek","Show Peek view of the results (default)"),w("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a Peek view"),w("editor.gotoLocation.multiple.goto","Go to the primary result and enable Peek-less navigation to others")]},n=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(58,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:w("editor.gotoLocation.multiple.deprecated","This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":{description:w("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleTypeDefinitions":{description:w("editor.editor.gotoLocation.multipleTypeDefinitions","Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleDeclarations":{description:w("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleImplementations":{description:w("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleReferences":{description:w("editor.editor.gotoLocation.multipleReferences","Controls the behavior the 'Go to References'-command when multiple target locations exist."),...t},"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:n,description:w("alternativeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:n,description:w("alternativeTypeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:n,description:w("alternativeDeclarationCommand","Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:n,description:w("alternativeImplementationCommand","Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:n,description:w("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var t,n,r,o,s;if(!e||typeof e!="object")return this.defaultValue;const a=e;return{multiple:_r(a.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:(t=a.multipleDefinitions)!==null&&t!==void 0?t:_r(a.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:(n=a.multipleTypeDefinitions)!==null&&n!==void 0?n:_r(a.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:(r=a.multipleDeclarations)!==null&&r!==void 0?r:_r(a.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:(o=a.multipleImplementations)!==null&&o!==void 0?o:_r(a.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:(s=a.multipleReferences)!==null&&s!==void 0?s:_r(a.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:ha.string(a.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:ha.string(a.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:ha.string(a.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:ha.string(a.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:ha.string(a.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}class m3e extends er{constructor(){const e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(60,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:w("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:w("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:w("hover.sticky","Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,description:w("hover.hidingDelay","Controls the delay in milliseconds after which the hover is hidden. Requires `editor.hover.sticky` to be enabled.")},"editor.hover.above":{type:"boolean",default:e.above,description:w("hover.above","Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Lt(t.enabled,this.defaultValue.enabled),delay:_i.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:Lt(t.sticky,this.defaultValue.sticky),hidingDelay:_i.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:Lt(t.above,this.defaultValue.above)}}}class Ty extends Ek{constructor(){super(144)}compute(e,t,n){return Ty.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,n=Math.floor(e.paddingTop/e.lineHeight);let r=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(r=Math.max(r,t-1));const o=(n+e.viewLineCount+r)/(e.pixelRatio*e.height),s=Math.floor(e.viewLineCount/o);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:n,extraLinesBeyondLastLine:r,desiredRatio:o,minimapLineCount:s}}static _computeMinimapLayout(e,t){const n=e.outerWidth,r=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*r),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:r};const s=t.stableMinimapLayoutInput,a=s&&e.outerHeight===s.outerHeight&&e.lineHeight===s.lineHeight&&e.typicalHalfwidthCharacterWidth===s.typicalHalfwidthCharacterWidth&&e.pixelRatio===s.pixelRatio&&e.scrollBeyondLastLine===s.scrollBeyondLastLine&&e.paddingTop===s.paddingTop&&e.paddingBottom===s.paddingBottom&&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,l=e.lineHeight,c=e.typicalHalfwidthCharacterWidth,u=e.scrollBeyondLastLine,d=e.minimap.renderCharacters;let h=o>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const f=e.minimap.maxColumn,g=e.minimap.size,p=e.minimap.side,v=e.verticalScrollbarWidth,m=e.viewLineCount,_=e.remainingWidth,y=e.isViewportWrapping,S=d?2:3;let L=Math.floor(o*r);const E=L/o;let D=!1,k=!1,T=S*h,M=h/o,A=1;if(g==="fill"||g==="fit"){const{typicalViewportLineCount:U,extraLinesBeforeFirstLine:K,extraLinesBeyondLastLine:re,desiredRatio:Y,minimapLineCount:J}=Ty.computeContainedMinimapLineCount({viewLineCount:m,scrollBeyondLastLine:u,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:r,lineHeight:l,pixelRatio:o});if(m/J>1)D=!0,k=!0,h=1,T=1,M=h/o;else{let ue=!1,de=h+1;if(g==="fit"){const _e=Math.ceil((K+m+re)*T);y&&a&&_<=t.stableFitRemainingWidth?(ue=!0,de=t.stableFitMaxMinimapScale):ue=_e>L}if(g==="fill"||ue){D=!0;const _e=h;T=Math.min(l*o,Math.max(1,Math.floor(1/Y))),y&&a&&_<=t.stableFitRemainingWidth&&(de=t.stableFitMaxMinimapScale),h=Math.min(de,Math.max(1,Math.floor(T/S))),h>_e&&(A=Math.min(2,h/_e)),M=h/o/A,L=Math.ceil(Math.max(U,K+m+re)*T),y?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=_,t.stableFitMaxMinimapScale=h):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const N=Math.floor(f*M),R=Math.min(N,Math.max(0,Math.floor((_-v-2)*M/(c+M)))+gm);let F=Math.floor(o*R);const W=F/o;F=Math.floor(F*A);const H=d?1:2,G=p==="left"?0:n-R-v;return{renderMinimap:H,minimapLeft:G,minimapWidth:R,minimapHeightIsEditorHeight:D,minimapIsSampling:k,minimapScale:h,minimapLineHeight:T,minimapCanvasInnerWidth:F,minimapCanvasInnerHeight:L,minimapCanvasOuterWidth:W,minimapCanvasOuterHeight:E}}static computeLayout(e,t){const n=t.outerWidth|0,r=t.outerHeight|0,o=t.lineHeight|0,s=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,c=t.pixelRatio,u=t.viewLineCount,d=e.get(136),h=d==="inherit"?e.get(135):d,f=h==="inherit"?e.get(131):h,g=e.get(134),p=t.isDominatedByLongLines,v=e.get(57),m=e.get(68).renderType!==0,_=e.get(69),y=e.get(105),S=e.get(84),L=e.get(73),E=e.get(103),D=E.verticalScrollbarSize,k=E.verticalHasArrows,T=E.arrowSize,M=E.horizontalScrollbarSize,A=e.get(43),N=e.get(110)!=="never";let R=e.get(66);A&&N&&(R+=16);let F=0;if(m){const Ve=Math.max(s,_);F=Math.round(Ve*l)}let W=0;v&&(W=o*t.glyphMarginDecorationLaneCount);let H=0,G=H+W,U=G+F,K=U+R;const re=n-W-F-R;let Y=!1,J=!1,Q=-1;h==="inherit"&&p?(Y=!0,J=!0):f==="on"||f==="bounded"?J=!0:f==="wordWrapColumn"&&(Q=g);const ue=Ty._computeMinimapLayout({outerWidth:n,outerHeight:r,lineHeight:o,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:y,paddingTop:S.top,paddingBottom:S.bottom,minimap:L,verticalScrollbarWidth:D,viewLineCount:u,remainingWidth:re,isViewportWrapping:J},t.memory||new mpe);ue.renderMinimap!==0&&ue.minimapLeft===0&&(H+=ue.minimapWidth,G+=ue.minimapWidth,U+=ue.minimapWidth,K+=ue.minimapWidth);const de=re-ue.minimapWidth,_e=Math.max(1,Math.floor((de-D-2)/a)),ve=k?T:0;return J&&(Q=Math.max(1,_e),f==="bounded"&&(Q=Math.min(Q,g))),{width:n,height:r,glyphMarginLeft:H,glyphMarginWidth:W,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:G,lineNumbersWidth:F,decorationsLeft:U,decorationsWidth:R,contentLeft:K,contentWidth:de,minimap:ue,viewportColumn:_e,isWordWrapMinified:Y,isViewportWrapping:J,wrappingColumn:Q,verticalScrollbarWidth:D,horizontalScrollbarHeight:M,overviewRuler:{top:ve,width:D,height:r-2*ve,right:0}}}}class v3e extends er{constructor(){super(138,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[w("wrappingStrategy.simple","Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),w("wrappingStrategy.advanced","Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],type:"string",enum:["simple","advanced"],default:"simple",description:w("wrappingStrategy","Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return _r(e,"simple",["simple","advanced"])}compute(e,t,n){return t.get(2)===2?"advanced":n}}var Fu;(function(i){i.Off="off",i.OnCode="onCode",i.On="on"})(Fu||(Fu={}));class _3e extends er{constructor(){const e={enabled:Fu.OnCode};super(65,"lightbulb",e,{"editor.lightbulb.enabled":{type:"string",tags:["experimental"],enum:[Fu.Off,Fu.OnCode,Fu.On],default:e.enabled,enumDescriptions:[w("editor.lightbulb.enabled.off","Disable the code action menu."),w("editor.lightbulb.enabled.onCode","Show the code action menu when the cursor is on lines with code."),w("editor.lightbulb.enabled.on","Show the code action menu when the cursor is on lines with code or on empty lines.")],description:w("enabled","Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:_r(e.enabled,this.defaultValue.enabled,[Fu.Off,Fu.OnCode,Fu.On])}}}class b3e extends er{constructor(){const e={enabled:!0,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(115,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:w("editor.stickyScroll.enabled","Shows the nested current scopes during the scroll at the top of the editor."),tags:["experimental"]},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:20,description:w("editor.stickyScroll.maxLineCount","Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:w("editor.stickyScroll.defaultModel","Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.")},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:e.scrollWithEditor,description:w("editor.stickyScroll.scrollWithEditor","Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Lt(t.enabled,this.defaultValue.enabled),maxLineCount:_i.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,20),defaultModel:_r(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:Lt(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class C3e extends er{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(140,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:w("inlayHints.enable","Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[w("editor.inlayHints.on","Inlay hints are enabled"),w("editor.inlayHints.onUnlessPressed","Inlay hints are showing by default and hide when holding {0}",Ln?"Ctrl+Option":"Ctrl+Alt"),w("editor.inlayHints.offUnlessPressed","Inlay hints are hidden by default and show when holding {0}",Ln?"Ctrl+Option":"Ctrl+Alt"),w("editor.inlayHints.off","Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:w("inlayHints.fontSize","Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.","`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:w("inlayHints.fontFamily","Controls font family of inlay hints in the editor. When set to empty, the {0} is used.","`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:w("inlayHints.padding","Enables the padding around the inlay hints in the editor.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return typeof t.enabled=="boolean"&&(t.enabled=t.enabled?"on":"off"),{enabled:_r(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:_i.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:ha.string(t.fontFamily,this.defaultValue.fontFamily),padding:Lt(t.padding,this.defaultValue.padding)}}}class y3e extends er{constructor(){super(66,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):_i.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,n){return n<0?_i.clampedInt(-n*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):n}}class w3e extends zu{constructor(){super(67,"lineHeight",Qa.lineHeight,e=>zu.clamp(e,0,150),{markdownDescription:w("lineHeight",`Controls the line height. + `},kne=YFe(e4e)(Kge),t4e={config:QFe},n4e=function(){for(var e=arguments.length,t=new Array(e),n=0;n{n.current=!1}:i,e)}var Hc=y4e;function sE(){}function Z1(i,e,t,n){return w4e(i,n)||S4e(i,e,t,n)}function w4e(i,e){return i.editor.getModel(Qge(i,e))}function S4e(i,e,t,n){return i.editor.createModel(e,t,n?Qge(i,n):void 0)}function Qge(i,e){return i.Uri.parse(e)}function x4e({original:i,modified:e,language:t,originalLanguage:n,modifiedLanguage:r,originalModelPath:o,modifiedModelPath:s,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:u="Loading...",options:d={},height:h="100%",width:f="100%",className:g,wrapperProps:p={},beforeMount:v=sE,onMount:m=sE}){let[_,y]=C.useState(!1),[S,L]=C.useState(!0),E=C.useRef(null),D=C.useRef(null),k=C.useRef(null),T=C.useRef(m),M=C.useRef(v),A=C.useRef(!1);Zge(()=>{let W=n4.init();return W.then(H=>(D.current=H)&&L(!1)).catch(H=>(H==null?void 0:H.type)!=="cancelation"&&console.error("Monaco initialization: error:",H)),()=>E.current?F():W.cancel()}),Hc(()=>{if(E.current&&D.current){let W=E.current.getOriginalEditor(),H=Z1(D.current,i||"",n||t||"text",o||"");H!==W.getModel()&&W.setModel(H)}},[o],_),Hc(()=>{if(E.current&&D.current){let W=E.current.getModifiedEditor(),H=Z1(D.current,e||"",r||t||"text",s||"");H!==W.getModel()&&W.setModel(H)}},[s],_),Hc(()=>{let W=E.current.getModifiedEditor();W.getOption(D.current.editor.EditorOption.readOnly)?W.setValue(e||""):e!==W.getValue()&&(W.executeEdits("",[{range:W.getModel().getFullModelRange(),text:e||"",forceMoveMarkers:!0}]),W.pushUndoStop())},[e],_),Hc(()=>{var W,H;(H=(W=E.current)==null?void 0:W.getModel())==null||H.original.setValue(i||"")},[i],_),Hc(()=>{let{original:W,modified:H}=E.current.getModel();D.current.editor.setModelLanguage(W,n||t||"text"),D.current.editor.setModelLanguage(H,r||t||"text")},[t,n,r],_),Hc(()=>{var W;(W=D.current)==null||W.editor.setTheme(c)},[c],_),Hc(()=>{var W;(W=E.current)==null||W.updateOptions(d)},[d],_);let N=C.useCallback(()=>{var G;if(!D.current)return;M.current(D.current);let W=Z1(D.current,i||"",n||t||"text",o||""),H=Z1(D.current,e||"",r||t||"text",s||"");(G=E.current)==null||G.setModel({original:W,modified:H})},[t,e,r,i,n,o,s]),R=C.useCallback(()=>{var W;!A.current&&k.current&&(E.current=D.current.editor.createDiffEditor(k.current,{automaticLayout:!0,...d}),N(),(W=D.current)==null||W.editor.setTheme(c),y(!0),A.current=!0)},[d,c,N]);C.useEffect(()=>{_&&T.current(E.current,D.current)},[_]),C.useEffect(()=>{!S&&!_&&R()},[S,_,R]);function F(){var H,G,U,K;let W=(H=E.current)==null?void 0:H.getModel();a||((G=W==null?void 0:W.original)==null||G.dispose()),l||((U=W==null?void 0:W.modified)==null||U.dispose()),(K=E.current)==null||K.dispose()}return $e.createElement(Yge,{width:f,height:h,isEditorReady:_,loading:u,_ref:k,className:g,wrapperProps:p})}var L4e=x4e;C.memo(L4e);function E4e(i){let e=C.useRef();return C.useEffect(()=>{e.current=i},[i]),e.current}var D4e=E4e,XN=new Map;function I4e({defaultValue:i,defaultLanguage:e,defaultPath:t,value:n,language:r,path:o,theme:s="light",line:a,loading:l="Loading...",options:c={},overrideServices:u={},saveViewState:d=!0,keepCurrentModel:h=!1,width:f="100%",height:g="100%",className:p,wrapperProps:v={},beforeMount:m=sE,onMount:_=sE,onChange:y,onValidate:S=sE}){let[L,E]=C.useState(!1),[D,k]=C.useState(!0),T=C.useRef(null),M=C.useRef(null),A=C.useRef(null),N=C.useRef(_),R=C.useRef(m),F=C.useRef(),W=C.useRef(n),H=D4e(o),G=C.useRef(!1),U=C.useRef(!1);Zge(()=>{let Y=n4.init();return Y.then(J=>(T.current=J)&&k(!1)).catch(J=>(J==null?void 0:J.type)!=="cancelation"&&console.error("Monaco initialization: error:",J)),()=>M.current?re():Y.cancel()}),Hc(()=>{var J,Q,ue,de;let Y=Z1(T.current,i||n||"",e||r||"",o||t||"");Y!==((J=M.current)==null?void 0:J.getModel())&&(d&&XN.set(H,(Q=M.current)==null?void 0:Q.saveViewState()),(ue=M.current)==null||ue.setModel(Y),d&&((de=M.current)==null||de.restoreViewState(XN.get(o))))},[o],L),Hc(()=>{var Y;(Y=M.current)==null||Y.updateOptions(c)},[c],L),Hc(()=>{!M.current||n===void 0||(M.current.getOption(T.current.editor.EditorOption.readOnly)?M.current.setValue(n):n!==M.current.getValue()&&(U.current=!0,M.current.executeEdits("",[{range:M.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),M.current.pushUndoStop(),U.current=!1))},[n],L),Hc(()=>{var J,Q;let Y=(J=M.current)==null?void 0:J.getModel();Y&&r&&((Q=T.current)==null||Q.editor.setModelLanguage(Y,r))},[r],L),Hc(()=>{var Y;a!==void 0&&((Y=M.current)==null||Y.revealLine(a))},[a],L),Hc(()=>{var Y;(Y=T.current)==null||Y.editor.setTheme(s)},[s],L);let K=C.useCallback(()=>{var Y;if(!(!A.current||!T.current)&&!G.current){R.current(T.current);let J=o||t,Q=Z1(T.current,n||i||"",e||r||"",J||"");M.current=(Y=T.current)==null?void 0:Y.editor.create(A.current,{model:Q,automaticLayout:!0,...c},u),d&&M.current.restoreViewState(XN.get(J)),T.current.editor.setTheme(s),a!==void 0&&M.current.revealLine(a),E(!0),G.current=!0}},[i,e,t,n,r,o,c,u,d,s,a]);C.useEffect(()=>{L&&N.current(M.current,T.current)},[L]),C.useEffect(()=>{!D&&!L&&K()},[D,L,K]),W.current=n,C.useEffect(()=>{var Y,J;L&&y&&((Y=F.current)==null||Y.dispose(),F.current=(J=M.current)==null?void 0:J.onDidChangeModelContent(Q=>{U.current||y(M.current.getValue(),Q)}))},[L,y]),C.useEffect(()=>{if(L){let Y=T.current.editor.onDidChangeMarkers(J=>{var ue;let Q=(ue=M.current.getModel())==null?void 0:ue.uri;if(Q&&J.find(de=>de.path===Q.path)){let de=T.current.editor.getModelMarkers({resource:Q});S==null||S(de)}});return()=>{Y==null||Y.dispose()}}return()=>{}},[L,S]);function re(){var Y,J;(Y=F.current)==null||Y.dispose(),h?d&&XN.set(o,M.current.saveViewState()):(J=M.current.getModel())==null||J.dispose(),M.current.dispose()}return $e.createElement(Yge,{width:f,height:g,isEditorReady:L,loading:l,_ref:A,className:p,wrapperProps:v})}var k4e=I4e,T4e=C.memo(k4e);function Rc(i,e=0){return i[i.length-(1+e)]}function N4e(i){if(i.length===0)throw new Error("Invalid tail call");return[i.slice(0,i.length-1),i[i.length-1]]}function or(i,e,t=(n,r)=>n===r){if(i===e)return!0;if(!i||!e||i.length!==e.length)return!1;for(let n=0,r=i.length;nt(i[n],e))}function M4e(i,e){let t=0,n=i-1;for(;t<=n;){const r=(t+n)/2|0,o=e(r);if(o<0)t=r+1;else if(o>0)n=r-1;else return r}return-(t+1)}function e$(i,e,t){if(i=i|0,i>=e.length)throw new TypeError("invalid index");const n=e[Math.floor(e.length*Math.random())],r=[],o=[],s=[];for(const a of e){const l=t(a,n);l<0?r.push(a):l>0?o.push(a):s.push(a)}return i!!e)}function Nne(i){let e=0;for(let t=0;t0}function Ep(i,e=t=>t){const t=new Set;return i.filter(n=>{const r=e(n);return t.has(r)?!1:(t.add(r),!0)})}function JG(i,e){return i.length>0?i[0]:e}function la(i,e){let t=typeof e=="number"?i:0;typeof e=="number"?t=i:(t=0,e=i);const n=[];if(t<=e)for(let r=t;re;r--)n.push(r);return n}function i4(i,e,t){const n=i.slice(0,e),r=i.slice(e);return n.concat(t,r)}function q8(i,e){const t=i.indexOf(e);t>-1&&(i.splice(t,1),i.unshift(e))}function YN(i,e){const t=i.indexOf(e);t>-1&&(i.splice(t,1),i.push(e))}function t$(i,e){for(const t of e)i.push(t)}function eq(i){return Array.isArray(i)?i:[i]}function P4e(i,e,t){const n=tpe(i,e),r=i.length,o=t.length;i.length=r+o;for(let s=r-1;s>=n;s--)i[s+o]=i[s];for(let s=0;s0}i.isGreaterThan=n;function r(o){return o===0}i.isNeitherLessOrGreaterThan=r,i.greaterThan=1,i.lessThan=-1,i.neitherLessOrGreaterThan=0})(bD||(bD={}));function Jc(i,e){return(t,n)=>e(i(t),i(n))}function O4e(...i){return(e,t)=>{for(const n of i){const r=n(e,t);if(!bD.isNeitherLessOrGreaterThan(r))return r}return bD.neitherLessOrGreaterThan}}const dp=(i,e)=>i-e,F4e=(i,e)=>dp(i?1:0,e?1:0);function npe(i){return(e,t)=>-i(e,t)}class Dp{constructor(e){this.items=e,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t=0&&e(this.items[t]);)t--;const n=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,n}peek(){if(this.length!==0)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}class If{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new If(t=>this.iterate(n=>e(n)?t(n):!0))}map(e){return new If(t=>this.iterate(n=>t(e(n))))}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(r=>((n||bD.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}}If.empty=new If(i=>{});function Sa(i){return typeof i=="string"}function va(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)&&!(i instanceof RegExp)&&!(i instanceof Date)}function B4e(i){const e=Object.getPrototypeOf(Uint8Array);return typeof i=="object"&&i instanceof e}function $v(i){return typeof i=="number"&&!isNaN(i)}function Mne(i){return!!i&&typeof i[Symbol.iterator]=="function"}function ipe(i){return i===!0||i===!1}function Cl(i){return typeof i>"u"}function kf(i){return!nc(i)}function nc(i){return Cl(i)||i===null}function Xn(i,e){if(!i)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function zm(i){if(nc(i))throw new Error("Assertion Failed: argument is undefined or null");return i}function CD(i){return typeof i=="function"}function W4e(i,e){const t=Math.min(i.length,e.length);for(let n=0;n{e[t]=n&&typeof n=="object"?Mg(n):n}),e}function H4e(i){if(!i||typeof i!="object")return i;const e=[i];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const n in t)if(rpe.call(t,n)){const r=t[n];typeof r=="object"&&!Object.isFrozen(r)&&!B4e(r)&&e.push(r)}}return i}const rpe=Object.prototype.hasOwnProperty;function ope(i,e){return n$(i,e,new Set)}function n$(i,e,t){if(nc(i))return i;const n=e(i);if(typeof n<"u")return n;if(Array.isArray(i)){const r=[];for(const o of i)r.push(n$(o,e,t));return r}if(va(i)){if(t.has(i))throw new Error("Cannot clone recursive data-structure");t.add(i);const r={};for(const o in i)rpe.call(i,o)&&(r[o]=n$(i[o],e,t));return t.delete(i),r}return i}function r4(i,e,t=!0){return va(i)?(va(e)&&Object.keys(e).forEach(n=>{n in i?t&&(va(i[n])&&va(e[n])?r4(i[n],e[n],t):i[n]=e[n]):i[n]=e[n]}),i):e}function dc(i,e){if(i===e)return!0;if(i==null||e===null||e===void 0||typeof i!=typeof e||typeof i!="object"||Array.isArray(i)!==Array.isArray(e))return!1;let t,n;if(Array.isArray(i)){if(i.length!==e.length)return!1;for(t=0;tfunction(){const o=Array.prototype.slice.call(arguments,0);return e(r,o)},n={};for(const r of i)n[r]=t(r);return n}let U4e=typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function spe(i,e){let t;return e.length===0?t=i:t=i.replace(/\{(\d+)\}/g,(n,r)=>{const o=r[0],s=e[o];let a=n;return typeof s=="string"?a=s:(typeof s=="number"||typeof s=="boolean"||s===void 0||s===null)&&(a=String(s)),a}),U4e&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function w(i,e,...t){return spe(e,t)}function $n(i,e,...t){const n=spe(e,t);return{value:n,original:n}}var X8;const Q1="en";let NA=!1,RA=!1,oM=!1,ape=!1,nq=!1,iq=!1,lpe=!1,ZN,sM=Q1,Ane=Q1,j4e,wd;const hp=globalThis;let ca;typeof hp.vscode<"u"&&typeof hp.vscode.process<"u"?ca=hp.vscode.process:typeof process<"u"&&(ca=process);const K4e=typeof((X8=ca==null?void 0:ca.versions)===null||X8===void 0?void 0:X8.electron)=="string",G4e=K4e&&(ca==null?void 0:ca.type)==="renderer";if(typeof ca=="object"){NA=ca.platform==="win32",RA=ca.platform==="darwin",oM=ca.platform==="linux",oM&&ca.env.SNAP&&ca.env.SNAP_REVISION,ca.env.CI||ca.env.BUILD_ARTIFACTSTAGINGDIRECTORY,ZN=Q1,sM=Q1;const i=ca.env.VSCODE_NLS_CONFIG;if(i)try{const e=JSON.parse(i),t=e.availableLanguages["*"];ZN=e.locale,Ane=e.osLocale,sM=t||Q1,j4e=e._translationsConfigFile}catch{}ape=!0}else typeof navigator=="object"&&!G4e?(wd=navigator.userAgent,NA=wd.indexOf("Windows")>=0,RA=wd.indexOf("Macintosh")>=0,iq=(wd.indexOf("Macintosh")>=0||wd.indexOf("iPad")>=0||wd.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,oM=wd.indexOf("Linux")>=0,lpe=(wd==null?void 0:wd.indexOf("Mobi"))>=0,nq=!0,w({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"),ZN=Q1,sM=ZN,Ane=navigator.language):console.error("Unable to resolve platform.");const Rs=NA,Ln=RA,Da=oM,Jd=ape,S_=nq,q4e=nq&&typeof hp.importScripts=="function",X4e=q4e?hp.origin:void 0,ch=iq,cpe=lpe,Wf=wd,Y4e=sM,Z4e=typeof hp.postMessage=="function"&&!hp.importScripts,upe=(()=>{if(Z4e){const i=[];hp.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,r=i.length;n{const n=++e;i.push({id:n,callback:t}),hp.postMessage({vscodeScheduleAsyncWork:n},"*")}}return i=>setTimeout(i)})(),yl=RA||iq?2:NA?1:3;let Pne=!0,One=!1;function dpe(){if(!One){One=!0;const i=new Uint8Array(2);i[0]=1,i[1]=2,Pne=new Uint16Array(i.buffer)[0]===(2<<8)+1}return Pne}const hpe=!!(Wf&&Wf.indexOf("Chrome")>=0),Q4e=!!(Wf&&Wf.indexOf("Firefox")>=0),J4e=!!(!hpe&&Wf&&Wf.indexOf("Safari")>=0),e3e=!!(Wf&&Wf.indexOf("Edg/")>=0),t3e=!!(Wf&&Wf.indexOf("Android")>=0),Ds={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var En;(function(i){function e(y){return y&&typeof y=="object"&&typeof y[Symbol.iterator]=="function"}i.is=e;const t=Object.freeze([]);function n(){return t}i.empty=n;function*r(y){yield y}i.single=r;function o(y){return e(y)?y:r(y)}i.wrap=o;function s(y){return y||t}i.from=s;function*a(y){for(let S=y.length-1;S>=0;S--)yield y[S]}i.reverse=a;function l(y){return!y||y[Symbol.iterator]().next().done===!0}i.isEmpty=l;function c(y){return y[Symbol.iterator]().next().value}i.first=c;function u(y,S){for(const L of y)if(S(L))return!0;return!1}i.some=u;function d(y,S){for(const L of y)if(S(L))return L}i.find=d;function*h(y,S){for(const L of y)S(L)&&(yield L)}i.filter=h;function*f(y,S){let L=0;for(const E of y)yield S(E,L++)}i.map=f;function*g(...y){for(const S of y)yield*S}i.concat=g;function p(y,S,L){let E=L;for(const D of y)E=S(E,D);return E}i.reduce=p;function*v(y,S,L=y.length){for(S<0&&(S+=y.length),L<0?L+=y.length:L>y.length&&(L=y.length);S{r||(r=!0,this._remove(n))}}shift(){if(this._first!==no.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==no.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==no.Undefined&&e.next!==no.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===no.Undefined&&e.next===no.Undefined?(this._first=no.Undefined,this._last=no.Undefined):e.next===no.Undefined?(this._last=this._last.prev,this._last.next=no.Undefined):e.prev===no.Undefined&&(this._first=this._first.next,this._first.prev=no.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==no.Undefined;)yield e.element,e=e.next}}const fpe="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function n3e(i=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of fpe)i.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const rq=n3e();function oq(i){let e=rq;if(i&&i instanceof RegExp)if(i.global)e=i;else{let t="g";i.ignoreCase&&(t+="i"),i.multiline&&(t+="m"),i.unicode&&(t+="u"),e=new RegExp(i.source,t)}return e.lastIndex=0,e}const gpe=new _a;gpe.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function yD(i,e,t,n,r){if(e=oq(e),r||(r=En.first(gpe)),t.length>r.maxLen){let c=i-r.maxLen/2;return c<0?c=0:n+=c,t=t.substring(c,i+r.maxLen/2),yD(i,e,t,n,r)}const o=Date.now(),s=i-1-n;let a=-1,l=null;for(let c=1;!(Date.now()-o>=r.timeBudget);c++){const u=s-r.windowSize*c;e.lastIndex=Math.max(0,u);const d=i3e(e,t,s,a);if(!d&&l||(l=d,u<=0))break;a=u}if(l){const c={word:l[0],startColumn:n+1+l.index,endColumn:n+1+l.index+l[0].length};return e.lastIndex=0,c}return null}function i3e(i,e,t,n){let r;for(;r=i.exec(e);){const o=r.index||0;if(o<=t&&i.lastIndex>=t)return r;if(n>0&&o>n)return null}return null}const pm=8;class ppe{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class mpe{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class er{constructor(e,t,n,r){this.id=e,this.name=t,this.defaultValue=n,this.schema=r}applyUpdate(e,t){return o4(e,t)}compute(e,t,n){return n}}class aE{constructor(e,t){this.newValue=e,this.didChange=t}}function o4(i,e){if(typeof i!="object"||typeof e!="object"||!i||!e)return new aE(e,i!==e);if(Array.isArray(i)||Array.isArray(e)){const n=Array.isArray(i)&&Array.isArray(e)&&or(i,e);return new aE(e,!n)}let t=!1;for(const n in e)if(e.hasOwnProperty(n)){const r=o4(i[n],e[n]);r.didChange&&(i[n]=r.newValue,t=!0)}return new aE(i,t)}class Ek{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return o4(e,t)}validate(e){return this.defaultValue}}class wS{constructor(e,t,n,r){this.id=e,this.name=t,this.defaultValue=n,this.schema=r}applyUpdate(e,t){return o4(e,t)}validate(e){return typeof e>"u"?this.defaultValue:e}compute(e,t,n){return n}}function Lt(i,e){return typeof i>"u"?e:i==="false"?!1:!!i}class Bn extends wS{constructor(e,t,n,r=void 0){typeof r<"u"&&(r.type="boolean",r.default=n),super(e,t,n,r)}validate(e){return Lt(e,this.defaultValue)}}function d0(i,e,t,n){if(typeof i>"u")return e;let r=parseInt(i,10);return isNaN(r)?e:(r=Math.max(t,r),r=Math.min(n,r),r|0)}class _i extends wS{static clampedInt(e,t,n,r){return d0(e,t,n,r)}constructor(e,t,n,r,o,s=void 0){typeof s<"u"&&(s.type="integer",s.default=n,s.minimum=r,s.maximum=o),super(e,t,n,s),this.minimum=r,this.maximum=o}validate(e){return _i.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function r3e(i,e,t,n){if(typeof i>"u")return e;const r=zu.float(i,e);return zu.clamp(r,t,n)}class zu extends wS{static clamp(e,t,n){return en?n:e}static float(e,t){if(typeof e=="number")return e;if(typeof e>"u")return t;const n=parseFloat(e);return isNaN(n)?t:n}constructor(e,t,n,r,o){typeof o<"u"&&(o.type="number",o.default=n),super(e,t,n,o),this.validationFn=r}validate(e){return this.validationFn(zu.float(e,this.defaultValue))}}class ha extends wS{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,n,r=void 0){typeof r<"u"&&(r.type="string",r.default=n),super(e,t,n,r)}validate(e){return ha.string(e,this.defaultValue)}}function _r(i,e,t,n){return typeof i!="string"?e:n&&i in n?n[i]:t.indexOf(i)===-1?e:i}class dr extends wS{constructor(e,t,n,r,o=void 0){typeof o<"u"&&(o.type="string",o.enum=r,o.default=n),super(e,t,n,o),this._allowedValues=r}validate(e){return _r(e,this.defaultValue,this._allowedValues)}}class QN extends er{constructor(e,t,n,r,o,s,a=void 0){typeof a<"u"&&(a.type="string",a.enum=o,a.default=r),super(e,t,n,a),this._allowedValues=o,this._convert=s}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function o3e(i){switch(i){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class s3e extends er{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[w("accessibilitySupport.auto","Use platform APIs to detect when a Screen Reader is attached."),w("accessibilitySupport.on","Optimize for usage with a Screen Reader."),w("accessibilitySupport.off","Assume a screen reader is not attached.")],default:"auto",tags:["accessibility"],description:w("accessibilitySupport","Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,n){return n===0?e.accessibilitySupport:n}}class a3e extends er{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:w("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:w("comments.ignoreEmptyLines","Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertSpace:Lt(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:Lt(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function l3e(i){switch(i){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var Qo;(function(i){i[i.Line=1]="Line",i[i.Block=2]="Block",i[i.Underline=3]="Underline",i[i.LineThin=4]="LineThin",i[i.BlockOutline=5]="BlockOutline",i[i.UnderlineThin=6]="UnderlineThin"})(Qo||(Qo={}));function c3e(i){switch(i){case"line":return Qo.Line;case"block":return Qo.Block;case"underline":return Qo.Underline;case"line-thin":return Qo.LineThin;case"block-outline":return Qo.BlockOutline;case"underline-thin":return Qo.UnderlineThin}}class u3e extends Ek{constructor(){super(141)}compute(e,t,n){const r=["monaco-editor"];return t.get(39)&&r.push(t.get(39)),e.extraEditorClassName&&r.push(e.extraEditorClassName),t.get(74)==="default"?r.push("mouse-default"):t.get(74)==="copy"&&r.push("mouse-copy"),t.get(111)&&r.push("showUnused"),t.get(139)&&r.push("showDeprecated"),r.join(" ")}}class d3e extends Bn{constructor(){super(37,"emptySelectionClipboard",!0,{description:w("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,n){return n&&e.emptySelectionClipboard}}class h3e extends er{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(41,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:w("find.cursorMoveOnType","Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[w("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),w("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),w("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:w("find.seedSearchStringFromSelection","Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[w("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),w("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),w("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:w("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:w("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:Ln},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:w("find.addExtraSpaceOnTop","Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:w("find.loop","Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{cursorMoveOnType:Lt(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":_r(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":_r(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:Lt(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:Lt(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:Lt(t.loop,this.defaultValue.loop)}}}class ic extends er{constructor(){super(51,"fontLigatures",ic.OFF,{anyOf:[{type:"boolean",description:w("fontLigatures","Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:w("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:w("fontLigaturesGeneral","Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"||e.length===0?ic.OFF:e==="true"?ic.ON:e:e?ic.ON:ic.OFF}}ic.OFF='"liga" off, "calt" off';ic.ON='"liga" on, "calt" on';class Ud extends er{constructor(){super(54,"fontVariations",Ud.OFF,{anyOf:[{type:"boolean",description:w("fontVariations","Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")},{type:"string",description:w("fontVariationSettings","Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")}],description:w("fontVariationsGeneral","Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?Ud.OFF:e==="true"?Ud.TRANSLATE:e:e?Ud.TRANSLATE:Ud.OFF}compute(e,t,n){return e.fontInfo.fontVariationSettings}}Ud.OFF="normal";Ud.TRANSLATE="translate";class f3e extends Ek{constructor(){super(50)}compute(e,t,n){return e.fontInfo}}class g3e extends wS{constructor(){super(52,"fontSize",Qa.fontSize,{type:"number",minimum:6,maximum:100,default:Qa.fontSize,description:w("fontSize","Controls the font size in pixels.")})}validate(e){const t=zu.float(e,this.defaultValue);return t===0?Qa.fontSize:zu.clamp(t,6,100)}compute(e,t,n){return e.fontInfo.fontSize}}class uf extends er{constructor(){super(53,"fontWeight",Qa.fontWeight,{anyOf:[{type:"number",minimum:uf.MINIMUM_VALUE,maximum:uf.MAXIMUM_VALUE,errorMessage:w("fontWeightErrorMessage",'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:uf.SUGGESTION_VALUES}],default:Qa.fontWeight,description:w("fontWeight",'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return e==="normal"||e==="bold"?e:String(_i.clampedInt(e,Qa.fontWeight,uf.MINIMUM_VALUE,uf.MAXIMUM_VALUE))}}uf.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"];uf.MINIMUM_VALUE=1;uf.MAXIMUM_VALUE=1e3;class p3e extends er{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:[w("editor.gotoLocation.multiple.peek","Show Peek view of the results (default)"),w("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a Peek view"),w("editor.gotoLocation.multiple.goto","Go to the primary result and enable Peek-less navigation to others")]},n=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(58,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:w("editor.gotoLocation.multiple.deprecated","This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":{description:w("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleTypeDefinitions":{description:w("editor.editor.gotoLocation.multipleTypeDefinitions","Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleDeclarations":{description:w("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleImplementations":{description:w("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleReferences":{description:w("editor.editor.gotoLocation.multipleReferences","Controls the behavior the 'Go to References'-command when multiple target locations exist."),...t},"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:n,description:w("alternativeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:n,description:w("alternativeTypeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:n,description:w("alternativeDeclarationCommand","Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:n,description:w("alternativeImplementationCommand","Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:n,description:w("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var t,n,r,o,s;if(!e||typeof e!="object")return this.defaultValue;const a=e;return{multiple:_r(a.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:(t=a.multipleDefinitions)!==null&&t!==void 0?t:_r(a.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:(n=a.multipleTypeDefinitions)!==null&&n!==void 0?n:_r(a.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:(r=a.multipleDeclarations)!==null&&r!==void 0?r:_r(a.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:(o=a.multipleImplementations)!==null&&o!==void 0?o:_r(a.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:(s=a.multipleReferences)!==null&&s!==void 0?s:_r(a.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:ha.string(a.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:ha.string(a.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:ha.string(a.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:ha.string(a.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:ha.string(a.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}class m3e extends er{constructor(){const e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(60,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:w("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:w("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:w("hover.sticky","Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,description:w("hover.hidingDelay","Controls the delay in milliseconds after which the hover is hidden. Requires `editor.hover.sticky` to be enabled.")},"editor.hover.above":{type:"boolean",default:e.above,description:w("hover.above","Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Lt(t.enabled,this.defaultValue.enabled),delay:_i.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:Lt(t.sticky,this.defaultValue.sticky),hidingDelay:_i.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:Lt(t.above,this.defaultValue.above)}}}class Ty extends Ek{constructor(){super(144)}compute(e,t,n){return Ty.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,n=Math.floor(e.paddingTop/e.lineHeight);let r=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(r=Math.max(r,t-1));const o=(n+e.viewLineCount+r)/(e.pixelRatio*e.height),s=Math.floor(e.viewLineCount/o);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:n,extraLinesBeyondLastLine:r,desiredRatio:o,minimapLineCount:s}}static _computeMinimapLayout(e,t){const n=e.outerWidth,r=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*r),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:r};const s=t.stableMinimapLayoutInput,a=s&&e.outerHeight===s.outerHeight&&e.lineHeight===s.lineHeight&&e.typicalHalfwidthCharacterWidth===s.typicalHalfwidthCharacterWidth&&e.pixelRatio===s.pixelRatio&&e.scrollBeyondLastLine===s.scrollBeyondLastLine&&e.paddingTop===s.paddingTop&&e.paddingBottom===s.paddingBottom&&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,l=e.lineHeight,c=e.typicalHalfwidthCharacterWidth,u=e.scrollBeyondLastLine,d=e.minimap.renderCharacters;let h=o>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const f=e.minimap.maxColumn,g=e.minimap.size,p=e.minimap.side,v=e.verticalScrollbarWidth,m=e.viewLineCount,_=e.remainingWidth,y=e.isViewportWrapping,S=d?2:3;let L=Math.floor(o*r);const E=L/o;let D=!1,k=!1,T=S*h,M=h/o,A=1;if(g==="fill"||g==="fit"){const{typicalViewportLineCount:U,extraLinesBeforeFirstLine:K,extraLinesBeyondLastLine:re,desiredRatio:Y,minimapLineCount:J}=Ty.computeContainedMinimapLineCount({viewLineCount:m,scrollBeyondLastLine:u,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:r,lineHeight:l,pixelRatio:o});if(m/J>1)D=!0,k=!0,h=1,T=1,M=h/o;else{let ue=!1,de=h+1;if(g==="fit"){const _e=Math.ceil((K+m+re)*T);y&&a&&_<=t.stableFitRemainingWidth?(ue=!0,de=t.stableFitMaxMinimapScale):ue=_e>L}if(g==="fill"||ue){D=!0;const _e=h;T=Math.min(l*o,Math.max(1,Math.floor(1/Y))),y&&a&&_<=t.stableFitRemainingWidth&&(de=t.stableFitMaxMinimapScale),h=Math.min(de,Math.max(1,Math.floor(T/S))),h>_e&&(A=Math.min(2,h/_e)),M=h/o/A,L=Math.ceil(Math.max(U,K+m+re)*T),y?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=_,t.stableFitMaxMinimapScale=h):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const N=Math.floor(f*M),R=Math.min(N,Math.max(0,Math.floor((_-v-2)*M/(c+M)))+pm);let F=Math.floor(o*R);const W=F/o;F=Math.floor(F*A);const H=d?1:2,G=p==="left"?0:n-R-v;return{renderMinimap:H,minimapLeft:G,minimapWidth:R,minimapHeightIsEditorHeight:D,minimapIsSampling:k,minimapScale:h,minimapLineHeight:T,minimapCanvasInnerWidth:F,minimapCanvasInnerHeight:L,minimapCanvasOuterWidth:W,minimapCanvasOuterHeight:E}}static computeLayout(e,t){const n=t.outerWidth|0,r=t.outerHeight|0,o=t.lineHeight|0,s=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,c=t.pixelRatio,u=t.viewLineCount,d=e.get(136),h=d==="inherit"?e.get(135):d,f=h==="inherit"?e.get(131):h,g=e.get(134),p=t.isDominatedByLongLines,v=e.get(57),m=e.get(68).renderType!==0,_=e.get(69),y=e.get(105),S=e.get(84),L=e.get(73),E=e.get(103),D=E.verticalScrollbarSize,k=E.verticalHasArrows,T=E.arrowSize,M=E.horizontalScrollbarSize,A=e.get(43),N=e.get(110)!=="never";let R=e.get(66);A&&N&&(R+=16);let F=0;if(m){const Ve=Math.max(s,_);F=Math.round(Ve*l)}let W=0;v&&(W=o*t.glyphMarginDecorationLaneCount);let H=0,G=H+W,U=G+F,K=U+R;const re=n-W-F-R;let Y=!1,J=!1,Q=-1;h==="inherit"&&p?(Y=!0,J=!0):f==="on"||f==="bounded"?J=!0:f==="wordWrapColumn"&&(Q=g);const ue=Ty._computeMinimapLayout({outerWidth:n,outerHeight:r,lineHeight:o,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:y,paddingTop:S.top,paddingBottom:S.bottom,minimap:L,verticalScrollbarWidth:D,viewLineCount:u,remainingWidth:re,isViewportWrapping:J},t.memory||new mpe);ue.renderMinimap!==0&&ue.minimapLeft===0&&(H+=ue.minimapWidth,G+=ue.minimapWidth,U+=ue.minimapWidth,K+=ue.minimapWidth);const de=re-ue.minimapWidth,_e=Math.max(1,Math.floor((de-D-2)/a)),ve=k?T:0;return J&&(Q=Math.max(1,_e),f==="bounded"&&(Q=Math.min(Q,g))),{width:n,height:r,glyphMarginLeft:H,glyphMarginWidth:W,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:G,lineNumbersWidth:F,decorationsLeft:U,decorationsWidth:R,contentLeft:K,contentWidth:de,minimap:ue,viewportColumn:_e,isWordWrapMinified:Y,isViewportWrapping:J,wrappingColumn:Q,verticalScrollbarWidth:D,horizontalScrollbarHeight:M,overviewRuler:{top:ve,width:D,height:r-2*ve,right:0}}}}class v3e extends er{constructor(){super(138,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[w("wrappingStrategy.simple","Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),w("wrappingStrategy.advanced","Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],type:"string",enum:["simple","advanced"],default:"simple",description:w("wrappingStrategy","Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return _r(e,"simple",["simple","advanced"])}compute(e,t,n){return t.get(2)===2?"advanced":n}}var Fu;(function(i){i.Off="off",i.OnCode="onCode",i.On="on"})(Fu||(Fu={}));class _3e extends er{constructor(){const e={enabled:Fu.OnCode};super(65,"lightbulb",e,{"editor.lightbulb.enabled":{type:"string",tags:["experimental"],enum:[Fu.Off,Fu.OnCode,Fu.On],default:e.enabled,enumDescriptions:[w("editor.lightbulb.enabled.off","Disable the code action menu."),w("editor.lightbulb.enabled.onCode","Show the code action menu when the cursor is on lines with code."),w("editor.lightbulb.enabled.on","Show the code action menu when the cursor is on lines with code or on empty lines.")],description:w("enabled","Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:_r(e.enabled,this.defaultValue.enabled,[Fu.Off,Fu.OnCode,Fu.On])}}}class b3e extends er{constructor(){const e={enabled:!0,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(115,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:w("editor.stickyScroll.enabled","Shows the nested current scopes during the scroll at the top of the editor."),tags:["experimental"]},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:20,description:w("editor.stickyScroll.maxLineCount","Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:w("editor.stickyScroll.defaultModel","Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.")},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:e.scrollWithEditor,description:w("editor.stickyScroll.scrollWithEditor","Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Lt(t.enabled,this.defaultValue.enabled),maxLineCount:_i.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,20),defaultModel:_r(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:Lt(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class C3e extends er{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(140,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:w("inlayHints.enable","Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[w("editor.inlayHints.on","Inlay hints are enabled"),w("editor.inlayHints.onUnlessPressed","Inlay hints are showing by default and hide when holding {0}",Ln?"Ctrl+Option":"Ctrl+Alt"),w("editor.inlayHints.offUnlessPressed","Inlay hints are hidden by default and show when holding {0}",Ln?"Ctrl+Option":"Ctrl+Alt"),w("editor.inlayHints.off","Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:w("inlayHints.fontSize","Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.","`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:w("inlayHints.fontFamily","Controls font family of inlay hints in the editor. When set to empty, the {0} is used.","`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:w("inlayHints.padding","Enables the padding around the inlay hints in the editor.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return typeof t.enabled=="boolean"&&(t.enabled=t.enabled?"on":"off"),{enabled:_r(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:_i.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:ha.string(t.fontFamily,this.defaultValue.fontFamily),padding:Lt(t.padding,this.defaultValue.padding)}}}class y3e extends er{constructor(){super(66,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):_i.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,n){return n<0?_i.clampedInt(-n*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):n}}class w3e extends zu{constructor(){super(67,"lineHeight",Qa.lineHeight,e=>zu.clamp(e,0,150),{markdownDescription:w("lineHeight",`Controls the line height. - Use 0 to automatically compute the line height from the font size. - Values between 0 and 8 will be used as a multiplier with the font size. - Values greater than or equal to 8 will be used as effective values.`)})}compute(e,t,n){return e.fontInfo.lineHeight}}class S3e extends er{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1};super(73,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:w("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:w("minimap.autohide","Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[w("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),w("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),w("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:w("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:w("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:w("minimap.showSlider","Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:w("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:w("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:w("minimap.maxColumn","Limit the width of the minimap to render at most a certain number of columns.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Lt(t.enabled,this.defaultValue.enabled),autohide:Lt(t.autohide,this.defaultValue.autohide),size:_r(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:_r(t.side,this.defaultValue.side,["right","left"]),showSlider:_r(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:Lt(t.renderCharacters,this.defaultValue.renderCharacters),scale:_i.clampedInt(t.scale,1,1,3),maxColumn:_i.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}function x3e(i){return i==="ctrlCmd"?Ln?"metaKey":"ctrlKey":"altKey"}class L3e extends er{constructor(){super(84,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:w("padding.top","Controls the amount of space between the top edge of the editor and the first line.")},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:w("padding.bottom","Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{top:_i.clampedInt(t.top,0,0,1e3),bottom:_i.clampedInt(t.bottom,0,0,1e3)}}}class E3e extends er{constructor(){const e={enabled:!0,cycle:!0};super(86,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:w("parameterHints.enabled","Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:w("parameterHints.cycle","Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Lt(t.enabled,this.defaultValue.enabled),cycle:Lt(t.cycle,this.defaultValue.cycle)}}}class D3e extends Ek{constructor(){super(142)}compute(e,t,n){return e.pixelRatio}}class I3e extends er{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[w("on","Quick suggestions show inside the suggest widget"),w("inline","Quick suggestions show as ghost text"),w("off","Quick suggestions are disabled")]}];super(89,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:w("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:w("quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:w("quickSuggestions.other","Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:w("quickSuggestions","Controls whether suggestions should automatically show up while typing. This can be controlled for typing in comments, strings, and other code. Quick suggestion can be configured to show as ghost text or with the suggest widget. Also be aware of the '{0}'-setting which controls if suggestions are triggered by special characters.","#editor.suggestOnTriggerCharacters#")}),this.defaultValue=e}validate(e){if(typeof e=="boolean"){const c=e?"on":"off";return{comments:c,strings:c,other:c}}if(!e||typeof e!="object")return this.defaultValue;const{other:t,comments:n,strings:r}=e,o=["on","inline","off"];let s,a,l;return typeof t=="boolean"?s=t?"on":"off":s=_r(t,this.defaultValue.other,o),typeof n=="boolean"?a=n?"on":"off":a=_r(n,this.defaultValue.comments,o),typeof r=="boolean"?l=r?"on":"off":l=_r(r,this.defaultValue.strings,o),{other:s,comments:a,strings:l}}}class k3e extends er{constructor(){super(68,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[w("lineNumbers.off","Line numbers are not rendered."),w("lineNumbers.on","Line numbers are rendered as absolute number."),w("lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),w("lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:w("lineNumbers","Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,n=this.defaultValue.renderFn;return typeof e<"u"&&(typeof e=="function"?(t=4,n=e):e==="interval"?t=3:e==="relative"?t=2:e==="on"?t=1:t=0),{renderType:t,renderFn:n}}}function MA(i){const e=i.get(98);return e==="editable"?i.get(91):e!=="on"}class T3e extends er{constructor(){const e=[],t={type:"number",description:w("rulers.size","Number of monospace characters at which this editor ruler will render.")};super(102,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:w("rulers.color","Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:w("rulers","Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.")})}validate(e){if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="number")t.push({column:_i.clampedInt(n,0,0,1e4),color:null});else if(n&&typeof n=="object"){const r=n;t.push({column:_i.clampedInt(r.column,0,0,1e4),color:r.color})}return t.sort((n,r)=>n.column-r.column),t}return this.defaultValue}}class N3e extends er{constructor(){super(92,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}}function Fne(i,e){if(typeof i!="string")return e;switch(i){case"hidden":return 2;case"visible":return 3;default:return 1}}let R3e=class extends er{constructor(){const e={vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1,ignoreHorizontalScrollbarInContentHeight:!1};super(103,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[w("scrollbar.vertical.auto","The vertical scrollbar will be visible only when necessary."),w("scrollbar.vertical.visible","The vertical scrollbar will always be visible."),w("scrollbar.vertical.fit","The vertical scrollbar will always be hidden.")],default:"auto",description:w("scrollbar.vertical","Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[w("scrollbar.horizontal.auto","The horizontal scrollbar will be visible only when necessary."),w("scrollbar.horizontal.visible","The horizontal scrollbar will always be visible."),w("scrollbar.horizontal.fit","The horizontal scrollbar will always be hidden.")],default:"auto",description:w("scrollbar.horizontal","Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:w("scrollbar.verticalScrollbarSize","The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:w("scrollbar.horizontalScrollbarSize","The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:w("scrollbar.scrollByPage","Controls whether clicks scroll by page or jump to click position.")},"editor.scrollbar.ignoreHorizontalScrollbarInContentHeight":{type:"boolean",default:e.ignoreHorizontalScrollbarInContentHeight,description:w("scrollbar.ignoreHorizontalScrollbarInContentHeight","When set, the horizontal scrollbar will not increase the size of the editor's content.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e,n=_i.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),r=_i.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:_i.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:Fne(t.vertical,this.defaultValue.vertical),horizontal:Fne(t.horizontal,this.defaultValue.horizontal),useShadows:Lt(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:Lt(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:Lt(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:Lt(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:Lt(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:n,horizontalSliderSize:_i.clampedInt(t.horizontalSliderSize,n,0,1e3),verticalScrollbarSize:r,verticalSliderSize:_i.clampedInt(t.verticalSliderSize,r,0,1e3),scrollByPage:Lt(t.scrollByPage,this.defaultValue.scrollByPage),ignoreHorizontalScrollbarInContentHeight:Lt(t.ignoreHorizontalScrollbarInContentHeight,this.defaultValue.ignoreHorizontalScrollbarInContentHeight)}}};const Kl="inUntrustedWorkspace",Ga={allowedCharacters:"editor.unicodeHighlight.allowedCharacters",invisibleCharacters:"editor.unicodeHighlight.invisibleCharacters",nonBasicASCII:"editor.unicodeHighlight.nonBasicASCII",ambiguousCharacters:"editor.unicodeHighlight.ambiguousCharacters",includeComments:"editor.unicodeHighlight.includeComments",includeStrings:"editor.unicodeHighlight.includeStrings",allowedLocales:"editor.unicodeHighlight.allowedLocales"};class M3e extends er{constructor(){const e={nonBasicASCII:Kl,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:Kl,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(125,"unicodeHighlight",e,{[Ga.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Kl],default:e.nonBasicASCII,description:w("unicodeHighlight.nonBasicASCII","Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.")},[Ga.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:w("unicodeHighlight.invisibleCharacters","Controls whether characters that just reserve space or have no width at all are highlighted.")},[Ga.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:w("unicodeHighlight.ambiguousCharacters","Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")},[Ga.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Kl],default:e.includeComments,description:w("unicodeHighlight.includeComments","Controls whether characters in comments should also be subject to Unicode highlighting.")},[Ga.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Kl],default:e.includeStrings,description:w("unicodeHighlight.includeStrings","Controls whether characters in strings should also be subject to Unicode highlighting.")},[Ga.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:w("unicodeHighlight.allowedCharacters","Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[Ga.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:w("unicodeHighlight.allowedLocales","Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let n=!1;t.allowedCharacters&&e&&(dc(e.allowedCharacters,t.allowedCharacters)||(e={...e,allowedCharacters:t.allowedCharacters},n=!0)),t.allowedLocales&&e&&(dc(e.allowedLocales,t.allowedLocales)||(e={...e,allowedLocales:t.allowedLocales},n=!0));const r=super.applyUpdate(e,t);return n?new aE(r.newValue,!0):r}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{nonBasicASCII:Ny(t.nonBasicASCII,Kl,[!0,!1,Kl]),invisibleCharacters:Lt(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:Lt(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:Ny(t.includeComments,Kl,[!0,!1,Kl]),includeStrings:Ny(t.includeStrings,Kl,[!0,!1,Kl]),allowedCharacters:this.validateBooleanMap(e.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(e.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if(typeof e!="object"||!e)return t;const n={};for(const[r,o]of Object.entries(e))o===!0&&(n[r]=!0);return n}}class A3e extends er{constructor(){const e={enabled:!0,mode:"subwordSmart",showToolbar:"onHover",suppressSuggestions:!1,keepOnBlur:!1,fontFamily:"default"};super(62,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:w("inlineSuggest.enabled","Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[w("inlineSuggest.showToolbar.always","Show the inline suggestion toolbar whenever an inline suggestion is shown."),w("inlineSuggest.showToolbar.onHover","Show the inline suggestion toolbar when hovering over an inline suggestion."),w("inlineSuggest.showToolbar.never","Never show the inline suggestion toolbar.")],description:w("inlineSuggest.showToolbar","Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:w("inlineSuggest.suppressSuggestions","Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.")},"editor.inlineSuggest.fontFamily":{type:"string",default:e.fontFamily,description:w("inlineSuggest.fontFamily","Controls the font family of the inline suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Lt(t.enabled,this.defaultValue.enabled),mode:_r(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:_r(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),suppressSuggestions:Lt(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:Lt(t.keepOnBlur,this.defaultValue.keepOnBlur),fontFamily:ha.string(t.fontFamily,this.defaultValue.fontFamily)}}}class P3e extends er{constructor(){const e={enabled:!1,showToolbar:"onHover",fontFamily:"default",keepOnBlur:!1,backgroundColoring:!1};super(63,"experimentalInlineEdit",e,{"editor.experimentalInlineEdit.enabled":{type:"boolean",default:e.enabled,description:w("inlineEdit.enabled","Controls whether to show inline edits in the editor.")},"editor.experimentalInlineEdit.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[w("inlineEdit.showToolbar.always","Show the inline edit toolbar whenever an inline suggestion is shown."),w("inlineEdit.showToolbar.onHover","Show the inline edit toolbar when hovering over an inline suggestion."),w("inlineEdit.showToolbar.never","Never show the inline edit toolbar.")],description:w("inlineEdit.showToolbar","Controls when to show the inline edit toolbar.")},"editor.experimentalInlineEdit.fontFamily":{type:"string",default:e.fontFamily,description:w("inlineEdit.fontFamily","Controls the font family of the inline edit.")},"editor.experimentalInlineEdit.backgroundColoring":{type:"boolean",default:e.backgroundColoring,description:w("inlineEdit.backgroundColoring","Controls whether to color the background of inline edits.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Lt(t.enabled,this.defaultValue.enabled),showToolbar:_r(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),fontFamily:ha.string(t.fontFamily,this.defaultValue.fontFamily),keepOnBlur:Lt(t.keepOnBlur,this.defaultValue.keepOnBlur),backgroundColoring:Lt(t.backgroundColoring,this.defaultValue.backgroundColoring)}}}class O3e extends er{constructor(){const e={enabled:Ds.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:Ds.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(15,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:w("bracketPairColorization.enabled","Controls whether bracket pair colorization is enabled or not. Use {0} to override the bracket highlight colors.","`#workbench.colorCustomizations#`")},"editor.bracketPairColorization.independentColorPoolPerBracketType":{type:"boolean",default:e.independentColorPoolPerBracketType,description:w("bracketPairColorization.independentColorPoolPerBracketType","Controls whether each bracket type has its own independent color pool.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Lt(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:Lt(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}class F3e extends er{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(16,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[w("editor.guides.bracketPairs.true","Enables bracket pair guides."),w("editor.guides.bracketPairs.active","Enables bracket pair guides only for the active bracket pair."),w("editor.guides.bracketPairs.false","Disables bracket pair guides.")],default:e.bracketPairs,description:w("editor.guides.bracketPairs","Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[w("editor.guides.bracketPairsHorizontal.true","Enables horizontal guides as addition to vertical bracket pair guides."),w("editor.guides.bracketPairsHorizontal.active","Enables horizontal guides only for the active bracket pair."),w("editor.guides.bracketPairsHorizontal.false","Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:w("editor.guides.bracketPairsHorizontal","Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:w("editor.guides.highlightActiveBracketPair","Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:w("editor.guides.indentation","Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[w("editor.guides.highlightActiveIndentation.true","Highlights the active indent guide."),w("editor.guides.highlightActiveIndentation.always","Highlights the active indent guide even if bracket guides are highlighted."),w("editor.guides.highlightActiveIndentation.false","Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:w("editor.guides.highlightActiveIndentation","Controls whether the editor should highlight the active indent guide.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{bracketPairs:Ny(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:Ny(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:Lt(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:Lt(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:Ny(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}function Ny(i,e,t){const n=t.indexOf(i);return n===-1?e:t[n]}class B3e extends er{constructor(){const e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!1,localityBonus:!1,shareSuggestSelections:!1,selectionMode:"always",showIcons:!0,showStatusBar:!1,preview:!1,previewMode:"subwordSmart",showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!0,matchOnWordStartOnly:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0};super(118,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[w("suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),w("suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:w("suggest.insertMode","Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.")},"editor.suggest.filterGraceful":{type:"boolean",default:e.filterGraceful,description:w("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:w("suggest.localityBonus","Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:w("suggest.shareSuggestSelections","Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.selectionMode":{type:"string",enum:["always","never","whenTriggerCharacter","whenQuickSuggestion"],enumDescriptions:[w("suggest.insertMode.always","Always select a suggestion when automatically triggering IntelliSense."),w("suggest.insertMode.never","Never select a suggestion when automatically triggering IntelliSense."),w("suggest.insertMode.whenTriggerCharacter","Select a suggestion only when triggering IntelliSense from a trigger character."),w("suggest.insertMode.whenQuickSuggestion","Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:w("suggest.selectionMode","Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions (`#editor.quickSuggestions#` and `#editor.suggestOnTriggerCharacters#`) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:w("suggest.snippetsPreventQuickSuggestions","Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:w("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:w("suggest.showStatusBar","Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:w("suggest.preview","Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:w("suggest.showInlineDetails","Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:w("suggest.maxVisibleSuggestions.dep","This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:w("deprecated","This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.")},"editor.suggest.showMethods":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showMethods","When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showFunctions","When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showConstructors","When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showDeprecated","When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.matchOnWordStartOnly","When enabled IntelliSense filtering requires that the first character matches on a word start. For example, `c` on `Console` or `WebContext` but _not_ on `description`. When disabled IntelliSense will show more results but still sorts them by match quality.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showFields","When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showVariables","When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showClasss","When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showStructs","When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showInterfaces","When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showModules","When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showPropertys","When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showEvents","When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showOperators","When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showUnits","When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showValues","When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showConstants","When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showEnums","When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showEnumMembers","When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showKeywords","When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showTexts","When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showColors","When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showFiles","When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showReferences","When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showCustomcolors","When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showFolders","When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showTypeParameters","When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showSnippets","When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showUsers","When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showIssues","When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertMode:_r(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:Lt(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:Lt(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:Lt(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:Lt(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:_r(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:Lt(t.showIcons,this.defaultValue.showIcons),showStatusBar:Lt(t.showStatusBar,this.defaultValue.showStatusBar),preview:Lt(t.preview,this.defaultValue.preview),previewMode:_r(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:Lt(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:Lt(t.showMethods,this.defaultValue.showMethods),showFunctions:Lt(t.showFunctions,this.defaultValue.showFunctions),showConstructors:Lt(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:Lt(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:Lt(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:Lt(t.showFields,this.defaultValue.showFields),showVariables:Lt(t.showVariables,this.defaultValue.showVariables),showClasses:Lt(t.showClasses,this.defaultValue.showClasses),showStructs:Lt(t.showStructs,this.defaultValue.showStructs),showInterfaces:Lt(t.showInterfaces,this.defaultValue.showInterfaces),showModules:Lt(t.showModules,this.defaultValue.showModules),showProperties:Lt(t.showProperties,this.defaultValue.showProperties),showEvents:Lt(t.showEvents,this.defaultValue.showEvents),showOperators:Lt(t.showOperators,this.defaultValue.showOperators),showUnits:Lt(t.showUnits,this.defaultValue.showUnits),showValues:Lt(t.showValues,this.defaultValue.showValues),showConstants:Lt(t.showConstants,this.defaultValue.showConstants),showEnums:Lt(t.showEnums,this.defaultValue.showEnums),showEnumMembers:Lt(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:Lt(t.showKeywords,this.defaultValue.showKeywords),showWords:Lt(t.showWords,this.defaultValue.showWords),showColors:Lt(t.showColors,this.defaultValue.showColors),showFiles:Lt(t.showFiles,this.defaultValue.showFiles),showReferences:Lt(t.showReferences,this.defaultValue.showReferences),showFolders:Lt(t.showFolders,this.defaultValue.showFolders),showTypeParameters:Lt(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:Lt(t.showSnippets,this.defaultValue.showSnippets),showUsers:Lt(t.showUsers,this.defaultValue.showUsers),showIssues:Lt(t.showIssues,this.defaultValue.showIssues)}}}class W3e extends er{constructor(){super(113,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:w("selectLeadingAndTrailingWhitespace","Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:w("selectSubwords","Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected."),default:!0,type:"boolean"}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{selectLeadingAndTrailingWhitespace:Lt(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:Lt(e.selectSubwords,this.defaultValue.selectSubwords)}}}class $3e extends er{constructor(){super(137,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[w("wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),w("wrappingIndent.same","Wrapped lines get the same indentation as the parent."),w("wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),w("wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],description:w("wrappingIndent","Controls the indentation of wrapped lines."),default:"same"}})}validate(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}return 1}compute(e,t,n){return t.get(2)===2?0:n}}class H3e extends Ek{constructor(){super(145)}compute(e,t,n){const r=t.get(144);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:r.isWordWrapMinified,isViewportWrapping:r.isViewportWrapping,wrappingColumn:r.wrappingColumn}}}class V3e extends er{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(36,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:w("dropIntoEditor.enabled","Controls whether you can drag and drop a file into a text editor by holding down the `Shift` key (instead of opening the file in an editor).")},"editor.dropIntoEditor.showDropSelector":{type:"string",markdownDescription:w("dropIntoEditor.showDropSelector","Controls if a widget is shown when dropping files into the editor. This widget lets you control how the file is dropped."),enum:["afterDrop","never"],enumDescriptions:[w("dropIntoEditor.showDropSelector.afterDrop","Show the drop selector widget after a file is dropped into the editor."),w("dropIntoEditor.showDropSelector.never","Never show the drop selector widget. Instead the default drop provider is always used.")],default:"afterDrop"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Lt(t.enabled,this.defaultValue.enabled),showDropSelector:_r(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}class z3e extends er{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(85,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:w("pasteAs.enabled","Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:w("pasteAs.showPasteSelector","Controls if a widget is shown when pasting content in to the editor. This widget lets you control how the file is pasted."),enum:["afterPaste","never"],enumDescriptions:[w("pasteAs.showPasteSelector.afterPaste","Show the paste selector widget after content is pasted into the editor."),w("pasteAs.showPasteSelector.never","Never show the paste selector widget. Instead the default pasting behavior is always used.")],default:"afterPaste"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Lt(t.enabled,this.defaultValue.enabled),showPasteSelector:_r(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}const U3e="Consolas, 'Courier New', monospace",j3e="Menlo, Monaco, 'Courier New', monospace",K3e="'Droid Sans Mono', 'monospace', monospace",Qa={fontFamily:Ln?j3e:Da?K3e:U3e,fontWeight:"normal",fontSize:Ln?12:14,lineHeight:0,letterSpacing:0},J1=[];function je(i){return J1[i.id]=i,i}const yh={acceptSuggestionOnCommitCharacter:je(new Bn(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:w("acceptSuggestionOnCommitCharacter","Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.")})),acceptSuggestionOnEnter:je(new dr(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",w("acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:w("acceptSuggestionOnEnter","Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:je(new s3e),accessibilityPageSize:je(new _i(3,"accessibilityPageSize",10,1,1073741824,{description:w("accessibilityPageSize","Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default."),tags:["accessibility"]})),ariaLabel:je(new ha(4,"ariaLabel",w("editorViewAccessibleLabel","Editor content"))),ariaRequired:je(new Bn(5,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:je(new Bn(8,"screenReaderAnnounceInlineSuggestion",!0,{description:w("screenReaderAnnounceInlineSuggestion","Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:je(new dr(6,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",w("editor.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),w("editor.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],description:w("autoClosingBrackets","Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:je(new dr(7,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",w("editor.autoClosingComments.languageDefined","Use language configurations to determine when to autoclose comments."),w("editor.autoClosingComments.beforeWhitespace","Autoclose comments only when the cursor is to the left of whitespace."),""],description:w("autoClosingComments","Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:je(new dr(9,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",w("editor.autoClosingDelete.auto","Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:w("autoClosingDelete","Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:je(new dr(10,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",w("editor.autoClosingOvertype.auto","Type over closing quotes or brackets only if they were automatically inserted."),""],description:w("autoClosingOvertype","Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:je(new dr(11,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",w("editor.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),w("editor.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],description:w("autoClosingQuotes","Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:je(new QN(12,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],o3e,{enumDescriptions:[w("editor.autoIndent.none","The editor will not insert indentation automatically."),w("editor.autoIndent.keep","The editor will keep the current line's indentation."),w("editor.autoIndent.brackets","The editor will keep the current line's indentation and honor language defined brackets."),w("editor.autoIndent.advanced","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),w("editor.autoIndent.full","The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.")],description:w("autoIndent","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:je(new Bn(13,"automaticLayout",!1)),autoSurround:je(new dr(14,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[w("editor.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),w("editor.autoSurround.quotes","Surround with quotes but not brackets."),w("editor.autoSurround.brackets","Surround with brackets but not quotes."),""],description:w("autoSurround","Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:je(new O3e),bracketPairGuides:je(new F3e),stickyTabStops:je(new Bn(116,"stickyTabStops",!1,{description:w("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:je(new Bn(17,"codeLens",!0,{description:w("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:je(new ha(18,"codeLensFontFamily","",{description:w("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:je(new _i(19,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:w("codeLensFontSize","Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:je(new Bn(20,"colorDecorators",!0,{description:w("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:je(new dr(147,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[w("editor.colorDecoratorActivatedOn.clickAndHover","Make the color picker appear both on click and hover of the color decorator"),w("editor.colorDecoratorActivatedOn.hover","Make the color picker appear on hover of the color decorator"),w("editor.colorDecoratorActivatedOn.click","Make the color picker appear on click of the color decorator")],description:w("colorDecoratorActivatedOn","Controls the condition to make a color picker appear from a color decorator")})),colorDecoratorsLimit:je(new _i(21,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:w("colorDecoratorsLimit","Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:je(new Bn(22,"columnSelection",!1,{description:w("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:je(new a3e),contextmenu:je(new Bn(24,"contextmenu",!0)),copyWithSyntaxHighlighting:je(new Bn(25,"copyWithSyntaxHighlighting",!0,{description:w("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:je(new QN(26,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],l3e,{description:w("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:je(new dr(27,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[w("cursorSmoothCaretAnimation.off","Smooth caret animation is disabled."),w("cursorSmoothCaretAnimation.explicit","Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),w("cursorSmoothCaretAnimation.on","Smooth caret animation is always enabled.")],description:w("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:je(new QN(28,"cursorStyle",Qo.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],c3e,{description:w("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:je(new _i(29,"cursorSurroundingLines",0,0,1073741824,{description:w("cursorSurroundingLines","Controls the minimal number of visible leading lines (minimum 0) and trailing lines (minimum 1) surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),cursorSurroundingLinesStyle:je(new dr(30,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[w("cursorSurroundingLinesStyle.default","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),w("cursorSurroundingLinesStyle.all","`cursorSurroundingLines` is enforced always.")],markdownDescription:w("cursorSurroundingLinesStyle","Controls when `#cursorSurroundingLines#` should be enforced.")})),cursorWidth:je(new _i(31,"cursorWidth",0,0,1073741824,{markdownDescription:w("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:je(new Bn(32,"disableLayerHinting",!1)),disableMonospaceOptimizations:je(new Bn(33,"disableMonospaceOptimizations",!1)),domReadOnly:je(new Bn(34,"domReadOnly",!1)),dragAndDrop:je(new Bn(35,"dragAndDrop",!0,{description:w("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:je(new d3e),dropIntoEditor:je(new V3e),stickyScroll:je(new b3e),experimentalWhitespaceRendering:je(new dr(38,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[w("experimentalWhitespaceRendering.svg","Use a new rendering method with svgs."),w("experimentalWhitespaceRendering.font","Use a new rendering method with font characters."),w("experimentalWhitespaceRendering.off","Use the stable rendering method.")],description:w("experimentalWhitespaceRendering","Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:je(new ha(39,"extraEditorClassName","")),fastScrollSensitivity:je(new zu(40,"fastScrollSensitivity",5,i=>i<=0?5:i,{markdownDescription:w("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:je(new h3e),fixedOverflowWidgets:je(new Bn(42,"fixedOverflowWidgets",!1)),folding:je(new Bn(43,"folding",!0,{description:w("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:je(new dr(44,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[w("foldingStrategy.auto","Use a language-specific folding strategy if available, else the indentation-based one."),w("foldingStrategy.indentation","Use the indentation-based folding strategy.")],description:w("foldingStrategy","Controls the strategy for computing folding ranges.")})),foldingHighlight:je(new Bn(45,"foldingHighlight",!0,{description:w("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:je(new Bn(46,"foldingImportsByDefault",!1,{description:w("foldingImportsByDefault","Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:je(new _i(47,"foldingMaximumRegions",5e3,10,65e3,{description:w("foldingMaximumRegions","The maximum number of foldable regions. Increasing this value may result in the editor becoming less responsive when the current source has a large number of foldable regions.")})),unfoldOnClickAfterEndOfLine:je(new Bn(48,"unfoldOnClickAfterEndOfLine",!1,{description:w("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:je(new ha(49,"fontFamily",Qa.fontFamily,{description:w("fontFamily","Controls the font family.")})),fontInfo:je(new f3e),fontLigatures2:je(new ic),fontSize:je(new g3e),fontWeight:je(new uf),fontVariations:je(new Ud),formatOnPaste:je(new Bn(55,"formatOnPaste",!1,{description:w("formatOnPaste","Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.")})),formatOnType:je(new Bn(56,"formatOnType",!1,{description:w("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:je(new Bn(57,"glyphMargin",!0,{description:w("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:je(new p3e),hideCursorInOverviewRuler:je(new Bn(59,"hideCursorInOverviewRuler",!1,{description:w("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),hover:je(new m3e),inDiffEditor:je(new Bn(61,"inDiffEditor",!1)),letterSpacing:je(new zu(64,"letterSpacing",Qa.letterSpacing,i=>zu.clamp(i,-5,20),{description:w("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:je(new _3e),lineDecorationsWidth:je(new y3e),lineHeight:je(new w3e),lineNumbers:je(new k3e),lineNumbersMinChars:je(new _i(69,"lineNumbersMinChars",5,1,300)),linkedEditing:je(new Bn(70,"linkedEditing",!1,{description:w("linkedEditing","Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:je(new Bn(71,"links",!0,{description:w("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:je(new dr(72,"matchBrackets","always",["always","near","never"],{description:w("matchBrackets","Highlight matching brackets.")})),minimap:je(new S3e),mouseStyle:je(new dr(74,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:je(new zu(75,"mouseWheelScrollSensitivity",1,i=>i===0?1:i,{markdownDescription:w("mouseWheelScrollSensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:je(new Bn(76,"mouseWheelZoom",!1,{markdownDescription:Ln?w("mouseWheelZoom.mac","Zoom the font of the editor when using mouse wheel and holding `Cmd`."):w("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:je(new Bn(77,"multiCursorMergeOverlapping",!0,{description:w("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:je(new QN(78,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],x3e,{markdownEnumDescriptions:[w("multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),w("multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:w({key:"multiCursorModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the [multicursor modifier](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")})),multiCursorPaste:je(new dr(79,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[w("multiCursorPaste.spread","Each cursor pastes a single line of the text."),w("multiCursorPaste.full","Each cursor pastes the full text.")],markdownDescription:w("multiCursorPaste","Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:je(new _i(80,"multiCursorLimit",1e4,1,1e5,{markdownDescription:w("multiCursorLimit","Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:je(new dr(81,"occurrencesHighlight","singleFile",["off","singleFile","multiFile"],{markdownEnumDescriptions:[w("occurrencesHighlight.off","Does not highlight occurrences."),w("occurrencesHighlight.singleFile","Highlights occurrences only in the current file."),w("occurrencesHighlight.multiFile","Experimental: Highlights occurrences across all valid open files.")],markdownDescription:w("occurrencesHighlight","Controls whether occurrences should be highlighted across open files.")})),overviewRulerBorder:je(new Bn(82,"overviewRulerBorder",!0,{description:w("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:je(new _i(83,"overviewRulerLanes",3,0,3)),padding:je(new L3e),pasteAs:je(new z3e),parameterHints:je(new E3e),peekWidgetDefaultFocus:je(new dr(87,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[w("peekWidgetDefaultFocus.tree","Focus the tree when opening peek"),w("peekWidgetDefaultFocus.editor","Focus the editor when opening peek")],description:w("peekWidgetDefaultFocus","Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:je(new Bn(88,"definitionLinkOpensInPeek",!1,{description:w("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:je(new I3e),quickSuggestionsDelay:je(new _i(90,"quickSuggestionsDelay",10,0,1073741824,{description:w("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:je(new Bn(91,"readOnly",!1)),readOnlyMessage:je(new N3e),renameOnType:je(new Bn(93,"renameOnType",!1,{description:w("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:w("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:je(new Bn(94,"renderControlCharacters",!0,{description:w("renderControlCharacters","Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:je(new dr(95,"renderFinalNewline",Da?"dimmed":"on",["off","on","dimmed"],{description:w("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:je(new dr(96,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",w("renderLineHighlight.all","Highlights both the gutter and the current line.")],description:w("renderLineHighlight","Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:je(new Bn(97,"renderLineHighlightOnlyWhenFocus",!1,{description:w("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:je(new dr(98,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:je(new dr(99,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",w("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),w("renderWhitespace.selection","Render whitespace characters only on selected text."),w("renderWhitespace.trailing","Render only trailing whitespace characters."),""],description:w("renderWhitespace","Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:je(new _i(100,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:je(new Bn(101,"roundedSelection",!0,{description:w("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:je(new T3e),scrollbar:je(new R3e),scrollBeyondLastColumn:je(new _i(104,"scrollBeyondLastColumn",4,0,1073741824,{description:w("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:je(new Bn(105,"scrollBeyondLastLine",!0,{description:w("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:je(new Bn(106,"scrollPredominantAxis",!0,{description:w("scrollPredominantAxis","Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.")})),selectionClipboard:je(new Bn(107,"selectionClipboard",!0,{description:w("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:Da})),selectionHighlight:je(new Bn(108,"selectionHighlight",!0,{description:w("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:je(new Bn(109,"selectOnLineNumbers",!0)),showFoldingControls:je(new dr(110,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[w("showFoldingControls.always","Always show the folding controls."),w("showFoldingControls.never","Never show the folding controls and reduce the gutter size."),w("showFoldingControls.mouseover","Only show the folding controls when the mouse is over the gutter.")],description:w("showFoldingControls","Controls when the folding controls on the gutter are shown.")})),showUnused:je(new Bn(111,"showUnused",!0,{description:w("showUnused","Controls fading out of unused code.")})),showDeprecated:je(new Bn(139,"showDeprecated",!0,{description:w("showDeprecated","Controls strikethrough deprecated variables.")})),inlayHints:je(new C3e),snippetSuggestions:je(new dr(112,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[w("snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),w("snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),w("snippetSuggestions.inline","Show snippets suggestions with other suggestions."),w("snippetSuggestions.none","Do not show snippet suggestions.")],description:w("snippetSuggestions","Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:je(new W3e),smoothScrolling:je(new Bn(114,"smoothScrolling",!1,{description:w("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:je(new _i(117,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:je(new B3e),inlineSuggest:je(new A3e),inlineEdit:je(new P3e),inlineCompletionsAccessibilityVerbose:je(new Bn(148,"inlineCompletionsAccessibilityVerbose",!1,{description:w("inlineCompletionsAccessibilityVerbose","Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:je(new _i(119,"suggestFontSize",0,0,1e3,{markdownDescription:w("suggestFontSize","Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:je(new _i(120,"suggestLineHeight",0,0,1e3,{markdownDescription:w("suggestLineHeight","Line height for the suggest widget. When set to {0}, the value of {1} is used. The minimum value is 8.","`0`","`#editor.lineHeight#`")})),suggestOnTriggerCharacters:je(new Bn(121,"suggestOnTriggerCharacters",!0,{description:w("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:je(new dr(122,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[w("suggestSelection.first","Always select the first suggestion."),w("suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),w("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:w("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:je(new dr(123,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[w("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),w("tabCompletion.off","Disable tab completions."),w("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:w("tabCompletion","Enables tab completions.")})),tabIndex:je(new _i(124,"tabIndex",0,-1,1073741824)),unicodeHighlight:je(new M3e),unusualLineTerminators:je(new dr(126,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[w("unusualLineTerminators.auto","Unusual line terminators are automatically removed."),w("unusualLineTerminators.off","Unusual line terminators are ignored."),w("unusualLineTerminators.prompt","Unusual line terminators prompt to be removed.")],description:w("unusualLineTerminators","Remove unusual line terminators that might cause problems.")})),useShadowDOM:je(new Bn(127,"useShadowDOM",!0)),useTabStops:je(new Bn(128,"useTabStops",!0,{description:w("useTabStops","Inserting and deleting whitespace follows tab stops.")})),wordBreak:je(new dr(129,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[w("wordBreak.normal","Use the default line break rule."),w("wordBreak.keepAll","Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.")],description:w("wordBreak","Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSeparators:je(new ha(130,"wordSeparators",fpe,{description:w("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:je(new dr(131,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[w("wordWrap.off","Lines will never wrap."),w("wordWrap.on","Lines will wrap at the viewport width."),w({key:"wordWrap.wordWrapColumn",comment:["- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at `#editor.wordWrapColumn#`."),w({key:"wordWrap.bounded",comment:["- viewport means the edge of the visible window size.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:w({key:"wordWrap",comment:["- 'off', 'on', 'wordWrapColumn' and 'bounded' refer to values the setting can take and should not be localized.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:je(new ha(132,"wordWrapBreakAfterCharacters"," })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:je(new ha(133,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:je(new _i(134,"wordWrapColumn",80,1,1073741824,{markdownDescription:w({key:"wordWrapColumn",comment:["- `editor.wordWrap` refers to a different setting and should not be localized.","- 'wordWrapColumn' and 'bounded' refer to values the different setting can take and should not be localized."]},"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:je(new dr(135,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:je(new dr(136,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:je(new u3e),defaultColorDecorators:je(new Bn(146,"defaultColorDecorators",!1,{markdownDescription:w("defaultColorDecorators","Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:je(new D3e),tabFocusMode:je(new Bn(143,"tabFocusMode",!1,{markdownDescription:w("tabFocusMode","Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:je(new Ty),wrappingInfo:je(new H3e),wrappingIndent:je(new $3e),wrappingStrategy:je(new v3e)};class G3e{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?yw.isErrorNoTelemetry(e)?new yw(e.message+` `+e.stack):new Error(e.message+` -`+e.stack):e},0)}}emit(e){this.listeners.forEach(t=>{t(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const vpe=new G3e;function en(i){wh(i)||vpe.onUnexpectedError(i)}function Zr(i){wh(i)||vpe.onUnexpectedExternalError(i)}function Bne(i){if(i instanceof Error){const{name:e,message:t}=i,n=i.stacktrace||i.stack;return{$isError:!0,name:e,message:t,stack:n,noTelemetry:yw.isErrorNoTelemetry(i)}}return i}const AA="Canceled";function wh(i){return i instanceof L_?!0:i instanceof Error&&i.name===AA&&i.message===AA}class L_ extends Error{constructor(){super(AA),this.name=this.message}}function q3e(){const i=new Error(AA);return i.name=i.message,i}function eu(i){return i?new Error(`Illegal argument: ${i}`):new Error("Illegal argument")}function sq(i){return i?new Error(`Illegal state: ${i}`):new Error("Illegal state")}class X3e extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class yw extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof yw)return e;const t=new yw;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class qi extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,qi.prototype)}}function Vv(i,e){const t=this;let n=!1,r;return function(){if(n)return r;if(n=!0,e)try{r=i.apply(t,arguments)}finally{e()}else r=i.apply(t,arguments);return r}}function aq(i){return typeof i.dispose=="function"&&i.dispose.length===0}function si(i){if(En.is(i)){const e=[];for(const t of i)if(t)try{t.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(i)?[]:i}else if(i)return i.dispose(),i}function Zu(...i){return Rt(()=>si(i))}function Rt(i){return{dispose:Vv(()=>{i()})}}class Te{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{si(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?Te.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}deleteAndLeak(e){e&&this._toDispose.has(e)&&this._toDispose.delete(e)}}Te.DISABLE_DISPOSED_WARNING=!1;class fe{constructor(){this._store=new Te,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}fe.None=Object.freeze({dispose(){}});class Ho{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)===null||t===void 0||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)===null||e===void 0||e.dispose(),this._value=void 0}}class Y3e{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}}class Z3e{constructor(e){this.object=e}dispose(){}}class lq{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{si(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,n=!1){var r;this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),n||(r=this._store.get(e))===null||r===void 0||r.dispose(),this._store.set(e,t)}deleteAndDispose(e){var t;(t=this._store.get(e))===null||t===void 0||t.dispose(),this._store.delete(e)}[Symbol.iterator](){return this._store[Symbol.iterator]()}}const Q3e=globalThis.performance&&typeof globalThis.performance.now=="function";class Ms{static create(e){return new Ms(e)}constructor(e){this._now=Q3e&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}var Je;(function(i){i.None=()=>fe.None;function e(A,N){return d(A,()=>{},0,void 0,!0,void 0,N)}i.defer=e;function t(A){return(N,R=null,F)=>{let W=!1,H;return H=A(G=>{if(!W)return H?H.dispose():W=!0,N.call(R,G)},null,F),W&&H.dispose(),H}}i.once=t;function n(A,N,R){return c((F,W=null,H)=>A(G=>F.call(W,N(G)),null,H),R)}i.map=n;function r(A,N,R){return c((F,W=null,H)=>A(G=>{N(G),F.call(W,G)},null,H),R)}i.forEach=r;function o(A,N,R){return c((F,W=null,H)=>A(G=>N(G)&&F.call(W,G),null,H),R)}i.filter=o;function s(A){return A}i.signal=s;function a(...A){return(N,R=null,F)=>{const W=Zu(...A.map(H=>H(G=>N.call(R,G))));return u(W,F)}}i.any=a;function l(A,N,R,F){let W=R;return n(A,H=>(W=N(W,H),W),F)}i.reduce=l;function c(A,N){let R;const F={onWillAddFirstListener(){R=A(W.fire,W)},onDidRemoveLastListener(){R==null||R.dispose()}},W=new se(F);return N==null||N.add(W),W.event}function u(A,N){return N instanceof Array?N.push(A):N&&N.add(A),A}function d(A,N,R=100,F=!1,W=!1,H,G){let U,K,re,Y=0,J;const Q={leakWarningThreshold:H,onWillAddFirstListener(){U=A(de=>{Y++,K=N(K,de),F&&!re&&(ue.fire(K),K=void 0),J=()=>{const _e=K;K=void 0,re=void 0,(!F||Y>1)&&ue.fire(_e),Y=0},typeof R=="number"?(clearTimeout(re),re=setTimeout(J,R)):re===void 0&&(re=0,queueMicrotask(J))})},onWillRemoveListener(){W&&Y>0&&(J==null||J())},onDidRemoveLastListener(){J=void 0,U.dispose()}},ue=new se(Q);return G==null||G.add(ue),ue.event}i.debounce=d;function h(A,N=0,R){return i.debounce(A,(F,W)=>F?(F.push(W),F):[W],N,void 0,!0,void 0,R)}i.accumulate=h;function f(A,N=(F,W)=>F===W,R){let F=!0,W;return o(A,H=>{const G=F||!N(H,W);return F=!1,W=H,G},R)}i.latch=f;function g(A,N,R){return[i.filter(A,N,R),i.filter(A,F=>!N(F),R)]}i.split=g;function p(A,N=!1,R=[],F){let W=R.slice(),H=A(K=>{W?W.push(K):U.fire(K)});F&&F.add(H);const G=()=>{W==null||W.forEach(K=>U.fire(K)),W=null},U=new se({onWillAddFirstListener(){H||(H=A(K=>U.fire(K)),F&&F.add(H))},onDidAddFirstListener(){W&&(N?setTimeout(G):G())},onDidRemoveLastListener(){H&&H.dispose(),H=null}});return F&&F.add(U),U.event}i.buffer=p;function v(A,N){return(F,W,H)=>{const G=N(new _);return A(function(U){const K=G.evaluate(U);K!==m&&F.call(W,K)},void 0,H)}}i.chain=v;const m=Symbol("HaltChainable");class _{constructor(){this.steps=[]}map(N){return this.steps.push(N),this}forEach(N){return this.steps.push(R=>(N(R),R)),this}filter(N){return this.steps.push(R=>N(R)?R:m),this}reduce(N,R){let F=R;return this.steps.push(W=>(F=N(F,W),F)),this}latch(N=(R,F)=>R===F){let R=!0,F;return this.steps.push(W=>{const H=R||!N(W,F);return R=!1,F=W,H?W:m}),this}evaluate(N){for(const R of this.steps)if(N=R(N),N===m)break;return N}}function y(A,N,R=F=>F){const F=(...U)=>G.fire(R(...U)),W=()=>A.on(N,F),H=()=>A.removeListener(N,F),G=new se({onWillAddFirstListener:W,onDidRemoveLastListener:H});return G.event}i.fromNodeEventEmitter=y;function S(A,N,R=F=>F){const F=(...U)=>G.fire(R(...U)),W=()=>A.addEventListener(N,F),H=()=>A.removeEventListener(N,F),G=new se({onWillAddFirstListener:W,onDidRemoveLastListener:H});return G.event}i.fromDOMEventEmitter=S;function L(A){return new Promise(N=>t(A)(N))}i.toPromise=L;function E(A){const N=new se;return A.then(R=>{N.fire(R)},()=>{N.fire(void 0)}).finally(()=>{N.dispose()}),N.event}i.fromPromise=E;function D(A,N,R){return N(R),A(F=>N(F))}i.runAndSubscribe=D;class k{constructor(N,R){this._observable=N,this._counter=0,this._hasChanged=!1;const F={onWillAddFirstListener:()=>{N.addObserver(this)},onDidRemoveLastListener:()=>{N.removeObserver(this)}};this.emitter=new se(F),R&&R.add(this.emitter)}beginUpdate(N){this._counter++}handlePossibleChange(N){}handleChange(N,R){this._hasChanged=!0}endUpdate(N){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function T(A,N){return new k(A,N).emitter.event}i.fromObservable=T;function M(A){return(N,R,F)=>{let W=0,H=!1;const G={beginUpdate(){W++},endUpdate(){W--,W===0&&(A.reportChanges(),H&&(H=!1,N.call(R)))},handlePossibleChange(){},handleChange(){H=!0}};A.addObserver(G),A.reportChanges();const U={dispose(){A.removeObserver(G)}};return F instanceof Te?F.add(U):Array.isArray(F)&&F.push(U),U}}i.fromObservableLight=M})(Je||(Je={}));class ww{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${ww._idPool++}`,ww.all.add(this)}start(e){this._stopWatch=new Ms,this.listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}}ww.all=new Set;ww._idPool=0;let J3e=-1;class e5e{constructor(e,t=Math.random().toString(18).slice(2,5)){this.threshold=e,this.name=t,this._warnCountdown=0}dispose(){var e;(e=this._stacks)===null||e===void 0||e.clear()}check(e,t){const n=this.threshold;if(n<=0||t{const o=this._stacks.get(e.value)||0;this._stacks.set(e.value,o-1)}}}class cq{static create(){var e;return new cq((e=new Error().stack)!==null&&e!==void 0?e:"")}constructor(e){this.value=e}print(){console.warn(this.value.split(` +`+e.stack):e},0)}}emit(e){this.listeners.forEach(t=>{t(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const vpe=new G3e;function en(i){wh(i)||vpe.onUnexpectedError(i)}function Zr(i){wh(i)||vpe.onUnexpectedExternalError(i)}function Bne(i){if(i instanceof Error){const{name:e,message:t}=i,n=i.stacktrace||i.stack;return{$isError:!0,name:e,message:t,stack:n,noTelemetry:yw.isErrorNoTelemetry(i)}}return i}const AA="Canceled";function wh(i){return i instanceof x_?!0:i instanceof Error&&i.name===AA&&i.message===AA}class x_ extends Error{constructor(){super(AA),this.name=this.message}}function q3e(){const i=new Error(AA);return i.name=i.message,i}function eu(i){return i?new Error(`Illegal argument: ${i}`):new Error("Illegal argument")}function sq(i){return i?new Error(`Illegal state: ${i}`):new Error("Illegal state")}class X3e extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class yw extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof yw)return e;const t=new yw;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class qi extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,qi.prototype)}}function Hv(i,e){const t=this;let n=!1,r;return function(){if(n)return r;if(n=!0,e)try{r=i.apply(t,arguments)}finally{e()}else r=i.apply(t,arguments);return r}}function aq(i){return typeof i.dispose=="function"&&i.dispose.length===0}function si(i){if(En.is(i)){const e=[];for(const t of i)if(t)try{t.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(i)?[]:i}else if(i)return i.dispose(),i}function Zu(...i){return Rt(()=>si(i))}function Rt(i){return{dispose:Hv(()=>{i()})}}class Te{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{si(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?Te.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}deleteAndLeak(e){e&&this._toDispose.has(e)&&this._toDispose.delete(e)}}Te.DISABLE_DISPOSED_WARNING=!1;class fe{constructor(){this._store=new Te,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}fe.None=Object.freeze({dispose(){}});class Ho{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)===null||t===void 0||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)===null||e===void 0||e.dispose(),this._value=void 0}}class Y3e{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}}class Z3e{constructor(e){this.object=e}dispose(){}}class lq{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{si(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,n=!1){var r;this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),n||(r=this._store.get(e))===null||r===void 0||r.dispose(),this._store.set(e,t)}deleteAndDispose(e){var t;(t=this._store.get(e))===null||t===void 0||t.dispose(),this._store.delete(e)}[Symbol.iterator](){return this._store[Symbol.iterator]()}}const Q3e=globalThis.performance&&typeof globalThis.performance.now=="function";class Ms{static create(e){return new Ms(e)}constructor(e){this._now=Q3e&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}var Je;(function(i){i.None=()=>fe.None;function e(A,N){return d(A,()=>{},0,void 0,!0,void 0,N)}i.defer=e;function t(A){return(N,R=null,F)=>{let W=!1,H;return H=A(G=>{if(!W)return H?H.dispose():W=!0,N.call(R,G)},null,F),W&&H.dispose(),H}}i.once=t;function n(A,N,R){return c((F,W=null,H)=>A(G=>F.call(W,N(G)),null,H),R)}i.map=n;function r(A,N,R){return c((F,W=null,H)=>A(G=>{N(G),F.call(W,G)},null,H),R)}i.forEach=r;function o(A,N,R){return c((F,W=null,H)=>A(G=>N(G)&&F.call(W,G),null,H),R)}i.filter=o;function s(A){return A}i.signal=s;function a(...A){return(N,R=null,F)=>{const W=Zu(...A.map(H=>H(G=>N.call(R,G))));return u(W,F)}}i.any=a;function l(A,N,R,F){let W=R;return n(A,H=>(W=N(W,H),W),F)}i.reduce=l;function c(A,N){let R;const F={onWillAddFirstListener(){R=A(W.fire,W)},onDidRemoveLastListener(){R==null||R.dispose()}},W=new se(F);return N==null||N.add(W),W.event}function u(A,N){return N instanceof Array?N.push(A):N&&N.add(A),A}function d(A,N,R=100,F=!1,W=!1,H,G){let U,K,re,Y=0,J;const Q={leakWarningThreshold:H,onWillAddFirstListener(){U=A(de=>{Y++,K=N(K,de),F&&!re&&(ue.fire(K),K=void 0),J=()=>{const _e=K;K=void 0,re=void 0,(!F||Y>1)&&ue.fire(_e),Y=0},typeof R=="number"?(clearTimeout(re),re=setTimeout(J,R)):re===void 0&&(re=0,queueMicrotask(J))})},onWillRemoveListener(){W&&Y>0&&(J==null||J())},onDidRemoveLastListener(){J=void 0,U.dispose()}},ue=new se(Q);return G==null||G.add(ue),ue.event}i.debounce=d;function h(A,N=0,R){return i.debounce(A,(F,W)=>F?(F.push(W),F):[W],N,void 0,!0,void 0,R)}i.accumulate=h;function f(A,N=(F,W)=>F===W,R){let F=!0,W;return o(A,H=>{const G=F||!N(H,W);return F=!1,W=H,G},R)}i.latch=f;function g(A,N,R){return[i.filter(A,N,R),i.filter(A,F=>!N(F),R)]}i.split=g;function p(A,N=!1,R=[],F){let W=R.slice(),H=A(K=>{W?W.push(K):U.fire(K)});F&&F.add(H);const G=()=>{W==null||W.forEach(K=>U.fire(K)),W=null},U=new se({onWillAddFirstListener(){H||(H=A(K=>U.fire(K)),F&&F.add(H))},onDidAddFirstListener(){W&&(N?setTimeout(G):G())},onDidRemoveLastListener(){H&&H.dispose(),H=null}});return F&&F.add(U),U.event}i.buffer=p;function v(A,N){return(F,W,H)=>{const G=N(new _);return A(function(U){const K=G.evaluate(U);K!==m&&F.call(W,K)},void 0,H)}}i.chain=v;const m=Symbol("HaltChainable");class _{constructor(){this.steps=[]}map(N){return this.steps.push(N),this}forEach(N){return this.steps.push(R=>(N(R),R)),this}filter(N){return this.steps.push(R=>N(R)?R:m),this}reduce(N,R){let F=R;return this.steps.push(W=>(F=N(F,W),F)),this}latch(N=(R,F)=>R===F){let R=!0,F;return this.steps.push(W=>{const H=R||!N(W,F);return R=!1,F=W,H?W:m}),this}evaluate(N){for(const R of this.steps)if(N=R(N),N===m)break;return N}}function y(A,N,R=F=>F){const F=(...U)=>G.fire(R(...U)),W=()=>A.on(N,F),H=()=>A.removeListener(N,F),G=new se({onWillAddFirstListener:W,onDidRemoveLastListener:H});return G.event}i.fromNodeEventEmitter=y;function S(A,N,R=F=>F){const F=(...U)=>G.fire(R(...U)),W=()=>A.addEventListener(N,F),H=()=>A.removeEventListener(N,F),G=new se({onWillAddFirstListener:W,onDidRemoveLastListener:H});return G.event}i.fromDOMEventEmitter=S;function L(A){return new Promise(N=>t(A)(N))}i.toPromise=L;function E(A){const N=new se;return A.then(R=>{N.fire(R)},()=>{N.fire(void 0)}).finally(()=>{N.dispose()}),N.event}i.fromPromise=E;function D(A,N,R){return N(R),A(F=>N(F))}i.runAndSubscribe=D;class k{constructor(N,R){this._observable=N,this._counter=0,this._hasChanged=!1;const F={onWillAddFirstListener:()=>{N.addObserver(this)},onDidRemoveLastListener:()=>{N.removeObserver(this)}};this.emitter=new se(F),R&&R.add(this.emitter)}beginUpdate(N){this._counter++}handlePossibleChange(N){}handleChange(N,R){this._hasChanged=!0}endUpdate(N){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function T(A,N){return new k(A,N).emitter.event}i.fromObservable=T;function M(A){return(N,R,F)=>{let W=0,H=!1;const G={beginUpdate(){W++},endUpdate(){W--,W===0&&(A.reportChanges(),H&&(H=!1,N.call(R)))},handlePossibleChange(){},handleChange(){H=!0}};A.addObserver(G),A.reportChanges();const U={dispose(){A.removeObserver(G)}};return F instanceof Te?F.add(U):Array.isArray(F)&&F.push(U),U}}i.fromObservableLight=M})(Je||(Je={}));class ww{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${ww._idPool++}`,ww.all.add(this)}start(e){this._stopWatch=new Ms,this.listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}}ww.all=new Set;ww._idPool=0;let J3e=-1;class e5e{constructor(e,t=Math.random().toString(18).slice(2,5)){this.threshold=e,this.name=t,this._warnCountdown=0}dispose(){var e;(e=this._stacks)===null||e===void 0||e.clear()}check(e,t){const n=this.threshold;if(n<=0||t{const o=this._stacks.get(e.value)||0;this._stacks.set(e.value,o-1)}}}class cq{static create(){var e;return new cq((e=new Error().stack)!==null&&e!==void 0?e:"")}constructor(e){this.value=e}print(){console.warn(this.value.split(` `).slice(2).join(` -`))}}class Y8{constructor(e){this.value=e}}const t5e=2;let se=class{constructor(e){var t,n,r,o,s;this._size=0,this._options=e,this._leakageMon=!((t=this._options)===null||t===void 0)&&t.leakWarningThreshold?new e5e((r=(n=this._options)===null||n===void 0?void 0:n.leakWarningThreshold)!==null&&r!==void 0?r:J3e):void 0,this._perfMon=!((o=this._options)===null||o===void 0)&&o._profName?new ww(this._options._profName):void 0,this._deliveryQueue=(s=this._options)===null||s===void 0?void 0:s.deliveryQueue}dispose(){var e,t,n,r;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)===null||e===void 0?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(n=(t=this._options)===null||t===void 0?void 0:t.onDidRemoveLastListener)===null||n===void 0||n.call(t),(r=this._leakageMon)===null||r===void 0||r.dispose())}get event(){var e;return(e=this._event)!==null&&e!==void 0||(this._event=(t,n,r)=>{var o,s,a,l,c;if(this._leakageMon&&this._size>this._leakageMon.threshold*3)return console.warn(`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far`),fe.None;if(this._disposed)return fe.None;n&&(t=t.bind(n));const u=new Y8(t);let d;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(u.stack=cq.create(),d=this._leakageMon.check(u.stack,this._size+1)),this._listeners?this._listeners instanceof Y8?((c=this._deliveryQueue)!==null&&c!==void 0||(this._deliveryQueue=new _pe),this._listeners=[this._listeners,u]):this._listeners.push(u):((s=(o=this._options)===null||o===void 0?void 0:o.onWillAddFirstListener)===null||s===void 0||s.call(o,this),this._listeners=u,(l=(a=this._options)===null||a===void 0?void 0:a.onDidAddFirstListener)===null||l===void 0||l.call(a,this)),this._size++;const h=Rt(()=>{d==null||d(),this._removeListener(u)});return r instanceof Te?r.add(h):Array.isArray(r)&&r.push(h),h}),this._event}_removeListener(e){var t,n,r,o;if((n=(t=this._options)===null||t===void 0?void 0:t.onWillRemoveListener)===null||n===void 0||n.call(t,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(o=(r=this._options)===null||r===void 0?void 0:r.onDidRemoveLastListener)===null||o===void 0||o.call(r,this),this._size=0;return}const s=this._listeners,a=s.indexOf(e);if(a===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,s[a]=void 0;const l=this._deliveryQueue.current===this;if(this._size*t5e<=s.length){let c=0;for(let u=0;u0}};const n5e=()=>new _pe;class _pe{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class Lb extends se{constructor(e){super(e),this._isPaused=0,this._eventQueue=new _a,this._mergeFn=e==null?void 0:e.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}}class bpe extends Lb{constructor(e){var t;super(e),this._delay=(t=e.delay)!==null&&t!==void 0?t:100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}}class i5e extends se{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e==null?void 0:e.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(t=>super.fire(t)),this._queuedEvents=[]}))}}class r5e{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new se({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(e){const t={event:e,listener:null};return this.events.push(t),this.hasListeners&&this.hook(t),Rt(Vv(()=>{this.hasListeners&&this.unhook(t);const r=this.events.indexOf(t);this.events.splice(r,1)}))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(t=>this.emitter.fire(t))}unhook(e){var t;(t=e.listener)===null||t===void 0||t.dispose(),e.listener=null}dispose(){var e;this.emitter.dispose();for(const t of this.events)(e=t.listener)===null||e===void 0||e.dispose();this.events=[]}}class uq{constructor(){this.buffers=[]}wrapEvent(e){return(t,n,r)=>e(o=>{const s=this.buffers[this.buffers.length-1];s?s.push(()=>t.call(n,o)):t.call(n,o)},void 0,r)}bufferEvents(e){const t=[];this.buffers.push(t);const n=e();return this.buffers.pop(),t.forEach(r=>r()),n}}class Wne{constructor(){this.listening=!1,this.inputEvent=Je.None,this.inputEventListener=fe.None,this.emitter=new se({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}const Cpe=Object.freeze(function(i,e){const t=setTimeout(i.bind(e),0);return{dispose(){clearTimeout(t)}}});var Cn;(function(i){function e(t){return t===i.None||t===i.Cancelled||t instanceof aM?!0:!t||typeof t!="object"?!1:typeof t.isCancellationRequested=="boolean"&&typeof t.onCancellationRequested=="function"}i.isCancellationToken=e,i.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Je.None}),i.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Cpe})})(Cn||(Cn={}));class aM{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Cpe:(this._emitter||(this._emitter=new se),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}let wr=class{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new aM),this._token}cancel(){this._token?this._token instanceof aM&&this._token.cancel():this._token=Cn.Cancelled}dispose(e=!1){var t;e&&this.cancel(),(t=this._parentListener)===null||t===void 0||t.dispose(),this._token?this._token instanceof aM&&this._token.dispose():this._token=Cn.None}};class dq{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}}const lM=new dq,r$=new dq,o$=new dq,ype=new Array(230),o5e=Object.create(null),s5e=Object.create(null),hq=[];for(let i=0;i<=193;i++)hq[i]=-1;(function(){const i="",e=[[1,0,"None",0,"unknown",0,"VK_UNKNOWN",i,i],[1,1,"Hyper",0,i,0,i,i,i],[1,2,"Super",0,i,0,i,i,i],[1,3,"Fn",0,i,0,i,i,i],[1,4,"FnLock",0,i,0,i,i,i],[1,5,"Suspend",0,i,0,i,i,i],[1,6,"Resume",0,i,0,i,i,i],[1,7,"Turbo",0,i,0,i,i,i],[1,8,"Sleep",0,i,0,"VK_SLEEP",i,i],[1,9,"WakeUp",0,i,0,i,i,i],[0,10,"KeyA",31,"A",65,"VK_A",i,i],[0,11,"KeyB",32,"B",66,"VK_B",i,i],[0,12,"KeyC",33,"C",67,"VK_C",i,i],[0,13,"KeyD",34,"D",68,"VK_D",i,i],[0,14,"KeyE",35,"E",69,"VK_E",i,i],[0,15,"KeyF",36,"F",70,"VK_F",i,i],[0,16,"KeyG",37,"G",71,"VK_G",i,i],[0,17,"KeyH",38,"H",72,"VK_H",i,i],[0,18,"KeyI",39,"I",73,"VK_I",i,i],[0,19,"KeyJ",40,"J",74,"VK_J",i,i],[0,20,"KeyK",41,"K",75,"VK_K",i,i],[0,21,"KeyL",42,"L",76,"VK_L",i,i],[0,22,"KeyM",43,"M",77,"VK_M",i,i],[0,23,"KeyN",44,"N",78,"VK_N",i,i],[0,24,"KeyO",45,"O",79,"VK_O",i,i],[0,25,"KeyP",46,"P",80,"VK_P",i,i],[0,26,"KeyQ",47,"Q",81,"VK_Q",i,i],[0,27,"KeyR",48,"R",82,"VK_R",i,i],[0,28,"KeyS",49,"S",83,"VK_S",i,i],[0,29,"KeyT",50,"T",84,"VK_T",i,i],[0,30,"KeyU",51,"U",85,"VK_U",i,i],[0,31,"KeyV",52,"V",86,"VK_V",i,i],[0,32,"KeyW",53,"W",87,"VK_W",i,i],[0,33,"KeyX",54,"X",88,"VK_X",i,i],[0,34,"KeyY",55,"Y",89,"VK_Y",i,i],[0,35,"KeyZ",56,"Z",90,"VK_Z",i,i],[0,36,"Digit1",22,"1",49,"VK_1",i,i],[0,37,"Digit2",23,"2",50,"VK_2",i,i],[0,38,"Digit3",24,"3",51,"VK_3",i,i],[0,39,"Digit4",25,"4",52,"VK_4",i,i],[0,40,"Digit5",26,"5",53,"VK_5",i,i],[0,41,"Digit6",27,"6",54,"VK_6",i,i],[0,42,"Digit7",28,"7",55,"VK_7",i,i],[0,43,"Digit8",29,"8",56,"VK_8",i,i],[0,44,"Digit9",30,"9",57,"VK_9",i,i],[0,45,"Digit0",21,"0",48,"VK_0",i,i],[1,46,"Enter",3,"Enter",13,"VK_RETURN",i,i],[1,47,"Escape",9,"Escape",27,"VK_ESCAPE",i,i],[1,48,"Backspace",1,"Backspace",8,"VK_BACK",i,i],[1,49,"Tab",2,"Tab",9,"VK_TAB",i,i],[1,50,"Space",10,"Space",32,"VK_SPACE",i,i],[0,51,"Minus",88,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[0,52,"Equal",86,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[0,53,"BracketLeft",92,"[",219,"VK_OEM_4","[","OEM_4"],[0,54,"BracketRight",94,"]",221,"VK_OEM_6","]","OEM_6"],[0,55,"Backslash",93,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,56,"IntlHash",0,i,0,i,i,i],[0,57,"Semicolon",85,";",186,"VK_OEM_1",";","OEM_1"],[0,58,"Quote",95,"'",222,"VK_OEM_7","'","OEM_7"],[0,59,"Backquote",91,"`",192,"VK_OEM_3","`","OEM_3"],[0,60,"Comma",87,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[0,61,"Period",89,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[0,62,"Slash",90,"/",191,"VK_OEM_2","/","OEM_2"],[1,63,"CapsLock",8,"CapsLock",20,"VK_CAPITAL",i,i],[1,64,"F1",59,"F1",112,"VK_F1",i,i],[1,65,"F2",60,"F2",113,"VK_F2",i,i],[1,66,"F3",61,"F3",114,"VK_F3",i,i],[1,67,"F4",62,"F4",115,"VK_F4",i,i],[1,68,"F5",63,"F5",116,"VK_F5",i,i],[1,69,"F6",64,"F6",117,"VK_F6",i,i],[1,70,"F7",65,"F7",118,"VK_F7",i,i],[1,71,"F8",66,"F8",119,"VK_F8",i,i],[1,72,"F9",67,"F9",120,"VK_F9",i,i],[1,73,"F10",68,"F10",121,"VK_F10",i,i],[1,74,"F11",69,"F11",122,"VK_F11",i,i],[1,75,"F12",70,"F12",123,"VK_F12",i,i],[1,76,"PrintScreen",0,i,0,i,i,i],[1,77,"ScrollLock",84,"ScrollLock",145,"VK_SCROLL",i,i],[1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE",i,i],[1,79,"Insert",19,"Insert",45,"VK_INSERT",i,i],[1,80,"Home",14,"Home",36,"VK_HOME",i,i],[1,81,"PageUp",11,"PageUp",33,"VK_PRIOR",i,i],[1,82,"Delete",20,"Delete",46,"VK_DELETE",i,i],[1,83,"End",13,"End",35,"VK_END",i,i],[1,84,"PageDown",12,"PageDown",34,"VK_NEXT",i,i],[1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",i],[1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",i],[1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",i],[1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",i],[1,89,"NumLock",83,"NumLock",144,"VK_NUMLOCK",i,i],[1,90,"NumpadDivide",113,"NumPad_Divide",111,"VK_DIVIDE",i,i],[1,91,"NumpadMultiply",108,"NumPad_Multiply",106,"VK_MULTIPLY",i,i],[1,92,"NumpadSubtract",111,"NumPad_Subtract",109,"VK_SUBTRACT",i,i],[1,93,"NumpadAdd",109,"NumPad_Add",107,"VK_ADD",i,i],[1,94,"NumpadEnter",3,i,0,i,i,i],[1,95,"Numpad1",99,"NumPad1",97,"VK_NUMPAD1",i,i],[1,96,"Numpad2",100,"NumPad2",98,"VK_NUMPAD2",i,i],[1,97,"Numpad3",101,"NumPad3",99,"VK_NUMPAD3",i,i],[1,98,"Numpad4",102,"NumPad4",100,"VK_NUMPAD4",i,i],[1,99,"Numpad5",103,"NumPad5",101,"VK_NUMPAD5",i,i],[1,100,"Numpad6",104,"NumPad6",102,"VK_NUMPAD6",i,i],[1,101,"Numpad7",105,"NumPad7",103,"VK_NUMPAD7",i,i],[1,102,"Numpad8",106,"NumPad8",104,"VK_NUMPAD8",i,i],[1,103,"Numpad9",107,"NumPad9",105,"VK_NUMPAD9",i,i],[1,104,"Numpad0",98,"NumPad0",96,"VK_NUMPAD0",i,i],[1,105,"NumpadDecimal",112,"NumPad_Decimal",110,"VK_DECIMAL",i,i],[0,106,"IntlBackslash",97,"OEM_102",226,"VK_OEM_102",i,i],[1,107,"ContextMenu",58,"ContextMenu",93,i,i,i],[1,108,"Power",0,i,0,i,i,i],[1,109,"NumpadEqual",0,i,0,i,i,i],[1,110,"F13",71,"F13",124,"VK_F13",i,i],[1,111,"F14",72,"F14",125,"VK_F14",i,i],[1,112,"F15",73,"F15",126,"VK_F15",i,i],[1,113,"F16",74,"F16",127,"VK_F16",i,i],[1,114,"F17",75,"F17",128,"VK_F17",i,i],[1,115,"F18",76,"F18",129,"VK_F18",i,i],[1,116,"F19",77,"F19",130,"VK_F19",i,i],[1,117,"F20",78,"F20",131,"VK_F20",i,i],[1,118,"F21",79,"F21",132,"VK_F21",i,i],[1,119,"F22",80,"F22",133,"VK_F22",i,i],[1,120,"F23",81,"F23",134,"VK_F23",i,i],[1,121,"F24",82,"F24",135,"VK_F24",i,i],[1,122,"Open",0,i,0,i,i,i],[1,123,"Help",0,i,0,i,i,i],[1,124,"Select",0,i,0,i,i,i],[1,125,"Again",0,i,0,i,i,i],[1,126,"Undo",0,i,0,i,i,i],[1,127,"Cut",0,i,0,i,i,i],[1,128,"Copy",0,i,0,i,i,i],[1,129,"Paste",0,i,0,i,i,i],[1,130,"Find",0,i,0,i,i,i],[1,131,"AudioVolumeMute",117,"AudioVolumeMute",173,"VK_VOLUME_MUTE",i,i],[1,132,"AudioVolumeUp",118,"AudioVolumeUp",175,"VK_VOLUME_UP",i,i],[1,133,"AudioVolumeDown",119,"AudioVolumeDown",174,"VK_VOLUME_DOWN",i,i],[1,134,"NumpadComma",110,"NumPad_Separator",108,"VK_SEPARATOR",i,i],[0,135,"IntlRo",115,"ABNT_C1",193,"VK_ABNT_C1",i,i],[1,136,"KanaMode",0,i,0,i,i,i],[0,137,"IntlYen",0,i,0,i,i,i],[1,138,"Convert",0,i,0,i,i,i],[1,139,"NonConvert",0,i,0,i,i,i],[1,140,"Lang1",0,i,0,i,i,i],[1,141,"Lang2",0,i,0,i,i,i],[1,142,"Lang3",0,i,0,i,i,i],[1,143,"Lang4",0,i,0,i,i,i],[1,144,"Lang5",0,i,0,i,i,i],[1,145,"Abort",0,i,0,i,i,i],[1,146,"Props",0,i,0,i,i,i],[1,147,"NumpadParenLeft",0,i,0,i,i,i],[1,148,"NumpadParenRight",0,i,0,i,i,i],[1,149,"NumpadBackspace",0,i,0,i,i,i],[1,150,"NumpadMemoryStore",0,i,0,i,i,i],[1,151,"NumpadMemoryRecall",0,i,0,i,i,i],[1,152,"NumpadMemoryClear",0,i,0,i,i,i],[1,153,"NumpadMemoryAdd",0,i,0,i,i,i],[1,154,"NumpadMemorySubtract",0,i,0,i,i,i],[1,155,"NumpadClear",131,"Clear",12,"VK_CLEAR",i,i],[1,156,"NumpadClearEntry",0,i,0,i,i,i],[1,0,i,5,"Ctrl",17,"VK_CONTROL",i,i],[1,0,i,4,"Shift",16,"VK_SHIFT",i,i],[1,0,i,6,"Alt",18,"VK_MENU",i,i],[1,0,i,57,"Meta",91,"VK_COMMAND",i,i],[1,157,"ControlLeft",5,i,0,"VK_LCONTROL",i,i],[1,158,"ShiftLeft",4,i,0,"VK_LSHIFT",i,i],[1,159,"AltLeft",6,i,0,"VK_LMENU",i,i],[1,160,"MetaLeft",57,i,0,"VK_LWIN",i,i],[1,161,"ControlRight",5,i,0,"VK_RCONTROL",i,i],[1,162,"ShiftRight",4,i,0,"VK_RSHIFT",i,i],[1,163,"AltRight",6,i,0,"VK_RMENU",i,i],[1,164,"MetaRight",57,i,0,"VK_RWIN",i,i],[1,165,"BrightnessUp",0,i,0,i,i,i],[1,166,"BrightnessDown",0,i,0,i,i,i],[1,167,"MediaPlay",0,i,0,i,i,i],[1,168,"MediaRecord",0,i,0,i,i,i],[1,169,"MediaFastForward",0,i,0,i,i,i],[1,170,"MediaRewind",0,i,0,i,i,i],[1,171,"MediaTrackNext",124,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK",i,i],[1,172,"MediaTrackPrevious",125,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK",i,i],[1,173,"MediaStop",126,"MediaStop",178,"VK_MEDIA_STOP",i,i],[1,174,"Eject",0,i,0,i,i,i],[1,175,"MediaPlayPause",127,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE",i,i],[1,176,"MediaSelect",128,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT",i,i],[1,177,"LaunchMail",129,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL",i,i],[1,178,"LaunchApp2",130,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2",i,i],[1,179,"LaunchApp1",0,i,0,"VK_MEDIA_LAUNCH_APP1",i,i],[1,180,"SelectTask",0,i,0,i,i,i],[1,181,"LaunchScreenSaver",0,i,0,i,i,i],[1,182,"BrowserSearch",120,"BrowserSearch",170,"VK_BROWSER_SEARCH",i,i],[1,183,"BrowserHome",121,"BrowserHome",172,"VK_BROWSER_HOME",i,i],[1,184,"BrowserBack",122,"BrowserBack",166,"VK_BROWSER_BACK",i,i],[1,185,"BrowserForward",123,"BrowserForward",167,"VK_BROWSER_FORWARD",i,i],[1,186,"BrowserStop",0,i,0,"VK_BROWSER_STOP",i,i],[1,187,"BrowserRefresh",0,i,0,"VK_BROWSER_REFRESH",i,i],[1,188,"BrowserFavorites",0,i,0,"VK_BROWSER_FAVORITES",i,i],[1,189,"ZoomToggle",0,i,0,i,i,i],[1,190,"MailReply",0,i,0,i,i,i],[1,191,"MailForward",0,i,0,i,i,i],[1,192,"MailSend",0,i,0,i,i,i],[1,0,i,114,"KeyInComposition",229,i,i,i],[1,0,i,116,"ABNT_C2",194,"VK_ABNT_C2",i,i],[1,0,i,96,"OEM_8",223,"VK_OEM_8",i,i],[1,0,i,0,i,0,"VK_KANA",i,i],[1,0,i,0,i,0,"VK_HANGUL",i,i],[1,0,i,0,i,0,"VK_JUNJA",i,i],[1,0,i,0,i,0,"VK_FINAL",i,i],[1,0,i,0,i,0,"VK_HANJA",i,i],[1,0,i,0,i,0,"VK_KANJI",i,i],[1,0,i,0,i,0,"VK_CONVERT",i,i],[1,0,i,0,i,0,"VK_NONCONVERT",i,i],[1,0,i,0,i,0,"VK_ACCEPT",i,i],[1,0,i,0,i,0,"VK_MODECHANGE",i,i],[1,0,i,0,i,0,"VK_SELECT",i,i],[1,0,i,0,i,0,"VK_PRINT",i,i],[1,0,i,0,i,0,"VK_EXECUTE",i,i],[1,0,i,0,i,0,"VK_SNAPSHOT",i,i],[1,0,i,0,i,0,"VK_HELP",i,i],[1,0,i,0,i,0,"VK_APPS",i,i],[1,0,i,0,i,0,"VK_PROCESSKEY",i,i],[1,0,i,0,i,0,"VK_PACKET",i,i],[1,0,i,0,i,0,"VK_DBE_SBCSCHAR",i,i],[1,0,i,0,i,0,"VK_DBE_DBCSCHAR",i,i],[1,0,i,0,i,0,"VK_ATTN",i,i],[1,0,i,0,i,0,"VK_CRSEL",i,i],[1,0,i,0,i,0,"VK_EXSEL",i,i],[1,0,i,0,i,0,"VK_EREOF",i,i],[1,0,i,0,i,0,"VK_PLAY",i,i],[1,0,i,0,i,0,"VK_ZOOM",i,i],[1,0,i,0,i,0,"VK_NONAME",i,i],[1,0,i,0,i,0,"VK_PA1",i,i],[1,0,i,0,i,0,"VK_OEM_CLEAR",i,i]],t=[],n=[];for(const r of e){const[o,s,a,l,c,u,d,h,f]=r;if(n[s]||(n[s]=!0,o5e[a]=s,s5e[a.toLowerCase()]=s,o&&(hq[s]=l)),!t[l]){if(t[l]=!0,!c)throw new Error(`String representation missing for key code ${l} around scan code ${a}`);lM.define(l,c),r$.define(l,h||c),o$.define(l,f||h||c)}u&&(ype[u]=l)}})();var Bg;(function(i){function e(a){return lM.keyCodeToStr(a)}i.toString=e;function t(a){return lM.strToKeyCode(a)}i.fromString=t;function n(a){return r$.keyCodeToStr(a)}i.toUserSettingsUS=n;function r(a){return o$.keyCodeToStr(a)}i.toUserSettingsGeneral=r;function o(a){return r$.strToKeyCode(a)||o$.strToKeyCode(a)}i.fromUserSettings=o;function s(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return lM.keyCodeToStr(a)}i.toElectronAccelerator=s})(Bg||(Bg={}));function co(i,e){const t=(e&65535)<<16>>>0;return(i|t)>>>0}let Ry;const Z8=globalThis.vscode;if(typeof Z8<"u"&&typeof Z8.process<"u"){const i=Z8.process;Ry={get platform(){return i.platform},get arch(){return i.arch},get env(){return i.env},cwd(){return i.cwd()}}}else typeof process<"u"?Ry={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:Ry={get platform(){return Rs?"win32":Ln?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};const PA=Ry.cwd,s$=Ry.env,a5e=Ry.platform,l5e=65,c5e=97,u5e=90,d5e=122,mv=46,zs=47,jl=92,rm=58,h5e=63;class wpe extends Error{constructor(e,t,n){let r;typeof t=="string"&&t.indexOf("not ")===0?(r="must not be",t=t.replace(/^not /,"")):r="must be";const o=e.indexOf(".")!==-1?"property":"argument";let s=`The "${e}" ${o} ${r} of type ${t}`;s+=`. Received type ${typeof n}`,super(s),this.code="ERR_INVALID_ARG_TYPE"}}function f5e(i,e){if(i===null||typeof i!="object")throw new wpe(e,"Object",i)}function Oo(i,e){if(typeof i!="string")throw new wpe(e,"string",i)}const E_=a5e==="win32";function li(i){return i===zs||i===jl}function a$(i){return i===zs}function om(i){return i>=l5e&&i<=u5e||i>=c5e&&i<=d5e}function OA(i,e,t,n){let r="",o=0,s=-1,a=0,l=0;for(let c=0;c<=i.length;++c){if(c2){const u=r.lastIndexOf(t);u===-1?(r="",o=0):(r=r.slice(0,u),o=r.length-1-r.lastIndexOf(t)),s=c,a=0;continue}else if(r.length!==0){r="",o=0,s=c,a=0;continue}}e&&(r+=r.length>0?`${t}..`:"..",o=2)}else r.length>0?r+=`${t}${i.slice(s+1,c)}`:r=i.slice(s+1,c),o=c-s-1;s=c,a=0}else l===mv&&a!==-1?++a:a=-1}return r}function Spe(i,e){f5e(e,"pathObject");const t=e.dir||e.root,n=e.base||`${e.name||""}${e.ext||""}`;return t?t===e.root?`${t}${n}`:`${t}${i}${n}`:n}const wl={resolve(...i){let e="",t="",n=!1;for(let r=i.length-1;r>=-1;r--){let o;if(r>=0){if(o=i[r],Oo(o,"path"),o.length===0)continue}else e.length===0?o=PA():(o=s$[`=${e}`]||PA(),(o===void 0||o.slice(0,2).toLowerCase()!==e.toLowerCase()&&o.charCodeAt(2)===jl)&&(o=`${e}\\`));const s=o.length;let a=0,l="",c=!1;const u=o.charCodeAt(0);if(s===1)li(u)&&(a=1,c=!0);else if(li(u))if(c=!0,li(o.charCodeAt(1))){let d=2,h=d;for(;d2&&li(o.charCodeAt(2))&&(c=!0,a=3));if(l.length>0)if(e.length>0){if(l.toLowerCase()!==e.toLowerCase())continue}else e=l;if(n){if(e.length>0)break}else if(t=`${o.slice(a)}\\${t}`,n=c,c&&e.length>0)break}return t=OA(t,!n,"\\",li),n?`${e}\\${t}`:`${e}${t}`||"."},normalize(i){Oo(i,"path");const e=i.length;if(e===0)return".";let t=0,n,r=!1;const o=i.charCodeAt(0);if(e===1)return a$(o)?"\\":i;if(li(o))if(r=!0,li(i.charCodeAt(1))){let a=2,l=a;for(;a2&&li(i.charCodeAt(2))&&(r=!0,t=3));let s=t0&&li(i.charCodeAt(e-1))&&(s+="\\"),n===void 0?r?`\\${s}`:s:r?`${n}\\${s}`:`${n}${s}`},isAbsolute(i){Oo(i,"path");const e=i.length;if(e===0)return!1;const t=i.charCodeAt(0);return li(t)||e>2&&om(t)&&i.charCodeAt(1)===rm&&li(i.charCodeAt(2))},join(...i){if(i.length===0)return".";let e,t;for(let o=0;o0&&(e===void 0?e=t=s:e+=`\\${s}`)}if(e===void 0)return".";let n=!0,r=0;if(typeof t=="string"&&li(t.charCodeAt(0))){++r;const o=t.length;o>1&&li(t.charCodeAt(1))&&(++r,o>2&&(li(t.charCodeAt(2))?++r:n=!1))}if(n){for(;r=2&&(e=`\\${e.slice(r)}`)}return wl.normalize(e)},relative(i,e){if(Oo(i,"from"),Oo(e,"to"),i===e)return"";const t=wl.resolve(i),n=wl.resolve(e);if(t===n||(i=t.toLowerCase(),e=n.toLowerCase(),i===e))return"";let r=0;for(;rr&&i.charCodeAt(o-1)===jl;)o--;const s=o-r;let a=0;for(;aa&&e.charCodeAt(l-1)===jl;)l--;const c=l-a,u=su){if(e.charCodeAt(a+h)===jl)return n.slice(a+h+1);if(h===2)return n.slice(a+h)}s>u&&(i.charCodeAt(r+h)===jl?d=h:h===2&&(d=3)),d===-1&&(d=0)}let f="";for(h=r+d+1;h<=o;++h)(h===o||i.charCodeAt(h)===jl)&&(f+=f.length===0?"..":"\\..");return a+=d,f.length>0?`${f}${n.slice(a,l)}`:(n.charCodeAt(a)===jl&&++a,n.slice(a,l))},toNamespacedPath(i){if(typeof i!="string"||i.length===0)return i;const e=wl.resolve(i);if(e.length<=2)return i;if(e.charCodeAt(0)===jl){if(e.charCodeAt(1)===jl){const t=e.charCodeAt(2);if(t!==h5e&&t!==mv)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(om(e.charCodeAt(0))&&e.charCodeAt(1)===rm&&e.charCodeAt(2)===jl)return`\\\\?\\${e}`;return i},dirname(i){Oo(i,"path");const e=i.length;if(e===0)return".";let t=-1,n=0;const r=i.charCodeAt(0);if(e===1)return li(r)?i:".";if(li(r)){if(t=n=1,li(i.charCodeAt(1))){let a=2,l=a;for(;a2&&li(i.charCodeAt(2))?3:2,n=t);let o=-1,s=!0;for(let a=e-1;a>=n;--a)if(li(i.charCodeAt(a))){if(!s){o=a;break}}else s=!1;if(o===-1){if(t===-1)return".";o=t}return i.slice(0,o)},basename(i,e){e!==void 0&&Oo(e,"ext"),Oo(i,"path");let t=0,n=-1,r=!0,o;if(i.length>=2&&om(i.charCodeAt(0))&&i.charCodeAt(1)===rm&&(t=2),e!==void 0&&e.length>0&&e.length<=i.length){if(e===i)return"";let s=e.length-1,a=-1;for(o=i.length-1;o>=t;--o){const l=i.charCodeAt(o);if(li(l)){if(!r){t=o+1;break}}else a===-1&&(r=!1,a=o+1),s>=0&&(l===e.charCodeAt(s)?--s===-1&&(n=o):(s=-1,n=a))}return t===n?n=a:n===-1&&(n=i.length),i.slice(t,n)}for(o=i.length-1;o>=t;--o)if(li(i.charCodeAt(o))){if(!r){t=o+1;break}}else n===-1&&(r=!1,n=o+1);return n===-1?"":i.slice(t,n)},extname(i){Oo(i,"path");let e=0,t=-1,n=0,r=-1,o=!0,s=0;i.length>=2&&i.charCodeAt(1)===rm&&om(i.charCodeAt(0))&&(e=n=2);for(let a=i.length-1;a>=e;--a){const l=i.charCodeAt(a);if(li(l)){if(!o){n=a+1;break}continue}r===-1&&(o=!1,r=a+1),l===mv?t===-1?t=a:s!==1&&(s=1):t!==-1&&(s=-1)}return t===-1||r===-1||s===0||s===1&&t===r-1&&t===n+1?"":i.slice(t,r)},format:Spe.bind(null,"\\"),parse(i){Oo(i,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return e;const t=i.length;let n=0,r=i.charCodeAt(0);if(t===1)return li(r)?(e.root=e.dir=i,e):(e.base=e.name=i,e);if(li(r)){if(n=1,li(i.charCodeAt(1))){let d=2,h=d;for(;d0&&(e.root=i.slice(0,n));let o=-1,s=n,a=-1,l=!0,c=i.length-1,u=0;for(;c>=n;--c){if(r=i.charCodeAt(c),li(r)){if(!l){s=c+1;break}continue}a===-1&&(l=!1,a=c+1),r===mv?o===-1?o=c:u!==1&&(u=1):o!==-1&&(u=-1)}return a!==-1&&(o===-1||u===0||u===1&&o===a-1&&o===s+1?e.base=e.name=i.slice(s,a):(e.name=i.slice(s,o),e.base=i.slice(s,a),e.ext=i.slice(o,a))),s>0&&s!==n?e.dir=i.slice(0,s-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},g5e=(()=>{if(E_){const i=/\\/g;return()=>{const e=PA().replace(i,"/");return e.slice(e.indexOf("/"))}}return()=>PA()})(),oo={resolve(...i){let e="",t=!1;for(let n=i.length-1;n>=-1&&!t;n--){const r=n>=0?i[n]:g5e();Oo(r,"path"),r.length!==0&&(e=`${r}/${e}`,t=r.charCodeAt(0)===zs)}return e=OA(e,!t,"/",a$),t?`/${e}`:e.length>0?e:"."},normalize(i){if(Oo(i,"path"),i.length===0)return".";const e=i.charCodeAt(0)===zs,t=i.charCodeAt(i.length-1)===zs;return i=OA(i,!e,"/",a$),i.length===0?e?"/":t?"./":".":(t&&(i+="/"),e?`/${i}`:i)},isAbsolute(i){return Oo(i,"path"),i.length>0&&i.charCodeAt(0)===zs},join(...i){if(i.length===0)return".";let e;for(let t=0;t0&&(e===void 0?e=n:e+=`/${n}`)}return e===void 0?".":oo.normalize(e)},relative(i,e){if(Oo(i,"from"),Oo(e,"to"),i===e||(i=oo.resolve(i),e=oo.resolve(e),i===e))return"";const t=1,n=i.length,r=n-t,o=1,s=e.length-o,a=ra){if(e.charCodeAt(o+c)===zs)return e.slice(o+c+1);if(c===0)return e.slice(o+c)}else r>a&&(i.charCodeAt(t+c)===zs?l=c:c===0&&(l=0));let u="";for(c=t+l+1;c<=n;++c)(c===n||i.charCodeAt(c)===zs)&&(u+=u.length===0?"..":"/..");return`${u}${e.slice(o+l)}`},toNamespacedPath(i){return i},dirname(i){if(Oo(i,"path"),i.length===0)return".";const e=i.charCodeAt(0)===zs;let t=-1,n=!0;for(let r=i.length-1;r>=1;--r)if(i.charCodeAt(r)===zs){if(!n){t=r;break}}else n=!1;return t===-1?e?"/":".":e&&t===1?"//":i.slice(0,t)},basename(i,e){e!==void 0&&Oo(e,"ext"),Oo(i,"path");let t=0,n=-1,r=!0,o;if(e!==void 0&&e.length>0&&e.length<=i.length){if(e===i)return"";let s=e.length-1,a=-1;for(o=i.length-1;o>=0;--o){const l=i.charCodeAt(o);if(l===zs){if(!r){t=o+1;break}}else a===-1&&(r=!1,a=o+1),s>=0&&(l===e.charCodeAt(s)?--s===-1&&(n=o):(s=-1,n=a))}return t===n?n=a:n===-1&&(n=i.length),i.slice(t,n)}for(o=i.length-1;o>=0;--o)if(i.charCodeAt(o)===zs){if(!r){t=o+1;break}}else n===-1&&(r=!1,n=o+1);return n===-1?"":i.slice(t,n)},extname(i){Oo(i,"path");let e=-1,t=0,n=-1,r=!0,o=0;for(let s=i.length-1;s>=0;--s){const a=i.charCodeAt(s);if(a===zs){if(!r){t=s+1;break}continue}n===-1&&(r=!1,n=s+1),a===mv?e===-1?e=s:o!==1&&(o=1):e!==-1&&(o=-1)}return e===-1||n===-1||o===0||o===1&&e===n-1&&e===t+1?"":i.slice(e,n)},format:Spe.bind(null,"/"),parse(i){Oo(i,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return e;const t=i.charCodeAt(0)===zs;let n;t?(e.root="/",n=1):n=0;let r=-1,o=0,s=-1,a=!0,l=i.length-1,c=0;for(;l>=n;--l){const u=i.charCodeAt(l);if(u===zs){if(!a){o=l+1;break}continue}s===-1&&(a=!1,s=l+1),u===mv?r===-1?r=l:c!==1&&(c=1):r!==-1&&(c=-1)}if(s!==-1){const u=o===0&&t?1:o;r===-1||c===0||c===1&&r===s-1&&r===o+1?e.base=e.name=i.slice(u,s):(e.name=i.slice(u,r),e.base=i.slice(u,s),e.ext=i.slice(r,s))}return o>0?e.dir=i.slice(0,o-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};oo.win32=wl.win32=wl;oo.posix=wl.posix=oo;const xpe=E_?wl.normalize:oo.normalize,p5e=E_?wl.resolve:oo.resolve,m5e=E_?wl.relative:oo.relative,Lpe=E_?wl.dirname:oo.dirname,vv=E_?wl.basename:oo.basename,v5e=E_?wl.extname:oo.extname,eh=E_?wl.sep:oo.sep,_5e=/^\w[\w\d+.-]*$/,b5e=/^\//,C5e=/^\/\//;function y5e(i,e){if(!i.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${i.authority}", path: "${i.path}", query: "${i.query}", fragment: "${i.fragment}"}`);if(i.scheme&&!_5e.test(i.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(i.path){if(i.authority){if(!b5e.test(i.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(C5e.test(i.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function w5e(i,e){return!i&&!e?"file":i}function S5e(i,e){switch(i){case"https":case"http":case"file":e?e[0]!==Bd&&(e=Bd+e):e=Bd;break}return e}const Or="",Bd="/",x5e=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class At{static isUri(e){return e instanceof At?!0:e?typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function":!1}constructor(e,t,n,r,o,s=!1){typeof e=="object"?(this.scheme=e.scheme||Or,this.authority=e.authority||Or,this.path=e.path||Or,this.query=e.query||Or,this.fragment=e.fragment||Or):(this.scheme=w5e(e,s),this.authority=t||Or,this.path=S5e(this.scheme,n||Or),this.query=r||Or,this.fragment=o||Or,y5e(this,s))}get fsPath(){return FA(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:n,path:r,query:o,fragment:s}=e;return t===void 0?t=this.scheme:t===null&&(t=Or),n===void 0?n=this.authority:n===null&&(n=Or),r===void 0?r=this.path:r===null&&(r=Or),o===void 0?o=this.query:o===null&&(o=Or),s===void 0?s=this.fragment:s===null&&(s=Or),t===this.scheme&&n===this.authority&&r===this.path&&o===this.query&&s===this.fragment?this:new jC(t,n,r,o,s)}static parse(e,t=!1){const n=x5e.exec(e);return n?new jC(n[2]||Or,JN(n[4]||Or),JN(n[5]||Or),JN(n[7]||Or),JN(n[9]||Or),t):new jC(Or,Or,Or,Or,Or)}static file(e){let t=Or;if(Rs&&(e=e.replace(/\\/g,Bd)),e[0]===Bd&&e[1]===Bd){const n=e.indexOf(Bd,2);n===-1?(t=e.substring(2),e=Bd):(t=e.substring(2,n),e=e.substring(n)||Bd)}return new jC("file",t,e,Or,Or)}static from(e,t){return new jC(e.scheme,e.authority,e.path,e.query,e.fragment,t)}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let n;return Rs&&e.scheme==="file"?n=At.file(wl.join(FA(e,!0),...t)).path:n=oo.join(e.path,...t),e.with({path:n})}toString(e=!1){return l$(this,e)}toJSON(){return this}static revive(e){var t,n;if(e){if(e instanceof At)return e;{const r=new jC(e);return r._formatted=(t=e.external)!==null&&t!==void 0?t:null,r._fsPath=e._sep===Epe&&(n=e.fsPath)!==null&&n!==void 0?n:null,r}}else return e}}const Epe=Rs?1:void 0;let jC=class extends At{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=FA(this,!1)),this._fsPath}toString(e=!1){return e?l$(this,!0):(this._formatted||(this._formatted=l$(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=Epe),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}};const Dpe={[58]:"%3A",[47]:"%2F",[63]:"%3F",[35]:"%23",[91]:"%5B",[93]:"%5D",[64]:"%40",[33]:"%21",[36]:"%24",[38]:"%26",[39]:"%27",[40]:"%28",[41]:"%29",[42]:"%2A",[43]:"%2B",[44]:"%2C",[59]:"%3B",[61]:"%3D",[32]:"%20"};function $ne(i,e,t){let n,r=-1;for(let o=0;o=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57||s===45||s===46||s===95||s===126||e&&s===47||t&&s===91||t&&s===93||t&&s===58)r!==-1&&(n+=encodeURIComponent(i.substring(r,o)),r=-1),n!==void 0&&(n+=i.charAt(o));else{n===void 0&&(n=i.substr(0,o));const a=Dpe[s];a!==void 0?(r!==-1&&(n+=encodeURIComponent(i.substring(r,o)),r=-1),n+=a):r===-1&&(r=o)}}return r!==-1&&(n+=encodeURIComponent(i.substring(r))),n!==void 0?n:i}function L5e(i){let e;for(let t=0;t1&&i.scheme==="file"?t=`//${i.authority}${i.path}`:i.path.charCodeAt(0)===47&&(i.path.charCodeAt(1)>=65&&i.path.charCodeAt(1)<=90||i.path.charCodeAt(1)>=97&&i.path.charCodeAt(1)<=122)&&i.path.charCodeAt(2)===58?e?t=i.path.substr(1):t=i.path[1].toLowerCase()+i.path.substr(2):t=i.path,Rs&&(t=t.replace(/\//g,"\\")),t}function l$(i,e){const t=e?L5e:$ne;let n="",{scheme:r,authority:o,path:s,query:a,fragment:l}=i;if(r&&(n+=r,n+=":"),(o||r==="file")&&(n+=Bd,n+=Bd),o){let c=o.indexOf("@");if(c!==-1){const u=o.substr(0,c);o=o.substr(c+1),c=u.lastIndexOf(":"),c===-1?n+=t(u,!1,!1):(n+=t(u.substr(0,c),!1,!1),n+=":",n+=t(u.substr(c+1),!1,!0)),n+="@"}o=o.toLowerCase(),c=o.lastIndexOf(":"),c===-1?n+=t(o,!1,!0):(n+=t(o.substr(0,c),!1,!0),n+=o.substr(c))}if(s){if(s.length>=3&&s.charCodeAt(0)===47&&s.charCodeAt(2)===58){const c=s.charCodeAt(1);c>=65&&c<=90&&(s=`/${String.fromCharCode(c+32)}:${s.substr(3)}`)}else if(s.length>=2&&s.charCodeAt(1)===58){const c=s.charCodeAt(0);c>=65&&c<=90&&(s=`${String.fromCharCode(c+32)}:${s.substr(2)}`)}n+=t(s,!0,!1)}return a&&(n+="?",n+=t(a,!1,!1)),l&&(n+="#",n+=e?l:$ne(l,!1,!1)),n}function Ipe(i){try{return decodeURIComponent(i)}catch{return i.length>3?i.substr(0,3)+Ipe(i.substr(3)):i}}const Hne=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function JN(i){return i.match(Hne)?i.replace(Hne,e=>Ipe(e)):i}let ae=class f0{constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new f0(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return f0.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return f0.isBefore(this,e)}static isBefore(e,t){return e.lineNumbern||e===n&&t>r?(this.startLineNumber=n,this.startColumn=r,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=n,this.endColumn=r)}isEmpty(){return Ko.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return Ko.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.columne.endColumn)}static strictContainsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<=e.startColumn||t.lineNumber===e.endLineNumber&&t.column>=e.endColumn)}containsRange(e){return Ko.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumne.endColumn)}strictContainsRange(e){return Ko.strictContainsRange(this,e)}static strictContainsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)}plusRange(e){return Ko.plusRange(this,e)}static plusRange(e,t){let n,r,o,s;return t.startLineNumbere.endLineNumber?(o=t.endLineNumber,s=t.endColumn):t.endLineNumber===e.endLineNumber?(o=t.endLineNumber,s=Math.max(t.endColumn,e.endColumn)):(o=e.endLineNumber,s=e.endColumn),new Ko(n,r,o,s)}intersectRanges(e){return Ko.intersectRanges(this,e)}static intersectRanges(e,t){let n=e.startLineNumber,r=e.startColumn,o=e.endLineNumber,s=e.endColumn;const a=t.startLineNumber,l=t.startColumn,c=t.endLineNumber,u=t.endColumn;return nc?(o=c,s=u):o===c&&(s=Math.min(s,u)),n>o||n===o&&r>s?null:new Ko(n,r,o,s)}equalsRange(e){return Ko.equalsRange(this,e)}static equalsRange(e,t){return!e&&!t?!0:!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return Ko.getEndPosition(this)}static getEndPosition(e){return new ae(e.endLineNumber,e.endColumn)}getStartPosition(){return Ko.getStartPosition(this)}static getStartPosition(e){return new ae(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new Ko(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new Ko(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return Ko.collapseToStart(this)}static collapseToStart(e){return new Ko(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return Ko.collapseToEnd(this)}static collapseToEnd(e){return new Ko(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new Ko(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}static fromPositions(e,t=e){return new Ko(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new Ko(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,t){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}},yt=class Ru extends B{constructor(e,t,n,r){super(e,t,n,r),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=n,this.positionColumn=r}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return Ru.selectionsEqual(this,e)}static selectionsEqual(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1}setEndPosition(e,t){return this.getDirection()===0?new Ru(this.startLineNumber,this.startColumn,e,t):new Ru(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new ae(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new ae(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return this.getDirection()===0?new Ru(e,t,this.endLineNumber,this.endColumn):new Ru(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new Ru(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return t===0?new Ru(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new Ru(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new Ru(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(let n=0,r=e.length;n{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){var n;(n=this._factories.get(e))===null||n===void 0||n.dispose();const r=new D5e(this,e,t);return this._factories.set(e,r),Rt(()=>{const o=this._factories.get(e);!o||o!==r||(this._factories.delete(e),o.dispose())})}async getOrCreate(e){const t=this.get(e);if(t)return t;const n=this._factories.get(e);return!n||n.isResolved?null:(await n.resolve(),this.get(e))}isResolved(e){if(this.get(e))return!0;const n=this._factories.get(e);return!!(!n||n.isResolved)}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._tokenizationSupports.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null}};class D5e extends fe{get isResolved(){return this._isResolved}constructor(e,t,n){super(),this._registry=e,this._languageId=t,this._factory=n,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}async resolve(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise}async _create(){const e=await this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))}}let wD=class{constructor(e,t,n){this.offset=e,this.type=t,this.language=n,this._tokenBrand=void 0}toString(){return"("+this.offset+", "+this.type+")"}};class fq{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}}class s4{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}var SD;(function(i){const e=new Map;e.set(0,Xe.symbolMethod),e.set(1,Xe.symbolFunction),e.set(2,Xe.symbolConstructor),e.set(3,Xe.symbolField),e.set(4,Xe.symbolVariable),e.set(5,Xe.symbolClass),e.set(6,Xe.symbolStruct),e.set(7,Xe.symbolInterface),e.set(8,Xe.symbolModule),e.set(9,Xe.symbolProperty),e.set(10,Xe.symbolEvent),e.set(11,Xe.symbolOperator),e.set(12,Xe.symbolUnit),e.set(13,Xe.symbolValue),e.set(15,Xe.symbolEnum),e.set(14,Xe.symbolConstant),e.set(15,Xe.symbolEnum),e.set(16,Xe.symbolEnumMember),e.set(17,Xe.symbolKeyword),e.set(27,Xe.symbolSnippet),e.set(18,Xe.symbolText),e.set(19,Xe.symbolColor),e.set(20,Xe.symbolFile),e.set(21,Xe.symbolReference),e.set(22,Xe.symbolCustomColor),e.set(23,Xe.symbolFolder),e.set(24,Xe.symbolTypeParameter),e.set(25,Xe.account),e.set(26,Xe.issues);function t(o){let s=e.get(o);return s||(console.info("No codicon found for CompletionItemKind "+o),s=Xe.symbolProperty),s}i.toIcon=t;const n=new Map;n.set("method",0),n.set("function",1),n.set("constructor",2),n.set("field",3),n.set("variable",4),n.set("class",5),n.set("struct",6),n.set("interface",7),n.set("module",8),n.set("property",9),n.set("event",10),n.set("operator",11),n.set("unit",12),n.set("value",13),n.set("constant",14),n.set("enum",15),n.set("enum-member",16),n.set("enumMember",16),n.set("keyword",17),n.set("snippet",27),n.set("text",18),n.set("color",19),n.set("file",20),n.set("reference",21),n.set("customcolor",22),n.set("folder",23),n.set("type-parameter",24),n.set("typeParameter",24),n.set("account",25),n.set("issue",26);function r(o,s){let a=n.get(o);return typeof a>"u"&&!s&&(a=9),a}i.fromString=r})(SD||(SD={}));var fp;(function(i){i[i.Automatic=0]="Automatic",i[i.Explicit=1]="Explicit"})(fp||(fp={}));class Tpe{constructor(e,t,n,r){this.range=e,this.text=t,this.completionKind=n,this.isSnippetText=r}equals(e){return B.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}var Tf;(function(i){i[i.Invoke=1]="Invoke",i[i.TriggerCharacter=2]="TriggerCharacter",i[i.ContentChange=3]="ContentChange"})(Tf||(Tf={}));var xD;(function(i){i[i.Text=0]="Text",i[i.Read=1]="Read",i[i.Write=2]="Write"})(xD||(xD={}));function I5e(i){return i&&At.isUri(i.uri)&&B.isIRange(i.range)&&(B.isIRange(i.originSelectionRange)||B.isIRange(i.targetSelectionRange))}const k5e={[17]:w("Array","array"),[16]:w("Boolean","boolean"),[4]:w("Class","class"),[13]:w("Constant","constant"),[8]:w("Constructor","constructor"),[9]:w("Enum","enumeration"),[21]:w("EnumMember","enumeration member"),[23]:w("Event","event"),[7]:w("Field","field"),[0]:w("File","file"),[11]:w("Function","function"),[10]:w("Interface","interface"),[19]:w("Key","key"),[5]:w("Method","method"),[1]:w("Module","module"),[2]:w("Namespace","namespace"),[20]:w("Null","null"),[15]:w("Number","number"),[18]:w("Object","object"),[24]:w("Operator","operator"),[3]:w("Package","package"),[6]:w("Property","property"),[14]:w("String","string"),[22]:w("Struct","struct"),[25]:w("TypeParameter","type parameter"),[12]:w("Variable","variable")};function T5e(i,e){return w("symbolAriaLabel","{0} ({1})",i,k5e[e])}var BA;(function(i){const e=new Map;e.set(0,Xe.symbolFile),e.set(1,Xe.symbolModule),e.set(2,Xe.symbolNamespace),e.set(3,Xe.symbolPackage),e.set(4,Xe.symbolClass),e.set(5,Xe.symbolMethod),e.set(6,Xe.symbolProperty),e.set(7,Xe.symbolField),e.set(8,Xe.symbolConstructor),e.set(9,Xe.symbolEnum),e.set(10,Xe.symbolInterface),e.set(11,Xe.symbolFunction),e.set(12,Xe.symbolVariable),e.set(13,Xe.symbolConstant),e.set(14,Xe.symbolString),e.set(15,Xe.symbolNumber),e.set(16,Xe.symbolBoolean),e.set(17,Xe.symbolArray),e.set(18,Xe.symbolObject),e.set(19,Xe.symbolKey),e.set(20,Xe.symbolNull),e.set(21,Xe.symbolEnumMember),e.set(22,Xe.symbolStruct),e.set(23,Xe.symbolEvent),e.set(24,Xe.symbolOperator),e.set(25,Xe.symbolTypeParameter);function t(n){let r=e.get(n);return r||(console.info("No codicon found for SymbolKind "+n),r=Xe.symbolProperty),r}i.toIcon=t})(BA||(BA={}));class ba{static fromValue(e){switch(e){case"comment":return ba.Comment;case"imports":return ba.Imports;case"region":return ba.Region}return new ba(e)}constructor(e){this.value=e}}ba.Comment=new ba("comment");ba.Imports=new ba("imports");ba.Region=new ba("region");var Vne;(function(i){i[i.AIGenerated=1]="AIGenerated"})(Vne||(Vne={}));var u$;(function(i){function e(t){return!t||typeof t!="object"?!1:typeof t.id=="string"&&typeof t.title=="string"}i.is=e})(u$||(u$={}));var WA;(function(i){i[i.Type=1]="Type",i[i.Parameter=2]="Parameter"})(WA||(WA={}));class N5e{constructor(e){this.createSupport=e,this._tokenizationSupport=null}dispose(){this._tokenizationSupport&&this._tokenizationSupport.then(e=>{e&&e.dispose()})}get tokenizationSupport(){return this._tokenizationSupport||(this._tokenizationSupport=this.createSupport()),this._tokenizationSupport}}const hr=new E5e;var $A;(function(i){i[i.Invoke=0]="Invoke",i[i.Automatic=1]="Automatic"})($A||($A={}));var d$;(function(i){i[i.Unknown=0]="Unknown",i[i.Disabled=1]="Disabled",i[i.Enabled=2]="Enabled"})(d$||(d$={}));var h$;(function(i){i[i.Invoke=1]="Invoke",i[i.Auto=2]="Auto"})(h$||(h$={}));var f$;(function(i){i[i.None=0]="None",i[i.KeepWhitespace=1]="KeepWhitespace",i[i.InsertAsSnippet=4]="InsertAsSnippet"})(f$||(f$={}));var g$;(function(i){i[i.Method=0]="Method",i[i.Function=1]="Function",i[i.Constructor=2]="Constructor",i[i.Field=3]="Field",i[i.Variable=4]="Variable",i[i.Class=5]="Class",i[i.Struct=6]="Struct",i[i.Interface=7]="Interface",i[i.Module=8]="Module",i[i.Property=9]="Property",i[i.Event=10]="Event",i[i.Operator=11]="Operator",i[i.Unit=12]="Unit",i[i.Value=13]="Value",i[i.Constant=14]="Constant",i[i.Enum=15]="Enum",i[i.EnumMember=16]="EnumMember",i[i.Keyword=17]="Keyword",i[i.Text=18]="Text",i[i.Color=19]="Color",i[i.File=20]="File",i[i.Reference=21]="Reference",i[i.Customcolor=22]="Customcolor",i[i.Folder=23]="Folder",i[i.TypeParameter=24]="TypeParameter",i[i.User=25]="User",i[i.Issue=26]="Issue",i[i.Snippet=27]="Snippet"})(g$||(g$={}));var p$;(function(i){i[i.Deprecated=1]="Deprecated"})(p$||(p$={}));var m$;(function(i){i[i.Invoke=0]="Invoke",i[i.TriggerCharacter=1]="TriggerCharacter",i[i.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(m$||(m$={}));var v$;(function(i){i[i.EXACT=0]="EXACT",i[i.ABOVE=1]="ABOVE",i[i.BELOW=2]="BELOW"})(v$||(v$={}));var _$;(function(i){i[i.NotSet=0]="NotSet",i[i.ContentFlush=1]="ContentFlush",i[i.RecoverFromMarkers=2]="RecoverFromMarkers",i[i.Explicit=3]="Explicit",i[i.Paste=4]="Paste",i[i.Undo=5]="Undo",i[i.Redo=6]="Redo"})(_$||(_$={}));var b$;(function(i){i[i.LF=1]="LF",i[i.CRLF=2]="CRLF"})(b$||(b$={}));var C$;(function(i){i[i.Text=0]="Text",i[i.Read=1]="Read",i[i.Write=2]="Write"})(C$||(C$={}));var y$;(function(i){i[i.None=0]="None",i[i.Keep=1]="Keep",i[i.Brackets=2]="Brackets",i[i.Advanced=3]="Advanced",i[i.Full=4]="Full"})(y$||(y$={}));var w$;(function(i){i[i.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",i[i.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",i[i.accessibilitySupport=2]="accessibilitySupport",i[i.accessibilityPageSize=3]="accessibilityPageSize",i[i.ariaLabel=4]="ariaLabel",i[i.ariaRequired=5]="ariaRequired",i[i.autoClosingBrackets=6]="autoClosingBrackets",i[i.autoClosingComments=7]="autoClosingComments",i[i.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",i[i.autoClosingDelete=9]="autoClosingDelete",i[i.autoClosingOvertype=10]="autoClosingOvertype",i[i.autoClosingQuotes=11]="autoClosingQuotes",i[i.autoIndent=12]="autoIndent",i[i.automaticLayout=13]="automaticLayout",i[i.autoSurround=14]="autoSurround",i[i.bracketPairColorization=15]="bracketPairColorization",i[i.guides=16]="guides",i[i.codeLens=17]="codeLens",i[i.codeLensFontFamily=18]="codeLensFontFamily",i[i.codeLensFontSize=19]="codeLensFontSize",i[i.colorDecorators=20]="colorDecorators",i[i.colorDecoratorsLimit=21]="colorDecoratorsLimit",i[i.columnSelection=22]="columnSelection",i[i.comments=23]="comments",i[i.contextmenu=24]="contextmenu",i[i.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",i[i.cursorBlinking=26]="cursorBlinking",i[i.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",i[i.cursorStyle=28]="cursorStyle",i[i.cursorSurroundingLines=29]="cursorSurroundingLines",i[i.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",i[i.cursorWidth=31]="cursorWidth",i[i.disableLayerHinting=32]="disableLayerHinting",i[i.disableMonospaceOptimizations=33]="disableMonospaceOptimizations",i[i.domReadOnly=34]="domReadOnly",i[i.dragAndDrop=35]="dragAndDrop",i[i.dropIntoEditor=36]="dropIntoEditor",i[i.emptySelectionClipboard=37]="emptySelectionClipboard",i[i.experimentalWhitespaceRendering=38]="experimentalWhitespaceRendering",i[i.extraEditorClassName=39]="extraEditorClassName",i[i.fastScrollSensitivity=40]="fastScrollSensitivity",i[i.find=41]="find",i[i.fixedOverflowWidgets=42]="fixedOverflowWidgets",i[i.folding=43]="folding",i[i.foldingStrategy=44]="foldingStrategy",i[i.foldingHighlight=45]="foldingHighlight",i[i.foldingImportsByDefault=46]="foldingImportsByDefault",i[i.foldingMaximumRegions=47]="foldingMaximumRegions",i[i.unfoldOnClickAfterEndOfLine=48]="unfoldOnClickAfterEndOfLine",i[i.fontFamily=49]="fontFamily",i[i.fontInfo=50]="fontInfo",i[i.fontLigatures=51]="fontLigatures",i[i.fontSize=52]="fontSize",i[i.fontWeight=53]="fontWeight",i[i.fontVariations=54]="fontVariations",i[i.formatOnPaste=55]="formatOnPaste",i[i.formatOnType=56]="formatOnType",i[i.glyphMargin=57]="glyphMargin",i[i.gotoLocation=58]="gotoLocation",i[i.hideCursorInOverviewRuler=59]="hideCursorInOverviewRuler",i[i.hover=60]="hover",i[i.inDiffEditor=61]="inDiffEditor",i[i.inlineSuggest=62]="inlineSuggest",i[i.inlineEdit=63]="inlineEdit",i[i.letterSpacing=64]="letterSpacing",i[i.lightbulb=65]="lightbulb",i[i.lineDecorationsWidth=66]="lineDecorationsWidth",i[i.lineHeight=67]="lineHeight",i[i.lineNumbers=68]="lineNumbers",i[i.lineNumbersMinChars=69]="lineNumbersMinChars",i[i.linkedEditing=70]="linkedEditing",i[i.links=71]="links",i[i.matchBrackets=72]="matchBrackets",i[i.minimap=73]="minimap",i[i.mouseStyle=74]="mouseStyle",i[i.mouseWheelScrollSensitivity=75]="mouseWheelScrollSensitivity",i[i.mouseWheelZoom=76]="mouseWheelZoom",i[i.multiCursorMergeOverlapping=77]="multiCursorMergeOverlapping",i[i.multiCursorModifier=78]="multiCursorModifier",i[i.multiCursorPaste=79]="multiCursorPaste",i[i.multiCursorLimit=80]="multiCursorLimit",i[i.occurrencesHighlight=81]="occurrencesHighlight",i[i.overviewRulerBorder=82]="overviewRulerBorder",i[i.overviewRulerLanes=83]="overviewRulerLanes",i[i.padding=84]="padding",i[i.pasteAs=85]="pasteAs",i[i.parameterHints=86]="parameterHints",i[i.peekWidgetDefaultFocus=87]="peekWidgetDefaultFocus",i[i.definitionLinkOpensInPeek=88]="definitionLinkOpensInPeek",i[i.quickSuggestions=89]="quickSuggestions",i[i.quickSuggestionsDelay=90]="quickSuggestionsDelay",i[i.readOnly=91]="readOnly",i[i.readOnlyMessage=92]="readOnlyMessage",i[i.renameOnType=93]="renameOnType",i[i.renderControlCharacters=94]="renderControlCharacters",i[i.renderFinalNewline=95]="renderFinalNewline",i[i.renderLineHighlight=96]="renderLineHighlight",i[i.renderLineHighlightOnlyWhenFocus=97]="renderLineHighlightOnlyWhenFocus",i[i.renderValidationDecorations=98]="renderValidationDecorations",i[i.renderWhitespace=99]="renderWhitespace",i[i.revealHorizontalRightPadding=100]="revealHorizontalRightPadding",i[i.roundedSelection=101]="roundedSelection",i[i.rulers=102]="rulers",i[i.scrollbar=103]="scrollbar",i[i.scrollBeyondLastColumn=104]="scrollBeyondLastColumn",i[i.scrollBeyondLastLine=105]="scrollBeyondLastLine",i[i.scrollPredominantAxis=106]="scrollPredominantAxis",i[i.selectionClipboard=107]="selectionClipboard",i[i.selectionHighlight=108]="selectionHighlight",i[i.selectOnLineNumbers=109]="selectOnLineNumbers",i[i.showFoldingControls=110]="showFoldingControls",i[i.showUnused=111]="showUnused",i[i.snippetSuggestions=112]="snippetSuggestions",i[i.smartSelect=113]="smartSelect",i[i.smoothScrolling=114]="smoothScrolling",i[i.stickyScroll=115]="stickyScroll",i[i.stickyTabStops=116]="stickyTabStops",i[i.stopRenderingLineAfter=117]="stopRenderingLineAfter",i[i.suggest=118]="suggest",i[i.suggestFontSize=119]="suggestFontSize",i[i.suggestLineHeight=120]="suggestLineHeight",i[i.suggestOnTriggerCharacters=121]="suggestOnTriggerCharacters",i[i.suggestSelection=122]="suggestSelection",i[i.tabCompletion=123]="tabCompletion",i[i.tabIndex=124]="tabIndex",i[i.unicodeHighlighting=125]="unicodeHighlighting",i[i.unusualLineTerminators=126]="unusualLineTerminators",i[i.useShadowDOM=127]="useShadowDOM",i[i.useTabStops=128]="useTabStops",i[i.wordBreak=129]="wordBreak",i[i.wordSeparators=130]="wordSeparators",i[i.wordWrap=131]="wordWrap",i[i.wordWrapBreakAfterCharacters=132]="wordWrapBreakAfterCharacters",i[i.wordWrapBreakBeforeCharacters=133]="wordWrapBreakBeforeCharacters",i[i.wordWrapColumn=134]="wordWrapColumn",i[i.wordWrapOverride1=135]="wordWrapOverride1",i[i.wordWrapOverride2=136]="wordWrapOverride2",i[i.wrappingIndent=137]="wrappingIndent",i[i.wrappingStrategy=138]="wrappingStrategy",i[i.showDeprecated=139]="showDeprecated",i[i.inlayHints=140]="inlayHints",i[i.editorClassName=141]="editorClassName",i[i.pixelRatio=142]="pixelRatio",i[i.tabFocusMode=143]="tabFocusMode",i[i.layoutInfo=144]="layoutInfo",i[i.wrappingInfo=145]="wrappingInfo",i[i.defaultColorDecorators=146]="defaultColorDecorators",i[i.colorDecoratorsActivatedOn=147]="colorDecoratorsActivatedOn",i[i.inlineCompletionsAccessibilityVerbose=148]="inlineCompletionsAccessibilityVerbose"})(w$||(w$={}));var S$;(function(i){i[i.TextDefined=0]="TextDefined",i[i.LF=1]="LF",i[i.CRLF=2]="CRLF"})(S$||(S$={}));var x$;(function(i){i[i.LF=0]="LF",i[i.CRLF=1]="CRLF"})(x$||(x$={}));var L$;(function(i){i[i.Left=1]="Left",i[i.Center=2]="Center",i[i.Right=3]="Right"})(L$||(L$={}));var E$;(function(i){i[i.None=0]="None",i[i.Indent=1]="Indent",i[i.IndentOutdent=2]="IndentOutdent",i[i.Outdent=3]="Outdent"})(E$||(E$={}));var D$;(function(i){i[i.Both=0]="Both",i[i.Right=1]="Right",i[i.Left=2]="Left",i[i.None=3]="None"})(D$||(D$={}));var I$;(function(i){i[i.Type=1]="Type",i[i.Parameter=2]="Parameter"})(I$||(I$={}));var k$;(function(i){i[i.Automatic=0]="Automatic",i[i.Explicit=1]="Explicit"})(k$||(k$={}));var T$;(function(i){i[i.Invoke=0]="Invoke",i[i.Automatic=1]="Automatic"})(T$||(T$={}));var N$;(function(i){i[i.DependsOnKbLayout=-1]="DependsOnKbLayout",i[i.Unknown=0]="Unknown",i[i.Backspace=1]="Backspace",i[i.Tab=2]="Tab",i[i.Enter=3]="Enter",i[i.Shift=4]="Shift",i[i.Ctrl=5]="Ctrl",i[i.Alt=6]="Alt",i[i.PauseBreak=7]="PauseBreak",i[i.CapsLock=8]="CapsLock",i[i.Escape=9]="Escape",i[i.Space=10]="Space",i[i.PageUp=11]="PageUp",i[i.PageDown=12]="PageDown",i[i.End=13]="End",i[i.Home=14]="Home",i[i.LeftArrow=15]="LeftArrow",i[i.UpArrow=16]="UpArrow",i[i.RightArrow=17]="RightArrow",i[i.DownArrow=18]="DownArrow",i[i.Insert=19]="Insert",i[i.Delete=20]="Delete",i[i.Digit0=21]="Digit0",i[i.Digit1=22]="Digit1",i[i.Digit2=23]="Digit2",i[i.Digit3=24]="Digit3",i[i.Digit4=25]="Digit4",i[i.Digit5=26]="Digit5",i[i.Digit6=27]="Digit6",i[i.Digit7=28]="Digit7",i[i.Digit8=29]="Digit8",i[i.Digit9=30]="Digit9",i[i.KeyA=31]="KeyA",i[i.KeyB=32]="KeyB",i[i.KeyC=33]="KeyC",i[i.KeyD=34]="KeyD",i[i.KeyE=35]="KeyE",i[i.KeyF=36]="KeyF",i[i.KeyG=37]="KeyG",i[i.KeyH=38]="KeyH",i[i.KeyI=39]="KeyI",i[i.KeyJ=40]="KeyJ",i[i.KeyK=41]="KeyK",i[i.KeyL=42]="KeyL",i[i.KeyM=43]="KeyM",i[i.KeyN=44]="KeyN",i[i.KeyO=45]="KeyO",i[i.KeyP=46]="KeyP",i[i.KeyQ=47]="KeyQ",i[i.KeyR=48]="KeyR",i[i.KeyS=49]="KeyS",i[i.KeyT=50]="KeyT",i[i.KeyU=51]="KeyU",i[i.KeyV=52]="KeyV",i[i.KeyW=53]="KeyW",i[i.KeyX=54]="KeyX",i[i.KeyY=55]="KeyY",i[i.KeyZ=56]="KeyZ",i[i.Meta=57]="Meta",i[i.ContextMenu=58]="ContextMenu",i[i.F1=59]="F1",i[i.F2=60]="F2",i[i.F3=61]="F3",i[i.F4=62]="F4",i[i.F5=63]="F5",i[i.F6=64]="F6",i[i.F7=65]="F7",i[i.F8=66]="F8",i[i.F9=67]="F9",i[i.F10=68]="F10",i[i.F11=69]="F11",i[i.F12=70]="F12",i[i.F13=71]="F13",i[i.F14=72]="F14",i[i.F15=73]="F15",i[i.F16=74]="F16",i[i.F17=75]="F17",i[i.F18=76]="F18",i[i.F19=77]="F19",i[i.F20=78]="F20",i[i.F21=79]="F21",i[i.F22=80]="F22",i[i.F23=81]="F23",i[i.F24=82]="F24",i[i.NumLock=83]="NumLock",i[i.ScrollLock=84]="ScrollLock",i[i.Semicolon=85]="Semicolon",i[i.Equal=86]="Equal",i[i.Comma=87]="Comma",i[i.Minus=88]="Minus",i[i.Period=89]="Period",i[i.Slash=90]="Slash",i[i.Backquote=91]="Backquote",i[i.BracketLeft=92]="BracketLeft",i[i.Backslash=93]="Backslash",i[i.BracketRight=94]="BracketRight",i[i.Quote=95]="Quote",i[i.OEM_8=96]="OEM_8",i[i.IntlBackslash=97]="IntlBackslash",i[i.Numpad0=98]="Numpad0",i[i.Numpad1=99]="Numpad1",i[i.Numpad2=100]="Numpad2",i[i.Numpad3=101]="Numpad3",i[i.Numpad4=102]="Numpad4",i[i.Numpad5=103]="Numpad5",i[i.Numpad6=104]="Numpad6",i[i.Numpad7=105]="Numpad7",i[i.Numpad8=106]="Numpad8",i[i.Numpad9=107]="Numpad9",i[i.NumpadMultiply=108]="NumpadMultiply",i[i.NumpadAdd=109]="NumpadAdd",i[i.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",i[i.NumpadSubtract=111]="NumpadSubtract",i[i.NumpadDecimal=112]="NumpadDecimal",i[i.NumpadDivide=113]="NumpadDivide",i[i.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",i[i.ABNT_C1=115]="ABNT_C1",i[i.ABNT_C2=116]="ABNT_C2",i[i.AudioVolumeMute=117]="AudioVolumeMute",i[i.AudioVolumeUp=118]="AudioVolumeUp",i[i.AudioVolumeDown=119]="AudioVolumeDown",i[i.BrowserSearch=120]="BrowserSearch",i[i.BrowserHome=121]="BrowserHome",i[i.BrowserBack=122]="BrowserBack",i[i.BrowserForward=123]="BrowserForward",i[i.MediaTrackNext=124]="MediaTrackNext",i[i.MediaTrackPrevious=125]="MediaTrackPrevious",i[i.MediaStop=126]="MediaStop",i[i.MediaPlayPause=127]="MediaPlayPause",i[i.LaunchMediaPlayer=128]="LaunchMediaPlayer",i[i.LaunchMail=129]="LaunchMail",i[i.LaunchApp2=130]="LaunchApp2",i[i.Clear=131]="Clear",i[i.MAX_VALUE=132]="MAX_VALUE"})(N$||(N$={}));var R$;(function(i){i[i.Hint=1]="Hint",i[i.Info=2]="Info",i[i.Warning=4]="Warning",i[i.Error=8]="Error"})(R$||(R$={}));var M$;(function(i){i[i.Unnecessary=1]="Unnecessary",i[i.Deprecated=2]="Deprecated"})(M$||(M$={}));var A$;(function(i){i[i.Inline=1]="Inline",i[i.Gutter=2]="Gutter"})(A$||(A$={}));var P$;(function(i){i[i.UNKNOWN=0]="UNKNOWN",i[i.TEXTAREA=1]="TEXTAREA",i[i.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",i[i.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",i[i.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",i[i.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",i[i.CONTENT_TEXT=6]="CONTENT_TEXT",i[i.CONTENT_EMPTY=7]="CONTENT_EMPTY",i[i.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",i[i.CONTENT_WIDGET=9]="CONTENT_WIDGET",i[i.OVERVIEW_RULER=10]="OVERVIEW_RULER",i[i.SCROLLBAR=11]="SCROLLBAR",i[i.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",i[i.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(P$||(P$={}));var O$;(function(i){i[i.AIGenerated=1]="AIGenerated"})(O$||(O$={}));var F$;(function(i){i[i.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",i[i.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",i[i.TOP_CENTER=2]="TOP_CENTER"})(F$||(F$={}));var B$;(function(i){i[i.Left=1]="Left",i[i.Center=2]="Center",i[i.Right=4]="Right",i[i.Full=7]="Full"})(B$||(B$={}));var W$;(function(i){i[i.Left=0]="Left",i[i.Right=1]="Right",i[i.None=2]="None",i[i.LeftOfInjectedText=3]="LeftOfInjectedText",i[i.RightOfInjectedText=4]="RightOfInjectedText"})(W$||(W$={}));var $$;(function(i){i[i.Off=0]="Off",i[i.On=1]="On",i[i.Relative=2]="Relative",i[i.Interval=3]="Interval",i[i.Custom=4]="Custom"})($$||($$={}));var H$;(function(i){i[i.None=0]="None",i[i.Text=1]="Text",i[i.Blocks=2]="Blocks"})(H$||(H$={}));var V$;(function(i){i[i.Smooth=0]="Smooth",i[i.Immediate=1]="Immediate"})(V$||(V$={}));var z$;(function(i){i[i.Auto=1]="Auto",i[i.Hidden=2]="Hidden",i[i.Visible=3]="Visible"})(z$||(z$={}));var U$;(function(i){i[i.LTR=0]="LTR",i[i.RTL=1]="RTL"})(U$||(U$={}));var j$;(function(i){i.Off="off",i.OnCode="onCode",i.On="on"})(j$||(j$={}));var K$;(function(i){i[i.Invoke=1]="Invoke",i[i.TriggerCharacter=2]="TriggerCharacter",i[i.ContentChange=3]="ContentChange"})(K$||(K$={}));var G$;(function(i){i[i.File=0]="File",i[i.Module=1]="Module",i[i.Namespace=2]="Namespace",i[i.Package=3]="Package",i[i.Class=4]="Class",i[i.Method=5]="Method",i[i.Property=6]="Property",i[i.Field=7]="Field",i[i.Constructor=8]="Constructor",i[i.Enum=9]="Enum",i[i.Interface=10]="Interface",i[i.Function=11]="Function",i[i.Variable=12]="Variable",i[i.Constant=13]="Constant",i[i.String=14]="String",i[i.Number=15]="Number",i[i.Boolean=16]="Boolean",i[i.Array=17]="Array",i[i.Object=18]="Object",i[i.Key=19]="Key",i[i.Null=20]="Null",i[i.EnumMember=21]="EnumMember",i[i.Struct=22]="Struct",i[i.Event=23]="Event",i[i.Operator=24]="Operator",i[i.TypeParameter=25]="TypeParameter"})(G$||(G$={}));var q$;(function(i){i[i.Deprecated=1]="Deprecated"})(q$||(q$={}));var X$;(function(i){i[i.Hidden=0]="Hidden",i[i.Blink=1]="Blink",i[i.Smooth=2]="Smooth",i[i.Phase=3]="Phase",i[i.Expand=4]="Expand",i[i.Solid=5]="Solid"})(X$||(X$={}));var Y$;(function(i){i[i.Line=1]="Line",i[i.Block=2]="Block",i[i.Underline=3]="Underline",i[i.LineThin=4]="LineThin",i[i.BlockOutline=5]="BlockOutline",i[i.UnderlineThin=6]="UnderlineThin"})(Y$||(Y$={}));var Z$;(function(i){i[i.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",i[i.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",i[i.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",i[i.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(Z$||(Z$={}));var Q$;(function(i){i[i.None=0]="None",i[i.Same=1]="Same",i[i.Indent=2]="Indent",i[i.DeepIndent=3]="DeepIndent"})(Q$||(Q$={}));let Dk=class{static chord(e,t){return co(e,t)}};Dk.CtrlCmd=2048;Dk.Shift=1024;Dk.Alt=512;Dk.WinCtrl=256;function Npe(){return{editor:void 0,languages:void 0,CancellationTokenSource:wr,Emitter:se,KeyCode:N$,KeyMod:Dk,Position:ae,Range:B,Selection:yt,SelectionDirection:U$,MarkerSeverity:R$,MarkerTag:M$,Uri:At,Token:wD}}function R5e(i,e){const t=i;typeof t.vscodeWindowId!="number"&&Object.defineProperty(t,"vscodeWindowId",{get:()=>e})}const hi=window,M5e=hi;class A5e{constructor(e){this.fn=e,this.lastCache=void 0,this.lastArgKey=void 0}get(e){const t=JSON.stringify(e);return this.lastArgKey!==t&&(this.lastArgKey=t,this.lastCache=this.fn(e)),this.lastCache}}class zne{get cachedValues(){return this._map}constructor(e){this.fn=e,this._map=new Map}get(e){if(this._map.has(e))return this._map.get(e);const t=this.fn(e);return this._map.set(e,t),t}}class Qf{constructor(e){this.executor=e,this._didRun=!1}get value(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}var Sw;function Rpe(i){return!i||typeof i!="string"?!0:i.trim().length===0}const P5e=/{(\d+)}/g;function Eb(i,...e){return e.length===0?i:i.replace(P5e,function(t,n){const r=parseInt(n,10);return isNaN(r)||r<0||r>=e.length?t:e[r]})}function O5e(i){return i.replace(/[<>"'&]/g,e=>{switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return e})}function HA(i){return i.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}function fc(i){return i.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function F5e(i,e=" "){const t=Ik(i,e);return Mpe(t,e)}function Ik(i,e){if(!i||!e)return i;const t=e.length;if(t===0||i.length===0)return i;let n=0;for(;i.indexOf(e,n)===n;)n=n+t;return i.substring(n)}function Mpe(i,e){if(!i||!e)return i;const t=e.length,n=i.length;if(t===0||n===0)return i;let r=n,o=-1;for(;o=i.lastIndexOf(e,r-1),!(o===-1||o+t!==r);){if(o===0)return"";r=o}return i.substring(0,r)}function B5e(i){return i.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function W5e(i){return i.replace(/\*/g,"")}function Ape(i,e,t={}){if(!i)throw new Error("Cannot create regex from empty string");e||(i=fc(i)),t.wholeWord&&(/\B/.test(i.charAt(0))||(i="\\b"+i),/\B/.test(i.charAt(i.length-1))||(i=i+"\\b"));let n="";return t.global&&(n+="g"),t.matchCase||(n+="i"),t.multiline&&(n+="m"),t.unicode&&(n+="u"),new RegExp(i,n)}function $5e(i){return i.source==="^"||i.source==="^$"||i.source==="$"||i.source==="^\\s*$"?!1:!!(i.exec("")&&i.lastIndex===0)}function Jf(i){return i.split(/\r\n|\r|\n/)}function H5e(i){var e;const t=[],n=i.split(/(\r\n|\r|\n)/);for(let r=0;r=0;t--){const n=i.charCodeAt(t);if(n!==32&&n!==9)return t}return-1}function LD(i,e){return ie?1:0}function gq(i,e,t=0,n=i.length,r=0,o=e.length){for(;tc)return 1}const s=n-t,a=o-r;return sa?1:0}function J$(i,e){return kk(i,e,0,i.length,0,e.length)}function kk(i,e,t=0,n=i.length,r=0,o=e.length){for(;t=128||c>=128)return gq(i.toLowerCase(),e.toLowerCase(),t,n,r,o);zm(l)&&(l-=32),zm(c)&&(c-=32);const u=l-c;if(u!==0)return u}const s=n-t,a=o-r;return sa?1:0}function eR(i){return i>=48&&i<=57}function zm(i){return i>=97&&i<=122}function nf(i){return i>=65&&i<=90}function ey(i,e){return i.length===e.length&&kk(i,e)===0}function pq(i,e){const t=e.length;return e.length>i.length?!1:kk(i,e,0,t)===0}function zv(i,e){const t=Math.min(i.length,e.length);let n;for(n=0;n1){const n=i.charCodeAt(e-2);if(xo(n))return mq(n,t)}return t}class vq{get offset(){return this._offset}constructor(e,t=0){this._str=e,this._len=e.length,this._offset=t}setOffset(e){this._offset=e}prevCodePoint(){const e=V5e(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=zA(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class UA{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new vq(e,t)}nextGraphemeLength(){const e=Um.getInstance(),t=this._iterator,n=t.offset;let r=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){const o=t.offset,s=e.getGraphemeBreakType(t.nextCodePoint());if(Une(r,s)){t.setOffset(o);break}r=s}return t.offset-n}prevGraphemeLength(){const e=Um.getInstance(),t=this._iterator,n=t.offset;let r=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){const o=t.offset,s=e.getGraphemeBreakType(t.prevCodePoint());if(Une(s,r)){t.setOffset(o);break}r=s}return n-t.offset}eol(){return this._iterator.eol()}}function _q(i,e){return new UA(i,e).nextGraphemeLength()}function Ppe(i,e){return new UA(i,e).prevGraphemeLength()}function z5e(i,e){e>0&&Db(i.charCodeAt(e))&&e--;const t=e+_q(i,e);return[t-Ppe(i,t),t]}let Q8;function U5e(){return/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/}function xw(i){return Q8||(Q8=U5e()),Q8.test(i)}const j5e=/^[\t\n\r\x20-\x7E]*$/;function Tk(i){return j5e.test(i)}const Ope=/[\u2028\u2029]/;function Fpe(i){return Ope.test(i)}function Uv(i){return i>=11904&&i<=55215||i>=63744&&i<=64255||i>=65281&&i<=65374}function bq(i){return i>=127462&&i<=127487||i===8986||i===8987||i===9200||i===9203||i>=9728&&i<=10175||i===11088||i===11093||i>=127744&&i<=128591||i>=128640&&i<=128764||i>=128992&&i<=129008||i>=129280&&i<=129535||i>=129648&&i<=129782}const K5e=String.fromCharCode(65279);function Cq(i){return!!(i&&i.length>0&&i.charCodeAt(0)===65279)}function G5e(i,e=!1){return i?(e&&(i=i.replace(/\\./g,"")),i.toLowerCase()!==i):!1}function Bpe(i){return i=i%(2*26),i<26?String.fromCharCode(97+i):String.fromCharCode(65+i-26)}function Une(i,e){return i===0?e!==5&&e!==7:i===2&&e===3?!1:i===4||i===2||i===3||e===4||e===2||e===3?!0:!(i===8&&(e===8||e===9||e===11||e===12)||(i===11||i===9)&&(e===9||e===10)||(i===12||i===10)&&e===10||e===5||e===13||e===7||i===1||i===13&&e===14||i===6&&e===6)}class Um{static getInstance(){return Um._INSTANCE||(Um._INSTANCE=new Um),Um._INSTANCE}constructor(){this._data=q5e()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;const t=this._data,n=t.length/3;let r=1;for(;r<=n;)if(et[3*r+1])r=2*r+1;else return t[3*r+2];return 0}}Um._INSTANCE=null;function q5e(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}function X5e(i,e){if(i===0)return 0;const t=Y5e(i,e);if(t!==void 0)return t;const n=new vq(e,i);return n.prevCodePoint(),n.offset}function Y5e(i,e){const t=new vq(e,i);let n=t.prevCodePoint();for(;Z5e(n)||n===65039||n===8419;){if(t.offset===0)return;n=t.prevCodePoint()}if(!bq(n))return;let r=t.offset;return r>0&&t.prevCodePoint()===8205&&(r=t.offset),r}function Z5e(i){return 127995<=i&&i<=127999}const Wpe=" ";class Ib{static getInstance(e){return Sw.cache.get(Array.from(e))}static getLocales(){return Sw._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}getPrimaryConfusable(e){return this.confusableDictionary.get(e)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}}Sw=Ib;Ib.ambiguousCharacterData=new Qf(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],"ko":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}'));Ib.cache=new A5e(i=>{function e(c){const u=new Map;for(let d=0;d!c.startsWith("_")&&c in r);o.length===0&&(o=["_default"]);let s;for(const c of o){const u=e(r[c]);s=n(s,u)}const a=e(r._common),l=t(a,s);return new Sw(l)});Ib._locales=new Qf(()=>Object.keys(Sw.ambiguousCharacterData.value).filter(i=>!i.startsWith("_")));class Nf{static getRawData(){return JSON.parse("[9,10,11,12,13,32,127,160,173,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12288,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999]")}static getData(){return this._data||(this._data=new Set(Nf.getRawData())),this._data}static isInvisibleCharacter(e){return Nf.getData().has(e)}static get codePoints(){return Nf.getData()}}Nf._data=void 0;class eH{constructor(){this.mapWindowIdToZoomFactor=new Map}getZoomFactor(e){var t;return(t=this.mapWindowIdToZoomFactor.get(this.getWindowId(e)))!==null&&t!==void 0?t:1}getWindowId(e){return e.vscodeWindowId}}eH.INSTANCE=new eH;function $pe(i,e,t){typeof e=="string"&&(e=i.matchMedia(e)),e.addEventListener("change",t)}function Q5e(i){return eH.INSTANCE.getZoomFactor(i)}const SS=navigator.userAgent,ru=SS.indexOf("Firefox")>=0,nb=SS.indexOf("AppleWebKit")>=0,Nk=SS.indexOf("Chrome")>=0,Dp=!Nk&&SS.indexOf("Safari")>=0,Hpe=!Nk&&!Dp&&nb;SS.indexOf("Electron/")>=0;const jne=SS.indexOf("Android")>=0;let cM=!1;if(typeof hi.matchMedia=="function"){const i=hi.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=hi.matchMedia("(display-mode: fullscreen)");cM=i.matches,$pe(hi,i,({matches:t})=>{cM&&e.matches||(cM=t)})}function J5e(){return cM}const yq={clipboard:{writeText:Jd||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:Jd||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},keyboard:(()=>Jd||J5e()?0:navigator.keyboard||Dp?1:2)(),touch:"ontouchstart"in hi||navigator.maxTouchPoints>0,pointerEvents:hi.PointerEvent&&("ontouchstart"in hi||navigator.maxTouchPoints>0)};function tH(i,e){if(typeof i=="number"){if(i===0)return null;const t=(i&65535)>>>0,n=(i&4294901760)>>>16;return n!==0?new J8([tR(t,e),tR(n,e)]):new J8([tR(t,e)])}else{const t=[];for(let n=0;n{const s=e.token.onCancellationRequested(()=>{s.dispose(),o(new L_)});Promise.resolve(t).then(a=>{s.dispose(),e.dispose(),r(a)},a=>{s.dispose(),e.dispose(),o(a)})});return new class{cancel(){e.cancel(),e.dispose()}then(r,o){return n.then(r,o)}catch(r){return this.then(void 0,r)}finally(r){return n.finally(r)}}}function Rk(i,e,t){return new Promise((n,r)=>{const o=e.onCancellationRequested(()=>{o.dispose(),n(t)});i.then(n,r).finally(()=>o.dispose())})}class cBe{constructor(){this.isDisposed=!1,this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(e){if(this.isDisposed)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){const t=()=>{if(this.queuedPromise=null,this.isDisposed)return;const n=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,n};this.queuedPromise=new Promise(n=>{this.activePromise.then(t,t).then(n)})}return new Promise((t,n)=>{this.queuedPromise.then(t,n)})}return this.activePromise=e(),new Promise((t,n)=>{this.activePromise.then(r=>{this.activePromise=null,t(r)},r=>{this.activePromise=null,n(r)})})}dispose(){this.isDisposed=!0}}const uBe=(i,e)=>{let t=!0;const n=setTimeout(()=>{t=!1,e()},i);return{isTriggered:()=>t,dispose:()=>{clearTimeout(n),t=!1}}},dBe=i=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,i())}),{isTriggered:()=>e,dispose:()=>{e=!1}}};class nd{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((r,o)=>{this.doResolve=r,this.doReject=o}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const r=this.task;return this.task=null,r()}}));const n=()=>{var r;this.deferred=null,(r=this.doResolve)===null||r===void 0||r.call(this,null)};return this.deferred=t===Vpe?dBe(n):uBe(t,n),this.completionPromise}isTriggered(){var e;return!!(!((e=this.deferred)===null||e===void 0)&&e.isTriggered())}cancel(){var e;this.cancelTimeout(),this.completionPromise&&((e=this.doReject)===null||e===void 0||e.call(this,new L_),this.completionPromise=null)}cancelTimeout(){var e;(e=this.deferred)===null||e===void 0||e.dispose(),this.deferred=null}dispose(){this.cancel()}}class zpe{constructor(e){this.delayer=new nd(e),this.throttler=new cBe}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}function jv(i,e){return e?new Promise((t,n)=>{const r=setTimeout(()=>{o.dispose(),t()},i),o=e.onCancellationRequested(()=>{clearTimeout(r),o.dispose(),n(new L_)})}):Io(t=>jv(i,t))}function Kv(i,e=0,t){const n=setTimeout(()=>{i(),t&&r.dispose()},e),r=Rt(()=>{clearTimeout(n),t==null||t.deleteAndLeak(r)});return t==null||t.add(r),r}function wq(i,e=n=>!!n,t=null){let n=0;const r=i.length,o=()=>{if(n>=r)return Promise.resolve(t);const s=i[n++];return Promise.resolve(s()).then(l=>e(l)?Promise.resolve(l):o())};return o()}class cd{constructor(e,t){this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}}class Sq{constructor(){this.disposable=void 0}cancel(){var e;(e=this.disposable)===null||e===void 0||e.dispose(),this.disposable=void 0}cancelAndSet(e,t,n=globalThis){this.cancel();const r=n.setInterval(()=>{e()},t);this.disposable=Rt(()=>{n.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel()}}class pi{constructor(e,t){this.timeoutToken=-1,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==-1}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){var e;(e=this.runner)===null||e===void 0||e.call(this)}}let Upe,lE;(function(){typeof globalThis.requestIdleCallback!="function"||typeof globalThis.cancelIdleCallback!="function"?lE=(i,e)=>{upe(()=>{if(t)return;const n=Date.now()+15;e(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,n-Date.now())}}))});let t=!1;return{dispose(){t||(t=!0)}}}:lE=(i,e,t)=>{const n=i.requestIdleCallback(e,typeof t=="number"?{timeout:t}:void 0);let r=!1;return{dispose(){r||(r=!0,i.cancelIdleCallback(n))}}},Upe=i=>lE(globalThis,i)})();class jpe{constructor(e,t){this._didRun=!1,this._executor=()=>{try{this._value=t()}catch(n){this._error=n}finally{this._didRun=!0}},this._handle=lE(e,()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}}class hBe extends jpe{constructor(e){super(globalThis,e)}}class a4{get isRejected(){var e;return((e=this.outcome)===null||e===void 0?void 0:e.outcome)===1}get isSettled(){return!!this.outcome}constructor(){this.p=new Promise((e,t)=>{this.completeCallback=e,this.errorCallback=t})}complete(e){return new Promise(t=>{this.completeCallback(e),this.outcome={outcome:0,value:e},t()})}error(e){return new Promise(t=>{this.errorCallback(e),this.outcome={outcome:1,value:e},t()})}cancel(){return this.error(new L_)}}var iH;(function(i){async function e(n){let r;const o=await Promise.all(n.map(s=>s.then(a=>a,a=>{r||(r=a)})));if(typeof r<"u")throw r;return o}i.settled=e;function t(n){return new Promise(async(r,o)=>{try{await n(r,o)}catch(s){o(s)}})}i.withAsyncBody=t})(iH||(iH={}));class Kr{static fromArray(e){return new Kr(t=>{t.emitMany(e)})}static fromPromise(e){return new Kr(async t=>{t.emitMany(await e)})}static fromPromises(e){return new Kr(async t=>{await Promise.all(e.map(async n=>t.emitOne(await n)))})}static merge(e){return new Kr(async t=>{await Promise.all(e.map(async n=>{for await(const r of n)t.emitOne(r)}))})}constructor(e){this._state=0,this._results=[],this._error=null,this._onStateChanged=new se,queueMicrotask(async()=>{const t={emitOne:n=>this.emitOne(n),emitMany:n=>this.emitMany(n),reject:n=>this.reject(n)};try{await Promise.resolve(e(t)),this.resolve()}catch(n){this.reject(n)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e{for await(const r of e)n.emitOne(t(r))})}map(e){return Kr.map(this,e)}static filter(e,t){return new Kr(async n=>{for await(const r of e)t(r)&&n.emitOne(r)})}filter(e){return Kr.filter(this,e)}static coalesce(e){return Kr.filter(e,t=>!!t)}coalesce(){return Kr.coalesce(this)}static async toPromise(e){const t=[];for await(const n of e)t.push(n);return t}toPromise(){return Kr.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}}Kr.EMPTY=Kr.fromArray([]);class fBe extends Kr{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}function gBe(i){const e=new wr,t=i(e.token);return new fBe(e,async n=>{const r=e.token.onCancellationRequested(()=>{r.dispose(),e.dispose(),n.reject(new L_)});try{for await(const o of t){if(e.token.isCancellationRequested)return;n.emitOne(o)}r.dispose(),e.dispose()}catch(o){r.dispose(),e.dispose(),n.reject(o)}})}/*! @license DOMPurify 3.0.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.5/LICENSE */const{entries:Kpe,setPrototypeOf:Gne,isFrozen:pBe,getPrototypeOf:mBe,getOwnPropertyDescriptor:vBe}=Object;let{freeze:Dl,seal:uh,create:_Be}=Object,{apply:rH,construct:oH}=typeof Reflect<"u"&&Reflect;rH||(rH=function(e,t,n){return e.apply(t,n)});Dl||(Dl=function(e){return e});uh||(uh=function(e){return e});oH||(oH=function(e,t){return new e(...t)});const bBe=id(Array.prototype.forEach),qne=id(Array.prototype.pop),Ix=id(Array.prototype.push),uM=id(String.prototype.toLowerCase),e6=id(String.prototype.toString),CBe=id(String.prototype.match),Cd=id(String.prototype.replace),yBe=id(String.prototype.indexOf),wBe=id(String.prototype.trim),Mc=id(RegExp.prototype.test),kx=SBe(TypeError);function id(i){return function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r/gm),IBe=uh(/\${[\w\W]*}/gm),kBe=uh(/^data-[\-\w.\u00B7-\uFFFF]/),TBe=uh(/^aria-[\-\w]+$/),Gpe=uh(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),NBe=uh(/^(?:\w+script|data):/i),RBe=uh(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),qpe=uh(/^html$/i);var Jne=Object.freeze({__proto__:null,MUSTACHE_EXPR:EBe,ERB_EXPR:DBe,TMPLIT_EXPR:IBe,DATA_ATTR:kBe,ARIA_ATTR:TBe,IS_ALLOWED_URI:Gpe,IS_SCRIPT_OR_DATA:NBe,ATTR_WHITESPACE:RBe,DOCTYPE_NAME:qpe});const MBe=()=>typeof window>"u"?null:window,ABe=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function Xpe(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:MBe();const e=$t=>Xpe($t);if(e.version="3.0.5",e.removed=[],!i||!i.document||i.document.nodeType!==9)return e.isSupported=!1,e;const t=i.document,n=t.currentScript;let{document:r}=i;const{DocumentFragment:o,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:f}=i,g=l.prototype,p=nR(g,"cloneNode"),v=nR(g,"nextSibling"),m=nR(g,"childNodes"),_=nR(g,"parentNode");if(typeof s=="function"){const $t=r.createElement("template");$t.content&&$t.content.ownerDocument&&(r=$t.content.ownerDocument)}let y,S="";const{implementation:L,createNodeIterator:E,createDocumentFragment:D,getElementsByTagName:k}=r,{importNode:T}=t;let M={};e.isSupported=typeof Kpe=="function"&&typeof _=="function"&&L&&L.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:A,ERB_EXPR:N,TMPLIT_EXPR:R,DATA_ATTR:F,ARIA_ATTR:W,IS_SCRIPT_OR_DATA:H,ATTR_WHITESPACE:G}=Jne;let{IS_ALLOWED_URI:U}=Jne,K=null;const re=di({},[...Xne,...t6,...n6,...i6,...Yne]);let Y=null;const J=di({},[...Zne,...r6,...Qne,...iR]);let Q=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ue=null,de=null,_e=!0,ve=!0,Ve=!1,Ze=!0,We=!1,pe=!1,Pe=!1,Se=!1,Ne=!1,Me=!1,Qe=!1,Ke=!0,Re=!1;const ct="user-content-";let ie=!0,le=!1,ce={},z=null;const q=di({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let oe=null;const ne=di({},["audio","video","img","source","image","track"]);let he=null;const Le=di({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Fe="http://www.w3.org/1998/Math/MathML",ze="http://www.w3.org/2000/svg",Ue="http://www.w3.org/1999/xhtml";let nt=Ue,it=!1,at=null;const tt=di({},[Fe,ze,Ue],e6);let Zt;const Tt=["application/xhtml+xml","text/html"],xn="text/html";let rt,wt=null;const Bt=r.createElement("form"),Nt=function(we){return we instanceof RegExp||we instanceof Function},nn=function(we){if(!(wt&&wt===we)){if((!we||typeof we!="object")&&(we={}),we=KC(we),Zt=Tt.indexOf(we.PARSER_MEDIA_TYPE)===-1?Zt=xn:Zt=we.PARSER_MEDIA_TYPE,rt=Zt==="application/xhtml+xml"?e6:uM,K="ALLOWED_TAGS"in we?di({},we.ALLOWED_TAGS,rt):re,Y="ALLOWED_ATTR"in we?di({},we.ALLOWED_ATTR,rt):J,at="ALLOWED_NAMESPACES"in we?di({},we.ALLOWED_NAMESPACES,e6):tt,he="ADD_URI_SAFE_ATTR"in we?di(KC(Le),we.ADD_URI_SAFE_ATTR,rt):Le,oe="ADD_DATA_URI_TAGS"in we?di(KC(ne),we.ADD_DATA_URI_TAGS,rt):ne,z="FORBID_CONTENTS"in we?di({},we.FORBID_CONTENTS,rt):q,ue="FORBID_TAGS"in we?di({},we.FORBID_TAGS,rt):{},de="FORBID_ATTR"in we?di({},we.FORBID_ATTR,rt):{},ce="USE_PROFILES"in we?we.USE_PROFILES:!1,_e=we.ALLOW_ARIA_ATTR!==!1,ve=we.ALLOW_DATA_ATTR!==!1,Ve=we.ALLOW_UNKNOWN_PROTOCOLS||!1,Ze=we.ALLOW_SELF_CLOSE_IN_ATTR!==!1,We=we.SAFE_FOR_TEMPLATES||!1,pe=we.WHOLE_DOCUMENT||!1,Ne=we.RETURN_DOM||!1,Me=we.RETURN_DOM_FRAGMENT||!1,Qe=we.RETURN_TRUSTED_TYPE||!1,Se=we.FORCE_BODY||!1,Ke=we.SANITIZE_DOM!==!1,Re=we.SANITIZE_NAMED_PROPS||!1,ie=we.KEEP_CONTENT!==!1,le=we.IN_PLACE||!1,U=we.ALLOWED_URI_REGEXP||Gpe,nt=we.NAMESPACE||Ue,Q=we.CUSTOM_ELEMENT_HANDLING||{},we.CUSTOM_ELEMENT_HANDLING&&Nt(we.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Q.tagNameCheck=we.CUSTOM_ELEMENT_HANDLING.tagNameCheck),we.CUSTOM_ELEMENT_HANDLING&&Nt(we.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Q.attributeNameCheck=we.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),we.CUSTOM_ELEMENT_HANDLING&&typeof we.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Q.allowCustomizedBuiltInElements=we.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),We&&(ve=!1),Me&&(Ne=!0),ce&&(K=di({},[...Yne]),Y=[],ce.html===!0&&(di(K,Xne),di(Y,Zne)),ce.svg===!0&&(di(K,t6),di(Y,r6),di(Y,iR)),ce.svgFilters===!0&&(di(K,n6),di(Y,r6),di(Y,iR)),ce.mathMl===!0&&(di(K,i6),di(Y,Qne),di(Y,iR))),we.ADD_TAGS&&(K===re&&(K=KC(K)),di(K,we.ADD_TAGS,rt)),we.ADD_ATTR&&(Y===J&&(Y=KC(Y)),di(Y,we.ADD_ATTR,rt)),we.ADD_URI_SAFE_ATTR&&di(he,we.ADD_URI_SAFE_ATTR,rt),we.FORBID_CONTENTS&&(z===q&&(z=KC(z)),di(z,we.FORBID_CONTENTS,rt)),ie&&(K["#text"]=!0),pe&&di(K,["html","head","body"]),K.table&&(di(K,["tbody"]),delete ue.tbody),we.TRUSTED_TYPES_POLICY){if(typeof we.TRUSTED_TYPES_POLICY.createHTML!="function")throw kx('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof we.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw kx('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=we.TRUSTED_TYPES_POLICY,S=y.createHTML("")}else y===void 0&&(y=ABe(f,n)),y!==null&&typeof S=="string"&&(S=y.createHTML(""));Dl&&Dl(we),wt=we}},Mn=di({},["mi","mo","mn","ms","mtext"]),zt=di({},["foreignobject","desc","title","annotation-xml"]),Qt=di({},["title","style","font","a","script"]),lt=di({},t6);di(lt,n6),di(lt,xBe);const ut=di({},i6);di(ut,LBe);const dt=function(we){let bt=_(we);(!bt||!bt.tagName)&&(bt={namespaceURI:nt,tagName:"template"});const xt=uM(we.tagName),Gn=uM(bt.tagName);return at[we.namespaceURI]?we.namespaceURI===ze?bt.namespaceURI===Ue?xt==="svg":bt.namespaceURI===Fe?xt==="svg"&&(Gn==="annotation-xml"||Mn[Gn]):!!lt[xt]:we.namespaceURI===Fe?bt.namespaceURI===Ue?xt==="math":bt.namespaceURI===ze?xt==="math"&&zt[Gn]:!!ut[xt]:we.namespaceURI===Ue?bt.namespaceURI===ze&&!zt[Gn]||bt.namespaceURI===Fe&&!Mn[Gn]?!1:!ut[xt]&&(Qt[xt]||!lt[xt]):!!(Zt==="application/xhtml+xml"&&at[we.namespaceURI]):!1},Mt=function(we){Ix(e.removed,{element:we});try{we.parentNode.removeChild(we)}catch{we.remove()}},Kt=function(we,bt){try{Ix(e.removed,{attribute:bt.getAttributeNode(we),from:bt})}catch{Ix(e.removed,{attribute:null,from:bt})}if(bt.removeAttribute(we),we==="is"&&!Y[we])if(Ne||Me)try{Mt(bt)}catch{}else try{bt.setAttribute(we,"")}catch{}},mn=function(we){let bt,xt;if(Se)we=""+we;else{const Vr=CBe(we,/^[\r\n\t ]+/);xt=Vr&&Vr[0]}Zt==="application/xhtml+xml"&&nt===Ue&&(we=''+we+"");const Gn=y?y.createHTML(we):we;if(nt===Ue)try{bt=new h().parseFromString(Gn,Zt)}catch{}if(!bt||!bt.documentElement){bt=L.createDocument(nt,"template",null);try{bt.documentElement.innerHTML=it?S:Gn}catch{}}const cr=bt.body||bt.documentElement;return we&&xt&&cr.insertBefore(r.createTextNode(xt),cr.childNodes[0]||null),nt===Ue?k.call(bt,pe?"html":"body")[0]:pe?bt.documentElement:cr},lr=function(we){return E.call(we.ownerDocument||we,we,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},nr=function(we){return we instanceof d&&(typeof we.nodeName!="string"||typeof we.textContent!="string"||typeof we.removeChild!="function"||!(we.attributes instanceof u)||typeof we.removeAttribute!="function"||typeof we.setAttribute!="function"||typeof we.namespaceURI!="string"||typeof we.insertBefore!="function"||typeof we.hasChildNodes!="function")},Hr=function(we){return typeof a=="object"?we instanceof a:we&&typeof we=="object"&&typeof we.nodeType=="number"&&typeof we.nodeName=="string"},Jn=function(we,bt,xt){M[we]&&bBe(M[we],Gn=>{Gn.call(e,bt,xt,wt)})},Ii=function(we){let bt;if(Jn("beforeSanitizeElements",we,null),nr(we))return Mt(we),!0;const xt=rt(we.nodeName);if(Jn("uponSanitizeElement",we,{tagName:xt,allowedTags:K}),we.hasChildNodes()&&!Hr(we.firstElementChild)&&(!Hr(we.content)||!Hr(we.content.firstElementChild))&&Mc(/<[/\w]/g,we.innerHTML)&&Mc(/<[/\w]/g,we.textContent))return Mt(we),!0;if(!K[xt]||ue[xt]){if(!ue[xt]&&No(xt)&&(Q.tagNameCheck instanceof RegExp&&Mc(Q.tagNameCheck,xt)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(xt)))return!1;if(ie&&!z[xt]){const Gn=_(we)||we.parentNode,cr=m(we)||we.childNodes;if(cr&&Gn){const Vr=cr.length;for(let ei=Vr-1;ei>=0;--ei)Gn.insertBefore(p(cr[ei],!0),v(we))}}return Mt(we),!0}return we instanceof l&&!dt(we)||(xt==="noscript"||xt==="noembed"||xt==="noframes")&&Mc(/<\/no(script|embed|frames)/i,we.innerHTML)?(Mt(we),!0):(We&&we.nodeType===3&&(bt=we.textContent,bt=Cd(bt,A," "),bt=Cd(bt,N," "),bt=Cd(bt,R," "),we.textContent!==bt&&(Ix(e.removed,{element:we.cloneNode()}),we.textContent=bt)),Jn("afterSanitizeElements",we,null),!1)},_o=function(we,bt,xt){if(Ke&&(bt==="id"||bt==="name")&&(xt in r||xt in Bt))return!1;if(!(ve&&!de[bt]&&Mc(F,bt))){if(!(_e&&Mc(W,bt))){if(!Y[bt]||de[bt]){if(!(No(we)&&(Q.tagNameCheck instanceof RegExp&&Mc(Q.tagNameCheck,we)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(we))&&(Q.attributeNameCheck instanceof RegExp&&Mc(Q.attributeNameCheck,bt)||Q.attributeNameCheck instanceof Function&&Q.attributeNameCheck(bt))||bt==="is"&&Q.allowCustomizedBuiltInElements&&(Q.tagNameCheck instanceof RegExp&&Mc(Q.tagNameCheck,xt)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(xt))))return!1}else if(!he[bt]){if(!Mc(U,Cd(xt,G,""))){if(!((bt==="src"||bt==="xlink:href"||bt==="href")&&we!=="script"&&yBe(xt,"data:")===0&&oe[we])){if(!(Ve&&!Mc(H,Cd(xt,G,"")))){if(xt)return!1}}}}}}return!0},No=function(we){return we.indexOf("-")>0},bs=function(we){let bt,xt,Gn,cr;Jn("beforeSanitizeAttributes",we,null);const{attributes:Vr}=we;if(!Vr)return;const ei={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Y};for(cr=Vr.length;cr--;){bt=Vr[cr];const{name:Qr,namespaceURI:Fs}=bt;if(xt=Qr==="value"?bt.value:wBe(bt.value),Gn=rt(Qr),ei.attrName=Gn,ei.attrValue=xt,ei.keepAttr=!0,ei.forceKeepAttr=void 0,Jn("uponSanitizeAttribute",we,ei),xt=ei.attrValue,ei.forceKeepAttr||(Kt(Qr,we),!ei.keepAttr))continue;if(!Ze&&Mc(/\/>/i,xt)){Kt(Qr,we);continue}We&&(xt=Cd(xt,A," "),xt=Cd(xt,N," "),xt=Cd(xt,R," "));const Fl=rt(we.nodeName);if(_o(Fl,Gn,xt)){if(Re&&(Gn==="id"||Gn==="name")&&(Kt(Qr,we),xt=ct+xt),y&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!Fs)switch(f.getAttributeType(Fl,Gn)){case"TrustedHTML":{xt=y.createHTML(xt);break}case"TrustedScriptURL":{xt=y.createScriptURL(xt);break}}try{Fs?we.setAttributeNS(Fs,Qr,xt):we.setAttribute(Qr,xt),qne(e.removed)}catch{}}}Jn("afterSanitizeAttributes",we,null)},Cs=function $t(we){let bt;const xt=lr(we);for(Jn("beforeSanitizeShadowDOM",we,null);bt=xt.nextNode();)Jn("uponSanitizeShadowNode",bt,null),!Ii(bt)&&(bt.content instanceof o&&$t(bt.content),bs(bt));Jn("afterSanitizeShadowDOM",we,null)};return e.sanitize=function($t){let we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},bt,xt,Gn,cr;if(it=!$t,it&&($t=""),typeof $t!="string"&&!Hr($t))if(typeof $t.toString=="function"){if($t=$t.toString(),typeof $t!="string")throw kx("dirty is not a string, aborting")}else throw kx("toString is not a function");if(!e.isSupported)return $t;if(Pe||nn(we),e.removed=[],typeof $t=="string"&&(le=!1),le){if($t.nodeName){const Qr=rt($t.nodeName);if(!K[Qr]||ue[Qr])throw kx("root node is forbidden and cannot be sanitized in-place")}}else if($t instanceof a)bt=mn(""),xt=bt.ownerDocument.importNode($t,!0),xt.nodeType===1&&xt.nodeName==="BODY"||xt.nodeName==="HTML"?bt=xt:bt.appendChild(xt);else{if(!Ne&&!We&&!pe&&$t.indexOf("<")===-1)return y&&Qe?y.createHTML($t):$t;if(bt=mn($t),!bt)return Ne?null:Qe?S:""}bt&&Se&&Mt(bt.firstChild);const Vr=lr(le?$t:bt);for(;Gn=Vr.nextNode();)Ii(Gn)||(Gn.content instanceof o&&Cs(Gn.content),bs(Gn));if(le)return $t;if(Ne){if(Me)for(cr=D.call(bt.ownerDocument);bt.firstChild;)cr.appendChild(bt.firstChild);else cr=bt;return(Y.shadowroot||Y.shadowrootmode)&&(cr=T.call(t,cr,!0)),cr}let ei=pe?bt.outerHTML:bt.innerHTML;return pe&&K["!doctype"]&&bt.ownerDocument&&bt.ownerDocument.doctype&&bt.ownerDocument.doctype.name&&Mc(qpe,bt.ownerDocument.doctype.name)&&(ei=" -`+ei),We&&(ei=Cd(ei,A," "),ei=Cd(ei,N," "),ei=Cd(ei,R," ")),y&&Qe?y.createHTML(ei):ei},e.setConfig=function($t){nn($t),Pe=!0},e.clearConfig=function(){wt=null,Pe=!1},e.isValidAttribute=function($t,we,bt){wt||nn({});const xt=rt($t),Gn=rt(we);return _o(xt,Gn,bt)},e.addHook=function($t,we){typeof we=="function"&&(M[$t]=M[$t]||[],Ix(M[$t],we))},e.removeHook=function($t){if(M[$t])return qne(M[$t])},e.removeHooks=function($t){M[$t]&&(M[$t]=[])},e.removeAllHooks=function(){M={}},e}var eg=Xpe();eg.version;eg.isSupported;const Ype=eg.sanitize;eg.setConfig;eg.clearConfig;eg.isValidAttribute;const sH=eg.addHook,Zpe=eg.removeHook;eg.removeHooks;eg.removeAllHooks;var an;(function(i){i.inMemory="inmemory",i.vscode="vscode",i.internal="private",i.walkThrough="walkThrough",i.walkThroughSnippet="walkThroughSnippet",i.http="http",i.https="https",i.file="file",i.mailto="mailto",i.untitled="untitled",i.data="data",i.command="command",i.vscodeRemote="vscode-remote",i.vscodeRemoteResource="vscode-remote-resource",i.vscodeManagedRemoteResource="vscode-managed-remote-resource",i.vscodeUserData="vscode-userdata",i.vscodeCustomEditor="vscode-custom-editor",i.vscodeNotebookCell="vscode-notebook-cell",i.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",i.vscodeNotebookCellOutput="vscode-notebook-cell-output",i.vscodeInteractiveInput="vscode-interactive-input",i.vscodeSettings="vscode-settings",i.vscodeWorkspaceTrust="vscode-workspace-trust",i.vscodeTerminal="vscode-terminal",i.vscodeChatCodeBlock="vscode-chat-code-block",i.vscodeChatSesssion="vscode-chat-editor",i.webviewPanel="webview-panel",i.vscodeWebview="vscode-webview",i.extension="extension",i.vscodeFileResource="vscode-file",i.tmp="tmp",i.vsls="vsls",i.vscodeSourceControl="vscode-scm",i.codeSetting="code-setting",i.codeFeature="code-feature"})(an||(an={}));function xq(i,e){return At.isUri(i)?ey(i.scheme,e):pq(i,e+":")}function eie(i,...e){return e.some(t=>xq(i,t))}const PBe="tkn";class OBe{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._remoteResourcesPath=`/${an.vscodeRemoteResource}`}setPreferredWebSchema(e){this._preferredWebSchema=e}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return en(a),e}const t=e.authority;let n=this._hosts[t];n&&n.indexOf(":")!==-1&&n.indexOf("[")===-1&&(n=`[${n}]`);const r=this._ports[t],o=this._connectionTokens[t];let s=`path=${encodeURIComponent(e.path)}`;return typeof o=="string"&&(s+=`&${PBe}=${encodeURIComponent(o)}`),At.from({scheme:x_?this._preferredWebSchema:an.vscodeRemoteResource,authority:`${n}:${r}`,path:this._remoteResourcesPath,query:s})}}const Qpe=new OBe,FBe="vscode-app";class ED{uriToBrowserUri(e){return e.scheme===an.vscodeRemote?Qpe.rewrite(e):e.scheme===an.file&&(Jd||X4e===`${an.vscodeFileResource}://${ED.FALLBACK_AUTHORITY}`)?e.with({scheme:an.vscodeFileResource,authority:e.authority||ED.FALLBACK_AUTHORITY,query:null,fragment:null}):e}}ED.FALLBACK_AUTHORITY=FBe;const Jpe=new ED;var tie;(function(i){const e=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);i.CoopAndCoep=Object.freeze(e.get("3"));const t="vscode-coi";function n(o){let s;typeof o=="string"?s=new URL(o).searchParams:o instanceof URL?s=o.searchParams:At.isUri(o)&&(s=new URL(o.toString(!0)).searchParams);const a=s==null?void 0:s.get(t);if(a)return e.get(a)}i.getHeadersFromQuery=n;function r(o,s,a){if(!globalThis.crossOriginIsolated)return;const l=s&&a?"3":a?"2":"1";o instanceof URLSearchParams?o.set(t,l):o[t]=l}i.addSearchParam=r})(tie||(tie={}));function l4(i){return c4(i,0)}function c4(i,e){switch(typeof i){case"object":return i===null?Gg(349,e):Array.isArray(i)?WBe(i,e):$Be(i,e);case"string":return Lq(i,e);case"boolean":return BBe(i,e);case"number":return Gg(i,e);case"undefined":return Gg(937,e);default:return Gg(617,e)}}function Gg(i,e){return(e<<5)-e+i|0}function BBe(i,e){return Gg(i?433:863,e)}function Lq(i,e){e=Gg(149417,e);for(let t=0,n=i.length;tc4(n,t),e)}function $Be(i,e){return e=Gg(181387,e),Object.keys(i).sort().reduce((t,n)=>(t=Lq(n,t),c4(i[n],t)),e)}function o6(i,e,t=32){const n=t-e,r=~((1<>>n)>>>0}function nie(i,e=0,t=i.byteLength,n=0){for(let r=0;rt.toString(16).padStart(2,"0")).join(""):HBe((i>>>0).toString(16),e/4)}class u4{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(64+3),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(t===0)return;const n=this._buff;let r=this._buffLen,o=this._leftoverHighSurrogate,s,a;for(o!==0?(s=o,a=-1,o=0):(s=e.charCodeAt(0),a=0);;){let l=s;if(xo(s))if(a+1>>6,e[t++]=128|(n&63)>>>0):n<65536?(e[t++]=224|(n&61440)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0):(e[t++]=240|(n&1835008)>>>18,e[t++]=128|(n&258048)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64+0],e[1]=e[64+1],e[2]=e[64+2]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),Tx(this._h0)+Tx(this._h1)+Tx(this._h2)+Tx(this._h3)+Tx(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,nie(this._buff,this._buffLen),this._buffLen>56&&(this._step(),nie(this._buff));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const e=u4._bigBlock32,t=this._buffDV;for(let d=0;d<64;d+=4)e.setUint32(d,t.getUint32(d,!1),!1);for(let d=64;d<320;d+=4)e.setUint32(d,o6(e.getUint32(d-12,!1)^e.getUint32(d-32,!1)^e.getUint32(d-56,!1)^e.getUint32(d-64,!1),1),!1);let n=this._h0,r=this._h1,o=this._h2,s=this._h3,a=this._h4,l,c,u;for(let d=0;d<80;d++)d<20?(l=r&o|~r&s,c=1518500249):d<40?(l=r^o^s,c=1859775393):d<60?(l=r&o|r&s|o&s,c=2400959708):(l=r^o^s,c=3395469782),u=o6(n,5)+l+a+c+e.getUint32(d*4,!1)&4294967295,a=s,s=o,o=o6(r,30),r=n,n=u;this._h0=this._h0+n&4294967295,this._h1=this._h1+r&4294967295,this._h2=this._h2+o&4294967295,this._h3=this._h3+s&4294967295,this._h4=this._h4+a&4294967295}}u4._bigBlock32=new DataView(new ArrayBuffer(320));const{registerWindow:nRt,getWindow:Pt,getDocument:iRt,getWindows:eme,getWindowsCount:VBe,getWindowId:jA,getWindowById:iie,hasWindow:rRt,onDidRegisterWindow:d4,onWillUnregisterWindow:zBe,onDidUnregisterWindow:UBe}=function(){const i=new Map;R5e(hi,1);const e={window:hi,disposables:new Te};i.set(hi.vscodeWindowId,e);const t=new se,n=new se,r=new se;function o(s,a){const l=typeof s=="number"?i.get(s):void 0;return l??(a?e:void 0)}return{onDidRegisterWindow:t.event,onWillUnregisterWindow:r.event,onDidUnregisterWindow:n.event,registerWindow(s){if(i.has(s.vscodeWindowId))return fe.None;const a=new Te,l={window:s,disposables:a.add(new Te)};return i.set(s.vscodeWindowId,l),a.add(Rt(()=>{i.delete(s.vscodeWindowId),n.fire(s)})),a.add(ye(s,Ge.BEFORE_UNLOAD,()=>{r.fire(s)})),t.fire(l),a},getWindows(){return i.values()},getWindowsCount(){return i.size},getWindowId(s){return s.vscodeWindowId},hasWindow(s){return i.has(s)},getWindowById:o,getWindow(s){var a;const l=s;if(!((a=l==null?void 0:l.ownerDocument)===null||a===void 0)&&a.defaultView)return l.ownerDocument.defaultView.window;const c=s;return c!=null&&c.view?c.view.window:hi},getDocument(s){return Pt(s).document}}}();function Ns(i){for(;i.firstChild;)i.firstChild.remove()}class jBe{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,this._options=r||!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 ye(i,e,t,n){return new jBe(i,e,t,n)}function tme(i,e){return function(t){return e(new Uu(i,t))}}function KBe(i){return function(e){return i(new Ai(e))}}const Sr=function(e,t,n,r){let o=n;return t==="click"||t==="mousedown"?o=tme(Pt(e),n):(t==="keydown"||t==="keypress"||t==="keyup")&&(o=KBe(n)),ye(e,t,o,r)},GBe=function(e,t,n){const r=tme(Pt(e),t);return qBe(e,r,n)};function qBe(i,e,t){return ye(i,ch&&yq.pointerEvents?Ge.POINTER_DOWN:Ge.MOUSE_DOWN,e,t)}function yL(i,e,t){return lE(i,e,t)}class s6 extends jpe{constructor(e,t){super(e,t)}}let KA,Il;class Eq extends Sq{constructor(e){super(),this.defaultTarget=e&&Pt(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}}class a6{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){en(e)}}static sort(e,t){return t.priority-e.priority}}(function(){const i=new Map,e=new Map,t=new Map,n=new Map,r=o=>{var s;t.set(o,!1);const a=(s=i.get(o))!==null&&s!==void 0?s:[];for(e.set(o,a),i.set(o,[]),n.set(o,!0);a.length>0;)a.sort(a6.sort),a.shift().execute();n.set(o,!1)};Il=(o,s,a=0)=>{const l=jA(o),c=new a6(s,a);let u=i.get(l);return u||(u=[],i.set(l,u)),u.push(c),t.get(l)||(t.set(l,!0),o.requestAnimationFrame(()=>r(l))),c},KA=(o,s,a)=>{const l=jA(o);if(n.get(l)){const c=new a6(s,a);let u=e.get(l);return u||(u=[],e.set(l,u)),u.push(c),c}else return Il(o,s,a)}})();function h4(i){return Pt(i).getComputedStyle(i,null)}function kp(i,e){const t=Pt(i),n=t.document;if(i!==n.body)return new Kn(i.clientWidth,i.clientHeight);if(ch&&(t!=null&&t.visualViewport))return new Kn(t.visualViewport.width,t.visualViewport.height);if(t!=null&&t.innerWidth&&t.innerHeight)return new Kn(t.innerWidth,t.innerHeight);if(n.body&&n.body.clientWidth&&n.body.clientHeight)return new Kn(n.body.clientWidth,n.body.clientHeight);if(n.documentElement&&n.documentElement.clientWidth&&n.documentElement.clientHeight)return new Kn(n.documentElement.clientWidth,n.documentElement.clientHeight);if(e)return kp(e);throw new Error("Unable to figure out browser width and height")}class Ir{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,n){const r=h4(e),o=r?r.getPropertyValue(t):"0";return Ir.convertToPixels(e,o)}static getBorderLeftWidth(e){return Ir.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return Ir.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return Ir.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return Ir.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return Ir.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return Ir.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return Ir.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return Ir.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return Ir.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return Ir.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return Ir.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return Ir.getDimension(e,"margin-bottom","marginBottom")}}class Kn{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new Kn(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof Kn?e:new Kn(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}}Kn.None=new Kn(0,0);function nme(i){let e=i.offsetParent,t=i.offsetTop,n=i.offsetLeft;for(;(i=i.parentNode)!==null&&i!==i.ownerDocument.body&&i!==i.ownerDocument.documentElement;){t-=i.scrollTop;const r=rme(i)?null:h4(i);r&&(n-=r.direction!=="rtl"?i.scrollLeft:-i.scrollLeft),i===e&&(n+=Ir.getBorderLeftWidth(i),t+=Ir.getBorderTopWidth(i),t+=i.offsetTop,n+=i.offsetLeft,e=i.offsetParent)}return{left:n,top:t}}function XBe(i,e,t){typeof e=="number"&&(i.style.width=`${e}px`),typeof t=="number"&&(i.style.height=`${t}px`)}function Br(i){const e=i.getBoundingClientRect(),t=Pt(i);return{left:e.left+t.scrollX,top:e.top+t.scrollY,width:e.width,height:e.height}}function ime(i){let e=i,t=1;do{const n=h4(e).zoom;n!=null&&n!=="1"&&(t*=n),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function ua(i){const e=Ir.getMarginLeft(i)+Ir.getMarginRight(i);return i.offsetWidth+e}function l6(i){const e=Ir.getBorderLeftWidth(i)+Ir.getBorderRightWidth(i),t=Ir.getPaddingLeft(i)+Ir.getPaddingRight(i);return i.offsetWidth-e-t}function YBe(i){const e=Ir.getBorderTopWidth(i)+Ir.getBorderBottomWidth(i),t=Ir.getPaddingTop(i)+Ir.getPaddingBottom(i);return i.offsetHeight-e-t}function qg(i){const e=Ir.getMarginTop(i)+Ir.getMarginBottom(i);return i.offsetHeight+e}function es(i,e){return!!(e!=null&&e.contains(i))}function ZBe(i,e,t){for(;i&&i.nodeType===i.ELEMENT_NODE;){if(i.classList.contains(e))return i;if(t){if(typeof t=="string"){if(i.classList.contains(t))return null}else if(i===t)return null}i=i.parentNode}return null}function c6(i,e,t){return!!ZBe(i,e,t)}function rme(i){return i&&!!i.host&&!!i.mode}function GA(i){return!!Tb(i)}function Tb(i){for(var e;i.parentNode;){if(i===((e=i.ownerDocument)===null||e===void 0?void 0:e.body))return null;i=i.parentNode}return rme(i)?i:null}function fs(){let i=xS().activeElement;for(;i!=null&&i.shadowRoot;)i=i.shadowRoot.activeElement;return i}function Mk(i){return fs()===i}function ome(i){return es(fs(),i)}function xS(){var i;return VBe()<=1?hi.document:(i=Array.from(eme()).map(({window:t})=>t.document).find(t=>t.hasFocus()))!==null&&i!==void 0?i:hi.document}function QBe(){var i,e;return(e=(i=xS().defaultView)===null||i===void 0?void 0:i.window)!==null&&e!==void 0?e:hi}const Dq=new Map;function sme(){return new JBe}class JBe{constructor(){this._currentCssStyle="",this._styleSheet=void 0}setStyle(e){e!==this._currentCssStyle&&(this._currentCssStyle=e,this._styleSheet?this._styleSheet.innerText=e:this._styleSheet=gc(hi.document.head,t=>t.innerText=e))}dispose(){this._styleSheet&&(this._styleSheet.remove(),this._styleSheet=void 0)}}function gc(i=hi.document.head,e,t){const n=document.createElement("style");if(n.type="text/css",n.media="screen",e==null||e(n),i.appendChild(n),t&&t.add(Rt(()=>i.removeChild(n))),i===hi.document.head){const r=new Set;Dq.set(n,r);for(const{window:o,disposables:s}of eme()){if(o===hi)continue;const a=s.add(e8e(n,r,o));t==null||t.add(a)}}return n}function e8e(i,e,t){var n,r;const o=new Te,s=i.cloneNode(!0);t.document.head.appendChild(s),o.add(Rt(()=>t.document.head.removeChild(s)));for(const a of lme(i))(n=s.sheet)===null||n===void 0||n.insertRule(a.cssText,(r=s.sheet)===null||r===void 0?void 0:r.cssRules.length);return o.add(t8e.observe(i,o,{childList:!0})(()=>{s.textContent=i.textContent})),e.add(s),o.add(Rt(()=>e.delete(s))),o}const t8e=new class{constructor(){this.mutationObservers=new Map}observe(i,e,t){let n=this.mutationObservers.get(i);n||(n=new Map,this.mutationObservers.set(i,n));const r=l4(t);let o=n.get(r);if(o)o.users+=1;else{const s=new se,a=new MutationObserver(c=>s.fire(c));a.observe(i,t);const l=o={users:1,observer:a,onDidMutate:s.event};e.add(Rt(()=>{l.users-=1,l.users===0&&(s.dispose(),a.disconnect(),n==null||n.delete(r),(n==null?void 0:n.size)===0&&this.mutationObservers.delete(i))})),n.set(r,o)}return o.onDidMutate}};let u6=null;function ame(){return u6||(u6=gc()),u6}function lme(i){var e,t;return!((e=i==null?void 0:i.sheet)===null||e===void 0)&&e.rules?i.sheet.rules:!((t=i==null?void 0:i.sheet)===null||t===void 0)&&t.cssRules?i.sheet.cssRules:[]}function qA(i,e,t=ame()){var n,r;if(!(!t||!e)){(n=t.sheet)===null||n===void 0||n.insertRule(`${i} {${e}}`,0);for(const o of(r=Dq.get(t))!==null&&r!==void 0?r:[])qA(i,e,o)}}function aH(i,e=ame()){var t,n;if(!e)return;const r=lme(e),o=[];for(let s=0;s=0;s--)(t=e.sheet)===null||t===void 0||t.deleteRule(o[s]);for(const s of(n=Dq.get(e))!==null&&n!==void 0?n:[])aH(i,s)}function n8e(i){return typeof i.selectorText=="string"}function Iq(i){return i instanceof MouseEvent||i instanceof Pt(i).MouseEvent}function kq(i){return i instanceof KeyboardEvent||i instanceof Pt(i).KeyboardEvent}const Ge={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",PASTE:"paste",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:nb?"webkitAnimationStart":"animationstart",ANIMATION_END:nb?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:nb?"webkitAnimationIteration":"animationiteration"};function i8e(i){const e=i;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const hn={stop:(i,e)=>(i.preventDefault(),e&&i.stopPropagation(),i)};function r8e(i){const e=[];for(let t=0;i&&i.nodeType===i.ELEMENT_NODE;t++)e[t]=i.scrollTop,i=i.parentNode;return e}function o8e(i,e){for(let t=0;i&&i.nodeType===i.ELEMENT_NODE;t++)i.scrollTop!==e[t]&&(i.scrollTop=e[t]),i=i.parentNode}class XA extends fe{static hasFocusWithin(e){if(e instanceof HTMLElement){const t=Tb(e),n=t?t.activeElement:e.ownerDocument.activeElement;return es(n,e)}else{const t=e;return es(t.document.activeElement,t.document)}}constructor(e){super(),this._onDidFocus=this._register(new se),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new se),this.onDidBlur=this._onDidBlur.event;let t=XA.hasFocusWithin(e),n=!1;const r=()=>{n=!1,t||(t=!0,this._onDidFocus.fire())},o=()=>{t&&(n=!0,(e instanceof HTMLElement?Pt(e):e).setTimeout(()=>{n&&(n=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{XA.hasFocusWithin(e)!==t&&(t?o():r())},this._register(ye(e,Ge.FOCUS,r,!0)),this._register(ye(e,Ge.BLUR,o,!0)),e instanceof HTMLElement&&(this._register(ye(e,Ge.FOCUS_IN,()=>this._refreshStateHandler())),this._register(ye(e,Ge.FOCUS_OUT,()=>this._refreshStateHandler())))}}function dh(i){return new XA(i)}function s8e(i,e){return i.after(e),e}function ke(i,...e){if(i.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function Tq(i,e){return i.insertBefore(e,i.firstChild),e}function gs(i,...e){i.innerText="",ke(i,...e)}const a8e=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var DD;(function(i){i.HTML="http://www.w3.org/1999/xhtml",i.SVG="http://www.w3.org/2000/svg"})(DD||(DD={}));function cme(i,e,t,...n){const r=a8e.exec(e);if(!r)throw new Error("Bad use of emmet");const o=r[1]||"div";let s;return i!==DD.HTML?s=document.createElementNS(i,o):s=document.createElement(o),r[3]&&(s.id=r[3]),r[4]&&(s.className=r[4].replace(/\./g," ").trim()),t&&Object.entries(t).forEach(([a,l])=>{typeof l>"u"||(/^on\w+$/.test(a)?s[a]=l:a==="selected"?l&&s.setAttribute(a,"true"):s.setAttribute(a,l))}),s.append(...n),s}function He(i,e,...t){return cme(DD.HTML,i,e,...t)}He.SVG=function(i,e,...t){return cme(DD.SVG,i,e,...t)};function l8e(i,...e){i?bl(...e):fa(...e)}function bl(...i){for(const e of i)e.style.display="",e.removeAttribute("aria-hidden")}function fa(...i){for(const e of i)e.style.display="none",e.setAttribute("aria-hidden","true")}function rie(i,e){const t=i.devicePixelRatio*e;return Math.max(1,Math.floor(t))/i.devicePixelRatio}function ume(i){hi.open(i,"_blank","noopener")}function c8e(i,e){const t=()=>{e(),n=Il(i,t)};let n=Il(i,t);return Rt(()=>n.dispose())}Qpe.setPreferredWebSchema(/^https:/.test(hi.location.href)?"https":"http");function Gv(i){return i?`url('${Jpe.uriToBrowserUri(i).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function oie(i){return`'${i.replace(/'/g,"%27")}'`}function gp(i,e){if(i!==void 0){const t=i.match(/^\s*var\((.+)\)$/);if(t){const n=t[1].split(",",2);return n.length===2&&(e=gp(n[1].trim(),e)),`var(${n[0]}, ${e})`}return i}return e}function u8e(i,e=!1){const t=document.createElement("a");return sH("afterSanitizeAttributes",n=>{for(const r of["href","src"])if(n.hasAttribute(r)){const o=n.getAttribute(r);if(r==="href"&&o.startsWith("#"))continue;if(t.href=o,!i.includes(t.protocol.replace(/:$/,""))){if(e&&r==="src"&&t.href.startsWith("data:"))continue;n.removeAttribute(r)}}}),Rt(()=>{Zpe("afterSanitizeAttributes")})}const d8e=Object.freeze(["a","abbr","b","bdo","blockquote","br","caption","cite","code","col","colgroup","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","label","li","mark","ol","p","pre","q","rp","rt","ruby","samp","small","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","time","tr","tt","u","ul","var","video","wbr"]);class Xg extends se{constructor(){super(),this._subscriptions=new Te,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(Je.runAndSubscribe(d4,({window:e,disposables:t})=>this.registerListeners(e,t),{window:hi,disposables:this._subscriptions}))}registerListeners(e,t){t.add(ye(e,"keydown",n=>{if(n.defaultPrevented)return;const r=new Ai(n);if(!(r.keyCode===6&&n.repeat)){if(n.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(n.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(n.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(n.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else if(r.keyCode!==6)this._keyStatus.lastKeyPressed=void 0;else return;this._keyStatus.altKey=n.altKey,this._keyStatus.ctrlKey=n.ctrlKey,this._keyStatus.metaKey=n.metaKey,this._keyStatus.shiftKey=n.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=n,this.fire(this._keyStatus))}},!0)),t.add(ye(e,"keyup",n=>{n.defaultPrevented||(!n.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!n.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!n.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!n.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=n.altKey,this._keyStatus.ctrlKey=n.ctrlKey,this._keyStatus.metaKey=n.metaKey,this._keyStatus.shiftKey=n.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=n,this.fire(this._keyStatus)))},!0)),t.add(ye(e.document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(ye(e.document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(ye(e.document.body,"mousemove",n=>{n.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),t.add(ye(e,"blur",()=>{this.resetKeyStatus()}))}get keyStatus(){return this._keyStatus}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return Xg.instance||(Xg.instance=new Xg),Xg.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class h8e extends fe{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this.callbacks.onDragStart&&this._register(ye(this.element,Ge.DRAG_START,e=>{var t,n;(n=(t=this.callbacks).onDragStart)===null||n===void 0||n.call(t,e)})),this.callbacks.onDrag&&this._register(ye(this.element,Ge.DRAG,e=>{var t,n;(n=(t=this.callbacks).onDrag)===null||n===void 0||n.call(t,e)})),this._register(ye(this.element,Ge.DRAG_ENTER,e=>{var t,n;this.counter++,this.dragStartTime=e.timeStamp,(n=(t=this.callbacks).onDragEnter)===null||n===void 0||n.call(t,e)})),this._register(ye(this.element,Ge.DRAG_OVER,e=>{var t,n;e.preventDefault(),(n=(t=this.callbacks).onDragOver)===null||n===void 0||n.call(t,e,e.timeStamp-this.dragStartTime)})),this._register(ye(this.element,Ge.DRAG_LEAVE,e=>{var t,n;this.counter--,this.counter===0&&(this.dragStartTime=0,(n=(t=this.callbacks).onDragLeave)===null||n===void 0||n.call(t,e))})),this._register(ye(this.element,Ge.DRAG_END,e=>{var t,n;this.counter=0,this.dragStartTime=0,(n=(t=this.callbacks).onDragEnd)===null||n===void 0||n.call(t,e)})),this._register(ye(this.element,Ge.DROP,e=>{var t,n;this.counter=0,this.dragStartTime=0,(n=(t=this.callbacks).onDrop)===null||n===void 0||n.call(t,e)}))}}const f8e=/(?[\w\-]+)?(?:#(?[\w\-]+))?(?(?:\.(?:[\w\-]+))*)(?:@(?(?:[\w\_])+))?/;function gi(i,...e){let t,n;Array.isArray(e[0])?(t={},n=e[0]):(t=e[0]||{},n=e[1]);const r=f8e.exec(i);if(!r||!r.groups)throw new Error("Bad use of h");const o=r.groups.tag||"div",s=document.createElement(o);r.groups.id&&(s.id=r.groups.id);const a=[];if(r.groups.class)for(const c of r.groups.class.split("."))c!==""&&a.push(c);if(t.className!==void 0)for(const c of t.className.split("."))c!==""&&a.push(c);a.length>0&&(s.className=a.join(" "));const l={};if(r.groups.name&&(l[r.groups.name]=s),n)for(const c of n)c instanceof HTMLElement?s.appendChild(c):typeof c=="string"?s.append(c):"root"in c&&(Object.assign(l,c),s.appendChild(c.root));for(const[c,u]of Object.entries(t))if(c!=="className")if(c==="style")for(const[d,h]of Object.entries(u))s.style.setProperty(sie(d),typeof h=="number"?h+"px":""+h);else c==="tabIndex"?s.tabIndex=u:s.setAttribute(sie(c),u.toString());return l.root=s,l}function sie(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class g8e extends fe{constructor(e){super(),this._onDidChange=this._register(new se),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(e,!0),this._mediaQueryList=null,this._handleChange(e,!1)}_handleChange(e,t){var n;(n=this._mediaQueryList)===null||n===void 0||n.removeEventListener("change",this._listener),this._mediaQueryList=e.matchMedia(`(resolution: ${e.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),t&&this._onDidChange.fire()}}class p8e extends fe{get value(){return this._value}constructor(e){super(),this._onDidChange=this._register(new se),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio(e);const t=this._register(new g8e(e));this._register(t.onDidChange(()=>{this._value=this._getPixelRatio(e),this._onDidChange.fire(this._value)}))}_getPixelRatio(e){const t=document.createElement("canvas").getContext("2d"),n=e.devicePixelRatio||1,r=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return n/r}}class m8e{constructor(){this.mapWindowIdToPixelRatioMonitor=new Map}_getOrCreatePixelRatioMonitor(e){const t=jA(e);let n=this.mapWindowIdToPixelRatioMonitor.get(t);return n||(n=new p8e(e),this.mapWindowIdToPixelRatioMonitor.set(t,n),Je.once(UBe)(({vscodeWindowId:r})=>{r===t&&(n==null||n.dispose(),this.mapWindowIdToPixelRatioMonitor.delete(t))})),n}getInstance(e){return this._getOrCreatePixelRatioMonitor(e)}}const ID=new m8e;class dme{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingLeft="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){const t=yd(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=yd(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=yd(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=yd(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=yd(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=yd(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=yd(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){const t=yd(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){const t=yd(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){const t=yd(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=yd(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}}function yd(i){return typeof i=="number"?`${i}px`:i}function Qn(i){return new dme(i)}function ps(i,e){i instanceof dme?(i.setFontFamily(e.getMassagedFontFamily()),i.setFontWeight(e.fontWeight),i.setFontSize(e.fontSize),i.setFontFeatureSettings(e.fontFeatureSettings),i.setFontVariationSettings(e.fontVariationSettings),i.setLineHeight(e.lineHeight),i.setLetterSpacing(e.letterSpacing)):(i.style.fontFamily=e.getMassagedFontFamily(),i.style.fontWeight=e.fontWeight,i.style.fontSize=e.fontSize+"px",i.style.fontFeatureSettings=e.fontFeatureSettings,i.style.fontVariationSettings=e.fontVariationSettings,i.style.lineHeight=e.lineHeight+"px",i.style.letterSpacing=e.letterSpacing+"px")}class v8e{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class Nq{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(e){this._createDomElements(),e.document.body.appendChild(this._container),this._readFromDomElements(),e.document.body.removeChild(this._container),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const t=document.createElement("div");ps(t,this._bareFontInfo),e.appendChild(t);const n=document.createElement("div");ps(n,this._bareFontInfo),n.style.fontWeight="bold",e.appendChild(n);const r=document.createElement("div");ps(r,this._bareFontInfo),r.style.fontStyle="italic",e.appendChild(r);const o=[];for(const s of this._requests){let a;s.type===0&&(a=t),s.type===2&&(a=n),s.type===1&&(a=r),a.appendChild(document.createElement("br"));const l=document.createElement("span");Nq._render(l,s),a.appendChild(l),o.push(l)}this._container=e,this._testElements=o}static _render(e,t){if(t.chr===" "){let n=" ";for(let r=0;r<8;r++)n+=n;e.innerText=n}else{let n=t.chr;for(let r=0;r<8;r++)n+=n;e.textContent=n}}_readFromDomElements(){for(let e=0,t=this._requests.length;e{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings(e)},5e3))}_evictUntrustedReadings(e){const t=this._ensureCache(e),n=t.getValues();let r=!1;for(const o of n)o.isTrusted||(r=!0,t.remove(o));r&&this._onDidChange.fire()}readFontInfo(e,t){const n=this._ensureCache(e);if(!n.has(t)){let r=this._actualReadFontInfo(e,t);(r.typicalHalfwidthCharacterWidth<=2||r.typicalFullwidthCharacterWidth<=2||r.spaceWidth<=2||r.maxDigitWidth<=2)&&(r=new lH({pixelRatio:ID.getInstance(e).value,fontFamily:r.fontFamily,fontWeight:r.fontWeight,fontSize:r.fontSize,fontFeatureSettings:r.fontFeatureSettings,fontVariationSettings:r.fontVariationSettings,lineHeight:r.lineHeight,letterSpacing:r.letterSpacing,isMonospace:r.isMonospace,typicalHalfwidthCharacterWidth:Math.max(r.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(r.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:r.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(r.spaceWidth,5),middotWidth:Math.max(r.middotWidth,5),wsmiddotWidth:Math.max(r.wsmiddotWidth,5),maxDigitWidth:Math.max(r.maxDigitWidth,5)},!1)),this._writeToCache(e,t,r)}return n.get(t)}_createRequest(e,t,n,r){const o=new v8e(e,t);return n.push(o),r==null||r.push(o),o}_actualReadFontInfo(e,t){const n=[],r=[],o=this._createRequest("n",0,n,r),s=this._createRequest("m",0,n,null),a=this._createRequest(" ",0,n,r),l=this._createRequest("0",0,n,r),c=this._createRequest("1",0,n,r),u=this._createRequest("2",0,n,r),d=this._createRequest("3",0,n,r),h=this._createRequest("4",0,n,r),f=this._createRequest("5",0,n,r),g=this._createRequest("6",0,n,r),p=this._createRequest("7",0,n,r),v=this._createRequest("8",0,n,r),m=this._createRequest("9",0,n,r),_=this._createRequest("→",0,n,r),y=this._createRequest("→",0,n,null),S=this._createRequest("·",0,n,r),L=this._createRequest(String.fromCharCode(11825),0,n,null),E="|/-_ilm%";for(let A=0,N=E.length;A.001){k=!1;break}}let M=!0;return k&&y.width!==T&&(M=!1),y.width>_.width&&(M=!1),new lH({pixelRatio:ID.getInstance(e).value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,fontVariationSettings:t.fontVariationSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:k,typicalHalfwidthCharacterWidth:o.width,typicalFullwidthCharacterWidth:s.width,canUseHalfwidthRightwardsArrow:M,spaceWidth:a.width,middotWidth:S.width,wsmiddotWidth:L.width,maxDigitWidth:D},!0)}}class w8e{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){const t=e.getId();return!!this._values[t]}get(e){const t=e.getId();return this._values[t]}put(e,t){const n=e.getId();this._keys[n]=e,this._values[n]=t}remove(e){const t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map(e=>this._values[e])}}const cH=new y8e;var qd;(function(i){i.serviceIds=new Map,i.DI_TARGET="$di$target",i.DI_DEPENDENCIES="$di$dependencies";function e(t){return t[i.DI_DEPENDENCIES]||[]}i.getServiceDependencies=e})(qd||(qd={}));const Ot=yn("instantiationService");function S8e(i,e,t){e[qd.DI_TARGET]===e?e[qd.DI_DEPENDENCIES].push({id:i,index:t}):(e[qd.DI_DEPENDENCIES]=[{id:i,index:t}],e[qd.DI_TARGET]=e)}function yn(i){if(qd.serviceIds.has(i))return qd.serviceIds.get(i);const e=function(t,n,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");S8e(e,t,r)};return e.toString=()=>i,qd.serviceIds.set(i,e),e}const Un=yn("codeEditorService"),tr=yn("modelService"),ol=yn("textModelService");class xl extends fe{constructor(e,t="",n="",r=!0,o){super(),this._onDidChange=this._register(new se),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=n,this._enabled=r,this._actionCallback=o}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||""}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}async run(e,t){this._actionCallback&&await this._actionCallback(e)}}class Nb extends fe{constructor(){super(...arguments),this._onWillRun=this._register(new se),this.onWillRun=this._onWillRun.event,this._onDidRun=this._register(new se),this.onDidRun=this._onDidRun.event}async run(e,t){if(!e.enabled)return;this._onWillRun.fire({action:e});let n;try{await this.runAction(e,t)}catch(r){n=r}this._onDidRun.fire({action:e,error:n})}async runAction(e,t){await e.run(t)}}class lo{constructor(){this.id=lo.ID,this.label="",this.tooltip="",this.class="separator",this.enabled=!1,this.checked=!1}static join(...e){let t=[];for(const n of e)n.length&&(t.length?t=[...t,new lo,...n]:t=n);return t}async run(){}}lo.ID="vs.actions.separator";class Lw{get actions(){return this._actions}constructor(e,t,n,r){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=r,this._actions=n}async run(){}}class f4 extends xl{constructor(){super(f4.ID,w("submenu.empty","(empty)"),void 0,!1)}}f4.ID="vs.actions.empty";function My(i){var e;return{id:i.id,label:i.label,class:i.class,enabled:(e=i.enabled)!==null&&e!==void 0?e:!0,checked:i.checked,run:async(...t)=>i.run(...t),tooltip:i.label}}var uH;(function(i){function e(t){return t&&typeof t=="object"&&typeof t.id=="string"}i.isThemeColor=e})(uH||(uH={}));var Wt;(function(i){i.iconNameSegment="[A-Za-z0-9]+",i.iconNameExpression="[A-Za-z0-9-]+",i.iconModifierExpression="~[A-Za-z]+",i.iconNameCharacter="[A-Za-z0-9~-]";const e=new RegExp(`^(${i.iconNameExpression})(${i.iconModifierExpression})?$`);function t(h){const f=e.exec(h.id);if(!f)return t(Xe.error);const[,g,p]=f,v=["codicon","codicon-"+g];return p&&v.push("codicon-modifier-"+p.substring(1)),v}i.asClassNameArray=t;function n(h){return t(h).join(" ")}i.asClassName=n;function r(h){return"."+t(h).join(".")}i.asCSSSelector=r;function o(h){return h&&typeof h=="object"&&typeof h.id=="string"&&(typeof h.color>"u"||uH.isThemeColor(h.color))}i.isThemeIcon=o;const s=new RegExp(`^\\$\\((${i.iconNameExpression}(?:${i.iconModifierExpression})?)\\)$`);function a(h){const f=s.exec(h);if(!f)return;const[,g]=f;return{id:g}}i.fromString=a;function l(h){return{id:h}}i.fromId=l;function c(h,f){let g=h.id;const p=g.lastIndexOf("~");return p!==-1&&(g=g.substring(0,p)),f&&(g=`${g}~${f}`),{id:g}}i.modify=c;function u(h){const f=h.id.lastIndexOf("~");if(f!==-1)return h.id.substring(f+1)}i.getModifier=u;function d(h,f){var g,p;return h.id===f.id&&((g=h.color)===null||g===void 0?void 0:g.id)===((p=f.color)===null||p===void 0?void 0:p.id)}i.isEqual=d})(Wt||(Wt={}));const sr=yn("commandService"),Dn=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new se,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(i,e){if(!i)throw new Error("invalid command");if(typeof i=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:i,handler:e})}if(i.metadata&&Array.isArray(i.metadata.args)){const s=[];for(const l of i.metadata.args)s.push(l.constraint);const a=i.handler;i.handler=function(l,...c){return W4e(c,s),a(l,...c)}}const{id:t}=i;let n=this._commands.get(t);n||(n=new _a,this._commands.set(t,n));const r=n.unshift(i),o=Rt(()=>{r();const s=this._commands.get(t);s!=null&&s.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),o}registerCommandAlias(i,e){return Dn.registerCommand(i,(t,...n)=>t.get(sr).executeCommand(e,...n))}getCommand(i){const e=this._commands.get(i);if(!(!e||e.isEmpty()))return En.first(e)}getCommands(){const i=new Map;for(const e of this._commands.keys()){const t=this.getCommand(e);t&&i.set(e,t)}return i}};Dn.registerCommand("noop",()=>{});function h6(...i){switch(i.length){case 1:return w("contextkey.scanner.hint.didYouMean1","Did you mean {0}?",i[0]);case 2:return w("contextkey.scanner.hint.didYouMean2","Did you mean {0} or {1}?",i[0],i[1]);case 3:return w("contextkey.scanner.hint.didYouMean3","Did you mean {0}, {1} or {2}?",i[0],i[1],i[2]);default:return}}const x8e=w("contextkey.scanner.hint.didYouForgetToOpenOrCloseQuote","Did you forget to open or close the quote?"),L8e=w("contextkey.scanner.hint.didYouForgetToEscapeSlash","Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.");let w0=class dH{constructor(){this._input="",this._start=0,this._current=0,this._tokens=[],this._errors=[],this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(e){switch(e.type){case 0:return"(";case 1:return")";case 2:return"!";case 3:return e.isTripleEq?"===":"==";case 4:return e.isTripleEq?"!==":"!=";case 5:return"<";case 6:return"<=";case 7:return">=";case 8:return">=";case 9:return"=~";case 10:return e.lexeme;case 11:return"true";case 12:return"false";case 13:return"in";case 14:return"not";case 15:return"&&";case 16:return"||";case 17:return e.lexeme;case 18:return e.lexeme;case 19:return e.lexeme;case 20:return"EOF";default:throw sq(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}reset(e){return this._input=e,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();)switch(this._start=this._current,this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){const t=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:t})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){const t=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:t})}else this._match(126)?this._addToken(9):this._error(h6("==","=~"));break;case 60:this._addToken(this._match(61)?6:5);break;case 62:this._addToken(this._match(61)?8:7);break;case 38:this._match(38)?this._addToken(15):this._error(h6("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(h6("||"));break;case 32:case 13:case 9:case 10:case 160:break;default:this._string()}return this._start=this._current,this._addToken(20),Array.from(this._tokens)}_match(e){return this._isAtEnd()||this._input.charCodeAt(this._current)!==e?!1:(this._current++,!0)}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?0:this._input.charCodeAt(this._current)}_addToken(e){this._tokens.push({type:e,offset:this._start})}_error(e){const t=this._start,n=this._input.substring(this._start,this._current),r={type:19,offset:this._start,lexeme:n};this._errors.push({offset:t,lexeme:n,additionalInfo:e}),this._tokens.push(r)}_string(){this.stringRe.lastIndex=this._start;const e=this.stringRe.exec(this._input);if(e){this._current=this._start+e[0].length;const t=this._input.substring(this._start,this._current),n=dH._keywords.get(t);n?this._addToken(n):this._tokens.push({type:17,lexeme:t,offset:this._start})}}_quotedString(){for(;this._peek()!==39&&!this._isAtEnd();)this._advance();if(this._isAtEnd()){this._error(x8e);return}this._advance(),this._tokens.push({type:18,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1})}_regex(){let e=this._current,t=!1,n=!1;for(;;){if(e>=this._input.length){this._current=e,this._error(L8e);return}const o=this._input.charCodeAt(e);if(t)t=!1;else if(o===47&&!n){e++;break}else o===91?n=!0:o===92?t=!0:o===93&&(n=!1);e++}for(;e=this._input.length}};w0._regexFlags=new Set(["i","g","s","m","y","u"].map(i=>i.charCodeAt(0)));w0._keywords=new Map([["not",14],["in",13],["false",12],["true",11]]);const As=new Map;As.set("false",!1);As.set("true",!0);As.set("isMac",Ln);As.set("isLinux",Da);As.set("isWindows",Rs);As.set("isWeb",x_);As.set("isMacNative",Ln&&!x_);As.set("isEdge",e3e);As.set("isFirefox",Q4e);As.set("isChrome",hpe);As.set("isSafari",J4e);const E8e=Object.prototype.hasOwnProperty,D8e={regexParsingWithErrorRecovery:!0},I8e=w("contextkey.parser.error.emptyString","Empty context key expression"),k8e=w("contextkey.parser.error.emptyString.hint","Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively."),T8e=w("contextkey.parser.error.noInAfterNot","'in' after 'not'."),aie=w("contextkey.parser.error.closingParenthesis","closing parenthesis ')'"),N8e=w("contextkey.parser.error.unexpectedToken","Unexpected token"),R8e=w("contextkey.parser.error.unexpectedToken.hint","Did you forget to put && or || before the token?"),M8e=w("contextkey.parser.error.unexpectedEOF","Unexpected end of expression"),A8e=w("contextkey.parser.error.unexpectedEOF.hint","Did you forget to put a context key?");let hme=class wL{constructor(e=D8e){this._config=e,this._scanner=new w0,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(e===""){this._parsingErrors.push({message:I8e,offset:0,lexeme:"",additionalInfo:k8e});return}this._tokens=this._scanner.reset(e).scan(),this._current=0,this._parsingErrors=[];try{const t=this._expr();if(!this._isAtEnd()){const n=this._peek(),r=n.type===17?R8e:void 0;throw this._parsingErrors.push({message:N8e,offset:n.offset,lexeme:w0.getLexeme(n),additionalInfo:r}),wL._parseError}return t}catch(t){if(t!==wL._parseError)throw t;return}}_expr(){return this._or()}_or(){const e=[this._and()];for(;this._matchOne(16);){const t=this._and();e.push(t)}return e.length===1?e[0]:De.or(...e)}_and(){const e=[this._term()];for(;this._matchOne(15);){const t=this._term();e.push(t)}return e.length===1?e[0]:De.and(...e)}_term(){if(this._matchOne(2)){const e=this._peek();switch(e.type){case 11:return this._advance(),Ia.INSTANCE;case 12:return this._advance(),tl.INSTANCE;case 0:{this._advance();const t=this._expr();return this._consume(1,aie),t==null?void 0:t.negate()}case 17:return this._advance(),uC.create(e.lexeme);default:throw this._errExpectedButGot("KEY | true | false | '(' expression ')'",e)}}return this._primary()}_primary(){const e=this._peek();switch(e.type){case 11:return this._advance(),De.true();case 12:return this._advance(),De.false();case 0:{this._advance();const t=this._expr();return this._consume(1,aie),t}case 17:{const t=e.lexeme;if(this._advance(),this._matchOne(9)){const r=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),r.type!==10)throw this._errExpectedButGot("REGEX",r);const o=r.lexeme,s=o.lastIndexOf("/"),a=s===o.length-1?void 0:this._removeFlagsGY(o.substring(s+1));let l;try{l=new RegExp(o.substring(1,s),a)}catch{throw this._errExpectedButGot("REGEX",r)}return kD.create(t,l)}switch(r.type){case 10:case 19:{const o=[r.lexeme];this._advance();let s=this._peek(),a=0;for(let h=0;h=0){const c=o.slice(a+1,l),u=o[l+1]==="i"?"i":"";try{s=new RegExp(c,u)}catch{throw this._errExpectedButGot("REGEX",r)}}}if(s===null)throw this._errExpectedButGot("REGEX",r);return kD.create(t,s)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,T8e);const r=this._value();return De.notIn(t,r)}switch(this._peek().type){case 3:{this._advance();const r=this._value();if(this._previous().type===18)return De.equals(t,r);switch(r){case"true":return De.has(t);case"false":return De.not(t);default:return De.equals(t,r)}}case 4:{this._advance();const r=this._value();if(this._previous().type===18)return De.notEquals(t,r);switch(r){case"true":return De.not(t);case"false":return De.has(t);default:return De.notEquals(t,r)}}case 5:return this._advance(),C4.create(t,this._value());case 6:return this._advance(),y4.create(t,this._value());case 7:return this._advance(),_4.create(t,this._value());case 8:return this._advance(),b4.create(t,this._value());case 13:return this._advance(),De.in(t,this._value());default:return De.has(t)}}case 20:throw this._parsingErrors.push({message:M8e,offset:e.offset,lexeme:"",additionalInfo:A8e}),wL._parseError;default:throw this._errExpectedButGot(`true | false | KEY +`))}}class Y8{constructor(e){this.value=e}}const t5e=2;let se=class{constructor(e){var t,n,r,o,s;this._size=0,this._options=e,this._leakageMon=!((t=this._options)===null||t===void 0)&&t.leakWarningThreshold?new e5e((r=(n=this._options)===null||n===void 0?void 0:n.leakWarningThreshold)!==null&&r!==void 0?r:J3e):void 0,this._perfMon=!((o=this._options)===null||o===void 0)&&o._profName?new ww(this._options._profName):void 0,this._deliveryQueue=(s=this._options)===null||s===void 0?void 0:s.deliveryQueue}dispose(){var e,t,n,r;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)===null||e===void 0?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(n=(t=this._options)===null||t===void 0?void 0:t.onDidRemoveLastListener)===null||n===void 0||n.call(t),(r=this._leakageMon)===null||r===void 0||r.dispose())}get event(){var e;return(e=this._event)!==null&&e!==void 0||(this._event=(t,n,r)=>{var o,s,a,l,c;if(this._leakageMon&&this._size>this._leakageMon.threshold*3)return console.warn(`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far`),fe.None;if(this._disposed)return fe.None;n&&(t=t.bind(n));const u=new Y8(t);let d;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(u.stack=cq.create(),d=this._leakageMon.check(u.stack,this._size+1)),this._listeners?this._listeners instanceof Y8?((c=this._deliveryQueue)!==null&&c!==void 0||(this._deliveryQueue=new _pe),this._listeners=[this._listeners,u]):this._listeners.push(u):((s=(o=this._options)===null||o===void 0?void 0:o.onWillAddFirstListener)===null||s===void 0||s.call(o,this),this._listeners=u,(l=(a=this._options)===null||a===void 0?void 0:a.onDidAddFirstListener)===null||l===void 0||l.call(a,this)),this._size++;const h=Rt(()=>{d==null||d(),this._removeListener(u)});return r instanceof Te?r.add(h):Array.isArray(r)&&r.push(h),h}),this._event}_removeListener(e){var t,n,r,o;if((n=(t=this._options)===null||t===void 0?void 0:t.onWillRemoveListener)===null||n===void 0||n.call(t,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(o=(r=this._options)===null||r===void 0?void 0:r.onDidRemoveLastListener)===null||o===void 0||o.call(r,this),this._size=0;return}const s=this._listeners,a=s.indexOf(e);if(a===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,s[a]=void 0;const l=this._deliveryQueue.current===this;if(this._size*t5e<=s.length){let c=0;for(let u=0;u0}};const n5e=()=>new _pe;class _pe{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class Lb extends se{constructor(e){super(e),this._isPaused=0,this._eventQueue=new _a,this._mergeFn=e==null?void 0:e.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}}class bpe extends Lb{constructor(e){var t;super(e),this._delay=(t=e.delay)!==null&&t!==void 0?t:100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}}class i5e extends se{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e==null?void 0:e.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(t=>super.fire(t)),this._queuedEvents=[]}))}}class r5e{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new se({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(e){const t={event:e,listener:null};return this.events.push(t),this.hasListeners&&this.hook(t),Rt(Hv(()=>{this.hasListeners&&this.unhook(t);const r=this.events.indexOf(t);this.events.splice(r,1)}))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(t=>this.emitter.fire(t))}unhook(e){var t;(t=e.listener)===null||t===void 0||t.dispose(),e.listener=null}dispose(){var e;this.emitter.dispose();for(const t of this.events)(e=t.listener)===null||e===void 0||e.dispose();this.events=[]}}class uq{constructor(){this.buffers=[]}wrapEvent(e){return(t,n,r)=>e(o=>{const s=this.buffers[this.buffers.length-1];s?s.push(()=>t.call(n,o)):t.call(n,o)},void 0,r)}bufferEvents(e){const t=[];this.buffers.push(t);const n=e();return this.buffers.pop(),t.forEach(r=>r()),n}}class Wne{constructor(){this.listening=!1,this.inputEvent=Je.None,this.inputEventListener=fe.None,this.emitter=new se({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}const Cpe=Object.freeze(function(i,e){const t=setTimeout(i.bind(e),0);return{dispose(){clearTimeout(t)}}});var Cn;(function(i){function e(t){return t===i.None||t===i.Cancelled||t instanceof aM?!0:!t||typeof t!="object"?!1:typeof t.isCancellationRequested=="boolean"&&typeof t.onCancellationRequested=="function"}i.isCancellationToken=e,i.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Je.None}),i.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Cpe})})(Cn||(Cn={}));class aM{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Cpe:(this._emitter||(this._emitter=new se),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}let wr=class{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new aM),this._token}cancel(){this._token?this._token instanceof aM&&this._token.cancel():this._token=Cn.Cancelled}dispose(e=!1){var t;e&&this.cancel(),(t=this._parentListener)===null||t===void 0||t.dispose(),this._token?this._token instanceof aM&&this._token.dispose():this._token=Cn.None}};class dq{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}}const lM=new dq,r$=new dq,o$=new dq,ype=new Array(230),o5e=Object.create(null),s5e=Object.create(null),hq=[];for(let i=0;i<=193;i++)hq[i]=-1;(function(){const i="",e=[[1,0,"None",0,"unknown",0,"VK_UNKNOWN",i,i],[1,1,"Hyper",0,i,0,i,i,i],[1,2,"Super",0,i,0,i,i,i],[1,3,"Fn",0,i,0,i,i,i],[1,4,"FnLock",0,i,0,i,i,i],[1,5,"Suspend",0,i,0,i,i,i],[1,6,"Resume",0,i,0,i,i,i],[1,7,"Turbo",0,i,0,i,i,i],[1,8,"Sleep",0,i,0,"VK_SLEEP",i,i],[1,9,"WakeUp",0,i,0,i,i,i],[0,10,"KeyA",31,"A",65,"VK_A",i,i],[0,11,"KeyB",32,"B",66,"VK_B",i,i],[0,12,"KeyC",33,"C",67,"VK_C",i,i],[0,13,"KeyD",34,"D",68,"VK_D",i,i],[0,14,"KeyE",35,"E",69,"VK_E",i,i],[0,15,"KeyF",36,"F",70,"VK_F",i,i],[0,16,"KeyG",37,"G",71,"VK_G",i,i],[0,17,"KeyH",38,"H",72,"VK_H",i,i],[0,18,"KeyI",39,"I",73,"VK_I",i,i],[0,19,"KeyJ",40,"J",74,"VK_J",i,i],[0,20,"KeyK",41,"K",75,"VK_K",i,i],[0,21,"KeyL",42,"L",76,"VK_L",i,i],[0,22,"KeyM",43,"M",77,"VK_M",i,i],[0,23,"KeyN",44,"N",78,"VK_N",i,i],[0,24,"KeyO",45,"O",79,"VK_O",i,i],[0,25,"KeyP",46,"P",80,"VK_P",i,i],[0,26,"KeyQ",47,"Q",81,"VK_Q",i,i],[0,27,"KeyR",48,"R",82,"VK_R",i,i],[0,28,"KeyS",49,"S",83,"VK_S",i,i],[0,29,"KeyT",50,"T",84,"VK_T",i,i],[0,30,"KeyU",51,"U",85,"VK_U",i,i],[0,31,"KeyV",52,"V",86,"VK_V",i,i],[0,32,"KeyW",53,"W",87,"VK_W",i,i],[0,33,"KeyX",54,"X",88,"VK_X",i,i],[0,34,"KeyY",55,"Y",89,"VK_Y",i,i],[0,35,"KeyZ",56,"Z",90,"VK_Z",i,i],[0,36,"Digit1",22,"1",49,"VK_1",i,i],[0,37,"Digit2",23,"2",50,"VK_2",i,i],[0,38,"Digit3",24,"3",51,"VK_3",i,i],[0,39,"Digit4",25,"4",52,"VK_4",i,i],[0,40,"Digit5",26,"5",53,"VK_5",i,i],[0,41,"Digit6",27,"6",54,"VK_6",i,i],[0,42,"Digit7",28,"7",55,"VK_7",i,i],[0,43,"Digit8",29,"8",56,"VK_8",i,i],[0,44,"Digit9",30,"9",57,"VK_9",i,i],[0,45,"Digit0",21,"0",48,"VK_0",i,i],[1,46,"Enter",3,"Enter",13,"VK_RETURN",i,i],[1,47,"Escape",9,"Escape",27,"VK_ESCAPE",i,i],[1,48,"Backspace",1,"Backspace",8,"VK_BACK",i,i],[1,49,"Tab",2,"Tab",9,"VK_TAB",i,i],[1,50,"Space",10,"Space",32,"VK_SPACE",i,i],[0,51,"Minus",88,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[0,52,"Equal",86,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[0,53,"BracketLeft",92,"[",219,"VK_OEM_4","[","OEM_4"],[0,54,"BracketRight",94,"]",221,"VK_OEM_6","]","OEM_6"],[0,55,"Backslash",93,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,56,"IntlHash",0,i,0,i,i,i],[0,57,"Semicolon",85,";",186,"VK_OEM_1",";","OEM_1"],[0,58,"Quote",95,"'",222,"VK_OEM_7","'","OEM_7"],[0,59,"Backquote",91,"`",192,"VK_OEM_3","`","OEM_3"],[0,60,"Comma",87,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[0,61,"Period",89,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[0,62,"Slash",90,"/",191,"VK_OEM_2","/","OEM_2"],[1,63,"CapsLock",8,"CapsLock",20,"VK_CAPITAL",i,i],[1,64,"F1",59,"F1",112,"VK_F1",i,i],[1,65,"F2",60,"F2",113,"VK_F2",i,i],[1,66,"F3",61,"F3",114,"VK_F3",i,i],[1,67,"F4",62,"F4",115,"VK_F4",i,i],[1,68,"F5",63,"F5",116,"VK_F5",i,i],[1,69,"F6",64,"F6",117,"VK_F6",i,i],[1,70,"F7",65,"F7",118,"VK_F7",i,i],[1,71,"F8",66,"F8",119,"VK_F8",i,i],[1,72,"F9",67,"F9",120,"VK_F9",i,i],[1,73,"F10",68,"F10",121,"VK_F10",i,i],[1,74,"F11",69,"F11",122,"VK_F11",i,i],[1,75,"F12",70,"F12",123,"VK_F12",i,i],[1,76,"PrintScreen",0,i,0,i,i,i],[1,77,"ScrollLock",84,"ScrollLock",145,"VK_SCROLL",i,i],[1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE",i,i],[1,79,"Insert",19,"Insert",45,"VK_INSERT",i,i],[1,80,"Home",14,"Home",36,"VK_HOME",i,i],[1,81,"PageUp",11,"PageUp",33,"VK_PRIOR",i,i],[1,82,"Delete",20,"Delete",46,"VK_DELETE",i,i],[1,83,"End",13,"End",35,"VK_END",i,i],[1,84,"PageDown",12,"PageDown",34,"VK_NEXT",i,i],[1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",i],[1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",i],[1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",i],[1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",i],[1,89,"NumLock",83,"NumLock",144,"VK_NUMLOCK",i,i],[1,90,"NumpadDivide",113,"NumPad_Divide",111,"VK_DIVIDE",i,i],[1,91,"NumpadMultiply",108,"NumPad_Multiply",106,"VK_MULTIPLY",i,i],[1,92,"NumpadSubtract",111,"NumPad_Subtract",109,"VK_SUBTRACT",i,i],[1,93,"NumpadAdd",109,"NumPad_Add",107,"VK_ADD",i,i],[1,94,"NumpadEnter",3,i,0,i,i,i],[1,95,"Numpad1",99,"NumPad1",97,"VK_NUMPAD1",i,i],[1,96,"Numpad2",100,"NumPad2",98,"VK_NUMPAD2",i,i],[1,97,"Numpad3",101,"NumPad3",99,"VK_NUMPAD3",i,i],[1,98,"Numpad4",102,"NumPad4",100,"VK_NUMPAD4",i,i],[1,99,"Numpad5",103,"NumPad5",101,"VK_NUMPAD5",i,i],[1,100,"Numpad6",104,"NumPad6",102,"VK_NUMPAD6",i,i],[1,101,"Numpad7",105,"NumPad7",103,"VK_NUMPAD7",i,i],[1,102,"Numpad8",106,"NumPad8",104,"VK_NUMPAD8",i,i],[1,103,"Numpad9",107,"NumPad9",105,"VK_NUMPAD9",i,i],[1,104,"Numpad0",98,"NumPad0",96,"VK_NUMPAD0",i,i],[1,105,"NumpadDecimal",112,"NumPad_Decimal",110,"VK_DECIMAL",i,i],[0,106,"IntlBackslash",97,"OEM_102",226,"VK_OEM_102",i,i],[1,107,"ContextMenu",58,"ContextMenu",93,i,i,i],[1,108,"Power",0,i,0,i,i,i],[1,109,"NumpadEqual",0,i,0,i,i,i],[1,110,"F13",71,"F13",124,"VK_F13",i,i],[1,111,"F14",72,"F14",125,"VK_F14",i,i],[1,112,"F15",73,"F15",126,"VK_F15",i,i],[1,113,"F16",74,"F16",127,"VK_F16",i,i],[1,114,"F17",75,"F17",128,"VK_F17",i,i],[1,115,"F18",76,"F18",129,"VK_F18",i,i],[1,116,"F19",77,"F19",130,"VK_F19",i,i],[1,117,"F20",78,"F20",131,"VK_F20",i,i],[1,118,"F21",79,"F21",132,"VK_F21",i,i],[1,119,"F22",80,"F22",133,"VK_F22",i,i],[1,120,"F23",81,"F23",134,"VK_F23",i,i],[1,121,"F24",82,"F24",135,"VK_F24",i,i],[1,122,"Open",0,i,0,i,i,i],[1,123,"Help",0,i,0,i,i,i],[1,124,"Select",0,i,0,i,i,i],[1,125,"Again",0,i,0,i,i,i],[1,126,"Undo",0,i,0,i,i,i],[1,127,"Cut",0,i,0,i,i,i],[1,128,"Copy",0,i,0,i,i,i],[1,129,"Paste",0,i,0,i,i,i],[1,130,"Find",0,i,0,i,i,i],[1,131,"AudioVolumeMute",117,"AudioVolumeMute",173,"VK_VOLUME_MUTE",i,i],[1,132,"AudioVolumeUp",118,"AudioVolumeUp",175,"VK_VOLUME_UP",i,i],[1,133,"AudioVolumeDown",119,"AudioVolumeDown",174,"VK_VOLUME_DOWN",i,i],[1,134,"NumpadComma",110,"NumPad_Separator",108,"VK_SEPARATOR",i,i],[0,135,"IntlRo",115,"ABNT_C1",193,"VK_ABNT_C1",i,i],[1,136,"KanaMode",0,i,0,i,i,i],[0,137,"IntlYen",0,i,0,i,i,i],[1,138,"Convert",0,i,0,i,i,i],[1,139,"NonConvert",0,i,0,i,i,i],[1,140,"Lang1",0,i,0,i,i,i],[1,141,"Lang2",0,i,0,i,i,i],[1,142,"Lang3",0,i,0,i,i,i],[1,143,"Lang4",0,i,0,i,i,i],[1,144,"Lang5",0,i,0,i,i,i],[1,145,"Abort",0,i,0,i,i,i],[1,146,"Props",0,i,0,i,i,i],[1,147,"NumpadParenLeft",0,i,0,i,i,i],[1,148,"NumpadParenRight",0,i,0,i,i,i],[1,149,"NumpadBackspace",0,i,0,i,i,i],[1,150,"NumpadMemoryStore",0,i,0,i,i,i],[1,151,"NumpadMemoryRecall",0,i,0,i,i,i],[1,152,"NumpadMemoryClear",0,i,0,i,i,i],[1,153,"NumpadMemoryAdd",0,i,0,i,i,i],[1,154,"NumpadMemorySubtract",0,i,0,i,i,i],[1,155,"NumpadClear",131,"Clear",12,"VK_CLEAR",i,i],[1,156,"NumpadClearEntry",0,i,0,i,i,i],[1,0,i,5,"Ctrl",17,"VK_CONTROL",i,i],[1,0,i,4,"Shift",16,"VK_SHIFT",i,i],[1,0,i,6,"Alt",18,"VK_MENU",i,i],[1,0,i,57,"Meta",91,"VK_COMMAND",i,i],[1,157,"ControlLeft",5,i,0,"VK_LCONTROL",i,i],[1,158,"ShiftLeft",4,i,0,"VK_LSHIFT",i,i],[1,159,"AltLeft",6,i,0,"VK_LMENU",i,i],[1,160,"MetaLeft",57,i,0,"VK_LWIN",i,i],[1,161,"ControlRight",5,i,0,"VK_RCONTROL",i,i],[1,162,"ShiftRight",4,i,0,"VK_RSHIFT",i,i],[1,163,"AltRight",6,i,0,"VK_RMENU",i,i],[1,164,"MetaRight",57,i,0,"VK_RWIN",i,i],[1,165,"BrightnessUp",0,i,0,i,i,i],[1,166,"BrightnessDown",0,i,0,i,i,i],[1,167,"MediaPlay",0,i,0,i,i,i],[1,168,"MediaRecord",0,i,0,i,i,i],[1,169,"MediaFastForward",0,i,0,i,i,i],[1,170,"MediaRewind",0,i,0,i,i,i],[1,171,"MediaTrackNext",124,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK",i,i],[1,172,"MediaTrackPrevious",125,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK",i,i],[1,173,"MediaStop",126,"MediaStop",178,"VK_MEDIA_STOP",i,i],[1,174,"Eject",0,i,0,i,i,i],[1,175,"MediaPlayPause",127,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE",i,i],[1,176,"MediaSelect",128,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT",i,i],[1,177,"LaunchMail",129,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL",i,i],[1,178,"LaunchApp2",130,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2",i,i],[1,179,"LaunchApp1",0,i,0,"VK_MEDIA_LAUNCH_APP1",i,i],[1,180,"SelectTask",0,i,0,i,i,i],[1,181,"LaunchScreenSaver",0,i,0,i,i,i],[1,182,"BrowserSearch",120,"BrowserSearch",170,"VK_BROWSER_SEARCH",i,i],[1,183,"BrowserHome",121,"BrowserHome",172,"VK_BROWSER_HOME",i,i],[1,184,"BrowserBack",122,"BrowserBack",166,"VK_BROWSER_BACK",i,i],[1,185,"BrowserForward",123,"BrowserForward",167,"VK_BROWSER_FORWARD",i,i],[1,186,"BrowserStop",0,i,0,"VK_BROWSER_STOP",i,i],[1,187,"BrowserRefresh",0,i,0,"VK_BROWSER_REFRESH",i,i],[1,188,"BrowserFavorites",0,i,0,"VK_BROWSER_FAVORITES",i,i],[1,189,"ZoomToggle",0,i,0,i,i,i],[1,190,"MailReply",0,i,0,i,i,i],[1,191,"MailForward",0,i,0,i,i,i],[1,192,"MailSend",0,i,0,i,i,i],[1,0,i,114,"KeyInComposition",229,i,i,i],[1,0,i,116,"ABNT_C2",194,"VK_ABNT_C2",i,i],[1,0,i,96,"OEM_8",223,"VK_OEM_8",i,i],[1,0,i,0,i,0,"VK_KANA",i,i],[1,0,i,0,i,0,"VK_HANGUL",i,i],[1,0,i,0,i,0,"VK_JUNJA",i,i],[1,0,i,0,i,0,"VK_FINAL",i,i],[1,0,i,0,i,0,"VK_HANJA",i,i],[1,0,i,0,i,0,"VK_KANJI",i,i],[1,0,i,0,i,0,"VK_CONVERT",i,i],[1,0,i,0,i,0,"VK_NONCONVERT",i,i],[1,0,i,0,i,0,"VK_ACCEPT",i,i],[1,0,i,0,i,0,"VK_MODECHANGE",i,i],[1,0,i,0,i,0,"VK_SELECT",i,i],[1,0,i,0,i,0,"VK_PRINT",i,i],[1,0,i,0,i,0,"VK_EXECUTE",i,i],[1,0,i,0,i,0,"VK_SNAPSHOT",i,i],[1,0,i,0,i,0,"VK_HELP",i,i],[1,0,i,0,i,0,"VK_APPS",i,i],[1,0,i,0,i,0,"VK_PROCESSKEY",i,i],[1,0,i,0,i,0,"VK_PACKET",i,i],[1,0,i,0,i,0,"VK_DBE_SBCSCHAR",i,i],[1,0,i,0,i,0,"VK_DBE_DBCSCHAR",i,i],[1,0,i,0,i,0,"VK_ATTN",i,i],[1,0,i,0,i,0,"VK_CRSEL",i,i],[1,0,i,0,i,0,"VK_EXSEL",i,i],[1,0,i,0,i,0,"VK_EREOF",i,i],[1,0,i,0,i,0,"VK_PLAY",i,i],[1,0,i,0,i,0,"VK_ZOOM",i,i],[1,0,i,0,i,0,"VK_NONAME",i,i],[1,0,i,0,i,0,"VK_PA1",i,i],[1,0,i,0,i,0,"VK_OEM_CLEAR",i,i]],t=[],n=[];for(const r of e){const[o,s,a,l,c,u,d,h,f]=r;if(n[s]||(n[s]=!0,o5e[a]=s,s5e[a.toLowerCase()]=s,o&&(hq[s]=l)),!t[l]){if(t[l]=!0,!c)throw new Error(`String representation missing for key code ${l} around scan code ${a}`);lM.define(l,c),r$.define(l,h||c),o$.define(l,f||h||c)}u&&(ype[u]=l)}})();var Bg;(function(i){function e(a){return lM.keyCodeToStr(a)}i.toString=e;function t(a){return lM.strToKeyCode(a)}i.fromString=t;function n(a){return r$.keyCodeToStr(a)}i.toUserSettingsUS=n;function r(a){return o$.keyCodeToStr(a)}i.toUserSettingsGeneral=r;function o(a){return r$.strToKeyCode(a)||o$.strToKeyCode(a)}i.fromUserSettings=o;function s(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return lM.keyCodeToStr(a)}i.toElectronAccelerator=s})(Bg||(Bg={}));function co(i,e){const t=(e&65535)<<16>>>0;return(i|t)>>>0}let Ry;const Z8=globalThis.vscode;if(typeof Z8<"u"&&typeof Z8.process<"u"){const i=Z8.process;Ry={get platform(){return i.platform},get arch(){return i.arch},get env(){return i.env},cwd(){return i.cwd()}}}else typeof process<"u"?Ry={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:Ry={get platform(){return Rs?"win32":Ln?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};const PA=Ry.cwd,s$=Ry.env,a5e=Ry.platform,l5e=65,c5e=97,u5e=90,d5e=122,vv=46,zs=47,jl=92,om=58,h5e=63;class wpe extends Error{constructor(e,t,n){let r;typeof t=="string"&&t.indexOf("not ")===0?(r="must not be",t=t.replace(/^not /,"")):r="must be";const o=e.indexOf(".")!==-1?"property":"argument";let s=`The "${e}" ${o} ${r} of type ${t}`;s+=`. Received type ${typeof n}`,super(s),this.code="ERR_INVALID_ARG_TYPE"}}function f5e(i,e){if(i===null||typeof i!="object")throw new wpe(e,"Object",i)}function Oo(i,e){if(typeof i!="string")throw new wpe(e,"string",i)}const L_=a5e==="win32";function li(i){return i===zs||i===jl}function a$(i){return i===zs}function sm(i){return i>=l5e&&i<=u5e||i>=c5e&&i<=d5e}function OA(i,e,t,n){let r="",o=0,s=-1,a=0,l=0;for(let c=0;c<=i.length;++c){if(c2){const u=r.lastIndexOf(t);u===-1?(r="",o=0):(r=r.slice(0,u),o=r.length-1-r.lastIndexOf(t)),s=c,a=0;continue}else if(r.length!==0){r="",o=0,s=c,a=0;continue}}e&&(r+=r.length>0?`${t}..`:"..",o=2)}else r.length>0?r+=`${t}${i.slice(s+1,c)}`:r=i.slice(s+1,c),o=c-s-1;s=c,a=0}else l===vv&&a!==-1?++a:a=-1}return r}function Spe(i,e){f5e(e,"pathObject");const t=e.dir||e.root,n=e.base||`${e.name||""}${e.ext||""}`;return t?t===e.root?`${t}${n}`:`${t}${i}${n}`:n}const wl={resolve(...i){let e="",t="",n=!1;for(let r=i.length-1;r>=-1;r--){let o;if(r>=0){if(o=i[r],Oo(o,"path"),o.length===0)continue}else e.length===0?o=PA():(o=s$[`=${e}`]||PA(),(o===void 0||o.slice(0,2).toLowerCase()!==e.toLowerCase()&&o.charCodeAt(2)===jl)&&(o=`${e}\\`));const s=o.length;let a=0,l="",c=!1;const u=o.charCodeAt(0);if(s===1)li(u)&&(a=1,c=!0);else if(li(u))if(c=!0,li(o.charCodeAt(1))){let d=2,h=d;for(;d2&&li(o.charCodeAt(2))&&(c=!0,a=3));if(l.length>0)if(e.length>0){if(l.toLowerCase()!==e.toLowerCase())continue}else e=l;if(n){if(e.length>0)break}else if(t=`${o.slice(a)}\\${t}`,n=c,c&&e.length>0)break}return t=OA(t,!n,"\\",li),n?`${e}\\${t}`:`${e}${t}`||"."},normalize(i){Oo(i,"path");const e=i.length;if(e===0)return".";let t=0,n,r=!1;const o=i.charCodeAt(0);if(e===1)return a$(o)?"\\":i;if(li(o))if(r=!0,li(i.charCodeAt(1))){let a=2,l=a;for(;a2&&li(i.charCodeAt(2))&&(r=!0,t=3));let s=t0&&li(i.charCodeAt(e-1))&&(s+="\\"),n===void 0?r?`\\${s}`:s:r?`${n}\\${s}`:`${n}${s}`},isAbsolute(i){Oo(i,"path");const e=i.length;if(e===0)return!1;const t=i.charCodeAt(0);return li(t)||e>2&&sm(t)&&i.charCodeAt(1)===om&&li(i.charCodeAt(2))},join(...i){if(i.length===0)return".";let e,t;for(let o=0;o0&&(e===void 0?e=t=s:e+=`\\${s}`)}if(e===void 0)return".";let n=!0,r=0;if(typeof t=="string"&&li(t.charCodeAt(0))){++r;const o=t.length;o>1&&li(t.charCodeAt(1))&&(++r,o>2&&(li(t.charCodeAt(2))?++r:n=!1))}if(n){for(;r=2&&(e=`\\${e.slice(r)}`)}return wl.normalize(e)},relative(i,e){if(Oo(i,"from"),Oo(e,"to"),i===e)return"";const t=wl.resolve(i),n=wl.resolve(e);if(t===n||(i=t.toLowerCase(),e=n.toLowerCase(),i===e))return"";let r=0;for(;rr&&i.charCodeAt(o-1)===jl;)o--;const s=o-r;let a=0;for(;aa&&e.charCodeAt(l-1)===jl;)l--;const c=l-a,u=su){if(e.charCodeAt(a+h)===jl)return n.slice(a+h+1);if(h===2)return n.slice(a+h)}s>u&&(i.charCodeAt(r+h)===jl?d=h:h===2&&(d=3)),d===-1&&(d=0)}let f="";for(h=r+d+1;h<=o;++h)(h===o||i.charCodeAt(h)===jl)&&(f+=f.length===0?"..":"\\..");return a+=d,f.length>0?`${f}${n.slice(a,l)}`:(n.charCodeAt(a)===jl&&++a,n.slice(a,l))},toNamespacedPath(i){if(typeof i!="string"||i.length===0)return i;const e=wl.resolve(i);if(e.length<=2)return i;if(e.charCodeAt(0)===jl){if(e.charCodeAt(1)===jl){const t=e.charCodeAt(2);if(t!==h5e&&t!==vv)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(sm(e.charCodeAt(0))&&e.charCodeAt(1)===om&&e.charCodeAt(2)===jl)return`\\\\?\\${e}`;return i},dirname(i){Oo(i,"path");const e=i.length;if(e===0)return".";let t=-1,n=0;const r=i.charCodeAt(0);if(e===1)return li(r)?i:".";if(li(r)){if(t=n=1,li(i.charCodeAt(1))){let a=2,l=a;for(;a2&&li(i.charCodeAt(2))?3:2,n=t);let o=-1,s=!0;for(let a=e-1;a>=n;--a)if(li(i.charCodeAt(a))){if(!s){o=a;break}}else s=!1;if(o===-1){if(t===-1)return".";o=t}return i.slice(0,o)},basename(i,e){e!==void 0&&Oo(e,"ext"),Oo(i,"path");let t=0,n=-1,r=!0,o;if(i.length>=2&&sm(i.charCodeAt(0))&&i.charCodeAt(1)===om&&(t=2),e!==void 0&&e.length>0&&e.length<=i.length){if(e===i)return"";let s=e.length-1,a=-1;for(o=i.length-1;o>=t;--o){const l=i.charCodeAt(o);if(li(l)){if(!r){t=o+1;break}}else a===-1&&(r=!1,a=o+1),s>=0&&(l===e.charCodeAt(s)?--s===-1&&(n=o):(s=-1,n=a))}return t===n?n=a:n===-1&&(n=i.length),i.slice(t,n)}for(o=i.length-1;o>=t;--o)if(li(i.charCodeAt(o))){if(!r){t=o+1;break}}else n===-1&&(r=!1,n=o+1);return n===-1?"":i.slice(t,n)},extname(i){Oo(i,"path");let e=0,t=-1,n=0,r=-1,o=!0,s=0;i.length>=2&&i.charCodeAt(1)===om&&sm(i.charCodeAt(0))&&(e=n=2);for(let a=i.length-1;a>=e;--a){const l=i.charCodeAt(a);if(li(l)){if(!o){n=a+1;break}continue}r===-1&&(o=!1,r=a+1),l===vv?t===-1?t=a:s!==1&&(s=1):t!==-1&&(s=-1)}return t===-1||r===-1||s===0||s===1&&t===r-1&&t===n+1?"":i.slice(t,r)},format:Spe.bind(null,"\\"),parse(i){Oo(i,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return e;const t=i.length;let n=0,r=i.charCodeAt(0);if(t===1)return li(r)?(e.root=e.dir=i,e):(e.base=e.name=i,e);if(li(r)){if(n=1,li(i.charCodeAt(1))){let d=2,h=d;for(;d0&&(e.root=i.slice(0,n));let o=-1,s=n,a=-1,l=!0,c=i.length-1,u=0;for(;c>=n;--c){if(r=i.charCodeAt(c),li(r)){if(!l){s=c+1;break}continue}a===-1&&(l=!1,a=c+1),r===vv?o===-1?o=c:u!==1&&(u=1):o!==-1&&(u=-1)}return a!==-1&&(o===-1||u===0||u===1&&o===a-1&&o===s+1?e.base=e.name=i.slice(s,a):(e.name=i.slice(s,o),e.base=i.slice(s,a),e.ext=i.slice(o,a))),s>0&&s!==n?e.dir=i.slice(0,s-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},g5e=(()=>{if(L_){const i=/\\/g;return()=>{const e=PA().replace(i,"/");return e.slice(e.indexOf("/"))}}return()=>PA()})(),oo={resolve(...i){let e="",t=!1;for(let n=i.length-1;n>=-1&&!t;n--){const r=n>=0?i[n]:g5e();Oo(r,"path"),r.length!==0&&(e=`${r}/${e}`,t=r.charCodeAt(0)===zs)}return e=OA(e,!t,"/",a$),t?`/${e}`:e.length>0?e:"."},normalize(i){if(Oo(i,"path"),i.length===0)return".";const e=i.charCodeAt(0)===zs,t=i.charCodeAt(i.length-1)===zs;return i=OA(i,!e,"/",a$),i.length===0?e?"/":t?"./":".":(t&&(i+="/"),e?`/${i}`:i)},isAbsolute(i){return Oo(i,"path"),i.length>0&&i.charCodeAt(0)===zs},join(...i){if(i.length===0)return".";let e;for(let t=0;t0&&(e===void 0?e=n:e+=`/${n}`)}return e===void 0?".":oo.normalize(e)},relative(i,e){if(Oo(i,"from"),Oo(e,"to"),i===e||(i=oo.resolve(i),e=oo.resolve(e),i===e))return"";const t=1,n=i.length,r=n-t,o=1,s=e.length-o,a=ra){if(e.charCodeAt(o+c)===zs)return e.slice(o+c+1);if(c===0)return e.slice(o+c)}else r>a&&(i.charCodeAt(t+c)===zs?l=c:c===0&&(l=0));let u="";for(c=t+l+1;c<=n;++c)(c===n||i.charCodeAt(c)===zs)&&(u+=u.length===0?"..":"/..");return`${u}${e.slice(o+l)}`},toNamespacedPath(i){return i},dirname(i){if(Oo(i,"path"),i.length===0)return".";const e=i.charCodeAt(0)===zs;let t=-1,n=!0;for(let r=i.length-1;r>=1;--r)if(i.charCodeAt(r)===zs){if(!n){t=r;break}}else n=!1;return t===-1?e?"/":".":e&&t===1?"//":i.slice(0,t)},basename(i,e){e!==void 0&&Oo(e,"ext"),Oo(i,"path");let t=0,n=-1,r=!0,o;if(e!==void 0&&e.length>0&&e.length<=i.length){if(e===i)return"";let s=e.length-1,a=-1;for(o=i.length-1;o>=0;--o){const l=i.charCodeAt(o);if(l===zs){if(!r){t=o+1;break}}else a===-1&&(r=!1,a=o+1),s>=0&&(l===e.charCodeAt(s)?--s===-1&&(n=o):(s=-1,n=a))}return t===n?n=a:n===-1&&(n=i.length),i.slice(t,n)}for(o=i.length-1;o>=0;--o)if(i.charCodeAt(o)===zs){if(!r){t=o+1;break}}else n===-1&&(r=!1,n=o+1);return n===-1?"":i.slice(t,n)},extname(i){Oo(i,"path");let e=-1,t=0,n=-1,r=!0,o=0;for(let s=i.length-1;s>=0;--s){const a=i.charCodeAt(s);if(a===zs){if(!r){t=s+1;break}continue}n===-1&&(r=!1,n=s+1),a===vv?e===-1?e=s:o!==1&&(o=1):e!==-1&&(o=-1)}return e===-1||n===-1||o===0||o===1&&e===n-1&&e===t+1?"":i.slice(e,n)},format:Spe.bind(null,"/"),parse(i){Oo(i,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return e;const t=i.charCodeAt(0)===zs;let n;t?(e.root="/",n=1):n=0;let r=-1,o=0,s=-1,a=!0,l=i.length-1,c=0;for(;l>=n;--l){const u=i.charCodeAt(l);if(u===zs){if(!a){o=l+1;break}continue}s===-1&&(a=!1,s=l+1),u===vv?r===-1?r=l:c!==1&&(c=1):r!==-1&&(c=-1)}if(s!==-1){const u=o===0&&t?1:o;r===-1||c===0||c===1&&r===s-1&&r===o+1?e.base=e.name=i.slice(u,s):(e.name=i.slice(u,r),e.base=i.slice(u,s),e.ext=i.slice(r,s))}return o>0?e.dir=i.slice(0,o-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};oo.win32=wl.win32=wl;oo.posix=wl.posix=oo;const xpe=L_?wl.normalize:oo.normalize,p5e=L_?wl.resolve:oo.resolve,m5e=L_?wl.relative:oo.relative,Lpe=L_?wl.dirname:oo.dirname,_v=L_?wl.basename:oo.basename,v5e=L_?wl.extname:oo.extname,eh=L_?wl.sep:oo.sep,_5e=/^\w[\w\d+.-]*$/,b5e=/^\//,C5e=/^\/\//;function y5e(i,e){if(!i.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${i.authority}", path: "${i.path}", query: "${i.query}", fragment: "${i.fragment}"}`);if(i.scheme&&!_5e.test(i.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(i.path){if(i.authority){if(!b5e.test(i.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(C5e.test(i.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function w5e(i,e){return!i&&!e?"file":i}function S5e(i,e){switch(i){case"https":case"http":case"file":e?e[0]!==Bd&&(e=Bd+e):e=Bd;break}return e}const Or="",Bd="/",x5e=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class At{static isUri(e){return e instanceof At?!0:e?typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function":!1}constructor(e,t,n,r,o,s=!1){typeof e=="object"?(this.scheme=e.scheme||Or,this.authority=e.authority||Or,this.path=e.path||Or,this.query=e.query||Or,this.fragment=e.fragment||Or):(this.scheme=w5e(e,s),this.authority=t||Or,this.path=S5e(this.scheme,n||Or),this.query=r||Or,this.fragment=o||Or,y5e(this,s))}get fsPath(){return FA(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:n,path:r,query:o,fragment:s}=e;return t===void 0?t=this.scheme:t===null&&(t=Or),n===void 0?n=this.authority:n===null&&(n=Or),r===void 0?r=this.path:r===null&&(r=Or),o===void 0?o=this.query:o===null&&(o=Or),s===void 0?s=this.fragment:s===null&&(s=Or),t===this.scheme&&n===this.authority&&r===this.path&&o===this.query&&s===this.fragment?this:new jC(t,n,r,o,s)}static parse(e,t=!1){const n=x5e.exec(e);return n?new jC(n[2]||Or,JN(n[4]||Or),JN(n[5]||Or),JN(n[7]||Or),JN(n[9]||Or),t):new jC(Or,Or,Or,Or,Or)}static file(e){let t=Or;if(Rs&&(e=e.replace(/\\/g,Bd)),e[0]===Bd&&e[1]===Bd){const n=e.indexOf(Bd,2);n===-1?(t=e.substring(2),e=Bd):(t=e.substring(2,n),e=e.substring(n)||Bd)}return new jC("file",t,e,Or,Or)}static from(e,t){return new jC(e.scheme,e.authority,e.path,e.query,e.fragment,t)}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let n;return Rs&&e.scheme==="file"?n=At.file(wl.join(FA(e,!0),...t)).path:n=oo.join(e.path,...t),e.with({path:n})}toString(e=!1){return l$(this,e)}toJSON(){return this}static revive(e){var t,n;if(e){if(e instanceof At)return e;{const r=new jC(e);return r._formatted=(t=e.external)!==null&&t!==void 0?t:null,r._fsPath=e._sep===Epe&&(n=e.fsPath)!==null&&n!==void 0?n:null,r}}else return e}}const Epe=Rs?1:void 0;let jC=class extends At{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=FA(this,!1)),this._fsPath}toString(e=!1){return e?l$(this,!0):(this._formatted||(this._formatted=l$(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=Epe),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}};const Dpe={[58]:"%3A",[47]:"%2F",[63]:"%3F",[35]:"%23",[91]:"%5B",[93]:"%5D",[64]:"%40",[33]:"%21",[36]:"%24",[38]:"%26",[39]:"%27",[40]:"%28",[41]:"%29",[42]:"%2A",[43]:"%2B",[44]:"%2C",[59]:"%3B",[61]:"%3D",[32]:"%20"};function $ne(i,e,t){let n,r=-1;for(let o=0;o=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57||s===45||s===46||s===95||s===126||e&&s===47||t&&s===91||t&&s===93||t&&s===58)r!==-1&&(n+=encodeURIComponent(i.substring(r,o)),r=-1),n!==void 0&&(n+=i.charAt(o));else{n===void 0&&(n=i.substr(0,o));const a=Dpe[s];a!==void 0?(r!==-1&&(n+=encodeURIComponent(i.substring(r,o)),r=-1),n+=a):r===-1&&(r=o)}}return r!==-1&&(n+=encodeURIComponent(i.substring(r))),n!==void 0?n:i}function L5e(i){let e;for(let t=0;t1&&i.scheme==="file"?t=`//${i.authority}${i.path}`:i.path.charCodeAt(0)===47&&(i.path.charCodeAt(1)>=65&&i.path.charCodeAt(1)<=90||i.path.charCodeAt(1)>=97&&i.path.charCodeAt(1)<=122)&&i.path.charCodeAt(2)===58?e?t=i.path.substr(1):t=i.path[1].toLowerCase()+i.path.substr(2):t=i.path,Rs&&(t=t.replace(/\//g,"\\")),t}function l$(i,e){const t=e?L5e:$ne;let n="",{scheme:r,authority:o,path:s,query:a,fragment:l}=i;if(r&&(n+=r,n+=":"),(o||r==="file")&&(n+=Bd,n+=Bd),o){let c=o.indexOf("@");if(c!==-1){const u=o.substr(0,c);o=o.substr(c+1),c=u.lastIndexOf(":"),c===-1?n+=t(u,!1,!1):(n+=t(u.substr(0,c),!1,!1),n+=":",n+=t(u.substr(c+1),!1,!0)),n+="@"}o=o.toLowerCase(),c=o.lastIndexOf(":"),c===-1?n+=t(o,!1,!0):(n+=t(o.substr(0,c),!1,!0),n+=o.substr(c))}if(s){if(s.length>=3&&s.charCodeAt(0)===47&&s.charCodeAt(2)===58){const c=s.charCodeAt(1);c>=65&&c<=90&&(s=`/${String.fromCharCode(c+32)}:${s.substr(3)}`)}else if(s.length>=2&&s.charCodeAt(1)===58){const c=s.charCodeAt(0);c>=65&&c<=90&&(s=`${String.fromCharCode(c+32)}:${s.substr(2)}`)}n+=t(s,!0,!1)}return a&&(n+="?",n+=t(a,!1,!1)),l&&(n+="#",n+=e?l:$ne(l,!1,!1)),n}function Ipe(i){try{return decodeURIComponent(i)}catch{return i.length>3?i.substr(0,3)+Ipe(i.substr(3)):i}}const Hne=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function JN(i){return i.match(Hne)?i.replace(Hne,e=>Ipe(e)):i}let ae=class h0{constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new h0(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return h0.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return h0.isBefore(this,e)}static isBefore(e,t){return e.lineNumbern||e===n&&t>r?(this.startLineNumber=n,this.startColumn=r,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=n,this.endColumn=r)}isEmpty(){return Ko.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return Ko.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.columne.endColumn)}static strictContainsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<=e.startColumn||t.lineNumber===e.endLineNumber&&t.column>=e.endColumn)}containsRange(e){return Ko.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumne.endColumn)}strictContainsRange(e){return Ko.strictContainsRange(this,e)}static strictContainsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)}plusRange(e){return Ko.plusRange(this,e)}static plusRange(e,t){let n,r,o,s;return t.startLineNumbere.endLineNumber?(o=t.endLineNumber,s=t.endColumn):t.endLineNumber===e.endLineNumber?(o=t.endLineNumber,s=Math.max(t.endColumn,e.endColumn)):(o=e.endLineNumber,s=e.endColumn),new Ko(n,r,o,s)}intersectRanges(e){return Ko.intersectRanges(this,e)}static intersectRanges(e,t){let n=e.startLineNumber,r=e.startColumn,o=e.endLineNumber,s=e.endColumn;const a=t.startLineNumber,l=t.startColumn,c=t.endLineNumber,u=t.endColumn;return nc?(o=c,s=u):o===c&&(s=Math.min(s,u)),n>o||n===o&&r>s?null:new Ko(n,r,o,s)}equalsRange(e){return Ko.equalsRange(this,e)}static equalsRange(e,t){return!e&&!t?!0:!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return Ko.getEndPosition(this)}static getEndPosition(e){return new ae(e.endLineNumber,e.endColumn)}getStartPosition(){return Ko.getStartPosition(this)}static getStartPosition(e){return new ae(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new Ko(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new Ko(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return Ko.collapseToStart(this)}static collapseToStart(e){return new Ko(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return Ko.collapseToEnd(this)}static collapseToEnd(e){return new Ko(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new Ko(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}static fromPositions(e,t=e){return new Ko(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new Ko(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,t){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}},yt=class Ru extends B{constructor(e,t,n,r){super(e,t,n,r),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=n,this.positionColumn=r}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return Ru.selectionsEqual(this,e)}static selectionsEqual(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1}setEndPosition(e,t){return this.getDirection()===0?new Ru(this.startLineNumber,this.startColumn,e,t):new Ru(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new ae(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new ae(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return this.getDirection()===0?new Ru(e,t,this.endLineNumber,this.endColumn):new Ru(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new Ru(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return t===0?new Ru(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new Ru(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new Ru(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(let n=0,r=e.length;n{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){var n;(n=this._factories.get(e))===null||n===void 0||n.dispose();const r=new D5e(this,e,t);return this._factories.set(e,r),Rt(()=>{const o=this._factories.get(e);!o||o!==r||(this._factories.delete(e),o.dispose())})}async getOrCreate(e){const t=this.get(e);if(t)return t;const n=this._factories.get(e);return!n||n.isResolved?null:(await n.resolve(),this.get(e))}isResolved(e){if(this.get(e))return!0;const n=this._factories.get(e);return!!(!n||n.isResolved)}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._tokenizationSupports.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null}};class D5e extends fe{get isResolved(){return this._isResolved}constructor(e,t,n){super(),this._registry=e,this._languageId=t,this._factory=n,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}async resolve(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise}async _create(){const e=await this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))}}let wD=class{constructor(e,t,n){this.offset=e,this.type=t,this.language=n,this._tokenBrand=void 0}toString(){return"("+this.offset+", "+this.type+")"}};class fq{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}}class s4{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}var SD;(function(i){const e=new Map;e.set(0,Xe.symbolMethod),e.set(1,Xe.symbolFunction),e.set(2,Xe.symbolConstructor),e.set(3,Xe.symbolField),e.set(4,Xe.symbolVariable),e.set(5,Xe.symbolClass),e.set(6,Xe.symbolStruct),e.set(7,Xe.symbolInterface),e.set(8,Xe.symbolModule),e.set(9,Xe.symbolProperty),e.set(10,Xe.symbolEvent),e.set(11,Xe.symbolOperator),e.set(12,Xe.symbolUnit),e.set(13,Xe.symbolValue),e.set(15,Xe.symbolEnum),e.set(14,Xe.symbolConstant),e.set(15,Xe.symbolEnum),e.set(16,Xe.symbolEnumMember),e.set(17,Xe.symbolKeyword),e.set(27,Xe.symbolSnippet),e.set(18,Xe.symbolText),e.set(19,Xe.symbolColor),e.set(20,Xe.symbolFile),e.set(21,Xe.symbolReference),e.set(22,Xe.symbolCustomColor),e.set(23,Xe.symbolFolder),e.set(24,Xe.symbolTypeParameter),e.set(25,Xe.account),e.set(26,Xe.issues);function t(o){let s=e.get(o);return s||(console.info("No codicon found for CompletionItemKind "+o),s=Xe.symbolProperty),s}i.toIcon=t;const n=new Map;n.set("method",0),n.set("function",1),n.set("constructor",2),n.set("field",3),n.set("variable",4),n.set("class",5),n.set("struct",6),n.set("interface",7),n.set("module",8),n.set("property",9),n.set("event",10),n.set("operator",11),n.set("unit",12),n.set("value",13),n.set("constant",14),n.set("enum",15),n.set("enum-member",16),n.set("enumMember",16),n.set("keyword",17),n.set("snippet",27),n.set("text",18),n.set("color",19),n.set("file",20),n.set("reference",21),n.set("customcolor",22),n.set("folder",23),n.set("type-parameter",24),n.set("typeParameter",24),n.set("account",25),n.set("issue",26);function r(o,s){let a=n.get(o);return typeof a>"u"&&!s&&(a=9),a}i.fromString=r})(SD||(SD={}));var fp;(function(i){i[i.Automatic=0]="Automatic",i[i.Explicit=1]="Explicit"})(fp||(fp={}));class Tpe{constructor(e,t,n,r){this.range=e,this.text=t,this.completionKind=n,this.isSnippetText=r}equals(e){return B.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}var Tf;(function(i){i[i.Invoke=1]="Invoke",i[i.TriggerCharacter=2]="TriggerCharacter",i[i.ContentChange=3]="ContentChange"})(Tf||(Tf={}));var xD;(function(i){i[i.Text=0]="Text",i[i.Read=1]="Read",i[i.Write=2]="Write"})(xD||(xD={}));function I5e(i){return i&&At.isUri(i.uri)&&B.isIRange(i.range)&&(B.isIRange(i.originSelectionRange)||B.isIRange(i.targetSelectionRange))}const k5e={[17]:w("Array","array"),[16]:w("Boolean","boolean"),[4]:w("Class","class"),[13]:w("Constant","constant"),[8]:w("Constructor","constructor"),[9]:w("Enum","enumeration"),[21]:w("EnumMember","enumeration member"),[23]:w("Event","event"),[7]:w("Field","field"),[0]:w("File","file"),[11]:w("Function","function"),[10]:w("Interface","interface"),[19]:w("Key","key"),[5]:w("Method","method"),[1]:w("Module","module"),[2]:w("Namespace","namespace"),[20]:w("Null","null"),[15]:w("Number","number"),[18]:w("Object","object"),[24]:w("Operator","operator"),[3]:w("Package","package"),[6]:w("Property","property"),[14]:w("String","string"),[22]:w("Struct","struct"),[25]:w("TypeParameter","type parameter"),[12]:w("Variable","variable")};function T5e(i,e){return w("symbolAriaLabel","{0} ({1})",i,k5e[e])}var BA;(function(i){const e=new Map;e.set(0,Xe.symbolFile),e.set(1,Xe.symbolModule),e.set(2,Xe.symbolNamespace),e.set(3,Xe.symbolPackage),e.set(4,Xe.symbolClass),e.set(5,Xe.symbolMethod),e.set(6,Xe.symbolProperty),e.set(7,Xe.symbolField),e.set(8,Xe.symbolConstructor),e.set(9,Xe.symbolEnum),e.set(10,Xe.symbolInterface),e.set(11,Xe.symbolFunction),e.set(12,Xe.symbolVariable),e.set(13,Xe.symbolConstant),e.set(14,Xe.symbolString),e.set(15,Xe.symbolNumber),e.set(16,Xe.symbolBoolean),e.set(17,Xe.symbolArray),e.set(18,Xe.symbolObject),e.set(19,Xe.symbolKey),e.set(20,Xe.symbolNull),e.set(21,Xe.symbolEnumMember),e.set(22,Xe.symbolStruct),e.set(23,Xe.symbolEvent),e.set(24,Xe.symbolOperator),e.set(25,Xe.symbolTypeParameter);function t(n){let r=e.get(n);return r||(console.info("No codicon found for SymbolKind "+n),r=Xe.symbolProperty),r}i.toIcon=t})(BA||(BA={}));class ba{static fromValue(e){switch(e){case"comment":return ba.Comment;case"imports":return ba.Imports;case"region":return ba.Region}return new ba(e)}constructor(e){this.value=e}}ba.Comment=new ba("comment");ba.Imports=new ba("imports");ba.Region=new ba("region");var Vne;(function(i){i[i.AIGenerated=1]="AIGenerated"})(Vne||(Vne={}));var u$;(function(i){function e(t){return!t||typeof t!="object"?!1:typeof t.id=="string"&&typeof t.title=="string"}i.is=e})(u$||(u$={}));var WA;(function(i){i[i.Type=1]="Type",i[i.Parameter=2]="Parameter"})(WA||(WA={}));class N5e{constructor(e){this.createSupport=e,this._tokenizationSupport=null}dispose(){this._tokenizationSupport&&this._tokenizationSupport.then(e=>{e&&e.dispose()})}get tokenizationSupport(){return this._tokenizationSupport||(this._tokenizationSupport=this.createSupport()),this._tokenizationSupport}}const hr=new E5e;var $A;(function(i){i[i.Invoke=0]="Invoke",i[i.Automatic=1]="Automatic"})($A||($A={}));var d$;(function(i){i[i.Unknown=0]="Unknown",i[i.Disabled=1]="Disabled",i[i.Enabled=2]="Enabled"})(d$||(d$={}));var h$;(function(i){i[i.Invoke=1]="Invoke",i[i.Auto=2]="Auto"})(h$||(h$={}));var f$;(function(i){i[i.None=0]="None",i[i.KeepWhitespace=1]="KeepWhitespace",i[i.InsertAsSnippet=4]="InsertAsSnippet"})(f$||(f$={}));var g$;(function(i){i[i.Method=0]="Method",i[i.Function=1]="Function",i[i.Constructor=2]="Constructor",i[i.Field=3]="Field",i[i.Variable=4]="Variable",i[i.Class=5]="Class",i[i.Struct=6]="Struct",i[i.Interface=7]="Interface",i[i.Module=8]="Module",i[i.Property=9]="Property",i[i.Event=10]="Event",i[i.Operator=11]="Operator",i[i.Unit=12]="Unit",i[i.Value=13]="Value",i[i.Constant=14]="Constant",i[i.Enum=15]="Enum",i[i.EnumMember=16]="EnumMember",i[i.Keyword=17]="Keyword",i[i.Text=18]="Text",i[i.Color=19]="Color",i[i.File=20]="File",i[i.Reference=21]="Reference",i[i.Customcolor=22]="Customcolor",i[i.Folder=23]="Folder",i[i.TypeParameter=24]="TypeParameter",i[i.User=25]="User",i[i.Issue=26]="Issue",i[i.Snippet=27]="Snippet"})(g$||(g$={}));var p$;(function(i){i[i.Deprecated=1]="Deprecated"})(p$||(p$={}));var m$;(function(i){i[i.Invoke=0]="Invoke",i[i.TriggerCharacter=1]="TriggerCharacter",i[i.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(m$||(m$={}));var v$;(function(i){i[i.EXACT=0]="EXACT",i[i.ABOVE=1]="ABOVE",i[i.BELOW=2]="BELOW"})(v$||(v$={}));var _$;(function(i){i[i.NotSet=0]="NotSet",i[i.ContentFlush=1]="ContentFlush",i[i.RecoverFromMarkers=2]="RecoverFromMarkers",i[i.Explicit=3]="Explicit",i[i.Paste=4]="Paste",i[i.Undo=5]="Undo",i[i.Redo=6]="Redo"})(_$||(_$={}));var b$;(function(i){i[i.LF=1]="LF",i[i.CRLF=2]="CRLF"})(b$||(b$={}));var C$;(function(i){i[i.Text=0]="Text",i[i.Read=1]="Read",i[i.Write=2]="Write"})(C$||(C$={}));var y$;(function(i){i[i.None=0]="None",i[i.Keep=1]="Keep",i[i.Brackets=2]="Brackets",i[i.Advanced=3]="Advanced",i[i.Full=4]="Full"})(y$||(y$={}));var w$;(function(i){i[i.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",i[i.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",i[i.accessibilitySupport=2]="accessibilitySupport",i[i.accessibilityPageSize=3]="accessibilityPageSize",i[i.ariaLabel=4]="ariaLabel",i[i.ariaRequired=5]="ariaRequired",i[i.autoClosingBrackets=6]="autoClosingBrackets",i[i.autoClosingComments=7]="autoClosingComments",i[i.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",i[i.autoClosingDelete=9]="autoClosingDelete",i[i.autoClosingOvertype=10]="autoClosingOvertype",i[i.autoClosingQuotes=11]="autoClosingQuotes",i[i.autoIndent=12]="autoIndent",i[i.automaticLayout=13]="automaticLayout",i[i.autoSurround=14]="autoSurround",i[i.bracketPairColorization=15]="bracketPairColorization",i[i.guides=16]="guides",i[i.codeLens=17]="codeLens",i[i.codeLensFontFamily=18]="codeLensFontFamily",i[i.codeLensFontSize=19]="codeLensFontSize",i[i.colorDecorators=20]="colorDecorators",i[i.colorDecoratorsLimit=21]="colorDecoratorsLimit",i[i.columnSelection=22]="columnSelection",i[i.comments=23]="comments",i[i.contextmenu=24]="contextmenu",i[i.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",i[i.cursorBlinking=26]="cursorBlinking",i[i.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",i[i.cursorStyle=28]="cursorStyle",i[i.cursorSurroundingLines=29]="cursorSurroundingLines",i[i.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",i[i.cursorWidth=31]="cursorWidth",i[i.disableLayerHinting=32]="disableLayerHinting",i[i.disableMonospaceOptimizations=33]="disableMonospaceOptimizations",i[i.domReadOnly=34]="domReadOnly",i[i.dragAndDrop=35]="dragAndDrop",i[i.dropIntoEditor=36]="dropIntoEditor",i[i.emptySelectionClipboard=37]="emptySelectionClipboard",i[i.experimentalWhitespaceRendering=38]="experimentalWhitespaceRendering",i[i.extraEditorClassName=39]="extraEditorClassName",i[i.fastScrollSensitivity=40]="fastScrollSensitivity",i[i.find=41]="find",i[i.fixedOverflowWidgets=42]="fixedOverflowWidgets",i[i.folding=43]="folding",i[i.foldingStrategy=44]="foldingStrategy",i[i.foldingHighlight=45]="foldingHighlight",i[i.foldingImportsByDefault=46]="foldingImportsByDefault",i[i.foldingMaximumRegions=47]="foldingMaximumRegions",i[i.unfoldOnClickAfterEndOfLine=48]="unfoldOnClickAfterEndOfLine",i[i.fontFamily=49]="fontFamily",i[i.fontInfo=50]="fontInfo",i[i.fontLigatures=51]="fontLigatures",i[i.fontSize=52]="fontSize",i[i.fontWeight=53]="fontWeight",i[i.fontVariations=54]="fontVariations",i[i.formatOnPaste=55]="formatOnPaste",i[i.formatOnType=56]="formatOnType",i[i.glyphMargin=57]="glyphMargin",i[i.gotoLocation=58]="gotoLocation",i[i.hideCursorInOverviewRuler=59]="hideCursorInOverviewRuler",i[i.hover=60]="hover",i[i.inDiffEditor=61]="inDiffEditor",i[i.inlineSuggest=62]="inlineSuggest",i[i.inlineEdit=63]="inlineEdit",i[i.letterSpacing=64]="letterSpacing",i[i.lightbulb=65]="lightbulb",i[i.lineDecorationsWidth=66]="lineDecorationsWidth",i[i.lineHeight=67]="lineHeight",i[i.lineNumbers=68]="lineNumbers",i[i.lineNumbersMinChars=69]="lineNumbersMinChars",i[i.linkedEditing=70]="linkedEditing",i[i.links=71]="links",i[i.matchBrackets=72]="matchBrackets",i[i.minimap=73]="minimap",i[i.mouseStyle=74]="mouseStyle",i[i.mouseWheelScrollSensitivity=75]="mouseWheelScrollSensitivity",i[i.mouseWheelZoom=76]="mouseWheelZoom",i[i.multiCursorMergeOverlapping=77]="multiCursorMergeOverlapping",i[i.multiCursorModifier=78]="multiCursorModifier",i[i.multiCursorPaste=79]="multiCursorPaste",i[i.multiCursorLimit=80]="multiCursorLimit",i[i.occurrencesHighlight=81]="occurrencesHighlight",i[i.overviewRulerBorder=82]="overviewRulerBorder",i[i.overviewRulerLanes=83]="overviewRulerLanes",i[i.padding=84]="padding",i[i.pasteAs=85]="pasteAs",i[i.parameterHints=86]="parameterHints",i[i.peekWidgetDefaultFocus=87]="peekWidgetDefaultFocus",i[i.definitionLinkOpensInPeek=88]="definitionLinkOpensInPeek",i[i.quickSuggestions=89]="quickSuggestions",i[i.quickSuggestionsDelay=90]="quickSuggestionsDelay",i[i.readOnly=91]="readOnly",i[i.readOnlyMessage=92]="readOnlyMessage",i[i.renameOnType=93]="renameOnType",i[i.renderControlCharacters=94]="renderControlCharacters",i[i.renderFinalNewline=95]="renderFinalNewline",i[i.renderLineHighlight=96]="renderLineHighlight",i[i.renderLineHighlightOnlyWhenFocus=97]="renderLineHighlightOnlyWhenFocus",i[i.renderValidationDecorations=98]="renderValidationDecorations",i[i.renderWhitespace=99]="renderWhitespace",i[i.revealHorizontalRightPadding=100]="revealHorizontalRightPadding",i[i.roundedSelection=101]="roundedSelection",i[i.rulers=102]="rulers",i[i.scrollbar=103]="scrollbar",i[i.scrollBeyondLastColumn=104]="scrollBeyondLastColumn",i[i.scrollBeyondLastLine=105]="scrollBeyondLastLine",i[i.scrollPredominantAxis=106]="scrollPredominantAxis",i[i.selectionClipboard=107]="selectionClipboard",i[i.selectionHighlight=108]="selectionHighlight",i[i.selectOnLineNumbers=109]="selectOnLineNumbers",i[i.showFoldingControls=110]="showFoldingControls",i[i.showUnused=111]="showUnused",i[i.snippetSuggestions=112]="snippetSuggestions",i[i.smartSelect=113]="smartSelect",i[i.smoothScrolling=114]="smoothScrolling",i[i.stickyScroll=115]="stickyScroll",i[i.stickyTabStops=116]="stickyTabStops",i[i.stopRenderingLineAfter=117]="stopRenderingLineAfter",i[i.suggest=118]="suggest",i[i.suggestFontSize=119]="suggestFontSize",i[i.suggestLineHeight=120]="suggestLineHeight",i[i.suggestOnTriggerCharacters=121]="suggestOnTriggerCharacters",i[i.suggestSelection=122]="suggestSelection",i[i.tabCompletion=123]="tabCompletion",i[i.tabIndex=124]="tabIndex",i[i.unicodeHighlighting=125]="unicodeHighlighting",i[i.unusualLineTerminators=126]="unusualLineTerminators",i[i.useShadowDOM=127]="useShadowDOM",i[i.useTabStops=128]="useTabStops",i[i.wordBreak=129]="wordBreak",i[i.wordSeparators=130]="wordSeparators",i[i.wordWrap=131]="wordWrap",i[i.wordWrapBreakAfterCharacters=132]="wordWrapBreakAfterCharacters",i[i.wordWrapBreakBeforeCharacters=133]="wordWrapBreakBeforeCharacters",i[i.wordWrapColumn=134]="wordWrapColumn",i[i.wordWrapOverride1=135]="wordWrapOverride1",i[i.wordWrapOverride2=136]="wordWrapOverride2",i[i.wrappingIndent=137]="wrappingIndent",i[i.wrappingStrategy=138]="wrappingStrategy",i[i.showDeprecated=139]="showDeprecated",i[i.inlayHints=140]="inlayHints",i[i.editorClassName=141]="editorClassName",i[i.pixelRatio=142]="pixelRatio",i[i.tabFocusMode=143]="tabFocusMode",i[i.layoutInfo=144]="layoutInfo",i[i.wrappingInfo=145]="wrappingInfo",i[i.defaultColorDecorators=146]="defaultColorDecorators",i[i.colorDecoratorsActivatedOn=147]="colorDecoratorsActivatedOn",i[i.inlineCompletionsAccessibilityVerbose=148]="inlineCompletionsAccessibilityVerbose"})(w$||(w$={}));var S$;(function(i){i[i.TextDefined=0]="TextDefined",i[i.LF=1]="LF",i[i.CRLF=2]="CRLF"})(S$||(S$={}));var x$;(function(i){i[i.LF=0]="LF",i[i.CRLF=1]="CRLF"})(x$||(x$={}));var L$;(function(i){i[i.Left=1]="Left",i[i.Center=2]="Center",i[i.Right=3]="Right"})(L$||(L$={}));var E$;(function(i){i[i.None=0]="None",i[i.Indent=1]="Indent",i[i.IndentOutdent=2]="IndentOutdent",i[i.Outdent=3]="Outdent"})(E$||(E$={}));var D$;(function(i){i[i.Both=0]="Both",i[i.Right=1]="Right",i[i.Left=2]="Left",i[i.None=3]="None"})(D$||(D$={}));var I$;(function(i){i[i.Type=1]="Type",i[i.Parameter=2]="Parameter"})(I$||(I$={}));var k$;(function(i){i[i.Automatic=0]="Automatic",i[i.Explicit=1]="Explicit"})(k$||(k$={}));var T$;(function(i){i[i.Invoke=0]="Invoke",i[i.Automatic=1]="Automatic"})(T$||(T$={}));var N$;(function(i){i[i.DependsOnKbLayout=-1]="DependsOnKbLayout",i[i.Unknown=0]="Unknown",i[i.Backspace=1]="Backspace",i[i.Tab=2]="Tab",i[i.Enter=3]="Enter",i[i.Shift=4]="Shift",i[i.Ctrl=5]="Ctrl",i[i.Alt=6]="Alt",i[i.PauseBreak=7]="PauseBreak",i[i.CapsLock=8]="CapsLock",i[i.Escape=9]="Escape",i[i.Space=10]="Space",i[i.PageUp=11]="PageUp",i[i.PageDown=12]="PageDown",i[i.End=13]="End",i[i.Home=14]="Home",i[i.LeftArrow=15]="LeftArrow",i[i.UpArrow=16]="UpArrow",i[i.RightArrow=17]="RightArrow",i[i.DownArrow=18]="DownArrow",i[i.Insert=19]="Insert",i[i.Delete=20]="Delete",i[i.Digit0=21]="Digit0",i[i.Digit1=22]="Digit1",i[i.Digit2=23]="Digit2",i[i.Digit3=24]="Digit3",i[i.Digit4=25]="Digit4",i[i.Digit5=26]="Digit5",i[i.Digit6=27]="Digit6",i[i.Digit7=28]="Digit7",i[i.Digit8=29]="Digit8",i[i.Digit9=30]="Digit9",i[i.KeyA=31]="KeyA",i[i.KeyB=32]="KeyB",i[i.KeyC=33]="KeyC",i[i.KeyD=34]="KeyD",i[i.KeyE=35]="KeyE",i[i.KeyF=36]="KeyF",i[i.KeyG=37]="KeyG",i[i.KeyH=38]="KeyH",i[i.KeyI=39]="KeyI",i[i.KeyJ=40]="KeyJ",i[i.KeyK=41]="KeyK",i[i.KeyL=42]="KeyL",i[i.KeyM=43]="KeyM",i[i.KeyN=44]="KeyN",i[i.KeyO=45]="KeyO",i[i.KeyP=46]="KeyP",i[i.KeyQ=47]="KeyQ",i[i.KeyR=48]="KeyR",i[i.KeyS=49]="KeyS",i[i.KeyT=50]="KeyT",i[i.KeyU=51]="KeyU",i[i.KeyV=52]="KeyV",i[i.KeyW=53]="KeyW",i[i.KeyX=54]="KeyX",i[i.KeyY=55]="KeyY",i[i.KeyZ=56]="KeyZ",i[i.Meta=57]="Meta",i[i.ContextMenu=58]="ContextMenu",i[i.F1=59]="F1",i[i.F2=60]="F2",i[i.F3=61]="F3",i[i.F4=62]="F4",i[i.F5=63]="F5",i[i.F6=64]="F6",i[i.F7=65]="F7",i[i.F8=66]="F8",i[i.F9=67]="F9",i[i.F10=68]="F10",i[i.F11=69]="F11",i[i.F12=70]="F12",i[i.F13=71]="F13",i[i.F14=72]="F14",i[i.F15=73]="F15",i[i.F16=74]="F16",i[i.F17=75]="F17",i[i.F18=76]="F18",i[i.F19=77]="F19",i[i.F20=78]="F20",i[i.F21=79]="F21",i[i.F22=80]="F22",i[i.F23=81]="F23",i[i.F24=82]="F24",i[i.NumLock=83]="NumLock",i[i.ScrollLock=84]="ScrollLock",i[i.Semicolon=85]="Semicolon",i[i.Equal=86]="Equal",i[i.Comma=87]="Comma",i[i.Minus=88]="Minus",i[i.Period=89]="Period",i[i.Slash=90]="Slash",i[i.Backquote=91]="Backquote",i[i.BracketLeft=92]="BracketLeft",i[i.Backslash=93]="Backslash",i[i.BracketRight=94]="BracketRight",i[i.Quote=95]="Quote",i[i.OEM_8=96]="OEM_8",i[i.IntlBackslash=97]="IntlBackslash",i[i.Numpad0=98]="Numpad0",i[i.Numpad1=99]="Numpad1",i[i.Numpad2=100]="Numpad2",i[i.Numpad3=101]="Numpad3",i[i.Numpad4=102]="Numpad4",i[i.Numpad5=103]="Numpad5",i[i.Numpad6=104]="Numpad6",i[i.Numpad7=105]="Numpad7",i[i.Numpad8=106]="Numpad8",i[i.Numpad9=107]="Numpad9",i[i.NumpadMultiply=108]="NumpadMultiply",i[i.NumpadAdd=109]="NumpadAdd",i[i.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",i[i.NumpadSubtract=111]="NumpadSubtract",i[i.NumpadDecimal=112]="NumpadDecimal",i[i.NumpadDivide=113]="NumpadDivide",i[i.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",i[i.ABNT_C1=115]="ABNT_C1",i[i.ABNT_C2=116]="ABNT_C2",i[i.AudioVolumeMute=117]="AudioVolumeMute",i[i.AudioVolumeUp=118]="AudioVolumeUp",i[i.AudioVolumeDown=119]="AudioVolumeDown",i[i.BrowserSearch=120]="BrowserSearch",i[i.BrowserHome=121]="BrowserHome",i[i.BrowserBack=122]="BrowserBack",i[i.BrowserForward=123]="BrowserForward",i[i.MediaTrackNext=124]="MediaTrackNext",i[i.MediaTrackPrevious=125]="MediaTrackPrevious",i[i.MediaStop=126]="MediaStop",i[i.MediaPlayPause=127]="MediaPlayPause",i[i.LaunchMediaPlayer=128]="LaunchMediaPlayer",i[i.LaunchMail=129]="LaunchMail",i[i.LaunchApp2=130]="LaunchApp2",i[i.Clear=131]="Clear",i[i.MAX_VALUE=132]="MAX_VALUE"})(N$||(N$={}));var R$;(function(i){i[i.Hint=1]="Hint",i[i.Info=2]="Info",i[i.Warning=4]="Warning",i[i.Error=8]="Error"})(R$||(R$={}));var M$;(function(i){i[i.Unnecessary=1]="Unnecessary",i[i.Deprecated=2]="Deprecated"})(M$||(M$={}));var A$;(function(i){i[i.Inline=1]="Inline",i[i.Gutter=2]="Gutter"})(A$||(A$={}));var P$;(function(i){i[i.UNKNOWN=0]="UNKNOWN",i[i.TEXTAREA=1]="TEXTAREA",i[i.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",i[i.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",i[i.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",i[i.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",i[i.CONTENT_TEXT=6]="CONTENT_TEXT",i[i.CONTENT_EMPTY=7]="CONTENT_EMPTY",i[i.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",i[i.CONTENT_WIDGET=9]="CONTENT_WIDGET",i[i.OVERVIEW_RULER=10]="OVERVIEW_RULER",i[i.SCROLLBAR=11]="SCROLLBAR",i[i.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",i[i.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(P$||(P$={}));var O$;(function(i){i[i.AIGenerated=1]="AIGenerated"})(O$||(O$={}));var F$;(function(i){i[i.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",i[i.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",i[i.TOP_CENTER=2]="TOP_CENTER"})(F$||(F$={}));var B$;(function(i){i[i.Left=1]="Left",i[i.Center=2]="Center",i[i.Right=4]="Right",i[i.Full=7]="Full"})(B$||(B$={}));var W$;(function(i){i[i.Left=0]="Left",i[i.Right=1]="Right",i[i.None=2]="None",i[i.LeftOfInjectedText=3]="LeftOfInjectedText",i[i.RightOfInjectedText=4]="RightOfInjectedText"})(W$||(W$={}));var $$;(function(i){i[i.Off=0]="Off",i[i.On=1]="On",i[i.Relative=2]="Relative",i[i.Interval=3]="Interval",i[i.Custom=4]="Custom"})($$||($$={}));var H$;(function(i){i[i.None=0]="None",i[i.Text=1]="Text",i[i.Blocks=2]="Blocks"})(H$||(H$={}));var V$;(function(i){i[i.Smooth=0]="Smooth",i[i.Immediate=1]="Immediate"})(V$||(V$={}));var z$;(function(i){i[i.Auto=1]="Auto",i[i.Hidden=2]="Hidden",i[i.Visible=3]="Visible"})(z$||(z$={}));var U$;(function(i){i[i.LTR=0]="LTR",i[i.RTL=1]="RTL"})(U$||(U$={}));var j$;(function(i){i.Off="off",i.OnCode="onCode",i.On="on"})(j$||(j$={}));var K$;(function(i){i[i.Invoke=1]="Invoke",i[i.TriggerCharacter=2]="TriggerCharacter",i[i.ContentChange=3]="ContentChange"})(K$||(K$={}));var G$;(function(i){i[i.File=0]="File",i[i.Module=1]="Module",i[i.Namespace=2]="Namespace",i[i.Package=3]="Package",i[i.Class=4]="Class",i[i.Method=5]="Method",i[i.Property=6]="Property",i[i.Field=7]="Field",i[i.Constructor=8]="Constructor",i[i.Enum=9]="Enum",i[i.Interface=10]="Interface",i[i.Function=11]="Function",i[i.Variable=12]="Variable",i[i.Constant=13]="Constant",i[i.String=14]="String",i[i.Number=15]="Number",i[i.Boolean=16]="Boolean",i[i.Array=17]="Array",i[i.Object=18]="Object",i[i.Key=19]="Key",i[i.Null=20]="Null",i[i.EnumMember=21]="EnumMember",i[i.Struct=22]="Struct",i[i.Event=23]="Event",i[i.Operator=24]="Operator",i[i.TypeParameter=25]="TypeParameter"})(G$||(G$={}));var q$;(function(i){i[i.Deprecated=1]="Deprecated"})(q$||(q$={}));var X$;(function(i){i[i.Hidden=0]="Hidden",i[i.Blink=1]="Blink",i[i.Smooth=2]="Smooth",i[i.Phase=3]="Phase",i[i.Expand=4]="Expand",i[i.Solid=5]="Solid"})(X$||(X$={}));var Y$;(function(i){i[i.Line=1]="Line",i[i.Block=2]="Block",i[i.Underline=3]="Underline",i[i.LineThin=4]="LineThin",i[i.BlockOutline=5]="BlockOutline",i[i.UnderlineThin=6]="UnderlineThin"})(Y$||(Y$={}));var Z$;(function(i){i[i.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",i[i.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",i[i.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",i[i.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(Z$||(Z$={}));var Q$;(function(i){i[i.None=0]="None",i[i.Same=1]="Same",i[i.Indent=2]="Indent",i[i.DeepIndent=3]="DeepIndent"})(Q$||(Q$={}));let Dk=class{static chord(e,t){return co(e,t)}};Dk.CtrlCmd=2048;Dk.Shift=1024;Dk.Alt=512;Dk.WinCtrl=256;function Npe(){return{editor:void 0,languages:void 0,CancellationTokenSource:wr,Emitter:se,KeyCode:N$,KeyMod:Dk,Position:ae,Range:B,Selection:yt,SelectionDirection:U$,MarkerSeverity:R$,MarkerTag:M$,Uri:At,Token:wD}}function R5e(i,e){const t=i;typeof t.vscodeWindowId!="number"&&Object.defineProperty(t,"vscodeWindowId",{get:()=>e})}const hi=window,M5e=hi;class A5e{constructor(e){this.fn=e,this.lastCache=void 0,this.lastArgKey=void 0}get(e){const t=JSON.stringify(e);return this.lastArgKey!==t&&(this.lastArgKey=t,this.lastCache=this.fn(e)),this.lastCache}}class zne{get cachedValues(){return this._map}constructor(e){this.fn=e,this._map=new Map}get(e){if(this._map.has(e))return this._map.get(e);const t=this.fn(e);return this._map.set(e,t),t}}class Qf{constructor(e){this.executor=e,this._didRun=!1}get value(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}var Sw;function Rpe(i){return!i||typeof i!="string"?!0:i.trim().length===0}const P5e=/{(\d+)}/g;function Eb(i,...e){return e.length===0?i:i.replace(P5e,function(t,n){const r=parseInt(n,10);return isNaN(r)||r<0||r>=e.length?t:e[r]})}function O5e(i){return i.replace(/[<>"'&]/g,e=>{switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return e})}function HA(i){return i.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}function fc(i){return i.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function F5e(i,e=" "){const t=Ik(i,e);return Mpe(t,e)}function Ik(i,e){if(!i||!e)return i;const t=e.length;if(t===0||i.length===0)return i;let n=0;for(;i.indexOf(e,n)===n;)n=n+t;return i.substring(n)}function Mpe(i,e){if(!i||!e)return i;const t=e.length,n=i.length;if(t===0||n===0)return i;let r=n,o=-1;for(;o=i.lastIndexOf(e,r-1),!(o===-1||o+t!==r);){if(o===0)return"";r=o}return i.substring(0,r)}function B5e(i){return i.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function W5e(i){return i.replace(/\*/g,"")}function Ape(i,e,t={}){if(!i)throw new Error("Cannot create regex from empty string");e||(i=fc(i)),t.wholeWord&&(/\B/.test(i.charAt(0))||(i="\\b"+i),/\B/.test(i.charAt(i.length-1))||(i=i+"\\b"));let n="";return t.global&&(n+="g"),t.matchCase||(n+="i"),t.multiline&&(n+="m"),t.unicode&&(n+="u"),new RegExp(i,n)}function $5e(i){return i.source==="^"||i.source==="^$"||i.source==="$"||i.source==="^\\s*$"?!1:!!(i.exec("")&&i.lastIndex===0)}function Jf(i){return i.split(/\r\n|\r|\n/)}function H5e(i){var e;const t=[],n=i.split(/(\r\n|\r|\n)/);for(let r=0;r=0;t--){const n=i.charCodeAt(t);if(n!==32&&n!==9)return t}return-1}function LD(i,e){return ie?1:0}function gq(i,e,t=0,n=i.length,r=0,o=e.length){for(;tc)return 1}const s=n-t,a=o-r;return sa?1:0}function J$(i,e){return kk(i,e,0,i.length,0,e.length)}function kk(i,e,t=0,n=i.length,r=0,o=e.length){for(;t=128||c>=128)return gq(i.toLowerCase(),e.toLowerCase(),t,n,r,o);Um(l)&&(l-=32),Um(c)&&(c-=32);const u=l-c;if(u!==0)return u}const s=n-t,a=o-r;return sa?1:0}function eR(i){return i>=48&&i<=57}function Um(i){return i>=97&&i<=122}function nf(i){return i>=65&&i<=90}function ey(i,e){return i.length===e.length&&kk(i,e)===0}function pq(i,e){const t=e.length;return e.length>i.length?!1:kk(i,e,0,t)===0}function Vv(i,e){const t=Math.min(i.length,e.length);let n;for(n=0;n1){const n=i.charCodeAt(e-2);if(xo(n))return mq(n,t)}return t}class vq{get offset(){return this._offset}constructor(e,t=0){this._str=e,this._len=e.length,this._offset=t}setOffset(e){this._offset=e}prevCodePoint(){const e=V5e(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=zA(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class UA{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new vq(e,t)}nextGraphemeLength(){const e=jm.getInstance(),t=this._iterator,n=t.offset;let r=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){const o=t.offset,s=e.getGraphemeBreakType(t.nextCodePoint());if(Une(r,s)){t.setOffset(o);break}r=s}return t.offset-n}prevGraphemeLength(){const e=jm.getInstance(),t=this._iterator,n=t.offset;let r=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){const o=t.offset,s=e.getGraphemeBreakType(t.prevCodePoint());if(Une(s,r)){t.setOffset(o);break}r=s}return n-t.offset}eol(){return this._iterator.eol()}}function _q(i,e){return new UA(i,e).nextGraphemeLength()}function Ppe(i,e){return new UA(i,e).prevGraphemeLength()}function z5e(i,e){e>0&&Db(i.charCodeAt(e))&&e--;const t=e+_q(i,e);return[t-Ppe(i,t),t]}let Q8;function U5e(){return/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/}function xw(i){return Q8||(Q8=U5e()),Q8.test(i)}const j5e=/^[\t\n\r\x20-\x7E]*$/;function Tk(i){return j5e.test(i)}const Ope=/[\u2028\u2029]/;function Fpe(i){return Ope.test(i)}function zv(i){return i>=11904&&i<=55215||i>=63744&&i<=64255||i>=65281&&i<=65374}function bq(i){return i>=127462&&i<=127487||i===8986||i===8987||i===9200||i===9203||i>=9728&&i<=10175||i===11088||i===11093||i>=127744&&i<=128591||i>=128640&&i<=128764||i>=128992&&i<=129008||i>=129280&&i<=129535||i>=129648&&i<=129782}const K5e=String.fromCharCode(65279);function Cq(i){return!!(i&&i.length>0&&i.charCodeAt(0)===65279)}function G5e(i,e=!1){return i?(e&&(i=i.replace(/\\./g,"")),i.toLowerCase()!==i):!1}function Bpe(i){return i=i%(2*26),i<26?String.fromCharCode(97+i):String.fromCharCode(65+i-26)}function Une(i,e){return i===0?e!==5&&e!==7:i===2&&e===3?!1:i===4||i===2||i===3||e===4||e===2||e===3?!0:!(i===8&&(e===8||e===9||e===11||e===12)||(i===11||i===9)&&(e===9||e===10)||(i===12||i===10)&&e===10||e===5||e===13||e===7||i===1||i===13&&e===14||i===6&&e===6)}class jm{static getInstance(){return jm._INSTANCE||(jm._INSTANCE=new jm),jm._INSTANCE}constructor(){this._data=q5e()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;const t=this._data,n=t.length/3;let r=1;for(;r<=n;)if(et[3*r+1])r=2*r+1;else return t[3*r+2];return 0}}jm._INSTANCE=null;function q5e(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}function X5e(i,e){if(i===0)return 0;const t=Y5e(i,e);if(t!==void 0)return t;const n=new vq(e,i);return n.prevCodePoint(),n.offset}function Y5e(i,e){const t=new vq(e,i);let n=t.prevCodePoint();for(;Z5e(n)||n===65039||n===8419;){if(t.offset===0)return;n=t.prevCodePoint()}if(!bq(n))return;let r=t.offset;return r>0&&t.prevCodePoint()===8205&&(r=t.offset),r}function Z5e(i){return 127995<=i&&i<=127999}const Wpe=" ";class Ib{static getInstance(e){return Sw.cache.get(Array.from(e))}static getLocales(){return Sw._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}getPrimaryConfusable(e){return this.confusableDictionary.get(e)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}}Sw=Ib;Ib.ambiguousCharacterData=new Qf(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],"ko":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}'));Ib.cache=new A5e(i=>{function e(c){const u=new Map;for(let d=0;d!c.startsWith("_")&&c in r);o.length===0&&(o=["_default"]);let s;for(const c of o){const u=e(r[c]);s=n(s,u)}const a=e(r._common),l=t(a,s);return new Sw(l)});Ib._locales=new Qf(()=>Object.keys(Sw.ambiguousCharacterData.value).filter(i=>!i.startsWith("_")));class Nf{static getRawData(){return JSON.parse("[9,10,11,12,13,32,127,160,173,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12288,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999]")}static getData(){return this._data||(this._data=new Set(Nf.getRawData())),this._data}static isInvisibleCharacter(e){return Nf.getData().has(e)}static get codePoints(){return Nf.getData()}}Nf._data=void 0;class eH{constructor(){this.mapWindowIdToZoomFactor=new Map}getZoomFactor(e){var t;return(t=this.mapWindowIdToZoomFactor.get(this.getWindowId(e)))!==null&&t!==void 0?t:1}getWindowId(e){return e.vscodeWindowId}}eH.INSTANCE=new eH;function $pe(i,e,t){typeof e=="string"&&(e=i.matchMedia(e)),e.addEventListener("change",t)}function Q5e(i){return eH.INSTANCE.getZoomFactor(i)}const SS=navigator.userAgent,ru=SS.indexOf("Firefox")>=0,tb=SS.indexOf("AppleWebKit")>=0,Nk=SS.indexOf("Chrome")>=0,Ip=!Nk&&SS.indexOf("Safari")>=0,Hpe=!Nk&&!Ip&&tb;SS.indexOf("Electron/")>=0;const jne=SS.indexOf("Android")>=0;let cM=!1;if(typeof hi.matchMedia=="function"){const i=hi.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=hi.matchMedia("(display-mode: fullscreen)");cM=i.matches,$pe(hi,i,({matches:t})=>{cM&&e.matches||(cM=t)})}function J5e(){return cM}const yq={clipboard:{writeText:Jd||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:Jd||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},keyboard:(()=>Jd||J5e()?0:navigator.keyboard||Ip?1:2)(),touch:"ontouchstart"in hi||navigator.maxTouchPoints>0,pointerEvents:hi.PointerEvent&&("ontouchstart"in hi||navigator.maxTouchPoints>0)};function tH(i,e){if(typeof i=="number"){if(i===0)return null;const t=(i&65535)>>>0,n=(i&4294901760)>>>16;return n!==0?new J8([tR(t,e),tR(n,e)]):new J8([tR(t,e)])}else{const t=[];for(let n=0;n{const s=e.token.onCancellationRequested(()=>{s.dispose(),o(new x_)});Promise.resolve(t).then(a=>{s.dispose(),e.dispose(),r(a)},a=>{s.dispose(),e.dispose(),o(a)})});return new class{cancel(){e.cancel(),e.dispose()}then(r,o){return n.then(r,o)}catch(r){return this.then(void 0,r)}finally(r){return n.finally(r)}}}function Rk(i,e,t){return new Promise((n,r)=>{const o=e.onCancellationRequested(()=>{o.dispose(),n(t)});i.then(n,r).finally(()=>o.dispose())})}class cBe{constructor(){this.isDisposed=!1,this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(e){if(this.isDisposed)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){const t=()=>{if(this.queuedPromise=null,this.isDisposed)return;const n=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,n};this.queuedPromise=new Promise(n=>{this.activePromise.then(t,t).then(n)})}return new Promise((t,n)=>{this.queuedPromise.then(t,n)})}return this.activePromise=e(),new Promise((t,n)=>{this.activePromise.then(r=>{this.activePromise=null,t(r)},r=>{this.activePromise=null,n(r)})})}dispose(){this.isDisposed=!0}}const uBe=(i,e)=>{let t=!0;const n=setTimeout(()=>{t=!1,e()},i);return{isTriggered:()=>t,dispose:()=>{clearTimeout(n),t=!1}}},dBe=i=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,i())}),{isTriggered:()=>e,dispose:()=>{e=!1}}};class nd{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((r,o)=>{this.doResolve=r,this.doReject=o}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const r=this.task;return this.task=null,r()}}));const n=()=>{var r;this.deferred=null,(r=this.doResolve)===null||r===void 0||r.call(this,null)};return this.deferred=t===Vpe?dBe(n):uBe(t,n),this.completionPromise}isTriggered(){var e;return!!(!((e=this.deferred)===null||e===void 0)&&e.isTriggered())}cancel(){var e;this.cancelTimeout(),this.completionPromise&&((e=this.doReject)===null||e===void 0||e.call(this,new x_),this.completionPromise=null)}cancelTimeout(){var e;(e=this.deferred)===null||e===void 0||e.dispose(),this.deferred=null}dispose(){this.cancel()}}class zpe{constructor(e){this.delayer=new nd(e),this.throttler=new cBe}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}function Uv(i,e){return e?new Promise((t,n)=>{const r=setTimeout(()=>{o.dispose(),t()},i),o=e.onCancellationRequested(()=>{clearTimeout(r),o.dispose(),n(new x_)})}):Io(t=>Uv(i,t))}function jv(i,e=0,t){const n=setTimeout(()=>{i(),t&&r.dispose()},e),r=Rt(()=>{clearTimeout(n),t==null||t.deleteAndLeak(r)});return t==null||t.add(r),r}function wq(i,e=n=>!!n,t=null){let n=0;const r=i.length,o=()=>{if(n>=r)return Promise.resolve(t);const s=i[n++];return Promise.resolve(s()).then(l=>e(l)?Promise.resolve(l):o())};return o()}class cd{constructor(e,t){this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}}class Sq{constructor(){this.disposable=void 0}cancel(){var e;(e=this.disposable)===null||e===void 0||e.dispose(),this.disposable=void 0}cancelAndSet(e,t,n=globalThis){this.cancel();const r=n.setInterval(()=>{e()},t);this.disposable=Rt(()=>{n.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel()}}class pi{constructor(e,t){this.timeoutToken=-1,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==-1}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){var e;(e=this.runner)===null||e===void 0||e.call(this)}}let Upe,lE;(function(){typeof globalThis.requestIdleCallback!="function"||typeof globalThis.cancelIdleCallback!="function"?lE=(i,e)=>{upe(()=>{if(t)return;const n=Date.now()+15;e(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,n-Date.now())}}))});let t=!1;return{dispose(){t||(t=!0)}}}:lE=(i,e,t)=>{const n=i.requestIdleCallback(e,typeof t=="number"?{timeout:t}:void 0);let r=!1;return{dispose(){r||(r=!0,i.cancelIdleCallback(n))}}},Upe=i=>lE(globalThis,i)})();class jpe{constructor(e,t){this._didRun=!1,this._executor=()=>{try{this._value=t()}catch(n){this._error=n}finally{this._didRun=!0}},this._handle=lE(e,()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}}class hBe extends jpe{constructor(e){super(globalThis,e)}}class a4{get isRejected(){var e;return((e=this.outcome)===null||e===void 0?void 0:e.outcome)===1}get isSettled(){return!!this.outcome}constructor(){this.p=new Promise((e,t)=>{this.completeCallback=e,this.errorCallback=t})}complete(e){return new Promise(t=>{this.completeCallback(e),this.outcome={outcome:0,value:e},t()})}error(e){return new Promise(t=>{this.errorCallback(e),this.outcome={outcome:1,value:e},t()})}cancel(){return this.error(new x_)}}var iH;(function(i){async function e(n){let r;const o=await Promise.all(n.map(s=>s.then(a=>a,a=>{r||(r=a)})));if(typeof r<"u")throw r;return o}i.settled=e;function t(n){return new Promise(async(r,o)=>{try{await n(r,o)}catch(s){o(s)}})}i.withAsyncBody=t})(iH||(iH={}));class Kr{static fromArray(e){return new Kr(t=>{t.emitMany(e)})}static fromPromise(e){return new Kr(async t=>{t.emitMany(await e)})}static fromPromises(e){return new Kr(async t=>{await Promise.all(e.map(async n=>t.emitOne(await n)))})}static merge(e){return new Kr(async t=>{await Promise.all(e.map(async n=>{for await(const r of n)t.emitOne(r)}))})}constructor(e){this._state=0,this._results=[],this._error=null,this._onStateChanged=new se,queueMicrotask(async()=>{const t={emitOne:n=>this.emitOne(n),emitMany:n=>this.emitMany(n),reject:n=>this.reject(n)};try{await Promise.resolve(e(t)),this.resolve()}catch(n){this.reject(n)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e{for await(const r of e)n.emitOne(t(r))})}map(e){return Kr.map(this,e)}static filter(e,t){return new Kr(async n=>{for await(const r of e)t(r)&&n.emitOne(r)})}filter(e){return Kr.filter(this,e)}static coalesce(e){return Kr.filter(e,t=>!!t)}coalesce(){return Kr.coalesce(this)}static async toPromise(e){const t=[];for await(const n of e)t.push(n);return t}toPromise(){return Kr.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}}Kr.EMPTY=Kr.fromArray([]);class fBe extends Kr{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}function gBe(i){const e=new wr,t=i(e.token);return new fBe(e,async n=>{const r=e.token.onCancellationRequested(()=>{r.dispose(),e.dispose(),n.reject(new x_)});try{for await(const o of t){if(e.token.isCancellationRequested)return;n.emitOne(o)}r.dispose(),e.dispose()}catch(o){r.dispose(),e.dispose(),n.reject(o)}})}/*! @license DOMPurify 3.0.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.5/LICENSE */const{entries:Kpe,setPrototypeOf:Gne,isFrozen:pBe,getPrototypeOf:mBe,getOwnPropertyDescriptor:vBe}=Object;let{freeze:Dl,seal:uh,create:_Be}=Object,{apply:rH,construct:oH}=typeof Reflect<"u"&&Reflect;rH||(rH=function(e,t,n){return e.apply(t,n)});Dl||(Dl=function(e){return e});uh||(uh=function(e){return e});oH||(oH=function(e,t){return new e(...t)});const bBe=id(Array.prototype.forEach),qne=id(Array.prototype.pop),Ix=id(Array.prototype.push),uM=id(String.prototype.toLowerCase),e6=id(String.prototype.toString),CBe=id(String.prototype.match),Cd=id(String.prototype.replace),yBe=id(String.prototype.indexOf),wBe=id(String.prototype.trim),Mc=id(RegExp.prototype.test),kx=SBe(TypeError);function id(i){return function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r/gm),IBe=uh(/\${[\w\W]*}/gm),kBe=uh(/^data-[\-\w.\u00B7-\uFFFF]/),TBe=uh(/^aria-[\-\w]+$/),Gpe=uh(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),NBe=uh(/^(?:\w+script|data):/i),RBe=uh(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),qpe=uh(/^html$/i);var Jne=Object.freeze({__proto__:null,MUSTACHE_EXPR:EBe,ERB_EXPR:DBe,TMPLIT_EXPR:IBe,DATA_ATTR:kBe,ARIA_ATTR:TBe,IS_ALLOWED_URI:Gpe,IS_SCRIPT_OR_DATA:NBe,ATTR_WHITESPACE:RBe,DOCTYPE_NAME:qpe});const MBe=()=>typeof window>"u"?null:window,ABe=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function Xpe(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:MBe();const e=$t=>Xpe($t);if(e.version="3.0.5",e.removed=[],!i||!i.document||i.document.nodeType!==9)return e.isSupported=!1,e;const t=i.document,n=t.currentScript;let{document:r}=i;const{DocumentFragment:o,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:f}=i,g=l.prototype,p=nR(g,"cloneNode"),v=nR(g,"nextSibling"),m=nR(g,"childNodes"),_=nR(g,"parentNode");if(typeof s=="function"){const $t=r.createElement("template");$t.content&&$t.content.ownerDocument&&(r=$t.content.ownerDocument)}let y,S="";const{implementation:L,createNodeIterator:E,createDocumentFragment:D,getElementsByTagName:k}=r,{importNode:T}=t;let M={};e.isSupported=typeof Kpe=="function"&&typeof _=="function"&&L&&L.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:A,ERB_EXPR:N,TMPLIT_EXPR:R,DATA_ATTR:F,ARIA_ATTR:W,IS_SCRIPT_OR_DATA:H,ATTR_WHITESPACE:G}=Jne;let{IS_ALLOWED_URI:U}=Jne,K=null;const re=di({},[...Xne,...t6,...n6,...i6,...Yne]);let Y=null;const J=di({},[...Zne,...r6,...Qne,...iR]);let Q=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ue=null,de=null,_e=!0,ve=!0,Ve=!1,Ze=!0,We=!1,pe=!1,Pe=!1,Se=!1,Ne=!1,Me=!1,Qe=!1,Ke=!0,Re=!1;const ct="user-content-";let ie=!0,le=!1,ce={},z=null;const q=di({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let oe=null;const ne=di({},["audio","video","img","source","image","track"]);let he=null;const Le=di({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Fe="http://www.w3.org/1998/Math/MathML",ze="http://www.w3.org/2000/svg",Ue="http://www.w3.org/1999/xhtml";let nt=Ue,it=!1,at=null;const tt=di({},[Fe,ze,Ue],e6);let Zt;const Tt=["application/xhtml+xml","text/html"],xn="text/html";let rt,wt=null;const Bt=r.createElement("form"),Nt=function(we){return we instanceof RegExp||we instanceof Function},nn=function(we){if(!(wt&&wt===we)){if((!we||typeof we!="object")&&(we={}),we=KC(we),Zt=Tt.indexOf(we.PARSER_MEDIA_TYPE)===-1?Zt=xn:Zt=we.PARSER_MEDIA_TYPE,rt=Zt==="application/xhtml+xml"?e6:uM,K="ALLOWED_TAGS"in we?di({},we.ALLOWED_TAGS,rt):re,Y="ALLOWED_ATTR"in we?di({},we.ALLOWED_ATTR,rt):J,at="ALLOWED_NAMESPACES"in we?di({},we.ALLOWED_NAMESPACES,e6):tt,he="ADD_URI_SAFE_ATTR"in we?di(KC(Le),we.ADD_URI_SAFE_ATTR,rt):Le,oe="ADD_DATA_URI_TAGS"in we?di(KC(ne),we.ADD_DATA_URI_TAGS,rt):ne,z="FORBID_CONTENTS"in we?di({},we.FORBID_CONTENTS,rt):q,ue="FORBID_TAGS"in we?di({},we.FORBID_TAGS,rt):{},de="FORBID_ATTR"in we?di({},we.FORBID_ATTR,rt):{},ce="USE_PROFILES"in we?we.USE_PROFILES:!1,_e=we.ALLOW_ARIA_ATTR!==!1,ve=we.ALLOW_DATA_ATTR!==!1,Ve=we.ALLOW_UNKNOWN_PROTOCOLS||!1,Ze=we.ALLOW_SELF_CLOSE_IN_ATTR!==!1,We=we.SAFE_FOR_TEMPLATES||!1,pe=we.WHOLE_DOCUMENT||!1,Ne=we.RETURN_DOM||!1,Me=we.RETURN_DOM_FRAGMENT||!1,Qe=we.RETURN_TRUSTED_TYPE||!1,Se=we.FORCE_BODY||!1,Ke=we.SANITIZE_DOM!==!1,Re=we.SANITIZE_NAMED_PROPS||!1,ie=we.KEEP_CONTENT!==!1,le=we.IN_PLACE||!1,U=we.ALLOWED_URI_REGEXP||Gpe,nt=we.NAMESPACE||Ue,Q=we.CUSTOM_ELEMENT_HANDLING||{},we.CUSTOM_ELEMENT_HANDLING&&Nt(we.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Q.tagNameCheck=we.CUSTOM_ELEMENT_HANDLING.tagNameCheck),we.CUSTOM_ELEMENT_HANDLING&&Nt(we.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Q.attributeNameCheck=we.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),we.CUSTOM_ELEMENT_HANDLING&&typeof we.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Q.allowCustomizedBuiltInElements=we.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),We&&(ve=!1),Me&&(Ne=!0),ce&&(K=di({},[...Yne]),Y=[],ce.html===!0&&(di(K,Xne),di(Y,Zne)),ce.svg===!0&&(di(K,t6),di(Y,r6),di(Y,iR)),ce.svgFilters===!0&&(di(K,n6),di(Y,r6),di(Y,iR)),ce.mathMl===!0&&(di(K,i6),di(Y,Qne),di(Y,iR))),we.ADD_TAGS&&(K===re&&(K=KC(K)),di(K,we.ADD_TAGS,rt)),we.ADD_ATTR&&(Y===J&&(Y=KC(Y)),di(Y,we.ADD_ATTR,rt)),we.ADD_URI_SAFE_ATTR&&di(he,we.ADD_URI_SAFE_ATTR,rt),we.FORBID_CONTENTS&&(z===q&&(z=KC(z)),di(z,we.FORBID_CONTENTS,rt)),ie&&(K["#text"]=!0),pe&&di(K,["html","head","body"]),K.table&&(di(K,["tbody"]),delete ue.tbody),we.TRUSTED_TYPES_POLICY){if(typeof we.TRUSTED_TYPES_POLICY.createHTML!="function")throw kx('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof we.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw kx('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=we.TRUSTED_TYPES_POLICY,S=y.createHTML("")}else y===void 0&&(y=ABe(f,n)),y!==null&&typeof S=="string"&&(S=y.createHTML(""));Dl&&Dl(we),wt=we}},Mn=di({},["mi","mo","mn","ms","mtext"]),zt=di({},["foreignobject","desc","title","annotation-xml"]),Qt=di({},["title","style","font","a","script"]),lt=di({},t6);di(lt,n6),di(lt,xBe);const ut=di({},i6);di(ut,LBe);const dt=function(we){let bt=_(we);(!bt||!bt.tagName)&&(bt={namespaceURI:nt,tagName:"template"});const xt=uM(we.tagName),Gn=uM(bt.tagName);return at[we.namespaceURI]?we.namespaceURI===ze?bt.namespaceURI===Ue?xt==="svg":bt.namespaceURI===Fe?xt==="svg"&&(Gn==="annotation-xml"||Mn[Gn]):!!lt[xt]:we.namespaceURI===Fe?bt.namespaceURI===Ue?xt==="math":bt.namespaceURI===ze?xt==="math"&&zt[Gn]:!!ut[xt]:we.namespaceURI===Ue?bt.namespaceURI===ze&&!zt[Gn]||bt.namespaceURI===Fe&&!Mn[Gn]?!1:!ut[xt]&&(Qt[xt]||!lt[xt]):!!(Zt==="application/xhtml+xml"&&at[we.namespaceURI]):!1},Mt=function(we){Ix(e.removed,{element:we});try{we.parentNode.removeChild(we)}catch{we.remove()}},Kt=function(we,bt){try{Ix(e.removed,{attribute:bt.getAttributeNode(we),from:bt})}catch{Ix(e.removed,{attribute:null,from:bt})}if(bt.removeAttribute(we),we==="is"&&!Y[we])if(Ne||Me)try{Mt(bt)}catch{}else try{bt.setAttribute(we,"")}catch{}},mn=function(we){let bt,xt;if(Se)we=""+we;else{const Vr=CBe(we,/^[\r\n\t ]+/);xt=Vr&&Vr[0]}Zt==="application/xhtml+xml"&&nt===Ue&&(we=''+we+"");const Gn=y?y.createHTML(we):we;if(nt===Ue)try{bt=new h().parseFromString(Gn,Zt)}catch{}if(!bt||!bt.documentElement){bt=L.createDocument(nt,"template",null);try{bt.documentElement.innerHTML=it?S:Gn}catch{}}const cr=bt.body||bt.documentElement;return we&&xt&&cr.insertBefore(r.createTextNode(xt),cr.childNodes[0]||null),nt===Ue?k.call(bt,pe?"html":"body")[0]:pe?bt.documentElement:cr},lr=function(we){return E.call(we.ownerDocument||we,we,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},nr=function(we){return we instanceof d&&(typeof we.nodeName!="string"||typeof we.textContent!="string"||typeof we.removeChild!="function"||!(we.attributes instanceof u)||typeof we.removeAttribute!="function"||typeof we.setAttribute!="function"||typeof we.namespaceURI!="string"||typeof we.insertBefore!="function"||typeof we.hasChildNodes!="function")},Hr=function(we){return typeof a=="object"?we instanceof a:we&&typeof we=="object"&&typeof we.nodeType=="number"&&typeof we.nodeName=="string"},Jn=function(we,bt,xt){M[we]&&bBe(M[we],Gn=>{Gn.call(e,bt,xt,wt)})},Ii=function(we){let bt;if(Jn("beforeSanitizeElements",we,null),nr(we))return Mt(we),!0;const xt=rt(we.nodeName);if(Jn("uponSanitizeElement",we,{tagName:xt,allowedTags:K}),we.hasChildNodes()&&!Hr(we.firstElementChild)&&(!Hr(we.content)||!Hr(we.content.firstElementChild))&&Mc(/<[/\w]/g,we.innerHTML)&&Mc(/<[/\w]/g,we.textContent))return Mt(we),!0;if(!K[xt]||ue[xt]){if(!ue[xt]&&No(xt)&&(Q.tagNameCheck instanceof RegExp&&Mc(Q.tagNameCheck,xt)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(xt)))return!1;if(ie&&!z[xt]){const Gn=_(we)||we.parentNode,cr=m(we)||we.childNodes;if(cr&&Gn){const Vr=cr.length;for(let ei=Vr-1;ei>=0;--ei)Gn.insertBefore(p(cr[ei],!0),v(we))}}return Mt(we),!0}return we instanceof l&&!dt(we)||(xt==="noscript"||xt==="noembed"||xt==="noframes")&&Mc(/<\/no(script|embed|frames)/i,we.innerHTML)?(Mt(we),!0):(We&&we.nodeType===3&&(bt=we.textContent,bt=Cd(bt,A," "),bt=Cd(bt,N," "),bt=Cd(bt,R," "),we.textContent!==bt&&(Ix(e.removed,{element:we.cloneNode()}),we.textContent=bt)),Jn("afterSanitizeElements",we,null),!1)},_o=function(we,bt,xt){if(Ke&&(bt==="id"||bt==="name")&&(xt in r||xt in Bt))return!1;if(!(ve&&!de[bt]&&Mc(F,bt))){if(!(_e&&Mc(W,bt))){if(!Y[bt]||de[bt]){if(!(No(we)&&(Q.tagNameCheck instanceof RegExp&&Mc(Q.tagNameCheck,we)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(we))&&(Q.attributeNameCheck instanceof RegExp&&Mc(Q.attributeNameCheck,bt)||Q.attributeNameCheck instanceof Function&&Q.attributeNameCheck(bt))||bt==="is"&&Q.allowCustomizedBuiltInElements&&(Q.tagNameCheck instanceof RegExp&&Mc(Q.tagNameCheck,xt)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(xt))))return!1}else if(!he[bt]){if(!Mc(U,Cd(xt,G,""))){if(!((bt==="src"||bt==="xlink:href"||bt==="href")&&we!=="script"&&yBe(xt,"data:")===0&&oe[we])){if(!(Ve&&!Mc(H,Cd(xt,G,"")))){if(xt)return!1}}}}}}return!0},No=function(we){return we.indexOf("-")>0},bs=function(we){let bt,xt,Gn,cr;Jn("beforeSanitizeAttributes",we,null);const{attributes:Vr}=we;if(!Vr)return;const ei={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Y};for(cr=Vr.length;cr--;){bt=Vr[cr];const{name:Qr,namespaceURI:Fs}=bt;if(xt=Qr==="value"?bt.value:wBe(bt.value),Gn=rt(Qr),ei.attrName=Gn,ei.attrValue=xt,ei.keepAttr=!0,ei.forceKeepAttr=void 0,Jn("uponSanitizeAttribute",we,ei),xt=ei.attrValue,ei.forceKeepAttr||(Kt(Qr,we),!ei.keepAttr))continue;if(!Ze&&Mc(/\/>/i,xt)){Kt(Qr,we);continue}We&&(xt=Cd(xt,A," "),xt=Cd(xt,N," "),xt=Cd(xt,R," "));const Fl=rt(we.nodeName);if(_o(Fl,Gn,xt)){if(Re&&(Gn==="id"||Gn==="name")&&(Kt(Qr,we),xt=ct+xt),y&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!Fs)switch(f.getAttributeType(Fl,Gn)){case"TrustedHTML":{xt=y.createHTML(xt);break}case"TrustedScriptURL":{xt=y.createScriptURL(xt);break}}try{Fs?we.setAttributeNS(Fs,Qr,xt):we.setAttribute(Qr,xt),qne(e.removed)}catch{}}}Jn("afterSanitizeAttributes",we,null)},Cs=function $t(we){let bt;const xt=lr(we);for(Jn("beforeSanitizeShadowDOM",we,null);bt=xt.nextNode();)Jn("uponSanitizeShadowNode",bt,null),!Ii(bt)&&(bt.content instanceof o&&$t(bt.content),bs(bt));Jn("afterSanitizeShadowDOM",we,null)};return e.sanitize=function($t){let we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},bt,xt,Gn,cr;if(it=!$t,it&&($t=""),typeof $t!="string"&&!Hr($t))if(typeof $t.toString=="function"){if($t=$t.toString(),typeof $t!="string")throw kx("dirty is not a string, aborting")}else throw kx("toString is not a function");if(!e.isSupported)return $t;if(Pe||nn(we),e.removed=[],typeof $t=="string"&&(le=!1),le){if($t.nodeName){const Qr=rt($t.nodeName);if(!K[Qr]||ue[Qr])throw kx("root node is forbidden and cannot be sanitized in-place")}}else if($t instanceof a)bt=mn(""),xt=bt.ownerDocument.importNode($t,!0),xt.nodeType===1&&xt.nodeName==="BODY"||xt.nodeName==="HTML"?bt=xt:bt.appendChild(xt);else{if(!Ne&&!We&&!pe&&$t.indexOf("<")===-1)return y&&Qe?y.createHTML($t):$t;if(bt=mn($t),!bt)return Ne?null:Qe?S:""}bt&&Se&&Mt(bt.firstChild);const Vr=lr(le?$t:bt);for(;Gn=Vr.nextNode();)Ii(Gn)||(Gn.content instanceof o&&Cs(Gn.content),bs(Gn));if(le)return $t;if(Ne){if(Me)for(cr=D.call(bt.ownerDocument);bt.firstChild;)cr.appendChild(bt.firstChild);else cr=bt;return(Y.shadowroot||Y.shadowrootmode)&&(cr=T.call(t,cr,!0)),cr}let ei=pe?bt.outerHTML:bt.innerHTML;return pe&&K["!doctype"]&&bt.ownerDocument&&bt.ownerDocument.doctype&&bt.ownerDocument.doctype.name&&Mc(qpe,bt.ownerDocument.doctype.name)&&(ei=" +`+ei),We&&(ei=Cd(ei,A," "),ei=Cd(ei,N," "),ei=Cd(ei,R," ")),y&&Qe?y.createHTML(ei):ei},e.setConfig=function($t){nn($t),Pe=!0},e.clearConfig=function(){wt=null,Pe=!1},e.isValidAttribute=function($t,we,bt){wt||nn({});const xt=rt($t),Gn=rt(we);return _o(xt,Gn,bt)},e.addHook=function($t,we){typeof we=="function"&&(M[$t]=M[$t]||[],Ix(M[$t],we))},e.removeHook=function($t){if(M[$t])return qne(M[$t])},e.removeHooks=function($t){M[$t]&&(M[$t]=[])},e.removeAllHooks=function(){M={}},e}var eg=Xpe();eg.version;eg.isSupported;const Ype=eg.sanitize;eg.setConfig;eg.clearConfig;eg.isValidAttribute;const sH=eg.addHook,Zpe=eg.removeHook;eg.removeHooks;eg.removeAllHooks;var an;(function(i){i.inMemory="inmemory",i.vscode="vscode",i.internal="private",i.walkThrough="walkThrough",i.walkThroughSnippet="walkThroughSnippet",i.http="http",i.https="https",i.file="file",i.mailto="mailto",i.untitled="untitled",i.data="data",i.command="command",i.vscodeRemote="vscode-remote",i.vscodeRemoteResource="vscode-remote-resource",i.vscodeManagedRemoteResource="vscode-managed-remote-resource",i.vscodeUserData="vscode-userdata",i.vscodeCustomEditor="vscode-custom-editor",i.vscodeNotebookCell="vscode-notebook-cell",i.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",i.vscodeNotebookCellOutput="vscode-notebook-cell-output",i.vscodeInteractiveInput="vscode-interactive-input",i.vscodeSettings="vscode-settings",i.vscodeWorkspaceTrust="vscode-workspace-trust",i.vscodeTerminal="vscode-terminal",i.vscodeChatCodeBlock="vscode-chat-code-block",i.vscodeChatSesssion="vscode-chat-editor",i.webviewPanel="webview-panel",i.vscodeWebview="vscode-webview",i.extension="extension",i.vscodeFileResource="vscode-file",i.tmp="tmp",i.vsls="vsls",i.vscodeSourceControl="vscode-scm",i.codeSetting="code-setting",i.codeFeature="code-feature"})(an||(an={}));function xq(i,e){return At.isUri(i)?ey(i.scheme,e):pq(i,e+":")}function eie(i,...e){return e.some(t=>xq(i,t))}const PBe="tkn";class OBe{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._remoteResourcesPath=`/${an.vscodeRemoteResource}`}setPreferredWebSchema(e){this._preferredWebSchema=e}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return en(a),e}const t=e.authority;let n=this._hosts[t];n&&n.indexOf(":")!==-1&&n.indexOf("[")===-1&&(n=`[${n}]`);const r=this._ports[t],o=this._connectionTokens[t];let s=`path=${encodeURIComponent(e.path)}`;return typeof o=="string"&&(s+=`&${PBe}=${encodeURIComponent(o)}`),At.from({scheme:S_?this._preferredWebSchema:an.vscodeRemoteResource,authority:`${n}:${r}`,path:this._remoteResourcesPath,query:s})}}const Qpe=new OBe,FBe="vscode-app";class ED{uriToBrowserUri(e){return e.scheme===an.vscodeRemote?Qpe.rewrite(e):e.scheme===an.file&&(Jd||X4e===`${an.vscodeFileResource}://${ED.FALLBACK_AUTHORITY}`)?e.with({scheme:an.vscodeFileResource,authority:e.authority||ED.FALLBACK_AUTHORITY,query:null,fragment:null}):e}}ED.FALLBACK_AUTHORITY=FBe;const Jpe=new ED;var tie;(function(i){const e=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);i.CoopAndCoep=Object.freeze(e.get("3"));const t="vscode-coi";function n(o){let s;typeof o=="string"?s=new URL(o).searchParams:o instanceof URL?s=o.searchParams:At.isUri(o)&&(s=new URL(o.toString(!0)).searchParams);const a=s==null?void 0:s.get(t);if(a)return e.get(a)}i.getHeadersFromQuery=n;function r(o,s,a){if(!globalThis.crossOriginIsolated)return;const l=s&&a?"3":a?"2":"1";o instanceof URLSearchParams?o.set(t,l):o[t]=l}i.addSearchParam=r})(tie||(tie={}));function l4(i){return c4(i,0)}function c4(i,e){switch(typeof i){case"object":return i===null?Gg(349,e):Array.isArray(i)?WBe(i,e):$Be(i,e);case"string":return Lq(i,e);case"boolean":return BBe(i,e);case"number":return Gg(i,e);case"undefined":return Gg(937,e);default:return Gg(617,e)}}function Gg(i,e){return(e<<5)-e+i|0}function BBe(i,e){return Gg(i?433:863,e)}function Lq(i,e){e=Gg(149417,e);for(let t=0,n=i.length;tc4(n,t),e)}function $Be(i,e){return e=Gg(181387,e),Object.keys(i).sort().reduce((t,n)=>(t=Lq(n,t),c4(i[n],t)),e)}function o6(i,e,t=32){const n=t-e,r=~((1<>>n)>>>0}function nie(i,e=0,t=i.byteLength,n=0){for(let r=0;rt.toString(16).padStart(2,"0")).join(""):HBe((i>>>0).toString(16),e/4)}class u4{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(64+3),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(t===0)return;const n=this._buff;let r=this._buffLen,o=this._leftoverHighSurrogate,s,a;for(o!==0?(s=o,a=-1,o=0):(s=e.charCodeAt(0),a=0);;){let l=s;if(xo(s))if(a+1>>6,e[t++]=128|(n&63)>>>0):n<65536?(e[t++]=224|(n&61440)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0):(e[t++]=240|(n&1835008)>>>18,e[t++]=128|(n&258048)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64+0],e[1]=e[64+1],e[2]=e[64+2]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),Tx(this._h0)+Tx(this._h1)+Tx(this._h2)+Tx(this._h3)+Tx(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,nie(this._buff,this._buffLen),this._buffLen>56&&(this._step(),nie(this._buff));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const e=u4._bigBlock32,t=this._buffDV;for(let d=0;d<64;d+=4)e.setUint32(d,t.getUint32(d,!1),!1);for(let d=64;d<320;d+=4)e.setUint32(d,o6(e.getUint32(d-12,!1)^e.getUint32(d-32,!1)^e.getUint32(d-56,!1)^e.getUint32(d-64,!1),1),!1);let n=this._h0,r=this._h1,o=this._h2,s=this._h3,a=this._h4,l,c,u;for(let d=0;d<80;d++)d<20?(l=r&o|~r&s,c=1518500249):d<40?(l=r^o^s,c=1859775393):d<60?(l=r&o|r&s|o&s,c=2400959708):(l=r^o^s,c=3395469782),u=o6(n,5)+l+a+c+e.getUint32(d*4,!1)&4294967295,a=s,s=o,o=o6(r,30),r=n,n=u;this._h0=this._h0+n&4294967295,this._h1=this._h1+r&4294967295,this._h2=this._h2+o&4294967295,this._h3=this._h3+s&4294967295,this._h4=this._h4+a&4294967295}}u4._bigBlock32=new DataView(new ArrayBuffer(320));const{registerWindow:nRt,getWindow:Pt,getDocument:iRt,getWindows:eme,getWindowsCount:VBe,getWindowId:jA,getWindowById:iie,hasWindow:rRt,onDidRegisterWindow:d4,onWillUnregisterWindow:zBe,onDidUnregisterWindow:UBe}=function(){const i=new Map;R5e(hi,1);const e={window:hi,disposables:new Te};i.set(hi.vscodeWindowId,e);const t=new se,n=new se,r=new se;function o(s,a){const l=typeof s=="number"?i.get(s):void 0;return l??(a?e:void 0)}return{onDidRegisterWindow:t.event,onWillUnregisterWindow:r.event,onDidUnregisterWindow:n.event,registerWindow(s){if(i.has(s.vscodeWindowId))return fe.None;const a=new Te,l={window:s,disposables:a.add(new Te)};return i.set(s.vscodeWindowId,l),a.add(Rt(()=>{i.delete(s.vscodeWindowId),n.fire(s)})),a.add(ye(s,Ge.BEFORE_UNLOAD,()=>{r.fire(s)})),t.fire(l),a},getWindows(){return i.values()},getWindowsCount(){return i.size},getWindowId(s){return s.vscodeWindowId},hasWindow(s){return i.has(s)},getWindowById:o,getWindow(s){var a;const l=s;if(!((a=l==null?void 0:l.ownerDocument)===null||a===void 0)&&a.defaultView)return l.ownerDocument.defaultView.window;const c=s;return c!=null&&c.view?c.view.window:hi},getDocument(s){return Pt(s).document}}}();function Ns(i){for(;i.firstChild;)i.firstChild.remove()}class jBe{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,this._options=r||!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 ye(i,e,t,n){return new jBe(i,e,t,n)}function tme(i,e){return function(t){return e(new Uu(i,t))}}function KBe(i){return function(e){return i(new Ai(e))}}const Sr=function(e,t,n,r){let o=n;return t==="click"||t==="mousedown"?o=tme(Pt(e),n):(t==="keydown"||t==="keypress"||t==="keyup")&&(o=KBe(n)),ye(e,t,o,r)},GBe=function(e,t,n){const r=tme(Pt(e),t);return qBe(e,r,n)};function qBe(i,e,t){return ye(i,ch&&yq.pointerEvents?Ge.POINTER_DOWN:Ge.MOUSE_DOWN,e,t)}function yL(i,e,t){return lE(i,e,t)}class s6 extends jpe{constructor(e,t){super(e,t)}}let KA,Il;class Eq extends Sq{constructor(e){super(),this.defaultTarget=e&&Pt(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}}class a6{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){en(e)}}static sort(e,t){return t.priority-e.priority}}(function(){const i=new Map,e=new Map,t=new Map,n=new Map,r=o=>{var s;t.set(o,!1);const a=(s=i.get(o))!==null&&s!==void 0?s:[];for(e.set(o,a),i.set(o,[]),n.set(o,!0);a.length>0;)a.sort(a6.sort),a.shift().execute();n.set(o,!1)};Il=(o,s,a=0)=>{const l=jA(o),c=new a6(s,a);let u=i.get(l);return u||(u=[],i.set(l,u)),u.push(c),t.get(l)||(t.set(l,!0),o.requestAnimationFrame(()=>r(l))),c},KA=(o,s,a)=>{const l=jA(o);if(n.get(l)){const c=new a6(s,a);let u=e.get(l);return u||(u=[],e.set(l,u)),u.push(c),c}else return Il(o,s,a)}})();function h4(i){return Pt(i).getComputedStyle(i,null)}function Tp(i,e){const t=Pt(i),n=t.document;if(i!==n.body)return new Kn(i.clientWidth,i.clientHeight);if(ch&&(t!=null&&t.visualViewport))return new Kn(t.visualViewport.width,t.visualViewport.height);if(t!=null&&t.innerWidth&&t.innerHeight)return new Kn(t.innerWidth,t.innerHeight);if(n.body&&n.body.clientWidth&&n.body.clientHeight)return new Kn(n.body.clientWidth,n.body.clientHeight);if(n.documentElement&&n.documentElement.clientWidth&&n.documentElement.clientHeight)return new Kn(n.documentElement.clientWidth,n.documentElement.clientHeight);if(e)return Tp(e);throw new Error("Unable to figure out browser width and height")}class Ir{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,n){const r=h4(e),o=r?r.getPropertyValue(t):"0";return Ir.convertToPixels(e,o)}static getBorderLeftWidth(e){return Ir.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return Ir.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return Ir.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return Ir.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return Ir.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return Ir.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return Ir.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return Ir.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return Ir.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return Ir.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return Ir.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return Ir.getDimension(e,"margin-bottom","marginBottom")}}class Kn{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new Kn(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof Kn?e:new Kn(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}}Kn.None=new Kn(0,0);function nme(i){let e=i.offsetParent,t=i.offsetTop,n=i.offsetLeft;for(;(i=i.parentNode)!==null&&i!==i.ownerDocument.body&&i!==i.ownerDocument.documentElement;){t-=i.scrollTop;const r=rme(i)?null:h4(i);r&&(n-=r.direction!=="rtl"?i.scrollLeft:-i.scrollLeft),i===e&&(n+=Ir.getBorderLeftWidth(i),t+=Ir.getBorderTopWidth(i),t+=i.offsetTop,n+=i.offsetLeft,e=i.offsetParent)}return{left:n,top:t}}function XBe(i,e,t){typeof e=="number"&&(i.style.width=`${e}px`),typeof t=="number"&&(i.style.height=`${t}px`)}function Br(i){const e=i.getBoundingClientRect(),t=Pt(i);return{left:e.left+t.scrollX,top:e.top+t.scrollY,width:e.width,height:e.height}}function ime(i){let e=i,t=1;do{const n=h4(e).zoom;n!=null&&n!=="1"&&(t*=n),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function ua(i){const e=Ir.getMarginLeft(i)+Ir.getMarginRight(i);return i.offsetWidth+e}function l6(i){const e=Ir.getBorderLeftWidth(i)+Ir.getBorderRightWidth(i),t=Ir.getPaddingLeft(i)+Ir.getPaddingRight(i);return i.offsetWidth-e-t}function YBe(i){const e=Ir.getBorderTopWidth(i)+Ir.getBorderBottomWidth(i),t=Ir.getPaddingTop(i)+Ir.getPaddingBottom(i);return i.offsetHeight-e-t}function qg(i){const e=Ir.getMarginTop(i)+Ir.getMarginBottom(i);return i.offsetHeight+e}function es(i,e){return!!(e!=null&&e.contains(i))}function ZBe(i,e,t){for(;i&&i.nodeType===i.ELEMENT_NODE;){if(i.classList.contains(e))return i;if(t){if(typeof t=="string"){if(i.classList.contains(t))return null}else if(i===t)return null}i=i.parentNode}return null}function c6(i,e,t){return!!ZBe(i,e,t)}function rme(i){return i&&!!i.host&&!!i.mode}function GA(i){return!!Tb(i)}function Tb(i){for(var e;i.parentNode;){if(i===((e=i.ownerDocument)===null||e===void 0?void 0:e.body))return null;i=i.parentNode}return rme(i)?i:null}function fs(){let i=xS().activeElement;for(;i!=null&&i.shadowRoot;)i=i.shadowRoot.activeElement;return i}function Mk(i){return fs()===i}function ome(i){return es(fs(),i)}function xS(){var i;return VBe()<=1?hi.document:(i=Array.from(eme()).map(({window:t})=>t.document).find(t=>t.hasFocus()))!==null&&i!==void 0?i:hi.document}function QBe(){var i,e;return(e=(i=xS().defaultView)===null||i===void 0?void 0:i.window)!==null&&e!==void 0?e:hi}const Dq=new Map;function sme(){return new JBe}class JBe{constructor(){this._currentCssStyle="",this._styleSheet=void 0}setStyle(e){e!==this._currentCssStyle&&(this._currentCssStyle=e,this._styleSheet?this._styleSheet.innerText=e:this._styleSheet=gc(hi.document.head,t=>t.innerText=e))}dispose(){this._styleSheet&&(this._styleSheet.remove(),this._styleSheet=void 0)}}function gc(i=hi.document.head,e,t){const n=document.createElement("style");if(n.type="text/css",n.media="screen",e==null||e(n),i.appendChild(n),t&&t.add(Rt(()=>i.removeChild(n))),i===hi.document.head){const r=new Set;Dq.set(n,r);for(const{window:o,disposables:s}of eme()){if(o===hi)continue;const a=s.add(e8e(n,r,o));t==null||t.add(a)}}return n}function e8e(i,e,t){var n,r;const o=new Te,s=i.cloneNode(!0);t.document.head.appendChild(s),o.add(Rt(()=>t.document.head.removeChild(s)));for(const a of lme(i))(n=s.sheet)===null||n===void 0||n.insertRule(a.cssText,(r=s.sheet)===null||r===void 0?void 0:r.cssRules.length);return o.add(t8e.observe(i,o,{childList:!0})(()=>{s.textContent=i.textContent})),e.add(s),o.add(Rt(()=>e.delete(s))),o}const t8e=new class{constructor(){this.mutationObservers=new Map}observe(i,e,t){let n=this.mutationObservers.get(i);n||(n=new Map,this.mutationObservers.set(i,n));const r=l4(t);let o=n.get(r);if(o)o.users+=1;else{const s=new se,a=new MutationObserver(c=>s.fire(c));a.observe(i,t);const l=o={users:1,observer:a,onDidMutate:s.event};e.add(Rt(()=>{l.users-=1,l.users===0&&(s.dispose(),a.disconnect(),n==null||n.delete(r),(n==null?void 0:n.size)===0&&this.mutationObservers.delete(i))})),n.set(r,o)}return o.onDidMutate}};let u6=null;function ame(){return u6||(u6=gc()),u6}function lme(i){var e,t;return!((e=i==null?void 0:i.sheet)===null||e===void 0)&&e.rules?i.sheet.rules:!((t=i==null?void 0:i.sheet)===null||t===void 0)&&t.cssRules?i.sheet.cssRules:[]}function qA(i,e,t=ame()){var n,r;if(!(!t||!e)){(n=t.sheet)===null||n===void 0||n.insertRule(`${i} {${e}}`,0);for(const o of(r=Dq.get(t))!==null&&r!==void 0?r:[])qA(i,e,o)}}function aH(i,e=ame()){var t,n;if(!e)return;const r=lme(e),o=[];for(let s=0;s=0;s--)(t=e.sheet)===null||t===void 0||t.deleteRule(o[s]);for(const s of(n=Dq.get(e))!==null&&n!==void 0?n:[])aH(i,s)}function n8e(i){return typeof i.selectorText=="string"}function Iq(i){return i instanceof MouseEvent||i instanceof Pt(i).MouseEvent}function kq(i){return i instanceof KeyboardEvent||i instanceof Pt(i).KeyboardEvent}const Ge={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",PASTE:"paste",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:tb?"webkitAnimationStart":"animationstart",ANIMATION_END:tb?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:tb?"webkitAnimationIteration":"animationiteration"};function i8e(i){const e=i;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const hn={stop:(i,e)=>(i.preventDefault(),e&&i.stopPropagation(),i)};function r8e(i){const e=[];for(let t=0;i&&i.nodeType===i.ELEMENT_NODE;t++)e[t]=i.scrollTop,i=i.parentNode;return e}function o8e(i,e){for(let t=0;i&&i.nodeType===i.ELEMENT_NODE;t++)i.scrollTop!==e[t]&&(i.scrollTop=e[t]),i=i.parentNode}class XA extends fe{static hasFocusWithin(e){if(e instanceof HTMLElement){const t=Tb(e),n=t?t.activeElement:e.ownerDocument.activeElement;return es(n,e)}else{const t=e;return es(t.document.activeElement,t.document)}}constructor(e){super(),this._onDidFocus=this._register(new se),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new se),this.onDidBlur=this._onDidBlur.event;let t=XA.hasFocusWithin(e),n=!1;const r=()=>{n=!1,t||(t=!0,this._onDidFocus.fire())},o=()=>{t&&(n=!0,(e instanceof HTMLElement?Pt(e):e).setTimeout(()=>{n&&(n=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{XA.hasFocusWithin(e)!==t&&(t?o():r())},this._register(ye(e,Ge.FOCUS,r,!0)),this._register(ye(e,Ge.BLUR,o,!0)),e instanceof HTMLElement&&(this._register(ye(e,Ge.FOCUS_IN,()=>this._refreshStateHandler())),this._register(ye(e,Ge.FOCUS_OUT,()=>this._refreshStateHandler())))}}function dh(i){return new XA(i)}function s8e(i,e){return i.after(e),e}function ke(i,...e){if(i.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function Tq(i,e){return i.insertBefore(e,i.firstChild),e}function gs(i,...e){i.innerText="",ke(i,...e)}const a8e=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var DD;(function(i){i.HTML="http://www.w3.org/1999/xhtml",i.SVG="http://www.w3.org/2000/svg"})(DD||(DD={}));function cme(i,e,t,...n){const r=a8e.exec(e);if(!r)throw new Error("Bad use of emmet");const o=r[1]||"div";let s;return i!==DD.HTML?s=document.createElementNS(i,o):s=document.createElement(o),r[3]&&(s.id=r[3]),r[4]&&(s.className=r[4].replace(/\./g," ").trim()),t&&Object.entries(t).forEach(([a,l])=>{typeof l>"u"||(/^on\w+$/.test(a)?s[a]=l:a==="selected"?l&&s.setAttribute(a,"true"):s.setAttribute(a,l))}),s.append(...n),s}function He(i,e,...t){return cme(DD.HTML,i,e,...t)}He.SVG=function(i,e,...t){return cme(DD.SVG,i,e,...t)};function l8e(i,...e){i?bl(...e):fa(...e)}function bl(...i){for(const e of i)e.style.display="",e.removeAttribute("aria-hidden")}function fa(...i){for(const e of i)e.style.display="none",e.setAttribute("aria-hidden","true")}function rie(i,e){const t=i.devicePixelRatio*e;return Math.max(1,Math.floor(t))/i.devicePixelRatio}function ume(i){hi.open(i,"_blank","noopener")}function c8e(i,e){const t=()=>{e(),n=Il(i,t)};let n=Il(i,t);return Rt(()=>n.dispose())}Qpe.setPreferredWebSchema(/^https:/.test(hi.location.href)?"https":"http");function Kv(i){return i?`url('${Jpe.uriToBrowserUri(i).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function oie(i){return`'${i.replace(/'/g,"%27")}'`}function gp(i,e){if(i!==void 0){const t=i.match(/^\s*var\((.+)\)$/);if(t){const n=t[1].split(",",2);return n.length===2&&(e=gp(n[1].trim(),e)),`var(${n[0]}, ${e})`}return i}return e}function u8e(i,e=!1){const t=document.createElement("a");return sH("afterSanitizeAttributes",n=>{for(const r of["href","src"])if(n.hasAttribute(r)){const o=n.getAttribute(r);if(r==="href"&&o.startsWith("#"))continue;if(t.href=o,!i.includes(t.protocol.replace(/:$/,""))){if(e&&r==="src"&&t.href.startsWith("data:"))continue;n.removeAttribute(r)}}}),Rt(()=>{Zpe("afterSanitizeAttributes")})}const d8e=Object.freeze(["a","abbr","b","bdo","blockquote","br","caption","cite","code","col","colgroup","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","label","li","mark","ol","p","pre","q","rp","rt","ruby","samp","small","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","time","tr","tt","u","ul","var","video","wbr"]);class Xg extends se{constructor(){super(),this._subscriptions=new Te,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(Je.runAndSubscribe(d4,({window:e,disposables:t})=>this.registerListeners(e,t),{window:hi,disposables:this._subscriptions}))}registerListeners(e,t){t.add(ye(e,"keydown",n=>{if(n.defaultPrevented)return;const r=new Ai(n);if(!(r.keyCode===6&&n.repeat)){if(n.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(n.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(n.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(n.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else if(r.keyCode!==6)this._keyStatus.lastKeyPressed=void 0;else return;this._keyStatus.altKey=n.altKey,this._keyStatus.ctrlKey=n.ctrlKey,this._keyStatus.metaKey=n.metaKey,this._keyStatus.shiftKey=n.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=n,this.fire(this._keyStatus))}},!0)),t.add(ye(e,"keyup",n=>{n.defaultPrevented||(!n.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!n.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!n.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!n.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=n.altKey,this._keyStatus.ctrlKey=n.ctrlKey,this._keyStatus.metaKey=n.metaKey,this._keyStatus.shiftKey=n.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=n,this.fire(this._keyStatus)))},!0)),t.add(ye(e.document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(ye(e.document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(ye(e.document.body,"mousemove",n=>{n.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),t.add(ye(e,"blur",()=>{this.resetKeyStatus()}))}get keyStatus(){return this._keyStatus}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return Xg.instance||(Xg.instance=new Xg),Xg.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class h8e extends fe{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this.callbacks.onDragStart&&this._register(ye(this.element,Ge.DRAG_START,e=>{var t,n;(n=(t=this.callbacks).onDragStart)===null||n===void 0||n.call(t,e)})),this.callbacks.onDrag&&this._register(ye(this.element,Ge.DRAG,e=>{var t,n;(n=(t=this.callbacks).onDrag)===null||n===void 0||n.call(t,e)})),this._register(ye(this.element,Ge.DRAG_ENTER,e=>{var t,n;this.counter++,this.dragStartTime=e.timeStamp,(n=(t=this.callbacks).onDragEnter)===null||n===void 0||n.call(t,e)})),this._register(ye(this.element,Ge.DRAG_OVER,e=>{var t,n;e.preventDefault(),(n=(t=this.callbacks).onDragOver)===null||n===void 0||n.call(t,e,e.timeStamp-this.dragStartTime)})),this._register(ye(this.element,Ge.DRAG_LEAVE,e=>{var t,n;this.counter--,this.counter===0&&(this.dragStartTime=0,(n=(t=this.callbacks).onDragLeave)===null||n===void 0||n.call(t,e))})),this._register(ye(this.element,Ge.DRAG_END,e=>{var t,n;this.counter=0,this.dragStartTime=0,(n=(t=this.callbacks).onDragEnd)===null||n===void 0||n.call(t,e)})),this._register(ye(this.element,Ge.DROP,e=>{var t,n;this.counter=0,this.dragStartTime=0,(n=(t=this.callbacks).onDrop)===null||n===void 0||n.call(t,e)}))}}const f8e=/(?[\w\-]+)?(?:#(?[\w\-]+))?(?(?:\.(?:[\w\-]+))*)(?:@(?(?:[\w\_])+))?/;function gi(i,...e){let t,n;Array.isArray(e[0])?(t={},n=e[0]):(t=e[0]||{},n=e[1]);const r=f8e.exec(i);if(!r||!r.groups)throw new Error("Bad use of h");const o=r.groups.tag||"div",s=document.createElement(o);r.groups.id&&(s.id=r.groups.id);const a=[];if(r.groups.class)for(const c of r.groups.class.split("."))c!==""&&a.push(c);if(t.className!==void 0)for(const c of t.className.split("."))c!==""&&a.push(c);a.length>0&&(s.className=a.join(" "));const l={};if(r.groups.name&&(l[r.groups.name]=s),n)for(const c of n)c instanceof HTMLElement?s.appendChild(c):typeof c=="string"?s.append(c):"root"in c&&(Object.assign(l,c),s.appendChild(c.root));for(const[c,u]of Object.entries(t))if(c!=="className")if(c==="style")for(const[d,h]of Object.entries(u))s.style.setProperty(sie(d),typeof h=="number"?h+"px":""+h);else c==="tabIndex"?s.tabIndex=u:s.setAttribute(sie(c),u.toString());return l.root=s,l}function sie(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class g8e extends fe{constructor(e){super(),this._onDidChange=this._register(new se),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(e,!0),this._mediaQueryList=null,this._handleChange(e,!1)}_handleChange(e,t){var n;(n=this._mediaQueryList)===null||n===void 0||n.removeEventListener("change",this._listener),this._mediaQueryList=e.matchMedia(`(resolution: ${e.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),t&&this._onDidChange.fire()}}class p8e extends fe{get value(){return this._value}constructor(e){super(),this._onDidChange=this._register(new se),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio(e);const t=this._register(new g8e(e));this._register(t.onDidChange(()=>{this._value=this._getPixelRatio(e),this._onDidChange.fire(this._value)}))}_getPixelRatio(e){const t=document.createElement("canvas").getContext("2d"),n=e.devicePixelRatio||1,r=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return n/r}}class m8e{constructor(){this.mapWindowIdToPixelRatioMonitor=new Map}_getOrCreatePixelRatioMonitor(e){const t=jA(e);let n=this.mapWindowIdToPixelRatioMonitor.get(t);return n||(n=new p8e(e),this.mapWindowIdToPixelRatioMonitor.set(t,n),Je.once(UBe)(({vscodeWindowId:r})=>{r===t&&(n==null||n.dispose(),this.mapWindowIdToPixelRatioMonitor.delete(t))})),n}getInstance(e){return this._getOrCreatePixelRatioMonitor(e)}}const ID=new m8e;class dme{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingLeft="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){const t=yd(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=yd(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=yd(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=yd(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=yd(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=yd(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=yd(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){const t=yd(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){const t=yd(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){const t=yd(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=yd(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}}function yd(i){return typeof i=="number"?`${i}px`:i}function Qn(i){return new dme(i)}function ps(i,e){i instanceof dme?(i.setFontFamily(e.getMassagedFontFamily()),i.setFontWeight(e.fontWeight),i.setFontSize(e.fontSize),i.setFontFeatureSettings(e.fontFeatureSettings),i.setFontVariationSettings(e.fontVariationSettings),i.setLineHeight(e.lineHeight),i.setLetterSpacing(e.letterSpacing)):(i.style.fontFamily=e.getMassagedFontFamily(),i.style.fontWeight=e.fontWeight,i.style.fontSize=e.fontSize+"px",i.style.fontFeatureSettings=e.fontFeatureSettings,i.style.fontVariationSettings=e.fontVariationSettings,i.style.lineHeight=e.lineHeight+"px",i.style.letterSpacing=e.letterSpacing+"px")}class v8e{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class Nq{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(e){this._createDomElements(),e.document.body.appendChild(this._container),this._readFromDomElements(),e.document.body.removeChild(this._container),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const t=document.createElement("div");ps(t,this._bareFontInfo),e.appendChild(t);const n=document.createElement("div");ps(n,this._bareFontInfo),n.style.fontWeight="bold",e.appendChild(n);const r=document.createElement("div");ps(r,this._bareFontInfo),r.style.fontStyle="italic",e.appendChild(r);const o=[];for(const s of this._requests){let a;s.type===0&&(a=t),s.type===2&&(a=n),s.type===1&&(a=r),a.appendChild(document.createElement("br"));const l=document.createElement("span");Nq._render(l,s),a.appendChild(l),o.push(l)}this._container=e,this._testElements=o}static _render(e,t){if(t.chr===" "){let n=" ";for(let r=0;r<8;r++)n+=n;e.innerText=n}else{let n=t.chr;for(let r=0;r<8;r++)n+=n;e.textContent=n}}_readFromDomElements(){for(let e=0,t=this._requests.length;e{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings(e)},5e3))}_evictUntrustedReadings(e){const t=this._ensureCache(e),n=t.getValues();let r=!1;for(const o of n)o.isTrusted||(r=!0,t.remove(o));r&&this._onDidChange.fire()}readFontInfo(e,t){const n=this._ensureCache(e);if(!n.has(t)){let r=this._actualReadFontInfo(e,t);(r.typicalHalfwidthCharacterWidth<=2||r.typicalFullwidthCharacterWidth<=2||r.spaceWidth<=2||r.maxDigitWidth<=2)&&(r=new lH({pixelRatio:ID.getInstance(e).value,fontFamily:r.fontFamily,fontWeight:r.fontWeight,fontSize:r.fontSize,fontFeatureSettings:r.fontFeatureSettings,fontVariationSettings:r.fontVariationSettings,lineHeight:r.lineHeight,letterSpacing:r.letterSpacing,isMonospace:r.isMonospace,typicalHalfwidthCharacterWidth:Math.max(r.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(r.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:r.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(r.spaceWidth,5),middotWidth:Math.max(r.middotWidth,5),wsmiddotWidth:Math.max(r.wsmiddotWidth,5),maxDigitWidth:Math.max(r.maxDigitWidth,5)},!1)),this._writeToCache(e,t,r)}return n.get(t)}_createRequest(e,t,n,r){const o=new v8e(e,t);return n.push(o),r==null||r.push(o),o}_actualReadFontInfo(e,t){const n=[],r=[],o=this._createRequest("n",0,n,r),s=this._createRequest("m",0,n,null),a=this._createRequest(" ",0,n,r),l=this._createRequest("0",0,n,r),c=this._createRequest("1",0,n,r),u=this._createRequest("2",0,n,r),d=this._createRequest("3",0,n,r),h=this._createRequest("4",0,n,r),f=this._createRequest("5",0,n,r),g=this._createRequest("6",0,n,r),p=this._createRequest("7",0,n,r),v=this._createRequest("8",0,n,r),m=this._createRequest("9",0,n,r),_=this._createRequest("→",0,n,r),y=this._createRequest("→",0,n,null),S=this._createRequest("·",0,n,r),L=this._createRequest(String.fromCharCode(11825),0,n,null),E="|/-_ilm%";for(let A=0,N=E.length;A.001){k=!1;break}}let M=!0;return k&&y.width!==T&&(M=!1),y.width>_.width&&(M=!1),new lH({pixelRatio:ID.getInstance(e).value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,fontVariationSettings:t.fontVariationSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:k,typicalHalfwidthCharacterWidth:o.width,typicalFullwidthCharacterWidth:s.width,canUseHalfwidthRightwardsArrow:M,spaceWidth:a.width,middotWidth:S.width,wsmiddotWidth:L.width,maxDigitWidth:D},!0)}}class w8e{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){const t=e.getId();return!!this._values[t]}get(e){const t=e.getId();return this._values[t]}put(e,t){const n=e.getId();this._keys[n]=e,this._values[n]=t}remove(e){const t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map(e=>this._values[e])}}const cH=new y8e;var qd;(function(i){i.serviceIds=new Map,i.DI_TARGET="$di$target",i.DI_DEPENDENCIES="$di$dependencies";function e(t){return t[i.DI_DEPENDENCIES]||[]}i.getServiceDependencies=e})(qd||(qd={}));const Ot=yn("instantiationService");function S8e(i,e,t){e[qd.DI_TARGET]===e?e[qd.DI_DEPENDENCIES].push({id:i,index:t}):(e[qd.DI_DEPENDENCIES]=[{id:i,index:t}],e[qd.DI_TARGET]=e)}function yn(i){if(qd.serviceIds.has(i))return qd.serviceIds.get(i);const e=function(t,n,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");S8e(e,t,r)};return e.toString=()=>i,qd.serviceIds.set(i,e),e}const Un=yn("codeEditorService"),tr=yn("modelService"),ol=yn("textModelService");class xl extends fe{constructor(e,t="",n="",r=!0,o){super(),this._onDidChange=this._register(new se),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=n,this._enabled=r,this._actionCallback=o}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||""}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}async run(e,t){this._actionCallback&&await this._actionCallback(e)}}class Nb extends fe{constructor(){super(...arguments),this._onWillRun=this._register(new se),this.onWillRun=this._onWillRun.event,this._onDidRun=this._register(new se),this.onDidRun=this._onDidRun.event}async run(e,t){if(!e.enabled)return;this._onWillRun.fire({action:e});let n;try{await this.runAction(e,t)}catch(r){n=r}this._onDidRun.fire({action:e,error:n})}async runAction(e,t){await e.run(t)}}class lo{constructor(){this.id=lo.ID,this.label="",this.tooltip="",this.class="separator",this.enabled=!1,this.checked=!1}static join(...e){let t=[];for(const n of e)n.length&&(t.length?t=[...t,new lo,...n]:t=n);return t}async run(){}}lo.ID="vs.actions.separator";class Lw{get actions(){return this._actions}constructor(e,t,n,r){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=r,this._actions=n}async run(){}}class f4 extends xl{constructor(){super(f4.ID,w("submenu.empty","(empty)"),void 0,!1)}}f4.ID="vs.actions.empty";function My(i){var e;return{id:i.id,label:i.label,class:i.class,enabled:(e=i.enabled)!==null&&e!==void 0?e:!0,checked:i.checked,run:async(...t)=>i.run(...t),tooltip:i.label}}var uH;(function(i){function e(t){return t&&typeof t=="object"&&typeof t.id=="string"}i.isThemeColor=e})(uH||(uH={}));var Wt;(function(i){i.iconNameSegment="[A-Za-z0-9]+",i.iconNameExpression="[A-Za-z0-9-]+",i.iconModifierExpression="~[A-Za-z]+",i.iconNameCharacter="[A-Za-z0-9~-]";const e=new RegExp(`^(${i.iconNameExpression})(${i.iconModifierExpression})?$`);function t(h){const f=e.exec(h.id);if(!f)return t(Xe.error);const[,g,p]=f,v=["codicon","codicon-"+g];return p&&v.push("codicon-modifier-"+p.substring(1)),v}i.asClassNameArray=t;function n(h){return t(h).join(" ")}i.asClassName=n;function r(h){return"."+t(h).join(".")}i.asCSSSelector=r;function o(h){return h&&typeof h=="object"&&typeof h.id=="string"&&(typeof h.color>"u"||uH.isThemeColor(h.color))}i.isThemeIcon=o;const s=new RegExp(`^\\$\\((${i.iconNameExpression}(?:${i.iconModifierExpression})?)\\)$`);function a(h){const f=s.exec(h);if(!f)return;const[,g]=f;return{id:g}}i.fromString=a;function l(h){return{id:h}}i.fromId=l;function c(h,f){let g=h.id;const p=g.lastIndexOf("~");return p!==-1&&(g=g.substring(0,p)),f&&(g=`${g}~${f}`),{id:g}}i.modify=c;function u(h){const f=h.id.lastIndexOf("~");if(f!==-1)return h.id.substring(f+1)}i.getModifier=u;function d(h,f){var g,p;return h.id===f.id&&((g=h.color)===null||g===void 0?void 0:g.id)===((p=f.color)===null||p===void 0?void 0:p.id)}i.isEqual=d})(Wt||(Wt={}));const sr=yn("commandService"),Dn=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new se,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(i,e){if(!i)throw new Error("invalid command");if(typeof i=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:i,handler:e})}if(i.metadata&&Array.isArray(i.metadata.args)){const s=[];for(const l of i.metadata.args)s.push(l.constraint);const a=i.handler;i.handler=function(l,...c){return W4e(c,s),a(l,...c)}}const{id:t}=i;let n=this._commands.get(t);n||(n=new _a,this._commands.set(t,n));const r=n.unshift(i),o=Rt(()=>{r();const s=this._commands.get(t);s!=null&&s.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),o}registerCommandAlias(i,e){return Dn.registerCommand(i,(t,...n)=>t.get(sr).executeCommand(e,...n))}getCommand(i){const e=this._commands.get(i);if(!(!e||e.isEmpty()))return En.first(e)}getCommands(){const i=new Map;for(const e of this._commands.keys()){const t=this.getCommand(e);t&&i.set(e,t)}return i}};Dn.registerCommand("noop",()=>{});function h6(...i){switch(i.length){case 1:return w("contextkey.scanner.hint.didYouMean1","Did you mean {0}?",i[0]);case 2:return w("contextkey.scanner.hint.didYouMean2","Did you mean {0} or {1}?",i[0],i[1]);case 3:return w("contextkey.scanner.hint.didYouMean3","Did you mean {0}, {1} or {2}?",i[0],i[1],i[2]);default:return}}const x8e=w("contextkey.scanner.hint.didYouForgetToOpenOrCloseQuote","Did you forget to open or close the quote?"),L8e=w("contextkey.scanner.hint.didYouForgetToEscapeSlash","Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.");let y0=class dH{constructor(){this._input="",this._start=0,this._current=0,this._tokens=[],this._errors=[],this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(e){switch(e.type){case 0:return"(";case 1:return")";case 2:return"!";case 3:return e.isTripleEq?"===":"==";case 4:return e.isTripleEq?"!==":"!=";case 5:return"<";case 6:return"<=";case 7:return">=";case 8:return">=";case 9:return"=~";case 10:return e.lexeme;case 11:return"true";case 12:return"false";case 13:return"in";case 14:return"not";case 15:return"&&";case 16:return"||";case 17:return e.lexeme;case 18:return e.lexeme;case 19:return e.lexeme;case 20:return"EOF";default:throw sq(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}reset(e){return this._input=e,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();)switch(this._start=this._current,this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){const t=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:t})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){const t=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:t})}else this._match(126)?this._addToken(9):this._error(h6("==","=~"));break;case 60:this._addToken(this._match(61)?6:5);break;case 62:this._addToken(this._match(61)?8:7);break;case 38:this._match(38)?this._addToken(15):this._error(h6("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(h6("||"));break;case 32:case 13:case 9:case 10:case 160:break;default:this._string()}return this._start=this._current,this._addToken(20),Array.from(this._tokens)}_match(e){return this._isAtEnd()||this._input.charCodeAt(this._current)!==e?!1:(this._current++,!0)}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?0:this._input.charCodeAt(this._current)}_addToken(e){this._tokens.push({type:e,offset:this._start})}_error(e){const t=this._start,n=this._input.substring(this._start,this._current),r={type:19,offset:this._start,lexeme:n};this._errors.push({offset:t,lexeme:n,additionalInfo:e}),this._tokens.push(r)}_string(){this.stringRe.lastIndex=this._start;const e=this.stringRe.exec(this._input);if(e){this._current=this._start+e[0].length;const t=this._input.substring(this._start,this._current),n=dH._keywords.get(t);n?this._addToken(n):this._tokens.push({type:17,lexeme:t,offset:this._start})}}_quotedString(){for(;this._peek()!==39&&!this._isAtEnd();)this._advance();if(this._isAtEnd()){this._error(x8e);return}this._advance(),this._tokens.push({type:18,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1})}_regex(){let e=this._current,t=!1,n=!1;for(;;){if(e>=this._input.length){this._current=e,this._error(L8e);return}const o=this._input.charCodeAt(e);if(t)t=!1;else if(o===47&&!n){e++;break}else o===91?n=!0:o===92?t=!0:o===93&&(n=!1);e++}for(;e=this._input.length}};y0._regexFlags=new Set(["i","g","s","m","y","u"].map(i=>i.charCodeAt(0)));y0._keywords=new Map([["not",14],["in",13],["false",12],["true",11]]);const As=new Map;As.set("false",!1);As.set("true",!0);As.set("isMac",Ln);As.set("isLinux",Da);As.set("isWindows",Rs);As.set("isWeb",S_);As.set("isMacNative",Ln&&!S_);As.set("isEdge",e3e);As.set("isFirefox",Q4e);As.set("isChrome",hpe);As.set("isSafari",J4e);const E8e=Object.prototype.hasOwnProperty,D8e={regexParsingWithErrorRecovery:!0},I8e=w("contextkey.parser.error.emptyString","Empty context key expression"),k8e=w("contextkey.parser.error.emptyString.hint","Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively."),T8e=w("contextkey.parser.error.noInAfterNot","'in' after 'not'."),aie=w("contextkey.parser.error.closingParenthesis","closing parenthesis ')'"),N8e=w("contextkey.parser.error.unexpectedToken","Unexpected token"),R8e=w("contextkey.parser.error.unexpectedToken.hint","Did you forget to put && or || before the token?"),M8e=w("contextkey.parser.error.unexpectedEOF","Unexpected end of expression"),A8e=w("contextkey.parser.error.unexpectedEOF.hint","Did you forget to put a context key?");let hme=class wL{constructor(e=D8e){this._config=e,this._scanner=new y0,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(e===""){this._parsingErrors.push({message:I8e,offset:0,lexeme:"",additionalInfo:k8e});return}this._tokens=this._scanner.reset(e).scan(),this._current=0,this._parsingErrors=[];try{const t=this._expr();if(!this._isAtEnd()){const n=this._peek(),r=n.type===17?R8e:void 0;throw this._parsingErrors.push({message:N8e,offset:n.offset,lexeme:y0.getLexeme(n),additionalInfo:r}),wL._parseError}return t}catch(t){if(t!==wL._parseError)throw t;return}}_expr(){return this._or()}_or(){const e=[this._and()];for(;this._matchOne(16);){const t=this._and();e.push(t)}return e.length===1?e[0]:De.or(...e)}_and(){const e=[this._term()];for(;this._matchOne(15);){const t=this._term();e.push(t)}return e.length===1?e[0]:De.and(...e)}_term(){if(this._matchOne(2)){const e=this._peek();switch(e.type){case 11:return this._advance(),Ia.INSTANCE;case 12:return this._advance(),tl.INSTANCE;case 0:{this._advance();const t=this._expr();return this._consume(1,aie),t==null?void 0:t.negate()}case 17:return this._advance(),uC.create(e.lexeme);default:throw this._errExpectedButGot("KEY | true | false | '(' expression ')'",e)}}return this._primary()}_primary(){const e=this._peek();switch(e.type){case 11:return this._advance(),De.true();case 12:return this._advance(),De.false();case 0:{this._advance();const t=this._expr();return this._consume(1,aie),t}case 17:{const t=e.lexeme;if(this._advance(),this._matchOne(9)){const r=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),r.type!==10)throw this._errExpectedButGot("REGEX",r);const o=r.lexeme,s=o.lastIndexOf("/"),a=s===o.length-1?void 0:this._removeFlagsGY(o.substring(s+1));let l;try{l=new RegExp(o.substring(1,s),a)}catch{throw this._errExpectedButGot("REGEX",r)}return kD.create(t,l)}switch(r.type){case 10:case 19:{const o=[r.lexeme];this._advance();let s=this._peek(),a=0;for(let h=0;h=0){const c=o.slice(a+1,l),u=o[l+1]==="i"?"i":"";try{s=new RegExp(c,u)}catch{throw this._errExpectedButGot("REGEX",r)}}}if(s===null)throw this._errExpectedButGot("REGEX",r);return kD.create(t,s)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,T8e);const r=this._value();return De.notIn(t,r)}switch(this._peek().type){case 3:{this._advance();const r=this._value();if(this._previous().type===18)return De.equals(t,r);switch(r){case"true":return De.has(t);case"false":return De.not(t);default:return De.equals(t,r)}}case 4:{this._advance();const r=this._value();if(this._previous().type===18)return De.notEquals(t,r);switch(r){case"true":return De.not(t);case"false":return De.has(t);default:return De.notEquals(t,r)}}case 5:return this._advance(),C4.create(t,this._value());case 6:return this._advance(),y4.create(t,this._value());case 7:return this._advance(),_4.create(t,this._value());case 8:return this._advance(),b4.create(t,this._value());case 13:return this._advance(),De.in(t,this._value());default:return De.has(t)}}case 20:throw this._parsingErrors.push({message:M8e,offset:e.offset,lexeme:"",additionalInfo:A8e}),wL._parseError;default:throw this._errExpectedButGot(`true | false | KEY | KEY '=~' REGEX | KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`,this._peek())}}_value(){const e=this._peek();switch(e.type){case 17:case 18:return this._advance(),e.lexeme;case 11:return this._advance(),"true";case 12:return this._advance(),"false";case 13:return this._advance(),"in";default:return""}}_removeFlagsGY(e){return e.replaceAll(this._flagsGYRe,"")}_previous(){return this._tokens[this._current-1]}_matchOne(e){return this._check(e)?(this._advance(),!0):!1}_advance(){return this._isAtEnd()||this._current++,this._previous()}_consume(e,t){if(this._check(e))return this._advance();throw this._errExpectedButGot(t,this._peek())}_errExpectedButGot(e,t,n){const r=w("contextkey.parser.error.expectedButGot",`Expected: {0} -Received: '{1}'.`,e,w0.getLexeme(t)),o=t.offset,s=w0.getLexeme(t);return this._parsingErrors.push({message:r,offset:o,lexeme:s,additionalInfo:n}),wL._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}};hme._parseError=new Error;class De{static false(){return Ia.INSTANCE}static true(){return tl.INSTANCE}static has(e){return cC.create(e)}static equals(e,t){return LS.create(e,t)}static notEquals(e,t){return m4.create(e,t)}static regex(e,t){return kD.create(e,t)}static in(e,t){return g4.create(e,t)}static notIn(e,t){return p4.create(e,t)}static not(e){return uC.create(e)}static and(...e){return B0.create(e,null,!0)}static or(...e){return Wg.create(e,null,!0)}static deserialize(e){return e==null?void 0:this._parser.parse(e)}}De._parser=new hme({regexParsingWithErrorRecovery:!1});function P8e(i,e){const t=i?i.substituteConstants():void 0,n=e?e.substituteConstants():void 0;return!t&&!n?!0:!t||!n?!1:t.equals(n)}function cE(i,e){return i.cmp(e)}class Ia{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 tl.INSTANCE}}Ia.INSTANCE=new Ia;class tl{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 Ia.INSTANCE}}tl.INSTANCE=new tl;class cC{static create(e,t=null){const n=As.get(e);return typeof n=="boolean"?n?tl.INSTANCE:Ia.INSTANCE:new cC(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=2}cmp(e){return e.type!==this.type?this.type-e.type:gme(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=As.get(this.key);return typeof e=="boolean"?e?tl.INSTANCE:Ia.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=uC.create(this.key,this)),this.negated}}class LS{static create(e,t,n=null){if(typeof t=="boolean")return t?cC.create(e,n):uC.create(e,n);const r=As.get(e);return typeof r=="boolean"?t===(r?"true":"false")?tl.INSTANCE:Ia.INSTANCE:new LS(e,t,n)}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:dC(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=As.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?tl.INSTANCE:Ia.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=m4.create(this.key,this.value,this)),this.negated}}class g4{static create(e,t){return new g4(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}cmp(e){return e.type!==this.type?this.type-e.type:dC(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type?this.key===e.key&&this.valueKey===e.valueKey:!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.valueKey),n=e.getValue(this.key);return Array.isArray(t)?t.includes(n):typeof n=="string"&&typeof t=="object"&&t!==null?E8e.call(t,n):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=p4.create(this.key,this.valueKey)),this.negated}}class p4{static create(e,t){return new p4(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=g4.create(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:this._negated.cmp(e._negated)}equals(e){return e.type===this.type?this._negated.equals(e._negated):!1}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}negate(){return this._negated}}class m4{static create(e,t,n=null){if(typeof t=="boolean")return t?uC.create(e,n):cC.create(e,n);const r=As.get(e);return typeof r=="boolean"?t===(r?"true":"false")?Ia.INSTANCE:tl.INSTANCE:new m4(e,t,n)}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=5}cmp(e){return e.type!==this.type?this.type-e.type:dC(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=As.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?Ia.INSTANCE:tl.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=LS.create(this.key,this.value,this)),this.negated}}class uC{static create(e,t=null){const n=As.get(e);return typeof n=="boolean"?n?Ia.INSTANCE:tl.INSTANCE:new uC(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=3}cmp(e){return e.type!==this.type?this.type-e.type:gme(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=As.get(this.key);return typeof e=="boolean"?e?Ia.INSTANCE:tl.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=cC.create(this.key,this)),this.negated}}function v4(i,e){if(typeof i=="string"){const t=parseFloat(i);isNaN(t)||(i=t)}return typeof i=="string"||typeof i=="number"?e(i):Ia.INSTANCE}class _4{static create(e,t,n=null){return v4(t,r=>new _4(e,r,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=12}cmp(e){return e.type!==this.type?this.type-e.type:dC(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=y4.create(this.key,this.value,this)),this.negated}}class b4{static create(e,t,n=null){return v4(t,r=>new b4(e,r,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=13}cmp(e){return e.type!==this.type?this.type-e.type:dC(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=C4.create(this.key,this.value,this)),this.negated}}class C4{static create(e,t,n=null){return v4(t,r=>new C4(e,r,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=14}cmp(e){return e.type!==this.type?this.type-e.type:dC(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))new y4(e,r,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=15}cmp(e){return e.type!==this.type?this.type-e.type:dC(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=_4.create(this.key,this.value,this)),this.negated}}class kD{static create(e,t){return new kD(e,t)}constructor(e,t){this.key=e,this.regexp=t,this.type=7,this.negated=null}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.keye.key)return 1;const t=this.regexp?this.regexp.source:"",n=e.regexp?e.regexp.source:"";return tn?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",n=e.regexp?e.regexp.source:"";return this.key===e.key&&t===n}return!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.key);return this.regexp?this.regexp.test(t):!1}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Rq.create(this)),this.negated}}class Rq{static create(e){return new Rq(e)}constructor(e){this._actual=e,this.type=8}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type?this._actual.equals(e._actual):!1}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}negate(){return this._actual}}function fme(i){let e=null;for(let t=0,n=i.length;te.expr.length)return 1;for(let t=0,n=this.expr.length;t1;){const s=r[r.length-1];if(s.type!==9)break;r.pop();const a=r.pop(),l=r.length===0,c=Wg.create(s.expr.map(u=>B0.create([u,a],null,n)),null,l);c&&(r.push(c),r.sort(cE))}if(r.length===1)return r[0];if(n){for(let s=0;se.serialize()).join(" && ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());this.negated=Wg.create(e,this,!0)}return this.negated}}class Wg{static create(e,t,n){return Wg._normalizeArr(e,t,n)}constructor(e,t){this.expr=e,this.negated=t,this.type=9}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.lengthe.expr.length)return 1;for(let t=0,n=this.expr.length;te.serialize()).join(" || ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());for(;e.length>1;){const t=e.shift(),n=e.shift(),r=[];for(const o of cie(t))for(const s of cie(n))r.push(B0.create([o,s],null,!1));e.unshift(Wg.create(r,null,!1))}this.negated=Wg.create(e,this,!0)}return this.negated}}class st extends cC{static all(){return st._info.values()}constructor(e,t,n){super(e,null),this._defaultValue=t,typeof n=="object"?st._info.push({...n,key:e}):n!==!0&&st._info.push({key:e,description:n,type:t!=null?typeof t:void 0})}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return LS.create(this.key,e)}}st._info=[];const Vt=yn("contextKeyService");function gme(i,e){return ie?1:0}function dC(i,e,t,n){return it?1:en?1:0}function hH(i,e){if(i.type===0||e.type===1)return!0;if(i.type===9)return e.type===9?lie(i.expr,e.expr):!1;if(e.type===9){for(const t of e.expr)if(hH(i,t))return!0;return!1}if(i.type===6){if(e.type===6)return lie(e.expr,i.expr);for(const t of i.expr)if(hH(t,e))return!0;return!1}return i.equals(e)}function lie(i,e){let t=0,n=0;for(;t{a(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(B8e)),this._cachedMergedKeybindings.slice(0)}}const nl=new Mq,F8e={EditorModes:"platform.keybindingsRegistry"};ar.add(F8e.EditorModes,nl);function B8e(i,e){if(i.weight1!==e.weight1)return i.weight1-e.weight1;if(i.command&&e.command){if(i.commande.command)return 1}return i.weight2-e.weight2}var W8e=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},die=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},dM;function ty(i){return i.command!==void 0}function $8e(i){return i.submenu!==void 0}class ${constructor(e){if($._instances.has(e))throw new TypeError(`MenuId with identifier '${e}' already exists. Use MenuId.for(ident) or a unique identifier`);$._instances.set(e,this),this.id=e}}$._instances=new Map;$.CommandPalette=new $("CommandPalette");$.DebugBreakpointsContext=new $("DebugBreakpointsContext");$.DebugCallStackContext=new $("DebugCallStackContext");$.DebugConsoleContext=new $("DebugConsoleContext");$.DebugVariablesContext=new $("DebugVariablesContext");$.NotebookVariablesContext=new $("NotebookVariablesContext");$.DebugHoverContext=new $("DebugHoverContext");$.DebugWatchContext=new $("DebugWatchContext");$.DebugToolBar=new $("DebugToolBar");$.DebugToolBarStop=new $("DebugToolBarStop");$.EditorContext=new $("EditorContext");$.SimpleEditorContext=new $("SimpleEditorContext");$.EditorContent=new $("EditorContent");$.EditorLineNumberContext=new $("EditorLineNumberContext");$.EditorContextCopy=new $("EditorContextCopy");$.EditorContextPeek=new $("EditorContextPeek");$.EditorContextShare=new $("EditorContextShare");$.EditorTitle=new $("EditorTitle");$.EditorTitleRun=new $("EditorTitleRun");$.EditorTitleContext=new $("EditorTitleContext");$.EditorTitleContextShare=new $("EditorTitleContextShare");$.EmptyEditorGroup=new $("EmptyEditorGroup");$.EmptyEditorGroupContext=new $("EmptyEditorGroupContext");$.EditorTabsBarContext=new $("EditorTabsBarContext");$.EditorTabsBarShowTabsSubmenu=new $("EditorTabsBarShowTabsSubmenu");$.EditorTabsBarShowTabsZenModeSubmenu=new $("EditorTabsBarShowTabsZenModeSubmenu");$.EditorActionsPositionSubmenu=new $("EditorActionsPositionSubmenu");$.ExplorerContext=new $("ExplorerContext");$.ExplorerContextShare=new $("ExplorerContextShare");$.ExtensionContext=new $("ExtensionContext");$.GlobalActivity=new $("GlobalActivity");$.CommandCenter=new $("CommandCenter");$.CommandCenterCenter=new $("CommandCenterCenter");$.LayoutControlMenuSubmenu=new $("LayoutControlMenuSubmenu");$.LayoutControlMenu=new $("LayoutControlMenu");$.MenubarMainMenu=new $("MenubarMainMenu");$.MenubarAppearanceMenu=new $("MenubarAppearanceMenu");$.MenubarDebugMenu=new $("MenubarDebugMenu");$.MenubarEditMenu=new $("MenubarEditMenu");$.MenubarCopy=new $("MenubarCopy");$.MenubarFileMenu=new $("MenubarFileMenu");$.MenubarGoMenu=new $("MenubarGoMenu");$.MenubarHelpMenu=new $("MenubarHelpMenu");$.MenubarLayoutMenu=new $("MenubarLayoutMenu");$.MenubarNewBreakpointMenu=new $("MenubarNewBreakpointMenu");$.PanelAlignmentMenu=new $("PanelAlignmentMenu");$.PanelPositionMenu=new $("PanelPositionMenu");$.ActivityBarPositionMenu=new $("ActivityBarPositionMenu");$.MenubarPreferencesMenu=new $("MenubarPreferencesMenu");$.MenubarRecentMenu=new $("MenubarRecentMenu");$.MenubarSelectionMenu=new $("MenubarSelectionMenu");$.MenubarShare=new $("MenubarShare");$.MenubarSwitchEditorMenu=new $("MenubarSwitchEditorMenu");$.MenubarSwitchGroupMenu=new $("MenubarSwitchGroupMenu");$.MenubarTerminalMenu=new $("MenubarTerminalMenu");$.MenubarViewMenu=new $("MenubarViewMenu");$.MenubarHomeMenu=new $("MenubarHomeMenu");$.OpenEditorsContext=new $("OpenEditorsContext");$.OpenEditorsContextShare=new $("OpenEditorsContextShare");$.ProblemsPanelContext=new $("ProblemsPanelContext");$.SCMInputBox=new $("SCMInputBox");$.SCMChangesSeparator=new $("SCMChangesSeparator");$.SCMIncomingChanges=new $("SCMIncomingChanges");$.SCMIncomingChangesContext=new $("SCMIncomingChangesContext");$.SCMIncomingChangesSetting=new $("SCMIncomingChangesSetting");$.SCMOutgoingChanges=new $("SCMOutgoingChanges");$.SCMOutgoingChangesContext=new $("SCMOutgoingChangesContext");$.SCMOutgoingChangesSetting=new $("SCMOutgoingChangesSetting");$.SCMIncomingChangesAllChangesContext=new $("SCMIncomingChangesAllChangesContext");$.SCMIncomingChangesHistoryItemContext=new $("SCMIncomingChangesHistoryItemContext");$.SCMOutgoingChangesAllChangesContext=new $("SCMOutgoingChangesAllChangesContext");$.SCMOutgoingChangesHistoryItemContext=new $("SCMOutgoingChangesHistoryItemContext");$.SCMChangeContext=new $("SCMChangeContext");$.SCMResourceContext=new $("SCMResourceContext");$.SCMResourceContextShare=new $("SCMResourceContextShare");$.SCMResourceFolderContext=new $("SCMResourceFolderContext");$.SCMResourceGroupContext=new $("SCMResourceGroupContext");$.SCMSourceControl=new $("SCMSourceControl");$.SCMSourceControlInline=new $("SCMSourceControlInline");$.SCMSourceControlTitle=new $("SCMSourceControlTitle");$.SCMTitle=new $("SCMTitle");$.SearchContext=new $("SearchContext");$.SearchActionMenu=new $("SearchActionContext");$.StatusBarWindowIndicatorMenu=new $("StatusBarWindowIndicatorMenu");$.StatusBarRemoteIndicatorMenu=new $("StatusBarRemoteIndicatorMenu");$.StickyScrollContext=new $("StickyScrollContext");$.TestItem=new $("TestItem");$.TestItemGutter=new $("TestItemGutter");$.TestMessageContext=new $("TestMessageContext");$.TestMessageContent=new $("TestMessageContent");$.TestPeekElement=new $("TestPeekElement");$.TestPeekTitle=new $("TestPeekTitle");$.TouchBarContext=new $("TouchBarContext");$.TitleBarContext=new $("TitleBarContext");$.TitleBarTitleContext=new $("TitleBarTitleContext");$.TunnelContext=new $("TunnelContext");$.TunnelPrivacy=new $("TunnelPrivacy");$.TunnelProtocol=new $("TunnelProtocol");$.TunnelPortInline=new $("TunnelInline");$.TunnelTitle=new $("TunnelTitle");$.TunnelLocalAddressInline=new $("TunnelLocalAddressInline");$.TunnelOriginInline=new $("TunnelOriginInline");$.ViewItemContext=new $("ViewItemContext");$.ViewContainerTitle=new $("ViewContainerTitle");$.ViewContainerTitleContext=new $("ViewContainerTitleContext");$.ViewTitle=new $("ViewTitle");$.ViewTitleContext=new $("ViewTitleContext");$.CommentEditorActions=new $("CommentEditorActions");$.CommentThreadTitle=new $("CommentThreadTitle");$.CommentThreadActions=new $("CommentThreadActions");$.CommentThreadAdditionalActions=new $("CommentThreadAdditionalActions");$.CommentThreadTitleContext=new $("CommentThreadTitleContext");$.CommentThreadCommentContext=new $("CommentThreadCommentContext");$.CommentTitle=new $("CommentTitle");$.CommentActions=new $("CommentActions");$.InteractiveToolbar=new $("InteractiveToolbar");$.InteractiveCellTitle=new $("InteractiveCellTitle");$.InteractiveCellDelete=new $("InteractiveCellDelete");$.InteractiveCellExecute=new $("InteractiveCellExecute");$.InteractiveInputExecute=new $("InteractiveInputExecute");$.IssueReporter=new $("IssueReporter");$.NotebookToolbar=new $("NotebookToolbar");$.NotebookStickyScrollContext=new $("NotebookStickyScrollContext");$.NotebookCellTitle=new $("NotebookCellTitle");$.NotebookCellDelete=new $("NotebookCellDelete");$.NotebookCellInsert=new $("NotebookCellInsert");$.NotebookCellBetween=new $("NotebookCellBetween");$.NotebookCellListTop=new $("NotebookCellTop");$.NotebookCellExecute=new $("NotebookCellExecute");$.NotebookCellExecuteGoTo=new $("NotebookCellExecuteGoTo");$.NotebookCellExecutePrimary=new $("NotebookCellExecutePrimary");$.NotebookDiffCellInputTitle=new $("NotebookDiffCellInputTitle");$.NotebookDiffCellMetadataTitle=new $("NotebookDiffCellMetadataTitle");$.NotebookDiffCellOutputsTitle=new $("NotebookDiffCellOutputsTitle");$.NotebookOutputToolbar=new $("NotebookOutputToolbar");$.NotebookEditorLayoutConfigure=new $("NotebookEditorLayoutConfigure");$.NotebookKernelSource=new $("NotebookKernelSource");$.BulkEditTitle=new $("BulkEditTitle");$.BulkEditContext=new $("BulkEditContext");$.TimelineItemContext=new $("TimelineItemContext");$.TimelineTitle=new $("TimelineTitle");$.TimelineTitleContext=new $("TimelineTitleContext");$.TimelineFilterSubMenu=new $("TimelineFilterSubMenu");$.AccountsContext=new $("AccountsContext");$.SidebarTitle=new $("SidebarTitle");$.PanelTitle=new $("PanelTitle");$.AuxiliaryBarTitle=new $("AuxiliaryBarTitle");$.TerminalInstanceContext=new $("TerminalInstanceContext");$.TerminalEditorInstanceContext=new $("TerminalEditorInstanceContext");$.TerminalNewDropdownContext=new $("TerminalNewDropdownContext");$.TerminalTabContext=new $("TerminalTabContext");$.TerminalTabEmptyAreaContext=new $("TerminalTabEmptyAreaContext");$.TerminalStickyScrollContext=new $("TerminalStickyScrollContext");$.WebviewContext=new $("WebviewContext");$.InlineCompletionsActions=new $("InlineCompletionsActions");$.InlineEditActions=new $("InlineEditActions");$.NewFile=new $("NewFile");$.MergeInput1Toolbar=new $("MergeToolbar1Toolbar");$.MergeInput2Toolbar=new $("MergeToolbar2Toolbar");$.MergeBaseToolbar=new $("MergeBaseToolbar");$.MergeInputResultToolbar=new $("MergeToolbarResultToolbar");$.InlineSuggestionToolbar=new $("InlineSuggestionToolbar");$.InlineEditToolbar=new $("InlineEditToolbar");$.ChatContext=new $("ChatContext");$.ChatCodeBlock=new $("ChatCodeblock");$.ChatMessageTitle=new $("ChatMessageTitle");$.ChatExecute=new $("ChatExecute");$.ChatInputSide=new $("ChatInputSide");$.AccessibleView=new $("AccessibleView");$.MultiDiffEditorFileToolbar=new $("MultiDiffEditorFileToolbar");const hu=yn("menuService");class $g{static for(e){let t=this._all.get(e);return t||(t=new $g(e),this._all.set(e,t)),t}static merge(e){const t=new Set;for(const n of e)n instanceof $g&&t.add(n.id);return t}constructor(e){this.id=e,this.has=t=>t===e}}$g._all=new Map;const ts=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new i5e({merge:$g.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(i){return this._commands.set(i.id,i),this._onDidChangeMenu.fire($g.for($.CommandPalette)),Rt(()=>{this._commands.delete(i.id)&&this._onDidChangeMenu.fire($g.for($.CommandPalette))})}getCommand(i){return this._commands.get(i)}getCommands(){const i=new Map;return this._commands.forEach((e,t)=>i.set(t,e)),i}appendMenuItem(i,e){let t=this._menuItems.get(i);t||(t=new _a,this._menuItems.set(i,t));const n=t.push(e);return this._onDidChangeMenu.fire($g.for(i)),Rt(()=>{n(),this._onDidChangeMenu.fire($g.for(i))})}appendMenuItems(i){const e=new Te;for(const{id:t,item:n}of i)e.add(this.appendMenuItem(t,n));return e}getMenuItems(i){let e;return this._menuItems.has(i)?e=[...this._menuItems.get(i)]:e=[],i===$.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(i){const e=new Set;for(const t of i)ty(t)&&(e.add(t.command.id),t.alt&&e.add(t.alt.id));this._commands.forEach((t,n)=>{e.has(n)||i.push({command:t})})}};class TD extends Lw{constructor(e,t,n){super(`submenuitem.${e.submenu.id}`,typeof e.title=="string"?e.title:e.title.value,n,"submenu"),this.item=e,this.hideActions=t}}let pc=dM=class{static label(e,t){return t!=null&&t.renderShortTitle&&e.shortTitle?typeof e.shortTitle=="string"?e.shortTitle:e.shortTitle.value:typeof e.title=="string"?e.title:e.title.value}constructor(e,t,n,r,o,s){var a,l;this.hideActions=r,this._commandService=s,this.id=e.id,this.label=dM.label(e,n),this.tooltip=(l=typeof e.tooltip=="string"?e.tooltip:(a=e.tooltip)===null||a===void 0?void 0:a.value)!==null&&l!==void 0?l:"",this.enabled=!e.precondition||o.contextMatchesRules(e.precondition),this.checked=void 0;let c;if(e.toggled){const u=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=o.contextMatchesRules(u.condition),this.checked&&u.tooltip&&(this.tooltip=typeof u.tooltip=="string"?u.tooltip:u.tooltip.value),this.checked&&Wt.isThemeIcon(u.icon)&&(c=u.icon),this.checked&&u.title&&(this.label=typeof u.title=="string"?u.title:u.title.value)}c||(c=Wt.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new dM(t,void 0,n,r,o,s):void 0,this._options=n,this.class=c&&Wt.asClassName(c)}run(...e){var t,n;let r=[];return!((t=this._options)===null||t===void 0)&&t.arg&&(r=[...r,this._options.arg]),!((n=this._options)===null||n===void 0)&&n.shouldForwardArgs&&(r=[...r,...e]),this._commandService.executeCommand(this.id,...r)}};pc=dM=W8e([die(4,Vt),die(5,sr)],pc);class sl{constructor(e){this.desc=e}}function Ei(i){const e=new Te,t=new i,{f1:n,menu:r,keybinding:o,...s}=t.desc;if(Dn.getCommand(s.id))throw new Error(`Cannot register two commands with the same id: ${s.id}`);if(e.add(Dn.registerCommand({id:s.id,handler:(a,...l)=>t.run(a,...l),metadata:s.metadata})),Array.isArray(r))for(const a of r)e.add(ts.appendMenuItem(a.id,{command:{...s,precondition:a.precondition===null?void 0:s.precondition},...a}));else r&&e.add(ts.appendMenuItem(r.id,{command:{...s,precondition:r.precondition===null?void 0:s.precondition},...r}));if(n&&(e.add(ts.appendMenuItem($.CommandPalette,{command:s,when:s.precondition})),e.add(ts.addCommand(s))),Array.isArray(o))for(const a of o)e.add(nl.registerKeybindingRule({...a,id:s.id,when:s.precondition?De.and(s.precondition,a.when):a.when}));else o&&e.add(nl.registerKeybindingRule({...o,id:s.id,when:s.precondition?De.and(s.precondition,o.when):o.when}));return e}const ea=yn("telemetryService"),Ta=yn("logService");var cs;(function(i){i[i.Off=0]="Off",i[i.Trace=1]="Trace",i[i.Debug=2]="Debug",i[i.Info=3]="Info",i[i.Warning=4]="Warning",i[i.Error=5]="Error"})(cs||(cs={}));const mme=cs.Info;class vme extends fe{constructor(){super(...arguments),this.level=mme,this._onDidChangeLogLevel=this._register(new se),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(e){return this.level!==cs.Off&&this.level<=e}}class H8e extends vme{constructor(e=mme,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(cs.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(cs.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(cs.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(cs.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(cs.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...t):console.error(e,...t))}}class V8e extends vme{constructor(e){super(),this.loggers=e,e.length&&this.setLevel(e[0].getLevel())}setLevel(e){for(const t of this.loggers)t.setLevel(e);super.setLevel(e)}trace(e,...t){for(const n of this.loggers)n.trace(e,...t)}debug(e,...t){for(const n of this.loggers)n.debug(e,...t)}info(e,...t){for(const n of this.loggers)n.info(e,...t)}warn(e,...t){for(const n of this.loggers)n.warn(e,...t)}error(e,...t){for(const n of this.loggers)n.error(e,...t)}dispose(){for(const e of this.loggers)e.dispose();super.dispose()}}function z8e(i){switch(i){case cs.Trace:return"trace";case cs.Debug:return"debug";case cs.Info:return"info";case cs.Warning:return"warn";case cs.Error:return"error";case cs.Off:return"off"}}new st("logLevel",z8e(cs.Info));class S4{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this.metadata=e.metadata}register(){if(Array.isArray(this._menuOpts)?this._menuOpts.forEach(this._registerMenuItem,this):this._menuOpts&&this._registerMenuItem(this._menuOpts),this._kbOpts){const e=Array.isArray(this._kbOpts)?this._kbOpts:[this._kbOpts];for(const t of e){let n=t.kbExpr;this.precondition&&(n?n=De.and(n,this.precondition):n=this.precondition);const r={id:this.id,weight:t.weight,args:t.args,when:n,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};nl.registerKeybindingRule(r)}}Dn.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),metadata:this.metadata})}_registerMenuItem(e){ts.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 ES extends S4{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,n,r){return this._implementations.push({priority:e,name:t,implementation:n,when:r}),this._implementations.sort((o,s)=>s.priority-o.priority),{dispose:()=>{for(let o=0;o{if(a.get(Vt).contextMatchesRules(n??void 0))return r(a,s,t)})}runCommand(e,t){return Vo.runEditorCommand(e,t,this.precondition,(n,r,o)=>this.runEditorCommand(n,r,o))}}class gt extends Vo{static convertOptions(e){let t;Array.isArray(e.menuOpts)?t=e.menuOpts:e.menuOpts?t=[e.menuOpts]:t=[];function n(r){return r.menuId||(r.menuId=$.EditorContext),r.title||(r.title=e.label),r.when=De.and(e.precondition,r.when),r}return Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(n)):e.contextMenuOpts&&t.push(n(e.contextMenuOpts)),e.menuOpts=t,e}constructor(e){super(gt.convertOptions(e)),this.label=e.label,this.alias=e.alias}runEditorCommand(e,t,n){return this.reportTelemetry(e,t),this.run(e,t,n||{})}reportTelemetry(e,t){e.get(ea).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class bme extends gt{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort((n,r)=>r[0]-n[0]),{dispose:()=>{for(let n=0;n{var s,a;const l=o.get(Vt),c=o.get(Ta);if(!l.contextMatchesRules((s=this.desc.precondition)!==null&&s!==void 0?s:void 0)){c.debug("[EditorAction2] NOT running command because its precondition is FALSE",this.desc.id,(a=this.desc.precondition)===null||a===void 0?void 0:a.serialize());return}return this.runEditorCommand(o,r,...t)})}}function tg(i,e){Dn.registerCommand(i,function(t,...n){const r=t.get(Ot),[o,s]=n;Xn(At.isUri(o)),Xn(ae.isIPosition(s));const a=t.get(tr).getModel(o);if(a){const l=ae.lift(s);return r.invokeFunction(e,a,l,...n.slice(2))}return t.get(ol).createModelReference(o).then(l=>new Promise((c,u)=>{try{const d=r.invokeFunction(e,l.object.textEditorModel,ae.lift(s),n.slice(2));c(d)}catch(d){u(d)}}).finally(()=>{l.dispose()}))})}function et(i){return Uc.INSTANCE.registerEditorCommand(i),i}function Be(i){const e=new i;return Uc.INSTANCE.registerEditorAction(e),e}function Cme(i){return Uc.INSTANCE.registerEditorAction(i),i}function U8e(i){Uc.INSTANCE.registerEditorAction(i)}function jn(i,e,t){Uc.INSTANCE.registerEditorContribution(i,e,t)}var Ay;(function(i){function e(s){return Uc.INSTANCE.getEditorCommand(s)}i.getEditorCommand=e;function t(){return Uc.INSTANCE.getEditorActions()}i.getEditorActions=t;function n(){return Uc.INSTANCE.getEditorContributions()}i.getEditorContributions=n;function r(s){return Uc.INSTANCE.getEditorContributions().filter(a=>s.indexOf(a.id)>=0)}i.getSomeEditorContributions=r;function o(){return Uc.INSTANCE.getDiffEditorContributions()}i.getDiffEditorContributions=o})(Ay||(Ay={}));const j8e={EditorCommonContributions:"editor.contributions"};class Uc{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t,n){this.editorContributions.push({id:e,ctor:t,instantiation:n})}getEditorContributions(){return this.editorContributions.slice(0)}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}}Uc.INSTANCE=new Uc;ar.add(j8e.EditorCommonContributions,Uc.INSTANCE);function Ak(i){return i.register(),i}const yme=Ak(new ES({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:$.MenubarEditMenu,group:"1_do",title:w({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1},{menuId:$.CommandPalette,group:"",title:w("undo","Undo"),order:1}]}));Ak(new _me(yme,{id:"default:undo",precondition:void 0}));const wme=Ak(new ES({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:$.MenubarEditMenu,group:"1_do",title:w({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2},{menuId:$.CommandPalette,group:"",title:w("redo","Redo"),order:1}]}));Ak(new _me(wme,{id:"default:redo",precondition:void 0}));const K8e=Ak(new ES({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:$.MenubarSelectionMenu,group:"1_basic",title:w({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1},{menuId:$.CommandPalette,group:"",title:w("selectAll","Select All"),order:1}]})),G8e="$initialize";let hie=!1;function fH(i){x_&&(hie||(hie=!0,console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq")),console.warn(i.message))}class q8e{constructor(e,t,n,r){this.vsWorker=e,this.req=t,this.method=n,this.args=r,this.type=0}}class fie{constructor(e,t,n,r){this.vsWorker=e,this.seq=t,this.res=n,this.err=r,this.type=1}}class X8e{constructor(e,t,n,r){this.vsWorker=e,this.req=t,this.eventName=n,this.arg=r,this.type=2}}class Y8e{constructor(e,t,n){this.vsWorker=e,this.req=t,this.event=n,this.type=3}}class Z8e{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class Q8e{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null),this._pendingEmitters=new Map,this._pendingEvents=new Map}setWorkerId(e){this._workerId=e}sendMessage(e,t){const n=String(++this._lastSentReq);return new Promise((r,o)=>{this._pendingReplies[n]={resolve:r,reject:o},this._send(new q8e(this._workerId,n,e,t))})}listen(e,t){let n=null;const r=new se({onWillAddFirstListener:()=>{n=String(++this._lastSentReq),this._pendingEmitters.set(n,r),this._send(new X8e(this._workerId,n,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(n),this._send(new Z8e(this._workerId,n)),n=null}});return r.event}handleMessage(e){!e||!e.vsWorker||this._workerId!==-1&&e.vsWorker!==this._workerId||this._handleMessage(e)}_handleMessage(e){switch(e.type){case 1:return this._handleReplyMessage(e);case 0:return this._handleRequestMessage(e);case 2:return this._handleSubscribeEventMessage(e);case 3:return this._handleEventMessage(e);case 4:return this._handleUnsubscribeEventMessage(e)}}_handleReplyMessage(e){if(!this._pendingReplies[e.seq]){console.warn("Got reply to unknown seq");return}const t=this._pendingReplies[e.seq];if(delete this._pendingReplies[e.seq],e.err){let n=e.err;e.err.$isError&&(n=new Error,n.name=e.err.name,n.message=e.err.message,n.stack=e.err.stack),t.reject(n);return}t.resolve(e.res)}_handleRequestMessage(e){const t=e.req;this._handler.handleMessage(e.method,e.args).then(r=>{this._send(new fie(this._workerId,t,r,void 0))},r=>{r.detail instanceof Error&&(r.detail=Bne(r.detail)),this._send(new fie(this._workerId,t,void 0,Bne(r)))})}_handleSubscribeEventMessage(e){const t=e.req,n=this._handler.handleEvent(e.eventName,e.arg)(r=>{this._send(new Y8e(this._workerId,t,r))});this._pendingEvents.set(t,n)}_handleEventMessage(e){if(!this._pendingEmitters.has(e.req)){console.warn("Got event for unknown req");return}this._pendingEmitters.get(e.req).fire(e.event)}_handleUnsubscribeEventMessage(e){if(!this._pendingEvents.has(e.req)){console.warn("Got unsubscribe for unknown req");return}this._pendingEvents.get(e.req).dispose(),this._pendingEvents.delete(e.req)}_send(e){const t=[];if(e.type===0)for(let n=0;n{this._protocol.handleMessage(u)},u=>{r==null||r(u)})),this._protocol=new Q8e({sendMessage:(u,d)=>{this._worker.postMessage(u,d)},handleMessage:(u,d)=>{if(typeof n[u]!="function")return Promise.reject(new Error("Missing method "+u+" on main thread host."));try{return Promise.resolve(n[u].apply(n,d))}catch(h){return Promise.reject(h)}},handleEvent:(u,d)=>{if(xme(u)){const h=n[u].call(n,d);if(typeof h!="function")throw new Error(`Missing dynamic event ${u} on main thread host.`);return h}if(Sme(u)){const h=n[u];if(typeof h!="function")throw new Error(`Missing event ${u} on main thread host.`);return h}throw new Error(`Malformed event name ${u}`)}}),this._protocol.setWorkerId(this._worker.getId());let o=null;const s=globalThis.require;typeof s<"u"&&typeof s.getConfig=="function"?o=s.getConfig():typeof globalThis.requirejs<"u"&&(o=globalThis.requirejs.s.contexts._.config);const a=tq(n);this._onModuleLoaded=this._protocol.sendMessage(G8e,[this._worker.getId(),JSON.parse(JSON.stringify(o)),t,a]);const l=(u,d)=>this._request(u,d),c=(u,d)=>this._protocol.listen(u,d);this._lazyProxy=new Promise((u,d)=>{r=d,this._onModuleLoaded.then(h=>{u(e6e(h,l,c))},h=>{d(h),this._onError("Worker failed to load "+t,h)})})}getProxyObject(){return this._lazyProxy}_request(e,t){return new Promise((n,r)=>{this._onModuleLoaded.then(()=>{this._protocol.sendMessage(e,t).then(n,r)},r)})}_onError(e,t){console.error(e),console.info(t)}}function Sme(i){return i[0]==="o"&&i[1]==="n"&&nf(i.charCodeAt(2))}function xme(i){return/^onDynamic/.test(i)&&nf(i.charCodeAt(9))}function e6e(i,e,t){const n=s=>function(){const a=Array.prototype.slice.call(arguments,0);return e(s,a)},r=s=>function(a){return t(s,a)},o={};for(const s of i){if(xme(s)){o[s]=r(s);continue}if(Sme(s)){o[s]=t(s,void 0);continue}o[s]=n(s)}return o}function Hp(i,e){var t;const n=globalThis.MonacoEnvironment;if(n!=null&&n.createTrustedTypesPolicy)try{return n.createTrustedTypesPolicy(i,e)}catch(r){en(r);return}try{return(t=hi.trustedTypes)===null||t===void 0?void 0:t.createPolicy(i,e)}catch(r){en(r);return}}const gie=Hp("defaultWorkerFactory",{createScriptURL:i=>i});function t6e(i){const e=globalThis.MonacoEnvironment;if(e){if(typeof e.getWorker=="function")return e.getWorker("workerMain.js",i);if(typeof e.getWorkerUrl=="function"){const t=e.getWorkerUrl("workerMain.js",i);return new Worker(gie?gie.createScriptURL(t):t,{name:i})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function n6e(i){return typeof i.then=="function"}class i6e extends fe{constructor(e,t,n,r,o){super(),this.id=t,this.label=n;const s=t6e(n);n6e(s)?this.worker=s:this.worker=Promise.resolve(s),this.postMessage(e,[]),this.worker.then(a=>{a.onmessage=function(l){r(l.data)},a.onmessageerror=o,typeof a.addEventListener=="function"&&a.addEventListener("error",o)}),this._register(Rt(()=>{var a;(a=this.worker)===null||a===void 0||a.then(l=>{l.onmessage=null,l.onmessageerror=null,l.removeEventListener("error",o),l.terminate()}),this.worker=null}))}getId(){return this.id}postMessage(e,t){var n;(n=this.worker)===null||n===void 0||n.then(r=>{try{r.postMessage(e,t)}catch(o){en(o),en(new Error(`FAILED to post message to '${this.label}'-worker`,{cause:o}))}})}}class x4{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,n){const r=++x4.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new i6e(e,r,this._label||"anonymous"+r,t,o=>{fH(o),this._webWorkerFailedBeforeError=o,n(o)})}}x4.LAST_WORKER_ID=0;var qr;(function(i){i[i.None=0]="None",i[i.Indent=1]="Indent",i[i.IndentOutdent=2]="IndentOutdent",i[i.Outdent=3]="Outdent"})(qr||(qr={}));class g6{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,n=e.notIn.length;t0&&i.getLanguageId(s-1)===r;)s--;return new o6e(i,r,s,o+1,i.getStartOffset(s),i.getEndOffset(o))}class o6e{constructor(e,t,n,r,o,s){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=n,this._lastTokenIndex=r,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 Kh(i){return(i&3)!==0}class Dw{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(t=>new g6(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new g6({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new g6({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:Dw.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:Dw.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS,this._surroundingPairs=e.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(e){return e?this._autoCloseBeforeForQuotes:this._autoCloseBeforeForBrackets}getSurroundingPairs(){return this._surroundingPairs}}Dw.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])> +Received: '{1}'.`,e,y0.getLexeme(t)),o=t.offset,s=y0.getLexeme(t);return this._parsingErrors.push({message:r,offset:o,lexeme:s,additionalInfo:n}),wL._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}};hme._parseError=new Error;class De{static false(){return Ia.INSTANCE}static true(){return tl.INSTANCE}static has(e){return cC.create(e)}static equals(e,t){return LS.create(e,t)}static notEquals(e,t){return m4.create(e,t)}static regex(e,t){return kD.create(e,t)}static in(e,t){return g4.create(e,t)}static notIn(e,t){return p4.create(e,t)}static not(e){return uC.create(e)}static and(...e){return F0.create(e,null,!0)}static or(...e){return Wg.create(e,null,!0)}static deserialize(e){return e==null?void 0:this._parser.parse(e)}}De._parser=new hme({regexParsingWithErrorRecovery:!1});function P8e(i,e){const t=i?i.substituteConstants():void 0,n=e?e.substituteConstants():void 0;return!t&&!n?!0:!t||!n?!1:t.equals(n)}function cE(i,e){return i.cmp(e)}class Ia{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 tl.INSTANCE}}Ia.INSTANCE=new Ia;class tl{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 Ia.INSTANCE}}tl.INSTANCE=new tl;class cC{static create(e,t=null){const n=As.get(e);return typeof n=="boolean"?n?tl.INSTANCE:Ia.INSTANCE:new cC(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=2}cmp(e){return e.type!==this.type?this.type-e.type:gme(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=As.get(this.key);return typeof e=="boolean"?e?tl.INSTANCE:Ia.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=uC.create(this.key,this)),this.negated}}class LS{static create(e,t,n=null){if(typeof t=="boolean")return t?cC.create(e,n):uC.create(e,n);const r=As.get(e);return typeof r=="boolean"?t===(r?"true":"false")?tl.INSTANCE:Ia.INSTANCE:new LS(e,t,n)}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:dC(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=As.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?tl.INSTANCE:Ia.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=m4.create(this.key,this.value,this)),this.negated}}class g4{static create(e,t){return new g4(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}cmp(e){return e.type!==this.type?this.type-e.type:dC(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type?this.key===e.key&&this.valueKey===e.valueKey:!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.valueKey),n=e.getValue(this.key);return Array.isArray(t)?t.includes(n):typeof n=="string"&&typeof t=="object"&&t!==null?E8e.call(t,n):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=p4.create(this.key,this.valueKey)),this.negated}}class p4{static create(e,t){return new p4(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=g4.create(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:this._negated.cmp(e._negated)}equals(e){return e.type===this.type?this._negated.equals(e._negated):!1}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}negate(){return this._negated}}class m4{static create(e,t,n=null){if(typeof t=="boolean")return t?uC.create(e,n):cC.create(e,n);const r=As.get(e);return typeof r=="boolean"?t===(r?"true":"false")?Ia.INSTANCE:tl.INSTANCE:new m4(e,t,n)}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=5}cmp(e){return e.type!==this.type?this.type-e.type:dC(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=As.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?Ia.INSTANCE:tl.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=LS.create(this.key,this.value,this)),this.negated}}class uC{static create(e,t=null){const n=As.get(e);return typeof n=="boolean"?n?Ia.INSTANCE:tl.INSTANCE:new uC(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=3}cmp(e){return e.type!==this.type?this.type-e.type:gme(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=As.get(this.key);return typeof e=="boolean"?e?Ia.INSTANCE:tl.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=cC.create(this.key,this)),this.negated}}function v4(i,e){if(typeof i=="string"){const t=parseFloat(i);isNaN(t)||(i=t)}return typeof i=="string"||typeof i=="number"?e(i):Ia.INSTANCE}class _4{static create(e,t,n=null){return v4(t,r=>new _4(e,r,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=12}cmp(e){return e.type!==this.type?this.type-e.type:dC(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=y4.create(this.key,this.value,this)),this.negated}}class b4{static create(e,t,n=null){return v4(t,r=>new b4(e,r,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=13}cmp(e){return e.type!==this.type?this.type-e.type:dC(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=C4.create(this.key,this.value,this)),this.negated}}class C4{static create(e,t,n=null){return v4(t,r=>new C4(e,r,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=14}cmp(e){return e.type!==this.type?this.type-e.type:dC(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))new y4(e,r,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=15}cmp(e){return e.type!==this.type?this.type-e.type:dC(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=_4.create(this.key,this.value,this)),this.negated}}class kD{static create(e,t){return new kD(e,t)}constructor(e,t){this.key=e,this.regexp=t,this.type=7,this.negated=null}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.keye.key)return 1;const t=this.regexp?this.regexp.source:"",n=e.regexp?e.regexp.source:"";return tn?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",n=e.regexp?e.regexp.source:"";return this.key===e.key&&t===n}return!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.key);return this.regexp?this.regexp.test(t):!1}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Rq.create(this)),this.negated}}class Rq{static create(e){return new Rq(e)}constructor(e){this._actual=e,this.type=8}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type?this._actual.equals(e._actual):!1}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}negate(){return this._actual}}function fme(i){let e=null;for(let t=0,n=i.length;te.expr.length)return 1;for(let t=0,n=this.expr.length;t1;){const s=r[r.length-1];if(s.type!==9)break;r.pop();const a=r.pop(),l=r.length===0,c=Wg.create(s.expr.map(u=>F0.create([u,a],null,n)),null,l);c&&(r.push(c),r.sort(cE))}if(r.length===1)return r[0];if(n){for(let s=0;se.serialize()).join(" && ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());this.negated=Wg.create(e,this,!0)}return this.negated}}class Wg{static create(e,t,n){return Wg._normalizeArr(e,t,n)}constructor(e,t){this.expr=e,this.negated=t,this.type=9}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.lengthe.expr.length)return 1;for(let t=0,n=this.expr.length;te.serialize()).join(" || ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());for(;e.length>1;){const t=e.shift(),n=e.shift(),r=[];for(const o of cie(t))for(const s of cie(n))r.push(F0.create([o,s],null,!1));e.unshift(Wg.create(r,null,!1))}this.negated=Wg.create(e,this,!0)}return this.negated}}class st extends cC{static all(){return st._info.values()}constructor(e,t,n){super(e,null),this._defaultValue=t,typeof n=="object"?st._info.push({...n,key:e}):n!==!0&&st._info.push({key:e,description:n,type:t!=null?typeof t:void 0})}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return LS.create(this.key,e)}}st._info=[];const Vt=yn("contextKeyService");function gme(i,e){return ie?1:0}function dC(i,e,t,n){return it?1:en?1:0}function hH(i,e){if(i.type===0||e.type===1)return!0;if(i.type===9)return e.type===9?lie(i.expr,e.expr):!1;if(e.type===9){for(const t of e.expr)if(hH(i,t))return!0;return!1}if(i.type===6){if(e.type===6)return lie(e.expr,i.expr);for(const t of i.expr)if(hH(t,e))return!0;return!1}return i.equals(e)}function lie(i,e){let t=0,n=0;for(;t{a(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(B8e)),this._cachedMergedKeybindings.slice(0)}}const nl=new Mq,F8e={EditorModes:"platform.keybindingsRegistry"};ar.add(F8e.EditorModes,nl);function B8e(i,e){if(i.weight1!==e.weight1)return i.weight1-e.weight1;if(i.command&&e.command){if(i.commande.command)return 1}return i.weight2-e.weight2}var W8e=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},die=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},dM;function ty(i){return i.command!==void 0}function $8e(i){return i.submenu!==void 0}class ${constructor(e){if($._instances.has(e))throw new TypeError(`MenuId with identifier '${e}' already exists. Use MenuId.for(ident) or a unique identifier`);$._instances.set(e,this),this.id=e}}$._instances=new Map;$.CommandPalette=new $("CommandPalette");$.DebugBreakpointsContext=new $("DebugBreakpointsContext");$.DebugCallStackContext=new $("DebugCallStackContext");$.DebugConsoleContext=new $("DebugConsoleContext");$.DebugVariablesContext=new $("DebugVariablesContext");$.NotebookVariablesContext=new $("NotebookVariablesContext");$.DebugHoverContext=new $("DebugHoverContext");$.DebugWatchContext=new $("DebugWatchContext");$.DebugToolBar=new $("DebugToolBar");$.DebugToolBarStop=new $("DebugToolBarStop");$.EditorContext=new $("EditorContext");$.SimpleEditorContext=new $("SimpleEditorContext");$.EditorContent=new $("EditorContent");$.EditorLineNumberContext=new $("EditorLineNumberContext");$.EditorContextCopy=new $("EditorContextCopy");$.EditorContextPeek=new $("EditorContextPeek");$.EditorContextShare=new $("EditorContextShare");$.EditorTitle=new $("EditorTitle");$.EditorTitleRun=new $("EditorTitleRun");$.EditorTitleContext=new $("EditorTitleContext");$.EditorTitleContextShare=new $("EditorTitleContextShare");$.EmptyEditorGroup=new $("EmptyEditorGroup");$.EmptyEditorGroupContext=new $("EmptyEditorGroupContext");$.EditorTabsBarContext=new $("EditorTabsBarContext");$.EditorTabsBarShowTabsSubmenu=new $("EditorTabsBarShowTabsSubmenu");$.EditorTabsBarShowTabsZenModeSubmenu=new $("EditorTabsBarShowTabsZenModeSubmenu");$.EditorActionsPositionSubmenu=new $("EditorActionsPositionSubmenu");$.ExplorerContext=new $("ExplorerContext");$.ExplorerContextShare=new $("ExplorerContextShare");$.ExtensionContext=new $("ExtensionContext");$.GlobalActivity=new $("GlobalActivity");$.CommandCenter=new $("CommandCenter");$.CommandCenterCenter=new $("CommandCenterCenter");$.LayoutControlMenuSubmenu=new $("LayoutControlMenuSubmenu");$.LayoutControlMenu=new $("LayoutControlMenu");$.MenubarMainMenu=new $("MenubarMainMenu");$.MenubarAppearanceMenu=new $("MenubarAppearanceMenu");$.MenubarDebugMenu=new $("MenubarDebugMenu");$.MenubarEditMenu=new $("MenubarEditMenu");$.MenubarCopy=new $("MenubarCopy");$.MenubarFileMenu=new $("MenubarFileMenu");$.MenubarGoMenu=new $("MenubarGoMenu");$.MenubarHelpMenu=new $("MenubarHelpMenu");$.MenubarLayoutMenu=new $("MenubarLayoutMenu");$.MenubarNewBreakpointMenu=new $("MenubarNewBreakpointMenu");$.PanelAlignmentMenu=new $("PanelAlignmentMenu");$.PanelPositionMenu=new $("PanelPositionMenu");$.ActivityBarPositionMenu=new $("ActivityBarPositionMenu");$.MenubarPreferencesMenu=new $("MenubarPreferencesMenu");$.MenubarRecentMenu=new $("MenubarRecentMenu");$.MenubarSelectionMenu=new $("MenubarSelectionMenu");$.MenubarShare=new $("MenubarShare");$.MenubarSwitchEditorMenu=new $("MenubarSwitchEditorMenu");$.MenubarSwitchGroupMenu=new $("MenubarSwitchGroupMenu");$.MenubarTerminalMenu=new $("MenubarTerminalMenu");$.MenubarViewMenu=new $("MenubarViewMenu");$.MenubarHomeMenu=new $("MenubarHomeMenu");$.OpenEditorsContext=new $("OpenEditorsContext");$.OpenEditorsContextShare=new $("OpenEditorsContextShare");$.ProblemsPanelContext=new $("ProblemsPanelContext");$.SCMInputBox=new $("SCMInputBox");$.SCMChangesSeparator=new $("SCMChangesSeparator");$.SCMIncomingChanges=new $("SCMIncomingChanges");$.SCMIncomingChangesContext=new $("SCMIncomingChangesContext");$.SCMIncomingChangesSetting=new $("SCMIncomingChangesSetting");$.SCMOutgoingChanges=new $("SCMOutgoingChanges");$.SCMOutgoingChangesContext=new $("SCMOutgoingChangesContext");$.SCMOutgoingChangesSetting=new $("SCMOutgoingChangesSetting");$.SCMIncomingChangesAllChangesContext=new $("SCMIncomingChangesAllChangesContext");$.SCMIncomingChangesHistoryItemContext=new $("SCMIncomingChangesHistoryItemContext");$.SCMOutgoingChangesAllChangesContext=new $("SCMOutgoingChangesAllChangesContext");$.SCMOutgoingChangesHistoryItemContext=new $("SCMOutgoingChangesHistoryItemContext");$.SCMChangeContext=new $("SCMChangeContext");$.SCMResourceContext=new $("SCMResourceContext");$.SCMResourceContextShare=new $("SCMResourceContextShare");$.SCMResourceFolderContext=new $("SCMResourceFolderContext");$.SCMResourceGroupContext=new $("SCMResourceGroupContext");$.SCMSourceControl=new $("SCMSourceControl");$.SCMSourceControlInline=new $("SCMSourceControlInline");$.SCMSourceControlTitle=new $("SCMSourceControlTitle");$.SCMTitle=new $("SCMTitle");$.SearchContext=new $("SearchContext");$.SearchActionMenu=new $("SearchActionContext");$.StatusBarWindowIndicatorMenu=new $("StatusBarWindowIndicatorMenu");$.StatusBarRemoteIndicatorMenu=new $("StatusBarRemoteIndicatorMenu");$.StickyScrollContext=new $("StickyScrollContext");$.TestItem=new $("TestItem");$.TestItemGutter=new $("TestItemGutter");$.TestMessageContext=new $("TestMessageContext");$.TestMessageContent=new $("TestMessageContent");$.TestPeekElement=new $("TestPeekElement");$.TestPeekTitle=new $("TestPeekTitle");$.TouchBarContext=new $("TouchBarContext");$.TitleBarContext=new $("TitleBarContext");$.TitleBarTitleContext=new $("TitleBarTitleContext");$.TunnelContext=new $("TunnelContext");$.TunnelPrivacy=new $("TunnelPrivacy");$.TunnelProtocol=new $("TunnelProtocol");$.TunnelPortInline=new $("TunnelInline");$.TunnelTitle=new $("TunnelTitle");$.TunnelLocalAddressInline=new $("TunnelLocalAddressInline");$.TunnelOriginInline=new $("TunnelOriginInline");$.ViewItemContext=new $("ViewItemContext");$.ViewContainerTitle=new $("ViewContainerTitle");$.ViewContainerTitleContext=new $("ViewContainerTitleContext");$.ViewTitle=new $("ViewTitle");$.ViewTitleContext=new $("ViewTitleContext");$.CommentEditorActions=new $("CommentEditorActions");$.CommentThreadTitle=new $("CommentThreadTitle");$.CommentThreadActions=new $("CommentThreadActions");$.CommentThreadAdditionalActions=new $("CommentThreadAdditionalActions");$.CommentThreadTitleContext=new $("CommentThreadTitleContext");$.CommentThreadCommentContext=new $("CommentThreadCommentContext");$.CommentTitle=new $("CommentTitle");$.CommentActions=new $("CommentActions");$.InteractiveToolbar=new $("InteractiveToolbar");$.InteractiveCellTitle=new $("InteractiveCellTitle");$.InteractiveCellDelete=new $("InteractiveCellDelete");$.InteractiveCellExecute=new $("InteractiveCellExecute");$.InteractiveInputExecute=new $("InteractiveInputExecute");$.IssueReporter=new $("IssueReporter");$.NotebookToolbar=new $("NotebookToolbar");$.NotebookStickyScrollContext=new $("NotebookStickyScrollContext");$.NotebookCellTitle=new $("NotebookCellTitle");$.NotebookCellDelete=new $("NotebookCellDelete");$.NotebookCellInsert=new $("NotebookCellInsert");$.NotebookCellBetween=new $("NotebookCellBetween");$.NotebookCellListTop=new $("NotebookCellTop");$.NotebookCellExecute=new $("NotebookCellExecute");$.NotebookCellExecuteGoTo=new $("NotebookCellExecuteGoTo");$.NotebookCellExecutePrimary=new $("NotebookCellExecutePrimary");$.NotebookDiffCellInputTitle=new $("NotebookDiffCellInputTitle");$.NotebookDiffCellMetadataTitle=new $("NotebookDiffCellMetadataTitle");$.NotebookDiffCellOutputsTitle=new $("NotebookDiffCellOutputsTitle");$.NotebookOutputToolbar=new $("NotebookOutputToolbar");$.NotebookEditorLayoutConfigure=new $("NotebookEditorLayoutConfigure");$.NotebookKernelSource=new $("NotebookKernelSource");$.BulkEditTitle=new $("BulkEditTitle");$.BulkEditContext=new $("BulkEditContext");$.TimelineItemContext=new $("TimelineItemContext");$.TimelineTitle=new $("TimelineTitle");$.TimelineTitleContext=new $("TimelineTitleContext");$.TimelineFilterSubMenu=new $("TimelineFilterSubMenu");$.AccountsContext=new $("AccountsContext");$.SidebarTitle=new $("SidebarTitle");$.PanelTitle=new $("PanelTitle");$.AuxiliaryBarTitle=new $("AuxiliaryBarTitle");$.TerminalInstanceContext=new $("TerminalInstanceContext");$.TerminalEditorInstanceContext=new $("TerminalEditorInstanceContext");$.TerminalNewDropdownContext=new $("TerminalNewDropdownContext");$.TerminalTabContext=new $("TerminalTabContext");$.TerminalTabEmptyAreaContext=new $("TerminalTabEmptyAreaContext");$.TerminalStickyScrollContext=new $("TerminalStickyScrollContext");$.WebviewContext=new $("WebviewContext");$.InlineCompletionsActions=new $("InlineCompletionsActions");$.InlineEditActions=new $("InlineEditActions");$.NewFile=new $("NewFile");$.MergeInput1Toolbar=new $("MergeToolbar1Toolbar");$.MergeInput2Toolbar=new $("MergeToolbar2Toolbar");$.MergeBaseToolbar=new $("MergeBaseToolbar");$.MergeInputResultToolbar=new $("MergeToolbarResultToolbar");$.InlineSuggestionToolbar=new $("InlineSuggestionToolbar");$.InlineEditToolbar=new $("InlineEditToolbar");$.ChatContext=new $("ChatContext");$.ChatCodeBlock=new $("ChatCodeblock");$.ChatMessageTitle=new $("ChatMessageTitle");$.ChatExecute=new $("ChatExecute");$.ChatInputSide=new $("ChatInputSide");$.AccessibleView=new $("AccessibleView");$.MultiDiffEditorFileToolbar=new $("MultiDiffEditorFileToolbar");const hu=yn("menuService");class $g{static for(e){let t=this._all.get(e);return t||(t=new $g(e),this._all.set(e,t)),t}static merge(e){const t=new Set;for(const n of e)n instanceof $g&&t.add(n.id);return t}constructor(e){this.id=e,this.has=t=>t===e}}$g._all=new Map;const ts=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new i5e({merge:$g.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(i){return this._commands.set(i.id,i),this._onDidChangeMenu.fire($g.for($.CommandPalette)),Rt(()=>{this._commands.delete(i.id)&&this._onDidChangeMenu.fire($g.for($.CommandPalette))})}getCommand(i){return this._commands.get(i)}getCommands(){const i=new Map;return this._commands.forEach((e,t)=>i.set(t,e)),i}appendMenuItem(i,e){let t=this._menuItems.get(i);t||(t=new _a,this._menuItems.set(i,t));const n=t.push(e);return this._onDidChangeMenu.fire($g.for(i)),Rt(()=>{n(),this._onDidChangeMenu.fire($g.for(i))})}appendMenuItems(i){const e=new Te;for(const{id:t,item:n}of i)e.add(this.appendMenuItem(t,n));return e}getMenuItems(i){let e;return this._menuItems.has(i)?e=[...this._menuItems.get(i)]:e=[],i===$.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(i){const e=new Set;for(const t of i)ty(t)&&(e.add(t.command.id),t.alt&&e.add(t.alt.id));this._commands.forEach((t,n)=>{e.has(n)||i.push({command:t})})}};class TD extends Lw{constructor(e,t,n){super(`submenuitem.${e.submenu.id}`,typeof e.title=="string"?e.title:e.title.value,n,"submenu"),this.item=e,this.hideActions=t}}let pc=dM=class{static label(e,t){return t!=null&&t.renderShortTitle&&e.shortTitle?typeof e.shortTitle=="string"?e.shortTitle:e.shortTitle.value:typeof e.title=="string"?e.title:e.title.value}constructor(e,t,n,r,o,s){var a,l;this.hideActions=r,this._commandService=s,this.id=e.id,this.label=dM.label(e,n),this.tooltip=(l=typeof e.tooltip=="string"?e.tooltip:(a=e.tooltip)===null||a===void 0?void 0:a.value)!==null&&l!==void 0?l:"",this.enabled=!e.precondition||o.contextMatchesRules(e.precondition),this.checked=void 0;let c;if(e.toggled){const u=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=o.contextMatchesRules(u.condition),this.checked&&u.tooltip&&(this.tooltip=typeof u.tooltip=="string"?u.tooltip:u.tooltip.value),this.checked&&Wt.isThemeIcon(u.icon)&&(c=u.icon),this.checked&&u.title&&(this.label=typeof u.title=="string"?u.title:u.title.value)}c||(c=Wt.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new dM(t,void 0,n,r,o,s):void 0,this._options=n,this.class=c&&Wt.asClassName(c)}run(...e){var t,n;let r=[];return!((t=this._options)===null||t===void 0)&&t.arg&&(r=[...r,this._options.arg]),!((n=this._options)===null||n===void 0)&&n.shouldForwardArgs&&(r=[...r,...e]),this._commandService.executeCommand(this.id,...r)}};pc=dM=W8e([die(4,Vt),die(5,sr)],pc);class sl{constructor(e){this.desc=e}}function Ei(i){const e=new Te,t=new i,{f1:n,menu:r,keybinding:o,...s}=t.desc;if(Dn.getCommand(s.id))throw new Error(`Cannot register two commands with the same id: ${s.id}`);if(e.add(Dn.registerCommand({id:s.id,handler:(a,...l)=>t.run(a,...l),metadata:s.metadata})),Array.isArray(r))for(const a of r)e.add(ts.appendMenuItem(a.id,{command:{...s,precondition:a.precondition===null?void 0:s.precondition},...a}));else r&&e.add(ts.appendMenuItem(r.id,{command:{...s,precondition:r.precondition===null?void 0:s.precondition},...r}));if(n&&(e.add(ts.appendMenuItem($.CommandPalette,{command:s,when:s.precondition})),e.add(ts.addCommand(s))),Array.isArray(o))for(const a of o)e.add(nl.registerKeybindingRule({...a,id:s.id,when:s.precondition?De.and(s.precondition,a.when):a.when}));else o&&e.add(nl.registerKeybindingRule({...o,id:s.id,when:s.precondition?De.and(s.precondition,o.when):o.when}));return e}const ea=yn("telemetryService"),Ta=yn("logService");var cs;(function(i){i[i.Off=0]="Off",i[i.Trace=1]="Trace",i[i.Debug=2]="Debug",i[i.Info=3]="Info",i[i.Warning=4]="Warning",i[i.Error=5]="Error"})(cs||(cs={}));const mme=cs.Info;class vme extends fe{constructor(){super(...arguments),this.level=mme,this._onDidChangeLogLevel=this._register(new se),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(e){return this.level!==cs.Off&&this.level<=e}}class H8e extends vme{constructor(e=mme,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(cs.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(cs.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(cs.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(cs.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(cs.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...t):console.error(e,...t))}}class V8e extends vme{constructor(e){super(),this.loggers=e,e.length&&this.setLevel(e[0].getLevel())}setLevel(e){for(const t of this.loggers)t.setLevel(e);super.setLevel(e)}trace(e,...t){for(const n of this.loggers)n.trace(e,...t)}debug(e,...t){for(const n of this.loggers)n.debug(e,...t)}info(e,...t){for(const n of this.loggers)n.info(e,...t)}warn(e,...t){for(const n of this.loggers)n.warn(e,...t)}error(e,...t){for(const n of this.loggers)n.error(e,...t)}dispose(){for(const e of this.loggers)e.dispose();super.dispose()}}function z8e(i){switch(i){case cs.Trace:return"trace";case cs.Debug:return"debug";case cs.Info:return"info";case cs.Warning:return"warn";case cs.Error:return"error";case cs.Off:return"off"}}new st("logLevel",z8e(cs.Info));class S4{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this.metadata=e.metadata}register(){if(Array.isArray(this._menuOpts)?this._menuOpts.forEach(this._registerMenuItem,this):this._menuOpts&&this._registerMenuItem(this._menuOpts),this._kbOpts){const e=Array.isArray(this._kbOpts)?this._kbOpts:[this._kbOpts];for(const t of e){let n=t.kbExpr;this.precondition&&(n?n=De.and(n,this.precondition):n=this.precondition);const r={id:this.id,weight:t.weight,args:t.args,when:n,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};nl.registerKeybindingRule(r)}}Dn.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),metadata:this.metadata})}_registerMenuItem(e){ts.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 ES extends S4{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,n,r){return this._implementations.push({priority:e,name:t,implementation:n,when:r}),this._implementations.sort((o,s)=>s.priority-o.priority),{dispose:()=>{for(let o=0;o{if(a.get(Vt).contextMatchesRules(n??void 0))return r(a,s,t)})}runCommand(e,t){return Vo.runEditorCommand(e,t,this.precondition,(n,r,o)=>this.runEditorCommand(n,r,o))}}class gt extends Vo{static convertOptions(e){let t;Array.isArray(e.menuOpts)?t=e.menuOpts:e.menuOpts?t=[e.menuOpts]:t=[];function n(r){return r.menuId||(r.menuId=$.EditorContext),r.title||(r.title=e.label),r.when=De.and(e.precondition,r.when),r}return Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(n)):e.contextMenuOpts&&t.push(n(e.contextMenuOpts)),e.menuOpts=t,e}constructor(e){super(gt.convertOptions(e)),this.label=e.label,this.alias=e.alias}runEditorCommand(e,t,n){return this.reportTelemetry(e,t),this.run(e,t,n||{})}reportTelemetry(e,t){e.get(ea).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class bme extends gt{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort((n,r)=>r[0]-n[0]),{dispose:()=>{for(let n=0;n{var s,a;const l=o.get(Vt),c=o.get(Ta);if(!l.contextMatchesRules((s=this.desc.precondition)!==null&&s!==void 0?s:void 0)){c.debug("[EditorAction2] NOT running command because its precondition is FALSE",this.desc.id,(a=this.desc.precondition)===null||a===void 0?void 0:a.serialize());return}return this.runEditorCommand(o,r,...t)})}}function tg(i,e){Dn.registerCommand(i,function(t,...n){const r=t.get(Ot),[o,s]=n;Xn(At.isUri(o)),Xn(ae.isIPosition(s));const a=t.get(tr).getModel(o);if(a){const l=ae.lift(s);return r.invokeFunction(e,a,l,...n.slice(2))}return t.get(ol).createModelReference(o).then(l=>new Promise((c,u)=>{try{const d=r.invokeFunction(e,l.object.textEditorModel,ae.lift(s),n.slice(2));c(d)}catch(d){u(d)}}).finally(()=>{l.dispose()}))})}function et(i){return Uc.INSTANCE.registerEditorCommand(i),i}function Be(i){const e=new i;return Uc.INSTANCE.registerEditorAction(e),e}function Cme(i){return Uc.INSTANCE.registerEditorAction(i),i}function U8e(i){Uc.INSTANCE.registerEditorAction(i)}function jn(i,e,t){Uc.INSTANCE.registerEditorContribution(i,e,t)}var Ay;(function(i){function e(s){return Uc.INSTANCE.getEditorCommand(s)}i.getEditorCommand=e;function t(){return Uc.INSTANCE.getEditorActions()}i.getEditorActions=t;function n(){return Uc.INSTANCE.getEditorContributions()}i.getEditorContributions=n;function r(s){return Uc.INSTANCE.getEditorContributions().filter(a=>s.indexOf(a.id)>=0)}i.getSomeEditorContributions=r;function o(){return Uc.INSTANCE.getDiffEditorContributions()}i.getDiffEditorContributions=o})(Ay||(Ay={}));const j8e={EditorCommonContributions:"editor.contributions"};class Uc{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t,n){this.editorContributions.push({id:e,ctor:t,instantiation:n})}getEditorContributions(){return this.editorContributions.slice(0)}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}}Uc.INSTANCE=new Uc;ar.add(j8e.EditorCommonContributions,Uc.INSTANCE);function Ak(i){return i.register(),i}const yme=Ak(new ES({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:$.MenubarEditMenu,group:"1_do",title:w({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1},{menuId:$.CommandPalette,group:"",title:w("undo","Undo"),order:1}]}));Ak(new _me(yme,{id:"default:undo",precondition:void 0}));const wme=Ak(new ES({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:$.MenubarEditMenu,group:"1_do",title:w({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2},{menuId:$.CommandPalette,group:"",title:w("redo","Redo"),order:1}]}));Ak(new _me(wme,{id:"default:redo",precondition:void 0}));const K8e=Ak(new ES({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:$.MenubarSelectionMenu,group:"1_basic",title:w({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1},{menuId:$.CommandPalette,group:"",title:w("selectAll","Select All"),order:1}]})),G8e="$initialize";let hie=!1;function fH(i){S_&&(hie||(hie=!0,console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq")),console.warn(i.message))}class q8e{constructor(e,t,n,r){this.vsWorker=e,this.req=t,this.method=n,this.args=r,this.type=0}}class fie{constructor(e,t,n,r){this.vsWorker=e,this.seq=t,this.res=n,this.err=r,this.type=1}}class X8e{constructor(e,t,n,r){this.vsWorker=e,this.req=t,this.eventName=n,this.arg=r,this.type=2}}class Y8e{constructor(e,t,n){this.vsWorker=e,this.req=t,this.event=n,this.type=3}}class Z8e{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class Q8e{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null),this._pendingEmitters=new Map,this._pendingEvents=new Map}setWorkerId(e){this._workerId=e}sendMessage(e,t){const n=String(++this._lastSentReq);return new Promise((r,o)=>{this._pendingReplies[n]={resolve:r,reject:o},this._send(new q8e(this._workerId,n,e,t))})}listen(e,t){let n=null;const r=new se({onWillAddFirstListener:()=>{n=String(++this._lastSentReq),this._pendingEmitters.set(n,r),this._send(new X8e(this._workerId,n,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(n),this._send(new Z8e(this._workerId,n)),n=null}});return r.event}handleMessage(e){!e||!e.vsWorker||this._workerId!==-1&&e.vsWorker!==this._workerId||this._handleMessage(e)}_handleMessage(e){switch(e.type){case 1:return this._handleReplyMessage(e);case 0:return this._handleRequestMessage(e);case 2:return this._handleSubscribeEventMessage(e);case 3:return this._handleEventMessage(e);case 4:return this._handleUnsubscribeEventMessage(e)}}_handleReplyMessage(e){if(!this._pendingReplies[e.seq]){console.warn("Got reply to unknown seq");return}const t=this._pendingReplies[e.seq];if(delete this._pendingReplies[e.seq],e.err){let n=e.err;e.err.$isError&&(n=new Error,n.name=e.err.name,n.message=e.err.message,n.stack=e.err.stack),t.reject(n);return}t.resolve(e.res)}_handleRequestMessage(e){const t=e.req;this._handler.handleMessage(e.method,e.args).then(r=>{this._send(new fie(this._workerId,t,r,void 0))},r=>{r.detail instanceof Error&&(r.detail=Bne(r.detail)),this._send(new fie(this._workerId,t,void 0,Bne(r)))})}_handleSubscribeEventMessage(e){const t=e.req,n=this._handler.handleEvent(e.eventName,e.arg)(r=>{this._send(new Y8e(this._workerId,t,r))});this._pendingEvents.set(t,n)}_handleEventMessage(e){if(!this._pendingEmitters.has(e.req)){console.warn("Got event for unknown req");return}this._pendingEmitters.get(e.req).fire(e.event)}_handleUnsubscribeEventMessage(e){if(!this._pendingEvents.has(e.req)){console.warn("Got unsubscribe for unknown req");return}this._pendingEvents.get(e.req).dispose(),this._pendingEvents.delete(e.req)}_send(e){const t=[];if(e.type===0)for(let n=0;n{this._protocol.handleMessage(u)},u=>{r==null||r(u)})),this._protocol=new Q8e({sendMessage:(u,d)=>{this._worker.postMessage(u,d)},handleMessage:(u,d)=>{if(typeof n[u]!="function")return Promise.reject(new Error("Missing method "+u+" on main thread host."));try{return Promise.resolve(n[u].apply(n,d))}catch(h){return Promise.reject(h)}},handleEvent:(u,d)=>{if(xme(u)){const h=n[u].call(n,d);if(typeof h!="function")throw new Error(`Missing dynamic event ${u} on main thread host.`);return h}if(Sme(u)){const h=n[u];if(typeof h!="function")throw new Error(`Missing event ${u} on main thread host.`);return h}throw new Error(`Malformed event name ${u}`)}}),this._protocol.setWorkerId(this._worker.getId());let o=null;const s=globalThis.require;typeof s<"u"&&typeof s.getConfig=="function"?o=s.getConfig():typeof globalThis.requirejs<"u"&&(o=globalThis.requirejs.s.contexts._.config);const a=tq(n);this._onModuleLoaded=this._protocol.sendMessage(G8e,[this._worker.getId(),JSON.parse(JSON.stringify(o)),t,a]);const l=(u,d)=>this._request(u,d),c=(u,d)=>this._protocol.listen(u,d);this._lazyProxy=new Promise((u,d)=>{r=d,this._onModuleLoaded.then(h=>{u(e6e(h,l,c))},h=>{d(h),this._onError("Worker failed to load "+t,h)})})}getProxyObject(){return this._lazyProxy}_request(e,t){return new Promise((n,r)=>{this._onModuleLoaded.then(()=>{this._protocol.sendMessage(e,t).then(n,r)},r)})}_onError(e,t){console.error(e),console.info(t)}}function Sme(i){return i[0]==="o"&&i[1]==="n"&&nf(i.charCodeAt(2))}function xme(i){return/^onDynamic/.test(i)&&nf(i.charCodeAt(9))}function e6e(i,e,t){const n=s=>function(){const a=Array.prototype.slice.call(arguments,0);return e(s,a)},r=s=>function(a){return t(s,a)},o={};for(const s of i){if(xme(s)){o[s]=r(s);continue}if(Sme(s)){o[s]=t(s,void 0);continue}o[s]=n(s)}return o}function Vp(i,e){var t;const n=globalThis.MonacoEnvironment;if(n!=null&&n.createTrustedTypesPolicy)try{return n.createTrustedTypesPolicy(i,e)}catch(r){en(r);return}try{return(t=hi.trustedTypes)===null||t===void 0?void 0:t.createPolicy(i,e)}catch(r){en(r);return}}const gie=Vp("defaultWorkerFactory",{createScriptURL:i=>i});function t6e(i){const e=globalThis.MonacoEnvironment;if(e){if(typeof e.getWorker=="function")return e.getWorker("workerMain.js",i);if(typeof e.getWorkerUrl=="function"){const t=e.getWorkerUrl("workerMain.js",i);return new Worker(gie?gie.createScriptURL(t):t,{name:i})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function n6e(i){return typeof i.then=="function"}class i6e extends fe{constructor(e,t,n,r,o){super(),this.id=t,this.label=n;const s=t6e(n);n6e(s)?this.worker=s:this.worker=Promise.resolve(s),this.postMessage(e,[]),this.worker.then(a=>{a.onmessage=function(l){r(l.data)},a.onmessageerror=o,typeof a.addEventListener=="function"&&a.addEventListener("error",o)}),this._register(Rt(()=>{var a;(a=this.worker)===null||a===void 0||a.then(l=>{l.onmessage=null,l.onmessageerror=null,l.removeEventListener("error",o),l.terminate()}),this.worker=null}))}getId(){return this.id}postMessage(e,t){var n;(n=this.worker)===null||n===void 0||n.then(r=>{try{r.postMessage(e,t)}catch(o){en(o),en(new Error(`FAILED to post message to '${this.label}'-worker`,{cause:o}))}})}}class x4{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,n){const r=++x4.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new i6e(e,r,this._label||"anonymous"+r,t,o=>{fH(o),this._webWorkerFailedBeforeError=o,n(o)})}}x4.LAST_WORKER_ID=0;var qr;(function(i){i[i.None=0]="None",i[i.Indent=1]="Indent",i[i.IndentOutdent=2]="IndentOutdent",i[i.Outdent=3]="Outdent"})(qr||(qr={}));class g6{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,n=e.notIn.length;t0&&i.getLanguageId(s-1)===r;)s--;return new o6e(i,r,s,o+1,i.getStartOffset(s),i.getEndOffset(o))}class o6e{constructor(e,t,n,r,o,s){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=n,this._lastTokenIndex=r,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 Kh(i){return(i&3)!==0}class Dw{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(t=>new g6(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new g6({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new g6({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:Dw.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:Dw.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS,this._surroundingPairs=e.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(e){return e?this._autoCloseBeforeForQuotes:this._autoCloseBeforeForBrackets}getSurroundingPairs(){return this._surroundingPairs}}Dw.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])> `;Dw.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])> - `;const pie=typeof Buffer<"u";let p6;class E4{static wrap(e){return pie&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new E4(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return pie?this.buffer.toString():(p6||(p6=new TextDecoder),p6.decode(this.buffer))}}function s6e(i,e){return i[e+0]<<0>>>0|i[e+1]<<8>>>0}function a6e(i,e,t){i[t+0]=e&255,e=e>>>8,i[t+1]=e&255}function Td(i,e){return i[e]*2**24+i[e+1]*2**16+i[e+2]*2**8+i[e+3]}function Nd(i,e,t){i[t+3]=e,e=e>>>8,i[t+2]=e,e=e>>>8,i[t+1]=e,e=e>>>8,i[t]=e}function mie(i,e){return i[e]}function vie(i,e,t){i[t]=e}let m6;function Lme(){return m6||(m6=new TextDecoder("UTF-16LE")),m6}let v6;function l6e(){return v6||(v6=new TextDecoder("UTF-16BE")),v6}let _6;function Eme(){return _6||(_6=dpe()?Lme():l6e()),_6}function c6e(i,e,t){const n=new Uint16Array(i.buffer,e,t);return t>0&&(n[0]===65279||n[0]===65534)?u6e(i,e,t):Lme().decode(n)}function u6e(i,e,t){const n=[];let r=0;for(let o=0;o=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let n=0;n[s[0].toLowerCase(),s[1].toLowerCase()]);const t=[];for(let s=0;s{const[l,c]=s,[u,d]=a;return l===u||l===d||c===u||c===d},r=(s,a)=>{const l=Math.min(s,a),c=Math.max(s,a);for(let u=0;u0&&o.push({open:a,close:l})}return o}class h6e{constructor(e,t){this._richEditBracketsBrand=void 0;const n=d6e(t);this.brackets=n.map((r,o)=>new YA(e,o,r.open,r.close,f6e(r.open,r.close,n,o),g6e(r.open,r.close,n,o))),this.forwardRegex=p6e(this.brackets),this.reversedRegex=m6e(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const r of this.brackets){for(const o of r.open)this.textIsBracket[o]=r,this.textIsOpenBracket[o]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,o.length);for(const o of r.close)this.textIsBracket[o]=r,this.textIsOpenBracket[o]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,o.length)}}}function Dme(i,e,t,n){for(let r=0,o=e.length;r=0&&n.push(a);for(const a of s.close)a.indexOf(i)>=0&&n.push(a)}}function Ime(i,e){return i.length-e.length}function D4(i){if(i.length<=1)return i;const e=[],t=new Set;for(const n of i)t.has(n)||(e.push(n),t.add(n));return e}function f6e(i,e,t,n){let r=[];r=r.concat(i),r=r.concat(e);for(let o=0,s=r.length;o=0;s--)r[o++]=n.charCodeAt(s);return Eme().decode(r)}let e=null,t=null;return function(r){return e!==r&&(e=r,t=i(e)),t}}();class Mu{static _findPrevBracketInText(e,t,n,r){const o=n.match(e);if(!o)return null;const s=n.length-(o.index||0),a=o[0].length,l=r+s;return new B(t,l-a+1,t,l+1)}static findPrevBracketInRange(e,t,n,r,o){const a=Aq(n).substring(n.length-o,n.length-r);return this._findPrevBracketInText(e,t,a,r)}static findNextBracketInText(e,t,n,r){const o=n.match(e);if(!o)return null;const s=o.index||0,a=o[0].length;if(a===0)return null;const l=r+s;return new B(t,l+1,t,l+1+a)}static findNextBracketInRange(e,t,n,r,o){const s=n.substring(r,o);return this.findNextBracketInText(e,t,s,r)}}class _6e{constructor(e){this._richEditBrackets=e}getElectricCharacters(){const e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const n of t.close){const r=n.charAt(n.length-1);e.push(r)}return Lp(e)}onElectricCharacter(e,t,n){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const r=t.findTokenIndexAtOffset(n-1);if(Kh(t.getStandardTokenType(r)))return null;const o=this._richEditBrackets.reversedRegex,s=t.getLineContent().substring(0,n-1)+e,a=Mu.findPrevBracketInRange(o,1,s,0,s.length);if(!a)return null;const l=s.substring(a.startColumn-1,a.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[l])return null;const u=t.getActualLineContentBefore(a.startColumn-1);return/^\s*$/.test(u)?{matchOpenBracket:l}:null}}function rR(i){return i.global&&(i.lastIndex=0),!0}class b6e{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&rR(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&rR(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&rR(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&rR(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 ny{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const n=ny._createOpenBracketRegExp(t[0]),r=ny._createCloseBracketRegExp(t[1]);n&&r&&this._brackets.push({open:t[0],openRegExp:n,close:t[1],closeRegExp:r})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,n,r){if(e>=3)for(let o=0,s=this._regExpRules.length;oc.reg?(c.reg.lastIndex=0,c.reg.test(c.text)):!0))return a.action}if(e>=2&&n.length>0&&r.length>0)for(let o=0,s=this._brackets.length;o=2&&n.length>0){for(let o=0,s=this._brackets.length;o"u"?t:o}function y6e(i){return i.replace(/[\[\]]/g,"")}const ji=yn("languageService");class rf{constructor(e,t=[],n=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=n}}const Nme=[];function In(i,e,t){e instanceof rf||(e=new rf(e,[],!!t)),Nme.push([i,e])}function bie(){return Nme}const Cr=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list"}),k4={JSONContribution:"base.contributions.json"};function w6e(i){return i.length>0&&i.charAt(i.length-1)==="#"?i.substring(0,i.length-1):i}class S6e{constructor(){this._onDidChangeSchema=new se,this.schemasById={}}registerSchema(e,t){this.schemasById[w6e(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}}const x6e=new S6e;ar.add(k4.JSONContribution,x6e);const xh={Configuration:"base.contributions.configuration"},Rx="vscode://schemas/settings/resourceLanguage",Cie=ar.as(k4.JSONContribution);class L6e{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new se,this._onDidUpdateConfiguration=new se,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:w("defaultLanguageConfigurationOverrides.title","Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},Cie.registerSchema(Rx,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const n=new Set;this.doRegisterConfigurations(e,t,n),Cie.registerSchema(Rx,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:n})}registerDefaultConfigurations(e){const t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){var n;const r=[];for(const{overrides:o,source:s}of e)for(const a in o)if(t.add(a),qv.test(a)){const l=this.configurationDefaultsOverrides.get(a),c=(n=l==null?void 0:l.valuesSources)!==null&&n!==void 0?n:new Map;if(s)for(const f of Object.keys(o[a]))c.set(f,s);const u={...(l==null?void 0:l.value)||{},...o[a]};this.configurationDefaultsOverrides.set(a,{source:s,value:u,valuesSources:c});const d=y6e(a),h={type:"object",default:u,description:w("defaultLanguageConfiguration.description","Configure settings to be overridden for the {0} language.",d),$ref:Rx,defaultDefaultValue:u,source:Sa(s)?void 0:s,defaultValueSource:s};r.push(...ZA(a)),this.configurationProperties[a]=h,this.defaultLanguageConfigurationOverridesNode.properties[a]=h}else{this.configurationDefaultsOverrides.set(a,{value:o[a],source:s});const l=this.configurationProperties[a];l&&(this.updatePropertyDefaultValue(a,l),this.updateSchema(a,l))}this.doRegisterOverrideIdentifiers(r)}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,n){e.forEach(r=>{this.validateAndRegisterProperties(r,t,r.extensionInfo,r.restrictedProperties,void 0,n),this.configurationContributors.push(r),this.registerJSONConfiguration(r)})}validateAndRegisterProperties(e,t=!0,n,r,o=3,s){var a;o=nc(e.scope)?o:e.scope;const l=e.properties;if(l)for(const u in l){const d=l[u];if(t&&I6e(u,d)){delete l[u];continue}if(d.source=n,d.defaultDefaultValue=l[u].default,this.updatePropertyDefaultValue(u,d),qv.test(u)?d.scope=void 0:(d.scope=nc(d.scope)?o:d.scope,d.restricted=nc(d.restricted)?!!(r!=null&&r.includes(u)):d.restricted),l[u].hasOwnProperty("included")&&!l[u].included){this.excludedConfigurationProperties[u]=l[u],delete l[u];continue}else this.configurationProperties[u]=l[u],!((a=l[u].policy)===null||a===void 0)&&a.name&&this.policyConfigurations.set(l[u].policy.name,u);!l[u].deprecationMessage&&l[u].markdownDeprecationMessage&&(l[u].deprecationMessage=l[u].markdownDeprecationMessage),s.add(u)}const c=e.allOf;if(c)for(const u of c)this.validateAndRegisterProperties(u,t,n,r,o,s)}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}registerJSONConfiguration(e){const t=n=>{const r=n.properties;if(r)for(const s in r)this.updateSchema(s,r[s]);const o=n.allOf;o==null||o.forEach(t)};t(e)}updateSchema(e,t){switch(t.scope){case 1:break;case 2:break;case 6:break;case 3:break;case 4:break;case 5:this.resourceLanguageSettingsSchema.properties[e]=t;break}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,n={type:"object",description:w("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),errorMessage:w("overrideSettings.errorMessage","This setting does not support per-language configuration."),$ref:Rx};this.updatePropertyDefaultValue(t,n)}}registerOverridePropertyPatternKey(){w("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),w("overrideSettings.errorMessage","This setting does not support per-language configuration."),this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const n=this.configurationDefaultsOverrides.get(e);let r=n==null?void 0:n.value,o=n==null?void 0:n.source;Cl(r)&&(r=t.defaultDefaultValue,o=void 0),Cl(r)&&(r=D6e(t.type)),t.default=r,t.defaultValueSource=o}}const Rme="\\[([^\\]]+)\\]",yie=new RegExp(Rme,"g"),E6e=`^(${Rme})+$`,qv=new RegExp(E6e);function ZA(i){const e=[];if(qv.test(i)){let t=yie.exec(i);for(;t!=null&&t.length;){const n=t[1].trim();n&&e.push(n),t=yie.exec(i)}}return Lp(e)}function D6e(i){switch(Array.isArray(i)?i[0]:i){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const hM=new L6e;ar.add(xh.Configuration,hM);function I6e(i,e){var t,n,r,o;return i.trim()?qv.test(i)?w("config.property.languageDefault","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",i):hM.getConfigurationProperties()[i]!==void 0?w("config.property.duplicate","Cannot register '{0}'. This property is already registered.",i):!((t=e.policy)===null||t===void 0)&&t.name&&hM.getPolicyConfigurations().get((n=e.policy)===null||n===void 0?void 0:n.name)!==void 0?w("config.policy.duplicate","Cannot register '{0}'. The associated policy {1} is already registered with {2}.",i,(r=e.policy)===null||r===void 0?void 0:r.name,hM.getPolicyConfigurations().get((o=e.policy)===null||o===void 0?void 0:o.name)):null:w("config.property.empty","Cannot register an empty property")}const k6e={ModesRegistry:"editor.modesRegistry"};class T6e{constructor(){this._onDidChangeLanguages=new se,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,n=this._languages.length;t{const l=new Set;return{info:new M6e(this,a,l),closing:l}}),o=new zne(a=>{const l=new Set,c=new Set;return{info:new A6e(this,a,l,c),opening:l,openingColorized:c}});for(const[a,l]of n){const c=r.get(a),u=o.get(l);c.closing.add(u.info),u.opening.add(c.info)}const s=t.colorizedBracketPairs?wie(t.colorizedBracketPairs):n.filter(a=>!(a[0]==="<"&&a[1]===">"));for(const[a,l]of s){const c=r.get(a),u=o.get(l);c.closing.add(u.info),u.openingColorized.add(c.info),u.opening.add(c.info)}this._openingBrackets=new Map([...r.cachedValues].map(([a,l])=>[a,l.info])),this._closingBrackets=new Map([...o.cachedValues].map(([a,l])=>[a,l.info]))}get openingBrackets(){return[...this._openingBrackets.values()]}get closingBrackets(){return[...this._closingBrackets.values()]}getOpeningBracketInfo(e){return this._openingBrackets.get(e)}getClosingBracketInfo(e){return this._closingBrackets.get(e)}getBracketInfo(e){return this.getOpeningBracketInfo(e)||this.getClosingBracketInfo(e)}}function wie(i){return i.filter(([e,t])=>e!==""&&t!=="")}class Mme{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class M6e extends Mme{constructor(e,t,n){super(e,t),this.openedBrackets=n,this.isOpeningBracket=!0}}class A6e extends Mme{constructor(e,t,n,r){super(e,t),this.openingBrackets=n,this.openingColorizedBrackets=r,this.isOpeningBracket=!1}closes(e){return e.config!==this.config?!1:this.openingBrackets.has(e)}closesColorized(e){return e.config!==this.config?!1:this.openingColorizedBrackets.has(e)}getOpeningBrackets(){return[...this.openingBrackets]}}var P6e=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Sie=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class b6{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const Di=yn("languageConfigurationService");let pH=class extends fe{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new W6e),this.onDidChangeEmitter=this._register(new se),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const n=new Set(Object.values(mH));this._register(this.configurationService.onDidChangeConfiguration(r=>{const o=r.change.keys.some(a=>n.has(a)),s=r.change.overrides.filter(([a,l])=>l.some(c=>n.has(c))).map(([a])=>a);if(o)this.configurations.clear(),this.onDidChangeEmitter.fire(new b6(void 0));else for(const a of s)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new b6(a)))})),this._register(this._registry.onDidChange(r=>{this.configurations.delete(r.languageId),this.onDidChangeEmitter.fire(new b6(r.languageId))}))}register(e,t,n){return this._registry.register(e,t,n)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=O6e(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};pH=P6e([Sie(0,gn),Sie(1,ji)],pH);function O6e(i,e,t,n){let r=e.getLanguageConfiguration(i);if(!r){if(!n.isRegisteredLanguageId(i))return new Oy(i,{});r=new Oy(i,{})}const o=F6e(r.languageId,t),s=Pme([r.underlyingConfig,o]);return new Oy(r.languageId,s)}const mH={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function F6e(i,e){const t=e.getValue(mH.brackets,{overrideIdentifier:i}),n=e.getValue(mH.colorizedBracketPairs,{overrideIdentifier:i});return{brackets:xie(t),colorizedBracketPairs:xie(n)}}function xie(i){if(Array.isArray(i))return i.map(e=>{if(!(!Array.isArray(e)||e.length!==2))return[e[0],e[1]]}).filter(e=>!!e)}function Ame(i,e,t){const n=i.getLineContent(e);let r=bi(n);return r.length>t-1&&(r=r.substring(0,t-1)),r}function Py(i,e,t){i.tokenization.forceTokenization(e);const n=i.tokenization.getLineTokens(e),r=typeof t>"u"?i.getLineMaxColumn(e)-1:t-1;return L4(n,r)}class B6e{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const n=new Lie(e,t,++this._order);return this._entries.push(n),this._resolved=null,Rt(()=>{for(let r=0;re.configuration)))}}function Pme(i){let e={comments:void 0,brackets:void 0,wordPattern:void 0,indentationRules:void 0,onEnterRules:void 0,autoClosingPairs:void 0,surroundingPairs:void 0,autoCloseBefore:void 0,folding:void 0,colorizedBracketPairs:void 0,__electricCharacterSupport:void 0};for(const t of i)e={comments:t.comments||e.comments,brackets:t.brackets||e.brackets,wordPattern:t.wordPattern||e.wordPattern,indentationRules:t.indentationRules||e.indentationRules,onEnterRules:t.onEnterRules||e.onEnterRules,autoClosingPairs:t.autoClosingPairs||e.autoClosingPairs,surroundingPairs:t.surroundingPairs||e.surroundingPairs,autoCloseBefore:t.autoCloseBefore||e.autoCloseBefore,folding:t.folding||e.folding,colorizedBracketPairs:t.colorizedBracketPairs||e.colorizedBracketPairs,__electricCharacterSupport:t.__electricCharacterSupport||e.__electricCharacterSupport};return e}class Lie{constructor(e,t,n){this.configuration=e,this.priority=t,this.order=n}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}}class Eie{constructor(e){this.languageId=e}}class W6e extends fe{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new se),this.onDidChange=this._onDidChange.event,this._register(this.register(hc,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,t,n=0){let r=this._entries.get(e);r||(r=new B6e(e),this._entries.set(e,r));const o=r.register(t,n);return this._onDidChange.fire(new Eie(e)),Rt(()=>{o.dispose(),this._onDidChange.fire(new Eie(e))})}getLanguageConfiguration(e){const t=this._entries.get(e);return(t==null?void 0:t.getResolvedConfiguration())||null}}class Oy{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 ny(this.underlyingConfig):null,this.comments=Oy._handleComments(this.underlyingConfig),this.characterPair=new Dw(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||rq,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new b6e(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new R6e(e,this.underlyingConfig)}getWordDefinition(){return oq(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new h6e(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new _6e(this.brackets)),this._electricCharacter}onEnter(e,t,n,r){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,n,r):null}getAutoClosingPairs(){return new r6e(this.characterPair.getAutoClosingPairs())}getAutoCloseBeforeSet(e){return this.characterPair.getAutoCloseBeforeSet(e)}getSurroundingPairs(){return this.characterPair.getSurroundingPairs()}static _handleComments(e){const t=e.comments;if(!t)return null;const n={};if(t.lineComment&&(n.lineCommentToken=t.lineComment),t.blockComment){const[r,o]=t.blockComment;n.blockCommentStartToken=r,n.blockCommentEndToken=o}return n}}In(Di,pH,1);class pm{constructor(e,t,n,r){this.originalStart=e,this.originalLength=t,this.modifiedStart=n,this.modifiedLength=r}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}class Die{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let n=0,r=e.length;n0||this.m_modifiedCount>0)&&this.m_changes.push(new pm(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class df{constructor(e,t,n=null){this.ContinueProcessingPredicate=n,this._originalSequence=e,this._modifiedSequence=t;const[r,o,s]=df._getElements(e),[a,l,c]=df._getElements(t);this._hasStrings=s&&c,this._originalStringElements=r,this._originalElementsOrHash=o,this._modifiedStringElements=a,this._modifiedElementsOrHash=l,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&typeof e[0]=="string"}static _getElements(e){const t=e.getElements();if(df._isStringArray(t)){const n=new Int32Array(t.length);for(let r=0,o=t.length;r=e&&r>=n&&this.ElementsAreEqual(t,r);)t--,r--;if(e>t||n>r){let d;return n<=r?(GC.Assert(e===t+1,"originalStart should only be one more than originalEnd"),d=[new pm(e,0,n,r-n+1)]):e<=t?(GC.Assert(n===r+1,"modifiedStart should only be one more than modifiedEnd"),d=[new pm(e,t-e+1,n,0)]):(GC.Assert(e===t+1,"originalStart should only be one more than originalEnd"),GC.Assert(n===r+1,"modifiedStart should only be one more than modifiedEnd"),d=[]),d}const s=[0],a=[0],l=this.ComputeRecursionPoint(e,t,n,r,s,a,o),c=s[0],u=a[0];if(l!==null)return l;if(!o[0]){const d=this.ComputeDiffRecursive(e,c,n,u,o);let h=[];return o[0]?h=[new pm(c+1,t-(c+1)+1,u+1,r-(u+1)+1)]:h=this.ComputeDiffRecursive(c+1,t,u+1,r,o),this.ConcatenateChanges(d,h)}return[new pm(e,t-e+1,n,r-n+1)]}WALKTRACE(e,t,n,r,o,s,a,l,c,u,d,h,f,g,p,v,m,_){let y=null,S=null,L=new Iie,E=t,D=n,k=f[0]-v[0]-r,T=-1073741824,M=this.m_forwardHistory.length-1;do{const A=k+e;A===E||A=0&&(c=this.m_forwardHistory[M],e=c[0],E=1,D=c.length-1)}while(--M>=-1);if(y=L.getReverseChanges(),_[0]){let A=f[0]+1,N=v[0]+1;if(y!==null&&y.length>0){const R=y[y.length-1];A=Math.max(A,R.getOriginalEnd()),N=Math.max(N,R.getModifiedEnd())}S=[new pm(A,h-A+1,N,p-N+1)]}else{L=new Iie,E=s,D=a,k=f[0]-v[0]-l,T=1073741824,M=m?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const A=k+o;A===E||A=u[A+1]?(d=u[A+1]-1,g=d-k-l,d>T&&L.MarkNextChange(),T=d+1,L.AddOriginalElement(d+1,g+1),k=A+1-o):(d=u[A-1],g=d-k-l,d>T&&L.MarkNextChange(),T=d,L.AddModifiedElement(d+1,g+1),k=A-1-o),M>=0&&(u=this.m_reverseHistory[M],o=u[0],E=1,D=u.length-1)}while(--M>=-1);S=L.getChanges()}return this.ConcatenateChanges(y,S)}ComputeRecursionPoint(e,t,n,r,o,s,a){let l=0,c=0,u=0,d=0,h=0,f=0;e--,n--,o[0]=0,s[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const g=t-e+(r-n),p=g+1,v=new Int32Array(p),m=new Int32Array(p),_=r-n,y=t-e,S=e-n,L=t-r,D=(y-_)%2===0;v[_]=e,m[y]=t,a[0]=!1;for(let k=1;k<=g/2+1;k++){let T=0,M=0;u=this.ClipDiagonalBound(_-k,k,_,p),d=this.ClipDiagonalBound(_+k,k,_,p);for(let N=u;N<=d;N+=2){N===u||NT+M&&(T=l,M=c),!D&&Math.abs(N-y)<=k-1&&l>=m[N])return o[0]=l,s[0]=c,R<=m[N]&&1447>0&&k<=1447+1?this.WALKTRACE(_,u,d,S,y,h,f,L,v,m,l,t,o,c,r,s,D,a):null}const A=(T-e+(M-n)-k)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(T,A))return a[0]=!0,o[0]=T,s[0]=M,A>0&&1447>0&&k<=1447+1?this.WALKTRACE(_,u,d,S,y,h,f,L,v,m,l,t,o,c,r,s,D,a):(e++,n++,[new pm(e,t-e+1,n,r-n+1)]);h=this.ClipDiagonalBound(y-k,k,y,p),f=this.ClipDiagonalBound(y+k,k,y,p);for(let N=h;N<=f;N+=2){N===h||N=m[N+1]?l=m[N+1]-1:l=m[N-1],c=l-(N-y)-L;const R=l;for(;l>e&&c>n&&this.ElementsAreEqual(l,c);)l--,c--;if(m[N]=l,D&&Math.abs(N-_)<=k&&l<=v[N])return o[0]=l,s[0]=c,R>=v[N]&&1447>0&&k<=1447+1?this.WALKTRACE(_,u,d,S,y,h,f,L,v,m,l,t,o,c,r,s,D,a):null}if(k<=1447){let N=new Int32Array(d-u+2);N[0]=_-u+1,qC.Copy2(v,u,N,1,d-u+1),this.m_forwardHistory.push(N),N=new Int32Array(f-h+2),N[0]=y-h+1,qC.Copy2(m,h,N,1,f-h+1),this.m_reverseHistory.push(N)}}return this.WALKTRACE(_,u,d,S,y,h,f,L,v,m,l,t,o,c,r,s,D,a)}PrettifyChanges(e){for(let t=0;t0,a=n.modifiedLength>0;for(;n.originalStart+n.originalLength=0;t--){const n=e[t];let r=0,o=0;if(t>0){const d=e[t-1];r=d.originalStart+d.originalLength,o=d.modifiedStart+d.modifiedLength}const s=n.originalLength>0,a=n.modifiedLength>0;let l=0,c=this._boundaryScore(n.originalStart,n.originalLength,n.modifiedStart,n.modifiedLength);for(let d=1;;d++){const h=n.originalStart-d,f=n.modifiedStart-d;if(hc&&(c=p,l=d)}n.originalStart-=l,n.modifiedStart-=l;const u=[null];if(t>0&&this.ChangesOverlap(e[t-1],e[t],u)){e[t-1]=u[0],e.splice(t,1),t++;continue}}if(this._hasStrings)for(let t=1,n=e.length;t0&&f>l&&(l=f,c=d,u=h)}return l>0?[c,u]:null}_contiguousSequenceScore(e,t,n){let r=0;for(let o=0;o=this._originalElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){const n=e+t;if(this._OriginalIsBoundary(n-1)||this._OriginalIsBoundary(n))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){const n=e+t;if(this._ModifiedIsBoundary(n-1)||this._ModifiedIsBoundary(n))return!0}return!1}_boundaryScore(e,t,n,r){const o=this._OriginalRegionIsBoundary(e,t)?1:0,s=this._ModifiedRegionIsBoundary(n,r)?1:0;return o+s}ConcatenateChanges(e,t){const n=[];if(e.length===0||t.length===0)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],n)){const r=new Array(e.length+t.length-1);return qC.Copy(e,0,r,0,e.length-1),r[e.length-1]=n[0],qC.Copy(t,1,r,e.length,t.length-1),r}else{const r=new Array(e.length+t.length);return qC.Copy(e,0,r,0,e.length),qC.Copy(t,0,r,e.length,t.length),r}}ChangesOverlap(e,t,n){if(GC.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),GC.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){const r=e.originalStart;let o=e.originalLength;const s=e.modifiedStart;let a=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(o=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(a=t.modifiedStart+t.modifiedLength-e.modifiedStart),n[0]=new pm(r,o,s,a),!0}else return n[0]=null,!1}ClipDiagonalBound(e,t,n,r){if(e>=0&&e255?255:i|0}function XC(i){return i<0?0:i>4294967295?4294967295:i|0}class H6e{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=XC(e);const n=this.values,r=this.prefixSum,o=t.length;return o===0?!1:(this.values=new Uint32Array(n.length+o),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e),e+o),this.values.set(t,e),e-1=0&&this.prefixSum.set(r.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=XC(e),t=XC(t),this.values[e]===t?!1:(this.values[e]=t,e-1=n.length)return!1;const o=n.length-e;return t>=o&&(t=o),t===0?!1:(this.values=new Uint32Array(n.length-t),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(r.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=XC(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;t===0&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let n=t;n<=e;n++)this.prefixSum[n]=this.prefixSum[n-1]+this.values[n];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,n=this.values.length-1,r=0,o=0,s=0;for(;t<=n;)if(r=t+(n-t)/2|0,o=this.prefixSum[r],s=o-this.values[r],e=o)t=r+1;else break;return new Ome(r,e-s)}}class V6e{constructor(e){this._values=e,this._isValid=!1,this._validEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(e){return this._ensureValid(),e===0?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();const t=this._indexBySum[e],n=t>0?this._prefixSum[t-1]:0;return new Ome(t,e-n)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=i4(this._values,e,t),this._invalidate(e)}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,t=this._values.length;e0?this._prefixSum[e-1]:0;this._prefixSum[e]=r+n;for(let o=0;o=0&&e<256?this._asciiMap[e]=n:this._map.set(e,n)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}}class JA{constructor(){this._actual=new IS(0)}add(e){this._actual.set(e,1)}has(e){return this._actual.get(e)===1}clear(){return this._actual.clear()}}class U6e{constructor(e,t,n){const r=new Uint8Array(e*t);for(let o=0,s=e*t;ot&&(t=l),a>n&&(n=a),c>n&&(n=c)}t++,n++;const r=new U6e(n,t,0);for(let o=0,s=e.length;o=this._maxCharCode?0:this._states.get(e,t)}}let C6=null;function K6e(){return C6===null&&(C6=new j6e([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),C6}let Mx=null;function G6e(){if(Mx===null){Mx=new IS(0);const i=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…`;for(let t=0;tr);if(r>0){const a=t.charCodeAt(r-1),l=t.charCodeAt(s);(a===40&&l===41||a===91&&l===93||a===123&&l===125)&&s--}return{range:{startLineNumber:n,startColumn:r+1,endLineNumber:n,endColumn:s+2},url:t.substring(r,s+1)}}static computeLinks(e,t=K6e()){const n=G6e(),r=[];for(let o=1,s=e.getLineCount();o<=s;o++){const a=e.getLineContent(o),l=a.length;let c=0,u=0,d=0,h=1,f=!1,g=!1,p=!1,v=!1;for(;c=0?(r+=n?1:-1,r<0?r=e.length-1:r%=e.length,e[r]):null}}vH.INSTANCE=new vH;class X6e extends IS{constructor(e){super(0);for(let t=0,n=e.length;t(e.hasOwnProperty(t)||(e[t]=i(t)),e[t])}const ou=Y6e(i=>new X6e(i));var mc;(function(i){i[i.Left=1]="Left",i[i.Center=2]="Center",i[i.Right=4]="Right",i[i.Full=7]="Full"})(mc||(mc={}));var $f;(function(i){i[i.Left=1]="Left",i[i.Center=2]="Center",i[i.Right=3]="Right"})($f||($f={}));var Ll;(function(i){i[i.Inline=1]="Inline",i[i.Gutter=2]="Gutter"})(Ll||(Ll={}));var ju;(function(i){i[i.Both=0]="Both",i[i.Right=1]="Right",i[i.Left=2]="Left",i[i.None=3]="None"})(ju||(ju={}));class fM{get originalIndentSize(){return this._indentSizeIsTabSize?"tabSize":this.indentSize}constructor(e){this._textModelResolvedOptionsBrand=void 0,this.tabSize=Math.max(1,e.tabSize|0),e.indentSize==="tabSize"?(this.indentSize=this.tabSize,this._indentSizeIsTabSize=!0):(this.indentSize=Math.max(1,e.indentSize|0),this._indentSizeIsTabSize=!1),this.insertSpaces=!!e.insertSpaces,this.defaultEOL=e.defaultEOL|0,this.trimAutoWhitespace=!!e.trimAutoWhitespace,this.bracketPairColorizationOptions=e.bracketPairColorizationOptions}equals(e){return this.tabSize===e.tabSize&&this._indentSizeIsTabSize===e._indentSizeIsTabSize&&this.indentSize===e.indentSize&&this.insertSpaces===e.insertSpaces&&this.defaultEOL===e.defaultEOL&&this.trimAutoWhitespace===e.trimAutoWhitespace&&dc(this.bracketPairColorizationOptions,e.bracketPairColorizationOptions)}createChangeEvent(e){return{tabSize:this.tabSize!==e.tabSize,indentSize:this.indentSize!==e.indentSize,insertSpaces:this.insertSpaces!==e.insertSpaces,trimAutoWhitespace:this.trimAutoWhitespace!==e.trimAutoWhitespace}}}class ND{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}}function Z6e(i){return i&&typeof i.read=="function"}class y6{constructor(e,t,n,r,o,s){this.identifier=e,this.range=t,this.text=n,this.forceMoveMarkers=r,this.isAutoWhitespaceEdit=o,this._isTracked=s}}class Q6e{constructor(e,t,n){this.regex=e,this.wordSeparators=t,this.simpleSearch=n}}class J6e{constructor(e,t,n){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=n}}function Fme(i){return!i.isTooLargeForSyncing()&&!i.isForSimpleWidget}const e9e=999;class g0{constructor(e,t,n,r){this.searchString=e,this.isRegex=t,this.matchCase=n,this.wordSeparators=r}parseSearchRequest(){if(this.searchString==="")return null;let e;this.isRegex?e=t9e(this.searchString):e=this.searchString.indexOf(` -`)>=0;let t=null;try{t=Ape(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch{return null}if(!t)return null;let n=!this.isRegex&&!e;return n&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(n=this.matchCase),new Q6e(t,this.wordSeparators?ou(this.wordSeparators):null,n?this.searchString:null)}}function t9e(i){if(!i||i.length===0)return!1;for(let e=0,t=i.length;e=t)break;const r=i.charCodeAt(e);if(r===110||r===114||r===87)return!0}}return!1}function S0(i,e,t){if(!t)return new ND(i,null);const n=[];for(let r=0,o=e.length;r>0);t[o]>=e?r=o-1:t[o+1]>=e?(n=o,r=o):n=o+1}return n+1}}class oR{static findMatches(e,t,n,r,o){const s=t.parseSearchRequest();return s?s.regex.multiline?this._doFindMatchesMultiline(e,n,new iy(s.wordSeparators,s.regex),r,o):this._doFindMatchesLineByLine(e,n,s,r,o):[]}static _getMultilineMatchRange(e,t,n,r,o,s){let a,l=0;r?(l=r.findLineFeedCountBeforeOffset(o),a=t+o+l):a=t+o;let c;if(r){const f=r.findLineFeedCountBeforeOffset(o+s.length)-l;c=a+s.length+f}else c=a+s.length;const u=e.getPositionAt(a),d=e.getPositionAt(c);return new B(u.lineNumber,u.column,d.lineNumber,d.column)}static _doFindMatchesMultiline(e,t,n,r,o){const s=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),l=e.getEOL()===`\r -`?new kie(a):null,c=[];let u=0,d;for(n.reset(0);d=n.next(a);)if(c[u++]=S0(this._getMultilineMatchRange(e,s,a,l,d.index,d[0]),d,r),u>=o)return c;return c}static _doFindMatchesLineByLine(e,t,n,r,o){const s=[];let a=0;if(t.startLineNumber===t.endLineNumber){const c=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return a=this._findMatchesInLine(n,c,t.startLineNumber,t.startColumn-1,a,s,r,o),s}const l=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(n,l,t.startLineNumber,t.startColumn-1,a,s,r,o);for(let c=t.startLineNumber+1;c=l))return o;return o}const u=new iy(e.wordSeparators,e.regex);let d;u.reset(0);do if(d=u.next(t),d&&(s[o++]=S0(new B(n,d.index+1+r,n,d.index+1+d[0].length+r),d,a),o>=l))return o;while(d);return o}static findNextMatch(e,t,n,r){const o=t.parseSearchRequest();if(!o)return null;const s=new iy(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(e,n,s,r):this._doFindNextMatchLineByLine(e,n,s,r)}static _doFindNextMatchMultiline(e,t,n,r){const o=new ae(t.lineNumber,1),s=e.getOffsetAt(o),a=e.getLineCount(),l=e.getValueInRange(new B(o.lineNumber,o.column,a,e.getLineMaxColumn(a)),1),c=e.getEOL()===`\r -`?new kie(l):null;n.reset(t.column-1);const u=n.next(l);return u?S0(this._getMultilineMatchRange(e,s,l,c,u.index,u[0]),u,r):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new ae(1,1),n,r):null}static _doFindNextMatchLineByLine(e,t,n,r){const o=e.getLineCount(),s=t.lineNumber,a=e.getLineContent(s),l=this._findFirstMatchInLine(n,a,s,t.column,r);if(l)return l;for(let c=1;c<=o;c++){const u=(s+c-1)%o,d=e.getLineContent(u+1),h=this._findFirstMatchInLine(n,d,u+1,1,r);if(h)return h}return null}static _findFirstMatchInLine(e,t,n,r,o){e.reset(r-1);const s=e.next(t);return s?S0(new B(n,s.index+1,n,s.index+1+s[0].length),s,o):null}static findPreviousMatch(e,t,n,r){const o=t.parseSearchRequest();if(!o)return null;const s=new iy(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(e,n,s,r):this._doFindPreviousMatchLineByLine(e,n,s,r)}static _doFindPreviousMatchMultiline(e,t,n,r){const o=this._doFindMatchesMultiline(e,new B(1,1,t.lineNumber,t.column),n,r,10*e9e);if(o.length>0)return o[o.length-1];const s=e.getLineCount();return t.lineNumber!==s||t.column!==e.getLineMaxColumn(s)?this._doFindPreviousMatchMultiline(e,new ae(s,e.getLineMaxColumn(s)),n,r):null}static _doFindPreviousMatchLineByLine(e,t,n,r){const o=e.getLineCount(),s=t.lineNumber,a=e.getLineContent(s).substring(0,t.column-1),l=this._findLastMatchInLine(n,a,s,r);if(l)return l;for(let c=1;c<=o;c++){const u=(o+s-c-1)%o,d=e.getLineContent(u+1),h=this._findLastMatchInLine(n,d,u+1,r);if(h)return h}return null}static _findLastMatchInLine(e,t,n,r){let o=null,s;for(e.reset(0);s=e.next(t);)o=S0(new B(n,s.index+1,n,s.index+1+s[0].length),s,r);return o}}function n9e(i,e,t,n,r){if(n===0)return!0;const o=e.charCodeAt(n-1);if(i.get(o)!==0||o===13||o===10)return!0;if(r>0){const s=e.charCodeAt(n);if(i.get(s)!==0)return!0}return!1}function i9e(i,e,t,n,r){if(n+r===t)return!0;const o=e.charCodeAt(n+r);if(i.get(o)!==0||o===13||o===10)return!0;if(r>0){const s=e.charCodeAt(n+r-1);if(i.get(s)!==0)return!0}return!1}function Pq(i,e,t,n,r){return n9e(i,e,t,n,r)&&i9e(i,e,t,n,r)}class iy{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){const t=e.length;let n;do{if(this._prevMatchStartIndex+this._prevMatchLength===t||(n=this._searchRegex.exec(e),!n))return null;const r=n.index,o=n[0].length;if(r===this._prevMatchStartIndex&&o===this._prevMatchLength){if(o===0){zA(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=r,this._prevMatchLength=o,!this._wordSeparators||Pq(this._wordSeparators,e,t,r,o))return n}while(n);return null}}class Oq{static computeUnicodeHighlights(e,t,n){const r=n?n.startLineNumber:1,o=n?n.endLineNumber:e.getLineCount(),s=new Tie(t),a=s.getCandidateCodePoints();let l;a==="allNonBasicAscii"?l=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):l=new RegExp(`${r9e(Array.from(a))}`,"g");const c=new iy(null,l),u=[];let d=!1,h,f=0,g=0,p=0;e:for(let v=r,m=o;v<=m;v++){const _=e.getLineContent(v),y=_.length;c.reset(0);do if(h=c.next(_),h){let S=h.index,L=h.index+h[0].length;if(S>0){const T=_.charCodeAt(S-1);xo(T)&&S--}if(L+1=T){d=!0;break e}u.push(new B(v,S+1,v,L+1))}}while(h)}return{ranges:u,hasMore:d,ambiguousCharacterCount:f,invisibleCharacterCount:g,nonBasicAsciiCharacterCount:p}}static computeUnicodeHighlightReason(e,t){const n=new Tie(t);switch(n.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const o=e.codePointAt(0),s=n.ambiguousCharacters.getPrimaryConfusable(o),a=Ib.getLocales().filter(l=>!Ib.getInstance(new Set([...t.allowedLocales,l])).isAmbiguous(o));return{kind:0,confusableWith:String.fromCodePoint(s),notAmbiguousInLocales:a}}case 1:return{kind:2}}}}function r9e(i,e){return`[${fc(i.map(n=>String.fromCodePoint(n)).join(""))}]`}class Tie{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=Ib.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of Nf.codePoints)Nie(String.fromCodePoint(t))||e.add(t);if(this.options.ambiguousCharacters)for(const t of this.ambiguousCharacters.getConfusableCodePoints())e.add(t);for(const t of this.allowedCodePoints)e.delete(t);return e}shouldHighlightNonBasicASCII(e,t){const n=e.codePointAt(0);if(this.allowedCodePoints.has(n))return 0;if(this.options.nonBasicASCII)return 1;let r=!1,o=!1;if(t)for(const s of t){const a=s.codePointAt(0),l=Tk(s);r=r||l,!l&&!this.ambiguousCharacters.isAmbiguous(a)&&!Nf.isInvisibleCharacter(a)&&(o=!0)}return!r&&o?0:this.options.invisibleCharacters&&!Nie(e)&&Nf.isInvisibleCharacter(n)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(n)?3:0}}function Nie(i){return i===" "||i===` -`||i===" "}class gM{constructor(e,t,n){this.changes=e,this.moves=t,this.hitTimeout=n}}class Bme{constructor(e,t){this.lineRangeMapping=e,this.changes=t}}class vn{static addRange(e,t){let n=0;for(;nt)throw new qi(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new vn(this.start+e,this.endExclusive+e)}deltaStart(e){return new vn(this.start+e,this.endExclusive)}deltaEnd(e){return new vn(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}contains(e){return this.start<=e&&e=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new qi(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new qi(`Invalid clipping range: ${this.toString()}`);return e=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let t=this.start;te.toString()).join(", ")}intersectsStrict(e){let t=0;for(;te+t.length,0)}}function RD(i,e,t){const n=o9e(i,e);if(n!==-1)return i[n]}function o9e(i,e,t=i.length-1){for(let n=t;n>=0;n--){const r=i[n];if(e(r))return n}return-1}function kw(i,e){const t=MD(i,e);return t===-1?void 0:i[t]}function MD(i,e,t=0,n=i.length){let r=t,o=n;for(;r0&&(t=r)}return t}function a9e(i,e){if(i.length===0)return;let t=i[0];for(let n=1;n=0&&(t=r)}return t}function l9e(i,e){return Bq(i,(t,n)=>-e(t,n))}function c9e(i,e){if(i.length===0)return-1;let t=0;for(let n=1;n0&&(t=n)}return t}function u9e(i,e){for(const t of i){const n=e(t);if(n!==void 0)return n}}let pn=class mm{static fromRangeInclusive(e){return new mm(e.startLineNumber,e.endLineNumber+1)}static joinMany(e){if(e.length===0)return[];let t=new Hu(e[0].slice());for(let n=1;nt)throw new qi(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&er.endLineNumberExclusive>=e.startLineNumber),n=MD(this._normalizedRanges,r=>r.startLineNumber<=e.endLineNumberExclusive)+1;if(t===n)this._normalizedRanges.splice(t,0,e);else if(t===n-1){const r=this._normalizedRanges[t];this._normalizedRanges[t]=r.join(e)}else{const r=this._normalizedRanges[t].join(this._normalizedRanges[n-1]).join(e);this._normalizedRanges.splice(t,n-t,r)}}contains(e){const t=kw(this._normalizedRanges,n=>n.startLineNumber<=e);return!!t&&t.endLineNumberExclusive>e}intersects(e){const t=kw(this._normalizedRanges,n=>n.startLineNumbere.startLineNumber}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;const t=[];let n=0,r=0,o=null;for(;n=s.startLineNumber?o=new pn(o.startLineNumber,Math.max(o.endLineNumberExclusive,s.endLineNumberExclusive)):(t.push(o),o=s)}return o!==null&&t.push(o),new Hu(t)}subtractFrom(e){const t=AD(this._normalizedRanges,s=>s.endLineNumberExclusive>=e.startLineNumber),n=MD(this._normalizedRanges,s=>s.startLineNumber<=e.endLineNumberExclusive)+1;if(t===n)return new Hu([e]);const r=[];let o=e.startLineNumber;for(let s=t;so&&r.push(new pn(o,a.startLineNumber)),o=a.endLineNumberExclusive}return oe.toString()).join(", ")}getIntersection(e){const t=[];let n=0,r=0;for(;nt.delta(e)))}}class Ya{static inverse(e,t,n){const r=[];let o=1,s=1;for(const l of e){const c=new Ya(new pn(o,l.original.startLineNumber),new pn(s,l.modified.startLineNumber));c.modified.isEmpty||r.push(c),o=l.original.endLineNumberExclusive,s=l.modified.endLineNumberExclusive}const a=new Ya(new pn(o,t+1),new pn(s,n+1));return a.modified.isEmpty||r.push(a),r}static clip(e,t,n){const r=[];for(const o of e){const s=o.original.intersect(t),a=o.modified.intersect(n);s&&!s.isEmpty&&a&&!a.isEmpty&&r.push(new Ya(s,a))}return r}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new Ya(this.modified,this.original)}join(e){return new Ya(this.original.join(e.original),this.modified.join(e.modified))}}class hh extends Ya{constructor(e,t,n){super(e,t),this.innerChanges=n}flip(){var e;return new hh(this.modified,this.original,(e=this.innerChanges)===null||e===void 0?void 0:e.map(t=>t.flip()))}}class Xv{constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new Xv(this.modifiedRange,this.originalRange)}}const d9e=3;class h9e{computeDiff(e,t,n){var r;const s=new p9e(e,t,{maxComputationTime:n.maxComputationTimeMs,shouldIgnoreTrimWhitespace:n.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),a=[];let l=null;for(const c of s.changes){let u;c.originalEndLineNumber===0?u=new pn(c.originalStartLineNumber+1,c.originalStartLineNumber+1):u=new pn(c.originalStartLineNumber,c.originalEndLineNumber+1);let d;c.modifiedEndLineNumber===0?d=new pn(c.modifiedStartLineNumber+1,c.modifiedStartLineNumber+1):d=new pn(c.modifiedStartLineNumber,c.modifiedEndLineNumber+1);let h=new hh(u,d,(r=c.charChanges)===null||r===void 0?void 0:r.map(f=>new Xv(new B(f.originalStartLineNumber,f.originalStartColumn,f.originalEndLineNumber,f.originalEndColumn),new B(f.modifiedStartLineNumber,f.modifiedStartColumn,f.modifiedEndLineNumber,f.modifiedEndColumn))));l&&(l.modified.endLineNumberExclusive===h.modified.startLineNumber||l.original.endLineNumberExclusive===h.original.startLineNumber)&&(h=new hh(l.original.join(h.original),l.modified.join(h.modified),l.innerChanges&&h.innerChanges?l.innerChanges.concat(h.innerChanges):void 0),a.pop()),a.push(h),l=h}return Ew(()=>pme(a,(c,u)=>u.original.startLineNumber-c.original.endLineNumberExclusive===u.modified.startLineNumber-c.modified.endLineNumberExclusive&&c.original.endLineNumberExclusive(e===10?"\\n":String.fromCharCode(e))+`-(${this._lineNumbers[t]},${this._columns[t]})`).join(", ")+"]"}_assertIndex(e,t){if(e<0||e>=t.length)throw new Error("Illegal index")}getElements(){return this._charCodes}getStartLineNumber(e){return e>0&&e===this._lineNumbers.length?this.getEndLineNumber(e-1):(this._assertIndex(e,this._lineNumbers),this._lineNumbers[e])}getEndLineNumber(e){return e===-1?this.getStartLineNumber(e+1):(this._assertIndex(e,this._lineNumbers),this._charCodes[e]===10?this._lineNumbers[e]+1:this._lineNumbers[e])}getStartColumn(e){return e>0&&e===this._columns.length?this.getEndColumn(e-1):(this._assertIndex(e,this._columns),this._columns[e])}getEndColumn(e){return e===-1?this.getStartColumn(e+1):(this._assertIndex(e,this._columns),this._charCodes[e]===10?1:this._columns[e]+1)}}class Fy{constructor(e,t,n,r,o,s,a,l){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=n,this.originalEndColumn=r,this.modifiedStartLineNumber=o,this.modifiedStartColumn=s,this.modifiedEndLineNumber=a,this.modifiedEndColumn=l}static createFromDiffChange(e,t,n){const r=t.getStartLineNumber(e.originalStart),o=t.getStartColumn(e.originalStart),s=t.getEndLineNumber(e.originalStart+e.originalLength-1),a=t.getEndColumn(e.originalStart+e.originalLength-1),l=n.getStartLineNumber(e.modifiedStart),c=n.getStartColumn(e.modifiedStart),u=n.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),d=n.getEndColumn(e.modifiedStart+e.modifiedLength-1);return new Fy(r,o,s,a,l,c,u,d)}}function g9e(i){if(i.length<=1)return i;const e=[i[0]];let t=e[0];for(let n=1,r=i.length;n0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&o()){const f=n.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),g=r.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(f.getElements().length>0&&g.getElements().length>0){let p=Wme(f,g,o,!0).changes;a&&(p=g9e(p)),h=[];for(let v=0,m=p.length;v1&&p>1;){const v=h.charCodeAt(g-2),m=f.charCodeAt(p-2);if(v!==m)break;g--,p--}(g>1||p>1)&&this._pushTrimWhitespaceCharChange(r,o+1,1,g,s+1,1,p)}{let g=bH(h,1),p=bH(f,1);const v=h.length+1,m=f.length+1;for(;g!0;const e=Date.now();return()=>Date.now()-e{n.push(So.fromOffsetPairs(r?r.getEndExclusives():Gc.zero,o?o.getStarts():new Gc(t,(r?r.seq2Range.endExclusive-r.seq1Range.endExclusive:0)+t)))}),n}static fromOffsetPairs(e,t){return new So(new vn(e.offset1,t.offset1),new vn(e.offset2,t.offset2))}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new So(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new So(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new So(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new So(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new So(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersect(e){const t=this.seq1Range.intersect(e.seq1Range),n=this.seq2Range.intersect(e.seq2Range);if(!(!t||!n))return new So(t,n)}getStarts(){return new Gc(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new Gc(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}class Gc{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(e){return e===0?this:new Gc(this.offset1+e,this.offset2+e)}equals(e){return this.offset1===e.offset1&&this.offset2===e.offset2}}Gc.zero=new Gc(0,0);Gc.max=new Gc(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);class PD{isValid(){return!0}}PD.instance=new PD;class m9e{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new qi("timeout must be positive")}isValid(){if(!(Date.now()-this.startTime0&&p>0&&s.get(g-1,p-1)===3&&(_+=a.get(g-1,p-1)),_+=r?r(g,p):1):_=-1;const y=Math.max(v,m,_);if(y===_){const S=g>0&&p>0?a.get(g-1,p-1):0;a.set(g,p,S+1),s.set(g,p,3)}else y===v?(a.set(g,p,0),s.set(g,p,1)):y===m&&(a.set(g,p,0),s.set(g,p,2));o.set(g,p,y)}const l=[];let c=e.length,u=t.length;function d(g,p){(g+1!==c||p+1!==u)&&l.push(new So(new vn(g+1,c),new vn(p+1,u))),c=g,u=p}let h=e.length-1,f=t.length-1;for(;h>=0&&f>=0;)s.get(h,f)===3?(d(h,f),h--,f--):s.get(h,f)===1?h--:f--;return d(-1,-1),l.reverse(),new pp(l,!1)}}class $me{compute(e,t,n=PD.instance){if(e.length===0||t.length===0)return pp.trivial(e,t);const r=e,o=t;function s(p,v){for(;pr.length||S>o.length)continue;const L=s(y,S);l.set(u,L);const E=y===m?c.get(u+1):c.get(u-1);if(c.set(u,L!==y?new Aie(E,y,S,L-y):E),l.get(u)===r.length&&l.get(u)-u===o.length)break e}}let d=c.get(u);const h=[];let f=r.length,g=o.length;for(;;){const p=d?d.x+d.length:0,v=d?d.y+d.length:0;if((p!==f||v!==g)&&h.push(new So(new vn(p,f),new vn(v,g))),!d)break;f=d.x,g=d.y,d=d.prev}return h.reverse(),new pp(h,!1)}}class Aie{constructor(e,t,n,r){this.prev=e,this.x=t,this.y=n,this.length=r}}class _9e{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){if(e<0){if(e=-e-1,e>=this.negativeArr.length){const n=this.negativeArr;this.negativeArr=new Int32Array(n.length*2),this.negativeArr.set(n)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){const n=this.positiveArr;this.positiveArr=new Int32Array(n.length*2),this.positiveArr.set(n)}this.positiveArr[e]=t}}}class b9e{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){e<0?(e=-e-1,this.negativeArr[e]=t):this.positiveArr[e]=t}}var Pie,Oie;class C9e{constructor(e,t){this.uri=e,this.value=t}}function y9e(i){return Array.isArray(i)}class Tr{constructor(e,t){if(this[Pie]="ResourceMap",e instanceof Tr)this.map=new Map(e.map),this.toKey=t??Tr.defaultToKey;else if(y9e(e)){this.map=new Map,this.toKey=t??Tr.defaultToKey;for(const[n,r]of e)this.set(n,r)}else this.map=new Map,this.toKey=e??Tr.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new C9e(e,t)),this}get(e){var t;return(t=this.map.get(this.toKey(e)))===null||t===void 0?void 0:t.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){typeof t<"u"&&(e=e.bind(t));for(const[n,r]of this.map)e(r.value,r.uri,this)}*values(){for(const e of this.map.values())yield e.value}*keys(){for(const e of this.map.values())yield e.uri}*entries(){for(const e of this.map.values())yield[e.uri,e.value]}*[(Pie=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.map)yield[e.uri,e.value]}}Tr.defaultToKey=i=>i.toString();class w9e{constructor(){this[Oie]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var e;return(e=this._head)===null||e===void 0?void 0:e.value}get last(){var e;return(e=this._tail)===null||e===void 0?void 0:e.value}has(e){return this._map.has(e)}get(e,t=0){const n=this._map.get(e);if(n)return t!==0&&this.touch(n,t),n.value}set(e,t,n=0){let r=this._map.get(e);if(r)r.value=t,n!==0&&this.touch(r,n);else{switch(r={key:e,value:t,next:void 0,previous:void 0},n){case 0:this.addItemLast(r);break;case 1:this.addItemFirst(r);break;case 2:this.addItemLast(r);break;default:this.addItemLast(r);break}this._map.set(e,r),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 n=this._state;let r=this._head;for(;r;){if(t?e.bind(t)(r.value,r.key,this):e(r.value,r.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");r=r.next}}keys(){const e=this,t=this._state;let n=this._head;const r={[Symbol.iterator](){return r},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const o={value:n.key,done:!1};return n=n.next,o}else return{value:void 0,done:!0}}};return r}values(){const e=this,t=this._state;let n=this._head;const r={[Symbol.iterator](){return r},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const o={value:n.value,done:!1};return n=n.next,o}else return{value:void 0,done:!0}}};return r}entries(){const e=this,t=this._state;let n=this._head;const r={[Symbol.iterator](){return r},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const o={value:[n.key,n.value],done:!1};return n=n.next,o}else return{value:void 0,done:!0}}};return r}[(Oie=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const t=e.next,n=e.previous;if(!t||!n)throw new Error("Invalid list");t.previous=n,n.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==1&&t!==2)){if(t===1){if(e===this._head)return;const n=e.next,r=e.previous;e===this._tail?(r.next=void 0,this._tail=r):(n.previous=r,r.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===2){if(e===this._tail)return;const n=e.next,r=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=r,r.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){const e=[];return this.forEach((t,n)=>{e.push([n,t])}),e}fromJSON(e){this.clear();for(const[t,n]of e)this.set(t,n)}}class D_ extends w9e{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))}}class S9e{constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(const[t,n]of e)this.set(t,n)}clear(){this._m1.clear(),this._m2.clear()}set(e,t){this._m1.set(e,t),this._m2.set(t,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){const t=this._m1.get(e);return t===void 0?!1:(this._m1.delete(e),this._m2.delete(t),!0)}keys(){return this._m1.keys()}values(){return this._m1.values()}}class Wq{constructor(){this.map=new Map}add(e,t){let n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(t)}delete(e,t){const n=this.map.get(e);n&&(n.delete(t),n.size===0&&this.map.delete(e))}forEach(e,t){const n=this.map.get(e);n&&n.forEach(t)}get(e){const t=this.map.get(e);return t||new Set}}class tP{constructor(e,t,n){this.lines=e,this.considerWhitespaceChanges=n,this.elements=[],this.firstCharOffsetByLine=[],this.additionalOffsetByLine=[];let r=!1;t.start>0&&t.endExclusive>=e.length&&(t=new vn(t.start-1,t.endExclusive),r=!0),this.lineRange=t,this.firstCharOffsetByLine[0]=0;for(let o=this.lineRange.start;o>>0|i[e+1]<<8>>>0}function a6e(i,e,t){i[t+0]=e&255,e=e>>>8,i[t+1]=e&255}function Td(i,e){return i[e]*2**24+i[e+1]*2**16+i[e+2]*2**8+i[e+3]}function Nd(i,e,t){i[t+3]=e,e=e>>>8,i[t+2]=e,e=e>>>8,i[t+1]=e,e=e>>>8,i[t]=e}function mie(i,e){return i[e]}function vie(i,e,t){i[t]=e}let m6;function Lme(){return m6||(m6=new TextDecoder("UTF-16LE")),m6}let v6;function l6e(){return v6||(v6=new TextDecoder("UTF-16BE")),v6}let _6;function Eme(){return _6||(_6=dpe()?Lme():l6e()),_6}function c6e(i,e,t){const n=new Uint16Array(i.buffer,e,t);return t>0&&(n[0]===65279||n[0]===65534)?u6e(i,e,t):Lme().decode(n)}function u6e(i,e,t){const n=[];let r=0;for(let o=0;o=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let n=0;n[s[0].toLowerCase(),s[1].toLowerCase()]);const t=[];for(let s=0;s{const[l,c]=s,[u,d]=a;return l===u||l===d||c===u||c===d},r=(s,a)=>{const l=Math.min(s,a),c=Math.max(s,a);for(let u=0;u0&&o.push({open:a,close:l})}return o}class h6e{constructor(e,t){this._richEditBracketsBrand=void 0;const n=d6e(t);this.brackets=n.map((r,o)=>new YA(e,o,r.open,r.close,f6e(r.open,r.close,n,o),g6e(r.open,r.close,n,o))),this.forwardRegex=p6e(this.brackets),this.reversedRegex=m6e(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const r of this.brackets){for(const o of r.open)this.textIsBracket[o]=r,this.textIsOpenBracket[o]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,o.length);for(const o of r.close)this.textIsBracket[o]=r,this.textIsOpenBracket[o]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,o.length)}}}function Dme(i,e,t,n){for(let r=0,o=e.length;r=0&&n.push(a);for(const a of s.close)a.indexOf(i)>=0&&n.push(a)}}function Ime(i,e){return i.length-e.length}function D4(i){if(i.length<=1)return i;const e=[],t=new Set;for(const n of i)t.has(n)||(e.push(n),t.add(n));return e}function f6e(i,e,t,n){let r=[];r=r.concat(i),r=r.concat(e);for(let o=0,s=r.length;o=0;s--)r[o++]=n.charCodeAt(s);return Eme().decode(r)}let e=null,t=null;return function(r){return e!==r&&(e=r,t=i(e)),t}}();class Mu{static _findPrevBracketInText(e,t,n,r){const o=n.match(e);if(!o)return null;const s=n.length-(o.index||0),a=o[0].length,l=r+s;return new B(t,l-a+1,t,l+1)}static findPrevBracketInRange(e,t,n,r,o){const a=Aq(n).substring(n.length-o,n.length-r);return this._findPrevBracketInText(e,t,a,r)}static findNextBracketInText(e,t,n,r){const o=n.match(e);if(!o)return null;const s=o.index||0,a=o[0].length;if(a===0)return null;const l=r+s;return new B(t,l+1,t,l+1+a)}static findNextBracketInRange(e,t,n,r,o){const s=n.substring(r,o);return this.findNextBracketInText(e,t,s,r)}}class _6e{constructor(e){this._richEditBrackets=e}getElectricCharacters(){const e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const n of t.close){const r=n.charAt(n.length-1);e.push(r)}return Ep(e)}onElectricCharacter(e,t,n){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const r=t.findTokenIndexAtOffset(n-1);if(Kh(t.getStandardTokenType(r)))return null;const o=this._richEditBrackets.reversedRegex,s=t.getLineContent().substring(0,n-1)+e,a=Mu.findPrevBracketInRange(o,1,s,0,s.length);if(!a)return null;const l=s.substring(a.startColumn-1,a.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[l])return null;const u=t.getActualLineContentBefore(a.startColumn-1);return/^\s*$/.test(u)?{matchOpenBracket:l}:null}}function rR(i){return i.global&&(i.lastIndex=0),!0}class b6e{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&rR(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&rR(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&rR(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&rR(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 ny{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const n=ny._createOpenBracketRegExp(t[0]),r=ny._createCloseBracketRegExp(t[1]);n&&r&&this._brackets.push({open:t[0],openRegExp:n,close:t[1],closeRegExp:r})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,n,r){if(e>=3)for(let o=0,s=this._regExpRules.length;oc.reg?(c.reg.lastIndex=0,c.reg.test(c.text)):!0))return a.action}if(e>=2&&n.length>0&&r.length>0)for(let o=0,s=this._brackets.length;o=2&&n.length>0){for(let o=0,s=this._brackets.length;o"u"?t:o}function y6e(i){return i.replace(/[\[\]]/g,"")}const ji=yn("languageService");class rf{constructor(e,t=[],n=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=n}}const Nme=[];function In(i,e,t){e instanceof rf||(e=new rf(e,[],!!t)),Nme.push([i,e])}function bie(){return Nme}const Cr=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list"}),k4={JSONContribution:"base.contributions.json"};function w6e(i){return i.length>0&&i.charAt(i.length-1)==="#"?i.substring(0,i.length-1):i}class S6e{constructor(){this._onDidChangeSchema=new se,this.schemasById={}}registerSchema(e,t){this.schemasById[w6e(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}}const x6e=new S6e;ar.add(k4.JSONContribution,x6e);const xh={Configuration:"base.contributions.configuration"},Rx="vscode://schemas/settings/resourceLanguage",Cie=ar.as(k4.JSONContribution);class L6e{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new se,this._onDidUpdateConfiguration=new se,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:w("defaultLanguageConfigurationOverrides.title","Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},Cie.registerSchema(Rx,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const n=new Set;this.doRegisterConfigurations(e,t,n),Cie.registerSchema(Rx,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:n})}registerDefaultConfigurations(e){const t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){var n;const r=[];for(const{overrides:o,source:s}of e)for(const a in o)if(t.add(a),Gv.test(a)){const l=this.configurationDefaultsOverrides.get(a),c=(n=l==null?void 0:l.valuesSources)!==null&&n!==void 0?n:new Map;if(s)for(const f of Object.keys(o[a]))c.set(f,s);const u={...(l==null?void 0:l.value)||{},...o[a]};this.configurationDefaultsOverrides.set(a,{source:s,value:u,valuesSources:c});const d=y6e(a),h={type:"object",default:u,description:w("defaultLanguageConfiguration.description","Configure settings to be overridden for the {0} language.",d),$ref:Rx,defaultDefaultValue:u,source:Sa(s)?void 0:s,defaultValueSource:s};r.push(...ZA(a)),this.configurationProperties[a]=h,this.defaultLanguageConfigurationOverridesNode.properties[a]=h}else{this.configurationDefaultsOverrides.set(a,{value:o[a],source:s});const l=this.configurationProperties[a];l&&(this.updatePropertyDefaultValue(a,l),this.updateSchema(a,l))}this.doRegisterOverrideIdentifiers(r)}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,n){e.forEach(r=>{this.validateAndRegisterProperties(r,t,r.extensionInfo,r.restrictedProperties,void 0,n),this.configurationContributors.push(r),this.registerJSONConfiguration(r)})}validateAndRegisterProperties(e,t=!0,n,r,o=3,s){var a;o=nc(e.scope)?o:e.scope;const l=e.properties;if(l)for(const u in l){const d=l[u];if(t&&I6e(u,d)){delete l[u];continue}if(d.source=n,d.defaultDefaultValue=l[u].default,this.updatePropertyDefaultValue(u,d),Gv.test(u)?d.scope=void 0:(d.scope=nc(d.scope)?o:d.scope,d.restricted=nc(d.restricted)?!!(r!=null&&r.includes(u)):d.restricted),l[u].hasOwnProperty("included")&&!l[u].included){this.excludedConfigurationProperties[u]=l[u],delete l[u];continue}else this.configurationProperties[u]=l[u],!((a=l[u].policy)===null||a===void 0)&&a.name&&this.policyConfigurations.set(l[u].policy.name,u);!l[u].deprecationMessage&&l[u].markdownDeprecationMessage&&(l[u].deprecationMessage=l[u].markdownDeprecationMessage),s.add(u)}const c=e.allOf;if(c)for(const u of c)this.validateAndRegisterProperties(u,t,n,r,o,s)}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}registerJSONConfiguration(e){const t=n=>{const r=n.properties;if(r)for(const s in r)this.updateSchema(s,r[s]);const o=n.allOf;o==null||o.forEach(t)};t(e)}updateSchema(e,t){switch(t.scope){case 1:break;case 2:break;case 6:break;case 3:break;case 4:break;case 5:this.resourceLanguageSettingsSchema.properties[e]=t;break}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,n={type:"object",description:w("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),errorMessage:w("overrideSettings.errorMessage","This setting does not support per-language configuration."),$ref:Rx};this.updatePropertyDefaultValue(t,n)}}registerOverridePropertyPatternKey(){w("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),w("overrideSettings.errorMessage","This setting does not support per-language configuration."),this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const n=this.configurationDefaultsOverrides.get(e);let r=n==null?void 0:n.value,o=n==null?void 0:n.source;Cl(r)&&(r=t.defaultDefaultValue,o=void 0),Cl(r)&&(r=D6e(t.type)),t.default=r,t.defaultValueSource=o}}const Rme="\\[([^\\]]+)\\]",yie=new RegExp(Rme,"g"),E6e=`^(${Rme})+$`,Gv=new RegExp(E6e);function ZA(i){const e=[];if(Gv.test(i)){let t=yie.exec(i);for(;t!=null&&t.length;){const n=t[1].trim();n&&e.push(n),t=yie.exec(i)}}return Ep(e)}function D6e(i){switch(Array.isArray(i)?i[0]:i){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const hM=new L6e;ar.add(xh.Configuration,hM);function I6e(i,e){var t,n,r,o;return i.trim()?Gv.test(i)?w("config.property.languageDefault","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",i):hM.getConfigurationProperties()[i]!==void 0?w("config.property.duplicate","Cannot register '{0}'. This property is already registered.",i):!((t=e.policy)===null||t===void 0)&&t.name&&hM.getPolicyConfigurations().get((n=e.policy)===null||n===void 0?void 0:n.name)!==void 0?w("config.policy.duplicate","Cannot register '{0}'. The associated policy {1} is already registered with {2}.",i,(r=e.policy)===null||r===void 0?void 0:r.name,hM.getPolicyConfigurations().get((o=e.policy)===null||o===void 0?void 0:o.name)):null:w("config.property.empty","Cannot register an empty property")}const k6e={ModesRegistry:"editor.modesRegistry"};class T6e{constructor(){this._onDidChangeLanguages=new se,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,n=this._languages.length;t{const l=new Set;return{info:new M6e(this,a,l),closing:l}}),o=new zne(a=>{const l=new Set,c=new Set;return{info:new A6e(this,a,l,c),opening:l,openingColorized:c}});for(const[a,l]of n){const c=r.get(a),u=o.get(l);c.closing.add(u.info),u.opening.add(c.info)}const s=t.colorizedBracketPairs?wie(t.colorizedBracketPairs):n.filter(a=>!(a[0]==="<"&&a[1]===">"));for(const[a,l]of s){const c=r.get(a),u=o.get(l);c.closing.add(u.info),u.openingColorized.add(c.info),u.opening.add(c.info)}this._openingBrackets=new Map([...r.cachedValues].map(([a,l])=>[a,l.info])),this._closingBrackets=new Map([...o.cachedValues].map(([a,l])=>[a,l.info]))}get openingBrackets(){return[...this._openingBrackets.values()]}get closingBrackets(){return[...this._closingBrackets.values()]}getOpeningBracketInfo(e){return this._openingBrackets.get(e)}getClosingBracketInfo(e){return this._closingBrackets.get(e)}getBracketInfo(e){return this.getOpeningBracketInfo(e)||this.getClosingBracketInfo(e)}}function wie(i){return i.filter(([e,t])=>e!==""&&t!=="")}class Mme{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class M6e extends Mme{constructor(e,t,n){super(e,t),this.openedBrackets=n,this.isOpeningBracket=!0}}class A6e extends Mme{constructor(e,t,n,r){super(e,t),this.openingBrackets=n,this.openingColorizedBrackets=r,this.isOpeningBracket=!1}closes(e){return e.config!==this.config?!1:this.openingBrackets.has(e)}closesColorized(e){return e.config!==this.config?!1:this.openingColorizedBrackets.has(e)}getOpeningBrackets(){return[...this.openingBrackets]}}var P6e=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Sie=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class b6{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const Di=yn("languageConfigurationService");let pH=class extends fe{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new W6e),this.onDidChangeEmitter=this._register(new se),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const n=new Set(Object.values(mH));this._register(this.configurationService.onDidChangeConfiguration(r=>{const o=r.change.keys.some(a=>n.has(a)),s=r.change.overrides.filter(([a,l])=>l.some(c=>n.has(c))).map(([a])=>a);if(o)this.configurations.clear(),this.onDidChangeEmitter.fire(new b6(void 0));else for(const a of s)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new b6(a)))})),this._register(this._registry.onDidChange(r=>{this.configurations.delete(r.languageId),this.onDidChangeEmitter.fire(new b6(r.languageId))}))}register(e,t,n){return this._registry.register(e,t,n)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=O6e(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};pH=P6e([Sie(0,gn),Sie(1,ji)],pH);function O6e(i,e,t,n){let r=e.getLanguageConfiguration(i);if(!r){if(!n.isRegisteredLanguageId(i))return new Oy(i,{});r=new Oy(i,{})}const o=F6e(r.languageId,t),s=Pme([r.underlyingConfig,o]);return new Oy(r.languageId,s)}const mH={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function F6e(i,e){const t=e.getValue(mH.brackets,{overrideIdentifier:i}),n=e.getValue(mH.colorizedBracketPairs,{overrideIdentifier:i});return{brackets:xie(t),colorizedBracketPairs:xie(n)}}function xie(i){if(Array.isArray(i))return i.map(e=>{if(!(!Array.isArray(e)||e.length!==2))return[e[0],e[1]]}).filter(e=>!!e)}function Ame(i,e,t){const n=i.getLineContent(e);let r=bi(n);return r.length>t-1&&(r=r.substring(0,t-1)),r}function Py(i,e,t){i.tokenization.forceTokenization(e);const n=i.tokenization.getLineTokens(e),r=typeof t>"u"?i.getLineMaxColumn(e)-1:t-1;return L4(n,r)}class B6e{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const n=new Lie(e,t,++this._order);return this._entries.push(n),this._resolved=null,Rt(()=>{for(let r=0;re.configuration)))}}function Pme(i){let e={comments:void 0,brackets:void 0,wordPattern:void 0,indentationRules:void 0,onEnterRules:void 0,autoClosingPairs:void 0,surroundingPairs:void 0,autoCloseBefore:void 0,folding:void 0,colorizedBracketPairs:void 0,__electricCharacterSupport:void 0};for(const t of i)e={comments:t.comments||e.comments,brackets:t.brackets||e.brackets,wordPattern:t.wordPattern||e.wordPattern,indentationRules:t.indentationRules||e.indentationRules,onEnterRules:t.onEnterRules||e.onEnterRules,autoClosingPairs:t.autoClosingPairs||e.autoClosingPairs,surroundingPairs:t.surroundingPairs||e.surroundingPairs,autoCloseBefore:t.autoCloseBefore||e.autoCloseBefore,folding:t.folding||e.folding,colorizedBracketPairs:t.colorizedBracketPairs||e.colorizedBracketPairs,__electricCharacterSupport:t.__electricCharacterSupport||e.__electricCharacterSupport};return e}class Lie{constructor(e,t,n){this.configuration=e,this.priority=t,this.order=n}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}}class Eie{constructor(e){this.languageId=e}}class W6e extends fe{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new se),this.onDidChange=this._onDidChange.event,this._register(this.register(hc,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,t,n=0){let r=this._entries.get(e);r||(r=new B6e(e),this._entries.set(e,r));const o=r.register(t,n);return this._onDidChange.fire(new Eie(e)),Rt(()=>{o.dispose(),this._onDidChange.fire(new Eie(e))})}getLanguageConfiguration(e){const t=this._entries.get(e);return(t==null?void 0:t.getResolvedConfiguration())||null}}class Oy{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 ny(this.underlyingConfig):null,this.comments=Oy._handleComments(this.underlyingConfig),this.characterPair=new Dw(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||rq,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new b6e(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new R6e(e,this.underlyingConfig)}getWordDefinition(){return oq(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new h6e(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new _6e(this.brackets)),this._electricCharacter}onEnter(e,t,n,r){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,n,r):null}getAutoClosingPairs(){return new r6e(this.characterPair.getAutoClosingPairs())}getAutoCloseBeforeSet(e){return this.characterPair.getAutoCloseBeforeSet(e)}getSurroundingPairs(){return this.characterPair.getSurroundingPairs()}static _handleComments(e){const t=e.comments;if(!t)return null;const n={};if(t.lineComment&&(n.lineCommentToken=t.lineComment),t.blockComment){const[r,o]=t.blockComment;n.blockCommentStartToken=r,n.blockCommentEndToken=o}return n}}In(Di,pH,1);class mm{constructor(e,t,n,r){this.originalStart=e,this.originalLength=t,this.modifiedStart=n,this.modifiedLength=r}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}class Die{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let n=0,r=e.length;n0||this.m_modifiedCount>0)&&this.m_changes.push(new mm(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class df{constructor(e,t,n=null){this.ContinueProcessingPredicate=n,this._originalSequence=e,this._modifiedSequence=t;const[r,o,s]=df._getElements(e),[a,l,c]=df._getElements(t);this._hasStrings=s&&c,this._originalStringElements=r,this._originalElementsOrHash=o,this._modifiedStringElements=a,this._modifiedElementsOrHash=l,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&typeof e[0]=="string"}static _getElements(e){const t=e.getElements();if(df._isStringArray(t)){const n=new Int32Array(t.length);for(let r=0,o=t.length;r=e&&r>=n&&this.ElementsAreEqual(t,r);)t--,r--;if(e>t||n>r){let d;return n<=r?(GC.Assert(e===t+1,"originalStart should only be one more than originalEnd"),d=[new mm(e,0,n,r-n+1)]):e<=t?(GC.Assert(n===r+1,"modifiedStart should only be one more than modifiedEnd"),d=[new mm(e,t-e+1,n,0)]):(GC.Assert(e===t+1,"originalStart should only be one more than originalEnd"),GC.Assert(n===r+1,"modifiedStart should only be one more than modifiedEnd"),d=[]),d}const s=[0],a=[0],l=this.ComputeRecursionPoint(e,t,n,r,s,a,o),c=s[0],u=a[0];if(l!==null)return l;if(!o[0]){const d=this.ComputeDiffRecursive(e,c,n,u,o);let h=[];return o[0]?h=[new mm(c+1,t-(c+1)+1,u+1,r-(u+1)+1)]:h=this.ComputeDiffRecursive(c+1,t,u+1,r,o),this.ConcatenateChanges(d,h)}return[new mm(e,t-e+1,n,r-n+1)]}WALKTRACE(e,t,n,r,o,s,a,l,c,u,d,h,f,g,p,v,m,_){let y=null,S=null,L=new Iie,E=t,D=n,k=f[0]-v[0]-r,T=-1073741824,M=this.m_forwardHistory.length-1;do{const A=k+e;A===E||A=0&&(c=this.m_forwardHistory[M],e=c[0],E=1,D=c.length-1)}while(--M>=-1);if(y=L.getReverseChanges(),_[0]){let A=f[0]+1,N=v[0]+1;if(y!==null&&y.length>0){const R=y[y.length-1];A=Math.max(A,R.getOriginalEnd()),N=Math.max(N,R.getModifiedEnd())}S=[new mm(A,h-A+1,N,p-N+1)]}else{L=new Iie,E=s,D=a,k=f[0]-v[0]-l,T=1073741824,M=m?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const A=k+o;A===E||A=u[A+1]?(d=u[A+1]-1,g=d-k-l,d>T&&L.MarkNextChange(),T=d+1,L.AddOriginalElement(d+1,g+1),k=A+1-o):(d=u[A-1],g=d-k-l,d>T&&L.MarkNextChange(),T=d,L.AddModifiedElement(d+1,g+1),k=A-1-o),M>=0&&(u=this.m_reverseHistory[M],o=u[0],E=1,D=u.length-1)}while(--M>=-1);S=L.getChanges()}return this.ConcatenateChanges(y,S)}ComputeRecursionPoint(e,t,n,r,o,s,a){let l=0,c=0,u=0,d=0,h=0,f=0;e--,n--,o[0]=0,s[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const g=t-e+(r-n),p=g+1,v=new Int32Array(p),m=new Int32Array(p),_=r-n,y=t-e,S=e-n,L=t-r,D=(y-_)%2===0;v[_]=e,m[y]=t,a[0]=!1;for(let k=1;k<=g/2+1;k++){let T=0,M=0;u=this.ClipDiagonalBound(_-k,k,_,p),d=this.ClipDiagonalBound(_+k,k,_,p);for(let N=u;N<=d;N+=2){N===u||NT+M&&(T=l,M=c),!D&&Math.abs(N-y)<=k-1&&l>=m[N])return o[0]=l,s[0]=c,R<=m[N]&&1447>0&&k<=1447+1?this.WALKTRACE(_,u,d,S,y,h,f,L,v,m,l,t,o,c,r,s,D,a):null}const A=(T-e+(M-n)-k)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(T,A))return a[0]=!0,o[0]=T,s[0]=M,A>0&&1447>0&&k<=1447+1?this.WALKTRACE(_,u,d,S,y,h,f,L,v,m,l,t,o,c,r,s,D,a):(e++,n++,[new mm(e,t-e+1,n,r-n+1)]);h=this.ClipDiagonalBound(y-k,k,y,p),f=this.ClipDiagonalBound(y+k,k,y,p);for(let N=h;N<=f;N+=2){N===h||N=m[N+1]?l=m[N+1]-1:l=m[N-1],c=l-(N-y)-L;const R=l;for(;l>e&&c>n&&this.ElementsAreEqual(l,c);)l--,c--;if(m[N]=l,D&&Math.abs(N-_)<=k&&l<=v[N])return o[0]=l,s[0]=c,R>=v[N]&&1447>0&&k<=1447+1?this.WALKTRACE(_,u,d,S,y,h,f,L,v,m,l,t,o,c,r,s,D,a):null}if(k<=1447){let N=new Int32Array(d-u+2);N[0]=_-u+1,qC.Copy2(v,u,N,1,d-u+1),this.m_forwardHistory.push(N),N=new Int32Array(f-h+2),N[0]=y-h+1,qC.Copy2(m,h,N,1,f-h+1),this.m_reverseHistory.push(N)}}return this.WALKTRACE(_,u,d,S,y,h,f,L,v,m,l,t,o,c,r,s,D,a)}PrettifyChanges(e){for(let t=0;t0,a=n.modifiedLength>0;for(;n.originalStart+n.originalLength=0;t--){const n=e[t];let r=0,o=0;if(t>0){const d=e[t-1];r=d.originalStart+d.originalLength,o=d.modifiedStart+d.modifiedLength}const s=n.originalLength>0,a=n.modifiedLength>0;let l=0,c=this._boundaryScore(n.originalStart,n.originalLength,n.modifiedStart,n.modifiedLength);for(let d=1;;d++){const h=n.originalStart-d,f=n.modifiedStart-d;if(hc&&(c=p,l=d)}n.originalStart-=l,n.modifiedStart-=l;const u=[null];if(t>0&&this.ChangesOverlap(e[t-1],e[t],u)){e[t-1]=u[0],e.splice(t,1),t++;continue}}if(this._hasStrings)for(let t=1,n=e.length;t0&&f>l&&(l=f,c=d,u=h)}return l>0?[c,u]:null}_contiguousSequenceScore(e,t,n){let r=0;for(let o=0;o=this._originalElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){const n=e+t;if(this._OriginalIsBoundary(n-1)||this._OriginalIsBoundary(n))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){const n=e+t;if(this._ModifiedIsBoundary(n-1)||this._ModifiedIsBoundary(n))return!0}return!1}_boundaryScore(e,t,n,r){const o=this._OriginalRegionIsBoundary(e,t)?1:0,s=this._ModifiedRegionIsBoundary(n,r)?1:0;return o+s}ConcatenateChanges(e,t){const n=[];if(e.length===0||t.length===0)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],n)){const r=new Array(e.length+t.length-1);return qC.Copy(e,0,r,0,e.length-1),r[e.length-1]=n[0],qC.Copy(t,1,r,e.length,t.length-1),r}else{const r=new Array(e.length+t.length);return qC.Copy(e,0,r,0,e.length),qC.Copy(t,0,r,e.length,t.length),r}}ChangesOverlap(e,t,n){if(GC.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),GC.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){const r=e.originalStart;let o=e.originalLength;const s=e.modifiedStart;let a=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(o=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(a=t.modifiedStart+t.modifiedLength-e.modifiedStart),n[0]=new mm(r,o,s,a),!0}else return n[0]=null,!1}ClipDiagonalBound(e,t,n,r){if(e>=0&&e255?255:i|0}function XC(i){return i<0?0:i>4294967295?4294967295:i|0}class H6e{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=XC(e);const n=this.values,r=this.prefixSum,o=t.length;return o===0?!1:(this.values=new Uint32Array(n.length+o),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e),e+o),this.values.set(t,e),e-1=0&&this.prefixSum.set(r.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=XC(e),t=XC(t),this.values[e]===t?!1:(this.values[e]=t,e-1=n.length)return!1;const o=n.length-e;return t>=o&&(t=o),t===0?!1:(this.values=new Uint32Array(n.length-t),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(r.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=XC(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;t===0&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let n=t;n<=e;n++)this.prefixSum[n]=this.prefixSum[n-1]+this.values[n];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,n=this.values.length-1,r=0,o=0,s=0;for(;t<=n;)if(r=t+(n-t)/2|0,o=this.prefixSum[r],s=o-this.values[r],e=o)t=r+1;else break;return new Ome(r,e-s)}}class V6e{constructor(e){this._values=e,this._isValid=!1,this._validEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(e){return this._ensureValid(),e===0?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();const t=this._indexBySum[e],n=t>0?this._prefixSum[t-1]:0;return new Ome(t,e-n)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=i4(this._values,e,t),this._invalidate(e)}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,t=this._values.length;e0?this._prefixSum[e-1]:0;this._prefixSum[e]=r+n;for(let o=0;o=0&&e<256?this._asciiMap[e]=n:this._map.set(e,n)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}}class JA{constructor(){this._actual=new IS(0)}add(e){this._actual.set(e,1)}has(e){return this._actual.get(e)===1}clear(){return this._actual.clear()}}class U6e{constructor(e,t,n){const r=new Uint8Array(e*t);for(let o=0,s=e*t;ot&&(t=l),a>n&&(n=a),c>n&&(n=c)}t++,n++;const r=new U6e(n,t,0);for(let o=0,s=e.length;o=this._maxCharCode?0:this._states.get(e,t)}}let C6=null;function K6e(){return C6===null&&(C6=new j6e([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),C6}let Mx=null;function G6e(){if(Mx===null){Mx=new IS(0);const i=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…`;for(let t=0;tr);if(r>0){const a=t.charCodeAt(r-1),l=t.charCodeAt(s);(a===40&&l===41||a===91&&l===93||a===123&&l===125)&&s--}return{range:{startLineNumber:n,startColumn:r+1,endLineNumber:n,endColumn:s+2},url:t.substring(r,s+1)}}static computeLinks(e,t=K6e()){const n=G6e(),r=[];for(let o=1,s=e.getLineCount();o<=s;o++){const a=e.getLineContent(o),l=a.length;let c=0,u=0,d=0,h=1,f=!1,g=!1,p=!1,v=!1;for(;c=0?(r+=n?1:-1,r<0?r=e.length-1:r%=e.length,e[r]):null}}vH.INSTANCE=new vH;class X6e extends IS{constructor(e){super(0);for(let t=0,n=e.length;t(e.hasOwnProperty(t)||(e[t]=i(t)),e[t])}const ou=Y6e(i=>new X6e(i));var mc;(function(i){i[i.Left=1]="Left",i[i.Center=2]="Center",i[i.Right=4]="Right",i[i.Full=7]="Full"})(mc||(mc={}));var $f;(function(i){i[i.Left=1]="Left",i[i.Center=2]="Center",i[i.Right=3]="Right"})($f||($f={}));var Ll;(function(i){i[i.Inline=1]="Inline",i[i.Gutter=2]="Gutter"})(Ll||(Ll={}));var ju;(function(i){i[i.Both=0]="Both",i[i.Right=1]="Right",i[i.Left=2]="Left",i[i.None=3]="None"})(ju||(ju={}));class fM{get originalIndentSize(){return this._indentSizeIsTabSize?"tabSize":this.indentSize}constructor(e){this._textModelResolvedOptionsBrand=void 0,this.tabSize=Math.max(1,e.tabSize|0),e.indentSize==="tabSize"?(this.indentSize=this.tabSize,this._indentSizeIsTabSize=!0):(this.indentSize=Math.max(1,e.indentSize|0),this._indentSizeIsTabSize=!1),this.insertSpaces=!!e.insertSpaces,this.defaultEOL=e.defaultEOL|0,this.trimAutoWhitespace=!!e.trimAutoWhitespace,this.bracketPairColorizationOptions=e.bracketPairColorizationOptions}equals(e){return this.tabSize===e.tabSize&&this._indentSizeIsTabSize===e._indentSizeIsTabSize&&this.indentSize===e.indentSize&&this.insertSpaces===e.insertSpaces&&this.defaultEOL===e.defaultEOL&&this.trimAutoWhitespace===e.trimAutoWhitespace&&dc(this.bracketPairColorizationOptions,e.bracketPairColorizationOptions)}createChangeEvent(e){return{tabSize:this.tabSize!==e.tabSize,indentSize:this.indentSize!==e.indentSize,insertSpaces:this.insertSpaces!==e.insertSpaces,trimAutoWhitespace:this.trimAutoWhitespace!==e.trimAutoWhitespace}}}class ND{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}}function Z6e(i){return i&&typeof i.read=="function"}class y6{constructor(e,t,n,r,o,s){this.identifier=e,this.range=t,this.text=n,this.forceMoveMarkers=r,this.isAutoWhitespaceEdit=o,this._isTracked=s}}class Q6e{constructor(e,t,n){this.regex=e,this.wordSeparators=t,this.simpleSearch=n}}class J6e{constructor(e,t,n){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=n}}function Fme(i){return!i.isTooLargeForSyncing()&&!i.isForSimpleWidget}const e9e=999;class f0{constructor(e,t,n,r){this.searchString=e,this.isRegex=t,this.matchCase=n,this.wordSeparators=r}parseSearchRequest(){if(this.searchString==="")return null;let e;this.isRegex?e=t9e(this.searchString):e=this.searchString.indexOf(` +`)>=0;let t=null;try{t=Ape(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch{return null}if(!t)return null;let n=!this.isRegex&&!e;return n&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(n=this.matchCase),new Q6e(t,this.wordSeparators?ou(this.wordSeparators):null,n?this.searchString:null)}}function t9e(i){if(!i||i.length===0)return!1;for(let e=0,t=i.length;e=t)break;const r=i.charCodeAt(e);if(r===110||r===114||r===87)return!0}}return!1}function w0(i,e,t){if(!t)return new ND(i,null);const n=[];for(let r=0,o=e.length;r>0);t[o]>=e?r=o-1:t[o+1]>=e?(n=o,r=o):n=o+1}return n+1}}class oR{static findMatches(e,t,n,r,o){const s=t.parseSearchRequest();return s?s.regex.multiline?this._doFindMatchesMultiline(e,n,new iy(s.wordSeparators,s.regex),r,o):this._doFindMatchesLineByLine(e,n,s,r,o):[]}static _getMultilineMatchRange(e,t,n,r,o,s){let a,l=0;r?(l=r.findLineFeedCountBeforeOffset(o),a=t+o+l):a=t+o;let c;if(r){const f=r.findLineFeedCountBeforeOffset(o+s.length)-l;c=a+s.length+f}else c=a+s.length;const u=e.getPositionAt(a),d=e.getPositionAt(c);return new B(u.lineNumber,u.column,d.lineNumber,d.column)}static _doFindMatchesMultiline(e,t,n,r,o){const s=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),l=e.getEOL()===`\r +`?new kie(a):null,c=[];let u=0,d;for(n.reset(0);d=n.next(a);)if(c[u++]=w0(this._getMultilineMatchRange(e,s,a,l,d.index,d[0]),d,r),u>=o)return c;return c}static _doFindMatchesLineByLine(e,t,n,r,o){const s=[];let a=0;if(t.startLineNumber===t.endLineNumber){const c=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return a=this._findMatchesInLine(n,c,t.startLineNumber,t.startColumn-1,a,s,r,o),s}const l=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(n,l,t.startLineNumber,t.startColumn-1,a,s,r,o);for(let c=t.startLineNumber+1;c=l))return o;return o}const u=new iy(e.wordSeparators,e.regex);let d;u.reset(0);do if(d=u.next(t),d&&(s[o++]=w0(new B(n,d.index+1+r,n,d.index+1+d[0].length+r),d,a),o>=l))return o;while(d);return o}static findNextMatch(e,t,n,r){const o=t.parseSearchRequest();if(!o)return null;const s=new iy(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(e,n,s,r):this._doFindNextMatchLineByLine(e,n,s,r)}static _doFindNextMatchMultiline(e,t,n,r){const o=new ae(t.lineNumber,1),s=e.getOffsetAt(o),a=e.getLineCount(),l=e.getValueInRange(new B(o.lineNumber,o.column,a,e.getLineMaxColumn(a)),1),c=e.getEOL()===`\r +`?new kie(l):null;n.reset(t.column-1);const u=n.next(l);return u?w0(this._getMultilineMatchRange(e,s,l,c,u.index,u[0]),u,r):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new ae(1,1),n,r):null}static _doFindNextMatchLineByLine(e,t,n,r){const o=e.getLineCount(),s=t.lineNumber,a=e.getLineContent(s),l=this._findFirstMatchInLine(n,a,s,t.column,r);if(l)return l;for(let c=1;c<=o;c++){const u=(s+c-1)%o,d=e.getLineContent(u+1),h=this._findFirstMatchInLine(n,d,u+1,1,r);if(h)return h}return null}static _findFirstMatchInLine(e,t,n,r,o){e.reset(r-1);const s=e.next(t);return s?w0(new B(n,s.index+1,n,s.index+1+s[0].length),s,o):null}static findPreviousMatch(e,t,n,r){const o=t.parseSearchRequest();if(!o)return null;const s=new iy(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(e,n,s,r):this._doFindPreviousMatchLineByLine(e,n,s,r)}static _doFindPreviousMatchMultiline(e,t,n,r){const o=this._doFindMatchesMultiline(e,new B(1,1,t.lineNumber,t.column),n,r,10*e9e);if(o.length>0)return o[o.length-1];const s=e.getLineCount();return t.lineNumber!==s||t.column!==e.getLineMaxColumn(s)?this._doFindPreviousMatchMultiline(e,new ae(s,e.getLineMaxColumn(s)),n,r):null}static _doFindPreviousMatchLineByLine(e,t,n,r){const o=e.getLineCount(),s=t.lineNumber,a=e.getLineContent(s).substring(0,t.column-1),l=this._findLastMatchInLine(n,a,s,r);if(l)return l;for(let c=1;c<=o;c++){const u=(o+s-c-1)%o,d=e.getLineContent(u+1),h=this._findLastMatchInLine(n,d,u+1,r);if(h)return h}return null}static _findLastMatchInLine(e,t,n,r){let o=null,s;for(e.reset(0);s=e.next(t);)o=w0(new B(n,s.index+1,n,s.index+1+s[0].length),s,r);return o}}function n9e(i,e,t,n,r){if(n===0)return!0;const o=e.charCodeAt(n-1);if(i.get(o)!==0||o===13||o===10)return!0;if(r>0){const s=e.charCodeAt(n);if(i.get(s)!==0)return!0}return!1}function i9e(i,e,t,n,r){if(n+r===t)return!0;const o=e.charCodeAt(n+r);if(i.get(o)!==0||o===13||o===10)return!0;if(r>0){const s=e.charCodeAt(n+r-1);if(i.get(s)!==0)return!0}return!1}function Pq(i,e,t,n,r){return n9e(i,e,t,n,r)&&i9e(i,e,t,n,r)}class iy{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){const t=e.length;let n;do{if(this._prevMatchStartIndex+this._prevMatchLength===t||(n=this._searchRegex.exec(e),!n))return null;const r=n.index,o=n[0].length;if(r===this._prevMatchStartIndex&&o===this._prevMatchLength){if(o===0){zA(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=r,this._prevMatchLength=o,!this._wordSeparators||Pq(this._wordSeparators,e,t,r,o))return n}while(n);return null}}class Oq{static computeUnicodeHighlights(e,t,n){const r=n?n.startLineNumber:1,o=n?n.endLineNumber:e.getLineCount(),s=new Tie(t),a=s.getCandidateCodePoints();let l;a==="allNonBasicAscii"?l=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):l=new RegExp(`${r9e(Array.from(a))}`,"g");const c=new iy(null,l),u=[];let d=!1,h,f=0,g=0,p=0;e:for(let v=r,m=o;v<=m;v++){const _=e.getLineContent(v),y=_.length;c.reset(0);do if(h=c.next(_),h){let S=h.index,L=h.index+h[0].length;if(S>0){const T=_.charCodeAt(S-1);xo(T)&&S--}if(L+1=T){d=!0;break e}u.push(new B(v,S+1,v,L+1))}}while(h)}return{ranges:u,hasMore:d,ambiguousCharacterCount:f,invisibleCharacterCount:g,nonBasicAsciiCharacterCount:p}}static computeUnicodeHighlightReason(e,t){const n=new Tie(t);switch(n.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const o=e.codePointAt(0),s=n.ambiguousCharacters.getPrimaryConfusable(o),a=Ib.getLocales().filter(l=>!Ib.getInstance(new Set([...t.allowedLocales,l])).isAmbiguous(o));return{kind:0,confusableWith:String.fromCodePoint(s),notAmbiguousInLocales:a}}case 1:return{kind:2}}}}function r9e(i,e){return`[${fc(i.map(n=>String.fromCodePoint(n)).join(""))}]`}class Tie{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=Ib.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of Nf.codePoints)Nie(String.fromCodePoint(t))||e.add(t);if(this.options.ambiguousCharacters)for(const t of this.ambiguousCharacters.getConfusableCodePoints())e.add(t);for(const t of this.allowedCodePoints)e.delete(t);return e}shouldHighlightNonBasicASCII(e,t){const n=e.codePointAt(0);if(this.allowedCodePoints.has(n))return 0;if(this.options.nonBasicASCII)return 1;let r=!1,o=!1;if(t)for(const s of t){const a=s.codePointAt(0),l=Tk(s);r=r||l,!l&&!this.ambiguousCharacters.isAmbiguous(a)&&!Nf.isInvisibleCharacter(a)&&(o=!0)}return!r&&o?0:this.options.invisibleCharacters&&!Nie(e)&&Nf.isInvisibleCharacter(n)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(n)?3:0}}function Nie(i){return i===" "||i===` +`||i===" "}class gM{constructor(e,t,n){this.changes=e,this.moves=t,this.hitTimeout=n}}class Bme{constructor(e,t){this.lineRangeMapping=e,this.changes=t}}class vn{static addRange(e,t){let n=0;for(;nt)throw new qi(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new vn(this.start+e,this.endExclusive+e)}deltaStart(e){return new vn(this.start+e,this.endExclusive)}deltaEnd(e){return new vn(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}contains(e){return this.start<=e&&e=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new qi(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new qi(`Invalid clipping range: ${this.toString()}`);return e=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let t=this.start;te.toString()).join(", ")}intersectsStrict(e){let t=0;for(;te+t.length,0)}}function RD(i,e,t){const n=o9e(i,e);if(n!==-1)return i[n]}function o9e(i,e,t=i.length-1){for(let n=t;n>=0;n--){const r=i[n];if(e(r))return n}return-1}function kw(i,e){const t=MD(i,e);return t===-1?void 0:i[t]}function MD(i,e,t=0,n=i.length){let r=t,o=n;for(;r0&&(t=r)}return t}function a9e(i,e){if(i.length===0)return;let t=i[0];for(let n=1;n=0&&(t=r)}return t}function l9e(i,e){return Bq(i,(t,n)=>-e(t,n))}function c9e(i,e){if(i.length===0)return-1;let t=0;for(let n=1;n0&&(t=n)}return t}function u9e(i,e){for(const t of i){const n=e(t);if(n!==void 0)return n}}let pn=class vm{static fromRangeInclusive(e){return new vm(e.startLineNumber,e.endLineNumber+1)}static joinMany(e){if(e.length===0)return[];let t=new Hu(e[0].slice());for(let n=1;nt)throw new qi(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&er.endLineNumberExclusive>=e.startLineNumber),n=MD(this._normalizedRanges,r=>r.startLineNumber<=e.endLineNumberExclusive)+1;if(t===n)this._normalizedRanges.splice(t,0,e);else if(t===n-1){const r=this._normalizedRanges[t];this._normalizedRanges[t]=r.join(e)}else{const r=this._normalizedRanges[t].join(this._normalizedRanges[n-1]).join(e);this._normalizedRanges.splice(t,n-t,r)}}contains(e){const t=kw(this._normalizedRanges,n=>n.startLineNumber<=e);return!!t&&t.endLineNumberExclusive>e}intersects(e){const t=kw(this._normalizedRanges,n=>n.startLineNumbere.startLineNumber}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;const t=[];let n=0,r=0,o=null;for(;n=s.startLineNumber?o=new pn(o.startLineNumber,Math.max(o.endLineNumberExclusive,s.endLineNumberExclusive)):(t.push(o),o=s)}return o!==null&&t.push(o),new Hu(t)}subtractFrom(e){const t=AD(this._normalizedRanges,s=>s.endLineNumberExclusive>=e.startLineNumber),n=MD(this._normalizedRanges,s=>s.startLineNumber<=e.endLineNumberExclusive)+1;if(t===n)return new Hu([e]);const r=[];let o=e.startLineNumber;for(let s=t;so&&r.push(new pn(o,a.startLineNumber)),o=a.endLineNumberExclusive}return oe.toString()).join(", ")}getIntersection(e){const t=[];let n=0,r=0;for(;nt.delta(e)))}}class Ya{static inverse(e,t,n){const r=[];let o=1,s=1;for(const l of e){const c=new Ya(new pn(o,l.original.startLineNumber),new pn(s,l.modified.startLineNumber));c.modified.isEmpty||r.push(c),o=l.original.endLineNumberExclusive,s=l.modified.endLineNumberExclusive}const a=new Ya(new pn(o,t+1),new pn(s,n+1));return a.modified.isEmpty||r.push(a),r}static clip(e,t,n){const r=[];for(const o of e){const s=o.original.intersect(t),a=o.modified.intersect(n);s&&!s.isEmpty&&a&&!a.isEmpty&&r.push(new Ya(s,a))}return r}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new Ya(this.modified,this.original)}join(e){return new Ya(this.original.join(e.original),this.modified.join(e.modified))}}class hh extends Ya{constructor(e,t,n){super(e,t),this.innerChanges=n}flip(){var e;return new hh(this.modified,this.original,(e=this.innerChanges)===null||e===void 0?void 0:e.map(t=>t.flip()))}}class qv{constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new qv(this.modifiedRange,this.originalRange)}}const d9e=3;class h9e{computeDiff(e,t,n){var r;const s=new p9e(e,t,{maxComputationTime:n.maxComputationTimeMs,shouldIgnoreTrimWhitespace:n.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),a=[];let l=null;for(const c of s.changes){let u;c.originalEndLineNumber===0?u=new pn(c.originalStartLineNumber+1,c.originalStartLineNumber+1):u=new pn(c.originalStartLineNumber,c.originalEndLineNumber+1);let d;c.modifiedEndLineNumber===0?d=new pn(c.modifiedStartLineNumber+1,c.modifiedStartLineNumber+1):d=new pn(c.modifiedStartLineNumber,c.modifiedEndLineNumber+1);let h=new hh(u,d,(r=c.charChanges)===null||r===void 0?void 0:r.map(f=>new qv(new B(f.originalStartLineNumber,f.originalStartColumn,f.originalEndLineNumber,f.originalEndColumn),new B(f.modifiedStartLineNumber,f.modifiedStartColumn,f.modifiedEndLineNumber,f.modifiedEndColumn))));l&&(l.modified.endLineNumberExclusive===h.modified.startLineNumber||l.original.endLineNumberExclusive===h.original.startLineNumber)&&(h=new hh(l.original.join(h.original),l.modified.join(h.modified),l.innerChanges&&h.innerChanges?l.innerChanges.concat(h.innerChanges):void 0),a.pop()),a.push(h),l=h}return Ew(()=>pme(a,(c,u)=>u.original.startLineNumber-c.original.endLineNumberExclusive===u.modified.startLineNumber-c.modified.endLineNumberExclusive&&c.original.endLineNumberExclusive(e===10?"\\n":String.fromCharCode(e))+`-(${this._lineNumbers[t]},${this._columns[t]})`).join(", ")+"]"}_assertIndex(e,t){if(e<0||e>=t.length)throw new Error("Illegal index")}getElements(){return this._charCodes}getStartLineNumber(e){return e>0&&e===this._lineNumbers.length?this.getEndLineNumber(e-1):(this._assertIndex(e,this._lineNumbers),this._lineNumbers[e])}getEndLineNumber(e){return e===-1?this.getStartLineNumber(e+1):(this._assertIndex(e,this._lineNumbers),this._charCodes[e]===10?this._lineNumbers[e]+1:this._lineNumbers[e])}getStartColumn(e){return e>0&&e===this._columns.length?this.getEndColumn(e-1):(this._assertIndex(e,this._columns),this._columns[e])}getEndColumn(e){return e===-1?this.getStartColumn(e+1):(this._assertIndex(e,this._columns),this._charCodes[e]===10?1:this._columns[e]+1)}}class Fy{constructor(e,t,n,r,o,s,a,l){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=n,this.originalEndColumn=r,this.modifiedStartLineNumber=o,this.modifiedStartColumn=s,this.modifiedEndLineNumber=a,this.modifiedEndColumn=l}static createFromDiffChange(e,t,n){const r=t.getStartLineNumber(e.originalStart),o=t.getStartColumn(e.originalStart),s=t.getEndLineNumber(e.originalStart+e.originalLength-1),a=t.getEndColumn(e.originalStart+e.originalLength-1),l=n.getStartLineNumber(e.modifiedStart),c=n.getStartColumn(e.modifiedStart),u=n.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),d=n.getEndColumn(e.modifiedStart+e.modifiedLength-1);return new Fy(r,o,s,a,l,c,u,d)}}function g9e(i){if(i.length<=1)return i;const e=[i[0]];let t=e[0];for(let n=1,r=i.length;n0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&o()){const f=n.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),g=r.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(f.getElements().length>0&&g.getElements().length>0){let p=Wme(f,g,o,!0).changes;a&&(p=g9e(p)),h=[];for(let v=0,m=p.length;v1&&p>1;){const v=h.charCodeAt(g-2),m=f.charCodeAt(p-2);if(v!==m)break;g--,p--}(g>1||p>1)&&this._pushTrimWhitespaceCharChange(r,o+1,1,g,s+1,1,p)}{let g=bH(h,1),p=bH(f,1);const v=h.length+1,m=f.length+1;for(;g!0;const e=Date.now();return()=>Date.now()-e{n.push(So.fromOffsetPairs(r?r.getEndExclusives():Gc.zero,o?o.getStarts():new Gc(t,(r?r.seq2Range.endExclusive-r.seq1Range.endExclusive:0)+t)))}),n}static fromOffsetPairs(e,t){return new So(new vn(e.offset1,t.offset1),new vn(e.offset2,t.offset2))}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new So(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new So(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new So(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new So(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new So(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersect(e){const t=this.seq1Range.intersect(e.seq1Range),n=this.seq2Range.intersect(e.seq2Range);if(!(!t||!n))return new So(t,n)}getStarts(){return new Gc(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new Gc(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}class Gc{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(e){return e===0?this:new Gc(this.offset1+e,this.offset2+e)}equals(e){return this.offset1===e.offset1&&this.offset2===e.offset2}}Gc.zero=new Gc(0,0);Gc.max=new Gc(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);class PD{isValid(){return!0}}PD.instance=new PD;class m9e{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new qi("timeout must be positive")}isValid(){if(!(Date.now()-this.startTime0&&p>0&&s.get(g-1,p-1)===3&&(_+=a.get(g-1,p-1)),_+=r?r(g,p):1):_=-1;const y=Math.max(v,m,_);if(y===_){const S=g>0&&p>0?a.get(g-1,p-1):0;a.set(g,p,S+1),s.set(g,p,3)}else y===v?(a.set(g,p,0),s.set(g,p,1)):y===m&&(a.set(g,p,0),s.set(g,p,2));o.set(g,p,y)}const l=[];let c=e.length,u=t.length;function d(g,p){(g+1!==c||p+1!==u)&&l.push(new So(new vn(g+1,c),new vn(p+1,u))),c=g,u=p}let h=e.length-1,f=t.length-1;for(;h>=0&&f>=0;)s.get(h,f)===3?(d(h,f),h--,f--):s.get(h,f)===1?h--:f--;return d(-1,-1),l.reverse(),new pp(l,!1)}}class $me{compute(e,t,n=PD.instance){if(e.length===0||t.length===0)return pp.trivial(e,t);const r=e,o=t;function s(p,v){for(;pr.length||S>o.length)continue;const L=s(y,S);l.set(u,L);const E=y===m?c.get(u+1):c.get(u-1);if(c.set(u,L!==y?new Aie(E,y,S,L-y):E),l.get(u)===r.length&&l.get(u)-u===o.length)break e}}let d=c.get(u);const h=[];let f=r.length,g=o.length;for(;;){const p=d?d.x+d.length:0,v=d?d.y+d.length:0;if((p!==f||v!==g)&&h.push(new So(new vn(p,f),new vn(v,g))),!d)break;f=d.x,g=d.y,d=d.prev}return h.reverse(),new pp(h,!1)}}class Aie{constructor(e,t,n,r){this.prev=e,this.x=t,this.y=n,this.length=r}}class _9e{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){if(e<0){if(e=-e-1,e>=this.negativeArr.length){const n=this.negativeArr;this.negativeArr=new Int32Array(n.length*2),this.negativeArr.set(n)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){const n=this.positiveArr;this.positiveArr=new Int32Array(n.length*2),this.positiveArr.set(n)}this.positiveArr[e]=t}}}class b9e{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){e<0?(e=-e-1,this.negativeArr[e]=t):this.positiveArr[e]=t}}var Pie,Oie;class C9e{constructor(e,t){this.uri=e,this.value=t}}function y9e(i){return Array.isArray(i)}class Tr{constructor(e,t){if(this[Pie]="ResourceMap",e instanceof Tr)this.map=new Map(e.map),this.toKey=t??Tr.defaultToKey;else if(y9e(e)){this.map=new Map,this.toKey=t??Tr.defaultToKey;for(const[n,r]of e)this.set(n,r)}else this.map=new Map,this.toKey=e??Tr.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new C9e(e,t)),this}get(e){var t;return(t=this.map.get(this.toKey(e)))===null||t===void 0?void 0:t.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){typeof t<"u"&&(e=e.bind(t));for(const[n,r]of this.map)e(r.value,r.uri,this)}*values(){for(const e of this.map.values())yield e.value}*keys(){for(const e of this.map.values())yield e.uri}*entries(){for(const e of this.map.values())yield[e.uri,e.value]}*[(Pie=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.map)yield[e.uri,e.value]}}Tr.defaultToKey=i=>i.toString();class w9e{constructor(){this[Oie]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var e;return(e=this._head)===null||e===void 0?void 0:e.value}get last(){var e;return(e=this._tail)===null||e===void 0?void 0:e.value}has(e){return this._map.has(e)}get(e,t=0){const n=this._map.get(e);if(n)return t!==0&&this.touch(n,t),n.value}set(e,t,n=0){let r=this._map.get(e);if(r)r.value=t,n!==0&&this.touch(r,n);else{switch(r={key:e,value:t,next:void 0,previous:void 0},n){case 0:this.addItemLast(r);break;case 1:this.addItemFirst(r);break;case 2:this.addItemLast(r);break;default:this.addItemLast(r);break}this._map.set(e,r),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 n=this._state;let r=this._head;for(;r;){if(t?e.bind(t)(r.value,r.key,this):e(r.value,r.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");r=r.next}}keys(){const e=this,t=this._state;let n=this._head;const r={[Symbol.iterator](){return r},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const o={value:n.key,done:!1};return n=n.next,o}else return{value:void 0,done:!0}}};return r}values(){const e=this,t=this._state;let n=this._head;const r={[Symbol.iterator](){return r},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const o={value:n.value,done:!1};return n=n.next,o}else return{value:void 0,done:!0}}};return r}entries(){const e=this,t=this._state;let n=this._head;const r={[Symbol.iterator](){return r},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const o={value:[n.key,n.value],done:!1};return n=n.next,o}else return{value:void 0,done:!0}}};return r}[(Oie=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const t=e.next,n=e.previous;if(!t||!n)throw new Error("Invalid list");t.previous=n,n.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==1&&t!==2)){if(t===1){if(e===this._head)return;const n=e.next,r=e.previous;e===this._tail?(r.next=void 0,this._tail=r):(n.previous=r,r.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===2){if(e===this._tail)return;const n=e.next,r=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=r,r.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){const e=[];return this.forEach((t,n)=>{e.push([n,t])}),e}fromJSON(e){this.clear();for(const[t,n]of e)this.set(t,n)}}class E_ extends w9e{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))}}class S9e{constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(const[t,n]of e)this.set(t,n)}clear(){this._m1.clear(),this._m2.clear()}set(e,t){this._m1.set(e,t),this._m2.set(t,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){const t=this._m1.get(e);return t===void 0?!1:(this._m1.delete(e),this._m2.delete(t),!0)}keys(){return this._m1.keys()}values(){return this._m1.values()}}class Wq{constructor(){this.map=new Map}add(e,t){let n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(t)}delete(e,t){const n=this.map.get(e);n&&(n.delete(t),n.size===0&&this.map.delete(e))}forEach(e,t){const n=this.map.get(e);n&&n.forEach(t)}get(e){const t=this.map.get(e);return t||new Set}}class tP{constructor(e,t,n){this.lines=e,this.considerWhitespaceChanges=n,this.elements=[],this.firstCharOffsetByLine=[],this.additionalOffsetByLine=[];let r=!1;t.start>0&&t.endExclusive>=e.length&&(t=new vn(t.start-1,t.endExclusive),r=!0),this.lineRange=t,this.firstCharOffsetByLine[0]=0;for(let o=this.lineRange.start;oString.fromCharCode(t)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=Bie(e>0?this.elements[e-1]:-1),n=Bie(en<=e);return new ae(this.lineRange.start+t+1,e-this.firstCharOffsetByLine[t]+this.additionalOffsetByLine[t]+1)}translateRange(e){return B.fromPositions(this.translateOffset(e.start),this.translateOffset(e.endExclusive))}findWordContaining(e){if(e<0||e>=this.elements.length||!S6(this.elements[e]))return;let t=e;for(;t>0&&S6(this.elements[t-1]);)t--;let n=e;for(;ns<=e.start))!==null&&t!==void 0?t:0,o=(n=s9e(this.firstCharOffsetByLine,s=>e.endExclusive<=s))!==null&&n!==void 0?n:this.elements.length;return new vn(r,o)}}function S6(i){return i>=97&&i<=122||i>=65&&i<=90||i>=48&&i<=57}const x9e={[0]:0,[1]:0,[2]:0,[3]:10,[4]:2,[5]:30,[6]:3,[7]:10,[8]:10};function Fie(i){return x9e[i]}function Bie(i){return i===10?8:i===13?7:CH(i)?6:i>=97&&i<=122?0:i>=65&&i<=90?1:i>=48&&i<=57?2:i===-1?3:i===44||i===59?5:4}function L9e(i,e,t,n,r,o){let{moves:s,excludedChanges:a}=D9e(i,e,t,o);if(!o.isValid())return[];const l=i.filter(u=>!a.has(u)),c=I9e(l,n,r,e,t,o);return t$(s,c),s=k9e(s),s=s.filter(u=>{const d=u.original.toOffsetRange().slice(e).map(f=>f.trim());return d.join(` `).length>=15&&E9e(d,f=>f.length>=2)>=2}),s=T9e(i,s),s}function E9e(i,e){let t=0;for(const n of i)e(n)&&t++;return t}function D9e(i,e,t,n){const r=[],o=i.filter(l=>l.modified.isEmpty&&l.original.length>=3).map(l=>new Tw(l.original,e,l)),s=new Set(i.filter(l=>l.original.isEmpty&&l.modified.length>=3).map(l=>new Tw(l.modified,t,l))),a=new Set;for(const l of o){let c=-1,u;for(const d of s){const h=l.computeSimilarity(d);h>c&&(c=h,u=d)}if(c>.9&&u&&(s.delete(u),r.push(new Ya(l.range,u.range)),a.add(l.source),a.add(u.source)),!n.isValid())return{moves:r,excludedChanges:a}}return{moves:r,excludedChanges:a}}function I9e(i,e,t,n,r,o){const s=[],a=new Wq;for(const h of i)for(let f=h.original.startLineNumber;fh.modified.startLineNumber,dp));for(const h of i){let f=[];for(let g=h.modified.startLineNumber;g{for(const S of f)if(S.originalLineRange.endLineNumberExclusive+1===_.endLineNumberExclusive&&S.modifiedLineRange.endLineNumberExclusive+1===v.endLineNumberExclusive){S.originalLineRange=new pn(S.originalLineRange.startLineNumber,_.endLineNumberExclusive),S.modifiedLineRange=new pn(S.modifiedLineRange.startLineNumber,v.endLineNumberExclusive),m.push(S);return}const y={modifiedLineRange:v,originalLineRange:_};l.push(y),m.push(y)}),f=m}if(!o.isValid())return[]}l.sort(npe(Jc(h=>h.modifiedLineRange.length,dp)));const c=new Hu,u=new Hu;for(const h of l){const f=h.modifiedLineRange.startLineNumber-h.originalLineRange.startLineNumber,g=c.subtractFrom(h.modifiedLineRange),p=u.subtractFrom(h.originalLineRange).getWithDelta(f),v=g.getIntersection(p);for(const m of v.ranges){if(m.length<3)continue;const _=m,y=m.delta(-f);s.push(new Ya(y,_)),c.addRange(_),u.addRange(y)}}s.sort(Jc(h=>h.original.startLineNumber,dp));const d=new Pk(i);for(let h=0;hE.original.startLineNumber<=f.original.startLineNumber),p=kw(i,E=>E.modified.startLineNumber<=f.modified.startLineNumber),v=Math.max(f.original.startLineNumber-g.original.startLineNumber,f.modified.startLineNumber-p.modified.startLineNumber),m=d.findLastMonotonous(E=>E.original.startLineNumberE.modified.startLineNumbern.length||D>r.length||c.contains(D)||u.contains(E)||!Wie(n[E-1],r[D-1],o))break}S>0&&(u.addRange(new pn(f.original.startLineNumber-S,f.original.startLineNumber)),c.addRange(new pn(f.modified.startLineNumber-S,f.modified.startLineNumber)));let L;for(L=0;Ln.length||D>r.length||c.contains(D)||u.contains(E)||!Wie(n[E-1],r[D-1],o))break}L>0&&(u.addRange(new pn(f.original.endLineNumberExclusive,f.original.endLineNumberExclusive+L)),c.addRange(new pn(f.modified.endLineNumberExclusive,f.modified.endLineNumberExclusive+L))),(S>0||L>0)&&(s[h]=new Ya(new pn(f.original.startLineNumber-S,f.original.endLineNumberExclusive+L),new pn(f.modified.startLineNumber-S,f.modified.endLineNumberExclusive+L)))}return s}function Wie(i,e,t){if(i.trim()===e.trim())return!0;if(i.length>300&&e.length>300)return!1;const r=new $me().compute(new tP([i],new vn(0,1),!1),new tP([e],new vn(0,1),!1),t);let o=0;const s=So.invert(r.diffs,i.length);for(const u of s)u.seq1Range.forEach(d=>{CH(i.charCodeAt(d))||o++});function a(u){let d=0;for(let h=0;he.length?i:e);return o/l>.6&&l>10}function k9e(i){if(i.length===0)return i;i.sort(Jc(t=>t.original.startLineNumber,dp));const e=[i[0]];for(let t=1;t=0&&s>=0&&o+s<=2){e[e.length-1]=n.join(r);continue}e.push(r)}return e}function T9e(i,e){const t=new Pk(i);return e=e.filter(n=>{const r=t.findLastMonotonous(a=>a.original.startLineNumbera.modified.startLineNumber0&&(a=a.delta(c))}r.push(a)}return n.length>0&&r.push(n[n.length-1]),r}function N9e(i,e,t){if(!i.getBoundaryScore||!e.getBoundaryScore)return t;for(let n=0;n0?t[n-1]:void 0,o=t[n],s=n+1=n.start&&i.seq2Range.start-s>=r.start&&t.isStronglyEqual(i.seq2Range.start-s,i.seq2Range.endExclusive-s)&&s<100;)s++;s--;let a=0;for(;i.seq1Range.start+ac&&(c=g,l=u)}return i.delta(l)}function R9e(i,e,t){const n=[];for(const r of t){const o=n[n.length-1];if(!o){n.push(r);continue}r.seq1Range.start-o.seq1Range.endExclusive<=2||r.seq2Range.start-o.seq2Range.endExclusive<=2?n[n.length-1]=new So(o.seq1Range.join(r.seq1Range),o.seq2Range.join(r.seq2Range)):n.push(r)}return n}function M9e(i,e,t){const n=So.invert(t,i.length),r=[];let o=new Gc(0,0);function s(l,c){if(l.offset10;){const v=n[0];if(!(v.seq1Range.intersects(u)||v.seq2Range.intersects(d)))break;const _=i.findWordContaining(v.seq1Range.start),y=e.findWordContaining(v.seq2Range.start),S=new So(_,y),L=S.intersect(v);if(g+=L.seq1Range.length,p+=L.seq2Range.length,h=h.join(S),h.seq1Range.endExclusive>=v.seq1Range.endExclusive)n.shift();else break}g+p<(h.seq1Range.length+h.seq2Range.length)*2/3&&r.push(h),o=h.getEndExclusives()}for(;n.length>0;){const l=n.shift();l.seq1Range.isEmpty||(s(l.getStarts(),l),s(l.getEndExclusives().delta(-1),l))}return A9e(t,r)}function A9e(i,e){const t=[];for(;i.length>0||e.length>0;){const n=i[0],r=e[0];let o;n&&(!r||n.seq1Range.start0&&t[t.length-1].seq1Range.endExclusive>=o.seq1Range.start?t[t.length-1]=t[t.length-1].join(o):t.push(o)}return t}function P9e(i,e,t){let n=t;if(n.length===0)return n;let r=0,o;do{o=!1;const s=[n[0]];for(let a=1;a5||f.seq1Range.length+f.seq2Range.length>5)};const l=n[a],c=s[s.length-1];u(c,l)?(o=!0,s[s.length-1]=s[s.length-1].join(l)):s.push(l)}n=s}while(r++<10&&o);return n}function O9e(i,e,t){let n=t;if(n.length===0)return n;let r=0,o;do{o=!1;const a=[n[0]];for(let l=1;l5||p.length>500)return!1;const m=i.getText(p).trim();if(m.length>20||m.split(/\r\n|\r|\n/).length>1)return!1;const _=i.countLinesIn(f.seq1Range),y=f.seq1Range.length,S=e.countLinesIn(f.seq2Range),L=f.seq2Range.length,E=i.countLinesIn(g.seq1Range),D=g.seq1Range.length,k=e.countLinesIn(g.seq2Range),T=g.seq2Range.length,M=2*40+50;function A(N){return Math.min(N,M)}return Math.pow(Math.pow(A(_*40+y),1.5)+Math.pow(A(S*40+L),1.5),1.5)+Math.pow(Math.pow(A(E*40+D),1.5)+Math.pow(A(k*40+T),1.5),1.5)>(M**1.5)**1.5*1.3};const c=n[l],u=a[a.length-1];d(u,c)?(o=!0,a[a.length-1]=a[a.length-1].join(c)):a.push(c)}n=a}while(r++<10&&o);const s=[];return A4e(n,(a,l,c)=>{let u=l;function d(m){return m.length>0&&m.trim().length<=3&&l.seq1Range.length+l.seq2Range.length>100}const h=i.extendToFullLines(l.seq1Range),f=i.getText(new vn(h.start,l.seq1Range.start));d(f)&&(u=u.deltaStart(-f.length));const g=i.getText(new vn(l.seq1Range.endExclusive,h.endExclusive));d(g)&&(u=u.deltaEnd(g.length));const p=So.fromOffsetPairs(a?a.getEndExclusives():Gc.zero,c?c.getStarts():Gc.max),v=u.intersect(p);s.length>0&&v.getStarts().equals(s[s.length-1].getEndExclusives())?s[s.length-1]=s[s.length-1].join(v):s.push(v)}),s}class Vie{constructor(e,t){this.trimmedHash=e,this.lines=t}getElement(e){return this.trimmedHash[e]}get length(){return this.trimmedHash.length}getBoundaryScore(e){const t=e===0?0:zie(this.lines[e-1]),n=e===this.lines.length?0:zie(this.lines[e]);return 1e3-(t+n)}getText(e){return this.lines.slice(e.start,e.endExclusive).join(` -`)}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function zie(i){let e=0;for(;eL===E))return new gM([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new gM([new hh(new pn(1,e.length+1),new pn(1,t.length+1),[new Xv(new B(1,1,e.length,e[0].length+1),new B(1,1,t.length,t[0].length+1))])],[],!1);const r=n.maxComputationTimeMs===0?PD.instance:new m9e(n.maxComputationTimeMs),o=!n.ignoreTrimWhitespace,s=new Map;function a(L){let E=s.get(L);return E===void 0&&(E=s.size,s.set(L,E)),E}const l=e.map(L=>a(L.trim())),c=t.map(L=>a(L.trim())),u=new Vie(l,e),d=new Vie(c,t),h=(()=>u.length+d.length<1700?this.dynamicProgrammingDiffing.compute(u,d,r,(L,E)=>e[L]===t[E]?t[E].length===0?.1:1+Math.log(1+t[E].length):.99):this.myersDiffingAlgorithm.compute(u,d))();let f=h.diffs,g=h.hitTimeout;f=yH(u,d,f),f=P9e(u,d,f);const p=[],v=L=>{if(o)for(let E=0;EL.seq1Range.start-m===L.seq2Range.start-_);const E=L.seq1Range.start-m;v(E),m=L.seq1Range.endExclusive,_=L.seq2Range.endExclusive;const D=this.refineDiff(e,t,L,r,o);D.hitTimeout&&(g=!0);for(const k of D.mappings)p.push(k)}v(e.length-m);const y=Uie(p,e,t);let S=[];return n.computeMoves&&(S=this.computeMoves(y,e,t,l,c,r,o)),Ew(()=>{function L(D,k){if(D.lineNumber<1||D.lineNumber>k.length)return!1;const T=k[D.lineNumber-1];return!(D.column<1||D.column>T.length+1)}function E(D,k){return!(D.startLineNumber<1||D.startLineNumber>k.length+1||D.endLineNumberExclusive<1||D.endLineNumberExclusive>k.length+1)}for(const D of y){if(!D.innerChanges)return!1;for(const k of D.innerChanges)if(!(L(k.modifiedRange.getStartPosition(),t)&&L(k.modifiedRange.getEndPosition(),t)&&L(k.originalRange.getStartPosition(),e)&&L(k.originalRange.getEndPosition(),e)))return!1;if(!E(D.modified,t)||!E(D.original,e))return!1}return!0}),new gM(y,S,g)}computeMoves(e,t,n,r,o,s,a){return L9e(e,t,n,r,o,s).map(u=>{const d=this.refineDiff(t,n,new So(u.original.toOffsetRange(),u.modified.toOffsetRange()),s,a),h=Uie(d.mappings,t,n,!0);return new Bme(u,h)})}refineDiff(e,t,n,r,o){const s=new tP(e,n.seq1Range,o),a=new tP(t,n.seq2Range,o),l=s.length+a.length<500?this.dynamicProgrammingDiffing.compute(s,a,r):this.myersDiffingAlgorithm.compute(s,a,r);let c=l.diffs;return c=yH(s,a,c),c=M9e(s,a,c),c=R9e(s,a,c),c=O9e(s,a,c),{mappings:c.map(d=>new Xv(s.translateRange(d.seq1Range),a.translateRange(d.seq2Range))),hitTimeout:l.hitTimeout}}}function Uie(i,e,t,n=!1){const r=[];for(const o of QG(i.map(s=>F9e(s,e,t)),(s,a)=>s.original.overlapOrTouch(a.original)||s.modified.overlapOrTouch(a.modified))){const s=o[0],a=o[o.length-1];r.push(new hh(s.original.join(a.original),s.modified.join(a.modified),o.map(l=>l.innerChanges[0])))}return Ew(()=>!n&&r.length>0&&r[0].original.startLineNumber!==r[0].modified.startLineNumber?!1:pme(r,(o,s)=>s.original.startLineNumber-o.original.endLineNumberExclusive===s.modified.startLineNumber-o.modified.endLineNumberExclusive&&o.original.endLineNumberExclusive=t[i.modifiedRange.startLineNumber-1].length&&i.originalRange.startColumn-1>=e[i.originalRange.startLineNumber-1].length&&i.originalRange.startLineNumber<=i.originalRange.endLineNumber+r&&i.modifiedRange.startLineNumber<=i.modifiedRange.endLineNumber+r&&(n=1);const o=new pn(i.originalRange.startLineNumber+n,i.originalRange.endLineNumber+1+r),s=new pn(i.modifiedRange.startLineNumber+n,i.modifiedRange.endLineNumber+1+r);return new hh(o,s,[i])}const jie={getLegacy:()=>new h9e,getDefault:()=>new Hme};function _v(i,e){const t=Math.pow(10,e);return Math.round(i*t)/t}class Tn{constructor(e,t,n,r=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,e))|0,this.g=Math.min(255,Math.max(0,t))|0,this.b=Math.min(255,Math.max(0,n))|0,this.a=_v(Math.max(Math.min(1,r),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class $u{constructor(e,t,n,r){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=_v(Math.max(Math.min(1,t),0),3),this.l=_v(Math.max(Math.min(1,n),0),3),this.a=_v(Math.max(Math.min(1,r),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,n=e.g/255,r=e.b/255,o=e.a,s=Math.max(t,n,r),a=Math.min(t,n,r);let l=0,c=0;const u=(a+s)/2,d=s-a;if(d>0){switch(c=Math.min(u<=.5?d/(2*u):d/(2-2*u),1),s){case t:l=(n-r)/d+(n1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}static toRGBA(e){const t=e.h/360,{s:n,l:r,a:o}=e;let s,a,l;if(n===0)s=a=l=r;else{const c=r<.5?r*(1+n):r+n-r*n,u=2*r-c;s=$u._hue2rgb(u,c,t+1/3),a=$u._hue2rgb(u,c,t),l=$u._hue2rgb(u,c,t-1/3)}return new Tn(Math.round(s*255),Math.round(a*255),Math.round(l*255),o)}}class bf{constructor(e,t,n,r){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=_v(Math.max(Math.min(1,t),0),3),this.v=_v(Math.max(Math.min(1,n),0),3),this.a=_v(Math.max(Math.min(1,r),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,n=e.g/255,r=e.b/255,o=Math.max(t,n,r),s=Math.min(t,n,r),a=o-s,l=o===0?0:a/o;let c;return a===0?c=0:o===t?c=((n-r)/a%6+6)%6:o===n?c=(r-t)/a+2:c=(t-n)/a+4,new bf(Math.round(c*60),l,o,e.a)}static toRGBA(e){const{h:t,s:n,v:r,a:o}=e,s=r*n,a=s*(1-Math.abs(t/60%2-1)),l=r-s;let[c,u,d]=[0,0,0];return t<60?(c=s,u=a):t<120?(c=a,u=s):t<180?(u=s,d=a):t<240?(u=a,d=s):t<300?(c=a,d=s):t<=360&&(c=s,d=a),c=Math.round((c+l)*255),u=Math.round((u+l)*255),d=Math.round((d+l)*255),new Tn(c,u,d,o)}}class me{static fromHex(e){return me.Format.CSS.parseHex(e)||me.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:$u.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:bf.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof Tn)this.rgba=e;else if(e instanceof $u)this._hsla=e,this.rgba=$u.toRGBA(e);else if(e instanceof bf)this._hsva=e,this.rgba=bf.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&Tn.equals(this.rgba,e.rgba)&&$u.equals(this.hsla,e.hsla)&&bf.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=me._relativeLuminanceForComponent(this.rgba.r),t=me._relativeLuminanceForComponent(this.rgba.g),n=me._relativeLuminanceForComponent(this.rgba.b),r=.2126*e+.7152*t+.0722*n;return _v(r,4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}isLighter(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3>=128}isLighterThan(e){const t=this.getRelativeLuminance(),n=e.getRelativeLuminance();return t>n}isDarkerThan(e){const t=this.getRelativeLuminance(),n=e.getRelativeLuminance();return t0)for(const r of n){const o=r.filter(c=>c!==void 0),s=o[1],a=o[2];if(!a)continue;let l;if(s==="rgb"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;l=Kie(Ax(i,r),Px(a,c),!1)}else if(s==="rgba"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=Kie(Ax(i,r),Px(a,c),!0)}else if(s==="hsl"){const c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;l=Gie(Ax(i,r),Px(a,c),!1)}else if(s==="hsla"){const c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=Gie(Ax(i,r),Px(a,c),!0)}else s==="#"&&(l=B9e(Ax(i,r),s+a));l&&e.push(l)}return e}function $9e(i){return!i||typeof i.getValue!="function"||typeof i.positionAt!="function"?[]:W9e(i)}class H9e extends z6e{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}findMatches(e){const t=[];for(let n=0;nthis._lines.length)t=this._lines.length,n=this._lines[t-1].length+1,r=!0;else{const o=this._lines[t-1].length+1;n<1?(n=1,r=!0):n>o&&(n=o,r=!0)}return r?{lineNumber:t,column:n}:e}}class bv{constructor(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(e){return this._models[e]}_getModels(){const e=[];return Object.keys(this._models).forEach(t=>e.push(this._models[t])),e}acceptNewModel(e){this._models[e.url]=new H9e(At.parse(e.url),e.lines,e.EOL,e.versionId)}acceptModelChanged(e,t){if(!this._models[e])return;this._models[e].onEvents(t)}acceptRemovedModel(e){this._models[e]&&delete this._models[e]}async computeUnicodeHighlights(e,t,n){const r=this._getModel(e);return r?Oq.computeUnicodeHighlights(r,t,n):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}}async computeDiff(e,t,n,r){const o=this._getModel(e),s=this._getModel(t);return!o||!s?null:bv.computeDiff(o,s,n,r)}static computeDiff(e,t,n,r){const o=r==="advanced"?jie.getDefault():jie.getLegacy(),s=e.getLinesContent(),a=t.getLinesContent(),l=o.computeDiff(s,a,n),c=l.changes.length>0?!1:this._modelsAreIdentical(e,t);function u(d){return d.map(h=>{var f;return[h.original.startLineNumber,h.original.endLineNumberExclusive,h.modified.startLineNumber,h.modified.endLineNumberExclusive,(f=h.innerChanges)===null||f===void 0?void 0:f.map(g=>[g.originalRange.startLineNumber,g.originalRange.startColumn,g.originalRange.endLineNumber,g.originalRange.endColumn,g.modifiedRange.startLineNumber,g.modifiedRange.startColumn,g.modifiedRange.endLineNumber,g.modifiedRange.endColumn])]})}return{identical:c,quitEarly:l.hitTimeout,changes:u(l.changes),moves:l.moves.map(d=>[d.lineRangeMapping.original.startLineNumber,d.lineRangeMapping.original.endLineNumberExclusive,d.lineRangeMapping.modified.startLineNumber,d.lineRangeMapping.modified.endLineNumberExclusive,u(d.changes)])}}static _modelsAreIdentical(e,t){const n=e.getLineCount(),r=t.getLineCount();if(n!==r)return!1;for(let o=1;o<=n;o++){const s=e.getLineContent(o),a=t.getLineContent(o);if(s!==a)return!1}return!0}async computeMoreMinimalEdits(e,t,n){const r=this._getModel(e);if(!r)return t;const o=[];let s;t=t.slice(0).sort((l,c)=>{if(l.range&&c.range)return B.compareRangesUsingStarts(l.range,c.range);const u=l.range?0:1,d=c.range?0:1;return u-d});let a=0;for(let l=1;lbv._diffLimit){o.push({range:l,text:c});continue}const h=$6e(d,c,n),f=r.offsetAt(B.lift(l).getStartPosition());for(const g of h){const p=r.positionAt(f+g.originalStart),v=r.positionAt(f+g.originalStart+g.originalLength),m={text:c.substr(g.modifiedStart,g.modifiedLength),range:{startLineNumber:p.lineNumber,startColumn:p.column,endLineNumber:v.lineNumber,endColumn:v.column}};r.getValueInRange(m.range)!==m.text&&o.push(m)}}return typeof s=="number"&&o.push({eol:s,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),o}async computeLinks(e){const t=this._getModel(e);return t?q6e(t):null}async computeDefaultDocumentColors(e){const t=this._getModel(e);return t?$9e(t):null}async textualSuggest(e,t,n,r){const o=new Ms,s=new RegExp(n,r),a=new Set;e:for(const l of e){const c=this._getModel(l);if(c){for(const u of c.words(s))if(!(u===t||!isNaN(Number(u)))&&(a.add(u),a.size>bv._suggestionsLimit))break e}}return{words:Array.from(a),duration:o.elapsed()}}async computeWordRanges(e,t,n,r){const o=this._getModel(e);if(!o)return Object.create(null);const s=new RegExp(n,r),a=Object.create(null);for(let l=t.startLineNumber;lthis._host.fhr(a,l)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(s,t),Promise.resolve(tq(this._foreignModule))):Promise.reject(new Error("Unexpected usage"))}fmr(e,t){if(!this._foreignModule||typeof this._foreignModule[e]!="function")return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(n){return Promise.reject(n)}}}bv._diffLimit=1e5;bv._suggestionsLimit=1e4;typeof importScripts=="function"&&(globalThis.monaco=Npe());const Hq=yn("textResourceConfigurationService"),zme=yn("textResourcePropertiesService"),_t=yn("ILanguageFeaturesService");var V9e=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Ox=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const qie=60*1e3,Xie=5*60*1e3;function x0(i,e){const t=i.getModel(e);return!(!t||t.isTooLargeForSyncing())}let wH=class extends fe{constructor(e,t,n,r,o){super(),this._modelService=e,this._workerManager=this._register(new U9e(this._modelService,r)),this._logService=n,this._register(o.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(s,a)=>x0(this._modelService,s.uri)?this._workerManager.withWorker().then(l=>l.computeLinks(s.uri)).then(l=>l&&{links:l}):Promise.resolve({links:[]})})),this._register(o.completionProvider.register("*",new z9e(this._workerManager,t,this._modelService,r)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return x0(this._modelService,e)}computedUnicodeHighlights(e,t,n){return this._workerManager.withWorker().then(r=>r.computedUnicodeHighlights(e,t,n))}async computeDiff(e,t,n,r){const o=await this._workerManager.withWorker().then(l=>l.computeDiff(e,t,n,r));if(!o)return null;return{identical:o.identical,quitEarly:o.quitEarly,changes:a(o.changes),moves:o.moves.map(l=>new Bme(new Ya(new pn(l[0],l[1]),new pn(l[2],l[3])),a(l[4])))};function a(l){return l.map(c=>{var u;return new hh(new pn(c[0],c[1]),new pn(c[2],c[3]),(u=c[4])===null||u===void 0?void 0:u.map(d=>new Xv(new B(d[0],d[1],d[2],d[3]),new B(d[4],d[5],d[6],d[7]))))})}}computeMoreMinimalEdits(e,t,n=!1){if(Ts(t)){if(!x0(this._modelService,e))return Promise.resolve(t);const r=Ms.create(),o=this._workerManager.withWorker().then(s=>s.computeMoreMinimalEdits(e,t,n));return o.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),r.elapsed())),Promise.race([o,jv(1e3).then(()=>t)])}else return Promise.resolve(void 0)}canNavigateValueSet(e){return x0(this._modelService,e)}navigateValueSet(e,t,n){return this._workerManager.withWorker().then(r=>r.navigateValueSet(e,t,n))}canComputeWordRanges(e){return x0(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then(n=>n.computeWordRanges(e,t))}};wH=V9e([Ox(0,tr),Ox(1,Hq),Ox(2,Ta),Ox(3,Di),Ox(4,_t)],wH);class z9e{constructor(e,t,n,r){this.languageConfigurationService=r,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=n}async provideCompletionItems(e,t){const n=this._configurationService.getValue(e.uri,t,"editor");if(n.wordBasedSuggestions==="off")return;const r=[];if(n.wordBasedSuggestions==="currentDocument")x0(this._modelService,e.uri)&&r.push(e.uri);else for(const d of this._modelService.getModels())x0(this._modelService,d.uri)&&(d===e?r.unshift(d.uri):(n.wordBasedSuggestions==="allDocuments"||d.getLanguageId()===e.getLanguageId())&&r.push(d.uri));if(r.length===0)return;const o=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),s=e.getWordAtPosition(t),a=s?new B(t.lineNumber,s.startColumn,t.lineNumber,s.endColumn):B.fromPositions(t),l=a.setEndPosition(t.lineNumber,t.column),u=await(await this._workerManager.withWorker()).textualSuggest(r,s==null?void 0:s.word,o);if(u)return{duration:u.duration,suggestions:u.words.map(d=>({kind:18,label:d,insertText:d,range:{insert:l,replace:a}}))}}}class U9e extends fe{constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new Eq).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(Xie/2),M5e),this._register(this._modelService.onModelRemoved(r=>this._checkStopEmptyWorker()))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){if(!this._editorWorkerClient)return;this._modelService.getModels().length===0&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){if(!this._editorWorkerClient)return;new Date().getTime()-this._lastWorkerUsedTime>Xie&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new Vq(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class j9e extends fe{constructor(e,t,n){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!n){const r=new Sq;r.cancelAndSet(()=>this._checkStopModelSync(),Math.round(qie/2)),this._register(r)}}dispose(){for(const e in this._syncedModels)si(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){for(const n of e){const r=n.toString();this._syncedModels[r]||this._beginModelSync(n,t),this._syncedModels[r]&&(this._syncedModelsLastUsedTime[r]=new Date().getTime())}}_checkStopModelSync(){const e=new Date().getTime(),t=[];for(const n in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[n]>qie&&t.push(n);for(const n of t)this._stopModelSync(n)}_beginModelSync(e,t){const n=this._modelService.getModel(e);if(!n||!t&&n.isTooLargeForSyncing())return;const r=e.toString();this._proxy.acceptNewModel({url:n.uri.toString(),lines:n.getLinesContent(),EOL:n.getEOL(),versionId:n.getVersionId()});const o=new Te;o.add(n.onDidChangeContent(s=>{this._proxy.acceptModelChanged(r.toString(),s)})),o.add(n.onWillDispose(()=>{this._stopModelSync(r)})),o.add(Rt(()=>{this._proxy.acceptRemovedModel(r)})),this._syncedModels[r]=o}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],si(t)}}class Yie{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class x6{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class Vq extends fe{constructor(e,t,n,r){super(),this.languageConfigurationService=r,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new x4(n),this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(new J8e(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new x6(this)))}catch(e){fH(e),this._worker=new Yie(new bv(new x6(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(fH(e),this._worker=new Yie(new bv(new x6(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new j9e(e,this._modelService,this._keepIdleModels))),this._modelManager}async _withSyncedResources(e,t=!1){return this._disposed?Promise.reject(q3e()):this._getProxy().then(n=>(this._getOrCreateModelManager(n).ensureSyncedResources(e,t),n))}computedUnicodeHighlights(e,t,n){return this._withSyncedResources([e]).then(r=>r.computeUnicodeHighlights(e.toString(),t,n))}computeDiff(e,t,n,r){return this._withSyncedResources([e,t],!0).then(o=>o.computeDiff(e.toString(),t.toString(),n,r))}computeMoreMinimalEdits(e,t,n){return this._withSyncedResources([e]).then(r=>r.computeMoreMinimalEdits(e.toString(),t,n))}computeLinks(e){return this._withSyncedResources([e]).then(t=>t.computeLinks(e.toString()))}computeDefaultDocumentColors(e){return this._withSyncedResources([e]).then(t=>t.computeDefaultDocumentColors(e.toString()))}async textualSuggest(e,t,n){const r=await this._withSyncedResources(e),o=n.source,s=n.flags;return r.textualSuggest(e.map(a=>a.toString()),t,o,s)}computeWordRanges(e,t){return this._withSyncedResources([e]).then(n=>{const r=this._modelService.getModel(e);if(!r)return Promise.resolve(null);const o=this.languageConfigurationService.getLanguageConfiguration(r.getLanguageId()).getWordDefinition(),s=o.source,a=o.flags;return n.computeWordRanges(e.toString(),t,s,a)})}navigateValueSet(e,t,n){return this._withSyncedResources([e]).then(r=>{const o=this._modelService.getModel(e);if(!o)return null;const s=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId()).getWordDefinition(),a=s.source,l=s.flags;return r.navigateValueSet(e.toString(),t,n,a,l)})}dispose(){super.dispose(),this._disposed=!0}}function K9e(i,e,t){return new G9e(i,e,t)}class G9e extends Vq{constructor(e,t,n){super(e,n.keepIdleModels||!1,n.label,t),this._foreignModuleId=n.moduleId,this._foreignModuleCreateData=n.createData||null,this._foreignModuleHost=n.host||null,this._foreignProxy=null}fhr(e,t){if(!this._foreignModuleHost||typeof this._foreignModuleHost[e]!="function")return Promise.reject(new Error("Missing method "+e+" or missing main thread foreign host."));try{return Promise.resolve(this._foreignModuleHost[e].apply(this._foreignModuleHost,t))}catch(n){return Promise.reject(n)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then(e=>{const t=this._foreignModuleHost?tq(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then(n=>{this._foreignModuleCreateData=null;const r=(a,l)=>e.fmr(a,l),o=(a,l)=>function(){const c=Array.prototype.slice.call(arguments,0);return l(a,c)},s={};for(const a of n)s[a]=o(a,r);return s})})),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then(t=>this.getProxy())}}const Ok={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"},Nw=new class{clone(){return this}equals(i){return this===i}};function zq(i,e){return new fq([new wD(0,"",i)],e)}function T4(i,e){const t=new Uint32Array(2);return t[0]=0,t[1]=(i<<0|0<<8|0<<11|1<<15|2<<24)>>>0,new s4(t,e===null?Nw:e)}class us{static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static getClassNameFromMetadata(e){let n="mtk"+this.getForeground(e);const r=this.getFontStyle(e);return r&1&&(n+=" mtki"),r&2&&(n+=" mtkb"),r&4&&(n+=" mtku"),r&8&&(n+=" mtks"),n}static getInlineStyleFromMetadata(e,t){const n=this.getForeground(e),r=this.getFontStyle(e);let o=`color: ${t[n]};`;r&1&&(o+="font-style: italic;"),r&2&&(o+="font-weight: bold;");let s="";return r&4&&(s+=" underline"),r&8&&(s+=" line-through"),s&&(o+=`text-decoration:${s};`),o}static getPresentationFromMetadata(e){const t=this.getForeground(e),n=this.getFontStyle(e);return{foreground:t,italic:!!(n&1),bold:!!(n&2),underline:!!(n&4),strikethrough:!!(n&8)}}}class Lo{static createEmpty(e,t){const n=Lo.defaultTokenMetadata,r=new Uint32Array(2);return r[0]=e.length,r[1]=n,new Lo(r,e,t)}constructor(e,t,n){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this._languageIdCodec=n}equals(e){return e instanceof Lo?this.slicedEquals(e,0,this._tokensCount):!1}slicedEquals(e,t,n){if(this._text!==e._text||this._tokensCount!==e._tokensCount)return!1;const r=t<<1,o=r+(n<<1);for(let s=r;s0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[(e<<1)+1]}getLanguageId(e){const t=this._tokens[(e<<1)+1],n=us.getLanguageId(t);return this._languageIdCodec.decodeLanguageId(n)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return us.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return us.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return us.getClassNameFromMetadata(t)}getInlineStyle(e,t){const n=this._tokens[(e<<1)+1];return us.getInlineStyleFromMetadata(n,t)}getPresentation(e){const t=this._tokens[(e<<1)+1];return us.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return Lo.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,n){return new Uq(this,e,t,n)}static convertToEndOffset(e,t){const r=(e.length>>>1)-1;for(let o=0;o>>1)-1;for(;nt&&(r=o)}return n}withInserted(e){if(e.length===0)return this;let t=0,n=0,r="";const o=new Array;let s=0;for(;;){const a=ts){r+=this._text.substring(s,l.offset);const c=this._tokens[(t<<1)+1];o.push(r.length,c),s=l.offset}r+=l.text,o.push(r.length,l.tokenMetadata),n++}else break}return new Lo(new Uint32Array(o),r,this._languageIdCodec)}}Lo.defaultTokenMetadata=(0<<11|1<<15|2<<24)>>>0;class Uq{constructor(e,t,n,r){this._source=e,this._startOffset=t,this._endOffset=n,this._deltaOffset=r,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(let o=this._firstTokenIndex,s=e.getCount();o=n);o++)this._tokensCount++}getMetadata(e){return this._source.getMetadata(this._firstTokenIndex+e)}getLanguageId(e){return this._source.getLanguageId(this._firstTokenIndex+e)}getLineContent(){return this._source.getLineContent().substring(this._startOffset,this._endOffset)}equals(e){return e instanceof Uq?this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount):!1}getCount(){return this._tokensCount}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){const t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)}getPresentation(e){return this._source.getPresentation(this._firstTokenIndex+e)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}}class Ca{constructor(e,t,n,r){this.startColumn=e,this.endColumn=t,this.className=n,this.type=r,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 n=e.length,r=t.length;if(n!==r)return!1;for(let o=0;o=o||(a[l++]=new Ca(Math.max(1,c.startColumn-r+1),Math.min(s+1,c.endColumn-r+1),c.className,c.type));return a}static filter(e,t,n,r){if(e.length===0)return[];const o=[];let s=0;for(let a=0,l=e.length;at||u.isEmpty()&&(c.type===0||c.type===3))continue;const d=u.startLineNumber===t?u.startColumn:n,h=u.endLineNumber===t?u.endColumn:r;o[s++]=new Ca(d,h,c.inlineClassName,c.type)}return o}static _typeCompare(e,t){const n=[2,0,1,3];return n[e]-n[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 n=Ca._typeCompare(e.type,t.type);return n!==0?n:e.className!==t.className?e.className0&&this.stopOffsets[0]0&&t=e){this.stopOffsets.splice(r,0,e),this.classNames.splice(r,0,t),this.metadata.splice(r,0,n);break}this.count++}}class q9e{static normalize(e,t){if(t.length===0)return[];const n=[],r=new nP;let o=0;for(let s=0,a=t.length;s1){const p=e.charCodeAt(c-2);xo(p)&&c--}if(u>1){const p=e.charCodeAt(u-2);xo(p)&&u--}const f=c-1,g=u-2;o=r.consumeLowerThan(f,o,n),r.count===0&&(o=f),r.insert(g,d,h)}return r.consumeLowerThan(1073741824,o,n),n}}class Wo{constructor(e,t,n,r){this.endIndex=e,this.type=t,this.metadata=n,this.containsRTL=r,this._linePartBrand=void 0}isWhitespace(){return!!(this.metadata&1)}isPseudoAfter(){return!!(this.metadata&4)}}class Ume{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class I_{constructor(e,t,n,r,o,s,a,l,c,u,d,h,f,g,p,v,m,_,y){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=n,this.continuesWithWrappedLine=r,this.isBasicASCII=o,this.containsRTL=s,this.fauxIndentLength=a,this.lineTokens=l,this.lineDecorations=c.sort(Ca.compare),this.tabSize=u,this.startVisibleColumn=d,this.spaceWidth=h,this.stopRenderingLineAfter=p,this.renderWhitespace=v==="all"?4:v==="boundary"?1:v==="selection"?2:v==="trailing"?3:0,this.renderControlCharacters=m,this.fontLigatures=_,this.selectionsOnLine=y&&y.sort((E,D)=>E.startOffset>>16}static getCharIndex(e){return(e&65535)>>>0}constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._horizontalOffset=new Uint32Array(this.length)}setColumnInfo(e,t,n,r){const o=(t<<16|n<<0)>>>0;this._data[e-1]=o,this._horizontalOffset[e-1]=r}getHorizontalOffset(e){return this._horizontalOffset.length===0?0:this._horizontalOffset[e-1]}charOffsetToPartData(e){return this.length===0?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}getDomPosition(e){const t=this.charOffsetToPartData(e-1),n=of.getPartIndex(t),r=of.getCharIndex(t);return new jme(n,r)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,n){if(this.length===0)return 0;const r=(e<<16|n<<0)>>>0;let o=0,s=this.length-1;for(;o+1>>1,v=this._data[p];if(v===r)return p;v>r?s=p:o=p}if(o===s)return o;const a=this._data[o],l=this._data[s];if(a===r)return o;if(l===r)return s;const c=of.getPartIndex(a),u=of.getCharIndex(a),d=of.getPartIndex(l);let h;c!==d?h=t:h=of.getCharIndex(l);const f=n-u,g=h-n;return f<=g?o:s}}class SH{constructor(e,t,n){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=n}}function Fk(i,e){if(i.lineContent.length===0){if(i.lineDecorations.length>0){e.appendString("");let t=0,n=0,r=0;for(const s of i.lineDecorations)(s.type===1||s.type===2)&&(e.appendString(''),s.type===1&&(r|=1,t++),s.type===2&&(r|=2,n++));e.appendString("");const o=new of(1,t+n);return o.setColumnInfo(1,t,0,0),new SH(o,!1,r)}return e.appendString(""),new SH(new of(0,0),!1,0)}return i7e(Z9e(i),e)}class X9e{constructor(e,t,n,r){this.characterMapping=e,this.html=t,this.containsRTL=n,this.containsForeignElements=r}}function N4(i){const e=new DS(1e4),t=Fk(i,e);return new X9e(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}class Y9e{constructor(e,t,n,r,o,s,a,l,c,u,d,h,f,g,p,v){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=n,this.len=r,this.isOverflowing=o,this.overflowingCharCount=s,this.parts=a,this.containsForeignElements=l,this.fauxIndentLength=c,this.tabSize=u,this.startVisibleColumn=d,this.containsRTL=h,this.spaceWidth=f,this.renderSpaceCharCode=g,this.renderWhitespace=p,this.renderControlCharacters=v}}function Z9e(i){const e=i.lineContent;let t,n,r;i.stopRenderingLineAfter!==-1&&i.stopRenderingLineAfter0){for(let a=0,l=i.lineDecorations.length;a0&&(o[s++]=new Wo(n,"",0,!1));let a=n;for(let l=0,c=t.getCount();l=r){const f=e?xw(i.substring(a,r)):!1;o[s++]=new Wo(r,d,0,f);break}const h=e?xw(i.substring(a,u)):!1;o[s++]=new Wo(u,d,0,h),a=u}return o}function J9e(i,e,t){let n=0;const r=[];let o=0;if(t)for(let s=0,a=e.length;s=50&&(r[o++]=new Wo(f+1,u,d,h),g=f+1,f=-1);g!==c&&(r[o++]=new Wo(c,u,d,h))}else r[o++]=l;n=c}else for(let s=0,a=e.length;s50){const d=l.type,h=l.metadata,f=l.containsRTL,g=Math.ceil(u/50);for(let p=1;p=8234&&i<=8238||i>=8294&&i<=8297||i>=8206&&i<=8207||i===1564}function e7e(i,e){const t=[];let n=new Wo(0,"",0,!1),r=0;for(const o of e){const s=o.endIndex;for(;rn.endIndex&&(n=new Wo(r,o.type,o.metadata,o.containsRTL),t.push(n)),n=new Wo(r+1,"mtkcontrol",o.metadata,!1),t.push(n))}r>n.endIndex&&(n=new Wo(s,o.type,o.metadata,o.containsRTL),t.push(n))}return t}function t7e(i,e,t,n){const r=i.continuesWithWrappedLine,o=i.fauxIndentLength,s=i.tabSize,a=i.startVisibleColumn,l=i.useMonospaceOptimizations,c=i.selectionsOnLine,u=i.renderWhitespace===1,d=i.renderWhitespace===3,h=i.renderSpaceWidth!==i.spaceWidth,f=[];let g=0,p=0,v=n[p].type,m=n[p].containsRTL,_=n[p].endIndex;const y=n.length;let S=!1,L=Ys(e),E;L===-1?(S=!0,L=t,E=t):E=th(e);let D=!1,k=0,T=c&&c[k],M=a%s;for(let N=o;N=T.endOffset&&(k++,T=c&&c[k]);let F;if(NE)F=!0;else if(R===9)F=!0;else if(R===32)if(u)if(D)F=!0;else{const W=N+1N),F&&d&&(F=S||N>E),F&&m&&N>=L&&N<=E&&(F=!1),D){if(!F||!l&&M>=s){if(h){const W=g>0?f[g-1].endIndex:o;for(let H=W+1;H<=N;H++)f[g++]=new Wo(H,"mtkw",1,!1)}else f[g++]=new Wo(N,"mtkw",1,!1);M=M%s}}else(N===_||F&&N>o)&&(f[g++]=new Wo(N,v,0,m),M=M%s);for(R===9?M=s:Uv(R)?M+=2:M++,D=F;N===_&&(p++,p0?e.charCodeAt(t-1):0,R=t>1?e.charCodeAt(t-2):0;N===32&&R!==32&&R!==9||(A=!0)}else A=!0;if(A)if(h){const N=g>0?f[g-1].endIndex:o;for(let R=N+1;R<=t;R++)f[g++]=new Wo(R,"mtkw",1,!1)}else f[g++]=new Wo(t,"mtkw",1,!1);else f[g++]=new Wo(t,v,0,m);return f}function n7e(i,e,t,n){n.sort(Ca.compare);const r=q9e.normalize(i,n),o=r.length;let s=0;const a=[];let l=0,c=0;for(let d=0,h=t.length;dc&&(c=_.startOffset,a[l++]=new Wo(c,p,v,m)),_.endOffset+1<=g)c=_.endOffset+1,a[l++]=new Wo(c,p+" "+_.className,v|_.metadata,m),s++;else{c=g,a[l++]=new Wo(c,p+" "+_.className,v|_.metadata,m);break}}g>c&&(c=g,a[l++]=new Wo(c,p,v,m))}const u=t[t.length-1].endIndex;if(s'):e.appendString("");for(let T=0,M=c.length;T=u&&(re+=J)}}for(H&&(e.appendString(' style="width:'),e.appendString(String(g*U)),e.appendString('px"')),e.appendASCIICharCode(62);S1?e.appendCharCode(8594):e.appendCharCode(65515);for(let J=2;J<=Y;J++)e.appendCharCode(160)}else re=2,Y=1,e.appendCharCode(p),e.appendCharCode(8204);E+=re,D+=Y,S>=u&&(L+=Y)}}else for(e.appendASCIICharCode(62);S=u&&(L+=re)}G?k++:k=0,S>=s&&!y&&A.isPseudoAfter()&&(y=!0,_.setColumnInfo(S+1,T,E,D)),e.appendString("")}return y||_.setColumnInfo(s+1,c.length-1,E,D),a&&(e.appendString(''),e.appendString(w("showMore","Show more ({0})",o7e(l))),e.appendString("")),e.appendString(""),new SH(_,f,r)}function r7e(i){return i.toString(16).toUpperCase().padStart(4,"0")}function o7e(i){return i<1024?w("overflow.chars","{0} chars",i):i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/1024/1024).toFixed(1)} MB`}class Qie{constructor(e,t,n,r){this._viewportBrand=void 0,this.top=e|0,this.left=t|0,this.width=n|0,this.height=r|0}}class s7e{constructor(e,t){this.tabSize=e,this.data=t}}class jq{constructor(e,t,n,r,o,s,a){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=n,this.maxColumn=r,this.startVisibleColumn=o,this.tokens=s,this.inlineDecorations=a}}class vc{constructor(e,t,n,r,o,s,a,l,c,u){this.minColumn=e,this.maxColumn=t,this.content=n,this.continuesWithWrappedLine=r,this.isBasicASCII=vc.isBasicASCII(n,s),this.containsRTL=vc.containsRTL(n,this.isBasicASCII,o),this.tokens=a,this.inlineDecorations=l,this.tabSize=c,this.startVisibleColumn=u}static isBasicASCII(e,t){return t?Tk(e):!0}static containsRTL(e,t,n){return!t&&n?xw(e):!1}}class dE{constructor(e,t,n){this.range=e,this.inlineClassName=t,this.type=n}}class a7e{constructor(e,t,n,r){this.startOffset=e,this.endOffset=t,this.inlineClassName=n,this.inlineClassNameAffectsLetterSpacing=r}toInlineDecoration(e){return new dE(new B(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class Gme{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}class OD{constructor(e,t,n){this.color=e,this.zIndex=t,this.data=n}static compareByRenderingProps(e,t){return e.zIndex===t.zIndex?e.colort.color?1:0:e.zIndex-t.zIndex}static equals(e,t){return e.color===t.color&&e.zIndex===t.zIndex&&or(e.data,t.data)}static equalsArr(e,t){return or(e,t,OD.equals)}}function l7e(i){return Array.isArray(i)}function c7e(i){return!l7e(i)}function qme(i){return typeof i=="string"}function Jie(i){return!qme(i)}function D1(i){return!i}function Cv(i,e){return i.ignoreCase&&e?e.toLowerCase():e}function ere(i){return i.replace(/[&<>'"_]/g,"-")}function u7e(i,e){console.log(`${i.languageId}: ${e}`)}function Hi(i,e){return new Error(`${i.languageId}: ${e}`)}function Mm(i,e,t,n,r){const o=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g;let s=null;return e.replace(o,function(a,l,c,u,d,h,f,g,p){return D1(c)?D1(u)?!D1(d)&&d0;){const n=i.tokenizer[t];if(n)return n;const r=t.lastIndexOf(".");r<0?t=null:t=t.substr(0,r)}return null}function d7e(i,e){let t=e;for(;t&&t.length>0;){if(i.stateNames[t])return!0;const r=t.lastIndexOf(".");r<0?t=null:t=t.substr(0,r)}return!1}var h7e=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},f7e=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},xH;const Xme=5;class FD{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(e!==null&&e.depth>=this._maxCacheDepth)return new By(e,t);let n=By.getStackElementId(e);n.length>0&&(n+="|"),n+=t;let r=this._entries[n];return r||(r=new By(e,t),this._entries[n]=r,r)}}FD._INSTANCE=new FD(Xme);class By{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;e!==null;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;e!==null&&t!==null;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return e===null&&t===null}equals(e){return By._equals(this,e)}push(e){return FD.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return FD.create(this.parent,e)}}class ry{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 ry(this.languageId,this.state)}}class Am{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(t!==null)return new hE(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new hE(e,t);const n=By.getStackElementId(e);let r=this._entries[n];return r||(r=new hE(e,null),this._entries[n]=r,r)}}Am._INSTANCE=new Am(Xme);class hE{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:Am.create(this.stack,this.embeddedLanguageData)}equals(e){return!(e instanceof hE)||!this.stack.equals(e.stack)?!1:this.embeddedLanguageData===null&&e.embeddedLanguageData===null?!0:this.embeddedLanguageData===null||e.embeddedLanguageData===null?!1:this.embeddedLanguageData.equals(e.embeddedLanguageData)}}class g7e{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 wD(e,t,this._languageId)))}nestedLanguageTokenize(e,t,n,r){const o=n.languageId,s=n.state,a=hr.get(o);if(!a)return this.enterLanguage(o),this.emit(r,""),s;const l=a.tokenize(e,t,s);if(r!==0)for(const c of l.tokens)this._tokens.push(new wD(c.offset+r,c.type,c.language));else this._tokens=this._tokens.concat(l.tokens);return this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,l.endState}finalize(e){return new fq(this._tokens,e)}}class iP{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 n=this._theme.match(this._currentLanguageId,t)|1024;this._lastTokenMetadata!==n&&(this._lastTokenMetadata=n,this._tokens.push(e),this._tokens.push(n))}static _merge(e,t,n){const r=e!==null?e.length:0,o=t.length,s=n!==null?n.length:0;if(r===0&&o===0&&s===0)return new Uint32Array(0);if(r===0&&o===0)return n;if(o===0&&s===0)return e;const a=new Uint32Array(r+o+s);e!==null&&a.set(e);for(let l=0;l{if(s)return;let l=!1;for(let c=0,u=a.changedLanguages.length;c{a.affectsConfiguration("editor.maxTokenizationLineLength")&&(this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}))}))}getLoadStatus(){const e=[];for(const t in this._embeddedLanguages){const n=hr.get(t);if(n){if(n instanceof xH){const r=n.getLoadStatus();r.loaded===!1&&e.push(r.promise)}continue}hr.isResolved(t)||e.push(hr.getOrCreate(t))}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){const e=FD.create(null,this._lexer.start);return Am.create(e,null)}tokenize(e,t,n){if(e.length>=this._maxTokenizationLineLength)return zq(this._languageId,n);const r=new g7e,o=this._tokenize(e,t,n,r);return r.finalize(o)}tokenizeEncoded(e,t,n){if(e.length>=this._maxTokenizationLineLength)return T4(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),n);const r=new iP(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),o=this._tokenize(e,t,n,r);return r.finalize(o)}_tokenize(e,t,n,r){return n.embeddedLanguageData?this._nestedTokenize(e,t,n,0,r):this._myTokenize(e,t,n,0,r)}_findLeavingNestedLanguageOffset(e,t){let n=this._lexer.tokenizer[t.stack.state];if(!n&&(n=sR(this._lexer,t.stack.state),!n))throw Hi(this._lexer,"tokenizer state is not defined: "+t.stack.state);let r=-1,o=!1;for(const s of n){if(!Jie(s.action)||s.action.nextEmbedded!=="@pop")continue;o=!0;let a=s.regex;const l=s.regex.source;if(l.substr(0,4)==="^(?:"&&l.substr(l.length-1,1)===")"){const u=(a.ignoreCase?"i":"")+(a.unicode?"u":"");a=new RegExp(l.substr(4,l.length-5),u)}const c=e.search(a);c===-1||c!==0&&s.matchOnlyAtLineStart||(r===-1||c0&&o.nestedLanguageTokenize(a,!1,n.embeddedLanguageData,r);const l=e.substring(s);return this._myTokenize(l,t,n,r+s,o)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,n,r,o){o.enterLanguage(this._languageId);const s=e.length,a=t&&this._lexer.includeLF?e+` -`:e,l=a.length;let c=n.embeddedLanguageData,u=n.stack,d=0,h=null,f=!0;for(;f||d=l)break;f=!1;let T=this._lexer.tokenizer[m];if(!T&&(T=sR(this._lexer,m),!T))throw Hi(this._lexer,"tokenizer state is not defined: "+m);const M=a.substr(d);for(const A of T)if((d===0||!A.matchOnlyAtLineStart)&&(_=M.match(A.regex),_)){y=_[0],S=A.action;break}}if(_||(_=[""],y=""),S||(d=this._lexer.maxStack)throw Hi(this._lexer,"maximum tokenizer stack size reached: ["+u.state+","+u.parent.state+",...]");u=u.push(m)}else if(S.next==="@pop"){if(u.depth<=1)throw Hi(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(L));u=u.pop()}else if(S.next==="@popall")u=u.popall();else{let T=Mm(this._lexer,S.next,y,_,m);if(T[0]==="@"&&(T=T.substr(1)),sR(this._lexer,T))u=u.push(T);else throw Hi(this._lexer,"trying to set a next state '"+T+"' that is undefined in rule: "+this._safeRuleName(L))}}S.log&&typeof S.log=="string"&&u7e(this._lexer,this._lexer.languageId+": "+Mm(this._lexer,S.log,y,_,m))}if(D===null)throw Hi(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(L));const k=T=>{const M=this._languageService.getLanguageIdByLanguageName(T)||this._languageService.getLanguageIdByMimeType(T)||T,A=this._getNestedEmbeddedLanguageData(M);if(d0)throw Hi(this._lexer,"groups cannot be nested: "+this._safeRuleName(L));if(_.length!==D.length+1)throw Hi(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(L));let T=0;for(let M=1;M<_.length;M++)T+=_[M].length;if(T!==y.length)throw Hi(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(L));h={rule:L,matches:_,groups:[]};for(let M=0;Mi});class Kq{static colorizeElement(e,t,n,r){r=r||{};const o=r.theme||"vs",s=r.mimeType||n.getAttribute("lang")||n.getAttribute("data-lang");if(!s)return console.error("Mode not detected"),Promise.resolve();const a=t.getLanguageIdByMimeType(s)||s;e.setTheme(o);const l=n.firstChild?n.firstChild.nodeValue:"";n.className+=" "+o;const c=u=>{var d;const h=(d=L6==null?void 0:L6.createHTML(u))!==null&&d!==void 0?d:u;n.innerHTML=h};return this.colorize(t,l||"",a,r).then(c,u=>console.error(u))}static async colorize(e,t,n,r){const o=e.languageIdCodec;let s=4;r&&typeof r.tabSize=="number"&&(s=r.tabSize),Cq(t)&&(t=t.substr(1));const a=Jf(t);if(!e.isRegisteredLanguageId(n))return tre(a,s,o);const l=await hr.getOrCreate(n);return l?m7e(a,s,l,o):tre(a,s,o)}static colorizeLine(e,t,n,r,o=4){const s=vc.isBasicASCII(e,t),a=vc.containsRTL(e,s,n);return N4(new I_(!1,!0,e,!1,s,a,0,r,[],o,0,0,0,0,-1,"none",!1,!1,null)).html}static colorizeModelLine(e,t,n=4){const r=e.getLineContent(t);e.tokenization.forceTokenization(t);const s=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(r,e.mightContainNonBasicASCII(),e.mightContainRTL(),s,n)}}function m7e(i,e,t,n){return new Promise((r,o)=>{const s=()=>{const a=v7e(i,e,t,n);if(t instanceof BD){const l=t.getLoadStatus();if(l.loaded===!1){l.promise.then(s,o);return}}r(a)};s()})}function tre(i,e,t){let n=[];const o=new Uint32Array(2);o[0]=0,o[1]=33587200;for(let s=0,a=i.length;s")}return n.join("")}function v7e(i,e,t,n){let r=[],o=t.getInitialState();for(let s=0,a=i.length;s"),o=c.endState}return r.join("")}const nre=2e4;let L0,pM,LH,mM,EH;function _7e(i){L0=document.createElement("div"),L0.className="monaco-aria-container";const e=()=>{const n=document.createElement("div");return n.className="monaco-alert",n.setAttribute("role","alert"),n.setAttribute("aria-atomic","true"),L0.appendChild(n),n};pM=e(),LH=e();const t=()=>{const n=document.createElement("div");return n.className="monaco-status",n.setAttribute("aria-live","polite"),n.setAttribute("aria-atomic","true"),L0.appendChild(n),n};mM=t(),EH=t(),i.appendChild(L0)}function kl(i){L0&&(pM.textContent!==i?(Ns(LH),rP(pM,i)):(Ns(pM),rP(LH,i)))}function Hf(i){L0&&(mM.textContent!==i?(Ns(EH),rP(mM,i)):(Ns(mM),rP(EH,i)))}function rP(i,e){Ns(i),e.length>nre&&(e=e.substr(0,nre)),i.textContent=e,i.style.visibility="hidden",i.style.visibility="visible"}const Gq=yn("markerDecorationsService");var b7e=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},C7e=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let WD=class{constructor(e,t){}dispose(){}};WD.ID="editor.contrib.markerDecorations";WD=b7e([C7e(1,Gq)],WD);jn(WD.ID,WD,0);class Yme extends fe{constructor(e,t){super(),this._onDidChange=this._register(new se),this.onDidChange=this._onDidChange.event,this._referenceDomElement=e,this._width=-1,this._height=-1,this._resizeObserver=null,this.measureReferenceDomElement(!1,t)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this._width}getHeight(){return this._height}startObserving(){if(!this._resizeObserver&&this._referenceDomElement){let e=null;const t=()=>{e?this.observe({width:e.width,height:e.height}):this.observe()};let n=!1,r=!1;const o=()=>{if(n&&!r)try{n=!1,r=!0,t()}finally{Il(Pt(this._referenceDomElement),()=>{r=!1,o()})}};this._resizeObserver=new ResizeObserver(s=>{s&&s[0]&&s[0].contentRect?e={width:s[0].contentRect.width,height:s[0].contentRect.height}:e=null,n=!0,o()}),this._resizeObserver.observe(this._referenceDomElement)}}stopObserving(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let n=0,r=0;t?(n=t.width,r=t.height):this._referenceDomElement&&(n=this._referenceDomElement.clientWidth,r=this._referenceDomElement.clientHeight),n=Math.max(5,n),r=Math.max(5,r),(this._width!==n||this._height!==r)&&(this._width=n,this._height=r,e&&this._onDidChange.fire())}}class yv{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=yv._read(e,this.key),n=o=>yv._read(e,o),r=(o,s)=>yv._write(e,o,s);this.migrate(t,n,r)}static _read(e,t){if(typeof e>"u")return;const n=t.indexOf(".");if(n>=0){const r=t.substring(0,n);return this._read(e[r],t.substring(n+1))}return e[t]}static _write(e,t,n){const r=t.indexOf(".");if(r>=0){const o=t.substring(0,r);e[o]=e[o]||{},this._write(e[o],t.substring(r+1),n);return}e[t]=n}}yv.items=[];function Lh(i,e){yv.items.push(new yv(i,e))}function Al(i,e){Lh(i,(t,n,r)=>{if(typeof t<"u"){for(const[o,s]of e)if(t===o){r(i,s);return}}})}function y7e(i){yv.items.forEach(e=>e.apply(i))}Al("wordWrap",[[!0,"on"],[!1,"off"]]);Al("lineNumbers",[[!0,"on"],[!1,"off"]]);Al("cursorBlinking",[["visible","solid"]]);Al("renderWhitespace",[[!0,"boundary"],[!1,"none"]]);Al("renderLineHighlight",[[!0,"line"],[!1,"none"]]);Al("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]);Al("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]);Al("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Al("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Al("autoIndent",[[!1,"advanced"],[!0,"full"]]);Al("matchBrackets",[[!0,"always"],[!1,"never"]]);Al("renderFinalNewline",[[!0,"on"],[!1,"off"]]);Al("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]);Al("occurrencesHighlight",[[!0,"singleFile"],[!1,"off"]]);Al("wordBasedSuggestions",[[!0,"matchingDocuments"],[!1,"off"]]);Lh("autoClosingBrackets",(i,e,t)=>{i===!1&&(t("autoClosingBrackets","never"),typeof e("autoClosingQuotes")>"u"&&t("autoClosingQuotes","never"),typeof e("autoSurround")>"u"&&t("autoSurround","never"))});Lh("renderIndentGuides",(i,e,t)=>{typeof i<"u"&&(t("renderIndentGuides",void 0),typeof e("guides.indentation")>"u"&&t("guides.indentation",!!i))});Lh("highlightActiveIndentGuide",(i,e,t)=>{typeof i<"u"&&(t("highlightActiveIndentGuide",void 0),typeof e("guides.highlightActiveIndentation")>"u"&&t("guides.highlightActiveIndentation",!!i))});const w7e={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"};Lh("suggest.filteredTypes",(i,e,t)=>{if(i&&typeof i=="object"){for(const n of Object.entries(w7e))i[n[0]]===!1&&typeof e(`suggest.${n[1]}`)>"u"&&t(`suggest.${n[1]}`,!1);t("suggest.filteredTypes",void 0)}});Lh("quickSuggestions",(i,e,t)=>{if(typeof i=="boolean"){const n=i?"on":"off";t("quickSuggestions",{comments:n,strings:n,other:n})}});Lh("experimental.stickyScroll.enabled",(i,e,t)=>{typeof i=="boolean"&&(t("experimental.stickyScroll.enabled",void 0),typeof e("stickyScroll.enabled")>"u"&&t("stickyScroll.enabled",i))});Lh("experimental.stickyScroll.maxLineCount",(i,e,t)=>{typeof i=="number"&&(t("experimental.stickyScroll.maxLineCount",void 0),typeof e("stickyScroll.maxLineCount")>"u"&&t("stickyScroll.maxLineCount",i))});Lh("codeActionsOnSave",(i,e,t)=>{if(i&&typeof i=="object"){let n=!1;const r={};for(const o of Object.entries(i))typeof o[1]=="boolean"?(n=!0,r[o[0]]=o[1]?"explicit":"never"):r[o[0]]=o[1];n&&t("codeActionsOnSave",r)}});Lh("codeActionWidget.includeNearbyQuickfixes",(i,e,t)=>{typeof i=="boolean"&&(t("codeActionWidget.includeNearbyQuickfixes",void 0),typeof e("codeActionWidget.includeNearbyQuickFixes")>"u"&&t("codeActionWidget.includeNearbyQuickFixes",i))});Lh("lightbulb.enabled",(i,e,t)=>{typeof i=="boolean"&&t("lightbulb.enabled",i?void 0:"off")});class S7e{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new se,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}}const Rw=new S7e,ud=yn("accessibilityService"),Bk=new st("accessibilityModeEnabled",!1);var x7e=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},L7e=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let DH=class extends fe{constructor(e,t,n,r){super(),this._accessibilityService=r,this._onDidChange=this._register(new se),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new se),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new mpe,this.isSimpleWidget=e,this._containerObserver=this._register(new Yme(n,t.dimension)),this._targetWindowId=Pt(n).vscodeWindowId,this._rawOptions=ire(t),this._validatedOptions=Pm.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(13)&&this._containerObserver.startObserving(),this._register(zc.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(Rw.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(cH.onDidChange(()=>this._recomputeOptions())),this._register(ID.getInstance(Pt(n)).onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){const e=this._computeOptions(),t=Pm.checkEquals(this.options,e);t!==null&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=ib.createFromValidatedSettings(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),n=this._readFontInfo(t),r={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:n,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:Rw.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return Pm.computeOptions(this._validatedOptions,r)}_readEnvConfiguration(){return{extraEditorClassName:D7e(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:nb||ru,pixelRatio:ID.getInstance(iie(this._targetWindowId,!0).window).value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return cH.readFontInfo(iie(this._targetWindowId,!0).window,e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=ire(e);Pm.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=Pm.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=E7e(e);this._lineNumbersDigitCount!==t&&(this._lineNumbersDigitCount=t,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}setReservedHeight(e){this._reservedHeight!==e&&(this._reservedHeight=e,this._recomputeOptions())}setGlyphMarginDecorationLaneCount(e){this._glyphMarginDecorationLaneCount!==e&&(this._glyphMarginDecorationLaneCount=e,this._recomputeOptions())}};DH=x7e([L7e(3,ud)],DH);function E7e(i){let e=0;for(;i;)i=Math.floor(i/10),e++;return e||1}function D7e(){let i="";return!Dp&&!Hpe&&(i+="no-user-select "),Dp&&(i+="no-minimap-shadow ",i+="enable-user-select "),Ln&&(i+="mac "),i}class I7e{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class k7e{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 Pm{static validateOptions(e){const t=new I7e;for(const n of J1){const r=n.name==="_never_"?void 0:e[n.name];t._write(n.id,n.validate(r))}return t}static computeOptions(e,t){const n=new k7e;for(const r of J1)n._write(r.id,r.compute(t,n,e._read(r.id)));return n}static _deepEquals(e,t){if(typeof e!="object"||typeof t!="object"||!e||!t)return e===t;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)?or(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!Pm._deepEquals(e[n],t[n]))return!1;return!0}static checkEquals(e,t){const n=[];let r=!1;for(const o of J1){const s=!Pm._deepEquals(e._read(o.id),t._read(o.id));n[o.id]=s,s&&(r=!0)}return r?new ppe(n):null}static applyUpdate(e,t){let n=!1;for(const r of J1)if(t.hasOwnProperty(r.name)){const o=r.applyUpdate(e[r.name],t[r.name]);e[r.name]=o.newValue,n=n||o.didChange}return n}}function ire(i){const e=Mg(i);return y7e(e),e}var jm;(function(i){const e={total:0,min:Number.MAX_VALUE,max:0},t={...e},n={...e},r={...e};let o=0;const s={keydown:0,input:0,render:0};function a(){m(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),s.keydown=1,queueMicrotask(l)}i.onKeyDown=a;function l(){s.keydown===1&&(performance.mark("keydown/end"),s.keydown=2)}function c(){performance.mark("input/start"),s.input=1,v()}i.onBeforeInput=c;function u(){s.input===0&&c(),queueMicrotask(d)}i.onInput=u;function d(){s.input===1&&(performance.mark("input/end"),s.input=2)}function h(){m()}i.onKeyUp=h;function f(){m()}i.onSelectionChange=f;function g(){s.keydown===2&&s.input===2&&s.render===0&&(performance.mark("render/start"),s.render=1,queueMicrotask(p),v())}i.onRenderStart=g;function p(){s.render===1&&(performance.mark("render/end"),s.render=2)}function v(){setTimeout(m)}function m(){s.keydown===2&&s.input===2&&s.render===2&&(performance.mark("inputlatency/end"),performance.measure("keydown","keydown/start","keydown/end"),performance.measure("input","input/start","input/end"),performance.measure("render","render/start","render/end"),performance.measure("inputlatency","inputlatency/start","inputlatency/end"),_("keydown",e),_("input",t),_("render",n),_("inputlatency",r),o++,y())}function _(D,k){const T=performance.getEntriesByName(D)[0].duration;k.total+=T,k.min=Math.min(k.min,T),k.max=Math.max(k.max,T)}function y(){performance.clearMarks("keydown/start"),performance.clearMarks("keydown/end"),performance.clearMarks("input/start"),performance.clearMarks("input/end"),performance.clearMarks("render/start"),performance.clearMarks("render/end"),performance.clearMarks("inputlatency/start"),performance.clearMarks("inputlatency/end"),performance.clearMeasures("keydown"),performance.clearMeasures("input"),performance.clearMeasures("render"),performance.clearMeasures("inputlatency"),s.keydown=0,s.input=0,s.render=0}function S(){if(o===0)return;const D={keydown:L(e),input:L(t),render:L(n),total:L(r),sampleCount:o};return E(e),E(t),E(n),E(r),o=0,D}i.getAndClearMeasurements=S;function L(D){return{average:D.total/o,max:D.max,min:D.min}}function E(D){D.total=0,D.min=Number.MAX_VALUE,D.max=0}})(jm||(jm={}));class kS{constructor(){this._hooks=new Te,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;const n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,n,r,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=o;let s=e;try{e.setPointerCapture(t),this._hooks.add(Rt(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{s=Pt(e)}this._hooks.add(ye(s,Ge.POINTER_MOVE,a=>{if(a.buttons!==n){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(ye(s,Ge.POINTER_UP,a=>this.stopMonitoring(!0)))}}function qq(i){return`--vscode-${i.replace(/\./g,"-")}`}function ht(i){return`var(${qq(i)})`}function T7e(i,e){return`var(${qq(i)}, ${e})`}const Zme={ColorContribution:"base.contributions.colors"};class N7e{constructor(){this._onDidChangeSchema=new se,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,n,r=!1,o){const s={id:e,description:n,defaults:t,needsTransparency:r,deprecationMessage:o};this.colorsById[e]=s;const a={type:"string",description:n,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return o&&(a.deprecationMessage=o),r&&(a.pattern="^#(?:(?[0-9a-fA-f]{3}[0-9a-eA-E])|(?:[0-9a-fA-F]{6}(?:(?![fF]{2})(?:[0-9a-fA-F]{2}))))?$",a.patternErrorMessage="This color must be transparent or it will obscure content"),this.colorSchema.properties[e]=a,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(n),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map(e=>this.colorsById[e])}resolveDefaultColor(e,t){const n=this.colorsById[e];if(n&&n.defaults){const r=n.defaults[t.type];return Sd(r,t)}}getColorSchema(){return this.colorSchema}toString(){const e=(t,n)=>{const r=t.indexOf(".")===-1?0:1,o=n.indexOf(".")===-1?0:1;return r!==o?r-o:t.localeCompare(n)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(` -`)}}const R4=new N7e;ar.add(Zme.ColorContribution,R4);function X(i,e,t,n,r){return R4.registerColor(i,e,t,n,r)}const qe=X("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},w("foreground","Overall foreground color. This color is only used if not overridden by a component."));X("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},w("disabledForeground","Overall foreground for disabled elements. This color is only used if not overridden by a component."));X("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},w("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component."));X("descriptionForeground",{light:"#717171",dark:It(qe,.7),hcDark:It(qe,.7),hcLight:It(qe,.7)},w("descriptionForeground","Foreground color for description text providing additional information, for example for a label."));const Cf=X("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},w("iconForeground","The default color for icons in the workbench.")),qc=X("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},w("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),Sn=X("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},w("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),zi=X("contrastActiveBorder",{light:null,dark:null,hcDark:qc,hcLight:qc},w("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast."));X("selection.background",{light:null,dark:null,hcDark:null,hcLight:null},w("selectionBackground","The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor."));X("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:me.black,hcLight:"#292929"},w("textSeparatorForeground","Color for text separators."));const R7e=X("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},w("textLinkForeground","Foreground color for links in text."));X("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},w("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover."));X("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#000000",hcLight:"#FFFFFF"},w("textPreformatForeground","Foreground color for preformatted text segments."));X("textPreformat.background",{light:"#0000001A",dark:"#FFFFFF1A",hcDark:"#FFFFFF",hcLight:"#09345f"},w("textPreformatBackground","Background color for preformatted text segments."));X("textBlockQuote.background",{light:"#f2f2f2",dark:"#222222",hcDark:null,hcLight:"#F2F2F2"},w("textBlockQuoteBackground","Background color for block quotes in text."));X("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:me.white,hcLight:"#292929"},w("textBlockQuoteBorder","Border color for block quotes in text."));X("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:me.black,hcLight:"#F2F2F2"},w("textCodeBlockBackground","Background color for code blocks in text."));const Yg=X("widget.shadow",{dark:It(me.black,.36),light:It(me.black,.16),hcDark:null,hcLight:null},w("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),Qme=X("widget.border",{dark:null,light:null,hcDark:Sn,hcLight:Sn},w("widgetBorder","Border color of widgets such as find/replace inside the editor.")),Jme=X("input.background",{dark:"#3C3C3C",light:me.white,hcDark:me.black,hcLight:me.white},w("inputBoxBackground","Input box background.")),eve=X("input.foreground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("inputBoxForeground","Input box foreground.")),tve=X("input.border",{dark:null,light:null,hcDark:Sn,hcLight:Sn},w("inputBoxBorder","Input box border.")),Xq=X("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:Sn,hcLight:Sn},w("inputBoxActiveOptionBorder","Border color of activated options in input fields."));X("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},w("inputOption.hoverBackground","Background color of activated options in input fields."));const W0=X("inputOption.activeBackground",{dark:It(qc,.4),light:It(qc,.2),hcDark:me.transparent,hcLight:me.transparent},w("inputOption.activeBackground","Background hover color of options in input fields.")),Yq=X("inputOption.activeForeground",{dark:me.white,light:me.black,hcDark:qe,hcLight:qe},w("inputOption.activeForeground","Foreground color of activated options in input fields."));X("input.placeholderForeground",{light:It(qe,.5),dark:It(qe,.5),hcDark:It(qe,.7),hcLight:It(qe,.7)},w("inputPlaceholderForeground","Input box foreground color for placeholder text."));const M7e=X("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:me.black,hcLight:me.white},w("inputValidationInfoBackground","Input validation background color for information severity.")),A7e=X("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:qe},w("inputValidationInfoForeground","Input validation foreground color for information severity.")),P7e=X("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:Sn,hcLight:Sn},w("inputValidationInfoBorder","Input validation border color for information severity.")),O7e=X("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:me.black,hcLight:me.white},w("inputValidationWarningBackground","Input validation background color for warning severity.")),F7e=X("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:qe},w("inputValidationWarningForeground","Input validation foreground color for warning severity.")),B7e=X("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:Sn,hcLight:Sn},w("inputValidationWarningBorder","Input validation border color for warning severity.")),W7e=X("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:me.black,hcLight:me.white},w("inputValidationErrorBackground","Input validation background color for error severity.")),$7e=X("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:qe},w("inputValidationErrorForeground","Input validation foreground color for error severity.")),H7e=X("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:Sn,hcLight:Sn},w("inputValidationErrorBorder","Input validation border color for error severity.")),yf=X("dropdown.background",{dark:"#3C3C3C",light:me.white,hcDark:me.black,hcLight:me.white},w("dropdownBackground","Dropdown background.")),V7e=X("dropdown.listBackground",{dark:null,light:null,hcDark:me.black,hcLight:me.white},w("dropdownListBackground","Dropdown list background.")),Zg=X("dropdown.foreground",{dark:"#F0F0F0",light:qe,hcDark:me.white,hcLight:qe},w("dropdownForeground","Dropdown foreground.")),oy=X("dropdown.border",{dark:yf,light:"#CECECE",hcDark:Sn,hcLight:Sn},w("dropdownBorder","Dropdown border.")),SL=X("button.foreground",{dark:me.white,light:me.white,hcDark:me.white,hcLight:me.white},w("buttonForeground","Button foreground color.")),z7e=X("button.separator",{dark:It(SL,.4),light:It(SL,.4),hcDark:It(SL,.4),hcLight:It(SL,.4)},w("buttonSeparator","Button separator color.")),xL=X("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},w("buttonBackground","Button background color.")),U7e=X("button.hoverBackground",{dark:nh(xL,.2),light:hC(xL,.2),hcDark:xL,hcLight:xL},w("buttonHoverBackground","Button background color when hovering.")),j7e=X("button.border",{dark:Sn,light:Sn,hcDark:Sn,hcLight:Sn},w("buttonBorder","Button border color.")),K7e=X("button.secondaryForeground",{dark:me.white,light:me.white,hcDark:me.white,hcLight:qe},w("buttonSecondaryForeground","Secondary button foreground color.")),IH=X("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:me.white},w("buttonSecondaryBackground","Secondary button background color.")),G7e=X("button.secondaryHoverBackground",{dark:nh(IH,.2),light:hC(IH,.2),hcDark:null,hcLight:null},w("buttonSecondaryHoverBackground","Secondary button background color when hovering.")),vM=X("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:me.black,hcLight:"#0F4A85"},w("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),q7e=X("badge.foreground",{dark:me.white,light:"#333",hcDark:me.white,hcLight:me.white},w("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),LL=X("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},w("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),EL=X("scrollbarSlider.background",{dark:me.fromHex("#797979").transparent(.4),light:me.fromHex("#646464").transparent(.4),hcDark:It(Sn,.6),hcLight:It(Sn,.4)},w("scrollbarSliderBackground","Scrollbar slider background color.")),DL=X("scrollbarSlider.hoverBackground",{dark:me.fromHex("#646464").transparent(.7),light:me.fromHex("#646464").transparent(.7),hcDark:It(Sn,.8),hcLight:It(Sn,.8)},w("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),IL=X("scrollbarSlider.activeBackground",{dark:me.fromHex("#BFBFBF").transparent(.4),light:me.fromHex("#000000").transparent(.6),hcDark:Sn,hcLight:Sn},w("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),X7e=X("progressBar.background",{dark:me.fromHex("#0E70C0"),light:me.fromHex("#0E70C0"),hcDark:Sn,hcLight:Sn},w("progressBarBackground","Background color of the progress bar that can show for long running operations."));X("editorError.background",{dark:null,light:null,hcDark:null,hcLight:null},w("editorError.background","Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const wf=X("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},w("editorError.foreground","Foreground color of error squigglies in the editor.")),Y7e=X("editorError.border",{dark:null,light:null,hcDark:me.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},w("errorBorder","If set, color of double underlines for errors in the editor.")),aR=X("editorWarning.background",{dark:null,light:null,hcDark:null,hcLight:null},w("editorWarning.background","Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),qs=X("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},w("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),$D=X("editorWarning.border",{dark:null,light:null,hcDark:me.fromHex("#FFCC00").transparent(.8),hcLight:me.fromHex("#FFCC00").transparent(.8)},w("warningBorder","If set, color of double underlines for warnings in the editor."));X("editorInfo.background",{dark:null,light:null,hcDark:null,hcLight:null},w("editorInfo.background","Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const Za=X("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},w("editorInfo.foreground","Foreground color of info squigglies in the editor.")),HD=X("editorInfo.border",{dark:null,light:null,hcDark:me.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},w("infoBorder","If set, color of double underlines for infos in the editor.")),Z7e=X("editorHint.foreground",{dark:me.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},w("editorHint.foreground","Foreground color of hint squigglies in the editor."));X("editorHint.border",{dark:null,light:null,hcDark:me.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},w("hintBorder","If set, color of double underlines for hints in the editor."));X("sash.hoverBorder",{dark:qc,light:qc,hcDark:qc,hcLight:qc},w("sashActiveBorder","Border color of active sashes."));const Eo=X("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:me.black,hcLight:me.white},w("editorBackground","Editor background color.")),Ku=X("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:me.white,hcLight:qe},w("editorForeground","Editor default foreground color."));X("editorStickyScroll.background",{light:Eo,dark:Eo,hcDark:Eo,hcLight:Eo},w("editorStickyScrollBackground","Background color of sticky scroll in the editor"));X("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:me.fromHex("#0F4A85").transparent(.1)},w("editorStickyScrollHoverBackground","Background color of sticky scroll on hover in the editor"));X("editorStickyScroll.border",{dark:null,light:null,hcDark:Sn,hcLight:Sn},w("editorStickyScrollBorder","Border color of sticky scroll in the editor"));X("editorStickyScroll.shadow",{dark:LL,light:LL,hcDark:LL,hcLight:LL},w("editorStickyScrollShadow"," Shadow color of sticky scroll in the editor"));const Nr=X("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:me.white},w("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),Qg=X("editorWidget.foreground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),Jg=X("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:Sn,hcLight:Sn},w("editorWidgetBorder","Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget."));X("editorWidget.resizeBorder",{light:null,dark:null,hcDark:null,hcLight:null},w("editorWidgetResizeBorder","Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget."));const rre=X("quickInput.background",{dark:Nr,light:Nr,hcDark:Nr,hcLight:Nr},w("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),Q7e=X("quickInput.foreground",{dark:Qg,light:Qg,hcDark:Qg,hcLight:Qg},w("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),J7e=X("quickInputTitle.background",{dark:new me(new Tn(255,255,255,.105)),light:new me(new Tn(0,0,0,.06)),hcDark:"#000000",hcLight:me.white},w("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),nve=X("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:me.white,hcLight:"#0F4A85"},w("pickerGroupForeground","Quick picker color for grouping labels.")),eWe=X("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:me.white,hcLight:"#0F4A85"},w("pickerGroupBorder","Quick picker color for grouping borders.")),tWe=X("keybindingLabel.background",{dark:new me(new Tn(128,128,128,.17)),light:new me(new Tn(221,221,221,.4)),hcDark:me.transparent,hcLight:me.transparent},w("keybindingLabelBackground","Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),nWe=X("keybindingLabel.foreground",{dark:me.fromHex("#CCCCCC"),light:me.fromHex("#555555"),hcDark:me.white,hcLight:qe},w("keybindingLabelForeground","Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),iWe=X("keybindingLabel.border",{dark:new me(new Tn(51,51,51,.6)),light:new me(new Tn(204,204,204,.4)),hcDark:new me(new Tn(111,195,223)),hcLight:Sn},w("keybindingLabelBorder","Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),rWe=X("keybindingLabel.bottomBorder",{dark:new me(new Tn(68,68,68,.6)),light:new me(new Tn(187,187,187,.4)),hcDark:new me(new Tn(111,195,223)),hcLight:qe},w("keybindingLabelBottomBorder","Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),Km=X("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},w("editorSelectionBackground","Color of the editor selection.")),oWe=X("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:me.white},w("editorSelectionForeground","Color of the selected text for high contrast.")),ive=X("editor.inactiveSelectionBackground",{light:It(Km,.5),dark:It(Km,.5),hcDark:It(Km,.7),hcLight:It(Km,.5)},w("editorInactiveSelection","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),Zq=X("editor.selectionHighlightBackground",{light:hre(Km,Eo,.3,.6),dark:hre(Km,Eo,.3,.6),hcDark:null,hcLight:null},w("editorSelectionHighlight","Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0);X("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:zi,hcLight:zi},w("editorSelectionHighlightBorder","Border color for regions with the same content as the selection."));X("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},w("editorFindMatch","Color of the current search match."));const ep=X("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},w("findMatchHighlight","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0);X("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},w("findRangeHighlight","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);X("editor.findMatchBorder",{light:null,dark:null,hcDark:zi,hcLight:zi},w("editorFindMatchBorder","Border color of the current search match."));const Gm=X("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:zi,hcLight:zi},w("findMatchHighlightBorder","Border color of the other search matches.")),sWe=X("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:It(zi,.4),hcLight:It(zi,.4)},w("findRangeHighlightBorder","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);X("searchEditor.findMatchBackground",{light:It(ep,.66),dark:It(ep,.66),hcDark:ep,hcLight:ep},w("searchEditor.queryMatch","Color of the Search Editor query matches."));X("searchEditor.findMatchBorder",{light:It(Gm,.66),dark:It(Gm,.66),hcDark:Gm,hcLight:Gm},w("searchEditor.editorFindMatchBorder","Border color of the Search Editor query matches."));X("search.resultsInfoForeground",{light:qe,dark:It(qe,.65),hcDark:qe,hcLight:qe},w("search.resultsInfoForeground","Color of the text in the search viewlet's completion message."));X("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},w("hoverHighlight","Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0);const oP=X("editorHoverWidget.background",{light:Nr,dark:Nr,hcDark:Nr,hcLight:Nr},w("hoverBackground","Background color of the editor hover."));X("editorHoverWidget.foreground",{light:Qg,dark:Qg,hcDark:Qg,hcLight:Qg},w("hoverForeground","Foreground color of the editor hover."));const rve=X("editorHoverWidget.border",{light:Jg,dark:Jg,hcDark:Jg,hcLight:Jg},w("hoverBorder","Border color of the editor hover."));X("editorHoverWidget.statusBarBackground",{dark:nh(oP,.2),light:hC(oP,.05),hcDark:Nr,hcLight:Nr},w("statusBarBackground","Background color of the editor hover status bar."));const aWe=X("editorLink.activeForeground",{dark:"#4E94CE",light:me.blue,hcDark:me.cyan,hcLight:"#292929"},w("activeLinkForeground","Color of active links.")),tp=X("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:me.white,hcLight:me.black},w("editorInlayHintForeground","Foreground color of inline hints")),np=X("editorInlayHint.background",{dark:It(vM,.1),light:It(vM,.1),hcDark:It(me.white,.1),hcLight:It(vM,.1)},w("editorInlayHintBackground","Background color of inline hints")),lWe=X("editorInlayHint.typeForeground",{dark:tp,light:tp,hcDark:tp,hcLight:tp},w("editorInlayHintForegroundTypes","Foreground color of inline hints for types")),cWe=X("editorInlayHint.typeBackground",{dark:np,light:np,hcDark:np,hcLight:np},w("editorInlayHintBackgroundTypes","Background color of inline hints for types")),uWe=X("editorInlayHint.parameterForeground",{dark:tp,light:tp,hcDark:tp,hcLight:tp},w("editorInlayHintForegroundParameter","Foreground color of inline hints for parameters")),dWe=X("editorInlayHint.parameterBackground",{dark:np,light:np,hcDark:np,hcLight:np},w("editorInlayHintBackgroundParameter","Background color of inline hints for parameters")),lR=X("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},w("editorLightBulbForeground","The color used for the lightbulb actions icon."));X("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon."));X("editorLightBulbAi.foreground",{dark:lR,light:lR,hcDark:lR,hcLight:lR},w("editorLightBulbAiForeground","The color used for the lightbulb AI icon."));const kH=new me(new Tn(155,185,85,.2)),TH=new me(new Tn(255,0,0,.2)),hWe=X("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},w("diffEditorInserted","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),fWe=X("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},w("diffEditorRemoved","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);X("diffEditor.insertedLineBackground",{dark:kH,light:kH,hcDark:null,hcLight:null},w("diffEditorInsertedLines","Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0);X("diffEditor.removedLineBackground",{dark:TH,light:TH,hcDark:null,hcLight:null},w("diffEditorRemovedLines","Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);X("diffEditorGutter.insertedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},w("diffEditorInsertedLineGutter","Background color for the margin where lines got inserted."));X("diffEditorGutter.removedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},w("diffEditorRemovedLineGutter","Background color for the margin where lines got removed."));const gWe=X("diffEditorOverview.insertedForeground",{dark:null,light:null,hcDark:null,hcLight:null},w("diffEditorOverviewInserted","Diff overview ruler foreground for inserted content.")),pWe=X("diffEditorOverview.removedForeground",{dark:null,light:null,hcDark:null,hcLight:null},w("diffEditorOverviewRemoved","Diff overview ruler foreground for removed content."));X("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},w("diffEditorInsertedOutline","Outline color for the text that got inserted."));X("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},w("diffEditorRemovedOutline","Outline color for text that got removed."));X("diffEditor.border",{dark:null,light:null,hcDark:Sn,hcLight:Sn},w("diffEditorBorder","Border color between the two text editors."));X("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},w("diffDiagonalFill","Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views."));X("diffEditor.unchangedRegionBackground",{dark:"sideBar.background",light:"sideBar.background",hcDark:"sideBar.background",hcLight:"sideBar.background"},w("diffEditor.unchangedRegionBackground","The background color of unchanged blocks in the diff editor."));X("diffEditor.unchangedRegionForeground",{dark:"foreground",light:"foreground",hcDark:"foreground",hcLight:"foreground"},w("diffEditor.unchangedRegionForeground","The foreground color of unchanged blocks in the diff editor."));X("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},w("diffEditor.unchangedCodeBackground","The background color of unchanged code in the diff editor."));const mWe=X("list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},w("listFocusBackground","List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),vWe=X("list.focusForeground",{dark:null,light:null,hcDark:null,hcLight:null},w("listFocusForeground","List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),_We=X("list.focusOutline",{dark:qc,light:qc,hcDark:zi,hcLight:zi},w("listFocusOutline","List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),bWe=X("list.focusAndSelectionOutline",{dark:null,light:null,hcDark:null,hcLight:null},w("listFocusAndSelectionOutline","List/Tree outline color for the focused item when the list/tree is active and selected. An active list/tree has keyboard focus, an inactive does not.")),ip=X("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:me.fromHex("#0F4A85").transparent(.1)},w("listActiveSelectionBackground","List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),Sf=X("list.activeSelectionForeground",{dark:me.white,light:me.white,hcDark:null,hcLight:null},w("listActiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),kL=X("list.activeSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},w("listActiveSelectionIconForeground","List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),CWe=X("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:me.fromHex("#0F4A85").transparent(.1)},w("listInactiveSelectionBackground","List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),yWe=X("list.inactiveSelectionForeground",{dark:null,light:null,hcDark:null,hcLight:null},w("listInactiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),wWe=X("list.inactiveSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},w("listInactiveSelectionIconForeground","List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),SWe=X("list.inactiveFocusBackground",{dark:null,light:null,hcDark:null,hcLight:null},w("listInactiveFocusBackground","List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),xWe=X("list.inactiveFocusOutline",{dark:null,light:null,hcDark:null,hcLight:null},w("listInactiveFocusOutline","List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),ove=X("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:me.white.transparent(.1),hcLight:me.fromHex("#0F4A85").transparent(.1)},w("listHoverBackground","List/Tree background when hovering over items using the mouse.")),sve=X("list.hoverForeground",{dark:null,light:null,hcDark:null,hcLight:null},w("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),LWe=X("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},w("listDropBackground","List/Tree drag and drop background when moving items over other items when using the mouse.")),EWe=X("list.dropBetweenBackground",{dark:Cf,light:Cf,hcDark:null,hcLight:null},w("listDropBetweenBackground","List/Tree drag and drop border color when moving items between items when using the mouse.")),Gu=X("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:qc,hcLight:qc},w("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree.")),cR=X("list.focusHighlightForeground",{dark:Gu,light:n$e(ip,Gu,"#BBE7FF"),hcDark:Gu,hcLight:Gu},w("listFocusHighlightForeground","List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));X("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},w("invalidItemForeground","List/Tree foreground color for invalid items, for example an unresolved root in explorer."));X("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},w("listErrorForeground","Foreground color of list items containing errors."));X("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},w("listWarningForeground","Foreground color of list items containing warnings."));const DWe=X("listFilterWidget.background",{light:hC(Nr,0),dark:nh(Nr,0),hcDark:Nr,hcLight:Nr},w("listFilterWidgetBackground","Background color of the type filter widget in lists and trees.")),IWe=X("listFilterWidget.outline",{dark:me.transparent,light:me.transparent,hcDark:"#f38518",hcLight:"#007ACC"},w("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),kWe=X("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:Sn,hcLight:Sn},w("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),TWe=X("listFilterWidget.shadow",{dark:Yg,light:Yg,hcDark:Yg,hcLight:Yg},w("listFilterWidgetShadow","Shadow color of the type filter widget in lists and trees."));X("list.filterMatchBackground",{dark:ep,light:ep,hcDark:null,hcLight:null},w("listFilterMatchHighlight","Background color of the filtered match."));X("list.filterMatchBorder",{dark:Gm,light:Gm,hcDark:Sn,hcLight:zi},w("listFilterMatchHighlightBorder","Border color of the filtered match."));const TL=X("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},w("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),NWe=X("tree.inactiveIndentGuidesStroke",{dark:It(TL,.4),light:It(TL,.4),hcDark:It(TL,.4),hcLight:It(TL,.4)},w("treeInactiveIndentGuidesStroke","Tree stroke color for the indentation guides that are not active.")),RWe=X("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},w("tableColumnsBorder","Table border color between columns.")),MWe=X("tree.tableOddRowsBackground",{dark:It(qe,.04),light:It(qe,.04),hcDark:null,hcLight:null},w("tableOddRowsBackgroundColor","Background color for odd table rows."));X("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},w("listDeemphasizedForeground","List/Tree foreground color for items that are deemphasized. "));const AWe=X("checkbox.background",{dark:yf,light:yf,hcDark:yf,hcLight:yf},w("checkbox.background","Background color of checkbox widget."));X("checkbox.selectBackground",{dark:Nr,light:Nr,hcDark:Nr,hcLight:Nr},w("checkbox.select.background","Background color of checkbox widget when the element it's in is selected."));const PWe=X("checkbox.foreground",{dark:Zg,light:Zg,hcDark:Zg,hcLight:Zg},w("checkbox.foreground","Foreground color of checkbox widget.")),OWe=X("checkbox.border",{dark:oy,light:oy,hcDark:oy,hcLight:oy},w("checkbox.border","Border color of checkbox widget."));X("checkbox.selectBorder",{dark:Cf,light:Cf,hcDark:Cf,hcLight:Cf},w("checkbox.select.border","Border color of checkbox widget when the element it's in is selected."));const ore=X("quickInput.list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},"",void 0,w("quickInput.list.focusBackground deprecation","Please use quickInputList.focusBackground instead")),$0=X("quickInputList.focusForeground",{dark:Sf,light:Sf,hcDark:Sf,hcLight:Sf},w("quickInput.listFocusForeground","Quick picker foreground color for the focused item.")),sy=X("quickInputList.focusIconForeground",{dark:kL,light:kL,hcDark:kL,hcLight:kL},w("quickInput.listFocusIconForeground","Quick picker icon foreground color for the focused item.")),H0=X("quickInputList.focusBackground",{dark:VD(ore,ip),light:VD(ore,ip),hcDark:null,hcLight:null},w("quickInput.listFocusBackground","Quick picker background color for the focused item.")),FWe=X("menu.border",{dark:null,light:null,hcDark:Sn,hcLight:Sn},w("menuBorder","Border color of menus.")),BWe=X("menu.foreground",{dark:Zg,light:Zg,hcDark:Zg,hcLight:Zg},w("menuForeground","Foreground color of menu items.")),WWe=X("menu.background",{dark:yf,light:yf,hcDark:yf,hcLight:yf},w("menuBackground","Background color of menu items.")),$We=X("menu.selectionForeground",{dark:Sf,light:Sf,hcDark:Sf,hcLight:Sf},w("menuSelectionForeground","Foreground color of the selected menu item in menus.")),HWe=X("menu.selectionBackground",{dark:ip,light:ip,hcDark:ip,hcLight:ip},w("menuSelectionBackground","Background color of the selected menu item in menus.")),VWe=X("menu.selectionBorder",{dark:null,light:null,hcDark:zi,hcLight:zi},w("menuSelectionBorder","Border color of the selected menu item in menus.")),zWe=X("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:Sn,hcLight:Sn},w("menuSeparatorBackground","Color of a separator menu item in menus.")),sre=X("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},w("toolbarHoverBackground","Toolbar background when hovering over actions using the mouse"));X("toolbar.hoverOutline",{dark:null,light:null,hcDark:zi,hcLight:zi},w("toolbarHoverOutline","Toolbar outline when hovering over actions using the mouse"));X("toolbar.activeBackground",{dark:nh(sre,.1),light:hC(sre,.1),hcDark:null,hcLight:null},w("toolbarActiveBackground","Toolbar background when holding the mouse over actions"));X("editor.snippetTabstopHighlightBackground",{dark:new me(new Tn(124,124,124,.3)),light:new me(new Tn(10,50,100,.2)),hcDark:new me(new Tn(124,124,124,.3)),hcLight:new me(new Tn(10,50,100,.2))},w("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop."));X("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hcDark:null,hcLight:null},w("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop."));X("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},w("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet."));X("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new me(new Tn(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},w("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet."));const UWe=X("breadcrumb.foreground",{light:It(qe,.8),dark:It(qe,.8),hcDark:It(qe,.8),hcLight:It(qe,.8)},w("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),jWe=X("breadcrumb.background",{light:Eo,dark:Eo,hcDark:Eo,hcLight:Eo},w("breadcrumbsBackground","Background color of breadcrumb items.")),are=X("breadcrumb.focusForeground",{light:hC(qe,.2),dark:nh(qe,.1),hcDark:nh(qe,.1),hcLight:nh(qe,.1)},w("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),KWe=X("breadcrumb.activeSelectionForeground",{light:hC(qe,.2),dark:nh(qe,.1),hcDark:nh(qe,.1),hcLight:nh(qe,.1)},w("breadcrumbsSelectedForeground","Color of selected breadcrumb items."));X("breadcrumbPicker.background",{light:Nr,dark:Nr,hcDark:Nr,hcLight:Nr},w("breadcrumbsSelectedBackground","Background color of breadcrumb item picker."));const ave=.5,lre=me.fromHex("#40C8AE").transparent(ave),cre=me.fromHex("#40A6FF").transparent(ave),ure=me.fromHex("#606060").transparent(.4),qu=.4,Mw=1,ay=X("merge.currentHeaderBackground",{dark:lre,light:lre,hcDark:null,hcLight:null},w("mergeCurrentHeaderBackground","Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);X("merge.currentContentBackground",{dark:It(ay,qu),light:It(ay,qu),hcDark:It(ay,qu),hcLight:It(ay,qu)},w("mergeCurrentContentBackground","Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const ly=X("merge.incomingHeaderBackground",{dark:cre,light:cre,hcDark:null,hcLight:null},w("mergeIncomingHeaderBackground","Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);X("merge.incomingContentBackground",{dark:It(ly,qu),light:It(ly,qu),hcDark:It(ly,qu),hcLight:It(ly,qu)},w("mergeIncomingContentBackground","Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const cy=X("merge.commonHeaderBackground",{dark:ure,light:ure,hcDark:null,hcLight:null},w("mergeCommonHeaderBackground","Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);X("merge.commonContentBackground",{dark:It(cy,qu),light:It(cy,qu),hcDark:It(cy,qu),hcLight:It(cy,qu)},w("mergeCommonContentBackground","Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const Aw=X("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},w("mergeBorder","Border color on headers and the splitter in inline merge-conflicts."));X("editorOverviewRuler.currentContentForeground",{dark:It(ay,Mw),light:It(ay,Mw),hcDark:Aw,hcLight:Aw},w("overviewRulerCurrentContentForeground","Current overview ruler foreground for inline merge-conflicts."));X("editorOverviewRuler.incomingContentForeground",{dark:It(ly,Mw),light:It(ly,Mw),hcDark:Aw,hcLight:Aw},w("overviewRulerIncomingContentForeground","Incoming overview ruler foreground for inline merge-conflicts."));X("editorOverviewRuler.commonContentForeground",{dark:It(cy,Mw),light:It(cy,Mw),hcDark:Aw,hcLight:Aw},w("overviewRulerCommonContentForeground","Common ancestor overview ruler foreground for inline merge-conflicts."));const Qq=X("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:""},w("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),NL=X("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},w("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),uy=X("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},w("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),M4=X("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},w("minimapSelectionOccurrenceHighlight","Minimap marker color for repeating editor selections."),!0),dre=X("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},w("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0),GWe=X("minimap.infoHighlight",{dark:Za,light:Za,hcDark:HD,hcLight:HD},w("minimapInfo","Minimap marker color for infos.")),qWe=X("minimap.warningHighlight",{dark:qs,light:qs,hcDark:$D,hcLight:$D},w("overviewRuleWarning","Minimap marker color for warnings.")),XWe=X("minimap.errorHighlight",{dark:new me(new Tn(255,18,18,.7)),light:new me(new Tn(255,18,18,.7)),hcDark:new me(new Tn(255,50,50,1)),hcLight:"#B5200D"},w("minimapError","Minimap marker color for errors.")),YWe=X("minimap.background",{dark:null,light:null,hcDark:null,hcLight:null},w("minimapBackground","Minimap background color.")),ZWe=X("minimap.foregroundOpacity",{dark:me.fromHex("#000f"),light:me.fromHex("#000f"),hcDark:me.fromHex("#000f"),hcLight:me.fromHex("#000f")},w("minimapForegroundOpacity",'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));X("minimapSlider.background",{light:It(EL,.5),dark:It(EL,.5),hcDark:It(EL,.5),hcLight:It(EL,.5)},w("minimapSliderBackground","Minimap slider background color."));X("minimapSlider.hoverBackground",{light:It(DL,.5),dark:It(DL,.5),hcDark:It(DL,.5),hcLight:It(DL,.5)},w("minimapSliderHoverBackground","Minimap slider background color when hovering."));X("minimapSlider.activeBackground",{light:It(IL,.5),dark:It(IL,.5),hcDark:It(IL,.5),hcLight:It(IL,.5)},w("minimapSliderActiveBackground","Minimap slider background color when clicked on."));const QWe=X("problemsErrorIcon.foreground",{dark:wf,light:wf,hcDark:wf,hcLight:wf},w("problemsErrorIconForeground","The color used for the problems error icon.")),JWe=X("problemsWarningIcon.foreground",{dark:qs,light:qs,hcDark:qs,hcLight:qs},w("problemsWarningIconForeground","The color used for the problems warning icon.")),e$e=X("problemsInfoIcon.foreground",{dark:Za,light:Za,hcDark:Za,hcLight:Za},w("problemsInfoIconForeground","The color used for the problems info icon."));X("charts.foreground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("chartsForeground","The foreground color used in charts."));X("charts.lines",{dark:It(qe,.5),light:It(qe,.5),hcDark:It(qe,.5),hcLight:It(qe,.5)},w("chartsLines","The color used for horizontal lines in charts."));X("charts.red",{dark:wf,light:wf,hcDark:wf,hcLight:wf},w("chartsRed","The red color used in chart visualizations."));X("charts.blue",{dark:Za,light:Za,hcDark:Za,hcLight:Za},w("chartsBlue","The blue color used in chart visualizations."));X("charts.yellow",{dark:qs,light:qs,hcDark:qs,hcLight:qs},w("chartsYellow","The yellow color used in chart visualizations."));X("charts.orange",{dark:uy,light:uy,hcDark:uy,hcLight:uy},w("chartsOrange","The orange color used in chart visualizations."));X("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},w("chartsGreen","The green color used in chart visualizations."));X("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},w("chartsPurple","The purple color used in chart visualizations."));function t$e(i,e){var t,n,r,o;switch(i.op){case 0:return(t=Sd(i.value,e))===null||t===void 0?void 0:t.darken(i.factor);case 1:return(n=Sd(i.value,e))===null||n===void 0?void 0:n.lighten(i.factor);case 2:return(r=Sd(i.value,e))===null||r===void 0?void 0:r.transparent(i.factor);case 3:{const s=Sd(i.background,e);return s?(o=Sd(i.value,e))===null||o===void 0?void 0:o.makeOpaque(s):Sd(i.value,e)}case 4:for(const s of i.values){const a=Sd(s,e);if(a)return a}return;case 6:return Sd(e.defines(i.if)?i.then:i.else,e);case 5:{const s=Sd(i.value,e);if(!s)return;const a=Sd(i.background,e);return a?s.isDarkerThan(a)?me.getLighterColor(s,a,i.factor).transparent(i.transparency):me.getDarkerColor(s,a,i.factor).transparent(i.transparency):s.transparent(i.factor*i.transparency)}default:throw w4()}}function hC(i,e){return{op:0,value:i,factor:e}}function nh(i,e){return{op:1,value:i,factor:e}}function It(i,e){return{op:2,value:i,factor:e}}function VD(...i){return{op:4,values:i}}function n$e(i,e,t){return{op:6,if:i,then:e,else:t}}function hre(i,e,t,n){return{op:5,value:i,background:e,factor:t,transparency:n}}function Sd(i,e){if(i!==null){if(typeof i=="string")return i[0]==="#"?me.fromHex(i):e.getColor(i);if(i instanceof me)return i;if(typeof i=="object")return t$e(i,e)}}const lve="vscode://schemas/workbench-colors",cve=ar.as(k4.JSONContribution);cve.registerSchema(lve,R4.getColorSchema());const fre=new pi(()=>cve.notifySchemaChanged(lve),200);R4.onDidChangeSchema(()=>{fre.isScheduled()||fre.schedule()});class A4{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(e){return new uve(this.x-e.scrollX,this.y-e.scrollY)}}class uve{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(e){return new A4(this.clientX+e.scrollX,this.clientY+e.scrollY)}}class i$e{constructor(e,t,n,r){this.x=e,this.y=t,this.width=n,this.height=r,this._editorPagePositionBrand=void 0}}class r$e{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function Jq(i){const e=Br(i);return new i$e(e.left,e.top,e.width,e.height)}function eX(i,e,t){const n=e.width/i.offsetWidth,r=e.height/i.offsetHeight,o=(t.x-e.x)/n,s=(t.y-e.y)/r;return new r$e(o,s)}class Yv extends Uu{constructor(e,t,n){super(Pt(n),e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new A4(this.posx,this.posy),this.editorPos=Jq(n),this.relativePos=eX(n,this.editorPos,this.pos)}}class o$e{constructor(e){this._editorViewDomNode=e}_create(e){return new Yv(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return ye(e,"contextmenu",n=>{t(this._create(n))})}onMouseUp(e,t){return ye(e,"mouseup",n=>{t(this._create(n))})}onMouseDown(e,t){return ye(e,Ge.MOUSE_DOWN,n=>{t(this._create(n))})}onPointerDown(e,t){return ye(e,Ge.POINTER_DOWN,n=>{t(this._create(n),n.pointerId)})}onMouseLeave(e,t){return ye(e,Ge.MOUSE_LEAVE,n=>{t(this._create(n))})}onMouseMove(e,t){return ye(e,"mousemove",n=>t(this._create(n)))}}class s$e{constructor(e){this._editorViewDomNode=e}_create(e){return new Yv(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return ye(e,"pointerup",n=>{t(this._create(n))})}onPointerDown(e,t){return ye(e,Ge.POINTER_DOWN,n=>{t(this._create(n),n.pointerId)})}onPointerLeave(e,t){return ye(e,Ge.POINTER_LEAVE,n=>{t(this._create(n))})}onPointerMove(e,t){return ye(e,"pointermove",n=>t(this._create(n)))}}class a$e extends fe{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new kS),this._keydownListener=null}startMonitoring(e,t,n,r,o){this._keydownListener=Sr(e.ownerDocument,"keydown",s=>{s.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,s.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,n,s=>{r(new Yv(s,!0,this._editorViewDomNode))},s=>{this._keydownListener.dispose(),o(s)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}class Wk{constructor(e){this._editor=e,this._instanceId=++Wk._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new pi(()=>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 n=this._rules.get(t);if(!n){const r=this._counter++;n=new l$e(t,`dyn-rule-${this._instanceId}-${r}`,GA(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(t,n)}return n}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(const e of this._rules.values())e.hasReferences()||(this._rules.delete(e.key),e.dispose())}}Wk._idPool=0;class l$e{constructor(e,t,n,r){this.key=e,this.className=t,this.properties=r,this._referenceCount=0,this._styleElementDisposables=new Te,this._styleElement=gc(n,void 0,this._styleElementDisposables),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let n=`.${e} {`;for(const r in t){const o=t[r];let s;typeof o=="object"?s=ht(o.id):s=o;const a=c$e(r);n+=` +`)}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function zie(i){let e=0;for(;eL===E))return new gM([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new gM([new hh(new pn(1,e.length+1),new pn(1,t.length+1),[new qv(new B(1,1,e.length,e[0].length+1),new B(1,1,t.length,t[0].length+1))])],[],!1);const r=n.maxComputationTimeMs===0?PD.instance:new m9e(n.maxComputationTimeMs),o=!n.ignoreTrimWhitespace,s=new Map;function a(L){let E=s.get(L);return E===void 0&&(E=s.size,s.set(L,E)),E}const l=e.map(L=>a(L.trim())),c=t.map(L=>a(L.trim())),u=new Vie(l,e),d=new Vie(c,t),h=(()=>u.length+d.length<1700?this.dynamicProgrammingDiffing.compute(u,d,r,(L,E)=>e[L]===t[E]?t[E].length===0?.1:1+Math.log(1+t[E].length):.99):this.myersDiffingAlgorithm.compute(u,d))();let f=h.diffs,g=h.hitTimeout;f=yH(u,d,f),f=P9e(u,d,f);const p=[],v=L=>{if(o)for(let E=0;EL.seq1Range.start-m===L.seq2Range.start-_);const E=L.seq1Range.start-m;v(E),m=L.seq1Range.endExclusive,_=L.seq2Range.endExclusive;const D=this.refineDiff(e,t,L,r,o);D.hitTimeout&&(g=!0);for(const k of D.mappings)p.push(k)}v(e.length-m);const y=Uie(p,e,t);let S=[];return n.computeMoves&&(S=this.computeMoves(y,e,t,l,c,r,o)),Ew(()=>{function L(D,k){if(D.lineNumber<1||D.lineNumber>k.length)return!1;const T=k[D.lineNumber-1];return!(D.column<1||D.column>T.length+1)}function E(D,k){return!(D.startLineNumber<1||D.startLineNumber>k.length+1||D.endLineNumberExclusive<1||D.endLineNumberExclusive>k.length+1)}for(const D of y){if(!D.innerChanges)return!1;for(const k of D.innerChanges)if(!(L(k.modifiedRange.getStartPosition(),t)&&L(k.modifiedRange.getEndPosition(),t)&&L(k.originalRange.getStartPosition(),e)&&L(k.originalRange.getEndPosition(),e)))return!1;if(!E(D.modified,t)||!E(D.original,e))return!1}return!0}),new gM(y,S,g)}computeMoves(e,t,n,r,o,s,a){return L9e(e,t,n,r,o,s).map(u=>{const d=this.refineDiff(t,n,new So(u.original.toOffsetRange(),u.modified.toOffsetRange()),s,a),h=Uie(d.mappings,t,n,!0);return new Bme(u,h)})}refineDiff(e,t,n,r,o){const s=new tP(e,n.seq1Range,o),a=new tP(t,n.seq2Range,o),l=s.length+a.length<500?this.dynamicProgrammingDiffing.compute(s,a,r):this.myersDiffingAlgorithm.compute(s,a,r);let c=l.diffs;return c=yH(s,a,c),c=M9e(s,a,c),c=R9e(s,a,c),c=O9e(s,a,c),{mappings:c.map(d=>new qv(s.translateRange(d.seq1Range),a.translateRange(d.seq2Range))),hitTimeout:l.hitTimeout}}}function Uie(i,e,t,n=!1){const r=[];for(const o of QG(i.map(s=>F9e(s,e,t)),(s,a)=>s.original.overlapOrTouch(a.original)||s.modified.overlapOrTouch(a.modified))){const s=o[0],a=o[o.length-1];r.push(new hh(s.original.join(a.original),s.modified.join(a.modified),o.map(l=>l.innerChanges[0])))}return Ew(()=>!n&&r.length>0&&r[0].original.startLineNumber!==r[0].modified.startLineNumber?!1:pme(r,(o,s)=>s.original.startLineNumber-o.original.endLineNumberExclusive===s.modified.startLineNumber-o.modified.endLineNumberExclusive&&o.original.endLineNumberExclusive=t[i.modifiedRange.startLineNumber-1].length&&i.originalRange.startColumn-1>=e[i.originalRange.startLineNumber-1].length&&i.originalRange.startLineNumber<=i.originalRange.endLineNumber+r&&i.modifiedRange.startLineNumber<=i.modifiedRange.endLineNumber+r&&(n=1);const o=new pn(i.originalRange.startLineNumber+n,i.originalRange.endLineNumber+1+r),s=new pn(i.modifiedRange.startLineNumber+n,i.modifiedRange.endLineNumber+1+r);return new hh(o,s,[i])}const jie={getLegacy:()=>new h9e,getDefault:()=>new Hme};function bv(i,e){const t=Math.pow(10,e);return Math.round(i*t)/t}class Tn{constructor(e,t,n,r=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,e))|0,this.g=Math.min(255,Math.max(0,t))|0,this.b=Math.min(255,Math.max(0,n))|0,this.a=bv(Math.max(Math.min(1,r),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class $u{constructor(e,t,n,r){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=bv(Math.max(Math.min(1,t),0),3),this.l=bv(Math.max(Math.min(1,n),0),3),this.a=bv(Math.max(Math.min(1,r),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,n=e.g/255,r=e.b/255,o=e.a,s=Math.max(t,n,r),a=Math.min(t,n,r);let l=0,c=0;const u=(a+s)/2,d=s-a;if(d>0){switch(c=Math.min(u<=.5?d/(2*u):d/(2-2*u),1),s){case t:l=(n-r)/d+(n1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}static toRGBA(e){const t=e.h/360,{s:n,l:r,a:o}=e;let s,a,l;if(n===0)s=a=l=r;else{const c=r<.5?r*(1+n):r+n-r*n,u=2*r-c;s=$u._hue2rgb(u,c,t+1/3),a=$u._hue2rgb(u,c,t),l=$u._hue2rgb(u,c,t-1/3)}return new Tn(Math.round(s*255),Math.round(a*255),Math.round(l*255),o)}}class bf{constructor(e,t,n,r){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=bv(Math.max(Math.min(1,t),0),3),this.v=bv(Math.max(Math.min(1,n),0),3),this.a=bv(Math.max(Math.min(1,r),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,n=e.g/255,r=e.b/255,o=Math.max(t,n,r),s=Math.min(t,n,r),a=o-s,l=o===0?0:a/o;let c;return a===0?c=0:o===t?c=((n-r)/a%6+6)%6:o===n?c=(r-t)/a+2:c=(t-n)/a+4,new bf(Math.round(c*60),l,o,e.a)}static toRGBA(e){const{h:t,s:n,v:r,a:o}=e,s=r*n,a=s*(1-Math.abs(t/60%2-1)),l=r-s;let[c,u,d]=[0,0,0];return t<60?(c=s,u=a):t<120?(c=a,u=s):t<180?(u=s,d=a):t<240?(u=a,d=s):t<300?(c=a,d=s):t<=360&&(c=s,d=a),c=Math.round((c+l)*255),u=Math.round((u+l)*255),d=Math.round((d+l)*255),new Tn(c,u,d,o)}}class me{static fromHex(e){return me.Format.CSS.parseHex(e)||me.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:$u.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:bf.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof Tn)this.rgba=e;else if(e instanceof $u)this._hsla=e,this.rgba=$u.toRGBA(e);else if(e instanceof bf)this._hsva=e,this.rgba=bf.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&Tn.equals(this.rgba,e.rgba)&&$u.equals(this.hsla,e.hsla)&&bf.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=me._relativeLuminanceForComponent(this.rgba.r),t=me._relativeLuminanceForComponent(this.rgba.g),n=me._relativeLuminanceForComponent(this.rgba.b),r=.2126*e+.7152*t+.0722*n;return bv(r,4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}isLighter(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3>=128}isLighterThan(e){const t=this.getRelativeLuminance(),n=e.getRelativeLuminance();return t>n}isDarkerThan(e){const t=this.getRelativeLuminance(),n=e.getRelativeLuminance();return t0)for(const r of n){const o=r.filter(c=>c!==void 0),s=o[1],a=o[2];if(!a)continue;let l;if(s==="rgb"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;l=Kie(Ax(i,r),Px(a,c),!1)}else if(s==="rgba"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=Kie(Ax(i,r),Px(a,c),!0)}else if(s==="hsl"){const c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;l=Gie(Ax(i,r),Px(a,c),!1)}else if(s==="hsla"){const c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=Gie(Ax(i,r),Px(a,c),!0)}else s==="#"&&(l=B9e(Ax(i,r),s+a));l&&e.push(l)}return e}function $9e(i){return!i||typeof i.getValue!="function"||typeof i.positionAt!="function"?[]:W9e(i)}class H9e extends z6e{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}findMatches(e){const t=[];for(let n=0;nthis._lines.length)t=this._lines.length,n=this._lines[t-1].length+1,r=!0;else{const o=this._lines[t-1].length+1;n<1?(n=1,r=!0):n>o&&(n=o,r=!0)}return r?{lineNumber:t,column:n}:e}}class Cv{constructor(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(e){return this._models[e]}_getModels(){const e=[];return Object.keys(this._models).forEach(t=>e.push(this._models[t])),e}acceptNewModel(e){this._models[e.url]=new H9e(At.parse(e.url),e.lines,e.EOL,e.versionId)}acceptModelChanged(e,t){if(!this._models[e])return;this._models[e].onEvents(t)}acceptRemovedModel(e){this._models[e]&&delete this._models[e]}async computeUnicodeHighlights(e,t,n){const r=this._getModel(e);return r?Oq.computeUnicodeHighlights(r,t,n):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}}async computeDiff(e,t,n,r){const o=this._getModel(e),s=this._getModel(t);return!o||!s?null:Cv.computeDiff(o,s,n,r)}static computeDiff(e,t,n,r){const o=r==="advanced"?jie.getDefault():jie.getLegacy(),s=e.getLinesContent(),a=t.getLinesContent(),l=o.computeDiff(s,a,n),c=l.changes.length>0?!1:this._modelsAreIdentical(e,t);function u(d){return d.map(h=>{var f;return[h.original.startLineNumber,h.original.endLineNumberExclusive,h.modified.startLineNumber,h.modified.endLineNumberExclusive,(f=h.innerChanges)===null||f===void 0?void 0:f.map(g=>[g.originalRange.startLineNumber,g.originalRange.startColumn,g.originalRange.endLineNumber,g.originalRange.endColumn,g.modifiedRange.startLineNumber,g.modifiedRange.startColumn,g.modifiedRange.endLineNumber,g.modifiedRange.endColumn])]})}return{identical:c,quitEarly:l.hitTimeout,changes:u(l.changes),moves:l.moves.map(d=>[d.lineRangeMapping.original.startLineNumber,d.lineRangeMapping.original.endLineNumberExclusive,d.lineRangeMapping.modified.startLineNumber,d.lineRangeMapping.modified.endLineNumberExclusive,u(d.changes)])}}static _modelsAreIdentical(e,t){const n=e.getLineCount(),r=t.getLineCount();if(n!==r)return!1;for(let o=1;o<=n;o++){const s=e.getLineContent(o),a=t.getLineContent(o);if(s!==a)return!1}return!0}async computeMoreMinimalEdits(e,t,n){const r=this._getModel(e);if(!r)return t;const o=[];let s;t=t.slice(0).sort((l,c)=>{if(l.range&&c.range)return B.compareRangesUsingStarts(l.range,c.range);const u=l.range?0:1,d=c.range?0:1;return u-d});let a=0;for(let l=1;lCv._diffLimit){o.push({range:l,text:c});continue}const h=$6e(d,c,n),f=r.offsetAt(B.lift(l).getStartPosition());for(const g of h){const p=r.positionAt(f+g.originalStart),v=r.positionAt(f+g.originalStart+g.originalLength),m={text:c.substr(g.modifiedStart,g.modifiedLength),range:{startLineNumber:p.lineNumber,startColumn:p.column,endLineNumber:v.lineNumber,endColumn:v.column}};r.getValueInRange(m.range)!==m.text&&o.push(m)}}return typeof s=="number"&&o.push({eol:s,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),o}async computeLinks(e){const t=this._getModel(e);return t?q6e(t):null}async computeDefaultDocumentColors(e){const t=this._getModel(e);return t?$9e(t):null}async textualSuggest(e,t,n,r){const o=new Ms,s=new RegExp(n,r),a=new Set;e:for(const l of e){const c=this._getModel(l);if(c){for(const u of c.words(s))if(!(u===t||!isNaN(Number(u)))&&(a.add(u),a.size>Cv._suggestionsLimit))break e}}return{words:Array.from(a),duration:o.elapsed()}}async computeWordRanges(e,t,n,r){const o=this._getModel(e);if(!o)return Object.create(null);const s=new RegExp(n,r),a=Object.create(null);for(let l=t.startLineNumber;lthis._host.fhr(a,l)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(s,t),Promise.resolve(tq(this._foreignModule))):Promise.reject(new Error("Unexpected usage"))}fmr(e,t){if(!this._foreignModule||typeof this._foreignModule[e]!="function")return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(n){return Promise.reject(n)}}}Cv._diffLimit=1e5;Cv._suggestionsLimit=1e4;typeof importScripts=="function"&&(globalThis.monaco=Npe());const Hq=yn("textResourceConfigurationService"),zme=yn("textResourcePropertiesService"),_t=yn("ILanguageFeaturesService");var V9e=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Ox=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const qie=60*1e3,Xie=5*60*1e3;function S0(i,e){const t=i.getModel(e);return!(!t||t.isTooLargeForSyncing())}let wH=class extends fe{constructor(e,t,n,r,o){super(),this._modelService=e,this._workerManager=this._register(new U9e(this._modelService,r)),this._logService=n,this._register(o.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(s,a)=>S0(this._modelService,s.uri)?this._workerManager.withWorker().then(l=>l.computeLinks(s.uri)).then(l=>l&&{links:l}):Promise.resolve({links:[]})})),this._register(o.completionProvider.register("*",new z9e(this._workerManager,t,this._modelService,r)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return S0(this._modelService,e)}computedUnicodeHighlights(e,t,n){return this._workerManager.withWorker().then(r=>r.computedUnicodeHighlights(e,t,n))}async computeDiff(e,t,n,r){const o=await this._workerManager.withWorker().then(l=>l.computeDiff(e,t,n,r));if(!o)return null;return{identical:o.identical,quitEarly:o.quitEarly,changes:a(o.changes),moves:o.moves.map(l=>new Bme(new Ya(new pn(l[0],l[1]),new pn(l[2],l[3])),a(l[4])))};function a(l){return l.map(c=>{var u;return new hh(new pn(c[0],c[1]),new pn(c[2],c[3]),(u=c[4])===null||u===void 0?void 0:u.map(d=>new qv(new B(d[0],d[1],d[2],d[3]),new B(d[4],d[5],d[6],d[7]))))})}}computeMoreMinimalEdits(e,t,n=!1){if(Ts(t)){if(!S0(this._modelService,e))return Promise.resolve(t);const r=Ms.create(),o=this._workerManager.withWorker().then(s=>s.computeMoreMinimalEdits(e,t,n));return o.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),r.elapsed())),Promise.race([o,Uv(1e3).then(()=>t)])}else return Promise.resolve(void 0)}canNavigateValueSet(e){return S0(this._modelService,e)}navigateValueSet(e,t,n){return this._workerManager.withWorker().then(r=>r.navigateValueSet(e,t,n))}canComputeWordRanges(e){return S0(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then(n=>n.computeWordRanges(e,t))}};wH=V9e([Ox(0,tr),Ox(1,Hq),Ox(2,Ta),Ox(3,Di),Ox(4,_t)],wH);class z9e{constructor(e,t,n,r){this.languageConfigurationService=r,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=n}async provideCompletionItems(e,t){const n=this._configurationService.getValue(e.uri,t,"editor");if(n.wordBasedSuggestions==="off")return;const r=[];if(n.wordBasedSuggestions==="currentDocument")S0(this._modelService,e.uri)&&r.push(e.uri);else for(const d of this._modelService.getModels())S0(this._modelService,d.uri)&&(d===e?r.unshift(d.uri):(n.wordBasedSuggestions==="allDocuments"||d.getLanguageId()===e.getLanguageId())&&r.push(d.uri));if(r.length===0)return;const o=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),s=e.getWordAtPosition(t),a=s?new B(t.lineNumber,s.startColumn,t.lineNumber,s.endColumn):B.fromPositions(t),l=a.setEndPosition(t.lineNumber,t.column),u=await(await this._workerManager.withWorker()).textualSuggest(r,s==null?void 0:s.word,o);if(u)return{duration:u.duration,suggestions:u.words.map(d=>({kind:18,label:d,insertText:d,range:{insert:l,replace:a}}))}}}class U9e extends fe{constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new Eq).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(Xie/2),M5e),this._register(this._modelService.onModelRemoved(r=>this._checkStopEmptyWorker()))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){if(!this._editorWorkerClient)return;this._modelService.getModels().length===0&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){if(!this._editorWorkerClient)return;new Date().getTime()-this._lastWorkerUsedTime>Xie&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new Vq(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class j9e extends fe{constructor(e,t,n){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!n){const r=new Sq;r.cancelAndSet(()=>this._checkStopModelSync(),Math.round(qie/2)),this._register(r)}}dispose(){for(const e in this._syncedModels)si(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){for(const n of e){const r=n.toString();this._syncedModels[r]||this._beginModelSync(n,t),this._syncedModels[r]&&(this._syncedModelsLastUsedTime[r]=new Date().getTime())}}_checkStopModelSync(){const e=new Date().getTime(),t=[];for(const n in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[n]>qie&&t.push(n);for(const n of t)this._stopModelSync(n)}_beginModelSync(e,t){const n=this._modelService.getModel(e);if(!n||!t&&n.isTooLargeForSyncing())return;const r=e.toString();this._proxy.acceptNewModel({url:n.uri.toString(),lines:n.getLinesContent(),EOL:n.getEOL(),versionId:n.getVersionId()});const o=new Te;o.add(n.onDidChangeContent(s=>{this._proxy.acceptModelChanged(r.toString(),s)})),o.add(n.onWillDispose(()=>{this._stopModelSync(r)})),o.add(Rt(()=>{this._proxy.acceptRemovedModel(r)})),this._syncedModels[r]=o}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],si(t)}}class Yie{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class x6{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class Vq extends fe{constructor(e,t,n,r){super(),this.languageConfigurationService=r,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new x4(n),this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(new J8e(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new x6(this)))}catch(e){fH(e),this._worker=new Yie(new Cv(new x6(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(fH(e),this._worker=new Yie(new Cv(new x6(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new j9e(e,this._modelService,this._keepIdleModels))),this._modelManager}async _withSyncedResources(e,t=!1){return this._disposed?Promise.reject(q3e()):this._getProxy().then(n=>(this._getOrCreateModelManager(n).ensureSyncedResources(e,t),n))}computedUnicodeHighlights(e,t,n){return this._withSyncedResources([e]).then(r=>r.computeUnicodeHighlights(e.toString(),t,n))}computeDiff(e,t,n,r){return this._withSyncedResources([e,t],!0).then(o=>o.computeDiff(e.toString(),t.toString(),n,r))}computeMoreMinimalEdits(e,t,n){return this._withSyncedResources([e]).then(r=>r.computeMoreMinimalEdits(e.toString(),t,n))}computeLinks(e){return this._withSyncedResources([e]).then(t=>t.computeLinks(e.toString()))}computeDefaultDocumentColors(e){return this._withSyncedResources([e]).then(t=>t.computeDefaultDocumentColors(e.toString()))}async textualSuggest(e,t,n){const r=await this._withSyncedResources(e),o=n.source,s=n.flags;return r.textualSuggest(e.map(a=>a.toString()),t,o,s)}computeWordRanges(e,t){return this._withSyncedResources([e]).then(n=>{const r=this._modelService.getModel(e);if(!r)return Promise.resolve(null);const o=this.languageConfigurationService.getLanguageConfiguration(r.getLanguageId()).getWordDefinition(),s=o.source,a=o.flags;return n.computeWordRanges(e.toString(),t,s,a)})}navigateValueSet(e,t,n){return this._withSyncedResources([e]).then(r=>{const o=this._modelService.getModel(e);if(!o)return null;const s=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId()).getWordDefinition(),a=s.source,l=s.flags;return r.navigateValueSet(e.toString(),t,n,a,l)})}dispose(){super.dispose(),this._disposed=!0}}function K9e(i,e,t){return new G9e(i,e,t)}class G9e extends Vq{constructor(e,t,n){super(e,n.keepIdleModels||!1,n.label,t),this._foreignModuleId=n.moduleId,this._foreignModuleCreateData=n.createData||null,this._foreignModuleHost=n.host||null,this._foreignProxy=null}fhr(e,t){if(!this._foreignModuleHost||typeof this._foreignModuleHost[e]!="function")return Promise.reject(new Error("Missing method "+e+" or missing main thread foreign host."));try{return Promise.resolve(this._foreignModuleHost[e].apply(this._foreignModuleHost,t))}catch(n){return Promise.reject(n)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then(e=>{const t=this._foreignModuleHost?tq(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then(n=>{this._foreignModuleCreateData=null;const r=(a,l)=>e.fmr(a,l),o=(a,l)=>function(){const c=Array.prototype.slice.call(arguments,0);return l(a,c)},s={};for(const a of n)s[a]=o(a,r);return s})})),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then(t=>this.getProxy())}}const Ok={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"},Nw=new class{clone(){return this}equals(i){return this===i}};function zq(i,e){return new fq([new wD(0,"",i)],e)}function T4(i,e){const t=new Uint32Array(2);return t[0]=0,t[1]=(i<<0|0<<8|0<<11|1<<15|2<<24)>>>0,new s4(t,e===null?Nw:e)}class us{static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static getClassNameFromMetadata(e){let n="mtk"+this.getForeground(e);const r=this.getFontStyle(e);return r&1&&(n+=" mtki"),r&2&&(n+=" mtkb"),r&4&&(n+=" mtku"),r&8&&(n+=" mtks"),n}static getInlineStyleFromMetadata(e,t){const n=this.getForeground(e),r=this.getFontStyle(e);let o=`color: ${t[n]};`;r&1&&(o+="font-style: italic;"),r&2&&(o+="font-weight: bold;");let s="";return r&4&&(s+=" underline"),r&8&&(s+=" line-through"),s&&(o+=`text-decoration:${s};`),o}static getPresentationFromMetadata(e){const t=this.getForeground(e),n=this.getFontStyle(e);return{foreground:t,italic:!!(n&1),bold:!!(n&2),underline:!!(n&4),strikethrough:!!(n&8)}}}class Lo{static createEmpty(e,t){const n=Lo.defaultTokenMetadata,r=new Uint32Array(2);return r[0]=e.length,r[1]=n,new Lo(r,e,t)}constructor(e,t,n){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this._languageIdCodec=n}equals(e){return e instanceof Lo?this.slicedEquals(e,0,this._tokensCount):!1}slicedEquals(e,t,n){if(this._text!==e._text||this._tokensCount!==e._tokensCount)return!1;const r=t<<1,o=r+(n<<1);for(let s=r;s0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[(e<<1)+1]}getLanguageId(e){const t=this._tokens[(e<<1)+1],n=us.getLanguageId(t);return this._languageIdCodec.decodeLanguageId(n)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return us.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return us.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return us.getClassNameFromMetadata(t)}getInlineStyle(e,t){const n=this._tokens[(e<<1)+1];return us.getInlineStyleFromMetadata(n,t)}getPresentation(e){const t=this._tokens[(e<<1)+1];return us.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return Lo.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,n){return new Uq(this,e,t,n)}static convertToEndOffset(e,t){const r=(e.length>>>1)-1;for(let o=0;o>>1)-1;for(;nt&&(r=o)}return n}withInserted(e){if(e.length===0)return this;let t=0,n=0,r="";const o=new Array;let s=0;for(;;){const a=ts){r+=this._text.substring(s,l.offset);const c=this._tokens[(t<<1)+1];o.push(r.length,c),s=l.offset}r+=l.text,o.push(r.length,l.tokenMetadata),n++}else break}return new Lo(new Uint32Array(o),r,this._languageIdCodec)}}Lo.defaultTokenMetadata=(0<<11|1<<15|2<<24)>>>0;class Uq{constructor(e,t,n,r){this._source=e,this._startOffset=t,this._endOffset=n,this._deltaOffset=r,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(let o=this._firstTokenIndex,s=e.getCount();o=n);o++)this._tokensCount++}getMetadata(e){return this._source.getMetadata(this._firstTokenIndex+e)}getLanguageId(e){return this._source.getLanguageId(this._firstTokenIndex+e)}getLineContent(){return this._source.getLineContent().substring(this._startOffset,this._endOffset)}equals(e){return e instanceof Uq?this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount):!1}getCount(){return this._tokensCount}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){const t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)}getPresentation(e){return this._source.getPresentation(this._firstTokenIndex+e)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}}class Ca{constructor(e,t,n,r){this.startColumn=e,this.endColumn=t,this.className=n,this.type=r,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 n=e.length,r=t.length;if(n!==r)return!1;for(let o=0;o=o||(a[l++]=new Ca(Math.max(1,c.startColumn-r+1),Math.min(s+1,c.endColumn-r+1),c.className,c.type));return a}static filter(e,t,n,r){if(e.length===0)return[];const o=[];let s=0;for(let a=0,l=e.length;at||u.isEmpty()&&(c.type===0||c.type===3))continue;const d=u.startLineNumber===t?u.startColumn:n,h=u.endLineNumber===t?u.endColumn:r;o[s++]=new Ca(d,h,c.inlineClassName,c.type)}return o}static _typeCompare(e,t){const n=[2,0,1,3];return n[e]-n[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 n=Ca._typeCompare(e.type,t.type);return n!==0?n:e.className!==t.className?e.className0&&this.stopOffsets[0]0&&t=e){this.stopOffsets.splice(r,0,e),this.classNames.splice(r,0,t),this.metadata.splice(r,0,n);break}this.count++}}class q9e{static normalize(e,t){if(t.length===0)return[];const n=[],r=new nP;let o=0;for(let s=0,a=t.length;s1){const p=e.charCodeAt(c-2);xo(p)&&c--}if(u>1){const p=e.charCodeAt(u-2);xo(p)&&u--}const f=c-1,g=u-2;o=r.consumeLowerThan(f,o,n),r.count===0&&(o=f),r.insert(g,d,h)}return r.consumeLowerThan(1073741824,o,n),n}}class Wo{constructor(e,t,n,r){this.endIndex=e,this.type=t,this.metadata=n,this.containsRTL=r,this._linePartBrand=void 0}isWhitespace(){return!!(this.metadata&1)}isPseudoAfter(){return!!(this.metadata&4)}}class Ume{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class D_{constructor(e,t,n,r,o,s,a,l,c,u,d,h,f,g,p,v,m,_,y){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=n,this.continuesWithWrappedLine=r,this.isBasicASCII=o,this.containsRTL=s,this.fauxIndentLength=a,this.lineTokens=l,this.lineDecorations=c.sort(Ca.compare),this.tabSize=u,this.startVisibleColumn=d,this.spaceWidth=h,this.stopRenderingLineAfter=p,this.renderWhitespace=v==="all"?4:v==="boundary"?1:v==="selection"?2:v==="trailing"?3:0,this.renderControlCharacters=m,this.fontLigatures=_,this.selectionsOnLine=y&&y.sort((E,D)=>E.startOffset>>16}static getCharIndex(e){return(e&65535)>>>0}constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._horizontalOffset=new Uint32Array(this.length)}setColumnInfo(e,t,n,r){const o=(t<<16|n<<0)>>>0;this._data[e-1]=o,this._horizontalOffset[e-1]=r}getHorizontalOffset(e){return this._horizontalOffset.length===0?0:this._horizontalOffset[e-1]}charOffsetToPartData(e){return this.length===0?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}getDomPosition(e){const t=this.charOffsetToPartData(e-1),n=of.getPartIndex(t),r=of.getCharIndex(t);return new jme(n,r)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,n){if(this.length===0)return 0;const r=(e<<16|n<<0)>>>0;let o=0,s=this.length-1;for(;o+1>>1,v=this._data[p];if(v===r)return p;v>r?s=p:o=p}if(o===s)return o;const a=this._data[o],l=this._data[s];if(a===r)return o;if(l===r)return s;const c=of.getPartIndex(a),u=of.getCharIndex(a),d=of.getPartIndex(l);let h;c!==d?h=t:h=of.getCharIndex(l);const f=n-u,g=h-n;return f<=g?o:s}}class SH{constructor(e,t,n){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=n}}function Fk(i,e){if(i.lineContent.length===0){if(i.lineDecorations.length>0){e.appendString("");let t=0,n=0,r=0;for(const s of i.lineDecorations)(s.type===1||s.type===2)&&(e.appendString(''),s.type===1&&(r|=1,t++),s.type===2&&(r|=2,n++));e.appendString("");const o=new of(1,t+n);return o.setColumnInfo(1,t,0,0),new SH(o,!1,r)}return e.appendString(""),new SH(new of(0,0),!1,0)}return i7e(Z9e(i),e)}class X9e{constructor(e,t,n,r){this.characterMapping=e,this.html=t,this.containsRTL=n,this.containsForeignElements=r}}function N4(i){const e=new DS(1e4),t=Fk(i,e);return new X9e(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}class Y9e{constructor(e,t,n,r,o,s,a,l,c,u,d,h,f,g,p,v){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=n,this.len=r,this.isOverflowing=o,this.overflowingCharCount=s,this.parts=a,this.containsForeignElements=l,this.fauxIndentLength=c,this.tabSize=u,this.startVisibleColumn=d,this.containsRTL=h,this.spaceWidth=f,this.renderSpaceCharCode=g,this.renderWhitespace=p,this.renderControlCharacters=v}}function Z9e(i){const e=i.lineContent;let t,n,r;i.stopRenderingLineAfter!==-1&&i.stopRenderingLineAfter0){for(let a=0,l=i.lineDecorations.length;a0&&(o[s++]=new Wo(n,"",0,!1));let a=n;for(let l=0,c=t.getCount();l=r){const f=e?xw(i.substring(a,r)):!1;o[s++]=new Wo(r,d,0,f);break}const h=e?xw(i.substring(a,u)):!1;o[s++]=new Wo(u,d,0,h),a=u}return o}function J9e(i,e,t){let n=0;const r=[];let o=0;if(t)for(let s=0,a=e.length;s=50&&(r[o++]=new Wo(f+1,u,d,h),g=f+1,f=-1);g!==c&&(r[o++]=new Wo(c,u,d,h))}else r[o++]=l;n=c}else for(let s=0,a=e.length;s50){const d=l.type,h=l.metadata,f=l.containsRTL,g=Math.ceil(u/50);for(let p=1;p=8234&&i<=8238||i>=8294&&i<=8297||i>=8206&&i<=8207||i===1564}function e7e(i,e){const t=[];let n=new Wo(0,"",0,!1),r=0;for(const o of e){const s=o.endIndex;for(;rn.endIndex&&(n=new Wo(r,o.type,o.metadata,o.containsRTL),t.push(n)),n=new Wo(r+1,"mtkcontrol",o.metadata,!1),t.push(n))}r>n.endIndex&&(n=new Wo(s,o.type,o.metadata,o.containsRTL),t.push(n))}return t}function t7e(i,e,t,n){const r=i.continuesWithWrappedLine,o=i.fauxIndentLength,s=i.tabSize,a=i.startVisibleColumn,l=i.useMonospaceOptimizations,c=i.selectionsOnLine,u=i.renderWhitespace===1,d=i.renderWhitespace===3,h=i.renderSpaceWidth!==i.spaceWidth,f=[];let g=0,p=0,v=n[p].type,m=n[p].containsRTL,_=n[p].endIndex;const y=n.length;let S=!1,L=Ys(e),E;L===-1?(S=!0,L=t,E=t):E=th(e);let D=!1,k=0,T=c&&c[k],M=a%s;for(let N=o;N=T.endOffset&&(k++,T=c&&c[k]);let F;if(NE)F=!0;else if(R===9)F=!0;else if(R===32)if(u)if(D)F=!0;else{const W=N+1N),F&&d&&(F=S||N>E),F&&m&&N>=L&&N<=E&&(F=!1),D){if(!F||!l&&M>=s){if(h){const W=g>0?f[g-1].endIndex:o;for(let H=W+1;H<=N;H++)f[g++]=new Wo(H,"mtkw",1,!1)}else f[g++]=new Wo(N,"mtkw",1,!1);M=M%s}}else(N===_||F&&N>o)&&(f[g++]=new Wo(N,v,0,m),M=M%s);for(R===9?M=s:zv(R)?M+=2:M++,D=F;N===_&&(p++,p0?e.charCodeAt(t-1):0,R=t>1?e.charCodeAt(t-2):0;N===32&&R!==32&&R!==9||(A=!0)}else A=!0;if(A)if(h){const N=g>0?f[g-1].endIndex:o;for(let R=N+1;R<=t;R++)f[g++]=new Wo(R,"mtkw",1,!1)}else f[g++]=new Wo(t,"mtkw",1,!1);else f[g++]=new Wo(t,v,0,m);return f}function n7e(i,e,t,n){n.sort(Ca.compare);const r=q9e.normalize(i,n),o=r.length;let s=0;const a=[];let l=0,c=0;for(let d=0,h=t.length;dc&&(c=_.startOffset,a[l++]=new Wo(c,p,v,m)),_.endOffset+1<=g)c=_.endOffset+1,a[l++]=new Wo(c,p+" "+_.className,v|_.metadata,m),s++;else{c=g,a[l++]=new Wo(c,p+" "+_.className,v|_.metadata,m);break}}g>c&&(c=g,a[l++]=new Wo(c,p,v,m))}const u=t[t.length-1].endIndex;if(s'):e.appendString("");for(let T=0,M=c.length;T=u&&(re+=J)}}for(H&&(e.appendString(' style="width:'),e.appendString(String(g*U)),e.appendString('px"')),e.appendASCIICharCode(62);S1?e.appendCharCode(8594):e.appendCharCode(65515);for(let J=2;J<=Y;J++)e.appendCharCode(160)}else re=2,Y=1,e.appendCharCode(p),e.appendCharCode(8204);E+=re,D+=Y,S>=u&&(L+=Y)}}else for(e.appendASCIICharCode(62);S=u&&(L+=re)}G?k++:k=0,S>=s&&!y&&A.isPseudoAfter()&&(y=!0,_.setColumnInfo(S+1,T,E,D)),e.appendString("")}return y||_.setColumnInfo(s+1,c.length-1,E,D),a&&(e.appendString(''),e.appendString(w("showMore","Show more ({0})",o7e(l))),e.appendString("")),e.appendString(""),new SH(_,f,r)}function r7e(i){return i.toString(16).toUpperCase().padStart(4,"0")}function o7e(i){return i<1024?w("overflow.chars","{0} chars",i):i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/1024/1024).toFixed(1)} MB`}class Qie{constructor(e,t,n,r){this._viewportBrand=void 0,this.top=e|0,this.left=t|0,this.width=n|0,this.height=r|0}}class s7e{constructor(e,t){this.tabSize=e,this.data=t}}class jq{constructor(e,t,n,r,o,s,a){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=n,this.maxColumn=r,this.startVisibleColumn=o,this.tokens=s,this.inlineDecorations=a}}class vc{constructor(e,t,n,r,o,s,a,l,c,u){this.minColumn=e,this.maxColumn=t,this.content=n,this.continuesWithWrappedLine=r,this.isBasicASCII=vc.isBasicASCII(n,s),this.containsRTL=vc.containsRTL(n,this.isBasicASCII,o),this.tokens=a,this.inlineDecorations=l,this.tabSize=c,this.startVisibleColumn=u}static isBasicASCII(e,t){return t?Tk(e):!0}static containsRTL(e,t,n){return!t&&n?xw(e):!1}}class dE{constructor(e,t,n){this.range=e,this.inlineClassName=t,this.type=n}}class a7e{constructor(e,t,n,r){this.startOffset=e,this.endOffset=t,this.inlineClassName=n,this.inlineClassNameAffectsLetterSpacing=r}toInlineDecoration(e){return new dE(new B(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class Gme{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}class OD{constructor(e,t,n){this.color=e,this.zIndex=t,this.data=n}static compareByRenderingProps(e,t){return e.zIndex===t.zIndex?e.colort.color?1:0:e.zIndex-t.zIndex}static equals(e,t){return e.color===t.color&&e.zIndex===t.zIndex&&or(e.data,t.data)}static equalsArr(e,t){return or(e,t,OD.equals)}}function l7e(i){return Array.isArray(i)}function c7e(i){return!l7e(i)}function qme(i){return typeof i=="string"}function Jie(i){return!qme(i)}function D1(i){return!i}function yv(i,e){return i.ignoreCase&&e?e.toLowerCase():e}function ere(i){return i.replace(/[&<>'"_]/g,"-")}function u7e(i,e){console.log(`${i.languageId}: ${e}`)}function Hi(i,e){return new Error(`${i.languageId}: ${e}`)}function Am(i,e,t,n,r){const o=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g;let s=null;return e.replace(o,function(a,l,c,u,d,h,f,g,p){return D1(c)?D1(u)?!D1(d)&&d0;){const n=i.tokenizer[t];if(n)return n;const r=t.lastIndexOf(".");r<0?t=null:t=t.substr(0,r)}return null}function d7e(i,e){let t=e;for(;t&&t.length>0;){if(i.stateNames[t])return!0;const r=t.lastIndexOf(".");r<0?t=null:t=t.substr(0,r)}return!1}var h7e=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},f7e=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},xH;const Xme=5;class FD{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(e!==null&&e.depth>=this._maxCacheDepth)return new By(e,t);let n=By.getStackElementId(e);n.length>0&&(n+="|"),n+=t;let r=this._entries[n];return r||(r=new By(e,t),this._entries[n]=r,r)}}FD._INSTANCE=new FD(Xme);class By{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;e!==null;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;e!==null&&t!==null;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return e===null&&t===null}equals(e){return By._equals(this,e)}push(e){return FD.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return FD.create(this.parent,e)}}class ry{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 ry(this.languageId,this.state)}}class Pm{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(t!==null)return new hE(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new hE(e,t);const n=By.getStackElementId(e);let r=this._entries[n];return r||(r=new hE(e,null),this._entries[n]=r,r)}}Pm._INSTANCE=new Pm(Xme);class hE{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:Pm.create(this.stack,this.embeddedLanguageData)}equals(e){return!(e instanceof hE)||!this.stack.equals(e.stack)?!1:this.embeddedLanguageData===null&&e.embeddedLanguageData===null?!0:this.embeddedLanguageData===null||e.embeddedLanguageData===null?!1:this.embeddedLanguageData.equals(e.embeddedLanguageData)}}class g7e{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 wD(e,t,this._languageId)))}nestedLanguageTokenize(e,t,n,r){const o=n.languageId,s=n.state,a=hr.get(o);if(!a)return this.enterLanguage(o),this.emit(r,""),s;const l=a.tokenize(e,t,s);if(r!==0)for(const c of l.tokens)this._tokens.push(new wD(c.offset+r,c.type,c.language));else this._tokens=this._tokens.concat(l.tokens);return this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,l.endState}finalize(e){return new fq(this._tokens,e)}}class iP{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 n=this._theme.match(this._currentLanguageId,t)|1024;this._lastTokenMetadata!==n&&(this._lastTokenMetadata=n,this._tokens.push(e),this._tokens.push(n))}static _merge(e,t,n){const r=e!==null?e.length:0,o=t.length,s=n!==null?n.length:0;if(r===0&&o===0&&s===0)return new Uint32Array(0);if(r===0&&o===0)return n;if(o===0&&s===0)return e;const a=new Uint32Array(r+o+s);e!==null&&a.set(e);for(let l=0;l{if(s)return;let l=!1;for(let c=0,u=a.changedLanguages.length;c{a.affectsConfiguration("editor.maxTokenizationLineLength")&&(this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}))}))}getLoadStatus(){const e=[];for(const t in this._embeddedLanguages){const n=hr.get(t);if(n){if(n instanceof xH){const r=n.getLoadStatus();r.loaded===!1&&e.push(r.promise)}continue}hr.isResolved(t)||e.push(hr.getOrCreate(t))}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){const e=FD.create(null,this._lexer.start);return Pm.create(e,null)}tokenize(e,t,n){if(e.length>=this._maxTokenizationLineLength)return zq(this._languageId,n);const r=new g7e,o=this._tokenize(e,t,n,r);return r.finalize(o)}tokenizeEncoded(e,t,n){if(e.length>=this._maxTokenizationLineLength)return T4(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),n);const r=new iP(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),o=this._tokenize(e,t,n,r);return r.finalize(o)}_tokenize(e,t,n,r){return n.embeddedLanguageData?this._nestedTokenize(e,t,n,0,r):this._myTokenize(e,t,n,0,r)}_findLeavingNestedLanguageOffset(e,t){let n=this._lexer.tokenizer[t.stack.state];if(!n&&(n=sR(this._lexer,t.stack.state),!n))throw Hi(this._lexer,"tokenizer state is not defined: "+t.stack.state);let r=-1,o=!1;for(const s of n){if(!Jie(s.action)||s.action.nextEmbedded!=="@pop")continue;o=!0;let a=s.regex;const l=s.regex.source;if(l.substr(0,4)==="^(?:"&&l.substr(l.length-1,1)===")"){const u=(a.ignoreCase?"i":"")+(a.unicode?"u":"");a=new RegExp(l.substr(4,l.length-5),u)}const c=e.search(a);c===-1||c!==0&&s.matchOnlyAtLineStart||(r===-1||c0&&o.nestedLanguageTokenize(a,!1,n.embeddedLanguageData,r);const l=e.substring(s);return this._myTokenize(l,t,n,r+s,o)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,n,r,o){o.enterLanguage(this._languageId);const s=e.length,a=t&&this._lexer.includeLF?e+` +`:e,l=a.length;let c=n.embeddedLanguageData,u=n.stack,d=0,h=null,f=!0;for(;f||d=l)break;f=!1;let T=this._lexer.tokenizer[m];if(!T&&(T=sR(this._lexer,m),!T))throw Hi(this._lexer,"tokenizer state is not defined: "+m);const M=a.substr(d);for(const A of T)if((d===0||!A.matchOnlyAtLineStart)&&(_=M.match(A.regex),_)){y=_[0],S=A.action;break}}if(_||(_=[""],y=""),S||(d=this._lexer.maxStack)throw Hi(this._lexer,"maximum tokenizer stack size reached: ["+u.state+","+u.parent.state+",...]");u=u.push(m)}else if(S.next==="@pop"){if(u.depth<=1)throw Hi(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(L));u=u.pop()}else if(S.next==="@popall")u=u.popall();else{let T=Am(this._lexer,S.next,y,_,m);if(T[0]==="@"&&(T=T.substr(1)),sR(this._lexer,T))u=u.push(T);else throw Hi(this._lexer,"trying to set a next state '"+T+"' that is undefined in rule: "+this._safeRuleName(L))}}S.log&&typeof S.log=="string"&&u7e(this._lexer,this._lexer.languageId+": "+Am(this._lexer,S.log,y,_,m))}if(D===null)throw Hi(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(L));const k=T=>{const M=this._languageService.getLanguageIdByLanguageName(T)||this._languageService.getLanguageIdByMimeType(T)||T,A=this._getNestedEmbeddedLanguageData(M);if(d0)throw Hi(this._lexer,"groups cannot be nested: "+this._safeRuleName(L));if(_.length!==D.length+1)throw Hi(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(L));let T=0;for(let M=1;M<_.length;M++)T+=_[M].length;if(T!==y.length)throw Hi(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(L));h={rule:L,matches:_,groups:[]};for(let M=0;Mi});class Kq{static colorizeElement(e,t,n,r){r=r||{};const o=r.theme||"vs",s=r.mimeType||n.getAttribute("lang")||n.getAttribute("data-lang");if(!s)return console.error("Mode not detected"),Promise.resolve();const a=t.getLanguageIdByMimeType(s)||s;e.setTheme(o);const l=n.firstChild?n.firstChild.nodeValue:"";n.className+=" "+o;const c=u=>{var d;const h=(d=L6==null?void 0:L6.createHTML(u))!==null&&d!==void 0?d:u;n.innerHTML=h};return this.colorize(t,l||"",a,r).then(c,u=>console.error(u))}static async colorize(e,t,n,r){const o=e.languageIdCodec;let s=4;r&&typeof r.tabSize=="number"&&(s=r.tabSize),Cq(t)&&(t=t.substr(1));const a=Jf(t);if(!e.isRegisteredLanguageId(n))return tre(a,s,o);const l=await hr.getOrCreate(n);return l?m7e(a,s,l,o):tre(a,s,o)}static colorizeLine(e,t,n,r,o=4){const s=vc.isBasicASCII(e,t),a=vc.containsRTL(e,s,n);return N4(new D_(!1,!0,e,!1,s,a,0,r,[],o,0,0,0,0,-1,"none",!1,!1,null)).html}static colorizeModelLine(e,t,n=4){const r=e.getLineContent(t);e.tokenization.forceTokenization(t);const s=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(r,e.mightContainNonBasicASCII(),e.mightContainRTL(),s,n)}}function m7e(i,e,t,n){return new Promise((r,o)=>{const s=()=>{const a=v7e(i,e,t,n);if(t instanceof BD){const l=t.getLoadStatus();if(l.loaded===!1){l.promise.then(s,o);return}}r(a)};s()})}function tre(i,e,t){let n=[];const o=new Uint32Array(2);o[0]=0,o[1]=33587200;for(let s=0,a=i.length;s")}return n.join("")}function v7e(i,e,t,n){let r=[],o=t.getInitialState();for(let s=0,a=i.length;s"),o=c.endState}return r.join("")}const nre=2e4;let x0,pM,LH,mM,EH;function _7e(i){x0=document.createElement("div"),x0.className="monaco-aria-container";const e=()=>{const n=document.createElement("div");return n.className="monaco-alert",n.setAttribute("role","alert"),n.setAttribute("aria-atomic","true"),x0.appendChild(n),n};pM=e(),LH=e();const t=()=>{const n=document.createElement("div");return n.className="monaco-status",n.setAttribute("aria-live","polite"),n.setAttribute("aria-atomic","true"),x0.appendChild(n),n};mM=t(),EH=t(),i.appendChild(x0)}function kl(i){x0&&(pM.textContent!==i?(Ns(LH),rP(pM,i)):(Ns(pM),rP(LH,i)))}function Hf(i){x0&&(mM.textContent!==i?(Ns(EH),rP(mM,i)):(Ns(mM),rP(EH,i)))}function rP(i,e){Ns(i),e.length>nre&&(e=e.substr(0,nre)),i.textContent=e,i.style.visibility="hidden",i.style.visibility="visible"}const Gq=yn("markerDecorationsService");var b7e=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},C7e=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let WD=class{constructor(e,t){}dispose(){}};WD.ID="editor.contrib.markerDecorations";WD=b7e([C7e(1,Gq)],WD);jn(WD.ID,WD,0);class Yme extends fe{constructor(e,t){super(),this._onDidChange=this._register(new se),this.onDidChange=this._onDidChange.event,this._referenceDomElement=e,this._width=-1,this._height=-1,this._resizeObserver=null,this.measureReferenceDomElement(!1,t)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this._width}getHeight(){return this._height}startObserving(){if(!this._resizeObserver&&this._referenceDomElement){let e=null;const t=()=>{e?this.observe({width:e.width,height:e.height}):this.observe()};let n=!1,r=!1;const o=()=>{if(n&&!r)try{n=!1,r=!0,t()}finally{Il(Pt(this._referenceDomElement),()=>{r=!1,o()})}};this._resizeObserver=new ResizeObserver(s=>{s&&s[0]&&s[0].contentRect?e={width:s[0].contentRect.width,height:s[0].contentRect.height}:e=null,n=!0,o()}),this._resizeObserver.observe(this._referenceDomElement)}}stopObserving(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let n=0,r=0;t?(n=t.width,r=t.height):this._referenceDomElement&&(n=this._referenceDomElement.clientWidth,r=this._referenceDomElement.clientHeight),n=Math.max(5,n),r=Math.max(5,r),(this._width!==n||this._height!==r)&&(this._width=n,this._height=r,e&&this._onDidChange.fire())}}class wv{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=wv._read(e,this.key),n=o=>wv._read(e,o),r=(o,s)=>wv._write(e,o,s);this.migrate(t,n,r)}static _read(e,t){if(typeof e>"u")return;const n=t.indexOf(".");if(n>=0){const r=t.substring(0,n);return this._read(e[r],t.substring(n+1))}return e[t]}static _write(e,t,n){const r=t.indexOf(".");if(r>=0){const o=t.substring(0,r);e[o]=e[o]||{},this._write(e[o],t.substring(r+1),n);return}e[t]=n}}wv.items=[];function Lh(i,e){wv.items.push(new wv(i,e))}function Al(i,e){Lh(i,(t,n,r)=>{if(typeof t<"u"){for(const[o,s]of e)if(t===o){r(i,s);return}}})}function y7e(i){wv.items.forEach(e=>e.apply(i))}Al("wordWrap",[[!0,"on"],[!1,"off"]]);Al("lineNumbers",[[!0,"on"],[!1,"off"]]);Al("cursorBlinking",[["visible","solid"]]);Al("renderWhitespace",[[!0,"boundary"],[!1,"none"]]);Al("renderLineHighlight",[[!0,"line"],[!1,"none"]]);Al("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]);Al("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]);Al("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Al("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Al("autoIndent",[[!1,"advanced"],[!0,"full"]]);Al("matchBrackets",[[!0,"always"],[!1,"never"]]);Al("renderFinalNewline",[[!0,"on"],[!1,"off"]]);Al("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]);Al("occurrencesHighlight",[[!0,"singleFile"],[!1,"off"]]);Al("wordBasedSuggestions",[[!0,"matchingDocuments"],[!1,"off"]]);Lh("autoClosingBrackets",(i,e,t)=>{i===!1&&(t("autoClosingBrackets","never"),typeof e("autoClosingQuotes")>"u"&&t("autoClosingQuotes","never"),typeof e("autoSurround")>"u"&&t("autoSurround","never"))});Lh("renderIndentGuides",(i,e,t)=>{typeof i<"u"&&(t("renderIndentGuides",void 0),typeof e("guides.indentation")>"u"&&t("guides.indentation",!!i))});Lh("highlightActiveIndentGuide",(i,e,t)=>{typeof i<"u"&&(t("highlightActiveIndentGuide",void 0),typeof e("guides.highlightActiveIndentation")>"u"&&t("guides.highlightActiveIndentation",!!i))});const w7e={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"};Lh("suggest.filteredTypes",(i,e,t)=>{if(i&&typeof i=="object"){for(const n of Object.entries(w7e))i[n[0]]===!1&&typeof e(`suggest.${n[1]}`)>"u"&&t(`suggest.${n[1]}`,!1);t("suggest.filteredTypes",void 0)}});Lh("quickSuggestions",(i,e,t)=>{if(typeof i=="boolean"){const n=i?"on":"off";t("quickSuggestions",{comments:n,strings:n,other:n})}});Lh("experimental.stickyScroll.enabled",(i,e,t)=>{typeof i=="boolean"&&(t("experimental.stickyScroll.enabled",void 0),typeof e("stickyScroll.enabled")>"u"&&t("stickyScroll.enabled",i))});Lh("experimental.stickyScroll.maxLineCount",(i,e,t)=>{typeof i=="number"&&(t("experimental.stickyScroll.maxLineCount",void 0),typeof e("stickyScroll.maxLineCount")>"u"&&t("stickyScroll.maxLineCount",i))});Lh("codeActionsOnSave",(i,e,t)=>{if(i&&typeof i=="object"){let n=!1;const r={};for(const o of Object.entries(i))typeof o[1]=="boolean"?(n=!0,r[o[0]]=o[1]?"explicit":"never"):r[o[0]]=o[1];n&&t("codeActionsOnSave",r)}});Lh("codeActionWidget.includeNearbyQuickfixes",(i,e,t)=>{typeof i=="boolean"&&(t("codeActionWidget.includeNearbyQuickfixes",void 0),typeof e("codeActionWidget.includeNearbyQuickFixes")>"u"&&t("codeActionWidget.includeNearbyQuickFixes",i))});Lh("lightbulb.enabled",(i,e,t)=>{typeof i=="boolean"&&t("lightbulb.enabled",i?void 0:"off")});class S7e{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new se,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}}const Rw=new S7e,ud=yn("accessibilityService"),Bk=new st("accessibilityModeEnabled",!1);var x7e=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},L7e=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let DH=class extends fe{constructor(e,t,n,r){super(),this._accessibilityService=r,this._onDidChange=this._register(new se),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new se),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new mpe,this.isSimpleWidget=e,this._containerObserver=this._register(new Yme(n,t.dimension)),this._targetWindowId=Pt(n).vscodeWindowId,this._rawOptions=ire(t),this._validatedOptions=Om.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(13)&&this._containerObserver.startObserving(),this._register(zc.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(Rw.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(cH.onDidChange(()=>this._recomputeOptions())),this._register(ID.getInstance(Pt(n)).onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){const e=this._computeOptions(),t=Om.checkEquals(this.options,e);t!==null&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=nb.createFromValidatedSettings(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),n=this._readFontInfo(t),r={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:n,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:Rw.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return Om.computeOptions(this._validatedOptions,r)}_readEnvConfiguration(){return{extraEditorClassName:D7e(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:tb||ru,pixelRatio:ID.getInstance(iie(this._targetWindowId,!0).window).value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return cH.readFontInfo(iie(this._targetWindowId,!0).window,e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=ire(e);Om.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=Om.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=E7e(e);this._lineNumbersDigitCount!==t&&(this._lineNumbersDigitCount=t,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}setReservedHeight(e){this._reservedHeight!==e&&(this._reservedHeight=e,this._recomputeOptions())}setGlyphMarginDecorationLaneCount(e){this._glyphMarginDecorationLaneCount!==e&&(this._glyphMarginDecorationLaneCount=e,this._recomputeOptions())}};DH=x7e([L7e(3,ud)],DH);function E7e(i){let e=0;for(;i;)i=Math.floor(i/10),e++;return e||1}function D7e(){let i="";return!Ip&&!Hpe&&(i+="no-user-select "),Ip&&(i+="no-minimap-shadow ",i+="enable-user-select "),Ln&&(i+="mac "),i}class I7e{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class k7e{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 Om{static validateOptions(e){const t=new I7e;for(const n of J1){const r=n.name==="_never_"?void 0:e[n.name];t._write(n.id,n.validate(r))}return t}static computeOptions(e,t){const n=new k7e;for(const r of J1)n._write(r.id,r.compute(t,n,e._read(r.id)));return n}static _deepEquals(e,t){if(typeof e!="object"||typeof t!="object"||!e||!t)return e===t;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)?or(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!Om._deepEquals(e[n],t[n]))return!1;return!0}static checkEquals(e,t){const n=[];let r=!1;for(const o of J1){const s=!Om._deepEquals(e._read(o.id),t._read(o.id));n[o.id]=s,s&&(r=!0)}return r?new ppe(n):null}static applyUpdate(e,t){let n=!1;for(const r of J1)if(t.hasOwnProperty(r.name)){const o=r.applyUpdate(e[r.name],t[r.name]);e[r.name]=o.newValue,n=n||o.didChange}return n}}function ire(i){const e=Mg(i);return y7e(e),e}var Km;(function(i){const e={total:0,min:Number.MAX_VALUE,max:0},t={...e},n={...e},r={...e};let o=0;const s={keydown:0,input:0,render:0};function a(){m(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),s.keydown=1,queueMicrotask(l)}i.onKeyDown=a;function l(){s.keydown===1&&(performance.mark("keydown/end"),s.keydown=2)}function c(){performance.mark("input/start"),s.input=1,v()}i.onBeforeInput=c;function u(){s.input===0&&c(),queueMicrotask(d)}i.onInput=u;function d(){s.input===1&&(performance.mark("input/end"),s.input=2)}function h(){m()}i.onKeyUp=h;function f(){m()}i.onSelectionChange=f;function g(){s.keydown===2&&s.input===2&&s.render===0&&(performance.mark("render/start"),s.render=1,queueMicrotask(p),v())}i.onRenderStart=g;function p(){s.render===1&&(performance.mark("render/end"),s.render=2)}function v(){setTimeout(m)}function m(){s.keydown===2&&s.input===2&&s.render===2&&(performance.mark("inputlatency/end"),performance.measure("keydown","keydown/start","keydown/end"),performance.measure("input","input/start","input/end"),performance.measure("render","render/start","render/end"),performance.measure("inputlatency","inputlatency/start","inputlatency/end"),_("keydown",e),_("input",t),_("render",n),_("inputlatency",r),o++,y())}function _(D,k){const T=performance.getEntriesByName(D)[0].duration;k.total+=T,k.min=Math.min(k.min,T),k.max=Math.max(k.max,T)}function y(){performance.clearMarks("keydown/start"),performance.clearMarks("keydown/end"),performance.clearMarks("input/start"),performance.clearMarks("input/end"),performance.clearMarks("render/start"),performance.clearMarks("render/end"),performance.clearMarks("inputlatency/start"),performance.clearMarks("inputlatency/end"),performance.clearMeasures("keydown"),performance.clearMeasures("input"),performance.clearMeasures("render"),performance.clearMeasures("inputlatency"),s.keydown=0,s.input=0,s.render=0}function S(){if(o===0)return;const D={keydown:L(e),input:L(t),render:L(n),total:L(r),sampleCount:o};return E(e),E(t),E(n),E(r),o=0,D}i.getAndClearMeasurements=S;function L(D){return{average:D.total/o,max:D.max,min:D.min}}function E(D){D.total=0,D.min=Number.MAX_VALUE,D.max=0}})(Km||(Km={}));class kS{constructor(){this._hooks=new Te,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;const n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,n,r,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=o;let s=e;try{e.setPointerCapture(t),this._hooks.add(Rt(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{s=Pt(e)}this._hooks.add(ye(s,Ge.POINTER_MOVE,a=>{if(a.buttons!==n){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(ye(s,Ge.POINTER_UP,a=>this.stopMonitoring(!0)))}}function qq(i){return`--vscode-${i.replace(/\./g,"-")}`}function ht(i){return`var(${qq(i)})`}function T7e(i,e){return`var(${qq(i)}, ${e})`}const Zme={ColorContribution:"base.contributions.colors"};class N7e{constructor(){this._onDidChangeSchema=new se,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,n,r=!1,o){const s={id:e,description:n,defaults:t,needsTransparency:r,deprecationMessage:o};this.colorsById[e]=s;const a={type:"string",description:n,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return o&&(a.deprecationMessage=o),r&&(a.pattern="^#(?:(?[0-9a-fA-f]{3}[0-9a-eA-E])|(?:[0-9a-fA-F]{6}(?:(?![fF]{2})(?:[0-9a-fA-F]{2}))))?$",a.patternErrorMessage="This color must be transparent or it will obscure content"),this.colorSchema.properties[e]=a,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(n),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map(e=>this.colorsById[e])}resolveDefaultColor(e,t){const n=this.colorsById[e];if(n&&n.defaults){const r=n.defaults[t.type];return Sd(r,t)}}getColorSchema(){return this.colorSchema}toString(){const e=(t,n)=>{const r=t.indexOf(".")===-1?0:1,o=n.indexOf(".")===-1?0:1;return r!==o?r-o:t.localeCompare(n)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(` +`)}}const R4=new N7e;ar.add(Zme.ColorContribution,R4);function X(i,e,t,n,r){return R4.registerColor(i,e,t,n,r)}const qe=X("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},w("foreground","Overall foreground color. This color is only used if not overridden by a component."));X("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},w("disabledForeground","Overall foreground for disabled elements. This color is only used if not overridden by a component."));X("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},w("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component."));X("descriptionForeground",{light:"#717171",dark:It(qe,.7),hcDark:It(qe,.7),hcLight:It(qe,.7)},w("descriptionForeground","Foreground color for description text providing additional information, for example for a label."));const Cf=X("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},w("iconForeground","The default color for icons in the workbench.")),qc=X("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},w("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),Sn=X("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},w("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),zi=X("contrastActiveBorder",{light:null,dark:null,hcDark:qc,hcLight:qc},w("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast."));X("selection.background",{light:null,dark:null,hcDark:null,hcLight:null},w("selectionBackground","The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor."));X("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:me.black,hcLight:"#292929"},w("textSeparatorForeground","Color for text separators."));const R7e=X("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},w("textLinkForeground","Foreground color for links in text."));X("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},w("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover."));X("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#000000",hcLight:"#FFFFFF"},w("textPreformatForeground","Foreground color for preformatted text segments."));X("textPreformat.background",{light:"#0000001A",dark:"#FFFFFF1A",hcDark:"#FFFFFF",hcLight:"#09345f"},w("textPreformatBackground","Background color for preformatted text segments."));X("textBlockQuote.background",{light:"#f2f2f2",dark:"#222222",hcDark:null,hcLight:"#F2F2F2"},w("textBlockQuoteBackground","Background color for block quotes in text."));X("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:me.white,hcLight:"#292929"},w("textBlockQuoteBorder","Border color for block quotes in text."));X("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:me.black,hcLight:"#F2F2F2"},w("textCodeBlockBackground","Background color for code blocks in text."));const Yg=X("widget.shadow",{dark:It(me.black,.36),light:It(me.black,.16),hcDark:null,hcLight:null},w("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),Qme=X("widget.border",{dark:null,light:null,hcDark:Sn,hcLight:Sn},w("widgetBorder","Border color of widgets such as find/replace inside the editor.")),Jme=X("input.background",{dark:"#3C3C3C",light:me.white,hcDark:me.black,hcLight:me.white},w("inputBoxBackground","Input box background.")),eve=X("input.foreground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("inputBoxForeground","Input box foreground.")),tve=X("input.border",{dark:null,light:null,hcDark:Sn,hcLight:Sn},w("inputBoxBorder","Input box border.")),Xq=X("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:Sn,hcLight:Sn},w("inputBoxActiveOptionBorder","Border color of activated options in input fields."));X("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},w("inputOption.hoverBackground","Background color of activated options in input fields."));const B0=X("inputOption.activeBackground",{dark:It(qc,.4),light:It(qc,.2),hcDark:me.transparent,hcLight:me.transparent},w("inputOption.activeBackground","Background hover color of options in input fields.")),Yq=X("inputOption.activeForeground",{dark:me.white,light:me.black,hcDark:qe,hcLight:qe},w("inputOption.activeForeground","Foreground color of activated options in input fields."));X("input.placeholderForeground",{light:It(qe,.5),dark:It(qe,.5),hcDark:It(qe,.7),hcLight:It(qe,.7)},w("inputPlaceholderForeground","Input box foreground color for placeholder text."));const M7e=X("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:me.black,hcLight:me.white},w("inputValidationInfoBackground","Input validation background color for information severity.")),A7e=X("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:qe},w("inputValidationInfoForeground","Input validation foreground color for information severity.")),P7e=X("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:Sn,hcLight:Sn},w("inputValidationInfoBorder","Input validation border color for information severity.")),O7e=X("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:me.black,hcLight:me.white},w("inputValidationWarningBackground","Input validation background color for warning severity.")),F7e=X("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:qe},w("inputValidationWarningForeground","Input validation foreground color for warning severity.")),B7e=X("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:Sn,hcLight:Sn},w("inputValidationWarningBorder","Input validation border color for warning severity.")),W7e=X("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:me.black,hcLight:me.white},w("inputValidationErrorBackground","Input validation background color for error severity.")),$7e=X("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:qe},w("inputValidationErrorForeground","Input validation foreground color for error severity.")),H7e=X("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:Sn,hcLight:Sn},w("inputValidationErrorBorder","Input validation border color for error severity.")),yf=X("dropdown.background",{dark:"#3C3C3C",light:me.white,hcDark:me.black,hcLight:me.white},w("dropdownBackground","Dropdown background.")),V7e=X("dropdown.listBackground",{dark:null,light:null,hcDark:me.black,hcLight:me.white},w("dropdownListBackground","Dropdown list background.")),Zg=X("dropdown.foreground",{dark:"#F0F0F0",light:qe,hcDark:me.white,hcLight:qe},w("dropdownForeground","Dropdown foreground.")),oy=X("dropdown.border",{dark:yf,light:"#CECECE",hcDark:Sn,hcLight:Sn},w("dropdownBorder","Dropdown border.")),SL=X("button.foreground",{dark:me.white,light:me.white,hcDark:me.white,hcLight:me.white},w("buttonForeground","Button foreground color.")),z7e=X("button.separator",{dark:It(SL,.4),light:It(SL,.4),hcDark:It(SL,.4),hcLight:It(SL,.4)},w("buttonSeparator","Button separator color.")),xL=X("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},w("buttonBackground","Button background color.")),U7e=X("button.hoverBackground",{dark:nh(xL,.2),light:hC(xL,.2),hcDark:xL,hcLight:xL},w("buttonHoverBackground","Button background color when hovering.")),j7e=X("button.border",{dark:Sn,light:Sn,hcDark:Sn,hcLight:Sn},w("buttonBorder","Button border color.")),K7e=X("button.secondaryForeground",{dark:me.white,light:me.white,hcDark:me.white,hcLight:qe},w("buttonSecondaryForeground","Secondary button foreground color.")),IH=X("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:me.white},w("buttonSecondaryBackground","Secondary button background color.")),G7e=X("button.secondaryHoverBackground",{dark:nh(IH,.2),light:hC(IH,.2),hcDark:null,hcLight:null},w("buttonSecondaryHoverBackground","Secondary button background color when hovering.")),vM=X("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:me.black,hcLight:"#0F4A85"},w("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),q7e=X("badge.foreground",{dark:me.white,light:"#333",hcDark:me.white,hcLight:me.white},w("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),LL=X("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},w("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),EL=X("scrollbarSlider.background",{dark:me.fromHex("#797979").transparent(.4),light:me.fromHex("#646464").transparent(.4),hcDark:It(Sn,.6),hcLight:It(Sn,.4)},w("scrollbarSliderBackground","Scrollbar slider background color.")),DL=X("scrollbarSlider.hoverBackground",{dark:me.fromHex("#646464").transparent(.7),light:me.fromHex("#646464").transparent(.7),hcDark:It(Sn,.8),hcLight:It(Sn,.8)},w("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),IL=X("scrollbarSlider.activeBackground",{dark:me.fromHex("#BFBFBF").transparent(.4),light:me.fromHex("#000000").transparent(.6),hcDark:Sn,hcLight:Sn},w("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),X7e=X("progressBar.background",{dark:me.fromHex("#0E70C0"),light:me.fromHex("#0E70C0"),hcDark:Sn,hcLight:Sn},w("progressBarBackground","Background color of the progress bar that can show for long running operations."));X("editorError.background",{dark:null,light:null,hcDark:null,hcLight:null},w("editorError.background","Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const wf=X("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},w("editorError.foreground","Foreground color of error squigglies in the editor.")),Y7e=X("editorError.border",{dark:null,light:null,hcDark:me.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},w("errorBorder","If set, color of double underlines for errors in the editor.")),aR=X("editorWarning.background",{dark:null,light:null,hcDark:null,hcLight:null},w("editorWarning.background","Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),qs=X("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},w("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),$D=X("editorWarning.border",{dark:null,light:null,hcDark:me.fromHex("#FFCC00").transparent(.8),hcLight:me.fromHex("#FFCC00").transparent(.8)},w("warningBorder","If set, color of double underlines for warnings in the editor."));X("editorInfo.background",{dark:null,light:null,hcDark:null,hcLight:null},w("editorInfo.background","Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const Za=X("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},w("editorInfo.foreground","Foreground color of info squigglies in the editor.")),HD=X("editorInfo.border",{dark:null,light:null,hcDark:me.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},w("infoBorder","If set, color of double underlines for infos in the editor.")),Z7e=X("editorHint.foreground",{dark:me.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},w("editorHint.foreground","Foreground color of hint squigglies in the editor."));X("editorHint.border",{dark:null,light:null,hcDark:me.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},w("hintBorder","If set, color of double underlines for hints in the editor."));X("sash.hoverBorder",{dark:qc,light:qc,hcDark:qc,hcLight:qc},w("sashActiveBorder","Border color of active sashes."));const Eo=X("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:me.black,hcLight:me.white},w("editorBackground","Editor background color.")),Ku=X("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:me.white,hcLight:qe},w("editorForeground","Editor default foreground color."));X("editorStickyScroll.background",{light:Eo,dark:Eo,hcDark:Eo,hcLight:Eo},w("editorStickyScrollBackground","Background color of sticky scroll in the editor"));X("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:me.fromHex("#0F4A85").transparent(.1)},w("editorStickyScrollHoverBackground","Background color of sticky scroll on hover in the editor"));X("editorStickyScroll.border",{dark:null,light:null,hcDark:Sn,hcLight:Sn},w("editorStickyScrollBorder","Border color of sticky scroll in the editor"));X("editorStickyScroll.shadow",{dark:LL,light:LL,hcDark:LL,hcLight:LL},w("editorStickyScrollShadow"," Shadow color of sticky scroll in the editor"));const Nr=X("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:me.white},w("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),Qg=X("editorWidget.foreground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),Jg=X("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:Sn,hcLight:Sn},w("editorWidgetBorder","Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget."));X("editorWidget.resizeBorder",{light:null,dark:null,hcDark:null,hcLight:null},w("editorWidgetResizeBorder","Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget."));const rre=X("quickInput.background",{dark:Nr,light:Nr,hcDark:Nr,hcLight:Nr},w("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),Q7e=X("quickInput.foreground",{dark:Qg,light:Qg,hcDark:Qg,hcLight:Qg},w("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),J7e=X("quickInputTitle.background",{dark:new me(new Tn(255,255,255,.105)),light:new me(new Tn(0,0,0,.06)),hcDark:"#000000",hcLight:me.white},w("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),nve=X("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:me.white,hcLight:"#0F4A85"},w("pickerGroupForeground","Quick picker color for grouping labels.")),eWe=X("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:me.white,hcLight:"#0F4A85"},w("pickerGroupBorder","Quick picker color for grouping borders.")),tWe=X("keybindingLabel.background",{dark:new me(new Tn(128,128,128,.17)),light:new me(new Tn(221,221,221,.4)),hcDark:me.transparent,hcLight:me.transparent},w("keybindingLabelBackground","Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),nWe=X("keybindingLabel.foreground",{dark:me.fromHex("#CCCCCC"),light:me.fromHex("#555555"),hcDark:me.white,hcLight:qe},w("keybindingLabelForeground","Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),iWe=X("keybindingLabel.border",{dark:new me(new Tn(51,51,51,.6)),light:new me(new Tn(204,204,204,.4)),hcDark:new me(new Tn(111,195,223)),hcLight:Sn},w("keybindingLabelBorder","Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),rWe=X("keybindingLabel.bottomBorder",{dark:new me(new Tn(68,68,68,.6)),light:new me(new Tn(187,187,187,.4)),hcDark:new me(new Tn(111,195,223)),hcLight:qe},w("keybindingLabelBottomBorder","Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),Gm=X("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},w("editorSelectionBackground","Color of the editor selection.")),oWe=X("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:me.white},w("editorSelectionForeground","Color of the selected text for high contrast.")),ive=X("editor.inactiveSelectionBackground",{light:It(Gm,.5),dark:It(Gm,.5),hcDark:It(Gm,.7),hcLight:It(Gm,.5)},w("editorInactiveSelection","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),Zq=X("editor.selectionHighlightBackground",{light:hre(Gm,Eo,.3,.6),dark:hre(Gm,Eo,.3,.6),hcDark:null,hcLight:null},w("editorSelectionHighlight","Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0);X("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:zi,hcLight:zi},w("editorSelectionHighlightBorder","Border color for regions with the same content as the selection."));X("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},w("editorFindMatch","Color of the current search match."));const ep=X("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},w("findMatchHighlight","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0);X("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},w("findRangeHighlight","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);X("editor.findMatchBorder",{light:null,dark:null,hcDark:zi,hcLight:zi},w("editorFindMatchBorder","Border color of the current search match."));const qm=X("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:zi,hcLight:zi},w("findMatchHighlightBorder","Border color of the other search matches.")),sWe=X("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:It(zi,.4),hcLight:It(zi,.4)},w("findRangeHighlightBorder","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);X("searchEditor.findMatchBackground",{light:It(ep,.66),dark:It(ep,.66),hcDark:ep,hcLight:ep},w("searchEditor.queryMatch","Color of the Search Editor query matches."));X("searchEditor.findMatchBorder",{light:It(qm,.66),dark:It(qm,.66),hcDark:qm,hcLight:qm},w("searchEditor.editorFindMatchBorder","Border color of the Search Editor query matches."));X("search.resultsInfoForeground",{light:qe,dark:It(qe,.65),hcDark:qe,hcLight:qe},w("search.resultsInfoForeground","Color of the text in the search viewlet's completion message."));X("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},w("hoverHighlight","Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0);const oP=X("editorHoverWidget.background",{light:Nr,dark:Nr,hcDark:Nr,hcLight:Nr},w("hoverBackground","Background color of the editor hover."));X("editorHoverWidget.foreground",{light:Qg,dark:Qg,hcDark:Qg,hcLight:Qg},w("hoverForeground","Foreground color of the editor hover."));const rve=X("editorHoverWidget.border",{light:Jg,dark:Jg,hcDark:Jg,hcLight:Jg},w("hoverBorder","Border color of the editor hover."));X("editorHoverWidget.statusBarBackground",{dark:nh(oP,.2),light:hC(oP,.05),hcDark:Nr,hcLight:Nr},w("statusBarBackground","Background color of the editor hover status bar."));const aWe=X("editorLink.activeForeground",{dark:"#4E94CE",light:me.blue,hcDark:me.cyan,hcLight:"#292929"},w("activeLinkForeground","Color of active links.")),tp=X("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:me.white,hcLight:me.black},w("editorInlayHintForeground","Foreground color of inline hints")),np=X("editorInlayHint.background",{dark:It(vM,.1),light:It(vM,.1),hcDark:It(me.white,.1),hcLight:It(vM,.1)},w("editorInlayHintBackground","Background color of inline hints")),lWe=X("editorInlayHint.typeForeground",{dark:tp,light:tp,hcDark:tp,hcLight:tp},w("editorInlayHintForegroundTypes","Foreground color of inline hints for types")),cWe=X("editorInlayHint.typeBackground",{dark:np,light:np,hcDark:np,hcLight:np},w("editorInlayHintBackgroundTypes","Background color of inline hints for types")),uWe=X("editorInlayHint.parameterForeground",{dark:tp,light:tp,hcDark:tp,hcLight:tp},w("editorInlayHintForegroundParameter","Foreground color of inline hints for parameters")),dWe=X("editorInlayHint.parameterBackground",{dark:np,light:np,hcDark:np,hcLight:np},w("editorInlayHintBackgroundParameter","Background color of inline hints for parameters")),lR=X("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},w("editorLightBulbForeground","The color used for the lightbulb actions icon."));X("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon."));X("editorLightBulbAi.foreground",{dark:lR,light:lR,hcDark:lR,hcLight:lR},w("editorLightBulbAiForeground","The color used for the lightbulb AI icon."));const kH=new me(new Tn(155,185,85,.2)),TH=new me(new Tn(255,0,0,.2)),hWe=X("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},w("diffEditorInserted","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),fWe=X("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},w("diffEditorRemoved","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);X("diffEditor.insertedLineBackground",{dark:kH,light:kH,hcDark:null,hcLight:null},w("diffEditorInsertedLines","Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0);X("diffEditor.removedLineBackground",{dark:TH,light:TH,hcDark:null,hcLight:null},w("diffEditorRemovedLines","Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);X("diffEditorGutter.insertedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},w("diffEditorInsertedLineGutter","Background color for the margin where lines got inserted."));X("diffEditorGutter.removedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},w("diffEditorRemovedLineGutter","Background color for the margin where lines got removed."));const gWe=X("diffEditorOverview.insertedForeground",{dark:null,light:null,hcDark:null,hcLight:null},w("diffEditorOverviewInserted","Diff overview ruler foreground for inserted content.")),pWe=X("diffEditorOverview.removedForeground",{dark:null,light:null,hcDark:null,hcLight:null},w("diffEditorOverviewRemoved","Diff overview ruler foreground for removed content."));X("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},w("diffEditorInsertedOutline","Outline color for the text that got inserted."));X("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},w("diffEditorRemovedOutline","Outline color for text that got removed."));X("diffEditor.border",{dark:null,light:null,hcDark:Sn,hcLight:Sn},w("diffEditorBorder","Border color between the two text editors."));X("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},w("diffDiagonalFill","Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views."));X("diffEditor.unchangedRegionBackground",{dark:"sideBar.background",light:"sideBar.background",hcDark:"sideBar.background",hcLight:"sideBar.background"},w("diffEditor.unchangedRegionBackground","The background color of unchanged blocks in the diff editor."));X("diffEditor.unchangedRegionForeground",{dark:"foreground",light:"foreground",hcDark:"foreground",hcLight:"foreground"},w("diffEditor.unchangedRegionForeground","The foreground color of unchanged blocks in the diff editor."));X("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},w("diffEditor.unchangedCodeBackground","The background color of unchanged code in the diff editor."));const mWe=X("list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},w("listFocusBackground","List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),vWe=X("list.focusForeground",{dark:null,light:null,hcDark:null,hcLight:null},w("listFocusForeground","List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),_We=X("list.focusOutline",{dark:qc,light:qc,hcDark:zi,hcLight:zi},w("listFocusOutline","List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),bWe=X("list.focusAndSelectionOutline",{dark:null,light:null,hcDark:null,hcLight:null},w("listFocusAndSelectionOutline","List/Tree outline color for the focused item when the list/tree is active and selected. An active list/tree has keyboard focus, an inactive does not.")),ip=X("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:me.fromHex("#0F4A85").transparent(.1)},w("listActiveSelectionBackground","List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),Sf=X("list.activeSelectionForeground",{dark:me.white,light:me.white,hcDark:null,hcLight:null},w("listActiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),kL=X("list.activeSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},w("listActiveSelectionIconForeground","List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),CWe=X("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:me.fromHex("#0F4A85").transparent(.1)},w("listInactiveSelectionBackground","List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),yWe=X("list.inactiveSelectionForeground",{dark:null,light:null,hcDark:null,hcLight:null},w("listInactiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),wWe=X("list.inactiveSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},w("listInactiveSelectionIconForeground","List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),SWe=X("list.inactiveFocusBackground",{dark:null,light:null,hcDark:null,hcLight:null},w("listInactiveFocusBackground","List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),xWe=X("list.inactiveFocusOutline",{dark:null,light:null,hcDark:null,hcLight:null},w("listInactiveFocusOutline","List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),ove=X("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:me.white.transparent(.1),hcLight:me.fromHex("#0F4A85").transparent(.1)},w("listHoverBackground","List/Tree background when hovering over items using the mouse.")),sve=X("list.hoverForeground",{dark:null,light:null,hcDark:null,hcLight:null},w("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),LWe=X("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},w("listDropBackground","List/Tree drag and drop background when moving items over other items when using the mouse.")),EWe=X("list.dropBetweenBackground",{dark:Cf,light:Cf,hcDark:null,hcLight:null},w("listDropBetweenBackground","List/Tree drag and drop border color when moving items between items when using the mouse.")),Gu=X("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:qc,hcLight:qc},w("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree.")),cR=X("list.focusHighlightForeground",{dark:Gu,light:n$e(ip,Gu,"#BBE7FF"),hcDark:Gu,hcLight:Gu},w("listFocusHighlightForeground","List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));X("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},w("invalidItemForeground","List/Tree foreground color for invalid items, for example an unresolved root in explorer."));X("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},w("listErrorForeground","Foreground color of list items containing errors."));X("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},w("listWarningForeground","Foreground color of list items containing warnings."));const DWe=X("listFilterWidget.background",{light:hC(Nr,0),dark:nh(Nr,0),hcDark:Nr,hcLight:Nr},w("listFilterWidgetBackground","Background color of the type filter widget in lists and trees.")),IWe=X("listFilterWidget.outline",{dark:me.transparent,light:me.transparent,hcDark:"#f38518",hcLight:"#007ACC"},w("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),kWe=X("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:Sn,hcLight:Sn},w("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),TWe=X("listFilterWidget.shadow",{dark:Yg,light:Yg,hcDark:Yg,hcLight:Yg},w("listFilterWidgetShadow","Shadow color of the type filter widget in lists and trees."));X("list.filterMatchBackground",{dark:ep,light:ep,hcDark:null,hcLight:null},w("listFilterMatchHighlight","Background color of the filtered match."));X("list.filterMatchBorder",{dark:qm,light:qm,hcDark:Sn,hcLight:zi},w("listFilterMatchHighlightBorder","Border color of the filtered match."));const TL=X("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},w("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),NWe=X("tree.inactiveIndentGuidesStroke",{dark:It(TL,.4),light:It(TL,.4),hcDark:It(TL,.4),hcLight:It(TL,.4)},w("treeInactiveIndentGuidesStroke","Tree stroke color for the indentation guides that are not active.")),RWe=X("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},w("tableColumnsBorder","Table border color between columns.")),MWe=X("tree.tableOddRowsBackground",{dark:It(qe,.04),light:It(qe,.04),hcDark:null,hcLight:null},w("tableOddRowsBackgroundColor","Background color for odd table rows."));X("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},w("listDeemphasizedForeground","List/Tree foreground color for items that are deemphasized. "));const AWe=X("checkbox.background",{dark:yf,light:yf,hcDark:yf,hcLight:yf},w("checkbox.background","Background color of checkbox widget."));X("checkbox.selectBackground",{dark:Nr,light:Nr,hcDark:Nr,hcLight:Nr},w("checkbox.select.background","Background color of checkbox widget when the element it's in is selected."));const PWe=X("checkbox.foreground",{dark:Zg,light:Zg,hcDark:Zg,hcLight:Zg},w("checkbox.foreground","Foreground color of checkbox widget.")),OWe=X("checkbox.border",{dark:oy,light:oy,hcDark:oy,hcLight:oy},w("checkbox.border","Border color of checkbox widget."));X("checkbox.selectBorder",{dark:Cf,light:Cf,hcDark:Cf,hcLight:Cf},w("checkbox.select.border","Border color of checkbox widget when the element it's in is selected."));const ore=X("quickInput.list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},"",void 0,w("quickInput.list.focusBackground deprecation","Please use quickInputList.focusBackground instead")),W0=X("quickInputList.focusForeground",{dark:Sf,light:Sf,hcDark:Sf,hcLight:Sf},w("quickInput.listFocusForeground","Quick picker foreground color for the focused item.")),sy=X("quickInputList.focusIconForeground",{dark:kL,light:kL,hcDark:kL,hcLight:kL},w("quickInput.listFocusIconForeground","Quick picker icon foreground color for the focused item.")),$0=X("quickInputList.focusBackground",{dark:VD(ore,ip),light:VD(ore,ip),hcDark:null,hcLight:null},w("quickInput.listFocusBackground","Quick picker background color for the focused item.")),FWe=X("menu.border",{dark:null,light:null,hcDark:Sn,hcLight:Sn},w("menuBorder","Border color of menus.")),BWe=X("menu.foreground",{dark:Zg,light:Zg,hcDark:Zg,hcLight:Zg},w("menuForeground","Foreground color of menu items.")),WWe=X("menu.background",{dark:yf,light:yf,hcDark:yf,hcLight:yf},w("menuBackground","Background color of menu items.")),$We=X("menu.selectionForeground",{dark:Sf,light:Sf,hcDark:Sf,hcLight:Sf},w("menuSelectionForeground","Foreground color of the selected menu item in menus.")),HWe=X("menu.selectionBackground",{dark:ip,light:ip,hcDark:ip,hcLight:ip},w("menuSelectionBackground","Background color of the selected menu item in menus.")),VWe=X("menu.selectionBorder",{dark:null,light:null,hcDark:zi,hcLight:zi},w("menuSelectionBorder","Border color of the selected menu item in menus.")),zWe=X("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:Sn,hcLight:Sn},w("menuSeparatorBackground","Color of a separator menu item in menus.")),sre=X("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},w("toolbarHoverBackground","Toolbar background when hovering over actions using the mouse"));X("toolbar.hoverOutline",{dark:null,light:null,hcDark:zi,hcLight:zi},w("toolbarHoverOutline","Toolbar outline when hovering over actions using the mouse"));X("toolbar.activeBackground",{dark:nh(sre,.1),light:hC(sre,.1),hcDark:null,hcLight:null},w("toolbarActiveBackground","Toolbar background when holding the mouse over actions"));X("editor.snippetTabstopHighlightBackground",{dark:new me(new Tn(124,124,124,.3)),light:new me(new Tn(10,50,100,.2)),hcDark:new me(new Tn(124,124,124,.3)),hcLight:new me(new Tn(10,50,100,.2))},w("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop."));X("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hcDark:null,hcLight:null},w("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop."));X("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},w("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet."));X("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new me(new Tn(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},w("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet."));const UWe=X("breadcrumb.foreground",{light:It(qe,.8),dark:It(qe,.8),hcDark:It(qe,.8),hcLight:It(qe,.8)},w("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),jWe=X("breadcrumb.background",{light:Eo,dark:Eo,hcDark:Eo,hcLight:Eo},w("breadcrumbsBackground","Background color of breadcrumb items.")),are=X("breadcrumb.focusForeground",{light:hC(qe,.2),dark:nh(qe,.1),hcDark:nh(qe,.1),hcLight:nh(qe,.1)},w("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),KWe=X("breadcrumb.activeSelectionForeground",{light:hC(qe,.2),dark:nh(qe,.1),hcDark:nh(qe,.1),hcLight:nh(qe,.1)},w("breadcrumbsSelectedForeground","Color of selected breadcrumb items."));X("breadcrumbPicker.background",{light:Nr,dark:Nr,hcDark:Nr,hcLight:Nr},w("breadcrumbsSelectedBackground","Background color of breadcrumb item picker."));const ave=.5,lre=me.fromHex("#40C8AE").transparent(ave),cre=me.fromHex("#40A6FF").transparent(ave),ure=me.fromHex("#606060").transparent(.4),qu=.4,Mw=1,ay=X("merge.currentHeaderBackground",{dark:lre,light:lre,hcDark:null,hcLight:null},w("mergeCurrentHeaderBackground","Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);X("merge.currentContentBackground",{dark:It(ay,qu),light:It(ay,qu),hcDark:It(ay,qu),hcLight:It(ay,qu)},w("mergeCurrentContentBackground","Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const ly=X("merge.incomingHeaderBackground",{dark:cre,light:cre,hcDark:null,hcLight:null},w("mergeIncomingHeaderBackground","Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);X("merge.incomingContentBackground",{dark:It(ly,qu),light:It(ly,qu),hcDark:It(ly,qu),hcLight:It(ly,qu)},w("mergeIncomingContentBackground","Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const cy=X("merge.commonHeaderBackground",{dark:ure,light:ure,hcDark:null,hcLight:null},w("mergeCommonHeaderBackground","Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);X("merge.commonContentBackground",{dark:It(cy,qu),light:It(cy,qu),hcDark:It(cy,qu),hcLight:It(cy,qu)},w("mergeCommonContentBackground","Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const Aw=X("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},w("mergeBorder","Border color on headers and the splitter in inline merge-conflicts."));X("editorOverviewRuler.currentContentForeground",{dark:It(ay,Mw),light:It(ay,Mw),hcDark:Aw,hcLight:Aw},w("overviewRulerCurrentContentForeground","Current overview ruler foreground for inline merge-conflicts."));X("editorOverviewRuler.incomingContentForeground",{dark:It(ly,Mw),light:It(ly,Mw),hcDark:Aw,hcLight:Aw},w("overviewRulerIncomingContentForeground","Incoming overview ruler foreground for inline merge-conflicts."));X("editorOverviewRuler.commonContentForeground",{dark:It(cy,Mw),light:It(cy,Mw),hcDark:Aw,hcLight:Aw},w("overviewRulerCommonContentForeground","Common ancestor overview ruler foreground for inline merge-conflicts."));const Qq=X("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:""},w("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),NL=X("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},w("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),uy=X("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},w("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),M4=X("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},w("minimapSelectionOccurrenceHighlight","Minimap marker color for repeating editor selections."),!0),dre=X("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},w("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0),GWe=X("minimap.infoHighlight",{dark:Za,light:Za,hcDark:HD,hcLight:HD},w("minimapInfo","Minimap marker color for infos.")),qWe=X("minimap.warningHighlight",{dark:qs,light:qs,hcDark:$D,hcLight:$D},w("overviewRuleWarning","Minimap marker color for warnings.")),XWe=X("minimap.errorHighlight",{dark:new me(new Tn(255,18,18,.7)),light:new me(new Tn(255,18,18,.7)),hcDark:new me(new Tn(255,50,50,1)),hcLight:"#B5200D"},w("minimapError","Minimap marker color for errors.")),YWe=X("minimap.background",{dark:null,light:null,hcDark:null,hcLight:null},w("minimapBackground","Minimap background color.")),ZWe=X("minimap.foregroundOpacity",{dark:me.fromHex("#000f"),light:me.fromHex("#000f"),hcDark:me.fromHex("#000f"),hcLight:me.fromHex("#000f")},w("minimapForegroundOpacity",'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));X("minimapSlider.background",{light:It(EL,.5),dark:It(EL,.5),hcDark:It(EL,.5),hcLight:It(EL,.5)},w("minimapSliderBackground","Minimap slider background color."));X("minimapSlider.hoverBackground",{light:It(DL,.5),dark:It(DL,.5),hcDark:It(DL,.5),hcLight:It(DL,.5)},w("minimapSliderHoverBackground","Minimap slider background color when hovering."));X("minimapSlider.activeBackground",{light:It(IL,.5),dark:It(IL,.5),hcDark:It(IL,.5),hcLight:It(IL,.5)},w("minimapSliderActiveBackground","Minimap slider background color when clicked on."));const QWe=X("problemsErrorIcon.foreground",{dark:wf,light:wf,hcDark:wf,hcLight:wf},w("problemsErrorIconForeground","The color used for the problems error icon.")),JWe=X("problemsWarningIcon.foreground",{dark:qs,light:qs,hcDark:qs,hcLight:qs},w("problemsWarningIconForeground","The color used for the problems warning icon.")),e$e=X("problemsInfoIcon.foreground",{dark:Za,light:Za,hcDark:Za,hcLight:Za},w("problemsInfoIconForeground","The color used for the problems info icon."));X("charts.foreground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("chartsForeground","The foreground color used in charts."));X("charts.lines",{dark:It(qe,.5),light:It(qe,.5),hcDark:It(qe,.5),hcLight:It(qe,.5)},w("chartsLines","The color used for horizontal lines in charts."));X("charts.red",{dark:wf,light:wf,hcDark:wf,hcLight:wf},w("chartsRed","The red color used in chart visualizations."));X("charts.blue",{dark:Za,light:Za,hcDark:Za,hcLight:Za},w("chartsBlue","The blue color used in chart visualizations."));X("charts.yellow",{dark:qs,light:qs,hcDark:qs,hcLight:qs},w("chartsYellow","The yellow color used in chart visualizations."));X("charts.orange",{dark:uy,light:uy,hcDark:uy,hcLight:uy},w("chartsOrange","The orange color used in chart visualizations."));X("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},w("chartsGreen","The green color used in chart visualizations."));X("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},w("chartsPurple","The purple color used in chart visualizations."));function t$e(i,e){var t,n,r,o;switch(i.op){case 0:return(t=Sd(i.value,e))===null||t===void 0?void 0:t.darken(i.factor);case 1:return(n=Sd(i.value,e))===null||n===void 0?void 0:n.lighten(i.factor);case 2:return(r=Sd(i.value,e))===null||r===void 0?void 0:r.transparent(i.factor);case 3:{const s=Sd(i.background,e);return s?(o=Sd(i.value,e))===null||o===void 0?void 0:o.makeOpaque(s):Sd(i.value,e)}case 4:for(const s of i.values){const a=Sd(s,e);if(a)return a}return;case 6:return Sd(e.defines(i.if)?i.then:i.else,e);case 5:{const s=Sd(i.value,e);if(!s)return;const a=Sd(i.background,e);return a?s.isDarkerThan(a)?me.getLighterColor(s,a,i.factor).transparent(i.transparency):me.getDarkerColor(s,a,i.factor).transparent(i.transparency):s.transparent(i.factor*i.transparency)}default:throw w4()}}function hC(i,e){return{op:0,value:i,factor:e}}function nh(i,e){return{op:1,value:i,factor:e}}function It(i,e){return{op:2,value:i,factor:e}}function VD(...i){return{op:4,values:i}}function n$e(i,e,t){return{op:6,if:i,then:e,else:t}}function hre(i,e,t,n){return{op:5,value:i,background:e,factor:t,transparency:n}}function Sd(i,e){if(i!==null){if(typeof i=="string")return i[0]==="#"?me.fromHex(i):e.getColor(i);if(i instanceof me)return i;if(typeof i=="object")return t$e(i,e)}}const lve="vscode://schemas/workbench-colors",cve=ar.as(k4.JSONContribution);cve.registerSchema(lve,R4.getColorSchema());const fre=new pi(()=>cve.notifySchemaChanged(lve),200);R4.onDidChangeSchema(()=>{fre.isScheduled()||fre.schedule()});class A4{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(e){return new uve(this.x-e.scrollX,this.y-e.scrollY)}}class uve{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(e){return new A4(this.clientX+e.scrollX,this.clientY+e.scrollY)}}class i$e{constructor(e,t,n,r){this.x=e,this.y=t,this.width=n,this.height=r,this._editorPagePositionBrand=void 0}}class r$e{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function Jq(i){const e=Br(i);return new i$e(e.left,e.top,e.width,e.height)}function eX(i,e,t){const n=e.width/i.offsetWidth,r=e.height/i.offsetHeight,o=(t.x-e.x)/n,s=(t.y-e.y)/r;return new r$e(o,s)}class Xv extends Uu{constructor(e,t,n){super(Pt(n),e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new A4(this.posx,this.posy),this.editorPos=Jq(n),this.relativePos=eX(n,this.editorPos,this.pos)}}class o$e{constructor(e){this._editorViewDomNode=e}_create(e){return new Xv(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return ye(e,"contextmenu",n=>{t(this._create(n))})}onMouseUp(e,t){return ye(e,"mouseup",n=>{t(this._create(n))})}onMouseDown(e,t){return ye(e,Ge.MOUSE_DOWN,n=>{t(this._create(n))})}onPointerDown(e,t){return ye(e,Ge.POINTER_DOWN,n=>{t(this._create(n),n.pointerId)})}onMouseLeave(e,t){return ye(e,Ge.MOUSE_LEAVE,n=>{t(this._create(n))})}onMouseMove(e,t){return ye(e,"mousemove",n=>t(this._create(n)))}}class s$e{constructor(e){this._editorViewDomNode=e}_create(e){return new Xv(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return ye(e,"pointerup",n=>{t(this._create(n))})}onPointerDown(e,t){return ye(e,Ge.POINTER_DOWN,n=>{t(this._create(n),n.pointerId)})}onPointerLeave(e,t){return ye(e,Ge.POINTER_LEAVE,n=>{t(this._create(n))})}onPointerMove(e,t){return ye(e,"pointermove",n=>t(this._create(n)))}}class a$e extends fe{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new kS),this._keydownListener=null}startMonitoring(e,t,n,r,o){this._keydownListener=Sr(e.ownerDocument,"keydown",s=>{s.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,s.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,n,s=>{r(new Xv(s,!0,this._editorViewDomNode))},s=>{this._keydownListener.dispose(),o(s)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}class Wk{constructor(e){this._editor=e,this._instanceId=++Wk._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new pi(()=>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 n=this._rules.get(t);if(!n){const r=this._counter++;n=new l$e(t,`dyn-rule-${this._instanceId}-${r}`,GA(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(t,n)}return n}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(const e of this._rules.values())e.hasReferences()||(this._rules.delete(e.key),e.dispose())}}Wk._idPool=0;class l$e{constructor(e,t,n,r){this.key=e,this.className=t,this.properties=r,this._referenceCount=0,this._styleElementDisposables=new Te,this._styleElement=gc(n,void 0,this._styleElementDisposables),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let n=`.${e} {`;for(const r in t){const o=t[r];let s;typeof o=="object"?s=ht(o.id):s=o;const a=c$e(r);n+=` ${a}: ${s};`}return n+=` -}`,n}dispose(){this._styleElementDisposables.dispose(),this._styleElement=void 0}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function c$e(i){return i.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}class $k extends fe{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 n=0,r=e.length;n=a.left?r.width=Math.max(r.width,a.left+a.width-r.left):(t[n++]=r,r=a)}return t[n++]=r,t}static _createHorizontalRangesFromClientRects(e,t,n){if(!e||e.length===0)return null;const r=[];for(let o=0,s=e.length;ol)return null;if(t=Math.min(l,Math.max(0,t)),r=Math.min(l,Math.max(0,r)),t===r&&n===o&&n===0&&!e.children[t].firstChild){const h=e.children[t].getClientRects();return s.markDidDomLayout(),this._createHorizontalRangesFromClientRects(h,s.clientRectDeltaLeft,s.clientRectScale)}t!==r&&r>0&&o===0&&(r--,o=1073741824);let c=e.children[t].firstChild,u=e.children[r].firstChild;if((!c||!u)&&(!c&&n===0&&t>0&&(c=e.children[t-1].firstChild,n=1073741824),!u&&o===0&&r>0&&(u=e.children[r-1].firstChild,o=1073741824)),!c||!u)return null;n=Math.min(c.textContent.length,Math.max(0,n)),o=Math.min(u.textContent.length,Math.max(0,o));const d=this._readClientRects(c,n,u,o,s.endNode);return s.markDidDomLayout(),this._createHorizontalRangesFromClientRects(d,s.clientRectDeltaLeft,s.clientRectScale)}}var Xc;(function(i){i.DARK="dark",i.LIGHT="light",i.HIGH_CONTRAST_DARK="hcDark",i.HIGH_CONTRAST_LIGHT="hcLight"})(Xc||(Xc={}));function ih(i){return i===Xc.HIGH_CONTRAST_DARK||i===Xc.HIGH_CONTRAST_LIGHT}function Pw(i){return i===Xc.DARK||i===Xc.HIGH_CONTRAST_DARK}const g$e=function(){return Jd?!0:!(Da||ru||Dp)}();let Wy=!0;class pre{constructor(e,t){this.themeType=t;const n=e.options,r=n.get(50);n.get(38)==="off"?this.renderWhitespace=n.get(99):this.renderWhitespace="none",this.renderControlCharacters=n.get(94),this.spaceWidth=r.spaceWidth,this.middotWidth=r.middotWidth,this.wsmiddotWidth=r.wsmiddotWidth,this.useMonospaceOptimizations=r.isMonospace&&!n.get(33),this.canUseHalfwidthRightwardsArrow=r.canUseHalfwidthRightwardsArrow,this.lineHeight=n.get(67),this.stopRenderingLineAfter=n.get(117),this.fontLigatures=n.get(51)}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures}}class hf{constructor(e){this._options=e,this._isMaybeInvalid=!0,this._renderedViewLine=null}getDomNode(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null}setDomNode(e){if(this._renderedViewLine)this._renderedViewLine.domNode=Qn(e);else throw new Error("I have no rendered view line to set the dom node to...")}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return ih(this._options.themeType)||this._options.renderWhitespace==="selection"?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,t,n,r){if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;const o=n.getViewLineRenderingData(e),s=this._options,a=Ca.filter(o.inlineDecorations,e,o.minColumn,o.maxColumn);let l=null;if(ih(s.themeType)||this._options.renderWhitespace==="selection"){const h=n.selections;for(const f of h){if(f.endLineNumbere)continue;const g=f.startLineNumber===e?f.startColumn:o.minColumn,p=f.endLineNumber===e?f.endColumn:o.maxColumn;g');const u=Fk(c,r);r.appendString("");let d=null;return Wy&&g$e&&o.isBasicASCII&&s.useMonospaceOptimizations&&u.containsForeignElements===0&&(d=new uR(this._renderedViewLine?this._renderedViewLine.domNode:null,c,u.characterMapping)),d||(d=hve(this._renderedViewLine?this._renderedViewLine.domNode:null,c,u.characterMapping,u.containsRTL,u.containsForeignElements)),this._renderedViewLine=d,!0}layoutLine(e,t){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(this._options.lineHeight))}getWidth(e){return this._renderedViewLine?this._renderedViewLine.getWidth(e):0}getWidthIsFast(){return this._renderedViewLine?this._renderedViewLine.getWidthIsFast():!0}needsMonospaceFontCheck(){return this._renderedViewLine?this._renderedViewLine instanceof uR:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof uR?this._renderedViewLine.monospaceAssumptionsAreValid():Wy}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof uR&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,n,r){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),n=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,n));const o=this._renderedViewLine.input.stopRenderingLineAfter;if(o!==-1&&t>o+1&&n>o+1)return new gre(!0,[new rb(this.getWidth(r),0)]);o!==-1&&t>o+1&&(t=o+1),o!==-1&&n>o+1&&(n=o+1);const s=this._renderedViewLine.getVisibleRangesForRange(e,t,n,r);return s&&s.length>0?new gre(!1,s):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}}hf.CLASS_NAME="view-line";class uR{constructor(e,t,n){this._cachedWidth=-1,this.domNode=e,this.input=t;const r=Math.floor(t.lineContent.length/300);if(r>0){this._keyColumnPixelOffsetCache=new Float32Array(r);for(let o=0;o=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),Wy=!1)}return Wy}toSlowRenderedLine(){return hve(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,n,r){const o=this._getColumnPixelOffset(e,t,r),s=this._getColumnPixelOffset(e,n,r);return[new rb(o,s-o)]}_getColumnPixelOffset(e,t,n){if(t<=300){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const r=Math.floor((t-1)/300)-1,o=(r+1)*300+1;let s=-1;if(this._keyColumnPixelOffsetCache&&(s=this._keyColumnPixelOffsetCache[r],s===-1&&(s=this._actualReadPixelOffset(e,o,n),this._keyColumnPixelOffsetCache[r]=s)),s===-1){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const a=this._characterMapping.getHorizontalOffset(o),l=this._characterMapping.getHorizontalOffset(t);return s+this._charWidth*(l-a)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,n){if(!this.domNode)return-1;const r=this._characterMapping.getDomPosition(t),o=_M.readHorizontalRanges(this._getReadingTarget(this.domNode),r.partIndex,r.charIndex,r.partIndex,r.charIndex,n);return!o||o.length===0?-1:o[0].left}getColumnOfNodeOffset(e,t){return tX(this._characterMapping,e,t)}}class dve{constructor(e,t,n,r,o){if(this.domNode=e,this.input=t,this._characterMapping=n,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=o,this._cachedWidth=-1,this._pixelOffsetCache=null,!r||this._characterMapping.length===0){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let s=0,a=this._characterMapping.length;s<=a;s++)this._pixelOffsetCache[s]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(e){return this.domNode?(this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e==null||e.markDidDomLayout()),this._cachedWidth):0}getWidthIsFast(){return this._cachedWidth!==-1}getVisibleRangesForRange(e,t,n,r){if(!this.domNode)return null;if(this._pixelOffsetCache!==null){const o=this._readPixelOffset(this.domNode,e,t,r);if(o===-1)return null;const s=this._readPixelOffset(this.domNode,e,n,r);return s===-1?null:[new rb(o,s-o)]}return this._readVisibleRangesForRange(this.domNode,e,t,n,r)}_readVisibleRangesForRange(e,t,n,r,o){if(n===r){const s=this._readPixelOffset(e,t,n,o);return s===-1?null:[new rb(s,0)]}else return this._readRawVisibleRangesForRange(e,n,r,o)}_readPixelOffset(e,t,n,r){if(this._characterMapping.length===0){if(this._containsForeignElements===0||this._containsForeignElements===2)return 0;if(this._containsForeignElements===1)return this.getWidth(r);const o=this._getReadingTarget(e);return o.firstChild?(r.markDidDomLayout(),o.firstChild.offsetWidth):0}if(this._pixelOffsetCache!==null){const o=this._pixelOffsetCache[n];if(o!==-1)return o;const s=this._actualReadPixelOffset(e,t,n,r);return this._pixelOffsetCache[n]=s,s}return this._actualReadPixelOffset(e,t,n,r)}_actualReadPixelOffset(e,t,n,r){if(this._characterMapping.length===0){const l=_M.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,r);return!l||l.length===0?-1:l[0].left}if(n===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===0)return this.getWidth(r);const o=this._characterMapping.getDomPosition(n),s=_M.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,o.partIndex,o.charIndex,r);if(!s||s.length===0)return-1;const a=s[0].left;if(this.input.isBasicASCII){const l=this._characterMapping.getHorizontalOffset(n),c=Math.round(this.input.spaceWidth*l);if(Math.abs(c-a)<=1)return c}return a}_readRawVisibleRangesForRange(e,t,n,r){if(t===1&&n===this._characterMapping.length)return[new rb(0,this.getWidth(r))];const o=this._characterMapping.getDomPosition(t),s=this._characterMapping.getDomPosition(n);return _M.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,s.partIndex,s.charIndex,r)}getColumnOfNodeOffset(e,t){return tX(this._characterMapping,e,t)}}class p$e extends dve{_readVisibleRangesForRange(e,t,n,r,o){const s=super._readVisibleRangesForRange(e,t,n,r,o);if(!s||s.length===0||n===r||n===1&&r===this._characterMapping.length)return s;if(!this.input.containsRTL){const a=this._readPixelOffset(e,t,r,o);if(a!==-1){const l=s[s.length-1];l.left=t){const d=t-s;return c-t=4&&e[0]===3&&e[3]===8}static isStrictChildOfViewLines(e){return e.length>4&&e[0]===3&&e[3]===8}static isChildOfScrollableElement(e){return e.length>=2&&e[0]===3&&e[1]===6}static isChildOfMinimap(e){return e.length>=2&&e[0]===3&&e[1]===9}static isChildOfContentWidgets(e){return e.length>=4&&e[0]===3&&e[3]===1}static isChildOfOverflowGuard(e){return e.length>=1&&e[0]===3}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&e[0]===2}static isChildOfOverlayWidgets(e){return e.length>=2&&e[0]===3&&e[1]===4}static isChildOfOverflowingOverlayWidgets(e){return e.length>=1&&e[0]===5}}class Ow{constructor(e,t,n){this.viewModel=e.viewModel;const r=e.configuration.options;this.layoutInfo=r.get(144),this.viewDomNode=t.viewDomNode,this.lineHeight=r.get(67),this.stickyTabStops=r.get(116),this.typicalHalfwidthCharacterWidth=r.get(50).typicalHalfwidthCharacterWidth,this.lastRenderData=n,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return Ow.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const n=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(n){const r=n.verticalOffset+n.height/2,o=e.viewModel.getLineCount();let s=null,a,l=null;return n.afterLineNumber!==o&&(l=new ae(n.afterLineNumber+1,1)),n.afterLineNumber>0&&(s=new ae(n.afterLineNumber,e.viewModel.getLineMaxColumn(n.afterLineNumber))),l===null?a=s:s===null?a=l:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,rs._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class nX extends b$e{constructor(e,t,n,r,o){super(e,t,n,r),this._ctx=e,o?(this.target=o,this.targetPath=fh.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} - target: ${this.target?this.target.outerHTML:null}`}_getMouseColumn(e=null){return e&&e.columns.contentLeft+s.width)continue;const a=e.getVerticalOffsetForLineNumber(s.position.lineNumber);if(a<=o&&o<=a+s.height)return t.fulfillContentText(s.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const n=e.getZoneAtCoord(t.mouseVerticalOffset);if(n){const r=t.isInContentArea?8:5;return t.fulfillViewZone(r,n.position,n)}return null}static _hitTestTextArea(e,t){return ra.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 n=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),r=n.range.getStartPosition();let o=Math.abs(t.relativePos.x);const s={isAfterLines:n.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:o};if(o-=e.layoutInfo.glyphMarginLeft,o<=e.layoutInfo.glyphMarginWidth){const a=e.viewModel.coordinatesConverter.convertViewPositionToModelPosition(n.range.getStartPosition()),l=e.viewModel.glyphLanes.getLanesAtLine(a.lineNumber);return s.glyphMarginLane=l[Math.floor(o/e.lineHeight)],t.fulfillMargin(2,r,n.range,s)}return o-=e.layoutInfo.glyphMarginWidth,o<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,r,n.range,s):(o-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,r,n.range,s))}return null}static _hitTestViewLines(e,t,n){if(!ra.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new ae(1,1),mre);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const o=e.viewModel.getLineCount(),s=e.viewModel.getLineMaxColumn(o);return t.fulfillContentEmpty(new ae(o,s),mre)}if(n){if(ra.isStrictChildOfViewLines(t.targetPath)){const o=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.viewModel.getLineLength(o)===0){const a=e.getLineWidth(o),l=E6(t.mouseContentHorizontalOffset-a);return t.fulfillContentEmpty(new ae(o,1),l)}const s=e.getLineWidth(o);if(t.mouseContentHorizontalOffset>=s){const a=E6(t.mouseContentHorizontalOffset-s),l=new ae(o,e.viewModel.getLineMaxColumn(o));return t.fulfillContentEmpty(l,a)}}return t.fulfillUnknown()}const r=rs._doHitTest(e,t);return r.type===1?rs.createMouseTargetFromHitTestPosition(e,t,r.spanNode,r.position,r.injectedText):this._createMouseTarget(e,t.withTarget(r.hitTarget),!0)}static _hitTestMinimap(e,t){if(ra.isChildOfMinimap(t.targetPath)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new ae(n,r))}return null}static _hitTestScrollbarSlider(e,t){if(ra.isChildOfScrollableElement(t.targetPath)&&t.target&&t.target.nodeType===1){const n=t.target.className;if(n&&/\b(slider|scrollbar)\b/.test(n)){const r=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.viewModel.getLineMaxColumn(r);return t.fulfillScrollbar(new ae(r,o))}}return null}static _hitTestScrollbar(e,t){if(ra.isChildOfScrollableElement(t.targetPath)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new ae(n,r))}return null}getMouseColumn(e){const t=this._context.configuration.options,n=t.get(144),r=this._context.viewLayout.getCurrentScrollLeft()+e.x-n.contentLeft;return rs._getMouseColumn(r,t.get(50).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,n,r,o){const s=r.lineNumber,a=r.column,l=e.getLineWidth(s);if(t.mouseContentHorizontalOffset>l){const m=E6(t.mouseContentHorizontalOffset-l);return t.fulfillContentEmpty(r,m)}const c=e.visibleRangeForPosition(s,a);if(!c)return t.fulfillUnknown(r);const u=c.left;if(Math.abs(t.mouseContentHorizontalOffset-u)<1)return t.fulfillContentText(r,null,{mightBeForeignElement:!!o,injectedText:o});const d=[];if(d.push({offset:c.left,column:a}),a>1){const m=e.visibleRangeForPosition(s,a-1);m&&d.push({offset:m.left,column:a-1})}const h=e.viewModel.getLineMaxColumn(s);if(am.offset-_.offset);const f=t.pos.toClientCoordinates(Pt(e.viewDomNode)),g=n.getBoundingClientRect(),p=g.left<=f.clientX&&f.clientX<=g.right;let v=null;for(let m=1;mo)){const a=Math.floor((r+o)/2);let l=t.pos.y+(a-t.mouseVerticalOffset);l<=t.editorPos.y&&(l=t.editorPos.y+1),l>=t.editorPos.y+t.editorPos.height&&(l=t.editorPos.y+t.editorPos.height-1);const c=new A4(t.pos.x,l),u=this._actualDoHitTestWithCaretRangeFromPoint(e,c.toClientCoordinates(Pt(e.viewDomNode)));if(u.type===1)return u}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates(Pt(e.viewDomNode)))}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const n=Tb(e.viewDomNode);let r;if(n?typeof n.caretRangeFromPoint>"u"?r=C$e(n,t.clientX,t.clientY):r=n.caretRangeFromPoint(t.clientX,t.clientY):r=e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY),!r||!r.startContainer)return new vm;const o=r.startContainer;if(o.nodeType===o.TEXT_NODE){const s=o.parentNode,a=s?s.parentNode:null,l=a?a.parentNode:null;return(l&&l.nodeType===l.ELEMENT_NODE?l.className:null)===hf.CLASS_NAME?E0.createFromDOMInfo(e,s,r.startOffset):new vm(o.parentNode)}else if(o.nodeType===o.ELEMENT_NODE){const s=o.parentNode,a=s?s.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===hf.CLASS_NAME?E0.createFromDOMInfo(e,o,o.textContent.length):new vm(o)}return new vm}static _doHitTestWithCaretPositionFromPoint(e,t){const n=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(n.offsetNode.nodeType===n.offsetNode.TEXT_NODE){const r=n.offsetNode.parentNode,o=r?r.parentNode:null,s=o?o.parentNode:null;return(s&&s.nodeType===s.ELEMENT_NODE?s.className:null)===hf.CLASS_NAME?E0.createFromDOMInfo(e,n.offsetNode.parentNode,n.offset):new vm(n.offsetNode.parentNode)}if(n.offsetNode.nodeType===n.offsetNode.ELEMENT_NODE){const r=n.offsetNode.parentNode,o=r&&r.nodeType===r.ELEMENT_NODE?r.className:null,s=r?r.parentNode:null,a=s&&s.nodeType===s.ELEMENT_NODE?s.className:null;if(o===hf.CLASS_NAME){const l=n.offsetNode.childNodes[Math.min(n.offset,n.offsetNode.childNodes.length-1)];if(l)return E0.createFromDOMInfo(e,l,0)}else if(a===hf.CLASS_NAME)return E0.createFromDOMInfo(e,n.offsetNode,0)}return new vm(n.offsetNode)}static _snapToSoftTabBoundary(e,t){const n=t.getLineContent(e.lineNumber),{tabSize:r}=t.model.getOptions(),o=zD.atomicPosition(n,e.column-1,r,2);return o!==-1?new ae(e.lineNumber,o+1):e}static _doHitTest(e,t){let n=new vm;if(typeof e.viewDomNode.ownerDocument.caretRangeFromPoint=="function"?n=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(n=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates(Pt(e.viewDomNode)))),n.type===1){const r=e.viewModel.getInjectedTextAt(n.position),o=e.viewModel.normalizePosition(n.position,2);(r||!o.equals(n.position))&&(n=new fve(o,n.spanNode,r))}return n}}function C$e(i,e,t){const n=document.createRange();let r=i.elementFromPoint(e,t);if(r!==null){for(;r&&r.firstChild&&r.firstChild.nodeType!==r.firstChild.TEXT_NODE&&r.lastChild&&r.lastChild.firstChild;)r=r.lastChild;const o=r.getBoundingClientRect(),s=Pt(r),a=s.getComputedStyle(r,null).getPropertyValue("font-style"),l=s.getComputedStyle(r,null).getPropertyValue("font-variant"),c=s.getComputedStyle(r,null).getPropertyValue("font-weight"),u=s.getComputedStyle(r,null).getPropertyValue("font-size"),d=s.getComputedStyle(r,null).getPropertyValue("line-height"),h=s.getComputedStyle(r,null).getPropertyValue("font-family"),f=`${a} ${l} ${c} ${u}/${d} ${h}`,g=r.innerText;let p=o.left,v=0,m;if(e>o.left+o.width)v=g.length;else{const _=V0.getInstance();for(let y=0;y=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Si;(function(i){i.Tap="-monaco-gesturetap",i.Change="-monaco-gesturechange",i.Start="-monaco-gesturestart",i.End="-monaco-gesturesend",i.Contextmenu="-monaco-gesturecontextmenu"})(Si||(Si={}));class wi extends fe{constructor(){super(),this.dispatched=!1,this.targets=new _a,this.ignoreTargets=new _a,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Je.runAndSubscribe(d4,({window:e,disposables:t})=>{t.add(ye(e.document,"touchstart",n=>this.onTouchStart(n),{passive:!1})),t.add(ye(e.document,"touchend",n=>this.onTouchEnd(e,n))),t.add(ye(e.document,"touchmove",n=>this.onTouchMove(n),{passive:!1}))},{window:hi,disposables:this._store}))}static addTarget(e){if(!wi.isTouchDevice())return fe.None;wi.INSTANCE||(wi.INSTANCE=new wi);const t=wi.INSTANCE.targets.push(e);return Rt(t)}static ignoreTarget(e){if(!wi.isTouchDevice())return fe.None;wi.INSTANCE||(wi.INSTANCE=new wi);const t=wi.INSTANCE.ignoreTargets.push(e);return Rt(t)}static isTouchDevice(){return"ontouchstart"in hi||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){const t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let n=0,r=e.targetTouches.length;n=wi.HOLD_DELAY&&Math.abs(l.initialPageX-Rc(l.rollingPageX))<30&&Math.abs(l.initialPageY-Rc(l.rollingPageY))<30){const u=this.newGestureEvent(Si.Contextmenu,l.initialTarget);u.pageX=Rc(l.rollingPageX),u.pageY=Rc(l.rollingPageY),this.dispatchEvent(u)}else if(r===1){const u=Rc(l.rollingPageX),d=Rc(l.rollingPageY),h=Rc(l.rollingTimestamps)-l.rollingTimestamps[0],f=u-l.rollingPageX[0],g=d-l.rollingPageY[0],p=[...this.targets].filter(v=>l.initialTarget instanceof Node&&v.contains(l.initialTarget));this.inertia(e,p,n,Math.abs(f)/h,f>0?1:-1,u,Math.abs(g)/h,g>0?1:-1,d)}this.dispatchEvent(this.newGestureEvent(Si.End,l.initialTarget)),delete this.activeTouches[a.identifier]}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){const n=document.createEvent("CustomEvent");return n.initEvent(e,!1,!0),n.initialTarget=t,n.tapCount=0,n}dispatchEvent(e){if(e.type===Si.Tap){const t=new Date().getTime();let n=0;t-this._lastSetTapCountTime>wi.CLEAR_TAP_COUNT_TIME?n=1:n=2,this._lastSetTapCountTime=t,e.tapCount=n}else(e.type===Si.Change||e.type===Si.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(const t of this.ignoreTargets)if(t.contains(e.initialTarget))return;for(const t of this.targets)t.contains(e.initialTarget)&&(t.dispatchEvent(e),this.dispatched=!0)}}inertia(e,t,n,r,o,s,a,l,c){this.handle=Il(e,()=>{const u=Date.now(),d=u-n;let h=0,f=0,g=!0;r+=wi.SCROLL_FRICTION*d,a+=wi.SCROLL_FRICTION*d,r>0&&(g=!1,h=o*r*d),a>0&&(g=!1,f=l*a*d);const p=this.newGestureEvent(Si.Change);p.translationX=h,p.translationY=f,t.forEach(v=>v.dispatchEvent(p)),g||this.inertia(e,t,u,r,o,s+h,a,l,c+f)})}onTouchMove(e){const t=Date.now();for(let n=0,r=e.changedTouches.length;n3&&(s.rollingPageX.shift(),s.rollingPageY.shift(),s.rollingTimestamps.shift()),s.rollingPageX.push(o.pageX),s.rollingPageY.push(o.pageY),s.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}wi.SCROLL_FRICTION=-.005;wi.HOLD_DELAY=700;wi.CLEAR_TAP_COUNT_TIME=400;y$e([Rr],wi,"isTouchDevice",null);let yc=class extends fe{onclick(e,t){this._register(ye(e,Ge.CLICK,n=>t(new Uu(Pt(e),n))))}onmousedown(e,t){this._register(ye(e,Ge.MOUSE_DOWN,n=>t(new Uu(Pt(e),n))))}onmouseover(e,t){this._register(ye(e,Ge.MOUSE_OVER,n=>t(new Uu(Pt(e),n))))}onmouseleave(e,t){this._register(ye(e,Ge.MOUSE_LEAVE,n=>t(new Uu(Pt(e),n))))}onkeydown(e,t){this._register(ye(e,Ge.KEY_DOWN,n=>t(new Ai(n))))}onkeyup(e,t){this._register(ye(e,Ge.KEY_UP,n=>t(new Ai(n))))}oninput(e,t){this._register(ye(e,Ge.INPUT,t))}onblur(e,t){this._register(ye(e,Ge.BLUR,t))}onfocus(e,t){this._register(ye(e,Ge.FOCUS,t))}ignoreGesture(e){return wi.ignoreTarget(e)}};const Fw=11;class w$e extends yc{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...Wt.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=Fw+"px",this.domNode.style.height=Fw+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new kS),this._register(Sr(this.bgDomNode,Ge.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Sr(this.domNode,Ge.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new Eq),this._pointerdownScheduleRepeatTimer=this._register(new cd)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Pt(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}}class S$e extends fe{constructor(e,t,n){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new cd)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){const e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;(e=this._domNode)===null||e===void 0||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)===null||t===void 0||t.setClassName(this._invisibleClassName+(e?" fade":"")))}}const x$e=140;class gve extends yc{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 S$e(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new kS),this._shouldRender=!0,this.domNode=Qn(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(ye(this.domNode.domNode,Ge.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){const t=this._register(new w$e(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,r){this.slider=Qn(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof n=="number"&&this.slider.setWidth(n),typeof r=="number"&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(ye(this.slider.domNode,Ge.POINTER_DOWN,o=>{o.button===0&&(o.preventDefault(),this._sliderPointerDown(o))})),this.onclick(this.slider.domNode,o=>{o.leftButton&&o.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){const t=this.domNode.domNode.getClientRects()[0].top,n=t+this._scrollbarState.getSliderPosition(),r=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);n<=o&&o<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,n;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,n=e.offsetY;else{const o=Br(this.domNode.domNode);t=e.pageX-o.left,n=e.pageY-o.top}const r=this._pointerDownRelativePosition(t,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>{const s=this._sliderOrthogonalPointerPosition(o),a=Math.abs(s-n);if(Rs&&a>x$e){this._setDesiredScrollPositionNow(r.getScrollPosition());return}const c=this._sliderPointerPosition(o)-t;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(c))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){const t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}}const L$e=20;class Bw{constructor(e,t,n,r,o,s){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(e),this._visibleSize=r,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 Bw(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){const t=Math.round(e);return this._visibleSize!==t?(this._visibleSize=t,this._refreshComputedValues(),!0):!1}setScrollSize(e){const t=Math.round(e);return this._scrollSize!==t?(this._scrollSize=t,this._refreshComputedValues(),!0):!1}setScrollPosition(e){const t=Math.round(e);return this._scrollPosition!==t?(this._scrollPosition=t,this._refreshComputedValues(),!0):!1}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,n,r,o){const s=Math.max(0,n-e),a=Math.max(0,s-2*t),l=r>0&&r>n;if(!l)return{computedAvailableSize:Math.round(s),computedIsNeeded:l,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};const c=Math.round(Math.max(L$e,Math.floor(n*a/r))),u=(a-c)/(r-n),d=o*u;return{computedAvailableSize:Math.round(s),computedIsNeeded:l,computedSliderSize:Math.round(c),computedSliderRatio:u,computedSliderPosition:Math.round(d)}}_refreshComputedValues(){const e=Bw._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 n=this._scrollPosition;return tthis._host.onMouseWheel(new kb(null,1,0))}),this._createArrow({className:"scra",icon:Xe.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:s,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new kb(null,-1,0))})}this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}class D$e extends gve{constructor(e,t,n){const r=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new Bw(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,r.height,r.scrollHeight,o.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const s=(t.arrowSize-Fw)/2,a=(t.verticalScrollbarSize-Fw)/2;this._createArrow({className:"scra",icon:Xe.scrollbarButtonUp,top:s,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new kb(null,0,1))}),this._createArrow({className:"scra",icon:Xe.scrollbarButtonDown,top:void 0,left:a,bottom:s,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new kb(null,0,-1))})}this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}class sP{constructor(e,t,n,r,o,s,a){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t=t|0,n=n|0,r=r|0,o=o|0,s=s|0,a=a|0),this.rawScrollLeft=r,this.rawScrollTop=a,t<0&&(t=0),r+t>n&&(r=n-t),r<0&&(r=0),o<0&&(o=0),a+o>s&&(a=s-o),a<0&&(a=0),this.width=t,this.scrollWidth=n,this.scrollLeft=r,this.height=o,this.scrollHeight=s,this.scrollTop=a}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,t){return new sP(this._forceIntegerValues,typeof e.width<"u"?e.width:this.width,typeof e.scrollWidth<"u"?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,typeof e.height<"u"?e.height:this.height,typeof e.scrollHeight<"u"?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new sP(this._forceIntegerValues,this.width,this.scrollWidth,typeof e.scrollLeft<"u"?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof e.scrollTop<"u"?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){const n=this.width!==e.width,r=this.scrollWidth!==e.scrollWidth,o=this.scrollLeft!==e.scrollLeft,s=this.height!==e.height,a=this.scrollHeight!==e.scrollHeight,l=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:r,scrollLeftChanged:o,heightChanged:s,scrollHeightChanged:a,scrollTopChanged:l}}}class TS extends fe{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new se),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new sP(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var n;const r=this._state.withScrollDimensions(e,t);this._setState(r,!!this._smoothScrolling),(n=this._smoothScrolling)===null||n===void 0||n.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){const t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};const n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let r;t?r=new UD(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):r=this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=r}else{const n=this._state.withScrollPosition(e);this._smoothScrolling=UD.start(this._state,n,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;const e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){const n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,t)))}}class vre{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}}function D6(i,e){const t=e-i;return function(n){return i+t*T$e(n)}}function I$e(i,e,t){return function(n){return n2.5*n){let o,s;return e0&&Math.abs(e.deltaY)>0)return 1;let t=.5;return this._front===-1&&this._rear===-1||this._memory[this._rear],(!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(t+=.25),Math.min(Math.max(t,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}}aP.INSTANCE=new aP;class iX extends yc{get options(){return this._options}constructor(e,t,n){super(),this._onScroll=this._register(new se),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new se),e.style.overflow="hidden",this._options=M$e(t),this._scrollable=n,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));const r={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new D$e(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new E$e(this._scrollable,this._options,r)),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=Qn(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Qn(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Qn(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,o=>this._onMouseOver(o)),this.onmouseleave(this._listenOnDomNode,o=>this._onMouseLeave(o)),this._hideTimeout=this._register(new cd),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=si(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Ln&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new kb(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=si(this._mouseWheelToDispose),e)){const n=r=>{this._onMouseWheel(new kb(r))};this._mouseWheelToDispose.push(ye(this._listenOnDomNode,Ge.MOUSE_WHEEL,n,{passive:!1}))}}_onMouseWheel(e){var t;if(!((t=e.browserEvent)===null||t===void 0)&&t.defaultPrevented)return;const n=aP.INSTANCE;n.acceptStandardWheelEvent(e);let r=!1;if(e.deltaY||e.deltaX){let s=e.deltaY*this._options.mouseWheelScrollSensitivity,a=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&a+s===0?a=s=0:Math.abs(s)>=Math.abs(a)?a=0:s=0),this._options.flipAxes&&([s,a]=[a,s]);const l=!Ln&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||l)&&!a&&(a=s,s=0),e.browserEvent&&e.browserEvent.altKey&&(a=a*this._options.fastScrollSensitivity,s=s*this._options.fastScrollSensitivity);const c=this._scrollable.getFutureScrollPosition();let u={};if(s){const d=_re*s,h=c.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(u,h)}if(a){const d=_re*a,h=c.scrollLeft-(d<0?Math.floor(d):Math.ceil(d));this._horizontalScrollbar.writeScrollPosition(u,h)}u=this._scrollable.validateScrollPosition(u),(c.scrollLeft!==u.scrollLeft||c.scrollTop!==u.scrollTop)&&(this._options.mouseWheelSmoothScroll&&n.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(u):this._scrollable.setScrollPositionNow(u),r=!0)}let o=r;!o&&this._options.alwaysConsumeMouseWheel&&(o=!0),!o&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(o=!0),o&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,n=e.scrollLeft>0,r=n?" left":"",o=t?" top":"",s=n||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${s}${o}${r}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),N$e)}}class pve extends iX{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const n=new TS({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:r=>Il(Pt(e),r)});super(e,t,n),this._register(n)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class O4 extends iX{constructor(e,t,n){super(e,t,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class Hk extends iX{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const n=new TS({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:r=>Il(Pt(e),r)});super(e,t,n),this._register(n),this._element=e,this._register(this.onScroll(r=>{r.scrollTopChanged&&(this._element.scrollTop=r.scrollTop),r.scrollLeftChanged&&(this._element.scrollLeft=r.scrollLeft)})),this.scanDomNode()}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}}function M$e(i){const e={lazyRender:typeof i.lazyRender<"u"?i.lazyRender:!1,className:typeof i.className<"u"?i.className:"",useShadows:typeof i.useShadows<"u"?i.useShadows:!0,handleMouseWheel:typeof i.handleMouseWheel<"u"?i.handleMouseWheel:!0,flipAxes:typeof i.flipAxes<"u"?i.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof i.consumeMouseWheelIfScrollbarIsNeeded<"u"?i.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof i.alwaysConsumeMouseWheel<"u"?i.alwaysConsumeMouseWheel:!1,scrollYToX:typeof i.scrollYToX<"u"?i.scrollYToX:!1,mouseWheelScrollSensitivity:typeof i.mouseWheelScrollSensitivity<"u"?i.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof i.fastScrollSensitivity<"u"?i.fastScrollSensitivity:5,scrollPredominantAxis:typeof i.scrollPredominantAxis<"u"?i.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof i.mouseWheelSmoothScroll<"u"?i.mouseWheelSmoothScroll:!0,arrowSize:typeof i.arrowSize<"u"?i.arrowSize:11,listenOnDomNode:typeof i.listenOnDomNode<"u"?i.listenOnDomNode:null,horizontal:typeof i.horizontal<"u"?i.horizontal:1,horizontalScrollbarSize:typeof i.horizontalScrollbarSize<"u"?i.horizontalScrollbarSize:10,horizontalSliderSize:typeof i.horizontalSliderSize<"u"?i.horizontalSliderSize:0,horizontalHasArrows:typeof i.horizontalHasArrows<"u"?i.horizontalHasArrows:!1,vertical:typeof i.vertical<"u"?i.vertical:1,verticalScrollbarSize:typeof i.verticalScrollbarSize<"u"?i.verticalScrollbarSize:10,verticalHasArrows:typeof i.verticalHasArrows<"u"?i.verticalHasArrows:!1,verticalSliderSize:typeof i.verticalSliderSize<"u"?i.verticalSliderSize:0,scrollByPage:typeof i.scrollByPage<"u"?i.scrollByPage:!1};return e.horizontalSliderSize=typeof i.horizontalSliderSize<"u"?i.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof i.verticalSliderSize<"u"?i.verticalSliderSize:e.verticalScrollbarSize,Ln&&(e.className+=" mac"),e}class rX extends $k{constructor(e,t,n){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=n,this.mouseTargetFactory=new rs(this._context,n),this._mouseDownOperation=this._register(new A$e(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,(s,a)=>this._createMouseTarget(s,a),s=>this._getMouseColumn(s))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(144).height;const r=new o$e(this.viewHelper.viewDomNode);this._register(r.onContextMenu(this.viewHelper.viewDomNode,s=>this._onContextMenu(s,!0))),this._register(r.onMouseMove(this.viewHelper.viewDomNode,s=>{this._onMouseMove(s),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=ye(this.viewHelper.viewDomNode.ownerDocument,"mousemove",a=>{this.viewHelper.viewDomNode.contains(a.target)||this._onMouseLeave(new Yv(a,!1,this.viewHelper.viewDomNode))}))})),this._register(r.onMouseUp(this.viewHelper.viewDomNode,s=>this._onMouseUp(s))),this._register(r.onMouseLeave(this.viewHelper.viewDomNode,s=>this._onMouseLeave(s)));let o=0;this._register(r.onPointerDown(this.viewHelper.viewDomNode,(s,a)=>{o=a})),this._register(ye(this.viewHelper.viewDomNode,Ge.POINTER_UP,s=>{this._mouseDownOperation.onPointerUp()})),this._register(r.onMouseDown(this.viewHelper.viewDomNode,s=>this._onMouseDown(s,o))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=aP.INSTANCE;let t=0,n=zc.getZoomLevel(),r=!1,o=0;const s=l=>{if(this.viewController.emitMouseWheel(l),!this._context.configuration.options.get(76))return;const c=new kb(l);if(e.acceptStandardWheelEvent(c),e.isPhysicalMouseWheel()){if(a(l)){const u=zc.getZoomLevel(),d=c.deltaY>0?1:-1;zc.setZoomLevel(u+d),c.preventDefault(),c.stopPropagation()}}else Date.now()-t>50&&(n=zc.getZoomLevel(),r=a(l),o=0),t=Date.now(),o+=c.deltaY,r&&(zc.setZoomLevel(n+o/5),c.preventDefault(),c.stopPropagation())};this._register(ye(this.viewHelper.viewDomNode,Ge.MOUSE_WHEEL,s,{capture:!0,passive:!1}));function a(l){return Ln?(l.metaKey||l.ctrlKey)&&!l.shiftKey&&!l.altKey:l.ctrlKey&&!l.metaKey&&!l.shiftKey&&!l.altKey}}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(144)){const t=this._context.configuration.options.get(144).height;this._height!==t&&(this._height=t,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}getTargetAtClientPoint(e,t){const r=new uve(e,t).toPageCoordinates(Pt(this.viewHelper.viewDomNode)),o=Jq(this.viewHelper.viewDomNode);if(r.yo.y+o.height||r.xo.x+o.width)return null;const s=eX(this.viewHelper.viewDomNode,o,r);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),o,r,s,null)}_createMouseTarget(e,t){let n=e.target;if(!this.viewHelper.viewDomNode.contains(n)){const r=Tb(this.viewHelper.viewDomNode);r&&(n=r.elementsFromPoint(e.posx,e.posy).find(o=>this.viewHelper.viewDomNode.contains(o)))}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?n:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),!(this._mouseDownOperation.isActive()||e.timestamp{e.preventDefault(),this.viewHelper.focusTextArea()};if(u&&(r||s&&a))d(),this._mouseDownOperation.start(n.type,e,t);else if(o)e.preventDefault();else if(l){const h=n.detail;u&&this.viewHelper.shouldSuppressMouseDownOnViewZone(h.viewZoneId)&&(d(),this._mouseDownOperation.start(n.type,e,t),e.preventDefault())}else c&&this.viewHelper.shouldSuppressMouseDownOnWidget(n.detail)&&(d(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:n})}}class A$e extends fe{constructor(e,t,n,r,o,s){super(),this._context=e,this._viewController=t,this._viewHelper=n,this._mouseTargetFactory=r,this._createMouseTarget=o,this._getMouseColumn=s,this._mouseMoveMonitor=this._register(new a$e(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new P$e(this._context,this._viewHelper,this._mouseTargetFactory,(a,l,c)=>this._dispatchMouse(a,l,c))),this._mouseState=new F4,this._currentSelection=new yt(1,1,1,1),this._isActive=!1,this._lastMouseEvent=null}dispose(){super.dispose()}isActive(){return this._isActive}_onMouseDownThenMove(e){this._lastMouseEvent=e,this._mouseState.setModifiers(e);const t=this._findMousePosition(e,!1);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):t.type===13&&(t.outsidePosition==="above"||t.outsidePosition==="below")?this._topBottomDragScrolling.start(t,e):(this._topBottomDragScrolling.stop(),this._dispatchMouse(t,!0,1)))}start(e,t,n){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(e===3),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const r=this._findMousePosition(t,!0);if(!r||!r.position)return;this._mouseState.trySetCount(t.detail,r.position),t.detail=this._mouseState.count;const o=this._context.configuration.options;if(!o.get(91)&&o.get(35)&&!o.get(22)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&r.type===6&&r.position&&this._currentSelection.containsPosition(r.position)){this._mouseState.isDragAndDrop=!0,this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,n,t.buttons,s=>this._onMouseDownThenMove(s),s=>{const a=this._findMousePosition(this._lastMouseEvent,!1);kq(s)?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:a?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()});return}this._mouseState.isDragAndDrop=!1,this._dispatchMouse(r,t.shiftKey,1),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,n,t.buttons,s=>this._onMouseDownThenMove(s),()=>this._stop()))}_stop(){this._isActive=!1,this._topBottomDragScrolling.stop()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onPointerUp(){this._mouseMoveMonitor.stopMonitoring()}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const t=e.editorPos,n=this._context.viewModel,r=this._context.viewLayout,o=this._getMouseColumn(e);if(e.posyt.y+t.height){const a=e.posy-t.y-t.height,l=r.getCurrentScrollTop()+e.relativePos.y,c=Ow.getZoneAtCoord(this._context,l);if(c){const d=this._helpPositionJumpOverViewZone(c);if(d)return js.createOutsideEditor(o,d,"below",a)}const u=r.getLineNumberAtVerticalOffset(l);return js.createOutsideEditor(o,new ae(u,n.getLineMaxColumn(u)),"below",a)}const s=r.getLineNumberAtVerticalOffset(r.getCurrentScrollTop()+e.relativePos.y);if(e.posxt.x+t.width){const a=e.posx-t.x-t.width;return js.createOutsideEditor(o,new ae(s,n.getLineMaxColumn(s)),"right",a)}return null}_findMousePosition(e,t){const n=this._getPositionOutsideEditor(e);if(n)return n;const r=this._createMouseTarget(e,t);if(!r.position)return null;if(r.type===8||r.type===5){const s=this._helpPositionJumpOverViewZone(r.detail);if(s)return js.createViewZone(r.type,r.element,r.mouseColumn,s,r.detail)}return r}_helpPositionJumpOverViewZone(e){const t=new ae(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),n=e.positionBefore,r=e.positionAfter;return n&&r?n.isBefore(t)?n:r:null}_dispatchMouse(e,t,n){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:n,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton,onInjectedText:e.type===6&&e.detail.injectedText!==null})}}class P$e extends fe{constructor(e,t,n,r){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=n,this._dispatchMouse=r,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=new O$e(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class O$e extends fe{constructor(e,t,n,r,o,s){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=n,this._dispatchMouse=r,this._position=o,this._mouseEvent=s,this._lastTime=Date.now(),this._animationFrameDisposable=Il(Pt(s.browserEvent),()=>this._execute())}dispose(){this._animationFrameDisposable.dispose(),super.dispose()}setPosition(e,t){this._position=e,this._mouseEvent=t}_tick(){const e=Date.now(),t=e-this._lastTime;return this._lastTime=e,t}_getScrollSpeed(){const e=this._context.configuration.options.get(67),t=this._context.configuration.options.get(144).height/e,n=this._position.outsideDistance/e;return n<=1.5?Math.max(30,t*(1+n)):n<=3?Math.max(60,t*(2+n)):Math.max(200,t*(7+n))}_execute(){const e=this._context.configuration.options.get(67),t=this._getScrollSpeed(),n=this._tick(),r=t*(n/1e3)*e,o=this._position.outsidePosition==="above"?-r:r;this._context.viewModel.viewLayout.deltaScrollNow(0,o),this._viewHelper.renderNow();const s=this._context.viewLayout.getLinesViewportData(),a=this._position.outsidePosition==="above"?s.startLineNumber:s.endLineNumber;let l;{const c=Jq(this._viewHelper.viewDomNode),u=this._context.configuration.options.get(144).horizontalScrollbarHeight,d=new A4(this._mouseEvent.pos.x,c.y+c.height-u-.1),h=eX(this._viewHelper.viewDomNode,c,d);l=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),c,d,h,null)}(!l.position||l.position.lineNumber!==a)&&(this._position.outsidePosition==="above"?l=js.createOutsideEditor(this._position.mouseColumn,new ae(a,1),"above",this._position.outsideDistance):l=js.createOutsideEditor(this._position.mouseColumn,new ae(a,this._context.viewModel.getLineMaxColumn(a)),"below",this._position.outsideDistance)),this._dispatchMouse(l,!0,2),this._animationFrameDisposable=Il(Pt(l.element),()=>this._execute())}}class F4{get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get metaKey(){return this._metaKey}get shiftKey(){return this._shiftKey}get leftButton(){return this._leftButton}get middleButton(){return this._middleButton}get startedOnLineNumbers(){return this._startedOnLineNumbers}constructor(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e}trySetCount(e,t){const n=new Date().getTime();n-this._lastSetMouseDownCountTime>F4.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=n,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)}}F4.CLEAR_MOUSE_DOWN_COUNT_TIME=400;class wn{get event(){return this.emitter.event}constructor(e,t,n){const r=o=>this.emitter.fire(o);this.emitter=new se({onWillAddFirstListener:()=>e.addEventListener(t,r,n),onDidRemoveLastListener:()=>e.removeEventListener(t,r,n)})}dispose(){this.emitter.dispose()}}class Xo{constructor(e,t,n,r,o){this.value=e,this.selectionStart=t,this.selectionEnd=n,this.selection=r,this.newlineCountBeforeSelection=o}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const n=e.getValue(),r=e.getSelectionStart(),o=e.getSelectionEnd();let s;if(t){const a=n.substring(0,r),l=t.value.substring(0,t.selectionStart);a===l&&(s=t.newlineCountBeforeSelection)}return new Xo(n,r,o,null,s)}collapseSelection(){return this.selectionStart===this.value.length?this:new Xo(this.value,this.value.length,this.value.length,null,void 0)}writeToTextArea(e,t,n){t.setValue(e,this.value),n&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){var t,n,r,o,s,a,l,c;if(e<=this.selectionStart){const h=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition((n=(t=this.selection)===null||t===void 0?void 0:t.getStartPosition())!==null&&n!==void 0?n:null,h,-1)}if(e>=this.selectionEnd){const h=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition((o=(r=this.selection)===null||r===void 0?void 0:r.getEndPosition())!==null&&o!==void 0?o:null,h,1)}const u=this.value.substring(this.selectionStart,e);if(u.indexOf(String.fromCharCode(8230))===-1)return this._finishDeduceEditorPosition((a=(s=this.selection)===null||s===void 0?void 0:s.getStartPosition())!==null&&a!==void 0?a:null,u,1);const d=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition((c=(l=this.selection)===null||l===void 0?void 0:l.getEndPosition())!==null&&c!==void 0?c:null,d,-1)}_finishDeduceEditorPosition(e,t,n){let r=0,o=-1;for(;(o=t.indexOf(` -`,o+1))!==-1;)r++;return[e,n*t.length,r]}static deduceInput(e,t,n){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const r=Math.min(zv(e.value,t.value),e.selectionStart,t.selectionStart),o=Math.min(VA(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(r,e.value.length-o);const s=t.value.substring(r,t.value.length-o),a=e.selectionStart-r,l=e.selectionEnd-r,c=t.selectionStart-r,u=t.selectionEnd-r;if(c===u){const h=e.selectionStart-r;return{text:s,replacePrevCharCnt:h,replaceNextCharCnt:0,positionDelta:0}}const d=l-a;return{text:s,replacePrevCharCnt:d,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 n=Math.min(zv(e.value,t.value),e.selectionEnd),r=Math.min(VA(e.value,t.value),e.value.length-e.selectionEnd),o=e.value.substring(n,e.value.length-r),s=t.value.substring(n,t.value.length-r);e.selectionStart-n;const a=e.selectionEnd-n;t.selectionStart-n;const l=t.selectionEnd-n;return{text:s,replacePrevCharCnt:a,replaceNextCharCnt:o.length-a,positionDelta:l-s.length}}}Xo.EMPTY=new Xo("",0,0,null,void 0);class dy{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const n=e*t,r=n+1,o=n+t;return new B(r,1,o+1,1)}static fromEditorSelection(e,t,n,r){const s=dy._getPageOfLine(t.startLineNumber,n),a=dy._getRangeForPage(s,n),l=dy._getPageOfLine(t.endLineNumber,n),c=dy._getRangeForPage(l,n);let u=a.intersectRanges(new B(1,1,t.startLineNumber,t.startColumn));if(r&&e.getValueLengthInRange(u,1)>500){const m=e.modifyPosition(u.getEndPosition(),-500);u=B.fromPositions(m,u.getEndPosition())}const d=e.getValueInRange(u,1),h=e.getLineCount(),f=e.getLineMaxColumn(h);let g=c.intersectRanges(new B(t.endLineNumber,t.endColumn,h,f));if(r&&e.getValueLengthInRange(g,1)>500){const m=e.modifyPosition(g.getStartPosition(),500);g=B.fromPositions(g.getStartPosition(),m)}const p=e.getValueInRange(g,1);let v;if(s===l||s+1===l)v=e.getValueInRange(t,1);else{const m=a.intersectRanges(t),_=c.intersectRanges(t);v=e.getValueInRange(m,1)+String.fromCharCode(8230)+e.getValueInRange(_,1)}return r&&v.length>2*500&&(v=v.substring(0,500)+String.fromCharCode(8230)+v.substring(v.length-500,v.length)),new Xo(d+v+p,d.length,d.length+v.length,t,u.endLineNumber-u.startLineNumber)}}var F$e=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},bre=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},lP;(function(i){i.Tap="-monaco-textarea-synthetic-tap"})(lP||(lP={}));const NH={forceCopyWithSyntaxHighlighting:!1};class jD{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)}}jD.INSTANCE=new jD;class B$e{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){e=e||"";const t={text:e,replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}}let RH=class extends fe{get textAreaState(){return this._textAreaState}constructor(e,t,n,r,o,s){super(),this._host=e,this._textArea=t,this._OS=n,this._browser=r,this._accessibilityService=o,this._logService=s,this._onFocus=this._register(new se),this.onFocus=this._onFocus.event,this._onBlur=this._register(new se),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new se),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new se),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new se),this.onCut=this._onCut.event,this._onPaste=this._register(new se),this.onPaste=this._onPaste.event,this._onType=this._register(new se),this.onType=this._onType.event,this._onCompositionStart=this._register(new se),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new se),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new se),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new se),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncFocusGainWriteScreenReaderContent=this._register(new Ho),this._asyncTriggerCut=this._register(new pi(()=>this._onCut.fire(),0)),this._textAreaState=Xo.EMPTY,this._selectionChangeListener=null,this._accessibilityService.isScreenReaderOptimized()&&this.writeNativeTextAreaContent("ctor"),this._register(Je.runAndSubscribe(this._accessibilityService.onDidChangeScreenReaderOptimized,()=>{this._accessibilityService.isScreenReaderOptimized()&&!this._asyncFocusGainWriteScreenReaderContent.value?this._asyncFocusGainWriteScreenReaderContent.value=this._register(new pi(()=>this.writeNativeTextAreaContent("asyncFocusGain"),0)):this._asyncFocusGainWriteScreenReaderContent.clear()})),this._hasFocus=!1,this._currentComposition=null;let a=null;this._register(this._textArea.onKeyDown(l=>{const c=new Ai(l);(c.keyCode===114||this._currentComposition&&c.keyCode===1)&&c.stopPropagation(),c.equals(9)&&c.preventDefault(),a=c,this._onKeyDown.fire(c)})),this._register(this._textArea.onKeyUp(l=>{const c=new Ai(l);this._onKeyUp.fire(c)})),this._register(this._textArea.onCompositionStart(l=>{const c=new B$e;if(this._currentComposition){this._currentComposition=c;return}if(this._currentComposition=c,this._OS===2&&a&&a.equals(114)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===l.data&&(a.code==="ArrowRight"||a.code==="ArrowLeft")){c.handleCompositionUpdate("x"),this._onCompositionStart.fire({data:l.data});return}if(this._browser.isAndroid){this._onCompositionStart.fire({data:l.data});return}this._onCompositionStart.fire({data:l.data})})),this._register(this._textArea.onCompositionUpdate(l=>{const c=this._currentComposition;if(!c)return;if(this._browser.isAndroid){const d=Xo.readFromTextArea(this._textArea,this._textAreaState),h=Xo.deduceAndroidCompositionInput(this._textAreaState,d);this._textAreaState=d,this._onType.fire(h),this._onCompositionUpdate.fire(l);return}const u=c.handleCompositionUpdate(l.data);this._textAreaState=Xo.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(u),this._onCompositionUpdate.fire(l)})),this._register(this._textArea.onCompositionEnd(l=>{const c=this._currentComposition;if(!c)return;if(this._currentComposition=null,this._browser.isAndroid){const d=Xo.readFromTextArea(this._textArea,this._textAreaState),h=Xo.deduceAndroidCompositionInput(this._textAreaState,d);this._textAreaState=d,this._onType.fire(h),this._onCompositionEnd.fire();return}const u=c.handleCompositionUpdate(l.data);this._textAreaState=Xo.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(u),this._onCompositionEnd.fire()})),this._register(this._textArea.onInput(l=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;const c=Xo.readFromTextArea(this._textArea,this._textAreaState),u=Xo.deduceInput(this._textAreaState,c,this._OS===2);u.replacePrevCharCnt===0&&u.text.length===1&&(xo(u.text.charCodeAt(0))||u.text.charCodeAt(0)===127)||(this._textAreaState=c,(u.text!==""||u.replacePrevCharCnt!==0||u.replaceNextCharCnt!==0||u.positionDelta!==0)&&this._onType.fire(u))})),this._register(this._textArea.onCut(l=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(l),this._asyncTriggerCut.schedule()})),this._register(this._textArea.onCopy(l=>{this._ensureClipboardGetsEditorSelection(l)})),this._register(this._textArea.onPaste(l=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),l.preventDefault(),!l.clipboardData)return;let[c,u]=MH.getTextData(l.clipboardData);c&&(u=u||jD.INSTANCE.get(c),this._onPaste.fire({text:c,metadata:u}))})),this._register(this._textArea.onFocus(()=>{const l=this._hasFocus;this._setHasFocus(!0),this._accessibilityService.isScreenReaderOptimized()&&this._browser.isSafari&&!l&&this._hasFocus&&(this._asyncFocusGainWriteScreenReaderContent.value||(this._asyncFocusGainWriteScreenReaderContent.value=new pi(()=>this.writeNativeTextAreaContent("asyncFocusGain"),0)),this._asyncFocusGainWriteScreenReaderContent.value.schedule())})),this._register(this._textArea.onBlur(()=>{this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)})),this._register(this._textArea.onSyntheticTap(()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())}))}_installSelectionChangeListener(){let e=0;return ye(this._textArea.ownerDocument,"selectionchange",t=>{if(jm.onSelectionChange(),!this._hasFocus||this._currentComposition||!this._browser.isChrome)return;const n=Date.now(),r=n-e;if(e=n,r<5)return;const o=n-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),o<100||!this._textAreaState.selection)return;const s=this._textArea.getValue();if(this._textAreaState.value!==s)return;const a=this._textArea.getSelectionStart(),l=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===a&&this._textAreaState.selectionEnd===l)return;const c=this._textAreaState.deduceEditorPosition(a),u=this._host.deduceModelPosition(c[0],c[1],c[2]),d=this._textAreaState.deduceEditorPosition(l),h=this._host.deduceModelPosition(d[0],d[1],d[2]),f=new yt(u.lineNumber,u.column,h.lineNumber,h.column);this._onSelectionChangeRequest.fire(f)})}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){this._setHasFocus(this._textArea.hasFocus())}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&this.writeNativeTextAreaContent("focusgain"),this._hasFocus?this._onFocus.fire():this._onBlur.fire())}_setAndWriteTextAreaState(e,t){this._hasFocus||(t=t.collapseSelection()),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t}writeNativeTextAreaContent(e){!this._accessibilityService.isScreenReaderOptimized()&&e==="render"||this._currentComposition||(this._logService.trace(`writeTextAreaState(reason: ${e})`),this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent()))}_ensureClipboardGetsEditorSelection(e){const t=this._host.getDataToCopy(),n={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};jD.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,` +}`,n}dispose(){this._styleElementDisposables.dispose(),this._styleElement=void 0}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function c$e(i){return i.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}class $k extends fe{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 n=0,r=e.length;n=a.left?r.width=Math.max(r.width,a.left+a.width-r.left):(t[n++]=r,r=a)}return t[n++]=r,t}static _createHorizontalRangesFromClientRects(e,t,n){if(!e||e.length===0)return null;const r=[];for(let o=0,s=e.length;ol)return null;if(t=Math.min(l,Math.max(0,t)),r=Math.min(l,Math.max(0,r)),t===r&&n===o&&n===0&&!e.children[t].firstChild){const h=e.children[t].getClientRects();return s.markDidDomLayout(),this._createHorizontalRangesFromClientRects(h,s.clientRectDeltaLeft,s.clientRectScale)}t!==r&&r>0&&o===0&&(r--,o=1073741824);let c=e.children[t].firstChild,u=e.children[r].firstChild;if((!c||!u)&&(!c&&n===0&&t>0&&(c=e.children[t-1].firstChild,n=1073741824),!u&&o===0&&r>0&&(u=e.children[r-1].firstChild,o=1073741824)),!c||!u)return null;n=Math.min(c.textContent.length,Math.max(0,n)),o=Math.min(u.textContent.length,Math.max(0,o));const d=this._readClientRects(c,n,u,o,s.endNode);return s.markDidDomLayout(),this._createHorizontalRangesFromClientRects(d,s.clientRectDeltaLeft,s.clientRectScale)}}var Xc;(function(i){i.DARK="dark",i.LIGHT="light",i.HIGH_CONTRAST_DARK="hcDark",i.HIGH_CONTRAST_LIGHT="hcLight"})(Xc||(Xc={}));function ih(i){return i===Xc.HIGH_CONTRAST_DARK||i===Xc.HIGH_CONTRAST_LIGHT}function Pw(i){return i===Xc.DARK||i===Xc.HIGH_CONTRAST_DARK}const g$e=function(){return Jd?!0:!(Da||ru||Ip)}();let Wy=!0;class pre{constructor(e,t){this.themeType=t;const n=e.options,r=n.get(50);n.get(38)==="off"?this.renderWhitespace=n.get(99):this.renderWhitespace="none",this.renderControlCharacters=n.get(94),this.spaceWidth=r.spaceWidth,this.middotWidth=r.middotWidth,this.wsmiddotWidth=r.wsmiddotWidth,this.useMonospaceOptimizations=r.isMonospace&&!n.get(33),this.canUseHalfwidthRightwardsArrow=r.canUseHalfwidthRightwardsArrow,this.lineHeight=n.get(67),this.stopRenderingLineAfter=n.get(117),this.fontLigatures=n.get(51)}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures}}class hf{constructor(e){this._options=e,this._isMaybeInvalid=!0,this._renderedViewLine=null}getDomNode(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null}setDomNode(e){if(this._renderedViewLine)this._renderedViewLine.domNode=Qn(e);else throw new Error("I have no rendered view line to set the dom node to...")}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return ih(this._options.themeType)||this._options.renderWhitespace==="selection"?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,t,n,r){if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;const o=n.getViewLineRenderingData(e),s=this._options,a=Ca.filter(o.inlineDecorations,e,o.minColumn,o.maxColumn);let l=null;if(ih(s.themeType)||this._options.renderWhitespace==="selection"){const h=n.selections;for(const f of h){if(f.endLineNumbere)continue;const g=f.startLineNumber===e?f.startColumn:o.minColumn,p=f.endLineNumber===e?f.endColumn:o.maxColumn;g');const u=Fk(c,r);r.appendString("");let d=null;return Wy&&g$e&&o.isBasicASCII&&s.useMonospaceOptimizations&&u.containsForeignElements===0&&(d=new uR(this._renderedViewLine?this._renderedViewLine.domNode:null,c,u.characterMapping)),d||(d=hve(this._renderedViewLine?this._renderedViewLine.domNode:null,c,u.characterMapping,u.containsRTL,u.containsForeignElements)),this._renderedViewLine=d,!0}layoutLine(e,t){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(this._options.lineHeight))}getWidth(e){return this._renderedViewLine?this._renderedViewLine.getWidth(e):0}getWidthIsFast(){return this._renderedViewLine?this._renderedViewLine.getWidthIsFast():!0}needsMonospaceFontCheck(){return this._renderedViewLine?this._renderedViewLine instanceof uR:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof uR?this._renderedViewLine.monospaceAssumptionsAreValid():Wy}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof uR&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,n,r){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),n=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,n));const o=this._renderedViewLine.input.stopRenderingLineAfter;if(o!==-1&&t>o+1&&n>o+1)return new gre(!0,[new ib(this.getWidth(r),0)]);o!==-1&&t>o+1&&(t=o+1),o!==-1&&n>o+1&&(n=o+1);const s=this._renderedViewLine.getVisibleRangesForRange(e,t,n,r);return s&&s.length>0?new gre(!1,s):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}}hf.CLASS_NAME="view-line";class uR{constructor(e,t,n){this._cachedWidth=-1,this.domNode=e,this.input=t;const r=Math.floor(t.lineContent.length/300);if(r>0){this._keyColumnPixelOffsetCache=new Float32Array(r);for(let o=0;o=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),Wy=!1)}return Wy}toSlowRenderedLine(){return hve(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,n,r){const o=this._getColumnPixelOffset(e,t,r),s=this._getColumnPixelOffset(e,n,r);return[new ib(o,s-o)]}_getColumnPixelOffset(e,t,n){if(t<=300){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const r=Math.floor((t-1)/300)-1,o=(r+1)*300+1;let s=-1;if(this._keyColumnPixelOffsetCache&&(s=this._keyColumnPixelOffsetCache[r],s===-1&&(s=this._actualReadPixelOffset(e,o,n),this._keyColumnPixelOffsetCache[r]=s)),s===-1){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const a=this._characterMapping.getHorizontalOffset(o),l=this._characterMapping.getHorizontalOffset(t);return s+this._charWidth*(l-a)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,n){if(!this.domNode)return-1;const r=this._characterMapping.getDomPosition(t),o=_M.readHorizontalRanges(this._getReadingTarget(this.domNode),r.partIndex,r.charIndex,r.partIndex,r.charIndex,n);return!o||o.length===0?-1:o[0].left}getColumnOfNodeOffset(e,t){return tX(this._characterMapping,e,t)}}class dve{constructor(e,t,n,r,o){if(this.domNode=e,this.input=t,this._characterMapping=n,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=o,this._cachedWidth=-1,this._pixelOffsetCache=null,!r||this._characterMapping.length===0){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let s=0,a=this._characterMapping.length;s<=a;s++)this._pixelOffsetCache[s]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(e){return this.domNode?(this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e==null||e.markDidDomLayout()),this._cachedWidth):0}getWidthIsFast(){return this._cachedWidth!==-1}getVisibleRangesForRange(e,t,n,r){if(!this.domNode)return null;if(this._pixelOffsetCache!==null){const o=this._readPixelOffset(this.domNode,e,t,r);if(o===-1)return null;const s=this._readPixelOffset(this.domNode,e,n,r);return s===-1?null:[new ib(o,s-o)]}return this._readVisibleRangesForRange(this.domNode,e,t,n,r)}_readVisibleRangesForRange(e,t,n,r,o){if(n===r){const s=this._readPixelOffset(e,t,n,o);return s===-1?null:[new ib(s,0)]}else return this._readRawVisibleRangesForRange(e,n,r,o)}_readPixelOffset(e,t,n,r){if(this._characterMapping.length===0){if(this._containsForeignElements===0||this._containsForeignElements===2)return 0;if(this._containsForeignElements===1)return this.getWidth(r);const o=this._getReadingTarget(e);return o.firstChild?(r.markDidDomLayout(),o.firstChild.offsetWidth):0}if(this._pixelOffsetCache!==null){const o=this._pixelOffsetCache[n];if(o!==-1)return o;const s=this._actualReadPixelOffset(e,t,n,r);return this._pixelOffsetCache[n]=s,s}return this._actualReadPixelOffset(e,t,n,r)}_actualReadPixelOffset(e,t,n,r){if(this._characterMapping.length===0){const l=_M.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,r);return!l||l.length===0?-1:l[0].left}if(n===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===0)return this.getWidth(r);const o=this._characterMapping.getDomPosition(n),s=_M.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,o.partIndex,o.charIndex,r);if(!s||s.length===0)return-1;const a=s[0].left;if(this.input.isBasicASCII){const l=this._characterMapping.getHorizontalOffset(n),c=Math.round(this.input.spaceWidth*l);if(Math.abs(c-a)<=1)return c}return a}_readRawVisibleRangesForRange(e,t,n,r){if(t===1&&n===this._characterMapping.length)return[new ib(0,this.getWidth(r))];const o=this._characterMapping.getDomPosition(t),s=this._characterMapping.getDomPosition(n);return _M.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,s.partIndex,s.charIndex,r)}getColumnOfNodeOffset(e,t){return tX(this._characterMapping,e,t)}}class p$e extends dve{_readVisibleRangesForRange(e,t,n,r,o){const s=super._readVisibleRangesForRange(e,t,n,r,o);if(!s||s.length===0||n===r||n===1&&r===this._characterMapping.length)return s;if(!this.input.containsRTL){const a=this._readPixelOffset(e,t,r,o);if(a!==-1){const l=s[s.length-1];l.left=t){const d=t-s;return c-t=4&&e[0]===3&&e[3]===8}static isStrictChildOfViewLines(e){return e.length>4&&e[0]===3&&e[3]===8}static isChildOfScrollableElement(e){return e.length>=2&&e[0]===3&&e[1]===6}static isChildOfMinimap(e){return e.length>=2&&e[0]===3&&e[1]===9}static isChildOfContentWidgets(e){return e.length>=4&&e[0]===3&&e[3]===1}static isChildOfOverflowGuard(e){return e.length>=1&&e[0]===3}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&e[0]===2}static isChildOfOverlayWidgets(e){return e.length>=2&&e[0]===3&&e[1]===4}static isChildOfOverflowingOverlayWidgets(e){return e.length>=1&&e[0]===5}}class Ow{constructor(e,t,n){this.viewModel=e.viewModel;const r=e.configuration.options;this.layoutInfo=r.get(144),this.viewDomNode=t.viewDomNode,this.lineHeight=r.get(67),this.stickyTabStops=r.get(116),this.typicalHalfwidthCharacterWidth=r.get(50).typicalHalfwidthCharacterWidth,this.lastRenderData=n,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return Ow.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const n=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(n){const r=n.verticalOffset+n.height/2,o=e.viewModel.getLineCount();let s=null,a,l=null;return n.afterLineNumber!==o&&(l=new ae(n.afterLineNumber+1,1)),n.afterLineNumber>0&&(s=new ae(n.afterLineNumber,e.viewModel.getLineMaxColumn(n.afterLineNumber))),l===null?a=s:s===null?a=l:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,rs._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class nX extends b$e{constructor(e,t,n,r,o){super(e,t,n,r),this._ctx=e,o?(this.target=o,this.targetPath=fh.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} + target: ${this.target?this.target.outerHTML:null}`}_getMouseColumn(e=null){return e&&e.columns.contentLeft+s.width)continue;const a=e.getVerticalOffsetForLineNumber(s.position.lineNumber);if(a<=o&&o<=a+s.height)return t.fulfillContentText(s.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const n=e.getZoneAtCoord(t.mouseVerticalOffset);if(n){const r=t.isInContentArea?8:5;return t.fulfillViewZone(r,n.position,n)}return null}static _hitTestTextArea(e,t){return ra.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 n=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),r=n.range.getStartPosition();let o=Math.abs(t.relativePos.x);const s={isAfterLines:n.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:o};if(o-=e.layoutInfo.glyphMarginLeft,o<=e.layoutInfo.glyphMarginWidth){const a=e.viewModel.coordinatesConverter.convertViewPositionToModelPosition(n.range.getStartPosition()),l=e.viewModel.glyphLanes.getLanesAtLine(a.lineNumber);return s.glyphMarginLane=l[Math.floor(o/e.lineHeight)],t.fulfillMargin(2,r,n.range,s)}return o-=e.layoutInfo.glyphMarginWidth,o<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,r,n.range,s):(o-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,r,n.range,s))}return null}static _hitTestViewLines(e,t,n){if(!ra.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new ae(1,1),mre);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const o=e.viewModel.getLineCount(),s=e.viewModel.getLineMaxColumn(o);return t.fulfillContentEmpty(new ae(o,s),mre)}if(n){if(ra.isStrictChildOfViewLines(t.targetPath)){const o=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.viewModel.getLineLength(o)===0){const a=e.getLineWidth(o),l=E6(t.mouseContentHorizontalOffset-a);return t.fulfillContentEmpty(new ae(o,1),l)}const s=e.getLineWidth(o);if(t.mouseContentHorizontalOffset>=s){const a=E6(t.mouseContentHorizontalOffset-s),l=new ae(o,e.viewModel.getLineMaxColumn(o));return t.fulfillContentEmpty(l,a)}}return t.fulfillUnknown()}const r=rs._doHitTest(e,t);return r.type===1?rs.createMouseTargetFromHitTestPosition(e,t,r.spanNode,r.position,r.injectedText):this._createMouseTarget(e,t.withTarget(r.hitTarget),!0)}static _hitTestMinimap(e,t){if(ra.isChildOfMinimap(t.targetPath)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new ae(n,r))}return null}static _hitTestScrollbarSlider(e,t){if(ra.isChildOfScrollableElement(t.targetPath)&&t.target&&t.target.nodeType===1){const n=t.target.className;if(n&&/\b(slider|scrollbar)\b/.test(n)){const r=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.viewModel.getLineMaxColumn(r);return t.fulfillScrollbar(new ae(r,o))}}return null}static _hitTestScrollbar(e,t){if(ra.isChildOfScrollableElement(t.targetPath)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new ae(n,r))}return null}getMouseColumn(e){const t=this._context.configuration.options,n=t.get(144),r=this._context.viewLayout.getCurrentScrollLeft()+e.x-n.contentLeft;return rs._getMouseColumn(r,t.get(50).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,n,r,o){const s=r.lineNumber,a=r.column,l=e.getLineWidth(s);if(t.mouseContentHorizontalOffset>l){const m=E6(t.mouseContentHorizontalOffset-l);return t.fulfillContentEmpty(r,m)}const c=e.visibleRangeForPosition(s,a);if(!c)return t.fulfillUnknown(r);const u=c.left;if(Math.abs(t.mouseContentHorizontalOffset-u)<1)return t.fulfillContentText(r,null,{mightBeForeignElement:!!o,injectedText:o});const d=[];if(d.push({offset:c.left,column:a}),a>1){const m=e.visibleRangeForPosition(s,a-1);m&&d.push({offset:m.left,column:a-1})}const h=e.viewModel.getLineMaxColumn(s);if(am.offset-_.offset);const f=t.pos.toClientCoordinates(Pt(e.viewDomNode)),g=n.getBoundingClientRect(),p=g.left<=f.clientX&&f.clientX<=g.right;let v=null;for(let m=1;mo)){const a=Math.floor((r+o)/2);let l=t.pos.y+(a-t.mouseVerticalOffset);l<=t.editorPos.y&&(l=t.editorPos.y+1),l>=t.editorPos.y+t.editorPos.height&&(l=t.editorPos.y+t.editorPos.height-1);const c=new A4(t.pos.x,l),u=this._actualDoHitTestWithCaretRangeFromPoint(e,c.toClientCoordinates(Pt(e.viewDomNode)));if(u.type===1)return u}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates(Pt(e.viewDomNode)))}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const n=Tb(e.viewDomNode);let r;if(n?typeof n.caretRangeFromPoint>"u"?r=C$e(n,t.clientX,t.clientY):r=n.caretRangeFromPoint(t.clientX,t.clientY):r=e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY),!r||!r.startContainer)return new _m;const o=r.startContainer;if(o.nodeType===o.TEXT_NODE){const s=o.parentNode,a=s?s.parentNode:null,l=a?a.parentNode:null;return(l&&l.nodeType===l.ELEMENT_NODE?l.className:null)===hf.CLASS_NAME?L0.createFromDOMInfo(e,s,r.startOffset):new _m(o.parentNode)}else if(o.nodeType===o.ELEMENT_NODE){const s=o.parentNode,a=s?s.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===hf.CLASS_NAME?L0.createFromDOMInfo(e,o,o.textContent.length):new _m(o)}return new _m}static _doHitTestWithCaretPositionFromPoint(e,t){const n=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(n.offsetNode.nodeType===n.offsetNode.TEXT_NODE){const r=n.offsetNode.parentNode,o=r?r.parentNode:null,s=o?o.parentNode:null;return(s&&s.nodeType===s.ELEMENT_NODE?s.className:null)===hf.CLASS_NAME?L0.createFromDOMInfo(e,n.offsetNode.parentNode,n.offset):new _m(n.offsetNode.parentNode)}if(n.offsetNode.nodeType===n.offsetNode.ELEMENT_NODE){const r=n.offsetNode.parentNode,o=r&&r.nodeType===r.ELEMENT_NODE?r.className:null,s=r?r.parentNode:null,a=s&&s.nodeType===s.ELEMENT_NODE?s.className:null;if(o===hf.CLASS_NAME){const l=n.offsetNode.childNodes[Math.min(n.offset,n.offsetNode.childNodes.length-1)];if(l)return L0.createFromDOMInfo(e,l,0)}else if(a===hf.CLASS_NAME)return L0.createFromDOMInfo(e,n.offsetNode,0)}return new _m(n.offsetNode)}static _snapToSoftTabBoundary(e,t){const n=t.getLineContent(e.lineNumber),{tabSize:r}=t.model.getOptions(),o=zD.atomicPosition(n,e.column-1,r,2);return o!==-1?new ae(e.lineNumber,o+1):e}static _doHitTest(e,t){let n=new _m;if(typeof e.viewDomNode.ownerDocument.caretRangeFromPoint=="function"?n=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(n=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates(Pt(e.viewDomNode)))),n.type===1){const r=e.viewModel.getInjectedTextAt(n.position),o=e.viewModel.normalizePosition(n.position,2);(r||!o.equals(n.position))&&(n=new fve(o,n.spanNode,r))}return n}}function C$e(i,e,t){const n=document.createRange();let r=i.elementFromPoint(e,t);if(r!==null){for(;r&&r.firstChild&&r.firstChild.nodeType!==r.firstChild.TEXT_NODE&&r.lastChild&&r.lastChild.firstChild;)r=r.lastChild;const o=r.getBoundingClientRect(),s=Pt(r),a=s.getComputedStyle(r,null).getPropertyValue("font-style"),l=s.getComputedStyle(r,null).getPropertyValue("font-variant"),c=s.getComputedStyle(r,null).getPropertyValue("font-weight"),u=s.getComputedStyle(r,null).getPropertyValue("font-size"),d=s.getComputedStyle(r,null).getPropertyValue("line-height"),h=s.getComputedStyle(r,null).getPropertyValue("font-family"),f=`${a} ${l} ${c} ${u}/${d} ${h}`,g=r.innerText;let p=o.left,v=0,m;if(e>o.left+o.width)v=g.length;else{const _=H0.getInstance();for(let y=0;y=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Si;(function(i){i.Tap="-monaco-gesturetap",i.Change="-monaco-gesturechange",i.Start="-monaco-gesturestart",i.End="-monaco-gesturesend",i.Contextmenu="-monaco-gesturecontextmenu"})(Si||(Si={}));class wi extends fe{constructor(){super(),this.dispatched=!1,this.targets=new _a,this.ignoreTargets=new _a,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Je.runAndSubscribe(d4,({window:e,disposables:t})=>{t.add(ye(e.document,"touchstart",n=>this.onTouchStart(n),{passive:!1})),t.add(ye(e.document,"touchend",n=>this.onTouchEnd(e,n))),t.add(ye(e.document,"touchmove",n=>this.onTouchMove(n),{passive:!1}))},{window:hi,disposables:this._store}))}static addTarget(e){if(!wi.isTouchDevice())return fe.None;wi.INSTANCE||(wi.INSTANCE=new wi);const t=wi.INSTANCE.targets.push(e);return Rt(t)}static ignoreTarget(e){if(!wi.isTouchDevice())return fe.None;wi.INSTANCE||(wi.INSTANCE=new wi);const t=wi.INSTANCE.ignoreTargets.push(e);return Rt(t)}static isTouchDevice(){return"ontouchstart"in hi||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){const t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let n=0,r=e.targetTouches.length;n=wi.HOLD_DELAY&&Math.abs(l.initialPageX-Rc(l.rollingPageX))<30&&Math.abs(l.initialPageY-Rc(l.rollingPageY))<30){const u=this.newGestureEvent(Si.Contextmenu,l.initialTarget);u.pageX=Rc(l.rollingPageX),u.pageY=Rc(l.rollingPageY),this.dispatchEvent(u)}else if(r===1){const u=Rc(l.rollingPageX),d=Rc(l.rollingPageY),h=Rc(l.rollingTimestamps)-l.rollingTimestamps[0],f=u-l.rollingPageX[0],g=d-l.rollingPageY[0],p=[...this.targets].filter(v=>l.initialTarget instanceof Node&&v.contains(l.initialTarget));this.inertia(e,p,n,Math.abs(f)/h,f>0?1:-1,u,Math.abs(g)/h,g>0?1:-1,d)}this.dispatchEvent(this.newGestureEvent(Si.End,l.initialTarget)),delete this.activeTouches[a.identifier]}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){const n=document.createEvent("CustomEvent");return n.initEvent(e,!1,!0),n.initialTarget=t,n.tapCount=0,n}dispatchEvent(e){if(e.type===Si.Tap){const t=new Date().getTime();let n=0;t-this._lastSetTapCountTime>wi.CLEAR_TAP_COUNT_TIME?n=1:n=2,this._lastSetTapCountTime=t,e.tapCount=n}else(e.type===Si.Change||e.type===Si.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(const t of this.ignoreTargets)if(t.contains(e.initialTarget))return;for(const t of this.targets)t.contains(e.initialTarget)&&(t.dispatchEvent(e),this.dispatched=!0)}}inertia(e,t,n,r,o,s,a,l,c){this.handle=Il(e,()=>{const u=Date.now(),d=u-n;let h=0,f=0,g=!0;r+=wi.SCROLL_FRICTION*d,a+=wi.SCROLL_FRICTION*d,r>0&&(g=!1,h=o*r*d),a>0&&(g=!1,f=l*a*d);const p=this.newGestureEvent(Si.Change);p.translationX=h,p.translationY=f,t.forEach(v=>v.dispatchEvent(p)),g||this.inertia(e,t,u,r,o,s+h,a,l,c+f)})}onTouchMove(e){const t=Date.now();for(let n=0,r=e.changedTouches.length;n3&&(s.rollingPageX.shift(),s.rollingPageY.shift(),s.rollingTimestamps.shift()),s.rollingPageX.push(o.pageX),s.rollingPageY.push(o.pageY),s.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}wi.SCROLL_FRICTION=-.005;wi.HOLD_DELAY=700;wi.CLEAR_TAP_COUNT_TIME=400;y$e([Rr],wi,"isTouchDevice",null);let yc=class extends fe{onclick(e,t){this._register(ye(e,Ge.CLICK,n=>t(new Uu(Pt(e),n))))}onmousedown(e,t){this._register(ye(e,Ge.MOUSE_DOWN,n=>t(new Uu(Pt(e),n))))}onmouseover(e,t){this._register(ye(e,Ge.MOUSE_OVER,n=>t(new Uu(Pt(e),n))))}onmouseleave(e,t){this._register(ye(e,Ge.MOUSE_LEAVE,n=>t(new Uu(Pt(e),n))))}onkeydown(e,t){this._register(ye(e,Ge.KEY_DOWN,n=>t(new Ai(n))))}onkeyup(e,t){this._register(ye(e,Ge.KEY_UP,n=>t(new Ai(n))))}oninput(e,t){this._register(ye(e,Ge.INPUT,t))}onblur(e,t){this._register(ye(e,Ge.BLUR,t))}onfocus(e,t){this._register(ye(e,Ge.FOCUS,t))}ignoreGesture(e){return wi.ignoreTarget(e)}};const Fw=11;class w$e extends yc{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...Wt.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=Fw+"px",this.domNode.style.height=Fw+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new kS),this._register(Sr(this.bgDomNode,Ge.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Sr(this.domNode,Ge.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new Eq),this._pointerdownScheduleRepeatTimer=this._register(new cd)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Pt(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}}class S$e extends fe{constructor(e,t,n){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new cd)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){const e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;(e=this._domNode)===null||e===void 0||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)===null||t===void 0||t.setClassName(this._invisibleClassName+(e?" fade":"")))}}const x$e=140;class gve extends yc{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 S$e(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new kS),this._shouldRender=!0,this.domNode=Qn(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(ye(this.domNode.domNode,Ge.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){const t=this._register(new w$e(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,r){this.slider=Qn(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof n=="number"&&this.slider.setWidth(n),typeof r=="number"&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(ye(this.slider.domNode,Ge.POINTER_DOWN,o=>{o.button===0&&(o.preventDefault(),this._sliderPointerDown(o))})),this.onclick(this.slider.domNode,o=>{o.leftButton&&o.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){const t=this.domNode.domNode.getClientRects()[0].top,n=t+this._scrollbarState.getSliderPosition(),r=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);n<=o&&o<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,n;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,n=e.offsetY;else{const o=Br(this.domNode.domNode);t=e.pageX-o.left,n=e.pageY-o.top}const r=this._pointerDownRelativePosition(t,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>{const s=this._sliderOrthogonalPointerPosition(o),a=Math.abs(s-n);if(Rs&&a>x$e){this._setDesiredScrollPositionNow(r.getScrollPosition());return}const c=this._sliderPointerPosition(o)-t;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(c))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){const t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}}const L$e=20;class Bw{constructor(e,t,n,r,o,s){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(e),this._visibleSize=r,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 Bw(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){const t=Math.round(e);return this._visibleSize!==t?(this._visibleSize=t,this._refreshComputedValues(),!0):!1}setScrollSize(e){const t=Math.round(e);return this._scrollSize!==t?(this._scrollSize=t,this._refreshComputedValues(),!0):!1}setScrollPosition(e){const t=Math.round(e);return this._scrollPosition!==t?(this._scrollPosition=t,this._refreshComputedValues(),!0):!1}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,n,r,o){const s=Math.max(0,n-e),a=Math.max(0,s-2*t),l=r>0&&r>n;if(!l)return{computedAvailableSize:Math.round(s),computedIsNeeded:l,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};const c=Math.round(Math.max(L$e,Math.floor(n*a/r))),u=(a-c)/(r-n),d=o*u;return{computedAvailableSize:Math.round(s),computedIsNeeded:l,computedSliderSize:Math.round(c),computedSliderRatio:u,computedSliderPosition:Math.round(d)}}_refreshComputedValues(){const e=Bw._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 n=this._scrollPosition;return tthis._host.onMouseWheel(new kb(null,1,0))}),this._createArrow({className:"scra",icon:Xe.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:s,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new kb(null,-1,0))})}this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}class D$e extends gve{constructor(e,t,n){const r=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new Bw(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,r.height,r.scrollHeight,o.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const s=(t.arrowSize-Fw)/2,a=(t.verticalScrollbarSize-Fw)/2;this._createArrow({className:"scra",icon:Xe.scrollbarButtonUp,top:s,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new kb(null,0,1))}),this._createArrow({className:"scra",icon:Xe.scrollbarButtonDown,top:void 0,left:a,bottom:s,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new kb(null,0,-1))})}this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}class sP{constructor(e,t,n,r,o,s,a){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t=t|0,n=n|0,r=r|0,o=o|0,s=s|0,a=a|0),this.rawScrollLeft=r,this.rawScrollTop=a,t<0&&(t=0),r+t>n&&(r=n-t),r<0&&(r=0),o<0&&(o=0),a+o>s&&(a=s-o),a<0&&(a=0),this.width=t,this.scrollWidth=n,this.scrollLeft=r,this.height=o,this.scrollHeight=s,this.scrollTop=a}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,t){return new sP(this._forceIntegerValues,typeof e.width<"u"?e.width:this.width,typeof e.scrollWidth<"u"?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,typeof e.height<"u"?e.height:this.height,typeof e.scrollHeight<"u"?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new sP(this._forceIntegerValues,this.width,this.scrollWidth,typeof e.scrollLeft<"u"?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof e.scrollTop<"u"?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){const n=this.width!==e.width,r=this.scrollWidth!==e.scrollWidth,o=this.scrollLeft!==e.scrollLeft,s=this.height!==e.height,a=this.scrollHeight!==e.scrollHeight,l=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:r,scrollLeftChanged:o,heightChanged:s,scrollHeightChanged:a,scrollTopChanged:l}}}class TS extends fe{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new se),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new sP(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var n;const r=this._state.withScrollDimensions(e,t);this._setState(r,!!this._smoothScrolling),(n=this._smoothScrolling)===null||n===void 0||n.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){const t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};const n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let r;t?r=new UD(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):r=this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=r}else{const n=this._state.withScrollPosition(e);this._smoothScrolling=UD.start(this._state,n,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;const e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){const n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,t)))}}class vre{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}}function D6(i,e){const t=e-i;return function(n){return i+t*T$e(n)}}function I$e(i,e,t){return function(n){return n2.5*n){let o,s;return e0&&Math.abs(e.deltaY)>0)return 1;let t=.5;return this._front===-1&&this._rear===-1||this._memory[this._rear],(!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(t+=.25),Math.min(Math.max(t,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}}aP.INSTANCE=new aP;class iX extends yc{get options(){return this._options}constructor(e,t,n){super(),this._onScroll=this._register(new se),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new se),e.style.overflow="hidden",this._options=M$e(t),this._scrollable=n,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));const r={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new D$e(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new E$e(this._scrollable,this._options,r)),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=Qn(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Qn(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Qn(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,o=>this._onMouseOver(o)),this.onmouseleave(this._listenOnDomNode,o=>this._onMouseLeave(o)),this._hideTimeout=this._register(new cd),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=si(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Ln&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new kb(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=si(this._mouseWheelToDispose),e)){const n=r=>{this._onMouseWheel(new kb(r))};this._mouseWheelToDispose.push(ye(this._listenOnDomNode,Ge.MOUSE_WHEEL,n,{passive:!1}))}}_onMouseWheel(e){var t;if(!((t=e.browserEvent)===null||t===void 0)&&t.defaultPrevented)return;const n=aP.INSTANCE;n.acceptStandardWheelEvent(e);let r=!1;if(e.deltaY||e.deltaX){let s=e.deltaY*this._options.mouseWheelScrollSensitivity,a=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&a+s===0?a=s=0:Math.abs(s)>=Math.abs(a)?a=0:s=0),this._options.flipAxes&&([s,a]=[a,s]);const l=!Ln&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||l)&&!a&&(a=s,s=0),e.browserEvent&&e.browserEvent.altKey&&(a=a*this._options.fastScrollSensitivity,s=s*this._options.fastScrollSensitivity);const c=this._scrollable.getFutureScrollPosition();let u={};if(s){const d=_re*s,h=c.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(u,h)}if(a){const d=_re*a,h=c.scrollLeft-(d<0?Math.floor(d):Math.ceil(d));this._horizontalScrollbar.writeScrollPosition(u,h)}u=this._scrollable.validateScrollPosition(u),(c.scrollLeft!==u.scrollLeft||c.scrollTop!==u.scrollTop)&&(this._options.mouseWheelSmoothScroll&&n.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(u):this._scrollable.setScrollPositionNow(u),r=!0)}let o=r;!o&&this._options.alwaysConsumeMouseWheel&&(o=!0),!o&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(o=!0),o&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,n=e.scrollLeft>0,r=n?" left":"",o=t?" top":"",s=n||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${s}${o}${r}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),N$e)}}class pve extends iX{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const n=new TS({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:r=>Il(Pt(e),r)});super(e,t,n),this._register(n)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class O4 extends iX{constructor(e,t,n){super(e,t,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class Hk extends iX{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const n=new TS({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:r=>Il(Pt(e),r)});super(e,t,n),this._register(n),this._element=e,this._register(this.onScroll(r=>{r.scrollTopChanged&&(this._element.scrollTop=r.scrollTop),r.scrollLeftChanged&&(this._element.scrollLeft=r.scrollLeft)})),this.scanDomNode()}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}}function M$e(i){const e={lazyRender:typeof i.lazyRender<"u"?i.lazyRender:!1,className:typeof i.className<"u"?i.className:"",useShadows:typeof i.useShadows<"u"?i.useShadows:!0,handleMouseWheel:typeof i.handleMouseWheel<"u"?i.handleMouseWheel:!0,flipAxes:typeof i.flipAxes<"u"?i.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof i.consumeMouseWheelIfScrollbarIsNeeded<"u"?i.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof i.alwaysConsumeMouseWheel<"u"?i.alwaysConsumeMouseWheel:!1,scrollYToX:typeof i.scrollYToX<"u"?i.scrollYToX:!1,mouseWheelScrollSensitivity:typeof i.mouseWheelScrollSensitivity<"u"?i.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof i.fastScrollSensitivity<"u"?i.fastScrollSensitivity:5,scrollPredominantAxis:typeof i.scrollPredominantAxis<"u"?i.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof i.mouseWheelSmoothScroll<"u"?i.mouseWheelSmoothScroll:!0,arrowSize:typeof i.arrowSize<"u"?i.arrowSize:11,listenOnDomNode:typeof i.listenOnDomNode<"u"?i.listenOnDomNode:null,horizontal:typeof i.horizontal<"u"?i.horizontal:1,horizontalScrollbarSize:typeof i.horizontalScrollbarSize<"u"?i.horizontalScrollbarSize:10,horizontalSliderSize:typeof i.horizontalSliderSize<"u"?i.horizontalSliderSize:0,horizontalHasArrows:typeof i.horizontalHasArrows<"u"?i.horizontalHasArrows:!1,vertical:typeof i.vertical<"u"?i.vertical:1,verticalScrollbarSize:typeof i.verticalScrollbarSize<"u"?i.verticalScrollbarSize:10,verticalHasArrows:typeof i.verticalHasArrows<"u"?i.verticalHasArrows:!1,verticalSliderSize:typeof i.verticalSliderSize<"u"?i.verticalSliderSize:0,scrollByPage:typeof i.scrollByPage<"u"?i.scrollByPage:!1};return e.horizontalSliderSize=typeof i.horizontalSliderSize<"u"?i.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof i.verticalSliderSize<"u"?i.verticalSliderSize:e.verticalScrollbarSize,Ln&&(e.className+=" mac"),e}class rX extends $k{constructor(e,t,n){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=n,this.mouseTargetFactory=new rs(this._context,n),this._mouseDownOperation=this._register(new A$e(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,(s,a)=>this._createMouseTarget(s,a),s=>this._getMouseColumn(s))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(144).height;const r=new o$e(this.viewHelper.viewDomNode);this._register(r.onContextMenu(this.viewHelper.viewDomNode,s=>this._onContextMenu(s,!0))),this._register(r.onMouseMove(this.viewHelper.viewDomNode,s=>{this._onMouseMove(s),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=ye(this.viewHelper.viewDomNode.ownerDocument,"mousemove",a=>{this.viewHelper.viewDomNode.contains(a.target)||this._onMouseLeave(new Xv(a,!1,this.viewHelper.viewDomNode))}))})),this._register(r.onMouseUp(this.viewHelper.viewDomNode,s=>this._onMouseUp(s))),this._register(r.onMouseLeave(this.viewHelper.viewDomNode,s=>this._onMouseLeave(s)));let o=0;this._register(r.onPointerDown(this.viewHelper.viewDomNode,(s,a)=>{o=a})),this._register(ye(this.viewHelper.viewDomNode,Ge.POINTER_UP,s=>{this._mouseDownOperation.onPointerUp()})),this._register(r.onMouseDown(this.viewHelper.viewDomNode,s=>this._onMouseDown(s,o))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=aP.INSTANCE;let t=0,n=zc.getZoomLevel(),r=!1,o=0;const s=l=>{if(this.viewController.emitMouseWheel(l),!this._context.configuration.options.get(76))return;const c=new kb(l);if(e.acceptStandardWheelEvent(c),e.isPhysicalMouseWheel()){if(a(l)){const u=zc.getZoomLevel(),d=c.deltaY>0?1:-1;zc.setZoomLevel(u+d),c.preventDefault(),c.stopPropagation()}}else Date.now()-t>50&&(n=zc.getZoomLevel(),r=a(l),o=0),t=Date.now(),o+=c.deltaY,r&&(zc.setZoomLevel(n+o/5),c.preventDefault(),c.stopPropagation())};this._register(ye(this.viewHelper.viewDomNode,Ge.MOUSE_WHEEL,s,{capture:!0,passive:!1}));function a(l){return Ln?(l.metaKey||l.ctrlKey)&&!l.shiftKey&&!l.altKey:l.ctrlKey&&!l.metaKey&&!l.shiftKey&&!l.altKey}}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(144)){const t=this._context.configuration.options.get(144).height;this._height!==t&&(this._height=t,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}getTargetAtClientPoint(e,t){const r=new uve(e,t).toPageCoordinates(Pt(this.viewHelper.viewDomNode)),o=Jq(this.viewHelper.viewDomNode);if(r.yo.y+o.height||r.xo.x+o.width)return null;const s=eX(this.viewHelper.viewDomNode,o,r);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),o,r,s,null)}_createMouseTarget(e,t){let n=e.target;if(!this.viewHelper.viewDomNode.contains(n)){const r=Tb(this.viewHelper.viewDomNode);r&&(n=r.elementsFromPoint(e.posx,e.posy).find(o=>this.viewHelper.viewDomNode.contains(o)))}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?n:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),!(this._mouseDownOperation.isActive()||e.timestamp{e.preventDefault(),this.viewHelper.focusTextArea()};if(u&&(r||s&&a))d(),this._mouseDownOperation.start(n.type,e,t);else if(o)e.preventDefault();else if(l){const h=n.detail;u&&this.viewHelper.shouldSuppressMouseDownOnViewZone(h.viewZoneId)&&(d(),this._mouseDownOperation.start(n.type,e,t),e.preventDefault())}else c&&this.viewHelper.shouldSuppressMouseDownOnWidget(n.detail)&&(d(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:n})}}class A$e extends fe{constructor(e,t,n,r,o,s){super(),this._context=e,this._viewController=t,this._viewHelper=n,this._mouseTargetFactory=r,this._createMouseTarget=o,this._getMouseColumn=s,this._mouseMoveMonitor=this._register(new a$e(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new P$e(this._context,this._viewHelper,this._mouseTargetFactory,(a,l,c)=>this._dispatchMouse(a,l,c))),this._mouseState=new F4,this._currentSelection=new yt(1,1,1,1),this._isActive=!1,this._lastMouseEvent=null}dispose(){super.dispose()}isActive(){return this._isActive}_onMouseDownThenMove(e){this._lastMouseEvent=e,this._mouseState.setModifiers(e);const t=this._findMousePosition(e,!1);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):t.type===13&&(t.outsidePosition==="above"||t.outsidePosition==="below")?this._topBottomDragScrolling.start(t,e):(this._topBottomDragScrolling.stop(),this._dispatchMouse(t,!0,1)))}start(e,t,n){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(e===3),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const r=this._findMousePosition(t,!0);if(!r||!r.position)return;this._mouseState.trySetCount(t.detail,r.position),t.detail=this._mouseState.count;const o=this._context.configuration.options;if(!o.get(91)&&o.get(35)&&!o.get(22)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&r.type===6&&r.position&&this._currentSelection.containsPosition(r.position)){this._mouseState.isDragAndDrop=!0,this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,n,t.buttons,s=>this._onMouseDownThenMove(s),s=>{const a=this._findMousePosition(this._lastMouseEvent,!1);kq(s)?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:a?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()});return}this._mouseState.isDragAndDrop=!1,this._dispatchMouse(r,t.shiftKey,1),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,n,t.buttons,s=>this._onMouseDownThenMove(s),()=>this._stop()))}_stop(){this._isActive=!1,this._topBottomDragScrolling.stop()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onPointerUp(){this._mouseMoveMonitor.stopMonitoring()}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const t=e.editorPos,n=this._context.viewModel,r=this._context.viewLayout,o=this._getMouseColumn(e);if(e.posyt.y+t.height){const a=e.posy-t.y-t.height,l=r.getCurrentScrollTop()+e.relativePos.y,c=Ow.getZoneAtCoord(this._context,l);if(c){const d=this._helpPositionJumpOverViewZone(c);if(d)return js.createOutsideEditor(o,d,"below",a)}const u=r.getLineNumberAtVerticalOffset(l);return js.createOutsideEditor(o,new ae(u,n.getLineMaxColumn(u)),"below",a)}const s=r.getLineNumberAtVerticalOffset(r.getCurrentScrollTop()+e.relativePos.y);if(e.posxt.x+t.width){const a=e.posx-t.x-t.width;return js.createOutsideEditor(o,new ae(s,n.getLineMaxColumn(s)),"right",a)}return null}_findMousePosition(e,t){const n=this._getPositionOutsideEditor(e);if(n)return n;const r=this._createMouseTarget(e,t);if(!r.position)return null;if(r.type===8||r.type===5){const s=this._helpPositionJumpOverViewZone(r.detail);if(s)return js.createViewZone(r.type,r.element,r.mouseColumn,s,r.detail)}return r}_helpPositionJumpOverViewZone(e){const t=new ae(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),n=e.positionBefore,r=e.positionAfter;return n&&r?n.isBefore(t)?n:r:null}_dispatchMouse(e,t,n){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:n,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton,onInjectedText:e.type===6&&e.detail.injectedText!==null})}}class P$e extends fe{constructor(e,t,n,r){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=n,this._dispatchMouse=r,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=new O$e(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class O$e extends fe{constructor(e,t,n,r,o,s){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=n,this._dispatchMouse=r,this._position=o,this._mouseEvent=s,this._lastTime=Date.now(),this._animationFrameDisposable=Il(Pt(s.browserEvent),()=>this._execute())}dispose(){this._animationFrameDisposable.dispose(),super.dispose()}setPosition(e,t){this._position=e,this._mouseEvent=t}_tick(){const e=Date.now(),t=e-this._lastTime;return this._lastTime=e,t}_getScrollSpeed(){const e=this._context.configuration.options.get(67),t=this._context.configuration.options.get(144).height/e,n=this._position.outsideDistance/e;return n<=1.5?Math.max(30,t*(1+n)):n<=3?Math.max(60,t*(2+n)):Math.max(200,t*(7+n))}_execute(){const e=this._context.configuration.options.get(67),t=this._getScrollSpeed(),n=this._tick(),r=t*(n/1e3)*e,o=this._position.outsidePosition==="above"?-r:r;this._context.viewModel.viewLayout.deltaScrollNow(0,o),this._viewHelper.renderNow();const s=this._context.viewLayout.getLinesViewportData(),a=this._position.outsidePosition==="above"?s.startLineNumber:s.endLineNumber;let l;{const c=Jq(this._viewHelper.viewDomNode),u=this._context.configuration.options.get(144).horizontalScrollbarHeight,d=new A4(this._mouseEvent.pos.x,c.y+c.height-u-.1),h=eX(this._viewHelper.viewDomNode,c,d);l=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),c,d,h,null)}(!l.position||l.position.lineNumber!==a)&&(this._position.outsidePosition==="above"?l=js.createOutsideEditor(this._position.mouseColumn,new ae(a,1),"above",this._position.outsideDistance):l=js.createOutsideEditor(this._position.mouseColumn,new ae(a,this._context.viewModel.getLineMaxColumn(a)),"below",this._position.outsideDistance)),this._dispatchMouse(l,!0,2),this._animationFrameDisposable=Il(Pt(l.element),()=>this._execute())}}class F4{get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get metaKey(){return this._metaKey}get shiftKey(){return this._shiftKey}get leftButton(){return this._leftButton}get middleButton(){return this._middleButton}get startedOnLineNumbers(){return this._startedOnLineNumbers}constructor(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e}trySetCount(e,t){const n=new Date().getTime();n-this._lastSetMouseDownCountTime>F4.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=n,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)}}F4.CLEAR_MOUSE_DOWN_COUNT_TIME=400;class wn{get event(){return this.emitter.event}constructor(e,t,n){const r=o=>this.emitter.fire(o);this.emitter=new se({onWillAddFirstListener:()=>e.addEventListener(t,r,n),onDidRemoveLastListener:()=>e.removeEventListener(t,r,n)})}dispose(){this.emitter.dispose()}}class Xo{constructor(e,t,n,r,o){this.value=e,this.selectionStart=t,this.selectionEnd=n,this.selection=r,this.newlineCountBeforeSelection=o}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const n=e.getValue(),r=e.getSelectionStart(),o=e.getSelectionEnd();let s;if(t){const a=n.substring(0,r),l=t.value.substring(0,t.selectionStart);a===l&&(s=t.newlineCountBeforeSelection)}return new Xo(n,r,o,null,s)}collapseSelection(){return this.selectionStart===this.value.length?this:new Xo(this.value,this.value.length,this.value.length,null,void 0)}writeToTextArea(e,t,n){t.setValue(e,this.value),n&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){var t,n,r,o,s,a,l,c;if(e<=this.selectionStart){const h=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition((n=(t=this.selection)===null||t===void 0?void 0:t.getStartPosition())!==null&&n!==void 0?n:null,h,-1)}if(e>=this.selectionEnd){const h=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition((o=(r=this.selection)===null||r===void 0?void 0:r.getEndPosition())!==null&&o!==void 0?o:null,h,1)}const u=this.value.substring(this.selectionStart,e);if(u.indexOf(String.fromCharCode(8230))===-1)return this._finishDeduceEditorPosition((a=(s=this.selection)===null||s===void 0?void 0:s.getStartPosition())!==null&&a!==void 0?a:null,u,1);const d=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition((c=(l=this.selection)===null||l===void 0?void 0:l.getEndPosition())!==null&&c!==void 0?c:null,d,-1)}_finishDeduceEditorPosition(e,t,n){let r=0,o=-1;for(;(o=t.indexOf(` +`,o+1))!==-1;)r++;return[e,n*t.length,r]}static deduceInput(e,t,n){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const r=Math.min(Vv(e.value,t.value),e.selectionStart,t.selectionStart),o=Math.min(VA(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(r,e.value.length-o);const s=t.value.substring(r,t.value.length-o),a=e.selectionStart-r,l=e.selectionEnd-r,c=t.selectionStart-r,u=t.selectionEnd-r;if(c===u){const h=e.selectionStart-r;return{text:s,replacePrevCharCnt:h,replaceNextCharCnt:0,positionDelta:0}}const d=l-a;return{text:s,replacePrevCharCnt:d,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 n=Math.min(Vv(e.value,t.value),e.selectionEnd),r=Math.min(VA(e.value,t.value),e.value.length-e.selectionEnd),o=e.value.substring(n,e.value.length-r),s=t.value.substring(n,t.value.length-r);e.selectionStart-n;const a=e.selectionEnd-n;t.selectionStart-n;const l=t.selectionEnd-n;return{text:s,replacePrevCharCnt:a,replaceNextCharCnt:o.length-a,positionDelta:l-s.length}}}Xo.EMPTY=new Xo("",0,0,null,void 0);class dy{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const n=e*t,r=n+1,o=n+t;return new B(r,1,o+1,1)}static fromEditorSelection(e,t,n,r){const s=dy._getPageOfLine(t.startLineNumber,n),a=dy._getRangeForPage(s,n),l=dy._getPageOfLine(t.endLineNumber,n),c=dy._getRangeForPage(l,n);let u=a.intersectRanges(new B(1,1,t.startLineNumber,t.startColumn));if(r&&e.getValueLengthInRange(u,1)>500){const m=e.modifyPosition(u.getEndPosition(),-500);u=B.fromPositions(m,u.getEndPosition())}const d=e.getValueInRange(u,1),h=e.getLineCount(),f=e.getLineMaxColumn(h);let g=c.intersectRanges(new B(t.endLineNumber,t.endColumn,h,f));if(r&&e.getValueLengthInRange(g,1)>500){const m=e.modifyPosition(g.getStartPosition(),500);g=B.fromPositions(g.getStartPosition(),m)}const p=e.getValueInRange(g,1);let v;if(s===l||s+1===l)v=e.getValueInRange(t,1);else{const m=a.intersectRanges(t),_=c.intersectRanges(t);v=e.getValueInRange(m,1)+String.fromCharCode(8230)+e.getValueInRange(_,1)}return r&&v.length>2*500&&(v=v.substring(0,500)+String.fromCharCode(8230)+v.substring(v.length-500,v.length)),new Xo(d+v+p,d.length,d.length+v.length,t,u.endLineNumber-u.startLineNumber)}}var F$e=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},bre=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},lP;(function(i){i.Tap="-monaco-textarea-synthetic-tap"})(lP||(lP={}));const NH={forceCopyWithSyntaxHighlighting:!1};class jD{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)}}jD.INSTANCE=new jD;class B$e{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){e=e||"";const t={text:e,replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}}let RH=class extends fe{get textAreaState(){return this._textAreaState}constructor(e,t,n,r,o,s){super(),this._host=e,this._textArea=t,this._OS=n,this._browser=r,this._accessibilityService=o,this._logService=s,this._onFocus=this._register(new se),this.onFocus=this._onFocus.event,this._onBlur=this._register(new se),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new se),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new se),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new se),this.onCut=this._onCut.event,this._onPaste=this._register(new se),this.onPaste=this._onPaste.event,this._onType=this._register(new se),this.onType=this._onType.event,this._onCompositionStart=this._register(new se),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new se),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new se),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new se),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncFocusGainWriteScreenReaderContent=this._register(new Ho),this._asyncTriggerCut=this._register(new pi(()=>this._onCut.fire(),0)),this._textAreaState=Xo.EMPTY,this._selectionChangeListener=null,this._accessibilityService.isScreenReaderOptimized()&&this.writeNativeTextAreaContent("ctor"),this._register(Je.runAndSubscribe(this._accessibilityService.onDidChangeScreenReaderOptimized,()=>{this._accessibilityService.isScreenReaderOptimized()&&!this._asyncFocusGainWriteScreenReaderContent.value?this._asyncFocusGainWriteScreenReaderContent.value=this._register(new pi(()=>this.writeNativeTextAreaContent("asyncFocusGain"),0)):this._asyncFocusGainWriteScreenReaderContent.clear()})),this._hasFocus=!1,this._currentComposition=null;let a=null;this._register(this._textArea.onKeyDown(l=>{const c=new Ai(l);(c.keyCode===114||this._currentComposition&&c.keyCode===1)&&c.stopPropagation(),c.equals(9)&&c.preventDefault(),a=c,this._onKeyDown.fire(c)})),this._register(this._textArea.onKeyUp(l=>{const c=new Ai(l);this._onKeyUp.fire(c)})),this._register(this._textArea.onCompositionStart(l=>{const c=new B$e;if(this._currentComposition){this._currentComposition=c;return}if(this._currentComposition=c,this._OS===2&&a&&a.equals(114)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===l.data&&(a.code==="ArrowRight"||a.code==="ArrowLeft")){c.handleCompositionUpdate("x"),this._onCompositionStart.fire({data:l.data});return}if(this._browser.isAndroid){this._onCompositionStart.fire({data:l.data});return}this._onCompositionStart.fire({data:l.data})})),this._register(this._textArea.onCompositionUpdate(l=>{const c=this._currentComposition;if(!c)return;if(this._browser.isAndroid){const d=Xo.readFromTextArea(this._textArea,this._textAreaState),h=Xo.deduceAndroidCompositionInput(this._textAreaState,d);this._textAreaState=d,this._onType.fire(h),this._onCompositionUpdate.fire(l);return}const u=c.handleCompositionUpdate(l.data);this._textAreaState=Xo.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(u),this._onCompositionUpdate.fire(l)})),this._register(this._textArea.onCompositionEnd(l=>{const c=this._currentComposition;if(!c)return;if(this._currentComposition=null,this._browser.isAndroid){const d=Xo.readFromTextArea(this._textArea,this._textAreaState),h=Xo.deduceAndroidCompositionInput(this._textAreaState,d);this._textAreaState=d,this._onType.fire(h),this._onCompositionEnd.fire();return}const u=c.handleCompositionUpdate(l.data);this._textAreaState=Xo.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(u),this._onCompositionEnd.fire()})),this._register(this._textArea.onInput(l=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;const c=Xo.readFromTextArea(this._textArea,this._textAreaState),u=Xo.deduceInput(this._textAreaState,c,this._OS===2);u.replacePrevCharCnt===0&&u.text.length===1&&(xo(u.text.charCodeAt(0))||u.text.charCodeAt(0)===127)||(this._textAreaState=c,(u.text!==""||u.replacePrevCharCnt!==0||u.replaceNextCharCnt!==0||u.positionDelta!==0)&&this._onType.fire(u))})),this._register(this._textArea.onCut(l=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(l),this._asyncTriggerCut.schedule()})),this._register(this._textArea.onCopy(l=>{this._ensureClipboardGetsEditorSelection(l)})),this._register(this._textArea.onPaste(l=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),l.preventDefault(),!l.clipboardData)return;let[c,u]=MH.getTextData(l.clipboardData);c&&(u=u||jD.INSTANCE.get(c),this._onPaste.fire({text:c,metadata:u}))})),this._register(this._textArea.onFocus(()=>{const l=this._hasFocus;this._setHasFocus(!0),this._accessibilityService.isScreenReaderOptimized()&&this._browser.isSafari&&!l&&this._hasFocus&&(this._asyncFocusGainWriteScreenReaderContent.value||(this._asyncFocusGainWriteScreenReaderContent.value=new pi(()=>this.writeNativeTextAreaContent("asyncFocusGain"),0)),this._asyncFocusGainWriteScreenReaderContent.value.schedule())})),this._register(this._textArea.onBlur(()=>{this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)})),this._register(this._textArea.onSyntheticTap(()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())}))}_installSelectionChangeListener(){let e=0;return ye(this._textArea.ownerDocument,"selectionchange",t=>{if(Km.onSelectionChange(),!this._hasFocus||this._currentComposition||!this._browser.isChrome)return;const n=Date.now(),r=n-e;if(e=n,r<5)return;const o=n-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),o<100||!this._textAreaState.selection)return;const s=this._textArea.getValue();if(this._textAreaState.value!==s)return;const a=this._textArea.getSelectionStart(),l=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===a&&this._textAreaState.selectionEnd===l)return;const c=this._textAreaState.deduceEditorPosition(a),u=this._host.deduceModelPosition(c[0],c[1],c[2]),d=this._textAreaState.deduceEditorPosition(l),h=this._host.deduceModelPosition(d[0],d[1],d[2]),f=new yt(u.lineNumber,u.column,h.lineNumber,h.column);this._onSelectionChangeRequest.fire(f)})}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){this._setHasFocus(this._textArea.hasFocus())}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&this.writeNativeTextAreaContent("focusgain"),this._hasFocus?this._onFocus.fire():this._onBlur.fire())}_setAndWriteTextAreaState(e,t){this._hasFocus||(t=t.collapseSelection()),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t}writeNativeTextAreaContent(e){!this._accessibilityService.isScreenReaderOptimized()&&e==="render"||this._currentComposition||(this._logService.trace(`writeTextAreaState(reason: ${e})`),this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent()))}_ensureClipboardGetsEditorSelection(e){const t=this._host.getDataToCopy(),n={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};jD.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,` `):t.text,n),e.preventDefault(),e.clipboardData&&MH.setTextData(e.clipboardData,t.text,t.html,n)}};RH=F$e([bre(4,ud),bre(5,Ta)],RH);const MH={getTextData(i){const e=i.getData(Cr.text);let t=null;const n=i.getData("vscode-editor-data");if(typeof n=="string")try{t=JSON.parse(n),t.version!==1&&(t=null)}catch{}return e.length===0&&t===null&&i.files.length>0?[Array.prototype.slice.call(i.files,0).map(o=>o.name).join(` -`),null]:[e,t]},setTextData(i,e,t,n){i.setData(Cr.text,e),typeof t=="string"&&i.setData("text/html",t),i.setData("vscode-editor-data",JSON.stringify(n))}};class W$e extends fe{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new wn(this._actual,"keydown")).event,this.onKeyUp=this._register(new wn(this._actual,"keyup")).event,this.onCompositionStart=this._register(new wn(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new wn(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new wn(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new wn(this._actual,"beforeinput")).event,this.onInput=this._register(new wn(this._actual,"input")).event,this.onCut=this._register(new wn(this._actual,"cut")).event,this.onCopy=this._register(new wn(this._actual,"copy")).event,this.onPaste=this._register(new wn(this._actual,"paste")).event,this.onFocus=this._register(new wn(this._actual,"focus")).event,this.onBlur=this._register(new wn(this._actual,"blur")).event,this._onSyntheticTap=this._register(new se),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>jm.onKeyDown())),this._register(this.onBeforeInput(()=>jm.onBeforeInput())),this._register(this.onInput(()=>jm.onInput())),this._register(this.onKeyUp(()=>jm.onKeyUp())),this._register(ye(this._actual,lP.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=Tb(this._actual);return e?e.activeElement===this._actual:this._actual.isConnected?fs()===this._actual:!1}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){const n=this._actual;n.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),n.value=t)}getSelectionStart(){return this._actual.selectionDirection==="backward"?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return this._actual.selectionDirection==="backward"?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,n){const r=this._actual;let o=null;const s=Tb(r);s?o=s.activeElement:o=fs();const a=Pt(o),l=o===r,c=r.selectionStart,u=r.selectionEnd;if(l&&c===t&&u===n){ru&&a.parent!==a&&r.focus();return}if(l){this.setIgnoreSelectionChangeTime("setSelectionRange"),r.setSelectionRange(t,n),ru&&a.parent!==a&&r.focus();return}try{const d=r8e(r);this.setIgnoreSelectionChangeTime("setSelectionRange"),r.focus(),r.setSelectionRange(t,n),o8e(r,d)}catch{}}}class $$e extends rX{constructor(e,t,n){super(e,t,n),this._register(wi.addTarget(this.viewHelper.linesContentDomNode)),this._register(ye(this.viewHelper.linesContentDomNode,Si.Tap,o=>this.onTap(o))),this._register(ye(this.viewHelper.linesContentDomNode,Si.Change,o=>this.onChange(o))),this._register(ye(this.viewHelper.linesContentDomNode,Si.Contextmenu,o=>this._onContextMenu(new Yv(o,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(ye(this.viewHelper.linesContentDomNode,"pointerdown",o=>{const s=o.pointerType;if(s==="mouse"){this._lastPointerType="mouse";return}else s==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const r=new s$e(this.viewHelper.viewDomNode);this._register(r.onPointerMove(this.viewHelper.viewDomNode,o=>this._onMouseMove(o))),this._register(r.onPointerUp(this.viewHelper.viewDomNode,o=>this._onMouseUp(o))),this._register(r.onPointerLeave(this.viewHelper.viewDomNode,o=>this._onMouseLeave(o))),this._register(r.onPointerDown(this.viewHelper.viewDomNode,(o,s)=>this._onMouseDown(o,s)))}onTap(e){!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget)||(e.preventDefault(),this.viewHelper.focusTextArea(),this._dispatchGesture(e,!1))}onChange(e){this._lastPointerType==="touch"&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY),this._lastPointerType==="pen"&&this._dispatchGesture(e,!0)}_dispatchGesture(e,t){const n=this._createMouseTarget(new Yv(e,!1,this.viewHelper.viewDomNode),!1);n.position&&this.viewController.dispatchMouse({position:n.position,mouseColumn:n.position.column,startedOnLineNumbers:!1,revealType:1,mouseDownCount:e.tapCount,inSelectionMode:t,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:n.type===6&&n.detail.injectedText!==null})}_onMouseDown(e,t){e.browserEvent.pointerType!=="touch"&&super._onMouseDown(e,t)}}class H$e extends rX{constructor(e,t,n){super(e,t,n),this._register(wi.addTarget(this.viewHelper.linesContentDomNode)),this._register(ye(this.viewHelper.linesContentDomNode,Si.Tap,r=>this.onTap(r))),this._register(ye(this.viewHelper.linesContentDomNode,Si.Change,r=>this.onChange(r))),this._register(ye(this.viewHelper.linesContentDomNode,Si.Contextmenu,r=>this._onContextMenu(new Yv(r,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new Yv(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const n=document.createEvent("CustomEvent");n.initEvent(lP.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(n),this.viewController.moveTo(t.position,1)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class V$e extends fe{constructor(e,t,n){super(),(ch||t3e&&cpe)&&yq.pointerEvents?this.handler=this._register(new $$e(e,t,n)):hi.TouchEvent?this.handler=this._register(new H$e(e,t,n)):this.handler=this._register(new rX(e,t,n))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}class fC extends $k{}const To=yn("themeService");function fr(i){return{id:i}}function AH(i){switch(i){case Xc.DARK:return"vs-dark";case Xc.HIGH_CONTRAST_DARK:return"hc-black";case Xc.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const mve={ThemingContribution:"base.contributions.theming"};class z$e{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new se}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),Rt(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}}const vve=new z$e;ar.add(mve.ThemingContribution,vve);function fu(i){return vve.onColorThemeChange(i)}class U$e extends fe{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(t=>this.onThemeChange(t)))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}}const _ve=X("editor.lineHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},w("lineHighlight","Background color for the highlight of line at the cursor position.")),Cre=X("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:Sn},w("lineHighlightBorderBox","Background color for the border around the line at the cursor position."));X("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},w("rangeHighlight","Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."),!0);X("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:zi,hcLight:zi},w("rangeHighlightBorder","Background color of the border around highlighted ranges."),!0);X("editor.symbolHighlightBackground",{dark:ep,light:ep,hcDark:null,hcLight:null},w("symbolHighlight","Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations."),!0);X("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:zi,hcLight:zi},w("symbolHighlightBorder","Background color of the border around highlighted symbols."),!0);const bve=X("editorCursor.foreground",{dark:"#AEAFAD",light:me.black,hcDark:me.white,hcLight:"#0F4A85"},w("caret","Color of the editor cursor.")),j$e=X("editorCursor.background",null,w("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),rp=X("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},w("editorWhitespaces","Color of whitespace characters in the editor.")),K$e=X("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:me.white,hcLight:"#292929"},w("editorLineNumbers","Color of editor line numbers.")),dR=X("editorIndentGuide.background",{dark:rp,light:rp,hcDark:rp,hcLight:rp},w("editorIndentGuides","Color of the editor indentation guides."),!1,w("deprecatedEditorIndentGuides","'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),hR=X("editorIndentGuide.activeBackground",{dark:rp,light:rp,hcDark:rp,hcLight:rp},w("editorActiveIndentGuide","Color of the active editor indentation guides."),!1,w("deprecatedEditorActiveIndentGuide","'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),Vk=X("editorIndentGuide.background1",{dark:dR,light:dR,hcDark:dR,hcLight:dR},w("editorIndentGuides1","Color of the editor indentation guides (1).")),G$e=X("editorIndentGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorIndentGuides2","Color of the editor indentation guides (2).")),q$e=X("editorIndentGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorIndentGuides3","Color of the editor indentation guides (3).")),X$e=X("editorIndentGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorIndentGuides4","Color of the editor indentation guides (4).")),Y$e=X("editorIndentGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorIndentGuides5","Color of the editor indentation guides (5).")),Z$e=X("editorIndentGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorIndentGuides6","Color of the editor indentation guides (6).")),zk=X("editorIndentGuide.activeBackground1",{dark:hR,light:hR,hcDark:hR,hcLight:hR},w("editorActiveIndentGuide1","Color of the active editor indentation guides (1).")),Q$e=X("editorIndentGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorActiveIndentGuide2","Color of the active editor indentation guides (2).")),J$e=X("editorIndentGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorActiveIndentGuide3","Color of the active editor indentation guides (3).")),eHe=X("editorIndentGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorActiveIndentGuide4","Color of the active editor indentation guides (4).")),tHe=X("editorIndentGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorActiveIndentGuide5","Color of the active editor indentation guides (5).")),nHe=X("editorIndentGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorActiveIndentGuide6","Color of the active editor indentation guides (6).")),fR=X("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:zi,hcLight:zi},w("editorActiveLineNumber","Color of editor active line number"),!1,w("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));X("editorLineNumber.activeForeground",{dark:fR,light:fR,hcDark:fR,hcLight:fR},w("editorActiveLineNumber","Color of editor active line number"));const iHe=X("editorLineNumber.dimmedForeground",{dark:null,light:null,hcDark:null,hcLight:null},w("editorDimmedLineNumber","Color of the final editor line when editor.renderFinalNewline is set to dimmed."));X("editorRuler.foreground",{dark:"#5A5A5A",light:me.lightgrey,hcDark:me.white,hcLight:"#292929"},w("editorRuler","Color of the editor rulers."));X("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},w("editorCodeLensForeground","Foreground color of editor CodeLens"));X("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},w("editorBracketMatchBackground","Background color behind matching brackets"));X("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:Sn,hcLight:Sn},w("editorBracketMatchBorder","Color for matching brackets boxes"));const rHe=X("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},w("editorOverviewRulerBorder","Color of the overview ruler border.")),oHe=X("editorOverviewRuler.background",null,w("editorOverviewRulerBackground","Background color of the editor overview ruler."));X("editorGutter.background",{dark:Eo,light:Eo,hcDark:Eo,hcLight:Eo},w("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));X("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:me.fromHex("#fff").transparent(.8),hcLight:Sn},w("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor."));const sHe=X("editorUnnecessaryCode.opacity",{dark:me.fromHex("#000a"),light:me.fromHex("#0007"),hcDark:null,hcLight:null},w("unnecessaryCodeOpacity",`Opacity of unnecessary (unused) source code in the editor. For example, "#000000c0" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out.`));X("editorGhostText.border",{dark:null,light:null,hcDark:me.fromHex("#fff").transparent(.8),hcLight:me.fromHex("#292929").transparent(.8)},w("editorGhostTextBorder","Border color of ghost text in the editor."));X("editorGhostText.foreground",{dark:me.fromHex("#ffffff56"),light:me.fromHex("#0007"),hcDark:null,hcLight:null},w("editorGhostTextForeground","Foreground color of the ghost text in the editor."));X("editorGhostText.background",{dark:null,light:null,hcDark:null,hcLight:null},w("editorGhostTextBackground","Background color of the ghost text in the editor."));const gR=new me(new Tn(0,122,204,.6)),Cve=X("editorOverviewRuler.rangeHighlightForeground",{dark:gR,light:gR,hcDark:gR,hcLight:gR},w("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),aHe=X("editorOverviewRuler.errorForeground",{dark:new me(new Tn(255,18,18,.7)),light:new me(new Tn(255,18,18,.7)),hcDark:new me(new Tn(255,50,50,1)),hcLight:"#B5200D"},w("overviewRuleError","Overview ruler marker color for errors.")),lHe=X("editorOverviewRuler.warningForeground",{dark:qs,light:qs,hcDark:$D,hcLight:$D},w("overviewRuleWarning","Overview ruler marker color for warnings.")),cHe=X("editorOverviewRuler.infoForeground",{dark:Za,light:Za,hcDark:HD,hcLight:HD},w("overviewRuleInfo","Overview ruler marker color for infos.")),yve=X("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},w("editorBracketHighlightForeground1","Foreground color of brackets (1). Requires enabling bracket pair colorization.")),wve=X("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},w("editorBracketHighlightForeground2","Foreground color of brackets (2). Requires enabling bracket pair colorization.")),Sve=X("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},w("editorBracketHighlightForeground3","Foreground color of brackets (3). Requires enabling bracket pair colorization.")),xve=X("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketHighlightForeground4","Foreground color of brackets (4). Requires enabling bracket pair colorization.")),Lve=X("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketHighlightForeground5","Foreground color of brackets (5). Requires enabling bracket pair colorization.")),Eve=X("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketHighlightForeground6","Foreground color of brackets (6). Requires enabling bracket pair colorization.")),uHe=X("editorBracketHighlight.unexpectedBracket.foreground",{dark:new me(new Tn(255,18,18,.8)),light:new me(new Tn(255,18,18,.8)),hcDark:new me(new Tn(255,50,50,1)),hcLight:""},w("editorBracketHighlightUnexpectedBracketForeground","Foreground color of unexpected brackets.")),dHe=X("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.background1","Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),hHe=X("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.background2","Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),fHe=X("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.background3","Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),gHe=X("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.background4","Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),pHe=X("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.background5","Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),mHe=X("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.background6","Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),vHe=X("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.activeBackground1","Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),_He=X("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.activeBackground2","Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),bHe=X("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.activeBackground3","Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),CHe=X("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.activeBackground4","Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),yHe=X("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.activeBackground5","Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),wHe=X("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.activeBackground6","Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));X("editorUnicodeHighlight.border",{dark:qs,light:qs,hcDark:qs,hcLight:qs},w("editorUnicodeHighlight.border","Border color used to highlight unicode characters."));X("editorUnicodeHighlight.background",{dark:aR,light:aR,hcDark:aR,hcLight:aR},w("editorUnicodeHighlight.background","Background color used to highlight unicode characters."));fu((i,e)=>{const t=i.getColor(Eo),n=i.getColor(_ve),r=n&&!n.isTransparent()?n:t;r&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${r}; }`)});class Uk extends fC{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new ae(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(67);const t=e.get(68);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(95);const n=e.get(144);this._lineNumbersLeft=n.lineNumbersLeft,this._lineNumbersWidth=n.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 n=!1;return this._activeLineNumber!==t.lineNumber&&(this._activeLineNumber=t.lineNumber,n=!0),(this._renderLineNumbers===2||this._renderLineNumbers===3)&&(n=!0),n}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onDecorationsChanged(e){return e.affectsLineNumber}_getLineRenderLineNumber(e){const t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new ae(e,1));if(t.column!==1)return"";const n=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(n);if(this._renderLineNumbers===2){const r=Math.abs(this._lastCursorModelPosition.lineNumber-n);return r===0?''+n+"":String(r)}return this._renderLineNumbers===3?this._lastCursorModelPosition.lineNumber===n||n%10===0?String(n):"":String(n)}prepareRender(e){if(this._renderLineNumbers===0){this._renderResult=null;return}const t=Da?this._lineHeight%2===0?" lh-even":" lh-odd":"",n=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,o=this._context.viewModel.getDecorationsInViewport(e.visibleRange).filter(c=>!!c.options.lineNumberClassName);o.sort((c,u)=>B.compareRangesUsingEnds(c.range,u.range));let s=0;const a=this._context.viewModel.getLineCount(),l=[];for(let c=n;c<=r;c++){const u=c-n;let d=this._getLineRenderLineNumber(c),h="";for(;s${d}`}this._renderResult=l}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}Uk.CLASS_NAME="line-numbers";fu((i,e)=>{const t=i.getColor(K$e),n=i.getColor(iHe);n?e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${n}; }`):t&&e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${t.transparent(.4)}; }`)});class Rb extends Pl{constructor(e){super(e);const t=this._context.configuration.options,n=t.get(144);this._canUseLayerHinting=!t.get(32),this._contentLeft=n.contentLeft,this._glyphMarginLeft=n.glyphMarginLeft,this._glyphMarginWidth=n.glyphMarginWidth,this._domNode=Qn(document.createElement("div")),this._domNode.setClassName(Rb.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=Qn(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(Rb.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options,n=t.get(144);return this._canUseLayerHinting=!t.get(32),this._contentLeft=n.contentLeft,this._glyphMarginLeft=n.glyphMarginLeft,this._glyphMarginWidth=n.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 n=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(n),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(n)}}Rb.CLASS_NAME="glyph-margin";Rb.OUTER_CLASS_NAME="margin";const $y="monaco-mouse-cursor-text";class SHe{constructor(){this._onDidChange=new se,this.onDidChange=this._onDidChange.event,this._enabled=!0}get enabled(){return this._enabled}enable(){this._enabled=!0,this._onDidChange.fire()}disable(){this._enabled=!1,this._onDidChange.fire()}}const fE=new SHe,ci=yn("keybindingService");var xHe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},yre=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class LHe{constructor(e,t,n,r,o){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=n,this.widthOfHiddenLineTextBefore=r,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 ae(this.modelLineNumber,this.distanceToModelLineStart+1),n=new ae(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(n),this.startPosition.lineNumber===this.endPosition.lineNumber?(this.visibleTextareaStart=e.visibleRangeForPosition(this.startPosition),this.visibleTextareaEnd=e.visibleRangeForPosition(this.endPosition)):(this.visibleTextareaStart=null,this.visibleTextareaEnd=null)}definePresentation(e){return this._previousPresentation||(e?this._previousPresentation=e:this._previousPresentation={foreground:1,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const I6=ru;let PH=class extends Pl{constructor(e,t,n,r,o){super(e),this._keybindingService=r,this._instantiationService=o,this._primaryCursorPosition=new ae(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=n,this._scrollLeft=0,this._scrollTop=0;const s=this._context.configuration.options,a=s.get(144);this._setAccessibilityOptions(s),this._contentLeft=a.contentLeft,this._contentWidth=a.contentWidth,this._contentHeight=a.height,this._fontInfo=s.get(50),this._lineHeight=s.get(67),this._emptySelectionClipboard=s.get(37),this._copyWithSyntaxHighlighting=s.get(25),this._visibleTextArea=null,this._selections=[new yt(1,1,1,1)],this._modelSelections=[new yt(1,1,1,1)],this._lastRenderPosition=null,this.textArea=Qn(document.createElement("textarea")),fh.write(this.textArea,7),this.textArea.setClassName(`inputarea ${$y}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:l}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=`${l*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",this._getAriaLabel(s)),this.textArea.setAttribute("aria-required",s.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(s.get(124))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",w("editor","editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",s.get(91)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=Qn(document.createElement("div")),this.textAreaCover.setPosition("absolute");const c={getLineCount:()=>this._context.viewModel.getLineCount(),getLineMaxColumn:h=>this._context.viewModel.getLineMaxColumn(h),getValueInRange:(h,f)=>this._context.viewModel.getValueInRange(h,f),getValueLengthInRange:(h,f)=>this._context.viewModel.getValueLengthInRange(h,f),modifyPosition:(h,f)=>this._context.viewModel.modifyPosition(h,f)},u={getDataToCopy:()=>{const h=this._context.viewModel.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,Rs),f=this._context.viewModel.model.getEOL(),g=this._emptySelectionClipboard&&this._modelSelections.length===1&&this._modelSelections[0].isEmpty(),p=Array.isArray(h)?h:null,v=Array.isArray(h)?h.join(f):h;let m,_=null;if(NH.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&v.length<65536){const y=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);y&&(m=y.html,_=y.mode)}return{isFromEmptySelection:g,multicursorText:p,text:v,html:m,mode:_}},getScreenReaderContent:()=>{if(this._accessibilitySupport===1){const h=this._selections[0];if(Ln&&h.isEmpty()){const g=h.getStartPosition();let p=this._getWordBeforePosition(g);if(p.length===0&&(p=this._getCharacterBeforePosition(g)),p.length>0)return new Xo(p,p.length,p.length,B.fromPositions(g),0)}const f=500;if(Ln&&!h.isEmpty()&&c.getValueLengthInRange(h,0)0)return new Xo(g,p,p,B.fromPositions(f),0)}return Xo.EMPTY}return dy.fromEditorSelection(c,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===0)},deduceModelPosition:(h,f,g)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(h,f,g)},d=this._register(new W$e(this.textArea.domNode));this._textAreaInput=this._register(this._instantiationService.createInstance(RH,u,d,yl,{isAndroid:jne,isChrome:Nk,isFirefox:ru,isSafari:Dp})),this._register(this._textAreaInput.onKeyDown(h=>{this._viewController.emitKeyDown(h)})),this._register(this._textAreaInput.onKeyUp(h=>{this._viewController.emitKeyUp(h)})),this._register(this._textAreaInput.onPaste(h=>{let f=!1,g=null,p=null;h.metadata&&(f=this._emptySelectionClipboard&&!!h.metadata.isFromEmptySelection,g=typeof h.metadata.multicursorText<"u"?h.metadata.multicursorText:null,p=h.metadata.mode),this._viewController.paste(h.text,f,g,p)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(h=>{h.replacePrevCharCnt||h.replaceNextCharCnt||h.positionDelta?this._viewController.compositionType(h.text,h.replacePrevCharCnt,h.replaceNextCharCnt,h.positionDelta):this._viewController.type(h.text)})),this._register(this._textAreaInput.onSelectionChangeRequest(h=>{this._viewController.setSelection(h)})),this._register(this._textAreaInput.onCompositionStart(h=>{const f=this.textArea.domNode,g=this._modelSelections[0],{distanceToModelLineStart:p,widthOfHiddenTextBefore:v}=(()=>{const _=f.value.substring(0,Math.min(f.selectionStart,f.selectionEnd)),y=_.lastIndexOf(` +`),null]:[e,t]},setTextData(i,e,t,n){i.setData(Cr.text,e),typeof t=="string"&&i.setData("text/html",t),i.setData("vscode-editor-data",JSON.stringify(n))}};class W$e extends fe{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new wn(this._actual,"keydown")).event,this.onKeyUp=this._register(new wn(this._actual,"keyup")).event,this.onCompositionStart=this._register(new wn(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new wn(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new wn(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new wn(this._actual,"beforeinput")).event,this.onInput=this._register(new wn(this._actual,"input")).event,this.onCut=this._register(new wn(this._actual,"cut")).event,this.onCopy=this._register(new wn(this._actual,"copy")).event,this.onPaste=this._register(new wn(this._actual,"paste")).event,this.onFocus=this._register(new wn(this._actual,"focus")).event,this.onBlur=this._register(new wn(this._actual,"blur")).event,this._onSyntheticTap=this._register(new se),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>Km.onKeyDown())),this._register(this.onBeforeInput(()=>Km.onBeforeInput())),this._register(this.onInput(()=>Km.onInput())),this._register(this.onKeyUp(()=>Km.onKeyUp())),this._register(ye(this._actual,lP.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=Tb(this._actual);return e?e.activeElement===this._actual:this._actual.isConnected?fs()===this._actual:!1}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){const n=this._actual;n.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),n.value=t)}getSelectionStart(){return this._actual.selectionDirection==="backward"?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return this._actual.selectionDirection==="backward"?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,n){const r=this._actual;let o=null;const s=Tb(r);s?o=s.activeElement:o=fs();const a=Pt(o),l=o===r,c=r.selectionStart,u=r.selectionEnd;if(l&&c===t&&u===n){ru&&a.parent!==a&&r.focus();return}if(l){this.setIgnoreSelectionChangeTime("setSelectionRange"),r.setSelectionRange(t,n),ru&&a.parent!==a&&r.focus();return}try{const d=r8e(r);this.setIgnoreSelectionChangeTime("setSelectionRange"),r.focus(),r.setSelectionRange(t,n),o8e(r,d)}catch{}}}class $$e extends rX{constructor(e,t,n){super(e,t,n),this._register(wi.addTarget(this.viewHelper.linesContentDomNode)),this._register(ye(this.viewHelper.linesContentDomNode,Si.Tap,o=>this.onTap(o))),this._register(ye(this.viewHelper.linesContentDomNode,Si.Change,o=>this.onChange(o))),this._register(ye(this.viewHelper.linesContentDomNode,Si.Contextmenu,o=>this._onContextMenu(new Xv(o,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(ye(this.viewHelper.linesContentDomNode,"pointerdown",o=>{const s=o.pointerType;if(s==="mouse"){this._lastPointerType="mouse";return}else s==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const r=new s$e(this.viewHelper.viewDomNode);this._register(r.onPointerMove(this.viewHelper.viewDomNode,o=>this._onMouseMove(o))),this._register(r.onPointerUp(this.viewHelper.viewDomNode,o=>this._onMouseUp(o))),this._register(r.onPointerLeave(this.viewHelper.viewDomNode,o=>this._onMouseLeave(o))),this._register(r.onPointerDown(this.viewHelper.viewDomNode,(o,s)=>this._onMouseDown(o,s)))}onTap(e){!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget)||(e.preventDefault(),this.viewHelper.focusTextArea(),this._dispatchGesture(e,!1))}onChange(e){this._lastPointerType==="touch"&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY),this._lastPointerType==="pen"&&this._dispatchGesture(e,!0)}_dispatchGesture(e,t){const n=this._createMouseTarget(new Xv(e,!1,this.viewHelper.viewDomNode),!1);n.position&&this.viewController.dispatchMouse({position:n.position,mouseColumn:n.position.column,startedOnLineNumbers:!1,revealType:1,mouseDownCount:e.tapCount,inSelectionMode:t,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:n.type===6&&n.detail.injectedText!==null})}_onMouseDown(e,t){e.browserEvent.pointerType!=="touch"&&super._onMouseDown(e,t)}}class H$e extends rX{constructor(e,t,n){super(e,t,n),this._register(wi.addTarget(this.viewHelper.linesContentDomNode)),this._register(ye(this.viewHelper.linesContentDomNode,Si.Tap,r=>this.onTap(r))),this._register(ye(this.viewHelper.linesContentDomNode,Si.Change,r=>this.onChange(r))),this._register(ye(this.viewHelper.linesContentDomNode,Si.Contextmenu,r=>this._onContextMenu(new Xv(r,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new Xv(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const n=document.createEvent("CustomEvent");n.initEvent(lP.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(n),this.viewController.moveTo(t.position,1)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class V$e extends fe{constructor(e,t,n){super(),(ch||t3e&&cpe)&&yq.pointerEvents?this.handler=this._register(new $$e(e,t,n)):hi.TouchEvent?this.handler=this._register(new H$e(e,t,n)):this.handler=this._register(new rX(e,t,n))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}class fC extends $k{}const To=yn("themeService");function fr(i){return{id:i}}function AH(i){switch(i){case Xc.DARK:return"vs-dark";case Xc.HIGH_CONTRAST_DARK:return"hc-black";case Xc.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const mve={ThemingContribution:"base.contributions.theming"};class z$e{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new se}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),Rt(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}}const vve=new z$e;ar.add(mve.ThemingContribution,vve);function fu(i){return vve.onColorThemeChange(i)}class U$e extends fe{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(t=>this.onThemeChange(t)))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}}const _ve=X("editor.lineHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},w("lineHighlight","Background color for the highlight of line at the cursor position.")),Cre=X("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:Sn},w("lineHighlightBorderBox","Background color for the border around the line at the cursor position."));X("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},w("rangeHighlight","Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."),!0);X("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:zi,hcLight:zi},w("rangeHighlightBorder","Background color of the border around highlighted ranges."),!0);X("editor.symbolHighlightBackground",{dark:ep,light:ep,hcDark:null,hcLight:null},w("symbolHighlight","Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations."),!0);X("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:zi,hcLight:zi},w("symbolHighlightBorder","Background color of the border around highlighted symbols."),!0);const bve=X("editorCursor.foreground",{dark:"#AEAFAD",light:me.black,hcDark:me.white,hcLight:"#0F4A85"},w("caret","Color of the editor cursor.")),j$e=X("editorCursor.background",null,w("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),rp=X("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},w("editorWhitespaces","Color of whitespace characters in the editor.")),K$e=X("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:me.white,hcLight:"#292929"},w("editorLineNumbers","Color of editor line numbers.")),dR=X("editorIndentGuide.background",{dark:rp,light:rp,hcDark:rp,hcLight:rp},w("editorIndentGuides","Color of the editor indentation guides."),!1,w("deprecatedEditorIndentGuides","'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),hR=X("editorIndentGuide.activeBackground",{dark:rp,light:rp,hcDark:rp,hcLight:rp},w("editorActiveIndentGuide","Color of the active editor indentation guides."),!1,w("deprecatedEditorActiveIndentGuide","'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),Vk=X("editorIndentGuide.background1",{dark:dR,light:dR,hcDark:dR,hcLight:dR},w("editorIndentGuides1","Color of the editor indentation guides (1).")),G$e=X("editorIndentGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorIndentGuides2","Color of the editor indentation guides (2).")),q$e=X("editorIndentGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorIndentGuides3","Color of the editor indentation guides (3).")),X$e=X("editorIndentGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorIndentGuides4","Color of the editor indentation guides (4).")),Y$e=X("editorIndentGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorIndentGuides5","Color of the editor indentation guides (5).")),Z$e=X("editorIndentGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorIndentGuides6","Color of the editor indentation guides (6).")),zk=X("editorIndentGuide.activeBackground1",{dark:hR,light:hR,hcDark:hR,hcLight:hR},w("editorActiveIndentGuide1","Color of the active editor indentation guides (1).")),Q$e=X("editorIndentGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorActiveIndentGuide2","Color of the active editor indentation guides (2).")),J$e=X("editorIndentGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorActiveIndentGuide3","Color of the active editor indentation guides (3).")),eHe=X("editorIndentGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorActiveIndentGuide4","Color of the active editor indentation guides (4).")),tHe=X("editorIndentGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorActiveIndentGuide5","Color of the active editor indentation guides (5).")),nHe=X("editorIndentGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorActiveIndentGuide6","Color of the active editor indentation guides (6).")),fR=X("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:zi,hcLight:zi},w("editorActiveLineNumber","Color of editor active line number"),!1,w("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));X("editorLineNumber.activeForeground",{dark:fR,light:fR,hcDark:fR,hcLight:fR},w("editorActiveLineNumber","Color of editor active line number"));const iHe=X("editorLineNumber.dimmedForeground",{dark:null,light:null,hcDark:null,hcLight:null},w("editorDimmedLineNumber","Color of the final editor line when editor.renderFinalNewline is set to dimmed."));X("editorRuler.foreground",{dark:"#5A5A5A",light:me.lightgrey,hcDark:me.white,hcLight:"#292929"},w("editorRuler","Color of the editor rulers."));X("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},w("editorCodeLensForeground","Foreground color of editor CodeLens"));X("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},w("editorBracketMatchBackground","Background color behind matching brackets"));X("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:Sn,hcLight:Sn},w("editorBracketMatchBorder","Color for matching brackets boxes"));const rHe=X("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},w("editorOverviewRulerBorder","Color of the overview ruler border.")),oHe=X("editorOverviewRuler.background",null,w("editorOverviewRulerBackground","Background color of the editor overview ruler."));X("editorGutter.background",{dark:Eo,light:Eo,hcDark:Eo,hcLight:Eo},w("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));X("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:me.fromHex("#fff").transparent(.8),hcLight:Sn},w("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor."));const sHe=X("editorUnnecessaryCode.opacity",{dark:me.fromHex("#000a"),light:me.fromHex("#0007"),hcDark:null,hcLight:null},w("unnecessaryCodeOpacity",`Opacity of unnecessary (unused) source code in the editor. For example, "#000000c0" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out.`));X("editorGhostText.border",{dark:null,light:null,hcDark:me.fromHex("#fff").transparent(.8),hcLight:me.fromHex("#292929").transparent(.8)},w("editorGhostTextBorder","Border color of ghost text in the editor."));X("editorGhostText.foreground",{dark:me.fromHex("#ffffff56"),light:me.fromHex("#0007"),hcDark:null,hcLight:null},w("editorGhostTextForeground","Foreground color of the ghost text in the editor."));X("editorGhostText.background",{dark:null,light:null,hcDark:null,hcLight:null},w("editorGhostTextBackground","Background color of the ghost text in the editor."));const gR=new me(new Tn(0,122,204,.6)),Cve=X("editorOverviewRuler.rangeHighlightForeground",{dark:gR,light:gR,hcDark:gR,hcLight:gR},w("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),aHe=X("editorOverviewRuler.errorForeground",{dark:new me(new Tn(255,18,18,.7)),light:new me(new Tn(255,18,18,.7)),hcDark:new me(new Tn(255,50,50,1)),hcLight:"#B5200D"},w("overviewRuleError","Overview ruler marker color for errors.")),lHe=X("editorOverviewRuler.warningForeground",{dark:qs,light:qs,hcDark:$D,hcLight:$D},w("overviewRuleWarning","Overview ruler marker color for warnings.")),cHe=X("editorOverviewRuler.infoForeground",{dark:Za,light:Za,hcDark:HD,hcLight:HD},w("overviewRuleInfo","Overview ruler marker color for infos.")),yve=X("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},w("editorBracketHighlightForeground1","Foreground color of brackets (1). Requires enabling bracket pair colorization.")),wve=X("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},w("editorBracketHighlightForeground2","Foreground color of brackets (2). Requires enabling bracket pair colorization.")),Sve=X("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},w("editorBracketHighlightForeground3","Foreground color of brackets (3). Requires enabling bracket pair colorization.")),xve=X("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketHighlightForeground4","Foreground color of brackets (4). Requires enabling bracket pair colorization.")),Lve=X("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketHighlightForeground5","Foreground color of brackets (5). Requires enabling bracket pair colorization.")),Eve=X("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketHighlightForeground6","Foreground color of brackets (6). Requires enabling bracket pair colorization.")),uHe=X("editorBracketHighlight.unexpectedBracket.foreground",{dark:new me(new Tn(255,18,18,.8)),light:new me(new Tn(255,18,18,.8)),hcDark:new me(new Tn(255,50,50,1)),hcLight:""},w("editorBracketHighlightUnexpectedBracketForeground","Foreground color of unexpected brackets.")),dHe=X("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.background1","Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),hHe=X("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.background2","Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),fHe=X("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.background3","Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),gHe=X("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.background4","Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),pHe=X("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.background5","Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),mHe=X("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.background6","Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),vHe=X("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.activeBackground1","Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),_He=X("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.activeBackground2","Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),bHe=X("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.activeBackground3","Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),CHe=X("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.activeBackground4","Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),yHe=X("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.activeBackground5","Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),wHe=X("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},w("editorBracketPairGuide.activeBackground6","Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));X("editorUnicodeHighlight.border",{dark:qs,light:qs,hcDark:qs,hcLight:qs},w("editorUnicodeHighlight.border","Border color used to highlight unicode characters."));X("editorUnicodeHighlight.background",{dark:aR,light:aR,hcDark:aR,hcLight:aR},w("editorUnicodeHighlight.background","Background color used to highlight unicode characters."));fu((i,e)=>{const t=i.getColor(Eo),n=i.getColor(_ve),r=n&&!n.isTransparent()?n:t;r&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${r}; }`)});class Uk extends fC{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new ae(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(67);const t=e.get(68);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(95);const n=e.get(144);this._lineNumbersLeft=n.lineNumbersLeft,this._lineNumbersWidth=n.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 n=!1;return this._activeLineNumber!==t.lineNumber&&(this._activeLineNumber=t.lineNumber,n=!0),(this._renderLineNumbers===2||this._renderLineNumbers===3)&&(n=!0),n}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onDecorationsChanged(e){return e.affectsLineNumber}_getLineRenderLineNumber(e){const t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new ae(e,1));if(t.column!==1)return"";const n=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(n);if(this._renderLineNumbers===2){const r=Math.abs(this._lastCursorModelPosition.lineNumber-n);return r===0?''+n+"":String(r)}return this._renderLineNumbers===3?this._lastCursorModelPosition.lineNumber===n||n%10===0?String(n):"":String(n)}prepareRender(e){if(this._renderLineNumbers===0){this._renderResult=null;return}const t=Da?this._lineHeight%2===0?" lh-even":" lh-odd":"",n=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,o=this._context.viewModel.getDecorationsInViewport(e.visibleRange).filter(c=>!!c.options.lineNumberClassName);o.sort((c,u)=>B.compareRangesUsingEnds(c.range,u.range));let s=0;const a=this._context.viewModel.getLineCount(),l=[];for(let c=n;c<=r;c++){const u=c-n;let d=this._getLineRenderLineNumber(c),h="";for(;s${d}`}this._renderResult=l}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}Uk.CLASS_NAME="line-numbers";fu((i,e)=>{const t=i.getColor(K$e),n=i.getColor(iHe);n?e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${n}; }`):t&&e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${t.transparent(.4)}; }`)});class Rb extends Pl{constructor(e){super(e);const t=this._context.configuration.options,n=t.get(144);this._canUseLayerHinting=!t.get(32),this._contentLeft=n.contentLeft,this._glyphMarginLeft=n.glyphMarginLeft,this._glyphMarginWidth=n.glyphMarginWidth,this._domNode=Qn(document.createElement("div")),this._domNode.setClassName(Rb.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=Qn(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(Rb.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options,n=t.get(144);return this._canUseLayerHinting=!t.get(32),this._contentLeft=n.contentLeft,this._glyphMarginLeft=n.glyphMarginLeft,this._glyphMarginWidth=n.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 n=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(n),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(n)}}Rb.CLASS_NAME="glyph-margin";Rb.OUTER_CLASS_NAME="margin";const $y="monaco-mouse-cursor-text";class SHe{constructor(){this._onDidChange=new se,this.onDidChange=this._onDidChange.event,this._enabled=!0}get enabled(){return this._enabled}enable(){this._enabled=!0,this._onDidChange.fire()}disable(){this._enabled=!1,this._onDidChange.fire()}}const fE=new SHe,ci=yn("keybindingService");var xHe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},yre=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class LHe{constructor(e,t,n,r,o){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=n,this.widthOfHiddenLineTextBefore=r,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 ae(this.modelLineNumber,this.distanceToModelLineStart+1),n=new ae(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(n),this.startPosition.lineNumber===this.endPosition.lineNumber?(this.visibleTextareaStart=e.visibleRangeForPosition(this.startPosition),this.visibleTextareaEnd=e.visibleRangeForPosition(this.endPosition)):(this.visibleTextareaStart=null,this.visibleTextareaEnd=null)}definePresentation(e){return this._previousPresentation||(e?this._previousPresentation=e:this._previousPresentation={foreground:1,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const I6=ru;let PH=class extends Pl{constructor(e,t,n,r,o){super(e),this._keybindingService=r,this._instantiationService=o,this._primaryCursorPosition=new ae(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=n,this._scrollLeft=0,this._scrollTop=0;const s=this._context.configuration.options,a=s.get(144);this._setAccessibilityOptions(s),this._contentLeft=a.contentLeft,this._contentWidth=a.contentWidth,this._contentHeight=a.height,this._fontInfo=s.get(50),this._lineHeight=s.get(67),this._emptySelectionClipboard=s.get(37),this._copyWithSyntaxHighlighting=s.get(25),this._visibleTextArea=null,this._selections=[new yt(1,1,1,1)],this._modelSelections=[new yt(1,1,1,1)],this._lastRenderPosition=null,this.textArea=Qn(document.createElement("textarea")),fh.write(this.textArea,7),this.textArea.setClassName(`inputarea ${$y}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:l}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=`${l*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",this._getAriaLabel(s)),this.textArea.setAttribute("aria-required",s.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(s.get(124))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",w("editor","editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",s.get(91)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=Qn(document.createElement("div")),this.textAreaCover.setPosition("absolute");const c={getLineCount:()=>this._context.viewModel.getLineCount(),getLineMaxColumn:h=>this._context.viewModel.getLineMaxColumn(h),getValueInRange:(h,f)=>this._context.viewModel.getValueInRange(h,f),getValueLengthInRange:(h,f)=>this._context.viewModel.getValueLengthInRange(h,f),modifyPosition:(h,f)=>this._context.viewModel.modifyPosition(h,f)},u={getDataToCopy:()=>{const h=this._context.viewModel.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,Rs),f=this._context.viewModel.model.getEOL(),g=this._emptySelectionClipboard&&this._modelSelections.length===1&&this._modelSelections[0].isEmpty(),p=Array.isArray(h)?h:null,v=Array.isArray(h)?h.join(f):h;let m,_=null;if(NH.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&v.length<65536){const y=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);y&&(m=y.html,_=y.mode)}return{isFromEmptySelection:g,multicursorText:p,text:v,html:m,mode:_}},getScreenReaderContent:()=>{if(this._accessibilitySupport===1){const h=this._selections[0];if(Ln&&h.isEmpty()){const g=h.getStartPosition();let p=this._getWordBeforePosition(g);if(p.length===0&&(p=this._getCharacterBeforePosition(g)),p.length>0)return new Xo(p,p.length,p.length,B.fromPositions(g),0)}const f=500;if(Ln&&!h.isEmpty()&&c.getValueLengthInRange(h,0)0)return new Xo(g,p,p,B.fromPositions(f),0)}return Xo.EMPTY}return dy.fromEditorSelection(c,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===0)},deduceModelPosition:(h,f,g)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(h,f,g)},d=this._register(new W$e(this.textArea.domNode));this._textAreaInput=this._register(this._instantiationService.createInstance(RH,u,d,yl,{isAndroid:jne,isChrome:Nk,isFirefox:ru,isSafari:Ip})),this._register(this._textAreaInput.onKeyDown(h=>{this._viewController.emitKeyDown(h)})),this._register(this._textAreaInput.onKeyUp(h=>{this._viewController.emitKeyUp(h)})),this._register(this._textAreaInput.onPaste(h=>{let f=!1,g=null,p=null;h.metadata&&(f=this._emptySelectionClipboard&&!!h.metadata.isFromEmptySelection,g=typeof h.metadata.multicursorText<"u"?h.metadata.multicursorText:null,p=h.metadata.mode),this._viewController.paste(h.text,f,g,p)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(h=>{h.replacePrevCharCnt||h.replaceNextCharCnt||h.positionDelta?this._viewController.compositionType(h.text,h.replacePrevCharCnt,h.replaceNextCharCnt,h.positionDelta):this._viewController.type(h.text)})),this._register(this._textAreaInput.onSelectionChangeRequest(h=>{this._viewController.setSelection(h)})),this._register(this._textAreaInput.onCompositionStart(h=>{const f=this.textArea.domNode,g=this._modelSelections[0],{distanceToModelLineStart:p,widthOfHiddenTextBefore:v}=(()=>{const _=f.value.substring(0,Math.min(f.selectionStart,f.selectionEnd)),y=_.lastIndexOf(` `),S=_.substring(y+1),L=S.lastIndexOf(" "),E=S.length-L-1,D=g.getStartPosition(),k=Math.min(D.column-1,E),T=D.column-1-k,M=S.substring(0,S.length-k),{tabSize:A}=this._context.viewModel.model.getOptions(),N=EHe(this.textArea.domNode.ownerDocument,M,this._fontInfo,A);return{distanceToModelLineStart:T,widthOfHiddenTextBefore:N}})(),{distanceToModelLineEnd:m}=(()=>{const _=f.value.substring(Math.max(f.selectionStart,f.selectionEnd)),y=_.indexOf(` `),S=y===-1?_:_.substring(0,y),L=S.indexOf(" "),E=L===-1?S.length:S.length-L-1,D=g.getEndPosition(),k=Math.min(this._context.viewModel.model.getLineMaxColumn(D.lineNumber)-D.column,E);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(D.lineNumber)-D.column-k}})();this._context.viewModel.revealRange("keyboard",!0,B.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new LHe(this._context,g.startLineNumber,p,v,m),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${$y} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(h=>{this._visibleTextArea&&(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._render(),this.textArea.setClassName(`inputarea ${$y}`),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()})),this._register(this._textAreaInput.onFocus(()=>{this._context.viewModel.setHasFocus(!0)})),this._register(this._textAreaInput.onBlur(()=>{this._context.viewModel.setHasFocus(!1)})),this._register(fE.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeNativeTextAreaContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',n=this._context.viewModel.getLineContent(e.lineNumber),r=ou(t);let o=!0,s=e.column,a=!0,l=e.column,c=0;for(;c<50&&(o||a);){if(o&&s<=1&&(o=!1),o){const u=n.charCodeAt(s-2);r.get(u)!==0?o=!1:s--}if(a&&l>n.length&&(a=!1),a){const u=n.charCodeAt(l-1);r.get(u)!==0?a=!1:l++}c++}return[n.substring(s-1,l-1),e.column-s]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),n=ou(this._context.configuration.options.get(130));let r=e.column,o=0;for(;r>1;){const s=t.charCodeAt(r-2);if(n.get(s)!==0||o>50)return t.substring(r-1,e.column-1);o++,r--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const n=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!xo(n.charCodeAt(0)))return n}return""}_getAriaLabel(e){var t,n,r;if(e.get(2)===1){const s=(t=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode"))===null||t===void 0?void 0:t.getAriaLabel(),a=(n=this._keybindingService.lookupKeybinding("workbench.action.showCommands"))===null||n===void 0?void 0:n.getAriaLabel(),l=(r=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings"))===null||r===void 0?void 0:r.getAriaLabel(),c=w("accessibilityModeOff","The editor is not accessible at this time.");return s?w("accessibilityOffAriaLabel","{0} To enable screen reader optimized mode, use {1}",c,s):a?w("accessibilityOffAriaLabelNoKb","{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.",c,a):l?w("accessibilityOffAriaLabelNoKbs","{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.",c,l):c}return e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);this._accessibilitySupport===2&&t===yh.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const r=e.get(144).wrappingColumn;if(r!==-1&&this._accessibilitySupport!==1){const o=e.get(50);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(r*o.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=I6?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,n=t.get(144);this._setAccessibilityOptions(t),this._contentLeft=n.contentLeft,this._contentWidth=n.contentWidth,this._contentHeight=n.height,this._fontInfo=t.get(50),this._lineHeight=t.get(67),this._emptySelectionClipboard=t.get(37),this._copyWithSyntaxHighlighting=t.get(25),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:r}=this._context.viewModel.model.getOptions();return this.textArea.domNode.style.tabSize=`${r*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("aria-required",t.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(t.get(124))),(e.hasChanged(34)||e.hasChanged(91))&&this._ensureReadOnlyAttribute(),e.hasChanged(2)&&this._textAreaInput.writeNativeTextAreaContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeNativeTextAreaContent("selection changed"),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}isFocused(){return this._textAreaInput.isFocused()}focusTextArea(){this._textAreaInput.focusTextArea()}getLastRenderData(){return this._lastRenderPosition}setAriaOptions(e){e.activeDescendant?(this.textArea.setAttribute("aria-haspopup","true"),this.textArea.setAttribute("aria-autocomplete","list"),this.textArea.setAttribute("aria-activedescendant",e.activeDescendant)):(this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),this.textArea.removeAttribute("aria-activedescendant")),e.role&&this.textArea.setAttribute("role",e.role)}_ensureReadOnlyAttribute(){const e=this._context.configuration.options;!fE.enabled||e.get(34)&&e.get(91)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){var t;this._primaryCursorPosition=new ae(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),(t=this._visibleTextArea)===null||t===void 0||t.prepareRender(e)}render(e){this._textAreaInput.writeNativeTextAreaContent("render"),this._render()}_render(){var e;if(this._visibleTextArea){const r=this._visibleTextArea.visibleTextareaStart,o=this._visibleTextArea.visibleTextareaEnd,s=this._visibleTextArea.startPosition,a=this._visibleTextArea.endPosition;if(s&&a&&r&&o&&o.left>=this._scrollLeft&&r.left<=this._scrollLeft+this._contentWidth){const l=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,c=this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));let u=this._visibleTextArea.widthOfHiddenLineTextBefore,d=this._contentLeft+r.left-this._scrollLeft,h=o.left-r.left+1;if(dthis._contentWidth&&(h=this._contentWidth);const f=this._context.viewModel.getViewLineData(s.lineNumber),g=f.tokens.findTokenIndexAtOffset(s.column-1),p=f.tokens.findTokenIndexAtOffset(a.column-1),v=g===p,m=this._visibleTextArea.definePresentation(v?f.tokens.getPresentation(g):null);this.textArea.domNode.scrollTop=c*this._lineHeight,this.textArea.domNode.scrollLeft=u,this._doRender({lastRenderPosition:null,top:l,left:d,width:h,height:this._lineHeight,useCover:!1,color:(hr.getColorMap()||[])[m.foreground],italic:m.italic,bold:m.bold,underline:m.underline,strikethrough:m.strikethrough})}return}if(!this._primaryCursorVisibleRange){this._renderAtTopLeft();return}const t=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(tthis._contentLeft+this._contentWidth){this._renderAtTopLeft();return}const n=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(n<0||n>this._contentHeight){this._renderAtTopLeft();return}if(Ln||this._accessibilitySupport===2){this._doRender({lastRenderPosition:this._primaryCursorPosition,top:n,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:this._lineHeight,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const r=(e=this._textAreaInput.textAreaState.newlineCountBeforeSelection)!==null&&e!==void 0?e:this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=r*this._lineHeight;return}this._doRender({lastRenderPosition:this._primaryCursorPosition,top:n,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:I6?0:1,useCover:!1})}_newlinecount(e){let t=0,n=-1;do{if(n=e.indexOf(` -`,n+1),n===-1)break;t++}while(!0);return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:I6?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,n=this.textAreaCover;ps(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?me.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration(`${e.underline?" underline":""}${e.strikethrough?" line-through":""}`),n.setTop(e.useCover?e.top:0),n.setLeft(e.useCover?e.left:0),n.setWidth(e.useCover?e.width:0),n.setHeight(e.useCover?e.height:0);const r=this._context.configuration.options;r.get(57)?n.setClassName("monaco-editor-background textAreaCover "+Rb.OUTER_CLASS_NAME):r.get(68).renderType!==0?n.setClassName("monaco-editor-background textAreaCover "+Uk.CLASS_NAME):n.setClassName("monaco-editor-background textAreaCover")}};PH=xHe([yre(3,ci),yre(4,Ot)],PH);function EHe(i,e,t,n){if(e.length===0)return 0;const r=i.createElement("div");r.style.position="absolute",r.style.top="-50000px",r.style.width="50000px";const o=i.createElement("span");ps(o,t),o.style.whiteSpace="pre",o.style.tabSize=`${n*t.spaceWidth}px`,o.append(e),r.appendChild(o),i.body.appendChild(r);const s=o.offsetWidth;return i.body.removeChild(r),s}function DHe(i,e,t){let n=0;for(let o=0;o!0,kHe=()=>!1,THe=i=>i===" "||i===" ";class YC{static shouldRecreate(e){return e.hasChanged(144)||e.hasChanged(130)||e.hasChanged(37)||e.hasChanged(77)||e.hasChanged(79)||e.hasChanged(80)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(9)||e.hasChanged(10)||e.hasChanged(14)||e.hasChanged(128)||e.hasChanged(50)||e.hasChanged(91)}constructor(e,t,n,r){var o;this.languageConfigurationService=r,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const s=n.options,a=s.get(144),l=s.get(50);this.readOnly=s.get(91),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=s.get(116),this.lineHeight=l.lineHeight,this.typicalHalfwidthCharacterWidth=l.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(a.height/this.lineHeight)-2),this.useTabStops=s.get(128),this.wordSeparators=s.get(130),this.emptySelectionClipboard=s.get(37),this.copyWithSyntaxHighlighting=s.get(25),this.multiCursorMergeOverlapping=s.get(77),this.multiCursorPaste=s.get(79),this.multiCursorLimit=s.get(80),this.autoClosingBrackets=s.get(6),this.autoClosingComments=s.get(7),this.autoClosingQuotes=s.get(11),this.autoClosingDelete=s.get(9),this.autoClosingOvertype=s.get(10),this.autoSurround=s.get(14),this.autoIndent=s.get(12),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes,!0),comment:this._getShouldAutoClose(e,this.autoClosingComments,!1),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets,!1)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const c=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(c)for(const d of c)this.surroundingPairs[d.open]=d.close;const u=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=(o=u==null?void 0:u.blockCommentStartToken)!==null&&o!==void 0?o:null}get electricChars(){var e;if(!this._electricChars){this._electricChars={};const t=(e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter)===null||e===void 0?void 0:e.getElectricCharacters();if(t)for(const n of t)this._electricChars[n]=!0}return this._electricChars}onElectricCharacter(e,t,n){const r=L4(t,n-1),o=this.languageConfigurationService.getLanguageConfiguration(r.languageId).electricCharacter;return o?o.onElectricCharacter(e,r,n-r.firstCharOffset):null}normalizeIndentation(e){return cP(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,n){switch(t){case"beforeWhitespace":return THe;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,n);case"always":return IHe;case"never":return kHe}}_getLanguageDefinedShouldAutoClose(e,t){const n=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return r=>n.indexOf(r)!==-1}visibleColumnFromColumn(e,t){return go.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,n){const r=go.columnFromVisibleColumn(e.getLineContent(t),n,this.tabSize),o=e.getLineMinColumn(t);if(rs?s:r}}let Wn=class Dve{static fromModelState(e){return new NHe(e)}static fromViewState(e){return new RHe(e)}static fromModelSelection(e){const t=yt.liftSelection(e),n=new Yo(B.fromPositions(t.getSelectionStart()),0,0,t.getPosition(),0);return Dve.fromModelState(n)}static fromModelSelections(e){const t=[];for(let n=0,r=e.length;no,c=r>s,u=rs||mr||v0&&r--,D0.columnSelect(e,t,n.fromViewLineNumber,n.fromViewVisualColumn,n.toViewLineNumber,r)}static columnSelectRight(e,t,n){let r=0;const o=Math.min(n.fromViewLineNumber,n.toViewLineNumber),s=Math.max(n.fromViewLineNumber,n.toViewLineNumber);for(let l=o;l<=s;l++){const c=t.getLineMaxColumn(l),u=e.visibleColumnFromColumn(t,new ae(l,c));r=Math.max(r,u)}let a=n.toViewVisualColumn;return ae.getLineMinColumn(t.lineNumber))return t.delta(void 0,-Ppe(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const n=t.lineNumber-1;return new ae(n,e.getLineMaxColumn(n))}else return t}static leftPositionAtomicSoftTabs(e,t,n){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const r=e.getLineMinColumn(t.lineNumber),o=e.getLineContent(t.lineNumber),s=zD.atomicPosition(o,t.column-1,n,0);if(s!==-1&&s+1>=r)return new ae(t.lineNumber,s+1)}return this.leftPosition(e,t)}static left(e,t,n){const r=e.stickyTabStops?ri.leftPositionAtomicSoftTabs(t,n,e.tabSize):ri.leftPosition(t,n);return new k6(r.lineNumber,r.column,0)}static moveLeft(e,t,n,r,o){let s,a;if(n.hasSelection()&&!r)s=n.selection.startLineNumber,a=n.selection.startColumn;else{const l=n.position.delta(void 0,-(o-1)),c=t.normalizePosition(ri.clipPositionColumn(l,t),0),u=ri.left(e,t,c);s=u.lineNumber,a=u.column}return n.move(r,s,a,0)}static clipPositionColumn(e,t){return new ae(e.lineNumber,ri.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,n){return en?n:e}static rightPosition(e,t,n){return nu?(n=u,a?r=t.getLineMaxColumn(n):r=Math.min(t.getLineMaxColumn(n),r)):r=e.columnFromVisibleColumn(t,n,c),f?o=0:o=c-go.visibleColumnFromColumn(t.getLineContent(n),r,e.tabSize),l!==void 0){const g=new ae(n,r),p=t.normalizePosition(g,l);o=o+(r-p.column),n=p.lineNumber,r=p.column}return new k6(n,r,o)}static down(e,t,n,r,o,s,a){return this.vertical(e,t,n,r,o,n+s,a,4)}static moveDown(e,t,n,r,o){let s,a;n.hasSelection()&&!r?(s=n.selection.endLineNumber,a=n.selection.endColumn):(s=n.position.lineNumber,a=n.position.column);let l=0,c;do if(c=ri.down(e,t,s+l,a,n.leftoverVisibleColumns,o,!0),t.normalizePosition(new ae(c.lineNumber,c.column),2).lineNumber>s)break;while(l++<10&&s+l1&&this._isBlankLine(t,o);)o--;for(;o>1&&!this._isBlankLine(t,o);)o--;return n.move(r,o,t.getLineMinColumn(o),0)}static moveToNextBlankLine(e,t,n,r){const o=t.getLineCount();let s=n.position.lineNumber;for(;s=h.length+1)return!1;const f=h.charAt(d.column-2),g=r.get(f);if(!g)return!1;if(_m(f)){if(n==="never")return!1}else if(t==="never")return!1;const p=h.charAt(d.column-1);let v=!1;for(const m of g)m.open===f&&m.close===p&&(v=!0);if(!v)return!1;if(e==="auto"){let m=!1;for(let _=0,y=a.length;_1){const o=t.getLineContent(r.lineNumber),s=Ys(o),a=s===-1?o.length+1:s+1;if(r.column<=a){const l=n.visibleColumnFromColumn(t,r),c=go.prevIndentTabStop(l,n.indentSize),u=n.columnFromVisibleColumn(t,r.lineNumber,c);return new B(r.lineNumber,u,r.lineNumber,r.column)}}return B.fromPositions(Mb.getPositionAfterDeleteLeft(r,t),r)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const n=X5e(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,n+1)}else if(e.lineNumber>1){const n=e.lineNumber-1;return new ae(n,t.getLineMaxColumn(n))}else return e}static cut(e,t,n){const r=[];let o=null;n.sort((s,a)=>ae.compare(s.getStartPosition(),a.getEndPosition()));for(let s=0,a=n.length;s1&&(o==null?void 0:o.endLineNumber)!==c.lineNumber?(u=c.lineNumber-1,d=t.getLineMaxColumn(c.lineNumber-1),h=c.lineNumber,f=t.getLineMaxColumn(c.lineNumber)):(u=c.lineNumber,d=1,h=c.lineNumber,f=t.getLineMaxColumn(c.lineNumber));const g=new B(u,d,h,f);o=g,g.isEmpty()?r[s]=null:r[s]=new os(g,"")}else r[s]=null;else r[s]=new os(l,"")}return new za(0,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class Zn{static _createWord(e,t,n,r,o){return{start:r,end:o,wordType:t,nextCharClass:n}}static _findPreviousWordOnLine(e,t,n){const r=t.getLineContent(n.lineNumber);return this._doFindPreviousWordOnLine(r,e,n)}static _doFindPreviousWordOnLine(e,t,n){let r=0;for(let o=n.column-2;o>=0;o--){const s=e.charCodeAt(o),a=t.get(s);if(a===0){if(r===2)return this._createWord(e,r,a,o+1,this._findEndOfWord(e,t,r,o+1));r=1}else if(a===2){if(r===1)return this._createWord(e,r,a,o+1,this._findEndOfWord(e,t,r,o+1));r=2}else if(a===1&&r!==0)return this._createWord(e,r,a,o+1,this._findEndOfWord(e,t,r,o+1))}return r!==0?this._createWord(e,r,1,0,this._findEndOfWord(e,t,r,0)):null}static _findEndOfWord(e,t,n,r){const o=e.length;for(let s=r;s=0;o--){const s=e.charCodeAt(o),a=t.get(s);if(a===1||n===1&&a===2||n===2&&a===0)return o+1}return 0}static moveWordLeft(e,t,n,r){let o=n.lineNumber,s=n.column;s===1&&o>1&&(o=o-1,s=t.getLineMaxColumn(o));let a=Zn._findPreviousWordOnLine(e,t,new ae(o,s));if(r===0)return new ae(o,a?a.start+1:1);if(r===1)return a&&a.wordType===2&&a.end-a.start===1&&a.nextCharClass===0&&(a=Zn._findPreviousWordOnLine(e,t,new ae(o,a.start+1))),new ae(o,a?a.start+1:1);if(r===3){for(;a&&a.wordType===2;)a=Zn._findPreviousWordOnLine(e,t,new ae(o,a.start+1));return new ae(o,a?a.start+1:1)}return a&&s<=a.end+1&&(a=Zn._findPreviousWordOnLine(e,t,new ae(o,a.start+1))),new ae(o,a?a.end+1:1)}static _moveWordPartLeft(e,t){const n=t.lineNumber,r=e.getLineMaxColumn(n);if(t.column===1)return n>1?new ae(n-1,e.getLineMaxColumn(n-1)):t;const o=e.getLineContent(n);for(let s=t.column-1;s>1;s--){const a=o.charCodeAt(s-2),l=o.charCodeAt(s-1);if(a===95&&l!==95)return new ae(n,s);if(a===45&&l!==45)return new ae(n,s);if((zm(a)||eR(a))&&nf(l))return new ae(n,s);if(nf(a)&&nf(l)&&s+1=l.start+1&&(l=Zn._findNextWordOnLine(e,t,new ae(o,l.end+1))),l?s=l.start+1:s=t.getLineMaxColumn(o);return new ae(o,s)}static _moveWordPartRight(e,t){const n=t.lineNumber,r=e.getLineMaxColumn(n);if(t.column===r)return n1?c=1:(l--,c=r.getLineMaxColumn(l)):(u&&c<=u.end+1&&(u=Zn._findPreviousWordOnLine(n,r,new ae(l,u.start+1))),u?c=u.end+1:c>1?c=1:(l--,c=r.getLineMaxColumn(l))),new B(l,c,a.lineNumber,a.column)}static deleteInsideWord(e,t,n){if(!n.isEmpty())return n;const r=new ae(n.positionLineNumber,n.positionColumn),o=this._deleteInsideWordWhitespace(t,r);return o||this._deleteInsideWordDetermineDeleteRange(e,t,r)}static _charAtIsWhitespace(e,t){const n=e.charCodeAt(t);return n===32||n===9}static _deleteInsideWordWhitespace(e,t){const n=e.getLineContent(t.lineNumber),r=n.length;if(r===0)return null;let o=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(n,o))return null;let s=Math.min(t.column-1,r-1);if(!this._charAtIsWhitespace(n,s))return null;for(;o>0&&this._charAtIsWhitespace(n,o-1);)o--;for(;s+11?new B(n.lineNumber-1,t.getLineMaxColumn(n.lineNumber-1),n.lineNumber,1):n.lineNumberd.start+1<=n.column&&n.column<=d.end+1,a=(d,h)=>(d=Math.min(d,n.column),h=Math.max(h,n.column),new B(n.lineNumber,d,n.lineNumber,h)),l=d=>{let h=d.start+1,f=d.end+1,g=!1;for(;f-11&&this._charAtIsWhitespace(r,h-2);)h--;return a(h,f)},c=Zn._findPreviousWordOnLine(e,t,n);if(c&&s(c))return l(c);const u=Zn._findNextWordOnLine(e,t,n);return u&&s(u)?l(u):c&&u?a(c.end+1,u.start+1):c?a(c.start+1,c.end+1):u?a(u.start+1,u.end+1):a(1,o+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const n=t.getPosition(),r=Zn._moveWordPartLeft(e,n);return new B(n.lineNumber,n.column,r.lineNumber,r.column)}static _findFirstNonWhitespaceChar(e,t){const n=e.length;for(let r=t;r=h.start+1&&(h=Zn._findNextWordOnLine(n,r,new ae(l,h.end+1))),h?c=h.start+1:c!!e)}class Go{static addCursorDown(e,t,n){const r=[];let o=0;for(let s=0,a=t.length;sc&&(u=c,d=e.model.getLineMaxColumn(u)),Wn.fromModelState(new Yo(new B(s.lineNumber,1,u,d),2,0,new ae(u,d),0))}const l=t.modelState.selectionStart.getStartPosition().lineNumber;if(s.lineNumberl){const c=e.getLineCount();let u=a.lineNumber+1,d=1;return u>c&&(u=c,d=e.getLineMaxColumn(u)),Wn.fromViewState(t.viewState.move(!0,u,d,0))}else{const c=t.modelState.selectionStart.getEndPosition();return Wn.fromModelState(t.modelState.move(!0,c.lineNumber,c.column,0))}}static word(e,t,n,r){const o=e.model.validatePosition(r);return Wn.fromModelState(Zn.word(e.cursorConfig,e.model,t.modelState,n,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new Wn(t.modelState,t.viewState);const n=t.viewState.position.lineNumber,r=t.viewState.position.column;return Wn.fromViewState(new Yo(new B(n,r,n,r),0,0,new ae(n,r),0))}static moveTo(e,t,n,r,o){if(n){if(t.modelState.selectionStartKind===1)return this.word(e,t,n,r);if(t.modelState.selectionStartKind===2)return this.line(e,t,n,r,o)}const s=e.model.validatePosition(r),a=o?e.coordinatesConverter.validateViewPosition(new ae(o.lineNumber,o.column),s):e.coordinatesConverter.convertModelPositionToViewPosition(s);return Wn.fromViewState(t.viewState.move(n,a.lineNumber,a.column,0))}static simpleMove(e,t,n,r,o,s){switch(n){case 0:return s===4?this._moveHalfLineLeft(e,t,r):this._moveLeft(e,t,r,o);case 1:return s===4?this._moveHalfLineRight(e,t,r):this._moveRight(e,t,r,o);case 2:return s===2?this._moveUpByViewLines(e,t,r,o):this._moveUpByModelLines(e,t,r,o);case 3:return s===2?this._moveDownByViewLines(e,t,r,o):this._moveDownByModelLines(e,t,r,o);case 4:return s===2?t.map(a=>Wn.fromViewState(ri.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,r))):t.map(a=>Wn.fromModelState(ri.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,r)));case 5:return s===2?t.map(a=>Wn.fromViewState(ri.moveToNextBlankLine(e.cursorConfig,e,a.viewState,r))):t.map(a=>Wn.fromModelState(ri.moveToNextBlankLine(e.cursorConfig,e.model,a.modelState,r)));case 6:return this._moveToViewMinColumn(e,t,r);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,t,r);case 8:return this._moveToViewCenterColumn(e,t,r);case 9:return this._moveToViewMaxColumn(e,t,r);case 10:return this._moveToViewLastNonWhitespaceColumn(e,t,r);default:return null}}static viewportMove(e,t,n,r,o){const s=e.getCompletelyVisibleViewRange(),a=e.coordinatesConverter.convertViewRangeToModelRange(s);switch(n){case 11:{const l=this._firstLineNumberInRange(e.model,a,o),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],r,l,c)]}case 13:{const l=this._lastLineNumberInRange(e.model,a,o),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],r,l,c)]}case 12:{const l=Math.round((a.startLineNumber+a.endLineNumber)/2),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],r,l,c)]}case 14:{const l=[];for(let c=0,u=t.length;cn.endLineNumber-1?s=n.endLineNumber-1:oWn.fromViewState(ri.moveLeft(e.cursorConfig,e,o.viewState,n,r)))}static _moveHalfLineLeft(e,t,n){const r=[];for(let o=0,s=t.length;oWn.fromViewState(ri.moveRight(e.cursorConfig,e,o.viewState,n,r)))}static _moveHalfLineRight(e,t,n){const r=[];for(let o=0,s=t.length;o!0,kHe=()=>!1,THe=i=>i===" "||i===" ";class YC{static shouldRecreate(e){return e.hasChanged(144)||e.hasChanged(130)||e.hasChanged(37)||e.hasChanged(77)||e.hasChanged(79)||e.hasChanged(80)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(9)||e.hasChanged(10)||e.hasChanged(14)||e.hasChanged(128)||e.hasChanged(50)||e.hasChanged(91)}constructor(e,t,n,r){var o;this.languageConfigurationService=r,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const s=n.options,a=s.get(144),l=s.get(50);this.readOnly=s.get(91),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=s.get(116),this.lineHeight=l.lineHeight,this.typicalHalfwidthCharacterWidth=l.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(a.height/this.lineHeight)-2),this.useTabStops=s.get(128),this.wordSeparators=s.get(130),this.emptySelectionClipboard=s.get(37),this.copyWithSyntaxHighlighting=s.get(25),this.multiCursorMergeOverlapping=s.get(77),this.multiCursorPaste=s.get(79),this.multiCursorLimit=s.get(80),this.autoClosingBrackets=s.get(6),this.autoClosingComments=s.get(7),this.autoClosingQuotes=s.get(11),this.autoClosingDelete=s.get(9),this.autoClosingOvertype=s.get(10),this.autoSurround=s.get(14),this.autoIndent=s.get(12),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes,!0),comment:this._getShouldAutoClose(e,this.autoClosingComments,!1),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets,!1)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const c=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(c)for(const d of c)this.surroundingPairs[d.open]=d.close;const u=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=(o=u==null?void 0:u.blockCommentStartToken)!==null&&o!==void 0?o:null}get electricChars(){var e;if(!this._electricChars){this._electricChars={};const t=(e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter)===null||e===void 0?void 0:e.getElectricCharacters();if(t)for(const n of t)this._electricChars[n]=!0}return this._electricChars}onElectricCharacter(e,t,n){const r=L4(t,n-1),o=this.languageConfigurationService.getLanguageConfiguration(r.languageId).electricCharacter;return o?o.onElectricCharacter(e,r,n-r.firstCharOffset):null}normalizeIndentation(e){return cP(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,n){switch(t){case"beforeWhitespace":return THe;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,n);case"always":return IHe;case"never":return kHe}}_getLanguageDefinedShouldAutoClose(e,t){const n=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return r=>n.indexOf(r)!==-1}visibleColumnFromColumn(e,t){return go.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,n){const r=go.columnFromVisibleColumn(e.getLineContent(t),n,this.tabSize),o=e.getLineMinColumn(t);if(rs?s:r}}let Wn=class Dve{static fromModelState(e){return new NHe(e)}static fromViewState(e){return new RHe(e)}static fromModelSelection(e){const t=yt.liftSelection(e),n=new Yo(B.fromPositions(t.getSelectionStart()),0,0,t.getPosition(),0);return Dve.fromModelState(n)}static fromModelSelections(e){const t=[];for(let n=0,r=e.length;no,c=r>s,u=rs||mr||v0&&r--,E0.columnSelect(e,t,n.fromViewLineNumber,n.fromViewVisualColumn,n.toViewLineNumber,r)}static columnSelectRight(e,t,n){let r=0;const o=Math.min(n.fromViewLineNumber,n.toViewLineNumber),s=Math.max(n.fromViewLineNumber,n.toViewLineNumber);for(let l=o;l<=s;l++){const c=t.getLineMaxColumn(l),u=e.visibleColumnFromColumn(t,new ae(l,c));r=Math.max(r,u)}let a=n.toViewVisualColumn;return ae.getLineMinColumn(t.lineNumber))return t.delta(void 0,-Ppe(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const n=t.lineNumber-1;return new ae(n,e.getLineMaxColumn(n))}else return t}static leftPositionAtomicSoftTabs(e,t,n){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const r=e.getLineMinColumn(t.lineNumber),o=e.getLineContent(t.lineNumber),s=zD.atomicPosition(o,t.column-1,n,0);if(s!==-1&&s+1>=r)return new ae(t.lineNumber,s+1)}return this.leftPosition(e,t)}static left(e,t,n){const r=e.stickyTabStops?ri.leftPositionAtomicSoftTabs(t,n,e.tabSize):ri.leftPosition(t,n);return new k6(r.lineNumber,r.column,0)}static moveLeft(e,t,n,r,o){let s,a;if(n.hasSelection()&&!r)s=n.selection.startLineNumber,a=n.selection.startColumn;else{const l=n.position.delta(void 0,-(o-1)),c=t.normalizePosition(ri.clipPositionColumn(l,t),0),u=ri.left(e,t,c);s=u.lineNumber,a=u.column}return n.move(r,s,a,0)}static clipPositionColumn(e,t){return new ae(e.lineNumber,ri.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,n){return en?n:e}static rightPosition(e,t,n){return nu?(n=u,a?r=t.getLineMaxColumn(n):r=Math.min(t.getLineMaxColumn(n),r)):r=e.columnFromVisibleColumn(t,n,c),f?o=0:o=c-go.visibleColumnFromColumn(t.getLineContent(n),r,e.tabSize),l!==void 0){const g=new ae(n,r),p=t.normalizePosition(g,l);o=o+(r-p.column),n=p.lineNumber,r=p.column}return new k6(n,r,o)}static down(e,t,n,r,o,s,a){return this.vertical(e,t,n,r,o,n+s,a,4)}static moveDown(e,t,n,r,o){let s,a;n.hasSelection()&&!r?(s=n.selection.endLineNumber,a=n.selection.endColumn):(s=n.position.lineNumber,a=n.position.column);let l=0,c;do if(c=ri.down(e,t,s+l,a,n.leftoverVisibleColumns,o,!0),t.normalizePosition(new ae(c.lineNumber,c.column),2).lineNumber>s)break;while(l++<10&&s+l1&&this._isBlankLine(t,o);)o--;for(;o>1&&!this._isBlankLine(t,o);)o--;return n.move(r,o,t.getLineMinColumn(o),0)}static moveToNextBlankLine(e,t,n,r){const o=t.getLineCount();let s=n.position.lineNumber;for(;s=h.length+1)return!1;const f=h.charAt(d.column-2),g=r.get(f);if(!g)return!1;if(bm(f)){if(n==="never")return!1}else if(t==="never")return!1;const p=h.charAt(d.column-1);let v=!1;for(const m of g)m.open===f&&m.close===p&&(v=!0);if(!v)return!1;if(e==="auto"){let m=!1;for(let _=0,y=a.length;_1){const o=t.getLineContent(r.lineNumber),s=Ys(o),a=s===-1?o.length+1:s+1;if(r.column<=a){const l=n.visibleColumnFromColumn(t,r),c=go.prevIndentTabStop(l,n.indentSize),u=n.columnFromVisibleColumn(t,r.lineNumber,c);return new B(r.lineNumber,u,r.lineNumber,r.column)}}return B.fromPositions(Mb.getPositionAfterDeleteLeft(r,t),r)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const n=X5e(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,n+1)}else if(e.lineNumber>1){const n=e.lineNumber-1;return new ae(n,t.getLineMaxColumn(n))}else return e}static cut(e,t,n){const r=[];let o=null;n.sort((s,a)=>ae.compare(s.getStartPosition(),a.getEndPosition()));for(let s=0,a=n.length;s1&&(o==null?void 0:o.endLineNumber)!==c.lineNumber?(u=c.lineNumber-1,d=t.getLineMaxColumn(c.lineNumber-1),h=c.lineNumber,f=t.getLineMaxColumn(c.lineNumber)):(u=c.lineNumber,d=1,h=c.lineNumber,f=t.getLineMaxColumn(c.lineNumber));const g=new B(u,d,h,f);o=g,g.isEmpty()?r[s]=null:r[s]=new os(g,"")}else r[s]=null;else r[s]=new os(l,"")}return new za(0,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class Zn{static _createWord(e,t,n,r,o){return{start:r,end:o,wordType:t,nextCharClass:n}}static _findPreviousWordOnLine(e,t,n){const r=t.getLineContent(n.lineNumber);return this._doFindPreviousWordOnLine(r,e,n)}static _doFindPreviousWordOnLine(e,t,n){let r=0;for(let o=n.column-2;o>=0;o--){const s=e.charCodeAt(o),a=t.get(s);if(a===0){if(r===2)return this._createWord(e,r,a,o+1,this._findEndOfWord(e,t,r,o+1));r=1}else if(a===2){if(r===1)return this._createWord(e,r,a,o+1,this._findEndOfWord(e,t,r,o+1));r=2}else if(a===1&&r!==0)return this._createWord(e,r,a,o+1,this._findEndOfWord(e,t,r,o+1))}return r!==0?this._createWord(e,r,1,0,this._findEndOfWord(e,t,r,0)):null}static _findEndOfWord(e,t,n,r){const o=e.length;for(let s=r;s=0;o--){const s=e.charCodeAt(o),a=t.get(s);if(a===1||n===1&&a===2||n===2&&a===0)return o+1}return 0}static moveWordLeft(e,t,n,r){let o=n.lineNumber,s=n.column;s===1&&o>1&&(o=o-1,s=t.getLineMaxColumn(o));let a=Zn._findPreviousWordOnLine(e,t,new ae(o,s));if(r===0)return new ae(o,a?a.start+1:1);if(r===1)return a&&a.wordType===2&&a.end-a.start===1&&a.nextCharClass===0&&(a=Zn._findPreviousWordOnLine(e,t,new ae(o,a.start+1))),new ae(o,a?a.start+1:1);if(r===3){for(;a&&a.wordType===2;)a=Zn._findPreviousWordOnLine(e,t,new ae(o,a.start+1));return new ae(o,a?a.start+1:1)}return a&&s<=a.end+1&&(a=Zn._findPreviousWordOnLine(e,t,new ae(o,a.start+1))),new ae(o,a?a.end+1:1)}static _moveWordPartLeft(e,t){const n=t.lineNumber,r=e.getLineMaxColumn(n);if(t.column===1)return n>1?new ae(n-1,e.getLineMaxColumn(n-1)):t;const o=e.getLineContent(n);for(let s=t.column-1;s>1;s--){const a=o.charCodeAt(s-2),l=o.charCodeAt(s-1);if(a===95&&l!==95)return new ae(n,s);if(a===45&&l!==45)return new ae(n,s);if((Um(a)||eR(a))&&nf(l))return new ae(n,s);if(nf(a)&&nf(l)&&s+1=l.start+1&&(l=Zn._findNextWordOnLine(e,t,new ae(o,l.end+1))),l?s=l.start+1:s=t.getLineMaxColumn(o);return new ae(o,s)}static _moveWordPartRight(e,t){const n=t.lineNumber,r=e.getLineMaxColumn(n);if(t.column===r)return n1?c=1:(l--,c=r.getLineMaxColumn(l)):(u&&c<=u.end+1&&(u=Zn._findPreviousWordOnLine(n,r,new ae(l,u.start+1))),u?c=u.end+1:c>1?c=1:(l--,c=r.getLineMaxColumn(l))),new B(l,c,a.lineNumber,a.column)}static deleteInsideWord(e,t,n){if(!n.isEmpty())return n;const r=new ae(n.positionLineNumber,n.positionColumn),o=this._deleteInsideWordWhitespace(t,r);return o||this._deleteInsideWordDetermineDeleteRange(e,t,r)}static _charAtIsWhitespace(e,t){const n=e.charCodeAt(t);return n===32||n===9}static _deleteInsideWordWhitespace(e,t){const n=e.getLineContent(t.lineNumber),r=n.length;if(r===0)return null;let o=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(n,o))return null;let s=Math.min(t.column-1,r-1);if(!this._charAtIsWhitespace(n,s))return null;for(;o>0&&this._charAtIsWhitespace(n,o-1);)o--;for(;s+11?new B(n.lineNumber-1,t.getLineMaxColumn(n.lineNumber-1),n.lineNumber,1):n.lineNumberd.start+1<=n.column&&n.column<=d.end+1,a=(d,h)=>(d=Math.min(d,n.column),h=Math.max(h,n.column),new B(n.lineNumber,d,n.lineNumber,h)),l=d=>{let h=d.start+1,f=d.end+1,g=!1;for(;f-11&&this._charAtIsWhitespace(r,h-2);)h--;return a(h,f)},c=Zn._findPreviousWordOnLine(e,t,n);if(c&&s(c))return l(c);const u=Zn._findNextWordOnLine(e,t,n);return u&&s(u)?l(u):c&&u?a(c.end+1,u.start+1):c?a(c.start+1,c.end+1):u?a(u.start+1,u.end+1):a(1,o+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const n=t.getPosition(),r=Zn._moveWordPartLeft(e,n);return new B(n.lineNumber,n.column,r.lineNumber,r.column)}static _findFirstNonWhitespaceChar(e,t){const n=e.length;for(let r=t;r=h.start+1&&(h=Zn._findNextWordOnLine(n,r,new ae(l,h.end+1))),h?c=h.start+1:c!!e)}class Go{static addCursorDown(e,t,n){const r=[];let o=0;for(let s=0,a=t.length;sc&&(u=c,d=e.model.getLineMaxColumn(u)),Wn.fromModelState(new Yo(new B(s.lineNumber,1,u,d),2,0,new ae(u,d),0))}const l=t.modelState.selectionStart.getStartPosition().lineNumber;if(s.lineNumberl){const c=e.getLineCount();let u=a.lineNumber+1,d=1;return u>c&&(u=c,d=e.getLineMaxColumn(u)),Wn.fromViewState(t.viewState.move(!0,u,d,0))}else{const c=t.modelState.selectionStart.getEndPosition();return Wn.fromModelState(t.modelState.move(!0,c.lineNumber,c.column,0))}}static word(e,t,n,r){const o=e.model.validatePosition(r);return Wn.fromModelState(Zn.word(e.cursorConfig,e.model,t.modelState,n,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new Wn(t.modelState,t.viewState);const n=t.viewState.position.lineNumber,r=t.viewState.position.column;return Wn.fromViewState(new Yo(new B(n,r,n,r),0,0,new ae(n,r),0))}static moveTo(e,t,n,r,o){if(n){if(t.modelState.selectionStartKind===1)return this.word(e,t,n,r);if(t.modelState.selectionStartKind===2)return this.line(e,t,n,r,o)}const s=e.model.validatePosition(r),a=o?e.coordinatesConverter.validateViewPosition(new ae(o.lineNumber,o.column),s):e.coordinatesConverter.convertModelPositionToViewPosition(s);return Wn.fromViewState(t.viewState.move(n,a.lineNumber,a.column,0))}static simpleMove(e,t,n,r,o,s){switch(n){case 0:return s===4?this._moveHalfLineLeft(e,t,r):this._moveLeft(e,t,r,o);case 1:return s===4?this._moveHalfLineRight(e,t,r):this._moveRight(e,t,r,o);case 2:return s===2?this._moveUpByViewLines(e,t,r,o):this._moveUpByModelLines(e,t,r,o);case 3:return s===2?this._moveDownByViewLines(e,t,r,o):this._moveDownByModelLines(e,t,r,o);case 4:return s===2?t.map(a=>Wn.fromViewState(ri.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,r))):t.map(a=>Wn.fromModelState(ri.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,r)));case 5:return s===2?t.map(a=>Wn.fromViewState(ri.moveToNextBlankLine(e.cursorConfig,e,a.viewState,r))):t.map(a=>Wn.fromModelState(ri.moveToNextBlankLine(e.cursorConfig,e.model,a.modelState,r)));case 6:return this._moveToViewMinColumn(e,t,r);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,t,r);case 8:return this._moveToViewCenterColumn(e,t,r);case 9:return this._moveToViewMaxColumn(e,t,r);case 10:return this._moveToViewLastNonWhitespaceColumn(e,t,r);default:return null}}static viewportMove(e,t,n,r,o){const s=e.getCompletelyVisibleViewRange(),a=e.coordinatesConverter.convertViewRangeToModelRange(s);switch(n){case 11:{const l=this._firstLineNumberInRange(e.model,a,o),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],r,l,c)]}case 13:{const l=this._lastLineNumberInRange(e.model,a,o),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],r,l,c)]}case 12:{const l=Math.round((a.startLineNumber+a.endLineNumber)/2),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],r,l,c)]}case 14:{const l=[];for(let c=0,u=t.length;cn.endLineNumber-1?s=n.endLineNumber-1:oWn.fromViewState(ri.moveLeft(e.cursorConfig,e,o.viewState,n,r)))}static _moveHalfLineLeft(e,t,n){const r=[];for(let o=0,s=t.length;oWn.fromViewState(ri.moveRight(e.cursorConfig,e,o.viewState,n,r)))}static _moveHalfLineRight(e,t,n){const r=[];for(let o=0,s=t.length;o1&&r.firstCharOffset===0){const p=Py(e,t.startLineNumber-1);p.languageId===r.languageId&&(c=p.getLineContent())}const u=o.onEnter(i,c,a,l);if(!u)return null;const d=u.indentAction;let h=u.appendText;const f=u.removeText||0;h?d===qr.Indent&&(h=" "+h):d===qr.Indent||d===qr.IndentOutdent?h=" ":h="";let g=Ame(e,t.startLineNumber,t.startColumn);return f&&(g=g.substring(0,g.length-f)),{indentAction:d,appendText:h,removeText:f,indentation:g}}var AHe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},PHe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},CM;const T6=Object.create(null);function Q_(i,e){if(e<=0)return"";T6[i]||(T6[i]=["",i]);const t=T6[i];for(let n=t.length;n<=e;n++)t[n]=t[n-1]+i;return t[e]}let jc=CM=class{static unshiftIndent(e,t,n,r,o){const s=go.visibleColumnFromColumn(e,t,n);if(o){const a=Q_(" ",r),c=go.prevIndentTabStop(s,r)/r;return Q_(a,c)}else{const a=" ",c=go.prevRenderTabStop(s,n)/n;return Q_(a,c)}}static shiftIndent(e,t,n,r,o){const s=go.visibleColumnFromColumn(e,t,n);if(o){const a=Q_(" ",r),c=go.nextIndentTabStop(s,r)/r;return Q_(a,c)}else{const a=" ",c=go.nextRenderTabStop(s,n)/n;return Q_(a,c)}}constructor(e,t,n){this._languageConfigurationService=n,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,t,n){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,n):e.addEditOperation(t,n)}getEditOperations(e,t){const n=this._selection.startLineNumber;let r=this._selection.endLineNumber;this._selection.endColumn===1&&n!==r&&(r=r-1);const{tabSize:o,indentSize:s,insertSpaces:a}=this._opts,l=n===r;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(n))&&(this._useLastEditRangeForCursorEndPosition=!0);let c=0,u=0;for(let d=n;d<=r;d++,c=u){u=0;const h=e.getLineContent(d);let f=Ys(h);if(this._opts.isUnshift&&(h.length===0||f===0)||!l&&!this._opts.isUnshift&&h.length===0)continue;if(f===-1&&(f=h.length),d>1&&go.visibleColumnFromColumn(h,f+1,o)%s!==0&&e.tokenization.isCheapToTokenize(d-1)){const v=Hy(this._opts.autoIndent,e,new B(d-1,e.getLineMaxColumn(d-1),d-1,e.getLineMaxColumn(d-1)),this._languageConfigurationService);if(v){if(u=c,v.appendText)for(let m=0,_=v.appendText.length;m<_&&u1){let r,o=-1;for(r=e-1;r>=1;r--){if(i.tokenization.getLanguageIdAtPosition(r,0)!==n)return o;const s=i.getLineContent(r);if(t.shouldIgnore(s)||/^\s+$/.test(s)||s===""){o=r;continue}return r}}return-1}function W4(i,e,t,n=!0,r){if(i<4)return null;const o=r.getLanguageConfiguration(e.tokenization.getLanguageId()).indentRulesSupport;if(!o)return null;if(t<=1)return{indentation:"",action:null};for(let l=t-1;l>0&&e.getLineContent(l)==="";l--)if(l===1)return{indentation:"",action:null};const s=BHe(e,t,o);if(s<0)return null;if(s<1)return{indentation:"",action:null};const a=e.getLineContent(s);if(o.shouldIncrease(a)||o.shouldIndentNextLine(a))return{indentation:bi(a),action:qr.Indent,line:s};if(o.shouldDecrease(a))return{indentation:bi(a),action:null,line:s};{if(s===1)return{indentation:bi(e.getLineContent(s)),action:null,line:s};const l=s-1,c=o.getIndentMetadata(e.getLineContent(l));if(!(c&3)&&c&4){let u=0;for(let d=l-1;d>0;d--)if(!o.shouldIndentNextLine(e.getLineContent(d))){u=d;break}return{indentation:bi(e.getLineContent(u+1)),action:null,line:u+1}}if(n)return{indentation:bi(e.getLineContent(s)),action:null,line:s};for(let u=s;u>0;u--){const d=e.getLineContent(u);if(o.shouldIncrease(d))return{indentation:bi(d),action:qr.Indent,line:u};if(o.shouldIndentNextLine(d)){let h=0;for(let f=u-1;f>0;f--)if(!o.shouldIndentNextLine(e.getLineContent(u))){h=f;break}return{indentation:bi(e.getLineContent(h+1)),action:null,line:h+1}}else if(o.shouldDecrease(d))return{indentation:bi(d),action:null,line:u}}return{indentation:bi(e.getLineContent(1)),action:null,line:1}}}function gE(i,e,t,n,r,o){if(i<4)return null;const s=o.getLanguageConfiguration(t);if(!s)return null;const a=o.getLanguageConfiguration(t).indentRulesSupport;if(!a)return null;const l=W4(i,e,n,void 0,o),c=e.getLineContent(n);if(l){const u=l.line;if(u!==void 0){let d=!0;for(let h=u;h0&&o.getLanguageId(0)!==s.languageId?(l=!0,c=a.substr(0,t.startColumn-1-s.firstCharOffset)):c=o.getLineContent().substring(0,t.startColumn-1);let u;t.isEmpty()?u=a.substr(t.startColumn-1-s.firstCharOffset):u=Py(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-s.firstCharOffset);const d=r.getLanguageConfiguration(s.languageId).indentRulesSupport;if(!d)return null;const h=c,f=bi(c),g={tokenization:{getLineTokens:_=>e.tokenization.getLineTokens(_),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(_,y)=>e.getLanguageIdAtPosition(_,y)},getLineContent:_=>_===t.startLineNumber?h:e.getLineContent(_)},p=bi(o.getLineContent()),v=W4(i,g,t.startLineNumber+1,void 0,r);if(!v){const _=l?p:f;return{beforeEnter:_,afterEnter:_}}let m=l?p:v.indentation;return v.action===qr.Indent&&(m=n.shiftIndent(m)),d.shouldDecrease(u)&&(m=n.unshiftIndent(m)),{beforeEnter:l?p:f,afterEnter:m}}function $He(i,e,t,n,r,o){if(i<4)return null;const s=Py(e,t.startLineNumber,t.startColumn);if(s.firstCharOffset)return null;const a=o.getLanguageConfiguration(s.languageId).indentRulesSupport;if(!a)return null;const l=s.getLineContent(),c=l.substr(0,t.startColumn-1-s.firstCharOffset);let u;if(t.isEmpty()?u=l.substr(t.startColumn-1-s.firstCharOffset):u=Py(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-s.firstCharOffset),!a.shouldDecrease(c+u)&&a.shouldDecrease(c+n+u)){const d=W4(i,e,t.startLineNumber,!1,o);if(!d)return null;let h=d.indentation;return d.action!==qr.Indent&&(h=r.unshiftIndent(h)),h}return null}function Ive(i,e,t){const n=t.getLanguageConfiguration(i.getLanguageId()).indentRulesSupport;return!n||e<1||e>i.getLineCount()?null:n.getIndentMetadata(i.getLineContent(e))}class rr{static indent(e,t,n){if(t===null||n===null)return[];const r=[];for(let o=0,s=n.length;o1&&r.firstCharOffset===0){const p=Py(e,t.startLineNumber-1);p.languageId===r.languageId&&(c=p.getLineContent())}const u=o.onEnter(i,c,a,l);if(!u)return null;const d=u.indentAction;let h=u.appendText;const f=u.removeText||0;h?d===qr.Indent&&(h=" "+h):d===qr.Indent||d===qr.IndentOutdent?h=" ":h="";let g=Ame(e,t.startLineNumber,t.startColumn);return f&&(g=g.substring(0,g.length-f)),{indentAction:d,appendText:h,removeText:f,indentation:g}}var AHe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},PHe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},CM;const T6=Object.create(null);function Z_(i,e){if(e<=0)return"";T6[i]||(T6[i]=["",i]);const t=T6[i];for(let n=t.length;n<=e;n++)t[n]=t[n-1]+i;return t[e]}let jc=CM=class{static unshiftIndent(e,t,n,r,o){const s=go.visibleColumnFromColumn(e,t,n);if(o){const a=Z_(" ",r),c=go.prevIndentTabStop(s,r)/r;return Z_(a,c)}else{const a=" ",c=go.prevRenderTabStop(s,n)/n;return Z_(a,c)}}static shiftIndent(e,t,n,r,o){const s=go.visibleColumnFromColumn(e,t,n);if(o){const a=Z_(" ",r),c=go.nextIndentTabStop(s,r)/r;return Z_(a,c)}else{const a=" ",c=go.nextRenderTabStop(s,n)/n;return Z_(a,c)}}constructor(e,t,n){this._languageConfigurationService=n,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,t,n){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,n):e.addEditOperation(t,n)}getEditOperations(e,t){const n=this._selection.startLineNumber;let r=this._selection.endLineNumber;this._selection.endColumn===1&&n!==r&&(r=r-1);const{tabSize:o,indentSize:s,insertSpaces:a}=this._opts,l=n===r;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(n))&&(this._useLastEditRangeForCursorEndPosition=!0);let c=0,u=0;for(let d=n;d<=r;d++,c=u){u=0;const h=e.getLineContent(d);let f=Ys(h);if(this._opts.isUnshift&&(h.length===0||f===0)||!l&&!this._opts.isUnshift&&h.length===0)continue;if(f===-1&&(f=h.length),d>1&&go.visibleColumnFromColumn(h,f+1,o)%s!==0&&e.tokenization.isCheapToTokenize(d-1)){const v=Hy(this._opts.autoIndent,e,new B(d-1,e.getLineMaxColumn(d-1),d-1,e.getLineMaxColumn(d-1)),this._languageConfigurationService);if(v){if(u=c,v.appendText)for(let m=0,_=v.appendText.length;m<_&&u1){let r,o=-1;for(r=e-1;r>=1;r--){if(i.tokenization.getLanguageIdAtPosition(r,0)!==n)return o;const s=i.getLineContent(r);if(t.shouldIgnore(s)||/^\s+$/.test(s)||s===""){o=r;continue}return r}}return-1}function W4(i,e,t,n=!0,r){if(i<4)return null;const o=r.getLanguageConfiguration(e.tokenization.getLanguageId()).indentRulesSupport;if(!o)return null;if(t<=1)return{indentation:"",action:null};for(let l=t-1;l>0&&e.getLineContent(l)==="";l--)if(l===1)return{indentation:"",action:null};const s=BHe(e,t,o);if(s<0)return null;if(s<1)return{indentation:"",action:null};const a=e.getLineContent(s);if(o.shouldIncrease(a)||o.shouldIndentNextLine(a))return{indentation:bi(a),action:qr.Indent,line:s};if(o.shouldDecrease(a))return{indentation:bi(a),action:null,line:s};{if(s===1)return{indentation:bi(e.getLineContent(s)),action:null,line:s};const l=s-1,c=o.getIndentMetadata(e.getLineContent(l));if(!(c&3)&&c&4){let u=0;for(let d=l-1;d>0;d--)if(!o.shouldIndentNextLine(e.getLineContent(d))){u=d;break}return{indentation:bi(e.getLineContent(u+1)),action:null,line:u+1}}if(n)return{indentation:bi(e.getLineContent(s)),action:null,line:s};for(let u=s;u>0;u--){const d=e.getLineContent(u);if(o.shouldIncrease(d))return{indentation:bi(d),action:qr.Indent,line:u};if(o.shouldIndentNextLine(d)){let h=0;for(let f=u-1;f>0;f--)if(!o.shouldIndentNextLine(e.getLineContent(u))){h=f;break}return{indentation:bi(e.getLineContent(h+1)),action:null,line:h+1}}else if(o.shouldDecrease(d))return{indentation:bi(d),action:null,line:u}}return{indentation:bi(e.getLineContent(1)),action:null,line:1}}}function gE(i,e,t,n,r,o){if(i<4)return null;const s=o.getLanguageConfiguration(t);if(!s)return null;const a=o.getLanguageConfiguration(t).indentRulesSupport;if(!a)return null;const l=W4(i,e,n,void 0,o),c=e.getLineContent(n);if(l){const u=l.line;if(u!==void 0){let d=!0;for(let h=u;h0&&o.getLanguageId(0)!==s.languageId?(l=!0,c=a.substr(0,t.startColumn-1-s.firstCharOffset)):c=o.getLineContent().substring(0,t.startColumn-1);let u;t.isEmpty()?u=a.substr(t.startColumn-1-s.firstCharOffset):u=Py(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-s.firstCharOffset);const d=r.getLanguageConfiguration(s.languageId).indentRulesSupport;if(!d)return null;const h=c,f=bi(c),g={tokenization:{getLineTokens:_=>e.tokenization.getLineTokens(_),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(_,y)=>e.getLanguageIdAtPosition(_,y)},getLineContent:_=>_===t.startLineNumber?h:e.getLineContent(_)},p=bi(o.getLineContent()),v=W4(i,g,t.startLineNumber+1,void 0,r);if(!v){const _=l?p:f;return{beforeEnter:_,afterEnter:_}}let m=l?p:v.indentation;return v.action===qr.Indent&&(m=n.shiftIndent(m)),d.shouldDecrease(u)&&(m=n.unshiftIndent(m)),{beforeEnter:l?p:f,afterEnter:m}}function $He(i,e,t,n,r,o){if(i<4)return null;const s=Py(e,t.startLineNumber,t.startColumn);if(s.firstCharOffset)return null;const a=o.getLanguageConfiguration(s.languageId).indentRulesSupport;if(!a)return null;const l=s.getLineContent(),c=l.substr(0,t.startColumn-1-s.firstCharOffset);let u;if(t.isEmpty()?u=l.substr(t.startColumn-1-s.firstCharOffset):u=Py(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-s.firstCharOffset),!a.shouldDecrease(c+u)&&a.shouldDecrease(c+n+u)){const d=W4(i,e,t.startLineNumber,!1,o);if(!d)return null;let h=d.indentation;return d.action!==qr.Indent&&(h=r.unshiftIndent(h)),h}return null}function Ive(i,e,t){const n=t.getLanguageConfiguration(i.getLanguageId()).indentRulesSupport;return!n||e<1||e>i.getLineCount()?null:n.getIndentMetadata(i.getLineContent(e))}class rr{static indent(e,t,n){if(t===null||n===null)return[];const r=[];for(let o=0,s=n.length;o1){let a;for(a=n-1;a>=1;a--){const u=t.getLineContent(a);if(th(u)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),c=Hy(e.autoIndent,t,new B(a,l,a,l),e.languageConfigurationService);c&&(o=c.indentation+c.appendText)}return r&&(r===qr.Indent&&(o=rr.shiftIndent(e,o)),r===qr.Outdent&&(o=rr.unshiftIndent(e,o)),o=e.normalizeIndentation(o)),o||null}static _replaceJumpToNextIndent(e,t,n,r){let o="";const s=n.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,s),l=e.indentSize,c=l-a%l;for(let u=0;uthis._compositionType(n,u,o,s,a,l));return new za(4,c,{shouldPushStackElementBefore:vR(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,n,r,o,s){if(!t.isEmpty())return null;const a=t.getPosition(),l=Math.max(1,a.column-r),c=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+o),u=new B(a.lineNumber,l,a.lineNumber,c);return e.getValueInRange(u)===n&&s===0?null:new bM(u,n,0,s)}static _typeCommand(e,t,n){return n?new pR(e,t,!0):new os(e,t,!0)}static _enter(e,t,n,r){if(e.autoIndent===0)return rr._typeCommand(r,` `,n);if(!t.tokenization.isCheapToTokenize(r.getStartPosition().lineNumber)||e.autoIndent===1){const l=t.getLineContent(r.startLineNumber),c=bi(l).substring(0,r.startColumn-1);return rr._typeCommand(r,` `+e.normalizeIndentation(c),n)}const o=Hy(e.autoIndent,t,r,e.languageConfigurationService);if(o){if(o.indentAction===qr.None)return rr._typeCommand(r,` @@ -158,45 +158,45 @@ Received: '{1}'.`,e,w0.getLexeme(t)),o=t.offset,s=w0.getLexeme(t);return this._p `+e.normalizeIndentation(l+o.appendText),n)}}const s=t.getLineContent(r.startLineNumber),a=bi(s).substring(0,r.startColumn-1);if(e.autoIndent>=4){const l=WHe(e.autoIndent,t,r,{unshiftIndent:c=>rr.unshiftIndent(e,c),shiftIndent:c=>rr.shiftIndent(e,c),normalizeIndentation:c=>e.normalizeIndentation(c)},e.languageConfigurationService);if(l){let c=e.visibleColumnFromColumn(t,r.getEndPosition());const u=r.endColumn,d=t.getLineContent(r.endLineNumber),h=Ys(d);if(h>=0?r=r.setEndPosition(r.endLineNumber,Math.max(r.endColumn,h+1)):r=r.setEndPosition(r.endLineNumber,t.getLineMaxColumn(r.endLineNumber)),n)return new pR(r,` `+e.normalizeIndentation(l.afterEnter),!0);{let f=0;return u<=h+1&&(e.insertSpaces||(c=Math.ceil(c/e.indentSize)),f=Math.min(c+1-e.normalizeIndentation(l.afterEnter).length-1,0)),new bM(r,` `+e.normalizeIndentation(l.afterEnter),0,f,!0)}}}return rr._typeCommand(r,` -`+e.normalizeIndentation(a),n)}static _isAutoIndentType(e,t,n){if(e.autoIndent<4)return!1;for(let r=0,o=n.length;rrr.shiftIndent(e,a),unshiftIndent:a=>rr.unshiftIndent(e,a)},e.languageConfigurationService);if(s===null)return null;if(s!==e.normalizeIndentation(o)){const a=t.getLineFirstNonWhitespaceColumn(n.startLineNumber);return a===0?rr._typeCommand(new B(n.startLineNumber,1,n.endLineNumber,n.endColumn),e.normalizeIndentation(s)+r,!1):rr._typeCommand(new B(n.startLineNumber,1,n.endLineNumber,n.endColumn),e.normalizeIndentation(s)+t.getLineContent(n.startLineNumber).substring(a-1,n.startColumn-1)+r,!1)}return null}static _isAutoClosingOvertype(e,t,n,r,o){if(e.autoClosingOvertype==="never"||!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(o))return!1;for(let s=0,a=n.length;s2?u.charCodeAt(c.column-2):0)===92&&h)return!1;if(e.autoClosingOvertype==="auto"){let g=!1;for(let p=0,v=r.length;pt.startsWith(l.open)),a=o.some(l=>t.startsWith(l.close));return!s&&a}static _findAutoClosingPairOpen(e,t,n,r){const o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(r);if(!o)return null;let s=null;for(const a of o)if(s===null||a.open.length>s.open.length){let l=!0;for(const c of n)if(t.getValueInRange(new B(c.lineNumber,c.column-a.open.length+1,c.lineNumber,c.column))+r!==a.open){l=!1;break}l&&(s=a)}return s}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const n=t.close.charAt(t.close.length-1),r=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(n)||[];let o=null;for(const s of r)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,n,r,o){for(const g of n)if(!g.isEmpty())return null;const s=n.map(g=>{const p=g.getPosition();return o?{lineNumber:p.lineNumber,beforeColumn:p.column-r.length,afterColumn:p.column}:{lineNumber:p.lineNumber,beforeColumn:p.column,afterColumn:p.column}}),a=this._findAutoClosingPairOpen(e,t,s.map(g=>new ae(g.lineNumber,g.beforeColumn)),r);if(!a)return null;let l,c;if(_m(r)?(l=e.autoClosingQuotes,c=e.shouldAutoCloseBefore.quote):(e.blockCommentStartToken?a.open.includes(e.blockCommentStartToken):!1)?(l=e.autoClosingComments,c=e.shouldAutoCloseBefore.comment):(l=e.autoClosingBrackets,c=e.shouldAutoCloseBefore.bracket),l==="never")return null;const d=this._findContainedAutoClosingPair(e,a),h=d?d.close:"";let f=!0;for(const g of s){const{lineNumber:p,beforeColumn:v,afterColumn:m}=g,_=t.getLineContent(p),y=_.substring(0,v-1),S=_.substring(m-1);if(S.startsWith(h)||(f=!1),S.length>0){const k=S.charAt(0);if(!rr._isBeforeClosingBrace(e,S)&&!c(k))return null}if(a.open.length===1&&(r==="'"||r==='"')&&l!=="always"){const k=ou(e.wordSeparators);if(y.length>0){const T=y.charCodeAt(y.length-1);if(k.get(T)===0)return null}}if(!t.tokenization.isCheapToTokenize(p))return null;t.tokenization.forceTokenization(p);const L=t.tokenization.getLineTokens(p),E=L4(L,v-1);if(!a.shouldAutoClose(E,v-E.firstCharOffset))return null;const D=a.findNeutralCharacter();if(D){const k=t.tokenization.getTokenTypeIfInsertingCharacter(p,v,D);if(!a.isOK(k))return null}}return f?a.close.substring(0,a.close.length-h.length):a.close}static _runAutoClosingOpenCharType(e,t,n,r,o,s,a){const l=[];for(let c=0,u=r.length;cnew os(new B(h.positionLineNumber,h.positionColumn,h.positionLineNumber,h.positionColumn+1),"",!1));return new za(4,d,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const u=this._getAutoClosingPairClose(t,n,o,l,!0);return u!==null?this._runAutoClosingOpenCharType(e,t,n,o,l,!0,u):null}static typeWithInterceptors(e,t,n,r,o,s,a){if(!e&&a===` +`+e.normalizeIndentation(a),n)}static _isAutoIndentType(e,t,n){if(e.autoIndent<4)return!1;for(let r=0,o=n.length;rrr.shiftIndent(e,a),unshiftIndent:a=>rr.unshiftIndent(e,a)},e.languageConfigurationService);if(s===null)return null;if(s!==e.normalizeIndentation(o)){const a=t.getLineFirstNonWhitespaceColumn(n.startLineNumber);return a===0?rr._typeCommand(new B(n.startLineNumber,1,n.endLineNumber,n.endColumn),e.normalizeIndentation(s)+r,!1):rr._typeCommand(new B(n.startLineNumber,1,n.endLineNumber,n.endColumn),e.normalizeIndentation(s)+t.getLineContent(n.startLineNumber).substring(a-1,n.startColumn-1)+r,!1)}return null}static _isAutoClosingOvertype(e,t,n,r,o){if(e.autoClosingOvertype==="never"||!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(o))return!1;for(let s=0,a=n.length;s2?u.charCodeAt(c.column-2):0)===92&&h)return!1;if(e.autoClosingOvertype==="auto"){let g=!1;for(let p=0,v=r.length;pt.startsWith(l.open)),a=o.some(l=>t.startsWith(l.close));return!s&&a}static _findAutoClosingPairOpen(e,t,n,r){const o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(r);if(!o)return null;let s=null;for(const a of o)if(s===null||a.open.length>s.open.length){let l=!0;for(const c of n)if(t.getValueInRange(new B(c.lineNumber,c.column-a.open.length+1,c.lineNumber,c.column))+r!==a.open){l=!1;break}l&&(s=a)}return s}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const n=t.close.charAt(t.close.length-1),r=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(n)||[];let o=null;for(const s of r)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,n,r,o){for(const g of n)if(!g.isEmpty())return null;const s=n.map(g=>{const p=g.getPosition();return o?{lineNumber:p.lineNumber,beforeColumn:p.column-r.length,afterColumn:p.column}:{lineNumber:p.lineNumber,beforeColumn:p.column,afterColumn:p.column}}),a=this._findAutoClosingPairOpen(e,t,s.map(g=>new ae(g.lineNumber,g.beforeColumn)),r);if(!a)return null;let l,c;if(bm(r)?(l=e.autoClosingQuotes,c=e.shouldAutoCloseBefore.quote):(e.blockCommentStartToken?a.open.includes(e.blockCommentStartToken):!1)?(l=e.autoClosingComments,c=e.shouldAutoCloseBefore.comment):(l=e.autoClosingBrackets,c=e.shouldAutoCloseBefore.bracket),l==="never")return null;const d=this._findContainedAutoClosingPair(e,a),h=d?d.close:"";let f=!0;for(const g of s){const{lineNumber:p,beforeColumn:v,afterColumn:m}=g,_=t.getLineContent(p),y=_.substring(0,v-1),S=_.substring(m-1);if(S.startsWith(h)||(f=!1),S.length>0){const k=S.charAt(0);if(!rr._isBeforeClosingBrace(e,S)&&!c(k))return null}if(a.open.length===1&&(r==="'"||r==='"')&&l!=="always"){const k=ou(e.wordSeparators);if(y.length>0){const T=y.charCodeAt(y.length-1);if(k.get(T)===0)return null}}if(!t.tokenization.isCheapToTokenize(p))return null;t.tokenization.forceTokenization(p);const L=t.tokenization.getLineTokens(p),E=L4(L,v-1);if(!a.shouldAutoClose(E,v-E.firstCharOffset))return null;const D=a.findNeutralCharacter();if(D){const k=t.tokenization.getTokenTypeIfInsertingCharacter(p,v,D);if(!a.isOK(k))return null}}return f?a.close.substring(0,a.close.length-h.length):a.close}static _runAutoClosingOpenCharType(e,t,n,r,o,s,a){const l=[];for(let c=0,u=r.length;cnew os(new B(h.positionLineNumber,h.positionColumn,h.positionLineNumber,h.positionColumn+1),"",!1));return new za(4,d,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const u=this._getAutoClosingPairClose(t,n,o,l,!0);return u!==null?this._runAutoClosingOpenCharType(e,t,n,o,l,!0,u):null}static typeWithInterceptors(e,t,n,r,o,s,a){if(!e&&a===` `){const u=[];for(let d=0,h=o.length;d{const r=t.get(Un).getFocusedCodeEditor();return r&&r.hasTextFocus()?this._runEditorCommand(t,r,n):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,n)=>{const r=fs();return r&&["input","textarea"].indexOf(r.tagName.toLowerCase())>=0?(this.runDOMCommand(r),!0):!1}),e.addImplementation(0,"generic-dom",(t,n)=>{const r=t.get(Un).getActiveCodeEditor();return r?(r.focus(),this._runEditorCommand(t,r,n)):!1})}_runEditorCommand(e,t,n){const r=this.runEditorCommand(e,t,n);return r||!0}}var Ao;(function(i){class e extends vr{constructor(_){super(_),this._inSelectionMode=_.inSelectionMode}runCoreEditorCommand(_,y){if(!y.position)return;_.model.pushStackElement(),_.setCursorStates(y.source,3,[Go.moveTo(_,_.getPrimaryCursorState(),this._inSelectionMode,y.position,y.viewPosition)])&&y.revealType!==2&&_.revealPrimaryCursor(y.source,!0,!0)}}i.MoveTo=et(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),i.MoveToSelect=et(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends vr{runCoreEditorCommand(_,y){_.model.pushStackElement();const S=this._getColumnSelectResult(_,_.getPrimaryCursorState(),_.getCursorColumnSelectData(),y);S!==null&&(_.setCursorStates(y.source,3,S.viewStates.map(L=>Wn.fromViewState(L))),_.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:S.fromLineNumber,fromViewVisualColumn:S.fromVisualColumn,toViewLineNumber:S.toLineNumber,toViewVisualColumn:S.toVisualColumn}),S.reversed?_.revealTopMostCursor(y.source):_.revealBottomMostCursor(y.source))}}i.ColumnSelect=et(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(m,_,y,S){if(typeof S.position>"u"||typeof S.viewPosition>"u"||typeof S.mouseColumn>"u")return null;const L=m.model.validatePosition(S.position),E=m.coordinatesConverter.validateViewPosition(new ae(S.viewPosition.lineNumber,S.viewPosition.column),L),D=S.doColumnSelect?y.fromViewLineNumber:E.lineNumber,k=S.doColumnSelect?y.fromViewVisualColumn:S.mouseColumn-1;return D0.columnSelect(m.cursorConfig,m,D,k,E.lineNumber,S.mouseColumn-1)}}),i.CursorColumnSelectLeft=et(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(m,_,y,S){return D0.columnSelectLeft(m.cursorConfig,m,y)}}),i.CursorColumnSelectRight=et(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(m,_,y,S){return D0.columnSelectRight(m.cursorConfig,m,y)}});class n extends t{constructor(_){super(_),this._isPaged=_.isPaged}_getColumnSelectResult(_,y,S,L){return D0.columnSelectUp(_.cursorConfig,_,S,this._isPaged)}}i.CursorColumnSelectUp=et(new n({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:3600,linux:{primary:0}}})),i.CursorColumnSelectPageUp=et(new n({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:3595,linux:{primary:0}}}));class r extends t{constructor(_){super(_),this._isPaged=_.isPaged}_getColumnSelectResult(_,y,S,L){return D0.columnSelectDown(_.cursorConfig,_,S,this._isPaged)}}i.CursorColumnSelectDown=et(new r({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:3602,linux:{primary:0}}})),i.CursorColumnSelectPageDown=et(new r({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:3596,linux:{primary:0}}}));class o extends vr{constructor(){super({id:"cursorMove",precondition:void 0,metadata:uP.metadata})}runCoreEditorCommand(_,y){const S=uP.parse(y);S&&this._runCursorMove(_,y.source,S)}_runCursorMove(_,y,S){_.model.pushStackElement(),_.setCursorStates(y,3,o._move(_,_.getCursorStates(),S)),_.revealPrimaryCursor(y,!0)}static _move(_,y,S){const L=S.select,E=S.value;switch(S.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return Go.simpleMove(_,y,S.direction,L,E,S.unit);case 11:case 13:case 12:case 14:return Go.viewportMove(_,y,S.direction,L,E);default:return null}}}i.CursorMoveImpl=o,i.CursorMove=et(new o);class s extends vr{constructor(_){super(_),this._staticArgs=_.args}runCoreEditorCommand(_,y){let S=this._staticArgs;this._staticArgs.value===-1&&(S={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:y.pageSize||_.cursorConfig.pageSize}),_.model.pushStackElement(),_.setCursorStates(y.source,3,Go.simpleMove(_,_.getCursorStates(),S.direction,S.select,S.value,S.unit)),_.revealPrimaryCursor(y.source,!0)}}i.CursorLeft=et(new s({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),i.CursorLeftSelect=et(new s({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:1039}})),i.CursorRight=et(new s({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),i.CursorRightSelect=et(new s({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:1041}})),i.CursorUp=et(new s({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),i.CursorUpSelect=et(new s({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),i.CursorPageUp=et(new s({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:11}})),i.CursorPageUpSelect=et(new s({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:1035}})),i.CursorDown=et(new s({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),i.CursorDownSelect=et(new s({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),i.CursorPageDown=et(new s({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:12}})),i.CursorPageDownSelect=et(new s({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:1036}})),i.CreateCursor=et(new class extends vr{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(m,_){if(!_.position)return;let y;_.wholeLine?y=Go.line(m,m.getPrimaryCursorState(),!1,_.position,_.viewPosition):y=Go.moveTo(m,m.getPrimaryCursorState(),!1,_.position,_.viewPosition);const S=m.getCursorStates();if(S.length>1){const L=y.modelState?y.modelState.position:null,E=y.viewState?y.viewState.position:null;for(let D=0,k=S.length;DE&&(L=E);const D=new B(L,1,L,m.model.getLineMaxColumn(L));let k=0;if(y.at)switch(y.at){case hy.RawAtArgument.Top:k=3;break;case hy.RawAtArgument.Center:k=1;break;case hy.RawAtArgument.Bottom:k=4;break}const T=m.coordinatesConverter.convertModelRangeToViewRange(D);m.revealRange(_.source,!1,T,k,0)}}),i.SelectAll=new class extends OH{constructor(){super(K8e)}runDOMCommand(m){ru&&(m.focus(),m.select()),m.ownerDocument.execCommand("selectAll")}runEditorCommand(m,_,y){const S=_._getViewModel();S&&this.runCoreEditorCommand(S,y)}runCoreEditorCommand(m,_){m.model.pushStackElement(),m.setCursorStates("keyboard",3,[Go.selectAll(m,m.getPrimaryCursorState())])}},i.SetSelection=et(new class extends vr{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(m,_){_.selection&&(m.model.pushStackElement(),m.setCursorStates(_.source,3,[Wn.fromModelSelection(_.selection)]))}})})(Ao||(Ao={}));const VHe=De.and(j.textInputFocus,j.columnSelection);function NS(i,e){nl.registerKeybindingRule({id:i,primary:e,when:VHe,weight:qn+1})}NS(Ao.CursorColumnSelectLeft.id,1039);NS(Ao.CursorColumnSelectRight.id,1041);NS(Ao.CursorColumnSelectUp.id,1040);NS(Ao.CursorColumnSelectPageUp.id,1035);NS(Ao.CursorColumnSelectDown.id,1042);NS(Ao.CursorColumnSelectPageDown.id,1036);function xre(i){return i.register(),i}var Vy;(function(i){class e extends Vo{runEditorCommand(n,r,o){const s=r._getViewModel();s&&this.runCoreEditingCommand(r,s,o||{})}}i.CoreEditingCommand=e,i.LineBreakInsert=et(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:j.writable,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(t,n,r){t.pushUndoStop(),t.executeCommands(this.id,rr.lineBreakInsert(n.cursorConfig,n.model,n.getCursorStates().map(o=>o.modelState.selection)))}}),i.Outdent=et(new class extends e{constructor(){super({id:"outdent",precondition:j.writable,kbOpts:{weight:qn,kbExpr:De.and(j.editorTextFocus,j.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(t,n,r){t.pushUndoStop(),t.executeCommands(this.id,rr.outdent(n.cursorConfig,n.model,n.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),i.Tab=et(new class extends e{constructor(){super({id:"tab",precondition:j.writable,kbOpts:{weight:qn,kbExpr:De.and(j.editorTextFocus,j.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(t,n,r){t.pushUndoStop(),t.executeCommands(this.id,rr.tab(n.cursorConfig,n.model,n.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),i.DeleteLeft=et(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(t,n,r){const[o,s]=Mb.deleteLeft(n.getPrevEditOperationType(),n.cursorConfig,n.model,n.getCursorStates().map(a=>a.modelState.selection),n.getCursorAutoClosedCharacters());o&&t.pushUndoStop(),t.executeCommands(this.id,s),n.setPrevEditOperationType(2)}}),i.DeleteRight=et(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(t,n,r){const[o,s]=Mb.deleteRight(n.getPrevEditOperationType(),n.cursorConfig,n.model,n.getCursorStates().map(a=>a.modelState.selection));o&&t.pushUndoStop(),t.executeCommands(this.id,s),n.setPrevEditOperationType(3)}}),i.Undo=new class extends OH{constructor(){super(yme)}runDOMCommand(t){t.ownerDocument.execCommand("undo")}runEditorCommand(t,n,r){if(!(!n.hasModel()||n.getOption(91)===!0))return n.getModel().undo()}},i.Redo=new class extends OH{constructor(){super(wme)}runDOMCommand(t){t.ownerDocument.execCommand("redo")}runEditorCommand(t,n,r){if(!(!n.hasModel()||n.getOption(91)===!0))return n.getModel().redo()}}})(Vy||(Vy={}));class Lre extends S4{constructor(e,t,n){super({id:e,precondition:void 0,metadata:n}),this._handlerId=t}runCommand(e,t){const n=e.get(Un).getFocusedCodeEditor();n&&n.trigger("keyboard",this._handlerId,t)}}function gC(i,e){xre(new Lre("default:"+i,i)),xre(new Lre(i,i,e))}gC("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});gC("replacePreviousChar");gC("compositionType");gC("compositionStart");gC("compositionEnd");gC("paste");gC("cut");class zHe{constructor(e,t,n,r){this.configuration=e,this.viewModel=t,this.userInputEvents=n,this.commandDelegate=r}paste(e,t,n,r){this.commandDelegate.paste(e,t,n,r)}type(e){this.commandDelegate.type(e)}compositionType(e,t,n,r){this.commandDelegate.compositionType(e,t,n,r)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){Ao.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column=4?this._selectAll():e.mouseDownCount===3?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position,e.revealType):this._lastCursorLineSelect(e.position,e.revealType):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):e.mouseDownCount===2?e.onInjectedText||(this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position,e.revealType):e.inSelectionMode?this._wordSelectDrag(e.position,e.revealType):this._wordSelect(e.position,e.revealType)):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position,e.revealType):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey?this._columnSelect(e.position,e.mouseColumn,!0):r?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position,e.revealType):this.moveTo(e.position,e.revealType)}_usualArgs(e,t){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,revealType:t}}moveTo(e,t){Ao.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){Ao.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,n){e=this._validateViewColumn(e),Ao.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:n})}_createCursor(e,t){e=this._validateViewColumn(e),Ao.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){Ao.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){Ao.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){Ao.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){Ao.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){Ao.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){Ao.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){Ao.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){Ao.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){Ao.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 Tve{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 qi("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(this.getCount()===0)return null;const n=this.getStartLineNumber(),r=this.getEndLineNumber();if(tr)return null;let o=0,s=0;for(let l=n;l<=r;l++){const c=l-this._rendLineNumberStart;e<=l&&l<=t&&(s===0?(o=c,s=1):s++)}if(e=r&&a<=o&&(this._lines[a-this._rendLineNumberStart].onContentChanged(),s=!0);return s}onLinesInserted(e,t){if(this.getCount()===0)return null;const n=t-e+1,r=this.getStartLineNumber(),o=this.getEndLineNumber();if(e<=r)return this._rendLineNumberStart+=n,null;if(e>o)return null;if(n+e>o)return this._lines.splice(e-this._rendLineNumberStart,o-e+1);const s=[];for(let d=0;dn)continue;const l=Math.max(t,a.fromLineNumber),c=Math.min(n,a.toLineNumber);for(let u=l;u<=c;u++){const d=u-this._rendLineNumberStart;this._lines[d].onTokensChanged(),r=!0}}return r}}class Nve{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new Tve(()=>this._host.createVisibleLine())}_createDomNode(){const e=Qn(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(144)}onFlushed(e){return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){const t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let n=0,r=t.length;nt){const s=t,a=Math.min(n,o.rendLineNumberStart-1);s<=a&&(this._insertLinesBefore(o,s,a,r,t),o.linesLength+=a-s+1)}else if(o.rendLineNumberStart0&&(this._removeLinesBefore(o,s),o.linesLength-=s)}if(o.rendLineNumberStart=t,o.rendLineNumberStart+o.linesLength-1n){const s=Math.max(0,n-o.rendLineNumberStart+1),l=o.linesLength-1-s+1;l>0&&(this._removeLinesAfter(o,l),o.linesLength-=l)}return this._finishRendering(o,!1,r),o}_renderUntouchedLines(e,t,n,r,o){const s=e.rendLineNumberStart,a=e.lines;for(let l=t;l<=n;l++){const c=s+l;a[l].layoutLine(c,r[c-o])}}_insertLinesBefore(e,t,n,r,o){const s=[];let a=0;for(let l=t;l<=n;l++)s[a++]=this.host.createVisibleLine();e.lines=s.concat(e.lines)}_removeLinesBefore(e,t){for(let n=0;n=0;a--){const l=e.lines[a];r[a]&&(l.setDomNode(s),s=s.previousSibling)}}_finishRenderingInvalidLines(e,t,n){const r=document.createElement("div");Hg._ttPolicy&&(t=Hg._ttPolicy.createHTML(t)),r.innerHTML=t;for(let o=0;oi});Hg._sb=new DS(1e5);class Rve extends Pl{constructor(e){super(e),this._visibleLines=new Nve(this),this.domNode=this._visibleLines.domNode;const n=this._context.configuration.options.get(50);ps(this.domNode,n),this._dynamicOverlays=[],this._isFocused=!1,this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;en.shouldRender());for(let n=0,r=t.length;n'),r.appendString(o),r.appendString(""),!0)}layoutLine(e,t){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(this._lineHeight))}}class jHe extends Rve{constructor(e){super(e);const n=this._context.configuration.options.get(144);this._contentWidth=n.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const n=this._context.configuration.options.get(144);return this._contentWidth=n.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 KHe extends Rve{constructor(e){super(e);const t=this._context.configuration.options,n=t.get(144);this._contentLeft=n.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),ps(this.domNode,t.get(50))}onConfigurationChanged(e){const t=this._context.configuration.options;ps(this.domNode,t.get(50));const n=t.get(144);return this._contentLeft=n.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 $4{constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseDropCanceled=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){var t;(t=this.onKeyDown)===null||t===void 0||t.call(this,e)}emitKeyUp(e){var t;(t=this.onKeyUp)===null||t===void 0||t.call(this,e)}emitContextMenu(e){var t;(t=this.onContextMenu)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseMove(e){var t;(t=this.onMouseMove)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){var t;(t=this.onMouseLeave)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDown(e){var t;(t=this.onMouseDown)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseUp(e){var t;(t=this.onMouseUp)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){var t;(t=this.onMouseDrag)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){var t;(t=this.onMouseDrop)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){var e;(e=this.onMouseDropCanceled)===null||e===void 0||e.call(this)}emitMouseWheel(e){var t;(t=this.onMouseWheel)===null||t===void 0||t.call(this,e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return $4.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){const n={...e};return n.position&&(n.position=t.convertViewPositionToModelPosition(n.position)),n.range&&(n.range=t.convertViewRangeToModelRange(n.range)),(n.type===5||n.type===8)&&(n.detail=this.convertViewToModelViewZoneData(n.detail,t)),n}static convertViewToModelViewZoneData(e,t){return{viewZoneId:e.viewZoneId,positionBefore:e.positionBefore?t.convertViewPositionToModelPosition(e.positionBefore):e.positionBefore,positionAfter:e.positionAfter?t.convertViewPositionToModelPosition(e.positionAfter):e.positionAfter,position:t.convertViewPositionToModelPosition(e.position),afterLineNumber:t.convertViewPositionToModelPosition(new ae(e.afterLineNumber,1)).lineNumber}}}class GHe extends Pl{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.contentLeft=0,this.domNode=Qn(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("blockDecorations-container"),this.update()}update(){let e=!1;const n=this._context.configuration.options.get(144),r=n.contentWidth-n.verticalScrollbarWidth;this.contentWidth!==r&&(this.contentWidth=r,e=!0);const o=n.contentLeft;return this.contentLeft!==o&&(this.contentLeft=o,e=!0),e}dispose(){super.dispose()}onConfigurationChanged(e){return this.update()}onScrollChanged(e){return e.scrollTopChanged||e.scrollLeftChanged}onDecorationsChanged(e){return!0}onZonesChanged(e){return!0}prepareRender(e){}render(e){var t;let n=0;const r=e.getDecorationsInViewport();for(const o of r){if(!o.options.blockClassName)continue;let s=this.blocks[n];s||(s=this.blocks[n]=Qn(document.createElement("div")),this.domNode.appendChild(s));let a,l;o.options.blockIsAfterEnd?(a=e.getVerticalOffsetAfterLineNumber(o.range.endLineNumber,!1),l=e.getVerticalOffsetAfterLineNumber(o.range.endLineNumber,!0)):(a=e.getVerticalOffsetForLineNumber(o.range.startLineNumber,!0),l=o.range.isEmpty()&&!o.options.blockDoesNotCollapse?e.getVerticalOffsetForLineNumber(o.range.startLineNumber,!1):e.getVerticalOffsetAfterLineNumber(o.range.endLineNumber,!0));const[c,u,d,h]=(t=o.options.blockPadding)!==null&&t!==void 0?t:[0,0,0,0];s.setClassName("blockDecorations-block "+o.options.blockClassName),s.setLeft(this.contentLeft-h),s.setWidth(this.contentWidth+h+u),s.setTop(a-e.scrollTop-c),s.setHeight(l-a+c+d),n++}for(let o=n;o0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,n,r){const o=e.top,s=o,a=e.top+e.height,l=r.viewportHeight-a,c=o-n,u=s>=n,d=a,h=l>=n;let f=e.left;return f+t>r.scrollLeft+r.viewportWidth&&(f=r.scrollLeft+r.viewportWidth-t),fc){const f=h-(c-r);h-=f,n-=f}if(h=m,S=f+n<=g.height-_;return this._fixedOverflowWidgets?{fitsAbove:y,aboveTop:Math.max(h,m),fitsBelow:S,belowTop:f,left:v}:{fitsAbove:y,aboveTop:a,fitsBelow:S,belowTop:l,left:p}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new Bx(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){var t,n;const r=a(this._primaryAnchor.viewPosition,this._affinity,this._lineHeight),o=((t=this._secondaryAnchor.viewPosition)===null||t===void 0?void 0:t.lineNumber)===((n=this._primaryAnchor.viewPosition)===null||n===void 0?void 0:n.lineNumber)?this._secondaryAnchor.viewPosition:null,s=a(o,this._affinity,this._lineHeight);return{primary:r,secondary:s};function a(l,c,u){if(!l)return null;const d=e.visibleRangeForPosition(l);if(!d)return null;const h=l.column===1&&c===3?0:d.left,f=e.getVerticalOffsetForLineNumber(l.lineNumber)-e.scrollTop;return new Ere(f,h,u)}}_reduceAnchorCoordinates(e,t,n){if(!t)return e;const r=this._context.configuration.options.get(50);let o=t.left;return oe.endLineNumber||this.domNode.setMaxWidth(this._maxWidth)}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData){this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this.domNode.setVisibility("hidden")),typeof this._actual.afterRender=="function"&&R6(this._actual.afterRender,this._actual,null);return}this.allowEditorOverflow?(this.domNode.setTop(this._renderData.coordinate.top),this.domNode.setLeft(this._renderData.coordinate.left)):(this.domNode.setTop(this._renderData.coordinate.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.coordinate.left)),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"),this._isVisible=!0),typeof this._actual.afterRender=="function"&&R6(this._actual.afterRender,this._actual,this._renderData.position)}}class Fx{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class Bx{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class Ere{constructor(e,t,n){this.top=e,this.left=t,this.height=n,this._anchorCoordinateBrand=void 0}}function R6(i,e,...t){try{return i.call(e,...t)}catch{return null}}class Mve extends fC{constructor(e){super(),this._context=e;const t=this._context.configuration.options,n=t.get(144);this._lineHeight=t.get(67),this._renderLineHighlight=t.get(96),this._renderLineHighlightOnlyWhenFocus=t.get(97),this._wordWrap=n.isViewportWrapping,this._contentLeft=n.contentLeft,this._contentWidth=n.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new yt(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=new Set;for(const o of this._selections)t.add(o.positionLineNumber);const n=Array.from(t);n.sort((o,s)=>o-s),or(this._cursorLineNumbers,n)||(this._cursorLineNumbers=n,e=!0);const r=this._selections.every(o=>o.isEmpty());return this._selectionIsEmpty!==r&&(this._selectionIsEmpty=r,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,n=t.get(144);return this._lineHeight=t.get(67),this._renderLineHighlight=t.get(96),this._renderLineHighlightOnlyWhenFocus=t.get(97),this._wordWrap=n.isViewportWrapping,this._contentLeft=n.contentLeft,this._contentWidth=n.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return this._renderLineHighlightOnlyWhenFocus?(this._focused=e.isFocused,!0):!1}prepareRender(e){if(!this._shouldRenderThis()){this._renderData=null;return}const t=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,r=[];for(let s=t;s<=n;s++){const a=s-t;r[a]=""}if(this._wordWrap){const s=this._renderOne(e,!1);for(const a of this._cursorLineNumbers){const l=this._context.viewModel.coordinatesConverter,c=l.convertViewPositionToModelPosition(new ae(a,1)).lineNumber,u=l.convertModelPositionToViewPosition(new ae(c,1)).lineNumber,d=l.convertModelPositionToViewPosition(new ae(c,this._context.viewModel.model.getLineMaxColumn(c))).lineNumber,h=Math.max(u,t),f=Math.min(d,n);for(let g=h;g<=f;g++){const p=g-t;r[p]=s}}}const o=this._renderOne(e,!0);for(const s of this._cursorLineNumbers){if(sn)continue;const a=s-t;r[a]=o}this._renderData=r}render(e,t){if(!this._renderData)return"";const n=t-e;return n>=this._renderData.length?"":this._renderData[n]}_shouldRenderInMargin(){return(this._renderLineHighlight==="gutter"||this._renderLineHighlight==="all")&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return(this._renderLineHighlight==="line"||this._renderLineHighlight==="all")&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}class YHe extends Mve{_renderOne(e,t){return`
`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class ZHe extends Mve{_renderOne(e,t){return`
`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}fu((i,e)=>{const t=i.getColor(_ve);if(t&&(e.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${t}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${t}; border: none; }`)),!t||t.isTransparent()||i.defines(Cre)){const n=i.getColor(Cre);n&&(e.addRule(`.monaco-editor .view-overlays .current-line-exact { border: 2px solid ${n}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-exact-margin { border: 2px solid ${n}; }`),ih(i.type)&&(e.addRule(".monaco-editor .view-overlays .current-line-exact { border-width: 1px; }"),e.addRule(".monaco-editor .margin-view-overlays .current-line-exact-margin { border-width: 1px; }")))}});class QHe extends fC{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}prepareRender(e){const t=e.getDecorationsInViewport();let n=[],r=0;for(let l=0,c=t.length;l{if(l.options.zIndexc.options.zIndex)return 1;const u=l.options.className,d=c.options.className;return ud?1:B.compareRangesUsingStarts(l.range,c.range)});const o=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,a=[];for(let l=o;l<=s;l++){const c=l-o;a[c]=""}this._renderWholeLineDecorations(e,n,a),this._renderNormalDecorations(e,n,a),this._renderResult=a}_renderWholeLineDecorations(e,t,n){const r=String(this._lineHeight),o=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber;for(let a=0,l=t.length;a',d=Math.max(c.range.startLineNumber,o),h=Math.min(c.range.endLineNumber,s);for(let f=d;f<=h;f++){const g=f-o;n[g]+=u}}}_renderNormalDecorations(e,t,n){var r;const o=String(this._lineHeight),s=e.visibleRange.startLineNumber;let a=null,l=!1,c=null,u=!1;for(let d=0,h=t.length;d';l[f]+=_}}}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}class JHe extends Pl{constructor(e,t,n,r){super(e);const o=this._context.configuration.options,s=o.get(103),a=o.get(75),l=o.get(40),c=o.get(106),u={listenOnDomNode:n.domNode,className:"editor-scrollable "+AH(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:a,fastScrollSensitivity:l,scrollPredominantAxis:c,scrollByPage:s.scrollByPage};this.scrollbar=this._register(new O4(t.domNode,u,this._context.viewLayout.getScrollable())),fh.write(this.scrollbar.getDomNode(),6),this.scrollbarDomNode=Qn(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const d=(h,f,g)=>{const p={};if(f){const v=h.scrollTop;v&&(p.scrollTop=this._context.viewLayout.getCurrentScrollTop()+v,h.scrollTop=0)}if(g){const v=h.scrollLeft;v&&(p.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+v,h.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(p,1)};this._register(ye(n.domNode,"scroll",h=>d(n.domNode,!0,!0))),this._register(ye(t.domNode,"scroll",h=>d(t.domNode,!0,!1))),this._register(ye(r.domNode,"scroll",h=>d(r.domNode,!0,!1))),this._register(ye(this.scrollbarDomNode.domNode,"scroll",h=>d(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(144);this.scrollbarDomNode.setLeft(t.contentLeft),e.get(73).side==="right"?this.scrollbarDomNode.setWidth(t.contentWidth+t.minimap.minimapWidth):this.scrollbarDomNode.setWidth(t.contentWidth),this.scrollbarDomNode.setHeight(t.height)}getOverviewRulerLayoutInfo(){return this.scrollbar.getOverviewRulerLayoutInfo()}getDomNode(){return this.scrollbarDomNode}delegateVerticalScrollbarPointerDown(e){this.scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this.scrollbar.delegateScrollFromMouseWheelEvent(e)}onConfigurationChanged(e){if(e.hasChanged(103)||e.hasChanged(75)||e.hasChanged(40)){const t=this._context.configuration.options,n=t.get(103),r=t.get(75),o=t.get(40),s=t.get(106),a={vertical:n.vertical,horizontal:n.horizontal,verticalScrollbarSize:n.verticalScrollbarSize,horizontalScrollbarSize:n.horizontalScrollbarSize,scrollByPage:n.scrollByPage,handleMouseWheel:n.handleMouseWheel,mouseWheelScrollSensitivity:r,fastScrollSensitivity:o,scrollPredominantAxis:s};this.scrollbar.updateOptions(a)}return e.hasChanged(144)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+AH(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}class FH{constructor(e,t,n,r,o){this.startLineNumber=e,this.endLineNumber=t,this.className=n,this.tooltip=r,this._decorationToRenderBrand=void 0,this.zIndex=o??0}}class eVe{constructor(e,t,n){this.className=e,this.zIndex=t,this.tooltip=n}}class tVe{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class Ave extends fC{_render(e,t,n){const r=[];for(let a=e;a<=t;a++){const l=a-e;r[l]=new tVe}if(n.length===0)return r;n.sort((a,l)=>a.className===l.className?a.startLineNumber===l.startLineNumber?a.endLineNumber-l.endLineNumber:a.startLineNumber-l.startLineNumber:a.classNamer)continue;const c=Math.max(a,n),u=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new ae(c,0)),d=this._context.viewModel.glyphLanes.getLanesAtLine(u.lineNumber).indexOf(o.preference.lane);t.push(new rVe(c,d,o.preference.zIndex,o))}}_collectSortedGlyphRenderRequests(e){const t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort((n,r)=>n.lineNumber===r.lineNumber?n.laneIndex===r.laneIndex?n.zIndex===r.zIndex?r.type===n.type?n.type===0&&r.type===0?n.className0;){const r=t.peek();if(!r)break;const o=t.takeWhile(a=>a.lineNumber===r.lineNumber&&a.laneIndex===r.laneIndex);if(!o||o.length===0)break;const s=o[0];if(s.type===0){const a=[];for(const l of o){if(l.zIndex!==s.zIndex||l.type!==s.type)break;(a.length===0||a[a.length-1]!==l.className)&&a.push(l.className)}n.push(s.accept(a.join(" ")))}else s.widget.renderInfo={lineNumber:s.lineNumber,laneIndex:s.laneIndex}}this._decorationGlyphsToRender=n}render(e){if(!this._glyphMargin){for(const n of Object.values(this._widgets))n.domNode.setDisplay("none");for(;this._managedDomNodes.length>0;){const n=this._managedDomNodes.pop();n==null||n.domNode.remove()}return}const t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(const n of Object.values(this._widgets))if(!n.renderInfo)n.domNode.setDisplay("none");else{const r=e.viewportData.relativeVerticalOffset[n.renderInfo.lineNumber-e.viewportData.startLineNumber],o=this._glyphMarginLeft+n.renderInfo.laneIndex*this._lineHeight;n.domNode.setDisplay("block"),n.domNode.setTop(r),n.domNode.setLeft(o),n.domNode.setWidth(t),n.domNode.setHeight(this._lineHeight)}for(let n=0;nthis._decorationGlyphsToRender.length;){const n=this._managedDomNodes.pop();n==null||n.domNode.remove()}}}class iVe{constructor(e,t,n,r){this.lineNumber=e,this.laneIndex=t,this.zIndex=n,this.className=r,this.type=0}accept(e){return new oVe(this.lineNumber,this.laneIndex,e)}}class rVe{constructor(e,t,n,r){this.lineNumber=e,this.laneIndex=t,this.zIndex=n,this.widget=r,this.type=1}}class oVe{constructor(e,t,n){this.lineNumber=e,this.laneIndex=t,this.combinedClassName=n}}class Pve extends fe{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function H4(i,e){let t=0,n=0;const r=i.length;for(;nr)throw new qi("Illegal value for lineNumber");const o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,s=!!(o&&o.offSide);let a=-2,l=-1,c=-2,u=-1;const d=D=>{if(a!==-1&&(a===-2||a>D-1)){a=-1,l=-1;for(let k=D-2;k>=0;k--){const T=this._computeIndentLevel(k);if(T>=0){a=k,l=T;break}}}if(c===-2){c=-1,u=-1;for(let k=D;k=0){c=k,u=T;break}}}};let h=-2,f=-1,g=-2,p=-1;const v=D=>{if(h===-2){h=-1,f=-1;for(let k=D-2;k>=0;k--){const T=this._computeIndentLevel(k);if(T>=0){h=k,f=T;break}}}if(g!==-1&&(g===-2||g=0){g=k,p=T;break}}}};let m=0,_=!0,y=0,S=!0,L=0,E=0;for(let D=0;_||S;D++){const k=e-D,T=e+D;D>1&&(k<1||k1&&(T>r||T>n)&&(S=!1),D>5e4&&(_=!1,S=!1);let M=-1;if(_&&k>=1){const N=this._computeIndentLevel(k-1);N>=0?(c=k-1,u=N,M=Math.ceil(N/this.textModel.getOptions().indentSize)):(d(k),M=this._getIndentLevelForWhitespaceLine(s,l,u))}let A=-1;if(S&&T<=r){const N=this._computeIndentLevel(T-1);N>=0?(h=T-1,f=N,A=Math.ceil(N/this.textModel.getOptions().indentSize)):(v(T),A=this._getIndentLevelForWhitespaceLine(s,f,p))}if(D===0){E=M;continue}if(D===1){if(T<=r&&A>=0&&E+1===A){_=!1,m=T,y=T,L=A;continue}if(k>=1&&M>=0&&M-1===E){S=!1,m=k,y=k,L=M;continue}if(m=e,y=e,L=E,L===0)return{startLineNumber:m,endLineNumber:y,indent:L}}_&&(M>=L?m=k:_=!1),S&&(A>=L?y=T:S=!1)}return{startLineNumber:m,endLineNumber:y,indent:L}}getLinesBracketGuides(e,t,n,r){var o;const s=[];for(let h=e;h<=t;h++)s.push([]);const a=!0,l=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new B(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let c;if(n&&l.length>0){const h=(e<=n.lineNumber&&n.lineNumber<=t?l:this.textModel.bracketPairs.getBracketPairsInRange(B.fromPositions(n)).toArray()).filter(f=>B.strictContainsPosition(f.range,n));c=(o=RD(h,f=>a))===null||o===void 0?void 0:o.range}const u=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,d=new Ove;for(const h of l){if(!h.closingBracketRange)continue;const f=c&&h.range.equalsRange(c);if(!f&&!r.includeInactive)continue;const g=d.getInlineClassName(h.nestingLevel,h.nestingLevelOfEqualBracketType,u)+(r.highlightActive&&f?" "+d.activeClassName:""),p=h.openingBracketRange.getStartPosition(),v=h.closingBracketRange.getStartPosition(),m=r.horizontalGuides===ob.Enabled||r.horizontalGuides===ob.EnabledForActive&&f;if(h.range.startLineNumber===h.range.endLineNumber){m&&s[h.range.startLineNumber-e].push(new z0(-1,h.openingBracketRange.getEndPosition().column,g,new pE(!1,v.column),-1,-1));continue}const _=this.getVisibleColumnFromPosition(v),y=this.getVisibleColumnFromPosition(h.openingBracketRange.getStartPosition()),S=Math.min(y,_,h.minVisibleColumnIndentation+1);let L=!1;Ys(this.textModel.getLineContent(h.closingBracketRange.startLineNumber))=e&&y>S&&s[p.lineNumber-e].push(new z0(S,-1,g,new pE(!1,p.column),-1,-1)),v.lineNumber<=t&&_>S&&s[v.lineNumber-e].push(new z0(S,-1,g,new pE(!L,v.column),-1,-1)))}for(const h of s)h.sort((f,g)=>f.visibleColumn-g.visibleColumn);return s}getVisibleColumnFromPosition(e){return go.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();const n=this.textModel.getLineCount();if(e<1||e>n)throw new Error("Illegal value for startLineNumber");if(t<1||t>n)throw new Error("Illegal value for endLineNumber");const r=this.textModel.getOptions(),o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,s=!!(o&&o.offSide),a=new Array(t-e+1);let l=-2,c=-1,u=-2,d=-1;for(let h=e;h<=t;h++){const f=h-e,g=this._computeIndentLevel(h-1);if(g>=0){l=h-1,c=g,a[f]=Math.ceil(g/r.indentSize);continue}if(l===-2){l=-1,c=-1;for(let p=h-2;p>=0;p--){const v=this._computeIndentLevel(p);if(v>=0){l=p,c=v;break}}}if(u!==-1&&(u===-2||u=0){u=p,d=v;break}}}a[f]=this._getIndentLevelForWhitespaceLine(s,c,d)}return a}_getIndentLevelForWhitespaceLine(e,t,n){const r=this.textModel.getOptions();return t===-1||n===-1?0:tl||this._maxIndentLeft>0&&y>this._maxIndentLeft)break;const S=_.horizontalLine?_.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",L=_.horizontalLine?((o=(r=e.visibleRangeForPosition(new ae(f,_.horizontalLine.endColumn)))===null||r===void 0?void 0:r.left)!==null&&o!==void 0?o:y+this._spaceWidth)-y:this._spaceWidth;v+=`
`}h[g]=v}this._renderResult=h}getGuidesByLine(e,t,n){const r=this._bracketPairGuideOptions.bracketPairs!==!1?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,n,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:this._bracketPairGuideOptions.bracketPairsHorizontal===!0?ob.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?ob.EnabledForActive:ob.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}):null,o=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let s=0,a=0,l=0;if(this._bracketPairGuideOptions.highlightActiveIndentation!==!1&&n){const d=this._context.viewModel.getActiveIndentGuide(n.lineNumber,e,t);s=d.startLineNumber,a=d.endLineNumber,l=d.indent}const{indentSize:c}=this._context.viewModel.model.getOptions(),u=[];for(let d=e;d<=t;d++){const h=new Array;u.push(h);const f=r?r[d-e]:[],g=new Ep(f),p=o?o[d-e]:0;for(let v=1;v<=p;v++){const m=(v-1)*c+1,_=(this._bracketPairGuideOptions.highlightActiveIndentation==="always"||f.length===0)&&s<=d&&d<=a&&v===l;h.push(...g.takeWhile(S=>S.visibleColumn!0)||[])}return u}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}function ZC(i){if(!(i&&i.isTransparent()))return i}fu((i,e)=>{const t=[{bracketColor:yve,guideColor:dHe,guideColorActive:vHe},{bracketColor:wve,guideColor:hHe,guideColorActive:_He},{bracketColor:Sve,guideColor:fHe,guideColorActive:bHe},{bracketColor:xve,guideColor:gHe,guideColorActive:CHe},{bracketColor:Lve,guideColor:pHe,guideColorActive:yHe},{bracketColor:Eve,guideColor:mHe,guideColorActive:wHe}],n=new Ove,r=[{indentColor:Vk,indentColorActive:zk},{indentColor:G$e,indentColorActive:Q$e},{indentColor:q$e,indentColorActive:J$e},{indentColor:X$e,indentColorActive:eHe},{indentColor:Y$e,indentColorActive:tHe},{indentColor:Z$e,indentColorActive:nHe}],o=t.map(a=>{var l,c;const u=i.getColor(a.bracketColor),d=i.getColor(a.guideColor),h=i.getColor(a.guideColorActive),f=ZC((l=ZC(d))!==null&&l!==void 0?l:u==null?void 0:u.transparent(.3)),g=ZC((c=ZC(h))!==null&&c!==void 0?c:u);if(!(!f||!g))return{guideColor:f,guideColorActive:g}}).filter(kf),s=r.map(a=>{const l=i.getColor(a.indentColor),c=i.getColor(a.indentColorActive),u=ZC(l),d=ZC(c);if(!(!u||!d))return{indentColor:u,indentColorActive:d}}).filter(kf);if(o.length>0){for(let a=0;a<30;a++){const l=o[a%o.length];e.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(a).replace(/ /g,".")} { --guide-color: ${l.guideColor}; --guide-color-active: ${l.guideColorActive}; }`)}e.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),e.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),e.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),e.addRule(`.monaco-editor .vertical.${n.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),e.addRule(`.monaco-editor .horizontal-top.${n.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),e.addRule(`.monaco-editor .horizontal-bottom.${n.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(s.length>0){for(let a=0;a<30;a++){const l=s[a%s.length];e.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${a} { --indent-color: ${l.indentColor}; --indent-color-active: ${l.indentColorActive}; }`)}e.addRule(".monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }"),e.addRule(".monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }")}});class M6{get didDomLayout(){return this._didDomLayout}readClientRect(){if(!this._clientRectRead){this._clientRectRead=!0;const e=this._domNode.getBoundingClientRect();this.markDidDomLayout(),this._clientRectDeltaLeft=e.left,this._clientRectScale=e.width/this._domNode.offsetWidth}}get clientRectDeltaLeft(){return this._clientRectRead||this.readClientRect(),this._clientRectDeltaLeft}get clientRectScale(){return this._clientRectRead||this.readClientRect(),this._clientRectScale}constructor(e,t){this._domNode=e,this.endNode=t,this._didDomLayout=!1,this._clientRectDeltaLeft=0,this._clientRectScale=1,this._clientRectRead=!1}markDidDomLayout(){this._didDomLayout=!0}}class lVe{constructor(){this._currentVisibleRange=new B(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class cVe{constructor(e,t,n,r,o,s,a){this.minimalReveal=e,this.lineNumber=t,this.startColumn=n,this.endColumn=r,this.startScrollTop=o,this.stopScrollTop=s,this.scrollType=a,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class uVe{constructor(e,t,n,r,o){this.minimalReveal=e,this.selections=t,this.startScrollTop=n,this.stopScrollTop=r,this.scrollType=o,this.type="selections";let s=t[0].startLineNumber,a=t[0].endLineNumber;for(let l=1,c=t.length;l{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new pi(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new lVe,this._horizontalRevealRequest=null,this._stickyScrollEnabled=r.get(115).enabled,this._maxNumberStickyLines=r.get(115).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new hf(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(145)&&(this._maxLineWidth=0);const t=this._context.configuration.options,n=t.get(50),r=t.get(145);return this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._isViewportWrapping=r.isViewportWrapping,this._revealHorizontalRightPadding=t.get(100),this._cursorSurroundingLines=t.get(29),this._cursorSurroundingLinesStyle=t.get(30),this._canUseLayerHinting=!t.get(32),this._stickyScrollEnabled=t.get(115).enabled,this._maxNumberStickyLines=t.get(115).maxLineCount,ps(this.domNode,n),this._onOptionsMaybeChanged(),e.hasChanged(144)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new pre(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const n=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();for(let o=n;o<=r;o++)this._visibleLines.getVisibleLine(o).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();let r=!1;for(let o=t;o<=n;o++)r=this._visibleLines.getVisibleLine(o).onSelectionChanged()||r;return r}onDecorationsChanged(e){{const t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let r=t;r<=n;r++)this._visibleLines.getVisibleLine(r).onDecorationsChanged()}return!0}onFlushed(e){const t=this._visibleLines.onFlushed(e);return this._maxLineWidth=0,t}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onRevealRangeRequest(e){const t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.minimalReveal,e.range,e.selections,e.verticalType);if(t===-1)return!1;let n=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?n={scrollTop:n.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new cVe(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),n.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new uVe(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),n.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const o=Math.abs(this._context.viewLayout.getCurrentScrollTop()-n.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(n,o),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){const t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),n=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTopn)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0}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 n=this._getViewLineDomNode(e);if(n===null)return null;const r=this._getLineNumberFor(n);if(r===-1||r<1||r>this._context.viewModel.getLineCount())return null;if(this._context.viewModel.getLineMaxColumn(r)===1)return new ae(r,1);const o=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();if(rs)return null;let a=this._visibleLines.getVisibleLine(r).getColumnOfNodeOffset(e,t);const l=this._context.viewModel.getLineMinColumn(r);return an)return-1;const r=new M6(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getWidth(r);return this._updateLineWidthsSlowIfDomDidLayout(r),o}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const n=e.endLineNumber,r=B.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!r)return null;const o=[];let s=0;const a=new M6(this.domNode.domNode,this._textRangeRestingSpot);let l=0;t&&(l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new ae(r.startLineNumber,1)).lineNumber);const c=this._visibleLines.getStartLineNumber(),u=this._visibleLines.getEndLineNumber();for(let d=r.startLineNumber;d<=r.endLineNumber;d++){if(du)continue;const h=d===r.startLineNumber?r.startColumn:1,f=d!==r.endLineNumber,g=f?this._context.viewModel.getLineMaxColumn(d):r.endColumn,p=this._visibleLines.getVisibleLine(d).getVisibleRangesForRange(d,h,g,a);if(p){if(t&&dthis._visibleLines.getEndLineNumber())return null;const r=new M6(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,n,r);return this._updateLineWidthsSlowIfDomDidLayout(r),o}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new f$e(t.outsideRenderedLine,t.ranges[0].left):null}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidthsSlowIfDomDidLayout(e){e.didDomLayout&&(this._asyncUpdateLineWidths.isScheduled()||(this._asyncUpdateLineWidths.cancel(),this._updateLineWidthsSlow()))}_updateLineWidths(e){const t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();let r=1,o=!0;for(let s=t;s<=n;s++){const a=this._visibleLines.getVisibleLine(s);if(e&&!a.getWidthIsFast()){o=!1;continue}r=Math.max(r,a.getWidth(null))}return o&&t===1&&n===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(r),o}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const n=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();for(let o=n;o<=r;o++){const s=this._visibleLines.getVisibleLine(o);if(s.needsMonospaceFontCheck()){const a=s.getWidth(null);a>t&&(t=a,e=o)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let o=n;o<=r;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 n=this._horizontalRevealRequest;if(e.startLineNumber<=n.minLineNumber&&n.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const r=this._computeScrollLeftToReveal(n);r&&(this._isViewportWrapping||this._ensureMaxLineWidth(r.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:r.scrollLeft},n.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),Da&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const n=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();for(let o=n;o<=r;o++)if(this._visibleLines.getVisibleLine(o).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain("strict");const t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){const t=Math.ceil(e);this._maxLineWidth0){let m=o[0].startLineNumber,_=o[0].endLineNumber;for(let y=1,S=o.length;yl){if(!u)return-1;v=d}else if(s===5||s===6)if(s===6&&a<=d&&h<=c)v=a;else{const m=Math.max(5*this._lineHeight,l*.2),_=d-m,y=h-l;v=Math.max(y,_)}else if(s===1||s===2)if(s===2&&a<=d&&h<=c)v=a;else{const m=(d+h)/2;v=Math.max(0,m-l/2)}else v=this._computeMinimumScrolling(a,c,d,h,s===3,s===4);return v}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),n=this._context.configuration.options.get(144),r=t.left,o=r+t.width-n.verticalScrollbarWidth;let s=1073741824,a=0;if(e.type==="range"){const c=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!c)return null;for(const u of c.ranges)s=Math.min(s,Math.round(u.left)),a=Math.max(a,Math.round(u.left+u.width))}else for(const c of e.selections){if(c.startLineNumber!==c.endLineNumber)return null;const u=this._visibleRangesForLineRange(c.startLineNumber,c.startColumn,c.endColumn);if(!u)return null;for(const d of u.ranges)s=Math.min(s,Math.round(d.left)),a=Math.max(a,Math.round(d.left+d.width))}return e.minimalReveal||(s=Math.max(0,s-V4.HORIZONTAL_EXTRA_PX),a+=this._revealHorizontalRightPadding),e.type==="selections"&&a-s>t.width?null:{scrollLeft:this._computeMinimumScrolling(r,o,s,a),maxHorizontalOffset:a}}_computeMinimumScrolling(e,t,n,r,o,s){e=e|0,t=t|0,n=n|0,r=r|0,o=!!o,s=!!s;const a=t-e;if(r-nt)return Math.max(0,r-a)}else return n;return e}}V4.HORIZONTAL_EXTRA_PX=30;class dVe extends Ave{constructor(e){super(),this._context=e;const n=this._context.configuration.options.get(144);this._decorationsLeft=n.decorationsLeft,this._decorationsWidth=n.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const n=this._context.configuration.options.get(144);return this._decorationsLeft=n.decorationsLeft,this._decorationsWidth=n.decorationsWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){var t,n;const r=e.getDecorationsInViewport(),o=[];let s=0;for(let a=0,l=r.length;a',l=[];for(let c=t;c<=n;c++){const u=c-t,d=r[u].getDecorations();let h="";for(const f of d){let g='
';o[a]=c}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class Yc{constructor(e,t,n,r){this._rgba8Brand=void 0,this.r=Yc._clamp(e),this.g=Yc._clamp(t),this.b=Yc._clamp(n),this.a=Yc._clamp(r)}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}static _clamp(e){return e<0?0:e>255?255:e|0}}Yc.Empty=new Yc(0,0,0,0);class jk extends fe{static getInstance(){return this._INSTANCE||(this._INSTANCE=new jk),this._INSTANCE}constructor(){super(),this._onDidChange=new se,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(hr.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=hr.getColorMap();if(!e){this._colors=[Yc.Empty],this._backgroundIsLight=!0;return}this._colors=[Yc.Empty];for(let n=1;n=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}}jk._INSTANCE=null;const fVe=(()=>{const i=[];for(let e=32;e<=126;e++)i.push(e);return i.push(65533),i})(),gVe=(i,e)=>(i-=32,i<0||i>96?e<=2?(i+96)%96:96-1:i);class KD{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=KD.soften(e,12/15),this.charDataLight=KD.soften(e,50/60)}static soften(e,t){const n=new Uint8ClampedArray(e.length);for(let r=0,o=e.length;re.width||n+g>e.height){console.warn("bad render request outside image data");return}const p=u?this.charDataLight:this.charDataNormal,v=gVe(r,c),m=e.width*4,_=a.r,y=a.g,S=a.b,L=o.r-_,E=o.g-y,D=o.b-S,k=Math.max(s,l),T=e.data;let M=v*h*f,A=n*m+t*4;for(let N=0;Ne.width||n+d>e.height){console.warn("bad render request outside image data");return}const h=e.width*4,f=.5*(o/255),g=s.r,p=s.g,v=s.b,m=r.r-g,_=r.g-p,y=r.b-v,S=g+m*f,L=p+_*f,E=v+y*f,D=Math.max(o,a),k=e.data;let T=n*h+t*4;for(let M=0;M{const e=new Uint8ClampedArray(i.length/2);for(let t=0;t>1]=Dre[i[t]]<<4|Dre[i[t+1]]&15;return e},kre={1:Vv(()=>Ire("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:Vv(()=>Ire("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class mE{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let n;return kre[e]?n=new KD(kre[e](),e):n=mE.createFromSampleData(mE.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=n,n}static createSampleData(e){const t=document.createElement("canvas"),n=t.getContext("2d");t.style.height="16px",t.height=16,t.width=96*10,t.style.width=96*10+"px",n.fillStyle="#ffffff",n.font=`bold 16px ${e}`,n.textBaseline="middle";let r=0;for(const o of fVe)n.fillText(String.fromCharCode(o),r,16/2),r+=10;return n.getImageData(0,0,96*10,16)}static createFromSampleData(e,t){if(e.length!==61440)throw new Error("Unexpected source in MinimapCharRenderer");const r=mE._downsample(e,t);return new KD(r,t)}static _downsampleChar(e,t,n,r,o){const s=1*o,a=2*o;let l=r,c=0;for(let u=0;u0){const c=255/l;for(let u=0;umE.create(this.fontScale,l.fontFamily)),this.defaultBackgroundColor=n.getColor(2),this.backgroundColor=GD._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=GD._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const n=e.getColor(YWe);return n?new Yc(n.rgba.r,n.rgba.g,n.rgba.b,Math.round(255*n.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(ZWe);return t?Yc._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.paddingTop===e.paddingTop&&this.paddingBottom===e.paddingBottom&&this.showSlider===e.showSlider&&this.autohide===e.autohide&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class vE{constructor(e,t,n,r,o,s,a,l,c){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=n,this._computedSliderRatio=r,this.sliderTop=o,this.sliderHeight=s,this.topPaddingLineCount=a,this.startLineNumber=l,this.endLineNumber=c}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}intersectWithViewport(e){const t=Math.max(this.startLineNumber,e.startLineNumber),n=Math.min(this.endLineNumber,e.endLineNumber);return t>n?null:[t,n]}getYForLineNumber(e,t){return+(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(e,t,n,r,o,s,a,l,c,u,d){const h=e.pixelRatio,f=e.minimapLineHeight,g=Math.floor(e.canvasInnerHeight/f),p=e.lineHeight;if(e.minimapHeightIsEditorHeight){let E=l*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(E+=Math.max(0,o-e.lineHeight-e.paddingBottom));const D=Math.max(1,Math.floor(o*o/E)),k=Math.max(0,e.minimapHeight-D),T=k/(u-o),M=c*T,A=k>0,N=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),R=Math.floor(e.paddingTop/e.lineHeight);return new vE(c,u,A,T,M,D,R,1,Math.min(a,N))}let v;if(s&&n!==a){const E=n-t+1;v=Math.floor(E*f/h)}else{const E=o/p;v=Math.floor(E*f/h)}const m=Math.floor(e.paddingTop/p);let _=Math.floor(e.paddingBottom/p);if(e.scrollBeyondLastLine){const E=o/p;_=Math.max(_,E-1)}let y;if(_>0){const E=o/p;y=(m+a+_-E-1)*f/h}else y=Math.max(0,(m+a)*f/h-v);y=Math.min(e.minimapHeight-v,y);const S=y/(u-o),L=c*S;if(g>=m+a+_){const E=y>0;return new vE(c,u,E,S,L,v,m,1,a)}else{let E;t>1?E=t+m:E=Math.max(1,c/p);let D,k=Math.max(1,Math.floor(E-L*h/f));kc&&(k=Math.min(k,d.startLineNumber),D=Math.max(D,d.topPaddingLineCount)),d.scrollTop=e.paddingTop?A=(t-k+D+M)*f/h:A=c/e.paddingTop*(D+M)*f/h,new vE(c,u,!0,S,A,v,D,k,T)}}}class dP{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}dP.INVALID=new dP(-1);class Tre{constructor(e,t,n){this.renderedLayout=e,this._imageData=t,this._renderedLines=new Tve(()=>dP.INVALID),this._renderedLines._set(e.startLineNumber,n)}linesEquals(e){if(!this.scrollEquals(e))return!1;const n=this._renderedLines._get().lines;for(let r=0,o=n.length;r1){for(let m=0,_=r-1;m<_;m++)v[m]=Math.round(m*o+s);v[r-1]=t}return[new qD(o,v),[]]}const a=n.minimapLines,l=a.length,c=[];let u=0,d=0,h=1;const f=10;let g=[],p=null;for(let v=0;v0&&this.minimapLines[n-1]>=e;)n--;let r=this.modelLineToMinimapLine(t)-1;for(;r+1t)return null}return[n+1,r+1]}decorationLineRangeToMinimapLineRange(e,t){let n=this.modelLineToMinimapLine(e),r=this.modelLineToMinimapLine(t);return e!==t&&r===n&&(r===this.minimapLines.length?n>1&&n--:r++),[n,r]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let n=this.minimapLines.length,r=0;for(let o=this.minimapLines.length-1;o>=0&&!(this.minimapLines[o]=0&&!(this.minimapLines[n]0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:n,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(r)}_recreateLineSampling(){this._minimapSelections=null;const e=!!this._samplingState,[t,n]=qD.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const r of n)switch(r.type){case"deleted":this._actual.onLinesDeleted(r.deleteFromLineNumber,r.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(r.insertFromLineNumber,r.insertToLineNumber);break;case"flush":this._actual.onFlushed();break}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.viewModel.getLineCount()}getRealLineCount(){return this._context.viewModel.getLineCount()}getLineContent(e){return this._samplingState?this._context.viewModel.getLineContent(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineContent(e)}getLineMaxColumn(e){return this._samplingState?this._context.viewModel.getLineMaxColumn(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineMaxColumn(e)}getMinimapLinesRenderingData(e,t,n){if(this._samplingState){const r=[];for(let o=0,s=t-e+1;o{if(n.preventDefault(),this._model.options.renderMinimap===0||!this._lastRenderData)return;if(this._model.options.size!=="proportional"){if(n.button===0&&this._lastRenderData){const c=Br(this._slider.domNode),u=c.top+c.height/2;this._startSliderDragging(n,u,this._lastRenderData.renderedLayout)}return}const o=this._model.options.minimapLineHeight,s=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*n.offsetY;let l=Math.floor(s/o)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;l=Math.min(l,this._model.getLineCount()),this._model.revealLineNumber(l)}),this._sliderPointerMoveMonitor=new kS,this._sliderPointerDownListener=Sr(this._slider.domNode,Ge.POINTER_DOWN,n=>{n.preventDefault(),n.stopPropagation(),n.button===0&&this._lastRenderData&&this._startSliderDragging(n,n.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=wi.addTarget(this._domNode.domNode),this._sliderTouchStartListener=ye(this._domNode.domNode,Si.Start,n=>{n.preventDefault(),n.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(n))},{passive:!1}),this._sliderTouchMoveListener=ye(this._domNode.domNode,Si.Change,n=>{n.preventDefault(),n.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(n)},{passive:!1}),this._sliderTouchEndListener=Sr(this._domNode.domNode,Si.End,n=>{n.preventDefault(),n.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_startSliderDragging(e,t,n){if(!e.target||!(e.target instanceof Element))return;const r=e.pageX;this._slider.toggleClassName("active",!0);const o=(s,a)=>{const l=Br(this._domNode.domNode),c=Math.min(Math.abs(a-r),Math.abs(a-l.left),Math.abs(a-l.left-l.width));if(Rs&&c>pVe){this._model.setScrollTop(n.scrollTop);return}const u=s-t;this._model.setScrollTop(n.getDesiredScrollTopFromDelta(u))};e.pageY!==t&&o(e.pageY,r),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>o(s.pageY,s.pageX),()=>{this._slider.toggleClassName("active",!1)})}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,n=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(n)}dispose(){this._pointerDownListener.dispose(),this._sliderPointerMoveMonitor.dispose(),this._sliderPointerDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){const e=["minimap"];return this._model.options.showSlider==="always"?e.push("slider-always"):e.push("slider-mouseover"),this._model.options.autohide&&e.push("autohide"),e.join(" ")}getDomNode(){return this._domNode}_applyLayout(){this._domNode.setLeft(this._model.options.minimapLeft),this._domNode.setWidth(this._model.options.minimapWidth),this._domNode.setHeight(this._model.options.minimapHeight),this._shadow.setHeight(this._model.options.minimapHeight),this._canvas.setWidth(this._model.options.canvasOuterWidth),this._canvas.setHeight(this._model.options.canvasOuterHeight),this._canvas.domNode.width=this._model.options.canvasInnerWidth,this._canvas.domNode.height=this._model.options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._model.options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._model.options.canvasInnerHeight,this._slider.setWidth(this._model.options.minimapWidth)}_getBuffer(){return this._buffers||this._model.options.canvasInnerWidth>0&&this._model.options.canvasInnerHeight>0&&(this._buffers=new sX(this._canvas.domNode.getContext("2d"),this._model.options.canvasInnerWidth,this._model.options.canvasInnerHeight,this._model.options.backgroundColor)),this._buffers?this._buffers.getBuffer():null}onDidChangeOptions(){this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName())}onSelectionChanged(){return this._renderDecorations=!0,!0}onDecorationsChanged(){return this._renderDecorations=!0,!0}onFlushed(){return this._lastRenderData=null,!0}onLinesChanged(e,t){return this._lastRenderData?this._lastRenderData.onLinesChanged(e,t):!1}onLinesDeleted(e,t){var n;return(n=this._lastRenderData)===null||n===void 0||n.onLinesDeleted(e,t),!0}onLinesInserted(e,t){var n;return(n=this._lastRenderData)===null||n===void 0||n.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(dre),this._renderDecorations=!0,!0}onTokensChanged(e){return this._lastRenderData?this._lastRenderData.onTokensChanged(e):!1}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(this._model.options.renderMinimap===0){this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),this._sliderHorizontal.setHeight(0);return}e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");const n=vE.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(n.sliderNeeded?"block":"none"),this._slider.setTop(n.sliderTop),this._slider.setHeight(n.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(n.sliderHeight),this.renderDecorations(n),this._lastRenderData=this.renderLines(n)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(B.compareRangesUsingStarts);const n=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);n.sort((h,f)=>(h.options.zIndex||0)-(f.options.zIndex||0));const{canvasInnerWidth:r,canvasInnerHeight:o}=this._model.options,s=this._model.options.minimapLineHeight,a=this._model.options.minimapCharWidth,l=this._model.getOptions().tabSize,c=this._decorationsCanvas.domNode.getContext("2d");c.clearRect(0,0,r,o);const u=new Nre(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(c,t,u,e,s),this._renderDecorationsLineHighlights(c,n,u,e,s);const d=new Nre(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(c,t,d,e,s,l,a,r),this._renderDecorationsHighlights(c,n,d,e,s,l,a,r)}}_renderSelectionLineHighlights(e,t,n,r,o){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let s=0,a=0;for(const l of t){const c=r.intersectWithViewport(l);if(!c)continue;const[u,d]=c;for(let g=u;g<=d;g++)n.set(g,!0);const h=r.getYForLineNumber(u,o),f=r.getYForLineNumber(d,o);a>=h||(a>s&&e.fillRect(gm,s,e.canvas.width,a-s),s=h),a=f}a>s&&e.fillRect(gm,s,e.canvas.width,a-s)}_renderDecorationsLineHighlights(e,t,n,r,o){const s=new Map;for(let a=t.length-1;a>=0;a--){const l=t[a],c=l.options.minimap;if(!c||c.position!==Ll.Inline)continue;const u=r.intersectWithViewport(l.range);if(!u)continue;const[d,h]=u,f=c.getColor(this._theme.value);if(!f||f.isTransparent())continue;let g=s.get(f.toString());g||(g=f.transparent(.5).toString(),s.set(f.toString(),g)),e.fillStyle=g;for(let p=d;p<=h;p++){if(n.has(p))continue;n.set(p,!0);const v=r.getYForLineNumber(d,o);e.fillRect(gm,v,e.canvas.width,o)}}}_renderSelectionsHighlights(e,t,n,r,o,s,a,l){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(const c of t){const u=r.intersectWithViewport(c);if(!u)continue;const[d,h]=u;for(let f=d;f<=h;f++)this.renderDecorationOnLine(e,n,c,this._selectionColor,r,f,o,o,s,a,l)}}_renderDecorationsHighlights(e,t,n,r,o,s,a,l){for(const c of t){const u=c.options.minimap;if(!u)continue;const d=r.intersectWithViewport(c.range);if(!d)continue;const[h,f]=d,g=u.getColor(this._theme.value);if(!(!g||g.isTransparent()))for(let p=h;p<=f;p++)switch(u.position){case Ll.Inline:this.renderDecorationOnLine(e,n,c.range,g,r,p,o,o,s,a,l);continue;case Ll.Gutter:{const v=r.getYForLineNumber(p,o),m=2;this.renderDecoration(e,g,m,v,mVe,o);continue}}}}renderDecorationOnLine(e,t,n,r,o,s,a,l,c,u,d){const h=o.getYForLineNumber(s,l);if(h+a<0||h>this._model.options.canvasInnerHeight)return;const{startLineNumber:f,endLineNumber:g}=n,p=f===s?n.startColumn:1,v=g===s?n.endColumn:this._model.getLineMaxColumn(s),m=this.getXOffsetForPosition(t,s,p,c,u,d),_=this.getXOffsetForPosition(t,s,v,c,u,d);this.renderDecoration(e,r,m,h,_-m,a)}getXOffsetForPosition(e,t,n,r,o,s){if(n===1)return gm;if((n-1)*o>=s)return s;let l=e.get(t);if(!l){const c=this._model.getLineContent(t);l=[gm];let u=gm;for(let d=1;d=s){l[d]=s;break}l[d]=g,u=g}e.set(t,l)}return n-1L?Math.floor((r-L)/2):0,D=h.a/255,k=new Yc(Math.round((h.r-d.r)*D+d.r),Math.round((h.g-d.g)*D+d.g),Math.round((h.b-d.b)*D+d.b),255);let T=e.topPaddingLineCount*r;const M=[];for(let W=0,H=n-t+1;W=0&&A_)return;const N=v.charCodeAt(L);if(N===9){const R=h-(L+E)%h;E+=R-1,S+=R*s}else if(N===32)S+=s;else{const R=Uv(N)?2:1;for(let F=0;F_)return}}}}}class Nre{constructor(e,t,n){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=n,this._values=[];for(let r=0,o=this._endLineNumber-this._startLineNumber+1;rthis._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return ethis._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}class _Ve extends Pl{constructor(e,t){super(e),this._viewDomNode=t;const r=this._context.configuration.options.get(144);this._widgets={},this._verticalScrollbarWidth=r.verticalScrollbarWidth,this._minimapWidth=r.minimap.minimapWidth,this._horizontalScrollbarHeight=r.horizontalScrollbarHeight,this._editorHeight=r.height,this._editorWidth=r.width,this._viewDomNodeRect={top:0,left:0,width:0,height:0},this._domNode=Qn(document.createElement("div")),fh.write(this._domNode,4),this._domNode.setClassName("overlayWidgets"),this.overflowingOverlayWidgetsDomNode=Qn(document.createElement("div")),fh.write(this.overflowingOverlayWidgetsDomNode,5),this.overflowingOverlayWidgetsDomNode.setClassName("overflowingOverlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const n=this._context.configuration.options.get(144);return this._verticalScrollbarWidth=n.verticalScrollbarWidth,this._minimapWidth=n.minimap.minimapWidth,this._horizontalScrollbarHeight=n.horizontalScrollbarHeight,this._editorHeight=n.height,this._editorWidth=n.width,!0}addWidget(e){const t=Qn(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),e.allowEditorOverflow?this.overflowingOverlayWidgetsDomNode.appendChild(t):this._domNode.appendChild(t),this.setShouldRender(),this._updateMaxMinWidth()}setWidgetPosition(e,t){const n=this._widgets[e.getId()];return n.preference===t?(this._updateMaxMinWidth(),!1):(n.preference=t,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const r=this._widgets[t].domNode.domNode;delete this._widgets[t],r.remove(),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){var e,t;let n=0;const r=Object.keys(this._widgets);for(let o=0,s=r.length;o=3){const o=Math.floor(r/3),s=Math.floor(r/3),a=r-o-s,l=e,c=l+o,u=l+o+a;return[[0,l,c,l,u,l,c,l],[0,o,a,o+a,s,o+a+s,a+s,o+a+s]]}else if(n===2){const o=Math.floor(r/2),s=r-o,a=e,l=a+o;return[[0,a,a,a,l,a,a,a],[0,o,o,o,s,o+s,o+s,o+s]]}else{const o=e,s=r;return[[0,o,o,o,o,o,o,o],[0,s,s,s,s,s,s,s]]}}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&&me.equals(this.backgroundColor,e.backgroundColor)&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight}}class CVe extends Pl{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=Qn(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=hr.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[new ae(1,1)]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new bVe(this._context.configuration,this._context.theme);return this._settings&&this._settings.equals(t)?!1:(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),!0)}_markRenderingIsNeeded(){return this._actualShouldRender=2,!0}_markRenderingIsMaybeNeeded(){return this._actualShouldRender=1,!0}onConfigurationChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,n=e.selections.length;tg.lineNumber===p.lineNumber)&&(this._actualShouldRender=2),this._actualShouldRender===1)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");const n=this._settings.canvasWidth,r=this._settings.canvasHeight,o=this._settings.lineHeight,s=this._context.viewLayout,a=this._context.viewLayout.getScrollHeight(),l=r/a,c=6*this._settings.pixelRatio|0,u=c/2|0,d=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(d.fillStyle=me.Format.CSS.formatHexA(e),d.fillRect(0,0,n,r)):(d.clearRect(0,0,n,r),d.fillStyle=me.Format.CSS.formatHexA(e),d.fillRect(0,0,n,r)):d.clearRect(0,0,n,r);const h=this._settings.x,f=this._settings.w;for(const g of t){const p=g.color,v=g.data;d.fillStyle=p;let m=0,_=0,y=0;for(let S=0,L=v.length/3;Sr&&(N=r-u),T=N-u,M=N+u}T>y+1||E!==m?(S!==0&&d.fillRect(h[m],_,f[m],y-_),m=E,_=T,y=M):M>y&&(y=M)}d.fillRect(h[m],_,f[m],y-_)}if(!this._settings.hideCursor&&this._settings.cursorColor){const g=2*this._settings.pixelRatio|0,p=g/2|0,v=this._settings.x[7],m=this._settings.w[7];d.fillStyle=this._settings.cursorColor;let _=-100,y=-100;for(let S=0,L=this._cursorPositions.length;Sr&&(D=r-p);const k=D-p,T=k+g;k>y+1?(S!==0&&d.fillRect(v,_,m,y-_),_=k,y=T):T>y&&(y=T)}d.fillRect(v,_,m,y-_)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(d.beginPath(),d.lineWidth=1,d.strokeStyle=this._settings.borderColor,d.moveTo(0,0),d.lineTo(0,r),d.stroke(),d.moveTo(0,0),d.lineTo(n,0),d.stroke())}}class Rre{constructor(e,t,n){this._colorZoneBrand=void 0,this.from=e|0,this.to=t|0,this.colorId=n|0}static compare(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId}}class Fve{constructor(e,t,n,r){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=n,this.color=r,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.colorn&&(p=n-v);const m=u.color;let _=this._color2Id[m];_||(_=++this._lastAssignedId,this._color2Id[m]=_,this._id2Color[_]=m);const y=new Rre(p-v,p+v,_);u.setColorZone(y),a.push(y)}return this._colorZonesInvalid=!1,a.sort(Rre.compare),a}}class wVe extends $k{constructor(e,t){super(),this._context=e;const n=this._context.configuration.options;this._domNode=Qn(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new yVe(r=>this._context.viewLayout.getVerticalOffsetForLineNumber(r)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(n.get(67)),this._zoneManager.setPixelRatio(n.get(142)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(67)&&(this._zoneManager.setLineHeight(t.get(67)),this._render()),e.hasChanged(142)&&(this._zoneManager.setPixelRatio(t.get(142)),this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render()),!0}onFlushed(e){return this._render(),!0}onScrollChanged(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0}onZonesChanged(e){return this._render(),!0}getDomNode(){return this._domNode.domNode}setLayout(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);let t=!1;t=this._zoneManager.setDOMWidth(e.width)||t,t=this._zoneManager.setDOMHeight(e.height)||t,t&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())}setZones(e){this._zoneManager.setZones(e),this._render()}_render(){if(this._zoneManager.getOuterHeight()===0)return!1;const e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),n=this._zoneManager.resolveColorZones(),r=this._zoneManager.getId2Color(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),n.length>0&&this._renderOneLane(o,n,r,e),!0}_renderOneLane(e,t,n,r){let o=0,s=0,a=0;for(const l of t){const c=l.colorId,u=l.from,d=l.to;c!==o?(e.fillRect(0,s,r,a-s),o=c,e.fillStyle=n[o],s=u,a=d):a>=u?a=Math.max(a,d):(e.fillRect(0,s,r,a-s),s=u,a=d)}e.fillRect(0,s,r,a-s)}}class SVe extends Pl{constructor(e){super(e),this.domNode=Qn(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("view-rulers"),this._renderedRulers=[];const t=this._context.configuration.options;this._rulers=t.get(102),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(102),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){const e=this._renderedRulers.length,t=this._rulers.length;if(e===t)return;if(e0;){const a=Qn(document.createElement("div"));a.setClassName("view-ruler"),a.setWidth(o),this.domNode.appendChild(a),this._renderedRulers.push(a),s--}return}let n=e-t;for(;n>0;){const r=this._renderedRulers.pop();this.domNode.removeChild(r),n--}}render(e){this._ensureRulersCount();for(let t=0,n=this._rulers.length;t0;return this._shouldShow!==e?(this._shouldShow=e,!0):!1}getDomNode(){return this._domNode}_updateWidth(){const t=this._context.configuration.options.get(144);t.minimap.renderMinimap===0||t.minimap.minimapWidth>0&&t.minimap.minimapLeft===0?this._width=t.width:this._width=t.width-t.verticalScrollbarWidth}onConfigurationChanged(e){const n=this._context.configuration.options.get(103);return this._useShadows=n.useShadows,this._updateWidth(),this._updateShouldShow(),!0}onScrollChanged(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()}prepareRender(e){}render(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")}}class LVe{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class EVe{constructor(e,t){this.lineNumber=e,this.ranges=t}}function DVe(i){return new LVe(i)}function IVe(i){return new EVe(i.lineNumber,i.ranges.map(DVe))}class Dr extends fC{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(67),this._roundedSelection=t.get(101),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(67),this._roundedSelection=t.get(101),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_visibleRangesHaveGaps(e){for(let t=0,n=e.length;t1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,n){const r=this._typicalHalfwidthCharacterWidth/4;let o=null,s=null;if(n&&n.length>0&&t.length>0){const a=t[0].lineNumber;if(a===e.startLineNumber)for(let c=0;!o&&c=0;c--)n[c].lineNumber===l&&(s=n[c].ranges[0]);o&&!o.startStyle&&(o=null),s&&!s.startStyle&&(s=null)}for(let a=0,l=t.length;a0){const g=t[a-1].ranges[0].left,p=t[a-1].ranges[0].left+t[a-1].ranges[0].width;_R(u-g)g&&(h.top=1),_R(d-p)'}_actualRenderOneSelection(e,t,n,r){if(r.length===0)return;const o=!!r[0].ranges[0].startStyle,s=this._lineHeight.toString(),a=(this._lineHeight-1).toString(),l=r[0].lineNumber,c=r[r.length-1].lineNumber;for(let u=0,d=r.length;u1,c)}this._previousFrameVisibleRangesWithStyle=o,this._renderResult=t.map(([s,a])=>s+a)}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}Dr.SELECTION_CLASS_NAME="selected-text";Dr.SELECTION_TOP_LEFT="top-left-radius";Dr.SELECTION_BOTTOM_LEFT="bottom-left-radius";Dr.SELECTION_TOP_RIGHT="top-right-radius";Dr.SELECTION_BOTTOM_RIGHT="bottom-right-radius";Dr.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background";Dr.ROUNDED_PIECE_WIDTH=10;fu((i,e)=>{const t=i.getColor(oWe);t&&!t.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${t}; }`)});function _R(i){return i<0?-i:i}class Mre{constructor(e,t,n,r,o,s,a){this.top=e,this.left=t,this.paddingLeft=n,this.width=r,this.height=o,this.textContent=s,this.textContentClassName=a}}class Are{constructor(e){this._context=e;const t=this._context.configuration.options,n=t.get(50);this._cursorStyle=t.get(28),this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=Qn(document.createElement("div")),this._domNode.setClassName(`cursor ${$y}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),ps(this._domNode,n),this._domNode.setDisplay("none"),this._position=new ae(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,n=t.get(50);return this._cursorStyle=t.get(28),this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),ps(this._domNode,n),!0}onCursorPositionChanged(e,t){return t?this._domNode.domNode.style.transitionProperty="none":this._domNode.domNode.style.transitionProperty="",this._position=e,!0}_getGraphemeAwarePosition(){const{lineNumber:e,column:t}=this._position,n=this._context.viewModel.getLineContent(e),[r,o]=z5e(n,t-1);return[new ae(e,r+1),n.substring(r,o)]}_prepareRender(e){let t="",n="";const[r,o]=this._getGraphemeAwarePosition();if(this._cursorStyle===Qo.Line||this._cursorStyle===Qo.LineThin){const h=e.visibleRangeForPosition(r);if(!h||h.outsideRenderedLine)return null;const f=Pt(this._domNode.domNode);let g;this._cursorStyle===Qo.Line?(g=rie(f,this._lineCursorWidth>0?this._lineCursorWidth:2),g>2&&(t=o,n=this._getTokenClassName(r))):g=rie(f,1);let p=h.left,v=0;g>=2&&p>=1&&(v=1,p-=v);const m=e.getVerticalOffsetForLineNumber(r.lineNumber)-e.bigNumbersDelta;return new Mre(m,p,v,g,this._lineHeight,t,n)}const s=e.linesVisibleRangesForRange(new B(r.lineNumber,r.column,r.lineNumber,r.column+o.length),!1);if(!s||s.length===0)return null;const a=s[0];if(a.outsideRenderedLine||a.ranges.length===0)return null;const l=a.ranges[0],c=o===" "?this._typicalHalfwidthCharacterWidth:l.width<1?this._typicalHalfwidthCharacterWidth:l.width;this._cursorStyle===Qo.Block&&(t=o,n=this._getTokenClassName(r));let u=e.getVerticalOffsetForLineNumber(r.lineNumber)-e.bigNumbersDelta,d=this._lineHeight;return(this._cursorStyle===Qo.Underline||this._cursorStyle===Qo.UnderlineThin)&&(u+=this._lineHeight-2,d=2),new Mre(u,l.left,0,c,d,t,n)}_getTokenClassName(e){const t=this._context.viewModel.getViewLineData(e.lineNumber),n=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(n)}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 ${$y} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setPaddingLeft(this._renderData.paddingLeft),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)}}class XD extends Pl{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(91),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new Are(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=Qn(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 cd,this._cursorFlatBlinkInterval=new Eq,this._blinkingEnabled=!1,this._editorHasFocus=!1,this._updateBlinking()}dispose(){super.dispose(),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()}getDomNode(){return this._domNode}onCompositionStart(e){return this._isComposingInput=!0,this._updateBlinking(),!0}onCompositionEnd(e){return this._isComposingInput=!1,this._updateBlinking(),!0}onConfigurationChanged(e){const t=this._context.configuration.options;this._readOnly=t.get(91),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let n=0,r=this._secondaryCursors.length;nt.length){const o=this._secondaryCursors.length-t.length;for(let s=0;s{for(let r=0,o=e.ranges.length;r{this._isVisible?this._hide():this._show()},XD.BLINK_INTERVAL,Pt(this._domNode.domNode)):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},XD.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case Qo.Line:e+=" cursor-line-style";break;case Qo.Block:e+=" cursor-block-style";break;case Qo.Underline:e+=" cursor-underline-style";break;case Qo.LineThin:e+=" cursor-line-thin-style";break;case Qo.BlockOutline:e+=" cursor-block-outline-style";break;case Qo.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case 1:e+=" cursor-blink";break;case 2:e+=" cursor-smooth";break;case 3:e+=" cursor-phase";break;case 4:e+=" cursor-expand";break;case 5:e+=" cursor-solid";break;default:e+=" cursor-solid"}else e+=" cursor-solid";return(this._cursorSmoothCaretAnimation==="on"||this._cursorSmoothCaretAnimation==="explicit")&&(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e{const t=i.getColor(bve);if(t){let n=i.getColor(j$e);n||(n=t.opposite()),e.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${t}; border-color: ${t}; color: ${n}; }`),ih(i.type)&&e.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${n}; border-right: 1px solid ${n}; }`)}});const A6=()=>{throw new Error("Invalid change accessor")};class kVe extends Pl{constructor(e){super(e);const t=this._context.configuration.options,n=t.get(144);this._lineHeight=t.get(67),this._contentWidth=n.contentWidth,this._contentLeft=n.contentLeft,this.domNode=Qn(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=Qn(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 r of e)t.set(r.id,r);let n=!1;return this._context.viewModel.changeWhitespace(r=>{const o=Object.keys(this._zones);for(let s=0,a=o.length;s{const r={addZone:o=>(t=!0,this._addZone(n,o)),removeZone:o=>{o&&(t=this._removeZone(n,o)||t)},layoutZone:o=>{o&&(t=this._layoutZone(n,o)||t)}};TVe(e,r),r.addZone=A6,r.removeZone=A6,r.layoutZone=A6}),t}_addZone(e,t){const n=this._computeWhitespaceProps(t),o={whitespaceId:e.insertWhitespace(n.afterViewLineNumber,this._getZoneOrdinal(t),n.heightInPx,n.minWidthInPx),delegate:t,isInHiddenArea:n.isInHiddenArea,isVisible:!1,domNode:Qn(t.domNode),marginDomNode:t.marginDomNode?Qn(t.marginDomNode):null};return this._safeCallOnComputedHeight(o.delegate,n.heightInPx),o.domNode.setPosition("absolute"),o.domNode.domNode.style.width="100%",o.domNode.setDisplay("none"),o.domNode.setAttribute("monaco-view-zone",o.whitespaceId),this.domNode.appendChild(o.domNode),o.marginDomNode&&(o.marginDomNode.setPosition("absolute"),o.marginDomNode.domNode.style.width="100%",o.marginDomNode.setDisplay("none"),o.marginDomNode.setAttribute("monaco-view-zone",o.whitespaceId),this.marginDomNode.appendChild(o.marginDomNode)),this._zones[o.whitespaceId]=o,this.setShouldRender(),o.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const n=this._zones[t];return delete this._zones[t],e.removeWhitespace(n.whitespaceId),n.domNode.removeAttribute("monaco-visible-view-zone"),n.domNode.removeAttribute("monaco-view-zone"),n.domNode.domNode.parentNode.removeChild(n.domNode.domNode),n.marginDomNode&&(n.marginDomNode.removeAttribute("monaco-visible-view-zone"),n.marginDomNode.removeAttribute("monaco-view-zone"),n.marginDomNode.domNode.parentNode.removeChild(n.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const n=this._zones[t],r=this._computeWhitespaceProps(n.delegate);return n.isInHiddenArea=r.isInHiddenArea,e.changeOneWhitespace(n.whitespaceId,r.afterViewLineNumber,r.heightInPx),this._safeCallOnComputedHeight(n.delegate,r.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){return this._zones.hasOwnProperty(e)?!!this._zones[e].delegate.suppressMouseDown:!1}_heightInPixels(e){return typeof e.heightInPx=="number"?e.heightInPx:typeof e.heightInLines=="number"?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return typeof e.minWidthInPx=="number"?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if(typeof e.onComputedHeight=="function")try{e.onComputedHeight(t)}catch(n){en(n)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(n){en(n)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,n={};let r=!1;for(const s of t)this._zones[s.id].isInHiddenArea||(n[s.id]=s,r=!0);const o=Object.keys(this._zones);for(let s=0,a=o.length;sa)continue;const f=h.startLineNumber===a?h.startColumn:c.minColumn,g=h.endLineNumber===a?h.endColumn:c.maxColumn;f=M.endOffset&&(T++,M=n&&n[T]),R!==9&&R!==32||h&&!E&&N<=k)continue;if(d&&N>=D&&N<=k&&R===32){const W=N-1>=0?a.charCodeAt(N-1):0,H=N+1=0?a.charCodeAt(N-1):0;if(R===32&&W!==32&&W!==9)continue}if(n&&(!M||M.startOffset>N||M.endOffset<=N))continue;const F=e.visibleRangeForPosition(new ae(t,N+1));F&&(s?(A=Math.max(A,F.left),R===9?L+=this._renderArrow(f,v,F.left):L+=``):R===9?L+=`
${S?String.fromCharCode(65515):String.fromCharCode(8594)}
`:L+=`
${String.fromCharCode(y)}
`)}return s?(A=Math.round(A+v),``+L+""):L}_renderArrow(e,t,n){const r=t/7,o=t,s=e/2,a=n,l={x:0,y:r/2},c={x:100/125*o,y:l.y},u={x:c.x-.2*c.x,y:c.y+.2*c.x},d={x:u.x+.1*c.x,y:u.y+.1*c.x},h={x:d.x+.35*c.x,y:d.y-.35*c.x},f={x:h.x,y:-h.y},g={x:d.x,y:-d.y},p={x:u.x,y:-u.y},v={x:c.x,y:-c.y},m={x:l.x,y:-l.y};return``}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}class Pre{constructor(e){const t=e.options,n=t.get(50),r=t.get(38);r==="off"?(this.renderWhitespace="none",this.renderWithSVG=!1):r==="svg"?(this.renderWhitespace=t.get(99),this.renderWithSVG=!0):(this.renderWhitespace=t.get(99),this.renderWithSVG=!1),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=n.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(67),this.stopRenderingLineAfter=t.get(117)}equals(e){return this.renderWhitespace===e.renderWhitespace&&this.renderWithSVG===e.renderWithSVG&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter}}class RVe{constructor(e,t,n,r){this.selections=e,this.startLineNumber=t.startLineNumber|0,this.endLineNumber=t.endLineNumber|0,this.relativeVerticalOffset=t.relativeVerticalOffset,this.bigNumbersDelta=t.bigNumbersDelta|0,this.whitespaceViewportData=n,this._model=r,this.visibleRange=new B(t.startLineNumber,this._model.getLineMinColumn(t.startLineNumber),t.endLineNumber,this._model.getLineMaxColumn(t.endLineNumber))}getViewLineRenderingData(e){return this._model.getViewportViewLineRenderingData(this.visibleRange,e)}getDecorationsInViewport(){return this._model.getDecorationsInViewport(this.visibleRange)}}class MVe{get type(){return this._theme.type}get value(){return this._theme}constructor(e){this._theme=e}update(e){this._theme=e}getColor(e){return this._theme.getColor(e)}}class AVe{constructor(e,t,n){this.configuration=e,this.theme=new MVe(t),this.viewModel=n,this.viewLayout=n.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}}var PVe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},OVe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let BH=class extends $k{constructor(e,t,n,r,o,s,a){super(),this._instantiationService=a,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new yt(1,1,1,1)],this._renderAnimationFrame=null;const l=new zHe(t,r,o,e);this._context=new AVe(t,n,r),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(PH,this._context,l,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=Qn(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=Qn(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=Qn(document.createElement("div")),fh.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new JHe(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new V4(this._context,this._linesContent),this._viewZones=new kVe(this._context),this._viewParts.push(this._viewZones);const c=new CVe(this._context);this._viewParts.push(c);const u=new xVe(this._context);this._viewParts.push(u);const d=new jHe(this._context);this._viewParts.push(d),d.addDynamicOverlay(new YHe(this._context)),d.addDynamicOverlay(new Dr(this._context)),d.addDynamicOverlay(new aVe(this._context)),d.addDynamicOverlay(new QHe(this._context)),d.addDynamicOverlay(new NVe(this._context));const h=new KHe(this._context);this._viewParts.push(h),h.addDynamicOverlay(new ZHe(this._context)),h.addDynamicOverlay(new hVe(this._context)),h.addDynamicOverlay(new dVe(this._context)),h.addDynamicOverlay(new Uk(this._context)),this._glyphMarginWidgets=new nVe(this._context),this._viewParts.push(this._glyphMarginWidgets);const f=new Rb(this._context);f.getDomNode().appendChild(this._viewZones.marginDomNode),f.getDomNode().appendChild(h.getDomNode()),f.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(f),this._contentWidgets=new qHe(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new XD(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new _Ve(this._context,this.domNode),this._viewParts.push(this._overlayWidgets);const g=new SVe(this._context);this._viewParts.push(g);const p=new GHe(this._context);this._viewParts.push(p);const v=new vVe(this._context);if(this._viewParts.push(v),c){const m=this._scrollbar.getOverviewRulerLayoutInfo();m.parent.insertBefore(c.getDomNode(),m.insertBefore)}this._linesContent.appendChild(d.getDomNode()),this._linesContent.appendChild(g.domNode),this._linesContent.appendChild(this._viewZones.domNode),this._linesContent.appendChild(this._viewLines.getDomNode()),this._linesContent.appendChild(this._contentWidgets.domNode),this._linesContent.appendChild(this._viewCursors.getDomNode()),this._overflowGuardContainer.appendChild(f.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._overflowGuardContainer.appendChild(u.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(v.getDomNode()),this._overflowGuardContainer.appendChild(p.domNode),this.domNode.appendChild(this._overflowGuardContainer),s?(s.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode),s.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode)):(this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this.domNode.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode)),this._applyLayout(),this._pointerHandler=this._register(new V$e(this._context,l,this._createPointerHandlerHelper()))}_computeGlyphMarginLanes(){const e=this._context.viewModel.model,t=this._context.viewModel.glyphLanes;let n=[],r=0;n=n.concat(e.getAllMarginDecorations().map(o=>{var s,a,l;const c=(a=(s=o.options.glyphMargin)===null||s===void 0?void 0:s.position)!==null&&a!==void 0?a:$f.Center;return r=Math.max(r,o.range.endLineNumber),{range:o.range,lane:c,persist:(l=o.options.glyphMargin)===null||l===void 0?void 0:l.persistLane}})),n=n.concat(this._glyphMarginWidgets.getWidgets().map(o=>{const s=e.validateRange(o.preference.range);return r=Math.max(r,s.endLineNumber),{range:s,lane:o.preference.lane}})),n.sort((o,s)=>B.compareRangesUsingStarts(o.range,s.range)),t.reset(r);for(const o of n)t.push(o.lane,o.range,o.persist);return t}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,viewLinesDomNode:this._viewLines.getDomNode().domNode,focusTextArea:()=>{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new _$e(e,t)},renderNow:()=>{this.render(!0,!1)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,t)),visibleRangeForPosition:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new ae(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e))}}_applyLayout(){const t=this._context.configuration.options.get(144);this.domNode.setWidth(t.width),this.domNode.setHeight(t.height),this._overflowGuardContainer.setWidth(t.width),this._overflowGuardContainer.setHeight(t.height),this._linesContent.setWidth(1e6),this._linesContent.setHeight(1e6)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(141)+" "+AH(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this.domNode.setClassName(this._getEditorClassName()),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onDecorationsChanged(e){return e.affectsGlyphMargin&&(this._shouldRecomputeGlyphMarginLanes=!0),!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this._context.theme.update(e.theme),this.domNode.setClassName(this._getEditorClassName()),!1}dispose(){this._renderAnimationFrame!==null&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null),this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewLines.dispose();for(const e of this._viewParts)e.dispose();super.dispose()}_scheduleRender(){if(this._store.isDisposed)throw new qi;if(this._renderAnimationFrame===null){const e=this._createCoordinatedRendering();this._renderAnimationFrame=WH.INSTANCE.scheduleCoordinatedRendering({window:Pt(this.domNode.domNode),prepareRenderText:()=>{if(this._store.isDisposed)throw new qi;try{return e.prepareRenderText()}finally{this._renderAnimationFrame=null}},renderText:()=>{if(this._store.isDisposed)throw new qi;return e.renderText()},prepareRender:(t,n)=>{if(this._store.isDisposed)throw new qi;return e.prepareRender(t,n)},render:(t,n)=>{if(this._store.isDisposed)throw new qi;return e.render(t,n)}})}}_flushAccumulatedAndRenderNow(){const e=this._createCoordinatedRendering();qm(()=>e.prepareRenderText());const t=qm(()=>e.renderText());if(t){const[n,r]=t;qm(()=>e.prepareRender(n,r)),qm(()=>e.render(n,r))}}_getViewPartsToRender(){const e=[];let t=0;for(const n of this._viewParts)n.shouldRender()&&(e[t++]=n);return e}_createCoordinatedRendering(){return{prepareRenderText:()=>{if(this._shouldRecomputeGlyphMarginLanes){this._shouldRecomputeGlyphMarginLanes=!1;const e=this._computeGlyphMarginLanes();this._context.configuration.setGlyphMarginDecorationLaneCount(e.requiredLanes)}jm.onRenderStart()},renderText:()=>{if(!this.domNode.domNode.isConnected)return null;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&e.length===0)return null;const t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const n=new RVe(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);return this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(n),this._viewLines.shouldRender()&&(this._viewLines.renderText(n),this._viewLines.onDidRender(),e=this._getViewPartsToRender()),[e,new d$e(this._context.viewLayout,n,this._viewLines)]},prepareRender:(e,t)=>{for(const n of e)n.prepareRender(t)},render:(e,t)=>{for(const n of e)n.render(t),n.onDidRender()}}}delegateVerticalScrollbarPointerDown(e){this._scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._scrollbar.delegateScrollFromMouseWheelEvent(e)}restoreState(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft},1),this._context.viewModel.visibleLinesStabilized()}getOffsetForColumn(e,t){const n=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),r=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(n);this._flushAccumulatedAndRenderNow();const o=this._viewLines.visibleRangeForPosition(new ae(r.lineNumber,r.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const n=this._pointerHandler.getTargetAtClientPoint(e,t);return n?$4.convertViewToModelMouseTarget(n,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new wVe(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const n of this._viewParts)n.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}writeScreenReaderContent(e){this._textAreaHandler.writeScreenReaderContent(e)}focus(){this._textAreaHandler.focusTextArea()}isFocused(){return this._textAreaHandler.isFocused()}setAriaOptions(e){this._textAreaHandler.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){var t,n,r,o,s,a,l,c;this._contentWidgets.setWidgetPosition(e.widget,(n=(t=e.position)===null||t===void 0?void 0:t.position)!==null&&n!==void 0?n:null,(o=(r=e.position)===null||r===void 0?void 0:r.secondaryPosition)!==null&&o!==void 0?o:null,(a=(s=e.position)===null||s===void 0?void 0:s.preference)!==null&&a!==void 0?a:null,(c=(l=e.position)===null||l===void 0?void 0:l.positionAffinity)!==null&&c!==void 0?c:null),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){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()}addGlyphMarginWidget(e){this._glyphMarginWidgets.addWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}layoutGlyphMarginWidget(e){const t=e.position;this._glyphMarginWidgets.setWidgetPosition(e.widget,t)&&(this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender())}removeGlyphMarginWidget(e){this._glyphMarginWidgets.removeWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}};BH=PVe([OVe(6,Ot)],BH);function qm(i){try{return i()}catch(e){return en(e),null}}class WH{constructor(){this._coordinatedRenderings=[],this._animationFrameRunners=new Map}scheduleCoordinatedRendering(e){return this._coordinatedRenderings.push(e),this._scheduleRender(e.window),{dispose:()=>{const t=this._coordinatedRenderings.indexOf(e);if(t!==-1&&(this._coordinatedRenderings.splice(t,1),this._coordinatedRenderings.length===0)){for(const[n,r]of this._animationFrameRunners)r.dispose();this._animationFrameRunners.clear()}}}}_scheduleRender(e){if(!this._animationFrameRunners.has(e)){const t=()=>{this._animationFrameRunners.delete(e),this._onRenderScheduled()};this._animationFrameRunners.set(e,KA(e,t,100))}}_onRenderScheduled(){const e=this._coordinatedRenderings.slice(0);this._coordinatedRenderings=[];for(const n of e)qm(()=>n.prepareRenderText());const t=[];for(let n=0,r=e.length;no.renderText())}for(let n=0,r=e.length;no.prepareRender(a,l))}for(let n=0,r=e.length;no.render(a,l))}}}WH.INSTANCE=new WH;class _E{constructor(e,t,n,r,o){this.injectionOffsets=e,this.injectionOptions=t,this.breakOffsets=n,this.breakOffsetsVisibleColumn=r,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 r=this.breakOffsets[e]-t;return e>0&&(r+=this.wrappedTextIndentLength),r}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let r=e===0?t:this.breakOffsets[e-1]+t;if(this.injectionOffsets!==null)for(let o=0;othis.injectionOffsets[o];o++)r0?this.breakOffsets[o-1]:0,t===0)if(e<=s)r=o-1;else if(e>l)n=o+1;else break;else if(e=l)n=o+1;else break}let a=e-s;return o>0&&(a+=this.wrappedTextIndentLength),new bR(o,a)}normalizeOutputPosition(e,t,n){if(this.injectionOffsets!==null){const r=this.outputPositionToOffsetInInputWithInjections(e,t),o=this.normalizeOffsetInInputWithInjectionsAroundInjections(r,n);if(o!==r)return this.offsetInInputWithInjectionsToOutputPosition(o,n)}if(n===0){if(e>0&&t===this.getMinOutputOffset(e))return new bR(e-1,this.getMaxOutputOffset(e-1))}else if(n===1){const r=this.getOutputLineCount()-1;if(e0&&(t=Math.max(0,t-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const n=this.getInjectedTextAtOffset(e);if(!n)return e;if(t===2){if(e===n.offsetInInputWithInjections+n.length&&Ore(this.injectionOptions[n.injectedTextIndex].cursorStops))return n.offsetInInputWithInjections+n.length;{let r=n.offsetInInputWithInjections;if(Fre(this.injectionOptions[n.injectedTextIndex].cursorStops))return r;let o=n.injectedTextIndex-1;for(;o>=0&&this.injectionOffsets[o]===this.injectionOffsets[n.injectedTextIndex]&&!(Ore(this.injectionOptions[o].cursorStops)||(r-=this.injectionOptions[o].content.length,Fre(this.injectionOptions[o].cursorStops)));)o--;return r}}else if(t===1||t===4){let r=n.offsetInInputWithInjections+n.length,o=n.injectedTextIndex;for(;o+1=0&&this.injectionOffsets[o-1]===this.injectionOffsets[o];)r-=this.injectionOptions[o-1].content.length,o--;return r}w4()}getInjectedText(e,t){const n=this.outputPositionToOffsetInInputWithInjections(e,t),r=this.getInjectedTextAtOffset(n);return r?{options:this.injectionOptions[r.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,n=this.injectionOptions;if(t!==null){let r=0;for(let o=0;oe)break;if(e<=l)return{injectedTextIndex:o,offsetInInputWithInjections:a,length:s};r+=s}}}}function Ore(i){return i==null?!0:i===ju.Right||i===ju.Both}function Fre(i){return i==null?!0:i===ju.Left||i===ju.Both}class bR{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new ae(e+this.outputLineIndex,this.outputOffset+1)}}class FVe{constructor(){this.changeType=1}}class gh{static applyInjectedText(e,t){if(!t||t.length===0)return e;let n="",r=0;for(const o of t)n+=e.substring(r,o.column-1),r=o.column-1,n+=o.options.content;return n+=e.substring(r),n}static fromDecorations(e){const t=[];for(const n of e)n.options.before&&n.options.before.content.length>0&&t.push(new gh(n.ownerId,n.range.startLineNumber,n.range.startColumn,n.options.before,0)),n.options.after&&n.options.after.content.length>0&&t.push(new gh(n.ownerId,n.range.endLineNumber,n.range.endColumn,n.options.after,1));return t.sort((n,r)=>n.lineNumber===r.lineNumber?n.column===r.column?n.order-r.order:n.column-r.column:n.lineNumber-r.lineNumber),t}constructor(e,t,n,r,o){this.ownerId=e,this.lineNumber=t,this.column=n,this.options=r,this.order=o}}class Bre{constructor(e,t,n){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=n}}class BVe{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class WVe{constructor(e,t,n,r){this.changeType=4,this.injectedTexts=r,this.fromLineNumber=e,this.toLineNumber=t,this.detail=n}}class $Ve{constructor(){this.changeType=5}}class zy{constructor(e,t,n,r){this.changes=e,this.versionId=t,this.isUndoing=n,this.isRedoing=r,this.resultingSelection=null}containsEvent(e){for(let t=0,n=this.changes.length;ti});class aX{static create(e){return new aX(new WeakRef(e))}constructor(e){this.targetWindow=e}createLineBreaksComputer(e,t,n,r,o){const s=[],a=[];return{addRequest:(l,c,u)=>{s.push(l),a.push(c)},finalize:()=>HVe(Vm(this.targetWindow.deref()),s,e,t,n,r,o,a)}}}function HVe(i,e,t,n,r,o,s,a){var l;function c(M){const A=a[M];if(A){const N=gh.applyInjectedText(e[M],A),R=A.map(W=>W.options),F=A.map(W=>W.column-1);return new _E(F,R,[N.length],[],0)}else return null}if(r===-1){const M=[];for(let A=0,N=e.length;Au?(N=0,R=0):F=u-G}const W=A.substr(N),H=VVe(W,R,n,F,p,f);v[M]=N,m[M]=R,_[M]=W,y[M]=H[0],S[M]=H[1]}const L=p.build(),E=(l=P6==null?void 0:P6.createHTML(L))!==null&&l!==void 0?l:L;g.innerHTML=E,g.style.position="absolute",g.style.top="10000",s==="keepAll"?(g.style.wordBreak="keep-all",g.style.overflowWrap="anywhere"):(g.style.wordBreak="inherit",g.style.overflowWrap="break-word"),i.document.body.appendChild(g);const D=document.createRange(),k=Array.prototype.slice.call(g.children,0),T=[];for(let M=0;Mre.options),U=K.map(re=>re.column-1)):(G=null,U=null),T[M]=new _E(U,G,N,H,F)}return i.document.body.removeChild(g),T}function VVe(i,e,t,n,r,o){if(o!==0){const h=String(o);r.appendString('
');const s=i.length;let a=e,l=0;const c=[],u=[];let d=0");for(let h=0;h"),c[h]=l,u[h]=a;const f=d;d=h+1"),c[i.length]=l,u[i.length]=a,r.appendString("
"),[c,u]}function zVe(i,e,t,n){if(t.length<=1)return null;const r=Array.prototype.slice.call(e.children,0),o=[];try{$H(i,r,n,0,null,t.length-1,null,o)}catch(s){return console.log(s),null}return o.length===0?null:(o.push(t.length),o)}function $H(i,e,t,n,r,o,s,a){if(n===o||(r=r||O6(i,e,t[n],t[n+1]),s=s||O6(i,e,t[o],t[o+1]),Math.abs(r[0].top-s[0].top)<=.1))return;if(n+1===o){a.push(o);return}const l=n+(o-n)/2|0,c=O6(i,e,t[l],t[l+1]);$H(i,e,t,n,r,l,c,a),$H(i,e,t,l,c,o,s,a)}function O6(i,e,t,n){return i.setStart(e[t/16384|0].firstChild,t%16384),i.setEnd(e[n/16384|0].firstChild,n%16384),i.getClientRects()}class UVe extends fe{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new lq),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[0]=!1,this._finishedInstantiation[1]=!1,this._finishedInstantiation[2]=!1,this._finishedInstantiation[3]=!1}initialize(e,t,n){this._editor=e,this._instantiationService=n;for(const r of t){if(this._pending.has(r.id)){en(new Error(`Cannot have two contributions with the same id ${r.id}`));continue}this._pending.set(r.id,r)}this._instantiateSome(0),this._register(yL(Pt(this._editor.getDomNode()),()=>{this._instantiateSome(1)})),this._register(yL(Pt(this._editor.getDomNode()),()=>{this._instantiateSome(2)})),this._register(yL(Pt(this._editor.getDomNode()),()=>{this._instantiateSome(3)},5e3))}saveViewState(){const e={};for(const[t,n]of this._instances)typeof n.saveViewState=="function"&&(e[t]=n.saveViewState());return e}restoreViewState(e){for(const[t,n]of this._instances)typeof n.restoreViewState=="function"&&n.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}onBeforeInteractionEvent(){this._instantiateSome(2)}onAfterModelAttached(){var e;return yL(Pt((e=this._editor)===null||e===void 0?void 0:e.getDomNode()),()=>{this._instantiateSome(1)},50)}_instantiateSome(e){if(this._finishedInstantiation[e])return;this._finishedInstantiation[e]=!0;const t=this._findPendingContributionsByInstantiation(e);for(const n of t)this._instantiateById(n.id)}_findPendingContributionsByInstantiation(e){const t=[];for(const[,n]of this._pending)n.instantiation===e&&t.push(n);return t}_instantiateById(e){const t=this._pending.get(e);if(t){if(this._pending.delete(e),!this._instantiationService||!this._editor)throw new Error("Cannot instantiate contributions before being initialized!");try{const n=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,n),typeof n.restoreViewState=="function"&&t.instantiation!==0&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(n){en(n)}}}}class Wve{constructor(e,t,n,r,o,s,a){this.id=e,this.label=t,this.alias=n,this.metadata=r,this._precondition=o,this._run=s,this._contextKeyService=a}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}function Zv(i){let e=0,t=0,n=0,r=0;for(let o=0,s=i.length;o=ac&&(t=t-i%ac),t}function XVe(i,e){return i.reduce((t,n)=>gr(t,e(n)),ya)}function $ve(i,e){return i===e}function ZD(i,e){const t=i,n=e;if(n-t<=0)return ya;const o=Math.floor(t/ac),s=Math.floor(n/ac),a=n-s*ac;if(o===s){const l=t-o*ac;return Fr(0,a-l)}else return Fr(s-o,a)}function Uy(i,e){return i=e}function fy(i){return Fr(i.lineNumber-1,i.column-1)}function ab(i,e){const t=i,n=Math.floor(t/ac),r=t-n*ac,o=e,s=Math.floor(o/ac),a=o-s*ac;return new B(n+1,r+1,s+1,a+1)}function YVe(i){const e=Jf(i);return Fr(e.length-1,e[e.length-1].length)}class op{static fromModelContentChanges(e){return e.map(n=>{const r=B.lift(n.range);return new op(fy(r.getStartPosition()),fy(r.getEndPosition()),YVe(n.text))}).reverse()}constructor(e,t,n){this.startOffset=e,this.endOffset=t,this.newLength=n}toString(){return`[${tu(this.startOffset)}...${tu(this.endOffset)}) -> ${tu(this.newLength)}`}}class ZVe{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>lX.from(t))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],n=t?this.translateOldToCur(t.offsetObj):null;return n===null?null:ZD(e,n)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?Fr(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):Fr(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=tu(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?Fr(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):Fr(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx>5;if(r===0){const s=1<this.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;this.line===null&&(this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const e=this.lineIdx,t=this.lineCharOffset;let n=0;for(;;){const o=this.lineTokens,s=o.getCount();let a=null;if(this.lineTokenOffset1e3))break;if(n>1500)break}const r=GVe(e,t,this.lineIdx,this.lineCharOffset);return new Om(r,0,-1,ro.getEmpty(),new I0(r))}}class ize{constructor(e,t){this.text=e,this._offset=ya,this.idx=0;const n=t.getRegExpStr(),r=n?new RegExp(n+`| -`,"gi"):null,o=[];let s,a=0,l=0,c=0,u=0;const d=[];for(let g=0;g<60;g++)d.push(new Om(Fr(0,g),0,-1,ro.getEmpty(),new I0(Fr(0,g))));const h=[];for(let g=0;g<60;g++)h.push(new Om(Fr(1,g),0,-1,ro.getEmpty(),new I0(Fr(1,g))));if(r)for(r.lastIndex=0;(s=r.exec(e))!==null;){const g=s.index,p=s[0];if(p===` -`)a++,l=g+1;else{if(c!==g){let v;if(u===a){const m=g-c;if(mrze(t)).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"gi"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e.toLowerCase())}findClosingTokenText(e){for(const[t,n]of this.map)if(n.kind===2&&n.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function rze(i){let e=fc(i);return/^[\w ]+/.test(i)&&(e=`\\b${e}`),/[\w ]+$/.test(i)&&(e=`${e}\\b`),e}class zve{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){return this.languageIdToBracketTokens.has(e)}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=dX.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function oze(i){if(i.length===0)return null;if(i.length===1)return i[0];let e=0;function t(){if(e>=i.length)return null;const s=e,a=i[s].listHeight;for(e++;e=2?Uve(s===0&&e===i.length?i:i.slice(s,e),!1):i[s]}let n=t(),r=t();if(!r)return n;for(let s=t();s;s=t())Hre(n,r)<=Hre(r,s)?(n=F6(n,r),r=s):r=F6(r,s);return F6(n,r)}function Uve(i,e=!1){if(i.length===0)return null;if(i.length===1)return i[0];let t=i.length;for(;t>3;){const n=t>>1;for(let r=0;r=3?i[2]:null,e)}function Hre(i,e){return Math.abs(i.listHeight-e.listHeight)}function F6(i,e){return i.listHeight===e.listHeight?Vf.create23(i,e,null,!1):i.listHeight>e.listHeight?sze(i,e):aze(e,i)}function sze(i,e){i=i.toMutable();let t=i;const n=[];let r;for(;;){if(e.listHeight===t.listHeight){r=e;break}if(t.kind!==4)throw new Error("unexpected");n.push(t),t=t.makeLastElementMutable()}for(let o=n.length-1;o>=0;o--){const s=n[o];r?s.childrenLength>=3?r=Vf.create23(s.unappendChild(),r,null,!1):(s.appendChildOfSameHeight(r),r=void 0):s.handleChildrenChanged()}return r?Vf.create23(i,r,null,!1):i}function aze(i,e){i=i.toMutable();let t=i;const n=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==4)throw new Error("unexpected");n.push(t),t=t.makeFirstElementMutable()}let r=e;for(let o=n.length-1;o>=0;o--){const s=n[o];r?s.childrenLength>=3?r=Vf.create23(r,s.unprependChild(),null,!1):(s.prependChildOfSameHeight(r),r=void 0):s.handleChildrenChanged()}return r?Vf.create23(r,i,null,!1):i}class lze{constructor(e){this.lastOffset=ya,this.nextNodes=[e],this.offsets=[ya],this.idxs=[]}readLongestNodeAt(e,t){if(Uy(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const n=Wx(this.nextNodes);if(!n)return;const r=Wx(this.offsets);if(Uy(e,r))return;if(Uy(r,e))if(gr(r,n.length)<=e)this.nextNodeAfterCurrent();else{const o=B6(n);o!==-1?(this.nextNodes.push(n.getChild(o)),this.offsets.push(r),this.idxs.push(o)):this.nextNodeAfterCurrent()}else{if(t(n))return this.nextNodeAfterCurrent(),n;{const o=B6(n);if(o===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(n.getChild(o)),this.offsets.push(r),this.idxs.push(o)}}}}nextNodeAfterCurrent(){for(;;){const e=Wx(this.offsets),t=Wx(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const n=Wx(this.nextNodes),r=B6(n,this.idxs[this.idxs.length-1]);if(r!==-1){this.nextNodes.push(n.getChild(r)),this.offsets.push(gr(e,t.length)),this.idxs[this.idxs.length-1]=r;break}else this.idxs.pop()}}}function B6(i,e=-1){for(;;){if(e++,e>=i.childrenLength)return-1;if(i.getChild(e))return e}}function Wx(i){return i.length>0?i[i.length-1]:void 0}function HH(i,e,t,n){return new cze(i,e,t,n).parseDocument()}class cze{constructor(e,t,n,r){if(this.tokenizer=e,this.createImmutableLists=r,this._itemsConstructed=0,this._itemsFromCache=0,n&&r)throw new Error("Not supported");this.oldNodeReader=n?new lze(n):void 0,this.positionMapper=new ZVe(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(ro.getEmpty(),0);return e||(e=Vf.getEmpty()),e}parseList(e,t){const n=[];for(;;){let o=this.tryReadChildFromCache(e);if(!o){const s=this.tokenizer.peek();if(!s||s.kind===2&&s.bracketIds.intersects(e))break;o=this.parseChild(e,t+1)}o.kind===4&&o.childrenLength===0||n.push(o)}return this.oldNodeReader?oze(n):Uve(n,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!fP(t)){const n=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),r=>t!==null&&!Uy(r.length,t)?!1:r.canBeReused(e));if(n)return this._itemsFromCache++,this.tokenizer.skip(n.length),n}}}parseChild(e,t){this._itemsConstructed++;const n=this.tokenizer.read();switch(n.kind){case 2:return new tze(n.bracketIds,n.length);case 0:return n.astNode;case 1:{if(t>300)return new I0(n.length);const r=e.merge(n.bracketIds),o=this.parseList(r,t+1),s=this.tokenizer.peek();return s&&s.kind===2&&(s.bracketId===n.bracketId||s.bracketIds.intersects(n.bracketIds))?(this.tokenizer.read(),QD.create(n.astNode,o,s.astNode)):QD.create(n.astNode,o,null)}default:throw new Error("unexpected")}}}function mP(i,e){if(i.length===0)return e;if(e.length===0)return i;const t=new Ep(Vre(i)),n=Vre(e);n.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let r=t.dequeue();function o(c){if(c===void 0){const d=t.takeWhile(h=>!0)||[];return r&&d.unshift(r),d}const u=[];for(;r&&!fP(c);){const[d,h]=r.splitAt(c);u.push(d),c=ZD(d.lengthAfter,c),r=h??t.dequeue()}return fP(c)||u.push(new Xm(!1,c,c)),u}const s=[];function a(c,u,d){if(s.length>0&&$ve(s[s.length-1].endOffset,c)){const h=s[s.length-1];s[s.length-1]=new op(h.startOffset,u,gr(h.newLength,d))}else s.push({startOffset:c,endOffset:u,newLength:d})}let l=ya;for(const c of n){const u=o(c.lengthBefore);if(c.modified){const d=XVe(u,f=>f.lengthBefore),h=gr(l,d);a(l,h,c.lengthAfter),l=h}else for(const d of u){const h=l;l=gr(l,d.lengthBefore),d.modified&&a(h,l,d.lengthAfter)}}return s}class Xm{constructor(e,t,n){this.modified=e,this.lengthBefore=t,this.lengthAfter=n}splitAt(e){const t=ZD(e,this.lengthAfter);return $ve(t,ya)?[this,void 0]:this.modified?[new Xm(this.modified,this.lengthBefore,e),new Xm(this.modified,ya,t)]:[new Xm(this.modified,e,e),new Xm(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${tu(this.lengthBefore)} -> ${tu(this.lengthAfter)}`}}function Vre(i){const e=[];let t=ya;for(const n of i){const r=ZD(t,n.startOffset);fP(r)||e.push(new Xm(!1,r,r));const o=ZD(n.startOffset,n.endOffset);e.push(new Xm(!0,o,n.newLength)),t=n.endOffset}return e}class uze extends fe{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new se,this.denseKeyProvider=new Hve,this.brackets=new zve(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)e.tokenization.backgroundTokenizationState===2?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens);else{const n=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),r=new ize(this.textModel.getValue(),n);this.initialAstWithoutTokens=HH(r,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(this.textModel.tokenization.backgroundTokenizationState===2){const e=this.initialAstWithoutTokens===void 0;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map(n=>new op(Fr(n.fromLineNumber-1,0),Fr(n.toLineNumber,0),Fr(n.toLineNumber-n.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=op.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const n=mP(this.queuedTextEdits,e);this.queuedTextEdits=n,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=mP(this.queuedTextEditsForInitialAstWithoutTokens,e))}flushQueue(){this.queuedTextEdits.length>0&&(this.astWithTokens=this.parseDocumentFromTextBuffer(this.queuedTextEdits,this.astWithTokens,!1),this.queuedTextEdits=[]),this.queuedTextEditsForInitialAstWithoutTokens.length>0&&(this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens,this.initialAstWithoutTokens,!1)),this.queuedTextEditsForInitialAstWithoutTokens=[])}parseDocumentFromTextBuffer(e,t,n){const r=t,o=new Vve(this.textModel,this.brackets);return HH(o,e,r,n)}getBracketsInRange(e,t){this.flushQueue();const n=Fr(e.startLineNumber-1,e.startColumn-1),r=Fr(e.endLineNumber-1,e.endColumn-1);return new If(o=>{const s=this.initialAstWithoutTokens||this.astWithTokens;VH(s,ya,s.length,n,r,o,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const n=fy(e.getStartPosition()),r=fy(e.getEndPosition());return new If(o=>{const s=this.initialAstWithoutTokens||this.astWithTokens,a=new dze(o,t,this.textModel);zH(s,ya,s.length,n,r,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return Kve(t,ya,t.length,fy(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return jve(t,ya,t.length,fy(e))}}function jve(i,e,t,n){if(i.kind===4||i.kind===2){const r=[];for(const o of i.children)t=gr(e,o.length),r.push({nodeOffsetStart:e,nodeOffsetEnd:t}),e=t;for(let o=r.length-1;o>=0;o--){const{nodeOffsetStart:s,nodeOffsetEnd:a}=r[o];if(Uy(s,n)){const l=jve(i.children[o],s,a,n);if(l)return l}}return null}else{if(i.kind===3)return null;if(i.kind===1){const r=ab(e,t);return{bracketInfo:i.bracketInfo,range:r}}}return null}function Kve(i,e,t,n){if(i.kind===4||i.kind===2){for(const r of i.children){if(t=gr(e,r.length),Uy(n,t)){const o=Kve(r,e,t,n);if(o)return o}e=t}return null}else{if(i.kind===3)return null;if(i.kind===1){const r=ab(e,t);return{bracketInfo:i.bracketInfo,range:r}}}return null}function VH(i,e,t,n,r,o,s,a,l,c,u=!1){if(s>200)return!0;e:for(;;)switch(i.kind){case 4:{const d=i.childrenLength;for(let h=0;h200)return!0;let c=!0;if(i.kind===2){let u=0;if(a){let f=a.get(i.openingBracket.text);f===void 0&&(f=0),u=f,f++,a.set(i.openingBracket.text,f)}const d=gr(e,i.openingBracket.length);let h=-1;if(o.includeMinIndentation&&(h=i.computeMinIndentation(e,o.textModel)),c=o.push(new KVe(ab(e,t),ab(e,d),i.closingBracket?ab(gr(d,((l=i.child)===null||l===void 0?void 0:l.length)||ya),t):void 0,s,u,i,h)),e=d,c&&i.child){const f=i.child;if(t=gr(e,f.length),jy(e,r)&&RL(t,n)&&(c=zH(f,e,t,n,r,o,s+1,a),!c))return!1}a==null||a.set(i.openingBracket.text,u)}else{let u=e;for(const d of i.children){const h=u;if(u=gr(u,d.length),jy(h,r)&&jy(n,u)&&(c=zH(d,h,u,n,r,o,s,a),!c))return!1}}return c}class hze extends fe{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new Ho),this.onDidChangeEmitter=new se,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(this.languageConfigurationService.onDidChange(n=>{var r;(!n.languageId||!((r=this.bracketPairsTree.value)===null||r===void 0)&&r.object.didLanguageChange(n.languageId))&&(this.bracketPairsTree.clear(),this.updateBracketPairsTree())}))}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){var t;(t=this.bracketPairsTree.value)===null||t===void 0||t.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){var e;(e=this.bracketPairsTree.value)===null||e===void 0||e.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){var t;(t=this.bracketPairsTree.value)===null||t===void 0||t.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const e=new Te;this.bracketPairsTree.value=fze(e.add(new uze(this.textModel,t=>this.languageConfigurationService.getLanguageConfiguration(t))),e),e.add(this.bracketPairsTree.value.object.onDidChange(t=>this.onDidChangeEmitter.fire(t))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire())}getBracketPairsInRange(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!1))||If.empty}getBracketPairsInRangeWithMinIndentation(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!0))||If.empty}getBracketsInRange(e,t=!1){var n;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((n=this.bracketPairsTree.value)===null||n===void 0?void 0:n.object.getBracketsInRange(e,t))||If.empty}findMatchingBracketUp(e,t,n){const r=this.textModel.validatePosition(t),o=this.textModel.getLanguageIdAtPosition(r.lineNumber,r.column);if(this.canBuildAST){const s=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew.getClosingBracketInfo(e);if(!s)return null;const a=this.getBracketPairsInRange(B.fromPositions(t,t)).findLast(l=>s.closes(l.openingBracketInfo));return a?a.openingBracketRange:null}else{const s=e.toLowerCase(),a=this.languageConfigurationService.getLanguageConfiguration(o).brackets;if(!a)return null;const l=a.textIsBracket[s];return l?CR(this._findMatchingBracketUp(l,r,W6(n))):null}}matchBracket(e,t){if(this.canBuildAST){const n=this.getBracketPairsInRange(B.fromPositions(e,e)).filter(r=>r.closingBracketRange!==void 0&&(r.openingBracketRange.containsPosition(e)||r.closingBracketRange.containsPosition(e))).findLastMaxBy(Jc(r=>r.openingBracketRange.containsPosition(e)?r.openingBracketRange:r.closingBracketRange,B.compareRangesUsingStarts));return n?[n.openingBracketRange,n.closingBracketRange]:null}else{const n=W6(t);return this._matchBracket(this.textModel.validatePosition(e),n)}}_establishBracketSearchOffsets(e,t,n,r){const o=t.getCount(),s=t.getLanguageId(r);let a=Math.max(0,e.column-1-n.maxBracketLength);for(let c=r-1;c>=0;c--){const u=t.getEndOffset(c);if(u<=a)break;if(Kh(t.getStandardTokenType(c))||t.getLanguageId(c)!==s){a=u;break}}let l=Math.min(t.getLineContent().length,e.column-1+n.maxBracketLength);for(let c=r+1;c=l)break;if(Kh(t.getStandardTokenType(c))||t.getLanguageId(c)!==s){l=u;break}}return{searchStartOffset:a,searchEndOffset:l}}_matchBracket(e,t){const n=e.lineNumber,r=this.textModel.tokenization.getLineTokens(n),o=this.textModel.getLineContent(n),s=r.findTokenIndexAtOffset(e.column-1);if(s<0)return null;const a=this.languageConfigurationService.getLanguageConfiguration(r.getLanguageId(s)).brackets;if(a&&!Kh(r.getStandardTokenType(s))){let{searchStartOffset:l,searchEndOffset:c}=this._establishBracketSearchOffsets(e,r,a,s),u=null;for(;;){const d=Mu.findNextBracketInRange(a.forwardRegex,n,o,l,c);if(!d)break;if(d.startColumn<=e.column&&e.column<=d.endColumn){const h=o.substring(d.startColumn-1,d.endColumn-1).toLowerCase(),f=this._matchFoundBracket(d,a.textIsBracket[h],a.textIsOpenBracket[h],t);if(f){if(f instanceof Ag)return null;u=f}}l=d.endColumn-1}if(u)return u}if(s>0&&r.getStartOffset(s)===e.column-1){const l=s-1,c=this.languageConfigurationService.getLanguageConfiguration(r.getLanguageId(l)).brackets;if(c&&!Kh(r.getStandardTokenType(l))){const{searchStartOffset:u,searchEndOffset:d}=this._establishBracketSearchOffsets(e,r,c,l),h=Mu.findPrevBracketInRange(c.reversedRegex,n,o,u,d);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn){const f=o.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),g=this._matchFoundBracket(h,c.textIsBracket[f],c.textIsOpenBracket[f],t);if(g)return g instanceof Ag?null:g}}}return null}_matchFoundBracket(e,t,n,r){if(!t)return null;const o=n?this._findMatchingBracketDown(t,e.getEndPosition(),r):this._findMatchingBracketUp(t,e.getStartPosition(),r);return o?o instanceof Ag?o:[e,o]:null}_findMatchingBracketUp(e,t,n){const r=e.languageId,o=e.reversedRegex;let s=-1,a=0;const l=(c,u,d,h)=>{for(;;){if(n&&++a%100===0&&!n())return Ag.INSTANCE;const f=Mu.findPrevBracketInRange(o,c,u,d,h);if(!f)break;const g=u.substring(f.startColumn-1,f.endColumn-1).toLowerCase();if(e.isOpen(g)?s++:e.isClose(g)&&s--,s===0)return f;h=f.startColumn-1}return null};for(let c=t.lineNumber;c>=1;c--){const u=this.textModel.tokenization.getLineTokens(c),d=u.getCount(),h=this.textModel.getLineContent(c);let f=d-1,g=h.length,p=h.length;c===t.lineNumber&&(f=u.findTokenIndexAtOffset(t.column-1),g=t.column-1,p=t.column-1);let v=!0;for(;f>=0;f--){const m=u.getLanguageId(f)===r&&!Kh(u.getStandardTokenType(f));if(m)v?g=u.getStartOffset(f):(g=u.getStartOffset(f),p=u.getEndOffset(f));else if(v&&g!==p){const _=l(c,h,g,p);if(_)return _}v=m}if(v&&g!==p){const m=l(c,h,g,p);if(m)return m}}return null}_findMatchingBracketDown(e,t,n){const r=e.languageId,o=e.forwardRegex;let s=1,a=0;const l=(u,d,h,f)=>{for(;;){if(n&&++a%100===0&&!n())return Ag.INSTANCE;const g=Mu.findNextBracketInRange(o,u,d,h,f);if(!g)break;const p=d.substring(g.startColumn-1,g.endColumn-1).toLowerCase();if(e.isOpen(p)?s++:e.isClose(p)&&s--,s===0)return g;h=g.endColumn-1}return null},c=this.textModel.getLineCount();for(let u=t.lineNumber;u<=c;u++){const d=this.textModel.tokenization.getLineTokens(u),h=d.getCount(),f=this.textModel.getLineContent(u);let g=0,p=0,v=0;u===t.lineNumber&&(g=d.findTokenIndexAtOffset(t.column-1),p=t.column-1,v=t.column-1);let m=!0;for(;g=1;a--){const l=this.textModel.tokenization.getLineTokens(a),c=l.getCount(),u=this.textModel.getLineContent(a);let d=c-1,h=u.length,f=u.length;if(a===n.lineNumber){d=l.findTokenIndexAtOffset(n.column-1),h=n.column-1,f=n.column-1;const p=l.getLanguageId(d);r!==p&&(r=p,o=this.languageConfigurationService.getLanguageConfiguration(r).brackets,s=this.languageConfigurationService.getLanguageConfiguration(r).bracketsNew)}let g=!0;for(;d>=0;d--){const p=l.getLanguageId(d);if(r!==p){if(o&&s&&g&&h!==f){const m=Mu.findPrevBracketInRange(o.reversedRegex,a,u,h,f);if(m)return this._toFoundBracket(s,m);g=!1}r=p,o=this.languageConfigurationService.getLanguageConfiguration(r).brackets,s=this.languageConfigurationService.getLanguageConfiguration(r).bracketsNew}const v=!!o&&!Kh(l.getStandardTokenType(d));if(v)g?h=l.getStartOffset(d):(h=l.getStartOffset(d),f=l.getEndOffset(d));else if(s&&o&&g&&h!==f){const m=Mu.findPrevBracketInRange(o.reversedRegex,a,u,h,f);if(m)return this._toFoundBracket(s,m)}g=v}if(s&&o&&g&&h!==f){const p=Mu.findPrevBracketInRange(o.reversedRegex,a,u,h,f);if(p)return this._toFoundBracket(s,p)}}return null}findNextBracket(e){var t;const n=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getFirstBracketAfter(n))||null;const r=this.textModel.getLineCount();let o=null,s=null,a=null;for(let l=n.lineNumber;l<=r;l++){const c=this.textModel.tokenization.getLineTokens(l),u=c.getCount(),d=this.textModel.getLineContent(l);let h=0,f=0,g=0;if(l===n.lineNumber){h=c.findTokenIndexAtOffset(n.column-1),f=n.column-1,g=n.column-1;const v=c.getLanguageId(h);o!==v&&(o=v,s=this.languageConfigurationService.getLanguageConfiguration(o).brackets,a=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew)}let p=!0;for(;hp.closingBracketRange!==void 0&&p.range.strictContainsRange(f));return g?[g.openingBracketRange,g.closingBracketRange]:null}const r=W6(t),o=this.textModel.getLineCount(),s=new Map;let a=[];const l=(f,g)=>{if(!s.has(f)){const p=[];for(let v=0,m=g?g.brackets.length:0;v{for(;;){if(r&&++c%100===0&&!r())return Ag.INSTANCE;const _=Mu.findNextBracketInRange(f.forwardRegex,g,p,v,m);if(!_)break;const y=p.substring(_.startColumn-1,_.endColumn-1).toLowerCase(),S=f.textIsBracket[y];if(S&&(S.isOpen(y)?a[S.index]++:S.isClose(y)&&a[S.index]--,a[S.index]===-1))return this._matchFoundBracket(_,S,!1,r);v=_.endColumn-1}return null};let d=null,h=null;for(let f=n.lineNumber;f<=o;f++){const g=this.textModel.tokenization.getLineTokens(f),p=g.getCount(),v=this.textModel.getLineContent(f);let m=0,_=0,y=0;if(f===n.lineNumber){m=g.findTokenIndexAtOffset(n.column-1),_=n.column-1,y=n.column-1;const L=g.getLanguageId(m);d!==L&&(d=L,h=this.languageConfigurationService.getLanguageConfiguration(d).brackets,l(d,h))}let S=!0;for(;me==null?void 0:e.dispose()}}function W6(i){if(typeof i>"u")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=i}}class Ag{constructor(){this._searchCanceledBrand=void 0}}Ag.INSTANCE=new Ag;function CR(i){return i instanceof Ag?null:i}class gze extends fe{constructor(e){super(),this.textModel=e,this.colorProvider=new Gve,this.onDidChangeEmitter=new se,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.bracketPairs.onDidChange(t=>{this.onDidChangeEmitter.fire()}))}handleDidChangeOptions(e){this.colorizationOptions=this.textModel.getOptions().bracketPairColorizationOptions}getDecorationsInRange(e,t,n,r){return r?[]:t===void 0?[]:this.colorizationOptions.enabled?this.textModel.bracketPairs.getBracketsInRange(e,!0).map(s=>({id:`bracket${s.range.toString()}-${s.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(s,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:s.range})).toArray():[]}getAllDecorations(e,t){return e===void 0?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new B(1,1,this.textModel.getLineCount(),1),e,t):[]}}class Gve{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e,t){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(t?e.nestingLevelOfEqualBracketType:e.nestingLevel)}getInlineClassNameOfLevel(e){return`bracket-highlighting-${e%30}`}}fu((i,e)=>{const t=[yve,wve,Sve,xve,Lve,Eve],n=new Gve;e.addRule(`.monaco-editor .${n.unexpectedClosingBracketClassName} { color: ${i.getColor(uHe)}; }`);const r=t.map(o=>i.getColor(o)).filter(o=>!!o).filter(o=>!o.isTransparent());for(let o=0;o<30;o++){const s=r[o%r.length];e.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(o)} { color: ${s}; }`)}});function yR(i){return i.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class as{get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,n,r){this.oldPosition=e,this.oldText=t,this.newPosition=n,this.newText=r}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${yR(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${yR(this.oldText)}")`:`(replace@${this.oldPosition} "${yR(this.oldText)}" with "${yR(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,n){const r=t.length;Nd(e,r,n),n+=4;for(let o=0;oi.length)return!1;if(t){if(!pq(i,e))return!1;if(e.length===i.length)return!0;let o=e.length;return e.charAt(e.length-1)===n&&o--,i.charAt(o)===n}return e.charAt(e.length-1)!==n&&(e+=n),i.indexOf(e)===0}function Xve(i){return i>=65&&i<=90||i>=97&&i<=122}function vze(i,e=Rs){return e?Xve(i.charCodeAt(0))&&i.charCodeAt(1)===58:!1}function Gh(i){return FA(i,!0)}class _ze{constructor(e){this._ignorePathCasing=e}compare(e,t,n=!1){return e===t?0:LD(this.getComparisonKey(e,n),this.getComparisonKey(t,n))}isEqual(e,t,n=!1){return e===t?!0:!e||!t?!1:this.getComparisonKey(e,n)===this.getComparisonKey(t,n)}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,n=!1){if(e.scheme===t.scheme){if(e.scheme===an.file)return UH(Gh(e),Gh(t),this._ignorePathCasing(e))&&e.query===t.query&&(n||e.fragment===t.fragment);if(jre(e.authority,t.authority))return UH(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(n||e.fragment===t.fragment)}return!1}joinPath(e,...t){return At.joinPath(e,...t)}basenameOrAuthority(e){return su(e)||e.authority}basename(e){return oo.basename(e.path)}extname(e){return oo.extname(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===an.file?t=At.file(Lpe(Gh(e))).path:(t=oo.dirname(e.path),e.authority&&t.length&&t.charCodeAt(0)!==47&&(console.error(`dirname("${e.toString})) resulted in a relative path`),t="/")),e.with({path:t})}normalizePath(e){if(!e.path.length)return e;let t;return e.scheme===an.file?t=At.file(xpe(Gh(e))).path:t=oo.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!jre(e.authority,t.authority))return;if(e.scheme===an.file){const o=m5e(Gh(e),Gh(t));return Rs?qve(o):o}let n=e.path||"/";const r=t.path||"/";if(this._ignorePathCasing(e)){let o=0;for(const s=Math.min(n.length,r.length);ozre(n).length&&n[n.length-1]===t}else{const n=e.path;return n.length>1&&n.charCodeAt(n.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=eh){return Kre(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=eh){let n=!1;if(e.scheme===an.file){const r=Gh(e);n=r!==void 0&&r.length===zre(r).length&&r[r.length-1]===t}else{t="/";const r=e.path;n=r.length===1&&r.charCodeAt(r.length-1)===47}return!n&&!Kre(e,t)?e.with({path:e.path+"/"}):e}}const Ui=new _ze(()=>!1),hX=Ui.isEqual.bind(Ui);Ui.isEqualOrParent.bind(Ui);Ui.getComparisonKey.bind(Ui);const bze=Ui.basenameOrAuthority.bind(Ui),su=Ui.basename.bind(Ui),Cze=Ui.extname.bind(Ui),z4=Ui.dirname.bind(Ui),yze=Ui.joinPath.bind(Ui),wze=Ui.normalizePath.bind(Ui),Sze=Ui.relativePath.bind(Ui),Ure=Ui.resolvePath.bind(Ui);Ui.isAbsolutePath.bind(Ui);const jre=Ui.isEqualAuthority.bind(Ui),Kre=Ui.hasTrailingPathSeparator.bind(Ui);Ui.removeTrailingPathSeparator.bind(Ui);Ui.addTrailingPathSeparator.bind(Ui);var Qv;(function(i){i.META_DATA_LABEL="label",i.META_DATA_DESCRIPTION="description",i.META_DATA_SIZE="size",i.META_DATA_MIME="mime";function e(t){const n=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach(s=>{const[a,l]=s.split(":");a&&l&&n.set(a,l)});const o=t.path.substring(0,t.path.indexOf(";"));return o&&n.set(i.META_DATA_MIME,o),n}i.parseMetaData=e})(Qv||(Qv={}));function QC(i){return i.toString()}class Po{static create(e,t){const n=e.getAlternativeVersionId(),r=jH(e);return new Po(n,n,r,r,t,t,[])}constructor(e,t,n,r,o,s,a){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=n,this.afterEOL=r,this.beforeCursorState=o,this.afterCursorState=s,this.changes=a}append(e,t,n,r,o){t.length>0&&(this.changes=pze(this.changes,t)),this.afterEOL=n,this.afterVersionId=r,this.afterCursorState=o}static _writeSelectionsSize(e){return 4+4*4*(e?e.length:0)}static _writeSelections(e,t,n){if(Nd(e,t?t.length:0,n),n+=4,t)for(const r of t)Nd(e,r.selectionStartLineNumber,n),n+=4,Nd(e,r.selectionStartColumn,n),n+=4,Nd(e,r.positionLineNumber,n),n+=4,Nd(e,r.positionColumn,n),n+=4;return n}static _readSelections(e,t,n){const r=Td(e,t);t+=4;for(let o=0;ot.toString()).join(", ")}matchesResource(e){return(At.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 Po}append(e,t,n,r,o){this._data instanceof Po&&this._data.append(e,t,n,r,o)}close(){this._data instanceof Po&&(this._data=this._data.serialize())}open(){this._data instanceof Po||(this._data=Po.deserialize(this._data))}undo(){if(At.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Po&&(this._data=this._data.serialize());const e=Po.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(At.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Po&&(this._data=this._data.serialize());const e=Po.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof Po&&(this._data=this._data.serialize()),this._data.byteLength+168}}class xze{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,n){this.label=e,this.code=t,this.type=1,this._isOpen=!0,this._editStackElementsArr=n.slice(0),this._editStackElementsMap=new Map;for(const r of this._editStackElementsArr){const o=QC(r.resource);this._editStackElementsMap.set(o,r)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=QC(e);return this._editStackElementsMap.has(t)}setModel(e){const t=QC(At.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=QC(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,n,r,o){const s=QC(e.uri);this._editStackElementsMap.get(s).append(e,t,n,r,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=QC(e);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).heapSize():0}split(){return this._editStackElementsArr}toString(){const e=[];for(const t of this._editStackElementsArr)e.push(`${su(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function jH(i){return i.getEOL()===` -`?0:1}function Pg(i){return i?i instanceof Yve||i instanceof xze:!1}class fX{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Pg(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Pg(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const n=this._undoRedoService.getLastElement(this._model.uri);if(Pg(n)&&n.canAppend(this._model))return n;const r=new Yve(w("edit","Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(r,t),r}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],jH(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,n,r){const o=this._getOrCreateEditStackElement(e,r),s=this._model.applyEdits(t,!0),a=fX._computeCursorState(n,s),l=s.map((c,u)=>({index:u,textChange:c.textChange}));return l.sort((c,u)=>c.textChange.oldPosition===u.textChange.oldPosition?c.index-u.index:c.textChange.oldPosition-u.textChange.oldPosition),o.append(this._model,l.map(c=>c.textChange),jH(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(n){return en(n),null}}}class Lze{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function Eze(i,e,t,n,r){r.spacesDiff=0,r.looksLikeAlignment=!1;let o;for(o=0;o0&&a>0||l>0&&c>0)return;const u=Math.abs(a-c),d=Math.abs(s-l);if(u===0){r.spacesDiff=d,d>0&&0<=l-1&&l-10?r++:S>1&&o++,Eze(s,a,v,y,d),d.looksLikeAlignment&&!(t&&e===d.spacesDiff)))continue;const E=d.spacesDiff;E<=c&&u[E]++,s=v,a=y}let h=t;r!==o&&(h=r{const v=u[p];v>g&&(g=v,f=p)}),f===4&&u[4]>0&&u[2]>0&&u[2]>=u[4]/2&&(f=2)}return{insertSpaces:h,tabSize:f}}function Ua(i){return(i.metadata&1)>>>0}function $i(i,e){i.metadata=i.metadata&254|e<<0}function ms(i){return(i.metadata&2)>>>1===1}function Mi(i,e){i.metadata=i.metadata&253|(e?1:0)<<1}function Zve(i){return(i.metadata&4)>>>2===1}function qre(i,e){i.metadata=i.metadata&251|(e?1:0)<<2}function Qve(i){return(i.metadata&64)>>>6===1}function Xre(i,e){i.metadata=i.metadata&191|(e?1:0)<<6}function Dze(i){return(i.metadata&24)>>>3}function Yre(i,e){i.metadata=i.metadata&231|e<<3}function Ize(i){return(i.metadata&32)>>>5===1}function Zre(i,e){i.metadata=i.metadata&223|(e?1:0)<<5}class Jve{constructor(e,t,n){this.metadata=0,this.parent=this,this.left=this,this.right=this,$i(this,1),this.start=t,this.end=n,this.delta=0,this.maxEnd=n,this.id=e,this.ownerId=0,this.options=null,qre(this,!1),Xre(this,!1),Yre(this,1),Zre(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=n,this.range=null,Mi(this,!1)}reset(e,t,n,r){this.start=t,this.end=n,this.maxEnd=n,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=n,this.range=r}setOptions(e){this.options=e;const t=this.options.className;qre(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),Xre(this,this.options.glyphMarginClassName!==null),Yre(this,this.options.stickiness),Zre(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,n){this.cachedVersionId!==n&&(this.range=null),this.cachedVersionId=n,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}const _n=new Jve(null,0,0);_n.parent=_n;_n.left=_n;_n.right=_n;$i(_n,0);class $6{constructor(){this.root=_n,this.requestNormalizeDelta=!1}intervalSearch(e,t,n,r,o,s){return this.root===_n?[]:Oze(this,e,t,n,r,o,s)}search(e,t,n,r){return this.root===_n?[]:Pze(this,e,t,n,r)}collectNodesFromOwner(e){return Mze(this,e)}collectNodesPostOrder(){return Aze(this)}insert(e){Qre(this,e),this._normalizeDeltaIfNecessary()}delete(e){Jre(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const n=e;let r=0;for(;e!==this.root;)e===e.parent.right&&(r+=e.parent.delta),e=e.parent;const o=n.start+r,s=n.end+r;n.setCachedOffsets(o,s,t)}acceptReplace(e,t,n,r){const o=Nze(this,e,e+t);for(let s=0,a=o.length;st||n===1?!1:n===2?!0:e}function Tze(i,e,t,n,r){const o=Dze(i),s=o===0||o===2,a=o===1||o===2,l=t-e,c=n,u=Math.min(l,c),d=i.start;let h=!1;const f=i.end;let g=!1;e<=d&&f<=t&&Ize(i)&&(i.start=e,h=!0,i.end=e,g=!0);{const v=r?1:l>0?2:0;!h&&JC(d,s,e,v)&&(h=!0),!g&&JC(f,a,e,v)&&(g=!0)}if(u>0&&!r){const v=l>c?2:0;!h&&JC(d,s,e+u,v)&&(h=!0),!g&&JC(f,a,e+u,v)&&(g=!0)}{const v=r?1:0;!h&&JC(d,s,t,v)&&(i.start=e+c,h=!0),!g&&JC(f,a,t,v)&&(i.end=e+c,g=!0)}const p=c-l;h||(i.start=Math.max(0,d+p)),g||(i.end=Math.max(0,f+p)),i.start>i.end&&(i.end=i.start)}function Nze(i,e,t){let n=i.root,r=0,o=0,s=0,a=0;const l=[];let c=0;for(;n!==_n;){if(ms(n)){Mi(n.left,!1),Mi(n.right,!1),n===n.parent.right&&(r-=n.parent.delta),n=n.parent;continue}if(!ms(n.left)){if(o=r+n.maxEnd,ot){Mi(n,!0);continue}if(a=r+n.end,a>=e&&(n.setCachedOffsets(s,a,0),l[c++]=n),Mi(n,!0),n.right!==_n&&!ms(n.right)){r+=n.delta,n=n.right;continue}}return Mi(i.root,!1),l}function Rze(i,e,t,n){let r=i.root,o=0,s=0,a=0;const l=n-(t-e);for(;r!==_n;){if(ms(r)){Mi(r.left,!1),Mi(r.right,!1),r===r.parent.right&&(o-=r.parent.delta),Jv(r),r=r.parent;continue}if(!ms(r.left)){if(s=o+r.maxEnd,st){r.start+=l,r.end+=l,r.delta+=l,(r.delta<-1073741824||r.delta>1073741824)&&(i.requestNormalizeDelta=!0),Mi(r,!0);continue}if(Mi(r,!0),r.right!==_n&&!ms(r.right)){o+=r.delta,r=r.right;continue}}Mi(i.root,!1)}function Mze(i,e){let t=i.root;const n=[];let r=0;for(;t!==_n;){if(ms(t)){Mi(t.left,!1),Mi(t.right,!1),t=t.parent;continue}if(t.left!==_n&&!ms(t.left)){t=t.left;continue}if(t.ownerId===e&&(n[r++]=t),Mi(t,!0),t.right!==_n&&!ms(t.right)){t=t.right;continue}}return Mi(i.root,!1),n}function Aze(i){let e=i.root;const t=[];let n=0;for(;e!==_n;){if(ms(e)){Mi(e.left,!1),Mi(e.right,!1),e=e.parent;continue}if(e.left!==_n&&!ms(e.left)){e=e.left;continue}if(e.right!==_n&&!ms(e.right)){e=e.right;continue}t[n++]=e,Mi(e,!0)}return Mi(i.root,!1),t}function Pze(i,e,t,n,r){let o=i.root,s=0,a=0,l=0;const c=[];let u=0;for(;o!==_n;){if(ms(o)){Mi(o.left,!1),Mi(o.right,!1),o===o.parent.right&&(s-=o.parent.delta),o=o.parent;continue}if(o.left!==_n&&!ms(o.left)){o=o.left;continue}a=s+o.start,l=s+o.end,o.setCachedOffsets(a,l,n);let d=!0;if(e&&o.ownerId&&o.ownerId!==e&&(d=!1),t&&Zve(o)&&(d=!1),r&&!Qve(o)&&(d=!1),d&&(c[u++]=o),Mi(o,!0),o.right!==_n&&!ms(o.right)){s+=o.delta,o=o.right;continue}}return Mi(i.root,!1),c}function Oze(i,e,t,n,r,o,s){let a=i.root,l=0,c=0,u=0,d=0;const h=[];let f=0;for(;a!==_n;){if(ms(a)){Mi(a.left,!1),Mi(a.right,!1),a===a.parent.right&&(l-=a.parent.delta),a=a.parent;continue}if(!ms(a.left)){if(c=l+a.maxEnd,ct){Mi(a,!0);continue}if(d=l+a.end,d>=e){a.setCachedOffsets(u,d,o);let g=!0;n&&a.ownerId&&a.ownerId!==n&&(g=!1),r&&Zve(a)&&(g=!1),s&&!Qve(a)&&(g=!1),g&&(h[f++]=a)}if(Mi(a,!0),a.right!==_n&&!ms(a.right)){l+=a.delta,a=a.right;continue}}return Mi(i.root,!1),h}function Qre(i,e){if(i.root===_n)return e.parent=_n,e.left=_n,e.right=_n,$i(e,0),i.root=e,i.root;Fze(i,e),bm(e.parent);let t=e;for(;t!==i.root&&Ua(t.parent)===1;)if(t.parent===t.parent.parent.left){const n=t.parent.parent.right;Ua(n)===1?($i(t.parent,0),$i(n,0),$i(t.parent.parent,1),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,bE(i,t)),$i(t.parent,0),$i(t.parent.parent,1),CE(i,t.parent.parent))}else{const n=t.parent.parent.left;Ua(n)===1?($i(t.parent,0),$i(n,0),$i(t.parent.parent,1),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,CE(i,t)),$i(t.parent,0),$i(t.parent.parent,1),bE(i,t.parent.parent))}return $i(i.root,0),e}function Fze(i,e){let t=0,n=i.root;const r=e.start,o=e.end;for(;;)if(Wze(r,o,n.start+t,n.end+t)<0)if(n.left===_n){e.start-=t,e.end-=t,e.maxEnd-=t,n.left=e;break}else n=n.left;else if(n.right===_n){e.start-=t+n.delta,e.end-=t+n.delta,e.maxEnd-=t+n.delta,n.right=e;break}else t+=n.delta,n=n.right;e.parent=n,e.left=_n,e.right=_n,$i(e,1)}function Jre(i,e){let t,n;if(e.left===_n?(t=e.right,n=e,t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(i.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===_n?(t=e.left,n=e):(n=Bze(e.right),t=n.right,t.start+=n.delta,t.end+=n.delta,t.delta+=n.delta,(t.delta<-1073741824||t.delta>1073741824)&&(i.requestNormalizeDelta=!0),n.start+=e.delta,n.end+=e.delta,n.delta=e.delta,(n.delta<-1073741824||n.delta>1073741824)&&(i.requestNormalizeDelta=!0)),n===i.root){i.root=t,$i(t,0),e.detach(),H6(),Jv(t),i.root.parent=_n;return}const r=Ua(n)===1;if(n===n.parent.left?n.parent.left=t:n.parent.right=t,n===e?t.parent=n.parent:(n.parent===e?t.parent=n:t.parent=n.parent,n.left=e.left,n.right=e.right,n.parent=e.parent,$i(n,Ua(e)),e===i.root?i.root=n:e===e.parent.left?e.parent.left=n:e.parent.right=n,n.left!==_n&&(n.left.parent=n),n.right!==_n&&(n.right.parent=n)),e.detach(),r){bm(t.parent),n!==e&&(bm(n),bm(n.parent)),H6();return}bm(t),bm(t.parent),n!==e&&(bm(n),bm(n.parent));let o;for(;t!==i.root&&Ua(t)===0;)t===t.parent.left?(o=t.parent.right,Ua(o)===1&&($i(o,0),$i(t.parent,1),bE(i,t.parent),o=t.parent.right),Ua(o.left)===0&&Ua(o.right)===0?($i(o,1),t=t.parent):(Ua(o.right)===0&&($i(o.left,0),$i(o,1),CE(i,o),o=t.parent.right),$i(o,Ua(t.parent)),$i(t.parent,0),$i(o.right,0),bE(i,t.parent),t=i.root)):(o=t.parent.left,Ua(o)===1&&($i(o,0),$i(t.parent,1),CE(i,t.parent),o=t.parent.left),Ua(o.left)===0&&Ua(o.right)===0?($i(o,1),t=t.parent):(Ua(o.left)===0&&($i(o.right,0),$i(o,1),bE(i,o),o=t.parent.left),$i(o,Ua(t.parent)),$i(t.parent,0),$i(o.left,0),CE(i,t.parent),t=i.root));$i(t,0),H6()}function Bze(i){for(;i.left!==_n;)i=i.left;return i}function H6(){_n.parent=_n,_n.delta=0,_n.start=0,_n.end=0}function bE(i,e){const t=e.right;t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(i.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==_n&&(t.left.parent=e),t.parent=e.parent,e.parent===_n?i.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,Jv(e),Jv(t)}function CE(i,e){const t=e.left;e.delta-=t.delta,(e.delta<-1073741824||e.delta>1073741824)&&(i.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==_n&&(t.right.parent=e),t.parent=e.parent,e.parent===_n?i.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,Jv(e),Jv(t)}function e_e(i){let e=i.end;if(i.left!==_n){const t=i.left.maxEnd;t>e&&(e=t)}if(i.right!==_n){const t=i.right.maxEnd+i.delta;t>e&&(e=t)}return e}function Jv(i){i.maxEnd=e_e(i)}function bm(i){for(;i!==_n;){const e=e_e(i);if(i.maxEnd===e)return;i.maxEnd=e,i=i.parent}}function Wze(i,e,t,n){return i===t?e-n:i-t}class KH{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!==rn)return gX(this.right);let e=this;for(;e.parent!==rn&&e.parent.left!==e;)e=e.parent;return e.parent===rn?rn:e.parent}prev(){if(this.left!==rn)return t_e(this.left);let e=this;for(;e.parent!==rn&&e.parent.right!==e;)e=e.parent;return e.parent===rn?rn:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const rn=new KH(null,0);rn.parent=rn;rn.left=rn;rn.right=rn;rn.color=0;function gX(i){for(;i.left!==rn;)i=i.left;return i}function t_e(i){for(;i.right!==rn;)i=i.right;return i}function pX(i){return i===rn?0:i.size_left+i.piece.length+pX(i.right)}function mX(i){return i===rn?0:i.lf_left+i.piece.lineFeedCnt+mX(i.right)}function V6(){rn.parent=rn}function yE(i,e){const t=e.right;t.size_left+=e.size_left+(e.piece?e.piece.length:0),t.lf_left+=e.lf_left+(e.piece?e.piece.lineFeedCnt:0),e.right=t.left,t.left!==rn&&(t.left.parent=e),t.parent=e.parent,e.parent===rn?i.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function wE(i,e){const t=e.left;e.left=t.right,t.right!==rn&&(t.right.parent=e),t.parent=e.parent,e.size_left-=t.size_left+(t.piece?t.piece.length:0),e.lf_left-=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),e.parent===rn?i.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function wR(i,e){let t,n;if(e.left===rn?(n=e,t=n.right):e.right===rn?(n=e,t=n.left):(n=gX(e.right),t=n.right),n===i.root){i.root=t,t.color=0,e.detach(),V6(),i.root.parent=rn;return}const r=n.color===1;if(n===n.parent.left?n.parent.left=t:n.parent.right=t,n===e?(t.parent=n.parent,ML(i,t)):(n.parent===e?t.parent=n:t.parent=n.parent,ML(i,t),n.left=e.left,n.right=e.right,n.parent=e.parent,n.color=e.color,e===i.root?i.root=n:e===e.parent.left?e.parent.left=n:e.parent.right=n,n.left!==rn&&(n.left.parent=n),n.right!==rn&&(n.right.parent=n),n.size_left=e.size_left,n.lf_left=e.lf_left,ML(i,n)),e.detach(),t.parent.left===t){const s=pX(t),a=mX(t);if(s!==t.parent.size_left||a!==t.parent.lf_left){const l=s-t.parent.size_left,c=a-t.parent.lf_left;t.parent.size_left=s,t.parent.lf_left=a,xg(i,t.parent,l,c)}}if(ML(i,t.parent),r){V6();return}let o;for(;t!==i.root&&t.color===0;)t===t.parent.left?(o=t.parent.right,o.color===1&&(o.color=0,t.parent.color=1,yE(i,t.parent),o=t.parent.right),o.left.color===0&&o.right.color===0?(o.color=1,t=t.parent):(o.right.color===0&&(o.left.color=0,o.color=1,wE(i,o),o=t.parent.right),o.color=t.parent.color,t.parent.color=0,o.right.color=0,yE(i,t.parent),t=i.root)):(o=t.parent.left,o.color===1&&(o.color=0,t.parent.color=1,wE(i,t.parent),o=t.parent.left),o.left.color===0&&o.right.color===0?(o.color=1,t=t.parent):(o.left.color===0&&(o.right.color=0,o.color=1,yE(i,o),o=t.parent.left),o.color=t.parent.color,t.parent.color=0,o.left.color=0,wE(i,t.parent),t=i.root));t.color=0,V6()}function eoe(i,e){for(ML(i,e);e!==i.root&&e.parent.color===1;)if(e.parent===e.parent.parent.left){const t=e.parent.parent.right;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.right&&(e=e.parent,yE(i,e)),e.parent.color=0,e.parent.parent.color=1,wE(i,e.parent.parent))}else{const t=e.parent.parent.left;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.left&&(e=e.parent,wE(i,e)),e.parent.color=0,e.parent.parent.color=1,yE(i,e.parent.parent))}i.root.color=0}function xg(i,e,t,n){for(;e!==i.root&&e!==rn;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=n),e=e.parent}function ML(i,e){let t=0,n=0;if(e!==i.root){for(;e!==i.root&&e===e.parent.right;)e=e.parent;if(e!==i.root)for(e=e.parent,t=pX(e.left)-e.size_left,n=mX(e.left)-e.lf_left,e.size_left+=t,e.lf_left+=n;e!==i.root&&(t!==0||n!==0);)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=n),e=e.parent}}const pg=65535;function n_e(i){let e;return i[i.length-1]<65536?e=new Uint16Array(i.length):e=new Uint32Array(i.length),e.set(i,0),e}class $ze{constructor(e,t,n,r,o){this.lineStarts=e,this.cr=t,this.lf=n,this.crlf=r,this.isBasicASCII=o}}function Dg(i,e=!0){const t=[0];let n=1;for(let r=0,o=i.length;r126)&&(s=!1)}const a=new $ze(n_e(i),n,r,o,s);return i.length=0,a}class gl{constructor(e,t,n,r,o){this.bufferIndex=e,this.start=t,this.end=n,this.lineFeedCnt=r,this.length=o}}class k0{constructor(e,t){this.buffer=e,this.lineStarts=t}}class Vze{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==rn&&e.iterate(e.root,n=>(n!==rn&&this._pieces.push(n.piece),!0))}read(){return this._pieces.length===0?this._index===0?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:this._index===0?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class zze{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){const n=this._cache[t];if(n.nodeStartOffset<=e&&n.nodeStartOffset+n.node.piece.length>=e)return n}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){const n=this._cache[t];if(n.nodeStartLineNumber&&n.nodeStartLineNumber=e)return n}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1;const n=this._cache;for(let r=0;r=e){n[r]=null,t=!0;continue}}if(t){const r=[];for(const o of n)o!==null&&r.push(o);this._cache=r}}}class Uze{constructor(e,t,n){this.create(e,t,n)}create(e,t,n){this._buffers=[new k0("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=rn,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=n;let r=null;for(let o=0,s=e.length;o0){e[o].lineStarts||(e[o].lineStarts=Dg(e[o].buffer));const a=new gl(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]),r=this.rbInsertRight(r,a)}this._searchCache=new zze(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=pg,n=t-Math.floor(t/3),r=n*2;let o="",s=0;const a=[];if(this.iterate(this.root,l=>{const c=this.getNodeContent(l),u=c.length;if(s<=n||s+u0){const l=o.replace(/\r\n|\r|\n/g,e);a.push(new k0(l,Dg(l)))}this.create(a,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new Vze(this,e)}getOffsetAt(e,t){let n=0,r=this.root;for(;r!==rn;)if(r.left!==rn&&r.lf_left+1>=e)r=r.left;else if(r.lf_left+r.piece.lineFeedCnt+1>=e){n+=r.size_left;const o=this.getAccumulatedValue(r,e-r.lf_left-2);return n+=o+t-1}else e-=r.lf_left+r.piece.lineFeedCnt,n+=r.size_left+r.piece.length,r=r.right;return n}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,n=0;const r=e;for(;t!==rn;)if(t.size_left!==0&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){const o=this.getIndexOf(t,e-t.size_left);if(n+=t.lf_left+o.index,o.index===0){const s=this.getOffsetAt(n+1,1),a=r-s;return new ae(n+1,a+1)}return new ae(n+1,o.remainder+1)}else if(e-=t.size_left+t.piece.length,n+=t.lf_left+t.piece.lineFeedCnt,t.right===rn){const o=this.getOffsetAt(n+1,1),s=r-e-o;return new ae(n+1,s+1)}else t=t.right;return new ae(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";const n=this.nodeAt2(e.startLineNumber,e.startColumn),r=this.nodeAt2(e.endLineNumber,e.endColumn),o=this.getValueInRange2(n,r);return t?t!==this._EOL||!this._EOLNormalized?o.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?o:o.replace(/\r\n|\r|\n/g,t):o}getValueInRange2(e,t){if(e.node===t.node){const a=e.node,l=this._buffers[a.piece.bufferIndex].buffer,c=this.offsetInBuffer(a.piece.bufferIndex,a.piece.start);return l.substring(c+e.remainder,c+t.remainder)}let n=e.node;const r=this._buffers[n.piece.bufferIndex].buffer,o=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);let s=r.substring(o+e.remainder,o+n.piece.length);for(n=n.next();n!==rn;){const a=this._buffers[n.piece.bufferIndex].buffer,l=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);if(n===t.node){s+=a.substring(l,l+t.remainder);break}else s+=a.substr(l,n.piece.length);n=n.next()}return s}getLinesContent(){const e=[];let t=0,n="",r=!1;return this.iterate(this.root,o=>{if(o===rn)return!0;const s=o.piece;let a=s.length;if(a===0)return!0;const l=this._buffers[s.bufferIndex].buffer,c=this._buffers[s.bufferIndex].lineStarts,u=s.start.line,d=s.end.line;let h=c[u]+s.start.column;if(r&&(l.charCodeAt(h)===10&&(h++,a--),e[t++]=n,n="",r=!1,a===0))return!0;if(u===d)return!this._EOLNormalized&&l.charCodeAt(h+a-1)===13?(r=!0,n+=l.substr(h,a-1)):n+=l.substr(h,a),!0;n+=this._EOLNormalized?l.substring(h,Math.max(h,c[u+1]-this._EOLLength)):l.substring(h,c[u+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=n;for(let f=u+1;fS+g,t.reset(0)):(_=h.buffer,y=S=>S,t.reset(g));do if(v=t.next(_),v){if(y(v.index)>=p)return u;this.positionInBuffer(e,y(v.index)-f,m);const S=this.getLineFeedCnt(e.piece.bufferIndex,o,m),L=m.line===o.line?m.column-o.column+r:m.column+1,E=L+v[0].length;if(d[u++]=S0(new B(n+S,L,n+S,E),v,l),y(v.index)+v[0].length>=p||u>=c)return u}while(v);return u}findMatchesLineByLine(e,t,n,r){const o=[];let s=0;const a=new iy(t.wordSeparators,t.regex);let l=this.nodeAt2(e.startLineNumber,e.startColumn);if(l===null)return[];const c=this.nodeAt2(e.endLineNumber,e.endColumn);if(c===null)return[];let u=this.positionInBuffer(l.node,l.remainder);const d=this.positionInBuffer(c.node,c.remainder);if(l.node===c.node)return this.findMatchesInNode(l.node,a,e.startLineNumber,e.startColumn,u,d,t,n,r,s,o),o;let h=e.startLineNumber,f=l.node;for(;f!==c.node;){const p=this.getLineFeedCnt(f.piece.bufferIndex,u,f.piece.end);if(p>=1){const m=this._buffers[f.piece.bufferIndex].lineStarts,_=this.offsetInBuffer(f.piece.bufferIndex,f.piece.start),y=m[u.line+p],S=h===e.startLineNumber?e.startColumn:1;if(s=this.findMatchesInNode(f,a,h,S,u,this.positionInBuffer(f,y-_),t,n,r,s,o),s>=r)return o;h+=p}const v=h===e.startLineNumber?e.startColumn-1:0;if(h===e.endLineNumber){const m=this.getLineContent(h).substring(v,e.endColumn-1);return s=this._findMatchesInLine(t,a,m,e.endLineNumber,v,s,o,n,r),o}if(s=this._findMatchesInLine(t,a,this.getLineContent(h).substr(v),h,v,s,o,n,r),s>=r)return o;h++,l=this.nodeAt2(h,1),f=l.node,u=this.positionInBuffer(l.node,l.remainder)}if(h===e.endLineNumber){const p=h===e.startLineNumber?e.startColumn-1:0,v=this.getLineContent(h).substring(p,e.endColumn-1);return s=this._findMatchesInLine(t,a,v,e.endLineNumber,p,s,o,n,r),o}const g=h===e.startLineNumber?e.startColumn:1;return s=this.findMatchesInNode(c.node,a,h,g,u,d,t,n,r,s,o),o}_findMatchesInLine(e,t,n,r,o,s,a,l,c){const u=e.wordSeparators;if(!l&&e.simpleSearch){const h=e.simpleSearch,f=h.length,g=n.length;let p=-f;for(;(p=n.indexOf(h,p+f))!==-1;)if((!u||Pq(u,n,g,p,f))&&(a[s++]=new ND(new B(r,p+1+o,r,p+1+f+o),null),s>=c))return s;return s}let d;t.reset(0);do if(d=t.next(n),d&&(a[s++]=S0(new B(r,d.index+1+o,r,d.index+1+d[0].length+o),d,l),s>=c))return s;while(d);return s}insert(e,t,n=!1){if(this._EOLNormalized=this._EOLNormalized&&n,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==rn){const{node:r,remainder:o,nodeStartOffset:s}=this.nodeAt(e),a=r.piece,l=a.bufferIndex,c=this.positionInBuffer(r,o);if(r.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&s+a.length===e&&t.lengthe){const u=[];let d=new gl(a.bufferIndex,c,a.end,this.getLineFeedCnt(a.bufferIndex,c,a.end),this.offsetInBuffer(l,a.end)-this.offsetInBuffer(l,c));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&this.nodeCharCodeAt(r,o)===10){const p={line:d.start.line+1,column:0};d=new gl(d.bufferIndex,p,d.end,this.getLineFeedCnt(d.bufferIndex,p,d.end),d.length-1),t+=` +`);else{a--;const l=t.getLineMaxColumn(a);r[o]=this._enter(e,t,!1,new B(a,l,a,l))}}return r}static lineInsertAfter(e,t,n){if(t===null||n===null)return[];const r=[];for(let o=0,s=n.length;o{const r=t.get(Un).getFocusedCodeEditor();return r&&r.hasTextFocus()?this._runEditorCommand(t,r,n):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,n)=>{const r=fs();return r&&["input","textarea"].indexOf(r.tagName.toLowerCase())>=0?(this.runDOMCommand(r),!0):!1}),e.addImplementation(0,"generic-dom",(t,n)=>{const r=t.get(Un).getActiveCodeEditor();return r?(r.focus(),this._runEditorCommand(t,r,n)):!1})}_runEditorCommand(e,t,n){const r=this.runEditorCommand(e,t,n);return r||!0}}var Ao;(function(i){class e extends vr{constructor(_){super(_),this._inSelectionMode=_.inSelectionMode}runCoreEditorCommand(_,y){if(!y.position)return;_.model.pushStackElement(),_.setCursorStates(y.source,3,[Go.moveTo(_,_.getPrimaryCursorState(),this._inSelectionMode,y.position,y.viewPosition)])&&y.revealType!==2&&_.revealPrimaryCursor(y.source,!0,!0)}}i.MoveTo=et(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),i.MoveToSelect=et(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends vr{runCoreEditorCommand(_,y){_.model.pushStackElement();const S=this._getColumnSelectResult(_,_.getPrimaryCursorState(),_.getCursorColumnSelectData(),y);S!==null&&(_.setCursorStates(y.source,3,S.viewStates.map(L=>Wn.fromViewState(L))),_.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:S.fromLineNumber,fromViewVisualColumn:S.fromVisualColumn,toViewLineNumber:S.toLineNumber,toViewVisualColumn:S.toVisualColumn}),S.reversed?_.revealTopMostCursor(y.source):_.revealBottomMostCursor(y.source))}}i.ColumnSelect=et(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(m,_,y,S){if(typeof S.position>"u"||typeof S.viewPosition>"u"||typeof S.mouseColumn>"u")return null;const L=m.model.validatePosition(S.position),E=m.coordinatesConverter.validateViewPosition(new ae(S.viewPosition.lineNumber,S.viewPosition.column),L),D=S.doColumnSelect?y.fromViewLineNumber:E.lineNumber,k=S.doColumnSelect?y.fromViewVisualColumn:S.mouseColumn-1;return E0.columnSelect(m.cursorConfig,m,D,k,E.lineNumber,S.mouseColumn-1)}}),i.CursorColumnSelectLeft=et(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(m,_,y,S){return E0.columnSelectLeft(m.cursorConfig,m,y)}}),i.CursorColumnSelectRight=et(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(m,_,y,S){return E0.columnSelectRight(m.cursorConfig,m,y)}});class n extends t{constructor(_){super(_),this._isPaged=_.isPaged}_getColumnSelectResult(_,y,S,L){return E0.columnSelectUp(_.cursorConfig,_,S,this._isPaged)}}i.CursorColumnSelectUp=et(new n({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:3600,linux:{primary:0}}})),i.CursorColumnSelectPageUp=et(new n({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:3595,linux:{primary:0}}}));class r extends t{constructor(_){super(_),this._isPaged=_.isPaged}_getColumnSelectResult(_,y,S,L){return E0.columnSelectDown(_.cursorConfig,_,S,this._isPaged)}}i.CursorColumnSelectDown=et(new r({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:3602,linux:{primary:0}}})),i.CursorColumnSelectPageDown=et(new r({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:3596,linux:{primary:0}}}));class o extends vr{constructor(){super({id:"cursorMove",precondition:void 0,metadata:uP.metadata})}runCoreEditorCommand(_,y){const S=uP.parse(y);S&&this._runCursorMove(_,y.source,S)}_runCursorMove(_,y,S){_.model.pushStackElement(),_.setCursorStates(y,3,o._move(_,_.getCursorStates(),S)),_.revealPrimaryCursor(y,!0)}static _move(_,y,S){const L=S.select,E=S.value;switch(S.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return Go.simpleMove(_,y,S.direction,L,E,S.unit);case 11:case 13:case 12:case 14:return Go.viewportMove(_,y,S.direction,L,E);default:return null}}}i.CursorMoveImpl=o,i.CursorMove=et(new o);class s extends vr{constructor(_){super(_),this._staticArgs=_.args}runCoreEditorCommand(_,y){let S=this._staticArgs;this._staticArgs.value===-1&&(S={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:y.pageSize||_.cursorConfig.pageSize}),_.model.pushStackElement(),_.setCursorStates(y.source,3,Go.simpleMove(_,_.getCursorStates(),S.direction,S.select,S.value,S.unit)),_.revealPrimaryCursor(y.source,!0)}}i.CursorLeft=et(new s({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),i.CursorLeftSelect=et(new s({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:1039}})),i.CursorRight=et(new s({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),i.CursorRightSelect=et(new s({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:1041}})),i.CursorUp=et(new s({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),i.CursorUpSelect=et(new s({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),i.CursorPageUp=et(new s({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:11}})),i.CursorPageUpSelect=et(new s({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:1035}})),i.CursorDown=et(new s({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),i.CursorDownSelect=et(new s({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),i.CursorPageDown=et(new s({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:12}})),i.CursorPageDownSelect=et(new s({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:1036}})),i.CreateCursor=et(new class extends vr{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(m,_){if(!_.position)return;let y;_.wholeLine?y=Go.line(m,m.getPrimaryCursorState(),!1,_.position,_.viewPosition):y=Go.moveTo(m,m.getPrimaryCursorState(),!1,_.position,_.viewPosition);const S=m.getCursorStates();if(S.length>1){const L=y.modelState?y.modelState.position:null,E=y.viewState?y.viewState.position:null;for(let D=0,k=S.length;DE&&(L=E);const D=new B(L,1,L,m.model.getLineMaxColumn(L));let k=0;if(y.at)switch(y.at){case hy.RawAtArgument.Top:k=3;break;case hy.RawAtArgument.Center:k=1;break;case hy.RawAtArgument.Bottom:k=4;break}const T=m.coordinatesConverter.convertModelRangeToViewRange(D);m.revealRange(_.source,!1,T,k,0)}}),i.SelectAll=new class extends OH{constructor(){super(K8e)}runDOMCommand(m){ru&&(m.focus(),m.select()),m.ownerDocument.execCommand("selectAll")}runEditorCommand(m,_,y){const S=_._getViewModel();S&&this.runCoreEditorCommand(S,y)}runCoreEditorCommand(m,_){m.model.pushStackElement(),m.setCursorStates("keyboard",3,[Go.selectAll(m,m.getPrimaryCursorState())])}},i.SetSelection=et(new class extends vr{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(m,_){_.selection&&(m.model.pushStackElement(),m.setCursorStates(_.source,3,[Wn.fromModelSelection(_.selection)]))}})})(Ao||(Ao={}));const VHe=De.and(j.textInputFocus,j.columnSelection);function NS(i,e){nl.registerKeybindingRule({id:i,primary:e,when:VHe,weight:qn+1})}NS(Ao.CursorColumnSelectLeft.id,1039);NS(Ao.CursorColumnSelectRight.id,1041);NS(Ao.CursorColumnSelectUp.id,1040);NS(Ao.CursorColumnSelectPageUp.id,1035);NS(Ao.CursorColumnSelectDown.id,1042);NS(Ao.CursorColumnSelectPageDown.id,1036);function xre(i){return i.register(),i}var Vy;(function(i){class e extends Vo{runEditorCommand(n,r,o){const s=r._getViewModel();s&&this.runCoreEditingCommand(r,s,o||{})}}i.CoreEditingCommand=e,i.LineBreakInsert=et(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:j.writable,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(t,n,r){t.pushUndoStop(),t.executeCommands(this.id,rr.lineBreakInsert(n.cursorConfig,n.model,n.getCursorStates().map(o=>o.modelState.selection)))}}),i.Outdent=et(new class extends e{constructor(){super({id:"outdent",precondition:j.writable,kbOpts:{weight:qn,kbExpr:De.and(j.editorTextFocus,j.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(t,n,r){t.pushUndoStop(),t.executeCommands(this.id,rr.outdent(n.cursorConfig,n.model,n.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),i.Tab=et(new class extends e{constructor(){super({id:"tab",precondition:j.writable,kbOpts:{weight:qn,kbExpr:De.and(j.editorTextFocus,j.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(t,n,r){t.pushUndoStop(),t.executeCommands(this.id,rr.tab(n.cursorConfig,n.model,n.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),i.DeleteLeft=et(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(t,n,r){const[o,s]=Mb.deleteLeft(n.getPrevEditOperationType(),n.cursorConfig,n.model,n.getCursorStates().map(a=>a.modelState.selection),n.getCursorAutoClosedCharacters());o&&t.pushUndoStop(),t.executeCommands(this.id,s),n.setPrevEditOperationType(2)}}),i.DeleteRight=et(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:qn,kbExpr:j.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(t,n,r){const[o,s]=Mb.deleteRight(n.getPrevEditOperationType(),n.cursorConfig,n.model,n.getCursorStates().map(a=>a.modelState.selection));o&&t.pushUndoStop(),t.executeCommands(this.id,s),n.setPrevEditOperationType(3)}}),i.Undo=new class extends OH{constructor(){super(yme)}runDOMCommand(t){t.ownerDocument.execCommand("undo")}runEditorCommand(t,n,r){if(!(!n.hasModel()||n.getOption(91)===!0))return n.getModel().undo()}},i.Redo=new class extends OH{constructor(){super(wme)}runDOMCommand(t){t.ownerDocument.execCommand("redo")}runEditorCommand(t,n,r){if(!(!n.hasModel()||n.getOption(91)===!0))return n.getModel().redo()}}})(Vy||(Vy={}));class Lre extends S4{constructor(e,t,n){super({id:e,precondition:void 0,metadata:n}),this._handlerId=t}runCommand(e,t){const n=e.get(Un).getFocusedCodeEditor();n&&n.trigger("keyboard",this._handlerId,t)}}function gC(i,e){xre(new Lre("default:"+i,i)),xre(new Lre(i,i,e))}gC("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});gC("replacePreviousChar");gC("compositionType");gC("compositionStart");gC("compositionEnd");gC("paste");gC("cut");class zHe{constructor(e,t,n,r){this.configuration=e,this.viewModel=t,this.userInputEvents=n,this.commandDelegate=r}paste(e,t,n,r){this.commandDelegate.paste(e,t,n,r)}type(e){this.commandDelegate.type(e)}compositionType(e,t,n,r){this.commandDelegate.compositionType(e,t,n,r)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){Ao.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column=4?this._selectAll():e.mouseDownCount===3?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position,e.revealType):this._lastCursorLineSelect(e.position,e.revealType):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):e.mouseDownCount===2?e.onInjectedText||(this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position,e.revealType):e.inSelectionMode?this._wordSelectDrag(e.position,e.revealType):this._wordSelect(e.position,e.revealType)):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position,e.revealType):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey?this._columnSelect(e.position,e.mouseColumn,!0):r?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position,e.revealType):this.moveTo(e.position,e.revealType)}_usualArgs(e,t){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,revealType:t}}moveTo(e,t){Ao.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){Ao.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,n){e=this._validateViewColumn(e),Ao.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:n})}_createCursor(e,t){e=this._validateViewColumn(e),Ao.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){Ao.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){Ao.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){Ao.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){Ao.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){Ao.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){Ao.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){Ao.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){Ao.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){Ao.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 Tve{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 qi("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(this.getCount()===0)return null;const n=this.getStartLineNumber(),r=this.getEndLineNumber();if(tr)return null;let o=0,s=0;for(let l=n;l<=r;l++){const c=l-this._rendLineNumberStart;e<=l&&l<=t&&(s===0?(o=c,s=1):s++)}if(e=r&&a<=o&&(this._lines[a-this._rendLineNumberStart].onContentChanged(),s=!0);return s}onLinesInserted(e,t){if(this.getCount()===0)return null;const n=t-e+1,r=this.getStartLineNumber(),o=this.getEndLineNumber();if(e<=r)return this._rendLineNumberStart+=n,null;if(e>o)return null;if(n+e>o)return this._lines.splice(e-this._rendLineNumberStart,o-e+1);const s=[];for(let d=0;dn)continue;const l=Math.max(t,a.fromLineNumber),c=Math.min(n,a.toLineNumber);for(let u=l;u<=c;u++){const d=u-this._rendLineNumberStart;this._lines[d].onTokensChanged(),r=!0}}return r}}class Nve{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new Tve(()=>this._host.createVisibleLine())}_createDomNode(){const e=Qn(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(144)}onFlushed(e){return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){const t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let n=0,r=t.length;nt){const s=t,a=Math.min(n,o.rendLineNumberStart-1);s<=a&&(this._insertLinesBefore(o,s,a,r,t),o.linesLength+=a-s+1)}else if(o.rendLineNumberStart0&&(this._removeLinesBefore(o,s),o.linesLength-=s)}if(o.rendLineNumberStart=t,o.rendLineNumberStart+o.linesLength-1n){const s=Math.max(0,n-o.rendLineNumberStart+1),l=o.linesLength-1-s+1;l>0&&(this._removeLinesAfter(o,l),o.linesLength-=l)}return this._finishRendering(o,!1,r),o}_renderUntouchedLines(e,t,n,r,o){const s=e.rendLineNumberStart,a=e.lines;for(let l=t;l<=n;l++){const c=s+l;a[l].layoutLine(c,r[c-o])}}_insertLinesBefore(e,t,n,r,o){const s=[];let a=0;for(let l=t;l<=n;l++)s[a++]=this.host.createVisibleLine();e.lines=s.concat(e.lines)}_removeLinesBefore(e,t){for(let n=0;n=0;a--){const l=e.lines[a];r[a]&&(l.setDomNode(s),s=s.previousSibling)}}_finishRenderingInvalidLines(e,t,n){const r=document.createElement("div");Hg._ttPolicy&&(t=Hg._ttPolicy.createHTML(t)),r.innerHTML=t;for(let o=0;oi});Hg._sb=new DS(1e5);class Rve extends Pl{constructor(e){super(e),this._visibleLines=new Nve(this),this.domNode=this._visibleLines.domNode;const n=this._context.configuration.options.get(50);ps(this.domNode,n),this._dynamicOverlays=[],this._isFocused=!1,this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;en.shouldRender());for(let n=0,r=t.length;n'),r.appendString(o),r.appendString(""),!0)}layoutLine(e,t){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(this._lineHeight))}}class jHe extends Rve{constructor(e){super(e);const n=this._context.configuration.options.get(144);this._contentWidth=n.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const n=this._context.configuration.options.get(144);return this._contentWidth=n.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 KHe extends Rve{constructor(e){super(e);const t=this._context.configuration.options,n=t.get(144);this._contentLeft=n.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),ps(this.domNode,t.get(50))}onConfigurationChanged(e){const t=this._context.configuration.options;ps(this.domNode,t.get(50));const n=t.get(144);return this._contentLeft=n.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 $4{constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseDropCanceled=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){var t;(t=this.onKeyDown)===null||t===void 0||t.call(this,e)}emitKeyUp(e){var t;(t=this.onKeyUp)===null||t===void 0||t.call(this,e)}emitContextMenu(e){var t;(t=this.onContextMenu)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseMove(e){var t;(t=this.onMouseMove)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){var t;(t=this.onMouseLeave)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDown(e){var t;(t=this.onMouseDown)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseUp(e){var t;(t=this.onMouseUp)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){var t;(t=this.onMouseDrag)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){var t;(t=this.onMouseDrop)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){var e;(e=this.onMouseDropCanceled)===null||e===void 0||e.call(this)}emitMouseWheel(e){var t;(t=this.onMouseWheel)===null||t===void 0||t.call(this,e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return $4.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){const n={...e};return n.position&&(n.position=t.convertViewPositionToModelPosition(n.position)),n.range&&(n.range=t.convertViewRangeToModelRange(n.range)),(n.type===5||n.type===8)&&(n.detail=this.convertViewToModelViewZoneData(n.detail,t)),n}static convertViewToModelViewZoneData(e,t){return{viewZoneId:e.viewZoneId,positionBefore:e.positionBefore?t.convertViewPositionToModelPosition(e.positionBefore):e.positionBefore,positionAfter:e.positionAfter?t.convertViewPositionToModelPosition(e.positionAfter):e.positionAfter,position:t.convertViewPositionToModelPosition(e.position),afterLineNumber:t.convertViewPositionToModelPosition(new ae(e.afterLineNumber,1)).lineNumber}}}class GHe extends Pl{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.contentLeft=0,this.domNode=Qn(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("blockDecorations-container"),this.update()}update(){let e=!1;const n=this._context.configuration.options.get(144),r=n.contentWidth-n.verticalScrollbarWidth;this.contentWidth!==r&&(this.contentWidth=r,e=!0);const o=n.contentLeft;return this.contentLeft!==o&&(this.contentLeft=o,e=!0),e}dispose(){super.dispose()}onConfigurationChanged(e){return this.update()}onScrollChanged(e){return e.scrollTopChanged||e.scrollLeftChanged}onDecorationsChanged(e){return!0}onZonesChanged(e){return!0}prepareRender(e){}render(e){var t;let n=0;const r=e.getDecorationsInViewport();for(const o of r){if(!o.options.blockClassName)continue;let s=this.blocks[n];s||(s=this.blocks[n]=Qn(document.createElement("div")),this.domNode.appendChild(s));let a,l;o.options.blockIsAfterEnd?(a=e.getVerticalOffsetAfterLineNumber(o.range.endLineNumber,!1),l=e.getVerticalOffsetAfterLineNumber(o.range.endLineNumber,!0)):(a=e.getVerticalOffsetForLineNumber(o.range.startLineNumber,!0),l=o.range.isEmpty()&&!o.options.blockDoesNotCollapse?e.getVerticalOffsetForLineNumber(o.range.startLineNumber,!1):e.getVerticalOffsetAfterLineNumber(o.range.endLineNumber,!0));const[c,u,d,h]=(t=o.options.blockPadding)!==null&&t!==void 0?t:[0,0,0,0];s.setClassName("blockDecorations-block "+o.options.blockClassName),s.setLeft(this.contentLeft-h),s.setWidth(this.contentWidth+h+u),s.setTop(a-e.scrollTop-c),s.setHeight(l-a+c+d),n++}for(let o=n;o0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,n,r){const o=e.top,s=o,a=e.top+e.height,l=r.viewportHeight-a,c=o-n,u=s>=n,d=a,h=l>=n;let f=e.left;return f+t>r.scrollLeft+r.viewportWidth&&(f=r.scrollLeft+r.viewportWidth-t),fc){const f=h-(c-r);h-=f,n-=f}if(h=m,S=f+n<=g.height-_;return this._fixedOverflowWidgets?{fitsAbove:y,aboveTop:Math.max(h,m),fitsBelow:S,belowTop:f,left:v}:{fitsAbove:y,aboveTop:a,fitsBelow:S,belowTop:l,left:p}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new Bx(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){var t,n;const r=a(this._primaryAnchor.viewPosition,this._affinity,this._lineHeight),o=((t=this._secondaryAnchor.viewPosition)===null||t===void 0?void 0:t.lineNumber)===((n=this._primaryAnchor.viewPosition)===null||n===void 0?void 0:n.lineNumber)?this._secondaryAnchor.viewPosition:null,s=a(o,this._affinity,this._lineHeight);return{primary:r,secondary:s};function a(l,c,u){if(!l)return null;const d=e.visibleRangeForPosition(l);if(!d)return null;const h=l.column===1&&c===3?0:d.left,f=e.getVerticalOffsetForLineNumber(l.lineNumber)-e.scrollTop;return new Ere(f,h,u)}}_reduceAnchorCoordinates(e,t,n){if(!t)return e;const r=this._context.configuration.options.get(50);let o=t.left;return oe.endLineNumber||this.domNode.setMaxWidth(this._maxWidth)}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData){this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this.domNode.setVisibility("hidden")),typeof this._actual.afterRender=="function"&&R6(this._actual.afterRender,this._actual,null);return}this.allowEditorOverflow?(this.domNode.setTop(this._renderData.coordinate.top),this.domNode.setLeft(this._renderData.coordinate.left)):(this.domNode.setTop(this._renderData.coordinate.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.coordinate.left)),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"),this._isVisible=!0),typeof this._actual.afterRender=="function"&&R6(this._actual.afterRender,this._actual,this._renderData.position)}}class Fx{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class Bx{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class Ere{constructor(e,t,n){this.top=e,this.left=t,this.height=n,this._anchorCoordinateBrand=void 0}}function R6(i,e,...t){try{return i.call(e,...t)}catch{return null}}class Mve extends fC{constructor(e){super(),this._context=e;const t=this._context.configuration.options,n=t.get(144);this._lineHeight=t.get(67),this._renderLineHighlight=t.get(96),this._renderLineHighlightOnlyWhenFocus=t.get(97),this._wordWrap=n.isViewportWrapping,this._contentLeft=n.contentLeft,this._contentWidth=n.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new yt(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=new Set;for(const o of this._selections)t.add(o.positionLineNumber);const n=Array.from(t);n.sort((o,s)=>o-s),or(this._cursorLineNumbers,n)||(this._cursorLineNumbers=n,e=!0);const r=this._selections.every(o=>o.isEmpty());return this._selectionIsEmpty!==r&&(this._selectionIsEmpty=r,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,n=t.get(144);return this._lineHeight=t.get(67),this._renderLineHighlight=t.get(96),this._renderLineHighlightOnlyWhenFocus=t.get(97),this._wordWrap=n.isViewportWrapping,this._contentLeft=n.contentLeft,this._contentWidth=n.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return this._renderLineHighlightOnlyWhenFocus?(this._focused=e.isFocused,!0):!1}prepareRender(e){if(!this._shouldRenderThis()){this._renderData=null;return}const t=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,r=[];for(let s=t;s<=n;s++){const a=s-t;r[a]=""}if(this._wordWrap){const s=this._renderOne(e,!1);for(const a of this._cursorLineNumbers){const l=this._context.viewModel.coordinatesConverter,c=l.convertViewPositionToModelPosition(new ae(a,1)).lineNumber,u=l.convertModelPositionToViewPosition(new ae(c,1)).lineNumber,d=l.convertModelPositionToViewPosition(new ae(c,this._context.viewModel.model.getLineMaxColumn(c))).lineNumber,h=Math.max(u,t),f=Math.min(d,n);for(let g=h;g<=f;g++){const p=g-t;r[p]=s}}}const o=this._renderOne(e,!0);for(const s of this._cursorLineNumbers){if(sn)continue;const a=s-t;r[a]=o}this._renderData=r}render(e,t){if(!this._renderData)return"";const n=t-e;return n>=this._renderData.length?"":this._renderData[n]}_shouldRenderInMargin(){return(this._renderLineHighlight==="gutter"||this._renderLineHighlight==="all")&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return(this._renderLineHighlight==="line"||this._renderLineHighlight==="all")&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}class YHe extends Mve{_renderOne(e,t){return`
`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class ZHe extends Mve{_renderOne(e,t){return`
`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}fu((i,e)=>{const t=i.getColor(_ve);if(t&&(e.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${t}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${t}; border: none; }`)),!t||t.isTransparent()||i.defines(Cre)){const n=i.getColor(Cre);n&&(e.addRule(`.monaco-editor .view-overlays .current-line-exact { border: 2px solid ${n}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-exact-margin { border: 2px solid ${n}; }`),ih(i.type)&&(e.addRule(".monaco-editor .view-overlays .current-line-exact { border-width: 1px; }"),e.addRule(".monaco-editor .margin-view-overlays .current-line-exact-margin { border-width: 1px; }")))}});class QHe extends fC{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}prepareRender(e){const t=e.getDecorationsInViewport();let n=[],r=0;for(let l=0,c=t.length;l{if(l.options.zIndexc.options.zIndex)return 1;const u=l.options.className,d=c.options.className;return ud?1:B.compareRangesUsingStarts(l.range,c.range)});const o=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,a=[];for(let l=o;l<=s;l++){const c=l-o;a[c]=""}this._renderWholeLineDecorations(e,n,a),this._renderNormalDecorations(e,n,a),this._renderResult=a}_renderWholeLineDecorations(e,t,n){const r=String(this._lineHeight),o=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber;for(let a=0,l=t.length;a',d=Math.max(c.range.startLineNumber,o),h=Math.min(c.range.endLineNumber,s);for(let f=d;f<=h;f++){const g=f-o;n[g]+=u}}}_renderNormalDecorations(e,t,n){var r;const o=String(this._lineHeight),s=e.visibleRange.startLineNumber;let a=null,l=!1,c=null,u=!1;for(let d=0,h=t.length;d';l[f]+=_}}}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}class JHe extends Pl{constructor(e,t,n,r){super(e);const o=this._context.configuration.options,s=o.get(103),a=o.get(75),l=o.get(40),c=o.get(106),u={listenOnDomNode:n.domNode,className:"editor-scrollable "+AH(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:a,fastScrollSensitivity:l,scrollPredominantAxis:c,scrollByPage:s.scrollByPage};this.scrollbar=this._register(new O4(t.domNode,u,this._context.viewLayout.getScrollable())),fh.write(this.scrollbar.getDomNode(),6),this.scrollbarDomNode=Qn(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const d=(h,f,g)=>{const p={};if(f){const v=h.scrollTop;v&&(p.scrollTop=this._context.viewLayout.getCurrentScrollTop()+v,h.scrollTop=0)}if(g){const v=h.scrollLeft;v&&(p.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+v,h.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(p,1)};this._register(ye(n.domNode,"scroll",h=>d(n.domNode,!0,!0))),this._register(ye(t.domNode,"scroll",h=>d(t.domNode,!0,!1))),this._register(ye(r.domNode,"scroll",h=>d(r.domNode,!0,!1))),this._register(ye(this.scrollbarDomNode.domNode,"scroll",h=>d(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(144);this.scrollbarDomNode.setLeft(t.contentLeft),e.get(73).side==="right"?this.scrollbarDomNode.setWidth(t.contentWidth+t.minimap.minimapWidth):this.scrollbarDomNode.setWidth(t.contentWidth),this.scrollbarDomNode.setHeight(t.height)}getOverviewRulerLayoutInfo(){return this.scrollbar.getOverviewRulerLayoutInfo()}getDomNode(){return this.scrollbarDomNode}delegateVerticalScrollbarPointerDown(e){this.scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this.scrollbar.delegateScrollFromMouseWheelEvent(e)}onConfigurationChanged(e){if(e.hasChanged(103)||e.hasChanged(75)||e.hasChanged(40)){const t=this._context.configuration.options,n=t.get(103),r=t.get(75),o=t.get(40),s=t.get(106),a={vertical:n.vertical,horizontal:n.horizontal,verticalScrollbarSize:n.verticalScrollbarSize,horizontalScrollbarSize:n.horizontalScrollbarSize,scrollByPage:n.scrollByPage,handleMouseWheel:n.handleMouseWheel,mouseWheelScrollSensitivity:r,fastScrollSensitivity:o,scrollPredominantAxis:s};this.scrollbar.updateOptions(a)}return e.hasChanged(144)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+AH(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}class FH{constructor(e,t,n,r,o){this.startLineNumber=e,this.endLineNumber=t,this.className=n,this.tooltip=r,this._decorationToRenderBrand=void 0,this.zIndex=o??0}}class eVe{constructor(e,t,n){this.className=e,this.zIndex=t,this.tooltip=n}}class tVe{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class Ave extends fC{_render(e,t,n){const r=[];for(let a=e;a<=t;a++){const l=a-e;r[l]=new tVe}if(n.length===0)return r;n.sort((a,l)=>a.className===l.className?a.startLineNumber===l.startLineNumber?a.endLineNumber-l.endLineNumber:a.startLineNumber-l.startLineNumber:a.classNamer)continue;const c=Math.max(a,n),u=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new ae(c,0)),d=this._context.viewModel.glyphLanes.getLanesAtLine(u.lineNumber).indexOf(o.preference.lane);t.push(new rVe(c,d,o.preference.zIndex,o))}}_collectSortedGlyphRenderRequests(e){const t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort((n,r)=>n.lineNumber===r.lineNumber?n.laneIndex===r.laneIndex?n.zIndex===r.zIndex?r.type===n.type?n.type===0&&r.type===0?n.className0;){const r=t.peek();if(!r)break;const o=t.takeWhile(a=>a.lineNumber===r.lineNumber&&a.laneIndex===r.laneIndex);if(!o||o.length===0)break;const s=o[0];if(s.type===0){const a=[];for(const l of o){if(l.zIndex!==s.zIndex||l.type!==s.type)break;(a.length===0||a[a.length-1]!==l.className)&&a.push(l.className)}n.push(s.accept(a.join(" ")))}else s.widget.renderInfo={lineNumber:s.lineNumber,laneIndex:s.laneIndex}}this._decorationGlyphsToRender=n}render(e){if(!this._glyphMargin){for(const n of Object.values(this._widgets))n.domNode.setDisplay("none");for(;this._managedDomNodes.length>0;){const n=this._managedDomNodes.pop();n==null||n.domNode.remove()}return}const t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(const n of Object.values(this._widgets))if(!n.renderInfo)n.domNode.setDisplay("none");else{const r=e.viewportData.relativeVerticalOffset[n.renderInfo.lineNumber-e.viewportData.startLineNumber],o=this._glyphMarginLeft+n.renderInfo.laneIndex*this._lineHeight;n.domNode.setDisplay("block"),n.domNode.setTop(r),n.domNode.setLeft(o),n.domNode.setWidth(t),n.domNode.setHeight(this._lineHeight)}for(let n=0;nthis._decorationGlyphsToRender.length;){const n=this._managedDomNodes.pop();n==null||n.domNode.remove()}}}class iVe{constructor(e,t,n,r){this.lineNumber=e,this.laneIndex=t,this.zIndex=n,this.className=r,this.type=0}accept(e){return new oVe(this.lineNumber,this.laneIndex,e)}}class rVe{constructor(e,t,n,r){this.lineNumber=e,this.laneIndex=t,this.zIndex=n,this.widget=r,this.type=1}}class oVe{constructor(e,t,n){this.lineNumber=e,this.laneIndex=t,this.combinedClassName=n}}class Pve extends fe{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function H4(i,e){let t=0,n=0;const r=i.length;for(;nr)throw new qi("Illegal value for lineNumber");const o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,s=!!(o&&o.offSide);let a=-2,l=-1,c=-2,u=-1;const d=D=>{if(a!==-1&&(a===-2||a>D-1)){a=-1,l=-1;for(let k=D-2;k>=0;k--){const T=this._computeIndentLevel(k);if(T>=0){a=k,l=T;break}}}if(c===-2){c=-1,u=-1;for(let k=D;k=0){c=k,u=T;break}}}};let h=-2,f=-1,g=-2,p=-1;const v=D=>{if(h===-2){h=-1,f=-1;for(let k=D-2;k>=0;k--){const T=this._computeIndentLevel(k);if(T>=0){h=k,f=T;break}}}if(g!==-1&&(g===-2||g=0){g=k,p=T;break}}}};let m=0,_=!0,y=0,S=!0,L=0,E=0;for(let D=0;_||S;D++){const k=e-D,T=e+D;D>1&&(k<1||k1&&(T>r||T>n)&&(S=!1),D>5e4&&(_=!1,S=!1);let M=-1;if(_&&k>=1){const N=this._computeIndentLevel(k-1);N>=0?(c=k-1,u=N,M=Math.ceil(N/this.textModel.getOptions().indentSize)):(d(k),M=this._getIndentLevelForWhitespaceLine(s,l,u))}let A=-1;if(S&&T<=r){const N=this._computeIndentLevel(T-1);N>=0?(h=T-1,f=N,A=Math.ceil(N/this.textModel.getOptions().indentSize)):(v(T),A=this._getIndentLevelForWhitespaceLine(s,f,p))}if(D===0){E=M;continue}if(D===1){if(T<=r&&A>=0&&E+1===A){_=!1,m=T,y=T,L=A;continue}if(k>=1&&M>=0&&M-1===E){S=!1,m=k,y=k,L=M;continue}if(m=e,y=e,L=E,L===0)return{startLineNumber:m,endLineNumber:y,indent:L}}_&&(M>=L?m=k:_=!1),S&&(A>=L?y=T:S=!1)}return{startLineNumber:m,endLineNumber:y,indent:L}}getLinesBracketGuides(e,t,n,r){var o;const s=[];for(let h=e;h<=t;h++)s.push([]);const a=!0,l=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new B(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let c;if(n&&l.length>0){const h=(e<=n.lineNumber&&n.lineNumber<=t?l:this.textModel.bracketPairs.getBracketPairsInRange(B.fromPositions(n)).toArray()).filter(f=>B.strictContainsPosition(f.range,n));c=(o=RD(h,f=>a))===null||o===void 0?void 0:o.range}const u=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,d=new Ove;for(const h of l){if(!h.closingBracketRange)continue;const f=c&&h.range.equalsRange(c);if(!f&&!r.includeInactive)continue;const g=d.getInlineClassName(h.nestingLevel,h.nestingLevelOfEqualBracketType,u)+(r.highlightActive&&f?" "+d.activeClassName:""),p=h.openingBracketRange.getStartPosition(),v=h.closingBracketRange.getStartPosition(),m=r.horizontalGuides===rb.Enabled||r.horizontalGuides===rb.EnabledForActive&&f;if(h.range.startLineNumber===h.range.endLineNumber){m&&s[h.range.startLineNumber-e].push(new V0(-1,h.openingBracketRange.getEndPosition().column,g,new pE(!1,v.column),-1,-1));continue}const _=this.getVisibleColumnFromPosition(v),y=this.getVisibleColumnFromPosition(h.openingBracketRange.getStartPosition()),S=Math.min(y,_,h.minVisibleColumnIndentation+1);let L=!1;Ys(this.textModel.getLineContent(h.closingBracketRange.startLineNumber))=e&&y>S&&s[p.lineNumber-e].push(new V0(S,-1,g,new pE(!1,p.column),-1,-1)),v.lineNumber<=t&&_>S&&s[v.lineNumber-e].push(new V0(S,-1,g,new pE(!L,v.column),-1,-1)))}for(const h of s)h.sort((f,g)=>f.visibleColumn-g.visibleColumn);return s}getVisibleColumnFromPosition(e){return go.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();const n=this.textModel.getLineCount();if(e<1||e>n)throw new Error("Illegal value for startLineNumber");if(t<1||t>n)throw new Error("Illegal value for endLineNumber");const r=this.textModel.getOptions(),o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,s=!!(o&&o.offSide),a=new Array(t-e+1);let l=-2,c=-1,u=-2,d=-1;for(let h=e;h<=t;h++){const f=h-e,g=this._computeIndentLevel(h-1);if(g>=0){l=h-1,c=g,a[f]=Math.ceil(g/r.indentSize);continue}if(l===-2){l=-1,c=-1;for(let p=h-2;p>=0;p--){const v=this._computeIndentLevel(p);if(v>=0){l=p,c=v;break}}}if(u!==-1&&(u===-2||u=0){u=p,d=v;break}}}a[f]=this._getIndentLevelForWhitespaceLine(s,c,d)}return a}_getIndentLevelForWhitespaceLine(e,t,n){const r=this.textModel.getOptions();return t===-1||n===-1?0:tl||this._maxIndentLeft>0&&y>this._maxIndentLeft)break;const S=_.horizontalLine?_.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",L=_.horizontalLine?((o=(r=e.visibleRangeForPosition(new ae(f,_.horizontalLine.endColumn)))===null||r===void 0?void 0:r.left)!==null&&o!==void 0?o:y+this._spaceWidth)-y:this._spaceWidth;v+=`
`}h[g]=v}this._renderResult=h}getGuidesByLine(e,t,n){const r=this._bracketPairGuideOptions.bracketPairs!==!1?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,n,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:this._bracketPairGuideOptions.bracketPairsHorizontal===!0?rb.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?rb.EnabledForActive:rb.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}):null,o=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let s=0,a=0,l=0;if(this._bracketPairGuideOptions.highlightActiveIndentation!==!1&&n){const d=this._context.viewModel.getActiveIndentGuide(n.lineNumber,e,t);s=d.startLineNumber,a=d.endLineNumber,l=d.indent}const{indentSize:c}=this._context.viewModel.model.getOptions(),u=[];for(let d=e;d<=t;d++){const h=new Array;u.push(h);const f=r?r[d-e]:[],g=new Dp(f),p=o?o[d-e]:0;for(let v=1;v<=p;v++){const m=(v-1)*c+1,_=(this._bracketPairGuideOptions.highlightActiveIndentation==="always"||f.length===0)&&s<=d&&d<=a&&v===l;h.push(...g.takeWhile(S=>S.visibleColumn!0)||[])}return u}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}function ZC(i){if(!(i&&i.isTransparent()))return i}fu((i,e)=>{const t=[{bracketColor:yve,guideColor:dHe,guideColorActive:vHe},{bracketColor:wve,guideColor:hHe,guideColorActive:_He},{bracketColor:Sve,guideColor:fHe,guideColorActive:bHe},{bracketColor:xve,guideColor:gHe,guideColorActive:CHe},{bracketColor:Lve,guideColor:pHe,guideColorActive:yHe},{bracketColor:Eve,guideColor:mHe,guideColorActive:wHe}],n=new Ove,r=[{indentColor:Vk,indentColorActive:zk},{indentColor:G$e,indentColorActive:Q$e},{indentColor:q$e,indentColorActive:J$e},{indentColor:X$e,indentColorActive:eHe},{indentColor:Y$e,indentColorActive:tHe},{indentColor:Z$e,indentColorActive:nHe}],o=t.map(a=>{var l,c;const u=i.getColor(a.bracketColor),d=i.getColor(a.guideColor),h=i.getColor(a.guideColorActive),f=ZC((l=ZC(d))!==null&&l!==void 0?l:u==null?void 0:u.transparent(.3)),g=ZC((c=ZC(h))!==null&&c!==void 0?c:u);if(!(!f||!g))return{guideColor:f,guideColorActive:g}}).filter(kf),s=r.map(a=>{const l=i.getColor(a.indentColor),c=i.getColor(a.indentColorActive),u=ZC(l),d=ZC(c);if(!(!u||!d))return{indentColor:u,indentColorActive:d}}).filter(kf);if(o.length>0){for(let a=0;a<30;a++){const l=o[a%o.length];e.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(a).replace(/ /g,".")} { --guide-color: ${l.guideColor}; --guide-color-active: ${l.guideColorActive}; }`)}e.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),e.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),e.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),e.addRule(`.monaco-editor .vertical.${n.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),e.addRule(`.monaco-editor .horizontal-top.${n.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),e.addRule(`.monaco-editor .horizontal-bottom.${n.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(s.length>0){for(let a=0;a<30;a++){const l=s[a%s.length];e.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${a} { --indent-color: ${l.indentColor}; --indent-color-active: ${l.indentColorActive}; }`)}e.addRule(".monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }"),e.addRule(".monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }")}});class M6{get didDomLayout(){return this._didDomLayout}readClientRect(){if(!this._clientRectRead){this._clientRectRead=!0;const e=this._domNode.getBoundingClientRect();this.markDidDomLayout(),this._clientRectDeltaLeft=e.left,this._clientRectScale=e.width/this._domNode.offsetWidth}}get clientRectDeltaLeft(){return this._clientRectRead||this.readClientRect(),this._clientRectDeltaLeft}get clientRectScale(){return this._clientRectRead||this.readClientRect(),this._clientRectScale}constructor(e,t){this._domNode=e,this.endNode=t,this._didDomLayout=!1,this._clientRectDeltaLeft=0,this._clientRectScale=1,this._clientRectRead=!1}markDidDomLayout(){this._didDomLayout=!0}}class lVe{constructor(){this._currentVisibleRange=new B(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class cVe{constructor(e,t,n,r,o,s,a){this.minimalReveal=e,this.lineNumber=t,this.startColumn=n,this.endColumn=r,this.startScrollTop=o,this.stopScrollTop=s,this.scrollType=a,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class uVe{constructor(e,t,n,r,o){this.minimalReveal=e,this.selections=t,this.startScrollTop=n,this.stopScrollTop=r,this.scrollType=o,this.type="selections";let s=t[0].startLineNumber,a=t[0].endLineNumber;for(let l=1,c=t.length;l{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new pi(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new lVe,this._horizontalRevealRequest=null,this._stickyScrollEnabled=r.get(115).enabled,this._maxNumberStickyLines=r.get(115).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new hf(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(145)&&(this._maxLineWidth=0);const t=this._context.configuration.options,n=t.get(50),r=t.get(145);return this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._isViewportWrapping=r.isViewportWrapping,this._revealHorizontalRightPadding=t.get(100),this._cursorSurroundingLines=t.get(29),this._cursorSurroundingLinesStyle=t.get(30),this._canUseLayerHinting=!t.get(32),this._stickyScrollEnabled=t.get(115).enabled,this._maxNumberStickyLines=t.get(115).maxLineCount,ps(this.domNode,n),this._onOptionsMaybeChanged(),e.hasChanged(144)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new pre(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const n=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();for(let o=n;o<=r;o++)this._visibleLines.getVisibleLine(o).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();let r=!1;for(let o=t;o<=n;o++)r=this._visibleLines.getVisibleLine(o).onSelectionChanged()||r;return r}onDecorationsChanged(e){{const t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let r=t;r<=n;r++)this._visibleLines.getVisibleLine(r).onDecorationsChanged()}return!0}onFlushed(e){const t=this._visibleLines.onFlushed(e);return this._maxLineWidth=0,t}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onRevealRangeRequest(e){const t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.minimalReveal,e.range,e.selections,e.verticalType);if(t===-1)return!1;let n=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?n={scrollTop:n.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new cVe(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),n.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new uVe(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),n.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const o=Math.abs(this._context.viewLayout.getCurrentScrollTop()-n.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(n,o),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){const t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),n=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTopn)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0}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 n=this._getViewLineDomNode(e);if(n===null)return null;const r=this._getLineNumberFor(n);if(r===-1||r<1||r>this._context.viewModel.getLineCount())return null;if(this._context.viewModel.getLineMaxColumn(r)===1)return new ae(r,1);const o=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();if(rs)return null;let a=this._visibleLines.getVisibleLine(r).getColumnOfNodeOffset(e,t);const l=this._context.viewModel.getLineMinColumn(r);return an)return-1;const r=new M6(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getWidth(r);return this._updateLineWidthsSlowIfDomDidLayout(r),o}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const n=e.endLineNumber,r=B.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!r)return null;const o=[];let s=0;const a=new M6(this.domNode.domNode,this._textRangeRestingSpot);let l=0;t&&(l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new ae(r.startLineNumber,1)).lineNumber);const c=this._visibleLines.getStartLineNumber(),u=this._visibleLines.getEndLineNumber();for(let d=r.startLineNumber;d<=r.endLineNumber;d++){if(du)continue;const h=d===r.startLineNumber?r.startColumn:1,f=d!==r.endLineNumber,g=f?this._context.viewModel.getLineMaxColumn(d):r.endColumn,p=this._visibleLines.getVisibleLine(d).getVisibleRangesForRange(d,h,g,a);if(p){if(t&&dthis._visibleLines.getEndLineNumber())return null;const r=new M6(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,n,r);return this._updateLineWidthsSlowIfDomDidLayout(r),o}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new f$e(t.outsideRenderedLine,t.ranges[0].left):null}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidthsSlowIfDomDidLayout(e){e.didDomLayout&&(this._asyncUpdateLineWidths.isScheduled()||(this._asyncUpdateLineWidths.cancel(),this._updateLineWidthsSlow()))}_updateLineWidths(e){const t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();let r=1,o=!0;for(let s=t;s<=n;s++){const a=this._visibleLines.getVisibleLine(s);if(e&&!a.getWidthIsFast()){o=!1;continue}r=Math.max(r,a.getWidth(null))}return o&&t===1&&n===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(r),o}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const n=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();for(let o=n;o<=r;o++){const s=this._visibleLines.getVisibleLine(o);if(s.needsMonospaceFontCheck()){const a=s.getWidth(null);a>t&&(t=a,e=o)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let o=n;o<=r;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 n=this._horizontalRevealRequest;if(e.startLineNumber<=n.minLineNumber&&n.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const r=this._computeScrollLeftToReveal(n);r&&(this._isViewportWrapping||this._ensureMaxLineWidth(r.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:r.scrollLeft},n.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),Da&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const n=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();for(let o=n;o<=r;o++)if(this._visibleLines.getVisibleLine(o).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain("strict");const t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){const t=Math.ceil(e);this._maxLineWidth0){let m=o[0].startLineNumber,_=o[0].endLineNumber;for(let y=1,S=o.length;yl){if(!u)return-1;v=d}else if(s===5||s===6)if(s===6&&a<=d&&h<=c)v=a;else{const m=Math.max(5*this._lineHeight,l*.2),_=d-m,y=h-l;v=Math.max(y,_)}else if(s===1||s===2)if(s===2&&a<=d&&h<=c)v=a;else{const m=(d+h)/2;v=Math.max(0,m-l/2)}else v=this._computeMinimumScrolling(a,c,d,h,s===3,s===4);return v}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),n=this._context.configuration.options.get(144),r=t.left,o=r+t.width-n.verticalScrollbarWidth;let s=1073741824,a=0;if(e.type==="range"){const c=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!c)return null;for(const u of c.ranges)s=Math.min(s,Math.round(u.left)),a=Math.max(a,Math.round(u.left+u.width))}else for(const c of e.selections){if(c.startLineNumber!==c.endLineNumber)return null;const u=this._visibleRangesForLineRange(c.startLineNumber,c.startColumn,c.endColumn);if(!u)return null;for(const d of u.ranges)s=Math.min(s,Math.round(d.left)),a=Math.max(a,Math.round(d.left+d.width))}return e.minimalReveal||(s=Math.max(0,s-V4.HORIZONTAL_EXTRA_PX),a+=this._revealHorizontalRightPadding),e.type==="selections"&&a-s>t.width?null:{scrollLeft:this._computeMinimumScrolling(r,o,s,a),maxHorizontalOffset:a}}_computeMinimumScrolling(e,t,n,r,o,s){e=e|0,t=t|0,n=n|0,r=r|0,o=!!o,s=!!s;const a=t-e;if(r-nt)return Math.max(0,r-a)}else return n;return e}}V4.HORIZONTAL_EXTRA_PX=30;class dVe extends Ave{constructor(e){super(),this._context=e;const n=this._context.configuration.options.get(144);this._decorationsLeft=n.decorationsLeft,this._decorationsWidth=n.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const n=this._context.configuration.options.get(144);return this._decorationsLeft=n.decorationsLeft,this._decorationsWidth=n.decorationsWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){var t,n;const r=e.getDecorationsInViewport(),o=[];let s=0;for(let a=0,l=r.length;a',l=[];for(let c=t;c<=n;c++){const u=c-t,d=r[u].getDecorations();let h="";for(const f of d){let g='
';o[a]=c}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class Yc{constructor(e,t,n,r){this._rgba8Brand=void 0,this.r=Yc._clamp(e),this.g=Yc._clamp(t),this.b=Yc._clamp(n),this.a=Yc._clamp(r)}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}static _clamp(e){return e<0?0:e>255?255:e|0}}Yc.Empty=new Yc(0,0,0,0);class jk extends fe{static getInstance(){return this._INSTANCE||(this._INSTANCE=new jk),this._INSTANCE}constructor(){super(),this._onDidChange=new se,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(hr.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=hr.getColorMap();if(!e){this._colors=[Yc.Empty],this._backgroundIsLight=!0;return}this._colors=[Yc.Empty];for(let n=1;n=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}}jk._INSTANCE=null;const fVe=(()=>{const i=[];for(let e=32;e<=126;e++)i.push(e);return i.push(65533),i})(),gVe=(i,e)=>(i-=32,i<0||i>96?e<=2?(i+96)%96:96-1:i);class KD{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=KD.soften(e,12/15),this.charDataLight=KD.soften(e,50/60)}static soften(e,t){const n=new Uint8ClampedArray(e.length);for(let r=0,o=e.length;re.width||n+g>e.height){console.warn("bad render request outside image data");return}const p=u?this.charDataLight:this.charDataNormal,v=gVe(r,c),m=e.width*4,_=a.r,y=a.g,S=a.b,L=o.r-_,E=o.g-y,D=o.b-S,k=Math.max(s,l),T=e.data;let M=v*h*f,A=n*m+t*4;for(let N=0;Ne.width||n+d>e.height){console.warn("bad render request outside image data");return}const h=e.width*4,f=.5*(o/255),g=s.r,p=s.g,v=s.b,m=r.r-g,_=r.g-p,y=r.b-v,S=g+m*f,L=p+_*f,E=v+y*f,D=Math.max(o,a),k=e.data;let T=n*h+t*4;for(let M=0;M{const e=new Uint8ClampedArray(i.length/2);for(let t=0;t>1]=Dre[i[t]]<<4|Dre[i[t+1]]&15;return e},kre={1:Hv(()=>Ire("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:Hv(()=>Ire("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class mE{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let n;return kre[e]?n=new KD(kre[e](),e):n=mE.createFromSampleData(mE.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=n,n}static createSampleData(e){const t=document.createElement("canvas"),n=t.getContext("2d");t.style.height="16px",t.height=16,t.width=96*10,t.style.width=96*10+"px",n.fillStyle="#ffffff",n.font=`bold 16px ${e}`,n.textBaseline="middle";let r=0;for(const o of fVe)n.fillText(String.fromCharCode(o),r,16/2),r+=10;return n.getImageData(0,0,96*10,16)}static createFromSampleData(e,t){if(e.length!==61440)throw new Error("Unexpected source in MinimapCharRenderer");const r=mE._downsample(e,t);return new KD(r,t)}static _downsampleChar(e,t,n,r,o){const s=1*o,a=2*o;let l=r,c=0;for(let u=0;u0){const c=255/l;for(let u=0;umE.create(this.fontScale,l.fontFamily)),this.defaultBackgroundColor=n.getColor(2),this.backgroundColor=GD._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=GD._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const n=e.getColor(YWe);return n?new Yc(n.rgba.r,n.rgba.g,n.rgba.b,Math.round(255*n.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(ZWe);return t?Yc._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.paddingTop===e.paddingTop&&this.paddingBottom===e.paddingBottom&&this.showSlider===e.showSlider&&this.autohide===e.autohide&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class vE{constructor(e,t,n,r,o,s,a,l,c){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=n,this._computedSliderRatio=r,this.sliderTop=o,this.sliderHeight=s,this.topPaddingLineCount=a,this.startLineNumber=l,this.endLineNumber=c}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}intersectWithViewport(e){const t=Math.max(this.startLineNumber,e.startLineNumber),n=Math.min(this.endLineNumber,e.endLineNumber);return t>n?null:[t,n]}getYForLineNumber(e,t){return+(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(e,t,n,r,o,s,a,l,c,u,d){const h=e.pixelRatio,f=e.minimapLineHeight,g=Math.floor(e.canvasInnerHeight/f),p=e.lineHeight;if(e.minimapHeightIsEditorHeight){let E=l*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(E+=Math.max(0,o-e.lineHeight-e.paddingBottom));const D=Math.max(1,Math.floor(o*o/E)),k=Math.max(0,e.minimapHeight-D),T=k/(u-o),M=c*T,A=k>0,N=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),R=Math.floor(e.paddingTop/e.lineHeight);return new vE(c,u,A,T,M,D,R,1,Math.min(a,N))}let v;if(s&&n!==a){const E=n-t+1;v=Math.floor(E*f/h)}else{const E=o/p;v=Math.floor(E*f/h)}const m=Math.floor(e.paddingTop/p);let _=Math.floor(e.paddingBottom/p);if(e.scrollBeyondLastLine){const E=o/p;_=Math.max(_,E-1)}let y;if(_>0){const E=o/p;y=(m+a+_-E-1)*f/h}else y=Math.max(0,(m+a)*f/h-v);y=Math.min(e.minimapHeight-v,y);const S=y/(u-o),L=c*S;if(g>=m+a+_){const E=y>0;return new vE(c,u,E,S,L,v,m,1,a)}else{let E;t>1?E=t+m:E=Math.max(1,c/p);let D,k=Math.max(1,Math.floor(E-L*h/f));kc&&(k=Math.min(k,d.startLineNumber),D=Math.max(D,d.topPaddingLineCount)),d.scrollTop=e.paddingTop?A=(t-k+D+M)*f/h:A=c/e.paddingTop*(D+M)*f/h,new vE(c,u,!0,S,A,v,D,k,T)}}}class dP{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}dP.INVALID=new dP(-1);class Tre{constructor(e,t,n){this.renderedLayout=e,this._imageData=t,this._renderedLines=new Tve(()=>dP.INVALID),this._renderedLines._set(e.startLineNumber,n)}linesEquals(e){if(!this.scrollEquals(e))return!1;const n=this._renderedLines._get().lines;for(let r=0,o=n.length;r1){for(let m=0,_=r-1;m<_;m++)v[m]=Math.round(m*o+s);v[r-1]=t}return[new qD(o,v),[]]}const a=n.minimapLines,l=a.length,c=[];let u=0,d=0,h=1;const f=10;let g=[],p=null;for(let v=0;v0&&this.minimapLines[n-1]>=e;)n--;let r=this.modelLineToMinimapLine(t)-1;for(;r+1t)return null}return[n+1,r+1]}decorationLineRangeToMinimapLineRange(e,t){let n=this.modelLineToMinimapLine(e),r=this.modelLineToMinimapLine(t);return e!==t&&r===n&&(r===this.minimapLines.length?n>1&&n--:r++),[n,r]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let n=this.minimapLines.length,r=0;for(let o=this.minimapLines.length-1;o>=0&&!(this.minimapLines[o]=0&&!(this.minimapLines[n]0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:n,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(r)}_recreateLineSampling(){this._minimapSelections=null;const e=!!this._samplingState,[t,n]=qD.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const r of n)switch(r.type){case"deleted":this._actual.onLinesDeleted(r.deleteFromLineNumber,r.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(r.insertFromLineNumber,r.insertToLineNumber);break;case"flush":this._actual.onFlushed();break}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.viewModel.getLineCount()}getRealLineCount(){return this._context.viewModel.getLineCount()}getLineContent(e){return this._samplingState?this._context.viewModel.getLineContent(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineContent(e)}getLineMaxColumn(e){return this._samplingState?this._context.viewModel.getLineMaxColumn(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineMaxColumn(e)}getMinimapLinesRenderingData(e,t,n){if(this._samplingState){const r=[];for(let o=0,s=t-e+1;o{if(n.preventDefault(),this._model.options.renderMinimap===0||!this._lastRenderData)return;if(this._model.options.size!=="proportional"){if(n.button===0&&this._lastRenderData){const c=Br(this._slider.domNode),u=c.top+c.height/2;this._startSliderDragging(n,u,this._lastRenderData.renderedLayout)}return}const o=this._model.options.minimapLineHeight,s=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*n.offsetY;let l=Math.floor(s/o)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;l=Math.min(l,this._model.getLineCount()),this._model.revealLineNumber(l)}),this._sliderPointerMoveMonitor=new kS,this._sliderPointerDownListener=Sr(this._slider.domNode,Ge.POINTER_DOWN,n=>{n.preventDefault(),n.stopPropagation(),n.button===0&&this._lastRenderData&&this._startSliderDragging(n,n.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=wi.addTarget(this._domNode.domNode),this._sliderTouchStartListener=ye(this._domNode.domNode,Si.Start,n=>{n.preventDefault(),n.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(n))},{passive:!1}),this._sliderTouchMoveListener=ye(this._domNode.domNode,Si.Change,n=>{n.preventDefault(),n.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(n)},{passive:!1}),this._sliderTouchEndListener=Sr(this._domNode.domNode,Si.End,n=>{n.preventDefault(),n.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_startSliderDragging(e,t,n){if(!e.target||!(e.target instanceof Element))return;const r=e.pageX;this._slider.toggleClassName("active",!0);const o=(s,a)=>{const l=Br(this._domNode.domNode),c=Math.min(Math.abs(a-r),Math.abs(a-l.left),Math.abs(a-l.left-l.width));if(Rs&&c>pVe){this._model.setScrollTop(n.scrollTop);return}const u=s-t;this._model.setScrollTop(n.getDesiredScrollTopFromDelta(u))};e.pageY!==t&&o(e.pageY,r),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>o(s.pageY,s.pageX),()=>{this._slider.toggleClassName("active",!1)})}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,n=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(n)}dispose(){this._pointerDownListener.dispose(),this._sliderPointerMoveMonitor.dispose(),this._sliderPointerDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){const e=["minimap"];return this._model.options.showSlider==="always"?e.push("slider-always"):e.push("slider-mouseover"),this._model.options.autohide&&e.push("autohide"),e.join(" ")}getDomNode(){return this._domNode}_applyLayout(){this._domNode.setLeft(this._model.options.minimapLeft),this._domNode.setWidth(this._model.options.minimapWidth),this._domNode.setHeight(this._model.options.minimapHeight),this._shadow.setHeight(this._model.options.minimapHeight),this._canvas.setWidth(this._model.options.canvasOuterWidth),this._canvas.setHeight(this._model.options.canvasOuterHeight),this._canvas.domNode.width=this._model.options.canvasInnerWidth,this._canvas.domNode.height=this._model.options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._model.options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._model.options.canvasInnerHeight,this._slider.setWidth(this._model.options.minimapWidth)}_getBuffer(){return this._buffers||this._model.options.canvasInnerWidth>0&&this._model.options.canvasInnerHeight>0&&(this._buffers=new sX(this._canvas.domNode.getContext("2d"),this._model.options.canvasInnerWidth,this._model.options.canvasInnerHeight,this._model.options.backgroundColor)),this._buffers?this._buffers.getBuffer():null}onDidChangeOptions(){this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName())}onSelectionChanged(){return this._renderDecorations=!0,!0}onDecorationsChanged(){return this._renderDecorations=!0,!0}onFlushed(){return this._lastRenderData=null,!0}onLinesChanged(e,t){return this._lastRenderData?this._lastRenderData.onLinesChanged(e,t):!1}onLinesDeleted(e,t){var n;return(n=this._lastRenderData)===null||n===void 0||n.onLinesDeleted(e,t),!0}onLinesInserted(e,t){var n;return(n=this._lastRenderData)===null||n===void 0||n.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(dre),this._renderDecorations=!0,!0}onTokensChanged(e){return this._lastRenderData?this._lastRenderData.onTokensChanged(e):!1}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(this._model.options.renderMinimap===0){this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),this._sliderHorizontal.setHeight(0);return}e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");const n=vE.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(n.sliderNeeded?"block":"none"),this._slider.setTop(n.sliderTop),this._slider.setHeight(n.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(n.sliderHeight),this.renderDecorations(n),this._lastRenderData=this.renderLines(n)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(B.compareRangesUsingStarts);const n=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);n.sort((h,f)=>(h.options.zIndex||0)-(f.options.zIndex||0));const{canvasInnerWidth:r,canvasInnerHeight:o}=this._model.options,s=this._model.options.minimapLineHeight,a=this._model.options.minimapCharWidth,l=this._model.getOptions().tabSize,c=this._decorationsCanvas.domNode.getContext("2d");c.clearRect(0,0,r,o);const u=new Nre(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(c,t,u,e,s),this._renderDecorationsLineHighlights(c,n,u,e,s);const d=new Nre(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(c,t,d,e,s,l,a,r),this._renderDecorationsHighlights(c,n,d,e,s,l,a,r)}}_renderSelectionLineHighlights(e,t,n,r,o){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let s=0,a=0;for(const l of t){const c=r.intersectWithViewport(l);if(!c)continue;const[u,d]=c;for(let g=u;g<=d;g++)n.set(g,!0);const h=r.getYForLineNumber(u,o),f=r.getYForLineNumber(d,o);a>=h||(a>s&&e.fillRect(pm,s,e.canvas.width,a-s),s=h),a=f}a>s&&e.fillRect(pm,s,e.canvas.width,a-s)}_renderDecorationsLineHighlights(e,t,n,r,o){const s=new Map;for(let a=t.length-1;a>=0;a--){const l=t[a],c=l.options.minimap;if(!c||c.position!==Ll.Inline)continue;const u=r.intersectWithViewport(l.range);if(!u)continue;const[d,h]=u,f=c.getColor(this._theme.value);if(!f||f.isTransparent())continue;let g=s.get(f.toString());g||(g=f.transparent(.5).toString(),s.set(f.toString(),g)),e.fillStyle=g;for(let p=d;p<=h;p++){if(n.has(p))continue;n.set(p,!0);const v=r.getYForLineNumber(d,o);e.fillRect(pm,v,e.canvas.width,o)}}}_renderSelectionsHighlights(e,t,n,r,o,s,a,l){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(const c of t){const u=r.intersectWithViewport(c);if(!u)continue;const[d,h]=u;for(let f=d;f<=h;f++)this.renderDecorationOnLine(e,n,c,this._selectionColor,r,f,o,o,s,a,l)}}_renderDecorationsHighlights(e,t,n,r,o,s,a,l){for(const c of t){const u=c.options.minimap;if(!u)continue;const d=r.intersectWithViewport(c.range);if(!d)continue;const[h,f]=d,g=u.getColor(this._theme.value);if(!(!g||g.isTransparent()))for(let p=h;p<=f;p++)switch(u.position){case Ll.Inline:this.renderDecorationOnLine(e,n,c.range,g,r,p,o,o,s,a,l);continue;case Ll.Gutter:{const v=r.getYForLineNumber(p,o),m=2;this.renderDecoration(e,g,m,v,mVe,o);continue}}}}renderDecorationOnLine(e,t,n,r,o,s,a,l,c,u,d){const h=o.getYForLineNumber(s,l);if(h+a<0||h>this._model.options.canvasInnerHeight)return;const{startLineNumber:f,endLineNumber:g}=n,p=f===s?n.startColumn:1,v=g===s?n.endColumn:this._model.getLineMaxColumn(s),m=this.getXOffsetForPosition(t,s,p,c,u,d),_=this.getXOffsetForPosition(t,s,v,c,u,d);this.renderDecoration(e,r,m,h,_-m,a)}getXOffsetForPosition(e,t,n,r,o,s){if(n===1)return pm;if((n-1)*o>=s)return s;let l=e.get(t);if(!l){const c=this._model.getLineContent(t);l=[pm];let u=pm;for(let d=1;d=s){l[d]=s;break}l[d]=g,u=g}e.set(t,l)}return n-1L?Math.floor((r-L)/2):0,D=h.a/255,k=new Yc(Math.round((h.r-d.r)*D+d.r),Math.round((h.g-d.g)*D+d.g),Math.round((h.b-d.b)*D+d.b),255);let T=e.topPaddingLineCount*r;const M=[];for(let W=0,H=n-t+1;W=0&&A_)return;const N=v.charCodeAt(L);if(N===9){const R=h-(L+E)%h;E+=R-1,S+=R*s}else if(N===32)S+=s;else{const R=zv(N)?2:1;for(let F=0;F_)return}}}}}class Nre{constructor(e,t,n){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=n,this._values=[];for(let r=0,o=this._endLineNumber-this._startLineNumber+1;rthis._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return ethis._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}class _Ve extends Pl{constructor(e,t){super(e),this._viewDomNode=t;const r=this._context.configuration.options.get(144);this._widgets={},this._verticalScrollbarWidth=r.verticalScrollbarWidth,this._minimapWidth=r.minimap.minimapWidth,this._horizontalScrollbarHeight=r.horizontalScrollbarHeight,this._editorHeight=r.height,this._editorWidth=r.width,this._viewDomNodeRect={top:0,left:0,width:0,height:0},this._domNode=Qn(document.createElement("div")),fh.write(this._domNode,4),this._domNode.setClassName("overlayWidgets"),this.overflowingOverlayWidgetsDomNode=Qn(document.createElement("div")),fh.write(this.overflowingOverlayWidgetsDomNode,5),this.overflowingOverlayWidgetsDomNode.setClassName("overflowingOverlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const n=this._context.configuration.options.get(144);return this._verticalScrollbarWidth=n.verticalScrollbarWidth,this._minimapWidth=n.minimap.minimapWidth,this._horizontalScrollbarHeight=n.horizontalScrollbarHeight,this._editorHeight=n.height,this._editorWidth=n.width,!0}addWidget(e){const t=Qn(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),e.allowEditorOverflow?this.overflowingOverlayWidgetsDomNode.appendChild(t):this._domNode.appendChild(t),this.setShouldRender(),this._updateMaxMinWidth()}setWidgetPosition(e,t){const n=this._widgets[e.getId()];return n.preference===t?(this._updateMaxMinWidth(),!1):(n.preference=t,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const r=this._widgets[t].domNode.domNode;delete this._widgets[t],r.remove(),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){var e,t;let n=0;const r=Object.keys(this._widgets);for(let o=0,s=r.length;o=3){const o=Math.floor(r/3),s=Math.floor(r/3),a=r-o-s,l=e,c=l+o,u=l+o+a;return[[0,l,c,l,u,l,c,l],[0,o,a,o+a,s,o+a+s,a+s,o+a+s]]}else if(n===2){const o=Math.floor(r/2),s=r-o,a=e,l=a+o;return[[0,a,a,a,l,a,a,a],[0,o,o,o,s,o+s,o+s,o+s]]}else{const o=e,s=r;return[[0,o,o,o,o,o,o,o],[0,s,s,s,s,s,s,s]]}}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&&me.equals(this.backgroundColor,e.backgroundColor)&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight}}class CVe extends Pl{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=Qn(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=hr.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[new ae(1,1)]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new bVe(this._context.configuration,this._context.theme);return this._settings&&this._settings.equals(t)?!1:(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),!0)}_markRenderingIsNeeded(){return this._actualShouldRender=2,!0}_markRenderingIsMaybeNeeded(){return this._actualShouldRender=1,!0}onConfigurationChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,n=e.selections.length;tg.lineNumber===p.lineNumber)&&(this._actualShouldRender=2),this._actualShouldRender===1)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");const n=this._settings.canvasWidth,r=this._settings.canvasHeight,o=this._settings.lineHeight,s=this._context.viewLayout,a=this._context.viewLayout.getScrollHeight(),l=r/a,c=6*this._settings.pixelRatio|0,u=c/2|0,d=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(d.fillStyle=me.Format.CSS.formatHexA(e),d.fillRect(0,0,n,r)):(d.clearRect(0,0,n,r),d.fillStyle=me.Format.CSS.formatHexA(e),d.fillRect(0,0,n,r)):d.clearRect(0,0,n,r);const h=this._settings.x,f=this._settings.w;for(const g of t){const p=g.color,v=g.data;d.fillStyle=p;let m=0,_=0,y=0;for(let S=0,L=v.length/3;Sr&&(N=r-u),T=N-u,M=N+u}T>y+1||E!==m?(S!==0&&d.fillRect(h[m],_,f[m],y-_),m=E,_=T,y=M):M>y&&(y=M)}d.fillRect(h[m],_,f[m],y-_)}if(!this._settings.hideCursor&&this._settings.cursorColor){const g=2*this._settings.pixelRatio|0,p=g/2|0,v=this._settings.x[7],m=this._settings.w[7];d.fillStyle=this._settings.cursorColor;let _=-100,y=-100;for(let S=0,L=this._cursorPositions.length;Sr&&(D=r-p);const k=D-p,T=k+g;k>y+1?(S!==0&&d.fillRect(v,_,m,y-_),_=k,y=T):T>y&&(y=T)}d.fillRect(v,_,m,y-_)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(d.beginPath(),d.lineWidth=1,d.strokeStyle=this._settings.borderColor,d.moveTo(0,0),d.lineTo(0,r),d.stroke(),d.moveTo(0,0),d.lineTo(n,0),d.stroke())}}class Rre{constructor(e,t,n){this._colorZoneBrand=void 0,this.from=e|0,this.to=t|0,this.colorId=n|0}static compare(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId}}class Fve{constructor(e,t,n,r){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=n,this.color=r,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.colorn&&(p=n-v);const m=u.color;let _=this._color2Id[m];_||(_=++this._lastAssignedId,this._color2Id[m]=_,this._id2Color[_]=m);const y=new Rre(p-v,p+v,_);u.setColorZone(y),a.push(y)}return this._colorZonesInvalid=!1,a.sort(Rre.compare),a}}class wVe extends $k{constructor(e,t){super(),this._context=e;const n=this._context.configuration.options;this._domNode=Qn(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new yVe(r=>this._context.viewLayout.getVerticalOffsetForLineNumber(r)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(n.get(67)),this._zoneManager.setPixelRatio(n.get(142)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(67)&&(this._zoneManager.setLineHeight(t.get(67)),this._render()),e.hasChanged(142)&&(this._zoneManager.setPixelRatio(t.get(142)),this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render()),!0}onFlushed(e){return this._render(),!0}onScrollChanged(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0}onZonesChanged(e){return this._render(),!0}getDomNode(){return this._domNode.domNode}setLayout(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);let t=!1;t=this._zoneManager.setDOMWidth(e.width)||t,t=this._zoneManager.setDOMHeight(e.height)||t,t&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())}setZones(e){this._zoneManager.setZones(e),this._render()}_render(){if(this._zoneManager.getOuterHeight()===0)return!1;const e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),n=this._zoneManager.resolveColorZones(),r=this._zoneManager.getId2Color(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),n.length>0&&this._renderOneLane(o,n,r,e),!0}_renderOneLane(e,t,n,r){let o=0,s=0,a=0;for(const l of t){const c=l.colorId,u=l.from,d=l.to;c!==o?(e.fillRect(0,s,r,a-s),o=c,e.fillStyle=n[o],s=u,a=d):a>=u?a=Math.max(a,d):(e.fillRect(0,s,r,a-s),s=u,a=d)}e.fillRect(0,s,r,a-s)}}class SVe extends Pl{constructor(e){super(e),this.domNode=Qn(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("view-rulers"),this._renderedRulers=[];const t=this._context.configuration.options;this._rulers=t.get(102),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(102),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){const e=this._renderedRulers.length,t=this._rulers.length;if(e===t)return;if(e0;){const a=Qn(document.createElement("div"));a.setClassName("view-ruler"),a.setWidth(o),this.domNode.appendChild(a),this._renderedRulers.push(a),s--}return}let n=e-t;for(;n>0;){const r=this._renderedRulers.pop();this.domNode.removeChild(r),n--}}render(e){this._ensureRulersCount();for(let t=0,n=this._rulers.length;t0;return this._shouldShow!==e?(this._shouldShow=e,!0):!1}getDomNode(){return this._domNode}_updateWidth(){const t=this._context.configuration.options.get(144);t.minimap.renderMinimap===0||t.minimap.minimapWidth>0&&t.minimap.minimapLeft===0?this._width=t.width:this._width=t.width-t.verticalScrollbarWidth}onConfigurationChanged(e){const n=this._context.configuration.options.get(103);return this._useShadows=n.useShadows,this._updateWidth(),this._updateShouldShow(),!0}onScrollChanged(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()}prepareRender(e){}render(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")}}class LVe{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class EVe{constructor(e,t){this.lineNumber=e,this.ranges=t}}function DVe(i){return new LVe(i)}function IVe(i){return new EVe(i.lineNumber,i.ranges.map(DVe))}class Dr extends fC{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(67),this._roundedSelection=t.get(101),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(67),this._roundedSelection=t.get(101),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_visibleRangesHaveGaps(e){for(let t=0,n=e.length;t1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,n){const r=this._typicalHalfwidthCharacterWidth/4;let o=null,s=null;if(n&&n.length>0&&t.length>0){const a=t[0].lineNumber;if(a===e.startLineNumber)for(let c=0;!o&&c=0;c--)n[c].lineNumber===l&&(s=n[c].ranges[0]);o&&!o.startStyle&&(o=null),s&&!s.startStyle&&(s=null)}for(let a=0,l=t.length;a0){const g=t[a-1].ranges[0].left,p=t[a-1].ranges[0].left+t[a-1].ranges[0].width;_R(u-g)g&&(h.top=1),_R(d-p)'}_actualRenderOneSelection(e,t,n,r){if(r.length===0)return;const o=!!r[0].ranges[0].startStyle,s=this._lineHeight.toString(),a=(this._lineHeight-1).toString(),l=r[0].lineNumber,c=r[r.length-1].lineNumber;for(let u=0,d=r.length;u1,c)}this._previousFrameVisibleRangesWithStyle=o,this._renderResult=t.map(([s,a])=>s+a)}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}Dr.SELECTION_CLASS_NAME="selected-text";Dr.SELECTION_TOP_LEFT="top-left-radius";Dr.SELECTION_BOTTOM_LEFT="bottom-left-radius";Dr.SELECTION_TOP_RIGHT="top-right-radius";Dr.SELECTION_BOTTOM_RIGHT="bottom-right-radius";Dr.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background";Dr.ROUNDED_PIECE_WIDTH=10;fu((i,e)=>{const t=i.getColor(oWe);t&&!t.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${t}; }`)});function _R(i){return i<0?-i:i}class Mre{constructor(e,t,n,r,o,s,a){this.top=e,this.left=t,this.paddingLeft=n,this.width=r,this.height=o,this.textContent=s,this.textContentClassName=a}}class Are{constructor(e){this._context=e;const t=this._context.configuration.options,n=t.get(50);this._cursorStyle=t.get(28),this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=Qn(document.createElement("div")),this._domNode.setClassName(`cursor ${$y}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),ps(this._domNode,n),this._domNode.setDisplay("none"),this._position=new ae(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,n=t.get(50);return this._cursorStyle=t.get(28),this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),ps(this._domNode,n),!0}onCursorPositionChanged(e,t){return t?this._domNode.domNode.style.transitionProperty="none":this._domNode.domNode.style.transitionProperty="",this._position=e,!0}_getGraphemeAwarePosition(){const{lineNumber:e,column:t}=this._position,n=this._context.viewModel.getLineContent(e),[r,o]=z5e(n,t-1);return[new ae(e,r+1),n.substring(r,o)]}_prepareRender(e){let t="",n="";const[r,o]=this._getGraphemeAwarePosition();if(this._cursorStyle===Qo.Line||this._cursorStyle===Qo.LineThin){const h=e.visibleRangeForPosition(r);if(!h||h.outsideRenderedLine)return null;const f=Pt(this._domNode.domNode);let g;this._cursorStyle===Qo.Line?(g=rie(f,this._lineCursorWidth>0?this._lineCursorWidth:2),g>2&&(t=o,n=this._getTokenClassName(r))):g=rie(f,1);let p=h.left,v=0;g>=2&&p>=1&&(v=1,p-=v);const m=e.getVerticalOffsetForLineNumber(r.lineNumber)-e.bigNumbersDelta;return new Mre(m,p,v,g,this._lineHeight,t,n)}const s=e.linesVisibleRangesForRange(new B(r.lineNumber,r.column,r.lineNumber,r.column+o.length),!1);if(!s||s.length===0)return null;const a=s[0];if(a.outsideRenderedLine||a.ranges.length===0)return null;const l=a.ranges[0],c=o===" "?this._typicalHalfwidthCharacterWidth:l.width<1?this._typicalHalfwidthCharacterWidth:l.width;this._cursorStyle===Qo.Block&&(t=o,n=this._getTokenClassName(r));let u=e.getVerticalOffsetForLineNumber(r.lineNumber)-e.bigNumbersDelta,d=this._lineHeight;return(this._cursorStyle===Qo.Underline||this._cursorStyle===Qo.UnderlineThin)&&(u+=this._lineHeight-2,d=2),new Mre(u,l.left,0,c,d,t,n)}_getTokenClassName(e){const t=this._context.viewModel.getViewLineData(e.lineNumber),n=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(n)}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 ${$y} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setPaddingLeft(this._renderData.paddingLeft),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)}}class XD extends Pl{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(91),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new Are(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=Qn(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 cd,this._cursorFlatBlinkInterval=new Eq,this._blinkingEnabled=!1,this._editorHasFocus=!1,this._updateBlinking()}dispose(){super.dispose(),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()}getDomNode(){return this._domNode}onCompositionStart(e){return this._isComposingInput=!0,this._updateBlinking(),!0}onCompositionEnd(e){return this._isComposingInput=!1,this._updateBlinking(),!0}onConfigurationChanged(e){const t=this._context.configuration.options;this._readOnly=t.get(91),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let n=0,r=this._secondaryCursors.length;nt.length){const o=this._secondaryCursors.length-t.length;for(let s=0;s{for(let r=0,o=e.ranges.length;r{this._isVisible?this._hide():this._show()},XD.BLINK_INTERVAL,Pt(this._domNode.domNode)):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},XD.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case Qo.Line:e+=" cursor-line-style";break;case Qo.Block:e+=" cursor-block-style";break;case Qo.Underline:e+=" cursor-underline-style";break;case Qo.LineThin:e+=" cursor-line-thin-style";break;case Qo.BlockOutline:e+=" cursor-block-outline-style";break;case Qo.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case 1:e+=" cursor-blink";break;case 2:e+=" cursor-smooth";break;case 3:e+=" cursor-phase";break;case 4:e+=" cursor-expand";break;case 5:e+=" cursor-solid";break;default:e+=" cursor-solid"}else e+=" cursor-solid";return(this._cursorSmoothCaretAnimation==="on"||this._cursorSmoothCaretAnimation==="explicit")&&(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e{const t=i.getColor(bve);if(t){let n=i.getColor(j$e);n||(n=t.opposite()),e.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${t}; border-color: ${t}; color: ${n}; }`),ih(i.type)&&e.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${n}; border-right: 1px solid ${n}; }`)}});const A6=()=>{throw new Error("Invalid change accessor")};class kVe extends Pl{constructor(e){super(e);const t=this._context.configuration.options,n=t.get(144);this._lineHeight=t.get(67),this._contentWidth=n.contentWidth,this._contentLeft=n.contentLeft,this.domNode=Qn(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=Qn(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 r of e)t.set(r.id,r);let n=!1;return this._context.viewModel.changeWhitespace(r=>{const o=Object.keys(this._zones);for(let s=0,a=o.length;s{const r={addZone:o=>(t=!0,this._addZone(n,o)),removeZone:o=>{o&&(t=this._removeZone(n,o)||t)},layoutZone:o=>{o&&(t=this._layoutZone(n,o)||t)}};TVe(e,r),r.addZone=A6,r.removeZone=A6,r.layoutZone=A6}),t}_addZone(e,t){const n=this._computeWhitespaceProps(t),o={whitespaceId:e.insertWhitespace(n.afterViewLineNumber,this._getZoneOrdinal(t),n.heightInPx,n.minWidthInPx),delegate:t,isInHiddenArea:n.isInHiddenArea,isVisible:!1,domNode:Qn(t.domNode),marginDomNode:t.marginDomNode?Qn(t.marginDomNode):null};return this._safeCallOnComputedHeight(o.delegate,n.heightInPx),o.domNode.setPosition("absolute"),o.domNode.domNode.style.width="100%",o.domNode.setDisplay("none"),o.domNode.setAttribute("monaco-view-zone",o.whitespaceId),this.domNode.appendChild(o.domNode),o.marginDomNode&&(o.marginDomNode.setPosition("absolute"),o.marginDomNode.domNode.style.width="100%",o.marginDomNode.setDisplay("none"),o.marginDomNode.setAttribute("monaco-view-zone",o.whitespaceId),this.marginDomNode.appendChild(o.marginDomNode)),this._zones[o.whitespaceId]=o,this.setShouldRender(),o.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const n=this._zones[t];return delete this._zones[t],e.removeWhitespace(n.whitespaceId),n.domNode.removeAttribute("monaco-visible-view-zone"),n.domNode.removeAttribute("monaco-view-zone"),n.domNode.domNode.parentNode.removeChild(n.domNode.domNode),n.marginDomNode&&(n.marginDomNode.removeAttribute("monaco-visible-view-zone"),n.marginDomNode.removeAttribute("monaco-view-zone"),n.marginDomNode.domNode.parentNode.removeChild(n.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const n=this._zones[t],r=this._computeWhitespaceProps(n.delegate);return n.isInHiddenArea=r.isInHiddenArea,e.changeOneWhitespace(n.whitespaceId,r.afterViewLineNumber,r.heightInPx),this._safeCallOnComputedHeight(n.delegate,r.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){return this._zones.hasOwnProperty(e)?!!this._zones[e].delegate.suppressMouseDown:!1}_heightInPixels(e){return typeof e.heightInPx=="number"?e.heightInPx:typeof e.heightInLines=="number"?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return typeof e.minWidthInPx=="number"?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if(typeof e.onComputedHeight=="function")try{e.onComputedHeight(t)}catch(n){en(n)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(n){en(n)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,n={};let r=!1;for(const s of t)this._zones[s.id].isInHiddenArea||(n[s.id]=s,r=!0);const o=Object.keys(this._zones);for(let s=0,a=o.length;sa)continue;const f=h.startLineNumber===a?h.startColumn:c.minColumn,g=h.endLineNumber===a?h.endColumn:c.maxColumn;f=M.endOffset&&(T++,M=n&&n[T]),R!==9&&R!==32||h&&!E&&N<=k)continue;if(d&&N>=D&&N<=k&&R===32){const W=N-1>=0?a.charCodeAt(N-1):0,H=N+1=0?a.charCodeAt(N-1):0;if(R===32&&W!==32&&W!==9)continue}if(n&&(!M||M.startOffset>N||M.endOffset<=N))continue;const F=e.visibleRangeForPosition(new ae(t,N+1));F&&(s?(A=Math.max(A,F.left),R===9?L+=this._renderArrow(f,v,F.left):L+=``):R===9?L+=`
${S?String.fromCharCode(65515):String.fromCharCode(8594)}
`:L+=`
${String.fromCharCode(y)}
`)}return s?(A=Math.round(A+v),``+L+""):L}_renderArrow(e,t,n){const r=t/7,o=t,s=e/2,a=n,l={x:0,y:r/2},c={x:100/125*o,y:l.y},u={x:c.x-.2*c.x,y:c.y+.2*c.x},d={x:u.x+.1*c.x,y:u.y+.1*c.x},h={x:d.x+.35*c.x,y:d.y-.35*c.x},f={x:h.x,y:-h.y},g={x:d.x,y:-d.y},p={x:u.x,y:-u.y},v={x:c.x,y:-c.y},m={x:l.x,y:-l.y};return``}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}class Pre{constructor(e){const t=e.options,n=t.get(50),r=t.get(38);r==="off"?(this.renderWhitespace="none",this.renderWithSVG=!1):r==="svg"?(this.renderWhitespace=t.get(99),this.renderWithSVG=!0):(this.renderWhitespace=t.get(99),this.renderWithSVG=!1),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=n.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(67),this.stopRenderingLineAfter=t.get(117)}equals(e){return this.renderWhitespace===e.renderWhitespace&&this.renderWithSVG===e.renderWithSVG&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter}}class RVe{constructor(e,t,n,r){this.selections=e,this.startLineNumber=t.startLineNumber|0,this.endLineNumber=t.endLineNumber|0,this.relativeVerticalOffset=t.relativeVerticalOffset,this.bigNumbersDelta=t.bigNumbersDelta|0,this.whitespaceViewportData=n,this._model=r,this.visibleRange=new B(t.startLineNumber,this._model.getLineMinColumn(t.startLineNumber),t.endLineNumber,this._model.getLineMaxColumn(t.endLineNumber))}getViewLineRenderingData(e){return this._model.getViewportViewLineRenderingData(this.visibleRange,e)}getDecorationsInViewport(){return this._model.getDecorationsInViewport(this.visibleRange)}}class MVe{get type(){return this._theme.type}get value(){return this._theme}constructor(e){this._theme=e}update(e){this._theme=e}getColor(e){return this._theme.getColor(e)}}class AVe{constructor(e,t,n){this.configuration=e,this.theme=new MVe(t),this.viewModel=n,this.viewLayout=n.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}}var PVe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},OVe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let BH=class extends $k{constructor(e,t,n,r,o,s,a){super(),this._instantiationService=a,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new yt(1,1,1,1)],this._renderAnimationFrame=null;const l=new zHe(t,r,o,e);this._context=new AVe(t,n,r),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(PH,this._context,l,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=Qn(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=Qn(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=Qn(document.createElement("div")),fh.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new JHe(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new V4(this._context,this._linesContent),this._viewZones=new kVe(this._context),this._viewParts.push(this._viewZones);const c=new CVe(this._context);this._viewParts.push(c);const u=new xVe(this._context);this._viewParts.push(u);const d=new jHe(this._context);this._viewParts.push(d),d.addDynamicOverlay(new YHe(this._context)),d.addDynamicOverlay(new Dr(this._context)),d.addDynamicOverlay(new aVe(this._context)),d.addDynamicOverlay(new QHe(this._context)),d.addDynamicOverlay(new NVe(this._context));const h=new KHe(this._context);this._viewParts.push(h),h.addDynamicOverlay(new ZHe(this._context)),h.addDynamicOverlay(new hVe(this._context)),h.addDynamicOverlay(new dVe(this._context)),h.addDynamicOverlay(new Uk(this._context)),this._glyphMarginWidgets=new nVe(this._context),this._viewParts.push(this._glyphMarginWidgets);const f=new Rb(this._context);f.getDomNode().appendChild(this._viewZones.marginDomNode),f.getDomNode().appendChild(h.getDomNode()),f.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(f),this._contentWidgets=new qHe(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new XD(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new _Ve(this._context,this.domNode),this._viewParts.push(this._overlayWidgets);const g=new SVe(this._context);this._viewParts.push(g);const p=new GHe(this._context);this._viewParts.push(p);const v=new vVe(this._context);if(this._viewParts.push(v),c){const m=this._scrollbar.getOverviewRulerLayoutInfo();m.parent.insertBefore(c.getDomNode(),m.insertBefore)}this._linesContent.appendChild(d.getDomNode()),this._linesContent.appendChild(g.domNode),this._linesContent.appendChild(this._viewZones.domNode),this._linesContent.appendChild(this._viewLines.getDomNode()),this._linesContent.appendChild(this._contentWidgets.domNode),this._linesContent.appendChild(this._viewCursors.getDomNode()),this._overflowGuardContainer.appendChild(f.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._overflowGuardContainer.appendChild(u.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(v.getDomNode()),this._overflowGuardContainer.appendChild(p.domNode),this.domNode.appendChild(this._overflowGuardContainer),s?(s.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode),s.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode)):(this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this.domNode.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode)),this._applyLayout(),this._pointerHandler=this._register(new V$e(this._context,l,this._createPointerHandlerHelper()))}_computeGlyphMarginLanes(){const e=this._context.viewModel.model,t=this._context.viewModel.glyphLanes;let n=[],r=0;n=n.concat(e.getAllMarginDecorations().map(o=>{var s,a,l;const c=(a=(s=o.options.glyphMargin)===null||s===void 0?void 0:s.position)!==null&&a!==void 0?a:$f.Center;return r=Math.max(r,o.range.endLineNumber),{range:o.range,lane:c,persist:(l=o.options.glyphMargin)===null||l===void 0?void 0:l.persistLane}})),n=n.concat(this._glyphMarginWidgets.getWidgets().map(o=>{const s=e.validateRange(o.preference.range);return r=Math.max(r,s.endLineNumber),{range:s,lane:o.preference.lane}})),n.sort((o,s)=>B.compareRangesUsingStarts(o.range,s.range)),t.reset(r);for(const o of n)t.push(o.lane,o.range,o.persist);return t}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,viewLinesDomNode:this._viewLines.getDomNode().domNode,focusTextArea:()=>{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new _$e(e,t)},renderNow:()=>{this.render(!0,!1)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,t)),visibleRangeForPosition:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new ae(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e))}}_applyLayout(){const t=this._context.configuration.options.get(144);this.domNode.setWidth(t.width),this.domNode.setHeight(t.height),this._overflowGuardContainer.setWidth(t.width),this._overflowGuardContainer.setHeight(t.height),this._linesContent.setWidth(1e6),this._linesContent.setHeight(1e6)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(141)+" "+AH(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this.domNode.setClassName(this._getEditorClassName()),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onDecorationsChanged(e){return e.affectsGlyphMargin&&(this._shouldRecomputeGlyphMarginLanes=!0),!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this._context.theme.update(e.theme),this.domNode.setClassName(this._getEditorClassName()),!1}dispose(){this._renderAnimationFrame!==null&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null),this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewLines.dispose();for(const e of this._viewParts)e.dispose();super.dispose()}_scheduleRender(){if(this._store.isDisposed)throw new qi;if(this._renderAnimationFrame===null){const e=this._createCoordinatedRendering();this._renderAnimationFrame=WH.INSTANCE.scheduleCoordinatedRendering({window:Pt(this.domNode.domNode),prepareRenderText:()=>{if(this._store.isDisposed)throw new qi;try{return e.prepareRenderText()}finally{this._renderAnimationFrame=null}},renderText:()=>{if(this._store.isDisposed)throw new qi;return e.renderText()},prepareRender:(t,n)=>{if(this._store.isDisposed)throw new qi;return e.prepareRender(t,n)},render:(t,n)=>{if(this._store.isDisposed)throw new qi;return e.render(t,n)}})}}_flushAccumulatedAndRenderNow(){const e=this._createCoordinatedRendering();Xm(()=>e.prepareRenderText());const t=Xm(()=>e.renderText());if(t){const[n,r]=t;Xm(()=>e.prepareRender(n,r)),Xm(()=>e.render(n,r))}}_getViewPartsToRender(){const e=[];let t=0;for(const n of this._viewParts)n.shouldRender()&&(e[t++]=n);return e}_createCoordinatedRendering(){return{prepareRenderText:()=>{if(this._shouldRecomputeGlyphMarginLanes){this._shouldRecomputeGlyphMarginLanes=!1;const e=this._computeGlyphMarginLanes();this._context.configuration.setGlyphMarginDecorationLaneCount(e.requiredLanes)}Km.onRenderStart()},renderText:()=>{if(!this.domNode.domNode.isConnected)return null;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&e.length===0)return null;const t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const n=new RVe(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);return this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(n),this._viewLines.shouldRender()&&(this._viewLines.renderText(n),this._viewLines.onDidRender(),e=this._getViewPartsToRender()),[e,new d$e(this._context.viewLayout,n,this._viewLines)]},prepareRender:(e,t)=>{for(const n of e)n.prepareRender(t)},render:(e,t)=>{for(const n of e)n.render(t),n.onDidRender()}}}delegateVerticalScrollbarPointerDown(e){this._scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._scrollbar.delegateScrollFromMouseWheelEvent(e)}restoreState(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft},1),this._context.viewModel.visibleLinesStabilized()}getOffsetForColumn(e,t){const n=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),r=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(n);this._flushAccumulatedAndRenderNow();const o=this._viewLines.visibleRangeForPosition(new ae(r.lineNumber,r.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const n=this._pointerHandler.getTargetAtClientPoint(e,t);return n?$4.convertViewToModelMouseTarget(n,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new wVe(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const n of this._viewParts)n.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}writeScreenReaderContent(e){this._textAreaHandler.writeScreenReaderContent(e)}focus(){this._textAreaHandler.focusTextArea()}isFocused(){return this._textAreaHandler.isFocused()}setAriaOptions(e){this._textAreaHandler.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){var t,n,r,o,s,a,l,c;this._contentWidgets.setWidgetPosition(e.widget,(n=(t=e.position)===null||t===void 0?void 0:t.position)!==null&&n!==void 0?n:null,(o=(r=e.position)===null||r===void 0?void 0:r.secondaryPosition)!==null&&o!==void 0?o:null,(a=(s=e.position)===null||s===void 0?void 0:s.preference)!==null&&a!==void 0?a:null,(c=(l=e.position)===null||l===void 0?void 0:l.positionAffinity)!==null&&c!==void 0?c:null),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){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()}addGlyphMarginWidget(e){this._glyphMarginWidgets.addWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}layoutGlyphMarginWidget(e){const t=e.position;this._glyphMarginWidgets.setWidgetPosition(e.widget,t)&&(this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender())}removeGlyphMarginWidget(e){this._glyphMarginWidgets.removeWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}};BH=PVe([OVe(6,Ot)],BH);function Xm(i){try{return i()}catch(e){return en(e),null}}class WH{constructor(){this._coordinatedRenderings=[],this._animationFrameRunners=new Map}scheduleCoordinatedRendering(e){return this._coordinatedRenderings.push(e),this._scheduleRender(e.window),{dispose:()=>{const t=this._coordinatedRenderings.indexOf(e);if(t!==-1&&(this._coordinatedRenderings.splice(t,1),this._coordinatedRenderings.length===0)){for(const[n,r]of this._animationFrameRunners)r.dispose();this._animationFrameRunners.clear()}}}}_scheduleRender(e){if(!this._animationFrameRunners.has(e)){const t=()=>{this._animationFrameRunners.delete(e),this._onRenderScheduled()};this._animationFrameRunners.set(e,KA(e,t,100))}}_onRenderScheduled(){const e=this._coordinatedRenderings.slice(0);this._coordinatedRenderings=[];for(const n of e)Xm(()=>n.prepareRenderText());const t=[];for(let n=0,r=e.length;no.renderText())}for(let n=0,r=e.length;no.prepareRender(a,l))}for(let n=0,r=e.length;no.render(a,l))}}}WH.INSTANCE=new WH;class _E{constructor(e,t,n,r,o){this.injectionOffsets=e,this.injectionOptions=t,this.breakOffsets=n,this.breakOffsetsVisibleColumn=r,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 r=this.breakOffsets[e]-t;return e>0&&(r+=this.wrappedTextIndentLength),r}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let r=e===0?t:this.breakOffsets[e-1]+t;if(this.injectionOffsets!==null)for(let o=0;othis.injectionOffsets[o];o++)r0?this.breakOffsets[o-1]:0,t===0)if(e<=s)r=o-1;else if(e>l)n=o+1;else break;else if(e=l)n=o+1;else break}let a=e-s;return o>0&&(a+=this.wrappedTextIndentLength),new bR(o,a)}normalizeOutputPosition(e,t,n){if(this.injectionOffsets!==null){const r=this.outputPositionToOffsetInInputWithInjections(e,t),o=this.normalizeOffsetInInputWithInjectionsAroundInjections(r,n);if(o!==r)return this.offsetInInputWithInjectionsToOutputPosition(o,n)}if(n===0){if(e>0&&t===this.getMinOutputOffset(e))return new bR(e-1,this.getMaxOutputOffset(e-1))}else if(n===1){const r=this.getOutputLineCount()-1;if(e0&&(t=Math.max(0,t-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const n=this.getInjectedTextAtOffset(e);if(!n)return e;if(t===2){if(e===n.offsetInInputWithInjections+n.length&&Ore(this.injectionOptions[n.injectedTextIndex].cursorStops))return n.offsetInInputWithInjections+n.length;{let r=n.offsetInInputWithInjections;if(Fre(this.injectionOptions[n.injectedTextIndex].cursorStops))return r;let o=n.injectedTextIndex-1;for(;o>=0&&this.injectionOffsets[o]===this.injectionOffsets[n.injectedTextIndex]&&!(Ore(this.injectionOptions[o].cursorStops)||(r-=this.injectionOptions[o].content.length,Fre(this.injectionOptions[o].cursorStops)));)o--;return r}}else if(t===1||t===4){let r=n.offsetInInputWithInjections+n.length,o=n.injectedTextIndex;for(;o+1=0&&this.injectionOffsets[o-1]===this.injectionOffsets[o];)r-=this.injectionOptions[o-1].content.length,o--;return r}w4()}getInjectedText(e,t){const n=this.outputPositionToOffsetInInputWithInjections(e,t),r=this.getInjectedTextAtOffset(n);return r?{options:this.injectionOptions[r.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,n=this.injectionOptions;if(t!==null){let r=0;for(let o=0;oe)break;if(e<=l)return{injectedTextIndex:o,offsetInInputWithInjections:a,length:s};r+=s}}}}function Ore(i){return i==null?!0:i===ju.Right||i===ju.Both}function Fre(i){return i==null?!0:i===ju.Left||i===ju.Both}class bR{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new ae(e+this.outputLineIndex,this.outputOffset+1)}}class FVe{constructor(){this.changeType=1}}class gh{static applyInjectedText(e,t){if(!t||t.length===0)return e;let n="",r=0;for(const o of t)n+=e.substring(r,o.column-1),r=o.column-1,n+=o.options.content;return n+=e.substring(r),n}static fromDecorations(e){const t=[];for(const n of e)n.options.before&&n.options.before.content.length>0&&t.push(new gh(n.ownerId,n.range.startLineNumber,n.range.startColumn,n.options.before,0)),n.options.after&&n.options.after.content.length>0&&t.push(new gh(n.ownerId,n.range.endLineNumber,n.range.endColumn,n.options.after,1));return t.sort((n,r)=>n.lineNumber===r.lineNumber?n.column===r.column?n.order-r.order:n.column-r.column:n.lineNumber-r.lineNumber),t}constructor(e,t,n,r,o){this.ownerId=e,this.lineNumber=t,this.column=n,this.options=r,this.order=o}}class Bre{constructor(e,t,n){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=n}}class BVe{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class WVe{constructor(e,t,n,r){this.changeType=4,this.injectedTexts=r,this.fromLineNumber=e,this.toLineNumber=t,this.detail=n}}class $Ve{constructor(){this.changeType=5}}class zy{constructor(e,t,n,r){this.changes=e,this.versionId=t,this.isUndoing=n,this.isRedoing=r,this.resultingSelection=null}containsEvent(e){for(let t=0,n=this.changes.length;ti});class aX{static create(e){return new aX(new WeakRef(e))}constructor(e){this.targetWindow=e}createLineBreaksComputer(e,t,n,r,o){const s=[],a=[];return{addRequest:(l,c,u)=>{s.push(l),a.push(c)},finalize:()=>HVe(zm(this.targetWindow.deref()),s,e,t,n,r,o,a)}}}function HVe(i,e,t,n,r,o,s,a){var l;function c(M){const A=a[M];if(A){const N=gh.applyInjectedText(e[M],A),R=A.map(W=>W.options),F=A.map(W=>W.column-1);return new _E(F,R,[N.length],[],0)}else return null}if(r===-1){const M=[];for(let A=0,N=e.length;Au?(N=0,R=0):F=u-G}const W=A.substr(N),H=VVe(W,R,n,F,p,f);v[M]=N,m[M]=R,_[M]=W,y[M]=H[0],S[M]=H[1]}const L=p.build(),E=(l=P6==null?void 0:P6.createHTML(L))!==null&&l!==void 0?l:L;g.innerHTML=E,g.style.position="absolute",g.style.top="10000",s==="keepAll"?(g.style.wordBreak="keep-all",g.style.overflowWrap="anywhere"):(g.style.wordBreak="inherit",g.style.overflowWrap="break-word"),i.document.body.appendChild(g);const D=document.createRange(),k=Array.prototype.slice.call(g.children,0),T=[];for(let M=0;Mre.options),U=K.map(re=>re.column-1)):(G=null,U=null),T[M]=new _E(U,G,N,H,F)}return i.document.body.removeChild(g),T}function VVe(i,e,t,n,r,o){if(o!==0){const h=String(o);r.appendString('
');const s=i.length;let a=e,l=0;const c=[],u=[];let d=0");for(let h=0;h"),c[h]=l,u[h]=a;const f=d;d=h+1"),c[i.length]=l,u[i.length]=a,r.appendString("
"),[c,u]}function zVe(i,e,t,n){if(t.length<=1)return null;const r=Array.prototype.slice.call(e.children,0),o=[];try{$H(i,r,n,0,null,t.length-1,null,o)}catch(s){return console.log(s),null}return o.length===0?null:(o.push(t.length),o)}function $H(i,e,t,n,r,o,s,a){if(n===o||(r=r||O6(i,e,t[n],t[n+1]),s=s||O6(i,e,t[o],t[o+1]),Math.abs(r[0].top-s[0].top)<=.1))return;if(n+1===o){a.push(o);return}const l=n+(o-n)/2|0,c=O6(i,e,t[l],t[l+1]);$H(i,e,t,n,r,l,c,a),$H(i,e,t,l,c,o,s,a)}function O6(i,e,t,n){return i.setStart(e[t/16384|0].firstChild,t%16384),i.setEnd(e[n/16384|0].firstChild,n%16384),i.getClientRects()}class UVe extends fe{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new lq),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[0]=!1,this._finishedInstantiation[1]=!1,this._finishedInstantiation[2]=!1,this._finishedInstantiation[3]=!1}initialize(e,t,n){this._editor=e,this._instantiationService=n;for(const r of t){if(this._pending.has(r.id)){en(new Error(`Cannot have two contributions with the same id ${r.id}`));continue}this._pending.set(r.id,r)}this._instantiateSome(0),this._register(yL(Pt(this._editor.getDomNode()),()=>{this._instantiateSome(1)})),this._register(yL(Pt(this._editor.getDomNode()),()=>{this._instantiateSome(2)})),this._register(yL(Pt(this._editor.getDomNode()),()=>{this._instantiateSome(3)},5e3))}saveViewState(){const e={};for(const[t,n]of this._instances)typeof n.saveViewState=="function"&&(e[t]=n.saveViewState());return e}restoreViewState(e){for(const[t,n]of this._instances)typeof n.restoreViewState=="function"&&n.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}onBeforeInteractionEvent(){this._instantiateSome(2)}onAfterModelAttached(){var e;return yL(Pt((e=this._editor)===null||e===void 0?void 0:e.getDomNode()),()=>{this._instantiateSome(1)},50)}_instantiateSome(e){if(this._finishedInstantiation[e])return;this._finishedInstantiation[e]=!0;const t=this._findPendingContributionsByInstantiation(e);for(const n of t)this._instantiateById(n.id)}_findPendingContributionsByInstantiation(e){const t=[];for(const[,n]of this._pending)n.instantiation===e&&t.push(n);return t}_instantiateById(e){const t=this._pending.get(e);if(t){if(this._pending.delete(e),!this._instantiationService||!this._editor)throw new Error("Cannot instantiate contributions before being initialized!");try{const n=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,n),typeof n.restoreViewState=="function"&&t.instantiation!==0&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(n){en(n)}}}}class Wve{constructor(e,t,n,r,o,s,a){this.id=e,this.label=t,this.alias=n,this.metadata=r,this._precondition=o,this._run=s,this._contextKeyService=a}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}function Yv(i){let e=0,t=0,n=0,r=0;for(let o=0,s=i.length;o=ac&&(t=t-i%ac),t}function XVe(i,e){return i.reduce((t,n)=>gr(t,e(n)),ya)}function $ve(i,e){return i===e}function ZD(i,e){const t=i,n=e;if(n-t<=0)return ya;const o=Math.floor(t/ac),s=Math.floor(n/ac),a=n-s*ac;if(o===s){const l=t-o*ac;return Fr(0,a-l)}else return Fr(s-o,a)}function Uy(i,e){return i=e}function fy(i){return Fr(i.lineNumber-1,i.column-1)}function sb(i,e){const t=i,n=Math.floor(t/ac),r=t-n*ac,o=e,s=Math.floor(o/ac),a=o-s*ac;return new B(n+1,r+1,s+1,a+1)}function YVe(i){const e=Jf(i);return Fr(e.length-1,e[e.length-1].length)}class op{static fromModelContentChanges(e){return e.map(n=>{const r=B.lift(n.range);return new op(fy(r.getStartPosition()),fy(r.getEndPosition()),YVe(n.text))}).reverse()}constructor(e,t,n){this.startOffset=e,this.endOffset=t,this.newLength=n}toString(){return`[${tu(this.startOffset)}...${tu(this.endOffset)}) -> ${tu(this.newLength)}`}}class ZVe{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>lX.from(t))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],n=t?this.translateOldToCur(t.offsetObj):null;return n===null?null:ZD(e,n)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?Fr(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):Fr(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=tu(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?Fr(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):Fr(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx>5;if(r===0){const s=1<this.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;this.line===null&&(this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const e=this.lineIdx,t=this.lineCharOffset;let n=0;for(;;){const o=this.lineTokens,s=o.getCount();let a=null;if(this.lineTokenOffset1e3))break;if(n>1500)break}const r=GVe(e,t,this.lineIdx,this.lineCharOffset);return new Fm(r,0,-1,ro.getEmpty(),new D0(r))}}class ize{constructor(e,t){this.text=e,this._offset=ya,this.idx=0;const n=t.getRegExpStr(),r=n?new RegExp(n+`| +`,"gi"):null,o=[];let s,a=0,l=0,c=0,u=0;const d=[];for(let g=0;g<60;g++)d.push(new Fm(Fr(0,g),0,-1,ro.getEmpty(),new D0(Fr(0,g))));const h=[];for(let g=0;g<60;g++)h.push(new Fm(Fr(1,g),0,-1,ro.getEmpty(),new D0(Fr(1,g))));if(r)for(r.lastIndex=0;(s=r.exec(e))!==null;){const g=s.index,p=s[0];if(p===` +`)a++,l=g+1;else{if(c!==g){let v;if(u===a){const m=g-c;if(mrze(t)).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"gi"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e.toLowerCase())}findClosingTokenText(e){for(const[t,n]of this.map)if(n.kind===2&&n.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function rze(i){let e=fc(i);return/^[\w ]+/.test(i)&&(e=`\\b${e}`),/[\w ]+$/.test(i)&&(e=`${e}\\b`),e}class zve{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){return this.languageIdToBracketTokens.has(e)}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=dX.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function oze(i){if(i.length===0)return null;if(i.length===1)return i[0];let e=0;function t(){if(e>=i.length)return null;const s=e,a=i[s].listHeight;for(e++;e=2?Uve(s===0&&e===i.length?i:i.slice(s,e),!1):i[s]}let n=t(),r=t();if(!r)return n;for(let s=t();s;s=t())Hre(n,r)<=Hre(r,s)?(n=F6(n,r),r=s):r=F6(r,s);return F6(n,r)}function Uve(i,e=!1){if(i.length===0)return null;if(i.length===1)return i[0];let t=i.length;for(;t>3;){const n=t>>1;for(let r=0;r=3?i[2]:null,e)}function Hre(i,e){return Math.abs(i.listHeight-e.listHeight)}function F6(i,e){return i.listHeight===e.listHeight?Vf.create23(i,e,null,!1):i.listHeight>e.listHeight?sze(i,e):aze(e,i)}function sze(i,e){i=i.toMutable();let t=i;const n=[];let r;for(;;){if(e.listHeight===t.listHeight){r=e;break}if(t.kind!==4)throw new Error("unexpected");n.push(t),t=t.makeLastElementMutable()}for(let o=n.length-1;o>=0;o--){const s=n[o];r?s.childrenLength>=3?r=Vf.create23(s.unappendChild(),r,null,!1):(s.appendChildOfSameHeight(r),r=void 0):s.handleChildrenChanged()}return r?Vf.create23(i,r,null,!1):i}function aze(i,e){i=i.toMutable();let t=i;const n=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==4)throw new Error("unexpected");n.push(t),t=t.makeFirstElementMutable()}let r=e;for(let o=n.length-1;o>=0;o--){const s=n[o];r?s.childrenLength>=3?r=Vf.create23(r,s.unprependChild(),null,!1):(s.prependChildOfSameHeight(r),r=void 0):s.handleChildrenChanged()}return r?Vf.create23(r,i,null,!1):i}class lze{constructor(e){this.lastOffset=ya,this.nextNodes=[e],this.offsets=[ya],this.idxs=[]}readLongestNodeAt(e,t){if(Uy(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const n=Wx(this.nextNodes);if(!n)return;const r=Wx(this.offsets);if(Uy(e,r))return;if(Uy(r,e))if(gr(r,n.length)<=e)this.nextNodeAfterCurrent();else{const o=B6(n);o!==-1?(this.nextNodes.push(n.getChild(o)),this.offsets.push(r),this.idxs.push(o)):this.nextNodeAfterCurrent()}else{if(t(n))return this.nextNodeAfterCurrent(),n;{const o=B6(n);if(o===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(n.getChild(o)),this.offsets.push(r),this.idxs.push(o)}}}}nextNodeAfterCurrent(){for(;;){const e=Wx(this.offsets),t=Wx(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const n=Wx(this.nextNodes),r=B6(n,this.idxs[this.idxs.length-1]);if(r!==-1){this.nextNodes.push(n.getChild(r)),this.offsets.push(gr(e,t.length)),this.idxs[this.idxs.length-1]=r;break}else this.idxs.pop()}}}function B6(i,e=-1){for(;;){if(e++,e>=i.childrenLength)return-1;if(i.getChild(e))return e}}function Wx(i){return i.length>0?i[i.length-1]:void 0}function HH(i,e,t,n){return new cze(i,e,t,n).parseDocument()}class cze{constructor(e,t,n,r){if(this.tokenizer=e,this.createImmutableLists=r,this._itemsConstructed=0,this._itemsFromCache=0,n&&r)throw new Error("Not supported");this.oldNodeReader=n?new lze(n):void 0,this.positionMapper=new ZVe(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(ro.getEmpty(),0);return e||(e=Vf.getEmpty()),e}parseList(e,t){const n=[];for(;;){let o=this.tryReadChildFromCache(e);if(!o){const s=this.tokenizer.peek();if(!s||s.kind===2&&s.bracketIds.intersects(e))break;o=this.parseChild(e,t+1)}o.kind===4&&o.childrenLength===0||n.push(o)}return this.oldNodeReader?oze(n):Uve(n,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!fP(t)){const n=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),r=>t!==null&&!Uy(r.length,t)?!1:r.canBeReused(e));if(n)return this._itemsFromCache++,this.tokenizer.skip(n.length),n}}}parseChild(e,t){this._itemsConstructed++;const n=this.tokenizer.read();switch(n.kind){case 2:return new tze(n.bracketIds,n.length);case 0:return n.astNode;case 1:{if(t>300)return new D0(n.length);const r=e.merge(n.bracketIds),o=this.parseList(r,t+1),s=this.tokenizer.peek();return s&&s.kind===2&&(s.bracketId===n.bracketId||s.bracketIds.intersects(n.bracketIds))?(this.tokenizer.read(),QD.create(n.astNode,o,s.astNode)):QD.create(n.astNode,o,null)}default:throw new Error("unexpected")}}}function mP(i,e){if(i.length===0)return e;if(e.length===0)return i;const t=new Dp(Vre(i)),n=Vre(e);n.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let r=t.dequeue();function o(c){if(c===void 0){const d=t.takeWhile(h=>!0)||[];return r&&d.unshift(r),d}const u=[];for(;r&&!fP(c);){const[d,h]=r.splitAt(c);u.push(d),c=ZD(d.lengthAfter,c),r=h??t.dequeue()}return fP(c)||u.push(new Ym(!1,c,c)),u}const s=[];function a(c,u,d){if(s.length>0&&$ve(s[s.length-1].endOffset,c)){const h=s[s.length-1];s[s.length-1]=new op(h.startOffset,u,gr(h.newLength,d))}else s.push({startOffset:c,endOffset:u,newLength:d})}let l=ya;for(const c of n){const u=o(c.lengthBefore);if(c.modified){const d=XVe(u,f=>f.lengthBefore),h=gr(l,d);a(l,h,c.lengthAfter),l=h}else for(const d of u){const h=l;l=gr(l,d.lengthBefore),d.modified&&a(h,l,d.lengthAfter)}}return s}class Ym{constructor(e,t,n){this.modified=e,this.lengthBefore=t,this.lengthAfter=n}splitAt(e){const t=ZD(e,this.lengthAfter);return $ve(t,ya)?[this,void 0]:this.modified?[new Ym(this.modified,this.lengthBefore,e),new Ym(this.modified,ya,t)]:[new Ym(this.modified,e,e),new Ym(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${tu(this.lengthBefore)} -> ${tu(this.lengthAfter)}`}}function Vre(i){const e=[];let t=ya;for(const n of i){const r=ZD(t,n.startOffset);fP(r)||e.push(new Ym(!1,r,r));const o=ZD(n.startOffset,n.endOffset);e.push(new Ym(!0,o,n.newLength)),t=n.endOffset}return e}class uze extends fe{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new se,this.denseKeyProvider=new Hve,this.brackets=new zve(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)e.tokenization.backgroundTokenizationState===2?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens);else{const n=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),r=new ize(this.textModel.getValue(),n);this.initialAstWithoutTokens=HH(r,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(this.textModel.tokenization.backgroundTokenizationState===2){const e=this.initialAstWithoutTokens===void 0;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map(n=>new op(Fr(n.fromLineNumber-1,0),Fr(n.toLineNumber,0),Fr(n.toLineNumber-n.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=op.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const n=mP(this.queuedTextEdits,e);this.queuedTextEdits=n,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=mP(this.queuedTextEditsForInitialAstWithoutTokens,e))}flushQueue(){this.queuedTextEdits.length>0&&(this.astWithTokens=this.parseDocumentFromTextBuffer(this.queuedTextEdits,this.astWithTokens,!1),this.queuedTextEdits=[]),this.queuedTextEditsForInitialAstWithoutTokens.length>0&&(this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens,this.initialAstWithoutTokens,!1)),this.queuedTextEditsForInitialAstWithoutTokens=[])}parseDocumentFromTextBuffer(e,t,n){const r=t,o=new Vve(this.textModel,this.brackets);return HH(o,e,r,n)}getBracketsInRange(e,t){this.flushQueue();const n=Fr(e.startLineNumber-1,e.startColumn-1),r=Fr(e.endLineNumber-1,e.endColumn-1);return new If(o=>{const s=this.initialAstWithoutTokens||this.astWithTokens;VH(s,ya,s.length,n,r,o,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const n=fy(e.getStartPosition()),r=fy(e.getEndPosition());return new If(o=>{const s=this.initialAstWithoutTokens||this.astWithTokens,a=new dze(o,t,this.textModel);zH(s,ya,s.length,n,r,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return Kve(t,ya,t.length,fy(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return jve(t,ya,t.length,fy(e))}}function jve(i,e,t,n){if(i.kind===4||i.kind===2){const r=[];for(const o of i.children)t=gr(e,o.length),r.push({nodeOffsetStart:e,nodeOffsetEnd:t}),e=t;for(let o=r.length-1;o>=0;o--){const{nodeOffsetStart:s,nodeOffsetEnd:a}=r[o];if(Uy(s,n)){const l=jve(i.children[o],s,a,n);if(l)return l}}return null}else{if(i.kind===3)return null;if(i.kind===1){const r=sb(e,t);return{bracketInfo:i.bracketInfo,range:r}}}return null}function Kve(i,e,t,n){if(i.kind===4||i.kind===2){for(const r of i.children){if(t=gr(e,r.length),Uy(n,t)){const o=Kve(r,e,t,n);if(o)return o}e=t}return null}else{if(i.kind===3)return null;if(i.kind===1){const r=sb(e,t);return{bracketInfo:i.bracketInfo,range:r}}}return null}function VH(i,e,t,n,r,o,s,a,l,c,u=!1){if(s>200)return!0;e:for(;;)switch(i.kind){case 4:{const d=i.childrenLength;for(let h=0;h200)return!0;let c=!0;if(i.kind===2){let u=0;if(a){let f=a.get(i.openingBracket.text);f===void 0&&(f=0),u=f,f++,a.set(i.openingBracket.text,f)}const d=gr(e,i.openingBracket.length);let h=-1;if(o.includeMinIndentation&&(h=i.computeMinIndentation(e,o.textModel)),c=o.push(new KVe(sb(e,t),sb(e,d),i.closingBracket?sb(gr(d,((l=i.child)===null||l===void 0?void 0:l.length)||ya),t):void 0,s,u,i,h)),e=d,c&&i.child){const f=i.child;if(t=gr(e,f.length),jy(e,r)&&RL(t,n)&&(c=zH(f,e,t,n,r,o,s+1,a),!c))return!1}a==null||a.set(i.openingBracket.text,u)}else{let u=e;for(const d of i.children){const h=u;if(u=gr(u,d.length),jy(h,r)&&jy(n,u)&&(c=zH(d,h,u,n,r,o,s,a),!c))return!1}}return c}class hze extends fe{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new Ho),this.onDidChangeEmitter=new se,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(this.languageConfigurationService.onDidChange(n=>{var r;(!n.languageId||!((r=this.bracketPairsTree.value)===null||r===void 0)&&r.object.didLanguageChange(n.languageId))&&(this.bracketPairsTree.clear(),this.updateBracketPairsTree())}))}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){var t;(t=this.bracketPairsTree.value)===null||t===void 0||t.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){var e;(e=this.bracketPairsTree.value)===null||e===void 0||e.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){var t;(t=this.bracketPairsTree.value)===null||t===void 0||t.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const e=new Te;this.bracketPairsTree.value=fze(e.add(new uze(this.textModel,t=>this.languageConfigurationService.getLanguageConfiguration(t))),e),e.add(this.bracketPairsTree.value.object.onDidChange(t=>this.onDidChangeEmitter.fire(t))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire())}getBracketPairsInRange(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!1))||If.empty}getBracketPairsInRangeWithMinIndentation(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!0))||If.empty}getBracketsInRange(e,t=!1){var n;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((n=this.bracketPairsTree.value)===null||n===void 0?void 0:n.object.getBracketsInRange(e,t))||If.empty}findMatchingBracketUp(e,t,n){const r=this.textModel.validatePosition(t),o=this.textModel.getLanguageIdAtPosition(r.lineNumber,r.column);if(this.canBuildAST){const s=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew.getClosingBracketInfo(e);if(!s)return null;const a=this.getBracketPairsInRange(B.fromPositions(t,t)).findLast(l=>s.closes(l.openingBracketInfo));return a?a.openingBracketRange:null}else{const s=e.toLowerCase(),a=this.languageConfigurationService.getLanguageConfiguration(o).brackets;if(!a)return null;const l=a.textIsBracket[s];return l?CR(this._findMatchingBracketUp(l,r,W6(n))):null}}matchBracket(e,t){if(this.canBuildAST){const n=this.getBracketPairsInRange(B.fromPositions(e,e)).filter(r=>r.closingBracketRange!==void 0&&(r.openingBracketRange.containsPosition(e)||r.closingBracketRange.containsPosition(e))).findLastMaxBy(Jc(r=>r.openingBracketRange.containsPosition(e)?r.openingBracketRange:r.closingBracketRange,B.compareRangesUsingStarts));return n?[n.openingBracketRange,n.closingBracketRange]:null}else{const n=W6(t);return this._matchBracket(this.textModel.validatePosition(e),n)}}_establishBracketSearchOffsets(e,t,n,r){const o=t.getCount(),s=t.getLanguageId(r);let a=Math.max(0,e.column-1-n.maxBracketLength);for(let c=r-1;c>=0;c--){const u=t.getEndOffset(c);if(u<=a)break;if(Kh(t.getStandardTokenType(c))||t.getLanguageId(c)!==s){a=u;break}}let l=Math.min(t.getLineContent().length,e.column-1+n.maxBracketLength);for(let c=r+1;c=l)break;if(Kh(t.getStandardTokenType(c))||t.getLanguageId(c)!==s){l=u;break}}return{searchStartOffset:a,searchEndOffset:l}}_matchBracket(e,t){const n=e.lineNumber,r=this.textModel.tokenization.getLineTokens(n),o=this.textModel.getLineContent(n),s=r.findTokenIndexAtOffset(e.column-1);if(s<0)return null;const a=this.languageConfigurationService.getLanguageConfiguration(r.getLanguageId(s)).brackets;if(a&&!Kh(r.getStandardTokenType(s))){let{searchStartOffset:l,searchEndOffset:c}=this._establishBracketSearchOffsets(e,r,a,s),u=null;for(;;){const d=Mu.findNextBracketInRange(a.forwardRegex,n,o,l,c);if(!d)break;if(d.startColumn<=e.column&&e.column<=d.endColumn){const h=o.substring(d.startColumn-1,d.endColumn-1).toLowerCase(),f=this._matchFoundBracket(d,a.textIsBracket[h],a.textIsOpenBracket[h],t);if(f){if(f instanceof Ag)return null;u=f}}l=d.endColumn-1}if(u)return u}if(s>0&&r.getStartOffset(s)===e.column-1){const l=s-1,c=this.languageConfigurationService.getLanguageConfiguration(r.getLanguageId(l)).brackets;if(c&&!Kh(r.getStandardTokenType(l))){const{searchStartOffset:u,searchEndOffset:d}=this._establishBracketSearchOffsets(e,r,c,l),h=Mu.findPrevBracketInRange(c.reversedRegex,n,o,u,d);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn){const f=o.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),g=this._matchFoundBracket(h,c.textIsBracket[f],c.textIsOpenBracket[f],t);if(g)return g instanceof Ag?null:g}}}return null}_matchFoundBracket(e,t,n,r){if(!t)return null;const o=n?this._findMatchingBracketDown(t,e.getEndPosition(),r):this._findMatchingBracketUp(t,e.getStartPosition(),r);return o?o instanceof Ag?o:[e,o]:null}_findMatchingBracketUp(e,t,n){const r=e.languageId,o=e.reversedRegex;let s=-1,a=0;const l=(c,u,d,h)=>{for(;;){if(n&&++a%100===0&&!n())return Ag.INSTANCE;const f=Mu.findPrevBracketInRange(o,c,u,d,h);if(!f)break;const g=u.substring(f.startColumn-1,f.endColumn-1).toLowerCase();if(e.isOpen(g)?s++:e.isClose(g)&&s--,s===0)return f;h=f.startColumn-1}return null};for(let c=t.lineNumber;c>=1;c--){const u=this.textModel.tokenization.getLineTokens(c),d=u.getCount(),h=this.textModel.getLineContent(c);let f=d-1,g=h.length,p=h.length;c===t.lineNumber&&(f=u.findTokenIndexAtOffset(t.column-1),g=t.column-1,p=t.column-1);let v=!0;for(;f>=0;f--){const m=u.getLanguageId(f)===r&&!Kh(u.getStandardTokenType(f));if(m)v?g=u.getStartOffset(f):(g=u.getStartOffset(f),p=u.getEndOffset(f));else if(v&&g!==p){const _=l(c,h,g,p);if(_)return _}v=m}if(v&&g!==p){const m=l(c,h,g,p);if(m)return m}}return null}_findMatchingBracketDown(e,t,n){const r=e.languageId,o=e.forwardRegex;let s=1,a=0;const l=(u,d,h,f)=>{for(;;){if(n&&++a%100===0&&!n())return Ag.INSTANCE;const g=Mu.findNextBracketInRange(o,u,d,h,f);if(!g)break;const p=d.substring(g.startColumn-1,g.endColumn-1).toLowerCase();if(e.isOpen(p)?s++:e.isClose(p)&&s--,s===0)return g;h=g.endColumn-1}return null},c=this.textModel.getLineCount();for(let u=t.lineNumber;u<=c;u++){const d=this.textModel.tokenization.getLineTokens(u),h=d.getCount(),f=this.textModel.getLineContent(u);let g=0,p=0,v=0;u===t.lineNumber&&(g=d.findTokenIndexAtOffset(t.column-1),p=t.column-1,v=t.column-1);let m=!0;for(;g=1;a--){const l=this.textModel.tokenization.getLineTokens(a),c=l.getCount(),u=this.textModel.getLineContent(a);let d=c-1,h=u.length,f=u.length;if(a===n.lineNumber){d=l.findTokenIndexAtOffset(n.column-1),h=n.column-1,f=n.column-1;const p=l.getLanguageId(d);r!==p&&(r=p,o=this.languageConfigurationService.getLanguageConfiguration(r).brackets,s=this.languageConfigurationService.getLanguageConfiguration(r).bracketsNew)}let g=!0;for(;d>=0;d--){const p=l.getLanguageId(d);if(r!==p){if(o&&s&&g&&h!==f){const m=Mu.findPrevBracketInRange(o.reversedRegex,a,u,h,f);if(m)return this._toFoundBracket(s,m);g=!1}r=p,o=this.languageConfigurationService.getLanguageConfiguration(r).brackets,s=this.languageConfigurationService.getLanguageConfiguration(r).bracketsNew}const v=!!o&&!Kh(l.getStandardTokenType(d));if(v)g?h=l.getStartOffset(d):(h=l.getStartOffset(d),f=l.getEndOffset(d));else if(s&&o&&g&&h!==f){const m=Mu.findPrevBracketInRange(o.reversedRegex,a,u,h,f);if(m)return this._toFoundBracket(s,m)}g=v}if(s&&o&&g&&h!==f){const p=Mu.findPrevBracketInRange(o.reversedRegex,a,u,h,f);if(p)return this._toFoundBracket(s,p)}}return null}findNextBracket(e){var t;const n=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getFirstBracketAfter(n))||null;const r=this.textModel.getLineCount();let o=null,s=null,a=null;for(let l=n.lineNumber;l<=r;l++){const c=this.textModel.tokenization.getLineTokens(l),u=c.getCount(),d=this.textModel.getLineContent(l);let h=0,f=0,g=0;if(l===n.lineNumber){h=c.findTokenIndexAtOffset(n.column-1),f=n.column-1,g=n.column-1;const v=c.getLanguageId(h);o!==v&&(o=v,s=this.languageConfigurationService.getLanguageConfiguration(o).brackets,a=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew)}let p=!0;for(;hp.closingBracketRange!==void 0&&p.range.strictContainsRange(f));return g?[g.openingBracketRange,g.closingBracketRange]:null}const r=W6(t),o=this.textModel.getLineCount(),s=new Map;let a=[];const l=(f,g)=>{if(!s.has(f)){const p=[];for(let v=0,m=g?g.brackets.length:0;v{for(;;){if(r&&++c%100===0&&!r())return Ag.INSTANCE;const _=Mu.findNextBracketInRange(f.forwardRegex,g,p,v,m);if(!_)break;const y=p.substring(_.startColumn-1,_.endColumn-1).toLowerCase(),S=f.textIsBracket[y];if(S&&(S.isOpen(y)?a[S.index]++:S.isClose(y)&&a[S.index]--,a[S.index]===-1))return this._matchFoundBracket(_,S,!1,r);v=_.endColumn-1}return null};let d=null,h=null;for(let f=n.lineNumber;f<=o;f++){const g=this.textModel.tokenization.getLineTokens(f),p=g.getCount(),v=this.textModel.getLineContent(f);let m=0,_=0,y=0;if(f===n.lineNumber){m=g.findTokenIndexAtOffset(n.column-1),_=n.column-1,y=n.column-1;const L=g.getLanguageId(m);d!==L&&(d=L,h=this.languageConfigurationService.getLanguageConfiguration(d).brackets,l(d,h))}let S=!0;for(;me==null?void 0:e.dispose()}}function W6(i){if(typeof i>"u")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=i}}class Ag{constructor(){this._searchCanceledBrand=void 0}}Ag.INSTANCE=new Ag;function CR(i){return i instanceof Ag?null:i}class gze extends fe{constructor(e){super(),this.textModel=e,this.colorProvider=new Gve,this.onDidChangeEmitter=new se,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.bracketPairs.onDidChange(t=>{this.onDidChangeEmitter.fire()}))}handleDidChangeOptions(e){this.colorizationOptions=this.textModel.getOptions().bracketPairColorizationOptions}getDecorationsInRange(e,t,n,r){return r?[]:t===void 0?[]:this.colorizationOptions.enabled?this.textModel.bracketPairs.getBracketsInRange(e,!0).map(s=>({id:`bracket${s.range.toString()}-${s.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(s,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:s.range})).toArray():[]}getAllDecorations(e,t){return e===void 0?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new B(1,1,this.textModel.getLineCount(),1),e,t):[]}}class Gve{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e,t){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(t?e.nestingLevelOfEqualBracketType:e.nestingLevel)}getInlineClassNameOfLevel(e){return`bracket-highlighting-${e%30}`}}fu((i,e)=>{const t=[yve,wve,Sve,xve,Lve,Eve],n=new Gve;e.addRule(`.monaco-editor .${n.unexpectedClosingBracketClassName} { color: ${i.getColor(uHe)}; }`);const r=t.map(o=>i.getColor(o)).filter(o=>!!o).filter(o=>!o.isTransparent());for(let o=0;o<30;o++){const s=r[o%r.length];e.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(o)} { color: ${s}; }`)}});function yR(i){return i.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class as{get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,n,r){this.oldPosition=e,this.oldText=t,this.newPosition=n,this.newText=r}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${yR(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${yR(this.oldText)}")`:`(replace@${this.oldPosition} "${yR(this.oldText)}" with "${yR(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,n){const r=t.length;Nd(e,r,n),n+=4;for(let o=0;oi.length)return!1;if(t){if(!pq(i,e))return!1;if(e.length===i.length)return!0;let o=e.length;return e.charAt(e.length-1)===n&&o--,i.charAt(o)===n}return e.charAt(e.length-1)!==n&&(e+=n),i.indexOf(e)===0}function Xve(i){return i>=65&&i<=90||i>=97&&i<=122}function vze(i,e=Rs){return e?Xve(i.charCodeAt(0))&&i.charCodeAt(1)===58:!1}function Gh(i){return FA(i,!0)}class _ze{constructor(e){this._ignorePathCasing=e}compare(e,t,n=!1){return e===t?0:LD(this.getComparisonKey(e,n),this.getComparisonKey(t,n))}isEqual(e,t,n=!1){return e===t?!0:!e||!t?!1:this.getComparisonKey(e,n)===this.getComparisonKey(t,n)}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,n=!1){if(e.scheme===t.scheme){if(e.scheme===an.file)return UH(Gh(e),Gh(t),this._ignorePathCasing(e))&&e.query===t.query&&(n||e.fragment===t.fragment);if(jre(e.authority,t.authority))return UH(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(n||e.fragment===t.fragment)}return!1}joinPath(e,...t){return At.joinPath(e,...t)}basenameOrAuthority(e){return su(e)||e.authority}basename(e){return oo.basename(e.path)}extname(e){return oo.extname(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===an.file?t=At.file(Lpe(Gh(e))).path:(t=oo.dirname(e.path),e.authority&&t.length&&t.charCodeAt(0)!==47&&(console.error(`dirname("${e.toString})) resulted in a relative path`),t="/")),e.with({path:t})}normalizePath(e){if(!e.path.length)return e;let t;return e.scheme===an.file?t=At.file(xpe(Gh(e))).path:t=oo.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!jre(e.authority,t.authority))return;if(e.scheme===an.file){const o=m5e(Gh(e),Gh(t));return Rs?qve(o):o}let n=e.path||"/";const r=t.path||"/";if(this._ignorePathCasing(e)){let o=0;for(const s=Math.min(n.length,r.length);ozre(n).length&&n[n.length-1]===t}else{const n=e.path;return n.length>1&&n.charCodeAt(n.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=eh){return Kre(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=eh){let n=!1;if(e.scheme===an.file){const r=Gh(e);n=r!==void 0&&r.length===zre(r).length&&r[r.length-1]===t}else{t="/";const r=e.path;n=r.length===1&&r.charCodeAt(r.length-1)===47}return!n&&!Kre(e,t)?e.with({path:e.path+"/"}):e}}const Ui=new _ze(()=>!1),hX=Ui.isEqual.bind(Ui);Ui.isEqualOrParent.bind(Ui);Ui.getComparisonKey.bind(Ui);const bze=Ui.basenameOrAuthority.bind(Ui),su=Ui.basename.bind(Ui),Cze=Ui.extname.bind(Ui),z4=Ui.dirname.bind(Ui),yze=Ui.joinPath.bind(Ui),wze=Ui.normalizePath.bind(Ui),Sze=Ui.relativePath.bind(Ui),Ure=Ui.resolvePath.bind(Ui);Ui.isAbsolutePath.bind(Ui);const jre=Ui.isEqualAuthority.bind(Ui),Kre=Ui.hasTrailingPathSeparator.bind(Ui);Ui.removeTrailingPathSeparator.bind(Ui);Ui.addTrailingPathSeparator.bind(Ui);var Zv;(function(i){i.META_DATA_LABEL="label",i.META_DATA_DESCRIPTION="description",i.META_DATA_SIZE="size",i.META_DATA_MIME="mime";function e(t){const n=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach(s=>{const[a,l]=s.split(":");a&&l&&n.set(a,l)});const o=t.path.substring(0,t.path.indexOf(";"));return o&&n.set(i.META_DATA_MIME,o),n}i.parseMetaData=e})(Zv||(Zv={}));function QC(i){return i.toString()}class Po{static create(e,t){const n=e.getAlternativeVersionId(),r=jH(e);return new Po(n,n,r,r,t,t,[])}constructor(e,t,n,r,o,s,a){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=n,this.afterEOL=r,this.beforeCursorState=o,this.afterCursorState=s,this.changes=a}append(e,t,n,r,o){t.length>0&&(this.changes=pze(this.changes,t)),this.afterEOL=n,this.afterVersionId=r,this.afterCursorState=o}static _writeSelectionsSize(e){return 4+4*4*(e?e.length:0)}static _writeSelections(e,t,n){if(Nd(e,t?t.length:0,n),n+=4,t)for(const r of t)Nd(e,r.selectionStartLineNumber,n),n+=4,Nd(e,r.selectionStartColumn,n),n+=4,Nd(e,r.positionLineNumber,n),n+=4,Nd(e,r.positionColumn,n),n+=4;return n}static _readSelections(e,t,n){const r=Td(e,t);t+=4;for(let o=0;ot.toString()).join(", ")}matchesResource(e){return(At.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 Po}append(e,t,n,r,o){this._data instanceof Po&&this._data.append(e,t,n,r,o)}close(){this._data instanceof Po&&(this._data=this._data.serialize())}open(){this._data instanceof Po||(this._data=Po.deserialize(this._data))}undo(){if(At.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Po&&(this._data=this._data.serialize());const e=Po.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(At.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Po&&(this._data=this._data.serialize());const e=Po.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof Po&&(this._data=this._data.serialize()),this._data.byteLength+168}}class xze{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,n){this.label=e,this.code=t,this.type=1,this._isOpen=!0,this._editStackElementsArr=n.slice(0),this._editStackElementsMap=new Map;for(const r of this._editStackElementsArr){const o=QC(r.resource);this._editStackElementsMap.set(o,r)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=QC(e);return this._editStackElementsMap.has(t)}setModel(e){const t=QC(At.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=QC(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,n,r,o){const s=QC(e.uri);this._editStackElementsMap.get(s).append(e,t,n,r,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=QC(e);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).heapSize():0}split(){return this._editStackElementsArr}toString(){const e=[];for(const t of this._editStackElementsArr)e.push(`${su(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function jH(i){return i.getEOL()===` +`?0:1}function Pg(i){return i?i instanceof Yve||i instanceof xze:!1}class fX{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Pg(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Pg(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const n=this._undoRedoService.getLastElement(this._model.uri);if(Pg(n)&&n.canAppend(this._model))return n;const r=new Yve(w("edit","Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(r,t),r}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],jH(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,n,r){const o=this._getOrCreateEditStackElement(e,r),s=this._model.applyEdits(t,!0),a=fX._computeCursorState(n,s),l=s.map((c,u)=>({index:u,textChange:c.textChange}));return l.sort((c,u)=>c.textChange.oldPosition===u.textChange.oldPosition?c.index-u.index:c.textChange.oldPosition-u.textChange.oldPosition),o.append(this._model,l.map(c=>c.textChange),jH(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(n){return en(n),null}}}class Lze{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function Eze(i,e,t,n,r){r.spacesDiff=0,r.looksLikeAlignment=!1;let o;for(o=0;o0&&a>0||l>0&&c>0)return;const u=Math.abs(a-c),d=Math.abs(s-l);if(u===0){r.spacesDiff=d,d>0&&0<=l-1&&l-10?r++:S>1&&o++,Eze(s,a,v,y,d),d.looksLikeAlignment&&!(t&&e===d.spacesDiff)))continue;const E=d.spacesDiff;E<=c&&u[E]++,s=v,a=y}let h=t;r!==o&&(h=r{const v=u[p];v>g&&(g=v,f=p)}),f===4&&u[4]>0&&u[2]>0&&u[2]>=u[4]/2&&(f=2)}return{insertSpaces:h,tabSize:f}}function Ua(i){return(i.metadata&1)>>>0}function $i(i,e){i.metadata=i.metadata&254|e<<0}function ms(i){return(i.metadata&2)>>>1===1}function Mi(i,e){i.metadata=i.metadata&253|(e?1:0)<<1}function Zve(i){return(i.metadata&4)>>>2===1}function qre(i,e){i.metadata=i.metadata&251|(e?1:0)<<2}function Qve(i){return(i.metadata&64)>>>6===1}function Xre(i,e){i.metadata=i.metadata&191|(e?1:0)<<6}function Dze(i){return(i.metadata&24)>>>3}function Yre(i,e){i.metadata=i.metadata&231|e<<3}function Ize(i){return(i.metadata&32)>>>5===1}function Zre(i,e){i.metadata=i.metadata&223|(e?1:0)<<5}class Jve{constructor(e,t,n){this.metadata=0,this.parent=this,this.left=this,this.right=this,$i(this,1),this.start=t,this.end=n,this.delta=0,this.maxEnd=n,this.id=e,this.ownerId=0,this.options=null,qre(this,!1),Xre(this,!1),Yre(this,1),Zre(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=n,this.range=null,Mi(this,!1)}reset(e,t,n,r){this.start=t,this.end=n,this.maxEnd=n,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=n,this.range=r}setOptions(e){this.options=e;const t=this.options.className;qre(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),Xre(this,this.options.glyphMarginClassName!==null),Yre(this,this.options.stickiness),Zre(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,n){this.cachedVersionId!==n&&(this.range=null),this.cachedVersionId=n,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}const _n=new Jve(null,0,0);_n.parent=_n;_n.left=_n;_n.right=_n;$i(_n,0);class $6{constructor(){this.root=_n,this.requestNormalizeDelta=!1}intervalSearch(e,t,n,r,o,s){return this.root===_n?[]:Oze(this,e,t,n,r,o,s)}search(e,t,n,r){return this.root===_n?[]:Pze(this,e,t,n,r)}collectNodesFromOwner(e){return Mze(this,e)}collectNodesPostOrder(){return Aze(this)}insert(e){Qre(this,e),this._normalizeDeltaIfNecessary()}delete(e){Jre(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const n=e;let r=0;for(;e!==this.root;)e===e.parent.right&&(r+=e.parent.delta),e=e.parent;const o=n.start+r,s=n.end+r;n.setCachedOffsets(o,s,t)}acceptReplace(e,t,n,r){const o=Nze(this,e,e+t);for(let s=0,a=o.length;st||n===1?!1:n===2?!0:e}function Tze(i,e,t,n,r){const o=Dze(i),s=o===0||o===2,a=o===1||o===2,l=t-e,c=n,u=Math.min(l,c),d=i.start;let h=!1;const f=i.end;let g=!1;e<=d&&f<=t&&Ize(i)&&(i.start=e,h=!0,i.end=e,g=!0);{const v=r?1:l>0?2:0;!h&&JC(d,s,e,v)&&(h=!0),!g&&JC(f,a,e,v)&&(g=!0)}if(u>0&&!r){const v=l>c?2:0;!h&&JC(d,s,e+u,v)&&(h=!0),!g&&JC(f,a,e+u,v)&&(g=!0)}{const v=r?1:0;!h&&JC(d,s,t,v)&&(i.start=e+c,h=!0),!g&&JC(f,a,t,v)&&(i.end=e+c,g=!0)}const p=c-l;h||(i.start=Math.max(0,d+p)),g||(i.end=Math.max(0,f+p)),i.start>i.end&&(i.end=i.start)}function Nze(i,e,t){let n=i.root,r=0,o=0,s=0,a=0;const l=[];let c=0;for(;n!==_n;){if(ms(n)){Mi(n.left,!1),Mi(n.right,!1),n===n.parent.right&&(r-=n.parent.delta),n=n.parent;continue}if(!ms(n.left)){if(o=r+n.maxEnd,ot){Mi(n,!0);continue}if(a=r+n.end,a>=e&&(n.setCachedOffsets(s,a,0),l[c++]=n),Mi(n,!0),n.right!==_n&&!ms(n.right)){r+=n.delta,n=n.right;continue}}return Mi(i.root,!1),l}function Rze(i,e,t,n){let r=i.root,o=0,s=0,a=0;const l=n-(t-e);for(;r!==_n;){if(ms(r)){Mi(r.left,!1),Mi(r.right,!1),r===r.parent.right&&(o-=r.parent.delta),Qv(r),r=r.parent;continue}if(!ms(r.left)){if(s=o+r.maxEnd,st){r.start+=l,r.end+=l,r.delta+=l,(r.delta<-1073741824||r.delta>1073741824)&&(i.requestNormalizeDelta=!0),Mi(r,!0);continue}if(Mi(r,!0),r.right!==_n&&!ms(r.right)){o+=r.delta,r=r.right;continue}}Mi(i.root,!1)}function Mze(i,e){let t=i.root;const n=[];let r=0;for(;t!==_n;){if(ms(t)){Mi(t.left,!1),Mi(t.right,!1),t=t.parent;continue}if(t.left!==_n&&!ms(t.left)){t=t.left;continue}if(t.ownerId===e&&(n[r++]=t),Mi(t,!0),t.right!==_n&&!ms(t.right)){t=t.right;continue}}return Mi(i.root,!1),n}function Aze(i){let e=i.root;const t=[];let n=0;for(;e!==_n;){if(ms(e)){Mi(e.left,!1),Mi(e.right,!1),e=e.parent;continue}if(e.left!==_n&&!ms(e.left)){e=e.left;continue}if(e.right!==_n&&!ms(e.right)){e=e.right;continue}t[n++]=e,Mi(e,!0)}return Mi(i.root,!1),t}function Pze(i,e,t,n,r){let o=i.root,s=0,a=0,l=0;const c=[];let u=0;for(;o!==_n;){if(ms(o)){Mi(o.left,!1),Mi(o.right,!1),o===o.parent.right&&(s-=o.parent.delta),o=o.parent;continue}if(o.left!==_n&&!ms(o.left)){o=o.left;continue}a=s+o.start,l=s+o.end,o.setCachedOffsets(a,l,n);let d=!0;if(e&&o.ownerId&&o.ownerId!==e&&(d=!1),t&&Zve(o)&&(d=!1),r&&!Qve(o)&&(d=!1),d&&(c[u++]=o),Mi(o,!0),o.right!==_n&&!ms(o.right)){s+=o.delta,o=o.right;continue}}return Mi(i.root,!1),c}function Oze(i,e,t,n,r,o,s){let a=i.root,l=0,c=0,u=0,d=0;const h=[];let f=0;for(;a!==_n;){if(ms(a)){Mi(a.left,!1),Mi(a.right,!1),a===a.parent.right&&(l-=a.parent.delta),a=a.parent;continue}if(!ms(a.left)){if(c=l+a.maxEnd,ct){Mi(a,!0);continue}if(d=l+a.end,d>=e){a.setCachedOffsets(u,d,o);let g=!0;n&&a.ownerId&&a.ownerId!==n&&(g=!1),r&&Zve(a)&&(g=!1),s&&!Qve(a)&&(g=!1),g&&(h[f++]=a)}if(Mi(a,!0),a.right!==_n&&!ms(a.right)){l+=a.delta,a=a.right;continue}}return Mi(i.root,!1),h}function Qre(i,e){if(i.root===_n)return e.parent=_n,e.left=_n,e.right=_n,$i(e,0),i.root=e,i.root;Fze(i,e),Cm(e.parent);let t=e;for(;t!==i.root&&Ua(t.parent)===1;)if(t.parent===t.parent.parent.left){const n=t.parent.parent.right;Ua(n)===1?($i(t.parent,0),$i(n,0),$i(t.parent.parent,1),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,bE(i,t)),$i(t.parent,0),$i(t.parent.parent,1),CE(i,t.parent.parent))}else{const n=t.parent.parent.left;Ua(n)===1?($i(t.parent,0),$i(n,0),$i(t.parent.parent,1),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,CE(i,t)),$i(t.parent,0),$i(t.parent.parent,1),bE(i,t.parent.parent))}return $i(i.root,0),e}function Fze(i,e){let t=0,n=i.root;const r=e.start,o=e.end;for(;;)if(Wze(r,o,n.start+t,n.end+t)<0)if(n.left===_n){e.start-=t,e.end-=t,e.maxEnd-=t,n.left=e;break}else n=n.left;else if(n.right===_n){e.start-=t+n.delta,e.end-=t+n.delta,e.maxEnd-=t+n.delta,n.right=e;break}else t+=n.delta,n=n.right;e.parent=n,e.left=_n,e.right=_n,$i(e,1)}function Jre(i,e){let t,n;if(e.left===_n?(t=e.right,n=e,t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(i.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===_n?(t=e.left,n=e):(n=Bze(e.right),t=n.right,t.start+=n.delta,t.end+=n.delta,t.delta+=n.delta,(t.delta<-1073741824||t.delta>1073741824)&&(i.requestNormalizeDelta=!0),n.start+=e.delta,n.end+=e.delta,n.delta=e.delta,(n.delta<-1073741824||n.delta>1073741824)&&(i.requestNormalizeDelta=!0)),n===i.root){i.root=t,$i(t,0),e.detach(),H6(),Qv(t),i.root.parent=_n;return}const r=Ua(n)===1;if(n===n.parent.left?n.parent.left=t:n.parent.right=t,n===e?t.parent=n.parent:(n.parent===e?t.parent=n:t.parent=n.parent,n.left=e.left,n.right=e.right,n.parent=e.parent,$i(n,Ua(e)),e===i.root?i.root=n:e===e.parent.left?e.parent.left=n:e.parent.right=n,n.left!==_n&&(n.left.parent=n),n.right!==_n&&(n.right.parent=n)),e.detach(),r){Cm(t.parent),n!==e&&(Cm(n),Cm(n.parent)),H6();return}Cm(t),Cm(t.parent),n!==e&&(Cm(n),Cm(n.parent));let o;for(;t!==i.root&&Ua(t)===0;)t===t.parent.left?(o=t.parent.right,Ua(o)===1&&($i(o,0),$i(t.parent,1),bE(i,t.parent),o=t.parent.right),Ua(o.left)===0&&Ua(o.right)===0?($i(o,1),t=t.parent):(Ua(o.right)===0&&($i(o.left,0),$i(o,1),CE(i,o),o=t.parent.right),$i(o,Ua(t.parent)),$i(t.parent,0),$i(o.right,0),bE(i,t.parent),t=i.root)):(o=t.parent.left,Ua(o)===1&&($i(o,0),$i(t.parent,1),CE(i,t.parent),o=t.parent.left),Ua(o.left)===0&&Ua(o.right)===0?($i(o,1),t=t.parent):(Ua(o.left)===0&&($i(o.right,0),$i(o,1),bE(i,o),o=t.parent.left),$i(o,Ua(t.parent)),$i(t.parent,0),$i(o.left,0),CE(i,t.parent),t=i.root));$i(t,0),H6()}function Bze(i){for(;i.left!==_n;)i=i.left;return i}function H6(){_n.parent=_n,_n.delta=0,_n.start=0,_n.end=0}function bE(i,e){const t=e.right;t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(i.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==_n&&(t.left.parent=e),t.parent=e.parent,e.parent===_n?i.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,Qv(e),Qv(t)}function CE(i,e){const t=e.left;e.delta-=t.delta,(e.delta<-1073741824||e.delta>1073741824)&&(i.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==_n&&(t.right.parent=e),t.parent=e.parent,e.parent===_n?i.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,Qv(e),Qv(t)}function e_e(i){let e=i.end;if(i.left!==_n){const t=i.left.maxEnd;t>e&&(e=t)}if(i.right!==_n){const t=i.right.maxEnd+i.delta;t>e&&(e=t)}return e}function Qv(i){i.maxEnd=e_e(i)}function Cm(i){for(;i!==_n;){const e=e_e(i);if(i.maxEnd===e)return;i.maxEnd=e,i=i.parent}}function Wze(i,e,t,n){return i===t?e-n:i-t}class KH{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!==rn)return gX(this.right);let e=this;for(;e.parent!==rn&&e.parent.left!==e;)e=e.parent;return e.parent===rn?rn:e.parent}prev(){if(this.left!==rn)return t_e(this.left);let e=this;for(;e.parent!==rn&&e.parent.right!==e;)e=e.parent;return e.parent===rn?rn:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const rn=new KH(null,0);rn.parent=rn;rn.left=rn;rn.right=rn;rn.color=0;function gX(i){for(;i.left!==rn;)i=i.left;return i}function t_e(i){for(;i.right!==rn;)i=i.right;return i}function pX(i){return i===rn?0:i.size_left+i.piece.length+pX(i.right)}function mX(i){return i===rn?0:i.lf_left+i.piece.lineFeedCnt+mX(i.right)}function V6(){rn.parent=rn}function yE(i,e){const t=e.right;t.size_left+=e.size_left+(e.piece?e.piece.length:0),t.lf_left+=e.lf_left+(e.piece?e.piece.lineFeedCnt:0),e.right=t.left,t.left!==rn&&(t.left.parent=e),t.parent=e.parent,e.parent===rn?i.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function wE(i,e){const t=e.left;e.left=t.right,t.right!==rn&&(t.right.parent=e),t.parent=e.parent,e.size_left-=t.size_left+(t.piece?t.piece.length:0),e.lf_left-=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),e.parent===rn?i.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function wR(i,e){let t,n;if(e.left===rn?(n=e,t=n.right):e.right===rn?(n=e,t=n.left):(n=gX(e.right),t=n.right),n===i.root){i.root=t,t.color=0,e.detach(),V6(),i.root.parent=rn;return}const r=n.color===1;if(n===n.parent.left?n.parent.left=t:n.parent.right=t,n===e?(t.parent=n.parent,ML(i,t)):(n.parent===e?t.parent=n:t.parent=n.parent,ML(i,t),n.left=e.left,n.right=e.right,n.parent=e.parent,n.color=e.color,e===i.root?i.root=n:e===e.parent.left?e.parent.left=n:e.parent.right=n,n.left!==rn&&(n.left.parent=n),n.right!==rn&&(n.right.parent=n),n.size_left=e.size_left,n.lf_left=e.lf_left,ML(i,n)),e.detach(),t.parent.left===t){const s=pX(t),a=mX(t);if(s!==t.parent.size_left||a!==t.parent.lf_left){const l=s-t.parent.size_left,c=a-t.parent.lf_left;t.parent.size_left=s,t.parent.lf_left=a,xg(i,t.parent,l,c)}}if(ML(i,t.parent),r){V6();return}let o;for(;t!==i.root&&t.color===0;)t===t.parent.left?(o=t.parent.right,o.color===1&&(o.color=0,t.parent.color=1,yE(i,t.parent),o=t.parent.right),o.left.color===0&&o.right.color===0?(o.color=1,t=t.parent):(o.right.color===0&&(o.left.color=0,o.color=1,wE(i,o),o=t.parent.right),o.color=t.parent.color,t.parent.color=0,o.right.color=0,yE(i,t.parent),t=i.root)):(o=t.parent.left,o.color===1&&(o.color=0,t.parent.color=1,wE(i,t.parent),o=t.parent.left),o.left.color===0&&o.right.color===0?(o.color=1,t=t.parent):(o.left.color===0&&(o.right.color=0,o.color=1,yE(i,o),o=t.parent.left),o.color=t.parent.color,t.parent.color=0,o.left.color=0,wE(i,t.parent),t=i.root));t.color=0,V6()}function eoe(i,e){for(ML(i,e);e!==i.root&&e.parent.color===1;)if(e.parent===e.parent.parent.left){const t=e.parent.parent.right;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.right&&(e=e.parent,yE(i,e)),e.parent.color=0,e.parent.parent.color=1,wE(i,e.parent.parent))}else{const t=e.parent.parent.left;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.left&&(e=e.parent,wE(i,e)),e.parent.color=0,e.parent.parent.color=1,yE(i,e.parent.parent))}i.root.color=0}function xg(i,e,t,n){for(;e!==i.root&&e!==rn;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=n),e=e.parent}function ML(i,e){let t=0,n=0;if(e!==i.root){for(;e!==i.root&&e===e.parent.right;)e=e.parent;if(e!==i.root)for(e=e.parent,t=pX(e.left)-e.size_left,n=mX(e.left)-e.lf_left,e.size_left+=t,e.lf_left+=n;e!==i.root&&(t!==0||n!==0);)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=n),e=e.parent}}const pg=65535;function n_e(i){let e;return i[i.length-1]<65536?e=new Uint16Array(i.length):e=new Uint32Array(i.length),e.set(i,0),e}class $ze{constructor(e,t,n,r,o){this.lineStarts=e,this.cr=t,this.lf=n,this.crlf=r,this.isBasicASCII=o}}function Dg(i,e=!0){const t=[0];let n=1;for(let r=0,o=i.length;r126)&&(s=!1)}const a=new $ze(n_e(i),n,r,o,s);return i.length=0,a}class gl{constructor(e,t,n,r,o){this.bufferIndex=e,this.start=t,this.end=n,this.lineFeedCnt=r,this.length=o}}class I0{constructor(e,t){this.buffer=e,this.lineStarts=t}}class Vze{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==rn&&e.iterate(e.root,n=>(n!==rn&&this._pieces.push(n.piece),!0))}read(){return this._pieces.length===0?this._index===0?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:this._index===0?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class zze{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){const n=this._cache[t];if(n.nodeStartOffset<=e&&n.nodeStartOffset+n.node.piece.length>=e)return n}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){const n=this._cache[t];if(n.nodeStartLineNumber&&n.nodeStartLineNumber=e)return n}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1;const n=this._cache;for(let r=0;r=e){n[r]=null,t=!0;continue}}if(t){const r=[];for(const o of n)o!==null&&r.push(o);this._cache=r}}}class Uze{constructor(e,t,n){this.create(e,t,n)}create(e,t,n){this._buffers=[new I0("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=rn,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=n;let r=null;for(let o=0,s=e.length;o0){e[o].lineStarts||(e[o].lineStarts=Dg(e[o].buffer));const a=new gl(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]),r=this.rbInsertRight(r,a)}this._searchCache=new zze(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=pg,n=t-Math.floor(t/3),r=n*2;let o="",s=0;const a=[];if(this.iterate(this.root,l=>{const c=this.getNodeContent(l),u=c.length;if(s<=n||s+u0){const l=o.replace(/\r\n|\r|\n/g,e);a.push(new I0(l,Dg(l)))}this.create(a,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new Vze(this,e)}getOffsetAt(e,t){let n=0,r=this.root;for(;r!==rn;)if(r.left!==rn&&r.lf_left+1>=e)r=r.left;else if(r.lf_left+r.piece.lineFeedCnt+1>=e){n+=r.size_left;const o=this.getAccumulatedValue(r,e-r.lf_left-2);return n+=o+t-1}else e-=r.lf_left+r.piece.lineFeedCnt,n+=r.size_left+r.piece.length,r=r.right;return n}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,n=0;const r=e;for(;t!==rn;)if(t.size_left!==0&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){const o=this.getIndexOf(t,e-t.size_left);if(n+=t.lf_left+o.index,o.index===0){const s=this.getOffsetAt(n+1,1),a=r-s;return new ae(n+1,a+1)}return new ae(n+1,o.remainder+1)}else if(e-=t.size_left+t.piece.length,n+=t.lf_left+t.piece.lineFeedCnt,t.right===rn){const o=this.getOffsetAt(n+1,1),s=r-e-o;return new ae(n+1,s+1)}else t=t.right;return new ae(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";const n=this.nodeAt2(e.startLineNumber,e.startColumn),r=this.nodeAt2(e.endLineNumber,e.endColumn),o=this.getValueInRange2(n,r);return t?t!==this._EOL||!this._EOLNormalized?o.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?o:o.replace(/\r\n|\r|\n/g,t):o}getValueInRange2(e,t){if(e.node===t.node){const a=e.node,l=this._buffers[a.piece.bufferIndex].buffer,c=this.offsetInBuffer(a.piece.bufferIndex,a.piece.start);return l.substring(c+e.remainder,c+t.remainder)}let n=e.node;const r=this._buffers[n.piece.bufferIndex].buffer,o=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);let s=r.substring(o+e.remainder,o+n.piece.length);for(n=n.next();n!==rn;){const a=this._buffers[n.piece.bufferIndex].buffer,l=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);if(n===t.node){s+=a.substring(l,l+t.remainder);break}else s+=a.substr(l,n.piece.length);n=n.next()}return s}getLinesContent(){const e=[];let t=0,n="",r=!1;return this.iterate(this.root,o=>{if(o===rn)return!0;const s=o.piece;let a=s.length;if(a===0)return!0;const l=this._buffers[s.bufferIndex].buffer,c=this._buffers[s.bufferIndex].lineStarts,u=s.start.line,d=s.end.line;let h=c[u]+s.start.column;if(r&&(l.charCodeAt(h)===10&&(h++,a--),e[t++]=n,n="",r=!1,a===0))return!0;if(u===d)return!this._EOLNormalized&&l.charCodeAt(h+a-1)===13?(r=!0,n+=l.substr(h,a-1)):n+=l.substr(h,a),!0;n+=this._EOLNormalized?l.substring(h,Math.max(h,c[u+1]-this._EOLLength)):l.substring(h,c[u+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=n;for(let f=u+1;fS+g,t.reset(0)):(_=h.buffer,y=S=>S,t.reset(g));do if(v=t.next(_),v){if(y(v.index)>=p)return u;this.positionInBuffer(e,y(v.index)-f,m);const S=this.getLineFeedCnt(e.piece.bufferIndex,o,m),L=m.line===o.line?m.column-o.column+r:m.column+1,E=L+v[0].length;if(d[u++]=w0(new B(n+S,L,n+S,E),v,l),y(v.index)+v[0].length>=p||u>=c)return u}while(v);return u}findMatchesLineByLine(e,t,n,r){const o=[];let s=0;const a=new iy(t.wordSeparators,t.regex);let l=this.nodeAt2(e.startLineNumber,e.startColumn);if(l===null)return[];const c=this.nodeAt2(e.endLineNumber,e.endColumn);if(c===null)return[];let u=this.positionInBuffer(l.node,l.remainder);const d=this.positionInBuffer(c.node,c.remainder);if(l.node===c.node)return this.findMatchesInNode(l.node,a,e.startLineNumber,e.startColumn,u,d,t,n,r,s,o),o;let h=e.startLineNumber,f=l.node;for(;f!==c.node;){const p=this.getLineFeedCnt(f.piece.bufferIndex,u,f.piece.end);if(p>=1){const m=this._buffers[f.piece.bufferIndex].lineStarts,_=this.offsetInBuffer(f.piece.bufferIndex,f.piece.start),y=m[u.line+p],S=h===e.startLineNumber?e.startColumn:1;if(s=this.findMatchesInNode(f,a,h,S,u,this.positionInBuffer(f,y-_),t,n,r,s,o),s>=r)return o;h+=p}const v=h===e.startLineNumber?e.startColumn-1:0;if(h===e.endLineNumber){const m=this.getLineContent(h).substring(v,e.endColumn-1);return s=this._findMatchesInLine(t,a,m,e.endLineNumber,v,s,o,n,r),o}if(s=this._findMatchesInLine(t,a,this.getLineContent(h).substr(v),h,v,s,o,n,r),s>=r)return o;h++,l=this.nodeAt2(h,1),f=l.node,u=this.positionInBuffer(l.node,l.remainder)}if(h===e.endLineNumber){const p=h===e.startLineNumber?e.startColumn-1:0,v=this.getLineContent(h).substring(p,e.endColumn-1);return s=this._findMatchesInLine(t,a,v,e.endLineNumber,p,s,o,n,r),o}const g=h===e.startLineNumber?e.startColumn:1;return s=this.findMatchesInNode(c.node,a,h,g,u,d,t,n,r,s,o),o}_findMatchesInLine(e,t,n,r,o,s,a,l,c){const u=e.wordSeparators;if(!l&&e.simpleSearch){const h=e.simpleSearch,f=h.length,g=n.length;let p=-f;for(;(p=n.indexOf(h,p+f))!==-1;)if((!u||Pq(u,n,g,p,f))&&(a[s++]=new ND(new B(r,p+1+o,r,p+1+f+o),null),s>=c))return s;return s}let d;t.reset(0);do if(d=t.next(n),d&&(a[s++]=w0(new B(r,d.index+1+o,r,d.index+1+d[0].length+o),d,l),s>=c))return s;while(d);return s}insert(e,t,n=!1){if(this._EOLNormalized=this._EOLNormalized&&n,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==rn){const{node:r,remainder:o,nodeStartOffset:s}=this.nodeAt(e),a=r.piece,l=a.bufferIndex,c=this.positionInBuffer(r,o);if(r.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&s+a.length===e&&t.lengthe){const u=[];let d=new gl(a.bufferIndex,c,a.end,this.getLineFeedCnt(a.bufferIndex,c,a.end),this.offsetInBuffer(l,a.end)-this.offsetInBuffer(l,c));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&this.nodeCharCodeAt(r,o)===10){const p={line:d.start.line+1,column:0};d=new gl(d.bufferIndex,p,d.end,this.getLineFeedCnt(d.bufferIndex,p,d.end),d.length-1),t+=` `}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(r,o-1)===13){const p=this.positionInBuffer(r,o-1);this.deleteNodeTail(r,p),t="\r"+t,r.piece.length===0&&u.push(r)}else this.deleteNodeTail(r,c);else this.deleteNodeTail(r,c);const h=this.createNewPieces(t);d.length>0&&this.rbInsertRight(r,d);let f=r;for(let g=0;g=0;s--)o=this.rbInsertLeft(o,r[s]);this.validateCRLFWithPrevNode(o),this.deleteNodes(n)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=` -`);const n=this.createNewPieces(e),r=this.rbInsertRight(t,n[0]);let o=r;for(let s=1;s=h)c=d+1;else break;return n?(n.line=d,n.column=l-f,null):{line:d,column:l-f}}getLineFeedCnt(e,t,n){if(n.column===0)return n.line-t.line;const r=this._buffers[e].lineStarts;if(n.line===r.length-1)return n.line-t.line;const o=r[n.line+1],s=r[n.line]+n.column;if(o>s+1)return n.line-t.line;const a=s-1;return this._buffers[e].buffer.charCodeAt(a)===13?n.line-t.line+1:n.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;tpg){const u=[];for(;e.length>pg;){const h=e.charCodeAt(pg-1);let f;h===13||h>=55296&&h<=56319?(f=e.substring(0,pg-1),e=e.substring(pg-1)):(f=e.substring(0,pg),e=e.substring(pg));const g=Dg(f);u.push(new gl(this._buffers.length,{line:0,column:0},{line:g.length-1,column:f.length-g[g.length-1]},g.length-1,f.length)),this._buffers.push(new k0(f,g))}const d=Dg(e);return u.push(new gl(this._buffers.length,{line:0,column:0},{line:d.length-1,column:e.length-d[d.length-1]},d.length-1,e.length)),this._buffers.push(new k0(e,d)),u}let t=this._buffers[0].buffer.length;const n=Dg(e,!1);let r=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&t!==0&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},r=this._lastChangeBufferPos;for(let u=0;u=e-1)n=n.left;else if(n.lf_left+n.piece.lineFeedCnt>e-1){const l=this.getAccumulatedValue(n,e-n.lf_left-2),c=this.getAccumulatedValue(n,e-n.lf_left-1),u=this._buffers[n.piece.bufferIndex].buffer,d=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return s+=n.size_left,this._searchCache.set({node:n,nodeStartOffset:s,nodeStartLineNumber:a-(e-1-n.lf_left)}),u.substring(d+l,d+c-t)}else if(n.lf_left+n.piece.lineFeedCnt===e-1){const l=this.getAccumulatedValue(n,e-n.lf_left-2),c=this._buffers[n.piece.bufferIndex].buffer,u=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);r=c.substring(u+l,u+n.piece.length);break}else e-=n.lf_left+n.piece.lineFeedCnt,s+=n.size_left+n.piece.length,n=n.right}for(n=n.next();n!==rn;){const s=this._buffers[n.piece.bufferIndex].buffer;if(n.piece.lineFeedCnt>0){const a=this.getAccumulatedValue(n,0),l=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return r+=s.substring(l,l+a-t),r}else{const a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);r+=s.substr(a,n.piece.length)}n=n.next()}return r}computeBufferMetadata(){let e=this.root,t=1,n=0;for(;e!==rn;)t+=e.lf_left+e.piece.lineFeedCnt,n+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=n,this._searchCache.validate(this._length)}getIndexOf(e,t){const n=e.piece,r=this.positionInBuffer(e,t),o=r.line-n.start.line;if(this.offsetInBuffer(n.bufferIndex,n.end)-this.offsetInBuffer(n.bufferIndex,n.start)===t){const s=this.getLineFeedCnt(e.piece.bufferIndex,n.start,r);if(s!==o)return{index:s,remainder:0}}return{index:o,remainder:r.column}}getAccumulatedValue(e,t){if(t<0)return 0;const n=e.piece,r=this._buffers[n.bufferIndex].lineStarts,o=n.start.line+t+1;return o>n.end.line?r[n.end.line]+n.end.column-r[n.start.line]-n.start.column:r[o]-r[n.start.line]-n.start.column}deleteNodeTail(e,t){const n=e.piece,r=n.lineFeedCnt,o=this.offsetInBuffer(n.bufferIndex,n.end),s=t,a=this.offsetInBuffer(n.bufferIndex,s),l=this.getLineFeedCnt(n.bufferIndex,n.start,s),c=l-r,u=a-o,d=n.length+u;e.piece=new gl(n.bufferIndex,n.start,s,l,d),xg(this,e,u,c)}deleteNodeHead(e,t){const n=e.piece,r=n.lineFeedCnt,o=this.offsetInBuffer(n.bufferIndex,n.start),s=t,a=this.getLineFeedCnt(n.bufferIndex,s,n.end),l=this.offsetInBuffer(n.bufferIndex,s),c=a-r,u=o-l,d=n.length+u;e.piece=new gl(n.bufferIndex,s,n.end,a,d),xg(this,e,u,c)}shrinkNode(e,t,n){const r=e.piece,o=r.start,s=r.end,a=r.length,l=r.lineFeedCnt,c=t,u=this.getLineFeedCnt(r.bufferIndex,r.start,c),d=this.offsetInBuffer(r.bufferIndex,t)-this.offsetInBuffer(r.bufferIndex,o);e.piece=new gl(r.bufferIndex,r.start,c,u,d),xg(this,e,d-a,u-l);const h=new gl(r.bufferIndex,n,s,this.getLineFeedCnt(r.bufferIndex,n,s),this.offsetInBuffer(r.bufferIndex,s)-this.offsetInBuffer(r.bufferIndex,n)),f=this.rbInsertRight(e,h);this.validateCRLFWithPrevNode(f)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+=` +`);const n=this.createNewPieces(e),r=this.rbInsertRight(t,n[0]);let o=r;for(let s=1;s=h)c=d+1;else break;return n?(n.line=d,n.column=l-f,null):{line:d,column:l-f}}getLineFeedCnt(e,t,n){if(n.column===0)return n.line-t.line;const r=this._buffers[e].lineStarts;if(n.line===r.length-1)return n.line-t.line;const o=r[n.line+1],s=r[n.line]+n.column;if(o>s+1)return n.line-t.line;const a=s-1;return this._buffers[e].buffer.charCodeAt(a)===13?n.line-t.line+1:n.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;tpg){const u=[];for(;e.length>pg;){const h=e.charCodeAt(pg-1);let f;h===13||h>=55296&&h<=56319?(f=e.substring(0,pg-1),e=e.substring(pg-1)):(f=e.substring(0,pg),e=e.substring(pg));const g=Dg(f);u.push(new gl(this._buffers.length,{line:0,column:0},{line:g.length-1,column:f.length-g[g.length-1]},g.length-1,f.length)),this._buffers.push(new I0(f,g))}const d=Dg(e);return u.push(new gl(this._buffers.length,{line:0,column:0},{line:d.length-1,column:e.length-d[d.length-1]},d.length-1,e.length)),this._buffers.push(new I0(e,d)),u}let t=this._buffers[0].buffer.length;const n=Dg(e,!1);let r=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&t!==0&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},r=this._lastChangeBufferPos;for(let u=0;u=e-1)n=n.left;else if(n.lf_left+n.piece.lineFeedCnt>e-1){const l=this.getAccumulatedValue(n,e-n.lf_left-2),c=this.getAccumulatedValue(n,e-n.lf_left-1),u=this._buffers[n.piece.bufferIndex].buffer,d=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return s+=n.size_left,this._searchCache.set({node:n,nodeStartOffset:s,nodeStartLineNumber:a-(e-1-n.lf_left)}),u.substring(d+l,d+c-t)}else if(n.lf_left+n.piece.lineFeedCnt===e-1){const l=this.getAccumulatedValue(n,e-n.lf_left-2),c=this._buffers[n.piece.bufferIndex].buffer,u=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);r=c.substring(u+l,u+n.piece.length);break}else e-=n.lf_left+n.piece.lineFeedCnt,s+=n.size_left+n.piece.length,n=n.right}for(n=n.next();n!==rn;){const s=this._buffers[n.piece.bufferIndex].buffer;if(n.piece.lineFeedCnt>0){const a=this.getAccumulatedValue(n,0),l=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return r+=s.substring(l,l+a-t),r}else{const a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);r+=s.substr(a,n.piece.length)}n=n.next()}return r}computeBufferMetadata(){let e=this.root,t=1,n=0;for(;e!==rn;)t+=e.lf_left+e.piece.lineFeedCnt,n+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=n,this._searchCache.validate(this._length)}getIndexOf(e,t){const n=e.piece,r=this.positionInBuffer(e,t),o=r.line-n.start.line;if(this.offsetInBuffer(n.bufferIndex,n.end)-this.offsetInBuffer(n.bufferIndex,n.start)===t){const s=this.getLineFeedCnt(e.piece.bufferIndex,n.start,r);if(s!==o)return{index:s,remainder:0}}return{index:o,remainder:r.column}}getAccumulatedValue(e,t){if(t<0)return 0;const n=e.piece,r=this._buffers[n.bufferIndex].lineStarts,o=n.start.line+t+1;return o>n.end.line?r[n.end.line]+n.end.column-r[n.start.line]-n.start.column:r[o]-r[n.start.line]-n.start.column}deleteNodeTail(e,t){const n=e.piece,r=n.lineFeedCnt,o=this.offsetInBuffer(n.bufferIndex,n.end),s=t,a=this.offsetInBuffer(n.bufferIndex,s),l=this.getLineFeedCnt(n.bufferIndex,n.start,s),c=l-r,u=a-o,d=n.length+u;e.piece=new gl(n.bufferIndex,n.start,s,l,d),xg(this,e,u,c)}deleteNodeHead(e,t){const n=e.piece,r=n.lineFeedCnt,o=this.offsetInBuffer(n.bufferIndex,n.start),s=t,a=this.getLineFeedCnt(n.bufferIndex,s,n.end),l=this.offsetInBuffer(n.bufferIndex,s),c=a-r,u=o-l,d=n.length+u;e.piece=new gl(n.bufferIndex,s,n.end,a,d),xg(this,e,u,c)}shrinkNode(e,t,n){const r=e.piece,o=r.start,s=r.end,a=r.length,l=r.lineFeedCnt,c=t,u=this.getLineFeedCnt(r.bufferIndex,r.start,c),d=this.offsetInBuffer(r.bufferIndex,t)-this.offsetInBuffer(r.bufferIndex,o);e.piece=new gl(r.bufferIndex,r.start,c,u,d),xg(this,e,d-a,u-l);const h=new gl(r.bufferIndex,n,s,this.getLineFeedCnt(r.bufferIndex,n,s),this.offsetInBuffer(r.bufferIndex,s)-this.offsetInBuffer(r.bufferIndex,n)),f=this.rbInsertRight(e,h);this.validateCRLFWithPrevNode(f)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+=` `);const n=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),r=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const o=Dg(t,!1);for(let f=0;fe)t=t.left;else if(t.size_left+t.piece.length>=e){r+=t.size_left;const o={node:t,remainder:e-t.size_left,nodeStartOffset:r};return this._searchCache.set(o),o}else e-=t.size_left+t.piece.length,r+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let n=this.root,r=0;for(;n!==rn;)if(n.left!==rn&&n.lf_left>=e-1)n=n.left;else if(n.lf_left+n.piece.lineFeedCnt>e-1){const o=this.getAccumulatedValue(n,e-n.lf_left-2),s=this.getAccumulatedValue(n,e-n.lf_left-1);return r+=n.size_left,{node:n,remainder:Math.min(o+t-1,s),nodeStartOffset:r}}else if(n.lf_left+n.piece.lineFeedCnt===e-1){const o=this.getAccumulatedValue(n,e-n.lf_left-2);if(o+t-1<=n.piece.length)return{node:n,remainder:o+t-1,nodeStartOffset:r};t-=n.piece.length-o;break}else e-=n.lf_left+n.piece.lineFeedCnt,r+=n.size_left+n.piece.length,n=n.right;for(n=n.next();n!==rn;){if(n.piece.lineFeedCnt>0){const o=this.getAccumulatedValue(n,0),s=this.offsetOfNode(n);return{node:n,remainder:Math.min(t-1,o),nodeStartOffset:s}}else if(n.piece.length>=t-1){const o=this.offsetOfNode(n);return{node:n,remainder:t-1,nodeStartOffset:o}}else t-=n.piece.length;n=n.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;const n=this._buffers[e.piece.bufferIndex],r=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return n.buffer.charCodeAt(r)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&this._EOL===` `)}startWithLF(e){if(typeof e=="string")return e.charCodeAt(0)===10;if(e===rn||e.piece.lineFeedCnt===0)return!1;const t=e.piece,n=this._buffers[t.bufferIndex].lineStarts,r=t.start.line,o=n[r]+t.start.column;return r===n.length-1||n[r+1]>o+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(o)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===rn||e.piece.lineFeedCnt===0?!1:this.nodeCharCodeAt(e,e.piece.length-1)===13}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){const t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){const n=[],r=this._buffers[e.piece.bufferIndex].lineStarts;let o;e.piece.end.column===0?o={line:e.piece.end.line-1,column:r[e.piece.end.line]-r[e.piece.end.line-1]-1}:o={line:e.piece.end.line,column:e.piece.end.column-1};const s=e.piece.length-1,a=e.piece.lineFeedCnt-1;e.piece=new gl(e.piece.bufferIndex,e.piece.start,o,a,s),xg(this,e,-1,-1),e.piece.length===0&&n.push(e);const l={line:t.piece.start.line+1,column:0},c=t.piece.length-1,u=this.getLineFeedCnt(t.piece.bufferIndex,l,t.piece.end);t.piece=new gl(t.piece.bufferIndex,l,t.piece.end,u,c),xg(this,t,-1,-1),t.piece.length===0&&n.push(t);const d=this.createNewPieces(`\r `);this.rbInsertRight(e,d[0]);for(let h=0;hv.sortIndex-m.sortIndex)}this._mightContainRTL=r,this._mightContainUnusualLineTerminators=o,this._mightContainNonBasicASCII=s;const f=this._doApplyEdits(l);let g=null;if(t&&d.length>0){d.sort((p,v)=>v.lineNumber-p.lineNumber),g=[];for(let p=0,v=d.length;p0&&d[p-1].lineNumber===m)continue;const _=d[p].oldContent,y=this.getLineContent(m);y.length===0||y===_||Ys(y)!==-1||g.push(m)}}return this._onDidChangeContent.fire(),new J6e(h,f,g)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const n=e[0].range,r=e[e.length-1].range,o=new B(n.startLineNumber,n.startColumn,r.endLineNumber,r.endColumn);let s=n.startLineNumber,a=n.startColumn;const l=[];for(let f=0,g=e.length;f0&&l.push(p.text),s=v.endLineNumber,a=v.endColumn}const c=l.join(""),[u,d,h]=Zv(c);return{sortIndex:0,identifier:e[0].identifier,range:o,rangeOffset:this.getOffsetAt(o.startLineNumber,o.startColumn),rangeLength:this.getValueLengthInRange(o,0),text:c,eolCount:u,firstLineLength:d,lastLineLength:h,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(Ky._sortOpsDescending);const t=[];for(let n=0;n0){const h=l.eolCount+1;h===1?d=new B(c,u,c,u+l.firstLineLength):d=new B(c,u,c+h-1,l.lastLineLength+1)}else d=new B(c,u,c,u);n=d.endLineNumber,r=d.endColumn,t.push(d),o=l}return t}static _sortOpsAscending(e,t){const n=B.compareRangesUsingEnds(e.range,t.range);return n===0?e.sortIndex-t.sortIndex:n}static _sortOpsDescending(e,t){const n=B.compareRangesUsingEnds(e.range,t.range);return n===0?t.sortIndex-e.sortIndex:-n}}class jze{constructor(e,t,n,r,o,s,a,l,c){this._chunks=e,this._bom=t,this._cr=n,this._lf=r,this._crlf=o,this._containsRTL=s,this._containsUnusualLineTerminators=a,this._isBasicASCII=l,this._normalizeEOL=c}_getEOL(e){const t=this._cr+this._lf+this._crlf,n=this._cr+this._crlf;return t===0?e===1?` +`;case 0:return this.getEOL();default:throw new Error("Unknown EOL preference")}}setEOL(e){this._pieceTree.setEOL(e)}applyEdits(e,t,n){let r=this._mightContainRTL,o=this._mightContainUnusualLineTerminators,s=this._mightContainNonBasicASCII,a=!0,l=[];for(let p=0;pv.sortIndex-m.sortIndex)}this._mightContainRTL=r,this._mightContainUnusualLineTerminators=o,this._mightContainNonBasicASCII=s;const f=this._doApplyEdits(l);let g=null;if(t&&d.length>0){d.sort((p,v)=>v.lineNumber-p.lineNumber),g=[];for(let p=0,v=d.length;p0&&d[p-1].lineNumber===m)continue;const _=d[p].oldContent,y=this.getLineContent(m);y.length===0||y===_||Ys(y)!==-1||g.push(m)}}return this._onDidChangeContent.fire(),new J6e(h,f,g)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const n=e[0].range,r=e[e.length-1].range,o=new B(n.startLineNumber,n.startColumn,r.endLineNumber,r.endColumn);let s=n.startLineNumber,a=n.startColumn;const l=[];for(let f=0,g=e.length;f0&&l.push(p.text),s=v.endLineNumber,a=v.endColumn}const c=l.join(""),[u,d,h]=Yv(c);return{sortIndex:0,identifier:e[0].identifier,range:o,rangeOffset:this.getOffsetAt(o.startLineNumber,o.startColumn),rangeLength:this.getValueLengthInRange(o,0),text:c,eolCount:u,firstLineLength:d,lastLineLength:h,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(Ky._sortOpsDescending);const t=[];for(let n=0;n0){const h=l.eolCount+1;h===1?d=new B(c,u,c,u+l.firstLineLength):d=new B(c,u,c+h-1,l.lastLineLength+1)}else d=new B(c,u,c,u);n=d.endLineNumber,r=d.endColumn,t.push(d),o=l}return t}static _sortOpsAscending(e,t){const n=B.compareRangesUsingEnds(e.range,t.range);return n===0?e.sortIndex-t.sortIndex:n}static _sortOpsDescending(e,t){const n=B.compareRangesUsingEnds(e.range,t.range);return n===0?t.sortIndex-e.sortIndex:-n}}class jze{constructor(e,t,n,r,o,s,a,l,c){this._chunks=e,this._bom=t,this._cr=n,this._lf=r,this._crlf=o,this._containsRTL=s,this._containsUnusualLineTerminators=a,this._isBasicASCII=l,this._normalizeEOL=c}_getEOL(e){const t=this._cr+this._lf+this._crlf,n=this._cr+this._crlf;return t===0?e===1?` `:`\r `:n>t/2?`\r `:` `}create(e){const t=this._getEOL(e),n=this._chunks;if(this._normalizeEOL&&(t===`\r `&&(this._cr>0||this._lf>0)||t===` -`&&(this._cr>0||this._crlf>0)))for(let o=0,s=n.length;o=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}_acceptChunk1(e,t){!t&&e.length===0||(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=Hze(this._tmpLineStarts,e);this.chunks.push(new k0(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=xw(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=Fpe(e)))}finish(e=!0){return this._finish(),new jze(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(this.chunks.length===0&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;const e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);const t=Dg(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}class Kze{constructor(e){this._default=e,this._store=[]}get(e){return e=this._store.length;)this._store[this._store.length]=this._default;this._store[e]=t}replace(e,t,n){if(e>=this._store.length)return;if(t===0){this.insert(e,n);return}else if(n===0){this.delete(e,t);return}const r=this._store.slice(0,e),o=this._store.slice(e+t),s=Gze(n,this._default);this._store=r.concat(s,o)}delete(e,t){t===0||e>=this._store.length||this._store.splice(e,t)}insert(e,t){if(t===0||e>=this._store.length)return;const n=[];for(let r=0;r0){const n=this._tokens[this._tokens.length-1];if(n.endLineNumber+1===e){n.appendLineTokens(t);return}}this._tokens.push(new qze(e,[t]))}finalize(){return this._tokens}}class Xze{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new qH(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class Yze extends Xze{constructor(e,t,n,r){super(e,t),this._textModel=n,this._languageIdCodec=r}updateTokensUntilLine(e,t){const n=this._textModel.getLanguageId();for(;;){const r=this.getFirstInvalidLine();if(!r||r.lineNumber>t)break;const o=this._textModel.getLineContent(r.lineNumber),s=$x(this._languageIdCodec,n,this.tokenizationSupport,o,!0,r.startState);e.add(r.lineNumber,s.tokens),this.store.setEndState(r.lineNumber,s.endState)}}getTokenTypeIfInsertingCharacter(e,t){const n=this.getStartState(e.lineNumber);if(!n)return 0;const r=this._textModel.getLanguageId(),o=this._textModel.getLineContent(e.lineNumber),s=o.substring(0,e.column-1)+t+o.substring(e.column-1),a=$x(this._languageIdCodec,r,this.tokenizationSupport,s,!0,n),l=new Lo(a.tokens,s,this._languageIdCodec);if(l.getCount()===0)return 0;const c=l.findTokenIndexAtOffset(e.column-1);return l.getStandardTokenType(c)}tokenizeLineWithEdit(e,t,n){const r=e.lineNumber,o=e.column,s=this.getStartState(r);if(!s)return null;const a=this._textModel.getLineContent(r),l=a.substring(0,o-1)+n+a.substring(o-1+t),c=this._textModel.getLanguageIdAtPosition(r,0),u=$x(this._languageIdCodec,c,this.tokenizationSupport,l,!0,s);return new Lo(u.tokens,l,this._languageIdCodec)}isCheapToTokenize(e){const t=this.store.getFirstInvalidEndStateLineNumberOrMax();return e1&&a>=1;a--){const l=this._textModel.getLineFirstNonWhitespaceColumn(a);if(l!==0&&l0&&n>0&&(n--,t--),this._lineEndStates.replace(e.startLineNumber,n,t)}}class Qze{constructor(){this._ranges=[]}get min(){return this._ranges.length===0?null:this._ranges[0].start}delete(e){const t=this._ranges.findIndex(n=>n.contains(e));if(t!==-1){const n=this._ranges[t];n.start===e?n.endExclusive===e+1?this._ranges.splice(t,1):this._ranges[t]=new vn(e+1,n.endExclusive):n.endExclusive===e+1?this._ranges[t]=new vn(n.start,e):this._ranges.splice(t,1,new vn(n.start,e),new vn(e+1,n.endExclusive))}}addRange(e){vn.addRange(e,this._ranges)}addRangeAndResize(e,t){let n=0;for(;!(n>=this._ranges.length||e.start<=this._ranges[n].endExclusive);)n++;let r=n;for(;!(r>=this._ranges.length||e.endExclusivee.toString()).join(" + ")}}function $x(i,e,t,n,r,o){let s=null;if(t)try{s=t.tokenizeEncoded(n,r,o.clone())}catch(a){en(a)}return s||(s=T4(i.encodeLanguageId(e),o)),Lo.convertToEndOffset(s.tokens,n.length),s}class Jze{constructor(e,t){this._tokenizerWithStateStore=e,this._backgroundTokenStore=t,this._isDisposed=!1,this._isScheduled=!1}dispose(){this._isDisposed=!0}handleChanges(){this._beginBackgroundTokenization()}_beginBackgroundTokenization(){this._isScheduled||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._isScheduled=!0,Upe(e=>{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)}))}_backgroundTokenizeWithDeadline(e){const t=Date.now()+e.timeRemaining(),n=()=>{this._isDisposed||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._backgroundTokenizeForAtLeast1ms(),Date.now()1||this._tokenizeOneInvalidLine(t)>=e)break;while(this._hasLinesToTokenize());this._backgroundTokenStore.setTokens(t.finalize()),this.checkFinished()}_hasLinesToTokenize(){return this._tokenizerWithStateStore?!this._tokenizerWithStateStore.store.allStatesValid():!1}_tokenizeOneInvalidLine(e){var t;const n=(t=this._tokenizerWithStateStore)===null||t===void 0?void 0:t.getFirstInvalidLine();return n?(this._tokenizerWithStateStore.updateTokensUntilLine(e,n.lineNumber),n.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){this._isDisposed||this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,t){this._tokenizerWithStateStore.store.invalidateEndStateRange(new pn(e,t))}}const Ig=new Uint32Array(0).buffer;class ef{static deleteBeginning(e,t){return e===null||e===Ig?e:ef.delete(e,0,t)}static deleteEnding(e,t){if(e===null||e===Ig)return e;const n=Vg(e),r=n[n.length-2];return ef.delete(e,t,r)}static delete(e,t,n){if(e===null||e===Ig||t===n)return e;const r=Vg(e),o=r.length>>>1;if(t===0&&r[r.length-2]===n)return Ig;const s=Lo.findIndexInTokensArray(r,t),a=s>0?r[s-1<<1]:0,l=r[s<<1];if(nu&&(r[c++]=g,r[c++]=r[(f<<1)+1],u=g)}if(c===r.length)return e;const h=new Uint32Array(c);return h.set(r.subarray(0,c),0),h.buffer}static append(e,t){if(t===Ig)return e;if(e===Ig)return t;if(e===null)return e;if(t===null)return null;const n=Vg(e),r=Vg(t),o=r.length>>>1,s=new Uint32Array(n.length+r.length);s.set(n,0);let a=n.length;const l=n[n.length-2];for(let c=0;c>>1;let s=Lo.findIndexInTokensArray(r,t);s>0&&r[s-1<<1]===t&&s--;for(let a=s;a0}getTokens(e,t,n){let r=null;if(t1&&(o=us.getLanguageId(r[1])!==e),!o)return Ig}if(!r||r.length===0){const o=new Uint32Array(2);return o[0]=t,o[1]=toe(e),o.buffer}return r[r.length-2]=t,r.byteOffset===0&&r.byteLength===r.buffer.byteLength?r.buffer:r}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){t!==0&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(t===0)return;const n=[];for(let r=0;r=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._lineTokens[t]=ef.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=ef.deleteEnding(this._lineTokens[t],e.startColumn-1);const n=e.endLineNumber-1;let r=null;n=this._len)){if(t===0){this._lineTokens[r]=ef.insert(this._lineTokens[r],e.column-1,n);return}this._lineTokens[r]=ef.deleteEnding(this._lineTokens[r],e.column-1),this._lineTokens[r]=ef.insert(this._lineTokens[r],e.column-1,n),this._insertLines(e.lineNumber,t)}}setMultilineTokens(e,t){if(e.length===0)return{changes:[]};const n=[];for(let r=0,o=e.length;r>>0}class vX{constructor(e){this._pieces=[],this._isComplete=!1,this._languageIdCodec=e}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return this._pieces.length===0}set(e,t){this._pieces=e||[],this._isComplete=t}setPartial(e,t){let n=e;if(t.length>0){const o=t[0].getRange(),s=t[t.length-1].getRange();if(!o||!s)return e;n=e.plusRange(o).plusRange(s)}let r=null;for(let o=0,s=this._pieces.length;on.endLineNumber){r=r||{index:o};break}if(a.removeTokens(n),a.isEmpty()){this._pieces.splice(o,1),o--,s--;continue}if(a.endLineNumbern.endLineNumber){r=r||{index:o};continue}const[l,c]=a.split(n);if(l.isEmpty()){r=r||{index:o};continue}c.isEmpty()||(this._pieces.splice(o,1,l,c),o++,s++,r=r||{index:o})}return r=r||{index:this._pieces.length},t.length>0&&(this._pieces=i4(this._pieces,r.index,t)),n}isComplete(){return this._isComplete}addSparseTokens(e,t){if(t.getLineContent().length===0)return t;const n=this._pieces;if(n.length===0)return t;const r=vX._findFirstPieceWithLine(n,e),o=n[r].getLineTokens(e);if(!o)return t;const s=t.getCount(),a=o.getCount();let l=0;const c=[];let u=0,d=0;const h=(f,g)=>{f!==d&&(d=f,c[u++]=f,c[u++]=g)};for(let f=0;f>>0,_=~m>>>0;for(;lt)r=o-1;else{for(;o>n&&e[o-1].startLineNumber<=t&&t<=e[o-1].endLineNumber;)o--;return o}}return n}acceptEdit(e,t,n,r,o){for(const s of this._pieces)s.acceptEdit(e,t,n,r,o)}}class vP extends Pve{constructor(e,t,n,r,o,s){super(),this._languageService=e,this._languageConfigurationService=t,this._textModel=n,this._bracketPairsTextModelPart=r,this._languageId=o,this._attachedViews=s,this._semanticTokens=new vX(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new se),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new se),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new se),this.onDidChangeTokens=this._onDidChangeTokens.event,this.grammarTokens=this._register(new eUe(this._languageService.languageIdCodec,this._textModel,()=>this._languageId,this._attachedViews)),this._register(this._languageConfigurationService.onDidChange(a=>{a.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})})),this._register(this.grammarTokens.onDidChangeTokens(a=>{this._emitModelTokensChangedEvent(a)})),this._register(this.grammarTokens.onDidChangeBackgroundTokenizationState(a=>{this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState()}))}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(const t of e.changes){const[n,r,o]=Zv(t.text);this._semanticTokens.acceptEdit(t.range,n,r,o,t.text.length>0?t.text.charCodeAt(0):0)}this.grammarTokens.handleDidChangeContent(e)}handleDidChangeAttached(){this.grammarTokens.handleDidChangeAttached()}getLineTokens(e){this.validateLineNumber(e);const t=this.grammarTokens.getLineTokens(e);return this._semanticTokens.addSparseTokens(e,t)}_emitModelTokensChangedEvent(e){this._textModel._isDisposing()||(this._bracketPairsTextModelPart.handleDidChangeTokens(e),this._onDidChangeTokens.fire(e))}validateLineNumber(e){if(e<1||e>this._textModel.getLineCount())throw new qi("Illegal value for lineNumber")}get hasTokens(){return this.grammarTokens.hasTokens}resetTokenization(){this.grammarTokens.resetTokenization()}get backgroundTokenizationState(){return this.grammarTokens.backgroundTokenizationState}forceTokenization(e){this.validateLineNumber(e),this.grammarTokens.forceTokenization(e)}isCheapToTokenize(e){return this.validateLineNumber(e),this.grammarTokens.isCheapToTokenize(e)}tokenizeIfCheap(e){this.validateLineNumber(e),this.grammarTokens.tokenizeIfCheap(e)}getTokenTypeIfInsertingCharacter(e,t,n){return this.grammarTokens.getTokenTypeIfInsertingCharacter(e,t,n)}tokenizeLineWithEdit(e,t,n){return this.grammarTokens.tokenizeLineWithEdit(e,t,n)}setSemanticTokens(e,t){this._semanticTokens.set(e,t),this._emitModelTokensChangedEvent({semanticTokensApplied:e!==null,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}hasCompleteSemanticTokens(){return this._semanticTokens.isComplete()}hasSomeSemanticTokens(){return!this._semanticTokens.isEmpty()}setPartialSemanticTokens(e,t){if(this.hasCompleteSemanticTokens())return;const n=this._textModel.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({semanticTokensApplied:!0,ranges:[{fromLineNumber:n.startLineNumber,toLineNumber:n.endLineNumber}]})}getWordAtPosition(e){this.assertNotDisposed();const t=this._textModel.validatePosition(e),n=this._textModel.getLineContent(t.lineNumber),r=this.getLineTokens(t.lineNumber),o=r.findTokenIndexAtOffset(t.column-1),[s,a]=vP._findLanguageBoundaries(r,o),l=yD(t.column,this.getLanguageConfiguration(r.getLanguageId(o)).getWordDefinition(),n.substring(s,a),s);if(l&&l.startColumn<=e.column&&e.column<=l.endColumn)return l;if(o>0&&s===t.column-1){const[c,u]=vP._findLanguageBoundaries(r,o-1),d=yD(t.column,this.getLanguageConfiguration(r.getLanguageId(o-1)).getWordDefinition(),n.substring(c,u),c);if(d&&d.startColumn<=e.column&&e.column<=d.endColumn)return d}return null}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}static _findLanguageBoundaries(e,t){const n=e.getLanguageId(t);let r=0;for(let s=t;s>=0&&e.getLanguageId(s)===n;s--)r=e.getStartOffset(s);let o=e.getLineContent().length;for(let s=t,a=e.getCount();s{const s=this.getLanguageId();o.changedLanguages.indexOf(s)!==-1&&this.resetTokenization()})),this.resetTokenization(),this._register(r.onDidChangeVisibleRanges(({view:o,state:s})=>{if(s){let a=this._attachedViewStates.get(o);a||(a=new tUe(()=>this.refreshRanges(a.lineRanges)),this._attachedViewStates.set(o,a)),a.handleStateChange(s)}else this._attachedViewStates.deleteAndDispose(o)}))}resetTokenization(e=!0){var t;this._tokens.flush(),(t=this._debugBackgroundTokens)===null||t===void 0||t.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new qH(this._textModel.getLineCount())),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});const n=()=>{if(this._textModel.isTooLargeForTokenization())return[null,null];const s=hr.get(this.getLanguageId());if(!s)return[null,null];let a;try{a=s.getInitialState()}catch(l){return en(l),[null,null]}return[s,a]},[r,o]=n();if(r&&o?this._tokenizer=new Yze(this._textModel.getLineCount(),r,this._textModel,this._languageIdCodec):this._tokenizer=null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){const s={setTokens:a=>{this.setTokens(a)},backgroundTokenizationFinished:()=>{if(this._backgroundTokenizationState===2)return;const a=2;this._backgroundTokenizationState=a,this._onDidChangeBackgroundTokenizationState.fire()},setEndState:(a,l)=>{var c;if(!this._tokenizer)return;const u=this._tokenizer.store.getFirstInvalidEndStateLineNumber();u!==null&&a>=u&&((c=this._tokenizer)===null||c===void 0||c.store.setEndState(a,l))}};r&&r.createBackgroundTokenizer&&!r.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=r.createBackgroundTokenizer(this._textModel,s)),!this._backgroundTokenizer.value&&!this._textModel.isTooLargeForTokenization()&&(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new Jze(this._tokenizer,s),this._defaultBackgroundTokenizer.handleChanges()),r!=null&&r.backgroundTokenizerShouldOnlyVerifyTokens&&r.createBackgroundTokenizer?(this._debugBackgroundTokens=new eI(this._languageIdCodec),this._debugBackgroundStates=new qH(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=r.createBackgroundTokenizer(this._textModel,{setTokens:a=>{var l;(l=this._debugBackgroundTokens)===null||l===void 0||l.setMultilineTokens(a,this._textModel)},backgroundTokenizationFinished(){},setEndState:(a,l)=>{var c;(c=this._debugBackgroundStates)===null||c===void 0||c.setEndState(a,l)}})):(this._debugBackgroundTokens=void 0,this._debugBackgroundStates=void 0,this._debugBackgroundTokenizer.value=void 0)}this.refreshAllVisibleLineTokens()}handleDidChangeAttached(){var e;(e=this._defaultBackgroundTokenizer)===null||e===void 0||e.handleChanges()}handleDidChangeContent(e){var t,n,r;if(e.isFlush)this.resetTokenization(!1);else if(!e.isEolChange){for(const o of e.changes){const[s,a]=Zv(o.text);this._tokens.acceptEdit(o.range,s,a),(t=this._debugBackgroundTokens)===null||t===void 0||t.acceptEdit(o.range,s,a)}(n=this._debugBackgroundStates)===null||n===void 0||n.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),(r=this._defaultBackgroundTokenizer)===null||r===void 0||r.handleChanges()}}setTokens(e){const{changes:t}=this._tokens.setMultilineTokens(e,this._textModel);return t.length>0&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:t}),{changes:t}}refreshAllVisibleLineTokens(){const e=pn.joinMany([...this._attachedViewStates].map(([t,n])=>n.lineRanges));this.refreshRanges(e)}refreshRanges(e){for(const t of e)this.refreshRange(t.startLineNumber,t.endLineNumberExclusive-1)}refreshRange(e,t){var n,r;if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),t=Math.min(this._textModel.getLineCount(),t);const o=new GH,{heuristicTokens:s}=this._tokenizer.tokenizeHeuristically(o,e,t),a=this.setTokens(o.finalize());if(s)for(const l of a.changes)(n=this._backgroundTokenizer.value)===null||n===void 0||n.requestTokens(l.fromLineNumber,l.toLineNumber+1);(r=this._defaultBackgroundTokenizer)===null||r===void 0||r.checkFinished()}forceTokenization(e){var t,n;const r=new GH;(t=this._tokenizer)===null||t===void 0||t.updateTokensUntilLine(r,e),this.setTokens(r.finalize()),(n=this._defaultBackgroundTokenizer)===null||n===void 0||n.checkFinished()}isCheapToTokenize(e){return this._tokenizer?this._tokenizer.isCheapToTokenize(e):!0}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){var t;const n=this._textModel.getLineContent(e),r=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,n);if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){const o=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,n);!r.equals(o)&&(!((t=this._debugBackgroundTokenizer.value)===null||t===void 0)&&t.reportMismatchingTokens)&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return r}getTokenTypeIfInsertingCharacter(e,t,n){if(!this._tokenizer)return 0;const r=this._textModel.validatePosition(new ae(e,t));return this.forceTokenization(r.lineNumber),this._tokenizer.getTokenTypeIfInsertingCharacter(r,n)}tokenizeLineWithEdit(e,t,n){if(!this._tokenizer)return null;const r=this._textModel.validatePosition(e);return this.forceTokenization(r.lineNumber),this._tokenizer.tokenizeLineWithEdit(r,t,n)}get hasTokens(){return this._tokens.hasTokens}}class tUe extends fe{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new pi(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){or(this._computedLineRanges,this._lineRanges,(e,t)=>e.equals(t))||(this._computedLineRanges=this._lineRanges,this._refreshTokens())}handleStateChange(e){this._lineRanges=e.visibleLineRanges,e.stabilized?(this.runner.cancel(),this.update()):this.runner.schedule()}}const U4=yn("undoRedoService");class r_e{constructor(e,t){this.resource=e,this.elements=t}}class Ww{constructor(){this.id=Ww._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}}Ww._ID=0;Ww.None=new Ww;class ff{constructor(){this.id=ff._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}}ff._ID=0;ff.None=new ff;var nUe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},z6=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},p0;function iUe(i){const e=new i_e;return e.acceptChunk(i),e.finish()}function rUe(i){const e=new i_e;let t;for(;typeof(t=i.read())=="string";)e.acceptChunk(t);return e.finish()}function noe(i,e){let t;return typeof i=="string"?t=iUe(i):Z6e(i)?t=rUe(i):t=i,t.create(e)}let SR=0;const oUe=999,sUe=1e4;class aUe{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,n=0;do{const r=this._source.read();if(r===null)return this._eos=!0,t===0?null:e.join("");if(r.length>0&&(e[t++]=r,n+=r.length),n>=64*1024)return e.join("")}while(!0)}}const Hx=()=>{throw new Error("Invalid change accessor")};let zf=p0=class extends fe{static resolveOptions(e,t){if(t.detectIndentation){const n=Gre(e,t.tabSize,t.insertSpaces);return new fM({tabSize:n.tabSize,indentSize:"tabSize",insertSpaces:n.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new fM(t)}get onDidChangeLanguage(){return this._tokenizationTextModelPart.onDidChangeLanguage}get onDidChangeLanguageConfiguration(){return this._tokenizationTextModelPart.onDidChangeLanguageConfiguration}get onDidChangeTokens(){return this._tokenizationTextModelPart.onDidChangeTokens}onDidChangeContent(e){return this._eventEmitter.slowEvent(t=>e(t.contentChangedEvent))}onDidChangeContentOrInjectedText(e){return Zu(this._eventEmitter.fastEvent(t=>e(t)),this._onDidChangeInjectedText.event(t=>e(t)))}_isDisposing(){return this.__isDisposing}get tokenization(){return this._tokenizationTextModelPart}get bracketPairs(){return this._bracketPairs}get guides(){return this._guidesTextModelPart}constructor(e,t,n,r=null,o,s,a){super(),this._undoRedoService=o,this._languageService=s,this._languageConfigurationService=a,this._onWillDispose=this._register(new se),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new fUe(f=>this.handleBeforeFireDecorationsChangedEvent(f))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new se),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new se),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new se),this._eventEmitter=this._register(new gUe),this._languageSelectionListener=this._register(new Ho),this._deltaDecorationCallCnt=0,this._attachedViews=new pUe,SR++,this.id="$model"+SR,this.isForSimpleWidget=n.isForSimpleWidget,typeof r>"u"||r===null?this._associatedResource=At.parse("inmemory://model/"+SR):this._associatedResource=r,this._attachedEditorCount=0;const{textBuffer:l,disposable:c}=noe(e,n.defaultEOL);this._buffer=l,this._bufferDisposable=c,this._options=p0.resolveOptions(this._buffer,n);const u=typeof t=="string"?t:t.languageId;typeof t!="string"&&(this._languageSelectionListener.value=t.onDidChange(()=>this._setLanguage(t.languageId))),this._bracketPairs=this._register(new hze(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new sVe(this,this._languageConfigurationService)),this._decorationProvider=this._register(new gze(this)),this._tokenizationTextModelPart=new vP(this._languageService,this._languageConfigurationService,this,this._bracketPairs,u,this._attachedViews);const d=this._buffer.getLineCount(),h=this._buffer.getValueLengthInRange(new B(1,1,d,this._buffer.getLineLength(d)+1),0);n.largeFileOptimizations?(this._isTooLargeForTokenization=h>p0.LARGE_FILE_SIZE_THRESHOLD||d>p0.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=h>p0.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=h>p0._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=Bpe(SR),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new ioe,this._commandManager=new fX(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._register(this._decorationProvider.onDidChange(()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()})),this._languageService.requestRichLanguageFeatures(u)}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;const e=new Ky([],"",` -`,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=fe.None}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new sb(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw eu();const{textBuffer:t,disposable:n}=noe(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,n)}_createContentChanged2(e,t,n,r,o,s,a,l){return{changes:[{range:e,rangeOffset:t,rangeLength:n,text:r}],eol:this._buffer.getEOL(),isEolChange:l,versionId:this.getVersionId(),isUndoing:o,isRedoing:s,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const n=this.getFullModelRange(),r=this.getValueLengthInRange(n),o=this.getLineCount(),s=this.getLineMaxColumn(o);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new ioe,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new zy([new FVe],this._versionId,!1,!1),this._createContentChanged2(new B(1,1,o,s),0,r,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const t=e===1?`\r +`&&(this._cr>0||this._crlf>0)))for(let o=0,s=n.length;o=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}_acceptChunk1(e,t){!t&&e.length===0||(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=Hze(this._tmpLineStarts,e);this.chunks.push(new I0(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=xw(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=Fpe(e)))}finish(e=!0){return this._finish(),new jze(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(this.chunks.length===0&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;const e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);const t=Dg(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}class Kze{constructor(e){this._default=e,this._store=[]}get(e){return e=this._store.length;)this._store[this._store.length]=this._default;this._store[e]=t}replace(e,t,n){if(e>=this._store.length)return;if(t===0){this.insert(e,n);return}else if(n===0){this.delete(e,t);return}const r=this._store.slice(0,e),o=this._store.slice(e+t),s=Gze(n,this._default);this._store=r.concat(s,o)}delete(e,t){t===0||e>=this._store.length||this._store.splice(e,t)}insert(e,t){if(t===0||e>=this._store.length)return;const n=[];for(let r=0;r0){const n=this._tokens[this._tokens.length-1];if(n.endLineNumber+1===e){n.appendLineTokens(t);return}}this._tokens.push(new qze(e,[t]))}finalize(){return this._tokens}}class Xze{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new qH(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class Yze extends Xze{constructor(e,t,n,r){super(e,t),this._textModel=n,this._languageIdCodec=r}updateTokensUntilLine(e,t){const n=this._textModel.getLanguageId();for(;;){const r=this.getFirstInvalidLine();if(!r||r.lineNumber>t)break;const o=this._textModel.getLineContent(r.lineNumber),s=$x(this._languageIdCodec,n,this.tokenizationSupport,o,!0,r.startState);e.add(r.lineNumber,s.tokens),this.store.setEndState(r.lineNumber,s.endState)}}getTokenTypeIfInsertingCharacter(e,t){const n=this.getStartState(e.lineNumber);if(!n)return 0;const r=this._textModel.getLanguageId(),o=this._textModel.getLineContent(e.lineNumber),s=o.substring(0,e.column-1)+t+o.substring(e.column-1),a=$x(this._languageIdCodec,r,this.tokenizationSupport,s,!0,n),l=new Lo(a.tokens,s,this._languageIdCodec);if(l.getCount()===0)return 0;const c=l.findTokenIndexAtOffset(e.column-1);return l.getStandardTokenType(c)}tokenizeLineWithEdit(e,t,n){const r=e.lineNumber,o=e.column,s=this.getStartState(r);if(!s)return null;const a=this._textModel.getLineContent(r),l=a.substring(0,o-1)+n+a.substring(o-1+t),c=this._textModel.getLanguageIdAtPosition(r,0),u=$x(this._languageIdCodec,c,this.tokenizationSupport,l,!0,s);return new Lo(u.tokens,l,this._languageIdCodec)}isCheapToTokenize(e){const t=this.store.getFirstInvalidEndStateLineNumberOrMax();return e1&&a>=1;a--){const l=this._textModel.getLineFirstNonWhitespaceColumn(a);if(l!==0&&l0&&n>0&&(n--,t--),this._lineEndStates.replace(e.startLineNumber,n,t)}}class Qze{constructor(){this._ranges=[]}get min(){return this._ranges.length===0?null:this._ranges[0].start}delete(e){const t=this._ranges.findIndex(n=>n.contains(e));if(t!==-1){const n=this._ranges[t];n.start===e?n.endExclusive===e+1?this._ranges.splice(t,1):this._ranges[t]=new vn(e+1,n.endExclusive):n.endExclusive===e+1?this._ranges[t]=new vn(n.start,e):this._ranges.splice(t,1,new vn(n.start,e),new vn(e+1,n.endExclusive))}}addRange(e){vn.addRange(e,this._ranges)}addRangeAndResize(e,t){let n=0;for(;!(n>=this._ranges.length||e.start<=this._ranges[n].endExclusive);)n++;let r=n;for(;!(r>=this._ranges.length||e.endExclusivee.toString()).join(" + ")}}function $x(i,e,t,n,r,o){let s=null;if(t)try{s=t.tokenizeEncoded(n,r,o.clone())}catch(a){en(a)}return s||(s=T4(i.encodeLanguageId(e),o)),Lo.convertToEndOffset(s.tokens,n.length),s}class Jze{constructor(e,t){this._tokenizerWithStateStore=e,this._backgroundTokenStore=t,this._isDisposed=!1,this._isScheduled=!1}dispose(){this._isDisposed=!0}handleChanges(){this._beginBackgroundTokenization()}_beginBackgroundTokenization(){this._isScheduled||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._isScheduled=!0,Upe(e=>{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)}))}_backgroundTokenizeWithDeadline(e){const t=Date.now()+e.timeRemaining(),n=()=>{this._isDisposed||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._backgroundTokenizeForAtLeast1ms(),Date.now()1||this._tokenizeOneInvalidLine(t)>=e)break;while(this._hasLinesToTokenize());this._backgroundTokenStore.setTokens(t.finalize()),this.checkFinished()}_hasLinesToTokenize(){return this._tokenizerWithStateStore?!this._tokenizerWithStateStore.store.allStatesValid():!1}_tokenizeOneInvalidLine(e){var t;const n=(t=this._tokenizerWithStateStore)===null||t===void 0?void 0:t.getFirstInvalidLine();return n?(this._tokenizerWithStateStore.updateTokensUntilLine(e,n.lineNumber),n.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){this._isDisposed||this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,t){this._tokenizerWithStateStore.store.invalidateEndStateRange(new pn(e,t))}}const Ig=new Uint32Array(0).buffer;class ef{static deleteBeginning(e,t){return e===null||e===Ig?e:ef.delete(e,0,t)}static deleteEnding(e,t){if(e===null||e===Ig)return e;const n=Vg(e),r=n[n.length-2];return ef.delete(e,t,r)}static delete(e,t,n){if(e===null||e===Ig||t===n)return e;const r=Vg(e),o=r.length>>>1;if(t===0&&r[r.length-2]===n)return Ig;const s=Lo.findIndexInTokensArray(r,t),a=s>0?r[s-1<<1]:0,l=r[s<<1];if(nu&&(r[c++]=g,r[c++]=r[(f<<1)+1],u=g)}if(c===r.length)return e;const h=new Uint32Array(c);return h.set(r.subarray(0,c),0),h.buffer}static append(e,t){if(t===Ig)return e;if(e===Ig)return t;if(e===null)return e;if(t===null)return null;const n=Vg(e),r=Vg(t),o=r.length>>>1,s=new Uint32Array(n.length+r.length);s.set(n,0);let a=n.length;const l=n[n.length-2];for(let c=0;c>>1;let s=Lo.findIndexInTokensArray(r,t);s>0&&r[s-1<<1]===t&&s--;for(let a=s;a0}getTokens(e,t,n){let r=null;if(t1&&(o=us.getLanguageId(r[1])!==e),!o)return Ig}if(!r||r.length===0){const o=new Uint32Array(2);return o[0]=t,o[1]=toe(e),o.buffer}return r[r.length-2]=t,r.byteOffset===0&&r.byteLength===r.buffer.byteLength?r.buffer:r}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){t!==0&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(t===0)return;const n=[];for(let r=0;r=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._lineTokens[t]=ef.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=ef.deleteEnding(this._lineTokens[t],e.startColumn-1);const n=e.endLineNumber-1;let r=null;n=this._len)){if(t===0){this._lineTokens[r]=ef.insert(this._lineTokens[r],e.column-1,n);return}this._lineTokens[r]=ef.deleteEnding(this._lineTokens[r],e.column-1),this._lineTokens[r]=ef.insert(this._lineTokens[r],e.column-1,n),this._insertLines(e.lineNumber,t)}}setMultilineTokens(e,t){if(e.length===0)return{changes:[]};const n=[];for(let r=0,o=e.length;r>>0}class vX{constructor(e){this._pieces=[],this._isComplete=!1,this._languageIdCodec=e}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return this._pieces.length===0}set(e,t){this._pieces=e||[],this._isComplete=t}setPartial(e,t){let n=e;if(t.length>0){const o=t[0].getRange(),s=t[t.length-1].getRange();if(!o||!s)return e;n=e.plusRange(o).plusRange(s)}let r=null;for(let o=0,s=this._pieces.length;on.endLineNumber){r=r||{index:o};break}if(a.removeTokens(n),a.isEmpty()){this._pieces.splice(o,1),o--,s--;continue}if(a.endLineNumbern.endLineNumber){r=r||{index:o};continue}const[l,c]=a.split(n);if(l.isEmpty()){r=r||{index:o};continue}c.isEmpty()||(this._pieces.splice(o,1,l,c),o++,s++,r=r||{index:o})}return r=r||{index:this._pieces.length},t.length>0&&(this._pieces=i4(this._pieces,r.index,t)),n}isComplete(){return this._isComplete}addSparseTokens(e,t){if(t.getLineContent().length===0)return t;const n=this._pieces;if(n.length===0)return t;const r=vX._findFirstPieceWithLine(n,e),o=n[r].getLineTokens(e);if(!o)return t;const s=t.getCount(),a=o.getCount();let l=0;const c=[];let u=0,d=0;const h=(f,g)=>{f!==d&&(d=f,c[u++]=f,c[u++]=g)};for(let f=0;f>>0,_=~m>>>0;for(;lt)r=o-1;else{for(;o>n&&e[o-1].startLineNumber<=t&&t<=e[o-1].endLineNumber;)o--;return o}}return n}acceptEdit(e,t,n,r,o){for(const s of this._pieces)s.acceptEdit(e,t,n,r,o)}}class vP extends Pve{constructor(e,t,n,r,o,s){super(),this._languageService=e,this._languageConfigurationService=t,this._textModel=n,this._bracketPairsTextModelPart=r,this._languageId=o,this._attachedViews=s,this._semanticTokens=new vX(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new se),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new se),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new se),this.onDidChangeTokens=this._onDidChangeTokens.event,this.grammarTokens=this._register(new eUe(this._languageService.languageIdCodec,this._textModel,()=>this._languageId,this._attachedViews)),this._register(this._languageConfigurationService.onDidChange(a=>{a.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})})),this._register(this.grammarTokens.onDidChangeTokens(a=>{this._emitModelTokensChangedEvent(a)})),this._register(this.grammarTokens.onDidChangeBackgroundTokenizationState(a=>{this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState()}))}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(const t of e.changes){const[n,r,o]=Yv(t.text);this._semanticTokens.acceptEdit(t.range,n,r,o,t.text.length>0?t.text.charCodeAt(0):0)}this.grammarTokens.handleDidChangeContent(e)}handleDidChangeAttached(){this.grammarTokens.handleDidChangeAttached()}getLineTokens(e){this.validateLineNumber(e);const t=this.grammarTokens.getLineTokens(e);return this._semanticTokens.addSparseTokens(e,t)}_emitModelTokensChangedEvent(e){this._textModel._isDisposing()||(this._bracketPairsTextModelPart.handleDidChangeTokens(e),this._onDidChangeTokens.fire(e))}validateLineNumber(e){if(e<1||e>this._textModel.getLineCount())throw new qi("Illegal value for lineNumber")}get hasTokens(){return this.grammarTokens.hasTokens}resetTokenization(){this.grammarTokens.resetTokenization()}get backgroundTokenizationState(){return this.grammarTokens.backgroundTokenizationState}forceTokenization(e){this.validateLineNumber(e),this.grammarTokens.forceTokenization(e)}isCheapToTokenize(e){return this.validateLineNumber(e),this.grammarTokens.isCheapToTokenize(e)}tokenizeIfCheap(e){this.validateLineNumber(e),this.grammarTokens.tokenizeIfCheap(e)}getTokenTypeIfInsertingCharacter(e,t,n){return this.grammarTokens.getTokenTypeIfInsertingCharacter(e,t,n)}tokenizeLineWithEdit(e,t,n){return this.grammarTokens.tokenizeLineWithEdit(e,t,n)}setSemanticTokens(e,t){this._semanticTokens.set(e,t),this._emitModelTokensChangedEvent({semanticTokensApplied:e!==null,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}hasCompleteSemanticTokens(){return this._semanticTokens.isComplete()}hasSomeSemanticTokens(){return!this._semanticTokens.isEmpty()}setPartialSemanticTokens(e,t){if(this.hasCompleteSemanticTokens())return;const n=this._textModel.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({semanticTokensApplied:!0,ranges:[{fromLineNumber:n.startLineNumber,toLineNumber:n.endLineNumber}]})}getWordAtPosition(e){this.assertNotDisposed();const t=this._textModel.validatePosition(e),n=this._textModel.getLineContent(t.lineNumber),r=this.getLineTokens(t.lineNumber),o=r.findTokenIndexAtOffset(t.column-1),[s,a]=vP._findLanguageBoundaries(r,o),l=yD(t.column,this.getLanguageConfiguration(r.getLanguageId(o)).getWordDefinition(),n.substring(s,a),s);if(l&&l.startColumn<=e.column&&e.column<=l.endColumn)return l;if(o>0&&s===t.column-1){const[c,u]=vP._findLanguageBoundaries(r,o-1),d=yD(t.column,this.getLanguageConfiguration(r.getLanguageId(o-1)).getWordDefinition(),n.substring(c,u),c);if(d&&d.startColumn<=e.column&&e.column<=d.endColumn)return d}return null}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}static _findLanguageBoundaries(e,t){const n=e.getLanguageId(t);let r=0;for(let s=t;s>=0&&e.getLanguageId(s)===n;s--)r=e.getStartOffset(s);let o=e.getLineContent().length;for(let s=t,a=e.getCount();s{const s=this.getLanguageId();o.changedLanguages.indexOf(s)!==-1&&this.resetTokenization()})),this.resetTokenization(),this._register(r.onDidChangeVisibleRanges(({view:o,state:s})=>{if(s){let a=this._attachedViewStates.get(o);a||(a=new tUe(()=>this.refreshRanges(a.lineRanges)),this._attachedViewStates.set(o,a)),a.handleStateChange(s)}else this._attachedViewStates.deleteAndDispose(o)}))}resetTokenization(e=!0){var t;this._tokens.flush(),(t=this._debugBackgroundTokens)===null||t===void 0||t.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new qH(this._textModel.getLineCount())),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});const n=()=>{if(this._textModel.isTooLargeForTokenization())return[null,null];const s=hr.get(this.getLanguageId());if(!s)return[null,null];let a;try{a=s.getInitialState()}catch(l){return en(l),[null,null]}return[s,a]},[r,o]=n();if(r&&o?this._tokenizer=new Yze(this._textModel.getLineCount(),r,this._textModel,this._languageIdCodec):this._tokenizer=null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){const s={setTokens:a=>{this.setTokens(a)},backgroundTokenizationFinished:()=>{if(this._backgroundTokenizationState===2)return;const a=2;this._backgroundTokenizationState=a,this._onDidChangeBackgroundTokenizationState.fire()},setEndState:(a,l)=>{var c;if(!this._tokenizer)return;const u=this._tokenizer.store.getFirstInvalidEndStateLineNumber();u!==null&&a>=u&&((c=this._tokenizer)===null||c===void 0||c.store.setEndState(a,l))}};r&&r.createBackgroundTokenizer&&!r.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=r.createBackgroundTokenizer(this._textModel,s)),!this._backgroundTokenizer.value&&!this._textModel.isTooLargeForTokenization()&&(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new Jze(this._tokenizer,s),this._defaultBackgroundTokenizer.handleChanges()),r!=null&&r.backgroundTokenizerShouldOnlyVerifyTokens&&r.createBackgroundTokenizer?(this._debugBackgroundTokens=new eI(this._languageIdCodec),this._debugBackgroundStates=new qH(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=r.createBackgroundTokenizer(this._textModel,{setTokens:a=>{var l;(l=this._debugBackgroundTokens)===null||l===void 0||l.setMultilineTokens(a,this._textModel)},backgroundTokenizationFinished(){},setEndState:(a,l)=>{var c;(c=this._debugBackgroundStates)===null||c===void 0||c.setEndState(a,l)}})):(this._debugBackgroundTokens=void 0,this._debugBackgroundStates=void 0,this._debugBackgroundTokenizer.value=void 0)}this.refreshAllVisibleLineTokens()}handleDidChangeAttached(){var e;(e=this._defaultBackgroundTokenizer)===null||e===void 0||e.handleChanges()}handleDidChangeContent(e){var t,n,r;if(e.isFlush)this.resetTokenization(!1);else if(!e.isEolChange){for(const o of e.changes){const[s,a]=Yv(o.text);this._tokens.acceptEdit(o.range,s,a),(t=this._debugBackgroundTokens)===null||t===void 0||t.acceptEdit(o.range,s,a)}(n=this._debugBackgroundStates)===null||n===void 0||n.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),(r=this._defaultBackgroundTokenizer)===null||r===void 0||r.handleChanges()}}setTokens(e){const{changes:t}=this._tokens.setMultilineTokens(e,this._textModel);return t.length>0&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:t}),{changes:t}}refreshAllVisibleLineTokens(){const e=pn.joinMany([...this._attachedViewStates].map(([t,n])=>n.lineRanges));this.refreshRanges(e)}refreshRanges(e){for(const t of e)this.refreshRange(t.startLineNumber,t.endLineNumberExclusive-1)}refreshRange(e,t){var n,r;if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),t=Math.min(this._textModel.getLineCount(),t);const o=new GH,{heuristicTokens:s}=this._tokenizer.tokenizeHeuristically(o,e,t),a=this.setTokens(o.finalize());if(s)for(const l of a.changes)(n=this._backgroundTokenizer.value)===null||n===void 0||n.requestTokens(l.fromLineNumber,l.toLineNumber+1);(r=this._defaultBackgroundTokenizer)===null||r===void 0||r.checkFinished()}forceTokenization(e){var t,n;const r=new GH;(t=this._tokenizer)===null||t===void 0||t.updateTokensUntilLine(r,e),this.setTokens(r.finalize()),(n=this._defaultBackgroundTokenizer)===null||n===void 0||n.checkFinished()}isCheapToTokenize(e){return this._tokenizer?this._tokenizer.isCheapToTokenize(e):!0}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){var t;const n=this._textModel.getLineContent(e),r=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,n);if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){const o=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,n);!r.equals(o)&&(!((t=this._debugBackgroundTokenizer.value)===null||t===void 0)&&t.reportMismatchingTokens)&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return r}getTokenTypeIfInsertingCharacter(e,t,n){if(!this._tokenizer)return 0;const r=this._textModel.validatePosition(new ae(e,t));return this.forceTokenization(r.lineNumber),this._tokenizer.getTokenTypeIfInsertingCharacter(r,n)}tokenizeLineWithEdit(e,t,n){if(!this._tokenizer)return null;const r=this._textModel.validatePosition(e);return this.forceTokenization(r.lineNumber),this._tokenizer.tokenizeLineWithEdit(r,t,n)}get hasTokens(){return this._tokens.hasTokens}}class tUe extends fe{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new pi(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){or(this._computedLineRanges,this._lineRanges,(e,t)=>e.equals(t))||(this._computedLineRanges=this._lineRanges,this._refreshTokens())}handleStateChange(e){this._lineRanges=e.visibleLineRanges,e.stabilized?(this.runner.cancel(),this.update()):this.runner.schedule()}}const U4=yn("undoRedoService");class r_e{constructor(e,t){this.resource=e,this.elements=t}}class Ww{constructor(){this.id=Ww._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}}Ww._ID=0;Ww.None=new Ww;class ff{constructor(){this.id=ff._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}}ff._ID=0;ff.None=new ff;var nUe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},z6=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},g0;function iUe(i){const e=new i_e;return e.acceptChunk(i),e.finish()}function rUe(i){const e=new i_e;let t;for(;typeof(t=i.read())=="string";)e.acceptChunk(t);return e.finish()}function noe(i,e){let t;return typeof i=="string"?t=iUe(i):Z6e(i)?t=rUe(i):t=i,t.create(e)}let SR=0;const oUe=999,sUe=1e4;class aUe{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,n=0;do{const r=this._source.read();if(r===null)return this._eos=!0,t===0?null:e.join("");if(r.length>0&&(e[t++]=r,n+=r.length),n>=64*1024)return e.join("")}while(!0)}}const Hx=()=>{throw new Error("Invalid change accessor")};let zf=g0=class extends fe{static resolveOptions(e,t){if(t.detectIndentation){const n=Gre(e,t.tabSize,t.insertSpaces);return new fM({tabSize:n.tabSize,indentSize:"tabSize",insertSpaces:n.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new fM(t)}get onDidChangeLanguage(){return this._tokenizationTextModelPart.onDidChangeLanguage}get onDidChangeLanguageConfiguration(){return this._tokenizationTextModelPart.onDidChangeLanguageConfiguration}get onDidChangeTokens(){return this._tokenizationTextModelPart.onDidChangeTokens}onDidChangeContent(e){return this._eventEmitter.slowEvent(t=>e(t.contentChangedEvent))}onDidChangeContentOrInjectedText(e){return Zu(this._eventEmitter.fastEvent(t=>e(t)),this._onDidChangeInjectedText.event(t=>e(t)))}_isDisposing(){return this.__isDisposing}get tokenization(){return this._tokenizationTextModelPart}get bracketPairs(){return this._bracketPairs}get guides(){return this._guidesTextModelPart}constructor(e,t,n,r=null,o,s,a){super(),this._undoRedoService=o,this._languageService=s,this._languageConfigurationService=a,this._onWillDispose=this._register(new se),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new fUe(f=>this.handleBeforeFireDecorationsChangedEvent(f))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new se),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new se),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new se),this._eventEmitter=this._register(new gUe),this._languageSelectionListener=this._register(new Ho),this._deltaDecorationCallCnt=0,this._attachedViews=new pUe,SR++,this.id="$model"+SR,this.isForSimpleWidget=n.isForSimpleWidget,typeof r>"u"||r===null?this._associatedResource=At.parse("inmemory://model/"+SR):this._associatedResource=r,this._attachedEditorCount=0;const{textBuffer:l,disposable:c}=noe(e,n.defaultEOL);this._buffer=l,this._bufferDisposable=c,this._options=g0.resolveOptions(this._buffer,n);const u=typeof t=="string"?t:t.languageId;typeof t!="string"&&(this._languageSelectionListener.value=t.onDidChange(()=>this._setLanguage(t.languageId))),this._bracketPairs=this._register(new hze(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new sVe(this,this._languageConfigurationService)),this._decorationProvider=this._register(new gze(this)),this._tokenizationTextModelPart=new vP(this._languageService,this._languageConfigurationService,this,this._bracketPairs,u,this._attachedViews);const d=this._buffer.getLineCount(),h=this._buffer.getValueLengthInRange(new B(1,1,d,this._buffer.getLineLength(d)+1),0);n.largeFileOptimizations?(this._isTooLargeForTokenization=h>g0.LARGE_FILE_SIZE_THRESHOLD||d>g0.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=h>g0.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=h>g0._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=Bpe(SR),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new ioe,this._commandManager=new fX(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._register(this._decorationProvider.onDidChange(()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()})),this._languageService.requestRichLanguageFeatures(u)}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;const e=new Ky([],"",` +`,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=fe.None}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new ob(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw eu();const{textBuffer:t,disposable:n}=noe(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,n)}_createContentChanged2(e,t,n,r,o,s,a,l){return{changes:[{range:e,rangeOffset:t,rangeLength:n,text:r}],eol:this._buffer.getEOL(),isEolChange:l,versionId:this.getVersionId(),isUndoing:o,isRedoing:s,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const n=this.getFullModelRange(),r=this.getValueLengthInRange(n),o=this.getLineCount(),s=this.getLineMaxColumn(o);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new ioe,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new zy([new FVe],this._versionId,!1,!1),this._createContentChanged2(new B(1,1,o,s),0,r,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const t=e===1?`\r `:` -`;if(this._buffer.getEOL()===t)return;const n=this.getFullModelRange(),r=this.getValueLengthInRange(n),o=this.getLineCount(),s=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new zy([new $Ve],this._versionId,!1,!1),this._createContentChanged2(new B(1,1,o,s),0,r,this.getValue(),!1,!1,!1,!0))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let n=0,r=t.length;n0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isTooLargeForHeapOperation(){return this._isTooLargeForHeapOperation}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,t=0;const n=this._buffer.getLineCount();for(let r=1;r<=n;r++){const o=this._buffer.getLineLength(r);o>=sUe?t+=o:e+=o}return t>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed();const t=typeof e.tabSize<"u"?e.tabSize:this._options.tabSize,n=typeof e.indentSize<"u"?e.indentSize:this._options.originalIndentSize,r=typeof e.insertSpaces<"u"?e.insertSpaces:this._options.insertSpaces,o=typeof e.trimAutoWhitespace<"u"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,s=typeof e.bracketColorizationOptions<"u"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new fM({tabSize:t,indentSize:n,insertSpaces:r,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:o,bracketPairColorizationOptions:s});if(this._options.equals(a))return;const l=this._options.createChangeEvent(a);this._options=a,this._bracketPairs.handleDidChangeOptions(l),this._decorationProvider.handleDidChangeOptions(l),this._onDidChangeOptions.fire(l)}detectIndentation(e,t){this._assertNotDisposed();const n=Gre(this._buffer,t,e);this.updateOptions({insertSpaces:n.insertSpaces,tabSize:n.tabSize,indentSize:n.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),cP(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(Ope.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map(n=>({range:n.range,text:null})),()=>null)}mightContainNonBasicASCII(){return this._buffer.mightContainNonBasicASCII()}getAlternativeVersionId(){return this._assertNotDisposed(),this._alternativeVersionId}getInitialUndoRedoSnapshot(){return this._assertNotDisposed(),this._initialUndoRedoSnapshot}getOffsetAt(e){this._assertNotDisposed();const t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();const t=Math.min(this._buffer.getLength(),Math.max(0,e));return this._buffer.getPositionAt(t)}_increaseVersionId(){this._versionId=this._versionId+1,this._alternativeVersionId=this._versionId}_overwriteVersionId(e){this._versionId=e}_overwriteAlternativeVersionId(e){this._alternativeVersionId=e}_overwriteInitialUndoRedoSnapshot(e){this._initialUndoRedoSnapshot=e}getValue(e,t=!1){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new qi("Operation would exceed heap memory limits");const n=this.getFullModelRange(),r=this.getValueInRange(n,e);return t?this._buffer.getBOM()+r:r}createSnapshot(e=!1){return new aUe(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const n=this.getFullModelRange(),r=this.getValueLengthInRange(n,e);return t?this._buffer.getBOM().length+r:r}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 qi("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new qi("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new qi("Operation would exceed heap memory limits");return this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),this._buffer.getEOL()===` +`;if(this._buffer.getEOL()===t)return;const n=this.getFullModelRange(),r=this.getValueLengthInRange(n),o=this.getLineCount(),s=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new zy([new $Ve],this._versionId,!1,!1),this._createContentChanged2(new B(1,1,o,s),0,r,this.getValue(),!1,!1,!1,!0))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let n=0,r=t.length;n0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isTooLargeForHeapOperation(){return this._isTooLargeForHeapOperation}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,t=0;const n=this._buffer.getLineCount();for(let r=1;r<=n;r++){const o=this._buffer.getLineLength(r);o>=sUe?t+=o:e+=o}return t>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed();const t=typeof e.tabSize<"u"?e.tabSize:this._options.tabSize,n=typeof e.indentSize<"u"?e.indentSize:this._options.originalIndentSize,r=typeof e.insertSpaces<"u"?e.insertSpaces:this._options.insertSpaces,o=typeof e.trimAutoWhitespace<"u"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,s=typeof e.bracketColorizationOptions<"u"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new fM({tabSize:t,indentSize:n,insertSpaces:r,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:o,bracketPairColorizationOptions:s});if(this._options.equals(a))return;const l=this._options.createChangeEvent(a);this._options=a,this._bracketPairs.handleDidChangeOptions(l),this._decorationProvider.handleDidChangeOptions(l),this._onDidChangeOptions.fire(l)}detectIndentation(e,t){this._assertNotDisposed();const n=Gre(this._buffer,t,e);this.updateOptions({insertSpaces:n.insertSpaces,tabSize:n.tabSize,indentSize:n.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),cP(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(Ope.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map(n=>({range:n.range,text:null})),()=>null)}mightContainNonBasicASCII(){return this._buffer.mightContainNonBasicASCII()}getAlternativeVersionId(){return this._assertNotDisposed(),this._alternativeVersionId}getInitialUndoRedoSnapshot(){return this._assertNotDisposed(),this._initialUndoRedoSnapshot}getOffsetAt(e){this._assertNotDisposed();const t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();const t=Math.min(this._buffer.getLength(),Math.max(0,e));return this._buffer.getPositionAt(t)}_increaseVersionId(){this._versionId=this._versionId+1,this._alternativeVersionId=this._versionId}_overwriteVersionId(e){this._versionId=e}_overwriteAlternativeVersionId(e){this._alternativeVersionId=e}_overwriteInitialUndoRedoSnapshot(e){this._initialUndoRedoSnapshot=e}getValue(e,t=!1){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new qi("Operation would exceed heap memory limits");const n=this.getFullModelRange(),r=this.getValueInRange(n,e);return t?this._buffer.getBOM()+r:r}createSnapshot(e=!1){return new aUe(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const n=this.getFullModelRange(),r=this.getValueLengthInRange(n,e);return t?this._buffer.getBOM().length+r:r}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 qi("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new qi("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new qi("Operation would exceed heap memory limits");return this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),this._buffer.getEOL()===` `?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new qi("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new qi("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new qi("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),n=e.startLineNumber,r=e.startColumn;let o=Math.floor(typeof n=="number"&&!isNaN(n)?n:1),s=Math.floor(typeof r=="number"&&!isNaN(r)?r:1);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 d=this.getLineMaxColumn(o);s>=d&&(s=d)}const a=e.endLineNumber,l=e.endColumn;let c=Math.floor(typeof a=="number"&&!isNaN(a)?a:1),u=Math.floor(typeof l=="number"&&!isNaN(l)?l:1);if(c<1)c=1,u=1;else if(c>t)c=t,u=this.getLineMaxColumn(c);else if(u<=1)u=1;else{const d=this.getLineMaxColumn(c);u>=d&&(u=d)}return n===o&&r===s&&a===c&&l===u&&e instanceof B&&!(e instanceof yt)?e:new B(o,s,c,u)}_isValidPosition(e,t,n){if(typeof e!="number"||typeof t!="number"||isNaN(e)||isNaN(t)||e<1||t<1||(e|0)!==e||(t|0)!==t)return!1;const r=this._buffer.getLineCount();if(e>r)return!1;if(t===1)return!0;const o=this.getLineMaxColumn(e);if(t>o)return!1;if(n===1){const s=this._buffer.getLineCharCode(e,t-2);if(xo(s))return!1}return!0}_validatePosition(e,t,n){const r=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),o=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),s=this._buffer.getLineCount();if(r<1)return new ae(1,1);if(r>s)return new ae(s,this.getLineMaxColumn(s));if(o<=1)return new ae(r,1);const a=this.getLineMaxColumn(r);if(o>=a)return new ae(r,a);if(n===1){const l=this._buffer.getLineCharCode(r,o-2);if(xo(l))return new ae(r,o-1)}return new ae(r,o)}validatePosition(e){return this._assertNotDisposed(),e instanceof ae&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const n=e.startLineNumber,r=e.startColumn,o=e.endLineNumber,s=e.endColumn;if(!this._isValidPosition(n,r,0)||!this._isValidPosition(o,s,0))return!1;if(t===1){const a=r>1?this._buffer.getLineCharCode(n,r-2):0,l=s>1&&s<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,s-2):0,c=xo(a),u=xo(l);return!c&&!u}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof B&&!(e instanceof yt)&&this._isValidRange(e,1))return e;const n=this._validatePosition(e.startLineNumber,e.startColumn,0),r=this._validatePosition(e.endLineNumber,e.endColumn,0),o=n.lineNumber,s=n.column,a=r.lineNumber,l=r.column;{const c=s>1?this._buffer.getLineCharCode(o,s-2):0,u=l>1&&l<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,l-2):0,d=xo(c),h=xo(u);return!d&&!h?new B(o,s,a,l):o===a&&s===l?new B(o,s-1,a,l-1):d&&h?new B(o,s-1,a,l+1):d?new B(o,s-1,a,l):new B(o,s,a,l+1)}}modifyPosition(e,t){this._assertNotDisposed();const n=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,n)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new B(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,n,r){return this._buffer.findMatchesLineByLine(e,t,n,r)}findMatches(e,t,n,r,o,s,a=oUe){this._assertNotDisposed();let l=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(d=>B.isIRange(d))&&(l=t.map(d=>this.validateRange(d)))),l===null&&(l=[this.getFullModelRange()]),l=l.sort((d,h)=>d.startLineNumber-h.startLineNumber||d.startColumn-h.startColumn);const c=[];c.push(l.reduce((d,h)=>B.areIntersecting(d,h)?d.plusRange(h):(c.push(d),h)));let u;if(!n&&e.indexOf(` -`)<0){const h=new g0(e,n,r,o).parseSearchRequest();if(!h)return[];u=f=>this.findMatchesLineByLine(f,h,s,a)}else u=d=>oR.findMatches(this,new g0(e,n,r,o),d,s,a);return c.map(u).reduce((d,h)=>d.concat(h),[])}findNextMatch(e,t,n,r,o,s){this._assertNotDisposed();const a=this.validatePosition(t);if(!n&&e.indexOf(` -`)<0){const c=new g0(e,n,r,o).parseSearchRequest();if(!c)return null;const u=this.getLineCount();let d=new B(a.lineNumber,a.column,u,this.getLineMaxColumn(u)),h=this.findMatchesLineByLine(d,c,s,1);return oR.findNextMatch(this,new g0(e,n,r,o),a,s),h.length>0||(d=new B(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),h=this.findMatchesLineByLine(d,c,s,1),h.length>0)?h[0]:null}return oR.findNextMatch(this,new g0(e,n,r,o),a,s)}findPreviousMatch(e,t,n,r,o,s){this._assertNotDisposed();const a=this.validatePosition(t);return oR.findPreviousMatch(this,new g0(e,n,r,o),a,s)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()===` +`)<0){const h=new f0(e,n,r,o).parseSearchRequest();if(!h)return[];u=f=>this.findMatchesLineByLine(f,h,s,a)}else u=d=>oR.findMatches(this,new f0(e,n,r,o),d,s,a);return c.map(u).reduce((d,h)=>d.concat(h),[])}findNextMatch(e,t,n,r,o,s){this._assertNotDisposed();const a=this.validatePosition(t);if(!n&&e.indexOf(` +`)<0){const c=new f0(e,n,r,o).parseSearchRequest();if(!c)return null;const u=this.getLineCount();let d=new B(a.lineNumber,a.column,u,this.getLineMaxColumn(u)),h=this.findMatchesLineByLine(d,c,s,1);return oR.findNextMatch(this,new f0(e,n,r,o),a,s),h.length>0||(d=new B(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),h=this.findMatchesLineByLine(d,c,s,1),h.length>0)?h[0]:null}return oR.findNextMatch(this,new f0(e,n,r,o),a,s)}findPreviousMatch(e,t,n,r,o,s){this._assertNotDisposed();const a=this.validatePosition(t);return oR.findPreviousMatch(this,new f0(e,n,r,o),a,s)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()===` `?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof y6?e:new y6(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let n=0,r=e.length;n({range:this.validateRange(a.range),text:a.text}));let s=!0;if(e)for(let a=0,l=e.length;ac.endLineNumber,p=c.startLineNumber>f.endLineNumber;if(!g&&!p){u=!0;break}}if(!u){s=!1;break}}if(s)for(let a=0,l=this._trimAutoWhitespaceLines.length;ag.endLineNumber)&&!(c===g.startLineNumber&&g.startColumn===u&&g.isEmpty()&&p&&p.length>0&&p.charAt(0)===` `)&&!(c===g.startLineNumber&&g.startColumn===1&&g.isEmpty()&&p&&p.length>0&&p.charAt(p.length-1)===` -`)){d=!1;break}}if(d){const h=new B(c,1,c,u);t.push(new y6(null,h,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,n,r)}_applyUndo(e,t,n,r){const o=e.map(s=>{const a=this.getPositionAt(s.newPosition),l=this.getPositionAt(s.newEnd);return{range:new B(a.lineNumber,a.column,l.lineNumber,l.column),text:s.oldText}});this._applyUndoRedoEdits(o,t,!0,!1,n,r)}_applyRedo(e,t,n,r){const o=e.map(s=>{const a=this.getPositionAt(s.oldPosition),l=this.getPositionAt(s.oldEnd);return{range:new B(a.lineNumber,a.column,l.lineNumber,l.column),text:s.newText}});this._applyUndoRedoEdits(o,t,!1,!0,n,r)}_applyUndoRedoEdits(e,t,n,r,o,s){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=n,this._isRedoing=r,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 n=this._validateEditOperations(e);return this._doApplyEdits(n,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){const n=this._buffer.getLineCount(),r=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),o=this._buffer.getLineCount(),s=r.changes;if(this._trimAutoWhitespaceLines=r.trimAutoWhitespaceLineNumbers,s.length!==0){for(let c=0,u=s.length;c=0;T--){const M=f+T,A=y+T;k.takeFromEndWhile(R=>R.lineNumber>A);const N=k.takeFromEndWhile(R=>R.lineNumber===A);a.push(new Bre(M,this.getLineContent(A),N))}if(mG.lineNumberG.lineNumber===H)}a.push(new WVe(M+1,f+v,F,R))}l+=_}this._emitContentChangedEvent(new zy(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:s,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return r.reverseEdits===null?void 0:r.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e){if(e===null||e.size===0)return;const n=Array.from(e).map(r=>new Bre(r,this.getLineContent(r),this._getInjectedTextInLine(r)));this._onDidChangeInjectedText.fire(new Bve(n))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const n={addDecoration:(o,s)=>this._deltaDecorationsImpl(e,[],[{range:o,options:s}])[0],changeDecoration:(o,s)=>{this._changeDecorationImpl(o,s)},changeDecorationOptions:(o,s)=>{this._changeDecorationOptionsImpl(o,ooe(s))},removeDecoration:o=>{this._deltaDecorationsImpl(e,[o],[])},deltaDecorations:(o,s)=>o.length===0&&s.length===0?[]:this._deltaDecorationsImpl(e,o,s)};let r=null;try{r=t(n)}catch(o){en(o)}return n.addDecoration=Hx,n.changeDecoration=Hx,n.changeDecorationOptions=Hx,n.removeDecoration=Hx,n.deltaDecorations=Hx,r}deltaDecorations(e,t,n=0){if(this._assertNotDisposed(),e||(e=[]),e.length===0&&t.length===0)return[];try{return this._deltaDecorationCallCnt++,this._deltaDecorationCallCnt>1&&(console.warn("Invoking deltaDecorations recursively could lead to leaking decorations."),en(new Error("Invoking deltaDecorations recursively could lead to leaking decorations."))),this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(n,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit(),this._deltaDecorationCallCnt--}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,n){const r=e?this._decorations[e]:null;if(!r)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:roe[n]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(r),delete this._decorations[r.id],null;const o=this._validateRangeRelaxedNoAllocations(t),s=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),a=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);return this._decorationsTree.delete(r),r.reset(this.getVersionId(),s,a,o),r.setOptions(roe[n]),this._decorationsTree.insert(r),r.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let n=0,r=t.length;nthis.getLineCount()?[]:this.getLinesDecorations(e,e,t,n)}getLinesDecorations(e,t,n=0,r=!1,o=!1){const s=this.getLineCount(),a=Math.min(s,Math.max(1,e)),l=Math.min(s,Math.max(1,t)),c=this.getLineMaxColumn(l),u=new B(a,1,l,c),d=this._getDecorationsInRange(u,n,r,o);return t$(d,this._decorationProvider.getDecorationsInRange(u,n,r)),d}getDecorationsInRange(e,t=0,n=!1,r=!1,o=!1){const s=this.validateRange(e),a=this._getDecorationsInRange(s,t,n,o);return t$(a,this._decorationProvider.getDecorationsInRange(s,t,n,r)),a}getOverviewRulerDecorations(e=0,t=!1){return this._decorationsTree.getAll(this,e,t,!0,!1)}getInjectedTextDecorations(e=0){return this._decorationsTree.getAllInjectedText(this,e)}_getInjectedTextInLine(e){const t=this._buffer.getOffsetAt(e,1),n=t+this._buffer.getLineLength(e),r=this._decorationsTree.getInjectedTextInInterval(this,t,n,0);return gh.fromDecorations(r).filter(o=>o.lineNumber===e)}getAllDecorations(e=0,t=!1){let n=this._decorationsTree.getAll(this,e,t,!1,!1);return n=n.concat(this._decorationProvider.getAllDecorations(e,t)),n}getAllMarginDecorations(e=0){return this._decorationsTree.getAll(this,e,!1,!1,!0)}_getDecorationsInRange(e,t,n,r){const o=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),s=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,o,s,t,n,r)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t){const n=this._decorations[e];if(!n)return;if(n.options.after){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.endLineNumber)}if(n.options.before){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.startLineNumber)}const r=this._validateRangeRelaxedNoAllocations(t),o=this._buffer.getOffsetAt(r.startLineNumber,r.startColumn),s=this._buffer.getOffsetAt(r.endLineNumber,r.endColumn);this._decorationsTree.delete(n),n.reset(this.getVersionId(),o,s,r),this._decorationsTree.insert(n),this._onDidChangeDecorations.checkAffectedAndFire(n.options),n.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(r.endLineNumber),n.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(r.startLineNumber)}_changeDecorationOptionsImpl(e,t){const n=this._decorations[e];if(!n)return;const r=!!(n.options.overviewRuler&&n.options.overviewRuler.color),o=!!(t.overviewRuler&&t.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(n.options),this._onDidChangeDecorations.checkAffectedAndFire(t),n.options.after||t.after){const l=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByInjectedText(l.endLineNumber)}if(n.options.before||t.before){const l=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByInjectedText(l.startLineNumber)}const s=r!==o,a=cUe(t)!==wM(n);s||a?(this._decorationsTree.delete(n),n.setOptions(t),this._decorationsTree.insert(n)):n.setOptions(t)}_deltaDecorationsImpl(e,t,n,r=!1){const o=this.getVersionId(),s=t.length;let a=0;const l=n.length;let c=0;this._onDidChangeDecorations.beginDeferredEmit();try{const u=new Array(l);for(;athis._setLanguage(e.languageId,t)),this._setLanguage(e.languageId,t))}_setLanguage(e,t){this.tokenization.setLanguageId(e,t),this._languageService.requestRichLanguageFeatures(e)}getLanguageIdAtPosition(e,t){return this.tokenization.getLanguageIdAtPosition(e,t)}getWordAtPosition(e){return this._tokenizationTextModelPart.getWordAtPosition(e)}getWordUntilPosition(e){return this._tokenizationTextModelPart.getWordUntilPosition(e)}normalizePosition(e,t){return e}getLineIndentColumn(e){return lUe(this.getLineContent(e))+1}};zf._MODEL_SYNC_LIMIT=50*1024*1024;zf.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024;zf.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3;zf.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024;zf.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:Ds.tabSize,indentSize:Ds.indentSize,insertSpaces:Ds.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:Ds.trimAutoWhitespace,largeFileOptimizations:Ds.largeFileOptimizations,bracketPairColorizationOptions:Ds.bracketPairColorizationOptions};zf=p0=nUe([z6(4,U4),z6(5,ji),z6(6,Di)],zf);function lUe(i){let e=0;for(const t of i)if(t===" "||t===" ")e++;else break;return e}function U6(i){return!!(i.options.overviewRuler&&i.options.overviewRuler.color)}function cUe(i){return!!i.after||!!i.before}function wM(i){return!!i.options.after||!!i.options.before}class ioe{constructor(){this._decorationsTree0=new $6,this._decorationsTree1=new $6,this._injectedTextDecorationsTree=new $6}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1,!1)}_ensureNodesHaveRanges(e,t){for(const n of t)n.range===null&&(n.range=e.getRangeAt(n.cachedAbsoluteStart,n.cachedAbsoluteEnd));return t}getAllInInterval(e,t,n,r,o,s){const a=e.getVersionId(),l=this._intervalSearch(t,n,r,o,a,s);return this._ensureNodesHaveRanges(e,l)}_intervalSearch(e,t,n,r,o,s){const a=this._decorationsTree0.intervalSearch(e,t,n,r,o,s),l=this._decorationsTree1.intervalSearch(e,t,n,r,o,s),c=this._injectedTextDecorationsTree.intervalSearch(e,t,n,r,o,s);return a.concat(l).concat(c)}getInjectedTextInInterval(e,t,n,r){const o=e.getVersionId(),s=this._injectedTextDecorationsTree.intervalSearch(t,n,r,!1,o,!1);return this._ensureNodesHaveRanges(e,s).filter(a=>a.options.showIfCollapsed||!a.range.isEmpty())}getAllInjectedText(e,t){const n=e.getVersionId(),r=this._injectedTextDecorationsTree.search(t,!1,n,!1);return this._ensureNodesHaveRanges(e,r).filter(o=>o.options.showIfCollapsed||!o.range.isEmpty())}getAll(e,t,n,r,o){const s=e.getVersionId(),a=this._search(t,n,r,s,o);return this._ensureNodesHaveRanges(e,a)}_search(e,t,n,r,o){if(n)return this._decorationsTree1.search(e,t,r,o);{const s=this._decorationsTree0.search(e,t,r,o),a=this._decorationsTree1.search(e,t,r,o),l=this._injectedTextDecorationsTree.search(e,t,r,o);return s.concat(a).concat(l)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),n=this._decorationsTree1.collectNodesFromOwner(e),r=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(n).concat(r)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),n=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(n)}insert(e){wM(e)?this._injectedTextDecorationsTree.insert(e):U6(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){wM(e)?this._injectedTextDecorationsTree.delete(e):U6(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const n=e.getVersionId();return t.cachedVersionId!==n&&this._resolveNode(t,n),t.range===null&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){wM(e)?this._injectedTextDecorationsTree.resolveNode(e,t):U6(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,n,r){this._decorationsTree0.acceptReplace(e,t,n,r),this._decorationsTree1.acceptReplace(e,t,n,r),this._injectedTextDecorationsTree.acceptReplace(e,t,n,r)}}function Wh(i){return i.replace(/[^a-z0-9\-_]/gi," ")}class o_e{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class uUe extends o_e{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:mc.Center}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=null}_resolveColor(e,t){if(typeof e=="string")return e;const n=e?t.getColor(e.id):null;return n?n.toString():""}}class dUe{constructor(e){var t;this.position=(t=e==null?void 0:e.position)!==null&&t!==void 0?t:$f.Center,this.persistLane=e==null?void 0:e.persistLane}}class hUe extends o_e{constructor(e){super(e),this.position=e.position}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=void 0}_resolveColor(e,t){return typeof e=="string"?me.fromHex(e):t.getColor(e.id)}}class e_{static from(e){return e instanceof e_?e:new e_(e)}constructor(e){this.content=e.content||"",this.inlineClassName=e.inlineClassName||null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.attachedData=e.attachedData||null,this.cursorStops=e.cursorStops||null}}class sn{static register(e){return new sn(e)}static createDynamic(e){return new sn(e)}constructor(e){var t,n,r,o,s,a;this.description=e.description,this.blockClassName=e.blockClassName?Wh(e.blockClassName):null,this.blockDoesNotCollapse=(t=e.blockDoesNotCollapse)!==null&&t!==void 0?t:null,this.blockIsAfterEnd=(n=e.blockIsAfterEnd)!==null&&n!==void 0?n:null,this.blockPadding=(r=e.blockPadding)!==null&&r!==void 0?r:null,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?Wh(e.className):null,this.shouldFillLineOnLineBreak=(o=e.shouldFillLineOnLineBreak)!==null&&o!==void 0?o:null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.lineNumberHoverMessage=e.lineNumberHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new uUe(e.overviewRuler):null,this.minimap=e.minimap?new hUe(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new dUe(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?Wh(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?Wh(e.linesDecorationsClassName):null,this.lineNumberClassName=e.lineNumberClassName?Wh(e.lineNumberClassName):null,this.linesDecorationsTooltip=e.linesDecorationsTooltip?O5e(e.linesDecorationsTooltip):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?Wh(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?Wh(e.marginClassName):null,this.inlineClassName=e.inlineClassName?Wh(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?Wh(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?Wh(e.afterContentClassName):null,this.after=e.after?e_.from(e.after):null,this.before=e.before?e_.from(e.before):null,this.hideInCommentTokens=(s=e.hideInCommentTokens)!==null&&s!==void 0?s:!1,this.hideInStringTokens=(a=e.hideInStringTokens)!==null&&a!==void 0?a:!1}}sn.EMPTY=sn.register({description:"empty"});const roe=[sn.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),sn.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),sn.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),sn.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function ooe(i){return i instanceof sn?i:sn.createDynamic(i)}class fUe extends fe{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new se),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._deferredCnt=0,this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._affectsLineNumber=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){var e;this._deferredCnt--,this._deferredCnt===0&&(this._shouldFireDeferred&&this.doFire(),(e=this._affectedInjectedTextLines)===null||e===void 0||e.clear(),this._affectedInjectedTextLines=null)}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}checkAffectedAndFire(e){var t,n;this._affectsMinimap||(this._affectsMinimap=!!(!((t=e.minimap)===null||t===void 0)&&t.position)),this._affectsOverviewRuler||(this._affectsOverviewRuler=!!(!((n=e.overviewRuler)===null||n===void 0)&&n.color)),this._affectsGlyphMargin||(this._affectsGlyphMargin=!!e.glyphMarginClassName),this._affectsLineNumber||(this._affectsLineNumber=!!e.lineNumberClassName),this.tryFire()}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this._affectsGlyphMargin=!0,this.tryFire()}tryFire(){this._deferredCnt===0?this.doFire():this._shouldFireDeferred=!0}doFire(){this.handleBeforeFire(this._affectedInjectedTextLines);const e={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler,affectsGlyphMargin:this._affectsGlyphMargin,affectsLineNumber:this._affectsLineNumber};this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._actual.fire(e)}}class gUe extends fe{constructor(){super(),this._fastEmitter=this._register(new se),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new se),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(e=null){if(this._deferredCnt--,this._deferredCnt===0&&this._deferredEvent!==null){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;const t=this._deferredEvent;this._deferredEvent=null,this._fastEmitter.fire(t),this._slowEmitter.fire(t)}}fire(e){if(this._deferredCnt>0){this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e;return}this._fastEmitter.fire(e),this._slowEmitter.fire(e)}}class pUe{constructor(){this._onDidChangeVisibleRanges=new se,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new mUe(t=>{this._onDidChangeVisibleRanges.fire({view:e,state:t})});return this._views.add(e),e}detachView(e){this._views.delete(e),this._onDidChangeVisibleRanges.fire({view:e,state:void 0})}}class mUe{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){const n=e.map(r=>new pn(r.startLineNumber,r.endLineNumber+1));this.handleStateChange({visibleLineRanges:n,stabilized:t})}}class _X{static create(e){return new _X(e.get(133),e.get(132))}constructor(e,t){this.classifier=new vUe(e,t)}createLineBreaksComputer(e,t,n,r,o){const s=[],a=[],l=[];return{addRequest:(c,u,d)=>{s.push(c),a.push(u),l.push(d)},finalize:()=>{const c=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,u=[];for(let d=0,h=s.length;d=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 XH=[],YH=[];function _Ue(i,e,t,n,r,o,s,a){if(r===-1)return null;const l=t.length;if(l<=1)return null;const c=a==="keepAll",u=e.breakOffsets,d=e.breakOffsetsVisibleColumn,h=s_e(t,n,r,o,s),f=r-h,g=XH,p=YH;let v=0,m=0,_=0,y=r;const S=u.length;let L=0;if(L>=0){let E=Math.abs(d[L]-y);for(;L+1=E)break;E=D,L++}}for(;LE&&(E=m,D=_);let k=0,T=0,M=0,A=0;if(D<=y){let R=D,F=E===0?0:t.charCodeAt(E-1),W=E===0?0:i.get(F),H=!0;for(let G=E;Gm&&ZH(F,W,K,re,c)&&(k=U,T=R),R+=Y,R>y){U>m?(M=U,A=R-Y):(M=G+1,A=R),R-T>f&&(k=0),H=!1;break}F=K,W=re}if(H){v>0&&(g[v]=u[u.length-1],p[v]=d[u.length-1],v++);break}}if(k===0){let R=D,F=t.charCodeAt(E),W=i.get(F),H=!1;for(let G=E-1;G>=m;G--){const U=G+1,K=t.charCodeAt(G);if(K===9){H=!0;break}let re,Y;if(Db(K)?(G--,re=0,Y=2):(re=i.get(K),Y=Uv(K)?o:1),R<=y){if(M===0&&(M=U,A=R),R<=y-f)break;if(ZH(K,re,F,W,c)){k=U,T=R;break}}R-=Y,F=K,W=re}if(k!==0){const G=f-(A-T);if(G<=n){const U=t.charCodeAt(M);let K;xo(U)?K=2:K=SE(U,A,n,o),G-K<0&&(k=0)}}if(H){L--;continue}}if(k===0&&(k=M,T=A),k<=m){const R=t.charCodeAt(m);xo(R)?(k=m+2,T=_+2):(k=m+1,T=_+SE(R,_,n,o))}for(m=k,g[v]=k,_=T,p[v]=T,v++,y=T+f;L<0||L=N)break;N=R,L++}}return v===0?null:(g.length=v,p.length=v,XH=e.breakOffsets,YH=e.breakOffsetsVisibleColumn,e.breakOffsets=g,e.breakOffsetsVisibleColumn=p,e.wrappedTextIndentLength=h,e)}function bUe(i,e,t,n,r,o,s,a){const l=gh.applyInjectedText(e,t);let c,u;if(t&&t.length>0?(c=t.map(T=>T.options),u=t.map(T=>T.column-1)):(c=null,u=null),r===-1)return c?new _E(u,c,[l.length],[],0):null;const d=l.length;if(d<=1)return c?new _E(u,c,[l.length],[],0):null;const h=a==="keepAll",f=s_e(l,n,r,o,s),g=r-f,p=[],v=[];let m=0,_=0,y=0,S=r,L=l.charCodeAt(0),E=i.get(L),D=SE(L,0,n,o),k=1;xo(L)&&(D+=1,L=l.charCodeAt(1),E=i.get(L),k++);for(let T=k;TS&&((_===0||D-y>g)&&(_=M,y=D-R),p[m]=_,v[m]=y,m++,S=y+g,_=0),L=A,E=N}return m===0&&(!t||t.length===0)?null:(p[m]=d,v[m]=D,new _E(u,c,p,v,f))}function SE(i,e,t,n){return i===9?t-e%t:Uv(i)||i<32?n:1}function soe(i,e){return e-i%e}function ZH(i,e,t,n,r){return t!==32&&(e===2&&n!==2||e!==1&&n===1||!r&&e===3&&n!==2||!r&&n===3&&e!==1)}function s_e(i,e,t,n,r){let o=0;if(r!==0){const s=Ys(i);if(s!==-1){for(let l=0;lt&&(o=0)}}return o}class _P{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new Yo(new B(1,1,1,1),0,0,new ae(1,1),0),new Yo(new B(1,1,1,1),0,0,new ae(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 Wn(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?yt.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):yt.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,n){this._setState(e,t,n)}static _validatePositionWithCache(e,t,n,r){return t.equals(n)?r:e.normalizePosition(t,2)}static _validateViewState(e,t){const n=t.position,r=t.selectionStart.getStartPosition(),o=t.selectionStart.getEndPosition(),s=e.normalizePosition(n,2),a=this._validatePositionWithCache(e,r,n,s),l=this._validatePositionWithCache(e,o,r,a);return n.equals(s)&&r.equals(a)&&o.equals(l)?t:new Yo(B.fromPositions(a,l),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+r.column-a.column,s,t.leftoverVisibleColumns+n.column-s.column)}_setState(e,t,n){if(n&&(n=_P._validateViewState(e.viewModel,n)),t){const r=e.model.validateRange(t.selectionStart),o=t.selectionStart.equalsRange(r)?t.selectionStartLeftoverVisibleColumns:0,s=e.model.validatePosition(t.position),a=t.position.equals(s)?t.leftoverVisibleColumns:0;t=new Yo(r,t.selectionStartKind,o,s,a)}else{if(!n)return;const r=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(n.selectionStart)),o=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(n.position));t=new Yo(r,n.selectionStartKind,n.selectionStartLeftoverVisibleColumns,o,n.leftoverVisibleColumns)}if(n){const r=e.coordinatesConverter.validateViewRange(n.selectionStart,t.selectionStart),o=e.coordinatesConverter.validateViewPosition(n.position,t.position);n=new Yo(r,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const r=e.coordinatesConverter.convertModelPositionToViewPosition(new ae(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new ae(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),s=new B(r.lineNumber,r.column,o.lineNumber,o.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);n=new Yo(s,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=n,this._updateTrackedRange(e)}}class aoe{constructor(e){this.context=e,this.cursors=[new _P(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 l9e(this.cursors,Jc(e=>e.viewState.position,ae.compare)).viewState.position}getBottomMostViewPosition(){return a9e(this.cursors,Jc(e=>e.viewState.position,ae.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(Wn.fromModelSelections(e))}getPrimaryCursor(){return this.cursors[0].asCursorState()}setStates(e){e!==null&&(this.cursors[0].setState(this.context,e[0].modelState,e[0].viewState),this._setSecondaryStates(e.slice(1)))}_setSecondaryStates(e){const t=this.cursors.length-1,n=e.length;if(tn){const r=t-n;for(let o=0;o=e+1&&this.lastAddedCursorIndex--,this.cursors[e+1].dispose(this.context),this.cursors.splice(e+1,1)}normalize(){if(this.cursors.length===1)return;const e=this.cursors.slice(0),t=[];for(let n=0,r=e.length;nn.selection,B.compareRangesUsingStarts));for(let n=0;nd&&p.index--;e.splice(d,1),t.splice(u,1),this._removeSecondaryCursor(d-1),n--}}}}class loe{constructor(e,t,n,r){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=n,this.cursorConfig=r}}class CUe{constructor(){this.type=0}}class yUe{constructor(){this.type=1}}class wUe{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class SUe{constructor(e,t,n){this.selections=e,this.modelSelections=t,this.reason=n,this.type=3}}class J_{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler,this.affectsGlyphMargin=e.affectsGlyphMargin,this.affectsLineNumber=e.affectsLineNumber):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0,this.affectsGlyphMargin=!0,this.affectsLineNumber=!0)}}class xR{constructor(){this.type=5}}class xUe{constructor(e){this.type=6,this.isFocused=e}}class LUe{constructor(){this.type=7}}class LR{constructor(){this.type=8}}class a_e{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}}class QH{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class JH{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class SM{constructor(e,t,n,r,o,s,a){this.source=e,this.minimalReveal=t,this.range=n,this.selections=r,this.verticalType=o,this.revealHorizontal=s,this.scrollType=a,this.type=12}}class EUe{constructor(e){this.type=13,this.scrollWidth=e.scrollWidth,this.scrollLeft=e.scrollLeft,this.scrollHeight=e.scrollHeight,this.scrollTop=e.scrollTop,this.scrollWidthChanged=e.scrollWidthChanged,this.scrollLeftChanged=e.scrollLeftChanged,this.scrollHeightChanged=e.scrollHeightChanged,this.scrollTopChanged=e.scrollTopChanged}}class DUe{constructor(e){this.theme=e,this.type=14}}class IUe{constructor(e){this.type=15,this.ranges=e}}class kUe{constructor(){this.type=16}}let TUe=class{constructor(){this.type=17}};class NUe extends fe{constructor(){super(),this._onEvent=this._register(new se),this.onEvent=this._onEvent.event,this._eventHandlers=[],this._viewEventQueue=null,this._isConsumingViewEventQueue=!1,this._collector=null,this._collectorCnt=0,this._outgoingEvents=[]}emitOutgoingEvent(e){this._addOutgoingEvent(e),this._emitOutgoingEvents()}_addOutgoingEvent(e){for(let t=0,n=this._outgoingEvents.length;t0;){if(this._collector||this._isConsumingViewEventQueue)return;const e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let t=0,n=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 n of t)n.handleEvents(e)}}}class RUe{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class bX{constructor(e,t,n,r){this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=n,this.contentHeight=r,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}attemptToMerge(e){return e.kind!==this.kind?null:new bX(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class CX{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new CX(this.oldHasFocus,e.hasFocus)}}class yX{constructor(e,t,n,r,o,s,a,l){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=n,this._oldScrollTop=r,this.scrollWidth=o,this.scrollLeft=s,this.scrollHeight=a,this.scrollTop=l,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!this.scrollWidthChanged&&!this.scrollLeftChanged&&!this.scrollHeightChanged&&!this.scrollTopChanged}attemptToMerge(e){return e.kind!==this.kind?null:new yX(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class MUe{constructor(){this.kind=3}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class AUe{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class bP{constructor(e,t,n,r,o,s,a){this.kind=6,this.oldSelections=e,this.selections=t,this.oldModelVersionId=n,this.modelVersionId=r,this.source=o,this.reason=s,this.reachedMaxCursorCount=a}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const n=e.length,r=t.length;if(n!==r)return!1;for(let o=0;o0){const e=this._cursors.getSelections();for(let t=0;ts&&(r=r.slice(0,s),o=!0);const a=xE.from(this._model,this);return this._cursors.setStates(r),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,n,a,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealPrimary(e,t,n,r,o,s){const a=this._cursors.getViewPositions();let l=null,c=null;a.length>1?c=this._cursors.getViewSelections():l=B.fromPositions(a[0],a[0]),e.emitViewEvent(new SM(t,n,l,c,r,o,s))}saveState(){const e=[],t=this._cursors.getSelections();for(let n=0,r=t.length;n0){const o=Wn.fromModelSelections(n.resultingSelection);this.setStates(e,"modelChange",n.isUndoing?5:n.isRedoing?6:2,o)&&this.revealPrimary(e,"modelChange",!1,0,!0,0)}else{const o=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,Wn.fromModelSelections(o))}}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;const e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),n=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:n.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,n)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,n,r){this.setStates(e,t,r,Wn.fromModelSelections(n))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const n=[],r=[];for(let a=0,l=e.length;a0&&this._pushAutoClosedAction(n,r),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){(!e||e.length===0)&&(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,n,r,o){const s=xE.from(this._model,this);if(s.equals(r))return!1;const a=this._cursors.getSelections(),l=this._cursors.getViewSelections();if(e.emitViewEvent(new SUe(l,a,n)),!r||r.cursorState.length!==s.cursorState.length||s.cursorState.some((c,u)=>!c.modelState.equals(r.cursorState[u].modelState))){const c=r?r.cursorState.map(d=>d.modelState.selection):null,u=r?r.modelVersionId:0;e.emitOutgoingEvent(new bP(c,a,u,s.modelVersionId,t||"keyboard",n,o))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let n=0,r=e.length;n=0)return null;const s=o.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!s)return null;const a=s[1],l=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!l||l.length!==1)return null;const c=l[0].open,u=o.text.length-s[2].length-1,d=o.text.lastIndexOf(c,u-1);if(d===-1)return null;t.push([d,u])}return t}executeEdits(e,t,n,r){let o=null;t==="snippet"&&(o=this._findAutoClosingPairs(n)),o&&(n[0]._isTracked=!0);const s=[],a=[],l=this._model.pushEditOperations(this.getSelections(),n,c=>{if(o)for(let d=0,h=o.length;d0&&this._pushAutoClosedAction(s,a)}_executeEdit(e,t,n,r=0){if(this.context.cursorConfig.readOnly)return;const o=xE.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(s){en(s)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,n,r,o,!1)&&this.revealPrimary(t,n,!1,0,!0,0)}getAutoClosedCharacters(){return coe.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new LE(this._model,this.getSelections())}endComposition(e,t){const n=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{t==="keyboard"&&this._executeEditOperation(rr.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,n,this.getSelections(),this.getAutoClosedCharacters()))},e,t)}type(e,t,n){this._executeEdit(()=>{if(n==="keyboard"){const r=t.length;let o=0;for(;o{const c=l.getPosition();return new yt(c.lineNumber,c.column+o,c.lineNumber,c.column+o)});this.setSelections(e,s,a,0)}return}this._executeEdit(()=>{this._executeEditOperation(rr.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,n,r,o))},e,s)}paste(e,t,n,r,o){this._executeEdit(()=>{this._executeEditOperation(rr.paste(this.context.cursorConfig,this._model,this.getSelections(),t,n,r||[]))},e,o,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(Mb.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,n){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new za(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,n)}executeCommands(e,t,n){this._executeEdit(()=>{this._executeEditOperation(new za(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,n)}}class xE{static from(e,t){return new xE(e.getVersionId(),t.getCursorStates())}constructor(e,t){this.modelVersionId=e,this.cursorState=t}equals(e){if(!e||this.modelVersionId!==e.modelVersionId||this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,n=this.cursorState.length;t=t.length||!t[n].strictContainsRange(e[n]))return!1;return!0}}class zUe{static executeCommands(e,t,n){const r={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},o=this._innerExecuteCommands(r,n);for(let s=0,a=r.trackedRanges.length;s0&&(s[0]._isTracked=!0);let a=e.model.pushEditOperations(e.selectionsBefore,s,c=>{const u=[];for(let f=0;ff.identifier.minor-g.identifier.minor,h=[];for(let f=0;f0?(u[f].sort(d),h[f]=t[f].computeCursorState(e.model,{getInverseEditOperations:()=>u[f],getTrackedSelection:g=>{const p=parseInt(g,10),v=e.model._getTrackedRange(e.trackedRanges[p]);return e.trackedRangesDirection[p]===0?new yt(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn):new yt(v.endLineNumber,v.endColumn,v.startLineNumber,v.startColumn)}})):h[f]=e.selectionsBefore[f];return h});a||(a=e.selectionsBefore);const l=[];for(const c in o)o.hasOwnProperty(c)&&l.push(parseInt(c,10));l.sort((c,u)=>u-c);for(const c of l)a.splice(c,1);return a}static _arrayIsEmpty(e){for(let t=0,n=e.length;t{B.isEmpty(d)&&h===""||r.push({identifier:{major:t,minor:o++},range:d,text:h,forceMoveMarkers:f,isAutoWhitespaceEdit:n.insertsAutoWhitespace})};let a=!1;const u={addEditOperation:s,addTrackedEditOperation:(d,h,f)=>{a=!0,s(d,h,f)},trackSelection:(d,h)=>{const f=yt.liftSelection(d);let g;if(f.isEmpty())if(typeof h=="boolean")h?g=2:g=3;else{const m=e.model.getLineMaxColumn(f.startLineNumber);f.startColumn===m?g=2:g=3}else g=1;const p=e.trackedRanges.length,v=e.model._setTrackedRange(null,f,g);return e.trackedRanges[p]=v,e.trackedRangesDirection[p]=f.getDirection(),p.toString()}};try{n.getEditOperations(e.model,u)}catch(d){return en(d),{operations:[],hadTrackedEditOperation:!1}}return{operations:r,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((n,r)=>-B.compareRangesUsingEnds(n.range,r.range));const t={};for(let n=1;no.identifier.major?s=r.identifier.major:s=o.identifier.major,t[s.toString()]=!0;for(let a=0;a0&&n--}}return t}}class UUe{constructor(e,t,n){this.text=e,this.startSelection=t,this.endSelection=n}}class LE{static _capture(e,t){const n=[];for(const r of t){if(r.startLineNumber!==r.endLineNumber)return null;n.push(new UUe(e.getLineContent(r.startLineNumber),r.startColumn-1,r.endColumn-1))}return n}constructor(e,t){this._original=LE._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const n=LE._capture(e,t);if(!n||this._original.length!==n.length)return null;const r=[];for(let o=0,s=this._original.length;oNw,tokenizeEncoded:(i,e,t)=>T4(0,t)};async function jUe(i,e,t){if(!t)return doe(e,i.languageIdCodec,uoe);const n=await hr.getOrCreate(t);return doe(e,i.languageIdCodec,n||uoe)}function KUe(i,e,t,n,r,o,s){let a="
",l=n,c=0,u=!0;for(let d=0,h=e.getCount();d0;)s&&u?(g+=" ",u=!1):(g+=" ",u=!0),v--;break}case 60:g+="<",u=!1;break;case 62:g+=">",u=!1;break;case 38:g+="&",u=!1;break;case 0:g+="�",u=!1;break;case 65279:case 8232:case 8233:case 133:g+="�",u=!1;break;case 13:g+="​",u=!1;break;case 32:s&&u?(g+=" ",u=!1):(g+=" ",u=!0);break;default:g+=String.fromCharCode(p),u=!1}}if(a+=`${g}`,f>r||l>=r)break}return a+="
",a}function doe(i,e,t){let n='
';const r=Jf(i);let o=t.getInitialState();for(let s=0,a=r.length;s0&&(n+="
");const c=t.tokenizeEncoded(l,!0,o);Lo.convertToEndOffset(c.tokens,l.length);const d=new Lo(c.tokens,l,e).inflate();let h=0;for(let f=0,g=d.getCount();f${HA(l.substring(h,v))}`,h=v}o=c.endState}return n+="
",n}class GUe{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,n=this._changes,r=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,n,r)}}class qUe{constructor(e,t,n,r,o){this.id=e,this.afterLineNumber=t,this.ordinal=n,this.height=r,this.minWidth=o,this.prefixSum=0}}let l_e=class eV{constructor(e,t,n,r){this._instanceId=Bpe(++eV.INSTANCE_COUNT),this._pendingChanges=new GUe,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=t,this._paddingTop=n,this._paddingBottom=r}static findInsertionIndex(e,t,n){let r=0,o=e.length;for(;r>>1;t===e[s].afterLineNumber?n{t=!0,r=r|0,o=o|0,s=s|0,a=a|0;const l=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new qUe(l,r,o,s,a)),l},changeOneWhitespace:(r,o,s)=>{t=!0,o=o|0,s=s|0,this._pendingChanges.change({id:r,newAfterLineNumber:o,newHeight:s})},removeWhitespace:r=>{t=!0,this._pendingChanges.remove({id:r})}})}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,n){if((e.length>0||n.length>0)&&(this._minWidth=-1),e.length+t.length+n.length<=1){for(const l of e)this._insertWhitespace(l);for(const l of t)this._changeOneWhitespace(l.id,l.newAfterLineNumber,l.newHeight);for(const l of n){const c=this._findWhitespaceIndex(l.id);c!==-1&&this._removeWhitespace(c)}return}const r=new Set;for(const l of n)r.add(l.id);const o=new Map;for(const l of t)o.set(l.id,l);const s=l=>{const c=[];for(const u of l)if(!r.has(u.id)){if(o.has(u.id)){const d=o.get(u.id);u.afterLineNumber=d.newAfterLineNumber,u.height=d.newHeight}c.push(u)}return c},a=s(this._arr).concat(s(e));a.sort((l,c)=>l.afterLineNumber===c.afterLineNumber?l.ordinal-c.ordinal:l.afterLineNumber-c.afterLineNumber),this._arr=a,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){const t=eV.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 n=0,r=t.length;nt&&(this._arr[n].afterLineNumber-=t-e+1)}}onLinesInserted(e,t){this._checkPendingChanges(),e=e|0,t=t|0,this._lineCount+=t-e+1;for(let n=0,r=this._arr.length;n=t.length||t[a+1].afterLineNumber>=e)return a;n=a+1|0}else r=a-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e=e|0;const n=this._findLastWhitespaceBeforeLineNumber(e)+1;return n1?n=this._lineHeight*(e-1):n=0;const r=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0));return n+r+this._paddingTop}getVerticalOffsetAfterLineNumber(e,t=!1){this._checkPendingChanges(),e=e|0;const n=this._lineHeight*e,r=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0));return n+r+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),this._minWidth===-1){let e=0;for(let t=0,n=this._arr.length;tt}isInTopPadding(e){return this._paddingTop===0?!1:(this._checkPendingChanges(),e=t-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),e=e|0,e<0)return 1;const t=this._lineCount|0,n=this._lineHeight;let r=1,o=t;for(;r=a+n)r=s+1;else{if(e>=a)return s;o=s}}return r>t?t:r}getLinesViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const n=this._lineHeight,r=this.getLineNumberAtOrAfterVerticalOffset(e)|0,o=this.getVerticalOffsetForLineNumber(r)|0;let s=this._lineCount|0,a=this.getFirstWhitespaceIndexAfterLineNumber(r)|0;const l=this.getWhitespacesCount()|0;let c,u;a===-1?(a=l,u=s+1,c=0):(u=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);let d=o,h=d;const f=5e5;let g=0;o>=f&&(g=Math.floor(o/f)*f,g=Math.floor(g/n)*n,h-=g);const p=[],v=e+(t-e)/2;let m=-1;for(let L=r;L<=s;L++){if(m===-1){const E=d,D=d+n;(E<=v&&vv)&&(m=L)}for(d+=n,p[L-r]=h,h+=n;u===L;)h+=c,d+=c,a++,a>=l?u=s+1:(u=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);if(d>=t){s=L;break}}m===-1&&(m=s);const _=this.getVerticalOffsetForLineNumber(s)|0;let y=r,S=s;return yt&&S--,{bigNumbersDelta:g,startLineNumber:r,endLineNumber:s,relativeVerticalOffset:p,centeredLineNumber:m,completelyVisibleStartLineNumber:y,completelyVisibleEndLineNumber:S}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e=e|0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let n;t>=1?n=this._lineHeight*t:n=0;let r;return e>0?r=this.getWhitespacesAccumulatedHeight(e-1):r=0,n+r+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e=e|0;let t=0,n=this.getWhitespacesCount()-1;if(n<0)return-1;const r=this.getVerticalOffsetForWhitespaceIndex(n),o=this.getHeightForWhitespaceIndex(n);if(e>=r+o)return-1;for(;t=a+l)t=s+1;else{if(e>=a)return s;n=s}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e=e|0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0||t>=this.getWhitespacesCount())return null;const n=this.getVerticalOffsetForWhitespaceIndex(t);if(n>e)return null;const r=this.getHeightForWhitespaceIndex(t),o=this.getIdForWhitespaceIndex(t),s=this.getAfterLineNumberForWhitespaceIndex(t);return{id:o,afterLineNumber:s,verticalOffset:n,height:r}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const n=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),r=this.getWhitespacesCount()-1;if(n<0)return[];const o=[];for(let s=n;s<=r;s++){const a=this.getVerticalOffsetForWhitespaceIndex(s),l=this.getHeightForWhitespaceIndex(s);if(a>=t)break;o.push({id:this.getIdForWhitespaceIndex(s),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(s),verticalOffset:a,height:l})}return o}getWhitespaces(){return this._checkPendingChanges(),this._arr.slice(0)}getWhitespacesCount(){return this._checkPendingChanges(),this._arr.length}getIdForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].height}};l_e.INSTANCE_COUNT=0;const XUe=125;class AL{constructor(e,t,n,r){e=e|0,t=t|0,n=n|0,r=r|0,e<0&&(e=0),t<0&&(t=0),n<0&&(n=0),r<0&&(r=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=n,this.contentHeight=r,this.scrollHeight=Math.max(n,r)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class YUe extends fe{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new se),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new AL(0,0,0,0),this._scrollable=this._register(new TS({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 n=t.contentWidth!==e.contentWidth,r=t.contentHeight!==e.contentHeight;(n||r)&&this._onDidContentSizeChange.fire(new bX(t.contentWidth,t.contentHeight,e.contentWidth,e.contentHeight))}getFutureScrollPosition(){return this._scrollable.getFutureScrollPosition()}getCurrentScrollPosition(){return this._scrollable.getCurrentScrollPosition()}setScrollPositionNow(e){this._scrollable.setScrollPositionNow(e)}setScrollPositionSmooth(e){this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}}class ZUe extends fe{constructor(e,t,n){super(),this._configuration=e;const r=this._configuration.options,o=r.get(144),s=r.get(84);this._linesLayout=new l_e(t,r.get(67),s.top,s.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new YUe(0,n)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new AL(o.contentWidth,0,o.height,0)),this.onDidScroll=this._scrollable.onDidScroll,this.onDidContentSizeChange=this._scrollable.onDidContentSizeChange,this._updateHeight()}dispose(){super.dispose()}getScrollable(){return this._scrollable.getScrollable()}onHeightMaybeChanged(){this._updateHeight()}_configureSmoothScrollDuration(){this._scrollable.setSmoothScrollDuration(this._configuration.options.get(114)?XUe:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(67)&&this._linesLayout.setLineHeight(t.get(67)),e.hasChanged(84)){const n=t.get(84);this._linesLayout.setPadding(n.top,n.bottom)}if(e.hasChanged(144)){const n=t.get(144),r=n.contentWidth,o=n.height,s=this._scrollable.getScrollDimensions(),a=s.contentWidth;this._scrollable.setScrollDimensions(new AL(r,s.contentWidth,o,this._getContentHeight(r,o,a)))}else this._updateHeight();e.hasChanged(114)&&this._configureSmoothScrollDuration()}onFlushed(e){this._linesLayout.onFlushed(e)}onLinesDeleted(e,t){this._linesLayout.onLinesDeleted(e,t)}onLinesInserted(e,t){this._linesLayout.onLinesInserted(e,t)}_getHorizontalScrollbarHeight(e,t){const r=this._configuration.options.get(103);return r.horizontal===2||e>=t?0:r.horizontalScrollbarSize}_getContentHeight(e,t,n){const r=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return r.get(105)?o+=Math.max(0,t-r.get(67)-r.get(84).bottom):r.get(103).ignoreHorizontalScrollbarInContentHeight||(o+=this._getHorizontalScrollbarHeight(e,n)),o}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,n=e.height,r=e.contentWidth;this._scrollable.setScrollDimensions(new AL(t,e.contentWidth,n,this._getContentHeight(t,n,r)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new Qie(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new Qie(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){const e=this._configuration.options,t=this._maxLineWidth,n=e.get(145),r=e.get(50),o=e.get(144);if(n.isViewportWrapping){const s=e.get(73);return t>o.contentWidth+r.typicalHalfwidthCharacterWidth&&s.enabled&&s.side==="right"?t+o.verticalScrollbarWidth:t}else{const s=e.get(104)*r.typicalHalfwidthCharacterWidth,a=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+s+o.verticalScrollbarWidth,a,this._overlayWidgetsMinWidth)}}setMaxLineWidth(e){this._maxLineWidth=e,this._updateContentWidth()}setOverlayWidgetsMinWidth(e){this._overlayWidgetsMinWidth=e,this._updateContentWidth()}_updateContentWidth(){const e=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new AL(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,n=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t),r=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(n);return{scrollTop:t,scrollTopWithoutViewZones:t-r,scrollLeft:e.scrollLeft}}changeWhitespace(e){const t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetAfterLineNumber(e,t)}isAfterLines(e){return this._linesLayout.isAfterLines(e)}isInTopPadding(e){return this._linesLayout.isInTopPadding(e)}isInBottomPadding(e){return this._linesLayout.isInBottomPadding(e)}getLineNumberAtVerticalOffset(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)}getWhitespaceAtVerticalOffset(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)}getLinesViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)}getLinesViewportDataAtScrollTop(e){const t=this._scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)}getWhitespaceViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)}getWhitespaces(){return this._linesLayout.getWhitespaces()}getContentWidth(){return this._scrollable.getScrollDimensions().contentWidth}getScrollWidth(){return this._scrollable.getScrollDimensions().scrollWidth}getContentHeight(){return this._scrollable.getScrollDimensions().contentHeight}getScrollHeight(){return this._scrollable.getScrollDimensions().scrollHeight}getCurrentScrollLeft(){return this._scrollable.getCurrentScrollPosition().scrollLeft}getCurrentScrollTop(){return this._scrollable.getCurrentScrollPosition().scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,t){t===1?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}deltaScrollNow(e,t){const n=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:n.scrollLeft+e,scrollTop:n.scrollTop+t})}}class QUe{constructor(e,t,n,r,o){this.editorId=e,this.model=t,this.configuration=n,this._linesCollection=r,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 n=this._decorationsCache[t];if(!n){const r=e.range,o=e.options;let s;if(o.isWholeLine){const a=this._coordinatesConverter.convertModelPositionToViewPosition(new ae(r.startLineNumber,1),0,!1,!0),l=this._coordinatesConverter.convertModelPositionToViewPosition(new ae(r.endLineNumber,this.model.getLineMaxColumn(r.endLineNumber)),1);s=new B(a.lineNumber,a.column,l.lineNumber,l.column)}else s=this._coordinatesConverter.convertModelRangeToViewRange(r,1);n=new Gme(s,o),this._decorationsCache[t]=n}return n}getMinimapDecorationsInRange(e){return this._getDecorationsInRange(e,!0,!1).decorations}getDecorationsViewportData(e){let t=this._cachedModelDecorationsResolver!==null;return t=t&&e.equalsRange(this._cachedModelDecorationsResolverViewRange),t||(this._cachedModelDecorationsResolver=this._getDecorationsInRange(e,!1,!1),this._cachedModelDecorationsResolverViewRange=e),this._cachedModelDecorationsResolver}getInlineDecorationsOnLine(e,t=!1,n=!1){const r=new B(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(r,t,n).inlineDecorations[0]}_getDecorationsInRange(e,t,n){const r=this._linesCollection.getDecorationsInRange(e,this.editorId,MA(this.configuration.options),t,n),o=e.startLineNumber,s=e.endLineNumber,a=[];let l=0;const c=[];for(let u=o;u<=s;u++)c[u-o]=[];for(let u=0,d=r.length;ut===1)}function xX(i,e){return c_e(i,e.range,t=>t===2)}function c_e(i,e,t){for(let n=e.startLineNumber;n<=e.endLineNumber;n++){const r=i.tokenization.getLineTokens(n),o=n===e.startLineNumber,s=n===e.endLineNumber;let a=o?r.findTokenIndexAtOffset(e.startColumn-1):0;for(;ae.endColumn-1);){if(!t(r.getStandardTokenType(a)))return!1;a++}}return!0}function j6(i,e){return i===null?e?CP.INSTANCE:yP.INSTANCE:new JUe(i,e)}class JUe{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,n){this._assertVisible();const r=n>0?this._projectionData.breakOffsets[n-1]:0,o=this._projectionData.breakOffsets[n];let s;if(this._projectionData.injectionOffsets!==null){const a=this._projectionData.injectionOffsets.map((c,u)=>new gh(0,0,c+1,this._projectionData.injectionOptions[u],0));s=gh.applyInjectedText(e.getLineContent(t),a).substring(r,o)}else s=e.getValueInRange({startLineNumber:t,startColumn:r+1,endLineNumber:t,endColumn:o+1});return n>0&&(s=hoe(this._projectionData.wrappedTextIndentLength)+s),s}getViewLineLength(e,t,n){return this._assertVisible(),this._projectionData.getLineLength(n)}getViewLineMinColumn(e,t,n){return this._assertVisible(),this._projectionData.getMinOutputOffset(n)+1}getViewLineMaxColumn(e,t,n){return this._assertVisible(),this._projectionData.getMaxOutputOffset(n)+1}getViewLineData(e,t,n){const r=new Array;return this.getViewLinesData(e,t,n,1,0,[!0],r),r[0]}getViewLinesData(e,t,n,r,o,s,a){this._assertVisible();const l=this._projectionData,c=l.injectionOffsets,u=l.injectionOptions;let d=null;if(c){d=[];let f=0,g=0;for(let p=0;p0?l.breakOffsets[p-1]:0,_=l.breakOffsets[p];for(;g_)break;if(m0?l.wrappedTextIndentLength:0,k=D+Math.max(S-m,0),T=D+Math.min(L-m,_-m);k!==T&&v.push(new a7e(k,T,E.inlineClassName,E.inlineClassNameAffectsLetterSpacing))}}if(L<=_)f+=y,g++;else break}}}let h;c?h=e.tokenization.getLineTokens(t).withInserted(c.map((f,g)=>({offset:f,text:u[g].content,tokenMetadata:Lo.defaultTokenMetadata}))):h=e.tokenization.getLineTokens(t);for(let f=n;f0?r.wrappedTextIndentLength:0,s=n>0?r.breakOffsets[n-1]:0,a=r.breakOffsets[n],l=e.sliceAndInflate(s,a,o);let c=l.getLineContent();n>0&&(c=hoe(r.wrappedTextIndentLength)+c);const u=this._projectionData.getMinOutputOffset(n)+1,d=c.length+1,h=n+1=K6.length)for(let e=1;e<=i;e++)K6[e]=eje(e);return K6[i]}function eje(i){return new Array(i+1).join(" ")}class tje{constructor(e,t,n,r,o,s,a,l,c,u){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=n,this._monospaceLineBreaksComputerFactory=r,this.fontInfo=o,this.tabSize=s,this.wrappingStrategy=a,this.wrappingColumn=l,this.wrappingIndent=c,this.wordBreak=u,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new ije(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));const n=this.model.getLinesContent(),r=this.model.getInjectedTextDecorations(this._editorId),o=n.length,s=this.createLineBreaksComputer(),a=new Ep(gh.fromDecorations(r));for(let p=0;pm.lineNumber===p+1);s.addRequest(n[p],v,t?t[p]:null)}const l=s.finalize(),c=[],u=this.hiddenAreasDecorationIds.map(p=>this.model.getDecorationRange(p)).sort(B.compareRangesUsingStarts);let d=1,h=0,f=-1,g=f+1=d&&v<=h,_=j6(l[p],!m);c[p]=_.getViewLineCount(),this.modelLineProjections[p]=_}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new V6e(c)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){const t=e.map(h=>this.model.validateRange(h)),n=nje(t),r=this.hiddenAreasDecorationIds.map(h=>this.model.getDecorationRange(h)).sort(B.compareRangesUsingStarts);if(n.length===r.length){let h=!1;for(let f=0;f({range:h,options:sn.EMPTY}));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,o);const s=n;let a=1,l=0,c=-1,u=c+1=a&&f<=l?this.modelLineProjections[h].isVisible()&&(this.modelLineProjections[h]=this.modelLineProjections[h].setVisible(!1),g=!0):(d=!0,this.modelLineProjections[h].isVisible()||(this.modelLineProjections[h]=this.modelLineProjections[h].setVisible(!0),g=!0)),g){const p=this.modelLineProjections[h].getViewLineCount();this.projectedModelLineLineCounts.setValue(h,p)}}return d||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return e<1||e>this.modelLineProjections.length?!1:this.modelLineProjections[e-1].isVisible()}getModelLineViewLineCount(e){return e<1||e>this.modelLineProjections.length?1:this.modelLineProjections[e-1].getViewLineCount()}setTabSize(e){return this.tabSize===e?!1:(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,n,r,o){const s=this.fontInfo.equals(e),a=this.wrappingStrategy===t,l=this.wrappingColumn===n,c=this.wrappingIndent===r,u=this.wordBreak===o;if(s&&a&&l&&c&&u)return!1;const d=s&&a&&!l&&c&&u;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=n,this.wrappingIndent=r,this.wordBreak=o;let h=null;if(d){h=[];for(let f=0,g=this.modelLineProjections.length;f2&&!this.modelLineProjections[t-2].isVisible(),s=t===1?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1;let a=0;const l=[],c=[];for(let u=0,d=r.length;ul?(u=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,d=u+l-1,g=d+1,p=g+(o-l)-1,c=!0):ot?t:e|0}getActiveIndentGuide(e,t,n){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),n=this._toValidViewLineNumber(n);const r=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),s=this.convertViewPositionToModelPosition(n,this.getViewLineMinColumn(n)),a=this.model.guides.getActiveIndentGuide(r.lineNumber,o.lineNumber,s.lineNumber),l=this.convertModelPositionToViewPosition(a.startLineNumber,1),c=this.convertModelPositionToViewPosition(a.endLineNumber,this.model.getLineMaxColumn(a.endLineNumber));return{startLineNumber:l.lineNumber,endLineNumber:c.lineNumber,indent:a.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);const t=this.projectedModelLineLineCounts.getIndexOf(e-1),n=t.index,r=t.remainder;return new foe(n+1,r)}getMinColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getMaxColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getModelStartPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],n=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),r=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,n);return new ae(e.modelLineNumber,r)}getModelEndPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],n=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),r=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,n);return new ae(e.modelLineNumber,r)}getViewLineInfosGroupedByModelRanges(e,t){const n=this.getViewLineInfo(e),r=this.getViewLineInfo(t),o=new Array;let s=this.getModelStartPositionOfViewLine(n),a=new Array;for(let l=n.modelLineNumber;l<=r.modelLineNumber;l++){const c=this.modelLineProjections[l-1];if(c.isVisible()){const u=l===n.modelLineNumber?n.modelLineWrappedLineIdx:0,d=l===r.modelLineNumber?r.modelLineWrappedLineIdx+1:c.getViewLineCount();for(let h=u;h{if(f.forWrappedLinesAfterColumn!==-1&&this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesAfterColumn).lineNumber>=u.modelLineWrappedLineIdx||f.forWrappedLinesBeforeOrAtColumn!==-1&&this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesBeforeOrAtColumn).lineNumberu.modelLineWrappedLineIdx)return}const p=this.convertModelPositionToViewPosition(u.modelLineNumber,f.horizontalLine.endColumn),v=this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,f.horizontalLine.endColumn);return v.lineNumber===u.modelLineWrappedLineIdx?new z0(f.visibleColumn,g,f.className,new pE(f.horizontalLine.top,p.column),-1,-1):v.lineNumber!!f))}}return s}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const n=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),r=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let o=[];const s=[],a=[],l=n.lineNumber-1,c=r.lineNumber-1;let u=null;for(let g=l;g<=c;g++){const p=this.modelLineProjections[g];if(p.isVisible()){const v=p.getViewLineNumberOfModelPosition(0,g===l?n.column:1),m=p.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(g+1)),_=m-v+1;let y=0;_>1&&p.getViewLineMinColumn(this.model,g+1,m)===1&&(y=v===0?1:2),s.push(_),a.push(y),u===null&&(u=new ae(g+1,0))}else u!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(u.lineNumber,g)),u=null)}u!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(u.lineNumber,r.lineNumber)),u=null);const d=t-e+1,h=new Array(d);let f=0;for(let g=0,p=o.length;gt&&(g=!0,f=t-o+1),d.getViewLinesData(this.model,c+1,h,f,o-e,n,l),o+=f,g)break}return l}validateViewPosition(e,t,n){e=this._toValidViewLineNumber(e);const r=this.projectedModelLineLineCounts.getIndexOf(e-1),o=r.index,s=r.remainder,a=this.modelLineProjections[o],l=a.getViewLineMinColumn(this.model,o+1,s),c=a.getViewLineMaxColumn(this.model,o+1,s);tc&&(t=c);const u=a.getModelColumnOfViewPosition(s,t);return this.model.validatePosition(new ae(o+1,u)).equals(n)?new ae(e,t):this.convertModelPositionToViewPosition(n.lineNumber,n.column)}validateViewRange(e,t){const n=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),r=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new B(n.lineNumber,n.column,r.lineNumber,r.column)}convertViewPositionToModelPosition(e,t){const n=this.getViewLineInfo(e),r=this.modelLineProjections[n.modelLineNumber-1].getModelColumnOfViewPosition(n.modelLineWrappedLineIdx,t);return this.model.validatePosition(new ae(n.modelLineNumber,r))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),n=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new B(t.lineNumber,t.column,n.lineNumber,n.column)}convertModelPositionToViewPosition(e,t,n=2,r=!1,o=!1){const s=this.model.validatePosition(new ae(e,t)),a=s.lineNumber,l=s.column;let c=a-1,u=!1;if(o)for(;c0&&!this.modelLineProjections[c].isVisible();)c--,u=!0;if(c===0&&!this.modelLineProjections[c].isVisible())return new ae(r?0:1,1);const d=1+this.projectedModelLineLineCounts.getPrefixSum(c);let h;return u?o?h=this.modelLineProjections[c].getViewPositionOfModelPosition(d,1,n):h=this.modelLineProjections[c].getViewPositionOfModelPosition(d,this.model.getLineMaxColumn(c+1),n):h=this.modelLineProjections[a-1].getViewPositionOfModelPosition(d,l,n),h}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){const n=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return B.fromPositions(n)}else{const n=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),r=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new B(n.lineNumber,n.column,r.lineNumber,r.column)}}getViewLineNumberOfModelPosition(e,t){let n=e-1;if(this.modelLineProjections[n].isVisible()){const o=1+this.projectedModelLineLineCounts.getPrefixSum(n);return this.modelLineProjections[n].getViewLineNumberOfModelPosition(o,t)}for(;n>0&&!this.modelLineProjections[n].isVisible();)n--;if(n===0&&!this.modelLineProjections[n].isVisible())return 1;const r=1+this.projectedModelLineLineCounts.getPrefixSum(n);return this.modelLineProjections[n].getViewLineNumberOfModelPosition(r,this.model.getLineMaxColumn(n+1))}getDecorationsInRange(e,t,n,r,o){const s=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),a=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(a.lineNumber-s.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new B(s.lineNumber,1,a.lineNumber,a.column),t,n,r,o);let l=[];const c=s.lineNumber-1,u=a.lineNumber-1;let d=null;for(let p=c;p<=u;p++)if(this.modelLineProjections[p].isVisible())d===null&&(d=new ae(p+1,p===c?s.column:1));else if(d!==null){const m=this.model.getLineMaxColumn(p);l=l.concat(this.model.getDecorationsInRange(new B(d.lineNumber,d.column,p,m),t,n,r)),d=null}d!==null&&(l=l.concat(this.model.getDecorationsInRange(new B(d.lineNumber,d.column,a.lineNumber,a.column),t,n,r)),d=null),l.sort((p,v)=>{const m=B.compareRangesUsingStarts(p.range,v.range);return m===0?p.idv.id?1:0:m});const h=[];let f=0,g=null;for(const p of l){const v=p.id;g!==v&&(g=v,h[f++]=p)}return h}getInjectedTextAt(e){const t=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[t.modelLineNumber-1].getInjectedTextAt(t.modelLineWrappedLineIdx,e.column)}normalizePosition(e,t){const n=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[n.modelLineNumber-1].normalizePosition(n.modelLineWrappedLineIdx,e,t)}getLineIndentColumn(e){const t=this.getViewLineInfo(e);return t.modelLineWrappedLineIdx===0?this.model.getLineIndentColumn(t.modelLineNumber):0}}function nje(i){if(i.length===0)return[];const e=i.slice();e.sort(B.compareRangesUsingStarts);const t=[];let n=e[0].startLineNumber,r=e[0].endLineNumber;for(let o=1,s=e.length;or+1?(t.push(new B(n,1,r,1)),n=a.startLineNumber,r=a.endLineNumber):a.endLineNumber>r&&(r=a.endLineNumber)}return t.push(new B(n,1,r,1)),t}class foe{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class goe{constructor(e,t){this.modelRange=e,this.viewLines=t}}class ije{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,n,r){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t,n,r)}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 rje{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new oje(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,n,r){return!1}createLineBreaksComputer(){const e=[];return{addRequest:(t,n,r)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,n){return new QH(t,n)}onModelLinesInserted(e,t,n,r){return new JH(t,n)}onModelLineChanged(e,t,n){return[!1,new a_e(t,1),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,n){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,n){return new Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){const n=t-e+1,r=new Array(n);for(let o=0;ot)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}const e0=$f.Right;class sje{constructor(e){this.persist=0,this._requiredLanes=1,this.lanes=new Uint8Array(Math.ceil((e+1)*e0/8))}reset(e){const t=Math.ceil((e+1)*e0/8);this.lanes.length>>3]|=1<>>3]&1<>>3]&1<this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=LX.create(this.model),this.glyphLanes=new sje(0),this.model.isTooLargeForTokenization())this._lines=new rje(this.model);else{const u=this._configuration.options,d=u.get(50),h=u.get(138),f=u.get(145),g=u.get(137),p=u.get(129);this._lines=new tje(this._editorId,this.model,r,o,d,this.model.getOptions().tabSize,h,f.wrappingColumn,g,p)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new VUe(n,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new ZUe(this._configuration,this.getLineCount(),s)),this._register(this.viewLayout.onDidScroll(u=>{u.scrollTopChanged&&this._handleVisibleLinesChanged(),u.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new EUe(u)),this._eventDispatcher.emitOutgoingEvent(new yX(u.oldScrollWidth,u.oldScrollLeft,u.oldScrollHeight,u.oldScrollTop,u.scrollWidth,u.scrollLeft,u.scrollHeight,u.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(u=>{this._eventDispatcher.emitOutgoingEvent(u)})),this._decorations=new QUe(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(u=>{try{const d=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(d,u)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(jk.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new kUe)})),this._register(this._themeService.onDidColorThemeChange(u=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new DUe(u))})),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this._viewportStart.dispose(),this._eventDispatcher.dispose()}createLineBreaksComputer(){return this._lines.createLineBreaksComputer()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}getModelVisibleRanges(){const e=this.viewLayout.getLinesViewportData(),t=new B(e.startLineNumber,this.getLineMinColumn(e.startLineNumber),e.endLineNumber,this.getLineMaxColumn(e.endLineNumber));return this._toModelVisibleRanges(t)}visibleLinesStabilized(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!0)}_handleVisibleLinesChanged(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!1)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new xUe(e)),this._eventDispatcher.emitOutgoingEvent(new CX(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new CUe)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new yUe)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new ae(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new moe(t,this._viewportStart.startLineDelta)}return new moe(null,0)}_onConfigurationChanged(e,t){const n=this._captureStableViewport(),r=this._configuration.options,o=r.get(50),s=r.get(138),a=r.get(145),l=r.get(137),c=r.get(129);this._lines.setWrappingSettings(o,s,a.wrappingColumn,l,c)&&(e.emitViewEvent(new xR),e.emitViewEvent(new LR),e.emitViewEvent(new J_(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(91)&&(this._decorations.reset(),e.emitViewEvent(new J_(null))),t.hasChanged(98)&&(this._decorations.reset(),e.emitViewEvent(new J_(null))),e.emitViewEvent(new wUe(t)),this.viewLayout.onConfigurationChanged(t),n.recoverViewportStart(this.coordinatesConverter,this.viewLayout),YC.shouldRecreate(t)&&(this.cursorConfig=new YC(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText(e=>{try{const n=this._eventDispatcher.beginEmitViewEvents();let r=!1,o=!1;const s=e instanceof sb?e.rawContentChangedEvent.changes:e.changes,a=e instanceof sb?e.rawContentChangedEvent.versionId:null,l=this._lines.createLineBreaksComputer();for(const d of s)switch(d.changeType){case 4:{for(let h=0;h!p.ownerId||p.ownerId===this._editorId)),l.addRequest(f,g,null)}break}case 2:{let h=null;d.injectedText&&(h=d.injectedText.filter(f=>!f.ownerId||f.ownerId===this._editorId)),l.addRequest(d.detail,h,null);break}}const c=l.finalize(),u=new Ep(c);for(const d of s)switch(d.changeType){case 1:{this._lines.onModelFlushed(),n.emitViewEvent(new xR),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),r=!0;break}case 3:{const h=this._lines.onModelLinesDeleted(a,d.fromLineNumber,d.toLineNumber);h!==null&&(n.emitViewEvent(h),this.viewLayout.onLinesDeleted(h.fromLineNumber,h.toLineNumber)),r=!0;break}case 4:{const h=u.takeCount(d.detail.length),f=this._lines.onModelLinesInserted(a,d.fromLineNumber,d.toLineNumber,h);f!==null&&(n.emitViewEvent(f),this.viewLayout.onLinesInserted(f.fromLineNumber,f.toLineNumber)),r=!0;break}case 2:{const h=u.dequeue(),[f,g,p,v]=this._lines.onModelLineChanged(a,d.lineNumber,h);o=f,g&&n.emitViewEvent(g),p&&(n.emitViewEvent(p),this.viewLayout.onLinesInserted(p.fromLineNumber,p.toLineNumber)),v&&(n.emitViewEvent(v),this.viewLayout.onLinesDeleted(v.fromLineNumber,v.toLineNumber));break}case 5:break}a!==null&&this._lines.acceptVersionId(a),this.viewLayout.onHeightMaybeChanged(),!r&&o&&(n.emitViewEvent(new LR),n.emitViewEvent(new J_(null)),this._cursor.onLineMappingChanged(n),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}const t=this._viewportStart.isValid;if(this._viewportStart.invalidate(),this._configuration.setModelLineCount(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&t){const n=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(n){const r=this.coordinatesConverter.convertModelPositionToViewPosition(n.getStartPosition()),o=this.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber);this.viewLayout.setScrollPosition({scrollTop:o+this._viewportStart.startLineDelta},1)}}try{const n=this._eventDispatcher.beginEmitViewEvents();e instanceof sb&&n.emitOutgoingEvent(new WUe(e.contentChangedEvent)),this._cursor.onModelContentChanged(n,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._handleVisibleLinesChanged()})),this._register(this.model.onDidChangeTokens(e=>{const t=[];for(let n=0,r=e.ranges.length;n{this._eventDispatcher.emitSingleViewEvent(new LUe),this.cursorConfig=new YC(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new BUe(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new YC(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new FUe(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const t=this._eventDispatcher.beginEmitViewEvents();t.emitViewEvent(new xR),t.emitViewEvent(new LR),t.emitViewEvent(new J_(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new YC(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new $Ue(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new J_(e)),this._eventDispatcher.emitOutgoingEvent(new OUe(e))}))}setHiddenAreas(e,t){var n;this.hiddenAreasModel.setHiddenAreas(t,e);const r=this.hiddenAreasModel.getMergedRanges();if(r===this.previousHiddenAreas)return;this.previousHiddenAreas=r;const o=this._captureStableViewport();let s=!1;try{const a=this._eventDispatcher.beginEmitViewEvents();s=this._lines.setHiddenAreas(r),s&&(a.emitViewEvent(new xR),a.emitViewEvent(new LR),a.emitViewEvent(new J_(null)),this._cursor.onLineMappingChanged(a),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged());const l=(n=o.viewportStartModelPosition)===null||n===void 0?void 0:n.lineNumber;l&&r.some(u=>u.startLineNumber<=l&&l<=u.endLineNumber)||o.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),s&&this._eventDispatcher.emitOutgoingEvent(new AUe)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(144),t=this._configuration.options.get(67),n=Math.max(20,Math.round(e.height/t)),r=this.viewLayout.getLinesViewportData(),o=Math.max(1,r.completelyVisibleStartLineNumber-n),s=Math.min(this.getLineCount(),r.completelyVisibleEndLineNumber+n);return this._toModelVisibleRanges(new B(o,this.getLineMinColumn(o),s,this.getLineMaxColumn(s)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}getHiddenAreas(){return this._lines.getHiddenAreas()}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),n=this._lines.getHiddenAreas();if(n.length===0)return[t];const r=[];let o=0,s=t.startLineNumber,a=t.startColumn;const l=t.endLineNumber,c=t.endColumn;for(let u=0,d=n.length;ul||(s"u")return this._reduceRestoreStateCompatibility(e);const t=this.model.validatePosition(e.firstPosition),n=this.coordinatesConverter.convertModelPositionToViewPosition(t),r=this.viewLayout.getVerticalOffsetForLineNumber(n.lineNumber)-e.firstPositionDeltaTop;return{scrollLeft:e.scrollLeft,scrollTop:r}}_reduceRestoreStateCompatibility(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTopWithoutViewZones}}getTabSize(){return this.model.getOptions().tabSize}getLineCount(){return this._lines.getViewLineCount()}setViewport(e,t,n){this._viewportStart.update(this,e)}getActiveIndentGuide(e,t,n){return this._lines.getActiveIndentGuide(e,t,n)}getLinesIndentGuides(e,t){return this._lines.getViewLinesIndentGuides(e,t)}getBracketGuidesInRangeByLine(e,t,n,r){return this._lines.getViewLinesBracketGuides(e,t,n,r)}getLineContent(e){return this._lines.getViewLineContent(e)}getLineLength(e){return this._lines.getViewLineLength(e)}getLineMinColumn(e){return this._lines.getViewLineMinColumn(e)}getLineMaxColumn(e){return this._lines.getViewLineMaxColumn(e)}getLineFirstNonWhitespaceColumn(e){const t=Ys(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=th(this.getLineContent(e));return t===-1?0:t+2}getMinimapDecorationsInRange(e){return this._decorations.getMinimapDecorationsInRange(e)}getDecorationsInViewport(e){return this._decorations.getDecorationsViewportData(e).decorations}getInjectedTextAt(e){return this._lines.getInjectedTextAt(e)}getViewportViewLineRenderingData(e,t){const r=this._decorations.getDecorationsViewportData(e).inlineDecorations[t-e.startLineNumber];return this._getViewLineRenderingData(t,r)}getViewLineRenderingData(e){const t=this._decorations.getInlineDecorationsOnLine(e);return this._getViewLineRenderingData(e,t)}_getViewLineRenderingData(e,t){const n=this.model.mightContainRTL(),r=this.model.mightContainNonBasicASCII(),o=this.getTabSize(),s=this._lines.getViewLineData(e);return s.inlineDecorations&&(t=[...t,...s.inlineDecorations.map(a=>a.toInlineDecoration(e))]),new vc(s.minColumn,s.maxColumn,s.content,s.continuesWithWrappedLine,n,r,s.tokens,t,o,s.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,n){const r=this._lines.getViewLinesData(e,t,n);return new s7e(this.getTabSize(),r)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,MA(this._configuration.options)),n=new lje;for(const r of t){const o=r.options,s=o.overviewRuler;if(!s)continue;const a=s.position;if(a===0)continue;const l=s.getColor(e.value),c=this.coordinatesConverter.getViewLineNumberOfModelPosition(r.range.startLineNumber,r.range.startColumn),u=this.coordinatesConverter.getViewLineNumberOfModelPosition(r.range.endLineNumber,r.range.endColumn);n.accept(l,o.zIndex,c,u,a)}return n.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e){const n=t.options.overviewRuler;n==null||n.invalidateCachedColor();const r=t.options.minimap;r==null||r.invalidateCachedColor()}}getValueInRange(e,t){const n=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(n,t)}getValueLengthInRange(e,t){const n=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueLengthInRange(n,t)}modifyPosition(e,t){const n=this.coordinatesConverter.convertViewPositionToModelPosition(e),r=this.model.modifyPosition(n,t);return this.coordinatesConverter.convertModelPositionToViewPosition(r)}deduceModelPositionRelativeToViewPosition(e,t,n){const r=this.coordinatesConverter.convertViewPositionToModelPosition(e);this.model.getEOL().length===2&&(t<0?t-=n:t+=n);const s=this.model.getOffsetAt(r)+t;return this.model.getPositionAt(s)}getPlainTextToCopy(e,t,n){const r=n?`\r -`:this.model.getEOL();e=e.slice(0),e.sort(B.compareRangesUsingStarts);let o=!1,s=!1;for(const l of e)l.isEmpty()?o=!0:s=!0;if(!s){if(!t)return"";const l=e.map(u=>u.startLineNumber);let c="";for(let u=0;u0&&l[u-1]===l[u]||(c+=this.model.getLineContent(l[u])+r);return c}if(o&&t){const l=[];let c=0;for(const u of e){const d=u.startLineNumber;u.isEmpty()?d!==c&&l.push(this.model.getLineContent(d)):l.push(this.model.getValueInRange(u,n?2:0)),c=d}return l.length===1?l[0]:l}const a=[];for(const l of e)l.isEmpty()||a.push(this.model.getValueInRange(l,n?2:0));return a.length===1?a[0]:a}getRichTextToCopy(e,t){const n=this.model.getLanguageId();if(n===hc||e.length!==1)return null;let r=e[0];if(r.isEmpty()){if(!t)return null;const u=r.startLineNumber;r=new B(u,this.model.getLineMinColumn(u),u,this.model.getLineMaxColumn(u))}const o=this._configuration.options.get(50),s=this._getColorMap(),l=/[:;\\\/<>]/.test(o.fontFamily)||o.fontFamily===Qa.fontFamily;let c;return l?c=Qa.fontFamily:(c=o.fontFamily,c=c.replace(/"/g,"'"),/[,']/.test(c)||/[+ ]/.test(c)&&(c=`'${c}'`),c=`${c}, ${Qa.fontFamily}`),{mode:n,html:`
`+this._getHTMLToCopy(r,s)+"
"}}_getHTMLToCopy(e,t){const n=e.startLineNumber,r=e.startColumn,o=e.endLineNumber,s=e.endColumn,a=this.getTabSize();let l="";for(let c=n;c<=o;c++){const u=this.model.tokenization.getLineTokens(c),d=u.getLineContent(),h=c===n?r-1:0,f=c===o?s-1:d.length;d===""?l+="
":l+=KUe(d,u.inflate(),t,h,f,a,Rs)}return l}_getColorMap(){const e=hr.getColorMap(),t=["#000000"];if(e)for(let n=1,r=e.length;nthis._cursor.setStates(r,e,t,n))}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,n=0){this._withViewEventsCollector(r=>this._cursor.setSelections(r,e,t,n))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector(t=>this._cursor.restoreState(t,e))}_executeCursorEdit(e){if(this._cursor.context.cursorConfig.readOnly){this._eventDispatcher.emitOutgoingEvent(new PUe);return}this._withViewEventsCollector(e)}executeEdits(e,t,n){this._executeCursorEdit(r=>this._cursor.executeEdits(r,e,t,n))}startComposition(){this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(n=>this._cursor.type(n,e,t))}compositionType(e,t,n,r,o){this._executeCursorEdit(s=>this._cursor.compositionType(s,e,t,n,r,o))}paste(e,t,n,r){this._executeCursorEdit(o=>this._cursor.paste(o,e,t,n,r))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(n=>this._cursor.executeCommand(n,e,t))}executeCommands(e,t){this._executeCursorEdit(n=>this._cursor.executeCommands(n,e,t))}revealPrimaryCursor(e,t,n=!1){this._withViewEventsCollector(r=>this._cursor.revealPrimary(r,e,n,0,t,0))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),n=new B(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(r=>r.emitViewEvent(new SM(e,!1,n,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),n=new B(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(r=>r.emitViewEvent(new SM(e,!1,n,null,0,!0,0)))}revealRange(e,t,n,r,o){this._withViewEventsCollector(s=>s.emitViewEvent(new SM(e,!1,n,null,r,t,o)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new TUe),this._eventDispatcher.emitOutgoingEvent(new MUe))}_withViewEventsCollector(e){try{const t=this._eventDispatcher.beginEmitViewEvents();return e(t)}finally{this._eventDispatcher.endEmitViewEvents()}}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}};class LX{static create(e){const t=e._setTrackedRange(null,new B(1,1,1,1),1);return new LX(e,1,!1,t,0)}get viewLineNumber(){return this._viewLineNumber}get isValid(){return this._isValid}get modelTrackedRange(){return this._modelTrackedRange}get startLineDelta(){return this._startLineDelta}constructor(e,t,n,r,o){this._model=e,this._viewLineNumber=t,this._isValid=n,this._modelTrackedRange=r,this._startLineDelta=o}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,1)}update(e,t){const n=e.coordinatesConverter.convertViewPositionToModelPosition(new ae(t,e.getLineMinColumn(t))),r=e.model._setTrackedRange(this._modelTrackedRange,new B(n.lineNumber,n.column,n.lineNumber,n.column),1),o=e.viewLayout.getVerticalOffsetForLineNumber(t),s=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=r,this._startLineDelta=s-o}invalidate(){this._isValid=!1}}class lje{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,n,r,o){const s=this._asMap[e];if(s){const a=s.data,l=a[a.length-3],c=a[a.length-1];if(l===o&&c+1>=n){r>c&&(a[a.length-1]=r);return}a.push(o,n,r)}else{const a=new OD(e,t,[o,n,r]);this._asMap[e]=a,this.asArray.push(a)}}}class cje{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const n=this.hiddenAreas.get(e);n&&poe(n,t)||(this.hiddenAreas.set(e,t),this.shouldRecompute=!0)}getMergedRanges(){if(!this.shouldRecompute)return this.ranges;this.shouldRecompute=!1;const e=Array.from(this.hiddenAreas.values()).reduce((t,n)=>uje(t,n),[]);return poe(this.ranges,e)?this.ranges:(this.ranges=e,this.ranges)}}function uje(i,e){const t=[];let n=0,r=0;for(;n=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},mg=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},m0;let fje=0,gje=class{constructor(e,t,n,r,o,s){this.model=e,this.viewModel=t,this.view=n,this.hasRealView=r,this.listenersToRemove=o,this.attachedView=s}dispose(){si(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}},$w=m0=class extends fe{get isSimpleWidget(){return this._configuration.isSimpleWidget}constructor(e,t,n,r,o,s,a,l,c,u,d,h){var f;super(),this.languageConfigurationService=d,this._deliveryQueue=n5e(),this._contributions=this._register(new UVe),this._onDidDispose=this._register(new se),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new se({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new se({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new se({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new se({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new se({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeModelTokens=this._register(new se({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new se({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onWillChangeModel=this._register(new se({deliveryQueue:this._deliveryQueue})),this.onWillChangeModel=this._onWillChangeModel.event,this._onDidChangeModel=this._register(new se({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new se({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new se({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new se({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new voe({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new voe({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new se({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new se({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new se({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new se({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection(),o.willCreateCodeEditor();const g={...t};this._domElement=e,this._overflowWidgetsDomNode=g.overflowWidgetsDomNode,delete g.overflowWidgetsDomNode,this._id=++fje,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=n.telemetryData,this._configuration=this._register(this._createConfiguration(n.isSimpleWidget||!1,g,u)),this._register(this._configuration.onDidChange(m=>{this._onDidChangeConfiguration.fire(m);const _=this._configuration.options;if(m.hasChanged(144)){const y=_.get(144);this._onDidLayoutChange.fire(y)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=c,this._codeEditorService=o,this._commandService=s,this._themeService=l,this._register(new pje(this,this._contextKeyService)),this._register(new mje(this,this._contextKeyService,h)),this._instantiationService=r.createChild(new Kk([Vt,this._contextKeyService])),this._modelData=null,this._focusTracker=new vje(e,this._overflowWidgetsDomNode),this._register(this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())})),this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={};let p;Array.isArray(n.contributions)?p=n.contributions:p=Ay.getEditorContributions(),this._contributions.initialize(this,p,this._instantiationService);for(const m of Ay.getEditorActions()){if(this._actions.has(m.id)){en(new Error(`Cannot have two actions with the same id ${m.id}`));continue}const _=new Wve(m.id,m.label,m.alias,m.metadata,(f=m.precondition)!==null&&f!==void 0?f:void 0,y=>this._instantiationService.invokeFunction(S=>Promise.resolve(m.runEditorCommand(S,this,y))),this._contextKeyService);this._actions.set(_.id,_)}const v=()=>!this._configuration.options.get(91)&&this._configuration.options.get(36).enabled;this._register(new h8e(this._domElement,{onDragOver:m=>{if(!v())return;const _=this.getTargetAtClientPoint(m.clientX,m.clientY);_!=null&&_.position&&this.showDropIndicatorAt(_.position)},onDrop:async m=>{if(!v()||(this.removeDropIndicator(),!m.dataTransfer))return;const _=this.getTargetAtClientPoint(m.clientX,m.clientY);_!=null&&_.position&&this._onDropIntoEditor.fire({position:_.position,event:m})},onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){var t;(t=this._modelData)===null||t===void 0||t.view.writeScreenReaderContent(e)}_createConfiguration(e,t,n){return new DH(e,t,this._domElement,n)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return Ok.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._focusTracker.dispose(),this._actions.clear(),this._contentWidgets={},this._overlayWidgets={},this._removeDecorationTypes(),this._postDetachModelCleanup(this._detachModel()),this._onDidDispose.fire(),super.dispose()}invokeWithinContext(e){return this._instantiationService.invokeFunction(e)}updateOptions(e){this._configuration.updateOptions(e||{})}getOptions(){return this._configuration.options}getOption(e){return this._configuration.options.get(e)}getRawOptions(){return this._configuration.getRawOptions()}getOverflowWidgetsDomNode(){return this._overflowWidgetsDomNode}getConfiguredWordAtPosition(e){return this._modelData?Zn.getWordAtPosition(this._modelData.model,this._configuration.options.get(130),e):null}getValue(e=null){if(!this._modelData)return"";const t=!!(e&&e.preserveBOM);let n=0;return e&&e.lineEnding&&e.lineEnding===` +`)){d=!1;break}}if(d){const h=new B(c,1,c,u);t.push(new y6(null,h,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,n,r)}_applyUndo(e,t,n,r){const o=e.map(s=>{const a=this.getPositionAt(s.newPosition),l=this.getPositionAt(s.newEnd);return{range:new B(a.lineNumber,a.column,l.lineNumber,l.column),text:s.oldText}});this._applyUndoRedoEdits(o,t,!0,!1,n,r)}_applyRedo(e,t,n,r){const o=e.map(s=>{const a=this.getPositionAt(s.oldPosition),l=this.getPositionAt(s.oldEnd);return{range:new B(a.lineNumber,a.column,l.lineNumber,l.column),text:s.newText}});this._applyUndoRedoEdits(o,t,!1,!0,n,r)}_applyUndoRedoEdits(e,t,n,r,o,s){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=n,this._isRedoing=r,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 n=this._validateEditOperations(e);return this._doApplyEdits(n,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){const n=this._buffer.getLineCount(),r=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),o=this._buffer.getLineCount(),s=r.changes;if(this._trimAutoWhitespaceLines=r.trimAutoWhitespaceLineNumbers,s.length!==0){for(let c=0,u=s.length;c=0;T--){const M=f+T,A=y+T;k.takeFromEndWhile(R=>R.lineNumber>A);const N=k.takeFromEndWhile(R=>R.lineNumber===A);a.push(new Bre(M,this.getLineContent(A),N))}if(mG.lineNumberG.lineNumber===H)}a.push(new WVe(M+1,f+v,F,R))}l+=_}this._emitContentChangedEvent(new zy(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:s,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return r.reverseEdits===null?void 0:r.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e){if(e===null||e.size===0)return;const n=Array.from(e).map(r=>new Bre(r,this.getLineContent(r),this._getInjectedTextInLine(r)));this._onDidChangeInjectedText.fire(new Bve(n))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const n={addDecoration:(o,s)=>this._deltaDecorationsImpl(e,[],[{range:o,options:s}])[0],changeDecoration:(o,s)=>{this._changeDecorationImpl(o,s)},changeDecorationOptions:(o,s)=>{this._changeDecorationOptionsImpl(o,ooe(s))},removeDecoration:o=>{this._deltaDecorationsImpl(e,[o],[])},deltaDecorations:(o,s)=>o.length===0&&s.length===0?[]:this._deltaDecorationsImpl(e,o,s)};let r=null;try{r=t(n)}catch(o){en(o)}return n.addDecoration=Hx,n.changeDecoration=Hx,n.changeDecorationOptions=Hx,n.removeDecoration=Hx,n.deltaDecorations=Hx,r}deltaDecorations(e,t,n=0){if(this._assertNotDisposed(),e||(e=[]),e.length===0&&t.length===0)return[];try{return this._deltaDecorationCallCnt++,this._deltaDecorationCallCnt>1&&(console.warn("Invoking deltaDecorations recursively could lead to leaking decorations."),en(new Error("Invoking deltaDecorations recursively could lead to leaking decorations."))),this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(n,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit(),this._deltaDecorationCallCnt--}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,n){const r=e?this._decorations[e]:null;if(!r)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:roe[n]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(r),delete this._decorations[r.id],null;const o=this._validateRangeRelaxedNoAllocations(t),s=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),a=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);return this._decorationsTree.delete(r),r.reset(this.getVersionId(),s,a,o),r.setOptions(roe[n]),this._decorationsTree.insert(r),r.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let n=0,r=t.length;nthis.getLineCount()?[]:this.getLinesDecorations(e,e,t,n)}getLinesDecorations(e,t,n=0,r=!1,o=!1){const s=this.getLineCount(),a=Math.min(s,Math.max(1,e)),l=Math.min(s,Math.max(1,t)),c=this.getLineMaxColumn(l),u=new B(a,1,l,c),d=this._getDecorationsInRange(u,n,r,o);return t$(d,this._decorationProvider.getDecorationsInRange(u,n,r)),d}getDecorationsInRange(e,t=0,n=!1,r=!1,o=!1){const s=this.validateRange(e),a=this._getDecorationsInRange(s,t,n,o);return t$(a,this._decorationProvider.getDecorationsInRange(s,t,n,r)),a}getOverviewRulerDecorations(e=0,t=!1){return this._decorationsTree.getAll(this,e,t,!0,!1)}getInjectedTextDecorations(e=0){return this._decorationsTree.getAllInjectedText(this,e)}_getInjectedTextInLine(e){const t=this._buffer.getOffsetAt(e,1),n=t+this._buffer.getLineLength(e),r=this._decorationsTree.getInjectedTextInInterval(this,t,n,0);return gh.fromDecorations(r).filter(o=>o.lineNumber===e)}getAllDecorations(e=0,t=!1){let n=this._decorationsTree.getAll(this,e,t,!1,!1);return n=n.concat(this._decorationProvider.getAllDecorations(e,t)),n}getAllMarginDecorations(e=0){return this._decorationsTree.getAll(this,e,!1,!1,!0)}_getDecorationsInRange(e,t,n,r){const o=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),s=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,o,s,t,n,r)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t){const n=this._decorations[e];if(!n)return;if(n.options.after){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.endLineNumber)}if(n.options.before){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.startLineNumber)}const r=this._validateRangeRelaxedNoAllocations(t),o=this._buffer.getOffsetAt(r.startLineNumber,r.startColumn),s=this._buffer.getOffsetAt(r.endLineNumber,r.endColumn);this._decorationsTree.delete(n),n.reset(this.getVersionId(),o,s,r),this._decorationsTree.insert(n),this._onDidChangeDecorations.checkAffectedAndFire(n.options),n.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(r.endLineNumber),n.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(r.startLineNumber)}_changeDecorationOptionsImpl(e,t){const n=this._decorations[e];if(!n)return;const r=!!(n.options.overviewRuler&&n.options.overviewRuler.color),o=!!(t.overviewRuler&&t.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(n.options),this._onDidChangeDecorations.checkAffectedAndFire(t),n.options.after||t.after){const l=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByInjectedText(l.endLineNumber)}if(n.options.before||t.before){const l=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByInjectedText(l.startLineNumber)}const s=r!==o,a=cUe(t)!==wM(n);s||a?(this._decorationsTree.delete(n),n.setOptions(t),this._decorationsTree.insert(n)):n.setOptions(t)}_deltaDecorationsImpl(e,t,n,r=!1){const o=this.getVersionId(),s=t.length;let a=0;const l=n.length;let c=0;this._onDidChangeDecorations.beginDeferredEmit();try{const u=new Array(l);for(;athis._setLanguage(e.languageId,t)),this._setLanguage(e.languageId,t))}_setLanguage(e,t){this.tokenization.setLanguageId(e,t),this._languageService.requestRichLanguageFeatures(e)}getLanguageIdAtPosition(e,t){return this.tokenization.getLanguageIdAtPosition(e,t)}getWordAtPosition(e){return this._tokenizationTextModelPart.getWordAtPosition(e)}getWordUntilPosition(e){return this._tokenizationTextModelPart.getWordUntilPosition(e)}normalizePosition(e,t){return e}getLineIndentColumn(e){return lUe(this.getLineContent(e))+1}};zf._MODEL_SYNC_LIMIT=50*1024*1024;zf.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024;zf.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3;zf.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024;zf.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:Ds.tabSize,indentSize:Ds.indentSize,insertSpaces:Ds.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:Ds.trimAutoWhitespace,largeFileOptimizations:Ds.largeFileOptimizations,bracketPairColorizationOptions:Ds.bracketPairColorizationOptions};zf=g0=nUe([z6(4,U4),z6(5,ji),z6(6,Di)],zf);function lUe(i){let e=0;for(const t of i)if(t===" "||t===" ")e++;else break;return e}function U6(i){return!!(i.options.overviewRuler&&i.options.overviewRuler.color)}function cUe(i){return!!i.after||!!i.before}function wM(i){return!!i.options.after||!!i.options.before}class ioe{constructor(){this._decorationsTree0=new $6,this._decorationsTree1=new $6,this._injectedTextDecorationsTree=new $6}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1,!1)}_ensureNodesHaveRanges(e,t){for(const n of t)n.range===null&&(n.range=e.getRangeAt(n.cachedAbsoluteStart,n.cachedAbsoluteEnd));return t}getAllInInterval(e,t,n,r,o,s){const a=e.getVersionId(),l=this._intervalSearch(t,n,r,o,a,s);return this._ensureNodesHaveRanges(e,l)}_intervalSearch(e,t,n,r,o,s){const a=this._decorationsTree0.intervalSearch(e,t,n,r,o,s),l=this._decorationsTree1.intervalSearch(e,t,n,r,o,s),c=this._injectedTextDecorationsTree.intervalSearch(e,t,n,r,o,s);return a.concat(l).concat(c)}getInjectedTextInInterval(e,t,n,r){const o=e.getVersionId(),s=this._injectedTextDecorationsTree.intervalSearch(t,n,r,!1,o,!1);return this._ensureNodesHaveRanges(e,s).filter(a=>a.options.showIfCollapsed||!a.range.isEmpty())}getAllInjectedText(e,t){const n=e.getVersionId(),r=this._injectedTextDecorationsTree.search(t,!1,n,!1);return this._ensureNodesHaveRanges(e,r).filter(o=>o.options.showIfCollapsed||!o.range.isEmpty())}getAll(e,t,n,r,o){const s=e.getVersionId(),a=this._search(t,n,r,s,o);return this._ensureNodesHaveRanges(e,a)}_search(e,t,n,r,o){if(n)return this._decorationsTree1.search(e,t,r,o);{const s=this._decorationsTree0.search(e,t,r,o),a=this._decorationsTree1.search(e,t,r,o),l=this._injectedTextDecorationsTree.search(e,t,r,o);return s.concat(a).concat(l)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),n=this._decorationsTree1.collectNodesFromOwner(e),r=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(n).concat(r)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),n=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(n)}insert(e){wM(e)?this._injectedTextDecorationsTree.insert(e):U6(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){wM(e)?this._injectedTextDecorationsTree.delete(e):U6(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const n=e.getVersionId();return t.cachedVersionId!==n&&this._resolveNode(t,n),t.range===null&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){wM(e)?this._injectedTextDecorationsTree.resolveNode(e,t):U6(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,n,r){this._decorationsTree0.acceptReplace(e,t,n,r),this._decorationsTree1.acceptReplace(e,t,n,r),this._injectedTextDecorationsTree.acceptReplace(e,t,n,r)}}function Wh(i){return i.replace(/[^a-z0-9\-_]/gi," ")}class o_e{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class uUe extends o_e{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:mc.Center}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=null}_resolveColor(e,t){if(typeof e=="string")return e;const n=e?t.getColor(e.id):null;return n?n.toString():""}}class dUe{constructor(e){var t;this.position=(t=e==null?void 0:e.position)!==null&&t!==void 0?t:$f.Center,this.persistLane=e==null?void 0:e.persistLane}}class hUe extends o_e{constructor(e){super(e),this.position=e.position}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=void 0}_resolveColor(e,t){return typeof e=="string"?me.fromHex(e):t.getColor(e.id)}}class Jv{static from(e){return e instanceof Jv?e:new Jv(e)}constructor(e){this.content=e.content||"",this.inlineClassName=e.inlineClassName||null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.attachedData=e.attachedData||null,this.cursorStops=e.cursorStops||null}}class sn{static register(e){return new sn(e)}static createDynamic(e){return new sn(e)}constructor(e){var t,n,r,o,s,a;this.description=e.description,this.blockClassName=e.blockClassName?Wh(e.blockClassName):null,this.blockDoesNotCollapse=(t=e.blockDoesNotCollapse)!==null&&t!==void 0?t:null,this.blockIsAfterEnd=(n=e.blockIsAfterEnd)!==null&&n!==void 0?n:null,this.blockPadding=(r=e.blockPadding)!==null&&r!==void 0?r:null,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?Wh(e.className):null,this.shouldFillLineOnLineBreak=(o=e.shouldFillLineOnLineBreak)!==null&&o!==void 0?o:null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.lineNumberHoverMessage=e.lineNumberHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new uUe(e.overviewRuler):null,this.minimap=e.minimap?new hUe(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new dUe(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?Wh(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?Wh(e.linesDecorationsClassName):null,this.lineNumberClassName=e.lineNumberClassName?Wh(e.lineNumberClassName):null,this.linesDecorationsTooltip=e.linesDecorationsTooltip?O5e(e.linesDecorationsTooltip):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?Wh(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?Wh(e.marginClassName):null,this.inlineClassName=e.inlineClassName?Wh(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?Wh(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?Wh(e.afterContentClassName):null,this.after=e.after?Jv.from(e.after):null,this.before=e.before?Jv.from(e.before):null,this.hideInCommentTokens=(s=e.hideInCommentTokens)!==null&&s!==void 0?s:!1,this.hideInStringTokens=(a=e.hideInStringTokens)!==null&&a!==void 0?a:!1}}sn.EMPTY=sn.register({description:"empty"});const roe=[sn.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),sn.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),sn.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),sn.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function ooe(i){return i instanceof sn?i:sn.createDynamic(i)}class fUe extends fe{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new se),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._deferredCnt=0,this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._affectsLineNumber=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){var e;this._deferredCnt--,this._deferredCnt===0&&(this._shouldFireDeferred&&this.doFire(),(e=this._affectedInjectedTextLines)===null||e===void 0||e.clear(),this._affectedInjectedTextLines=null)}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}checkAffectedAndFire(e){var t,n;this._affectsMinimap||(this._affectsMinimap=!!(!((t=e.minimap)===null||t===void 0)&&t.position)),this._affectsOverviewRuler||(this._affectsOverviewRuler=!!(!((n=e.overviewRuler)===null||n===void 0)&&n.color)),this._affectsGlyphMargin||(this._affectsGlyphMargin=!!e.glyphMarginClassName),this._affectsLineNumber||(this._affectsLineNumber=!!e.lineNumberClassName),this.tryFire()}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this._affectsGlyphMargin=!0,this.tryFire()}tryFire(){this._deferredCnt===0?this.doFire():this._shouldFireDeferred=!0}doFire(){this.handleBeforeFire(this._affectedInjectedTextLines);const e={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler,affectsGlyphMargin:this._affectsGlyphMargin,affectsLineNumber:this._affectsLineNumber};this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._actual.fire(e)}}class gUe extends fe{constructor(){super(),this._fastEmitter=this._register(new se),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new se),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(e=null){if(this._deferredCnt--,this._deferredCnt===0&&this._deferredEvent!==null){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;const t=this._deferredEvent;this._deferredEvent=null,this._fastEmitter.fire(t),this._slowEmitter.fire(t)}}fire(e){if(this._deferredCnt>0){this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e;return}this._fastEmitter.fire(e),this._slowEmitter.fire(e)}}class pUe{constructor(){this._onDidChangeVisibleRanges=new se,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new mUe(t=>{this._onDidChangeVisibleRanges.fire({view:e,state:t})});return this._views.add(e),e}detachView(e){this._views.delete(e),this._onDidChangeVisibleRanges.fire({view:e,state:void 0})}}class mUe{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){const n=e.map(r=>new pn(r.startLineNumber,r.endLineNumber+1));this.handleStateChange({visibleLineRanges:n,stabilized:t})}}class _X{static create(e){return new _X(e.get(133),e.get(132))}constructor(e,t){this.classifier=new vUe(e,t)}createLineBreaksComputer(e,t,n,r,o){const s=[],a=[],l=[];return{addRequest:(c,u,d)=>{s.push(c),a.push(u),l.push(d)},finalize:()=>{const c=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,u=[];for(let d=0,h=s.length;d=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 XH=[],YH=[];function _Ue(i,e,t,n,r,o,s,a){if(r===-1)return null;const l=t.length;if(l<=1)return null;const c=a==="keepAll",u=e.breakOffsets,d=e.breakOffsetsVisibleColumn,h=s_e(t,n,r,o,s),f=r-h,g=XH,p=YH;let v=0,m=0,_=0,y=r;const S=u.length;let L=0;if(L>=0){let E=Math.abs(d[L]-y);for(;L+1=E)break;E=D,L++}}for(;LE&&(E=m,D=_);let k=0,T=0,M=0,A=0;if(D<=y){let R=D,F=E===0?0:t.charCodeAt(E-1),W=E===0?0:i.get(F),H=!0;for(let G=E;Gm&&ZH(F,W,K,re,c)&&(k=U,T=R),R+=Y,R>y){U>m?(M=U,A=R-Y):(M=G+1,A=R),R-T>f&&(k=0),H=!1;break}F=K,W=re}if(H){v>0&&(g[v]=u[u.length-1],p[v]=d[u.length-1],v++);break}}if(k===0){let R=D,F=t.charCodeAt(E),W=i.get(F),H=!1;for(let G=E-1;G>=m;G--){const U=G+1,K=t.charCodeAt(G);if(K===9){H=!0;break}let re,Y;if(Db(K)?(G--,re=0,Y=2):(re=i.get(K),Y=zv(K)?o:1),R<=y){if(M===0&&(M=U,A=R),R<=y-f)break;if(ZH(K,re,F,W,c)){k=U,T=R;break}}R-=Y,F=K,W=re}if(k!==0){const G=f-(A-T);if(G<=n){const U=t.charCodeAt(M);let K;xo(U)?K=2:K=SE(U,A,n,o),G-K<0&&(k=0)}}if(H){L--;continue}}if(k===0&&(k=M,T=A),k<=m){const R=t.charCodeAt(m);xo(R)?(k=m+2,T=_+2):(k=m+1,T=_+SE(R,_,n,o))}for(m=k,g[v]=k,_=T,p[v]=T,v++,y=T+f;L<0||L=N)break;N=R,L++}}return v===0?null:(g.length=v,p.length=v,XH=e.breakOffsets,YH=e.breakOffsetsVisibleColumn,e.breakOffsets=g,e.breakOffsetsVisibleColumn=p,e.wrappedTextIndentLength=h,e)}function bUe(i,e,t,n,r,o,s,a){const l=gh.applyInjectedText(e,t);let c,u;if(t&&t.length>0?(c=t.map(T=>T.options),u=t.map(T=>T.column-1)):(c=null,u=null),r===-1)return c?new _E(u,c,[l.length],[],0):null;const d=l.length;if(d<=1)return c?new _E(u,c,[l.length],[],0):null;const h=a==="keepAll",f=s_e(l,n,r,o,s),g=r-f,p=[],v=[];let m=0,_=0,y=0,S=r,L=l.charCodeAt(0),E=i.get(L),D=SE(L,0,n,o),k=1;xo(L)&&(D+=1,L=l.charCodeAt(1),E=i.get(L),k++);for(let T=k;TS&&((_===0||D-y>g)&&(_=M,y=D-R),p[m]=_,v[m]=y,m++,S=y+g,_=0),L=A,E=N}return m===0&&(!t||t.length===0)?null:(p[m]=d,v[m]=D,new _E(u,c,p,v,f))}function SE(i,e,t,n){return i===9?t-e%t:zv(i)||i<32?n:1}function soe(i,e){return e-i%e}function ZH(i,e,t,n,r){return t!==32&&(e===2&&n!==2||e!==1&&n===1||!r&&e===3&&n!==2||!r&&n===3&&e!==1)}function s_e(i,e,t,n,r){let o=0;if(r!==0){const s=Ys(i);if(s!==-1){for(let l=0;lt&&(o=0)}}return o}class _P{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new Yo(new B(1,1,1,1),0,0,new ae(1,1),0),new Yo(new B(1,1,1,1),0,0,new ae(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 Wn(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?yt.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):yt.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,n){this._setState(e,t,n)}static _validatePositionWithCache(e,t,n,r){return t.equals(n)?r:e.normalizePosition(t,2)}static _validateViewState(e,t){const n=t.position,r=t.selectionStart.getStartPosition(),o=t.selectionStart.getEndPosition(),s=e.normalizePosition(n,2),a=this._validatePositionWithCache(e,r,n,s),l=this._validatePositionWithCache(e,o,r,a);return n.equals(s)&&r.equals(a)&&o.equals(l)?t:new Yo(B.fromPositions(a,l),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+r.column-a.column,s,t.leftoverVisibleColumns+n.column-s.column)}_setState(e,t,n){if(n&&(n=_P._validateViewState(e.viewModel,n)),t){const r=e.model.validateRange(t.selectionStart),o=t.selectionStart.equalsRange(r)?t.selectionStartLeftoverVisibleColumns:0,s=e.model.validatePosition(t.position),a=t.position.equals(s)?t.leftoverVisibleColumns:0;t=new Yo(r,t.selectionStartKind,o,s,a)}else{if(!n)return;const r=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(n.selectionStart)),o=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(n.position));t=new Yo(r,n.selectionStartKind,n.selectionStartLeftoverVisibleColumns,o,n.leftoverVisibleColumns)}if(n){const r=e.coordinatesConverter.validateViewRange(n.selectionStart,t.selectionStart),o=e.coordinatesConverter.validateViewPosition(n.position,t.position);n=new Yo(r,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const r=e.coordinatesConverter.convertModelPositionToViewPosition(new ae(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new ae(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),s=new B(r.lineNumber,r.column,o.lineNumber,o.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);n=new Yo(s,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=n,this._updateTrackedRange(e)}}class aoe{constructor(e){this.context=e,this.cursors=[new _P(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 l9e(this.cursors,Jc(e=>e.viewState.position,ae.compare)).viewState.position}getBottomMostViewPosition(){return a9e(this.cursors,Jc(e=>e.viewState.position,ae.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(Wn.fromModelSelections(e))}getPrimaryCursor(){return this.cursors[0].asCursorState()}setStates(e){e!==null&&(this.cursors[0].setState(this.context,e[0].modelState,e[0].viewState),this._setSecondaryStates(e.slice(1)))}_setSecondaryStates(e){const t=this.cursors.length-1,n=e.length;if(tn){const r=t-n;for(let o=0;o=e+1&&this.lastAddedCursorIndex--,this.cursors[e+1].dispose(this.context),this.cursors.splice(e+1,1)}normalize(){if(this.cursors.length===1)return;const e=this.cursors.slice(0),t=[];for(let n=0,r=e.length;nn.selection,B.compareRangesUsingStarts));for(let n=0;nd&&p.index--;e.splice(d,1),t.splice(u,1),this._removeSecondaryCursor(d-1),n--}}}}class loe{constructor(e,t,n,r){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=n,this.cursorConfig=r}}class CUe{constructor(){this.type=0}}class yUe{constructor(){this.type=1}}class wUe{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class SUe{constructor(e,t,n){this.selections=e,this.modelSelections=t,this.reason=n,this.type=3}}class Q_{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler,this.affectsGlyphMargin=e.affectsGlyphMargin,this.affectsLineNumber=e.affectsLineNumber):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0,this.affectsGlyphMargin=!0,this.affectsLineNumber=!0)}}class xR{constructor(){this.type=5}}class xUe{constructor(e){this.type=6,this.isFocused=e}}class LUe{constructor(){this.type=7}}class LR{constructor(){this.type=8}}class a_e{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}}class QH{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class JH{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class SM{constructor(e,t,n,r,o,s,a){this.source=e,this.minimalReveal=t,this.range=n,this.selections=r,this.verticalType=o,this.revealHorizontal=s,this.scrollType=a,this.type=12}}class EUe{constructor(e){this.type=13,this.scrollWidth=e.scrollWidth,this.scrollLeft=e.scrollLeft,this.scrollHeight=e.scrollHeight,this.scrollTop=e.scrollTop,this.scrollWidthChanged=e.scrollWidthChanged,this.scrollLeftChanged=e.scrollLeftChanged,this.scrollHeightChanged=e.scrollHeightChanged,this.scrollTopChanged=e.scrollTopChanged}}class DUe{constructor(e){this.theme=e,this.type=14}}class IUe{constructor(e){this.type=15,this.ranges=e}}class kUe{constructor(){this.type=16}}let TUe=class{constructor(){this.type=17}};class NUe extends fe{constructor(){super(),this._onEvent=this._register(new se),this.onEvent=this._onEvent.event,this._eventHandlers=[],this._viewEventQueue=null,this._isConsumingViewEventQueue=!1,this._collector=null,this._collectorCnt=0,this._outgoingEvents=[]}emitOutgoingEvent(e){this._addOutgoingEvent(e),this._emitOutgoingEvents()}_addOutgoingEvent(e){for(let t=0,n=this._outgoingEvents.length;t0;){if(this._collector||this._isConsumingViewEventQueue)return;const e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let t=0,n=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 n of t)n.handleEvents(e)}}}class RUe{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class bX{constructor(e,t,n,r){this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=n,this.contentHeight=r,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}attemptToMerge(e){return e.kind!==this.kind?null:new bX(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class CX{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new CX(this.oldHasFocus,e.hasFocus)}}class yX{constructor(e,t,n,r,o,s,a,l){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=n,this._oldScrollTop=r,this.scrollWidth=o,this.scrollLeft=s,this.scrollHeight=a,this.scrollTop=l,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!this.scrollWidthChanged&&!this.scrollLeftChanged&&!this.scrollHeightChanged&&!this.scrollTopChanged}attemptToMerge(e){return e.kind!==this.kind?null:new yX(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class MUe{constructor(){this.kind=3}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class AUe{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class bP{constructor(e,t,n,r,o,s,a){this.kind=6,this.oldSelections=e,this.selections=t,this.oldModelVersionId=n,this.modelVersionId=r,this.source=o,this.reason=s,this.reachedMaxCursorCount=a}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const n=e.length,r=t.length;if(n!==r)return!1;for(let o=0;o0){const e=this._cursors.getSelections();for(let t=0;ts&&(r=r.slice(0,s),o=!0);const a=xE.from(this._model,this);return this._cursors.setStates(r),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,n,a,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealPrimary(e,t,n,r,o,s){const a=this._cursors.getViewPositions();let l=null,c=null;a.length>1?c=this._cursors.getViewSelections():l=B.fromPositions(a[0],a[0]),e.emitViewEvent(new SM(t,n,l,c,r,o,s))}saveState(){const e=[],t=this._cursors.getSelections();for(let n=0,r=t.length;n0){const o=Wn.fromModelSelections(n.resultingSelection);this.setStates(e,"modelChange",n.isUndoing?5:n.isRedoing?6:2,o)&&this.revealPrimary(e,"modelChange",!1,0,!0,0)}else{const o=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,Wn.fromModelSelections(o))}}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;const e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),n=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:n.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,n)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,n,r){this.setStates(e,t,r,Wn.fromModelSelections(n))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const n=[],r=[];for(let a=0,l=e.length;a0&&this._pushAutoClosedAction(n,r),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){(!e||e.length===0)&&(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,n,r,o){const s=xE.from(this._model,this);if(s.equals(r))return!1;const a=this._cursors.getSelections(),l=this._cursors.getViewSelections();if(e.emitViewEvent(new SUe(l,a,n)),!r||r.cursorState.length!==s.cursorState.length||s.cursorState.some((c,u)=>!c.modelState.equals(r.cursorState[u].modelState))){const c=r?r.cursorState.map(d=>d.modelState.selection):null,u=r?r.modelVersionId:0;e.emitOutgoingEvent(new bP(c,a,u,s.modelVersionId,t||"keyboard",n,o))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let n=0,r=e.length;n=0)return null;const s=o.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!s)return null;const a=s[1],l=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!l||l.length!==1)return null;const c=l[0].open,u=o.text.length-s[2].length-1,d=o.text.lastIndexOf(c,u-1);if(d===-1)return null;t.push([d,u])}return t}executeEdits(e,t,n,r){let o=null;t==="snippet"&&(o=this._findAutoClosingPairs(n)),o&&(n[0]._isTracked=!0);const s=[],a=[],l=this._model.pushEditOperations(this.getSelections(),n,c=>{if(o)for(let d=0,h=o.length;d0&&this._pushAutoClosedAction(s,a)}_executeEdit(e,t,n,r=0){if(this.context.cursorConfig.readOnly)return;const o=xE.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(s){en(s)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,n,r,o,!1)&&this.revealPrimary(t,n,!1,0,!0,0)}getAutoClosedCharacters(){return coe.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new LE(this._model,this.getSelections())}endComposition(e,t){const n=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{t==="keyboard"&&this._executeEditOperation(rr.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,n,this.getSelections(),this.getAutoClosedCharacters()))},e,t)}type(e,t,n){this._executeEdit(()=>{if(n==="keyboard"){const r=t.length;let o=0;for(;o{const c=l.getPosition();return new yt(c.lineNumber,c.column+o,c.lineNumber,c.column+o)});this.setSelections(e,s,a,0)}return}this._executeEdit(()=>{this._executeEditOperation(rr.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,n,r,o))},e,s)}paste(e,t,n,r,o){this._executeEdit(()=>{this._executeEditOperation(rr.paste(this.context.cursorConfig,this._model,this.getSelections(),t,n,r||[]))},e,o,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(Mb.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,n){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new za(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,n)}executeCommands(e,t,n){this._executeEdit(()=>{this._executeEditOperation(new za(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,n)}}class xE{static from(e,t){return new xE(e.getVersionId(),t.getCursorStates())}constructor(e,t){this.modelVersionId=e,this.cursorState=t}equals(e){if(!e||this.modelVersionId!==e.modelVersionId||this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,n=this.cursorState.length;t=t.length||!t[n].strictContainsRange(e[n]))return!1;return!0}}class zUe{static executeCommands(e,t,n){const r={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},o=this._innerExecuteCommands(r,n);for(let s=0,a=r.trackedRanges.length;s0&&(s[0]._isTracked=!0);let a=e.model.pushEditOperations(e.selectionsBefore,s,c=>{const u=[];for(let f=0;ff.identifier.minor-g.identifier.minor,h=[];for(let f=0;f0?(u[f].sort(d),h[f]=t[f].computeCursorState(e.model,{getInverseEditOperations:()=>u[f],getTrackedSelection:g=>{const p=parseInt(g,10),v=e.model._getTrackedRange(e.trackedRanges[p]);return e.trackedRangesDirection[p]===0?new yt(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn):new yt(v.endLineNumber,v.endColumn,v.startLineNumber,v.startColumn)}})):h[f]=e.selectionsBefore[f];return h});a||(a=e.selectionsBefore);const l=[];for(const c in o)o.hasOwnProperty(c)&&l.push(parseInt(c,10));l.sort((c,u)=>u-c);for(const c of l)a.splice(c,1);return a}static _arrayIsEmpty(e){for(let t=0,n=e.length;t{B.isEmpty(d)&&h===""||r.push({identifier:{major:t,minor:o++},range:d,text:h,forceMoveMarkers:f,isAutoWhitespaceEdit:n.insertsAutoWhitespace})};let a=!1;const u={addEditOperation:s,addTrackedEditOperation:(d,h,f)=>{a=!0,s(d,h,f)},trackSelection:(d,h)=>{const f=yt.liftSelection(d);let g;if(f.isEmpty())if(typeof h=="boolean")h?g=2:g=3;else{const m=e.model.getLineMaxColumn(f.startLineNumber);f.startColumn===m?g=2:g=3}else g=1;const p=e.trackedRanges.length,v=e.model._setTrackedRange(null,f,g);return e.trackedRanges[p]=v,e.trackedRangesDirection[p]=f.getDirection(),p.toString()}};try{n.getEditOperations(e.model,u)}catch(d){return en(d),{operations:[],hadTrackedEditOperation:!1}}return{operations:r,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((n,r)=>-B.compareRangesUsingEnds(n.range,r.range));const t={};for(let n=1;no.identifier.major?s=r.identifier.major:s=o.identifier.major,t[s.toString()]=!0;for(let a=0;a0&&n--}}return t}}class UUe{constructor(e,t,n){this.text=e,this.startSelection=t,this.endSelection=n}}class LE{static _capture(e,t){const n=[];for(const r of t){if(r.startLineNumber!==r.endLineNumber)return null;n.push(new UUe(e.getLineContent(r.startLineNumber),r.startColumn-1,r.endColumn-1))}return n}constructor(e,t){this._original=LE._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const n=LE._capture(e,t);if(!n||this._original.length!==n.length)return null;const r=[];for(let o=0,s=this._original.length;oNw,tokenizeEncoded:(i,e,t)=>T4(0,t)};async function jUe(i,e,t){if(!t)return doe(e,i.languageIdCodec,uoe);const n=await hr.getOrCreate(t);return doe(e,i.languageIdCodec,n||uoe)}function KUe(i,e,t,n,r,o,s){let a="
",l=n,c=0,u=!0;for(let d=0,h=e.getCount();d0;)s&&u?(g+=" ",u=!1):(g+=" ",u=!0),v--;break}case 60:g+="<",u=!1;break;case 62:g+=">",u=!1;break;case 38:g+="&",u=!1;break;case 0:g+="�",u=!1;break;case 65279:case 8232:case 8233:case 133:g+="�",u=!1;break;case 13:g+="​",u=!1;break;case 32:s&&u?(g+=" ",u=!1):(g+=" ",u=!0);break;default:g+=String.fromCharCode(p),u=!1}}if(a+=`${g}`,f>r||l>=r)break}return a+="
",a}function doe(i,e,t){let n='
';const r=Jf(i);let o=t.getInitialState();for(let s=0,a=r.length;s0&&(n+="
");const c=t.tokenizeEncoded(l,!0,o);Lo.convertToEndOffset(c.tokens,l.length);const d=new Lo(c.tokens,l,e).inflate();let h=0;for(let f=0,g=d.getCount();f${HA(l.substring(h,v))}`,h=v}o=c.endState}return n+="
",n}class GUe{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,n=this._changes,r=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,n,r)}}class qUe{constructor(e,t,n,r,o){this.id=e,this.afterLineNumber=t,this.ordinal=n,this.height=r,this.minWidth=o,this.prefixSum=0}}let l_e=class eV{constructor(e,t,n,r){this._instanceId=Bpe(++eV.INSTANCE_COUNT),this._pendingChanges=new GUe,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=t,this._paddingTop=n,this._paddingBottom=r}static findInsertionIndex(e,t,n){let r=0,o=e.length;for(;r>>1;t===e[s].afterLineNumber?n{t=!0,r=r|0,o=o|0,s=s|0,a=a|0;const l=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new qUe(l,r,o,s,a)),l},changeOneWhitespace:(r,o,s)=>{t=!0,o=o|0,s=s|0,this._pendingChanges.change({id:r,newAfterLineNumber:o,newHeight:s})},removeWhitespace:r=>{t=!0,this._pendingChanges.remove({id:r})}})}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,n){if((e.length>0||n.length>0)&&(this._minWidth=-1),e.length+t.length+n.length<=1){for(const l of e)this._insertWhitespace(l);for(const l of t)this._changeOneWhitespace(l.id,l.newAfterLineNumber,l.newHeight);for(const l of n){const c=this._findWhitespaceIndex(l.id);c!==-1&&this._removeWhitespace(c)}return}const r=new Set;for(const l of n)r.add(l.id);const o=new Map;for(const l of t)o.set(l.id,l);const s=l=>{const c=[];for(const u of l)if(!r.has(u.id)){if(o.has(u.id)){const d=o.get(u.id);u.afterLineNumber=d.newAfterLineNumber,u.height=d.newHeight}c.push(u)}return c},a=s(this._arr).concat(s(e));a.sort((l,c)=>l.afterLineNumber===c.afterLineNumber?l.ordinal-c.ordinal:l.afterLineNumber-c.afterLineNumber),this._arr=a,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){const t=eV.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 n=0,r=t.length;nt&&(this._arr[n].afterLineNumber-=t-e+1)}}onLinesInserted(e,t){this._checkPendingChanges(),e=e|0,t=t|0,this._lineCount+=t-e+1;for(let n=0,r=this._arr.length;n=t.length||t[a+1].afterLineNumber>=e)return a;n=a+1|0}else r=a-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e=e|0;const n=this._findLastWhitespaceBeforeLineNumber(e)+1;return n1?n=this._lineHeight*(e-1):n=0;const r=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0));return n+r+this._paddingTop}getVerticalOffsetAfterLineNumber(e,t=!1){this._checkPendingChanges(),e=e|0;const n=this._lineHeight*e,r=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0));return n+r+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),this._minWidth===-1){let e=0;for(let t=0,n=this._arr.length;tt}isInTopPadding(e){return this._paddingTop===0?!1:(this._checkPendingChanges(),e=t-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),e=e|0,e<0)return 1;const t=this._lineCount|0,n=this._lineHeight;let r=1,o=t;for(;r=a+n)r=s+1;else{if(e>=a)return s;o=s}}return r>t?t:r}getLinesViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const n=this._lineHeight,r=this.getLineNumberAtOrAfterVerticalOffset(e)|0,o=this.getVerticalOffsetForLineNumber(r)|0;let s=this._lineCount|0,a=this.getFirstWhitespaceIndexAfterLineNumber(r)|0;const l=this.getWhitespacesCount()|0;let c,u;a===-1?(a=l,u=s+1,c=0):(u=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);let d=o,h=d;const f=5e5;let g=0;o>=f&&(g=Math.floor(o/f)*f,g=Math.floor(g/n)*n,h-=g);const p=[],v=e+(t-e)/2;let m=-1;for(let L=r;L<=s;L++){if(m===-1){const E=d,D=d+n;(E<=v&&vv)&&(m=L)}for(d+=n,p[L-r]=h,h+=n;u===L;)h+=c,d+=c,a++,a>=l?u=s+1:(u=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);if(d>=t){s=L;break}}m===-1&&(m=s);const _=this.getVerticalOffsetForLineNumber(s)|0;let y=r,S=s;return yt&&S--,{bigNumbersDelta:g,startLineNumber:r,endLineNumber:s,relativeVerticalOffset:p,centeredLineNumber:m,completelyVisibleStartLineNumber:y,completelyVisibleEndLineNumber:S}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e=e|0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let n;t>=1?n=this._lineHeight*t:n=0;let r;return e>0?r=this.getWhitespacesAccumulatedHeight(e-1):r=0,n+r+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e=e|0;let t=0,n=this.getWhitespacesCount()-1;if(n<0)return-1;const r=this.getVerticalOffsetForWhitespaceIndex(n),o=this.getHeightForWhitespaceIndex(n);if(e>=r+o)return-1;for(;t=a+l)t=s+1;else{if(e>=a)return s;n=s}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e=e|0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0||t>=this.getWhitespacesCount())return null;const n=this.getVerticalOffsetForWhitespaceIndex(t);if(n>e)return null;const r=this.getHeightForWhitespaceIndex(t),o=this.getIdForWhitespaceIndex(t),s=this.getAfterLineNumberForWhitespaceIndex(t);return{id:o,afterLineNumber:s,verticalOffset:n,height:r}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const n=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),r=this.getWhitespacesCount()-1;if(n<0)return[];const o=[];for(let s=n;s<=r;s++){const a=this.getVerticalOffsetForWhitespaceIndex(s),l=this.getHeightForWhitespaceIndex(s);if(a>=t)break;o.push({id:this.getIdForWhitespaceIndex(s),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(s),verticalOffset:a,height:l})}return o}getWhitespaces(){return this._checkPendingChanges(),this._arr.slice(0)}getWhitespacesCount(){return this._checkPendingChanges(),this._arr.length}getIdForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].height}};l_e.INSTANCE_COUNT=0;const XUe=125;class AL{constructor(e,t,n,r){e=e|0,t=t|0,n=n|0,r=r|0,e<0&&(e=0),t<0&&(t=0),n<0&&(n=0),r<0&&(r=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=n,this.contentHeight=r,this.scrollHeight=Math.max(n,r)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class YUe extends fe{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new se),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new AL(0,0,0,0),this._scrollable=this._register(new TS({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 n=t.contentWidth!==e.contentWidth,r=t.contentHeight!==e.contentHeight;(n||r)&&this._onDidContentSizeChange.fire(new bX(t.contentWidth,t.contentHeight,e.contentWidth,e.contentHeight))}getFutureScrollPosition(){return this._scrollable.getFutureScrollPosition()}getCurrentScrollPosition(){return this._scrollable.getCurrentScrollPosition()}setScrollPositionNow(e){this._scrollable.setScrollPositionNow(e)}setScrollPositionSmooth(e){this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}}class ZUe extends fe{constructor(e,t,n){super(),this._configuration=e;const r=this._configuration.options,o=r.get(144),s=r.get(84);this._linesLayout=new l_e(t,r.get(67),s.top,s.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new YUe(0,n)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new AL(o.contentWidth,0,o.height,0)),this.onDidScroll=this._scrollable.onDidScroll,this.onDidContentSizeChange=this._scrollable.onDidContentSizeChange,this._updateHeight()}dispose(){super.dispose()}getScrollable(){return this._scrollable.getScrollable()}onHeightMaybeChanged(){this._updateHeight()}_configureSmoothScrollDuration(){this._scrollable.setSmoothScrollDuration(this._configuration.options.get(114)?XUe:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(67)&&this._linesLayout.setLineHeight(t.get(67)),e.hasChanged(84)){const n=t.get(84);this._linesLayout.setPadding(n.top,n.bottom)}if(e.hasChanged(144)){const n=t.get(144),r=n.contentWidth,o=n.height,s=this._scrollable.getScrollDimensions(),a=s.contentWidth;this._scrollable.setScrollDimensions(new AL(r,s.contentWidth,o,this._getContentHeight(r,o,a)))}else this._updateHeight();e.hasChanged(114)&&this._configureSmoothScrollDuration()}onFlushed(e){this._linesLayout.onFlushed(e)}onLinesDeleted(e,t){this._linesLayout.onLinesDeleted(e,t)}onLinesInserted(e,t){this._linesLayout.onLinesInserted(e,t)}_getHorizontalScrollbarHeight(e,t){const r=this._configuration.options.get(103);return r.horizontal===2||e>=t?0:r.horizontalScrollbarSize}_getContentHeight(e,t,n){const r=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return r.get(105)?o+=Math.max(0,t-r.get(67)-r.get(84).bottom):r.get(103).ignoreHorizontalScrollbarInContentHeight||(o+=this._getHorizontalScrollbarHeight(e,n)),o}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,n=e.height,r=e.contentWidth;this._scrollable.setScrollDimensions(new AL(t,e.contentWidth,n,this._getContentHeight(t,n,r)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new Qie(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new Qie(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){const e=this._configuration.options,t=this._maxLineWidth,n=e.get(145),r=e.get(50),o=e.get(144);if(n.isViewportWrapping){const s=e.get(73);return t>o.contentWidth+r.typicalHalfwidthCharacterWidth&&s.enabled&&s.side==="right"?t+o.verticalScrollbarWidth:t}else{const s=e.get(104)*r.typicalHalfwidthCharacterWidth,a=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+s+o.verticalScrollbarWidth,a,this._overlayWidgetsMinWidth)}}setMaxLineWidth(e){this._maxLineWidth=e,this._updateContentWidth()}setOverlayWidgetsMinWidth(e){this._overlayWidgetsMinWidth=e,this._updateContentWidth()}_updateContentWidth(){const e=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new AL(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,n=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t),r=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(n);return{scrollTop:t,scrollTopWithoutViewZones:t-r,scrollLeft:e.scrollLeft}}changeWhitespace(e){const t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetAfterLineNumber(e,t)}isAfterLines(e){return this._linesLayout.isAfterLines(e)}isInTopPadding(e){return this._linesLayout.isInTopPadding(e)}isInBottomPadding(e){return this._linesLayout.isInBottomPadding(e)}getLineNumberAtVerticalOffset(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)}getWhitespaceAtVerticalOffset(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)}getLinesViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)}getLinesViewportDataAtScrollTop(e){const t=this._scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)}getWhitespaceViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)}getWhitespaces(){return this._linesLayout.getWhitespaces()}getContentWidth(){return this._scrollable.getScrollDimensions().contentWidth}getScrollWidth(){return this._scrollable.getScrollDimensions().scrollWidth}getContentHeight(){return this._scrollable.getScrollDimensions().contentHeight}getScrollHeight(){return this._scrollable.getScrollDimensions().scrollHeight}getCurrentScrollLeft(){return this._scrollable.getCurrentScrollPosition().scrollLeft}getCurrentScrollTop(){return this._scrollable.getCurrentScrollPosition().scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,t){t===1?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}deltaScrollNow(e,t){const n=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:n.scrollLeft+e,scrollTop:n.scrollTop+t})}}class QUe{constructor(e,t,n,r,o){this.editorId=e,this.model=t,this.configuration=n,this._linesCollection=r,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 n=this._decorationsCache[t];if(!n){const r=e.range,o=e.options;let s;if(o.isWholeLine){const a=this._coordinatesConverter.convertModelPositionToViewPosition(new ae(r.startLineNumber,1),0,!1,!0),l=this._coordinatesConverter.convertModelPositionToViewPosition(new ae(r.endLineNumber,this.model.getLineMaxColumn(r.endLineNumber)),1);s=new B(a.lineNumber,a.column,l.lineNumber,l.column)}else s=this._coordinatesConverter.convertModelRangeToViewRange(r,1);n=new Gme(s,o),this._decorationsCache[t]=n}return n}getMinimapDecorationsInRange(e){return this._getDecorationsInRange(e,!0,!1).decorations}getDecorationsViewportData(e){let t=this._cachedModelDecorationsResolver!==null;return t=t&&e.equalsRange(this._cachedModelDecorationsResolverViewRange),t||(this._cachedModelDecorationsResolver=this._getDecorationsInRange(e,!1,!1),this._cachedModelDecorationsResolverViewRange=e),this._cachedModelDecorationsResolver}getInlineDecorationsOnLine(e,t=!1,n=!1){const r=new B(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(r,t,n).inlineDecorations[0]}_getDecorationsInRange(e,t,n){const r=this._linesCollection.getDecorationsInRange(e,this.editorId,MA(this.configuration.options),t,n),o=e.startLineNumber,s=e.endLineNumber,a=[];let l=0;const c=[];for(let u=o;u<=s;u++)c[u-o]=[];for(let u=0,d=r.length;ut===1)}function xX(i,e){return c_e(i,e.range,t=>t===2)}function c_e(i,e,t){for(let n=e.startLineNumber;n<=e.endLineNumber;n++){const r=i.tokenization.getLineTokens(n),o=n===e.startLineNumber,s=n===e.endLineNumber;let a=o?r.findTokenIndexAtOffset(e.startColumn-1):0;for(;ae.endColumn-1);){if(!t(r.getStandardTokenType(a)))return!1;a++}}return!0}function j6(i,e){return i===null?e?CP.INSTANCE:yP.INSTANCE:new JUe(i,e)}class JUe{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,n){this._assertVisible();const r=n>0?this._projectionData.breakOffsets[n-1]:0,o=this._projectionData.breakOffsets[n];let s;if(this._projectionData.injectionOffsets!==null){const a=this._projectionData.injectionOffsets.map((c,u)=>new gh(0,0,c+1,this._projectionData.injectionOptions[u],0));s=gh.applyInjectedText(e.getLineContent(t),a).substring(r,o)}else s=e.getValueInRange({startLineNumber:t,startColumn:r+1,endLineNumber:t,endColumn:o+1});return n>0&&(s=hoe(this._projectionData.wrappedTextIndentLength)+s),s}getViewLineLength(e,t,n){return this._assertVisible(),this._projectionData.getLineLength(n)}getViewLineMinColumn(e,t,n){return this._assertVisible(),this._projectionData.getMinOutputOffset(n)+1}getViewLineMaxColumn(e,t,n){return this._assertVisible(),this._projectionData.getMaxOutputOffset(n)+1}getViewLineData(e,t,n){const r=new Array;return this.getViewLinesData(e,t,n,1,0,[!0],r),r[0]}getViewLinesData(e,t,n,r,o,s,a){this._assertVisible();const l=this._projectionData,c=l.injectionOffsets,u=l.injectionOptions;let d=null;if(c){d=[];let f=0,g=0;for(let p=0;p0?l.breakOffsets[p-1]:0,_=l.breakOffsets[p];for(;g_)break;if(m0?l.wrappedTextIndentLength:0,k=D+Math.max(S-m,0),T=D+Math.min(L-m,_-m);k!==T&&v.push(new a7e(k,T,E.inlineClassName,E.inlineClassNameAffectsLetterSpacing))}}if(L<=_)f+=y,g++;else break}}}let h;c?h=e.tokenization.getLineTokens(t).withInserted(c.map((f,g)=>({offset:f,text:u[g].content,tokenMetadata:Lo.defaultTokenMetadata}))):h=e.tokenization.getLineTokens(t);for(let f=n;f0?r.wrappedTextIndentLength:0,s=n>0?r.breakOffsets[n-1]:0,a=r.breakOffsets[n],l=e.sliceAndInflate(s,a,o);let c=l.getLineContent();n>0&&(c=hoe(r.wrappedTextIndentLength)+c);const u=this._projectionData.getMinOutputOffset(n)+1,d=c.length+1,h=n+1=K6.length)for(let e=1;e<=i;e++)K6[e]=eje(e);return K6[i]}function eje(i){return new Array(i+1).join(" ")}class tje{constructor(e,t,n,r,o,s,a,l,c,u){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=n,this._monospaceLineBreaksComputerFactory=r,this.fontInfo=o,this.tabSize=s,this.wrappingStrategy=a,this.wrappingColumn=l,this.wrappingIndent=c,this.wordBreak=u,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new ije(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));const n=this.model.getLinesContent(),r=this.model.getInjectedTextDecorations(this._editorId),o=n.length,s=this.createLineBreaksComputer(),a=new Dp(gh.fromDecorations(r));for(let p=0;pm.lineNumber===p+1);s.addRequest(n[p],v,t?t[p]:null)}const l=s.finalize(),c=[],u=this.hiddenAreasDecorationIds.map(p=>this.model.getDecorationRange(p)).sort(B.compareRangesUsingStarts);let d=1,h=0,f=-1,g=f+1=d&&v<=h,_=j6(l[p],!m);c[p]=_.getViewLineCount(),this.modelLineProjections[p]=_}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new V6e(c)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){const t=e.map(h=>this.model.validateRange(h)),n=nje(t),r=this.hiddenAreasDecorationIds.map(h=>this.model.getDecorationRange(h)).sort(B.compareRangesUsingStarts);if(n.length===r.length){let h=!1;for(let f=0;f({range:h,options:sn.EMPTY}));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,o);const s=n;let a=1,l=0,c=-1,u=c+1=a&&f<=l?this.modelLineProjections[h].isVisible()&&(this.modelLineProjections[h]=this.modelLineProjections[h].setVisible(!1),g=!0):(d=!0,this.modelLineProjections[h].isVisible()||(this.modelLineProjections[h]=this.modelLineProjections[h].setVisible(!0),g=!0)),g){const p=this.modelLineProjections[h].getViewLineCount();this.projectedModelLineLineCounts.setValue(h,p)}}return d||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return e<1||e>this.modelLineProjections.length?!1:this.modelLineProjections[e-1].isVisible()}getModelLineViewLineCount(e){return e<1||e>this.modelLineProjections.length?1:this.modelLineProjections[e-1].getViewLineCount()}setTabSize(e){return this.tabSize===e?!1:(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,n,r,o){const s=this.fontInfo.equals(e),a=this.wrappingStrategy===t,l=this.wrappingColumn===n,c=this.wrappingIndent===r,u=this.wordBreak===o;if(s&&a&&l&&c&&u)return!1;const d=s&&a&&!l&&c&&u;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=n,this.wrappingIndent=r,this.wordBreak=o;let h=null;if(d){h=[];for(let f=0,g=this.modelLineProjections.length;f2&&!this.modelLineProjections[t-2].isVisible(),s=t===1?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1;let a=0;const l=[],c=[];for(let u=0,d=r.length;ul?(u=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,d=u+l-1,g=d+1,p=g+(o-l)-1,c=!0):ot?t:e|0}getActiveIndentGuide(e,t,n){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),n=this._toValidViewLineNumber(n);const r=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),s=this.convertViewPositionToModelPosition(n,this.getViewLineMinColumn(n)),a=this.model.guides.getActiveIndentGuide(r.lineNumber,o.lineNumber,s.lineNumber),l=this.convertModelPositionToViewPosition(a.startLineNumber,1),c=this.convertModelPositionToViewPosition(a.endLineNumber,this.model.getLineMaxColumn(a.endLineNumber));return{startLineNumber:l.lineNumber,endLineNumber:c.lineNumber,indent:a.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);const t=this.projectedModelLineLineCounts.getIndexOf(e-1),n=t.index,r=t.remainder;return new foe(n+1,r)}getMinColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getMaxColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getModelStartPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],n=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),r=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,n);return new ae(e.modelLineNumber,r)}getModelEndPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],n=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),r=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,n);return new ae(e.modelLineNumber,r)}getViewLineInfosGroupedByModelRanges(e,t){const n=this.getViewLineInfo(e),r=this.getViewLineInfo(t),o=new Array;let s=this.getModelStartPositionOfViewLine(n),a=new Array;for(let l=n.modelLineNumber;l<=r.modelLineNumber;l++){const c=this.modelLineProjections[l-1];if(c.isVisible()){const u=l===n.modelLineNumber?n.modelLineWrappedLineIdx:0,d=l===r.modelLineNumber?r.modelLineWrappedLineIdx+1:c.getViewLineCount();for(let h=u;h{if(f.forWrappedLinesAfterColumn!==-1&&this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesAfterColumn).lineNumber>=u.modelLineWrappedLineIdx||f.forWrappedLinesBeforeOrAtColumn!==-1&&this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesBeforeOrAtColumn).lineNumberu.modelLineWrappedLineIdx)return}const p=this.convertModelPositionToViewPosition(u.modelLineNumber,f.horizontalLine.endColumn),v=this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,f.horizontalLine.endColumn);return v.lineNumber===u.modelLineWrappedLineIdx?new V0(f.visibleColumn,g,f.className,new pE(f.horizontalLine.top,p.column),-1,-1):v.lineNumber!!f))}}return s}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const n=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),r=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let o=[];const s=[],a=[],l=n.lineNumber-1,c=r.lineNumber-1;let u=null;for(let g=l;g<=c;g++){const p=this.modelLineProjections[g];if(p.isVisible()){const v=p.getViewLineNumberOfModelPosition(0,g===l?n.column:1),m=p.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(g+1)),_=m-v+1;let y=0;_>1&&p.getViewLineMinColumn(this.model,g+1,m)===1&&(y=v===0?1:2),s.push(_),a.push(y),u===null&&(u=new ae(g+1,0))}else u!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(u.lineNumber,g)),u=null)}u!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(u.lineNumber,r.lineNumber)),u=null);const d=t-e+1,h=new Array(d);let f=0;for(let g=0,p=o.length;gt&&(g=!0,f=t-o+1),d.getViewLinesData(this.model,c+1,h,f,o-e,n,l),o+=f,g)break}return l}validateViewPosition(e,t,n){e=this._toValidViewLineNumber(e);const r=this.projectedModelLineLineCounts.getIndexOf(e-1),o=r.index,s=r.remainder,a=this.modelLineProjections[o],l=a.getViewLineMinColumn(this.model,o+1,s),c=a.getViewLineMaxColumn(this.model,o+1,s);tc&&(t=c);const u=a.getModelColumnOfViewPosition(s,t);return this.model.validatePosition(new ae(o+1,u)).equals(n)?new ae(e,t):this.convertModelPositionToViewPosition(n.lineNumber,n.column)}validateViewRange(e,t){const n=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),r=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new B(n.lineNumber,n.column,r.lineNumber,r.column)}convertViewPositionToModelPosition(e,t){const n=this.getViewLineInfo(e),r=this.modelLineProjections[n.modelLineNumber-1].getModelColumnOfViewPosition(n.modelLineWrappedLineIdx,t);return this.model.validatePosition(new ae(n.modelLineNumber,r))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),n=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new B(t.lineNumber,t.column,n.lineNumber,n.column)}convertModelPositionToViewPosition(e,t,n=2,r=!1,o=!1){const s=this.model.validatePosition(new ae(e,t)),a=s.lineNumber,l=s.column;let c=a-1,u=!1;if(o)for(;c0&&!this.modelLineProjections[c].isVisible();)c--,u=!0;if(c===0&&!this.modelLineProjections[c].isVisible())return new ae(r?0:1,1);const d=1+this.projectedModelLineLineCounts.getPrefixSum(c);let h;return u?o?h=this.modelLineProjections[c].getViewPositionOfModelPosition(d,1,n):h=this.modelLineProjections[c].getViewPositionOfModelPosition(d,this.model.getLineMaxColumn(c+1),n):h=this.modelLineProjections[a-1].getViewPositionOfModelPosition(d,l,n),h}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){const n=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return B.fromPositions(n)}else{const n=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),r=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new B(n.lineNumber,n.column,r.lineNumber,r.column)}}getViewLineNumberOfModelPosition(e,t){let n=e-1;if(this.modelLineProjections[n].isVisible()){const o=1+this.projectedModelLineLineCounts.getPrefixSum(n);return this.modelLineProjections[n].getViewLineNumberOfModelPosition(o,t)}for(;n>0&&!this.modelLineProjections[n].isVisible();)n--;if(n===0&&!this.modelLineProjections[n].isVisible())return 1;const r=1+this.projectedModelLineLineCounts.getPrefixSum(n);return this.modelLineProjections[n].getViewLineNumberOfModelPosition(r,this.model.getLineMaxColumn(n+1))}getDecorationsInRange(e,t,n,r,o){const s=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),a=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(a.lineNumber-s.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new B(s.lineNumber,1,a.lineNumber,a.column),t,n,r,o);let l=[];const c=s.lineNumber-1,u=a.lineNumber-1;let d=null;for(let p=c;p<=u;p++)if(this.modelLineProjections[p].isVisible())d===null&&(d=new ae(p+1,p===c?s.column:1));else if(d!==null){const m=this.model.getLineMaxColumn(p);l=l.concat(this.model.getDecorationsInRange(new B(d.lineNumber,d.column,p,m),t,n,r)),d=null}d!==null&&(l=l.concat(this.model.getDecorationsInRange(new B(d.lineNumber,d.column,a.lineNumber,a.column),t,n,r)),d=null),l.sort((p,v)=>{const m=B.compareRangesUsingStarts(p.range,v.range);return m===0?p.idv.id?1:0:m});const h=[];let f=0,g=null;for(const p of l){const v=p.id;g!==v&&(g=v,h[f++]=p)}return h}getInjectedTextAt(e){const t=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[t.modelLineNumber-1].getInjectedTextAt(t.modelLineWrappedLineIdx,e.column)}normalizePosition(e,t){const n=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[n.modelLineNumber-1].normalizePosition(n.modelLineWrappedLineIdx,e,t)}getLineIndentColumn(e){const t=this.getViewLineInfo(e);return t.modelLineWrappedLineIdx===0?this.model.getLineIndentColumn(t.modelLineNumber):0}}function nje(i){if(i.length===0)return[];const e=i.slice();e.sort(B.compareRangesUsingStarts);const t=[];let n=e[0].startLineNumber,r=e[0].endLineNumber;for(let o=1,s=e.length;or+1?(t.push(new B(n,1,r,1)),n=a.startLineNumber,r=a.endLineNumber):a.endLineNumber>r&&(r=a.endLineNumber)}return t.push(new B(n,1,r,1)),t}class foe{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class goe{constructor(e,t){this.modelRange=e,this.viewLines=t}}class ije{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,n,r){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t,n,r)}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 rje{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new oje(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,n,r){return!1}createLineBreaksComputer(){const e=[];return{addRequest:(t,n,r)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,n){return new QH(t,n)}onModelLinesInserted(e,t,n,r){return new JH(t,n)}onModelLineChanged(e,t,n){return[!1,new a_e(t,1),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,n){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,n){return new Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){const n=t-e+1,r=new Array(n);for(let o=0;ot)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}const J_=$f.Right;class sje{constructor(e){this.persist=0,this._requiredLanes=1,this.lanes=new Uint8Array(Math.ceil((e+1)*J_/8))}reset(e){const t=Math.ceil((e+1)*J_/8);this.lanes.length>>3]|=1<>>3]&1<>>3]&1<this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=LX.create(this.model),this.glyphLanes=new sje(0),this.model.isTooLargeForTokenization())this._lines=new rje(this.model);else{const u=this._configuration.options,d=u.get(50),h=u.get(138),f=u.get(145),g=u.get(137),p=u.get(129);this._lines=new tje(this._editorId,this.model,r,o,d,this.model.getOptions().tabSize,h,f.wrappingColumn,g,p)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new VUe(n,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new ZUe(this._configuration,this.getLineCount(),s)),this._register(this.viewLayout.onDidScroll(u=>{u.scrollTopChanged&&this._handleVisibleLinesChanged(),u.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new EUe(u)),this._eventDispatcher.emitOutgoingEvent(new yX(u.oldScrollWidth,u.oldScrollLeft,u.oldScrollHeight,u.oldScrollTop,u.scrollWidth,u.scrollLeft,u.scrollHeight,u.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(u=>{this._eventDispatcher.emitOutgoingEvent(u)})),this._decorations=new QUe(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(u=>{try{const d=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(d,u)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(jk.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new kUe)})),this._register(this._themeService.onDidColorThemeChange(u=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new DUe(u))})),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this._viewportStart.dispose(),this._eventDispatcher.dispose()}createLineBreaksComputer(){return this._lines.createLineBreaksComputer()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}getModelVisibleRanges(){const e=this.viewLayout.getLinesViewportData(),t=new B(e.startLineNumber,this.getLineMinColumn(e.startLineNumber),e.endLineNumber,this.getLineMaxColumn(e.endLineNumber));return this._toModelVisibleRanges(t)}visibleLinesStabilized(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!0)}_handleVisibleLinesChanged(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!1)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new xUe(e)),this._eventDispatcher.emitOutgoingEvent(new CX(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new CUe)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new yUe)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new ae(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new moe(t,this._viewportStart.startLineDelta)}return new moe(null,0)}_onConfigurationChanged(e,t){const n=this._captureStableViewport(),r=this._configuration.options,o=r.get(50),s=r.get(138),a=r.get(145),l=r.get(137),c=r.get(129);this._lines.setWrappingSettings(o,s,a.wrappingColumn,l,c)&&(e.emitViewEvent(new xR),e.emitViewEvent(new LR),e.emitViewEvent(new Q_(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(91)&&(this._decorations.reset(),e.emitViewEvent(new Q_(null))),t.hasChanged(98)&&(this._decorations.reset(),e.emitViewEvent(new Q_(null))),e.emitViewEvent(new wUe(t)),this.viewLayout.onConfigurationChanged(t),n.recoverViewportStart(this.coordinatesConverter,this.viewLayout),YC.shouldRecreate(t)&&(this.cursorConfig=new YC(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText(e=>{try{const n=this._eventDispatcher.beginEmitViewEvents();let r=!1,o=!1;const s=e instanceof ob?e.rawContentChangedEvent.changes:e.changes,a=e instanceof ob?e.rawContentChangedEvent.versionId:null,l=this._lines.createLineBreaksComputer();for(const d of s)switch(d.changeType){case 4:{for(let h=0;h!p.ownerId||p.ownerId===this._editorId)),l.addRequest(f,g,null)}break}case 2:{let h=null;d.injectedText&&(h=d.injectedText.filter(f=>!f.ownerId||f.ownerId===this._editorId)),l.addRequest(d.detail,h,null);break}}const c=l.finalize(),u=new Dp(c);for(const d of s)switch(d.changeType){case 1:{this._lines.onModelFlushed(),n.emitViewEvent(new xR),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),r=!0;break}case 3:{const h=this._lines.onModelLinesDeleted(a,d.fromLineNumber,d.toLineNumber);h!==null&&(n.emitViewEvent(h),this.viewLayout.onLinesDeleted(h.fromLineNumber,h.toLineNumber)),r=!0;break}case 4:{const h=u.takeCount(d.detail.length),f=this._lines.onModelLinesInserted(a,d.fromLineNumber,d.toLineNumber,h);f!==null&&(n.emitViewEvent(f),this.viewLayout.onLinesInserted(f.fromLineNumber,f.toLineNumber)),r=!0;break}case 2:{const h=u.dequeue(),[f,g,p,v]=this._lines.onModelLineChanged(a,d.lineNumber,h);o=f,g&&n.emitViewEvent(g),p&&(n.emitViewEvent(p),this.viewLayout.onLinesInserted(p.fromLineNumber,p.toLineNumber)),v&&(n.emitViewEvent(v),this.viewLayout.onLinesDeleted(v.fromLineNumber,v.toLineNumber));break}case 5:break}a!==null&&this._lines.acceptVersionId(a),this.viewLayout.onHeightMaybeChanged(),!r&&o&&(n.emitViewEvent(new LR),n.emitViewEvent(new Q_(null)),this._cursor.onLineMappingChanged(n),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}const t=this._viewportStart.isValid;if(this._viewportStart.invalidate(),this._configuration.setModelLineCount(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&t){const n=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(n){const r=this.coordinatesConverter.convertModelPositionToViewPosition(n.getStartPosition()),o=this.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber);this.viewLayout.setScrollPosition({scrollTop:o+this._viewportStart.startLineDelta},1)}}try{const n=this._eventDispatcher.beginEmitViewEvents();e instanceof ob&&n.emitOutgoingEvent(new WUe(e.contentChangedEvent)),this._cursor.onModelContentChanged(n,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._handleVisibleLinesChanged()})),this._register(this.model.onDidChangeTokens(e=>{const t=[];for(let n=0,r=e.ranges.length;n{this._eventDispatcher.emitSingleViewEvent(new LUe),this.cursorConfig=new YC(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new BUe(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new YC(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new FUe(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const t=this._eventDispatcher.beginEmitViewEvents();t.emitViewEvent(new xR),t.emitViewEvent(new LR),t.emitViewEvent(new Q_(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new YC(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new $Ue(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new Q_(e)),this._eventDispatcher.emitOutgoingEvent(new OUe(e))}))}setHiddenAreas(e,t){var n;this.hiddenAreasModel.setHiddenAreas(t,e);const r=this.hiddenAreasModel.getMergedRanges();if(r===this.previousHiddenAreas)return;this.previousHiddenAreas=r;const o=this._captureStableViewport();let s=!1;try{const a=this._eventDispatcher.beginEmitViewEvents();s=this._lines.setHiddenAreas(r),s&&(a.emitViewEvent(new xR),a.emitViewEvent(new LR),a.emitViewEvent(new Q_(null)),this._cursor.onLineMappingChanged(a),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged());const l=(n=o.viewportStartModelPosition)===null||n===void 0?void 0:n.lineNumber;l&&r.some(u=>u.startLineNumber<=l&&l<=u.endLineNumber)||o.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),s&&this._eventDispatcher.emitOutgoingEvent(new AUe)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(144),t=this._configuration.options.get(67),n=Math.max(20,Math.round(e.height/t)),r=this.viewLayout.getLinesViewportData(),o=Math.max(1,r.completelyVisibleStartLineNumber-n),s=Math.min(this.getLineCount(),r.completelyVisibleEndLineNumber+n);return this._toModelVisibleRanges(new B(o,this.getLineMinColumn(o),s,this.getLineMaxColumn(s)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}getHiddenAreas(){return this._lines.getHiddenAreas()}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),n=this._lines.getHiddenAreas();if(n.length===0)return[t];const r=[];let o=0,s=t.startLineNumber,a=t.startColumn;const l=t.endLineNumber,c=t.endColumn;for(let u=0,d=n.length;ul||(s"u")return this._reduceRestoreStateCompatibility(e);const t=this.model.validatePosition(e.firstPosition),n=this.coordinatesConverter.convertModelPositionToViewPosition(t),r=this.viewLayout.getVerticalOffsetForLineNumber(n.lineNumber)-e.firstPositionDeltaTop;return{scrollLeft:e.scrollLeft,scrollTop:r}}_reduceRestoreStateCompatibility(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTopWithoutViewZones}}getTabSize(){return this.model.getOptions().tabSize}getLineCount(){return this._lines.getViewLineCount()}setViewport(e,t,n){this._viewportStart.update(this,e)}getActiveIndentGuide(e,t,n){return this._lines.getActiveIndentGuide(e,t,n)}getLinesIndentGuides(e,t){return this._lines.getViewLinesIndentGuides(e,t)}getBracketGuidesInRangeByLine(e,t,n,r){return this._lines.getViewLinesBracketGuides(e,t,n,r)}getLineContent(e){return this._lines.getViewLineContent(e)}getLineLength(e){return this._lines.getViewLineLength(e)}getLineMinColumn(e){return this._lines.getViewLineMinColumn(e)}getLineMaxColumn(e){return this._lines.getViewLineMaxColumn(e)}getLineFirstNonWhitespaceColumn(e){const t=Ys(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=th(this.getLineContent(e));return t===-1?0:t+2}getMinimapDecorationsInRange(e){return this._decorations.getMinimapDecorationsInRange(e)}getDecorationsInViewport(e){return this._decorations.getDecorationsViewportData(e).decorations}getInjectedTextAt(e){return this._lines.getInjectedTextAt(e)}getViewportViewLineRenderingData(e,t){const r=this._decorations.getDecorationsViewportData(e).inlineDecorations[t-e.startLineNumber];return this._getViewLineRenderingData(t,r)}getViewLineRenderingData(e){const t=this._decorations.getInlineDecorationsOnLine(e);return this._getViewLineRenderingData(e,t)}_getViewLineRenderingData(e,t){const n=this.model.mightContainRTL(),r=this.model.mightContainNonBasicASCII(),o=this.getTabSize(),s=this._lines.getViewLineData(e);return s.inlineDecorations&&(t=[...t,...s.inlineDecorations.map(a=>a.toInlineDecoration(e))]),new vc(s.minColumn,s.maxColumn,s.content,s.continuesWithWrappedLine,n,r,s.tokens,t,o,s.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,n){const r=this._lines.getViewLinesData(e,t,n);return new s7e(this.getTabSize(),r)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,MA(this._configuration.options)),n=new lje;for(const r of t){const o=r.options,s=o.overviewRuler;if(!s)continue;const a=s.position;if(a===0)continue;const l=s.getColor(e.value),c=this.coordinatesConverter.getViewLineNumberOfModelPosition(r.range.startLineNumber,r.range.startColumn),u=this.coordinatesConverter.getViewLineNumberOfModelPosition(r.range.endLineNumber,r.range.endColumn);n.accept(l,o.zIndex,c,u,a)}return n.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e){const n=t.options.overviewRuler;n==null||n.invalidateCachedColor();const r=t.options.minimap;r==null||r.invalidateCachedColor()}}getValueInRange(e,t){const n=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(n,t)}getValueLengthInRange(e,t){const n=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueLengthInRange(n,t)}modifyPosition(e,t){const n=this.coordinatesConverter.convertViewPositionToModelPosition(e),r=this.model.modifyPosition(n,t);return this.coordinatesConverter.convertModelPositionToViewPosition(r)}deduceModelPositionRelativeToViewPosition(e,t,n){const r=this.coordinatesConverter.convertViewPositionToModelPosition(e);this.model.getEOL().length===2&&(t<0?t-=n:t+=n);const s=this.model.getOffsetAt(r)+t;return this.model.getPositionAt(s)}getPlainTextToCopy(e,t,n){const r=n?`\r +`:this.model.getEOL();e=e.slice(0),e.sort(B.compareRangesUsingStarts);let o=!1,s=!1;for(const l of e)l.isEmpty()?o=!0:s=!0;if(!s){if(!t)return"";const l=e.map(u=>u.startLineNumber);let c="";for(let u=0;u0&&l[u-1]===l[u]||(c+=this.model.getLineContent(l[u])+r);return c}if(o&&t){const l=[];let c=0;for(const u of e){const d=u.startLineNumber;u.isEmpty()?d!==c&&l.push(this.model.getLineContent(d)):l.push(this.model.getValueInRange(u,n?2:0)),c=d}return l.length===1?l[0]:l}const a=[];for(const l of e)l.isEmpty()||a.push(this.model.getValueInRange(l,n?2:0));return a.length===1?a[0]:a}getRichTextToCopy(e,t){const n=this.model.getLanguageId();if(n===hc||e.length!==1)return null;let r=e[0];if(r.isEmpty()){if(!t)return null;const u=r.startLineNumber;r=new B(u,this.model.getLineMinColumn(u),u,this.model.getLineMaxColumn(u))}const o=this._configuration.options.get(50),s=this._getColorMap(),l=/[:;\\\/<>]/.test(o.fontFamily)||o.fontFamily===Qa.fontFamily;let c;return l?c=Qa.fontFamily:(c=o.fontFamily,c=c.replace(/"/g,"'"),/[,']/.test(c)||/[+ ]/.test(c)&&(c=`'${c}'`),c=`${c}, ${Qa.fontFamily}`),{mode:n,html:`
`+this._getHTMLToCopy(r,s)+"
"}}_getHTMLToCopy(e,t){const n=e.startLineNumber,r=e.startColumn,o=e.endLineNumber,s=e.endColumn,a=this.getTabSize();let l="";for(let c=n;c<=o;c++){const u=this.model.tokenization.getLineTokens(c),d=u.getLineContent(),h=c===n?r-1:0,f=c===o?s-1:d.length;d===""?l+="
":l+=KUe(d,u.inflate(),t,h,f,a,Rs)}return l}_getColorMap(){const e=hr.getColorMap(),t=["#000000"];if(e)for(let n=1,r=e.length;nthis._cursor.setStates(r,e,t,n))}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,n=0){this._withViewEventsCollector(r=>this._cursor.setSelections(r,e,t,n))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector(t=>this._cursor.restoreState(t,e))}_executeCursorEdit(e){if(this._cursor.context.cursorConfig.readOnly){this._eventDispatcher.emitOutgoingEvent(new PUe);return}this._withViewEventsCollector(e)}executeEdits(e,t,n){this._executeCursorEdit(r=>this._cursor.executeEdits(r,e,t,n))}startComposition(){this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(n=>this._cursor.type(n,e,t))}compositionType(e,t,n,r,o){this._executeCursorEdit(s=>this._cursor.compositionType(s,e,t,n,r,o))}paste(e,t,n,r){this._executeCursorEdit(o=>this._cursor.paste(o,e,t,n,r))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(n=>this._cursor.executeCommand(n,e,t))}executeCommands(e,t){this._executeCursorEdit(n=>this._cursor.executeCommands(n,e,t))}revealPrimaryCursor(e,t,n=!1){this._withViewEventsCollector(r=>this._cursor.revealPrimary(r,e,n,0,t,0))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),n=new B(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(r=>r.emitViewEvent(new SM(e,!1,n,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),n=new B(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(r=>r.emitViewEvent(new SM(e,!1,n,null,0,!0,0)))}revealRange(e,t,n,r,o){this._withViewEventsCollector(s=>s.emitViewEvent(new SM(e,!1,n,null,r,t,o)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new TUe),this._eventDispatcher.emitOutgoingEvent(new MUe))}_withViewEventsCollector(e){try{const t=this._eventDispatcher.beginEmitViewEvents();return e(t)}finally{this._eventDispatcher.endEmitViewEvents()}}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}};class LX{static create(e){const t=e._setTrackedRange(null,new B(1,1,1,1),1);return new LX(e,1,!1,t,0)}get viewLineNumber(){return this._viewLineNumber}get isValid(){return this._isValid}get modelTrackedRange(){return this._modelTrackedRange}get startLineDelta(){return this._startLineDelta}constructor(e,t,n,r,o){this._model=e,this._viewLineNumber=t,this._isValid=n,this._modelTrackedRange=r,this._startLineDelta=o}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,1)}update(e,t){const n=e.coordinatesConverter.convertViewPositionToModelPosition(new ae(t,e.getLineMinColumn(t))),r=e.model._setTrackedRange(this._modelTrackedRange,new B(n.lineNumber,n.column,n.lineNumber,n.column),1),o=e.viewLayout.getVerticalOffsetForLineNumber(t),s=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=r,this._startLineDelta=s-o}invalidate(){this._isValid=!1}}class lje{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,n,r,o){const s=this._asMap[e];if(s){const a=s.data,l=a[a.length-3],c=a[a.length-1];if(l===o&&c+1>=n){r>c&&(a[a.length-1]=r);return}a.push(o,n,r)}else{const a=new OD(e,t,[o,n,r]);this._asMap[e]=a,this.asArray.push(a)}}}class cje{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const n=this.hiddenAreas.get(e);n&&poe(n,t)||(this.hiddenAreas.set(e,t),this.shouldRecompute=!0)}getMergedRanges(){if(!this.shouldRecompute)return this.ranges;this.shouldRecompute=!1;const e=Array.from(this.hiddenAreas.values()).reduce((t,n)=>uje(t,n),[]);return poe(this.ranges,e)?this.ranges:(this.ranges=e,this.ranges)}}function uje(i,e){const t=[];let n=0,r=0;for(;n=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},mg=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},p0;let fje=0,gje=class{constructor(e,t,n,r,o,s){this.model=e,this.viewModel=t,this.view=n,this.hasRealView=r,this.listenersToRemove=o,this.attachedView=s}dispose(){si(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}},$w=p0=class extends fe{get isSimpleWidget(){return this._configuration.isSimpleWidget}constructor(e,t,n,r,o,s,a,l,c,u,d,h){var f;super(),this.languageConfigurationService=d,this._deliveryQueue=n5e(),this._contributions=this._register(new UVe),this._onDidDispose=this._register(new se),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new se({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new se({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new se({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new se({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new se({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeModelTokens=this._register(new se({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new se({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onWillChangeModel=this._register(new se({deliveryQueue:this._deliveryQueue})),this.onWillChangeModel=this._onWillChangeModel.event,this._onDidChangeModel=this._register(new se({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new se({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new se({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new se({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new voe({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new voe({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new Hs(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new se({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new se({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new se({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new se({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection(),o.willCreateCodeEditor();const g={...t};this._domElement=e,this._overflowWidgetsDomNode=g.overflowWidgetsDomNode,delete g.overflowWidgetsDomNode,this._id=++fje,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=n.telemetryData,this._configuration=this._register(this._createConfiguration(n.isSimpleWidget||!1,g,u)),this._register(this._configuration.onDidChange(m=>{this._onDidChangeConfiguration.fire(m);const _=this._configuration.options;if(m.hasChanged(144)){const y=_.get(144);this._onDidLayoutChange.fire(y)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=c,this._codeEditorService=o,this._commandService=s,this._themeService=l,this._register(new pje(this,this._contextKeyService)),this._register(new mje(this,this._contextKeyService,h)),this._instantiationService=r.createChild(new Kk([Vt,this._contextKeyService])),this._modelData=null,this._focusTracker=new vje(e,this._overflowWidgetsDomNode),this._register(this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())})),this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={};let p;Array.isArray(n.contributions)?p=n.contributions:p=Ay.getEditorContributions(),this._contributions.initialize(this,p,this._instantiationService);for(const m of Ay.getEditorActions()){if(this._actions.has(m.id)){en(new Error(`Cannot have two actions with the same id ${m.id}`));continue}const _=new Wve(m.id,m.label,m.alias,m.metadata,(f=m.precondition)!==null&&f!==void 0?f:void 0,y=>this._instantiationService.invokeFunction(S=>Promise.resolve(m.runEditorCommand(S,this,y))),this._contextKeyService);this._actions.set(_.id,_)}const v=()=>!this._configuration.options.get(91)&&this._configuration.options.get(36).enabled;this._register(new h8e(this._domElement,{onDragOver:m=>{if(!v())return;const _=this.getTargetAtClientPoint(m.clientX,m.clientY);_!=null&&_.position&&this.showDropIndicatorAt(_.position)},onDrop:async m=>{if(!v()||(this.removeDropIndicator(),!m.dataTransfer))return;const _=this.getTargetAtClientPoint(m.clientX,m.clientY);_!=null&&_.position&&this._onDropIntoEditor.fire({position:_.position,event:m})},onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){var t;(t=this._modelData)===null||t===void 0||t.view.writeScreenReaderContent(e)}_createConfiguration(e,t,n){return new DH(e,t,this._domElement,n)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return Ok.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._focusTracker.dispose(),this._actions.clear(),this._contentWidgets={},this._overlayWidgets={},this._removeDecorationTypes(),this._postDetachModelCleanup(this._detachModel()),this._onDidDispose.fire(),super.dispose()}invokeWithinContext(e){return this._instantiationService.invokeFunction(e)}updateOptions(e){this._configuration.updateOptions(e||{})}getOptions(){return this._configuration.options}getOption(e){return this._configuration.options.get(e)}getRawOptions(){return this._configuration.getRawOptions()}getOverflowWidgetsDomNode(){return this._overflowWidgetsDomNode}getConfiguredWordAtPosition(e){return this._modelData?Zn.getWordAtPosition(this._modelData.model,this._configuration.options.get(130),e):null}getValue(e=null){if(!this._modelData)return"";const t=!!(e&&e.preserveBOM);let n=0;return e&&e.lineEnding&&e.lineEnding===` `?n=1:e&&e.lineEnding&&e.lineEnding===`\r -`&&(n=2),this._modelData.model.getValue(n,t)}setValue(e){this._modelData&&this._modelData.model.setValue(e)}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){var t;const n=e;if(this._modelData===null&&n===null||this._modelData&&this._modelData.model===n)return;const r={oldModelUrl:((t=this._modelData)===null||t===void 0?void 0:t.model.uri)||null,newModelUrl:(n==null?void 0:n.uri)||null};this._onWillChangeModel.fire(r);const o=this.hasTextFocus(),s=this._detachModel();this._attachModel(n),o&&this.hasModel()&&this.focus(),this._removeDecorationTypes(),this._onDidChangeModel.fire(r),this._postDetachModelCleanup(s),this._contributionsDisposable=this._contributions.onAfterModelAttached()}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const n in t)this._removeDecorationType(e+"-"+n)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetAfterPosition(e,t,n,r){const o=e.model.validatePosition({lineNumber:t,column:n}),s=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(s.lineNumber,r)}getTopForLineNumber(e,t=!1){return this._modelData?m0._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?m0._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,n,r=!1){const o=e.model.validatePosition({lineNumber:t,column:n}),s=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(s.lineNumber,r)}getBottomForLineNumber(e,t=!1){return this._modelData?m0._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e,t){var n;(n=this._modelData)===null||n===void 0||n.viewModel.setHiddenAreas(e.map(r=>B.lift(r)),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),n=this._modelData.model.getOptions().tabSize;return go.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,n)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!ae.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,n,r){if(!this._modelData)return;if(!B.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",n,s,t,r)}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,n){if(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new B(e,1,e,1),t,!1,n)}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,n,r){if(!ae.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new B(e.lineNumber,e.column,e.lineNumber,e.column),t,n,r)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const n=yt.isISelection(e),r=B.isIRange(e);if(!n&&!r)throw new Error("Invalid arguments");if(n)this._setSelectionImpl(e,t);else if(r){const o={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(o,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const n=new yt(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[n])}revealLines(e,t,n=0){this._revealLines(e,t,0,n)}revealLinesInCenter(e,t,n=0){this._revealLines(e,t,1,n)}revealLinesInCenterIfOutsideViewport(e,t,n=0){this._revealLines(e,t,2,n)}revealLinesNearTop(e,t,n=0){this._revealLines(e,t,5,n)}_revealLines(e,t,n,r){if(typeof e!="number"||typeof t!="number")throw new Error("Invalid arguments");this._sendRevealRange(new B(e,1,t,1),n,!1,r)}revealRange(e,t=0,n=!1,r=!0){this._revealRange(e,n?1:0,r,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,n,r){if(!B.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(B.lift(e),t,n,r)}setSelections(e,t="api",n=0){if(this._modelData){if(!e||e.length===0)throw new Error("Invalid arguments");for(let r=0,o=e.length;r0&&this._modelData.viewModel.restoreCursorState(n):this._modelData.viewModel.restoreCursorState([n]),this._contributions.restoreViewState(t.contributionsState||{});const r=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(r)}}handleInitialized(){var e;(e=this._getViewModel())===null||e===void 0||e.visibleLinesStabilized()}getContribution(e){return this._contributions.get(e)}getActions(){return Array.from(this._actions.values())}getSupportedActions(){let e=this.getActions();return e=e.filter(t=>t.isSupported()),e}getAction(e){return this._actions.get(e)||null}trigger(e,t,n){switch(n=n||{},t){case"compositionStart":this._startComposition();return;case"compositionEnd":this._endComposition(e);return;case"type":{const o=n;this._type(e,o.text||"");return}case"replacePreviousChar":{const o=n;this._compositionType(e,o.text||"",o.replaceCharCnt||0,0,0);return}case"compositionType":{const o=n;this._compositionType(e,o.text||"",o.replacePrevCharCnt||0,o.replaceNextCharCnt||0,o.positionDelta||0);return}case"paste":{const o=n;this._paste(e,o.text||"",o.pasteOnNewLine||!1,o.multicursorText||null,o.mode||null);return}case"cut":this._cut(e);return}const r=this.getAction(t);if(r){Promise.resolve(r.run(n)).then(void 0,en);return}this._modelData&&(this._triggerEditorCommand(e,t,n)||this._triggerCommand(t,n))}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){this._modelData&&(this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){!this._modelData||t.length===0||(e==="keyboard"&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),e==="keyboard"&&this._onDidType.fire(t))}_compositionType(e,t,n,r,o){this._modelData&&this._modelData.viewModel.compositionType(t,n,r,o,e)}_paste(e,t,n,r,o){if(!this._modelData||t.length===0)return;const s=this._modelData.viewModel,a=s.getSelection().getStartPosition();s.paste(t,n,r,e);const l=s.getSelection().getStartPosition();e==="keyboard"&&this._onDidPaste.fire({range:new B(a.lineNumber,a.column,l.lineNumber,l.column),languageId:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,n){const r=Ay.getEditorCommand(t);return r?(n=n||{},n.source=e,this._instantiationService.invokeFunction(o=>{Promise.resolve(r.runEditorCommand(o,this,n)).then(void 0,en)}),!0):!1}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!this._modelData||this._configuration.options.get(91)?!1:(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!this._modelData||this._configuration.options.get(91)?!1:(this._modelData.model.popStackElement(),!0)}executeEdits(e,t,n){if(!this._modelData||this._configuration.options.get(91))return!1;let r;return n?Array.isArray(n)?r=()=>n:r=n:r=()=>null,this._modelData.viewModel.executeEdits(e,t,r),!0}executeCommand(e,t){this._modelData&&this._modelData.viewModel.executeCommand(t,e)}executeCommands(e,t){this._modelData&&this._modelData.viewModel.executeCommands(t,e)}createDecorationsCollection(e){return new _je(this,e)}changeDecorations(e){return this._modelData?this._modelData.model.changeDecorations(e,this._id):null}getLineDecorations(e){return this._modelData?this._modelData.model.getLineDecorations(e,this._id,MA(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,MA(this._configuration.options)):null}deltaDecorations(e,t){return this._modelData?e.length===0&&t.length===0?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){!this._modelData||e.length===0||this._modelData.model.changeDecorations(t=>{t.deltaDecorations(e,[])})}removeDecorationsByType(e){const t=this._decorationTypeKeysToIds[e];t&&this.changeDecorations(n=>n.deltaDecorations(t,[])),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(144)}createOverviewRuler(e){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.createOverviewRuler(e)}getContainerDomNode(){return this._domElement}getDomNode(){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.domNode.domNode}delegateVerticalScrollbarPointerDown(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateScrollFromMouseWheelEvent(e)}layout(e,t=!1){this._configuration.observeContainer(e),t||this.render()}focus(){!this._modelData||!this._modelData.hasRealView||this._modelData.view.focus()}hasTextFocus(){return!this._modelData||!this._modelData.hasRealView?!1:this._modelData.view.isFocused()}hasWidgetFocus(){return this._focusTracker&&this._focusTracker.hasFocus()}addContentWidget(e){const t={widget:e,position:e.getPosition()};this._contentWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a content widget with the same id:"+e.getId()),this._contentWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(t)}layoutContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const n=this._contentWidgets[t];n.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(n)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const n=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(n)}}addOverlayWidget(e){const t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting an overlay widget with the same id."),this._overlayWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addOverlayWidget(t)}layoutOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const n=this._overlayWidgets[t];n.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(n)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const n=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(n)}}addGlyphMarginWidget(e){const t={widget:e,position:e.getPosition()};this._glyphMarginWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a glyph margin widget with the same id."),this._glyphMarginWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addGlyphMarginWidget(t)}layoutGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const n=this._glyphMarginWidgets[t];n.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutGlyphMarginWidget(n)}}removeGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const n=this._glyphMarginWidgets[t];delete this._glyphMarginWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(n)}}changeViewZones(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.getTargetAtClientPoint(e,t)}getScrolledVisiblePosition(e){if(!this._modelData||!this._modelData.hasRealView)return null;const t=this._modelData.model.validatePosition(e),n=this._configuration.options,r=n.get(144),o=m0._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),s=this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+r.glyphMarginWidth+r.lineNumbersWidth+r.decorationsWidth-this.getScrollLeft();return{top:o,left:s,height:n.get(67)}}getOffsetForColumn(e,t){return!this._modelData||!this._modelData.hasRealView?-1:this._modelData.view.getOffsetForColumn(e,t)}render(e=!1){!this._modelData||!this._modelData.hasRealView||this._modelData.view.render(!0,e)}setAriaOptions(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.setAriaOptions(e)}applyFontInfo(e){ps(e,this._configuration.options.get(50))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),this._bannerDomNode=e,this._configuration.setReservedHeight(e?t:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_attachModel(e){if(!e){this._modelData=null;return}const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount());const n=e.onBeforeAttached(),r=new aje(this._id,this._configuration,e,aX.create(Pt(this._domElement)),_X.create(this._configuration.options),a=>Il(Pt(this._domElement),a),this.languageConfigurationService,this._themeService,n);t.push(e.onWillDispose(()=>this.setModel(null))),t.push(r.onEvent(a=>{switch(a.kind){case 0:this._onDidContentSizeChange.fire(a);break;case 1:this._editorTextFocus.setValue(a.hasFocus);break;case 2:this._onDidScrollChange.fire(a);break;case 3:this._onDidChangeViewZones.fire();break;case 4:this._onDidChangeHiddenAreas.fire();break;case 5:this._onDidAttemptReadOnlyEdit.fire();break;case 6:{if(a.reachedMaxCursorCount){const d=this.getOption(80),h=w("cursors.maximum","The number of cursors has been limited to {0}. Consider using [find and replace](https://code.visualstudio.com/docs/editor/codebasics#_find-and-replace) for larger changes or increase the editor multi cursor limit setting.",d);this._notificationService.prompt(j4.Warning,h,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:w("goToSetting","Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}const l=[];for(let d=0,h=a.selections.length;d{this._paste("keyboard",o,s,a,l)},type:o=>{this._type("keyboard",o)},compositionType:(o,s,a,l)=>{this._compositionType("keyboard",o,s,a,l)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:t={paste:(o,s,a,l)=>{const c={text:o,pasteOnNewLine:s,multicursorText:a,mode:l};this._commandService.executeCommand("paste",c)},type:o=>{const s={text:o};this._commandService.executeCommand("type",s)},compositionType:(o,s,a,l)=>{if(a||l){const c={text:o,replacePrevCharCnt:s,replaceNextCharCnt:a,positionDelta:l};this._commandService.executeCommand("compositionType",c)}else{const c={text:o,replaceCharCnt:s};this._commandService.executeCommand("replacePreviousChar",c)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const n=new $4(e.coordinatesConverter);return n.onKeyDown=o=>this._onKeyDown.fire(o),n.onKeyUp=o=>this._onKeyUp.fire(o),n.onContextMenu=o=>this._onContextMenu.fire(o),n.onMouseMove=o=>this._onMouseMove.fire(o),n.onMouseLeave=o=>this._onMouseLeave.fire(o),n.onMouseDown=o=>this._onMouseDown.fire(o),n.onMouseUp=o=>this._onMouseUp.fire(o),n.onMouseDrag=o=>this._onMouseDrag.fire(o),n.onMouseDrop=o=>this._onMouseDrop.fire(o),n.onMouseDropCanceled=o=>this._onMouseDropCanceled.fire(o),n.onMouseWheel=o=>this._onMouseWheel.fire(o),[new BH(t,this._configuration,this._themeService.getColorTheme(),e,n,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){e==null||e.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){var e;if((e=this._contributionsDisposable)===null||e===void 0||e.dispose(),this._contributionsDisposable=void 0,!this._modelData)return null;const t=this._modelData.model,n=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),n&&this._domElement.contains(n)&&this._domElement.removeChild(n),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),t}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return this._modelData!==null}showDropIndicatorAt(e){const t=[{range:new B(e.lineNumber,e.column,e.lineNumber,e.column),options:m0.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,t){this._contextKeyService.createKey(e,t)}};$w.dropIntoEditorDecorationOptions=sn.register({description:"workbench-dnd-target",className:"dnd-target"});$w=m0=hje([mg(3,Ot),mg(4,Un),mg(5,sr),mg(6,Vt),mg(7,To),mg(8,$r),mg(9,ud),mg(10,Di),mg(11,_t)],$w);class voe extends fe{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new se(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new se(this._emitterOptions)),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){const t=e?2:1;this._value!==t&&(this._value=t,this._value===2?this._onDidChangeToTrue.fire():this._value===1&&this._onDidChangeToFalse.fire())}}class Hs extends se{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class pje extends fe{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=j.editorSimpleInput.bindTo(t),this._editorFocus=j.focus.bindTo(t),this._textInputFocus=j.textInputFocus.bindTo(t),this._editorTextFocus=j.editorTextFocus.bindTo(t),this._tabMovesFocus=j.tabMovesFocus.bindTo(t),this._editorReadonly=j.readOnly.bindTo(t),this._inDiffEditor=j.inDiffEditor.bindTo(t),this._editorColumnSelection=j.columnSelection.bindTo(t),this._hasMultipleSelections=j.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=j.hasNonEmptySelection.bindTo(t),this._canUndo=j.canUndo.bindTo(t),this._canRedo=j.canRedo.bindTo(t),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromConfig())),this._register(this._editor.onDidChangeCursorSelection(()=>this._updateFromSelection())),this._register(this._editor.onDidFocusEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidFocusEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidChangeModel(()=>this._updateFromModel())),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromModel())),this._register(Rw.onDidChangeTabFocus(n=>this._tabMovesFocus.set(n))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._tabMovesFocus.set(Rw.getTabFocusMode()),this._editorReadonly.set(e.get(91)),this._inDiffEditor.set(e.get(61)),this._editorColumnSelection.set(e.get(22))}_updateFromSelection(){const e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some(t=>!t.isEmpty()))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())}_updateFromFocus(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())}_updateFromModel(){const e=this._editor.getModel();this._canUndo.set(!!(e&&e.canUndo())),this._canRedo.set(!!(e&&e.canRedo()))}}class mje extends fe{constructor(e,t,n){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=n,this._langId=j.languageId.bindTo(t),this._hasCompletionItemProvider=j.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=j.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=j.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=j.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=j.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=j.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=j.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=j.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=j.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=j.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=j.hasReferenceProvider.bindTo(t),this._hasRenameProvider=j.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=j.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=j.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=j.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=j.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=j.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=j.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInEmbeddedEditor=j.isInEmbeddedEditor.bindTo(t);const r=()=>this._update();this._register(e.onDidChangeModel(r)),this._register(e.onDidChangeModelLanguage(r)),this._register(n.completionProvider.onDidChange(r)),this._register(n.codeActionProvider.onDidChange(r)),this._register(n.codeLensProvider.onDidChange(r)),this._register(n.definitionProvider.onDidChange(r)),this._register(n.declarationProvider.onDidChange(r)),this._register(n.implementationProvider.onDidChange(r)),this._register(n.typeDefinitionProvider.onDidChange(r)),this._register(n.hoverProvider.onDidChange(r)),this._register(n.documentHighlightProvider.onDidChange(r)),this._register(n.documentSymbolProvider.onDidChange(r)),this._register(n.referenceProvider.onDidChange(r)),this._register(n.renameProvider.onDidChange(r)),this._register(n.documentFormattingEditProvider.onDidChange(r)),this._register(n.documentRangeFormattingEditProvider.onDidChange(r)),this._register(n.signatureHelpProvider.onDidChange(r)),this._register(n.inlayHintsProvider.onDidChange(r)),r()}dispose(){super.dispose()}reset(){this._contextKeyService.bufferChangeEvents(()=>{this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasDeclarationProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInEmbeddedEditor.reset()})}_update(){const e=this._editor.getModel();if(!e){this.reset();return}this._contextKeyService.bufferChangeEvents(()=>{this._langId.set(e.getLanguageId()),this._hasCompletionItemProvider.set(this._languageFeaturesService.completionProvider.has(e)),this._hasCodeActionsProvider.set(this._languageFeaturesService.codeActionProvider.has(e)),this._hasCodeLensProvider.set(this._languageFeaturesService.codeLensProvider.has(e)),this._hasDefinitionProvider.set(this._languageFeaturesService.definitionProvider.has(e)),this._hasDeclarationProvider.set(this._languageFeaturesService.declarationProvider.has(e)),this._hasImplementationProvider.set(this._languageFeaturesService.implementationProvider.has(e)),this._hasTypeDefinitionProvider.set(this._languageFeaturesService.typeDefinitionProvider.has(e)),this._hasHoverProvider.set(this._languageFeaturesService.hoverProvider.has(e)),this._hasDocumentHighlightProvider.set(this._languageFeaturesService.documentHighlightProvider.has(e)),this._hasDocumentSymbolProvider.set(this._languageFeaturesService.documentSymbolProvider.has(e)),this._hasReferenceProvider.set(this._languageFeaturesService.referenceProvider.has(e)),this._hasRenameProvider.set(this._languageFeaturesService.renameProvider.has(e)),this._hasSignatureHelpProvider.set(this._languageFeaturesService.signatureHelpProvider.has(e)),this._hasInlayHintsProvider.set(this._languageFeaturesService.inlayHintsProvider.has(e)),this._hasDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.has(e)||this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasMultipleDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.all(e).length+this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._isInEmbeddedEditor.set(e.uri.scheme===an.walkThroughSnippet||e.uri.scheme===an.vscodeChatCodeBlock)})}}class vje extends fe{constructor(e,t){super(),this._onChange=this._register(new se),this.onChange=this._onChange.event,this._hadFocus=void 0,this._hasDomElementFocus=!1,this._domFocusTracker=this._register(dh(e)),this._overflowWidgetsDomNodeHasFocus=!1,this._register(this._domFocusTracker.onDidFocus(()=>{this._hasDomElementFocus=!0,this._update()})),this._register(this._domFocusTracker.onDidBlur(()=>{this._hasDomElementFocus=!1,this._update()})),t&&(this._overflowWidgetsDomNode=this._register(dh(t)),this._register(this._overflowWidgetsDomNode.onDidFocus(()=>{this._overflowWidgetsDomNodeHasFocus=!0,this._update()})),this._register(this._overflowWidgetsDomNode.onDidBlur(()=>{this._overflowWidgetsDomNodeHasFocus=!1,this._update()})))}_update(){const e=this._hasDomElementFocus||this._overflowWidgetsDomNodeHasFocus;this._hadFocus!==e&&(this._hadFocus=e,this._onChange.fire(void 0))}hasFocus(){var e;return(e=this._hadFocus)!==null&&e!==void 0?e:!1}}class _je{get length(){return this._decorationIds.length}constructor(e,t){this._editor=e,this._decorationIds=[],this._isChangingDecorations=!1,Array.isArray(t)&&t.length>0&&this.set(t)}onDidChange(e,t,n){return this._editor.onDidChangeModelDecorations(r=>{this._isChangingDecorations||e.call(t,r)},n)}getRange(e){return!this._editor.hasModel()||e>=this._decorationIds.length?null:this._editor.getModel().getDecorationRange(this._decorationIds[e])}getRanges(){if(!this._editor.hasModel())return[];const e=this._editor.getModel(),t=[];for(const n of this._decorationIds){const r=e.getDecorationRange(n);r&&t.push(r)}return t}has(e){return this._decorationIds.includes(e.id)}clear(){this._decorationIds.length!==0&&this.set([])}set(e){try{this._isChangingDecorations=!0,this._editor.changeDecorations(t=>{this._decorationIds=t.deltaDecorations(this._decorationIds,e)})}finally{this._isChangingDecorations=!1}return this._decorationIds}append(e){let t=[];try{this._isChangingDecorations=!0,this._editor.changeDecorations(n=>{t=n.deltaDecorations([],e),this._decorationIds=this._decorationIds.concat(t)})}finally{this._isChangingDecorations=!1}return t}}const bje=encodeURIComponent("");function G6(i){return bje+encodeURIComponent(i.toString())+Cje}const yje=encodeURIComponent('');function Sje(i){return yje+encodeURIComponent(i.toString())+wje}fu((i,e)=>{const t=i.getColor(wf);t&&e.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${G6(t)}") repeat-x bottom left; }`);const n=i.getColor(qs);n&&e.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${G6(n)}") repeat-x bottom left; }`);const r=i.getColor(Za);r&&e.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${G6(r)}") repeat-x bottom left; }`);const o=i.getColor(Z7e);o&&e.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${Sje(o)}") no-repeat bottom left; }`);const s=i.getColor(sHe);s&&e.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${s.rgba.a}; }`)});var xje=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Lje=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let tV=class extends fe{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new se),this._onCodeEditorAdd=this._register(new se),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new se),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new se),this._onDiffEditorAdd=this._register(new se),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new se),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new _a,this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null),this._globalStyleSheet=null}willCreateCodeEditor(){this._onWillCreateCodeEditor.fire()}addCodeEditor(e){this._codeEditors[e.getId()]=e,this._onCodeEditorAdd.fire(e)}removeCodeEditor(e){delete this._codeEditors[e.getId()]&&this._onCodeEditorRemove.fire(e)}listCodeEditors(){return Object.keys(this._codeEditors).map(e=>this._codeEditors[e])}willCreateDiffEditor(){this._onWillCreateDiffEditor.fire()}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}listDiffEditors(){return Object.keys(this._diffEditors).map(e=>this._diffEditors[e])}getFocusedCodeEditor(){let e=null;const t=this.listCodeEditors();for(const n of t){if(n.hasTextFocus())return n;n.hasWidgetFocus()&&(e=n)}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(n=>n.removeDecorationsByType(e))))}setModelProperty(e,t,n){const r=e.toString();let o;this._modelProperties.has(r)?o=this._modelProperties.get(r):(o=new Map,this._modelProperties.set(r,o)),o.set(t,n)}getModelProperty(e,t){const n=e.toString();if(this._modelProperties.has(n))return this._modelProperties.get(n).get(t)}async openCodeEditor(e,t,n){for(const r of this._codeEditorOpenHandlers){const o=await r(e,t,n);if(o!==null)return o}return null}registerCodeEditorOpenHandler(e){const t=this._codeEditorOpenHandlers.unshift(e);return Rt(t)}};tV=xje([Lje(0,To)],tV);var Eje=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},_oe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let wP=class extends tV{constructor(e,t){super(t),this._register(this.onCodeEditorAdd(()=>this._checkContextKey())),this._register(this.onCodeEditorRemove(()=>this._checkContextKey())),this._editorIsOpen=e.createKey("editorIsOpen",!1),this._activeCodeEditor=null,this._register(this.registerCodeEditorOpenHandler(async(n,r,o)=>r?this.doOpenEditor(r,n):null))}_checkContextKey(){let e=!1;for(const t of this.listCodeEditors())if(!t.isSimpleWidget){e=!0;break}this._editorIsOpen.set(e)}setActiveCodeEditor(e){this._activeCodeEditor=e}getActiveCodeEditor(){return this._activeCodeEditor}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){const o=t.resource.scheme;if(o===an.http||o===an.https)return ume(t.resource.toString()),e}return null}const r=t.options?t.options.selection:null;if(r)if(typeof r.endLineNumber=="number"&&typeof r.endColumn=="number")e.setSelection(r),e.revealRangeInCenter(r,1);else{const o={lineNumber:r.startLineNumber,column:r.startColumn};e.setPosition(o),e.revealPositionInCenter(o,1)}return e}findModel(e,t){const n=e.getModel();return n&&n.uri.toString()!==t.toString()?null:n}};wP=Eje([_oe(0,Vt),_oe(1,To)],wP);In(Un,wP,0);const pC=yn("layoutService");var u_e=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},d_e=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let SP=class{get mainContainer(){var e,t;return(t=(e=JG(this._codeEditorService.listCodeEditors()))===null||e===void 0?void 0:e.getContainerDomNode())!==null&&t!==void 0?t:hi.document.body}get activeContainer(){var e,t;const n=(e=this._codeEditorService.getFocusedCodeEditor())!==null&&e!==void 0?e:this._codeEditorService.getActiveCodeEditor();return(t=n==null?void 0:n.getContainerDomNode())!==null&&t!==void 0?t:this.mainContainer}get mainContainerDimension(){return kp(this.mainContainer)}get activeContainerDimension(){return kp(this.activeContainer)}get containers(){return lh(this._codeEditorService.listCodeEditors().map(e=>e.getContainerDomNode()))}getContainer(){return this.activeContainer}focus(){var e;(e=this._codeEditorService.getFocusedCodeEditor())===null||e===void 0||e.focus()}constructor(e){this._codeEditorService=e,this.onDidLayoutMainContainer=Je.None,this.onDidLayoutActiveContainer=Je.None,this.onDidLayoutContainer=Je.None,this.onDidChangeActiveContainer=Je.None,this.onDidAddContainer=Je.None,this.whenActiveContainerStylesLoaded=Promise.resolve(),this.mainContainerOffset={top:0,quickPickTop:0},this.activeContainerOffset={top:0,quickPickTop:0}}};SP=u_e([d_e(0,Un)],SP);let nV=class extends SP{get mainContainer(){return this._container}constructor(e,t){super(t),this._container=e}};nV=u_e([d_e(1,Un)],nV);In(pC,SP,1);const Gk=yn("dialogService");var Dje=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},boe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};function ER(i){return i.scheme===an.file?i.fsPath:i.path}let h_e=0;class DR{constructor(e,t,n,r,o,s,a){this.id=++h_e,this.type=0,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=n,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=r,this.groupOrder=o,this.sourceId=s,this.sourceOrder=a,this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?" VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class Coe{constructor(e,t){this.resourceLabel=e,this.reason=t}}class yoe{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,r]of this.elements)(r.reason===0?e:t).push(r.resourceLabel);const n=[];return e.length>0&&n.push(w({key:"externalRemoval",comment:["{0} is a list of filenames"]},"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&n.push(w({key:"noParallelUniverses",comment:["{0} is a list of filenames"]},"The following files have been modified in an incompatible way: {0}.",t.join(", "))),n.join(` +`&&(n=2),this._modelData.model.getValue(n,t)}setValue(e){this._modelData&&this._modelData.model.setValue(e)}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){var t;const n=e;if(this._modelData===null&&n===null||this._modelData&&this._modelData.model===n)return;const r={oldModelUrl:((t=this._modelData)===null||t===void 0?void 0:t.model.uri)||null,newModelUrl:(n==null?void 0:n.uri)||null};this._onWillChangeModel.fire(r);const o=this.hasTextFocus(),s=this._detachModel();this._attachModel(n),o&&this.hasModel()&&this.focus(),this._removeDecorationTypes(),this._onDidChangeModel.fire(r),this._postDetachModelCleanup(s),this._contributionsDisposable=this._contributions.onAfterModelAttached()}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const n in t)this._removeDecorationType(e+"-"+n)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetAfterPosition(e,t,n,r){const o=e.model.validatePosition({lineNumber:t,column:n}),s=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(s.lineNumber,r)}getTopForLineNumber(e,t=!1){return this._modelData?p0._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?p0._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,n,r=!1){const o=e.model.validatePosition({lineNumber:t,column:n}),s=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(s.lineNumber,r)}getBottomForLineNumber(e,t=!1){return this._modelData?p0._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e,t){var n;(n=this._modelData)===null||n===void 0||n.viewModel.setHiddenAreas(e.map(r=>B.lift(r)),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),n=this._modelData.model.getOptions().tabSize;return go.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,n)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!ae.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,n,r){if(!this._modelData)return;if(!B.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",n,s,t,r)}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,n){if(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new B(e,1,e,1),t,!1,n)}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,n,r){if(!ae.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new B(e.lineNumber,e.column,e.lineNumber,e.column),t,n,r)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const n=yt.isISelection(e),r=B.isIRange(e);if(!n&&!r)throw new Error("Invalid arguments");if(n)this._setSelectionImpl(e,t);else if(r){const o={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(o,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const n=new yt(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[n])}revealLines(e,t,n=0){this._revealLines(e,t,0,n)}revealLinesInCenter(e,t,n=0){this._revealLines(e,t,1,n)}revealLinesInCenterIfOutsideViewport(e,t,n=0){this._revealLines(e,t,2,n)}revealLinesNearTop(e,t,n=0){this._revealLines(e,t,5,n)}_revealLines(e,t,n,r){if(typeof e!="number"||typeof t!="number")throw new Error("Invalid arguments");this._sendRevealRange(new B(e,1,t,1),n,!1,r)}revealRange(e,t=0,n=!1,r=!0){this._revealRange(e,n?1:0,r,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,n,r){if(!B.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(B.lift(e),t,n,r)}setSelections(e,t="api",n=0){if(this._modelData){if(!e||e.length===0)throw new Error("Invalid arguments");for(let r=0,o=e.length;r0&&this._modelData.viewModel.restoreCursorState(n):this._modelData.viewModel.restoreCursorState([n]),this._contributions.restoreViewState(t.contributionsState||{});const r=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(r)}}handleInitialized(){var e;(e=this._getViewModel())===null||e===void 0||e.visibleLinesStabilized()}getContribution(e){return this._contributions.get(e)}getActions(){return Array.from(this._actions.values())}getSupportedActions(){let e=this.getActions();return e=e.filter(t=>t.isSupported()),e}getAction(e){return this._actions.get(e)||null}trigger(e,t,n){switch(n=n||{},t){case"compositionStart":this._startComposition();return;case"compositionEnd":this._endComposition(e);return;case"type":{const o=n;this._type(e,o.text||"");return}case"replacePreviousChar":{const o=n;this._compositionType(e,o.text||"",o.replaceCharCnt||0,0,0);return}case"compositionType":{const o=n;this._compositionType(e,o.text||"",o.replacePrevCharCnt||0,o.replaceNextCharCnt||0,o.positionDelta||0);return}case"paste":{const o=n;this._paste(e,o.text||"",o.pasteOnNewLine||!1,o.multicursorText||null,o.mode||null);return}case"cut":this._cut(e);return}const r=this.getAction(t);if(r){Promise.resolve(r.run(n)).then(void 0,en);return}this._modelData&&(this._triggerEditorCommand(e,t,n)||this._triggerCommand(t,n))}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){this._modelData&&(this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){!this._modelData||t.length===0||(e==="keyboard"&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),e==="keyboard"&&this._onDidType.fire(t))}_compositionType(e,t,n,r,o){this._modelData&&this._modelData.viewModel.compositionType(t,n,r,o,e)}_paste(e,t,n,r,o){if(!this._modelData||t.length===0)return;const s=this._modelData.viewModel,a=s.getSelection().getStartPosition();s.paste(t,n,r,e);const l=s.getSelection().getStartPosition();e==="keyboard"&&this._onDidPaste.fire({range:new B(a.lineNumber,a.column,l.lineNumber,l.column),languageId:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,n){const r=Ay.getEditorCommand(t);return r?(n=n||{},n.source=e,this._instantiationService.invokeFunction(o=>{Promise.resolve(r.runEditorCommand(o,this,n)).then(void 0,en)}),!0):!1}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!this._modelData||this._configuration.options.get(91)?!1:(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!this._modelData||this._configuration.options.get(91)?!1:(this._modelData.model.popStackElement(),!0)}executeEdits(e,t,n){if(!this._modelData||this._configuration.options.get(91))return!1;let r;return n?Array.isArray(n)?r=()=>n:r=n:r=()=>null,this._modelData.viewModel.executeEdits(e,t,r),!0}executeCommand(e,t){this._modelData&&this._modelData.viewModel.executeCommand(t,e)}executeCommands(e,t){this._modelData&&this._modelData.viewModel.executeCommands(t,e)}createDecorationsCollection(e){return new _je(this,e)}changeDecorations(e){return this._modelData?this._modelData.model.changeDecorations(e,this._id):null}getLineDecorations(e){return this._modelData?this._modelData.model.getLineDecorations(e,this._id,MA(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,MA(this._configuration.options)):null}deltaDecorations(e,t){return this._modelData?e.length===0&&t.length===0?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){!this._modelData||e.length===0||this._modelData.model.changeDecorations(t=>{t.deltaDecorations(e,[])})}removeDecorationsByType(e){const t=this._decorationTypeKeysToIds[e];t&&this.changeDecorations(n=>n.deltaDecorations(t,[])),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(144)}createOverviewRuler(e){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.createOverviewRuler(e)}getContainerDomNode(){return this._domElement}getDomNode(){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.domNode.domNode}delegateVerticalScrollbarPointerDown(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateScrollFromMouseWheelEvent(e)}layout(e,t=!1){this._configuration.observeContainer(e),t||this.render()}focus(){!this._modelData||!this._modelData.hasRealView||this._modelData.view.focus()}hasTextFocus(){return!this._modelData||!this._modelData.hasRealView?!1:this._modelData.view.isFocused()}hasWidgetFocus(){return this._focusTracker&&this._focusTracker.hasFocus()}addContentWidget(e){const t={widget:e,position:e.getPosition()};this._contentWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a content widget with the same id:"+e.getId()),this._contentWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(t)}layoutContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const n=this._contentWidgets[t];n.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(n)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const n=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(n)}}addOverlayWidget(e){const t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting an overlay widget with the same id."),this._overlayWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addOverlayWidget(t)}layoutOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const n=this._overlayWidgets[t];n.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(n)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const n=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(n)}}addGlyphMarginWidget(e){const t={widget:e,position:e.getPosition()};this._glyphMarginWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a glyph margin widget with the same id."),this._glyphMarginWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addGlyphMarginWidget(t)}layoutGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const n=this._glyphMarginWidgets[t];n.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutGlyphMarginWidget(n)}}removeGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const n=this._glyphMarginWidgets[t];delete this._glyphMarginWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(n)}}changeViewZones(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.getTargetAtClientPoint(e,t)}getScrolledVisiblePosition(e){if(!this._modelData||!this._modelData.hasRealView)return null;const t=this._modelData.model.validatePosition(e),n=this._configuration.options,r=n.get(144),o=p0._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),s=this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+r.glyphMarginWidth+r.lineNumbersWidth+r.decorationsWidth-this.getScrollLeft();return{top:o,left:s,height:n.get(67)}}getOffsetForColumn(e,t){return!this._modelData||!this._modelData.hasRealView?-1:this._modelData.view.getOffsetForColumn(e,t)}render(e=!1){!this._modelData||!this._modelData.hasRealView||this._modelData.view.render(!0,e)}setAriaOptions(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.setAriaOptions(e)}applyFontInfo(e){ps(e,this._configuration.options.get(50))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),this._bannerDomNode=e,this._configuration.setReservedHeight(e?t:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_attachModel(e){if(!e){this._modelData=null;return}const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount());const n=e.onBeforeAttached(),r=new aje(this._id,this._configuration,e,aX.create(Pt(this._domElement)),_X.create(this._configuration.options),a=>Il(Pt(this._domElement),a),this.languageConfigurationService,this._themeService,n);t.push(e.onWillDispose(()=>this.setModel(null))),t.push(r.onEvent(a=>{switch(a.kind){case 0:this._onDidContentSizeChange.fire(a);break;case 1:this._editorTextFocus.setValue(a.hasFocus);break;case 2:this._onDidScrollChange.fire(a);break;case 3:this._onDidChangeViewZones.fire();break;case 4:this._onDidChangeHiddenAreas.fire();break;case 5:this._onDidAttemptReadOnlyEdit.fire();break;case 6:{if(a.reachedMaxCursorCount){const d=this.getOption(80),h=w("cursors.maximum","The number of cursors has been limited to {0}. Consider using [find and replace](https://code.visualstudio.com/docs/editor/codebasics#_find-and-replace) for larger changes or increase the editor multi cursor limit setting.",d);this._notificationService.prompt(j4.Warning,h,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:w("goToSetting","Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}const l=[];for(let d=0,h=a.selections.length;d{this._paste("keyboard",o,s,a,l)},type:o=>{this._type("keyboard",o)},compositionType:(o,s,a,l)=>{this._compositionType("keyboard",o,s,a,l)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:t={paste:(o,s,a,l)=>{const c={text:o,pasteOnNewLine:s,multicursorText:a,mode:l};this._commandService.executeCommand("paste",c)},type:o=>{const s={text:o};this._commandService.executeCommand("type",s)},compositionType:(o,s,a,l)=>{if(a||l){const c={text:o,replacePrevCharCnt:s,replaceNextCharCnt:a,positionDelta:l};this._commandService.executeCommand("compositionType",c)}else{const c={text:o,replaceCharCnt:s};this._commandService.executeCommand("replacePreviousChar",c)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const n=new $4(e.coordinatesConverter);return n.onKeyDown=o=>this._onKeyDown.fire(o),n.onKeyUp=o=>this._onKeyUp.fire(o),n.onContextMenu=o=>this._onContextMenu.fire(o),n.onMouseMove=o=>this._onMouseMove.fire(o),n.onMouseLeave=o=>this._onMouseLeave.fire(o),n.onMouseDown=o=>this._onMouseDown.fire(o),n.onMouseUp=o=>this._onMouseUp.fire(o),n.onMouseDrag=o=>this._onMouseDrag.fire(o),n.onMouseDrop=o=>this._onMouseDrop.fire(o),n.onMouseDropCanceled=o=>this._onMouseDropCanceled.fire(o),n.onMouseWheel=o=>this._onMouseWheel.fire(o),[new BH(t,this._configuration,this._themeService.getColorTheme(),e,n,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){e==null||e.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){var e;if((e=this._contributionsDisposable)===null||e===void 0||e.dispose(),this._contributionsDisposable=void 0,!this._modelData)return null;const t=this._modelData.model,n=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),n&&this._domElement.contains(n)&&this._domElement.removeChild(n),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),t}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return this._modelData!==null}showDropIndicatorAt(e){const t=[{range:new B(e.lineNumber,e.column,e.lineNumber,e.column),options:p0.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,t){this._contextKeyService.createKey(e,t)}};$w.dropIntoEditorDecorationOptions=sn.register({description:"workbench-dnd-target",className:"dnd-target"});$w=p0=hje([mg(3,Ot),mg(4,Un),mg(5,sr),mg(6,Vt),mg(7,To),mg(8,$r),mg(9,ud),mg(10,Di),mg(11,_t)],$w);class voe extends fe{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new se(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new se(this._emitterOptions)),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){const t=e?2:1;this._value!==t&&(this._value=t,this._value===2?this._onDidChangeToTrue.fire():this._value===1&&this._onDidChangeToFalse.fire())}}class Hs extends se{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class pje extends fe{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=j.editorSimpleInput.bindTo(t),this._editorFocus=j.focus.bindTo(t),this._textInputFocus=j.textInputFocus.bindTo(t),this._editorTextFocus=j.editorTextFocus.bindTo(t),this._tabMovesFocus=j.tabMovesFocus.bindTo(t),this._editorReadonly=j.readOnly.bindTo(t),this._inDiffEditor=j.inDiffEditor.bindTo(t),this._editorColumnSelection=j.columnSelection.bindTo(t),this._hasMultipleSelections=j.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=j.hasNonEmptySelection.bindTo(t),this._canUndo=j.canUndo.bindTo(t),this._canRedo=j.canRedo.bindTo(t),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromConfig())),this._register(this._editor.onDidChangeCursorSelection(()=>this._updateFromSelection())),this._register(this._editor.onDidFocusEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidFocusEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidChangeModel(()=>this._updateFromModel())),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromModel())),this._register(Rw.onDidChangeTabFocus(n=>this._tabMovesFocus.set(n))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._tabMovesFocus.set(Rw.getTabFocusMode()),this._editorReadonly.set(e.get(91)),this._inDiffEditor.set(e.get(61)),this._editorColumnSelection.set(e.get(22))}_updateFromSelection(){const e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some(t=>!t.isEmpty()))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())}_updateFromFocus(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())}_updateFromModel(){const e=this._editor.getModel();this._canUndo.set(!!(e&&e.canUndo())),this._canRedo.set(!!(e&&e.canRedo()))}}class mje extends fe{constructor(e,t,n){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=n,this._langId=j.languageId.bindTo(t),this._hasCompletionItemProvider=j.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=j.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=j.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=j.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=j.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=j.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=j.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=j.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=j.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=j.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=j.hasReferenceProvider.bindTo(t),this._hasRenameProvider=j.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=j.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=j.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=j.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=j.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=j.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=j.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInEmbeddedEditor=j.isInEmbeddedEditor.bindTo(t);const r=()=>this._update();this._register(e.onDidChangeModel(r)),this._register(e.onDidChangeModelLanguage(r)),this._register(n.completionProvider.onDidChange(r)),this._register(n.codeActionProvider.onDidChange(r)),this._register(n.codeLensProvider.onDidChange(r)),this._register(n.definitionProvider.onDidChange(r)),this._register(n.declarationProvider.onDidChange(r)),this._register(n.implementationProvider.onDidChange(r)),this._register(n.typeDefinitionProvider.onDidChange(r)),this._register(n.hoverProvider.onDidChange(r)),this._register(n.documentHighlightProvider.onDidChange(r)),this._register(n.documentSymbolProvider.onDidChange(r)),this._register(n.referenceProvider.onDidChange(r)),this._register(n.renameProvider.onDidChange(r)),this._register(n.documentFormattingEditProvider.onDidChange(r)),this._register(n.documentRangeFormattingEditProvider.onDidChange(r)),this._register(n.signatureHelpProvider.onDidChange(r)),this._register(n.inlayHintsProvider.onDidChange(r)),r()}dispose(){super.dispose()}reset(){this._contextKeyService.bufferChangeEvents(()=>{this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasDeclarationProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInEmbeddedEditor.reset()})}_update(){const e=this._editor.getModel();if(!e){this.reset();return}this._contextKeyService.bufferChangeEvents(()=>{this._langId.set(e.getLanguageId()),this._hasCompletionItemProvider.set(this._languageFeaturesService.completionProvider.has(e)),this._hasCodeActionsProvider.set(this._languageFeaturesService.codeActionProvider.has(e)),this._hasCodeLensProvider.set(this._languageFeaturesService.codeLensProvider.has(e)),this._hasDefinitionProvider.set(this._languageFeaturesService.definitionProvider.has(e)),this._hasDeclarationProvider.set(this._languageFeaturesService.declarationProvider.has(e)),this._hasImplementationProvider.set(this._languageFeaturesService.implementationProvider.has(e)),this._hasTypeDefinitionProvider.set(this._languageFeaturesService.typeDefinitionProvider.has(e)),this._hasHoverProvider.set(this._languageFeaturesService.hoverProvider.has(e)),this._hasDocumentHighlightProvider.set(this._languageFeaturesService.documentHighlightProvider.has(e)),this._hasDocumentSymbolProvider.set(this._languageFeaturesService.documentSymbolProvider.has(e)),this._hasReferenceProvider.set(this._languageFeaturesService.referenceProvider.has(e)),this._hasRenameProvider.set(this._languageFeaturesService.renameProvider.has(e)),this._hasSignatureHelpProvider.set(this._languageFeaturesService.signatureHelpProvider.has(e)),this._hasInlayHintsProvider.set(this._languageFeaturesService.inlayHintsProvider.has(e)),this._hasDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.has(e)||this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasMultipleDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.all(e).length+this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._isInEmbeddedEditor.set(e.uri.scheme===an.walkThroughSnippet||e.uri.scheme===an.vscodeChatCodeBlock)})}}class vje extends fe{constructor(e,t){super(),this._onChange=this._register(new se),this.onChange=this._onChange.event,this._hadFocus=void 0,this._hasDomElementFocus=!1,this._domFocusTracker=this._register(dh(e)),this._overflowWidgetsDomNodeHasFocus=!1,this._register(this._domFocusTracker.onDidFocus(()=>{this._hasDomElementFocus=!0,this._update()})),this._register(this._domFocusTracker.onDidBlur(()=>{this._hasDomElementFocus=!1,this._update()})),t&&(this._overflowWidgetsDomNode=this._register(dh(t)),this._register(this._overflowWidgetsDomNode.onDidFocus(()=>{this._overflowWidgetsDomNodeHasFocus=!0,this._update()})),this._register(this._overflowWidgetsDomNode.onDidBlur(()=>{this._overflowWidgetsDomNodeHasFocus=!1,this._update()})))}_update(){const e=this._hasDomElementFocus||this._overflowWidgetsDomNodeHasFocus;this._hadFocus!==e&&(this._hadFocus=e,this._onChange.fire(void 0))}hasFocus(){var e;return(e=this._hadFocus)!==null&&e!==void 0?e:!1}}class _je{get length(){return this._decorationIds.length}constructor(e,t){this._editor=e,this._decorationIds=[],this._isChangingDecorations=!1,Array.isArray(t)&&t.length>0&&this.set(t)}onDidChange(e,t,n){return this._editor.onDidChangeModelDecorations(r=>{this._isChangingDecorations||e.call(t,r)},n)}getRange(e){return!this._editor.hasModel()||e>=this._decorationIds.length?null:this._editor.getModel().getDecorationRange(this._decorationIds[e])}getRanges(){if(!this._editor.hasModel())return[];const e=this._editor.getModel(),t=[];for(const n of this._decorationIds){const r=e.getDecorationRange(n);r&&t.push(r)}return t}has(e){return this._decorationIds.includes(e.id)}clear(){this._decorationIds.length!==0&&this.set([])}set(e){try{this._isChangingDecorations=!0,this._editor.changeDecorations(t=>{this._decorationIds=t.deltaDecorations(this._decorationIds,e)})}finally{this._isChangingDecorations=!1}return this._decorationIds}append(e){let t=[];try{this._isChangingDecorations=!0,this._editor.changeDecorations(n=>{t=n.deltaDecorations([],e),this._decorationIds=this._decorationIds.concat(t)})}finally{this._isChangingDecorations=!1}return t}}const bje=encodeURIComponent("");function G6(i){return bje+encodeURIComponent(i.toString())+Cje}const yje=encodeURIComponent('');function Sje(i){return yje+encodeURIComponent(i.toString())+wje}fu((i,e)=>{const t=i.getColor(wf);t&&e.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${G6(t)}") repeat-x bottom left; }`);const n=i.getColor(qs);n&&e.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${G6(n)}") repeat-x bottom left; }`);const r=i.getColor(Za);r&&e.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${G6(r)}") repeat-x bottom left; }`);const o=i.getColor(Z7e);o&&e.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${Sje(o)}") no-repeat bottom left; }`);const s=i.getColor(sHe);s&&e.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${s.rgba.a}; }`)});var xje=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Lje=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let tV=class extends fe{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new se),this._onCodeEditorAdd=this._register(new se),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new se),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new se),this._onDiffEditorAdd=this._register(new se),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new se),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new _a,this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null),this._globalStyleSheet=null}willCreateCodeEditor(){this._onWillCreateCodeEditor.fire()}addCodeEditor(e){this._codeEditors[e.getId()]=e,this._onCodeEditorAdd.fire(e)}removeCodeEditor(e){delete this._codeEditors[e.getId()]&&this._onCodeEditorRemove.fire(e)}listCodeEditors(){return Object.keys(this._codeEditors).map(e=>this._codeEditors[e])}willCreateDiffEditor(){this._onWillCreateDiffEditor.fire()}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}listDiffEditors(){return Object.keys(this._diffEditors).map(e=>this._diffEditors[e])}getFocusedCodeEditor(){let e=null;const t=this.listCodeEditors();for(const n of t){if(n.hasTextFocus())return n;n.hasWidgetFocus()&&(e=n)}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(n=>n.removeDecorationsByType(e))))}setModelProperty(e,t,n){const r=e.toString();let o;this._modelProperties.has(r)?o=this._modelProperties.get(r):(o=new Map,this._modelProperties.set(r,o)),o.set(t,n)}getModelProperty(e,t){const n=e.toString();if(this._modelProperties.has(n))return this._modelProperties.get(n).get(t)}async openCodeEditor(e,t,n){for(const r of this._codeEditorOpenHandlers){const o=await r(e,t,n);if(o!==null)return o}return null}registerCodeEditorOpenHandler(e){const t=this._codeEditorOpenHandlers.unshift(e);return Rt(t)}};tV=xje([Lje(0,To)],tV);var Eje=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},_oe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let wP=class extends tV{constructor(e,t){super(t),this._register(this.onCodeEditorAdd(()=>this._checkContextKey())),this._register(this.onCodeEditorRemove(()=>this._checkContextKey())),this._editorIsOpen=e.createKey("editorIsOpen",!1),this._activeCodeEditor=null,this._register(this.registerCodeEditorOpenHandler(async(n,r,o)=>r?this.doOpenEditor(r,n):null))}_checkContextKey(){let e=!1;for(const t of this.listCodeEditors())if(!t.isSimpleWidget){e=!0;break}this._editorIsOpen.set(e)}setActiveCodeEditor(e){this._activeCodeEditor=e}getActiveCodeEditor(){return this._activeCodeEditor}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){const o=t.resource.scheme;if(o===an.http||o===an.https)return ume(t.resource.toString()),e}return null}const r=t.options?t.options.selection:null;if(r)if(typeof r.endLineNumber=="number"&&typeof r.endColumn=="number")e.setSelection(r),e.revealRangeInCenter(r,1);else{const o={lineNumber:r.startLineNumber,column:r.startColumn};e.setPosition(o),e.revealPositionInCenter(o,1)}return e}findModel(e,t){const n=e.getModel();return n&&n.uri.toString()!==t.toString()?null:n}};wP=Eje([_oe(0,Vt),_oe(1,To)],wP);In(Un,wP,0);const pC=yn("layoutService");var u_e=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},d_e=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let SP=class{get mainContainer(){var e,t;return(t=(e=JG(this._codeEditorService.listCodeEditors()))===null||e===void 0?void 0:e.getContainerDomNode())!==null&&t!==void 0?t:hi.document.body}get activeContainer(){var e,t;const n=(e=this._codeEditorService.getFocusedCodeEditor())!==null&&e!==void 0?e:this._codeEditorService.getActiveCodeEditor();return(t=n==null?void 0:n.getContainerDomNode())!==null&&t!==void 0?t:this.mainContainer}get mainContainerDimension(){return Tp(this.mainContainer)}get activeContainerDimension(){return Tp(this.activeContainer)}get containers(){return lh(this._codeEditorService.listCodeEditors().map(e=>e.getContainerDomNode()))}getContainer(){return this.activeContainer}focus(){var e;(e=this._codeEditorService.getFocusedCodeEditor())===null||e===void 0||e.focus()}constructor(e){this._codeEditorService=e,this.onDidLayoutMainContainer=Je.None,this.onDidLayoutActiveContainer=Je.None,this.onDidLayoutContainer=Je.None,this.onDidChangeActiveContainer=Je.None,this.onDidAddContainer=Je.None,this.whenActiveContainerStylesLoaded=Promise.resolve(),this.mainContainerOffset={top:0,quickPickTop:0},this.activeContainerOffset={top:0,quickPickTop:0}}};SP=u_e([d_e(0,Un)],SP);let nV=class extends SP{get mainContainer(){return this._container}constructor(e,t){super(t),this._container=e}};nV=u_e([d_e(1,Un)],nV);In(pC,SP,1);const Gk=yn("dialogService");var Dje=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},boe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};function ER(i){return i.scheme===an.file?i.fsPath:i.path}let h_e=0;class DR{constructor(e,t,n,r,o,s,a){this.id=++h_e,this.type=0,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=n,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=r,this.groupOrder=o,this.sourceId=s,this.sourceOrder=a,this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?" VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class Coe{constructor(e,t){this.resourceLabel=e,this.reason=t}}class yoe{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,r]of this.elements)(r.reason===0?e:t).push(r.resourceLabel);const n=[];return e.length>0&&n.push(w({key:"externalRemoval",comment:["{0} is a list of filenames"]},"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&n.push(w({key:"noParallelUniverses",comment:["{0} is a list of filenames"]},"The following files have been modified in an incompatible way: {0}.",t.join(", "))),n.join(` `)}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,t){this.elements.set(e,t)}delete(e){return this.elements.delete(e)}}class Ije{constructor(e,t,n,r,o,s,a){this.id=++h_e,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=n,this.groupId=r,this.groupOrder=o,this.sourceId=s,this.sourceOrder=a,this.removedResources=null,this.invalidatedResources=null}canSplit(){return typeof this.actual.split=="function"}removeResource(e,t,n){this.removedResources||(this.removedResources=new yoe),this.removedResources.has(t)||this.removedResources.set(t,new Coe(e,n))}setValid(e,t,n){n?this.invalidatedResources&&(this.invalidatedResources.delete(t),this.invalidatedResources.size===0&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new yoe),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new Coe(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class f_e{constructor(e,t){this.resourceLabel=e,this.strResource=t,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(const e of this._past)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){const e=[];e.push(`* ${this.strResource}:`);for(let t=0;t=0;t--)e.push(` * [REDO] ${this._future[t]}`);return e.join(` `)}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){e.type===1?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const n of this._past)t(n.actual)&&this._setElementValidFlag(n,e);for(const n of this._future)t(n.actual)&&this._setElementValidFlag(n,e)}pushElement(e){for(const t of this._future)t.type===1&&t.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let n=0,r=this._past.length;n=0;n--)t.push(this._future[n].id);return new r_e(e,t)}restoreSnapshot(e){const t=e.elements.length;let n=!0,r=0,o=-1;for(let a=0,l=this._past.length;a=t||c.id!==e.elements[r])&&(n=!1,o=0),!n&&c.type===1&&c.removeResource(this.resourceLabel,this.strResource,0)}let s=-1;for(let a=this._future.length-1;a>=0;a--,r++){const l=this._future[a];n&&(r>=t||l.id!==e.elements[r])&&(n=!1,s=a),!n&&l.type===1&&l.removeResource(this.resourceLabel,this.strResource,0)}o!==-1&&(this._past=this._past.slice(0,o)),s!==-1&&(this._future=this._future.slice(s+1)),this.versionId++}getElements(){const e=[],t=[];for(const n of this._past)e.push(n.actual);for(const n of this._future)t.push(n.actual);return{past:e,future:t}}getClosestPastElement(){return this._past.length===0?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return this._future.length===0?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(e,t){for(let n=this._past.length-1;n>=0;n--)if(this._past[n]===e){t.has(this.strResource)?this._past[n]=t.get(this.strResource):this._past.splice(n,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let n=this._future.length-1;n>=0;n--)if(this._future[n]===e){t.has(this.strResource)?this._future[n]=t.get(this.strResource):this._future.splice(n,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 q6{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,n=this.editStacks.length;tt.sourceOrder)&&(t=s,n=r)}return[t,n]}canUndo(e){if(e instanceof ff){const[,n]=this._findClosestUndoElementWithSource(e.id);return!!n}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasPastElements():!1}_onError(e,t){en(e);for(const n of t.strResources)this.removeElements(n);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,n,r,o){const s=this._acquireLocks(n);let a;try{a=t()}catch(l){return s(),r.dispose(),this._onError(l,e)}return a?a.then(()=>(s(),r.dispose(),o()),l=>(s(),r.dispose(),this._onError(l,e))):(s(),r.dispose(),o())}async _invokeWorkspacePrepare(e){if(typeof e.actual.prepareUndoRedo>"u")return fe.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?fe.None:t}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo>"u")return t(fe.None);const n=e.actual.prepareUndoRedo();return n?aq(n)?t(n):n.then(r=>t(r)):t(fe.None)}_getAffectedEditStacks(e){const t=[];for(const n of e.strResources)t.push(this._editStacks.get(n)||g_e);return new q6(t)}_tryToSplitAndUndo(e,t,n,r){if(t.canSplit())return this._splitPastWorkspaceElement(t,n),this._notificationService.warn(r),new IR(this._undo(e,0,!0));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(r),new IR}_checkWorkspaceUndo(e,t,n,r){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,w({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(r&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,w({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const a of n.editStacks)a.getClosestPastElement()!==t&&o.push(a.resourceLabel);if(o.length>0)return this._tryToSplitAndUndo(e,t,null,w({key:"cannotWorkspaceUndoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const s=[];for(const a of n.editStacks)a.locked&&s.push(a.resourceLabel);return s.length>0?this._tryToSplitAndUndo(e,t,null,w({key:"cannotWorkspaceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,s.join(", "))):n.isValid()?null:this._tryToSplitAndUndo(e,t,null,w({key:"cannotWorkspaceUndoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,n){const r=this._getAffectedEditStacks(t),o=this._checkWorkspaceUndo(e,t,r,!1);return o?o.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,r,n)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const n=t.getClosestPastElement();if(n){if(n===e){const r=t.getSecondClosestPastElement();if(r&&r.groupId===e.groupId)return!0}if(n.groupId===e.groupId)return!0}}return!1}async _confirmAndExecuteWorkspaceUndo(e,t,n,r){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){let a;(function(u){u[u.All=0]="All",u[u.This=1]="This",u[u.Cancel=2]="Cancel"})(a||(a={}));const{result:l}=await this._dialogService.prompt({type:kr.Info,message:w("confirmWorkspace","Would you like to undo '{0}' across all files?",t.label),buttons:[{label:w({key:"ok",comment:["{0} denotes a number that is > 1, && denotes a mnemonic"]},"&&Undo in {0} Files",n.editStacks.length),run:()=>a.All},{label:w({key:"nok",comment:["&& denotes a mnemonic"]},"Undo this &&File"),run:()=>a.This}],cancelButton:{run:()=>a.Cancel}});if(l===a.Cancel)return;if(l===a.This)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const c=this._checkWorkspaceUndo(e,t,n,!1);if(c)return c.returnValue;r=!0}let o;try{o=await this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}const s=this._checkWorkspaceUndo(e,t,n,!0);if(s)return o.dispose(),s.returnValue;for(const a of n.editStacks)a.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),n,o,()=>this._continueUndoInGroup(t.groupId,r))}_resourceUndo(e,t,n){if(!t.isValid){e.flushAllElements();return}if(e.locked){const r=w({key:"cannotResourceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(r);return}return this._invokeResourcePrepare(t,r=>(e.moveBackward(t),this._safeInvokeWithLocks(t,()=>t.actual.undo(),new q6([e]),r,()=>this._continueUndoInGroup(t.groupId,n))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,n=null;for(const[r,o]of this._editStacks){const s=o.getClosestPastElement();s&&s.groupId===e&&(!t||s.groupOrder>t.groupOrder)&&(t=s,n=r)}return[t,n]}_continueUndoInGroup(e,t){if(!e)return;const[,n]=this._findClosestUndoElementInGroup(e);if(n)return this._undo(n,0,t)}undo(e){if(e instanceof ff){const[,t]=this._findClosestUndoElementWithSource(e.id);return t?this._undo(t,e.id,!1):void 0}return typeof e=="string"?this._undo(e,0,!1):this._undo(this.getUriComparisonKey(e),0,!1)}_undo(e,t=0,n){if(!this._editStacks.has(e))return;const r=this._editStacks.get(e),o=r.getClosestPastElement();if(!o)return;if(o.groupId){const[a,l]=this._findClosestUndoElementInGroup(o.groupId);if(o!==a&&l)return this._undo(l,t,n)}if((o.sourceId!==t||o.confirmBeforeUndo)&&!n)return this._confirmAndContinueUndo(e,t,o);try{return o.type===1?this._workspaceUndo(e,o,n):this._resourceUndo(r,o,n)}finally{}}async _confirmAndContinueUndo(e,t,n){if((await this._dialogService.confirm({message:w("confirmDifferentSource","Would you like to undo '{0}'?",n.label),primaryButton:w({key:"confirmDifferentSource.yes",comment:["&& denotes a mnemonic"]},"&&Yes"),cancelButton:w("confirmDifferentSource.no","No")})).confirmed)return this._undo(e,t,!0)}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,n=null;for(const[r,o]of this._editStacks){const s=o.getClosestFutureElement();s&&s.sourceId===e&&(!t||s.sourceOrder0)return this._tryToSplitAndRedo(e,t,null,w({key:"cannotWorkspaceRedoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const s=[];for(const a of n.editStacks)a.locked&&s.push(a.resourceLabel);return s.length>0?this._tryToSplitAndRedo(e,t,null,w({key:"cannotWorkspaceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,s.join(", "))):n.isValid()?null:this._tryToSplitAndRedo(e,t,null,w({key:"cannotWorkspaceRedoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceRedo(e,t){const n=this._getAffectedEditStacks(t),r=this._checkWorkspaceRedo(e,t,n,!1);return r?r.returnValue:this._executeWorkspaceRedo(e,t,n)}async _executeWorkspaceRedo(e,t,n){let r;try{r=await this._invokeWorkspacePrepare(t)}catch(s){return this._onError(s,t)}const o=this._checkWorkspaceRedo(e,t,n,!0);if(o)return r.dispose(),o.returnValue;for(const s of n.editStacks)s.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),n,r,()=>this._continueRedoInGroup(t.groupId))}_resourceRedo(e,t){if(!t.isValid){e.flushAllElements();return}if(e.locked){const n=w({key:"cannotResourceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(n);return}return this._invokeResourcePrepare(t,n=>(e.moveForward(t),this._safeInvokeWithLocks(t,()=>t.actual.redo(),new q6([e]),n,()=>this._continueRedoInGroup(t.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,n=null;for(const[r,o]of this._editStacks){const s=o.getClosestFutureElement();s&&s.groupId===e&&(!t||s.groupOrder=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},woe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const gu=yn("ILanguageFeatureDebounceService");var xP;(function(i){const e=new WeakMap;let t=0;function n(r){let o=e.get(r);return o===void 0&&(o=++t,e.set(r,o)),o}i.of=n})(xP||(xP={}));class Nje{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}}class Rje{constructor(e,t,n,r,o,s){this._logService=e,this._name=t,this._registry=n,this._default=r,this._min=o,this._max=s,this._cache=new D_(50,.7)}_key(e){return e.id+this._registry.all(e).reduce((t,n)=>c4(xP.of(n),t),0)}get(e){const t=this._key(e),n=this._cache.get(t);return n?da(n.value,this._min,this._max):this.default()}update(e,t){const n=this._key(e);let r=this._cache.get(n);r||(r=new kje(6),this._cache.set(n,r));const o=da(r.update(t),this._min,this._max);return xq(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${o}ms`),o}_overall(){const e=new p_e;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){const e=this._overall()|0||this._default;return da(e,this._min,this._max)}}let rV=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,n){var r,o,s;const a=(r=n==null?void 0:n.min)!==null&&r!==void 0?r:50,l=(o=n==null?void 0:n.max)!==null&&o!==void 0?o:a**2,c=(s=n==null?void 0:n.key)!==null&&s!==void 0?s:void 0,u=`${xP.of(e)},${a}${c?","+c:""}`;let d=this._data.get(u);return d||(this._isDev?d=new Rje(this._logService,t,e,this._overallAverage()|0||a*1.5,a,l):(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),d=new Nje(a*1.5)),this._data.set(u,d)),d}_overallAverage(){const e=new p_e;for(const t of this._data.values())e.update(t.default());return e.value}};rV=Tje([woe(0,Ta),woe(1,EX)],rV);In(gu,rV,1);class EE{static create(e,t){return new EE(e,new LP(t))}get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._endLineNumber}constructor(e,t){this._startLineNumber=e,this._tokens=t,this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}toString(){return this._tokens.toString(this._startLineNumber)}_updateEndLineNumber(){this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}isEmpty(){return this._tokens.isEmpty()}getLineTokens(e){return this._startLineNumber<=e&&e<=this._endLineNumber?this._tokens.getLineTokens(e-this._startLineNumber):null}getRange(){const e=this._tokens.getRange();return e&&new B(this._startLineNumber+e.startLineNumber,e.startColumn,this._startLineNumber+e.endLineNumber,e.endColumn)}removeTokens(e){const t=e.startLineNumber-this._startLineNumber,n=e.endLineNumber-this._startLineNumber;this._startLineNumber+=this._tokens.removeTokens(t,e.startColumn-1,n,e.endColumn-1),this._updateEndLineNumber()}split(e){const t=e.startLineNumber-this._startLineNumber,n=e.endLineNumber-this._startLineNumber,[r,o,s]=this._tokens.split(t,e.startColumn-1,n,e.endColumn-1);return[new EE(this._startLineNumber,r),new EE(this._startLineNumber+s,o)]}applyEdit(e,t){const[n,r,o]=Zv(t);this.acceptEdit(e,n,r,o,t.length>0?t.charCodeAt(0):0)}acceptEdit(e,t,n,r,o){this._acceptDeleteRange(e),this._acceptInsertText(new ae(e.startLineNumber,e.startColumn),t,n,r,o),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const t=e.startLineNumber-this._startLineNumber,n=e.endLineNumber-this._startLineNumber;if(n<0){const o=n-t;this._startLineNumber-=o;return}const r=this._tokens.getMaxDeltaLine();if(!(t>=r+1)){if(t<0&&n>=r+1){this._startLineNumber=0,this._tokens.clear();return}if(t<0){const o=-t;this._startLineNumber-=o,this._tokens.acceptDeleteRange(e.startColumn-1,0,0,n,e.endColumn-1)}else this._tokens.acceptDeleteRange(0,t,e.startColumn-1,n,e.endColumn-1)}}_acceptInsertText(e,t,n,r,o){if(t===0&&n===0)return;const s=e.lineNumber-this._startLineNumber;if(s<0){this._startLineNumber+=t;return}const a=this._tokens.getMaxDeltaLine();s>=a+1||this._tokens.acceptInsertText(s,e.column-1,t,n,r,o)}}class LP{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const t=[];for(let n=0;ne)n=r-1;else{let s=r;for(;s>t&&this._getDeltaLine(s-1)===e;)s--;let a=r;for(;ae||h===e&&g>=t)&&(he||g===e&&v>=t){if(go?p-=o-n:p=n;else if(f===t&&g===n)if(f===r&&p>o)p-=o-n;else{u=!0;continue}else if(fo)f=t,g=n,p=g+(p-o);else{u=!0;continue}else if(f>r){if(l===0&&!u){c=a;break}f-=l}else if(f===r&&g>=o)e&&f===0&&(g+=e,p+=e),f-=l,g-=o-n,p-=o-n;else throw new Error("Not possible!");const m=4*c;s[m]=f,s[m+1]=g,s[m+2]=p,s[m+3]=v,c++}this._tokenCount=c}acceptInsertText(e,t,n,r,o,s){const a=n===0&&r===1&&(s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122),l=this._tokens,c=this._tokenCount;for(let u=0;u=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},X6=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let oV=class{constructor(e,t,n,r){this._legend=e,this._themeService=t,this._languageService=n,this._logService=r,this._hasWarnedOverlappingTokens=!1,this._hasWarnedInvalidLengthTokens=!1,this._hasWarnedInvalidEditStart=!1,this._hashTable=new Og}getMetadata(e,t,n){const r=this._languageService.languageIdCodec.encodeLanguageId(n),o=this._hashTable.get(e,t,r);let s;if(o)s=o.metadata,this._logService.getLevel()===cs.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${us.getForeground(s)}, fontStyle ${us.getFontStyle(s).toString(2)}`);else{let a=this._legend.tokenTypes[e];const l=[];if(a){let c=t;for(let d=0;c>0&&d>1;c>0&&this._logService.getLevel()===cs.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),l.push("not-in-legend"));const u=this._themeService.getColorTheme().getTokenStyleMetadata(a,l,n);if(typeof u>"u")s=2147483647;else{if(s=0,typeof u.italic<"u"){const d=(u.italic?1:0)<<11;s|=d|1}if(typeof u.bold<"u"){const d=(u.bold?2:0)<<11;s|=d|2}if(typeof u.underline<"u"){const d=(u.underline?4:0)<<11;s|=d|4}if(typeof u.strikethrough<"u"){const d=(u.strikethrough?8:0)<<11;s|=d|8}if(u.foreground){const d=u.foreground<<15;s|=d|16}s===0&&(s=2147483647)}}else this._logService.getLevel()===cs.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),s=2147483647,a="not-in-legend";this._hashTable.add(e,t,r,s),this._logService.getLevel()===cs.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${a}) / ${t} (${l.join(" ")}): foreground ${us.getForeground(s)}, fontStyle ${us.getFontStyle(s).toString(2)}`)}return s}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,this._logService.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}warnInvalidLengthSemanticTokens(e,t){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,this._logService.warn(`Semantic token with invalid length detected at lineNumber ${e}, column ${t}`))}warnInvalidEditStart(e,t,n,r,o){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,this._logService.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${n}: The provided start offset ${r} is outside the previous data (length ${o}).`))}};oV=Mje([X6(1,To),X6(2,ji),X6(3,Ta)],oV);function m_e(i,e,t){const n=i.data,r=i.data.length/5|0,o=Math.max(Math.ceil(r/1024),400),s=[];let a=0,l=1,c=0;for(;au&&n[5*_]===0;)_--;if(_-1===u){let y=d;for(;y+1E)e.warnOverlappingSemanticTokens(L,E+1);else{const A=e.getMetadata(T,M,t);A!==2147483647&&(g===0&&(g=L),h[f]=L-g,h[f+1]=E,h[f+2]=k,h[f+3]=A,f+=4,p=L,v=k)}l=L,c=E,a++}f!==h.length&&(h=h.subarray(0,f));const m=EE.create(g,h);s.push(m)}return s}class Aje{constructor(e,t,n,r){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=n,this.metadata=r,this.next=null}}class Og{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=Og._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=this._growCount){const o=this._elements;this._currentLengthIndex++,this._currentLength=Og._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Y6=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let sV=class extends fe{constructor(e,t,n){super(),this._themeService=e,this._logService=t,this._languageService=n,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange(()=>{this._caches=new WeakMap}))}getStyling(e){return this._caches.has(e)||this._caches.set(e,new oV(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};sV=Pje([Y6(0,To),Y6(1,Ta),Y6(2,ji)],sV);In(K4,sV,1);const kR="**",xoe="/",xM="[/\\\\]",LM="[^/\\\\]",Oje=/\//g;function Loe(i,e){switch(i){case 0:return"";case 1:return`${LM}*?`;default:return`(?:${xM}|${LM}+${xM}${e?`|${xM}${LM}+`:""})*?`}}function Eoe(i,e){if(!i)return[];const t=[];let n=!1,r=!1,o="";for(const s of i){switch(s){case e:if(!n&&!r){t.push(o),o="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":r=!0;break;case"]":r=!1;break}o+=s}return o&&t.push(o),t}function v_e(i){if(!i)return"";let e="";const t=Eoe(i,xoe);if(t.every(n=>n===kR))e=".*";else{let n=!1;t.forEach((r,o)=>{if(r===kR){if(n)return;e+=Loe(2,o===t.length-1)}else{let s=!1,a="",l=!1,c="";for(const u of r){if(u!=="}"&&s){a+=u;continue}if(l&&(u!=="]"||!c)){let d;u==="-"?d=u:(u==="^"||u==="!")&&!c?d="^":u===xoe?d="":d=fc(u),c+=d;continue}switch(u){case"{":s=!0;continue;case"[":l=!0;continue;case"}":{const h=`(?:${Eoe(a,",").map(f=>v_e(f)).join("|")})`;e+=h,s=!1,a="";break}case"]":{e+="["+c+"]",l=!1,c="";break}case"?":e+=LM;continue;case"*":e+=Loe(1);continue;default:e+=fc(u)}}oDX(a,e)).filter(a=>a!==Rf),i),n=t.length;if(!n)return Rf;if(n===1)return t[0];const r=function(a,l){for(let c=0,u=t.length;c!!a.allBasenames);o&&(r.allBasenames=o.allBasenames);const s=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return s.length&&(r.allPaths=s),r}function Toe(i,e,t){const n=eh===oo.sep,r=n?i:i.replace(Oje,eh),o=eh+r,s=oo.sep+i;let a;return t?a=function(l,c){return typeof l=="string"&&(l===r||l.endsWith(o)||!n&&(l===i||l.endsWith(s)))?e:null}:a=function(l,c){return typeof l=="string"&&(l===r||!n&&l===i)?e:null},a.allPaths=[(t?"*/":"./")+i],a}function Kje(i){try{const e=new RegExp(`^${v_e(i)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?i:null}}catch{return Rf}}function Gje(i,e,t){return!i||typeof e!="string"?!1:__e(i)(e,void 0,t)}function __e(i,e={}){if(!i)return Ioe;if(typeof i=="string"||qje(i)){const t=DX(i,e);if(t===Rf)return Ioe;const n=function(r,o){return!!t(r,o)};return t.allBasenames&&(n.allBasenames=t.allBasenames),t.allPaths&&(n.allPaths=t.allPaths),n}return Xje(i,e)}function qje(i){const e=i;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function Xje(i,e){const t=b_e(Object.getOwnPropertyNames(i).map(a=>Yje(a,i[a],e)).filter(a=>a!==Rf)),n=t.length;if(!n)return Rf;if(!t.some(a=>!!a.requiresSiblings)){if(n===1)return t[0];const a=function(u,d){let h;for(let f=0,g=t.length;f{for(const f of h){const g=await f;if(typeof g=="string")return g}return null})():null},l=t.find(u=>!!u.allBasenames);l&&(a.allBasenames=l.allBasenames);const c=t.reduce((u,d)=>d.allPaths?u.concat(d.allPaths):u,[]);return c.length&&(a.allPaths=c),a}const r=function(a,l,c){let u,d;for(let h=0,f=t.length;h{for(const h of d){const f=await h;if(typeof f=="string")return f}return null})():null},o=t.find(a=>!!a.allBasenames);o&&(r.allBasenames=o.allBasenames);const s=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return s.length&&(r.allPaths=s),r}function Yje(i,e,t){if(e===!1)return Rf;const n=DX(i,t);if(n===Rf)return Rf;if(typeof e=="boolean")return n;if(e){const r=e.when;if(typeof r=="string"){const o=(s,a,l,c)=>{if(!c||!n(s,a))return null;const u=r.replace("$(basename)",()=>l),d=c(u);return nH(d)?d.then(h=>h?i:null):d?i:null};return o.requiresSiblings=!0,o}}return n}function b_e(i,e){const t=i.filter(a=>!!a.basenames);if(t.length<2)return i;const n=t.reduce((a,l)=>{const c=l.basenames;return c?a.concat(c):a},[]);let r;if(e){r=[];for(let a=0,l=n.length;a{const c=l.patterns;return c?a.concat(c):a},[]);const o=function(a,l){if(typeof a!="string")return null;if(!l){let u;for(u=a.length;u>0;u--){const d=a.charCodeAt(u-1);if(d===47||d===92)break}l=a.substr(u)}const c=n.indexOf(l);return c!==-1?r[c]:null};o.basenames=n,o.patterns=r,o.allBasenames=n;const s=i.filter(a=>!a.basenames);return s.push(o),s}function IX(i,e,t,n,r,o){if(Array.isArray(i)){let s=0;for(const a of i){const l=IX(a,e,t,n,r,o);if(l===10)return l;l>s&&(s=l)}return s}else{if(typeof i=="string")return n?i==="*"?5:i===t?10:0:0;if(i){const{language:s,pattern:a,scheme:l,hasAccessToAllModels:c,notebookType:u}=i;if(!n&&!c)return 0;u&&r&&(e=r);let d=0;if(l)if(l===e.scheme)d=10;else if(l==="*")d=5;else return 0;if(s)if(s===t)d=10;else if(s==="*")d=Math.max(d,5);else return 0;if(u)if(u===o)d=10;else if(u==="*"&&o!==void 0)d=Math.max(d,5);else return 0;if(a){let h;if(typeof a=="string"?h=a:h={...a,base:xpe(a.base)},h===e.fsPath||Gje(h,e.fsPath))d=10;else return 0}return d}else return 0}}function C_e(i){return typeof i=="string"?!1:Array.isArray(i)?i.every(C_e):!!i.exclusive}class Noe{constructor(e,t,n,r){this.uri=e,this.languageId=t,this.notebookUri=n,this.notebookType=r}equals(e){var t,n;return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&((t=this.notebookUri)===null||t===void 0?void 0:t.toString())===((n=e.notebookUri)===null||n===void 0?void 0:n.toString())}}class Ji{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new se,this.onDidChange=this._onDidChange.event}register(e,t){let n={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(n),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),Rt(()=>{if(n){const r=this._entries.indexOf(n);r>=0&&(this._entries.splice(r,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),n=void 0)}})}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);const t=[];for(const n of this._entries)n._score>0&&t.push(n.provider);return t}ordered(e){const t=[];return this._orderedForEach(e,n=>t.push(n.provider)),t}orderedGroups(e){const t=[];let n,r;return this._orderedForEach(e,o=>{n&&r===o._score?n.push(o.provider):(r=o._score,n=[o.provider],t.push(n))}),t}_orderedForEach(e,t){this._updateScores(e);for(const n of this._entries)n._score>0&&t(n)}_updateScores(e){var t,n;const r=(t=this._notebookInfoResolver)===null||t===void 0?void 0:t.call(this,e.uri),o=r?new Noe(e.uri,e.getLanguageId(),r.uri,r.type):new Noe(e.uri,e.getLanguageId(),void 0,void 0);if(!(!((n=this._lastCandidate)===null||n===void 0)&&n.equals(o))){this._lastCandidate=o;for(const s of this._entries)if(s._score=IX(s.selector,o.uri,o.languageId,Fme(e),o.notebookUri,o.notebookType),C_e(s.selector)&&s._score>0){for(const a of this._entries)a._score=0;s._score=1e3;break}this._entries.sort(Ji._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:PL(e.selector)&&!PL(t.selector)?1:!PL(e.selector)&&PL(t.selector)?-1:e._timet._time?-1:0}}function PL(i){return typeof i=="string"?!1:Array.isArray(i)?i.some(PL):!!i.isBuiltin}class Zje{constructor(){this.referenceProvider=new Ji(this._score.bind(this)),this.renameProvider=new Ji(this._score.bind(this)),this.newSymbolNamesProvider=new Ji(this._score.bind(this)),this.codeActionProvider=new Ji(this._score.bind(this)),this.definitionProvider=new Ji(this._score.bind(this)),this.typeDefinitionProvider=new Ji(this._score.bind(this)),this.declarationProvider=new Ji(this._score.bind(this)),this.implementationProvider=new Ji(this._score.bind(this)),this.documentSymbolProvider=new Ji(this._score.bind(this)),this.inlayHintsProvider=new Ji(this._score.bind(this)),this.colorProvider=new Ji(this._score.bind(this)),this.codeLensProvider=new Ji(this._score.bind(this)),this.documentFormattingEditProvider=new Ji(this._score.bind(this)),this.documentRangeFormattingEditProvider=new Ji(this._score.bind(this)),this.onTypeFormattingEditProvider=new Ji(this._score.bind(this)),this.signatureHelpProvider=new Ji(this._score.bind(this)),this.hoverProvider=new Ji(this._score.bind(this)),this.documentHighlightProvider=new Ji(this._score.bind(this)),this.multiDocumentHighlightProvider=new Ji(this._score.bind(this)),this.selectionRangeProvider=new Ji(this._score.bind(this)),this.foldingRangeProvider=new Ji(this._score.bind(this)),this.linkProvider=new Ji(this._score.bind(this)),this.inlineCompletionsProvider=new Ji(this._score.bind(this)),this.inlineEditProvider=new Ji(this._score.bind(this)),this.completionProvider=new Ji(this._score.bind(this)),this.linkedEditingRangeProvider=new Ji(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new Ji(this._score.bind(this)),this.documentSemanticTokensProvider=new Ji(this._score.bind(this)),this.documentOnDropEditProvider=new Ji(this._score.bind(this)),this.documentPasteEditProvider=new Ji(this._score.bind(this))}_score(e){var t;return(t=this._notebookTypeResolver)===null||t===void 0?void 0:t.call(this,e)}}In(_t,Zje,1);var Qje=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Roe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const kX=yn("hoverService");let EP=class extends fe{get delay(){return this.instantHover&&Date.now()-this.lastHoverHideTime{s.affectsConfiguration("workbench.hover.delay")&&(this._delay=this.configurationService.getValue("workbench.hover.delay"))}))}showHover(e,t){const n=typeof this.overrideOptions=="function"?this.overrideOptions(e,t):this.overrideOptions;this.hoverDisposables.clear();const r=e.target instanceof HTMLElement?[e.target]:e.target.targetElements;for(const o of r)this.hoverDisposables.add(Sr(o,"keydown",s=>{s.equals(9)&&this.hoverService.hideHover()}));return this.hoverService.showHover({...e,persistence:{hideOnHover:!0},...n},t)}onDidHideHover(){this.hoverDisposables.clear(),this.instantHover&&(this.lastHoverHideTime=Date.now())}};EP=Qje([Roe(3,gn),Roe(4,kX)],EP);const ng=yn("contextViewService"),Ol=yn("contextMenuService");const TR=He;let TX=class extends fe{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 Hk(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}};class G4 extends fe{static render(e,t,n){return new G4(e,t,n)}constructor(e,t,n){super(),this.actionContainer=ke(e,TR("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=ke(this.actionContainer,TR("a.action")),this.action.setAttribute("role","button"),t.iconClass&&ke(this.action,TR(`span.icon.${t.iconClass}`));const r=ke(this.action,TR("span"));r.textContent=n?`${t.label} (${n})`:t.label,this._register(ye(this.actionContainer,Ge.CLICK,o=>{o.stopPropagation(),o.preventDefault(),t.run(this.actionContainer)})),this._register(ye(this.actionContainer,Ge.KEY_DOWN,o=>{const s=new Ai(o);(s.equals(3)||s.equals(10))&&(o.stopPropagation(),o.preventDefault(),t.run(this.actionContainer))})),this.setEnabled(!0)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}function y_e(i,e){return i&&e?w("acessibleViewHint","Inspect this in the accessible view with {0}.",e):i?w("acessibleViewHintNoKbOpen","Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}const al=yn("openerService");function Jje(i){let e;const t=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(i.fragment);return t&&(e={startLineNumber:parseInt(t[1]),startColumn:t[2]?parseInt(t[2]):1,endLineNumber:t[4]?parseInt(t[4]):void 0,endColumn:t[4]?t[5]?parseInt(t[5]):1:void 0},i=i.with({fragment:""})),{selection:e,uri:i}}function eKe(i,e={}){const t=NX(e);return t.textContent=i,t}function tKe(i,e={}){const t=NX(e);return w_e(t,iKe(i,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function NX(i){const e=i.inline?"span":"div",t=document.createElement(e);return i.className&&(t.className=i.className),t}class nKe{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 w_e(i,e,t,n){let r;if(e.type===2)r=document.createTextNode(e.content||"");else if(e.type===3)r=document.createElement("b");else if(e.type===4)r=document.createElement("i");else if(e.type===7&&n)r=document.createElement("code");else if(e.type===5&&t){const o=document.createElement("a");t.disposables.add(Sr(o,"click",s=>{t.callback(String(e.index),s)})),r=o}else e.type===8?r=document.createElement("br"):e.type===1&&(r=i);r&&i!==r&&i.appendChild(r),r&&Array.isArray(e.children)&&e.children.forEach(o=>{w_e(r,o,t,n)})}function iKe(i,e){const t={type:1,children:[]};let n=0,r=t;const o=[],s=new nKe(i);for(;!s.eos();){let a=s.next();const l=a==="\\"&&aV(s.peek(),e)!==0;if(l&&(a=s.next()),!l&&rKe(a,e)&&a===s.peek()){s.advance(),r.type===2&&(r=o.pop());const c=aV(a,e);if(r.type===c||r.type===5&&c===6)r=o.pop();else{const u={type:c,children:[]};c===5&&(u.index=n,n++),r.children.push(u),o.push(r),r=u}}else if(a===` -`)r.type===2&&(r=o.pop()),r.children.push({type:8});else if(r.type!==2){const c={type:2,content:a};r.children.push(c),o.push(r),r=c}else r.content+=a}return r.type===2&&(r=o.pop()),t}function rKe(i,e){return aV(i,e)!==0}function aV(i,e){switch(i){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return e?7:0;default:return 0}}const oKe=new RegExp(`(\\\\)?\\$\\((${Wt.iconNameExpression}(?:${Wt.iconModifierExpression})?)\\)`,"g");function wv(i){const e=new Array;let t,n=0,r=0;for(;(t=oKe.exec(i))!==null;){r=t.index||0,n0)return new Uint32Array(e)}let Gl=0;const Fm=new Uint32Array(10);function aKe(i){if(Gl=0,$h(i,Q6,4352),Gl>0||($h(i,J6,4449),Gl>0)||($h(i,e9,4520),Gl>0)||($h(i,t0,12593),Gl))return Fm.subarray(0,Gl);if(i>=44032&&i<=55203){const e=i-44032,t=e%588,n=Math.floor(e/588),r=Math.floor(t/28),o=t%28-1;if(n=0&&(o0)return Fm.subarray(0,Gl)}}function $h(i,e,t){i>=t&&i>8&&(Fm[Gl++]=i>>8&255),i>>16&&(Fm[Gl++]=i>>16&255))}const Q6=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),J6=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),e9=new Uint16Array([114,82,29810,115,30579,26483,101,102,29286,24934,29030,29798,30822,30310,26470,97,113,29809,116,84,100,119,99,122,120,118,103]),t0=new Uint16Array([114,82,29810,115,30579,26483,101,69,102,29286,24934,29030,29798,30822,30310,26470,97,113,81,29809,116,84,100,119,87,99,122,120,118,103,107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]);function RX(...i){return function(e,t){for(let n=0,r=i.length;n0?[{start:0,end:e.length}]:[]:null}function x_e(i,e){const t=e.toLowerCase().indexOf(i.toLowerCase());return t===-1?null:[{start:t,end:t+i.length}]}function L_e(i,e){return lV(i.toLowerCase(),e.toLowerCase(),0,0)}function lV(i,e,t,n){if(t===i.length)return[];if(n===e.length)return null;if(i[t]===e[n]){let r=null;return(r=lV(i,e,t+1,n+1))?PX({start:n,end:n+1},r):null}return lV(i,e,t,n+1)}function MX(i){return 97<=i&&i<=122}function q4(i){return 65<=i&&i<=90}function AX(i){return 48<=i&&i<=57}function E_e(i){return i===32||i===9||i===10||i===13}const D_e=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(i=>D_e.add(i.charCodeAt(0)));function DP(i){return E_e(i)||D_e.has(i)}function Moe(i,e){return i===e||DP(i)&&DP(e)}const t9=new Map;function Aoe(i){if(t9.has(i))return t9.get(i);let e;const t=sKe(i);return t&&(e=t),t9.set(i,e),e}function I_e(i){return MX(i)||q4(i)||AX(i)}function PX(i,e){return e.length===0?e=[i]:i.end===e[0].start?e[0].start=i.start:e.unshift(i),e}function k_e(i,e){for(let t=e;t0&&!I_e(i.charCodeAt(t-1)))return t}return i.length}function cV(i,e,t,n){if(t===i.length)return[];if(n===e.length)return null;if(i[t]!==e[n].toLowerCase())return null;{let r=null,o=n+1;for(r=cV(i,e,t+1,n+1);!r&&(o=k_e(e,o)).6}function dKe(i){const{upperPercent:e,lowerPercent:t,alphaPercent:n,numericPercent:r}=i;return t>.2&&e<.8&&n>.6&&r<.2}function hKe(i){let e=0,t=0,n=0,r=0;for(let o=0;o60&&(e=e.substring(0,60));const t=cKe(e);if(!dKe(t)){if(!uKe(t))return null;e=e.toLowerCase()}let n=null,r=0;for(i=i.toLowerCase();r0&&DP(i.charCodeAt(t-1)))return t;return i.length}const gKe=RX(iI,T_e,x_e),pKe=RX(iI,T_e,L_e),Poe=new D_(1e4);function Ooe(i,e,t=!1){if(typeof i!="string"||typeof e!="string")return null;let n=Poe.get(i);n||(n=new RegExp(B5e(i),"i"),Poe.set(i,n));const r=n.exec(e);return r?[{start:r.index,end:r.index+r[0].length}]:t?pKe(i,e):gKe(i,e)}function mKe(i,e){const t=Ab(i,i.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return t?qk(t):null}function vKe(i,e,t,n,r,o){const s=Math.min(13,i.length);for(;t"u")return[];const e=[],t=i[1];for(let n=i.length-1;n>1;n--){const r=i[n]+t,o=e[e.length-1];o&&o.end===r?o.end=r+1:e.push({start:r,end:r+1})}return e}const Ym=128;function OX(){const i=[],e=[];for(let t=0;t<=Ym;t++)e[t]=0;for(let t=0;t<=Ym;t++)i.push(e.slice(0));return i}function R_e(i){const e=[];for(let t=0;t<=i;t++)e[t]=0;return e}const M_e=R_e(2*Ym),dV=R_e(2*Ym),vg=OX(),n0=OX(),NR=OX();function RR(i,e){if(e<0||e>=i.length)return!1;const t=i.codePointAt(e);switch(t){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:return!!bq(t)}}function Foe(i,e){if(e<0||e>=i.length)return!1;switch(i.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}function EM(i,e,t){return e[i]!==t[i]}function _Ke(i,e,t,n,r,o,s=!1){for(;eYm?Ym:i.length,l=n.length>Ym?Ym:n.length;if(t>=a||o>=l||a-t>l-o||!_Ke(e,t,a,r,o,l,!0))return;bKe(a,l,t,o,e,r);let c=1,u=1,d=t,h=o;const f=[!1];for(c=1,d=t;d_,T=k?n0[c][u-1]+(vg[c][u-1]>0?-5:0):0,M=h>_+1&&vg[c][u-1]>0,A=M?n0[c][u-2]+(vg[c][u-2]>0?-5:0):0;if(M&&(!k||A>=T)&&(!E||A>=D))n0[c][u]=A,NR[c][u]=3,vg[c][u]=0;else if(k&&(!E||T>=D))n0[c][u]=T,NR[c][u]=2,vg[c][u]=0;else if(E)n0[c][u]=D,NR[c][u]=1,vg[c][u]=vg[c-1][u-1]+1;else throw new Error("not possible")}}if(!f[0]&&!s.firstMatchCanBeWeak)return;c--,u--;const g=[n0[c][u],o];let p=0,v=0;for(;c>=1;){let _=u;do{const y=NR[c][_];if(y===3)_=_-2;else if(y===2)_=_-1;else break}while(_>=1);p>1&&e[t+c-1]===r[o+u-1]&&!EM(_+o-1,n,r)&&p+1>vg[c][_]&&(_=u),_===u?p++:p=1,v||(v=_),c--,u=_-1,g.push(u)}l===a&&s.boostFullMatch&&(g[0]+=2);const m=v-a;return g[0]-=m,g}function bKe(i,e,t,n,r,o){let s=i-1,a=e-1;for(;s>=t&&a>=n;)r[s]===o[a]&&(dV[s]=a,s--),a--}function CKe(i,e,t,n,r,o,s,a,l,c,u){if(e[t]!==o[s])return Number.MIN_SAFE_INTEGER;let d=1,h=!1;return s===t-n?d=i[t]===r[s]?7:5:EM(s,r,o)&&(s===0||!EM(s-1,r,o))?(d=i[t]===r[s]?7:5,h=!0):RR(o,s)&&(s===0||!RR(o,s-1))?d=5:(RR(o,s-1)||Foe(o,s-1))&&(d=5,h=!0),d>1&&t===n&&(u[0]=!0),h||(h=EM(s,r,o)||RR(o,s-1)||Foe(o,s-1)),t===n?s>l&&(d-=h?3:5):c?d+=h?2:0:d+=h?0:1,s+1===a&&(d-=h?3:5),d}function yKe(i,e,t,n,r,o,s){return wKe(i,e,t,n,r,o,!0,s)}function wKe(i,e,t,n,r,o,s,a){let l=Ab(i,e,t,n,r,o,a);if(l&&!s)return l;if(i.length>=3){const c=Math.min(7,i.length-1);for(let u=t+1;ul[0])&&(l=h))}}}return l}function SKe(i,e){if(e+1>=i.length)return;const t=i[e],n=i[e+1];if(t!==n)return i.slice(0,e)+n+t+i.slice(e+2)}const xKe="$(",FX=new RegExp(`\\$\\(${Wt.iconNameExpression}(?:${Wt.iconModifierExpression})?\\)`,"g"),LKe=new RegExp(`(\\\\)?${FX.source}`,"g");function EKe(i){return i.replace(LKe,(e,t)=>t?e:`\\${e}`)}const DKe=new RegExp(`\\\\${FX.source}`,"g");function IKe(i){return i.replace(DKe,e=>`\\${e}`)}const kKe=new RegExp(`(\\s)?(\\\\)?${FX.source}(\\s)?`,"g");function BX(i){return i.indexOf(xKe)===-1?i:i.replace(kKe,(e,t,n,r)=>n?e:t||r||"")}function TKe(i){return i?i.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}const n9=new RegExp(`\\$\\(${Wt.iconNameCharacter}+\\)`,"g");function OL(i){n9.lastIndex=0;let e="";const t=[];let n=0;for(;;){const r=n9.lastIndex,o=n9.exec(i),s=i.substring(r,o==null?void 0:o.index);if(s.length>0){e+=s;for(let a=0;a" ".repeat(r.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===1?`\\ +`))}pushElement(e,t=Ww.None,n=ff.None){if(e.type===0){const r=ER(e.resource),o=this.getUriComparisonKey(e.resource);this._pushElement(new DR(e,r,o,t.id,t.nextOrder(),n.id,n.nextOrder()))}else{const r=new Set,o=[],s=[];for(const a of e.resources){const l=ER(a),c=this.getUriComparisonKey(a);r.has(c)||(r.add(c),o.push(l),s.push(c))}o.length===1?this._pushElement(new DR(e,o[0],s[0],t.id,t.nextOrder(),n.id,n.nextOrder())):this._pushElement(new Ije(e,o,s,t.id,t.nextOrder(),n.id,n.nextOrder()))}}_pushElement(e){for(let t=0,n=e.strResources.length;tt.sourceOrder)&&(t=s,n=r)}return[t,n]}canUndo(e){if(e instanceof ff){const[,n]=this._findClosestUndoElementWithSource(e.id);return!!n}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasPastElements():!1}_onError(e,t){en(e);for(const n of t.strResources)this.removeElements(n);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,n,r,o){const s=this._acquireLocks(n);let a;try{a=t()}catch(l){return s(),r.dispose(),this._onError(l,e)}return a?a.then(()=>(s(),r.dispose(),o()),l=>(s(),r.dispose(),this._onError(l,e))):(s(),r.dispose(),o())}async _invokeWorkspacePrepare(e){if(typeof e.actual.prepareUndoRedo>"u")return fe.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?fe.None:t}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo>"u")return t(fe.None);const n=e.actual.prepareUndoRedo();return n?aq(n)?t(n):n.then(r=>t(r)):t(fe.None)}_getAffectedEditStacks(e){const t=[];for(const n of e.strResources)t.push(this._editStacks.get(n)||g_e);return new q6(t)}_tryToSplitAndUndo(e,t,n,r){if(t.canSplit())return this._splitPastWorkspaceElement(t,n),this._notificationService.warn(r),new IR(this._undo(e,0,!0));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(r),new IR}_checkWorkspaceUndo(e,t,n,r){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,w({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(r&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,w({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const a of n.editStacks)a.getClosestPastElement()!==t&&o.push(a.resourceLabel);if(o.length>0)return this._tryToSplitAndUndo(e,t,null,w({key:"cannotWorkspaceUndoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const s=[];for(const a of n.editStacks)a.locked&&s.push(a.resourceLabel);return s.length>0?this._tryToSplitAndUndo(e,t,null,w({key:"cannotWorkspaceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,s.join(", "))):n.isValid()?null:this._tryToSplitAndUndo(e,t,null,w({key:"cannotWorkspaceUndoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,n){const r=this._getAffectedEditStacks(t),o=this._checkWorkspaceUndo(e,t,r,!1);return o?o.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,r,n)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const n=t.getClosestPastElement();if(n){if(n===e){const r=t.getSecondClosestPastElement();if(r&&r.groupId===e.groupId)return!0}if(n.groupId===e.groupId)return!0}}return!1}async _confirmAndExecuteWorkspaceUndo(e,t,n,r){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){let a;(function(u){u[u.All=0]="All",u[u.This=1]="This",u[u.Cancel=2]="Cancel"})(a||(a={}));const{result:l}=await this._dialogService.prompt({type:kr.Info,message:w("confirmWorkspace","Would you like to undo '{0}' across all files?",t.label),buttons:[{label:w({key:"ok",comment:["{0} denotes a number that is > 1, && denotes a mnemonic"]},"&&Undo in {0} Files",n.editStacks.length),run:()=>a.All},{label:w({key:"nok",comment:["&& denotes a mnemonic"]},"Undo this &&File"),run:()=>a.This}],cancelButton:{run:()=>a.Cancel}});if(l===a.Cancel)return;if(l===a.This)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const c=this._checkWorkspaceUndo(e,t,n,!1);if(c)return c.returnValue;r=!0}let o;try{o=await this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}const s=this._checkWorkspaceUndo(e,t,n,!0);if(s)return o.dispose(),s.returnValue;for(const a of n.editStacks)a.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),n,o,()=>this._continueUndoInGroup(t.groupId,r))}_resourceUndo(e,t,n){if(!t.isValid){e.flushAllElements();return}if(e.locked){const r=w({key:"cannotResourceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(r);return}return this._invokeResourcePrepare(t,r=>(e.moveBackward(t),this._safeInvokeWithLocks(t,()=>t.actual.undo(),new q6([e]),r,()=>this._continueUndoInGroup(t.groupId,n))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,n=null;for(const[r,o]of this._editStacks){const s=o.getClosestPastElement();s&&s.groupId===e&&(!t||s.groupOrder>t.groupOrder)&&(t=s,n=r)}return[t,n]}_continueUndoInGroup(e,t){if(!e)return;const[,n]=this._findClosestUndoElementInGroup(e);if(n)return this._undo(n,0,t)}undo(e){if(e instanceof ff){const[,t]=this._findClosestUndoElementWithSource(e.id);return t?this._undo(t,e.id,!1):void 0}return typeof e=="string"?this._undo(e,0,!1):this._undo(this.getUriComparisonKey(e),0,!1)}_undo(e,t=0,n){if(!this._editStacks.has(e))return;const r=this._editStacks.get(e),o=r.getClosestPastElement();if(!o)return;if(o.groupId){const[a,l]=this._findClosestUndoElementInGroup(o.groupId);if(o!==a&&l)return this._undo(l,t,n)}if((o.sourceId!==t||o.confirmBeforeUndo)&&!n)return this._confirmAndContinueUndo(e,t,o);try{return o.type===1?this._workspaceUndo(e,o,n):this._resourceUndo(r,o,n)}finally{}}async _confirmAndContinueUndo(e,t,n){if((await this._dialogService.confirm({message:w("confirmDifferentSource","Would you like to undo '{0}'?",n.label),primaryButton:w({key:"confirmDifferentSource.yes",comment:["&& denotes a mnemonic"]},"&&Yes"),cancelButton:w("confirmDifferentSource.no","No")})).confirmed)return this._undo(e,t,!0)}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,n=null;for(const[r,o]of this._editStacks){const s=o.getClosestFutureElement();s&&s.sourceId===e&&(!t||s.sourceOrder0)return this._tryToSplitAndRedo(e,t,null,w({key:"cannotWorkspaceRedoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const s=[];for(const a of n.editStacks)a.locked&&s.push(a.resourceLabel);return s.length>0?this._tryToSplitAndRedo(e,t,null,w({key:"cannotWorkspaceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,s.join(", "))):n.isValid()?null:this._tryToSplitAndRedo(e,t,null,w({key:"cannotWorkspaceRedoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceRedo(e,t){const n=this._getAffectedEditStacks(t),r=this._checkWorkspaceRedo(e,t,n,!1);return r?r.returnValue:this._executeWorkspaceRedo(e,t,n)}async _executeWorkspaceRedo(e,t,n){let r;try{r=await this._invokeWorkspacePrepare(t)}catch(s){return this._onError(s,t)}const o=this._checkWorkspaceRedo(e,t,n,!0);if(o)return r.dispose(),o.returnValue;for(const s of n.editStacks)s.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),n,r,()=>this._continueRedoInGroup(t.groupId))}_resourceRedo(e,t){if(!t.isValid){e.flushAllElements();return}if(e.locked){const n=w({key:"cannotResourceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(n);return}return this._invokeResourcePrepare(t,n=>(e.moveForward(t),this._safeInvokeWithLocks(t,()=>t.actual.redo(),new q6([e]),n,()=>this._continueRedoInGroup(t.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,n=null;for(const[r,o]of this._editStacks){const s=o.getClosestFutureElement();s&&s.groupId===e&&(!t||s.groupOrder=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},woe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const gu=yn("ILanguageFeatureDebounceService");var xP;(function(i){const e=new WeakMap;let t=0;function n(r){let o=e.get(r);return o===void 0&&(o=++t,e.set(r,o)),o}i.of=n})(xP||(xP={}));class Nje{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}}class Rje{constructor(e,t,n,r,o,s){this._logService=e,this._name=t,this._registry=n,this._default=r,this._min=o,this._max=s,this._cache=new E_(50,.7)}_key(e){return e.id+this._registry.all(e).reduce((t,n)=>c4(xP.of(n),t),0)}get(e){const t=this._key(e),n=this._cache.get(t);return n?da(n.value,this._min,this._max):this.default()}update(e,t){const n=this._key(e);let r=this._cache.get(n);r||(r=new kje(6),this._cache.set(n,r));const o=da(r.update(t),this._min,this._max);return xq(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${o}ms`),o}_overall(){const e=new p_e;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){const e=this._overall()|0||this._default;return da(e,this._min,this._max)}}let rV=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,n){var r,o,s;const a=(r=n==null?void 0:n.min)!==null&&r!==void 0?r:50,l=(o=n==null?void 0:n.max)!==null&&o!==void 0?o:a**2,c=(s=n==null?void 0:n.key)!==null&&s!==void 0?s:void 0,u=`${xP.of(e)},${a}${c?","+c:""}`;let d=this._data.get(u);return d||(this._isDev?d=new Rje(this._logService,t,e,this._overallAverage()|0||a*1.5,a,l):(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),d=new Nje(a*1.5)),this._data.set(u,d)),d}_overallAverage(){const e=new p_e;for(const t of this._data.values())e.update(t.default());return e.value}};rV=Tje([woe(0,Ta),woe(1,EX)],rV);In(gu,rV,1);class EE{static create(e,t){return new EE(e,new LP(t))}get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._endLineNumber}constructor(e,t){this._startLineNumber=e,this._tokens=t,this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}toString(){return this._tokens.toString(this._startLineNumber)}_updateEndLineNumber(){this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}isEmpty(){return this._tokens.isEmpty()}getLineTokens(e){return this._startLineNumber<=e&&e<=this._endLineNumber?this._tokens.getLineTokens(e-this._startLineNumber):null}getRange(){const e=this._tokens.getRange();return e&&new B(this._startLineNumber+e.startLineNumber,e.startColumn,this._startLineNumber+e.endLineNumber,e.endColumn)}removeTokens(e){const t=e.startLineNumber-this._startLineNumber,n=e.endLineNumber-this._startLineNumber;this._startLineNumber+=this._tokens.removeTokens(t,e.startColumn-1,n,e.endColumn-1),this._updateEndLineNumber()}split(e){const t=e.startLineNumber-this._startLineNumber,n=e.endLineNumber-this._startLineNumber,[r,o,s]=this._tokens.split(t,e.startColumn-1,n,e.endColumn-1);return[new EE(this._startLineNumber,r),new EE(this._startLineNumber+s,o)]}applyEdit(e,t){const[n,r,o]=Yv(t);this.acceptEdit(e,n,r,o,t.length>0?t.charCodeAt(0):0)}acceptEdit(e,t,n,r,o){this._acceptDeleteRange(e),this._acceptInsertText(new ae(e.startLineNumber,e.startColumn),t,n,r,o),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const t=e.startLineNumber-this._startLineNumber,n=e.endLineNumber-this._startLineNumber;if(n<0){const o=n-t;this._startLineNumber-=o;return}const r=this._tokens.getMaxDeltaLine();if(!(t>=r+1)){if(t<0&&n>=r+1){this._startLineNumber=0,this._tokens.clear();return}if(t<0){const o=-t;this._startLineNumber-=o,this._tokens.acceptDeleteRange(e.startColumn-1,0,0,n,e.endColumn-1)}else this._tokens.acceptDeleteRange(0,t,e.startColumn-1,n,e.endColumn-1)}}_acceptInsertText(e,t,n,r,o){if(t===0&&n===0)return;const s=e.lineNumber-this._startLineNumber;if(s<0){this._startLineNumber+=t;return}const a=this._tokens.getMaxDeltaLine();s>=a+1||this._tokens.acceptInsertText(s,e.column-1,t,n,r,o)}}class LP{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const t=[];for(let n=0;ne)n=r-1;else{let s=r;for(;s>t&&this._getDeltaLine(s-1)===e;)s--;let a=r;for(;ae||h===e&&g>=t)&&(he||g===e&&v>=t){if(go?p-=o-n:p=n;else if(f===t&&g===n)if(f===r&&p>o)p-=o-n;else{u=!0;continue}else if(fo)f=t,g=n,p=g+(p-o);else{u=!0;continue}else if(f>r){if(l===0&&!u){c=a;break}f-=l}else if(f===r&&g>=o)e&&f===0&&(g+=e,p+=e),f-=l,g-=o-n,p-=o-n;else throw new Error("Not possible!");const m=4*c;s[m]=f,s[m+1]=g,s[m+2]=p,s[m+3]=v,c++}this._tokenCount=c}acceptInsertText(e,t,n,r,o,s){const a=n===0&&r===1&&(s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122),l=this._tokens,c=this._tokenCount;for(let u=0;u=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},X6=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let oV=class{constructor(e,t,n,r){this._legend=e,this._themeService=t,this._languageService=n,this._logService=r,this._hasWarnedOverlappingTokens=!1,this._hasWarnedInvalidLengthTokens=!1,this._hasWarnedInvalidEditStart=!1,this._hashTable=new Og}getMetadata(e,t,n){const r=this._languageService.languageIdCodec.encodeLanguageId(n),o=this._hashTable.get(e,t,r);let s;if(o)s=o.metadata,this._logService.getLevel()===cs.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${us.getForeground(s)}, fontStyle ${us.getFontStyle(s).toString(2)}`);else{let a=this._legend.tokenTypes[e];const l=[];if(a){let c=t;for(let d=0;c>0&&d>1;c>0&&this._logService.getLevel()===cs.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),l.push("not-in-legend"));const u=this._themeService.getColorTheme().getTokenStyleMetadata(a,l,n);if(typeof u>"u")s=2147483647;else{if(s=0,typeof u.italic<"u"){const d=(u.italic?1:0)<<11;s|=d|1}if(typeof u.bold<"u"){const d=(u.bold?2:0)<<11;s|=d|2}if(typeof u.underline<"u"){const d=(u.underline?4:0)<<11;s|=d|4}if(typeof u.strikethrough<"u"){const d=(u.strikethrough?8:0)<<11;s|=d|8}if(u.foreground){const d=u.foreground<<15;s|=d|16}s===0&&(s=2147483647)}}else this._logService.getLevel()===cs.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),s=2147483647,a="not-in-legend";this._hashTable.add(e,t,r,s),this._logService.getLevel()===cs.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${a}) / ${t} (${l.join(" ")}): foreground ${us.getForeground(s)}, fontStyle ${us.getFontStyle(s).toString(2)}`)}return s}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,this._logService.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}warnInvalidLengthSemanticTokens(e,t){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,this._logService.warn(`Semantic token with invalid length detected at lineNumber ${e}, column ${t}`))}warnInvalidEditStart(e,t,n,r,o){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,this._logService.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${n}: The provided start offset ${r} is outside the previous data (length ${o}).`))}};oV=Mje([X6(1,To),X6(2,ji),X6(3,Ta)],oV);function m_e(i,e,t){const n=i.data,r=i.data.length/5|0,o=Math.max(Math.ceil(r/1024),400),s=[];let a=0,l=1,c=0;for(;au&&n[5*_]===0;)_--;if(_-1===u){let y=d;for(;y+1E)e.warnOverlappingSemanticTokens(L,E+1);else{const A=e.getMetadata(T,M,t);A!==2147483647&&(g===0&&(g=L),h[f]=L-g,h[f+1]=E,h[f+2]=k,h[f+3]=A,f+=4,p=L,v=k)}l=L,c=E,a++}f!==h.length&&(h=h.subarray(0,f));const m=EE.create(g,h);s.push(m)}return s}class Aje{constructor(e,t,n,r){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=n,this.metadata=r,this.next=null}}class Og{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=Og._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=this._growCount){const o=this._elements;this._currentLengthIndex++,this._currentLength=Og._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Y6=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let sV=class extends fe{constructor(e,t,n){super(),this._themeService=e,this._logService=t,this._languageService=n,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange(()=>{this._caches=new WeakMap}))}getStyling(e){return this._caches.has(e)||this._caches.set(e,new oV(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};sV=Pje([Y6(0,To),Y6(1,Ta),Y6(2,ji)],sV);In(K4,sV,1);const kR="**",xoe="/",xM="[/\\\\]",LM="[^/\\\\]",Oje=/\//g;function Loe(i,e){switch(i){case 0:return"";case 1:return`${LM}*?`;default:return`(?:${xM}|${LM}+${xM}${e?`|${xM}${LM}+`:""})*?`}}function Eoe(i,e){if(!i)return[];const t=[];let n=!1,r=!1,o="";for(const s of i){switch(s){case e:if(!n&&!r){t.push(o),o="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":r=!0;break;case"]":r=!1;break}o+=s}return o&&t.push(o),t}function v_e(i){if(!i)return"";let e="";const t=Eoe(i,xoe);if(t.every(n=>n===kR))e=".*";else{let n=!1;t.forEach((r,o)=>{if(r===kR){if(n)return;e+=Loe(2,o===t.length-1)}else{let s=!1,a="",l=!1,c="";for(const u of r){if(u!=="}"&&s){a+=u;continue}if(l&&(u!=="]"||!c)){let d;u==="-"?d=u:(u==="^"||u==="!")&&!c?d="^":u===xoe?d="":d=fc(u),c+=d;continue}switch(u){case"{":s=!0;continue;case"[":l=!0;continue;case"}":{const h=`(?:${Eoe(a,",").map(f=>v_e(f)).join("|")})`;e+=h,s=!1,a="";break}case"]":{e+="["+c+"]",l=!1,c="";break}case"?":e+=LM;continue;case"*":e+=Loe(1);continue;default:e+=fc(u)}}oDX(a,e)).filter(a=>a!==Rf),i),n=t.length;if(!n)return Rf;if(n===1)return t[0];const r=function(a,l){for(let c=0,u=t.length;c!!a.allBasenames);o&&(r.allBasenames=o.allBasenames);const s=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return s.length&&(r.allPaths=s),r}function Toe(i,e,t){const n=eh===oo.sep,r=n?i:i.replace(Oje,eh),o=eh+r,s=oo.sep+i;let a;return t?a=function(l,c){return typeof l=="string"&&(l===r||l.endsWith(o)||!n&&(l===i||l.endsWith(s)))?e:null}:a=function(l,c){return typeof l=="string"&&(l===r||!n&&l===i)?e:null},a.allPaths=[(t?"*/":"./")+i],a}function Kje(i){try{const e=new RegExp(`^${v_e(i)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?i:null}}catch{return Rf}}function Gje(i,e,t){return!i||typeof e!="string"?!1:__e(i)(e,void 0,t)}function __e(i,e={}){if(!i)return Ioe;if(typeof i=="string"||qje(i)){const t=DX(i,e);if(t===Rf)return Ioe;const n=function(r,o){return!!t(r,o)};return t.allBasenames&&(n.allBasenames=t.allBasenames),t.allPaths&&(n.allPaths=t.allPaths),n}return Xje(i,e)}function qje(i){const e=i;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function Xje(i,e){const t=b_e(Object.getOwnPropertyNames(i).map(a=>Yje(a,i[a],e)).filter(a=>a!==Rf)),n=t.length;if(!n)return Rf;if(!t.some(a=>!!a.requiresSiblings)){if(n===1)return t[0];const a=function(u,d){let h;for(let f=0,g=t.length;f{for(const f of h){const g=await f;if(typeof g=="string")return g}return null})():null},l=t.find(u=>!!u.allBasenames);l&&(a.allBasenames=l.allBasenames);const c=t.reduce((u,d)=>d.allPaths?u.concat(d.allPaths):u,[]);return c.length&&(a.allPaths=c),a}const r=function(a,l,c){let u,d;for(let h=0,f=t.length;h{for(const h of d){const f=await h;if(typeof f=="string")return f}return null})():null},o=t.find(a=>!!a.allBasenames);o&&(r.allBasenames=o.allBasenames);const s=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return s.length&&(r.allPaths=s),r}function Yje(i,e,t){if(e===!1)return Rf;const n=DX(i,t);if(n===Rf)return Rf;if(typeof e=="boolean")return n;if(e){const r=e.when;if(typeof r=="string"){const o=(s,a,l,c)=>{if(!c||!n(s,a))return null;const u=r.replace("$(basename)",()=>l),d=c(u);return nH(d)?d.then(h=>h?i:null):d?i:null};return o.requiresSiblings=!0,o}}return n}function b_e(i,e){const t=i.filter(a=>!!a.basenames);if(t.length<2)return i;const n=t.reduce((a,l)=>{const c=l.basenames;return c?a.concat(c):a},[]);let r;if(e){r=[];for(let a=0,l=n.length;a{const c=l.patterns;return c?a.concat(c):a},[]);const o=function(a,l){if(typeof a!="string")return null;if(!l){let u;for(u=a.length;u>0;u--){const d=a.charCodeAt(u-1);if(d===47||d===92)break}l=a.substr(u)}const c=n.indexOf(l);return c!==-1?r[c]:null};o.basenames=n,o.patterns=r,o.allBasenames=n;const s=i.filter(a=>!a.basenames);return s.push(o),s}function IX(i,e,t,n,r,o){if(Array.isArray(i)){let s=0;for(const a of i){const l=IX(a,e,t,n,r,o);if(l===10)return l;l>s&&(s=l)}return s}else{if(typeof i=="string")return n?i==="*"?5:i===t?10:0:0;if(i){const{language:s,pattern:a,scheme:l,hasAccessToAllModels:c,notebookType:u}=i;if(!n&&!c)return 0;u&&r&&(e=r);let d=0;if(l)if(l===e.scheme)d=10;else if(l==="*")d=5;else return 0;if(s)if(s===t)d=10;else if(s==="*")d=Math.max(d,5);else return 0;if(u)if(u===o)d=10;else if(u==="*"&&o!==void 0)d=Math.max(d,5);else return 0;if(a){let h;if(typeof a=="string"?h=a:h={...a,base:xpe(a.base)},h===e.fsPath||Gje(h,e.fsPath))d=10;else return 0}return d}else return 0}}function C_e(i){return typeof i=="string"?!1:Array.isArray(i)?i.every(C_e):!!i.exclusive}class Noe{constructor(e,t,n,r){this.uri=e,this.languageId=t,this.notebookUri=n,this.notebookType=r}equals(e){var t,n;return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&((t=this.notebookUri)===null||t===void 0?void 0:t.toString())===((n=e.notebookUri)===null||n===void 0?void 0:n.toString())}}class Ji{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new se,this.onDidChange=this._onDidChange.event}register(e,t){let n={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(n),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),Rt(()=>{if(n){const r=this._entries.indexOf(n);r>=0&&(this._entries.splice(r,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),n=void 0)}})}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);const t=[];for(const n of this._entries)n._score>0&&t.push(n.provider);return t}ordered(e){const t=[];return this._orderedForEach(e,n=>t.push(n.provider)),t}orderedGroups(e){const t=[];let n,r;return this._orderedForEach(e,o=>{n&&r===o._score?n.push(o.provider):(r=o._score,n=[o.provider],t.push(n))}),t}_orderedForEach(e,t){this._updateScores(e);for(const n of this._entries)n._score>0&&t(n)}_updateScores(e){var t,n;const r=(t=this._notebookInfoResolver)===null||t===void 0?void 0:t.call(this,e.uri),o=r?new Noe(e.uri,e.getLanguageId(),r.uri,r.type):new Noe(e.uri,e.getLanguageId(),void 0,void 0);if(!(!((n=this._lastCandidate)===null||n===void 0)&&n.equals(o))){this._lastCandidate=o;for(const s of this._entries)if(s._score=IX(s.selector,o.uri,o.languageId,Fme(e),o.notebookUri,o.notebookType),C_e(s.selector)&&s._score>0){for(const a of this._entries)a._score=0;s._score=1e3;break}this._entries.sort(Ji._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:PL(e.selector)&&!PL(t.selector)?1:!PL(e.selector)&&PL(t.selector)?-1:e._timet._time?-1:0}}function PL(i){return typeof i=="string"?!1:Array.isArray(i)?i.some(PL):!!i.isBuiltin}class Zje{constructor(){this.referenceProvider=new Ji(this._score.bind(this)),this.renameProvider=new Ji(this._score.bind(this)),this.newSymbolNamesProvider=new Ji(this._score.bind(this)),this.codeActionProvider=new Ji(this._score.bind(this)),this.definitionProvider=new Ji(this._score.bind(this)),this.typeDefinitionProvider=new Ji(this._score.bind(this)),this.declarationProvider=new Ji(this._score.bind(this)),this.implementationProvider=new Ji(this._score.bind(this)),this.documentSymbolProvider=new Ji(this._score.bind(this)),this.inlayHintsProvider=new Ji(this._score.bind(this)),this.colorProvider=new Ji(this._score.bind(this)),this.codeLensProvider=new Ji(this._score.bind(this)),this.documentFormattingEditProvider=new Ji(this._score.bind(this)),this.documentRangeFormattingEditProvider=new Ji(this._score.bind(this)),this.onTypeFormattingEditProvider=new Ji(this._score.bind(this)),this.signatureHelpProvider=new Ji(this._score.bind(this)),this.hoverProvider=new Ji(this._score.bind(this)),this.documentHighlightProvider=new Ji(this._score.bind(this)),this.multiDocumentHighlightProvider=new Ji(this._score.bind(this)),this.selectionRangeProvider=new Ji(this._score.bind(this)),this.foldingRangeProvider=new Ji(this._score.bind(this)),this.linkProvider=new Ji(this._score.bind(this)),this.inlineCompletionsProvider=new Ji(this._score.bind(this)),this.inlineEditProvider=new Ji(this._score.bind(this)),this.completionProvider=new Ji(this._score.bind(this)),this.linkedEditingRangeProvider=new Ji(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new Ji(this._score.bind(this)),this.documentSemanticTokensProvider=new Ji(this._score.bind(this)),this.documentOnDropEditProvider=new Ji(this._score.bind(this)),this.documentPasteEditProvider=new Ji(this._score.bind(this))}_score(e){var t;return(t=this._notebookTypeResolver)===null||t===void 0?void 0:t.call(this,e)}}In(_t,Zje,1);var Qje=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Roe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const kX=yn("hoverService");let EP=class extends fe{get delay(){return this.instantHover&&Date.now()-this.lastHoverHideTime{s.affectsConfiguration("workbench.hover.delay")&&(this._delay=this.configurationService.getValue("workbench.hover.delay"))}))}showHover(e,t){const n=typeof this.overrideOptions=="function"?this.overrideOptions(e,t):this.overrideOptions;this.hoverDisposables.clear();const r=e.target instanceof HTMLElement?[e.target]:e.target.targetElements;for(const o of r)this.hoverDisposables.add(Sr(o,"keydown",s=>{s.equals(9)&&this.hoverService.hideHover()}));return this.hoverService.showHover({...e,persistence:{hideOnHover:!0},...n},t)}onDidHideHover(){this.hoverDisposables.clear(),this.instantHover&&(this.lastHoverHideTime=Date.now())}};EP=Qje([Roe(3,gn),Roe(4,kX)],EP);const ng=yn("contextViewService"),Ol=yn("contextMenuService");const TR=He;let TX=class extends fe{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 Hk(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}};class G4 extends fe{static render(e,t,n){return new G4(e,t,n)}constructor(e,t,n){super(),this.actionContainer=ke(e,TR("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=ke(this.actionContainer,TR("a.action")),this.action.setAttribute("role","button"),t.iconClass&&ke(this.action,TR(`span.icon.${t.iconClass}`));const r=ke(this.action,TR("span"));r.textContent=n?`${t.label} (${n})`:t.label,this._register(ye(this.actionContainer,Ge.CLICK,o=>{o.stopPropagation(),o.preventDefault(),t.run(this.actionContainer)})),this._register(ye(this.actionContainer,Ge.KEY_DOWN,o=>{const s=new Ai(o);(s.equals(3)||s.equals(10))&&(o.stopPropagation(),o.preventDefault(),t.run(this.actionContainer))})),this.setEnabled(!0)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}function y_e(i,e){return i&&e?w("acessibleViewHint","Inspect this in the accessible view with {0}.",e):i?w("acessibleViewHintNoKbOpen","Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}const al=yn("openerService");function Jje(i){let e;const t=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(i.fragment);return t&&(e={startLineNumber:parseInt(t[1]),startColumn:t[2]?parseInt(t[2]):1,endLineNumber:t[4]?parseInt(t[4]):void 0,endColumn:t[4]?t[5]?parseInt(t[5]):1:void 0},i=i.with({fragment:""})),{selection:e,uri:i}}function eKe(i,e={}){const t=NX(e);return t.textContent=i,t}function tKe(i,e={}){const t=NX(e);return w_e(t,iKe(i,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function NX(i){const e=i.inline?"span":"div",t=document.createElement(e);return i.className&&(t.className=i.className),t}class nKe{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 w_e(i,e,t,n){let r;if(e.type===2)r=document.createTextNode(e.content||"");else if(e.type===3)r=document.createElement("b");else if(e.type===4)r=document.createElement("i");else if(e.type===7&&n)r=document.createElement("code");else if(e.type===5&&t){const o=document.createElement("a");t.disposables.add(Sr(o,"click",s=>{t.callback(String(e.index),s)})),r=o}else e.type===8?r=document.createElement("br"):e.type===1&&(r=i);r&&i!==r&&i.appendChild(r),r&&Array.isArray(e.children)&&e.children.forEach(o=>{w_e(r,o,t,n)})}function iKe(i,e){const t={type:1,children:[]};let n=0,r=t;const o=[],s=new nKe(i);for(;!s.eos();){let a=s.next();const l=a==="\\"&&aV(s.peek(),e)!==0;if(l&&(a=s.next()),!l&&rKe(a,e)&&a===s.peek()){s.advance(),r.type===2&&(r=o.pop());const c=aV(a,e);if(r.type===c||r.type===5&&c===6)r=o.pop();else{const u={type:c,children:[]};c===5&&(u.index=n,n++),r.children.push(u),o.push(r),r=u}}else if(a===` +`)r.type===2&&(r=o.pop()),r.children.push({type:8});else if(r.type!==2){const c={type:2,content:a};r.children.push(c),o.push(r),r=c}else r.content+=a}return r.type===2&&(r=o.pop()),t}function rKe(i,e){return aV(i,e)!==0}function aV(i,e){switch(i){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return e?7:0;default:return 0}}const oKe=new RegExp(`(\\\\)?\\$\\((${Wt.iconNameExpression}(?:${Wt.iconModifierExpression})?)\\)`,"g");function Sv(i){const e=new Array;let t,n=0,r=0;for(;(t=oKe.exec(i))!==null;){r=t.index||0,n0)return new Uint32Array(e)}let Gl=0;const Bm=new Uint32Array(10);function aKe(i){if(Gl=0,$h(i,Q6,4352),Gl>0||($h(i,J6,4449),Gl>0)||($h(i,e9,4520),Gl>0)||($h(i,e0,12593),Gl))return Bm.subarray(0,Gl);if(i>=44032&&i<=55203){const e=i-44032,t=e%588,n=Math.floor(e/588),r=Math.floor(t/28),o=t%28-1;if(n=0&&(o0)return Bm.subarray(0,Gl)}}function $h(i,e,t){i>=t&&i>8&&(Bm[Gl++]=i>>8&255),i>>16&&(Bm[Gl++]=i>>16&255))}const Q6=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),J6=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),e9=new Uint16Array([114,82,29810,115,30579,26483,101,102,29286,24934,29030,29798,30822,30310,26470,97,113,29809,116,84,100,119,99,122,120,118,103]),e0=new Uint16Array([114,82,29810,115,30579,26483,101,69,102,29286,24934,29030,29798,30822,30310,26470,97,113,81,29809,116,84,100,119,87,99,122,120,118,103,107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]);function RX(...i){return function(e,t){for(let n=0,r=i.length;n0?[{start:0,end:e.length}]:[]:null}function x_e(i,e){const t=e.toLowerCase().indexOf(i.toLowerCase());return t===-1?null:[{start:t,end:t+i.length}]}function L_e(i,e){return lV(i.toLowerCase(),e.toLowerCase(),0,0)}function lV(i,e,t,n){if(t===i.length)return[];if(n===e.length)return null;if(i[t]===e[n]){let r=null;return(r=lV(i,e,t+1,n+1))?PX({start:n,end:n+1},r):null}return lV(i,e,t,n+1)}function MX(i){return 97<=i&&i<=122}function q4(i){return 65<=i&&i<=90}function AX(i){return 48<=i&&i<=57}function E_e(i){return i===32||i===9||i===10||i===13}const D_e=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(i=>D_e.add(i.charCodeAt(0)));function DP(i){return E_e(i)||D_e.has(i)}function Moe(i,e){return i===e||DP(i)&&DP(e)}const t9=new Map;function Aoe(i){if(t9.has(i))return t9.get(i);let e;const t=sKe(i);return t&&(e=t),t9.set(i,e),e}function I_e(i){return MX(i)||q4(i)||AX(i)}function PX(i,e){return e.length===0?e=[i]:i.end===e[0].start?e[0].start=i.start:e.unshift(i),e}function k_e(i,e){for(let t=e;t0&&!I_e(i.charCodeAt(t-1)))return t}return i.length}function cV(i,e,t,n){if(t===i.length)return[];if(n===e.length)return null;if(i[t]!==e[n].toLowerCase())return null;{let r=null,o=n+1;for(r=cV(i,e,t+1,n+1);!r&&(o=k_e(e,o)).6}function dKe(i){const{upperPercent:e,lowerPercent:t,alphaPercent:n,numericPercent:r}=i;return t>.2&&e<.8&&n>.6&&r<.2}function hKe(i){let e=0,t=0,n=0,r=0;for(let o=0;o60&&(e=e.substring(0,60));const t=cKe(e);if(!dKe(t)){if(!uKe(t))return null;e=e.toLowerCase()}let n=null,r=0;for(i=i.toLowerCase();r0&&DP(i.charCodeAt(t-1)))return t;return i.length}const gKe=RX(iI,T_e,x_e),pKe=RX(iI,T_e,L_e),Poe=new E_(1e4);function Ooe(i,e,t=!1){if(typeof i!="string"||typeof e!="string")return null;let n=Poe.get(i);n||(n=new RegExp(B5e(i),"i"),Poe.set(i,n));const r=n.exec(e);return r?[{start:r.index,end:r.index+r[0].length}]:t?pKe(i,e):gKe(i,e)}function mKe(i,e){const t=Ab(i,i.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return t?qk(t):null}function vKe(i,e,t,n,r,o){const s=Math.min(13,i.length);for(;t"u")return[];const e=[],t=i[1];for(let n=i.length-1;n>1;n--){const r=i[n]+t,o=e[e.length-1];o&&o.end===r?o.end=r+1:e.push({start:r,end:r+1})}return e}const Zm=128;function OX(){const i=[],e=[];for(let t=0;t<=Zm;t++)e[t]=0;for(let t=0;t<=Zm;t++)i.push(e.slice(0));return i}function R_e(i){const e=[];for(let t=0;t<=i;t++)e[t]=0;return e}const M_e=R_e(2*Zm),dV=R_e(2*Zm),vg=OX(),t0=OX(),NR=OX();function RR(i,e){if(e<0||e>=i.length)return!1;const t=i.codePointAt(e);switch(t){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:return!!bq(t)}}function Foe(i,e){if(e<0||e>=i.length)return!1;switch(i.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}function EM(i,e,t){return e[i]!==t[i]}function _Ke(i,e,t,n,r,o,s=!1){for(;eZm?Zm:i.length,l=n.length>Zm?Zm:n.length;if(t>=a||o>=l||a-t>l-o||!_Ke(e,t,a,r,o,l,!0))return;bKe(a,l,t,o,e,r);let c=1,u=1,d=t,h=o;const f=[!1];for(c=1,d=t;d_,T=k?t0[c][u-1]+(vg[c][u-1]>0?-5:0):0,M=h>_+1&&vg[c][u-1]>0,A=M?t0[c][u-2]+(vg[c][u-2]>0?-5:0):0;if(M&&(!k||A>=T)&&(!E||A>=D))t0[c][u]=A,NR[c][u]=3,vg[c][u]=0;else if(k&&(!E||T>=D))t0[c][u]=T,NR[c][u]=2,vg[c][u]=0;else if(E)t0[c][u]=D,NR[c][u]=1,vg[c][u]=vg[c-1][u-1]+1;else throw new Error("not possible")}}if(!f[0]&&!s.firstMatchCanBeWeak)return;c--,u--;const g=[t0[c][u],o];let p=0,v=0;for(;c>=1;){let _=u;do{const y=NR[c][_];if(y===3)_=_-2;else if(y===2)_=_-1;else break}while(_>=1);p>1&&e[t+c-1]===r[o+u-1]&&!EM(_+o-1,n,r)&&p+1>vg[c][_]&&(_=u),_===u?p++:p=1,v||(v=_),c--,u=_-1,g.push(u)}l===a&&s.boostFullMatch&&(g[0]+=2);const m=v-a;return g[0]-=m,g}function bKe(i,e,t,n,r,o){let s=i-1,a=e-1;for(;s>=t&&a>=n;)r[s]===o[a]&&(dV[s]=a,s--),a--}function CKe(i,e,t,n,r,o,s,a,l,c,u){if(e[t]!==o[s])return Number.MIN_SAFE_INTEGER;let d=1,h=!1;return s===t-n?d=i[t]===r[s]?7:5:EM(s,r,o)&&(s===0||!EM(s-1,r,o))?(d=i[t]===r[s]?7:5,h=!0):RR(o,s)&&(s===0||!RR(o,s-1))?d=5:(RR(o,s-1)||Foe(o,s-1))&&(d=5,h=!0),d>1&&t===n&&(u[0]=!0),h||(h=EM(s,r,o)||RR(o,s-1)||Foe(o,s-1)),t===n?s>l&&(d-=h?3:5):c?d+=h?2:0:d+=h?0:1,s+1===a&&(d-=h?3:5),d}function yKe(i,e,t,n,r,o,s){return wKe(i,e,t,n,r,o,!0,s)}function wKe(i,e,t,n,r,o,s,a){let l=Ab(i,e,t,n,r,o,a);if(l&&!s)return l;if(i.length>=3){const c=Math.min(7,i.length-1);for(let u=t+1;ul[0])&&(l=h))}}}return l}function SKe(i,e){if(e+1>=i.length)return;const t=i[e],n=i[e+1];if(t!==n)return i.slice(0,e)+n+t+i.slice(e+2)}const xKe="$(",FX=new RegExp(`\\$\\(${Wt.iconNameExpression}(?:${Wt.iconModifierExpression})?\\)`,"g"),LKe=new RegExp(`(\\\\)?${FX.source}`,"g");function EKe(i){return i.replace(LKe,(e,t)=>t?e:`\\${e}`)}const DKe=new RegExp(`\\\\${FX.source}`,"g");function IKe(i){return i.replace(DKe,e=>`\\${e}`)}const kKe=new RegExp(`(\\s)?(\\\\)?${FX.source}(\\s)?`,"g");function BX(i){return i.indexOf(xKe)===-1?i:i.replace(kKe,(e,t,n,r)=>n?e:t||r||"")}function TKe(i){return i?i.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}const n9=new RegExp(`\\$\\(${Wt.iconNameCharacter}+\\)`,"g");function OL(i){n9.lastIndex=0;let e="";const t=[];let n=0;for(;;){const r=n9.lastIndex,o=n9.exec(i),s=i.substring(r,o==null?void 0:o.index);if(s.length>0){e+=s;for(let a=0;a" ".repeat(r.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===1?`\\ `:` `),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+=` @@ -250,18 +250,18 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `)},le.strong=function(z){return""+z+""},le.em=function(z){return""+z+""},le.codespan=function(z){return""+z+""},le.br=function(){return this.options.xhtml?"
":"
"},le.del=function(z){return""+z+""},le.link=function(z,q,oe){if(z=E(this.options.sanitize,this.options.baseUrl,z),z===null)return oe;var ne='",ne},le.image=function(z,q,oe){if(z=E(this.options.sanitize,this.options.baseUrl,z),z===null)return oe;var ne=''+oe+'":">",ne},le.text=function(z){return z},ie}(),Ve=function(){function ie(){}var le=ie.prototype;return le.strong=function(z){return z},le.em=function(z){return z},le.codespan=function(z){return z},le.del=function(z){return z},le.html=function(z){return z},le.text=function(z){return z},le.link=function(z,q,oe){return""+oe},le.image=function(z,q,oe){return""+oe},le.br=function(){return""},ie}(),Ze=function(){function ie(){this.seen={}}var le=ie.prototype;return le.serialize=function(z){return z.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},le.getNextSafeSlug=function(z,q){var oe=z,ne=0;if(this.seen.hasOwnProperty(oe)){ne=this.seen[z];do ne++,oe=z+"-"+ne;while(this.seen.hasOwnProperty(oe))}return q||(this.seen[z]=ne,this.seen[oe]=0),oe},le.slug=function(z,q){q===void 0&&(q={});var oe=this.serialize(z);return this.getNextSafeSlug(oe,q.dryrun)},ie}(),We=function(){function ie(ce){this.options=ce||e.defaults,this.options.renderer=this.options.renderer||new ve,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ve,this.slugger=new Ze}ie.parse=function(z,q){var oe=new ie(q);return oe.parse(z)},ie.parseInline=function(z,q){var oe=new ie(q);return oe.parseInline(z)};var le=ie.prototype;return le.parse=function(z,q){q===void 0&&(q=!0);var oe="",ne,he,Le,Fe,ze,Ue,nt,it,at,tt,Zt,Tt,xn,rt,wt,Bt,Nt,nn,Mn,zt=z.length;for(ne=0;ne0&&wt.tokens[0].type==="paragraph"?(wt.tokens[0].text=nn+" "+wt.tokens[0].text,wt.tokens[0].tokens&&wt.tokens[0].tokens.length>0&&wt.tokens[0].tokens[0].type==="text"&&(wt.tokens[0].tokens[0].text=nn+" "+wt.tokens[0].tokens[0].text)):wt.tokens.unshift({type:"text",text:nn}):rt+=nn),rt+=this.parse(wt.tokens,xn),at+=this.renderer.listitem(rt,Nt,Bt);oe+=this.renderer.list(at,Zt,Tt);continue}case"html":{oe+=this.renderer.html(tt.text);continue}case"paragraph":{oe+=this.renderer.paragraph(this.parseInline(tt.tokens));continue}case"text":{for(at=tt.tokens?this.parseInline(tt.tokens):tt.text;ne+1"u"||ie===null)throw new Error("marked(): input parameter is undefined or null");if(typeof ie!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(ie)+", string expected");if(typeof le=="function"&&(ce=le,le=null),le=R({},pe.defaults,le||{}),G(le),ce){var z=le.highlight,q;try{q=_e.lex(ie,le)}catch(Fe){return ce(Fe)}var oe=function(ze){var Ue;if(!ze)try{le.walkTokens&&pe.walkTokens(q,le.walkTokens),Ue=We.parse(q,le)}catch(nt){ze=nt}return le.highlight=z,ze?ce(ze):ce(null,Ue)};if(!z||z.length<3||(delete le.highlight,!q.length))return oe();var ne=0;pe.walkTokens(q,function(Fe){Fe.type==="code"&&(ne++,setTimeout(function(){z(Fe.text,Fe.lang,function(ze,Ue){if(ze)return oe(ze);Ue!=null&&Ue!==Fe.text&&(Fe.text=Ue,Fe.escaped=!0),ne--,ne===0&&oe()})},0))}),ne===0&&oe();return}function he(Fe){if(Fe.message+=` Please report this to https://github.com/markedjs/marked.`,le.silent)return"

An error occurred:

"+p(Fe.message+"",!0)+"
";throw Fe}try{var Le=_e.lex(ie,le);if(le.walkTokens){if(le.async)return Promise.all(pe.walkTokens(Le,le.walkTokens)).then(function(){return We.parse(Le,le)}).catch(he);pe.walkTokens(Le,le.walkTokens)}return We.parse(Le,le)}catch(Fe){he(Fe)}}pe.options=pe.setOptions=function(ie){return R(pe.defaults,ie),l(pe.defaults),pe},pe.getDefaults=a,pe.defaults=e.defaults,pe.use=function(){for(var ie=arguments.length,le=new Array(ie),ce=0;ce"u"||ie===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof ie!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(ie)+", string expected");le=R({},pe.defaults,le||{}),G(le);try{var ce=_e.lexInline(ie,le);return le.walkTokens&&pe.walkTokens(ce,le.walkTokens),We.parseInline(ce,le)}catch(z){if(z.message+=` -Please report this to https://github.com/markedjs/marked.`,le.silent)return"

An error occurred:

"+p(z.message+"",!0)+"
";throw z}},pe.Parser=We,pe.parser=We.parse,pe.Renderer=ve,pe.TextRenderer=Ve,pe.Lexer=_e,pe.lexer=_e.lex,pe.Tokenizer=Y,pe.Slugger=Ze,pe.parse=pe;var Pe=pe.options,Se=pe.setOptions,Ne=pe.use,Me=pe.walkTokens,Qe=pe.parseInline,Ke=pe,Re=We.parse,ct=_e.lex;e.Lexer=_e,e.Parser=We,e.Renderer=ve,e.Slugger=Ze,e.TextRenderer=Ve,e.Tokenizer=Y,e.getDefaults=a,e.lexer=ct,e.marked=pe,e.options=Pe,e.parse=Ke,e.parseInline=Qe,e.parser=Re,e.setOptions=Se,e.use=Ne,e.walkTokens=Me,Object.defineProperty(e,"__esModule",{value:!0})})})();Na.Lexer||exports.Lexer;Na.Parser||exports.Parser;Na.Renderer||exports.Renderer;Na.Slugger||exports.Slugger;Na.TextRenderer||exports.TextRenderer;Na.Tokenizer||exports.Tokenizer;Na.getDefaults||exports.getDefaults;Na.lexer||exports.lexer;var gf=Na.marked||exports.marked;Na.options||exports.options;Na.parse||exports.parse;Na.parseInline||exports.parseInline;Na.parser||exports.parser;Na.setOptions||exports.setOptions;Na.use||exports.use;Na.walkTokens||exports.walkTokens;function PKe(i){return JSON.stringify(i,OKe)}function fV(i){let e=JSON.parse(i);return e=gV(e),e}function OKe(i,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function gV(i,e=0){if(!i||e>200)return i;if(typeof i=="object"){switch(i.$mid){case 1:return At.revive(i);case 2:return new RegExp(i.source,i.flags);case 17:return new Date(i.source)}if(i instanceof E4||i instanceof Uint8Array)return i;if(Array.isArray(i))for(let t=0;t{let n=[],r=[];return i&&({href:i,dimensions:n}=AKe(i),r.push(`src="${MR(i)}"`)),t&&r.push(`alt="${MR(t)}"`),e&&r.push(`title="${MR(e)}"`),n.length&&(r=r.concat(n)),""},paragraph:i=>`

${i}

`,link:(i,e,t)=>typeof i!="string"?"":(i===t&&(t=r9(t)),e=typeof e=="string"?MR(r9(e)):"",i=r9(i),i=i.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),`
${t}`)});function Y4(i,e={},t={}){var n,r;const o=new Te;let s=!1;const a=NX(e),l=function(m){let _;try{_=fV(decodeURIComponent(m))}catch{}return _?(_=ope(_,y=>{if(i.uris&&i.uris[y])return At.revive(i.uris[y])}),encodeURIComponent(JSON.stringify(_))):m},c=function(m,_){const y=i.uris&&i.uris[m];let S=At.revive(y);return _?m.startsWith(an.data+":")?m:(S||(S=At.parse(m)),Jpe.uriToBrowserUri(S).toString(!0)):!S||At.parse(m).toString()===S.toString()?m:(S.query&&(S=S.with({query:l(S.query)})),S.toString())},u=new gf.Renderer;u.image=o9.image,u.link=o9.link,u.paragraph=o9.paragraph;const d=[],h=[];if(e.codeBlockRendererSync?u.code=(m,_)=>{const y=hV.nextId(),S=e.codeBlockRendererSync(Boe(_),m);return h.push([y,S]),`
${HA(m)}
`}:e.codeBlockRenderer&&(u.code=(m,_)=>{const y=hV.nextId(),S=e.codeBlockRenderer(Boe(_),m);return d.push(S.then(L=>[y,L])),`
${HA(m)}
`}),e.actionHandler){const m=function(S){let L=S.target;if(!(L.tagName!=="A"&&(L=L.parentElement,!L||L.tagName!=="A")))try{let E=L.dataset.href;E&&(i.baseUri&&(E=s9(At.from(i.baseUri),E)),e.actionHandler.callback(E,S))}catch(E){en(E)}finally{S.preventDefault()}},_=e.actionHandler.disposables.add(new wn(a,"click")),y=e.actionHandler.disposables.add(new wn(a,"auxclick"));e.actionHandler.disposables.add(Je.any(_.event,y.event)(S=>{const L=new Uu(Pt(a),S);!L.leftButton&&!L.middleButton||m(L)})),e.actionHandler.disposables.add(ye(a,"keydown",S=>{const L=new Ai(S);!L.equals(10)&&!L.equals(3)||m(L)}))}i.supportHtml||(t.sanitizer=m=>(i.isTrusted?m.match(/^(]+>)|(<\/\s*span>)$/):void 0)?m:"",t.sanitize=!0,t.silent=!0),t.renderer=u;let f=(n=i.value)!==null&&n!==void 0?n:"";f.length>1e5&&(f=`${f.substr(0,1e5)}…`),i.supportThemeIcons&&(f=IKe(f));let g;if(e.fillInIncompleteTokens){const m={...gf.defaults,...t},_=gf.lexer(f,m),y=UKe(_);g=gf.parser(y,m)}else g=gf.parse(f,t);i.supportThemeIcons&&(g=wv(g).map(_=>typeof _=="string"?_:_.outerHTML).join(""));const v=new DOMParser().parseFromString(pV(i,g),"text/html");if(v.body.querySelectorAll("img").forEach(m=>{const _=m.getAttribute("src");if(_){let y=_;try{i.baseUri&&(y=s9(At.from(i.baseUri),y))}catch{}m.src=c(y,!0)}}),v.body.querySelectorAll("a").forEach(m=>{const _=m.getAttribute("href");if(m.setAttribute("href",""),!_||/^data:|javascript:/i.test(_)||/^command:/i.test(_)&&!i.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(_))m.replaceWith(...m.childNodes);else{let y=c(_,!1);i.baseUri&&(y=s9(At.from(i.baseUri),_)),m.dataset.href=y}}),a.innerHTML=pV(i,v.body.innerHTML),d.length>0)Promise.all(d).then(m=>{var _,y;if(s)return;const S=new Map(m),L=a.querySelectorAll("div[data-code]");for(const E of L){const D=S.get((_=E.dataset.code)!==null&&_!==void 0?_:"");D&&gs(E,D)}(y=e.asyncRenderCallback)===null||y===void 0||y.call(e)});else if(h.length>0){const m=new Map(h),_=a.querySelectorAll("div[data-code]");for(const y of _){const S=m.get((r=y.dataset.code)!==null&&r!==void 0?r:"");S&&gs(y,S)}}if(e.asyncRenderCallback)for(const m of a.getElementsByTagName("img")){const _=o.add(ye(m,"load",()=>{_.dispose(),e.asyncRenderCallback()}))}return{element:a,dispose:()=>{s=!0,o.dispose()}}}function Boe(i){if(!i)return"";const e=i.split(/[\s+|:|,|\{|\?]/,1);return e.length?e[0]:i}function s9(i,e){return/^\w[\w\d+.-]*:/.test(e)?e:i.path.endsWith("/")?Ure(i,e).toString():Ure(z4(i),e).toString()}function pV(i,e){const{config:t,allowedSchemes:n}=BKe(i);sH("uponSanitizeAttribute",(o,s)=>{var a;if(s.attrName==="style"||s.attrName==="class"){if(o.tagName==="SPAN"){if(s.attrName==="style"){s.keepAttr=/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?$/.test(s.attrValue);return}else if(s.attrName==="class"){s.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(s.attrValue);return}}s.keepAttr=!1;return}else if(o.tagName==="INPUT"&&((a=o.attributes.getNamedItem("type"))===null||a===void 0?void 0:a.value)==="checkbox"){if(s.attrName==="type"&&s.attrValue==="checkbox"||s.attrName==="disabled"||s.attrName==="checked"){s.keepAttr=!0;return}s.keepAttr=!1}}),sH("uponSanitizeElement",(o,s)=>{var a,l;s.tagName==="input"&&(((a=o.attributes.getNamedItem("type"))===null||a===void 0?void 0:a.value)==="checkbox"?o.setAttribute("disabled",""):(l=o.parentElement)===null||l===void 0||l.removeChild(o))});const r=u8e(n);try{return Ype(e,{...t,RETURN_TRUSTED_TYPE:!0})}finally{Zpe("uponSanitizeAttribute"),r.dispose()}}const FKe=["align","autoplay","alt","checked","class","controls","data-code","data-href","disabled","draggable","height","href","loop","muted","playsinline","poster","src","style","target","title","type","width","start"];function BKe(i){const e=[an.http,an.https,an.mailto,an.data,an.file,an.vscodeFileResource,an.vscodeRemote,an.vscodeRemoteResource];return i.isTrusted&&e.push(an.command),{config:{ALLOWED_TAGS:[...d8e],ALLOWED_ATTR:FKe,ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:e}}function WKe(i){return typeof i=="string"?i:$Ke(i)}function $Ke(i){var e;let t=(e=i.value)!==null&&e!==void 0?e:"";t.length>1e5&&(t=`${t.substr(0,1e5)}…`);const n=gf.parse(t,{renderer:VKe.value}).replace(/&(#\d+|[a-zA-Z]+);/g,r=>{var o;return(o=HKe.get(r))!==null&&o!==void 0?o:r});return pV({isTrusted:!1},n).toString()}const HKe=new Map([[""",'"'],[" "," "],["&","&"],["'","'"],["<","<"],[">",">"]]),VKe=new Qf(()=>{const i=new gf.Renderer;return i.code=e=>e,i.blockquote=e=>e,i.html=e=>"",i.heading=(e,t,n)=>e+` +Please report this to https://github.com/markedjs/marked.`,le.silent)return"

An error occurred:

"+p(z.message+"",!0)+"
";throw z}},pe.Parser=We,pe.parser=We.parse,pe.Renderer=ve,pe.TextRenderer=Ve,pe.Lexer=_e,pe.lexer=_e.lex,pe.Tokenizer=Y,pe.Slugger=Ze,pe.parse=pe;var Pe=pe.options,Se=pe.setOptions,Ne=pe.use,Me=pe.walkTokens,Qe=pe.parseInline,Ke=pe,Re=We.parse,ct=_e.lex;e.Lexer=_e,e.Parser=We,e.Renderer=ve,e.Slugger=Ze,e.TextRenderer=Ve,e.Tokenizer=Y,e.getDefaults=a,e.lexer=ct,e.marked=pe,e.options=Pe,e.parse=Ke,e.parseInline=Qe,e.parser=Re,e.setOptions=Se,e.use=Ne,e.walkTokens=Me,Object.defineProperty(e,"__esModule",{value:!0})})})();Na.Lexer||exports.Lexer;Na.Parser||exports.Parser;Na.Renderer||exports.Renderer;Na.Slugger||exports.Slugger;Na.TextRenderer||exports.TextRenderer;Na.Tokenizer||exports.Tokenizer;Na.getDefaults||exports.getDefaults;Na.lexer||exports.lexer;var gf=Na.marked||exports.marked;Na.options||exports.options;Na.parse||exports.parse;Na.parseInline||exports.parseInline;Na.parser||exports.parser;Na.setOptions||exports.setOptions;Na.use||exports.use;Na.walkTokens||exports.walkTokens;function PKe(i){return JSON.stringify(i,OKe)}function fV(i){let e=JSON.parse(i);return e=gV(e),e}function OKe(i,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function gV(i,e=0){if(!i||e>200)return i;if(typeof i=="object"){switch(i.$mid){case 1:return At.revive(i);case 2:return new RegExp(i.source,i.flags);case 17:return new Date(i.source)}if(i instanceof E4||i instanceof Uint8Array)return i;if(Array.isArray(i))for(let t=0;t{let n=[],r=[];return i&&({href:i,dimensions:n}=AKe(i),r.push(`src="${MR(i)}"`)),t&&r.push(`alt="${MR(t)}"`),e&&r.push(`title="${MR(e)}"`),n.length&&(r=r.concat(n)),""},paragraph:i=>`

${i}

`,link:(i,e,t)=>typeof i!="string"?"":(i===t&&(t=r9(t)),e=typeof e=="string"?MR(r9(e)):"",i=r9(i),i=i.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),`${t}`)});function Y4(i,e={},t={}){var n,r;const o=new Te;let s=!1;const a=NX(e),l=function(m){let _;try{_=fV(decodeURIComponent(m))}catch{}return _?(_=ope(_,y=>{if(i.uris&&i.uris[y])return At.revive(i.uris[y])}),encodeURIComponent(JSON.stringify(_))):m},c=function(m,_){const y=i.uris&&i.uris[m];let S=At.revive(y);return _?m.startsWith(an.data+":")?m:(S||(S=At.parse(m)),Jpe.uriToBrowserUri(S).toString(!0)):!S||At.parse(m).toString()===S.toString()?m:(S.query&&(S=S.with({query:l(S.query)})),S.toString())},u=new gf.Renderer;u.image=o9.image,u.link=o9.link,u.paragraph=o9.paragraph;const d=[],h=[];if(e.codeBlockRendererSync?u.code=(m,_)=>{const y=hV.nextId(),S=e.codeBlockRendererSync(Boe(_),m);return h.push([y,S]),`
${HA(m)}
`}:e.codeBlockRenderer&&(u.code=(m,_)=>{const y=hV.nextId(),S=e.codeBlockRenderer(Boe(_),m);return d.push(S.then(L=>[y,L])),`
${HA(m)}
`}),e.actionHandler){const m=function(S){let L=S.target;if(!(L.tagName!=="A"&&(L=L.parentElement,!L||L.tagName!=="A")))try{let E=L.dataset.href;E&&(i.baseUri&&(E=s9(At.from(i.baseUri),E)),e.actionHandler.callback(E,S))}catch(E){en(E)}finally{S.preventDefault()}},_=e.actionHandler.disposables.add(new wn(a,"click")),y=e.actionHandler.disposables.add(new wn(a,"auxclick"));e.actionHandler.disposables.add(Je.any(_.event,y.event)(S=>{const L=new Uu(Pt(a),S);!L.leftButton&&!L.middleButton||m(L)})),e.actionHandler.disposables.add(ye(a,"keydown",S=>{const L=new Ai(S);!L.equals(10)&&!L.equals(3)||m(L)}))}i.supportHtml||(t.sanitizer=m=>(i.isTrusted?m.match(/^(]+>)|(<\/\s*span>)$/):void 0)?m:"",t.sanitize=!0,t.silent=!0),t.renderer=u;let f=(n=i.value)!==null&&n!==void 0?n:"";f.length>1e5&&(f=`${f.substr(0,1e5)}…`),i.supportThemeIcons&&(f=IKe(f));let g;if(e.fillInIncompleteTokens){const m={...gf.defaults,...t},_=gf.lexer(f,m),y=UKe(_);g=gf.parser(y,m)}else g=gf.parse(f,t);i.supportThemeIcons&&(g=Sv(g).map(_=>typeof _=="string"?_:_.outerHTML).join(""));const v=new DOMParser().parseFromString(pV(i,g),"text/html");if(v.body.querySelectorAll("img").forEach(m=>{const _=m.getAttribute("src");if(_){let y=_;try{i.baseUri&&(y=s9(At.from(i.baseUri),y))}catch{}m.src=c(y,!0)}}),v.body.querySelectorAll("a").forEach(m=>{const _=m.getAttribute("href");if(m.setAttribute("href",""),!_||/^data:|javascript:/i.test(_)||/^command:/i.test(_)&&!i.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(_))m.replaceWith(...m.childNodes);else{let y=c(_,!1);i.baseUri&&(y=s9(At.from(i.baseUri),_)),m.dataset.href=y}}),a.innerHTML=pV(i,v.body.innerHTML),d.length>0)Promise.all(d).then(m=>{var _,y;if(s)return;const S=new Map(m),L=a.querySelectorAll("div[data-code]");for(const E of L){const D=S.get((_=E.dataset.code)!==null&&_!==void 0?_:"");D&&gs(E,D)}(y=e.asyncRenderCallback)===null||y===void 0||y.call(e)});else if(h.length>0){const m=new Map(h),_=a.querySelectorAll("div[data-code]");for(const y of _){const S=m.get((r=y.dataset.code)!==null&&r!==void 0?r:"");S&&gs(y,S)}}if(e.asyncRenderCallback)for(const m of a.getElementsByTagName("img")){const _=o.add(ye(m,"load",()=>{_.dispose(),e.asyncRenderCallback()}))}return{element:a,dispose:()=>{s=!0,o.dispose()}}}function Boe(i){if(!i)return"";const e=i.split(/[\s+|:|,|\{|\?]/,1);return e.length?e[0]:i}function s9(i,e){return/^\w[\w\d+.-]*:/.test(e)?e:i.path.endsWith("/")?Ure(i,e).toString():Ure(z4(i),e).toString()}function pV(i,e){const{config:t,allowedSchemes:n}=BKe(i);sH("uponSanitizeAttribute",(o,s)=>{var a;if(s.attrName==="style"||s.attrName==="class"){if(o.tagName==="SPAN"){if(s.attrName==="style"){s.keepAttr=/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?$/.test(s.attrValue);return}else if(s.attrName==="class"){s.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(s.attrValue);return}}s.keepAttr=!1;return}else if(o.tagName==="INPUT"&&((a=o.attributes.getNamedItem("type"))===null||a===void 0?void 0:a.value)==="checkbox"){if(s.attrName==="type"&&s.attrValue==="checkbox"||s.attrName==="disabled"||s.attrName==="checked"){s.keepAttr=!0;return}s.keepAttr=!1}}),sH("uponSanitizeElement",(o,s)=>{var a,l;s.tagName==="input"&&(((a=o.attributes.getNamedItem("type"))===null||a===void 0?void 0:a.value)==="checkbox"?o.setAttribute("disabled",""):(l=o.parentElement)===null||l===void 0||l.removeChild(o))});const r=u8e(n);try{return Ype(e,{...t,RETURN_TRUSTED_TYPE:!0})}finally{Zpe("uponSanitizeAttribute"),r.dispose()}}const FKe=["align","autoplay","alt","checked","class","controls","data-code","data-href","disabled","draggable","height","href","loop","muted","playsinline","poster","src","style","target","title","type","width","start"];function BKe(i){const e=[an.http,an.https,an.mailto,an.data,an.file,an.vscodeFileResource,an.vscodeRemote,an.vscodeRemoteResource];return i.isTrusted&&e.push(an.command),{config:{ALLOWED_TAGS:[...d8e],ALLOWED_ATTR:FKe,ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:e}}function WKe(i){return typeof i=="string"?i:$Ke(i)}function $Ke(i){var e;let t=(e=i.value)!==null&&e!==void 0?e:"";t.length>1e5&&(t=`${t.substr(0,1e5)}…`);const n=gf.parse(t,{renderer:VKe.value}).replace(/&(#\d+|[a-zA-Z]+);/g,r=>{var o;return(o=HKe.get(r))!==null&&o!==void 0?o:r});return pV({isTrusted:!1},n).toString()}const HKe=new Map([[""",'"'],[" "," "],["&","&"],["'","'"],["<","<"],[">",">"]]),VKe=new Qf(()=>{const i=new gf.Renderer;return i.code=e=>e,i.blockquote=e=>e,i.html=e=>"",i.heading=(e,t,n)=>e+` `,i.hr=()=>"",i.list=(e,t)=>e,i.listitem=e=>e+` `,i.paragraph=e=>e+` `,i.table=(e,t)=>e+t+` `,i.tablerow=e=>e,i.tablecell=(e,t)=>e+" ",i.strong=e=>e,i.em=e=>e,i.codespan=e=>e,i.br=()=>` `,i.del=e=>e,i.image=(e,t,n)=>"",i.text=e=>e,i.link=(e,t,n)=>n,i});function $X(i){let e="";return i.forEach(t=>{e+=t.raw}),e}function zKe(i){var e,t;for(let n=0;nWoe(a.raw)))return YKe(i)}}}}function Woe(i){return!!i.match(/^[^\[]*\]\([^\)]*$/)}function UKe(i){let e,t;for(e=0;e"u"&&s.match(/^\s*\|/)){const a=s.match(/(\|[^\|]+)(?=\||$)/g);a&&(n=a.length)}else if(typeof n=="number")if(s.match(/^\s*\|/)){if(o!==t.length-1)return;r=!0}else return}if(typeof n=="number"&&n>0){const o=r?t.slice(0,-1).join(` `):e,s=!!o.match(/\|\s*$/),a=o+(s?"":"|")+` -|${" --- |".repeat(n)}`;return gf.lexer(a)}}var eGe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Hoe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},mV;let Uf=mV=class{constructor(e,t,n){this._options=e,this._languageService=t,this._openerService=n,this._onDidRenderAsync=new se,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,n){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const r=new Te,o=r.add(Y4(e,{...this._getRenderOptions(e,r),...t},n));return o.element.classList.add("rendered-markdown"),{element:o.element,dispose:()=>r.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:async(n,r)=>{var o,s,a;let l;n?l=this._languageService.getLanguageIdByLanguageName(n):this._options.editor&&(l=(o=this._options.editor.getModel())===null||o===void 0?void 0:o.getLanguageId()),l||(l=hc);const c=await jUe(this._languageService,r,l),u=document.createElement("span");if(u.innerHTML=(a=(s=mV._ttpTokenizer)===null||s===void 0?void 0:s.createHTML(c))!==null&&a!==void 0?a:c,this._options.editor){const d=this._options.editor.getOption(50);ps(u,d)}else this._options.codeBlockFontFamily&&(u.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(u.style.fontSize=this._options.codeBlockFontSize),u},asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:n=>HX(this._openerService,n,e.isTrusted),disposables:t}}}};Uf._ttpTokenizer=Hp("tokenizeToString",{createHTML(i){return i}});Uf=mV=eGe([Hoe(1,ji),Hoe(2,al)],Uf);async function HX(i,e,t){try{return await i.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:tGe(t)})}catch(n){return en(n),!1}}function tGe(i){return i===!0?!0:i&&Array.isArray(i.enabledCommands)?i.enabledCommands:!1}var nGe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Vx=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Hh=He;let vV=class extends yc{get _targetWindow(){return Pt(this._target.targetElements[0])}get _targetDocumentElement(){return Pt(this._target.targetElements[0]).document.documentElement}get isDisposed(){return this._isDisposed}get isMouseIn(){return this._lockMouseTracker.isMouseIn}get domNode(){return this._hover.containerDomNode}get onDispose(){return this._onDispose.event}get onRequestLayout(){return this._onRequestLayout.event}get anchor(){return this._hoverPosition===2?0:1}get x(){return this._x}get y(){return this._y}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked!==e&&(this._isLocked=e,this._hoverContainer.classList.toggle("locked",this._isLocked))}constructor(e,t,n,r,o,s){var a,l,c,u,d,h,f,g;super(),this._keybindingService=t,this._configurationService=n,this._openerService=r,this._instantiationService=o,this._accessibilityService=s,this._messageListeners=new Te,this._isDisposed=!1,this._forcePosition=!1,this._x=0,this._y=0,this._isLocked=!1,this._enableFocusTraps=!1,this._addedFocusTrap=!1,this._onDispose=this._register(new se),this._onRequestLayout=this._register(new se),this._linkHandler=e.linkHandler||(S=>HX(this._openerService,S,Mf(e.content)?e.content.isTrusted:void 0)),this._target="targetElements"in e.target?e.target:new iGe(e.target),this._hoverPointer=!((a=e.appearance)===null||a===void 0)&&a.showPointer?Hh("div.workbench-hover-pointer"):void 0,this._hover=this._register(new TX),this._hover.containerDomNode.classList.add("workbench-hover","fadeIn"),!((l=e.appearance)===null||l===void 0)&&l.compact&&this._hover.containerDomNode.classList.add("workbench-hover","compact"),!((c=e.appearance)===null||c===void 0)&&c.skipFadeInAnimation&&this._hover.containerDomNode.classList.add("skip-fade-in"),e.additionalClasses&&this._hover.containerDomNode.classList.add(...e.additionalClasses),!((u=e.position)===null||u===void 0)&&u.forcePosition&&(this._forcePosition=!0),e.trapFocus&&(this._enableFocusTraps=!0),this._hoverPosition=(h=(d=e.position)===null||d===void 0?void 0:d.hoverPosition)!==null&&h!==void 0?h:3,this.onmousedown(this._hover.containerDomNode,S=>S.stopPropagation()),this.onkeydown(this._hover.containerDomNode,S=>{S.equals(9)&&this.dispose()}),this._register(ye(this._targetWindow,"blur",()=>this.dispose()));const p=Hh("div.hover-row.markdown-hover"),v=Hh("div.hover-contents");if(typeof e.content=="string")v.textContent=e.content,v.style.whiteSpace="pre-wrap";else if(e.content instanceof HTMLElement)v.appendChild(e.content),v.classList.add("html-hover-contents");else{const S=e.content,L=this._instantiationService.createInstance(Uf,{codeBlockFontFamily:this._configurationService.getValue("editor").fontFamily||Qa.fontFamily}),{element:E}=L.render(S,{actionHandler:{callback:D=>this._linkHandler(D),disposables:this._messageListeners},asyncRenderCallback:()=>{v.classList.add("code-hover-contents"),this.layout(),this._onRequestLayout.fire()}});v.appendChild(E)}if(p.appendChild(v),this._hover.contentsDomNode.appendChild(p),e.actions&&e.actions.length>0){const S=Hh("div.hover-row.status-bar"),L=Hh("div.actions");e.actions.forEach(E=>{const D=this._keybindingService.lookupKeybinding(E.commandId),k=D?D.getLabel():null;G4.render(L,{label:E.label,commandId:E.commandId,run:T=>{E.run(T),this.dispose()},iconClass:E.iconClass},k)}),S.appendChild(L),this._hover.containerDomNode.appendChild(S)}this._hoverContainer=Hh("div.workbench-hover-container"),this._hoverPointer&&this._hoverContainer.appendChild(this._hoverPointer),this._hoverContainer.appendChild(this._hover.containerDomNode);let m;if(e.actions&&e.actions.length>0?m=!1:((f=e.persistence)===null||f===void 0?void 0:f.hideOnHover)===void 0?m=typeof e.content=="string"||Mf(e.content)&&!e.content.value.includes("](")&&!e.content.value.includes(""):m=e.persistence.hideOnHover,m&&(!((g=e.appearance)===null||g===void 0)&&g.showHoverHint)){const S=Hh("div.hover-row.status-bar"),L=Hh("div.info");L.textContent=w("hoverhint","Hold {0} key to mouse over",Ln?"Option":"Alt"),S.appendChild(L),this._hover.containerDomNode.appendChild(S)}const _=[...this._target.targetElements];m||_.push(this._hoverContainer);const y=this._register(new Voe(_));if(this._register(y.onMouseOut(()=>{this._isLocked||this.dispose()})),m){const S=[...this._target.targetElements,this._hoverContainer];this._lockMouseTracker=this._register(new Voe(S)),this._register(this._lockMouseTracker.onMouseOut(()=>{this._isLocked||this.dispose()}))}else this._lockMouseTracker=y}addFocusTrap(){if(!this._enableFocusTraps||this._addedFocusTrap)return;this._addedFocusTrap=!0;const e=this._hover.containerDomNode,t=this.findLastFocusableChild(this._hover.containerDomNode);if(t){const n=Tq(this._hoverContainer,Hh("div")),r=ke(this._hoverContainer,Hh("div"));n.tabIndex=0,r.tabIndex=0,this._register(ye(r,"focus",o=>{e.focus(),o.preventDefault()})),this._register(ye(n,"focus",o=>{t.focus(),o.preventDefault()}))}}findLastFocusableChild(e){if(e.hasChildNodes())for(let t=0;t=0)return o}const r=this.findLastFocusableChild(n);if(r)return r}}render(e){var t;e.appendChild(this._hoverContainer);const r=this._hoverContainer.contains(this._hoverContainer.ownerDocument.activeElement)&&y_e(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(t=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||t===void 0?void 0:t.getAriaLabel());r&&Hf(r),this.layout(),this.addFocusTrap()}layout(){this._hover.containerDomNode.classList.remove("right-aligned"),this._hover.contentsDomNode.style.maxHeight="";const e=u=>{const d=ime(u),h=u.getBoundingClientRect();return{top:h.top*d,bottom:h.bottom*d,right:h.right*d,left:h.left*d}},t=this._target.targetElements.map(u=>e(u)),n=Math.min(...t.map(u=>u.top)),r=Math.max(...t.map(u=>u.right)),o=Math.max(...t.map(u=>u.bottom)),s=Math.min(...t.map(u=>u.left)),a=r-s,l=o-n,c={top:n,right:r,bottom:o,left:s,width:a,height:l,center:{x:s+a/2,y:n+l/2}};if(this.adjustHorizontalHoverPosition(c),this.adjustVerticalHoverPosition(c),this.adjustHoverMaxHeight(c),this._hoverContainer.style.padding="",this._hoverContainer.style.margin="",this._hoverPointer){switch(this._hoverPosition){case 1:c.left+=3,c.right+=3,this._hoverContainer.style.paddingLeft="3px",this._hoverContainer.style.marginLeft="-3px";break;case 0:c.left-=3,c.right-=3,this._hoverContainer.style.paddingRight="3px",this._hoverContainer.style.marginRight="-3px";break;case 2:c.top+=3,c.bottom+=3,this._hoverContainer.style.paddingTop="3px",this._hoverContainer.style.marginTop="-3px";break;case 3:c.top-=3,c.bottom-=3,this._hoverContainer.style.paddingBottom="3px",this._hoverContainer.style.marginBottom="-3px";break}c.center.x=c.left+a/2,c.center.y=c.top+l/2}this.computeXCordinate(c),this.computeYCordinate(c),this._hoverPointer&&(this._hoverPointer.classList.remove("top"),this._hoverPointer.classList.remove("left"),this._hoverPointer.classList.remove("right"),this._hoverPointer.classList.remove("bottom"),this.setHoverPointerPosition(c)),this._hover.onContentsChanged()}computeXCordinate(e){const t=this._hover.containerDomNode.clientWidth+2;this._target.x!==void 0?this._x=this._target.x:this._hoverPosition===1?this._x=e.right:this._hoverPosition===0?this._x=e.left-t:(this._hoverPointer?this._x=e.center.x-this._hover.containerDomNode.clientWidth/2:this._x=e.left,this._x+t>=this._targetDocumentElement.clientWidth&&(this._hover.containerDomNode.classList.add("right-aligned"),this._x=Math.max(this._targetDocumentElement.clientWidth-t-2,this._targetDocumentElement.clientLeft))),this._xthis._targetWindow.innerHeight&&(this._y=e.bottom)}adjustHorizontalHoverPosition(e){if(this._target.x===void 0){if(this._forcePosition){const t=(this._hoverPointer?3:0)+2;this._hoverPosition===1?this._hover.containerDomNode.style.maxWidth=`${this._targetDocumentElement.clientWidth-e.right-t}px`:this._hoverPosition===0&&(this._hover.containerDomNode.style.maxWidth=`${e.left-t}px`);return}this._hoverPosition===1?this._targetDocumentElement.clientWidth-e.right=this._hover.containerDomNode.clientWidth?this._hoverPosition=0:this._hoverPosition=2):this._hoverPosition===0&&(e.left=this._hover.containerDomNode.clientWidth?this._hoverPosition=1:this._hoverPosition=2),e.left-this._hover.containerDomNode.clientWidth<=this._targetDocumentElement.clientLeft&&(this._hoverPosition=1))}}adjustVerticalHoverPosition(e){this._target.y!==void 0||this._forcePosition||(this._hoverPosition===3?e.top-this._hover.containerDomNode.clientHeight<0&&(this._hoverPosition=2):this._hoverPosition===2&&e.bottom+this._hover.containerDomNode.clientHeight>this._targetWindow.innerHeight&&(this._hoverPosition=3))}adjustHoverMaxHeight(e){let t=this._targetWindow.innerHeight/2;if(this._forcePosition){const n=(this._hoverPointer?3:0)+2;this._hoverPosition===3?t=Math.min(t,e.top-n):this._hoverPosition===2&&(t=Math.min(t,this._targetWindow.innerHeight-e.bottom-n))}if(this._hover.containerDomNode.style.maxHeight=`${t}px`,this._hover.contentsDomNode.clientHeighte.height?this._hoverPointer.style.top=`${e.center.y-(this._y-t)-3}px`:this._hoverPointer.style.top=`${Math.round(t/2)-3}px`;break}case 3:case 2:{this._hoverPointer.classList.add(this._hoverPosition===3?"bottom":"top");const t=this._hover.containerDomNode.clientWidth;let n=Math.round(t/2)-3;const r=this._x+n;(re.right)&&(n=e.center.x-this._x-3),this._hoverPointer.style.left=`${n}px`;break}}}focus(){this._hover.containerDomNode.focus()}dispose(){this._isDisposed||(this._onDispose.fire(),this._hoverContainer.remove(),this._messageListeners.dispose(),this._target.dispose(),super.dispose()),this._isDisposed=!0}};vV=nGe([Vx(1,ci),Vx(2,gn),Vx(3,al),Vx(4,Ot),Vx(5,ud)],vV);class Voe extends yc{get onMouseOut(){return this._onMouseOut.event}get isMouseIn(){return this._isMouseIn}constructor(e){super(),this._elements=e,this._isMouseIn=!0,this._onMouseOut=this._register(new se),this._elements.forEach(t=>this.onmouseover(t,()=>this._onTargetMouseOver(t))),this._elements.forEach(t=>this.onmouseleave(t,()=>this._onTargetMouseLeave(t)))}_onTargetMouseOver(e){this._isMouseIn=!0,this._clearEvaluateMouseStateTimeout(e)}_onTargetMouseLeave(e){this._isMouseIn=!1,this._evaluateMouseState(e)}_evaluateMouseState(e){this._clearEvaluateMouseStateTimeout(e),this._mouseTimeout=Pt(e).setTimeout(()=>this._fireIfMouseOutside(),0)}_clearEvaluateMouseStateTimeout(e){this._mouseTimeout&&(Pt(e).clearTimeout(this._mouseTimeout),this._mouseTimeout=void 0)}_fireIfMouseOutside(){this._isMouseIn||this._onMouseOut.fire()}}class iGe{constructor(e){this._element=e,this.targetElements=[this._element]}dispose(){}}var rGe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},e1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let _V=class{constructor(e,t,n,r,o,s){this._instantiationService=e,this._contextViewService=t,this._keybindingService=r,this._layoutService=o,this._accessibilityService=s,n.onDidShowContextMenu(()=>this.hideHover())}showHover(e,t,n){var r,o,s,a;if(zoe(this._currentHoverOptions)===zoe(e)||this._currentHover&&(!((o=(r=this._currentHoverOptions)===null||r===void 0?void 0:r.persistence)===null||o===void 0)&&o.sticky))return;this._currentHoverOptions=e,this._lastHoverOptions=e;const l=e.trapFocus||this._accessibilityService.isScreenReaderOptimized(),c=fs();n||(l&&c?this._lastFocusedElementBeforeOpen=c:this._lastFocusedElementBeforeOpen=void 0);const u=new Te,d=this._instantiationService.createInstance(vV,e);if(!((s=e.persistence)===null||s===void 0)&&s.sticky&&(d.isLocked=!0),d.onDispose(()=>{var f,g;((f=this._currentHover)===null||f===void 0?void 0:f.domNode)&&ome(this._currentHover.domNode)&&((g=this._lastFocusedElementBeforeOpen)===null||g===void 0||g.focus()),this._currentHoverOptions===e&&(this._currentHoverOptions=void 0),u.dispose()}),!e.container){const f=e.target instanceof HTMLElement?e.target:e.target.targetElements[0];e.container=this._layoutService.getContainer(Pt(f))}const h=this._contextViewService;if(h.showContextView(new oGe(d,t),e.container),d.onRequestLayout(()=>h.layout()),!((a=e.persistence)===null||a===void 0)&&a.sticky)u.add(ye(Pt(e.container).document,Ge.MOUSE_DOWN,f=>{es(f.target,d.domNode)||this.doHideHover()}));else{if("targetElements"in e.target)for(const g of e.target.targetElements)u.add(ye(g,Ge.CLICK,()=>this.hideHover()));else u.add(ye(e.target,Ge.CLICK,()=>this.hideHover()));const f=fs();if(f){const g=Pt(f).document;u.add(ye(f,Ge.KEY_DOWN,p=>{var v;return this._keyDown(p,d,!!(!((v=e.persistence)===null||v===void 0)&&v.hideOnKeyDown))})),u.add(ye(g,Ge.KEY_DOWN,p=>{var v;return this._keyDown(p,d,!!(!((v=e.persistence)===null||v===void 0)&&v.hideOnKeyDown))})),u.add(ye(f,Ge.KEY_UP,p=>this._keyUp(p,d))),u.add(ye(g,Ge.KEY_UP,p=>this._keyUp(p,d)))}}if("IntersectionObserver"in hi){const f=new IntersectionObserver(p=>this._intersectionChange(p,d),{threshold:0}),g="targetElements"in e.target?e.target.targetElements[0]:e.target;f.observe(g),u.add(Rt(()=>f.disconnect()))}return this._currentHover=d,d}hideHover(){var e;!((e=this._currentHover)===null||e===void 0)&&e.isLocked||!this._currentHoverOptions||this.doHideHover()}doHideHover(){this._currentHover=void 0,this._currentHoverOptions=void 0,this._contextViewService.hideContextView()}_intersectionChange(e,t){e[e.length-1].isIntersecting||t.dispose()}_keyDown(e,t,n){var r,o;if(e.key==="Alt"){t.isLocked=!0;return}const s=new Ai(e);this._keybindingService.resolveKeyboardEvent(s).getSingleModifierDispatchChords().some(l=>!!l)||this._keybindingService.softDispatch(s,s.target).kind!==0||n&&(!(!((r=this._currentHoverOptions)===null||r===void 0)&&r.trapFocus)||e.key!=="Tab")&&(this.hideHover(),(o=this._lastFocusedElementBeforeOpen)===null||o===void 0||o.focus())}_keyUp(e,t){var n;e.key==="Alt"&&(t.isLocked=!1,t.isMouseIn||(this.hideHover(),(n=this._lastFocusedElementBeforeOpen)===null||n===void 0||n.focus()))}};_V=rGe([e1(0,Ot),e1(1,ng),e1(2,Ol),e1(3,ci),e1(4,pC),e1(5,ud)],_V);function zoe(i){var e;if(i!==void 0)return(e=i==null?void 0:i.id)!==null&&e!==void 0?e:i}class oGe{get anchorPosition(){return this._hover.anchor}constructor(e,t=!1){this._hover=e,this._focus=t}render(e){return this._hover.render(e),this._focus&&this._hover.focus(),this._hover}getAnchor(){return{x:this._hover.x,y:this._hover.y}}layout(){this._hover.layout()}}In(kX,_V,1);fu((i,e)=>{const t=i.getColor(rve);t&&(e.addRule(`.monaco-workbench .workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-workbench .workbench-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`))});const Xk=yn("IWorkspaceEditService");class VX{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(Sv.is(t))return Sv.lift(t);if(Gy.is(t))return Gy.lift(t);throw new Error("Unsupported edit")})}}class Sv extends VX{static is(e){return e instanceof Sv?!0:va(e)&&At.isUri(e.resource)&&va(e.textEdit)}static lift(e){return e instanceof Sv?e:new Sv(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,n=void 0,r){super(r),this.resource=e,this.textEdit=t,this.versionId=n}}class Gy extends VX{static is(e){return e instanceof Gy?!0:va(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof Gy?e:new Gy(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,n={},r){super(r),this.oldResource=e,this.newResource=t,this.options=n}}const Vs={enableSplitViewResizing:!0,splitViewDefaultRatio:.5,renderSideBySide:!0,renderMarginRevertIcon:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0},Z4=Object.freeze({id:"editor",order:5,type:"object",title:w("editorConfigurationTitle","Editor"),scope:5}),IP={...Z4,properties:{"editor.tabSize":{type:"number",default:Ds.tabSize,minimum:1,markdownDescription:w("tabSize","The number of spaces a tab is equal to. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.indentSize":{anyOf:[{type:"string",enum:["tabSize"]},{type:"number",minimum:1}],default:"tabSize",markdownDescription:w("indentSize",'The number of spaces used for indentation or `"tabSize"` to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.')},"editor.insertSpaces":{type:"boolean",default:Ds.insertSpaces,markdownDescription:w("insertSpaces","Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.detectIndentation":{type:"boolean",default:Ds.detectIndentation,markdownDescription:w("detectIndentation","Controls whether {0} and {1} will be automatically detected when a file is opened based on the file contents.","`#editor.tabSize#`","`#editor.insertSpaces#`")},"editor.trimAutoWhitespace":{type:"boolean",default:Ds.trimAutoWhitespace,description:w("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:Ds.largeFileOptimizations,description:w("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{enum:["off","currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[w("wordBasedSuggestions.off","Turn off Word Based Suggestions."),w("wordBasedSuggestions.currentDocument","Only suggest words from the active document."),w("wordBasedSuggestions.matchingDocuments","Suggest words from all open documents of the same language."),w("wordBasedSuggestions.allDocuments","Suggest words from all open documents.")],description:w("wordBasedSuggestions","Controls whether completions should be computed based on words in the document and from which documents they are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[w("semanticHighlighting.true","Semantic highlighting enabled for all color themes."),w("semanticHighlighting.false","Semantic highlighting disabled for all color themes."),w("semanticHighlighting.configuredByTheme","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:w("semanticHighlighting.enabled","Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:w("stablePeek","Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:w("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!1,description:w("editor.experimental.asyncTokenization","Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:w("editor.experimental.asyncTokenizationLogging","Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:w("editor.experimental.asyncTokenizationVerification","Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."),tags:["experimental"]},"editor.language.brackets":{type:["array","null"],default:null,description:w("schema.brackets","Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:w("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:w("schema.closeBracket","The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:w("schema.colorizedBracketPairs","Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:w("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:w("schema.closeBracket","The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:Vs.maxComputationTime,description:w("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:Vs.maxFileSize,description:w("maxFileSize","Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:Vs.renderSideBySide,description:w("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:Vs.renderSideBySideInlineBreakpoint,description:w("renderSideBySideInlineBreakpoint","If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:Vs.useInlineViewWhenSpaceIsLimited,description:w("useInlineViewWhenSpaceIsLimited","If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:Vs.renderMarginRevertIcon,description:w("renderMarginRevertIcon","When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:Vs.ignoreTrimWhitespace,description:w("ignoreTrimWhitespace","When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:Vs.renderIndicators,description:w("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:Vs.diffCodeLens,description:w("codeLens","Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:Vs.diffWordWrap,markdownEnumDescriptions:[w("wordWrap.off","Lines will never wrap."),w("wordWrap.on","Lines will wrap at the viewport width."),w("wordWrap.inherit","Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:Vs.diffAlgorithm,markdownEnumDescriptions:[w("diffAlgorithm.legacy","Uses the legacy diffing algorithm."),w("diffAlgorithm.advanced","Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:Vs.hideUnchangedRegions.enabled,markdownDescription:w("hideUnchangedRegions.enabled","Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:Vs.hideUnchangedRegions.revealLineCount,markdownDescription:w("hideUnchangedRegions.revealLineCount","Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:Vs.hideUnchangedRegions.minimumLineCount,markdownDescription:w("hideUnchangedRegions.minimumLineCount","Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:Vs.hideUnchangedRegions.contextLineCount,markdownDescription:w("hideUnchangedRegions.contextLineCount","Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:Vs.experimental.showMoves,markdownDescription:w("showMoves","Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:Vs.experimental.showEmptyDecorations,description:w("showEmptyDecorations","Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")}}};function sGe(i){return typeof i.type<"u"||typeof i.anyOf<"u"}for(const i of J1){const e=i.schema;if(typeof e<"u")if(sGe(e))IP.properties[`editor.${i.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(IP.properties[t]=e[t])}let AR=null;function A_e(){return AR===null&&(AR=Object.create(null),Object.keys(IP.properties).forEach(i=>{AR[i]=!0})),AR}function aGe(i){return A_e()[`editor.${i}`]||!1}function lGe(i){return A_e()[`diffEditor.${i}`]||!1}const cGe=ar.as(xh.Configuration);cGe.registerConfiguration(IP);class Xi{static insert(e,t){return{range:new B(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}}function PR(i){return Object.isFrozen(i)?i:H4e(i)}class ls{constructor(e={},t=[],n=[],r){this._contents=e,this._keys=t,this._overrides=n,this.raw=r,this.overrideConfigurations=new Map}get rawConfiguration(){var e;if(!this._rawConfiguration)if(!((e=this.raw)===null||e===void 0)&&e.length){const t=this.raw.map(n=>{if(n instanceof ls)return n;const r=new uGe("");return r.parseRaw(n),r.configurationModel});this._rawConfiguration=t.reduce((n,r)=>r===n?r:n.merge(r),t[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(e){return e?_ie(this.contents,e):this.contents}inspect(e,t){const n=this;return{get value(){return PR(n.rawConfiguration.getValue(e))},get override(){return t?PR(n.rawConfiguration.getOverrideValue(e,t)):void 0},get merged(){return PR(t?n.rawConfiguration.override(t).getValue(e):n.rawConfiguration.getValue(e))},get overrides(){const r=[];for(const{contents:o,identifiers:s,keys:a}of n.rawConfiguration.overrides){const l=new ls(o,a).getValue(e);l!==void 0&&r.push({identifiers:s,value:l})}return r.length?PR(r):void 0}}}getOverrideValue(e,t){const n=this.getContentsForOverrideIdentifer(t);return n?e?_ie(n,e):n:void 0}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){var t,n;const r=Mg(this.contents),o=Mg(this.overrides),s=[...this.keys],a=!((t=this.raw)===null||t===void 0)&&t.length?[...this.raw]:[this];for(const l of e)if(a.push(...!((n=l.raw)===null||n===void 0)&&n.length?l.raw:[l]),!l.isEmpty()){this.mergeContents(r,l.contents);for(const c of l.overrides){const[u]=o.filter(d=>or(d.identifiers,c.identifiers));u?(this.mergeContents(u.contents,c.contents),u.keys.push(...c.keys),u.keys=Lp(u.keys)):o.push(Mg(c))}for(const c of l.keys)s.indexOf(c)===-1&&s.push(c)}return new ls(r,s,o,a.every(l=>l instanceof ls)?void 0:a)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||typeof t!="object"||!Object.keys(t).length)return this;const n={};for(const r of Lp([...Object.keys(this.contents),...Object.keys(t)])){let o=this.contents[r];const s=t[r];s&&(typeof o=="object"&&typeof s=="object"?(o=Mg(o),this.mergeContents(o,s)):o=s),n[r]=o}return new ls(n,this.keys,this.overrides)}mergeContents(e,t){for(const n of Object.keys(t)){if(n in e&&va(e[n])&&va(t[n])){this.mergeContents(e[n],t[n]);continue}e[n]=Mg(t[n])}}getContentsForOverrideIdentifer(e){let t=null,n=null;const r=o=>{o&&(n?this.mergeContents(n,o):n=Mg(o))};for(const o of this.overrides)o.identifiers.length===1&&o.identifiers[0]===e?t=o.contents:o.identifiers.includes(e)&&r(o.contents);return r(t),n}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}addValue(e,t){this.updateValue(e,t,!0)}setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){const t=this.keys.indexOf(e);t!==-1&&(this.keys.splice(t,1),C6e(this.contents,e),qv.test(e)&&this.overrides.splice(this.overrides.findIndex(n=>or(n.identifiers,ZA(e))),1))}updateValue(e,t,n){kme(this.contents,e,t,r=>console.error(r)),n=n||this.keys.indexOf(e)===-1,n&&this.keys.push(e),qv.test(e)&&this.overrides.push({identifiers:ZA(e),keys:Object.keys(this.contents[e]),contents:gH(this.contents[e],r=>console.error(r))})}}class uGe{constructor(e){this._name=e,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||new ls}parseRaw(e,t){this._raw=e;const{contents:n,keys:r,overrides:o,restricted:s,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new ls(n,r,o,a?[e]:void 0),this._restrictedConfigurations=s||[]}doParseRaw(e,t){const n=ar.as(xh.Configuration).getConfigurationProperties(),r=this.filter(e,n,!0,t);e=r.raw;const o=gH(e,l=>console.error(`Conflict in settings file ${this._name}: ${l}`)),s=Object.keys(e),a=this.toOverrides(e,l=>console.error(`Conflict in settings file ${this._name}: ${l}`));return{contents:o,keys:s,overrides:a,restricted:r.restricted,hasExcludedProperties:r.hasExcludedProperties}}filter(e,t,n,r){var o,s,a;let l=!1;if(!(r!=null&&r.scopes)&&!(r!=null&&r.skipRestricted)&&!(!((o=r==null?void 0:r.exclude)===null||o===void 0)&&o.length))return{raw:e,restricted:[],hasExcludedProperties:l};const c={},u=[];for(const d in e)if(qv.test(d)&&n){const h=this.filter(e[d],t,!1,r);c[d]=h.raw,l=l||h.hasExcludedProperties,u.push(...h.restricted)}else{const h=t[d],f=h?typeof h.scope<"u"?h.scope:3:void 0;h!=null&&h.restricted&&u.push(d),!(!((s=r.exclude)===null||s===void 0)&&s.includes(d))&&(!((a=r.include)===null||a===void 0)&&a.includes(d)||(f===void 0||r.scopes===void 0||r.scopes.includes(f))&&!(r.skipRestricted&&(h!=null&&h.restricted)))?c[d]=e[d]:l=!0}return{raw:c,restricted:u,hasExcludedProperties:l}}toOverrides(e,t){const n=[];for(const r of Object.keys(e))if(qv.test(r)){const o={};for(const s in e[r])o[s]=e[r][s];n.push({identifiers:ZA(r),keys:Object.keys(o),contents:gH(o,t)})}return n}}class dGe{constructor(e,t,n,r,o,s,a,l,c,u,d,h,f){this.key=e,this.overrides=t,this._value=n,this.overrideIdentifiers=r,this.defaultConfiguration=o,this.policyConfiguration=s,this.applicationConfiguration=a,this.userConfiguration=l,this.localUserConfiguration=c,this.remoteUserConfiguration=u,this.workspaceConfiguration=d,this.folderConfigurationModel=h,this.memoryConfigurationModel=f}toInspectValue(e){return(e==null?void 0:e.value)!==void 0||(e==null?void 0:e.override)!==void 0||(e==null?void 0:e.overrides)!==void 0?e:void 0}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.userConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get user(){return this.toInspectValue(this.userInspectValue)}}class Q4{constructor(e,t,n,r,o=new ls,s=new ls,a=new Tr,l=new ls,c=new Tr){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=n,this._localUserConfiguration=r,this._remoteUserConfiguration=o,this._workspaceConfiguration=s,this._folderConfigurations=a,this._memoryConfiguration=l,this._memoryConfigurationByResource=c,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new Tr,this._userConfiguration=null}getValue(e,t,n){return this.getConsolidatedConfigurationModel(e,t,n).getValue(e)}updateValue(e,t,n={}){let r;n.resource?(r=this._memoryConfigurationByResource.get(n.resource),r||(r=new ls,this._memoryConfigurationByResource.set(n.resource,r))):r=this._memoryConfiguration,t===void 0?r.removeValue(e):r.setValue(e,t),n.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,n){const r=this.getConsolidatedConfigurationModel(e,t,n),o=this.getFolderConfigurationModelForResource(t.resource,n),s=t.resource?this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration:this._memoryConfiguration,a=new Set;for(const l of r.overrides)for(const c of l.identifiers)r.getOverrideValue(e,c)!==void 0&&a.add(c);return new dGe(e,t,r.getValue(e),a.size?[...a]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,n?this._workspaceConfiguration:void 0,o||void 0,s)}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration)),this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}getConsolidatedConfigurationModel(e,t,n){let r=this.getConsolidatedConfigurationModelForResource(t,n);return t.overrideIdentifier&&(r=r.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0&&(r=r.merge(this._policyConfiguration)),r}getConsolidatedConfigurationModelForResource({resource:e},t){let n=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const r=t.getFolder(e);r&&(n=this.getFolderConsolidatedConfiguration(r.uri)||n);const o=this._memoryConfigurationByResource.get(e);o&&(n=n.merge(o))}return n}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const n=this.getWorkspaceConsolidatedConfiguration(),r=this._folderConfigurations.get(e);r?(t=n.merge(r),this._foldersConsolidatedConfigurations.set(e,t)):t=n}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const n=t.getFolder(e);if(n)return this._folderConfigurations.get(n.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys},user:{contents:this.userConfiguration.contents,overrides:this.userConfiguration.overrides,keys:this.userConfiguration.keys},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((e,t)=>{const{contents:n,overrides:r,keys:o}=this._folderConfigurations.get(t);return e.push([t,{contents:n,overrides:r,keys:o}]),e},[])}}static parse(e){const t=this.parseConfigurationModel(e.defaults),n=this.parseConfigurationModel(e.policy),r=this.parseConfigurationModel(e.application),o=this.parseConfigurationModel(e.user),s=this.parseConfigurationModel(e.workspace),a=e.folders.reduce((l,c)=>(l.set(At.revive(c[0]),this.parseConfigurationModel(c[1])),l),new Tr);return new Q4(t,n,r,o,new ls,s,a,new ls,new Tr)}static parseConfigurationModel(e){return new ls(e.contents,e.keys,e.overrides)}}class hGe{constructor(e,t,n,r){this.change=e,this.previous=t,this.currentConfiguraiton=n,this.currentWorkspace=r,this._marker=` -`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=".".charCodeAt(0),this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const o of e.keys)this.affectedKeys.add(o);for(const[,o]of e.overrides)for(const s of o)this.affectedKeys.add(s);this._affectsConfigStr=this._marker;for(const o of this.affectedKeys)this._affectsConfigStr+=o+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=Q4.parse(this.previous.data)),this._previousConfiguration}affectsConfiguration(e,t){var n;const r=this._marker+e,o=this._affectsConfigStr.indexOf(r);if(o<0)return!1;const s=o+r.length;if(s>=this._affectsConfigStr.length)return!1;const a=this._affectsConfigStr.charCodeAt(s);if(a!==this._markerCode1&&a!==this._markerCode2)return!1;if(t){const l=this.previousConfiguration?this.previousConfiguration.getValue(e,t,(n=this.previous)===null||n===void 0?void 0:n.workspace):void 0,c=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!dc(l,c)}return!0}}const kP={kind:0},fGe={kind:1};function gGe(i,e,t){return{kind:2,commandId:i,commandArgs:e,isBubble:t}}class DE{constructor(e,t,n){var r;this._log=n,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const o of e){const s=o.command;s&&s.charAt(0)!=="-"&&this._defaultBoundCommands.set(s,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=DE.handleRemovals([].concat(e).concat(t));for(let o=0,s=this._keybindings.length;o"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let r=n.length-1;r>=0;r--){const o=n[r];if(o.command===t.command)continue;let s=!0;for(let a=1;a"u"?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;const t=this._lookupMap.get(e.command);if(!(typeof t>"u")){for(let n=0,r=t.length;n"u"||n.length===0)return null;if(n.length===1)return n[0];for(let r=n.length-1;r>=0;r--){const o=n[r];if(t.contextMatchesRules(o.when))return o}return n[n.length-1]}resolve(e,t,n){const r=[...t,n];this._log(`| Resolving ${r}`);const o=this._map.get(r[0]);if(o===void 0)return this._log("\\ No keybinding entries."),kP;let s=null;if(r.length<2)s=o;else{s=[];for(let l=0,c=o.length;lu.chords.length)continue;let d=!0;for(let h=1;h=0;n--){const r=t[n];if(DE._contextMatchesRules(e,r.when))return r}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function Uoe(i){return i?`${i.serialize()}`:"no when condition"}function joe(i){return i.extensionId?i.isBuiltinExtension?`built-in extension ${i.extensionId}`:`user extension ${i.extensionId}`:i.isDefault?"built-in":"user"}const pGe=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class mGe extends fe{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:Je.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,n,r,o){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=n,this._notificationService=r,this._logService=o,this._onDidUpdateKeybindings=this._register(new se),this._currentChords=[],this._currentChordChecker=new Sq,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=gy.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new cd,this._currentlyDispatchingCommandId=null,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e,t){const n=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService);if(n)return n.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");const n=this.resolveKeyboardEvent(e);if(n.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),kP;const[r]=n.getDispatchChords();if(r===null)return this._log("\\ Keyboard event cannot be dispatched"),kP;const o=this._contextKeyService.getContext(t),s=this._currentChords.map(({keypress:a})=>a);return this._getResolver().resolve(o,s,r)}_scheduleLeaveChordMode(){const e=Date.now();this._currentChordChecker.cancelAndSet(()=>{if(!this._documentHasFocus()){this._leaveChordMode();return}Date.now()-e>5e3&&this._leaveChordMode()},500)}_expectAnotherChord(e,t){switch(this._currentChords.push({keypress:e,label:t}),this._currentChords.length){case 0:throw sq("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(w("first.chord","({0}) was pressed. Waiting for second key of chord...",t));break;default:{const n=this._currentChords.map(({label:r})=>r).join(", ");this._currentChordStatusMessage=this._notificationService.status(w("next.chord","({0}) was pressed. Waiting for next key of chord...",n))}}this._scheduleLeaveChordMode(),fE.enabled&&fE.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],fE.enable()}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const n=this.resolveKeyboardEvent(e),[r]=n.getSingleModifierDispatchChords();if(r)return this._ignoreSingleModifiers.has(r)?(this._log(`+ Ignoring single modifier ${r} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=gy.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=gy.EMPTY,this._currentSingleModifier===null?(this._log(`+ Storing single modifier for possible chord ${r}.`),this._currentSingleModifier=r,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):r===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${r} ${r}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(n,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${r}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[o]=n.getChords();return this._ignoreSingleModifiers=new gy(o),this._currentSingleModifier!==null&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,n=!1){var r;let o=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let s=null,a=null;if(n){const[d]=e.getSingleModifierDispatchChords();s=d,a=d?[d]:[]}else[s]=e.getDispatchChords(),a=this._currentChords.map(({keypress:d})=>d);if(s===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),o;const l=this._contextKeyService.getContext(t),c=e.getLabel(),u=this._getResolver().resolve(l,a,s);switch(u.kind){case 0:{if(this._logService.trace("KeybindingService#dispatch",c,"[ No matching keybinding ]"),this.inChordMode){const d=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${d}, ${c}".`),this._notificationService.status(w("missing.chord","The key combination ({0}, {1}) is not a command.",d,c),{hideAfter:10*1e3}),this._leaveChordMode(),o=!0}return o}case 1:return this._logService.trace("KeybindingService#dispatch",c,"[ Several keybindings match - more chords needed ]"),o=!0,this._expectAnotherChord(s,c),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),o;case 2:{if(this._logService.trace("KeybindingService#dispatch",c,`[ Will dispatch command ${u.commandId} ]`),u.commandId===null||u.commandId===""){if(this.inChordMode){const d=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${d}, ${c}".`),this._notificationService.status(w("missing.chord","The key combination ({0}, {1}) is not a command.",d,c),{hideAfter:10*1e3}),this._leaveChordMode(),o=!0}}else{this.inChordMode&&this._leaveChordMode(),u.isBubble||(o=!0),this._log(`+ Invoking command ${u.commandId}.`),this._currentlyDispatchingCommandId=u.commandId;try{typeof u.commandArgs>"u"?this._commandService.executeCommand(u.commandId).then(void 0,d=>this._notificationService.warn(d)):this._commandService.executeCommand(u.commandId,u.commandArgs).then(void 0,d=>this._notificationService.warn(d))}finally{this._currentlyDispatchingCommandId=null}pGe.test(u.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:u.commandId,from:"keybinding",detail:(r=e.getUserSettingsLabel())!==null&&r!==void 0?r:void 0})}return o}}}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30}}class gy{constructor(e){this._ctrlKey=e?e.ctrlKey:!1,this._shiftKey=e?e.shiftKey:!1,this._altKey=e?e.altKey:!1,this._metaKey=e?e.metaKey:!1}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}}gy.EMPTY=new gy(null);class Koe{constructor(e,t,n,r,o,s,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?bV(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=bV(e.getSingleModifierDispatchChords())),this.bubble=t?t.charCodeAt(0)===94:!1,this.command=this.bubble?t.substr(1):t,this.commandArgs=n,this.when=r,this.isDefault=o,this.extensionId=s,this.isBuiltinExtension=a}}function bV(i){const e=[];for(let t=0,n=i.length;tthis._getLabel(e))}getAriaLabel(){return vGe.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:_Ge.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return bGe.toLabel(this._os,this._chords,e=>this._getUserSettingsLabel(e))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map(e=>this._getChord(e))}_getChord(e){return new eBe(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchChords(){return this._chords.map(e=>this._getChordDispatch(e))}getSingleModifierDispatchChords(){return this._chords.map(e=>this._getSingleModifierChordDispatch(e))}}class rI extends yGe{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(this._os===2)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return Bg.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":Bg.toString(e.keyCode)}_getElectronAccelerator(e){return Bg.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=Bg.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_getChordDispatch(e){return rI.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+=Bg.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return e.keyCode===5&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":e.keyCode===4&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":e.keyCode===6&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":e.keyCode===57&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}static _scanCodeToKeyCode(e){const t=hq[e];if(t!==-1)return t;switch(e){case 10:return 31;case 11:return 32;case 12:return 33;case 13:return 34;case 14:return 35;case 15:return 36;case 16:return 37;case 17:return 38;case 18:return 39;case 19:return 40;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 45;case 25:return 46;case 26:return 47;case 27:return 48;case 28:return 49;case 29:return 50;case 30:return 51;case 31:return 52;case 32:return 53;case 33:return 54;case 34:return 55;case 35:return 56;case 36:return 22;case 37:return 23;case 38:return 24;case 39:return 25;case 40:return 26;case 41:return 27;case 42:return 28;case 43:return 29;case 44:return 30;case 45:return 21;case 51:return 88;case 52:return 86;case 53:return 92;case 54:return 94;case 55:return 93;case 56:return 0;case 57:return 85;case 58:return 95;case 59:return 91;case 60:return 87;case 61:return 89;case 62:return 90;case 106:return 97}return 0}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof Ip)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===0?null:new Ip(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const n=bV(e.chords.map(r=>this._toKeyCodeChord(r)));return n.length>0?[new rI(n,t)]:[]}}const Vw=yn("labelService"),P_e=yn("progressService");let mp=class{constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}};mp.None=Object.freeze({report(){}});const T_=yn("editorProgressService");class wGe{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos=0;t--,this._valueLen--){const n=this._value.charCodeAt(t);if(!(n===47||this._splitOnBackslash&&n===92))break}return this.next()}hasNext(){return this._to!1,t=()=>!1){return new qy(new LGe(e,t))}static forStrings(){return new qy(new wGe)}static forConfigKeys(){return new qy(new SGe)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,t){const n=this._iter.reset(e);let r;this._root||(this._root=new OR,this._root.segment=n.value());const o=[];for(r=this._root;;){const a=n.cmp(r.segment);if(a>0)r.left||(r.left=new OR,r.left.segment=n.value()),o.push([-1,r]),r=r.left;else if(a<0)r.right||(r.right=new OR,r.right.segment=n.value()),o.push([1,r]),r=r.right;else if(n.hasNext())n.next(),r.mid||(r.mid=new OR,r.mid.segment=n.value()),o.push([0,r]),r=r.mid;else break}const s=r.value;r.value=t,r.key=e;for(let a=o.length-1;a>=0;a--){const l=o[a][1];l.updateHeight();const c=l.balanceFactor();if(c<-1||c>1){const u=o[a][0],d=o[a+1][0];if(u===1&&d===1)o[a][1]=l.rotateLeft();else if(u===-1&&d===-1)o[a][1]=l.rotateRight();else if(u===1&&d===-1)l.right=o[a+1][1]=o[a+1][1].rotateRight(),o[a][1]=l.rotateLeft();else if(u===-1&&d===1)l.left=o[a+1][1]=o[a+1][1].rotateLeft(),o[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(o[a-1][0]){case-1:o[a-1][1].left=o[a][1];break;case 1:o[a-1][1].right=o[a][1];break;case 0:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}return s}get(e){var t;return(t=this._getNode(e))===null||t===void 0?void 0:t.value}_getNode(e){const t=this._iter.reset(e);let n=this._root;for(;n;){const r=t.cmp(n.segment);if(r>0)n=n.left;else if(r<0)n=n.right;else if(t.hasNext())t.next(),n=n.mid;else break}return n}has(e){const t=this._getNode(e);return!((t==null?void 0:t.value)===void 0&&(t==null?void 0:t.mid)===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){var n;const r=this._iter.reset(e),o=[];let s=this._root;for(;s;){const a=r.cmp(s.segment);if(a>0)o.push([-1,s]),s=s.left;else if(a<0)o.push([1,s]),s=s.right;else if(r.hasNext())r.next(),o.push([0,s]),s=s.mid;else break}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 a=this._min(s.right);if(a.key){const{key:l,value:c,segment:u}=a;this._delete(a.key,!1),s.key=l,s.value=c,s.segment=u}}else{const a=(n=s.left)!==null&&n!==void 0?n:s.right;if(o.length>0){const[l,c]=o[o.length-1];switch(l){case-1:c.left=a;break;case 0:c.mid=a;break;case 1:c.right=a;break}}else this._root=a}for(let a=o.length-1;a>=0;a--){const l=o[a][1];l.updateHeight();const c=l.balanceFactor();if(c>1?(l.right.balanceFactor()>=0||(l.right=l.right.rotateRight()),o[a][1]=l.rotateLeft()):c<-1&&(l.left.balanceFactor()<=0||(l.left=l.left.rotateLeft()),o[a][1]=l.rotateRight()),a>0)switch(o[a-1][0]){case-1:o[a-1][1].left=o[a][1];break;case 1:o[a-1][1].right=o[a][1];break;case 0:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const t=this._iter.reset(e);let n=this._root,r;for(;n;){const o=t.cmp(n.segment);if(o>0)n=n.left;else if(o<0)n=n.right;else if(t.hasNext())t.next(),r=n.value||r,n=n.mid;else break}return n&&n.value||r}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const n=this._iter.reset(e);let r=this._root;for(;r;){const o=n.cmp(r.segment);if(o>0)r=r.left;else if(o<0)r=r.right;else if(n.hasNext())n.next(),r=r.mid;else return r.mid?this._entries(r.mid):t?r.value:void 0}}forEach(e){for(const[t,n]of this)e(n,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){const t=[];return this._dfsEntries(e,t),t[Symbol.iterator]()}_dfsEntries(e,t){e&&(e.left&&this._dfsEntries(e.left,t),e.value&&t.push([e.key,e.value]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}}const Pb=yn("contextService");function CV(i){const e=i;return typeof(e==null?void 0:e.id)=="string"&&At.isUri(e.uri)}function EGe(i){const e=i;return typeof(e==null?void 0:e.id)=="string"&&!CV(i)&&!TGe(i)}const DGe={id:"ext-dev"},IGe={id:"empty-window"};function kGe(i,e){if(typeof i=="string"||typeof i>"u")return typeof i=="string"?{id:vv(i)}:e?DGe:IGe;const t=i;return t.configuration?{id:t.id,configPath:t.configuration}:t.folders.length===1?{id:t.id,uri:t.folders[0].uri}:{id:t.id}}function TGe(i){const e=i;return typeof(e==null?void 0:e.id)=="string"&&At.isUri(e.configPath)}class NGe{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}const yV="code-workspace";w("codeWorkspace","Code Workspace");const O_e="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function RGe(i){return i.id===O_e}var wV;(function(i){i.inspectTokensAction=w("inspectTokens","Developer: Inspect Tokens")})(wV||(wV={}));var TP;(function(i){i.gotoLineActionLabel=w("gotoLineActionLabel","Go to Line/Column...")})(TP||(TP={}));var SV;(function(i){i.helpQuickAccessActionLabel=w("helpQuickAccess","Show all Quick Access Providers")})(SV||(SV={}));var NP;(function(i){i.quickCommandActionLabel=w("quickCommandActionLabel","Command Palette"),i.quickCommandHelp=w("quickCommandActionHelp","Show And Run Commands")})(NP||(NP={}));var oI;(function(i){i.quickOutlineActionLabel=w("quickOutlineActionLabel","Go to Symbol..."),i.quickOutlineByCategoryActionLabel=w("quickOutlineByCategoryActionLabel","Go to Symbol by Category...")})(oI||(oI={}));var RP;(function(i){i.editorViewAccessibleLabel=w("editorViewAccessibleLabel","Editor content"),i.accessibilityHelpMessage=w("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options.")})(RP||(RP={}));var xV;(function(i){i.toggleHighContrast=w("toggleHighContrast","Toggle High Contrast Theme")})(xV||(xV={}));var LV;(function(i){i.bulkEditServiceSummary=w("bulkEditServiceSummary","Made {0} edits in {1} files")})(LV||(LV={}));const F_e=yn("workspaceTrustManagementService");var xs;(function(i){function e(o,s){if(o.start>=s.end||s.start>=o.end)return{start:0,end:0};const a=Math.max(o.start,s.start),l=Math.min(o.end,s.end);return l-a<=0?{start:0,end:0}:{start:a,end:l}}i.intersect=e;function t(o){return o.end-o.start<=0}i.isEmpty=t;function n(o,s){return!t(e(o,s))}i.intersects=n;function r(o,s){const a=[],l={start:o.start,end:Math.min(s.start,o.end)},c={start:Math.max(s.end,o.start),end:o.end};return t(l)||a.push(l),t(c)||a.push(c),a}i.relativeComplement=r})(xs||(xs={}));function MGe(i){const e=i;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var Zm;(function(i){i[i.AVOID=0]="AVOID",i[i.ALIGN=1]="ALIGN"})(Zm||(Zm={}));function py(i,e,t){const n=t.mode===Zm.ALIGN?t.offset:t.offset+t.size,r=t.mode===Zm.ALIGN?t.offset+t.size:t.offset;return t.position===0?e<=i-n?n:e<=r?r-e:Math.max(i-e,0):e<=r?r-e:e<=i-n?n:0}class zw extends fe{constructor(e,t){super(),this.container=null,this.useFixedPosition=!1,this.useShadowDOM=!1,this.delegate=null,this.toDisposeOnClean=fe.None,this.toDisposeOnSetContainer=fe.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=He(".context-view"),fa(this.view),this.setContainer(e,t),this._register(Rt(()=>this.setContainer(null,1)))}setContainer(e,t){var n;this.useFixedPosition=t!==1;const r=this.useShadowDOM;if(this.useShadowDOM=t===3,!(e===this.container&&r===this.useShadowDOM)&&(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,(n=this.shadowRootHostElement)===null||n===void 0||n.remove(),this.shadowRootHostElement=null):this.container.removeChild(this.view),this.container=null),e)){if(this.container=e,this.useShadowDOM){this.shadowRootHostElement=He(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const s=document.createElement("style");s.textContent=AGe,this.shadowRoot.appendChild(s),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(He("slot"))}else this.container.appendChild(this.view);const o=new Te;zw.BUBBLE_UP_EVENTS.forEach(s=>{o.add(Sr(this.container,s,a=>{this.onDOMEvent(a,!1)}))}),zw.BUBBLE_DOWN_EVENTS.forEach(s=>{o.add(Sr(this.container,s,a=>{this.onDOMEvent(a,!0)},!0))}),this.toDisposeOnSetContainer=o}}show(e){var t,n;this.isVisible()&&this.hide(),Ns(this.view),this.view.className="context-view",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex="2575",this.view.style.position=this.useFixedPosition?"fixed":"absolute",bl(this.view),this.toDisposeOnClean=e.render(this.view)||fe.None,this.delegate=e,this.doLayout(),(n=(t=this.delegate).focus)===null||n===void 0||n.call(t)}getViewElement(){return this.view}layout(){var e,t;if(this.isVisible()){if(this.delegate.canRelayout===!1&&!(ch&&yq.pointerEvents)){this.hide();return}(t=(e=this.delegate)===null||e===void 0?void 0:e.layout)===null||t===void 0||t.call(e),this.doLayout()}}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(e instanceof HTMLElement){const h=Br(e),f=ime(e);t={top:h.top*f,left:h.left*f,width:h.width*f,height:h.height*f}}else MGe(e)?t={top:e.y,left:e.x,width:e.width||1,height:e.height||2}:t={top:e.posy,left:e.posx,width:2,height:2};const n=ua(this.view),r=qg(this.view),o=this.delegate.anchorPosition||0,s=this.delegate.anchorAlignment||0,a=this.delegate.anchorAxisAlignment||0;let l,c;const u=QBe();if(a===0){const h={offset:t.top-u.pageYOffset,size:t.height,position:o===0?0:1},f={offset:t.left,size:t.width,position:s===0?0:1,mode:Zm.ALIGN};l=py(u.innerHeight,r,h)+u.pageYOffset,xs.intersects({start:l,end:l+r},{start:h.offset,end:h.offset+h.size})&&(f.mode=Zm.AVOID),c=py(u.innerWidth,n,f)}else{const h={offset:t.left,size:t.width,position:s===0?0:1},f={offset:t.top,size:t.height,position:o===0?0:1,mode:Zm.ALIGN};c=py(u.innerWidth,n,h),xs.intersects({start:c,end:c+n},{start:h.offset,end:h.offset+h.size})&&(f.mode=Zm.AVOID),l=py(u.innerHeight,r,f)+u.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(o===0?"bottom":"top"),this.view.classList.add(s===0?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const d=Br(this.container);this.view.style.top=`${l-(this.useFixedPosition?Br(this.view).top:d.top)}px`,this.view.style.left=`${c-(this.useFixedPosition?Br(this.view).left:d.left)}px`,this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,t!=null&&t.onHide&&t.onHide(e),this.toDisposeOnClean.dispose(),fa(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,Pt(e).document.activeElement):t&&!es(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}zw.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"];zw.BUBBLE_DOWN_EVENTS=["click"];const AGe=` +|${" --- |".repeat(n)}`;return gf.lexer(a)}}var eGe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Hoe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},mV;let Uf=mV=class{constructor(e,t,n){this._options=e,this._languageService=t,this._openerService=n,this._onDidRenderAsync=new se,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,n){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const r=new Te,o=r.add(Y4(e,{...this._getRenderOptions(e,r),...t},n));return o.element.classList.add("rendered-markdown"),{element:o.element,dispose:()=>r.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:async(n,r)=>{var o,s,a;let l;n?l=this._languageService.getLanguageIdByLanguageName(n):this._options.editor&&(l=(o=this._options.editor.getModel())===null||o===void 0?void 0:o.getLanguageId()),l||(l=hc);const c=await jUe(this._languageService,r,l),u=document.createElement("span");if(u.innerHTML=(a=(s=mV._ttpTokenizer)===null||s===void 0?void 0:s.createHTML(c))!==null&&a!==void 0?a:c,this._options.editor){const d=this._options.editor.getOption(50);ps(u,d)}else this._options.codeBlockFontFamily&&(u.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(u.style.fontSize=this._options.codeBlockFontSize),u},asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:n=>HX(this._openerService,n,e.isTrusted),disposables:t}}}};Uf._ttpTokenizer=Vp("tokenizeToString",{createHTML(i){return i}});Uf=mV=eGe([Hoe(1,ji),Hoe(2,al)],Uf);async function HX(i,e,t){try{return await i.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:tGe(t)})}catch(n){return en(n),!1}}function tGe(i){return i===!0?!0:i&&Array.isArray(i.enabledCommands)?i.enabledCommands:!1}var nGe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Vx=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Hh=He;let vV=class extends yc{get _targetWindow(){return Pt(this._target.targetElements[0])}get _targetDocumentElement(){return Pt(this._target.targetElements[0]).document.documentElement}get isDisposed(){return this._isDisposed}get isMouseIn(){return this._lockMouseTracker.isMouseIn}get domNode(){return this._hover.containerDomNode}get onDispose(){return this._onDispose.event}get onRequestLayout(){return this._onRequestLayout.event}get anchor(){return this._hoverPosition===2?0:1}get x(){return this._x}get y(){return this._y}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked!==e&&(this._isLocked=e,this._hoverContainer.classList.toggle("locked",this._isLocked))}constructor(e,t,n,r,o,s){var a,l,c,u,d,h,f,g;super(),this._keybindingService=t,this._configurationService=n,this._openerService=r,this._instantiationService=o,this._accessibilityService=s,this._messageListeners=new Te,this._isDisposed=!1,this._forcePosition=!1,this._x=0,this._y=0,this._isLocked=!1,this._enableFocusTraps=!1,this._addedFocusTrap=!1,this._onDispose=this._register(new se),this._onRequestLayout=this._register(new se),this._linkHandler=e.linkHandler||(S=>HX(this._openerService,S,Mf(e.content)?e.content.isTrusted:void 0)),this._target="targetElements"in e.target?e.target:new iGe(e.target),this._hoverPointer=!((a=e.appearance)===null||a===void 0)&&a.showPointer?Hh("div.workbench-hover-pointer"):void 0,this._hover=this._register(new TX),this._hover.containerDomNode.classList.add("workbench-hover","fadeIn"),!((l=e.appearance)===null||l===void 0)&&l.compact&&this._hover.containerDomNode.classList.add("workbench-hover","compact"),!((c=e.appearance)===null||c===void 0)&&c.skipFadeInAnimation&&this._hover.containerDomNode.classList.add("skip-fade-in"),e.additionalClasses&&this._hover.containerDomNode.classList.add(...e.additionalClasses),!((u=e.position)===null||u===void 0)&&u.forcePosition&&(this._forcePosition=!0),e.trapFocus&&(this._enableFocusTraps=!0),this._hoverPosition=(h=(d=e.position)===null||d===void 0?void 0:d.hoverPosition)!==null&&h!==void 0?h:3,this.onmousedown(this._hover.containerDomNode,S=>S.stopPropagation()),this.onkeydown(this._hover.containerDomNode,S=>{S.equals(9)&&this.dispose()}),this._register(ye(this._targetWindow,"blur",()=>this.dispose()));const p=Hh("div.hover-row.markdown-hover"),v=Hh("div.hover-contents");if(typeof e.content=="string")v.textContent=e.content,v.style.whiteSpace="pre-wrap";else if(e.content instanceof HTMLElement)v.appendChild(e.content),v.classList.add("html-hover-contents");else{const S=e.content,L=this._instantiationService.createInstance(Uf,{codeBlockFontFamily:this._configurationService.getValue("editor").fontFamily||Qa.fontFamily}),{element:E}=L.render(S,{actionHandler:{callback:D=>this._linkHandler(D),disposables:this._messageListeners},asyncRenderCallback:()=>{v.classList.add("code-hover-contents"),this.layout(),this._onRequestLayout.fire()}});v.appendChild(E)}if(p.appendChild(v),this._hover.contentsDomNode.appendChild(p),e.actions&&e.actions.length>0){const S=Hh("div.hover-row.status-bar"),L=Hh("div.actions");e.actions.forEach(E=>{const D=this._keybindingService.lookupKeybinding(E.commandId),k=D?D.getLabel():null;G4.render(L,{label:E.label,commandId:E.commandId,run:T=>{E.run(T),this.dispose()},iconClass:E.iconClass},k)}),S.appendChild(L),this._hover.containerDomNode.appendChild(S)}this._hoverContainer=Hh("div.workbench-hover-container"),this._hoverPointer&&this._hoverContainer.appendChild(this._hoverPointer),this._hoverContainer.appendChild(this._hover.containerDomNode);let m;if(e.actions&&e.actions.length>0?m=!1:((f=e.persistence)===null||f===void 0?void 0:f.hideOnHover)===void 0?m=typeof e.content=="string"||Mf(e.content)&&!e.content.value.includes("](")&&!e.content.value.includes(""):m=e.persistence.hideOnHover,m&&(!((g=e.appearance)===null||g===void 0)&&g.showHoverHint)){const S=Hh("div.hover-row.status-bar"),L=Hh("div.info");L.textContent=w("hoverhint","Hold {0} key to mouse over",Ln?"Option":"Alt"),S.appendChild(L),this._hover.containerDomNode.appendChild(S)}const _=[...this._target.targetElements];m||_.push(this._hoverContainer);const y=this._register(new Voe(_));if(this._register(y.onMouseOut(()=>{this._isLocked||this.dispose()})),m){const S=[...this._target.targetElements,this._hoverContainer];this._lockMouseTracker=this._register(new Voe(S)),this._register(this._lockMouseTracker.onMouseOut(()=>{this._isLocked||this.dispose()}))}else this._lockMouseTracker=y}addFocusTrap(){if(!this._enableFocusTraps||this._addedFocusTrap)return;this._addedFocusTrap=!0;const e=this._hover.containerDomNode,t=this.findLastFocusableChild(this._hover.containerDomNode);if(t){const n=Tq(this._hoverContainer,Hh("div")),r=ke(this._hoverContainer,Hh("div"));n.tabIndex=0,r.tabIndex=0,this._register(ye(r,"focus",o=>{e.focus(),o.preventDefault()})),this._register(ye(n,"focus",o=>{t.focus(),o.preventDefault()}))}}findLastFocusableChild(e){if(e.hasChildNodes())for(let t=0;t=0)return o}const r=this.findLastFocusableChild(n);if(r)return r}}render(e){var t;e.appendChild(this._hoverContainer);const r=this._hoverContainer.contains(this._hoverContainer.ownerDocument.activeElement)&&y_e(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(t=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||t===void 0?void 0:t.getAriaLabel());r&&Hf(r),this.layout(),this.addFocusTrap()}layout(){this._hover.containerDomNode.classList.remove("right-aligned"),this._hover.contentsDomNode.style.maxHeight="";const e=u=>{const d=ime(u),h=u.getBoundingClientRect();return{top:h.top*d,bottom:h.bottom*d,right:h.right*d,left:h.left*d}},t=this._target.targetElements.map(u=>e(u)),n=Math.min(...t.map(u=>u.top)),r=Math.max(...t.map(u=>u.right)),o=Math.max(...t.map(u=>u.bottom)),s=Math.min(...t.map(u=>u.left)),a=r-s,l=o-n,c={top:n,right:r,bottom:o,left:s,width:a,height:l,center:{x:s+a/2,y:n+l/2}};if(this.adjustHorizontalHoverPosition(c),this.adjustVerticalHoverPosition(c),this.adjustHoverMaxHeight(c),this._hoverContainer.style.padding="",this._hoverContainer.style.margin="",this._hoverPointer){switch(this._hoverPosition){case 1:c.left+=3,c.right+=3,this._hoverContainer.style.paddingLeft="3px",this._hoverContainer.style.marginLeft="-3px";break;case 0:c.left-=3,c.right-=3,this._hoverContainer.style.paddingRight="3px",this._hoverContainer.style.marginRight="-3px";break;case 2:c.top+=3,c.bottom+=3,this._hoverContainer.style.paddingTop="3px",this._hoverContainer.style.marginTop="-3px";break;case 3:c.top-=3,c.bottom-=3,this._hoverContainer.style.paddingBottom="3px",this._hoverContainer.style.marginBottom="-3px";break}c.center.x=c.left+a/2,c.center.y=c.top+l/2}this.computeXCordinate(c),this.computeYCordinate(c),this._hoverPointer&&(this._hoverPointer.classList.remove("top"),this._hoverPointer.classList.remove("left"),this._hoverPointer.classList.remove("right"),this._hoverPointer.classList.remove("bottom"),this.setHoverPointerPosition(c)),this._hover.onContentsChanged()}computeXCordinate(e){const t=this._hover.containerDomNode.clientWidth+2;this._target.x!==void 0?this._x=this._target.x:this._hoverPosition===1?this._x=e.right:this._hoverPosition===0?this._x=e.left-t:(this._hoverPointer?this._x=e.center.x-this._hover.containerDomNode.clientWidth/2:this._x=e.left,this._x+t>=this._targetDocumentElement.clientWidth&&(this._hover.containerDomNode.classList.add("right-aligned"),this._x=Math.max(this._targetDocumentElement.clientWidth-t-2,this._targetDocumentElement.clientLeft))),this._xthis._targetWindow.innerHeight&&(this._y=e.bottom)}adjustHorizontalHoverPosition(e){if(this._target.x===void 0){if(this._forcePosition){const t=(this._hoverPointer?3:0)+2;this._hoverPosition===1?this._hover.containerDomNode.style.maxWidth=`${this._targetDocumentElement.clientWidth-e.right-t}px`:this._hoverPosition===0&&(this._hover.containerDomNode.style.maxWidth=`${e.left-t}px`);return}this._hoverPosition===1?this._targetDocumentElement.clientWidth-e.right=this._hover.containerDomNode.clientWidth?this._hoverPosition=0:this._hoverPosition=2):this._hoverPosition===0&&(e.left=this._hover.containerDomNode.clientWidth?this._hoverPosition=1:this._hoverPosition=2),e.left-this._hover.containerDomNode.clientWidth<=this._targetDocumentElement.clientLeft&&(this._hoverPosition=1))}}adjustVerticalHoverPosition(e){this._target.y!==void 0||this._forcePosition||(this._hoverPosition===3?e.top-this._hover.containerDomNode.clientHeight<0&&(this._hoverPosition=2):this._hoverPosition===2&&e.bottom+this._hover.containerDomNode.clientHeight>this._targetWindow.innerHeight&&(this._hoverPosition=3))}adjustHoverMaxHeight(e){let t=this._targetWindow.innerHeight/2;if(this._forcePosition){const n=(this._hoverPointer?3:0)+2;this._hoverPosition===3?t=Math.min(t,e.top-n):this._hoverPosition===2&&(t=Math.min(t,this._targetWindow.innerHeight-e.bottom-n))}if(this._hover.containerDomNode.style.maxHeight=`${t}px`,this._hover.contentsDomNode.clientHeighte.height?this._hoverPointer.style.top=`${e.center.y-(this._y-t)-3}px`:this._hoverPointer.style.top=`${Math.round(t/2)-3}px`;break}case 3:case 2:{this._hoverPointer.classList.add(this._hoverPosition===3?"bottom":"top");const t=this._hover.containerDomNode.clientWidth;let n=Math.round(t/2)-3;const r=this._x+n;(re.right)&&(n=e.center.x-this._x-3),this._hoverPointer.style.left=`${n}px`;break}}}focus(){this._hover.containerDomNode.focus()}dispose(){this._isDisposed||(this._onDispose.fire(),this._hoverContainer.remove(),this._messageListeners.dispose(),this._target.dispose(),super.dispose()),this._isDisposed=!0}};vV=nGe([Vx(1,ci),Vx(2,gn),Vx(3,al),Vx(4,Ot),Vx(5,ud)],vV);class Voe extends yc{get onMouseOut(){return this._onMouseOut.event}get isMouseIn(){return this._isMouseIn}constructor(e){super(),this._elements=e,this._isMouseIn=!0,this._onMouseOut=this._register(new se),this._elements.forEach(t=>this.onmouseover(t,()=>this._onTargetMouseOver(t))),this._elements.forEach(t=>this.onmouseleave(t,()=>this._onTargetMouseLeave(t)))}_onTargetMouseOver(e){this._isMouseIn=!0,this._clearEvaluateMouseStateTimeout(e)}_onTargetMouseLeave(e){this._isMouseIn=!1,this._evaluateMouseState(e)}_evaluateMouseState(e){this._clearEvaluateMouseStateTimeout(e),this._mouseTimeout=Pt(e).setTimeout(()=>this._fireIfMouseOutside(),0)}_clearEvaluateMouseStateTimeout(e){this._mouseTimeout&&(Pt(e).clearTimeout(this._mouseTimeout),this._mouseTimeout=void 0)}_fireIfMouseOutside(){this._isMouseIn||this._onMouseOut.fire()}}class iGe{constructor(e){this._element=e,this.targetElements=[this._element]}dispose(){}}var rGe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},e1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let _V=class{constructor(e,t,n,r,o,s){this._instantiationService=e,this._contextViewService=t,this._keybindingService=r,this._layoutService=o,this._accessibilityService=s,n.onDidShowContextMenu(()=>this.hideHover())}showHover(e,t,n){var r,o,s,a;if(zoe(this._currentHoverOptions)===zoe(e)||this._currentHover&&(!((o=(r=this._currentHoverOptions)===null||r===void 0?void 0:r.persistence)===null||o===void 0)&&o.sticky))return;this._currentHoverOptions=e,this._lastHoverOptions=e;const l=e.trapFocus||this._accessibilityService.isScreenReaderOptimized(),c=fs();n||(l&&c?this._lastFocusedElementBeforeOpen=c:this._lastFocusedElementBeforeOpen=void 0);const u=new Te,d=this._instantiationService.createInstance(vV,e);if(!((s=e.persistence)===null||s===void 0)&&s.sticky&&(d.isLocked=!0),d.onDispose(()=>{var f,g;((f=this._currentHover)===null||f===void 0?void 0:f.domNode)&&ome(this._currentHover.domNode)&&((g=this._lastFocusedElementBeforeOpen)===null||g===void 0||g.focus()),this._currentHoverOptions===e&&(this._currentHoverOptions=void 0),u.dispose()}),!e.container){const f=e.target instanceof HTMLElement?e.target:e.target.targetElements[0];e.container=this._layoutService.getContainer(Pt(f))}const h=this._contextViewService;if(h.showContextView(new oGe(d,t),e.container),d.onRequestLayout(()=>h.layout()),!((a=e.persistence)===null||a===void 0)&&a.sticky)u.add(ye(Pt(e.container).document,Ge.MOUSE_DOWN,f=>{es(f.target,d.domNode)||this.doHideHover()}));else{if("targetElements"in e.target)for(const g of e.target.targetElements)u.add(ye(g,Ge.CLICK,()=>this.hideHover()));else u.add(ye(e.target,Ge.CLICK,()=>this.hideHover()));const f=fs();if(f){const g=Pt(f).document;u.add(ye(f,Ge.KEY_DOWN,p=>{var v;return this._keyDown(p,d,!!(!((v=e.persistence)===null||v===void 0)&&v.hideOnKeyDown))})),u.add(ye(g,Ge.KEY_DOWN,p=>{var v;return this._keyDown(p,d,!!(!((v=e.persistence)===null||v===void 0)&&v.hideOnKeyDown))})),u.add(ye(f,Ge.KEY_UP,p=>this._keyUp(p,d))),u.add(ye(g,Ge.KEY_UP,p=>this._keyUp(p,d)))}}if("IntersectionObserver"in hi){const f=new IntersectionObserver(p=>this._intersectionChange(p,d),{threshold:0}),g="targetElements"in e.target?e.target.targetElements[0]:e.target;f.observe(g),u.add(Rt(()=>f.disconnect()))}return this._currentHover=d,d}hideHover(){var e;!((e=this._currentHover)===null||e===void 0)&&e.isLocked||!this._currentHoverOptions||this.doHideHover()}doHideHover(){this._currentHover=void 0,this._currentHoverOptions=void 0,this._contextViewService.hideContextView()}_intersectionChange(e,t){e[e.length-1].isIntersecting||t.dispose()}_keyDown(e,t,n){var r,o;if(e.key==="Alt"){t.isLocked=!0;return}const s=new Ai(e);this._keybindingService.resolveKeyboardEvent(s).getSingleModifierDispatchChords().some(l=>!!l)||this._keybindingService.softDispatch(s,s.target).kind!==0||n&&(!(!((r=this._currentHoverOptions)===null||r===void 0)&&r.trapFocus)||e.key!=="Tab")&&(this.hideHover(),(o=this._lastFocusedElementBeforeOpen)===null||o===void 0||o.focus())}_keyUp(e,t){var n;e.key==="Alt"&&(t.isLocked=!1,t.isMouseIn||(this.hideHover(),(n=this._lastFocusedElementBeforeOpen)===null||n===void 0||n.focus()))}};_V=rGe([e1(0,Ot),e1(1,ng),e1(2,Ol),e1(3,ci),e1(4,pC),e1(5,ud)],_V);function zoe(i){var e;if(i!==void 0)return(e=i==null?void 0:i.id)!==null&&e!==void 0?e:i}class oGe{get anchorPosition(){return this._hover.anchor}constructor(e,t=!1){this._hover=e,this._focus=t}render(e){return this._hover.render(e),this._focus&&this._hover.focus(),this._hover}getAnchor(){return{x:this._hover.x,y:this._hover.y}}layout(){this._hover.layout()}}In(kX,_V,1);fu((i,e)=>{const t=i.getColor(rve);t&&(e.addRule(`.monaco-workbench .workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-workbench .workbench-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`))});const Xk=yn("IWorkspaceEditService");class VX{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(xv.is(t))return xv.lift(t);if(Gy.is(t))return Gy.lift(t);throw new Error("Unsupported edit")})}}class xv extends VX{static is(e){return e instanceof xv?!0:va(e)&&At.isUri(e.resource)&&va(e.textEdit)}static lift(e){return e instanceof xv?e:new xv(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,n=void 0,r){super(r),this.resource=e,this.textEdit=t,this.versionId=n}}class Gy extends VX{static is(e){return e instanceof Gy?!0:va(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof Gy?e:new Gy(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,n={},r){super(r),this.oldResource=e,this.newResource=t,this.options=n}}const Vs={enableSplitViewResizing:!0,splitViewDefaultRatio:.5,renderSideBySide:!0,renderMarginRevertIcon:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0},Z4=Object.freeze({id:"editor",order:5,type:"object",title:w("editorConfigurationTitle","Editor"),scope:5}),IP={...Z4,properties:{"editor.tabSize":{type:"number",default:Ds.tabSize,minimum:1,markdownDescription:w("tabSize","The number of spaces a tab is equal to. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.indentSize":{anyOf:[{type:"string",enum:["tabSize"]},{type:"number",minimum:1}],default:"tabSize",markdownDescription:w("indentSize",'The number of spaces used for indentation or `"tabSize"` to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.')},"editor.insertSpaces":{type:"boolean",default:Ds.insertSpaces,markdownDescription:w("insertSpaces","Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.detectIndentation":{type:"boolean",default:Ds.detectIndentation,markdownDescription:w("detectIndentation","Controls whether {0} and {1} will be automatically detected when a file is opened based on the file contents.","`#editor.tabSize#`","`#editor.insertSpaces#`")},"editor.trimAutoWhitespace":{type:"boolean",default:Ds.trimAutoWhitespace,description:w("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:Ds.largeFileOptimizations,description:w("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{enum:["off","currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[w("wordBasedSuggestions.off","Turn off Word Based Suggestions."),w("wordBasedSuggestions.currentDocument","Only suggest words from the active document."),w("wordBasedSuggestions.matchingDocuments","Suggest words from all open documents of the same language."),w("wordBasedSuggestions.allDocuments","Suggest words from all open documents.")],description:w("wordBasedSuggestions","Controls whether completions should be computed based on words in the document and from which documents they are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[w("semanticHighlighting.true","Semantic highlighting enabled for all color themes."),w("semanticHighlighting.false","Semantic highlighting disabled for all color themes."),w("semanticHighlighting.configuredByTheme","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:w("semanticHighlighting.enabled","Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:w("stablePeek","Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:w("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!1,description:w("editor.experimental.asyncTokenization","Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:w("editor.experimental.asyncTokenizationLogging","Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:w("editor.experimental.asyncTokenizationVerification","Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."),tags:["experimental"]},"editor.language.brackets":{type:["array","null"],default:null,description:w("schema.brackets","Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:w("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:w("schema.closeBracket","The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:w("schema.colorizedBracketPairs","Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:w("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:w("schema.closeBracket","The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:Vs.maxComputationTime,description:w("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:Vs.maxFileSize,description:w("maxFileSize","Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:Vs.renderSideBySide,description:w("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:Vs.renderSideBySideInlineBreakpoint,description:w("renderSideBySideInlineBreakpoint","If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:Vs.useInlineViewWhenSpaceIsLimited,description:w("useInlineViewWhenSpaceIsLimited","If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:Vs.renderMarginRevertIcon,description:w("renderMarginRevertIcon","When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:Vs.ignoreTrimWhitespace,description:w("ignoreTrimWhitespace","When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:Vs.renderIndicators,description:w("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:Vs.diffCodeLens,description:w("codeLens","Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:Vs.diffWordWrap,markdownEnumDescriptions:[w("wordWrap.off","Lines will never wrap."),w("wordWrap.on","Lines will wrap at the viewport width."),w("wordWrap.inherit","Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:Vs.diffAlgorithm,markdownEnumDescriptions:[w("diffAlgorithm.legacy","Uses the legacy diffing algorithm."),w("diffAlgorithm.advanced","Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:Vs.hideUnchangedRegions.enabled,markdownDescription:w("hideUnchangedRegions.enabled","Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:Vs.hideUnchangedRegions.revealLineCount,markdownDescription:w("hideUnchangedRegions.revealLineCount","Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:Vs.hideUnchangedRegions.minimumLineCount,markdownDescription:w("hideUnchangedRegions.minimumLineCount","Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:Vs.hideUnchangedRegions.contextLineCount,markdownDescription:w("hideUnchangedRegions.contextLineCount","Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:Vs.experimental.showMoves,markdownDescription:w("showMoves","Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:Vs.experimental.showEmptyDecorations,description:w("showEmptyDecorations","Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")}}};function sGe(i){return typeof i.type<"u"||typeof i.anyOf<"u"}for(const i of J1){const e=i.schema;if(typeof e<"u")if(sGe(e))IP.properties[`editor.${i.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(IP.properties[t]=e[t])}let AR=null;function A_e(){return AR===null&&(AR=Object.create(null),Object.keys(IP.properties).forEach(i=>{AR[i]=!0})),AR}function aGe(i){return A_e()[`editor.${i}`]||!1}function lGe(i){return A_e()[`diffEditor.${i}`]||!1}const cGe=ar.as(xh.Configuration);cGe.registerConfiguration(IP);class Xi{static insert(e,t){return{range:new B(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}}function PR(i){return Object.isFrozen(i)?i:H4e(i)}class ls{constructor(e={},t=[],n=[],r){this._contents=e,this._keys=t,this._overrides=n,this.raw=r,this.overrideConfigurations=new Map}get rawConfiguration(){var e;if(!this._rawConfiguration)if(!((e=this.raw)===null||e===void 0)&&e.length){const t=this.raw.map(n=>{if(n instanceof ls)return n;const r=new uGe("");return r.parseRaw(n),r.configurationModel});this._rawConfiguration=t.reduce((n,r)=>r===n?r:n.merge(r),t[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(e){return e?_ie(this.contents,e):this.contents}inspect(e,t){const n=this;return{get value(){return PR(n.rawConfiguration.getValue(e))},get override(){return t?PR(n.rawConfiguration.getOverrideValue(e,t)):void 0},get merged(){return PR(t?n.rawConfiguration.override(t).getValue(e):n.rawConfiguration.getValue(e))},get overrides(){const r=[];for(const{contents:o,identifiers:s,keys:a}of n.rawConfiguration.overrides){const l=new ls(o,a).getValue(e);l!==void 0&&r.push({identifiers:s,value:l})}return r.length?PR(r):void 0}}}getOverrideValue(e,t){const n=this.getContentsForOverrideIdentifer(t);return n?e?_ie(n,e):n:void 0}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){var t,n;const r=Mg(this.contents),o=Mg(this.overrides),s=[...this.keys],a=!((t=this.raw)===null||t===void 0)&&t.length?[...this.raw]:[this];for(const l of e)if(a.push(...!((n=l.raw)===null||n===void 0)&&n.length?l.raw:[l]),!l.isEmpty()){this.mergeContents(r,l.contents);for(const c of l.overrides){const[u]=o.filter(d=>or(d.identifiers,c.identifiers));u?(this.mergeContents(u.contents,c.contents),u.keys.push(...c.keys),u.keys=Ep(u.keys)):o.push(Mg(c))}for(const c of l.keys)s.indexOf(c)===-1&&s.push(c)}return new ls(r,s,o,a.every(l=>l instanceof ls)?void 0:a)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||typeof t!="object"||!Object.keys(t).length)return this;const n={};for(const r of Ep([...Object.keys(this.contents),...Object.keys(t)])){let o=this.contents[r];const s=t[r];s&&(typeof o=="object"&&typeof s=="object"?(o=Mg(o),this.mergeContents(o,s)):o=s),n[r]=o}return new ls(n,this.keys,this.overrides)}mergeContents(e,t){for(const n of Object.keys(t)){if(n in e&&va(e[n])&&va(t[n])){this.mergeContents(e[n],t[n]);continue}e[n]=Mg(t[n])}}getContentsForOverrideIdentifer(e){let t=null,n=null;const r=o=>{o&&(n?this.mergeContents(n,o):n=Mg(o))};for(const o of this.overrides)o.identifiers.length===1&&o.identifiers[0]===e?t=o.contents:o.identifiers.includes(e)&&r(o.contents);return r(t),n}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}addValue(e,t){this.updateValue(e,t,!0)}setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){const t=this.keys.indexOf(e);t!==-1&&(this.keys.splice(t,1),C6e(this.contents,e),Gv.test(e)&&this.overrides.splice(this.overrides.findIndex(n=>or(n.identifiers,ZA(e))),1))}updateValue(e,t,n){kme(this.contents,e,t,r=>console.error(r)),n=n||this.keys.indexOf(e)===-1,n&&this.keys.push(e),Gv.test(e)&&this.overrides.push({identifiers:ZA(e),keys:Object.keys(this.contents[e]),contents:gH(this.contents[e],r=>console.error(r))})}}class uGe{constructor(e){this._name=e,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||new ls}parseRaw(e,t){this._raw=e;const{contents:n,keys:r,overrides:o,restricted:s,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new ls(n,r,o,a?[e]:void 0),this._restrictedConfigurations=s||[]}doParseRaw(e,t){const n=ar.as(xh.Configuration).getConfigurationProperties(),r=this.filter(e,n,!0,t);e=r.raw;const o=gH(e,l=>console.error(`Conflict in settings file ${this._name}: ${l}`)),s=Object.keys(e),a=this.toOverrides(e,l=>console.error(`Conflict in settings file ${this._name}: ${l}`));return{contents:o,keys:s,overrides:a,restricted:r.restricted,hasExcludedProperties:r.hasExcludedProperties}}filter(e,t,n,r){var o,s,a;let l=!1;if(!(r!=null&&r.scopes)&&!(r!=null&&r.skipRestricted)&&!(!((o=r==null?void 0:r.exclude)===null||o===void 0)&&o.length))return{raw:e,restricted:[],hasExcludedProperties:l};const c={},u=[];for(const d in e)if(Gv.test(d)&&n){const h=this.filter(e[d],t,!1,r);c[d]=h.raw,l=l||h.hasExcludedProperties,u.push(...h.restricted)}else{const h=t[d],f=h?typeof h.scope<"u"?h.scope:3:void 0;h!=null&&h.restricted&&u.push(d),!(!((s=r.exclude)===null||s===void 0)&&s.includes(d))&&(!((a=r.include)===null||a===void 0)&&a.includes(d)||(f===void 0||r.scopes===void 0||r.scopes.includes(f))&&!(r.skipRestricted&&(h!=null&&h.restricted)))?c[d]=e[d]:l=!0}return{raw:c,restricted:u,hasExcludedProperties:l}}toOverrides(e,t){const n=[];for(const r of Object.keys(e))if(Gv.test(r)){const o={};for(const s in e[r])o[s]=e[r][s];n.push({identifiers:ZA(r),keys:Object.keys(o),contents:gH(o,t)})}return n}}class dGe{constructor(e,t,n,r,o,s,a,l,c,u,d,h,f){this.key=e,this.overrides=t,this._value=n,this.overrideIdentifiers=r,this.defaultConfiguration=o,this.policyConfiguration=s,this.applicationConfiguration=a,this.userConfiguration=l,this.localUserConfiguration=c,this.remoteUserConfiguration=u,this.workspaceConfiguration=d,this.folderConfigurationModel=h,this.memoryConfigurationModel=f}toInspectValue(e){return(e==null?void 0:e.value)!==void 0||(e==null?void 0:e.override)!==void 0||(e==null?void 0:e.overrides)!==void 0?e:void 0}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.userConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get user(){return this.toInspectValue(this.userInspectValue)}}class Q4{constructor(e,t,n,r,o=new ls,s=new ls,a=new Tr,l=new ls,c=new Tr){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=n,this._localUserConfiguration=r,this._remoteUserConfiguration=o,this._workspaceConfiguration=s,this._folderConfigurations=a,this._memoryConfiguration=l,this._memoryConfigurationByResource=c,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new Tr,this._userConfiguration=null}getValue(e,t,n){return this.getConsolidatedConfigurationModel(e,t,n).getValue(e)}updateValue(e,t,n={}){let r;n.resource?(r=this._memoryConfigurationByResource.get(n.resource),r||(r=new ls,this._memoryConfigurationByResource.set(n.resource,r))):r=this._memoryConfiguration,t===void 0?r.removeValue(e):r.setValue(e,t),n.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,n){const r=this.getConsolidatedConfigurationModel(e,t,n),o=this.getFolderConfigurationModelForResource(t.resource,n),s=t.resource?this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration:this._memoryConfiguration,a=new Set;for(const l of r.overrides)for(const c of l.identifiers)r.getOverrideValue(e,c)!==void 0&&a.add(c);return new dGe(e,t,r.getValue(e),a.size?[...a]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,n?this._workspaceConfiguration:void 0,o||void 0,s)}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration)),this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}getConsolidatedConfigurationModel(e,t,n){let r=this.getConsolidatedConfigurationModelForResource(t,n);return t.overrideIdentifier&&(r=r.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0&&(r=r.merge(this._policyConfiguration)),r}getConsolidatedConfigurationModelForResource({resource:e},t){let n=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const r=t.getFolder(e);r&&(n=this.getFolderConsolidatedConfiguration(r.uri)||n);const o=this._memoryConfigurationByResource.get(e);o&&(n=n.merge(o))}return n}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const n=this.getWorkspaceConsolidatedConfiguration(),r=this._folderConfigurations.get(e);r?(t=n.merge(r),this._foldersConsolidatedConfigurations.set(e,t)):t=n}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const n=t.getFolder(e);if(n)return this._folderConfigurations.get(n.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys},user:{contents:this.userConfiguration.contents,overrides:this.userConfiguration.overrides,keys:this.userConfiguration.keys},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((e,t)=>{const{contents:n,overrides:r,keys:o}=this._folderConfigurations.get(t);return e.push([t,{contents:n,overrides:r,keys:o}]),e},[])}}static parse(e){const t=this.parseConfigurationModel(e.defaults),n=this.parseConfigurationModel(e.policy),r=this.parseConfigurationModel(e.application),o=this.parseConfigurationModel(e.user),s=this.parseConfigurationModel(e.workspace),a=e.folders.reduce((l,c)=>(l.set(At.revive(c[0]),this.parseConfigurationModel(c[1])),l),new Tr);return new Q4(t,n,r,o,new ls,s,a,new ls,new Tr)}static parseConfigurationModel(e){return new ls(e.contents,e.keys,e.overrides)}}class hGe{constructor(e,t,n,r){this.change=e,this.previous=t,this.currentConfiguraiton=n,this.currentWorkspace=r,this._marker=` +`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=".".charCodeAt(0),this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const o of e.keys)this.affectedKeys.add(o);for(const[,o]of e.overrides)for(const s of o)this.affectedKeys.add(s);this._affectsConfigStr=this._marker;for(const o of this.affectedKeys)this._affectsConfigStr+=o+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=Q4.parse(this.previous.data)),this._previousConfiguration}affectsConfiguration(e,t){var n;const r=this._marker+e,o=this._affectsConfigStr.indexOf(r);if(o<0)return!1;const s=o+r.length;if(s>=this._affectsConfigStr.length)return!1;const a=this._affectsConfigStr.charCodeAt(s);if(a!==this._markerCode1&&a!==this._markerCode2)return!1;if(t){const l=this.previousConfiguration?this.previousConfiguration.getValue(e,t,(n=this.previous)===null||n===void 0?void 0:n.workspace):void 0,c=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!dc(l,c)}return!0}}const kP={kind:0},fGe={kind:1};function gGe(i,e,t){return{kind:2,commandId:i,commandArgs:e,isBubble:t}}class DE{constructor(e,t,n){var r;this._log=n,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const o of e){const s=o.command;s&&s.charAt(0)!=="-"&&this._defaultBoundCommands.set(s,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=DE.handleRemovals([].concat(e).concat(t));for(let o=0,s=this._keybindings.length;o"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let r=n.length-1;r>=0;r--){const o=n[r];if(o.command===t.command)continue;let s=!0;for(let a=1;a"u"?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;const t=this._lookupMap.get(e.command);if(!(typeof t>"u")){for(let n=0,r=t.length;n"u"||n.length===0)return null;if(n.length===1)return n[0];for(let r=n.length-1;r>=0;r--){const o=n[r];if(t.contextMatchesRules(o.when))return o}return n[n.length-1]}resolve(e,t,n){const r=[...t,n];this._log(`| Resolving ${r}`);const o=this._map.get(r[0]);if(o===void 0)return this._log("\\ No keybinding entries."),kP;let s=null;if(r.length<2)s=o;else{s=[];for(let l=0,c=o.length;lu.chords.length)continue;let d=!0;for(let h=1;h=0;n--){const r=t[n];if(DE._contextMatchesRules(e,r.when))return r}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function Uoe(i){return i?`${i.serialize()}`:"no when condition"}function joe(i){return i.extensionId?i.isBuiltinExtension?`built-in extension ${i.extensionId}`:`user extension ${i.extensionId}`:i.isDefault?"built-in":"user"}const pGe=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class mGe extends fe{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:Je.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,n,r,o){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=n,this._notificationService=r,this._logService=o,this._onDidUpdateKeybindings=this._register(new se),this._currentChords=[],this._currentChordChecker=new Sq,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=gy.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new cd,this._currentlyDispatchingCommandId=null,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e,t){const n=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService);if(n)return n.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");const n=this.resolveKeyboardEvent(e);if(n.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),kP;const[r]=n.getDispatchChords();if(r===null)return this._log("\\ Keyboard event cannot be dispatched"),kP;const o=this._contextKeyService.getContext(t),s=this._currentChords.map(({keypress:a})=>a);return this._getResolver().resolve(o,s,r)}_scheduleLeaveChordMode(){const e=Date.now();this._currentChordChecker.cancelAndSet(()=>{if(!this._documentHasFocus()){this._leaveChordMode();return}Date.now()-e>5e3&&this._leaveChordMode()},500)}_expectAnotherChord(e,t){switch(this._currentChords.push({keypress:e,label:t}),this._currentChords.length){case 0:throw sq("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(w("first.chord","({0}) was pressed. Waiting for second key of chord...",t));break;default:{const n=this._currentChords.map(({label:r})=>r).join(", ");this._currentChordStatusMessage=this._notificationService.status(w("next.chord","({0}) was pressed. Waiting for next key of chord...",n))}}this._scheduleLeaveChordMode(),fE.enabled&&fE.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],fE.enable()}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const n=this.resolveKeyboardEvent(e),[r]=n.getSingleModifierDispatchChords();if(r)return this._ignoreSingleModifiers.has(r)?(this._log(`+ Ignoring single modifier ${r} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=gy.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=gy.EMPTY,this._currentSingleModifier===null?(this._log(`+ Storing single modifier for possible chord ${r}.`),this._currentSingleModifier=r,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):r===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${r} ${r}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(n,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${r}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[o]=n.getChords();return this._ignoreSingleModifiers=new gy(o),this._currentSingleModifier!==null&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,n=!1){var r;let o=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let s=null,a=null;if(n){const[d]=e.getSingleModifierDispatchChords();s=d,a=d?[d]:[]}else[s]=e.getDispatchChords(),a=this._currentChords.map(({keypress:d})=>d);if(s===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),o;const l=this._contextKeyService.getContext(t),c=e.getLabel(),u=this._getResolver().resolve(l,a,s);switch(u.kind){case 0:{if(this._logService.trace("KeybindingService#dispatch",c,"[ No matching keybinding ]"),this.inChordMode){const d=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${d}, ${c}".`),this._notificationService.status(w("missing.chord","The key combination ({0}, {1}) is not a command.",d,c),{hideAfter:10*1e3}),this._leaveChordMode(),o=!0}return o}case 1:return this._logService.trace("KeybindingService#dispatch",c,"[ Several keybindings match - more chords needed ]"),o=!0,this._expectAnotherChord(s,c),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),o;case 2:{if(this._logService.trace("KeybindingService#dispatch",c,`[ Will dispatch command ${u.commandId} ]`),u.commandId===null||u.commandId===""){if(this.inChordMode){const d=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${d}, ${c}".`),this._notificationService.status(w("missing.chord","The key combination ({0}, {1}) is not a command.",d,c),{hideAfter:10*1e3}),this._leaveChordMode(),o=!0}}else{this.inChordMode&&this._leaveChordMode(),u.isBubble||(o=!0),this._log(`+ Invoking command ${u.commandId}.`),this._currentlyDispatchingCommandId=u.commandId;try{typeof u.commandArgs>"u"?this._commandService.executeCommand(u.commandId).then(void 0,d=>this._notificationService.warn(d)):this._commandService.executeCommand(u.commandId,u.commandArgs).then(void 0,d=>this._notificationService.warn(d))}finally{this._currentlyDispatchingCommandId=null}pGe.test(u.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:u.commandId,from:"keybinding",detail:(r=e.getUserSettingsLabel())!==null&&r!==void 0?r:void 0})}return o}}}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30}}class gy{constructor(e){this._ctrlKey=e?e.ctrlKey:!1,this._shiftKey=e?e.shiftKey:!1,this._altKey=e?e.altKey:!1,this._metaKey=e?e.metaKey:!1}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}}gy.EMPTY=new gy(null);class Koe{constructor(e,t,n,r,o,s,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?bV(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=bV(e.getSingleModifierDispatchChords())),this.bubble=t?t.charCodeAt(0)===94:!1,this.command=this.bubble?t.substr(1):t,this.commandArgs=n,this.when=r,this.isDefault=o,this.extensionId=s,this.isBuiltinExtension=a}}function bV(i){const e=[];for(let t=0,n=i.length;tthis._getLabel(e))}getAriaLabel(){return vGe.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:_Ge.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return bGe.toLabel(this._os,this._chords,e=>this._getUserSettingsLabel(e))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map(e=>this._getChord(e))}_getChord(e){return new eBe(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchChords(){return this._chords.map(e=>this._getChordDispatch(e))}getSingleModifierDispatchChords(){return this._chords.map(e=>this._getSingleModifierChordDispatch(e))}}class rI extends yGe{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(this._os===2)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return Bg.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":Bg.toString(e.keyCode)}_getElectronAccelerator(e){return Bg.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=Bg.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_getChordDispatch(e){return rI.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+=Bg.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return e.keyCode===5&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":e.keyCode===4&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":e.keyCode===6&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":e.keyCode===57&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}static _scanCodeToKeyCode(e){const t=hq[e];if(t!==-1)return t;switch(e){case 10:return 31;case 11:return 32;case 12:return 33;case 13:return 34;case 14:return 35;case 15:return 36;case 16:return 37;case 17:return 38;case 18:return 39;case 19:return 40;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 45;case 25:return 46;case 26:return 47;case 27:return 48;case 28:return 49;case 29:return 50;case 30:return 51;case 31:return 52;case 32:return 53;case 33:return 54;case 34:return 55;case 35:return 56;case 36:return 22;case 37:return 23;case 38:return 24;case 39:return 25;case 40:return 26;case 41:return 27;case 42:return 28;case 43:return 29;case 44:return 30;case 45:return 21;case 51:return 88;case 52:return 86;case 53:return 92;case 54:return 94;case 55:return 93;case 56:return 0;case 57:return 85;case 58:return 95;case 59:return 91;case 60:return 87;case 61:return 89;case 62:return 90;case 106:return 97}return 0}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof kp)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===0?null:new kp(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const n=bV(e.chords.map(r=>this._toKeyCodeChord(r)));return n.length>0?[new rI(n,t)]:[]}}const Vw=yn("labelService"),P_e=yn("progressService");let mp=class{constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}};mp.None=Object.freeze({report(){}});const k_=yn("editorProgressService");class wGe{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos=0;t--,this._valueLen--){const n=this._value.charCodeAt(t);if(!(n===47||this._splitOnBackslash&&n===92))break}return this.next()}hasNext(){return this._to!1,t=()=>!1){return new qy(new LGe(e,t))}static forStrings(){return new qy(new wGe)}static forConfigKeys(){return new qy(new SGe)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,t){const n=this._iter.reset(e);let r;this._root||(this._root=new OR,this._root.segment=n.value());const o=[];for(r=this._root;;){const a=n.cmp(r.segment);if(a>0)r.left||(r.left=new OR,r.left.segment=n.value()),o.push([-1,r]),r=r.left;else if(a<0)r.right||(r.right=new OR,r.right.segment=n.value()),o.push([1,r]),r=r.right;else if(n.hasNext())n.next(),r.mid||(r.mid=new OR,r.mid.segment=n.value()),o.push([0,r]),r=r.mid;else break}const s=r.value;r.value=t,r.key=e;for(let a=o.length-1;a>=0;a--){const l=o[a][1];l.updateHeight();const c=l.balanceFactor();if(c<-1||c>1){const u=o[a][0],d=o[a+1][0];if(u===1&&d===1)o[a][1]=l.rotateLeft();else if(u===-1&&d===-1)o[a][1]=l.rotateRight();else if(u===1&&d===-1)l.right=o[a+1][1]=o[a+1][1].rotateRight(),o[a][1]=l.rotateLeft();else if(u===-1&&d===1)l.left=o[a+1][1]=o[a+1][1].rotateLeft(),o[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(o[a-1][0]){case-1:o[a-1][1].left=o[a][1];break;case 1:o[a-1][1].right=o[a][1];break;case 0:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}return s}get(e){var t;return(t=this._getNode(e))===null||t===void 0?void 0:t.value}_getNode(e){const t=this._iter.reset(e);let n=this._root;for(;n;){const r=t.cmp(n.segment);if(r>0)n=n.left;else if(r<0)n=n.right;else if(t.hasNext())t.next(),n=n.mid;else break}return n}has(e){const t=this._getNode(e);return!((t==null?void 0:t.value)===void 0&&(t==null?void 0:t.mid)===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){var n;const r=this._iter.reset(e),o=[];let s=this._root;for(;s;){const a=r.cmp(s.segment);if(a>0)o.push([-1,s]),s=s.left;else if(a<0)o.push([1,s]),s=s.right;else if(r.hasNext())r.next(),o.push([0,s]),s=s.mid;else break}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 a=this._min(s.right);if(a.key){const{key:l,value:c,segment:u}=a;this._delete(a.key,!1),s.key=l,s.value=c,s.segment=u}}else{const a=(n=s.left)!==null&&n!==void 0?n:s.right;if(o.length>0){const[l,c]=o[o.length-1];switch(l){case-1:c.left=a;break;case 0:c.mid=a;break;case 1:c.right=a;break}}else this._root=a}for(let a=o.length-1;a>=0;a--){const l=o[a][1];l.updateHeight();const c=l.balanceFactor();if(c>1?(l.right.balanceFactor()>=0||(l.right=l.right.rotateRight()),o[a][1]=l.rotateLeft()):c<-1&&(l.left.balanceFactor()<=0||(l.left=l.left.rotateLeft()),o[a][1]=l.rotateRight()),a>0)switch(o[a-1][0]){case-1:o[a-1][1].left=o[a][1];break;case 1:o[a-1][1].right=o[a][1];break;case 0:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const t=this._iter.reset(e);let n=this._root,r;for(;n;){const o=t.cmp(n.segment);if(o>0)n=n.left;else if(o<0)n=n.right;else if(t.hasNext())t.next(),r=n.value||r,n=n.mid;else break}return n&&n.value||r}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const n=this._iter.reset(e);let r=this._root;for(;r;){const o=n.cmp(r.segment);if(o>0)r=r.left;else if(o<0)r=r.right;else if(n.hasNext())n.next(),r=r.mid;else return r.mid?this._entries(r.mid):t?r.value:void 0}}forEach(e){for(const[t,n]of this)e(n,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){const t=[];return this._dfsEntries(e,t),t[Symbol.iterator]()}_dfsEntries(e,t){e&&(e.left&&this._dfsEntries(e.left,t),e.value&&t.push([e.key,e.value]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}}const Pb=yn("contextService");function CV(i){const e=i;return typeof(e==null?void 0:e.id)=="string"&&At.isUri(e.uri)}function EGe(i){const e=i;return typeof(e==null?void 0:e.id)=="string"&&!CV(i)&&!TGe(i)}const DGe={id:"ext-dev"},IGe={id:"empty-window"};function kGe(i,e){if(typeof i=="string"||typeof i>"u")return typeof i=="string"?{id:_v(i)}:e?DGe:IGe;const t=i;return t.configuration?{id:t.id,configPath:t.configuration}:t.folders.length===1?{id:t.id,uri:t.folders[0].uri}:{id:t.id}}function TGe(i){const e=i;return typeof(e==null?void 0:e.id)=="string"&&At.isUri(e.configPath)}class NGe{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}const yV="code-workspace";w("codeWorkspace","Code Workspace");const O_e="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function RGe(i){return i.id===O_e}var wV;(function(i){i.inspectTokensAction=w("inspectTokens","Developer: Inspect Tokens")})(wV||(wV={}));var TP;(function(i){i.gotoLineActionLabel=w("gotoLineActionLabel","Go to Line/Column...")})(TP||(TP={}));var SV;(function(i){i.helpQuickAccessActionLabel=w("helpQuickAccess","Show all Quick Access Providers")})(SV||(SV={}));var NP;(function(i){i.quickCommandActionLabel=w("quickCommandActionLabel","Command Palette"),i.quickCommandHelp=w("quickCommandActionHelp","Show And Run Commands")})(NP||(NP={}));var oI;(function(i){i.quickOutlineActionLabel=w("quickOutlineActionLabel","Go to Symbol..."),i.quickOutlineByCategoryActionLabel=w("quickOutlineByCategoryActionLabel","Go to Symbol by Category...")})(oI||(oI={}));var RP;(function(i){i.editorViewAccessibleLabel=w("editorViewAccessibleLabel","Editor content"),i.accessibilityHelpMessage=w("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options.")})(RP||(RP={}));var xV;(function(i){i.toggleHighContrast=w("toggleHighContrast","Toggle High Contrast Theme")})(xV||(xV={}));var LV;(function(i){i.bulkEditServiceSummary=w("bulkEditServiceSummary","Made {0} edits in {1} files")})(LV||(LV={}));const F_e=yn("workspaceTrustManagementService");var xs;(function(i){function e(o,s){if(o.start>=s.end||s.start>=o.end)return{start:0,end:0};const a=Math.max(o.start,s.start),l=Math.min(o.end,s.end);return l-a<=0?{start:0,end:0}:{start:a,end:l}}i.intersect=e;function t(o){return o.end-o.start<=0}i.isEmpty=t;function n(o,s){return!t(e(o,s))}i.intersects=n;function r(o,s){const a=[],l={start:o.start,end:Math.min(s.start,o.end)},c={start:Math.max(s.end,o.start),end:o.end};return t(l)||a.push(l),t(c)||a.push(c),a}i.relativeComplement=r})(xs||(xs={}));function MGe(i){const e=i;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var Qm;(function(i){i[i.AVOID=0]="AVOID",i[i.ALIGN=1]="ALIGN"})(Qm||(Qm={}));function py(i,e,t){const n=t.mode===Qm.ALIGN?t.offset:t.offset+t.size,r=t.mode===Qm.ALIGN?t.offset+t.size:t.offset;return t.position===0?e<=i-n?n:e<=r?r-e:Math.max(i-e,0):e<=r?r-e:e<=i-n?n:0}class zw extends fe{constructor(e,t){super(),this.container=null,this.useFixedPosition=!1,this.useShadowDOM=!1,this.delegate=null,this.toDisposeOnClean=fe.None,this.toDisposeOnSetContainer=fe.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=He(".context-view"),fa(this.view),this.setContainer(e,t),this._register(Rt(()=>this.setContainer(null,1)))}setContainer(e,t){var n;this.useFixedPosition=t!==1;const r=this.useShadowDOM;if(this.useShadowDOM=t===3,!(e===this.container&&r===this.useShadowDOM)&&(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,(n=this.shadowRootHostElement)===null||n===void 0||n.remove(),this.shadowRootHostElement=null):this.container.removeChild(this.view),this.container=null),e)){if(this.container=e,this.useShadowDOM){this.shadowRootHostElement=He(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const s=document.createElement("style");s.textContent=AGe,this.shadowRoot.appendChild(s),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(He("slot"))}else this.container.appendChild(this.view);const o=new Te;zw.BUBBLE_UP_EVENTS.forEach(s=>{o.add(Sr(this.container,s,a=>{this.onDOMEvent(a,!1)}))}),zw.BUBBLE_DOWN_EVENTS.forEach(s=>{o.add(Sr(this.container,s,a=>{this.onDOMEvent(a,!0)},!0))}),this.toDisposeOnSetContainer=o}}show(e){var t,n;this.isVisible()&&this.hide(),Ns(this.view),this.view.className="context-view",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex="2575",this.view.style.position=this.useFixedPosition?"fixed":"absolute",bl(this.view),this.toDisposeOnClean=e.render(this.view)||fe.None,this.delegate=e,this.doLayout(),(n=(t=this.delegate).focus)===null||n===void 0||n.call(t)}getViewElement(){return this.view}layout(){var e,t;if(this.isVisible()){if(this.delegate.canRelayout===!1&&!(ch&&yq.pointerEvents)){this.hide();return}(t=(e=this.delegate)===null||e===void 0?void 0:e.layout)===null||t===void 0||t.call(e),this.doLayout()}}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(e instanceof HTMLElement){const h=Br(e),f=ime(e);t={top:h.top*f,left:h.left*f,width:h.width*f,height:h.height*f}}else MGe(e)?t={top:e.y,left:e.x,width:e.width||1,height:e.height||2}:t={top:e.posy,left:e.posx,width:2,height:2};const n=ua(this.view),r=qg(this.view),o=this.delegate.anchorPosition||0,s=this.delegate.anchorAlignment||0,a=this.delegate.anchorAxisAlignment||0;let l,c;const u=QBe();if(a===0){const h={offset:t.top-u.pageYOffset,size:t.height,position:o===0?0:1},f={offset:t.left,size:t.width,position:s===0?0:1,mode:Qm.ALIGN};l=py(u.innerHeight,r,h)+u.pageYOffset,xs.intersects({start:l,end:l+r},{start:h.offset,end:h.offset+h.size})&&(f.mode=Qm.AVOID),c=py(u.innerWidth,n,f)}else{const h={offset:t.left,size:t.width,position:s===0?0:1},f={offset:t.top,size:t.height,position:o===0?0:1,mode:Qm.ALIGN};c=py(u.innerWidth,n,h),xs.intersects({start:c,end:c+n},{start:h.offset,end:h.offset+h.size})&&(f.mode=Qm.AVOID),l=py(u.innerHeight,r,f)+u.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(o===0?"bottom":"top"),this.view.classList.add(s===0?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const d=Br(this.container);this.view.style.top=`${l-(this.useFixedPosition?Br(this.view).top:d.top)}px`,this.view.style.left=`${c-(this.useFixedPosition?Br(this.view).left:d.left)}px`,this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,t!=null&&t.onHide&&t.onHide(e),this.toDisposeOnClean.dispose(),fa(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,Pt(e).document.activeElement):t&&!es(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}zw.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"];zw.BUBBLE_DOWN_EVENTS=["click"];const AGe=` :host { all: initial; /* 1st rule so subsequent properties are reset. */ } @@ -300,7 +300,7 @@ ${e}`)}function KKe(i){return k_(i,"`")}function GKe(i){return k_(i,"*")}functio :host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; } :host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; } :host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; } -`;var PGe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},OGe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let EV=class extends fe{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=fe.None,this.contextView=this._register(new zw(this.layoutService.mainContainer,1)),this.layout(),this._register(e.onDidLayoutContainer(()=>this.layout()))}showContextView(e,t,n){let r;t?t===this.layoutService.getContainer(Pt(t))?r=1:n?r=3:r=2:r=1,this.contextView.setContainer(t??this.layoutService.activeContainer,r),this.contextView.show(e);const o=Rt(()=>{this.currentViewDisposable===o&&this.hideContextView()});return this.currentViewDisposable=o,o}getContextViewElement(){return this.contextView.getViewElement()}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e)}dispose(){super.dispose(),this.currentViewDisposable.dispose(),this.currentViewDisposable=fe.None}};EV=PGe([OGe(0,pC)],EV);let Uw=[],UX=[],B_e=[];function FR(i,e=!1){FGe(i,!1,e)}function FGe(i,e,t){const n=BGe(i,e);Uw.push(n),n.userConfigured?B_e.push(n):UX.push(n),t&&!n.userConfigured&&Uw.forEach(r=>{r.mime===n.mime||r.userConfigured||(n.extension&&r.extension===n.extension&&console.warn(`Overwriting extension <<${n.extension}>> to now point to mime <<${n.mime}>>`),n.filename&&r.filename===n.filename&&console.warn(`Overwriting filename <<${n.filename}>> to now point to mime <<${n.mime}>>`),n.filepattern&&r.filepattern===n.filepattern&&console.warn(`Overwriting filepattern <<${n.filepattern}>> to now point to mime <<${n.mime}>>`),n.firstline&&r.firstline===n.firstline&&console.warn(`Overwriting firstline <<${n.firstline}>> to now point to mime <<${n.mime}>>`))})}function BGe(i,e){return{id:i.id,mime:i.mime,filename:i.filename,extension:i.extension,filepattern:i.filepattern,firstline:i.firstline,userConfigured:e,filenameLowercase:i.filename?i.filename.toLowerCase():void 0,extensionLowercase:i.extension?i.extension.toLowerCase():void 0,filepatternLowercase:i.filepattern?__e(i.filepattern.toLowerCase()):void 0,filepatternOnPath:i.filepattern?i.filepattern.indexOf(oo.sep)>=0:!1}}function WGe(){Uw=Uw.filter(i=>i.userConfigured),UX=[]}function $Ge(i,e){return HGe(i,e).map(t=>t.id)}function HGe(i,e){let t;if(i)switch(i.scheme){case an.file:t=i.fsPath;break;case an.data:{t=Qv.parseMetaData(i).get(Qv.META_DATA_LABEL);break}case an.vscodeNotebookCell:t=void 0;break;default:t=i.path}if(!t)return[{id:"unknown",mime:Cr.unknown}];t=t.toLowerCase();const n=vv(t),r=Goe(t,n,B_e);if(r)return[r,{id:hc,mime:Cr.text}];const o=Goe(t,n,UX);if(o)return[o,{id:hc,mime:Cr.text}];if(e){const s=VGe(e);if(s)return[s,{id:hc,mime:Cr.text}]}return[{id:"unknown",mime:Cr.unknown}]}function Goe(i,e,t){var n;let r,o,s;for(let a=t.length-1;a>=0;a--){const l=t[a];if(e===l.filenameLowercase){r=l;break}if(l.filepattern&&(!o||l.filepattern.length>o.filepattern.length)){const c=l.filepatternOnPath?i:e;!((n=l.filepatternLowercase)===null||n===void 0)&&n.call(l,c)&&(o=l)}l.extension&&(!s||l.extension.length>s.extension.length)&&e.endsWith(l.extensionLowercase)&&(s=l)}if(r)return r;if(o)return o;if(s)return s}function VGe(i){if(Cq(i)&&(i=i.substr(1)),i.length>0)for(let e=Uw.length-1;e>=0;e--){const t=Uw[e];if(!t.firstline)continue;const n=i.match(t.firstline);if(n&&n.length>0)return t}}const BR=Object.prototype.hasOwnProperty,qoe="vs.editor.nullLanguage";class zGe{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(qoe,0),this._register(hc,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]||qoe}}class sI extends fe{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new se),this.onDidChange=this._onDidChange.event,sI.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new zGe,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(Iw.onDidChangeLanguages(n=>{this._initializeFromRegistry()})))}dispose(){sI.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},WGe();const e=[].concat(Iw.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach(t=>{const n=this._languages[t];n.name&&(this._nameMap[n.name]=n.identifier),n.aliases.forEach(r=>{this._lowercaseNameMap[r.toLowerCase()]=n.identifier}),n.mimetypes.forEach(r=>{this._mimeTypesMap[r]=n.identifier})}),ar.as(xh.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let n;BR.call(this._languages,t)?n=this._languages[t]:(this.languageIdCodec.register(t),n={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=n),this._mergeLanguage(n,e)}_mergeLanguage(e,t){const n=t.id;let r=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),r=t.mimetypes[0]),r||(r=`text/x-${n}`,e.mimetypes.push(r)),Array.isArray(t.extensions)){t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions);for(const a of t.extensions)FR({id:n,mime:r,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)FR({id:n,mime:r,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)FR({id:n,mime:r,filepattern:a},this._warnOnOverwrite);if(typeof t.firstLine=="string"&&t.firstLine.length>0){let a=t.firstLine;a.charAt(0)!=="^"&&(a="^"+a);try{const l=new RegExp(a);$5e(l)||FR({id:n,mime:r,firstline:l},this._warnOnOverwrite)}catch(l){console.warn(`[${t.id}]: Invalid regular expression \`${a}\`: `,l)}}e.aliases.push(n);let o=null;if(typeof t.aliases<"u"&&Array.isArray(t.aliases)&&(t.aliases.length===0?o=[null]:o=t.aliases),o!==null)for(const a of o)!a||a.length===0||e.aliases.push(a);const s=o!==null&&o.length>0;if(!(s&&o[0]===null)){const a=(s?o[0]:null)||n;(s||!e.name)&&(e.name=a)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return e?BR.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return BR.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&BR.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:$Ge(e,t)}}sI.instanceCount=0;class aI extends fe{constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new se),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new se),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new se({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,aI.instanceCount++,this._registry=this._register(new sI(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){aI.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 n=this._registry.guessLanguageIdByFilepathOrFirstLine(e,t);return JG(n,null)}createById(e){return new Xoe(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByFilepathOrFirstLine(e,t){return new Xoe(this.onDidChange,()=>{const n=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(n)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=hc),e}requestBasicLanguageFeatures(e){this._requestedBasicLanguages.has(e)||(this._requestedBasicLanguages.add(e),this._onDidRequestBasicLanguageFeatures.fire(e))}requestRichLanguageFeatures(e){this._requestedRichLanguages.has(e)||(this._requestedRichLanguages.add(e),this.requestBasicLanguageFeatures(e),hr.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}}aI.instanceCount=0;class Xoe{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 se({onDidRemoveLastListener:()=>{this._dispose()}})),this._emitter.event}_evaluate(){var e;const t=this._selector();t!==this.languageId&&(this.languageId=t,(e=this._emitter)===null||e===void 0||e.fire(this.languageId))}}const lI={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:Cr.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"},UGe=()=>({get delay(){return-1},dispose:()=>{},showHover:()=>{}});let e3=UGe;const jGe=new Qf(()=>e3("mouse",!1)),KGe=new Qf(()=>e3("element",!1));function GGe(i){e3=i}function Vp(i,e){return e?e3(i,!0):i==="element"?KGe.value:jGe.value}function qGe(i,e){Sa(e)?i.title=BX(e):e!=null&&e.markdownNotSupportedFallback?i.title=e.markdownNotSupportedFallback:i.removeAttribute("title")}class XGe{constructor(e,t,n){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=n}async update(e,t,n){var r;if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let o;if(e===void 0||Sa(e)||e instanceof HTMLElement)o=e;else if(!CD(e.markdown))o=(r=e.markdown)!==null&&r!==void 0?r:e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(w("iconLabel.loading","Loading..."),t),this._cancellationTokenSource=new wr;const s=this._cancellationTokenSource.token;if(o=await e.markdown(s),o===void 0&&(o=e.markdownNotSupportedFallback),this.isDisposed||s.isCancellationRequested)return}this.show(o,t,n)}show(e,t,n){const r=this._hoverWidget;if(this.hasContent(e)){const o={content:e,target:this.target,appearance:{showPointer:this.hoverDelegate.placement==="element",skipFadeInAnimation:!this.fadeInAnimation||!!r},position:{hoverPosition:2},...n};this._hoverWidget=this.hoverDelegate.showHover(o,t)}r==null||r.dispose()}hasContent(e){return e?Mf(e)?!!e.value:!0:!1}get isDisposed(){var e;return(e=this._hoverWidget)===null||e===void 0?void 0:e.isDisposed}dispose(){var e,t;(e=this._hoverWidget)===null||e===void 0||e.dispose(),(t=this._cancellationTokenSource)===null||t===void 0||t.dispose(!0),this._cancellationTokenSource=void 0}}function mC(i,e,t,n){let r,o;const s=(m,_)=>{var y;const S=o!==void 0;m&&(o==null||o.dispose(),o=void 0),_&&(r==null||r.dispose(),r=void 0),S&&((y=i.onDidHideHover)===null||y===void 0||y.call(i),o=void 0)},a=(m,_,y)=>new cd(async()=>{(!o||o.isDisposed)&&(o=new XGe(i,y||e,m>0),await o.update(typeof t=="function"?t():t,_,n))},m);let l=!1;const c=ye(e,Ge.MOUSE_DOWN,()=>{l=!0,s(!0,!0)},!0),u=ye(e,Ge.MOUSE_UP,()=>{l=!1},!0),d=ye(e,Ge.MOUSE_LEAVE,m=>{l=!1,s(!1,m.fromElement===e)},!0),h=()=>{if(r)return;const m=new Te,_={targetElements:[e],dispose:()=>{}};if(i.placement===void 0||i.placement==="mouse"){const y=S=>{_.x=S.x+10,S.target instanceof HTMLElement&&S.target.classList.contains("action-label")&&s(!0,!0)};m.add(ye(e,Ge.MOUSE_MOVE,y,!0))}m.add(a(i.delay,!1,_)),r=m},f=ye(e,Ge.MOUSE_OVER,h,!0),g=()=>{if(l||r)return;const m={targetElements:[e],dispose:()=>{}},_=new Te,y=()=>s(!0,!0);_.add(ye(e,Ge.BLUR,y,!0)),_.add(a(i.delay,!1,m)),r=_},p=ye(e,Ge.FOCUS,g,!0);return{show:m=>{s(!1,!0),a(0,m)},hide:()=>{s(!0,!0)},update:async(m,_)=>{t=m,await(o==null?void 0:o.update(t,void 0,_))},dispose:()=>{f.dispose(),d.dispose(),c.dispose(),u.dispose(),p.dispose(),s(!0,!0)}}}class YGe{constructor(e){this.spliceables=e}splice(e,t,n){this.spliceables.forEach(r=>r.splice(e,t,n))}}class i0 extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function Yoe(i,e){const t=[];for(const n of e){if(i.start>=n.range.end)continue;if(i.ende.concat(t),[]))}class JGe{get paddingTop(){return this._paddingTop}set paddingTop(e){this._size=this._size+e-this._paddingTop,this._paddingTop=e}constructor(e){this.groups=[],this._size=0,this._paddingTop=0,this._paddingTop=e??0,this._size=this._paddingTop}splice(e,t,n=[]){const r=n.length-t,o=Yoe({start:0,end:e},this.groups),s=Yoe({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:DV(l.range,r),size:l.size})),a=n.map((l,c)=>({range:{start:e+c,end:e+c+1},size:l.size}));this.groups=QGe(o,a,s),this._size=this._paddingTop+this.groups.reduce((l,c)=>l+c.size*(c.range.end-c.range.start),0)}get count(){const e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return-1;if(e{for(const n of e)this.getRenderer(t).disposeTemplate(n.templateData),n.templateData=null}),this.cache.clear(),this.transactionNodesPendingRemoval.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}var zp=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o};const r0={CurrentDragAndDropData:void 0},Vh={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(i){return[i]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class Yk{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class nqe{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class iqe{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;tr,e!=null&&e.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(t,n)=>n+1,e!=null&&e.getRole?this.getRole=e.getRole.bind(e):this.getRole=t=>"listitem",e!=null&&e.isChecked?this.isChecked=e.isChecked.bind(e):this.isChecked=t=>{}}}class pu{get contentHeight(){return this.rangeMap.size}get onDidScroll(){return this.scrollableElement.onScroll}get scrollableElementDomNode(){return this.scrollableElement.getDomNode()}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=e,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(const t of this.items)this.measureItemWidth(t);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:l6(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}constructor(e,t,n,r=Vh){var o,s,a,l,c,u,d,h,f,g,p,v,m;if(this.virtualDelegate=t,this.domId=`list_id_${++pu.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new nd(50),this.splicing=!1,this.dragOverAnimationStopDisposable=fe.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=fe.None,this.onDragLeaveTimeout=fe.None,this.disposables=new Te,this._onDidChangeContentHeight=new se,this._onDidChangeContentWidth=new se,this.onDidChangeContentHeight=Je.latch(this._onDidChangeContentHeight.event,void 0,this.disposables),this._horizontalScrolling=!1,r.horizontalScrolling&&r.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=this.createRangeMap((o=r.paddingTop)!==null&&o!==void 0?o:0);for(const y of n)this.renderers.set(y.templateId,y);this.cache=this.disposables.add(new tqe(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support",typeof r.mouseSupport=="boolean"?r.mouseSupport:!0),this._horizontalScrolling=(s=r.horizontalScrolling)!==null&&s!==void 0?s:Vh.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof r.paddingBottom>"u"?0:r.paddingBottom,this.accessibilityProvider=new oqe(r.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",((a=r.transformOptimization)!==null&&a!==void 0?a:Vh.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(wi.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new TS({forceIntegerValues:!0,smoothScrollDuration:(l=r.smoothScrolling)!==null&&l!==void 0&&l?125:0,scheduleAtNextAnimationFrame:y=>Il(Pt(this.domNode),y)})),this.scrollableElement=this.disposables.add(new O4(this.rowsContainer,{alwaysConsumeMouseWheel:(c=r.alwaysConsumeMouseWheel)!==null&&c!==void 0?c:Vh.alwaysConsumeMouseWheel,horizontal:1,vertical:(u=r.verticalScrollMode)!==null&&u!==void 0?u:Vh.verticalScrollMode,useShadows:(d=r.useShadows)!==null&&d!==void 0?d:Vh.useShadows,mouseWheelScrollSensitivity:r.mouseWheelScrollSensitivity,fastScrollSensitivity:r.fastScrollSensitivity,scrollByPage:r.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(ye(this.rowsContainer,Si.Change,y=>this.onTouchChange(y))),this.disposables.add(ye(this.scrollableElement.getDomNode(),"scroll",y=>y.target.scrollTop=0)),this.disposables.add(ye(this.domNode,"dragover",y=>this.onDragOver(this.toDragEvent(y)))),this.disposables.add(ye(this.domNode,"drop",y=>this.onDrop(this.toDragEvent(y)))),this.disposables.add(ye(this.domNode,"dragleave",y=>this.onDragLeave(this.toDragEvent(y)))),this.disposables.add(ye(this.domNode,"dragend",y=>this.onDragEnd(y))),this.setRowLineHeight=(h=r.setRowLineHeight)!==null&&h!==void 0?h:Vh.setRowLineHeight,this.setRowHeight=(f=r.setRowHeight)!==null&&f!==void 0?f:Vh.setRowHeight,this.supportDynamicHeights=(g=r.supportDynamicHeights)!==null&&g!==void 0?g:Vh.supportDynamicHeights,this.dnd=(p=r.dnd)!==null&&p!==void 0?p:this.disposables.add(Vh.dnd),this.layout((v=r.initialSize)===null||v===void 0?void 0:v.height,(m=r.initialSize)===null||m===void 0?void 0:m.width)}updateOptions(e){e.paddingBottom!==void 0&&(this.paddingBottom=e.paddingBottom,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),e.smoothScrolling!==void 0&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),e.horizontalScrolling!==void 0&&(this.horizontalScrolling=e.horizontalScrolling);let t;if(e.scrollByPage!==void 0&&(t={...t??{},scrollByPage:e.scrollByPage}),e.mouseWheelScrollSensitivity!==void 0&&(t={...t??{},mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity}),e.fastScrollSensitivity!==void 0&&(t={...t??{},fastScrollSensitivity:e.fastScrollSensitivity}),t&&this.scrollableElement.updateOptions(t),e.paddingTop!==void 0&&e.paddingTop!==this.rangeMap.paddingTop){const n=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),r=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(n,Math.max(0,this.lastRenderTop+r),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}createRangeMap(e){return new JGe(e)}splice(e,t,n=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,n)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,n=[]){const r=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),o={start:e,end:e+t},s=xs.intersect(r,o),a=new Map;for(let L=s.end-1;L>=s.start;L--){const E=this.items[L];if(E.dragStartDisposable.dispose(),E.checkedDisposable.dispose(),E.row){let D=a.get(E.templateId);D||(D=[],a.set(E.templateId,D));const k=this.renderers.get(E.templateId);k&&k.disposeElement&&k.disposeElement(E.element,L,E.row.templateData,E.size),D.push(E.row)}E.row=null,E.stale=!0}const l={start:e+t,end:this.items.length},c=xs.intersect(l,r),u=xs.relativeComplement(l,r),d=n.map(L=>({id:String(this.itemId++),element:L,templateId:this.virtualDelegate.getTemplateId(L),size:this.virtualDelegate.getHeight(L),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(L),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:fe.None,checkedDisposable:fe.None,stale:!1}));let h;e===0&&t>=this.items.length?(this.rangeMap=this.createRangeMap(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,d),h=this.items,this.items=d):(this.rangeMap.splice(e,t,d),h=this.items.splice(e,t,...d));const f=n.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),p=DV(c,f),v=xs.intersect(g,p);for(let L=v.start;LDV(L,f)),S=[{start:e,end:e+n.length},..._].map(L=>xs.intersect(g,L)).reverse();for(const L of S)for(let E=L.end-1;E>=L.start;E--){const D=this.items[E],k=a.get(D.templateId),T=k==null?void 0:k.pop();this.insertItemInDOM(E,T)}for(const L of a.values())for(const E of L)this.cache.release(E);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),h.map(L=>L.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=Il(Pt(this.domNode),()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null}))}eventuallyUpdateScrollWidth(){if(!this.horizontalScrolling){this.scrollableElementWidthDelayer.cancel();return}this.scrollableElementWidthDelayer.trigger(()=>this.updateScrollWidth())}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const t of this.items)typeof t.width<"u"&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:e===0?0:e+10}),this._onDidChangeContentWidth.fire(this.scrollWidth)}rerender(){if(this.supportDynamicHeights){for(const e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}get firstVisibleIndex(){return this.getRenderRange(this.lastRenderTop,this.lastRenderHeight).start}element(e){return this.items[e].element}indexOf(e){return this.items.findIndex(t=>t.element===e)}domElement(e){const t=this.items[e].row;return t&&t.domNode}elementHeight(e){return this.items[e].size}elementTop(e){return this.rangeMap.positionAt(e)}indexAt(e){return this.rangeMap.indexAt(e)}indexAfter(e){return this.rangeMap.indexAfter(e)}layout(e,t){const n={height:typeof e=="number"?e:YBe(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,n.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(n),typeof t<"u"&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:typeof t=="number"?t:l6(this.domNode)})}render(e,t,n,r,o,s=!1){const a=this.getRenderRange(t,n),l=xs.relativeComplement(a,e).reverse(),c=xs.relativeComplement(e,a);if(s){const u=xs.intersect(e,a);for(let d=u.start;d{for(const u of c)for(let d=u.start;d=u.start;d--)this.insertItemInDOM(d)}),r!==void 0&&(this.rowsContainer.style.left=`-${r}px`),this.rowsContainer.style.top=`-${t}px`,this.horizontalScrolling&&o!==void 0&&(this.rowsContainer.style.width=`${Math.max(o,this.renderWidth)}px`),this.lastRenderTop=t,this.lastRenderHeight=n}insertItemInDOM(e,t){var n,r,o;const s=this.items[e];if(!s.row)if(t)s.row=t,s.stale=!0;else{const d=this.cache.alloc(s.templateId);s.row=d.row,s.stale||(s.stale=d.isReusingConnectedDomNode)}const a=this.accessibilityProvider.getRole(s.element)||"listitem";s.row.domNode.setAttribute("role",a);const l=this.accessibilityProvider.isChecked(s.element);if(typeof l=="boolean")s.row.domNode.setAttribute("aria-checked",String(!!l));else if(l){const d=h=>s.row.domNode.setAttribute("aria-checked",String(!!h));d(l.value),s.checkedDisposable=l.onDidChange(d)}if(s.stale||!s.row.domNode.parentElement){const d=(o=(r=(n=this.items.at(e+1))===null||n===void 0?void 0:n.row)===null||r===void 0?void 0:r.domNode)!==null&&o!==void 0?o:null;this.rowsContainer.insertBefore(s.row.domNode,d),s.stale=!1}this.updateItemInDOM(s,e);const c=this.renderers.get(s.templateId);if(!c)throw new Error(`No renderer found for template id ${s.templateId}`);c==null||c.renderElement(s.element,e,s.row.templateData,s.size);const u=this.dnd.getDragURI(s.element);s.dragStartDisposable.dispose(),s.row.domNode.draggable=!!u,u&&(s.dragStartDisposable=ye(s.row.domNode,"dragstart",d=>this.onDragStart(s.element,u,d))),this.horizontalScrolling&&(this.measureItemWidth(s),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=l6(e.row.domNode);const t=Pt(e.row.domNode).getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${t}`),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("data-parity",t%2===0?"even":"odd"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e){const t=this.items[e];if(t.dragStartDisposable.dispose(),t.checkedDisposable.dispose(),t.row){const n=this.renderers.get(t.templateId);n&&n.disposeElement&&n.disposeElement(t.element,e,t.row.templateData,t.size),this.cache.release(t.row),t.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,t){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:t})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.paddingBottom}get onMouseClick(){return Je.map(this.disposables.add(new wn(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return Je.map(this.disposables.add(new wn(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return Je.filter(Je.map(this.disposables.add(new wn(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseDown(){return Je.map(this.disposables.add(new wn(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return Je.map(this.disposables.add(new wn(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return Je.map(this.disposables.add(new wn(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return Je.any(Je.map(this.disposables.add(new wn(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),Je.map(this.disposables.add(new wn(this.domNode,Si.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return Je.map(this.disposables.add(new wn(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return Je.map(this.disposables.add(new wn(this.rowsContainer,Si.Tap)).event,e=>this.toGestureEvent(e),this.disposables)}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),n=typeof t>"u"?void 0:this.items[t],r=n&&n.element;return{browserEvent:e,index:t,element:r}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),n=typeof t>"u"?void 0:this.items[t],r=n&&n.element;return{browserEvent:e,index:t,element:r}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),n=typeof t>"u"?void 0:this.items[t],r=n&&n.element;return{browserEvent:e,index:t,element:r}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),n=typeof t>"u"?void 0:this.items[t],r=n&&n.element,o=this.getTargetSector(e,t);return{browserEvent:e,index:t,element:r,sector:o}}onScroll(e){try{const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(t){throw console.error("Got bad scroll event:",e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,n){var r,o;if(!n.dataTransfer)return;const s=this.dnd.getDragElements(e);if(n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setData(lI.TEXT,t),n.dataTransfer.setDragImage){let a;this.dnd.getDragLabel&&(a=this.dnd.getDragLabel(s,n)),typeof a>"u"&&(a=String(s.length));const l=He(".monaco-drag-image");l.textContent=a;const u=(d=>{for(;d&&!d.classList.contains("monaco-workbench");)d=d.parentElement;return d||this.domNode.ownerDocument})(this.domNode);u.appendChild(l),n.dataTransfer.setDragImage(l,-10,-10),setTimeout(()=>u.removeChild(l),0)}this.domNode.classList.add("dragging"),this.currentDragData=new Yk(s),r0.CurrentDragAndDropData=new nqe(s),(o=(r=this.dnd).onDragStart)===null||o===void 0||o.call(r,this.currentDragData,n)}onDragOver(e){var t,n;if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),r0.CurrentDragAndDropData&&r0.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(r0.CurrentDragAndDropData)this.currentDragData=r0.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new iqe}const r=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.sector,e.browserEvent);if(this.canDrop=typeof r=="boolean"?r:r.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect=typeof r!="boolean"&&((t=r.effect)===null||t===void 0?void 0:t.type)===0?"copy":"move";let o;typeof r!="boolean"&&r.feedback?o=r.feedback:typeof e.index>"u"?o=[-1]:o=[e.index],o=Lp(o).filter(a=>a>=-1&&aa-l),o=o[0]===-1?[-1]:o;let s=typeof r!="boolean"&&r.effect&&r.effect.position?r.effect.position:"drop-target";if(rqe(this.currentDragFeedback,o)&&this.currentDragFeedbackPosition===s)return!0;if(this.currentDragFeedback=o,this.currentDragFeedbackPosition=s,this.currentDragFeedbackDisposable.dispose(),o[0]===-1)this.domNode.classList.add(s),this.rowsContainer.classList.add(s),this.currentDragFeedbackDisposable=Rt(()=>{this.domNode.classList.remove(s),this.rowsContainer.classList.remove(s)});else{if(o.length>1&&s!=="drop-target")throw new Error("Can't use multiple feedbacks with position different than 'over'");s==="drop-target-after"&&o[0]{var a;for(const l of o){const c=this.items[l];c.dropTarget=!1,(a=c.row)===null||a===void 0||a.domNode.classList.remove(s)}})}return!0}onDragLeave(e){var t,n;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=Kv(()=>this.clearDragOverFeedback(),100,this.disposables),this.currentDragData&&((n=(t=this.dnd).onDragLeave)===null||n===void 0||n.call(t,this.currentDragData,e.element,e.index,e.browserEvent))}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,r0.CurrentDragAndDropData=void 0,!(!t||!e.browserEvent.dataTransfer)&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.sector,e.browserEvent))}onDragEnd(e){var t,n;this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,r0.CurrentDragAndDropData=void 0,(n=(t=this.dnd).onDragEnd)===null||n===void 0||n.call(t,e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackPosition=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=fe.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=nme(this.domNode).top;this.dragOverAnimationDisposable=c8e(Pt(this.domNode),this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=Kv(()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)},1e3,this.disposables),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(this.dragOverMouseY===void 0)return;const t=this.dragOverMouseY-e,n=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>n&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-n))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getTargetSector(e,t){if(t===void 0)return;const n=e.offsetY/this.items[t].size,r=Math.floor(n/.25);return da(r,0,3)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let n=e;for(;n instanceof HTMLElement&&n!==this.rowsContainer&&t.contains(n);){const r=n.getAttribute("data-index");if(r){const o=Number(r);if(!isNaN(o))return o}n=n.parentElement}}getRenderRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}_rerender(e,t,n){const r=this.getRenderRange(e,t);let o,s;e===this.elementTop(r.start)?(o=r.start,s=0):r.end-r.start>1&&(o=r.start+1,s=this.elementTop(o)-e);let a=0;for(;;){const l=this.getRenderRange(e,t);let c=!1;for(let u=l.start;u=h.start;f--)this.insertItemInDOM(f);for(let h=l.start;h=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o};class sqe{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,n){const r=this.renderedElements.findIndex(o=>o.templateData===n);if(r>=0){const o=this.renderedElements[r];this.trait.unrender(n),o.index=t}else{const o={index:t,templateData:n};this.renderedElements.push(o)}this.trait.renderIndex(t,n)}splice(e,t,n){const r=[];for(const o of this.renderedElements)o.index=e+t&&r.push({index:o.index+n-t,templateData:o.templateData});this.renderedElements=r}renderIndexes(e){for(const{index:t,templateData:n}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,n)}disposeTemplate(e){const t=this.renderedElements.findIndex(n=>n.templateData===e);t<0||this.renderedElements.splice(t,1)}}let MP=class{get name(){return this._trait}get renderer(){return new sqe(this)}constructor(e){this._trait=e,this.indexes=[],this.sortedIndexes=[],this._onChange=new se,this.onChange=this._onChange.event}splice(e,t,n){const r=n.length-t,o=e+t,s=[];let a=0;for(;a=o;)s.push(this.sortedIndexes[a++]+r);this.renderer.splice(e,t,n.length),this._set(s,s)}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(Qoe),t)}_set(e,t,n){const r=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const s=IV(o,e);return this.renderer.renderIndexes(s),this._onChange.fire({indexes:e,browserEvent:n}),r}get(){return this.indexes}contains(e){return _D(this.sortedIndexes,e,Qoe)>=0}dispose(){si(this._onChange)}};N_([Rr],MP.prototype,"renderer",null);class aqe extends MP{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 a9{constructor(e,t,n){this.trait=e,this.view=t,this.identityProvider=n}splice(e,t,n){if(!this.identityProvider)return this.trait.splice(e,t,new Array(n.length).fill(!1));const r=this.trait.get().map(a=>this.identityProvider.getId(this.view.element(a)).toString());if(r.length===0)return this.trait.splice(e,t,new Array(n.length).fill(!1));const o=new Set(r),s=n.map(a=>o.has(this.identityProvider.getId(a).toString()));this.trait.splice(e,t,s)}}function xv(i){return i.tagName==="INPUT"||i.tagName==="TEXTAREA"}function Zk(i,e){return i.classList.contains(e)?!0:i.classList.contains("monaco-list")||!i.parentElement?!1:Zk(i.parentElement,e)}function FL(i){return Zk(i,"monaco-editor")}function lqe(i){return Zk(i,"monaco-custom-toggle")}function cqe(i){return Zk(i,"action-item")}function IE(i){return Zk(i,"monaco-tree-sticky-row")}function AP(i){return i.classList.contains("monaco-tree-sticky-container")}function W_e(i){return i.tagName==="A"&&i.classList.contains("monaco-button")||i.tagName==="DIV"&&i.classList.contains("monaco-button-dropdown")?!0:i.classList.contains("monaco-list")||!i.parentElement?!1:W_e(i.parentElement)}class $_e{get onKeyDown(){return Je.chain(this.disposables.add(new wn(this.view.domNode,"keydown")).event,e=>e.filter(t=>!xv(t.target)).map(t=>new Ai(t)))}constructor(e,t,n){this.list=e,this.view=t,this.disposables=new Te,this.multipleSelectionDisposables=new Te,this.multipleSelectionSupport=n.multipleSelectionSupport,this.disposables.add(this.onKeyDown(r=>{switch(r.keyCode){case 3:return this.onEnter(r);case 16:return this.onUpArrow(r);case 18:return this.onDownArrow(r);case 11:return this.onPageUpArrow(r);case 12:return this.onPageDownArrow(r);case 9:return this.onEscape(r);case 31:this.multipleSelectionSupport&&(Ln?r.metaKey:r.ctrlKey)&&this.onCtrlA(r)}}))}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionSupport=e.multipleSelectionSupport)}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(la(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()}}N_([Rr],$_e.prototype,"onKeyDown",null);var pf;(function(i){i[i.Automatic=0]="Automatic",i[i.Trigger=1]="Trigger"})(pf||(pf={}));var my;(function(i){i[i.Idle=0]="Idle",i[i.Typing=1]="Typing"})(my||(my={}));const uqe=new class{mightProducePrintableCharacter(i){return i.ctrlKey||i.metaKey||i.altKey?!1:i.keyCode>=31&&i.keyCode<=56||i.keyCode>=21&&i.keyCode<=30||i.keyCode>=98&&i.keyCode<=107||i.keyCode>=85&&i.keyCode<=95}};class dqe{constructor(e,t,n,r,o){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=n,this.keyboardNavigationEventFilter=r,this.delegate=o,this.enabled=!1,this.state=my.Idle,this.mode=pf.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new Te,this.disposables=new Te,this.updateOptions(e.options)}updateOptions(e){var t,n;!((t=e.typeNavigationEnabled)!==null&&t!==void 0)||t?this.enable():this.disable(),this.mode=(n=e.typeNavigationMode)!==null&&n!==void 0?n:pf.Automatic}enable(){if(this.enabled)return;let e=!1;const t=Je.chain(this.enabledDisposables.add(new wn(this.view.domNode,"keydown")).event,o=>o.filter(s=>!xv(s.target)).filter(()=>this.mode===pf.Automatic||this.triggered).map(s=>new Ai(s)).filter(s=>e||this.keyboardNavigationEventFilter(s)).filter(s=>this.delegate.mightProducePrintableCharacter(s)).forEach(s=>hn.stop(s,!0)).map(s=>s.browserEvent.key)),n=Je.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);Je.reduce(Je.any(t,n),(o,s)=>s===null?null:(o||"")+s,void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),n(this.onClear,this,this.enabledDisposables),t(()=>e=!0,void 0,this.enabledDisposables),n(()=>e=!1,void 0,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){var e;const t=this.list.getFocus();if(t.length>0&&t[0]===this.previouslyFocused){const n=(e=this.list.options.accessibilityProvider)===null||e===void 0?void 0:e.getAriaLabel(this.list.element(t[0]));n&&kl(n)}this.previouslyFocused=-1}onInput(e){if(!e){this.state=my.Idle,this.triggered=!1;return}const t=this.list.getFocus(),n=t.length>0?t[0]:0,r=this.state===my.Idle?1:0;this.state=my.Typing;for(let o=0;o1&&c.length===1){this.previouslyFocused=n,this.list.setFocus([s]),this.list.reveal(s);return}}}else if(typeof l>"u"||iI(e,l)){this.previouslyFocused=n,this.list.setFocus([s]),this.list.reveal(s);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class hqe{constructor(e,t){this.list=e,this.view=t,this.disposables=new Te;const n=Je.chain(this.disposables.add(new wn(t.domNode,"keydown")).event,o=>o.filter(s=>!xv(s.target)).map(s=>new Ai(s)));Je.chain(n,o=>o.filter(s=>s.keyCode===2&&!s.ctrlKey&&!s.metaKey&&!s.shiftKey&&!s.altKey))(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(t.length===0)return;const n=this.view.domElement(t[0]);if(!n)return;const r=n.querySelector("[tabIndex]");if(!r||!(r instanceof HTMLElement)||r.tabIndex===-1)return;const o=Pt(r).getComputedStyle(r);o.visibility==="hidden"||o.display==="none"||(e.preventDefault(),e.stopPropagation(),r.focus())}dispose(){this.disposables.dispose()}}function H_e(i){return Ln?i.browserEvent.metaKey:i.browserEvent.ctrlKey}function V_e(i){return i.browserEvent.shiftKey}function fqe(i){return Iq(i)&&i.button===2}const Zoe={isSelectionSingleChangeEvent:H_e,isSelectionRangeChangeEvent:V_e};class z_e{constructor(e){this.list=e,this.disposables=new Te,this._onPointer=new se,this.onPointer=this._onPointer.event,e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||Zoe),this.mouseSupport=typeof e.options.mouseSupport>"u"||!!e.options.mouseSupport,this.mouseSupport&&(e.onMouseDown(this.onMouseDown,this,this.disposables),e.onContextMenu(this.onContextMenu,this,this.disposables),e.onMouseDblClick(this.onDoubleClick,this,this.disposables),e.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(wi.addTarget(e.getHTMLElement()))),Je.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||Zoe))}isSelectionSingleChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionSingleChangeEvent(e):!1}isSelectionRangeChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionRangeChangeEvent(e):!1}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){FL(e.browserEvent.target)||fs()!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(xv(e.browserEvent.target)||FL(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||xv(e.browserEvent.target)||FL(e.browserEvent.target)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=e.index;if(typeof t>"u"){this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0);return}if(this.isSelectionChangeEvent(e))return this.changeSelection(e);this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),fqe(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(xv(e.browserEvent.target)||FL(e.browserEvent.target)||this.isSelectionChangeEvent(e)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e){const t=e.index;let n=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){if(typeof n>"u"){const u=this.list.getFocus()[0];n=u??t,this.list.setAnchor(n)}const r=Math.min(n,t),o=Math.max(n,t),s=la(r,o+1),a=this.list.getSelection(),l=mqe(IV(a,[n]),n);if(l.length===0)return;const c=IV(s,vqe(a,l));this.list.setSelection(c,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const r=this.list.getSelection(),o=r.filter(s=>s!==t);this.list.setFocus([t]),this.list.setAnchor(t),r.length===o.length?this.list.setSelection([...o,t],e.browserEvent):this.list.setSelection(o,e.browserEvent)}}dispose(){this.disposables.dispose()}}class U_e{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){var t,n;const r=this.selectorSuffix&&`.${this.selectorSuffix}`,o=[];e.listBackground&&o.push(`.monaco-list${r} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(o.push(`.monaco-list${r}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),o.push(`.monaco-list${r}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&o.push(`.monaco-list${r}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(o.push(`.monaco-list${r}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),o.push(`.monaco-list${r}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&o.push(`.monaco-list${r}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&o.push(`.monaco-list${r}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&o.push(` +`;var PGe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},OGe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let EV=class extends fe{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=fe.None,this.contextView=this._register(new zw(this.layoutService.mainContainer,1)),this.layout(),this._register(e.onDidLayoutContainer(()=>this.layout()))}showContextView(e,t,n){let r;t?t===this.layoutService.getContainer(Pt(t))?r=1:n?r=3:r=2:r=1,this.contextView.setContainer(t??this.layoutService.activeContainer,r),this.contextView.show(e);const o=Rt(()=>{this.currentViewDisposable===o&&this.hideContextView()});return this.currentViewDisposable=o,o}getContextViewElement(){return this.contextView.getViewElement()}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e)}dispose(){super.dispose(),this.currentViewDisposable.dispose(),this.currentViewDisposable=fe.None}};EV=PGe([OGe(0,pC)],EV);let Uw=[],UX=[],B_e=[];function FR(i,e=!1){FGe(i,!1,e)}function FGe(i,e,t){const n=BGe(i,e);Uw.push(n),n.userConfigured?B_e.push(n):UX.push(n),t&&!n.userConfigured&&Uw.forEach(r=>{r.mime===n.mime||r.userConfigured||(n.extension&&r.extension===n.extension&&console.warn(`Overwriting extension <<${n.extension}>> to now point to mime <<${n.mime}>>`),n.filename&&r.filename===n.filename&&console.warn(`Overwriting filename <<${n.filename}>> to now point to mime <<${n.mime}>>`),n.filepattern&&r.filepattern===n.filepattern&&console.warn(`Overwriting filepattern <<${n.filepattern}>> to now point to mime <<${n.mime}>>`),n.firstline&&r.firstline===n.firstline&&console.warn(`Overwriting firstline <<${n.firstline}>> to now point to mime <<${n.mime}>>`))})}function BGe(i,e){return{id:i.id,mime:i.mime,filename:i.filename,extension:i.extension,filepattern:i.filepattern,firstline:i.firstline,userConfigured:e,filenameLowercase:i.filename?i.filename.toLowerCase():void 0,extensionLowercase:i.extension?i.extension.toLowerCase():void 0,filepatternLowercase:i.filepattern?__e(i.filepattern.toLowerCase()):void 0,filepatternOnPath:i.filepattern?i.filepattern.indexOf(oo.sep)>=0:!1}}function WGe(){Uw=Uw.filter(i=>i.userConfigured),UX=[]}function $Ge(i,e){return HGe(i,e).map(t=>t.id)}function HGe(i,e){let t;if(i)switch(i.scheme){case an.file:t=i.fsPath;break;case an.data:{t=Zv.parseMetaData(i).get(Zv.META_DATA_LABEL);break}case an.vscodeNotebookCell:t=void 0;break;default:t=i.path}if(!t)return[{id:"unknown",mime:Cr.unknown}];t=t.toLowerCase();const n=_v(t),r=Goe(t,n,B_e);if(r)return[r,{id:hc,mime:Cr.text}];const o=Goe(t,n,UX);if(o)return[o,{id:hc,mime:Cr.text}];if(e){const s=VGe(e);if(s)return[s,{id:hc,mime:Cr.text}]}return[{id:"unknown",mime:Cr.unknown}]}function Goe(i,e,t){var n;let r,o,s;for(let a=t.length-1;a>=0;a--){const l=t[a];if(e===l.filenameLowercase){r=l;break}if(l.filepattern&&(!o||l.filepattern.length>o.filepattern.length)){const c=l.filepatternOnPath?i:e;!((n=l.filepatternLowercase)===null||n===void 0)&&n.call(l,c)&&(o=l)}l.extension&&(!s||l.extension.length>s.extension.length)&&e.endsWith(l.extensionLowercase)&&(s=l)}if(r)return r;if(o)return o;if(s)return s}function VGe(i){if(Cq(i)&&(i=i.substr(1)),i.length>0)for(let e=Uw.length-1;e>=0;e--){const t=Uw[e];if(!t.firstline)continue;const n=i.match(t.firstline);if(n&&n.length>0)return t}}const BR=Object.prototype.hasOwnProperty,qoe="vs.editor.nullLanguage";class zGe{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(qoe,0),this._register(hc,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]||qoe}}class sI extends fe{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new se),this.onDidChange=this._onDidChange.event,sI.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new zGe,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(Iw.onDidChangeLanguages(n=>{this._initializeFromRegistry()})))}dispose(){sI.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},WGe();const e=[].concat(Iw.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach(t=>{const n=this._languages[t];n.name&&(this._nameMap[n.name]=n.identifier),n.aliases.forEach(r=>{this._lowercaseNameMap[r.toLowerCase()]=n.identifier}),n.mimetypes.forEach(r=>{this._mimeTypesMap[r]=n.identifier})}),ar.as(xh.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let n;BR.call(this._languages,t)?n=this._languages[t]:(this.languageIdCodec.register(t),n={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=n),this._mergeLanguage(n,e)}_mergeLanguage(e,t){const n=t.id;let r=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),r=t.mimetypes[0]),r||(r=`text/x-${n}`,e.mimetypes.push(r)),Array.isArray(t.extensions)){t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions);for(const a of t.extensions)FR({id:n,mime:r,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)FR({id:n,mime:r,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)FR({id:n,mime:r,filepattern:a},this._warnOnOverwrite);if(typeof t.firstLine=="string"&&t.firstLine.length>0){let a=t.firstLine;a.charAt(0)!=="^"&&(a="^"+a);try{const l=new RegExp(a);$5e(l)||FR({id:n,mime:r,firstline:l},this._warnOnOverwrite)}catch(l){console.warn(`[${t.id}]: Invalid regular expression \`${a}\`: `,l)}}e.aliases.push(n);let o=null;if(typeof t.aliases<"u"&&Array.isArray(t.aliases)&&(t.aliases.length===0?o=[null]:o=t.aliases),o!==null)for(const a of o)!a||a.length===0||e.aliases.push(a);const s=o!==null&&o.length>0;if(!(s&&o[0]===null)){const a=(s?o[0]:null)||n;(s||!e.name)&&(e.name=a)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return e?BR.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return BR.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&BR.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:$Ge(e,t)}}sI.instanceCount=0;class aI extends fe{constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new se),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new se),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new se({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,aI.instanceCount++,this._registry=this._register(new sI(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){aI.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 n=this._registry.guessLanguageIdByFilepathOrFirstLine(e,t);return JG(n,null)}createById(e){return new Xoe(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByFilepathOrFirstLine(e,t){return new Xoe(this.onDidChange,()=>{const n=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(n)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=hc),e}requestBasicLanguageFeatures(e){this._requestedBasicLanguages.has(e)||(this._requestedBasicLanguages.add(e),this._onDidRequestBasicLanguageFeatures.fire(e))}requestRichLanguageFeatures(e){this._requestedRichLanguages.has(e)||(this._requestedRichLanguages.add(e),this.requestBasicLanguageFeatures(e),hr.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}}aI.instanceCount=0;class Xoe{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 se({onDidRemoveLastListener:()=>{this._dispose()}})),this._emitter.event}_evaluate(){var e;const t=this._selector();t!==this.languageId&&(this.languageId=t,(e=this._emitter)===null||e===void 0||e.fire(this.languageId))}}const lI={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:Cr.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"},UGe=()=>({get delay(){return-1},dispose:()=>{},showHover:()=>{}});let e3=UGe;const jGe=new Qf(()=>e3("mouse",!1)),KGe=new Qf(()=>e3("element",!1));function GGe(i){e3=i}function zp(i,e){return e?e3(i,!0):i==="element"?KGe.value:jGe.value}function qGe(i,e){Sa(e)?i.title=BX(e):e!=null&&e.markdownNotSupportedFallback?i.title=e.markdownNotSupportedFallback:i.removeAttribute("title")}class XGe{constructor(e,t,n){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=n}async update(e,t,n){var r;if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let o;if(e===void 0||Sa(e)||e instanceof HTMLElement)o=e;else if(!CD(e.markdown))o=(r=e.markdown)!==null&&r!==void 0?r:e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(w("iconLabel.loading","Loading..."),t),this._cancellationTokenSource=new wr;const s=this._cancellationTokenSource.token;if(o=await e.markdown(s),o===void 0&&(o=e.markdownNotSupportedFallback),this.isDisposed||s.isCancellationRequested)return}this.show(o,t,n)}show(e,t,n){const r=this._hoverWidget;if(this.hasContent(e)){const o={content:e,target:this.target,appearance:{showPointer:this.hoverDelegate.placement==="element",skipFadeInAnimation:!this.fadeInAnimation||!!r},position:{hoverPosition:2},...n};this._hoverWidget=this.hoverDelegate.showHover(o,t)}r==null||r.dispose()}hasContent(e){return e?Mf(e)?!!e.value:!0:!1}get isDisposed(){var e;return(e=this._hoverWidget)===null||e===void 0?void 0:e.isDisposed}dispose(){var e,t;(e=this._hoverWidget)===null||e===void 0||e.dispose(),(t=this._cancellationTokenSource)===null||t===void 0||t.dispose(!0),this._cancellationTokenSource=void 0}}function mC(i,e,t,n){let r,o;const s=(m,_)=>{var y;const S=o!==void 0;m&&(o==null||o.dispose(),o=void 0),_&&(r==null||r.dispose(),r=void 0),S&&((y=i.onDidHideHover)===null||y===void 0||y.call(i),o=void 0)},a=(m,_,y)=>new cd(async()=>{(!o||o.isDisposed)&&(o=new XGe(i,y||e,m>0),await o.update(typeof t=="function"?t():t,_,n))},m);let l=!1;const c=ye(e,Ge.MOUSE_DOWN,()=>{l=!0,s(!0,!0)},!0),u=ye(e,Ge.MOUSE_UP,()=>{l=!1},!0),d=ye(e,Ge.MOUSE_LEAVE,m=>{l=!1,s(!1,m.fromElement===e)},!0),h=()=>{if(r)return;const m=new Te,_={targetElements:[e],dispose:()=>{}};if(i.placement===void 0||i.placement==="mouse"){const y=S=>{_.x=S.x+10,S.target instanceof HTMLElement&&S.target.classList.contains("action-label")&&s(!0,!0)};m.add(ye(e,Ge.MOUSE_MOVE,y,!0))}m.add(a(i.delay,!1,_)),r=m},f=ye(e,Ge.MOUSE_OVER,h,!0),g=()=>{if(l||r)return;const m={targetElements:[e],dispose:()=>{}},_=new Te,y=()=>s(!0,!0);_.add(ye(e,Ge.BLUR,y,!0)),_.add(a(i.delay,!1,m)),r=_},p=ye(e,Ge.FOCUS,g,!0);return{show:m=>{s(!1,!0),a(0,m)},hide:()=>{s(!0,!0)},update:async(m,_)=>{t=m,await(o==null?void 0:o.update(t,void 0,_))},dispose:()=>{f.dispose(),d.dispose(),c.dispose(),u.dispose(),p.dispose(),s(!0,!0)}}}class YGe{constructor(e){this.spliceables=e}splice(e,t,n){this.spliceables.forEach(r=>r.splice(e,t,n))}}class n0 extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function Yoe(i,e){const t=[];for(const n of e){if(i.start>=n.range.end)continue;if(i.ende.concat(t),[]))}class JGe{get paddingTop(){return this._paddingTop}set paddingTop(e){this._size=this._size+e-this._paddingTop,this._paddingTop=e}constructor(e){this.groups=[],this._size=0,this._paddingTop=0,this._paddingTop=e??0,this._size=this._paddingTop}splice(e,t,n=[]){const r=n.length-t,o=Yoe({start:0,end:e},this.groups),s=Yoe({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:DV(l.range,r),size:l.size})),a=n.map((l,c)=>({range:{start:e+c,end:e+c+1},size:l.size}));this.groups=QGe(o,a,s),this._size=this._paddingTop+this.groups.reduce((l,c)=>l+c.size*(c.range.end-c.range.start),0)}get count(){const e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return-1;if(e{for(const n of e)this.getRenderer(t).disposeTemplate(n.templateData),n.templateData=null}),this.cache.clear(),this.transactionNodesPendingRemoval.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}var Up=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o};const i0={CurrentDragAndDropData:void 0},Vh={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(i){return[i]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class Yk{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class nqe{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class iqe{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;tr,e!=null&&e.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(t,n)=>n+1,e!=null&&e.getRole?this.getRole=e.getRole.bind(e):this.getRole=t=>"listitem",e!=null&&e.isChecked?this.isChecked=e.isChecked.bind(e):this.isChecked=t=>{}}}class pu{get contentHeight(){return this.rangeMap.size}get onDidScroll(){return this.scrollableElement.onScroll}get scrollableElementDomNode(){return this.scrollableElement.getDomNode()}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=e,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(const t of this.items)this.measureItemWidth(t);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:l6(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}constructor(e,t,n,r=Vh){var o,s,a,l,c,u,d,h,f,g,p,v,m;if(this.virtualDelegate=t,this.domId=`list_id_${++pu.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new nd(50),this.splicing=!1,this.dragOverAnimationStopDisposable=fe.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=fe.None,this.onDragLeaveTimeout=fe.None,this.disposables=new Te,this._onDidChangeContentHeight=new se,this._onDidChangeContentWidth=new se,this.onDidChangeContentHeight=Je.latch(this._onDidChangeContentHeight.event,void 0,this.disposables),this._horizontalScrolling=!1,r.horizontalScrolling&&r.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=this.createRangeMap((o=r.paddingTop)!==null&&o!==void 0?o:0);for(const y of n)this.renderers.set(y.templateId,y);this.cache=this.disposables.add(new tqe(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support",typeof r.mouseSupport=="boolean"?r.mouseSupport:!0),this._horizontalScrolling=(s=r.horizontalScrolling)!==null&&s!==void 0?s:Vh.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof r.paddingBottom>"u"?0:r.paddingBottom,this.accessibilityProvider=new oqe(r.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",((a=r.transformOptimization)!==null&&a!==void 0?a:Vh.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(wi.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new TS({forceIntegerValues:!0,smoothScrollDuration:(l=r.smoothScrolling)!==null&&l!==void 0&&l?125:0,scheduleAtNextAnimationFrame:y=>Il(Pt(this.domNode),y)})),this.scrollableElement=this.disposables.add(new O4(this.rowsContainer,{alwaysConsumeMouseWheel:(c=r.alwaysConsumeMouseWheel)!==null&&c!==void 0?c:Vh.alwaysConsumeMouseWheel,horizontal:1,vertical:(u=r.verticalScrollMode)!==null&&u!==void 0?u:Vh.verticalScrollMode,useShadows:(d=r.useShadows)!==null&&d!==void 0?d:Vh.useShadows,mouseWheelScrollSensitivity:r.mouseWheelScrollSensitivity,fastScrollSensitivity:r.fastScrollSensitivity,scrollByPage:r.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(ye(this.rowsContainer,Si.Change,y=>this.onTouchChange(y))),this.disposables.add(ye(this.scrollableElement.getDomNode(),"scroll",y=>y.target.scrollTop=0)),this.disposables.add(ye(this.domNode,"dragover",y=>this.onDragOver(this.toDragEvent(y)))),this.disposables.add(ye(this.domNode,"drop",y=>this.onDrop(this.toDragEvent(y)))),this.disposables.add(ye(this.domNode,"dragleave",y=>this.onDragLeave(this.toDragEvent(y)))),this.disposables.add(ye(this.domNode,"dragend",y=>this.onDragEnd(y))),this.setRowLineHeight=(h=r.setRowLineHeight)!==null&&h!==void 0?h:Vh.setRowLineHeight,this.setRowHeight=(f=r.setRowHeight)!==null&&f!==void 0?f:Vh.setRowHeight,this.supportDynamicHeights=(g=r.supportDynamicHeights)!==null&&g!==void 0?g:Vh.supportDynamicHeights,this.dnd=(p=r.dnd)!==null&&p!==void 0?p:this.disposables.add(Vh.dnd),this.layout((v=r.initialSize)===null||v===void 0?void 0:v.height,(m=r.initialSize)===null||m===void 0?void 0:m.width)}updateOptions(e){e.paddingBottom!==void 0&&(this.paddingBottom=e.paddingBottom,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),e.smoothScrolling!==void 0&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),e.horizontalScrolling!==void 0&&(this.horizontalScrolling=e.horizontalScrolling);let t;if(e.scrollByPage!==void 0&&(t={...t??{},scrollByPage:e.scrollByPage}),e.mouseWheelScrollSensitivity!==void 0&&(t={...t??{},mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity}),e.fastScrollSensitivity!==void 0&&(t={...t??{},fastScrollSensitivity:e.fastScrollSensitivity}),t&&this.scrollableElement.updateOptions(t),e.paddingTop!==void 0&&e.paddingTop!==this.rangeMap.paddingTop){const n=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),r=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(n,Math.max(0,this.lastRenderTop+r),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}createRangeMap(e){return new JGe(e)}splice(e,t,n=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,n)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,n=[]){const r=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),o={start:e,end:e+t},s=xs.intersect(r,o),a=new Map;for(let L=s.end-1;L>=s.start;L--){const E=this.items[L];if(E.dragStartDisposable.dispose(),E.checkedDisposable.dispose(),E.row){let D=a.get(E.templateId);D||(D=[],a.set(E.templateId,D));const k=this.renderers.get(E.templateId);k&&k.disposeElement&&k.disposeElement(E.element,L,E.row.templateData,E.size),D.push(E.row)}E.row=null,E.stale=!0}const l={start:e+t,end:this.items.length},c=xs.intersect(l,r),u=xs.relativeComplement(l,r),d=n.map(L=>({id:String(this.itemId++),element:L,templateId:this.virtualDelegate.getTemplateId(L),size:this.virtualDelegate.getHeight(L),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(L),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:fe.None,checkedDisposable:fe.None,stale:!1}));let h;e===0&&t>=this.items.length?(this.rangeMap=this.createRangeMap(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,d),h=this.items,this.items=d):(this.rangeMap.splice(e,t,d),h=this.items.splice(e,t,...d));const f=n.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),p=DV(c,f),v=xs.intersect(g,p);for(let L=v.start;LDV(L,f)),S=[{start:e,end:e+n.length},..._].map(L=>xs.intersect(g,L)).reverse();for(const L of S)for(let E=L.end-1;E>=L.start;E--){const D=this.items[E],k=a.get(D.templateId),T=k==null?void 0:k.pop();this.insertItemInDOM(E,T)}for(const L of a.values())for(const E of L)this.cache.release(E);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),h.map(L=>L.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=Il(Pt(this.domNode),()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null}))}eventuallyUpdateScrollWidth(){if(!this.horizontalScrolling){this.scrollableElementWidthDelayer.cancel();return}this.scrollableElementWidthDelayer.trigger(()=>this.updateScrollWidth())}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const t of this.items)typeof t.width<"u"&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:e===0?0:e+10}),this._onDidChangeContentWidth.fire(this.scrollWidth)}rerender(){if(this.supportDynamicHeights){for(const e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}get firstVisibleIndex(){return this.getRenderRange(this.lastRenderTop,this.lastRenderHeight).start}element(e){return this.items[e].element}indexOf(e){return this.items.findIndex(t=>t.element===e)}domElement(e){const t=this.items[e].row;return t&&t.domNode}elementHeight(e){return this.items[e].size}elementTop(e){return this.rangeMap.positionAt(e)}indexAt(e){return this.rangeMap.indexAt(e)}indexAfter(e){return this.rangeMap.indexAfter(e)}layout(e,t){const n={height:typeof e=="number"?e:YBe(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,n.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(n),typeof t<"u"&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:typeof t=="number"?t:l6(this.domNode)})}render(e,t,n,r,o,s=!1){const a=this.getRenderRange(t,n),l=xs.relativeComplement(a,e).reverse(),c=xs.relativeComplement(e,a);if(s){const u=xs.intersect(e,a);for(let d=u.start;d{for(const u of c)for(let d=u.start;d=u.start;d--)this.insertItemInDOM(d)}),r!==void 0&&(this.rowsContainer.style.left=`-${r}px`),this.rowsContainer.style.top=`-${t}px`,this.horizontalScrolling&&o!==void 0&&(this.rowsContainer.style.width=`${Math.max(o,this.renderWidth)}px`),this.lastRenderTop=t,this.lastRenderHeight=n}insertItemInDOM(e,t){var n,r,o;const s=this.items[e];if(!s.row)if(t)s.row=t,s.stale=!0;else{const d=this.cache.alloc(s.templateId);s.row=d.row,s.stale||(s.stale=d.isReusingConnectedDomNode)}const a=this.accessibilityProvider.getRole(s.element)||"listitem";s.row.domNode.setAttribute("role",a);const l=this.accessibilityProvider.isChecked(s.element);if(typeof l=="boolean")s.row.domNode.setAttribute("aria-checked",String(!!l));else if(l){const d=h=>s.row.domNode.setAttribute("aria-checked",String(!!h));d(l.value),s.checkedDisposable=l.onDidChange(d)}if(s.stale||!s.row.domNode.parentElement){const d=(o=(r=(n=this.items.at(e+1))===null||n===void 0?void 0:n.row)===null||r===void 0?void 0:r.domNode)!==null&&o!==void 0?o:null;this.rowsContainer.insertBefore(s.row.domNode,d),s.stale=!1}this.updateItemInDOM(s,e);const c=this.renderers.get(s.templateId);if(!c)throw new Error(`No renderer found for template id ${s.templateId}`);c==null||c.renderElement(s.element,e,s.row.templateData,s.size);const u=this.dnd.getDragURI(s.element);s.dragStartDisposable.dispose(),s.row.domNode.draggable=!!u,u&&(s.dragStartDisposable=ye(s.row.domNode,"dragstart",d=>this.onDragStart(s.element,u,d))),this.horizontalScrolling&&(this.measureItemWidth(s),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=l6(e.row.domNode);const t=Pt(e.row.domNode).getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${t}`),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("data-parity",t%2===0?"even":"odd"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e){const t=this.items[e];if(t.dragStartDisposable.dispose(),t.checkedDisposable.dispose(),t.row){const n=this.renderers.get(t.templateId);n&&n.disposeElement&&n.disposeElement(t.element,e,t.row.templateData,t.size),this.cache.release(t.row),t.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,t){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:t})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.paddingBottom}get onMouseClick(){return Je.map(this.disposables.add(new wn(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return Je.map(this.disposables.add(new wn(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return Je.filter(Je.map(this.disposables.add(new wn(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseDown(){return Je.map(this.disposables.add(new wn(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return Je.map(this.disposables.add(new wn(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return Je.map(this.disposables.add(new wn(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return Je.any(Je.map(this.disposables.add(new wn(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),Je.map(this.disposables.add(new wn(this.domNode,Si.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return Je.map(this.disposables.add(new wn(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return Je.map(this.disposables.add(new wn(this.rowsContainer,Si.Tap)).event,e=>this.toGestureEvent(e),this.disposables)}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),n=typeof t>"u"?void 0:this.items[t],r=n&&n.element;return{browserEvent:e,index:t,element:r}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),n=typeof t>"u"?void 0:this.items[t],r=n&&n.element;return{browserEvent:e,index:t,element:r}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),n=typeof t>"u"?void 0:this.items[t],r=n&&n.element;return{browserEvent:e,index:t,element:r}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),n=typeof t>"u"?void 0:this.items[t],r=n&&n.element,o=this.getTargetSector(e,t);return{browserEvent:e,index:t,element:r,sector:o}}onScroll(e){try{const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(t){throw console.error("Got bad scroll event:",e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,n){var r,o;if(!n.dataTransfer)return;const s=this.dnd.getDragElements(e);if(n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setData(lI.TEXT,t),n.dataTransfer.setDragImage){let a;this.dnd.getDragLabel&&(a=this.dnd.getDragLabel(s,n)),typeof a>"u"&&(a=String(s.length));const l=He(".monaco-drag-image");l.textContent=a;const u=(d=>{for(;d&&!d.classList.contains("monaco-workbench");)d=d.parentElement;return d||this.domNode.ownerDocument})(this.domNode);u.appendChild(l),n.dataTransfer.setDragImage(l,-10,-10),setTimeout(()=>u.removeChild(l),0)}this.domNode.classList.add("dragging"),this.currentDragData=new Yk(s),i0.CurrentDragAndDropData=new nqe(s),(o=(r=this.dnd).onDragStart)===null||o===void 0||o.call(r,this.currentDragData,n)}onDragOver(e){var t,n;if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),i0.CurrentDragAndDropData&&i0.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(i0.CurrentDragAndDropData)this.currentDragData=i0.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new iqe}const r=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.sector,e.browserEvent);if(this.canDrop=typeof r=="boolean"?r:r.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect=typeof r!="boolean"&&((t=r.effect)===null||t===void 0?void 0:t.type)===0?"copy":"move";let o;typeof r!="boolean"&&r.feedback?o=r.feedback:typeof e.index>"u"?o=[-1]:o=[e.index],o=Ep(o).filter(a=>a>=-1&&aa-l),o=o[0]===-1?[-1]:o;let s=typeof r!="boolean"&&r.effect&&r.effect.position?r.effect.position:"drop-target";if(rqe(this.currentDragFeedback,o)&&this.currentDragFeedbackPosition===s)return!0;if(this.currentDragFeedback=o,this.currentDragFeedbackPosition=s,this.currentDragFeedbackDisposable.dispose(),o[0]===-1)this.domNode.classList.add(s),this.rowsContainer.classList.add(s),this.currentDragFeedbackDisposable=Rt(()=>{this.domNode.classList.remove(s),this.rowsContainer.classList.remove(s)});else{if(o.length>1&&s!=="drop-target")throw new Error("Can't use multiple feedbacks with position different than 'over'");s==="drop-target-after"&&o[0]{var a;for(const l of o){const c=this.items[l];c.dropTarget=!1,(a=c.row)===null||a===void 0||a.domNode.classList.remove(s)}})}return!0}onDragLeave(e){var t,n;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=jv(()=>this.clearDragOverFeedback(),100,this.disposables),this.currentDragData&&((n=(t=this.dnd).onDragLeave)===null||n===void 0||n.call(t,this.currentDragData,e.element,e.index,e.browserEvent))}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,i0.CurrentDragAndDropData=void 0,!(!t||!e.browserEvent.dataTransfer)&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.sector,e.browserEvent))}onDragEnd(e){var t,n;this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,i0.CurrentDragAndDropData=void 0,(n=(t=this.dnd).onDragEnd)===null||n===void 0||n.call(t,e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackPosition=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=fe.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=nme(this.domNode).top;this.dragOverAnimationDisposable=c8e(Pt(this.domNode),this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=jv(()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)},1e3,this.disposables),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(this.dragOverMouseY===void 0)return;const t=this.dragOverMouseY-e,n=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>n&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-n))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getTargetSector(e,t){if(t===void 0)return;const n=e.offsetY/this.items[t].size,r=Math.floor(n/.25);return da(r,0,3)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let n=e;for(;n instanceof HTMLElement&&n!==this.rowsContainer&&t.contains(n);){const r=n.getAttribute("data-index");if(r){const o=Number(r);if(!isNaN(o))return o}n=n.parentElement}}getRenderRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}_rerender(e,t,n){const r=this.getRenderRange(e,t);let o,s;e===this.elementTop(r.start)?(o=r.start,s=0):r.end-r.start>1&&(o=r.start+1,s=this.elementTop(o)-e);let a=0;for(;;){const l=this.getRenderRange(e,t);let c=!1;for(let u=l.start;u=h.start;f--)this.insertItemInDOM(f);for(let h=l.start;h=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o};class sqe{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,n){const r=this.renderedElements.findIndex(o=>o.templateData===n);if(r>=0){const o=this.renderedElements[r];this.trait.unrender(n),o.index=t}else{const o={index:t,templateData:n};this.renderedElements.push(o)}this.trait.renderIndex(t,n)}splice(e,t,n){const r=[];for(const o of this.renderedElements)o.index=e+t&&r.push({index:o.index+n-t,templateData:o.templateData});this.renderedElements=r}renderIndexes(e){for(const{index:t,templateData:n}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,n)}disposeTemplate(e){const t=this.renderedElements.findIndex(n=>n.templateData===e);t<0||this.renderedElements.splice(t,1)}}let MP=class{get name(){return this._trait}get renderer(){return new sqe(this)}constructor(e){this._trait=e,this.indexes=[],this.sortedIndexes=[],this._onChange=new se,this.onChange=this._onChange.event}splice(e,t,n){const r=n.length-t,o=e+t,s=[];let a=0;for(;a=o;)s.push(this.sortedIndexes[a++]+r);this.renderer.splice(e,t,n.length),this._set(s,s)}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(Qoe),t)}_set(e,t,n){const r=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const s=IV(o,e);return this.renderer.renderIndexes(s),this._onChange.fire({indexes:e,browserEvent:n}),r}get(){return this.indexes}contains(e){return _D(this.sortedIndexes,e,Qoe)>=0}dispose(){si(this._onChange)}};T_([Rr],MP.prototype,"renderer",null);class aqe extends MP{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 a9{constructor(e,t,n){this.trait=e,this.view=t,this.identityProvider=n}splice(e,t,n){if(!this.identityProvider)return this.trait.splice(e,t,new Array(n.length).fill(!1));const r=this.trait.get().map(a=>this.identityProvider.getId(this.view.element(a)).toString());if(r.length===0)return this.trait.splice(e,t,new Array(n.length).fill(!1));const o=new Set(r),s=n.map(a=>o.has(this.identityProvider.getId(a).toString()));this.trait.splice(e,t,s)}}function Lv(i){return i.tagName==="INPUT"||i.tagName==="TEXTAREA"}function Zk(i,e){return i.classList.contains(e)?!0:i.classList.contains("monaco-list")||!i.parentElement?!1:Zk(i.parentElement,e)}function FL(i){return Zk(i,"monaco-editor")}function lqe(i){return Zk(i,"monaco-custom-toggle")}function cqe(i){return Zk(i,"action-item")}function IE(i){return Zk(i,"monaco-tree-sticky-row")}function AP(i){return i.classList.contains("monaco-tree-sticky-container")}function W_e(i){return i.tagName==="A"&&i.classList.contains("monaco-button")||i.tagName==="DIV"&&i.classList.contains("monaco-button-dropdown")?!0:i.classList.contains("monaco-list")||!i.parentElement?!1:W_e(i.parentElement)}class $_e{get onKeyDown(){return Je.chain(this.disposables.add(new wn(this.view.domNode,"keydown")).event,e=>e.filter(t=>!Lv(t.target)).map(t=>new Ai(t)))}constructor(e,t,n){this.list=e,this.view=t,this.disposables=new Te,this.multipleSelectionDisposables=new Te,this.multipleSelectionSupport=n.multipleSelectionSupport,this.disposables.add(this.onKeyDown(r=>{switch(r.keyCode){case 3:return this.onEnter(r);case 16:return this.onUpArrow(r);case 18:return this.onDownArrow(r);case 11:return this.onPageUpArrow(r);case 12:return this.onPageDownArrow(r);case 9:return this.onEscape(r);case 31:this.multipleSelectionSupport&&(Ln?r.metaKey:r.ctrlKey)&&this.onCtrlA(r)}}))}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionSupport=e.multipleSelectionSupport)}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(la(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()}}T_([Rr],$_e.prototype,"onKeyDown",null);var pf;(function(i){i[i.Automatic=0]="Automatic",i[i.Trigger=1]="Trigger"})(pf||(pf={}));var my;(function(i){i[i.Idle=0]="Idle",i[i.Typing=1]="Typing"})(my||(my={}));const uqe=new class{mightProducePrintableCharacter(i){return i.ctrlKey||i.metaKey||i.altKey?!1:i.keyCode>=31&&i.keyCode<=56||i.keyCode>=21&&i.keyCode<=30||i.keyCode>=98&&i.keyCode<=107||i.keyCode>=85&&i.keyCode<=95}};class dqe{constructor(e,t,n,r,o){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=n,this.keyboardNavigationEventFilter=r,this.delegate=o,this.enabled=!1,this.state=my.Idle,this.mode=pf.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new Te,this.disposables=new Te,this.updateOptions(e.options)}updateOptions(e){var t,n;!((t=e.typeNavigationEnabled)!==null&&t!==void 0)||t?this.enable():this.disable(),this.mode=(n=e.typeNavigationMode)!==null&&n!==void 0?n:pf.Automatic}enable(){if(this.enabled)return;let e=!1;const t=Je.chain(this.enabledDisposables.add(new wn(this.view.domNode,"keydown")).event,o=>o.filter(s=>!Lv(s.target)).filter(()=>this.mode===pf.Automatic||this.triggered).map(s=>new Ai(s)).filter(s=>e||this.keyboardNavigationEventFilter(s)).filter(s=>this.delegate.mightProducePrintableCharacter(s)).forEach(s=>hn.stop(s,!0)).map(s=>s.browserEvent.key)),n=Je.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);Je.reduce(Je.any(t,n),(o,s)=>s===null?null:(o||"")+s,void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),n(this.onClear,this,this.enabledDisposables),t(()=>e=!0,void 0,this.enabledDisposables),n(()=>e=!1,void 0,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){var e;const t=this.list.getFocus();if(t.length>0&&t[0]===this.previouslyFocused){const n=(e=this.list.options.accessibilityProvider)===null||e===void 0?void 0:e.getAriaLabel(this.list.element(t[0]));n&&kl(n)}this.previouslyFocused=-1}onInput(e){if(!e){this.state=my.Idle,this.triggered=!1;return}const t=this.list.getFocus(),n=t.length>0?t[0]:0,r=this.state===my.Idle?1:0;this.state=my.Typing;for(let o=0;o1&&c.length===1){this.previouslyFocused=n,this.list.setFocus([s]),this.list.reveal(s);return}}}else if(typeof l>"u"||iI(e,l)){this.previouslyFocused=n,this.list.setFocus([s]),this.list.reveal(s);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class hqe{constructor(e,t){this.list=e,this.view=t,this.disposables=new Te;const n=Je.chain(this.disposables.add(new wn(t.domNode,"keydown")).event,o=>o.filter(s=>!Lv(s.target)).map(s=>new Ai(s)));Je.chain(n,o=>o.filter(s=>s.keyCode===2&&!s.ctrlKey&&!s.metaKey&&!s.shiftKey&&!s.altKey))(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(t.length===0)return;const n=this.view.domElement(t[0]);if(!n)return;const r=n.querySelector("[tabIndex]");if(!r||!(r instanceof HTMLElement)||r.tabIndex===-1)return;const o=Pt(r).getComputedStyle(r);o.visibility==="hidden"||o.display==="none"||(e.preventDefault(),e.stopPropagation(),r.focus())}dispose(){this.disposables.dispose()}}function H_e(i){return Ln?i.browserEvent.metaKey:i.browserEvent.ctrlKey}function V_e(i){return i.browserEvent.shiftKey}function fqe(i){return Iq(i)&&i.button===2}const Zoe={isSelectionSingleChangeEvent:H_e,isSelectionRangeChangeEvent:V_e};class z_e{constructor(e){this.list=e,this.disposables=new Te,this._onPointer=new se,this.onPointer=this._onPointer.event,e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||Zoe),this.mouseSupport=typeof e.options.mouseSupport>"u"||!!e.options.mouseSupport,this.mouseSupport&&(e.onMouseDown(this.onMouseDown,this,this.disposables),e.onContextMenu(this.onContextMenu,this,this.disposables),e.onMouseDblClick(this.onDoubleClick,this,this.disposables),e.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(wi.addTarget(e.getHTMLElement()))),Je.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||Zoe))}isSelectionSingleChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionSingleChangeEvent(e):!1}isSelectionRangeChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionRangeChangeEvent(e):!1}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){FL(e.browserEvent.target)||fs()!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(Lv(e.browserEvent.target)||FL(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||Lv(e.browserEvent.target)||FL(e.browserEvent.target)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=e.index;if(typeof t>"u"){this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0);return}if(this.isSelectionChangeEvent(e))return this.changeSelection(e);this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),fqe(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(Lv(e.browserEvent.target)||FL(e.browserEvent.target)||this.isSelectionChangeEvent(e)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e){const t=e.index;let n=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){if(typeof n>"u"){const u=this.list.getFocus()[0];n=u??t,this.list.setAnchor(n)}const r=Math.min(n,t),o=Math.max(n,t),s=la(r,o+1),a=this.list.getSelection(),l=mqe(IV(a,[n]),n);if(l.length===0)return;const c=IV(s,vqe(a,l));this.list.setSelection(c,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const r=this.list.getSelection(),o=r.filter(s=>s!==t);this.list.setFocus([t]),this.list.setAnchor(t),r.length===o.length?this.list.setSelection([...o,t],e.browserEvent):this.list.setSelection(o,e.browserEvent)}}dispose(){this.disposables.dispose()}}class U_e{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){var t,n;const r=this.selectorSuffix&&`.${this.selectorSuffix}`,o=[];e.listBackground&&o.push(`.monaco-list${r} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(o.push(`.monaco-list${r}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),o.push(`.monaco-list${r}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&o.push(`.monaco-list${r}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(o.push(`.monaco-list${r}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),o.push(`.monaco-list${r}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&o.push(`.monaco-list${r}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&o.push(`.monaco-list${r}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&o.push(` .monaco-drag-image, .monaco-list${r}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; } `),e.listFocusAndSelectionForeground&&o.push(` @@ -343,9 +343,9 @@ ${e}`)}function KKe(i){return k_(i,"`")}function GKe(i){return k_(i,"*")}functio background-color: ${e.tableOddRowsBackgroundColor}; } `),this.styleElement.textContent=o.join(` -`)}}const gqe={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropOverBackground:"#383B3D",listDropBetweenBackground:"#EEEEEE",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:me.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:me.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:me.fromHex("#cccccc").transparent(.04).toString(),listBackground:void 0,listFocusForeground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusForeground:void 0,listInactiveFocusBackground:void 0,listHoverForeground:void 0,listFocusOutline:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listHoverOutline:void 0},pqe={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function mqe(i,e){const t=i.indexOf(e);if(t===-1)return[];const n=[];let r=t-1;for(;r>=0&&i[r]===e-(t-r);)n.push(i[r--]);for(n.reverse(),r=t;r=i.length)t.push(e[r++]);else if(r>=e.length)t.push(i[n++]);else if(i[n]===e[r]){t.push(i[n]),n++,r++;continue}else i[n]=i.length)t.push(e[r++]);else if(r>=e.length)t.push(i[n++]);else if(i[n]===e[r]){n++,r++;continue}else i[n]i-e;class _qe{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,n,r){let o=0;for(const s of this.renderers)s.renderElement(e,t,n[o++],r)}disposeElement(e,t,n,r){var o;let s=0;for(const a of this.renderers)(o=a.disposeElement)===null||o===void 0||o.call(a,e,t,n[s],r),s+=1}disposeTemplate(e){let t=0;for(const n of this.renderers)n.disposeTemplate(e[t++])}}class bqe{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return e}renderElement(e,t,n){const r=this.accessibilityProvider.getAriaLabel(e);r?n.setAttribute("aria-label",r):n.removeAttribute("aria-label");const o=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof o=="number"?n.setAttribute("aria-level",`${o}`):n.removeAttribute("aria-level")}disposeTemplate(e){}}class Cqe{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){var n,r;(r=(n=this.dnd).onDragStart)===null||r===void 0||r.call(n,e,t)}onDragOver(e,t,n,r,o){return this.dnd.onDragOver(e,t,n,r,o)}onDragLeave(e,t,n,r){var o,s;(s=(o=this.dnd).onDragLeave)===null||s===void 0||s.call(o,e,t,n,r)}onDragEnd(e){var t,n;(n=(t=this.dnd).onDragEnd)===null||n===void 0||n.call(t,e)}drop(e,t,n,r,o){this.dnd.drop(e,t,n,r,o)}dispose(){this.dnd.dispose()}}let wc=class{get onDidChangeFocus(){return Je.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return Je.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e),this.disposables)}get domId(){return this.view.domId}get onDidScroll(){return this.view.onDidScroll}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseDown(){return this.view.onMouseDown}get onMouseOver(){return this.view.onMouseOver}get onMouseOut(){return this.view.onMouseOut}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1;const t=Je.chain(this.disposables.add(new wn(this.view.domNode,"keydown")).event,o=>o.map(s=>new Ai(s)).filter(s=>e=s.keyCode===58||s.shiftKey&&s.keyCode===68).map(s=>hn.stop(s,!0)).filter(()=>!1)),n=Je.chain(this.disposables.add(new wn(this.view.domNode,"keyup")).event,o=>o.forEach(()=>e=!1).map(s=>new Ai(s)).filter(s=>s.keyCode===58||s.shiftKey&&s.keyCode===68).map(s=>hn.stop(s,!0)).map(({browserEvent:s})=>{const a=this.getFocus(),l=a.length?a[0]:void 0,c=typeof l<"u"?this.view.element(l):void 0,u=typeof l<"u"?this.view.domElement(l):this.view.domNode;return{index:l,element:c,anchor:u,browserEvent:s}})),r=Je.chain(this.view.onContextMenu,o=>o.filter(s=>!e).map(({element:s,index:a,browserEvent:l})=>({element:s,index:a,anchor:new Uu(Pt(this.view.domNode),l),browserEvent:l})));return Je.any(t,n,r)}get onKeyDown(){return this.disposables.add(new wn(this.view.domNode,"keydown")).event}get onDidFocus(){return Je.signal(this.disposables.add(new wn(this.view.domNode,"focus",!0)).event)}get onDidBlur(){return Je.signal(this.disposables.add(new wn(this.view.domNode,"blur",!0)).event)}constructor(e,t,n,r,o=pqe){var s,a,l,c;this.user=e,this._options=o,this.focus=new MP("focused"),this.anchor=new MP("anchor"),this.eventBufferer=new uq,this._ariaLabel="",this.disposables=new Te,this._onDidDispose=new se,this.onDidDispose=this._onDidDispose.event;const u=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?(s=this._options.accessibilityProvider)===null||s===void 0?void 0:s.getWidgetRole():"list";this.selection=new aqe(u!=="listbox");const d=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(d.push(new bqe(this.accessibilityProvider)),(l=(a=this.accessibilityProvider).onDidChangeActiveDescendant)===null||l===void 0||l.call(a,this.onDidChangeActiveDescendant,this,this.disposables)),r=r.map(f=>new _qe(f.templateId,[...d,f]));const h={...o,dnd:o.dnd&&new Cqe(this,o.dnd)};if(this.view=this.createListView(t,n,r,h),this.view.domNode.setAttribute("role",u),o.styleController)this.styleController=o.styleController(this.view.domId);else{const f=gc(this.view.domNode);this.styleController=new U_e(f,this.view.domId)}if(this.spliceable=new YGe([new a9(this.focus,this.view,o.identityProvider),new a9(this.selection,this.view,o.identityProvider),new a9(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 hqe(this,this.view)),(typeof o.keyboardSupport!="boolean"||o.keyboardSupport)&&(this.keyboardController=new $_e(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const f=o.keyboardNavigationDelegate||uqe;this.typeNavigationController=new dqe(this,this.view,o.keyboardNavigationLabelProvider,(c=o.keyboardNavigationEventFilter)!==null&&c!==void 0?c:()=>!0,f),this.disposables.add(this.typeNavigationController)}this.mouseController=this.createMouseController(o),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider&&(this.ariaLabel=this.accessibilityProvider.getWidgetAriaLabel()),this._options.multipleSelectionSupport!==!1&&this.view.domNode.setAttribute("aria-multiselectable","true")}createListView(e,t,n,r){return new pu(e,t,n,r)}createMouseController(e){return new z_e(this)}updateOptions(e={}){var t,n;this._options={...this._options,...e},(t=this.typeNavigationController)===null||t===void 0||t.updateOptions(this._options),this._options.multipleSelectionController!==void 0&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),(n=this.keyboardController)===null||n===void 0||n.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,n=[]){if(e<0||e>this.view.length)throw new i0(this.user,`Invalid start index: ${e}`);if(t<0)throw new i0(this.user,`Invalid delete count: ${t}`);t===0&&n.length===0||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,t,n))}rerender(){this.view.rerender()}element(e){return this.view.element(e)}indexOf(e){return this.view.indexOf(e)}indexAt(e){return this.view.indexAt(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get onDidChangeContentHeight(){return this.view.onDidChangeContentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute("aria-label",e)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(e,t){this.view.layout(e,t)}setSelection(e,t){for(const n of e)if(n<0||n>=this.length)throw new i0(this.user,`Invalid index ${n}`);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(e=>this.view.element(e))}setAnchor(e){if(typeof e>"u"){this.anchor.set([]);return}if(e<0||e>=this.length)throw new i0(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return JG(this.anchor.get(),void 0)}getAnchorElement(){const e=this.getAnchor();return typeof e>"u"?void 0:this.element(e)}setFocus(e,t){for(const n of e)if(n<0||n>=this.length)throw new i0(this.user,`Invalid index ${n}`);this.focus.set(e,t)}focusNext(e=1,t=!1,n,r){if(this.length===0)return;const o=this.focus.get(),s=this.findNextIndex(o.length>0?o[0]+e:0,t,r);s>-1&&this.setFocus([s],n)}focusPrevious(e=1,t=!1,n,r){if(this.length===0)return;const o=this.focus.get(),s=this.findPreviousIndex(o.length>0?o[0]-e:0,t,r);s>-1&&this.setFocus([s],n)}async focusNextPage(e,t){let n=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);n=n===0?0:n-1;const r=this.getFocus()[0];if(r!==n&&(r===void 0||n>r)){const o=this.findPreviousIndex(n,!1,t);o>-1&&r!==o?this.setFocus([o],e):this.setFocus([n],e)}else{const o=this.view.getScrollTop();let s=o+this.view.renderHeight;n>r&&(s-=this.view.elementHeight(n)),this.view.setScrollTop(s),this.view.getScrollTop()!==o&&(this.setFocus([]),await jv(0),await this.focusNextPage(e,t))}}async focusPreviousPage(e,t,n=()=>0){let r;const o=n(),s=this.view.getScrollTop()+o;s===0?r=this.view.indexAt(s):r=this.view.indexAfter(s-1);const a=this.getFocus()[0];if(a!==r&&(a===void 0||a>=r)){const l=this.findNextIndex(r,!1,t);l>-1&&a!==l?this.setFocus([l],e):this.setFocus([r],e)}else{const l=s;this.view.setScrollTop(s-this.view.renderHeight-o),this.view.getScrollTop()+n()!==l&&(this.setFocus([]),await jv(0),await this.focusPreviousPage(e,t,n))}}focusLast(e,t){if(this.length===0)return;const n=this.findPreviousIndex(this.length-1,!1,t);n>-1&&this.setFocus([n],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,n){if(this.length===0)return;const r=this.findNextIndex(e,!1,n);r>-1&&this.setFocus([r],t)}findNextIndex(e,t=!1,n){for(let r=0;r=this.length&&!t)return-1;if(e=e%this.length,!n||n(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,n){for(let r=0;rthis.view.element(e))}reveal(e,t,n=0){if(e<0||e>=this.length)throw new i0(this.user,`Invalid index ${e}`);const r=this.view.getScrollTop(),o=this.view.elementTop(e),s=this.view.elementHeight(e);if(Hv(t)){const a=s-this.view.renderHeight+n;this.view.setScrollTop(a*da(t,0,1)+o-n)}else{const a=o+s,l=r+this.view.renderHeight;o=l||(o=l&&s>=this.view.renderHeight?this.view.setScrollTop(o-n):a>=l&&this.view.setScrollTop(a-this.view.renderHeight))}}getRelativeTop(e,t=0){if(e<0||e>=this.length)throw new i0(this.user,`Invalid index ${e}`);const n=this.view.getScrollTop(),r=this.view.elementTop(e),o=this.view.elementHeight(e);if(rn+this.view.renderHeight)return null;const s=o-this.view.renderHeight+t;return Math.abs((n+t-r)/s)}isDOMFocused(){return Mk(this.view.domNode)}getHTMLElement(){return this.view.domNode}getScrollableElement(){return this.view.scrollableElementDomNode}getElementID(e){return this.view.getElementDomId(e)}getElementTop(e){return this.view.elementTop(e)}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map(n=>this.view.element(n)),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 n;!((e=this.accessibilityProvider)===null||e===void 0)&&e.getActiveDescendantId&&(n=this.accessibilityProvider.getActiveDescendantId(this.view.element(t[0]))),this.view.domNode.setAttribute("aria-activedescendant",n||this.view.getElementDomId(t[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const e=this.selection.get();this.view.domNode.classList.toggle("selection-none",e.length===0),this.view.domNode.classList.toggle("selection-single",e.length===1),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}};N_([Rr],wc.prototype,"onDidChangeFocus",null);N_([Rr],wc.prototype,"onDidChangeSelection",null);N_([Rr],wc.prototype,"onContextMenu",null);N_([Rr],wc.prototype,"onKeyDown",null);N_([Rr],wc.prototype,"onDidFocus",null);N_([Rr],wc.prototype,"onDidBlur",null);const U0=He,j_e="selectOption.entry.template";class yqe{get templateId(){return j_e}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=ke(e,U0(".option-text")),t.detail=ke(e,U0(".option-detail")),t.decoratorRight=ke(e,U0(".option-decorator-right")),t}renderElement(e,t,n){const r=n,o=e.text,s=e.detail,a=e.decoratorRight,l=e.isDisabled;r.text.textContent=o,r.detail.textContent=s||"",r.decoratorRight.innerText=a||"",l?r.root.classList.add("option-disabled"):r.root.classList.remove("option-disabled")}disposeTemplate(e){}}class mf extends fe{constructor(e,t,n,r,o){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=r,this.selectBoxOptions=o||Object.create(null),typeof this.selectBoxOptions.minBottomMargin!="number"?this.selectBoxOptions.minBottomMargin=mf.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN:this.selectBoxOptions.minBottomMargin<0&&(this.selectBoxOptions.minBottomMargin=0),this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box monaco-select-box-dropdown-padding",typeof this.selectBoxOptions.ariaLabel=="string"&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),typeof this.selectBoxOptions.ariaDescription=="string"&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._hover=this._register(mC(Vp("mouse"),this.selectElement,"")),this._onDidSelect=new se,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(n),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}getHeight(){return 22}getTemplateId(){return j_e}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=He(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=ke(this.selectDropDownContainer,U0(".select-box-details-pane"));const t=ke(this.selectDropDownContainer,U0(".select-box-dropdown-container-width-control")),n=ke(t,U0(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",ke(n,this.widthControlElement),this._dropDownPosition=0,this.styleElement=gc(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(ye(this.selectDropDownContainer,Ge.DRAG_START,r=>{hn.stop(r,!0)}))}registerListeners(){this._register(Sr(this.selectElement,"change",t=>{this.selected=t.target.selectedIndex,this._onDidSelect.fire({index:t.target.selectedIndex,selected:t.target.value}),this.options[this.selected]&&this.options[this.selected].text&&this._hover.update(this.options[this.selected].text)})),this._register(ye(this.selectElement,Ge.CLICK,t=>{hn.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(ye(this.selectElement,Ge.MOUSE_DOWN,t=>{hn.stop(t)}));let e;this._register(ye(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(ye(this.selectElement,"touchend",t=>{hn.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(ye(this.selectElement,Ge.KEY_DOWN,t=>{const n=new Ai(t);let r=!1;Ln?(n.keyCode===18||n.keyCode===16||n.keyCode===10||n.keyCode===3)&&(r=!0):(n.keyCode===18&&n.altKey||n.keyCode===16&&n.altKey||n.keyCode===10||n.keyCode===3)&&(r=!0),r&&(this.showSelectDropDown(),hn.stop(t,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){or(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach((n,r)=>{this.selectElement.add(this.createOption(n.text,r,n.isDisabled)),typeof n.description=="string"&&(this._hasDetails=!0)})),t!==void 0&&(this.select(t),this._currentSelection=this.selected)}setOptionsList(){var e;(e=this.selectList)===null||e===void 0||e.splice(0,this.selectList.length,this.options)}select(e){e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.options[this.selected]&&this.options[this.selected].text&&this._hover.update(this.options[this.selected].text)}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){this.container=e,e.classList.add("select-container"),e.appendChild(this.selectElement),this.styleSelectElement()}initStyleSheet(){const e=[];this.styles.listFocusBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`),this.styles.listFocusForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`),this.styles.decoratorRightForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`),this.styles.selectBackground&&this.styles.selectBorder&&this.styles.selectBorder!==this.styles.selectBackground?(e.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)):this.styles.selectListBorder&&(e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)),this.styles.listHoverForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`),this.styles.listHoverBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`),this.styles.listFocusOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`),this.styles.listHoverOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }"),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }"),this.styleElement.textContent=e.join(` -`)}styleSelectElement(){var e,t,n;const r=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",o=(t=this.styles.selectForeground)!==null&&t!==void 0?t:"",s=(n=this.styles.selectBorder)!==null&&n!==void 0?n:"";this.selectElement.style.backgroundColor=r,this.selectElement.style.color=o,this.selectElement.style.borderColor=s}styleList(){var e,t;const n=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",r=gp(this.styles.selectListBackground,n);this.selectDropDownListContainer.style.backgroundColor=r,this.selectionDetailsPane.style.backgroundColor=r;const o=(t=this.styles.focusBorder)!==null&&t!==void 0?t:"";this.selectDropDownContainer.style.outlineColor=o,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,n){const r=document.createElement("option");return r.value=e,r.text=e,r.disabled=!!n,r}showSelectDropDown(){this.selectionDetailsPane.innerText="",!(!this.contextViewProvider||this._isVisible)&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){!this.contextViewProvider||!this._isVisible||(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{try{e.removeChild(this.selectDropDownContainer)}catch{}}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach((t,n)=>{this.updateDetail(n),this.selectionDetailsPane.offsetHeight>e&&(e=this.selectionDetailsPane.offsetHeight)}),e}layoutSelectDropDown(e){if(this._skipLayout)return!1;if(this.selectList){this.selectDropDownContainer.classList.add("visible");const t=Pt(this.selectElement),n=Br(this.selectElement),r=Pt(this.selectElement).getComputedStyle(this.selectElement),o=parseFloat(r.getPropertyValue("--dropdown-padding-top"))+parseFloat(r.getPropertyValue("--dropdown-padding-bottom")),s=t.innerHeight-n.top-n.height-(this.selectBoxOptions.minBottomMargin||0),a=n.top-mf.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,l=this.selectElement.offsetWidth,c=this.setWidthControlElement(this.widthControlElement),u=Math.max(c,Math.round(l)).toString()+"px";this.selectDropDownContainer.style.width=u,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let d=this.selectList.contentHeight;this._hasDetails&&this._cachedMaxDetailsHeight===void 0&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const h=this._hasDetails?this._cachedMaxDetailsHeight:0,f=d+o+h,g=Math.floor((s-o-h)/this.getHeight()),p=Math.floor((a-o-h)/this.getHeight());if(e)return n.top+n.height>t.innerHeight-22||n.topg&&this.options.length>g?(this._dropDownPosition=1,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=0,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),!0);if(n.top+n.height>t.innerHeight-22||n.tops&&(d=g*this.getHeight())}else f>a&&(d=p*this.getHeight());return this.selectList.layout(d),this.selectList.domFocus(),this.selectList.length>0&&(this.selectList.setFocus([this.selected||0]),this.selectList.reveal(this.selectList.getFocus()[0]||0)),this._hasDetails?(this.selectList.getHTMLElement().style.height=d+o+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=d+o+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=u,this.selectDropDownListContainer.setAttribute("tabindex","0"),this.selectElement.classList.add("synthetic-focus"),this.selectDropDownContainer.classList.add("synthetic-focus"),!0}else return!1}setWidthControlElement(e){let t=0;if(e){let n=0,r=0;this.options.forEach((o,s)=>{const a=o.detail?o.detail.length:0,l=o.decoratorRight?o.decoratorRight.length:0,c=o.text.length+a+l;c>r&&(n=s,r=c)}),e.textContent=this.options[n].text+(this.options[n].decoratorRight?this.options[n].decoratorRight+" ":""),t=ua(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=ke(e,U0(".select-box-dropdown-list-container")),this.listRenderer=new yqe,this.selectList=new wc("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:r=>{let o=r.text;return r.detail&&(o+=`. ${r.detail}`),r.decoratorRight&&(o+=`. ${r.decoratorRight}`),r.description&&(o+=`. ${r.description}`),o},getWidgetAriaLabel:()=>w({key:"selectBox",comment:["Behave like native select dropdown element."]},"Select Box"),getRole:()=>Ln?"":"option",getWidgetRole:()=>"listbox"}}),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new wn(this.selectDropDownListContainer,"keydown")),n=Je.chain(t.event,r=>r.filter(()=>this.selectList.length>0).map(o=>new Ai(o)));this._register(Je.chain(n,r=>r.filter(o=>o.keyCode===3))(this.onEnter,this)),this._register(Je.chain(n,r=>r.filter(o=>o.keyCode===2))(this.onEnter,this)),this._register(Je.chain(n,r=>r.filter(o=>o.keyCode===9))(this.onEscape,this)),this._register(Je.chain(n,r=>r.filter(o=>o.keyCode===16))(this.onUpArrow,this)),this._register(Je.chain(n,r=>r.filter(o=>o.keyCode===18))(this.onDownArrow,this)),this._register(Je.chain(n,r=>r.filter(o=>o.keyCode===12))(this.onPageDown,this)),this._register(Je.chain(n,r=>r.filter(o=>o.keyCode===11))(this.onPageUp,this)),this._register(Je.chain(n,r=>r.filter(o=>o.keyCode===14))(this.onHome,this)),this._register(Je.chain(n,r=>r.filter(o=>o.keyCode===13))(this.onEnd,this)),this._register(Je.chain(n,r=>r.filter(o=>o.keyCode>=21&&o.keyCode<=56||o.keyCode>=85&&o.keyCode<=113))(this.onCharacter,this)),this._register(ye(this.selectList.getHTMLElement(),Ge.POINTER_UP,r=>this.onPointerUp(r))),this._register(this.selectList.onMouseOver(r=>typeof r.index<"u"&&this.selectList.setFocus([r.index]))),this._register(this.selectList.onDidChangeFocus(r=>this.onListFocus(r))),this._register(ye(this.selectDropDownContainer,Ge.FOCUS_OUT,r=>{!this._isVisible||es(r.relatedTarget,this.selectDropDownContainer)||this.onListBlur()})),this.selectList.getHTMLElement().setAttribute("aria-label",this.selectBoxOptions.ariaLabel||""),this.selectList.getHTMLElement().setAttribute("aria-expanded","true"),this.styleList()}onPointerUp(e){if(!this.selectList.length)return;hn.stop(e);const t=e.target;if(!t||t.classList.contains("slider"))return;const n=t.closest(".monaco-list-row");if(!n)return;const r=Number(n.getAttribute("data-index")),o=n.classList.contains("option-disabled");r>=0&&r{for(let s=0;sthis.selected+2)this.selected+=2;else{if(t)return;this.selected++}this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0])}}onUpArrow(e){this.selected>0&&(hn.stop(e,!0),this.options[this.selected-1].isDisabled&&this.selected>1?this.selected-=2:this.selected--,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]))}onPageUp(e){hn.stop(e),this.selectList.focusPreviousPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected>0&&(this.selected--,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)},1)}onHome(e){hn.stop(e),!(this.options.length<2)&&(this.selected=0,this.options[this.selected].isDisabled&&this.selected>1&&this.selected++,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onEnd(e){hn.stop(e),!(this.options.length<2)&&(this.selected=this.options.length-1,this.options[this.selected].isDisabled&&this.selected>1&&this.selected--,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onCharacter(e){const t=Bg.toString(e.keyCode);let n=-1;for(let r=0;r{this._register(ye(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register(Sr(this.selectElement,"click",e=>{hn.stop(e,!0)})),this._register(Sr(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(Sr(this.selectElement,"keydown",e=>{let t=!1;Ln?(e.keyCode===18||e.keyCode===16||e.keyCode===10)&&(t=!0):(e.keyCode===18&&e.altKey||e.keyCode===10||e.keyCode===3)&&(t=!0),t&&e.stopPropagation()}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){(!this.options||!or(this.options,e))&&(this.options=e,this.selectElement.options.length=0,this.options.forEach((n,r)=>{this.selectElement.add(this.createOption(n.text,r,n.isDisabled))})),t!==void 0&&this.select(t)}select(e){this.options.length===0?this.selected=0:e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.selected{this.element&&this.handleActionChangeEvent(r)}))}handleActionChangeEvent(e){e.enabled!==void 0&&this.updateEnabled(),e.checked!==void 0&&this.updateChecked(),e.class!==void 0&&this.updateClass(),e.label!==void 0&&(this.updateLabel(),this.updateTooltip()),e.tooltip!==void 0&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new Nb)),this._actionRunner}set actionRunner(e){this._actionRunner=e}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const t=this.element=e;this._register(wi.addTarget(e));const n=this.options&&this.options.draggable;n&&(e.draggable=!0,ru&&this._register(ye(e,Ge.DRAG_START,r=>{var o;return(o=r.dataTransfer)===null||o===void 0?void 0:o.setData(lI.TEXT,this._action.label)}))),this._register(ye(t,Si.Tap,r=>this.onClick(r,!0))),this._register(ye(t,Ge.MOUSE_DOWN,r=>{n||hn.stop(r,!0),this._action.enabled&&r.button===0&&t.classList.add("active")})),Ln&&this._register(ye(t,Ge.CONTEXT_MENU,r=>{r.button===0&&r.ctrlKey===!0&&this.onClick(r)})),this._register(ye(t,Ge.CLICK,r=>{hn.stop(r,!0),this.options&&this.options.isMenu||this.onClick(r)})),this._register(ye(t,Ge.DBLCLICK,r=>{hn.stop(r,!0)})),[Ge.MOUSE_UP,Ge.MOUSE_OUT].forEach(r=>{this._register(ye(t,r,o=>{hn.stop(o),t.classList.remove("active")}))})}onClick(e,t=!1){var n;hn.stop(e,!0);const r=nc(this._context)?!((n=this.options)===null||n===void 0)&&n.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,r)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}getClass(){return this.action.class}getTooltip(){return this.action.tooltip}updateTooltip(){var e,t,n;if(!this.element)return;const r=(e=this.getTooltip())!==null&&e!==void 0?e:"";if(this.updateAriaLabel(),!((t=this.options.hoverDelegate)===null||t===void 0)&&t.showNativeHover)this.element.title=r;else if(this.customHover)this.customHover.update(r);else{const o=(n=this.options.hoverDelegate)!==null&&n!==void 0?n:Vp("element");this.customHover=mC(o,this.element,r),this._store.add(this.customHover)}}updateAriaLabel(){var e;if(this.element){const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.element.setAttribute("aria-label",t)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class jw extends Wd{constructor(e,t,n){super(e,t,n),this.options=n,this.options.icon=n.icon!==void 0?n.icon:!1,this.options.label=n.label!==void 0?n.label:!0,this.cssClass=""}render(e){super.render(e),Xn(this.element);const t=document.createElement("a");if(t.classList.add("action-label"),t.setAttribute("role",this.getDefaultAriaRole()),this.label=t,this.element.appendChild(t),this.options.label&&this.options.keybinding){const n=document.createElement("span");n.classList.add("keybinding"),n.textContent=this.options.keybinding,this.element.appendChild(n)}this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===lo.ID?"presentation":this.options.isMenu?"menuitem":"button"}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.action.label)}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:!this.options.label&&this.action.label&&this.options.icon&&(e=this.action.label,this.options.keybinding&&(e=w({key:"titleLabel",comment:["action title","action keybinding"]},"{0} ({1})",e,this.options.keybinding))),e??void 0}updateClass(){var e;this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.getClass(),this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):(e=this.label)===null||e===void 0||e.classList.remove("codicon")}updateEnabled(){var e,t;this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),(e=this.element)===null||e===void 0||e.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),(t=this.element)===null||t===void 0||t.classList.add("disabled"))}updateAriaLabel(){var e;if(this.label){const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.label.setAttribute("aria-label",t)}}updateChecked(){this.label&&(this.action.checked!==void 0?(this.label.classList.toggle("checked",this.action.checked),this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox")):(this.label.classList.remove("checked"),this.label.removeAttribute("aria-checked"),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class xqe extends Wd{constructor(e,t,n,r,o,s,a){super(e,t),this.selectBox=new Sqe(n,r,o,s,a),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}select(e){this.selectBox.select(e)}registerListeners(){this._register(this.selectBox.onDidSelect(e=>this.runAction(e.selected,e.index)))}runAction(e,t){this.actionRunner.run(this._action,this.getActionContext(e,t))}getActionContext(e,t){return e}setFocusable(e){this.selectBox.setFocusable(e)}focus(){var e;(e=this.selectBox)===null||e===void 0||e.focus()}blur(){var e;(e=this.selectBox)===null||e===void 0||e.blur()}render(e){this.selectBox.render(e)}}class Lqe extends Nb{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new se),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=ke(e,He(".monaco-dropdown")),this._label=ke(this._element,He(".dropdown-label"));let n=t.labelRenderer;n||(n=o=>(o.textContent=t.label||"",null));for(const o of[Ge.CLICK,Ge.MOUSE_DOWN,Si.Tap])this._register(ye(this.element,o,s=>hn.stop(s,!0)));for(const o of[Ge.MOUSE_DOWN,Si.Tap])this._register(ye(this._label,o,s=>{Iq(s)&&(s.detail>1||s.button!==0)||(this.visible?this.hide():this.show())}));this._register(ye(this._label,Ge.KEY_UP,o=>{const s=new Ai(o);(s.equals(3)||s.equals(10))&&(hn.stop(o,!0),this.visible?this.hide():this.show())}));const r=n(this._label);r&&this._register(r),this._register(wi.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 Eqe extends Lqe{constructor(e,t){super(e,t),this._options=t,this._actions=[],this.actions=t.actions||[]}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this._options.actionProvider?this._options.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._options.contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:(e,t)=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e,t):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this._options.menuClassName||"",onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this._options.menuAsChild?this.element:void 0,skipTelemetry:this._options.skipTelemetry})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class PP extends Wd{constructor(e,t,n,r=Object.create(null)){super(null,e,r),this.actionItem=null,this._onDidChangeVisibility=this._register(new se),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.menuActionsOrProvider=t,this.contextMenuProvider=n,this.options=r,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=o=>{this.element=ke(o,He("a.action-label"));let s=[];return typeof this.options.classNames=="string"?s=this.options.classNames.split(/\s+/g).filter(a=>!!a):this.options.classNames&&(s=this.options.classNames),s.find(a=>a==="icon")||s.push("codicon"),this.element.classList.add(...s),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this._action.label&&this._register(mC(Vp("mouse"),this.element,this._action.label)),this.element.ariaLabel=this._action.label||"",null},n=Array.isArray(this.menuActionsOrProvider),r={contextMenuProvider:this.contextMenuProvider,labelRenderer:t,menuAsChild:this.options.menuAsChild,actions:n?this.menuActionsOrProvider:void 0,actionProvider:n?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new Eqe(e,r)),this._register(this.dropdownMenu.onDidChangeVisibility(o=>{var s;(s=this.element)===null||s===void 0||s.setAttribute("aria-expanded",`${o}`),this._onDidChangeVisibility.fire(o)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const o=this;this.dropdownMenu.menuOptions={...this.dropdownMenu.menuOptions,get anchorAlignment(){return o.options.anchorAlignmentProvider()}}}this.updateTooltip(),this.updateEnabled()}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label),e??void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){var e;(e=this.dropdownMenu)===null||e===void 0||e.show()}updateEnabled(){var e,t;const n=!this.action.enabled;(e=this.actionItem)===null||e===void 0||e.classList.toggle("disabled",n),(t=this.element)===null||t===void 0||t.classList.toggle("disabled",n)}}function Dqe(i){return i?i.condition!==void 0:!1}var Xy;(function(i){i[i.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",i[i.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(Xy||(Xy={}));var vy;(function(i){i[i.None=0]="None",i[i.Initialized=1]="Initialized",i[i.Closed=2]="Closed"})(vy||(vy={}));class Yy extends fe{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new Lb),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=vy.None,this.cache=new Map,this.flushDelayer=this._register(new zpe(Yy.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,n;this._onDidChangeStorage.pause();try{(t=e.changed)===null||t===void 0||t.forEach((r,o)=>this.acceptExternal(o,r)),(n=e.deleted)===null||n===void 0||n.forEach(r=>this.acceptExternal(r,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===vy.Closed)return;let n=!1;nc(t)?n=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),n=!0),n&&this._onDidChangeStorage.fire({key:e,external:!0})}get(e,t){const n=this.cache.get(e);return nc(n)?t:n}getBoolean(e,t){const n=this.get(e);return nc(n)?t:n==="true"}getNumber(e,t){const n=this.get(e);return nc(n)?t:parseInt(n,10)}async set(e,t,n=!1){if(this.state===vy.Closed)return;if(nc(t))return this.delete(e,n);const r=va(t)||Array.isArray(t)?PKe(t):String(t);if(this.cache.get(e)!==r)return this.cache.set(e,r),this.pendingInserts.set(e,r),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:n}),this.doFlush()}async delete(e,t=!1){if(!(this.state===vy.Closed||!this.cache.delete(e)))return this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:t}),this.doFlush()}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}async flushPending(){if(!this.hasPending)return;const e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally(()=>{var t;if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)(t=this.whenFlushedCallbacks.pop())===null||t===void 0||t()})}async doFlush(e){return this.options.hint===Xy.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)}}Yy.DEFAULT_FLUSH_DELAY=100;class l9{constructor(){this.onDidChangeItemsExternal=Je.None,this.items=new Map}async updateItems(e){var t,n;(t=e.insert)===null||t===void 0||t.forEach((r,o)=>this.items.set(o,r)),(n=e.delete)===null||n===void 0||n.forEach(r=>this.items.delete(r))}}const DM="__$__targetStorageMarker",dd=yn("storageService");var cI;(function(i){i[i.NONE=0]="NONE",i[i.SHUTDOWN=1]="SHUTDOWN"})(cI||(cI={}));function Iqe(i){const e=i.get(DM);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}class t3 extends fe{constructor(e={flushInterval:t3.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new Lb),this._onDidChangeTarget=this._register(new Lb),this._onWillSaveState=this._register(new se),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,t,n){return Je.filter(this._onDidChangeValue.event,r=>r.scope===e&&(t===void 0||r.key===t),n)}emitDidChangeValue(e,t){const{key:n,external:r}=t;if(n===DM){switch(e){case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:n,target:this.getKeyTargets(e)[n],external:r})}get(e,t,n){var r;return(r=this.getStorage(t))===null||r===void 0?void 0:r.get(e,n)}getBoolean(e,t,n){var r;return(r=this.getStorage(t))===null||r===void 0?void 0:r.getBoolean(e,n)}getNumber(e,t,n){var r;return(r=this.getStorage(t))===null||r===void 0?void 0:r.getNumber(e,n)}store(e,t,n,r,o=!1){if(nc(t)){this.remove(e,n,o);return}this.withPausedEmitters(()=>{var s;this.updateKeyTarget(e,n,r),(s=this.getStorage(n))===null||s===void 0||s.set(e,t,o)})}remove(e,t,n=!1){this.withPausedEmitters(()=>{var r;this.updateKeyTarget(e,t,void 0),(r=this.getStorage(t))===null||r===void 0||r.delete(e,n)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,n,r=!1){var o,s;const a=this.getKeyTargets(t);typeof n=="number"?a[e]!==n&&(a[e]=n,(o=this.getStorage(t))===null||o===void 0||o.set(DM,JSON.stringify(a),r)):typeof a[e]=="number"&&(delete a[e],(s=this.getStorage(t))===null||s===void 0||s.set(DM,JSON.stringify(a),r))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?Iqe(t):Object.create(null)}}t3.DEFAULT_FLUSH_INTERVAL=60*1e3;class kqe extends t3{constructor(){super(),this.applicationStorage=this._register(new Yy(new l9,{hint:Xy.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new Yy(new l9,{hint:Xy.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new Yy(new l9,{hint:Xy.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(1,e))),this._register(this.profileStorage.onDidChangeStorage(e=>this.emitDidChangeValue(0,e))),this._register(this.applicationStorage.onDidChangeStorage(e=>this.emitDidChangeValue(-1,e)))}getStorage(e){switch(e){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}}function Tqe(i,e){const t={...e};for(const n in i){const r=i[n];t[n]=r!==void 0?ht(r):void 0}return t}const Nqe={keybindingLabelBackground:ht(tWe),keybindingLabelForeground:ht(nWe),keybindingLabelBorder:ht(iWe),keybindingLabelBottomBorder:ht(rWe),keybindingLabelShadow:ht(Yg)},Rqe={buttonForeground:ht(SL),buttonSeparator:ht(z7e),buttonBackground:ht(xL),buttonHoverBackground:ht(U7e),buttonSecondaryForeground:ht(K7e),buttonSecondaryBackground:ht(IH),buttonSecondaryHoverBackground:ht(G7e),buttonBorder:ht(j7e)},Mqe={progressBarBackground:ht(X7e)},OP={inputActiveOptionBorder:ht(Xq),inputActiveOptionForeground:ht(Yq),inputActiveOptionBackground:ht(W0)};ht(AWe),ht(OWe),ht(PWe);ht(Nr),ht(Qg),ht(Yg),ht(Sn),ht(QWe),ht(JWe),ht(e$e),ht(R7e);const FP={inputBackground:ht(Jme),inputForeground:ht(eve),inputBorder:ht(tve),inputValidationInfoBorder:ht(P7e),inputValidationInfoBackground:ht(M7e),inputValidationInfoForeground:ht(A7e),inputValidationWarningBorder:ht(B7e),inputValidationWarningBackground:ht(O7e),inputValidationWarningForeground:ht(F7e),inputValidationErrorBorder:ht(H7e),inputValidationErrorBackground:ht(W7e),inputValidationErrorForeground:ht($7e)},Aqe={listFilterWidgetBackground:ht(DWe),listFilterWidgetOutline:ht(IWe),listFilterWidgetNoMatchesOutline:ht(kWe),listFilterWidgetShadow:ht(TWe),inputBoxStyles:FP,toggleStyles:OP},K_e={badgeBackground:ht(vM),badgeForeground:ht(q7e),badgeBorder:ht(Sn)};ht(jWe),ht(UWe),ht(are),ht(are),ht(KWe);const R_={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:ht(mWe),listFocusForeground:ht(vWe),listFocusOutline:ht(_We),listActiveSelectionBackground:ht(ip),listActiveSelectionForeground:ht(Sf),listActiveSelectionIconForeground:ht(kL),listFocusAndSelectionOutline:ht(bWe),listFocusAndSelectionBackground:ht(ip),listFocusAndSelectionForeground:ht(Sf),listInactiveSelectionBackground:ht(CWe),listInactiveSelectionIconForeground:ht(wWe),listInactiveSelectionForeground:ht(yWe),listInactiveFocusBackground:ht(SWe),listInactiveFocusOutline:ht(xWe),listHoverBackground:ht(ove),listHoverForeground:ht(sve),listDropOverBackground:ht(LWe),listDropBetweenBackground:ht(EWe),listSelectionOutline:ht(zi),listHoverOutline:ht(zi),treeIndentGuidesStroke:ht(TL),treeInactiveIndentGuidesStroke:ht(NWe),tableColumnsBorder:ht(RWe),tableOddRowsBackgroundColor:ht(MWe)};function RS(i){return Tqe(i,R_)}const Pqe={selectBackground:ht(yf),selectListBackground:ht(V7e),selectForeground:ht(Zg),decoratorRightForeground:ht(nve),selectBorder:ht(oy),focusBorder:ht(qc),listFocusBackground:ht(H0),listInactiveSelectionIconForeground:ht(sy),listFocusForeground:ht($0),listFocusOutline:T7e(zi,me.transparent.toString()),listHoverBackground:ht(ove),listHoverForeground:ht(sve),listHoverOutline:ht(zi),selectListBorder:ht(Jg),listBackground:void 0,listActiveSelectionBackground:void 0,listActiveSelectionForeground:void 0,listActiveSelectionIconForeground:void 0,listFocusAndSelectionBackground:void 0,listDropOverBackground:void 0,listDropBetweenBackground:void 0,listInactiveSelectionBackground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusBackground:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listFocusAndSelectionForeground:void 0,listFocusAndSelectionOutline:void 0,listInactiveFocusForeground:void 0,tableColumnsBorder:void 0,tableOddRowsBackgroundColor:void 0,treeIndentGuidesStroke:void 0,treeInactiveIndentGuidesStroke:void 0},Oqe={shadowColor:ht(Yg),borderColor:ht(FWe),foregroundColor:ht(BWe),backgroundColor:ht(WWe),selectionForegroundColor:ht($We),selectionBackgroundColor:ht(HWe),selectionBorderColor:ht(VWe),separatorColor:ht(zWe),scrollbarShadow:ht(LL),scrollbarSliderBackground:ht(EL),scrollbarSliderHoverBackground:ht(DL),scrollbarSliderActiveBackground:ht(IL)};var n3=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Xa=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};function Fqe(i,e,t,n){const r=i.getActions(e),o=Xg.getInstance(),s=o.keyStatus.altKey||(Rs||Da)&&o.keyStatus.shiftKey;G_e(r,t,s,n?a=>a===n:a=>a==="navigation")}function i3(i,e,t,n,r,o){const s=i.getActions(e);G_e(s,t,!1,typeof n=="string"?l=>l===n:n,r,o)}function G_e(i,e,t,n=s=>s==="navigation",r=()=>!1,o=!1){let s,a;Array.isArray(e)?(s=e,a=e):(s=e.primary,a=e.secondary);const l=new Set;for(const[c,u]of i){let d;n(c)?(d=s,d.length>0&&o&&d.push(new lo)):(d=a,d.length>0&&d.push(new lo));for(let h of u){t&&(h=h instanceof pc&&h.alt?h.alt:h);const f=d.push(h);h instanceof Lw&&l.add({group:c,action:h,index:f-1})}}for(const{group:c,action:u,index:d}of l){const h=n(c)?s:a,f=u.actions;r(u,c,h.length)&&h.splice(d,1,...f)}}let t_=class extends jw{constructor(e,t,n,r,o,s,a,l){super(void 0,e,{icon:!!(e.class||e.item.icon),label:!e.class&&!e.item.icon,draggable:t==null?void 0:t.draggable,keybinding:t==null?void 0:t.keybinding,hoverDelegate:t==null?void 0:t.hoverDelegate}),this._keybindingService=n,this._notificationService=r,this._contextKeyService=o,this._themeService=s,this._contextMenuService=a,this._accessibilityService=l,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new Ho),this._altKey=Xg.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}async onClick(e){e.preventDefault(),e.stopPropagation();try{await this.actionRunner.run(this._commandAction,this._context)}catch(t){this._notificationService.error(t)}}render(e){if(super.render(e),e.classList.add("menu-entry"),this.options.icon&&this._updateItemClass(this._menuItemAction.item),this._menuItemAction.alt){let t=!1;const n=()=>{var r;const o=!!(!((r=this._menuItemAction.alt)===null||r===void 0)&&r.enabled)&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);o!==this._wantsAltCommand&&(this._wantsAltCommand=o,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(n)),this._register(ye(e,"mouseleave",r=>{t=!1,n()})),this._register(ye(e,"mouseenter",r=>{t=!0,n()})),n()}}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){var e;const t=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),n=t&&t.getLabel(),r=this._commandAction.tooltip||this._commandAction.label;let o=n?w("titleAndKb","{0} ({1})",r,n):r;if(!this._wantsAltCommand&&(!((e=this._menuItemAction.alt)===null||e===void 0)&&e.enabled)){const s=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,a=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),l=a&&a.getLabel(),c=l?w("titleAndKb","{0} ({1})",s,l):s;o=w("titleAndKbAndAlt",`{0} -[{1}] {2}`,o,zX.modifierLabels[yl].altKey,c)}return o}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:t,label:n}=this;if(!t||!n)return;const r=this._commandAction.checked&&Dqe(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(r)if(Wt.isThemeIcon(r)){const o=Wt.asClassNameArray(r);n.classList.add(...o),this._itemClassDispose.value=Rt(()=>{n.classList.remove(...o)})}else n.style.backgroundImage=Pw(this._themeService.getColorTheme().type)?Gv(r.dark):Gv(r.light),n.classList.add("icon"),this._itemClassDispose.value=Zu(Rt(()=>{n.style.backgroundImage="",n.classList.remove("icon")}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}};t_=n3([Xa(2,ci),Xa(3,$r),Xa(4,Vt),Xa(5,To),Xa(6,Ol),Xa(7,ud)],t_);let kV=class extends PP{constructor(e,t,n,r,o){var s,a,l;const c={...t,menuAsChild:(s=t==null?void 0:t.menuAsChild)!==null&&s!==void 0?s:!1,classNames:(a=t==null?void 0:t.classNames)!==null&&a!==void 0?a:Wt.isThemeIcon(e.item.icon)?Wt.asClassName(e.item.icon):void 0,keybindingProvider:(l=t==null?void 0:t.keybindingProvider)!==null&&l!==void 0?l:u=>n.lookupKeybinding(u.id)};super(e,{getActions:()=>e.actions},r,c),this._keybindingService=n,this._contextMenuService=r,this._themeService=o}render(e){super.render(e),Xn(this.element),e.classList.add("menu-entry");const t=this._action,{icon:n}=t.item;if(n&&!Wt.isThemeIcon(n)){this.element.classList.add("icon");const r=()=>{this.element&&(this.element.style.backgroundImage=Pw(this._themeService.getColorTheme().type)?Gv(n.dark):Gv(n.light))};r(),this._register(this._themeService.onDidColorThemeChange(()=>{r()}))}}};kV=n3([Xa(2,ci),Xa(3,Ol),Xa(4,To)],kV);let TV=class extends Wd{constructor(e,t,n,r,o,s,a,l){var c,u,d;super(null,e),this._keybindingService=n,this._notificationService=r,this._contextMenuService=o,this._menuService=s,this._instaService=a,this._storageService=l,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let h;const f=t!=null&&t.persistLastActionId?l.get(this._storageKey,1):void 0;f&&(h=e.actions.find(p=>f===p.id)),h||(h=e.actions[0]),this._defaultAction=this._instaService.createInstance(t_,h,{keybinding:this._getDefaultActionKeybindingLabel(h)});const g={keybindingProvider:p=>this._keybindingService.lookupKeybinding(p.id),...t,menuAsChild:(c=t==null?void 0:t.menuAsChild)!==null&&c!==void 0?c:!0,classNames:(u=t==null?void 0:t.classNames)!==null&&u!==void 0?u:["codicon","codicon-chevron-down"],actionRunner:(d=t==null?void 0:t.actionRunner)!==null&&d!==void 0?d:new Nb};this._dropdown=new PP(e,e.actions,this._contextMenuService,g),this._register(this._dropdown.actionRunner.onDidRun(p=>{p.action instanceof pc&&this.update(p.action)}))}update(e){var t;!((t=this._options)===null||t===void 0)&&t.persistLastActionId&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(t_,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends Nb{async runAction(n,r){await n.run(void 0)}},this._container&&this._defaultAction.render(Tq(this._container,He(".action-container")))}_getDefaultActionKeybindingLabel(e){var t;let n;if(!((t=this._options)===null||t===void 0)&&t.renderKeybindingWithDefaultActionLabel){const r=this._keybindingService.lookupKeybinding(e.id);r&&(n=`(${r.getLabel()})`)}return n}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=He(".action-container");this._defaultAction.render(ke(this._container,t)),this._register(ye(t,Ge.KEY_DOWN,r=>{const o=new Ai(r);o.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),o.stopPropagation())}));const n=He(".dropdown-action-container");this._dropdown.render(ke(this._container,n)),this._register(ye(n,Ge.KEY_DOWN,r=>{var o;const s=new Ai(r);s.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),(o=this._defaultAction.element)===null||o===void 0||o.focus(),s.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()}};TV=n3([Xa(2,ci),Xa(3,$r),Xa(4,Ol),Xa(5,hu),Xa(6,Ot),Xa(7,dd)],TV);let NV=class extends xqe{constructor(e,t){super(null,e,e.actions.map(n=>({text:n.id===lo.ID?"─────────":n.label,isDisabled:!n.enabled})),0,t,Pqe,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex(n=>n.checked)))}render(e){super.render(e),e.style.borderColor=ht(oy)}runAction(e,t){const n=this.action.actions[t];n&&this.actionRunner.run(n)}};NV=n3([Xa(1,ng)],NV);function q_e(i,e,t){return e instanceof pc?i.createInstance(t_,e,t):e instanceof TD?e.item.isSelection?i.createInstance(NV,e):e.item.rememberDefaultAction?i.createInstance(TV,e,{...t,persistLastActionId:!0}):i.createInstance(kV,e,t):void 0}class au extends fe{constructor(e,t={}){var n,r,o,s,a,l,c;super(),this._actionRunnerDisposables=this._register(new Te),this.viewItemDisposables=this._register(new lq),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new se),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new se({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new se),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new se),this.onWillRun=this._onWillRun.event,this.options=t,this._context=(n=t.context)!==null&&n!==void 0?n:null,this._orientation=(r=this.options.orientation)!==null&&r!==void 0?r:0,this._triggerKeys={keyDown:(s=(o=this.options.triggerKeys)===null||o===void 0?void 0:o.keyDown)!==null&&s!==void 0?s:!1,keys:(l=(a=this.options.triggerKeys)===null||a===void 0?void 0:a.keys)!==null&&l!==void 0?l:[3,10]},this._hoverDelegate=(c=t.hoverDelegate)!==null&&c!==void 0?c:this._register(Vp("element",!0)),this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new Nb,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(h=>this._onDidRun.fire(h))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(h=>this._onWillRun.fire(h))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar";let u,d;switch(this._orientation){case 0:u=[15],d=[17];break;case 1:u=[16],d=[18],this.domNode.className+=" vertical";break}this._register(ye(this.domNode,Ge.KEY_DOWN,h=>{const f=new Ai(h);let g=!0;const p=typeof this.focusedItem=="number"?this.viewItems[this.focusedItem]:void 0;u&&(f.equals(u[0])||f.equals(u[1]))?g=this.focusPrevious():d&&(f.equals(d[0])||f.equals(d[1]))?g=this.focusNext():f.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():f.equals(14)?g=this.focusFirst():f.equals(13)?g=this.focusLast():f.equals(2)&&p instanceof Wd&&p.trapsArrowNavigation?g=this.focusNext():this.isTriggerKeyEvent(f)?this._triggerKeys.keyDown?this.doTrigger(f):this.triggerKeyDown=!0:g=!1,g&&(f.preventDefault(),f.stopPropagation())})),this._register(ye(this.domNode,Ge.KEY_UP,h=>{const f=new Ai(h);this.isTriggerKeyEvent(f)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(f)),f.preventDefault(),f.stopPropagation()):(f.equals(2)||f.equals(1026)||f.equals(16)||f.equals(18)||f.equals(15)||f.equals(17))&&this.updateFocusedItem()})),this.focusTracker=this._register(dh(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(fs()===this.domNode||!es(fs(),this.domNode))&&(this._onDidBlur.fire(),this.previouslyFocusedItem=this.focusedItem,this.focusedItem=void 0,this.triggerKeyDown=!1)})),this._register(this.focusTracker.onDidFocus(()=>this.updateFocusedItem())),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.options.highlightToggledItems&&this.actionsList.classList.add("highlight-toggled"),this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}refreshRole(){this.length()>=1?this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"):this.actionsList.setAttribute("role","presentation")}setFocusable(e){if(this.focusable=e,this.focusable){const t=this.viewItems.find(n=>n instanceof Wd&&n.isEnabled());t instanceof Wd&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof Wd&&t.setFocusable(!1)})}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(n=>{t=t||e.equals(n)}),t}updateFocusedItem(){var e,t;for(let n=0;nt.setActionContext(e))}get actionRunner(){return this._actionRunner}set actionRunner(e){this._actionRunner=e,this._actionRunnerDisposables.clear(),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(t=>this._onDidRun.fire(t))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(t=>this._onWillRun.fire(t))),this.viewItems.forEach(t=>t.actionRunner=e)}getContainer(){return this.domNode}getAction(e){var t;if(typeof e=="number")return(t=this.viewItems[e])===null||t===void 0?void 0:t.action;if(e instanceof HTMLElement){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let n=0;n{const s=document.createElement("li");s.className="action-item",s.setAttribute("role","presentation");let a;const l={hoverDelegate:this._hoverDelegate,...t};this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(o,l)),a||(a=new jw(this.context,o,l)),this.options.allowContextMenu||this.viewItemDisposables.set(a,ye(s,Ge.CONTEXT_MENU,c=>{hn.stop(c,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(s),this.focusable&&a instanceof Wd&&this.viewItems.length===0&&a.setFocusable(!0),r===null||r<0||r>=this.actionsList.children.length?(this.actionsList.appendChild(s),this.viewItems.push(a)):(this.actionsList.insertBefore(s,this.actionsList.children[r]),this.viewItems.splice(r,0,a),r++)}),typeof this.focusedItem=="number"&&this.focus(this.focusedItem),this.refreshRole()}clear(){this.isEmpty()||(this.viewItems=si(this.viewItems),this.viewItemDisposables.clearAndDisposeAll(),Ns(this.actionsList),this.refreshRole())}length(){return this.viewItems.length}isEmpty(){return this.viewItems.length===0}focus(e){let t=!1,n;if(e===void 0?t=!0:typeof e=="number"?n=e:typeof e=="boolean"&&(t=e),t&&typeof this.focusedItem>"u"){const r=this.viewItems.findIndex(o=>o.isEnabled());this.focusedItem=r===-1?void 0:r,this.updateFocus(void 0,void 0,!0)}else n!==void 0&&(this.focusedItem=n),this.updateFocus(void 0,void 0,!0)}focusFirst(){return this.focusedItem=this.length()-1,this.focusNext(!0)}focusLast(){return this.focusedItem=0,this.focusPrevious(!0)}focusNext(e){if(typeof this.focusedItem>"u")this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let n;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,n=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!n.isEnabled()||n.action.id===lo.ID));return this.updateFocus(),!0}focusPrevious(e){if(typeof this.focusedItem>"u")this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let n;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}n=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!n.isEnabled()||n.action.id===lo.ID));return this.updateFocus(!0),!0}updateFocus(e,t,n=!1){var r,o;typeof this.focusedItem>"u"&&this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem!==void 0&&this.previouslyFocusedItem!==this.focusedItem&&((r=this.viewItems[this.previouslyFocusedItem])===null||r===void 0||r.blur());const s=this.focusedItem!==void 0?this.viewItems[this.focusedItem]:void 0;if(s){let a=!0;CD(s.focus)||(a=!1),this.options.focusOnlyEnabledItems&&CD(s.isEnabled)&&!s.isEnabled()&&(a=!1),s.action.id===lo.ID&&(a=!1),a?(n||this.previouslyFocusedItem!==this.focusedItem)&&(s.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0),a&&((o=s.showHover)===null||o===void 0||o.call(s))}}doTrigger(e){if(typeof this.focusedItem>"u")return;const t=this.viewItems[this.focusedItem];if(t instanceof Wd){const n=t._context===null||t._context===void 0?e:t._context;this.run(t._action,n)}}async run(e,t){await this._actionRunner.run(e,t)}dispose(){this._context=void 0,this.viewItems=si(this.viewItems),this.getContainer().remove(),super.dispose()}}const RV=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,c9=/(&)?(&)([^\s&])/g;var BP;(function(i){i[i.Right=0]="Right",i[i.Left=1]="Left"})(BP||(BP={}));let X_e=class IM extends au{constructor(e,t,n,r){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const o=document.createElement("div");o.classList.add("monaco-menu"),o.setAttribute("role","presentation"),super(o,{orientation:1,actionViewItemProvider:c=>this.doGetActionViewItem(c,n,s),context:n.context,actionRunner:n.actionRunner,ariaLabel:n.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...Ln||Da?[10]:[]],keyDown:!0}}),this.menuStyles=r,this.menuElement=o,this.actionsList.tabIndex=0,this.initializeOrUpdateStyleSheet(e,r),this._register(wi.addTarget(o)),this._register(ye(o,Ge.KEY_DOWN,c=>{new Ai(c).equals(2)&&c.preventDefault()})),n.enableMnemonics&&this._register(ye(o,Ge.KEY_DOWN,c=>{const u=c.key.toLocaleLowerCase();if(this.mnemonics.has(u)){hn.stop(c,!0);const d=this.mnemonics.get(u);if(d.length===1&&(d[0]instanceof Joe&&d[0].container&&this.focusItemByElement(d[0].container),d[0].onClick(c)),d.length>1){const h=d.shift();h&&h.container&&(this.focusItemByElement(h.container),d.push(h)),this.mnemonics.set(u,d)}}})),Da&&this._register(ye(o,Ge.KEY_DOWN,c=>{const u=new Ai(c);u.equals(14)||u.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),hn.stop(c,!0)):(u.equals(13)||u.equals(12))&&(this.focusedItem=0,this.focusPrevious(),hn.stop(c,!0))})),this._register(ye(this.domNode,Ge.MOUSE_OUT,c=>{const u=c.relatedTarget;es(u,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),c.stopPropagation())})),this._register(ye(this.actionsList,Ge.MOUSE_OVER,c=>{let u=c.target;if(!(!u||!es(u,this.actionsList)||u===this.actionsList)){for(;u.parentElement!==this.actionsList&&u.parentElement!==null;)u=u.parentElement;if(u.classList.contains("action-item")){const d=this.focusedItem;this.setFocusedItem(u),d!==this.focusedItem&&this.updateFocus()}}})),this._register(wi.addTarget(this.actionsList)),this._register(ye(this.actionsList,Si.Tap,c=>{let u=c.initialTarget;if(!(!u||!es(u,this.actionsList)||u===this.actionsList)){for(;u.parentElement!==this.actionsList&&u.parentElement!==null;)u=u.parentElement;if(u.classList.contains("action-item")){const d=this.focusedItem;this.setFocusedItem(u),d!==this.focusedItem&&this.updateFocus()}}}));const s={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new Hk(o,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const a=this.scrollableElement.getDomNode();a.style.position="",this.styleScrollElement(a,r),this._register(ye(o,Si.Change,c=>{hn.stop(c,!0);const u=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:u-c.translationY})})),this._register(ye(a,Ge.MOUSE_UP,c=>{c.preventDefault()}));const l=Pt(e);o.style.maxHeight=`${Math.max(10,l.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter((c,u)=>{var d;return!((d=n.submenuIds)===null||d===void 0)&&d.has(c.id)?(console.warn(`Found submenu cycle: ${c.id}`),!1):!(c instanceof lo&&(u===t.length-1||u===0||t[u-1]instanceof lo))}),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(c=>!(c instanceof ese)).forEach((c,u,d)=>{c.updatePositionInSet(u+1,d.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(GA(e)?this.styleSheet=gc(e):(IM.globalStyleSheet||(IM.globalStyleSheet=gc()),this.styleSheet=IM.globalStyleSheet)),this.styleSheet.textContent=Wqe(t,GA(e))}styleScrollElement(e,t){var n,r;const o=(n=t.foregroundColor)!==null&&n!==void 0?n:"",s=(r=t.backgroundColor)!==null&&r!==void 0?r:"",a=t.borderColor?`1px solid ${t.borderColor}`:"",l="5px",c=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=a,e.style.borderRadius=l,e.style.color=o,e.style.backgroundColor=s,e.style.boxShadow=c}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}focusItemByElement(e){const t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t{this.element&&(this._register(ye(this.element,Ge.MOUSE_UP,o=>{if(hn.stop(o,!0),ru){if(new Uu(Pt(this.element),o).rightButton)return;this.onClick(o)}else setTimeout(()=>{this.onClick(o)},0)})),this._register(ye(this.element,Ge.CONTEXT_MENU,o=>{hn.stop(o,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=ke(this.element,He("a.action-menu-item")),this._action.id===lo.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=ke(this.item,He("span.menu-item-check"+Wt.asCSSSelector(Xe.menuSelection))),this.check.setAttribute("role","none"),this.label=ke(this.item,He("span.action-label")),this.options.label&&this.options.keybinding&&(ke(this.item,He("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked(),this.applyStyle())}blur(){super.blur(),this.applyStyle()}focus(){var e;super.focus(),(e=this.item)===null||e===void 0||e.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){var e;if(this.label&&this.options.label){Ns(this.label);let t=BX(this.action.label);if(t){const n=Bqe(t);this.options.enableMnemonics||(t=n),this.label.setAttribute("aria-label",n.replace(/&&/g,"&"));const r=RV.exec(t);if(r){t=HA(t),c9.lastIndex=0;let o=c9.exec(t);for(;o&&o[1];)o=c9.exec(t);const s=a=>a.replace(/&&/g,"&");o?this.label.append(Ik(s(t.substr(0,o.index))," "),He("u",{"aria-hidden":"true"},o[3]),Mpe(s(t.substr(o.index+o[0].length))," ")):this.label.innerText=s(t).trim(),(e=this.item)===null||e===void 0||e.setAttribute("aria-keyshortcuts",(r[1]?r[1]:r[3]).toLocaleLowerCase())}else this.label.innerText=t.replace(/&&/g,"&").trim()}}}updateTooltip(){}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.action.class||"",this.label.classList.add("icon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" ")),this.updateEnabled()):this.label&&this.label.classList.remove("icon")}updateEnabled(){this.action.enabled?(this.element&&(this.element.classList.remove("disabled"),this.element.removeAttribute("aria-disabled")),this.item&&(this.item.classList.remove("disabled"),this.item.removeAttribute("aria-disabled"),this.item.tabIndex=0)):(this.element&&(this.element.classList.add("disabled"),this.element.setAttribute("aria-disabled","true")),this.item&&(this.item.classList.add("disabled"),this.item.setAttribute("aria-disabled","true")))}updateChecked(){if(!this.item)return;const e=this.action.checked;this.item.classList.toggle("checked",!!e),e!==void 0?(this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked",e?"true":"false")):(this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked",""))}getMnemonic(){return this.mnemonic}applyStyle(){const e=this.element&&this.element.classList.contains("focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,n=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,r=e&&this.menuStyle.selectionBorderColor?`1px solid ${this.menuStyle.selectionBorderColor}`:"",o=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=t??"",this.item.style.backgroundColor=n??"",this.item.style.outline=r,this.item.style.outlineOffset=o),this.check&&(this.check.style.color=t??"")}}class Joe extends Y_e{constructor(e,t,n,r,o){super(e,e,r,o),this.submenuActions=t,this.parentData=n,this.submenuOptions=r,this.mysubmenu=null,this.submenuDisposables=this._register(new Te),this.mouseOver=!1,this.expandDirection=r&&r.expandDirection!==void 0?r.expandDirection:BP.Right,this.showScheduler=new pi(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new pi(()=>{this.element&&!es(fs(),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=ke(this.item,He("span.submenu-indicator"+Wt.asCSSSelector(Xe.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(ye(this.element,Ge.KEY_UP,t=>{const n=new Ai(t);(n.equals(17)||n.equals(3))&&(hn.stop(t,!0),this.createSubmenu(!0))})),this._register(ye(this.element,Ge.KEY_DOWN,t=>{const n=new Ai(t);fs()===this.item&&(n.equals(17)||n.equals(3))&&hn.stop(t,!0)})),this._register(ye(this.element,Ge.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(ye(this.element,Ge.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(ye(this.element,Ge.FOCUS_OUT,t=>{this.element&&!es(fs(),this.element)&&this.hideScheduler.schedule()})),this._register(this.parentData.parent.onScroll(()=>{this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))})))}updateEnabled(){}onClick(e){hn.stop(e,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(e){if(this.parentData.submenu&&(e||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch{}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,n,r){const o={top:0,left:0};return o.left=py(e.width,t.width,{position:r===BP.Right?0:1,offset:n.left,size:n.width}),o.left>=n.left&&o.left{new Ai(u).equals(15)&&(hn.stop(u,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(ye(this.submenuContainer,Ge.KEY_DOWN,u=>{new Ai(u).equals(15)&&hn.stop(u,!0)})),this.submenuDisposables.add(this.parentData.submenu.onDidCancel(()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)})),this.parentData.submenu.focus(e),this.mysubmenu=this.parentData.submenu}}updateAriaExpanded(e){var t;this.item&&((t=this.item)===null||t===void 0||t.setAttribute("aria-expanded",e))}applyStyle(){super.applyStyle();const t=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=t??"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class ese extends jw{constructor(e,t,n,r){super(e,t,n),this.menuStyles=r}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}}function Bqe(i){const e=RV,t=e.exec(i);if(!t)return i;const n=!t[1];return i.replace(e,n?"$2$3":"").trim()}function tse(i){const e=kpe()[i.id];return`.codicon-${i.id}:before { content: '\\${e.toString(16)}'; }`}function Wqe(i,e){let t=` +`)}}const gqe={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropOverBackground:"#383B3D",listDropBetweenBackground:"#EEEEEE",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:me.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:me.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:me.fromHex("#cccccc").transparent(.04).toString(),listBackground:void 0,listFocusForeground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusForeground:void 0,listInactiveFocusBackground:void 0,listHoverForeground:void 0,listFocusOutline:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listHoverOutline:void 0},pqe={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function mqe(i,e){const t=i.indexOf(e);if(t===-1)return[];const n=[];let r=t-1;for(;r>=0&&i[r]===e-(t-r);)n.push(i[r--]);for(n.reverse(),r=t;r=i.length)t.push(e[r++]);else if(r>=e.length)t.push(i[n++]);else if(i[n]===e[r]){t.push(i[n]),n++,r++;continue}else i[n]=i.length)t.push(e[r++]);else if(r>=e.length)t.push(i[n++]);else if(i[n]===e[r]){n++,r++;continue}else i[n]i-e;class _qe{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,n,r){let o=0;for(const s of this.renderers)s.renderElement(e,t,n[o++],r)}disposeElement(e,t,n,r){var o;let s=0;for(const a of this.renderers)(o=a.disposeElement)===null||o===void 0||o.call(a,e,t,n[s],r),s+=1}disposeTemplate(e){let t=0;for(const n of this.renderers)n.disposeTemplate(e[t++])}}class bqe{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return e}renderElement(e,t,n){const r=this.accessibilityProvider.getAriaLabel(e);r?n.setAttribute("aria-label",r):n.removeAttribute("aria-label");const o=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof o=="number"?n.setAttribute("aria-level",`${o}`):n.removeAttribute("aria-level")}disposeTemplate(e){}}class Cqe{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){var n,r;(r=(n=this.dnd).onDragStart)===null||r===void 0||r.call(n,e,t)}onDragOver(e,t,n,r,o){return this.dnd.onDragOver(e,t,n,r,o)}onDragLeave(e,t,n,r){var o,s;(s=(o=this.dnd).onDragLeave)===null||s===void 0||s.call(o,e,t,n,r)}onDragEnd(e){var t,n;(n=(t=this.dnd).onDragEnd)===null||n===void 0||n.call(t,e)}drop(e,t,n,r,o){this.dnd.drop(e,t,n,r,o)}dispose(){this.dnd.dispose()}}let wc=class{get onDidChangeFocus(){return Je.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return Je.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e),this.disposables)}get domId(){return this.view.domId}get onDidScroll(){return this.view.onDidScroll}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseDown(){return this.view.onMouseDown}get onMouseOver(){return this.view.onMouseOver}get onMouseOut(){return this.view.onMouseOut}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1;const t=Je.chain(this.disposables.add(new wn(this.view.domNode,"keydown")).event,o=>o.map(s=>new Ai(s)).filter(s=>e=s.keyCode===58||s.shiftKey&&s.keyCode===68).map(s=>hn.stop(s,!0)).filter(()=>!1)),n=Je.chain(this.disposables.add(new wn(this.view.domNode,"keyup")).event,o=>o.forEach(()=>e=!1).map(s=>new Ai(s)).filter(s=>s.keyCode===58||s.shiftKey&&s.keyCode===68).map(s=>hn.stop(s,!0)).map(({browserEvent:s})=>{const a=this.getFocus(),l=a.length?a[0]:void 0,c=typeof l<"u"?this.view.element(l):void 0,u=typeof l<"u"?this.view.domElement(l):this.view.domNode;return{index:l,element:c,anchor:u,browserEvent:s}})),r=Je.chain(this.view.onContextMenu,o=>o.filter(s=>!e).map(({element:s,index:a,browserEvent:l})=>({element:s,index:a,anchor:new Uu(Pt(this.view.domNode),l),browserEvent:l})));return Je.any(t,n,r)}get onKeyDown(){return this.disposables.add(new wn(this.view.domNode,"keydown")).event}get onDidFocus(){return Je.signal(this.disposables.add(new wn(this.view.domNode,"focus",!0)).event)}get onDidBlur(){return Je.signal(this.disposables.add(new wn(this.view.domNode,"blur",!0)).event)}constructor(e,t,n,r,o=pqe){var s,a,l,c;this.user=e,this._options=o,this.focus=new MP("focused"),this.anchor=new MP("anchor"),this.eventBufferer=new uq,this._ariaLabel="",this.disposables=new Te,this._onDidDispose=new se,this.onDidDispose=this._onDidDispose.event;const u=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?(s=this._options.accessibilityProvider)===null||s===void 0?void 0:s.getWidgetRole():"list";this.selection=new aqe(u!=="listbox");const d=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(d.push(new bqe(this.accessibilityProvider)),(l=(a=this.accessibilityProvider).onDidChangeActiveDescendant)===null||l===void 0||l.call(a,this.onDidChangeActiveDescendant,this,this.disposables)),r=r.map(f=>new _qe(f.templateId,[...d,f]));const h={...o,dnd:o.dnd&&new Cqe(this,o.dnd)};if(this.view=this.createListView(t,n,r,h),this.view.domNode.setAttribute("role",u),o.styleController)this.styleController=o.styleController(this.view.domId);else{const f=gc(this.view.domNode);this.styleController=new U_e(f,this.view.domId)}if(this.spliceable=new YGe([new a9(this.focus,this.view,o.identityProvider),new a9(this.selection,this.view,o.identityProvider),new a9(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 hqe(this,this.view)),(typeof o.keyboardSupport!="boolean"||o.keyboardSupport)&&(this.keyboardController=new $_e(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const f=o.keyboardNavigationDelegate||uqe;this.typeNavigationController=new dqe(this,this.view,o.keyboardNavigationLabelProvider,(c=o.keyboardNavigationEventFilter)!==null&&c!==void 0?c:()=>!0,f),this.disposables.add(this.typeNavigationController)}this.mouseController=this.createMouseController(o),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider&&(this.ariaLabel=this.accessibilityProvider.getWidgetAriaLabel()),this._options.multipleSelectionSupport!==!1&&this.view.domNode.setAttribute("aria-multiselectable","true")}createListView(e,t,n,r){return new pu(e,t,n,r)}createMouseController(e){return new z_e(this)}updateOptions(e={}){var t,n;this._options={...this._options,...e},(t=this.typeNavigationController)===null||t===void 0||t.updateOptions(this._options),this._options.multipleSelectionController!==void 0&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),(n=this.keyboardController)===null||n===void 0||n.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,n=[]){if(e<0||e>this.view.length)throw new n0(this.user,`Invalid start index: ${e}`);if(t<0)throw new n0(this.user,`Invalid delete count: ${t}`);t===0&&n.length===0||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,t,n))}rerender(){this.view.rerender()}element(e){return this.view.element(e)}indexOf(e){return this.view.indexOf(e)}indexAt(e){return this.view.indexAt(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get onDidChangeContentHeight(){return this.view.onDidChangeContentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute("aria-label",e)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(e,t){this.view.layout(e,t)}setSelection(e,t){for(const n of e)if(n<0||n>=this.length)throw new n0(this.user,`Invalid index ${n}`);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(e=>this.view.element(e))}setAnchor(e){if(typeof e>"u"){this.anchor.set([]);return}if(e<0||e>=this.length)throw new n0(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return JG(this.anchor.get(),void 0)}getAnchorElement(){const e=this.getAnchor();return typeof e>"u"?void 0:this.element(e)}setFocus(e,t){for(const n of e)if(n<0||n>=this.length)throw new n0(this.user,`Invalid index ${n}`);this.focus.set(e,t)}focusNext(e=1,t=!1,n,r){if(this.length===0)return;const o=this.focus.get(),s=this.findNextIndex(o.length>0?o[0]+e:0,t,r);s>-1&&this.setFocus([s],n)}focusPrevious(e=1,t=!1,n,r){if(this.length===0)return;const o=this.focus.get(),s=this.findPreviousIndex(o.length>0?o[0]-e:0,t,r);s>-1&&this.setFocus([s],n)}async focusNextPage(e,t){let n=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);n=n===0?0:n-1;const r=this.getFocus()[0];if(r!==n&&(r===void 0||n>r)){const o=this.findPreviousIndex(n,!1,t);o>-1&&r!==o?this.setFocus([o],e):this.setFocus([n],e)}else{const o=this.view.getScrollTop();let s=o+this.view.renderHeight;n>r&&(s-=this.view.elementHeight(n)),this.view.setScrollTop(s),this.view.getScrollTop()!==o&&(this.setFocus([]),await Uv(0),await this.focusNextPage(e,t))}}async focusPreviousPage(e,t,n=()=>0){let r;const o=n(),s=this.view.getScrollTop()+o;s===0?r=this.view.indexAt(s):r=this.view.indexAfter(s-1);const a=this.getFocus()[0];if(a!==r&&(a===void 0||a>=r)){const l=this.findNextIndex(r,!1,t);l>-1&&a!==l?this.setFocus([l],e):this.setFocus([r],e)}else{const l=s;this.view.setScrollTop(s-this.view.renderHeight-o),this.view.getScrollTop()+n()!==l&&(this.setFocus([]),await Uv(0),await this.focusPreviousPage(e,t,n))}}focusLast(e,t){if(this.length===0)return;const n=this.findPreviousIndex(this.length-1,!1,t);n>-1&&this.setFocus([n],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,n){if(this.length===0)return;const r=this.findNextIndex(e,!1,n);r>-1&&this.setFocus([r],t)}findNextIndex(e,t=!1,n){for(let r=0;r=this.length&&!t)return-1;if(e=e%this.length,!n||n(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,n){for(let r=0;rthis.view.element(e))}reveal(e,t,n=0){if(e<0||e>=this.length)throw new n0(this.user,`Invalid index ${e}`);const r=this.view.getScrollTop(),o=this.view.elementTop(e),s=this.view.elementHeight(e);if($v(t)){const a=s-this.view.renderHeight+n;this.view.setScrollTop(a*da(t,0,1)+o-n)}else{const a=o+s,l=r+this.view.renderHeight;o=l||(o=l&&s>=this.view.renderHeight?this.view.setScrollTop(o-n):a>=l&&this.view.setScrollTop(a-this.view.renderHeight))}}getRelativeTop(e,t=0){if(e<0||e>=this.length)throw new n0(this.user,`Invalid index ${e}`);const n=this.view.getScrollTop(),r=this.view.elementTop(e),o=this.view.elementHeight(e);if(rn+this.view.renderHeight)return null;const s=o-this.view.renderHeight+t;return Math.abs((n+t-r)/s)}isDOMFocused(){return Mk(this.view.domNode)}getHTMLElement(){return this.view.domNode}getScrollableElement(){return this.view.scrollableElementDomNode}getElementID(e){return this.view.getElementDomId(e)}getElementTop(e){return this.view.elementTop(e)}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map(n=>this.view.element(n)),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 n;!((e=this.accessibilityProvider)===null||e===void 0)&&e.getActiveDescendantId&&(n=this.accessibilityProvider.getActiveDescendantId(this.view.element(t[0]))),this.view.domNode.setAttribute("aria-activedescendant",n||this.view.getElementDomId(t[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const e=this.selection.get();this.view.domNode.classList.toggle("selection-none",e.length===0),this.view.domNode.classList.toggle("selection-single",e.length===1),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}};T_([Rr],wc.prototype,"onDidChangeFocus",null);T_([Rr],wc.prototype,"onDidChangeSelection",null);T_([Rr],wc.prototype,"onContextMenu",null);T_([Rr],wc.prototype,"onKeyDown",null);T_([Rr],wc.prototype,"onDidFocus",null);T_([Rr],wc.prototype,"onDidBlur",null);const z0=He,j_e="selectOption.entry.template";class yqe{get templateId(){return j_e}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=ke(e,z0(".option-text")),t.detail=ke(e,z0(".option-detail")),t.decoratorRight=ke(e,z0(".option-decorator-right")),t}renderElement(e,t,n){const r=n,o=e.text,s=e.detail,a=e.decoratorRight,l=e.isDisabled;r.text.textContent=o,r.detail.textContent=s||"",r.decoratorRight.innerText=a||"",l?r.root.classList.add("option-disabled"):r.root.classList.remove("option-disabled")}disposeTemplate(e){}}class mf extends fe{constructor(e,t,n,r,o){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=r,this.selectBoxOptions=o||Object.create(null),typeof this.selectBoxOptions.minBottomMargin!="number"?this.selectBoxOptions.minBottomMargin=mf.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN:this.selectBoxOptions.minBottomMargin<0&&(this.selectBoxOptions.minBottomMargin=0),this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box monaco-select-box-dropdown-padding",typeof this.selectBoxOptions.ariaLabel=="string"&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),typeof this.selectBoxOptions.ariaDescription=="string"&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._hover=this._register(mC(zp("mouse"),this.selectElement,"")),this._onDidSelect=new se,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(n),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}getHeight(){return 22}getTemplateId(){return j_e}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=He(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=ke(this.selectDropDownContainer,z0(".select-box-details-pane"));const t=ke(this.selectDropDownContainer,z0(".select-box-dropdown-container-width-control")),n=ke(t,z0(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",ke(n,this.widthControlElement),this._dropDownPosition=0,this.styleElement=gc(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(ye(this.selectDropDownContainer,Ge.DRAG_START,r=>{hn.stop(r,!0)}))}registerListeners(){this._register(Sr(this.selectElement,"change",t=>{this.selected=t.target.selectedIndex,this._onDidSelect.fire({index:t.target.selectedIndex,selected:t.target.value}),this.options[this.selected]&&this.options[this.selected].text&&this._hover.update(this.options[this.selected].text)})),this._register(ye(this.selectElement,Ge.CLICK,t=>{hn.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(ye(this.selectElement,Ge.MOUSE_DOWN,t=>{hn.stop(t)}));let e;this._register(ye(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(ye(this.selectElement,"touchend",t=>{hn.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(ye(this.selectElement,Ge.KEY_DOWN,t=>{const n=new Ai(t);let r=!1;Ln?(n.keyCode===18||n.keyCode===16||n.keyCode===10||n.keyCode===3)&&(r=!0):(n.keyCode===18&&n.altKey||n.keyCode===16&&n.altKey||n.keyCode===10||n.keyCode===3)&&(r=!0),r&&(this.showSelectDropDown(),hn.stop(t,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){or(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach((n,r)=>{this.selectElement.add(this.createOption(n.text,r,n.isDisabled)),typeof n.description=="string"&&(this._hasDetails=!0)})),t!==void 0&&(this.select(t),this._currentSelection=this.selected)}setOptionsList(){var e;(e=this.selectList)===null||e===void 0||e.splice(0,this.selectList.length,this.options)}select(e){e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.options[this.selected]&&this.options[this.selected].text&&this._hover.update(this.options[this.selected].text)}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){this.container=e,e.classList.add("select-container"),e.appendChild(this.selectElement),this.styleSelectElement()}initStyleSheet(){const e=[];this.styles.listFocusBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`),this.styles.listFocusForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`),this.styles.decoratorRightForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`),this.styles.selectBackground&&this.styles.selectBorder&&this.styles.selectBorder!==this.styles.selectBackground?(e.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)):this.styles.selectListBorder&&(e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)),this.styles.listHoverForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`),this.styles.listHoverBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`),this.styles.listFocusOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`),this.styles.listHoverOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }"),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }"),this.styleElement.textContent=e.join(` +`)}styleSelectElement(){var e,t,n;const r=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",o=(t=this.styles.selectForeground)!==null&&t!==void 0?t:"",s=(n=this.styles.selectBorder)!==null&&n!==void 0?n:"";this.selectElement.style.backgroundColor=r,this.selectElement.style.color=o,this.selectElement.style.borderColor=s}styleList(){var e,t;const n=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",r=gp(this.styles.selectListBackground,n);this.selectDropDownListContainer.style.backgroundColor=r,this.selectionDetailsPane.style.backgroundColor=r;const o=(t=this.styles.focusBorder)!==null&&t!==void 0?t:"";this.selectDropDownContainer.style.outlineColor=o,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,n){const r=document.createElement("option");return r.value=e,r.text=e,r.disabled=!!n,r}showSelectDropDown(){this.selectionDetailsPane.innerText="",!(!this.contextViewProvider||this._isVisible)&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){!this.contextViewProvider||!this._isVisible||(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{try{e.removeChild(this.selectDropDownContainer)}catch{}}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach((t,n)=>{this.updateDetail(n),this.selectionDetailsPane.offsetHeight>e&&(e=this.selectionDetailsPane.offsetHeight)}),e}layoutSelectDropDown(e){if(this._skipLayout)return!1;if(this.selectList){this.selectDropDownContainer.classList.add("visible");const t=Pt(this.selectElement),n=Br(this.selectElement),r=Pt(this.selectElement).getComputedStyle(this.selectElement),o=parseFloat(r.getPropertyValue("--dropdown-padding-top"))+parseFloat(r.getPropertyValue("--dropdown-padding-bottom")),s=t.innerHeight-n.top-n.height-(this.selectBoxOptions.minBottomMargin||0),a=n.top-mf.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,l=this.selectElement.offsetWidth,c=this.setWidthControlElement(this.widthControlElement),u=Math.max(c,Math.round(l)).toString()+"px";this.selectDropDownContainer.style.width=u,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let d=this.selectList.contentHeight;this._hasDetails&&this._cachedMaxDetailsHeight===void 0&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const h=this._hasDetails?this._cachedMaxDetailsHeight:0,f=d+o+h,g=Math.floor((s-o-h)/this.getHeight()),p=Math.floor((a-o-h)/this.getHeight());if(e)return n.top+n.height>t.innerHeight-22||n.topg&&this.options.length>g?(this._dropDownPosition=1,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=0,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),!0);if(n.top+n.height>t.innerHeight-22||n.tops&&(d=g*this.getHeight())}else f>a&&(d=p*this.getHeight());return this.selectList.layout(d),this.selectList.domFocus(),this.selectList.length>0&&(this.selectList.setFocus([this.selected||0]),this.selectList.reveal(this.selectList.getFocus()[0]||0)),this._hasDetails?(this.selectList.getHTMLElement().style.height=d+o+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=d+o+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=u,this.selectDropDownListContainer.setAttribute("tabindex","0"),this.selectElement.classList.add("synthetic-focus"),this.selectDropDownContainer.classList.add("synthetic-focus"),!0}else return!1}setWidthControlElement(e){let t=0;if(e){let n=0,r=0;this.options.forEach((o,s)=>{const a=o.detail?o.detail.length:0,l=o.decoratorRight?o.decoratorRight.length:0,c=o.text.length+a+l;c>r&&(n=s,r=c)}),e.textContent=this.options[n].text+(this.options[n].decoratorRight?this.options[n].decoratorRight+" ":""),t=ua(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=ke(e,z0(".select-box-dropdown-list-container")),this.listRenderer=new yqe,this.selectList=new wc("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:r=>{let o=r.text;return r.detail&&(o+=`. ${r.detail}`),r.decoratorRight&&(o+=`. ${r.decoratorRight}`),r.description&&(o+=`. ${r.description}`),o},getWidgetAriaLabel:()=>w({key:"selectBox",comment:["Behave like native select dropdown element."]},"Select Box"),getRole:()=>Ln?"":"option",getWidgetRole:()=>"listbox"}}),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new wn(this.selectDropDownListContainer,"keydown")),n=Je.chain(t.event,r=>r.filter(()=>this.selectList.length>0).map(o=>new Ai(o)));this._register(Je.chain(n,r=>r.filter(o=>o.keyCode===3))(this.onEnter,this)),this._register(Je.chain(n,r=>r.filter(o=>o.keyCode===2))(this.onEnter,this)),this._register(Je.chain(n,r=>r.filter(o=>o.keyCode===9))(this.onEscape,this)),this._register(Je.chain(n,r=>r.filter(o=>o.keyCode===16))(this.onUpArrow,this)),this._register(Je.chain(n,r=>r.filter(o=>o.keyCode===18))(this.onDownArrow,this)),this._register(Je.chain(n,r=>r.filter(o=>o.keyCode===12))(this.onPageDown,this)),this._register(Je.chain(n,r=>r.filter(o=>o.keyCode===11))(this.onPageUp,this)),this._register(Je.chain(n,r=>r.filter(o=>o.keyCode===14))(this.onHome,this)),this._register(Je.chain(n,r=>r.filter(o=>o.keyCode===13))(this.onEnd,this)),this._register(Je.chain(n,r=>r.filter(o=>o.keyCode>=21&&o.keyCode<=56||o.keyCode>=85&&o.keyCode<=113))(this.onCharacter,this)),this._register(ye(this.selectList.getHTMLElement(),Ge.POINTER_UP,r=>this.onPointerUp(r))),this._register(this.selectList.onMouseOver(r=>typeof r.index<"u"&&this.selectList.setFocus([r.index]))),this._register(this.selectList.onDidChangeFocus(r=>this.onListFocus(r))),this._register(ye(this.selectDropDownContainer,Ge.FOCUS_OUT,r=>{!this._isVisible||es(r.relatedTarget,this.selectDropDownContainer)||this.onListBlur()})),this.selectList.getHTMLElement().setAttribute("aria-label",this.selectBoxOptions.ariaLabel||""),this.selectList.getHTMLElement().setAttribute("aria-expanded","true"),this.styleList()}onPointerUp(e){if(!this.selectList.length)return;hn.stop(e);const t=e.target;if(!t||t.classList.contains("slider"))return;const n=t.closest(".monaco-list-row");if(!n)return;const r=Number(n.getAttribute("data-index")),o=n.classList.contains("option-disabled");r>=0&&r{for(let s=0;sthis.selected+2)this.selected+=2;else{if(t)return;this.selected++}this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0])}}onUpArrow(e){this.selected>0&&(hn.stop(e,!0),this.options[this.selected-1].isDisabled&&this.selected>1?this.selected-=2:this.selected--,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]))}onPageUp(e){hn.stop(e),this.selectList.focusPreviousPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected>0&&(this.selected--,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)},1)}onHome(e){hn.stop(e),!(this.options.length<2)&&(this.selected=0,this.options[this.selected].isDisabled&&this.selected>1&&this.selected++,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onEnd(e){hn.stop(e),!(this.options.length<2)&&(this.selected=this.options.length-1,this.options[this.selected].isDisabled&&this.selected>1&&this.selected--,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onCharacter(e){const t=Bg.toString(e.keyCode);let n=-1;for(let r=0;r{this._register(ye(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register(Sr(this.selectElement,"click",e=>{hn.stop(e,!0)})),this._register(Sr(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(Sr(this.selectElement,"keydown",e=>{let t=!1;Ln?(e.keyCode===18||e.keyCode===16||e.keyCode===10)&&(t=!0):(e.keyCode===18&&e.altKey||e.keyCode===10||e.keyCode===3)&&(t=!0),t&&e.stopPropagation()}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){(!this.options||!or(this.options,e))&&(this.options=e,this.selectElement.options.length=0,this.options.forEach((n,r)=>{this.selectElement.add(this.createOption(n.text,r,n.isDisabled))})),t!==void 0&&this.select(t)}select(e){this.options.length===0?this.selected=0:e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.selected{this.element&&this.handleActionChangeEvent(r)}))}handleActionChangeEvent(e){e.enabled!==void 0&&this.updateEnabled(),e.checked!==void 0&&this.updateChecked(),e.class!==void 0&&this.updateClass(),e.label!==void 0&&(this.updateLabel(),this.updateTooltip()),e.tooltip!==void 0&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new Nb)),this._actionRunner}set actionRunner(e){this._actionRunner=e}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const t=this.element=e;this._register(wi.addTarget(e));const n=this.options&&this.options.draggable;n&&(e.draggable=!0,ru&&this._register(ye(e,Ge.DRAG_START,r=>{var o;return(o=r.dataTransfer)===null||o===void 0?void 0:o.setData(lI.TEXT,this._action.label)}))),this._register(ye(t,Si.Tap,r=>this.onClick(r,!0))),this._register(ye(t,Ge.MOUSE_DOWN,r=>{n||hn.stop(r,!0),this._action.enabled&&r.button===0&&t.classList.add("active")})),Ln&&this._register(ye(t,Ge.CONTEXT_MENU,r=>{r.button===0&&r.ctrlKey===!0&&this.onClick(r)})),this._register(ye(t,Ge.CLICK,r=>{hn.stop(r,!0),this.options&&this.options.isMenu||this.onClick(r)})),this._register(ye(t,Ge.DBLCLICK,r=>{hn.stop(r,!0)})),[Ge.MOUSE_UP,Ge.MOUSE_OUT].forEach(r=>{this._register(ye(t,r,o=>{hn.stop(o),t.classList.remove("active")}))})}onClick(e,t=!1){var n;hn.stop(e,!0);const r=nc(this._context)?!((n=this.options)===null||n===void 0)&&n.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,r)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}getClass(){return this.action.class}getTooltip(){return this.action.tooltip}updateTooltip(){var e,t,n;if(!this.element)return;const r=(e=this.getTooltip())!==null&&e!==void 0?e:"";if(this.updateAriaLabel(),!((t=this.options.hoverDelegate)===null||t===void 0)&&t.showNativeHover)this.element.title=r;else if(this.customHover)this.customHover.update(r);else{const o=(n=this.options.hoverDelegate)!==null&&n!==void 0?n:zp("element");this.customHover=mC(o,this.element,r),this._store.add(this.customHover)}}updateAriaLabel(){var e;if(this.element){const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.element.setAttribute("aria-label",t)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class jw extends Wd{constructor(e,t,n){super(e,t,n),this.options=n,this.options.icon=n.icon!==void 0?n.icon:!1,this.options.label=n.label!==void 0?n.label:!0,this.cssClass=""}render(e){super.render(e),Xn(this.element);const t=document.createElement("a");if(t.classList.add("action-label"),t.setAttribute("role",this.getDefaultAriaRole()),this.label=t,this.element.appendChild(t),this.options.label&&this.options.keybinding){const n=document.createElement("span");n.classList.add("keybinding"),n.textContent=this.options.keybinding,this.element.appendChild(n)}this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===lo.ID?"presentation":this.options.isMenu?"menuitem":"button"}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.action.label)}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:!this.options.label&&this.action.label&&this.options.icon&&(e=this.action.label,this.options.keybinding&&(e=w({key:"titleLabel",comment:["action title","action keybinding"]},"{0} ({1})",e,this.options.keybinding))),e??void 0}updateClass(){var e;this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.getClass(),this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):(e=this.label)===null||e===void 0||e.classList.remove("codicon")}updateEnabled(){var e,t;this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),(e=this.element)===null||e===void 0||e.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),(t=this.element)===null||t===void 0||t.classList.add("disabled"))}updateAriaLabel(){var e;if(this.label){const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.label.setAttribute("aria-label",t)}}updateChecked(){this.label&&(this.action.checked!==void 0?(this.label.classList.toggle("checked",this.action.checked),this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox")):(this.label.classList.remove("checked"),this.label.removeAttribute("aria-checked"),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class xqe extends Wd{constructor(e,t,n,r,o,s,a){super(e,t),this.selectBox=new Sqe(n,r,o,s,a),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}select(e){this.selectBox.select(e)}registerListeners(){this._register(this.selectBox.onDidSelect(e=>this.runAction(e.selected,e.index)))}runAction(e,t){this.actionRunner.run(this._action,this.getActionContext(e,t))}getActionContext(e,t){return e}setFocusable(e){this.selectBox.setFocusable(e)}focus(){var e;(e=this.selectBox)===null||e===void 0||e.focus()}blur(){var e;(e=this.selectBox)===null||e===void 0||e.blur()}render(e){this.selectBox.render(e)}}class Lqe extends Nb{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new se),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=ke(e,He(".monaco-dropdown")),this._label=ke(this._element,He(".dropdown-label"));let n=t.labelRenderer;n||(n=o=>(o.textContent=t.label||"",null));for(const o of[Ge.CLICK,Ge.MOUSE_DOWN,Si.Tap])this._register(ye(this.element,o,s=>hn.stop(s,!0)));for(const o of[Ge.MOUSE_DOWN,Si.Tap])this._register(ye(this._label,o,s=>{Iq(s)&&(s.detail>1||s.button!==0)||(this.visible?this.hide():this.show())}));this._register(ye(this._label,Ge.KEY_UP,o=>{const s=new Ai(o);(s.equals(3)||s.equals(10))&&(hn.stop(o,!0),this.visible?this.hide():this.show())}));const r=n(this._label);r&&this._register(r),this._register(wi.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 Eqe extends Lqe{constructor(e,t){super(e,t),this._options=t,this._actions=[],this.actions=t.actions||[]}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this._options.actionProvider?this._options.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._options.contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:(e,t)=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e,t):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this._options.menuClassName||"",onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this._options.menuAsChild?this.element:void 0,skipTelemetry:this._options.skipTelemetry})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class PP extends Wd{constructor(e,t,n,r=Object.create(null)){super(null,e,r),this.actionItem=null,this._onDidChangeVisibility=this._register(new se),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.menuActionsOrProvider=t,this.contextMenuProvider=n,this.options=r,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=o=>{this.element=ke(o,He("a.action-label"));let s=[];return typeof this.options.classNames=="string"?s=this.options.classNames.split(/\s+/g).filter(a=>!!a):this.options.classNames&&(s=this.options.classNames),s.find(a=>a==="icon")||s.push("codicon"),this.element.classList.add(...s),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this._action.label&&this._register(mC(zp("mouse"),this.element,this._action.label)),this.element.ariaLabel=this._action.label||"",null},n=Array.isArray(this.menuActionsOrProvider),r={contextMenuProvider:this.contextMenuProvider,labelRenderer:t,menuAsChild:this.options.menuAsChild,actions:n?this.menuActionsOrProvider:void 0,actionProvider:n?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new Eqe(e,r)),this._register(this.dropdownMenu.onDidChangeVisibility(o=>{var s;(s=this.element)===null||s===void 0||s.setAttribute("aria-expanded",`${o}`),this._onDidChangeVisibility.fire(o)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const o=this;this.dropdownMenu.menuOptions={...this.dropdownMenu.menuOptions,get anchorAlignment(){return o.options.anchorAlignmentProvider()}}}this.updateTooltip(),this.updateEnabled()}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label),e??void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){var e;(e=this.dropdownMenu)===null||e===void 0||e.show()}updateEnabled(){var e,t;const n=!this.action.enabled;(e=this.actionItem)===null||e===void 0||e.classList.toggle("disabled",n),(t=this.element)===null||t===void 0||t.classList.toggle("disabled",n)}}function Dqe(i){return i?i.condition!==void 0:!1}var Xy;(function(i){i[i.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",i[i.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(Xy||(Xy={}));var vy;(function(i){i[i.None=0]="None",i[i.Initialized=1]="Initialized",i[i.Closed=2]="Closed"})(vy||(vy={}));class Yy extends fe{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new Lb),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=vy.None,this.cache=new Map,this.flushDelayer=this._register(new zpe(Yy.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,n;this._onDidChangeStorage.pause();try{(t=e.changed)===null||t===void 0||t.forEach((r,o)=>this.acceptExternal(o,r)),(n=e.deleted)===null||n===void 0||n.forEach(r=>this.acceptExternal(r,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===vy.Closed)return;let n=!1;nc(t)?n=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),n=!0),n&&this._onDidChangeStorage.fire({key:e,external:!0})}get(e,t){const n=this.cache.get(e);return nc(n)?t:n}getBoolean(e,t){const n=this.get(e);return nc(n)?t:n==="true"}getNumber(e,t){const n=this.get(e);return nc(n)?t:parseInt(n,10)}async set(e,t,n=!1){if(this.state===vy.Closed)return;if(nc(t))return this.delete(e,n);const r=va(t)||Array.isArray(t)?PKe(t):String(t);if(this.cache.get(e)!==r)return this.cache.set(e,r),this.pendingInserts.set(e,r),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:n}),this.doFlush()}async delete(e,t=!1){if(!(this.state===vy.Closed||!this.cache.delete(e)))return this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:t}),this.doFlush()}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}async flushPending(){if(!this.hasPending)return;const e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally(()=>{var t;if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)(t=this.whenFlushedCallbacks.pop())===null||t===void 0||t()})}async doFlush(e){return this.options.hint===Xy.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)}}Yy.DEFAULT_FLUSH_DELAY=100;class l9{constructor(){this.onDidChangeItemsExternal=Je.None,this.items=new Map}async updateItems(e){var t,n;(t=e.insert)===null||t===void 0||t.forEach((r,o)=>this.items.set(o,r)),(n=e.delete)===null||n===void 0||n.forEach(r=>this.items.delete(r))}}const DM="__$__targetStorageMarker",dd=yn("storageService");var cI;(function(i){i[i.NONE=0]="NONE",i[i.SHUTDOWN=1]="SHUTDOWN"})(cI||(cI={}));function Iqe(i){const e=i.get(DM);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}class t3 extends fe{constructor(e={flushInterval:t3.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new Lb),this._onDidChangeTarget=this._register(new Lb),this._onWillSaveState=this._register(new se),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,t,n){return Je.filter(this._onDidChangeValue.event,r=>r.scope===e&&(t===void 0||r.key===t),n)}emitDidChangeValue(e,t){const{key:n,external:r}=t;if(n===DM){switch(e){case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:n,target:this.getKeyTargets(e)[n],external:r})}get(e,t,n){var r;return(r=this.getStorage(t))===null||r===void 0?void 0:r.get(e,n)}getBoolean(e,t,n){var r;return(r=this.getStorage(t))===null||r===void 0?void 0:r.getBoolean(e,n)}getNumber(e,t,n){var r;return(r=this.getStorage(t))===null||r===void 0?void 0:r.getNumber(e,n)}store(e,t,n,r,o=!1){if(nc(t)){this.remove(e,n,o);return}this.withPausedEmitters(()=>{var s;this.updateKeyTarget(e,n,r),(s=this.getStorage(n))===null||s===void 0||s.set(e,t,o)})}remove(e,t,n=!1){this.withPausedEmitters(()=>{var r;this.updateKeyTarget(e,t,void 0),(r=this.getStorage(t))===null||r===void 0||r.delete(e,n)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,n,r=!1){var o,s;const a=this.getKeyTargets(t);typeof n=="number"?a[e]!==n&&(a[e]=n,(o=this.getStorage(t))===null||o===void 0||o.set(DM,JSON.stringify(a),r)):typeof a[e]=="number"&&(delete a[e],(s=this.getStorage(t))===null||s===void 0||s.set(DM,JSON.stringify(a),r))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?Iqe(t):Object.create(null)}}t3.DEFAULT_FLUSH_INTERVAL=60*1e3;class kqe extends t3{constructor(){super(),this.applicationStorage=this._register(new Yy(new l9,{hint:Xy.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new Yy(new l9,{hint:Xy.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new Yy(new l9,{hint:Xy.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(1,e))),this._register(this.profileStorage.onDidChangeStorage(e=>this.emitDidChangeValue(0,e))),this._register(this.applicationStorage.onDidChangeStorage(e=>this.emitDidChangeValue(-1,e)))}getStorage(e){switch(e){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}}function Tqe(i,e){const t={...e};for(const n in i){const r=i[n];t[n]=r!==void 0?ht(r):void 0}return t}const Nqe={keybindingLabelBackground:ht(tWe),keybindingLabelForeground:ht(nWe),keybindingLabelBorder:ht(iWe),keybindingLabelBottomBorder:ht(rWe),keybindingLabelShadow:ht(Yg)},Rqe={buttonForeground:ht(SL),buttonSeparator:ht(z7e),buttonBackground:ht(xL),buttonHoverBackground:ht(U7e),buttonSecondaryForeground:ht(K7e),buttonSecondaryBackground:ht(IH),buttonSecondaryHoverBackground:ht(G7e),buttonBorder:ht(j7e)},Mqe={progressBarBackground:ht(X7e)},OP={inputActiveOptionBorder:ht(Xq),inputActiveOptionForeground:ht(Yq),inputActiveOptionBackground:ht(B0)};ht(AWe),ht(OWe),ht(PWe);ht(Nr),ht(Qg),ht(Yg),ht(Sn),ht(QWe),ht(JWe),ht(e$e),ht(R7e);const FP={inputBackground:ht(Jme),inputForeground:ht(eve),inputBorder:ht(tve),inputValidationInfoBorder:ht(P7e),inputValidationInfoBackground:ht(M7e),inputValidationInfoForeground:ht(A7e),inputValidationWarningBorder:ht(B7e),inputValidationWarningBackground:ht(O7e),inputValidationWarningForeground:ht(F7e),inputValidationErrorBorder:ht(H7e),inputValidationErrorBackground:ht(W7e),inputValidationErrorForeground:ht($7e)},Aqe={listFilterWidgetBackground:ht(DWe),listFilterWidgetOutline:ht(IWe),listFilterWidgetNoMatchesOutline:ht(kWe),listFilterWidgetShadow:ht(TWe),inputBoxStyles:FP,toggleStyles:OP},K_e={badgeBackground:ht(vM),badgeForeground:ht(q7e),badgeBorder:ht(Sn)};ht(jWe),ht(UWe),ht(are),ht(are),ht(KWe);const N_={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:ht(mWe),listFocusForeground:ht(vWe),listFocusOutline:ht(_We),listActiveSelectionBackground:ht(ip),listActiveSelectionForeground:ht(Sf),listActiveSelectionIconForeground:ht(kL),listFocusAndSelectionOutline:ht(bWe),listFocusAndSelectionBackground:ht(ip),listFocusAndSelectionForeground:ht(Sf),listInactiveSelectionBackground:ht(CWe),listInactiveSelectionIconForeground:ht(wWe),listInactiveSelectionForeground:ht(yWe),listInactiveFocusBackground:ht(SWe),listInactiveFocusOutline:ht(xWe),listHoverBackground:ht(ove),listHoverForeground:ht(sve),listDropOverBackground:ht(LWe),listDropBetweenBackground:ht(EWe),listSelectionOutline:ht(zi),listHoverOutline:ht(zi),treeIndentGuidesStroke:ht(TL),treeInactiveIndentGuidesStroke:ht(NWe),tableColumnsBorder:ht(RWe),tableOddRowsBackgroundColor:ht(MWe)};function RS(i){return Tqe(i,N_)}const Pqe={selectBackground:ht(yf),selectListBackground:ht(V7e),selectForeground:ht(Zg),decoratorRightForeground:ht(nve),selectBorder:ht(oy),focusBorder:ht(qc),listFocusBackground:ht($0),listInactiveSelectionIconForeground:ht(sy),listFocusForeground:ht(W0),listFocusOutline:T7e(zi,me.transparent.toString()),listHoverBackground:ht(ove),listHoverForeground:ht(sve),listHoverOutline:ht(zi),selectListBorder:ht(Jg),listBackground:void 0,listActiveSelectionBackground:void 0,listActiveSelectionForeground:void 0,listActiveSelectionIconForeground:void 0,listFocusAndSelectionBackground:void 0,listDropOverBackground:void 0,listDropBetweenBackground:void 0,listInactiveSelectionBackground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusBackground:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listFocusAndSelectionForeground:void 0,listFocusAndSelectionOutline:void 0,listInactiveFocusForeground:void 0,tableColumnsBorder:void 0,tableOddRowsBackgroundColor:void 0,treeIndentGuidesStroke:void 0,treeInactiveIndentGuidesStroke:void 0},Oqe={shadowColor:ht(Yg),borderColor:ht(FWe),foregroundColor:ht(BWe),backgroundColor:ht(WWe),selectionForegroundColor:ht($We),selectionBackgroundColor:ht(HWe),selectionBorderColor:ht(VWe),separatorColor:ht(zWe),scrollbarShadow:ht(LL),scrollbarSliderBackground:ht(EL),scrollbarSliderHoverBackground:ht(DL),scrollbarSliderActiveBackground:ht(IL)};var n3=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Xa=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};function Fqe(i,e,t,n){const r=i.getActions(e),o=Xg.getInstance(),s=o.keyStatus.altKey||(Rs||Da)&&o.keyStatus.shiftKey;G_e(r,t,s,n?a=>a===n:a=>a==="navigation")}function i3(i,e,t,n,r,o){const s=i.getActions(e);G_e(s,t,!1,typeof n=="string"?l=>l===n:n,r,o)}function G_e(i,e,t,n=s=>s==="navigation",r=()=>!1,o=!1){let s,a;Array.isArray(e)?(s=e,a=e):(s=e.primary,a=e.secondary);const l=new Set;for(const[c,u]of i){let d;n(c)?(d=s,d.length>0&&o&&d.push(new lo)):(d=a,d.length>0&&d.push(new lo));for(let h of u){t&&(h=h instanceof pc&&h.alt?h.alt:h);const f=d.push(h);h instanceof Lw&&l.add({group:c,action:h,index:f-1})}}for(const{group:c,action:u,index:d}of l){const h=n(c)?s:a,f=u.actions;r(u,c,h.length)&&h.splice(d,1,...f)}}let e_=class extends jw{constructor(e,t,n,r,o,s,a,l){super(void 0,e,{icon:!!(e.class||e.item.icon),label:!e.class&&!e.item.icon,draggable:t==null?void 0:t.draggable,keybinding:t==null?void 0:t.keybinding,hoverDelegate:t==null?void 0:t.hoverDelegate}),this._keybindingService=n,this._notificationService=r,this._contextKeyService=o,this._themeService=s,this._contextMenuService=a,this._accessibilityService=l,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new Ho),this._altKey=Xg.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}async onClick(e){e.preventDefault(),e.stopPropagation();try{await this.actionRunner.run(this._commandAction,this._context)}catch(t){this._notificationService.error(t)}}render(e){if(super.render(e),e.classList.add("menu-entry"),this.options.icon&&this._updateItemClass(this._menuItemAction.item),this._menuItemAction.alt){let t=!1;const n=()=>{var r;const o=!!(!((r=this._menuItemAction.alt)===null||r===void 0)&&r.enabled)&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);o!==this._wantsAltCommand&&(this._wantsAltCommand=o,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(n)),this._register(ye(e,"mouseleave",r=>{t=!1,n()})),this._register(ye(e,"mouseenter",r=>{t=!0,n()})),n()}}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){var e;const t=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),n=t&&t.getLabel(),r=this._commandAction.tooltip||this._commandAction.label;let o=n?w("titleAndKb","{0} ({1})",r,n):r;if(!this._wantsAltCommand&&(!((e=this._menuItemAction.alt)===null||e===void 0)&&e.enabled)){const s=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,a=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),l=a&&a.getLabel(),c=l?w("titleAndKb","{0} ({1})",s,l):s;o=w("titleAndKbAndAlt",`{0} +[{1}] {2}`,o,zX.modifierLabels[yl].altKey,c)}return o}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:t,label:n}=this;if(!t||!n)return;const r=this._commandAction.checked&&Dqe(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(r)if(Wt.isThemeIcon(r)){const o=Wt.asClassNameArray(r);n.classList.add(...o),this._itemClassDispose.value=Rt(()=>{n.classList.remove(...o)})}else n.style.backgroundImage=Pw(this._themeService.getColorTheme().type)?Kv(r.dark):Kv(r.light),n.classList.add("icon"),this._itemClassDispose.value=Zu(Rt(()=>{n.style.backgroundImage="",n.classList.remove("icon")}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}};e_=n3([Xa(2,ci),Xa(3,$r),Xa(4,Vt),Xa(5,To),Xa(6,Ol),Xa(7,ud)],e_);let kV=class extends PP{constructor(e,t,n,r,o){var s,a,l;const c={...t,menuAsChild:(s=t==null?void 0:t.menuAsChild)!==null&&s!==void 0?s:!1,classNames:(a=t==null?void 0:t.classNames)!==null&&a!==void 0?a:Wt.isThemeIcon(e.item.icon)?Wt.asClassName(e.item.icon):void 0,keybindingProvider:(l=t==null?void 0:t.keybindingProvider)!==null&&l!==void 0?l:u=>n.lookupKeybinding(u.id)};super(e,{getActions:()=>e.actions},r,c),this._keybindingService=n,this._contextMenuService=r,this._themeService=o}render(e){super.render(e),Xn(this.element),e.classList.add("menu-entry");const t=this._action,{icon:n}=t.item;if(n&&!Wt.isThemeIcon(n)){this.element.classList.add("icon");const r=()=>{this.element&&(this.element.style.backgroundImage=Pw(this._themeService.getColorTheme().type)?Kv(n.dark):Kv(n.light))};r(),this._register(this._themeService.onDidColorThemeChange(()=>{r()}))}}};kV=n3([Xa(2,ci),Xa(3,Ol),Xa(4,To)],kV);let TV=class extends Wd{constructor(e,t,n,r,o,s,a,l){var c,u,d;super(null,e),this._keybindingService=n,this._notificationService=r,this._contextMenuService=o,this._menuService=s,this._instaService=a,this._storageService=l,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let h;const f=t!=null&&t.persistLastActionId?l.get(this._storageKey,1):void 0;f&&(h=e.actions.find(p=>f===p.id)),h||(h=e.actions[0]),this._defaultAction=this._instaService.createInstance(e_,h,{keybinding:this._getDefaultActionKeybindingLabel(h)});const g={keybindingProvider:p=>this._keybindingService.lookupKeybinding(p.id),...t,menuAsChild:(c=t==null?void 0:t.menuAsChild)!==null&&c!==void 0?c:!0,classNames:(u=t==null?void 0:t.classNames)!==null&&u!==void 0?u:["codicon","codicon-chevron-down"],actionRunner:(d=t==null?void 0:t.actionRunner)!==null&&d!==void 0?d:new Nb};this._dropdown=new PP(e,e.actions,this._contextMenuService,g),this._register(this._dropdown.actionRunner.onDidRun(p=>{p.action instanceof pc&&this.update(p.action)}))}update(e){var t;!((t=this._options)===null||t===void 0)&&t.persistLastActionId&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(e_,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends Nb{async runAction(n,r){await n.run(void 0)}},this._container&&this._defaultAction.render(Tq(this._container,He(".action-container")))}_getDefaultActionKeybindingLabel(e){var t;let n;if(!((t=this._options)===null||t===void 0)&&t.renderKeybindingWithDefaultActionLabel){const r=this._keybindingService.lookupKeybinding(e.id);r&&(n=`(${r.getLabel()})`)}return n}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=He(".action-container");this._defaultAction.render(ke(this._container,t)),this._register(ye(t,Ge.KEY_DOWN,r=>{const o=new Ai(r);o.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),o.stopPropagation())}));const n=He(".dropdown-action-container");this._dropdown.render(ke(this._container,n)),this._register(ye(n,Ge.KEY_DOWN,r=>{var o;const s=new Ai(r);s.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),(o=this._defaultAction.element)===null||o===void 0||o.focus(),s.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()}};TV=n3([Xa(2,ci),Xa(3,$r),Xa(4,Ol),Xa(5,hu),Xa(6,Ot),Xa(7,dd)],TV);let NV=class extends xqe{constructor(e,t){super(null,e,e.actions.map(n=>({text:n.id===lo.ID?"─────────":n.label,isDisabled:!n.enabled})),0,t,Pqe,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex(n=>n.checked)))}render(e){super.render(e),e.style.borderColor=ht(oy)}runAction(e,t){const n=this.action.actions[t];n&&this.actionRunner.run(n)}};NV=n3([Xa(1,ng)],NV);function q_e(i,e,t){return e instanceof pc?i.createInstance(e_,e,t):e instanceof TD?e.item.isSelection?i.createInstance(NV,e):e.item.rememberDefaultAction?i.createInstance(TV,e,{...t,persistLastActionId:!0}):i.createInstance(kV,e,t):void 0}class au extends fe{constructor(e,t={}){var n,r,o,s,a,l,c;super(),this._actionRunnerDisposables=this._register(new Te),this.viewItemDisposables=this._register(new lq),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new se),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new se({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new se),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new se),this.onWillRun=this._onWillRun.event,this.options=t,this._context=(n=t.context)!==null&&n!==void 0?n:null,this._orientation=(r=this.options.orientation)!==null&&r!==void 0?r:0,this._triggerKeys={keyDown:(s=(o=this.options.triggerKeys)===null||o===void 0?void 0:o.keyDown)!==null&&s!==void 0?s:!1,keys:(l=(a=this.options.triggerKeys)===null||a===void 0?void 0:a.keys)!==null&&l!==void 0?l:[3,10]},this._hoverDelegate=(c=t.hoverDelegate)!==null&&c!==void 0?c:this._register(zp("element",!0)),this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new Nb,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(h=>this._onDidRun.fire(h))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(h=>this._onWillRun.fire(h))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar";let u,d;switch(this._orientation){case 0:u=[15],d=[17];break;case 1:u=[16],d=[18],this.domNode.className+=" vertical";break}this._register(ye(this.domNode,Ge.KEY_DOWN,h=>{const f=new Ai(h);let g=!0;const p=typeof this.focusedItem=="number"?this.viewItems[this.focusedItem]:void 0;u&&(f.equals(u[0])||f.equals(u[1]))?g=this.focusPrevious():d&&(f.equals(d[0])||f.equals(d[1]))?g=this.focusNext():f.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():f.equals(14)?g=this.focusFirst():f.equals(13)?g=this.focusLast():f.equals(2)&&p instanceof Wd&&p.trapsArrowNavigation?g=this.focusNext():this.isTriggerKeyEvent(f)?this._triggerKeys.keyDown?this.doTrigger(f):this.triggerKeyDown=!0:g=!1,g&&(f.preventDefault(),f.stopPropagation())})),this._register(ye(this.domNode,Ge.KEY_UP,h=>{const f=new Ai(h);this.isTriggerKeyEvent(f)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(f)),f.preventDefault(),f.stopPropagation()):(f.equals(2)||f.equals(1026)||f.equals(16)||f.equals(18)||f.equals(15)||f.equals(17))&&this.updateFocusedItem()})),this.focusTracker=this._register(dh(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(fs()===this.domNode||!es(fs(),this.domNode))&&(this._onDidBlur.fire(),this.previouslyFocusedItem=this.focusedItem,this.focusedItem=void 0,this.triggerKeyDown=!1)})),this._register(this.focusTracker.onDidFocus(()=>this.updateFocusedItem())),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.options.highlightToggledItems&&this.actionsList.classList.add("highlight-toggled"),this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}refreshRole(){this.length()>=1?this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"):this.actionsList.setAttribute("role","presentation")}setFocusable(e){if(this.focusable=e,this.focusable){const t=this.viewItems.find(n=>n instanceof Wd&&n.isEnabled());t instanceof Wd&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof Wd&&t.setFocusable(!1)})}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(n=>{t=t||e.equals(n)}),t}updateFocusedItem(){var e,t;for(let n=0;nt.setActionContext(e))}get actionRunner(){return this._actionRunner}set actionRunner(e){this._actionRunner=e,this._actionRunnerDisposables.clear(),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(t=>this._onDidRun.fire(t))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(t=>this._onWillRun.fire(t))),this.viewItems.forEach(t=>t.actionRunner=e)}getContainer(){return this.domNode}getAction(e){var t;if(typeof e=="number")return(t=this.viewItems[e])===null||t===void 0?void 0:t.action;if(e instanceof HTMLElement){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let n=0;n{const s=document.createElement("li");s.className="action-item",s.setAttribute("role","presentation");let a;const l={hoverDelegate:this._hoverDelegate,...t};this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(o,l)),a||(a=new jw(this.context,o,l)),this.options.allowContextMenu||this.viewItemDisposables.set(a,ye(s,Ge.CONTEXT_MENU,c=>{hn.stop(c,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(s),this.focusable&&a instanceof Wd&&this.viewItems.length===0&&a.setFocusable(!0),r===null||r<0||r>=this.actionsList.children.length?(this.actionsList.appendChild(s),this.viewItems.push(a)):(this.actionsList.insertBefore(s,this.actionsList.children[r]),this.viewItems.splice(r,0,a),r++)}),typeof this.focusedItem=="number"&&this.focus(this.focusedItem),this.refreshRole()}clear(){this.isEmpty()||(this.viewItems=si(this.viewItems),this.viewItemDisposables.clearAndDisposeAll(),Ns(this.actionsList),this.refreshRole())}length(){return this.viewItems.length}isEmpty(){return this.viewItems.length===0}focus(e){let t=!1,n;if(e===void 0?t=!0:typeof e=="number"?n=e:typeof e=="boolean"&&(t=e),t&&typeof this.focusedItem>"u"){const r=this.viewItems.findIndex(o=>o.isEnabled());this.focusedItem=r===-1?void 0:r,this.updateFocus(void 0,void 0,!0)}else n!==void 0&&(this.focusedItem=n),this.updateFocus(void 0,void 0,!0)}focusFirst(){return this.focusedItem=this.length()-1,this.focusNext(!0)}focusLast(){return this.focusedItem=0,this.focusPrevious(!0)}focusNext(e){if(typeof this.focusedItem>"u")this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let n;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,n=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!n.isEnabled()||n.action.id===lo.ID));return this.updateFocus(),!0}focusPrevious(e){if(typeof this.focusedItem>"u")this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let n;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}n=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!n.isEnabled()||n.action.id===lo.ID));return this.updateFocus(!0),!0}updateFocus(e,t,n=!1){var r,o;typeof this.focusedItem>"u"&&this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem!==void 0&&this.previouslyFocusedItem!==this.focusedItem&&((r=this.viewItems[this.previouslyFocusedItem])===null||r===void 0||r.blur());const s=this.focusedItem!==void 0?this.viewItems[this.focusedItem]:void 0;if(s){let a=!0;CD(s.focus)||(a=!1),this.options.focusOnlyEnabledItems&&CD(s.isEnabled)&&!s.isEnabled()&&(a=!1),s.action.id===lo.ID&&(a=!1),a?(n||this.previouslyFocusedItem!==this.focusedItem)&&(s.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0),a&&((o=s.showHover)===null||o===void 0||o.call(s))}}doTrigger(e){if(typeof this.focusedItem>"u")return;const t=this.viewItems[this.focusedItem];if(t instanceof Wd){const n=t._context===null||t._context===void 0?e:t._context;this.run(t._action,n)}}async run(e,t){await this._actionRunner.run(e,t)}dispose(){this._context=void 0,this.viewItems=si(this.viewItems),this.getContainer().remove(),super.dispose()}}const RV=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,c9=/(&)?(&)([^\s&])/g;var BP;(function(i){i[i.Right=0]="Right",i[i.Left=1]="Left"})(BP||(BP={}));let X_e=class IM extends au{constructor(e,t,n,r){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const o=document.createElement("div");o.classList.add("monaco-menu"),o.setAttribute("role","presentation"),super(o,{orientation:1,actionViewItemProvider:c=>this.doGetActionViewItem(c,n,s),context:n.context,actionRunner:n.actionRunner,ariaLabel:n.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...Ln||Da?[10]:[]],keyDown:!0}}),this.menuStyles=r,this.menuElement=o,this.actionsList.tabIndex=0,this.initializeOrUpdateStyleSheet(e,r),this._register(wi.addTarget(o)),this._register(ye(o,Ge.KEY_DOWN,c=>{new Ai(c).equals(2)&&c.preventDefault()})),n.enableMnemonics&&this._register(ye(o,Ge.KEY_DOWN,c=>{const u=c.key.toLocaleLowerCase();if(this.mnemonics.has(u)){hn.stop(c,!0);const d=this.mnemonics.get(u);if(d.length===1&&(d[0]instanceof Joe&&d[0].container&&this.focusItemByElement(d[0].container),d[0].onClick(c)),d.length>1){const h=d.shift();h&&h.container&&(this.focusItemByElement(h.container),d.push(h)),this.mnemonics.set(u,d)}}})),Da&&this._register(ye(o,Ge.KEY_DOWN,c=>{const u=new Ai(c);u.equals(14)||u.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),hn.stop(c,!0)):(u.equals(13)||u.equals(12))&&(this.focusedItem=0,this.focusPrevious(),hn.stop(c,!0))})),this._register(ye(this.domNode,Ge.MOUSE_OUT,c=>{const u=c.relatedTarget;es(u,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),c.stopPropagation())})),this._register(ye(this.actionsList,Ge.MOUSE_OVER,c=>{let u=c.target;if(!(!u||!es(u,this.actionsList)||u===this.actionsList)){for(;u.parentElement!==this.actionsList&&u.parentElement!==null;)u=u.parentElement;if(u.classList.contains("action-item")){const d=this.focusedItem;this.setFocusedItem(u),d!==this.focusedItem&&this.updateFocus()}}})),this._register(wi.addTarget(this.actionsList)),this._register(ye(this.actionsList,Si.Tap,c=>{let u=c.initialTarget;if(!(!u||!es(u,this.actionsList)||u===this.actionsList)){for(;u.parentElement!==this.actionsList&&u.parentElement!==null;)u=u.parentElement;if(u.classList.contains("action-item")){const d=this.focusedItem;this.setFocusedItem(u),d!==this.focusedItem&&this.updateFocus()}}}));const s={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new Hk(o,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const a=this.scrollableElement.getDomNode();a.style.position="",this.styleScrollElement(a,r),this._register(ye(o,Si.Change,c=>{hn.stop(c,!0);const u=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:u-c.translationY})})),this._register(ye(a,Ge.MOUSE_UP,c=>{c.preventDefault()}));const l=Pt(e);o.style.maxHeight=`${Math.max(10,l.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter((c,u)=>{var d;return!((d=n.submenuIds)===null||d===void 0)&&d.has(c.id)?(console.warn(`Found submenu cycle: ${c.id}`),!1):!(c instanceof lo&&(u===t.length-1||u===0||t[u-1]instanceof lo))}),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(c=>!(c instanceof ese)).forEach((c,u,d)=>{c.updatePositionInSet(u+1,d.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(GA(e)?this.styleSheet=gc(e):(IM.globalStyleSheet||(IM.globalStyleSheet=gc()),this.styleSheet=IM.globalStyleSheet)),this.styleSheet.textContent=Wqe(t,GA(e))}styleScrollElement(e,t){var n,r;const o=(n=t.foregroundColor)!==null&&n!==void 0?n:"",s=(r=t.backgroundColor)!==null&&r!==void 0?r:"",a=t.borderColor?`1px solid ${t.borderColor}`:"",l="5px",c=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=a,e.style.borderRadius=l,e.style.color=o,e.style.backgroundColor=s,e.style.boxShadow=c}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}focusItemByElement(e){const t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t{this.element&&(this._register(ye(this.element,Ge.MOUSE_UP,o=>{if(hn.stop(o,!0),ru){if(new Uu(Pt(this.element),o).rightButton)return;this.onClick(o)}else setTimeout(()=>{this.onClick(o)},0)})),this._register(ye(this.element,Ge.CONTEXT_MENU,o=>{hn.stop(o,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=ke(this.element,He("a.action-menu-item")),this._action.id===lo.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=ke(this.item,He("span.menu-item-check"+Wt.asCSSSelector(Xe.menuSelection))),this.check.setAttribute("role","none"),this.label=ke(this.item,He("span.action-label")),this.options.label&&this.options.keybinding&&(ke(this.item,He("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked(),this.applyStyle())}blur(){super.blur(),this.applyStyle()}focus(){var e;super.focus(),(e=this.item)===null||e===void 0||e.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){var e;if(this.label&&this.options.label){Ns(this.label);let t=BX(this.action.label);if(t){const n=Bqe(t);this.options.enableMnemonics||(t=n),this.label.setAttribute("aria-label",n.replace(/&&/g,"&"));const r=RV.exec(t);if(r){t=HA(t),c9.lastIndex=0;let o=c9.exec(t);for(;o&&o[1];)o=c9.exec(t);const s=a=>a.replace(/&&/g,"&");o?this.label.append(Ik(s(t.substr(0,o.index))," "),He("u",{"aria-hidden":"true"},o[3]),Mpe(s(t.substr(o.index+o[0].length))," ")):this.label.innerText=s(t).trim(),(e=this.item)===null||e===void 0||e.setAttribute("aria-keyshortcuts",(r[1]?r[1]:r[3]).toLocaleLowerCase())}else this.label.innerText=t.replace(/&&/g,"&").trim()}}}updateTooltip(){}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.action.class||"",this.label.classList.add("icon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" ")),this.updateEnabled()):this.label&&this.label.classList.remove("icon")}updateEnabled(){this.action.enabled?(this.element&&(this.element.classList.remove("disabled"),this.element.removeAttribute("aria-disabled")),this.item&&(this.item.classList.remove("disabled"),this.item.removeAttribute("aria-disabled"),this.item.tabIndex=0)):(this.element&&(this.element.classList.add("disabled"),this.element.setAttribute("aria-disabled","true")),this.item&&(this.item.classList.add("disabled"),this.item.setAttribute("aria-disabled","true")))}updateChecked(){if(!this.item)return;const e=this.action.checked;this.item.classList.toggle("checked",!!e),e!==void 0?(this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked",e?"true":"false")):(this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked",""))}getMnemonic(){return this.mnemonic}applyStyle(){const e=this.element&&this.element.classList.contains("focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,n=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,r=e&&this.menuStyle.selectionBorderColor?`1px solid ${this.menuStyle.selectionBorderColor}`:"",o=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=t??"",this.item.style.backgroundColor=n??"",this.item.style.outline=r,this.item.style.outlineOffset=o),this.check&&(this.check.style.color=t??"")}}class Joe extends Y_e{constructor(e,t,n,r,o){super(e,e,r,o),this.submenuActions=t,this.parentData=n,this.submenuOptions=r,this.mysubmenu=null,this.submenuDisposables=this._register(new Te),this.mouseOver=!1,this.expandDirection=r&&r.expandDirection!==void 0?r.expandDirection:BP.Right,this.showScheduler=new pi(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new pi(()=>{this.element&&!es(fs(),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=ke(this.item,He("span.submenu-indicator"+Wt.asCSSSelector(Xe.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(ye(this.element,Ge.KEY_UP,t=>{const n=new Ai(t);(n.equals(17)||n.equals(3))&&(hn.stop(t,!0),this.createSubmenu(!0))})),this._register(ye(this.element,Ge.KEY_DOWN,t=>{const n=new Ai(t);fs()===this.item&&(n.equals(17)||n.equals(3))&&hn.stop(t,!0)})),this._register(ye(this.element,Ge.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(ye(this.element,Ge.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(ye(this.element,Ge.FOCUS_OUT,t=>{this.element&&!es(fs(),this.element)&&this.hideScheduler.schedule()})),this._register(this.parentData.parent.onScroll(()=>{this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))})))}updateEnabled(){}onClick(e){hn.stop(e,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(e){if(this.parentData.submenu&&(e||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch{}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,n,r){const o={top:0,left:0};return o.left=py(e.width,t.width,{position:r===BP.Right?0:1,offset:n.left,size:n.width}),o.left>=n.left&&o.left{new Ai(u).equals(15)&&(hn.stop(u,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(ye(this.submenuContainer,Ge.KEY_DOWN,u=>{new Ai(u).equals(15)&&hn.stop(u,!0)})),this.submenuDisposables.add(this.parentData.submenu.onDidCancel(()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)})),this.parentData.submenu.focus(e),this.mysubmenu=this.parentData.submenu}}updateAriaExpanded(e){var t;this.item&&((t=this.item)===null||t===void 0||t.setAttribute("aria-expanded",e))}applyStyle(){super.applyStyle();const t=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=t??"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class ese extends jw{constructor(e,t,n,r){super(e,t,n),this.menuStyles=r}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}}function Bqe(i){const e=RV,t=e.exec(i);if(!t)return i;const n=!t[1];return i.replace(e,n?"$2$3":"").trim()}function tse(i){const e=kpe()[i.id];return`.codicon-${i.id}:before { content: '\\${e.toString(16)}'; }`}function Wqe(i,e){let t=` .monaco-menu { font-size: 13px; border-radius: 5px; @@ -709,26 +709,26 @@ ${tse(Xe.menuSubmenu)} .monaco-scrollable-element > .scrollbar > .slider.active { background: ${s}; } - `)}return t}class $qe{constructor(e,t,n,r){this.contextViewService=e,this.telemetryService=t,this.notificationService=n,this.keybindingService=r,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;this.focusToReturn=fs();let n;const r=e.domForShadowRoot instanceof HTMLElement?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:o=>{var s;this.lastContainer=o;const a=e.getMenuClassName?e.getMenuClassName():"";a&&(o.className+=" "+a),this.options.blockMouse&&(this.block=o.appendChild(He(".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",(s=this.blockDisposable)===null||s===void 0||s.dispose(),this.blockDisposable=ye(this.block,Ge.MOUSE_DOWN,d=>d.stopPropagation()));const l=new Te,c=e.actionRunner||new Nb;c.onWillRun(d=>this.onActionRun(d,!e.skipTelemetry),this,l),c.onDidRun(this.onDidActionRun,this,l),n=new X_e(o,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:c,getKeyBinding:e.getKeyBinding?e.getKeyBinding:d=>this.keybindingService.lookupKeybinding(d.id)},Oqe),n.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,l),n.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,l);const u=Pt(o);return l.add(ye(u,Ge.BLUR,()=>this.contextViewService.hideContextView(!0))),l.add(ye(u,Ge.MOUSE_DOWN,d=>{if(d.defaultPrevented)return;const h=new Uu(u,d);let f=h.target;if(!h.rightButton){for(;f;){if(f===o)return;f=f.parentElement}this.contextViewService.hideContextView(!0)}})),Zu(l,n)},focus:()=>{n==null||n.focus(!!e.autoSelectFirstItem)},onHide:o=>{var s,a,l;(s=e.onHide)===null||s===void 0||s.call(e,!!o),this.block&&(this.block.remove(),this.block=null),(a=this.blockDisposable)===null||a===void 0||a.dispose(),this.blockDisposable=null,this.lastContainer&&(fs()===this.lastContainer||es(fs(),this.lastContainer))&&((l=this.focusToReturn)===null||l===void 0||l.focus()),this.lastContainer=null}},r,!!r)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!wh(e.error)&&this.notificationService.error(e.error)}}var Hqe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},t1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let MV=class extends fe{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new $qe(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,n,r,o,s){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=n,this.keybindingService=r,this.menuService=o,this.contextKeyService=s,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new se),this.onDidShowContextMenu=this._onDidShowContextMenu.event,this._onDidHideContextMenu=this._store.add(new se)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=AV.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...e,onHide:t=>{var n;(n=e.onHide)===null||n===void 0||n.call(e,t),this._onDidHideContextMenu.fire()}}),Xg.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};MV=Hqe([t1(0,ea),t1(1,$r),t1(2,ng),t1(3,ci),t1(4,hu),t1(5,Vt)],MV);var AV;(function(i){function e(n){return n&&n.menuId instanceof $}function t(n,r,o){if(!e(n))return n;const{menuId:s,menuActionOptions:a,contextKeyService:l}=n;return{...n,getActions:()=>{const c=[];if(s){const u=r.createMenu(s,l??o);Fqe(u,a,c),u.dispose()}return n.getActions?lo.join(n.getActions(),c):c}}}i.transform=t})(AV||(AV={}));var WP;(function(i){i[i.API=0]="API",i[i.USER=1]="USER"})(WP||(WP={}));var jX=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},$P=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let PV=class{constructor(e){this._commandService=e}async open(e,t){if(!xq(e,an.command))return!1;if(!(t!=null&&t.allowCommands)||(typeof e=="string"&&(e=At.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let n=[];try{n=fV(decodeURIComponent(e.query))}catch{try{n=fV(e.query)}catch{}}return Array.isArray(n)||(n=[n]),await this._commandService.executeCommand(e.path,...n),!0}};PV=jX([$P(0,sr)],PV);let OV=class{constructor(e){this._editorService=e}async open(e,t){typeof e=="string"&&(e=At.parse(e));const{selection:n,uri:r}=Jje(e);return e=r,e.scheme===an.file&&(e=wze(e)),await this._editorService.openCodeEditor({resource:e,options:{selection:n,source:t!=null&&t.fromUserGesture?WP.USER:WP.API,...t==null?void 0:t.editorOptions}},this._editorService.getFocusedCodeEditor(),t==null?void 0:t.openToSide),!0}};OV=jX([$P(0,Un)],OV);let FV=class{constructor(e,t){this._openers=new _a,this._validators=new _a,this._resolvers=new _a,this._resolvedUriTargets=new Tr(n=>n.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new _a,this._defaultExternalOpener={openExternal:async n=>(eie(n,an.http,an.https)?ume(n):hi.location.href=n,!0)},this._openers.push({open:async(n,r)=>r!=null&&r.openExternal||eie(n,an.mailto,an.http,an.https,an.vsls)?(await this._doOpenExternal(n,r),!0):!1}),this._openers.push(new PV(t)),this._openers.push(new OV(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}async open(e,t){var n;const r=typeof e=="string"?At.parse(e):e,o=(n=this._resolvedUriTargets.get(r))!==null&&n!==void 0?n:e;for(const s of this._validators)if(!await s.shouldOpen(o,t))return!1;for(const s of this._openers)if(await s.open(e,t))return!0;return!1}async resolveExternalUri(e,t){for(const n of this._resolvers)try{const r=await n.resolveExternalUri(e,t);if(r)return this._resolvedUriTargets.has(r.resolved)||this._resolvedUriTargets.set(r.resolved,e),r}catch{}throw new Error("Could not resolve external URI: "+e.toString())}async _doOpenExternal(e,t){const n=typeof e=="string"?At.parse(e):e;let r;try{r=(await this.resolveExternalUri(n,t)).resolved}catch{r=n}let o;if(typeof e=="string"&&n.toString()===r.toString()?o=e:o=encodeURI(r.toString(!0)),t!=null&&t.allowContributedOpeners){const s=typeof(t==null?void 0:t.allowContributedOpeners)=="string"?t==null?void 0:t.allowContributedOpeners:void 0;for(const a of this._externalOpeners)if(await a.openExternal(o,{sourceUri:n,preferredOpenerId:s},Cn.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:n},Cn.None)}dispose(){this._validators.clear()}};FV=jX([$P(0,Un),$P(1,sr)],FV);const hd=yn("editorWorkerService");var pr;(function(i){i[i.Hint=1]="Hint",i[i.Info=2]="Info",i[i.Warning=4]="Warning",i[i.Error=8]="Error"})(pr||(pr={}));(function(i){function e(s,a){return a-s}i.compare=e;const t=Object.create(null);t[i.Error]=w("sev.error","Error"),t[i.Warning]=w("sev.warning","Warning"),t[i.Info]=w("sev.info","Info");function n(s){return t[s]||""}i.toString=n;function r(s){switch(s){case kr.Error:return i.Error;case kr.Warning:return i.Warning;case kr.Info:return i.Info;case kr.Ignore:return i.Hint}}i.fromSeverity=r;function o(s){switch(s){case i.Error:return kr.Error;case i.Warning:return kr.Warning;case i.Info:return kr.Info;case i.Hint:return kr.Ignore}}i.toSeverity=o})(pr||(pr={}));var HP;(function(i){const e="";function t(r){return n(r,!0)}i.makeKey=t;function n(r,o){const s=[e];return r.source?s.push(r.source.replace("¦","\\¦")):s.push(e),r.code?typeof r.code=="string"?s.push(r.code.replace("¦","\\¦")):s.push(r.code.value.replace("¦","\\¦")):s.push(e),r.severity!==void 0&&r.severity!==null?s.push(pr.toString(r.severity)):s.push(e),r.message&&o?s.push(r.message.replace("¦","\\¦")):s.push(e),r.startLineNumber!==void 0&&r.startLineNumber!==null?s.push(r.startLineNumber.toString()):s.push(e),r.startColumn!==void 0&&r.startColumn!==null?s.push(r.startColumn.toString()):s.push(e),r.endLineNumber!==void 0&&r.endLineNumber!==null?s.push(r.endLineNumber.toString()):s.push(e),r.endColumn!==void 0&&r.endColumn!==null?s.push(r.endColumn.toString()):s.push(e),s.push(e),s.join("¦")}i.makeKeyOptionalMessage=n})(HP||(HP={}));const ig=yn("markerService");function Vqe(i,e){const t=[],n=[];for(const r of i)e.has(r)||t.push(r);for(const r of e)i.has(r)||n.push(r);return{removed:t,added:n}}function zqe(i,e){const t=new Set;for(const n of e)i.has(n)&&t.add(n);return t}var Uqe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},nse=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let BV=class extends fe{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new se),this._markerDecorations=new Tr,e.getModels().forEach(n=>this._onModelAdded(n)),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 n=this._markerDecorations.get(e);return n&&n.getMarker(t)||null}_handleMarkerChange(e){e.forEach(t=>{const n=this._markerDecorations.get(t);n&&this._updateDecorations(n)})}_onModelAdded(e){const t=new jqe(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){var t;const n=this._markerDecorations.get(e.uri);n&&(n.dispose(),this._markerDecorations.delete(e.uri)),(e.uri.scheme===an.inMemory||e.uri.scheme===an.internal||e.uri.scheme===an.vscode)&&((t=this._markerService)===null||t===void 0||t.read({resource:e.uri}).map(r=>r.owner).forEach(r=>this._markerService.remove(r,[e.uri])))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500});e.update(t)&&this._onDidChangeMarker.fire(e.model)}};BV=Uqe([nse(0,tr),nse(1,ig)],BV);class jqe extends fe{constructor(e){super(),this.model=e,this._map=new S9e,this._register(Rt(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:n}=Vqe(new Set(this._map.keys()),new Set(e));if(t.length===0&&n.length===0)return!1;const r=n.map(a=>this._map.get(a)),o=t.map(a=>({range:this._createDecorationRange(this.model,a),options:this._createDecorationOption(a)})),s=this.model.deltaDecorations(r,o);for(const a of n)this._map.delete(a);for(let a=0;a=r)return n;const o=e.getWordAtPosition(n.getStartPosition());o&&(n=new B(n.startLineNumber,o.startColumn,n.endLineNumber,o.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&t.startColumn===1&&n.startLineNumber===n.endLineNumber){const r=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);r=0:!1}}var Kqe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},zx=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},I1;function o0(i){return i.toString()}class Gqe{constructor(e,t,n){this.model=e,this._modelEventListeners=new Te,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(r=>n(e,r)))}dispose(){this._modelEventListeners.dispose()}}const qqe=Da||Ln?1:2;class Xqe{constructor(e,t,n,r,o,s,a,l){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=n,this.sharesUndoRedoStack=r,this.heapSize=o,this.sha1=s,this.versionId=a,this.alternativeVersionId=l}}let VP=I1=class extends fe{constructor(e,t,n,r,o){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=n,this._languageService=r,this._languageConfigurationService=o,this._onModelAdded=this._register(new se),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new se),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new se),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._register(this._configurationService.onDidChangeConfiguration(s=>this._updateModelOptions(s))),this._updateModelOptions(void 0)}static _readModelOptions(e,t){var n;let r=Ds.tabSize;if(e.editor&&typeof e.editor.tabSize<"u"){const f=parseInt(e.editor.tabSize,10);isNaN(f)||(r=f),r<1&&(r=1)}let o="tabSize";if(e.editor&&typeof e.editor.indentSize<"u"&&e.editor.indentSize!=="tabSize"){const f=parseInt(e.editor.indentSize,10);isNaN(f)||(o=Math.max(f,1))}let s=Ds.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(s=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let a=qqe;const l=e.eol;l===`\r + `)}return t}class $qe{constructor(e,t,n,r){this.contextViewService=e,this.telemetryService=t,this.notificationService=n,this.keybindingService=r,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;this.focusToReturn=fs();let n;const r=e.domForShadowRoot instanceof HTMLElement?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:o=>{var s;this.lastContainer=o;const a=e.getMenuClassName?e.getMenuClassName():"";a&&(o.className+=" "+a),this.options.blockMouse&&(this.block=o.appendChild(He(".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",(s=this.blockDisposable)===null||s===void 0||s.dispose(),this.blockDisposable=ye(this.block,Ge.MOUSE_DOWN,d=>d.stopPropagation()));const l=new Te,c=e.actionRunner||new Nb;c.onWillRun(d=>this.onActionRun(d,!e.skipTelemetry),this,l),c.onDidRun(this.onDidActionRun,this,l),n=new X_e(o,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:c,getKeyBinding:e.getKeyBinding?e.getKeyBinding:d=>this.keybindingService.lookupKeybinding(d.id)},Oqe),n.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,l),n.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,l);const u=Pt(o);return l.add(ye(u,Ge.BLUR,()=>this.contextViewService.hideContextView(!0))),l.add(ye(u,Ge.MOUSE_DOWN,d=>{if(d.defaultPrevented)return;const h=new Uu(u,d);let f=h.target;if(!h.rightButton){for(;f;){if(f===o)return;f=f.parentElement}this.contextViewService.hideContextView(!0)}})),Zu(l,n)},focus:()=>{n==null||n.focus(!!e.autoSelectFirstItem)},onHide:o=>{var s,a,l;(s=e.onHide)===null||s===void 0||s.call(e,!!o),this.block&&(this.block.remove(),this.block=null),(a=this.blockDisposable)===null||a===void 0||a.dispose(),this.blockDisposable=null,this.lastContainer&&(fs()===this.lastContainer||es(fs(),this.lastContainer))&&((l=this.focusToReturn)===null||l===void 0||l.focus()),this.lastContainer=null}},r,!!r)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!wh(e.error)&&this.notificationService.error(e.error)}}var Hqe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},t1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let MV=class extends fe{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new $qe(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,n,r,o,s){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=n,this.keybindingService=r,this.menuService=o,this.contextKeyService=s,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new se),this.onDidShowContextMenu=this._onDidShowContextMenu.event,this._onDidHideContextMenu=this._store.add(new se)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=AV.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...e,onHide:t=>{var n;(n=e.onHide)===null||n===void 0||n.call(e,t),this._onDidHideContextMenu.fire()}}),Xg.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};MV=Hqe([t1(0,ea),t1(1,$r),t1(2,ng),t1(3,ci),t1(4,hu),t1(5,Vt)],MV);var AV;(function(i){function e(n){return n&&n.menuId instanceof $}function t(n,r,o){if(!e(n))return n;const{menuId:s,menuActionOptions:a,contextKeyService:l}=n;return{...n,getActions:()=>{const c=[];if(s){const u=r.createMenu(s,l??o);Fqe(u,a,c),u.dispose()}return n.getActions?lo.join(n.getActions(),c):c}}}i.transform=t})(AV||(AV={}));var WP;(function(i){i[i.API=0]="API",i[i.USER=1]="USER"})(WP||(WP={}));var jX=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},$P=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let PV=class{constructor(e){this._commandService=e}async open(e,t){if(!xq(e,an.command))return!1;if(!(t!=null&&t.allowCommands)||(typeof e=="string"&&(e=At.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let n=[];try{n=fV(decodeURIComponent(e.query))}catch{try{n=fV(e.query)}catch{}}return Array.isArray(n)||(n=[n]),await this._commandService.executeCommand(e.path,...n),!0}};PV=jX([$P(0,sr)],PV);let OV=class{constructor(e){this._editorService=e}async open(e,t){typeof e=="string"&&(e=At.parse(e));const{selection:n,uri:r}=Jje(e);return e=r,e.scheme===an.file&&(e=wze(e)),await this._editorService.openCodeEditor({resource:e,options:{selection:n,source:t!=null&&t.fromUserGesture?WP.USER:WP.API,...t==null?void 0:t.editorOptions}},this._editorService.getFocusedCodeEditor(),t==null?void 0:t.openToSide),!0}};OV=jX([$P(0,Un)],OV);let FV=class{constructor(e,t){this._openers=new _a,this._validators=new _a,this._resolvers=new _a,this._resolvedUriTargets=new Tr(n=>n.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new _a,this._defaultExternalOpener={openExternal:async n=>(eie(n,an.http,an.https)?ume(n):hi.location.href=n,!0)},this._openers.push({open:async(n,r)=>r!=null&&r.openExternal||eie(n,an.mailto,an.http,an.https,an.vsls)?(await this._doOpenExternal(n,r),!0):!1}),this._openers.push(new PV(t)),this._openers.push(new OV(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}async open(e,t){var n;const r=typeof e=="string"?At.parse(e):e,o=(n=this._resolvedUriTargets.get(r))!==null&&n!==void 0?n:e;for(const s of this._validators)if(!await s.shouldOpen(o,t))return!1;for(const s of this._openers)if(await s.open(e,t))return!0;return!1}async resolveExternalUri(e,t){for(const n of this._resolvers)try{const r=await n.resolveExternalUri(e,t);if(r)return this._resolvedUriTargets.has(r.resolved)||this._resolvedUriTargets.set(r.resolved,e),r}catch{}throw new Error("Could not resolve external URI: "+e.toString())}async _doOpenExternal(e,t){const n=typeof e=="string"?At.parse(e):e;let r;try{r=(await this.resolveExternalUri(n,t)).resolved}catch{r=n}let o;if(typeof e=="string"&&n.toString()===r.toString()?o=e:o=encodeURI(r.toString(!0)),t!=null&&t.allowContributedOpeners){const s=typeof(t==null?void 0:t.allowContributedOpeners)=="string"?t==null?void 0:t.allowContributedOpeners:void 0;for(const a of this._externalOpeners)if(await a.openExternal(o,{sourceUri:n,preferredOpenerId:s},Cn.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:n},Cn.None)}dispose(){this._validators.clear()}};FV=jX([$P(0,Un),$P(1,sr)],FV);const hd=yn("editorWorkerService");var pr;(function(i){i[i.Hint=1]="Hint",i[i.Info=2]="Info",i[i.Warning=4]="Warning",i[i.Error=8]="Error"})(pr||(pr={}));(function(i){function e(s,a){return a-s}i.compare=e;const t=Object.create(null);t[i.Error]=w("sev.error","Error"),t[i.Warning]=w("sev.warning","Warning"),t[i.Info]=w("sev.info","Info");function n(s){return t[s]||""}i.toString=n;function r(s){switch(s){case kr.Error:return i.Error;case kr.Warning:return i.Warning;case kr.Info:return i.Info;case kr.Ignore:return i.Hint}}i.fromSeverity=r;function o(s){switch(s){case i.Error:return kr.Error;case i.Warning:return kr.Warning;case i.Info:return kr.Info;case i.Hint:return kr.Ignore}}i.toSeverity=o})(pr||(pr={}));var HP;(function(i){const e="";function t(r){return n(r,!0)}i.makeKey=t;function n(r,o){const s=[e];return r.source?s.push(r.source.replace("¦","\\¦")):s.push(e),r.code?typeof r.code=="string"?s.push(r.code.replace("¦","\\¦")):s.push(r.code.value.replace("¦","\\¦")):s.push(e),r.severity!==void 0&&r.severity!==null?s.push(pr.toString(r.severity)):s.push(e),r.message&&o?s.push(r.message.replace("¦","\\¦")):s.push(e),r.startLineNumber!==void 0&&r.startLineNumber!==null?s.push(r.startLineNumber.toString()):s.push(e),r.startColumn!==void 0&&r.startColumn!==null?s.push(r.startColumn.toString()):s.push(e),r.endLineNumber!==void 0&&r.endLineNumber!==null?s.push(r.endLineNumber.toString()):s.push(e),r.endColumn!==void 0&&r.endColumn!==null?s.push(r.endColumn.toString()):s.push(e),s.push(e),s.join("¦")}i.makeKeyOptionalMessage=n})(HP||(HP={}));const ig=yn("markerService");function Vqe(i,e){const t=[],n=[];for(const r of i)e.has(r)||t.push(r);for(const r of e)i.has(r)||n.push(r);return{removed:t,added:n}}function zqe(i,e){const t=new Set;for(const n of e)i.has(n)&&t.add(n);return t}var Uqe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},nse=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let BV=class extends fe{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new se),this._markerDecorations=new Tr,e.getModels().forEach(n=>this._onModelAdded(n)),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 n=this._markerDecorations.get(e);return n&&n.getMarker(t)||null}_handleMarkerChange(e){e.forEach(t=>{const n=this._markerDecorations.get(t);n&&this._updateDecorations(n)})}_onModelAdded(e){const t=new jqe(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){var t;const n=this._markerDecorations.get(e.uri);n&&(n.dispose(),this._markerDecorations.delete(e.uri)),(e.uri.scheme===an.inMemory||e.uri.scheme===an.internal||e.uri.scheme===an.vscode)&&((t=this._markerService)===null||t===void 0||t.read({resource:e.uri}).map(r=>r.owner).forEach(r=>this._markerService.remove(r,[e.uri])))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500});e.update(t)&&this._onDidChangeMarker.fire(e.model)}};BV=Uqe([nse(0,tr),nse(1,ig)],BV);class jqe extends fe{constructor(e){super(),this.model=e,this._map=new S9e,this._register(Rt(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:n}=Vqe(new Set(this._map.keys()),new Set(e));if(t.length===0&&n.length===0)return!1;const r=n.map(a=>this._map.get(a)),o=t.map(a=>({range:this._createDecorationRange(this.model,a),options:this._createDecorationOption(a)})),s=this.model.deltaDecorations(r,o);for(const a of n)this._map.delete(a);for(let a=0;a=r)return n;const o=e.getWordAtPosition(n.getStartPosition());o&&(n=new B(n.startLineNumber,o.startColumn,n.endLineNumber,o.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&t.startColumn===1&&n.startLineNumber===n.endLineNumber){const r=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);r=0:!1}}var Kqe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},zx=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},I1;function r0(i){return i.toString()}class Gqe{constructor(e,t,n){this.model=e,this._modelEventListeners=new Te,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(r=>n(e,r)))}dispose(){this._modelEventListeners.dispose()}}const qqe=Da||Ln?1:2;class Xqe{constructor(e,t,n,r,o,s,a,l){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=n,this.sharesUndoRedoStack=r,this.heapSize=o,this.sha1=s,this.versionId=a,this.alternativeVersionId=l}}let VP=I1=class extends fe{constructor(e,t,n,r,o){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=n,this._languageService=r,this._languageConfigurationService=o,this._onModelAdded=this._register(new se),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new se),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new se),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._register(this._configurationService.onDidChangeConfiguration(s=>this._updateModelOptions(s))),this._updateModelOptions(void 0)}static _readModelOptions(e,t){var n;let r=Ds.tabSize;if(e.editor&&typeof e.editor.tabSize<"u"){const f=parseInt(e.editor.tabSize,10);isNaN(f)||(r=f),r<1&&(r=1)}let o="tabSize";if(e.editor&&typeof e.editor.indentSize<"u"&&e.editor.indentSize!=="tabSize"){const f=parseInt(e.editor.indentSize,10);isNaN(f)||(o=Math.max(f,1))}let s=Ds.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(s=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let a=qqe;const l=e.eol;l===`\r `?a=2:l===` `&&(a=1);let c=Ds.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(c=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let u=Ds.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(u=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let d=Ds.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(d=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let h=Ds.bracketPairColorizationOptions;return!((n=e.editor)===null||n===void 0)&&n.bracketPairColorization&&typeof e.editor.bracketPairColorization=="object"&&(h={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:r,indentSize:o,insertSpaces:s,detectIndentation:u,defaultEOL:a,trimAutoWhitespace:c,largeFileOptimizations:d,bracketPairColorizationOptions:h}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const n=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return n&&typeof n=="string"&&n!=="auto"?n:yl===3||yl===2?` `:`\r -`}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,n){const r=typeof e=="string"?e:e.languageId;let o=this._modelCreationOptionsByLanguageAndResource[r+t];if(!o){const s=this._configurationService.getValue("editor",{overrideIdentifier:r,resource:t}),a=this._getEOL(t,r);o=I1._readModelOptions({editor:s,eol:a},n),this._modelCreationOptionsByLanguageAndResource[r+t]=o}return o}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const n=Object.keys(this._models);for(let r=0,o=n.length;re){const t=[];for(this._disposedModels.forEach(n=>{n.sharesUndoRedoStack||t.push(n)}),t.sort((n,r)=>n.time-r.time);t.length>0&&this._disposedModelsHeapSize>e;){const n=t.shift();this._removeDisposedModel(n.uri),n.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(n.initialUndoRedoSnapshot)}}}_createModelData(e,t,n,r){const o=this.getCreationOptions(t,n,r),s=new zf(e,t,o,n,this._undoRedoService,this._languageService,this._languageConfigurationService);if(n&&this._disposedModels.has(o0(n))){const c=this._removeDisposedModel(n),u=this._undoRedoService.getElements(n),d=this._getSHA1Computer(),h=d.canComputeSHA1(s)?d.computeSHA1(s)===c.sha1:!1;if(h||c.sharesUndoRedoStack){for(const f of u.past)Pg(f)&&f.matchesResource(n)&&f.setModel(s);for(const f of u.future)Pg(f)&&f.matchesResource(n)&&f.setModel(s);this._undoRedoService.setElementsValidFlag(n,!0,f=>Pg(f)&&f.matchesResource(n)),h&&(s._overwriteVersionId(c.versionId),s._overwriteAlternativeVersionId(c.alternativeVersionId),s._overwriteInitialUndoRedoSnapshot(c.initialUndoRedoSnapshot))}else c.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(c.initialUndoRedoSnapshot)}const a=o0(s.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new Gqe(s,c=>this._onWillDispose(c),(c,u)=>this._onDidChangeLanguage(c,u));return this._models[a]=l,l}createModel(e,t,n,r=!1){let o;return t?o=this._createModelData(e,t,n,r):o=this._createModelData(e,hc,n,r),this._onModelAdded.fire(o.model),o.model}getModels(){const e=[],t=Object.keys(this._models);for(let n=0,r=t.length;n0||c.future.length>0){for(const u of c.past)Pg(u)&&u.matchesResource(e.uri)&&(o=!0,s+=u.heapSize(e.uri),u.setModel(e.uri));for(const u of c.future)Pg(u)&&u.matchesResource(e.uri)&&(o=!0,s+=u.heapSize(e.uri),u.setModel(e.uri))}}const a=I1.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,l=this._getSHA1Computer();if(o)if(!r&&(s>a||!l.canComputeSHA1(e))){const c=n.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}else this._ensureDisposedModelsHeapSize(a-s),this._undoRedoService.setElementsValidFlag(e.uri,!1,c=>Pg(c)&&c.matchesResource(e.uri)),this._insertDisposedModel(new Xqe(e.uri,n.model.getInitialUndoRedoSnapshot(),Date.now(),r,s,l.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else if(!r){const c=n.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}delete this._models[t],n.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){const n=t.oldLanguage,r=e.getLanguageId(),o=this.getCreationOptions(n,e.uri,e.isForSimpleWidget),s=this.getCreationOptions(r,e.uri,e.isForSimpleWidget);I1._setModelOptionsForModel(e,s,o),this._onModelModeChanged.fire({model:e,oldLanguageId:n})}_getSHA1Computer(){return new r3}};VP.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024;VP=I1=Kqe([zx(0,gn),zx(1,zme),zx(2,U4),zx(3,ji),zx(4,Di)],VP);class r3{canComputeSHA1(e){return e.getValueLength()<=r3.MAX_MODEL_SIZE}computeSHA1(e){const t=new u4,n=e.createSnapshot();let r;for(;r=n.read();)t.update(r);return t.digest()}}r3.MAX_MODEL_SIZE=10*1024*1024;class Yqe{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:fe.None}}renderElement(e,t,n,r){var o;if((o=n.disposable)===null||o===void 0||o.dispose(),!n.data)return;const s=this.modelProvider();if(s.isResolved(e))return this.renderer.renderElement(s.get(e),e,n.data,r);const a=new wr,l=s.resolve(e,a.token);n.disposable={dispose:()=>a.cancel()},this.renderer.renderPlaceholder(e,n.data),l.then(c=>this.renderer.renderElement(c,e,n.data,r))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class Zqe{constructor(e,t){this.modelProvider=e,this.accessibilityProvider=t}getWidgetAriaLabel(){return this.accessibilityProvider.getWidgetAriaLabel()}getAriaLabel(e){const t=this.modelProvider();return t.isResolved(e)?this.accessibilityProvider.getAriaLabel(t.get(e)):null}}function Qqe(i,e){return{...e,accessibilityProvider:e.accessibilityProvider&&new Zqe(i,e.accessibilityProvider)}}class Jqe{constructor(e,t,n,r,o={}){const s=()=>this.model,a=r.map(l=>new Yqe(l,s));this.list=new wc(e,t,n,a,Qqe(s,o))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get widget(){return this.list}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return Je.map(this.list.onMouseDblClick,({element:e,index:t,browserEvent:n})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:n}))}get onPointer(){return Je.map(this.list.onPointer,({element:e,index:t,browserEvent:n})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:n}))}get onDidChangeSelection(){return Je.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:n})=>({elements:e.map(r=>this._model.get(r)),indexes:t,browserEvent:n}))}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,la(e.length))}getFocus(){return this.list.getFocus()}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map(e=>this.model.get(e))}style(e){this.list.style(e)}dispose(){this.list.dispose()}}var MS=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o};const eXe=!1;var zP;(function(i){i.North="north",i.South="south",i.East="east",i.West="west"})(zP||(zP={}));let tXe=4;const nXe=new se;let iXe=300;const rXe=new se;class KX{constructor(e){this.el=e,this.disposables=new Te}get onPointerMove(){return this.disposables.add(new wn(Pt(this.el),"mousemove")).event}get onPointerUp(){return this.disposables.add(new wn(Pt(this.el),"mouseup")).event}dispose(){this.disposables.dispose()}}MS([Rr],KX.prototype,"onPointerMove",null);MS([Rr],KX.prototype,"onPointerUp",null);class GX{get onPointerMove(){return this.disposables.add(new wn(this.el,Si.Change)).event}get onPointerUp(){return this.disposables.add(new wn(this.el,Si.End)).event}constructor(e){this.el=e,this.disposables=new Te}dispose(){this.disposables.dispose()}}MS([Rr],GX.prototype,"onPointerMove",null);MS([Rr],GX.prototype,"onPointerUp",null);class UP{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}MS([Rr],UP.prototype,"onPointerMove",null);MS([Rr],UP.prototype,"onPointerUp",null);const ise="pointer-events-disabled";class Ls extends fe{get state(){return this._state}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}set state(e){this._state!==e&&(this.el.classList.toggle("disabled",e===0),this.el.classList.toggle("minimum",e===1),this.el.classList.toggle("maximum",e===2),this._state=e,this.onDidEnablementChange.fire(e))}set orthogonalStartSash(e){if(this._orthogonalStartSash!==e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=n=>{this.orthogonalStartDragHandleDisposables.clear(),n!==0&&(this._orthogonalStartDragHandle=ke(this.el,He(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(Rt(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new wn(this._orthogonalStartDragHandle,"mouseenter")).event(()=>Ls.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new wn(this._orthogonalStartDragHandle,"mouseleave")).event(()=>Ls.onMouseLeave(e),void 0,this.orthogonalStartDragHandleDisposables))};this.orthogonalStartSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalStartSash=e}}set orthogonalEndSash(e){if(this._orthogonalEndSash!==e){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),e){const t=n=>{this.orthogonalEndDragHandleDisposables.clear(),n!==0&&(this._orthogonalEndDragHandle=ke(this.el,He(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(Rt(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new wn(this._orthogonalEndDragHandle,"mouseenter")).event(()=>Ls.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new wn(this._orthogonalEndDragHandle,"mouseleave")).event(()=>Ls.onMouseLeave(e),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}}constructor(e,t,n){super(),this.hoverDelay=iXe,this.hoverDelayer=this._register(new nd(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new se),this._onDidStart=this._register(new se),this._onDidChange=this._register(new se),this._onDidReset=this._register(new se),this._onDidEnd=this._register(new se),this.orthogonalStartSashDisposables=this._register(new Te),this.orthogonalStartDragHandleDisposables=this._register(new Te),this.orthogonalEndSashDisposables=this._register(new Te),this.orthogonalEndDragHandleDisposables=this._register(new Te),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=ke(e,He(".monaco-sash")),n.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${n.orthogonalEdge}`),Ln&&this.el.classList.add("mac");const r=this._register(new wn(this.el,"mousedown")).event;this._register(r(d=>this.onPointerStart(d,new KX(e)),this));const o=this._register(new wn(this.el,"dblclick")).event;this._register(o(this.onPointerDoublePress,this));const s=this._register(new wn(this.el,"mouseenter")).event;this._register(s(()=>Ls.onMouseEnter(this)));const a=this._register(new wn(this.el,"mouseleave")).event;this._register(a(()=>Ls.onMouseLeave(this))),this._register(wi.addTarget(this.el));const l=this._register(new wn(this.el,Si.Start)).event;this._register(l(d=>this.onPointerStart(d,new GX(this.el)),this));const c=this._register(new wn(this.el,Si.Tap)).event;let u;this._register(c(d=>{if(u){clearTimeout(u),u=void 0,this.onPointerDoublePress(d);return}clearTimeout(u),u=setTimeout(()=>u=void 0,250)},this)),typeof n.size=="number"?(this.size=n.size,n.orientation===0?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=tXe,this._register(nXe.event(d=>{this.size=d,this.layout()}))),this._register(rXe.event(d=>this.hoverDelay=d)),this.layoutProvider=t,this.orthogonalStartSash=n.orthogonalStartSash,this.orthogonalEndSash=n.orthogonalEndSash,this.orientation=n.orientation||0,this.orientation===1?(this.el.classList.add("horizontal"),this.el.classList.remove("vertical")):(this.el.classList.remove("horizontal"),this.el.classList.add("vertical")),this.el.classList.toggle("debug",eXe),this.layout()}onPointerStart(e,t){hn.stop(e);let n=!1;if(!e.__orthogonalSashEvent){const g=this.getOrthogonalSash(e);g&&(n=!0,e.__orthogonalSashEvent=!0,g.onPointerStart(e,new UP(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new UP(t))),!this.state)return;const r=this.el.ownerDocument.getElementsByTagName("iframe");for(const g of r)g.classList.add(ise);const o=e.pageX,s=e.pageY,a=e.altKey,l={startX:o,currentX:o,startY:s,currentY:s,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(l);const c=gc(this.el),u=()=>{let g="";n?g="all-scroll":this.orientation===1?this.state===1?g="s-resize":this.state===2?g="n-resize":g=Ln?"row-resize":"ns-resize":this.state===1?g="e-resize":this.state===2?g="w-resize":g=Ln?"col-resize":"ew-resize",c.textContent=`* { cursor: ${g} !important; }`},d=new Te;u(),n||this.onDidEnablementChange.event(u,null,d);const h=g=>{hn.stop(g,!1);const p={startX:o,currentX:g.pageX,startY:s,currentY:g.pageY,altKey:a};this._onDidChange.fire(p)},f=g=>{hn.stop(g,!1),this.el.removeChild(c),this.el.classList.remove("active"),this._onDidEnd.fire(),d.dispose();for(const p of r)p.classList.remove(ise)};t.onPointerMove(h,null,d),t.onPointerUp(f,null,d),d.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&&Ls.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&Ls.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){Ls.onMouseLeave(this)}layout(){if(this.orientation===0){const e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{const e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}getOrthogonalSash(e){var t;const n=(t=e.initialTarget)!==null&&t!==void 0?t:e.target;if(!(!n||!(n instanceof HTMLElement))&&n.classList.contains("orthogonal-drag-handle"))return n.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}const oXe={separatorBorder:me.transparent};class Z_e{set size(e){this._size=e}get size(){return this._size}get visible(){return typeof this._cachedVisibleSize>"u"}setVisible(e,t){var n,r;if(e!==this.visible){e?(this.size=da(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof t=="number"?t:this.size,this.size=0),this.container.classList.toggle("visible",e);try{(r=(n=this.view).setVisible)===null||r===void 0||r.call(n,e)}catch(o){console.error("Splitview: Failed to set visible view"),console.error(o)}}}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get proportionalLayout(){var e;return(e=this.view.proportionalLayout)!==null&&e!==void 0?e:!0}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,t,n,r){this.container=e,this.view=t,this.disposable=r,this._cachedVisibleSize=void 0,typeof n=="number"?(this._size=n,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=n.cachedVisibleSize)}layout(e,t){this.layoutContainer(e);try{this.view.layout(this.size,e,t)}catch(n){console.error("Splitview: Failed to layout view"),console.error(n)}}dispose(){this.disposable.dispose()}}class sXe extends Z_e{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class aXe extends Z_e{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var kg;(function(i){i[i.Idle=0]="Idle",i[i.Busy=1]="Busy"})(kg||(kg={}));var jP;(function(i){i.Distribute={type:"distribute"};function e(r){return{type:"split",index:r}}i.Split=e;function t(r){return{type:"auto",index:r}}i.Auto=t;function n(r){return{type:"invisible",cachedVisibleSize:r}}i.Invisible=n})(jP||(jP={}));class Q_e extends fe{get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}get startSnappingEnabled(){return this._startSnappingEnabled}get endSnappingEnabled(){return this._endSnappingEnabled}set orthogonalStartSash(e){for(const t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}set orthogonalEndSash(e){for(const t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}constructor(e,t={}){var n,r,o,s,a;super(),this.size=0,this._contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=kg.Idle,this._onDidSashChange=this._register(new se),this._onDidSashReset=this._register(new se),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=(n=t.orientation)!==null&&n!==void 0?n:0,this.inverseAltBehavior=(r=t.inverseAltBehavior)!==null&&r!==void 0?r:!1,this.proportionalLayout=(o=t.proportionalLayout)!==null&&o!==void 0?o:!0,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(this.orientation===0?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=ke(this.el,He(".sash-container")),this.viewContainer=He(".split-view-container"),this.scrollable=this._register(new TS({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:c=>Il(Pt(this.el),c)})),this.scrollableElement=this._register(new O4(this.viewContainer,{vertical:this.orientation===0?(s=t.scrollbarVisibility)!==null&&s!==void 0?s:1:2,horizontal:this.orientation===1?(a=t.scrollbarVisibility)!==null&&a!==void 0?a:1:2},this.scrollable));const l=this._register(new wn(this.viewContainer,"scroll")).event;this._register(l(c=>{const u=this.scrollableElement.getScrollPosition(),d=Math.abs(this.viewContainer.scrollLeft-u.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,h=Math.abs(this.viewContainer.scrollTop-u.scrollTop)<=1?void 0:this.viewContainer.scrollTop;(d!==void 0||h!==void 0)&&this.scrollableElement.setScrollPosition({scrollLeft:d,scrollTop:h})})),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(c=>{c.scrollTopChanged&&(this.viewContainer.scrollTop=c.scrollTop),c.scrollLeftChanged&&(this.viewContainer.scrollLeft=c.scrollLeft)})),ke(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||oXe),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((c,u)=>{const d=Cl(c.visible)||c.visible?c.size:{type:"invisible",cachedVisibleSize:c.size},h=c.view;this.doAddView(h,d,u,!0)}),this._contentSize=this.viewItems.reduce((c,u)=>c+u.size,0),this.saveProportions())}style(e){e.separatorBorder.isTransparent()?(this.el.classList.remove("separator-border"),this.el.style.removeProperty("--separator-border")):(this.el.classList.add("separator-border"),this.el.style.setProperty("--separator-border",e.separatorBorder.toString()))}addView(e,t,n=this.viewItems.length,r){this.doAddView(e,t,n,r)}layout(e,t){const n=Math.max(this.size,this._contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let r=0;for(let o=0;o0&&(s.size=da(Math.round(a*e/r),s.minimumSize,s.maximumSize))}}else{const r=la(this.viewItems.length),o=r.filter(a=>this.viewItems[a].priority===1),s=r.filter(a=>this.viewItems[a].priority===2);this.resize(this.viewItems.length-1,e-n,void 0,o,s)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this._contentSize>0&&(this.proportions=this.viewItems.map(e=>e.proportionalLayout&&e.visible?e.size/this._contentSize:void 0))}onSashStart({sash:e,start:t,alt:n}){for(const a of this.viewItems)a.enabled=!1;const r=this.sashItems.findIndex(a=>a.sash===e),o=Zu(ye(this.el.ownerDocument.body,"keydown",a=>s(this.sashDragState.current,a.altKey)),ye(this.el.ownerDocument.body,"keyup",()=>s(this.sashDragState.current,!1))),s=(a,l)=>{const c=this.viewItems.map(g=>g.size);let u=Number.NEGATIVE_INFINITY,d=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(l=!l),l)if(r===this.sashItems.length-1){const p=this.viewItems[r];u=(p.minimumSize-p.size)/2,d=(p.maximumSize-p.size)/2}else{const p=this.viewItems[r+1];u=(p.size-p.maximumSize)/2,d=(p.size-p.minimumSize)/2}let h,f;if(!l){const g=la(r,-1),p=la(r+1,this.viewItems.length),v=g.reduce((k,T)=>k+(this.viewItems[T].minimumSize-c[T]),0),m=g.reduce((k,T)=>k+(this.viewItems[T].viewMaximumSize-c[T]),0),_=p.length===0?Number.POSITIVE_INFINITY:p.reduce((k,T)=>k+(c[T]-this.viewItems[T].minimumSize),0),y=p.length===0?Number.NEGATIVE_INFINITY:p.reduce((k,T)=>k+(c[T]-this.viewItems[T].viewMaximumSize),0),S=Math.max(v,y),L=Math.min(_,m),E=this.findFirstSnapIndex(g),D=this.findFirstSnapIndex(p);if(typeof E=="number"){const k=this.viewItems[E],T=Math.floor(k.viewMinimumSize/2);h={index:E,limitDelta:k.visible?S-T:S+T,size:k.size}}if(typeof D=="number"){const k=this.viewItems[D],T=Math.floor(k.viewMinimumSize/2);f={index:D,limitDelta:k.visible?L+T:L-T,size:k.size}}}this.sashDragState={start:a,current:a,index:r,sizes:c,minDelta:u,maxDelta:d,alt:l,snapBefore:h,snapAfter:f,disposable:o}};s(t,n)}onSashChange({current:e}){const{index:t,start:n,sizes:r,alt:o,minDelta:s,maxDelta:a,snapBefore:l,snapAfter:c}=this.sashDragState;this.sashDragState.current=e;const u=e-n,d=this.resize(t,u,r,void 0,void 0,s,a,l,c);if(o){const h=t===this.sashItems.length-1,f=this.viewItems.map(y=>y.size),g=h?t:t+1,p=this.viewItems[g],v=p.size-p.maximumSize,m=p.size-p.minimumSize,_=h?t-1:t+1;this.resize(_,-d,f,void 0,void 0,v,m)}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 n=this.viewItems.indexOf(e);n<0||n>=this.viewItems.length||(t=typeof t=="number"?t:e.size,t=da(t,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&n>0?(this.resize(n-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([n],void 0)))}resizeView(e,t){if(!(e<0||e>=this.viewItems.length)){if(this.state!==kg.Idle)throw new Error("Cant modify splitview");this.state=kg.Busy;try{const n=la(this.viewItems.length).filter(a=>a!==e),r=[...n.filter(a=>this.viewItems[a].priority===1),e],o=n.filter(a=>this.viewItems[a].priority===2),s=this.viewItems[e];t=Math.round(t),t=da(t,s.minimumSize,Math.min(s.maximumSize,this.size)),s.size=t,this.relayout(r,o)}finally{this.state=kg.Idle}}}distributeViewSizes(){const e=[];let t=0;for(const a of this.viewItems)a.maximumSize-a.minimumSize>0&&(e.push(a),t+=a.size);const n=Math.floor(t/e.length);for(const a of e)a.size=da(n,a.minimumSize,a.maximumSize);const r=la(this.viewItems.length),o=r.filter(a=>this.viewItems[a].priority===1),s=r.filter(a=>this.viewItems[a].priority===2);this.relayout(o,s)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,n=this.viewItems.length,r){if(this.state!==kg.Idle)throw new Error("Cant modify splitview");this.state=kg.Busy;try{const o=He(".split-view-view");n===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(n));const s=e.onDidChange(h=>this.onViewChange(u,h)),a=Rt(()=>this.viewContainer.removeChild(o)),l=Zu(s,a);let c;typeof t=="number"?c=t:(t.type==="auto"&&(this.areViewsDistributed()?t={type:"distribute"}:t={type:"split",index:t.index}),t.type==="split"?c=this.getViewSize(t.index)/2:t.type==="invisible"?c={cachedVisibleSize:t.cachedVisibleSize}:c=e.minimumSize);const u=this.orientation===0?new sXe(o,e,c,l):new aXe(o,e,c,l);if(this.viewItems.splice(n,0,u),this.viewItems.length>1){const h={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},f=this.orientation===0?new Ls(this.sashContainer,{getHorizontalSashTop:k=>this.getSashPosition(k),getHorizontalSashWidth:this.getSashOrthogonalSize},{...h,orientation:1}):new Ls(this.sashContainer,{getVerticalSashLeft:k=>this.getSashPosition(k),getVerticalSashHeight:this.getSashOrthogonalSize},{...h,orientation:0}),g=this.orientation===0?k=>({sash:f,start:k.startY,current:k.currentY,alt:k.altKey}):k=>({sash:f,start:k.startX,current:k.currentX,alt:k.altKey}),v=Je.map(f.onDidStart,g)(this.onSashStart,this),_=Je.map(f.onDidChange,g)(this.onSashChange,this),S=Je.map(f.onDidEnd,()=>this.sashItems.findIndex(k=>k.sash===f))(this.onSashEnd,this),L=f.onDidReset(()=>{const k=this.sashItems.findIndex(R=>R.sash===f),T=la(k,-1),M=la(k+1,this.viewItems.length),A=this.findFirstSnapIndex(T),N=this.findFirstSnapIndex(M);typeof A=="number"&&!this.viewItems[A].visible||typeof N=="number"&&!this.viewItems[N].visible||this._onDidSashReset.fire(k)}),E=Zu(v,_,S,L,f),D={sash:f,disposable:E};this.sashItems.splice(n-1,0,D)}o.appendChild(e.element);let d;typeof t!="number"&&t.type==="split"&&(d=[t.index]),r||this.relayout([n],d),!r&&typeof t!="number"&&t.type==="distribute"&&this.distributeViewSizes()}finally{this.state=kg.Idle}}relayout(e,t){const n=this.viewItems.reduce((r,o)=>r+o.size,0);this.resize(this.viewItems.length-1,this.size-n,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,n=this.viewItems.map(u=>u.size),r,o,s=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,l,c){if(e<0||e>=this.viewItems.length)return 0;const u=la(e,-1),d=la(e+1,this.viewItems.length);if(o)for(const D of o)q8(u,D),q8(d,D);if(r)for(const D of r)YN(u,D),YN(d,D);const h=u.map(D=>this.viewItems[D]),f=u.map(D=>n[D]),g=d.map(D=>this.viewItems[D]),p=d.map(D=>n[D]),v=u.reduce((D,k)=>D+(this.viewItems[k].minimumSize-n[k]),0),m=u.reduce((D,k)=>D+(this.viewItems[k].maximumSize-n[k]),0),_=d.length===0?Number.POSITIVE_INFINITY:d.reduce((D,k)=>D+(n[k]-this.viewItems[k].minimumSize),0),y=d.length===0?Number.NEGATIVE_INFINITY:d.reduce((D,k)=>D+(n[k]-this.viewItems[k].maximumSize),0),S=Math.max(v,y,s),L=Math.min(_,m,a);let E=!1;if(l){const D=this.viewItems[l.index],k=t>=l.limitDelta;E=k!==D.visible,D.setVisible(k,l.size)}if(!E&&c){const D=this.viewItems[c.index],k=ta+l.size,0);let n=this.size-t;const r=la(this.viewItems.length-1,-1),o=r.filter(a=>this.viewItems[a].priority===1),s=r.filter(a=>this.viewItems[a].priority===2);for(const a of s)q8(r,a);for(const a of o)YN(r,a);typeof e=="number"&&YN(r,e);for(let a=0;n!==0&&at+n.size,0);let e=0;for(const t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach(t=>t.sash.layout()),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){this.orientation===0?this.scrollableElement.setScrollDimensions({height:this.size,scrollHeight:this._contentSize}):this.scrollableElement.setScrollDimensions({width:this.size,scrollWidth:this._contentSize})}updateSashEnablement(){let e=!1;const t=this.viewItems.map(l=>e=l.size-l.minimumSize>0||e);e=!1;const n=this.viewItems.map(l=>e=l.maximumSize-l.size>0||e),r=[...this.viewItems].reverse();e=!1;const o=r.map(l=>e=l.size-l.minimumSize>0||e).reverse();e=!1;const s=r.map(l=>e=l.maximumSize-l.size>0||e).reverse();let a=0;for(let l=0;l0||this.startSnappingEnabled)?c.state=1:_&&t[l]&&(a0)return;if(!n.visible&&n.snap)return t}}areViewsDistributed(){let e,t;for(const n of this.viewItems)if(e=e===void 0?n.size:Math.min(e,n.size),t=t===void 0?n.size:Math.max(t,n.size),t-e>2)return!1;return!0}dispose(){var e;(e=this.sashDragState)===null||e===void 0||e.disposable.dispose(),si(this.viewItems),this.viewItems=[],this.sashItems.forEach(t=>t.disposable.dispose()),this.sashItems=[],super.dispose()}}class Qk{constructor(e,t,n){this.columns=e,this.getColumnSize=n,this.templateId=Qk.TemplateId,this.renderedTemplates=new Set;const r=new Map(t.map(o=>[o.templateId,o]));this.renderers=[];for(const o of e){const s=r.get(o.templateId);if(!s)throw new Error(`Table cell renderer for template id ${o.templateId} not found.`);this.renderers.push(s)}}renderTemplate(e){const t=ke(e,He(".monaco-table-tr")),n=[],r=[];for(let s=0;sthis.disposables.add(new cXe(u,d))),l={size:a.reduce((u,d)=>u+d.column.weight,0),views:a.map(u=>({size:u.column.weight,view:u}))};this.splitview=this.disposables.add(new Q_e(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:l})),this.splitview.el.style.height=`${n.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${n.headerRowHeight}px`;const c=new Qk(r,o,u=>this.splitview.getViewSize(u));this.list=this.disposables.add(new wc(e,this.domNode,lXe(n),[c],s)),Je.any(...a.map(u=>u.onDidLayout))(([u,d])=>c.layoutColumn(u,d),null,this.disposables),this.splitview.onDidSashReset(u=>{const d=r.reduce((f,g)=>f+g.weight,0),h=r[u].weight/d*this.cachedWidth;this.splitview.resizeView(u,h)},null,this.disposables),this.styleElement=gc(this.domNode),this.style(gqe)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,n=[]){this.list.splice(e,t,n)}getHTMLElement(){return this.domNode}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before { +`}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,n){const r=typeof e=="string"?e:e.languageId;let o=this._modelCreationOptionsByLanguageAndResource[r+t];if(!o){const s=this._configurationService.getValue("editor",{overrideIdentifier:r,resource:t}),a=this._getEOL(t,r);o=I1._readModelOptions({editor:s,eol:a},n),this._modelCreationOptionsByLanguageAndResource[r+t]=o}return o}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const n=Object.keys(this._models);for(let r=0,o=n.length;re){const t=[];for(this._disposedModels.forEach(n=>{n.sharesUndoRedoStack||t.push(n)}),t.sort((n,r)=>n.time-r.time);t.length>0&&this._disposedModelsHeapSize>e;){const n=t.shift();this._removeDisposedModel(n.uri),n.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(n.initialUndoRedoSnapshot)}}}_createModelData(e,t,n,r){const o=this.getCreationOptions(t,n,r),s=new zf(e,t,o,n,this._undoRedoService,this._languageService,this._languageConfigurationService);if(n&&this._disposedModels.has(r0(n))){const c=this._removeDisposedModel(n),u=this._undoRedoService.getElements(n),d=this._getSHA1Computer(),h=d.canComputeSHA1(s)?d.computeSHA1(s)===c.sha1:!1;if(h||c.sharesUndoRedoStack){for(const f of u.past)Pg(f)&&f.matchesResource(n)&&f.setModel(s);for(const f of u.future)Pg(f)&&f.matchesResource(n)&&f.setModel(s);this._undoRedoService.setElementsValidFlag(n,!0,f=>Pg(f)&&f.matchesResource(n)),h&&(s._overwriteVersionId(c.versionId),s._overwriteAlternativeVersionId(c.alternativeVersionId),s._overwriteInitialUndoRedoSnapshot(c.initialUndoRedoSnapshot))}else c.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(c.initialUndoRedoSnapshot)}const a=r0(s.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new Gqe(s,c=>this._onWillDispose(c),(c,u)=>this._onDidChangeLanguage(c,u));return this._models[a]=l,l}createModel(e,t,n,r=!1){let o;return t?o=this._createModelData(e,t,n,r):o=this._createModelData(e,hc,n,r),this._onModelAdded.fire(o.model),o.model}getModels(){const e=[],t=Object.keys(this._models);for(let n=0,r=t.length;n0||c.future.length>0){for(const u of c.past)Pg(u)&&u.matchesResource(e.uri)&&(o=!0,s+=u.heapSize(e.uri),u.setModel(e.uri));for(const u of c.future)Pg(u)&&u.matchesResource(e.uri)&&(o=!0,s+=u.heapSize(e.uri),u.setModel(e.uri))}}const a=I1.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,l=this._getSHA1Computer();if(o)if(!r&&(s>a||!l.canComputeSHA1(e))){const c=n.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}else this._ensureDisposedModelsHeapSize(a-s),this._undoRedoService.setElementsValidFlag(e.uri,!1,c=>Pg(c)&&c.matchesResource(e.uri)),this._insertDisposedModel(new Xqe(e.uri,n.model.getInitialUndoRedoSnapshot(),Date.now(),r,s,l.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else if(!r){const c=n.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}delete this._models[t],n.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){const n=t.oldLanguage,r=e.getLanguageId(),o=this.getCreationOptions(n,e.uri,e.isForSimpleWidget),s=this.getCreationOptions(r,e.uri,e.isForSimpleWidget);I1._setModelOptionsForModel(e,s,o),this._onModelModeChanged.fire({model:e,oldLanguageId:n})}_getSHA1Computer(){return new r3}};VP.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024;VP=I1=Kqe([zx(0,gn),zx(1,zme),zx(2,U4),zx(3,ji),zx(4,Di)],VP);class r3{canComputeSHA1(e){return e.getValueLength()<=r3.MAX_MODEL_SIZE}computeSHA1(e){const t=new u4,n=e.createSnapshot();let r;for(;r=n.read();)t.update(r);return t.digest()}}r3.MAX_MODEL_SIZE=10*1024*1024;class Yqe{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:fe.None}}renderElement(e,t,n,r){var o;if((o=n.disposable)===null||o===void 0||o.dispose(),!n.data)return;const s=this.modelProvider();if(s.isResolved(e))return this.renderer.renderElement(s.get(e),e,n.data,r);const a=new wr,l=s.resolve(e,a.token);n.disposable={dispose:()=>a.cancel()},this.renderer.renderPlaceholder(e,n.data),l.then(c=>this.renderer.renderElement(c,e,n.data,r))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class Zqe{constructor(e,t){this.modelProvider=e,this.accessibilityProvider=t}getWidgetAriaLabel(){return this.accessibilityProvider.getWidgetAriaLabel()}getAriaLabel(e){const t=this.modelProvider();return t.isResolved(e)?this.accessibilityProvider.getAriaLabel(t.get(e)):null}}function Qqe(i,e){return{...e,accessibilityProvider:e.accessibilityProvider&&new Zqe(i,e.accessibilityProvider)}}class Jqe{constructor(e,t,n,r,o={}){const s=()=>this.model,a=r.map(l=>new Yqe(l,s));this.list=new wc(e,t,n,a,Qqe(s,o))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get widget(){return this.list}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return Je.map(this.list.onMouseDblClick,({element:e,index:t,browserEvent:n})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:n}))}get onPointer(){return Je.map(this.list.onPointer,({element:e,index:t,browserEvent:n})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:n}))}get onDidChangeSelection(){return Je.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:n})=>({elements:e.map(r=>this._model.get(r)),indexes:t,browserEvent:n}))}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,la(e.length))}getFocus(){return this.list.getFocus()}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map(e=>this.model.get(e))}style(e){this.list.style(e)}dispose(){this.list.dispose()}}var MS=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o};const eXe=!1;var zP;(function(i){i.North="north",i.South="south",i.East="east",i.West="west"})(zP||(zP={}));let tXe=4;const nXe=new se;let iXe=300;const rXe=new se;class KX{constructor(e){this.el=e,this.disposables=new Te}get onPointerMove(){return this.disposables.add(new wn(Pt(this.el),"mousemove")).event}get onPointerUp(){return this.disposables.add(new wn(Pt(this.el),"mouseup")).event}dispose(){this.disposables.dispose()}}MS([Rr],KX.prototype,"onPointerMove",null);MS([Rr],KX.prototype,"onPointerUp",null);class GX{get onPointerMove(){return this.disposables.add(new wn(this.el,Si.Change)).event}get onPointerUp(){return this.disposables.add(new wn(this.el,Si.End)).event}constructor(e){this.el=e,this.disposables=new Te}dispose(){this.disposables.dispose()}}MS([Rr],GX.prototype,"onPointerMove",null);MS([Rr],GX.prototype,"onPointerUp",null);class UP{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}MS([Rr],UP.prototype,"onPointerMove",null);MS([Rr],UP.prototype,"onPointerUp",null);const ise="pointer-events-disabled";class Ls extends fe{get state(){return this._state}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}set state(e){this._state!==e&&(this.el.classList.toggle("disabled",e===0),this.el.classList.toggle("minimum",e===1),this.el.classList.toggle("maximum",e===2),this._state=e,this.onDidEnablementChange.fire(e))}set orthogonalStartSash(e){if(this._orthogonalStartSash!==e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=n=>{this.orthogonalStartDragHandleDisposables.clear(),n!==0&&(this._orthogonalStartDragHandle=ke(this.el,He(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(Rt(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new wn(this._orthogonalStartDragHandle,"mouseenter")).event(()=>Ls.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new wn(this._orthogonalStartDragHandle,"mouseleave")).event(()=>Ls.onMouseLeave(e),void 0,this.orthogonalStartDragHandleDisposables))};this.orthogonalStartSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalStartSash=e}}set orthogonalEndSash(e){if(this._orthogonalEndSash!==e){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),e){const t=n=>{this.orthogonalEndDragHandleDisposables.clear(),n!==0&&(this._orthogonalEndDragHandle=ke(this.el,He(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(Rt(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new wn(this._orthogonalEndDragHandle,"mouseenter")).event(()=>Ls.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new wn(this._orthogonalEndDragHandle,"mouseleave")).event(()=>Ls.onMouseLeave(e),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}}constructor(e,t,n){super(),this.hoverDelay=iXe,this.hoverDelayer=this._register(new nd(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new se),this._onDidStart=this._register(new se),this._onDidChange=this._register(new se),this._onDidReset=this._register(new se),this._onDidEnd=this._register(new se),this.orthogonalStartSashDisposables=this._register(new Te),this.orthogonalStartDragHandleDisposables=this._register(new Te),this.orthogonalEndSashDisposables=this._register(new Te),this.orthogonalEndDragHandleDisposables=this._register(new Te),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=ke(e,He(".monaco-sash")),n.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${n.orthogonalEdge}`),Ln&&this.el.classList.add("mac");const r=this._register(new wn(this.el,"mousedown")).event;this._register(r(d=>this.onPointerStart(d,new KX(e)),this));const o=this._register(new wn(this.el,"dblclick")).event;this._register(o(this.onPointerDoublePress,this));const s=this._register(new wn(this.el,"mouseenter")).event;this._register(s(()=>Ls.onMouseEnter(this)));const a=this._register(new wn(this.el,"mouseleave")).event;this._register(a(()=>Ls.onMouseLeave(this))),this._register(wi.addTarget(this.el));const l=this._register(new wn(this.el,Si.Start)).event;this._register(l(d=>this.onPointerStart(d,new GX(this.el)),this));const c=this._register(new wn(this.el,Si.Tap)).event;let u;this._register(c(d=>{if(u){clearTimeout(u),u=void 0,this.onPointerDoublePress(d);return}clearTimeout(u),u=setTimeout(()=>u=void 0,250)},this)),typeof n.size=="number"?(this.size=n.size,n.orientation===0?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=tXe,this._register(nXe.event(d=>{this.size=d,this.layout()}))),this._register(rXe.event(d=>this.hoverDelay=d)),this.layoutProvider=t,this.orthogonalStartSash=n.orthogonalStartSash,this.orthogonalEndSash=n.orthogonalEndSash,this.orientation=n.orientation||0,this.orientation===1?(this.el.classList.add("horizontal"),this.el.classList.remove("vertical")):(this.el.classList.remove("horizontal"),this.el.classList.add("vertical")),this.el.classList.toggle("debug",eXe),this.layout()}onPointerStart(e,t){hn.stop(e);let n=!1;if(!e.__orthogonalSashEvent){const g=this.getOrthogonalSash(e);g&&(n=!0,e.__orthogonalSashEvent=!0,g.onPointerStart(e,new UP(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new UP(t))),!this.state)return;const r=this.el.ownerDocument.getElementsByTagName("iframe");for(const g of r)g.classList.add(ise);const o=e.pageX,s=e.pageY,a=e.altKey,l={startX:o,currentX:o,startY:s,currentY:s,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(l);const c=gc(this.el),u=()=>{let g="";n?g="all-scroll":this.orientation===1?this.state===1?g="s-resize":this.state===2?g="n-resize":g=Ln?"row-resize":"ns-resize":this.state===1?g="e-resize":this.state===2?g="w-resize":g=Ln?"col-resize":"ew-resize",c.textContent=`* { cursor: ${g} !important; }`},d=new Te;u(),n||this.onDidEnablementChange.event(u,null,d);const h=g=>{hn.stop(g,!1);const p={startX:o,currentX:g.pageX,startY:s,currentY:g.pageY,altKey:a};this._onDidChange.fire(p)},f=g=>{hn.stop(g,!1),this.el.removeChild(c),this.el.classList.remove("active"),this._onDidEnd.fire(),d.dispose();for(const p of r)p.classList.remove(ise)};t.onPointerMove(h,null,d),t.onPointerUp(f,null,d),d.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&&Ls.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&Ls.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){Ls.onMouseLeave(this)}layout(){if(this.orientation===0){const e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{const e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}getOrthogonalSash(e){var t;const n=(t=e.initialTarget)!==null&&t!==void 0?t:e.target;if(!(!n||!(n instanceof HTMLElement))&&n.classList.contains("orthogonal-drag-handle"))return n.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}const oXe={separatorBorder:me.transparent};class Z_e{set size(e){this._size=e}get size(){return this._size}get visible(){return typeof this._cachedVisibleSize>"u"}setVisible(e,t){var n,r;if(e!==this.visible){e?(this.size=da(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof t=="number"?t:this.size,this.size=0),this.container.classList.toggle("visible",e);try{(r=(n=this.view).setVisible)===null||r===void 0||r.call(n,e)}catch(o){console.error("Splitview: Failed to set visible view"),console.error(o)}}}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get proportionalLayout(){var e;return(e=this.view.proportionalLayout)!==null&&e!==void 0?e:!0}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,t,n,r){this.container=e,this.view=t,this.disposable=r,this._cachedVisibleSize=void 0,typeof n=="number"?(this._size=n,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=n.cachedVisibleSize)}layout(e,t){this.layoutContainer(e);try{this.view.layout(this.size,e,t)}catch(n){console.error("Splitview: Failed to layout view"),console.error(n)}}dispose(){this.disposable.dispose()}}class sXe extends Z_e{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class aXe extends Z_e{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var kg;(function(i){i[i.Idle=0]="Idle",i[i.Busy=1]="Busy"})(kg||(kg={}));var jP;(function(i){i.Distribute={type:"distribute"};function e(r){return{type:"split",index:r}}i.Split=e;function t(r){return{type:"auto",index:r}}i.Auto=t;function n(r){return{type:"invisible",cachedVisibleSize:r}}i.Invisible=n})(jP||(jP={}));class Q_e extends fe{get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}get startSnappingEnabled(){return this._startSnappingEnabled}get endSnappingEnabled(){return this._endSnappingEnabled}set orthogonalStartSash(e){for(const t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}set orthogonalEndSash(e){for(const t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}constructor(e,t={}){var n,r,o,s,a;super(),this.size=0,this._contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=kg.Idle,this._onDidSashChange=this._register(new se),this._onDidSashReset=this._register(new se),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=(n=t.orientation)!==null&&n!==void 0?n:0,this.inverseAltBehavior=(r=t.inverseAltBehavior)!==null&&r!==void 0?r:!1,this.proportionalLayout=(o=t.proportionalLayout)!==null&&o!==void 0?o:!0,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(this.orientation===0?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=ke(this.el,He(".sash-container")),this.viewContainer=He(".split-view-container"),this.scrollable=this._register(new TS({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:c=>Il(Pt(this.el),c)})),this.scrollableElement=this._register(new O4(this.viewContainer,{vertical:this.orientation===0?(s=t.scrollbarVisibility)!==null&&s!==void 0?s:1:2,horizontal:this.orientation===1?(a=t.scrollbarVisibility)!==null&&a!==void 0?a:1:2},this.scrollable));const l=this._register(new wn(this.viewContainer,"scroll")).event;this._register(l(c=>{const u=this.scrollableElement.getScrollPosition(),d=Math.abs(this.viewContainer.scrollLeft-u.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,h=Math.abs(this.viewContainer.scrollTop-u.scrollTop)<=1?void 0:this.viewContainer.scrollTop;(d!==void 0||h!==void 0)&&this.scrollableElement.setScrollPosition({scrollLeft:d,scrollTop:h})})),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(c=>{c.scrollTopChanged&&(this.viewContainer.scrollTop=c.scrollTop),c.scrollLeftChanged&&(this.viewContainer.scrollLeft=c.scrollLeft)})),ke(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||oXe),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((c,u)=>{const d=Cl(c.visible)||c.visible?c.size:{type:"invisible",cachedVisibleSize:c.size},h=c.view;this.doAddView(h,d,u,!0)}),this._contentSize=this.viewItems.reduce((c,u)=>c+u.size,0),this.saveProportions())}style(e){e.separatorBorder.isTransparent()?(this.el.classList.remove("separator-border"),this.el.style.removeProperty("--separator-border")):(this.el.classList.add("separator-border"),this.el.style.setProperty("--separator-border",e.separatorBorder.toString()))}addView(e,t,n=this.viewItems.length,r){this.doAddView(e,t,n,r)}layout(e,t){const n=Math.max(this.size,this._contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let r=0;for(let o=0;o0&&(s.size=da(Math.round(a*e/r),s.minimumSize,s.maximumSize))}}else{const r=la(this.viewItems.length),o=r.filter(a=>this.viewItems[a].priority===1),s=r.filter(a=>this.viewItems[a].priority===2);this.resize(this.viewItems.length-1,e-n,void 0,o,s)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this._contentSize>0&&(this.proportions=this.viewItems.map(e=>e.proportionalLayout&&e.visible?e.size/this._contentSize:void 0))}onSashStart({sash:e,start:t,alt:n}){for(const a of this.viewItems)a.enabled=!1;const r=this.sashItems.findIndex(a=>a.sash===e),o=Zu(ye(this.el.ownerDocument.body,"keydown",a=>s(this.sashDragState.current,a.altKey)),ye(this.el.ownerDocument.body,"keyup",()=>s(this.sashDragState.current,!1))),s=(a,l)=>{const c=this.viewItems.map(g=>g.size);let u=Number.NEGATIVE_INFINITY,d=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(l=!l),l)if(r===this.sashItems.length-1){const p=this.viewItems[r];u=(p.minimumSize-p.size)/2,d=(p.maximumSize-p.size)/2}else{const p=this.viewItems[r+1];u=(p.size-p.maximumSize)/2,d=(p.size-p.minimumSize)/2}let h,f;if(!l){const g=la(r,-1),p=la(r+1,this.viewItems.length),v=g.reduce((k,T)=>k+(this.viewItems[T].minimumSize-c[T]),0),m=g.reduce((k,T)=>k+(this.viewItems[T].viewMaximumSize-c[T]),0),_=p.length===0?Number.POSITIVE_INFINITY:p.reduce((k,T)=>k+(c[T]-this.viewItems[T].minimumSize),0),y=p.length===0?Number.NEGATIVE_INFINITY:p.reduce((k,T)=>k+(c[T]-this.viewItems[T].viewMaximumSize),0),S=Math.max(v,y),L=Math.min(_,m),E=this.findFirstSnapIndex(g),D=this.findFirstSnapIndex(p);if(typeof E=="number"){const k=this.viewItems[E],T=Math.floor(k.viewMinimumSize/2);h={index:E,limitDelta:k.visible?S-T:S+T,size:k.size}}if(typeof D=="number"){const k=this.viewItems[D],T=Math.floor(k.viewMinimumSize/2);f={index:D,limitDelta:k.visible?L+T:L-T,size:k.size}}}this.sashDragState={start:a,current:a,index:r,sizes:c,minDelta:u,maxDelta:d,alt:l,snapBefore:h,snapAfter:f,disposable:o}};s(t,n)}onSashChange({current:e}){const{index:t,start:n,sizes:r,alt:o,minDelta:s,maxDelta:a,snapBefore:l,snapAfter:c}=this.sashDragState;this.sashDragState.current=e;const u=e-n,d=this.resize(t,u,r,void 0,void 0,s,a,l,c);if(o){const h=t===this.sashItems.length-1,f=this.viewItems.map(y=>y.size),g=h?t:t+1,p=this.viewItems[g],v=p.size-p.maximumSize,m=p.size-p.minimumSize,_=h?t-1:t+1;this.resize(_,-d,f,void 0,void 0,v,m)}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 n=this.viewItems.indexOf(e);n<0||n>=this.viewItems.length||(t=typeof t=="number"?t:e.size,t=da(t,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&n>0?(this.resize(n-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([n],void 0)))}resizeView(e,t){if(!(e<0||e>=this.viewItems.length)){if(this.state!==kg.Idle)throw new Error("Cant modify splitview");this.state=kg.Busy;try{const n=la(this.viewItems.length).filter(a=>a!==e),r=[...n.filter(a=>this.viewItems[a].priority===1),e],o=n.filter(a=>this.viewItems[a].priority===2),s=this.viewItems[e];t=Math.round(t),t=da(t,s.minimumSize,Math.min(s.maximumSize,this.size)),s.size=t,this.relayout(r,o)}finally{this.state=kg.Idle}}}distributeViewSizes(){const e=[];let t=0;for(const a of this.viewItems)a.maximumSize-a.minimumSize>0&&(e.push(a),t+=a.size);const n=Math.floor(t/e.length);for(const a of e)a.size=da(n,a.minimumSize,a.maximumSize);const r=la(this.viewItems.length),o=r.filter(a=>this.viewItems[a].priority===1),s=r.filter(a=>this.viewItems[a].priority===2);this.relayout(o,s)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,n=this.viewItems.length,r){if(this.state!==kg.Idle)throw new Error("Cant modify splitview");this.state=kg.Busy;try{const o=He(".split-view-view");n===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(n));const s=e.onDidChange(h=>this.onViewChange(u,h)),a=Rt(()=>this.viewContainer.removeChild(o)),l=Zu(s,a);let c;typeof t=="number"?c=t:(t.type==="auto"&&(this.areViewsDistributed()?t={type:"distribute"}:t={type:"split",index:t.index}),t.type==="split"?c=this.getViewSize(t.index)/2:t.type==="invisible"?c={cachedVisibleSize:t.cachedVisibleSize}:c=e.minimumSize);const u=this.orientation===0?new sXe(o,e,c,l):new aXe(o,e,c,l);if(this.viewItems.splice(n,0,u),this.viewItems.length>1){const h={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},f=this.orientation===0?new Ls(this.sashContainer,{getHorizontalSashTop:k=>this.getSashPosition(k),getHorizontalSashWidth:this.getSashOrthogonalSize},{...h,orientation:1}):new Ls(this.sashContainer,{getVerticalSashLeft:k=>this.getSashPosition(k),getVerticalSashHeight:this.getSashOrthogonalSize},{...h,orientation:0}),g=this.orientation===0?k=>({sash:f,start:k.startY,current:k.currentY,alt:k.altKey}):k=>({sash:f,start:k.startX,current:k.currentX,alt:k.altKey}),v=Je.map(f.onDidStart,g)(this.onSashStart,this),_=Je.map(f.onDidChange,g)(this.onSashChange,this),S=Je.map(f.onDidEnd,()=>this.sashItems.findIndex(k=>k.sash===f))(this.onSashEnd,this),L=f.onDidReset(()=>{const k=this.sashItems.findIndex(R=>R.sash===f),T=la(k,-1),M=la(k+1,this.viewItems.length),A=this.findFirstSnapIndex(T),N=this.findFirstSnapIndex(M);typeof A=="number"&&!this.viewItems[A].visible||typeof N=="number"&&!this.viewItems[N].visible||this._onDidSashReset.fire(k)}),E=Zu(v,_,S,L,f),D={sash:f,disposable:E};this.sashItems.splice(n-1,0,D)}o.appendChild(e.element);let d;typeof t!="number"&&t.type==="split"&&(d=[t.index]),r||this.relayout([n],d),!r&&typeof t!="number"&&t.type==="distribute"&&this.distributeViewSizes()}finally{this.state=kg.Idle}}relayout(e,t){const n=this.viewItems.reduce((r,o)=>r+o.size,0);this.resize(this.viewItems.length-1,this.size-n,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,n=this.viewItems.map(u=>u.size),r,o,s=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,l,c){if(e<0||e>=this.viewItems.length)return 0;const u=la(e,-1),d=la(e+1,this.viewItems.length);if(o)for(const D of o)q8(u,D),q8(d,D);if(r)for(const D of r)YN(u,D),YN(d,D);const h=u.map(D=>this.viewItems[D]),f=u.map(D=>n[D]),g=d.map(D=>this.viewItems[D]),p=d.map(D=>n[D]),v=u.reduce((D,k)=>D+(this.viewItems[k].minimumSize-n[k]),0),m=u.reduce((D,k)=>D+(this.viewItems[k].maximumSize-n[k]),0),_=d.length===0?Number.POSITIVE_INFINITY:d.reduce((D,k)=>D+(n[k]-this.viewItems[k].minimumSize),0),y=d.length===0?Number.NEGATIVE_INFINITY:d.reduce((D,k)=>D+(n[k]-this.viewItems[k].maximumSize),0),S=Math.max(v,y,s),L=Math.min(_,m,a);let E=!1;if(l){const D=this.viewItems[l.index],k=t>=l.limitDelta;E=k!==D.visible,D.setVisible(k,l.size)}if(!E&&c){const D=this.viewItems[c.index],k=ta+l.size,0);let n=this.size-t;const r=la(this.viewItems.length-1,-1),o=r.filter(a=>this.viewItems[a].priority===1),s=r.filter(a=>this.viewItems[a].priority===2);for(const a of s)q8(r,a);for(const a of o)YN(r,a);typeof e=="number"&&YN(r,e);for(let a=0;n!==0&&at+n.size,0);let e=0;for(const t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach(t=>t.sash.layout()),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){this.orientation===0?this.scrollableElement.setScrollDimensions({height:this.size,scrollHeight:this._contentSize}):this.scrollableElement.setScrollDimensions({width:this.size,scrollWidth:this._contentSize})}updateSashEnablement(){let e=!1;const t=this.viewItems.map(l=>e=l.size-l.minimumSize>0||e);e=!1;const n=this.viewItems.map(l=>e=l.maximumSize-l.size>0||e),r=[...this.viewItems].reverse();e=!1;const o=r.map(l=>e=l.size-l.minimumSize>0||e).reverse();e=!1;const s=r.map(l=>e=l.maximumSize-l.size>0||e).reverse();let a=0;for(let l=0;l0||this.startSnappingEnabled)?c.state=1:_&&t[l]&&(a0)return;if(!n.visible&&n.snap)return t}}areViewsDistributed(){let e,t;for(const n of this.viewItems)if(e=e===void 0?n.size:Math.min(e,n.size),t=t===void 0?n.size:Math.max(t,n.size),t-e>2)return!1;return!0}dispose(){var e;(e=this.sashDragState)===null||e===void 0||e.disposable.dispose(),si(this.viewItems),this.viewItems=[],this.sashItems.forEach(t=>t.disposable.dispose()),this.sashItems=[],super.dispose()}}class Qk{constructor(e,t,n){this.columns=e,this.getColumnSize=n,this.templateId=Qk.TemplateId,this.renderedTemplates=new Set;const r=new Map(t.map(o=>[o.templateId,o]));this.renderers=[];for(const o of e){const s=r.get(o.templateId);if(!s)throw new Error(`Table cell renderer for template id ${o.templateId} not found.`);this.renderers.push(s)}}renderTemplate(e){const t=ke(e,He(".monaco-table-tr")),n=[],r=[];for(let s=0;sthis.disposables.add(new cXe(u,d))),l={size:a.reduce((u,d)=>u+d.column.weight,0),views:a.map(u=>({size:u.column.weight,view:u}))};this.splitview=this.disposables.add(new Q_e(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:l})),this.splitview.el.style.height=`${n.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${n.headerRowHeight}px`;const c=new Qk(r,o,u=>this.splitview.getViewSize(u));this.list=this.disposables.add(new wc(e,this.domNode,lXe(n),[c],s)),Je.any(...a.map(u=>u.onDidLayout))(([u,d])=>c.layoutColumn(u,d),null,this.disposables),this.splitview.onDidSashReset(u=>{const d=r.reduce((f,g)=>f+g.weight,0),h=r[u].weight/d*this.cachedWidth;this.splitview.resizeView(u,h)},null,this.disposables),this.styleElement=gc(this.domNode),this.style(gqe)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,n=[]){this.list.splice(e,t,n)}getHTMLElement(){return this.domNode}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before { top: ${this.virtualDelegate.headerRowHeight+1}px; height: calc(100% - ${this.virtualDelegate.headerRowHeight}px); }`),this.styleElement.textContent=t.join(` -`),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}};J_e.InstanceCount=0;class AS extends yc{constructor(e){super(),this._onChange=this._register(new se),this.onChange=this._onChange.event,this._onKeyDown=this._register(new se),this.onKeyDown=this._onKeyDown.event,this._opts=e,this._checked=this._opts.isChecked;const t=["monaco-custom-toggle"];this._opts.icon&&(this._icon=this._opts.icon,t.push(...Wt.asClassNameArray(this._icon))),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this._hover=this._register(mC(Vp("mouse"),this.domNode,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,n=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),n.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,n=>{if(n.keyCode===10||n.keyCode===3){this.checked=!this._checked,this._onChange.fire(!0),n.preventDefault(),n.stopPropagation();return}this._onKeyDown.fire(n)})}get enabled(){return this.domNode.getAttribute("aria-disabled")!=="true"}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}width(){return 2+2+2+16}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder||"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground||"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground||"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1))}disable(){this.domNode.setAttribute("aria-disabled",String(!0))}}const uXe=w("caseDescription","Match Case"),dXe=w("wordsDescription","Match Whole Word"),hXe=w("regexDescription","Use Regular Expression");class t0e extends AS{constructor(e){super({icon:Xe.caseSensitive,title:uXe+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class n0e extends AS{constructor(e){super({icon:Xe.wholeWord,title:dXe+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class i0e extends AS{constructor(e){super({icon:Xe.regex,title:hXe+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class fXe{constructor(e,t=0,n=e.length,r=t-1){this.items=e,this.start=t,this.end=n,this.index=r}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 gXe{constructor(e=[],t=10){this._initialize(e),this._limit=t,this._onChange()}getHistory(){return this._elements}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._navigator.next()}previous(){return this._currentPosition()!==0?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}isLast(){return this._currentPosition()>=this._elements.length-1}isNowhere(){return this._navigator.current()===null}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new fXe(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 Ux=He;let pXe=class extends yc{constructor(e,t,n){var r;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new se),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new se),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=n,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=(r=this.options.tooltip)!==null&&r!==void 0?r:this.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=ke(e,Ux(".monaco-inputbox.idle"));const o=this.options.flexibleHeight?"textarea":"input",s=ke(this.element,Ux(".ibwrapper"));if(this.input=ke(s,Ux(o+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,()=>this.element.classList.add("synthetic-focus")),this.onblur(this.input,()=>this.element.classList.remove("synthetic-focus")),this.options.flexibleHeight){this.maxHeight=typeof this.options.flexibleMaxHeight=="number"?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=ke(s,Ux("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new pve(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),ke(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(c=>this.input.scrollTop=c.scrollTop));const a=this._register(new wn(e.ownerDocument,"selectionchange")),l=Je.filter(a.event,()=>{const c=e.ownerDocument.getSelection();return(c==null?void 0:c.anchorNode)===s});this._register(l(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,()=>this.onValueChange()),this.onblur(this.input,()=>this.onBlur()),this.onfocus(this.input,()=>this.onFocus()),this._register(this.ignoreGesture(this.input)),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actionbar=this._register(new au(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}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get height(){return typeof this.cachedHeight=="number"?this.cachedHeight:qg(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return Mk(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()}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if(typeof this.cachedContentHeight!="number"||typeof this.cachedHeight!="number"||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,n=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:n})}showMessage(e,t){if(this.state==="open"&&dc(this.message,e))return;this.message=e,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(e.type));const n=this.stylesForType(this.message.type);this.element.style.border=`1px solid ${gp(n.border,"transparent")}`,this.message.content&&(this.hasFocus()||t)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}validate(){let e=null;return this.validation&&(e=this.validation(this.value),e?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),e==null?void 0:e.type}stylesForType(e){const t=this.options.inputBoxStyles;switch(e){case 1:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case 2:return{border:t.inputValidationWarningBorder,background:t.inputValidationWarningBackground,foreground:t.inputValidationWarningForeground};default:return{border:t.inputValidationErrorBorder,background:t.inputValidationErrorBackground,foreground:t.inputValidationErrorForeground}}}classForType(e){switch(e){case 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e;const t=()=>e.style.width=ua(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:r=>{var o,s;if(!this.message)return null;e=ke(r,Ux(".monaco-inputbox-container")),t();const a={inline:!0,className:"monaco-inputbox-message"},l=this.message.formatContent?tKe(this.message.content,a):eKe(this.message.content,a);l.classList.add(this.classForType(this.message.type));const c=this.stylesForType(this.message.type);return l.style.backgroundColor=(o=c.background)!==null&&o!==void 0?o:"",l.style.color=(s=c.foreground)!==null&&s!==void 0?s:"",l.style.border=c.border?`1px solid ${c.border}`:"",ke(e,l),null},onHide:()=>{this.state="closed"},layout:t});let n;this.message.type===3?n=w("alertErrorMessage","Error: {0}",this.message.content):this.message.type===2?n=w("alertWarningMessage","Warning: {0}",this.message.content):n=w("alertInfoMessage","Info: {0}",this.message.content),kl(n),this.state="open"}_hideMessage(){this.contextViewProvider&&(this.state==="open"&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),this.state==="open"&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,n=e.charCodeAt(e.length-1)===10?" ":"";(e+n).replace(/\u000c/g,"")?this.mirror.textContent=e+n:this.mirror.innerText=" ",this.layout()}applyStyles(){var e,t,n;const r=this.options.inputBoxStyles,o=(e=r.inputBackground)!==null&&e!==void 0?e:"",s=(t=r.inputForeground)!==null&&t!==void 0?t:"",a=(n=r.inputBorder)!==null&&n!==void 0?n:"";this.element.style.backgroundColor=o,this.element.style.color=s,this.input.style.backgroundColor="inherit",this.input.style.color=s,this.element.style.border=`1px solid ${gp(a,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=qg(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,n=t.selectionStart,r=t.selectionEnd,o=t.value;n!==null&&r!==null&&(this.value=o.substr(0,n)+e+o.substr(r),t.setSelectionRange(n+1,n+1),this.layout())}dispose(){var e;this._hideMessage(),this.message=null,(e=this.actionbar)===null||e===void 0||e.dispose(),super.dispose()}};class r0e extends pXe{constructor(e,t,n){const r=w({key:"history.inputbox.hint.suffix.noparens",comment:['Text is the suffix of an input field placeholder coming after the action the input field performs, this will be used when the input field ends in a closing parenthesis ")", for example "Filter (e.g. text, !exclude)". The character inserted into the final string is ⇅ to represent the up and down arrow keys.']}," or {0} for history","⇅"),o=w({key:"history.inputbox.hint.suffix.inparens",comment:['Text is the suffix of an input field placeholder coming after the action the input field performs, this will be used when the input field does NOT end in a closing parenthesis (eg. "Find"). The character inserted into the final string is ⇅ to represent the up and down arrow keys.']}," ({0} for history)","⇅");super(e,t,n),this._onDidFocus=this._register(new se),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new se),this.onDidBlur=this._onDidBlur.event,this.history=new gXe(n.history,100);const s=()=>{if(n.showHistoryHint&&n.showHistoryHint()&&!this.placeholder.endsWith(r)&&!this.placeholder.endsWith(o)&&this.history.getHistory().length){const a=this.placeholder.endsWith(")")?r:o,l=this.placeholder+a;n.showPlaceholderOnFocus&&!Mk(this.input)?this.placeholder=l:this.setPlaceHolder(l)}};this.observer=new MutationObserver((a,l)=>{a.forEach(c=>{c.target.textContent||s()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>s()),this.onblur(this.input,()=>{const a=l=>{if(this.placeholder.endsWith(l)){const c=this.placeholder.slice(0,this.placeholder.length-l.length);return n.showPlaceholderOnFocus?this.placeholder=c:this.setPlaceHolder(c),!0}else return!1};a(o)||a(r)})}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(e){this.value&&(e||this.value!==this.getCurrentValue())&&this.history.add(this.value)}isAtLastInHistory(){return this.history.isLast()}isNowhereInHistory(){return this.history.isNowhere()}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),this.value=e??"",Hf(this.value?this.value:w("clearedInput","Cleared Input"))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,Hf(this.value))}setPlaceHolder(e){super.setPlaceHolder(e),this.setTooltip(e)}onBlur(){super.onBlur(),this._onDidBlur.fire()}onFocus(){super.onFocus(),this._onDidFocus.fire()}getCurrentValue(){let e=this.history.current();return e||(e=this.history.last(),this.history.next()),e}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()}}const mXe=w("defaultLabel","input");class o0e extends yc{constructor(e,t,n){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new Ho),this.additionalToggles=[],this._onDidOptionChange=this._register(new se),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new se),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new se),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new se),this._onKeyUp=this._register(new se),this._onCaseSensitiveKeyDown=this._register(new se),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new se),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=n.placeholder||"",this.validation=n.validation,this.label=n.label||mXe,this.showCommonFindToggles=!!n.showCommonFindToggles;const r=n.appendCaseSensitiveLabel||"",o=n.appendWholeWordsLabel||"",s=n.appendRegexLabel||"",a=n.history||[],l=!!n.flexibleHeight,c=!!n.flexibleWidth,u=n.flexibleMaxHeight;if(this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new r0e(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},history:a,showHistoryHint:n.showHistoryHint,flexibleHeight:l,flexibleWidth:c,flexibleMaxHeight:u,inputBoxStyles:n.inputBoxStyles})),this.showCommonFindToggles){this.regex=this._register(new i0e({appendTitle:s,isChecked:!1,...n.toggleStyles})),this._register(this.regex.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(h=>{this._onRegexKeyDown.fire(h)})),this.wholeWords=this._register(new n0e({appendTitle:o,isChecked:!1,...n.toggleStyles})),this._register(this.wholeWords.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new t0e({appendTitle:r,isChecked:!1,...n.toggleStyles})),this._register(this.caseSensitive.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(h=>{this._onCaseSensitiveKeyDown.fire(h)}));const d=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,h=>{if(h.equals(15)||h.equals(17)||h.equals(9)){const f=d.indexOf(this.domNode.ownerDocument.activeElement);if(f>=0){let g=-1;h.equals(17)?g=(f+1)%d.length:h.equals(15)&&(f===0?g=d.length-1:g=f-1),h.equals(9)?(d[f].blur(),this.inputBox.focus()):g>=0&&d[g].focus(),hn.stop(h,!0)}}})}this.controls=document.createElement("div"),this.controls.className="controls",this.controls.style.display=this.showCommonFindToggles?"":"none",this.caseSensitive&&this.controls.append(this.caseSensitive.domNode),this.wholeWords&&this.controls.appendChild(this.wholeWords.domNode),this.regex&&this.controls.appendChild(this.regex.domNode),this.setAdditionalToggles(n==null?void 0:n.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),e==null||e.appendChild(this.domNode),this._register(ye(this.inputBox.inputElement,"compositionstart",d=>{this.imeSessionInProgress=!0})),this._register(ye(this.inputBox.inputElement,"compositionend",d=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,d=>this._onKeyDown.fire(d)),this.onkeyup(this.inputBox.inputElement,d=>this._onKeyUp.fire(d)),this.oninput(this.inputBox.inputElement,d=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,d=>this._onMouseDown.fire(d))}get onDidChange(){return this.inputBox.onDidChange}layout(e){this.inputBox.layout(),this.updateInputBoxPadding(e.collapsedFindWidget)}enable(){var e,t,n;this.domNode.classList.remove("disabled"),this.inputBox.enable(),(e=this.regex)===null||e===void 0||e.enable(),(t=this.wholeWords)===null||t===void 0||t.enable(),(n=this.caseSensitive)===null||n===void 0||n.enable();for(const r of this.additionalToggles)r.enable()}disable(){var e,t,n;this.domNode.classList.add("disabled"),this.inputBox.disable(),(e=this.regex)===null||e===void 0||e.disable(),(t=this.wholeWords)===null||t===void 0||t.disable(),(n=this.caseSensitive)===null||n===void 0||n.disable();for(const r of this.additionalToggles)r.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}setAdditionalToggles(e){for(const t of this.additionalToggles)t.domNode.remove();this.additionalToggles=[],this.additionalTogglesDisposables.value=new Te;for(const t of e??[])this.additionalTogglesDisposables.value.add(t),this.controls.appendChild(t.domNode),this.additionalTogglesDisposables.value.add(t.onChange(n=>{this._onDidOptionChange.fire(n),!n&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()})),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){var t,n,r,o,s,a;e?this.inputBox.paddingRight=0:this.inputBox.paddingRight=((n=(t=this.caseSensitive)===null||t===void 0?void 0:t.width())!==null&&n!==void 0?n:0)+((o=(r=this.wholeWords)===null||r===void 0?void 0:r.width())!==null&&o!==void 0?o:0)+((a=(s=this.regex)===null||s===void 0?void 0:s.width())!==null&&a!==void 0?a:0)+this.additionalToggles.reduce((l,c)=>l+c.width(),0)}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){var e,t;return(t=(e=this.caseSensitive)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){var e,t;return(t=(e=this.wholeWords)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){var e,t;return(t=(e=this.regex)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){var e;(e=this.caseSensitive)===null||e===void 0||e.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}showMessage(e){this.inputBox.showMessage(e)}clearMessage(){this.inputBox.hideMessage()}}var Yl;(function(i){i[i.Expanded=0]="Expanded",i[i.Collapsed=1]="Collapsed",i[i.PreserveOrExpanded=2]="PreserveOrExpanded",i[i.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(Yl||(Yl={}));var j0;(function(i){i[i.Unknown=0]="Unknown",i[i.Twistie=1]="Twistie",i[i.Element=2]="Element",i[i.Filter=3]="Filter"})(j0||(j0={}));class rc extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class qX{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 XX(i){return typeof i=="object"&&"visibility"in i&&"data"in i}function uI(i){switch(i){case!0:return 1;case!1:return 0;default:return i}}function u9(i){return typeof i.collapsible=="boolean"}class vXe{constructor(e,t,n,r={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new uq,this._onDidChangeCollapseState=new se,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new se,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new se,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new nd(Vpe),this.collapseByDefault=typeof r.collapseByDefault>"u"?!1:r.collapseByDefault,this.filter=r.filter,this.autoExpandSingleChildren=typeof r.autoExpandSingleChildren>"u"?!1:r.autoExpandSingleChildren,this.root={parent:void 0,element:n,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,n=En.empty(),r={}){if(e.length===0)throw new rc(this.user,"Invalid tree location");r.diffIdentityProvider?this.spliceSmart(r.diffIdentityProvider,e,t,n,r):this.spliceSimple(e,t,n,r)}spliceSmart(e,t,n,r,o,s){var a;r===void 0&&(r=En.empty()),s===void 0&&(s=(a=o.diffDepth)!==null&&a!==void 0?a:0);const{parentNode:l}=this.getParentNodeWithListIndex(t);if(!l.lastDiffIds)return this.spliceSimple(t,n,r,o);const c=[...r],u=t[t.length-1],d=new df({getElements:()=>l.lastDiffIds},{getElements:()=>[...l.children.slice(0,u),...c,...l.children.slice(u+n)].map(v=>e.getId(v.element).toString())}).ComputeDiff(!1);if(d.quitEarly)return l.lastDiffIds=void 0,this.spliceSimple(t,n,c,o);const h=t.slice(0,-1),f=(v,m,_)=>{if(s>0)for(let y=0;y<_;y++)v--,m--,this.spliceSmart(e,[...h,v,0],Number.MAX_SAFE_INTEGER,c[m].children,o,s-1)};let g=Math.min(l.children.length,u+n),p=c.length;for(const v of d.changes.sort((m,_)=>_.originalStart-m.originalStart))f(g,p,g-(v.originalStart+v.originalLength)),g=v.originalStart,p=v.modifiedStart-u,this.spliceSimple([...h,g],v.originalLength,En.slice(c,p,p+v.modifiedLength),o);f(g,p,g)}spliceSimple(e,t,n=En.empty(),{onDidCreateNode:r,onDidDeleteNode:o,diffIdentityProvider:s}){const{parentNode:a,listIndex:l,revealed:c,visible:u}=this.getParentNodeWithListIndex(e),d=[],h=En.map(n,L=>this.createTreeNode(L,a,a.visible?1:0,c,d,r)),f=e[e.length-1];let g=0;for(let L=f;L>=0&&Ls.getId(L.element).toString())):a.lastDiffIds=a.children.map(L=>s.getId(L.element).toString()):a.lastDiffIds=void 0;let y=0;for(const L of _)L.visible&&y++;if(y!==0)for(let L=f+p.length;LE+(D.visible?D.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,m-L),this.list.splice(l,L,d)}if(_.length>0&&o){const L=E=>{o(E),E.children.forEach(L)};_.forEach(L)}this._onDidSplice.fire({insertedNodes:p,deletedNodes:_});let S=a;for(;S;){if(S.visibility===2){this.refilterDelayer.trigger(()=>this.refilter());break}S=S.parent}}rerender(e){if(e.length===0)throw new rc(this.user,"Invalid tree location");const{node:t,listIndex:n,revealed:r}=this.getTreeNodeWithListIndex(e);t.visible&&r&&this.list.splice(n,1,[t])}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:n,revealed:r}=this.getTreeNodeWithListIndex(e);return n&&r?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const n=this.getTreeNode(e);typeof t>"u"&&(t=!n.collapsible);const r={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,r))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,n){const r=this.getTreeNode(e);typeof t>"u"&&(t=!r.collapsed);const o={collapsed:t,recursive:n||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,o))}_setCollapseState(e,t){const{node:n,listIndex:r,revealed:o}=this.getTreeNodeWithListIndex(e),s=this._setListNodeCollapseState(n,r,o,t);if(n!==this.root&&this.autoExpandSingleChildren&&s&&!u9(t)&&n.collapsible&&!n.collapsed&&!t.recursive){let a=-1;for(let l=0;l-1){a=-1;break}else a=l;a>-1&&this._setCollapseState([...e,a],t)}return s}_setListNodeCollapseState(e,t,n,r){const o=this._setNodeCollapseState(e,r,!1);if(!n||!e.visible||!o)return o;const s=e.renderNodeCount,a=this.updateNodeAfterCollapseChange(e),l=s-(t===-1?0:1);return this.list.splice(t+1,l,a.slice(1)),o}_setNodeCollapseState(e,t,n){let r;if(e===this.root?r=!1:(u9(t)?(r=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(r=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):r=!1,r&&this._onDidChangeCollapseState.fire({node:e,deep:n})),!u9(t)&&t.recursive)for(const o of e.children)r=this._setNodeCollapseState(o,t,!0)||r;return r}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,n,r,o,s){const a={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:typeof e.collapsible=="boolean"?e.collapsible:typeof e.collapsed<"u",collapsed:typeof e.collapsed>"u"?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},l=this._filterNode(a,n);a.visibility=l,r&&o.push(a);const c=e.children||En.empty(),u=r&&l!==0&&!a.collapsed;let d=0,h=1;for(const f of c){const g=this.createTreeNode(f,a,l,u,o,s);a.children.push(g),h+=g.renderNodeCount,g.visible&&(g.visibleChildIndex=d++)}return a.collapsible=a.collapsible||a.children.length>0,a.visibleChildrenCount=d,a.visible=l===2?d>0:l===1,a.visible?a.collapsed||(a.renderNodeCount=h):(a.renderNodeCount=0,r&&o.pop()),s==null||s(a),a}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,n=[];return this._updateNodeAfterCollapseChange(e,n),this._updateAncestorsRenderNodeCount(e.parent,n.length-t),n}_updateNodeAfterCollapseChange(e,t){if(e.visible===!1)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const n of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(n,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,n=[];return this._updateNodeAfterFilterChange(e,e.visible?1:0,n),this._updateAncestorsRenderNodeCount(e.parent,n.length-t),n}_updateNodeAfterFilterChange(e,t,n,r=!0){let o;if(e!==this.root){if(o=this._filterNode(e,t),o===0)return e.visible=!1,e.renderNodeCount=0,!1;r&&n.push(e)}const s=n.length;e.renderNodeCount=e===this.root?0:1;let a=!1;if(!e.collapsed||o!==0){let l=0;for(const c of e.children)a=this._updateNodeAfterFilterChange(c,o,n,r&&!e.collapsed)||a,c.visible&&(c.visibleChildIndex=l++);e.visibleChildrenCount=l}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=o===2?a:o===1,e.visibility=o),e.visible?e.collapsed||(e.renderNodeCount+=n.length-s):(e.renderNodeCount=0,r&&n.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(t!==0)for(;e;)e.renderNodeCount+=t,this._onDidChangeRenderNodeCount.fire(e),e=e.parent}_filterNode(e,t){const n=this.filter?this.filter.filter(e.element,t):1;return typeof n=="boolean"?(e.filterData=void 0,n?1:0):XX(n)?(e.filterData=n.data,uI(n.visibility)):(e.filterData=void 0,uI(n))}hasTreeNode(e,t=this.root){if(!e||e.length===0)return!0;const[n,...r]=e;return n<0||n>t.children.length?!1:this.hasTreeNode(r,t.children[n])}getTreeNode(e,t=this.root){if(!e||e.length===0)return t;const[n,...r]=e;if(n<0||n>t.children.length)throw new rc(this.user,"Invalid tree location");return this.getTreeNode(r,t.children[n])}getTreeNodeWithListIndex(e){if(e.length===0)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:n,revealed:r,visible:o}=this.getParentNodeWithListIndex(e),s=e[e.length-1];if(s<0||s>t.children.length)throw new rc(this.user,"Invalid tree location");const a=t.children[s];return{node:a,listIndex:n,revealed:r,visible:o&&a.visible}}getParentNodeWithListIndex(e,t=this.root,n=0,r=!0,o=!0){const[s,...a]=e;if(s<0||s>t.children.length)throw new rc(this.user,"Invalid tree location");for(let l=0;lt.element)),this.data=e}}function d9(i){return i instanceof Yk?new _Xe(i):i}class bXe{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=fe.None,this.disposables=new Te}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(n=>n.element),t)}onDragStart(e,t){var n,r;(r=(n=this.dnd).onDragStart)===null||r===void 0||r.call(n,d9(e),t)}onDragOver(e,t,n,r,o,s=!0){const a=this.dnd.onDragOver(d9(e),t&&t.element,n,r,o),l=this.autoExpandNode!==t;if(l&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),typeof t>"u")return a;if(l&&typeof a!="boolean"&&a.autoExpand&&(this.autoExpandDisposable=Kv(()=>{const f=this.modelProvider(),g=f.getNodeLocation(t);f.isCollapsed(g)&&f.setCollapsed(g,!1),this.autoExpandNode=void 0},500,this.disposables)),typeof a=="boolean"||!a.accept||typeof a.bubble>"u"||a.feedback){if(!s){const f=typeof a=="boolean"?a:a.accept,g=typeof a=="boolean"?void 0:a.effect;return{accept:f,effect:g,feedback:[n]}}return a}if(a.bubble===1){const f=this.modelProvider(),g=f.getNodeLocation(t),p=f.getParentNodeLocation(g),v=f.getNode(p),m=p&&f.getListIndex(p);return this.onDragOver(e,v,m,r,o,!1)}const c=this.modelProvider(),u=c.getNodeLocation(t),d=c.getListIndex(u),h=c.getListRenderCount(u);return{...a,feedback:la(d,d+h)}}drop(e,t,n,r,o){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(d9(e),t&&t.element,n,r,o)}onDragEnd(e){var t,n;(n=(t=this.dnd).onDragEnd)===null||n===void 0||n.call(t,e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function CXe(i,e){return e&&{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new bXe(i,e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent(t){return e.multipleSelectionController.isSelectionSingleChangeEvent({...t,element:t.element})},isSelectionRangeChangeEvent(t){return e.multipleSelectionController.isSelectionRangeChangeEvent({...t,element:t.element})}},accessibilityProvider:e.accessibilityProvider&&{...e.accessibilityProvider,getSetSize(t){const n=i(),r=n.getNodeLocation(t),o=n.getParentNodeLocation(r);return n.getNode(o).visibleChildrenCount},getPosInSet(t){return t.visibleChildIndex+1},isChecked:e.accessibilityProvider&&e.accessibilityProvider.isChecked?t=>e.accessibilityProvider.isChecked(t.element):void 0,getRole:e.accessibilityProvider&&e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",getAriaLabel(t){return e.accessibilityProvider.getAriaLabel(t.element)},getWidgetAriaLabel(){return e.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:e.accessibilityProvider&&e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider&&e.accessibilityProvider.getAriaLevel?t=>e.accessibilityProvider.getAriaLevel(t.element):t=>t.depth,getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))},keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(t){return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}}}}class YX{constructor(e){this.delegate=e}getHeight(e){return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,t){var n,r;(r=(n=this.delegate).setDynamicHeight)===null||r===void 0||r.call(n,e.element,t)}}var dI;(function(i){i.None="none",i.OnHover="onHover",i.Always="always"})(dI||(dI={}));class yXe{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new Te,this.onDidChange=Je.forEach(e,n=>this._elements=n,this.disposables)}dispose(){this.disposables.dispose()}}class hI{constructor(e,t,n,r,o,s={}){var a;this.renderer=e,this.modelProvider=t,this.activeNodes=r,this.renderedIndentGuides=o,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=hI.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=fe.None,this.disposables=new Te,this.templateId=e.templateId,this.updateOptions(s),Je.map(n,l=>l.node)(this.onDidChangeNodeTwistieState,this,this.disposables),(a=e.onDidChangeTwistieState)===null||a===void 0||a.call(e,this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(typeof e.indent<"u"){const t=da(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[n,r]of this.renderedNodes)this.renderTreeElement(n,r)}}if(typeof e.renderIndentGuides<"u"){const t=e.renderIndentGuides!==dI.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(const[n,r]of this.renderedNodes)this._renderIndentGuides(n,r);if(this.indentGuidesDisposable.dispose(),t){const n=new Te;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,n),this.indentGuidesDisposable=n,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}typeof e.hideTwistiesOfChildlessElements<"u"&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=ke(e,He(".monaco-tl-row")),n=ke(t,He(".monaco-tl-indent")),r=ke(t,He(".monaco-tl-twistie")),o=ke(t,He(".monaco-tl-contents")),s=this.renderer.renderTemplate(o);return{container:e,indent:n,twistie:r,indentGuidesDisposable:fe.None,templateData:s}}renderElement(e,t,n,r){this.renderedNodes.set(e,n),this.renderedElements.set(e.element,e),this.renderTreeElement(e,n),this.renderer.renderElement(e,t,n.templateData,r)}disposeElement(e,t,n,r){var o,s;n.indentGuidesDisposable.dispose(),(s=(o=this.renderer).disposeElement)===null||s===void 0||s.call(o,e,t,n.templateData,r),typeof r=="number"&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){const t=this.renderedElements.get(e);t&&this.onDidChangeNodeTwistieState(t)}onDidChangeNodeTwistieState(e){const t=this.renderedNodes.get(e);t&&(this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderTreeElement(e,t))}renderTreeElement(e,t){const n=hI.DefaultIndent+(e.depth-1)*this.indent;t.twistie.style.paddingLeft=`${n}px`,t.indent.style.width=`${n+this.indent-16}px`,e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...Wt.asClassNameArray(Xe.treeItemExpanded));let r=!1;this.renderer.renderTwistie&&(r=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(r||t.twistie.classList.add(...Wt.asClassNameArray(Xe.treeItemExpanded)),t.twistie.classList.add("collapsible"),t.twistie.classList.toggle("collapsed",e.collapsed)):t.twistie.classList.remove("collapsible","collapsed"),this._renderIndentGuides(e,t)}_renderIndentGuides(e,t){if(Ns(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const n=new Te,r=this.modelProvider();for(;;){const o=r.getNodeLocation(e),s=r.getParentNodeLocation(o);if(!s)break;const a=r.getNode(s),l=He(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(a)&&l.classList.add("active"),t.indent.childElementCount===0?t.indent.appendChild(l):t.indent.insertBefore(l,t.indent.firstElementChild),this.renderedIndentGuides.add(a,l),n.add(Rt(()=>this.renderedIndentGuides.delete(a,l))),e=a}t.indentGuidesDisposable=n}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,n=this.modelProvider();e.forEach(r=>{const o=n.getNodeLocation(r);try{const s=n.getParentNodeLocation(o);r.collapsible&&r.children.length>0&&!r.collapsed?t.add(r):s&&t.add(n.getNode(s))}catch{}}),this.activeIndentNodes.forEach(r=>{t.has(r)||this.renderedIndentGuides.forEach(r,o=>o.classList.remove("active"))}),t.forEach(r=>{this.activeIndentNodes.has(r)||this.renderedIndentGuides.forEach(r,o=>o.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),si(this.disposables)}}hI.DefaultIndent=8;class wXe{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}constructor(e,t,n){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=n,this._totalCount=0,this._matchCount=0,this._pattern="",this._lowercasePattern="",this.disposables=new Te,e.onWillRefilter(this.reset,this,this.disposables)}filter(e,t){let n=1;if(this._filter){const s=this._filter.filter(e,t);if(typeof s=="boolean"?n=s?1:0:XX(s)?n=uI(s.visibility):n=s,n===0)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:rh.Default,visibility:n};const r=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),o=Array.isArray(r)?r:[r];for(const s of o){const a=s&&s.toString();if(typeof a>"u")return{data:rh.Default,visibility:n};let l;if(this.tree.findMatchType===Ob.Contiguous){const c=a.toLowerCase().indexOf(this._lowercasePattern);if(c>-1){l=[Number.MAX_SAFE_INTEGER,0];for(let u=this._lowercasePattern.length;u>0;u--)l.push(c+u-1)}}else l=Ab(this._pattern,this._lowercasePattern,0,a,a.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(l)return this._matchCount++,o.length===1?{data:l,visibility:n}:{data:{label:a,score:l},visibility:n}}return this.tree.findMode===sp.Filter?typeof this.tree.options.defaultFindVisibility=="number"?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):2:{data:rh.Default,visibility:n}}reset(){this._totalCount=0,this._matchCount=0}dispose(){si(this.disposables)}}var sp;(function(i){i[i.Highlight=0]="Highlight",i[i.Filter=1]="Filter"})(sp||(sp={}));var Ob;(function(i){i[i.Fuzzy=0]="Fuzzy",i[i.Contiguous=1]="Contiguous"})(Ob||(Ob={}));let SXe=class{get pattern(){return this._pattern}get mode(){return this._mode}set mode(e){e!==this._mode&&(this._mode=e,this.widget&&(this.widget.mode=this._mode),this.tree.refilter(),this.render(),this._onDidChangeMode.fire(e))}get matchType(){return this._matchType}set matchType(e){e!==this._matchType&&(this._matchType=e,this.widget&&(this.widget.matchType=this._matchType),this.tree.refilter(),this.render(),this._onDidChangeMatchType.fire(e))}constructor(e,t,n,r,o,s={}){var a,l;this.tree=e,this.view=n,this.filter=r,this.contextViewProvider=o,this.options=s,this._pattern="",this.width=0,this._onDidChangeMode=new se,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new se,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new se,this._onDidChangeOpenState=new se,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new Te,this.disposables=new Te,this._mode=(a=e.options.defaultFindMode)!==null&&a!==void 0?a:sp.Highlight,this._matchType=(l=e.options.defaultFindMatchType)!==null&&l!==void 0?l:Ob.Fuzzy,t.onDidSplice(this.onDidSpliceModel,this,this.disposables)}updateOptions(e={}){e.defaultFindMode!==void 0&&(this.mode=e.defaultFindMode),e.defaultFindMatchType!==void 0&&(this.matchType=e.defaultFindMatchType)}onDidSpliceModel(){!this.widget||this.pattern.length===0||(this.tree.refilter(),this.render())}render(){var e,t,n,r;const o=this.filter.totalCount>0&&this.filter.matchCount===0;this.pattern&&o?!((e=this.tree.options.showNotFoundMessage)!==null&&e!==void 0)||e?(t=this.widget)===null||t===void 0||t.showMessage({type:2,content:w("not found","No elements found.")}):(n=this.widget)===null||n===void 0||n.showMessage({type:2}):(r=this.widget)===null||r===void 0||r.clearMessage()}shouldAllowFocus(e){return!this.widget||!this.pattern||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!rh.isDefault(e.filterData)}layout(e){var t;this.width=e,(t=this.widget)===null||t===void 0||t.layout(e)}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}};function xXe(i,e){return i.position===e.position&&s0e(i,e)}function s0e(i,e){return i.node.element===e.node.element&&i.startIndex===e.startIndex&&i.height===e.height&&i.endIndex===e.endIndex}class LXe{constructor(e=[]){this.stickyNodes=e}get count(){return this.stickyNodes.length}equal(e){return or(this.stickyNodes,e.stickyNodes,xXe)}lastNodePartiallyVisible(){if(this.count===0)return!1;const e=this.stickyNodes[this.count-1];if(this.count===1)return e.position!==0;const t=this.stickyNodes[this.count-2];return t.position+t.height!==e.position}animationStateChanged(e){if(!or(this.stickyNodes,e.stickyNodes,s0e)||this.count===0)return!1;const t=this.stickyNodes[this.count-1],n=e.stickyNodes[e.count-1];return t.position!==n.position}}class EXe{constrainStickyScrollNodes(e,t,n){for(let r=0;rn||r>=t)return e.slice(0,r)}return e}}let rse=class extends fe{constructor(e,t,n,r,o,s={}){var a;super(),this.tree=e,this.model=t,this.view=n,this.treeDelegate=o,this.maxWidgetViewRatio=.4;const l=this.validateStickySettings(s);this.stickyScrollMaxItemCount=l.stickyScrollMaxItemCount,this.stickyScrollDelegate=(a=s.stickyScrollDelegate)!==null&&a!==void 0?a:new EXe,this._widget=this._register(new DXe(n.getScrollableElement(),n,e,r,o,s.accessibilityProvider)),this.onDidChangeHasFocus=this._widget.onDidChangeHasFocus,this.onContextMenu=this._widget.onContextMenu,this._register(n.onDidScroll(()=>this.update())),this._register(n.onDidChangeContentHeight(()=>this.update())),this._register(e.onDidChangeCollapseState(()=>this.update())),this.update()}getNodeAtHeight(e){let t;if(e===0?t=this.view.firstVisibleIndex:t=this.view.indexAt(e+this.view.scrollTop),!(t<0||t>=this.view.length))return this.view.element(t)}update(){const e=this.getNodeAtHeight(0);if(!e||this.tree.scrollTop===0){this._widget.setState(void 0);return}const t=this.findStickyState(e);this._widget.setState(t)}findStickyState(e){const t=[];let n=e,r=0,o=this.getNextStickyNode(n,void 0,r);for(;o&&(t.push(o),r+=o.height,!(t.length<=this.stickyScrollMaxItemCount&&(n=this.getNextVisibleNode(o),!n)));)o=this.getNextStickyNode(n,o.node,r);const s=this.constrainStickyNodes(t);return s.length?new LXe(s):void 0}getNextVisibleNode(e){return this.getNodeAtHeight(e.position+e.height)}getNextStickyNode(e,t,n){const r=this.getAncestorUnderPrevious(e,t);if(r&&!(r===e&&(!this.nodeIsUncollapsedParent(e)||this.nodeTopAlignsWithStickyNodesBottom(e,n))))return this.createStickyScrollNode(r,n)}nodeTopAlignsWithStickyNodesBottom(e,t){const n=this.getNodeIndex(e),r=this.view.getElementTop(n),o=t;return this.view.scrollTop===r-o}createStickyScrollNode(e,t){const n=this.treeDelegate.getHeight(e),{startIndex:r,endIndex:o}=this.getNodeRange(e),s=this.calculateStickyNodePosition(o,t,n);return{node:e,position:s,height:n,startIndex:r,endIndex:o}}getAncestorUnderPrevious(e,t=void 0){let n=e,r=this.getParentNode(n);for(;r;){if(r===t)return n;n=r,r=this.getParentNode(n)}if(t===void 0)return n}calculateStickyNodePosition(e,t,n){let r=this.view.getRelativeTop(e);if(r===null&&this.view.firstVisibleIndex===e&&e+1l&&t<=l?l-n:t}constrainStickyNodes(e){if(e.length===0)return[];const t=this.view.renderHeight*this.maxWidgetViewRatio,n=e[e.length-1];if(e.length<=this.stickyScrollMaxItemCount&&n.position+n.height<=t)return e;const r=this.stickyScrollDelegate.constrainStickyScrollNodes(e,this.stickyScrollMaxItemCount,t);if(!r.length)return[];const o=r[r.length-1];if(r.length>this.stickyScrollMaxItemCount||o.position+o.height>t)throw new Error("stickyScrollDelegate violates constraints");return r}getParentNode(e){const t=this.model.getNodeLocation(e),n=this.model.getParentNodeLocation(t);return n?this.model.getNode(n):void 0}nodeIsUncollapsedParent(e){const t=this.model.getNodeLocation(e);return this.model.getListRenderCount(t)>1}getNodeIndex(e){const t=this.model.getNodeLocation(e);return this.model.getListIndex(t)}getNodeRange(e){const t=this.model.getNodeLocation(e),n=this.model.getListIndex(t);if(n<0)throw new Error("Node not found in tree");const r=this.model.getListRenderCount(t),o=n+r-1;return{startIndex:n,endIndex:o}}nodePositionTopBelowWidget(e){const t=[];let n=this.getParentNode(e);for(;n;)t.push(n),n=this.getParentNode(n);let r=0;for(let o=0;o0,n=!!e&&e.count>0;if(!t&&!n||t&&n&&this._previousState.equal(e))return;if(t!==n&&this.setVisible(n),!n){this._previousState=void 0,this._previousElements=[],this._previousStateDisposables.clear();return}const r=e.stickyNodes[e.count-1];if(this._previousState&&e.animationStateChanged(this._previousState))this._previousElements[this._previousState.count-1].style.top=`${r.position}px`;else{this._previousStateDisposables.clear();const o=Array(e.count);for(let s=e.count-1;s>=0;s--){const a=e.stickyNodes[s],{element:l,disposable:c}=this.createElement(a,s,e.count);o[s]=l,this._rootDomNode.appendChild(l),this._previousStateDisposables.add(c)}this.stickyScrollFocus.updateElements(o,e),this._previousElements=o}this._previousState=e,this._rootDomNode.style.height=`${r.position+r.height}px`}createElement(e,t,n){const r=e.startIndex,o=document.createElement("div");o.style.top=`${e.position}px`,o.style.height=`${e.height}px`,o.style.lineHeight=`${e.height}px`,o.classList.add("monaco-tree-sticky-row"),o.classList.add("monaco-list-row"),o.setAttribute("data-index",`${r}`),o.setAttribute("data-parity",r%2===0?"even":"odd"),o.setAttribute("id",this.view.getElementID(r)),this.setAccessibilityAttributes(o,e.node.element,t,n);const s=this.treeDelegate.getTemplateId(e.node),a=this.treeRenderers.find(d=>d.templateId===s);if(!a)throw new Error(`No renderer found for template id ${s}`);let l=e.node;l===this.tree.getNode(this.tree.getNodeLocation(e.node))&&(l=new Proxy(e.node,{}));const c=a.renderTemplate(o);a.renderElement(l,e.startIndex,c,e.height);const u=Rt(()=>{a.disposeElement(l,e.startIndex,c,e.height),a.disposeTemplate(c),o.remove()});return{element:o,disposable:u}}setAccessibilityAttributes(e,t,n,r){var o;if(!this.accessibilityProvider)return;this.accessibilityProvider.getSetSize&&e.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(t,n,r))),this.accessibilityProvider.getPosInSet&&e.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(t,n))),this.accessibilityProvider.getRole&&e.setAttribute("role",(o=this.accessibilityProvider.getRole(t))!==null&&o!==void 0?o:"treeitem");const s=this.accessibilityProvider.getAriaLabel(t);s&&e.setAttribute("aria-label",s);const a=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(t);typeof a=="number"&&e.setAttribute("aria-level",`${a}`),e.setAttribute("aria-selected",String(!1))}setVisible(e){this._rootDomNode.classList.toggle("empty",!e),e||this.stickyScrollFocus.updateElements([],void 0)}domFocus(){this.stickyScrollFocus.domFocus()}focusedLast(){return this.stickyScrollFocus.focusedLast()}dispose(){this.stickyScrollFocus.dispose(),this._previousStateDisposables.dispose(),this._rootDomNode.remove()}};class IXe extends fe{get domHasFocus(){return this._domHasFocus}set domHasFocus(e){e!==this._domHasFocus&&(this._onDidChangeHasFocus.fire(e),this._domHasFocus=e)}constructor(e,t){super(),this.container=e,this.view=t,this.focusedIndex=-1,this.elements=[],this._onDidChangeHasFocus=new se,this.onDidChangeHasFocus=this._onDidChangeHasFocus.event,this._onContextMenu=new se,this.onContextMenu=this._onContextMenu.event,this._domHasFocus=!1,this.container.addEventListener("focus",()=>this.onFocus()),this.container.addEventListener("blur",()=>this.onBlur()),this._register(this.view.onDidFocus(()=>this.toggleStickyScrollFocused(!1))),this._register(this.view.onKeyDown(n=>this.onKeyDown(n))),this._register(this.view.onMouseDown(n=>this.onMouseDown(n))),this._register(this.view.onContextMenu(n=>this.handleContextMenu(n)))}handleContextMenu(e){const t=e.browserEvent.target;if(!AP(t)&&!IE(t)){this.focusedLast()&&this.view.domFocus();return}if(!kq(e.browserEvent)){if(!this.state)throw new Error("Context menu should not be triggered when state is undefined");const s=this.state.stickyNodes.findIndex(a=>{var l;return a.node.element===((l=e.element)===null||l===void 0?void 0:l.element)});if(s===-1)throw new Error("Context menu should not be triggered when element is not in sticky scroll widget");this.container.focus(),this.setFocus(s);return}if(!this.state||this.focusedIndex<0)throw new Error("Context menu key should not be triggered when focus is not in sticky scroll widget");const r=this.state.stickyNodes[this.focusedIndex].node.element,o=this.elements[this.focusedIndex];this._onContextMenu.fire({element:r,anchor:o,browserEvent:e.browserEvent,isStickyScroll:!0})}onKeyDown(e){if(this.domHasFocus&&this.state){if(e.key==="ArrowUp")this.setFocusedElement(Math.max(0,this.focusedIndex-1)),e.preventDefault(),e.stopPropagation();else if(e.key==="ArrowDown"||e.key==="ArrowRight"){if(this.focusedIndex>=this.state.count-1){const t=this.state.stickyNodes[this.state.count-1].startIndex+1;this.view.domFocus(),this.view.setFocus([t]),this.scrollNodeUnderWidget(t,this.state)}else this.setFocusedElement(this.focusedIndex+1);e.preventDefault(),e.stopPropagation()}}}onMouseDown(e){const t=e.browserEvent.target;!AP(t)&&!IE(t)||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation())}updateElements(e,t){if(t&&t.count===0)throw new Error("Sticky scroll state must be undefined when there are no sticky nodes");if(t&&t.count!==e.length)throw new Error("Sticky scroll focus received illigel state");const n=this.focusedIndex;if(this.removeFocus(),this.elements=e,this.state=t,t){const r=da(n,0,t.count-1);this.setFocus(r)}else this.domHasFocus&&this.view.domFocus();this.container.tabIndex=t?0:-1}setFocusedElement(e){const t=this.state;if(!t)throw new Error("Cannot set focus when state is undefined");if(this.setFocus(e),!(e1?t.stickyNodes[t.count-2]:void 0,o=this.view.getElementTop(e),s=r?r.position+r.height+n.height:n.height;this.view.scrollTop=o-s}domFocus(){if(!this.state)throw new Error("Cannot focus when state is undefined");this.container.focus()}focusedLast(){return this.state?this.view.getHTMLElement().classList.contains("sticky-scroll-focused"):!1}removeFocus(){this.focusedIndex!==-1&&(this.toggleElementFocus(this.elements[this.focusedIndex],!1),this.focusedIndex=-1)}setFocus(e){if(0>e)throw new Error("addFocus() can not remove focus");if(!this.state&&e>=0)throw new Error("Cannot set focus index when state is undefined");if(this.state&&e>=this.state.count)throw new Error("Cannot set focus index to an index that does not exist");const t=this.focusedIndex;t>=0&&this.toggleElementFocus(this.elements[t],!1),e>=0&&this.toggleElementFocus(this.elements[e],!0),this.focusedIndex=e}toggleElementFocus(e,t){e.classList.toggle("focused",t)}toggleStickyScrollFocused(e){this.view.getHTMLElement().classList.toggle("sticky-scroll-focused",e)}onFocus(){if(!this.state||this.elements.length===0)throw new Error("Cannot focus when state is undefined or elements are empty");this.domHasFocus=!0,this.toggleStickyScrollFocused(!0),this.focusedIndex===-1&&this.setFocus(0)}onBlur(){this.domHasFocus=!1}dispose(){this.toggleStickyScrollFocused(!1),this._onDidChangeHasFocus.fire(!1),super.dispose()}}function ose(i){let e=j0.Unknown;return c6(i.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=j0.Twistie:c6(i.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=j0.Element:c6(i.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=j0.Filter),{browserEvent:i.browserEvent,element:i.element?i.element.element:null,target:e}}function kM(i,e){e(i),i.children.forEach(t=>kM(t,e))}class h9{get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}constructor(e,t){this.getFirstViewElementWithTrait=e,this.identityProvider=t,this.nodes=[],this._onDidChange=new se,this.onDidChange=this._onDidChange.event}set(e,t){!(t!=null&&t.__forceEvent)&&or(this.nodes,e)||this._set(e,!1,t)}_set(e,t,n){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const r=this;this._onDidChange.fire({get elements(){return r.get()},browserEvent:n})}}get(){return this.elements||(this.elements=this.nodes.map(e=>e.element)),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}){if(!this.identityProvider){const l=this.createNodeSet(),c=u=>l.delete(u);t.forEach(u=>kM(u,c)),this.set([...l.values()]);return}const n=new Set,r=l=>n.add(this.identityProvider.getId(l.element).toString());t.forEach(l=>kM(l,r));const o=new Map,s=l=>o.set(this.identityProvider.getId(l.element).toString(),l);e.forEach(l=>kM(l,s));const a=[];for(const l of this.nodes){const c=this.identityProvider.getId(l.element).toString();if(!n.has(c))a.push(l);else{const d=o.get(c);d&&d.visible&&a.push(d)}}if(this.nodes.length>0&&a.length===0){const l=this.getFirstViewElementWithTrait();l&&a.push(l)}this._set(a,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class kXe extends z_e{constructor(e,t,n){super(e),this.tree=t,this.stickyScrollProvider=n}onViewPointer(e){if(W_e(e.browserEvent.target)||xv(e.browserEvent.target)||FL(e.browserEvent.target)||e.browserEvent.isHandledByList)return;const t=e.element;if(!t)return super.onViewPointer(e);if(this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);const n=e.browserEvent.target,r=n.classList.contains("monaco-tl-twistie")||n.classList.contains("monaco-icon-label")&&n.classList.contains("folder-icon")&&e.browserEvent.offsetX<16,o=IE(e.browserEvent.target);let s=!1;if(o?s=!0:typeof this.tree.expandOnlyOnTwistieClick=="function"?s=this.tree.expandOnlyOnTwistieClick(t.element):s=!!this.tree.expandOnlyOnTwistieClick,o)this.handleStickyScrollMouseEvent(e,t);else{if(s&&!r&&e.browserEvent.detail!==2)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e)}if(t.collapsible&&(!o||r)){const a=this.tree.getNodeLocation(t),l=e.browserEvent.altKey;if(this.tree.setFocus([a]),this.tree.toggleCollapsed(a,l),s&&r){e.browserEvent.isHandledByList=!0;return}}o||super.onViewPointer(e)}handleStickyScrollMouseEvent(e,t){if(lqe(e.browserEvent.target)||cqe(e.browserEvent.target))return;const n=this.stickyScrollProvider();if(!n)throw new Error("Sticky scroll controller not found");const r=this.list.indexOf(t),o=this.list.getElementTop(r),s=n.nodePositionTopBelowWidget(t);this.tree.scrollTop=o-s,this.list.domFocus(),this.list.setFocus([r]),this.list.setSelection([r])}onDoubleClick(e){e.browserEvent.target.classList.contains("monaco-tl-twistie")||!this.tree.expandOnDoubleClick||e.browserEvent.isHandledByList||super.onDoubleClick(e)}onMouseDown(e){const t=e.browserEvent.target;if(!AP(t)&&!IE(t)){super.onMouseDown(e);return}}onContextMenu(e){const t=e.browserEvent.target;if(!AP(t)&&!IE(t)){super.onContextMenu(e);return}}}class TXe extends wc{constructor(e,t,n,r,o,s,a,l){super(e,t,n,r,l),this.focusTrait=o,this.selectionTrait=s,this.anchorTrait=a}createMouseController(e){return new kXe(this,e.tree,e.stickyScrollProvider)}splice(e,t,n=[]){if(super.splice(e,t,n),n.length===0)return;const r=[],o=[];let s;n.forEach((a,l)=>{this.focusTrait.has(a)&&r.push(e+l),this.selectionTrait.has(a)&&o.push(e+l),this.anchorTrait.has(a)&&(s=e+l)}),r.length>0&&super.setFocus(Lp([...super.getFocus(),...r])),o.length>0&&super.setSelection(Lp([...super.getSelection(),...o])),typeof s=="number"&&super.setAnchor(s)}setFocus(e,t,n=!1){super.setFocus(e,t),n||this.focusTrait.set(e.map(r=>this.element(r)),t)}setSelection(e,t,n=!1){super.setSelection(e,t),n||this.selectionTrait.set(e.map(r=>this.element(r)),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(typeof e>"u"?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class a0e{get onDidScroll(){return this.view.onDidScroll}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return Je.filter(Je.map(this.view.onMouseDblClick,ose),e=>e.target!==j0.Filter)}get onPointer(){return Je.map(this.view.onPointer,ose)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return Je.signal(this.model.onDidSplice)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get findMode(){var e,t;return(t=(e=this.findController)===null||e===void 0?void 0:e.mode)!==null&&t!==void 0?t:sp.Highlight}set findMode(e){this.findController&&(this.findController.mode=e)}get findMatchType(){var e,t;return(t=(e=this.findController)===null||e===void 0?void 0:e.matchType)!==null&&t!==void 0?t:Ob.Fuzzy}set findMatchType(e){this.findController&&(this.findController.matchType=e)}get expandOnDoubleClick(){return typeof this._options.expandOnDoubleClick>"u"?!0:this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return typeof this._options.expandOnlyOnTwistieClick>"u"?!0:this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(e,t,n,r,o={}){var s;this._user=e,this._options=o,this.eventBufferer=new uq,this.onDidChangeFindOpenState=Je.None,this.onDidChangeStickyScrollFocused=Je.None,this.disposables=new Te,this._onWillRefilter=new se,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new se,this.treeDelegate=new YX(n);const a=new Wne,l=new Wne,c=this.disposables.add(new yXe(l.event)),u=new Wq;this.renderers=r.map(p=>new hI(p,()=>this.model,a.event,c,u,o));for(const p of this.renderers)this.disposables.add(p);let d;o.keyboardNavigationLabelProvider&&(d=new wXe(this,o.keyboardNavigationLabelProvider,o.filter),o={...o,filter:d},this.disposables.add(d)),this.focus=new h9(()=>this.view.getFocusedElements()[0],o.identityProvider),this.selection=new h9(()=>this.view.getSelectedElements()[0],o.identityProvider),this.anchor=new h9(()=>this.view.getAnchorElement(),o.identityProvider),this.view=new TXe(e,t,this.treeDelegate,this.renderers,this.focus,this.selection,this.anchor,{...CXe(()=>this.model,o),tree:this,stickyScrollProvider:()=>this.stickyScrollController}),this.model=this.createModel(e,this.view,o),a.input=this.model.onDidChangeCollapseState;const h=Je.forEach(this.model.onDidSplice,p=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(p),this.selection.onDidModelSplice(p)})},this.disposables);h(()=>null,null,this.disposables);const f=this.disposables.add(new se),g=this.disposables.add(new nd(0));if(this.disposables.add(Je.any(h,this.focus.onDidChange,this.selection.onDidChange)(()=>{g.trigger(()=>{const p=new Set;for(const v of this.focus.getNodes())p.add(v);for(const v of this.selection.getNodes())p.add(v);f.fire([...p.values()])})})),l.input=f.event,o.keyboardSupport!==!1){const p=Je.chain(this.view.onKeyDown,v=>v.filter(m=>!xv(m.target)).map(m=>new Ai(m)));Je.chain(p,v=>v.filter(m=>m.keyCode===15))(this.onLeftArrow,this,this.disposables),Je.chain(p,v=>v.filter(m=>m.keyCode===17))(this.onRightArrow,this,this.disposables),Je.chain(p,v=>v.filter(m=>m.keyCode===10))(this.onSpace,this,this.disposables)}if((!((s=o.findWidgetEnabled)!==null&&s!==void 0)||s)&&o.keyboardNavigationLabelProvider&&o.contextViewProvider){const p=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new SXe(this,this.model,this.view,d,o.contextViewProvider,p),this.focusNavigationFilter=v=>this.findController.shouldAllowFocus(v),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.disposables.add(this.findController),this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=Je.None,this.onDidChangeFindMatchType=Je.None;o.enableStickyScroll&&(this.stickyScrollController=new rse(this,this.model,this.view,this.renderers,this.treeDelegate,o),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus),this.styleElement=gc(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===dI.Always)}updateOptions(e={}){var t;this._options={...this._options,...e};for(const n of this.renderers)n.updateOptions(e);this.view.updateOptions(this._options),(t=this.findController)===null||t===void 0||t.updateOptions(e),this.updateStickyScroll(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===dI.Always)}get options(){return this._options}updateStickyScroll(e){var t;!this.stickyScrollController&&this._options.enableStickyScroll?(this.stickyScrollController=new rse(this,this.model,this.view,this.renderers,this.treeDelegate,this._options),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus):this.stickyScrollController&&!this._options.enableStickyScroll&&(this.onDidChangeStickyScrollFocused=Je.None,this.stickyScrollController.dispose(),this.stickyScrollController=void 0),(t=this.stickyScrollController)===null||t===void 0||t.updateOptions(e)}getHTMLElement(){return this.view.getHTMLElement()}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}domFocus(){var e;!((e=this.stickyScrollController)===null||e===void 0)&&e.focusedLast()?this.stickyScrollController.domFocus():this.view.domFocus()}layout(e,t){var n;this.view.layout(e,t),Hv(t)&&((n=this.findController)===null||n===void 0||n.layout(t))}style(e){var t;const n=`.${this.view.domId}`,r=[];e.treeIndentGuidesStroke&&(r.push(`.monaco-list${n}:hover .monaco-tl-indent > .indent-guide, .monaco-list${n}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeInactiveIndentGuidesStroke}; }`),r.push(`.monaco-list${n} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`)),e.listBackground&&(r.push(`.monaco-list${n} .monaco-scrollable-element .monaco-tree-sticky-container { background-color: ${e.listBackground}; }`),r.push(`.monaco-list${n} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row { background-color: ${e.listBackground}; }`)),e.listFocusForeground&&(r.push(`.monaco-list${n}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),r.push(`.monaco-list${n}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { color: inherit; }`));const o=gp(e.listFocusAndSelectionOutline,gp(e.listSelectionOutline,(t=e.listFocusOutline)!==null&&t!==void 0?t:""));o&&(r.push(`.monaco-list${n}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused.selected { outline: 1px solid ${o}; outline-offset: -1px;}`),r.push(`.monaco-list${n}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused.selected { outline: inherit;}`)),e.listFocusOutline&&(r.push(`.monaco-list${n}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),r.push(`.monaco-list${n}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { outline: inherit; }`),r.push(`.monaco-workbench.context-menu-visible .monaco-list${n}.last-focused.sticky-scroll-focused .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`),r.push(`.monaco-workbench.context-menu-visible .monaco-list${n}.last-focused:not(.sticky-scroll-focused) .monaco-tree-sticky-container .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`)),this.styleElement.textContent=r.join(` -`),this.view.style(e)}getParentElement(e){const t=this.model.getParentNodeLocation(e);return this.model.getNode(t).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}getNodeLocation(e){return this.model.getNodeLocation(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}toggleCollapsed(e,t=!1){return this.model.setCollapsed(e,void 0,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){this.eventBufferer.bufferEvents(()=>{const n=e.map(o=>this.model.getNode(o));this.selection.set(n,t);const r=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setSelection(r,t,!0)})}getSelection(){return this.selection.get()}setFocus(e,t){this.eventBufferer.bufferEvents(()=>{const n=e.map(o=>this.model.getNode(o));this.focus.set(n,t);const r=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setFocus(r,t,!0)})}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const n=this.model.getListIndex(e);if(n!==-1)if(!this.stickyScrollController)this.view.reveal(n,t);else{const r=this.stickyScrollController.nodePositionTopBelowWidget(this.getNode(e));this.view.reveal(n,t,r)}}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const n=t[0],r=this.model.getNodeLocation(n);if(!this.model.setCollapsed(r,!0)){const s=this.model.getParentNodeLocation(r);if(!s)return;const a=this.model.getListIndex(s);this.view.reveal(a),this.view.setFocus([a])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const n=t[0],r=this.model.getNodeLocation(n);if(!this.model.setCollapsed(r,!1)){if(!n.children.some(l=>l.visible))return;const[s]=this.view.getFocus(),a=s+1;this.view.reveal(a),this.view.setFocus([a])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const n=t[0],r=this.model.getNodeLocation(n),o=e.browserEvent.altKey;this.model.setCollapsed(r,void 0,o)}dispose(){var e;si(this.disposables),(e=this.stickyScrollController)===null||e===void 0||e.dispose(),this.view.dispose()}}class ZX{constructor(e,t,n={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new vXe(e,t,null,n),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,n.sorter&&(this.sorter={compare(r,o){return n.sorter.compare(r.element,o.element)}}),this.identityProvider=n.identityProvider}setChildren(e,t=En.empty(),n={}){const r=this.getElementLocation(e);this._setChildren(r,this.preserveCollapseState(t),n)}_setChildren(e,t=En.empty(),n){const r=new Set,o=new Set,s=l=>{var c;if(l.element===null)return;const u=l;if(r.add(u.element),this.nodes.set(u.element,u),this.identityProvider){const d=this.identityProvider.getId(u.element).toString();o.add(d),this.nodesByIdentity.set(d,u)}(c=n.onDidCreateNode)===null||c===void 0||c.call(n,u)},a=l=>{var c;if(l.element===null)return;const u=l;if(r.has(u.element)||this.nodes.delete(u.element),this.identityProvider){const d=this.identityProvider.getId(u.element).toString();o.has(d)||this.nodesByIdentity.delete(d)}(c=n.onDidDeleteNode)===null||c===void 0||c.call(n,u)};this.model.splice([...e,0],Number.MAX_VALUE,t,{...n,onDidCreateNode:s,onDidDeleteNode:a})}preserveCollapseState(e=En.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),En.map(e,t=>{let n=this.nodes.get(t.element);if(!n&&this.identityProvider){const s=this.identityProvider.getId(t.element).toString();n=this.nodesByIdentity.get(s)}if(!n){let s;return typeof t.collapsed>"u"?s=void 0:t.collapsed===Yl.Collapsed||t.collapsed===Yl.PreserveOrCollapsed?s=!0:t.collapsed===Yl.Expanded||t.collapsed===Yl.PreserveOrExpanded?s=!1:s=!!t.collapsed,{...t,children:this.preserveCollapseState(t.children),collapsed:s}}const r=typeof t.collapsible=="boolean"?t.collapsible:n.collapsible;let o;return typeof t.collapsed>"u"||t.collapsed===Yl.PreserveOrCollapsed||t.collapsed===Yl.PreserveOrExpanded?o=n.collapsed:t.collapsed===Yl.Collapsed?o=!0:t.collapsed===Yl.Expanded?o=!1:o=!!t.collapsed,{...t,collapsible:r,collapsed:o,children:this.preserveCollapseState(t.children)}})}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}getFirstElementChild(e=null){const t=this.getElementLocation(e);return this.model.getFirstElementChild(t)}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getElementLocation(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getElementLocation(e);return this.model.getListRenderCount(t)}isCollapsible(e){const t=this.getElementLocation(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const n=this.getElementLocation(e);return this.model.setCollapsible(n,t)}isCollapsed(e){const t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,n){const r=this.getElementLocation(e);return this.model.setCollapsed(r,t,n)}expandTo(e){const t=this.getElementLocation(e);this.model.expandTo(t)}refilter(){this.model.refilter()}getNode(e=null){if(e===null)return this.model.getNode(this.model.rootRef);const t=this.nodes.get(e);if(!t)throw new rc(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new rc(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new rc(this.user,`Tree element not found: ${e}`);const n=this.model.getNodeLocation(t),r=this.model.getParentNodeLocation(n);return this.model.getNode(r).element}getElementLocation(e){if(e===null)return[];const t=this.nodes.get(e);if(!t)throw new rc(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function TM(i){const e=[i.element],t=i.incompressible||!1;return{element:{elements:e,incompressible:t},children:En.map(En.from(i.children),TM),collapsible:i.collapsible,collapsed:i.collapsed}}function NM(i){const e=[i.element],t=i.incompressible||!1;let n,r;for(;[r,n]=En.consume(En.from(i.children),2),!(r.length!==1||r[0].incompressible);)i=r[0],e.push(i.element);return{element:{elements:e,incompressible:t},children:En.map(En.concat(r,n),NM),collapsible:i.collapsible,collapsed:i.collapsed}}function WV(i,e=0){let t;return eWV(n,0)),e===0&&i.element.incompressible?{element:i.element.elements[e],children:t,incompressible:!0,collapsible:i.collapsible,collapsed:i.collapsed}:{element:i.element.elements[e],children:t,collapsible:i.collapsible,collapsed:i.collapsed}}function sse(i){return WV(i,0)}function l0e(i,e,t){return i.element===e?{...i,children:t}:{...i,children:En.map(En.from(i.children),n=>l0e(n,e,t))}}const NXe=i=>({getId(e){return e.elements.map(t=>i.getId(t).toString()).join("\0")}});class RXe{get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(e,t,n={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new ZX(e,t,n),this.enabled=typeof n.compressionEnabled>"u"?!0:n.compressionEnabled,this.identityProvider=n.identityProvider}setChildren(e,t=En.empty(),n){const r=n.diffIdentityProvider&&NXe(n.diffIdentityProvider);if(e===null){const g=En.map(t,this.enabled?NM:TM);this._setChildren(null,g,{diffIdentityProvider:r,diffDepth:1/0});return}const o=this.nodes.get(e);if(!o)throw new rc(this.user,"Unknown compressed tree node");const s=this.model.getNode(o),a=this.model.getParentNodeLocation(o),l=this.model.getNode(a),c=sse(s),u=l0e(c,e,t),d=(this.enabled?NM:TM)(u),h=n.diffIdentityProvider?(g,p)=>n.diffIdentityProvider.getId(g)===n.diffIdentityProvider.getId(p):void 0;if(or(d.element.elements,s.element.elements,h)){this._setChildren(o,d.children||En.empty(),{diffIdentityProvider:r,diffDepth:1});return}const f=l.children.map(g=>g===s?d:g);this._setChildren(l.element,f,{diffIdentityProvider:r,diffDepth:s.depth-l.depth})}isCompressionEnabled(){return this.enabled}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const n=this.model.getNode().children,r=En.map(n,sse),o=En.map(r,e?NM:TM);this._setChildren(null,o,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,n){const r=new Set,o=a=>{for(const l of a.element.elements)r.add(l),this.nodes.set(l,a.element)},s=a=>{for(const l of a.element.elements)r.has(l)||this.nodes.delete(l)};this.model.setChildren(e,t,{...n,onDidCreateNode:o,onDidDeleteNode:s})}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getCompressedNode(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getCompressedNode(e);return this.model.getListRenderCount(t)}getNode(e){if(typeof e>"u")return this.model.getNode();const t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){const t=this.model.getNodeLocation(e);return t===null?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){const t=this.getCompressedNode(e),n=this.model.getParentNodeLocation(t);return n===null?null:n.elements[n.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 n=this.getCompressedNode(e);return this.model.setCollapsible(n,t)}isCollapsed(e){const t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,n){const r=this.getCompressedNode(e);return this.model.setCollapsed(r,t,n)}expandTo(e){const t=this.getCompressedNode(e);this.model.expandTo(t)}rerender(e){const t=this.getCompressedNode(e);this.model.rerender(t)}refilter(){this.model.refilter()}getCompressedNode(e){if(e===null)return null;const t=this.nodes.get(e);if(!t)throw new rc(this.user,`Tree element not found: ${e}`);return t}}const MXe=i=>i[i.length-1];class QX{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new QX(this.unwrapper,e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e,t){this.unwrapper=e,this.node=t}}function AXe(i,e){return{splice(t,n,r){e.splice(t,n,r.map(o=>i.map(o)))},updateElementHeight(t,n){e.updateElementHeight(t,n)}}}function PXe(i,e){return{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(i(t))}},sorter:e.sorter&&{compare(t,n){return e.sorter.compare(t.elements[0],n.elements[0])}},filter:e.filter&&{filter(t,n){return e.filter.filter(i(t),n)}}}}class OXe{get onDidSplice(){return Je.map(this.model.onDidSplice,({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map(n=>this.nodeMapper.map(n)),deletedNodes:t.map(n=>this.nodeMapper.map(n))}))}get onDidChangeCollapseState(){return Je.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return Je.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t,n={}){this.rootRef=null,this.elementMapper=n.elementMapper||MXe;const r=o=>this.elementMapper(o.elements);this.nodeMapper=new qX(o=>new QX(r,o)),this.model=new RXe(e,AXe(this.nodeMapper,t),PXe(r,n))}setChildren(e,t=En.empty(),n={}){this.model.setChildren(e,t,n)}isCompressionEnabled(){return this.model.isCompressionEnabled()}setCompressionEnabled(e){this.model.setCompressionEnabled(e)}has(e){return this.model.has(e)}getListIndex(e){return this.model.getListIndex(e)}getListRenderCount(e){return this.model.getListRenderCount(e)}getNode(e){return this.nodeMapper.map(this.model.getNode(e))}getNodeLocation(e){return e.element}getParentNodeLocation(e){return this.model.getParentNodeLocation(e)}getFirstElementChild(e){const t=this.model.getFirstElementChild(e);return t===null||typeof t>"u"?t:this.elementMapper(t.elements)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}setCollapsed(e,t,n){return this.model.setCollapsed(e,t,n)}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 FXe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o};class JX extends a0e{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,n,r,o={}){super(e,t,n,r,o),this.user=e}setChildren(e,t=En.empty(),n){this.model.setChildren(e,t,n)}rerender(e){if(e===void 0){this.view.rerender();return}this.model.rerender(e)}hasElement(e){return this.model.has(e)}createModel(e,t,n){return new ZX(e,t,n)}}class c0e{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,t,n){this._compressedTreeNodeProvider=e,this.stickyScrollDelegate=t,this.renderer=n,this.templateId=n.templateId,n.onDidChangeTwistieState&&(this.onDidChangeTwistieState=n.onDidChangeTwistieState)}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,n,r){let o=this.stickyScrollDelegate.getCompressedNode(e);o||(o=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element)),o.element.elements.length===1?(n.compressedTreeNode=void 0,this.renderer.renderElement(e,t,n.data,r)):(n.compressedTreeNode=o,this.renderer.renderCompressedElements(o,t,n.data,r))}disposeElement(e,t,n,r){var o,s,a,l;n.compressedTreeNode?(s=(o=this.renderer).disposeCompressedElements)===null||s===void 0||s.call(o,n.compressedTreeNode,t,n.data,r):(l=(a=this.renderer).disposeElement)===null||l===void 0||l.call(a,e,t,n.data,r)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return this.renderer.renderTwistie?this.renderer.renderTwistie(e,t):!1}}FXe([Rr],c0e.prototype,"compressedTreeNodeProvider",null);class BXe{constructor(e){this.modelProvider=e,this.compressedStickyNodes=new Map}getCompressedNode(e){return this.compressedStickyNodes.get(e)}constrainStickyScrollNodes(e,t,n){if(this.compressedStickyNodes.clear(),e.length===0)return[];for(let r=0;rn||r>=t-1&&tthis,a=new BXe(()=>this.model),l=r.map(c=>new c0e(s,a,c));super(e,t,n,l,{...WXe(s,o),stickyScrollDelegate:a})}setChildren(e,t=En.empty(),n){this.model.setChildren(e,t,n)}createModel(e,t,n){return new OXe(e,t,n)}updateOptions(e={}){super.updateOptions(e),typeof e.compressionEnabled<"u"&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}function f9(i){return{...i,children:[],refreshPromise:void 0,stale:!0,slow:!1,forceExpanded:!1}}function $V(i,e){return e.parent?e.parent===i?!0:$V(i,e.parent):!1}function $Xe(i,e){return i===e||$V(i,e)||$V(e,i)}class eY{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new eY(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class HXe{constructor(e,t,n){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=n,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,n,r){this.renderer.renderElement(this.nodeMapper.map(e),t,n.templateData,r)}renderTwistie(e,t){return e.slow?(t.classList.add(...Wt.asClassNameArray(Xe.treeItemLoading)),!0):(t.classList.remove(...Wt.asClassNameArray(Xe.treeItemLoading)),!1)}disposeElement(e,t,n,r){var o,s;(s=(o=this.renderer).disposeElement)===null||s===void 0||s.call(o,this.nodeMapper.map(e),t,n.templateData,r)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function ase(i){return{browserEvent:i.browserEvent,elements:i.elements.map(e=>e.element)}}function lse(i){return{browserEvent:i.browserEvent,element:i.element&&i.element.element,target:i.target}}class VXe extends Yk{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function g9(i){return i instanceof Yk?new VXe(i):i}class zXe{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(n=>n.element),t)}onDragStart(e,t){var n,r;(r=(n=this.dnd).onDragStart)===null||r===void 0||r.call(n,g9(e),t)}onDragOver(e,t,n,r,o,s=!0){return this.dnd.onDragOver(g9(e),t&&t.element,n,r,o)}drop(e,t,n,r,o){this.dnd.drop(g9(e),t&&t.element,n,r,o)}onDragEnd(e){var t,n;(n=(t=this.dnd).onDragEnd)===null||n===void 0||n.call(t,e)}dispose(){this.dnd.dispose()}}function d0e(i){return i&&{...i,collapseByDefault:!0,identityProvider:i.identityProvider&&{getId(e){return i.identityProvider.getId(e.element)}},dnd:i.dnd&&new zXe(i.dnd),multipleSelectionController:i.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return i.multipleSelectionController.isSelectionSingleChangeEvent({...e,element:e.element})},isSelectionRangeChangeEvent(e){return i.multipleSelectionController.isSelectionRangeChangeEvent({...e,element:e.element})}},accessibilityProvider:i.accessibilityProvider&&{...i.accessibilityProvider,getPosInSet:void 0,getSetSize:void 0,getRole:i.accessibilityProvider.getRole?e=>i.accessibilityProvider.getRole(e.element):()=>"treeitem",isChecked:i.accessibilityProvider.isChecked?e=>{var t;return!!(!((t=i.accessibilityProvider)===null||t===void 0)&&t.isChecked(e.element))}:void 0,getAriaLabel(e){return i.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return i.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:i.accessibilityProvider.getWidgetRole?()=>i.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:i.accessibilityProvider.getAriaLevel&&(e=>i.accessibilityProvider.getAriaLevel(e.element)),getActiveDescendantId:i.accessibilityProvider.getActiveDescendantId&&(e=>i.accessibilityProvider.getActiveDescendantId(e.element))},filter:i.filter&&{filter(e,t){return i.filter.filter(e.element,t)}},keyboardNavigationLabelProvider:i.keyboardNavigationLabelProvider&&{...i.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(e){return i.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}},sorter:void 0,expandOnlyOnTwistieClick:typeof i.expandOnlyOnTwistieClick>"u"?void 0:typeof i.expandOnlyOnTwistieClick!="function"?i.expandOnlyOnTwistieClick:e=>i.expandOnlyOnTwistieClick(e.element),defaultFindVisibility:e=>e.hasChildren&&e.stale?1:typeof i.defaultFindVisibility=="number"?i.defaultFindVisibility:typeof i.defaultFindVisibility>"u"?2:i.defaultFindVisibility(e.element)}}function HV(i,e){e(i),i.children.forEach(t=>HV(t,e))}class h0e{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return Je.map(this.tree.onDidChangeFocus,ase)}get onDidChangeSelection(){return Je.map(this.tree.onDidChangeSelection,ase)}get onMouseDblClick(){return Je.map(this.tree.onMouseDblClick,lse)}get onPointer(){return Je.map(this.tree.onPointer,lse)}get onDidFocus(){return this.tree.onDidFocus}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidChangeFindOpenState(){return this.tree.onDidChangeFindOpenState}get onDidChangeStickyScrollFocused(){return this.tree.onDidChangeStickyScrollFocused}get onDidDispose(){return this.tree.onDidDispose}constructor(e,t,n,r,o,s={}){this.user=e,this.dataSource=o,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new se,this._onDidChangeNodeSlowState=new se,this.nodeMapper=new qX(a=>new eY(a)),this.disposables=new Te,this.identityProvider=s.identityProvider,this.autoExpandSingleChildren=typeof s.autoExpandSingleChildren>"u"?!1:s.autoExpandSingleChildren,this.sorter=s.sorter,this.getDefaultCollapseState=a=>s.collapseByDefault?s.collapseByDefault(a)?Yl.PreserveOrCollapsed:Yl.PreserveOrExpanded:void 0,this.tree=this.createTree(e,t,n,r,s),this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.onDidChangeFindMatchType=this.tree.onDidChangeFindMatchType,this.root=f9({element:void 0,parent:null,hasChildren:!0,defaultCollapseState:void 0}),this.identityProvider&&(this.root={...this.root,id:null}),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}createTree(e,t,n,r,o){const s=new YX(n),a=r.map(c=>new HXe(c,this.nodeMapper,this._onDidChangeNodeSlowState.event)),l=d0e(o)||{};return new JX(e,t,s,a,l)}updateOptions(e={}){this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}get scrollHeight(){return this.tree.scrollHeight}get renderHeight(){return this.tree.renderHeight}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}async setInput(e,t){this.refreshPromises.forEach(r=>r.cancel()),this.refreshPromises.clear(),this.root.element=e;const n=t&&{viewState:t,focus:[],selection:[]};await this._updateChildren(e,!0,!1,n),n&&(this.tree.setFocus(n.focus),this.tree.setSelection(n.selection)),t&&typeof t.scrollTop=="number"&&(this.scrollTop=t.scrollTop)}async _updateChildren(e=this.root.element,t=!0,n=!1,r,o){if(typeof this.root.element>"u")throw new rc(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await Je.toPromise(this._onDidRender.event));const s=this.getDataNode(e);if(await this.refreshAndRenderNode(s,t,r,o),n)try{this.tree.rerender(s)}catch{}}rerender(e){if(e===void 0||e===this.root.element){this.tree.rerender();return}const t=this.getDataNode(e);this.tree.rerender(t)}getNode(e=this.root.element){const t=this.getDataNode(e),n=this.tree.getNode(t===this.root?null:t);return this.nodeMapper.map(n)}collapse(e,t=!1){const n=this.getDataNode(e);return this.tree.collapse(n===this.root?null:n,t)}async expand(e,t=!1){if(typeof this.root.element>"u")throw new rc(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await Je.toPromise(this._onDidRender.event));const n=this.getDataNode(e);if(this.tree.hasElement(n)&&!this.tree.isCollapsible(n)||(n.refreshPromise&&(await this.root.refreshPromise,await Je.toPromise(this._onDidRender.event)),n!==this.root&&!n.refreshPromise&&!this.tree.isCollapsed(n)))return!1;const r=this.tree.expand(n===this.root?null:n,t);return n.refreshPromise&&(await this.root.refreshPromise,await Je.toPromise(this._onDidRender.event)),r}setSelection(e,t){const n=e.map(r=>this.getDataNode(r));this.tree.setSelection(n,t)}getSelection(){return this.tree.getSelection().map(t=>t.element)}setFocus(e,t){const n=e.map(r=>this.getDataNode(r));this.tree.setFocus(n,t)}getFocus(){return this.tree.getFocus().map(t=>t.element)}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getParentElement(e){const t=this.tree.getParentElement(this.getDataNode(e));return t&&t.element}getFirstElementChild(e=this.root.element){const t=this.getDataNode(e),n=this.tree.getFirstElementChild(t===this.root?null:t);return n&&n.element}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e);if(!t)throw new rc(this.user,`Data tree node not found: ${e}`);return t}async refreshAndRenderNode(e,t,n,r){await this.refreshNode(e,t,n),!this.disposables.isDisposed&&this.render(e,n,r)}async refreshNode(e,t,n){let r;if(this.subTreeRefreshPromises.forEach((o,s)=>{!r&&$Xe(s,e)&&(r=o.then(()=>this.refreshNode(e,t,n)))}),r)return r;if(e!==this.root&&this.tree.getNode(e).collapsed){e.hasChildren=!!this.dataSource.hasChildren(e.element),e.stale=!0,this.setChildren(e,[],t,n);return}return this.doRefreshSubTree(e,t,n)}async doRefreshSubTree(e,t,n){let r;e.refreshPromise=new Promise(o=>r=o),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)});try{const o=await this.doRefreshNode(e,t,n);e.stale=!1,await iH.settled(o.map(s=>this.doRefreshSubTree(s,t,n)))}finally{r()}}async doRefreshNode(e,t,n){e.hasChildren=!!this.dataSource.hasChildren(e.element);let r;if(!e.hasChildren)r=Promise.resolve(En.empty());else{const o=this.doGetChildren(e);if(Mne(o))r=Promise.resolve(o);else{const s=jv(800);s.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},a=>null),r=o.finally(()=>s.cancel())}}try{const o=await r;return this.setChildren(e,o,t,n)}catch(o){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),wh(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 n=this.dataSource.getChildren(e.element);return Mne(n)?this.processChildren(n):(t=Io(async()=>this.processChildren(await n)),this.refreshPromises.set(e,t),t.finally(()=>{this.refreshPromises.delete(e)}))}_onDidChangeCollapseState({node:e,deep:t}){e.element!==null&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(en))}setChildren(e,t,n,r){const o=[...t];if(e.children.length===0&&o.length===0)return[];const s=new Map,a=new Map;for(const u of e.children)s.set(u.element,u),this.identityProvider&&a.set(u.id,{node:u,collapsed:this.tree.hasElement(u)&&this.tree.isCollapsed(u)});const l=[],c=o.map(u=>{const d=!!this.dataSource.hasChildren(u);if(!this.identityProvider){const p=f9({element:u,parent:e,hasChildren:d,defaultCollapseState:this.getDefaultCollapseState(u)});return d&&p.defaultCollapseState===Yl.PreserveOrExpanded&&l.push(p),p}const h=this.identityProvider.getId(u).toString(),f=a.get(h);if(f){const p=f.node;return s.delete(p.element),this.nodes.delete(p.element),this.nodes.set(u,p),p.element=u,p.hasChildren=d,n?f.collapsed?(p.children.forEach(v=>HV(v,m=>this.nodes.delete(m.element))),p.children.splice(0,p.children.length),p.stale=!0):l.push(p):d&&!f.collapsed&&l.push(p),p}const g=f9({element:u,parent:e,id:h,hasChildren:d,defaultCollapseState:this.getDefaultCollapseState(u)});return r&&r.viewState.focus&&r.viewState.focus.indexOf(h)>-1&&r.focus.push(g),r&&r.viewState.selection&&r.viewState.selection.indexOf(h)>-1&&r.selection.push(g),(r&&r.viewState.expanded&&r.viewState.expanded.indexOf(h)>-1||d&&g.defaultCollapseState===Yl.PreserveOrExpanded)&&l.push(g),g});for(const u of s.values())HV(u,d=>this.nodes.delete(d.element));for(const u of c)this.nodes.set(u.element,u);return e.children.splice(0,e.children.length,...c),e!==this.root&&this.autoExpandSingleChildren&&c.length===1&&l.length===0&&(c[0].forceExpanded=!0,l.push(c[0])),l}render(e,t,n){const r=e.children.map(s=>this.asTreeElement(s,t)),o=n&&{...n,diffIdentityProvider:n.diffIdentityProvider&&{getId(s){return n.diffIdentityProvider.getId(s.element)}}};this.tree.setChildren(e===this.root?null:e,r,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 n;return t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1?n=!1:e.forceExpanded?(n=!1,e.forceExpanded=!1):n=e.defaultCollapseState,{element:e,children:e.hasChildren?En.map(e.children,r=>this.asTreeElement(r,t)):[],collapsible:e.hasChildren,collapsed:n}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose(),this.tree.dispose()}}class tY{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 tY(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class UXe{constructor(e,t,n,r){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=n,this.onDidChangeTwistieState=r,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,n,r){this.renderer.renderElement(this.nodeMapper.map(e),t,n.templateData,r)}renderCompressedElements(e,t,n,r){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,n.templateData,r)}renderTwistie(e,t){return e.slow?(t.classList.add(...Wt.asClassNameArray(Xe.treeItemLoading)),!0):(t.classList.remove(...Wt.asClassNameArray(Xe.treeItemLoading)),!1)}disposeElement(e,t,n,r){var o,s;(s=(o=this.renderer).disposeElement)===null||s===void 0||s.call(o,this.nodeMapper.map(e),t,n.templateData,r)}disposeCompressedElements(e,t,n,r){var o,s;(s=(o=this.renderer).disposeCompressedElements)===null||s===void 0||s.call(o,this.compressibleNodeMapperProvider().map(e),t,n.templateData,r)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=si(this.disposables)}}function jXe(i){const e=i&&d0e(i);return e&&{...e,keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getCompressedNodeKeyboardNavigationLabel(t){return i.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(n=>n.element))}}}}class KXe extends h0e{constructor(e,t,n,r,o,s,a={}){super(e,t,n,o,s,a),this.compressionDelegate=r,this.compressibleNodeMapper=new qX(l=>new tY(l)),this.filter=a.filter}createTree(e,t,n,r,o){const s=new YX(n),a=r.map(c=>new UXe(c,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),l=jXe(o)||{};return new u0e(e,t,s,a,l)}asTreeElement(e,t){return{incompressible:this.compressionDelegate.isIncompressible(e.element),...super.asTreeElement(e,t)}}updateOptions(e={}){this.tree.updateOptions(e)}render(e,t,n){if(!this.identityProvider)return super.render(e,t);const r=f=>this.identityProvider.getId(f).toString(),o=f=>{const g=new Set;for(const p of f){const v=this.tree.getCompressedTreeNode(p===this.root?null:p);if(v.element)for(const m of v.element.elements)g.add(r(m.element))}return g},s=o(this.tree.getSelection()),a=o(this.tree.getFocus());super.render(e,t,n);const l=this.getSelection();let c=!1;const u=this.getFocus();let d=!1;const h=f=>{const g=f.element;if(g)for(let p=0;p{const n=this.filter.filter(t,1),r=GXe(n);if(r===2)throw new Error("Recursive tree visibility not supported in async data compressed trees");return r===1})),super.processChildren(e)}}function GXe(i){return typeof i=="boolean"?i?1:0:XX(i)?uI(i.visibility):uI(i)}class qXe extends a0e{constructor(e,t,n,r,o,s={}){super(e,t,n,r,s),this.user=e,this.dataSource=o,this.identityProvider=s.identityProvider}createModel(e,t,n){return new ZX(e,t,n)}}new st("isMac",Ln,w("isMac","Whether the operating system is macOS"));new st("isLinux",Da,w("isLinux","Whether the operating system is Linux"));const o3=new st("isWindows",Rs,w("isWindows","Whether the operating system is Windows")),f0e=new st("isWeb",x_,w("isWeb","Whether the platform is a web browser"));new st("isMacNative",Ln&&!x_,w("isMacNative","Whether the operating system is macOS on a non-browser platform"));new st("isIOS",ch,w("isIOS","Whether the operating system is iOS"));new st("isMobile",cpe,w("isMobile","Whether the platform is a mobile web browser"));new st("isDevelopment",!1,!0);new st("productQualityType","",w("productQualityType","Quality type of VS Code"));const g0e="inputFocus",XXe=new st(g0e,!1,w("inputFocus","Whether keyboard focus is inside an input box"));var Up=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Pi=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const mu=yn("listService");class YXe{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new Te,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}setLastFocusedList(e){var t,n;e!==this._lastFocusedWidget&&((t=this._lastFocusedWidget)===null||t===void 0||t.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,(n=this._lastFocusedWidget)===null||n===void 0||n.getHTMLElement().classList.add("last-focused"))}register(e,t){if(this._hasCreatedStyleController||(this._hasCreatedStyleController=!0,new U_e(gc(),"").style(R_)),this.lists.some(r=>r.widget===e))throw new Error("Cannot register the same widget multiple times");const n={widget:e,extraContextKeys:t};return this.lists.push(n),Mk(e.getHTMLElement())&&this.setLastFocusedList(e),Zu(e.onDidFocus(()=>this.setLastFocusedList(e)),Rt(()=>this.lists.splice(this.lists.indexOf(n),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(r=>r!==n),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)}))}dispose(){this.disposables.dispose()}}const fI=new st("listScrollAtBoundary","none");De.or(fI.isEqualTo("top"),fI.isEqualTo("both"));De.or(fI.isEqualTo("bottom"),fI.isEqualTo("both"));const p0e=new st("listFocus",!0),m0e=new st("treestickyScrollFocused",!1),s3=new st("listSupportsMultiselect",!0),v0e=De.and(p0e,De.not(g0e),m0e.negate()),nY=new st("listHasSelectionOrFocus",!1),iY=new st("listDoubleSelection",!1),rY=new st("listMultiSelection",!1),a3=new st("listSelectionNavigation",!1),ZXe=new st("listSupportsFind",!0),oY=new st("treeElementCanCollapse",!1),QXe=new st("treeElementHasParent",!1),sY=new st("treeElementCanExpand",!1),JXe=new st("treeElementHasChild",!1),eYe=new st("treeFindOpen",!1),_0e="listTypeNavigationMode",b0e="listAutomaticKeyboardNavigation";function l3(i,e){const t=i.createScoped(e.getHTMLElement());return p0e.bindTo(t),t}function c3(i,e){const t=fI.bindTo(i),n=()=>{const r=e.scrollTop===0,o=e.scrollHeight-e.renderHeight-e.scrollTop<1;r&&o?t.set("both"):r?t.set("top"):o?t.set("bottom"):t.set("none")};return n(),e.onDidScroll(n)}const vC="workbench.list.multiSelectModifier",RM="workbench.list.openMode",nu="workbench.list.horizontalScrolling",aY="workbench.list.defaultFindMode",lY="workbench.list.typeNavigationMode",KP="workbench.list.keyboardNavigation",ph="workbench.list.scrollByPage",cY="workbench.list.defaultFindMatchType",gI="workbench.tree.indent",GP="workbench.tree.renderIndentGuides",mh="workbench.list.smoothScrolling",jf="workbench.list.mouseWheelScrollSensitivity",Kf="workbench.list.fastScrollSensitivity",qP="workbench.tree.expandMode",XP="workbench.tree.enableStickyScroll",YP="workbench.tree.stickyScrollMaxItemCount";function Gf(i){return i.getValue(vC)==="alt"}class tYe extends fe{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=Gf(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(vC)&&(this.useAltAsMultipleSelectionModifier=Gf(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:H_e(e)}isSelectionRangeChangeEvent(e){return V_e(e)}}function u3(i,e){var t;const n=i.get(gn),r=i.get(ci),o=new Te;return[{...e,keyboardNavigationDelegate:{mightProducePrintableCharacter(a){return r.mightProducePrintableCharacter(a)}},smoothScrolling:!!n.getValue(mh),mouseWheelScrollSensitivity:n.getValue(jf),fastScrollSensitivity:n.getValue(Kf),multipleSelectionController:(t=e.multipleSelectionController)!==null&&t!==void 0?t:o.add(new tYe(n)),keyboardNavigationEventFilter:rYe(r),scrollByPage:!!n.getValue(ph)},o]}let VV=class extends wc{constructor(e,t,n,r,o,s,a,l,c){const u=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(nu),[d,h]=c.invokeFunction(u3,o);super(e,t,n,r,{keyboardSupport:!1,...d,horizontalScrolling:u}),this.disposables.add(h),this.contextKeyService=l3(s,this),this.disposables.add(c3(this.contextKeyService,this)),this.listSupportsMultiSelect=s3.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),a3.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this.listHasSelectionOrFocus=nY.bindTo(this.contextKeyService),this.listDoubleSelection=iY.bindTo(this.contextKeyService),this.listMultiSelection=rY.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=Gf(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const g=this.getSelection(),p=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(g.length>0||p.length>0),this.listMultiSelection.set(g.length>1),this.listDoubleSelection.set(g.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const g=this.getSelection(),p=this.getFocus();this.listHasSelectionOrFocus.set(g.length>0||p.length>0)})),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(vC)&&(this._useAltAsMultipleSelectionModifier=Gf(l));let p={};if(g.affectsConfiguration(nu)&&this.horizontalScrolling===void 0){const v=!!l.getValue(nu);p={...p,horizontalScrolling:v}}if(g.affectsConfiguration(ph)){const v=!!l.getValue(ph);p={...p,scrollByPage:v}}if(g.affectsConfiguration(mh)){const v=!!l.getValue(mh);p={...p,smoothScrolling:v}}if(g.affectsConfiguration(jf)){const v=l.getValue(jf);p={...p,mouseWheelScrollSensitivity:v}}if(g.affectsConfiguration(Kf)){const v=l.getValue(Kf);p={...p,fastScrollSensitivity:v}}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new C0e(this,{configurationService:l,...o}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?RS(e):R_)}};VV=Up([Pi(5,Vt),Pi(6,mu),Pi(7,gn),Pi(8,Ot)],VV);let cse=class extends Jqe{constructor(e,t,n,r,o,s,a,l,c){const u=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(nu),[d,h]=c.invokeFunction(u3,o);super(e,t,n,r,{keyboardSupport:!1,...d,horizontalScrolling:u}),this.disposables=new Te,this.disposables.add(h),this.contextKeyService=l3(s,this),this.disposables.add(c3(this.contextKeyService,this.widget)),this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=s3.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),a3.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this._useAltAsMultipleSelectionModifier=Gf(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(vC)&&(this._useAltAsMultipleSelectionModifier=Gf(l));let p={};if(g.affectsConfiguration(nu)&&this.horizontalScrolling===void 0){const v=!!l.getValue(nu);p={...p,horizontalScrolling:v}}if(g.affectsConfiguration(ph)){const v=!!l.getValue(ph);p={...p,scrollByPage:v}}if(g.affectsConfiguration(mh)){const v=!!l.getValue(mh);p={...p,smoothScrolling:v}}if(g.affectsConfiguration(jf)){const v=l.getValue(jf);p={...p,mouseWheelScrollSensitivity:v}}if(g.affectsConfiguration(Kf)){const v=l.getValue(Kf);p={...p,fastScrollSensitivity:v}}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new C0e(this,{configurationService:l,...o}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?RS(e):R_)}dispose(){this.disposables.dispose(),super.dispose()}};cse=Up([Pi(5,Vt),Pi(6,mu),Pi(7,gn),Pi(8,Ot)],cse);let use=class extends J_e{constructor(e,t,n,r,o,s,a,l,c,u){const d=typeof s.horizontalScrolling<"u"?s.horizontalScrolling:!!c.getValue(nu),[h,f]=u.invokeFunction(u3,s);super(e,t,n,r,o,{keyboardSupport:!1,...h,horizontalScrolling:d}),this.disposables.add(f),this.contextKeyService=l3(a,this),this.disposables.add(c3(this.contextKeyService,this)),this.listSupportsMultiSelect=s3.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(s.multipleSelectionSupport!==!1),a3.bindTo(this.contextKeyService).set(!!s.selectionNavigation),this.listHasSelectionOrFocus=nY.bindTo(this.contextKeyService),this.listDoubleSelection=iY.bindTo(this.contextKeyService),this.listMultiSelection=rY.bindTo(this.contextKeyService),this.horizontalScrolling=s.horizontalScrolling,this._useAltAsMultipleSelectionModifier=Gf(c),this.disposables.add(this.contextKeyService),this.disposables.add(l.register(this)),this.updateStyles(s.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const p=this.getSelection(),v=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(p.length>0||v.length>0),this.listMultiSelection.set(p.length>1),this.listDoubleSelection.set(p.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const p=this.getSelection(),v=this.getFocus();this.listHasSelectionOrFocus.set(p.length>0||v.length>0)})),this.disposables.add(c.onDidChangeConfiguration(p=>{p.affectsConfiguration(vC)&&(this._useAltAsMultipleSelectionModifier=Gf(c));let v={};if(p.affectsConfiguration(nu)&&this.horizontalScrolling===void 0){const m=!!c.getValue(nu);v={...v,horizontalScrolling:m}}if(p.affectsConfiguration(ph)){const m=!!c.getValue(ph);v={...v,scrollByPage:m}}if(p.affectsConfiguration(mh)){const m=!!c.getValue(mh);v={...v,smoothScrolling:m}}if(p.affectsConfiguration(jf)){const m=c.getValue(jf);v={...v,mouseWheelScrollSensitivity:m}}if(p.affectsConfiguration(Kf)){const m=c.getValue(Kf);v={...v,fastScrollSensitivity:m}}Object.keys(v).length>0&&this.updateOptions(v)})),this.navigator=new nYe(this,{configurationService:c,...s}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?RS(e):R_)}dispose(){this.disposables.dispose(),super.dispose()}};use=Up([Pi(6,Vt),Pi(7,mu),Pi(8,gn),Pi(9,Ot)],use);class uY extends fe{constructor(e,t){var n;super(),this.widget=e,this._onDidOpen=this._register(new se),this.onDidOpen=this._onDidOpen.event,this._register(Je.filter(this.widget.onDidChangeSelection,r=>kq(r.browserEvent))(r=>this.onSelectionFromKeyboard(r))),this._register(this.widget.onPointer(r=>this.onPointer(r.element,r.browserEvent))),this._register(this.widget.onMouseDblClick(r=>this.onMouseDblClick(r.element,r.browserEvent))),typeof(t==null?void 0:t.openOnSingleClick)!="boolean"&&(t!=null&&t.configurationService)?(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(RM))!=="doubleClick",this._register(t==null?void 0:t.configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration(RM)&&(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(RM))!=="doubleClick")}))):this.openOnSingleClick=(n=t==null?void 0:t.openOnSingleClick)!==null&&n!==void 0?n:!0}onSelectionFromKeyboard(e){if(e.elements.length!==1)return;const t=e.browserEvent,n=typeof t.preserveFocus=="boolean"?t.preserveFocus:!0,r=typeof t.pinned=="boolean"?t.pinned:!n,o=!1;this._open(this.getSelectedElement(),n,r,o,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick||t.detail===2)return;const r=t.button===1,o=!0,s=r,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,s,a,t)}onMouseDblClick(e,t){if(!t)return;const n=t.target;if(n.classList.contains("monaco-tl-twistie")||n.classList.contains("monaco-icon-label")&&n.classList.contains("folder-icon")&&t.offsetX<16)return;const o=!1,s=!0,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,s,a,t)}_open(e,t,n,r,o){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:n,revealIfVisible:!0},sideBySide:r,element:e,browserEvent:o})}}class C0e extends uY{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class nYe extends uY{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class iYe extends uY{constructor(e,t){super(e,t)}getSelectedElement(){var e;return(e=this.widget.getSelection()[0])!==null&&e!==void 0?e:void 0}}function rYe(i){let e=!1;return t=>{if(t.toKeyCodeChord().isModifierKey())return!1;if(e)return e=!1,!1;const n=i.softDispatch(t,t.target);return n.kind===1?(e=!0,!1):(e=!1,n.kind===0)}}let dse=class extends JX{constructor(e,t,n,r,o,s,a,l,c){const{options:u,getTypeNavigationMode:d,disposable:h}=s.invokeFunction(Jk,o);super(e,t,n,r,u),this.disposables.add(h),this.internals=new Fb(this,o,d,o.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};dse=Up([Pi(5,Ot),Pi(6,Vt),Pi(7,mu),Pi(8,gn)],dse);let hse=class extends u0e{constructor(e,t,n,r,o,s,a,l,c){const{options:u,getTypeNavigationMode:d,disposable:h}=s.invokeFunction(Jk,o);super(e,t,n,r,u),this.disposables.add(h),this.internals=new Fb(this,o,d,o.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};hse=Up([Pi(5,Ot),Pi(6,Vt),Pi(7,mu),Pi(8,gn)],hse);let fse=class extends qXe{constructor(e,t,n,r,o,s,a,l,c,u){const{options:d,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(Jk,s);super(e,t,n,r,o,d),this.disposables.add(f),this.internals=new Fb(this,s,h,s.overrideStyles,l,c,u),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles!==void 0&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};fse=Up([Pi(6,Ot),Pi(7,Vt),Pi(8,mu),Pi(9,gn)],fse);let zV=class extends h0e{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,n,r,o,s,a,l,c,u){const{options:d,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(Jk,s);super(e,t,n,r,o,d),this.disposables.add(f),this.internals=new Fb(this,s,h,s.overrideStyles,l,c,u),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};zV=Up([Pi(6,Ot),Pi(7,Vt),Pi(8,mu),Pi(9,gn)],zV);let gse=class extends KXe{constructor(e,t,n,r,o,s,a,l,c,u,d){const{options:h,getTypeNavigationMode:f,disposable:g}=l.invokeFunction(Jk,a);super(e,t,n,r,o,s,h),this.disposables.add(g),this.internals=new Fb(this,a,f,a.overrideStyles,c,u,d),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};gse=Up([Pi(7,Ot),Pi(8,Vt),Pi(9,mu),Pi(10,gn)],gse);function y0e(i){const e=i.getValue(aY);if(e==="highlight")return sp.Highlight;if(e==="filter")return sp.Filter;const t=i.getValue(KP);if(t==="simple"||t==="highlight")return sp.Highlight;if(t==="filter")return sp.Filter}function w0e(i){const e=i.getValue(cY);if(e==="fuzzy")return Ob.Fuzzy;if(e==="contiguous")return Ob.Contiguous}function Jk(i,e){var t;const n=i.get(gn),r=i.get(ng),o=i.get(Vt),s=i.get(Ot),a=()=>{const f=o.getContextKeyValue(_0e);if(f==="automatic")return pf.Automatic;if(f==="trigger"||o.getContextKeyValue(b0e)===!1)return pf.Trigger;const p=n.getValue(lY);if(p==="automatic")return pf.Automatic;if(p==="trigger")return pf.Trigger},l=e.horizontalScrolling!==void 0?e.horizontalScrolling:!!n.getValue(nu),[c,u]=s.invokeFunction(u3,e),d=e.paddingBottom,h=e.renderIndentGuides!==void 0?e.renderIndentGuides:n.getValue(GP);return{getTypeNavigationMode:a,disposable:u,options:{keyboardSupport:!1,...c,indent:typeof n.getValue(gI)=="number"?n.getValue(gI):void 0,renderIndentGuides:h,smoothScrolling:!!n.getValue(mh),defaultFindMode:y0e(n),defaultFindMatchType:w0e(n),horizontalScrolling:l,scrollByPage:!!n.getValue(ph),paddingBottom:d,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:(t=e.expandOnlyOnTwistieClick)!==null&&t!==void 0?t:n.getValue(qP)==="doubleClick",contextViewProvider:r,findWidgetStyles:Aqe,enableStickyScroll:!!n.getValue(XP),stickyScrollMaxItemCount:Number(n.getValue(YP))}}}let Fb=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,n,r,o,s,a){var l;this.tree=e,this.disposables=[],this.contextKeyService=l3(o,e),this.disposables.push(c3(this.contextKeyService,e)),this.listSupportsMultiSelect=s3.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),a3.bindTo(this.contextKeyService).set(!!t.selectionNavigation),this.listSupportFindWidget=ZXe.bindTo(this.contextKeyService),this.listSupportFindWidget.set((l=t.findWidgetEnabled)!==null&&l!==void 0?l:!0),this.hasSelectionOrFocus=nY.bindTo(this.contextKeyService),this.hasDoubleSelection=iY.bindTo(this.contextKeyService),this.hasMultiSelection=rY.bindTo(this.contextKeyService),this.treeElementCanCollapse=oY.bindTo(this.contextKeyService),this.treeElementHasParent=QXe.bindTo(this.contextKeyService),this.treeElementCanExpand=sY.bindTo(this.contextKeyService),this.treeElementHasChild=JXe.bindTo(this.contextKeyService),this.treeFindOpen=eYe.bindTo(this.contextKeyService),this.treeStickyScrollFocused=m0e.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=Gf(a),this.updateStyleOverrides(r);const u=()=>{const h=e.getFocus()[0];if(!h)return;const f=e.getNode(h);this.treeElementCanCollapse.set(f.collapsible&&!f.collapsed),this.treeElementHasParent.set(!!e.getParentElement(h)),this.treeElementCanExpand.set(f.collapsible&&f.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(h))},d=new Set;d.add(_0e),d.add(b0e),this.disposables.push(this.contextKeyService,s.register(e),e.onDidChangeSelection(()=>{const h=e.getSelection(),f=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(h.length>0||f.length>0),this.hasMultiSelection.set(h.length>1),this.hasDoubleSelection.set(h.length===2)})}),e.onDidChangeFocus(()=>{const h=e.getSelection(),f=e.getFocus();this.hasSelectionOrFocus.set(h.length>0||f.length>0),u()}),e.onDidChangeCollapseState(u),e.onDidChangeModel(u),e.onDidChangeFindOpenState(h=>this.treeFindOpen.set(h)),e.onDidChangeStickyScrollFocused(h=>this.treeStickyScrollFocused.set(h)),a.onDidChangeConfiguration(h=>{let f={};if(h.affectsConfiguration(vC)&&(this._useAltAsMultipleSelectionModifier=Gf(a)),h.affectsConfiguration(gI)){const g=a.getValue(gI);f={...f,indent:g}}if(h.affectsConfiguration(GP)&&t.renderIndentGuides===void 0){const g=a.getValue(GP);f={...f,renderIndentGuides:g}}if(h.affectsConfiguration(mh)){const g=!!a.getValue(mh);f={...f,smoothScrolling:g}}if(h.affectsConfiguration(aY)||h.affectsConfiguration(KP)){const g=y0e(a);f={...f,defaultFindMode:g}}if(h.affectsConfiguration(lY)||h.affectsConfiguration(KP)){const g=n();f={...f,typeNavigationMode:g}}if(h.affectsConfiguration(cY)){const g=w0e(a);f={...f,defaultFindMatchType:g}}if(h.affectsConfiguration(nu)&&t.horizontalScrolling===void 0){const g=!!a.getValue(nu);f={...f,horizontalScrolling:g}}if(h.affectsConfiguration(ph)){const g=!!a.getValue(ph);f={...f,scrollByPage:g}}if(h.affectsConfiguration(qP)&&t.expandOnlyOnTwistieClick===void 0&&(f={...f,expandOnlyOnTwistieClick:a.getValue(qP)==="doubleClick"}),h.affectsConfiguration(XP)){const g=a.getValue(XP);f={...f,enableStickyScroll:g}}if(h.affectsConfiguration(YP)){const g=Math.max(1,a.getValue(YP));f={...f,stickyScrollMaxItemCount:g}}if(h.affectsConfiguration(jf)){const g=a.getValue(jf);f={...f,mouseWheelScrollSensitivity:g}}if(h.affectsConfiguration(Kf)){const g=a.getValue(Kf);f={...f,fastScrollSensitivity:g}}Object.keys(f).length>0&&e.updateOptions(f)}),this.contextKeyService.onDidChangeContext(h=>{h.affectsSome(d)&&e.updateOptions({typeNavigationMode:n()})})),this.navigator=new iYe(e,{configurationService:a,...t}),this.disposables.push(this.navigator)}updateOptions(e){e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){this.tree.style(e?RS(e):R_)}dispose(){this.disposables=si(this.disposables)}};Fb=Up([Pi(4,Vt),Pi(5,mu),Pi(6,gn)],Fb);const oYe=ar.as(xh.Configuration);oYe.registerConfiguration({id:"workbench",order:7,title:w("workbenchConfigurationTitle","Workbench"),type:"object",properties:{[vC]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[w("multiSelectModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),w("multiSelectModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:w({key:"multiSelectModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.")},[RM]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:w({key:"openModeModifier",comment:["`singleClick` and `doubleClick` refers to a value the setting can take and should not be localized."]},"Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[nu]:{type:"boolean",default:!1,description:w("horizontalScrolling setting","Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[ph]:{type:"boolean",default:!1,description:w("list.scrollByPage","Controls whether clicks in the scrollbar scroll page by page.")},[gI]:{type:"number",default:8,minimum:4,maximum:40,description:w("tree indent setting","Controls tree indentation in pixels.")},[GP]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:w("render tree indent guides","Controls whether the tree should render indent guides.")},[mh]:{type:"boolean",default:!1,description:w("list smoothScrolling setting","Controls whether lists and trees have smooth scrolling.")},[jf]:{type:"number",default:1,markdownDescription:w("Mouse Wheel Scroll Sensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[Kf]:{type:"number",default:5,markdownDescription:w("Fast Scroll Sensitivity","Scrolling speed multiplier when pressing `Alt`.")},[aY]:{type:"string",enum:["highlight","filter"],enumDescriptions:[w("defaultFindModeSettingKey.highlight","Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),w("defaultFindModeSettingKey.filter","Filter elements when searching.")],default:"highlight",description:w("defaultFindModeSettingKey","Controls the default find mode for lists and trees in the workbench.")},[KP]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[w("keyboardNavigationSettingKey.simple","Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),w("keyboardNavigationSettingKey.highlight","Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),w("keyboardNavigationSettingKey.filter","Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:w("keyboardNavigationSettingKey","Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:w("keyboardNavigationSettingKeyDeprecated","Please use 'workbench.list.defaultFindMode' and 'workbench.list.typeNavigationMode' instead.")},[cY]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[w("defaultFindMatchTypeSettingKey.fuzzy","Use fuzzy matching when searching."),w("defaultFindMatchTypeSettingKey.contiguous","Use contiguous matching when searching.")],default:"fuzzy",description:w("defaultFindMatchTypeSettingKey","Controls the type of matching used when searching lists and trees in the workbench.")},[qP]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:w("expand mode","Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[XP]:{type:"boolean",default:!0,description:w("sticky scroll","Controls whether sticky scrolling is enabled in trees.")},[YP]:{type:"number",minimum:1,default:7,markdownDescription:w("sticky scroll maximum items","Controls the number of sticky elements displayed in the tree when `#workbench.tree.enableStickyScroll#` is enabled.")},[lY]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:w("typeNavigationMode2","Controls how type navigation works in lists and trees in the workbench. When set to `trigger`, type navigation begins once the `list.triggerTypeNavigation` command is run.")}}});var UV;(function(i){i[i.PRESERVE=0]="PRESERVE",i[i.LAST=1]="LAST"})(UV||(UV={}));const _C={Quickaccess:"workbench.contributions.quickaccess"};class sYe{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return e.prefix.length===0?this.defaultProvider=e:this.providers.push(e),this.providers.sort((t,n)=>n.prefix.length-t.prefix.length),Rt(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return lh([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(n=>e.startsWith(n.prefix))||void 0||this.defaultProvider}}ar.add(_C.Quickaccess,new sYe);const aYe={ctrlCmd:!1,alt:!1};var pI;(function(i){i[i.Blur=1]="Blur",i[i.Gesture=2]="Gesture",i[i.Other=3]="Other"})(pI||(pI={}));var Md;(function(i){i[i.NONE=0]="NONE",i[i.FIRST=1]="FIRST",i[i.SECOND=2]="SECOND",i[i.LAST=3]="LAST"})(Md||(Md={}));const Eh=yn("quickInputService");var lYe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},pse=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let jV=class extends fe{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=ar.as(_C.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,n){var r;const[o,s]=this.getOrInstantiateProvider(e),a=this.visibleQuickAccess,l=a==null?void 0:a.descriptor;if(a&&s&&l===s){e!==s.prefix&&!(n!=null&&n.preserveValue)&&(a.picker.value=e),this.adjustValueSelection(a.picker,s,n);return}if(s&&!(n!=null&&n.preserveValue)){let f;if(a&&l&&l!==s){const g=a.value.substr(l.prefix.length);g&&(f=`${s.prefix}${g}`)}if(!f){const g=o==null?void 0:o.defaultFilterValue;g===UV.LAST?f=this.lastAcceptedPickerValues.get(s):typeof g=="string"&&(f=`${s.prefix}${g}`)}typeof f=="string"&&(e=f)}const c=new Te,u=c.add(this.quickInputService.createQuickPick());u.value=e,this.adjustValueSelection(u,s,n),u.placeholder=s==null?void 0:s.placeholder,u.quickNavigate=n==null?void 0:n.quickNavigateConfiguration,u.hideInput=!!u.quickNavigate&&!a,(typeof(n==null?void 0:n.itemActivation)=="number"||n!=null&&n.quickNavigateConfiguration)&&(u.itemActivation=(r=n==null?void 0:n.itemActivation)!==null&&r!==void 0?r:Md.SECOND),u.contextKey=s==null?void 0:s.contextKey,u.filterValue=f=>f.substring(s?s.prefix.length:0);let d;t&&(d=new a4,c.add(Je.once(u.onWillAccept)(f=>{f.veto(),u.hide()}))),c.add(this.registerPickerListeners(u,o,s,e,n==null?void 0:n.providerOptions));const h=c.add(new wr);if(o&&c.add(o.provide(u,h.token,n==null?void 0:n.providerOptions)),Je.once(u.onDidHide)(()=>{u.selectedItems.length===0&&h.cancel(),c.dispose(),d==null||d.complete(u.selectedItems.slice(0))}),u.show(),t)return d==null?void 0:d.p}adjustValueSelection(e,t,n){var r;let o;n!=null&&n.preserveValue?o=[e.value.length,e.value.length]:o=[(r=t==null?void 0:t.prefix.length)!==null&&r!==void 0?r:0,e.value.length],e.valueSelection=o}registerPickerListeners(e,t,n,r,o){const s=new Te,a=this.visibleQuickAccess={picker:e,descriptor:n,value:r};return s.add(Rt(()=>{a===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),s.add(e.onDidChangeValue(l=>{const[c]=this.getOrInstantiateProvider(l);c!==t?this.show(l,{preserveValue:!0,providerOptions:o}):a.value=l})),n&&s.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(n,e.value)})),s}getOrInstantiateProvider(e){const t=this.registry.getQuickAccessProvider(e);if(!t)return[void 0,void 0];let n=this.mapProviderToDescriptor.get(t);return n||(n=this.instantiationService.createInstance(t.ctor),this.mapProviderToDescriptor.set(t,n)),[n,t]}};jV=lYe([pse(0,Eh),pse(1,Ot)],jV);class Lv{constructor(e,t){var n;this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=(n=t==null?void 0:t.supportIcons)!==null&&n!==void 0?n:!1,this.domNode=ke(e,He("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],n="",r){e||(e=""),r&&(e=Lv.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===n&&dc(this.highlights,t))&&(this.text=e,this.title=n,this.highlights=t,this.render())}render(){const e=[];let t=0;for(const n of this.highlights){if(n.end===n.start)continue;if(t{r=o===`\r -`?-1:0,s+=n;for(const a of t)a.end<=s||(a.start>=s&&(a.start+=r),a.end>=s&&(a.end+=r));return n+=r,"⏎"})}}class jx{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 ZP extends fe{constructor(e,t){var n;super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new jx(ke(e,He(".monaco-icon-label")))),this.labelContainer=ke(this.domNode.element,He(".monaco-icon-label-container")),this.nameContainer=ke(this.labelContainer,He("span.monaco-icon-name-container")),t!=null&&t.supportHighlights||t!=null&&t.supportIcons?this.nameNode=new dYe(this.nameContainer,!!t.supportIcons):this.nameNode=new cYe(this.nameContainer),this.hoverDelegate=(n=t==null?void 0:t.hoverDelegate)!==null&&n!==void 0?n:Vp("mouse")}get element(){return this.domNode.element}setLabel(e,t,n){var r;const o=["monaco-icon-label"],s=["monaco-icon-label-container"];let a="";if(n&&(n.extraClasses&&o.push(...n.extraClasses),n.italic&&o.push("italic"),n.strikethrough&&o.push("strikethrough"),n.disabledCommand&&s.push("disabled"),n.title&&(typeof n.title=="string"?a+=n.title:a+=e)),this.domNode.className=o.join(" "),this.domNode.element.setAttribute("aria-label",a),this.labelContainer.className=s.join(" "),this.setupHover(n!=null&&n.descriptionTitle?this.labelContainer:this.element,n==null?void 0:n.title),this.nameNode.setLabel(e,n),t||this.descriptionNode){const l=this.getOrCreateDescriptionNode();l instanceof Lv?(l.set(t||"",n?n.descriptionMatches:void 0,void 0,n==null?void 0:n.labelEscapeNewLines),this.setupHover(l.element,n==null?void 0:n.descriptionTitle)):(l.textContent=t&&(n!=null&&n.labelEscapeNewLines)?Lv.escapeNewLines(t,[]):t||"",this.setupHover(l.element,(n==null?void 0:n.descriptionTitle)||""),l.empty=!t)}if(n!=null&&n.suffix||this.suffixNode){const l=this.getOrCreateSuffixNode();l.textContent=(r=n==null?void 0:n.suffix)!==null&&r!==void 0?r:""}}setupHover(e,t){const n=this.customHovers.get(e);if(n&&(n.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}if(this.hoverDelegate.showNativeHover)qGe(e,t);else{const r=mC(this.hoverDelegate,e,t);r&&this.customHovers.set(e,r)}}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateSuffixNode(){if(!this.suffixNode){const e=this._register(new jx(s8e(this.nameContainer,He("span.monaco-icon-suffix-container"))));this.suffixNode=this._register(new jx(ke(e.element,He("span.label-suffix"))))}return this.suffixNode}getOrCreateDescriptionNode(){var e;if(!this.descriptionNode){const t=this._register(new jx(ke(this.labelContainer,He("span.monaco-icon-description-container"))));!((e=this.creationOptions)===null||e===void 0)&&e.supportDescriptionHighlights?this.descriptionNode=new Lv(ke(t.element,He("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons}):this.descriptionNode=this._register(new jx(ke(t.element,He("span.label-description"))))}return this.descriptionNode}}class cYe{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&dc(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=ke(this.container,He("a.label-name",{id:t==null?void 0:t.domId}))),this.singleLabel.textContent=e;else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let n=0;n{const o={start:n,end:n+r.length},s=t.map(a=>xs.intersect(o,a)).filter(a=>!xs.isEmpty(a)).map(({start:a,end:l})=>({start:a-n,end:l-n}));return n=o.end+e.length,s})}class dYe{constructor(e,t){this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&dc(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=new Lv(ke(this.container,He("a.label-name",{id:t==null?void 0:t.domId})),{supportIcons:this.supportIcons})),this.singleLabel.set(e,t==null?void 0:t.matches,void 0,t==null?void 0:t.labelEscapeNewLines);else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;const n=(t==null?void 0:t.separator)||"/",r=uYe(e,n,t==null?void 0:t.matches);for(let o=0;o{const i=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:i,collatorIsNumeric:i.resolvedOptions().numeric}});function hYe(i,e,t=!1){const n=i||"",r=e||"",o=mse.value.collator.compare(n,r);return mse.value.collatorIsNumeric&&o===0&&n!==r?nr.length)return 1}return 0}var pYe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o};class x0e{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}}pYe([Rr],x0e.prototype,"toString",null);const mYe=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function vYe(i){const e=[];let t=0,n;for(;n=mYe.exec(i);){n.index-t>0&&e.push(i.substring(t,n.index));const[,r,o,,s]=n;s?e.push({label:r,href:o,title:s}):e.push({label:r,href:o}),t=n.index+n[0].length}return t{i8e(f)&&hn.stop(f,!0),t.callback(o.href)},c=t.disposables.add(new wn(a,Ge.CLICK)).event,u=t.disposables.add(new wn(a,Ge.KEY_DOWN)).event,d=Je.chain(u,f=>f.filter(g=>{const p=new Ai(g);return p.equals(10)||p.equals(3)}));t.disposables.add(wi.addTarget(a));const h=t.disposables.add(new wn(a,Si.Tap)).event;Je.any(c,h,d)(l,null,t.disposables),e.appendChild(a)}}var L0e=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o};const xd=He;class yYe{constructor(e,t,n,r,o,s,a){var l,c,u;this._checked=!1,this._hidden=!1,this.hasCheckbox=r,this.index=n,this.fireButtonTriggered=o,this.fireSeparatorButtonTriggered=s,this._onChecked=a,this.onChecked=r?Je.map(Je.filter(this._onChecked.event,d=>d.listElement===this),d=>d.checked):Je.None,e.type==="separator"?this._separator=e:(this.item=e,t&&t.type==="separator"&&!t.buttons&&(this._separator=t),this.saneDescription=this.item.description,this.saneDetail=this.item.detail,this._labelHighlights=(l=this.item.highlights)===null||l===void 0?void 0:l.label,this._descriptionHighlights=(c=this.item.highlights)===null||c===void 0?void 0:c.description,this._detailHighlights=(u=this.item.highlights)===null||u===void 0?void 0:u.detail,this.saneTooltip=this.item.tooltip),this._init=new Qf(()=>{var d;const h=(d=e.label)!==null&&d!==void 0?d:"",f=OL(h).text.trim(),g=e.ariaLabel||[h,this.saneDescription,this.saneDetail].map(p=>TKe(p)).filter(p=>!!p).join(", ");return{saneLabel:h,saneSortLabel:f,saneAriaLabel:g}})}get saneLabel(){return this._init.value.saneLabel}get saneSortLabel(){return this._init.value.saneSortLabel}get saneAriaLabel(){return this._init.value.saneAriaLabel}get element(){return this._element}set element(e){this._element=e}get hidden(){return this._hidden}set hidden(e){this._hidden=e}get checked(){return this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire({listElement:this,checked:e}))}get separator(){return this._separator}set separator(e){this._separator=e}get labelHighlights(){return this._labelHighlights}set labelHighlights(e){this._labelHighlights=e}get descriptionHighlights(){return this._descriptionHighlights}set descriptionHighlights(e){this._descriptionHighlights=e}get detailHighlights(){return this._detailHighlights}set detailHighlights(e){this._detailHighlights=e}}class eT{constructor(e,t){this.themeService=e,this.hoverDelegate=t}get templateId(){return eT.ID}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=[],t.toDisposeTemplate=[],t.entry=ke(e,xd(".quick-input-list-entry"));const n=ke(t.entry,xd("label.quick-input-list-label"));t.toDisposeTemplate.push(Sr(n,Ge.CLICK,c=>{t.checkbox.offsetParent||c.preventDefault()})),t.checkbox=ke(n,xd("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(Sr(t.checkbox,Ge.CHANGE,c=>{t.element.checked=t.checkbox.checked}));const r=ke(n,xd(".quick-input-list-rows")),o=ke(r,xd(".quick-input-list-row")),s=ke(r,xd(".quick-input-list-row"));t.label=new ZP(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.push(t.label),t.icon=Tq(t.label.element,xd(".quick-input-list-icon"));const a=ke(o,xd(".quick-input-list-entry-keybinding"));t.keybinding=new PS(a,yl);const l=ke(s,xd(".quick-input-list-label-meta"));return t.detail=new ZP(l,{supportHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.push(t.detail),t.separator=ke(t.entry,xd(".quick-input-list-separator")),t.actionBar=new au(t.entry,this.hoverDelegate?{hoverDelegate:this.hoverDelegate}:void 0),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.push(t.actionBar),t}renderElement(e,t,n){var r,o,s,a;n.element=e,e.element=(r=n.entry)!==null&&r!==void 0?r:void 0;const l=e.item?e.item:e.separator;n.checkbox.checked=e.checked,n.toDisposeElement.push(e.onChecked(p=>n.checkbox.checked=p));const{labelHighlights:c,descriptionHighlights:u,detailHighlights:d}=e;if(!((o=e.item)===null||o===void 0)&&o.iconPath){const p=Pw(this.themeService.getColorTheme().type)?e.item.iconPath.dark:(s=e.item.iconPath.light)!==null&&s!==void 0?s:e.item.iconPath.dark,v=At.revive(p);n.icon.className="quick-input-list-icon",n.icon.style.backgroundImage=Gv(v)}else n.icon.style.backgroundImage="",n.icon.className=!((a=e.item)===null||a===void 0)&&a.iconClass?`quick-input-list-icon ${e.item.iconClass}`:"";let h;!e.saneTooltip&&e.saneDescription&&(h={markdown:{value:e.saneDescription,supportThemeIcons:!0},markdownNotSupportedFallback:e.saneDescription});const f={matches:c||[],descriptionTitle:h,descriptionMatches:u||[],labelEscapeNewLines:!0};if(l.type!=="separator"?(f.extraClasses=l.iconClasses,f.italic=l.italic,f.strikethrough=l.strikethrough,n.entry.classList.remove("quick-input-list-separator-as-item")):n.entry.classList.add("quick-input-list-separator-as-item"),n.label.setLabel(e.saneLabel,e.saneDescription,f),n.keybinding.set(l.type==="separator"?void 0:l.keybinding),e.saneDetail){let p;e.saneTooltip||(p={markdown:{value:e.saneDetail,supportThemeIcons:!0},markdownNotSupportedFallback:e.saneDetail}),n.detail.element.style.display="",n.detail.setLabel(e.saneDetail,void 0,{matches:d,title:p,labelEscapeNewLines:!0})}else n.detail.element.style.display="none";e.item&&e.separator&&e.separator.label?(n.separator.textContent=e.separator.label,n.separator.style.display=""):n.separator.style.display="none",n.entry.classList.toggle("quick-input-list-separator-border",!!e.separator);const g=l.buttons;g&&g.length?(n.actionBar.push(g.map((p,v)=>KV(p,`id-${v}`,()=>l.type!=="separator"?e.fireButtonTriggered({button:p,item:l}):e.fireSeparatorButtonTriggered({button:p,separator:l}))),{icon:!0,label:!1}),n.entry.classList.add("has-actions")):n.entry.classList.remove("has-actions")}disposeElement(e,t,n){n.toDisposeElement=si(n.toDisposeElement),n.actionBar.clear()}disposeTemplate(e){e.toDisposeElement=si(e.toDisposeElement),e.toDisposeTemplate=si(e.toDisposeTemplate)}}eT.ID="listelement";class wYe{getHeight(e){return e.item?e.saneDetail?44:22:24}getTemplateId(e){return eT.ID}}var Fo;(function(i){i[i.First=1]="First",i[i.Second=2]="Second",i[i.Last=3]="Last",i[i.Next=4]="Next",i[i.Previous=5]="Previous",i[i.NextPage=6]="NextPage",i[i.PreviousPage=7]="PreviousPage"})(Fo||(Fo={}));class dY{constructor(e,t,n,r){this.parent=e,this.options=n,this.inputElements=[],this.elements=[],this.elementsToIndexes=new Map,this.matchOnDescription=!1,this.matchOnDetail=!1,this.matchOnLabel=!0,this.matchOnLabelMode="fuzzy",this.sortByLabel=!0,this._onChangedAllVisibleChecked=new se,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new se,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new se,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new se,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new se,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new se,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._onKeyDown=new se,this.onKeyDown=this._onKeyDown.event,this._onLeave=new se,this.onLeave=this._onLeave.event,this._listElementChecked=new se,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=ke(this.parent,xd(".quick-input-list"));const o=new wYe,s=new LYe;this.list=n.createList("QuickInput",this.container,o,[new eT(r,n.hoverDelegate)],{identityProvider:{getId:l=>{var c,u,d,h,f,g,p,v;return(v=(g=(h=(u=(c=l.item)===null||c===void 0?void 0:c.id)!==null&&u!==void 0?u:(d=l.item)===null||d===void 0?void 0:d.label)!==null&&h!==void 0?h:(f=l.separator)===null||f===void 0?void 0:f.id)!==null&&g!==void 0?g:(p=l.separator)===null||p===void 0?void 0:p.label)!==null&&v!==void 0?v:""}},setRowLineHeight:!1,multipleSelectionSupport:!1,horizontalScrolling:!1,accessibilityProvider:s}),this.list.getHTMLElement().id=t,this.disposables.push(this.list),this.disposables.push(this.list.onKeyDown(l=>{const c=new Ai(l);switch(c.keyCode){case 10:this.toggleCheckbox();break;case 31:(Ln?l.metaKey:l.ctrlKey)&&this.list.setFocus(la(this.list.length));break;case 16:{const u=this.list.getFocus();u.length===1&&u[0]===0&&this._onLeave.fire();break}case 18:{const u=this.list.getFocus();u.length===1&&u[0]===this.list.length-1&&this._onLeave.fire();break}}this._onKeyDown.fire(c)})),this.disposables.push(this.list.onMouseDown(l=>{l.browserEvent.button!==2&&l.browserEvent.preventDefault()})),this.disposables.push(ye(this.container,Ge.CLICK,l=>{(l.x||l.y)&&this._onLeave.fire()})),this.disposables.push(this.list.onMouseMiddleClick(l=>{this._onLeave.fire()})),this.disposables.push(this.list.onContextMenu(l=>{typeof l.index=="number"&&(l.browserEvent.preventDefault(),this.list.setSelection([l.index]))}));const a=new zpe(n.hoverDelegate.delay);this.disposables.push(this.list.onMouseOver(async l=>{var c;if(l.browserEvent.target instanceof HTMLAnchorElement){a.cancel();return}if(!(!(l.browserEvent.relatedTarget instanceof HTMLAnchorElement)&&es(l.browserEvent.relatedTarget,(c=l.element)===null||c===void 0?void 0:c.element)))try{await a.trigger(async()=>{l.element&&this.showHover(l.element)})}catch(u){if(!wh(u))throw u}})),this.disposables.push(this.list.onMouseOut(l=>{var c;es(l.browserEvent.relatedTarget,(c=l.element)===null||c===void 0?void 0:c.element)||a.cancel()})),this.disposables.push(a),this.disposables.push(this._listElementChecked.event(l=>this.fireCheckedEvents())),this.disposables.push(this._onChangedAllVisibleChecked,this._onChangedCheckedCount,this._onChangedVisibleCount,this._onChangedCheckedElements,this._onButtonTriggered,this._onSeparatorButtonTriggered,this._onLeave,this._onKeyDown)}get onDidChangeFocus(){return Je.map(this.list.onDidChangeFocus,e=>e.elements.map(t=>t.item))}get onDidChangeSelection(){return Je.map(this.list.onDidChangeSelection,e=>({items:e.elements.map(t=>t.item),event:e.browserEvent}))}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}get ariaLabel(){return this.list.getHTMLElement().ariaLabel}set ariaLabel(e){this.list.getHTMLElement().ariaLabel=e}getAllVisibleChecked(){return this.allVisibleChecked(this.elements,!1)}allVisibleChecked(e,t=!0){for(let n=0,r=e.length;n{t.hidden||(t.checked=e)})}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}setElements(e){this.elementDisposables=si(this.elementDisposables);const t=s=>this.fireButtonTriggered(s),n=s=>this.fireSeparatorButtonTriggered(s);this.inputElements=e;const r=new Map,o=this.parent.classList.contains("show-checkboxes");this.elements=e.reduce((s,a,l)=>{var c;const u=l>0?e[l-1]:void 0;if(a.type==="separator"&&!a.buttons)return s;const d=new yYe(a,u,l,o,t,n,this._listElementChecked),h=s.length;return s.push(d),r.set((c=d.item)!==null&&c!==void 0?c:d.separator,h),s},[]),this.elementsToIndexes=r,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(t=>this.elementsToIndexes.has(t)).map(t=>this.elementsToIndexes.get(t))),e.length>0){const t=this.list.getFocus()[0];typeof t=="number"&&this.list.reveal(t)}}getActiveDescendant(){return this.list.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){this.list.setSelection(e.filter(t=>this.elementsToIndexes.has(t)).map(t=>this.elementsToIndexes.get(t)))}getCheckedElements(){return this.elements.filter(e=>e.checked).map(e=>e.item).filter(e=>!!e)}setCheckedElements(e){try{this._fireCheckedEvents=!1;const t=new Set;for(const n of e)t.add(n);for(const n of this.elements)n.checked=t.has(n.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===Fo.Second&&this.list.length<2&&(e=Fo.First),e){case Fo.First:this.list.scrollTop=0,this.list.focusFirst(void 0,n=>!!n.item);break;case Fo.Second:this.list.scrollTop=0,this.list.focusNth(1,void 0,n=>!!n.item);break;case Fo.Last:this.list.scrollTop=this.list.scrollHeight,this.list.focusLast(void 0,n=>!!n.item);break;case Fo.Next:{this.list.focusNext(void 0,!0,void 0,r=>!!r.item);const n=this.list.getFocus()[0];n!==0&&!this.elements[n-1].item&&this.list.firstVisibleIndex>n-1&&this.list.reveal(n-1);break}case Fo.Previous:{this.list.focusPrevious(void 0,!0,void 0,r=>!!r.item);const n=this.list.getFocus()[0];n!==0&&!this.elements[n-1].item&&this.list.firstVisibleIndex>n-1&&this.list.reveal(n-1);break}case Fo.NextPage:this.list.focusNextPage(void 0,n=>!!n.item);break;case Fo.PreviousPage:this.list.focusPreviousPage(void 0,n=>!!n.item);break}const t=this.list.getFocus()[0];typeof t=="number"&&this.list.reveal(t)}clearFocus(){this.list.setFocus([])}domFocus(){this.list.domFocus()}showHover(e){var t,n,r;this._lastHover&&!this._lastHover.isDisposed&&((n=(t=this.options.hoverDelegate).onDidHideHover)===null||n===void 0||n.call(t),(r=this._lastHover)===null||r===void 0||r.dispose()),!(!e.element||!e.saneTooltip)&&(this._lastHover=this.options.hoverDelegate.showHover({content:e.saneTooltip,target:e.element,linkHandler:o=>{this.options.linkOpenerDelegate(o)},appearance:{showPointer:!0},container:this.container,position:{hoverPosition:1}},!1))}layout(e){this.list.getHTMLElement().style.maxHeight=e?`${Math.floor(e/44)*44+6}px`:"",this.list.layout()}filter(e){if(!(this.sortByLabel||this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))return this.list.layout(),!1;const t=e;if(e=e.trim(),!e||!(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))this.elements.forEach(r=>{r.labelHighlights=void 0,r.descriptionHighlights=void 0,r.detailHighlights=void 0,r.hidden=!1;const o=r.index&&this.inputElements[r.index-1];r.item&&(r.separator=o&&o.type==="separator"&&!o.buttons?o:void 0)});else{let r;this.elements.forEach(o=>{var s,a,l,c;let u;this.matchOnLabelMode==="fuzzy"?u=this.matchOnLabel&&(s=i9(e,OL(o.saneLabel)))!==null&&s!==void 0?s:void 0:u=this.matchOnLabel&&(a=SYe(t,OL(o.saneLabel)))!==null&&a!==void 0?a:void 0;const d=this.matchOnDescription&&(l=i9(e,OL(o.saneDescription||"")))!==null&&l!==void 0?l:void 0,h=this.matchOnDetail&&(c=i9(e,OL(o.saneDetail||"")))!==null&&c!==void 0?c:void 0;if(u||d||h?(o.labelHighlights=u,o.descriptionHighlights=d,o.detailHighlights=h,o.hidden=!1):(o.labelHighlights=void 0,o.descriptionHighlights=void 0,o.detailHighlights=void 0,o.hidden=o.item?!o.item.alwaysShow:!0),o.item?o.separator=void 0:o.separator&&(o.hidden=!0),!this.sortByLabel){const f=o.index&&this.inputElements[o.index-1];r=f&&f.type==="separator"?f:r,r&&!o.hidden&&(o.separator=r,r=void 0)}})}const n=this.elements.filter(r=>!r.hidden);if(this.sortByLabel&&e){const r=e.toLowerCase();n.sort((o,s)=>xYe(o,s,r))}return this.elementsToIndexes=n.reduce((r,o,s)=>{var a;return r.set((a=o.item)!==null&&a!==void 0?a:o.separator,s),r},new Map),this.list.splice(0,this.list.length,n),this.list.setFocus([]),this.list.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(n.length),!0}toggleCheckbox(){try{this._fireCheckedEvents=!1;const e=this.list.getFocusedElements(),t=this.allVisibleChecked(e);for(const n of e)n.checked=!t}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}display(e){this.container.style.display=e?"":"none"}isDisplayed(){return this.container.style.display!=="none"}dispose(){this.elementDisposables=si(this.elementDisposables),this.disposables=si(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)}fireSeparatorButtonTriggered(e){this._onSeparatorButtonTriggered.fire(e)}style(e){this.list.style(e)}toggleHover(){const e=this.list.getFocusedElements()[0];if(!(e!=null&&e.saneTooltip))return;if(this._lastHover&&!this._lastHover.isDisposed){this._lastHover.dispose();return}const t=this.list.getFocusedElements()[0];if(!t)return;this.showHover(t);const n=new Te;n.add(this.list.onDidChangeFocus(r=>{r.indexes.length&&this.showHover(r.elements[0])})),this._lastHover&&n.add(this._lastHover),this._toggleHover=n,this.elementDisposables.push(this._toggleHover)}}L0e([Rr],dY.prototype,"onDidChangeFocus",null);L0e([Rr],dY.prototype,"onDidChangeSelection",null);function SYe(i,e){const{text:t,iconOffsets:n}=e;if(!n||n.length===0)return vse(i,t);const r=Ik(t," "),o=t.length-r.length,s=vse(i,r);if(s)for(const a of s){const l=n[a.start+o]+o;a.start+=l,a.end+=l}return s}function vse(i,e){const t=e.toLowerCase().indexOf(i.toLowerCase());return t!==-1?[{start:t,end:t+i.length}]:null}function xYe(i,e,t){const n=i.labelHighlights||[],r=e.labelHighlights||[];return n.length&&!r.length?-1:!n.length&&r.length?1:n.length===0&&r.length===0?0:fYe(i.saneSortLabel,e.saneSortLabel,t)}class LYe{getWidgetAriaLabel(){return w("quickInput","Quick Input")}getAriaLabel(e){var t;return!((t=e.separator)===null||t===void 0)&&t.label?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(e.hasCheckbox)return{value:e.checked,onDidChange:e.onChecked}}}var EYe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},_se=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const GV={iconClass:Wt.asClassName(Xe.quickInputBack),tooltip:w("quickInput.back","Back"),handle:-1};class tT extends fe{constructor(e){super(),this.ui=e,this._widgetUpdated=!1,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._buttons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=tT.noPromptMessage,this._severity=kr.Ignore,this.onDidTriggerButtonEmitter=this._register(new se),this.onDidHideEmitter=this._register(new se),this.onDisposeEmitter=this._register(new se),this.visibleDisposables=this._register(new Te),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&&!ch;this._ignoreFocusOut=e&&!ch,t&&this.update()}get buttons(){return this._buttons}set buttons(e){this._buttons=e,this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=e??[],this.togglesUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get severity(){return this._severity}set severity(e){this._severity=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton(e=>{this.buttons.indexOf(e)!==-1&&this.onDidTriggerButtonEmitter.fire(e)})),this.ui.show(this),this.visible=!0,this._lastValidationMessage=void 0,this._lastSeverity=void 0,this.buttons.length&&(this.buttonsUpdated=!0),this.toggles.length&&(this.togglesUpdated=!0),this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=pI.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}update(){var e,t;if(!this.visible)return;const n=this.getTitle();n&&this.ui.title.textContent!==n?this.ui.title.textContent=n:!n&&this.ui.title.innerHTML!==" "&&(this.ui.title.innerText=" ");const r=this.getDescription();if(this.ui.description1.textContent!==r&&(this.ui.description1.textContent=r),this.ui.description2.textContent!==r&&(this.ui.description2.textContent=r),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?gs(this.ui.widget,this._widget):gs(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new cd,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 s=this.buttons.filter(l=>l===GV).map((l,c)=>KV(l,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(l)));this.ui.leftActionBar.push(s,{icon:!0,label:!1}),this.ui.rightActionBar.clear();const a=this.buttons.filter(l=>l!==GV).map((l,c)=>KV(l,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(l)));this.ui.rightActionBar.push(a,{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const s=(t=(e=this.toggles)===null||e===void 0?void 0:e.filter(a=>a instanceof AS))!==null&&t!==void 0?t:[];this.ui.inputBox.toggles=s}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const o=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==o&&(this._lastValidationMessage=o,gs(this.ui.message),CYe(o,this.ui.message,{callback:s=>{this.ui.linkOpenerDelegate(s)},disposables:this.visibleDisposables})),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?w("quickInput.steps","{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==kr.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()}}tT.noPromptMessage=w("inputModeEntry","Press 'Enter' to confirm your input or 'Escape' to cancel");class mI extends tT{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new se),this.onWillAcceptEmitter=this._register(new se),this.onDidAcceptEmitter=this._register(new se),this.onDidCustomEmitter=this._register(new se),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._keepScrollPosition=!1,this._itemActivation=Md.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new se),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new se),this.onDidTriggerItemButtonEmitter=this._register(new se),this.onDidTriggerSeparatorButtonEmitter=this._register(new se),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,this.onDidTriggerSeparatorButton=this.onDidTriggerSeparatorButtonEmitter.event}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this.doSetValue(e)}doSetValue(e,t){this._value!==e&&(this._value=e,t||this.update(),this.visible&&this.ui.list.filter(this.filterValue(this._value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(this._value))}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get items(){return this._items}get scrollTop(){return this.ui.list.scrollTop}set scrollTop(e){this.ui.list.scrollTop=e}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(e){this._keepScrollPosition=e}get itemActivation(){return this._itemActivation}set itemActivation(e){this._itemActivation=e}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?aYe: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.canSelectMany||this.ui.list.focus(Fo.First)}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{this.doSetValue(e,!0)})),this.visibleDisposables.add((this._hideInput?this.ui.list:this.ui.inputBox).onKeyDown(e=>{switch(e.keyCode){case 18:this.ui.list.focus(Fo.Next),this.canSelectMany&&this.ui.list.domFocus(),hn.stop(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(Fo.Previous):this.ui.list.focus(Fo.Last),this.canSelectMany&&this.ui.list.domFocus(),hn.stop(e,!0);break;case 12:this.ui.list.focus(Fo.NextPage),this.canSelectMany&&this.ui.list.domFocus(),hn.stop(e,!0);break;case 11:this.ui.list.focus(Fo.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),hn.stop(e,!0);break;case 17:if(!this._canAcceptInBackground||!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(Fo.First),hn.stop(e,!0));break;case 13:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(Fo.Last),hn.stop(e,!0));break}})),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&&or(e,this._activeItems,(t,n)=>t===n)||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onDidChangeSelection(({items:e,event:t})=>{if(this.canSelectMany){e.length&&this.ui.list.setSelectedElements([]);return}this.selectedItemsToConfirm!==this._selectedItems&&or(e,this._selectedItems,(n,r)=>n===r)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(Iq(t)&&t.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{this.canSelectMany&&(this.selectedItemsToConfirm!==this._selectedItems&&or(e,this._selectedItems,(t,n)=>t===n)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e)))})),this.visibleDisposables.add(this.ui.list.onButtonTriggered(e=>this.onDidTriggerItemButtonEmitter.fire(e))),this.visibleDisposables.add(this.ui.list.onSeparatorButtonTriggered(e=>this.onDidTriggerSeparatorButtonEmitter.fire(e))),this.visibleDisposables.add(this.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}handleAccept(e){let t=!1;this.onWillAcceptEmitter.fire({veto:()=>t=!0}),t||this.onDidAcceptEmitter.fire({inBackground:e})}registerQuickNavigation(){return ye(this.ui.container,Ge.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new Ai(e),n=t.keyCode;this._quickNavigate.keybindings.some(s=>{const a=s.getChords();return a.length>1?!1:a[0].shiftKey&&n===4?!(t.ctrlKey||t.altKey||t.metaKey):!!(a[0].altKey&&n===6||a[0].ctrlKey&&n===5||a[0].metaKey&&n===57)})&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!1)),this._quickNavigate=void 0)})}update(){if(!this.visible)return;const e=this.keepScrollPosition?this.scrollTop:0,t=!!this.description,n={title:!!this.title||!!this.step||!!this.buttons.length,description:t,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||t,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:this.ok==="default"?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage,customButton:this.customButton};this.ui.setVisibilities(n),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||"");let r=this.ariaLabel;if(!r&&n.inputBox&&(r=this.placeholder||mI.DEFAULT_ARIA_LABEL,this.title&&(r+=` - ${this.title}`)),this.ui.list.ariaLabel!==r&&(this.ui.list.ariaLabel=r??null),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.matchOnLabelMode=this.matchOnLabelMode,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated)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 Md.NONE:this._itemActivation=Md.FIRST;break;case Md.SECOND:this.ui.list.focus(Fo.Second),this._itemActivation=Md.FIRST;break;case Md.LAST:this.ui.list.focus(Fo.Last),this._itemActivation=Md.FIRST;break;default:this.trySelectFirst();break}this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",n.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(Fo.First)),this.keepScrollPosition&&(this.scrollTop=e)}}mI.DEFAULT_ARIA_LABEL=w("quickInputBox.ariaLabel","Type to narrow down results.");class DYe extends tT{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new se),this.onDidAcceptEmitter=this._register(new se),this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",this.update()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get password(){return this._password}set password(e){this._password=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{e!==this.value&&(this._value=e,this.onDidValueChangeEmitter.fire(e))})),this.visibleDisposables.add(this.ui.onDidAccept(()=>this.onDidAcceptEmitter.fire())),this.valueSelectionUpdated=!0),super.show()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");const e={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0,progressBar:!0};this.ui.setVisibilities(e),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password)}}let qV=class extends EP{constructor(e,t){super("element",!1,n=>this.getOverrideOptions(n),e,t)}getOverrideOptions(e){var t;const n=(e.content instanceof HTMLElement?(t=e.content.textContent)!==null&&t!==void 0?t:"":typeof e.content=="string"?e.content:e.content.value).includes(` -`);return{persistence:{hideOnKeyDown:!1},appearance:{showHoverHint:n,skipFadeInAnimation:!0}}}};qV=EYe([_se(0,gn),_se(1,kX)],qV);me.white.toString(),me.white.toString();let QP=class extends fe{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new se),this._onDidEscape=this._register(new se),this.options=t,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),this._element.classList.toggle("secondary",!!t.secondary);const n=t.secondary?t.buttonSecondaryBackground:t.buttonBackground,r=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=r||"",this._element.style.backgroundColor=n||"",t.supportShortLabel&&(this._labelShortElement=document.createElement("div"),this._labelShortElement.classList.add("monaco-button-label-short"),this._element.appendChild(this._labelShortElement),this._labelElement=document.createElement("div"),this._labelElement.classList.add("monaco-button-label"),this._element.appendChild(this._labelElement),this._element.classList.add("monaco-text-button-with-short-label")),typeof t.ariaLabel=="string"&&this._element.setAttribute("aria-label",t.ariaLabel),e.appendChild(this._element),this._register(wi.addTarget(this._element)),[Ge.CLICK,Si.Tap].forEach(o=>{this._register(ye(this._element,o,s=>{if(!this.enabled){hn.stop(s);return}this._onDidClick.fire(s)}))}),this._register(ye(this._element,Ge.KEY_DOWN,o=>{const s=new Ai(o);let a=!1;this.enabled&&(s.equals(3)||s.equals(10))?(this._onDidClick.fire(o),a=!0):s.equals(9)&&(this._onDidEscape.fire(o),this._element.blur(),a=!0),a&&hn.stop(s,!0)})),this._register(ye(this._element,Ge.MOUSE_OVER,o=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(ye(this._element,Ge.MOUSE_OUT,o=>{this.updateBackground(!1)})),this.focusTracker=this._register(dh(this._element)),this._register(this.focusTracker.onDidFocus(()=>{this.enabled&&this.updateBackground(!0)})),this._register(this.focusTracker.onDidBlur(()=>{this.enabled&&this.updateBackground(!1)}))}dispose(){super.dispose(),this._element.remove()}getContentElements(e){const t=[];for(let n of wv(e))if(typeof n=="string"){if(n=n.trim(),n==="")continue;const r=document.createElement("span");r.textContent=n,t.push(r)}else t.push(n);return t}updateBackground(e){let t;this.options.secondary?t=e?this.options.buttonSecondaryHoverBackground:this.options.buttonSecondaryBackground:t=e?this.options.buttonHoverBackground:this.options.buttonBackground,t&&(this._element.style.backgroundColor=t)}get element(){return this._element}set label(e){var t;if(this._label===e||Mf(this._label)&&Mf(e)&&NKe(this._label,e))return;this._element.classList.add("monaco-text-button");const n=this.options.supportShortLabel?this._labelElement:this._element;if(Mf(e)){const o=Y4(e,{inline:!0});o.dispose();const s=(t=o.element.querySelector("p"))===null||t===void 0?void 0:t.innerHTML;if(s){const a=Ype(s,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});n.innerHTML=a}else gs(n)}else this.options.supportIcons?gs(n,...this.getContentElements(e)):n.textContent=e;let r="";typeof this.options.title=="string"?r=this.options.title:this.options.title&&(r=WKe(e)),this._hover?this._hover.update(r):this._hover=this._register(mC(Vp("mouse"),this._element,r)),typeof this.options.ariaLabel=="string"?this._element.setAttribute("aria-label",this.options.ariaLabel):this.options.ariaLabel&&this._element.setAttribute("aria-label",this._element.title),this._label=e}get label(){return this._label}set icon(e){this._element.classList.add(...Wt.asClassNameArray(e))}set enabled(e){e?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}};class XV{constructor(e,t,n){this.options=t,this.styles=n,this.count=0,this.element=ke(e,He(".monaco-count-badge")),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0)}setCount(e){this.count=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){var e,t;this.element.textContent=Eb(this.countFormat,this.count),this.element.title=Eb(this.titleFormat,this.count),this.element.style.backgroundColor=(e=this.styles.badgeBackground)!==null&&e!==void 0?e:"",this.element.style.color=(t=this.styles.badgeForeground)!==null&&t!==void 0?t:"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}const bse="done",Cse="active",m9="infinite",v9="infinite-long-running",yse="discrete";class d3 extends fe{constructor(e,t){super(),this.workedVal=0,this.showDelayedScheduler=this._register(new pi(()=>bl(this.element),0)),this.longRunningScheduler=this._register(new pi(()=>this.infiniteLongRunning(),d3.LONG_RUNNING_INFINITE_THRESHOLD)),this.create(e,t)}create(e,t){this.element=document.createElement("div"),this.element.classList.add("monaco-progress-container"),this.element.setAttribute("role","progressbar"),this.element.setAttribute("aria-valuemin","0"),e.appendChild(this.element),this.bit=document.createElement("div"),this.bit.classList.add("progress-bit"),this.bit.style.backgroundColor=(t==null?void 0:t.progressBarBackground)||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(Cse,m9,v9,yse),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(bse),this.element.classList.contains(m9)?(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(yse,bse,v9),this.element.classList.add(Cse,m9),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(v9)}getContainer(){return this.element}}d3.LONG_RUNNING_INFINITE_THRESHOLD=1e4;const IYe=He;class kYe extends fe{constructor(e,t,n){super(),this.parent=e,this.onKeyDown=o=>Sr(this.findInput.inputBox.inputElement,Ge.KEY_DOWN,o),this.onDidChange=o=>this.findInput.onDidChange(o),this.container=ke(this.parent,IYe(".quick-input-box")),this.findInput=this._register(new o0e(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:n}));const r=this.findInput.inputBox.inputElement;r.role="combobox",r.ariaHasPopup="menu",r.ariaAutoComplete="list",r.ariaExpanded="true"}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}get placeholder(){return this.findInput.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.findInput.inputBox.setPlaceHolder(e)}get password(){return this.findInput.inputBox.inputElement.type==="password"}set password(e){this.findInput.inputBox.inputElement.type=e?"password":"text"}set enabled(e){this.findInput.inputBox.inputElement.toggleAttribute("readonly",!e)}set toggles(e){this.findInput.setAdditionalToggles(e)}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}showDecoration(e){e===kr.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===kr.Info?1:e===kr.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===kr.Info?1:e===kr.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}const pl=He;class h3 extends fe{get container(){return this._container}constructor(e,t,n){super(),this.options=e,this.themeService=t,this.layoutService=n,this.enabled=!0,this.onDidAcceptEmitter=this._register(new se),this.onDidCustomEmitter=this._register(new se),this.onDidTriggerButtonEmitter=this._register(new se),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new se),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new se),this.onHide=this.onHideEmitter.event,this.idPrefix=e.idPrefix,this._container=e.container,this.styles=e.styles,this._register(Je.runAndSubscribe(d4,({window:r,disposables:o})=>this.registerKeyModsListeners(r,o),{window:hi,disposables:this._store})),this._register(zBe(r=>{this.ui&&Pt(this.ui.container)===r&&(this.reparentUI(this.layoutService.mainContainer),this.layout(this.layoutService.mainContainerDimension,this.layoutService.mainContainerOffset.quickPickTop))}))}registerKeyModsListeners(e,t){const n=r=>{this.keyMods.ctrlCmd=r.ctrlKey||r.metaKey,this.keyMods.alt=r.altKey};for(const r of[Ge.KEY_DOWN,Ge.KEY_UP,Ge.MOUSE_DOWN])t.add(ye(e,r,n,!0))}getUI(e){if(this.ui)return e&&Pt(this._container)!==Pt(this.layoutService.activeContainer)&&(this.reparentUI(this.layoutService.activeContainer),this.layout(this.layoutService.activeContainerDimension,this.layoutService.activeContainerOffset.quickPickTop)),this.ui;const t=ke(this._container,pl(".quick-input-widget.show-file-icons"));t.tabIndex=-1,t.style.display="none";const n=gc(t),r=ke(t,pl(".quick-input-titlebar")),o=this._register(new au(r,{hoverDelegate:this.options.hoverDelegate}));o.domNode.classList.add("quick-input-left-action-bar");const s=ke(r,pl(".quick-input-title")),a=this._register(new au(r,{hoverDelegate:this.options.hoverDelegate}));a.domNode.classList.add("quick-input-right-action-bar");const l=ke(t,pl(".quick-input-header")),c=ke(l,pl("input.quick-input-check-all"));c.type="checkbox",c.setAttribute("aria-label",w("quickInput.checkAll","Toggle all checkboxes")),this._register(Sr(c,Ge.CHANGE,R=>{const F=c.checked;A.setAllVisibleChecked(F)})),this._register(ye(c,Ge.CLICK,R=>{(R.x||R.y)&&f.setFocus()}));const u=ke(l,pl(".quick-input-description")),d=ke(l,pl(".quick-input-and-message")),h=ke(d,pl(".quick-input-filter")),f=this._register(new kYe(h,this.styles.inputBox,this.styles.toggle));f.setAttribute("aria-describedby",`${this.idPrefix}message`);const g=ke(h,pl(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");const p=new XV(g,{countFormat:w({key:"quickInput.visibleCount",comment:["This tells the user how many items are shown in a list of items to select from. The items can be anything. Currently not visible, but read by screen readers."]},"{0} Results")},this.styles.countBadge),v=ke(h,pl(".quick-input-count"));v.setAttribute("aria-live","polite");const m=new XV(v,{countFormat:w({key:"quickInput.countSelected",comment:["This tells the user how many items are selected in a list of items to select from. The items can be anything."]},"{0} Selected")},this.styles.countBadge),_=ke(l,pl(".quick-input-action")),y=this._register(new QP(_,this.styles.button));y.label=w("ok","OK"),this._register(y.onDidClick(R=>{this.onDidAcceptEmitter.fire()}));const S=ke(l,pl(".quick-input-action")),L=this._register(new QP(S,{...this.styles.button,supportIcons:!0}));L.label=w("custom","Custom"),this._register(L.onDidClick(R=>{this.onDidCustomEmitter.fire()}));const E=ke(d,pl(`#${this.idPrefix}message.quick-input-message`)),D=this._register(new d3(t,this.styles.progressBar));D.getContainer().classList.add("quick-input-progress");const k=ke(t,pl(".quick-input-html-widget"));k.tabIndex=-1;const T=ke(t,pl(".quick-input-description")),M=this.idPrefix+"list",A=this._register(new dY(t,M,this.options,this.themeService));f.setAttribute("aria-controls",M),this._register(A.onDidChangeFocus(()=>{var R;f.setAttribute("aria-activedescendant",(R=A.getActiveDescendant())!==null&&R!==void 0?R:"")})),this._register(A.onChangedAllVisibleChecked(R=>{c.checked=R})),this._register(A.onChangedVisibleCount(R=>{p.setCount(R)})),this._register(A.onChangedCheckedCount(R=>{m.setCount(R)})),this._register(A.onLeave(()=>{setTimeout(()=>{this.controller&&(f.setFocus(),this.controller instanceof mI&&this.controller.canSelectMany&&A.clearFocus())},0)}));const N=dh(t);return this._register(N),this._register(ye(t,Ge.FOCUS,R=>{es(R.relatedTarget,t)||(this.previousFocusElement=R.relatedTarget instanceof HTMLElement?R.relatedTarget:void 0)},!0)),this._register(N.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(pI.Blur),this.previousFocusElement=void 0})),this._register(ye(t,Ge.FOCUS,R=>{f.setFocus()})),this._register(Sr(t,Ge.KEY_DOWN,R=>{if(!es(R.target,k))switch(R.keyCode){case 3:hn.stop(R,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case 9:hn.stop(R,!0),this.hide(pI.Gesture);break;case 2:if(!R.altKey&&!R.ctrlKey&&!R.metaKey){const F=[".quick-input-list .monaco-action-bar .always-visible",".quick-input-list-entry:hover .monaco-action-bar",".monaco-list-row.focused .monaco-action-bar"];if(t.classList.contains("show-checkboxes")?F.push("input"):F.push("input[type=text]"),this.getUI().list.isDisplayed()&&F.push(".monaco-list"),this.getUI().message&&F.push(".quick-input-message a"),this.getUI().widget){if(es(R.target,this.getUI().widget))break;F.push(".quick-input-html-widget")}const W=t.querySelectorAll(F.join(", "));R.shiftKey&&R.target===W[0]?(hn.stop(R,!0),A.clearFocus()):!R.shiftKey&&es(R.target,W[W.length-1])&&(hn.stop(R,!0),W[0].focus())}break;case 10:R.ctrlKey&&(hn.stop(R,!0),this.getUI().list.toggleHover());break}})),this.ui={container:t,styleSheet:n,leftActionBar:o,titleBar:r,title:s,description1:T,description2:u,widget:k,rightActionBar:a,checkAll:c,inputContainer:d,filterContainer:h,inputBox:f,visibleCountContainer:g,visibleCount:p,countContainer:v,count:m,okContainer:_,ok:y,message:E,customButtonContainer:S,customButton:L,list:A,progressBar:D,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:R=>this.show(R),hide:()=>this.hide(),setVisibilities:R=>this.setVisibilities(R),setEnabled:R=>this.setEnabled(R),setContextKey:R=>this.options.setContextKey(R),linkOpenerDelegate:R=>this.options.linkOpenerDelegate(R)},this.updateStyles(),this.ui}reparentUI(e){this.ui&&(this._container=e,ke(this._container,this.ui.container))}pick(e,t={},n=Cn.None){return new Promise((r,o)=>{let s=u=>{var d;s=r,(d=t.onKeyMods)===null||d===void 0||d.call(t,a.keyMods),r(u)};if(n.isCancellationRequested){s(void 0);return}const a=this.createQuickPick();let l;const c=[a,a.onDidAccept(()=>{if(a.canSelectMany)s(a.selectedItems.slice()),a.hide();else{const u=a.activeItems[0];u&&(s(u),a.hide())}}),a.onDidChangeActive(u=>{const d=u[0];d&&t.onDidFocus&&t.onDidFocus(d)}),a.onDidChangeSelection(u=>{if(!a.canSelectMany){const d=u[0];d&&(s(d),a.hide())}}),a.onDidTriggerItemButton(u=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton({...u,removeItem:()=>{const d=a.items.indexOf(u.item);if(d!==-1){const h=a.items.slice(),f=h.splice(d,1),g=a.activeItems.filter(v=>v!==f[0]),p=a.keepScrollPosition;a.keepScrollPosition=!0,a.items=h,g&&(a.activeItems=g),a.keepScrollPosition=p}}})),a.onDidTriggerSeparatorButton(u=>{var d;return(d=t.onDidTriggerSeparatorButton)===null||d===void 0?void 0:d.call(t,u)}),a.onDidChangeValue(u=>{l&&!u&&(a.activeItems.length!==1||a.activeItems[0]!==l)&&(a.activeItems=[l])}),n.onCancellationRequested(()=>{a.hide()}),a.onDidHide(()=>{si(c),s(void 0)})];a.title=t.title,a.canSelectMany=!!t.canPickMany,a.placeholder=t.placeHolder,a.ignoreFocusOut=!!t.ignoreFocusLost,a.matchOnDescription=!!t.matchOnDescription,a.matchOnDetail=!!t.matchOnDetail,a.matchOnLabel=t.matchOnLabel===void 0||t.matchOnLabel,a.quickNavigate=t.quickNavigate,a.hideInput=!!t.hideInput,a.contextKey=t.contextKey,a.busy=!0,Promise.all([e,t.activeItem]).then(([u,d])=>{l=d,a.busy=!1,a.items=u,a.canSelectMany&&(a.selectedItems=u.filter(h=>h.type!=="separator"&&h.picked)),l&&(a.activeItems=[l])}),a.show(),Promise.resolve(e).then(void 0,u=>{o(u),a.hide()})})}createQuickPick(){const e=this.getUI(!0);return new mI(e)}createInputBox(){const e=this.getUI(!0);return new DYe(e)}show(e){const t=this.getUI(!0);this.onShowEmitter.fire();const n=this.controller;this.controller=e,n==null||n.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",gs(t.widget),t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(kr.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),gs(t.message),t.progressBar.stop(),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.ignoreFocusOut=!1,t.inputBox.toggles=void 0;const r=this.options.backKeybindingLabel();GV.tooltip=r?w("quickInput.backWithKeybinding","Back ({0})",r):w("quickInput.back","Back"),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus()}isVisible(){return!!this.ui&&this.ui.container.style.display!=="none"}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",t.description2.style.display=e.description&&!(e.inputBox||e.checkAll)?"":"none",t.checkAll.style.display=e.checkAll?"":"none",t.inputContainer.style.display=e.inputBox?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.display(!!e.list),t.container.classList.toggle("show-checkboxes",!!e.checkBox),t.container.classList.toggle("hidden-input",!e.inputBox&&!e.description),this.updateLayout()}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const t of this.getUI().leftActionBar.viewItems)t.action.enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.action.enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().inputBox.enabled=e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(e){var t,n;const r=this.controller;if(!r)return;const o=(t=this.ui)===null||t===void 0?void 0:t.container,s=o&&!ome(o);if(this.controller=null,this.onHideEmitter.fire(),o&&(o.style.display="none"),!s){let a=this.previousFocusElement;for(;a&&!a.offsetParent;)a=(n=a.parentElement)!==null&&n!==void 0?n:void 0;a!=null&&a.offsetParent?(a.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}r.didHide(e)}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui&&this.isVisible()){this.ui.container.style.top=`${this.titleBarOffset}px`;const e=this.ui.container.style,t=Math.min(this.dimension.width*.62,h3.MAX_WIDTH);e.width=t+"px",e.marginLeft="-"+t/2+"px",this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&this.dimension.height*.4)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:n,widgetBorder:r,widgetShadow:o}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e??"",this.ui.container.style.backgroundColor=t??"",this.ui.container.style.color=n??"",this.ui.container.style.border=r?`1px solid ${r}`:"",this.ui.container.style.boxShadow=o?`0 0 8px 2px ${o}`:"",this.ui.list.style(this.styles.list);const s=[];this.styles.pickerGroup.pickerGroupBorder&&s.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&s.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&s.push(".quick-input-list .quick-input-list-separator-as-item { color: var(--vscode-descriptionForeground); }"),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(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 a=s.join(` -`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}}h3.MAX_WIDTH=600;var TYe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Kx=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let YV=class extends U$e{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(jV))),this._quickAccess}constructor(e,t,n,r,o){super(n),this.instantiationService=e,this.contextKeyService=t,this.layoutService=r,this.configurationService=o,this._onShow=this._register(new se),this._onHide=this._register(new se),this.contexts=new Map}createController(e=this.layoutService,t){const n={idPrefix:"quickInput_",container:e.activeContainer,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:o=>this.setContextKey(o),linkOpenerDelegate:o=>{this.instantiationService.invokeFunction(s=>{s.get(al).open(o,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),createList:(o,s,a,l,c)=>this.instantiationService.createInstance(VV,o,s,a,l,c),styles:this.computeStyles(),hoverDelegate:this._register(this.instantiationService.createInstance(qV))},r=this._register(new h3({...n,...t},this.themeService,this.layoutService));return r.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop),this._register(e.onDidLayoutActiveContainer(o=>{Pt(e.activeContainer)===Pt(r.container)&&r.layout(o,e.activeContainerOffset.quickPickTop)})),this._register(e.onDidChangeActiveContainer(()=>{r.isVisible()||r.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop)})),this._register(r.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(r.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),r}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new st(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),!(t&&t.get())&&(this.resetContextKeys(),t==null||t.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t={},n=Cn.None){return this.controller.pick(e,t,n)}createQuickPick(){return this.controller.createQuickPick()}createInputBox(){return this.controller.createInputBox()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:ht(rre),quickInputForeground:ht(Q7e),quickInputTitleBackground:ht(J7e),widgetBorder:ht(Qme),widgetShadow:ht(Yg)},inputBox:FP,toggle:OP,countBadge:K_e,button:Rqe,progressBar:Mqe,keybindingLabel:Nqe,list:RS({listBackground:rre,listFocusBackground:H0,listFocusForeground:$0,listInactiveFocusForeground:$0,listInactiveSelectionIconForeground:sy,listInactiveFocusBackground:H0,listFocusOutline:zi,listInactiveFocusOutline:zi}),pickerGroup:{pickerGroupBorder:ht(eWe),pickerGroupForeground:ht(nve)}}}};YV=TYe([Kx(0,Ot),Kx(1,Vt),Kx(2,To),Kx(3,pC),Kx(4,gn)],YV);var E0e=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},T0=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let ZV=class extends YV{constructor(e,t,n,r,o,s){super(t,n,r,new nV(e.getContainerDomNode(),o),s),this.host=void 0;const a=Kw.get(e);if(a){const l=a.widget;this.host={_serviceBrand:void 0,get mainContainer(){return l.getDomNode()},getContainer(){return l.getDomNode()},get containers(){return[l.getDomNode()]},get activeContainer(){return l.getDomNode()},get mainContainerDimension(){return e.getLayoutInfo()},get activeContainerDimension(){return e.getLayoutInfo()},get onDidLayoutMainContainer(){return e.onDidLayoutChange},get onDidLayoutActiveContainer(){return e.onDidLayoutChange},get onDidLayoutContainer(){return Je.map(e.onDidLayoutChange,c=>({container:l.getDomNode(),dimension:c}))},get onDidChangeActiveContainer(){return Je.None},get onDidAddContainer(){return Je.None},get whenActiveContainerStylesLoaded(){return Promise.resolve()},get mainContainerOffset(){return{top:0,quickPickTop:0}},get activeContainerOffset(){return{top:0,quickPickTop:0}},focus:()=>e.focus()}}else this.host=void 0}createController(){return super.createController(this.host)}};ZV=E0e([T0(1,Ot),T0(2,Vt),T0(3,To),T0(4,Un),T0(5,gn)],ZV);let QV=class{get activeService(){const e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw new Error("Quick input service needs a focused editor to work.");let t=this.mapEditorToService.get(e);if(!t){const n=t=this.instantiationService.createInstance(ZV,e);this.mapEditorToService.set(e,t),Vv(e.onDidDispose)(()=>{n.dispose(),this.mapEditorToService.delete(e)})}return t}get quickAccess(){return this.activeService.quickAccess}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t={},n=Cn.None){return this.activeService.pick(e,t,n)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}};QV=E0e([T0(0,Ot),T0(1,Un)],QV);class Kw{static get(e){return e.getContribution(Kw.ID)}constructor(e){this.editor=e,this.widget=new f3(this.editor)}dispose(){this.widget.dispose()}}Kw.ID="editor.controller.quickInput";class f3{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return f3.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}f3.ID="editor.contrib.quickInputWidget";jn(Kw.ID,Kw,4);class NYe{constructor(e,t,n,r,o){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=n,this.foreground=r,this.background=o}}function RYe(i){if(!i||!Array.isArray(i))return[];const e=[];let t=0;for(let n=0,r=i.length;n{const h=BYe(u.token,d.token);return h!==0?h:u.index-d.index});let t=0,n="000000",r="ffffff";for(;i.length>=1&&i[0].token==="";){const u=i.shift();u.fontStyle!==-1&&(t=u.fontStyle),u.foreground!==null&&(n=u.foreground),u.background!==null&&(r=u.background)}const o=new PYe;for(const u of e)o.getId(u);const s=o.getId(n),a=o.getId(r),l=new hY(t,s,a),c=new fY(l);for(let u=0,d=i.length;u"u"){const r=this._match(t),o=FYe(t);n=(r.metadata|o<<8)>>>0,this._cache.set(t,n)}return(n|e<<0)>>>0}}const OYe=/\b(comment|string|regex|regexp)\b/;function FYe(i){const e=i.match(OYe);if(!e)return 0;switch(e[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"regexp":return 3}throw new Error("Unexpected match for standard token type!")}function BYe(i,e){return ie?1:0}class hY{constructor(e,t,n){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=n,this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}clone(){return new hY(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,n){e!==-1&&(this._fontStyle=e),t!==0&&(this._foreground=t),n!==0&&(this._background=n),this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}}class fY{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 n,r;t===-1?(n=e,r=""):(n=e.substring(0,t),r=e.substring(t+1));const o=this._children.get(n);return typeof o<"u"?o.match(r):this._mainRule}insert(e,t,n,r){if(e===""){this._mainRule.acceptOverwrite(t,n,r);return}const o=e.indexOf(".");let s,a;o===-1?(s=e,a=""):(s=e.substring(0,o),a=e.substring(o+1));let l=this._children.get(s);typeof l>"u"&&(l=new fY(this._mainRule.clone()),this._children.set(s,l)),l.insert(a,t,n,r)}}function WYe(i){const e=[];for(let t=1,n=i.length;t{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),n.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,n=>{if(n.keyCode===10||n.keyCode===3){this.checked=!this._checked,this._onChange.fire(!0),n.preventDefault(),n.stopPropagation();return}this._onKeyDown.fire(n)})}get enabled(){return this.domNode.getAttribute("aria-disabled")!=="true"}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}width(){return 2+2+2+16}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder||"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground||"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground||"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1))}disable(){this.domNode.setAttribute("aria-disabled",String(!0))}}const uXe=w("caseDescription","Match Case"),dXe=w("wordsDescription","Match Whole Word"),hXe=w("regexDescription","Use Regular Expression");class t0e extends AS{constructor(e){super({icon:Xe.caseSensitive,title:uXe+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class n0e extends AS{constructor(e){super({icon:Xe.wholeWord,title:dXe+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class i0e extends AS{constructor(e){super({icon:Xe.regex,title:hXe+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class fXe{constructor(e,t=0,n=e.length,r=t-1){this.items=e,this.start=t,this.end=n,this.index=r}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 gXe{constructor(e=[],t=10){this._initialize(e),this._limit=t,this._onChange()}getHistory(){return this._elements}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._navigator.next()}previous(){return this._currentPosition()!==0?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}isLast(){return this._currentPosition()>=this._elements.length-1}isNowhere(){return this._navigator.current()===null}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new fXe(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 Ux=He;let pXe=class extends yc{constructor(e,t,n){var r;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new se),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new se),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=n,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=(r=this.options.tooltip)!==null&&r!==void 0?r:this.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=ke(e,Ux(".monaco-inputbox.idle"));const o=this.options.flexibleHeight?"textarea":"input",s=ke(this.element,Ux(".ibwrapper"));if(this.input=ke(s,Ux(o+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,()=>this.element.classList.add("synthetic-focus")),this.onblur(this.input,()=>this.element.classList.remove("synthetic-focus")),this.options.flexibleHeight){this.maxHeight=typeof this.options.flexibleMaxHeight=="number"?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=ke(s,Ux("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new pve(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),ke(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(c=>this.input.scrollTop=c.scrollTop));const a=this._register(new wn(e.ownerDocument,"selectionchange")),l=Je.filter(a.event,()=>{const c=e.ownerDocument.getSelection();return(c==null?void 0:c.anchorNode)===s});this._register(l(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,()=>this.onValueChange()),this.onblur(this.input,()=>this.onBlur()),this.onfocus(this.input,()=>this.onFocus()),this._register(this.ignoreGesture(this.input)),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actionbar=this._register(new au(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}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get height(){return typeof this.cachedHeight=="number"?this.cachedHeight:qg(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return Mk(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()}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if(typeof this.cachedContentHeight!="number"||typeof this.cachedHeight!="number"||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,n=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:n})}showMessage(e,t){if(this.state==="open"&&dc(this.message,e))return;this.message=e,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(e.type));const n=this.stylesForType(this.message.type);this.element.style.border=`1px solid ${gp(n.border,"transparent")}`,this.message.content&&(this.hasFocus()||t)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}validate(){let e=null;return this.validation&&(e=this.validation(this.value),e?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),e==null?void 0:e.type}stylesForType(e){const t=this.options.inputBoxStyles;switch(e){case 1:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case 2:return{border:t.inputValidationWarningBorder,background:t.inputValidationWarningBackground,foreground:t.inputValidationWarningForeground};default:return{border:t.inputValidationErrorBorder,background:t.inputValidationErrorBackground,foreground:t.inputValidationErrorForeground}}}classForType(e){switch(e){case 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e;const t=()=>e.style.width=ua(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:r=>{var o,s;if(!this.message)return null;e=ke(r,Ux(".monaco-inputbox-container")),t();const a={inline:!0,className:"monaco-inputbox-message"},l=this.message.formatContent?tKe(this.message.content,a):eKe(this.message.content,a);l.classList.add(this.classForType(this.message.type));const c=this.stylesForType(this.message.type);return l.style.backgroundColor=(o=c.background)!==null&&o!==void 0?o:"",l.style.color=(s=c.foreground)!==null&&s!==void 0?s:"",l.style.border=c.border?`1px solid ${c.border}`:"",ke(e,l),null},onHide:()=>{this.state="closed"},layout:t});let n;this.message.type===3?n=w("alertErrorMessage","Error: {0}",this.message.content):this.message.type===2?n=w("alertWarningMessage","Warning: {0}",this.message.content):n=w("alertInfoMessage","Info: {0}",this.message.content),kl(n),this.state="open"}_hideMessage(){this.contextViewProvider&&(this.state==="open"&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),this.state==="open"&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,n=e.charCodeAt(e.length-1)===10?" ":"";(e+n).replace(/\u000c/g,"")?this.mirror.textContent=e+n:this.mirror.innerText=" ",this.layout()}applyStyles(){var e,t,n;const r=this.options.inputBoxStyles,o=(e=r.inputBackground)!==null&&e!==void 0?e:"",s=(t=r.inputForeground)!==null&&t!==void 0?t:"",a=(n=r.inputBorder)!==null&&n!==void 0?n:"";this.element.style.backgroundColor=o,this.element.style.color=s,this.input.style.backgroundColor="inherit",this.input.style.color=s,this.element.style.border=`1px solid ${gp(a,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=qg(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,n=t.selectionStart,r=t.selectionEnd,o=t.value;n!==null&&r!==null&&(this.value=o.substr(0,n)+e+o.substr(r),t.setSelectionRange(n+1,n+1),this.layout())}dispose(){var e;this._hideMessage(),this.message=null,(e=this.actionbar)===null||e===void 0||e.dispose(),super.dispose()}};class r0e extends pXe{constructor(e,t,n){const r=w({key:"history.inputbox.hint.suffix.noparens",comment:['Text is the suffix of an input field placeholder coming after the action the input field performs, this will be used when the input field ends in a closing parenthesis ")", for example "Filter (e.g. text, !exclude)". The character inserted into the final string is ⇅ to represent the up and down arrow keys.']}," or {0} for history","⇅"),o=w({key:"history.inputbox.hint.suffix.inparens",comment:['Text is the suffix of an input field placeholder coming after the action the input field performs, this will be used when the input field does NOT end in a closing parenthesis (eg. "Find"). The character inserted into the final string is ⇅ to represent the up and down arrow keys.']}," ({0} for history)","⇅");super(e,t,n),this._onDidFocus=this._register(new se),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new se),this.onDidBlur=this._onDidBlur.event,this.history=new gXe(n.history,100);const s=()=>{if(n.showHistoryHint&&n.showHistoryHint()&&!this.placeholder.endsWith(r)&&!this.placeholder.endsWith(o)&&this.history.getHistory().length){const a=this.placeholder.endsWith(")")?r:o,l=this.placeholder+a;n.showPlaceholderOnFocus&&!Mk(this.input)?this.placeholder=l:this.setPlaceHolder(l)}};this.observer=new MutationObserver((a,l)=>{a.forEach(c=>{c.target.textContent||s()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>s()),this.onblur(this.input,()=>{const a=l=>{if(this.placeholder.endsWith(l)){const c=this.placeholder.slice(0,this.placeholder.length-l.length);return n.showPlaceholderOnFocus?this.placeholder=c:this.setPlaceHolder(c),!0}else return!1};a(o)||a(r)})}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(e){this.value&&(e||this.value!==this.getCurrentValue())&&this.history.add(this.value)}isAtLastInHistory(){return this.history.isLast()}isNowhereInHistory(){return this.history.isNowhere()}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),this.value=e??"",Hf(this.value?this.value:w("clearedInput","Cleared Input"))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,Hf(this.value))}setPlaceHolder(e){super.setPlaceHolder(e),this.setTooltip(e)}onBlur(){super.onBlur(),this._onDidBlur.fire()}onFocus(){super.onFocus(),this._onDidFocus.fire()}getCurrentValue(){let e=this.history.current();return e||(e=this.history.last(),this.history.next()),e}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()}}const mXe=w("defaultLabel","input");class o0e extends yc{constructor(e,t,n){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new Ho),this.additionalToggles=[],this._onDidOptionChange=this._register(new se),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new se),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new se),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new se),this._onKeyUp=this._register(new se),this._onCaseSensitiveKeyDown=this._register(new se),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new se),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=n.placeholder||"",this.validation=n.validation,this.label=n.label||mXe,this.showCommonFindToggles=!!n.showCommonFindToggles;const r=n.appendCaseSensitiveLabel||"",o=n.appendWholeWordsLabel||"",s=n.appendRegexLabel||"",a=n.history||[],l=!!n.flexibleHeight,c=!!n.flexibleWidth,u=n.flexibleMaxHeight;if(this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new r0e(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},history:a,showHistoryHint:n.showHistoryHint,flexibleHeight:l,flexibleWidth:c,flexibleMaxHeight:u,inputBoxStyles:n.inputBoxStyles})),this.showCommonFindToggles){this.regex=this._register(new i0e({appendTitle:s,isChecked:!1,...n.toggleStyles})),this._register(this.regex.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(h=>{this._onRegexKeyDown.fire(h)})),this.wholeWords=this._register(new n0e({appendTitle:o,isChecked:!1,...n.toggleStyles})),this._register(this.wholeWords.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new t0e({appendTitle:r,isChecked:!1,...n.toggleStyles})),this._register(this.caseSensitive.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(h=>{this._onCaseSensitiveKeyDown.fire(h)}));const d=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,h=>{if(h.equals(15)||h.equals(17)||h.equals(9)){const f=d.indexOf(this.domNode.ownerDocument.activeElement);if(f>=0){let g=-1;h.equals(17)?g=(f+1)%d.length:h.equals(15)&&(f===0?g=d.length-1:g=f-1),h.equals(9)?(d[f].blur(),this.inputBox.focus()):g>=0&&d[g].focus(),hn.stop(h,!0)}}})}this.controls=document.createElement("div"),this.controls.className="controls",this.controls.style.display=this.showCommonFindToggles?"":"none",this.caseSensitive&&this.controls.append(this.caseSensitive.domNode),this.wholeWords&&this.controls.appendChild(this.wholeWords.domNode),this.regex&&this.controls.appendChild(this.regex.domNode),this.setAdditionalToggles(n==null?void 0:n.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),e==null||e.appendChild(this.domNode),this._register(ye(this.inputBox.inputElement,"compositionstart",d=>{this.imeSessionInProgress=!0})),this._register(ye(this.inputBox.inputElement,"compositionend",d=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,d=>this._onKeyDown.fire(d)),this.onkeyup(this.inputBox.inputElement,d=>this._onKeyUp.fire(d)),this.oninput(this.inputBox.inputElement,d=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,d=>this._onMouseDown.fire(d))}get onDidChange(){return this.inputBox.onDidChange}layout(e){this.inputBox.layout(),this.updateInputBoxPadding(e.collapsedFindWidget)}enable(){var e,t,n;this.domNode.classList.remove("disabled"),this.inputBox.enable(),(e=this.regex)===null||e===void 0||e.enable(),(t=this.wholeWords)===null||t===void 0||t.enable(),(n=this.caseSensitive)===null||n===void 0||n.enable();for(const r of this.additionalToggles)r.enable()}disable(){var e,t,n;this.domNode.classList.add("disabled"),this.inputBox.disable(),(e=this.regex)===null||e===void 0||e.disable(),(t=this.wholeWords)===null||t===void 0||t.disable(),(n=this.caseSensitive)===null||n===void 0||n.disable();for(const r of this.additionalToggles)r.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}setAdditionalToggles(e){for(const t of this.additionalToggles)t.domNode.remove();this.additionalToggles=[],this.additionalTogglesDisposables.value=new Te;for(const t of e??[])this.additionalTogglesDisposables.value.add(t),this.controls.appendChild(t.domNode),this.additionalTogglesDisposables.value.add(t.onChange(n=>{this._onDidOptionChange.fire(n),!n&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()})),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){var t,n,r,o,s,a;e?this.inputBox.paddingRight=0:this.inputBox.paddingRight=((n=(t=this.caseSensitive)===null||t===void 0?void 0:t.width())!==null&&n!==void 0?n:0)+((o=(r=this.wholeWords)===null||r===void 0?void 0:r.width())!==null&&o!==void 0?o:0)+((a=(s=this.regex)===null||s===void 0?void 0:s.width())!==null&&a!==void 0?a:0)+this.additionalToggles.reduce((l,c)=>l+c.width(),0)}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){var e,t;return(t=(e=this.caseSensitive)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){var e,t;return(t=(e=this.wholeWords)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){var e,t;return(t=(e=this.regex)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){var e;(e=this.caseSensitive)===null||e===void 0||e.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}showMessage(e){this.inputBox.showMessage(e)}clearMessage(){this.inputBox.hideMessage()}}var Yl;(function(i){i[i.Expanded=0]="Expanded",i[i.Collapsed=1]="Collapsed",i[i.PreserveOrExpanded=2]="PreserveOrExpanded",i[i.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(Yl||(Yl={}));var U0;(function(i){i[i.Unknown=0]="Unknown",i[i.Twistie=1]="Twistie",i[i.Element=2]="Element",i[i.Filter=3]="Filter"})(U0||(U0={}));class rc extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class qX{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 XX(i){return typeof i=="object"&&"visibility"in i&&"data"in i}function uI(i){switch(i){case!0:return 1;case!1:return 0;default:return i}}function u9(i){return typeof i.collapsible=="boolean"}class vXe{constructor(e,t,n,r={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new uq,this._onDidChangeCollapseState=new se,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new se,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new se,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new nd(Vpe),this.collapseByDefault=typeof r.collapseByDefault>"u"?!1:r.collapseByDefault,this.filter=r.filter,this.autoExpandSingleChildren=typeof r.autoExpandSingleChildren>"u"?!1:r.autoExpandSingleChildren,this.root={parent:void 0,element:n,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,n=En.empty(),r={}){if(e.length===0)throw new rc(this.user,"Invalid tree location");r.diffIdentityProvider?this.spliceSmart(r.diffIdentityProvider,e,t,n,r):this.spliceSimple(e,t,n,r)}spliceSmart(e,t,n,r,o,s){var a;r===void 0&&(r=En.empty()),s===void 0&&(s=(a=o.diffDepth)!==null&&a!==void 0?a:0);const{parentNode:l}=this.getParentNodeWithListIndex(t);if(!l.lastDiffIds)return this.spliceSimple(t,n,r,o);const c=[...r],u=t[t.length-1],d=new df({getElements:()=>l.lastDiffIds},{getElements:()=>[...l.children.slice(0,u),...c,...l.children.slice(u+n)].map(v=>e.getId(v.element).toString())}).ComputeDiff(!1);if(d.quitEarly)return l.lastDiffIds=void 0,this.spliceSimple(t,n,c,o);const h=t.slice(0,-1),f=(v,m,_)=>{if(s>0)for(let y=0;y<_;y++)v--,m--,this.spliceSmart(e,[...h,v,0],Number.MAX_SAFE_INTEGER,c[m].children,o,s-1)};let g=Math.min(l.children.length,u+n),p=c.length;for(const v of d.changes.sort((m,_)=>_.originalStart-m.originalStart))f(g,p,g-(v.originalStart+v.originalLength)),g=v.originalStart,p=v.modifiedStart-u,this.spliceSimple([...h,g],v.originalLength,En.slice(c,p,p+v.modifiedLength),o);f(g,p,g)}spliceSimple(e,t,n=En.empty(),{onDidCreateNode:r,onDidDeleteNode:o,diffIdentityProvider:s}){const{parentNode:a,listIndex:l,revealed:c,visible:u}=this.getParentNodeWithListIndex(e),d=[],h=En.map(n,L=>this.createTreeNode(L,a,a.visible?1:0,c,d,r)),f=e[e.length-1];let g=0;for(let L=f;L>=0&&Ls.getId(L.element).toString())):a.lastDiffIds=a.children.map(L=>s.getId(L.element).toString()):a.lastDiffIds=void 0;let y=0;for(const L of _)L.visible&&y++;if(y!==0)for(let L=f+p.length;LE+(D.visible?D.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,m-L),this.list.splice(l,L,d)}if(_.length>0&&o){const L=E=>{o(E),E.children.forEach(L)};_.forEach(L)}this._onDidSplice.fire({insertedNodes:p,deletedNodes:_});let S=a;for(;S;){if(S.visibility===2){this.refilterDelayer.trigger(()=>this.refilter());break}S=S.parent}}rerender(e){if(e.length===0)throw new rc(this.user,"Invalid tree location");const{node:t,listIndex:n,revealed:r}=this.getTreeNodeWithListIndex(e);t.visible&&r&&this.list.splice(n,1,[t])}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:n,revealed:r}=this.getTreeNodeWithListIndex(e);return n&&r?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const n=this.getTreeNode(e);typeof t>"u"&&(t=!n.collapsible);const r={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,r))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,n){const r=this.getTreeNode(e);typeof t>"u"&&(t=!r.collapsed);const o={collapsed:t,recursive:n||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,o))}_setCollapseState(e,t){const{node:n,listIndex:r,revealed:o}=this.getTreeNodeWithListIndex(e),s=this._setListNodeCollapseState(n,r,o,t);if(n!==this.root&&this.autoExpandSingleChildren&&s&&!u9(t)&&n.collapsible&&!n.collapsed&&!t.recursive){let a=-1;for(let l=0;l-1){a=-1;break}else a=l;a>-1&&this._setCollapseState([...e,a],t)}return s}_setListNodeCollapseState(e,t,n,r){const o=this._setNodeCollapseState(e,r,!1);if(!n||!e.visible||!o)return o;const s=e.renderNodeCount,a=this.updateNodeAfterCollapseChange(e),l=s-(t===-1?0:1);return this.list.splice(t+1,l,a.slice(1)),o}_setNodeCollapseState(e,t,n){let r;if(e===this.root?r=!1:(u9(t)?(r=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(r=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):r=!1,r&&this._onDidChangeCollapseState.fire({node:e,deep:n})),!u9(t)&&t.recursive)for(const o of e.children)r=this._setNodeCollapseState(o,t,!0)||r;return r}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,n,r,o,s){const a={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:typeof e.collapsible=="boolean"?e.collapsible:typeof e.collapsed<"u",collapsed:typeof e.collapsed>"u"?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},l=this._filterNode(a,n);a.visibility=l,r&&o.push(a);const c=e.children||En.empty(),u=r&&l!==0&&!a.collapsed;let d=0,h=1;for(const f of c){const g=this.createTreeNode(f,a,l,u,o,s);a.children.push(g),h+=g.renderNodeCount,g.visible&&(g.visibleChildIndex=d++)}return a.collapsible=a.collapsible||a.children.length>0,a.visibleChildrenCount=d,a.visible=l===2?d>0:l===1,a.visible?a.collapsed||(a.renderNodeCount=h):(a.renderNodeCount=0,r&&o.pop()),s==null||s(a),a}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,n=[];return this._updateNodeAfterCollapseChange(e,n),this._updateAncestorsRenderNodeCount(e.parent,n.length-t),n}_updateNodeAfterCollapseChange(e,t){if(e.visible===!1)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const n of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(n,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,n=[];return this._updateNodeAfterFilterChange(e,e.visible?1:0,n),this._updateAncestorsRenderNodeCount(e.parent,n.length-t),n}_updateNodeAfterFilterChange(e,t,n,r=!0){let o;if(e!==this.root){if(o=this._filterNode(e,t),o===0)return e.visible=!1,e.renderNodeCount=0,!1;r&&n.push(e)}const s=n.length;e.renderNodeCount=e===this.root?0:1;let a=!1;if(!e.collapsed||o!==0){let l=0;for(const c of e.children)a=this._updateNodeAfterFilterChange(c,o,n,r&&!e.collapsed)||a,c.visible&&(c.visibleChildIndex=l++);e.visibleChildrenCount=l}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=o===2?a:o===1,e.visibility=o),e.visible?e.collapsed||(e.renderNodeCount+=n.length-s):(e.renderNodeCount=0,r&&n.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(t!==0)for(;e;)e.renderNodeCount+=t,this._onDidChangeRenderNodeCount.fire(e),e=e.parent}_filterNode(e,t){const n=this.filter?this.filter.filter(e.element,t):1;return typeof n=="boolean"?(e.filterData=void 0,n?1:0):XX(n)?(e.filterData=n.data,uI(n.visibility)):(e.filterData=void 0,uI(n))}hasTreeNode(e,t=this.root){if(!e||e.length===0)return!0;const[n,...r]=e;return n<0||n>t.children.length?!1:this.hasTreeNode(r,t.children[n])}getTreeNode(e,t=this.root){if(!e||e.length===0)return t;const[n,...r]=e;if(n<0||n>t.children.length)throw new rc(this.user,"Invalid tree location");return this.getTreeNode(r,t.children[n])}getTreeNodeWithListIndex(e){if(e.length===0)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:n,revealed:r,visible:o}=this.getParentNodeWithListIndex(e),s=e[e.length-1];if(s<0||s>t.children.length)throw new rc(this.user,"Invalid tree location");const a=t.children[s];return{node:a,listIndex:n,revealed:r,visible:o&&a.visible}}getParentNodeWithListIndex(e,t=this.root,n=0,r=!0,o=!0){const[s,...a]=e;if(s<0||s>t.children.length)throw new rc(this.user,"Invalid tree location");for(let l=0;lt.element)),this.data=e}}function d9(i){return i instanceof Yk?new _Xe(i):i}class bXe{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=fe.None,this.disposables=new Te}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(n=>n.element),t)}onDragStart(e,t){var n,r;(r=(n=this.dnd).onDragStart)===null||r===void 0||r.call(n,d9(e),t)}onDragOver(e,t,n,r,o,s=!0){const a=this.dnd.onDragOver(d9(e),t&&t.element,n,r,o),l=this.autoExpandNode!==t;if(l&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),typeof t>"u")return a;if(l&&typeof a!="boolean"&&a.autoExpand&&(this.autoExpandDisposable=jv(()=>{const f=this.modelProvider(),g=f.getNodeLocation(t);f.isCollapsed(g)&&f.setCollapsed(g,!1),this.autoExpandNode=void 0},500,this.disposables)),typeof a=="boolean"||!a.accept||typeof a.bubble>"u"||a.feedback){if(!s){const f=typeof a=="boolean"?a:a.accept,g=typeof a=="boolean"?void 0:a.effect;return{accept:f,effect:g,feedback:[n]}}return a}if(a.bubble===1){const f=this.modelProvider(),g=f.getNodeLocation(t),p=f.getParentNodeLocation(g),v=f.getNode(p),m=p&&f.getListIndex(p);return this.onDragOver(e,v,m,r,o,!1)}const c=this.modelProvider(),u=c.getNodeLocation(t),d=c.getListIndex(u),h=c.getListRenderCount(u);return{...a,feedback:la(d,d+h)}}drop(e,t,n,r,o){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(d9(e),t&&t.element,n,r,o)}onDragEnd(e){var t,n;(n=(t=this.dnd).onDragEnd)===null||n===void 0||n.call(t,e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function CXe(i,e){return e&&{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new bXe(i,e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent(t){return e.multipleSelectionController.isSelectionSingleChangeEvent({...t,element:t.element})},isSelectionRangeChangeEvent(t){return e.multipleSelectionController.isSelectionRangeChangeEvent({...t,element:t.element})}},accessibilityProvider:e.accessibilityProvider&&{...e.accessibilityProvider,getSetSize(t){const n=i(),r=n.getNodeLocation(t),o=n.getParentNodeLocation(r);return n.getNode(o).visibleChildrenCount},getPosInSet(t){return t.visibleChildIndex+1},isChecked:e.accessibilityProvider&&e.accessibilityProvider.isChecked?t=>e.accessibilityProvider.isChecked(t.element):void 0,getRole:e.accessibilityProvider&&e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",getAriaLabel(t){return e.accessibilityProvider.getAriaLabel(t.element)},getWidgetAriaLabel(){return e.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:e.accessibilityProvider&&e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider&&e.accessibilityProvider.getAriaLevel?t=>e.accessibilityProvider.getAriaLevel(t.element):t=>t.depth,getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))},keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(t){return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}}}}class YX{constructor(e){this.delegate=e}getHeight(e){return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,t){var n,r;(r=(n=this.delegate).setDynamicHeight)===null||r===void 0||r.call(n,e.element,t)}}var dI;(function(i){i.None="none",i.OnHover="onHover",i.Always="always"})(dI||(dI={}));class yXe{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new Te,this.onDidChange=Je.forEach(e,n=>this._elements=n,this.disposables)}dispose(){this.disposables.dispose()}}class hI{constructor(e,t,n,r,o,s={}){var a;this.renderer=e,this.modelProvider=t,this.activeNodes=r,this.renderedIndentGuides=o,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=hI.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=fe.None,this.disposables=new Te,this.templateId=e.templateId,this.updateOptions(s),Je.map(n,l=>l.node)(this.onDidChangeNodeTwistieState,this,this.disposables),(a=e.onDidChangeTwistieState)===null||a===void 0||a.call(e,this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(typeof e.indent<"u"){const t=da(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[n,r]of this.renderedNodes)this.renderTreeElement(n,r)}}if(typeof e.renderIndentGuides<"u"){const t=e.renderIndentGuides!==dI.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(const[n,r]of this.renderedNodes)this._renderIndentGuides(n,r);if(this.indentGuidesDisposable.dispose(),t){const n=new Te;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,n),this.indentGuidesDisposable=n,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}typeof e.hideTwistiesOfChildlessElements<"u"&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=ke(e,He(".monaco-tl-row")),n=ke(t,He(".monaco-tl-indent")),r=ke(t,He(".monaco-tl-twistie")),o=ke(t,He(".monaco-tl-contents")),s=this.renderer.renderTemplate(o);return{container:e,indent:n,twistie:r,indentGuidesDisposable:fe.None,templateData:s}}renderElement(e,t,n,r){this.renderedNodes.set(e,n),this.renderedElements.set(e.element,e),this.renderTreeElement(e,n),this.renderer.renderElement(e,t,n.templateData,r)}disposeElement(e,t,n,r){var o,s;n.indentGuidesDisposable.dispose(),(s=(o=this.renderer).disposeElement)===null||s===void 0||s.call(o,e,t,n.templateData,r),typeof r=="number"&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){const t=this.renderedElements.get(e);t&&this.onDidChangeNodeTwistieState(t)}onDidChangeNodeTwistieState(e){const t=this.renderedNodes.get(e);t&&(this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderTreeElement(e,t))}renderTreeElement(e,t){const n=hI.DefaultIndent+(e.depth-1)*this.indent;t.twistie.style.paddingLeft=`${n}px`,t.indent.style.width=`${n+this.indent-16}px`,e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...Wt.asClassNameArray(Xe.treeItemExpanded));let r=!1;this.renderer.renderTwistie&&(r=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(r||t.twistie.classList.add(...Wt.asClassNameArray(Xe.treeItemExpanded)),t.twistie.classList.add("collapsible"),t.twistie.classList.toggle("collapsed",e.collapsed)):t.twistie.classList.remove("collapsible","collapsed"),this._renderIndentGuides(e,t)}_renderIndentGuides(e,t){if(Ns(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const n=new Te,r=this.modelProvider();for(;;){const o=r.getNodeLocation(e),s=r.getParentNodeLocation(o);if(!s)break;const a=r.getNode(s),l=He(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(a)&&l.classList.add("active"),t.indent.childElementCount===0?t.indent.appendChild(l):t.indent.insertBefore(l,t.indent.firstElementChild),this.renderedIndentGuides.add(a,l),n.add(Rt(()=>this.renderedIndentGuides.delete(a,l))),e=a}t.indentGuidesDisposable=n}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,n=this.modelProvider();e.forEach(r=>{const o=n.getNodeLocation(r);try{const s=n.getParentNodeLocation(o);r.collapsible&&r.children.length>0&&!r.collapsed?t.add(r):s&&t.add(n.getNode(s))}catch{}}),this.activeIndentNodes.forEach(r=>{t.has(r)||this.renderedIndentGuides.forEach(r,o=>o.classList.remove("active"))}),t.forEach(r=>{this.activeIndentNodes.has(r)||this.renderedIndentGuides.forEach(r,o=>o.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),si(this.disposables)}}hI.DefaultIndent=8;class wXe{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}constructor(e,t,n){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=n,this._totalCount=0,this._matchCount=0,this._pattern="",this._lowercasePattern="",this.disposables=new Te,e.onWillRefilter(this.reset,this,this.disposables)}filter(e,t){let n=1;if(this._filter){const s=this._filter.filter(e,t);if(typeof s=="boolean"?n=s?1:0:XX(s)?n=uI(s.visibility):n=s,n===0)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:rh.Default,visibility:n};const r=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),o=Array.isArray(r)?r:[r];for(const s of o){const a=s&&s.toString();if(typeof a>"u")return{data:rh.Default,visibility:n};let l;if(this.tree.findMatchType===Ob.Contiguous){const c=a.toLowerCase().indexOf(this._lowercasePattern);if(c>-1){l=[Number.MAX_SAFE_INTEGER,0];for(let u=this._lowercasePattern.length;u>0;u--)l.push(c+u-1)}}else l=Ab(this._pattern,this._lowercasePattern,0,a,a.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(l)return this._matchCount++,o.length===1?{data:l,visibility:n}:{data:{label:a,score:l},visibility:n}}return this.tree.findMode===sp.Filter?typeof this.tree.options.defaultFindVisibility=="number"?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):2:{data:rh.Default,visibility:n}}reset(){this._totalCount=0,this._matchCount=0}dispose(){si(this.disposables)}}var sp;(function(i){i[i.Highlight=0]="Highlight",i[i.Filter=1]="Filter"})(sp||(sp={}));var Ob;(function(i){i[i.Fuzzy=0]="Fuzzy",i[i.Contiguous=1]="Contiguous"})(Ob||(Ob={}));let SXe=class{get pattern(){return this._pattern}get mode(){return this._mode}set mode(e){e!==this._mode&&(this._mode=e,this.widget&&(this.widget.mode=this._mode),this.tree.refilter(),this.render(),this._onDidChangeMode.fire(e))}get matchType(){return this._matchType}set matchType(e){e!==this._matchType&&(this._matchType=e,this.widget&&(this.widget.matchType=this._matchType),this.tree.refilter(),this.render(),this._onDidChangeMatchType.fire(e))}constructor(e,t,n,r,o,s={}){var a,l;this.tree=e,this.view=n,this.filter=r,this.contextViewProvider=o,this.options=s,this._pattern="",this.width=0,this._onDidChangeMode=new se,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new se,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new se,this._onDidChangeOpenState=new se,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new Te,this.disposables=new Te,this._mode=(a=e.options.defaultFindMode)!==null&&a!==void 0?a:sp.Highlight,this._matchType=(l=e.options.defaultFindMatchType)!==null&&l!==void 0?l:Ob.Fuzzy,t.onDidSplice(this.onDidSpliceModel,this,this.disposables)}updateOptions(e={}){e.defaultFindMode!==void 0&&(this.mode=e.defaultFindMode),e.defaultFindMatchType!==void 0&&(this.matchType=e.defaultFindMatchType)}onDidSpliceModel(){!this.widget||this.pattern.length===0||(this.tree.refilter(),this.render())}render(){var e,t,n,r;const o=this.filter.totalCount>0&&this.filter.matchCount===0;this.pattern&&o?!((e=this.tree.options.showNotFoundMessage)!==null&&e!==void 0)||e?(t=this.widget)===null||t===void 0||t.showMessage({type:2,content:w("not found","No elements found.")}):(n=this.widget)===null||n===void 0||n.showMessage({type:2}):(r=this.widget)===null||r===void 0||r.clearMessage()}shouldAllowFocus(e){return!this.widget||!this.pattern||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!rh.isDefault(e.filterData)}layout(e){var t;this.width=e,(t=this.widget)===null||t===void 0||t.layout(e)}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}};function xXe(i,e){return i.position===e.position&&s0e(i,e)}function s0e(i,e){return i.node.element===e.node.element&&i.startIndex===e.startIndex&&i.height===e.height&&i.endIndex===e.endIndex}class LXe{constructor(e=[]){this.stickyNodes=e}get count(){return this.stickyNodes.length}equal(e){return or(this.stickyNodes,e.stickyNodes,xXe)}lastNodePartiallyVisible(){if(this.count===0)return!1;const e=this.stickyNodes[this.count-1];if(this.count===1)return e.position!==0;const t=this.stickyNodes[this.count-2];return t.position+t.height!==e.position}animationStateChanged(e){if(!or(this.stickyNodes,e.stickyNodes,s0e)||this.count===0)return!1;const t=this.stickyNodes[this.count-1],n=e.stickyNodes[e.count-1];return t.position!==n.position}}class EXe{constrainStickyScrollNodes(e,t,n){for(let r=0;rn||r>=t)return e.slice(0,r)}return e}}let rse=class extends fe{constructor(e,t,n,r,o,s={}){var a;super(),this.tree=e,this.model=t,this.view=n,this.treeDelegate=o,this.maxWidgetViewRatio=.4;const l=this.validateStickySettings(s);this.stickyScrollMaxItemCount=l.stickyScrollMaxItemCount,this.stickyScrollDelegate=(a=s.stickyScrollDelegate)!==null&&a!==void 0?a:new EXe,this._widget=this._register(new DXe(n.getScrollableElement(),n,e,r,o,s.accessibilityProvider)),this.onDidChangeHasFocus=this._widget.onDidChangeHasFocus,this.onContextMenu=this._widget.onContextMenu,this._register(n.onDidScroll(()=>this.update())),this._register(n.onDidChangeContentHeight(()=>this.update())),this._register(e.onDidChangeCollapseState(()=>this.update())),this.update()}getNodeAtHeight(e){let t;if(e===0?t=this.view.firstVisibleIndex:t=this.view.indexAt(e+this.view.scrollTop),!(t<0||t>=this.view.length))return this.view.element(t)}update(){const e=this.getNodeAtHeight(0);if(!e||this.tree.scrollTop===0){this._widget.setState(void 0);return}const t=this.findStickyState(e);this._widget.setState(t)}findStickyState(e){const t=[];let n=e,r=0,o=this.getNextStickyNode(n,void 0,r);for(;o&&(t.push(o),r+=o.height,!(t.length<=this.stickyScrollMaxItemCount&&(n=this.getNextVisibleNode(o),!n)));)o=this.getNextStickyNode(n,o.node,r);const s=this.constrainStickyNodes(t);return s.length?new LXe(s):void 0}getNextVisibleNode(e){return this.getNodeAtHeight(e.position+e.height)}getNextStickyNode(e,t,n){const r=this.getAncestorUnderPrevious(e,t);if(r&&!(r===e&&(!this.nodeIsUncollapsedParent(e)||this.nodeTopAlignsWithStickyNodesBottom(e,n))))return this.createStickyScrollNode(r,n)}nodeTopAlignsWithStickyNodesBottom(e,t){const n=this.getNodeIndex(e),r=this.view.getElementTop(n),o=t;return this.view.scrollTop===r-o}createStickyScrollNode(e,t){const n=this.treeDelegate.getHeight(e),{startIndex:r,endIndex:o}=this.getNodeRange(e),s=this.calculateStickyNodePosition(o,t,n);return{node:e,position:s,height:n,startIndex:r,endIndex:o}}getAncestorUnderPrevious(e,t=void 0){let n=e,r=this.getParentNode(n);for(;r;){if(r===t)return n;n=r,r=this.getParentNode(n)}if(t===void 0)return n}calculateStickyNodePosition(e,t,n){let r=this.view.getRelativeTop(e);if(r===null&&this.view.firstVisibleIndex===e&&e+1l&&t<=l?l-n:t}constrainStickyNodes(e){if(e.length===0)return[];const t=this.view.renderHeight*this.maxWidgetViewRatio,n=e[e.length-1];if(e.length<=this.stickyScrollMaxItemCount&&n.position+n.height<=t)return e;const r=this.stickyScrollDelegate.constrainStickyScrollNodes(e,this.stickyScrollMaxItemCount,t);if(!r.length)return[];const o=r[r.length-1];if(r.length>this.stickyScrollMaxItemCount||o.position+o.height>t)throw new Error("stickyScrollDelegate violates constraints");return r}getParentNode(e){const t=this.model.getNodeLocation(e),n=this.model.getParentNodeLocation(t);return n?this.model.getNode(n):void 0}nodeIsUncollapsedParent(e){const t=this.model.getNodeLocation(e);return this.model.getListRenderCount(t)>1}getNodeIndex(e){const t=this.model.getNodeLocation(e);return this.model.getListIndex(t)}getNodeRange(e){const t=this.model.getNodeLocation(e),n=this.model.getListIndex(t);if(n<0)throw new Error("Node not found in tree");const r=this.model.getListRenderCount(t),o=n+r-1;return{startIndex:n,endIndex:o}}nodePositionTopBelowWidget(e){const t=[];let n=this.getParentNode(e);for(;n;)t.push(n),n=this.getParentNode(n);let r=0;for(let o=0;o0,n=!!e&&e.count>0;if(!t&&!n||t&&n&&this._previousState.equal(e))return;if(t!==n&&this.setVisible(n),!n){this._previousState=void 0,this._previousElements=[],this._previousStateDisposables.clear();return}const r=e.stickyNodes[e.count-1];if(this._previousState&&e.animationStateChanged(this._previousState))this._previousElements[this._previousState.count-1].style.top=`${r.position}px`;else{this._previousStateDisposables.clear();const o=Array(e.count);for(let s=e.count-1;s>=0;s--){const a=e.stickyNodes[s],{element:l,disposable:c}=this.createElement(a,s,e.count);o[s]=l,this._rootDomNode.appendChild(l),this._previousStateDisposables.add(c)}this.stickyScrollFocus.updateElements(o,e),this._previousElements=o}this._previousState=e,this._rootDomNode.style.height=`${r.position+r.height}px`}createElement(e,t,n){const r=e.startIndex,o=document.createElement("div");o.style.top=`${e.position}px`,o.style.height=`${e.height}px`,o.style.lineHeight=`${e.height}px`,o.classList.add("monaco-tree-sticky-row"),o.classList.add("monaco-list-row"),o.setAttribute("data-index",`${r}`),o.setAttribute("data-parity",r%2===0?"even":"odd"),o.setAttribute("id",this.view.getElementID(r)),this.setAccessibilityAttributes(o,e.node.element,t,n);const s=this.treeDelegate.getTemplateId(e.node),a=this.treeRenderers.find(d=>d.templateId===s);if(!a)throw new Error(`No renderer found for template id ${s}`);let l=e.node;l===this.tree.getNode(this.tree.getNodeLocation(e.node))&&(l=new Proxy(e.node,{}));const c=a.renderTemplate(o);a.renderElement(l,e.startIndex,c,e.height);const u=Rt(()=>{a.disposeElement(l,e.startIndex,c,e.height),a.disposeTemplate(c),o.remove()});return{element:o,disposable:u}}setAccessibilityAttributes(e,t,n,r){var o;if(!this.accessibilityProvider)return;this.accessibilityProvider.getSetSize&&e.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(t,n,r))),this.accessibilityProvider.getPosInSet&&e.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(t,n))),this.accessibilityProvider.getRole&&e.setAttribute("role",(o=this.accessibilityProvider.getRole(t))!==null&&o!==void 0?o:"treeitem");const s=this.accessibilityProvider.getAriaLabel(t);s&&e.setAttribute("aria-label",s);const a=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(t);typeof a=="number"&&e.setAttribute("aria-level",`${a}`),e.setAttribute("aria-selected",String(!1))}setVisible(e){this._rootDomNode.classList.toggle("empty",!e),e||this.stickyScrollFocus.updateElements([],void 0)}domFocus(){this.stickyScrollFocus.domFocus()}focusedLast(){return this.stickyScrollFocus.focusedLast()}dispose(){this.stickyScrollFocus.dispose(),this._previousStateDisposables.dispose(),this._rootDomNode.remove()}};class IXe extends fe{get domHasFocus(){return this._domHasFocus}set domHasFocus(e){e!==this._domHasFocus&&(this._onDidChangeHasFocus.fire(e),this._domHasFocus=e)}constructor(e,t){super(),this.container=e,this.view=t,this.focusedIndex=-1,this.elements=[],this._onDidChangeHasFocus=new se,this.onDidChangeHasFocus=this._onDidChangeHasFocus.event,this._onContextMenu=new se,this.onContextMenu=this._onContextMenu.event,this._domHasFocus=!1,this.container.addEventListener("focus",()=>this.onFocus()),this.container.addEventListener("blur",()=>this.onBlur()),this._register(this.view.onDidFocus(()=>this.toggleStickyScrollFocused(!1))),this._register(this.view.onKeyDown(n=>this.onKeyDown(n))),this._register(this.view.onMouseDown(n=>this.onMouseDown(n))),this._register(this.view.onContextMenu(n=>this.handleContextMenu(n)))}handleContextMenu(e){const t=e.browserEvent.target;if(!AP(t)&&!IE(t)){this.focusedLast()&&this.view.domFocus();return}if(!kq(e.browserEvent)){if(!this.state)throw new Error("Context menu should not be triggered when state is undefined");const s=this.state.stickyNodes.findIndex(a=>{var l;return a.node.element===((l=e.element)===null||l===void 0?void 0:l.element)});if(s===-1)throw new Error("Context menu should not be triggered when element is not in sticky scroll widget");this.container.focus(),this.setFocus(s);return}if(!this.state||this.focusedIndex<0)throw new Error("Context menu key should not be triggered when focus is not in sticky scroll widget");const r=this.state.stickyNodes[this.focusedIndex].node.element,o=this.elements[this.focusedIndex];this._onContextMenu.fire({element:r,anchor:o,browserEvent:e.browserEvent,isStickyScroll:!0})}onKeyDown(e){if(this.domHasFocus&&this.state){if(e.key==="ArrowUp")this.setFocusedElement(Math.max(0,this.focusedIndex-1)),e.preventDefault(),e.stopPropagation();else if(e.key==="ArrowDown"||e.key==="ArrowRight"){if(this.focusedIndex>=this.state.count-1){const t=this.state.stickyNodes[this.state.count-1].startIndex+1;this.view.domFocus(),this.view.setFocus([t]),this.scrollNodeUnderWidget(t,this.state)}else this.setFocusedElement(this.focusedIndex+1);e.preventDefault(),e.stopPropagation()}}}onMouseDown(e){const t=e.browserEvent.target;!AP(t)&&!IE(t)||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation())}updateElements(e,t){if(t&&t.count===0)throw new Error("Sticky scroll state must be undefined when there are no sticky nodes");if(t&&t.count!==e.length)throw new Error("Sticky scroll focus received illigel state");const n=this.focusedIndex;if(this.removeFocus(),this.elements=e,this.state=t,t){const r=da(n,0,t.count-1);this.setFocus(r)}else this.domHasFocus&&this.view.domFocus();this.container.tabIndex=t?0:-1}setFocusedElement(e){const t=this.state;if(!t)throw new Error("Cannot set focus when state is undefined");if(this.setFocus(e),!(e1?t.stickyNodes[t.count-2]:void 0,o=this.view.getElementTop(e),s=r?r.position+r.height+n.height:n.height;this.view.scrollTop=o-s}domFocus(){if(!this.state)throw new Error("Cannot focus when state is undefined");this.container.focus()}focusedLast(){return this.state?this.view.getHTMLElement().classList.contains("sticky-scroll-focused"):!1}removeFocus(){this.focusedIndex!==-1&&(this.toggleElementFocus(this.elements[this.focusedIndex],!1),this.focusedIndex=-1)}setFocus(e){if(0>e)throw new Error("addFocus() can not remove focus");if(!this.state&&e>=0)throw new Error("Cannot set focus index when state is undefined");if(this.state&&e>=this.state.count)throw new Error("Cannot set focus index to an index that does not exist");const t=this.focusedIndex;t>=0&&this.toggleElementFocus(this.elements[t],!1),e>=0&&this.toggleElementFocus(this.elements[e],!0),this.focusedIndex=e}toggleElementFocus(e,t){e.classList.toggle("focused",t)}toggleStickyScrollFocused(e){this.view.getHTMLElement().classList.toggle("sticky-scroll-focused",e)}onFocus(){if(!this.state||this.elements.length===0)throw new Error("Cannot focus when state is undefined or elements are empty");this.domHasFocus=!0,this.toggleStickyScrollFocused(!0),this.focusedIndex===-1&&this.setFocus(0)}onBlur(){this.domHasFocus=!1}dispose(){this.toggleStickyScrollFocused(!1),this._onDidChangeHasFocus.fire(!1),super.dispose()}}function ose(i){let e=U0.Unknown;return c6(i.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=U0.Twistie:c6(i.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=U0.Element:c6(i.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=U0.Filter),{browserEvent:i.browserEvent,element:i.element?i.element.element:null,target:e}}function kM(i,e){e(i),i.children.forEach(t=>kM(t,e))}class h9{get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}constructor(e,t){this.getFirstViewElementWithTrait=e,this.identityProvider=t,this.nodes=[],this._onDidChange=new se,this.onDidChange=this._onDidChange.event}set(e,t){!(t!=null&&t.__forceEvent)&&or(this.nodes,e)||this._set(e,!1,t)}_set(e,t,n){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const r=this;this._onDidChange.fire({get elements(){return r.get()},browserEvent:n})}}get(){return this.elements||(this.elements=this.nodes.map(e=>e.element)),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}){if(!this.identityProvider){const l=this.createNodeSet(),c=u=>l.delete(u);t.forEach(u=>kM(u,c)),this.set([...l.values()]);return}const n=new Set,r=l=>n.add(this.identityProvider.getId(l.element).toString());t.forEach(l=>kM(l,r));const o=new Map,s=l=>o.set(this.identityProvider.getId(l.element).toString(),l);e.forEach(l=>kM(l,s));const a=[];for(const l of this.nodes){const c=this.identityProvider.getId(l.element).toString();if(!n.has(c))a.push(l);else{const d=o.get(c);d&&d.visible&&a.push(d)}}if(this.nodes.length>0&&a.length===0){const l=this.getFirstViewElementWithTrait();l&&a.push(l)}this._set(a,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class kXe extends z_e{constructor(e,t,n){super(e),this.tree=t,this.stickyScrollProvider=n}onViewPointer(e){if(W_e(e.browserEvent.target)||Lv(e.browserEvent.target)||FL(e.browserEvent.target)||e.browserEvent.isHandledByList)return;const t=e.element;if(!t)return super.onViewPointer(e);if(this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);const n=e.browserEvent.target,r=n.classList.contains("monaco-tl-twistie")||n.classList.contains("monaco-icon-label")&&n.classList.contains("folder-icon")&&e.browserEvent.offsetX<16,o=IE(e.browserEvent.target);let s=!1;if(o?s=!0:typeof this.tree.expandOnlyOnTwistieClick=="function"?s=this.tree.expandOnlyOnTwistieClick(t.element):s=!!this.tree.expandOnlyOnTwistieClick,o)this.handleStickyScrollMouseEvent(e,t);else{if(s&&!r&&e.browserEvent.detail!==2)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e)}if(t.collapsible&&(!o||r)){const a=this.tree.getNodeLocation(t),l=e.browserEvent.altKey;if(this.tree.setFocus([a]),this.tree.toggleCollapsed(a,l),s&&r){e.browserEvent.isHandledByList=!0;return}}o||super.onViewPointer(e)}handleStickyScrollMouseEvent(e,t){if(lqe(e.browserEvent.target)||cqe(e.browserEvent.target))return;const n=this.stickyScrollProvider();if(!n)throw new Error("Sticky scroll controller not found");const r=this.list.indexOf(t),o=this.list.getElementTop(r),s=n.nodePositionTopBelowWidget(t);this.tree.scrollTop=o-s,this.list.domFocus(),this.list.setFocus([r]),this.list.setSelection([r])}onDoubleClick(e){e.browserEvent.target.classList.contains("monaco-tl-twistie")||!this.tree.expandOnDoubleClick||e.browserEvent.isHandledByList||super.onDoubleClick(e)}onMouseDown(e){const t=e.browserEvent.target;if(!AP(t)&&!IE(t)){super.onMouseDown(e);return}}onContextMenu(e){const t=e.browserEvent.target;if(!AP(t)&&!IE(t)){super.onContextMenu(e);return}}}class TXe extends wc{constructor(e,t,n,r,o,s,a,l){super(e,t,n,r,l),this.focusTrait=o,this.selectionTrait=s,this.anchorTrait=a}createMouseController(e){return new kXe(this,e.tree,e.stickyScrollProvider)}splice(e,t,n=[]){if(super.splice(e,t,n),n.length===0)return;const r=[],o=[];let s;n.forEach((a,l)=>{this.focusTrait.has(a)&&r.push(e+l),this.selectionTrait.has(a)&&o.push(e+l),this.anchorTrait.has(a)&&(s=e+l)}),r.length>0&&super.setFocus(Ep([...super.getFocus(),...r])),o.length>0&&super.setSelection(Ep([...super.getSelection(),...o])),typeof s=="number"&&super.setAnchor(s)}setFocus(e,t,n=!1){super.setFocus(e,t),n||this.focusTrait.set(e.map(r=>this.element(r)),t)}setSelection(e,t,n=!1){super.setSelection(e,t),n||this.selectionTrait.set(e.map(r=>this.element(r)),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(typeof e>"u"?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class a0e{get onDidScroll(){return this.view.onDidScroll}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return Je.filter(Je.map(this.view.onMouseDblClick,ose),e=>e.target!==U0.Filter)}get onPointer(){return Je.map(this.view.onPointer,ose)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return Je.signal(this.model.onDidSplice)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get findMode(){var e,t;return(t=(e=this.findController)===null||e===void 0?void 0:e.mode)!==null&&t!==void 0?t:sp.Highlight}set findMode(e){this.findController&&(this.findController.mode=e)}get findMatchType(){var e,t;return(t=(e=this.findController)===null||e===void 0?void 0:e.matchType)!==null&&t!==void 0?t:Ob.Fuzzy}set findMatchType(e){this.findController&&(this.findController.matchType=e)}get expandOnDoubleClick(){return typeof this._options.expandOnDoubleClick>"u"?!0:this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return typeof this._options.expandOnlyOnTwistieClick>"u"?!0:this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(e,t,n,r,o={}){var s;this._user=e,this._options=o,this.eventBufferer=new uq,this.onDidChangeFindOpenState=Je.None,this.onDidChangeStickyScrollFocused=Je.None,this.disposables=new Te,this._onWillRefilter=new se,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new se,this.treeDelegate=new YX(n);const a=new Wne,l=new Wne,c=this.disposables.add(new yXe(l.event)),u=new Wq;this.renderers=r.map(p=>new hI(p,()=>this.model,a.event,c,u,o));for(const p of this.renderers)this.disposables.add(p);let d;o.keyboardNavigationLabelProvider&&(d=new wXe(this,o.keyboardNavigationLabelProvider,o.filter),o={...o,filter:d},this.disposables.add(d)),this.focus=new h9(()=>this.view.getFocusedElements()[0],o.identityProvider),this.selection=new h9(()=>this.view.getSelectedElements()[0],o.identityProvider),this.anchor=new h9(()=>this.view.getAnchorElement(),o.identityProvider),this.view=new TXe(e,t,this.treeDelegate,this.renderers,this.focus,this.selection,this.anchor,{...CXe(()=>this.model,o),tree:this,stickyScrollProvider:()=>this.stickyScrollController}),this.model=this.createModel(e,this.view,o),a.input=this.model.onDidChangeCollapseState;const h=Je.forEach(this.model.onDidSplice,p=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(p),this.selection.onDidModelSplice(p)})},this.disposables);h(()=>null,null,this.disposables);const f=this.disposables.add(new se),g=this.disposables.add(new nd(0));if(this.disposables.add(Je.any(h,this.focus.onDidChange,this.selection.onDidChange)(()=>{g.trigger(()=>{const p=new Set;for(const v of this.focus.getNodes())p.add(v);for(const v of this.selection.getNodes())p.add(v);f.fire([...p.values()])})})),l.input=f.event,o.keyboardSupport!==!1){const p=Je.chain(this.view.onKeyDown,v=>v.filter(m=>!Lv(m.target)).map(m=>new Ai(m)));Je.chain(p,v=>v.filter(m=>m.keyCode===15))(this.onLeftArrow,this,this.disposables),Je.chain(p,v=>v.filter(m=>m.keyCode===17))(this.onRightArrow,this,this.disposables),Je.chain(p,v=>v.filter(m=>m.keyCode===10))(this.onSpace,this,this.disposables)}if((!((s=o.findWidgetEnabled)!==null&&s!==void 0)||s)&&o.keyboardNavigationLabelProvider&&o.contextViewProvider){const p=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new SXe(this,this.model,this.view,d,o.contextViewProvider,p),this.focusNavigationFilter=v=>this.findController.shouldAllowFocus(v),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.disposables.add(this.findController),this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=Je.None,this.onDidChangeFindMatchType=Je.None;o.enableStickyScroll&&(this.stickyScrollController=new rse(this,this.model,this.view,this.renderers,this.treeDelegate,o),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus),this.styleElement=gc(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===dI.Always)}updateOptions(e={}){var t;this._options={...this._options,...e};for(const n of this.renderers)n.updateOptions(e);this.view.updateOptions(this._options),(t=this.findController)===null||t===void 0||t.updateOptions(e),this.updateStickyScroll(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===dI.Always)}get options(){return this._options}updateStickyScroll(e){var t;!this.stickyScrollController&&this._options.enableStickyScroll?(this.stickyScrollController=new rse(this,this.model,this.view,this.renderers,this.treeDelegate,this._options),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus):this.stickyScrollController&&!this._options.enableStickyScroll&&(this.onDidChangeStickyScrollFocused=Je.None,this.stickyScrollController.dispose(),this.stickyScrollController=void 0),(t=this.stickyScrollController)===null||t===void 0||t.updateOptions(e)}getHTMLElement(){return this.view.getHTMLElement()}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}domFocus(){var e;!((e=this.stickyScrollController)===null||e===void 0)&&e.focusedLast()?this.stickyScrollController.domFocus():this.view.domFocus()}layout(e,t){var n;this.view.layout(e,t),$v(t)&&((n=this.findController)===null||n===void 0||n.layout(t))}style(e){var t;const n=`.${this.view.domId}`,r=[];e.treeIndentGuidesStroke&&(r.push(`.monaco-list${n}:hover .monaco-tl-indent > .indent-guide, .monaco-list${n}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeInactiveIndentGuidesStroke}; }`),r.push(`.monaco-list${n} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`)),e.listBackground&&(r.push(`.monaco-list${n} .monaco-scrollable-element .monaco-tree-sticky-container { background-color: ${e.listBackground}; }`),r.push(`.monaco-list${n} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row { background-color: ${e.listBackground}; }`)),e.listFocusForeground&&(r.push(`.monaco-list${n}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),r.push(`.monaco-list${n}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { color: inherit; }`));const o=gp(e.listFocusAndSelectionOutline,gp(e.listSelectionOutline,(t=e.listFocusOutline)!==null&&t!==void 0?t:""));o&&(r.push(`.monaco-list${n}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused.selected { outline: 1px solid ${o}; outline-offset: -1px;}`),r.push(`.monaco-list${n}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused.selected { outline: inherit;}`)),e.listFocusOutline&&(r.push(`.monaco-list${n}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),r.push(`.monaco-list${n}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { outline: inherit; }`),r.push(`.monaco-workbench.context-menu-visible .monaco-list${n}.last-focused.sticky-scroll-focused .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`),r.push(`.monaco-workbench.context-menu-visible .monaco-list${n}.last-focused:not(.sticky-scroll-focused) .monaco-tree-sticky-container .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`)),this.styleElement.textContent=r.join(` +`),this.view.style(e)}getParentElement(e){const t=this.model.getParentNodeLocation(e);return this.model.getNode(t).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}getNodeLocation(e){return this.model.getNodeLocation(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}toggleCollapsed(e,t=!1){return this.model.setCollapsed(e,void 0,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){this.eventBufferer.bufferEvents(()=>{const n=e.map(o=>this.model.getNode(o));this.selection.set(n,t);const r=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setSelection(r,t,!0)})}getSelection(){return this.selection.get()}setFocus(e,t){this.eventBufferer.bufferEvents(()=>{const n=e.map(o=>this.model.getNode(o));this.focus.set(n,t);const r=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setFocus(r,t,!0)})}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const n=this.model.getListIndex(e);if(n!==-1)if(!this.stickyScrollController)this.view.reveal(n,t);else{const r=this.stickyScrollController.nodePositionTopBelowWidget(this.getNode(e));this.view.reveal(n,t,r)}}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const n=t[0],r=this.model.getNodeLocation(n);if(!this.model.setCollapsed(r,!0)){const s=this.model.getParentNodeLocation(r);if(!s)return;const a=this.model.getListIndex(s);this.view.reveal(a),this.view.setFocus([a])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const n=t[0],r=this.model.getNodeLocation(n);if(!this.model.setCollapsed(r,!1)){if(!n.children.some(l=>l.visible))return;const[s]=this.view.getFocus(),a=s+1;this.view.reveal(a),this.view.setFocus([a])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const n=t[0],r=this.model.getNodeLocation(n),o=e.browserEvent.altKey;this.model.setCollapsed(r,void 0,o)}dispose(){var e;si(this.disposables),(e=this.stickyScrollController)===null||e===void 0||e.dispose(),this.view.dispose()}}class ZX{constructor(e,t,n={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new vXe(e,t,null,n),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,n.sorter&&(this.sorter={compare(r,o){return n.sorter.compare(r.element,o.element)}}),this.identityProvider=n.identityProvider}setChildren(e,t=En.empty(),n={}){const r=this.getElementLocation(e);this._setChildren(r,this.preserveCollapseState(t),n)}_setChildren(e,t=En.empty(),n){const r=new Set,o=new Set,s=l=>{var c;if(l.element===null)return;const u=l;if(r.add(u.element),this.nodes.set(u.element,u),this.identityProvider){const d=this.identityProvider.getId(u.element).toString();o.add(d),this.nodesByIdentity.set(d,u)}(c=n.onDidCreateNode)===null||c===void 0||c.call(n,u)},a=l=>{var c;if(l.element===null)return;const u=l;if(r.has(u.element)||this.nodes.delete(u.element),this.identityProvider){const d=this.identityProvider.getId(u.element).toString();o.has(d)||this.nodesByIdentity.delete(d)}(c=n.onDidDeleteNode)===null||c===void 0||c.call(n,u)};this.model.splice([...e,0],Number.MAX_VALUE,t,{...n,onDidCreateNode:s,onDidDeleteNode:a})}preserveCollapseState(e=En.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),En.map(e,t=>{let n=this.nodes.get(t.element);if(!n&&this.identityProvider){const s=this.identityProvider.getId(t.element).toString();n=this.nodesByIdentity.get(s)}if(!n){let s;return typeof t.collapsed>"u"?s=void 0:t.collapsed===Yl.Collapsed||t.collapsed===Yl.PreserveOrCollapsed?s=!0:t.collapsed===Yl.Expanded||t.collapsed===Yl.PreserveOrExpanded?s=!1:s=!!t.collapsed,{...t,children:this.preserveCollapseState(t.children),collapsed:s}}const r=typeof t.collapsible=="boolean"?t.collapsible:n.collapsible;let o;return typeof t.collapsed>"u"||t.collapsed===Yl.PreserveOrCollapsed||t.collapsed===Yl.PreserveOrExpanded?o=n.collapsed:t.collapsed===Yl.Collapsed?o=!0:t.collapsed===Yl.Expanded?o=!1:o=!!t.collapsed,{...t,collapsible:r,collapsed:o,children:this.preserveCollapseState(t.children)}})}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}getFirstElementChild(e=null){const t=this.getElementLocation(e);return this.model.getFirstElementChild(t)}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getElementLocation(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getElementLocation(e);return this.model.getListRenderCount(t)}isCollapsible(e){const t=this.getElementLocation(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const n=this.getElementLocation(e);return this.model.setCollapsible(n,t)}isCollapsed(e){const t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,n){const r=this.getElementLocation(e);return this.model.setCollapsed(r,t,n)}expandTo(e){const t=this.getElementLocation(e);this.model.expandTo(t)}refilter(){this.model.refilter()}getNode(e=null){if(e===null)return this.model.getNode(this.model.rootRef);const t=this.nodes.get(e);if(!t)throw new rc(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new rc(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new rc(this.user,`Tree element not found: ${e}`);const n=this.model.getNodeLocation(t),r=this.model.getParentNodeLocation(n);return this.model.getNode(r).element}getElementLocation(e){if(e===null)return[];const t=this.nodes.get(e);if(!t)throw new rc(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function TM(i){const e=[i.element],t=i.incompressible||!1;return{element:{elements:e,incompressible:t},children:En.map(En.from(i.children),TM),collapsible:i.collapsible,collapsed:i.collapsed}}function NM(i){const e=[i.element],t=i.incompressible||!1;let n,r;for(;[r,n]=En.consume(En.from(i.children),2),!(r.length!==1||r[0].incompressible);)i=r[0],e.push(i.element);return{element:{elements:e,incompressible:t},children:En.map(En.concat(r,n),NM),collapsible:i.collapsible,collapsed:i.collapsed}}function WV(i,e=0){let t;return eWV(n,0)),e===0&&i.element.incompressible?{element:i.element.elements[e],children:t,incompressible:!0,collapsible:i.collapsible,collapsed:i.collapsed}:{element:i.element.elements[e],children:t,collapsible:i.collapsible,collapsed:i.collapsed}}function sse(i){return WV(i,0)}function l0e(i,e,t){return i.element===e?{...i,children:t}:{...i,children:En.map(En.from(i.children),n=>l0e(n,e,t))}}const NXe=i=>({getId(e){return e.elements.map(t=>i.getId(t).toString()).join("\0")}});class RXe{get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(e,t,n={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new ZX(e,t,n),this.enabled=typeof n.compressionEnabled>"u"?!0:n.compressionEnabled,this.identityProvider=n.identityProvider}setChildren(e,t=En.empty(),n){const r=n.diffIdentityProvider&&NXe(n.diffIdentityProvider);if(e===null){const g=En.map(t,this.enabled?NM:TM);this._setChildren(null,g,{diffIdentityProvider:r,diffDepth:1/0});return}const o=this.nodes.get(e);if(!o)throw new rc(this.user,"Unknown compressed tree node");const s=this.model.getNode(o),a=this.model.getParentNodeLocation(o),l=this.model.getNode(a),c=sse(s),u=l0e(c,e,t),d=(this.enabled?NM:TM)(u),h=n.diffIdentityProvider?(g,p)=>n.diffIdentityProvider.getId(g)===n.diffIdentityProvider.getId(p):void 0;if(or(d.element.elements,s.element.elements,h)){this._setChildren(o,d.children||En.empty(),{diffIdentityProvider:r,diffDepth:1});return}const f=l.children.map(g=>g===s?d:g);this._setChildren(l.element,f,{diffIdentityProvider:r,diffDepth:s.depth-l.depth})}isCompressionEnabled(){return this.enabled}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const n=this.model.getNode().children,r=En.map(n,sse),o=En.map(r,e?NM:TM);this._setChildren(null,o,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,n){const r=new Set,o=a=>{for(const l of a.element.elements)r.add(l),this.nodes.set(l,a.element)},s=a=>{for(const l of a.element.elements)r.has(l)||this.nodes.delete(l)};this.model.setChildren(e,t,{...n,onDidCreateNode:o,onDidDeleteNode:s})}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getCompressedNode(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getCompressedNode(e);return this.model.getListRenderCount(t)}getNode(e){if(typeof e>"u")return this.model.getNode();const t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){const t=this.model.getNodeLocation(e);return t===null?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){const t=this.getCompressedNode(e),n=this.model.getParentNodeLocation(t);return n===null?null:n.elements[n.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 n=this.getCompressedNode(e);return this.model.setCollapsible(n,t)}isCollapsed(e){const t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,n){const r=this.getCompressedNode(e);return this.model.setCollapsed(r,t,n)}expandTo(e){const t=this.getCompressedNode(e);this.model.expandTo(t)}rerender(e){const t=this.getCompressedNode(e);this.model.rerender(t)}refilter(){this.model.refilter()}getCompressedNode(e){if(e===null)return null;const t=this.nodes.get(e);if(!t)throw new rc(this.user,`Tree element not found: ${e}`);return t}}const MXe=i=>i[i.length-1];class QX{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new QX(this.unwrapper,e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e,t){this.unwrapper=e,this.node=t}}function AXe(i,e){return{splice(t,n,r){e.splice(t,n,r.map(o=>i.map(o)))},updateElementHeight(t,n){e.updateElementHeight(t,n)}}}function PXe(i,e){return{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(i(t))}},sorter:e.sorter&&{compare(t,n){return e.sorter.compare(t.elements[0],n.elements[0])}},filter:e.filter&&{filter(t,n){return e.filter.filter(i(t),n)}}}}class OXe{get onDidSplice(){return Je.map(this.model.onDidSplice,({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map(n=>this.nodeMapper.map(n)),deletedNodes:t.map(n=>this.nodeMapper.map(n))}))}get onDidChangeCollapseState(){return Je.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return Je.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t,n={}){this.rootRef=null,this.elementMapper=n.elementMapper||MXe;const r=o=>this.elementMapper(o.elements);this.nodeMapper=new qX(o=>new QX(r,o)),this.model=new RXe(e,AXe(this.nodeMapper,t),PXe(r,n))}setChildren(e,t=En.empty(),n={}){this.model.setChildren(e,t,n)}isCompressionEnabled(){return this.model.isCompressionEnabled()}setCompressionEnabled(e){this.model.setCompressionEnabled(e)}has(e){return this.model.has(e)}getListIndex(e){return this.model.getListIndex(e)}getListRenderCount(e){return this.model.getListRenderCount(e)}getNode(e){return this.nodeMapper.map(this.model.getNode(e))}getNodeLocation(e){return e.element}getParentNodeLocation(e){return this.model.getParentNodeLocation(e)}getFirstElementChild(e){const t=this.model.getFirstElementChild(e);return t===null||typeof t>"u"?t:this.elementMapper(t.elements)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}setCollapsed(e,t,n){return this.model.setCollapsed(e,t,n)}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 FXe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o};class JX extends a0e{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,n,r,o={}){super(e,t,n,r,o),this.user=e}setChildren(e,t=En.empty(),n){this.model.setChildren(e,t,n)}rerender(e){if(e===void 0){this.view.rerender();return}this.model.rerender(e)}hasElement(e){return this.model.has(e)}createModel(e,t,n){return new ZX(e,t,n)}}class c0e{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,t,n){this._compressedTreeNodeProvider=e,this.stickyScrollDelegate=t,this.renderer=n,this.templateId=n.templateId,n.onDidChangeTwistieState&&(this.onDidChangeTwistieState=n.onDidChangeTwistieState)}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,n,r){let o=this.stickyScrollDelegate.getCompressedNode(e);o||(o=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element)),o.element.elements.length===1?(n.compressedTreeNode=void 0,this.renderer.renderElement(e,t,n.data,r)):(n.compressedTreeNode=o,this.renderer.renderCompressedElements(o,t,n.data,r))}disposeElement(e,t,n,r){var o,s,a,l;n.compressedTreeNode?(s=(o=this.renderer).disposeCompressedElements)===null||s===void 0||s.call(o,n.compressedTreeNode,t,n.data,r):(l=(a=this.renderer).disposeElement)===null||l===void 0||l.call(a,e,t,n.data,r)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return this.renderer.renderTwistie?this.renderer.renderTwistie(e,t):!1}}FXe([Rr],c0e.prototype,"compressedTreeNodeProvider",null);class BXe{constructor(e){this.modelProvider=e,this.compressedStickyNodes=new Map}getCompressedNode(e){return this.compressedStickyNodes.get(e)}constrainStickyScrollNodes(e,t,n){if(this.compressedStickyNodes.clear(),e.length===0)return[];for(let r=0;rn||r>=t-1&&tthis,a=new BXe(()=>this.model),l=r.map(c=>new c0e(s,a,c));super(e,t,n,l,{...WXe(s,o),stickyScrollDelegate:a})}setChildren(e,t=En.empty(),n){this.model.setChildren(e,t,n)}createModel(e,t,n){return new OXe(e,t,n)}updateOptions(e={}){super.updateOptions(e),typeof e.compressionEnabled<"u"&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}function f9(i){return{...i,children:[],refreshPromise:void 0,stale:!0,slow:!1,forceExpanded:!1}}function $V(i,e){return e.parent?e.parent===i?!0:$V(i,e.parent):!1}function $Xe(i,e){return i===e||$V(i,e)||$V(e,i)}class eY{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new eY(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class HXe{constructor(e,t,n){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=n,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,n,r){this.renderer.renderElement(this.nodeMapper.map(e),t,n.templateData,r)}renderTwistie(e,t){return e.slow?(t.classList.add(...Wt.asClassNameArray(Xe.treeItemLoading)),!0):(t.classList.remove(...Wt.asClassNameArray(Xe.treeItemLoading)),!1)}disposeElement(e,t,n,r){var o,s;(s=(o=this.renderer).disposeElement)===null||s===void 0||s.call(o,this.nodeMapper.map(e),t,n.templateData,r)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function ase(i){return{browserEvent:i.browserEvent,elements:i.elements.map(e=>e.element)}}function lse(i){return{browserEvent:i.browserEvent,element:i.element&&i.element.element,target:i.target}}class VXe extends Yk{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function g9(i){return i instanceof Yk?new VXe(i):i}class zXe{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(n=>n.element),t)}onDragStart(e,t){var n,r;(r=(n=this.dnd).onDragStart)===null||r===void 0||r.call(n,g9(e),t)}onDragOver(e,t,n,r,o,s=!0){return this.dnd.onDragOver(g9(e),t&&t.element,n,r,o)}drop(e,t,n,r,o){this.dnd.drop(g9(e),t&&t.element,n,r,o)}onDragEnd(e){var t,n;(n=(t=this.dnd).onDragEnd)===null||n===void 0||n.call(t,e)}dispose(){this.dnd.dispose()}}function d0e(i){return i&&{...i,collapseByDefault:!0,identityProvider:i.identityProvider&&{getId(e){return i.identityProvider.getId(e.element)}},dnd:i.dnd&&new zXe(i.dnd),multipleSelectionController:i.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return i.multipleSelectionController.isSelectionSingleChangeEvent({...e,element:e.element})},isSelectionRangeChangeEvent(e){return i.multipleSelectionController.isSelectionRangeChangeEvent({...e,element:e.element})}},accessibilityProvider:i.accessibilityProvider&&{...i.accessibilityProvider,getPosInSet:void 0,getSetSize:void 0,getRole:i.accessibilityProvider.getRole?e=>i.accessibilityProvider.getRole(e.element):()=>"treeitem",isChecked:i.accessibilityProvider.isChecked?e=>{var t;return!!(!((t=i.accessibilityProvider)===null||t===void 0)&&t.isChecked(e.element))}:void 0,getAriaLabel(e){return i.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return i.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:i.accessibilityProvider.getWidgetRole?()=>i.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:i.accessibilityProvider.getAriaLevel&&(e=>i.accessibilityProvider.getAriaLevel(e.element)),getActiveDescendantId:i.accessibilityProvider.getActiveDescendantId&&(e=>i.accessibilityProvider.getActiveDescendantId(e.element))},filter:i.filter&&{filter(e,t){return i.filter.filter(e.element,t)}},keyboardNavigationLabelProvider:i.keyboardNavigationLabelProvider&&{...i.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(e){return i.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}},sorter:void 0,expandOnlyOnTwistieClick:typeof i.expandOnlyOnTwistieClick>"u"?void 0:typeof i.expandOnlyOnTwistieClick!="function"?i.expandOnlyOnTwistieClick:e=>i.expandOnlyOnTwistieClick(e.element),defaultFindVisibility:e=>e.hasChildren&&e.stale?1:typeof i.defaultFindVisibility=="number"?i.defaultFindVisibility:typeof i.defaultFindVisibility>"u"?2:i.defaultFindVisibility(e.element)}}function HV(i,e){e(i),i.children.forEach(t=>HV(t,e))}class h0e{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return Je.map(this.tree.onDidChangeFocus,ase)}get onDidChangeSelection(){return Je.map(this.tree.onDidChangeSelection,ase)}get onMouseDblClick(){return Je.map(this.tree.onMouseDblClick,lse)}get onPointer(){return Je.map(this.tree.onPointer,lse)}get onDidFocus(){return this.tree.onDidFocus}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidChangeFindOpenState(){return this.tree.onDidChangeFindOpenState}get onDidChangeStickyScrollFocused(){return this.tree.onDidChangeStickyScrollFocused}get onDidDispose(){return this.tree.onDidDispose}constructor(e,t,n,r,o,s={}){this.user=e,this.dataSource=o,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new se,this._onDidChangeNodeSlowState=new se,this.nodeMapper=new qX(a=>new eY(a)),this.disposables=new Te,this.identityProvider=s.identityProvider,this.autoExpandSingleChildren=typeof s.autoExpandSingleChildren>"u"?!1:s.autoExpandSingleChildren,this.sorter=s.sorter,this.getDefaultCollapseState=a=>s.collapseByDefault?s.collapseByDefault(a)?Yl.PreserveOrCollapsed:Yl.PreserveOrExpanded:void 0,this.tree=this.createTree(e,t,n,r,s),this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.onDidChangeFindMatchType=this.tree.onDidChangeFindMatchType,this.root=f9({element:void 0,parent:null,hasChildren:!0,defaultCollapseState:void 0}),this.identityProvider&&(this.root={...this.root,id:null}),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}createTree(e,t,n,r,o){const s=new YX(n),a=r.map(c=>new HXe(c,this.nodeMapper,this._onDidChangeNodeSlowState.event)),l=d0e(o)||{};return new JX(e,t,s,a,l)}updateOptions(e={}){this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}get scrollHeight(){return this.tree.scrollHeight}get renderHeight(){return this.tree.renderHeight}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}async setInput(e,t){this.refreshPromises.forEach(r=>r.cancel()),this.refreshPromises.clear(),this.root.element=e;const n=t&&{viewState:t,focus:[],selection:[]};await this._updateChildren(e,!0,!1,n),n&&(this.tree.setFocus(n.focus),this.tree.setSelection(n.selection)),t&&typeof t.scrollTop=="number"&&(this.scrollTop=t.scrollTop)}async _updateChildren(e=this.root.element,t=!0,n=!1,r,o){if(typeof this.root.element>"u")throw new rc(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await Je.toPromise(this._onDidRender.event));const s=this.getDataNode(e);if(await this.refreshAndRenderNode(s,t,r,o),n)try{this.tree.rerender(s)}catch{}}rerender(e){if(e===void 0||e===this.root.element){this.tree.rerender();return}const t=this.getDataNode(e);this.tree.rerender(t)}getNode(e=this.root.element){const t=this.getDataNode(e),n=this.tree.getNode(t===this.root?null:t);return this.nodeMapper.map(n)}collapse(e,t=!1){const n=this.getDataNode(e);return this.tree.collapse(n===this.root?null:n,t)}async expand(e,t=!1){if(typeof this.root.element>"u")throw new rc(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await Je.toPromise(this._onDidRender.event));const n=this.getDataNode(e);if(this.tree.hasElement(n)&&!this.tree.isCollapsible(n)||(n.refreshPromise&&(await this.root.refreshPromise,await Je.toPromise(this._onDidRender.event)),n!==this.root&&!n.refreshPromise&&!this.tree.isCollapsed(n)))return!1;const r=this.tree.expand(n===this.root?null:n,t);return n.refreshPromise&&(await this.root.refreshPromise,await Je.toPromise(this._onDidRender.event)),r}setSelection(e,t){const n=e.map(r=>this.getDataNode(r));this.tree.setSelection(n,t)}getSelection(){return this.tree.getSelection().map(t=>t.element)}setFocus(e,t){const n=e.map(r=>this.getDataNode(r));this.tree.setFocus(n,t)}getFocus(){return this.tree.getFocus().map(t=>t.element)}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getParentElement(e){const t=this.tree.getParentElement(this.getDataNode(e));return t&&t.element}getFirstElementChild(e=this.root.element){const t=this.getDataNode(e),n=this.tree.getFirstElementChild(t===this.root?null:t);return n&&n.element}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e);if(!t)throw new rc(this.user,`Data tree node not found: ${e}`);return t}async refreshAndRenderNode(e,t,n,r){await this.refreshNode(e,t,n),!this.disposables.isDisposed&&this.render(e,n,r)}async refreshNode(e,t,n){let r;if(this.subTreeRefreshPromises.forEach((o,s)=>{!r&&$Xe(s,e)&&(r=o.then(()=>this.refreshNode(e,t,n)))}),r)return r;if(e!==this.root&&this.tree.getNode(e).collapsed){e.hasChildren=!!this.dataSource.hasChildren(e.element),e.stale=!0,this.setChildren(e,[],t,n);return}return this.doRefreshSubTree(e,t,n)}async doRefreshSubTree(e,t,n){let r;e.refreshPromise=new Promise(o=>r=o),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)});try{const o=await this.doRefreshNode(e,t,n);e.stale=!1,await iH.settled(o.map(s=>this.doRefreshSubTree(s,t,n)))}finally{r()}}async doRefreshNode(e,t,n){e.hasChildren=!!this.dataSource.hasChildren(e.element);let r;if(!e.hasChildren)r=Promise.resolve(En.empty());else{const o=this.doGetChildren(e);if(Mne(o))r=Promise.resolve(o);else{const s=Uv(800);s.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},a=>null),r=o.finally(()=>s.cancel())}}try{const o=await r;return this.setChildren(e,o,t,n)}catch(o){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),wh(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 n=this.dataSource.getChildren(e.element);return Mne(n)?this.processChildren(n):(t=Io(async()=>this.processChildren(await n)),this.refreshPromises.set(e,t),t.finally(()=>{this.refreshPromises.delete(e)}))}_onDidChangeCollapseState({node:e,deep:t}){e.element!==null&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(en))}setChildren(e,t,n,r){const o=[...t];if(e.children.length===0&&o.length===0)return[];const s=new Map,a=new Map;for(const u of e.children)s.set(u.element,u),this.identityProvider&&a.set(u.id,{node:u,collapsed:this.tree.hasElement(u)&&this.tree.isCollapsed(u)});const l=[],c=o.map(u=>{const d=!!this.dataSource.hasChildren(u);if(!this.identityProvider){const p=f9({element:u,parent:e,hasChildren:d,defaultCollapseState:this.getDefaultCollapseState(u)});return d&&p.defaultCollapseState===Yl.PreserveOrExpanded&&l.push(p),p}const h=this.identityProvider.getId(u).toString(),f=a.get(h);if(f){const p=f.node;return s.delete(p.element),this.nodes.delete(p.element),this.nodes.set(u,p),p.element=u,p.hasChildren=d,n?f.collapsed?(p.children.forEach(v=>HV(v,m=>this.nodes.delete(m.element))),p.children.splice(0,p.children.length),p.stale=!0):l.push(p):d&&!f.collapsed&&l.push(p),p}const g=f9({element:u,parent:e,id:h,hasChildren:d,defaultCollapseState:this.getDefaultCollapseState(u)});return r&&r.viewState.focus&&r.viewState.focus.indexOf(h)>-1&&r.focus.push(g),r&&r.viewState.selection&&r.viewState.selection.indexOf(h)>-1&&r.selection.push(g),(r&&r.viewState.expanded&&r.viewState.expanded.indexOf(h)>-1||d&&g.defaultCollapseState===Yl.PreserveOrExpanded)&&l.push(g),g});for(const u of s.values())HV(u,d=>this.nodes.delete(d.element));for(const u of c)this.nodes.set(u.element,u);return e.children.splice(0,e.children.length,...c),e!==this.root&&this.autoExpandSingleChildren&&c.length===1&&l.length===0&&(c[0].forceExpanded=!0,l.push(c[0])),l}render(e,t,n){const r=e.children.map(s=>this.asTreeElement(s,t)),o=n&&{...n,diffIdentityProvider:n.diffIdentityProvider&&{getId(s){return n.diffIdentityProvider.getId(s.element)}}};this.tree.setChildren(e===this.root?null:e,r,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 n;return t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1?n=!1:e.forceExpanded?(n=!1,e.forceExpanded=!1):n=e.defaultCollapseState,{element:e,children:e.hasChildren?En.map(e.children,r=>this.asTreeElement(r,t)):[],collapsible:e.hasChildren,collapsed:n}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose(),this.tree.dispose()}}class tY{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 tY(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class UXe{constructor(e,t,n,r){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=n,this.onDidChangeTwistieState=r,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,n,r){this.renderer.renderElement(this.nodeMapper.map(e),t,n.templateData,r)}renderCompressedElements(e,t,n,r){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,n.templateData,r)}renderTwistie(e,t){return e.slow?(t.classList.add(...Wt.asClassNameArray(Xe.treeItemLoading)),!0):(t.classList.remove(...Wt.asClassNameArray(Xe.treeItemLoading)),!1)}disposeElement(e,t,n,r){var o,s;(s=(o=this.renderer).disposeElement)===null||s===void 0||s.call(o,this.nodeMapper.map(e),t,n.templateData,r)}disposeCompressedElements(e,t,n,r){var o,s;(s=(o=this.renderer).disposeCompressedElements)===null||s===void 0||s.call(o,this.compressibleNodeMapperProvider().map(e),t,n.templateData,r)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=si(this.disposables)}}function jXe(i){const e=i&&d0e(i);return e&&{...e,keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getCompressedNodeKeyboardNavigationLabel(t){return i.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(n=>n.element))}}}}class KXe extends h0e{constructor(e,t,n,r,o,s,a={}){super(e,t,n,o,s,a),this.compressionDelegate=r,this.compressibleNodeMapper=new qX(l=>new tY(l)),this.filter=a.filter}createTree(e,t,n,r,o){const s=new YX(n),a=r.map(c=>new UXe(c,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),l=jXe(o)||{};return new u0e(e,t,s,a,l)}asTreeElement(e,t){return{incompressible:this.compressionDelegate.isIncompressible(e.element),...super.asTreeElement(e,t)}}updateOptions(e={}){this.tree.updateOptions(e)}render(e,t,n){if(!this.identityProvider)return super.render(e,t);const r=f=>this.identityProvider.getId(f).toString(),o=f=>{const g=new Set;for(const p of f){const v=this.tree.getCompressedTreeNode(p===this.root?null:p);if(v.element)for(const m of v.element.elements)g.add(r(m.element))}return g},s=o(this.tree.getSelection()),a=o(this.tree.getFocus());super.render(e,t,n);const l=this.getSelection();let c=!1;const u=this.getFocus();let d=!1;const h=f=>{const g=f.element;if(g)for(let p=0;p{const n=this.filter.filter(t,1),r=GXe(n);if(r===2)throw new Error("Recursive tree visibility not supported in async data compressed trees");return r===1})),super.processChildren(e)}}function GXe(i){return typeof i=="boolean"?i?1:0:XX(i)?uI(i.visibility):uI(i)}class qXe extends a0e{constructor(e,t,n,r,o,s={}){super(e,t,n,r,s),this.user=e,this.dataSource=o,this.identityProvider=s.identityProvider}createModel(e,t,n){return new ZX(e,t,n)}}new st("isMac",Ln,w("isMac","Whether the operating system is macOS"));new st("isLinux",Da,w("isLinux","Whether the operating system is Linux"));const o3=new st("isWindows",Rs,w("isWindows","Whether the operating system is Windows")),f0e=new st("isWeb",S_,w("isWeb","Whether the platform is a web browser"));new st("isMacNative",Ln&&!S_,w("isMacNative","Whether the operating system is macOS on a non-browser platform"));new st("isIOS",ch,w("isIOS","Whether the operating system is iOS"));new st("isMobile",cpe,w("isMobile","Whether the platform is a mobile web browser"));new st("isDevelopment",!1,!0);new st("productQualityType","",w("productQualityType","Quality type of VS Code"));const g0e="inputFocus",XXe=new st(g0e,!1,w("inputFocus","Whether keyboard focus is inside an input box"));var jp=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Pi=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const mu=yn("listService");class YXe{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new Te,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}setLastFocusedList(e){var t,n;e!==this._lastFocusedWidget&&((t=this._lastFocusedWidget)===null||t===void 0||t.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,(n=this._lastFocusedWidget)===null||n===void 0||n.getHTMLElement().classList.add("last-focused"))}register(e,t){if(this._hasCreatedStyleController||(this._hasCreatedStyleController=!0,new U_e(gc(),"").style(N_)),this.lists.some(r=>r.widget===e))throw new Error("Cannot register the same widget multiple times");const n={widget:e,extraContextKeys:t};return this.lists.push(n),Mk(e.getHTMLElement())&&this.setLastFocusedList(e),Zu(e.onDidFocus(()=>this.setLastFocusedList(e)),Rt(()=>this.lists.splice(this.lists.indexOf(n),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(r=>r!==n),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)}))}dispose(){this.disposables.dispose()}}const fI=new st("listScrollAtBoundary","none");De.or(fI.isEqualTo("top"),fI.isEqualTo("both"));De.or(fI.isEqualTo("bottom"),fI.isEqualTo("both"));const p0e=new st("listFocus",!0),m0e=new st("treestickyScrollFocused",!1),s3=new st("listSupportsMultiselect",!0),v0e=De.and(p0e,De.not(g0e),m0e.negate()),nY=new st("listHasSelectionOrFocus",!1),iY=new st("listDoubleSelection",!1),rY=new st("listMultiSelection",!1),a3=new st("listSelectionNavigation",!1),ZXe=new st("listSupportsFind",!0),oY=new st("treeElementCanCollapse",!1),QXe=new st("treeElementHasParent",!1),sY=new st("treeElementCanExpand",!1),JXe=new st("treeElementHasChild",!1),eYe=new st("treeFindOpen",!1),_0e="listTypeNavigationMode",b0e="listAutomaticKeyboardNavigation";function l3(i,e){const t=i.createScoped(e.getHTMLElement());return p0e.bindTo(t),t}function c3(i,e){const t=fI.bindTo(i),n=()=>{const r=e.scrollTop===0,o=e.scrollHeight-e.renderHeight-e.scrollTop<1;r&&o?t.set("both"):r?t.set("top"):o?t.set("bottom"):t.set("none")};return n(),e.onDidScroll(n)}const vC="workbench.list.multiSelectModifier",RM="workbench.list.openMode",nu="workbench.list.horizontalScrolling",aY="workbench.list.defaultFindMode",lY="workbench.list.typeNavigationMode",KP="workbench.list.keyboardNavigation",ph="workbench.list.scrollByPage",cY="workbench.list.defaultFindMatchType",gI="workbench.tree.indent",GP="workbench.tree.renderIndentGuides",mh="workbench.list.smoothScrolling",jf="workbench.list.mouseWheelScrollSensitivity",Kf="workbench.list.fastScrollSensitivity",qP="workbench.tree.expandMode",XP="workbench.tree.enableStickyScroll",YP="workbench.tree.stickyScrollMaxItemCount";function Gf(i){return i.getValue(vC)==="alt"}class tYe extends fe{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=Gf(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(vC)&&(this.useAltAsMultipleSelectionModifier=Gf(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:H_e(e)}isSelectionRangeChangeEvent(e){return V_e(e)}}function u3(i,e){var t;const n=i.get(gn),r=i.get(ci),o=new Te;return[{...e,keyboardNavigationDelegate:{mightProducePrintableCharacter(a){return r.mightProducePrintableCharacter(a)}},smoothScrolling:!!n.getValue(mh),mouseWheelScrollSensitivity:n.getValue(jf),fastScrollSensitivity:n.getValue(Kf),multipleSelectionController:(t=e.multipleSelectionController)!==null&&t!==void 0?t:o.add(new tYe(n)),keyboardNavigationEventFilter:rYe(r),scrollByPage:!!n.getValue(ph)},o]}let VV=class extends wc{constructor(e,t,n,r,o,s,a,l,c){const u=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(nu),[d,h]=c.invokeFunction(u3,o);super(e,t,n,r,{keyboardSupport:!1,...d,horizontalScrolling:u}),this.disposables.add(h),this.contextKeyService=l3(s,this),this.disposables.add(c3(this.contextKeyService,this)),this.listSupportsMultiSelect=s3.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),a3.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this.listHasSelectionOrFocus=nY.bindTo(this.contextKeyService),this.listDoubleSelection=iY.bindTo(this.contextKeyService),this.listMultiSelection=rY.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=Gf(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const g=this.getSelection(),p=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(g.length>0||p.length>0),this.listMultiSelection.set(g.length>1),this.listDoubleSelection.set(g.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const g=this.getSelection(),p=this.getFocus();this.listHasSelectionOrFocus.set(g.length>0||p.length>0)})),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(vC)&&(this._useAltAsMultipleSelectionModifier=Gf(l));let p={};if(g.affectsConfiguration(nu)&&this.horizontalScrolling===void 0){const v=!!l.getValue(nu);p={...p,horizontalScrolling:v}}if(g.affectsConfiguration(ph)){const v=!!l.getValue(ph);p={...p,scrollByPage:v}}if(g.affectsConfiguration(mh)){const v=!!l.getValue(mh);p={...p,smoothScrolling:v}}if(g.affectsConfiguration(jf)){const v=l.getValue(jf);p={...p,mouseWheelScrollSensitivity:v}}if(g.affectsConfiguration(Kf)){const v=l.getValue(Kf);p={...p,fastScrollSensitivity:v}}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new C0e(this,{configurationService:l,...o}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?RS(e):N_)}};VV=jp([Pi(5,Vt),Pi(6,mu),Pi(7,gn),Pi(8,Ot)],VV);let cse=class extends Jqe{constructor(e,t,n,r,o,s,a,l,c){const u=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(nu),[d,h]=c.invokeFunction(u3,o);super(e,t,n,r,{keyboardSupport:!1,...d,horizontalScrolling:u}),this.disposables=new Te,this.disposables.add(h),this.contextKeyService=l3(s,this),this.disposables.add(c3(this.contextKeyService,this.widget)),this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=s3.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),a3.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this._useAltAsMultipleSelectionModifier=Gf(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(vC)&&(this._useAltAsMultipleSelectionModifier=Gf(l));let p={};if(g.affectsConfiguration(nu)&&this.horizontalScrolling===void 0){const v=!!l.getValue(nu);p={...p,horizontalScrolling:v}}if(g.affectsConfiguration(ph)){const v=!!l.getValue(ph);p={...p,scrollByPage:v}}if(g.affectsConfiguration(mh)){const v=!!l.getValue(mh);p={...p,smoothScrolling:v}}if(g.affectsConfiguration(jf)){const v=l.getValue(jf);p={...p,mouseWheelScrollSensitivity:v}}if(g.affectsConfiguration(Kf)){const v=l.getValue(Kf);p={...p,fastScrollSensitivity:v}}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new C0e(this,{configurationService:l,...o}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?RS(e):N_)}dispose(){this.disposables.dispose(),super.dispose()}};cse=jp([Pi(5,Vt),Pi(6,mu),Pi(7,gn),Pi(8,Ot)],cse);let use=class extends J_e{constructor(e,t,n,r,o,s,a,l,c,u){const d=typeof s.horizontalScrolling<"u"?s.horizontalScrolling:!!c.getValue(nu),[h,f]=u.invokeFunction(u3,s);super(e,t,n,r,o,{keyboardSupport:!1,...h,horizontalScrolling:d}),this.disposables.add(f),this.contextKeyService=l3(a,this),this.disposables.add(c3(this.contextKeyService,this)),this.listSupportsMultiSelect=s3.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(s.multipleSelectionSupport!==!1),a3.bindTo(this.contextKeyService).set(!!s.selectionNavigation),this.listHasSelectionOrFocus=nY.bindTo(this.contextKeyService),this.listDoubleSelection=iY.bindTo(this.contextKeyService),this.listMultiSelection=rY.bindTo(this.contextKeyService),this.horizontalScrolling=s.horizontalScrolling,this._useAltAsMultipleSelectionModifier=Gf(c),this.disposables.add(this.contextKeyService),this.disposables.add(l.register(this)),this.updateStyles(s.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const p=this.getSelection(),v=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(p.length>0||v.length>0),this.listMultiSelection.set(p.length>1),this.listDoubleSelection.set(p.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const p=this.getSelection(),v=this.getFocus();this.listHasSelectionOrFocus.set(p.length>0||v.length>0)})),this.disposables.add(c.onDidChangeConfiguration(p=>{p.affectsConfiguration(vC)&&(this._useAltAsMultipleSelectionModifier=Gf(c));let v={};if(p.affectsConfiguration(nu)&&this.horizontalScrolling===void 0){const m=!!c.getValue(nu);v={...v,horizontalScrolling:m}}if(p.affectsConfiguration(ph)){const m=!!c.getValue(ph);v={...v,scrollByPage:m}}if(p.affectsConfiguration(mh)){const m=!!c.getValue(mh);v={...v,smoothScrolling:m}}if(p.affectsConfiguration(jf)){const m=c.getValue(jf);v={...v,mouseWheelScrollSensitivity:m}}if(p.affectsConfiguration(Kf)){const m=c.getValue(Kf);v={...v,fastScrollSensitivity:m}}Object.keys(v).length>0&&this.updateOptions(v)})),this.navigator=new nYe(this,{configurationService:c,...s}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?RS(e):N_)}dispose(){this.disposables.dispose(),super.dispose()}};use=jp([Pi(6,Vt),Pi(7,mu),Pi(8,gn),Pi(9,Ot)],use);class uY extends fe{constructor(e,t){var n;super(),this.widget=e,this._onDidOpen=this._register(new se),this.onDidOpen=this._onDidOpen.event,this._register(Je.filter(this.widget.onDidChangeSelection,r=>kq(r.browserEvent))(r=>this.onSelectionFromKeyboard(r))),this._register(this.widget.onPointer(r=>this.onPointer(r.element,r.browserEvent))),this._register(this.widget.onMouseDblClick(r=>this.onMouseDblClick(r.element,r.browserEvent))),typeof(t==null?void 0:t.openOnSingleClick)!="boolean"&&(t!=null&&t.configurationService)?(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(RM))!=="doubleClick",this._register(t==null?void 0:t.configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration(RM)&&(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(RM))!=="doubleClick")}))):this.openOnSingleClick=(n=t==null?void 0:t.openOnSingleClick)!==null&&n!==void 0?n:!0}onSelectionFromKeyboard(e){if(e.elements.length!==1)return;const t=e.browserEvent,n=typeof t.preserveFocus=="boolean"?t.preserveFocus:!0,r=typeof t.pinned=="boolean"?t.pinned:!n,o=!1;this._open(this.getSelectedElement(),n,r,o,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick||t.detail===2)return;const r=t.button===1,o=!0,s=r,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,s,a,t)}onMouseDblClick(e,t){if(!t)return;const n=t.target;if(n.classList.contains("monaco-tl-twistie")||n.classList.contains("monaco-icon-label")&&n.classList.contains("folder-icon")&&t.offsetX<16)return;const o=!1,s=!0,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,s,a,t)}_open(e,t,n,r,o){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:n,revealIfVisible:!0},sideBySide:r,element:e,browserEvent:o})}}class C0e extends uY{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class nYe extends uY{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class iYe extends uY{constructor(e,t){super(e,t)}getSelectedElement(){var e;return(e=this.widget.getSelection()[0])!==null&&e!==void 0?e:void 0}}function rYe(i){let e=!1;return t=>{if(t.toKeyCodeChord().isModifierKey())return!1;if(e)return e=!1,!1;const n=i.softDispatch(t,t.target);return n.kind===1?(e=!0,!1):(e=!1,n.kind===0)}}let dse=class extends JX{constructor(e,t,n,r,o,s,a,l,c){const{options:u,getTypeNavigationMode:d,disposable:h}=s.invokeFunction(Jk,o);super(e,t,n,r,u),this.disposables.add(h),this.internals=new Fb(this,o,d,o.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};dse=jp([Pi(5,Ot),Pi(6,Vt),Pi(7,mu),Pi(8,gn)],dse);let hse=class extends u0e{constructor(e,t,n,r,o,s,a,l,c){const{options:u,getTypeNavigationMode:d,disposable:h}=s.invokeFunction(Jk,o);super(e,t,n,r,u),this.disposables.add(h),this.internals=new Fb(this,o,d,o.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};hse=jp([Pi(5,Ot),Pi(6,Vt),Pi(7,mu),Pi(8,gn)],hse);let fse=class extends qXe{constructor(e,t,n,r,o,s,a,l,c,u){const{options:d,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(Jk,s);super(e,t,n,r,o,d),this.disposables.add(f),this.internals=new Fb(this,s,h,s.overrideStyles,l,c,u),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles!==void 0&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};fse=jp([Pi(6,Ot),Pi(7,Vt),Pi(8,mu),Pi(9,gn)],fse);let zV=class extends h0e{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,n,r,o,s,a,l,c,u){const{options:d,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(Jk,s);super(e,t,n,r,o,d),this.disposables.add(f),this.internals=new Fb(this,s,h,s.overrideStyles,l,c,u),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};zV=jp([Pi(6,Ot),Pi(7,Vt),Pi(8,mu),Pi(9,gn)],zV);let gse=class extends KXe{constructor(e,t,n,r,o,s,a,l,c,u,d){const{options:h,getTypeNavigationMode:f,disposable:g}=l.invokeFunction(Jk,a);super(e,t,n,r,o,s,h),this.disposables.add(g),this.internals=new Fb(this,a,f,a.overrideStyles,c,u,d),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};gse=jp([Pi(7,Ot),Pi(8,Vt),Pi(9,mu),Pi(10,gn)],gse);function y0e(i){const e=i.getValue(aY);if(e==="highlight")return sp.Highlight;if(e==="filter")return sp.Filter;const t=i.getValue(KP);if(t==="simple"||t==="highlight")return sp.Highlight;if(t==="filter")return sp.Filter}function w0e(i){const e=i.getValue(cY);if(e==="fuzzy")return Ob.Fuzzy;if(e==="contiguous")return Ob.Contiguous}function Jk(i,e){var t;const n=i.get(gn),r=i.get(ng),o=i.get(Vt),s=i.get(Ot),a=()=>{const f=o.getContextKeyValue(_0e);if(f==="automatic")return pf.Automatic;if(f==="trigger"||o.getContextKeyValue(b0e)===!1)return pf.Trigger;const p=n.getValue(lY);if(p==="automatic")return pf.Automatic;if(p==="trigger")return pf.Trigger},l=e.horizontalScrolling!==void 0?e.horizontalScrolling:!!n.getValue(nu),[c,u]=s.invokeFunction(u3,e),d=e.paddingBottom,h=e.renderIndentGuides!==void 0?e.renderIndentGuides:n.getValue(GP);return{getTypeNavigationMode:a,disposable:u,options:{keyboardSupport:!1,...c,indent:typeof n.getValue(gI)=="number"?n.getValue(gI):void 0,renderIndentGuides:h,smoothScrolling:!!n.getValue(mh),defaultFindMode:y0e(n),defaultFindMatchType:w0e(n),horizontalScrolling:l,scrollByPage:!!n.getValue(ph),paddingBottom:d,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:(t=e.expandOnlyOnTwistieClick)!==null&&t!==void 0?t:n.getValue(qP)==="doubleClick",contextViewProvider:r,findWidgetStyles:Aqe,enableStickyScroll:!!n.getValue(XP),stickyScrollMaxItemCount:Number(n.getValue(YP))}}}let Fb=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,n,r,o,s,a){var l;this.tree=e,this.disposables=[],this.contextKeyService=l3(o,e),this.disposables.push(c3(this.contextKeyService,e)),this.listSupportsMultiSelect=s3.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),a3.bindTo(this.contextKeyService).set(!!t.selectionNavigation),this.listSupportFindWidget=ZXe.bindTo(this.contextKeyService),this.listSupportFindWidget.set((l=t.findWidgetEnabled)!==null&&l!==void 0?l:!0),this.hasSelectionOrFocus=nY.bindTo(this.contextKeyService),this.hasDoubleSelection=iY.bindTo(this.contextKeyService),this.hasMultiSelection=rY.bindTo(this.contextKeyService),this.treeElementCanCollapse=oY.bindTo(this.contextKeyService),this.treeElementHasParent=QXe.bindTo(this.contextKeyService),this.treeElementCanExpand=sY.bindTo(this.contextKeyService),this.treeElementHasChild=JXe.bindTo(this.contextKeyService),this.treeFindOpen=eYe.bindTo(this.contextKeyService),this.treeStickyScrollFocused=m0e.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=Gf(a),this.updateStyleOverrides(r);const u=()=>{const h=e.getFocus()[0];if(!h)return;const f=e.getNode(h);this.treeElementCanCollapse.set(f.collapsible&&!f.collapsed),this.treeElementHasParent.set(!!e.getParentElement(h)),this.treeElementCanExpand.set(f.collapsible&&f.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(h))},d=new Set;d.add(_0e),d.add(b0e),this.disposables.push(this.contextKeyService,s.register(e),e.onDidChangeSelection(()=>{const h=e.getSelection(),f=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(h.length>0||f.length>0),this.hasMultiSelection.set(h.length>1),this.hasDoubleSelection.set(h.length===2)})}),e.onDidChangeFocus(()=>{const h=e.getSelection(),f=e.getFocus();this.hasSelectionOrFocus.set(h.length>0||f.length>0),u()}),e.onDidChangeCollapseState(u),e.onDidChangeModel(u),e.onDidChangeFindOpenState(h=>this.treeFindOpen.set(h)),e.onDidChangeStickyScrollFocused(h=>this.treeStickyScrollFocused.set(h)),a.onDidChangeConfiguration(h=>{let f={};if(h.affectsConfiguration(vC)&&(this._useAltAsMultipleSelectionModifier=Gf(a)),h.affectsConfiguration(gI)){const g=a.getValue(gI);f={...f,indent:g}}if(h.affectsConfiguration(GP)&&t.renderIndentGuides===void 0){const g=a.getValue(GP);f={...f,renderIndentGuides:g}}if(h.affectsConfiguration(mh)){const g=!!a.getValue(mh);f={...f,smoothScrolling:g}}if(h.affectsConfiguration(aY)||h.affectsConfiguration(KP)){const g=y0e(a);f={...f,defaultFindMode:g}}if(h.affectsConfiguration(lY)||h.affectsConfiguration(KP)){const g=n();f={...f,typeNavigationMode:g}}if(h.affectsConfiguration(cY)){const g=w0e(a);f={...f,defaultFindMatchType:g}}if(h.affectsConfiguration(nu)&&t.horizontalScrolling===void 0){const g=!!a.getValue(nu);f={...f,horizontalScrolling:g}}if(h.affectsConfiguration(ph)){const g=!!a.getValue(ph);f={...f,scrollByPage:g}}if(h.affectsConfiguration(qP)&&t.expandOnlyOnTwistieClick===void 0&&(f={...f,expandOnlyOnTwistieClick:a.getValue(qP)==="doubleClick"}),h.affectsConfiguration(XP)){const g=a.getValue(XP);f={...f,enableStickyScroll:g}}if(h.affectsConfiguration(YP)){const g=Math.max(1,a.getValue(YP));f={...f,stickyScrollMaxItemCount:g}}if(h.affectsConfiguration(jf)){const g=a.getValue(jf);f={...f,mouseWheelScrollSensitivity:g}}if(h.affectsConfiguration(Kf)){const g=a.getValue(Kf);f={...f,fastScrollSensitivity:g}}Object.keys(f).length>0&&e.updateOptions(f)}),this.contextKeyService.onDidChangeContext(h=>{h.affectsSome(d)&&e.updateOptions({typeNavigationMode:n()})})),this.navigator=new iYe(e,{configurationService:a,...t}),this.disposables.push(this.navigator)}updateOptions(e){e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){this.tree.style(e?RS(e):N_)}dispose(){this.disposables=si(this.disposables)}};Fb=jp([Pi(4,Vt),Pi(5,mu),Pi(6,gn)],Fb);const oYe=ar.as(xh.Configuration);oYe.registerConfiguration({id:"workbench",order:7,title:w("workbenchConfigurationTitle","Workbench"),type:"object",properties:{[vC]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[w("multiSelectModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),w("multiSelectModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:w({key:"multiSelectModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.")},[RM]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:w({key:"openModeModifier",comment:["`singleClick` and `doubleClick` refers to a value the setting can take and should not be localized."]},"Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[nu]:{type:"boolean",default:!1,description:w("horizontalScrolling setting","Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[ph]:{type:"boolean",default:!1,description:w("list.scrollByPage","Controls whether clicks in the scrollbar scroll page by page.")},[gI]:{type:"number",default:8,minimum:4,maximum:40,description:w("tree indent setting","Controls tree indentation in pixels.")},[GP]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:w("render tree indent guides","Controls whether the tree should render indent guides.")},[mh]:{type:"boolean",default:!1,description:w("list smoothScrolling setting","Controls whether lists and trees have smooth scrolling.")},[jf]:{type:"number",default:1,markdownDescription:w("Mouse Wheel Scroll Sensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[Kf]:{type:"number",default:5,markdownDescription:w("Fast Scroll Sensitivity","Scrolling speed multiplier when pressing `Alt`.")},[aY]:{type:"string",enum:["highlight","filter"],enumDescriptions:[w("defaultFindModeSettingKey.highlight","Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),w("defaultFindModeSettingKey.filter","Filter elements when searching.")],default:"highlight",description:w("defaultFindModeSettingKey","Controls the default find mode for lists and trees in the workbench.")},[KP]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[w("keyboardNavigationSettingKey.simple","Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),w("keyboardNavigationSettingKey.highlight","Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),w("keyboardNavigationSettingKey.filter","Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:w("keyboardNavigationSettingKey","Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:w("keyboardNavigationSettingKeyDeprecated","Please use 'workbench.list.defaultFindMode' and 'workbench.list.typeNavigationMode' instead.")},[cY]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[w("defaultFindMatchTypeSettingKey.fuzzy","Use fuzzy matching when searching."),w("defaultFindMatchTypeSettingKey.contiguous","Use contiguous matching when searching.")],default:"fuzzy",description:w("defaultFindMatchTypeSettingKey","Controls the type of matching used when searching lists and trees in the workbench.")},[qP]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:w("expand mode","Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[XP]:{type:"boolean",default:!0,description:w("sticky scroll","Controls whether sticky scrolling is enabled in trees.")},[YP]:{type:"number",minimum:1,default:7,markdownDescription:w("sticky scroll maximum items","Controls the number of sticky elements displayed in the tree when `#workbench.tree.enableStickyScroll#` is enabled.")},[lY]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:w("typeNavigationMode2","Controls how type navigation works in lists and trees in the workbench. When set to `trigger`, type navigation begins once the `list.triggerTypeNavigation` command is run.")}}});var UV;(function(i){i[i.PRESERVE=0]="PRESERVE",i[i.LAST=1]="LAST"})(UV||(UV={}));const _C={Quickaccess:"workbench.contributions.quickaccess"};class sYe{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return e.prefix.length===0?this.defaultProvider=e:this.providers.push(e),this.providers.sort((t,n)=>n.prefix.length-t.prefix.length),Rt(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return lh([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(n=>e.startsWith(n.prefix))||void 0||this.defaultProvider}}ar.add(_C.Quickaccess,new sYe);const aYe={ctrlCmd:!1,alt:!1};var pI;(function(i){i[i.Blur=1]="Blur",i[i.Gesture=2]="Gesture",i[i.Other=3]="Other"})(pI||(pI={}));var Md;(function(i){i[i.NONE=0]="NONE",i[i.FIRST=1]="FIRST",i[i.SECOND=2]="SECOND",i[i.LAST=3]="LAST"})(Md||(Md={}));const Eh=yn("quickInputService");var lYe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},pse=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let jV=class extends fe{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=ar.as(_C.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,n){var r;const[o,s]=this.getOrInstantiateProvider(e),a=this.visibleQuickAccess,l=a==null?void 0:a.descriptor;if(a&&s&&l===s){e!==s.prefix&&!(n!=null&&n.preserveValue)&&(a.picker.value=e),this.adjustValueSelection(a.picker,s,n);return}if(s&&!(n!=null&&n.preserveValue)){let f;if(a&&l&&l!==s){const g=a.value.substr(l.prefix.length);g&&(f=`${s.prefix}${g}`)}if(!f){const g=o==null?void 0:o.defaultFilterValue;g===UV.LAST?f=this.lastAcceptedPickerValues.get(s):typeof g=="string"&&(f=`${s.prefix}${g}`)}typeof f=="string"&&(e=f)}const c=new Te,u=c.add(this.quickInputService.createQuickPick());u.value=e,this.adjustValueSelection(u,s,n),u.placeholder=s==null?void 0:s.placeholder,u.quickNavigate=n==null?void 0:n.quickNavigateConfiguration,u.hideInput=!!u.quickNavigate&&!a,(typeof(n==null?void 0:n.itemActivation)=="number"||n!=null&&n.quickNavigateConfiguration)&&(u.itemActivation=(r=n==null?void 0:n.itemActivation)!==null&&r!==void 0?r:Md.SECOND),u.contextKey=s==null?void 0:s.contextKey,u.filterValue=f=>f.substring(s?s.prefix.length:0);let d;t&&(d=new a4,c.add(Je.once(u.onWillAccept)(f=>{f.veto(),u.hide()}))),c.add(this.registerPickerListeners(u,o,s,e,n==null?void 0:n.providerOptions));const h=c.add(new wr);if(o&&c.add(o.provide(u,h.token,n==null?void 0:n.providerOptions)),Je.once(u.onDidHide)(()=>{u.selectedItems.length===0&&h.cancel(),c.dispose(),d==null||d.complete(u.selectedItems.slice(0))}),u.show(),t)return d==null?void 0:d.p}adjustValueSelection(e,t,n){var r;let o;n!=null&&n.preserveValue?o=[e.value.length,e.value.length]:o=[(r=t==null?void 0:t.prefix.length)!==null&&r!==void 0?r:0,e.value.length],e.valueSelection=o}registerPickerListeners(e,t,n,r,o){const s=new Te,a=this.visibleQuickAccess={picker:e,descriptor:n,value:r};return s.add(Rt(()=>{a===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),s.add(e.onDidChangeValue(l=>{const[c]=this.getOrInstantiateProvider(l);c!==t?this.show(l,{preserveValue:!0,providerOptions:o}):a.value=l})),n&&s.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(n,e.value)})),s}getOrInstantiateProvider(e){const t=this.registry.getQuickAccessProvider(e);if(!t)return[void 0,void 0];let n=this.mapProviderToDescriptor.get(t);return n||(n=this.instantiationService.createInstance(t.ctor),this.mapProviderToDescriptor.set(t,n)),[n,t]}};jV=lYe([pse(0,Eh),pse(1,Ot)],jV);class Ev{constructor(e,t){var n;this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=(n=t==null?void 0:t.supportIcons)!==null&&n!==void 0?n:!1,this.domNode=ke(e,He("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],n="",r){e||(e=""),r&&(e=Ev.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===n&&dc(this.highlights,t))&&(this.text=e,this.title=n,this.highlights=t,this.render())}render(){const e=[];let t=0;for(const n of this.highlights){if(n.end===n.start)continue;if(t{r=o===`\r +`?-1:0,s+=n;for(const a of t)a.end<=s||(a.start>=s&&(a.start+=r),a.end>=s&&(a.end+=r));return n+=r,"⏎"})}}class jx{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 ZP extends fe{constructor(e,t){var n;super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new jx(ke(e,He(".monaco-icon-label")))),this.labelContainer=ke(this.domNode.element,He(".monaco-icon-label-container")),this.nameContainer=ke(this.labelContainer,He("span.monaco-icon-name-container")),t!=null&&t.supportHighlights||t!=null&&t.supportIcons?this.nameNode=new dYe(this.nameContainer,!!t.supportIcons):this.nameNode=new cYe(this.nameContainer),this.hoverDelegate=(n=t==null?void 0:t.hoverDelegate)!==null&&n!==void 0?n:zp("mouse")}get element(){return this.domNode.element}setLabel(e,t,n){var r;const o=["monaco-icon-label"],s=["monaco-icon-label-container"];let a="";if(n&&(n.extraClasses&&o.push(...n.extraClasses),n.italic&&o.push("italic"),n.strikethrough&&o.push("strikethrough"),n.disabledCommand&&s.push("disabled"),n.title&&(typeof n.title=="string"?a+=n.title:a+=e)),this.domNode.className=o.join(" "),this.domNode.element.setAttribute("aria-label",a),this.labelContainer.className=s.join(" "),this.setupHover(n!=null&&n.descriptionTitle?this.labelContainer:this.element,n==null?void 0:n.title),this.nameNode.setLabel(e,n),t||this.descriptionNode){const l=this.getOrCreateDescriptionNode();l instanceof Ev?(l.set(t||"",n?n.descriptionMatches:void 0,void 0,n==null?void 0:n.labelEscapeNewLines),this.setupHover(l.element,n==null?void 0:n.descriptionTitle)):(l.textContent=t&&(n!=null&&n.labelEscapeNewLines)?Ev.escapeNewLines(t,[]):t||"",this.setupHover(l.element,(n==null?void 0:n.descriptionTitle)||""),l.empty=!t)}if(n!=null&&n.suffix||this.suffixNode){const l=this.getOrCreateSuffixNode();l.textContent=(r=n==null?void 0:n.suffix)!==null&&r!==void 0?r:""}}setupHover(e,t){const n=this.customHovers.get(e);if(n&&(n.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}if(this.hoverDelegate.showNativeHover)qGe(e,t);else{const r=mC(this.hoverDelegate,e,t);r&&this.customHovers.set(e,r)}}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateSuffixNode(){if(!this.suffixNode){const e=this._register(new jx(s8e(this.nameContainer,He("span.monaco-icon-suffix-container"))));this.suffixNode=this._register(new jx(ke(e.element,He("span.label-suffix"))))}return this.suffixNode}getOrCreateDescriptionNode(){var e;if(!this.descriptionNode){const t=this._register(new jx(ke(this.labelContainer,He("span.monaco-icon-description-container"))));!((e=this.creationOptions)===null||e===void 0)&&e.supportDescriptionHighlights?this.descriptionNode=new Ev(ke(t.element,He("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons}):this.descriptionNode=this._register(new jx(ke(t.element,He("span.label-description"))))}return this.descriptionNode}}class cYe{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&dc(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=ke(this.container,He("a.label-name",{id:t==null?void 0:t.domId}))),this.singleLabel.textContent=e;else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let n=0;n{const o={start:n,end:n+r.length},s=t.map(a=>xs.intersect(o,a)).filter(a=>!xs.isEmpty(a)).map(({start:a,end:l})=>({start:a-n,end:l-n}));return n=o.end+e.length,s})}class dYe{constructor(e,t){this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&dc(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=new Ev(ke(this.container,He("a.label-name",{id:t==null?void 0:t.domId})),{supportIcons:this.supportIcons})),this.singleLabel.set(e,t==null?void 0:t.matches,void 0,t==null?void 0:t.labelEscapeNewLines);else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;const n=(t==null?void 0:t.separator)||"/",r=uYe(e,n,t==null?void 0:t.matches);for(let o=0;o{const i=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:i,collatorIsNumeric:i.resolvedOptions().numeric}});function hYe(i,e,t=!1){const n=i||"",r=e||"",o=mse.value.collator.compare(n,r);return mse.value.collatorIsNumeric&&o===0&&n!==r?nr.length)return 1}return 0}var pYe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o};class x0e{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}}pYe([Rr],x0e.prototype,"toString",null);const mYe=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function vYe(i){const e=[];let t=0,n;for(;n=mYe.exec(i);){n.index-t>0&&e.push(i.substring(t,n.index));const[,r,o,,s]=n;s?e.push({label:r,href:o,title:s}):e.push({label:r,href:o}),t=n.index+n[0].length}return t{i8e(f)&&hn.stop(f,!0),t.callback(o.href)},c=t.disposables.add(new wn(a,Ge.CLICK)).event,u=t.disposables.add(new wn(a,Ge.KEY_DOWN)).event,d=Je.chain(u,f=>f.filter(g=>{const p=new Ai(g);return p.equals(10)||p.equals(3)}));t.disposables.add(wi.addTarget(a));const h=t.disposables.add(new wn(a,Si.Tap)).event;Je.any(c,h,d)(l,null,t.disposables),e.appendChild(a)}}var L0e=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o};const xd=He;class yYe{constructor(e,t,n,r,o,s,a){var l,c,u;this._checked=!1,this._hidden=!1,this.hasCheckbox=r,this.index=n,this.fireButtonTriggered=o,this.fireSeparatorButtonTriggered=s,this._onChecked=a,this.onChecked=r?Je.map(Je.filter(this._onChecked.event,d=>d.listElement===this),d=>d.checked):Je.None,e.type==="separator"?this._separator=e:(this.item=e,t&&t.type==="separator"&&!t.buttons&&(this._separator=t),this.saneDescription=this.item.description,this.saneDetail=this.item.detail,this._labelHighlights=(l=this.item.highlights)===null||l===void 0?void 0:l.label,this._descriptionHighlights=(c=this.item.highlights)===null||c===void 0?void 0:c.description,this._detailHighlights=(u=this.item.highlights)===null||u===void 0?void 0:u.detail,this.saneTooltip=this.item.tooltip),this._init=new Qf(()=>{var d;const h=(d=e.label)!==null&&d!==void 0?d:"",f=OL(h).text.trim(),g=e.ariaLabel||[h,this.saneDescription,this.saneDetail].map(p=>TKe(p)).filter(p=>!!p).join(", ");return{saneLabel:h,saneSortLabel:f,saneAriaLabel:g}})}get saneLabel(){return this._init.value.saneLabel}get saneSortLabel(){return this._init.value.saneSortLabel}get saneAriaLabel(){return this._init.value.saneAriaLabel}get element(){return this._element}set element(e){this._element=e}get hidden(){return this._hidden}set hidden(e){this._hidden=e}get checked(){return this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire({listElement:this,checked:e}))}get separator(){return this._separator}set separator(e){this._separator=e}get labelHighlights(){return this._labelHighlights}set labelHighlights(e){this._labelHighlights=e}get descriptionHighlights(){return this._descriptionHighlights}set descriptionHighlights(e){this._descriptionHighlights=e}get detailHighlights(){return this._detailHighlights}set detailHighlights(e){this._detailHighlights=e}}class eT{constructor(e,t){this.themeService=e,this.hoverDelegate=t}get templateId(){return eT.ID}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=[],t.toDisposeTemplate=[],t.entry=ke(e,xd(".quick-input-list-entry"));const n=ke(t.entry,xd("label.quick-input-list-label"));t.toDisposeTemplate.push(Sr(n,Ge.CLICK,c=>{t.checkbox.offsetParent||c.preventDefault()})),t.checkbox=ke(n,xd("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(Sr(t.checkbox,Ge.CHANGE,c=>{t.element.checked=t.checkbox.checked}));const r=ke(n,xd(".quick-input-list-rows")),o=ke(r,xd(".quick-input-list-row")),s=ke(r,xd(".quick-input-list-row"));t.label=new ZP(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.push(t.label),t.icon=Tq(t.label.element,xd(".quick-input-list-icon"));const a=ke(o,xd(".quick-input-list-entry-keybinding"));t.keybinding=new PS(a,yl);const l=ke(s,xd(".quick-input-list-label-meta"));return t.detail=new ZP(l,{supportHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.push(t.detail),t.separator=ke(t.entry,xd(".quick-input-list-separator")),t.actionBar=new au(t.entry,this.hoverDelegate?{hoverDelegate:this.hoverDelegate}:void 0),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.push(t.actionBar),t}renderElement(e,t,n){var r,o,s,a;n.element=e,e.element=(r=n.entry)!==null&&r!==void 0?r:void 0;const l=e.item?e.item:e.separator;n.checkbox.checked=e.checked,n.toDisposeElement.push(e.onChecked(p=>n.checkbox.checked=p));const{labelHighlights:c,descriptionHighlights:u,detailHighlights:d}=e;if(!((o=e.item)===null||o===void 0)&&o.iconPath){const p=Pw(this.themeService.getColorTheme().type)?e.item.iconPath.dark:(s=e.item.iconPath.light)!==null&&s!==void 0?s:e.item.iconPath.dark,v=At.revive(p);n.icon.className="quick-input-list-icon",n.icon.style.backgroundImage=Kv(v)}else n.icon.style.backgroundImage="",n.icon.className=!((a=e.item)===null||a===void 0)&&a.iconClass?`quick-input-list-icon ${e.item.iconClass}`:"";let h;!e.saneTooltip&&e.saneDescription&&(h={markdown:{value:e.saneDescription,supportThemeIcons:!0},markdownNotSupportedFallback:e.saneDescription});const f={matches:c||[],descriptionTitle:h,descriptionMatches:u||[],labelEscapeNewLines:!0};if(l.type!=="separator"?(f.extraClasses=l.iconClasses,f.italic=l.italic,f.strikethrough=l.strikethrough,n.entry.classList.remove("quick-input-list-separator-as-item")):n.entry.classList.add("quick-input-list-separator-as-item"),n.label.setLabel(e.saneLabel,e.saneDescription,f),n.keybinding.set(l.type==="separator"?void 0:l.keybinding),e.saneDetail){let p;e.saneTooltip||(p={markdown:{value:e.saneDetail,supportThemeIcons:!0},markdownNotSupportedFallback:e.saneDetail}),n.detail.element.style.display="",n.detail.setLabel(e.saneDetail,void 0,{matches:d,title:p,labelEscapeNewLines:!0})}else n.detail.element.style.display="none";e.item&&e.separator&&e.separator.label?(n.separator.textContent=e.separator.label,n.separator.style.display=""):n.separator.style.display="none",n.entry.classList.toggle("quick-input-list-separator-border",!!e.separator);const g=l.buttons;g&&g.length?(n.actionBar.push(g.map((p,v)=>KV(p,`id-${v}`,()=>l.type!=="separator"?e.fireButtonTriggered({button:p,item:l}):e.fireSeparatorButtonTriggered({button:p,separator:l}))),{icon:!0,label:!1}),n.entry.classList.add("has-actions")):n.entry.classList.remove("has-actions")}disposeElement(e,t,n){n.toDisposeElement=si(n.toDisposeElement),n.actionBar.clear()}disposeTemplate(e){e.toDisposeElement=si(e.toDisposeElement),e.toDisposeTemplate=si(e.toDisposeTemplate)}}eT.ID="listelement";class wYe{getHeight(e){return e.item?e.saneDetail?44:22:24}getTemplateId(e){return eT.ID}}var Fo;(function(i){i[i.First=1]="First",i[i.Second=2]="Second",i[i.Last=3]="Last",i[i.Next=4]="Next",i[i.Previous=5]="Previous",i[i.NextPage=6]="NextPage",i[i.PreviousPage=7]="PreviousPage"})(Fo||(Fo={}));class dY{constructor(e,t,n,r){this.parent=e,this.options=n,this.inputElements=[],this.elements=[],this.elementsToIndexes=new Map,this.matchOnDescription=!1,this.matchOnDetail=!1,this.matchOnLabel=!0,this.matchOnLabelMode="fuzzy",this.sortByLabel=!0,this._onChangedAllVisibleChecked=new se,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new se,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new se,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new se,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new se,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new se,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._onKeyDown=new se,this.onKeyDown=this._onKeyDown.event,this._onLeave=new se,this.onLeave=this._onLeave.event,this._listElementChecked=new se,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=ke(this.parent,xd(".quick-input-list"));const o=new wYe,s=new LYe;this.list=n.createList("QuickInput",this.container,o,[new eT(r,n.hoverDelegate)],{identityProvider:{getId:l=>{var c,u,d,h,f,g,p,v;return(v=(g=(h=(u=(c=l.item)===null||c===void 0?void 0:c.id)!==null&&u!==void 0?u:(d=l.item)===null||d===void 0?void 0:d.label)!==null&&h!==void 0?h:(f=l.separator)===null||f===void 0?void 0:f.id)!==null&&g!==void 0?g:(p=l.separator)===null||p===void 0?void 0:p.label)!==null&&v!==void 0?v:""}},setRowLineHeight:!1,multipleSelectionSupport:!1,horizontalScrolling:!1,accessibilityProvider:s}),this.list.getHTMLElement().id=t,this.disposables.push(this.list),this.disposables.push(this.list.onKeyDown(l=>{const c=new Ai(l);switch(c.keyCode){case 10:this.toggleCheckbox();break;case 31:(Ln?l.metaKey:l.ctrlKey)&&this.list.setFocus(la(this.list.length));break;case 16:{const u=this.list.getFocus();u.length===1&&u[0]===0&&this._onLeave.fire();break}case 18:{const u=this.list.getFocus();u.length===1&&u[0]===this.list.length-1&&this._onLeave.fire();break}}this._onKeyDown.fire(c)})),this.disposables.push(this.list.onMouseDown(l=>{l.browserEvent.button!==2&&l.browserEvent.preventDefault()})),this.disposables.push(ye(this.container,Ge.CLICK,l=>{(l.x||l.y)&&this._onLeave.fire()})),this.disposables.push(this.list.onMouseMiddleClick(l=>{this._onLeave.fire()})),this.disposables.push(this.list.onContextMenu(l=>{typeof l.index=="number"&&(l.browserEvent.preventDefault(),this.list.setSelection([l.index]))}));const a=new zpe(n.hoverDelegate.delay);this.disposables.push(this.list.onMouseOver(async l=>{var c;if(l.browserEvent.target instanceof HTMLAnchorElement){a.cancel();return}if(!(!(l.browserEvent.relatedTarget instanceof HTMLAnchorElement)&&es(l.browserEvent.relatedTarget,(c=l.element)===null||c===void 0?void 0:c.element)))try{await a.trigger(async()=>{l.element&&this.showHover(l.element)})}catch(u){if(!wh(u))throw u}})),this.disposables.push(this.list.onMouseOut(l=>{var c;es(l.browserEvent.relatedTarget,(c=l.element)===null||c===void 0?void 0:c.element)||a.cancel()})),this.disposables.push(a),this.disposables.push(this._listElementChecked.event(l=>this.fireCheckedEvents())),this.disposables.push(this._onChangedAllVisibleChecked,this._onChangedCheckedCount,this._onChangedVisibleCount,this._onChangedCheckedElements,this._onButtonTriggered,this._onSeparatorButtonTriggered,this._onLeave,this._onKeyDown)}get onDidChangeFocus(){return Je.map(this.list.onDidChangeFocus,e=>e.elements.map(t=>t.item))}get onDidChangeSelection(){return Je.map(this.list.onDidChangeSelection,e=>({items:e.elements.map(t=>t.item),event:e.browserEvent}))}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}get ariaLabel(){return this.list.getHTMLElement().ariaLabel}set ariaLabel(e){this.list.getHTMLElement().ariaLabel=e}getAllVisibleChecked(){return this.allVisibleChecked(this.elements,!1)}allVisibleChecked(e,t=!0){for(let n=0,r=e.length;n{t.hidden||(t.checked=e)})}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}setElements(e){this.elementDisposables=si(this.elementDisposables);const t=s=>this.fireButtonTriggered(s),n=s=>this.fireSeparatorButtonTriggered(s);this.inputElements=e;const r=new Map,o=this.parent.classList.contains("show-checkboxes");this.elements=e.reduce((s,a,l)=>{var c;const u=l>0?e[l-1]:void 0;if(a.type==="separator"&&!a.buttons)return s;const d=new yYe(a,u,l,o,t,n,this._listElementChecked),h=s.length;return s.push(d),r.set((c=d.item)!==null&&c!==void 0?c:d.separator,h),s},[]),this.elementsToIndexes=r,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(t=>this.elementsToIndexes.has(t)).map(t=>this.elementsToIndexes.get(t))),e.length>0){const t=this.list.getFocus()[0];typeof t=="number"&&this.list.reveal(t)}}getActiveDescendant(){return this.list.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){this.list.setSelection(e.filter(t=>this.elementsToIndexes.has(t)).map(t=>this.elementsToIndexes.get(t)))}getCheckedElements(){return this.elements.filter(e=>e.checked).map(e=>e.item).filter(e=>!!e)}setCheckedElements(e){try{this._fireCheckedEvents=!1;const t=new Set;for(const n of e)t.add(n);for(const n of this.elements)n.checked=t.has(n.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===Fo.Second&&this.list.length<2&&(e=Fo.First),e){case Fo.First:this.list.scrollTop=0,this.list.focusFirst(void 0,n=>!!n.item);break;case Fo.Second:this.list.scrollTop=0,this.list.focusNth(1,void 0,n=>!!n.item);break;case Fo.Last:this.list.scrollTop=this.list.scrollHeight,this.list.focusLast(void 0,n=>!!n.item);break;case Fo.Next:{this.list.focusNext(void 0,!0,void 0,r=>!!r.item);const n=this.list.getFocus()[0];n!==0&&!this.elements[n-1].item&&this.list.firstVisibleIndex>n-1&&this.list.reveal(n-1);break}case Fo.Previous:{this.list.focusPrevious(void 0,!0,void 0,r=>!!r.item);const n=this.list.getFocus()[0];n!==0&&!this.elements[n-1].item&&this.list.firstVisibleIndex>n-1&&this.list.reveal(n-1);break}case Fo.NextPage:this.list.focusNextPage(void 0,n=>!!n.item);break;case Fo.PreviousPage:this.list.focusPreviousPage(void 0,n=>!!n.item);break}const t=this.list.getFocus()[0];typeof t=="number"&&this.list.reveal(t)}clearFocus(){this.list.setFocus([])}domFocus(){this.list.domFocus()}showHover(e){var t,n,r;this._lastHover&&!this._lastHover.isDisposed&&((n=(t=this.options.hoverDelegate).onDidHideHover)===null||n===void 0||n.call(t),(r=this._lastHover)===null||r===void 0||r.dispose()),!(!e.element||!e.saneTooltip)&&(this._lastHover=this.options.hoverDelegate.showHover({content:e.saneTooltip,target:e.element,linkHandler:o=>{this.options.linkOpenerDelegate(o)},appearance:{showPointer:!0},container:this.container,position:{hoverPosition:1}},!1))}layout(e){this.list.getHTMLElement().style.maxHeight=e?`${Math.floor(e/44)*44+6}px`:"",this.list.layout()}filter(e){if(!(this.sortByLabel||this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))return this.list.layout(),!1;const t=e;if(e=e.trim(),!e||!(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))this.elements.forEach(r=>{r.labelHighlights=void 0,r.descriptionHighlights=void 0,r.detailHighlights=void 0,r.hidden=!1;const o=r.index&&this.inputElements[r.index-1];r.item&&(r.separator=o&&o.type==="separator"&&!o.buttons?o:void 0)});else{let r;this.elements.forEach(o=>{var s,a,l,c;let u;this.matchOnLabelMode==="fuzzy"?u=this.matchOnLabel&&(s=i9(e,OL(o.saneLabel)))!==null&&s!==void 0?s:void 0:u=this.matchOnLabel&&(a=SYe(t,OL(o.saneLabel)))!==null&&a!==void 0?a:void 0;const d=this.matchOnDescription&&(l=i9(e,OL(o.saneDescription||"")))!==null&&l!==void 0?l:void 0,h=this.matchOnDetail&&(c=i9(e,OL(o.saneDetail||"")))!==null&&c!==void 0?c:void 0;if(u||d||h?(o.labelHighlights=u,o.descriptionHighlights=d,o.detailHighlights=h,o.hidden=!1):(o.labelHighlights=void 0,o.descriptionHighlights=void 0,o.detailHighlights=void 0,o.hidden=o.item?!o.item.alwaysShow:!0),o.item?o.separator=void 0:o.separator&&(o.hidden=!0),!this.sortByLabel){const f=o.index&&this.inputElements[o.index-1];r=f&&f.type==="separator"?f:r,r&&!o.hidden&&(o.separator=r,r=void 0)}})}const n=this.elements.filter(r=>!r.hidden);if(this.sortByLabel&&e){const r=e.toLowerCase();n.sort((o,s)=>xYe(o,s,r))}return this.elementsToIndexes=n.reduce((r,o,s)=>{var a;return r.set((a=o.item)!==null&&a!==void 0?a:o.separator,s),r},new Map),this.list.splice(0,this.list.length,n),this.list.setFocus([]),this.list.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(n.length),!0}toggleCheckbox(){try{this._fireCheckedEvents=!1;const e=this.list.getFocusedElements(),t=this.allVisibleChecked(e);for(const n of e)n.checked=!t}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}display(e){this.container.style.display=e?"":"none"}isDisplayed(){return this.container.style.display!=="none"}dispose(){this.elementDisposables=si(this.elementDisposables),this.disposables=si(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)}fireSeparatorButtonTriggered(e){this._onSeparatorButtonTriggered.fire(e)}style(e){this.list.style(e)}toggleHover(){const e=this.list.getFocusedElements()[0];if(!(e!=null&&e.saneTooltip))return;if(this._lastHover&&!this._lastHover.isDisposed){this._lastHover.dispose();return}const t=this.list.getFocusedElements()[0];if(!t)return;this.showHover(t);const n=new Te;n.add(this.list.onDidChangeFocus(r=>{r.indexes.length&&this.showHover(r.elements[0])})),this._lastHover&&n.add(this._lastHover),this._toggleHover=n,this.elementDisposables.push(this._toggleHover)}}L0e([Rr],dY.prototype,"onDidChangeFocus",null);L0e([Rr],dY.prototype,"onDidChangeSelection",null);function SYe(i,e){const{text:t,iconOffsets:n}=e;if(!n||n.length===0)return vse(i,t);const r=Ik(t," "),o=t.length-r.length,s=vse(i,r);if(s)for(const a of s){const l=n[a.start+o]+o;a.start+=l,a.end+=l}return s}function vse(i,e){const t=e.toLowerCase().indexOf(i.toLowerCase());return t!==-1?[{start:t,end:t+i.length}]:null}function xYe(i,e,t){const n=i.labelHighlights||[],r=e.labelHighlights||[];return n.length&&!r.length?-1:!n.length&&r.length?1:n.length===0&&r.length===0?0:fYe(i.saneSortLabel,e.saneSortLabel,t)}class LYe{getWidgetAriaLabel(){return w("quickInput","Quick Input")}getAriaLabel(e){var t;return!((t=e.separator)===null||t===void 0)&&t.label?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(e.hasCheckbox)return{value:e.checked,onDidChange:e.onChecked}}}var EYe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},_se=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const GV={iconClass:Wt.asClassName(Xe.quickInputBack),tooltip:w("quickInput.back","Back"),handle:-1};class tT extends fe{constructor(e){super(),this.ui=e,this._widgetUpdated=!1,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._buttons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=tT.noPromptMessage,this._severity=kr.Ignore,this.onDidTriggerButtonEmitter=this._register(new se),this.onDidHideEmitter=this._register(new se),this.onDisposeEmitter=this._register(new se),this.visibleDisposables=this._register(new Te),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&&!ch;this._ignoreFocusOut=e&&!ch,t&&this.update()}get buttons(){return this._buttons}set buttons(e){this._buttons=e,this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=e??[],this.togglesUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get severity(){return this._severity}set severity(e){this._severity=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton(e=>{this.buttons.indexOf(e)!==-1&&this.onDidTriggerButtonEmitter.fire(e)})),this.ui.show(this),this.visible=!0,this._lastValidationMessage=void 0,this._lastSeverity=void 0,this.buttons.length&&(this.buttonsUpdated=!0),this.toggles.length&&(this.togglesUpdated=!0),this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=pI.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}update(){var e,t;if(!this.visible)return;const n=this.getTitle();n&&this.ui.title.textContent!==n?this.ui.title.textContent=n:!n&&this.ui.title.innerHTML!==" "&&(this.ui.title.innerText=" ");const r=this.getDescription();if(this.ui.description1.textContent!==r&&(this.ui.description1.textContent=r),this.ui.description2.textContent!==r&&(this.ui.description2.textContent=r),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?gs(this.ui.widget,this._widget):gs(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new cd,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 s=this.buttons.filter(l=>l===GV).map((l,c)=>KV(l,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(l)));this.ui.leftActionBar.push(s,{icon:!0,label:!1}),this.ui.rightActionBar.clear();const a=this.buttons.filter(l=>l!==GV).map((l,c)=>KV(l,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(l)));this.ui.rightActionBar.push(a,{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const s=(t=(e=this.toggles)===null||e===void 0?void 0:e.filter(a=>a instanceof AS))!==null&&t!==void 0?t:[];this.ui.inputBox.toggles=s}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const o=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==o&&(this._lastValidationMessage=o,gs(this.ui.message),CYe(o,this.ui.message,{callback:s=>{this.ui.linkOpenerDelegate(s)},disposables:this.visibleDisposables})),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?w("quickInput.steps","{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==kr.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()}}tT.noPromptMessage=w("inputModeEntry","Press 'Enter' to confirm your input or 'Escape' to cancel");class mI extends tT{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new se),this.onWillAcceptEmitter=this._register(new se),this.onDidAcceptEmitter=this._register(new se),this.onDidCustomEmitter=this._register(new se),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._keepScrollPosition=!1,this._itemActivation=Md.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new se),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new se),this.onDidTriggerItemButtonEmitter=this._register(new se),this.onDidTriggerSeparatorButtonEmitter=this._register(new se),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,this.onDidTriggerSeparatorButton=this.onDidTriggerSeparatorButtonEmitter.event}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this.doSetValue(e)}doSetValue(e,t){this._value!==e&&(this._value=e,t||this.update(),this.visible&&this.ui.list.filter(this.filterValue(this._value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(this._value))}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get items(){return this._items}get scrollTop(){return this.ui.list.scrollTop}set scrollTop(e){this.ui.list.scrollTop=e}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(e){this._keepScrollPosition=e}get itemActivation(){return this._itemActivation}set itemActivation(e){this._itemActivation=e}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?aYe: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.canSelectMany||this.ui.list.focus(Fo.First)}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{this.doSetValue(e,!0)})),this.visibleDisposables.add((this._hideInput?this.ui.list:this.ui.inputBox).onKeyDown(e=>{switch(e.keyCode){case 18:this.ui.list.focus(Fo.Next),this.canSelectMany&&this.ui.list.domFocus(),hn.stop(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(Fo.Previous):this.ui.list.focus(Fo.Last),this.canSelectMany&&this.ui.list.domFocus(),hn.stop(e,!0);break;case 12:this.ui.list.focus(Fo.NextPage),this.canSelectMany&&this.ui.list.domFocus(),hn.stop(e,!0);break;case 11:this.ui.list.focus(Fo.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),hn.stop(e,!0);break;case 17:if(!this._canAcceptInBackground||!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(Fo.First),hn.stop(e,!0));break;case 13:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(Fo.Last),hn.stop(e,!0));break}})),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&&or(e,this._activeItems,(t,n)=>t===n)||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onDidChangeSelection(({items:e,event:t})=>{if(this.canSelectMany){e.length&&this.ui.list.setSelectedElements([]);return}this.selectedItemsToConfirm!==this._selectedItems&&or(e,this._selectedItems,(n,r)=>n===r)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(Iq(t)&&t.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{this.canSelectMany&&(this.selectedItemsToConfirm!==this._selectedItems&&or(e,this._selectedItems,(t,n)=>t===n)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e)))})),this.visibleDisposables.add(this.ui.list.onButtonTriggered(e=>this.onDidTriggerItemButtonEmitter.fire(e))),this.visibleDisposables.add(this.ui.list.onSeparatorButtonTriggered(e=>this.onDidTriggerSeparatorButtonEmitter.fire(e))),this.visibleDisposables.add(this.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}handleAccept(e){let t=!1;this.onWillAcceptEmitter.fire({veto:()=>t=!0}),t||this.onDidAcceptEmitter.fire({inBackground:e})}registerQuickNavigation(){return ye(this.ui.container,Ge.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new Ai(e),n=t.keyCode;this._quickNavigate.keybindings.some(s=>{const a=s.getChords();return a.length>1?!1:a[0].shiftKey&&n===4?!(t.ctrlKey||t.altKey||t.metaKey):!!(a[0].altKey&&n===6||a[0].ctrlKey&&n===5||a[0].metaKey&&n===57)})&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!1)),this._quickNavigate=void 0)})}update(){if(!this.visible)return;const e=this.keepScrollPosition?this.scrollTop:0,t=!!this.description,n={title:!!this.title||!!this.step||!!this.buttons.length,description:t,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||t,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:this.ok==="default"?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage,customButton:this.customButton};this.ui.setVisibilities(n),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||"");let r=this.ariaLabel;if(!r&&n.inputBox&&(r=this.placeholder||mI.DEFAULT_ARIA_LABEL,this.title&&(r+=` - ${this.title}`)),this.ui.list.ariaLabel!==r&&(this.ui.list.ariaLabel=r??null),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.matchOnLabelMode=this.matchOnLabelMode,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated)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 Md.NONE:this._itemActivation=Md.FIRST;break;case Md.SECOND:this.ui.list.focus(Fo.Second),this._itemActivation=Md.FIRST;break;case Md.LAST:this.ui.list.focus(Fo.Last),this._itemActivation=Md.FIRST;break;default:this.trySelectFirst();break}this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",n.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(Fo.First)),this.keepScrollPosition&&(this.scrollTop=e)}}mI.DEFAULT_ARIA_LABEL=w("quickInputBox.ariaLabel","Type to narrow down results.");class DYe extends tT{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new se),this.onDidAcceptEmitter=this._register(new se),this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",this.update()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get password(){return this._password}set password(e){this._password=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{e!==this.value&&(this._value=e,this.onDidValueChangeEmitter.fire(e))})),this.visibleDisposables.add(this.ui.onDidAccept(()=>this.onDidAcceptEmitter.fire())),this.valueSelectionUpdated=!0),super.show()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");const e={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0,progressBar:!0};this.ui.setVisibilities(e),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password)}}let qV=class extends EP{constructor(e,t){super("element",!1,n=>this.getOverrideOptions(n),e,t)}getOverrideOptions(e){var t;const n=(e.content instanceof HTMLElement?(t=e.content.textContent)!==null&&t!==void 0?t:"":typeof e.content=="string"?e.content:e.content.value).includes(` +`);return{persistence:{hideOnKeyDown:!1},appearance:{showHoverHint:n,skipFadeInAnimation:!0}}}};qV=EYe([_se(0,gn),_se(1,kX)],qV);me.white.toString(),me.white.toString();let QP=class extends fe{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new se),this._onDidEscape=this._register(new se),this.options=t,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),this._element.classList.toggle("secondary",!!t.secondary);const n=t.secondary?t.buttonSecondaryBackground:t.buttonBackground,r=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=r||"",this._element.style.backgroundColor=n||"",t.supportShortLabel&&(this._labelShortElement=document.createElement("div"),this._labelShortElement.classList.add("monaco-button-label-short"),this._element.appendChild(this._labelShortElement),this._labelElement=document.createElement("div"),this._labelElement.classList.add("monaco-button-label"),this._element.appendChild(this._labelElement),this._element.classList.add("monaco-text-button-with-short-label")),typeof t.ariaLabel=="string"&&this._element.setAttribute("aria-label",t.ariaLabel),e.appendChild(this._element),this._register(wi.addTarget(this._element)),[Ge.CLICK,Si.Tap].forEach(o=>{this._register(ye(this._element,o,s=>{if(!this.enabled){hn.stop(s);return}this._onDidClick.fire(s)}))}),this._register(ye(this._element,Ge.KEY_DOWN,o=>{const s=new Ai(o);let a=!1;this.enabled&&(s.equals(3)||s.equals(10))?(this._onDidClick.fire(o),a=!0):s.equals(9)&&(this._onDidEscape.fire(o),this._element.blur(),a=!0),a&&hn.stop(s,!0)})),this._register(ye(this._element,Ge.MOUSE_OVER,o=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(ye(this._element,Ge.MOUSE_OUT,o=>{this.updateBackground(!1)})),this.focusTracker=this._register(dh(this._element)),this._register(this.focusTracker.onDidFocus(()=>{this.enabled&&this.updateBackground(!0)})),this._register(this.focusTracker.onDidBlur(()=>{this.enabled&&this.updateBackground(!1)}))}dispose(){super.dispose(),this._element.remove()}getContentElements(e){const t=[];for(let n of Sv(e))if(typeof n=="string"){if(n=n.trim(),n==="")continue;const r=document.createElement("span");r.textContent=n,t.push(r)}else t.push(n);return t}updateBackground(e){let t;this.options.secondary?t=e?this.options.buttonSecondaryHoverBackground:this.options.buttonSecondaryBackground:t=e?this.options.buttonHoverBackground:this.options.buttonBackground,t&&(this._element.style.backgroundColor=t)}get element(){return this._element}set label(e){var t;if(this._label===e||Mf(this._label)&&Mf(e)&&NKe(this._label,e))return;this._element.classList.add("monaco-text-button");const n=this.options.supportShortLabel?this._labelElement:this._element;if(Mf(e)){const o=Y4(e,{inline:!0});o.dispose();const s=(t=o.element.querySelector("p"))===null||t===void 0?void 0:t.innerHTML;if(s){const a=Ype(s,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});n.innerHTML=a}else gs(n)}else this.options.supportIcons?gs(n,...this.getContentElements(e)):n.textContent=e;let r="";typeof this.options.title=="string"?r=this.options.title:this.options.title&&(r=WKe(e)),this._hover?this._hover.update(r):this._hover=this._register(mC(zp("mouse"),this._element,r)),typeof this.options.ariaLabel=="string"?this._element.setAttribute("aria-label",this.options.ariaLabel):this.options.ariaLabel&&this._element.setAttribute("aria-label",this._element.title),this._label=e}get label(){return this._label}set icon(e){this._element.classList.add(...Wt.asClassNameArray(e))}set enabled(e){e?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}};class XV{constructor(e,t,n){this.options=t,this.styles=n,this.count=0,this.element=ke(e,He(".monaco-count-badge")),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0)}setCount(e){this.count=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){var e,t;this.element.textContent=Eb(this.countFormat,this.count),this.element.title=Eb(this.titleFormat,this.count),this.element.style.backgroundColor=(e=this.styles.badgeBackground)!==null&&e!==void 0?e:"",this.element.style.color=(t=this.styles.badgeForeground)!==null&&t!==void 0?t:"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}const bse="done",Cse="active",m9="infinite",v9="infinite-long-running",yse="discrete";class d3 extends fe{constructor(e,t){super(),this.workedVal=0,this.showDelayedScheduler=this._register(new pi(()=>bl(this.element),0)),this.longRunningScheduler=this._register(new pi(()=>this.infiniteLongRunning(),d3.LONG_RUNNING_INFINITE_THRESHOLD)),this.create(e,t)}create(e,t){this.element=document.createElement("div"),this.element.classList.add("monaco-progress-container"),this.element.setAttribute("role","progressbar"),this.element.setAttribute("aria-valuemin","0"),e.appendChild(this.element),this.bit=document.createElement("div"),this.bit.classList.add("progress-bit"),this.bit.style.backgroundColor=(t==null?void 0:t.progressBarBackground)||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(Cse,m9,v9,yse),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(bse),this.element.classList.contains(m9)?(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(yse,bse,v9),this.element.classList.add(Cse,m9),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(v9)}getContainer(){return this.element}}d3.LONG_RUNNING_INFINITE_THRESHOLD=1e4;const IYe=He;class kYe extends fe{constructor(e,t,n){super(),this.parent=e,this.onKeyDown=o=>Sr(this.findInput.inputBox.inputElement,Ge.KEY_DOWN,o),this.onDidChange=o=>this.findInput.onDidChange(o),this.container=ke(this.parent,IYe(".quick-input-box")),this.findInput=this._register(new o0e(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:n}));const r=this.findInput.inputBox.inputElement;r.role="combobox",r.ariaHasPopup="menu",r.ariaAutoComplete="list",r.ariaExpanded="true"}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}get placeholder(){return this.findInput.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.findInput.inputBox.setPlaceHolder(e)}get password(){return this.findInput.inputBox.inputElement.type==="password"}set password(e){this.findInput.inputBox.inputElement.type=e?"password":"text"}set enabled(e){this.findInput.inputBox.inputElement.toggleAttribute("readonly",!e)}set toggles(e){this.findInput.setAdditionalToggles(e)}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}showDecoration(e){e===kr.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===kr.Info?1:e===kr.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===kr.Info?1:e===kr.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}const pl=He;class h3 extends fe{get container(){return this._container}constructor(e,t,n){super(),this.options=e,this.themeService=t,this.layoutService=n,this.enabled=!0,this.onDidAcceptEmitter=this._register(new se),this.onDidCustomEmitter=this._register(new se),this.onDidTriggerButtonEmitter=this._register(new se),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new se),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new se),this.onHide=this.onHideEmitter.event,this.idPrefix=e.idPrefix,this._container=e.container,this.styles=e.styles,this._register(Je.runAndSubscribe(d4,({window:r,disposables:o})=>this.registerKeyModsListeners(r,o),{window:hi,disposables:this._store})),this._register(zBe(r=>{this.ui&&Pt(this.ui.container)===r&&(this.reparentUI(this.layoutService.mainContainer),this.layout(this.layoutService.mainContainerDimension,this.layoutService.mainContainerOffset.quickPickTop))}))}registerKeyModsListeners(e,t){const n=r=>{this.keyMods.ctrlCmd=r.ctrlKey||r.metaKey,this.keyMods.alt=r.altKey};for(const r of[Ge.KEY_DOWN,Ge.KEY_UP,Ge.MOUSE_DOWN])t.add(ye(e,r,n,!0))}getUI(e){if(this.ui)return e&&Pt(this._container)!==Pt(this.layoutService.activeContainer)&&(this.reparentUI(this.layoutService.activeContainer),this.layout(this.layoutService.activeContainerDimension,this.layoutService.activeContainerOffset.quickPickTop)),this.ui;const t=ke(this._container,pl(".quick-input-widget.show-file-icons"));t.tabIndex=-1,t.style.display="none";const n=gc(t),r=ke(t,pl(".quick-input-titlebar")),o=this._register(new au(r,{hoverDelegate:this.options.hoverDelegate}));o.domNode.classList.add("quick-input-left-action-bar");const s=ke(r,pl(".quick-input-title")),a=this._register(new au(r,{hoverDelegate:this.options.hoverDelegate}));a.domNode.classList.add("quick-input-right-action-bar");const l=ke(t,pl(".quick-input-header")),c=ke(l,pl("input.quick-input-check-all"));c.type="checkbox",c.setAttribute("aria-label",w("quickInput.checkAll","Toggle all checkboxes")),this._register(Sr(c,Ge.CHANGE,R=>{const F=c.checked;A.setAllVisibleChecked(F)})),this._register(ye(c,Ge.CLICK,R=>{(R.x||R.y)&&f.setFocus()}));const u=ke(l,pl(".quick-input-description")),d=ke(l,pl(".quick-input-and-message")),h=ke(d,pl(".quick-input-filter")),f=this._register(new kYe(h,this.styles.inputBox,this.styles.toggle));f.setAttribute("aria-describedby",`${this.idPrefix}message`);const g=ke(h,pl(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");const p=new XV(g,{countFormat:w({key:"quickInput.visibleCount",comment:["This tells the user how many items are shown in a list of items to select from. The items can be anything. Currently not visible, but read by screen readers."]},"{0} Results")},this.styles.countBadge),v=ke(h,pl(".quick-input-count"));v.setAttribute("aria-live","polite");const m=new XV(v,{countFormat:w({key:"quickInput.countSelected",comment:["This tells the user how many items are selected in a list of items to select from. The items can be anything."]},"{0} Selected")},this.styles.countBadge),_=ke(l,pl(".quick-input-action")),y=this._register(new QP(_,this.styles.button));y.label=w("ok","OK"),this._register(y.onDidClick(R=>{this.onDidAcceptEmitter.fire()}));const S=ke(l,pl(".quick-input-action")),L=this._register(new QP(S,{...this.styles.button,supportIcons:!0}));L.label=w("custom","Custom"),this._register(L.onDidClick(R=>{this.onDidCustomEmitter.fire()}));const E=ke(d,pl(`#${this.idPrefix}message.quick-input-message`)),D=this._register(new d3(t,this.styles.progressBar));D.getContainer().classList.add("quick-input-progress");const k=ke(t,pl(".quick-input-html-widget"));k.tabIndex=-1;const T=ke(t,pl(".quick-input-description")),M=this.idPrefix+"list",A=this._register(new dY(t,M,this.options,this.themeService));f.setAttribute("aria-controls",M),this._register(A.onDidChangeFocus(()=>{var R;f.setAttribute("aria-activedescendant",(R=A.getActiveDescendant())!==null&&R!==void 0?R:"")})),this._register(A.onChangedAllVisibleChecked(R=>{c.checked=R})),this._register(A.onChangedVisibleCount(R=>{p.setCount(R)})),this._register(A.onChangedCheckedCount(R=>{m.setCount(R)})),this._register(A.onLeave(()=>{setTimeout(()=>{this.controller&&(f.setFocus(),this.controller instanceof mI&&this.controller.canSelectMany&&A.clearFocus())},0)}));const N=dh(t);return this._register(N),this._register(ye(t,Ge.FOCUS,R=>{es(R.relatedTarget,t)||(this.previousFocusElement=R.relatedTarget instanceof HTMLElement?R.relatedTarget:void 0)},!0)),this._register(N.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(pI.Blur),this.previousFocusElement=void 0})),this._register(ye(t,Ge.FOCUS,R=>{f.setFocus()})),this._register(Sr(t,Ge.KEY_DOWN,R=>{if(!es(R.target,k))switch(R.keyCode){case 3:hn.stop(R,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case 9:hn.stop(R,!0),this.hide(pI.Gesture);break;case 2:if(!R.altKey&&!R.ctrlKey&&!R.metaKey){const F=[".quick-input-list .monaco-action-bar .always-visible",".quick-input-list-entry:hover .monaco-action-bar",".monaco-list-row.focused .monaco-action-bar"];if(t.classList.contains("show-checkboxes")?F.push("input"):F.push("input[type=text]"),this.getUI().list.isDisplayed()&&F.push(".monaco-list"),this.getUI().message&&F.push(".quick-input-message a"),this.getUI().widget){if(es(R.target,this.getUI().widget))break;F.push(".quick-input-html-widget")}const W=t.querySelectorAll(F.join(", "));R.shiftKey&&R.target===W[0]?(hn.stop(R,!0),A.clearFocus()):!R.shiftKey&&es(R.target,W[W.length-1])&&(hn.stop(R,!0),W[0].focus())}break;case 10:R.ctrlKey&&(hn.stop(R,!0),this.getUI().list.toggleHover());break}})),this.ui={container:t,styleSheet:n,leftActionBar:o,titleBar:r,title:s,description1:T,description2:u,widget:k,rightActionBar:a,checkAll:c,inputContainer:d,filterContainer:h,inputBox:f,visibleCountContainer:g,visibleCount:p,countContainer:v,count:m,okContainer:_,ok:y,message:E,customButtonContainer:S,customButton:L,list:A,progressBar:D,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:R=>this.show(R),hide:()=>this.hide(),setVisibilities:R=>this.setVisibilities(R),setEnabled:R=>this.setEnabled(R),setContextKey:R=>this.options.setContextKey(R),linkOpenerDelegate:R=>this.options.linkOpenerDelegate(R)},this.updateStyles(),this.ui}reparentUI(e){this.ui&&(this._container=e,ke(this._container,this.ui.container))}pick(e,t={},n=Cn.None){return new Promise((r,o)=>{let s=u=>{var d;s=r,(d=t.onKeyMods)===null||d===void 0||d.call(t,a.keyMods),r(u)};if(n.isCancellationRequested){s(void 0);return}const a=this.createQuickPick();let l;const c=[a,a.onDidAccept(()=>{if(a.canSelectMany)s(a.selectedItems.slice()),a.hide();else{const u=a.activeItems[0];u&&(s(u),a.hide())}}),a.onDidChangeActive(u=>{const d=u[0];d&&t.onDidFocus&&t.onDidFocus(d)}),a.onDidChangeSelection(u=>{if(!a.canSelectMany){const d=u[0];d&&(s(d),a.hide())}}),a.onDidTriggerItemButton(u=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton({...u,removeItem:()=>{const d=a.items.indexOf(u.item);if(d!==-1){const h=a.items.slice(),f=h.splice(d,1),g=a.activeItems.filter(v=>v!==f[0]),p=a.keepScrollPosition;a.keepScrollPosition=!0,a.items=h,g&&(a.activeItems=g),a.keepScrollPosition=p}}})),a.onDidTriggerSeparatorButton(u=>{var d;return(d=t.onDidTriggerSeparatorButton)===null||d===void 0?void 0:d.call(t,u)}),a.onDidChangeValue(u=>{l&&!u&&(a.activeItems.length!==1||a.activeItems[0]!==l)&&(a.activeItems=[l])}),n.onCancellationRequested(()=>{a.hide()}),a.onDidHide(()=>{si(c),s(void 0)})];a.title=t.title,a.canSelectMany=!!t.canPickMany,a.placeholder=t.placeHolder,a.ignoreFocusOut=!!t.ignoreFocusLost,a.matchOnDescription=!!t.matchOnDescription,a.matchOnDetail=!!t.matchOnDetail,a.matchOnLabel=t.matchOnLabel===void 0||t.matchOnLabel,a.quickNavigate=t.quickNavigate,a.hideInput=!!t.hideInput,a.contextKey=t.contextKey,a.busy=!0,Promise.all([e,t.activeItem]).then(([u,d])=>{l=d,a.busy=!1,a.items=u,a.canSelectMany&&(a.selectedItems=u.filter(h=>h.type!=="separator"&&h.picked)),l&&(a.activeItems=[l])}),a.show(),Promise.resolve(e).then(void 0,u=>{o(u),a.hide()})})}createQuickPick(){const e=this.getUI(!0);return new mI(e)}createInputBox(){const e=this.getUI(!0);return new DYe(e)}show(e){const t=this.getUI(!0);this.onShowEmitter.fire();const n=this.controller;this.controller=e,n==null||n.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",gs(t.widget),t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(kr.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),gs(t.message),t.progressBar.stop(),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.ignoreFocusOut=!1,t.inputBox.toggles=void 0;const r=this.options.backKeybindingLabel();GV.tooltip=r?w("quickInput.backWithKeybinding","Back ({0})",r):w("quickInput.back","Back"),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus()}isVisible(){return!!this.ui&&this.ui.container.style.display!=="none"}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",t.description2.style.display=e.description&&!(e.inputBox||e.checkAll)?"":"none",t.checkAll.style.display=e.checkAll?"":"none",t.inputContainer.style.display=e.inputBox?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.display(!!e.list),t.container.classList.toggle("show-checkboxes",!!e.checkBox),t.container.classList.toggle("hidden-input",!e.inputBox&&!e.description),this.updateLayout()}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const t of this.getUI().leftActionBar.viewItems)t.action.enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.action.enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().inputBox.enabled=e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(e){var t,n;const r=this.controller;if(!r)return;const o=(t=this.ui)===null||t===void 0?void 0:t.container,s=o&&!ome(o);if(this.controller=null,this.onHideEmitter.fire(),o&&(o.style.display="none"),!s){let a=this.previousFocusElement;for(;a&&!a.offsetParent;)a=(n=a.parentElement)!==null&&n!==void 0?n:void 0;a!=null&&a.offsetParent?(a.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}r.didHide(e)}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui&&this.isVisible()){this.ui.container.style.top=`${this.titleBarOffset}px`;const e=this.ui.container.style,t=Math.min(this.dimension.width*.62,h3.MAX_WIDTH);e.width=t+"px",e.marginLeft="-"+t/2+"px",this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&this.dimension.height*.4)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:n,widgetBorder:r,widgetShadow:o}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e??"",this.ui.container.style.backgroundColor=t??"",this.ui.container.style.color=n??"",this.ui.container.style.border=r?`1px solid ${r}`:"",this.ui.container.style.boxShadow=o?`0 0 8px 2px ${o}`:"",this.ui.list.style(this.styles.list);const s=[];this.styles.pickerGroup.pickerGroupBorder&&s.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&s.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&s.push(".quick-input-list .quick-input-list-separator-as-item { color: var(--vscode-descriptionForeground); }"),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(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 a=s.join(` +`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}}h3.MAX_WIDTH=600;var TYe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Kx=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let YV=class extends U$e{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(jV))),this._quickAccess}constructor(e,t,n,r,o){super(n),this.instantiationService=e,this.contextKeyService=t,this.layoutService=r,this.configurationService=o,this._onShow=this._register(new se),this._onHide=this._register(new se),this.contexts=new Map}createController(e=this.layoutService,t){const n={idPrefix:"quickInput_",container:e.activeContainer,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:o=>this.setContextKey(o),linkOpenerDelegate:o=>{this.instantiationService.invokeFunction(s=>{s.get(al).open(o,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),createList:(o,s,a,l,c)=>this.instantiationService.createInstance(VV,o,s,a,l,c),styles:this.computeStyles(),hoverDelegate:this._register(this.instantiationService.createInstance(qV))},r=this._register(new h3({...n,...t},this.themeService,this.layoutService));return r.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop),this._register(e.onDidLayoutActiveContainer(o=>{Pt(e.activeContainer)===Pt(r.container)&&r.layout(o,e.activeContainerOffset.quickPickTop)})),this._register(e.onDidChangeActiveContainer(()=>{r.isVisible()||r.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop)})),this._register(r.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(r.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),r}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new st(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),!(t&&t.get())&&(this.resetContextKeys(),t==null||t.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t={},n=Cn.None){return this.controller.pick(e,t,n)}createQuickPick(){return this.controller.createQuickPick()}createInputBox(){return this.controller.createInputBox()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:ht(rre),quickInputForeground:ht(Q7e),quickInputTitleBackground:ht(J7e),widgetBorder:ht(Qme),widgetShadow:ht(Yg)},inputBox:FP,toggle:OP,countBadge:K_e,button:Rqe,progressBar:Mqe,keybindingLabel:Nqe,list:RS({listBackground:rre,listFocusBackground:$0,listFocusForeground:W0,listInactiveFocusForeground:W0,listInactiveSelectionIconForeground:sy,listInactiveFocusBackground:$0,listFocusOutline:zi,listInactiveFocusOutline:zi}),pickerGroup:{pickerGroupBorder:ht(eWe),pickerGroupForeground:ht(nve)}}}};YV=TYe([Kx(0,Ot),Kx(1,Vt),Kx(2,To),Kx(3,pC),Kx(4,gn)],YV);var E0e=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},k0=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let ZV=class extends YV{constructor(e,t,n,r,o,s){super(t,n,r,new nV(e.getContainerDomNode(),o),s),this.host=void 0;const a=Kw.get(e);if(a){const l=a.widget;this.host={_serviceBrand:void 0,get mainContainer(){return l.getDomNode()},getContainer(){return l.getDomNode()},get containers(){return[l.getDomNode()]},get activeContainer(){return l.getDomNode()},get mainContainerDimension(){return e.getLayoutInfo()},get activeContainerDimension(){return e.getLayoutInfo()},get onDidLayoutMainContainer(){return e.onDidLayoutChange},get onDidLayoutActiveContainer(){return e.onDidLayoutChange},get onDidLayoutContainer(){return Je.map(e.onDidLayoutChange,c=>({container:l.getDomNode(),dimension:c}))},get onDidChangeActiveContainer(){return Je.None},get onDidAddContainer(){return Je.None},get whenActiveContainerStylesLoaded(){return Promise.resolve()},get mainContainerOffset(){return{top:0,quickPickTop:0}},get activeContainerOffset(){return{top:0,quickPickTop:0}},focus:()=>e.focus()}}else this.host=void 0}createController(){return super.createController(this.host)}};ZV=E0e([k0(1,Ot),k0(2,Vt),k0(3,To),k0(4,Un),k0(5,gn)],ZV);let QV=class{get activeService(){const e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw new Error("Quick input service needs a focused editor to work.");let t=this.mapEditorToService.get(e);if(!t){const n=t=this.instantiationService.createInstance(ZV,e);this.mapEditorToService.set(e,t),Hv(e.onDidDispose)(()=>{n.dispose(),this.mapEditorToService.delete(e)})}return t}get quickAccess(){return this.activeService.quickAccess}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t={},n=Cn.None){return this.activeService.pick(e,t,n)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}};QV=E0e([k0(0,Ot),k0(1,Un)],QV);class Kw{static get(e){return e.getContribution(Kw.ID)}constructor(e){this.editor=e,this.widget=new f3(this.editor)}dispose(){this.widget.dispose()}}Kw.ID="editor.controller.quickInput";class f3{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return f3.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}f3.ID="editor.contrib.quickInputWidget";jn(Kw.ID,Kw,4);class NYe{constructor(e,t,n,r,o){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=n,this.foreground=r,this.background=o}}function RYe(i){if(!i||!Array.isArray(i))return[];const e=[];let t=0;for(let n=0,r=i.length;n{const h=BYe(u.token,d.token);return h!==0?h:u.index-d.index});let t=0,n="000000",r="ffffff";for(;i.length>=1&&i[0].token==="";){const u=i.shift();u.fontStyle!==-1&&(t=u.fontStyle),u.foreground!==null&&(n=u.foreground),u.background!==null&&(r=u.background)}const o=new PYe;for(const u of e)o.getId(u);const s=o.getId(n),a=o.getId(r),l=new hY(t,s,a),c=new fY(l);for(let u=0,d=i.length;u"u"){const r=this._match(t),o=FYe(t);n=(r.metadata|o<<8)>>>0,this._cache.set(t,n)}return(n|e<<0)>>>0}}const OYe=/\b(comment|string|regex|regexp)\b/;function FYe(i){const e=i.match(OYe);if(!e)return 0;switch(e[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"regexp":return 3}throw new Error("Unexpected match for standard token type!")}function BYe(i,e){return ie?1:0}class hY{constructor(e,t,n){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=n,this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}clone(){return new hY(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,n){e!==-1&&(this._fontStyle=e),t!==0&&(this._foreground=t),n!==0&&(this._background=n),this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}}class fY{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 n,r;t===-1?(n=e,r=""):(n=e.substring(0,t),r=e.substring(t+1));const o=this._children.get(n);return typeof o<"u"?o.match(r):this._mainRule}insert(e,t,n,r){if(e===""){this._mainRule.acceptOverwrite(t,n,r);return}const o=e.indexOf(".");let s,a;o===-1?(s=e,a=""):(s=e.substring(0,o),a=e.substring(o+1));let l=this._children.get(s);typeof l>"u"&&(l=new fY(this._mainRule.clone()),this._children.set(s,l)),l.insert(a,t,n,r)}}function WYe(i){const e=[];for(let t=1,n=i.length;t({format:r.format,location:r.location.toString()}))}}i.toJSONObject=e;function t(n){const r=o=>Sa(o)?o:void 0;if(n&&Array.isArray(n.src)&&n.src.every(o=>Sa(o.format)&&Sa(o.location)))return{weight:r(n.weight),style:r(n.style),src:n.src.map(o=>({format:o.format,location:At.parse(o.location)}))}}i.fromJSONObject=t})(Sse||(Sse={}));class jYe{constructor(){this._onDidChange=new se,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:w("iconDefinition.fontId","The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:w("iconDefinition.fontCharacter","The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${Wt.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,n,r){const o=this.iconsById[e];if(o){if(n&&!o.description){o.description=n,this.iconSchema.properties[e].markdownDescription=`${n} $(${e})`;const l=this.iconReferenceSchema.enum.indexOf(e);l!==-1&&(this.iconReferenceSchema.enumDescriptions[l]=n),this._onDidChange.fire()}return o}const s={id:e,description:n,defaults:t,deprecationMessage:r};this.iconsById[e]=s;const a={$ref:"#/definitions/icons"};return r&&(a.deprecationMessage=r),n&&(a.markdownDescription=`${n}: $(${e})`),this.iconSchema.properties[e]=a,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(n||""),this._onDidChange.fire(),{id:e}}getIcons(){return Object.keys(this.iconsById).map(e=>this.iconsById[e])}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}toString(){const e=(o,s)=>o.id.localeCompare(s.id),t=o=>{for(;Wt.isThemeIcon(o.defaults);)o=this.iconsById[o.defaults.id];return`codicon codicon-${o?o.id:""}`},n=[];n.push("| preview | identifier | default codicon ID | description"),n.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const r=Object.keys(this.iconsById).map(o=>this.iconsById[o]);for(const o of r.filter(s=>!!s.description).sort(e))n.push(`||${o.id}|${Wt.isThemeIcon(o.defaults)?o.defaults.id:o.id}|${o.description||""}|`);n.push("| preview | identifier "),n.push("| ----------- | --------------------------------- |");for(const o of r.filter(s=>!Wt.isThemeIcon(s.defaults)).sort(e))n.push(`||${o.id}|`);return n.join(` -`)}}const bC=new jYe;ar.add(UYe.IconContribution,bC);function Mr(i,e,t,n){return bC.registerIcon(i,e,t,n)}function I0e(){return bC}function KYe(){const i=kpe();for(const e in i){const t="\\"+i[e].toString(16);bC.registerIcon(e,{fontCharacter:t})}}KYe();const k0e="vscode://schemas/icons",T0e=ar.as(k4.JSONContribution);T0e.registerSchema(k0e,bC.getIconSchema());const xse=new pi(()=>T0e.notifySchemaChanged(k0e),200);bC.onDidChange(()=>{xse.isScheduled()||xse.schedule()});const N0e=Mr("widget-close",Xe.close,w("widgetClose","Icon for the close action in widgets."));Mr("goto-previous-location",Xe.arrowUp,w("previousChangeIcon","Icon for goto previous editor location."));Mr("goto-next-location",Xe.arrowDown,w("nextChangeIcon","Icon for goto next editor location."));Wt.modify(Xe.sync,"spin");Wt.modify(Xe.loading,"spin");function GYe(i){const e=new Te,t=e.add(new se),n=I0e();return e.add(n.onDidChange(()=>t.fire())),i&&e.add(i.onDidProductIconThemeChange(()=>t.fire())),{dispose:()=>e.dispose(),onDidChange:t.event,getCSS(){const r=i?i.getProductIconTheme():new R0e,o={},s=l=>{const c=r.getIcon(l);if(!c)return;const u=c.font;return u?(o[u.id]=u.definition,`.codicon-${l.id}:before { content: '${c.fontCharacter}'; font-family: ${oie(u.id)}; }`):`.codicon-${l.id}:before { content: '${c.fontCharacter}'; }`},a=[];for(const l of n.getIcons()){const c=s(l);c&&a.push(c)}for(const l in o){const c=o[l],u=c.weight?`font-weight: ${c.weight};`:"",d=c.style?`font-style: ${c.style};`:"",h=c.src.map(f=>`${Gv(f.location)} format('${f.format}')`).join(", ");a.push(`@font-face { src: ${h}; font-family: ${oie(l)};${u}${d} font-display: block; }`)}return a.join(` -`)}}}class R0e{getIcon(e){const t=I0e();let n=e.defaults;for(;Wt.isThemeIcon(n);){const r=t.getIcon(n.id);if(!r)return;n=r.defaults}return n}}const zg="vs",Zy="vs-dark",lb="hc-black",cb="hc-light",M0e=ar.as(Zme.ColorContribution),qYe=ar.as(mve.ThemingContribution);class A0e{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const n=t.base;e.length>0?(MM(e)?this.id=e:this.id=n+" "+e,this.themeName=e):(this.id=n,this.themeName=n),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get base(){return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){const e=new Map;for(const t in this.themeData.colors)e.set(t,me.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=JV(this.themeData.base);for(const n in t.colors)e.has(n)||e.set(n,me.fromHex(t.colors[n]))}this.colors=e}return this.colors}getColor(e,t){const n=this.getColors().get(e);if(n)return n;if(t!==!1)return this.getDefault(e)}getDefault(e){let t=this.defaultColors[e];return t||(t=M0e.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case zg:return Xc.LIGHT;case lb:return Xc.HIGH_CONTRAST_DARK;case cb:return Xc.HIGH_CONTRAST_LIGHT;default:return Xc.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const o=JV(this.themeData.base);e=o.rules,o.encodedTokensColors&&(t=o.encodedTokensColors)}const n=this.themeData.colors["editor.foreground"],r=this.themeData.colors["editor.background"];if(n||r){const o={token:""};n&&(o.foreground=n),r&&(o.background=r),e.push(o)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=D0e.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,n){const o=this.tokenTheme._match([e].concat(t).join(".")).metadata,s=us.getForeground(o),a=us.getFontStyle(o);return{foreground:s,italic:!!(a&1),bold:!!(a&2),underline:!!(a&4),strikethrough:!!(a&8)}}}function MM(i){return i===zg||i===Zy||i===lb||i===cb}function JV(i){switch(i){case zg:return $Ye;case Zy:return HYe;case lb:return VYe;case cb:return zYe}}function $R(i){const e=JV(i);return new A0e(i,e)}class XYe extends fe{constructor(){super(),this._onColorThemeChange=this._register(new se),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new se),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new R0e,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(zg,$R(zg)),this._knownThemes.set(Zy,$R(Zy)),this._knownThemes.set(lb,$R(lb)),this._knownThemes.set(cb,$R(cb));const e=this._register(GYe(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS} -${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(zg),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),$pe(hi,"(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return GA(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=gc(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),fe.None}_registerShadowDomContainer(e){const t=gc(e,n=>{n.className="monaco-colors",n.textContent=this._allCSS});return this._styleElements.push(t),{dispose:()=>{for(let n=0;n{n.base===e&&n.notifyBaseUpdated()}),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;this._knownThemes.has(e)?t=this._knownThemes.get(e):t=this._knownThemes.get(zg),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=hi.matchMedia("(forced-colors: active)").matches;if(e!==ih(this._theme.type)){let t;Pw(this._theme.type)?t=e?lb:Zy:t=e?cb:zg,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},n={addRule:s=>{t[s]||(e.push(s),t[s]=!0)}};qYe.getThemingParticipants().forEach(s=>s(this._theme,n,this._environment));const r=[];for(const s of M0e.getColors()){const a=this._theme.getColor(s.id,!0);a&&r.push(`${qq(s.id)}: ${a.toString()};`)}n.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${r.join(` +`)}}const bC=new jYe;ar.add(UYe.IconContribution,bC);function Mr(i,e,t,n){return bC.registerIcon(i,e,t,n)}function I0e(){return bC}function KYe(){const i=kpe();for(const e in i){const t="\\"+i[e].toString(16);bC.registerIcon(e,{fontCharacter:t})}}KYe();const k0e="vscode://schemas/icons",T0e=ar.as(k4.JSONContribution);T0e.registerSchema(k0e,bC.getIconSchema());const xse=new pi(()=>T0e.notifySchemaChanged(k0e),200);bC.onDidChange(()=>{xse.isScheduled()||xse.schedule()});const N0e=Mr("widget-close",Xe.close,w("widgetClose","Icon for the close action in widgets."));Mr("goto-previous-location",Xe.arrowUp,w("previousChangeIcon","Icon for goto previous editor location."));Mr("goto-next-location",Xe.arrowDown,w("nextChangeIcon","Icon for goto next editor location."));Wt.modify(Xe.sync,"spin");Wt.modify(Xe.loading,"spin");function GYe(i){const e=new Te,t=e.add(new se),n=I0e();return e.add(n.onDidChange(()=>t.fire())),i&&e.add(i.onDidProductIconThemeChange(()=>t.fire())),{dispose:()=>e.dispose(),onDidChange:t.event,getCSS(){const r=i?i.getProductIconTheme():new R0e,o={},s=l=>{const c=r.getIcon(l);if(!c)return;const u=c.font;return u?(o[u.id]=u.definition,`.codicon-${l.id}:before { content: '${c.fontCharacter}'; font-family: ${oie(u.id)}; }`):`.codicon-${l.id}:before { content: '${c.fontCharacter}'; }`},a=[];for(const l of n.getIcons()){const c=s(l);c&&a.push(c)}for(const l in o){const c=o[l],u=c.weight?`font-weight: ${c.weight};`:"",d=c.style?`font-style: ${c.style};`:"",h=c.src.map(f=>`${Kv(f.location)} format('${f.format}')`).join(", ");a.push(`@font-face { src: ${h}; font-family: ${oie(l)};${u}${d} font-display: block; }`)}return a.join(` +`)}}}class R0e{getIcon(e){const t=I0e();let n=e.defaults;for(;Wt.isThemeIcon(n);){const r=t.getIcon(n.id);if(!r)return;n=r.defaults}return n}}const zg="vs",Zy="vs-dark",ab="hc-black",lb="hc-light",M0e=ar.as(Zme.ColorContribution),qYe=ar.as(mve.ThemingContribution);class A0e{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const n=t.base;e.length>0?(MM(e)?this.id=e:this.id=n+" "+e,this.themeName=e):(this.id=n,this.themeName=n),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get base(){return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){const e=new Map;for(const t in this.themeData.colors)e.set(t,me.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=JV(this.themeData.base);for(const n in t.colors)e.has(n)||e.set(n,me.fromHex(t.colors[n]))}this.colors=e}return this.colors}getColor(e,t){const n=this.getColors().get(e);if(n)return n;if(t!==!1)return this.getDefault(e)}getDefault(e){let t=this.defaultColors[e];return t||(t=M0e.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case zg:return Xc.LIGHT;case ab:return Xc.HIGH_CONTRAST_DARK;case lb:return Xc.HIGH_CONTRAST_LIGHT;default:return Xc.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const o=JV(this.themeData.base);e=o.rules,o.encodedTokensColors&&(t=o.encodedTokensColors)}const n=this.themeData.colors["editor.foreground"],r=this.themeData.colors["editor.background"];if(n||r){const o={token:""};n&&(o.foreground=n),r&&(o.background=r),e.push(o)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=D0e.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,n){const o=this.tokenTheme._match([e].concat(t).join(".")).metadata,s=us.getForeground(o),a=us.getFontStyle(o);return{foreground:s,italic:!!(a&1),bold:!!(a&2),underline:!!(a&4),strikethrough:!!(a&8)}}}function MM(i){return i===zg||i===Zy||i===ab||i===lb}function JV(i){switch(i){case zg:return $Ye;case Zy:return HYe;case ab:return VYe;case lb:return zYe}}function $R(i){const e=JV(i);return new A0e(i,e)}class XYe extends fe{constructor(){super(),this._onColorThemeChange=this._register(new se),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new se),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new R0e,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(zg,$R(zg)),this._knownThemes.set(Zy,$R(Zy)),this._knownThemes.set(ab,$R(ab)),this._knownThemes.set(lb,$R(lb));const e=this._register(GYe(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS} +${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(zg),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),$pe(hi,"(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return GA(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=gc(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),fe.None}_registerShadowDomContainer(e){const t=gc(e,n=>{n.className="monaco-colors",n.textContent=this._allCSS});return this._styleElements.push(t),{dispose:()=>{for(let n=0;n{n.base===e&&n.notifyBaseUpdated()}),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;this._knownThemes.has(e)?t=this._knownThemes.get(e):t=this._knownThemes.get(zg),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=hi.matchMedia("(forced-colors: active)").matches;if(e!==ih(this._theme.type)){let t;Pw(this._theme.type)?t=e?ab:Zy:t=e?lb:zg,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},n={addRule:s=>{t[s]||(e.push(s),t[s]=!0)}};qYe.getThemingParticipants().forEach(s=>s(this._theme,n,this._environment));const r=[];for(const s of M0e.getColors()){const a=this._theme.getColor(s.id,!0);a&&r.push(`${qq(s.id)}: ${a.toString()};`)}n.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${r.join(` `)} }`);const o=this._colorMapOverride||this._theme.tokenTheme.getColorMap();n.addRule(WYe(o)),this._themeCSS=e.join(` `),this._updateCSS(),hr.setColorMap(o),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS} -${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}const Sc=yn("themeService");var YYe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},_9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let ez=class extends fe{constructor(e,t,n){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=n,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new se,this._onDidChangeReducedMotion=new se,this._accessibilityModeEnabledContext=Bk.bindTo(this._contextKeyService);const r=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(s=>{s.affectsConfiguration("editor.accessibilitySupport")&&(r(),this._onDidChangeScreenReaderOptimized.fire()),s.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),r(),this._register(this.onDidChangeScreenReaderOptimized(()=>r()));const o=hi.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=o.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this.initReducedMotionListeners(o)}initReducedMotionListeners(e){this._register(ye(e,"change",()=>{this._systemMotionReduced=e.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));const t=()=>{const n=this.isMotionReduced();this._layoutService.mainContainer.classList.toggle("reduce-motion",n),this._layoutService.mainContainer.classList.toggle("enable-motion",!n)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return e==="on"||e==="auto"&&this._accessibilitySupport===2}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return e==="on"||e==="auto"&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}};ez=YYe([_9(0,Vt),_9(1,pC),_9(2,gn)],ez);var g3=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Bb=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},k1,Cm;let tz=class{constructor(e,t){this._commandService=e,this._hiddenStates=new JP(t)}createMenu(e,t,n){return new iz(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...n},this._commandService,t)}resetHiddenStates(e){this._hiddenStates.reset(e)}};tz=g3([Bb(0,sr),Bb(1,dd)],tz);let JP=k1=class{constructor(e){this._storageService=e,this._disposables=new Te,this._onDidChange=new se,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(k1._key,0,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,k1._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get(k1._key,0,"{}");this._data=JSON.parse(t)}catch(t){console.log("FAILED to read storage after UPDATE",t)}this._onDidChange.fire()}))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,t){var n;return(n=this._hiddenByDefaultCache.get(`${e.id}/${t}`))!==null&&n!==void 0?n:!1}setDefaultState(e,t,n){this._hiddenByDefaultCache.set(`${e.id}/${t}`,n)}isHidden(e,t){var n,r;const o=this._isHiddenByDefault(e,t),s=(r=(n=this._data[e.id])===null||n===void 0?void 0:n.includes(t))!==null&&r!==void 0?r:!1;return o?!s:s}updateHidden(e,t,n){this._isHiddenByDefault(e,t)&&(n=!n);const o=this._data[e.id];if(n)o?o.indexOf(t)<0&&o.push(t):this._data[e.id]=[t];else if(o){const s=o.indexOf(t);s>=0&&R4e(o,s),o.length===0&&delete this._data[e.id]}this._persist()}reset(e){if(e===void 0)this._data=Object.create(null),this._persist();else{for(const{id:t}of e)this._data[t]&&delete this._data[t];this._persist()}}_persist(){try{this._ignoreChangeEvent=!0;const e=JSON.stringify(this._data);this._storageService.store(k1._key,e,0,0)}finally{this._ignoreChangeEvent=!1}}};JP._key="menu.hiddenCommands";JP=k1=g3([Bb(0,dd)],JP);let nz=Cm=class{constructor(e,t,n,r,o){this._id=e,this._hiddenStates=t,this._collectContextKeysForSubmenus=n,this._commandService=r,this._contextKeyService=o,this._menuGroups=[],this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();const e=ts.getMenuItems(this._id);let t;e.sort(Cm._compareMenuItems);for(const n of e){const r=n.group||"";(!t||t[0]!==r)&&(t=[r,[]],this._menuGroups.push(t)),t[1].push(n),this._collectContextKeys(n)}}_collectContextKeys(e){if(Cm._fillInKbExprKeys(e.when,this._structureContextKeys),ty(e)){if(e.command.precondition&&Cm._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;Cm._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&ts.getMenuItems(e.submenu).forEach(this._collectContextKeys,this)}createActionGroups(e){const t=[];for(const n of this._menuGroups){const[r,o]=n,s=[];for(const a of o)if(this._contextKeyService.contextMatchesRules(a.when)){const l=ty(a);l&&this._hiddenStates.setDefaultState(this._id,a.command.id,!!a.isHiddenByDefault);const c=ZYe(this._id,l?a.command:a,this._hiddenStates);if(l)s.push(new pc(a.command,a.alt,e,c,this._contextKeyService,this._commandService));else{const u=new Cm(a.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._contextKeyService).createActionGroups(e),d=lo.join(...u.map(h=>h[1]));d.length>0&&s.push(new TD(a,c,d))}}s.length>0&&t.push([r,s])}return t}static _fillInKbExprKeys(e,t){if(e)for(const n of e.keys())t.add(n)}static _compareMenuItems(e,t){const n=e.group,r=t.group;if(n!==r){if(n){if(!r)return-1}else return 1;if(n==="navigation")return-1;if(r==="navigation")return 1;const a=n.localeCompare(r);if(a!==0)return a}const o=e.order||0,s=t.order||0;return os?1:Cm._compareTitles(ty(e)?e.command.title:e.title,ty(t)?t.command.title:t.title)}static _compareTitles(e,t){const n=typeof e=="string"?e:e.original,r=typeof t=="string"?t:t.original;return n.localeCompare(r)}};nz=Cm=g3([Bb(3,sr),Bb(4,Vt)],nz);let iz=class{constructor(e,t,n,r,o){this._disposables=new Te,this._menuInfo=new nz(e,t,n.emitEventsForSubmenuChanges,r,o);const s=new pi(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},n.eventDebounceDelay);this._disposables.add(s),this._disposables.add(ts.onDidChangeMenu(u=>{u.has(e)&&s.schedule()}));const a=this._disposables.add(new Te),l=u=>{let d=!1,h=!1,f=!1;for(const g of u)if(d=d||g.isStructuralChange,h=h||g.isEnablementChange,f=f||g.isToggleChange,d&&h&&f)break;return{menu:this,isStructuralChange:d,isEnablementChange:h,isToggleChange:f}},c=()=>{a.add(o.onDidChangeContext(u=>{const d=u.affectsSome(this._menuInfo.structureContextKeys),h=u.affectsSome(this._menuInfo.preconditionContextKeys),f=u.affectsSome(this._menuInfo.toggledContextKeys);(d||h||f)&&this._onDidChange.fire({menu:this,isStructuralChange:d,isEnablementChange:h,isToggleChange:f})})),a.add(t.onDidChange(u=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})}))};this._onDidChange=new bpe({onWillAddFirstListener:c,onDidRemoveLastListener:a.clear.bind(a),delay:n.eventDebounceDelay,merge:l}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};iz=g3([Bb(3,sr),Bb(4,Vt)],iz);function ZYe(i,e,t){const n=$8e(e)?e.submenu.id:e.id,r=typeof e.title=="string"?e.title:e.title.value,o=My({id:`hide/${i.id}/${n}`,label:w("hide.label","Hide '{0}'",r),run(){t.updateHidden(i,n,!0)}}),s=My({id:`toggle/${i.id}/${n}`,label:r,get checked(){return!t.isHidden(i,n)},run(){t.updateHidden(i,n,!!this.checked)}});return{hide:o,toggle:s,get isHidden(){return!s.checked}}}var QYe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Lse=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},rz;let eO=rz=class extends fe{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],this.resourcesStateHash=void 0,(Dp||Hpe)&&this.installWebKitWriteTextWorkaround(),this._register(Je.runAndSubscribe(d4,({window:n,disposables:r})=>{r.add(ye(n.document,"copy",()=>this.clearResources()))},{window:hi,disposables:this._store}))}installWebKitWriteTextWorkaround(){const e=()=>{const t=new a4;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=t,navigator.clipboard.write([new ClipboardItem({"text/plain":t.p})]).catch(async n=>{(!(n instanceof Error)||n.name!=="NotAllowedError"||!t.isRejected)&&this.logService.error(n)})};this._register(Je.runAndSubscribe(this.layoutService.onDidAddContainer,({container:t,disposables:n})=>{n.add(ye(t,"click",e)),n.add(ye(t,"keydown",e))},{container:this.layoutService.mainContainer,disposables:this._store}))}async writeText(e,t){if(this.writeResources([]),t){this.mapTextToType.set(t,e);return}if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return await navigator.clipboard.writeText(e)}catch(n){console.error(n)}this.fallbackWriteText(e)}fallbackWriteText(e){const t=xS(),n=t.activeElement,r=t.body.appendChild(He("textarea",{"aria-hidden":!0}));r.style.height="1px",r.style.width="1px",r.style.position="absolute",r.value=e,r.focus(),r.select(),t.execCommand("copy"),n instanceof HTMLElement&&n.focus(),t.body.removeChild(r)}async readText(e){if(e)return this.mapTextToType.get(e)||"";try{return await navigator.clipboard.readText()}catch(t){console.error(t)}return""}async readFindText(){return this.findText}async writeFindText(e){this.findText=e}async writeResources(e){e.length===0?this.clearResources():(this.resources=e,this.resourcesStateHash=await this.computeResourcesStateHash())}async readResources(){const e=await this.computeResourcesStateHash();return this.resourcesStateHash!==e&&this.clearResources(),this.resources}async computeResourcesStateHash(){if(this.resources.length===0)return;const e=await this.readText();return l4(e.substring(0,rz.MAX_RESOURCE_STATE_SOURCE_LENGTH))}clearResources(){this.resources=[],this.resourcesStateHash=void 0}};eO.MAX_RESOURCE_STATE_SOURCE_LENGTH=1e3;eO=rz=QYe([Lse(0,pC),Lse(1,Ta)],eO);const jp=yn("clipboardService");var JYe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},eZe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const kE="data-keybinding-context";let gY=class{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}get value(){return{...this._value}}setValue(e,t){return this._value[e]!==t?(this._value[e]=t,!0):!1}removeValue(e){return e in this._value?(delete this._value[e],!0):!1}getValue(e){const t=this._value[e];return typeof t>"u"&&this._parent?this._parent.getValue(e):t}};class Gw extends gY{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}Gw.INSTANCE=new Gw;class vI extends gY{constructor(e,t,n){super(e,null),this._configurationService=t,this._values=qy.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(r=>{if(r.source===7){const o=Array.from(this._values,([s])=>s);this._values.clear(),n.fire(new Dse(o))}else{const o=[];for(const s of r.affectedKeys){const a=`config.${s}`,l=this._values.findSuperstr(a);l!==void 0&&(o.push(...En.map(l,([c])=>c)),this._values.deleteSuperstr(a)),this._values.has(a)&&(o.push(a),this._values.delete(a))}n.fire(new Dse(o))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(vI._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(vI._keyPrefix.length),n=this._configurationService.getValue(t);let r;switch(typeof n){case"number":case"boolean":case"string":r=n;break;default:Array.isArray(n)?r=JSON.stringify(n):r=n}return this._values.set(e,r),r}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}}vI._keyPrefix="config.";class tZe{constructor(e,t,n){this._service=e,this._key=t,this._defaultValue=n,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){typeof this._defaultValue>"u"?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class Ese{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class Dse{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}allKeysContainedIn(e){return this.keys.every(t=>e.has(t))}}class nZe{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}allKeysContainedIn(e){return this.events.every(t=>t.allKeysContainedIn(e))}}function iZe(i,e){return i.allKeysContainedIn(new Set(Object.keys(e)))}class P0e extends fe{constructor(e){super(),this._onDidChangeContext=this._register(new Lb({merge:t=>new nZe(t)})),this.onDidChangeContext=this._onDidChangeContext.event,this._isDisposed=!1,this._myContextId=e}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new tZe(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 rZe(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId);return e?e.evaluate(t):!0}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;const n=this.getContextValuesContainer(this._myContextId);n&&n.setValue(e,t)&&this._onDidChangeContext.fire(new Ese(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new Ese(e))}getContext(e){return this._isDisposed?Gw.INSTANCE:this.getContextValuesContainer(oZe(e))}dispose(){super.dispose(),this._isDisposed=!0}}let oz=class extends P0e{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0;const t=this._register(new vI(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t)}getContextValuesContainer(e){return this._isDisposed?Gw.INSTANCE:this._contexts.get(e)||Gw.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");const t=++this._lastContextId;return this._contexts.set(t,new gY(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};oz=JYe([eZe(0,gn)],oz);class rZe extends P0e{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new Ho),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(kE)){let n="";this._domNode.classList&&(n=Array.from(this._domNode.classList.values()).join(", ")),console.error(`Element already has context attribute${n?": "+n:""}`)}this._domNode.setAttribute(kE,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const n=this._parent.getContextValuesContainer(this._myContextId).value;iZe(e,n)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(kE),super.dispose())}getContextValuesContainer(e){return this._isDisposed?Gw.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}}function oZe(i){for(;i;){if(i.hasAttribute(kE)){const e=i.getAttribute(kE);return e?parseInt(e,10):NaN}i=i.parentElement}return 0}function sZe(i,e,t){i.get(Vt).createKey(String(e),aZe(t))}function aZe(i){return ope(i,e=>{if(typeof e=="object"&&e.$mid===1)return At.revive(e).toString();if(e instanceof At)return e.toString()})}Dn.registerCommand("_setContext",sZe);Dn.registerCommand({id:"getContextKeyInfo",handler(){return[...st.all()].sort((i,e)=>i.key.localeCompare(e.key))},metadata:{description:w("getContextKeyInfo","A command that returns information about context keys"),args:[]}});Dn.registerCommand("_generateContextKeyInfo",function(){const i=[],e=new Set;for(const t of st.all())e.has(t.key)||(e.add(t.key),i.push(t));i.sort((t,n)=>t.key.localeCompare(n.key)),console.log(JSON.stringify(i,void 0,2))});let lZe=class{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}};class Ise{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(const t of this._nodes.values())t.outgoing.size===0&&e.push(t);return e}insertEdge(e,t){const n=this.lookupOrInsertNode(e),r=this.lookupOrInsertNode(t);n.outgoing.set(r.key,r),r.incoming.set(n.key,n)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(const n of this._nodes.values())n.outgoing.delete(t),n.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let n=this._nodes.get(t);return n||(n=new lZe(t,e),this._nodes.set(t,n)),n}isEmpty(){return this._nodes.size===0}toString(){const e=[];for(const[t,n]of this._nodes)e.push(`${t} +${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}const Sc=yn("themeService");var YYe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},_9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let ez=class extends fe{constructor(e,t,n){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=n,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new se,this._onDidChangeReducedMotion=new se,this._accessibilityModeEnabledContext=Bk.bindTo(this._contextKeyService);const r=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(s=>{s.affectsConfiguration("editor.accessibilitySupport")&&(r(),this._onDidChangeScreenReaderOptimized.fire()),s.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),r(),this._register(this.onDidChangeScreenReaderOptimized(()=>r()));const o=hi.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=o.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this.initReducedMotionListeners(o)}initReducedMotionListeners(e){this._register(ye(e,"change",()=>{this._systemMotionReduced=e.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));const t=()=>{const n=this.isMotionReduced();this._layoutService.mainContainer.classList.toggle("reduce-motion",n),this._layoutService.mainContainer.classList.toggle("enable-motion",!n)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return e==="on"||e==="auto"&&this._accessibilitySupport===2}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return e==="on"||e==="auto"&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}};ez=YYe([_9(0,Vt),_9(1,pC),_9(2,gn)],ez);var g3=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Bb=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},k1,ym;let tz=class{constructor(e,t){this._commandService=e,this._hiddenStates=new JP(t)}createMenu(e,t,n){return new iz(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...n},this._commandService,t)}resetHiddenStates(e){this._hiddenStates.reset(e)}};tz=g3([Bb(0,sr),Bb(1,dd)],tz);let JP=k1=class{constructor(e){this._storageService=e,this._disposables=new Te,this._onDidChange=new se,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(k1._key,0,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,k1._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get(k1._key,0,"{}");this._data=JSON.parse(t)}catch(t){console.log("FAILED to read storage after UPDATE",t)}this._onDidChange.fire()}))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,t){var n;return(n=this._hiddenByDefaultCache.get(`${e.id}/${t}`))!==null&&n!==void 0?n:!1}setDefaultState(e,t,n){this._hiddenByDefaultCache.set(`${e.id}/${t}`,n)}isHidden(e,t){var n,r;const o=this._isHiddenByDefault(e,t),s=(r=(n=this._data[e.id])===null||n===void 0?void 0:n.includes(t))!==null&&r!==void 0?r:!1;return o?!s:s}updateHidden(e,t,n){this._isHiddenByDefault(e,t)&&(n=!n);const o=this._data[e.id];if(n)o?o.indexOf(t)<0&&o.push(t):this._data[e.id]=[t];else if(o){const s=o.indexOf(t);s>=0&&R4e(o,s),o.length===0&&delete this._data[e.id]}this._persist()}reset(e){if(e===void 0)this._data=Object.create(null),this._persist();else{for(const{id:t}of e)this._data[t]&&delete this._data[t];this._persist()}}_persist(){try{this._ignoreChangeEvent=!0;const e=JSON.stringify(this._data);this._storageService.store(k1._key,e,0,0)}finally{this._ignoreChangeEvent=!1}}};JP._key="menu.hiddenCommands";JP=k1=g3([Bb(0,dd)],JP);let nz=ym=class{constructor(e,t,n,r,o){this._id=e,this._hiddenStates=t,this._collectContextKeysForSubmenus=n,this._commandService=r,this._contextKeyService=o,this._menuGroups=[],this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();const e=ts.getMenuItems(this._id);let t;e.sort(ym._compareMenuItems);for(const n of e){const r=n.group||"";(!t||t[0]!==r)&&(t=[r,[]],this._menuGroups.push(t)),t[1].push(n),this._collectContextKeys(n)}}_collectContextKeys(e){if(ym._fillInKbExprKeys(e.when,this._structureContextKeys),ty(e)){if(e.command.precondition&&ym._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;ym._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&ts.getMenuItems(e.submenu).forEach(this._collectContextKeys,this)}createActionGroups(e){const t=[];for(const n of this._menuGroups){const[r,o]=n,s=[];for(const a of o)if(this._contextKeyService.contextMatchesRules(a.when)){const l=ty(a);l&&this._hiddenStates.setDefaultState(this._id,a.command.id,!!a.isHiddenByDefault);const c=ZYe(this._id,l?a.command:a,this._hiddenStates);if(l)s.push(new pc(a.command,a.alt,e,c,this._contextKeyService,this._commandService));else{const u=new ym(a.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._contextKeyService).createActionGroups(e),d=lo.join(...u.map(h=>h[1]));d.length>0&&s.push(new TD(a,c,d))}}s.length>0&&t.push([r,s])}return t}static _fillInKbExprKeys(e,t){if(e)for(const n of e.keys())t.add(n)}static _compareMenuItems(e,t){const n=e.group,r=t.group;if(n!==r){if(n){if(!r)return-1}else return 1;if(n==="navigation")return-1;if(r==="navigation")return 1;const a=n.localeCompare(r);if(a!==0)return a}const o=e.order||0,s=t.order||0;return os?1:ym._compareTitles(ty(e)?e.command.title:e.title,ty(t)?t.command.title:t.title)}static _compareTitles(e,t){const n=typeof e=="string"?e:e.original,r=typeof t=="string"?t:t.original;return n.localeCompare(r)}};nz=ym=g3([Bb(3,sr),Bb(4,Vt)],nz);let iz=class{constructor(e,t,n,r,o){this._disposables=new Te,this._menuInfo=new nz(e,t,n.emitEventsForSubmenuChanges,r,o);const s=new pi(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},n.eventDebounceDelay);this._disposables.add(s),this._disposables.add(ts.onDidChangeMenu(u=>{u.has(e)&&s.schedule()}));const a=this._disposables.add(new Te),l=u=>{let d=!1,h=!1,f=!1;for(const g of u)if(d=d||g.isStructuralChange,h=h||g.isEnablementChange,f=f||g.isToggleChange,d&&h&&f)break;return{menu:this,isStructuralChange:d,isEnablementChange:h,isToggleChange:f}},c=()=>{a.add(o.onDidChangeContext(u=>{const d=u.affectsSome(this._menuInfo.structureContextKeys),h=u.affectsSome(this._menuInfo.preconditionContextKeys),f=u.affectsSome(this._menuInfo.toggledContextKeys);(d||h||f)&&this._onDidChange.fire({menu:this,isStructuralChange:d,isEnablementChange:h,isToggleChange:f})})),a.add(t.onDidChange(u=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})}))};this._onDidChange=new bpe({onWillAddFirstListener:c,onDidRemoveLastListener:a.clear.bind(a),delay:n.eventDebounceDelay,merge:l}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};iz=g3([Bb(3,sr),Bb(4,Vt)],iz);function ZYe(i,e,t){const n=$8e(e)?e.submenu.id:e.id,r=typeof e.title=="string"?e.title:e.title.value,o=My({id:`hide/${i.id}/${n}`,label:w("hide.label","Hide '{0}'",r),run(){t.updateHidden(i,n,!0)}}),s=My({id:`toggle/${i.id}/${n}`,label:r,get checked(){return!t.isHidden(i,n)},run(){t.updateHidden(i,n,!!this.checked)}});return{hide:o,toggle:s,get isHidden(){return!s.checked}}}var QYe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Lse=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},rz;let eO=rz=class extends fe{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],this.resourcesStateHash=void 0,(Ip||Hpe)&&this.installWebKitWriteTextWorkaround(),this._register(Je.runAndSubscribe(d4,({window:n,disposables:r})=>{r.add(ye(n.document,"copy",()=>this.clearResources()))},{window:hi,disposables:this._store}))}installWebKitWriteTextWorkaround(){const e=()=>{const t=new a4;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=t,navigator.clipboard.write([new ClipboardItem({"text/plain":t.p})]).catch(async n=>{(!(n instanceof Error)||n.name!=="NotAllowedError"||!t.isRejected)&&this.logService.error(n)})};this._register(Je.runAndSubscribe(this.layoutService.onDidAddContainer,({container:t,disposables:n})=>{n.add(ye(t,"click",e)),n.add(ye(t,"keydown",e))},{container:this.layoutService.mainContainer,disposables:this._store}))}async writeText(e,t){if(this.writeResources([]),t){this.mapTextToType.set(t,e);return}if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return await navigator.clipboard.writeText(e)}catch(n){console.error(n)}this.fallbackWriteText(e)}fallbackWriteText(e){const t=xS(),n=t.activeElement,r=t.body.appendChild(He("textarea",{"aria-hidden":!0}));r.style.height="1px",r.style.width="1px",r.style.position="absolute",r.value=e,r.focus(),r.select(),t.execCommand("copy"),n instanceof HTMLElement&&n.focus(),t.body.removeChild(r)}async readText(e){if(e)return this.mapTextToType.get(e)||"";try{return await navigator.clipboard.readText()}catch(t){console.error(t)}return""}async readFindText(){return this.findText}async writeFindText(e){this.findText=e}async writeResources(e){e.length===0?this.clearResources():(this.resources=e,this.resourcesStateHash=await this.computeResourcesStateHash())}async readResources(){const e=await this.computeResourcesStateHash();return this.resourcesStateHash!==e&&this.clearResources(),this.resources}async computeResourcesStateHash(){if(this.resources.length===0)return;const e=await this.readText();return l4(e.substring(0,rz.MAX_RESOURCE_STATE_SOURCE_LENGTH))}clearResources(){this.resources=[],this.resourcesStateHash=void 0}};eO.MAX_RESOURCE_STATE_SOURCE_LENGTH=1e3;eO=rz=QYe([Lse(0,pC),Lse(1,Ta)],eO);const Kp=yn("clipboardService");var JYe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},eZe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const kE="data-keybinding-context";let gY=class{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}get value(){return{...this._value}}setValue(e,t){return this._value[e]!==t?(this._value[e]=t,!0):!1}removeValue(e){return e in this._value?(delete this._value[e],!0):!1}getValue(e){const t=this._value[e];return typeof t>"u"&&this._parent?this._parent.getValue(e):t}};class Gw extends gY{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}Gw.INSTANCE=new Gw;class vI extends gY{constructor(e,t,n){super(e,null),this._configurationService=t,this._values=qy.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(r=>{if(r.source===7){const o=Array.from(this._values,([s])=>s);this._values.clear(),n.fire(new Dse(o))}else{const o=[];for(const s of r.affectedKeys){const a=`config.${s}`,l=this._values.findSuperstr(a);l!==void 0&&(o.push(...En.map(l,([c])=>c)),this._values.deleteSuperstr(a)),this._values.has(a)&&(o.push(a),this._values.delete(a))}n.fire(new Dse(o))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(vI._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(vI._keyPrefix.length),n=this._configurationService.getValue(t);let r;switch(typeof n){case"number":case"boolean":case"string":r=n;break;default:Array.isArray(n)?r=JSON.stringify(n):r=n}return this._values.set(e,r),r}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}}vI._keyPrefix="config.";class tZe{constructor(e,t,n){this._service=e,this._key=t,this._defaultValue=n,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){typeof this._defaultValue>"u"?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class Ese{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class Dse{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}allKeysContainedIn(e){return this.keys.every(t=>e.has(t))}}class nZe{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}allKeysContainedIn(e){return this.events.every(t=>t.allKeysContainedIn(e))}}function iZe(i,e){return i.allKeysContainedIn(new Set(Object.keys(e)))}class P0e extends fe{constructor(e){super(),this._onDidChangeContext=this._register(new Lb({merge:t=>new nZe(t)})),this.onDidChangeContext=this._onDidChangeContext.event,this._isDisposed=!1,this._myContextId=e}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new tZe(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 rZe(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId);return e?e.evaluate(t):!0}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;const n=this.getContextValuesContainer(this._myContextId);n&&n.setValue(e,t)&&this._onDidChangeContext.fire(new Ese(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new Ese(e))}getContext(e){return this._isDisposed?Gw.INSTANCE:this.getContextValuesContainer(oZe(e))}dispose(){super.dispose(),this._isDisposed=!0}}let oz=class extends P0e{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0;const t=this._register(new vI(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t)}getContextValuesContainer(e){return this._isDisposed?Gw.INSTANCE:this._contexts.get(e)||Gw.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");const t=++this._lastContextId;return this._contexts.set(t,new gY(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};oz=JYe([eZe(0,gn)],oz);class rZe extends P0e{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new Ho),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(kE)){let n="";this._domNode.classList&&(n=Array.from(this._domNode.classList.values()).join(", ")),console.error(`Element already has context attribute${n?": "+n:""}`)}this._domNode.setAttribute(kE,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const n=this._parent.getContextValuesContainer(this._myContextId).value;iZe(e,n)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(kE),super.dispose())}getContextValuesContainer(e){return this._isDisposed?Gw.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}}function oZe(i){for(;i;){if(i.hasAttribute(kE)){const e=i.getAttribute(kE);return e?parseInt(e,10):NaN}i=i.parentElement}return 0}function sZe(i,e,t){i.get(Vt).createKey(String(e),aZe(t))}function aZe(i){return ope(i,e=>{if(typeof e=="object"&&e.$mid===1)return At.revive(e).toString();if(e instanceof At)return e.toString()})}Dn.registerCommand("_setContext",sZe);Dn.registerCommand({id:"getContextKeyInfo",handler(){return[...st.all()].sort((i,e)=>i.key.localeCompare(e.key))},metadata:{description:w("getContextKeyInfo","A command that returns information about context keys"),args:[]}});Dn.registerCommand("_generateContextKeyInfo",function(){const i=[],e=new Set;for(const t of st.all())e.has(t.key)||(e.add(t.key),i.push(t));i.sort((t,n)=>t.key.localeCompare(n.key)),console.log(JSON.stringify(i,void 0,2))});let lZe=class{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}};class Ise{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(const t of this._nodes.values())t.outgoing.size===0&&e.push(t);return e}insertEdge(e,t){const n=this.lookupOrInsertNode(e),r=this.lookupOrInsertNode(t);n.outgoing.set(r.key,r),r.incoming.set(n.key,n)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(const n of this._nodes.values())n.outgoing.delete(t),n.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let n=this._nodes.get(t);return n||(n=new lZe(t,e),this._nodes.set(t,n)),n}isEmpty(){return this._nodes.size===0}toString(){const e=[];for(const[t,n]of this._nodes)e.push(`${t} (-> incoming)[${[...n.incoming.keys()].join(", ")}] (outgoing ->)[${[...n.outgoing.keys()].join(",")}] `);return e.join(` @@ -737,41 +737,41 @@ ${e.toString()}`}}class tO{constructor(e=new Kk,t=!1,n,r=cZe){var o;this._servic `).slice(3,4).join(` `)):Ka._None}static traceCreation(e,t){return e?new Ka(1,t.name):Ka._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const n=new Ka(3,e.toString());return this._dep.push([e,t,n]),n}stop(){const e=Date.now()-this._start;Ka._totals+=e;let t=!1;function n(o,s){const a=[],l=new Array(o+1).join(" ");for(const[c,u,d]of s._dep)if(u&&d){t=!0,a.push(`${l}CREATES -> ${c}`);const h=n(o+1,d);h&&a.push(h)}else a.push(`${l}uses -> ${c}`);return a.join(` `)}const r=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${n(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${Ka._totals.toFixed(2)}ms)`];(e>2||t)&&Ka.all.add(r.join(` -`))}}Ka.all=new Set;Ka._None=new class extends Ka{constructor(){super(0,null)}stop(){}branch(){return this}};Ka._totals=0;const uZe=new Set([an.inMemory,an.vscodeSourceControl,an.walkThrough,an.walkThroughSnippet]);class dZe{constructor(){this._byResource=new Tr,this._byOwner=new Map}set(e,t,n){let r=this._byResource.get(e);r||(r=new Map,this._byResource.set(e,r)),r.set(t,n);let o=this._byOwner.get(t);o||(o=new Tr,this._byOwner.set(t,o)),o.set(e,n)}get(e,t){const n=this._byResource.get(e);return n==null?void 0:n.get(t)}delete(e,t){let n=!1,r=!1;const o=this._byResource.get(e);o&&(n=o.delete(t));const s=this._byOwner.get(t);if(s&&(r=s.delete(e)),n!==r)throw new Error("illegal state");return n&&r}values(e){var t,n,r,o;return typeof e=="string"?(n=(t=this._byOwner.get(e))===null||t===void 0?void 0:t.values())!==null&&n!==void 0?n:En.empty():At.isUri(e)?(o=(r=this._byResource.get(e))===null||r===void 0?void 0:r.values())!==null&&o!==void 0?o:En.empty():En.map(En.concat(...this._byOwner.values()),s=>s[1])}}class hZe{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new Tr,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const n=this._data.get(t);n&&this._substract(n);const r=this._resourceStats(t);this._add(r),this._data.set(t,r)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(uZe.has(e.scheme))return t;for(const{severity:n}of this._service.read({resource:e}))n===pr.Error?t.errors+=1:n===pr.Warning?t.warnings+=1:n===pr.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 Dm{constructor(){this._onMarkerChanged=new bpe({delay:0,merge:Dm._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new dZe,this._stats=new hZe(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const n of t||[])this.changeOne(e,n,[])}changeOne(e,t,n){if(epe(n))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const r=[];for(const o of n){const s=Dm._toMarker(e,t,o);s&&r.push(s)}this._data.set(t,e,r),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,n){let{code:r,severity:o,message:s,source:a,startLineNumber:l,startColumn:c,endLineNumber:u,endColumn:d,relatedInformation:h,tags:f}=n;if(s)return l=l>0?l:1,c=c>0?c:1,u=u>=l?u:l,d=d>0?d:c,{resource:t,owner:e,code:r,severity:o,message:s,source:a,startLineNumber:l,startColumn:c,endLineNumber:u,endColumn:d,relatedInformation:h,tags:f}}changeAll(e,t){const n=[],r=this._data.values(e);if(r)for(const o of r){const s=En.first(o);s&&(n.push(s.resource),this._data.delete(s.resource,e))}if(Ts(t)){const o=new Tr;for(const{resource:s,marker:a}of t){const l=Dm._toMarker(e,s,a);if(!l)continue;const c=o.get(s);c?c.push(l):(o.set(s,[l]),n.push(s))}for(const[s,a]of o)this._data.set(s,e,a)}n.length>0&&this._onMarkerChanged.fire(n)}read(e=Object.create(null)){let{owner:t,resource:n,severities:r,take:o}=e;if((!o||o<0)&&(o=-1),t&&n){const s=this._data.get(n,t);if(s){const a=[];for(const l of s)if(Dm._accept(l,r)){const c=a.push(l);if(o>0&&c===o)break}return a}else return[]}else if(!t&&!n){const s=[];for(const a of this._data.values())for(const l of a)if(Dm._accept(l,r)){const c=s.push(l);if(o>0&&c===o)return s}return s}else{const s=this._data.values(n??t),a=[];for(const l of s)for(const c of l)if(Dm._accept(c,r)){const u=a.push(c);if(o>0&&u===o)return a}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new Tr;for(const n of e)for(const r of n)t.set(r,!0);return Array.from(t.keys())}}class fZe extends fe{constructor(){super(...arguments),this._configurationModel=new ls}get configurationModel(){return this._configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=new ls;const e=ar.as(xh.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const n=this.getConfigurationDefaultOverrides();for(const r of e){const o=n[r],s=t[r];o!==void 0?this._configurationModel.addValue(r,o):s?this._configurationModel.addValue(r,s.default):this._configurationModel.removeValue(r)}}}const M_=yn("accessibilitySignalService");class Jt{static register(e){return new Jt(e.fileName)}constructor(e){this.fileName=e}}Jt.error=Jt.register({fileName:"error.mp3"});Jt.warning=Jt.register({fileName:"warning.mp3"});Jt.foldedArea=Jt.register({fileName:"foldedAreas.mp3"});Jt.break=Jt.register({fileName:"break.mp3"});Jt.quickFixes=Jt.register({fileName:"quickFixes.mp3"});Jt.taskCompleted=Jt.register({fileName:"taskCompleted.mp3"});Jt.taskFailed=Jt.register({fileName:"taskFailed.mp3"});Jt.terminalBell=Jt.register({fileName:"terminalBell.mp3"});Jt.diffLineInserted=Jt.register({fileName:"diffLineInserted.mp3"});Jt.diffLineDeleted=Jt.register({fileName:"diffLineDeleted.mp3"});Jt.diffLineModified=Jt.register({fileName:"diffLineModified.mp3"});Jt.chatRequestSent=Jt.register({fileName:"chatRequestSent.mp3"});Jt.chatResponsePending=Jt.register({fileName:"chatResponsePending.mp3"});Jt.chatResponseReceived1=Jt.register({fileName:"chatResponseReceived1.mp3"});Jt.chatResponseReceived2=Jt.register({fileName:"chatResponseReceived2.mp3"});Jt.chatResponseReceived3=Jt.register({fileName:"chatResponseReceived3.mp3"});Jt.chatResponseReceived4=Jt.register({fileName:"chatResponseReceived4.mp3"});Jt.clear=Jt.register({fileName:"clear.mp3"});Jt.save=Jt.register({fileName:"save.mp3"});Jt.format=Jt.register({fileName:"format.mp3"});class gZe{constructor(e){this.randomOneOf=e}}class cn{static register(e){const t=new gZe("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),n=new cn(t,e.name,e.legacySoundSettingsKey,e.settingsKey,e.legacyAnnouncementSettingsKey,e.announcementMessage);return cn._signals.add(n),n}constructor(e,t,n,r,o,s){this.sound=e,this.name=t,this.legacySoundSettingsKey=n,this.settingsKey=r,this.legacyAnnouncementSettingsKey=o,this.announcementMessage=s}}cn._signals=new Set;cn.error=cn.register({name:w("accessibilitySignals.lineHasError.name","Error on Line"),sound:Jt.error,legacySoundSettingsKey:"audioCues.lineHasError",legacyAnnouncementSettingsKey:"accessibility.alert.error",announcementMessage:w("accessibility.signals.lineHasError","Error"),settingsKey:"accessibility.signals.lineHasError"});cn.warning=cn.register({name:w("accessibilitySignals.lineHasWarning.name","Warning on Line"),sound:Jt.warning,legacySoundSettingsKey:"audioCues.lineHasWarning",legacyAnnouncementSettingsKey:"accessibility.alert.warning",announcementMessage:w("accessibility.signals.lineHasWarning","Warning"),settingsKey:"accessibility.signals.lineHasWarning"});cn.foldedArea=cn.register({name:w("accessibilitySignals.lineHasFoldedArea.name","Folded Area on Line"),sound:Jt.foldedArea,legacySoundSettingsKey:"audioCues.lineHasFoldedArea",legacyAnnouncementSettingsKey:"accessibility.alert.foldedArea",announcementMessage:w("accessibility.signals.lineHasFoldedArea","Folded"),settingsKey:"accessibility.signals.lineHasFoldedArea"});cn.break=cn.register({name:w("accessibilitySignals.lineHasBreakpoint.name","Breakpoint on Line"),sound:Jt.break,legacySoundSettingsKey:"audioCues.lineHasBreakpoint",legacyAnnouncementSettingsKey:"accessibility.alert.breakpoint",announcementMessage:w("accessibility.signals.lineHasBreakpoint","Breakpoint"),settingsKey:"accessibility.signals.lineHasBreakpoint"});cn.inlineSuggestion=cn.register({name:w("accessibilitySignals.lineHasInlineSuggestion.name","Inline Suggestion on Line"),sound:Jt.quickFixes,legacySoundSettingsKey:"audioCues.lineHasInlineSuggestion",settingsKey:"accessibility.signals.lineHasInlineSuggestion"});cn.terminalQuickFix=cn.register({name:w("accessibilitySignals.terminalQuickFix.name","Terminal Quick Fix"),sound:Jt.quickFixes,legacySoundSettingsKey:"audioCues.terminalQuickFix",legacyAnnouncementSettingsKey:"accessibility.alert.terminalQuickFix",announcementMessage:w("accessibility.signals.terminalQuickFix","Quick Fix"),settingsKey:"accessibility.signals.terminalQuickFix"});cn.onDebugBreak=cn.register({name:w("accessibilitySignals.onDebugBreak.name","Debugger Stopped on Breakpoint"),sound:Jt.break,legacySoundSettingsKey:"audioCues.onDebugBreak",legacyAnnouncementSettingsKey:"accessibility.alert.onDebugBreak",announcementMessage:w("accessibility.signals.onDebugBreak","Breakpoint"),settingsKey:"accessibility.signals.onDebugBreak"});cn.noInlayHints=cn.register({name:w("accessibilitySignals.noInlayHints","No Inlay Hints on Line"),sound:Jt.error,legacySoundSettingsKey:"audioCues.noInlayHints",legacyAnnouncementSettingsKey:"accessibility.alert.noInlayHints",announcementMessage:w("accessibility.signals.noInlayHints","No Inlay Hints"),settingsKey:"accessibility.signals.noInlayHints"});cn.taskCompleted=cn.register({name:w("accessibilitySignals.taskCompleted","Task Completed"),sound:Jt.taskCompleted,legacySoundSettingsKey:"audioCues.taskCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.taskCompleted",announcementMessage:w("accessibility.signals.taskCompleted","Task Completed"),settingsKey:"accessibility.signals.taskCompleted"});cn.taskFailed=cn.register({name:w("accessibilitySignals.taskFailed","Task Failed"),sound:Jt.taskFailed,legacySoundSettingsKey:"audioCues.taskFailed",legacyAnnouncementSettingsKey:"accessibility.alert.taskFailed",announcementMessage:w("accessibility.signals.taskFailed","Task Failed"),settingsKey:"accessibility.signals.taskFailed"});cn.terminalCommandFailed=cn.register({name:w("accessibilitySignals.terminalCommandFailed","Terminal Command Failed"),sound:Jt.error,legacySoundSettingsKey:"audioCues.terminalCommandFailed",legacyAnnouncementSettingsKey:"accessibility.alert.terminalCommandFailed",announcementMessage:w("accessibility.signals.terminalCommandFailed","Command Failed"),settingsKey:"accessibility.signals.terminalCommandFailed"});cn.terminalBell=cn.register({name:w("accessibilitySignals.terminalBell","Terminal Bell"),sound:Jt.terminalBell,legacySoundSettingsKey:"audioCues.terminalBell",legacyAnnouncementSettingsKey:"accessibility.alert.terminalBell",announcementMessage:w("accessibility.signals.terminalBell","Terminal Bell"),settingsKey:"accessibility.signals.terminalBell"});cn.notebookCellCompleted=cn.register({name:w("accessibilitySignals.notebookCellCompleted","Notebook Cell Completed"),sound:Jt.taskCompleted,legacySoundSettingsKey:"audioCues.notebookCellCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellCompleted",announcementMessage:w("accessibility.signals.notebookCellCompleted","Notebook Cell Completed"),settingsKey:"accessibility.signals.notebookCellCompleted"});cn.notebookCellFailed=cn.register({name:w("accessibilitySignals.notebookCellFailed","Notebook Cell Failed"),sound:Jt.taskFailed,legacySoundSettingsKey:"audioCues.notebookCellFailed",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellFailed",announcementMessage:w("accessibility.signals.notebookCellFailed","Notebook Cell Failed"),settingsKey:"accessibility.signals.notebookCellFailed"});cn.diffLineInserted=cn.register({name:w("accessibilitySignals.diffLineInserted","Diff Line Inserted"),sound:Jt.diffLineInserted,legacySoundSettingsKey:"audioCues.diffLineInserted",settingsKey:"accessibility.signals.diffLineInserted"});cn.diffLineDeleted=cn.register({name:w("accessibilitySignals.diffLineDeleted","Diff Line Deleted"),sound:Jt.diffLineDeleted,legacySoundSettingsKey:"audioCues.diffLineDeleted",settingsKey:"accessibility.signals.diffLineDeleted"});cn.diffLineModified=cn.register({name:w("accessibilitySignals.diffLineModified","Diff Line Modified"),sound:Jt.diffLineModified,legacySoundSettingsKey:"audioCues.diffLineModified",settingsKey:"accessibility.signals.diffLineModified"});cn.chatRequestSent=cn.register({name:w("accessibilitySignals.chatRequestSent","Chat Request Sent"),sound:Jt.chatRequestSent,legacySoundSettingsKey:"audioCues.chatRequestSent",legacyAnnouncementSettingsKey:"accessibility.alert.chatRequestSent",announcementMessage:w("accessibility.signals.chatRequestSent","Chat Request Sent"),settingsKey:"accessibility.signals.chatRequestSent"});cn.chatResponseReceived=cn.register({name:w("accessibilitySignals.chatResponseReceived","Chat Response Received"),legacySoundSettingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[Jt.chatResponseReceived1,Jt.chatResponseReceived2,Jt.chatResponseReceived3,Jt.chatResponseReceived4]},settingsKey:"accessibility.signals.chatResponseReceived"});cn.chatResponsePending=cn.register({name:w("accessibilitySignals.chatResponsePending","Chat Response Pending"),sound:Jt.chatResponsePending,legacySoundSettingsKey:"audioCues.chatResponsePending",legacyAnnouncementSettingsKey:"accessibility.alert.chatResponsePending",announcementMessage:w("accessibility.signals.chatResponsePending","Chat Response Pending"),settingsKey:"accessibility.signals.chatResponsePending"});cn.clear=cn.register({name:w("accessibilitySignals.clear","Clear"),sound:Jt.clear,legacySoundSettingsKey:"audioCues.clear",legacyAnnouncementSettingsKey:"accessibility.alert.clear",announcementMessage:w("accessibility.signals.clear","Clear"),settingsKey:"accessibility.signals.clear"});cn.save=cn.register({name:w("accessibilitySignals.save","Save"),sound:Jt.save,legacySoundSettingsKey:"audioCues.save",legacyAnnouncementSettingsKey:"accessibility.alert.save",announcementMessage:w("accessibility.signals.save","Save"),settingsKey:"accessibility.signals.save"});cn.format=cn.register({name:w("accessibilitySignals.format","Format"),sound:Jt.format,legacySoundSettingsKey:"audioCues.format",legacyAnnouncementSettingsKey:"accessibility.alert.format",announcementMessage:w("accessibility.signals.format","Format"),settingsKey:"accessibility.signals.format"});class pZe extends fe{constructor(e,t=[]){super(),this.logger=new V8e([e,...t]),this._register(e.onDidChangeLogLevel(n=>this.setLevel(n)))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(e){this.logger.setLevel(e)}getLevel(){return this.logger.getLevel()}trace(e,...t){this.logger.trace(e,...t)}debug(e,...t){this.logger.debug(e,...t)}info(e,...t){this.logger.info(e,...t)}warn(e,...t){this.logger.warn(e,...t)}error(e,...t){this.logger.error(e,...t)}}const O0e=[];function nT(i){O0e.push(i)}function mZe(){return O0e.slice(0)}var A_=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Jo=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class vZe{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new se}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let sz=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new Z3e(new vZe(t))):Promise.reject(new Error("Model not found"))}};sz=A_([Jo(0,tr)],sz);class p3{show(){return p3.NULL_PROGRESS_RUNNER}async showWhile(e,t){await e}}p3.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class _Ze{withProgress(e,t,n){return t({report:()=>{}})}}class bZe{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}}class CZe{async confirm(e){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}}doConfirm(e,t){let n=e;return t&&(n=n+` +`))}}Ka.all=new Set;Ka._None=new class extends Ka{constructor(){super(0,null)}stop(){}branch(){return this}};Ka._totals=0;const uZe=new Set([an.inMemory,an.vscodeSourceControl,an.walkThrough,an.walkThroughSnippet]);class dZe{constructor(){this._byResource=new Tr,this._byOwner=new Map}set(e,t,n){let r=this._byResource.get(e);r||(r=new Map,this._byResource.set(e,r)),r.set(t,n);let o=this._byOwner.get(t);o||(o=new Tr,this._byOwner.set(t,o)),o.set(e,n)}get(e,t){const n=this._byResource.get(e);return n==null?void 0:n.get(t)}delete(e,t){let n=!1,r=!1;const o=this._byResource.get(e);o&&(n=o.delete(t));const s=this._byOwner.get(t);if(s&&(r=s.delete(e)),n!==r)throw new Error("illegal state");return n&&r}values(e){var t,n,r,o;return typeof e=="string"?(n=(t=this._byOwner.get(e))===null||t===void 0?void 0:t.values())!==null&&n!==void 0?n:En.empty():At.isUri(e)?(o=(r=this._byResource.get(e))===null||r===void 0?void 0:r.values())!==null&&o!==void 0?o:En.empty():En.map(En.concat(...this._byOwner.values()),s=>s[1])}}class hZe{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new Tr,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const n=this._data.get(t);n&&this._substract(n);const r=this._resourceStats(t);this._add(r),this._data.set(t,r)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(uZe.has(e.scheme))return t;for(const{severity:n}of this._service.read({resource:e}))n===pr.Error?t.errors+=1:n===pr.Warning?t.warnings+=1:n===pr.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 Im{constructor(){this._onMarkerChanged=new bpe({delay:0,merge:Im._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new dZe,this._stats=new hZe(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const n of t||[])this.changeOne(e,n,[])}changeOne(e,t,n){if(epe(n))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const r=[];for(const o of n){const s=Im._toMarker(e,t,o);s&&r.push(s)}this._data.set(t,e,r),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,n){let{code:r,severity:o,message:s,source:a,startLineNumber:l,startColumn:c,endLineNumber:u,endColumn:d,relatedInformation:h,tags:f}=n;if(s)return l=l>0?l:1,c=c>0?c:1,u=u>=l?u:l,d=d>0?d:c,{resource:t,owner:e,code:r,severity:o,message:s,source:a,startLineNumber:l,startColumn:c,endLineNumber:u,endColumn:d,relatedInformation:h,tags:f}}changeAll(e,t){const n=[],r=this._data.values(e);if(r)for(const o of r){const s=En.first(o);s&&(n.push(s.resource),this._data.delete(s.resource,e))}if(Ts(t)){const o=new Tr;for(const{resource:s,marker:a}of t){const l=Im._toMarker(e,s,a);if(!l)continue;const c=o.get(s);c?c.push(l):(o.set(s,[l]),n.push(s))}for(const[s,a]of o)this._data.set(s,e,a)}n.length>0&&this._onMarkerChanged.fire(n)}read(e=Object.create(null)){let{owner:t,resource:n,severities:r,take:o}=e;if((!o||o<0)&&(o=-1),t&&n){const s=this._data.get(n,t);if(s){const a=[];for(const l of s)if(Im._accept(l,r)){const c=a.push(l);if(o>0&&c===o)break}return a}else return[]}else if(!t&&!n){const s=[];for(const a of this._data.values())for(const l of a)if(Im._accept(l,r)){const c=s.push(l);if(o>0&&c===o)return s}return s}else{const s=this._data.values(n??t),a=[];for(const l of s)for(const c of l)if(Im._accept(c,r)){const u=a.push(c);if(o>0&&u===o)return a}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new Tr;for(const n of e)for(const r of n)t.set(r,!0);return Array.from(t.keys())}}class fZe extends fe{constructor(){super(...arguments),this._configurationModel=new ls}get configurationModel(){return this._configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=new ls;const e=ar.as(xh.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const n=this.getConfigurationDefaultOverrides();for(const r of e){const o=n[r],s=t[r];o!==void 0?this._configurationModel.addValue(r,o):s?this._configurationModel.addValue(r,s.default):this._configurationModel.removeValue(r)}}}const R_=yn("accessibilitySignalService");class Jt{static register(e){return new Jt(e.fileName)}constructor(e){this.fileName=e}}Jt.error=Jt.register({fileName:"error.mp3"});Jt.warning=Jt.register({fileName:"warning.mp3"});Jt.foldedArea=Jt.register({fileName:"foldedAreas.mp3"});Jt.break=Jt.register({fileName:"break.mp3"});Jt.quickFixes=Jt.register({fileName:"quickFixes.mp3"});Jt.taskCompleted=Jt.register({fileName:"taskCompleted.mp3"});Jt.taskFailed=Jt.register({fileName:"taskFailed.mp3"});Jt.terminalBell=Jt.register({fileName:"terminalBell.mp3"});Jt.diffLineInserted=Jt.register({fileName:"diffLineInserted.mp3"});Jt.diffLineDeleted=Jt.register({fileName:"diffLineDeleted.mp3"});Jt.diffLineModified=Jt.register({fileName:"diffLineModified.mp3"});Jt.chatRequestSent=Jt.register({fileName:"chatRequestSent.mp3"});Jt.chatResponsePending=Jt.register({fileName:"chatResponsePending.mp3"});Jt.chatResponseReceived1=Jt.register({fileName:"chatResponseReceived1.mp3"});Jt.chatResponseReceived2=Jt.register({fileName:"chatResponseReceived2.mp3"});Jt.chatResponseReceived3=Jt.register({fileName:"chatResponseReceived3.mp3"});Jt.chatResponseReceived4=Jt.register({fileName:"chatResponseReceived4.mp3"});Jt.clear=Jt.register({fileName:"clear.mp3"});Jt.save=Jt.register({fileName:"save.mp3"});Jt.format=Jt.register({fileName:"format.mp3"});class gZe{constructor(e){this.randomOneOf=e}}class cn{static register(e){const t=new gZe("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),n=new cn(t,e.name,e.legacySoundSettingsKey,e.settingsKey,e.legacyAnnouncementSettingsKey,e.announcementMessage);return cn._signals.add(n),n}constructor(e,t,n,r,o,s){this.sound=e,this.name=t,this.legacySoundSettingsKey=n,this.settingsKey=r,this.legacyAnnouncementSettingsKey=o,this.announcementMessage=s}}cn._signals=new Set;cn.error=cn.register({name:w("accessibilitySignals.lineHasError.name","Error on Line"),sound:Jt.error,legacySoundSettingsKey:"audioCues.lineHasError",legacyAnnouncementSettingsKey:"accessibility.alert.error",announcementMessage:w("accessibility.signals.lineHasError","Error"),settingsKey:"accessibility.signals.lineHasError"});cn.warning=cn.register({name:w("accessibilitySignals.lineHasWarning.name","Warning on Line"),sound:Jt.warning,legacySoundSettingsKey:"audioCues.lineHasWarning",legacyAnnouncementSettingsKey:"accessibility.alert.warning",announcementMessage:w("accessibility.signals.lineHasWarning","Warning"),settingsKey:"accessibility.signals.lineHasWarning"});cn.foldedArea=cn.register({name:w("accessibilitySignals.lineHasFoldedArea.name","Folded Area on Line"),sound:Jt.foldedArea,legacySoundSettingsKey:"audioCues.lineHasFoldedArea",legacyAnnouncementSettingsKey:"accessibility.alert.foldedArea",announcementMessage:w("accessibility.signals.lineHasFoldedArea","Folded"),settingsKey:"accessibility.signals.lineHasFoldedArea"});cn.break=cn.register({name:w("accessibilitySignals.lineHasBreakpoint.name","Breakpoint on Line"),sound:Jt.break,legacySoundSettingsKey:"audioCues.lineHasBreakpoint",legacyAnnouncementSettingsKey:"accessibility.alert.breakpoint",announcementMessage:w("accessibility.signals.lineHasBreakpoint","Breakpoint"),settingsKey:"accessibility.signals.lineHasBreakpoint"});cn.inlineSuggestion=cn.register({name:w("accessibilitySignals.lineHasInlineSuggestion.name","Inline Suggestion on Line"),sound:Jt.quickFixes,legacySoundSettingsKey:"audioCues.lineHasInlineSuggestion",settingsKey:"accessibility.signals.lineHasInlineSuggestion"});cn.terminalQuickFix=cn.register({name:w("accessibilitySignals.terminalQuickFix.name","Terminal Quick Fix"),sound:Jt.quickFixes,legacySoundSettingsKey:"audioCues.terminalQuickFix",legacyAnnouncementSettingsKey:"accessibility.alert.terminalQuickFix",announcementMessage:w("accessibility.signals.terminalQuickFix","Quick Fix"),settingsKey:"accessibility.signals.terminalQuickFix"});cn.onDebugBreak=cn.register({name:w("accessibilitySignals.onDebugBreak.name","Debugger Stopped on Breakpoint"),sound:Jt.break,legacySoundSettingsKey:"audioCues.onDebugBreak",legacyAnnouncementSettingsKey:"accessibility.alert.onDebugBreak",announcementMessage:w("accessibility.signals.onDebugBreak","Breakpoint"),settingsKey:"accessibility.signals.onDebugBreak"});cn.noInlayHints=cn.register({name:w("accessibilitySignals.noInlayHints","No Inlay Hints on Line"),sound:Jt.error,legacySoundSettingsKey:"audioCues.noInlayHints",legacyAnnouncementSettingsKey:"accessibility.alert.noInlayHints",announcementMessage:w("accessibility.signals.noInlayHints","No Inlay Hints"),settingsKey:"accessibility.signals.noInlayHints"});cn.taskCompleted=cn.register({name:w("accessibilitySignals.taskCompleted","Task Completed"),sound:Jt.taskCompleted,legacySoundSettingsKey:"audioCues.taskCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.taskCompleted",announcementMessage:w("accessibility.signals.taskCompleted","Task Completed"),settingsKey:"accessibility.signals.taskCompleted"});cn.taskFailed=cn.register({name:w("accessibilitySignals.taskFailed","Task Failed"),sound:Jt.taskFailed,legacySoundSettingsKey:"audioCues.taskFailed",legacyAnnouncementSettingsKey:"accessibility.alert.taskFailed",announcementMessage:w("accessibility.signals.taskFailed","Task Failed"),settingsKey:"accessibility.signals.taskFailed"});cn.terminalCommandFailed=cn.register({name:w("accessibilitySignals.terminalCommandFailed","Terminal Command Failed"),sound:Jt.error,legacySoundSettingsKey:"audioCues.terminalCommandFailed",legacyAnnouncementSettingsKey:"accessibility.alert.terminalCommandFailed",announcementMessage:w("accessibility.signals.terminalCommandFailed","Command Failed"),settingsKey:"accessibility.signals.terminalCommandFailed"});cn.terminalBell=cn.register({name:w("accessibilitySignals.terminalBell","Terminal Bell"),sound:Jt.terminalBell,legacySoundSettingsKey:"audioCues.terminalBell",legacyAnnouncementSettingsKey:"accessibility.alert.terminalBell",announcementMessage:w("accessibility.signals.terminalBell","Terminal Bell"),settingsKey:"accessibility.signals.terminalBell"});cn.notebookCellCompleted=cn.register({name:w("accessibilitySignals.notebookCellCompleted","Notebook Cell Completed"),sound:Jt.taskCompleted,legacySoundSettingsKey:"audioCues.notebookCellCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellCompleted",announcementMessage:w("accessibility.signals.notebookCellCompleted","Notebook Cell Completed"),settingsKey:"accessibility.signals.notebookCellCompleted"});cn.notebookCellFailed=cn.register({name:w("accessibilitySignals.notebookCellFailed","Notebook Cell Failed"),sound:Jt.taskFailed,legacySoundSettingsKey:"audioCues.notebookCellFailed",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellFailed",announcementMessage:w("accessibility.signals.notebookCellFailed","Notebook Cell Failed"),settingsKey:"accessibility.signals.notebookCellFailed"});cn.diffLineInserted=cn.register({name:w("accessibilitySignals.diffLineInserted","Diff Line Inserted"),sound:Jt.diffLineInserted,legacySoundSettingsKey:"audioCues.diffLineInserted",settingsKey:"accessibility.signals.diffLineInserted"});cn.diffLineDeleted=cn.register({name:w("accessibilitySignals.diffLineDeleted","Diff Line Deleted"),sound:Jt.diffLineDeleted,legacySoundSettingsKey:"audioCues.diffLineDeleted",settingsKey:"accessibility.signals.diffLineDeleted"});cn.diffLineModified=cn.register({name:w("accessibilitySignals.diffLineModified","Diff Line Modified"),sound:Jt.diffLineModified,legacySoundSettingsKey:"audioCues.diffLineModified",settingsKey:"accessibility.signals.diffLineModified"});cn.chatRequestSent=cn.register({name:w("accessibilitySignals.chatRequestSent","Chat Request Sent"),sound:Jt.chatRequestSent,legacySoundSettingsKey:"audioCues.chatRequestSent",legacyAnnouncementSettingsKey:"accessibility.alert.chatRequestSent",announcementMessage:w("accessibility.signals.chatRequestSent","Chat Request Sent"),settingsKey:"accessibility.signals.chatRequestSent"});cn.chatResponseReceived=cn.register({name:w("accessibilitySignals.chatResponseReceived","Chat Response Received"),legacySoundSettingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[Jt.chatResponseReceived1,Jt.chatResponseReceived2,Jt.chatResponseReceived3,Jt.chatResponseReceived4]},settingsKey:"accessibility.signals.chatResponseReceived"});cn.chatResponsePending=cn.register({name:w("accessibilitySignals.chatResponsePending","Chat Response Pending"),sound:Jt.chatResponsePending,legacySoundSettingsKey:"audioCues.chatResponsePending",legacyAnnouncementSettingsKey:"accessibility.alert.chatResponsePending",announcementMessage:w("accessibility.signals.chatResponsePending","Chat Response Pending"),settingsKey:"accessibility.signals.chatResponsePending"});cn.clear=cn.register({name:w("accessibilitySignals.clear","Clear"),sound:Jt.clear,legacySoundSettingsKey:"audioCues.clear",legacyAnnouncementSettingsKey:"accessibility.alert.clear",announcementMessage:w("accessibility.signals.clear","Clear"),settingsKey:"accessibility.signals.clear"});cn.save=cn.register({name:w("accessibilitySignals.save","Save"),sound:Jt.save,legacySoundSettingsKey:"audioCues.save",legacyAnnouncementSettingsKey:"accessibility.alert.save",announcementMessage:w("accessibility.signals.save","Save"),settingsKey:"accessibility.signals.save"});cn.format=cn.register({name:w("accessibilitySignals.format","Format"),sound:Jt.format,legacySoundSettingsKey:"audioCues.format",legacyAnnouncementSettingsKey:"accessibility.alert.format",announcementMessage:w("accessibility.signals.format","Format"),settingsKey:"accessibility.signals.format"});class pZe extends fe{constructor(e,t=[]){super(),this.logger=new V8e([e,...t]),this._register(e.onDidChangeLogLevel(n=>this.setLevel(n)))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(e){this.logger.setLevel(e)}getLevel(){return this.logger.getLevel()}trace(e,...t){this.logger.trace(e,...t)}debug(e,...t){this.logger.debug(e,...t)}info(e,...t){this.logger.info(e,...t)}warn(e,...t){this.logger.warn(e,...t)}error(e,...t){this.logger.error(e,...t)}}const O0e=[];function nT(i){O0e.push(i)}function mZe(){return O0e.slice(0)}var M_=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Jo=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class vZe{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new se}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let sz=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new Z3e(new vZe(t))):Promise.reject(new Error("Model not found"))}};sz=M_([Jo(0,tr)],sz);class p3{show(){return p3.NULL_PROGRESS_RUNNER}async showWhile(e,t){await e}}p3.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class _Ze{withProgress(e,t,n){return t({report:()=>{}})}}class bZe{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}}class CZe{async confirm(e){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}}doConfirm(e,t){let n=e;return t&&(n=n+` -`+t),hi.confirm(n)}async prompt(e){var t,n;let r;if(this.doConfirm(e.message,e.detail)){const s=[...(t=e.buttons)!==null&&t!==void 0?t:[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&s.push(e.cancelButton),r=await((n=s[0])===null||n===void 0?void 0:n.run({checkboxChecked:!1}))}return{result:r}}async error(e,t){await this.prompt({type:kr.Error,message:e,detail:t})}}class _I{info(e){return this.notify({severity:kr.Info,message:e})}warn(e){return this.notify({severity:kr.Warning,message:e})}error(e){return this.notify({severity:kr.Error,message:e})}notify(e){switch(e.severity){case kr.Error:console.error(e.message);break;case kr.Warning:console.warn(e.message);break;default:console.log(e.message);break}return _I.NO_OP}prompt(e,t,n,r){return _I.NO_OP}status(e,t){return fe.None}}_I.NO_OP=new dje;let az=class{constructor(e){this._onWillExecuteCommand=new se,this._onDidExecuteCommand=new se,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const n=Dn.getCommand(e);if(!n)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const r=this._instantiationService.invokeFunction.apply(this._instantiationService,[n.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(r)}catch(r){return Promise.reject(r)}}};az=A_([Jo(0,Ot)],az);let qw=class extends mGe{constructor(e,t,n,r,o,s){super(e,t,n,r,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=f=>{const g=new Te;g.add(ye(f,Ge.KEY_DOWN,p=>{const v=new Ai(p);this._dispatch(v,v.target)&&(v.preventDefault(),v.stopPropagation())})),g.add(ye(f,Ge.KEY_UP,p=>{const v=new Ai(p);this._singleModifierDispatch(v,v.target)&&v.preventDefault()})),this._domNodeListeners.push(new yZe(f,g))},l=f=>{for(let g=0;g{f.getOption(61)||a(f.getContainerDomNode())},u=f=>{f.getOption(61)||l(f.getContainerDomNode())};this._register(s.onCodeEditorAdd(c)),this._register(s.onCodeEditorRemove(u)),s.listCodeEditors().forEach(c);const d=f=>{a(f.getContainerDomNode())},h=f=>{l(f.getContainerDomNode())};this._register(s.onDiffEditorAdd(d)),this._register(s.onDiffEditorRemove(h)),s.listDiffEditors().forEach(d)}addDynamicKeybinding(e,t,n,r){return Zu(Dn.registerCommand(e,n),this.addDynamicKeybindings([{keybinding:t,command:e,when:r}]))}addDynamicKeybindings(e){const t=e.map(n=>{var r;return{keybinding:tH(n.keybinding,yl),command:(r=n.command)!==null&&r!==void 0?r:null,commandArgs:n.commandArgs,when:n.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}});return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),Rt(()=>{for(let n=0;nthis._log(n))}return this._cachedResolver}_documentHasFocus(){return hi.document.hasFocus()}_toNormalizedKeybindingItems(e,t){const n=[];let r=0;for(const o of e){const s=o.when||void 0,a=o.keybinding;if(!a)n[r++]=new Koe(void 0,o.command,o.commandArgs,s,t,null,!1);else{const l=rI.resolveKeybinding(a,yl);for(const c of l)n[r++]=new Koe(c,o.command,o.commandArgs,s,t,null,!1)}}return n}resolveKeyboardEvent(e){const t=new Ip(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new rI([t],yl)}};qw=A_([Jo(0,Vt),Jo(1,sr),Jo(2,ea),Jo(3,$r),Jo(4,Ta),Jo(5,Un)],qw);class yZe extends fe{constructor(e,t){super(),this.domNode=e,this._register(t)}}function Tse(i){return i&&typeof i=="object"&&(!i.overrideIdentifier||typeof i.overrideIdentifier=="string")&&(!i.resource||i.resource instanceof At)}class F0e{constructor(){this._onDidChangeConfiguration=new se,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const e=new fZe;this._configuration=new Q4(e.reload(),new ls,new ls,new ls),e.dispose()}getValue(e,t){const n=typeof e=="string"?e:void 0,r=Tse(e)?e:Tse(t)?t:{};return this._configuration.getValue(n,r,void 0)}updateValues(e){const t={data:this._configuration.toData()},n=[];for(const r of e){const[o,s]=r;this.getValue(o)!==s&&(this._configuration.updateValue(o,s),n.push(o))}if(n.length>0){const r=new hGe({keys:n,overrides:[]},t,this._configuration);r.source=8,this._onDidChangeConfiguration.fire(r)}return Promise.resolve()}updateValue(e,t,n,r){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}}let lz=class{constructor(e,t,n){this.configurationService=e,this.modelService=t,this.languageService=n,this._onDidChangeConfiguration=new se,this.configurationService.onDidChangeConfiguration(r=>{this._onDidChangeConfiguration.fire({affectedKeys:r.affectedKeys,affectsConfiguration:(o,s)=>r.affectsConfiguration(s)})})}getValue(e,t,n){const r=ae.isIPosition(t)?t:null,o=r?typeof n=="string"?n:void 0:typeof t=="string"?t:void 0,s=e?this.getLanguage(e,r):void 0;return typeof o>"u"?this.configurationService.getValue({resource:e,overrideIdentifier:s}):this.configurationService.getValue(o,{resource:e,overrideIdentifier:s})}getLanguage(e,t){const n=this.modelService.getModel(e);return n?t?n.getLanguageIdAtPosition(t.lineNumber,t.column):n.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}};lz=A_([Jo(0,gn),Jo(1,tr),Jo(2,ji)],lz);let cz=class{constructor(e){this.configurationService=e}getEOL(e,t){const n=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return n&&typeof n=="string"&&n!=="auto"?n:Da||Ln?` +`+t),hi.confirm(n)}async prompt(e){var t,n;let r;if(this.doConfirm(e.message,e.detail)){const s=[...(t=e.buttons)!==null&&t!==void 0?t:[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&s.push(e.cancelButton),r=await((n=s[0])===null||n===void 0?void 0:n.run({checkboxChecked:!1}))}return{result:r}}async error(e,t){await this.prompt({type:kr.Error,message:e,detail:t})}}class _I{info(e){return this.notify({severity:kr.Info,message:e})}warn(e){return this.notify({severity:kr.Warning,message:e})}error(e){return this.notify({severity:kr.Error,message:e})}notify(e){switch(e.severity){case kr.Error:console.error(e.message);break;case kr.Warning:console.warn(e.message);break;default:console.log(e.message);break}return _I.NO_OP}prompt(e,t,n,r){return _I.NO_OP}status(e,t){return fe.None}}_I.NO_OP=new dje;let az=class{constructor(e){this._onWillExecuteCommand=new se,this._onDidExecuteCommand=new se,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const n=Dn.getCommand(e);if(!n)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const r=this._instantiationService.invokeFunction.apply(this._instantiationService,[n.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(r)}catch(r){return Promise.reject(r)}}};az=M_([Jo(0,Ot)],az);let qw=class extends mGe{constructor(e,t,n,r,o,s){super(e,t,n,r,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=f=>{const g=new Te;g.add(ye(f,Ge.KEY_DOWN,p=>{const v=new Ai(p);this._dispatch(v,v.target)&&(v.preventDefault(),v.stopPropagation())})),g.add(ye(f,Ge.KEY_UP,p=>{const v=new Ai(p);this._singleModifierDispatch(v,v.target)&&v.preventDefault()})),this._domNodeListeners.push(new yZe(f,g))},l=f=>{for(let g=0;g{f.getOption(61)||a(f.getContainerDomNode())},u=f=>{f.getOption(61)||l(f.getContainerDomNode())};this._register(s.onCodeEditorAdd(c)),this._register(s.onCodeEditorRemove(u)),s.listCodeEditors().forEach(c);const d=f=>{a(f.getContainerDomNode())},h=f=>{l(f.getContainerDomNode())};this._register(s.onDiffEditorAdd(d)),this._register(s.onDiffEditorRemove(h)),s.listDiffEditors().forEach(d)}addDynamicKeybinding(e,t,n,r){return Zu(Dn.registerCommand(e,n),this.addDynamicKeybindings([{keybinding:t,command:e,when:r}]))}addDynamicKeybindings(e){const t=e.map(n=>{var r;return{keybinding:tH(n.keybinding,yl),command:(r=n.command)!==null&&r!==void 0?r:null,commandArgs:n.commandArgs,when:n.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}});return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),Rt(()=>{for(let n=0;nthis._log(n))}return this._cachedResolver}_documentHasFocus(){return hi.document.hasFocus()}_toNormalizedKeybindingItems(e,t){const n=[];let r=0;for(const o of e){const s=o.when||void 0,a=o.keybinding;if(!a)n[r++]=new Koe(void 0,o.command,o.commandArgs,s,t,null,!1);else{const l=rI.resolveKeybinding(a,yl);for(const c of l)n[r++]=new Koe(c,o.command,o.commandArgs,s,t,null,!1)}}return n}resolveKeyboardEvent(e){const t=new kp(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new rI([t],yl)}};qw=M_([Jo(0,Vt),Jo(1,sr),Jo(2,ea),Jo(3,$r),Jo(4,Ta),Jo(5,Un)],qw);class yZe extends fe{constructor(e,t){super(),this.domNode=e,this._register(t)}}function Tse(i){return i&&typeof i=="object"&&(!i.overrideIdentifier||typeof i.overrideIdentifier=="string")&&(!i.resource||i.resource instanceof At)}class F0e{constructor(){this._onDidChangeConfiguration=new se,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const e=new fZe;this._configuration=new Q4(e.reload(),new ls,new ls,new ls),e.dispose()}getValue(e,t){const n=typeof e=="string"?e:void 0,r=Tse(e)?e:Tse(t)?t:{};return this._configuration.getValue(n,r,void 0)}updateValues(e){const t={data:this._configuration.toData()},n=[];for(const r of e){const[o,s]=r;this.getValue(o)!==s&&(this._configuration.updateValue(o,s),n.push(o))}if(n.length>0){const r=new hGe({keys:n,overrides:[]},t,this._configuration);r.source=8,this._onDidChangeConfiguration.fire(r)}return Promise.resolve()}updateValue(e,t,n,r){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}}let lz=class{constructor(e,t,n){this.configurationService=e,this.modelService=t,this.languageService=n,this._onDidChangeConfiguration=new se,this.configurationService.onDidChangeConfiguration(r=>{this._onDidChangeConfiguration.fire({affectedKeys:r.affectedKeys,affectsConfiguration:(o,s)=>r.affectsConfiguration(s)})})}getValue(e,t,n){const r=ae.isIPosition(t)?t:null,o=r?typeof n=="string"?n:void 0:typeof t=="string"?t:void 0,s=e?this.getLanguage(e,r):void 0;return typeof o>"u"?this.configurationService.getValue({resource:e,overrideIdentifier:s}):this.configurationService.getValue(o,{resource:e,overrideIdentifier:s})}getLanguage(e,t){const n=this.modelService.getModel(e);return n?t?n.getLanguageIdAtPosition(t.lineNumber,t.column):n.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}};lz=M_([Jo(0,gn),Jo(1,tr),Jo(2,ji)],lz);let cz=class{constructor(e){this.configurationService=e}getEOL(e,t){const n=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return n&&typeof n=="string"&&n!=="auto"?n:Da||Ln?` `:`\r -`}};cz=A_([Jo(0,gn)],cz);class wZe{publicLog2(){}}class bI{constructor(){const e=At.from({scheme:bI.SCHEME,authority:"model",path:"/"});this.workspace={id:O_e,folders:[new NGe({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===bI.SCHEME?this.workspace.folders[0]:null}}bI.SCHEME="inmemory";function nO(i,e,t){if(!e||!(i instanceof F0e))return;const n=[];Object.keys(e).forEach(r=>{aGe(r)&&n.push([`editor.${r}`,e[r]]),t&&lGe(r)&&n.push([`diffEditor.${r}`,e[r]])}),n.length>0&&i.updateValues(n)}let uz=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}async apply(e,t){const n=Array.isArray(e)?e:VX.convert(e),r=new Map;for(const a of n){if(!(a instanceof Sv))throw new Error("bad edit - only text edits are supported");const l=this._modelService.getModel(a.resource);if(!l)throw new Error("bad edit - model not found");if(typeof a.versionId=="number"&&l.getVersionId()!==a.versionId)throw new Error("bad state - model changed in the meantime");let c=r.get(l);c||(c=[],r.set(l,c)),c.push(Xi.replaceMove(B.lift(a.textEdit.range),a.textEdit.text))}let o=0,s=0;for(const[a,l]of r)a.pushStackElement(),a.pushEditOperations([],l,()=>[]),a.pushStackElement(),s+=1,o+=l.length;return{ariaSummary:Eb(LV.bulkEditServiceSummary,o,s),isApplied:o>0}}};uz=A_([Jo(0,tr)],uz);class SZe{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return su(e)}}let dz=class extends EV{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,n){if(!t){const r=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();r&&(t=r.getContainerDomNode())}return super.showContextView(e,t,n)}};dz=A_([Jo(0,pC),Jo(1,Un)],dz);class xZe{constructor(){this._neverEmitter=new se,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class LZe extends aI{constructor(){super()}}class EZe extends pZe{constructor(){super(new H8e)}}let hz=class extends MV{constructor(e,t,n,r,o,s){super(e,t,n,r,o,s),this.configure({blockMouse:!1})}};hz=A_([Jo(0,ea),Jo(1,$r),Jo(2,ng),Jo(3,ci),Jo(4,hu),Jo(5,Vt)],hz);class DZe{async playSignal(e,t){}}In(gn,F0e,0);In(Hq,lz,0);In(zme,cz,0);In(Pb,bI,0);In(Vw,SZe,0);In(ea,wZe,0);In(Gk,CZe,0);In(EX,bZe,0);In($r,_I,0);In(ig,Dm,0);In(ji,LZe,0);In(Sc,XYe,0);In(Ta,EZe,0);In(tr,VP,0);In(Gq,BV,0);In(Vt,oz,0);In(P_e,_Ze,0);In(T_,p3,0);In(dd,kqe,0);In(hd,wH,0);In(Xk,uz,0);In(F_e,xZe,0);In(ol,sz,0);In(ud,ez,0);In(mu,YXe,0);In(sr,az,0);In(ci,qw,0);In(Eh,QV,0);In(ng,dz,0);In(al,FV,0);In(jp,eO,0);In(Ol,hz,0);In(hu,tz,0);In(M_,DZe,0);var Ht;(function(i){const e=new Kk;for(const[l,c]of bie())e.set(l,c);const t=new tO(e,!0);e.set(Ot,t);function n(l){r||s({});const c=e.get(l);if(!c)throw new Error("Missing service "+l);return c instanceof rf?t.invokeFunction(u=>u.get(l)):c}i.get=n;let r=!1;const o=new se;function s(l){if(r)return t;r=!0;for(const[u,d]of bie())e.get(u)||e.set(u,d);for(const u in l)if(l.hasOwnProperty(u)){const d=yn(u);e.get(d)instanceof rf&&e.set(d,l[u])}const c=mZe();for(const u of c)try{t.createInstance(u)}catch(d){en(d)}return o.fire(),t}i.initialize=s;function a(l){if(r)return l();const c=new Te,u=c.add(o.event(()=>{u.dispose(),c.add(l())}));return c}i.withServices=a})(Ht||(Ht={}));class vh{constructor(e,t,n){this.owner=e,this.debugNameSource=t,this.referenceFn=n}getDebugName(e){return IZe(e,this)}}const Nse=new Map,fz=new WeakMap;function IZe(i,e){var t;const n=fz.get(i);if(n)return n;const r=kZe(i,e);if(r){let o=(t=Nse.get(r))!==null&&t!==void 0?t:0;o++,Nse.set(r,o);const s=o===1?r:`${r}#${o}`;return fz.set(i,s),s}}function kZe(i,e){const t=fz.get(i);if(t)return t;const n=e.owner?NZe(e.owner)+".":"";let r;const o=e.debugNameSource;if(o!==void 0)if(typeof o=="function"){if(r=o(),r!==void 0)return n+r}else return n+o;const s=e.referenceFn;if(s!==void 0&&(r=m3(s),r!==void 0))return n+r;if(e.owner!==void 0){const a=TZe(e.owner,i);if(a!==void 0)return n+a}}function TZe(i,e){for(const t in i)if(i[t]===e)return t}const Rse=new Map,Mse=new WeakMap;function NZe(i){var e;const t=Mse.get(i);if(t)return t;const n=RZe(i);let r=(e=Rse.get(n))!==null&&e!==void 0?e:0;r++,Rse.set(n,r);const o=r===1?n:`${n}#${r}`;return Mse.set(i,o),o}function RZe(i){const e=i.constructor;return e?e.name:"Object"}function m3(i){const e=i.toString(),n=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e),r=n?n[1]:void 0;return r==null?void 0:r.trim()}let MZe;function Af(){return MZe}let B0e;function AZe(i){B0e=i}let W0e;function PZe(i){W0e=i}class $0e{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t){const n=t===void 0?void 0:e,r=t===void 0?e:t;return W0e({owner:n,debugName:()=>{const o=m3(r);if(o!==void 0)return o;const a=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(r.toString());if(a)return`${this.debugName}.${a[2]}`;if(!n)return`${this.debugName} (mapped)`}},o=>r(this.read(o),o))}recomputeInitiallyAndOnChange(e,t){return e.add(B0e(this,t)),this}}class iT extends $0e{constructor(){super(...arguments),this.observers=new Set}addObserver(e){const t=this.observers.size;this.observers.add(e),t===0&&this.onFirstObserverAdded()}removeObserver(e){this.observers.delete(e)&&this.observers.size===0&&this.onLastObserverRemoved()}onFirstObserverAdded(){}onLastObserverRemoved(){}}function Ri(i,e){const t=new v3(i,e);try{i(t)}finally{t.finish()}}let HR;function AM(i){if(HR)i(HR);else{const e=new v3(i,void 0);HR=e;try{i(e)}finally{e.finish(),HR=void 0}}}async function OZe(i,e){const t=new v3(i,e);try{await i(t)}finally{t.finish()}}function CI(i,e,t){i?e(i):Ri(e,t)}class v3{constructor(e,t){var n;this._fn=e,this._getDebugName=t,this.updatingObservers=[],(n=Af())===null||n===void 0||n.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():m3(this._fn)}updateObserver(e,t){this.updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){var e;const t=this.updatingObservers;for(let n=0;n{},()=>`Setting ${this.debugName}`));try{const s=this._value;this._setValue(e),(r=Af())===null||r===void 0||r.handleObservableChanged(this,{oldValue:s,newValue:e,change:n,didChange:!0,hadValue:!0});for(const a of this.observers)t.updateObserver(a,this),a.handleChange(this,n)}finally{o&&o.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function yI(i,e){return typeof i=="string"?new Ase(void 0,i,e):new Ase(i,void 0,e)}class Ase extends gz{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){var e;(e=this._value)===null||e===void 0||e.dispose()}}const Xw=(i,e)=>i===e;function Yt(i,e){return e!==void 0?new Yw(new vh(i,void 0,e),e,void 0,void 0,void 0,Xw):new Yw(new vh(void 0,void 0,i),i,void 0,void 0,void 0,Xw)}function Qy(i,e){var t;return new Yw(new vh(i.owner,i.debugName,i.debugReferenceFn),e,void 0,void 0,i.onLastObserverRemoved,(t=i.equalityComparer)!==null&&t!==void 0?t:Xw)}PZe(Qy);function FZe(i,e){var t;return new Yw(new vh(i.owner,i.debugName,void 0),e,i.createEmptyChangeSummary,i.handleChange,void 0,(t=i.equalityComparer)!==null&&t!==void 0?t:Xw)}function OS(i,e){let t,n;e===void 0?(t=i,n=void 0):(n=i,t=e);const r=new Te;return new Yw(new vh(n,void 0,t),o=>(r.clear(),t(o,r)),void 0,void 0,()=>r.dispose(),Xw)}function ym(i,e){let t,n;e===void 0?(t=i,n=void 0):(n=i,t=e);const r=new Te;return new Yw(new vh(n,void 0,t),o=>{r.clear();const s=t(o);return s&&r.add(s),s},void 0,void 0,()=>r.dispose(),Xw)}class Yw extends iT{get debugName(){var e;return(e=this._debugNameData.getDebugName(this))!==null&&e!==void 0?e:"(anonymous)"}constructor(e,t,n,r,o=void 0,s){var a,l;super(),this._debugNameData=e,this._computeFn=t,this.createChangeSummary=n,this._handleChange=r,this._handleLastObserverRemoved=o,this._equalityComparator=s,this.state=0,this.value=void 0,this.updateCount=0,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=void 0,this.changeSummary=(a=this.createChangeSummary)===null||a===void 0?void 0:a.call(this),(l=Af())===null||l===void 0||l.handleDerivedCreated(this)}onLastObserverRemoved(){var e;this.state=0,this.value=void 0;for(const t of this.dependencies)t.removeObserver(this);this.dependencies.clear(),(e=this._handleLastObserverRemoved)===null||e===void 0||e.call(this)}get(){var e;if(this.observers.size===0){const t=this._computeFn(this,(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this));return this.onLastObserverRemoved(),t}else{do{if(this.state===1){for(const t of this.dependencies)if(t.reportChanges(),this.state===2)break}this.state===1&&(this.state=3),this._recomputeIfNeeded()}while(this.state!==3);return this.value}}_recomputeIfNeeded(){var e,t;if(this.state===3)return;const n=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=n;const r=this.state!==0,o=this.value;this.state=3;const s=this.changeSummary;this.changeSummary=(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this);try{this.value=this._computeFn(this,s)}finally{for(const l of this.dependenciesToBeRemoved)l.removeObserver(this);this.dependenciesToBeRemoved.clear()}const a=r&&!this._equalityComparator(o,this.value);if((t=Af())===null||t===void 0||t.handleDerivedRecomputed(this,{oldValue:o,newValue:this.value,change:void 0,didChange:a,hadValue:r}),a)for(const l of this.observers)l.handleChange(this,void 0)}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){this.updateCount++;const t=this.updateCount===1;if(this.state===3&&(this.state=1,!t))for(const n of this.observers)n.handlePossibleChange(this);if(t)for(const n of this.observers)n.beginUpdate(this)}endUpdate(e){if(this.updateCount--,this.updateCount===0){const t=[...this.observers];for(const n of t)n.endUpdate(this)}Ew(()=>this.updateCount>=0)}handlePossibleChange(e){if(this.state===3&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){this.state=1;for(const t of this.observers)t.handlePossibleChange(this)}}handleChange(e,t){if(this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){const n=this._handleChange?this._handleChange({changedObservable:e,change:t,didChange:o=>o===e},this.changeSummary):!0,r=this.state===3;if(n&&(this.state===1||r)&&(this.state=2,r))for(const o of this.observers)o.handlePossibleChange(this)}}readObservable(e){e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}addObserver(e){const t=!this.observers.has(e)&&this.updateCount>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){const t=this.observers.has(e)&&this.updateCount>0;super.removeObserver(e),t&&e.endUpdate(this)}}function bn(i){return new b3(new vh(void 0,void 0,i),i,void 0,void 0)}function _3(i,e){var t;return new b3(new vh(i.owner,i.debugName,(t=i.debugReferenceFn)!==null&&t!==void 0?t:e),e,void 0,void 0)}function rT(i,e){var t;return new b3(new vh(i.owner,i.debugName,(t=i.debugReferenceFn)!==null&&t!==void 0?t:e),e,i.createEmptyChangeSummary,i.handleChange)}function Dh(i){const e=new Te,t=_3({owner:void 0,debugName:void 0,debugReferenceFn:i},n=>{e.clear(),i(n,e)});return Rt(()=>{t.dispose(),e.dispose()})}class b3{get debugName(){var e;return(e=this._debugNameData.getDebugName(this))!==null&&e!==void 0?e:"(anonymous)"}constructor(e,t,n,r){var o,s;this._debugNameData=e,this._runFn=t,this.createChangeSummary=n,this._handleChange=r,this.state=2,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=(o=this.createChangeSummary)===null||o===void 0?void 0:o.call(this),(s=Af())===null||s===void 0||s.handleAutorunCreated(this),this._runIfNeeded()}dispose(){this.disposed=!0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear()}_runIfNeeded(){var e,t,n;if(this.state===3)return;const r=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=r,this.state=3;const o=this.disposed;try{if(!o){(e=Af())===null||e===void 0||e.handleAutorunTriggered(this);const s=this.changeSummary;this.changeSummary=(t=this.createChangeSummary)===null||t===void 0?void 0:t.call(this),this._runFn(this,s)}}finally{o||(n=Af())===null||n===void 0||n.handleAutorunFinished(this);for(const s of this.dependenciesToBeRemoved)s.removeObserver(this);this.dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(){this.state===3&&(this.state=1),this.updateCount++}endUpdate(){if(this.updateCount===1)do{if(this.state===1){this.state=3;for(const e of this.dependencies)if(e.reportChanges(),this.state===2)break}this._runIfNeeded()}while(this.state!==3);this.updateCount--,Ew(()=>this.updateCount>=0)}handlePossibleChange(e){this.state===3&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(this.state=1)}handleChange(e,t){this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(!this._handleChange||this._handleChange({changedObservable:e,change:t,didChange:r=>r===e},this.changeSummary))&&(this.state=2)}readObservable(e){if(this.disposed)return e.get();e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}}(function(i){i.Observer=b3})(bn||(bn={}));function ap(i){return new BZe(i)}class BZe extends $0e{constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}toString(){return`Const: ${this.value}`}}function Vi(i,e){return new K0(i,e)}class K0 extends iT{constructor(e,t){super(),this.event=e,this._getValue=t,this.hasValue=!1,this.handleEvent=n=>{var r;const o=this._getValue(n),s=this.value,a=!this.hasValue||s!==o;let l=!1;a&&(this.value=o,this.hasValue&&(l=!0,CI(K0.globalTransaction,c=>{var u;(u=Af())===null||u===void 0||u.handleFromEventObservableTriggered(this,{oldValue:s,newValue:o,change:void 0,didChange:a,hadValue:this.hasValue});for(const d of this.observers)c.updateObserver(d,this),d.handleChange(this,void 0)},()=>{const c=this.getDebugName();return"Event fired"+(c?`: ${c}`:"")})),this.hasValue=!0),l||(r=Af())===null||r===void 0||r.handleFromEventObservableTriggered(this,{oldValue:s,newValue:o,change:void 0,didChange:a,hadValue:this.hasValue})}}getDebugName(){return m3(this._getValue)}get debugName(){const e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0,this.hasValue=!1,this.value=void 0}get(){return this.subscription?(this.hasValue||this.handleEvent(void 0),this.value):this._getValue(void 0)}}(function(i){i.Observer=K0;function e(t,n){let r=!1;K0.globalTransaction===void 0&&(K0.globalTransaction=t,r=!0);try{n()}finally{r&&(K0.globalTransaction=void 0)}}i.batchEventsGlobally=e})(Vi||(Vi={}));function ma(i,e){return new WZe(i,e)}class WZe extends iT{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{Ri(n=>{for(const r of this.observers)n.updateObserver(r,this),r.handleChange(this,void 0)},()=>this.debugName)}}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}function pY(i){return typeof i=="string"?new Pse(i):new Pse(void 0,i)}class Pse extends iT{get debugName(){var e;return(e=new vh(this._owner,this._debugName,void 0).getDebugName(this))!==null&&e!==void 0?e:"Observable Signal"}constructor(e,t){super(),this._debugName=e,this._owner=t}trigger(e,t){if(!e){Ri(n=>{this.trigger(n,t)},()=>`Trigger signal ${this.debugName}`);return}for(const n of this.observers)e.updateObserver(n,this),n.handleChange(this,t)}get(){}}function oT(i,e){const t=new $Ze(!0,e);return i.addObserver(t),e?e(i.get()):i.reportChanges(),Rt(()=>{i.removeObserver(t)})}AZe(oT);class $Ze{constructor(e,t){this._forceRecompute=e,this._handleValue=t,this._counter=0}beginUpdate(e){this._counter++}endUpdate(e){this._counter--,this._counter===0&&this._forceRecompute&&(this._handleValue?this._handleValue(e.get()):e.reportChanges())}handlePossibleChange(e){}handleChange(e,t){}}function HZe(i){let e;return Yt(n=>(e=i(n,e),e))}function VZe(i,e,t,n){let r=new Ose(t,n);return Qy({debugReferenceFn:t,owner:i,onLastObserverRemoved:()=>{r.dispose(),r=new Ose(t)}},s=>(r.setItems(e.read(s)),r.getItems()))}class Ose{constructor(e,t){this._map=e,this._keySelector=t,this._cache=new Map,this._items=[]}dispose(){this._cache.forEach(e=>e.store.dispose()),this._cache.clear()}setItems(e){const t=[],n=new Set(this._cache.keys());for(const r of e){const o=this._keySelector?this._keySelector(r):r;let s=this._cache.get(o);if(s)n.delete(o);else{const a=new Te;s={out:this._map(r,a),store:a},this._cache.set(o,s)}t.push(s.out)}for(const r of n)this._cache.get(r).store.dispose(),this._cache.delete(r);this._items=t}getItems(){return this._items}}function zZe(i,e,t){return new Promise((n,r)=>{let o=!0,s=!1;const a=i.map(c=>({isFinished:e(c),error:t?t(c):!1,state:c})),l=bn(c=>{const{isFinished:u,error:d,state:h}=a.read(c);(u||d)&&(o?s=!0:l.dispose(),d?r(d===!0?h:d):n(h))});o=!1,s&&l.dispose()})}class _h{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new _h(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,n=0;const r=e.getVisibleRanges();if(r.length>0){t=r[0].getStartPosition();const o=e.getTopForPosition(t.lineNumber,t.column);n=e.getScrollTop()-o}return new _h(e.getScrollTop(),e.getContentHeight(),t,n,e.getPosition())}constructor(e,t,n,r,o){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=n,this._visiblePositionScrollDelta=r,this._cursorPosition=o}restore(e){if(!(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())&&this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){if(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())return;const t=e.getPosition();if(!this._cursorPosition||!t)return;const n=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+n)}}function mY(){return s$&&!!s$.VSCODE_DEV}function H0e(i){if(mY()){const e=UZe();return e.add(i),{dispose(){e.delete(i)}}}else return{dispose(){}}}function UZe(){VR||(VR=new Set);const i=globalThis;return i.$hotReload_applyNewExports||(i.$hotReload_applyNewExports=e=>{const t={config:{mode:void 0},...e};for(const n of VR){const r=n(t);if(r)return r}}),VR}let VR;mY()&&H0e(({oldExports:i,newSrc:e,config:t})=>{if(t.mode==="patch-prototype")return n=>{var r,o;for(const s in n){const a=n[s];if(console.log(`[hot-reload] Patching prototype methods of '${s}'`,{exportedItem:a}),typeof a=="function"&&a.prototype){const l=i[s];if(l){for(const c of Object.getOwnPropertyNames(a.prototype)){const u=Object.getOwnPropertyDescriptor(a.prototype,c),d=Object.getOwnPropertyDescriptor(l.prototype,c);((r=u==null?void 0:u.value)===null||r===void 0?void 0:r.toString())!==((o=d==null?void 0:d.value)===null||o===void 0?void 0:o.toString())&&console.log(`[hot-reload] Patching prototype method '${s}.${c}'`),Object.defineProperty(l.prototype,c,u)}n[s]=l}}}return!0}});function jZe(i,e,t,n){if(i.length===0)return e;if(e.length===0)return i;const r=[];let o=0,s=0;for(;ou?(r.push(l),s++):(r.push(n(a,l)),o++,s++)}for(;o`Apply decorations from ${e.debugName}`},r=>{const o=e.read(r);n.set(o)})),t.add({dispose:()=>{n.clear()}}),t}function zR(i,e){return i.appendChild(e),Rt(()=>{i.removeChild(e)})}class V0e extends fe{get width(){return this._width}get height(){return this._height}constructor(e,t){super(),this.elementSizeObserver=this._register(new Yme(e,t)),this._width=Hn(this,this.elementSizeObserver.getWidth()),this._height=Hn(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(n=>Ri(r=>{this._width.set(this.elementSizeObserver.getWidth(),r),this._height.set(this.elementSizeObserver.getHeight(),r)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function Fse(i,e,t){let n=e.get(),r=n,o=n;const s=Hn("animatedValue",n);let a=-1;const l=300;let c;t.add(rT({createEmptyChangeSummary:()=>({animate:!1}),handleChange:(d,h)=>(d.didChange(e)&&(h.animate=h.animate||d.change),!0)},(d,h)=>{c!==void 0&&(i.cancelAnimationFrame(c),c=void 0),r=o,n=e.read(d),a=Date.now()-(h.animate?0:l),u()}));function u(){const d=Date.now()-a;o=Math.floor(KZe(d,r,n-r,l)),d{this._actualTop.set(n,void 0)},this.onComputedHeight=n=>{this._actualHeight.set(n,void 0)}}}class C3{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${C3._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}}C3._counter=0;function Ev(i,e){return bn(t=>{for(let[n,r]of Object.entries(e))r&&typeof r=="object"&&"read"in r&&(r=r.read(t)),typeof r=="number"&&(r=`${r}px`),n=n.replace(/[A-Z]/g,o=>"-"+o.toLowerCase()),i.style[n]=r})}function sf(i,e){return GZe([i],e),i}function GZe(i,e){mY()&&ma("reload",n=>H0e(({oldExports:r})=>{if([...Object.values(r)].some(o=>i.includes(o)))return o=>(n(void 0),!0)})).read(e)}function oO(i,e,t,n){const r=new Te,o=[];return r.add(Dh((s,a)=>{const l=e.read(s),c=new Map,u=new Map;t&&t(!0),i.changeViewZones(d=>{for(const h of o)d.removeZone(h),n==null||n.delete(h);o.length=0;for(const h of l){const f=d.addZone(h);h.setZoneId&&h.setZoneId(f),o.push(f),n==null||n.add(f),c.set(h,f)}}),t&&t(!1),a.add(rT({createEmptyChangeSummary(){return{zoneIds:[]}},handleChange(d,h){const f=u.get(d.changedObservable);return f!==void 0&&h.zoneIds.push(f),!0}},(d,h)=>{for(const f of l)f.onChange&&(u.set(f.onChange,c.get(f)),f.onChange.read(d));t&&t(!0),i.changeViewZones(f=>{for(const g of h.zoneIds)f.layoutZone(g)}),t&&t(!1)}))})),r.add({dispose(){t&&t(!0),i.changeViewZones(s=>{for(const a of o)s.removeZone(a)}),n==null||n.clear(),t&&t(!1)}}),r}class qZe extends wr{dispose(){super.dispose(!0)}}function Bse(i,e){const t=RD(e,r=>r.original.startLineNumber<=i.lineNumber);if(!t)return B.fromPositions(i);if(t.original.endLineNumberExclusive<=i.lineNumber){const r=i.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return B.fromPositions(new ae(r,i.column))}if(!t.innerChanges)return B.fromPositions(new ae(t.modified.startLineNumber,1));const n=RD(t.innerChanges,r=>r.originalRange.getStartPosition().isBeforeOrEqual(i));if(!n){const r=i.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return B.fromPositions(new ae(r,i.column))}if(n.originalRange.containsPosition(i))return n.modifiedRange;{const r=XZe(n.originalRange.getEndPosition(),i);return B.fromPositions(YZe(n.modifiedRange.getEndPosition(),r))}}function XZe(i,e){return i.lineNumber===e.lineNumber?new YD(0,e.column-i.column):new YD(e.lineNumber-i.lineNumber,e.column-1)}function YZe(i,e){return e.lineCount===0?new ae(i.lineNumber,i.column+e.columnCount):new ae(i.lineNumber+e.lineCount,e.columnCount+1)}function UR(i,e,t){const n=i.bindTo(e);return _3({debugName:()=>`Set Context Key "${i.key}"`},r=>{n.set(t(r))})}function ZZe(i,e){let t;return i.filter(n=>{const r=e(n,t);return t=n,r})}var vY=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},_Y=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const QZe=Mr("diff-review-insert",Xe.add,w("accessibleDiffViewerInsertIcon","Icon for 'Insert' in accessible diff viewer.")),JZe=Mr("diff-review-remove",Xe.remove,w("accessibleDiffViewerRemoveIcon","Icon for 'Remove' in accessible diff viewer.")),eQe=Mr("diff-review-close",Xe.close,w("accessibleDiffViewerCloseIcon","Icon for 'Close' in accessible diff viewer."));let Qm=class extends fe{constructor(e,t,n,r,o,s,a,l,c){super(),this._parentNode=e,this._visible=t,this._setVisible=n,this._canClose=r,this._width=o,this._height=s,this._diffs=a,this._models=l,this._instantiationService=c,this._state=OS(this,(u,d)=>{const h=this._visible.read(u);if(this._parentNode.style.visibility=h?"visible":"hidden",!h)return null;const f=d.add(this._instantiationService.createInstance(pz,this._diffs,this._models,this._setVisible,this._canClose)),g=d.add(this._instantiationService.createInstance(mz,this._parentNode,f,this._width,this._height,this._models));return{model:f,view:g}}).recomputeInitiallyAndOnChange(this._store)}next(){Ri(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this._state.get().model.nextGroup(e)})}prev(){Ri(e=>{this._setVisible(!0,e),this._state.get().model.previousGroup(e)})}close(){Ri(e=>{this._setVisible(!1,e)})}};Qm._ttPolicy=Hp("diffReview",{createHTML:i=>i});Qm=vY([_Y(8,Ot)],Qm);let pz=class extends fe{constructor(e,t,n,r,o){super(),this._diffs=e,this._models=t,this._setVisible=n,this.canClose=r,this._accessibilitySignalService=o,this._groups=Hn(this,[]),this._currentGroupIdx=Hn(this,0),this._currentElementIdx=Hn(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((s,a)=>this._groups.read(a)[s]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((s,a)=>{var l;return(l=this.currentGroup.read(a))===null||l===void 0?void 0:l.lines[s]}),this._register(bn(s=>{const a=this._diffs.read(s);if(!a){this._groups.set([],void 0);return}const l=tQe(a,this._models.getOriginalModel().getLineCount(),this._models.getModifiedModel().getLineCount());Ri(c=>{const u=this._models.getModifiedPosition();if(u){const d=l.findIndex(h=>(u==null?void 0:u.lineNumber){const a=this.currentElement.read(s);(a==null?void 0:a.type)===ga.Deleted?this._accessibilitySignalService.playSignal(cn.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):(a==null?void 0:a.type)===ga.Added&&this._accessibilitySignalService.playSignal(cn.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(bn(s=>{var a;const l=this.currentElement.read(s);if(l&&l.type!==ga.Header){const c=(a=l.modifiedLineNumber)!==null&&a!==void 0?a:l.diff.modified.startLineNumber;this._models.modifiedSetSelection(B.fromPositions(new ae(c,1)))}}))}_goToGroupDelta(e,t){const n=this.groups.get();!n||n.length<=1||CI(t,r=>{this._currentGroupIdx.set(vn.ofLength(n.length).clipCyclic(this._currentGroupIdx.get()+e),r),this._currentElementIdx.set(0,r)})}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){const t=this.currentGroup.get();!t||t.lines.length<=1||Ri(n=>{this._currentElementIdx.set(vn.ofLength(t.lines.length).clip(this._currentElementIdx.get()+e),n)})}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(e){const t=this.currentGroup.get();if(!t)return;const n=t.lines.indexOf(e);n!==-1&&Ri(r=>{this._currentElementIdx.set(n,r)})}revealCurrentElementInEditor(){if(!this.canClose.get())return;this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===ga.Deleted?this._models.originalReveal(B.fromPositions(new ae(e.originalLineNumber,1))):this._models.modifiedReveal(e.type!==ga.Header?B.fromPositions(new ae(e.modifiedLineNumber,1)):void 0))}close(){this.canClose.get()&&(this._setVisible(!1,void 0),this._models.modifiedFocus())}};pz=vY([_Y(4,M_)],pz);const Gx=3;function tQe(i,e,t){const n=[];for(const r of QG(i,(o,s)=>s.modified.startLineNumber-o.modified.endLineNumberExclusive<2*Gx)){const o=[];o.push(new iQe);const s=new pn(Math.max(1,r[0].original.startLineNumber-Gx),Math.min(r[r.length-1].original.endLineNumberExclusive+Gx,e+1)),a=new pn(Math.max(1,r[0].modified.startLineNumber-Gx),Math.min(r[r.length-1].modified.endLineNumberExclusive+Gx,t+1));Jge(r,(u,d)=>{const h=new pn(u?u.original.endLineNumberExclusive:s.startLineNumber,d?d.original.startLineNumber:s.endLineNumberExclusive),f=new pn(u?u.modified.endLineNumberExclusive:a.startLineNumber,d?d.modified.startLineNumber:a.endLineNumberExclusive);h.forEach(g=>{o.push(new sQe(g,f.startLineNumber+(g-h.startLineNumber)))}),d&&(d.original.forEach(g=>{o.push(new rQe(d,g))}),d.modified.forEach(g=>{o.push(new oQe(d,g))}))});const l=r[0].modified.join(r[r.length-1].modified),c=r[0].original.join(r[r.length-1].original);n.push(new nQe(new Ya(l,c),o))}return n}var ga;(function(i){i[i.Header=0]="Header",i[i.Unchanged=1]="Unchanged",i[i.Deleted=2]="Deleted",i[i.Added=3]="Added"})(ga||(ga={}));class nQe{constructor(e,t){this.range=e,this.lines=t}}class iQe{constructor(){this.type=ga.Header}}class rQe{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=ga.Deleted,this.modifiedLineNumber=void 0}}class oQe{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=ga.Added,this.originalLineNumber=void 0}}class sQe{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=ga.Unchanged}}let mz=class extends fe{constructor(e,t,n,r,o,s){super(),this._element=e,this._model=t,this._width=n,this._height=r,this._models=o,this._languageService=s,this.domNode=this._element,this.domNode.className="monaco-component diff-review monaco-editor-background";const a=document.createElement("div");a.className="diff-review-actions",this._actionBar=this._register(new au(a)),this._register(bn(l=>{this._actionBar.clear(),this._model.canClose.read(l)&&this._actionBar.push(new xl("diffreview.close",w("label.close","Close"),"close-diff-review "+Wt.asClassName(eQe),!0,async()=>t.close()),{label:!1,icon:!0})})),this._content=document.createElement("div"),this._content.className="diff-review-content",this._content.setAttribute("role","code"),this._scrollbar=this._register(new Hk(this._content,{})),gs(this.domNode,this._scrollbar.getDomNode(),a),this._register(bn(l=>{this._height.read(l),this._width.read(l),this._scrollbar.scanDomNode()})),this._register(Rt(()=>{gs(this.domNode)})),this._register(Ev(this.domNode,{width:this._width,height:this._height})),this._register(Ev(this._content,{width:this._width,height:this._height})),this._register(Dh((l,c)=>{this._model.currentGroup.read(l),this._render(c)})),this._register(Sr(this.domNode,"keydown",l=>{(l.equals(18)||l.equals(2066)||l.equals(530))&&(l.preventDefault(),this._model.goToNextLine()),(l.equals(16)||l.equals(2064)||l.equals(528))&&(l.preventDefault(),this._model.goToPreviousLine()),(l.equals(9)||l.equals(2057)||l.equals(521)||l.equals(1033))&&(l.preventDefault(),this._model.close()),(l.equals(10)||l.equals(3))&&(l.preventDefault(),this._model.revealCurrentElementInEditor())}))}_render(e){const t=this._models.getOriginalOptions(),n=this._models.getModifiedOptions(),r=document.createElement("div");r.className="diff-review-table",r.setAttribute("role","list"),r.setAttribute("aria-label",w("ariaLabel","Accessible Diff Viewer. Use arrow up and down to navigate.")),ps(r,n.get(50)),gs(this._content,r);const o=this._models.getOriginalModel(),s=this._models.getModifiedModel();if(!o||!s)return;const a=o.getOptions(),l=s.getOptions(),c=n.get(67),u=this._model.currentGroup.get();for(const d of(u==null?void 0:u.lines)||[]){if(!u)break;let h;if(d.type===ga.Header){const g=document.createElement("div");g.className="diff-review-row",g.setAttribute("role","listitem");const p=u.range,v=this._model.currentGroupIndex.get(),m=this._model.groups.get().length,_=E=>E===0?w("no_lines_changed","no lines changed"):E===1?w("one_line_changed","1 line changed"):w("more_lines_changed","{0} lines changed",E),y=_(p.original.length),S=_(p.modified.length);g.setAttribute("aria-label",w({key:"header",comment:["This is the ARIA label for a git diff header.","A git diff header looks like this: @@ -154,12 +159,39 @@.","That encodes that at original line 154 (which is now line 159), 12 lines were removed/changed with 39 lines.","Variables 0 and 1 refer to the diff index out of total number of diffs.","Variables 2 and 4 will be numbers (a line number).",'Variables 3 and 5 will be "no lines changed", "1 line changed" or "X lines changed", localized separately.']},"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",v+1,m,p.original.startLineNumber,y,p.modified.startLineNumber,S));const L=document.createElement("div");L.className="diff-review-cell diff-review-summary",L.appendChild(document.createTextNode(`${v+1}/${m}: @@ -${p.original.startLineNumber},${p.original.length} +${p.modified.startLineNumber},${p.modified.length} @@`)),g.appendChild(L),h=g}else h=this._createRow(d,c,this._width.get(),t,o,a,n,s,l);r.appendChild(h);const f=Yt(g=>this._model.currentElement.read(g)===d);e.add(bn(g=>{const p=f.read(g);h.tabIndex=p?0:-1,p&&h.focus()})),e.add(ye(h,"focus",()=>{this._model.goToLine(d)}))}this._scrollbar.scanDomNode()}_createRow(e,t,n,r,o,s,a,l,c){const u=r.get(144),d=u.glyphMarginWidth+u.lineNumbersWidth,h=a.get(144),f=10+h.glyphMarginWidth+h.lineNumbersWidth;let g="diff-review-row",p="";const v="diff-review-spacer";let m=null;switch(e.type){case ga.Added:g="diff-review-row line-insert",p=" char-insert",m=QZe;break;case ga.Deleted:g="diff-review-row line-delete",p=" char-delete",m=JZe;break}const _=document.createElement("div");_.style.minWidth=n+"px",_.className=g,_.setAttribute("role","listitem"),_.ariaLevel="";const y=document.createElement("div");y.className="diff-review-cell",y.style.height=`${t}px`,_.appendChild(y);const S=document.createElement("span");S.style.width=d+"px",S.style.minWidth=d+"px",S.className="diff-review-line-number"+p,e.originalLineNumber!==void 0?S.appendChild(document.createTextNode(String(e.originalLineNumber))):S.innerText=" ",y.appendChild(S);const L=document.createElement("span");L.style.width=f+"px",L.style.minWidth=f+"px",L.style.paddingRight="10px",L.className="diff-review-line-number"+p,e.modifiedLineNumber!==void 0?L.appendChild(document.createTextNode(String(e.modifiedLineNumber))):L.innerText=" ",y.appendChild(L);const E=document.createElement("span");if(E.className=v,m){const T=document.createElement("span");T.className=Wt.asClassName(m),T.innerText="  ",E.appendChild(T)}else E.innerText="  ";y.appendChild(E);let D;if(e.modifiedLineNumber!==void 0){let T=this._getLineHtml(l,a,c.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);Qm._ttPolicy&&(T=Qm._ttPolicy.createHTML(T)),y.insertAdjacentHTML("beforeend",T),D=l.getLineContent(e.modifiedLineNumber)}else{let T=this._getLineHtml(o,r,s.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);Qm._ttPolicy&&(T=Qm._ttPolicy.createHTML(T)),y.insertAdjacentHTML("beforeend",T),D=o.getLineContent(e.originalLineNumber)}D.length===0&&(D=w("blankLine","blank"));let k="";switch(e.type){case ga.Unchanged:e.originalLineNumber===e.modifiedLineNumber?k=w({key:"unchangedLine",comment:["The placeholders are contents of the line and should not be translated."]},"{0} unchanged line {1}",D,e.originalLineNumber):k=w("equalLine","{0} original line {1} modified line {2}",D,e.originalLineNumber,e.modifiedLineNumber);break;case ga.Added:k=w("insertLine","+ {0} modified line {1}",D,e.modifiedLineNumber);break;case ga.Deleted:k=w("deleteLine","- {0} original line {1}",D,e.originalLineNumber);break}return _.setAttribute("aria-label",k),_}_getLineHtml(e,t,n,r,o){const s=e.getLineContent(r),a=t.get(50),l=Lo.createEmpty(s,o),c=vc.isBasicASCII(s,e.mightContainNonBasicASCII()),u=vc.containsRTL(s,c,e.mightContainRTL());return N4(new I_(a.isMonospace&&!t.get(33),a.canUseHalfwidthRightwardsArrow,s,!1,c,u,0,l,[],n,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,t.get(117),t.get(99),t.get(94),t.get(51)!==ic.OFF,null)).html}};mz=vY([_Y(5,ji)],mz);class aQe{constructor(e){this.editors=e}getOriginalModel(){return this.editors.original.getModel()}getOriginalOptions(){return this.editors.original.getOptions()}originalReveal(e){this.editors.original.revealRange(e),this.editors.original.setSelection(e),this.editors.original.focus()}getModifiedModel(){return this.editors.modified.getModel()}getModifiedOptions(){return this.editors.modified.getOptions()}modifiedReveal(e){e&&(this.editors.modified.revealRange(e),this.editors.modified.setSelection(e)),this.editors.modified.focus()}modifiedSetSelection(e){this.editors.modified.setSelection(e)}modifiedFocus(){this.editors.modified.focus()}getModifiedPosition(){var e;return(e=this.editors.modified.getPosition())!==null&&e!==void 0?e:void 0}}class Dv extends fe{constructor(e,t,n,r,o){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=n,this._modifiedEditorLayoutInfo=r,this._editors=o,this._originalScrollTop=Vi(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Vi(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=ma("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=Hn(this,0),this._modifiedViewZonesChangedSignal=ma("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=ma("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=OS(this,(u,d)=>{var h;this._element.replaceChildren();const f=this._diffModel.read(u),g=(h=f==null?void 0:f.diff.read(u))===null||h===void 0?void 0:h.movedTexts;if(!g||g.length===0){this.width.set(0,void 0);return}this._viewZonesChanged.read(u);const p=this._originalEditorLayoutInfo.read(u),v=this._modifiedEditorLayoutInfo.read(u);if(!p||!v){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(u),this._originalViewZonesChangedSignal.read(u);const m=g.map(k=>{function T(U,K){const re=K.getTopForLineNumber(U.startLineNumber,!0),Y=K.getTopForLineNumber(U.endLineNumberExclusive,!0);return(re+Y)/2}const M=T(k.lineRangeMapping.original,this._editors.original),A=this._originalScrollTop.read(u),N=T(k.lineRangeMapping.modified,this._editors.modified),R=this._modifiedScrollTop.read(u),F=M-A,W=N-R,H=Math.min(M,N),G=Math.max(M,N);return{range:new vn(H,G),from:F,to:W,fromWithoutScroll:M,toWithoutScroll:N,move:k}});m.sort(O4e(Jc(k=>k.fromWithoutScroll>k.toWithoutScroll,F4e),Jc(k=>k.fromWithoutScroll>k.toWithoutScroll?k.fromWithoutScroll:-k.toWithoutScroll,dp)));const _=bY.compute(m.map(k=>k.range)),y=10,S=p.verticalScrollbarWidth,L=(_.getTrackCount()-1)*10+y*2,E=S+L+(v.contentLeft-Dv.movedCodeBlockPadding);let D=0;for(const k of m){const T=_.getTrack(D),M=S+y+T*10,A=15,N=15,R=E,F=v.glyphMarginWidth+v.lineNumbersWidth,W=18,H=document.createElementNS("http://www.w3.org/2000/svg","rect");H.classList.add("arrow-rectangle"),H.setAttribute("x",`${R-F}`),H.setAttribute("y",`${k.to-W/2}`),H.setAttribute("width",`${F}`),H.setAttribute("height",`${W}`),this._element.appendChild(H);const G=document.createElementNS("http://www.w3.org/2000/svg","g"),U=document.createElementNS("http://www.w3.org/2000/svg","path");U.setAttribute("d",`M 0 ${k.from} L ${M} ${k.from} L ${M} ${k.to} L ${R-N} ${k.to}`),U.setAttribute("fill","none"),G.appendChild(U);const K=document.createElementNS("http://www.w3.org/2000/svg","polygon");K.classList.add("arrow"),d.add(bn(re=>{U.classList.toggle("currentMove",k.move===f.activeMovedText.read(re)),K.classList.toggle("currentMove",k.move===f.activeMovedText.read(re))})),K.setAttribute("points",`${R-N},${k.to-A/2} ${R},${k.to} ${R-N},${k.to+A/2}`),G.appendChild(K),this._element.appendChild(G),D++}this.width.set(L,void 0)}),this._element=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("class","moved-blocks-lines"),this._rootElement.appendChild(this._element),this._register(Rt(()=>this._element.remove())),this._register(bn(u=>{const d=this._originalEditorLayoutInfo.read(u),h=this._modifiedEditorLayoutInfo.read(u);!d||!h||(this._element.style.left=`${d.width-d.verticalScrollbarWidth}px`,this._element.style.height=`${d.height}px`,this._element.style.width=`${d.verticalScrollbarWidth+d.contentLeft-Dv.movedCodeBlockPadding+this.width.read(u)}px`)})),this._register(oT(this._state));const s=Yt(u=>{const d=this._diffModel.read(u),h=d==null?void 0:d.diff.read(u);return h?h.movedTexts.map(f=>({move:f,original:new rO(ap(f.lineRangeMapping.original.startLineNumber-1),18),modified:new rO(ap(f.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(oO(this._editors.original,s.map(u=>u.map(d=>d.original)))),this._register(oO(this._editors.modified,s.map(u=>u.map(d=>d.modified)))),this._register(Dh((u,d)=>{const h=s.read(u);for(const f of h)d.add(new Wse(this._editors.original,f.original,f.move,"original",this._diffModel.get())),d.add(new Wse(this._editors.modified,f.modified,f.move,"modified",this._diffModel.get()))}));const a=ma("original.onDidFocusEditorWidget",u=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>u(void 0),0))),l=ma("modified.onDidFocusEditorWidget",u=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>u(void 0),0)));let c="modified";this._register(rT({createEmptyChangeSummary:()=>{},handleChange:(u,d)=>(u.didChange(a)&&(c="original"),u.didChange(l)&&(c="modified"),!0)},u=>{a.read(u),l.read(u);const d=this._diffModel.read(u);if(!d)return;const h=d.diff.read(u);let f;if(h&&c==="original"){const g=this._editors.originalCursor.read(u);g&&(f=h.movedTexts.find(p=>p.lineRangeMapping.original.contains(g.lineNumber)))}if(h&&c==="modified"){const g=this._editors.modifiedCursor.read(u);g&&(f=h.movedTexts.find(p=>p.lineRangeMapping.modified.contains(g.lineNumber)))}f!==d.movedTextToCompare.get()&&d.movedTextToCompare.set(void 0,void 0),d.setActiveMovedText(f)}))}}Dv.movedCodeBlockPadding=4;class bY{static compute(e){const t=[],n=[];for(const r of e){let o=t.findIndex(s=>!s.intersectsStrict(r));o===-1&&(t.length>=6?o=c9e(t,Jc(a=>a.intersectWithRangeLength(r),dp)):(o=t.length,t.push(new Fq))),t[o].addRange(r),n.push(o)}return new bY(t.length,n)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class Wse extends z0e{constructor(e,t,n,r,o){const s=gi("div.diff-hidden-lines-widget");super(e,t,s.root),this._editor=e,this._move=n,this._kind=r,this._diffModel=o,this._nodes=gi("div.diff-moved-code-block",{style:{marginRight:"4px"}},[gi("div.text-content@textContent"),gi("div.action-bar@actionBar")]),s.root.appendChild(this._nodes.root);const a=Vi(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(Ev(this._nodes.root,{paddingRight:a.map(h=>h.verticalScrollbarWidth)}));let l;n.changes.length>0?l=this._kind==="original"?w("codeMovedToWithChanges","Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):w("codeMovedFromWithChanges","Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):l=this._kind==="original"?w("codeMovedTo","Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):w("codeMovedFrom","Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const c=this._register(new au(this._nodes.actionBar,{highlightToggledItems:!0})),u=new xl("",l,"",!1);c.push(u,{icon:!1,label:!0});const d=new xl("","Compare",Wt.asClassName(Xe.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===n?void 0:this._move,void 0)});this._register(bn(h=>{const f=this._diffModel.movedTextToCompare.read(h)===n;d.checked=f})),c.push(d,{icon:!1,label:!0})}}X("diffEditor.move.border",{dark:"#8b8b8b9c",light:"#8b8b8b9c",hcDark:"#8b8b8b9c",hcLight:"#8b8b8b9c"},w("diffEditor.move.border","The border color for text that got moved in the diff editor."));X("diffEditor.moveActive.border",{dark:"#FFA500",light:"#FFA500",hcDark:"#FFA500",hcLight:"#FFA500"},w("diffEditor.moveActive.border","The active border color for text that got moved in the diff editor."));X("diffEditor.unchangedRegionShadow",{dark:"#000000",light:"#737373BF",hcDark:"#000000",hcLight:"#737373BF"},w("diffEditor.unchangedRegionShadow","The color of the shadow around unchanged region widgets."));const lQe=Mr("diff-insert",Xe.add,w("diffInsertIcon","Line decoration for inserts in the diff editor.")),U0e=Mr("diff-remove",Xe.remove,w("diffRemoveIcon","Line decoration for removals in the diff editor.")),$se=sn.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+Wt.asClassName(lQe),marginClassName:"gutter-insert"}),Hse=sn.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+Wt.asClassName(U0e),marginClassName:"gutter-delete"}),Vse=sn.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),zse=sn.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),Use=sn.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),cQe=sn.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),uQe=sn.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),vz=sn.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),dQe=sn.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),hQe=sn.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"});class fQe extends fe{constructor(e,t,n,r){super(),this._editors=e,this._diffModel=t,this._options=n,this._decorations=Yt(this,o=>{var s;const a=(s=this._diffModel.read(o))===null||s===void 0?void 0:s.diff.read(o);if(!a)return null;const l=this._diffModel.read(o).movedTextToCompare.read(o),c=this._options.renderIndicators.read(o),u=this._options.showEmptyDecorations.read(o),d=[],h=[];if(!l)for(const g of a.mappings)if(g.lineRangeMapping.original.isEmpty||d.push({range:g.lineRangeMapping.original.toInclusiveRange(),options:c?Hse:zse}),g.lineRangeMapping.modified.isEmpty||h.push({range:g.lineRangeMapping.modified.toInclusiveRange(),options:c?$se:Vse}),g.lineRangeMapping.modified.isEmpty||g.lineRangeMapping.original.isEmpty)g.lineRangeMapping.original.isEmpty||d.push({range:g.lineRangeMapping.original.toInclusiveRange(),options:dQe}),g.lineRangeMapping.modified.isEmpty||h.push({range:g.lineRangeMapping.modified.toInclusiveRange(),options:cQe});else for(const p of g.lineRangeMapping.innerChanges||[])g.lineRangeMapping.original.contains(p.originalRange.startLineNumber)&&d.push({range:p.originalRange,options:p.originalRange.isEmpty()&&u?hQe:vz}),g.lineRangeMapping.modified.contains(p.modifiedRange.startLineNumber)&&h.push({range:p.modifiedRange,options:p.modifiedRange.isEmpty()&&u?uQe:Use});if(l)for(const g of l.changes){const p=g.original.toInclusiveRange();p&&d.push({range:p,options:c?Hse:zse});const v=g.modified.toInclusiveRange();v&&h.push({range:v,options:c?$se:Vse});for(const m of g.innerChanges||[])d.push({range:m.originalRange,options:vz}),h.push({range:m.modifiedRange,options:Use})}const f=this._diffModel.read(o).activeMovedText.read(o);for(const g of a.movedTexts)d.push({range:g.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(g===f?" currentMove":""),blockPadding:[Dv.movedCodeBlockPadding,0,Dv.movedCodeBlockPadding,Dv.movedCodeBlockPadding]}}),h.push({range:g.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(g===f?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:d,modifiedDecorations:h}}),this._register(iO(this._editors.original,this._decorations.map(o=>(o==null?void 0:o.originalDecorations)||[]))),this._register(iO(this._editors.modified,this._decorations.map(o=>(o==null?void 0:o.modifiedDecorations)||[])))}}class gQe extends fe{constructor(e,t,n,r){super(),this._options=e,this._domNode=t,this._dimensions=n,this._sashes=r,this._sashRatio=Hn(this,void 0),this.sashLeft=Yt(this,o=>{var s;const a=(s=this._sashRatio.read(o))!==null&&s!==void 0?s:this._options.splitViewDefaultRatio.read(o);return this._computeSashLeft(a,o)}),this._sash=this._register(new Ls(this._domNode,{getVerticalSashTop:o=>0,getVerticalSashLeft:o=>this.sashLeft.get(),getVerticalSashHeight:o=>this._dimensions.height.get()},{orientation:0})),this._startSashPosition=void 0,this._register(this._sash.onDidStart(()=>{this._startSashPosition=this.sashLeft.get()})),this._register(this._sash.onDidChange(o=>{const s=this._dimensions.width.get(),a=this._computeSashLeft((this._startSashPosition+(o.currentX-o.startX))/s,void 0);this._sashRatio.set(a/s,void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._sashRatio.set(void 0,void 0))),this._register(bn(o=>{const s=this._sashes.read(o);s&&(this._sash.orthogonalEndSash=s.bottom)})),this._register(bn(o=>{const s=this._options.enableSplitViewResizing.read(o);this._sash.state=s?3:0,this.sashLeft.read(o),this._dimensions.height.read(o),this._sash.layout()}))}_computeSashLeft(e,t){const n=this._dimensions.width.read(t),r=Math.floor(this._options.splitViewDefaultRatio.read(t)*n),o=this._options.enableSplitViewResizing.read(t)?Math.floor(e*n):r,s=100;return n<=s*2?r:on-s?n-s:o}}var pQe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},mQe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},_z;let wI=_z=class extends fe{static setBreadcrumbsSourceFactory(e){this._breadcrumbsSourceFactory.set(e,void 0)}get isUpdatingHiddenAreas(){return this._isUpdatingHiddenAreas}constructor(e,t,n,r){super(),this._editors=e,this._diffModel=t,this._options=n,this._instantiationService=r,this._modifiedOutlineSource=ym(this,l=>{const c=this._editors.modifiedModel.read(l),u=_z._breadcrumbsSourceFactory.read(l);return!c||!u?void 0:u(c,this._instantiationService)}),this._isUpdatingHiddenAreas=!1,this._register(this._editors.original.onDidChangeCursorPosition(l=>{if(l.reason===3){const c=this._diffModel.get();Ri(u=>{for(const d of this._editors.original.getSelections()||[])c==null||c.ensureOriginalLineIsVisible(d.getStartPosition().lineNumber,0,u),c==null||c.ensureOriginalLineIsVisible(d.getEndPosition().lineNumber,0,u)})}})),this._register(this._editors.modified.onDidChangeCursorPosition(l=>{if(l.reason===3){const c=this._diffModel.get();Ri(u=>{for(const d of this._editors.modified.getSelections()||[])c==null||c.ensureModifiedLineIsVisible(d.getStartPosition().lineNumber,0,u),c==null||c.ensureModifiedLineIsVisible(d.getEndPosition().lineNumber,0,u)})}}));const o=this._diffModel.map((l,c)=>{var u,d;const h=(u=l==null?void 0:l.unchangedRegions.read(c))!==null&&u!==void 0?u:[];return h.length===1&&h[0].modifiedLineNumber===1&&h[0].lineCount===((d=this._editors.modifiedModel.read(c))===null||d===void 0?void 0:d.getLineCount())?[]:h});this.viewZones=OS(this,(l,c)=>{const u=this._modifiedOutlineSource.read(l);if(!u)return{origViewZones:[],modViewZones:[]};const d=[],h=[],f=this._options.renderSideBySide.read(l),g=o.read(l);for(const p of g)if(!p.shouldHideControls(l)){{const v=Yt(this,_=>p.getHiddenOriginalRange(_).startLineNumber-1),m=new rO(v,24);d.push(m),c.add(new jse(this._editors.original,m,p,p.originalUnchangedRange,!f,u,_=>this._diffModel.get().ensureModifiedLineIsVisible(_,2,void 0),this._options))}{const v=Yt(this,_=>p.getHiddenModifiedRange(_).startLineNumber-1),m=new rO(v,24);h.push(m),c.add(new jse(this._editors.modified,m,p,p.modifiedUnchangedRange,!1,u,_=>this._diffModel.get().ensureModifiedLineIsVisible(_,2,void 0),this._options))}}return{origViewZones:d,modViewZones:h}});const s={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},a={description:"Fold Unchanged",glyphMarginHoverMessage:new Is(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(w("foldUnchanged","Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+Wt.asClassName(Xe.fold),zIndex:10001};this._register(iO(this._editors.original,Yt(this,l=>{const c=o.read(l),u=c.map(d=>({range:d.originalUnchangedRange.toInclusiveRange(),options:s}));for(const d of c)d.shouldHideControls(l)&&u.push({range:B.fromPositions(new ae(d.originalLineNumber,1)),options:a});return u}))),this._register(iO(this._editors.modified,Yt(this,l=>{const c=o.read(l),u=c.map(d=>({range:d.modifiedUnchangedRange.toInclusiveRange(),options:s}));for(const d of c)d.shouldHideControls(l)&&u.push({range:pn.ofLength(d.modifiedLineNumber,1).toInclusiveRange(),options:a});return u}))),this._register(bn(l=>{const c=o.read(l);this._isUpdatingHiddenAreas=!0;try{this._editors.original.setHiddenAreas(c.map(u=>u.getHiddenOriginalRange(l).toInclusiveRange()).filter(kf)),this._editors.modified.setHiddenAreas(c.map(u=>u.getHiddenModifiedRange(l).toInclusiveRange()).filter(kf))}finally{this._isUpdatingHiddenAreas=!1}})),this._register(this._editors.modified.onMouseUp(l=>{var c;if(!l.event.rightButton&&l.target.position&&(!((c=l.target.element)===null||c===void 0)&&c.className.includes("fold-unchanged"))){const u=l.target.position.lineNumber,d=this._diffModel.get();if(!d)return;const h=d.unchangedRegions.get().find(f=>f.modifiedUnchangedRange.includes(u));if(!h)return;h.collapseAll(void 0),l.event.stopPropagation(),l.event.preventDefault()}})),this._register(this._editors.original.onMouseUp(l=>{var c;if(!l.event.rightButton&&l.target.position&&(!((c=l.target.element)===null||c===void 0)&&c.className.includes("fold-unchanged"))){const u=l.target.position.lineNumber,d=this._diffModel.get();if(!d)return;const h=d.unchangedRegions.get().find(f=>f.originalUnchangedRange.includes(u));if(!h)return;h.collapseAll(void 0),l.event.stopPropagation(),l.event.preventDefault()}}))}};wI._breadcrumbsSourceFactory=Hn("breadcrumbsSourceFactory",void 0);wI=_z=pQe([mQe(3,Ot)],wI);class jse extends z0e{constructor(e,t,n,r,o,s,a,l){const c=gi("div.diff-hidden-lines-widget");super(e,t,c.root),this._editor=e,this._unchangedRegion=n,this._unchangedRegionRange=r,this._hide=o,this._modifiedOutlineSource=s,this._revealModifiedHiddenLine=a,this._options=l,this._nodes=gi("div.diff-hidden-lines",[gi("div.top@top",{title:w("diff.hiddenLines.top","Click or drag to show more above")}),gi("div.center@content",{style:{display:"flex"}},[gi("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[He("a",{title:w("showUnchangedRegion","Show Unchanged Region"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...wv("$(unfold)"))]),gi("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),gi("div.bottom@bottom",{title:w("diff.bottom","Click or drag to show more below"),role:"button"})]),c.root.appendChild(this._nodes.root);const u=Vi(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._hide?gs(this._nodes.first):this._register(Ev(this._nodes.first,{width:u.map(h=>h.contentLeft)})),this._register(bn(h=>{const f=this._unchangedRegion.visibleLineCountTop.read(h)+this._unchangedRegion.visibleLineCountBottom.read(h)===this._unchangedRegion.lineCount;this._nodes.bottom.classList.toggle("canMoveTop",!f),this._nodes.bottom.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(h)>0),this._nodes.top.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(h)>0),this._nodes.top.classList.toggle("canMoveBottom",!f);const g=this._unchangedRegion.isDragged.read(h),p=this._editor.getDomNode();p&&(p.classList.toggle("draggingUnchangedRegion",!!g),g==="top"?(p.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(h)>0),p.classList.toggle("canMoveBottom",!f)):g==="bottom"?(p.classList.toggle("canMoveTop",!f),p.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(h)>0)):(p.classList.toggle("canMoveTop",!1),p.classList.toggle("canMoveBottom",!1)))}));const d=this._editor;this._register(ye(this._nodes.top,"mousedown",h=>{if(h.button!==0)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const f=h.clientY;let g=!1;const p=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set("top",void 0);const v=Pt(this._nodes.top),m=ye(v,"mousemove",y=>{const L=y.clientY-f;g=g||Math.abs(L)>2;const E=Math.round(L/d.getOption(67)),D=Math.max(0,Math.min(p+E,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(D,void 0)}),_=ye(v,"mouseup",y=>{g||this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0),this._nodes.top.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),this._unchangedRegion.isDragged.set(void 0,void 0),m.dispose(),_.dispose()})})),this._register(ye(this._nodes.bottom,"mousedown",h=>{if(h.button!==0)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const f=h.clientY;let g=!1;const p=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set("bottom",void 0);const v=Pt(this._nodes.bottom),m=ye(v,"mousemove",y=>{const L=y.clientY-f;g=g||Math.abs(L)>2;const E=Math.round(L/d.getOption(67)),D=Math.max(0,Math.min(p-E,this._unchangedRegion.getMaxVisibleLineCountBottom())),k=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(D,void 0);const T=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(T-k))}),_=ye(v,"mouseup",y=>{if(this._unchangedRegion.isDragged.set(void 0,void 0),!g){const S=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const L=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(L-S))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),m.dispose(),_.dispose()})})),this._register(bn(h=>{const f=[];if(!this._hide){const g=n.getHiddenModifiedRange(h).length,p=w("hiddenLines","{0} hidden lines",g),v=He("span",{title:w("diff.hiddenLines.expandAll","Double click to unfold")},p);v.addEventListener("dblclick",y=>{y.button===0&&(y.preventDefault(),this._unchangedRegion.showAll(void 0))}),f.push(v);const m=this._unchangedRegion.getHiddenModifiedRange(h),_=this._modifiedOutlineSource.getBreadcrumbItems(m,h);if(_.length>0){f.push(He("span",void 0,"  |  "));for(let y=0;y<_.length;y++){const S=_[y],L=BA.toIcon(S.kind),E=gi("div.breadcrumb-item",{style:{display:"flex",alignItems:"center"}},[nI(L)," ",S.name,...y===_.length-1?[]:[nI(Xe.chevronRight)]]).root;f.push(E),E.onclick=()=>{this._revealModifiedHiddenLine(S.startLineNumber)}}}}gs(this._nodes.others,...f)}))}}var j0e=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},bz=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},v0;const K0e=yn("diffProviderFactoryService");let Cz=class{constructor(e){this.instantiationService=e}createDiffProvider(e){return this.instantiationService.createInstance(sO,e)}};Cz=j0e([bz(0,Ot)],Cz);In(K0e,Cz,1);let sO=v0=class{constructor(e,t,n){this.editorWorkerService=t,this.telemetryService=n,this.onDidChangeEventEmitter=new se,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){var e;(e=this.diffAlgorithmOnDidChangeSubscription)===null||e===void 0||e.dispose()}async computeDiff(e,t,n,r){var o,s;if(typeof this.diffAlgorithm!="string")return this.diffAlgorithm.computeDiff(e,t,n,r);if(e.getLineCount()===1&&e.getLineMaxColumn(1)===1)return t.getLineCount()===1&&t.getLineMaxColumn(1)===1?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new hh(new pn(1,2),new pn(1,t.getLineCount()+1),[new Xv(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const a=JSON.stringify([e.uri.toString(),t.uri.toString()]),l=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(n)]),c=v0.diffCache.get(a);if(c&&c.context===l)return c.result;const u=Ms.create(),d=await this.editorWorkerService.computeDiff(e.uri,t.uri,n,this.diffAlgorithm),h=u.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:h,timedOut:(o=d==null?void 0:d.quitEarly)!==null&&o!==void 0?o:!0,detectedMoves:n.computeMoves?(s=d==null?void 0:d.moves.length)!==null&&s!==void 0?s:0:-1}),r.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!d)throw new Error("no diff result available");return v0.diffCache.size>10&&v0.diffCache.delete(v0.diffCache.keys().next().value),v0.diffCache.set(a,{result:d,context:l}),d}setOptions(e){var t;let n=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&((t=this.diffAlgorithmOnDidChangeSubscription)===null||t===void 0||t.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,typeof e.diffAlgorithm!="string"&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange(()=>this.onDidChangeEventEmitter.fire())),n=!0),n&&this.onDidChangeEventEmitter.fire()}};sO.diffCache=new Map;sO=v0=j0e([bz(1,hd),bz(2,ea)],sO);var vQe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},_Qe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let yz=class extends fe{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,t,n){super(),this.model=e,this._options=t,this._diffProviderFactoryService=n,this._isDiffUpToDate=Hn(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=Hn(this,void 0),this.diff=this._diff,this._unchangedRegions=Hn(this,void 0),this.unchangedRegions=Yt(this,a=>{var l,c;return this._options.hideUnchangedRegions.read(a)?(c=(l=this._unchangedRegions.read(a))===null||l===void 0?void 0:l.regions)!==null&&c!==void 0?c:[]:(Ri(u=>{var d;for(const h of((d=this._unchangedRegions.get())===null||d===void 0?void 0:d.regions)||[])h.collapseAll(u)}),[])}),this.movedTextToCompare=Hn(this,void 0),this._activeMovedText=Hn(this,void 0),this._hoveredMovedText=Hn(this,void 0),this.activeMovedText=Yt(this,a=>{var l,c;return(c=(l=this.movedTextToCompare.read(a))!==null&&l!==void 0?l:this._hoveredMovedText.read(a))!==null&&c!==void 0?c:this._activeMovedText.read(a)}),this._cancellationTokenSource=new wr,this._diffProvider=Yt(this,a=>{const l=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:this._options.diffAlgorithm.read(a)}),c=ma("onDidChange",l.onDidChange);return{diffProvider:l,onChangeSignal:c}}),this._register(Rt(()=>this._cancellationTokenSource.cancel()));const r=pY("contentChangedSignal"),o=this._register(new pi(()=>r.trigger(void 0),200));this._register(bn(a=>{const l=this._unchangedRegions.read(a);if(!l||l.regions.some(g=>g.isDragged.read(a)))return;const c=l.originalDecorationIds.map(g=>e.original.getDecorationRange(g)).map(g=>g?pn.fromRangeInclusive(g):void 0),u=l.modifiedDecorationIds.map(g=>e.modified.getDecorationRange(g)).map(g=>g?pn.fromRangeInclusive(g):void 0),d=l.regions.map((g,p)=>!c[p]||!u[p]?void 0:new Jm(c[p].startLineNumber,u[p].startLineNumber,c[p].length,g.visibleLineCountTop.read(a),g.visibleLineCountBottom.read(a))).filter(kf),h=[];let f=!1;for(const g of QG(d,(p,v)=>p.getHiddenModifiedRange(a).endLineNumberExclusive===v.getHiddenModifiedRange(a).startLineNumber))if(g.length>1){f=!0;const p=g.reduce((m,_)=>m+_.lineCount,0),v=new Jm(g[0].originalLineNumber,g[0].modifiedLineNumber,p,g[0].visibleLineCountTop.get(),g[g.length-1].visibleLineCountBottom.get());h.push(v)}else h.push(g[0]);if(f){const g=e.original.deltaDecorations(l.originalDecorationIds,h.map(v=>({range:v.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),p=e.modified.deltaDecorations(l.modifiedDecorationIds,h.map(v=>({range:v.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));Ri(v=>{this._unchangedRegions.set({regions:h,originalDecorationIds:g,modifiedDecorationIds:p},v)})}}));const s=(a,l,c)=>{const u=Jm.fromDiffs(a.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(c),this._options.hideUnchangedRegionsContextLineCount.read(c));let d;const h=this._unchangedRegions.get();if(h){const v=h.originalDecorationIds.map(S=>e.original.getDecorationRange(S)).map(S=>S?pn.fromRangeInclusive(S):void 0),m=h.modifiedDecorationIds.map(S=>e.modified.getDecorationRange(S)).map(S=>S?pn.fromRangeInclusive(S):void 0);let y=ZZe(h.regions.map((S,L)=>{if(!v[L]||!m[L])return;const E=v[L].length;return new Jm(v[L].startLineNumber,m[L].startLineNumber,E,Math.min(S.visibleLineCountTop.get(),E),Math.min(S.visibleLineCountBottom.get(),E-S.visibleLineCountTop.get()))}).filter(kf),(S,L)=>!L||S.modifiedLineNumber>=L.modifiedLineNumber+L.lineCount&&S.originalLineNumber>=L.originalLineNumber+L.lineCount).map(S=>new Ya(S.getHiddenOriginalRange(c),S.getHiddenModifiedRange(c)));y=Ya.clip(y,pn.ofLength(1,e.original.getLineCount()),pn.ofLength(1,e.modified.getLineCount())),d=Ya.inverse(y,e.original.getLineCount(),e.modified.getLineCount())}const f=[];if(d)for(const v of u){const m=d.filter(_=>_.original.intersectsStrict(v.originalUnchangedRange)&&_.modified.intersectsStrict(v.modifiedUnchangedRange));f.push(...v.setVisibleRanges(m,l))}else f.push(...u);const g=e.original.deltaDecorations((h==null?void 0:h.originalDecorationIds)||[],f.map(v=>({range:v.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),p=e.modified.deltaDecorations((h==null?void 0:h.modifiedDecorationIds)||[],f.map(v=>({range:v.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));this._unchangedRegions.set({regions:f,originalDecorationIds:g,modifiedDecorationIds:p},l)};this._register(e.modified.onDidChangeContent(a=>{if(this._diff.get()){const c=op.fromModelContentChanges(a.changes);this._lastDiff,e.original,e.modified}this._isDiffUpToDate.set(!1,void 0),o.schedule()})),this._register(e.original.onDidChangeContent(a=>{if(this._diff.get()){const c=op.fromModelContentChanges(a.changes);this._lastDiff,e.original,e.modified}this._isDiffUpToDate.set(!1,void 0),o.schedule()})),this._register(Dh(async(a,l)=>{var c,u;this._options.hideUnchangedRegionsMinimumLineCount.read(a),this._options.hideUnchangedRegionsContextLineCount.read(a),o.cancel(),r.read(a);const d=this._diffProvider.read(a);d.onChangeSignal.read(a),sf(Hme,a),sf(yH,a),this._isDiffUpToDate.set(!1,void 0);let h=[];l.add(e.original.onDidChangeContent(p=>{const v=op.fromModelContentChanges(p.changes);h=mP(h,v)}));let f=[];l.add(e.modified.onDidChangeContent(p=>{const v=op.fromModelContentChanges(p.changes);f=mP(f,v)}));let g=await d.diffProvider.computeDiff(e.original,e.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(a),maxComputationTimeMs:this._options.maxComputationTimeMs.read(a),computeMoves:this._options.showMoves.read(a)},this._cancellationTokenSource.token);this._cancellationTokenSource.token.isCancellationRequested||(g=bQe(g,e.original,e.modified),g=(c=(e.original,e.modified,void 0))!==null&&c!==void 0?c:g,g=(u=(e.original,e.modified,void 0))!==null&&u!==void 0?u:g,Ri(p=>{s(g,p),this._lastDiff=g;const v=CY.fromDiffResult(g);this._diff.set(v,p),this._isDiffUpToDate.set(!0,p);const m=this.movedTextToCompare.get();this.movedTextToCompare.set(m?this._lastDiff.moves.find(_=>_.lineRangeMapping.modified.intersect(m.lineRangeMapping.modified)):void 0,p)}))}))}ensureModifiedLineIsVisible(e,t,n){var r,o;if(((r=this.diff.get())===null||r===void 0?void 0:r.mappings.length)===0)return;const s=((o=this._unchangedRegions.get())===null||o===void 0?void 0:o.regions)||[];for(const a of s)if(a.getHiddenModifiedRange(void 0).contains(e)){a.showModifiedLine(e,t,n);return}}ensureOriginalLineIsVisible(e,t,n){var r,o;if(((r=this.diff.get())===null||r===void 0?void 0:r.mappings.length)===0)return;const s=((o=this._unchangedRegions.get())===null||o===void 0?void 0:o.regions)||[];for(const a of s)if(a.getHiddenOriginalRange(void 0).contains(e)){a.showOriginalLine(e,t,n);return}}async waitForDiff(){await zZe(this.isDiffUpToDate,e=>e)}serializeState(){const e=this._unchangedRegions.get();return{collapsedRegions:e==null?void 0:e.regions.map(t=>({range:t.getHiddenModifiedRange(void 0).serialize()}))}}restoreSerializedState(e){var t;const n=(t=e.collapsedRegions)===null||t===void 0?void 0:t.map(o=>pn.deserialize(o.range)),r=this._unchangedRegions.get();!r||!n||Ri(o=>{for(const s of r.regions)for(const a of n)if(s.modifiedUnchangedRange.intersect(a)){s.setHiddenModifiedRange(a,o);break}})}};yz=vQe([_Qe(2,K0e)],yz);function bQe(i,e,t){return{changes:i.changes.map(n=>new hh(n.original,n.modified,n.innerChanges?n.innerChanges.map(r=>CQe(r,e,t)):void 0)),moves:i.moves,identical:i.identical,quitEarly:i.quitEarly}}function CQe(i,e,t){let n=i.originalRange,r=i.modifiedRange;return(n.endColumn!==1||r.endColumn!==1)&&n.endColumn===e.getLineMaxColumn(n.endLineNumber)&&r.endColumn===t.getLineMaxColumn(r.endLineNumber)&&n.endLineNumbernew G0e(t)),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,n,r){this.mappings=e,this.movedTexts=t,this.identical=n,this.quitEarly=r}}class G0e{constructor(e){this.lineRangeMapping=e}}class Jm{static fromDiffs(e,t,n,r,o){const s=hh.inverse(e,t,n),a=[];for(const l of s){let c=l.original.startLineNumber,u=l.modified.startLineNumber,d=l.original.length;const h=c===1&&u===1,f=c+d===t+1&&u+d===n+1;(h||f)&&d>=o+r?(h&&!f&&(d-=o),f&&!h&&(c+=o,u+=o,d-=o),a.push(new Jm(c,u,d,0,0))):d>=o*2+r&&(c+=o,u+=o,d-=o*2,a.push(new Jm(c,u,d,0,0)))}return a}get originalUnchangedRange(){return pn.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return pn.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,n,r,o){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=n,this._visibleLineCountTop=Hn(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=Hn(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=Yt(this,l=>this.visibleLineCountTop.read(l)+this.visibleLineCountBottom.read(l)===this.lineCount&&!this.isDragged.read(l)),this.isDragged=Hn(this,void 0);const s=Math.max(Math.min(r,this.lineCount),0),a=Math.max(Math.min(o,this.lineCount-r),0);uie(r===s),uie(o===a),this._visibleLineCountTop.set(s,void 0),this._visibleLineCountBottom.set(a,void 0)}setVisibleRanges(e,t){const n=[],r=new Hu(e.map(l=>l.modified)).subtractFrom(this.modifiedUnchangedRange);let o=this.originalLineNumber,s=this.modifiedLineNumber;const a=this.modifiedLineNumber+this.lineCount;if(r.ranges.length===0)this.showAll(t),n.push(this);else{let l=0;for(const c of r.ranges){const u=l===r.ranges.length-1;l++;const d=(u?a:c.endLineNumberExclusive)-s,h=new Jm(o,s,d,0,0);h.setHiddenModifiedRange(c,t),n.push(h),o=h.originalUnchangedRange.endLineNumberExclusive,s=h.modifiedUnchangedRange.endLineNumberExclusive}}return n}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return pn.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return pn.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,t){const n=e.startLineNumber-this.modifiedLineNumber,r=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(n,r,t)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,t){const n=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,n),t)}showMoreBelow(e=10,t){const n=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,n),t)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,t,n){const r=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),o=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;t===0&&r{var v;this._contextMenuService.showContextMenu({domForShadowRoot:h&&(v=n.getDomNode())!==null&&v!==void 0?v:void 0,getAnchor:()=>({x:g,y:p}),getActions:()=>{const m=[],_=r.modified.isEmpty;return m.push(new xl("diff.clipboard.copyDeletedContent",_?r.original.length>1?w("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):w("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"):r.original.length>1?w("diff.clipboard.copyChangedLinesContent.label","Copy changed lines"):w("diff.clipboard.copyChangedLinesContent.single.label","Copy changed line"),void 0,!0,async()=>{const S=this._originalTextModel.getValueInRange(r.original.toExclusiveRange());await this._clipboardService.writeText(S)})),r.original.length>1&&m.push(new xl("diff.clipboard.copyDeletedLineContent",_?w("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",r.original.startLineNumber+d):w("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",r.original.startLineNumber+d),void 0,!0,async()=>{let S=this._originalTextModel.getLineContent(r.original.startLineNumber+d);S===""&&(S=this._originalTextModel.getEndOfLineSequence()===0?` +`}};cz=M_([Jo(0,gn)],cz);class wZe{publicLog2(){}}class bI{constructor(){const e=At.from({scheme:bI.SCHEME,authority:"model",path:"/"});this.workspace={id:O_e,folders:[new NGe({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===bI.SCHEME?this.workspace.folders[0]:null}}bI.SCHEME="inmemory";function nO(i,e,t){if(!e||!(i instanceof F0e))return;const n=[];Object.keys(e).forEach(r=>{aGe(r)&&n.push([`editor.${r}`,e[r]]),t&&lGe(r)&&n.push([`diffEditor.${r}`,e[r]])}),n.length>0&&i.updateValues(n)}let uz=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}async apply(e,t){const n=Array.isArray(e)?e:VX.convert(e),r=new Map;for(const a of n){if(!(a instanceof xv))throw new Error("bad edit - only text edits are supported");const l=this._modelService.getModel(a.resource);if(!l)throw new Error("bad edit - model not found");if(typeof a.versionId=="number"&&l.getVersionId()!==a.versionId)throw new Error("bad state - model changed in the meantime");let c=r.get(l);c||(c=[],r.set(l,c)),c.push(Xi.replaceMove(B.lift(a.textEdit.range),a.textEdit.text))}let o=0,s=0;for(const[a,l]of r)a.pushStackElement(),a.pushEditOperations([],l,()=>[]),a.pushStackElement(),s+=1,o+=l.length;return{ariaSummary:Eb(LV.bulkEditServiceSummary,o,s),isApplied:o>0}}};uz=M_([Jo(0,tr)],uz);class SZe{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return su(e)}}let dz=class extends EV{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,n){if(!t){const r=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();r&&(t=r.getContainerDomNode())}return super.showContextView(e,t,n)}};dz=M_([Jo(0,pC),Jo(1,Un)],dz);class xZe{constructor(){this._neverEmitter=new se,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class LZe extends aI{constructor(){super()}}class EZe extends pZe{constructor(){super(new H8e)}}let hz=class extends MV{constructor(e,t,n,r,o,s){super(e,t,n,r,o,s),this.configure({blockMouse:!1})}};hz=M_([Jo(0,ea),Jo(1,$r),Jo(2,ng),Jo(3,ci),Jo(4,hu),Jo(5,Vt)],hz);class DZe{async playSignal(e,t){}}In(gn,F0e,0);In(Hq,lz,0);In(zme,cz,0);In(Pb,bI,0);In(Vw,SZe,0);In(ea,wZe,0);In(Gk,CZe,0);In(EX,bZe,0);In($r,_I,0);In(ig,Im,0);In(ji,LZe,0);In(Sc,XYe,0);In(Ta,EZe,0);In(tr,VP,0);In(Gq,BV,0);In(Vt,oz,0);In(P_e,_Ze,0);In(k_,p3,0);In(dd,kqe,0);In(hd,wH,0);In(Xk,uz,0);In(F_e,xZe,0);In(ol,sz,0);In(ud,ez,0);In(mu,YXe,0);In(sr,az,0);In(ci,qw,0);In(Eh,QV,0);In(ng,dz,0);In(al,FV,0);In(Kp,eO,0);In(Ol,hz,0);In(hu,tz,0);In(R_,DZe,0);var Ht;(function(i){const e=new Kk;for(const[l,c]of bie())e.set(l,c);const t=new tO(e,!0);e.set(Ot,t);function n(l){r||s({});const c=e.get(l);if(!c)throw new Error("Missing service "+l);return c instanceof rf?t.invokeFunction(u=>u.get(l)):c}i.get=n;let r=!1;const o=new se;function s(l){if(r)return t;r=!0;for(const[u,d]of bie())e.get(u)||e.set(u,d);for(const u in l)if(l.hasOwnProperty(u)){const d=yn(u);e.get(d)instanceof rf&&e.set(d,l[u])}const c=mZe();for(const u of c)try{t.createInstance(u)}catch(d){en(d)}return o.fire(),t}i.initialize=s;function a(l){if(r)return l();const c=new Te,u=c.add(o.event(()=>{u.dispose(),c.add(l())}));return c}i.withServices=a})(Ht||(Ht={}));class vh{constructor(e,t,n){this.owner=e,this.debugNameSource=t,this.referenceFn=n}getDebugName(e){return IZe(e,this)}}const Nse=new Map,fz=new WeakMap;function IZe(i,e){var t;const n=fz.get(i);if(n)return n;const r=kZe(i,e);if(r){let o=(t=Nse.get(r))!==null&&t!==void 0?t:0;o++,Nse.set(r,o);const s=o===1?r:`${r}#${o}`;return fz.set(i,s),s}}function kZe(i,e){const t=fz.get(i);if(t)return t;const n=e.owner?NZe(e.owner)+".":"";let r;const o=e.debugNameSource;if(o!==void 0)if(typeof o=="function"){if(r=o(),r!==void 0)return n+r}else return n+o;const s=e.referenceFn;if(s!==void 0&&(r=m3(s),r!==void 0))return n+r;if(e.owner!==void 0){const a=TZe(e.owner,i);if(a!==void 0)return n+a}}function TZe(i,e){for(const t in i)if(i[t]===e)return t}const Rse=new Map,Mse=new WeakMap;function NZe(i){var e;const t=Mse.get(i);if(t)return t;const n=RZe(i);let r=(e=Rse.get(n))!==null&&e!==void 0?e:0;r++,Rse.set(n,r);const o=r===1?n:`${n}#${r}`;return Mse.set(i,o),o}function RZe(i){const e=i.constructor;return e?e.name:"Object"}function m3(i){const e=i.toString(),n=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e),r=n?n[1]:void 0;return r==null?void 0:r.trim()}let MZe;function Af(){return MZe}let B0e;function AZe(i){B0e=i}let W0e;function PZe(i){W0e=i}class $0e{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t){const n=t===void 0?void 0:e,r=t===void 0?e:t;return W0e({owner:n,debugName:()=>{const o=m3(r);if(o!==void 0)return o;const a=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(r.toString());if(a)return`${this.debugName}.${a[2]}`;if(!n)return`${this.debugName} (mapped)`}},o=>r(this.read(o),o))}recomputeInitiallyAndOnChange(e,t){return e.add(B0e(this,t)),this}}class iT extends $0e{constructor(){super(...arguments),this.observers=new Set}addObserver(e){const t=this.observers.size;this.observers.add(e),t===0&&this.onFirstObserverAdded()}removeObserver(e){this.observers.delete(e)&&this.observers.size===0&&this.onLastObserverRemoved()}onFirstObserverAdded(){}onLastObserverRemoved(){}}function Ri(i,e){const t=new v3(i,e);try{i(t)}finally{t.finish()}}let HR;function AM(i){if(HR)i(HR);else{const e=new v3(i,void 0);HR=e;try{i(e)}finally{e.finish(),HR=void 0}}}async function OZe(i,e){const t=new v3(i,e);try{await i(t)}finally{t.finish()}}function CI(i,e,t){i?e(i):Ri(e,t)}class v3{constructor(e,t){var n;this._fn=e,this._getDebugName=t,this.updatingObservers=[],(n=Af())===null||n===void 0||n.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():m3(this._fn)}updateObserver(e,t){this.updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){var e;const t=this.updatingObservers;for(let n=0;n{},()=>`Setting ${this.debugName}`));try{const s=this._value;this._setValue(e),(r=Af())===null||r===void 0||r.handleObservableChanged(this,{oldValue:s,newValue:e,change:n,didChange:!0,hadValue:!0});for(const a of this.observers)t.updateObserver(a,this),a.handleChange(this,n)}finally{o&&o.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function yI(i,e){return typeof i=="string"?new Ase(void 0,i,e):new Ase(i,void 0,e)}class Ase extends gz{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){var e;(e=this._value)===null||e===void 0||e.dispose()}}const Xw=(i,e)=>i===e;function Yt(i,e){return e!==void 0?new Yw(new vh(i,void 0,e),e,void 0,void 0,void 0,Xw):new Yw(new vh(void 0,void 0,i),i,void 0,void 0,void 0,Xw)}function Qy(i,e){var t;return new Yw(new vh(i.owner,i.debugName,i.debugReferenceFn),e,void 0,void 0,i.onLastObserverRemoved,(t=i.equalityComparer)!==null&&t!==void 0?t:Xw)}PZe(Qy);function FZe(i,e){var t;return new Yw(new vh(i.owner,i.debugName,void 0),e,i.createEmptyChangeSummary,i.handleChange,void 0,(t=i.equalityComparer)!==null&&t!==void 0?t:Xw)}function OS(i,e){let t,n;e===void 0?(t=i,n=void 0):(n=i,t=e);const r=new Te;return new Yw(new vh(n,void 0,t),o=>(r.clear(),t(o,r)),void 0,void 0,()=>r.dispose(),Xw)}function wm(i,e){let t,n;e===void 0?(t=i,n=void 0):(n=i,t=e);const r=new Te;return new Yw(new vh(n,void 0,t),o=>{r.clear();const s=t(o);return s&&r.add(s),s},void 0,void 0,()=>r.dispose(),Xw)}class Yw extends iT{get debugName(){var e;return(e=this._debugNameData.getDebugName(this))!==null&&e!==void 0?e:"(anonymous)"}constructor(e,t,n,r,o=void 0,s){var a,l;super(),this._debugNameData=e,this._computeFn=t,this.createChangeSummary=n,this._handleChange=r,this._handleLastObserverRemoved=o,this._equalityComparator=s,this.state=0,this.value=void 0,this.updateCount=0,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=void 0,this.changeSummary=(a=this.createChangeSummary)===null||a===void 0?void 0:a.call(this),(l=Af())===null||l===void 0||l.handleDerivedCreated(this)}onLastObserverRemoved(){var e;this.state=0,this.value=void 0;for(const t of this.dependencies)t.removeObserver(this);this.dependencies.clear(),(e=this._handleLastObserverRemoved)===null||e===void 0||e.call(this)}get(){var e;if(this.observers.size===0){const t=this._computeFn(this,(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this));return this.onLastObserverRemoved(),t}else{do{if(this.state===1){for(const t of this.dependencies)if(t.reportChanges(),this.state===2)break}this.state===1&&(this.state=3),this._recomputeIfNeeded()}while(this.state!==3);return this.value}}_recomputeIfNeeded(){var e,t;if(this.state===3)return;const n=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=n;const r=this.state!==0,o=this.value;this.state=3;const s=this.changeSummary;this.changeSummary=(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this);try{this.value=this._computeFn(this,s)}finally{for(const l of this.dependenciesToBeRemoved)l.removeObserver(this);this.dependenciesToBeRemoved.clear()}const a=r&&!this._equalityComparator(o,this.value);if((t=Af())===null||t===void 0||t.handleDerivedRecomputed(this,{oldValue:o,newValue:this.value,change:void 0,didChange:a,hadValue:r}),a)for(const l of this.observers)l.handleChange(this,void 0)}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){this.updateCount++;const t=this.updateCount===1;if(this.state===3&&(this.state=1,!t))for(const n of this.observers)n.handlePossibleChange(this);if(t)for(const n of this.observers)n.beginUpdate(this)}endUpdate(e){if(this.updateCount--,this.updateCount===0){const t=[...this.observers];for(const n of t)n.endUpdate(this)}Ew(()=>this.updateCount>=0)}handlePossibleChange(e){if(this.state===3&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){this.state=1;for(const t of this.observers)t.handlePossibleChange(this)}}handleChange(e,t){if(this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){const n=this._handleChange?this._handleChange({changedObservable:e,change:t,didChange:o=>o===e},this.changeSummary):!0,r=this.state===3;if(n&&(this.state===1||r)&&(this.state=2,r))for(const o of this.observers)o.handlePossibleChange(this)}}readObservable(e){e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}addObserver(e){const t=!this.observers.has(e)&&this.updateCount>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){const t=this.observers.has(e)&&this.updateCount>0;super.removeObserver(e),t&&e.endUpdate(this)}}function bn(i){return new b3(new vh(void 0,void 0,i),i,void 0,void 0)}function _3(i,e){var t;return new b3(new vh(i.owner,i.debugName,(t=i.debugReferenceFn)!==null&&t!==void 0?t:e),e,void 0,void 0)}function rT(i,e){var t;return new b3(new vh(i.owner,i.debugName,(t=i.debugReferenceFn)!==null&&t!==void 0?t:e),e,i.createEmptyChangeSummary,i.handleChange)}function Dh(i){const e=new Te,t=_3({owner:void 0,debugName:void 0,debugReferenceFn:i},n=>{e.clear(),i(n,e)});return Rt(()=>{t.dispose(),e.dispose()})}class b3{get debugName(){var e;return(e=this._debugNameData.getDebugName(this))!==null&&e!==void 0?e:"(anonymous)"}constructor(e,t,n,r){var o,s;this._debugNameData=e,this._runFn=t,this.createChangeSummary=n,this._handleChange=r,this.state=2,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=(o=this.createChangeSummary)===null||o===void 0?void 0:o.call(this),(s=Af())===null||s===void 0||s.handleAutorunCreated(this),this._runIfNeeded()}dispose(){this.disposed=!0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear()}_runIfNeeded(){var e,t,n;if(this.state===3)return;const r=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=r,this.state=3;const o=this.disposed;try{if(!o){(e=Af())===null||e===void 0||e.handleAutorunTriggered(this);const s=this.changeSummary;this.changeSummary=(t=this.createChangeSummary)===null||t===void 0?void 0:t.call(this),this._runFn(this,s)}}finally{o||(n=Af())===null||n===void 0||n.handleAutorunFinished(this);for(const s of this.dependenciesToBeRemoved)s.removeObserver(this);this.dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(){this.state===3&&(this.state=1),this.updateCount++}endUpdate(){if(this.updateCount===1)do{if(this.state===1){this.state=3;for(const e of this.dependencies)if(e.reportChanges(),this.state===2)break}this._runIfNeeded()}while(this.state!==3);this.updateCount--,Ew(()=>this.updateCount>=0)}handlePossibleChange(e){this.state===3&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(this.state=1)}handleChange(e,t){this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(!this._handleChange||this._handleChange({changedObservable:e,change:t,didChange:r=>r===e},this.changeSummary))&&(this.state=2)}readObservable(e){if(this.disposed)return e.get();e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}}(function(i){i.Observer=b3})(bn||(bn={}));function ap(i){return new BZe(i)}class BZe extends $0e{constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}toString(){return`Const: ${this.value}`}}function Vi(i,e){return new j0(i,e)}class j0 extends iT{constructor(e,t){super(),this.event=e,this._getValue=t,this.hasValue=!1,this.handleEvent=n=>{var r;const o=this._getValue(n),s=this.value,a=!this.hasValue||s!==o;let l=!1;a&&(this.value=o,this.hasValue&&(l=!0,CI(j0.globalTransaction,c=>{var u;(u=Af())===null||u===void 0||u.handleFromEventObservableTriggered(this,{oldValue:s,newValue:o,change:void 0,didChange:a,hadValue:this.hasValue});for(const d of this.observers)c.updateObserver(d,this),d.handleChange(this,void 0)},()=>{const c=this.getDebugName();return"Event fired"+(c?`: ${c}`:"")})),this.hasValue=!0),l||(r=Af())===null||r===void 0||r.handleFromEventObservableTriggered(this,{oldValue:s,newValue:o,change:void 0,didChange:a,hadValue:this.hasValue})}}getDebugName(){return m3(this._getValue)}get debugName(){const e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0,this.hasValue=!1,this.value=void 0}get(){return this.subscription?(this.hasValue||this.handleEvent(void 0),this.value):this._getValue(void 0)}}(function(i){i.Observer=j0;function e(t,n){let r=!1;j0.globalTransaction===void 0&&(j0.globalTransaction=t,r=!0);try{n()}finally{r&&(j0.globalTransaction=void 0)}}i.batchEventsGlobally=e})(Vi||(Vi={}));function ma(i,e){return new WZe(i,e)}class WZe extends iT{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{Ri(n=>{for(const r of this.observers)n.updateObserver(r,this),r.handleChange(this,void 0)},()=>this.debugName)}}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}function pY(i){return typeof i=="string"?new Pse(i):new Pse(void 0,i)}class Pse extends iT{get debugName(){var e;return(e=new vh(this._owner,this._debugName,void 0).getDebugName(this))!==null&&e!==void 0?e:"Observable Signal"}constructor(e,t){super(),this._debugName=e,this._owner=t}trigger(e,t){if(!e){Ri(n=>{this.trigger(n,t)},()=>`Trigger signal ${this.debugName}`);return}for(const n of this.observers)e.updateObserver(n,this),n.handleChange(this,t)}get(){}}function oT(i,e){const t=new $Ze(!0,e);return i.addObserver(t),e?e(i.get()):i.reportChanges(),Rt(()=>{i.removeObserver(t)})}AZe(oT);class $Ze{constructor(e,t){this._forceRecompute=e,this._handleValue=t,this._counter=0}beginUpdate(e){this._counter++}endUpdate(e){this._counter--,this._counter===0&&this._forceRecompute&&(this._handleValue?this._handleValue(e.get()):e.reportChanges())}handlePossibleChange(e){}handleChange(e,t){}}function HZe(i){let e;return Yt(n=>(e=i(n,e),e))}function VZe(i,e,t,n){let r=new Ose(t,n);return Qy({debugReferenceFn:t,owner:i,onLastObserverRemoved:()=>{r.dispose(),r=new Ose(t)}},s=>(r.setItems(e.read(s)),r.getItems()))}class Ose{constructor(e,t){this._map=e,this._keySelector=t,this._cache=new Map,this._items=[]}dispose(){this._cache.forEach(e=>e.store.dispose()),this._cache.clear()}setItems(e){const t=[],n=new Set(this._cache.keys());for(const r of e){const o=this._keySelector?this._keySelector(r):r;let s=this._cache.get(o);if(s)n.delete(o);else{const a=new Te;s={out:this._map(r,a),store:a},this._cache.set(o,s)}t.push(s.out)}for(const r of n)this._cache.get(r).store.dispose(),this._cache.delete(r);this._items=t}getItems(){return this._items}}function zZe(i,e,t){return new Promise((n,r)=>{let o=!0,s=!1;const a=i.map(c=>({isFinished:e(c),error:t?t(c):!1,state:c})),l=bn(c=>{const{isFinished:u,error:d,state:h}=a.read(c);(u||d)&&(o?s=!0:l.dispose(),d?r(d===!0?h:d):n(h))});o=!1,s&&l.dispose()})}class _h{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new _h(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,n=0;const r=e.getVisibleRanges();if(r.length>0){t=r[0].getStartPosition();const o=e.getTopForPosition(t.lineNumber,t.column);n=e.getScrollTop()-o}return new _h(e.getScrollTop(),e.getContentHeight(),t,n,e.getPosition())}constructor(e,t,n,r,o){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=n,this._visiblePositionScrollDelta=r,this._cursorPosition=o}restore(e){if(!(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())&&this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){if(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())return;const t=e.getPosition();if(!this._cursorPosition||!t)return;const n=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+n)}}function mY(){return s$&&!!s$.VSCODE_DEV}function H0e(i){if(mY()){const e=UZe();return e.add(i),{dispose(){e.delete(i)}}}else return{dispose(){}}}function UZe(){VR||(VR=new Set);const i=globalThis;return i.$hotReload_applyNewExports||(i.$hotReload_applyNewExports=e=>{const t={config:{mode:void 0},...e};for(const n of VR){const r=n(t);if(r)return r}}),VR}let VR;mY()&&H0e(({oldExports:i,newSrc:e,config:t})=>{if(t.mode==="patch-prototype")return n=>{var r,o;for(const s in n){const a=n[s];if(console.log(`[hot-reload] Patching prototype methods of '${s}'`,{exportedItem:a}),typeof a=="function"&&a.prototype){const l=i[s];if(l){for(const c of Object.getOwnPropertyNames(a.prototype)){const u=Object.getOwnPropertyDescriptor(a.prototype,c),d=Object.getOwnPropertyDescriptor(l.prototype,c);((r=u==null?void 0:u.value)===null||r===void 0?void 0:r.toString())!==((o=d==null?void 0:d.value)===null||o===void 0?void 0:o.toString())&&console.log(`[hot-reload] Patching prototype method '${s}.${c}'`),Object.defineProperty(l.prototype,c,u)}n[s]=l}}}return!0}});function jZe(i,e,t,n){if(i.length===0)return e;if(e.length===0)return i;const r=[];let o=0,s=0;for(;ou?(r.push(l),s++):(r.push(n(a,l)),o++,s++)}for(;o`Apply decorations from ${e.debugName}`},r=>{const o=e.read(r);n.set(o)})),t.add({dispose:()=>{n.clear()}}),t}function zR(i,e){return i.appendChild(e),Rt(()=>{i.removeChild(e)})}class V0e extends fe{get width(){return this._width}get height(){return this._height}constructor(e,t){super(),this.elementSizeObserver=this._register(new Yme(e,t)),this._width=Hn(this,this.elementSizeObserver.getWidth()),this._height=Hn(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(n=>Ri(r=>{this._width.set(this.elementSizeObserver.getWidth(),r),this._height.set(this.elementSizeObserver.getHeight(),r)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function Fse(i,e,t){let n=e.get(),r=n,o=n;const s=Hn("animatedValue",n);let a=-1;const l=300;let c;t.add(rT({createEmptyChangeSummary:()=>({animate:!1}),handleChange:(d,h)=>(d.didChange(e)&&(h.animate=h.animate||d.change),!0)},(d,h)=>{c!==void 0&&(i.cancelAnimationFrame(c),c=void 0),r=o,n=e.read(d),a=Date.now()-(h.animate?0:l),u()}));function u(){const d=Date.now()-a;o=Math.floor(KZe(d,r,n-r,l)),d{this._actualTop.set(n,void 0)},this.onComputedHeight=n=>{this._actualHeight.set(n,void 0)}}}class C3{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${C3._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}}C3._counter=0;function Dv(i,e){return bn(t=>{for(let[n,r]of Object.entries(e))r&&typeof r=="object"&&"read"in r&&(r=r.read(t)),typeof r=="number"&&(r=`${r}px`),n=n.replace(/[A-Z]/g,o=>"-"+o.toLowerCase()),i.style[n]=r})}function sf(i,e){return GZe([i],e),i}function GZe(i,e){mY()&&ma("reload",n=>H0e(({oldExports:r})=>{if([...Object.values(r)].some(o=>i.includes(o)))return o=>(n(void 0),!0)})).read(e)}function oO(i,e,t,n){const r=new Te,o=[];return r.add(Dh((s,a)=>{const l=e.read(s),c=new Map,u=new Map;t&&t(!0),i.changeViewZones(d=>{for(const h of o)d.removeZone(h),n==null||n.delete(h);o.length=0;for(const h of l){const f=d.addZone(h);h.setZoneId&&h.setZoneId(f),o.push(f),n==null||n.add(f),c.set(h,f)}}),t&&t(!1),a.add(rT({createEmptyChangeSummary(){return{zoneIds:[]}},handleChange(d,h){const f=u.get(d.changedObservable);return f!==void 0&&h.zoneIds.push(f),!0}},(d,h)=>{for(const f of l)f.onChange&&(u.set(f.onChange,c.get(f)),f.onChange.read(d));t&&t(!0),i.changeViewZones(f=>{for(const g of h.zoneIds)f.layoutZone(g)}),t&&t(!1)}))})),r.add({dispose(){t&&t(!0),i.changeViewZones(s=>{for(const a of o)s.removeZone(a)}),n==null||n.clear(),t&&t(!1)}}),r}class qZe extends wr{dispose(){super.dispose(!0)}}function Bse(i,e){const t=RD(e,r=>r.original.startLineNumber<=i.lineNumber);if(!t)return B.fromPositions(i);if(t.original.endLineNumberExclusive<=i.lineNumber){const r=i.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return B.fromPositions(new ae(r,i.column))}if(!t.innerChanges)return B.fromPositions(new ae(t.modified.startLineNumber,1));const n=RD(t.innerChanges,r=>r.originalRange.getStartPosition().isBeforeOrEqual(i));if(!n){const r=i.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return B.fromPositions(new ae(r,i.column))}if(n.originalRange.containsPosition(i))return n.modifiedRange;{const r=XZe(n.originalRange.getEndPosition(),i);return B.fromPositions(YZe(n.modifiedRange.getEndPosition(),r))}}function XZe(i,e){return i.lineNumber===e.lineNumber?new YD(0,e.column-i.column):new YD(e.lineNumber-i.lineNumber,e.column-1)}function YZe(i,e){return e.lineCount===0?new ae(i.lineNumber,i.column+e.columnCount):new ae(i.lineNumber+e.lineCount,e.columnCount+1)}function UR(i,e,t){const n=i.bindTo(e);return _3({debugName:()=>`Set Context Key "${i.key}"`},r=>{n.set(t(r))})}function ZZe(i,e){let t;return i.filter(n=>{const r=e(n,t);return t=n,r})}var vY=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},_Y=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const QZe=Mr("diff-review-insert",Xe.add,w("accessibleDiffViewerInsertIcon","Icon for 'Insert' in accessible diff viewer.")),JZe=Mr("diff-review-remove",Xe.remove,w("accessibleDiffViewerRemoveIcon","Icon for 'Remove' in accessible diff viewer.")),eQe=Mr("diff-review-close",Xe.close,w("accessibleDiffViewerCloseIcon","Icon for 'Close' in accessible diff viewer."));let Jm=class extends fe{constructor(e,t,n,r,o,s,a,l,c){super(),this._parentNode=e,this._visible=t,this._setVisible=n,this._canClose=r,this._width=o,this._height=s,this._diffs=a,this._models=l,this._instantiationService=c,this._state=OS(this,(u,d)=>{const h=this._visible.read(u);if(this._parentNode.style.visibility=h?"visible":"hidden",!h)return null;const f=d.add(this._instantiationService.createInstance(pz,this._diffs,this._models,this._setVisible,this._canClose)),g=d.add(this._instantiationService.createInstance(mz,this._parentNode,f,this._width,this._height,this._models));return{model:f,view:g}}).recomputeInitiallyAndOnChange(this._store)}next(){Ri(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this._state.get().model.nextGroup(e)})}prev(){Ri(e=>{this._setVisible(!0,e),this._state.get().model.previousGroup(e)})}close(){Ri(e=>{this._setVisible(!1,e)})}};Jm._ttPolicy=Vp("diffReview",{createHTML:i=>i});Jm=vY([_Y(8,Ot)],Jm);let pz=class extends fe{constructor(e,t,n,r,o){super(),this._diffs=e,this._models=t,this._setVisible=n,this.canClose=r,this._accessibilitySignalService=o,this._groups=Hn(this,[]),this._currentGroupIdx=Hn(this,0),this._currentElementIdx=Hn(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((s,a)=>this._groups.read(a)[s]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((s,a)=>{var l;return(l=this.currentGroup.read(a))===null||l===void 0?void 0:l.lines[s]}),this._register(bn(s=>{const a=this._diffs.read(s);if(!a){this._groups.set([],void 0);return}const l=tQe(a,this._models.getOriginalModel().getLineCount(),this._models.getModifiedModel().getLineCount());Ri(c=>{const u=this._models.getModifiedPosition();if(u){const d=l.findIndex(h=>(u==null?void 0:u.lineNumber){const a=this.currentElement.read(s);(a==null?void 0:a.type)===ga.Deleted?this._accessibilitySignalService.playSignal(cn.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):(a==null?void 0:a.type)===ga.Added&&this._accessibilitySignalService.playSignal(cn.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(bn(s=>{var a;const l=this.currentElement.read(s);if(l&&l.type!==ga.Header){const c=(a=l.modifiedLineNumber)!==null&&a!==void 0?a:l.diff.modified.startLineNumber;this._models.modifiedSetSelection(B.fromPositions(new ae(c,1)))}}))}_goToGroupDelta(e,t){const n=this.groups.get();!n||n.length<=1||CI(t,r=>{this._currentGroupIdx.set(vn.ofLength(n.length).clipCyclic(this._currentGroupIdx.get()+e),r),this._currentElementIdx.set(0,r)})}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){const t=this.currentGroup.get();!t||t.lines.length<=1||Ri(n=>{this._currentElementIdx.set(vn.ofLength(t.lines.length).clip(this._currentElementIdx.get()+e),n)})}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(e){const t=this.currentGroup.get();if(!t)return;const n=t.lines.indexOf(e);n!==-1&&Ri(r=>{this._currentElementIdx.set(n,r)})}revealCurrentElementInEditor(){if(!this.canClose.get())return;this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===ga.Deleted?this._models.originalReveal(B.fromPositions(new ae(e.originalLineNumber,1))):this._models.modifiedReveal(e.type!==ga.Header?B.fromPositions(new ae(e.modifiedLineNumber,1)):void 0))}close(){this.canClose.get()&&(this._setVisible(!1,void 0),this._models.modifiedFocus())}};pz=vY([_Y(4,R_)],pz);const Gx=3;function tQe(i,e,t){const n=[];for(const r of QG(i,(o,s)=>s.modified.startLineNumber-o.modified.endLineNumberExclusive<2*Gx)){const o=[];o.push(new iQe);const s=new pn(Math.max(1,r[0].original.startLineNumber-Gx),Math.min(r[r.length-1].original.endLineNumberExclusive+Gx,e+1)),a=new pn(Math.max(1,r[0].modified.startLineNumber-Gx),Math.min(r[r.length-1].modified.endLineNumberExclusive+Gx,t+1));Jge(r,(u,d)=>{const h=new pn(u?u.original.endLineNumberExclusive:s.startLineNumber,d?d.original.startLineNumber:s.endLineNumberExclusive),f=new pn(u?u.modified.endLineNumberExclusive:a.startLineNumber,d?d.modified.startLineNumber:a.endLineNumberExclusive);h.forEach(g=>{o.push(new sQe(g,f.startLineNumber+(g-h.startLineNumber)))}),d&&(d.original.forEach(g=>{o.push(new rQe(d,g))}),d.modified.forEach(g=>{o.push(new oQe(d,g))}))});const l=r[0].modified.join(r[r.length-1].modified),c=r[0].original.join(r[r.length-1].original);n.push(new nQe(new Ya(l,c),o))}return n}var ga;(function(i){i[i.Header=0]="Header",i[i.Unchanged=1]="Unchanged",i[i.Deleted=2]="Deleted",i[i.Added=3]="Added"})(ga||(ga={}));class nQe{constructor(e,t){this.range=e,this.lines=t}}class iQe{constructor(){this.type=ga.Header}}class rQe{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=ga.Deleted,this.modifiedLineNumber=void 0}}class oQe{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=ga.Added,this.originalLineNumber=void 0}}class sQe{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=ga.Unchanged}}let mz=class extends fe{constructor(e,t,n,r,o,s){super(),this._element=e,this._model=t,this._width=n,this._height=r,this._models=o,this._languageService=s,this.domNode=this._element,this.domNode.className="monaco-component diff-review monaco-editor-background";const a=document.createElement("div");a.className="diff-review-actions",this._actionBar=this._register(new au(a)),this._register(bn(l=>{this._actionBar.clear(),this._model.canClose.read(l)&&this._actionBar.push(new xl("diffreview.close",w("label.close","Close"),"close-diff-review "+Wt.asClassName(eQe),!0,async()=>t.close()),{label:!1,icon:!0})})),this._content=document.createElement("div"),this._content.className="diff-review-content",this._content.setAttribute("role","code"),this._scrollbar=this._register(new Hk(this._content,{})),gs(this.domNode,this._scrollbar.getDomNode(),a),this._register(bn(l=>{this._height.read(l),this._width.read(l),this._scrollbar.scanDomNode()})),this._register(Rt(()=>{gs(this.domNode)})),this._register(Dv(this.domNode,{width:this._width,height:this._height})),this._register(Dv(this._content,{width:this._width,height:this._height})),this._register(Dh((l,c)=>{this._model.currentGroup.read(l),this._render(c)})),this._register(Sr(this.domNode,"keydown",l=>{(l.equals(18)||l.equals(2066)||l.equals(530))&&(l.preventDefault(),this._model.goToNextLine()),(l.equals(16)||l.equals(2064)||l.equals(528))&&(l.preventDefault(),this._model.goToPreviousLine()),(l.equals(9)||l.equals(2057)||l.equals(521)||l.equals(1033))&&(l.preventDefault(),this._model.close()),(l.equals(10)||l.equals(3))&&(l.preventDefault(),this._model.revealCurrentElementInEditor())}))}_render(e){const t=this._models.getOriginalOptions(),n=this._models.getModifiedOptions(),r=document.createElement("div");r.className="diff-review-table",r.setAttribute("role","list"),r.setAttribute("aria-label",w("ariaLabel","Accessible Diff Viewer. Use arrow up and down to navigate.")),ps(r,n.get(50)),gs(this._content,r);const o=this._models.getOriginalModel(),s=this._models.getModifiedModel();if(!o||!s)return;const a=o.getOptions(),l=s.getOptions(),c=n.get(67),u=this._model.currentGroup.get();for(const d of(u==null?void 0:u.lines)||[]){if(!u)break;let h;if(d.type===ga.Header){const g=document.createElement("div");g.className="diff-review-row",g.setAttribute("role","listitem");const p=u.range,v=this._model.currentGroupIndex.get(),m=this._model.groups.get().length,_=E=>E===0?w("no_lines_changed","no lines changed"):E===1?w("one_line_changed","1 line changed"):w("more_lines_changed","{0} lines changed",E),y=_(p.original.length),S=_(p.modified.length);g.setAttribute("aria-label",w({key:"header",comment:["This is the ARIA label for a git diff header.","A git diff header looks like this: @@ -154,12 +159,39 @@.","That encodes that at original line 154 (which is now line 159), 12 lines were removed/changed with 39 lines.","Variables 0 and 1 refer to the diff index out of total number of diffs.","Variables 2 and 4 will be numbers (a line number).",'Variables 3 and 5 will be "no lines changed", "1 line changed" or "X lines changed", localized separately.']},"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",v+1,m,p.original.startLineNumber,y,p.modified.startLineNumber,S));const L=document.createElement("div");L.className="diff-review-cell diff-review-summary",L.appendChild(document.createTextNode(`${v+1}/${m}: @@ -${p.original.startLineNumber},${p.original.length} +${p.modified.startLineNumber},${p.modified.length} @@`)),g.appendChild(L),h=g}else h=this._createRow(d,c,this._width.get(),t,o,a,n,s,l);r.appendChild(h);const f=Yt(g=>this._model.currentElement.read(g)===d);e.add(bn(g=>{const p=f.read(g);h.tabIndex=p?0:-1,p&&h.focus()})),e.add(ye(h,"focus",()=>{this._model.goToLine(d)}))}this._scrollbar.scanDomNode()}_createRow(e,t,n,r,o,s,a,l,c){const u=r.get(144),d=u.glyphMarginWidth+u.lineNumbersWidth,h=a.get(144),f=10+h.glyphMarginWidth+h.lineNumbersWidth;let g="diff-review-row",p="";const v="diff-review-spacer";let m=null;switch(e.type){case ga.Added:g="diff-review-row line-insert",p=" char-insert",m=QZe;break;case ga.Deleted:g="diff-review-row line-delete",p=" char-delete",m=JZe;break}const _=document.createElement("div");_.style.minWidth=n+"px",_.className=g,_.setAttribute("role","listitem"),_.ariaLevel="";const y=document.createElement("div");y.className="diff-review-cell",y.style.height=`${t}px`,_.appendChild(y);const S=document.createElement("span");S.style.width=d+"px",S.style.minWidth=d+"px",S.className="diff-review-line-number"+p,e.originalLineNumber!==void 0?S.appendChild(document.createTextNode(String(e.originalLineNumber))):S.innerText=" ",y.appendChild(S);const L=document.createElement("span");L.style.width=f+"px",L.style.minWidth=f+"px",L.style.paddingRight="10px",L.className="diff-review-line-number"+p,e.modifiedLineNumber!==void 0?L.appendChild(document.createTextNode(String(e.modifiedLineNumber))):L.innerText=" ",y.appendChild(L);const E=document.createElement("span");if(E.className=v,m){const T=document.createElement("span");T.className=Wt.asClassName(m),T.innerText="  ",E.appendChild(T)}else E.innerText="  ";y.appendChild(E);let D;if(e.modifiedLineNumber!==void 0){let T=this._getLineHtml(l,a,c.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);Jm._ttPolicy&&(T=Jm._ttPolicy.createHTML(T)),y.insertAdjacentHTML("beforeend",T),D=l.getLineContent(e.modifiedLineNumber)}else{let T=this._getLineHtml(o,r,s.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);Jm._ttPolicy&&(T=Jm._ttPolicy.createHTML(T)),y.insertAdjacentHTML("beforeend",T),D=o.getLineContent(e.originalLineNumber)}D.length===0&&(D=w("blankLine","blank"));let k="";switch(e.type){case ga.Unchanged:e.originalLineNumber===e.modifiedLineNumber?k=w({key:"unchangedLine",comment:["The placeholders are contents of the line and should not be translated."]},"{0} unchanged line {1}",D,e.originalLineNumber):k=w("equalLine","{0} original line {1} modified line {2}",D,e.originalLineNumber,e.modifiedLineNumber);break;case ga.Added:k=w("insertLine","+ {0} modified line {1}",D,e.modifiedLineNumber);break;case ga.Deleted:k=w("deleteLine","- {0} original line {1}",D,e.originalLineNumber);break}return _.setAttribute("aria-label",k),_}_getLineHtml(e,t,n,r,o){const s=e.getLineContent(r),a=t.get(50),l=Lo.createEmpty(s,o),c=vc.isBasicASCII(s,e.mightContainNonBasicASCII()),u=vc.containsRTL(s,c,e.mightContainRTL());return N4(new D_(a.isMonospace&&!t.get(33),a.canUseHalfwidthRightwardsArrow,s,!1,c,u,0,l,[],n,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,t.get(117),t.get(99),t.get(94),t.get(51)!==ic.OFF,null)).html}};mz=vY([_Y(5,ji)],mz);class aQe{constructor(e){this.editors=e}getOriginalModel(){return this.editors.original.getModel()}getOriginalOptions(){return this.editors.original.getOptions()}originalReveal(e){this.editors.original.revealRange(e),this.editors.original.setSelection(e),this.editors.original.focus()}getModifiedModel(){return this.editors.modified.getModel()}getModifiedOptions(){return this.editors.modified.getOptions()}modifiedReveal(e){e&&(this.editors.modified.revealRange(e),this.editors.modified.setSelection(e)),this.editors.modified.focus()}modifiedSetSelection(e){this.editors.modified.setSelection(e)}modifiedFocus(){this.editors.modified.focus()}getModifiedPosition(){var e;return(e=this.editors.modified.getPosition())!==null&&e!==void 0?e:void 0}}class Iv extends fe{constructor(e,t,n,r,o){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=n,this._modifiedEditorLayoutInfo=r,this._editors=o,this._originalScrollTop=Vi(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Vi(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=ma("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=Hn(this,0),this._modifiedViewZonesChangedSignal=ma("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=ma("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=OS(this,(u,d)=>{var h;this._element.replaceChildren();const f=this._diffModel.read(u),g=(h=f==null?void 0:f.diff.read(u))===null||h===void 0?void 0:h.movedTexts;if(!g||g.length===0){this.width.set(0,void 0);return}this._viewZonesChanged.read(u);const p=this._originalEditorLayoutInfo.read(u),v=this._modifiedEditorLayoutInfo.read(u);if(!p||!v){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(u),this._originalViewZonesChangedSignal.read(u);const m=g.map(k=>{function T(U,K){const re=K.getTopForLineNumber(U.startLineNumber,!0),Y=K.getTopForLineNumber(U.endLineNumberExclusive,!0);return(re+Y)/2}const M=T(k.lineRangeMapping.original,this._editors.original),A=this._originalScrollTop.read(u),N=T(k.lineRangeMapping.modified,this._editors.modified),R=this._modifiedScrollTop.read(u),F=M-A,W=N-R,H=Math.min(M,N),G=Math.max(M,N);return{range:new vn(H,G),from:F,to:W,fromWithoutScroll:M,toWithoutScroll:N,move:k}});m.sort(O4e(Jc(k=>k.fromWithoutScroll>k.toWithoutScroll,F4e),Jc(k=>k.fromWithoutScroll>k.toWithoutScroll?k.fromWithoutScroll:-k.toWithoutScroll,dp)));const _=bY.compute(m.map(k=>k.range)),y=10,S=p.verticalScrollbarWidth,L=(_.getTrackCount()-1)*10+y*2,E=S+L+(v.contentLeft-Iv.movedCodeBlockPadding);let D=0;for(const k of m){const T=_.getTrack(D),M=S+y+T*10,A=15,N=15,R=E,F=v.glyphMarginWidth+v.lineNumbersWidth,W=18,H=document.createElementNS("http://www.w3.org/2000/svg","rect");H.classList.add("arrow-rectangle"),H.setAttribute("x",`${R-F}`),H.setAttribute("y",`${k.to-W/2}`),H.setAttribute("width",`${F}`),H.setAttribute("height",`${W}`),this._element.appendChild(H);const G=document.createElementNS("http://www.w3.org/2000/svg","g"),U=document.createElementNS("http://www.w3.org/2000/svg","path");U.setAttribute("d",`M 0 ${k.from} L ${M} ${k.from} L ${M} ${k.to} L ${R-N} ${k.to}`),U.setAttribute("fill","none"),G.appendChild(U);const K=document.createElementNS("http://www.w3.org/2000/svg","polygon");K.classList.add("arrow"),d.add(bn(re=>{U.classList.toggle("currentMove",k.move===f.activeMovedText.read(re)),K.classList.toggle("currentMove",k.move===f.activeMovedText.read(re))})),K.setAttribute("points",`${R-N},${k.to-A/2} ${R},${k.to} ${R-N},${k.to+A/2}`),G.appendChild(K),this._element.appendChild(G),D++}this.width.set(L,void 0)}),this._element=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("class","moved-blocks-lines"),this._rootElement.appendChild(this._element),this._register(Rt(()=>this._element.remove())),this._register(bn(u=>{const d=this._originalEditorLayoutInfo.read(u),h=this._modifiedEditorLayoutInfo.read(u);!d||!h||(this._element.style.left=`${d.width-d.verticalScrollbarWidth}px`,this._element.style.height=`${d.height}px`,this._element.style.width=`${d.verticalScrollbarWidth+d.contentLeft-Iv.movedCodeBlockPadding+this.width.read(u)}px`)})),this._register(oT(this._state));const s=Yt(u=>{const d=this._diffModel.read(u),h=d==null?void 0:d.diff.read(u);return h?h.movedTexts.map(f=>({move:f,original:new rO(ap(f.lineRangeMapping.original.startLineNumber-1),18),modified:new rO(ap(f.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(oO(this._editors.original,s.map(u=>u.map(d=>d.original)))),this._register(oO(this._editors.modified,s.map(u=>u.map(d=>d.modified)))),this._register(Dh((u,d)=>{const h=s.read(u);for(const f of h)d.add(new Wse(this._editors.original,f.original,f.move,"original",this._diffModel.get())),d.add(new Wse(this._editors.modified,f.modified,f.move,"modified",this._diffModel.get()))}));const a=ma("original.onDidFocusEditorWidget",u=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>u(void 0),0))),l=ma("modified.onDidFocusEditorWidget",u=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>u(void 0),0)));let c="modified";this._register(rT({createEmptyChangeSummary:()=>{},handleChange:(u,d)=>(u.didChange(a)&&(c="original"),u.didChange(l)&&(c="modified"),!0)},u=>{a.read(u),l.read(u);const d=this._diffModel.read(u);if(!d)return;const h=d.diff.read(u);let f;if(h&&c==="original"){const g=this._editors.originalCursor.read(u);g&&(f=h.movedTexts.find(p=>p.lineRangeMapping.original.contains(g.lineNumber)))}if(h&&c==="modified"){const g=this._editors.modifiedCursor.read(u);g&&(f=h.movedTexts.find(p=>p.lineRangeMapping.modified.contains(g.lineNumber)))}f!==d.movedTextToCompare.get()&&d.movedTextToCompare.set(void 0,void 0),d.setActiveMovedText(f)}))}}Iv.movedCodeBlockPadding=4;class bY{static compute(e){const t=[],n=[];for(const r of e){let o=t.findIndex(s=>!s.intersectsStrict(r));o===-1&&(t.length>=6?o=c9e(t,Jc(a=>a.intersectWithRangeLength(r),dp)):(o=t.length,t.push(new Fq))),t[o].addRange(r),n.push(o)}return new bY(t.length,n)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class Wse extends z0e{constructor(e,t,n,r,o){const s=gi("div.diff-hidden-lines-widget");super(e,t,s.root),this._editor=e,this._move=n,this._kind=r,this._diffModel=o,this._nodes=gi("div.diff-moved-code-block",{style:{marginRight:"4px"}},[gi("div.text-content@textContent"),gi("div.action-bar@actionBar")]),s.root.appendChild(this._nodes.root);const a=Vi(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(Dv(this._nodes.root,{paddingRight:a.map(h=>h.verticalScrollbarWidth)}));let l;n.changes.length>0?l=this._kind==="original"?w("codeMovedToWithChanges","Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):w("codeMovedFromWithChanges","Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):l=this._kind==="original"?w("codeMovedTo","Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):w("codeMovedFrom","Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const c=this._register(new au(this._nodes.actionBar,{highlightToggledItems:!0})),u=new xl("",l,"",!1);c.push(u,{icon:!1,label:!0});const d=new xl("","Compare",Wt.asClassName(Xe.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===n?void 0:this._move,void 0)});this._register(bn(h=>{const f=this._diffModel.movedTextToCompare.read(h)===n;d.checked=f})),c.push(d,{icon:!1,label:!0})}}X("diffEditor.move.border",{dark:"#8b8b8b9c",light:"#8b8b8b9c",hcDark:"#8b8b8b9c",hcLight:"#8b8b8b9c"},w("diffEditor.move.border","The border color for text that got moved in the diff editor."));X("diffEditor.moveActive.border",{dark:"#FFA500",light:"#FFA500",hcDark:"#FFA500",hcLight:"#FFA500"},w("diffEditor.moveActive.border","The active border color for text that got moved in the diff editor."));X("diffEditor.unchangedRegionShadow",{dark:"#000000",light:"#737373BF",hcDark:"#000000",hcLight:"#737373BF"},w("diffEditor.unchangedRegionShadow","The color of the shadow around unchanged region widgets."));const lQe=Mr("diff-insert",Xe.add,w("diffInsertIcon","Line decoration for inserts in the diff editor.")),U0e=Mr("diff-remove",Xe.remove,w("diffRemoveIcon","Line decoration for removals in the diff editor.")),$se=sn.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+Wt.asClassName(lQe),marginClassName:"gutter-insert"}),Hse=sn.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+Wt.asClassName(U0e),marginClassName:"gutter-delete"}),Vse=sn.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),zse=sn.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),Use=sn.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),cQe=sn.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),uQe=sn.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),vz=sn.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),dQe=sn.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),hQe=sn.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"});class fQe extends fe{constructor(e,t,n,r){super(),this._editors=e,this._diffModel=t,this._options=n,this._decorations=Yt(this,o=>{var s;const a=(s=this._diffModel.read(o))===null||s===void 0?void 0:s.diff.read(o);if(!a)return null;const l=this._diffModel.read(o).movedTextToCompare.read(o),c=this._options.renderIndicators.read(o),u=this._options.showEmptyDecorations.read(o),d=[],h=[];if(!l)for(const g of a.mappings)if(g.lineRangeMapping.original.isEmpty||d.push({range:g.lineRangeMapping.original.toInclusiveRange(),options:c?Hse:zse}),g.lineRangeMapping.modified.isEmpty||h.push({range:g.lineRangeMapping.modified.toInclusiveRange(),options:c?$se:Vse}),g.lineRangeMapping.modified.isEmpty||g.lineRangeMapping.original.isEmpty)g.lineRangeMapping.original.isEmpty||d.push({range:g.lineRangeMapping.original.toInclusiveRange(),options:dQe}),g.lineRangeMapping.modified.isEmpty||h.push({range:g.lineRangeMapping.modified.toInclusiveRange(),options:cQe});else for(const p of g.lineRangeMapping.innerChanges||[])g.lineRangeMapping.original.contains(p.originalRange.startLineNumber)&&d.push({range:p.originalRange,options:p.originalRange.isEmpty()&&u?hQe:vz}),g.lineRangeMapping.modified.contains(p.modifiedRange.startLineNumber)&&h.push({range:p.modifiedRange,options:p.modifiedRange.isEmpty()&&u?uQe:Use});if(l)for(const g of l.changes){const p=g.original.toInclusiveRange();p&&d.push({range:p,options:c?Hse:zse});const v=g.modified.toInclusiveRange();v&&h.push({range:v,options:c?$se:Vse});for(const m of g.innerChanges||[])d.push({range:m.originalRange,options:vz}),h.push({range:m.modifiedRange,options:Use})}const f=this._diffModel.read(o).activeMovedText.read(o);for(const g of a.movedTexts)d.push({range:g.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(g===f?" currentMove":""),blockPadding:[Iv.movedCodeBlockPadding,0,Iv.movedCodeBlockPadding,Iv.movedCodeBlockPadding]}}),h.push({range:g.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(g===f?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:d,modifiedDecorations:h}}),this._register(iO(this._editors.original,this._decorations.map(o=>(o==null?void 0:o.originalDecorations)||[]))),this._register(iO(this._editors.modified,this._decorations.map(o=>(o==null?void 0:o.modifiedDecorations)||[])))}}class gQe extends fe{constructor(e,t,n,r){super(),this._options=e,this._domNode=t,this._dimensions=n,this._sashes=r,this._sashRatio=Hn(this,void 0),this.sashLeft=Yt(this,o=>{var s;const a=(s=this._sashRatio.read(o))!==null&&s!==void 0?s:this._options.splitViewDefaultRatio.read(o);return this._computeSashLeft(a,o)}),this._sash=this._register(new Ls(this._domNode,{getVerticalSashTop:o=>0,getVerticalSashLeft:o=>this.sashLeft.get(),getVerticalSashHeight:o=>this._dimensions.height.get()},{orientation:0})),this._startSashPosition=void 0,this._register(this._sash.onDidStart(()=>{this._startSashPosition=this.sashLeft.get()})),this._register(this._sash.onDidChange(o=>{const s=this._dimensions.width.get(),a=this._computeSashLeft((this._startSashPosition+(o.currentX-o.startX))/s,void 0);this._sashRatio.set(a/s,void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._sashRatio.set(void 0,void 0))),this._register(bn(o=>{const s=this._sashes.read(o);s&&(this._sash.orthogonalEndSash=s.bottom)})),this._register(bn(o=>{const s=this._options.enableSplitViewResizing.read(o);this._sash.state=s?3:0,this.sashLeft.read(o),this._dimensions.height.read(o),this._sash.layout()}))}_computeSashLeft(e,t){const n=this._dimensions.width.read(t),r=Math.floor(this._options.splitViewDefaultRatio.read(t)*n),o=this._options.enableSplitViewResizing.read(t)?Math.floor(e*n):r,s=100;return n<=s*2?r:on-s?n-s:o}}var pQe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},mQe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},_z;let wI=_z=class extends fe{static setBreadcrumbsSourceFactory(e){this._breadcrumbsSourceFactory.set(e,void 0)}get isUpdatingHiddenAreas(){return this._isUpdatingHiddenAreas}constructor(e,t,n,r){super(),this._editors=e,this._diffModel=t,this._options=n,this._instantiationService=r,this._modifiedOutlineSource=wm(this,l=>{const c=this._editors.modifiedModel.read(l),u=_z._breadcrumbsSourceFactory.read(l);return!c||!u?void 0:u(c,this._instantiationService)}),this._isUpdatingHiddenAreas=!1,this._register(this._editors.original.onDidChangeCursorPosition(l=>{if(l.reason===3){const c=this._diffModel.get();Ri(u=>{for(const d of this._editors.original.getSelections()||[])c==null||c.ensureOriginalLineIsVisible(d.getStartPosition().lineNumber,0,u),c==null||c.ensureOriginalLineIsVisible(d.getEndPosition().lineNumber,0,u)})}})),this._register(this._editors.modified.onDidChangeCursorPosition(l=>{if(l.reason===3){const c=this._diffModel.get();Ri(u=>{for(const d of this._editors.modified.getSelections()||[])c==null||c.ensureModifiedLineIsVisible(d.getStartPosition().lineNumber,0,u),c==null||c.ensureModifiedLineIsVisible(d.getEndPosition().lineNumber,0,u)})}}));const o=this._diffModel.map((l,c)=>{var u,d;const h=(u=l==null?void 0:l.unchangedRegions.read(c))!==null&&u!==void 0?u:[];return h.length===1&&h[0].modifiedLineNumber===1&&h[0].lineCount===((d=this._editors.modifiedModel.read(c))===null||d===void 0?void 0:d.getLineCount())?[]:h});this.viewZones=OS(this,(l,c)=>{const u=this._modifiedOutlineSource.read(l);if(!u)return{origViewZones:[],modViewZones:[]};const d=[],h=[],f=this._options.renderSideBySide.read(l),g=o.read(l);for(const p of g)if(!p.shouldHideControls(l)){{const v=Yt(this,_=>p.getHiddenOriginalRange(_).startLineNumber-1),m=new rO(v,24);d.push(m),c.add(new jse(this._editors.original,m,p,p.originalUnchangedRange,!f,u,_=>this._diffModel.get().ensureModifiedLineIsVisible(_,2,void 0),this._options))}{const v=Yt(this,_=>p.getHiddenModifiedRange(_).startLineNumber-1),m=new rO(v,24);h.push(m),c.add(new jse(this._editors.modified,m,p,p.modifiedUnchangedRange,!1,u,_=>this._diffModel.get().ensureModifiedLineIsVisible(_,2,void 0),this._options))}}return{origViewZones:d,modViewZones:h}});const s={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},a={description:"Fold Unchanged",glyphMarginHoverMessage:new Is(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(w("foldUnchanged","Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+Wt.asClassName(Xe.fold),zIndex:10001};this._register(iO(this._editors.original,Yt(this,l=>{const c=o.read(l),u=c.map(d=>({range:d.originalUnchangedRange.toInclusiveRange(),options:s}));for(const d of c)d.shouldHideControls(l)&&u.push({range:B.fromPositions(new ae(d.originalLineNumber,1)),options:a});return u}))),this._register(iO(this._editors.modified,Yt(this,l=>{const c=o.read(l),u=c.map(d=>({range:d.modifiedUnchangedRange.toInclusiveRange(),options:s}));for(const d of c)d.shouldHideControls(l)&&u.push({range:pn.ofLength(d.modifiedLineNumber,1).toInclusiveRange(),options:a});return u}))),this._register(bn(l=>{const c=o.read(l);this._isUpdatingHiddenAreas=!0;try{this._editors.original.setHiddenAreas(c.map(u=>u.getHiddenOriginalRange(l).toInclusiveRange()).filter(kf)),this._editors.modified.setHiddenAreas(c.map(u=>u.getHiddenModifiedRange(l).toInclusiveRange()).filter(kf))}finally{this._isUpdatingHiddenAreas=!1}})),this._register(this._editors.modified.onMouseUp(l=>{var c;if(!l.event.rightButton&&l.target.position&&(!((c=l.target.element)===null||c===void 0)&&c.className.includes("fold-unchanged"))){const u=l.target.position.lineNumber,d=this._diffModel.get();if(!d)return;const h=d.unchangedRegions.get().find(f=>f.modifiedUnchangedRange.includes(u));if(!h)return;h.collapseAll(void 0),l.event.stopPropagation(),l.event.preventDefault()}})),this._register(this._editors.original.onMouseUp(l=>{var c;if(!l.event.rightButton&&l.target.position&&(!((c=l.target.element)===null||c===void 0)&&c.className.includes("fold-unchanged"))){const u=l.target.position.lineNumber,d=this._diffModel.get();if(!d)return;const h=d.unchangedRegions.get().find(f=>f.originalUnchangedRange.includes(u));if(!h)return;h.collapseAll(void 0),l.event.stopPropagation(),l.event.preventDefault()}}))}};wI._breadcrumbsSourceFactory=Hn("breadcrumbsSourceFactory",void 0);wI=_z=pQe([mQe(3,Ot)],wI);class jse extends z0e{constructor(e,t,n,r,o,s,a,l){const c=gi("div.diff-hidden-lines-widget");super(e,t,c.root),this._editor=e,this._unchangedRegion=n,this._unchangedRegionRange=r,this._hide=o,this._modifiedOutlineSource=s,this._revealModifiedHiddenLine=a,this._options=l,this._nodes=gi("div.diff-hidden-lines",[gi("div.top@top",{title:w("diff.hiddenLines.top","Click or drag to show more above")}),gi("div.center@content",{style:{display:"flex"}},[gi("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[He("a",{title:w("showUnchangedRegion","Show Unchanged Region"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...Sv("$(unfold)"))]),gi("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),gi("div.bottom@bottom",{title:w("diff.bottom","Click or drag to show more below"),role:"button"})]),c.root.appendChild(this._nodes.root);const u=Vi(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._hide?gs(this._nodes.first):this._register(Dv(this._nodes.first,{width:u.map(h=>h.contentLeft)})),this._register(bn(h=>{const f=this._unchangedRegion.visibleLineCountTop.read(h)+this._unchangedRegion.visibleLineCountBottom.read(h)===this._unchangedRegion.lineCount;this._nodes.bottom.classList.toggle("canMoveTop",!f),this._nodes.bottom.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(h)>0),this._nodes.top.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(h)>0),this._nodes.top.classList.toggle("canMoveBottom",!f);const g=this._unchangedRegion.isDragged.read(h),p=this._editor.getDomNode();p&&(p.classList.toggle("draggingUnchangedRegion",!!g),g==="top"?(p.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(h)>0),p.classList.toggle("canMoveBottom",!f)):g==="bottom"?(p.classList.toggle("canMoveTop",!f),p.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(h)>0)):(p.classList.toggle("canMoveTop",!1),p.classList.toggle("canMoveBottom",!1)))}));const d=this._editor;this._register(ye(this._nodes.top,"mousedown",h=>{if(h.button!==0)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const f=h.clientY;let g=!1;const p=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set("top",void 0);const v=Pt(this._nodes.top),m=ye(v,"mousemove",y=>{const L=y.clientY-f;g=g||Math.abs(L)>2;const E=Math.round(L/d.getOption(67)),D=Math.max(0,Math.min(p+E,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(D,void 0)}),_=ye(v,"mouseup",y=>{g||this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0),this._nodes.top.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),this._unchangedRegion.isDragged.set(void 0,void 0),m.dispose(),_.dispose()})})),this._register(ye(this._nodes.bottom,"mousedown",h=>{if(h.button!==0)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const f=h.clientY;let g=!1;const p=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set("bottom",void 0);const v=Pt(this._nodes.bottom),m=ye(v,"mousemove",y=>{const L=y.clientY-f;g=g||Math.abs(L)>2;const E=Math.round(L/d.getOption(67)),D=Math.max(0,Math.min(p-E,this._unchangedRegion.getMaxVisibleLineCountBottom())),k=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(D,void 0);const T=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(T-k))}),_=ye(v,"mouseup",y=>{if(this._unchangedRegion.isDragged.set(void 0,void 0),!g){const S=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const L=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(L-S))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),m.dispose(),_.dispose()})})),this._register(bn(h=>{const f=[];if(!this._hide){const g=n.getHiddenModifiedRange(h).length,p=w("hiddenLines","{0} hidden lines",g),v=He("span",{title:w("diff.hiddenLines.expandAll","Double click to unfold")},p);v.addEventListener("dblclick",y=>{y.button===0&&(y.preventDefault(),this._unchangedRegion.showAll(void 0))}),f.push(v);const m=this._unchangedRegion.getHiddenModifiedRange(h),_=this._modifiedOutlineSource.getBreadcrumbItems(m,h);if(_.length>0){f.push(He("span",void 0,"  |  "));for(let y=0;y<_.length;y++){const S=_[y],L=BA.toIcon(S.kind),E=gi("div.breadcrumb-item",{style:{display:"flex",alignItems:"center"}},[nI(L)," ",S.name,...y===_.length-1?[]:[nI(Xe.chevronRight)]]).root;f.push(E),E.onclick=()=>{this._revealModifiedHiddenLine(S.startLineNumber)}}}}gs(this._nodes.others,...f)}))}}var j0e=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},bz=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},m0;const K0e=yn("diffProviderFactoryService");let Cz=class{constructor(e){this.instantiationService=e}createDiffProvider(e){return this.instantiationService.createInstance(sO,e)}};Cz=j0e([bz(0,Ot)],Cz);In(K0e,Cz,1);let sO=m0=class{constructor(e,t,n){this.editorWorkerService=t,this.telemetryService=n,this.onDidChangeEventEmitter=new se,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){var e;(e=this.diffAlgorithmOnDidChangeSubscription)===null||e===void 0||e.dispose()}async computeDiff(e,t,n,r){var o,s;if(typeof this.diffAlgorithm!="string")return this.diffAlgorithm.computeDiff(e,t,n,r);if(e.getLineCount()===1&&e.getLineMaxColumn(1)===1)return t.getLineCount()===1&&t.getLineMaxColumn(1)===1?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new hh(new pn(1,2),new pn(1,t.getLineCount()+1),[new qv(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const a=JSON.stringify([e.uri.toString(),t.uri.toString()]),l=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(n)]),c=m0.diffCache.get(a);if(c&&c.context===l)return c.result;const u=Ms.create(),d=await this.editorWorkerService.computeDiff(e.uri,t.uri,n,this.diffAlgorithm),h=u.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:h,timedOut:(o=d==null?void 0:d.quitEarly)!==null&&o!==void 0?o:!0,detectedMoves:n.computeMoves?(s=d==null?void 0:d.moves.length)!==null&&s!==void 0?s:0:-1}),r.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!d)throw new Error("no diff result available");return m0.diffCache.size>10&&m0.diffCache.delete(m0.diffCache.keys().next().value),m0.diffCache.set(a,{result:d,context:l}),d}setOptions(e){var t;let n=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&((t=this.diffAlgorithmOnDidChangeSubscription)===null||t===void 0||t.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,typeof e.diffAlgorithm!="string"&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange(()=>this.onDidChangeEventEmitter.fire())),n=!0),n&&this.onDidChangeEventEmitter.fire()}};sO.diffCache=new Map;sO=m0=j0e([bz(1,hd),bz(2,ea)],sO);var vQe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},_Qe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let yz=class extends fe{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,t,n){super(),this.model=e,this._options=t,this._diffProviderFactoryService=n,this._isDiffUpToDate=Hn(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=Hn(this,void 0),this.diff=this._diff,this._unchangedRegions=Hn(this,void 0),this.unchangedRegions=Yt(this,a=>{var l,c;return this._options.hideUnchangedRegions.read(a)?(c=(l=this._unchangedRegions.read(a))===null||l===void 0?void 0:l.regions)!==null&&c!==void 0?c:[]:(Ri(u=>{var d;for(const h of((d=this._unchangedRegions.get())===null||d===void 0?void 0:d.regions)||[])h.collapseAll(u)}),[])}),this.movedTextToCompare=Hn(this,void 0),this._activeMovedText=Hn(this,void 0),this._hoveredMovedText=Hn(this,void 0),this.activeMovedText=Yt(this,a=>{var l,c;return(c=(l=this.movedTextToCompare.read(a))!==null&&l!==void 0?l:this._hoveredMovedText.read(a))!==null&&c!==void 0?c:this._activeMovedText.read(a)}),this._cancellationTokenSource=new wr,this._diffProvider=Yt(this,a=>{const l=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:this._options.diffAlgorithm.read(a)}),c=ma("onDidChange",l.onDidChange);return{diffProvider:l,onChangeSignal:c}}),this._register(Rt(()=>this._cancellationTokenSource.cancel()));const r=pY("contentChangedSignal"),o=this._register(new pi(()=>r.trigger(void 0),200));this._register(bn(a=>{const l=this._unchangedRegions.read(a);if(!l||l.regions.some(g=>g.isDragged.read(a)))return;const c=l.originalDecorationIds.map(g=>e.original.getDecorationRange(g)).map(g=>g?pn.fromRangeInclusive(g):void 0),u=l.modifiedDecorationIds.map(g=>e.modified.getDecorationRange(g)).map(g=>g?pn.fromRangeInclusive(g):void 0),d=l.regions.map((g,p)=>!c[p]||!u[p]?void 0:new ev(c[p].startLineNumber,u[p].startLineNumber,c[p].length,g.visibleLineCountTop.read(a),g.visibleLineCountBottom.read(a))).filter(kf),h=[];let f=!1;for(const g of QG(d,(p,v)=>p.getHiddenModifiedRange(a).endLineNumberExclusive===v.getHiddenModifiedRange(a).startLineNumber))if(g.length>1){f=!0;const p=g.reduce((m,_)=>m+_.lineCount,0),v=new ev(g[0].originalLineNumber,g[0].modifiedLineNumber,p,g[0].visibleLineCountTop.get(),g[g.length-1].visibleLineCountBottom.get());h.push(v)}else h.push(g[0]);if(f){const g=e.original.deltaDecorations(l.originalDecorationIds,h.map(v=>({range:v.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),p=e.modified.deltaDecorations(l.modifiedDecorationIds,h.map(v=>({range:v.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));Ri(v=>{this._unchangedRegions.set({regions:h,originalDecorationIds:g,modifiedDecorationIds:p},v)})}}));const s=(a,l,c)=>{const u=ev.fromDiffs(a.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(c),this._options.hideUnchangedRegionsContextLineCount.read(c));let d;const h=this._unchangedRegions.get();if(h){const v=h.originalDecorationIds.map(S=>e.original.getDecorationRange(S)).map(S=>S?pn.fromRangeInclusive(S):void 0),m=h.modifiedDecorationIds.map(S=>e.modified.getDecorationRange(S)).map(S=>S?pn.fromRangeInclusive(S):void 0);let y=ZZe(h.regions.map((S,L)=>{if(!v[L]||!m[L])return;const E=v[L].length;return new ev(v[L].startLineNumber,m[L].startLineNumber,E,Math.min(S.visibleLineCountTop.get(),E),Math.min(S.visibleLineCountBottom.get(),E-S.visibleLineCountTop.get()))}).filter(kf),(S,L)=>!L||S.modifiedLineNumber>=L.modifiedLineNumber+L.lineCount&&S.originalLineNumber>=L.originalLineNumber+L.lineCount).map(S=>new Ya(S.getHiddenOriginalRange(c),S.getHiddenModifiedRange(c)));y=Ya.clip(y,pn.ofLength(1,e.original.getLineCount()),pn.ofLength(1,e.modified.getLineCount())),d=Ya.inverse(y,e.original.getLineCount(),e.modified.getLineCount())}const f=[];if(d)for(const v of u){const m=d.filter(_=>_.original.intersectsStrict(v.originalUnchangedRange)&&_.modified.intersectsStrict(v.modifiedUnchangedRange));f.push(...v.setVisibleRanges(m,l))}else f.push(...u);const g=e.original.deltaDecorations((h==null?void 0:h.originalDecorationIds)||[],f.map(v=>({range:v.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),p=e.modified.deltaDecorations((h==null?void 0:h.modifiedDecorationIds)||[],f.map(v=>({range:v.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));this._unchangedRegions.set({regions:f,originalDecorationIds:g,modifiedDecorationIds:p},l)};this._register(e.modified.onDidChangeContent(a=>{if(this._diff.get()){const c=op.fromModelContentChanges(a.changes);this._lastDiff,e.original,e.modified}this._isDiffUpToDate.set(!1,void 0),o.schedule()})),this._register(e.original.onDidChangeContent(a=>{if(this._diff.get()){const c=op.fromModelContentChanges(a.changes);this._lastDiff,e.original,e.modified}this._isDiffUpToDate.set(!1,void 0),o.schedule()})),this._register(Dh(async(a,l)=>{var c,u;this._options.hideUnchangedRegionsMinimumLineCount.read(a),this._options.hideUnchangedRegionsContextLineCount.read(a),o.cancel(),r.read(a);const d=this._diffProvider.read(a);d.onChangeSignal.read(a),sf(Hme,a),sf(yH,a),this._isDiffUpToDate.set(!1,void 0);let h=[];l.add(e.original.onDidChangeContent(p=>{const v=op.fromModelContentChanges(p.changes);h=mP(h,v)}));let f=[];l.add(e.modified.onDidChangeContent(p=>{const v=op.fromModelContentChanges(p.changes);f=mP(f,v)}));let g=await d.diffProvider.computeDiff(e.original,e.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(a),maxComputationTimeMs:this._options.maxComputationTimeMs.read(a),computeMoves:this._options.showMoves.read(a)},this._cancellationTokenSource.token);this._cancellationTokenSource.token.isCancellationRequested||(g=bQe(g,e.original,e.modified),g=(c=(e.original,e.modified,void 0))!==null&&c!==void 0?c:g,g=(u=(e.original,e.modified,void 0))!==null&&u!==void 0?u:g,Ri(p=>{s(g,p),this._lastDiff=g;const v=CY.fromDiffResult(g);this._diff.set(v,p),this._isDiffUpToDate.set(!0,p);const m=this.movedTextToCompare.get();this.movedTextToCompare.set(m?this._lastDiff.moves.find(_=>_.lineRangeMapping.modified.intersect(m.lineRangeMapping.modified)):void 0,p)}))}))}ensureModifiedLineIsVisible(e,t,n){var r,o;if(((r=this.diff.get())===null||r===void 0?void 0:r.mappings.length)===0)return;const s=((o=this._unchangedRegions.get())===null||o===void 0?void 0:o.regions)||[];for(const a of s)if(a.getHiddenModifiedRange(void 0).contains(e)){a.showModifiedLine(e,t,n);return}}ensureOriginalLineIsVisible(e,t,n){var r,o;if(((r=this.diff.get())===null||r===void 0?void 0:r.mappings.length)===0)return;const s=((o=this._unchangedRegions.get())===null||o===void 0?void 0:o.regions)||[];for(const a of s)if(a.getHiddenOriginalRange(void 0).contains(e)){a.showOriginalLine(e,t,n);return}}async waitForDiff(){await zZe(this.isDiffUpToDate,e=>e)}serializeState(){const e=this._unchangedRegions.get();return{collapsedRegions:e==null?void 0:e.regions.map(t=>({range:t.getHiddenModifiedRange(void 0).serialize()}))}}restoreSerializedState(e){var t;const n=(t=e.collapsedRegions)===null||t===void 0?void 0:t.map(o=>pn.deserialize(o.range)),r=this._unchangedRegions.get();!r||!n||Ri(o=>{for(const s of r.regions)for(const a of n)if(s.modifiedUnchangedRange.intersect(a)){s.setHiddenModifiedRange(a,o);break}})}};yz=vQe([_Qe(2,K0e)],yz);function bQe(i,e,t){return{changes:i.changes.map(n=>new hh(n.original,n.modified,n.innerChanges?n.innerChanges.map(r=>CQe(r,e,t)):void 0)),moves:i.moves,identical:i.identical,quitEarly:i.quitEarly}}function CQe(i,e,t){let n=i.originalRange,r=i.modifiedRange;return(n.endColumn!==1||r.endColumn!==1)&&n.endColumn===e.getLineMaxColumn(n.endLineNumber)&&r.endColumn===t.getLineMaxColumn(r.endLineNumber)&&n.endLineNumbernew G0e(t)),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,n,r){this.mappings=e,this.movedTexts=t,this.identical=n,this.quitEarly=r}}class G0e{constructor(e){this.lineRangeMapping=e}}class ev{static fromDiffs(e,t,n,r,o){const s=hh.inverse(e,t,n),a=[];for(const l of s){let c=l.original.startLineNumber,u=l.modified.startLineNumber,d=l.original.length;const h=c===1&&u===1,f=c+d===t+1&&u+d===n+1;(h||f)&&d>=o+r?(h&&!f&&(d-=o),f&&!h&&(c+=o,u+=o,d-=o),a.push(new ev(c,u,d,0,0))):d>=o*2+r&&(c+=o,u+=o,d-=o*2,a.push(new ev(c,u,d,0,0)))}return a}get originalUnchangedRange(){return pn.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return pn.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,n,r,o){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=n,this._visibleLineCountTop=Hn(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=Hn(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=Yt(this,l=>this.visibleLineCountTop.read(l)+this.visibleLineCountBottom.read(l)===this.lineCount&&!this.isDragged.read(l)),this.isDragged=Hn(this,void 0);const s=Math.max(Math.min(r,this.lineCount),0),a=Math.max(Math.min(o,this.lineCount-r),0);uie(r===s),uie(o===a),this._visibleLineCountTop.set(s,void 0),this._visibleLineCountBottom.set(a,void 0)}setVisibleRanges(e,t){const n=[],r=new Hu(e.map(l=>l.modified)).subtractFrom(this.modifiedUnchangedRange);let o=this.originalLineNumber,s=this.modifiedLineNumber;const a=this.modifiedLineNumber+this.lineCount;if(r.ranges.length===0)this.showAll(t),n.push(this);else{let l=0;for(const c of r.ranges){const u=l===r.ranges.length-1;l++;const d=(u?a:c.endLineNumberExclusive)-s,h=new ev(o,s,d,0,0);h.setHiddenModifiedRange(c,t),n.push(h),o=h.originalUnchangedRange.endLineNumberExclusive,s=h.modifiedUnchangedRange.endLineNumberExclusive}}return n}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return pn.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return pn.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,t){const n=e.startLineNumber-this.modifiedLineNumber,r=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(n,r,t)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,t){const n=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,n),t)}showMoreBelow(e=10,t){const n=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,n),t)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,t,n){const r=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),o=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;t===0&&r{var v;this._contextMenuService.showContextMenu({domForShadowRoot:h&&(v=n.getDomNode())!==null&&v!==void 0?v:void 0,getAnchor:()=>({x:g,y:p}),getActions:()=>{const m=[],_=r.modified.isEmpty;return m.push(new xl("diff.clipboard.copyDeletedContent",_?r.original.length>1?w("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):w("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"):r.original.length>1?w("diff.clipboard.copyChangedLinesContent.label","Copy changed lines"):w("diff.clipboard.copyChangedLinesContent.single.label","Copy changed line"),void 0,!0,async()=>{const S=this._originalTextModel.getValueInRange(r.original.toExclusiveRange());await this._clipboardService.writeText(S)})),r.original.length>1&&m.push(new xl("diff.clipboard.copyDeletedLineContent",_?w("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",r.original.startLineNumber+d):w("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",r.original.startLineNumber+d),void 0,!0,async()=>{let S=this._originalTextModel.getLineContent(r.original.startLineNumber+d);S===""&&(S=this._originalTextModel.getEndOfLineSequence()===0?` `:`\r -`),await this._clipboardService.writeText(S)})),n.getOption(91)||m.push(new xl("diff.inline.revertChange",w("diff.inline.revertChange.label","Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),m},autoSelectFirstItem:!0})};this._register(Sr(this._diffActions,"mousedown",g=>{if(!g.leftButton)return;const{top:p,height:v}=Br(this._diffActions),m=Math.floor(u/3);g.preventDefault(),f(g.posx,p+v+m)})),this._register(n.onMouseMove(g=>{(g.target.type===8||g.target.type===5)&&g.target.detail.viewZoneId===this._getViewZoneId()?(d=this._updateLightBulbPosition(this._marginDomNode,g.event.browserEvent.y,u),this.visibility=!0):this.visibility=!1})),this._register(n.onMouseDown(g=>{g.event.leftButton&&(g.target.type===8||g.target.type===5)&&g.target.detail.viewZoneId===this._getViewZoneId()&&(g.event.preventDefault(),d=this._updateLightBulbPosition(this._marginDomNode,g.event.browserEvent.y,u),f(g.event.posx,g.event.posy+u))}))}_updateLightBulbPosition(e,t,n){const{top:r}=Br(e),o=t-r,s=Math.floor(o/n),a=s*n;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let l=0;for(let c=0;ci});function wQe(i,e,t,n){ps(n,e.fontInfo);const r=t.length>0,o=new DS(1e4);let s=0,a=0;const l=[];for(let h=0;h');const l=e.getLineContent(),c=vc.isBasicASCII(l,r),u=vc.containsRTL(l,c,o),d=Fk(new I_(s.fontInfo.isMonospace&&!s.disableMonospaceOptimizations,s.fontInfo.canUseHalfwidthRightwardsArrow,l,!1,c,u,0,e,t,s.tabSize,0,s.fontInfo.spaceWidth,s.fontInfo.middotWidth,s.fontInfo.wsmiddotWidth,s.stopRenderingLineAfter,s.renderWhitespace,s.renderControlCharacters,s.fontLigatures!==ic.OFF,null),a);return a.appendString(""),d.characterMapping.getHorizontalOffset(d.characterMapping.length)}var xQe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},qse=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let wz=class extends fe{constructor(e,t,n,r,o,s,a,l,c,u){super(),this._targetWindow=e,this._editors=t,this._diffModel=n,this._options=r,this._diffEditorWidget=o,this._canIgnoreViewZoneUpdateEvent=s,this._origViewZonesToIgnore=a,this._modViewZonesToIgnore=l,this._clipboardService=c,this._contextMenuService=u,this._originalTopPadding=Hn(this,0),this._originalScrollOffset=Hn(this,0),this._originalScrollOffsetAnimated=Fse(this._targetWindow,this._originalScrollOffset,this._store),this._modifiedTopPadding=Hn(this,0),this._modifiedScrollOffset=Hn(this,0),this._modifiedScrollOffsetAnimated=Fse(this._targetWindow,this._modifiedScrollOffset,this._store);const d=Hn("invalidateAlignmentsState",0),h=this._register(new pi(()=>{d.set(d.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(y=>{this._canIgnoreViewZoneUpdateEvent()||h.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(y=>{this._canIgnoreViewZoneUpdateEvent()||h.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(y=>{(y.hasChanged(145)||y.hasChanged(67))&&h.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(y=>{(y.hasChanged(145)||y.hasChanged(67))&&h.schedule()}));const f=this._diffModel.map(y=>y?Vi(y.model.original.onDidChangeTokens,()=>y.model.original.tokenization.backgroundTokenizationState===2):void 0).map((y,S)=>y==null?void 0:y.read(S)),g=Yt(y=>{const S=this._diffModel.read(y),L=S==null?void 0:S.diff.read(y);if(!S||!L)return null;d.read(y);const D=this._options.renderSideBySide.read(y);return Xse(this._editors.original,this._editors.modified,L.mappings,this._origViewZonesToIgnore,this._modViewZonesToIgnore,D)}),p=Yt(y=>{var S;const L=(S=this._diffModel.read(y))===null||S===void 0?void 0:S.movedTextToCompare.read(y);if(!L)return null;d.read(y);const E=L.changes.map(D=>new G0e(D));return Xse(this._editors.original,this._editors.modified,E,this._origViewZonesToIgnore,this._modViewZonesToIgnore,!0)});function v(){const y=document.createElement("div");return y.className="diagonal-fill",y}const m=this._register(new Te);this.viewZones=OS(this,(y,S)=>{var L,E,D,k,T,M,A,N;m.clear();const R=g.read(y)||[],F=[],W=[],H=this._modifiedTopPadding.read(y);H>0&&W.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:H,showInHiddenAreas:!0,suppressMouseDown:!0});const G=this._originalTopPadding.read(y);G>0&&F.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:G,showInHiddenAreas:!0,suppressMouseDown:!0});const U=this._options.renderSideBySide.read(y),K=U||(L=this._editors.modified._getViewModel())===null||L===void 0?void 0:L.createLineBreaksComputer();if(K){const ve=this._editors.original.getModel();for(const Ve of R)if(Ve.diff)for(let Ze=Ve.originalRange.startLineNumber;Zeve.getLineCount())return{orig:F,mod:W};K==null||K.addRequest(ve.getLineContent(Ze),null,null)}}const re=(E=K==null?void 0:K.finalize())!==null&&E!==void 0?E:[];let Y=0;const J=this._editors.modified.getOption(67),Q=(D=this._diffModel.read(y))===null||D===void 0?void 0:D.movedTextToCompare.read(y),ue=(T=(k=this._editors.original.getModel())===null||k===void 0?void 0:k.mightContainNonBasicASCII())!==null&&T!==void 0?T:!1,de=(A=(M=this._editors.original.getModel())===null||M===void 0?void 0:M.mightContainRTL())!==null&&A!==void 0?A:!1,_e=yY.fromEditor(this._editors.modified);for(const ve of R)if(ve.diff&&!U){if(!ve.originalRange.isEmpty){f.read(y);const Ze=document.createElement("div");Ze.classList.add("view-lines","line-delete","monaco-mouse-cursor-text");const We=this._editors.original.getModel();if(ve.originalRange.endLineNumberExclusive-1>We.getLineCount())return{orig:F,mod:W};const pe=new SQe(ve.originalRange.mapToLineArray(Qe=>We.tokenization.getLineTokens(Qe)),ve.originalRange.mapToLineArray(Qe=>re[Y++]),ue,de),Pe=[];for(const Qe of ve.diff.innerChanges||[])Pe.push(new dE(Qe.originalRange.delta(-(ve.diff.original.startLineNumber-1)),vz.className,0));const Se=wQe(pe,_e,Pe,Ze),Ne=document.createElement("div");if(Ne.className="inline-deleted-margin-view-zone",ps(Ne,_e.fontInfo),this._options.renderIndicators.read(y))for(let Qe=0;QeVm(Me),Ne,this._editors.modified,ve.diff,this._diffEditorWidget,Se.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let Qe=0;Qe1&&F.push({afterLineNumber:ve.originalRange.startLineNumber+Qe,domNode:v(),heightInPx:(Ke-1)*J,showInHiddenAreas:!0,suppressMouseDown:!0})}W.push({afterLineNumber:ve.modifiedRange.startLineNumber-1,domNode:Ze,heightInPx:Se.heightInLines*J,minWidthInPx:Se.minWidthInPx,marginDomNode:Ne,setZoneId(Qe){Me=Qe},showInHiddenAreas:!0,suppressMouseDown:!0})}const Ve=document.createElement("div");Ve.className="gutter-delete",F.push({afterLineNumber:ve.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:ve.modifiedHeightInPx,marginDomNode:Ve,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const Ve=ve.modifiedHeightInPx-ve.originalHeightInPx;if(Ve>0){if(Q!=null&&Q.lineRangeMapping.original.delta(-1).deltaLength(2).contains(ve.originalRange.endLineNumberExclusive-1))continue;F.push({afterLineNumber:ve.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:Ve,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let Ze=function(){const pe=document.createElement("div");return pe.className="arrow-revert-change "+Wt.asClassName(Xe.arrowRight),S.add(ye(pe,"mousedown",Pe=>Pe.stopPropagation())),S.add(ye(pe,"click",Pe=>{Pe.stopPropagation(),o.revert(ve.diff)})),He("div",{},pe)};if(Q!=null&&Q.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(ve.modifiedRange.endLineNumberExclusive-1))continue;let We;ve.diff&&ve.diff.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(y)&&(We=Ze()),W.push({afterLineNumber:ve.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-Ve,marginDomNode:We,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const ve of(N=p.read(y))!==null&&N!==void 0?N:[]){if(!(Q!=null&&Q.lineRangeMapping.original.intersect(ve.originalRange))||!(Q!=null&&Q.lineRangeMapping.modified.intersect(ve.modifiedRange)))continue;const Ve=ve.modifiedHeightInPx-ve.originalHeightInPx;Ve>0?F.push({afterLineNumber:ve.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:Ve,showInHiddenAreas:!0,suppressMouseDown:!0}):W.push({afterLineNumber:ve.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-Ve,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:F,mod:W}});let _=!1;this._register(this._editors.original.onDidScrollChange(y=>{y.scrollLeftChanged&&!_&&(_=!0,this._editors.modified.setScrollLeft(y.scrollLeft),_=!1)})),this._register(this._editors.modified.onDidScrollChange(y=>{y.scrollLeftChanged&&!_&&(_=!0,this._editors.original.setScrollLeft(y.scrollLeft),_=!1)})),this._originalScrollTop=Vi(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Vi(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(bn(y=>{const S=this._originalScrollTop.read(y)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(y))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(y));S!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(S,1)})),this._register(bn(y=>{const S=this._modifiedScrollTop.read(y)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(y))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(y));S!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(S,1)})),this._register(bn(y=>{var S;const L=(S=this._diffModel.read(y))===null||S===void 0?void 0:S.movedTextToCompare.read(y);let E=0;if(L){const D=this._editors.original.getTopForLineNumber(L.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();E=this._editors.modified.getTopForLineNumber(L.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-D}E>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(E,void 0)):E<0?(this._modifiedTopPadding.set(-E,void 0),this._originalTopPadding.set(0,void 0)):setTimeout(()=>{this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(0,void 0)},400),this._editors.modified.hasTextFocus()?this._originalScrollOffset.set(this._modifiedScrollOffset.get()-E,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+E,void 0,!0)}))}};wz=xQe([qse(8,jp),qse(9,Ol)],wz);function Xse(i,e,t,n,r,o){const s=new Ep(Yse(i,n)),a=new Ep(Yse(e,r)),l=i.getOption(67),c=e.getOption(67),u=[];let d=0,h=0;function f(g,p){for(;;){let v=s.peek(),m=a.peek();if(v&&v.lineNumber>=g&&(v=void 0),m&&m.lineNumber>=p&&(m=void 0),!v&&!m)break;const _=v?v.lineNumber-d:Number.MAX_VALUE,y=m?m.lineNumber-h:Number.MAX_VALUE;_y?(a.dequeue(),v={lineNumber:m.lineNumber-h+d,heightInPx:0}):(s.dequeue(),a.dequeue()),u.push({originalRange:pn.ofLength(v.lineNumber,1),modifiedRange:pn.ofLength(m.lineNumber,1),originalHeightInPx:l+v.heightInPx,modifiedHeightInPx:c+m.heightInPx,diff:void 0})}}for(const g of t){let y=function(S,L){var E,D,k,T;if(S<_||LF.lineNumberF+W.heightInPx,0))!==null&&D!==void 0?D:0,R=(T=(k=a.takeWhile(F=>F.lineNumberF+W.heightInPx,0))!==null&&T!==void 0?T:0;u.push({originalRange:M,modifiedRange:A,originalHeightInPx:M.length*l+N,modifiedHeightInPx:A.length*c+R,diff:g.lineRangeMapping}),_=S,m=L};const p=g.lineRangeMapping;f(p.original.startLineNumber,p.modified.startLineNumber);let v=!0,m=p.modified.startLineNumber,_=p.original.startLineNumber;if(o)for(const S of p.innerChanges||[]){S.originalRange.startColumn>1&&S.modifiedRange.startColumn>1&&y(S.originalRange.startLineNumber,S.modifiedRange.startLineNumber);const L=i.getModel(),E=S.originalRange.endLineNumber<=L.getLineCount()?L.getLineMaxColumn(S.originalRange.endLineNumber):Number.MAX_SAFE_INTEGER;S.originalRange.endColumn1&&n.push({lineNumber:l,heightInPx:s*(c-1)})}for(const l of i.getWhitespaces()){if(e.has(l.id))continue;const c=l.afterLineNumber===0?0:o.convertViewPositionToModelPosition(new ae(l.afterLineNumber,1)).lineNumber;t.push({lineNumber:c,heightInPx:l.height})}return jZe(t,n,l=>l.lineNumber,(l,c)=>({lineNumber:l.lineNumber,heightInPx:l.heightInPx+c.heightInPx}))}var LQe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},EQe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Au;let Wb=Au=class extends fe{constructor(e,t,n,r,o,s,a){super(),this._editors=e,this._rootElement=t,this._diffModel=n,this._rootWidth=r,this._rootHeight=o,this._modifiedEditorLayoutInfo=s,this._themeService=a,this.width=Au.ENTIRE_DIFF_OVERVIEW_WIDTH;const l=Vi(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),c=Yt(h=>{const f=l.read(h),g=f.getColor(gWe)||(f.getColor(hWe)||kH).transparent(2),p=f.getColor(pWe)||(f.getColor(fWe)||TH).transparent(2);return{insertColor:g,removeColor:p}}),u=Qn(document.createElement("div"));u.setClassName("diffViewport"),u.setPosition("absolute");const d=gi("div.diffOverview",{style:{position:"absolute",top:"0px",width:Au.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;this._register(zR(d,u.domNode)),this._register(Sr(d,Ge.POINTER_DOWN,h=>{this._editors.modified.delegateVerticalScrollbarPointerDown(h)})),this._register(ye(d,Ge.MOUSE_WHEEL,h=>{this._editors.modified.delegateScrollFromMouseWheelEvent(h)},{passive:!1})),this._register(zR(this._rootElement,d)),this._register(Dh((h,f)=>{const g=this._diffModel.read(h),p=this._editors.original.createOverviewRuler("original diffOverviewRuler");p&&(f.add(p),f.add(zR(d,p.getDomNode())));const v=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(v&&(f.add(v),f.add(zR(d,v.getDomNode()))),!p||!v)return;const m=ma("viewZoneChanged",this._editors.original.onDidChangeViewZones),_=ma("viewZoneChanged",this._editors.modified.onDidChangeViewZones),y=ma("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),S=ma("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);f.add(bn(L=>{var E;m.read(L),_.read(L),y.read(L),S.read(L);const D=c.read(L),k=(E=g==null?void 0:g.diff.read(L))===null||E===void 0?void 0:E.mappings;function T(N,R,F){const W=F._getViewModel();return W?N.filter(H=>H.length>0).map(H=>{const G=W.coordinatesConverter.convertModelPositionToViewPosition(new ae(H.startLineNumber,1)),U=W.coordinatesConverter.convertModelPositionToViewPosition(new ae(H.endLineNumberExclusive,1)),K=U.lineNumber-G.lineNumber;return new Fve(G.lineNumber,U.lineNumber,K,R.toString())}):[]}const M=T((k||[]).map(N=>N.lineRangeMapping.original),D.removeColor,this._editors.original),A=T((k||[]).map(N=>N.lineRangeMapping.modified),D.insertColor,this._editors.modified);p==null||p.setZones(M),v==null||v.setZones(A)})),f.add(bn(L=>{const E=this._rootHeight.read(L),D=this._rootWidth.read(L),k=this._modifiedEditorLayoutInfo.read(L);if(k){const T=Au.ENTIRE_DIFF_OVERVIEW_WIDTH-2*Au.ONE_OVERVIEW_WIDTH;p.setLayout({top:0,height:E,right:T+Au.ONE_OVERVIEW_WIDTH,width:Au.ONE_OVERVIEW_WIDTH}),v.setLayout({top:0,height:E,right:0,width:Au.ONE_OVERVIEW_WIDTH});const M=this._editors.modifiedScrollTop.read(L),A=this._editors.modifiedScrollHeight.read(L),N=this._editors.modified.getOption(103),R=new Bw(N.verticalHasArrows?N.arrowSize:0,N.verticalScrollbarSize,0,k.height,A,M);u.setTop(R.getSliderPosition()),u.setHeight(R.getSliderSize())}else u.setTop(0),u.setHeight(0);d.style.height=E+"px",d.style.left=D-Au.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",u.setWidth(Au.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}};Wb.ONE_OVERVIEW_WIDTH=15;Wb.ENTIRE_DIFF_OVERVIEW_WIDTH=Au.ONE_OVERVIEW_WIDTH*2;Wb=Au=LQe([EQe(6,To)],Wb);class y3 extends fe{constructor(){super(...arguments),this._id=++y3.idCounter,this._onDidDispose=this._register(new se),this.onDidDispose=this._onDidDispose.event}getId(){return this.getEditorType()+":v2:"+this._id}getVisibleColumnFromPosition(e){return this._targetEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._targetEditor.getPosition()}setPosition(e,t="api"){this._targetEditor.setPosition(e,t)}revealLine(e,t=0){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){this._targetEditor.revealPositionNearTop(e,t)}getSelection(){return this._targetEditor.getSelection()}getSelections(){return this._targetEditor.getSelections()}setSelection(e,t="api"){this._targetEditor.setSelection(e,t)}setSelections(e,t="api"){this._targetEditor.setSelections(e,t)}revealLines(e,t,n=0){this._targetEditor.revealLines(e,t,n)}revealLinesInCenter(e,t,n=0){this._targetEditor.revealLinesInCenter(e,t,n)}revealLinesInCenterIfOutsideViewport(e,t,n=0){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,n)}revealLinesNearTop(e,t,n=0){this._targetEditor.revealLinesNearTop(e,t,n)}revealRange(e,t=0,n=!1,r=!0){this._targetEditor.revealRange(e,t,n,r)}revealRangeInCenter(e,t=0){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._targetEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._targetEditor.getSupportedActions()}focus(){this._targetEditor.focus()}trigger(e,t,n){this._targetEditor.trigger(e,t,n)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}}y3.idCounter=0;var DQe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Zse=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Sz=class extends fe{get onDidContentSizeChange(){return this._onDidContentSizeChange.event}constructor(e,t,n,r,o,s,a){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=n,this._createInnerEditor=o,this._instantiationService=s,this._keybindingService=a,this._onDidContentSizeChange=this._register(new se),this.original=this._register(this._createLeftHandSideEditor(n.editorOptions.get(),r.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(n.editorOptions.get(),r.modifiedEditor||{})),this.modifiedModel=Vi(this.modified.onDidChangeModel,()=>this.modified.getModel()),this.modifiedScrollTop=Vi(this.modified.onDidScrollChange,()=>this.modified.getScrollTop()),this.modifiedScrollHeight=Vi(this.modified.onDidScrollChange,()=>this.modified.getScrollHeight()),this.modifiedSelections=Vi(this.modified.onDidChangeCursorSelection,()=>{var l;return(l=this.modified.getSelections())!==null&&l!==void 0?l:[]}),this.modifiedCursor=Qy({owner:this,equalityComparer:ae.equals},l=>{var c,u;return(u=(c=this.modifiedSelections.read(l)[0])===null||c===void 0?void 0:c.getPosition())!==null&&u!==void 0?u:new ae(1,1)}),this.originalCursor=Vi(this.original.onDidChangeCursorPosition,()=>{var l;return(l=this.original.getPosition())!==null&&l!==void 0?l:new ae(1,1)}),this._register(rT({createEmptyChangeSummary:()=>({}),handleChange:(l,c)=>(l.didChange(n.editorOptions)&&Object.assign(c,l.change.changedOptions),!0)},(l,c)=>{n.editorOptions.read(l),this._options.renderSideBySide.read(l),this.modified.updateOptions(this._adjustOptionsForRightHandSide(l,c)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(l,c))}))}_createLeftHandSideEditor(e,t){const n=this._adjustOptionsForLeftHandSide(void 0,e),r=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,n,t);return r.setContextValue("isInDiffLeftEditor",!0),r}_createRightHandSideEditor(e,t){const n=this._adjustOptionsForRightHandSide(void 0,e),r=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,n,t);return r.setContextValue("isInDiffRightEditor",!0),r}_constructInnerEditor(e,t,n,r){const o=this._createInnerEditor(e,t,n,r);return this._register(o.onDidContentSizeChange(s=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+Wb.ENTIRE_DIFF_OVERVIEW_WIDTH,l=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:l,contentWidth:a,contentHeightChanged:s.contentHeightChanged,contentWidthChanged:s.contentWidthChanged})})),o}_adjustOptionsForLeftHandSide(e,t){const n=this._adjustOptionsForSubEditor(t);return this._options.renderSideBySide.get()?(n.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},n.wordWrapOverride1=this._options.diffWordWrap.get()):(n.wordWrapOverride1="off",n.wordWrapOverride2="off",n.stickyScroll={enabled:!1},n.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),n.glyphMargin=this._options.renderSideBySide.get(),t.originalAriaLabel&&(n.ariaLabel=t.originalAriaLabel),n.ariaLabel=this._updateAriaLabel(n.ariaLabel),n.readOnly=!this._options.originalEditable.get(),n.dropIntoEditor={enabled:!n.readOnly},n.extraEditorClassName="original-in-monaco-diff-editor",n}_adjustOptionsForRightHandSide(e,t){const n=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(n.ariaLabel=t.modifiedAriaLabel),n.ariaLabel=this._updateAriaLabel(n.ariaLabel),n.wordWrapOverride1=this._options.diffWordWrap.get(),n.revealHorizontalRightPadding=yh.revealHorizontalRightPadding.defaultValue+Wb.ENTIRE_DIFF_OVERVIEW_WIDTH,n.scrollbar.verticalHasArrows=!1,n.extraEditorClassName="modified-in-monaco-diff-editor",n}_adjustOptionsForSubEditor(e){const t={...e,dimension:{height:0,width:0}};return t.inDiffEditor=!0,t.automaticLayout=!1,t.scrollbar={...t.scrollbar||{}},t.folding=!1,t.codeLens=this._options.diffCodeLens.get(),t.fixedOverflowWidgets=!0,t.minimap={...t.minimap||{}},t.minimap.enabled=!1,this._options.hideUnchangedRegions.get()?t.stickyScroll={enabled:!1}:t.stickyScroll=this._options.editorOptions.get().stickyScroll,t}_updateAriaLabel(e){var t;e||(e="");const n=w("diff-aria-navigation-tip"," use {0} to open the accessibility help.",(t=this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp"))===null||t===void 0?void 0:t.getAriaLabel());return this._options.accessibilityVerbose.get()?e+n:e?e.replaceAll(n,""):""}};Sz=DQe([Zse(5,Ot),Zse(6,ci)],Sz);class IQe{get editorOptions(){return this._options}constructor(e){this._diffEditorWidth=Hn(this,0),this.couldShowInlineViewBecauseOfSize=Yt(this,n=>this._options.read(n).renderSideBySide&&this._diffEditorWidth.read(n)<=this._options.read(n).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=Yt(this,n=>this._options.read(n).renderOverviewRuler),this.renderSideBySide=Yt(this,n=>this._options.read(n).renderSideBySide&&!(this._options.read(n).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(n))),this.readOnly=Yt(this,n=>this._options.read(n).readOnly),this.shouldRenderRevertArrows=Yt(this,n=>!(!this._options.read(n).renderMarginRevertIcon||!this.renderSideBySide.read(n)||this.readOnly.read(n))),this.renderIndicators=Yt(this,n=>this._options.read(n).renderIndicators),this.enableSplitViewResizing=Yt(this,n=>this._options.read(n).enableSplitViewResizing),this.splitViewDefaultRatio=Yt(this,n=>this._options.read(n).splitViewDefaultRatio),this.ignoreTrimWhitespace=Yt(this,n=>this._options.read(n).ignoreTrimWhitespace),this.maxComputationTimeMs=Yt(this,n=>this._options.read(n).maxComputationTime),this.showMoves=Yt(this,n=>this._options.read(n).experimental.showMoves&&this.renderSideBySide.read(n)),this.isInEmbeddedEditor=Yt(this,n=>this._options.read(n).isInEmbeddedEditor),this.diffWordWrap=Yt(this,n=>this._options.read(n).diffWordWrap),this.originalEditable=Yt(this,n=>this._options.read(n).originalEditable),this.diffCodeLens=Yt(this,n=>this._options.read(n).diffCodeLens),this.accessibilityVerbose=Yt(this,n=>this._options.read(n).accessibilityVerbose),this.diffAlgorithm=Yt(this,n=>this._options.read(n).diffAlgorithm),this.showEmptyDecorations=Yt(this,n=>this._options.read(n).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=Yt(this,n=>this._options.read(n).onlyShowAccessibleDiffViewer),this.hideUnchangedRegions=Yt(this,n=>this._options.read(n).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=Yt(this,n=>this._options.read(n).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=Yt(this,n=>this._options.read(n).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=Yt(this,n=>this._options.read(n).hideUnchangedRegions.minimumLineCount);const t={...e,...Qse(e,Vs)};this._options=Hn(this,t)}updateOptions(e){const t=Qse(e,this._options.get()),n={...this._options.get(),...e,...t};this._options.set(n,void 0,{changedOptions:e})}setWidth(e){this._diffEditorWidth.set(e,void 0)}}function Qse(i,e){var t,n,r,o,s,a,l,c;return{enableSplitViewResizing:Lt(i.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:r3e(i.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:Lt(i.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:Lt(i.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:h0(i.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:h0(i.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:Lt(i.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:Lt(i.renderIndicators,e.renderIndicators),originalEditable:Lt(i.originalEditable,e.originalEditable),diffCodeLens:Lt(i.diffCodeLens,e.diffCodeLens),renderOverviewRuler:Lt(i.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:_r(i.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:_r(i.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:Lt(i.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:Lt((t=i.experimental)===null||t===void 0?void 0:t.showMoves,e.experimental.showMoves),showEmptyDecorations:Lt((n=i.experimental)===null||n===void 0?void 0:n.showEmptyDecorations,e.experimental.showEmptyDecorations)},hideUnchangedRegions:{enabled:Lt((o=(r=i.hideUnchangedRegions)===null||r===void 0?void 0:r.enabled)!==null&&o!==void 0?o:(s=i.experimental)===null||s===void 0?void 0:s.collapseUnchangedRegions,e.hideUnchangedRegions.enabled),contextLineCount:h0((a=i.hideUnchangedRegions)===null||a===void 0?void 0:a.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:h0((l=i.hideUnchangedRegions)===null||l===void 0?void 0:l.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:h0((c=i.hideUnchangedRegions)===null||c===void 0?void 0:c.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:Lt(i.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:Lt(i.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:h0(i.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:Lt(i.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited)}}const b9=[];class kQe extends fe{constructor(e,t,n,r){super(),this._editors=e,this._diffModel=t,this._options=n,this._widget=r,this._selectedDiffs=Yt(this,o=>{const s=this._diffModel.read(o),a=s==null?void 0:s.diff.read(o);if(!a)return b9;const l=this._editors.modifiedSelections.read(o);if(l.every(h=>h.isEmpty()))return b9;const c=new Hu(l.map(h=>pn.fromRangeInclusive(h))),d=a.mappings.filter(h=>h.lineRangeMapping.innerChanges&&c.intersects(h.lineRangeMapping.modified)).map(h=>({mapping:h,rangeMappings:h.lineRangeMapping.innerChanges.filter(f=>l.some(g=>B.areIntersecting(f.modifiedRange,g)))}));return d.length===0||d.every(h=>h.rangeMappings.length===0)?b9:d}),this._register(Dh((o,s)=>{if(!this._options.shouldRenderRevertArrows.read(o))return;const a=this._diffModel.read(o),l=a==null?void 0:a.diff.read(o);if(!a||!l||a.movedTextToCompare.read(o))return;const c=[],u=this._selectedDiffs.read(o),d=new Set(u.map(h=>h.mapping));if(u.length>0){const h=this._editors.modifiedSelections.read(o),f=s.add(new SI(h[h.length-1].positionLineNumber,this._widget,u.flatMap(g=>g.rangeMappings),!0));this._editors.modified.addGlyphMarginWidget(f),c.push(f)}for(const h of l.mappings)if(!d.has(h)&&!h.lineRangeMapping.modified.isEmpty&&h.lineRangeMapping.innerChanges){const f=s.add(new SI(h.lineRangeMapping.modified.startLineNumber,this._widget,h.lineRangeMapping.innerChanges,!1));this._editors.modified.addGlyphMarginWidget(f),c.push(f)}s.add(Rt(()=>{for(const h of c)this._editors.modified.removeGlyphMarginWidget(h)}))}))}}class SI extends fe{getId(){return this._id}constructor(e,t,n,r){super(),this._lineNumber=e,this._widget=t,this._diffs=n,this._revertSelection=r,this._id=`revertButton${SI.counter++}`,this._domNode=gi("div.revertButton",{title:this._revertSelection?w("revertSelectedChanges","Revert Selected Changes"):w("revertChange","Revert Change")},[nI(Xe.arrowRight)]).root,this._register(ye(this._domNode,Ge.MOUSE_DOWN,o=>{o.button!==2&&(o.stopPropagation(),o.preventDefault())})),this._register(ye(this._domNode,Ge.MOUSE_UP,o=>{o.stopPropagation(),o.preventDefault()})),this._register(ye(this._domNode,Ge.CLICK,o=>{this._widget.revertRangeMappings(this._diffs),o.stopPropagation(),o.preventDefault()}))}getDomNode(){return this._domNode}getPosition(){return{lane:$f.Right,range:{startColumn:1,startLineNumber:this._lineNumber,endColumn:1,endLineNumber:this._lineNumber},zIndex:10001}}}SI.counter=0;var TQe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},qx=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let n_=class extends y3{get onDidContentSizeChange(){return this._editors.onDidContentSizeChange}constructor(e,t,n,r,o,s,a,l){var c;super(),this._domElement=e,this._parentContextKeyService=r,this._parentInstantiationService=o,this._accessibilitySignalService=a,this._editorProgressService=l,this.elements=gi("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[gi("div.noModificationsOverlay@overlay",{style:{position:"absolute",height:"100%",visibility:"hidden"}},[He("span",{},"No Changes")]),gi("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),gi("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),gi("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModel=Hn(this,void 0),this._shouldDisposeDiffModel=!1,this.onDidChangeModel=Je.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._parentInstantiationService.createChild(new Kk([Vt,this._contextKeyService])),this._boundarySashes=Hn(this,void 0),this._accessibleDiffViewerShouldBeVisible=Hn(this,!1),this._accessibleDiffViewerVisible=Yt(this,S=>this._options.onlyShowAccessibleDiffViewer.read(S)?!0:this._accessibleDiffViewerShouldBeVisible.read(S)),this._movedBlocksLinesPart=Hn(this,void 0),this._layoutInfo=Yt(this,S=>{var L,E,D,k,T;const M=this._rootSizeObserver.width.read(S),A=this._rootSizeObserver.height.read(S),N=(L=this._sash.read(S))===null||L===void 0?void 0:L.sashLeft.read(S),R=N??Math.max(5,this._editors.original.getLayoutInfo().decorationsLeft),F=M-R-((D=(E=this._overviewRulerPart.read(S))===null||E===void 0?void 0:E.width)!==null&&D!==void 0?D:0),W=(T=(k=this._movedBlocksLinesPart.read(S))===null||k===void 0?void 0:k.width.read(S))!==null&&T!==void 0?T:0,H=R-W;return this.elements.original.style.width=H+"px",this.elements.original.style.left="0px",this.elements.modified.style.width=F+"px",this.elements.modified.style.left=R+"px",this._editors.original.layout({width:H,height:A},!0),this._editors.modified.layout({width:F,height:A},!0),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((S,L)=>S==null?void 0:S.diff.read(L)),this.onDidUpdateDiff=Je.fromObservableLight(this._diffValue),s.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(Rt(()=>this._domElement.removeChild(this.elements.root))),this._rootSizeObserver=this._register(new V0e(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout((c=t.automaticLayout)!==null&&c!==void 0?c:!1),this._options=new IQe(t),this._register(bn(S=>{this._options.setWidth(this._rootSizeObserver.width.read(S))})),this._contextKeyService.createKey(j.isEmbeddedDiffEditor.key,!1),this._register(UR(j.isEmbeddedDiffEditor,this._contextKeyService,S=>this._options.isInEmbeddedEditor.read(S))),this._register(UR(j.comparingMovedCode,this._contextKeyService,S=>{var L;return!!(!((L=this._diffModel.read(S))===null||L===void 0)&&L.movedTextToCompare.read(S))})),this._register(UR(j.diffEditorRenderSideBySideInlineBreakpointReached,this._contextKeyService,S=>this._options.couldShowInlineViewBecauseOfSize.read(S))),this._register(UR(j.hasChanges,this._contextKeyService,S=>{var L,E,D;return((D=(E=(L=this._diffModel.read(S))===null||L===void 0?void 0:L.diff.read(S))===null||E===void 0?void 0:E.mappings.length)!==null&&D!==void 0?D:0)>0})),this._editors=this._register(this._instantiationService.createInstance(Sz,this.elements.original,this.elements.modified,this._options,n,(S,L,E,D)=>this._createInnerEditor(S,L,E,D))),this._overviewRulerPart=ym(this,S=>this._options.renderOverviewRuler.read(S)?this._instantiationService.createInstance(sf(Wb,S),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(L=>L.modifiedEditor)):void 0).recomputeInitiallyAndOnChange(this._store),this._sash=ym(this,S=>{const L=this._options.renderSideBySide.read(S);return this.elements.root.classList.toggle("side-by-side",L),L?new gQe(this._options,this.elements.root,{height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((E,D)=>{var k,T;return E-((T=(k=this._overviewRulerPart.read(D))===null||k===void 0?void 0:k.width)!==null&&T!==void 0?T:0)})},this._boundarySashes):void 0}).recomputeInitiallyAndOnChange(this._store);const u=ym(this,S=>this._instantiationService.createInstance(sf(wI,S),this._editors,this._diffModel,this._options)).recomputeInitiallyAndOnChange(this._store);ym(this,S=>this._instantiationService.createInstance(sf(fQe,S),this._editors,this._diffModel,this._options,this)).recomputeInitiallyAndOnChange(this._store);const d=new Set,h=new Set;let f=!1;const g=ym(this,S=>this._instantiationService.createInstance(sf(wz,S),Pt(this._domElement),this._editors,this._diffModel,this._options,this,()=>f||u.get().isUpdatingHiddenAreas,d,h)).recomputeInitiallyAndOnChange(this._store),p=Yt(this,S=>{const L=g.read(S).viewZones.read(S).orig,E=u.read(S).viewZones.read(S).origViewZones;return L.concat(E)}),v=Yt(this,S=>{const L=g.read(S).viewZones.read(S).mod,E=u.read(S).viewZones.read(S).modViewZones;return L.concat(E)});this._register(oO(this._editors.original,p,S=>{f=S},d));let m;this._register(oO(this._editors.modified,v,S=>{f=S,f?m=_h.capture(this._editors.modified):(m==null||m.restore(this._editors.modified),m=void 0)},h)),this._accessibleDiffViewer=ym(this,S=>this._instantiationService.createInstance(sf(Qm,S),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(L,E)=>this._accessibleDiffViewerShouldBeVisible.set(L,E),this._options.onlyShowAccessibleDiffViewer.map(L=>!L),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((L,E)=>{var D;return(D=L==null?void 0:L.diff.read(E))===null||D===void 0?void 0:D.mappings.map(k=>k.lineRangeMapping)}),new aQe(this._editors))).recomputeInitiallyAndOnChange(this._store);const _=this._accessibleDiffViewerVisible.map(S=>S?"hidden":"visible");this._register(Ev(this.elements.modified,{visibility:_})),this._register(Ev(this.elements.original,{visibility:_})),this._createDiffEditorContributions(),s.addDiffEditor(this),this._register(oT(this._layoutInfo)),ym(this,S=>new(sf(Dv,S))(this.elements.root,this._diffModel,this._layoutInfo.map(L=>L.originalEditor),this._layoutInfo.map(L=>L.modifiedEditor),this._editors)).recomputeInitiallyAndOnChange(this._store,S=>{this._movedBlocksLinesPart.set(S,void 0)}),this._register(Ev(this.elements.overlay,{width:this._layoutInfo.map((S,L)=>S.originalEditor.width+(this._options.renderSideBySide.read(L)?0:S.modifiedEditor.width)),visibility:Yt(S=>{var L,E;return this._options.hideUnchangedRegions.read(S)&&((E=(L=this._diffModel.read(S))===null||L===void 0?void 0:L.diff.read(S))===null||E===void 0?void 0:E.mappings.length)===0?"visible":"hidden"})})),this._register(Je.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,S=>{var L,E;if((S==null?void 0:S.reason)===3){const D=(E=(L=this._diffModel.get())===null||L===void 0?void 0:L.diff.get())===null||E===void 0?void 0:E.mappings.find(k=>k.lineRangeMapping.modified.contains(S.position.lineNumber));D!=null&&D.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(cn.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):D!=null&&D.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(cn.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):D&&this._accessibilitySignalService.playSignal(cn.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}));const y=this._diffModel.map(this,(S,L)=>{if(S)return S.diff.read(L)===void 0&&!S.isDiffUpToDate.read(L)});this._register(Dh((S,L)=>{if(y.read(S)===!0){const E=this._editorProgressService.show(!0,1e3);L.add(Rt(()=>E.done()))}})),this._register(Rt(()=>{var S;this._shouldDisposeDiffModel&&((S=this._diffModel.get())===null||S===void 0||S.dispose())})),this._register(new kQe(this._editors,this._diffModel,this._options,this))}_createInnerEditor(e,t,n,r){return e.createInstance($w,t,n,r)}_createDiffEditorContributions(){const e=Ay.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(n){en(n)}}get _targetEditor(){return this._editors.modified}getEditorType(){return Ok.IDiffEditor}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){var e;const t=this._editors.original.saveViewState(),n=this._editors.modified.saveViewState();return{original:t,modified:n,modelState:(e=this._diffModel.get())===null||e===void 0?void 0:e.serializeState()}}restoreViewState(e){var t;if(e&&e.original&&e.modified){const n=e;this._editors.original.restoreViewState(n.original),this._editors.modified.restoreViewState(n.modified),n.modelState&&((t=this._diffModel.get())===null||t===void 0||t.restoreSerializedState(n.modelState))}}handleInitialized(){this._editors.original.handleInitialized(),this._editors.modified.handleInitialized()}createViewModel(e){return this._instantiationService.createInstance(yz,e,this._options)}getModel(){var e,t;return(t=(e=this._diffModel.get())===null||e===void 0?void 0:e.model)!==null&&t!==void 0?t:null}setModel(e,t){!e&&this._diffModel.get()&&this._accessibleDiffViewer.get().close();const n=e?"model"in e?{model:e,shouldDispose:!1}:{model:this.createViewModel(e),shouldDispose:!0}:void 0;this._diffModel.get()!==(n==null?void 0:n.model)&&CI(t,r=>{var o;Vi.batchEventsGlobally(r,()=>{this._editors.original.setModel(n?n.model.model.original:null),this._editors.modified.setModel(n?n.model.model.modified:null)});const s=this._diffModel.get(),a=this._shouldDisposeDiffModel;this._shouldDisposeDiffModel=(o=n==null?void 0:n.shouldDispose)!==null&&o!==void 0?o:!1,this._diffModel.set(n==null?void 0:n.model,r),a&&(s==null||s.dispose())})}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}getLineChanges(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.diff.get();return t?NQe(t):null}revert(e){if(e.innerChanges){this.revertRangeMappings(e.innerChanges);return}const t=this._diffModel.get();!t||!t.isDiffUpToDate.get()||this._editors.modified.executeEdits("diffEditor",[{range:e.modified.toExclusiveRange(),text:t.model.original.getValueInRange(e.original.toExclusiveRange())}])}revertRangeMappings(e){const t=this._diffModel.get();if(!t||!t.isDiffUpToDate.get())return;const n=e.map(r=>({range:r.modifiedRange,text:t.model.original.getValueInRange(r.originalRange)}));this._editors.modified.executeEdits("diffEditor",n)}_goTo(e){this._editors.modified.setPosition(new ae(e.lineRangeMapping.modified.startLineNumber,1)),this._editors.modified.revealRangeInCenter(e.lineRangeMapping.modified.toExclusiveRange())}goToDiff(e){var t,n,r,o;const s=(n=(t=this._diffModel.get())===null||t===void 0?void 0:t.diff.get())===null||n===void 0?void 0:n.mappings;if(!s||s.length===0)return;const a=this._editors.modified.getPosition().lineNumber;let l;e==="next"?l=(r=s.find(c=>c.lineRangeMapping.modified.startLineNumber>a))!==null&&r!==void 0?r:s[0]:l=(o=RD(s,c=>c.lineRangeMapping.modified.startLineNumber{var t;const n=(t=e.diff.get())===null||t===void 0?void 0:t.mappings;!n||n.length===0||this._goTo(n[0])})}accessibleDiffViewerNext(){this._accessibleDiffViewer.get().next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.get().prev()}async waitForDiff(){const e=this._diffModel.get();e&&await e.waitForDiff()}mapToOtherSide(){var e,t;const n=this._editors.modified.hasWidgetFocus(),r=n?this._editors.modified:this._editors.original,o=n?this._editors.original:this._editors.modified;let s;const a=r.getSelection();if(a){const l=(t=(e=this._diffModel.get())===null||e===void 0?void 0:e.diff.get())===null||t===void 0?void 0:t.mappings.map(c=>n?c.lineRangeMapping.flip():c.lineRangeMapping);if(l){const c=Bse(a.getStartPosition(),l),u=Bse(a.getEndPosition(),l);s=B.plusRange(c,u)}}return{destination:o,destinationSelection:s}}switchSide(){const{destination:e,destinationSelection:t}=this.mapToOtherSide();e.focus(),t&&e.setSelection(t)}exitCompareMove(){const e=this._diffModel.get();e&&e.movedTextToCompare.set(void 0,void 0)}collapseAllUnchangedRegions(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();t&&Ri(n=>{for(const r of t)r.collapseAll(n)})}showAllUnchangedRegions(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();t&&Ri(n=>{for(const r of t)r.showAll(n)})}};n_=TQe([qx(3,Vt),qx(4,Ot),qx(5,Un),qx(6,M_),qx(7,T_)],n_);function NQe(i){return i.mappings.map(e=>{const t=e.lineRangeMapping;let n,r,o,s,a=t.innerChanges;return t.original.isEmpty?(n=t.original.startLineNumber-1,r=0,a=void 0):(n=t.original.startLineNumber,r=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(o=t.modified.startLineNumber-1,s=0,a=void 0):(o=t.modified.startLineNumber,s=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:n,originalEndLineNumber:r,modifiedStartLineNumber:o,modifiedEndLineNumber:s,charChanges:a==null?void 0:a.map(l=>({originalStartLineNumber:l.originalRange.startLineNumber,originalStartColumn:l.originalRange.startColumn,originalEndLineNumber:l.originalRange.endLineNumber,originalEndColumn:l.originalRange.endColumn,modifiedStartLineNumber:l.modifiedRange.startLineNumber,modifiedStartColumn:l.modifiedRange.startColumn,modifiedEndLineNumber:l.modifiedRange.endLineNumber,modifiedEndColumn:l.modifiedRange.endColumn}))}})}var wY=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Ki=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let RQe=0,Jse=!1;function MQe(i){if(!i){if(Jse)return;Jse=!0}_7e(i||hi.document.body)}let aO=class extends $w{constructor(e,t,n,r,o,s,a,l,c,u,d,h){const f={...t};f.ariaLabel=f.ariaLabel||RP.editorViewAccessibleLabel,f.ariaLabel=f.ariaLabel+";"+RP.accessibilityHelpMessage,super(e,f,{},n,r,o,s,l,c,u,d,h),a instanceof qw?this._standaloneKeybindingService=a:this._standaloneKeybindingService=null,MQe(f.ariaContainerElement),GGe((g,p)=>n.createInstance(EP,g,p,{}))}addCommand(e,t,n){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const r="DYNAMIC_"+ ++RQe,o=De.deserialize(n);return this._standaloneKeybindingService.addDynamicKeybinding(r,e,t,o),r}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if(typeof e.id!="string"||typeof e.label!="string"||typeof e.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),fe.None;const t=e.id,n=e.label,r=De.and(De.equals("editorId",this.getId()),De.deserialize(e.precondition)),o=e.keybindings,s=De.and(r,De.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,l=e.contextMenuOrder||0,c=(f,...g)=>Promise.resolve(e.run(this,...g)),u=new Te,d=this.getId()+":"+t;if(u.add(Dn.registerCommand(d,c)),a){const f={command:{id:d,title:n},when:r,group:a,order:l};u.add(ts.appendMenuItem($.EditorContext,f))}if(Array.isArray(o))for(const f of o)u.add(this._standaloneKeybindingService.addDynamicKeybinding(d,f,c,s));const h=new Wve(d,n,n,void 0,r,(...f)=>Promise.resolve(e.run(this,...f)),this._contextKeyService);return this._actions.set(t,h),u.add(Rt(()=>{this._actions.delete(t)})),u}_triggerCommand(e,t){if(this._codeEditorService instanceof wP)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};aO=wY([Ki(2,Ot),Ki(3,Un),Ki(4,sr),Ki(5,Vt),Ki(6,ci),Ki(7,To),Ki(8,$r),Ki(9,ud),Ki(10,Di),Ki(11,_t)],aO);let xz=class extends aO{constructor(e,t,n,r,o,s,a,l,c,u,d,h,f,g,p){const v={...t};nO(u,v,!1);const m=l.registerEditorContainer(e);typeof v.theme=="string"&&l.setTheme(v.theme),typeof v.autoDetectHighContrast<"u"&&l.setAutoDetectHighContrast(!!v.autoDetectHighContrast);const _=v.model;delete v.model,super(e,v,n,r,o,s,a,l,c,d,g,p),this._configurationService=u,this._standaloneThemeService=l,this._register(m);let y;if(typeof _>"u"){const S=f.getLanguageIdByMimeType(v.language)||v.language||hc;y=q0e(h,f,v.value||"",S,void 0),this._ownsModel=!0}else y=_,this._ownsModel=!1;if(this._attachModel(y),y){const S={oldModelUrl:null,newModelUrl:y.uri};this._onDidChangeModel.fire(S)}}dispose(){super.dispose()}updateOptions(e){nO(this._configurationService,e,!1),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};xz=wY([Ki(2,Ot),Ki(3,Un),Ki(4,sr),Ki(5,Vt),Ki(6,ci),Ki(7,Sc),Ki(8,$r),Ki(9,gn),Ki(10,ud),Ki(11,tr),Ki(12,ji),Ki(13,Di),Ki(14,_t)],xz);let Lz=class extends n_{constructor(e,t,n,r,o,s,a,l,c,u,d,h){const f={...t};nO(l,f,!0);const g=s.registerEditorContainer(e);typeof f.theme=="string"&&s.setTheme(f.theme),typeof f.autoDetectHighContrast<"u"&&s.setAutoDetectHighContrast(!!f.autoDetectHighContrast),super(e,f,{},r,n,o,h,u),this._configurationService=l,this._standaloneThemeService=s,this._register(g)}dispose(){super.dispose()}updateOptions(e){nO(this._configurationService,e,!0),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_createInnerEditor(e,t,n){return e.createInstance(aO,t,n)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,n){return this.getModifiedEditor().addCommand(e,t,n)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};Lz=wY([Ki(2,Ot),Ki(3,Vt),Ki(4,Un),Ki(5,Sc),Ki(6,$r),Ki(7,gn),Ki(8,Ol),Ki(9,T_),Ki(10,jp),Ki(11,M_)],Lz);function q0e(i,e,t,n,r){if(t=t||"",!n){const o=t.indexOf(` -`);let s=t;return o!==-1&&(s=t.substring(0,o)),eae(i,t,e.createByFilepathOrFirstLine(r||null,s),r)}return eae(i,t,e.createById(n),r)}function eae(i,e,t,n){return i.createModel(e,t,n)}class AQe extends fe{constructor(e,t,n={orientation:0}){var r;super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new r5e),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new Te),n.hoverDelegate=(r=n.hoverDelegate)!==null&&r!==void 0?r:this._register(Vp("element",!0)),this.options=n,this.lookupKeybindings=typeof this.options.getKeyBinding=="function",this.toggleMenuAction=this._register(new xI(()=>{var o;return(o=this.toggleMenuActionViewItem)===null||o===void 0?void 0:o.show()},n.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new au(this.element,{orientation:n.orientation,ariaLabel:n.ariaLabel,actionRunner:n.actionRunner,allowContextMenu:n.allowContextMenu,highlightToggledItems:n.highlightToggledItems,hoverDelegate:n.hoverDelegate,actionViewItemProvider:(o,s)=>{var a;if(o.id===xI.ID)return this.toggleMenuActionViewItem=new PP(o,o.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:Wt.asClassNameArray((a=n.moreIcon)!==null&&a!==void 0?a:Xe.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,isMenu:!0,hoverDelegate:this.options.hoverDelegate}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(n.actionViewItemProvider){const l=n.actionViewItemProvider(o,s);if(l)return l}if(o instanceof Lw){const l=new PP(o,o.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:o.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,hoverDelegate:this.options.hoverDelegate});return l.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(l),this.disposables.add(this._onDidChangeDropdownVisibility.add(l.onDidChangeVisibility)),l}}}))}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}getElement(){return this.element}getItemAction(e){return this.actionBar.getAction(e)}setActions(e,t){this.clear();const n=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),n.push(this.toggleMenuAction)),n.forEach(r=>{this.actionBar.push(r,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(r)})})}getKeybindingLabel(e){var t,n,r;const o=this.lookupKeybindings?(n=(t=this.options).getKeyBinding)===null||n===void 0?void 0:n.call(t,e):void 0;return(r=o==null?void 0:o.getLabel())!==null&&r!==void 0?r:void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}class xI extends xl{constructor(e,t){t=t||w("moreActions","More Actions..."),super(xI.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}async run(){this.toggleDropdownMenu()}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}}xI.ID="toolbar.toggle.more";var X0e=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},vf=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let LI=class extends AQe{constructor(e,t,n,r,o,s,a){super(e,o,{getKeyBinding:c=>{var u;return(u=s.lookupKeybinding(c.id))!==null&&u!==void 0?u:void 0},...t,allowContextMenu:!0,skipTelemetry:typeof(t==null?void 0:t.telemetrySource)=="string"}),this._options=t,this._menuService=n,this._contextKeyService=r,this._contextMenuService=o,this._sessionDisposables=this._store.add(new Te);const l=t==null?void 0:t.telemetrySource;l&&this._store.add(this.actionBar.onDidRun(c=>a.publicLog2("workbenchActionExecuted",{id:c.action.id,from:l})))}setActions(e,t=[],n){var r,o,s;this._sessionDisposables.clear();const a=e.slice(),l=t.slice(),c=[];let u=0;const d=[];let h=!1;if(((r=this._options)===null||r===void 0?void 0:r.hiddenItemStrategy)!==-1)for(let f=0;fv==null?void 0:v.id)),g=this._options.overflowBehavior.maxItems-f.size;let p=0;for(let v=0;v=g&&(a[v]=void 0,d[v]=m))}}Nne(a),Nne(d),super.setActions(a,lo.join(d,l)),c.length>0&&this._sessionDisposables.add(ye(this.getElement(),"contextmenu",f=>{var g,p,v,m,_;const y=new Uu(Pt(this.getElement()),f),S=this.getItemAction(y.target);if(!S)return;y.preventDefault(),y.stopPropagation();let L=!1;if(u===1&&((g=this._options)===null||g===void 0?void 0:g.hiddenItemStrategy)===0){L=!0;for(let k=0;kthis._menuService.resetHiddenStates(n)}))),this._contextMenuService.showContextMenu({getAnchor:()=>y,getActions:()=>D,menuId:(v=this._options)===null||v===void 0?void 0:v.contextMenu,menuActionOptions:{renderShortTitle:!0,...(m=this._options)===null||m===void 0?void 0:m.menuOptions},skipTelemetry:typeof((_=this._options)===null||_===void 0?void 0:_.telemetrySource)=="string",contextKeyService:this._contextKeyService})}))}};LI=X0e([vf(2,hu),vf(3,Vt),vf(4,Ol),vf(5,ci),vf(6,ea)],LI);let Ez=class extends LI{constructor(e,t,n,r,o,s,a,l){super(e,{resetMenu:t,...n},r,o,s,a,l),this._onDidChangeMenuItems=this._store.add(new se);const c=this._store.add(r.createMenu(t,o,{emitEventsForSubmenuChanges:!0})),u=()=>{var d,h,f;const g=[],p=[];i3(c,n==null?void 0:n.menuOptions,{primary:g,secondary:p},(d=n==null?void 0:n.toolbarOptions)===null||d===void 0?void 0:d.primaryGroup,(h=n==null?void 0:n.toolbarOptions)===null||h===void 0?void 0:h.shouldInlineSubmenu,(f=n==null?void 0:n.toolbarOptions)===null||f===void 0?void 0:f.useSeparatorsInPrimaryActions),e.classList.toggle("has-no-actions",g.length===0&&p.length===0),super.setActions(g,p)};this._store.add(c.onDidChange(()=>{u(),this._onDidChangeMenuItems.fire(this)})),u()}setActions(){throw new qi("This toolbar is populated from a menu.")}};Ez=X0e([vf(3,hu),vf(4,Vt),vf(5,Ol),vf(6,ci),vf(7,ea)],Ez);class PQe extends Nb{constructor(e){super(),this._getContext=e}runAction(e,t){return super.runAction(e,this._getContext())}}var OQe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},FQe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class BQe{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let lO=class extends fe{constructor(e,t,n,r){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=n,this._instantiationService=r,this._viewModel=Hn(this,void 0),this._collapsed=Yt(this,s=>{var a;return(a=this._viewModel.read(s))===null||a===void 0?void 0:a.collapsed.read(s)}),this._editorContentHeight=Hn(this,500),this.contentHeight=Yt(this,s=>(this._collapsed.read(s)?0:this._editorContentHeight.read(s))+this._outerEditorHeight),this._modifiedContentWidth=Hn(this,0),this._modifiedWidth=Hn(this,0),this._originalContentWidth=Hn(this,0),this._originalWidth=Hn(this,0),this.maxScroll=Yt(this,s=>{const a=this._modifiedContentWidth.read(s)-this._modifiedWidth.read(s),l=this._originalContentWidth.read(s)-this._originalWidth.read(s);return a>l?{maxScroll:a,width:this._modifiedWidth.read(s)}:{maxScroll:l,width:this._originalWidth.read(s)}}),this._elements=gi("div.multiDiffEntry",[gi("div.header@header",[gi("div.header-content",[gi("div.collapse-button@collapseButton"),gi("div.file-path",[gi("div.title.modified.show-file-icons@primaryPath",[]),gi("div.status.deleted@status",["R"]),gi("div.title.original.show-file-icons@secondaryPath",[])]),gi("div.actions@actions")])]),gi("div.editorParent",[gi("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(n_,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode},{})),this.isModifedFocused=tae(this.editor.getModifiedEditor()),this.isOriginalFocused=tae(this.editor.getOriginalEditor()),this.isFocused=Yt(this,s=>this.isModifedFocused.read(s)||this.isOriginalFocused.read(s)),this._resourceLabel=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.primaryPath)):void 0,this._resourceLabel2=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.secondaryPath)):void 0,this._dataStore=new Te,this._headerHeight=48,this._lastScrollTop=-1,this._isSettingScrollTop=!1;const o=new QP(this._elements.collapseButton,{});this._register(bn(s=>{o.element.className="",o.icon=this._collapsed.read(s)?Xe.chevronRight:Xe.chevronDown})),this._register(o.onDidClick(()=>{var s;(s=this._viewModel.get())===null||s===void 0||s.collapsed.set(!this._collapsed.get(),void 0)})),this._register(bn(s=>{this._elements.editor.style.display=this._collapsed.read(s)?"none":"block"})),this._register(this.editor.getModifiedEditor().onDidLayoutChange(s=>{const a=this.editor.getModifiedEditor().getLayoutInfo().contentWidth;this._modifiedWidth.set(a,void 0)})),this._register(this.editor.getOriginalEditor().onDidLayoutChange(s=>{const a=this.editor.getOriginalEditor().getLayoutInfo().contentWidth;this._originalWidth.set(a,void 0)})),this._register(this.editor.onDidContentSizeChange(s=>{AM(a=>{this._editorContentHeight.set(s.contentHeight,a),this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(),a),this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(),a)})})),this._register(this.editor.getOriginalEditor().onDidScrollChange(s=>{if(this._isSettingScrollTop||!s.scrollTopChanged||!this._data)return;const a=s.scrollTop-this._lastScrollTop;this._data.deltaScrollVertical(a)})),this._register(bn(s=>{const a=this.isFocused.read(s);this._elements.root.classList.toggle("focused",a)})),this._container.appendChild(this._elements.root),this._outerEditorHeight=this._headerHeight,this._register(this._instantiationService.createInstance(Ez,this._elements.actions,$.MultiDiffEditorFileToolbar,{actionRunner:this._register(new PQe(()=>{var s;return(s=this._viewModel.get())===null||s===void 0?void 0:s.modifiedUri})),menuOptions:{shouldForwardArgs:!0},toolbarOptions:{primaryGroup:s=>s.startsWith("navigation")},actionViewItemProvider:(s,a)=>q_e(r,s,a)}))}setScrollLeft(e){this._modifiedContentWidth.get()-this._modifiedWidth.get()>this._originalContentWidth.get()-this._originalWidth.get()?this.editor.getModifiedEditor().setScrollLeft(e):this.editor.getOriginalEditor().setScrollLeft(e)}setData(e){this._data=e;function t(r){return{...r,scrollBeyondLastLine:!1,hideUnchangedRegions:{enabled:!0},scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1,useShadows:!1},renderOverviewRuler:!1,fixedOverflowWidgets:!0,overviewRulerBorder:!1}}const n=e.viewModel.entry.value;n.onOptionsDidChange&&this._dataStore.add(n.onOptionsDidChange(()=>{var r;this.editor.updateOptions(t((r=n.options)!==null&&r!==void 0?r:{}))})),AM(r=>{var o,s,a,l;(o=this._resourceLabel)===null||o===void 0||o.setUri((s=e.viewModel.modifiedUri)!==null&&s!==void 0?s:e.viewModel.originalUri,{strikethrough:e.viewModel.modifiedUri===void 0});let c=!1,u=!1,d=!1,h="";e.viewModel.modifiedUri&&e.viewModel.originalUri&&e.viewModel.modifiedUri.path!==e.viewModel.originalUri.path?(h="R",c=!0):e.viewModel.modifiedUri?e.viewModel.originalUri||(h="A",d=!0):(h="D",u=!0),this._elements.status.classList.toggle("renamed",c),this._elements.status.classList.toggle("deleted",u),this._elements.status.classList.toggle("added",d),this._elements.status.innerText=h,(a=this._resourceLabel2)===null||a===void 0||a.setUri(c?e.viewModel.originalUri:void 0,{strikethrough:!0}),this._dataStore.clear(),this._viewModel.set(e.viewModel,r),this.editor.setModel(e.viewModel.diffEditorViewModel,r),this.editor.updateOptions(t((l=n.options)!==null&&l!==void 0?l:{}))})}render(e,t,n,r){this._elements.root.style.visibility="visible",this._elements.root.style.top=`${e.start}px`,this._elements.root.style.height=`${e.length}px`,this._elements.root.style.width=`${t}px`,this._elements.root.style.position="absolute";const o=e.length-this._headerHeight,s=Math.max(0,Math.min(r.start-e.start,o));this._elements.header.style.transform=`translateY(${s}px)`,AM(a=>{this.editor.layout({width:t-2*8-2*1,height:e.length-this._outerEditorHeight})});try{this._isSettingScrollTop=!0,this._lastScrollTop=n,this.editor.getOriginalEditor().setScrollTop(n)}finally{this._isSettingScrollTop=!1}this._elements.header.classList.toggle("shadow",s>0||n>0),this._elements.header.classList.toggle("collapsed",s===o)}hide(){this._elements.root.style.top="-100000px",this._elements.root.style.visibility="hidden"}};lO=OQe([FQe(3,Ot)],lO);function tae(i){return Vi(e=>{const t=new Te;return t.add(i.onDidFocusEditorWidget(()=>e(!0))),t.add(i.onDidBlurEditorWidget(()=>e(!1))),t},()=>i.hasWidgetFocus())}class WQe{constructor(e){this._create=e,this._unused=new Set,this._used=new Set,this._itemData=new Map}getUnusedObj(e){var t;let n;if(this._unused.size===0)n=this._create(e),this._itemData.set(n,e);else{const r=[...this._unused.values()];n=(t=r.find(o=>this._itemData.get(o).getId()===e.getId()))!==null&&t!==void 0?t:r[0],this._unused.delete(n),this._itemData.set(n,e),n.setData(e)}return this._used.add(n),{object:n,dispose:()=>{this._used.delete(n),this._unused.size>5?n.dispose():this._unused.add(n)}}}dispose(){for(const e of this._used)e.dispose();for(const e of this._unused)e.dispose();this._used.clear(),this._unused.clear()}}var $Qe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},nae=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Dz=class extends fe{constructor(e,t,n,r,o,s){super(),this._element=e,this._dimension=t,this._viewModel=n,this._workbenchUIElementFactory=r,this._parentContextKeyService=o,this._parentInstantiationService=s,this._elements=gi("div.monaco-component.multiDiffEditor",[gi("div@content",{style:{overflow:"hidden"}}),gi("div.monaco-editor@overflowWidgetsDomNode",{})]),this._sizeObserver=this._register(new V0e(this._element,void 0)),this._objectPool=this._register(new WQe(l=>{const c=this._instantiationService.createInstance(lO,this._elements.content,this._elements.overflowWidgetsDomNode,this._workbenchUIElementFactory);return c.setData(l),c})),this._scrollable=this._register(new TS({forceIntegerValues:!1,scheduleAtNextAnimationFrame:l=>Il(Pt(this._element),l),smoothScrollDuration:100})),this._scrollableElement=this._register(new O4(this._elements.root,{vertical:1,horizontal:1,useShadows:!1},this._scrollable)),this.scrollTop=Vi(this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollTop),this.scrollLeft=Vi(this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollLeft),this._viewItems=OS(this,(l,c)=>{const u=this._viewModel.read(l);return u?u.items.read(l).map(h=>{var f;const g=c.add(new HQe(h,this._objectPool,this.scrollLeft,v=>{this._scrollableElement.setScrollPosition({scrollTop:this._scrollableElement.getScrollPosition().scrollTop+v})})),p=(f=this._lastDocStates)===null||f===void 0?void 0:f[g.getKey()];return p&&Ri(v=>{g.setViewState(p,v)}),g}):[]}),this._spaceBetweenPx=0,this._totalHeight=this._viewItems.map(this,(l,c)=>l.reduce((u,d)=>u+d.contentHeight.read(c)+this._spaceBetweenPx,0)),this.activeDiffItem=Yt(this,l=>this._viewItems.read(l).find(c=>{var u;return(u=c.template.read(l))===null||u===void 0?void 0:u.isFocused.read(l)})),this.lastActiveDiffItem=HZe((l,c)=>{var u;return(u=this.activeDiffItem.read(l))!==null&&u!==void 0?u:c}),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._element)),this._instantiationService=this._parentInstantiationService.createChild(new Kk([Vt,this._contextKeyService])),this._lastDocStates={},this._contextKeyService.createKey(j.inMultiDiffEditor.key,!0),this._register(Dh((l,c)=>{const u=this._viewModel.read(l);if(u&&u.contextKeys)for(const[d,h]of Object.entries(u.contextKeys)){const f=this._contextKeyService.createKey(d,void 0);f.set(h),c.add(Rt(()=>f.reset()))}}));const a=this._parentContextKeyService.createKey(j.multiDiffEditorAllCollapsed.key,!1);this._register(bn(l=>{const c=this._viewModel.read(l);if(c){const u=c.items.read(l).every(d=>d.collapsed.read(l));a.set(u)}})),this._register(bn(l=>{const c=this.lastActiveDiffItem.read(l);Ri(u=>{var d;(d=this._viewModel.read(l))===null||d===void 0||d.activeDiffItem.set(c==null?void 0:c.viewModel,u)})})),this._register(bn(l=>{const c=this._dimension.read(l);this._sizeObserver.observe(c)})),this._elements.content.style.position="relative",this._register(bn(l=>{const c=this._sizeObserver.height.read(l);this._elements.root.style.height=`${c}px`;const u=this._totalHeight.read(l);this._elements.content.style.height=`${u}px`;const d=this._sizeObserver.width.read(l);let h=d;const f=this._viewItems.read(l),g=Bq(f,p=>p.maxScroll.read(l).maxScroll);if(g){const p=g.maxScroll.read(l);h=d+p.maxScroll}this._scrollableElement.setScrollDimensions({width:d,height:c,scrollHeight:u,scrollWidth:h})})),e.replaceChildren(this._scrollableElement.getDomNode()),this._register(Rt(()=>{e.replaceChildren()})),this._register(this._register(bn(l=>{AM(c=>{this.render(l)})})))}render(e){const t=this.scrollTop.read(e);let n=0,r=0,o=0;const s=this._sizeObserver.height.read(e),a=vn.ofStartAndLength(t,s),l=this._sizeObserver.width.read(e);for(const c of this._viewItems.read(e)){const u=c.contentHeight.read(e),d=Math.min(u,s),h=vn.ofStartAndLength(r,d),f=vn.ofStartAndLength(o,u);if(f.isBefore(a))n-=u-d,c.hide();else if(f.isAfter(a))c.hide();else{const g=Math.max(0,Math.min(a.start-f.start,u-d));n-=g;const p=vn.ofStartAndLength(t+n,s);c.render(h,g,l,p)}r+=d+this._spaceBetweenPx,o+=u+this._spaceBetweenPx}this._elements.content.style.transform=`translateY(${-(t+n)}px)`}};Dz=$Qe([nae(4,Vt),nae(5,Ot)],Dz);class HQe extends fe{constructor(e,t,n,r){super(),this.viewModel=e,this._objectPool=t,this._scrollLeft=n,this._deltaScrollVertical=r,this._templateRef=this._register(yI(this,void 0)),this.contentHeight=Yt(this,o=>{var s,a,l;return(l=(a=(s=this._templateRef.read(o))===null||s===void 0?void 0:s.object.contentHeight)===null||a===void 0?void 0:a.read(o))!==null&&l!==void 0?l:this.viewModel.lastTemplateData.read(o).contentHeight}),this.maxScroll=Yt(this,o=>{var s,a;return(a=(s=this._templateRef.read(o))===null||s===void 0?void 0:s.object.maxScroll.read(o))!==null&&a!==void 0?a:{maxScroll:0,scrollWidth:0}}),this.template=Yt(this,o=>{var s;return(s=this._templateRef.read(o))===null||s===void 0?void 0:s.object}),this._isHidden=Hn(this,!1),this._register(bn(o=>{var s;const a=this._scrollLeft.read(o);(s=this._templateRef.read(o))===null||s===void 0||s.object.setScrollLeft(a)})),this._register(bn(o=>{const s=this._templateRef.read(o);!s||!this._isHidden.read(o)||s.object.isFocused.read(o)||this._clear()}))}dispose(){this._clear(),super.dispose()}toString(){var e;return`VirtualViewItem(${(e=this.viewModel.entry.value.modified)===null||e===void 0?void 0:e.uri.toString()})`}getKey(){return this.viewModel.getKey()}setViewState(e,t){var n;this.viewModel.collapsed.set(e.collapsed,t),this._updateTemplateData(t);const r=this.viewModel.lastTemplateData.get(),o=(n=e.selections)===null||n===void 0?void 0:n.map(yt.liftSelection);this.viewModel.lastTemplateData.set({...r,selections:o},t);const s=this._templateRef.get();s&&o&&s.object.editor.setSelections(o)}_updateTemplateData(e){var t;const n=this._templateRef.get();n&&this.viewModel.lastTemplateData.set({contentHeight:n.object.contentHeight.get(),selections:(t=n.object.editor.getSelections())!==null&&t!==void 0?t:void 0},e)}_clear(){const e=this._templateRef.get();e&&Ri(t=>{this._updateTemplateData(t),e.object.hide(),this._templateRef.set(void 0,t)})}hide(){this._isHidden.set(!0,void 0)}render(e,t,n,r){this._isHidden.set(!1,void 0);let o=this._templateRef.get();if(!o){o=this._objectPool.getUnusedObj(new BQe(this.viewModel,this._deltaScrollVertical)),this._templateRef.set(o,void 0);const s=this.viewModel.lastTemplateData.get().selections;s&&o.object.editor.setSelections(s)}o.object.render(e,n,t,r)}}X("multiDiffEditor.headerBackground",{dark:"#262626",light:"tab.inactiveBackground",hcDark:"tab.inactiveBackground",hcLight:"tab.inactiveBackground"},w("multiDiffEditor.headerBackground","The background color of the diff editor's header"));X("multiDiffEditor.background",{dark:"editorBackground",light:"editorBackground",hcDark:"editorBackground",hcLight:"editorBackground"},w("multiDiffEditor.background","The background color of the multi file diff editor"));X("multiDiffEditor.border",{dark:"sideBarSectionHeader.border",light:"#cccccc",hcDark:"sideBarSectionHeader.border",hcLight:"#cccccc"},w("multiDiffEditor.border","The border color of the multi file diff editor"));var VQe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},zQe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Iz=class extends fe{constructor(e,t,n){super(),this._element=e,this._workbenchUIElementFactory=t,this._instantiationService=n,this._dimension=Hn(this,void 0),this._viewModel=Hn(this,void 0),this._widgetImpl=OS(this,(r,o)=>(sf(lO,r),o.add(this._instantiationService.createInstance(sf(Dz,r),this._element,this._dimension,this._viewModel,this._workbenchUIElementFactory)))),this._register(oT(this._widgetImpl))}};Iz=VQe([zQe(2,Ot)],Iz);function UQe(i,e,t){return Ht.initialize(t||{}).createInstance(xz,i,e)}function jQe(i){return Ht.get(Un).onCodeEditorAdd(t=>{i(t)})}function KQe(i){return Ht.get(Un).onDiffEditorAdd(t=>{i(t)})}function GQe(){return Ht.get(Un).listCodeEditors()}function qQe(){return Ht.get(Un).listDiffEditors()}function XQe(i,e,t){return Ht.initialize(t||{}).createInstance(Lz,i,e)}function YQe(i,e){const t=Ht.initialize(e||{});return new Iz(i,{},t)}function ZQe(i){if(typeof i.id!="string"||typeof i.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return Dn.registerCommand(i.id,i.run)}function QQe(i){if(typeof i.id!="string"||typeof i.label!="string"||typeof i.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=De.deserialize(i.precondition),t=(r,...o)=>Vo.runEditorCommand(r,o,e,(s,a,l)=>Promise.resolve(i.run(a,...l))),n=new Te;if(n.add(Dn.registerCommand(i.id,t)),i.contextMenuGroupId){const r={command:{id:i.id,title:i.label},when:e,group:i.contextMenuGroupId,order:i.contextMenuOrder||0};n.add(ts.appendMenuItem($.EditorContext,r))}if(Array.isArray(i.keybindings)){const r=Ht.get(ci);if(!(r instanceof qw))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const o=De.and(e,De.deserialize(i.keybindingContext));n.add(r.addDynamicKeybindings(i.keybindings.map(s=>({keybinding:s,command:i.id,when:o}))))}}return n}function JQe(i){return Y0e([i])}function Y0e(i){const e=Ht.get(ci);return e instanceof qw?e.addDynamicKeybindings(i.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:De.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),fe.None)}function eJe(i,e,t){const n=Ht.get(ji),r=n.getLanguageIdByMimeType(e)||e;return q0e(Ht.get(tr),n,i,r,t)}function tJe(i,e){const t=Ht.get(ji),n=t.getLanguageIdByMimeType(e)||e||hc;i.setLanguage(t.createById(n))}function nJe(i,e,t){i&&Ht.get(ig).changeOne(e,i.uri,t)}function iJe(i){Ht.get(ig).changeAll(i,[])}function rJe(i){return Ht.get(ig).read(i)}function oJe(i){return Ht.get(ig).onMarkerChanged(i)}function sJe(i){return Ht.get(tr).getModel(i)}function aJe(){return Ht.get(tr).getModels()}function lJe(i){return Ht.get(tr).onModelAdded(i)}function cJe(i){return Ht.get(tr).onModelRemoved(i)}function uJe(i){return Ht.get(tr).onModelLanguageChanged(t=>{i({model:t.model,oldLanguage:t.oldLanguageId})})}function dJe(i){return K9e(Ht.get(tr),Ht.get(Di),i)}function hJe(i,e){const t=Ht.get(ji),n=Ht.get(Sc);return Kq.colorizeElement(n,t,i,e).then(()=>{n.registerEditorContainer(i)})}function fJe(i,e,t){const n=Ht.get(ji);return Ht.get(Sc).registerEditorContainer(hi.document.body),Kq.colorize(n,i,e,t)}function gJe(i,e,t=4){return Ht.get(Sc).registerEditorContainer(hi.document.body),Kq.colorizeModelLine(i,e,t)}function pJe(i){const e=hr.get(i);return e||{getInitialState:()=>Nw,tokenize:(t,n,r)=>zq(i,r)}}function mJe(i,e){hr.getOrCreate(e);const t=pJe(e),n=Jf(i),r=[];let o=t.getInitialState();for(let s=0,a=n.length;s{var o;if(!n)return null;const s=(o=t.options)===null||o===void 0?void 0:o.selection;let a;return s&&typeof s.endLineNumber=="number"&&typeof s.endColumn=="number"?a=s:s&&(a={lineNumber:s.startLineNumber,column:s.startColumn}),await i.openCodeEditor(n,t.resource,a)?n:null})}function SJe(){return{create:UQe,getEditors:GQe,getDiffEditors:qQe,onDidCreateEditor:jQe,onDidCreateDiffEditor:KQe,createDiffEditor:XQe,addCommand:ZQe,addEditorAction:QQe,addKeybindingRule:JQe,addKeybindingRules:Y0e,createModel:eJe,setModelLanguage:tJe,setModelMarkers:nJe,getModelMarkers:rJe,removeAllMarkers:iJe,onDidChangeMarkers:oJe,getModels:aJe,getModel:sJe,onDidCreateModel:lJe,onWillDisposeModel:cJe,onDidChangeModelLanguage:uJe,createWebWorker:dJe,colorizeElement:hJe,colorize:fJe,colorizeModelLine:gJe,tokenize:mJe,defineTheme:vJe,setTheme:_Je,remeasureFonts:bJe,registerCommand:CJe,registerLinkOpener:yJe,registerEditorOpener:wJe,AccessibilitySupport:d$,ContentWidgetPositionPreference:v$,CursorChangeReason:_$,DefaultEndOfLine:b$,EditorAutoIndentStrategy:y$,EditorOption:w$,EndOfLinePreference:S$,EndOfLineSequence:x$,MinimapPosition:A$,MouseTargetType:P$,OverlayWidgetPositionPreference:F$,OverviewRulerLane:B$,GlyphMarginLane:L$,RenderLineNumbersType:$$,RenderMinimap:H$,ScrollbarVisibility:z$,ScrollType:V$,TextEditorCursorBlinkingStyle:X$,TextEditorCursorStyle:Y$,TrackedRangeStickiness:Z$,WrappingIndent:Q$,InjectedTextCursorStops:D$,PositionAffinity:W$,ShowLightbulbIconMode:j$,ConfigurationChangedEvent:ppe,BareFontInfo:ib,FontInfo:lH,TextModelResolvedOptions:fM,FindMatch:ND,ApplyUpdateResult:aE,EditorZoom:zc,createMultiFileDiffEditor:YQe,EditorType:Ok,EditorOptions:yh}}function xJe(i,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!i(t))return!1;return!0}function jR(i,e){return typeof i=="boolean"?i:e}function iae(i,e){return typeof i=="string"?i:e}function LJe(i){const e={};for(const t of i)e[t]=!0;return e}function rae(i,e=!1){e&&(i=i.map(function(n){return n.toLowerCase()}));const t=LJe(i);return e?function(n){return t[n.toLowerCase()]!==void 0&&t.hasOwnProperty(n.toLowerCase())}:function(n){return t[n]!==void 0&&t.hasOwnProperty(n)}}function kz(i,e){e=e.replace(/@@/g,"");let t=0,n;do n=!1,e=e.replace(/@(\w+)/g,function(o,s){n=!0;let a="";if(typeof i[s]=="string")a=i[s];else if(i[s]&&i[s]instanceof RegExp)a=i[s].source;else throw i[s]===void 0?Hi(i,"language definition does not contain attribute '"+s+"', used at: "+e):Hi(i,"attribute reference '"+s+"' must be a string, used at: "+e);return D1(a)?"":"(?:"+a+")"}),t++;while(n&&t<5);e=e.replace(/\x01/g,"@");const r=(i.ignoreCase?"i":"")+(i.unicode?"u":"");return new RegExp(e,r)}function EJe(i,e,t,n){if(n<0)return i;if(n=100){n=n-100;const r=t.split(".");if(r.unshift(t),n=0&&(n.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")n.bracket=1;else if(t.bracket==="@close")n.bracket=-1;else throw Hi(i,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw Hi(i,"the next state must be a string value in rule: "+e);{let r=t.next;if(!/^(@pop|@push|@popall)$/.test(r)&&(r[0]==="@"&&(r=r.substr(1)),r.indexOf("$")<0&&!d7e(i,Mm(i,r,"",[],""))))throw Hi(i,"the next state '"+t.next+"' is not defined in rule: "+e);n.next=r}}return typeof t.goBack=="number"&&(n.goBack=t.goBack),typeof t.switchTo=="string"&&(n.switchTo=t.switchTo),typeof t.log=="string"&&(n.log=t.log),typeof t.nextEmbedded=="string"&&(n.nextEmbedded=t.nextEmbedded,i.usesEmbedded=!0),n}}else if(Array.isArray(t)){const n=[];for(let r=0,o=t.length;r0&&n[0]==="^",this.name=this.name+": "+n,this.regex=kz(e,"^(?:"+(this.matchOnlyAtLineStart?n.substr(1):n)+")")}setAction(e,t){this.action=Tz(e,this.name,t)}}function Z0e(i,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={};t.languageId=i,t.includeLF=jR(e.includeLF,!1),t.noThrow=!1,t.maxStack=100,t.start=typeof e.start=="string"?e.start:null,t.ignoreCase=jR(e.ignoreCase,!1),t.unicode=jR(e.unicode,!1),t.tokenPostfix=iae(e.tokenPostfix,"."+t.languageId),t.defaultToken=iae(e.defaultToken,"source"),t.usesEmbedded=!1;const n=e;n.languageId=i,n.includeLF=t.includeLF,n.ignoreCase=t.ignoreCase,n.unicode=t.unicode,n.noThrow=t.noThrow,n.usesEmbedded=t.usesEmbedded,n.stateNames=e.tokenizer,n.defaultToken=t.defaultToken;function r(s,a,l){for(const c of l){let u=c.include;if(u){if(typeof u!="string")throw Hi(t,"an 'include' attribute must be a string at: "+s);if(u[0]==="@"&&(u=u.substr(1)),!e.tokenizer[u])throw Hi(t,"include target '"+u+"' is not defined at: "+s);r(s+"."+u,a,e.tokenizer[u])}else{const d=new IJe(s);if(Array.isArray(c)&&c.length>=1&&c.length<=3)if(d.setRegex(n,c[0]),c.length>=3)if(typeof c[1]=="string")d.setAction(n,{token:c[1],next:c[2]});else if(typeof c[1]=="object"){const h=c[1];h.next=c[2],d.setAction(n,h)}else throw Hi(t,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+s);else d.setAction(n,c[1]);else{if(!c.regex)throw Hi(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+s);c.name&&typeof c.name=="string"&&(d.name=c.name),c.matchOnlyAtStart&&(d.matchOnlyAtLineStart=jR(c.matchOnlyAtLineStart,!1)),d.setRegex(n,c.regex),d.setAction(n,c.action)}a.push(d)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw Hi(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(const s in e.tokenizer)if(e.tokenizer.hasOwnProperty(s)){t.start||(t.start=s);const a=e.tokenizer[s];t.tokenizer[s]=new Array,r("tokenizer."+s,t.tokenizer[s],a)}if(t.usesEmbedded=n.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw Hi(t,"the 'brackets' attribute must be defined as an array")}else e.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const o=[];for(const s of e.brackets){let a=s;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw Hi(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+` - hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")o.push({token:a.token+t.tokenPostfix,open:Cv(t,a.open),close:Cv(t,a.close)});else throw Hi(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=o,t.noThrow=!0,t}function kJe(i){Iw.registerLanguage(i)}function TJe(){let i=[];return i=i.concat(Iw.getLanguages()),i}function NJe(i){return Ht.get(ji).languageIdCodec.encodeLanguageId(i)}function RJe(i,e){return Ht.withServices(()=>{const n=Ht.get(ji).onDidRequestRichLanguageFeatures(r=>{r===i&&(n.dispose(),e())});return n})}function MJe(i,e){return Ht.withServices(()=>{const n=Ht.get(ji).onDidRequestBasicLanguageFeatures(r=>{r===i&&(n.dispose(),e())});return n})}function AJe(i,e){if(!Ht.get(ji).isRegisteredLanguageId(i))throw new Error(`Cannot set configuration for unknown language ${i}`);return Ht.get(Di).register(i,e,100)}class PJe{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,n){if(typeof this._actual.tokenize=="function")return EI.adaptTokenize(this._languageId,this._actual,e,n);throw new Error("Not supported!")}tokenizeEncoded(e,t,n){const r=this._actual.tokenizeEncoded(e,n);return new s4(r.tokens,r.endState)}}class EI{constructor(e,t,n,r){this._languageId=e,this._actual=t,this._languageService=n,this._standaloneThemeService=r}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const n=[];let r=0;for(let o=0,s=e.length;o0&&o[s-1]===h)continue;let f=d.startIndex;c===0?f=0:f{const n=await Promise.resolve(e.create());return n?OJe(n)?J0e(i,n):new BD(Ht.get(ji),Ht.get(Sc),i,Z0e(i,n),Ht.get(gn)):null});return hr.registerFactory(i,t)}function WJe(i,e){if(!Ht.get(ji).isRegisteredLanguageId(i))throw new Error(`Cannot set tokens provider for unknown language ${i}`);return Q0e(e)?SY(i,{create:()=>e}):hr.register(i,J0e(i,e))}function $Je(i,e){const t=n=>new BD(Ht.get(ji),Ht.get(Sc),i,Z0e(i,n),Ht.get(gn));return Q0e(e)?SY(i,{create:()=>e}):hr.register(i,t(e))}function HJe(i,e){return Ht.get(_t).referenceProvider.register(i,e)}function VJe(i,e){return Ht.get(_t).renameProvider.register(i,e)}function zJe(i,e){return Ht.get(_t).newSymbolNamesProvider.register(i,e)}function UJe(i,e){return Ht.get(_t).signatureHelpProvider.register(i,e)}function jJe(i,e){return Ht.get(_t).hoverProvider.register(i,{provideHover:(n,r,o)=>{const s=n.getWordAtPosition(r);return Promise.resolve(e.provideHover(n,r,o)).then(a=>{if(a)return!a.range&&s&&(a.range=new B(r.lineNumber,s.startColumn,r.lineNumber,s.endColumn)),a.range||(a.range=new B(r.lineNumber,r.column,r.lineNumber,r.column)),a})}})}function KJe(i,e){return Ht.get(_t).documentSymbolProvider.register(i,e)}function GJe(i,e){return Ht.get(_t).documentHighlightProvider.register(i,e)}function qJe(i,e){return Ht.get(_t).linkedEditingRangeProvider.register(i,e)}function XJe(i,e){return Ht.get(_t).definitionProvider.register(i,e)}function YJe(i,e){return Ht.get(_t).implementationProvider.register(i,e)}function ZJe(i,e){return Ht.get(_t).typeDefinitionProvider.register(i,e)}function QJe(i,e){return Ht.get(_t).codeLensProvider.register(i,e)}function JJe(i,e,t){return Ht.get(_t).codeActionProvider.register(i,{providedCodeActionKinds:t==null?void 0:t.providedCodeActionKinds,documentation:t==null?void 0:t.documentation,provideCodeActions:(r,o,s,a)=>{const c=Ht.get(ig).read({resource:r.uri}).filter(u=>B.areIntersectingOrTouching(u,o));return e.provideCodeActions(r,o,{markers:c,only:s.only,trigger:s.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function eet(i,e){return Ht.get(_t).documentFormattingEditProvider.register(i,e)}function tet(i,e){return Ht.get(_t).documentRangeFormattingEditProvider.register(i,e)}function net(i,e){return Ht.get(_t).onTypeFormattingEditProvider.register(i,e)}function iet(i,e){return Ht.get(_t).linkProvider.register(i,e)}function ret(i,e){return Ht.get(_t).completionProvider.register(i,e)}function oet(i,e){return Ht.get(_t).colorProvider.register(i,e)}function set(i,e){return Ht.get(_t).foldingRangeProvider.register(i,e)}function aet(i,e){return Ht.get(_t).declarationProvider.register(i,e)}function cet(i,e){return Ht.get(_t).selectionRangeProvider.register(i,e)}function uet(i,e){return Ht.get(_t).documentSemanticTokensProvider.register(i,e)}function det(i,e){return Ht.get(_t).documentRangeSemanticTokensProvider.register(i,e)}function het(i,e){return Ht.get(_t).inlineCompletionsProvider.register(i,e)}function fet(i,e){return Ht.get(_t).inlineEditProvider.register(i,e)}function get(i,e){return Ht.get(_t).inlayHintsProvider.register(i,e)}function pet(){return{register:kJe,getLanguages:TJe,onLanguage:RJe,onLanguageEncountered:MJe,getEncodedLanguageId:NJe,setLanguageConfiguration:AJe,setColorMap:BJe,registerTokensProviderFactory:SY,setTokensProvider:WJe,setMonarchTokensProvider:$Je,registerReferenceProvider:HJe,registerRenameProvider:VJe,registerNewSymbolNameProvider:zJe,registerCompletionItemProvider:ret,registerSignatureHelpProvider:UJe,registerHoverProvider:jJe,registerDocumentSymbolProvider:KJe,registerDocumentHighlightProvider:GJe,registerLinkedEditingRangeProvider:qJe,registerDefinitionProvider:XJe,registerImplementationProvider:YJe,registerTypeDefinitionProvider:ZJe,registerCodeLensProvider:QJe,registerCodeActionProvider:JJe,registerDocumentFormattingEditProvider:eet,registerDocumentRangeFormattingEditProvider:tet,registerOnTypeFormattingEditProvider:net,registerLinkProvider:iet,registerColorProvider:oet,registerFoldingRangeProvider:set,registerDeclarationProvider:aet,registerSelectionRangeProvider:cet,registerDocumentSemanticTokensProvider:uet,registerDocumentRangeSemanticTokensProvider:det,registerInlineCompletionsProvider:het,registerInlineEditProvider:fet,registerInlayHintsProvider:get,DocumentHighlightKind:C$,CompletionItemKind:g$,CompletionItemTag:p$,CompletionItemInsertTextRule:f$,SymbolKind:G$,SymbolTag:q$,IndentAction:E$,CompletionTriggerKind:m$,SignatureHelpTriggerKind:K$,InlayHintKind:I$,InlineCompletionTriggerKind:k$,InlineEditTriggerKind:T$,CodeActionTriggerType:h$,NewSymbolNameTag:O$,FoldingRangeKind:ba,SelectedSuggestionInfo:Tpe}}const xY=yn("IEditorCancelService"),ebe=new st("cancellableOperation",!1,w("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));In(xY,class{constructor(){this._tokens=new WeakMap}add(i,e){let t=this._tokens.get(i);t||(t=i.invokeWithinContext(r=>{const o=ebe.bindTo(r.get(Vt)),s=new _a;return{key:o,tokens:s}}),this._tokens.set(i,t));let n;return t.key.set(!0),n=t.tokens.push(e),()=>{n&&(n(),t.key.set(!t.tokens.isEmpty()),n=void 0)}}cancel(i){const e=this._tokens.get(i);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},1);class met extends wr{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(n=>n.get(xY).add(e,this))}dispose(){this._unregister(),super.dispose()}}et(new class extends Vo{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:ebe})}runEditorCommand(i,e){i.get(xY).cancel(e)}});let tbe=class Nz{constructor(e,t){if(this.flags=t,this.flags&1){const n=e.getModel();this.modelVersionId=n?Eb("{0}#{1}",n.uri.toString(),n.getVersionId()):null}else this.modelVersionId=null;this.flags&4?this.position=e.getPosition():this.position=null,this.flags&2?this.selection=e.getSelection():this.selection=null,this.flags&8?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof Nz))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 Nz(e,this.flags))}};class i_ extends met{constructor(e,t,n,r){super(e,r),this._listener=new Te,t&4&&this._listener.add(e.onDidChangeCursorPosition(o=>{(!n||!B.containsPosition(n,o.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(o=>{(!n||!B.containsRange(n,o.selection))&&this.cancel()})),t&8&&this._listener.add(e.onDidScrollChange(o=>this.cancel())),t&1&&(this._listener.add(e.onDidChangeModel(o=>this.cancel())),this._listener.add(e.onDidChangeModelContent(o=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class LY extends wr{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}function qf(i){return i&&typeof i.getEditorType=="function"?i.getEditorType()===Ok.ICodeEditor:!1}function EY(i){return i&&typeof i.getEditorType=="function"?i.getEditorType()===Ok.IDiffEditor:!1}function vet(i){return!!i&&typeof i=="object"&&typeof i.onDidChangeActiveEditor=="function"}function nbe(i){return qf(i)?i:EY(i)?i.getModifiedEditor():vet(i)&&qf(i.activeCodeEditor)?i.activeCodeEditor:null}class Zw{static _handleEolEdits(e,t){let n;const r=[];for(const o of t)typeof o.eol=="number"&&(n=o.eol),o.range&&typeof o.text=="string"&&r.push(o);return typeof n=="number"&&e.hasModel()&&e.getModel().pushEOL(n),r}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const n=e.getModel(),r=n.validateRange(t.range);return n.getFullModelRange().equalsRange(r)}static execute(e,t,n){n&&e.pushUndoStop();const r=_h.capture(e),o=Zw._handleEolEdits(e,t);o.length===1&&Zw._isFullModelReplaceEdit(e,o[0])?e.executeEdits("formatEditsCommand",o.map(s=>Xi.replace(B.lift(s.range),s.text))):e.executeEdits("formatEditsCommand",o.map(s=>Xi.replaceMove(B.lift(s.range),s.text))),n&&e.pushUndoStop(),r.restoreRelativeVerticalPositionOfCursor(e)}}class oae{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class _et{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(oae.toKey(e))}has(e){return this._set.has(oae.toKey(e))}}function ibe(i,e,t){const n=[],r=new _et,o=i.ordered(t);for(const a of o)n.push(a),a.extensionId&&r.add(a.extensionId);const s=e.ordered(t);for(const a of s){if(a.extensionId){if(r.has(a.extensionId))continue;r.add(a.extensionId)}n.push({displayName:a.displayName,extensionId:a.extensionId,provideDocumentFormattingEdits(l,c,u){return a.provideDocumentRangeFormattingEdits(l,l.getFullModelRange(),c,u)}})}return n}class $b{static setFormatterSelector(e){return{dispose:$b._selectors.unshift(e)}}static async select(e,t,n,r){if(e.length===0)return;const o=En.first($b._selectors);if(o)return await o(e,t,n,r)}}$b._selectors=new _a;async function rbe(i,e,t,n,r,o,s){const a=i.get(Ot),{documentRangeFormattingEditProvider:l}=i.get(_t),c=qf(e)?e.getModel():e,u=l.ordered(c),d=await $b.select(u,c,n,2);d&&(r.report(d),await a.invokeFunction(bet,d,e,t,o,s))}async function bet(i,e,t,n,r,o){var s,a;const l=i.get(hd),c=i.get(Ta),u=i.get(M_);let d,h;qf(t)?(d=t.getModel(),h=new i_(t,5,void 0,r)):(d=t,h=new LY(t,r));const f=[];let g=0;for(const y of eq(n).sort(B.compareRangesUsingStarts))g>0&&B.areIntersectingOrTouching(f[g-1],y)?f[g-1]=B.fromPositions(f[g-1].getStartPosition(),y.getEndPosition()):g=f.push(y);const p=async y=>{var S,L;c.trace("[format][provideDocumentRangeFormattingEdits] (request)",(S=e.extensionId)===null||S===void 0?void 0:S.value,y);const E=await e.provideDocumentRangeFormattingEdits(d,y,d.getFormattingOptions(),h.token)||[];return c.trace("[format][provideDocumentRangeFormattingEdits] (response)",(L=e.extensionId)===null||L===void 0?void 0:L.value,E),E},v=(y,S)=>{if(!y.length||!S.length)return!1;const L=y.reduce((E,D)=>B.plusRange(E,D.range),y[0].range);if(!S.some(E=>B.intersectRanges(L,E.range)))return!1;for(const E of y)for(const D of S)if(B.intersectRanges(E.range,D.range))return!0;return!1},m=[],_=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){c.trace("[format][provideDocumentRangeFormattingEdits] (request)",(s=e.extensionId)===null||s===void 0?void 0:s.value,f);const y=await e.provideDocumentRangesFormattingEdits(d,f,d.getFormattingOptions(),h.token)||[];c.trace("[format][provideDocumentRangeFormattingEdits] (response)",(a=e.extensionId)===null||a===void 0?void 0:a.value,y),_.push(y)}else{for(const y of f){if(h.token.isCancellationRequested)return!0;_.push(await p(y))}for(let y=0;y({text:L.text,range:B.lift(L.range),forceMoveMarkers:!0})),L=>{for(const{range:E}of L)if(B.areIntersectingOrTouching(E,S))return[new yt(E.startLineNumber,E.startColumn,E.endLineNumber,E.endColumn)];return null})}return u.playSignal(cn.format,{userGesture:o}),!0}async function Cet(i,e,t,n,r,o){const s=i.get(Ot),a=i.get(_t),l=qf(e)?e.getModel():e,c=ibe(a.documentFormattingEditProvider,a.documentRangeFormattingEditProvider,l),u=await $b.select(c,l,t,1);u&&(n.report(u),await s.invokeFunction(yet,u,e,t,r,o))}async function yet(i,e,t,n,r,o){const s=i.get(hd),a=i.get(M_);let l,c;qf(t)?(l=t.getModel(),c=new i_(t,5,void 0,r)):(l=t,c=new LY(t,r));let u;try{const d=await e.provideDocumentFormattingEdits(l,l.getFormattingOptions(),c.token);if(u=await s.computeMoreMinimalEdits(l.uri,d),c.token.isCancellationRequested)return!0}finally{c.dispose()}if(!u||u.length===0)return!1;if(qf(t))Zw.execute(t,u,n!==2),n!==2&&t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:d}]=u,h=new yt(d.startLineNumber,d.startColumn,d.endLineNumber,d.endColumn);l.pushEditOperations([h],u.map(f=>({text:f.text,range:B.lift(f.range),forceMoveMarkers:!0})),f=>{for(const{range:g}of f)if(B.areIntersectingOrTouching(g,h))return[new yt(g.startLineNumber,g.startColumn,g.endLineNumber,g.endColumn)];return null})}return a.playSignal(cn.format,{userGesture:o}),!0}async function wet(i,e,t,n,r,o){const s=e.documentRangeFormattingEditProvider.ordered(t);for(const a of s){const l=await Promise.resolve(a.provideDocumentRangeFormattingEdits(t,n,r,o)).catch(Zr);if(Ts(l))return await i.computeMoreMinimalEdits(t.uri,l)}}async function xet(i,e,t,n,r){const o=ibe(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const s of o){const a=await Promise.resolve(s.provideDocumentFormattingEdits(t,n,r)).catch(Zr);if(Ts(a))return await i.computeMoreMinimalEdits(t.uri,a)}}function obe(i,e,t,n,r,o,s){const a=e.onTypeFormattingEditProvider.ordered(t);return a.length===0||a[0].autoFormatTriggerCharacters.indexOf(r)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(t,n,r,o,s)).catch(Zr).then(l=>i.computeMoreMinimalEdits(t.uri,l))}Dn.registerCommand("_executeFormatRangeProvider",async function(i,...e){const[t,n,r]=e;Xn(At.isUri(t)),Xn(B.isIRange(n));const o=i.get(ol),s=i.get(hd),a=i.get(_t),l=await o.createModelReference(t);try{return wet(s,a,l.object.textEditorModel,B.lift(n),r,Cn.None)}finally{l.dispose()}});Dn.registerCommand("_executeFormatDocumentProvider",async function(i,...e){const[t,n]=e;Xn(At.isUri(t));const r=i.get(ol),o=i.get(hd),s=i.get(_t),a=await r.createModelReference(t);try{return xet(o,s,a.object.textEditorModel,n,Cn.None)}finally{a.dispose()}});Dn.registerCommand("_executeFormatOnTypeProvider",async function(i,...e){const[t,n,r,o]=e;Xn(At.isUri(t)),Xn(ae.isIPosition(n)),Xn(typeof r=="string");const s=i.get(ol),a=i.get(hd),l=i.get(_t),c=await s.createModelReference(t);try{return obe(a,l,c.object.textEditorModel,ae.lift(n),r,o,Cn.None)}finally{c.dispose()}});yh.wrappingIndent.defaultValue=0;yh.glyphMargin.defaultValue=!1;yh.autoIndent.defaultValue=3;yh.overviewRulerLanes.defaultValue=2;$b.setFormatterSelector((i,e,t)=>Promise.resolve(i[0]));const Ra=Npe();Ra.editor=SJe();Ra.languages=pet();const sbe=Ra.CancellationTokenSource,DY=Ra.Emitter,abe=Ra.KeyCode,lbe=Ra.KeyMod,cbe=Ra.Position,ube=Ra.Range,dbe=Ra.Selection,hbe=Ra.SelectionDirection,fbe=Ra.MarkerSeverity,gbe=Ra.MarkerTag,pbe=Ra.Uri,mbe=Ra.Token,vbe=Ra.editor,sT=Ra.languages,C9=globalThis.MonacoEnvironment;(C9!=null&&C9.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=Ra);typeof globalThis.require<"u"&&typeof globalThis.require.config=="function"&&globalThis.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]});const w3=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:sbe,Emitter:DY,KeyCode:abe,KeyMod:lbe,MarkerSeverity:fbe,MarkerTag:gbe,Position:cbe,Range:ube,Selection:dbe,SelectionDirection:hbe,Token:mbe,Uri:pbe,editor:vbe,languages:sT},Symbol.toStringTag,{value:"Module"})),Let="modulepreload",Eet=function(i){return"/ir-virtual-machine/"+i},sae={},Dt=function(e,t,n){if(!t||t.length===0)return e();const r=document.getElementsByTagName("link");return Promise.all(t.map(o=>{if(o=Eet(o),o in sae)return;sae[o]=!0;const s=o.endsWith(".css"),a=s?'[rel="stylesheet"]':"";if(!!n)for(let u=r.length-1;u>=0;u--){const d=r[u];if(d.href===o&&(!s||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${a}`))return;const c=document.createElement("link");if(c.rel=s?"stylesheet":Let,s||(c.as="script",c.crossOrigin=""),c.href=o,document.head.appendChild(c),s)return new Promise((u,d)=>{c.addEventListener("load",u),c.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>e())};/*!----------------------------------------------------------------------------- +`),await this._clipboardService.writeText(S)})),n.getOption(91)||m.push(new xl("diff.inline.revertChange",w("diff.inline.revertChange.label","Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),m},autoSelectFirstItem:!0})};this._register(Sr(this._diffActions,"mousedown",g=>{if(!g.leftButton)return;const{top:p,height:v}=Br(this._diffActions),m=Math.floor(u/3);g.preventDefault(),f(g.posx,p+v+m)})),this._register(n.onMouseMove(g=>{(g.target.type===8||g.target.type===5)&&g.target.detail.viewZoneId===this._getViewZoneId()?(d=this._updateLightBulbPosition(this._marginDomNode,g.event.browserEvent.y,u),this.visibility=!0):this.visibility=!1})),this._register(n.onMouseDown(g=>{g.event.leftButton&&(g.target.type===8||g.target.type===5)&&g.target.detail.viewZoneId===this._getViewZoneId()&&(g.event.preventDefault(),d=this._updateLightBulbPosition(this._marginDomNode,g.event.browserEvent.y,u),f(g.event.posx,g.event.posy+u))}))}_updateLightBulbPosition(e,t,n){const{top:r}=Br(e),o=t-r,s=Math.floor(o/n),a=s*n;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let l=0;for(let c=0;ci});function wQe(i,e,t,n){ps(n,e.fontInfo);const r=t.length>0,o=new DS(1e4);let s=0,a=0;const l=[];for(let h=0;h');const l=e.getLineContent(),c=vc.isBasicASCII(l,r),u=vc.containsRTL(l,c,o),d=Fk(new D_(s.fontInfo.isMonospace&&!s.disableMonospaceOptimizations,s.fontInfo.canUseHalfwidthRightwardsArrow,l,!1,c,u,0,e,t,s.tabSize,0,s.fontInfo.spaceWidth,s.fontInfo.middotWidth,s.fontInfo.wsmiddotWidth,s.stopRenderingLineAfter,s.renderWhitespace,s.renderControlCharacters,s.fontLigatures!==ic.OFF,null),a);return a.appendString(""),d.characterMapping.getHorizontalOffset(d.characterMapping.length)}var xQe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},qse=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let wz=class extends fe{constructor(e,t,n,r,o,s,a,l,c,u){super(),this._targetWindow=e,this._editors=t,this._diffModel=n,this._options=r,this._diffEditorWidget=o,this._canIgnoreViewZoneUpdateEvent=s,this._origViewZonesToIgnore=a,this._modViewZonesToIgnore=l,this._clipboardService=c,this._contextMenuService=u,this._originalTopPadding=Hn(this,0),this._originalScrollOffset=Hn(this,0),this._originalScrollOffsetAnimated=Fse(this._targetWindow,this._originalScrollOffset,this._store),this._modifiedTopPadding=Hn(this,0),this._modifiedScrollOffset=Hn(this,0),this._modifiedScrollOffsetAnimated=Fse(this._targetWindow,this._modifiedScrollOffset,this._store);const d=Hn("invalidateAlignmentsState",0),h=this._register(new pi(()=>{d.set(d.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(y=>{this._canIgnoreViewZoneUpdateEvent()||h.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(y=>{this._canIgnoreViewZoneUpdateEvent()||h.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(y=>{(y.hasChanged(145)||y.hasChanged(67))&&h.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(y=>{(y.hasChanged(145)||y.hasChanged(67))&&h.schedule()}));const f=this._diffModel.map(y=>y?Vi(y.model.original.onDidChangeTokens,()=>y.model.original.tokenization.backgroundTokenizationState===2):void 0).map((y,S)=>y==null?void 0:y.read(S)),g=Yt(y=>{const S=this._diffModel.read(y),L=S==null?void 0:S.diff.read(y);if(!S||!L)return null;d.read(y);const D=this._options.renderSideBySide.read(y);return Xse(this._editors.original,this._editors.modified,L.mappings,this._origViewZonesToIgnore,this._modViewZonesToIgnore,D)}),p=Yt(y=>{var S;const L=(S=this._diffModel.read(y))===null||S===void 0?void 0:S.movedTextToCompare.read(y);if(!L)return null;d.read(y);const E=L.changes.map(D=>new G0e(D));return Xse(this._editors.original,this._editors.modified,E,this._origViewZonesToIgnore,this._modViewZonesToIgnore,!0)});function v(){const y=document.createElement("div");return y.className="diagonal-fill",y}const m=this._register(new Te);this.viewZones=OS(this,(y,S)=>{var L,E,D,k,T,M,A,N;m.clear();const R=g.read(y)||[],F=[],W=[],H=this._modifiedTopPadding.read(y);H>0&&W.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:H,showInHiddenAreas:!0,suppressMouseDown:!0});const G=this._originalTopPadding.read(y);G>0&&F.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:G,showInHiddenAreas:!0,suppressMouseDown:!0});const U=this._options.renderSideBySide.read(y),K=U||(L=this._editors.modified._getViewModel())===null||L===void 0?void 0:L.createLineBreaksComputer();if(K){const ve=this._editors.original.getModel();for(const Ve of R)if(Ve.diff)for(let Ze=Ve.originalRange.startLineNumber;Zeve.getLineCount())return{orig:F,mod:W};K==null||K.addRequest(ve.getLineContent(Ze),null,null)}}const re=(E=K==null?void 0:K.finalize())!==null&&E!==void 0?E:[];let Y=0;const J=this._editors.modified.getOption(67),Q=(D=this._diffModel.read(y))===null||D===void 0?void 0:D.movedTextToCompare.read(y),ue=(T=(k=this._editors.original.getModel())===null||k===void 0?void 0:k.mightContainNonBasicASCII())!==null&&T!==void 0?T:!1,de=(A=(M=this._editors.original.getModel())===null||M===void 0?void 0:M.mightContainRTL())!==null&&A!==void 0?A:!1,_e=yY.fromEditor(this._editors.modified);for(const ve of R)if(ve.diff&&!U){if(!ve.originalRange.isEmpty){f.read(y);const Ze=document.createElement("div");Ze.classList.add("view-lines","line-delete","monaco-mouse-cursor-text");const We=this._editors.original.getModel();if(ve.originalRange.endLineNumberExclusive-1>We.getLineCount())return{orig:F,mod:W};const pe=new SQe(ve.originalRange.mapToLineArray(Qe=>We.tokenization.getLineTokens(Qe)),ve.originalRange.mapToLineArray(Qe=>re[Y++]),ue,de),Pe=[];for(const Qe of ve.diff.innerChanges||[])Pe.push(new dE(Qe.originalRange.delta(-(ve.diff.original.startLineNumber-1)),vz.className,0));const Se=wQe(pe,_e,Pe,Ze),Ne=document.createElement("div");if(Ne.className="inline-deleted-margin-view-zone",ps(Ne,_e.fontInfo),this._options.renderIndicators.read(y))for(let Qe=0;Qezm(Me),Ne,this._editors.modified,ve.diff,this._diffEditorWidget,Se.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let Qe=0;Qe1&&F.push({afterLineNumber:ve.originalRange.startLineNumber+Qe,domNode:v(),heightInPx:(Ke-1)*J,showInHiddenAreas:!0,suppressMouseDown:!0})}W.push({afterLineNumber:ve.modifiedRange.startLineNumber-1,domNode:Ze,heightInPx:Se.heightInLines*J,minWidthInPx:Se.minWidthInPx,marginDomNode:Ne,setZoneId(Qe){Me=Qe},showInHiddenAreas:!0,suppressMouseDown:!0})}const Ve=document.createElement("div");Ve.className="gutter-delete",F.push({afterLineNumber:ve.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:ve.modifiedHeightInPx,marginDomNode:Ve,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const Ve=ve.modifiedHeightInPx-ve.originalHeightInPx;if(Ve>0){if(Q!=null&&Q.lineRangeMapping.original.delta(-1).deltaLength(2).contains(ve.originalRange.endLineNumberExclusive-1))continue;F.push({afterLineNumber:ve.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:Ve,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let Ze=function(){const pe=document.createElement("div");return pe.className="arrow-revert-change "+Wt.asClassName(Xe.arrowRight),S.add(ye(pe,"mousedown",Pe=>Pe.stopPropagation())),S.add(ye(pe,"click",Pe=>{Pe.stopPropagation(),o.revert(ve.diff)})),He("div",{},pe)};if(Q!=null&&Q.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(ve.modifiedRange.endLineNumberExclusive-1))continue;let We;ve.diff&&ve.diff.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(y)&&(We=Ze()),W.push({afterLineNumber:ve.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-Ve,marginDomNode:We,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const ve of(N=p.read(y))!==null&&N!==void 0?N:[]){if(!(Q!=null&&Q.lineRangeMapping.original.intersect(ve.originalRange))||!(Q!=null&&Q.lineRangeMapping.modified.intersect(ve.modifiedRange)))continue;const Ve=ve.modifiedHeightInPx-ve.originalHeightInPx;Ve>0?F.push({afterLineNumber:ve.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:Ve,showInHiddenAreas:!0,suppressMouseDown:!0}):W.push({afterLineNumber:ve.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-Ve,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:F,mod:W}});let _=!1;this._register(this._editors.original.onDidScrollChange(y=>{y.scrollLeftChanged&&!_&&(_=!0,this._editors.modified.setScrollLeft(y.scrollLeft),_=!1)})),this._register(this._editors.modified.onDidScrollChange(y=>{y.scrollLeftChanged&&!_&&(_=!0,this._editors.original.setScrollLeft(y.scrollLeft),_=!1)})),this._originalScrollTop=Vi(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Vi(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(bn(y=>{const S=this._originalScrollTop.read(y)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(y))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(y));S!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(S,1)})),this._register(bn(y=>{const S=this._modifiedScrollTop.read(y)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(y))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(y));S!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(S,1)})),this._register(bn(y=>{var S;const L=(S=this._diffModel.read(y))===null||S===void 0?void 0:S.movedTextToCompare.read(y);let E=0;if(L){const D=this._editors.original.getTopForLineNumber(L.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();E=this._editors.modified.getTopForLineNumber(L.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-D}E>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(E,void 0)):E<0?(this._modifiedTopPadding.set(-E,void 0),this._originalTopPadding.set(0,void 0)):setTimeout(()=>{this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(0,void 0)},400),this._editors.modified.hasTextFocus()?this._originalScrollOffset.set(this._modifiedScrollOffset.get()-E,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+E,void 0,!0)}))}};wz=xQe([qse(8,Kp),qse(9,Ol)],wz);function Xse(i,e,t,n,r,o){const s=new Dp(Yse(i,n)),a=new Dp(Yse(e,r)),l=i.getOption(67),c=e.getOption(67),u=[];let d=0,h=0;function f(g,p){for(;;){let v=s.peek(),m=a.peek();if(v&&v.lineNumber>=g&&(v=void 0),m&&m.lineNumber>=p&&(m=void 0),!v&&!m)break;const _=v?v.lineNumber-d:Number.MAX_VALUE,y=m?m.lineNumber-h:Number.MAX_VALUE;_y?(a.dequeue(),v={lineNumber:m.lineNumber-h+d,heightInPx:0}):(s.dequeue(),a.dequeue()),u.push({originalRange:pn.ofLength(v.lineNumber,1),modifiedRange:pn.ofLength(m.lineNumber,1),originalHeightInPx:l+v.heightInPx,modifiedHeightInPx:c+m.heightInPx,diff:void 0})}}for(const g of t){let y=function(S,L){var E,D,k,T;if(S<_||LF.lineNumberF+W.heightInPx,0))!==null&&D!==void 0?D:0,R=(T=(k=a.takeWhile(F=>F.lineNumberF+W.heightInPx,0))!==null&&T!==void 0?T:0;u.push({originalRange:M,modifiedRange:A,originalHeightInPx:M.length*l+N,modifiedHeightInPx:A.length*c+R,diff:g.lineRangeMapping}),_=S,m=L};const p=g.lineRangeMapping;f(p.original.startLineNumber,p.modified.startLineNumber);let v=!0,m=p.modified.startLineNumber,_=p.original.startLineNumber;if(o)for(const S of p.innerChanges||[]){S.originalRange.startColumn>1&&S.modifiedRange.startColumn>1&&y(S.originalRange.startLineNumber,S.modifiedRange.startLineNumber);const L=i.getModel(),E=S.originalRange.endLineNumber<=L.getLineCount()?L.getLineMaxColumn(S.originalRange.endLineNumber):Number.MAX_SAFE_INTEGER;S.originalRange.endColumn1&&n.push({lineNumber:l,heightInPx:s*(c-1)})}for(const l of i.getWhitespaces()){if(e.has(l.id))continue;const c=l.afterLineNumber===0?0:o.convertViewPositionToModelPosition(new ae(l.afterLineNumber,1)).lineNumber;t.push({lineNumber:c,heightInPx:l.height})}return jZe(t,n,l=>l.lineNumber,(l,c)=>({lineNumber:l.lineNumber,heightInPx:l.heightInPx+c.heightInPx}))}var LQe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},EQe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Au;let Wb=Au=class extends fe{constructor(e,t,n,r,o,s,a){super(),this._editors=e,this._rootElement=t,this._diffModel=n,this._rootWidth=r,this._rootHeight=o,this._modifiedEditorLayoutInfo=s,this._themeService=a,this.width=Au.ENTIRE_DIFF_OVERVIEW_WIDTH;const l=Vi(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),c=Yt(h=>{const f=l.read(h),g=f.getColor(gWe)||(f.getColor(hWe)||kH).transparent(2),p=f.getColor(pWe)||(f.getColor(fWe)||TH).transparent(2);return{insertColor:g,removeColor:p}}),u=Qn(document.createElement("div"));u.setClassName("diffViewport"),u.setPosition("absolute");const d=gi("div.diffOverview",{style:{position:"absolute",top:"0px",width:Au.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;this._register(zR(d,u.domNode)),this._register(Sr(d,Ge.POINTER_DOWN,h=>{this._editors.modified.delegateVerticalScrollbarPointerDown(h)})),this._register(ye(d,Ge.MOUSE_WHEEL,h=>{this._editors.modified.delegateScrollFromMouseWheelEvent(h)},{passive:!1})),this._register(zR(this._rootElement,d)),this._register(Dh((h,f)=>{const g=this._diffModel.read(h),p=this._editors.original.createOverviewRuler("original diffOverviewRuler");p&&(f.add(p),f.add(zR(d,p.getDomNode())));const v=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(v&&(f.add(v),f.add(zR(d,v.getDomNode()))),!p||!v)return;const m=ma("viewZoneChanged",this._editors.original.onDidChangeViewZones),_=ma("viewZoneChanged",this._editors.modified.onDidChangeViewZones),y=ma("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),S=ma("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);f.add(bn(L=>{var E;m.read(L),_.read(L),y.read(L),S.read(L);const D=c.read(L),k=(E=g==null?void 0:g.diff.read(L))===null||E===void 0?void 0:E.mappings;function T(N,R,F){const W=F._getViewModel();return W?N.filter(H=>H.length>0).map(H=>{const G=W.coordinatesConverter.convertModelPositionToViewPosition(new ae(H.startLineNumber,1)),U=W.coordinatesConverter.convertModelPositionToViewPosition(new ae(H.endLineNumberExclusive,1)),K=U.lineNumber-G.lineNumber;return new Fve(G.lineNumber,U.lineNumber,K,R.toString())}):[]}const M=T((k||[]).map(N=>N.lineRangeMapping.original),D.removeColor,this._editors.original),A=T((k||[]).map(N=>N.lineRangeMapping.modified),D.insertColor,this._editors.modified);p==null||p.setZones(M),v==null||v.setZones(A)})),f.add(bn(L=>{const E=this._rootHeight.read(L),D=this._rootWidth.read(L),k=this._modifiedEditorLayoutInfo.read(L);if(k){const T=Au.ENTIRE_DIFF_OVERVIEW_WIDTH-2*Au.ONE_OVERVIEW_WIDTH;p.setLayout({top:0,height:E,right:T+Au.ONE_OVERVIEW_WIDTH,width:Au.ONE_OVERVIEW_WIDTH}),v.setLayout({top:0,height:E,right:0,width:Au.ONE_OVERVIEW_WIDTH});const M=this._editors.modifiedScrollTop.read(L),A=this._editors.modifiedScrollHeight.read(L),N=this._editors.modified.getOption(103),R=new Bw(N.verticalHasArrows?N.arrowSize:0,N.verticalScrollbarSize,0,k.height,A,M);u.setTop(R.getSliderPosition()),u.setHeight(R.getSliderSize())}else u.setTop(0),u.setHeight(0);d.style.height=E+"px",d.style.left=D-Au.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",u.setWidth(Au.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}};Wb.ONE_OVERVIEW_WIDTH=15;Wb.ENTIRE_DIFF_OVERVIEW_WIDTH=Au.ONE_OVERVIEW_WIDTH*2;Wb=Au=LQe([EQe(6,To)],Wb);class y3 extends fe{constructor(){super(...arguments),this._id=++y3.idCounter,this._onDidDispose=this._register(new se),this.onDidDispose=this._onDidDispose.event}getId(){return this.getEditorType()+":v2:"+this._id}getVisibleColumnFromPosition(e){return this._targetEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._targetEditor.getPosition()}setPosition(e,t="api"){this._targetEditor.setPosition(e,t)}revealLine(e,t=0){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){this._targetEditor.revealPositionNearTop(e,t)}getSelection(){return this._targetEditor.getSelection()}getSelections(){return this._targetEditor.getSelections()}setSelection(e,t="api"){this._targetEditor.setSelection(e,t)}setSelections(e,t="api"){this._targetEditor.setSelections(e,t)}revealLines(e,t,n=0){this._targetEditor.revealLines(e,t,n)}revealLinesInCenter(e,t,n=0){this._targetEditor.revealLinesInCenter(e,t,n)}revealLinesInCenterIfOutsideViewport(e,t,n=0){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,n)}revealLinesNearTop(e,t,n=0){this._targetEditor.revealLinesNearTop(e,t,n)}revealRange(e,t=0,n=!1,r=!0){this._targetEditor.revealRange(e,t,n,r)}revealRangeInCenter(e,t=0){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._targetEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._targetEditor.getSupportedActions()}focus(){this._targetEditor.focus()}trigger(e,t,n){this._targetEditor.trigger(e,t,n)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}}y3.idCounter=0;var DQe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Zse=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Sz=class extends fe{get onDidContentSizeChange(){return this._onDidContentSizeChange.event}constructor(e,t,n,r,o,s,a){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=n,this._createInnerEditor=o,this._instantiationService=s,this._keybindingService=a,this._onDidContentSizeChange=this._register(new se),this.original=this._register(this._createLeftHandSideEditor(n.editorOptions.get(),r.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(n.editorOptions.get(),r.modifiedEditor||{})),this.modifiedModel=Vi(this.modified.onDidChangeModel,()=>this.modified.getModel()),this.modifiedScrollTop=Vi(this.modified.onDidScrollChange,()=>this.modified.getScrollTop()),this.modifiedScrollHeight=Vi(this.modified.onDidScrollChange,()=>this.modified.getScrollHeight()),this.modifiedSelections=Vi(this.modified.onDidChangeCursorSelection,()=>{var l;return(l=this.modified.getSelections())!==null&&l!==void 0?l:[]}),this.modifiedCursor=Qy({owner:this,equalityComparer:ae.equals},l=>{var c,u;return(u=(c=this.modifiedSelections.read(l)[0])===null||c===void 0?void 0:c.getPosition())!==null&&u!==void 0?u:new ae(1,1)}),this.originalCursor=Vi(this.original.onDidChangeCursorPosition,()=>{var l;return(l=this.original.getPosition())!==null&&l!==void 0?l:new ae(1,1)}),this._register(rT({createEmptyChangeSummary:()=>({}),handleChange:(l,c)=>(l.didChange(n.editorOptions)&&Object.assign(c,l.change.changedOptions),!0)},(l,c)=>{n.editorOptions.read(l),this._options.renderSideBySide.read(l),this.modified.updateOptions(this._adjustOptionsForRightHandSide(l,c)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(l,c))}))}_createLeftHandSideEditor(e,t){const n=this._adjustOptionsForLeftHandSide(void 0,e),r=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,n,t);return r.setContextValue("isInDiffLeftEditor",!0),r}_createRightHandSideEditor(e,t){const n=this._adjustOptionsForRightHandSide(void 0,e),r=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,n,t);return r.setContextValue("isInDiffRightEditor",!0),r}_constructInnerEditor(e,t,n,r){const o=this._createInnerEditor(e,t,n,r);return this._register(o.onDidContentSizeChange(s=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+Wb.ENTIRE_DIFF_OVERVIEW_WIDTH,l=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:l,contentWidth:a,contentHeightChanged:s.contentHeightChanged,contentWidthChanged:s.contentWidthChanged})})),o}_adjustOptionsForLeftHandSide(e,t){const n=this._adjustOptionsForSubEditor(t);return this._options.renderSideBySide.get()?(n.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},n.wordWrapOverride1=this._options.diffWordWrap.get()):(n.wordWrapOverride1="off",n.wordWrapOverride2="off",n.stickyScroll={enabled:!1},n.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),n.glyphMargin=this._options.renderSideBySide.get(),t.originalAriaLabel&&(n.ariaLabel=t.originalAriaLabel),n.ariaLabel=this._updateAriaLabel(n.ariaLabel),n.readOnly=!this._options.originalEditable.get(),n.dropIntoEditor={enabled:!n.readOnly},n.extraEditorClassName="original-in-monaco-diff-editor",n}_adjustOptionsForRightHandSide(e,t){const n=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(n.ariaLabel=t.modifiedAriaLabel),n.ariaLabel=this._updateAriaLabel(n.ariaLabel),n.wordWrapOverride1=this._options.diffWordWrap.get(),n.revealHorizontalRightPadding=yh.revealHorizontalRightPadding.defaultValue+Wb.ENTIRE_DIFF_OVERVIEW_WIDTH,n.scrollbar.verticalHasArrows=!1,n.extraEditorClassName="modified-in-monaco-diff-editor",n}_adjustOptionsForSubEditor(e){const t={...e,dimension:{height:0,width:0}};return t.inDiffEditor=!0,t.automaticLayout=!1,t.scrollbar={...t.scrollbar||{}},t.folding=!1,t.codeLens=this._options.diffCodeLens.get(),t.fixedOverflowWidgets=!0,t.minimap={...t.minimap||{}},t.minimap.enabled=!1,this._options.hideUnchangedRegions.get()?t.stickyScroll={enabled:!1}:t.stickyScroll=this._options.editorOptions.get().stickyScroll,t}_updateAriaLabel(e){var t;e||(e="");const n=w("diff-aria-navigation-tip"," use {0} to open the accessibility help.",(t=this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp"))===null||t===void 0?void 0:t.getAriaLabel());return this._options.accessibilityVerbose.get()?e+n:e?e.replaceAll(n,""):""}};Sz=DQe([Zse(5,Ot),Zse(6,ci)],Sz);class IQe{get editorOptions(){return this._options}constructor(e){this._diffEditorWidth=Hn(this,0),this.couldShowInlineViewBecauseOfSize=Yt(this,n=>this._options.read(n).renderSideBySide&&this._diffEditorWidth.read(n)<=this._options.read(n).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=Yt(this,n=>this._options.read(n).renderOverviewRuler),this.renderSideBySide=Yt(this,n=>this._options.read(n).renderSideBySide&&!(this._options.read(n).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(n))),this.readOnly=Yt(this,n=>this._options.read(n).readOnly),this.shouldRenderRevertArrows=Yt(this,n=>!(!this._options.read(n).renderMarginRevertIcon||!this.renderSideBySide.read(n)||this.readOnly.read(n))),this.renderIndicators=Yt(this,n=>this._options.read(n).renderIndicators),this.enableSplitViewResizing=Yt(this,n=>this._options.read(n).enableSplitViewResizing),this.splitViewDefaultRatio=Yt(this,n=>this._options.read(n).splitViewDefaultRatio),this.ignoreTrimWhitespace=Yt(this,n=>this._options.read(n).ignoreTrimWhitespace),this.maxComputationTimeMs=Yt(this,n=>this._options.read(n).maxComputationTime),this.showMoves=Yt(this,n=>this._options.read(n).experimental.showMoves&&this.renderSideBySide.read(n)),this.isInEmbeddedEditor=Yt(this,n=>this._options.read(n).isInEmbeddedEditor),this.diffWordWrap=Yt(this,n=>this._options.read(n).diffWordWrap),this.originalEditable=Yt(this,n=>this._options.read(n).originalEditable),this.diffCodeLens=Yt(this,n=>this._options.read(n).diffCodeLens),this.accessibilityVerbose=Yt(this,n=>this._options.read(n).accessibilityVerbose),this.diffAlgorithm=Yt(this,n=>this._options.read(n).diffAlgorithm),this.showEmptyDecorations=Yt(this,n=>this._options.read(n).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=Yt(this,n=>this._options.read(n).onlyShowAccessibleDiffViewer),this.hideUnchangedRegions=Yt(this,n=>this._options.read(n).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=Yt(this,n=>this._options.read(n).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=Yt(this,n=>this._options.read(n).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=Yt(this,n=>this._options.read(n).hideUnchangedRegions.minimumLineCount);const t={...e,...Qse(e,Vs)};this._options=Hn(this,t)}updateOptions(e){const t=Qse(e,this._options.get()),n={...this._options.get(),...e,...t};this._options.set(n,void 0,{changedOptions:e})}setWidth(e){this._diffEditorWidth.set(e,void 0)}}function Qse(i,e){var t,n,r,o,s,a,l,c;return{enableSplitViewResizing:Lt(i.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:r3e(i.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:Lt(i.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:Lt(i.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:d0(i.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:d0(i.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:Lt(i.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:Lt(i.renderIndicators,e.renderIndicators),originalEditable:Lt(i.originalEditable,e.originalEditable),diffCodeLens:Lt(i.diffCodeLens,e.diffCodeLens),renderOverviewRuler:Lt(i.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:_r(i.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:_r(i.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:Lt(i.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:Lt((t=i.experimental)===null||t===void 0?void 0:t.showMoves,e.experimental.showMoves),showEmptyDecorations:Lt((n=i.experimental)===null||n===void 0?void 0:n.showEmptyDecorations,e.experimental.showEmptyDecorations)},hideUnchangedRegions:{enabled:Lt((o=(r=i.hideUnchangedRegions)===null||r===void 0?void 0:r.enabled)!==null&&o!==void 0?o:(s=i.experimental)===null||s===void 0?void 0:s.collapseUnchangedRegions,e.hideUnchangedRegions.enabled),contextLineCount:d0((a=i.hideUnchangedRegions)===null||a===void 0?void 0:a.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:d0((l=i.hideUnchangedRegions)===null||l===void 0?void 0:l.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:d0((c=i.hideUnchangedRegions)===null||c===void 0?void 0:c.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:Lt(i.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:Lt(i.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:d0(i.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:Lt(i.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited)}}const b9=[];class kQe extends fe{constructor(e,t,n,r){super(),this._editors=e,this._diffModel=t,this._options=n,this._widget=r,this._selectedDiffs=Yt(this,o=>{const s=this._diffModel.read(o),a=s==null?void 0:s.diff.read(o);if(!a)return b9;const l=this._editors.modifiedSelections.read(o);if(l.every(h=>h.isEmpty()))return b9;const c=new Hu(l.map(h=>pn.fromRangeInclusive(h))),d=a.mappings.filter(h=>h.lineRangeMapping.innerChanges&&c.intersects(h.lineRangeMapping.modified)).map(h=>({mapping:h,rangeMappings:h.lineRangeMapping.innerChanges.filter(f=>l.some(g=>B.areIntersecting(f.modifiedRange,g)))}));return d.length===0||d.every(h=>h.rangeMappings.length===0)?b9:d}),this._register(Dh((o,s)=>{if(!this._options.shouldRenderRevertArrows.read(o))return;const a=this._diffModel.read(o),l=a==null?void 0:a.diff.read(o);if(!a||!l||a.movedTextToCompare.read(o))return;const c=[],u=this._selectedDiffs.read(o),d=new Set(u.map(h=>h.mapping));if(u.length>0){const h=this._editors.modifiedSelections.read(o),f=s.add(new SI(h[h.length-1].positionLineNumber,this._widget,u.flatMap(g=>g.rangeMappings),!0));this._editors.modified.addGlyphMarginWidget(f),c.push(f)}for(const h of l.mappings)if(!d.has(h)&&!h.lineRangeMapping.modified.isEmpty&&h.lineRangeMapping.innerChanges){const f=s.add(new SI(h.lineRangeMapping.modified.startLineNumber,this._widget,h.lineRangeMapping.innerChanges,!1));this._editors.modified.addGlyphMarginWidget(f),c.push(f)}s.add(Rt(()=>{for(const h of c)this._editors.modified.removeGlyphMarginWidget(h)}))}))}}class SI extends fe{getId(){return this._id}constructor(e,t,n,r){super(),this._lineNumber=e,this._widget=t,this._diffs=n,this._revertSelection=r,this._id=`revertButton${SI.counter++}`,this._domNode=gi("div.revertButton",{title:this._revertSelection?w("revertSelectedChanges","Revert Selected Changes"):w("revertChange","Revert Change")},[nI(Xe.arrowRight)]).root,this._register(ye(this._domNode,Ge.MOUSE_DOWN,o=>{o.button!==2&&(o.stopPropagation(),o.preventDefault())})),this._register(ye(this._domNode,Ge.MOUSE_UP,o=>{o.stopPropagation(),o.preventDefault()})),this._register(ye(this._domNode,Ge.CLICK,o=>{this._widget.revertRangeMappings(this._diffs),o.stopPropagation(),o.preventDefault()}))}getDomNode(){return this._domNode}getPosition(){return{lane:$f.Right,range:{startColumn:1,startLineNumber:this._lineNumber,endColumn:1,endLineNumber:this._lineNumber},zIndex:10001}}}SI.counter=0;var TQe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},qx=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let t_=class extends y3{get onDidContentSizeChange(){return this._editors.onDidContentSizeChange}constructor(e,t,n,r,o,s,a,l){var c;super(),this._domElement=e,this._parentContextKeyService=r,this._parentInstantiationService=o,this._accessibilitySignalService=a,this._editorProgressService=l,this.elements=gi("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[gi("div.noModificationsOverlay@overlay",{style:{position:"absolute",height:"100%",visibility:"hidden"}},[He("span",{},"No Changes")]),gi("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),gi("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),gi("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModel=Hn(this,void 0),this._shouldDisposeDiffModel=!1,this.onDidChangeModel=Je.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._parentInstantiationService.createChild(new Kk([Vt,this._contextKeyService])),this._boundarySashes=Hn(this,void 0),this._accessibleDiffViewerShouldBeVisible=Hn(this,!1),this._accessibleDiffViewerVisible=Yt(this,S=>this._options.onlyShowAccessibleDiffViewer.read(S)?!0:this._accessibleDiffViewerShouldBeVisible.read(S)),this._movedBlocksLinesPart=Hn(this,void 0),this._layoutInfo=Yt(this,S=>{var L,E,D,k,T;const M=this._rootSizeObserver.width.read(S),A=this._rootSizeObserver.height.read(S),N=(L=this._sash.read(S))===null||L===void 0?void 0:L.sashLeft.read(S),R=N??Math.max(5,this._editors.original.getLayoutInfo().decorationsLeft),F=M-R-((D=(E=this._overviewRulerPart.read(S))===null||E===void 0?void 0:E.width)!==null&&D!==void 0?D:0),W=(T=(k=this._movedBlocksLinesPart.read(S))===null||k===void 0?void 0:k.width.read(S))!==null&&T!==void 0?T:0,H=R-W;return this.elements.original.style.width=H+"px",this.elements.original.style.left="0px",this.elements.modified.style.width=F+"px",this.elements.modified.style.left=R+"px",this._editors.original.layout({width:H,height:A},!0),this._editors.modified.layout({width:F,height:A},!0),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((S,L)=>S==null?void 0:S.diff.read(L)),this.onDidUpdateDiff=Je.fromObservableLight(this._diffValue),s.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(Rt(()=>this._domElement.removeChild(this.elements.root))),this._rootSizeObserver=this._register(new V0e(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout((c=t.automaticLayout)!==null&&c!==void 0?c:!1),this._options=new IQe(t),this._register(bn(S=>{this._options.setWidth(this._rootSizeObserver.width.read(S))})),this._contextKeyService.createKey(j.isEmbeddedDiffEditor.key,!1),this._register(UR(j.isEmbeddedDiffEditor,this._contextKeyService,S=>this._options.isInEmbeddedEditor.read(S))),this._register(UR(j.comparingMovedCode,this._contextKeyService,S=>{var L;return!!(!((L=this._diffModel.read(S))===null||L===void 0)&&L.movedTextToCompare.read(S))})),this._register(UR(j.diffEditorRenderSideBySideInlineBreakpointReached,this._contextKeyService,S=>this._options.couldShowInlineViewBecauseOfSize.read(S))),this._register(UR(j.hasChanges,this._contextKeyService,S=>{var L,E,D;return((D=(E=(L=this._diffModel.read(S))===null||L===void 0?void 0:L.diff.read(S))===null||E===void 0?void 0:E.mappings.length)!==null&&D!==void 0?D:0)>0})),this._editors=this._register(this._instantiationService.createInstance(Sz,this.elements.original,this.elements.modified,this._options,n,(S,L,E,D)=>this._createInnerEditor(S,L,E,D))),this._overviewRulerPart=wm(this,S=>this._options.renderOverviewRuler.read(S)?this._instantiationService.createInstance(sf(Wb,S),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(L=>L.modifiedEditor)):void 0).recomputeInitiallyAndOnChange(this._store),this._sash=wm(this,S=>{const L=this._options.renderSideBySide.read(S);return this.elements.root.classList.toggle("side-by-side",L),L?new gQe(this._options,this.elements.root,{height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((E,D)=>{var k,T;return E-((T=(k=this._overviewRulerPart.read(D))===null||k===void 0?void 0:k.width)!==null&&T!==void 0?T:0)})},this._boundarySashes):void 0}).recomputeInitiallyAndOnChange(this._store);const u=wm(this,S=>this._instantiationService.createInstance(sf(wI,S),this._editors,this._diffModel,this._options)).recomputeInitiallyAndOnChange(this._store);wm(this,S=>this._instantiationService.createInstance(sf(fQe,S),this._editors,this._diffModel,this._options,this)).recomputeInitiallyAndOnChange(this._store);const d=new Set,h=new Set;let f=!1;const g=wm(this,S=>this._instantiationService.createInstance(sf(wz,S),Pt(this._domElement),this._editors,this._diffModel,this._options,this,()=>f||u.get().isUpdatingHiddenAreas,d,h)).recomputeInitiallyAndOnChange(this._store),p=Yt(this,S=>{const L=g.read(S).viewZones.read(S).orig,E=u.read(S).viewZones.read(S).origViewZones;return L.concat(E)}),v=Yt(this,S=>{const L=g.read(S).viewZones.read(S).mod,E=u.read(S).viewZones.read(S).modViewZones;return L.concat(E)});this._register(oO(this._editors.original,p,S=>{f=S},d));let m;this._register(oO(this._editors.modified,v,S=>{f=S,f?m=_h.capture(this._editors.modified):(m==null||m.restore(this._editors.modified),m=void 0)},h)),this._accessibleDiffViewer=wm(this,S=>this._instantiationService.createInstance(sf(Jm,S),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(L,E)=>this._accessibleDiffViewerShouldBeVisible.set(L,E),this._options.onlyShowAccessibleDiffViewer.map(L=>!L),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((L,E)=>{var D;return(D=L==null?void 0:L.diff.read(E))===null||D===void 0?void 0:D.mappings.map(k=>k.lineRangeMapping)}),new aQe(this._editors))).recomputeInitiallyAndOnChange(this._store);const _=this._accessibleDiffViewerVisible.map(S=>S?"hidden":"visible");this._register(Dv(this.elements.modified,{visibility:_})),this._register(Dv(this.elements.original,{visibility:_})),this._createDiffEditorContributions(),s.addDiffEditor(this),this._register(oT(this._layoutInfo)),wm(this,S=>new(sf(Iv,S))(this.elements.root,this._diffModel,this._layoutInfo.map(L=>L.originalEditor),this._layoutInfo.map(L=>L.modifiedEditor),this._editors)).recomputeInitiallyAndOnChange(this._store,S=>{this._movedBlocksLinesPart.set(S,void 0)}),this._register(Dv(this.elements.overlay,{width:this._layoutInfo.map((S,L)=>S.originalEditor.width+(this._options.renderSideBySide.read(L)?0:S.modifiedEditor.width)),visibility:Yt(S=>{var L,E;return this._options.hideUnchangedRegions.read(S)&&((E=(L=this._diffModel.read(S))===null||L===void 0?void 0:L.diff.read(S))===null||E===void 0?void 0:E.mappings.length)===0?"visible":"hidden"})})),this._register(Je.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,S=>{var L,E;if((S==null?void 0:S.reason)===3){const D=(E=(L=this._diffModel.get())===null||L===void 0?void 0:L.diff.get())===null||E===void 0?void 0:E.mappings.find(k=>k.lineRangeMapping.modified.contains(S.position.lineNumber));D!=null&&D.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(cn.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):D!=null&&D.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(cn.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):D&&this._accessibilitySignalService.playSignal(cn.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}));const y=this._diffModel.map(this,(S,L)=>{if(S)return S.diff.read(L)===void 0&&!S.isDiffUpToDate.read(L)});this._register(Dh((S,L)=>{if(y.read(S)===!0){const E=this._editorProgressService.show(!0,1e3);L.add(Rt(()=>E.done()))}})),this._register(Rt(()=>{var S;this._shouldDisposeDiffModel&&((S=this._diffModel.get())===null||S===void 0||S.dispose())})),this._register(new kQe(this._editors,this._diffModel,this._options,this))}_createInnerEditor(e,t,n,r){return e.createInstance($w,t,n,r)}_createDiffEditorContributions(){const e=Ay.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(n){en(n)}}get _targetEditor(){return this._editors.modified}getEditorType(){return Ok.IDiffEditor}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){var e;const t=this._editors.original.saveViewState(),n=this._editors.modified.saveViewState();return{original:t,modified:n,modelState:(e=this._diffModel.get())===null||e===void 0?void 0:e.serializeState()}}restoreViewState(e){var t;if(e&&e.original&&e.modified){const n=e;this._editors.original.restoreViewState(n.original),this._editors.modified.restoreViewState(n.modified),n.modelState&&((t=this._diffModel.get())===null||t===void 0||t.restoreSerializedState(n.modelState))}}handleInitialized(){this._editors.original.handleInitialized(),this._editors.modified.handleInitialized()}createViewModel(e){return this._instantiationService.createInstance(yz,e,this._options)}getModel(){var e,t;return(t=(e=this._diffModel.get())===null||e===void 0?void 0:e.model)!==null&&t!==void 0?t:null}setModel(e,t){!e&&this._diffModel.get()&&this._accessibleDiffViewer.get().close();const n=e?"model"in e?{model:e,shouldDispose:!1}:{model:this.createViewModel(e),shouldDispose:!0}:void 0;this._diffModel.get()!==(n==null?void 0:n.model)&&CI(t,r=>{var o;Vi.batchEventsGlobally(r,()=>{this._editors.original.setModel(n?n.model.model.original:null),this._editors.modified.setModel(n?n.model.model.modified:null)});const s=this._diffModel.get(),a=this._shouldDisposeDiffModel;this._shouldDisposeDiffModel=(o=n==null?void 0:n.shouldDispose)!==null&&o!==void 0?o:!1,this._diffModel.set(n==null?void 0:n.model,r),a&&(s==null||s.dispose())})}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}getLineChanges(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.diff.get();return t?NQe(t):null}revert(e){if(e.innerChanges){this.revertRangeMappings(e.innerChanges);return}const t=this._diffModel.get();!t||!t.isDiffUpToDate.get()||this._editors.modified.executeEdits("diffEditor",[{range:e.modified.toExclusiveRange(),text:t.model.original.getValueInRange(e.original.toExclusiveRange())}])}revertRangeMappings(e){const t=this._diffModel.get();if(!t||!t.isDiffUpToDate.get())return;const n=e.map(r=>({range:r.modifiedRange,text:t.model.original.getValueInRange(r.originalRange)}));this._editors.modified.executeEdits("diffEditor",n)}_goTo(e){this._editors.modified.setPosition(new ae(e.lineRangeMapping.modified.startLineNumber,1)),this._editors.modified.revealRangeInCenter(e.lineRangeMapping.modified.toExclusiveRange())}goToDiff(e){var t,n,r,o;const s=(n=(t=this._diffModel.get())===null||t===void 0?void 0:t.diff.get())===null||n===void 0?void 0:n.mappings;if(!s||s.length===0)return;const a=this._editors.modified.getPosition().lineNumber;let l;e==="next"?l=(r=s.find(c=>c.lineRangeMapping.modified.startLineNumber>a))!==null&&r!==void 0?r:s[0]:l=(o=RD(s,c=>c.lineRangeMapping.modified.startLineNumber{var t;const n=(t=e.diff.get())===null||t===void 0?void 0:t.mappings;!n||n.length===0||this._goTo(n[0])})}accessibleDiffViewerNext(){this._accessibleDiffViewer.get().next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.get().prev()}async waitForDiff(){const e=this._diffModel.get();e&&await e.waitForDiff()}mapToOtherSide(){var e,t;const n=this._editors.modified.hasWidgetFocus(),r=n?this._editors.modified:this._editors.original,o=n?this._editors.original:this._editors.modified;let s;const a=r.getSelection();if(a){const l=(t=(e=this._diffModel.get())===null||e===void 0?void 0:e.diff.get())===null||t===void 0?void 0:t.mappings.map(c=>n?c.lineRangeMapping.flip():c.lineRangeMapping);if(l){const c=Bse(a.getStartPosition(),l),u=Bse(a.getEndPosition(),l);s=B.plusRange(c,u)}}return{destination:o,destinationSelection:s}}switchSide(){const{destination:e,destinationSelection:t}=this.mapToOtherSide();e.focus(),t&&e.setSelection(t)}exitCompareMove(){const e=this._diffModel.get();e&&e.movedTextToCompare.set(void 0,void 0)}collapseAllUnchangedRegions(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();t&&Ri(n=>{for(const r of t)r.collapseAll(n)})}showAllUnchangedRegions(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();t&&Ri(n=>{for(const r of t)r.showAll(n)})}};t_=TQe([qx(3,Vt),qx(4,Ot),qx(5,Un),qx(6,R_),qx(7,k_)],t_);function NQe(i){return i.mappings.map(e=>{const t=e.lineRangeMapping;let n,r,o,s,a=t.innerChanges;return t.original.isEmpty?(n=t.original.startLineNumber-1,r=0,a=void 0):(n=t.original.startLineNumber,r=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(o=t.modified.startLineNumber-1,s=0,a=void 0):(o=t.modified.startLineNumber,s=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:n,originalEndLineNumber:r,modifiedStartLineNumber:o,modifiedEndLineNumber:s,charChanges:a==null?void 0:a.map(l=>({originalStartLineNumber:l.originalRange.startLineNumber,originalStartColumn:l.originalRange.startColumn,originalEndLineNumber:l.originalRange.endLineNumber,originalEndColumn:l.originalRange.endColumn,modifiedStartLineNumber:l.modifiedRange.startLineNumber,modifiedStartColumn:l.modifiedRange.startColumn,modifiedEndLineNumber:l.modifiedRange.endLineNumber,modifiedEndColumn:l.modifiedRange.endColumn}))}})}var wY=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Ki=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let RQe=0,Jse=!1;function MQe(i){if(!i){if(Jse)return;Jse=!0}_7e(i||hi.document.body)}let aO=class extends $w{constructor(e,t,n,r,o,s,a,l,c,u,d,h){const f={...t};f.ariaLabel=f.ariaLabel||RP.editorViewAccessibleLabel,f.ariaLabel=f.ariaLabel+";"+RP.accessibilityHelpMessage,super(e,f,{},n,r,o,s,l,c,u,d,h),a instanceof qw?this._standaloneKeybindingService=a:this._standaloneKeybindingService=null,MQe(f.ariaContainerElement),GGe((g,p)=>n.createInstance(EP,g,p,{}))}addCommand(e,t,n){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const r="DYNAMIC_"+ ++RQe,o=De.deserialize(n);return this._standaloneKeybindingService.addDynamicKeybinding(r,e,t,o),r}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if(typeof e.id!="string"||typeof e.label!="string"||typeof e.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),fe.None;const t=e.id,n=e.label,r=De.and(De.equals("editorId",this.getId()),De.deserialize(e.precondition)),o=e.keybindings,s=De.and(r,De.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,l=e.contextMenuOrder||0,c=(f,...g)=>Promise.resolve(e.run(this,...g)),u=new Te,d=this.getId()+":"+t;if(u.add(Dn.registerCommand(d,c)),a){const f={command:{id:d,title:n},when:r,group:a,order:l};u.add(ts.appendMenuItem($.EditorContext,f))}if(Array.isArray(o))for(const f of o)u.add(this._standaloneKeybindingService.addDynamicKeybinding(d,f,c,s));const h=new Wve(d,n,n,void 0,r,(...f)=>Promise.resolve(e.run(this,...f)),this._contextKeyService);return this._actions.set(t,h),u.add(Rt(()=>{this._actions.delete(t)})),u}_triggerCommand(e,t){if(this._codeEditorService instanceof wP)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};aO=wY([Ki(2,Ot),Ki(3,Un),Ki(4,sr),Ki(5,Vt),Ki(6,ci),Ki(7,To),Ki(8,$r),Ki(9,ud),Ki(10,Di),Ki(11,_t)],aO);let xz=class extends aO{constructor(e,t,n,r,o,s,a,l,c,u,d,h,f,g,p){const v={...t};nO(u,v,!1);const m=l.registerEditorContainer(e);typeof v.theme=="string"&&l.setTheme(v.theme),typeof v.autoDetectHighContrast<"u"&&l.setAutoDetectHighContrast(!!v.autoDetectHighContrast);const _=v.model;delete v.model,super(e,v,n,r,o,s,a,l,c,d,g,p),this._configurationService=u,this._standaloneThemeService=l,this._register(m);let y;if(typeof _>"u"){const S=f.getLanguageIdByMimeType(v.language)||v.language||hc;y=q0e(h,f,v.value||"",S,void 0),this._ownsModel=!0}else y=_,this._ownsModel=!1;if(this._attachModel(y),y){const S={oldModelUrl:null,newModelUrl:y.uri};this._onDidChangeModel.fire(S)}}dispose(){super.dispose()}updateOptions(e){nO(this._configurationService,e,!1),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};xz=wY([Ki(2,Ot),Ki(3,Un),Ki(4,sr),Ki(5,Vt),Ki(6,ci),Ki(7,Sc),Ki(8,$r),Ki(9,gn),Ki(10,ud),Ki(11,tr),Ki(12,ji),Ki(13,Di),Ki(14,_t)],xz);let Lz=class extends t_{constructor(e,t,n,r,o,s,a,l,c,u,d,h){const f={...t};nO(l,f,!0);const g=s.registerEditorContainer(e);typeof f.theme=="string"&&s.setTheme(f.theme),typeof f.autoDetectHighContrast<"u"&&s.setAutoDetectHighContrast(!!f.autoDetectHighContrast),super(e,f,{},r,n,o,h,u),this._configurationService=l,this._standaloneThemeService=s,this._register(g)}dispose(){super.dispose()}updateOptions(e){nO(this._configurationService,e,!0),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_createInnerEditor(e,t,n){return e.createInstance(aO,t,n)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,n){return this.getModifiedEditor().addCommand(e,t,n)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};Lz=wY([Ki(2,Ot),Ki(3,Vt),Ki(4,Un),Ki(5,Sc),Ki(6,$r),Ki(7,gn),Ki(8,Ol),Ki(9,k_),Ki(10,Kp),Ki(11,R_)],Lz);function q0e(i,e,t,n,r){if(t=t||"",!n){const o=t.indexOf(` +`);let s=t;return o!==-1&&(s=t.substring(0,o)),eae(i,t,e.createByFilepathOrFirstLine(r||null,s),r)}return eae(i,t,e.createById(n),r)}function eae(i,e,t,n){return i.createModel(e,t,n)}class AQe extends fe{constructor(e,t,n={orientation:0}){var r;super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new r5e),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new Te),n.hoverDelegate=(r=n.hoverDelegate)!==null&&r!==void 0?r:this._register(zp("element",!0)),this.options=n,this.lookupKeybindings=typeof this.options.getKeyBinding=="function",this.toggleMenuAction=this._register(new xI(()=>{var o;return(o=this.toggleMenuActionViewItem)===null||o===void 0?void 0:o.show()},n.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new au(this.element,{orientation:n.orientation,ariaLabel:n.ariaLabel,actionRunner:n.actionRunner,allowContextMenu:n.allowContextMenu,highlightToggledItems:n.highlightToggledItems,hoverDelegate:n.hoverDelegate,actionViewItemProvider:(o,s)=>{var a;if(o.id===xI.ID)return this.toggleMenuActionViewItem=new PP(o,o.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:Wt.asClassNameArray((a=n.moreIcon)!==null&&a!==void 0?a:Xe.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,isMenu:!0,hoverDelegate:this.options.hoverDelegate}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(n.actionViewItemProvider){const l=n.actionViewItemProvider(o,s);if(l)return l}if(o instanceof Lw){const l=new PP(o,o.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:o.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,hoverDelegate:this.options.hoverDelegate});return l.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(l),this.disposables.add(this._onDidChangeDropdownVisibility.add(l.onDidChangeVisibility)),l}}}))}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}getElement(){return this.element}getItemAction(e){return this.actionBar.getAction(e)}setActions(e,t){this.clear();const n=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),n.push(this.toggleMenuAction)),n.forEach(r=>{this.actionBar.push(r,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(r)})})}getKeybindingLabel(e){var t,n,r;const o=this.lookupKeybindings?(n=(t=this.options).getKeyBinding)===null||n===void 0?void 0:n.call(t,e):void 0;return(r=o==null?void 0:o.getLabel())!==null&&r!==void 0?r:void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}class xI extends xl{constructor(e,t){t=t||w("moreActions","More Actions..."),super(xI.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}async run(){this.toggleDropdownMenu()}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}}xI.ID="toolbar.toggle.more";var X0e=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},vf=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let LI=class extends AQe{constructor(e,t,n,r,o,s,a){super(e,o,{getKeyBinding:c=>{var u;return(u=s.lookupKeybinding(c.id))!==null&&u!==void 0?u:void 0},...t,allowContextMenu:!0,skipTelemetry:typeof(t==null?void 0:t.telemetrySource)=="string"}),this._options=t,this._menuService=n,this._contextKeyService=r,this._contextMenuService=o,this._sessionDisposables=this._store.add(new Te);const l=t==null?void 0:t.telemetrySource;l&&this._store.add(this.actionBar.onDidRun(c=>a.publicLog2("workbenchActionExecuted",{id:c.action.id,from:l})))}setActions(e,t=[],n){var r,o,s;this._sessionDisposables.clear();const a=e.slice(),l=t.slice(),c=[];let u=0;const d=[];let h=!1;if(((r=this._options)===null||r===void 0?void 0:r.hiddenItemStrategy)!==-1)for(let f=0;fv==null?void 0:v.id)),g=this._options.overflowBehavior.maxItems-f.size;let p=0;for(let v=0;v=g&&(a[v]=void 0,d[v]=m))}}Nne(a),Nne(d),super.setActions(a,lo.join(d,l)),c.length>0&&this._sessionDisposables.add(ye(this.getElement(),"contextmenu",f=>{var g,p,v,m,_;const y=new Uu(Pt(this.getElement()),f),S=this.getItemAction(y.target);if(!S)return;y.preventDefault(),y.stopPropagation();let L=!1;if(u===1&&((g=this._options)===null||g===void 0?void 0:g.hiddenItemStrategy)===0){L=!0;for(let k=0;kthis._menuService.resetHiddenStates(n)}))),this._contextMenuService.showContextMenu({getAnchor:()=>y,getActions:()=>D,menuId:(v=this._options)===null||v===void 0?void 0:v.contextMenu,menuActionOptions:{renderShortTitle:!0,...(m=this._options)===null||m===void 0?void 0:m.menuOptions},skipTelemetry:typeof((_=this._options)===null||_===void 0?void 0:_.telemetrySource)=="string",contextKeyService:this._contextKeyService})}))}};LI=X0e([vf(2,hu),vf(3,Vt),vf(4,Ol),vf(5,ci),vf(6,ea)],LI);let Ez=class extends LI{constructor(e,t,n,r,o,s,a,l){super(e,{resetMenu:t,...n},r,o,s,a,l),this._onDidChangeMenuItems=this._store.add(new se);const c=this._store.add(r.createMenu(t,o,{emitEventsForSubmenuChanges:!0})),u=()=>{var d,h,f;const g=[],p=[];i3(c,n==null?void 0:n.menuOptions,{primary:g,secondary:p},(d=n==null?void 0:n.toolbarOptions)===null||d===void 0?void 0:d.primaryGroup,(h=n==null?void 0:n.toolbarOptions)===null||h===void 0?void 0:h.shouldInlineSubmenu,(f=n==null?void 0:n.toolbarOptions)===null||f===void 0?void 0:f.useSeparatorsInPrimaryActions),e.classList.toggle("has-no-actions",g.length===0&&p.length===0),super.setActions(g,p)};this._store.add(c.onDidChange(()=>{u(),this._onDidChangeMenuItems.fire(this)})),u()}setActions(){throw new qi("This toolbar is populated from a menu.")}};Ez=X0e([vf(3,hu),vf(4,Vt),vf(5,Ol),vf(6,ci),vf(7,ea)],Ez);class PQe extends Nb{constructor(e){super(),this._getContext=e}runAction(e,t){return super.runAction(e,this._getContext())}}var OQe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},FQe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class BQe{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let lO=class extends fe{constructor(e,t,n,r){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=n,this._instantiationService=r,this._viewModel=Hn(this,void 0),this._collapsed=Yt(this,s=>{var a;return(a=this._viewModel.read(s))===null||a===void 0?void 0:a.collapsed.read(s)}),this._editorContentHeight=Hn(this,500),this.contentHeight=Yt(this,s=>(this._collapsed.read(s)?0:this._editorContentHeight.read(s))+this._outerEditorHeight),this._modifiedContentWidth=Hn(this,0),this._modifiedWidth=Hn(this,0),this._originalContentWidth=Hn(this,0),this._originalWidth=Hn(this,0),this.maxScroll=Yt(this,s=>{const a=this._modifiedContentWidth.read(s)-this._modifiedWidth.read(s),l=this._originalContentWidth.read(s)-this._originalWidth.read(s);return a>l?{maxScroll:a,width:this._modifiedWidth.read(s)}:{maxScroll:l,width:this._originalWidth.read(s)}}),this._elements=gi("div.multiDiffEntry",[gi("div.header@header",[gi("div.header-content",[gi("div.collapse-button@collapseButton"),gi("div.file-path",[gi("div.title.modified.show-file-icons@primaryPath",[]),gi("div.status.deleted@status",["R"]),gi("div.title.original.show-file-icons@secondaryPath",[])]),gi("div.actions@actions")])]),gi("div.editorParent",[gi("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(t_,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode},{})),this.isModifedFocused=tae(this.editor.getModifiedEditor()),this.isOriginalFocused=tae(this.editor.getOriginalEditor()),this.isFocused=Yt(this,s=>this.isModifedFocused.read(s)||this.isOriginalFocused.read(s)),this._resourceLabel=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.primaryPath)):void 0,this._resourceLabel2=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.secondaryPath)):void 0,this._dataStore=new Te,this._headerHeight=48,this._lastScrollTop=-1,this._isSettingScrollTop=!1;const o=new QP(this._elements.collapseButton,{});this._register(bn(s=>{o.element.className="",o.icon=this._collapsed.read(s)?Xe.chevronRight:Xe.chevronDown})),this._register(o.onDidClick(()=>{var s;(s=this._viewModel.get())===null||s===void 0||s.collapsed.set(!this._collapsed.get(),void 0)})),this._register(bn(s=>{this._elements.editor.style.display=this._collapsed.read(s)?"none":"block"})),this._register(this.editor.getModifiedEditor().onDidLayoutChange(s=>{const a=this.editor.getModifiedEditor().getLayoutInfo().contentWidth;this._modifiedWidth.set(a,void 0)})),this._register(this.editor.getOriginalEditor().onDidLayoutChange(s=>{const a=this.editor.getOriginalEditor().getLayoutInfo().contentWidth;this._originalWidth.set(a,void 0)})),this._register(this.editor.onDidContentSizeChange(s=>{AM(a=>{this._editorContentHeight.set(s.contentHeight,a),this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(),a),this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(),a)})})),this._register(this.editor.getOriginalEditor().onDidScrollChange(s=>{if(this._isSettingScrollTop||!s.scrollTopChanged||!this._data)return;const a=s.scrollTop-this._lastScrollTop;this._data.deltaScrollVertical(a)})),this._register(bn(s=>{const a=this.isFocused.read(s);this._elements.root.classList.toggle("focused",a)})),this._container.appendChild(this._elements.root),this._outerEditorHeight=this._headerHeight,this._register(this._instantiationService.createInstance(Ez,this._elements.actions,$.MultiDiffEditorFileToolbar,{actionRunner:this._register(new PQe(()=>{var s;return(s=this._viewModel.get())===null||s===void 0?void 0:s.modifiedUri})),menuOptions:{shouldForwardArgs:!0},toolbarOptions:{primaryGroup:s=>s.startsWith("navigation")},actionViewItemProvider:(s,a)=>q_e(r,s,a)}))}setScrollLeft(e){this._modifiedContentWidth.get()-this._modifiedWidth.get()>this._originalContentWidth.get()-this._originalWidth.get()?this.editor.getModifiedEditor().setScrollLeft(e):this.editor.getOriginalEditor().setScrollLeft(e)}setData(e){this._data=e;function t(r){return{...r,scrollBeyondLastLine:!1,hideUnchangedRegions:{enabled:!0},scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1,useShadows:!1},renderOverviewRuler:!1,fixedOverflowWidgets:!0,overviewRulerBorder:!1}}const n=e.viewModel.entry.value;n.onOptionsDidChange&&this._dataStore.add(n.onOptionsDidChange(()=>{var r;this.editor.updateOptions(t((r=n.options)!==null&&r!==void 0?r:{}))})),AM(r=>{var o,s,a,l;(o=this._resourceLabel)===null||o===void 0||o.setUri((s=e.viewModel.modifiedUri)!==null&&s!==void 0?s:e.viewModel.originalUri,{strikethrough:e.viewModel.modifiedUri===void 0});let c=!1,u=!1,d=!1,h="";e.viewModel.modifiedUri&&e.viewModel.originalUri&&e.viewModel.modifiedUri.path!==e.viewModel.originalUri.path?(h="R",c=!0):e.viewModel.modifiedUri?e.viewModel.originalUri||(h="A",d=!0):(h="D",u=!0),this._elements.status.classList.toggle("renamed",c),this._elements.status.classList.toggle("deleted",u),this._elements.status.classList.toggle("added",d),this._elements.status.innerText=h,(a=this._resourceLabel2)===null||a===void 0||a.setUri(c?e.viewModel.originalUri:void 0,{strikethrough:!0}),this._dataStore.clear(),this._viewModel.set(e.viewModel,r),this.editor.setModel(e.viewModel.diffEditorViewModel,r),this.editor.updateOptions(t((l=n.options)!==null&&l!==void 0?l:{}))})}render(e,t,n,r){this._elements.root.style.visibility="visible",this._elements.root.style.top=`${e.start}px`,this._elements.root.style.height=`${e.length}px`,this._elements.root.style.width=`${t}px`,this._elements.root.style.position="absolute";const o=e.length-this._headerHeight,s=Math.max(0,Math.min(r.start-e.start,o));this._elements.header.style.transform=`translateY(${s}px)`,AM(a=>{this.editor.layout({width:t-2*8-2*1,height:e.length-this._outerEditorHeight})});try{this._isSettingScrollTop=!0,this._lastScrollTop=n,this.editor.getOriginalEditor().setScrollTop(n)}finally{this._isSettingScrollTop=!1}this._elements.header.classList.toggle("shadow",s>0||n>0),this._elements.header.classList.toggle("collapsed",s===o)}hide(){this._elements.root.style.top="-100000px",this._elements.root.style.visibility="hidden"}};lO=OQe([FQe(3,Ot)],lO);function tae(i){return Vi(e=>{const t=new Te;return t.add(i.onDidFocusEditorWidget(()=>e(!0))),t.add(i.onDidBlurEditorWidget(()=>e(!1))),t},()=>i.hasWidgetFocus())}class WQe{constructor(e){this._create=e,this._unused=new Set,this._used=new Set,this._itemData=new Map}getUnusedObj(e){var t;let n;if(this._unused.size===0)n=this._create(e),this._itemData.set(n,e);else{const r=[...this._unused.values()];n=(t=r.find(o=>this._itemData.get(o).getId()===e.getId()))!==null&&t!==void 0?t:r[0],this._unused.delete(n),this._itemData.set(n,e),n.setData(e)}return this._used.add(n),{object:n,dispose:()=>{this._used.delete(n),this._unused.size>5?n.dispose():this._unused.add(n)}}}dispose(){for(const e of this._used)e.dispose();for(const e of this._unused)e.dispose();this._used.clear(),this._unused.clear()}}var $Qe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},nae=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Dz=class extends fe{constructor(e,t,n,r,o,s){super(),this._element=e,this._dimension=t,this._viewModel=n,this._workbenchUIElementFactory=r,this._parentContextKeyService=o,this._parentInstantiationService=s,this._elements=gi("div.monaco-component.multiDiffEditor",[gi("div@content",{style:{overflow:"hidden"}}),gi("div.monaco-editor@overflowWidgetsDomNode",{})]),this._sizeObserver=this._register(new V0e(this._element,void 0)),this._objectPool=this._register(new WQe(l=>{const c=this._instantiationService.createInstance(lO,this._elements.content,this._elements.overflowWidgetsDomNode,this._workbenchUIElementFactory);return c.setData(l),c})),this._scrollable=this._register(new TS({forceIntegerValues:!1,scheduleAtNextAnimationFrame:l=>Il(Pt(this._element),l),smoothScrollDuration:100})),this._scrollableElement=this._register(new O4(this._elements.root,{vertical:1,horizontal:1,useShadows:!1},this._scrollable)),this.scrollTop=Vi(this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollTop),this.scrollLeft=Vi(this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollLeft),this._viewItems=OS(this,(l,c)=>{const u=this._viewModel.read(l);return u?u.items.read(l).map(h=>{var f;const g=c.add(new HQe(h,this._objectPool,this.scrollLeft,v=>{this._scrollableElement.setScrollPosition({scrollTop:this._scrollableElement.getScrollPosition().scrollTop+v})})),p=(f=this._lastDocStates)===null||f===void 0?void 0:f[g.getKey()];return p&&Ri(v=>{g.setViewState(p,v)}),g}):[]}),this._spaceBetweenPx=0,this._totalHeight=this._viewItems.map(this,(l,c)=>l.reduce((u,d)=>u+d.contentHeight.read(c)+this._spaceBetweenPx,0)),this.activeDiffItem=Yt(this,l=>this._viewItems.read(l).find(c=>{var u;return(u=c.template.read(l))===null||u===void 0?void 0:u.isFocused.read(l)})),this.lastActiveDiffItem=HZe((l,c)=>{var u;return(u=this.activeDiffItem.read(l))!==null&&u!==void 0?u:c}),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._element)),this._instantiationService=this._parentInstantiationService.createChild(new Kk([Vt,this._contextKeyService])),this._lastDocStates={},this._contextKeyService.createKey(j.inMultiDiffEditor.key,!0),this._register(Dh((l,c)=>{const u=this._viewModel.read(l);if(u&&u.contextKeys)for(const[d,h]of Object.entries(u.contextKeys)){const f=this._contextKeyService.createKey(d,void 0);f.set(h),c.add(Rt(()=>f.reset()))}}));const a=this._parentContextKeyService.createKey(j.multiDiffEditorAllCollapsed.key,!1);this._register(bn(l=>{const c=this._viewModel.read(l);if(c){const u=c.items.read(l).every(d=>d.collapsed.read(l));a.set(u)}})),this._register(bn(l=>{const c=this.lastActiveDiffItem.read(l);Ri(u=>{var d;(d=this._viewModel.read(l))===null||d===void 0||d.activeDiffItem.set(c==null?void 0:c.viewModel,u)})})),this._register(bn(l=>{const c=this._dimension.read(l);this._sizeObserver.observe(c)})),this._elements.content.style.position="relative",this._register(bn(l=>{const c=this._sizeObserver.height.read(l);this._elements.root.style.height=`${c}px`;const u=this._totalHeight.read(l);this._elements.content.style.height=`${u}px`;const d=this._sizeObserver.width.read(l);let h=d;const f=this._viewItems.read(l),g=Bq(f,p=>p.maxScroll.read(l).maxScroll);if(g){const p=g.maxScroll.read(l);h=d+p.maxScroll}this._scrollableElement.setScrollDimensions({width:d,height:c,scrollHeight:u,scrollWidth:h})})),e.replaceChildren(this._scrollableElement.getDomNode()),this._register(Rt(()=>{e.replaceChildren()})),this._register(this._register(bn(l=>{AM(c=>{this.render(l)})})))}render(e){const t=this.scrollTop.read(e);let n=0,r=0,o=0;const s=this._sizeObserver.height.read(e),a=vn.ofStartAndLength(t,s),l=this._sizeObserver.width.read(e);for(const c of this._viewItems.read(e)){const u=c.contentHeight.read(e),d=Math.min(u,s),h=vn.ofStartAndLength(r,d),f=vn.ofStartAndLength(o,u);if(f.isBefore(a))n-=u-d,c.hide();else if(f.isAfter(a))c.hide();else{const g=Math.max(0,Math.min(a.start-f.start,u-d));n-=g;const p=vn.ofStartAndLength(t+n,s);c.render(h,g,l,p)}r+=d+this._spaceBetweenPx,o+=u+this._spaceBetweenPx}this._elements.content.style.transform=`translateY(${-(t+n)}px)`}};Dz=$Qe([nae(4,Vt),nae(5,Ot)],Dz);class HQe extends fe{constructor(e,t,n,r){super(),this.viewModel=e,this._objectPool=t,this._scrollLeft=n,this._deltaScrollVertical=r,this._templateRef=this._register(yI(this,void 0)),this.contentHeight=Yt(this,o=>{var s,a,l;return(l=(a=(s=this._templateRef.read(o))===null||s===void 0?void 0:s.object.contentHeight)===null||a===void 0?void 0:a.read(o))!==null&&l!==void 0?l:this.viewModel.lastTemplateData.read(o).contentHeight}),this.maxScroll=Yt(this,o=>{var s,a;return(a=(s=this._templateRef.read(o))===null||s===void 0?void 0:s.object.maxScroll.read(o))!==null&&a!==void 0?a:{maxScroll:0,scrollWidth:0}}),this.template=Yt(this,o=>{var s;return(s=this._templateRef.read(o))===null||s===void 0?void 0:s.object}),this._isHidden=Hn(this,!1),this._register(bn(o=>{var s;const a=this._scrollLeft.read(o);(s=this._templateRef.read(o))===null||s===void 0||s.object.setScrollLeft(a)})),this._register(bn(o=>{const s=this._templateRef.read(o);!s||!this._isHidden.read(o)||s.object.isFocused.read(o)||this._clear()}))}dispose(){this._clear(),super.dispose()}toString(){var e;return`VirtualViewItem(${(e=this.viewModel.entry.value.modified)===null||e===void 0?void 0:e.uri.toString()})`}getKey(){return this.viewModel.getKey()}setViewState(e,t){var n;this.viewModel.collapsed.set(e.collapsed,t),this._updateTemplateData(t);const r=this.viewModel.lastTemplateData.get(),o=(n=e.selections)===null||n===void 0?void 0:n.map(yt.liftSelection);this.viewModel.lastTemplateData.set({...r,selections:o},t);const s=this._templateRef.get();s&&o&&s.object.editor.setSelections(o)}_updateTemplateData(e){var t;const n=this._templateRef.get();n&&this.viewModel.lastTemplateData.set({contentHeight:n.object.contentHeight.get(),selections:(t=n.object.editor.getSelections())!==null&&t!==void 0?t:void 0},e)}_clear(){const e=this._templateRef.get();e&&Ri(t=>{this._updateTemplateData(t),e.object.hide(),this._templateRef.set(void 0,t)})}hide(){this._isHidden.set(!0,void 0)}render(e,t,n,r){this._isHidden.set(!1,void 0);let o=this._templateRef.get();if(!o){o=this._objectPool.getUnusedObj(new BQe(this.viewModel,this._deltaScrollVertical)),this._templateRef.set(o,void 0);const s=this.viewModel.lastTemplateData.get().selections;s&&o.object.editor.setSelections(s)}o.object.render(e,n,t,r)}}X("multiDiffEditor.headerBackground",{dark:"#262626",light:"tab.inactiveBackground",hcDark:"tab.inactiveBackground",hcLight:"tab.inactiveBackground"},w("multiDiffEditor.headerBackground","The background color of the diff editor's header"));X("multiDiffEditor.background",{dark:"editorBackground",light:"editorBackground",hcDark:"editorBackground",hcLight:"editorBackground"},w("multiDiffEditor.background","The background color of the multi file diff editor"));X("multiDiffEditor.border",{dark:"sideBarSectionHeader.border",light:"#cccccc",hcDark:"sideBarSectionHeader.border",hcLight:"#cccccc"},w("multiDiffEditor.border","The border color of the multi file diff editor"));var VQe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},zQe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Iz=class extends fe{constructor(e,t,n){super(),this._element=e,this._workbenchUIElementFactory=t,this._instantiationService=n,this._dimension=Hn(this,void 0),this._viewModel=Hn(this,void 0),this._widgetImpl=OS(this,(r,o)=>(sf(lO,r),o.add(this._instantiationService.createInstance(sf(Dz,r),this._element,this._dimension,this._viewModel,this._workbenchUIElementFactory)))),this._register(oT(this._widgetImpl))}};Iz=VQe([zQe(2,Ot)],Iz);function UQe(i,e,t){return Ht.initialize(t||{}).createInstance(xz,i,e)}function jQe(i){return Ht.get(Un).onCodeEditorAdd(t=>{i(t)})}function KQe(i){return Ht.get(Un).onDiffEditorAdd(t=>{i(t)})}function GQe(){return Ht.get(Un).listCodeEditors()}function qQe(){return Ht.get(Un).listDiffEditors()}function XQe(i,e,t){return Ht.initialize(t||{}).createInstance(Lz,i,e)}function YQe(i,e){const t=Ht.initialize(e||{});return new Iz(i,{},t)}function ZQe(i){if(typeof i.id!="string"||typeof i.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return Dn.registerCommand(i.id,i.run)}function QQe(i){if(typeof i.id!="string"||typeof i.label!="string"||typeof i.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=De.deserialize(i.precondition),t=(r,...o)=>Vo.runEditorCommand(r,o,e,(s,a,l)=>Promise.resolve(i.run(a,...l))),n=new Te;if(n.add(Dn.registerCommand(i.id,t)),i.contextMenuGroupId){const r={command:{id:i.id,title:i.label},when:e,group:i.contextMenuGroupId,order:i.contextMenuOrder||0};n.add(ts.appendMenuItem($.EditorContext,r))}if(Array.isArray(i.keybindings)){const r=Ht.get(ci);if(!(r instanceof qw))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const o=De.and(e,De.deserialize(i.keybindingContext));n.add(r.addDynamicKeybindings(i.keybindings.map(s=>({keybinding:s,command:i.id,when:o}))))}}return n}function JQe(i){return Y0e([i])}function Y0e(i){const e=Ht.get(ci);return e instanceof qw?e.addDynamicKeybindings(i.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:De.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),fe.None)}function eJe(i,e,t){const n=Ht.get(ji),r=n.getLanguageIdByMimeType(e)||e;return q0e(Ht.get(tr),n,i,r,t)}function tJe(i,e){const t=Ht.get(ji),n=t.getLanguageIdByMimeType(e)||e||hc;i.setLanguage(t.createById(n))}function nJe(i,e,t){i&&Ht.get(ig).changeOne(e,i.uri,t)}function iJe(i){Ht.get(ig).changeAll(i,[])}function rJe(i){return Ht.get(ig).read(i)}function oJe(i){return Ht.get(ig).onMarkerChanged(i)}function sJe(i){return Ht.get(tr).getModel(i)}function aJe(){return Ht.get(tr).getModels()}function lJe(i){return Ht.get(tr).onModelAdded(i)}function cJe(i){return Ht.get(tr).onModelRemoved(i)}function uJe(i){return Ht.get(tr).onModelLanguageChanged(t=>{i({model:t.model,oldLanguage:t.oldLanguageId})})}function dJe(i){return K9e(Ht.get(tr),Ht.get(Di),i)}function hJe(i,e){const t=Ht.get(ji),n=Ht.get(Sc);return Kq.colorizeElement(n,t,i,e).then(()=>{n.registerEditorContainer(i)})}function fJe(i,e,t){const n=Ht.get(ji);return Ht.get(Sc).registerEditorContainer(hi.document.body),Kq.colorize(n,i,e,t)}function gJe(i,e,t=4){return Ht.get(Sc).registerEditorContainer(hi.document.body),Kq.colorizeModelLine(i,e,t)}function pJe(i){const e=hr.get(i);return e||{getInitialState:()=>Nw,tokenize:(t,n,r)=>zq(i,r)}}function mJe(i,e){hr.getOrCreate(e);const t=pJe(e),n=Jf(i),r=[];let o=t.getInitialState();for(let s=0,a=n.length;s{var o;if(!n)return null;const s=(o=t.options)===null||o===void 0?void 0:o.selection;let a;return s&&typeof s.endLineNumber=="number"&&typeof s.endColumn=="number"?a=s:s&&(a={lineNumber:s.startLineNumber,column:s.startColumn}),await i.openCodeEditor(n,t.resource,a)?n:null})}function SJe(){return{create:UQe,getEditors:GQe,getDiffEditors:qQe,onDidCreateEditor:jQe,onDidCreateDiffEditor:KQe,createDiffEditor:XQe,addCommand:ZQe,addEditorAction:QQe,addKeybindingRule:JQe,addKeybindingRules:Y0e,createModel:eJe,setModelLanguage:tJe,setModelMarkers:nJe,getModelMarkers:rJe,removeAllMarkers:iJe,onDidChangeMarkers:oJe,getModels:aJe,getModel:sJe,onDidCreateModel:lJe,onWillDisposeModel:cJe,onDidChangeModelLanguage:uJe,createWebWorker:dJe,colorizeElement:hJe,colorize:fJe,colorizeModelLine:gJe,tokenize:mJe,defineTheme:vJe,setTheme:_Je,remeasureFonts:bJe,registerCommand:CJe,registerLinkOpener:yJe,registerEditorOpener:wJe,AccessibilitySupport:d$,ContentWidgetPositionPreference:v$,CursorChangeReason:_$,DefaultEndOfLine:b$,EditorAutoIndentStrategy:y$,EditorOption:w$,EndOfLinePreference:S$,EndOfLineSequence:x$,MinimapPosition:A$,MouseTargetType:P$,OverlayWidgetPositionPreference:F$,OverviewRulerLane:B$,GlyphMarginLane:L$,RenderLineNumbersType:$$,RenderMinimap:H$,ScrollbarVisibility:z$,ScrollType:V$,TextEditorCursorBlinkingStyle:X$,TextEditorCursorStyle:Y$,TrackedRangeStickiness:Z$,WrappingIndent:Q$,InjectedTextCursorStops:D$,PositionAffinity:W$,ShowLightbulbIconMode:j$,ConfigurationChangedEvent:ppe,BareFontInfo:nb,FontInfo:lH,TextModelResolvedOptions:fM,FindMatch:ND,ApplyUpdateResult:aE,EditorZoom:zc,createMultiFileDiffEditor:YQe,EditorType:Ok,EditorOptions:yh}}function xJe(i,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!i(t))return!1;return!0}function jR(i,e){return typeof i=="boolean"?i:e}function iae(i,e){return typeof i=="string"?i:e}function LJe(i){const e={};for(const t of i)e[t]=!0;return e}function rae(i,e=!1){e&&(i=i.map(function(n){return n.toLowerCase()}));const t=LJe(i);return e?function(n){return t[n.toLowerCase()]!==void 0&&t.hasOwnProperty(n.toLowerCase())}:function(n){return t[n]!==void 0&&t.hasOwnProperty(n)}}function kz(i,e){e=e.replace(/@@/g,"");let t=0,n;do n=!1,e=e.replace(/@(\w+)/g,function(o,s){n=!0;let a="";if(typeof i[s]=="string")a=i[s];else if(i[s]&&i[s]instanceof RegExp)a=i[s].source;else throw i[s]===void 0?Hi(i,"language definition does not contain attribute '"+s+"', used at: "+e):Hi(i,"attribute reference '"+s+"' must be a string, used at: "+e);return D1(a)?"":"(?:"+a+")"}),t++;while(n&&t<5);e=e.replace(/\x01/g,"@");const r=(i.ignoreCase?"i":"")+(i.unicode?"u":"");return new RegExp(e,r)}function EJe(i,e,t,n){if(n<0)return i;if(n=100){n=n-100;const r=t.split(".");if(r.unshift(t),n=0&&(n.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")n.bracket=1;else if(t.bracket==="@close")n.bracket=-1;else throw Hi(i,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw Hi(i,"the next state must be a string value in rule: "+e);{let r=t.next;if(!/^(@pop|@push|@popall)$/.test(r)&&(r[0]==="@"&&(r=r.substr(1)),r.indexOf("$")<0&&!d7e(i,Am(i,r,"",[],""))))throw Hi(i,"the next state '"+t.next+"' is not defined in rule: "+e);n.next=r}}return typeof t.goBack=="number"&&(n.goBack=t.goBack),typeof t.switchTo=="string"&&(n.switchTo=t.switchTo),typeof t.log=="string"&&(n.log=t.log),typeof t.nextEmbedded=="string"&&(n.nextEmbedded=t.nextEmbedded,i.usesEmbedded=!0),n}}else if(Array.isArray(t)){const n=[];for(let r=0,o=t.length;r0&&n[0]==="^",this.name=this.name+": "+n,this.regex=kz(e,"^(?:"+(this.matchOnlyAtLineStart?n.substr(1):n)+")")}setAction(e,t){this.action=Tz(e,this.name,t)}}function Z0e(i,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={};t.languageId=i,t.includeLF=jR(e.includeLF,!1),t.noThrow=!1,t.maxStack=100,t.start=typeof e.start=="string"?e.start:null,t.ignoreCase=jR(e.ignoreCase,!1),t.unicode=jR(e.unicode,!1),t.tokenPostfix=iae(e.tokenPostfix,"."+t.languageId),t.defaultToken=iae(e.defaultToken,"source"),t.usesEmbedded=!1;const n=e;n.languageId=i,n.includeLF=t.includeLF,n.ignoreCase=t.ignoreCase,n.unicode=t.unicode,n.noThrow=t.noThrow,n.usesEmbedded=t.usesEmbedded,n.stateNames=e.tokenizer,n.defaultToken=t.defaultToken;function r(s,a,l){for(const c of l){let u=c.include;if(u){if(typeof u!="string")throw Hi(t,"an 'include' attribute must be a string at: "+s);if(u[0]==="@"&&(u=u.substr(1)),!e.tokenizer[u])throw Hi(t,"include target '"+u+"' is not defined at: "+s);r(s+"."+u,a,e.tokenizer[u])}else{const d=new IJe(s);if(Array.isArray(c)&&c.length>=1&&c.length<=3)if(d.setRegex(n,c[0]),c.length>=3)if(typeof c[1]=="string")d.setAction(n,{token:c[1],next:c[2]});else if(typeof c[1]=="object"){const h=c[1];h.next=c[2],d.setAction(n,h)}else throw Hi(t,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+s);else d.setAction(n,c[1]);else{if(!c.regex)throw Hi(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+s);c.name&&typeof c.name=="string"&&(d.name=c.name),c.matchOnlyAtStart&&(d.matchOnlyAtLineStart=jR(c.matchOnlyAtLineStart,!1)),d.setRegex(n,c.regex),d.setAction(n,c.action)}a.push(d)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw Hi(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(const s in e.tokenizer)if(e.tokenizer.hasOwnProperty(s)){t.start||(t.start=s);const a=e.tokenizer[s];t.tokenizer[s]=new Array,r("tokenizer."+s,t.tokenizer[s],a)}if(t.usesEmbedded=n.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw Hi(t,"the 'brackets' attribute must be defined as an array")}else e.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const o=[];for(const s of e.brackets){let a=s;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw Hi(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+` + hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")o.push({token:a.token+t.tokenPostfix,open:yv(t,a.open),close:yv(t,a.close)});else throw Hi(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=o,t.noThrow=!0,t}function kJe(i){Iw.registerLanguage(i)}function TJe(){let i=[];return i=i.concat(Iw.getLanguages()),i}function NJe(i){return Ht.get(ji).languageIdCodec.encodeLanguageId(i)}function RJe(i,e){return Ht.withServices(()=>{const n=Ht.get(ji).onDidRequestRichLanguageFeatures(r=>{r===i&&(n.dispose(),e())});return n})}function MJe(i,e){return Ht.withServices(()=>{const n=Ht.get(ji).onDidRequestBasicLanguageFeatures(r=>{r===i&&(n.dispose(),e())});return n})}function AJe(i,e){if(!Ht.get(ji).isRegisteredLanguageId(i))throw new Error(`Cannot set configuration for unknown language ${i}`);return Ht.get(Di).register(i,e,100)}class PJe{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,n){if(typeof this._actual.tokenize=="function")return EI.adaptTokenize(this._languageId,this._actual,e,n);throw new Error("Not supported!")}tokenizeEncoded(e,t,n){const r=this._actual.tokenizeEncoded(e,n);return new s4(r.tokens,r.endState)}}class EI{constructor(e,t,n,r){this._languageId=e,this._actual=t,this._languageService=n,this._standaloneThemeService=r}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const n=[];let r=0;for(let o=0,s=e.length;o0&&o[s-1]===h)continue;let f=d.startIndex;c===0?f=0:f{const n=await Promise.resolve(e.create());return n?OJe(n)?J0e(i,n):new BD(Ht.get(ji),Ht.get(Sc),i,Z0e(i,n),Ht.get(gn)):null});return hr.registerFactory(i,t)}function WJe(i,e){if(!Ht.get(ji).isRegisteredLanguageId(i))throw new Error(`Cannot set tokens provider for unknown language ${i}`);return Q0e(e)?SY(i,{create:()=>e}):hr.register(i,J0e(i,e))}function $Je(i,e){const t=n=>new BD(Ht.get(ji),Ht.get(Sc),i,Z0e(i,n),Ht.get(gn));return Q0e(e)?SY(i,{create:()=>e}):hr.register(i,t(e))}function HJe(i,e){return Ht.get(_t).referenceProvider.register(i,e)}function VJe(i,e){return Ht.get(_t).renameProvider.register(i,e)}function zJe(i,e){return Ht.get(_t).newSymbolNamesProvider.register(i,e)}function UJe(i,e){return Ht.get(_t).signatureHelpProvider.register(i,e)}function jJe(i,e){return Ht.get(_t).hoverProvider.register(i,{provideHover:(n,r,o)=>{const s=n.getWordAtPosition(r);return Promise.resolve(e.provideHover(n,r,o)).then(a=>{if(a)return!a.range&&s&&(a.range=new B(r.lineNumber,s.startColumn,r.lineNumber,s.endColumn)),a.range||(a.range=new B(r.lineNumber,r.column,r.lineNumber,r.column)),a})}})}function KJe(i,e){return Ht.get(_t).documentSymbolProvider.register(i,e)}function GJe(i,e){return Ht.get(_t).documentHighlightProvider.register(i,e)}function qJe(i,e){return Ht.get(_t).linkedEditingRangeProvider.register(i,e)}function XJe(i,e){return Ht.get(_t).definitionProvider.register(i,e)}function YJe(i,e){return Ht.get(_t).implementationProvider.register(i,e)}function ZJe(i,e){return Ht.get(_t).typeDefinitionProvider.register(i,e)}function QJe(i,e){return Ht.get(_t).codeLensProvider.register(i,e)}function JJe(i,e,t){return Ht.get(_t).codeActionProvider.register(i,{providedCodeActionKinds:t==null?void 0:t.providedCodeActionKinds,documentation:t==null?void 0:t.documentation,provideCodeActions:(r,o,s,a)=>{const c=Ht.get(ig).read({resource:r.uri}).filter(u=>B.areIntersectingOrTouching(u,o));return e.provideCodeActions(r,o,{markers:c,only:s.only,trigger:s.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function eet(i,e){return Ht.get(_t).documentFormattingEditProvider.register(i,e)}function tet(i,e){return Ht.get(_t).documentRangeFormattingEditProvider.register(i,e)}function net(i,e){return Ht.get(_t).onTypeFormattingEditProvider.register(i,e)}function iet(i,e){return Ht.get(_t).linkProvider.register(i,e)}function ret(i,e){return Ht.get(_t).completionProvider.register(i,e)}function oet(i,e){return Ht.get(_t).colorProvider.register(i,e)}function set(i,e){return Ht.get(_t).foldingRangeProvider.register(i,e)}function aet(i,e){return Ht.get(_t).declarationProvider.register(i,e)}function cet(i,e){return Ht.get(_t).selectionRangeProvider.register(i,e)}function uet(i,e){return Ht.get(_t).documentSemanticTokensProvider.register(i,e)}function det(i,e){return Ht.get(_t).documentRangeSemanticTokensProvider.register(i,e)}function het(i,e){return Ht.get(_t).inlineCompletionsProvider.register(i,e)}function fet(i,e){return Ht.get(_t).inlineEditProvider.register(i,e)}function get(i,e){return Ht.get(_t).inlayHintsProvider.register(i,e)}function pet(){return{register:kJe,getLanguages:TJe,onLanguage:RJe,onLanguageEncountered:MJe,getEncodedLanguageId:NJe,setLanguageConfiguration:AJe,setColorMap:BJe,registerTokensProviderFactory:SY,setTokensProvider:WJe,setMonarchTokensProvider:$Je,registerReferenceProvider:HJe,registerRenameProvider:VJe,registerNewSymbolNameProvider:zJe,registerCompletionItemProvider:ret,registerSignatureHelpProvider:UJe,registerHoverProvider:jJe,registerDocumentSymbolProvider:KJe,registerDocumentHighlightProvider:GJe,registerLinkedEditingRangeProvider:qJe,registerDefinitionProvider:XJe,registerImplementationProvider:YJe,registerTypeDefinitionProvider:ZJe,registerCodeLensProvider:QJe,registerCodeActionProvider:JJe,registerDocumentFormattingEditProvider:eet,registerDocumentRangeFormattingEditProvider:tet,registerOnTypeFormattingEditProvider:net,registerLinkProvider:iet,registerColorProvider:oet,registerFoldingRangeProvider:set,registerDeclarationProvider:aet,registerSelectionRangeProvider:cet,registerDocumentSemanticTokensProvider:uet,registerDocumentRangeSemanticTokensProvider:det,registerInlineCompletionsProvider:het,registerInlineEditProvider:fet,registerInlayHintsProvider:get,DocumentHighlightKind:C$,CompletionItemKind:g$,CompletionItemTag:p$,CompletionItemInsertTextRule:f$,SymbolKind:G$,SymbolTag:q$,IndentAction:E$,CompletionTriggerKind:m$,SignatureHelpTriggerKind:K$,InlayHintKind:I$,InlineCompletionTriggerKind:k$,InlineEditTriggerKind:T$,CodeActionTriggerType:h$,NewSymbolNameTag:O$,FoldingRangeKind:ba,SelectedSuggestionInfo:Tpe}}const xY=yn("IEditorCancelService"),ebe=new st("cancellableOperation",!1,w("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));In(xY,class{constructor(){this._tokens=new WeakMap}add(i,e){let t=this._tokens.get(i);t||(t=i.invokeWithinContext(r=>{const o=ebe.bindTo(r.get(Vt)),s=new _a;return{key:o,tokens:s}}),this._tokens.set(i,t));let n;return t.key.set(!0),n=t.tokens.push(e),()=>{n&&(n(),t.key.set(!t.tokens.isEmpty()),n=void 0)}}cancel(i){const e=this._tokens.get(i);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},1);class met extends wr{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(n=>n.get(xY).add(e,this))}dispose(){this._unregister(),super.dispose()}}et(new class extends Vo{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:ebe})}runEditorCommand(i,e){i.get(xY).cancel(e)}});let tbe=class Nz{constructor(e,t){if(this.flags=t,this.flags&1){const n=e.getModel();this.modelVersionId=n?Eb("{0}#{1}",n.uri.toString(),n.getVersionId()):null}else this.modelVersionId=null;this.flags&4?this.position=e.getPosition():this.position=null,this.flags&2?this.selection=e.getSelection():this.selection=null,this.flags&8?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof Nz))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 Nz(e,this.flags))}};class n_ extends met{constructor(e,t,n,r){super(e,r),this._listener=new Te,t&4&&this._listener.add(e.onDidChangeCursorPosition(o=>{(!n||!B.containsPosition(n,o.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(o=>{(!n||!B.containsRange(n,o.selection))&&this.cancel()})),t&8&&this._listener.add(e.onDidScrollChange(o=>this.cancel())),t&1&&(this._listener.add(e.onDidChangeModel(o=>this.cancel())),this._listener.add(e.onDidChangeModelContent(o=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class LY extends wr{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}function qf(i){return i&&typeof i.getEditorType=="function"?i.getEditorType()===Ok.ICodeEditor:!1}function EY(i){return i&&typeof i.getEditorType=="function"?i.getEditorType()===Ok.IDiffEditor:!1}function vet(i){return!!i&&typeof i=="object"&&typeof i.onDidChangeActiveEditor=="function"}function nbe(i){return qf(i)?i:EY(i)?i.getModifiedEditor():vet(i)&&qf(i.activeCodeEditor)?i.activeCodeEditor:null}class Zw{static _handleEolEdits(e,t){let n;const r=[];for(const o of t)typeof o.eol=="number"&&(n=o.eol),o.range&&typeof o.text=="string"&&r.push(o);return typeof n=="number"&&e.hasModel()&&e.getModel().pushEOL(n),r}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const n=e.getModel(),r=n.validateRange(t.range);return n.getFullModelRange().equalsRange(r)}static execute(e,t,n){n&&e.pushUndoStop();const r=_h.capture(e),o=Zw._handleEolEdits(e,t);o.length===1&&Zw._isFullModelReplaceEdit(e,o[0])?e.executeEdits("formatEditsCommand",o.map(s=>Xi.replace(B.lift(s.range),s.text))):e.executeEdits("formatEditsCommand",o.map(s=>Xi.replaceMove(B.lift(s.range),s.text))),n&&e.pushUndoStop(),r.restoreRelativeVerticalPositionOfCursor(e)}}class oae{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class _et{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(oae.toKey(e))}has(e){return this._set.has(oae.toKey(e))}}function ibe(i,e,t){const n=[],r=new _et,o=i.ordered(t);for(const a of o)n.push(a),a.extensionId&&r.add(a.extensionId);const s=e.ordered(t);for(const a of s){if(a.extensionId){if(r.has(a.extensionId))continue;r.add(a.extensionId)}n.push({displayName:a.displayName,extensionId:a.extensionId,provideDocumentFormattingEdits(l,c,u){return a.provideDocumentRangeFormattingEdits(l,l.getFullModelRange(),c,u)}})}return n}class $b{static setFormatterSelector(e){return{dispose:$b._selectors.unshift(e)}}static async select(e,t,n,r){if(e.length===0)return;const o=En.first($b._selectors);if(o)return await o(e,t,n,r)}}$b._selectors=new _a;async function rbe(i,e,t,n,r,o,s){const a=i.get(Ot),{documentRangeFormattingEditProvider:l}=i.get(_t),c=qf(e)?e.getModel():e,u=l.ordered(c),d=await $b.select(u,c,n,2);d&&(r.report(d),await a.invokeFunction(bet,d,e,t,o,s))}async function bet(i,e,t,n,r,o){var s,a;const l=i.get(hd),c=i.get(Ta),u=i.get(R_);let d,h;qf(t)?(d=t.getModel(),h=new n_(t,5,void 0,r)):(d=t,h=new LY(t,r));const f=[];let g=0;for(const y of eq(n).sort(B.compareRangesUsingStarts))g>0&&B.areIntersectingOrTouching(f[g-1],y)?f[g-1]=B.fromPositions(f[g-1].getStartPosition(),y.getEndPosition()):g=f.push(y);const p=async y=>{var S,L;c.trace("[format][provideDocumentRangeFormattingEdits] (request)",(S=e.extensionId)===null||S===void 0?void 0:S.value,y);const E=await e.provideDocumentRangeFormattingEdits(d,y,d.getFormattingOptions(),h.token)||[];return c.trace("[format][provideDocumentRangeFormattingEdits] (response)",(L=e.extensionId)===null||L===void 0?void 0:L.value,E),E},v=(y,S)=>{if(!y.length||!S.length)return!1;const L=y.reduce((E,D)=>B.plusRange(E,D.range),y[0].range);if(!S.some(E=>B.intersectRanges(L,E.range)))return!1;for(const E of y)for(const D of S)if(B.intersectRanges(E.range,D.range))return!0;return!1},m=[],_=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){c.trace("[format][provideDocumentRangeFormattingEdits] (request)",(s=e.extensionId)===null||s===void 0?void 0:s.value,f);const y=await e.provideDocumentRangesFormattingEdits(d,f,d.getFormattingOptions(),h.token)||[];c.trace("[format][provideDocumentRangeFormattingEdits] (response)",(a=e.extensionId)===null||a===void 0?void 0:a.value,y),_.push(y)}else{for(const y of f){if(h.token.isCancellationRequested)return!0;_.push(await p(y))}for(let y=0;y({text:L.text,range:B.lift(L.range),forceMoveMarkers:!0})),L=>{for(const{range:E}of L)if(B.areIntersectingOrTouching(E,S))return[new yt(E.startLineNumber,E.startColumn,E.endLineNumber,E.endColumn)];return null})}return u.playSignal(cn.format,{userGesture:o}),!0}async function Cet(i,e,t,n,r,o){const s=i.get(Ot),a=i.get(_t),l=qf(e)?e.getModel():e,c=ibe(a.documentFormattingEditProvider,a.documentRangeFormattingEditProvider,l),u=await $b.select(c,l,t,1);u&&(n.report(u),await s.invokeFunction(yet,u,e,t,r,o))}async function yet(i,e,t,n,r,o){const s=i.get(hd),a=i.get(R_);let l,c;qf(t)?(l=t.getModel(),c=new n_(t,5,void 0,r)):(l=t,c=new LY(t,r));let u;try{const d=await e.provideDocumentFormattingEdits(l,l.getFormattingOptions(),c.token);if(u=await s.computeMoreMinimalEdits(l.uri,d),c.token.isCancellationRequested)return!0}finally{c.dispose()}if(!u||u.length===0)return!1;if(qf(t))Zw.execute(t,u,n!==2),n!==2&&t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:d}]=u,h=new yt(d.startLineNumber,d.startColumn,d.endLineNumber,d.endColumn);l.pushEditOperations([h],u.map(f=>({text:f.text,range:B.lift(f.range),forceMoveMarkers:!0})),f=>{for(const{range:g}of f)if(B.areIntersectingOrTouching(g,h))return[new yt(g.startLineNumber,g.startColumn,g.endLineNumber,g.endColumn)];return null})}return a.playSignal(cn.format,{userGesture:o}),!0}async function wet(i,e,t,n,r,o){const s=e.documentRangeFormattingEditProvider.ordered(t);for(const a of s){const l=await Promise.resolve(a.provideDocumentRangeFormattingEdits(t,n,r,o)).catch(Zr);if(Ts(l))return await i.computeMoreMinimalEdits(t.uri,l)}}async function xet(i,e,t,n,r){const o=ibe(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const s of o){const a=await Promise.resolve(s.provideDocumentFormattingEdits(t,n,r)).catch(Zr);if(Ts(a))return await i.computeMoreMinimalEdits(t.uri,a)}}function obe(i,e,t,n,r,o,s){const a=e.onTypeFormattingEditProvider.ordered(t);return a.length===0||a[0].autoFormatTriggerCharacters.indexOf(r)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(t,n,r,o,s)).catch(Zr).then(l=>i.computeMoreMinimalEdits(t.uri,l))}Dn.registerCommand("_executeFormatRangeProvider",async function(i,...e){const[t,n,r]=e;Xn(At.isUri(t)),Xn(B.isIRange(n));const o=i.get(ol),s=i.get(hd),a=i.get(_t),l=await o.createModelReference(t);try{return wet(s,a,l.object.textEditorModel,B.lift(n),r,Cn.None)}finally{l.dispose()}});Dn.registerCommand("_executeFormatDocumentProvider",async function(i,...e){const[t,n]=e;Xn(At.isUri(t));const r=i.get(ol),o=i.get(hd),s=i.get(_t),a=await r.createModelReference(t);try{return xet(o,s,a.object.textEditorModel,n,Cn.None)}finally{a.dispose()}});Dn.registerCommand("_executeFormatOnTypeProvider",async function(i,...e){const[t,n,r,o]=e;Xn(At.isUri(t)),Xn(ae.isIPosition(n)),Xn(typeof r=="string");const s=i.get(ol),a=i.get(hd),l=i.get(_t),c=await s.createModelReference(t);try{return obe(a,l,c.object.textEditorModel,ae.lift(n),r,o,Cn.None)}finally{c.dispose()}});yh.wrappingIndent.defaultValue=0;yh.glyphMargin.defaultValue=!1;yh.autoIndent.defaultValue=3;yh.overviewRulerLanes.defaultValue=2;$b.setFormatterSelector((i,e,t)=>Promise.resolve(i[0]));const Ra=Npe();Ra.editor=SJe();Ra.languages=pet();const sbe=Ra.CancellationTokenSource,DY=Ra.Emitter,abe=Ra.KeyCode,lbe=Ra.KeyMod,cbe=Ra.Position,ube=Ra.Range,dbe=Ra.Selection,hbe=Ra.SelectionDirection,fbe=Ra.MarkerSeverity,gbe=Ra.MarkerTag,pbe=Ra.Uri,mbe=Ra.Token,vbe=Ra.editor,sT=Ra.languages,C9=globalThis.MonacoEnvironment;(C9!=null&&C9.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=Ra);typeof globalThis.require<"u"&&typeof globalThis.require.config=="function"&&globalThis.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]});const w3=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:sbe,Emitter:DY,KeyCode:abe,KeyMod:lbe,MarkerSeverity:fbe,MarkerTag:gbe,Position:cbe,Range:ube,Selection:dbe,SelectionDirection:hbe,Token:mbe,Uri:pbe,editor:vbe,languages:sT},Symbol.toStringTag,{value:"Module"})),Let="modulepreload",Eet=function(i){return"/ir-virtual-machine/"+i},sae={},Dt=function(e,t,n){if(!t||t.length===0)return e();const r=document.getElementsByTagName("link");return Promise.all(t.map(o=>{if(o=Eet(o),o in sae)return;sae[o]=!0;const s=o.endsWith(".css"),a=s?'[rel="stylesheet"]':"";if(!!n)for(let u=r.length-1;u>=0;u--){const d=r[u];if(d.href===o&&(!s||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${a}`))return;const c=document.createElement("link");if(c.rel=s?"stylesheet":Let,s||(c.as="script",c.crossOrigin=""),c.href=o,document.head.appendChild(c),s)return new Promise((u,d)=>{c.addEventListener("load",u),c.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>e())};/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var Det=Object.defineProperty,Iet=Object.getOwnPropertyDescriptor,ket=Object.getOwnPropertyNames,Tet=Object.prototype.hasOwnProperty,aae=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ket(e))!Tet.call(i,r)&&r!==t&&Det(i,r,{get:()=>e[r],enumerable:!(n=Iet(e,r))||n.enumerable});return i},Net=(i,e,t)=>(aae(i,e,"default"),t&&aae(t,e,"default")),BL={};Net(BL,w3);var _be={},y9={},Ret=class bbe{static getOrCreate(e){return y9[e]||(y9[e]=new bbe(e)),y9[e]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((t,n)=>{this._lazyLoadPromiseResolve=t,this._lazyLoadPromiseReject=n})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,_be[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}};function kt(i){const e=i.id;_be[e]=i,BL.languages.register(i);const t=Ret.getOrCreate(e);BL.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),BL.languages.onLanguageEncountered(e,async()=>{const n=await t.load();BL.languages.setLanguageConfiguration(e,n.conf)})}kt({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>Dt(()=>import("./abap-ad6e811d.js"),[])});kt({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>Dt(()=>import("./apex-992ba105.js"),[])});kt({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>Dt(()=>import("./azcli-2ae42e71.js"),[])});kt({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>Dt(()=>import("./bat-638cac0f.js"),[])});kt({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>Dt(()=>import("./bicep-389290ac.js"),[])});kt({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>Dt(()=>import("./cameligo-e2b87a47.js"),[])});kt({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>Dt(()=>import("./clojure-9f651a27.js"),[])});kt({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>Dt(()=>import("./coffee-4e075114.js"),[])});kt({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>Dt(()=>import("./cpp-8ffe77ae.js"),[])});kt({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>Dt(()=>import("./cpp-8ffe77ae.js"),[])});kt({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>Dt(()=>import("./csharp-0b267c6b.js"),[])});kt({id:"csp",extensions:[],aliases:["CSP","csp"],loader:()=>Dt(()=>import("./csp-c23415e1.js"),[])});kt({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>Dt(()=>import("./css-c62f5578.js"),[])});kt({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>Dt(()=>import("./cypher-16871f29.js"),[])});kt({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>Dt(()=>import("./dart-20618e99.js"),[])});kt({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>Dt(()=>import("./dockerfile-13942c6d.js"),[])});kt({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>Dt(()=>import("./ecl-82a13cc7.js"),[])});kt({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>Dt(()=>import("./elixir-941d33da.js"),[])});kt({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>Dt(()=>import("./flow9-82e25a0d.js"),[])});kt({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>Dt(()=>import("./fsharp-930eb6d7.js"),[])});kt({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>Dt(()=>import("./freemarker2-64c2a106.js"),[]).then(i=>i.TagAutoInterpolationDollar)});kt({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>Dt(()=>import("./freemarker2-64c2a106.js"),[]).then(i=>i.TagAngleInterpolationDollar)});kt({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>Dt(()=>import("./freemarker2-64c2a106.js"),[]).then(i=>i.TagBracketInterpolationDollar)});kt({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>Dt(()=>import("./freemarker2-64c2a106.js"),[]).then(i=>i.TagAngleInterpolationBracket)});kt({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>Dt(()=>import("./freemarker2-64c2a106.js"),[]).then(i=>i.TagBracketInterpolationBracket)});kt({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>Dt(()=>import("./freemarker2-64c2a106.js"),[]).then(i=>i.TagAutoInterpolationDollar)});kt({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>Dt(()=>import("./freemarker2-64c2a106.js"),[]).then(i=>i.TagAutoInterpolationBracket)});kt({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>Dt(()=>import("./go-ace823b2.js"),[])});kt({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>Dt(()=>import("./graphql-9395e6dd.js"),[])});kt({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>Dt(()=>import("./handlebars-37d070d1.js"),[])});kt({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>Dt(()=>import("./hcl-4160620f.js"),[])});kt({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:()=>Dt(()=>import("./html-7ea466f3.js"),[])});kt({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>Dt(()=>import("./ini-1cc2fa96.js"),[])});kt({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>Dt(()=>import("./java-fe979474.js"),[])});kt({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>Dt(()=>import("./javascript-4363171e.js"),["assets/javascript-4363171e.js","assets/typescript-8089b405.js"])});kt({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>Dt(()=>import("./julia-1a2d9387.js"),[])});kt({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>Dt(()=>import("./kotlin-45b3a4f3.js"),[])});kt({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>Dt(()=>import("./less-a184ed1c.js"),[])});kt({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>Dt(()=>import("./lexon-ebf376fd.js"),[])});kt({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>Dt(()=>import("./lua-666d20d5.js"),[])});kt({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>Dt(()=>import("./liquid-87315f86.js"),[])});kt({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>Dt(()=>import("./m3-bbbbbca9.js"),[])});kt({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>Dt(()=>import("./markdown-5de2301d.js"),[])});kt({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>Dt(()=>import("./mdx-0ce00991.js"),[])});kt({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>Dt(()=>import("./mips-7b46d093.js"),[])});kt({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>Dt(()=>import("./msdax-295c0d3c.js"),[])});kt({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>Dt(()=>import("./mysql-28fc43b5.js"),[])});kt({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>Dt(()=>import("./objective-c-5f7f7623.js"),[])});kt({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>Dt(()=>import("./pascal-830d8a16.js"),[])});kt({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>Dt(()=>import("./pascaligo-ff6a611d.js"),[])});kt({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>Dt(()=>import("./perl-0c4cf450.js"),[])});kt({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>Dt(()=>import("./pgsql-85eb1e14.js"),[])});kt({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>Dt(()=>import("./php-571f6521.js"),[])});kt({id:"pla",extensions:[".pla"],loader:()=>Dt(()=>import("./pla-5e6cd4d5.js"),[])});kt({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>Dt(()=>import("./postiats-4d02d044.js"),[])});kt({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>Dt(()=>import("./powerquery-c6baddff.js"),[])});kt({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>Dt(()=>import("./powershell-8bfccb2f.js"),[])});kt({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>Dt(()=>import("./protobuf-7c245adb.js"),[])});kt({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>Dt(()=>import("./pug-e0d77a81.js"),[])});kt({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>Dt(()=>import("./python-54b0304d.js"),[])});kt({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>Dt(()=>import("./qsharp-560af9ec.js"),[])});kt({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>Dt(()=>import("./r-96b98db0.js"),[])});kt({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>Dt(()=>import("./razor-93d55a7c.js"),[])});kt({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>Dt(()=>import("./redis-2313a258.js"),[])});kt({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>Dt(()=>import("./redshift-e81279f9.js"),[])});kt({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>Dt(()=>import("./restructuredtext-23e36e2c.js"),[])});kt({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>Dt(()=>import("./ruby-6e5b4752.js"),[])});kt({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>Dt(()=>import("./rust-c4e1d9a9.js"),[])});kt({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>Dt(()=>import("./sb-095651a8.js"),[])});kt({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:()=>Dt(()=>import("./scala-dfd2c035.js"),[])});kt({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>Dt(()=>import("./scheme-4bd59040.js"),[])});kt({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>Dt(()=>import("./scss-0b769ec8.js"),[])});kt({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>Dt(()=>import("./shell-5fa60225.js"),[])});kt({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>Dt(()=>import("./solidity-3efd84d4.js"),[])});kt({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>Dt(()=>import("./sophia-156a057a.js"),[])});kt({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>Dt(()=>import("./sparql-25a61c8a.js"),[])});kt({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>Dt(()=>import("./sql-ef431720.js"),[])});kt({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>Dt(()=>import("./st-06071006.js"),[])});kt({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>Dt(()=>import("./swift-941c2e3c.js"),[])});kt({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>Dt(()=>import("./systemverilog-dc0c3813.js"),[])});kt({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>Dt(()=>import("./systemverilog-dc0c3813.js"),[])});kt({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>Dt(()=>import("./tcl-cc963d5c.js"),[])});kt({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>Dt(()=>import("./twig-cdf47909.js"),[])});kt({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>Dt(()=>import("./typescript-8089b405.js"),[])});kt({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>Dt(()=>import("./vb-3ff3c116.js"),[])});kt({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>Dt(()=>import("./wgsl-7be617f0.js"),[])});kt({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\Dt(()=>import("./xml-978d1915.js"),[])});kt({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>Dt(()=>import("./yaml-74f5320e.js"),[])});/*!----------------------------------------------------------------------------- + *-----------------------------------------------------------------------------*/var Det=Object.defineProperty,Iet=Object.getOwnPropertyDescriptor,ket=Object.getOwnPropertyNames,Tet=Object.prototype.hasOwnProperty,aae=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ket(e))!Tet.call(i,r)&&r!==t&&Det(i,r,{get:()=>e[r],enumerable:!(n=Iet(e,r))||n.enumerable});return i},Net=(i,e,t)=>(aae(i,e,"default"),t&&aae(t,e,"default")),BL={};Net(BL,w3);var _be={},y9={},Ret=class bbe{static getOrCreate(e){return y9[e]||(y9[e]=new bbe(e)),y9[e]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((t,n)=>{this._lazyLoadPromiseResolve=t,this._lazyLoadPromiseReject=n})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,_be[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}};function kt(i){const e=i.id;_be[e]=i,BL.languages.register(i);const t=Ret.getOrCreate(e);BL.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),BL.languages.onLanguageEncountered(e,async()=>{const n=await t.load();BL.languages.setLanguageConfiguration(e,n.conf)})}kt({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>Dt(()=>import("./abap-ad6e811d.js"),[])});kt({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>Dt(()=>import("./apex-992ba105.js"),[])});kt({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>Dt(()=>import("./azcli-2ae42e71.js"),[])});kt({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>Dt(()=>import("./bat-638cac0f.js"),[])});kt({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>Dt(()=>import("./bicep-389290ac.js"),[])});kt({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>Dt(()=>import("./cameligo-e2b87a47.js"),[])});kt({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>Dt(()=>import("./clojure-9f651a27.js"),[])});kt({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>Dt(()=>import("./coffee-4e075114.js"),[])});kt({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>Dt(()=>import("./cpp-8ffe77ae.js"),[])});kt({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>Dt(()=>import("./cpp-8ffe77ae.js"),[])});kt({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>Dt(()=>import("./csharp-0b267c6b.js"),[])});kt({id:"csp",extensions:[],aliases:["CSP","csp"],loader:()=>Dt(()=>import("./csp-c23415e1.js"),[])});kt({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>Dt(()=>import("./css-c62f5578.js"),[])});kt({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>Dt(()=>import("./cypher-16871f29.js"),[])});kt({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>Dt(()=>import("./dart-20618e99.js"),[])});kt({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>Dt(()=>import("./dockerfile-13942c6d.js"),[])});kt({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>Dt(()=>import("./ecl-82a13cc7.js"),[])});kt({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>Dt(()=>import("./elixir-941d33da.js"),[])});kt({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>Dt(()=>import("./flow9-82e25a0d.js"),[])});kt({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>Dt(()=>import("./fsharp-930eb6d7.js"),[])});kt({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>Dt(()=>import("./freemarker2-c400ccc3.js"),[]).then(i=>i.TagAutoInterpolationDollar)});kt({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>Dt(()=>import("./freemarker2-c400ccc3.js"),[]).then(i=>i.TagAngleInterpolationDollar)});kt({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>Dt(()=>import("./freemarker2-c400ccc3.js"),[]).then(i=>i.TagBracketInterpolationDollar)});kt({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>Dt(()=>import("./freemarker2-c400ccc3.js"),[]).then(i=>i.TagAngleInterpolationBracket)});kt({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>Dt(()=>import("./freemarker2-c400ccc3.js"),[]).then(i=>i.TagBracketInterpolationBracket)});kt({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>Dt(()=>import("./freemarker2-c400ccc3.js"),[]).then(i=>i.TagAutoInterpolationDollar)});kt({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>Dt(()=>import("./freemarker2-c400ccc3.js"),[]).then(i=>i.TagAutoInterpolationBracket)});kt({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>Dt(()=>import("./go-ace823b2.js"),[])});kt({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>Dt(()=>import("./graphql-9395e6dd.js"),[])});kt({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>Dt(()=>import("./handlebars-c10cb1ca.js"),[])});kt({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>Dt(()=>import("./hcl-4160620f.js"),[])});kt({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:()=>Dt(()=>import("./html-83ec7cfd.js"),[])});kt({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>Dt(()=>import("./ini-1cc2fa96.js"),[])});kt({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>Dt(()=>import("./java-fe979474.js"),[])});kt({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>Dt(()=>import("./javascript-608a8482.js"),["assets/javascript-608a8482.js","assets/typescript-4b89e88c.js"])});kt({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>Dt(()=>import("./julia-1a2d9387.js"),[])});kt({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>Dt(()=>import("./kotlin-45b3a4f3.js"),[])});kt({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>Dt(()=>import("./less-a184ed1c.js"),[])});kt({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>Dt(()=>import("./lexon-ebf376fd.js"),[])});kt({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>Dt(()=>import("./lua-666d20d5.js"),[])});kt({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>Dt(()=>import("./liquid-3fca3ef0.js"),[])});kt({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>Dt(()=>import("./m3-bbbbbca9.js"),[])});kt({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>Dt(()=>import("./markdown-5de2301d.js"),[])});kt({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>Dt(()=>import("./mdx-f7a52d23.js"),[])});kt({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>Dt(()=>import("./mips-7b46d093.js"),[])});kt({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>Dt(()=>import("./msdax-295c0d3c.js"),[])});kt({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>Dt(()=>import("./mysql-28fc43b5.js"),[])});kt({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>Dt(()=>import("./objective-c-5f7f7623.js"),[])});kt({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>Dt(()=>import("./pascal-830d8a16.js"),[])});kt({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>Dt(()=>import("./pascaligo-ff6a611d.js"),[])});kt({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>Dt(()=>import("./perl-0c4cf450.js"),[])});kt({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>Dt(()=>import("./pgsql-85eb1e14.js"),[])});kt({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>Dt(()=>import("./php-571f6521.js"),[])});kt({id:"pla",extensions:[".pla"],loader:()=>Dt(()=>import("./pla-5e6cd4d5.js"),[])});kt({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>Dt(()=>import("./postiats-4d02d044.js"),[])});kt({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>Dt(()=>import("./powerquery-c6baddff.js"),[])});kt({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>Dt(()=>import("./powershell-8bfccb2f.js"),[])});kt({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>Dt(()=>import("./protobuf-7c245adb.js"),[])});kt({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>Dt(()=>import("./pug-e0d77a81.js"),[])});kt({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>Dt(()=>import("./python-b8459894.js"),[])});kt({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>Dt(()=>import("./qsharp-560af9ec.js"),[])});kt({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>Dt(()=>import("./r-96b98db0.js"),[])});kt({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>Dt(()=>import("./razor-0763a92b.js"),[])});kt({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>Dt(()=>import("./redis-2313a258.js"),[])});kt({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>Dt(()=>import("./redshift-e81279f9.js"),[])});kt({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>Dt(()=>import("./restructuredtext-23e36e2c.js"),[])});kt({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>Dt(()=>import("./ruby-6e5b4752.js"),[])});kt({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>Dt(()=>import("./rust-c4e1d9a9.js"),[])});kt({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>Dt(()=>import("./sb-095651a8.js"),[])});kt({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:()=>Dt(()=>import("./scala-dfd2c035.js"),[])});kt({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>Dt(()=>import("./scheme-4bd59040.js"),[])});kt({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>Dt(()=>import("./scss-0b769ec8.js"),[])});kt({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>Dt(()=>import("./shell-5fa60225.js"),[])});kt({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>Dt(()=>import("./solidity-3efd84d4.js"),[])});kt({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>Dt(()=>import("./sophia-156a057a.js"),[])});kt({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>Dt(()=>import("./sparql-25a61c8a.js"),[])});kt({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>Dt(()=>import("./sql-ef431720.js"),[])});kt({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>Dt(()=>import("./st-06071006.js"),[])});kt({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>Dt(()=>import("./swift-941c2e3c.js"),[])});kt({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>Dt(()=>import("./systemverilog-dc0c3813.js"),[])});kt({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>Dt(()=>import("./systemverilog-dc0c3813.js"),[])});kt({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>Dt(()=>import("./tcl-cc963d5c.js"),[])});kt({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>Dt(()=>import("./twig-cdf47909.js"),[])});kt({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>Dt(()=>import("./typescript-4b89e88c.js"),[])});kt({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>Dt(()=>import("./vb-3ff3c116.js"),[])});kt({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>Dt(()=>import("./wgsl-7be617f0.js"),[])});kt({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\Dt(()=>import("./xml-968dcc32.js"),[])});kt({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>Dt(()=>import("./yaml-8a69e9dd.js"),[])});/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var Met=Object.defineProperty,Aet=Object.getOwnPropertyDescriptor,Pet=Object.getOwnPropertyNames,Oet=Object.prototype.hasOwnProperty,lae=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Pet(e))!Oet.call(i,r)&&r!==t&&Met(i,r,{get:()=>e[r],enumerable:!(n=Aet(e,r))||n.enumerable});return i},Fet=(i,e,t)=>(lae(i,e,"default"),t&&lae(t,e,"default")),FS={};Fet(FS,w3);var IY=class{constructor(e,t,n){this._onDidChange=new FS.Emitter,this._languageId=e,this.setOptions(t),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)}},kY={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},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},TY={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},Cbe=new IY("css",kY,TY),ybe=new IY("scss",kY,TY),wbe=new IY("less",kY,TY);FS.languages.css={cssDefaults:Cbe,lessDefaults:wbe,scssDefaults:ybe};function NY(){return Dt(()=>import("./cssMode-e9a916a7.js"),[])}FS.languages.onLanguage("less",()=>{NY().then(i=>i.setupMode(wbe))});FS.languages.onLanguage("scss",()=>{NY().then(i=>i.setupMode(ybe))});FS.languages.onLanguage("css",()=>{NY().then(i=>i.setupMode(Cbe))});/*!----------------------------------------------------------------------------- + *-----------------------------------------------------------------------------*/var Met=Object.defineProperty,Aet=Object.getOwnPropertyDescriptor,Pet=Object.getOwnPropertyNames,Oet=Object.prototype.hasOwnProperty,lae=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Pet(e))!Oet.call(i,r)&&r!==t&&Met(i,r,{get:()=>e[r],enumerable:!(n=Aet(e,r))||n.enumerable});return i},Fet=(i,e,t)=>(lae(i,e,"default"),t&&lae(t,e,"default")),FS={};Fet(FS,w3);var IY=class{constructor(e,t,n){this._onDidChange=new FS.Emitter,this._languageId=e,this.setOptions(t),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)}},kY={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},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},TY={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},Cbe=new IY("css",kY,TY),ybe=new IY("scss",kY,TY),wbe=new IY("less",kY,TY);FS.languages.css={cssDefaults:Cbe,lessDefaults:wbe,scssDefaults:ybe};function NY(){return Dt(()=>import("./cssMode-f75e3f37.js"),[])}FS.languages.onLanguage("less",()=>{NY().then(i=>i.setupMode(wbe))});FS.languages.onLanguage("scss",()=>{NY().then(i=>i.setupMode(ybe))});FS.languages.onLanguage("css",()=>{NY().then(i=>i.setupMode(Cbe))});/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var Bet=Object.defineProperty,Wet=Object.getOwnPropertyDescriptor,$et=Object.getOwnPropertyNames,Het=Object.prototype.hasOwnProperty,cae=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of $et(e))!Het.call(i,r)&&r!==t&&Bet(i,r,{get:()=>e[r],enumerable:!(n=Wet(e,r))||n.enumerable});return i},Vet=(i,e,t)=>(cae(i,e,"default"),t&&cae(t,e,"default")),S3={};Vet(S3,w3);var zet=class{constructor(e,t,n){this._onDidChange=new S3.Emitter,this._languageId=e,this.setOptions(t),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)}},Uet={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"},x3={format:Uet,suggest:{},data:{useDefaultDataProvider:!0}};function L3(i){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:i===TE,documentFormattingEdits:i===TE,documentRangeFormattingEdits:i===TE}}var TE="html",uae="handlebars",dae="razor",Sbe=E3(TE,x3,L3(TE)),jet=Sbe.defaults,xbe=E3(uae,x3,L3(uae)),Ket=xbe.defaults,Lbe=E3(dae,x3,L3(dae)),Get=Lbe.defaults;S3.languages.html={htmlDefaults:jet,razorDefaults:Get,handlebarDefaults:Ket,htmlLanguageService:Sbe,handlebarLanguageService:xbe,razorLanguageService:Lbe,registerHTMLLanguageService:E3};function qet(){return Dt(()=>import("./htmlMode-ed1d179b.js"),[])}function E3(i,e=x3,t=L3(i)){const n=new zet(i,e,t);let r;const o=S3.languages.onLanguage(i,async()=>{r=(await qet()).setupMode(n)});return{defaults:n,dispose(){o.dispose(),r==null||r.dispose(),r=void 0}}}var Xet=class{constructor(e,t,n){this._onDidChange=new DY,this._languageId=e,this.setDiagnosticsOptions(t),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)}},Yet={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},Zet={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},Ebe=new Xet("json",Yet,Zet),Qet=()=>Dbe().then(i=>i.getWorker());sT.json={jsonDefaults:Ebe,getWorker:Qet};function Dbe(){return Dt(()=>import("./jsonMode-c06ea4cb.js"),[])}sT.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});sT.onLanguage("json",()=>{Dbe().then(i=>i.setupMode(Ebe))});/*!----------------------------------------------------------------------------- + *-----------------------------------------------------------------------------*/var Bet=Object.defineProperty,Wet=Object.getOwnPropertyDescriptor,$et=Object.getOwnPropertyNames,Het=Object.prototype.hasOwnProperty,cae=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of $et(e))!Het.call(i,r)&&r!==t&&Bet(i,r,{get:()=>e[r],enumerable:!(n=Wet(e,r))||n.enumerable});return i},Vet=(i,e,t)=>(cae(i,e,"default"),t&&cae(t,e,"default")),S3={};Vet(S3,w3);var zet=class{constructor(e,t,n){this._onDidChange=new S3.Emitter,this._languageId=e,this.setOptions(t),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)}},Uet={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"},x3={format:Uet,suggest:{},data:{useDefaultDataProvider:!0}};function L3(i){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:i===TE,documentFormattingEdits:i===TE,documentRangeFormattingEdits:i===TE}}var TE="html",uae="handlebars",dae="razor",Sbe=E3(TE,x3,L3(TE)),jet=Sbe.defaults,xbe=E3(uae,x3,L3(uae)),Ket=xbe.defaults,Lbe=E3(dae,x3,L3(dae)),Get=Lbe.defaults;S3.languages.html={htmlDefaults:jet,razorDefaults:Get,handlebarDefaults:Ket,htmlLanguageService:Sbe,handlebarLanguageService:xbe,razorLanguageService:Lbe,registerHTMLLanguageService:E3};function qet(){return Dt(()=>import("./htmlMode-414a2305.js"),[])}function E3(i,e=x3,t=L3(i)){const n=new zet(i,e,t);let r;const o=S3.languages.onLanguage(i,async()=>{r=(await qet()).setupMode(n)});return{defaults:n,dispose(){o.dispose(),r==null||r.dispose(),r=void 0}}}var Xet=class{constructor(e,t,n){this._onDidChange=new DY,this._languageId=e,this.setDiagnosticsOptions(t),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)}},Yet={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},Zet={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},Ebe=new Xet("json",Yet,Zet),Qet=()=>Dbe().then(i=>i.getWorker());sT.json={jsonDefaults:Ebe,getWorker:Qet};function Dbe(){return Dt(()=>import("./jsonMode-b0407c2e.js"),[])}sT.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});sT.onLanguage("json",()=>{Dbe().then(i=>i.setupMode(Ebe))});/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var Jet=Object.defineProperty,ett=Object.getOwnPropertyDescriptor,ttt=Object.getOwnPropertyNames,ntt=Object.prototype.hasOwnProperty,hae=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ttt(e))!ntt.call(i,r)&&r!==t&&Jet(i,r,{get:()=>e[r],enumerable:!(n=ett(e,r))||n.enumerable});return i},itt=(i,e,t)=>(hae(i,e,"default"),t&&hae(t,e,"default")),rtt="5.0.2",Qw={};itt(Qw,w3);var Ibe=(i=>(i[i.None=0]="None",i[i.CommonJS=1]="CommonJS",i[i.AMD=2]="AMD",i[i.UMD=3]="UMD",i[i.System=4]="System",i[i.ES2015=5]="ES2015",i[i.ESNext=99]="ESNext",i))(Ibe||{}),kbe=(i=>(i[i.None=0]="None",i[i.Preserve=1]="Preserve",i[i.React=2]="React",i[i.ReactNative=3]="ReactNative",i[i.ReactJSX=4]="ReactJSX",i[i.ReactJSXDev=5]="ReactJSXDev",i))(kbe||{}),Tbe=(i=>(i[i.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",i[i.LineFeed=1]="LineFeed",i))(Tbe||{}),Nbe=(i=>(i[i.ES3=0]="ES3",i[i.ES5=1]="ES5",i[i.ES2015=2]="ES2015",i[i.ES2016=3]="ES2016",i[i.ES2017=4]="ES2017",i[i.ES2018=5]="ES2018",i[i.ES2019=6]="ES2019",i[i.ES2020=7]="ES2020",i[i.ESNext=99]="ESNext",i[i.JSON=100]="JSON",i[i.Latest=99]="Latest",i))(Nbe||{}),Rbe=(i=>(i[i.Classic=1]="Classic",i[i.NodeJs=2]="NodeJs",i))(Rbe||{}),Mbe=class{constructor(i,e,t,n,r){this._onDidChange=new Qw.Emitter,this._onDidExtraLibsChange=new Qw.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(i),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(n),this.setModeConfiguration(r),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(i,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===i)return{dispose:()=>{}};let n=1;return this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(n=this._extraLibs[t].version+1),this._extraLibs[t]={content:i,version:n},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let r=this._extraLibs[t];r&&r.version===n&&(delete this._extraLibs[t],this._removedExtraLibs[t]=n,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(i){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),i&&i.length>0)for(const e of i){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,n=e.content;let r=1;this._removedExtraLibs[t]&&(r=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:n,version:r}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(i){this._compilerOptions=i||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(i){this._diagnosticsOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(i){this._workerOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(i){this._inlayHintsOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(i){}setEagerModelSync(i){this._eagerModelSync=i}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(i){this._modeConfiguration=i||Object.create(null),this._onDidChange.fire(void 0)}},ott=rtt,Abe={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},Pbe=new Mbe({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},Abe),Obe=new Mbe({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},Abe),stt=()=>D3().then(i=>i.getTypeScriptWorker()),att=()=>D3().then(i=>i.getJavaScriptWorker());Qw.languages.typescript={ModuleKind:Ibe,JsxEmit:kbe,NewLineKind:Tbe,ScriptTarget:Nbe,ModuleResolutionKind:Rbe,typescriptVersion:ott,typescriptDefaults:Pbe,javascriptDefaults:Obe,getTypeScriptWorker:stt,getJavaScriptWorker:att};function D3(){return Dt(()=>import("./tsMode-15682ab2.js"),[])}Qw.languages.onLanguage("typescript",()=>D3().then(i=>i.setupTypeScript(Pbe)));Qw.languages.onLanguage("javascript",()=>D3().then(i=>i.setupJavaScript(Obe)));class ltt extends sl{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:$n("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:Xe.map,toggled:De.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:De.has("isInDiffEditor"),menu:{when:De.has("isInDiffEditor"),id:$.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const n=e.get(gn),r=!n.getValue("diffEditor.hideUnchangedRegions.enabled");n.updateValue("diffEditor.hideUnchangedRegions.enabled",r)}}Ei(ltt);class Fbe extends sl{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:$n("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:De.has("isInDiffEditor")})}run(e,...t){const n=e.get(gn),r=!n.getValue("diffEditor.experimental.showMoves");n.updateValue("diffEditor.experimental.showMoves",r)}}Ei(Fbe);class Bbe extends sl{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:$n("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:De.has("isInDiffEditor")})}run(e,...t){const n=e.get(gn),r=!n.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");n.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",r)}}Ei(Bbe);ts.appendMenuItem($.EditorTitle,{command:{id:new Bbe().desc.id,title:w("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:De.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:De.has("isInDiffEditor")},order:11,group:"1_diff",when:De.and(j.diffEditorRenderSideBySideInlineBreakpointReached,De.has("isInDiffEditor"))});ts.appendMenuItem($.EditorTitle,{command:{id:new Fbe().desc.id,title:w("showMoves","Show Moved Code Blocks"),icon:Xe.move,toggled:LS.create("config.diffEditor.experimental.showMoves",!0),precondition:De.has("isInDiffEditor")},order:10,group:"1_diff",when:De.has("isInDiffEditor")});const I3=$n("diffEditor","Diff Editor");class ctt extends Sh{constructor(){super({id:"diffEditor.switchSide",title:$n("switchSide","Switch Side"),icon:Xe.arrowSwap,precondition:De.has("isInDiffEditor"),f1:!0,category:I3})}runEditorCommand(e,t,n){const r=WS(e);if(r instanceof n_){if(n&&n.dryRun)return{destinationSelection:r.mapToOtherSide().destinationSelection};r.switchSide()}}}Ei(ctt);class utt extends Sh{constructor(){super({id:"diffEditor.exitCompareMove",title:$n("exitCompareMove","Exit Compare Move"),icon:Xe.close,precondition:j.comparingMovedCode,f1:!1,category:I3,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...n){const r=WS(e);r instanceof n_&&r.exitCompareMove()}}Ei(utt);class dtt extends Sh{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:$n("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:Xe.fold,precondition:De.has("isInDiffEditor"),f1:!0,category:I3})}runEditorCommand(e,t,...n){const r=WS(e);r instanceof n_&&r.collapseAllUnchangedRegions()}}Ei(dtt);class htt extends Sh{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:$n("showAllUnchangedRegions","Show All Unchanged Regions"),icon:Xe.unfold,precondition:De.has("isInDiffEditor"),f1:!0,category:I3})}runEditorCommand(e,t,...n){const r=WS(e);r instanceof n_&&r.showAllUnchangedRegions()}}Ei(htt);const Wbe=$n("accessibleDiffViewer","Accessible Diff Viewer");class BS extends sl{constructor(){super({id:BS.id,title:$n("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:Wbe,precondition:De.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=WS(e);t==null||t.accessibleDiffViewerNext()}}BS.id="editor.action.accessibleDiffViewer.next";ts.appendMenuItem($.EditorTitle,{command:{id:BS.id,title:w("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:De.has("isInDiffEditor")},order:10,group:"2_diff",when:De.and(j.accessibleDiffViewerVisible.negate(),De.has("isInDiffEditor"))});class aT extends sl{constructor(){super({id:aT.id,title:$n("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:Wbe,precondition:De.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=WS(e);t==null||t.accessibleDiffViewerPrev()}}aT.id="editor.action.accessibleDiffViewer.prev";function WS(i){const t=i.get(Un).listDiffEditors(),n=fs();if(n)for(const r of t){const o=r.getContainerDomNode();if(ftt(o,n))return r}return null}function ftt(i,e){let t=e;for(;t;){if(t===i)return!0;t=t.parentElement}return!1}Dn.registerCommandAlias("editor.action.diffReview.next",BS.id);Ei(BS);Dn.registerCommandAlias("editor.action.diffReview.prev",aT.id);Ei(aT);var gtt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ptt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Rz;const k3=new st("selectionAnchorSet",!1);let Tp=Rz=class{static get(e){return e.getContribution(Rz.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=k3.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(yt.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Is().appendText(w("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),kl(w("anchorSet","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(yt.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}};Tp.ID="editor.contrib.selectionAnchorController";Tp=Rz=gtt([ptt(1,Vt)],Tp);class mtt extends gt{constructor(){super({id:"editor.action.setSelectionAnchor",label:w("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:j.editorTextFocus,primary:co(2089,2080),weight:100}})}async run(e,t){var n;(n=Tp.get(t))===null||n===void 0||n.setSelectionAnchor()}}class vtt extends gt{constructor(){super({id:"editor.action.goToSelectionAnchor",label:w("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:k3})}async run(e,t){var n;(n=Tp.get(t))===null||n===void 0||n.goToSelectionAnchor()}}class _tt extends gt{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:w("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:k3,kbOpts:{kbExpr:j.editorTextFocus,primary:co(2089,2089),weight:100}})}async run(e,t){var n;(n=Tp.get(t))===null||n===void 0||n.selectFromAnchorToCursor()}}class btt extends gt{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:w("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:k3,kbOpts:{kbExpr:j.editorTextFocus,primary:9,weight:100}})}async run(e,t){var n;(n=Tp.get(t))===null||n===void 0||n.cancelSelectionAnchor()}}jn(Tp.ID,Tp,4);Be(mtt);Be(vtt);Be(_tt);Be(btt);const Ctt=X("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},w("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class ytt extends gt{constructor(){super({id:"editor.action.jumpToBracket",label:w("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:j.editorTextFocus,primary:3165,weight:100}})}run(e,t){var n;(n=Qu.get(t))===null||n===void 0||n.jumpToBracket()}}class wtt extends gt{constructor(){super({id:"editor.action.selectToBracket",label:w("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:$n("smartSelect.selectToBracketDescription","Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,n){var r;let o=!0;n&&n.selectBrackets===!1&&(o=!1),(r=Qu.get(t))===null||r===void 0||r.selectToBracket(o)}}class Stt extends gt{constructor(){super({id:"editor.action.removeBrackets",label:w("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:j.editorTextFocus,primary:2561,weight:100}})}run(e,t){var n;(n=Qu.get(t))===null||n===void 0||n.removeBrackets(this.id)}}class xtt{constructor(e,t,n){this.position=e,this.brackets=t,this.options=n}}class Qu extends fe{static get(e){return e.getContribution(Qu.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new pi(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(72),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(72)&&(this._matchBrackets=this._editor.getOption(72),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(n=>{const r=n.getStartPosition(),o=e.bracketPairs.matchBracket(r);let s=null;if(o)o[0].containsPosition(r)&&!o[1].containsPosition(r)?s=o[1].getStartPosition():o[1].containsPosition(r)&&(s=o[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(r);if(a)s=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(r);l&&l.range&&(s=l.range.getStartPosition())}}return s?new yt(s.lineNumber,s.column,s.lineNumber,s.column):new yt(r.lineNumber,r.column,r.lineNumber,r.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),n=[];this._editor.getSelections().forEach(r=>{const o=r.getStartPosition();let s=t.bracketPairs.matchBracket(o);if(!s&&(s=t.bracketPairs.findEnclosingBrackets(o),!s)){const c=t.bracketPairs.findNextBracket(o);c&&c.range&&(s=t.bracketPairs.matchBracket(c.range.getStartPosition()))}let a=null,l=null;if(s){s.sort(B.compareRangesUsingStarts);const[c,u]=s;if(a=e?c.getStartPosition():c.getEndPosition(),l=e?u.getEndPosition():u.getStartPosition(),u.containsPosition(o)){const d=a;a=l,l=d}}a&&l&&n.push(new yt(a.lineNumber,a.column,l.lineNumber,l.column))}),n.length>0&&(this._editor.setSelections(n),this._editor.revealRange(n[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(n=>{const r=n.getPosition();let o=t.bracketPairs.matchBracket(r);o||(o=t.bracketPairs.findEnclosingBrackets(r)),o&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:o[0],text:""},{range:o[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const n of this._lastBracketsData){const r=n.brackets;r&&(e[t++]={range:r[0],options:n.options},e[t++]={range:r[1],options:n.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),n=t.getVersionId();let r=[];this._lastVersionId===n&&(r=this._lastBracketsData);const o=[];let s=0;for(let d=0,h=e.length;d1&&o.sort(ae.compare);const a=[];let l=0,c=0;const u=r.length;for(let d=0,h=o.length;d0&&(t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop())}}Be(Itt);const T3=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let i;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?i=crypto.getRandomValues.bind(crypto):i=function(n){for(let r=0;ri,asFile:()=>{},value:typeof i=="string"?i:void 0}}function ktt(i,e,t){const n={id:T3(),name:i,uri:e,data:t};return{asString:async()=>"",asFile:()=>n,value:void 0}}class Hbe{constructor(){this._entries=new Map}get size(){let e=0;for(const t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const t=[...this._entries.keys()];return En.some(this,([n,r])=>r.asFile())&&t.push("files"),zbe(cO(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))===null||t===void 0?void 0:t[0]}append(e,t){const n=this._entries.get(e);n?n.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const n of t)yield[e,n]}toKey(e){return cO(e)}}function cO(i){return i.toLowerCase()}function Vbe(i,e){return zbe(cO(i),e.map(cO))}function zbe(i,e){if(i==="*/*")return e.length>0;if(e.includes(i))return!0;const t=i.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[n,r,o]=t;return o==="*"?e.some(s=>s.startsWith(r+"/")):!1}const N3=Object.freeze({create:i=>Lp(i.map(e=>e.toString())).join(`\r + *-----------------------------------------------------------------------------*/var Jet=Object.defineProperty,ett=Object.getOwnPropertyDescriptor,ttt=Object.getOwnPropertyNames,ntt=Object.prototype.hasOwnProperty,hae=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ttt(e))!ntt.call(i,r)&&r!==t&&Jet(i,r,{get:()=>e[r],enumerable:!(n=ett(e,r))||n.enumerable});return i},itt=(i,e,t)=>(hae(i,e,"default"),t&&hae(t,e,"default")),rtt="5.0.2",Qw={};itt(Qw,w3);var Ibe=(i=>(i[i.None=0]="None",i[i.CommonJS=1]="CommonJS",i[i.AMD=2]="AMD",i[i.UMD=3]="UMD",i[i.System=4]="System",i[i.ES2015=5]="ES2015",i[i.ESNext=99]="ESNext",i))(Ibe||{}),kbe=(i=>(i[i.None=0]="None",i[i.Preserve=1]="Preserve",i[i.React=2]="React",i[i.ReactNative=3]="ReactNative",i[i.ReactJSX=4]="ReactJSX",i[i.ReactJSXDev=5]="ReactJSXDev",i))(kbe||{}),Tbe=(i=>(i[i.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",i[i.LineFeed=1]="LineFeed",i))(Tbe||{}),Nbe=(i=>(i[i.ES3=0]="ES3",i[i.ES5=1]="ES5",i[i.ES2015=2]="ES2015",i[i.ES2016=3]="ES2016",i[i.ES2017=4]="ES2017",i[i.ES2018=5]="ES2018",i[i.ES2019=6]="ES2019",i[i.ES2020=7]="ES2020",i[i.ESNext=99]="ESNext",i[i.JSON=100]="JSON",i[i.Latest=99]="Latest",i))(Nbe||{}),Rbe=(i=>(i[i.Classic=1]="Classic",i[i.NodeJs=2]="NodeJs",i))(Rbe||{}),Mbe=class{constructor(i,e,t,n,r){this._onDidChange=new Qw.Emitter,this._onDidExtraLibsChange=new Qw.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(i),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(n),this.setModeConfiguration(r),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(i,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===i)return{dispose:()=>{}};let n=1;return this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(n=this._extraLibs[t].version+1),this._extraLibs[t]={content:i,version:n},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let r=this._extraLibs[t];r&&r.version===n&&(delete this._extraLibs[t],this._removedExtraLibs[t]=n,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(i){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),i&&i.length>0)for(const e of i){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,n=e.content;let r=1;this._removedExtraLibs[t]&&(r=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:n,version:r}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(i){this._compilerOptions=i||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(i){this._diagnosticsOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(i){this._workerOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(i){this._inlayHintsOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(i){}setEagerModelSync(i){this._eagerModelSync=i}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(i){this._modeConfiguration=i||Object.create(null),this._onDidChange.fire(void 0)}},ott=rtt,Abe={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},Pbe=new Mbe({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},Abe),Obe=new Mbe({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},Abe),stt=()=>D3().then(i=>i.getTypeScriptWorker()),att=()=>D3().then(i=>i.getJavaScriptWorker());Qw.languages.typescript={ModuleKind:Ibe,JsxEmit:kbe,NewLineKind:Tbe,ScriptTarget:Nbe,ModuleResolutionKind:Rbe,typescriptVersion:ott,typescriptDefaults:Pbe,javascriptDefaults:Obe,getTypeScriptWorker:stt,getJavaScriptWorker:att};function D3(){return Dt(()=>import("./tsMode-74a44fcf.js"),[])}Qw.languages.onLanguage("typescript",()=>D3().then(i=>i.setupTypeScript(Pbe)));Qw.languages.onLanguage("javascript",()=>D3().then(i=>i.setupJavaScript(Obe)));class ltt extends sl{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:$n("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:Xe.map,toggled:De.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:De.has("isInDiffEditor"),menu:{when:De.has("isInDiffEditor"),id:$.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const n=e.get(gn),r=!n.getValue("diffEditor.hideUnchangedRegions.enabled");n.updateValue("diffEditor.hideUnchangedRegions.enabled",r)}}Ei(ltt);class Fbe extends sl{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:$n("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:De.has("isInDiffEditor")})}run(e,...t){const n=e.get(gn),r=!n.getValue("diffEditor.experimental.showMoves");n.updateValue("diffEditor.experimental.showMoves",r)}}Ei(Fbe);class Bbe extends sl{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:$n("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:De.has("isInDiffEditor")})}run(e,...t){const n=e.get(gn),r=!n.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");n.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",r)}}Ei(Bbe);ts.appendMenuItem($.EditorTitle,{command:{id:new Bbe().desc.id,title:w("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:De.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:De.has("isInDiffEditor")},order:11,group:"1_diff",when:De.and(j.diffEditorRenderSideBySideInlineBreakpointReached,De.has("isInDiffEditor"))});ts.appendMenuItem($.EditorTitle,{command:{id:new Fbe().desc.id,title:w("showMoves","Show Moved Code Blocks"),icon:Xe.move,toggled:LS.create("config.diffEditor.experimental.showMoves",!0),precondition:De.has("isInDiffEditor")},order:10,group:"1_diff",when:De.has("isInDiffEditor")});const I3=$n("diffEditor","Diff Editor");class ctt extends Sh{constructor(){super({id:"diffEditor.switchSide",title:$n("switchSide","Switch Side"),icon:Xe.arrowSwap,precondition:De.has("isInDiffEditor"),f1:!0,category:I3})}runEditorCommand(e,t,n){const r=WS(e);if(r instanceof t_){if(n&&n.dryRun)return{destinationSelection:r.mapToOtherSide().destinationSelection};r.switchSide()}}}Ei(ctt);class utt extends Sh{constructor(){super({id:"diffEditor.exitCompareMove",title:$n("exitCompareMove","Exit Compare Move"),icon:Xe.close,precondition:j.comparingMovedCode,f1:!1,category:I3,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...n){const r=WS(e);r instanceof t_&&r.exitCompareMove()}}Ei(utt);class dtt extends Sh{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:$n("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:Xe.fold,precondition:De.has("isInDiffEditor"),f1:!0,category:I3})}runEditorCommand(e,t,...n){const r=WS(e);r instanceof t_&&r.collapseAllUnchangedRegions()}}Ei(dtt);class htt extends Sh{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:$n("showAllUnchangedRegions","Show All Unchanged Regions"),icon:Xe.unfold,precondition:De.has("isInDiffEditor"),f1:!0,category:I3})}runEditorCommand(e,t,...n){const r=WS(e);r instanceof t_&&r.showAllUnchangedRegions()}}Ei(htt);const Wbe=$n("accessibleDiffViewer","Accessible Diff Viewer");class BS extends sl{constructor(){super({id:BS.id,title:$n("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:Wbe,precondition:De.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=WS(e);t==null||t.accessibleDiffViewerNext()}}BS.id="editor.action.accessibleDiffViewer.next";ts.appendMenuItem($.EditorTitle,{command:{id:BS.id,title:w("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:De.has("isInDiffEditor")},order:10,group:"2_diff",when:De.and(j.accessibleDiffViewerVisible.negate(),De.has("isInDiffEditor"))});class aT extends sl{constructor(){super({id:aT.id,title:$n("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:Wbe,precondition:De.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=WS(e);t==null||t.accessibleDiffViewerPrev()}}aT.id="editor.action.accessibleDiffViewer.prev";function WS(i){const t=i.get(Un).listDiffEditors(),n=fs();if(n)for(const r of t){const o=r.getContainerDomNode();if(ftt(o,n))return r}return null}function ftt(i,e){let t=e;for(;t;){if(t===i)return!0;t=t.parentElement}return!1}Dn.registerCommandAlias("editor.action.diffReview.next",BS.id);Ei(BS);Dn.registerCommandAlias("editor.action.diffReview.prev",aT.id);Ei(aT);var gtt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ptt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Rz;const k3=new st("selectionAnchorSet",!1);let Np=Rz=class{static get(e){return e.getContribution(Rz.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=k3.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(yt.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Is().appendText(w("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),kl(w("anchorSet","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(yt.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}};Np.ID="editor.contrib.selectionAnchorController";Np=Rz=gtt([ptt(1,Vt)],Np);class mtt extends gt{constructor(){super({id:"editor.action.setSelectionAnchor",label:w("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:j.editorTextFocus,primary:co(2089,2080),weight:100}})}async run(e,t){var n;(n=Np.get(t))===null||n===void 0||n.setSelectionAnchor()}}class vtt extends gt{constructor(){super({id:"editor.action.goToSelectionAnchor",label:w("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:k3})}async run(e,t){var n;(n=Np.get(t))===null||n===void 0||n.goToSelectionAnchor()}}class _tt extends gt{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:w("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:k3,kbOpts:{kbExpr:j.editorTextFocus,primary:co(2089,2089),weight:100}})}async run(e,t){var n;(n=Np.get(t))===null||n===void 0||n.selectFromAnchorToCursor()}}class btt extends gt{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:w("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:k3,kbOpts:{kbExpr:j.editorTextFocus,primary:9,weight:100}})}async run(e,t){var n;(n=Np.get(t))===null||n===void 0||n.cancelSelectionAnchor()}}jn(Np.ID,Np,4);Be(mtt);Be(vtt);Be(_tt);Be(btt);const Ctt=X("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},w("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class ytt extends gt{constructor(){super({id:"editor.action.jumpToBracket",label:w("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:j.editorTextFocus,primary:3165,weight:100}})}run(e,t){var n;(n=Qu.get(t))===null||n===void 0||n.jumpToBracket()}}class wtt extends gt{constructor(){super({id:"editor.action.selectToBracket",label:w("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:$n("smartSelect.selectToBracketDescription","Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,n){var r;let o=!0;n&&n.selectBrackets===!1&&(o=!1),(r=Qu.get(t))===null||r===void 0||r.selectToBracket(o)}}class Stt extends gt{constructor(){super({id:"editor.action.removeBrackets",label:w("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:j.editorTextFocus,primary:2561,weight:100}})}run(e,t){var n;(n=Qu.get(t))===null||n===void 0||n.removeBrackets(this.id)}}class xtt{constructor(e,t,n){this.position=e,this.brackets=t,this.options=n}}class Qu extends fe{static get(e){return e.getContribution(Qu.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new pi(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(72),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(72)&&(this._matchBrackets=this._editor.getOption(72),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(n=>{const r=n.getStartPosition(),o=e.bracketPairs.matchBracket(r);let s=null;if(o)o[0].containsPosition(r)&&!o[1].containsPosition(r)?s=o[1].getStartPosition():o[1].containsPosition(r)&&(s=o[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(r);if(a)s=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(r);l&&l.range&&(s=l.range.getStartPosition())}}return s?new yt(s.lineNumber,s.column,s.lineNumber,s.column):new yt(r.lineNumber,r.column,r.lineNumber,r.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),n=[];this._editor.getSelections().forEach(r=>{const o=r.getStartPosition();let s=t.bracketPairs.matchBracket(o);if(!s&&(s=t.bracketPairs.findEnclosingBrackets(o),!s)){const c=t.bracketPairs.findNextBracket(o);c&&c.range&&(s=t.bracketPairs.matchBracket(c.range.getStartPosition()))}let a=null,l=null;if(s){s.sort(B.compareRangesUsingStarts);const[c,u]=s;if(a=e?c.getStartPosition():c.getEndPosition(),l=e?u.getEndPosition():u.getStartPosition(),u.containsPosition(o)){const d=a;a=l,l=d}}a&&l&&n.push(new yt(a.lineNumber,a.column,l.lineNumber,l.column))}),n.length>0&&(this._editor.setSelections(n),this._editor.revealRange(n[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(n=>{const r=n.getPosition();let o=t.bracketPairs.matchBracket(r);o||(o=t.bracketPairs.findEnclosingBrackets(r)),o&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:o[0],text:""},{range:o[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const n of this._lastBracketsData){const r=n.brackets;r&&(e[t++]={range:r[0],options:n.options},e[t++]={range:r[1],options:n.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),n=t.getVersionId();let r=[];this._lastVersionId===n&&(r=this._lastBracketsData);const o=[];let s=0;for(let d=0,h=e.length;d1&&o.sort(ae.compare);const a=[];let l=0,c=0;const u=r.length;for(let d=0,h=o.length;d0&&(t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop())}}Be(Itt);const T3=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let i;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?i=crypto.getRandomValues.bind(crypto):i=function(n){for(let r=0;ri,asFile:()=>{},value:typeof i=="string"?i:void 0}}function ktt(i,e,t){const n={id:T3(),name:i,uri:e,data:t};return{asString:async()=>"",asFile:()=>n,value:void 0}}class Hbe{constructor(){this._entries=new Map}get size(){let e=0;for(const t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const t=[...this._entries.keys()];return En.some(this,([n,r])=>r.asFile())&&t.push("files"),zbe(cO(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))===null||t===void 0?void 0:t[0]}append(e,t){const n=this._entries.get(e);n?n.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const n of t)yield[e,n]}toKey(e){return cO(e)}}function cO(i){return i.toLowerCase()}function Vbe(i,e){return zbe(cO(i),e.map(cO))}function zbe(i,e){if(i==="*/*")return e.length>0;if(e.includes(i))return!0;const t=i.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[n,r,o]=t;return o==="*"?e.some(s=>s.startsWith(r+"/")):!1}const N3=Object.freeze({create:i=>Ep(i.map(e=>e.toString())).join(`\r `),split:i=>i.split(`\r -`),parse:i=>N3.split(i).filter(e=>!e.startsWith("#"))}),fae={EDITORS:"CodeEditors",FILES:"CodeFiles"};class Ttt{}const Ntt={DragAndDropContribution:"workbench.contributions.dragAndDrop"};ar.add(Ntt.DragAndDropContribution,new Ttt);class DI{constructor(){}static getInstance(){return DI.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}}DI.INSTANCE=new DI;function Ube(i){const e=new Hbe;for(const t of i.items){const n=t.type;if(t.kind==="string"){const r=new Promise(o=>t.getAsString(o));e.append(n,RY(r))}else if(t.kind==="file"){const r=t.getAsFile();r&&e.append(n,Rtt(r))}}return e}function Rtt(i){const e=i.path?At.parse(i.path):void 0;return ktt(i.name,e,async()=>new Uint8Array(await i.arrayBuffer()))}const Mtt=Object.freeze([fae.EDITORS,fae.FILES,lI.RESOURCES,lI.INTERNAL_URI_LIST]);function jbe(i,e=!1){const t=Ube(i),n=t.get(lI.INTERNAL_URI_LIST);if(n)t.replace(Cr.uriList,n);else if(e||!t.has(Cr.uriList)){const r=[];for(const o of i.items){const s=o.getAsFile();if(s){const a=s.path;try{a?r.push(At.file(a).toString()):r.push(At.parse(s.name,!0).toString())}catch{}}}r.length&&t.replace(Cr.uriList,RY(N3.create(r)))}for(const r of Mtt)t.delete(r);return t}class Pu{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};const e=this.pos;let t=0,n=this.value.charCodeAt(e),r;if(r=Pu._table[n],typeof r=="number")return this.pos+=1,{type:r,pos:e,len:1};if(Pu.isDigitCharacter(n)){r=8;do t+=1,n=this.value.charCodeAt(e+t);while(Pu.isDigitCharacter(n));return this.pos+=t,{type:r,pos:e,len:t}}if(Pu.isVariableCharacter(n)){r=9;do n=this.value.charCodeAt(e+ ++t);while(Pu.isVariableCharacter(n)||Pu.isDigitCharacter(n));return this.pos+=t,{type:r,pos:e,len:t}}r=10;do t+=1,n=this.value.charCodeAt(e+t);while(!isNaN(n)&&typeof Pu._table[n]>"u"&&!Pu.isDigitCharacter(n)&&!Pu.isVariableCharacter(n));return this.pos+=t,{type:r,pos:e,len:t}}}Pu._table={[36]:0,[58]:1,[44]:2,[123]:3,[125]:4,[92]:5,[47]:6,[124]:7,[43]:11,[45]:12,[63]:13};class $S{constructor(){this._children=[]}appendChild(e){return e instanceof pa&&this._children[this._children.length-1]instanceof pa?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:n}=e,r=n.children.indexOf(e),o=n.children.slice(0);o.splice(r,1,...t),n._children=o,function s(a,l){for(const c of a)c.parent=l,s(c.children,c)}(t,n)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof lT)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class pa extends $S{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new pa(this.value)}}class Kbe extends $S{}class Vc extends Kbe{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.indext.index?1:0}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof HS?this._children[0]:void 0}clone(){const e=new Vc(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class HS extends $S{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof pa&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new HS;return this.options.forEach(e.appendChild,e),e}}class MY extends $S{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let n=!1,r=e.replace(this.regexp,function(){return n=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!n&&this._children.some(o=>o instanceof Ad&&!!o.elseValue)&&(r=this._replace([])),r}_replace(e){let t="";for(const n of this._children)if(n instanceof Ad){let r=e[n.index]||"";r=n.resolve(r),t+=r}else t+=n.toString();return t}toString(){return""}clone(){const e=new MY;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}}class Ad extends $S{constructor(e,t,n,r){super(),this.index=e,this.shorthandName=t,this.ifValue=n,this.elseValue=r}resolve(e){return this.shorthandName==="upcase"?e?e.toLocaleUpperCase():"":this.shorthandName==="downcase"?e?e.toLocaleLowerCase():"":this.shorthandName==="capitalize"?e?e[0].toLocaleUpperCase()+e.substr(1):"":this.shorthandName==="pascalcase"?e?this._toPascalCase(e):"":this.shorthandName==="camelcase"?e?this._toCamelCase(e):"":e&&typeof this.ifValue=="string"?this.ifValue:!e&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(n=>n.charAt(0).toUpperCase()+n.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((n,r)=>r===0?n.charAt(0).toLowerCase()+n.substr(1):n.charAt(0).toUpperCase()+n.substr(1)).join(""):e}clone(){return new Ad(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class II extends Kbe{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),t!==void 0?(this._children=[new pa(t)],!0):!1}clone(){const e=new II(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function gae(i,e){const t=[...i];for(;t.length>0;){const n=t.shift();if(!e(n))break;t.unshift(...n.children)}}class lT extends $S{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(n){return n instanceof Vc&&(e.push(n),t=!t||t.indexr===e?(n=!0,!1):(t+=r.len(),!0)),n?t:-1}fullLen(e){let t=0;return gae([e],n=>(t+=n.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:n}=e;for(;n;)n instanceof Vc&&t.push(n),n=n.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof II&&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(){const e=new lT;return this._children=this.children.map(t=>t.clone()),e}walk(e){gae(this.children,e)}}class Hb{constructor(){this._scanner=new Pu,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,n){const r=new lT;return this.parseFragment(e,r),this.ensureFinalTabstop(r,n??!1,t??!1),r}parseFragment(e,t){const n=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const r=new Map,o=[];t.walk(l=>(l instanceof Vc&&(l.isFinalTabstop?r.set(0,void 0):!r.has(l.index)&&l.children.length>0?r.set(l.index,l.children):o.push(l)),!0));const s=(l,c)=>{const u=r.get(l.index);if(!u)return;const d=new Vc(l.index);d.transform=l.transform;for(const h of u){const f=h.clone();d.appendChild(f),f instanceof Vc&&r.has(f.index)&&!c.has(f.index)&&(c.add(f.index),s(f,c),c.delete(f.index))}t.replace(l,[d])},a=new Set;for(const l of o)s(l,a);return t.children.slice(n)}ensureFinalTabstop(e,t,n){(t||n&&e.placeholders.length>0)&&(e.placeholders.find(o=>o.index===0)||e.appendChild(new Vc(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const n=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),n}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){const r=this._scanner.next();if(r.type!==0&&r.type!==4&&r.type!==5)return!1}this._token=this._scanner.next()}const n=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),n}_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 pa(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const n=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new Vc(Number(t)):new II(t)),!0):this._backTo(n)}_parseComplexPlaceholder(e){let t;const n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(n);const o=new Vc(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new pa("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else if(o.index>0&&this._accept(7)){const s=new HS;for(;;){if(this._parseChoiceElement(s)){if(this._accept(2))continue;if(this._accept(7)&&(o.appendChild(s),this._accept(4)))return e.appendChild(o),!0}return this._backTo(n),!1}}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(n),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(n)}_parseChoiceElement(e){const t=this._token,n=[];for(;!(this._token.type===2||this._token.type===7);){let r;if((r=this._accept(5,!0))?r=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||r:r=this._accept(void 0,!0),!r)return this._backTo(t),!1;n.push(r)}return n.length===0?(this._backTo(t),!1):(e.appendChild(new pa(n.join(""))),!0)}_parseComplexVariable(e){let t;const n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(n);const o=new II(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new pa("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(n),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(n)}_parseTransform(e){const t=new MY;let n="",r="";for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(6,!0)||o,n+=o;continue}if(this._token.type!==14){n+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(5,!0)||this._accept(6,!0)||o,t.appendChild(new pa(o));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){r+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(n,r)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let n=!1;this._accept(3)&&(n=!0);const r=this._accept(8,!0);if(r)if(n){if(this._accept(4))return e.appendChild(new Ad(Number(r))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new Ad(Number(r))),!0;else return this._backTo(t),!1;if(this._accept(6)){const o=this._accept(9,!0);return!o||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new Ad(Number(r),o)),!0)}else if(this._accept(11)){const o=this._until(4);if(o)return e.appendChild(new Ad(Number(r),void 0,o,void 0)),!0}else if(this._accept(12)){const o=this._until(4);if(o)return e.appendChild(new Ad(Number(r),void 0,void 0,o)),!0}else if(this._accept(13)){const o=this._until(1);if(o){const s=this._until(4);if(s)return e.appendChild(new Ad(Number(r),void 0,o,s)),!0}}else{const o=this._until(4);if(o)return e.appendChild(new Ad(Number(r),void 0,void 0,o)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new pa(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}function Gbe(i,e,t){var n,r,o,s;return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:(r=(n=t.additionalEdit)===null||n===void 0?void 0:n.edits)!==null&&r!==void 0?r:[]}:{edits:[...e.map(a=>new Sv(i,{range:a,text:typeof t.insertText=="string"?Hb.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...(s=(o=t.additionalEdit)===null||o===void 0?void 0:o.edits)!==null&&s!==void 0?s:[]]}}function qbe(i){var e;function t(a,l){return"providerId"in a&&a.providerId===l.providerId||"mimeType"in a&&a.mimeType===l.handledMimeType}const n=new Map;for(const a of i)for(const l of(e=a.yieldTo)!==null&&e!==void 0?e:[])for(const c of i)if(c!==a&&t(l,c)){let u=n.get(a);u||(u=[],n.set(a,u)),u.push(c)}if(!n.size)return Array.from(i);const r=new Set,o=[];function s(a){if(!a.length)return[];const l=a[0];if(o.includes(l))return console.warn(`Yield to cycle detected for ${l.providerId}`),a;if(r.has(l))return s(a.slice(1));let c=[];const u=n.get(l);return u&&(o.push(l),c=s(u),o.pop()),r.add(l),[...c,l,...s(a.slice(1))]}return s(Array.from(i))}var Att=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Ptt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Ott=sn.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:Wpe,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}});class R3 extends fe{constructor(e,t,n,r,o){super(),this.typeId=e,this.editor=t,this.range=n,this.delegate=o,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(r),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=He(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=He("span.icon");this.domNode.append(t),t.classList.add(...Wt.asClassNameArray(Xe.loading),"codicon-modifier-spin");const n=()=>{const r=this.editor.getOption(67);this.domNode.style.height=`${r}px`,this.domNode.style.width=`${Math.ceil(.8*r)}px`};n(),this._register(this.editor.onDidChangeConfiguration(r=>{(r.hasChanged(52)||r.hasChanged(67))&&n()})),this._register(ye(this.domNode,Ge.CLICK,r=>{this.delegate.cancel()}))}getId(){return R3.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[0]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}}R3.baseId="editor.widget.inlineProgressWidget";let uO=class extends fe{constructor(e,t,n){super(),this.id=e,this._editor=t,this._instantiationService=n,this._showDelay=500,this._showPromise=this._register(new Ho),this._currentWidget=new Ho,this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}async showWhile(e,t,n){const r=this._operationIdPool++;this._currentOperation=r,this.clear(),this._showPromise.value=Kv(()=>{const o=B.fromPositions(e);this._currentDecorations.set([{range:o,options:Ott}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(R3,this.id,this._editor,o,t,n))},this._showDelay);try{return await n}finally{this._currentOperation===r&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};uO=Att([Ptt(2,Ot)],uO);var Xbe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},NE=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Mz;let dO=Mz=class extends fe{constructor(e,t,n,r,o,s,a,l,c,u){super(),this.typeId=e,this.editor=t,this.showCommand=r,this.range=o,this.edits=s,this.onSelectNewEdit=a,this._contextMenuService=l,this._keybindingService=u,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=n.bindTo(c),this.visibleContext.set(!0),this._register(Rt(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(Rt(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(d=>{o.containsPosition(d.position)||this.dispose()})),this._register(Je.runAndSubscribe(u.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var e;const t=(e=this._keybindingService.lookupKeybinding(this.showCommand.id))===null||e===void 0?void 0:e.getLabel();this.button.element.title=this.showCommand.label+(t?` (${t})`:"")}create(){this.domNode=He(".post-edit-widget"),this.button=this._register(new QP(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(ye(this.domNode,Ge.CLICK,()=>this.showSelector()))}getId(){return Mz.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=Br(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>My({id:"",label:e.label,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}};dO.baseId="editor.widget.postEditWidget";dO=Mz=Xbe([NE(7,Ol),NE(8,Vt),NE(9,ci)],dO);let hO=class extends fe{constructor(e,t,n,r,o,s){super(),this._id=e,this._editor=t,this._visibleContext=n,this._showCommand=r,this._instantiationService=o,this._bulkEditService=s,this._currentWidget=this._register(new Ho),this._register(Je.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,n,r){const o=this._editor.getModel();if(!o||!e.length)return;const s=t.allEdits[t.activeEditIndex];if(!s)return;const a=Gbe(o.uri,e,s),l=e[0],c=o.deltaDecorations([],[{range:l,options:{description:"paste-line-suffix",stickiness:0}}]);let u,d;try{u=await this._bulkEditService.apply(a,{editor:this._editor,token:r}),d=o.getDecorationRange(c[0])}finally{o.deltaDecorations(c,[])}n&&u.isApplied&&t.allEdits.length>1&&this.show(d??l,t,async h=>{const f=this._editor.getModel();f&&(await f.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:h,allEdits:t.allEdits},n,r))})}show(e,t,n){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(dO,this._id,this._editor,this._visibleContext,this._showCommand,e,t,n))}clear(){this._currentWidget.clear()}tryShowSelector(){var e;(e=this._currentWidget.value)===null||e===void 0||e.showSelector()}};hO=Xbe([NE(4,Ot),NE(5,Xk)],hO);var Ftt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},pae=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},PM;let xa=PM=class{static get(e){return e.getContribution(PM.ID)}constructor(e,t,n){this._openerService=n,this._messageWidget=new Ho,this._messageListeners=new Te,this._mouseOverMessage=!1,this._editor=e,this._visible=PM.MESSAGE_VISIBLE.bindTo(t)}dispose(){var e;(e=this._message)===null||e===void 0||e.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){kl(Mf(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=Mf(e)?Y4(e,{actionHandler:{callback:r=>{this.closeMessage(),HX(this._openerService,r,Mf(e)?e.isTrusted:void 0)},disposables:this._messageListeners}}):void 0,this._messageWidget.value=new mae(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(Je.debounce(this._editor.onDidBlurEditorText,(r,o)=>o,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&es(fs(),this._messageWidget.value.getDomNode())||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(ye(this._messageWidget.value.getDomNode(),Ge.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(ye(this._messageWidget.value.getDomNode(),Ge.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let n;this._messageListeners.add(this._editor.onMouseMove(r=>{r.target.position&&(n?n.containsPosition(r.target.position)||this.closeMessage():n=new B(t.lineNumber-3,1,r.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(mae.fadeOut(this._messageWidget.value))}};xa.ID="editor.contrib.messageController";xa.MESSAGE_VISIBLE=new st("messageVisible",!1,w("messageVisible","Whether the editor is currently showing an inline message"));xa=PM=Ftt([pae(1,Vt),pae(2,al)],xa);const Btt=Vo.bindToContribution(xa.get);et(new Btt({id:"leaveEditorMessage",precondition:xa.MESSAGE_VISIBLE,handler:i=>i.closeMessage(),kbOpts:{weight:100+30,primary:9}}));let mae=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(n),e.getDomNode().removeEventListener("animationend",t)},n=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:n},r){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:n},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const o=document.createElement("div");o.classList.add("anchor","top"),this._domNode.appendChild(o);const s=document.createElement("div");typeof r=="string"?(s.classList.add("message"),s.textContent=r):(r.classList.add("message"),s.appendChild(r)),this._domNode.appendChild(s);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};jn(xa.ID,xa,4);var Wtt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},n1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Az;const Ybe="editor.changePasteType",Zbe=new st("pasteWidgetVisible",!1,w("pasteWidgetVisible","Whether the paste widget is showing")),w9="application/vnd.code.copyMetadata";let Np=Az=class extends fe{static get(e){return e.getContribution(Az.ID)}constructor(e,t,n,r,o,s,a){super(),this._bulkEditService=n,this._clipboardService=r,this._languageFeaturesService=o,this._quickInputService=s,this._progressService=a,this._editor=e;const l=e.getContainerDomNode();this._register(ye(l,"copy",c=>this.handleCopy(c))),this._register(ye(l,"cut",c=>this.handleCopy(c))),this._register(ye(l,"paste",c=>this.handlePaste(c),!0)),this._pasteProgressManager=this._register(new uO("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(hO,"pasteIntoEditor",e,Zbe,{id:Ybe,label:w("postPasteWidgetTitle","Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferredId:e},xS().execCommand("paste")}finally{this._pasteAsActionContext=void 0}}isPasteAsEnabled(){return this._editor.getOption(85).enabled&&!this._editor.getOption(91)}async finishedPaste(){await this._currentPasteOperation}handleCopy(e){var t,n;if(!this._editor.hasTextFocus()||(x_&&this._clipboardService.writeResources([]),!e.clipboardData||!this.isPasteAsEnabled()))return;const r=this._editor.getModel(),o=this._editor.getSelections();if(!r||!(o!=null&&o.length))return;const s=this._editor.getOption(37);let a=o;const l=o.length===1&&o[0].isEmpty();if(l){if(!s)return;a=[new B(a[0].startLineNumber,1,a[0].startLineNumber,1+r.getLineLength(a[0].startLineNumber))]}const c=(t=this._editor._getViewModel())===null||t===void 0?void 0:t.getPlainTextToCopy(o,s,Rs),d={multicursorText:Array.isArray(c)?c:null,pasteOnNewLine:l,mode:null},h=this._languageFeaturesService.documentPasteEditProvider.ordered(r).filter(m=>!!m.prepareDocumentPaste);if(!h.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:d});return}const f=Ube(e.clipboardData),g=h.flatMap(m=>{var _;return(_=m.copyMimeTypes)!==null&&_!==void 0?_:[]}),p=T3();this.setCopyMetadata(e.clipboardData,{id:p,providerCopyMimeTypes:g,defaultPastePayload:d});const v=Io(async m=>{const _=lh(await Promise.all(h.map(async y=>{try{return await y.prepareDocumentPaste(r,a,f,m)}catch(S){console.error(S);return}})));_.reverse();for(const y of _)for(const[S,L]of y)f.replace(S,L);return f});(n=this._currentCopyOperation)===null||n===void 0||n.dataTransferPromise.cancel(),this._currentCopyOperation={handle:p,dataTransferPromise:v}}async handlePaste(e){var t,n,r,o,s;if(!e.clipboardData||!this._editor.hasTextFocus())return;(t=xa.get(this._editor))===null||t===void 0||t.closeMessage(),(n=this._currentPasteOperation)===null||n===void 0||n.cancel(),this._currentPasteOperation=void 0;const a=this._editor.getModel(),l=this._editor.getSelections();if(!(l!=null&&l.length)||!a||!this.isPasteAsEnabled()&&!this._pasteAsActionContext)return;const c=this.fetchCopyMetadata(e),u=jbe(e.clipboardData);u.delete(w9);const d=[...e.clipboardData.types,...(r=c==null?void 0:c.providerCopyMimeTypes)!==null&&r!==void 0?r:[],Cr.uriList],h=this._languageFeaturesService.documentPasteEditProvider.ordered(a).filter(f=>{var g,p;return!((g=this._pasteAsActionContext)===null||g===void 0)&&g.preferredId&&this._pasteAsActionContext.preferredId!==f.id?!1:(p=f.pasteMimeTypes)===null||p===void 0?void 0:p.some(v=>Vbe(v,d))});if(!h.length){!((o=this._pasteAsActionContext)===null||o===void 0)&&o.preferredId&&this.showPasteAsNoEditMessage(l,(s=this._pasteAsActionContext)===null||s===void 0?void 0:s.preferredId);return}e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferredId,h,l,u,c,{trigger:"explicit",only:this._pasteAsActionContext.preferredId}):this.doPasteInline(h,l,u,c,{trigger:"implicit"})}showPasteAsNoEditMessage(e,t){var n;(n=xa.get(this._editor))===null||n===void 0||n.showMessage(w("pasteAsError","No paste edits for '{0}' found",t),e[0].getStartPosition())}doPasteInline(e,t,n,r,o){const s=Io(async a=>{const l=this._editor;if(!l.hasModel())return;const c=l.getModel(),u=new i_(l,3,void 0,a);try{if(await this.mergeInDataFromCopy(n,r,u.token),u.token.isCancellationRequested)return;const d=e.filter(f=>vae(f,n));if(!d.length||d.length===1&&d[0].id==="text"){await this.applyDefaultPasteHandler(n,r,u.token);return}const h=await this.getPasteEdits(d,n,c,t,o,u.token);if(u.token.isCancellationRequested)return;if(h.length===1&&h[0].providerId==="text"){await this.applyDefaultPasteHandler(n,r,u.token);return}if(h.length){const f=l.getOption(85).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:0,allEdits:h},f,u.token)}await this.applyDefaultPasteHandler(n,r,u.token)}finally{u.dispose(),this._currentPasteOperation===s&&(this._currentPasteOperation=void 0)}});this._pasteProgressManager.showWhile(t[0].getEndPosition(),w("pasteIntoEditorProgress","Running paste handlers. Click to cancel"),s),this._currentPasteOperation=s}showPasteAsPick(e,t,n,r,o,s){const a=Io(async l=>{const c=this._editor;if(!c.hasModel())return;const u=c.getModel(),d=new i_(c,3,void 0,l);try{if(await this.mergeInDataFromCopy(r,o,d.token),d.token.isCancellationRequested)return;let h=t.filter(v=>vae(v,r));e&&(h=h.filter(v=>v.id===e));const f=await this.getPasteEdits(h,r,u,n,s,d.token);if(d.token.isCancellationRequested)return;if(!f.length){s.only&&this.showPasteAsNoEditMessage(n,s.only);return}let g;if(e)g=f.at(0);else{const v=await this._quickInputService.pick(f.map(m=>({label:m.label,description:m.providerId,detail:m.detail,edit:m})),{placeHolder:w("pasteAsPickerPlaceholder","Select Paste Action")});g=v==null?void 0:v.edit}if(!g)return;const p=Gbe(u.uri,n,g);await this._bulkEditService.apply(p,{editor:this._editor})}finally{d.dispose(),this._currentPasteOperation===a&&(this._currentPasteOperation=void 0)}});this._progressService.withProgress({location:10,title:w("pasteAsProgress","Running paste handlers")},()=>a)}setCopyMetadata(e,t){e.setData(w9,JSON.stringify(t))}fetchCopyMetadata(e){var t;if(!e.clipboardData)return;const n=e.clipboardData.getData(w9);if(n)try{return JSON.parse(n)}catch{return}const[r,o]=MH.getTextData(e.clipboardData);if(o)return{defaultPastePayload:{mode:o.mode,multicursorText:(t=o.multicursorText)!==null&&t!==void 0?t:null,pasteOnNewLine:!!o.isFromEmptySelection}}}async mergeInDataFromCopy(e,t,n){var r;if(t!=null&&t.id&&((r=this._currentCopyOperation)===null||r===void 0?void 0:r.handle)===t.id){const o=await this._currentCopyOperation.dataTransferPromise;if(n.isCancellationRequested)return;for(const[s,a]of o)e.replace(s,a)}if(!e.has(Cr.uriList)){const o=await this._clipboardService.readResources();if(n.isCancellationRequested)return;o.length&&e.append(Cr.uriList,RY(N3.create(o)))}}async getPasteEdits(e,t,n,r,o,s){const a=await Rk(Promise.all(e.map(async c=>{var u;try{const d=await((u=c.provideDocumentPasteEdits)===null||u===void 0?void 0:u.call(c,n,r,t,o,s));if(d)return{...d,providerId:c.id}}catch(d){console.error(d)}})),s),l=lh(a??[]);return qbe(l)}async applyDefaultPasteHandler(e,t,n){var r,o,s;const a=(r=e.get(Cr.text))!==null&&r!==void 0?r:e.get("text");if(!a)return;const l=await a.asString();if(n.isCancellationRequested)return;const c={text:l,pasteOnNewLine:(o=t==null?void 0:t.defaultPastePayload.pasteOnNewLine)!==null&&o!==void 0?o:!1,multicursorText:(s=t==null?void 0:t.defaultPastePayload.multicursorText)!==null&&s!==void 0?s:null,mode:null};this._editor.trigger("keyboard","paste",c)}};Np.ID="editor.contrib.copyPasteActionController";Np=Az=Wtt([n1(1,Ot),n1(2,Xk),n1(3,jp),n1(4,_t),n1(5,Eh),n1(6,P_e)],Np);function vae(i,e){var t;return!!(!((t=i.pasteMimeTypes)===null||t===void 0)&&t.some(n=>e.matches(n)))}const Vb="9_cutcopypaste",$tt=Jd||document.queryCommandSupported("cut"),Qbe=Jd||document.queryCommandSupported("copy"),Htt=typeof navigator.clipboard>"u"||ru?document.queryCommandSupported("paste"):!0;function AY(i){return i.register(),i}const Vtt=$tt?AY(new ES({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:Jd?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:$.MenubarEditMenu,group:"2_ccp",title:w({key:"miCut",comment:["&& denotes a mnemonic"]},"Cu&&t"),order:1},{menuId:$.EditorContext,group:Vb,title:w("actions.clipboard.cutLabel","Cut"),when:j.writable,order:1},{menuId:$.CommandPalette,group:"",title:w("actions.clipboard.cutLabel","Cut"),order:1},{menuId:$.SimpleEditorContext,group:Vb,title:w("actions.clipboard.cutLabel","Cut"),when:j.writable,order:1}]})):void 0,ztt=Qbe?AY(new ES({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:Jd?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:$.MenubarEditMenu,group:"2_ccp",title:w({key:"miCopy",comment:["&& denotes a mnemonic"]},"&&Copy"),order:2},{menuId:$.EditorContext,group:Vb,title:w("actions.clipboard.copyLabel","Copy"),order:2},{menuId:$.CommandPalette,group:"",title:w("actions.clipboard.copyLabel","Copy"),order:1},{menuId:$.SimpleEditorContext,group:Vb,title:w("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;ts.appendMenuItem($.MenubarEditMenu,{submenu:$.MenubarCopy,title:$n("copy as","Copy As"),group:"2_ccp",order:3});ts.appendMenuItem($.EditorContext,{submenu:$.EditorContextCopy,title:$n("copy as","Copy As"),group:Vb,order:3});ts.appendMenuItem($.EditorContext,{submenu:$.EditorContextShare,title:$n("share","Share"),group:"11_share",order:-1,when:De.and(De.notEquals("resourceScheme","output"),j.editorTextFocus)});ts.appendMenuItem($.EditorTitleContext,{submenu:$.EditorTitleContextShare,title:$n("share","Share"),group:"11_share",order:-1});ts.appendMenuItem($.ExplorerContext,{submenu:$.ExplorerContextShare,title:$n("share","Share"),group:"11_share",order:-1});const S9=Htt?AY(new ES({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:Jd?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:$.MenubarEditMenu,group:"2_ccp",title:w({key:"miPaste",comment:["&& denotes a mnemonic"]},"&&Paste"),order:4},{menuId:$.EditorContext,group:Vb,title:w("actions.clipboard.pasteLabel","Paste"),when:j.writable,order:4},{menuId:$.CommandPalette,group:"",title:w("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:$.SimpleEditorContext,group:Vb,title:w("actions.clipboard.pasteLabel","Paste"),when:j.writable,order:4}]})):void 0;class Utt extends gt{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:w("actions.clipboard.copyWithSyntaxHighlightingLabel","Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:j.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(37)&&t.getSelection().isEmpty()||(NH.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),NH.forceCopyWithSyntaxHighlighting=!1)}}function Jbe(i,e){i&&(i.addImplementation(1e4,"code-editor",(t,n)=>{const r=t.get(Un).getFocusedCodeEditor();if(r&&r.hasTextFocus()){const o=r.getOption(37),s=r.getSelection();return s&&s.isEmpty()&&!o||r.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),i.addImplementation(0,"generic-dom",(t,n)=>(xS().execCommand(e),!0)))}Jbe(Vtt,"cut");Jbe(ztt,"copy");S9&&(S9.addImplementation(1e4,"code-editor",(i,e)=>{var t,n;const r=i.get(Un),o=i.get(jp),s=r.getFocusedCodeEditor();return s&&s.hasTextFocus()?s.getContainerDomNode().ownerDocument.execCommand("paste")?(n=(t=Np.get(s))===null||t===void 0?void 0:t.finishedPaste())!==null&&n!==void 0?n:Promise.resolve():x_?(async()=>{const l=await o.readText();if(l!==""){const c=jD.INSTANCE.get(l);let u=!1,d=null,h=null;c&&(u=s.getOption(37)&&!!c.isFromEmptySelection,d=typeof c.multicursorText<"u"?c.multicursorText:null,h=c.mode),s.trigger("keyboard","paste",{text:l,pasteOnNewLine:u,multicursorText:d,mode:h})}})():!0:!1}),S9.addImplementation(0,"generic-dom",(i,e)=>(xS().execCommand("paste"),!0)));Qbe&&Be(Utt);class Ut{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+Ut.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new Ut(this.value+Ut.sep+e)}}Ut.sep=".";Ut.None=new Ut("@@none@@");Ut.Empty=new Ut("");Ut.QuickFix=new Ut("quickfix");Ut.Refactor=new Ut("refactor");Ut.RefactorExtract=Ut.Refactor.append("extract");Ut.RefactorInline=Ut.Refactor.append("inline");Ut.RefactorMove=Ut.Refactor.append("move");Ut.RefactorRewrite=Ut.Refactor.append("rewrite");Ut.Notebook=new Ut("notebook");Ut.Source=new Ut("source");Ut.SourceOrganizeImports=Ut.Source.append("organizeImports");Ut.SourceFixAll=Ut.Source.append("fixAll");Ut.SurroundWith=Ut.Refactor.append("surround");var Tl;(function(i){i.Refactor="refactor",i.RefactorPreview="refactor preview",i.Lightbulb="lightbulb",i.Default="other (default)",i.SourceAction="source action",i.QuickFix="quick fix action",i.FixAll="fix all",i.OrganizeImports="organize imports",i.AutoFix="auto fix",i.QuickFixHover="quick fix hover window",i.OnSave="save participants",i.ProblemsView="problems view"})(Tl||(Tl={}));function jtt(i,e){return!(i.include&&!i.include.intersects(e)||i.excludes&&i.excludes.some(t=>eCe(e,t,i.include))||!i.includeSourceActions&&Ut.Source.contains(e))}function Ktt(i,e){const t=e.kind?new Ut(e.kind):void 0;return!(i.include&&(!t||!i.include.contains(t))||i.excludes&&t&&i.excludes.some(n=>eCe(t,n,i.include))||!i.includeSourceActions&&t&&Ut.Source.contains(t)||i.onlyIncludePreferredActions&&!e.isPreferred)}function eCe(i,e,t){return!(!e.contains(i)||t&&e.contains(t))}class _f{static fromUser(e,t){return!e||typeof e!="object"?new _f(t.kind,t.apply,!1):new _f(_f.getKindFromUser(e,t.kind),_f.getApplyFromUser(e,t.apply),_f.getPreferredUser(e))}static getApplyFromUser(e,t){switch(typeof e.apply=="string"?e.apply.toLowerCase():""){case"first":return"first";case"never":return"never";case"ifsingle":return"ifSingle";default:return t}}static getKindFromUser(e,t){return typeof e.kind=="string"?new Ut(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,n){this.kind=e,this.apply=t,this.preferred=n}}class Gtt{constructor(e,t,n){this.action=e,this.provider=t,this.highlightRange=n}async resolve(e){var t;if(!((t=this.provider)===null||t===void 0)&&t.resolveCodeAction&&!this.action.edit){let n;try{n=await this.provider.resolveCodeAction(this.action,e)}catch(r){Zr(r)}n&&(this.action.edit=n.edit)}return this}}const tCe="editor.action.codeAction",PY="editor.action.quickFix",nCe="editor.action.autoFix",iCe="editor.action.refactor",rCe="editor.action.sourceAction",OY="editor.action.organizeImports",FY="editor.action.fixAll";class RE extends fe{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return e.isAI&&!t.isAI?1:!e.isAI&&t.isAI?-1:Ts(e.diagnostics)?Ts(t.diagnostics)?RE.codeActionsPreferredComparator(e,t):-1:Ts(t.diagnostics)?1:RE.codeActionsPreferredComparator(e,t)}constructor(e,t,n){super(),this.documentation=t,this._register(n),this.allActions=[...e].sort(RE.codeActionsComparator),this.validActions=this.allActions.filter(({action:r})=>!r.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&Ut.QuickFix.contains(new Ut(e.kind))&&!!e.isPreferred)}get hasAIFix(){return this.validActions.some(({action:e})=>!!e.isAI)}get allAIFixes(){return this.validActions.every(({action:e})=>!!e.isAI)}}const _ae={actions:[],documentation:void 0};async function ME(i,e,t,n,r,o){var s;const a=n.filter||{},l={...a,excludes:[...a.excludes||[],Ut.Notebook]},c={only:(s=a.include)===null||s===void 0?void 0:s.value,trigger:n.type},u=new LY(e,o),d=n.type===2,h=qtt(i,e,d?l:a),f=new Te,g=h.map(async v=>{try{r.report(v);const m=await v.provideCodeActions(e,t,c,u.token);if(m&&f.add(m),u.token.isCancellationRequested)return _ae;const _=((m==null?void 0:m.actions)||[]).filter(S=>S&&Ktt(a,S)),y=Ytt(v,_,a.include);return{actions:_.map(S=>new Gtt(S,v)),documentation:y}}catch(m){if(wh(m))throw m;return Zr(m),_ae}}),p=i.onDidChange(()=>{const v=i.all(e);or(v,h)||u.cancel()});try{const v=await Promise.all(g),m=v.map(y=>y.actions).flat(),_=[...lh(v.map(y=>y.documentation)),...Xtt(i,e,n,m)];return new RE(m,_,f)}finally{p.dispose(),u.dispose()}}function qtt(i,e,t){return i.all(e).filter(n=>n.providedCodeActionKinds?n.providedCodeActionKinds.some(r=>jtt(t,new Ut(r))):!0)}function*Xtt(i,e,t,n){var r,o,s;if(e&&n.length)for(const a of i.all(e))a._getAdditionalMenuItems&&(yield*(r=a._getAdditionalMenuItems)===null||r===void 0?void 0:r.call(a,{trigger:t.type,only:(s=(o=t.filter)===null||o===void 0?void 0:o.include)===null||s===void 0?void 0:s.value},n.map(l=>l.action)))}function Ytt(i,e,t){if(!i.documentation)return;const n=i.documentation.map(r=>({kind:new Ut(r.kind),command:r.command}));if(t){let r;for(const o of n)o.kind.contains(t)&&(r?r.kind.contains(o.kind)&&(r=o):r=o);if(r)return r==null?void 0:r.command}for(const r of e)if(r.kind){for(const o of n)if(o.kind.contains(new Ut(r.kind)))return o.command}}var Jy;(function(i){i.OnSave="onSave",i.FromProblemsView="fromProblemsView",i.FromCodeActions="fromCodeActions",i.FromAILightbulb="fromAILightbulb"})(Jy||(Jy={}));async function Ztt(i,e,t,n,r=Cn.None){var o;const s=i.get(Xk),a=i.get(sr),l=i.get(ea),c=i.get($r);if(l.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),await e.resolve(r),!r.isCancellationRequested&&!(!((o=e.action.edit)===null||o===void 0)&&o.edits.length&&!(await s.apply(e.action.edit,{editor:n==null?void 0:n.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==Jy.OnSave,showPreview:n==null?void 0:n.preview})).isApplied)&&e.action.command)try{await a.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(u){const d=Qtt(u);c.error(typeof d=="string"?d:w("applyCodeActionFailed","An unknown error occurred while applying the code action"))}}function Qtt(i){return typeof i=="string"?i:i instanceof Error&&typeof i.message=="string"?i.message:void 0}Dn.registerCommand("_executeCodeActionProvider",async function(i,e,t,n,r){if(!(e instanceof At))throw eu();const{codeActionProvider:o}=i.get(_t),s=i.get(tr).getModel(e);if(!s)throw eu();const a=yt.isISelection(t)?yt.liftSelection(t):B.isIRange(t)?s.validateRange(t):void 0;if(!a)throw eu();const l=typeof n=="string"?new Ut(n):void 0,c=await ME(o,s,a,{type:1,triggerAction:Tl.Default,filter:{includeSourceActions:!0,include:l}},mp.None,Cn.None),u=[],d=Math.min(c.validActions.length,typeof r=="number"?r:0);for(let h=0;hh.action)}finally{setTimeout(()=>c.dispose(),100)}});var Jtt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ent=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Pz;let fO=Pz=class{constructor(e){this.keybindingService=e}getResolver(){const e=new Qf(()=>this.keybindingService.getKeybindings().filter(t=>Pz.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let n=t.commandArgs;return t.command===OY?n={kind:Ut.SourceOrganizeImports.value}:t.command===FY&&(n={kind:Ut.SourceFixAll.value}),{resolvedKeybinding:t.resolvedKeybinding,..._f.fromUser(n,{kind:Ut.None,apply:"never"})}}));return t=>{if(t.kind){const n=this.bestKeybindingForCodeAction(t,e.value);return n==null?void 0:n.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const n=new Ut(e.kind);return t.filter(r=>r.kind.contains(n)).filter(r=>r.preferred?e.isPreferred:!0).reduceRight((r,o)=>r?r.kind.contains(o.kind)?o:r:o,void 0)}};fO.codeActionCommands=[iCe,tCe,rCe,OY,FY];fO=Pz=Jtt([ent(0,ci)],fO);X("symbolIcon.arrayForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.booleanForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},w("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.colorForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.constantForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},w("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},w("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},w("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.fileForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.folderForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},w("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.keyForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.keywordForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},w("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.moduleForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.namespaceForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.nullForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.numberForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.objectForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.operatorForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.packageForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.propertyForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.referenceForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.snippetForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.stringForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.structForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.textForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.typeParameterForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.unitForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const oCe=Object.freeze({kind:Ut.Empty,title:w("codeAction.widget.id.more","More Actions...")}),tnt=Object.freeze([{kind:Ut.QuickFix,title:w("codeAction.widget.id.quickfix","Quick Fix")},{kind:Ut.RefactorExtract,title:w("codeAction.widget.id.extract","Extract"),icon:Xe.wrench},{kind:Ut.RefactorInline,title:w("codeAction.widget.id.inline","Inline"),icon:Xe.wrench},{kind:Ut.RefactorRewrite,title:w("codeAction.widget.id.convert","Rewrite"),icon:Xe.wrench},{kind:Ut.RefactorMove,title:w("codeAction.widget.id.move","Move"),icon:Xe.wrench},{kind:Ut.SurroundWith,title:w("codeAction.widget.id.surround","Surround With"),icon:Xe.surroundWith},{kind:Ut.Source,title:w("codeAction.widget.id.source","Source Action"),icon:Xe.symbolFile},oCe]);function nnt(i,e,t){if(!e)return i.map(o=>{var s;return{kind:"action",item:o,group:oCe,disabled:!!o.action.disabled,label:o.action.disabled||o.action.title,canPreview:!!(!((s=o.action.edit)===null||s===void 0)&&s.edits.length)}});const n=tnt.map(o=>({group:o,actions:[]}));for(const o of i){const s=o.action.kind?new Ut(o.action.kind):Ut.None;for(const a of n)if(a.group.kind.contains(s)){a.actions.push(o);break}}const r=[];for(const o of n)if(o.actions.length){r.push({kind:"header",group:o.group});for(const s of o.actions){const a=o.group;r.push({kind:"action",item:s,group:s.action.isAI?{title:a.title,kind:a.kind,icon:Xe.sparkle}:a,label:s.action.title,disabled:!!s.action.disabled,keybinding:t(s.action)})}}return r}var int=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},bae=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Oz,_y;(function(i){i.Hidden={type:0};class e{constructor(n,r,o,s){this.actions=n,this.trigger=r,this.editorPosition=o,this.widgetPosition=s,this.type=1}}i.Showing=e})(_y||(_y={}));let zb=Oz=class extends fe{constructor(e,t,n){super(),this._editor=e,this._keybindingService=t,this._onClick=this._register(new se),this.onClick=this._onClick.event,this._state=_y.Hidden,this._iconClasses=[],this._domNode=He("div.lightBulbWidget"),this._register(wi.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(r=>{const o=this._editor.getModel();(this.state.type!==1||!o||this.state.editorPosition.lineNumber>=o.getLineCount())&&this.hide()})),this._register(GBe(this._domNode,r=>{if(this.state.type!==1)return;this._editor.focus(),r.preventDefault();const{top:o,height:s}=Br(this._domNode),a=this._editor.getOption(67);let l=Math.floor(a/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber{(r.buttons&1)===1&&this.hide()})),this._register(Je.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{var r,o,s,a;this._preferredKbLabel=(o=(r=this._keybindingService.lookupKeybinding(nCe))===null||r===void 0?void 0:r.getLabel())!==null&&o!==void 0?o:void 0,this._quickFixKbLabel=(a=(s=this._keybindingService.lookupKeybinding(PY))===null||s===void 0?void 0:s.getLabel())!==null&&a!==void 0?a:void 0,this._updateLightBulbTitleAndIcon()}))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return this._state.type===1?this._state.widgetPosition:null}update(e,t,n){if(e.validActions.length<=0)return this.hide();if(!this._editor.getOptions().get(65).enabled)return this.hide();const o=this._editor.getModel();if(!o)return this.hide();const{lineNumber:s,column:a}=o.validatePosition(n),l=o.getOptions().tabSize,c=this._editor.getOptions().get(50),u=o.getLineContent(s),d=H4(u,l),h=c.spaceWidth*d>22,f=v=>v>2&&this._editor.getTopForLineNumber(v)===this._editor.getTopForLineNumber(v-1);let g=s,p=1;if(!h){if(s>1&&!f(s-1))g-=1;else if(s=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Fz=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const aCe="acceptSelectedCodeAction",lCe="previewSelectedCodeAction";class rnt{get templateId(){return"header"}renderTemplate(e){e.classList.add("group-header");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,n){var r,o;n.text.textContent=(o=(r=e.group)===null||r===void 0?void 0:r.title)!==null&&o!==void 0?o:""}disposeTemplate(e){}}let Bz=class{get templateId(){return"action"}constructor(e,t){this._supportsPreview=e,this._keybindingService=t}renderTemplate(e){e.classList.add(this.templateId);const t=document.createElement("div");t.className="icon",e.append(t);const n=document.createElement("span");n.className="title",e.append(n);const r=new PS(e,yl);return{container:e,icon:t,text:n,keybinding:r}}renderElement(e,t,n){var r,o,s;if(!((r=e.group)===null||r===void 0)&&r.icon?(n.icon.className=Wt.asClassName(e.group.icon),e.group.icon.color&&(n.icon.style.color=ht(e.group.icon.color.id))):(n.icon.className=Wt.asClassName(Xe.lightBulb),n.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;n.text.textContent=cCe(e.label),n.keybinding.set(e.keybinding),l8e(!!e.keybinding,n.keybinding.element);const a=(o=this._keybindingService.lookupKeybinding(aCe))===null||o===void 0?void 0:o.getLabel(),l=(s=this._keybindingService.lookupKeybinding(lCe))===null||s===void 0?void 0:s.getLabel();n.container.classList.toggle("option-disabled",e.disabled),e.disabled?n.container.title=e.label:a&&l?this._supportsPreview&&e.canPreview?n.container.title=w({key:"label-preview",comment:['placeholders are keybindings, e.g "F2 to apply, Shift+F2 to preview"']},"{0} to apply, {1} to preview",a,l):n.container.title=w({key:"label",comment:['placeholder is a keybinding, e.g "F2 to apply"']},"{0} to apply",a):n.container.title=""}disposeTemplate(e){}};Bz=sCe([Fz(1,ci)],Bz);class ont extends UIEvent{constructor(){super("acceptSelectedAction")}}class Cae extends UIEvent{constructor(){super("previewSelectedAction")}}function snt(i){if(i.kind==="action")return i.label}let Wz=class extends fe{constructor(e,t,n,r,o,s){super(),this._delegate=r,this._contextViewService=o,this._keybindingService=s,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new wr),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const a={getHeight:l=>l.kind==="header"?this._headerLineHeight:this._actionLineHeight,getTemplateId:l=>l.kind};this._list=this._register(new wc(e,this.domNode,a,[new Bz(t,this._keybindingService),new rnt],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:snt},accessibilityProvider:{getAriaLabel:l=>{if(l.kind==="action"){let c=l.label?cCe(l==null?void 0:l.label):"";return l.disabled&&(c=w({key:"customQuickFixWidget.labels",comment:["Action widget labels for accessibility."]},"{0}, Disabled Reason: {1}",c,l.disabled)),c}return null},getWidgetAriaLabel:()=>w({key:"customQuickFixWidget",comment:["An action widget option"]},"Action Widget"),getRole:l=>l.kind==="action"?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(R_),this._register(this._list.onMouseClick(l=>this.onListClick(l))),this._register(this._list.onMouseOver(l=>this.onListHover(l))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(l=>this.onListSelection(l))),this._allMenuItems=n,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(e){return!e.disabled&&e.kind==="action"}hide(e){this._delegate.onHide(e),this.cts.cancel(),this._contextViewService.hideContextView()}layout(e){const t=this._allMenuItems.filter(l=>l.kind==="header").length,r=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(r);let o=e;if(this._allMenuItems.length>=50)o=380;else{const l=this._allMenuItems.map((c,u)=>{const d=this.domNode.ownerDocument.getElementById(this._list.getElementID(u));if(d){d.style.width="auto";const h=d.getBoundingClientRect().width;return d.style.width="",h}return 0});o=Math.max(...l,e)}const s=.7,a=Math.min(r,this.domNode.ownerDocument.body.clientHeight*s);return this._list.layout(a,o),this.domNode.style.height=`${a}px`,this._list.domFocus(),o}focusPrevious(){this._list.focusPrevious(1,!0,void 0,this.focusCondition)}focusNext(){this._list.focusNext(1,!0,void 0,this.focusCondition)}acceptSelected(e){const t=this._list.getFocus();if(t.length===0)return;const n=t[0],r=this._list.element(n);if(!this.focusCondition(r))return;const o=e?new Cae:new ont;this._list.setSelection([n],o)}onListSelection(e){if(!e.elements.length)return;const t=e.elements[0];t.item&&this.focusCondition(t)?this._delegate.onSelect(t.item,e.browserEvent instanceof Cae):this._list.setSelection([])}onFocus(){var e,t;const n=this._list.getFocus();if(n.length===0)return;const r=n[0],o=this._list.element(r);(t=(e=this._delegate).onFocus)===null||t===void 0||t.call(e,o.item)}async onListHover(e){const t=e.element;if(t&&t.item&&this.focusCondition(t)){if(this._delegate.onHover&&!t.disabled&&t.kind==="action"){const n=await this._delegate.onHover(t.item,this.cts.token);t.canPreview=n?n.canPreview:void 0}e.index&&this._list.splice(e.index,1,[t])}this._list.setFocus(typeof e.index=="number"?[e.index]:[])}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};Wz=sCe([Fz(4,ng),Fz(5,ci)],Wz);function cCe(i){return i.replace(/\r\n|\r|\n/g," ")}var ant=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},x9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};X("actionBar.toggledBackground",{dark:W0,light:W0,hcDark:W0,hcLight:W0},w("actionBar.toggledBackground","Background color for toggled action items in action bar."));const Ub={Visible:new st("codeActionMenuVisible",!1,w("codeActionMenuVisible","Whether the action widget list is visible"))},CC=yn("actionWidgetService");let jb=class extends fe{get isVisible(){return Ub.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,n){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=n,this._list=this._register(new Ho)}show(e,t,n,r,o,s,a){const l=Ub.Visible.bindTo(this._contextKeyService),c=this._instantiationService.createInstance(Wz,e,t,n,r);this._contextViewService.showContextView({getAnchor:()=>o,render:u=>(l.set(!0),this._renderWidget(u,c,a??[])),onHide:u=>{l.reset(),this._onWidgetClosed(u)}},s,!1)}acceptSelected(e){var t;(t=this._list.value)===null||t===void 0||t.acceptSelected(e)}focusPrevious(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusPrevious()}focusNext(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusNext()}hide(){var e;(e=this._list.value)===null||e===void 0||e.hide(),this._list.clear()}_renderWidget(e,t,n){var r;const o=document.createElement("div");if(o.classList.add("action-widget"),e.appendChild(o),this._list.value=t,this._list.value)o.appendChild(this._list.value.domNode);else throw new Error("List has no value");const s=new Te,a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-block"),s.add(ye(l,Ge.MOUSE_DOWN,g=>g.stopPropagation()));const c=document.createElement("div"),u=e.appendChild(c);u.classList.add("context-view-pointerBlock"),s.add(ye(u,Ge.POINTER_MOVE,()=>u.remove())),s.add(ye(u,Ge.MOUSE_DOWN,()=>u.remove()));let d=0;if(n.length){const g=this._createActionBar(".action-widget-action-bar",n);g&&(o.appendChild(g.getContainer().parentElement),s.add(g),d=g.getContainer().offsetWidth)}const h=(r=this._list.value)===null||r===void 0?void 0:r.layout(d);o.style.width=`${h}px`;const f=s.add(dh(e));return s.add(f.onDidBlur(()=>this.hide())),s}_createActionBar(e,t){if(!t.length)return;const n=He(e),r=new au(n);return r.push(t,{icon:!1,label:!0}),r}_onWidgetClosed(e){var t;(t=this._list.value)===null||t===void 0||t.hide(e)}};jb=ant([x9(0,ng),x9(1,Vt),x9(2,Ot)],jb);In(CC,jb,1);const cT=100+1e3;Ei(class extends sl{constructor(){super({id:"hideCodeActionWidget",title:$n("hideCodeActionWidget.title","Hide action widget"),precondition:Ub.Visible,keybinding:{weight:cT,primary:9,secondary:[1033]}})}run(i){i.get(CC).hide()}});Ei(class extends sl{constructor(){super({id:"selectPrevCodeAction",title:$n("selectPrevCodeAction.title","Select previous action"),precondition:Ub.Visible,keybinding:{weight:cT,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(i){const e=i.get(CC);e instanceof jb&&e.focusPrevious()}});Ei(class extends sl{constructor(){super({id:"selectNextCodeAction",title:$n("selectNextCodeAction.title","Select next action"),precondition:Ub.Visible,keybinding:{weight:cT,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(i){const e=i.get(CC);e instanceof jb&&e.focusNext()}});Ei(class extends sl{constructor(){super({id:aCe,title:$n("acceptSelected.title","Accept selected action"),precondition:Ub.Visible,keybinding:{weight:cT,primary:3,secondary:[2137]}})}run(i){const e=i.get(CC);e instanceof jb&&e.acceptSelected()}});Ei(class extends sl{constructor(){super({id:lCe,title:$n("previewSelected.title","Preview selected action"),precondition:Ub.Visible,keybinding:{weight:cT,primary:2051}})}run(i){const e=i.get(CC);e instanceof jb&&e.acceptSelected(!0)}});const uCe=new st("supportedCodeAction",""),yae="_typescript.applyFixAllCodeAction";class lnt extends fe{constructor(e,t,n,r=250){super(),this._editor=e,this._markerService=t,this._signalChange=n,this._delay=r,this._autoTriggerTimer=this._register(new cd),this._register(this._markerService.onMarkerChanged(o=>this._onMarkerChanges(o))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some(n=>hX(n,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:Tl.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getSelection();if(e.type===1)return t;const n=this._editor.getOption(65).enabled;if(n!==Fu.Off){{if(n===Fu.On)return t;if(n===Fu.OnCode){if(!t.isEmpty())return t;const o=this._editor.getModel(),{lineNumber:s,column:a}=t.getPosition(),l=o.getLineContent(s);if(l.length===0)return;if(a===1){if(/\s/.test(l[0]))return}else if(a===o.getLineMaxColumn(s)){if(/\s/.test(l[l.length-1]))return}else if(/\s/.test(l[a-2])&&/\s/.test(l[a-1]))return}}return t}}}var N0;(function(i){i.Empty={type:0};class e{constructor(n,r,o){this.trigger=n,this.position=r,this._cancellablePromise=o,this.type=1,this.actions=o.catch(s=>{if(wh(s))return dCe;throw s})}cancel(){this._cancellablePromise.cancel()}}i.Triggered=e})(N0||(N0={}));const dCe=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1});class cnt extends fe{constructor(e,t,n,r,o,s){super(),this._editor=e,this._registry=t,this._markerService=n,this._progressService=o,this._configurationService=s,this._codeActionOracle=this._register(new Ho),this._state=N0.Empty,this._onDidChangeState=this._register(new se),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=uCe.bindTo(r),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._register(this._editor.onDidChangeConfiguration(a=>{a.hasChanged(65)&&this._update()})),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(N0.Empty,!0))}_settingEnabledNearbyQuickfixes(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes",{resource:t==null?void 0:t.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(N0.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(91)){const t=this._registry.all(e).flatMap(n=>{var r;return(r=n.providedCodeActionKinds)!==null&&r!==void 0?r:[]});this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new lnt(this._editor,this._markerService,n=>{var r;if(!n){this.setState(N0.Empty);return}const o=n.selection.getStartPosition(),s=Io(async a=>{var l,c,u,d,h,f,g,p,v,m;if(this._settingEnabledNearbyQuickfixes()&&n.trigger.type===1&&(n.trigger.triggerAction===Tl.QuickFix||!((c=(l=n.trigger.filter)===null||l===void 0?void 0:l.include)===null||c===void 0)&&c.contains(Ut.QuickFix))){const _=await ME(this._registry,e,n.selection,n.trigger,mp.None,a),y=[..._.allActions];if(a.isCancellationRequested)return dCe;const S=(u=_.validActions)===null||u===void 0?void 0:u.some(E=>E.action.kind?Ut.QuickFix.contains(new Ut(E.action.kind)):!1),L=this._markerService.read({resource:e.uri});if(S){for(const E of _.validActions)!((h=(d=E.action.command)===null||d===void 0?void 0:d.arguments)===null||h===void 0)&&h.some(D=>typeof D=="string"&&D.includes(yae))&&(E.action.diagnostics=[...L.filter(D=>D.relatedInformation)]);return{validActions:_.validActions,allActions:y,documentation:_.documentation,hasAutoFix:_.hasAutoFix,hasAIFix:_.hasAIFix,allAIFixes:_.allAIFixes,dispose:()=>{_.dispose()}}}else if(!S&&L.length>0){const E=n.selection.getPosition();let D=E,k=Number.MAX_VALUE;const T=[..._.validActions];for(const A of L){const N=A.endColumn,R=A.endLineNumber,F=A.startLineNumber;if(R===E.lineNumber||F===E.lineNumber){D=new ae(R,N);const W={type:n.trigger.type,triggerAction:n.trigger.triggerAction,filter:{include:!((f=n.trigger.filter)===null||f===void 0)&&f.include?(g=n.trigger.filter)===null||g===void 0?void 0:g.include:Ut.QuickFix},autoApply:n.trigger.autoApply,context:{notAvailableMessage:((p=n.trigger.context)===null||p===void 0?void 0:p.notAvailableMessage)||"",position:D}},H=new yt(D.lineNumber,D.column,D.lineNumber,D.column),G=await ME(this._registry,e,H,W,mp.None,a);if(G.validActions.length!==0){for(const U of G.validActions)!((m=(v=U.action.command)===null||v===void 0?void 0:v.arguments)===null||m===void 0)&&m.some(K=>typeof K=="string"&&K.includes(yae))&&(U.action.diagnostics=[...L.filter(K=>K.relatedInformation)]);_.allActions.length===0&&y.push(...G.allActions),Math.abs(E.column-N)R.findIndex(F=>F.action.title===A.action.title)===N);return M.sort((A,N)=>A.action.isPreferred&&!N.action.isPreferred?-1:!A.action.isPreferred&&N.action.isPreferred||A.action.isAI&&!N.action.isAI?1:!A.action.isAI&&N.action.isAI?-1:0),{validActions:M,allActions:y,documentation:_.documentation,hasAutoFix:_.hasAutoFix,hasAIFix:_.hasAIFix,allAIFixes:_.allAIFixes,dispose:()=>{_.dispose()}}}}return ME(this._registry,e,n.selection,n.trigger,mp.None,a)});n.trigger.type===1&&((r=this._progressService)===null||r===void 0||r.showWhile(s,250)),this.setState(new N0.Triggered(n.trigger,o,s))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:Tl.Default})}else this._supportedCodeActions.reset()}trigger(e){var t;(t=this._codeActionOracle.value)===null||t===void 0||t.trigger(e)}setState(e,t){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}}var unt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},_g=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},T1;const dnt="quickfix-edit-highlight";let r_=T1=class extends fe{static get(e){return e.getContribution(T1.ID)}constructor(e,t,n,r,o,s,a,l,c,u){super(),this._commandService=a,this._configurationService=l,this._actionWidgetService=c,this._instantiationService=u,this._activeCodeActions=this._register(new Ho),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new cnt(this._editor,o.codeActionProvider,t,n,s,l)),this._register(this._model.onDidChangeState(d=>this.update(d))),this._lightBulbWidget=new Qf(()=>{const d=this._editor.getContribution(zb.ID);return d&&this._register(d.onClick(h=>this.showCodeActionsFromLightbulb(h.actions,h))),d}),this._resolver=r.createInstance(fO),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}async showCodeActionsFromLightbulb(e,t){if(e.allAIFixes&&e.validActions.length===1){const n=e.validActions[0],r=n.action.command;r&&r.id==="inlineChat.start"&&r.arguments&&r.arguments.length>=1&&(r.arguments[0]={...r.arguments[0],autoSend:!1}),await this._applyCodeAction(n,!1,!1,Jy.FromAILightbulb);return}await this.showCodeActionList(e,t,{includeDisabledActions:!1,fromLightbulb:!0})}showCodeActions(e,t,n){return this.showCodeActionList(t,n,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,n,r){var o;if(!this._editor.hasModel())return;(o=xa.get(this._editor))===null||o===void 0||o.closeMessage();const s=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:n,autoApply:r,context:{notAvailableMessage:e,position:s}})}_trigger(e){return this._model.trigger(e)}async _applyCodeAction(e,t,n,r){try{await this._instantiationService.invokeFunction(Ztt,e,r,{preview:n,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:Tl.QuickFix,filter:{}})}}async update(e){var t,n,r,o,s,a,l;if(e.type!==1){(t=this._lightBulbWidget.rawValue)===null||t===void 0||t.hide();return}let c;try{c=await e.actions}catch(u){en(u);return}if(!this._disposed)if((n=this._lightBulbWidget.value)===null||n===void 0||n.update(c,e.trigger,e.position),e.trigger.type===1){if(!((r=e.trigger.filter)===null||r===void 0)&&r.include){const d=this.tryGetValidActionToApply(e.trigger,c);if(d){try{(o=this._lightBulbWidget.value)===null||o===void 0||o.hide(),await this._applyCodeAction(d,!1,!1,Jy.FromCodeActions)}finally{c.dispose()}return}if(e.trigger.context){const h=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,c);if(h&&h.action.disabled){(s=xa.get(this._editor))===null||s===void 0||s.showMessage(h.action.disabled,e.trigger.context.position),c.dispose();return}}}const u=!!(!((a=e.trigger.filter)===null||a===void 0)&&a.include);if(e.trigger.context&&(!c.allActions.length||!u&&!c.validActions.length)){(l=xa.get(this._editor))===null||l===void 0||l.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=c,c.dispose();return}this._activeCodeActions.value=c,this.showCodeActionList(c,this.toCoords(e.position),{includeDisabledActions:u,fromLightbulb:!1})}else this._actionWidgetService.isVisible?c.dispose():this._activeCodeActions.value=c}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length&&(e.autoApply==="first"&&t.validActions.length===0||e.autoApply==="ifSingle"&&t.allActions.length===1))return t.allActions.find(({action:n})=>n.disabled)}tryGetValidActionToApply(e,t){if(t.validActions.length&&(e.autoApply==="first"&&t.validActions.length>0||e.autoApply==="ifSingle"&&t.validActions.length===1))return t.validActions[0]}async showCodeActionList(e,t,n){const r=this._editor.createDecorationsCollection(),o=this._editor.getDomNode();if(!o)return;const s=n.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!s.length)return;const a=ae.isIPosition(t)?this.toCoords(t):t,l={onSelect:async(c,u)=>{this._applyCodeAction(c,!0,!!u,Jy.FromCodeActions),this._actionWidgetService.hide(),r.clear()},onHide:()=>{var c;(c=this._editor)===null||c===void 0||c.focus(),r.clear()},onHover:async(c,u)=>{var d;if(!u.isCancellationRequested)return{canPreview:!!(!((d=c.action.edit)===null||d===void 0)&&d.edits.length)}},onFocus:c=>{var u,d;if(c&&c.action){const h=c.action.ranges,f=c.action.diagnostics;if(r.clear(),h&&h.length>0){const g=f&&(f==null?void 0:f.length)>1?f.map(p=>({range:p,options:T1.DECORATION})):h.map(p=>({range:p,options:T1.DECORATION}));r.set(g)}else if(f&&f.length>0){const g=f.map(v=>({range:v,options:T1.DECORATION}));r.set(g);const p=f[0];if(p.startLineNumber&&p.startColumn){const v=(d=(u=this._editor.getModel())===null||u===void 0?void 0:u.getWordAtPosition({lineNumber:p.startLineNumber,column:p.startColumn}))===null||d===void 0?void 0:d.word;Hf(w("editingNewSelection","Context: {0} at line {1} and column {2}.",v,p.startLineNumber,p.startColumn))}}}else r.clear()}};this._actionWidgetService.show("codeActionWidget",!0,nnt(s,this._shouldShowHeaders(),this._resolver.getResolver()),l,a,o,this._getActionBarActions(e,t,n))}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),n=Br(this._editor.getDomNode()),r=n.left+t.left,o=n.top+t.top+t.height;return{x:r,y:o}}_shouldShowHeaders(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:t==null?void 0:t.uri})}_getActionBarActions(e,t,n){if(n.fromLightbulb)return[];const r=e.documentation.map(o=>{var s;return{id:o.id,label:o.title,tooltip:(s=o.tooltip)!==null&&s!==void 0?s:"",class:void 0,enabled:!0,run:()=>{var a;return this._commandService.executeCommand(o.id,...(a=o.arguments)!==null&&a!==void 0?a:[])}}});return n.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&r.push(this._showDisabled?{id:"hideMoreActions",label:w("hideMoreActions","Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,n))}:{id:"showMoreActions",label:w("showMoreActions","Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,n))}),r}};r_.ID="editor.contrib.codeActionController";r_.DECORATION=sn.register({description:"quickfix-highlight",className:dnt});r_=T1=unt([_g(1,ig),_g(2,Vt),_g(3,Ot),_g(4,_t),_g(5,T_),_g(6,sr),_g(7,gn),_g(8,CC),_g(9,Ot)],r_);fu((i,e)=>{((r,o)=>{o&&e.addRule(`.monaco-editor ${r} { background-color: ${o}; }`)})(".quickfix-edit-highlight",i.getColor(ep));const n=i.getColor(Gm);n&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${ih(i.type)?"dotted":"solid"} ${n}; box-sizing: border-box; }`)});function uT(i){return De.regex(uCe.keys()[0],new RegExp("(\\s|^)"+fc(i.value)+"\\b"))}const BY={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:w("args.schema.kind","Kind of the code action to run.")},apply:{type:"string",description:w("args.schema.apply","Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[w("args.schema.apply.first","Always apply the first returned code action."),w("args.schema.apply.ifSingle","Apply the first returned code action if it is the only one."),w("args.schema.apply.never","Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:w("args.schema.preferred","Controls if only preferred code actions should be returned.")}}};function yC(i,e,t,n,r=Tl.Default){if(i.hasModel()){const o=r_.get(i);o==null||o.manualTriggerAtCurrentPosition(e,r,t,n)}}class hnt extends gt{constructor(){super({id:PY,label:w("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:De.and(j.writable,j.hasCodeActionsProvider),kbOpts:{kbExpr:j.textInputFocus,primary:2137,weight:100}})}run(e,t){return yC(t,w("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0,Tl.QuickFix)}}class fnt extends Vo{constructor(){super({id:tCe,precondition:De.and(j.writable,j.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:BY}]}})}runEditorCommand(e,t,n){const r=_f.fromUser(n,{kind:Ut.Empty,apply:"ifSingle"});return yC(t,typeof(n==null?void 0:n.kind)=="string"?r.preferred?w("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",n.kind):w("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",n.kind):r.preferred?w("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):w("editor.action.codeAction.noneMessage","No code actions available"),{include:r.kind,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply)}}class gnt extends gt{constructor(){super({id:iCe,label:w("refactor.label","Refactor..."),alias:"Refactor...",precondition:De.and(j.writable,j.hasCodeActionsProvider),kbOpts:{kbExpr:j.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:De.and(j.writable,uT(Ut.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:BY}]}})}run(e,t,n){const r=_f.fromUser(n,{kind:Ut.Refactor,apply:"never"});return yC(t,typeof(n==null?void 0:n.kind)=="string"?r.preferred?w("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",n.kind):w("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",n.kind):r.preferred?w("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):w("editor.action.refactor.noneMessage","No refactorings available"),{include:Ut.Refactor.contains(r.kind)?r.kind:Ut.None,onlyIncludePreferredActions:r.preferred},r.apply,Tl.Refactor)}}class pnt extends gt{constructor(){super({id:rCe,label:w("source.label","Source Action..."),alias:"Source Action...",precondition:De.and(j.writable,j.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:De.and(j.writable,uT(Ut.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:BY}]}})}run(e,t,n){const r=_f.fromUser(n,{kind:Ut.Source,apply:"never"});return yC(t,typeof(n==null?void 0:n.kind)=="string"?r.preferred?w("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",n.kind):w("editor.action.source.noneMessage.kind","No source actions for '{0}' available",n.kind):r.preferred?w("editor.action.source.noneMessage.preferred","No preferred source actions available"):w("editor.action.source.noneMessage","No source actions available"),{include:Ut.Source.contains(r.kind)?r.kind:Ut.None,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply,Tl.SourceAction)}}class mnt extends gt{constructor(){super({id:OY,label:w("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:De.and(j.writable,uT(Ut.SourceOrganizeImports)),kbOpts:{kbExpr:j.textInputFocus,primary:1581,weight:100}})}run(e,t){return yC(t,w("editor.action.organize.noneMessage","No organize imports action available"),{include:Ut.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",Tl.OrganizeImports)}}class vnt extends gt{constructor(){super({id:FY,label:w("fixAll.label","Fix All"),alias:"Fix All",precondition:De.and(j.writable,uT(Ut.SourceFixAll))})}run(e,t){return yC(t,w("fixAll.noneMessage","No fix all action available"),{include:Ut.SourceFixAll,includeSourceActions:!0},"ifSingle",Tl.FixAll)}}class _nt extends gt{constructor(){super({id:nCe,label:w("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:De.and(j.writable,uT(Ut.QuickFix)),kbOpts:{kbExpr:j.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return yC(t,w("editor.action.autoFix.noneMessage","No auto fixes available"),{include:Ut.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",Tl.AutoFix)}}jn(r_.ID,r_,3);jn(zb.ID,zb,4);Be(hnt);Be(gnt);Be(pnt);Be(mnt);Be(_nt);Be(vnt);et(new fnt);ar.as(xh.Configuration).registerConfiguration({...Z4,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:w("showCodeActionHeaders","Enable/disable showing group headers in the Code Action menu."),default:!0}}});ar.as(xh.Configuration).registerConfiguration({...Z4,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:"boolean",scope:5,description:w("includeNearbyQuickFixes","Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),default:!0}}});class $z{constructor(){this.lenses=[],this._disposables=new Te}dispose(){this._disposables.dispose()}get isDisposed(){return this._disposables.isDisposed}add(e,t){this._disposables.add(e);for(const n of e.lenses)this.lenses.push({symbol:n,provider:t})}}async function hCe(i,e,t){const n=i.ordered(e),r=new Map,o=new $z,s=n.map(async(a,l)=>{r.set(a,l);try{const c=await Promise.resolve(a.provideCodeLenses(e,t));c&&o.add(c,a)}catch(c){Zr(c)}});return await Promise.all(s),o.lenses=o.lenses.sort((a,l)=>a.symbol.range.startLineNumberl.symbol.range.startLineNumber?1:r.get(a.provider)r.get(l.provider)?1:a.symbol.range.startColumnl.symbol.range.startColumn?1:0),o}Dn.registerCommand("_executeCodeLensProvider",function(i,...e){let[t,n]=e;Xn(At.isUri(t)),Xn(typeof n=="number"||!n);const{codeLensProvider:r}=i.get(_t),o=i.get(tr).getModel(t);if(!o)throw eu();const s=[],a=new Te;return hCe(r,o,Cn.None).then(l=>{a.add(l);const c=[];for(const u of l.lenses)n==null||u.symbol.command?s.push(u.symbol):n-- >0&&u.provider.resolveCodeLens&&c.push(Promise.resolve(u.provider.resolveCodeLens(o,u.symbol,Cn.None)).then(d=>s.push(d||u.symbol)));return Promise.all(c)}).then(()=>s).finally(()=>{setTimeout(()=>a.dispose(),100)})});var bnt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Cnt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const fCe=yn("ICodeLensCache");class wae{constructor(e,t){this.lineCount=e,this.data=t}}let Hz=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new D_(20,.75);const t="codelens/cache";yL(hi,()=>e.remove(t,1));const n="codelens/cache2",r=e.get(n,1,"{}");this._deserialize(r),Je.once(e.onWillSaveState)(o=>{o.reason===cI.SHUTDOWN&&e.store(n,this._serialize(),1,1)})}put(e,t){const n=t.lenses.map(s=>{var a;return{range:s.symbol.range,command:s.symbol.command&&{id:"",title:(a=s.symbol.command)===null||a===void 0?void 0:a.title}}}),r=new $z;r.add({lenses:n,dispose:()=>{}},this._fakeProvider);const o=new wae(e.getLineCount(),r);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,n]of this._cache){const r=new Set;for(const o of n.data.lenses)r.add(o.symbol.range.startLineNumber);e[t]={lineCount:n.lineCount,lines:[...r.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const n in t){const r=t[n],o=[];for(const a of r.lines)o.push({range:new B(a,1,a,11)});const s=new $z;s.add({lenses:o,dispose(){}},this._fakeProvider),this._cache.set(n,new wae(r.lineCount,s))}}catch{}}};Hz=bnt([Cnt(0,dd)],Hz);In(fCe,Hz,1);class ynt{constructor(e,t,n){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=n,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}}class kI{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${kI._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const n=[];let r=!1;for(let o=0;o{c.symbol.command&&l.push(c.symbol),n.addDecoration({range:c.symbol.range,options:Sae},d=>this._decorationIds[u]=d),a?a=B.plusRange(a,c.symbol.range):a=B.lift(c.symbol.range)}),this._viewZone=new ynt(a.startLineNumber-1,o,s),this._viewZoneId=r.addZone(this._viewZone),l.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(l,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new kI(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t==null||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 n=this._editor.getModel().getDecorationRange(e),r=this._data[t].symbol;return!!(n&&B.isEmpty(r.range)===n.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((n,r)=>{t.addDecoration({range:n.symbol.range,options:Sae},o=>this._decorationIds[r]=o)})}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--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Xx=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Jw=class{constructor(e,t,n,r,o,s){this._editor=e,this._languageFeaturesService=t,this._commandService=r,this._notificationService=o,this._codeLensCache=s,this._disposables=new Te,this._localToDispose=new Te,this._lenses=[],this._oldCodeLensModels=new Te,this._provideCodeLensDebounce=n.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=n.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new pi(()=>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(a=>{(a.hasChanged(50)||a.hasChanged(19)||a.hasChanged(18))&&this._updateLensStyle(),a.hasChanged(17)&&this._onModelChange()})),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){var e;this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),(e=this._currentCodeLensModel)===null||e===void 0||e.dispose()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(67)/this._editor.getOption(52));let t=this._editor.getOption(19);return(!t||t<5)&&(t=this._editor.getOption(52)*.9|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),n=this._editor.getOption(18),r=this._editor.getOption(50),{style:o}=this._editor.getContainerDomNode();o.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),o.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),o.setProperty("--vscode-editorCodeLens-fontFeatureSettings",r.fontFeatureSettings),n&&(o.setProperty("--vscode-editorCodeLens-fontFamily",n),o.setProperty("--vscode-editorCodeLens-fontFamilyDefault",Qa.fontFamily)),this._editor.changeViewZones(s=>{for(const a of this._lenses)a.updateHeight(e,s)})}_localDispose(){var e,t,n;(e=this._getCodeLensModelPromise)===null||e===void 0||e.cancel(),this._getCodeLensModelPromise=void 0,(t=this._resolveCodeLensesPromise)===null||t===void 0||t.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),(n=this._currentCodeLensModel)===null||n===void 0||n.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e||!this._editor.getOption(17)||e.isTooLargeForTokenization())return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&Kv(()=>{const r=this._codeLensCache.get(e);t===r&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3,this._localToDispose);return}for(const r of this._languageFeaturesService.codeLensProvider.all(e))if(typeof r.onDidChange=="function"){const o=r.onDidChange(()=>n.schedule());this._localToDispose.add(o)}const n=new pi(()=>{var r;const o=Date.now();(r=this._getCodeLensModelPromise)===null||r===void 0||r.cancel(),this._getCodeLensModelPromise=Io(s=>hCe(this._languageFeaturesService.codeLensProvider,e,s)),this._getCodeLensModelPromise.then(s=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=s,this._codeLensCache.put(e,s);const a=this._provideCodeLensDebounce.update(e,Date.now()-o);n.delay=a,this._renderCodeLensSymbols(s),this._resolveCodeLensesInViewportSoon()},en)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(n),this._localToDispose.add(Rt(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{var r;this._editor.changeDecorations(o=>{this._editor.changeViewZones(s=>{const a=[];let l=-1;this._lenses.forEach(u=>{!u.isValid()||l===u.getLineNumber()?a.push(u):(u.update(s),l=u.getLineNumber())});const c=new L9;a.forEach(u=>{u.dispose(c,s),this._lenses.splice(this._lenses.indexOf(u),1)}),c.commit(o)})}),n.schedule(),this._resolveCodeLensesScheduler.cancel(),(r=this._resolveCodeLensesPromise)===null||r===void 0||r.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorWidget(()=>{n.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{n.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(r=>{r.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(Rt(()=>{if(this._editor.getModel()){const r=_h.capture(this._editor);this._editor.changeDecorations(o=>{this._editor.changeViewZones(s=>{this._disposeAllLenses(o,s)})}),r.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(r=>{if(r.target.type!==9)return;let o=r.target.element;if((o==null?void 0:o.tagName)==="SPAN"&&(o=o.parentElement),(o==null?void 0:o.tagName)==="A")for(const s of this._lenses){const a=s.getCommand(o);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),n.schedule()}_disposeAllLenses(e,t){const n=new L9;for(const r of this._lenses)r.dispose(n,t);e&&n.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),n=[];let r;for(const a of e.lenses){const l=a.symbol.range.startLineNumber;l<1||l>t||(r&&r[r.length-1].symbol.range.startLineNumber===l?r.push(a):(r=[a],n.push(r)))}if(!n.length&&!this._lenses.length)return;const o=_h.capture(this._editor),s=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const c=new L9;let u=0,d=0;for(;dthis._resolveCodeLensesInViewportSoon())),u++,d++)}for(;uthis._resolveCodeLensesInViewportSoon())),d++;c.commit(a)})}),o.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var e;(e=this._resolveCodeLensesPromise)===null||e===void 0||e.cancel(),this._resolveCodeLensesPromise=void 0;const t=this._editor.getModel();if(!t)return;const n=[],r=[];if(this._lenses.forEach(a=>{const l=a.computeIfNecessary(t);l&&(n.push(l),r.push(a))}),n.length===0)return;const o=Date.now(),s=Io(a=>{const l=n.map((c,u)=>{const d=new Array(c.length),h=c.map((f,g)=>!f.symbol.command&&typeof f.provider.resolveCodeLens=="function"?Promise.resolve(f.provider.resolveCodeLens(t,f.symbol,a)).then(p=>{d[g]=p},Zr):(d[g]=f.symbol,Promise.resolve(void 0)));return Promise.all(h).then(()=>{!a.isCancellationRequested&&!r[u].isDisposed()&&r[u].updateCommands(d)})});return Promise.all(l)});this._resolveCodeLensesPromise=s,this._resolveCodeLensesPromise.then(()=>{const a=this._resolveCodeLensesDebounce.update(t,Date.now()-o);this._resolveCodeLensesScheduler.delay=a,this._currentCodeLensModel&&this._codeLensCache.put(t,this._currentCodeLensModel),this._oldCodeLensModels.clear(),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},a=>{en(a),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){var e;return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,!((e=this._currentCodeLensModel)===null||e===void 0)&&e.isDisposed?void 0:this._currentCodeLensModel}};Jw.ID="css.editor.codeLens";Jw=wnt([Xx(1,_t),Xx(2,gu),Xx(3,sr),Xx(4,$r),Xx(5,fCe)],Jw);jn(Jw.ID,Jw,1);Be(class extends gt{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:j.hasCodeLensProvider,label:w("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}async run(e,t){if(!t.hasModel())return;const n=e.get(Eh),r=e.get(sr),o=e.get($r),s=t.getSelection().positionLineNumber,a=t.getContribution(Jw.ID);if(!a)return;const l=await a.getModel();if(!l)return;const c=[];for(const h of l.lenses)h.symbol.command&&h.symbol.range.startLineNumber===s&&c.push({label:h.symbol.command.title,command:h.symbol.command});if(c.length===0)return;const u=await n.pick(c,{canPickMany:!1,placeHolder:w("placeHolder","Select a command")});if(!u)return;let d=u.command;if(l.isDisposed){const h=await a.getModel(),f=h==null?void 0:h.lenses.find(g=>{var p;return g.symbol.range.startLineNumber===s&&((p=g.symbol.command)===null||p===void 0?void 0:p.title)===d.title});if(!f||!f.symbol.command)return;d=f.symbol.command}try{await r.executeCommand(d.id,...d.arguments||[])}catch(h){o.error(h)}}});var Snt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},E9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class WY{constructor(e,t){this._editorWorkerClient=new Vq(e,!1,"editorWorkerService",t)}async provideDocumentColors(e,t){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,n){const r=t.range,o=t.color,s=o.alpha,a=new me(new Tn(Math.round(255*o.red),Math.round(255*o.green),Math.round(255*o.blue),s)),l=s?me.Format.CSS.formatRGB(a):me.Format.CSS.formatRGBA(a),c=s?me.Format.CSS.formatHSL(a):me.Format.CSS.formatHSLA(a),u=s?me.Format.CSS.formatHex(a):me.Format.CSS.formatHexA(a),d=[];return d.push({label:l,textEdit:{range:r,text:l}}),d.push({label:c,textEdit:{range:r,text:c}}),d.push({label:u,textEdit:{range:r,text:u}}),d}}let Vz=class extends fe{constructor(e,t,n){super(),this._register(n.colorProvider.register("*",new WY(e,t)))}};Vz=Snt([E9(0,tr),E9(1,Di),E9(2,_t)],Vz);nT(Vz);async function gCe(i,e,t,n=!0){return $Y(new xnt,i,e,t,n)}function pCe(i,e,t,n){return Promise.resolve(t.provideColorPresentations(i,e,n))}class xnt{constructor(){}async compute(e,t,n,r){const o=await e.provideDocumentColors(t,n);if(Array.isArray(o))for(const s of o)r.push({colorInfo:s,provider:e});return Array.isArray(o)}}class Lnt{constructor(){}async compute(e,t,n,r){const o=await e.provideDocumentColors(t,n);if(Array.isArray(o))for(const s of o)r.push({range:s.range,color:[s.color.red,s.color.green,s.color.blue,s.color.alpha]});return Array.isArray(o)}}class Ent{constructor(e){this.colorInfo=e}async compute(e,t,n,r){const o=await e.provideColorPresentations(t,this.colorInfo,Cn.None);return Array.isArray(o)&&r.push(...o),Array.isArray(o)}}async function $Y(i,e,t,n,r){let o=!1,s;const a=[],l=e.ordered(t);for(let c=l.length-1;c>=0;c--){const u=l[c];if(u instanceof WY)s=u;else try{await i.compute(u,t,n,a)&&(o=!0)}catch(d){Zr(d)}}return o?a:s&&r?(await i.compute(s,t,n,a),a):[]}function mCe(i,e){const{colorProvider:t}=i.get(_t),n=i.get(tr).getModel(e);if(!n)throw eu();const r=i.get(gn).getValue("editor.defaultColorDecorators",{resource:e});return{model:n,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:r}}Dn.registerCommand("_executeDocumentColorProvider",function(i,...e){const[t]=e;if(!(t instanceof At))throw eu();const{model:n,colorProviderRegistry:r,isDefaultColorDecoratorsEnabled:o}=mCe(i,t);return $Y(new Lnt,r,n,Cn.None,o)});Dn.registerCommand("_executeColorPresentationProvider",function(i,...e){const[t,n]=e,{uri:r,range:o}=n;if(!(r instanceof At)||!Array.isArray(t)||t.length!==4||!B.isIRange(o))throw eu();const{model:s,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=mCe(i,r),[c,u,d,h]=t;return $Y(new Ent({range:o,color:{red:c,green:u,blue:d,alpha:h}}),a,s,Cn.None,l)});var Dnt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},D9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},zz;const vCe=Object.create({});let o_=zz=class extends fe{constructor(e,t,n,r){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=n,this._localToDispose=this._register(new Te),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new Wk(this._editor),this._decoratorLimitReporter=new Int,this._colorDecorationClassRefs=this._register(new Te),this._debounceInformation=r.for(n.colorProvider,"Document Colors",{min:zz.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(n.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(o=>{const s=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(146);const a=s!==this._isColorDecoratorsEnabled||o.hasChanged(21),l=o.hasChanged(146);(a||l)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(146),this.updateColors()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),n=this._configurationService.getValue(t);if(n&&typeof n=="object"){const r=n.colorDecorators;if(r&&r.enable!==void 0&&!r.enable)return r.enable}return this._editor.getOption(20)}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}updateColors(){if(this.stop(),!this._isColorDecoratorsEnabled)return;const e=this._editor.getModel();!e||!this._languageFeaturesService.colorProvider.has(e)||(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new cd,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=Io(async e=>{const t=this._editor.getModel();if(!t)return[];const n=new Ms(!1),r=await gCe(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,n.elapsed()),r});try{const e=await this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){en(e)}}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(n=>({range:{startLineNumber:n.colorInfo.range.startLineNumber,startColumn:n.colorInfo.range.startColumn,endLineNumber:n.colorInfo.range.endLineNumber,endColumn:n.colorInfo.range.endColumn},options:sn.EMPTY}));this._editor.changeDecorations(n=>{this._decorationsIds=n.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((r,o)=>this._colorDatas.set(r,e[o]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],n=this._editor.getOption(21);for(let o=0;othis._colorDatas.has(r.id));return n.length===0?null:this._colorDatas.get(n[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};o_.ID="editor.contrib.colorDetector";o_.RECOMPUTE_TIME=1e3;o_=zz=Dnt([D9(1,gn),D9(2,_t),D9(3,gu)],o_);class Int{constructor(){this._onDidChange=new se,this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}jn(o_.ID,o_,1);class knt{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)}constructor(e,t,n){this.presentationIndex=n,this._onColorFlushed=new se,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new se,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new se,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){let n=-1;for(let r=0;r{this.backgroundColor=s.getColor(oP)||me.white})),this._register(ye(this._pickedColorNode,Ge.CLICK,()=>this.model.selectNextColorPresentation())),this._register(ye(this._originalColorNode,Ge.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=me.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),this.showingStandaloneColorPicker&&(this._domNode.classList.add("standalone-colorpicker"),this._closeButton=this._register(new Nnt(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=me.Format.CSS.format(e)||"",this._pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this._pickedColorPresentation.textContent=this.model.presentation?this.model.presentation.label:""}}class Nnt extends fe{constructor(e){super(),this._onClicked=this._register(new se),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),ke(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),ke(this._button,t),ke(t,oc(".button"+Wt.asCSSSelector(Mr("color-picker-close",Xe.close,w("closeIcon","Icon to close the color picker"))))).classList.add("close-icon"),this._register(ye(this._button,Ge.CLICK,()=>{this._onClicked.fire()}))}}class Rnt extends fe{constructor(e,t,n,r=!1){super(),this.model=t,this.pixelRatio=n,this._insertButton=null,this._domNode=oc(".colorpicker-body"),ke(e,this._domNode),this._saturationBox=new Mnt(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 Ant(this._domNode,this.model,r),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new Pnt(this._domNode,this.model,r),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),r&&(this._insertButton=this._register(new Ont(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const n=this.model.color.hsva;this.model.color=new me(new bf(n.h,e,t,n.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new me(new bf(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,n=(1-e)*360;this.model.color=new me(new bf(n===360?0:n,t.s,t.v,t.a))}get domNode(){return this._domNode}get saturationBox(){return this._saturationBox}get enterButton(){return this._insertButton}layout(){this._saturationBox.layout(),this._opacityStrip.layout(),this._hueStrip.layout()}}class Mnt extends fe{constructor(e,t,n){super(),this.model=t,this.pixelRatio=n,this._onDidChange=new se,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new se,this.onColorFlushed=this._onColorFlushed.event,this._domNode=oc(".saturation-wrap"),ke(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",ke(this._domNode,this._canvas),this.selection=oc(".saturation-selection"),ke(this._domNode,this.selection),this.layout(),this._register(ye(this._domNode,Ge.POINTER_DOWN,r=>this.onPointerDown(r))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}get domNode(){return this._domNode}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;this.monitor=this._register(new kS);const t=Br(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>this.onDidChangePosition(r.pageX-t.left,r.pageY-t.top),()=>null);const n=ye(e.target.ownerDocument,Ge.POINTER_UP,()=>{this._onColorFlushed.fire(),n.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const n=Math.max(0,Math.min(1,e/this.width)),r=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(n,r),this._onDidChange.fire({s:n,v:r})}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 me(new bf(e.h,1,1,1)),n=this._canvas.getContext("2d"),r=n.createLinearGradient(0,0,this._canvas.width,0);r.addColorStop(0,"rgba(255, 255, 255, 1)"),r.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),r.addColorStop(1,"rgba(255, 255, 255, 0)");const o=n.createLinearGradient(0,0,0,this._canvas.height);o.addColorStop(0,"rgba(0, 0, 0, 0)"),o.addColorStop(1,"rgba(0, 0, 0, 1)"),n.rect(0,0,this._canvas.width,this._canvas.height),n.fillStyle=me.Format.CSS.format(t),n.fill(),n.fillStyle=r,n.fill(),n.fillStyle=o,n.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${this.height-t*this.height}px`}onDidChangeColor(e){if(this.monitor&&this.monitor.isMonitoring())return;this.paint();const t=e.hsva;this.paintSelection(t.s,t.v)}}class _Ce extends fe{constructor(e,t,n=!1){super(),this.model=t,this._onDidChange=new se,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new se,this.onColorFlushed=this._onColorFlushed.event,n?(this.domNode=ke(e,oc(".standalone-strip")),this.overlay=ke(this.domNode,oc(".standalone-overlay"))):(this.domNode=ke(e,oc(".strip")),this.overlay=ke(this.domNode,oc(".overlay"))),this.slider=ke(this.domNode,oc(".slider")),this.slider.style.top="0px",this._register(ye(this.domNode,Ge.POINTER_DOWN,r=>this.onPointerDown(r))),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onDidChangeColor(e){const t=this.getValue(e);this.updateSliderPosition(t)}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._register(new kS),n=Br(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,o=>this.onDidChangeTop(o.pageY-n.top),()=>null);const r=ye(e.target.ownerDocument,Ge.POINTER_UP,()=>{this._onColorFlushed.fire(),r.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 Ant extends _Ce{constructor(e,t,n=!1){super(e,t,n),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);const{r:t,g:n,b:r}=e.rgba,o=new me(new Tn(t,n,r,1)),s=new me(new Tn(t,n,r,0));this.overlay.style.background=`linear-gradient(to bottom, ${o} 0%, ${s} 100%)`}getValue(e){return e.hsva.a}}class Pnt extends _Ce{constructor(e,t,n=!1){super(e,t,n),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class Ont extends fe{constructor(e){super(),this._onClicked=this._register(new se),this.onClicked=this._onClicked.event,this._button=ke(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._register(ye(this._button,Ge.CLICK,()=>{this._onClicked.fire()}))}get button(){return this._button}}class Fnt extends yc{constructor(e,t,n,r,o=!1){super(),this.model=t,this.pixelRatio=n,this._register(ID.getInstance(Pt(e)).onDidChange(()=>this.layout()));const s=oc(".colorpicker-widget");e.appendChild(s),this.header=this._register(new Tnt(s,this.model,r,o)),this.body=this._register(new Rnt(s,this.model,this.pixelRatio,o))}layout(){this.body.layout()}}var bCe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},CCe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class Bnt{constructor(e,t,n,r){this.owner=e,this.range=t,this.model=n,this.provider=r,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let gO=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,n){return Kr.fromPromise(this._computeAsync(e,t,n))}async _computeAsync(e,t,n){if(!this._editor.hasModel())return[];const r=o_.get(this._editor);if(!r)return[];for(const o of t){if(!r.isColorDecoration(o))continue;const s=r.getColorData(o.range.getStartPosition());if(s)return[await yCe(this,this._editor.getModel(),s.colorInfo,s.provider)]}return[]}renderHoverParts(e,t){return wCe(this,this._editor,this._themeService,t,e)}};gO=bCe([CCe(1,To)],gO);class Wnt{constructor(e,t,n,r){this.owner=e,this.range=t,this.model=n,this.provider=r}}let TI=class{constructor(e,t){this._editor=e,this._themeService=t,this._color=null}async createColorHover(e,t,n){if(!this._editor.hasModel()||!o_.get(this._editor))return null;const o=await gCe(n,this._editor.getModel(),Cn.None);let s=null,a=null;for(const d of o){const h=d.colorInfo;B.containsRange(h.range,e.range)&&(s=h,a=d.provider)}const l=s??e,c=a??t,u=!!s;return{colorHover:await yCe(this,this._editor.getModel(),l,c),foundInEditor:u}}async updateEditorModel(e){if(!this._editor.hasModel())return;const t=e.model;let n=new B(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(await OM(this._editor.getModel(),t,this._color,n,e),n=SCe(this._editor,n,t))}renderHoverParts(e,t){return wCe(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};TI=bCe([CCe(1,To)],TI);async function yCe(i,e,t,n){const r=e.getValueInRange(t.range),{red:o,green:s,blue:a,alpha:l}=t.color,c=new Tn(Math.round(o*255),Math.round(s*255),Math.round(a*255),l),u=new me(c),d=await pCe(e,t,n,Cn.None),h=new knt(u,[],0);return h.colorPresentations=d||[],h.guessColorPresentation(u,r),i instanceof gO?new Bnt(i,B.lift(t.range),h,n):new Wnt(i,B.lift(t.range),h,n)}function wCe(i,e,t,n,r){if(n.length===0||!e.hasModel())return fe.None;if(r.setMinimumDimensions){const h=e.getOption(67)+8;r.setMinimumDimensions(new Kn(302,h))}const o=new Te,s=n[0],a=e.getModel(),l=s.model,c=o.add(new Fnt(r.fragment,l,e.getOption(142),t,i instanceof TI));r.setColorPicker(c);let u=!1,d=new B(s.range.startLineNumber,s.range.startColumn,s.range.endLineNumber,s.range.endColumn);if(i instanceof TI){const h=n[0].model.color;i.color=h,OM(a,l,h,d,s),o.add(l.onColorFlushed(f=>{i.color=f}))}else o.add(l.onColorFlushed(async h=>{await OM(a,l,h,d,s),u=!0,d=SCe(e,d,l)}));return o.add(l.onDidChangeColor(h=>{OM(a,l,h,d,s)})),o.add(e.onDidChangeModelContent(h=>{u?u=!1:(r.hide(),e.focus())})),o}function SCe(i,e,t){var n,r;const o=[],s=(n=t.presentation.textEdit)!==null&&n!==void 0?n:{range:e,text:t.presentation.label,forceMoveMarkers:!1};o.push(s),t.presentation.additionalTextEdits&&o.push(...t.presentation.additionalTextEdits);const a=B.lift(s.range),l=i.getModel()._setTrackedRange(null,a,3);return i.executeEdits("colorpicker",o),i.pushUndoStop(),(r=i.getModel()._getTrackedRange(l))!==null&&r!==void 0?r:a}async function OM(i,e,t,n,r){const o=await pCe(i,{range:n,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},r.provider,Cn.None);e.colorPresentations=o||[]}function Uz(i,e){return!!i[e]}class I9{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=Uz(e.event,t.triggerModifier),this.hasSideBySideModifier=Uz(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class Lae{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=Uz(e,t.triggerModifier)}}class KR{constructor(e,t,n,r){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=n,this.triggerSideBySideModifier=r}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function Eae(i){return i==="altKey"?Ln?new KR(57,"metaKey",6,"altKey"):new KR(5,"ctrlKey",6,"altKey"):Ln?new KR(6,"altKey",57,"metaKey"):new KR(6,"altKey",5,"ctrlKey")}class M3 extends fe{constructor(e,t){var n;super(),this._onMouseMoveOrRelevantKeyDown=this._register(new se),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new se),this.onExecute=this._onExecute.event,this._onCancel=this._register(new se),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=(n=t==null?void 0:t.extractLineNumberFromMouseEvent)!==null&&n!==void 0?n:r=>r.target.position?r.target.position.lineNumber:0,this._opts=Eae(this._editor.getOption(78)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(r=>{if(r.hasChanged(78)){const o=Eae(this._editor.getOption(78));if(this._opts.equals(o))return;this._opts=o,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(r=>this._onEditorMouseMove(new I9(r,this._opts)))),this._register(this._editor.onMouseDown(r=>this._onEditorMouseDown(new I9(r,this._opts)))),this._register(this._editor.onMouseUp(r=>this._onEditorMouseUp(new I9(r,this._opts)))),this._register(this._editor.onKeyDown(r=>this._onEditorKeyDown(new Lae(r,this._opts)))),this._register(this._editor.onKeyUp(r=>this._onEditorKeyUp(new Lae(r,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(r=>this._onDidChangeCursorSelection(r))),this._register(this._editor.onDidChangeModel(r=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(r=>{(r.scrollTopChanged||r.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=this._extractLineNumberFromMouseEvent(e)}_onEditorMouseUp(e){const t=this._extractLineNumberFromMouseEvent(e);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 $nt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},bg=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let s_=class extends $w{constructor(e,t,n,r,o,s,a,l,c,u,d,h,f){super(e,{...r.getRawOptions(),overflowWidgetsDomNode:r.getOverflowWidgetsDomNode()},n,o,s,a,l,c,u,d,h,f),this._parentEditor=r,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(r.onDidChangeConfiguration(g=>this._onParentConfigurationChanged(g)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){r4(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};s_=$nt([bg(4,Ot),bg(5,Un),bg(6,sr),bg(7,Vt),bg(8,To),bg(9,$r),bg(10,ud),bg(11,Di),bg(12,_t)],s_);const Dae=new me(new Tn(0,122,204)),Hnt={showArrow:!0,showFrame:!0,className:"",frameColor:Dae,arrowColor:Dae,keepEditorSelection:!1},Vnt="vs.editor.contrib.zoneWidget";class znt{constructor(e,t,n,r,o,s,a,l){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=n,this.heightInLines=r,this.showInHiddenAreas=a,this.ordinal=l,this._onDomNodeTop=o,this._onComputedHeight=s}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class Unt{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}let xCe=class LCe{constructor(e){this._editor=e,this._ruleName=LCe._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),aH(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(){aH(this._ruleName),qA(`.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){e.column===1&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:B.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}};xCe._IdGenerator=new WX(".arrow-decoration-");class jnt{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new Te,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=Mg(t),r4(this.options,Hnt,!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(n=>{const r=this._getWidth(n);this.domNode.style.width=r+"px",this.domNode.style.left=this._getLeft(n)+"px",this._onWidth(r)}))}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._positionMarkerId.clear(),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 xCe(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){const e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){const e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){var t;if(this.domNode.style.height=`${e}px`,this.container){const n=e-this._decoratingElementsHeight();this.container.style.height=`${n}px`;const r=this.editor.getLayoutInfo();this._doLayout(n,this._getWidth(r))}(t=this._resizeSash)===null||t===void 0||t.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,t){const n=B.isIRange(e)?B.lift(e):B.fromPositions(e);this._isShowing=!0,this._showImpl(n,t),this._isShowing=!1,this._positionMarkerId.set([{range:n,options:sn.EMPTY}])}hide(){var e;this._viewZone&&(this.editor.changeViewZones(t=>{this._viewZone&&t.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),(e=this._arrow)===null||e===void 0||e.hide(),this._positionMarkerId.clear()}_decoratingElementsHeight(){const e=this.editor.getOption(67);let t=0;if(this.options.showArrow){const n=Math.round(e/3);t+=2*n}if(this.options.showFrame){const n=Math.round(e/9);t+=2*n}return t}_showImpl(e,t){const n=e.getStartPosition(),r=this.editor.getLayoutInfo(),o=this._getWidth(r);this.domNode.style.width=`${o}px`,this.domNode.style.left=this._getLeft(r)+"px";const s=document.createElement("div");s.style.overflow="hidden";const a=this.editor.getOption(67);if(!this.options.allowUnlimitedHeight){const h=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,h)}let l=0,c=0;if(this._arrow&&this.options.showArrow&&(l=Math.round(a/3),this._arrow.height=l,this._arrow.show(n)),this.options.showFrame&&(c=Math.round(a/9)),this.editor.changeViewZones(h=>{this._viewZone&&h.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new znt(s,n.lineNumber,n.column,t,f=>this._onViewZoneTop(f),f=>this._onViewZoneHeight(f),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=h.addZone(this._viewZone),this._overlayWidget=new Unt(Vnt+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const h=this.options.frameWidth?this.options.frameWidth:c;this.container.style.borderTopWidth=h+"px",this.container.style.borderBottomWidth=h+"px"}const u=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=u+"px",this.container.style.overflow="hidden"),this._doLayout(u,o),this.options.keepEditorSelection||this.editor.setSelection(e);const d=this.editor.getModel();if(d){const h=d.validateRange(new B(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(h,h.startLineNumber===d.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,0):this.editor.revealRange(e,0)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e){this._viewZone&&this._viewZone.heightInLines!==e&&this.editor.changeViewZones(t=>{this._viewZone&&(this._viewZone.heightInLines=e,t.layoutZone(this._viewZone.id))})}_initSash(){if(this._resizeSash)return;this._resizeSash=this._disposables.add(new Ls(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0);let e;this._disposables.add(this._resizeSash.onDidStart(t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines})})),this._disposables.add(this._resizeSash.onDidEnd(()=>{e=void 0})),this._disposables.add(this._resizeSash.onDidChange(t=>{if(e){const n=(t.currentY-e.startY)/this.editor.getOption(67),r=n<0?Math.ceil(n):Math.floor(n),o=e.heightInLines+r;o>5&&o<35&&this._relayout(o)}}))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(this.domNode.style.height===null?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){const e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}}var ECe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},DCe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const ICe=yn("IPeekViewService");In(ICe,class{constructor(){this._widgets=new Map}addExclusiveWidget(i,e){const t=this._widgets.get(i);t&&(t.listener.dispose(),t.widget.dispose());const n=()=>{const r=this._widgets.get(i);r&&r.widget===e&&(r.listener.dispose(),this._widgets.delete(i))};this._widgets.set(i,{widget:e,listener:e.onDidClose(n)})}},1);var il;(function(i){i.inPeekEditor=new st("inReferenceSearchEditor",!0,w("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),i.notInPeekEditor=i.inPeekEditor.toNegated()})(il||(il={}));let NI=class{constructor(e,t){e instanceof s_&&il.inPeekEditor.bindTo(t)}dispose(){}};NI.ID="editor.contrib.referenceController";NI=ECe([DCe(1,Vt)],NI);jn(NI.ID,NI,0);function Knt(i){const e=i.get(Un).getFocusedCodeEditor();return e instanceof s_?e.getParentEditor():e}const Gnt={headerBackgroundColor:me.white,primaryHeadingColor:me.fromHex("#333333"),secondaryHeadingColor:me.fromHex("#6c6c6cb3")};let pO=class extends jnt{constructor(e,t,n){super(e,t),this.instantiationService=n,this._onDidClose=new se,this.onDidClose=this._onDidClose.event,r4(this.options,Gnt,!1)}dispose(){this.disposed||(this.disposed=!0,super.dispose(),this._onDidClose.fire(this))}style(e){const 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();const 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=He(".head"),this._bodyElement=He(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=He(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),Sr(this._titleElement,"click",o=>this._onTitleClick(o))),ke(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=He("span.filename"),this._secondaryHeading=He("span.dirname"),this._metaHeading=He("span.meta"),ke(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const n=He(".peekview-actions");ke(this._headElement,n);const r=this._getActionBarOptions();this._actionbarWidget=new au(n,r),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new xl("peekview.close",w("label.close","Close"),Wt.asClassName(Xe.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:q_e.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:Ns(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,bl(this._metaHeading)):fa(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const n=Math.ceil(this.editor.getOption(67)*1.2),r=Math.round(e-(n+2));this._doLayoutHead(n,t),this._doLayoutBody(r,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`)}};pO=ECe([DCe(2,Ot)],pO);const qnt=X("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:me.black,hcLight:me.white},w("peekViewTitleBackground","Background color of the peek view title area.")),kCe=X("peekViewTitleLabel.foreground",{dark:me.white,light:me.black,hcDark:me.white,hcLight:Ku},w("peekViewTitleForeground","Color of the peek view title.")),TCe=X("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},w("peekViewTitleInfoForeground","Color of the peek view title info.")),Xnt=X("peekView.border",{dark:Za,light:Za,hcDark:Sn,hcLight:Sn},w("peekViewBorder","Color of the peek view borders and arrow.")),Ynt=X("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:me.black,hcLight:me.white},w("peekViewResultsBackground","Background color of the peek view result list."));X("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:me.white,hcLight:Ku},w("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));X("peekViewResult.fileForeground",{dark:me.white,light:"#1E1E1E",hcDark:me.white,hcLight:Ku},w("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));X("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},w("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));X("peekViewResult.selectionForeground",{dark:me.white,light:"#6C6C6C",hcDark:me.white,hcLight:Ku},w("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const ev=X("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:me.black,hcLight:me.white},w("peekViewEditorBackground","Background color of the peek view editor."));X("peekViewEditorGutter.background",{dark:ev,light:ev,hcDark:ev,hcLight:ev},w("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));X("peekViewEditorStickyScroll.background",{dark:ev,light:ev,hcDark:ev,hcLight:ev},w("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));X("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},w("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));X("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},w("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));X("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:zi,hcLight:zi},w("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));class a_{constructor(e,t,n,r){this.isProviderFirst=e,this.parent=t,this.link=n,this._rangeCallback=r,this.id=hV.nextId()}get uri(){return this.link.uri}get range(){var e,t;return(t=(e=this._range)!==null&&e!==void 0?e:this.link.targetSelectionRange)!==null&&t!==void 0?t:this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){var e;const t=(e=this.parent.getPreview(this))===null||e===void 0?void 0:e.preview(this.range);return t?w({key:"aria.oneReference.preview",comment:["Placeholders are: 0: filename, 1:line number, 2: column number, 3: preview snippet of source code"]},"{0} in {1} on line {2} at column {3}",t.value,su(this.uri),this.range.startLineNumber,this.range.startColumn):w("aria.oneReference","in {0} on line {1} at column {2}",su(this.uri),this.range.startLineNumber,this.range.startColumn)}}class Znt{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const n=this._modelReference.object.textEditorModel;if(!n)return;const{startLineNumber:r,startColumn:o,endLineNumber:s,endColumn:a}=e,l=n.getWordUntilPosition({lineNumber:r,column:o-t}),c=new B(r,l.startColumn,r,o),u=new B(s,a,s,1073741824),d=n.getValueInRange(c).replace(/^\s+/,""),h=n.getValueInRange(e),f=n.getValueInRange(u).replace(/\s+$/,"");return{value:d+h+f,highlight:{start:d.length,end:d.length+h.length}}}}class RI{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new Tr}dispose(){si(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?w("aria.fileReferences.1","1 symbol in {0}, full path {1}",su(this.uri),this.uri.fsPath):w("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,su(this.uri),this.uri.fsPath)}async resolve(e){if(this._previews.size!==0)return this;for(const t of this.children)if(!this._previews.has(t.uri))try{const n=await e.createModelReference(t.uri);this._previews.set(t.uri,new Znt(n))}catch(n){en(n)}return this}}class El{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new se,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[n]=e;e.sort(El._compareReferences);let r;for(const o of e)if((!r||!Ui.isEqual(r.uri,o.uri,!0))&&(r=new RI(this,o.uri),this.groups.push(r)),r.children.length===0||El._compareReferences(o,r.children[r.children.length-1])!==0){const s=new a_(n===o,r,o,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(s),r.children.push(s)}}dispose(){si(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new El(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?w("aria.result.0","No results found"):this.references.length===1?w("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?w("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):w("aria.result.nm","Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:n}=e;let r=n.children.indexOf(e);const o=n.children.length,s=n.parent.groups.length;return s===1||t&&r+10?(t?r=(r+1)%o:r=(r+o-1)%o,n.children[r]):(r=n.parent.groups.indexOf(n),t?(r=(r+1)%s,n.parent.groups[r].children[0]):(r=(r+s-1)%s,n.parent.groups[r].children[n.parent.groups[r].children.length-1]))}nearestReference(e,t){const n=this.references.map((r,o)=>({idx:o,prefixLen:zv(r.uri.toString(),e.toString()),offsetDist:Math.abs(r.range.startLineNumber-t.lineNumber)*100+Math.abs(r.range.startColumn-t.column)})).sort((r,o)=>r.prefixLen>o.prefixLen?-1:r.prefixLeno.offsetDist?1:0)[0];if(n)return this.references[n.idx]}referenceAt(e,t){for(const n of this.references)if(n.uri.toString()===e.toString()&&B.containsPosition(n.range,t))return n}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return Ui.compare(e.uri,t.uri)||B.compareRangesUsingStarts(e.range,t.range)}}var A3=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},P3=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},jz;let Kz=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof El||e instanceof RI}getChildren(e){if(e instanceof El)return e.groups;if(e instanceof RI)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};Kz=A3([P3(0,ol)],Kz);class Qnt{getHeight(){return 23}getTemplateId(e){return e instanceof RI?MI.id:dT.id}}let Gz=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof a_){const n=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(n)return n.value}return su(e.uri)}};Gz=A3([P3(0,ci)],Gz);class Jnt{getId(e){return e instanceof a_?e.id:e.uri}}let qz=class extends fe{constructor(e,t){super(),this._labelService=t;const n=document.createElement("div");n.classList.add("reference-file"),this.file=this._register(new ZP(n,{supportHighlights:!0})),this.badge=new XV(ke(n,He(".count")),{},K_e),e.appendChild(n)}set(e,t){const n=z4(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(n,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});const r=e.children.length;this.badge.setCount(r),r>1?this.badge.setTitleFormat(w("referencesCount","{0} references",r)):this.badge.setTitleFormat(w("referenceCount","{0} reference",r))}};qz=A3([P3(1,Vw)],qz);let MI=jz=class{constructor(e){this._instantiationService=e,this.templateId=jz.id}renderTemplate(e){return this._instantiationService.createInstance(qz,e)}renderElement(e,t,n){n.set(e.element,qk(e.filterData))}disposeTemplate(e){e.dispose()}};MI.id="FileReferencesRenderer";MI=jz=A3([P3(0,Ot)],MI);class eit{constructor(e){this.label=new Lv(e)}set(e,t){var n;const r=(n=e.parent.getPreview(e))===null||n===void 0?void 0:n.preview(e.range);if(!r||!r.value)this.label.set(`${su(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:o,highlight:s}=r;t&&!rh.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(o,qk(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(o,[s]))}}}class dT{constructor(){this.templateId=dT.id}renderTemplate(e){return new eit(e)}renderElement(e,t,n){n.set(e.element,e.filterData)}disposeTemplate(){}}dT.id="OneReferenceRenderer";class tit{getWidgetAriaLabel(){return w("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var nit=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Cg=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class O3{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new Te,this._callOnModelChange=new Te,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(const t of this._model.references)if(t.uri.toString()===e.uri.toString()){this._addDecorations(t.parent);return}}}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));const t=[],n=[];for(let r=0,o=e.children.length;r{const o=r.deltaDecorations([],t);for(let s=0;s{o.equals(9)&&(this._keybindingService.dispatchEvent(o,o.target),o.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(rit,"ReferencesWidget",this._treeContainer,new Qnt,[this._instantiationService.createInstance(MI),this._instantiationService.createInstance(dT)],this._instantiationService.createInstance(Kz),n),this._splitView.addView({onDidChange:Je.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:o=>{this._preview.layout({height:this._dim.height,width:o})}},jP.Distribute),this._splitView.addView({onDidChange:Je.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:o=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${o}px`,this._tree.layout(this._dim.height,o)}},jP.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const r=(o,s)=>{o instanceof a_&&(s==="show"&&this._revealReference(o,!1),this._onDidSelectReference.fire({element:o,kind:s,source:"tree"}))};this._tree.onDidOpen(o=>{o.sideBySide?r(o.element,"side"):o.editorOptions.pinned?r(o.element,"goto"):r(o.element,"show")}),fa(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new Kn(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=w("noResults","No results"),bl(this._messageContainer),Promise.resolve(void 0)):(fa(this._messageContainer),this._decorationsManager=new O3(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:n}=e;if(t.detail!==2)return;const r=this._getFocusedReference();r&&this._onDidSelectReference.fire({element:{uri:r.uri,range:n.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),bl(this._treeContainer),bl(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(this._model.groups.length===1?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){const[e]=this._tree.getFocus();if(e instanceof a_)return e;if(e instanceof RI&&e.children.length>0)return e.children[0]}async revealReference(e){await this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})}async _revealReference(e,t){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==an.inMemory?this.setTitle(bze(e.uri),this._uriLabel.getUriLabel(z4(e.uri))):this.setTitle(w("peekView.alternateTitle","References"));const n=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent?this._tree.reveal(e):(t&&this._tree.reveal(e.parent),await this._tree.expand(e.parent),this._tree.reveal(e));const r=await n;if(!this._model){r.dispose();return}si(this._previewModelReference);const o=r.object;if(o){const s=this._preview.getModel()===o.textEditorModel?0:1,a=B.lift(e.range).collapseToStart();this._previewModelReference=r,this._preview.setModel(o.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,s)}else this._preview.setModel(this._previewNotAvailableMessage),r.dispose()}};Xz=nit([Cg(3,To),Cg(4,ol),Cg(5,Ot),Cg(6,ICe),Cg(7,Vw),Cg(8,U4),Cg(9,ci),Cg(10,ji),Cg(11,Di)],Xz);var oit=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},i1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},FM;const wC=new st("referenceSearchVisible",!1,w("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let l_=FM=class{static get(e){return e.getContribution(FM.ID)}constructor(e,t,n,r,o,s,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=r,this._notificationService=o,this._instantiationService=s,this._storageService=a,this._configurationService=l,this._disposables=new Te,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=wC.bindTo(n)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),(e=this._widget)===null||e===void 0||e.dispose(),(t=this._model)===null||t===void 0||t.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,n){let r;if(this._widget&&(r=this._widget.position),this.closeWidget(),r&&e.containsPosition(r))return;this._peekMode=n,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=iit.fromJSON(this._storageService.get(o,0,"{}"));this._widget=this._instantiationService.createInstance(Xz,this._editor,this._defaultTreeKeyboardSupport,s),this._widget.setTitle(w("labelLoading","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(l=>{const{element:c,kind:u}=l;if(c)switch(u){case"open":(l.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(c,!1,!1);break;case"side":this.openReference(c,!0,!1);break;case"goto":n?this._gotoReference(c,!0):this.openReference(c,!1,!0);break}}));const a=++this._requestIdPool;t.then(l=>{var c;if(a!==this._requestIdPool||!this._widget){l.dispose();return}return(c=this._model)===null||c===void 0||c.dispose(),this._model=l,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(w("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));const u=this._editor.getModel().uri,d=new ae(e.startLineNumber,e.startColumn),h=this._model.nearestReference(u,d);if(h)return this._widget.setSelection(h).then(()=>{this._widget&&this._editor.getOption(87)==="editor"&&this._widget.focusOnPreviewEditor()})}})},l=>{this._notificationService.error(l)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}async goToNextOrPreviousReference(e){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const n=this._model.nearestReference(this._editor.getModel().uri,t);if(!n)return;const r=this._model.nextOrPreviousReference(n,e),o=this._editor.hasTextFocus(),s=this._widget.isPreviewEditorFocused();await this._widget.setSelection(r),await this._gotoReference(r,!1),o?this._editor.focus():this._widget&&s&&this._widget.focusOnPreviewEditor()}async revealReference(e){!this._editor.hasModel()||!this._model||!this._widget||await this._widget.revealReference(e)}closeWidget(e=!0){var t,n;(t=this._widget)===null||t===void 0||t.dispose(),(n=this._model)===null||n===void 0||n.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(e,t){var n;(n=this._widget)===null||n===void 0||n.hide(),this._ignoreModelChangeEvent=!0;const r=B.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:r,selectionSource:"code.jump",pinned:t}},this._editor).then(o=>{var s;if(this._ignoreModelChangeEvent=!1,!o||!this._widget){this.closeWidget();return}if(this._editor===o)this._widget.show(r),this._widget.focusOnReferenceTree();else{const a=FM.get(o),l=this._model.clone();this.closeWidget(),o.focus(),a==null||a.toggleWidget(r,Io(c=>Promise.resolve(l)),(s=this._peekMode)!==null&&s!==void 0?s:!1)}},o=>{this._ignoreModelChangeEvent=!1,en(o)})}openReference(e,t,n){t||this.closeWidget();const{uri:r,range:o}=e;this._editorService.openCodeEditor({resource:r,options:{selection:o,selectionSource:"code.jump",pinned:n}},this._editor,t)}};l_.ID="editor.contrib.referencesController";l_=FM=oit([i1(2,Vt),i1(3,Un),i1(4,$r),i1(5,Ot),i1(6,dd),i1(7,gn)],l_);function SC(i,e){const t=Knt(i);if(!t)return;const n=l_.get(t);n&&e(n)}nl.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:co(2089,60),when:De.or(wC,il.inPeekEditor),handler(i){SC(i,e=>{e.changeFocusBetweenPreviewAndReferences()})}});nl.registerCommandAndKeybindingRule({id:"goToNextReference",weight:100-10,primary:62,secondary:[70],when:De.or(wC,il.inPeekEditor),handler(i){SC(i,e=>{e.goToNextOrPreviousReference(!0)})}});nl.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:100-10,primary:1086,secondary:[1094],when:De.or(wC,il.inPeekEditor),handler(i){SC(i,e=>{e.goToNextOrPreviousReference(!1)})}});Dn.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");Dn.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");Dn.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");Dn.registerCommand("closeReferenceSearch",i=>SC(i,e=>e.closeWidget()));nl.registerKeybindingRule({id:"closeReferenceSearch",weight:100-101,primary:9,secondary:[1033],when:De.and(il.inPeekEditor,De.not("config.editor.stablePeek"))});nl.registerKeybindingRule({id:"closeReferenceSearch",weight:200+50,primary:9,secondary:[1033],when:De.and(wC,De.not("config.editor.stablePeek"),De.or(j.editorTextFocus,XXe.negate()))});nl.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:De.and(wC,v0e,oY.negate(),sY.negate()),handler(i){var e;const n=(e=i.get(mu).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(n)&&n[0]instanceof a_&&SC(i,r=>r.revealReference(n[0]))}});nl.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:De.and(wC,v0e,oY.negate(),sY.negate()),handler(i){var e;const n=(e=i.get(mu).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(n)&&n[0]instanceof a_&&SC(i,r=>r.openReference(n[0],!0,!0))}});Dn.registerCommand("openReference",i=>{var e;const n=(e=i.get(mu).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(n)&&n[0]instanceof a_&&SC(i,r=>r.openReference(n[0],!1,!0))});var NCe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},WL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const HY=new st("hasSymbols",!1,w("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),F3=yn("ISymbolNavigationService");let Yz=class{constructor(e,t,n,r){this._editorService=t,this._notificationService=n,this._keybindingService=r,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=HY.bindTo(e)}reset(){var e,t;this._ctxHasSymbols.reset(),(e=this._currentState)===null||e===void 0||e.dispose(),(t=this._currentMessage)===null||t===void 0||t.dispose(),this._currentModel=void 0,this._currentIdx=-1}put(e){const t=e.parent.parent;if(t.references.length<=1){this.reset();return}this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const n=new Zz(this._editorService),r=n.onDidChange(o=>{if(this._ignoreEditorChange)return;const s=this._editorService.getActiveCodeEditor();if(!s)return;const a=s.getModel(),l=s.getPosition();if(!a||!l)return;let c=!1,u=!1;for(const d of t.references)if(hX(d.uri,a.uri))c=!0,u=u||B.containsPosition(d.range,l);else if(c)break;(!c||!u)&&this.reset()});this._currentState=Zu(n,r)}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:B.collapseToStart(t.range),selectionRevealType:3}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){var e;(e=this._currentMessage)===null||e===void 0||e.dispose();const t=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),n=t?w("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):w("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(n)}};Yz=NCe([WL(0,Vt),WL(1,Un),WL(2,$r),WL(3,ci)],Yz);In(F3,Yz,1);et(new class extends Vo{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:HY,kbOpts:{weight:100,primary:70}})}runEditorCommand(i,e){return i.get(F3).revealNext(e)}});nl.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:HY,primary:9,handler(i){i.get(F3).reset()}});let Zz=class{constructor(e){this._listener=new Map,this._disposables=new Te,this._onDidChange=new se,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(),si(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,Zu(e.onDidChangeCursorPosition(t=>this._onDidChange.fire({editor:e})),e.onDidChangeModelContent(t=>this._onDidChange.fire({editor:e}))))}_onDidRemoveEditor(e){var t;(t=this._listener.get(e))===null||t===void 0||t.dispose(),this._listener.delete(e)}};Zz=NCe([WL(0,Un)],Zz);async function hT(i,e,t,n){const o=t.ordered(i).map(a=>Promise.resolve(n(a,i,e)).then(void 0,l=>{Zr(l)})),s=await Promise.all(o);return lh(s.flat())}function B3(i,e,t,n){return hT(e,t,i,(r,o,s)=>r.provideDefinition(o,s,n))}function RCe(i,e,t,n){return hT(e,t,i,(r,o,s)=>r.provideDeclaration(o,s,n))}function MCe(i,e,t,n){return hT(e,t,i,(r,o,s)=>r.provideImplementation(o,s,n))}function ACe(i,e,t,n){return hT(e,t,i,(r,o,s)=>r.provideTypeDefinition(o,s,n))}function W3(i,e,t,n,r){return hT(e,t,i,async(o,s,a)=>{const l=await o.provideReferences(s,a,{includeDeclaration:!0},r);if(!n||!l||l.length!==2)return l;const c=await o.provideReferences(s,a,{includeDeclaration:!1},r);return c&&c.length===1?c:l})}async function fT(i){const e=await i(),t=new El(e,""),n=t.references.map(r=>r.link);return t.dispose(),n}tg("_executeDefinitionProvider",(i,e,t)=>{const n=i.get(_t),r=B3(n.definitionProvider,e,t,Cn.None);return fT(()=>r)});tg("_executeTypeDefinitionProvider",(i,e,t)=>{const n=i.get(_t),r=ACe(n.typeDefinitionProvider,e,t,Cn.None);return fT(()=>r)});tg("_executeDeclarationProvider",(i,e,t)=>{const n=i.get(_t),r=RCe(n.declarationProvider,e,t,Cn.None);return fT(()=>r)});tg("_executeReferenceProvider",(i,e,t)=>{const n=i.get(_t),r=W3(n.referenceProvider,e,t,!1,Cn.None);return fT(()=>r)});tg("_executeImplementationProvider",(i,e,t)=>{const n=i.get(_t),r=MCe(n.implementationProvider,e,t,Cn.None);return fT(()=>r)});var Yx,Zx,Qx,GR,qR,XR,YR,ZR;ts.appendMenuItem($.EditorContext,{submenu:$.EditorContextPeek,title:w("peek.submenu","Peek"),group:"navigation",order:100});class eS{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof eS||ae.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}class Gs extends Sh{static all(){return Gs._allSymbolNavigationCommands.values()}static _patchConfig(e){const t={...e,f1:!0};if(t.menu)for(const n of En.wrap(t.menu))(n.id===$.EditorContext||n.id===$.EditorContextPeek)&&(n.when=De.and(e.precondition,n.when));return t}constructor(e,t){super(Gs._patchConfig(t)),this.configuration=e,Gs._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,n,r){if(!t.hasModel())return Promise.resolve(void 0);const o=e.get($r),s=e.get(Un),a=e.get(T_),l=e.get(F3),c=e.get(_t),u=e.get(Ot),d=t.getModel(),h=t.getPosition(),f=eS.is(n)?n:new eS(d,h),g=new i_(t,5),p=Rk(this._getLocationModel(c,f.model,f.position,g.token),g.token).then(async v=>{var m;if(!v||g.token.isCancellationRequested)return;kl(v.ariaMessage);let _;if(v.referenceAt(d.uri,h)){const S=this._getAlternativeCommand(t);!Gs._activeAlternativeCommands.has(S)&&Gs._allSymbolNavigationCommands.has(S)&&(_=Gs._allSymbolNavigationCommands.get(S))}const y=v.references.length;if(y===0){if(!this.configuration.muteMessage){const S=d.getWordAtPosition(h);(m=xa.get(t))===null||m===void 0||m.showMessage(this._getNoResultFoundMessage(S),h)}}else if(y===1&&_)Gs._activeAlternativeCommands.add(this.desc.id),u.invokeFunction(S=>_.runEditorCommand(S,t,n,r).finally(()=>{Gs._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(s,l,t,v,r)},v=>{o.error(v)}).finally(()=>{g.dispose()});return a.showWhile(p,250),p}async _onResult(e,t,n,r,o){const s=this._getGoToPreference(n);if(!(n instanceof s_)&&(this.configuration.openInPeek||s==="peek"&&r.references.length>1))this._openInPeek(n,r,o);else{const a=r.firstReference(),l=r.references.length>1&&s==="gotoAndPeek",c=await this._openReference(n,e,a,this.configuration.openToSide,!l);l&&c?this._openInPeek(c,r,o):r.dispose(),s==="goto"&&t.put(a)}}async _openReference(e,t,n,r,o){let s;if(I5e(n)&&(s=n.targetSelectionRange),s||(s=n.range),!s)return;const a=await t.openCodeEditor({resource:n.uri,options:{selection:B.collapseToStart(s),selectionRevealType:3,selectionSource:"code.jump"}},e,r);if(a){if(o){const l=a.getModel(),c=a.createDecorationsCollection([{range:s,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&c.clear()},350)}return a}}_openInPeek(e,t,n){const r=l_.get(e);r&&e.hasModel()?r.toggleWidget(n??e.getSelection(),Io(o=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}Gs._allSymbolNavigationCommands=new Map;Gs._activeAlternativeCommands=new Set;class gT extends Gs{async _getLocationModel(e,t,n,r){return new El(await B3(e.definitionProvider,t,n,r),w("def.title","Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?w("noResultWord","No definition found for '{0}'",e.word):w("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleDefinitions}}Ei((Yx=class extends gT{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:Yx.id,title:{...$n("actions.goToDecl.label","Go to Definition"),mnemonicTitle:w({key:"miGotoDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Definition")},precondition:j.hasDefinitionProvider,keybinding:[{when:j.editorTextFocus,primary:70,weight:100},{when:De.and(j.editorTextFocus,f0e),primary:2118,weight:100}],menu:[{id:$.EditorContext,group:"navigation",order:1.1},{id:$.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),Dn.registerCommandAlias("editor.action.goToDeclaration",Yx.id)}},Yx.id="editor.action.revealDefinition",Yx));Ei((Zx=class extends gT{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:Zx.id,title:$n("actions.goToDeclToSide.label","Open Definition to the Side"),precondition:De.and(j.hasDefinitionProvider,j.isInEmbeddedEditor.toNegated()),keybinding:[{when:j.editorTextFocus,primary:co(2089,70),weight:100},{when:De.and(j.editorTextFocus,f0e),primary:co(2089,2118),weight:100}]}),Dn.registerCommandAlias("editor.action.openDeclarationToTheSide",Zx.id)}},Zx.id="editor.action.revealDefinitionAside",Zx));Ei((Qx=class extends gT{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:Qx.id,title:$n("actions.previewDecl.label","Peek Definition"),precondition:De.and(j.hasDefinitionProvider,il.notInPeekEditor,j.isInEmbeddedEditor.toNegated()),keybinding:{when:j.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:$.EditorContextPeek,group:"peek",order:2}}),Dn.registerCommandAlias("editor.action.previewDeclaration",Qx.id)}},Qx.id="editor.action.peekDefinition",Qx));class PCe extends Gs{async _getLocationModel(e,t,n,r){return new El(await RCe(e.declarationProvider,t,n,r),w("decl.title","Declarations"))}_getNoResultFoundMessage(e){return e&&e.word?w("decl.noResultWord","No declaration found for '{0}'",e.word):w("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(58).multipleDeclarations}}Ei((GR=class extends PCe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:GR.id,title:{...$n("actions.goToDeclaration.label","Go to Declaration"),mnemonicTitle:w({key:"miGotoDeclaration",comment:["&& denotes a mnemonic"]},"Go to &&Declaration")},precondition:De.and(j.hasDeclarationProvider,j.isInEmbeddedEditor.toNegated()),menu:[{id:$.EditorContext,group:"navigation",order:1.3},{id:$.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?w("decl.noResultWord","No declaration found for '{0}'",e.word):w("decl.generic.noResults","No declaration found")}},GR.id="editor.action.revealDeclaration",GR));Ei(class extends PCe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:$n("actions.peekDecl.label","Peek Declaration"),precondition:De.and(j.hasDeclarationProvider,il.notInPeekEditor,j.isInEmbeddedEditor.toNegated()),menu:{id:$.EditorContextPeek,group:"peek",order:3}})}});class OCe extends Gs{async _getLocationModel(e,t,n,r){return new El(await ACe(e.typeDefinitionProvider,t,n,r),w("typedef.title","Type Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?w("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):w("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleTypeDefinitions}}Ei((qR=class extends OCe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:qR.ID,title:{...$n("actions.goToTypeDefinition.label","Go to Type Definition"),mnemonicTitle:w({key:"miGotoTypeDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Type Definition")},precondition:j.hasTypeDefinitionProvider,keybinding:{when:j.editorTextFocus,primary:0,weight:100},menu:[{id:$.EditorContext,group:"navigation",order:1.4},{id:$.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},qR.ID="editor.action.goToTypeDefinition",qR));Ei((XR=class extends OCe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:XR.ID,title:$n("actions.peekTypeDefinition.label","Peek Type Definition"),precondition:De.and(j.hasTypeDefinitionProvider,il.notInPeekEditor,j.isInEmbeddedEditor.toNegated()),menu:{id:$.EditorContextPeek,group:"peek",order:4}})}},XR.ID="editor.action.peekTypeDefinition",XR));class FCe extends Gs{async _getLocationModel(e,t,n,r){return new El(await MCe(e.implementationProvider,t,n,r),w("impl.title","Implementations"))}_getNoResultFoundMessage(e){return e&&e.word?w("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):w("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(58).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(58).multipleImplementations}}Ei((YR=class extends FCe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:YR.ID,title:{...$n("actions.goToImplementation.label","Go to Implementations"),mnemonicTitle:w({key:"miGotoImplementation",comment:["&& denotes a mnemonic"]},"Go to &&Implementations")},precondition:j.hasImplementationProvider,keybinding:{when:j.editorTextFocus,primary:2118,weight:100},menu:[{id:$.EditorContext,group:"navigation",order:1.45},{id:$.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},YR.ID="editor.action.goToImplementation",YR));Ei((ZR=class extends FCe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:ZR.ID,title:$n("actions.peekImplementation.label","Peek Implementations"),precondition:De.and(j.hasImplementationProvider,il.notInPeekEditor,j.isInEmbeddedEditor.toNegated()),keybinding:{when:j.editorTextFocus,primary:3142,weight:100},menu:{id:$.EditorContextPeek,group:"peek",order:5}})}},ZR.ID="editor.action.peekImplementation",ZR));class BCe extends Gs{_getNoResultFoundMessage(e){return e?w("references.no","No references found for '{0}'",e.word):w("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(58).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(58).multipleReferences}}Ei(class extends BCe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{...$n("goToReferences.label","Go to References"),mnemonicTitle:w({key:"miGotoReference",comment:["&& denotes a mnemonic"]},"Go to &&References")},precondition:De.and(j.hasReferenceProvider,il.notInPeekEditor,j.isInEmbeddedEditor.toNegated()),keybinding:{when:j.editorTextFocus,primary:1094,weight:100},menu:[{id:$.EditorContext,group:"navigation",order:1.45},{id:$.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}async _getLocationModel(e,t,n,r){return new El(await W3(e.referenceProvider,t,n,!0,r),w("ref.title","References"))}});Ei(class extends BCe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:$n("references.action.label","Peek References"),precondition:De.and(j.hasReferenceProvider,il.notInPeekEditor,j.isInEmbeddedEditor.toNegated()),menu:{id:$.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(e,t,n,r){return new El(await W3(e.referenceProvider,t,n,!1,r),w("ref.title","References"))}});class sit extends Gs{constructor(e,t,n){super(e,{id:"editor.action.goToLocation",title:$n("label.generic","Go to Any Symbol"),precondition:De.and(il.notInPeekEditor,j.isInEmbeddedEditor.toNegated())}),this._references=t,this._gotoMultipleBehaviour=n}async _getLocationModel(e,t,n,r){return new El(this._references,w("generic.title","Locations"))}_getNoResultFoundMessage(e){return e&&w("generic.noResult","No results for '{0}'",e.word)||""}_getGoToPreference(e){var t;return(t=this._gotoMultipleBehaviour)!==null&&t!==void 0?t:e.getOption(58).multipleReferences}_getAlternativeCommand(){return""}}Dn.registerCommand({id:"editor.action.goToLocations",metadata:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:At},{name:"position",description:"The position at which to start",constraint:ae.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:async(i,e,t,n,r,o,s)=>{Xn(At.isUri(e)),Xn(ae.isIPosition(t)),Xn(Array.isArray(n)),Xn(typeof r>"u"||typeof r=="string"),Xn(typeof s>"u"||typeof s=="boolean");const a=i.get(Un),l=await a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(qf(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(c=>{const u=new class extends sit{_getNoResultFoundMessage(d){return o||super._getNoResultFoundMessage(d)}}({muteMessage:!o,openInPeek:!!s,openToSide:!1},n,r);c.get(Ot).invokeFunction(u.run.bind(u),l)})}});Dn.registerCommand({id:"editor.action.peekLocations",metadata:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:At},{name:"position",description:"The position at which to start",constraint:ae.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:async(i,e,t,n,r)=>{i.get(sr).executeCommand("editor.action.goToLocations",e,t,n,r,void 0,!0)}});Dn.registerCommand({id:"editor.action.findReferences",handler:(i,e,t)=>{Xn(At.isUri(e)),Xn(ae.isIPosition(t));const n=i.get(_t),r=i.get(Un);return r.openCodeEditor({resource:e},r.getFocusedCodeEditor()).then(o=>{if(!qf(o)||!o.hasModel())return;const s=l_.get(o);if(!s)return;const a=Io(c=>W3(n.referenceProvider,o.getModel(),ae.lift(t),!1,c).then(u=>new El(u,w("ref.title","References")))),l=new B(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(s.toggleWidget(l,a,!1))})}});Dn.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");var ait=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},k9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},$L;let Kb=$L=class{constructor(e,t,n,r){this.textModelResolverService=t,this.languageService=n,this.languageFeaturesService=r,this.toUnhook=new Te,this.toUnhookForKeyboard=new Te,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const o=new M3(e);this.toUnhook.add(o),this.toUnhook.add(o.onMouseMoveOrRelevantKeyDown(([s,a])=>{this.startFindDefinitionFromMouse(s,a??void 0)})),this.toUnhook.add(o.onExecute(s=>{this.isEnabled(s)&&this.gotoDefinition(s.target.position,s.hasSideBySideModifier).catch(a=>{en(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(o.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution($L.ID)}async startFindDefinitionFromCursor(e){await this.startFindDefinition(e),this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()})),this.toUnhookForKeyboard.add(this.editor.onKeyDown(t=>{t&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())}))}startFindDefinitionFromMouse(e,t){if(e.target.type===9&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t)){this.currentWordAtPosition=null,this.removeLinkDecorations();return}const n=e.target.position;this.startFindDefinition(n)}async startFindDefinition(e){var t;this.toUnhookForKeyboard.clear();const n=e?(t=this.editor.getModel())===null||t===void 0?void 0:t.getWordAtPosition(e):null;if(!n){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===n.startColumn&&this.currentWordAtPosition.endColumn===n.endColumn&&this.currentWordAtPosition.word===n.word)return;this.currentWordAtPosition=n;const r=new tbe(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=Io(a=>this.findDefinition(e,a));let o;try{o=await this.previousPromise}catch(a){en(a);return}if(!o||!o.length||!r.validate(this.editor)){this.removeLinkDecorations();return}const s=o[0].originSelectionRange?B.lift(o[0].originSelectionRange):new B(e.lineNumber,n.startColumn,e.lineNumber,n.endColumn);if(o.length>1){let a=s;for(const{originSelectionRange:l}of o)l&&(a=B.plusRange(a,l));this.addDecoration(a,new Is().appendText(w("multipleResults","Click to show {0} definitions.",o.length)))}else{const a=o[0];if(!a.uri)return;this.textModelResolverService.createModelReference(a.uri).then(l=>{if(!l.object||!l.object.textEditorModel){l.dispose();return}const{object:{textEditorModel:c}}=l,{startLineNumber:u}=a.range;if(u<1||u>c.getLineCount()){l.dispose();return}const d=this.getPreviewValue(c,u,a),h=this.languageService.guessLanguageIdByFilepathOrFirstLine(c.uri);this.addDecoration(s,d?new Is().appendCodeblock(h||"",d):void 0),l.dispose()})}}getPreviewValue(e,t,n){let r=n.range;return r.endLineNumber-r.startLineNumber>=$L.MAX_SOURCE_PREVIEW_LINES&&(r=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,r)}stripIndentationFromPreviewRange(e,t,n){let o=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a{const r=!t&&this.editor.getOption(88)&&!this.isInPeekEditor(n);return new gT({openToSide:t,openInPeek:r,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(n)})}isInPeekEditor(e){const t=e.get(Vt);return il.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};Kb.ID="editor.contrib.gotodefinitionatposition";Kb.MAX_SOURCE_PREVIEW_LINES=8;Kb=$L=ait([k9(1,ol),k9(2,ji),k9(3,_t)],Kb);jn(Kb.ID,Kb,2);let lit=class{constructor(e,t,n){this.value=e,this.isComplete=t,this.hasLoadingMessage=n}};class WCe extends fe{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new se),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new pi(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new pi(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new pi(()=>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(60).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=gBe(e=>this._computer.computeAsync(e)),(async()=>{try{for await(const e of this._asyncIterable)e&&(this._result.push(e),this._fireResult());this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0)}catch(e){en(e)}})()):this._asyncIterableDone=!0}_triggerSyncComputation(){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync())),this._setState(this._asyncIterableDone?0:3)}_triggerLoadingMessage(){this._state===3&&this._setState(4)}_fireResult(){if(this._state===1||this._state===2)return;const e=this._state===0,t=this._state===4;this._onResult.fire(new lit(this._result.slice(0),e,t))}start(e){if(e===0)this._state===0&&(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();break}}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 T9{constructor(e,t,n,r){this.priority=e,this.range=t,this.initialMousePosX=n,this.initialMousePosY=r,this.type=1}equals(e){return e.type===1&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===1&&t.lineNumber===this.range.startLineNumber}}class ub{constructor(e,t,n,r,o,s){this.priority=e,this.owner=t,this.range=n,this.initialMousePosX=r,this.initialMousePosY=o,this.supportsMarkerHover=s,this.type=2}equals(e){return e.type===2&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===2&&this.owner===e.owner}}const P_=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class VY{constructor(){this._onDidWillResize=new se,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new se,this.onDidResize=this._onDidResize.event,this._sashListener=new Te,this._size=new Kn(0,0),this._minSize=new Kn(0,0),this._maxSize=new Kn(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new Ls(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new Ls(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new Ls(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:zP.North}),this._southSash=new Ls(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:zP.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let e,t=0,n=0;this._sashListener.add(Je.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,n=0)})),this._sashListener.add(Je.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,n=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(r=>{e&&(n=r.currentX-r.startX,this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(r=>{e&&(n=-(r.currentX-r.startX),this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(r=>{e&&(t=-(r.currentY-r.startY),this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(r=>{e&&(t=r.currentY-r.startY,this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(Je.any(this._eastSash.onDidReset,this._westSash.onDidReset)(r=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(Je.any(this._northSash.onDidReset,this._southSash.onDidReset)(r=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,n,r){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=n?3:0,this._westSash.state=r?3:0}layout(e=this.size.height,t=this.size.width){const{height:n,width:r}=this._minSize,{height:o,width:s}=this._maxSize;e=Math.max(n,Math.min(o,e)),t=Math.max(r,Math.min(s,t));const a=new Kn(t,e);Kn.equals(a,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=a,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}}const cit=30,uit=24;class dit extends fe{constructor(e,t=new Kn(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new VY),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=Kn.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(n=>{this._resize(new Kn(n.dimension.width,n.dimension.height)),n.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){var e;return!((e=this._contentPosition)===null||e===void 0)&&e.position?ae.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);return!t||!n?void 0:Br(t).top+n.top-cit}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);if(!t||!n)return;const r=Br(t),o=kp(t.ownerDocument.body),s=r.top+n.top+n.height;return o.height-s-uit}_findPositionPreference(e,t){var n,r;const o=Math.min((n=this._availableVerticalSpaceBelow(t))!==null&&n!==void 0?n:1/0,e),s=Math.min((r=this._availableVerticalSpaceAbove(t))!==null&&r!==void 0?r:1/0,e),a=Math.min(Math.max(s,o),e),l=Math.min(e,a);let c;return this._editor.getOption(60).above?c=l<=s?1:2:c=l<=o?2:1,c===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),c}_resize(e){this._resizableNode.layout(e.height,e.width)}}var zY=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},G0=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},BM,qh;const Iae=He;let mO=BM=class extends fe{constructor(e,t,n){super(),this._editor=e,this._instantiationService=t,this._keybindingService=n,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(Iv,this._editor)),this._participants=[];for(const r of P_.getAll())this._participants.push(this._instantiationService.createInstance(r,this._editor));this._participants.sort((r,o)=>r.hoverOrdinal-o.hoverOrdinal),this._computer=new _O(this._editor,this._participants),this._hoverOperation=this._register(new WCe(this._editor,this._computer)),this._register(this._hoverOperation.onResult(r=>{if(!this._computer.anchor)return;const o=r.hasLoadingMessage?this._addLoadingMessage(r.value):r.value;this._withResult(new $Ce(this._computer.anchor,o,r.isComplete))})),this._register(Sr(this._widget.getDomNode(),"keydown",r=>{r.equals(9)&&this.hide()})),this._register(hr.onDidChange(()=>{this._widget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))}_startShowingOrUpdateHover(e,t,n,r,o){return!this._widget.position||!this._currentResult?e?(this._startHoverOperationIfNecessary(e,t,n,r,!1),!0):!1:this._editor.getOption(60).sticky&&o&&this._widget.isMouseGettingCloser(o.event.posx,o.event.posy)?(e&&this._startHoverOperationIfNecessary(e,t,n,r,!0),!0):e?e&&this._currentResult.anchor.equals(e)?!0:e.canAdoptVisibleHover(this._currentResult.anchor,this._widget.position)?(this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,n,r,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,n,r,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,n,r,o){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=r,this._computer.source=n,this._computer.insistOnKeepingHoverVisible=o,this._hoverOperation.start(t))}_setCurrentResult(e){this._currentResult!==e&&(e&&e.messages.length===0&&(e=null),this._currentResult=e,this._currentResult?this._renderMessages(this._currentResult.anchor,this._currentResult.messages):this._widget.hide())}_addLoadingMessage(e){if(this._computer.anchor){for(const t of this._participants)if(t.createLoadingMessage){const n=t.createLoadingMessage(this._computer.anchor);if(n)return e.slice(0).concat([n])}}return e}_withResult(e){this._widget.position&&this._currentResult&&this._currentResult.isComplete&&(!e.isComplete||this._computer.insistOnKeepingHoverVisible&&e.messages.length===0)||this._setCurrentResult(e)}_renderMessages(e,t){const{showAtPosition:n,showAtSecondaryPosition:r,highlightRange:o}=BM.computeHoverRanges(this._editor,e.range,t),s=new Te,a=s.add(new vO(this._keybindingService)),l=document.createDocumentFragment();let c=null;const u={fragment:l,statusBar:a,setColorPicker:h=>c=h,onContentsChanged:()=>this._widget.onContentsChanged(),setMinimumDimensions:h=>this._widget.setMinimumDimensions(h),hide:()=>this.hide()};for(const h of this._participants){const f=t.filter(g=>g.owner===h);f.length>0&&s.add(h.renderHoverParts(u,f))}const d=t.some(h=>h.isBeforeContent);if(a.hasContent&&l.appendChild(a.hoverElement),l.hasChildNodes()){if(o){const h=this._editor.createDecorationsCollection();h.set([{range:o,options:BM._DECORATION_OPTIONS}]),s.add(Rt(()=>{h.clear()}))}this._widget.showAt(l,new fit(e.initialMousePosX,e.initialMousePosY,c,n,r,this._editor.getOption(60).above,this._computer.shouldFocus,this._computer.source,d,s))}else s.dispose()}static computeHoverRanges(e,t,n){let r=1;if(e.hasModel()){const d=e._getViewModel(),h=d.coordinatesConverter,f=h.convertModelRangeToViewRange(t),g=new ae(f.startLineNumber,d.getLineMinColumn(f.startLineNumber));r=h.convertViewPositionToModelPosition(g).column}const o=t.startLineNumber;let s=t.startColumn,a=n[0].range,l=null;for(const d of n)a=B.plusRange(a,d.range),d.range.startLineNumber===o&&d.range.endLineNumber===o&&(s=Math.max(Math.min(s,d.range.startColumn),r)),d.forceShowAtRange&&(l=d.range);const c=l?l.getStartPosition():new ae(o,t.startColumn),u=l?l.getStartPosition():new ae(o,s);return{showAtPosition:c,showAtSecondaryPosition:u,highlightRange:a}}showsOrWillShow(e){if(this._widget.isResizing)return!0;const t=[];for(const r of this._participants)if(r.suggestHoverAnchor){const o=r.suggestHoverAnchor(e);o&&t.push(o)}const n=e.target;if(n.type===6&&t.push(new T9(0,n.range,e.event.posx,e.event.posy)),n.type===7){const r=this._editor.getOption(50).typicalHalfwidthCharacterWidth/2;!n.detail.isAfterLines&&typeof n.detail.horizontalDistanceToText=="number"&&n.detail.horizontalDistanceToTexto.priority-r.priority),this._startShowingOrUpdateHover(t[0],0,0,!1,e))}startShowingAtRange(e,t,n,r){this._startShowingOrUpdateHover(new T9(0,e,void 0,void 0),t,n,r,null)}containsNode(e){return e?this._widget.getDomNode().contains(e):!1}focus(){this._widget.focus()}scrollUp(){this._widget.scrollUp()}scrollDown(){this._widget.scrollDown()}scrollLeft(){this._widget.scrollLeft()}scrollRight(){this._widget.scrollRight()}pageUp(){this._widget.pageUp()}pageDown(){this._widget.pageDown()}goToTop(){this._widget.goToTop()}goToBottom(){this._widget.goToBottom()}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}get isColorPickerVisible(){return this._widget.isColorPickerVisible}get isVisibleFromKeyboard(){return this._widget.isVisibleFromKeyboard}get isVisible(){return this._widget.isVisible}get isFocused(){return this._widget.isFocused}get isResizing(){return this._widget.isResizing}get widget(){return this._widget}};mO._DECORATION_OPTIONS=sn.register({description:"content-hover-highlight",className:"hoverHighlight"});mO=BM=zY([G0(1,Ot),G0(2,ci)],mO);class $Ce{constructor(e,t,n){this.anchor=e,this.messages=t,this.isComplete=n}filter(e){const t=this.messages.filter(n=>n.isValidForHoverAnchor(e));return t.length===this.messages.length?this:new hit(this,this.anchor,t,this.isComplete)}}class hit extends $Ce{constructor(e,t,n,r){super(t,n,r),this.original=e}filter(e){return this.original.filter(e)}}class fit{constructor(e,t,n,r,o,s,a,l,c,u){this.initialMousePosX=e,this.initialMousePosY=t,this.colorPicker=n,this.showAtPosition=r,this.showAtSecondaryPosition=o,this.preferAbove=s,this.stoleFocus=a,this.source=l,this.isBeforeContent=c,this.disposables=u,this.closestMouseDistance=void 0}}const kae=30,N9=10,git=6;let Iv=qh=class extends dit{get isColorPickerVisible(){var e;return!!(!((e=this._visibleData)===null||e===void 0)&&e.colorPicker)}get isVisibleFromKeyboard(){var e;return((e=this._visibleData)===null||e===void 0?void 0:e.source)===1}get isVisible(){var e;return(e=this._hoverVisibleKey.get())!==null&&e!==void 0?e:!1}get isFocused(){var e;return(e=this._hoverFocusedKey.get())!==null&&e!==void 0?e:!1}constructor(e,t,n,r,o){const s=e.getOption(67)+8,a=150,l=new Kn(a,s);super(e,l),this._configurationService=n,this._accessibilityService=r,this._keybindingService=o,this._hover=this._register(new TX),this._minimumSize=l,this._hoverVisibleKey=j.hoverVisible.bindTo(t),this._hoverFocusedKey=j.hoverFocused.bindTo(t),ke(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._register(this._editor.onDidLayoutChange(()=>{this.isVisible&&this._updateMaxDimensions()})),this._register(this._editor.onDidChangeConfiguration(u=>{u.hasChanged(50)&&this._updateFont()}));const c=this._register(dh(this._resizableNode.domNode));this._register(c.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(c.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._setHoverData(void 0),this._editor.addContentWidget(this)}dispose(){var e;super.dispose(),(e=this._visibleData)===null||e===void 0||e.disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return qh.ID}static _applyDimensions(e,t,n){const r=typeof t=="number"?`${t}px`:t,o=typeof n=="number"?`${n}px`:n;e.style.width=r,e.style.height=o}_setContentsDomNodeDimensions(e,t){const n=this._hover.contentsDomNode;return qh._applyDimensions(n,e,t)}_setContainerDomNodeDimensions(e,t){const n=this._hover.containerDomNode;return qh._applyDimensions(n,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,n){const r=typeof t=="number"?`${t}px`:t,o=typeof n=="number"?`${n}px`:n;e.style.maxWidth=r,e.style.maxHeight=o}_setHoverWidgetMaxDimensions(e,t){qh._applyMaxDimensions(this._hover.contentsDomNode,e,t),qh._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?`${e}px`:e),this._layoutContentWidget()}_hasHorizontalScrollbar(){const e=this._hover.scrollbar.getScrollDimensions();return e.scrollWidth>e.width}_adjustContentsBottomPadding(){const e=this._hover.contentsDomNode,t=`${this._hover.scrollbar.options.horizontalScrollbarSize}px`;e.style.paddingBottom!==t&&(e.style.paddingBottom=t)}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none");const t=e.width,n=e.height;this._setHoverWidgetDimensions(t,n),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._setContentsDomNodeDimensions(t,n-N9))}_updateResizableNodeMaxDimensions(){var e,t;const n=(e=this._findMaximumRenderingWidth())!==null&&e!==void 0?e:1/0,r=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._resizableNode.maxSize=new Kn(n,r),this._setHoverWidgetMaxDimensions(n,r)}_resize(e){var t,n;qh._lastDimensions=new Kn(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),(n=(t=this._visibleData)===null||t===void 0?void 0:t.colorPicker)===null||n===void 0||n.layout()}_findAvailableSpaceVertically(){var e;const t=(e=this._visibleData)===null||e===void 0?void 0:e.showAtPosition;if(t)return this._positionPreference===1?this._availableVerticalSpaceAbove(t):this._availableVerticalSpaceBelow(t)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let t=git;return Array.from(this._hover.contentsDomNode.children).forEach(n=>{t+=n.clientHeight}),this._hasHorizontalScrollbar()&&(t+=N9),Math.min(e,t)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const e=Array.from(this._hover.contentsDomNode.children).some(t=>t.scrollWidth>t.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const e=this._isHoverTextOverflowing(),t=typeof this._contentWidth>"u"?0:this._contentWidth-2;return e||this._hover.containerDomNode.clientWidth"u"||typeof this._visibleData.initialMousePosY>"u")return this._visibleData.initialMousePosX=e,this._visibleData.initialMousePosY=t,!1;const n=Br(this.getDomNode());typeof this._visibleData.closestMouseDistance>"u"&&(this._visibleData.closestMouseDistance=Tae(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,n.left,n.top,n.width,n.height));const r=Tae(e,t,n.left,n.top,n.width,n.height);return r>this._visibleData.closestMouseDistance+4?!1:(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,r),!0)}_setHoverData(e){var t;(t=this._visibleData)===null||t===void 0||t.disposables.dispose(),this._visibleData=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_updateFont(){const{fontSize:e,lineHeight:t}=this._editor.getOption(50),n=this._hover.contentsDomNode;n.style.fontSize=`${e}px`,n.style.lineHeight=`${t/e}`,Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(o=>this._editor.applyFontInfo(o))}_updateContent(e){const t=this._hover.contentsDomNode;t.style.paddingBottom="",t.textContent="",t.appendChild(e)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){const e=Math.max(this._editor.getLayoutInfo().height/4,250,qh._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,qh._lastDimensions.width);this._setHoverWidgetMaxDimensions(t,e)}_render(e,t){this._setHoverData(t),this._updateFont(),this._updateContent(e),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){var e;return this._visibleData?{position:this._visibleData.showAtPosition,secondaryPosition:this._visibleData.showAtSecondaryPosition,positionAffinity:this._visibleData.isBeforeContent?3:void 0,preference:[(e=this._positionPreference)!==null&&e!==void 0?e:1]}:null}showAt(e,t){var n,r,o,s;if(!this._editor||!this._editor.hasModel())return;this._render(e,t);const a=qg(this._hover.containerDomNode),l=t.showAtPosition;this._positionPreference=(n=this._findPositionPreference(a,l))!==null&&n!==void 0?n:1,this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),(r=t.colorPicker)===null||r===void 0||r.layout();const u=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&y_e(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(s=(o=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||o===void 0?void 0:o.getAriaLabel())!==null&&s!==void 0?s:"");u&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+u)}hide(){if(!this._visibleData)return;const e=this._visibleData.stoleFocus||this._hoverFocusedKey.get();this._setHoverData(void 0),this._resizableNode.maxSize=new Kn(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){const e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions("auto","auto")}_adjustHoverHeightForScrollbar(e){var t;const n=this._hover.containerDomNode,r=this._hover.contentsDomNode,o=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._setContainerDomNodeDimensions(ua(n),Math.min(o,e)),this._setContentsDomNodeDimensions(ua(r),Math.min(o,e-N9))}setMinimumDimensions(e){this._minimumSize=new Kn(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=typeof this._contentWidth>"u"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new Kn(e,this._minimumSize.height)}onContentsChanged(){var e;this._removeConstraintsRenderNormally();const t=this._hover.containerDomNode;let n=qg(t),r=ua(t);if(this._resizableNode.layout(n,r),this._setHoverWidgetDimensions(r,n),n=qg(t),r=ua(t),this._contentWidth=r,this._updateMinimumWidth(),this._resizableNode.layout(n,r),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._adjustHoverHeightForScrollbar(n)),!((e=this._visibleData)===null||e===void 0)&&e.showAtPosition){const o=qg(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(o,this._visibleData.showAtPosition)}this._layoutContentWidget()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-kae})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+kae})}pageUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e-t})}pageDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e+t})}goToTop(){this._hover.scrollbar.setScrollPosition({scrollTop:0})}goToBottom(){this._hover.scrollbar.setScrollPosition({scrollTop:this._hover.scrollbar.getScrollDimensions().scrollHeight})}};Iv.ID="editor.contrib.resizableContentHoverWidget";Iv._lastDimensions=new Kn(0,0);Iv=qh=zY([G0(1,Vt),G0(2,gn),G0(3,ud),G0(4,ci)],Iv);let vO=class extends fe{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=Iae("div.hover-row.status-bar"),this.actionsElement=ke(this.hoverElement,Iae("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),n=t?t.getLabel():null;return this._hasContent=!0,this._register(G4.render(this.actionsElement,e,n))}append(e){const t=ke(this.actionsElement,e);return this._hasContent=!0,t}};vO=zY([G0(0,ci)],vO);class _O{get anchor(){return this._anchor}set anchor(e){this._anchor=e}get shouldFocus(){return this._shouldFocus}set shouldFocus(e){this._shouldFocus=e}get source(){return this._source}set source(e){this._source=e}get insistOnKeepingHoverVisible(){return this._insistOnKeepingHoverVisible}set insistOnKeepingHoverVisible(e){this._insistOnKeepingHoverVisible=e}constructor(e,t){this._editor=e,this._participants=t,this._anchor=null,this._shouldFocus=!1,this._source=0,this._insistOnKeepingHoverVisible=!1}static _getLineDecorations(e,t){if(t.type!==1&&!t.supportsMarkerHover)return[];const n=e.getModel(),r=t.range.startLineNumber;if(r>n.getLineCount())return[];const o=n.getLineMaxColumn(r);return e.getLineDecorations(r).filter(s=>{if(s.options.isWholeLine)return!0;const a=s.range.startLineNumber===r?s.range.startColumn:1,l=s.range.endLineNumber===r?s.range.endColumn:o;if(s.options.showIfCollapsed){if(a>t.range.startColumn+1||t.range.endColumn-1>l)return!1}else if(a>t.range.startColumn||t.range.endColumn>l)return!1;return!0})}computeAsync(e){const t=this._anchor;if(!this._editor.hasModel()||!t)return Kr.EMPTY;const n=_O._getLineDecorations(this._editor,t);return Kr.merge(this._participants.map(r=>r.computeAsync?r.computeAsync(t,n,e):Kr.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=_O._getLineDecorations(this._editor,this._anchor);let t=[];for(const n of this._participants)t=t.concat(n.computeSync(this._anchor,e));return lh(t)}}function Tae(i,e,t,n,r,o){const s=t+r/2,a=n+o/2,l=Math.max(Math.abs(i-s)-r/2,0),c=Math.max(Math.abs(e-a)-o/2,0);return Math.sqrt(l*l+c*c)}const Nae=He;class ew extends fe{constructor(e,t,n){super(),this._renderDisposeables=this._register(new Te),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new TX),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new Uf({editor:this._editor},t,n)),this._computer=new pit(this._editor),this._hoverOperation=this._register(new WCe(this._editor,this._computer)),this._register(this._hoverOperation.onResult(r=>{this._withResult(r.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(50)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return ew.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_onModelDecorationsChanged(){this._isVisible&&(this._hoverOperation.cancel(),this._hoverOperation.start(0))}startShowingAt(e,t){this._computer.lineNumber===e&&this._computer.lane===t||(this._hoverOperation.cancel(),this.hide(),this._computer.lineNumber=e,this._computer.lane=t,this._hoverOperation.start(0))}hide(){this._computer.lineNumber=-1,this._hoverOperation.cancel(),this._isVisible&&(this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible))}_withResult(e){this._messages=e,this._messages.length>0?this._renderMessages(this._computer.lineNumber,this._messages):this.hide()}_renderMessages(e,t){this._renderDisposeables.clear();const n=document.createDocumentFragment();for(const r of t){const o=Nae("div.hover-row.markdown-hover"),s=ke(o,Nae("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(r.value));s.appendChild(a.element),n.appendChild(o)}this._updateContents(n),this._showAt(e)}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}_showAt(e){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const t=this._editor.getLayoutInfo(),n=this._editor.getTopForLineNumber(e),r=this._editor.getScrollTop(),o=this._editor.getOption(67),s=this._hover.containerDomNode.clientHeight,a=n-r-(s-o)/2,l=t.glyphMarginLeft+t.glyphMarginWidth+(this._computer.lane==="lineNo"?t.lineNumbersWidth:0);this._hover.containerDomNode.style.left=`${l}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(a),0)}px`}}ew.ID="editor.contrib.modesGlyphHoverWidget";class pit{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}get lane(){return this._laneOrLine}set lane(e){this._laneOrLine=e}constructor(e){this._editor=e,this._lineNumber=-1,this._laneOrLine=$f.Center}computeSync(){var e,t;const n=a=>({value:a}),r=this._editor.getLineDecorations(this._lineNumber),o=[],s=this._laneOrLine==="lineNo";if(!r)return o;for(const a of r){const l=(t=(e=a.options.glyphMargin)===null||e===void 0?void 0:e.position)!==null&&t!==void 0?t:$f.Center;if(!s&&l!==this._laneOrLine)continue;const c=s?a.options.lineNumberHoverMessage:a.options.glyphMarginHoverMessage;!c||Hw(c)||o.push(...eq(c).map(n))}return o}}class mit{constructor(e,t,n){this.provider=e,this.hover=t,this.ordinal=n}}async function vit(i,e,t,n,r){try{const o=await Promise.resolve(i.provideHover(t,n,r));if(o&&bit(o))return new mit(i,o,e)}catch(o){Zr(o)}}function UY(i,e,t,n){const o=i.ordered(e).map((s,a)=>vit(s,a,e,t,n));return Kr.fromPromises(o).coalesce()}function _it(i,e,t,n){return UY(i,e,t,n).map(r=>r.hover).toPromise()}tg("_executeHoverProvider",(i,e,t)=>{const n=i.get(_t);return _it(n.hoverProvider,e,t,Cn.None)});function bit(i){const e=typeof i.range<"u",t=typeof i.contents<"u"&&i.contents&&i.contents.length>0;return e&&t}var Cit=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},QR=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Rae=He;class jd{constructor(e,t,n,r,o){this.owner=e,this.range=t,this.contents=n,this.isBeforeContent=r,this.ordinal=o}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let bO=class{constructor(e,t,n,r,o){this._editor=e,this._languageService=t,this._openerService=n,this._configurationService=r,this._languageFeaturesService=o,this.hoverOrdinal=3}createLoadingMessage(e){return new jd(this,e.range,[new Is().appendText(w("modesContentHover.loading","Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const n=this._editor.getModel(),r=e.range.startLineNumber,o=n.getLineMaxColumn(r),s=[];let a=1e3;const l=n.getLineLength(r),c=n.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),u=this._editor.getOption(117),d=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:c});let h=!1;u>=0&&l>u&&e.range.startColumn>=u&&(h=!0,s.push(new jd(this,e.range,[{value:w("stopped rendering","Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!h&&typeof d=="number"&&l>=d&&s.push(new jd(this,e.range,[{value:w("too many characters","Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,a++));let f=!1;for(const g of t){const p=g.range.startLineNumber===r?g.range.startColumn:1,v=g.range.endLineNumber===r?g.range.endColumn:o,m=g.options.hoverMessage;if(!m||Hw(m))continue;g.options.beforeContentClassName&&(f=!0);const _=new B(e.range.startLineNumber,p,e.range.startLineNumber,v);s.push(new jd(this,_,eq(m),f,a++))}return s}computeAsync(e,t,n){if(!this._editor.hasModel()||e.type!==1)return Kr.EMPTY;const r=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(r))return Kr.EMPTY;const o=new ae(e.range.startLineNumber,e.range.startColumn);return UY(this._languageFeaturesService.hoverProvider,r,o,n).filter(s=>!Hw(s.hover.contents)).map(s=>{const a=s.hover.range?B.lift(s.hover.range):e.range;return new jd(this,a,s.hover.contents,!1,s.ordinal)})}renderHoverParts(e,t){return HCe(e,t,this._editor,this._languageService,this._openerService)}};bO=Cit([QR(1,ji),QR(2,al),QR(3,gn),QR(4,_t)],bO);function HCe(i,e,t,n,r){e.sort((s,a)=>s.ordinal-a.ordinal);const o=new Te;for(const s of e)for(const a of s.contents){if(Hw(a))continue;const l=Rae("div.hover-row.markdown-hover"),c=ke(l,Rae("div.hover-contents")),u=o.add(new Uf({editor:t},n,r));o.add(u.onDidRenderAsync(()=>{c.className="hover-contents code-hover-contents",i.onContentsChanged()}));const d=o.add(u.render(a));c.appendChild(d.element),i.fragment.appendChild(l)}return o}var VCe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},CO=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class Mae{constructor(e,t,n){this.marker=e,this.index=t,this.total=n}}let Qz=class{constructor(e,t,n){this._markerService=t,this._configService=n,this._onDidChange=new se,this.onDidChange=this._onDidChange.event,this._dispoables=new Te,this._markers=[],this._nextIdx=-1,At.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const r=this._configService.getValue("problems.sortOrder"),o=(a,l)=>{let c=LD(a.resource.toString(),l.resource.toString());return c===0&&(r==="position"?c=B.compareRangesUsingStarts(a,l)||pr.compare(a.severity,l.severity):c=pr.compare(a.severity,l.severity)||B.compareRangesUsingStarts(a,l)),c},s=()=>{this._markers=this._markerService.read({resource:At.isUri(e)?e:void 0,severities:pr.Error|pr.Warning|pr.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(o)};s(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(l=>this._resourceFilter(l)))&&(s(),this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e?!0:!this._resourceFilter||!e?!1:this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new Mae(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,n){let r=!1,o=this._markers.findIndex(s=>s.resource.toString()===e.uri.toString());o<0&&(o=_D(this._markers,{resource:e.uri},(s,a)=>LD(s.resource.toString(),a.resource.toString())),o<0&&(o=~o));for(let s=o;sr.resource.toString()===e.toString());if(!(n<0)){for(;n=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},r1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},tU;class wit{constructor(e,t,n,r,o){this._openerService=r,this._labelService=o,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new Te,this._editor=t;const s=document.createElement("div");s.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),s.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),s.appendChild(this._relatedBlock),this._disposables.add(Sr(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&n(l)})),this._scrollable=new pve(s,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{s.style.left=`-${a.scrollLeft}px`,s.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){si(this._disposables)}update(e){const{source:t,message:n,relatedInformation:r,code:o}=e;let s=((t==null?void 0:t.length)||0)+2;o&&(typeof o=="string"?s+=o.length:s+=o.value.length);const a=Jf(n);this._lines=a.length,this._longestLineLength=0;for(const h of a)this._longestLineLength=Math.max(h.length+s,this._longestLineLength);Ns(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const h of a)l=document.createElement("div"),l.innerText=h,h===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||o){const h=document.createElement("span");if(h.classList.add("details"),l.appendChild(h),t){const f=document.createElement("span");f.innerText=t,f.classList.add("source"),h.appendChild(f)}if(o)if(typeof o=="string"){const f=document.createElement("span");f.innerText=`(${o})`,f.classList.add("code"),h.appendChild(f)}else{this._codeLink=He("a.code-link"),this._codeLink.setAttribute("href",`${o.target.toString()}`),this._codeLink.onclick=g=>{this._openerService.open(o.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()};const f=ke(this._codeLink,He("span"));f.innerText=o.value,h.appendChild(this._codeLink)}}if(Ns(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),Ts(r)){const h=this._relatedBlock.appendChild(document.createElement("div"));h.style.paddingTop=`${Math.floor(this._editor.getOption(67)*.66)}px`,this._lines+=1;for(const f of r){const g=document.createElement("div"),p=document.createElement("a");p.classList.add("filename"),p.innerText=`${this._labelService.getUriBasenameLabel(f.resource)}(${f.startLineNumber}, ${f.startColumn}): `,p.title=this._labelService.getUriLabel(f.resource),this._relatedDiagnostics.set(p,f);const v=document.createElement("span");v.innerText=f.message,g.appendChild(p),g.appendChild(v),this._lines+=1,h.appendChild(g)}}const c=this._editor.getOption(50),u=Math.ceil(c.typicalFullwidthCharacterWidth*this._longestLineLength*.75),d=c.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:u,scrollHeight:d})}layout(e,t){this._scrollable.getDomNode().style.height=`${e}px`,this._scrollable.getDomNode().style.width=`${t}px`,this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case pr.Error:t=w("Error","Error");break;case pr.Warning:t=w("Warning","Warning");break;case pr.Info:t=w("Info","Info");break;case pr.Hint:t=w("Hint","Hint");break}let n=w("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const r=this._editor.getModel();return r&&e.startLineNumber<=r.getLineCount()&&e.startLineNumber>=1&&(n=`${r.getLineContent(e.startLineNumber)}, ${n}`),n}}let tS=tU=class extends pO{constructor(e,t,n,r,o,s,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},o),this._themeService=t,this._openerService=n,this._menuService=r,this._contextKeyService=s,this._labelService=a,this._callOnDispose=new Te,this._onDidSelectRelatedInformation=new se,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=pr.Warning,this._backgroundColor=me.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(Eit);let t=nU,n=Sit;this._severity===pr.Warning?(t=WM,n=xit):this._severity===pr.Info&&(t=iU,n=Lit);const r=e.getColor(t),o=e.getColor(n);this.style({arrowColor:r,frameColor:r,headerBackgroundColor:o,primaryHeadingColor:e.getColor(kCe),secondaryHeadingColor:e.getColor(TCe)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(e){super._fillHead(e),this._disposables.add(this._actionbarWidget.actionRunner.onWillRun(r=>this.editor.focus()));const t=[],n=this._menuService.createMenu(tU.TitleMenu,this._contextKeyService);i3(n,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),n.dispose()}_fillTitleIcon(e){this._icon=ke(e,He(""))}_fillBody(e){this._parentContainer=e,e.classList.add("marker-widget"),this._parentContainer.tabIndex=0,this._parentContainer.setAttribute("role","tooltip"),this._container=document.createElement("div"),e.appendChild(this._container),this._message=new wit(this._container,this.editor,t=>this._onDidSelectRelatedInformation.fire(t),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(e,t,n){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const r=B.lift(e),o=this.editor.getPosition(),s=o&&r.containsPosition(o)?o:r.getStartPosition();super.show(s,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=n>1?w("problems","{0} of {1} problems",t,n):w("change","{0} of {1} problem",t,n);this.setTitle(su(a.uri),l)}this._icon.className=`codicon ${eU.className(pr.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(s,0),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}};tS.TitleMenu=new $("gotoErrorTitleMenu");tS=tU=yit([r1(1,To),r1(2,al),r1(3,hu),r1(4,Ot),r1(5,Vt),r1(6,Vw)],tS);const Aae=VD(wf,Y7e),Pae=VD(qs,$D),Oae=VD(Za,HD),nU=X("editorMarkerNavigationError.background",{dark:Aae,light:Aae,hcDark:Sn,hcLight:Sn},w("editorMarkerNavigationError","Editor marker navigation widget error color.")),Sit=X("editorMarkerNavigationError.headerBackground",{dark:It(nU,.1),light:It(nU,.1),hcDark:null,hcLight:null},w("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),WM=X("editorMarkerNavigationWarning.background",{dark:Pae,light:Pae,hcDark:Sn,hcLight:Sn},w("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),xit=X("editorMarkerNavigationWarning.headerBackground",{dark:It(WM,.1),light:It(WM,.1),hcDark:"#0C141F",hcLight:It(WM,.2)},w("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),iU=X("editorMarkerNavigationInfo.background",{dark:Oae,light:Oae,hcDark:Sn,hcLight:Sn},w("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),Lit=X("editorMarkerNavigationInfo.headerBackground",{dark:It(iU,.1),light:It(iU,.1),hcDark:null,hcLight:null},w("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),Eit=X("editorMarkerNavigation.background",{dark:Eo,light:Eo,hcDark:Eo,hcLight:Eo},w("editorMarkerNavigationBackground","Editor marker navigation widget background."));var Dit=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},JR=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},HL;let c_=HL=class{static get(e){return e.getContribution(HL.ID)}constructor(e,t,n,r,o){this._markerNavigationService=t,this._contextKeyService=n,this._editorService=r,this._instantiationService=o,this._sessionDispoables=new Te,this._editor=e,this._widgetVisible=UCe.bindTo(this._contextKeyService)}dispose(){this._cleanUp(),this._sessionDispoables.dispose()}_cleanUp(){this._widgetVisible.reset(),this._sessionDispoables.clear(),this._widget=void 0,this._model=void 0}_getOrCreateModel(e){if(this._model&&this._model.matches(e))return this._model;let t=!1;return this._model&&(t=!0,this._cleanUp()),this._model=this._markerNavigationService.getMarkerList(e),t&&this._model.move(!0,this._editor.getModel(),this._editor.getPosition()),this._widget=this._instantiationService.createInstance(tS,this._editor),this._widget.onDidClose(()=>this.close(),this,this._sessionDispoables),this._widgetVisible.set(!0),this._sessionDispoables.add(this._model),this._sessionDispoables.add(this._widget),this._sessionDispoables.add(this._editor.onDidChangeCursorPosition(n=>{var r,o,s;(!(!((r=this._model)===null||r===void 0)&&r.selected)||!B.containsPosition((o=this._model)===null||o===void 0?void 0:o.selected.marker,n.position))&&((s=this._model)===null||s===void 0||s.resetIndex())})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const n=this._model.find(this._editor.getModel().uri,this._widget.position);n?this._widget.updateMarker(n.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(n=>{this._editorService.openCodeEditor({resource:n.resource,options:{pinned:!0,revealIfOpened:!0,selection:B.lift(n).collapseToStart()}},this._editor),this.close(!1)})),this._sessionDispoables.add(this._editor.onDidChangeModel(()=>this._cleanUp())),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(this._editor.hasModel()){const t=this._getOrCreateModel(this._editor.getModel().uri);t.resetIndex(),t.move(!0,this._editor.getModel(),new ae(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}async nagivate(e,t){var n,r;if(this._editor.hasModel()){const o=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(o.move(e,this._editor.getModel(),this._editor.getPosition()),!o.selected)return;if(o.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const s=await this._editorService.openCodeEditor({resource:o.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:o.selected.marker}},this._editor);s&&((n=HL.get(s))===null||n===void 0||n.close(),(r=HL.get(s))===null||r===void 0||r.nagivate(e,t))}else this._widget.showAtMarker(o.selected.marker,o.selected.index,o.selected.total)}}};c_.ID="editor.contrib.markerController";c_=HL=Dit([JR(1,zCe),JR(2,Vt),JR(3,Un),JR(4,Ot)],c_);class $3 extends gt{constructor(e,t,n){super(n),this._next=e,this._multiFile=t}async run(e,t){var n;t.hasModel()&&((n=c_.get(t))===null||n===void 0||n.nagivate(this._next,this._multiFile))}}class kv extends $3{constructor(){super(!0,!1,{id:kv.ID,label:kv.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:j.focus,primary:578,weight:100},menuOpts:{menuId:tS.TitleMenu,title:kv.LABEL,icon:Mr("marker-navigation-next",Xe.arrowDown,w("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}kv.ID="editor.action.marker.next";kv.LABEL=w("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class db extends $3{constructor(){super(!1,!1,{id:db.ID,label:db.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:j.focus,primary:1602,weight:100},menuOpts:{menuId:tS.TitleMenu,title:db.LABEL,icon:Mr("marker-navigation-previous",Xe.arrowUp,w("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}db.ID="editor.action.marker.prev";db.LABEL=w("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class Iit extends $3{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:w("markerAction.nextInFiles.label","Go to Next Problem in Files (Error, Warning, Info)"),alias:"Go to Next Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:j.focus,primary:66,weight:100},menuOpts:{menuId:$.MenubarGoMenu,title:w({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class kit extends $3{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:w("markerAction.previousInFiles.label","Go to Previous Problem in Files (Error, Warning, Info)"),alias:"Go to Previous Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:j.focus,primary:1090,weight:100},menuOpts:{menuId:$.MenubarGoMenu,title:w({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}jn(c_.ID,c_,4);Be(kv);Be(db);Be(Iit);Be(kit);const UCe=new st("markersNavigationVisible",!1),Tit=Vo.bindToContribution(c_.get);et(new Tit({id:"closeMarkersNavigation",precondition:UCe,handler:i=>i.close(),kbOpts:{weight:100+50,kbExpr:j.focus,primary:9,secondary:[1033]}}));var Nit=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},R9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Iu=He;class Rit{constructor(e,t,n){this.owner=e,this.range=t,this.marker=n}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const Fae={type:1,filter:{include:Ut.QuickFix},triggerAction:Tl.QuickFixHover};let rU=class{constructor(e,t,n,r){this._editor=e,this._markerDecorationsService=t,this._openerService=n,this._languageFeaturesService=r,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1&&!e.supportsMarkerHover)return[];const n=this._editor.getModel(),r=e.range.startLineNumber,o=n.getLineMaxColumn(r),s=[];for(const a of t){const l=a.range.startLineNumber===r?a.range.startColumn:1,c=a.range.endLineNumber===r?a.range.endColumn:o,u=this._markerDecorationsService.getMarker(n.uri,a);if(!u)continue;const d=new B(e.range.startLineNumber,l,e.range.startLineNumber,c);s.push(new Rit(this,d,u))}return s}renderHoverParts(e,t){if(!t.length)return fe.None;const n=new Te;t.forEach(o=>e.fragment.appendChild(this.renderMarkerHover(o,n)));const r=t.length===1?t[0]:t.sort((o,s)=>pr.compare(o.marker.severity,s.marker.severity))[0];return this.renderMarkerStatusbar(e,r,n),n}renderMarkerHover(e,t){const n=Iu("div.hover-row"),r=ke(n,Iu("div.marker.hover-contents")),{source:o,message:s,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(r);const c=ke(r,Iu("span"));if(c.style.whiteSpace="pre-wrap",c.innerText=s,o||a)if(a&&typeof a!="string"){const u=Iu("span");if(o){const g=ke(u,Iu("span"));g.innerText=o}const d=ke(u,Iu("a.code-link"));d.setAttribute("href",a.target.toString()),t.add(ye(d,"click",g=>{this._openerService.open(a.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()}));const h=ke(d,Iu("span"));h.innerText=a.value;const f=ke(r,u);f.style.opacity="0.6",f.style.paddingLeft="6px"}else{const u=ke(r,Iu("span"));u.style.opacity="0.6",u.style.paddingLeft="6px",u.innerText=o&&a?`${o}(${a})`:o||`(${a})`}if(Ts(l))for(const{message:u,resource:d,startLineNumber:h,startColumn:f}of l){const g=ke(r,Iu("div"));g.style.marginTop="8px";const p=ke(g,Iu("a"));p.innerText=`${su(d)}(${h}, ${f}): `,p.style.cursor="pointer",t.add(ye(p,"click",m=>{m.stopPropagation(),m.preventDefault(),this._openerService&&this._openerService.open(d,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:h,startColumn:f}}}).catch(en)}));const v=ke(g,Iu("span"));v.innerText=u,this._editor.applyFontInfo(v)}return n}renderMarkerStatusbar(e,t,n){if(t.marker.severity===pr.Error||t.marker.severity===pr.Warning||t.marker.severity===pr.Info){const r=c_.get(this._editor);r&&e.statusBar.addAction({label:w("view problem","View Problem"),commandId:kv.ID,run:()=>{e.hide(),r.showAtMarker(t.marker),this._editor.focus()}})}if(!this._editor.getOption(91)){const r=e.statusBar.append(Iu("div"));this.recentMarkerCodeActionsInfo&&(HP.makeKey(this.recentMarkerCodeActionsInfo.marker)===HP.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(r.textContent=w("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?fe.None:Kv(()=>r.textContent=w("checkingForQuickFixes","Checking for quick fixes..."),200,n);r.textContent||(r.textContent=String.fromCharCode(160));const s=this.getCodeActions(t.marker);n.add(Rt(()=>s.cancel())),s.then(a=>{if(o.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),r.textContent=w("noQuickFixes","No quick fixes available");return}r.style.display="none";let l=!1;n.add(Rt(()=>{l||a.dispose()})),e.statusBar.addAction({label:w("quick fixes","Quick Fix..."),commandId:PY,run:c=>{l=!0;const u=r_.get(this._editor),d=Br(c);e.hide(),u==null||u.showCodeActions(Fae,a,{x:d.left,y:d.top,width:d.width,height:d.height})}})},en)}}getCodeActions(e){return Io(t=>ME(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new B(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),Fae,mp.None,t))}};rU=Nit([R9(1,Gq),R9(2,al),R9(3,_t)],rU);const jCe="editor.action.inlineSuggest.commit",KCe="editor.action.inlineSuggest.showPrevious",GCe="editor.action.inlineSuggest.showNext";var jY=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Kd=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},$M;let oU=class extends fe{constructor(e,t,n){super(),this.editor=e,this.model=t,this.instantiationService=n,this.alwaysShowToolbar=Vi(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=Yt(this,r=>{var o,s,a;const l=(o=this.model.read(r))===null||o===void 0?void 0:o.primaryGhostText.read(r);if(!this.alwaysShowToolbar.read(r)||!l||l.parts.length===0)return this.sessionPosition=void 0,null;const c=l.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==l.lineNumber&&(this.sessionPosition=void 0);const u=new ae(l.lineNumber,Math.min(c,(a=(s=this.sessionPosition)===null||s===void 0?void 0:s.column)!==null&&a!==void 0?a:Number.MAX_SAFE_INTEGER));return this.sessionPosition=u,u}),this._register(Dh((r,o)=>{const s=this.model.read(r);if(!s||!this.alwaysShowToolbar.read(r))return;const a=o.add(this.instantiationService.createInstance(u_,this.editor,!0,this.position,s.selectedInlineCompletionIndex,s.inlineCompletionsCount,s.selectedInlineCompletion.map(l=>{var c;return(c=l==null?void 0:l.inlineCompletion.source.inlineCompletions.commands)!==null&&c!==void 0?c:[]})));e.addContentWidget(a),o.add(Rt(()=>e.removeContentWidget(a))),o.add(bn(l=>{this.position.read(l)&&s.lastTriggerKind.read(l)!==fp.Explicit&&s.triggerExplicitly()}))}))}};oU=jY([Kd(2,Ot)],oU);const Mit=Mr("inline-suggestion-hints-next",Xe.chevronRight,w("parameterHintsNextIcon","Icon for show next parameter hint.")),Ait=Mr("inline-suggestion-hints-previous",Xe.chevronLeft,w("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let u_=$M=class extends fe{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,n){const r=new xl(e,t,n,!0,()=>this._commandService.executeCommand(e)),o=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let s=t;return o&&(s=w({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",t,o.getLabel())),r.tooltip=s,r}constructor(e,t,n,r,o,s,a,l,c,u,d){super(),this.editor=e,this.withBorder=t,this._position=n,this._currentSuggestionIdx=r,this._suggestionCount=o,this._extraCommands=s,this._commandService=a,this.keybindingService=c,this._contextKeyService=u,this._menuService=d,this.id=`InlineSuggestionHintsContentWidget${$M.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=gi("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[gi("div@toolBar")]),this.previousAction=this.createCommandAction(KCe,w("previous","Previous"),Wt.asClassName(Ait)),this.availableSuggestionCountAction=new xl("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(GCe,w("next","Next"),Wt.asClassName(Mit)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu($.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new pi(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new pi(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.lastCommands=[],this.toolBar=this._register(l.createInstance(sU,this.nodes.toolBar,$.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:h=>h.startsWith("primary")},actionViewItemProvider:(h,f)=>{if(h instanceof pc)return l.createInstance(Oit,h,void 0);if(h===this.availableSuggestionCountAction){const g=new Pit(void 0,h,{label:!0,icon:!1});return g.setClass("availableSuggestionCount"),g}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(h=>{$M._dropDownVisible=h})),this._register(bn(h=>{this._position.read(h),this.editor.layoutContentWidget(this)})),this._register(bn(h=>{const f=this._suggestionCount.read(h),g=this._currentSuggestionIdx.read(h);f!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${g+1}/${f}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),f!==void 0&&f>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(bn(h=>{const f=this._extraCommands.read(h);if(or(this.lastCommands,f))return;this.lastCommands=f;const g=f.map(p=>({class:void 0,id:p.id,enabled:!0,tooltip:p.tooltip||"",label:p.title,run:v=>this._commandService.executeCommand(p.id)}));for(const[p,v]of this.inlineCompletionsActionsMenus.getActions())for(const m of v)m instanceof pc&&g.push(m);g.length>0&&g.unshift(new lo),this.toolBar.setAdditionalSecondaryActions(g)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};u_._dropDownVisible=!1;u_.id=0;u_=$M=jY([Kd(6,sr),Kd(7,Ot),Kd(8,ci),Kd(9,Vt),Kd(10,hu)],u_);class Pit extends jw{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}updateTooltip(){}}let Oit=class extends t_{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=gi("div.keybinding").root;new PS(t,yl,{disableTitle:!0,...S0e}).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}updateTooltip(){}},sU=class extends LI{constructor(e,t,n,r,o,s,a,l){super(e,{resetMenu:t,...n},r,o,s,a,l),this.menuId=t,this.options2=n,this.menuService=r,this.contextKeyService=o,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var e,t,n,r,o,s,a;const l=[],c=[];i3(this.menu,(e=this.options2)===null||e===void 0?void 0:e.menuOptions,{primary:l,secondary:c},(n=(t=this.options2)===null||t===void 0?void 0:t.toolbarOptions)===null||n===void 0?void 0:n.primaryGroup,(o=(r=this.options2)===null||r===void 0?void 0:r.toolbarOptions)===null||o===void 0?void 0:o.shouldInlineSubmenu,(a=(s=this.options2)===null||s===void 0?void 0:s.toolbarOptions)===null||a===void 0?void 0:a.useSeparatorsInPrimaryActions),c.push(...this.additionalActions),l.unshift(...this.prependedPrimaryActions),this.setActions(l,c)}setPrependedPrimaryActions(e){or(this.prependedPrimaryActions,e,(t,n)=>t===n)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){or(this.additionalActions,e,(t,n)=>t===n)||(this.additionalActions=e,this.updateToolbar())}};sU=jY([Kd(3,hu),Kd(4,Vt),Kd(5,Ol),Kd(6,ci),Kd(7,ea)],sU);var Fit=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},e2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},aU;const Bit=!1;let rl=aU=class extends fe{constructor(e,t,n,r,o){super(),this._editor=e,this._instantiationService=t,this._openerService=n,this._languageService=r,this._keybindingService=o,this._listenersStore=new Te,this._hoverState={mouseDown:!1,contentHoverFocused:!1,activatedByDecoratorClick:!1},this._reactToEditorMouseMoveRunner=this._register(new pi(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookListeners(),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(60)&&(this._unhookListeners(),this._hookListeners())}))}static get(e){return e.getContribution(aU.ID)}_hookListeners(){const e=this._editor.getOption(60);this._hoverSettings={enabled:e.enabled,sticky:e.sticky,hidingDelay:e.delay},e.enabled?(this._listenersStore.add(this._editor.onMouseDown(t=>this._onEditorMouseDown(t))),this._listenersStore.add(this._editor.onMouseUp(()=>this._onEditorMouseUp())),this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))):(this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))),this._listenersStore.add(this._editor.onMouseLeave(t=>this._onEditorMouseLeave(t))),this._listenersStore.add(this._editor.onDidChangeModel(()=>{this._cancelScheduler(),this._hideWidgets()})),this._listenersStore.add(this._editor.onDidChangeModelContent(()=>this._cancelScheduler())),this._listenersStore.add(this._editor.onDidScrollChange(t=>this._onEditorScrollChanged(t)))}_unhookListeners(){this._listenersStore.clear()}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){var t;this._hoverState.mouseDown=!0;const n=e.target;if(n.type===9&&n.detail===Iv.ID){this._hoverState.contentHoverFocused=!0;return}n.type===12&&n.detail===ew.ID||(n.type!==12&&(this._hoverState.contentHoverFocused=!1),!(!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing)&&this._hideWidgets())}_onEditorMouseUp(){this._hoverState.mouseDown=!1}_onEditorMouseLeave(e){var t,n;this._cancelScheduler();const r=e.event.browserEvent.relatedTarget;!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing||!((n=this._contentWidget)===null||n===void 0)&&n.containsNode(r)||this._hideWidgets()}_isMouseOverWidget(e){var t,n,r,o,s;const a=e.target,l=this._hoverSettings.sticky;return!!(l&&a.type===9&&a.detail===Iv.ID||l&&(!((t=this._contentWidget)===null||t===void 0)&&t.containsNode((n=e.event.browserEvent.view)===null||n===void 0?void 0:n.document.activeElement))&&!(!((o=(r=e.event.browserEvent.view)===null||r===void 0?void 0:r.getSelection())===null||o===void 0)&&o.isCollapsed)||!l&&a.type===9&&a.detail===Iv.ID&&(!((s=this._contentWidget)===null||s===void 0)&&s.isColorPickerVisible)||l&&a.type===12&&a.detail===ew.ID)}_onEditorMouseMove(e){var t,n,r,o;if(this._mouseMoveEvent=e,!((t=this._contentWidget)===null||t===void 0)&&t.isFocused||!((n=this._contentWidget)===null||n===void 0)&&n.isResizing||this._hoverState.mouseDown&&this._hoverState.contentHoverFocused)return;const s=this._hoverSettings.sticky;if(s&&(!((r=this._contentWidget)===null||r===void 0)&&r.isVisibleFromKeyboard))return;if(this._isMouseOverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}const l=this._hoverSettings.hidingDelay;if(!((o=this._contentWidget)===null||o===void 0)&&o.isVisible&&s&&l>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(l);return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){var t,n,r,o;if(!e)return;const s=e.target,a=(t=s.element)===null||t===void 0?void 0:t.classList.contains("colorpicker-color-decoration"),l=this._editor.getOption(147),c=this._hoverSettings.enabled,u=this._hoverState.activatedByDecoratorClick;if(a&&(l==="click"&&!u||l==="hover"&&!c&&!Bit||l==="clickAndHover"&&!c&&!u)||!a&&!c&&!u){this._hideWidgets();return}if(this._getOrCreateContentWidget().showsOrWillShow(e)){(n=this._glyphWidget)===null||n===void 0||n.hide();return}if(s.type===2&&s.position&&s.detail.glyphMarginLane){(r=this._contentWidget)===null||r===void 0||r.hide(),this._getOrCreateGlyphWidget().startShowingAt(s.position.lineNumber,s.detail.glyphMarginLane);return}if(s.type===3&&s.position){(o=this._contentWidget)===null||o===void 0||o.hide(),this._getOrCreateGlyphWidget().startShowingAt(s.position.lineNumber,"lineNo");return}this._hideWidgets()}_onKeyDown(e){var t;if(!this._editor.hasModel())return;const n=this._keybindingService.softDispatch(e,this._editor.getDomNode()),r=n.kind===1||n.kind===2&&n.commandId==="editor.action.showHover"&&((t=this._contentWidget)===null||t===void 0?void 0:t.isVisible);e.keyCode===5||e.keyCode===6||e.keyCode===57||e.keyCode===4||r||this._hideWidgets()}_hideWidgets(){var e,t,n;this._hoverState.mouseDown&&this._hoverState.contentHoverFocused&&(!((e=this._contentWidget)===null||e===void 0)&&e.isColorPickerVisible)||u_.dropDownVisible||(this._hoverState.activatedByDecoratorClick=!1,this._hoverState.contentHoverFocused=!1,(t=this._glyphWidget)===null||t===void 0||t.hide(),(n=this._contentWidget)===null||n===void 0||n.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(mO,this._editor)),this._contentWidget}_getOrCreateGlyphWidget(){return this._glyphWidget||(this._glyphWidget=new ew(this._editor,this._languageService,this._openerService)),this._glyphWidget}showContentHover(e,t,n,r,o=!1){this._hoverState.activatedByDecoratorClick=o,this._getOrCreateContentWidget().startShowingAtRange(e,t,n,r)}focus(){var e;(e=this._contentWidget)===null||e===void 0||e.focus()}scrollUp(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollUp()}scrollDown(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollDown()}scrollLeft(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollLeft()}scrollRight(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollRight()}pageUp(){var e;(e=this._contentWidget)===null||e===void 0||e.pageUp()}pageDown(){var e;(e=this._contentWidget)===null||e===void 0||e.pageDown()}goToTop(){var e;(e=this._contentWidget)===null||e===void 0||e.goToTop()}goToBottom(){var e;(e=this._contentWidget)===null||e===void 0||e.goToBottom()}get isColorPickerVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isColorPickerVisible}get isHoverVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isVisible}dispose(){var e,t;super.dispose(),this._unhookListeners(),this._listenersStore.dispose(),(e=this._glyphWidget)===null||e===void 0||e.dispose(),(t=this._contentWidget)===null||t===void 0||t.dispose()}};rl.ID="editor.contrib.hover";rl=aU=Fit([e2(1,Ot),e2(2,al),e2(3,ji),e2(4,ci)],rl);var Dd;(function(i){i.NoAutoFocus="noAutoFocus",i.FocusIfVisible="focusIfVisible",i.AutoFocusImmediately="autoFocusImmediately"})(Dd||(Dd={}));class Wit extends gt{constructor(){super({id:"editor.action.showHover",label:w({key:"showOrFocusHover",comment:["Label for action that will trigger the showing/focusing of a hover in the editor.","If the hover is not visible, it will show the hover.","This allows for users to show the hover without using the mouse."]},"Show or Focus Hover"),metadata:{description:"Show or Focus Hover",args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if and when the hover should take focus upon being triggered by this action.",enum:[Dd.NoAutoFocus,Dd.FocusIfVisible,Dd.AutoFocusImmediately],enumDescriptions:[w("showOrFocusHover.focus.noAutoFocus","The hover will not automatically take focus."),w("showOrFocusHover.focus.focusIfVisible","The hover will take focus only if it is already visible."),w("showOrFocusHover.focus.autoFocusImmediately","The hover will automatically take focus when it appears.")],default:Dd.FocusIfVisible}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:j.editorTextFocus,primary:co(2089,2087),weight:100}})}run(e,t,n){if(!t.hasModel())return;const r=rl.get(t);if(!r)return;const o=n==null?void 0:n.focus;let s=Dd.FocusIfVisible;Object.values(Dd).includes(o)?s=o:typeof o=="boolean"&&o&&(s=Dd.AutoFocusImmediately);const a=c=>{const u=t.getPosition(),d=new B(u.lineNumber,u.column,u.lineNumber,u.column);r.showContentHover(d,1,1,c)},l=t.getOption(2)===2;r.isHoverVisible?s!==Dd.NoAutoFocus?r.focus():a(l):a(l||s===Dd.AutoFocusImmediately)}}class $it extends gt{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:w({key:"showDefinitionPreviewHover",comment:["Label for action that will trigger the showing of definition preview hover in the editor.","This allows for users to show the definition preview hover without using the mouse."]},"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0})}run(e,t){const n=rl.get(t);if(!n)return;const r=t.getPosition();if(!r)return;const o=new B(r.lineNumber,r.column,r.lineNumber,r.column),s=Kb.get(t);if(!s)return;s.startFindDefinitionFromCursor(r).then(()=>{n.showContentHover(o,1,1,!0)})}}class Hit extends gt{constructor(){super({id:"editor.action.scrollUpHover",label:w({key:"scrollUpHover",comment:["Action that allows to scroll up in the hover widget with the up arrow when the hover widget is focused."]},"Scroll Up Hover"),alias:"Scroll Up Hover",precondition:j.hoverFocused,kbOpts:{kbExpr:j.hoverFocused,primary:16,weight:100}})}run(e,t){const n=rl.get(t);n&&n.scrollUp()}}class Vit extends gt{constructor(){super({id:"editor.action.scrollDownHover",label:w({key:"scrollDownHover",comment:["Action that allows to scroll down in the hover widget with the up arrow when the hover widget is focused."]},"Scroll Down Hover"),alias:"Scroll Down Hover",precondition:j.hoverFocused,kbOpts:{kbExpr:j.hoverFocused,primary:18,weight:100}})}run(e,t){const n=rl.get(t);n&&n.scrollDown()}}class zit extends gt{constructor(){super({id:"editor.action.scrollLeftHover",label:w({key:"scrollLeftHover",comment:["Action that allows to scroll left in the hover widget with the left arrow when the hover widget is focused."]},"Scroll Left Hover"),alias:"Scroll Left Hover",precondition:j.hoverFocused,kbOpts:{kbExpr:j.hoverFocused,primary:15,weight:100}})}run(e,t){const n=rl.get(t);n&&n.scrollLeft()}}class Uit extends gt{constructor(){super({id:"editor.action.scrollRightHover",label:w({key:"scrollRightHover",comment:["Action that allows to scroll right in the hover widget with the right arrow when the hover widget is focused."]},"Scroll Right Hover"),alias:"Scroll Right Hover",precondition:j.hoverFocused,kbOpts:{kbExpr:j.hoverFocused,primary:17,weight:100}})}run(e,t){const n=rl.get(t);n&&n.scrollRight()}}class jit extends gt{constructor(){super({id:"editor.action.pageUpHover",label:w({key:"pageUpHover",comment:["Action that allows to page up in the hover widget with the page up command when the hover widget is focused."]},"Page Up Hover"),alias:"Page Up Hover",precondition:j.hoverFocused,kbOpts:{kbExpr:j.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){const n=rl.get(t);n&&n.pageUp()}}class Kit extends gt{constructor(){super({id:"editor.action.pageDownHover",label:w({key:"pageDownHover",comment:["Action that allows to page down in the hover widget with the page down command when the hover widget is focused."]},"Page Down Hover"),alias:"Page Down Hover",precondition:j.hoverFocused,kbOpts:{kbExpr:j.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){const n=rl.get(t);n&&n.pageDown()}}class Git extends gt{constructor(){super({id:"editor.action.goToTopHover",label:w({key:"goToTopHover",comment:["Action that allows to go to the top of the hover widget with the home command when the hover widget is focused."]},"Go To Top Hover"),alias:"Go To Bottom Hover",precondition:j.hoverFocused,kbOpts:{kbExpr:j.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){const n=rl.get(t);n&&n.goToTop()}}class qit extends gt{constructor(){super({id:"editor.action.goToBottomHover",label:w({key:"goToBottomHover",comment:["Action that allows to go to the bottom in the hover widget with the end command when the hover widget is focused."]},"Go To Bottom Hover"),alias:"Go To Bottom Hover",precondition:j.hoverFocused,kbOpts:{kbExpr:j.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){const n=rl.get(t);n&&n.goToBottom()}}jn(rl.ID,rl,2);Be(Wit);Be($it);Be(Hit);Be(Vit);Be(zit);Be(Uit);Be(jit);Be(Kit);Be(Git);Be(qit);P_.register(bO);P_.register(rU);fu((i,e)=>{const t=i.getColor(rve);t&&(e.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${t.transparent(.5)}; }`))});class lU extends fe{constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){const t=this._editor.getOption(147);if(t!=="click"&&t!=="clickAndHover")return;const n=e.target;if(n.type!==6||!n.detail.injectedText||n.detail.injectedText.options.attachedData!==vCe||!n.range)return;const r=this._editor.getContribution(rl.ID);if(r&&!r.isColorPickerVisible){const o=new B(n.range.startLineNumber,n.range.startColumn+1,n.range.endLineNumber,n.range.endColumn+1);r.showContentHover(o,1,0,!1,!0)}}}lU.ID="editor.contrib.colorContribution";jn(lU.ID,lU,2);P_.register(gO);var qCe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},$d=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},cU,uU;let d_=cU=class extends fe{constructor(e,t,n,r,o,s,a){super(),this._editor=e,this._modelService=n,this._keybindingService=r,this._instantiationService=o,this._languageFeatureService=s,this._languageConfigurationService=a,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=j.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=j.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){var e;this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||(e=this._standaloneColorPickerWidget)===null||e===void 0||e.focus():this._standaloneColorPickerWidget=new yO(this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused,this._instantiationService,this._modelService,this._keybindingService,this._languageFeatureService,this._languageConfigurationService))}hide(){var e;this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),(e=this._standaloneColorPickerWidget)===null||e===void 0||e.hide(),this._editor.focus()}insertColor(){var e;(e=this._standaloneColorPickerWidget)===null||e===void 0||e.updateEditor(),this.hide()}static get(e){return e.getContribution(cU.ID)}};d_.ID="editor.contrib.standaloneColorPickerController";d_=cU=qCe([$d(1,Vt),$d(2,tr),$d(3,ci),$d(4,Ot),$d(5,_t),$d(6,Di)],d_);jn(d_.ID,d_,1);const Bae=8,Xit=22;let yO=uU=class extends fe{constructor(e,t,n,r,o,s,a,l){var c;super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=n,this._modelService=o,this._keybindingService=s,this._languageFeaturesService=a,this._languageConfigurationService=l,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new se),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=r.createInstance(TI,this._editor),this._position=(c=this._editor._getViewModel())===null||c===void 0?void 0:c.getPrimaryCursorState().modelState.position;const u=this._editor.getSelection(),d=u?{startLineNumber:u.startLineNumber,startColumn:u.startColumn,endLineNumber:u.endLineNumber,endColumn:u.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},h=this._register(dh(this._body));this._register(h.onDidBlur(f=>{this.hide()})),this._register(h.onDidFocus(f=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(f=>{var g;const p=(g=f.target.element)===null||g===void 0?void 0:g.classList;p&&p.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(f=>{this._render(f.value,f.foundInEditor)})),this._start(d),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return uU.ID}getDomNode(){return this._body}getPosition(){if(!this._position)return null;const e=this._editor.getOption(60).above;return{position:this._position,secondaryPosition:this._position,preference:e?[1,2]:[2,1],positionAffinity:2}}hide(){this.dispose(),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerFocused.set(!1),this._editor.removeContentWidget(this),this._editor.focus()}focus(){this._standaloneColorPickerFocused.set(!0),this._body.focus()}async _start(e){const t=await this._computeAsync(e);t&&this._onResult.fire(new Yit(t.result,t.foundInEditor))}async _computeAsync(e){if(!this._editor.hasModel())return null;const t={range:e,color:{red:0,green:0,blue:0,alpha:1}},n=await this._standaloneColorPickerParticipant.createColorHover(t,new WY(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return n?{result:n.colorHover,foundInEditor:n.foundInEditor}:null}_render(e,t){const n=document.createDocumentFragment(),r=this._register(new vO(this._keybindingService));let o;const s={fragment:n,statusBar:r,setColorPicker:p=>o=p,onContentsChanged:()=>{},hide:()=>this.hide()};if(this._colorHover=e,this._register(this._standaloneColorPickerParticipant.renderHoverParts(s,[e])),o===void 0)return;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(this._editor.getLayoutInfo().width*.66,500)+"px",this._body.tabIndex=0,this._body.appendChild(n),o.layout();const a=o.body,l=a.saturationBox.domNode.clientWidth,c=a.domNode.clientWidth-l-Xit-Bae,u=o.body.enterButton;u==null||u.onClicked(()=>{this.updateEditor(),this.hide()});const d=o.header,h=d.pickedColorNode;h.style.width=l+Bae+"px";const f=d.originalColorNode;f.style.width=c+"px";const g=o.header.closeButton;g==null||g.onClicked(()=>{this.hide()}),t&&(u&&(u.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}};yO.ID="editor.contrib.standaloneColorPickerWidget";yO=uU=qCe([$d(3,Ot),$d(4,tr),$d(5,ci),$d(6,_t),$d(7,Di)],yO);class Yit{constructor(e,t){this.value=e,this.foundInEditor=t}}class Zit extends Sh{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{...$n("showOrFocusStandaloneColorPicker","Show or Focus Standalone Color Picker"),mnemonicTitle:w({key:"mishowOrFocusStandaloneColorPicker",comment:["&& denotes a mnemonic"]},"&&Show or Focus Standalone Color Picker")},precondition:void 0,menu:[{id:$.CommandPalette}]})}runEditorCommand(e,t){var n;(n=d_.get(t))===null||n===void 0||n.showOrFocus()}}class Qit extends gt{constructor(){super({id:"editor.action.hideColorPicker",label:w({key:"hideColorPicker",comment:["Action that hides the color picker"]},"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:j.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100}})}run(e,t){var n;(n=d_.get(t))===null||n===void 0||n.hide()}}class Jit extends gt{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:w({key:"insertColorWithStandaloneColorPicker",comment:["Action that inserts color with standalone color picker"]},"Insert Color with Standalone Color Picker"),alias:"Insert Color with Standalone Color Picker",precondition:j.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100}})}run(e,t){var n;(n=d_.get(t))===null||n===void 0||n.insertColor()}}Be(Qit);Be(Jit);Ei(Zit);class tv{constructor(e,t,n){this.languageConfigurationService=n,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,n){if(n<0)return!1;const r=t.length,o=e.length;if(n+r>o)return!1;for(let s=0;s=65&&a<=90&&a+32===l)&&!(l>=65&&l<=90&&l+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,n,r,o,s){const a=e.startLineNumber,l=e.startColumn,c=e.endLineNumber,u=e.endColumn,d=o.getLineContent(a),h=o.getLineContent(c);let f=d.lastIndexOf(t,l-1+t.length),g=h.indexOf(n,u-1-n.length);if(f!==-1&&g!==-1)if(a===c)d.substring(f+t.length,g).indexOf(n)>=0&&(f=-1,g=-1);else{const v=d.substring(f+t.length),m=h.substring(0,g);(v.indexOf(n)>=0||m.indexOf(n)>=0)&&(f=-1,g=-1)}let p;f!==-1&&g!==-1?(r&&f+t.length0&&h.charCodeAt(g-1)===32&&(n=" "+n,g-=1),p=tv._createRemoveBlockCommentOperations(new B(a,f+t.length+1,c,g+1),t,n)):(p=tv._createAddBlockCommentOperations(e,t,n,this._insertSpace),this._usedEndToken=p.length===1?n:null);for(const v of p)s.addTrackedEditOperation(v.range,v.text)}static _createRemoveBlockCommentOperations(e,t,n){const r=[];return B.isEmpty(e)?r.push(Xi.delete(new B(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+n.length))):(r.push(Xi.delete(new B(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),r.push(Xi.delete(new B(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+n.length)))),r}static _createAddBlockCommentOperations(e,t,n,r){const o=[];return B.isEmpty(e)?o.push(Xi.replace(new B(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+n)):(o.push(Xi.insert(new ae(e.startLineNumber,e.startColumn),t+(r?" ":""))),o.push(Xi.insert(new ae(e.endLineNumber,e.endColumn),(r?" ":"")+n))),o}getEditOperations(e,t){const n=this._selection.startLineNumber,r=this._selection.startColumn;e.tokenization.tokenizeIfCheap(n);const o=e.getLanguageIdAtPosition(n,r),s=this.languageConfigurationService.getLanguageConfiguration(o).comments;!s||!s.blockCommentStartToken||!s.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,s.blockCommentStartToken,s.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const n=t.getInverseEditOperations();if(n.length===2){const r=n[0],o=n[1];return new yt(r.range.endLineNumber,r.range.endColumn,o.range.startLineNumber,o.range.startColumn)}else{const r=n[0].range,o=this._usedEndToken?-this._usedEndToken.length-1:0;return new yt(r.endLineNumber,r.endColumn+o,r.endLineNumber,r.endColumn+o)}}}class Tg{constructor(e,t,n,r,o,s,a){this.languageConfigurationService=e,this._selection=t,this._tabSize=n,this._type=r,this._insertSpace=o,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=s,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,n,r){e.tokenization.tokenizeIfCheap(t);const o=e.getLanguageIdAtPosition(t,1),s=r.getLanguageConfiguration(o).comments,a=s?s.lineCommentToken:null;if(!a)return null;const l=[];for(let c=0,u=n-t+1;co?t[l].commentStrOffset=s-1:t[l].commentStrOffset=s}}}class KY extends gt{constructor(e,t){super(t),this._type=e}run(e,t){const n=e.get(Di);if(!t.hasModel())return;const r=t.getModel(),o=[],s=r.getOptions(),a=t.getOption(23),l=t.getSelections().map((u,d)=>({selection:u,index:d,ignoreFirstLine:!1}));l.sort((u,d)=>B.compareRangesUsingStarts(u.selection,d.selection));let c=l[0];for(let u=1;u=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},s0=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},dU;let nS=dU=class{static get(e){return e.getContribution(dU.ID)}constructor(e,t,n,r,o,s,a,l){this._contextMenuService=t,this._contextViewService=n,this._contextKeyService=r,this._keybindingService=o,this._menuService=s,this._configurationService=a,this._workspaceContextService=l,this._toDispose=new Te,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu(c=>this._onContextMenu(c))),this._toDispose.add(this._editor.onMouseWheel(c=>{if(this._contextMenuIsBeingShownCount>0){const u=this._contextViewService.getContextViewElement(),d=c.srcElement;d.shadowRoot&&Tb(u)===d.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(c=>{this._editor.getOption(24)&&c.keyCode===58&&(c.preventDefault(),c.stopPropagation(),this.showContextMenu())}))}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(24)){this._editor.focus(),e.target.position&&!this._editor.getSelection().containsPosition(e.target.position)&&this._editor.setPosition(e.target.position);return}if(e.target.type===12||e.target.type===6&&e.target.detail.injectedText)return;if(e.event.preventDefault(),e.event.stopPropagation(),e.target.type===11)return this._showScrollbarContextMenu(e.event);if(e.target.type!==6&&e.target.type!==7&&e.target.type!==1)return;if(this._editor.focus(),e.target.position){let n=!1;for(const r of this._editor.getSelections())if(r.containsPosition(e.target.position)){n=!0;break}n||this._editor.setPosition(e.target.position)}let t=null;e.target.type!==1&&(t=e.event),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(24)||!this._editor.hasModel())return;const t=this._getMenuActions(this._editor.getModel(),this._editor.isSimpleWidget?$.SimpleEditorContext:$.EditorContext);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const n=[],r=this._menuService.createMenu(t,this._contextKeyService),o=r.getActions({arg:e.uri});r.dispose();for(const s of o){const[,a]=s;let l=0;for(const c of a)if(c instanceof TD){const u=this._getMenuActions(e,c.item.submenu);u.length>0&&(n.push(new Lw(c.id,c.label,u)),l++)}else n.push(c),l++;l&&n.push(new lo)}return n.length&&n.pop(),n}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;const n=this._editor.getOption(60);this._editor.updateOptions({hover:{enabled:!1}});let r=t;if(!r){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const s=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),a=Br(this._editor.getDomNode()),l=a.left+s.left,c=a.top+s.top+s.height;r={x:l,y:c}}const o=this._editor.getOption(127)&&!ch;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:o?this._editor.getDomNode():void 0,getAnchor:()=>r,getActions:()=>e,getActionViewItem:s=>{const a=this._keybindingFor(s);if(a)return new jw(s,s,{label:!0,keybinding:a.getLabel(),isMenu:!0});const l=s;return typeof l.getActionViewItem=="function"?l.getActionViewItem():new jw(s,s,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:s=>this._keybindingFor(s),onHide:s=>{this._contextMenuIsBeingShownCount--,this._editor.updateOptions({hover:n})}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel()||RGe(this._workspaceContextService.getWorkspace()))return;const t=this._editor.getOption(73);let n=0;const r=c=>({id:`menu-action-${++n}`,label:c.label,tooltip:"",class:void 0,enabled:typeof c.enabled>"u"?!0:c.enabled,checked:c.checked,run:c.run}),o=(c,u)=>new Lw(`menu-action-${++n}`,c,u,void 0),s=(c,u,d,h,f)=>{if(!u)return r({label:c,enabled:u,run:()=>{}});const g=v=>()=>{this._configurationService.updateValue(d,v)},p=[];for(const v of f)p.push(r({label:v.label,checked:h===v.value,run:g(v.value)}));return o(c,p)},a=[];a.push(r({label:w("context.minimap.minimap","Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new lo),a.push(r({label:w("context.minimap.renderCharacters","Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(s(w("context.minimap.size","Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:w("context.minimap.size.proportional","Proportional"),value:"proportional"},{label:w("context.minimap.size.fill","Fill"),value:"fill"},{label:w("context.minimap.size.fit","Fit"),value:"fit"}])),a.push(s(w("context.minimap.slider","Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:w("context.minimap.slider.mouseover","Mouse Over"),value:"mouseover"},{label:w("context.minimap.slider.always","Always"),value:"always"}]));const l=this._editor.getOption(127)&&!ch;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:l?this._editor.getDomNode():void 0,getAnchor:()=>e,getActions:()=>a,onHide:c=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}};nS.ID="editor.contrib.contextmenu";nS=dU=rrt([s0(1,Ol),s0(2,ng),s0(3,Vt),s0(4,ci),s0(5,hu),s0(6,gn),s0(7,Pb)],nS);class ort extends gt{constructor(){super({id:"editor.action.showContextMenu",label:w("action.showContextMenu.label","Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:j.textInputFocus,primary:1092,weight:100}})}run(e,t){var n;(n=nS.get(t))===null||n===void 0||n.showContextMenu()}}jn(nS.ID,nS,2);Be(ort);class M9{constructor(e){this.selections=e}equals(e){const t=this.selections.length,n=e.selections.length;if(t!==n)return!1;for(let r=0;r{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeModelContent(t=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeCursorSelection(t=>{if(this._isCursorUndoRedo||!t.oldSelections||t.oldModelVersionId!==t.modelVersionId)return;const n=new M9(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(n)||(this._undoStack.push(new A9(n,e.getScrollTop(),e.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())}))}cursorUndo(){!this._editor.hasModel()||this._undoStack.length===0||(this._redoStack.push(new A9(new M9(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._undoStack.pop()))}cursorRedo(){!this._editor.hasModel()||this._redoStack.length===0||(this._undoStack.push(new A9(new M9(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._redoStack.pop()))}_applyState(e){this._isCursorUndoRedo=!0,this._editor.setSelections(e.cursorState.selections),this._editor.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft}),this._isCursorUndoRedo=!1}}Gb.ID="editor.contrib.cursorUndoRedoController";class srt extends gt{constructor(){super({id:"cursorUndo",label:w("cursor.undo","Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:j.textInputFocus,primary:2099,weight:100}})}run(e,t,n){var r;(r=Gb.get(t))===null||r===void 0||r.cursorUndo()}}class art extends gt{constructor(){super({id:"cursorRedo",label:w("cursor.redo","Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,n){var r;(r=Gb.get(t))===null||r===void 0||r.cursorRedo()}}jn(Gb.ID,Gb,0);Be(srt);Be(art);class lrt{constructor(e,t,n){this.selection=e,this.targetPosition=t,this.copy=n,this.targetSelection=null}getEditOperations(e,t){const n=e.getValueInRange(this.selection);if(this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new B(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),n),this.selection.containsPosition(this.targetPosition)&&!(this.copy&&(this.selection.getEndPosition().equals(this.targetPosition)||this.selection.getStartPosition().equals(this.targetPosition)))){this.targetSelection=this.selection;return}if(this.copy){this.targetSelection=new yt(this.targetPosition.lineNumber,this.targetPosition.column,this.selection.endLineNumber-this.selection.startLineNumber+this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumber>this.selection.endLineNumber){this.targetSelection=new yt(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumberthis._onEditorMouseDown(t))),this._register(this._editor.onMouseUp(t=>this._onEditorMouseUp(t))),this._register(this._editor.onMouseDrag(t=>this._onEditorMouseDrag(t))),this._register(this._editor.onMouseDrop(t=>this._onEditorMouseDrop(t))),this._register(this._editor.onMouseDropCanceled(()=>this._onEditorMouseDropCanceled())),this._register(this._editor.onKeyDown(t=>this.onEditorKeyDown(t))),this._register(this._editor.onKeyUp(t=>this.onEditorKeyUp(t))),this._register(this._editor.onDidBlurEditorWidget(()=>this.onEditorBlur())),this._register(this._editor.onDidBlurEditorText(()=>this.onEditorBlur())),this._mouseDown=!1,this._modifierPressed=!1,this._dragSelection=null}onEditorBlur(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1}onEditorKeyDown(e){!this._editor.getOption(35)||this._editor.getOption(22)||(o1(e)&&(this._modifierPressed=!0),this._mouseDown&&o1(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(35)||this._editor.getOption(22)||(o1(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===vp.TRIGGER_KEY_VALUE&&this._editor.updateOptions({mouseStyle:"default"}))}_onEditorMouseDown(e){this._mouseDown=!0}_onEditorMouseUp(e){this._mouseDown=!1,this._editor.updateOptions({mouseStyle:"text"})}_onEditorMouseDrag(e){const t=e.target;if(this._dragSelection===null){const r=(this._editor.getSelections()||[]).filter(o=>t.position&&o.containsPosition(t.position));if(r.length===1)this._dragSelection=r[0];else return}o1(e.event)?this._editor.updateOptions({mouseStyle:"copy"}):this._editor.updateOptions({mouseStyle:"default"}),t.position&&(this._dragSelection.containsPosition(t.position)?this._removeDecoration():this.showAt(t.position))}_onEditorMouseDropCanceled(){this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}_onEditorMouseDrop(e){if(e.target&&(this._hitContent(e.target)||this._hitMargin(e.target))&&e.target.position){const t=new ae(e.target.position.lineNumber,e.target.position.column);if(this._dragSelection===null){let n=null;if(e.event.shiftKey){const r=this._editor.getSelection();if(r){const{selectionStartLineNumber:o,selectionStartColumn:s}=r;n=[new yt(o,s,t.lineNumber,t.column)]}}else n=(this._editor.getSelections()||[]).map(r=>r.containsPosition(t)?new yt(t.lineNumber,t.column,t.lineNumber,t.column):r);this._editor.setSelections(n||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(o1(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(vp.ID,new lrt(this._dragSelection,t,o1(e.event)||this._modifierPressed)),this._editor.pushUndoStop())}this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}showAt(e){this._dndDecorationIds.set([{range:new B(e.lineNumber,e.column,e.lineNumber,e.column),options:vp._DECORATION_OPTIONS}]),this._editor.revealPosition(e,1)}_removeDecoration(){this._dndDecorationIds.clear()}_hitContent(e){return e.type===6||e.type===7}_hitMargin(e){return e.type===2||e.type===3||e.type===4}dispose(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1,super.dispose()}}vp.ID="editor.contrib.dragAndDrop";vp.TRIGGER_KEY_VALUE=Ln?6:5;vp._DECORATION_OPTIONS=sn.register({description:"dnd-target",className:"dnd-target"});jn(vp.ID,vp,2);var GY=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},AI=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const H3=w("builtIn","Built-in");class qY{async provideDocumentPasteEdits(e,t,n,r,o){const s=await this.getEdit(n,o);return s?{insertText:s.insertText,label:s.label,detail:s.detail,handledMimeType:s.handledMimeType,yieldTo:s.yieldTo}:void 0}async provideDocumentOnDropEdits(e,t,n,r){const o=await this.getEdit(n,r);return o?{insertText:o.insertText,label:o.label,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}:void 0}}class XCe extends qY{constructor(){super(...arguments),this.id="text",this.dropMimeTypes=[Cr.text],this.pasteMimeTypes=[Cr.text]}async getEdit(e,t){const n=e.get(Cr.text);if(!n||e.has(Cr.uriList))return;const r=await n.asString();return{handledMimeType:Cr.text,label:w("text.label","Insert Plain Text"),detail:H3,insertText:r}}}class YCe extends qY{constructor(){super(...arguments),this.id="uri",this.dropMimeTypes=[Cr.uriList],this.pasteMimeTypes=[Cr.uriList]}async getEdit(e,t){const n=await ZCe(e);if(!n.length||t.isCancellationRequested)return;let r=0;const o=n.map(({uri:a,originalText:l})=>a.scheme===an.file?a.fsPath:(r++,l)).join(" ");let s;return r>0?s=n.length>1?w("defaultDropProvider.uriList.uris","Insert Uris"):w("defaultDropProvider.uriList.uri","Insert Uri"):s=n.length>1?w("defaultDropProvider.uriList.paths","Insert Paths"):w("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:Cr.uriList,insertText:o,label:s,detail:H3}}}let wO=class extends qY{constructor(e){super(),this._workspaceContextService=e,this.id="relativePath",this.dropMimeTypes=[Cr.uriList],this.pasteMimeTypes=[Cr.uriList]}async getEdit(e,t){const n=await ZCe(e);if(!n.length||t.isCancellationRequested)return;const r=lh(n.map(({uri:o})=>{const s=this._workspaceContextService.getWorkspaceFolder(o);return s?Sze(s.uri,o):void 0}));if(r.length)return{handledMimeType:Cr.uriList,insertText:r.join(" "),label:n.length>1?w("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):w("defaultDropProvider.uriList.relativePath","Insert Relative Path"),detail:H3}}};wO=GY([AI(0,Pb)],wO);class crt{constructor(){this.id="html",this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:Cr.text}]}async provideDocumentPasteEdits(e,t,n,r,o){if(r.trigger!=="explicit"&&r.only!==this.id)return;const s=n.get("text/html"),a=await(s==null?void 0:s.asString());if(!(!a||o.isCancellationRequested))return{insertText:a,yieldTo:this._yieldTo,label:w("pasteHtmlLabel","Insert HTML"),detail:H3}}}async function ZCe(i){const e=i.get(Cr.uriList);if(!e)return[];const t=await e.asString(),n=[];for(const r of N3.parse(t))try{n.push({uri:At.parse(r),originalText:r})}catch{}return n}let hU=class extends fe{constructor(e,t){super(),this._register(e.documentOnDropEditProvider.register("*",new XCe)),this._register(e.documentOnDropEditProvider.register("*",new YCe)),this._register(e.documentOnDropEditProvider.register("*",new wO(t)))}};hU=GY([AI(0,_t),AI(1,Pb)],hU);let fU=class extends fe{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new XCe)),this._register(e.documentPasteEditProvider.register("*",new YCe)),this._register(e.documentPasteEditProvider.register("*",new wO(t))),this._register(e.documentPasteEditProvider.register("*",new crt))}};fU=GY([AI(0,_t),AI(1,Pb)],fU);jn(Np.ID,Np,0);nT(fU);et(new class extends Vo{constructor(){super({id:Ybe,precondition:Zbe,kbOpts:{weight:100,primary:2137}})}runEditorCommand(i,e,t){var n;return(n=Np.get(e))===null||n===void 0?void 0:n.changePasteType()}});Be(class extends gt{constructor(){super({id:"editor.action.pasteAs",label:w("pasteAs","Paste As..."),alias:"Paste As...",precondition:j.writable,metadata:{description:"Paste as",args:[{name:"args",schema:{type:"object",properties:{id:{type:"string",description:w("pasteAs.id","The id of the paste edit to try applying. If not provided, the editor will show a picker.")}}}}]}})}run(i,e,t){var n;const r=typeof(t==null?void 0:t.id)=="string"?t.id:void 0;return(n=Np.get(e))===null||n===void 0?void 0:n.pasteAs(r)}});Be(class extends gt{constructor(){super({id:"editor.action.pasteAsText",label:w("pasteAsText","Paste as Text"),alias:"Paste as Text",precondition:j.writable})}run(i,e,t){var n;return(n=Np.get(e))===null||n===void 0?void 0:n.pasteAs("text")}});class urt{constructor(){this._dragOperations=new Map}removeDragOperationTransfer(e){if(e&&this._dragOperations.has(e)){const t=this._dragOperations.get(e);return this._dragOperations.delete(e),t}}}class Wae{constructor(e){this.identifier=e}}const QCe=yn("treeViewsDndService");In(QCe,urt,1);var drt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},t2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},gU;const JCe="editor.experimental.dropIntoEditor.defaultProvider",e1e="editor.changeDropType",t1e=new st("dropWidgetVisible",!1,w("dropWidgetVisible","Whether the drop widget is showing"));let iS=gU=class extends fe{static get(e){return e.getContribution(gU.ID)}constructor(e,t,n,r,o){super(),this._configService=n,this._languageFeaturesService=r,this._treeViewsDragAndDropService=o,this.treeItemsTransfer=DI.getInstance(),this._dropProgressManager=this._register(t.createInstance(uO,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(hO,"dropIntoEditor",e,t1e,{id:e1e,label:w("postDropWidgetTitle","Show drop options...")})),this._register(e.onDropIntoEditor(s=>this.onDropIntoEditor(e,s.position,s.event)))}changeDropType(){this._postDropWidgetManager.tryShowSelector()}async onDropIntoEditor(e,t,n){var r;if(!n.dataTransfer||!e.hasModel())return;(r=this._currentOperation)===null||r===void 0||r.cancel(),e.focus(),e.setPosition(t);const o=Io(async s=>{const a=new i_(e,1,void 0,s);try{const l=await this.extractDataTransferData(n);if(l.size===0||a.token.isCancellationRequested)return;const c=e.getModel();if(!c)return;const u=this._languageFeaturesService.documentOnDropEditProvider.ordered(c).filter(h=>h.dropMimeTypes?h.dropMimeTypes.some(f=>l.matches(f)):!0),d=await this.getDropEdits(u,c,t,l,a);if(a.token.isCancellationRequested)return;if(d.length){const h=this.getInitialActiveEditIndex(c,d),f=e.getOption(36).showDropSelector==="afterDrop";await this._postDropWidgetManager.applyEditAndShowIfNeeded([B.fromPositions(t)],{activeEditIndex:h,allEdits:d},f,s)}}finally{a.dispose(),this._currentOperation===o&&(this._currentOperation=void 0)}});this._dropProgressManager.showWhile(t,w("dropIntoEditorProgress","Running drop handlers. Click to cancel"),o),this._currentOperation=o}async getDropEdits(e,t,n,r,o){const s=await Rk(Promise.all(e.map(async l=>{try{const c=await l.provideDocumentOnDropEdits(t,n,r,o.token);if(c)return{...c,providerId:l.id}}catch(c){console.error(c)}})),o.token),a=lh(s??[]);return qbe(a)}getInitialActiveEditIndex(e,t){const n=this._configService.getValue(JCe,{resource:e.uri});for(const[r,o]of Object.entries(n)){const s=t.findIndex(a=>o===a.providerId&&a.handledMimeType&&Vbe(r,[a.handledMimeType]));if(s>=0)return s}return 0}async extractDataTransferData(e){if(!e.dataTransfer)return new Hbe;const t=jbe(e.dataTransfer);if(this.treeItemsTransfer.hasData(Wae.prototype)){const n=this.treeItemsTransfer.getData(Wae.prototype);if(Array.isArray(n))for(const r of n){const o=await this._treeViewsDragAndDropService.removeDragOperationTransfer(r.identifier);if(o)for(const[s,a]of o)t.replace(s,a)}}return t}};iS.ID="editor.contrib.dropIntoEditorController";iS=gU=drt([t2(1,Ot),t2(2,gn),t2(3,_t),t2(4,QCe)],iS);jn(iS.ID,iS,2);et(new class extends Vo{constructor(){super({id:e1e,precondition:t1e,kbOpts:{weight:100,primary:2137}})}runEditorCommand(i,e,t){var n;(n=iS.get(e))===null||n===void 0||n.changeDropType()}});nT(hU);ar.as(xh.Configuration).registerConfiguration({...Z4,properties:{[JCe]:{type:"object",scope:5,description:w("defaultProviderDescription","Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}});class Us{constructor(e){this._editor=e,this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null,this._startPosition=this._editor.getPosition()}dispose(){this._editor.removeDecorations(this._allDecorations()),this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}reset(){this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}getCount(){return this._decorations.length}getFindScope(){return this._findScopeDecorationIds[0]?this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]):null}getFindScopes(){if(this._findScopeDecorationIds.length){const e=this._findScopeDecorationIds.map(t=>this._editor.getModel().getDecorationRange(t)).filter(t=>!!t);if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){const t=this._decorations.indexOf(e);return t>=0?t+1:1}getDecorationRangeAt(e){const t=e{if(this._highlightedDecorationId!==null&&(r.changeDecorationOptions(this._highlightedDecorationId,Us._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,r.changeDecorationOptions(this._highlightedDecorationId,Us._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(r.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let o=this._editor.getModel().getDecorationRange(t);if(o.startLineNumber!==o.endLineNumber&&o.endColumn===1){const s=o.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(s);o=new B(o.startLineNumber,o.startColumn,s,a)}this._rangeHighlightDecorationId=r.addDecoration(o,Us._RANGE_HIGHLIGHT_DECORATION)}}),n}set(e,t){this._editor.changeDecorations(n=>{let r=Us._FIND_MATCH_DECORATION;const o=[];if(e.length>1e3){r=Us._FIND_MATCH_NO_OVERVIEW_DECORATION;const a=this._editor.getModel().getLineCount(),c=this._editor.getLayoutInfo().height/a,u=Math.max(2,Math.ceil(3/c));let d=e[0].range.startLineNumber,h=e[0].range.endLineNumber;for(let f=1,g=e.length;f=p.startLineNumber?p.endLineNumber>h&&(h=p.endLineNumber):(o.push({range:new B(d,1,h,1),options:Us._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),d=p.startLineNumber,h=p.endLineNumber)}o.push({range:new B(d,1,h,1),options:Us._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const s=new Array(e.length);for(let a=0,l=e.length;an.removeDecoration(a)),this._findScopeDecorationIds=[]),t!=null&&t.length&&(this._findScopeDecorationIds=t.map(a=>n.addDecoration(a,Us._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){const n=this._decorations[t],r=this._editor.getModel().getDecorationRange(n);if(!(!r||r.endLineNumber>e.lineNumber)){if(r.endLineNumbere.column))return r}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,n=this._decorations.length;te.lineNumber)return o;if(!(o.startColumn0){const n=[];for(let s=0;sB.compareRangesUsingStarts(s.range,a.range));const r=[];let o=n[0];for(let s=1;s0?e[0].toUpperCase()+e.substr(1):i[0][0].toUpperCase()!==i[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function $ae(i,e,t){return i[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&i[0].split(t).length===e.split(t).length}function Hae(i,e,t){const n=e.split(t),r=i[0].split(t);let o="";return n.forEach((s,a)=>{o+=n1e([r[a]],s)+t}),o.slice(0,-1)}class Vae{constructor(e){this.staticValue=e,this.kind=0}}class frt{constructor(e){this.pieces=e,this.kind=1}}class rS{static fromStaticValue(e){return new rS([hb.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new Vae(""):e.length===1&&e[0].staticValue!==null?this._state=new Vae(e[0].staticValue):this._state=new frt(e)}buildReplaceString(e,t){if(this._state.kind===0)return t?n1e(e,this._state.staticValue):this._state.staticValue;let n="";for(let r=0,o=this._state.pieces.length;r0){const l=[],c=s.caseOps.length;let u=0;for(let d=0,h=a.length;d=c){l.push(a.slice(d));break}switch(s.caseOps[u]){case"U":l.push(a[d].toUpperCase());break;case"u":l.push(a[d].toUpperCase()),u++;break;case"L":l.push(a[d].toLowerCase());break;case"l":l.push(a[d].toLowerCase()),u++;break;default:l.push(a[d])}}a=l.join("")}n+=a}return n}static _substitute(e,t){if(t===null)return"";if(e===0)return t[0];let n="";for(;e>0;){if(e=r)break;const s=i.charCodeAt(n);switch(s){case 92:t.emitUnchanged(n-1),t.emitStatic("\\",n+1);break;case 110:t.emitUnchanged(n-1),t.emitStatic(` -`,n+1);break;case 116:t.emitUnchanged(n-1),t.emitStatic(" ",n+1);break;case 117:case 85:case 108:case 76:t.emitUnchanged(n-1),t.emitStatic("",n+1),e.push(String.fromCharCode(s));break}continue}if(o===36){if(n++,n>=r)break;const s=i.charCodeAt(n);if(s===36){t.emitUnchanged(n-1),t.emitStatic("$",n+1);continue}if(s===48||s===38){t.emitUnchanged(n-1),t.emitMatchIndex(0,n+1,e),e.length=0;continue}if(49<=s&&s<=57){let a=s-48;if(n+1this.research(!1),100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(n=>{(n.reason===3||n.reason===5||n.reason===6)&&this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(n=>{this._ignoreModelContentChanged||(n.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(n=>this._onStateChanged(n))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,si(this._startSearchingTimer),this._toDispose.dispose()}_onStateChanged(e){this._isDisposed||this._editor.hasModel()&&(e.searchString||e.isReplaceRevealed||e.isRegex||e.wholeWord||e.matchCase||e.searchScope)&&(this._editor.getModel().isTooLargeForSyncing()?(this._startSearchingTimer.cancel(),this._startSearchingTimer.setIfNotSet(()=>{e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor)},mrt)):e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor))}static _getSearchRange(e,t){return t||e.getFullModelRange()}research(e,t){let n=null;typeof t<"u"?t!==null&&(Array.isArray(t)?n=t:n=[t]):n=this._decorations.getFindScopes(),n!==null&&(n=n.map(a=>{if(a.startLineNumber!==a.endLineNumber){let l=a.endLineNumber;return a.endColumn===1&&(l=l-1),new B(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));const r=this._findMatches(n,!1,nv);this._decorations.set(r,n);const o=this._editor.getSelection();let s=this._decorations.getCurrentMatchesPosition(o);if(s===0&&r.length>0){const a=AD(r.map(l=>l.range),l=>B.compareRangesUsingStarts(l,o)>=0);s=a>0?a-1+1:s}this._state.changeMatchInfo(s,this._decorations.getCount(),void 0),e&&this._editor.getOption(41).cursorMoveOnType&&this._moveToNextMatch(this._decorations.getStartPosition())}_hasMatches(){return this._state.matchesCount>0}_cannotFind(){if(!this._hasMatches()){const e=this._decorations.getFindScope();return e&&this._editor.revealRangeInCenterIfOutsideViewport(e,0),!0}return!1}_setCurrentFindMatch(e){const t=this._decorations.setCurrentFindMatch(e);this._state.changeMatchInfo(t,this._decorations.getCount(),e),this._editor.setSelection(e),this._editor.revealRangeInCenterIfOutsideViewport(e,0)}_prevSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:n,column:r}=e;const o=this._editor.getModel();return t||r===1?(n===1?n=o.getLineCount():n--,r=o.getLineMaxColumn(n)):r--,new ae(n,r)}_moveToPrevMatch(e,t=!1){if(!this._state.canNavigateBack()){const u=this._decorations.matchAfterPosition(e);u&&this._setCurrentFindMatch(u);return}if(this._decorations.getCount()=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:n,column:r}=e;const o=this._editor.getModel();return t||r===o.getLineMaxColumn(n)?(n===o.getLineCount()?n=1:n++,r=1):r++,new ae(n,r)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const n=this._decorations.matchBeforePosition(e);n&&this._setCurrentFindMatch(n);return}if(this._decorations.getCount()AE._getSearchRange(this._editor.getModel(),o));return this._editor.getModel().findMatches(this._state.searchString,r,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(130):null,t,n)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();e===null&&this._state.matchesCount>=nv?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new g0(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(130):null).parseSearchRequest();if(!t)return;let n=t.regex;if(!n.multiline){let d="mu";n.ignoreCase&&(d+="i"),n.global&&(d+="g"),n=new RegExp(n.source,d)}const r=this._editor.getModel(),o=r.getValue(1),s=r.getFullModelRange(),a=this._getReplacePattern();let l;const c=this._state.preserveCase;a.hasReplacementPatterns||c?l=o.replace(n,function(){return a.buildReplaceString(arguments,c)}):l=o.replace(n,a.buildReplaceString(null,c));const u=new oX(s,l,this._editor.getSelection());this._executeEditorCommand("replaceAll",u)}_regularReplaceAll(e){const t=this._getReplacePattern(),n=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),r=[];for(let s=0,a=n.length;ss.range),r);this._executeEditorCommand("replaceAll",o)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let n=this._findMatches(e,!1,1073741824).map(o=>new yt(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn));const r=this._editor.getSelection();for(let o=0,s=n.length;othis._hide(),2e3)),this._isVisible=!1,this._editor=e,this._state=t,this._keybindingService=n,this._domNode=document.createElement("div"),this._domNode.className="findOptionsWidget",this._domNode.style.display="none",this._domNode.style.top="10px",this._domNode.style.zIndex="12",this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true");const r={inputActiveOptionBorder:ht(Xq),inputActiveOptionForeground:ht(Yq),inputActiveOptionBackground:ht(W0)};this.caseSensitive=this._register(new t0e({appendTitle:this._keybindingLabelFor(Ni.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase,...r})),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new n0e({appendTitle:this._keybindingLabelFor(Ni.ToggleWholeWordCommand),isChecked:this._state.wholeWord,...r})),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new i0e({appendTitle:this._keybindingLabelFor(Ni.ToggleRegexCommand),isChecked:this._state.isRegex,...r})),this._domNode.appendChild(this.regex.domNode),this._register(this.regex.onChange(()=>{this._state.change({isRegex:this.regex.checked},!1)})),this._editor.addOverlayWidget(this),this._register(this._state.onFindReplaceStateChange(o=>{let s=!1;o.isRegex&&(this.regex.checked=this._state.isRegex,s=!0),o.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,s=!0),o.matchCase&&(this.caseSensitive.checked=this._state.matchCase,s=!0),!this._state.isRevealed&&s&&this._revealTemporarily()})),this._register(ye(this._domNode,Ge.MOUSE_LEAVE,o=>this._onMouseLeave())),this._register(ye(this._domNode,"mouseover",o=>this._onMouseOver()))}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return z3.ID}getDomNode(){return this._domNode}getPosition(){return{preference:0}}highlightFindOptions(){this._revealTemporarily()}_revealTemporarily(){this._show(),this._hideSoon.schedule()}_onMouseLeave(){this._hideSoon.schedule()}_onMouseOver(){this._hideSoon.cancel()}_show(){this._isVisible||(this._isVisible=!0,this._domNode.style.display="block")}_hide(){this._isVisible&&(this._isVisible=!1,this._domNode.style.display="none")}}z3.ID="editor.contrib.findOptionsWidget";function a2(i,e){return i===1?!0:i===2?!1:e}class vrt extends fe{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return a2(this._isRegexOverride,this._isRegex)}get wholeWord(){return a2(this._wholeWordOverride,this._wholeWord)}get matchCase(){return a2(this._matchCaseOverride,this._matchCase)}get preserveCase(){return a2(this._preserveCaseOverride,this._preserveCase)}get actualIsRegex(){return this._isRegex}get actualWholeWord(){return this._wholeWord}get actualMatchCase(){return this._matchCase}get actualPreserveCase(){return this._preserveCase}get searchScope(){return this._searchScope}get matchesPosition(){return this._matchesPosition}get matchesCount(){return this._matchesCount}get currentMatch(){return this._currentMatch}constructor(){super(),this._onFindReplaceStateChange=this._register(new se),this.onFindReplaceStateChange=this._onFindReplaceStateChange.event,this._searchString="",this._replaceString="",this._isRevealed=!1,this._isReplaceRevealed=!1,this._isRegex=!1,this._isRegexOverride=0,this._wholeWord=!1,this._wholeWordOverride=0,this._matchCase=!1,this._matchCaseOverride=0,this._preserveCase=!1,this._preserveCaseOverride=0,this._searchScope=null,this._matchesPosition=0,this._matchesCount=0,this._currentMatch=null,this._loop=!0,this._isSearching=!1,this._filters=null}changeMatchInfo(e,t,n){const r={moveCursor:!1,updateHistory:!1,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let o=!1;t===0&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,r.matchesPosition=!0,o=!0),this._matchesCount!==t&&(this._matchesCount=t,r.matchesCount=!0,o=!0),typeof n<"u"&&(B.equalsRange(this._currentMatch,n)||(this._currentMatch=n,r.currentMatch=!0,o=!0)),o&&this._onFindReplaceStateChange.fire(r)}change(e,t,n=!0){var r;const o={moveCursor:t,updateHistory:n,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let s=!1;const a=this.isRegex,l=this.wholeWord,c=this.matchCase,u=this.preserveCase;typeof e.searchString<"u"&&this._searchString!==e.searchString&&(this._searchString=e.searchString,o.searchString=!0,s=!0),typeof e.replaceString<"u"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,o.replaceString=!0,s=!0),typeof e.isRevealed<"u"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,o.isRevealed=!0,s=!0),typeof e.isReplaceRevealed<"u"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,o.isReplaceRevealed=!0,s=!0),typeof e.isRegex<"u"&&(this._isRegex=e.isRegex),typeof e.wholeWord<"u"&&(this._wholeWord=e.wholeWord),typeof e.matchCase<"u"&&(this._matchCase=e.matchCase),typeof e.preserveCase<"u"&&(this._preserveCase=e.preserveCase),typeof e.searchScope<"u"&&(!((r=e.searchScope)===null||r===void 0)&&r.every(d=>{var h;return(h=this._searchScope)===null||h===void 0?void 0:h.some(f=>!B.equalsRange(f,d))})||(this._searchScope=e.searchScope,o.searchScope=!0,s=!0)),typeof e.loop<"u"&&this._loop!==e.loop&&(this._loop=e.loop,o.loop=!0,s=!0),typeof e.isSearching<"u"&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,o.isSearching=!0,s=!0),typeof e.filters<"u"&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,o.filters=!0,s=!0),this._isRegexOverride=typeof e.isRegexOverride<"u"?e.isRegexOverride:0,this._wholeWordOverride=typeof e.wholeWordOverride<"u"?e.wholeWordOverride:0,this._matchCaseOverride=typeof e.matchCaseOverride<"u"?e.matchCaseOverride:0,this._preserveCaseOverride=typeof e.preserveCaseOverride<"u"?e.preserveCaseOverride:0,a!==this.isRegex&&(s=!0,o.isRegex=!0),l!==this.wholeWord&&(s=!0,o.wholeWord=!0),c!==this.matchCase&&(s=!0,o.matchCase=!0),u!==this.preserveCase&&(s=!0,o.preserveCase=!0),s&&this._onFindReplaceStateChange.fire(o)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition=nv}}const _rt=w("defaultLabel","input"),brt=w("label.preserveCaseToggle","Preserve Case");class Crt extends AS{constructor(e){super({icon:Xe.preserveCase,title:brt+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class yrt extends yc{constructor(e,t,n,r){super(),this._showOptionButtons=n,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new se),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new se),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new se),this._onInput=this._register(new se),this._onKeyUp=this._register(new se),this._onPreserveCaseKeyDown=this._register(new se),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=r.placeholder||"",this.validation=r.validation,this.label=r.label||_rt;const o=r.appendPreserveCaseLabel||"",s=r.history||[],a=!!r.flexibleHeight,l=!!r.flexibleWidth,c=r.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new r0e(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:s,showHistoryHint:r.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:c,inputBoxStyles:r.inputBoxStyles})),this.preserveCase=this._register(new Crt({appendTitle:o,isChecked:!1,...r.toggleStyles})),this._register(this.preserveCase.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(h=>{this._onPreserveCaseKeyDown.fire(h)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;const u=[this.preserveCase.domNode];this.onkeydown(this.domNode,h=>{if(h.equals(15)||h.equals(17)||h.equals(9)){const f=u.indexOf(this.domNode.ownerDocument.activeElement);if(f>=0){let g=-1;h.equals(17)?g=(f+1)%u.length:h.equals(15)&&(f===0?g=u.length-1:g=f-1),h.equals(9)?(u[f].blur(),this.inputBox.focus()):g>=0&&u[g].focus(),hn.stop(h,!0)}}});const d=document.createElement("div");d.className="controls",d.style.display=this._showOptionButtons?"block":"none",d.appendChild(this.preserveCase.domNode),this.domNode.appendChild(d),e==null||e.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,h=>this._onKeyDown.fire(h)),this.onkeyup(this.inputBox.inputElement,h=>this._onKeyUp.fire(h)),this.oninput(this.inputBox.inputElement,h=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,h=>this._onMouseDown.fire(h))}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()}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}validate(){var e;(e=this.inputBox)===null||e===void 0||e.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}var i1e=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},r1e=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const YY=new st("suggestWidgetVisible",!1,w("suggestWidgetVisible","Whether suggestion are visible")),ZY="historyNavigationWidgetFocus",o1e="historyNavigationForwardsEnabled",s1e="historyNavigationBackwardsEnabled";let _p;const l2=[];function a1e(i,e){if(l2.includes(e))throw new Error("Cannot register the same widget multiple times");l2.push(e);const t=new Te,n=new st(ZY,!1).bindTo(i),r=new st(o1e,!0).bindTo(i),o=new st(s1e,!0).bindTo(i),s=()=>{n.set(!0),_p=e},a=()=>{n.set(!1),_p===e&&(_p=void 0)};return Mk(e.element)&&s(),t.add(e.onDidFocus(()=>s())),t.add(e.onDidBlur(()=>a())),t.add(Rt(()=>{l2.splice(l2.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:r,historyNavigationBackwardsEnablement:o,dispose(){t.dispose()}}}let pU=class extends o0e{constructor(e,t,n,r){super(e,t,n);const o=this._register(r.createScoped(this.inputBox.element));this._register(a1e(o,this.inputBox))}};pU=i1e([r1e(3,Vt)],pU);let mU=class extends yrt{constructor(e,t,n,r,o=!1){super(e,t,o,n);const s=this._register(r.createScoped(this.inputBox.element));this._register(a1e(s,this.inputBox))}};mU=i1e([r1e(3,Vt)],mU);nl.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:De.and(De.has(ZY),De.equals(s1e,!0),De.not("isComposing"),YY.isEqualTo(!1)),primary:16,secondary:[528],handler:i=>{_p==null||_p.showPreviousValue()}});nl.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:De.and(De.has(ZY),De.equals(o1e,!0),De.not("isComposing"),YY.isEqualTo(!1)),primary:18,secondary:[530],handler:i=>{_p==null||_p.showNextValue()}});function zae(i){var e,t;return((e=i.lookupKeybinding("history.showPrevious"))===null||e===void 0?void 0:e.getElectronAccelerator())==="Up"&&((t=i.lookupKeybinding("history.showNext"))===null||t===void 0?void 0:t.getElectronAccelerator())==="Down"}const wrt=Mr("find-selection",Xe.selection,w("findSelectionIcon","Icon for 'Find in Selection' in the editor find widget.")),Uae=Mr("find-collapsed",Xe.chevronRight,w("findCollapsedIcon","Icon to indicate that the editor find widget is collapsed.")),jae=Mr("find-expanded",Xe.chevronDown,w("findExpandedIcon","Icon to indicate that the editor find widget is expanded.")),Srt=Mr("find-replace",Xe.replace,w("findReplaceIcon","Icon for 'Replace' in the editor find widget.")),xrt=Mr("find-replace-all",Xe.replaceAll,w("findReplaceAllIcon","Icon for 'Replace All' in the editor find widget.")),Lrt=Mr("find-previous-match",Xe.arrowUp,w("findPreviousMatchIcon","Icon for 'Find Previous' in the editor find widget.")),Ert=Mr("find-next-match",Xe.arrowDown,w("findNextMatchIcon","Icon for 'Find Next' in the editor find widget.")),Drt=w("label.findDialog","Find / Replace"),Irt=w("label.find","Find"),krt=w("placeholder.find","Find"),Trt=w("label.previousMatchButton","Previous Match"),Nrt=w("label.nextMatchButton","Next Match"),Rrt=w("label.toggleSelectionFind","Find in Selection"),Mrt=w("label.closeButton","Close"),Art=w("label.replace","Replace"),Prt=w("placeholder.replace","Replace"),Ort=w("label.replaceButton","Replace"),Frt=w("label.replaceAllButton","Replace All"),Brt=w("label.toggleReplaceButton","Toggle Replace"),Wrt=w("title.matchesCountLimit","Only the first {0} results are highlighted, but all find operations work on the entire text.",nv),$rt=w("label.matchesLocation","{0} of {1}"),Kae=w("label.noResults","No results"),zh=419,Hrt=275,Vrt=Hrt-54;let Jx=69;const zrt=33,Gae="ctrlEnterReplaceAll.windows.donotask",qae=Ln?256:2048;class P9{constructor(e){this.afterLineNumber=e,this.heightInPx=zrt,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function Xae(i,e,t){const n=!!e.match(/\n/);if(t&&n&&t.selectionStart>0){i.stopPropagation();return}}function Yae(i,e,t){const n=!!e.match(/\n/);if(t&&n&&t.selectionEndthis._updateHistoryDelayer.cancel())),this._register(this._state.onFindReplaceStateChange(u=>this._onStateChanged(u))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration(u=>{if(u.hasChanged(91)&&(this._codeEditor.getOption(91)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),u.hasChanged(144)&&this._tryUpdateWidgetWidth(),u.hasChanged(2)&&this.updateAccessibilitySupport(),u.hasChanged(41)){const d=this._codeEditor.getOption(41).loop;this._state.change({loop:d},!1);const h=this._codeEditor.getOption(41).addExtraSpaceOnTop;h&&!this._viewZone&&(this._viewZone=new P9(0),this._showViewZone()),!h&&this._viewZone&&this._removeViewZone()}})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(async()=>{if(this._isVisible){const u=await this._controller.getGlobalBufferTerm();u&&u!==this._state.searchString&&(this._state.change({searchString:u},!1),this._findInput.select())}})),this._findInputFocused=V3.bindTo(s),this._findFocusTracker=this._register(dh(this._findInput.inputBox.inputElement)),this._register(this._findFocusTracker.onDidFocus(()=>{this._findInputFocused.set(!0),this._updateSearchScope()})),this._register(this._findFocusTracker.onDidBlur(()=>{this._findInputFocused.set(!1)})),this._replaceInputFocused=XY.bindTo(s),this._replaceFocusTracker=this._register(dh(this._replaceInput.inputBox.inputElement)),this._register(this._replaceFocusTracker.onDidFocus(()=>{this._replaceInputFocused.set(!0),this._updateSearchScope()})),this._register(this._replaceFocusTracker.onDidBlur(()=>{this._replaceInputFocused.set(!1)})),this._codeEditor.addOverlayWidget(this),this._codeEditor.getOption(41).addExtraSpaceOnTop&&(this._viewZone=new P9(0)),this._register(this._codeEditor.onDidChangeModel(()=>{this._isVisible&&(this._viewZoneId=void 0)})),this._register(this._codeEditor.onDidScrollChange(u=>{if(u.scrollTopChanged){this._layoutViewZone();return}setTimeout(()=>{this._layoutViewZone()},0)}))}getId(){return U3.ID}getDomNode(){return this._domNode}getPosition(){return this._isVisible?{preference:0}:null}_onStateChanged(e){if(e.searchString){try{this._ignoreChangeEvent=!0,this._findInput.setValue(this._state.searchString)}finally{this._ignoreChangeEvent=!1}this._updateButtons()}if(e.replaceString&&(this._replaceInput.inputBox.value=this._state.replaceString),e.isRevealed&&(this._state.isRevealed?this._reveal():this._hide(!0)),e.isReplaceRevealed&&(this._state.isReplaceRevealed?!this._codeEditor.getOption(91)&&!this._isReplaceVisible&&(this._isReplaceVisible=!0,this._replaceInput.width=ua(this._findInput.domNode),this._updateButtons(),this._replaceInput.inputBox.layout()):this._isReplaceVisible&&(this._isReplaceVisible=!1,this._updateButtons())),(e.isRevealed||e.isReplaceRevealed)&&(this._state.isRevealed||this._state.isReplaceRevealed)&&this._tryUpdateHeight()&&this._showViewZone(),e.isRegex&&this._findInput.setRegex(this._state.isRegex),e.wholeWord&&this._findInput.setWholeWords(this._state.wholeWord),e.matchCase&&this._findInput.setCaseSensitive(this._state.matchCase),e.preserveCase&&this._replaceInput.setPreserveCase(this._state.preserveCase),e.searchScope&&(this._state.searchScope?this._toggleSelectionFind.checked=!0:this._toggleSelectionFind.checked=!1,this._updateToggleSelectionFindButton()),e.searchString||e.matchesCount||e.matchesPosition){const t=this._state.searchString.length>0&&this._state.matchesCount===0;this._domNode.classList.toggle("no-results",t),this._updateMatchesCount(),this._updateButtons()}(e.searchString||e.currentMatch)&&this._layoutViewZone(),e.updateHistory&&this._delayedUpdateHistory(),e.loop&&this._updateButtons()}_delayedUpdateHistory(){this._updateHistoryDelayer.trigger(this._updateHistory.bind(this)).then(void 0,en)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){this._matchesCount.style.minWidth=Jx+"px",this._state.matchesCount>=nv?this._matchesCount.title=Wrt:this._matchesCount.title="",this._matchesCount.firstChild&&this._matchesCount.removeChild(this._matchesCount.firstChild);let e;if(this._state.matchesCount>0){let t=String(this._state.matchesCount);this._state.matchesCount>=nv&&(t+="+");let n=String(this._state.matchesPosition);n==="0"&&(n="?"),e=Eb($rt,n,t)}else e=Kae;this._matchesCount.appendChild(document.createTextNode(e)),kl(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),Jx=Math.max(Jx,this._matchesCount.clientWidth)}_getAriaLabel(e,t,n){if(e===Kae)return n===""?w("ariaSearchNoResultEmpty","{0} found",e):w("ariaSearchNoResult","{0} found for '{1}'",e,n);if(t){const r=w("ariaSearchNoResultWithLineNum","{0} found for '{1}', at {2}",e,n,t.startLineNumber+":"+t.startColumn),o=this._codeEditor.getModel();return o&&t.startLineNumber<=o.getLineCount()&&t.startLineNumber>=1?`${o.getLineContent(t.startLineNumber)}, ${r}`:r}return w("ariaSearchNoResultWithLineNumNoCurrentMatch","{0} found for '{1}'",e,n)}_updateToggleSelectionFindButton(){const e=this._codeEditor.getSelection(),t=e?e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn:!1,n=this._toggleSelectionFind.checked;this._isVisible&&(n||t)?this._toggleSelectionFind.enable():this._toggleSelectionFind.disable()}_updateButtons(){this._findInput.setEnabled(this._isVisible),this._replaceInput.setEnabled(this._isVisible&&this._isReplaceVisible),this._updateToggleSelectionFindButton(),this._closeBtn.setEnabled(this._isVisible);const e=this._state.searchString.length>0,t=!!this._state.matchesCount;this._prevBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateBack()),this._nextBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateForward()),this._replaceBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._replaceAllBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._domNode.classList.toggle("replaceToggled",this._isReplaceVisible),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);const n=!this._codeEditor.getOption(91);this._toggleReplaceBtn.setEnabled(this._isVisible&&n)}_reveal(){if(this._revealTimeouts.forEach(e=>{clearTimeout(e)}),this._revealTimeouts=[],!this._isVisible){this._isVisible=!0;const e=this._codeEditor.getSelection();switch(this._codeEditor.getOption(41).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":{const n=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=n;break}}this._tryUpdateWidgetWidth(),this._updateButtons(),this._revealTimeouts.push(setTimeout(()=>{this._domNode.classList.add("visible"),this._domNode.setAttribute("aria-hidden","false")},0)),this._revealTimeouts.push(setTimeout(()=>{this._findInput.validate()},200)),this._codeEditor.layoutOverlayWidget(this);let t=!0;if(this._codeEditor.getOption(41).seedSearchStringFromSelection&&e){const n=this._codeEditor.getDomNode();if(n){const r=Br(n),o=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),s=r.left+(o?o.left:0),a=o?o.top:0;if(this._viewZone&&ae.startLineNumber&&(t=!1);const l=nme(this._domNode).left;s>l&&(t=!1);const c=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());r.left+(c?c.left:0)>l&&(t=!1)}}}this._showViewZone(t)}}_hide(e){this._revealTimeouts.forEach(t=>{clearTimeout(t)}),this._revealTimeouts=[],this._isVisible&&(this._isVisible=!1,this._updateButtons(),this._domNode.classList.remove("visible"),this._domNode.setAttribute("aria-hidden","true"),this._findInput.clearMessage(),e&&this._codeEditor.focus(),this._codeEditor.layoutOverlayWidget(this),this._removeViewZone())}_layoutViewZone(e){if(!this._codeEditor.getOption(41).addExtraSpaceOnTop){this._removeViewZone();return}if(!this._isVisible)return;const n=this._viewZone;this._viewZoneId!==void 0||!n||this._codeEditor.changeViewZones(r=>{n.heightInPx=this._getHeight(),this._viewZoneId=r.addZone(n),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+n.heightInPx)})}_showViewZone(e=!0){if(!this._isVisible||!this._codeEditor.getOption(41).addExtraSpaceOnTop)return;this._viewZone===void 0&&(this._viewZone=new P9(0));const n=this._viewZone;this._codeEditor.changeViewZones(r=>{if(this._viewZoneId!==void 0){const o=this._getHeight();if(o===n.heightInPx)return;const s=o-n.heightInPx;n.heightInPx=o,r.layoutZone(this._viewZoneId),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+s);return}else{let o=this._getHeight();if(o-=this._codeEditor.getOption(84).top,o<=0)return;n.heightInPx=o,this._viewZoneId=r.addZone(n),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+o)}})}_removeViewZone(){this._codeEditor.changeViewZones(e=>{this._viewZoneId!==void 0&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0,this._viewZone&&(this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()-this._viewZone.heightInPx),this._viewZone=void 0))})}_tryUpdateWidgetWidth(){if(!this._isVisible||!this._domNode.isConnected)return;const e=this._codeEditor.getLayoutInfo();if(e.contentWidth<=0){this._domNode.classList.add("hiddenEditor");return}else this._domNode.classList.contains("hiddenEditor")&&this._domNode.classList.remove("hiddenEditor");const n=e.width,r=e.minimap.minimapWidth;let o=!1,s=!1,a=!1;if(this._resized&&ua(this._domNode)>zh){this._domNode.style.maxWidth=`${n-28-r-15}px`,this._replaceInput.width=ua(this._findInput.domNode);return}if(zh+28+r>=n&&(s=!0),zh+28+r-Jx>=n&&(a=!0),zh+28+r-Jx>=n+50&&(o=!0),this._domNode.classList.toggle("collapsed-find-widget",o),this._domNode.classList.toggle("narrow-find-widget",a),this._domNode.classList.toggle("reduced-find-widget",s),!a&&!o&&(this._domNode.style.maxWidth=`${n-28-r-15}px`),this._findInput.layout({collapsedFindWidget:o,narrowFindWidget:a,reducedFindWidget:s}),this._resized){const l=this._findInput.inputBox.element.clientWidth;l>0&&(this._replaceInput.width=l)}else this._isReplaceVisible&&(this._replaceInput.width=ua(this._findInput.domNode))}_getHeight(){let e=0;return e+=4,e+=this._findInput.inputBox.height+2,this._isReplaceVisible&&(e+=4,e+=this._replaceInput.inputBox.height+2),e+=4,e}_tryUpdateHeight(){const e=this._getHeight();return this._cachedHeight!==null&&this._cachedHeight===e?!1:(this._cachedHeight=e,this._domNode.style.height=`${e}px`,!0)}focusFindInput(){this._findInput.select(),this._findInput.focus()}focusReplaceInput(){this._replaceInput.select(),this._replaceInput.focus()}highlightFindOptions(){this._findInput.highlightFindOptions()}_updateSearchScope(){if(this._codeEditor.hasModel()&&this._toggleSelectionFind.checked){const e=this._codeEditor.getSelections();e.map(t=>{t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(t.endLineNumber-1)));const n=this._state.currentMatch;return t.startLineNumber!==t.endLineNumber&&!B.equalsRange(t,n)?t:null}).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){if(e.equals(qae|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._findInput.inputBox.insertAtCursor(` +`),parse:i=>N3.split(i).filter(e=>!e.startsWith("#"))}),fae={EDITORS:"CodeEditors",FILES:"CodeFiles"};class Ttt{}const Ntt={DragAndDropContribution:"workbench.contributions.dragAndDrop"};ar.add(Ntt.DragAndDropContribution,new Ttt);class DI{constructor(){}static getInstance(){return DI.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}}DI.INSTANCE=new DI;function Ube(i){const e=new Hbe;for(const t of i.items){const n=t.type;if(t.kind==="string"){const r=new Promise(o=>t.getAsString(o));e.append(n,RY(r))}else if(t.kind==="file"){const r=t.getAsFile();r&&e.append(n,Rtt(r))}}return e}function Rtt(i){const e=i.path?At.parse(i.path):void 0;return ktt(i.name,e,async()=>new Uint8Array(await i.arrayBuffer()))}const Mtt=Object.freeze([fae.EDITORS,fae.FILES,lI.RESOURCES,lI.INTERNAL_URI_LIST]);function jbe(i,e=!1){const t=Ube(i),n=t.get(lI.INTERNAL_URI_LIST);if(n)t.replace(Cr.uriList,n);else if(e||!t.has(Cr.uriList)){const r=[];for(const o of i.items){const s=o.getAsFile();if(s){const a=s.path;try{a?r.push(At.file(a).toString()):r.push(At.parse(s.name,!0).toString())}catch{}}}r.length&&t.replace(Cr.uriList,RY(N3.create(r)))}for(const r of Mtt)t.delete(r);return t}class Pu{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};const e=this.pos;let t=0,n=this.value.charCodeAt(e),r;if(r=Pu._table[n],typeof r=="number")return this.pos+=1,{type:r,pos:e,len:1};if(Pu.isDigitCharacter(n)){r=8;do t+=1,n=this.value.charCodeAt(e+t);while(Pu.isDigitCharacter(n));return this.pos+=t,{type:r,pos:e,len:t}}if(Pu.isVariableCharacter(n)){r=9;do n=this.value.charCodeAt(e+ ++t);while(Pu.isVariableCharacter(n)||Pu.isDigitCharacter(n));return this.pos+=t,{type:r,pos:e,len:t}}r=10;do t+=1,n=this.value.charCodeAt(e+t);while(!isNaN(n)&&typeof Pu._table[n]>"u"&&!Pu.isDigitCharacter(n)&&!Pu.isVariableCharacter(n));return this.pos+=t,{type:r,pos:e,len:t}}}Pu._table={[36]:0,[58]:1,[44]:2,[123]:3,[125]:4,[92]:5,[47]:6,[124]:7,[43]:11,[45]:12,[63]:13};class $S{constructor(){this._children=[]}appendChild(e){return e instanceof pa&&this._children[this._children.length-1]instanceof pa?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:n}=e,r=n.children.indexOf(e),o=n.children.slice(0);o.splice(r,1,...t),n._children=o,function s(a,l){for(const c of a)c.parent=l,s(c.children,c)}(t,n)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof lT)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class pa extends $S{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new pa(this.value)}}class Kbe extends $S{}class Vc extends Kbe{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.indext.index?1:0}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof HS?this._children[0]:void 0}clone(){const e=new Vc(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class HS extends $S{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof pa&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new HS;return this.options.forEach(e.appendChild,e),e}}class MY extends $S{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let n=!1,r=e.replace(this.regexp,function(){return n=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!n&&this._children.some(o=>o instanceof Ad&&!!o.elseValue)&&(r=this._replace([])),r}_replace(e){let t="";for(const n of this._children)if(n instanceof Ad){let r=e[n.index]||"";r=n.resolve(r),t+=r}else t+=n.toString();return t}toString(){return""}clone(){const e=new MY;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}}class Ad extends $S{constructor(e,t,n,r){super(),this.index=e,this.shorthandName=t,this.ifValue=n,this.elseValue=r}resolve(e){return this.shorthandName==="upcase"?e?e.toLocaleUpperCase():"":this.shorthandName==="downcase"?e?e.toLocaleLowerCase():"":this.shorthandName==="capitalize"?e?e[0].toLocaleUpperCase()+e.substr(1):"":this.shorthandName==="pascalcase"?e?this._toPascalCase(e):"":this.shorthandName==="camelcase"?e?this._toCamelCase(e):"":e&&typeof this.ifValue=="string"?this.ifValue:!e&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(n=>n.charAt(0).toUpperCase()+n.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((n,r)=>r===0?n.charAt(0).toLowerCase()+n.substr(1):n.charAt(0).toUpperCase()+n.substr(1)).join(""):e}clone(){return new Ad(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class II extends Kbe{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),t!==void 0?(this._children=[new pa(t)],!0):!1}clone(){const e=new II(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function gae(i,e){const t=[...i];for(;t.length>0;){const n=t.shift();if(!e(n))break;t.unshift(...n.children)}}class lT extends $S{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(n){return n instanceof Vc&&(e.push(n),t=!t||t.indexr===e?(n=!0,!1):(t+=r.len(),!0)),n?t:-1}fullLen(e){let t=0;return gae([e],n=>(t+=n.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:n}=e;for(;n;)n instanceof Vc&&t.push(n),n=n.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof II&&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(){const e=new lT;return this._children=this.children.map(t=>t.clone()),e}walk(e){gae(this.children,e)}}class Hb{constructor(){this._scanner=new Pu,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,n){const r=new lT;return this.parseFragment(e,r),this.ensureFinalTabstop(r,n??!1,t??!1),r}parseFragment(e,t){const n=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const r=new Map,o=[];t.walk(l=>(l instanceof Vc&&(l.isFinalTabstop?r.set(0,void 0):!r.has(l.index)&&l.children.length>0?r.set(l.index,l.children):o.push(l)),!0));const s=(l,c)=>{const u=r.get(l.index);if(!u)return;const d=new Vc(l.index);d.transform=l.transform;for(const h of u){const f=h.clone();d.appendChild(f),f instanceof Vc&&r.has(f.index)&&!c.has(f.index)&&(c.add(f.index),s(f,c),c.delete(f.index))}t.replace(l,[d])},a=new Set;for(const l of o)s(l,a);return t.children.slice(n)}ensureFinalTabstop(e,t,n){(t||n&&e.placeholders.length>0)&&(e.placeholders.find(o=>o.index===0)||e.appendChild(new Vc(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const n=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),n}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){const r=this._scanner.next();if(r.type!==0&&r.type!==4&&r.type!==5)return!1}this._token=this._scanner.next()}const n=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),n}_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 pa(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const n=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new Vc(Number(t)):new II(t)),!0):this._backTo(n)}_parseComplexPlaceholder(e){let t;const n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(n);const o=new Vc(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new pa("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else if(o.index>0&&this._accept(7)){const s=new HS;for(;;){if(this._parseChoiceElement(s)){if(this._accept(2))continue;if(this._accept(7)&&(o.appendChild(s),this._accept(4)))return e.appendChild(o),!0}return this._backTo(n),!1}}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(n),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(n)}_parseChoiceElement(e){const t=this._token,n=[];for(;!(this._token.type===2||this._token.type===7);){let r;if((r=this._accept(5,!0))?r=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||r:r=this._accept(void 0,!0),!r)return this._backTo(t),!1;n.push(r)}return n.length===0?(this._backTo(t),!1):(e.appendChild(new pa(n.join(""))),!0)}_parseComplexVariable(e){let t;const n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(n);const o=new II(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new pa("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(n),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(n)}_parseTransform(e){const t=new MY;let n="",r="";for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(6,!0)||o,n+=o;continue}if(this._token.type!==14){n+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(5,!0)||this._accept(6,!0)||o,t.appendChild(new pa(o));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){r+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(n,r)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let n=!1;this._accept(3)&&(n=!0);const r=this._accept(8,!0);if(r)if(n){if(this._accept(4))return e.appendChild(new Ad(Number(r))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new Ad(Number(r))),!0;else return this._backTo(t),!1;if(this._accept(6)){const o=this._accept(9,!0);return!o||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new Ad(Number(r),o)),!0)}else if(this._accept(11)){const o=this._until(4);if(o)return e.appendChild(new Ad(Number(r),void 0,o,void 0)),!0}else if(this._accept(12)){const o=this._until(4);if(o)return e.appendChild(new Ad(Number(r),void 0,void 0,o)),!0}else if(this._accept(13)){const o=this._until(1);if(o){const s=this._until(4);if(s)return e.appendChild(new Ad(Number(r),void 0,o,s)),!0}}else{const o=this._until(4);if(o)return e.appendChild(new Ad(Number(r),void 0,void 0,o)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new pa(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}function Gbe(i,e,t){var n,r,o,s;return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:(r=(n=t.additionalEdit)===null||n===void 0?void 0:n.edits)!==null&&r!==void 0?r:[]}:{edits:[...e.map(a=>new xv(i,{range:a,text:typeof t.insertText=="string"?Hb.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...(s=(o=t.additionalEdit)===null||o===void 0?void 0:o.edits)!==null&&s!==void 0?s:[]]}}function qbe(i){var e;function t(a,l){return"providerId"in a&&a.providerId===l.providerId||"mimeType"in a&&a.mimeType===l.handledMimeType}const n=new Map;for(const a of i)for(const l of(e=a.yieldTo)!==null&&e!==void 0?e:[])for(const c of i)if(c!==a&&t(l,c)){let u=n.get(a);u||(u=[],n.set(a,u)),u.push(c)}if(!n.size)return Array.from(i);const r=new Set,o=[];function s(a){if(!a.length)return[];const l=a[0];if(o.includes(l))return console.warn(`Yield to cycle detected for ${l.providerId}`),a;if(r.has(l))return s(a.slice(1));let c=[];const u=n.get(l);return u&&(o.push(l),c=s(u),o.pop()),r.add(l),[...c,l,...s(a.slice(1))]}return s(Array.from(i))}var Att=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Ptt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Ott=sn.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:Wpe,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}});class R3 extends fe{constructor(e,t,n,r,o){super(),this.typeId=e,this.editor=t,this.range=n,this.delegate=o,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(r),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=He(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=He("span.icon");this.domNode.append(t),t.classList.add(...Wt.asClassNameArray(Xe.loading),"codicon-modifier-spin");const n=()=>{const r=this.editor.getOption(67);this.domNode.style.height=`${r}px`,this.domNode.style.width=`${Math.ceil(.8*r)}px`};n(),this._register(this.editor.onDidChangeConfiguration(r=>{(r.hasChanged(52)||r.hasChanged(67))&&n()})),this._register(ye(this.domNode,Ge.CLICK,r=>{this.delegate.cancel()}))}getId(){return R3.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[0]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}}R3.baseId="editor.widget.inlineProgressWidget";let uO=class extends fe{constructor(e,t,n){super(),this.id=e,this._editor=t,this._instantiationService=n,this._showDelay=500,this._showPromise=this._register(new Ho),this._currentWidget=new Ho,this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}async showWhile(e,t,n){const r=this._operationIdPool++;this._currentOperation=r,this.clear(),this._showPromise.value=jv(()=>{const o=B.fromPositions(e);this._currentDecorations.set([{range:o,options:Ott}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(R3,this.id,this._editor,o,t,n))},this._showDelay);try{return await n}finally{this._currentOperation===r&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};uO=Att([Ptt(2,Ot)],uO);var Xbe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},NE=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Mz;let dO=Mz=class extends fe{constructor(e,t,n,r,o,s,a,l,c,u){super(),this.typeId=e,this.editor=t,this.showCommand=r,this.range=o,this.edits=s,this.onSelectNewEdit=a,this._contextMenuService=l,this._keybindingService=u,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=n.bindTo(c),this.visibleContext.set(!0),this._register(Rt(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(Rt(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(d=>{o.containsPosition(d.position)||this.dispose()})),this._register(Je.runAndSubscribe(u.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var e;const t=(e=this._keybindingService.lookupKeybinding(this.showCommand.id))===null||e===void 0?void 0:e.getLabel();this.button.element.title=this.showCommand.label+(t?` (${t})`:"")}create(){this.domNode=He(".post-edit-widget"),this.button=this._register(new QP(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(ye(this.domNode,Ge.CLICK,()=>this.showSelector()))}getId(){return Mz.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=Br(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>My({id:"",label:e.label,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}};dO.baseId="editor.widget.postEditWidget";dO=Mz=Xbe([NE(7,Ol),NE(8,Vt),NE(9,ci)],dO);let hO=class extends fe{constructor(e,t,n,r,o,s){super(),this._id=e,this._editor=t,this._visibleContext=n,this._showCommand=r,this._instantiationService=o,this._bulkEditService=s,this._currentWidget=this._register(new Ho),this._register(Je.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,n,r){const o=this._editor.getModel();if(!o||!e.length)return;const s=t.allEdits[t.activeEditIndex];if(!s)return;const a=Gbe(o.uri,e,s),l=e[0],c=o.deltaDecorations([],[{range:l,options:{description:"paste-line-suffix",stickiness:0}}]);let u,d;try{u=await this._bulkEditService.apply(a,{editor:this._editor,token:r}),d=o.getDecorationRange(c[0])}finally{o.deltaDecorations(c,[])}n&&u.isApplied&&t.allEdits.length>1&&this.show(d??l,t,async h=>{const f=this._editor.getModel();f&&(await f.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:h,allEdits:t.allEdits},n,r))})}show(e,t,n){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(dO,this._id,this._editor,this._visibleContext,this._showCommand,e,t,n))}clear(){this._currentWidget.clear()}tryShowSelector(){var e;(e=this._currentWidget.value)===null||e===void 0||e.showSelector()}};hO=Xbe([NE(4,Ot),NE(5,Xk)],hO);var Ftt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},pae=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},PM;let xa=PM=class{static get(e){return e.getContribution(PM.ID)}constructor(e,t,n){this._openerService=n,this._messageWidget=new Ho,this._messageListeners=new Te,this._mouseOverMessage=!1,this._editor=e,this._visible=PM.MESSAGE_VISIBLE.bindTo(t)}dispose(){var e;(e=this._message)===null||e===void 0||e.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){kl(Mf(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=Mf(e)?Y4(e,{actionHandler:{callback:r=>{this.closeMessage(),HX(this._openerService,r,Mf(e)?e.isTrusted:void 0)},disposables:this._messageListeners}}):void 0,this._messageWidget.value=new mae(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(Je.debounce(this._editor.onDidBlurEditorText,(r,o)=>o,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&es(fs(),this._messageWidget.value.getDomNode())||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(ye(this._messageWidget.value.getDomNode(),Ge.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(ye(this._messageWidget.value.getDomNode(),Ge.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let n;this._messageListeners.add(this._editor.onMouseMove(r=>{r.target.position&&(n?n.containsPosition(r.target.position)||this.closeMessage():n=new B(t.lineNumber-3,1,r.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(mae.fadeOut(this._messageWidget.value))}};xa.ID="editor.contrib.messageController";xa.MESSAGE_VISIBLE=new st("messageVisible",!1,w("messageVisible","Whether the editor is currently showing an inline message"));xa=PM=Ftt([pae(1,Vt),pae(2,al)],xa);const Btt=Vo.bindToContribution(xa.get);et(new Btt({id:"leaveEditorMessage",precondition:xa.MESSAGE_VISIBLE,handler:i=>i.closeMessage(),kbOpts:{weight:100+30,primary:9}}));let mae=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(n),e.getDomNode().removeEventListener("animationend",t)},n=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:n},r){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:n},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const o=document.createElement("div");o.classList.add("anchor","top"),this._domNode.appendChild(o);const s=document.createElement("div");typeof r=="string"?(s.classList.add("message"),s.textContent=r):(r.classList.add("message"),s.appendChild(r)),this._domNode.appendChild(s);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};jn(xa.ID,xa,4);var Wtt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},n1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Az;const Ybe="editor.changePasteType",Zbe=new st("pasteWidgetVisible",!1,w("pasteWidgetVisible","Whether the paste widget is showing")),w9="application/vnd.code.copyMetadata";let Rp=Az=class extends fe{static get(e){return e.getContribution(Az.ID)}constructor(e,t,n,r,o,s,a){super(),this._bulkEditService=n,this._clipboardService=r,this._languageFeaturesService=o,this._quickInputService=s,this._progressService=a,this._editor=e;const l=e.getContainerDomNode();this._register(ye(l,"copy",c=>this.handleCopy(c))),this._register(ye(l,"cut",c=>this.handleCopy(c))),this._register(ye(l,"paste",c=>this.handlePaste(c),!0)),this._pasteProgressManager=this._register(new uO("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(hO,"pasteIntoEditor",e,Zbe,{id:Ybe,label:w("postPasteWidgetTitle","Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferredId:e},xS().execCommand("paste")}finally{this._pasteAsActionContext=void 0}}isPasteAsEnabled(){return this._editor.getOption(85).enabled&&!this._editor.getOption(91)}async finishedPaste(){await this._currentPasteOperation}handleCopy(e){var t,n;if(!this._editor.hasTextFocus()||(S_&&this._clipboardService.writeResources([]),!e.clipboardData||!this.isPasteAsEnabled()))return;const r=this._editor.getModel(),o=this._editor.getSelections();if(!r||!(o!=null&&o.length))return;const s=this._editor.getOption(37);let a=o;const l=o.length===1&&o[0].isEmpty();if(l){if(!s)return;a=[new B(a[0].startLineNumber,1,a[0].startLineNumber,1+r.getLineLength(a[0].startLineNumber))]}const c=(t=this._editor._getViewModel())===null||t===void 0?void 0:t.getPlainTextToCopy(o,s,Rs),d={multicursorText:Array.isArray(c)?c:null,pasteOnNewLine:l,mode:null},h=this._languageFeaturesService.documentPasteEditProvider.ordered(r).filter(m=>!!m.prepareDocumentPaste);if(!h.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:d});return}const f=Ube(e.clipboardData),g=h.flatMap(m=>{var _;return(_=m.copyMimeTypes)!==null&&_!==void 0?_:[]}),p=T3();this.setCopyMetadata(e.clipboardData,{id:p,providerCopyMimeTypes:g,defaultPastePayload:d});const v=Io(async m=>{const _=lh(await Promise.all(h.map(async y=>{try{return await y.prepareDocumentPaste(r,a,f,m)}catch(S){console.error(S);return}})));_.reverse();for(const y of _)for(const[S,L]of y)f.replace(S,L);return f});(n=this._currentCopyOperation)===null||n===void 0||n.dataTransferPromise.cancel(),this._currentCopyOperation={handle:p,dataTransferPromise:v}}async handlePaste(e){var t,n,r,o,s;if(!e.clipboardData||!this._editor.hasTextFocus())return;(t=xa.get(this._editor))===null||t===void 0||t.closeMessage(),(n=this._currentPasteOperation)===null||n===void 0||n.cancel(),this._currentPasteOperation=void 0;const a=this._editor.getModel(),l=this._editor.getSelections();if(!(l!=null&&l.length)||!a||!this.isPasteAsEnabled()&&!this._pasteAsActionContext)return;const c=this.fetchCopyMetadata(e),u=jbe(e.clipboardData);u.delete(w9);const d=[...e.clipboardData.types,...(r=c==null?void 0:c.providerCopyMimeTypes)!==null&&r!==void 0?r:[],Cr.uriList],h=this._languageFeaturesService.documentPasteEditProvider.ordered(a).filter(f=>{var g,p;return!((g=this._pasteAsActionContext)===null||g===void 0)&&g.preferredId&&this._pasteAsActionContext.preferredId!==f.id?!1:(p=f.pasteMimeTypes)===null||p===void 0?void 0:p.some(v=>Vbe(v,d))});if(!h.length){!((o=this._pasteAsActionContext)===null||o===void 0)&&o.preferredId&&this.showPasteAsNoEditMessage(l,(s=this._pasteAsActionContext)===null||s===void 0?void 0:s.preferredId);return}e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferredId,h,l,u,c,{trigger:"explicit",only:this._pasteAsActionContext.preferredId}):this.doPasteInline(h,l,u,c,{trigger:"implicit"})}showPasteAsNoEditMessage(e,t){var n;(n=xa.get(this._editor))===null||n===void 0||n.showMessage(w("pasteAsError","No paste edits for '{0}' found",t),e[0].getStartPosition())}doPasteInline(e,t,n,r,o){const s=Io(async a=>{const l=this._editor;if(!l.hasModel())return;const c=l.getModel(),u=new n_(l,3,void 0,a);try{if(await this.mergeInDataFromCopy(n,r,u.token),u.token.isCancellationRequested)return;const d=e.filter(f=>vae(f,n));if(!d.length||d.length===1&&d[0].id==="text"){await this.applyDefaultPasteHandler(n,r,u.token);return}const h=await this.getPasteEdits(d,n,c,t,o,u.token);if(u.token.isCancellationRequested)return;if(h.length===1&&h[0].providerId==="text"){await this.applyDefaultPasteHandler(n,r,u.token);return}if(h.length){const f=l.getOption(85).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:0,allEdits:h},f,u.token)}await this.applyDefaultPasteHandler(n,r,u.token)}finally{u.dispose(),this._currentPasteOperation===s&&(this._currentPasteOperation=void 0)}});this._pasteProgressManager.showWhile(t[0].getEndPosition(),w("pasteIntoEditorProgress","Running paste handlers. Click to cancel"),s),this._currentPasteOperation=s}showPasteAsPick(e,t,n,r,o,s){const a=Io(async l=>{const c=this._editor;if(!c.hasModel())return;const u=c.getModel(),d=new n_(c,3,void 0,l);try{if(await this.mergeInDataFromCopy(r,o,d.token),d.token.isCancellationRequested)return;let h=t.filter(v=>vae(v,r));e&&(h=h.filter(v=>v.id===e));const f=await this.getPasteEdits(h,r,u,n,s,d.token);if(d.token.isCancellationRequested)return;if(!f.length){s.only&&this.showPasteAsNoEditMessage(n,s.only);return}let g;if(e)g=f.at(0);else{const v=await this._quickInputService.pick(f.map(m=>({label:m.label,description:m.providerId,detail:m.detail,edit:m})),{placeHolder:w("pasteAsPickerPlaceholder","Select Paste Action")});g=v==null?void 0:v.edit}if(!g)return;const p=Gbe(u.uri,n,g);await this._bulkEditService.apply(p,{editor:this._editor})}finally{d.dispose(),this._currentPasteOperation===a&&(this._currentPasteOperation=void 0)}});this._progressService.withProgress({location:10,title:w("pasteAsProgress","Running paste handlers")},()=>a)}setCopyMetadata(e,t){e.setData(w9,JSON.stringify(t))}fetchCopyMetadata(e){var t;if(!e.clipboardData)return;const n=e.clipboardData.getData(w9);if(n)try{return JSON.parse(n)}catch{return}const[r,o]=MH.getTextData(e.clipboardData);if(o)return{defaultPastePayload:{mode:o.mode,multicursorText:(t=o.multicursorText)!==null&&t!==void 0?t:null,pasteOnNewLine:!!o.isFromEmptySelection}}}async mergeInDataFromCopy(e,t,n){var r;if(t!=null&&t.id&&((r=this._currentCopyOperation)===null||r===void 0?void 0:r.handle)===t.id){const o=await this._currentCopyOperation.dataTransferPromise;if(n.isCancellationRequested)return;for(const[s,a]of o)e.replace(s,a)}if(!e.has(Cr.uriList)){const o=await this._clipboardService.readResources();if(n.isCancellationRequested)return;o.length&&e.append(Cr.uriList,RY(N3.create(o)))}}async getPasteEdits(e,t,n,r,o,s){const a=await Rk(Promise.all(e.map(async c=>{var u;try{const d=await((u=c.provideDocumentPasteEdits)===null||u===void 0?void 0:u.call(c,n,r,t,o,s));if(d)return{...d,providerId:c.id}}catch(d){console.error(d)}})),s),l=lh(a??[]);return qbe(l)}async applyDefaultPasteHandler(e,t,n){var r,o,s;const a=(r=e.get(Cr.text))!==null&&r!==void 0?r:e.get("text");if(!a)return;const l=await a.asString();if(n.isCancellationRequested)return;const c={text:l,pasteOnNewLine:(o=t==null?void 0:t.defaultPastePayload.pasteOnNewLine)!==null&&o!==void 0?o:!1,multicursorText:(s=t==null?void 0:t.defaultPastePayload.multicursorText)!==null&&s!==void 0?s:null,mode:null};this._editor.trigger("keyboard","paste",c)}};Rp.ID="editor.contrib.copyPasteActionController";Rp=Az=Wtt([n1(1,Ot),n1(2,Xk),n1(3,Kp),n1(4,_t),n1(5,Eh),n1(6,P_e)],Rp);function vae(i,e){var t;return!!(!((t=i.pasteMimeTypes)===null||t===void 0)&&t.some(n=>e.matches(n)))}const Vb="9_cutcopypaste",$tt=Jd||document.queryCommandSupported("cut"),Qbe=Jd||document.queryCommandSupported("copy"),Htt=typeof navigator.clipboard>"u"||ru?document.queryCommandSupported("paste"):!0;function AY(i){return i.register(),i}const Vtt=$tt?AY(new ES({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:Jd?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:$.MenubarEditMenu,group:"2_ccp",title:w({key:"miCut",comment:["&& denotes a mnemonic"]},"Cu&&t"),order:1},{menuId:$.EditorContext,group:Vb,title:w("actions.clipboard.cutLabel","Cut"),when:j.writable,order:1},{menuId:$.CommandPalette,group:"",title:w("actions.clipboard.cutLabel","Cut"),order:1},{menuId:$.SimpleEditorContext,group:Vb,title:w("actions.clipboard.cutLabel","Cut"),when:j.writable,order:1}]})):void 0,ztt=Qbe?AY(new ES({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:Jd?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:$.MenubarEditMenu,group:"2_ccp",title:w({key:"miCopy",comment:["&& denotes a mnemonic"]},"&&Copy"),order:2},{menuId:$.EditorContext,group:Vb,title:w("actions.clipboard.copyLabel","Copy"),order:2},{menuId:$.CommandPalette,group:"",title:w("actions.clipboard.copyLabel","Copy"),order:1},{menuId:$.SimpleEditorContext,group:Vb,title:w("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;ts.appendMenuItem($.MenubarEditMenu,{submenu:$.MenubarCopy,title:$n("copy as","Copy As"),group:"2_ccp",order:3});ts.appendMenuItem($.EditorContext,{submenu:$.EditorContextCopy,title:$n("copy as","Copy As"),group:Vb,order:3});ts.appendMenuItem($.EditorContext,{submenu:$.EditorContextShare,title:$n("share","Share"),group:"11_share",order:-1,when:De.and(De.notEquals("resourceScheme","output"),j.editorTextFocus)});ts.appendMenuItem($.EditorTitleContext,{submenu:$.EditorTitleContextShare,title:$n("share","Share"),group:"11_share",order:-1});ts.appendMenuItem($.ExplorerContext,{submenu:$.ExplorerContextShare,title:$n("share","Share"),group:"11_share",order:-1});const S9=Htt?AY(new ES({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:Jd?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:$.MenubarEditMenu,group:"2_ccp",title:w({key:"miPaste",comment:["&& denotes a mnemonic"]},"&&Paste"),order:4},{menuId:$.EditorContext,group:Vb,title:w("actions.clipboard.pasteLabel","Paste"),when:j.writable,order:4},{menuId:$.CommandPalette,group:"",title:w("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:$.SimpleEditorContext,group:Vb,title:w("actions.clipboard.pasteLabel","Paste"),when:j.writable,order:4}]})):void 0;class Utt extends gt{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:w("actions.clipboard.copyWithSyntaxHighlightingLabel","Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:j.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(37)&&t.getSelection().isEmpty()||(NH.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),NH.forceCopyWithSyntaxHighlighting=!1)}}function Jbe(i,e){i&&(i.addImplementation(1e4,"code-editor",(t,n)=>{const r=t.get(Un).getFocusedCodeEditor();if(r&&r.hasTextFocus()){const o=r.getOption(37),s=r.getSelection();return s&&s.isEmpty()&&!o||r.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),i.addImplementation(0,"generic-dom",(t,n)=>(xS().execCommand(e),!0)))}Jbe(Vtt,"cut");Jbe(ztt,"copy");S9&&(S9.addImplementation(1e4,"code-editor",(i,e)=>{var t,n;const r=i.get(Un),o=i.get(Kp),s=r.getFocusedCodeEditor();return s&&s.hasTextFocus()?s.getContainerDomNode().ownerDocument.execCommand("paste")?(n=(t=Rp.get(s))===null||t===void 0?void 0:t.finishedPaste())!==null&&n!==void 0?n:Promise.resolve():S_?(async()=>{const l=await o.readText();if(l!==""){const c=jD.INSTANCE.get(l);let u=!1,d=null,h=null;c&&(u=s.getOption(37)&&!!c.isFromEmptySelection,d=typeof c.multicursorText<"u"?c.multicursorText:null,h=c.mode),s.trigger("keyboard","paste",{text:l,pasteOnNewLine:u,multicursorText:d,mode:h})}})():!0:!1}),S9.addImplementation(0,"generic-dom",(i,e)=>(xS().execCommand("paste"),!0)));Qbe&&Be(Utt);class Ut{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+Ut.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new Ut(this.value+Ut.sep+e)}}Ut.sep=".";Ut.None=new Ut("@@none@@");Ut.Empty=new Ut("");Ut.QuickFix=new Ut("quickfix");Ut.Refactor=new Ut("refactor");Ut.RefactorExtract=Ut.Refactor.append("extract");Ut.RefactorInline=Ut.Refactor.append("inline");Ut.RefactorMove=Ut.Refactor.append("move");Ut.RefactorRewrite=Ut.Refactor.append("rewrite");Ut.Notebook=new Ut("notebook");Ut.Source=new Ut("source");Ut.SourceOrganizeImports=Ut.Source.append("organizeImports");Ut.SourceFixAll=Ut.Source.append("fixAll");Ut.SurroundWith=Ut.Refactor.append("surround");var Tl;(function(i){i.Refactor="refactor",i.RefactorPreview="refactor preview",i.Lightbulb="lightbulb",i.Default="other (default)",i.SourceAction="source action",i.QuickFix="quick fix action",i.FixAll="fix all",i.OrganizeImports="organize imports",i.AutoFix="auto fix",i.QuickFixHover="quick fix hover window",i.OnSave="save participants",i.ProblemsView="problems view"})(Tl||(Tl={}));function jtt(i,e){return!(i.include&&!i.include.intersects(e)||i.excludes&&i.excludes.some(t=>eCe(e,t,i.include))||!i.includeSourceActions&&Ut.Source.contains(e))}function Ktt(i,e){const t=e.kind?new Ut(e.kind):void 0;return!(i.include&&(!t||!i.include.contains(t))||i.excludes&&t&&i.excludes.some(n=>eCe(t,n,i.include))||!i.includeSourceActions&&t&&Ut.Source.contains(t)||i.onlyIncludePreferredActions&&!e.isPreferred)}function eCe(i,e,t){return!(!e.contains(i)||t&&e.contains(t))}class _f{static fromUser(e,t){return!e||typeof e!="object"?new _f(t.kind,t.apply,!1):new _f(_f.getKindFromUser(e,t.kind),_f.getApplyFromUser(e,t.apply),_f.getPreferredUser(e))}static getApplyFromUser(e,t){switch(typeof e.apply=="string"?e.apply.toLowerCase():""){case"first":return"first";case"never":return"never";case"ifsingle":return"ifSingle";default:return t}}static getKindFromUser(e,t){return typeof e.kind=="string"?new Ut(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,n){this.kind=e,this.apply=t,this.preferred=n}}class Gtt{constructor(e,t,n){this.action=e,this.provider=t,this.highlightRange=n}async resolve(e){var t;if(!((t=this.provider)===null||t===void 0)&&t.resolveCodeAction&&!this.action.edit){let n;try{n=await this.provider.resolveCodeAction(this.action,e)}catch(r){Zr(r)}n&&(this.action.edit=n.edit)}return this}}const tCe="editor.action.codeAction",PY="editor.action.quickFix",nCe="editor.action.autoFix",iCe="editor.action.refactor",rCe="editor.action.sourceAction",OY="editor.action.organizeImports",FY="editor.action.fixAll";class RE extends fe{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return e.isAI&&!t.isAI?1:!e.isAI&&t.isAI?-1:Ts(e.diagnostics)?Ts(t.diagnostics)?RE.codeActionsPreferredComparator(e,t):-1:Ts(t.diagnostics)?1:RE.codeActionsPreferredComparator(e,t)}constructor(e,t,n){super(),this.documentation=t,this._register(n),this.allActions=[...e].sort(RE.codeActionsComparator),this.validActions=this.allActions.filter(({action:r})=>!r.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&Ut.QuickFix.contains(new Ut(e.kind))&&!!e.isPreferred)}get hasAIFix(){return this.validActions.some(({action:e})=>!!e.isAI)}get allAIFixes(){return this.validActions.every(({action:e})=>!!e.isAI)}}const _ae={actions:[],documentation:void 0};async function ME(i,e,t,n,r,o){var s;const a=n.filter||{},l={...a,excludes:[...a.excludes||[],Ut.Notebook]},c={only:(s=a.include)===null||s===void 0?void 0:s.value,trigger:n.type},u=new LY(e,o),d=n.type===2,h=qtt(i,e,d?l:a),f=new Te,g=h.map(async v=>{try{r.report(v);const m=await v.provideCodeActions(e,t,c,u.token);if(m&&f.add(m),u.token.isCancellationRequested)return _ae;const _=((m==null?void 0:m.actions)||[]).filter(S=>S&&Ktt(a,S)),y=Ytt(v,_,a.include);return{actions:_.map(S=>new Gtt(S,v)),documentation:y}}catch(m){if(wh(m))throw m;return Zr(m),_ae}}),p=i.onDidChange(()=>{const v=i.all(e);or(v,h)||u.cancel()});try{const v=await Promise.all(g),m=v.map(y=>y.actions).flat(),_=[...lh(v.map(y=>y.documentation)),...Xtt(i,e,n,m)];return new RE(m,_,f)}finally{p.dispose(),u.dispose()}}function qtt(i,e,t){return i.all(e).filter(n=>n.providedCodeActionKinds?n.providedCodeActionKinds.some(r=>jtt(t,new Ut(r))):!0)}function*Xtt(i,e,t,n){var r,o,s;if(e&&n.length)for(const a of i.all(e))a._getAdditionalMenuItems&&(yield*(r=a._getAdditionalMenuItems)===null||r===void 0?void 0:r.call(a,{trigger:t.type,only:(s=(o=t.filter)===null||o===void 0?void 0:o.include)===null||s===void 0?void 0:s.value},n.map(l=>l.action)))}function Ytt(i,e,t){if(!i.documentation)return;const n=i.documentation.map(r=>({kind:new Ut(r.kind),command:r.command}));if(t){let r;for(const o of n)o.kind.contains(t)&&(r?r.kind.contains(o.kind)&&(r=o):r=o);if(r)return r==null?void 0:r.command}for(const r of e)if(r.kind){for(const o of n)if(o.kind.contains(new Ut(r.kind)))return o.command}}var Jy;(function(i){i.OnSave="onSave",i.FromProblemsView="fromProblemsView",i.FromCodeActions="fromCodeActions",i.FromAILightbulb="fromAILightbulb"})(Jy||(Jy={}));async function Ztt(i,e,t,n,r=Cn.None){var o;const s=i.get(Xk),a=i.get(sr),l=i.get(ea),c=i.get($r);if(l.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),await e.resolve(r),!r.isCancellationRequested&&!(!((o=e.action.edit)===null||o===void 0)&&o.edits.length&&!(await s.apply(e.action.edit,{editor:n==null?void 0:n.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==Jy.OnSave,showPreview:n==null?void 0:n.preview})).isApplied)&&e.action.command)try{await a.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(u){const d=Qtt(u);c.error(typeof d=="string"?d:w("applyCodeActionFailed","An unknown error occurred while applying the code action"))}}function Qtt(i){return typeof i=="string"?i:i instanceof Error&&typeof i.message=="string"?i.message:void 0}Dn.registerCommand("_executeCodeActionProvider",async function(i,e,t,n,r){if(!(e instanceof At))throw eu();const{codeActionProvider:o}=i.get(_t),s=i.get(tr).getModel(e);if(!s)throw eu();const a=yt.isISelection(t)?yt.liftSelection(t):B.isIRange(t)?s.validateRange(t):void 0;if(!a)throw eu();const l=typeof n=="string"?new Ut(n):void 0,c=await ME(o,s,a,{type:1,triggerAction:Tl.Default,filter:{includeSourceActions:!0,include:l}},mp.None,Cn.None),u=[],d=Math.min(c.validActions.length,typeof r=="number"?r:0);for(let h=0;hh.action)}finally{setTimeout(()=>c.dispose(),100)}});var Jtt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ent=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Pz;let fO=Pz=class{constructor(e){this.keybindingService=e}getResolver(){const e=new Qf(()=>this.keybindingService.getKeybindings().filter(t=>Pz.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let n=t.commandArgs;return t.command===OY?n={kind:Ut.SourceOrganizeImports.value}:t.command===FY&&(n={kind:Ut.SourceFixAll.value}),{resolvedKeybinding:t.resolvedKeybinding,..._f.fromUser(n,{kind:Ut.None,apply:"never"})}}));return t=>{if(t.kind){const n=this.bestKeybindingForCodeAction(t,e.value);return n==null?void 0:n.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const n=new Ut(e.kind);return t.filter(r=>r.kind.contains(n)).filter(r=>r.preferred?e.isPreferred:!0).reduceRight((r,o)=>r?r.kind.contains(o.kind)?o:r:o,void 0)}};fO.codeActionCommands=[iCe,tCe,rCe,OY,FY];fO=Pz=Jtt([ent(0,ci)],fO);X("symbolIcon.arrayForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.booleanForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},w("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.colorForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.constantForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},w("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},w("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},w("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.fileForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.folderForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},w("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.keyForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.keywordForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},w("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.moduleForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.namespaceForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.nullForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.numberForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.objectForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.operatorForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.packageForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.propertyForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.referenceForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.snippetForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.stringForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.structForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.textForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.typeParameterForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.unitForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const oCe=Object.freeze({kind:Ut.Empty,title:w("codeAction.widget.id.more","More Actions...")}),tnt=Object.freeze([{kind:Ut.QuickFix,title:w("codeAction.widget.id.quickfix","Quick Fix")},{kind:Ut.RefactorExtract,title:w("codeAction.widget.id.extract","Extract"),icon:Xe.wrench},{kind:Ut.RefactorInline,title:w("codeAction.widget.id.inline","Inline"),icon:Xe.wrench},{kind:Ut.RefactorRewrite,title:w("codeAction.widget.id.convert","Rewrite"),icon:Xe.wrench},{kind:Ut.RefactorMove,title:w("codeAction.widget.id.move","Move"),icon:Xe.wrench},{kind:Ut.SurroundWith,title:w("codeAction.widget.id.surround","Surround With"),icon:Xe.surroundWith},{kind:Ut.Source,title:w("codeAction.widget.id.source","Source Action"),icon:Xe.symbolFile},oCe]);function nnt(i,e,t){if(!e)return i.map(o=>{var s;return{kind:"action",item:o,group:oCe,disabled:!!o.action.disabled,label:o.action.disabled||o.action.title,canPreview:!!(!((s=o.action.edit)===null||s===void 0)&&s.edits.length)}});const n=tnt.map(o=>({group:o,actions:[]}));for(const o of i){const s=o.action.kind?new Ut(o.action.kind):Ut.None;for(const a of n)if(a.group.kind.contains(s)){a.actions.push(o);break}}const r=[];for(const o of n)if(o.actions.length){r.push({kind:"header",group:o.group});for(const s of o.actions){const a=o.group;r.push({kind:"action",item:s,group:s.action.isAI?{title:a.title,kind:a.kind,icon:Xe.sparkle}:a,label:s.action.title,disabled:!!s.action.disabled,keybinding:t(s.action)})}}return r}var int=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},bae=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Oz,_y;(function(i){i.Hidden={type:0};class e{constructor(n,r,o,s){this.actions=n,this.trigger=r,this.editorPosition=o,this.widgetPosition=s,this.type=1}}i.Showing=e})(_y||(_y={}));let zb=Oz=class extends fe{constructor(e,t,n){super(),this._editor=e,this._keybindingService=t,this._onClick=this._register(new se),this.onClick=this._onClick.event,this._state=_y.Hidden,this._iconClasses=[],this._domNode=He("div.lightBulbWidget"),this._register(wi.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(r=>{const o=this._editor.getModel();(this.state.type!==1||!o||this.state.editorPosition.lineNumber>=o.getLineCount())&&this.hide()})),this._register(GBe(this._domNode,r=>{if(this.state.type!==1)return;this._editor.focus(),r.preventDefault();const{top:o,height:s}=Br(this._domNode),a=this._editor.getOption(67);let l=Math.floor(a/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber{(r.buttons&1)===1&&this.hide()})),this._register(Je.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{var r,o,s,a;this._preferredKbLabel=(o=(r=this._keybindingService.lookupKeybinding(nCe))===null||r===void 0?void 0:r.getLabel())!==null&&o!==void 0?o:void 0,this._quickFixKbLabel=(a=(s=this._keybindingService.lookupKeybinding(PY))===null||s===void 0?void 0:s.getLabel())!==null&&a!==void 0?a:void 0,this._updateLightBulbTitleAndIcon()}))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return this._state.type===1?this._state.widgetPosition:null}update(e,t,n){if(e.validActions.length<=0)return this.hide();if(!this._editor.getOptions().get(65).enabled)return this.hide();const o=this._editor.getModel();if(!o)return this.hide();const{lineNumber:s,column:a}=o.validatePosition(n),l=o.getOptions().tabSize,c=this._editor.getOptions().get(50),u=o.getLineContent(s),d=H4(u,l),h=c.spaceWidth*d>22,f=v=>v>2&&this._editor.getTopForLineNumber(v)===this._editor.getTopForLineNumber(v-1);let g=s,p=1;if(!h){if(s>1&&!f(s-1))g-=1;else if(s=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Fz=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const aCe="acceptSelectedCodeAction",lCe="previewSelectedCodeAction";class rnt{get templateId(){return"header"}renderTemplate(e){e.classList.add("group-header");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,n){var r,o;n.text.textContent=(o=(r=e.group)===null||r===void 0?void 0:r.title)!==null&&o!==void 0?o:""}disposeTemplate(e){}}let Bz=class{get templateId(){return"action"}constructor(e,t){this._supportsPreview=e,this._keybindingService=t}renderTemplate(e){e.classList.add(this.templateId);const t=document.createElement("div");t.className="icon",e.append(t);const n=document.createElement("span");n.className="title",e.append(n);const r=new PS(e,yl);return{container:e,icon:t,text:n,keybinding:r}}renderElement(e,t,n){var r,o,s;if(!((r=e.group)===null||r===void 0)&&r.icon?(n.icon.className=Wt.asClassName(e.group.icon),e.group.icon.color&&(n.icon.style.color=ht(e.group.icon.color.id))):(n.icon.className=Wt.asClassName(Xe.lightBulb),n.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;n.text.textContent=cCe(e.label),n.keybinding.set(e.keybinding),l8e(!!e.keybinding,n.keybinding.element);const a=(o=this._keybindingService.lookupKeybinding(aCe))===null||o===void 0?void 0:o.getLabel(),l=(s=this._keybindingService.lookupKeybinding(lCe))===null||s===void 0?void 0:s.getLabel();n.container.classList.toggle("option-disabled",e.disabled),e.disabled?n.container.title=e.label:a&&l?this._supportsPreview&&e.canPreview?n.container.title=w({key:"label-preview",comment:['placeholders are keybindings, e.g "F2 to apply, Shift+F2 to preview"']},"{0} to apply, {1} to preview",a,l):n.container.title=w({key:"label",comment:['placeholder is a keybinding, e.g "F2 to apply"']},"{0} to apply",a):n.container.title=""}disposeTemplate(e){}};Bz=sCe([Fz(1,ci)],Bz);class ont extends UIEvent{constructor(){super("acceptSelectedAction")}}class Cae extends UIEvent{constructor(){super("previewSelectedAction")}}function snt(i){if(i.kind==="action")return i.label}let Wz=class extends fe{constructor(e,t,n,r,o,s){super(),this._delegate=r,this._contextViewService=o,this._keybindingService=s,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new wr),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const a={getHeight:l=>l.kind==="header"?this._headerLineHeight:this._actionLineHeight,getTemplateId:l=>l.kind};this._list=this._register(new wc(e,this.domNode,a,[new Bz(t,this._keybindingService),new rnt],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:snt},accessibilityProvider:{getAriaLabel:l=>{if(l.kind==="action"){let c=l.label?cCe(l==null?void 0:l.label):"";return l.disabled&&(c=w({key:"customQuickFixWidget.labels",comment:["Action widget labels for accessibility."]},"{0}, Disabled Reason: {1}",c,l.disabled)),c}return null},getWidgetAriaLabel:()=>w({key:"customQuickFixWidget",comment:["An action widget option"]},"Action Widget"),getRole:l=>l.kind==="action"?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(N_),this._register(this._list.onMouseClick(l=>this.onListClick(l))),this._register(this._list.onMouseOver(l=>this.onListHover(l))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(l=>this.onListSelection(l))),this._allMenuItems=n,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(e){return!e.disabled&&e.kind==="action"}hide(e){this._delegate.onHide(e),this.cts.cancel(),this._contextViewService.hideContextView()}layout(e){const t=this._allMenuItems.filter(l=>l.kind==="header").length,r=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(r);let o=e;if(this._allMenuItems.length>=50)o=380;else{const l=this._allMenuItems.map((c,u)=>{const d=this.domNode.ownerDocument.getElementById(this._list.getElementID(u));if(d){d.style.width="auto";const h=d.getBoundingClientRect().width;return d.style.width="",h}return 0});o=Math.max(...l,e)}const s=.7,a=Math.min(r,this.domNode.ownerDocument.body.clientHeight*s);return this._list.layout(a,o),this.domNode.style.height=`${a}px`,this._list.domFocus(),o}focusPrevious(){this._list.focusPrevious(1,!0,void 0,this.focusCondition)}focusNext(){this._list.focusNext(1,!0,void 0,this.focusCondition)}acceptSelected(e){const t=this._list.getFocus();if(t.length===0)return;const n=t[0],r=this._list.element(n);if(!this.focusCondition(r))return;const o=e?new Cae:new ont;this._list.setSelection([n],o)}onListSelection(e){if(!e.elements.length)return;const t=e.elements[0];t.item&&this.focusCondition(t)?this._delegate.onSelect(t.item,e.browserEvent instanceof Cae):this._list.setSelection([])}onFocus(){var e,t;const n=this._list.getFocus();if(n.length===0)return;const r=n[0],o=this._list.element(r);(t=(e=this._delegate).onFocus)===null||t===void 0||t.call(e,o.item)}async onListHover(e){const t=e.element;if(t&&t.item&&this.focusCondition(t)){if(this._delegate.onHover&&!t.disabled&&t.kind==="action"){const n=await this._delegate.onHover(t.item,this.cts.token);t.canPreview=n?n.canPreview:void 0}e.index&&this._list.splice(e.index,1,[t])}this._list.setFocus(typeof e.index=="number"?[e.index]:[])}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};Wz=sCe([Fz(4,ng),Fz(5,ci)],Wz);function cCe(i){return i.replace(/\r\n|\r|\n/g," ")}var ant=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},x9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};X("actionBar.toggledBackground",{dark:B0,light:B0,hcDark:B0,hcLight:B0},w("actionBar.toggledBackground","Background color for toggled action items in action bar."));const Ub={Visible:new st("codeActionMenuVisible",!1,w("codeActionMenuVisible","Whether the action widget list is visible"))},CC=yn("actionWidgetService");let jb=class extends fe{get isVisible(){return Ub.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,n){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=n,this._list=this._register(new Ho)}show(e,t,n,r,o,s,a){const l=Ub.Visible.bindTo(this._contextKeyService),c=this._instantiationService.createInstance(Wz,e,t,n,r);this._contextViewService.showContextView({getAnchor:()=>o,render:u=>(l.set(!0),this._renderWidget(u,c,a??[])),onHide:u=>{l.reset(),this._onWidgetClosed(u)}},s,!1)}acceptSelected(e){var t;(t=this._list.value)===null||t===void 0||t.acceptSelected(e)}focusPrevious(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusPrevious()}focusNext(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusNext()}hide(){var e;(e=this._list.value)===null||e===void 0||e.hide(),this._list.clear()}_renderWidget(e,t,n){var r;const o=document.createElement("div");if(o.classList.add("action-widget"),e.appendChild(o),this._list.value=t,this._list.value)o.appendChild(this._list.value.domNode);else throw new Error("List has no value");const s=new Te,a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-block"),s.add(ye(l,Ge.MOUSE_DOWN,g=>g.stopPropagation()));const c=document.createElement("div"),u=e.appendChild(c);u.classList.add("context-view-pointerBlock"),s.add(ye(u,Ge.POINTER_MOVE,()=>u.remove())),s.add(ye(u,Ge.MOUSE_DOWN,()=>u.remove()));let d=0;if(n.length){const g=this._createActionBar(".action-widget-action-bar",n);g&&(o.appendChild(g.getContainer().parentElement),s.add(g),d=g.getContainer().offsetWidth)}const h=(r=this._list.value)===null||r===void 0?void 0:r.layout(d);o.style.width=`${h}px`;const f=s.add(dh(e));return s.add(f.onDidBlur(()=>this.hide())),s}_createActionBar(e,t){if(!t.length)return;const n=He(e),r=new au(n);return r.push(t,{icon:!1,label:!0}),r}_onWidgetClosed(e){var t;(t=this._list.value)===null||t===void 0||t.hide(e)}};jb=ant([x9(0,ng),x9(1,Vt),x9(2,Ot)],jb);In(CC,jb,1);const cT=100+1e3;Ei(class extends sl{constructor(){super({id:"hideCodeActionWidget",title:$n("hideCodeActionWidget.title","Hide action widget"),precondition:Ub.Visible,keybinding:{weight:cT,primary:9,secondary:[1033]}})}run(i){i.get(CC).hide()}});Ei(class extends sl{constructor(){super({id:"selectPrevCodeAction",title:$n("selectPrevCodeAction.title","Select previous action"),precondition:Ub.Visible,keybinding:{weight:cT,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(i){const e=i.get(CC);e instanceof jb&&e.focusPrevious()}});Ei(class extends sl{constructor(){super({id:"selectNextCodeAction",title:$n("selectNextCodeAction.title","Select next action"),precondition:Ub.Visible,keybinding:{weight:cT,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(i){const e=i.get(CC);e instanceof jb&&e.focusNext()}});Ei(class extends sl{constructor(){super({id:aCe,title:$n("acceptSelected.title","Accept selected action"),precondition:Ub.Visible,keybinding:{weight:cT,primary:3,secondary:[2137]}})}run(i){const e=i.get(CC);e instanceof jb&&e.acceptSelected()}});Ei(class extends sl{constructor(){super({id:lCe,title:$n("previewSelected.title","Preview selected action"),precondition:Ub.Visible,keybinding:{weight:cT,primary:2051}})}run(i){const e=i.get(CC);e instanceof jb&&e.acceptSelected(!0)}});const uCe=new st("supportedCodeAction",""),yae="_typescript.applyFixAllCodeAction";class lnt extends fe{constructor(e,t,n,r=250){super(),this._editor=e,this._markerService=t,this._signalChange=n,this._delay=r,this._autoTriggerTimer=this._register(new cd),this._register(this._markerService.onMarkerChanged(o=>this._onMarkerChanges(o))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some(n=>hX(n,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:Tl.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getSelection();if(e.type===1)return t;const n=this._editor.getOption(65).enabled;if(n!==Fu.Off){{if(n===Fu.On)return t;if(n===Fu.OnCode){if(!t.isEmpty())return t;const o=this._editor.getModel(),{lineNumber:s,column:a}=t.getPosition(),l=o.getLineContent(s);if(l.length===0)return;if(a===1){if(/\s/.test(l[0]))return}else if(a===o.getLineMaxColumn(s)){if(/\s/.test(l[l.length-1]))return}else if(/\s/.test(l[a-2])&&/\s/.test(l[a-1]))return}}return t}}}var T0;(function(i){i.Empty={type:0};class e{constructor(n,r,o){this.trigger=n,this.position=r,this._cancellablePromise=o,this.type=1,this.actions=o.catch(s=>{if(wh(s))return dCe;throw s})}cancel(){this._cancellablePromise.cancel()}}i.Triggered=e})(T0||(T0={}));const dCe=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1});class cnt extends fe{constructor(e,t,n,r,o,s){super(),this._editor=e,this._registry=t,this._markerService=n,this._progressService=o,this._configurationService=s,this._codeActionOracle=this._register(new Ho),this._state=T0.Empty,this._onDidChangeState=this._register(new se),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=uCe.bindTo(r),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._register(this._editor.onDidChangeConfiguration(a=>{a.hasChanged(65)&&this._update()})),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(T0.Empty,!0))}_settingEnabledNearbyQuickfixes(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes",{resource:t==null?void 0:t.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(T0.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(91)){const t=this._registry.all(e).flatMap(n=>{var r;return(r=n.providedCodeActionKinds)!==null&&r!==void 0?r:[]});this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new lnt(this._editor,this._markerService,n=>{var r;if(!n){this.setState(T0.Empty);return}const o=n.selection.getStartPosition(),s=Io(async a=>{var l,c,u,d,h,f,g,p,v,m;if(this._settingEnabledNearbyQuickfixes()&&n.trigger.type===1&&(n.trigger.triggerAction===Tl.QuickFix||!((c=(l=n.trigger.filter)===null||l===void 0?void 0:l.include)===null||c===void 0)&&c.contains(Ut.QuickFix))){const _=await ME(this._registry,e,n.selection,n.trigger,mp.None,a),y=[..._.allActions];if(a.isCancellationRequested)return dCe;const S=(u=_.validActions)===null||u===void 0?void 0:u.some(E=>E.action.kind?Ut.QuickFix.contains(new Ut(E.action.kind)):!1),L=this._markerService.read({resource:e.uri});if(S){for(const E of _.validActions)!((h=(d=E.action.command)===null||d===void 0?void 0:d.arguments)===null||h===void 0)&&h.some(D=>typeof D=="string"&&D.includes(yae))&&(E.action.diagnostics=[...L.filter(D=>D.relatedInformation)]);return{validActions:_.validActions,allActions:y,documentation:_.documentation,hasAutoFix:_.hasAutoFix,hasAIFix:_.hasAIFix,allAIFixes:_.allAIFixes,dispose:()=>{_.dispose()}}}else if(!S&&L.length>0){const E=n.selection.getPosition();let D=E,k=Number.MAX_VALUE;const T=[..._.validActions];for(const A of L){const N=A.endColumn,R=A.endLineNumber,F=A.startLineNumber;if(R===E.lineNumber||F===E.lineNumber){D=new ae(R,N);const W={type:n.trigger.type,triggerAction:n.trigger.triggerAction,filter:{include:!((f=n.trigger.filter)===null||f===void 0)&&f.include?(g=n.trigger.filter)===null||g===void 0?void 0:g.include:Ut.QuickFix},autoApply:n.trigger.autoApply,context:{notAvailableMessage:((p=n.trigger.context)===null||p===void 0?void 0:p.notAvailableMessage)||"",position:D}},H=new yt(D.lineNumber,D.column,D.lineNumber,D.column),G=await ME(this._registry,e,H,W,mp.None,a);if(G.validActions.length!==0){for(const U of G.validActions)!((m=(v=U.action.command)===null||v===void 0?void 0:v.arguments)===null||m===void 0)&&m.some(K=>typeof K=="string"&&K.includes(yae))&&(U.action.diagnostics=[...L.filter(K=>K.relatedInformation)]);_.allActions.length===0&&y.push(...G.allActions),Math.abs(E.column-N)R.findIndex(F=>F.action.title===A.action.title)===N);return M.sort((A,N)=>A.action.isPreferred&&!N.action.isPreferred?-1:!A.action.isPreferred&&N.action.isPreferred||A.action.isAI&&!N.action.isAI?1:!A.action.isAI&&N.action.isAI?-1:0),{validActions:M,allActions:y,documentation:_.documentation,hasAutoFix:_.hasAutoFix,hasAIFix:_.hasAIFix,allAIFixes:_.allAIFixes,dispose:()=>{_.dispose()}}}}return ME(this._registry,e,n.selection,n.trigger,mp.None,a)});n.trigger.type===1&&((r=this._progressService)===null||r===void 0||r.showWhile(s,250)),this.setState(new T0.Triggered(n.trigger,o,s))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:Tl.Default})}else this._supportedCodeActions.reset()}trigger(e){var t;(t=this._codeActionOracle.value)===null||t===void 0||t.trigger(e)}setState(e,t){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}}var unt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},_g=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},T1;const dnt="quickfix-edit-highlight";let i_=T1=class extends fe{static get(e){return e.getContribution(T1.ID)}constructor(e,t,n,r,o,s,a,l,c,u){super(),this._commandService=a,this._configurationService=l,this._actionWidgetService=c,this._instantiationService=u,this._activeCodeActions=this._register(new Ho),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new cnt(this._editor,o.codeActionProvider,t,n,s,l)),this._register(this._model.onDidChangeState(d=>this.update(d))),this._lightBulbWidget=new Qf(()=>{const d=this._editor.getContribution(zb.ID);return d&&this._register(d.onClick(h=>this.showCodeActionsFromLightbulb(h.actions,h))),d}),this._resolver=r.createInstance(fO),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}async showCodeActionsFromLightbulb(e,t){if(e.allAIFixes&&e.validActions.length===1){const n=e.validActions[0],r=n.action.command;r&&r.id==="inlineChat.start"&&r.arguments&&r.arguments.length>=1&&(r.arguments[0]={...r.arguments[0],autoSend:!1}),await this._applyCodeAction(n,!1,!1,Jy.FromAILightbulb);return}await this.showCodeActionList(e,t,{includeDisabledActions:!1,fromLightbulb:!0})}showCodeActions(e,t,n){return this.showCodeActionList(t,n,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,n,r){var o;if(!this._editor.hasModel())return;(o=xa.get(this._editor))===null||o===void 0||o.closeMessage();const s=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:n,autoApply:r,context:{notAvailableMessage:e,position:s}})}_trigger(e){return this._model.trigger(e)}async _applyCodeAction(e,t,n,r){try{await this._instantiationService.invokeFunction(Ztt,e,r,{preview:n,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:Tl.QuickFix,filter:{}})}}async update(e){var t,n,r,o,s,a,l;if(e.type!==1){(t=this._lightBulbWidget.rawValue)===null||t===void 0||t.hide();return}let c;try{c=await e.actions}catch(u){en(u);return}if(!this._disposed)if((n=this._lightBulbWidget.value)===null||n===void 0||n.update(c,e.trigger,e.position),e.trigger.type===1){if(!((r=e.trigger.filter)===null||r===void 0)&&r.include){const d=this.tryGetValidActionToApply(e.trigger,c);if(d){try{(o=this._lightBulbWidget.value)===null||o===void 0||o.hide(),await this._applyCodeAction(d,!1,!1,Jy.FromCodeActions)}finally{c.dispose()}return}if(e.trigger.context){const h=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,c);if(h&&h.action.disabled){(s=xa.get(this._editor))===null||s===void 0||s.showMessage(h.action.disabled,e.trigger.context.position),c.dispose();return}}}const u=!!(!((a=e.trigger.filter)===null||a===void 0)&&a.include);if(e.trigger.context&&(!c.allActions.length||!u&&!c.validActions.length)){(l=xa.get(this._editor))===null||l===void 0||l.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=c,c.dispose();return}this._activeCodeActions.value=c,this.showCodeActionList(c,this.toCoords(e.position),{includeDisabledActions:u,fromLightbulb:!1})}else this._actionWidgetService.isVisible?c.dispose():this._activeCodeActions.value=c}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length&&(e.autoApply==="first"&&t.validActions.length===0||e.autoApply==="ifSingle"&&t.allActions.length===1))return t.allActions.find(({action:n})=>n.disabled)}tryGetValidActionToApply(e,t){if(t.validActions.length&&(e.autoApply==="first"&&t.validActions.length>0||e.autoApply==="ifSingle"&&t.validActions.length===1))return t.validActions[0]}async showCodeActionList(e,t,n){const r=this._editor.createDecorationsCollection(),o=this._editor.getDomNode();if(!o)return;const s=n.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!s.length)return;const a=ae.isIPosition(t)?this.toCoords(t):t,l={onSelect:async(c,u)=>{this._applyCodeAction(c,!0,!!u,Jy.FromCodeActions),this._actionWidgetService.hide(),r.clear()},onHide:()=>{var c;(c=this._editor)===null||c===void 0||c.focus(),r.clear()},onHover:async(c,u)=>{var d;if(!u.isCancellationRequested)return{canPreview:!!(!((d=c.action.edit)===null||d===void 0)&&d.edits.length)}},onFocus:c=>{var u,d;if(c&&c.action){const h=c.action.ranges,f=c.action.diagnostics;if(r.clear(),h&&h.length>0){const g=f&&(f==null?void 0:f.length)>1?f.map(p=>({range:p,options:T1.DECORATION})):h.map(p=>({range:p,options:T1.DECORATION}));r.set(g)}else if(f&&f.length>0){const g=f.map(v=>({range:v,options:T1.DECORATION}));r.set(g);const p=f[0];if(p.startLineNumber&&p.startColumn){const v=(d=(u=this._editor.getModel())===null||u===void 0?void 0:u.getWordAtPosition({lineNumber:p.startLineNumber,column:p.startColumn}))===null||d===void 0?void 0:d.word;Hf(w("editingNewSelection","Context: {0} at line {1} and column {2}.",v,p.startLineNumber,p.startColumn))}}}else r.clear()}};this._actionWidgetService.show("codeActionWidget",!0,nnt(s,this._shouldShowHeaders(),this._resolver.getResolver()),l,a,o,this._getActionBarActions(e,t,n))}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),n=Br(this._editor.getDomNode()),r=n.left+t.left,o=n.top+t.top+t.height;return{x:r,y:o}}_shouldShowHeaders(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:t==null?void 0:t.uri})}_getActionBarActions(e,t,n){if(n.fromLightbulb)return[];const r=e.documentation.map(o=>{var s;return{id:o.id,label:o.title,tooltip:(s=o.tooltip)!==null&&s!==void 0?s:"",class:void 0,enabled:!0,run:()=>{var a;return this._commandService.executeCommand(o.id,...(a=o.arguments)!==null&&a!==void 0?a:[])}}});return n.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&r.push(this._showDisabled?{id:"hideMoreActions",label:w("hideMoreActions","Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,n))}:{id:"showMoreActions",label:w("showMoreActions","Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,n))}),r}};i_.ID="editor.contrib.codeActionController";i_.DECORATION=sn.register({description:"quickfix-highlight",className:dnt});i_=T1=unt([_g(1,ig),_g(2,Vt),_g(3,Ot),_g(4,_t),_g(5,k_),_g(6,sr),_g(7,gn),_g(8,CC),_g(9,Ot)],i_);fu((i,e)=>{((r,o)=>{o&&e.addRule(`.monaco-editor ${r} { background-color: ${o}; }`)})(".quickfix-edit-highlight",i.getColor(ep));const n=i.getColor(qm);n&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${ih(i.type)?"dotted":"solid"} ${n}; box-sizing: border-box; }`)});function uT(i){return De.regex(uCe.keys()[0],new RegExp("(\\s|^)"+fc(i.value)+"\\b"))}const BY={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:w("args.schema.kind","Kind of the code action to run.")},apply:{type:"string",description:w("args.schema.apply","Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[w("args.schema.apply.first","Always apply the first returned code action."),w("args.schema.apply.ifSingle","Apply the first returned code action if it is the only one."),w("args.schema.apply.never","Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:w("args.schema.preferred","Controls if only preferred code actions should be returned.")}}};function yC(i,e,t,n,r=Tl.Default){if(i.hasModel()){const o=i_.get(i);o==null||o.manualTriggerAtCurrentPosition(e,r,t,n)}}class hnt extends gt{constructor(){super({id:PY,label:w("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:De.and(j.writable,j.hasCodeActionsProvider),kbOpts:{kbExpr:j.textInputFocus,primary:2137,weight:100}})}run(e,t){return yC(t,w("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0,Tl.QuickFix)}}class fnt extends Vo{constructor(){super({id:tCe,precondition:De.and(j.writable,j.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:BY}]}})}runEditorCommand(e,t,n){const r=_f.fromUser(n,{kind:Ut.Empty,apply:"ifSingle"});return yC(t,typeof(n==null?void 0:n.kind)=="string"?r.preferred?w("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",n.kind):w("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",n.kind):r.preferred?w("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):w("editor.action.codeAction.noneMessage","No code actions available"),{include:r.kind,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply)}}class gnt extends gt{constructor(){super({id:iCe,label:w("refactor.label","Refactor..."),alias:"Refactor...",precondition:De.and(j.writable,j.hasCodeActionsProvider),kbOpts:{kbExpr:j.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:De.and(j.writable,uT(Ut.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:BY}]}})}run(e,t,n){const r=_f.fromUser(n,{kind:Ut.Refactor,apply:"never"});return yC(t,typeof(n==null?void 0:n.kind)=="string"?r.preferred?w("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",n.kind):w("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",n.kind):r.preferred?w("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):w("editor.action.refactor.noneMessage","No refactorings available"),{include:Ut.Refactor.contains(r.kind)?r.kind:Ut.None,onlyIncludePreferredActions:r.preferred},r.apply,Tl.Refactor)}}class pnt extends gt{constructor(){super({id:rCe,label:w("source.label","Source Action..."),alias:"Source Action...",precondition:De.and(j.writable,j.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:De.and(j.writable,uT(Ut.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:BY}]}})}run(e,t,n){const r=_f.fromUser(n,{kind:Ut.Source,apply:"never"});return yC(t,typeof(n==null?void 0:n.kind)=="string"?r.preferred?w("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",n.kind):w("editor.action.source.noneMessage.kind","No source actions for '{0}' available",n.kind):r.preferred?w("editor.action.source.noneMessage.preferred","No preferred source actions available"):w("editor.action.source.noneMessage","No source actions available"),{include:Ut.Source.contains(r.kind)?r.kind:Ut.None,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply,Tl.SourceAction)}}class mnt extends gt{constructor(){super({id:OY,label:w("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:De.and(j.writable,uT(Ut.SourceOrganizeImports)),kbOpts:{kbExpr:j.textInputFocus,primary:1581,weight:100}})}run(e,t){return yC(t,w("editor.action.organize.noneMessage","No organize imports action available"),{include:Ut.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",Tl.OrganizeImports)}}class vnt extends gt{constructor(){super({id:FY,label:w("fixAll.label","Fix All"),alias:"Fix All",precondition:De.and(j.writable,uT(Ut.SourceFixAll))})}run(e,t){return yC(t,w("fixAll.noneMessage","No fix all action available"),{include:Ut.SourceFixAll,includeSourceActions:!0},"ifSingle",Tl.FixAll)}}class _nt extends gt{constructor(){super({id:nCe,label:w("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:De.and(j.writable,uT(Ut.QuickFix)),kbOpts:{kbExpr:j.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return yC(t,w("editor.action.autoFix.noneMessage","No auto fixes available"),{include:Ut.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",Tl.AutoFix)}}jn(i_.ID,i_,3);jn(zb.ID,zb,4);Be(hnt);Be(gnt);Be(pnt);Be(mnt);Be(_nt);Be(vnt);et(new fnt);ar.as(xh.Configuration).registerConfiguration({...Z4,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:w("showCodeActionHeaders","Enable/disable showing group headers in the Code Action menu."),default:!0}}});ar.as(xh.Configuration).registerConfiguration({...Z4,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:"boolean",scope:5,description:w("includeNearbyQuickFixes","Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),default:!0}}});class $z{constructor(){this.lenses=[],this._disposables=new Te}dispose(){this._disposables.dispose()}get isDisposed(){return this._disposables.isDisposed}add(e,t){this._disposables.add(e);for(const n of e.lenses)this.lenses.push({symbol:n,provider:t})}}async function hCe(i,e,t){const n=i.ordered(e),r=new Map,o=new $z,s=n.map(async(a,l)=>{r.set(a,l);try{const c=await Promise.resolve(a.provideCodeLenses(e,t));c&&o.add(c,a)}catch(c){Zr(c)}});return await Promise.all(s),o.lenses=o.lenses.sort((a,l)=>a.symbol.range.startLineNumberl.symbol.range.startLineNumber?1:r.get(a.provider)r.get(l.provider)?1:a.symbol.range.startColumnl.symbol.range.startColumn?1:0),o}Dn.registerCommand("_executeCodeLensProvider",function(i,...e){let[t,n]=e;Xn(At.isUri(t)),Xn(typeof n=="number"||!n);const{codeLensProvider:r}=i.get(_t),o=i.get(tr).getModel(t);if(!o)throw eu();const s=[],a=new Te;return hCe(r,o,Cn.None).then(l=>{a.add(l);const c=[];for(const u of l.lenses)n==null||u.symbol.command?s.push(u.symbol):n-- >0&&u.provider.resolveCodeLens&&c.push(Promise.resolve(u.provider.resolveCodeLens(o,u.symbol,Cn.None)).then(d=>s.push(d||u.symbol)));return Promise.all(c)}).then(()=>s).finally(()=>{setTimeout(()=>a.dispose(),100)})});var bnt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Cnt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const fCe=yn("ICodeLensCache");class wae{constructor(e,t){this.lineCount=e,this.data=t}}let Hz=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new E_(20,.75);const t="codelens/cache";yL(hi,()=>e.remove(t,1));const n="codelens/cache2",r=e.get(n,1,"{}");this._deserialize(r),Je.once(e.onWillSaveState)(o=>{o.reason===cI.SHUTDOWN&&e.store(n,this._serialize(),1,1)})}put(e,t){const n=t.lenses.map(s=>{var a;return{range:s.symbol.range,command:s.symbol.command&&{id:"",title:(a=s.symbol.command)===null||a===void 0?void 0:a.title}}}),r=new $z;r.add({lenses:n,dispose:()=>{}},this._fakeProvider);const o=new wae(e.getLineCount(),r);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,n]of this._cache){const r=new Set;for(const o of n.data.lenses)r.add(o.symbol.range.startLineNumber);e[t]={lineCount:n.lineCount,lines:[...r.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const n in t){const r=t[n],o=[];for(const a of r.lines)o.push({range:new B(a,1,a,11)});const s=new $z;s.add({lenses:o,dispose(){}},this._fakeProvider),this._cache.set(n,new wae(r.lineCount,s))}}catch{}}};Hz=bnt([Cnt(0,dd)],Hz);In(fCe,Hz,1);class ynt{constructor(e,t,n){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=n,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}}class kI{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${kI._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const n=[];let r=!1;for(let o=0;o{c.symbol.command&&l.push(c.symbol),n.addDecoration({range:c.symbol.range,options:Sae},d=>this._decorationIds[u]=d),a?a=B.plusRange(a,c.symbol.range):a=B.lift(c.symbol.range)}),this._viewZone=new ynt(a.startLineNumber-1,o,s),this._viewZoneId=r.addZone(this._viewZone),l.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(l,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new kI(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t==null||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 n=this._editor.getModel().getDecorationRange(e),r=this._data[t].symbol;return!!(n&&B.isEmpty(r.range)===n.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((n,r)=>{t.addDecoration({range:n.symbol.range,options:Sae},o=>this._decorationIds[r]=o)})}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--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Xx=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Jw=class{constructor(e,t,n,r,o,s){this._editor=e,this._languageFeaturesService=t,this._commandService=r,this._notificationService=o,this._codeLensCache=s,this._disposables=new Te,this._localToDispose=new Te,this._lenses=[],this._oldCodeLensModels=new Te,this._provideCodeLensDebounce=n.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=n.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new pi(()=>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(a=>{(a.hasChanged(50)||a.hasChanged(19)||a.hasChanged(18))&&this._updateLensStyle(),a.hasChanged(17)&&this._onModelChange()})),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){var e;this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),(e=this._currentCodeLensModel)===null||e===void 0||e.dispose()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(67)/this._editor.getOption(52));let t=this._editor.getOption(19);return(!t||t<5)&&(t=this._editor.getOption(52)*.9|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),n=this._editor.getOption(18),r=this._editor.getOption(50),{style:o}=this._editor.getContainerDomNode();o.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),o.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),o.setProperty("--vscode-editorCodeLens-fontFeatureSettings",r.fontFeatureSettings),n&&(o.setProperty("--vscode-editorCodeLens-fontFamily",n),o.setProperty("--vscode-editorCodeLens-fontFamilyDefault",Qa.fontFamily)),this._editor.changeViewZones(s=>{for(const a of this._lenses)a.updateHeight(e,s)})}_localDispose(){var e,t,n;(e=this._getCodeLensModelPromise)===null||e===void 0||e.cancel(),this._getCodeLensModelPromise=void 0,(t=this._resolveCodeLensesPromise)===null||t===void 0||t.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),(n=this._currentCodeLensModel)===null||n===void 0||n.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e||!this._editor.getOption(17)||e.isTooLargeForTokenization())return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&jv(()=>{const r=this._codeLensCache.get(e);t===r&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3,this._localToDispose);return}for(const r of this._languageFeaturesService.codeLensProvider.all(e))if(typeof r.onDidChange=="function"){const o=r.onDidChange(()=>n.schedule());this._localToDispose.add(o)}const n=new pi(()=>{var r;const o=Date.now();(r=this._getCodeLensModelPromise)===null||r===void 0||r.cancel(),this._getCodeLensModelPromise=Io(s=>hCe(this._languageFeaturesService.codeLensProvider,e,s)),this._getCodeLensModelPromise.then(s=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=s,this._codeLensCache.put(e,s);const a=this._provideCodeLensDebounce.update(e,Date.now()-o);n.delay=a,this._renderCodeLensSymbols(s),this._resolveCodeLensesInViewportSoon()},en)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(n),this._localToDispose.add(Rt(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{var r;this._editor.changeDecorations(o=>{this._editor.changeViewZones(s=>{const a=[];let l=-1;this._lenses.forEach(u=>{!u.isValid()||l===u.getLineNumber()?a.push(u):(u.update(s),l=u.getLineNumber())});const c=new L9;a.forEach(u=>{u.dispose(c,s),this._lenses.splice(this._lenses.indexOf(u),1)}),c.commit(o)})}),n.schedule(),this._resolveCodeLensesScheduler.cancel(),(r=this._resolveCodeLensesPromise)===null||r===void 0||r.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorWidget(()=>{n.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{n.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(r=>{r.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(Rt(()=>{if(this._editor.getModel()){const r=_h.capture(this._editor);this._editor.changeDecorations(o=>{this._editor.changeViewZones(s=>{this._disposeAllLenses(o,s)})}),r.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(r=>{if(r.target.type!==9)return;let o=r.target.element;if((o==null?void 0:o.tagName)==="SPAN"&&(o=o.parentElement),(o==null?void 0:o.tagName)==="A")for(const s of this._lenses){const a=s.getCommand(o);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),n.schedule()}_disposeAllLenses(e,t){const n=new L9;for(const r of this._lenses)r.dispose(n,t);e&&n.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),n=[];let r;for(const a of e.lenses){const l=a.symbol.range.startLineNumber;l<1||l>t||(r&&r[r.length-1].symbol.range.startLineNumber===l?r.push(a):(r=[a],n.push(r)))}if(!n.length&&!this._lenses.length)return;const o=_h.capture(this._editor),s=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const c=new L9;let u=0,d=0;for(;dthis._resolveCodeLensesInViewportSoon())),u++,d++)}for(;uthis._resolveCodeLensesInViewportSoon())),d++;c.commit(a)})}),o.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var e;(e=this._resolveCodeLensesPromise)===null||e===void 0||e.cancel(),this._resolveCodeLensesPromise=void 0;const t=this._editor.getModel();if(!t)return;const n=[],r=[];if(this._lenses.forEach(a=>{const l=a.computeIfNecessary(t);l&&(n.push(l),r.push(a))}),n.length===0)return;const o=Date.now(),s=Io(a=>{const l=n.map((c,u)=>{const d=new Array(c.length),h=c.map((f,g)=>!f.symbol.command&&typeof f.provider.resolveCodeLens=="function"?Promise.resolve(f.provider.resolveCodeLens(t,f.symbol,a)).then(p=>{d[g]=p},Zr):(d[g]=f.symbol,Promise.resolve(void 0)));return Promise.all(h).then(()=>{!a.isCancellationRequested&&!r[u].isDisposed()&&r[u].updateCommands(d)})});return Promise.all(l)});this._resolveCodeLensesPromise=s,this._resolveCodeLensesPromise.then(()=>{const a=this._resolveCodeLensesDebounce.update(t,Date.now()-o);this._resolveCodeLensesScheduler.delay=a,this._currentCodeLensModel&&this._codeLensCache.put(t,this._currentCodeLensModel),this._oldCodeLensModels.clear(),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},a=>{en(a),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){var e;return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,!((e=this._currentCodeLensModel)===null||e===void 0)&&e.isDisposed?void 0:this._currentCodeLensModel}};Jw.ID="css.editor.codeLens";Jw=wnt([Xx(1,_t),Xx(2,gu),Xx(3,sr),Xx(4,$r),Xx(5,fCe)],Jw);jn(Jw.ID,Jw,1);Be(class extends gt{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:j.hasCodeLensProvider,label:w("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}async run(e,t){if(!t.hasModel())return;const n=e.get(Eh),r=e.get(sr),o=e.get($r),s=t.getSelection().positionLineNumber,a=t.getContribution(Jw.ID);if(!a)return;const l=await a.getModel();if(!l)return;const c=[];for(const h of l.lenses)h.symbol.command&&h.symbol.range.startLineNumber===s&&c.push({label:h.symbol.command.title,command:h.symbol.command});if(c.length===0)return;const u=await n.pick(c,{canPickMany:!1,placeHolder:w("placeHolder","Select a command")});if(!u)return;let d=u.command;if(l.isDisposed){const h=await a.getModel(),f=h==null?void 0:h.lenses.find(g=>{var p;return g.symbol.range.startLineNumber===s&&((p=g.symbol.command)===null||p===void 0?void 0:p.title)===d.title});if(!f||!f.symbol.command)return;d=f.symbol.command}try{await r.executeCommand(d.id,...d.arguments||[])}catch(h){o.error(h)}}});var Snt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},E9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class WY{constructor(e,t){this._editorWorkerClient=new Vq(e,!1,"editorWorkerService",t)}async provideDocumentColors(e,t){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,n){const r=t.range,o=t.color,s=o.alpha,a=new me(new Tn(Math.round(255*o.red),Math.round(255*o.green),Math.round(255*o.blue),s)),l=s?me.Format.CSS.formatRGB(a):me.Format.CSS.formatRGBA(a),c=s?me.Format.CSS.formatHSL(a):me.Format.CSS.formatHSLA(a),u=s?me.Format.CSS.formatHex(a):me.Format.CSS.formatHexA(a),d=[];return d.push({label:l,textEdit:{range:r,text:l}}),d.push({label:c,textEdit:{range:r,text:c}}),d.push({label:u,textEdit:{range:r,text:u}}),d}}let Vz=class extends fe{constructor(e,t,n){super(),this._register(n.colorProvider.register("*",new WY(e,t)))}};Vz=Snt([E9(0,tr),E9(1,Di),E9(2,_t)],Vz);nT(Vz);async function gCe(i,e,t,n=!0){return $Y(new xnt,i,e,t,n)}function pCe(i,e,t,n){return Promise.resolve(t.provideColorPresentations(i,e,n))}class xnt{constructor(){}async compute(e,t,n,r){const o=await e.provideDocumentColors(t,n);if(Array.isArray(o))for(const s of o)r.push({colorInfo:s,provider:e});return Array.isArray(o)}}class Lnt{constructor(){}async compute(e,t,n,r){const o=await e.provideDocumentColors(t,n);if(Array.isArray(o))for(const s of o)r.push({range:s.range,color:[s.color.red,s.color.green,s.color.blue,s.color.alpha]});return Array.isArray(o)}}class Ent{constructor(e){this.colorInfo=e}async compute(e,t,n,r){const o=await e.provideColorPresentations(t,this.colorInfo,Cn.None);return Array.isArray(o)&&r.push(...o),Array.isArray(o)}}async function $Y(i,e,t,n,r){let o=!1,s;const a=[],l=e.ordered(t);for(let c=l.length-1;c>=0;c--){const u=l[c];if(u instanceof WY)s=u;else try{await i.compute(u,t,n,a)&&(o=!0)}catch(d){Zr(d)}}return o?a:s&&r?(await i.compute(s,t,n,a),a):[]}function mCe(i,e){const{colorProvider:t}=i.get(_t),n=i.get(tr).getModel(e);if(!n)throw eu();const r=i.get(gn).getValue("editor.defaultColorDecorators",{resource:e});return{model:n,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:r}}Dn.registerCommand("_executeDocumentColorProvider",function(i,...e){const[t]=e;if(!(t instanceof At))throw eu();const{model:n,colorProviderRegistry:r,isDefaultColorDecoratorsEnabled:o}=mCe(i,t);return $Y(new Lnt,r,n,Cn.None,o)});Dn.registerCommand("_executeColorPresentationProvider",function(i,...e){const[t,n]=e,{uri:r,range:o}=n;if(!(r instanceof At)||!Array.isArray(t)||t.length!==4||!B.isIRange(o))throw eu();const{model:s,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=mCe(i,r),[c,u,d,h]=t;return $Y(new Ent({range:o,color:{red:c,green:u,blue:d,alpha:h}}),a,s,Cn.None,l)});var Dnt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},D9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},zz;const vCe=Object.create({});let r_=zz=class extends fe{constructor(e,t,n,r){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=n,this._localToDispose=this._register(new Te),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new Wk(this._editor),this._decoratorLimitReporter=new Int,this._colorDecorationClassRefs=this._register(new Te),this._debounceInformation=r.for(n.colorProvider,"Document Colors",{min:zz.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(n.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(o=>{const s=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(146);const a=s!==this._isColorDecoratorsEnabled||o.hasChanged(21),l=o.hasChanged(146);(a||l)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(146),this.updateColors()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),n=this._configurationService.getValue(t);if(n&&typeof n=="object"){const r=n.colorDecorators;if(r&&r.enable!==void 0&&!r.enable)return r.enable}return this._editor.getOption(20)}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}updateColors(){if(this.stop(),!this._isColorDecoratorsEnabled)return;const e=this._editor.getModel();!e||!this._languageFeaturesService.colorProvider.has(e)||(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new cd,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=Io(async e=>{const t=this._editor.getModel();if(!t)return[];const n=new Ms(!1),r=await gCe(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,n.elapsed()),r});try{const e=await this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){en(e)}}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(n=>({range:{startLineNumber:n.colorInfo.range.startLineNumber,startColumn:n.colorInfo.range.startColumn,endLineNumber:n.colorInfo.range.endLineNumber,endColumn:n.colorInfo.range.endColumn},options:sn.EMPTY}));this._editor.changeDecorations(n=>{this._decorationsIds=n.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((r,o)=>this._colorDatas.set(r,e[o]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],n=this._editor.getOption(21);for(let o=0;othis._colorDatas.has(r.id));return n.length===0?null:this._colorDatas.get(n[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};r_.ID="editor.contrib.colorDetector";r_.RECOMPUTE_TIME=1e3;r_=zz=Dnt([D9(1,gn),D9(2,_t),D9(3,gu)],r_);class Int{constructor(){this._onDidChange=new se,this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}jn(r_.ID,r_,1);class knt{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)}constructor(e,t,n){this.presentationIndex=n,this._onColorFlushed=new se,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new se,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new se,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){let n=-1;for(let r=0;r{this.backgroundColor=s.getColor(oP)||me.white})),this._register(ye(this._pickedColorNode,Ge.CLICK,()=>this.model.selectNextColorPresentation())),this._register(ye(this._originalColorNode,Ge.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=me.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),this.showingStandaloneColorPicker&&(this._domNode.classList.add("standalone-colorpicker"),this._closeButton=this._register(new Nnt(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=me.Format.CSS.format(e)||"",this._pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this._pickedColorPresentation.textContent=this.model.presentation?this.model.presentation.label:""}}class Nnt extends fe{constructor(e){super(),this._onClicked=this._register(new se),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),ke(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),ke(this._button,t),ke(t,oc(".button"+Wt.asCSSSelector(Mr("color-picker-close",Xe.close,w("closeIcon","Icon to close the color picker"))))).classList.add("close-icon"),this._register(ye(this._button,Ge.CLICK,()=>{this._onClicked.fire()}))}}class Rnt extends fe{constructor(e,t,n,r=!1){super(),this.model=t,this.pixelRatio=n,this._insertButton=null,this._domNode=oc(".colorpicker-body"),ke(e,this._domNode),this._saturationBox=new Mnt(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 Ant(this._domNode,this.model,r),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new Pnt(this._domNode,this.model,r),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),r&&(this._insertButton=this._register(new Ont(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const n=this.model.color.hsva;this.model.color=new me(new bf(n.h,e,t,n.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new me(new bf(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,n=(1-e)*360;this.model.color=new me(new bf(n===360?0:n,t.s,t.v,t.a))}get domNode(){return this._domNode}get saturationBox(){return this._saturationBox}get enterButton(){return this._insertButton}layout(){this._saturationBox.layout(),this._opacityStrip.layout(),this._hueStrip.layout()}}class Mnt extends fe{constructor(e,t,n){super(),this.model=t,this.pixelRatio=n,this._onDidChange=new se,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new se,this.onColorFlushed=this._onColorFlushed.event,this._domNode=oc(".saturation-wrap"),ke(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",ke(this._domNode,this._canvas),this.selection=oc(".saturation-selection"),ke(this._domNode,this.selection),this.layout(),this._register(ye(this._domNode,Ge.POINTER_DOWN,r=>this.onPointerDown(r))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}get domNode(){return this._domNode}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;this.monitor=this._register(new kS);const t=Br(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>this.onDidChangePosition(r.pageX-t.left,r.pageY-t.top),()=>null);const n=ye(e.target.ownerDocument,Ge.POINTER_UP,()=>{this._onColorFlushed.fire(),n.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const n=Math.max(0,Math.min(1,e/this.width)),r=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(n,r),this._onDidChange.fire({s:n,v:r})}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 me(new bf(e.h,1,1,1)),n=this._canvas.getContext("2d"),r=n.createLinearGradient(0,0,this._canvas.width,0);r.addColorStop(0,"rgba(255, 255, 255, 1)"),r.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),r.addColorStop(1,"rgba(255, 255, 255, 0)");const o=n.createLinearGradient(0,0,0,this._canvas.height);o.addColorStop(0,"rgba(0, 0, 0, 0)"),o.addColorStop(1,"rgba(0, 0, 0, 1)"),n.rect(0,0,this._canvas.width,this._canvas.height),n.fillStyle=me.Format.CSS.format(t),n.fill(),n.fillStyle=r,n.fill(),n.fillStyle=o,n.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${this.height-t*this.height}px`}onDidChangeColor(e){if(this.monitor&&this.monitor.isMonitoring())return;this.paint();const t=e.hsva;this.paintSelection(t.s,t.v)}}class _Ce extends fe{constructor(e,t,n=!1){super(),this.model=t,this._onDidChange=new se,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new se,this.onColorFlushed=this._onColorFlushed.event,n?(this.domNode=ke(e,oc(".standalone-strip")),this.overlay=ke(this.domNode,oc(".standalone-overlay"))):(this.domNode=ke(e,oc(".strip")),this.overlay=ke(this.domNode,oc(".overlay"))),this.slider=ke(this.domNode,oc(".slider")),this.slider.style.top="0px",this._register(ye(this.domNode,Ge.POINTER_DOWN,r=>this.onPointerDown(r))),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onDidChangeColor(e){const t=this.getValue(e);this.updateSliderPosition(t)}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._register(new kS),n=Br(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,o=>this.onDidChangeTop(o.pageY-n.top),()=>null);const r=ye(e.target.ownerDocument,Ge.POINTER_UP,()=>{this._onColorFlushed.fire(),r.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 Ant extends _Ce{constructor(e,t,n=!1){super(e,t,n),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);const{r:t,g:n,b:r}=e.rgba,o=new me(new Tn(t,n,r,1)),s=new me(new Tn(t,n,r,0));this.overlay.style.background=`linear-gradient(to bottom, ${o} 0%, ${s} 100%)`}getValue(e){return e.hsva.a}}class Pnt extends _Ce{constructor(e,t,n=!1){super(e,t,n),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class Ont extends fe{constructor(e){super(),this._onClicked=this._register(new se),this.onClicked=this._onClicked.event,this._button=ke(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._register(ye(this._button,Ge.CLICK,()=>{this._onClicked.fire()}))}get button(){return this._button}}class Fnt extends yc{constructor(e,t,n,r,o=!1){super(),this.model=t,this.pixelRatio=n,this._register(ID.getInstance(Pt(e)).onDidChange(()=>this.layout()));const s=oc(".colorpicker-widget");e.appendChild(s),this.header=this._register(new Tnt(s,this.model,r,o)),this.body=this._register(new Rnt(s,this.model,this.pixelRatio,o))}layout(){this.body.layout()}}var bCe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},CCe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class Bnt{constructor(e,t,n,r){this.owner=e,this.range=t,this.model=n,this.provider=r,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let gO=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,n){return Kr.fromPromise(this._computeAsync(e,t,n))}async _computeAsync(e,t,n){if(!this._editor.hasModel())return[];const r=r_.get(this._editor);if(!r)return[];for(const o of t){if(!r.isColorDecoration(o))continue;const s=r.getColorData(o.range.getStartPosition());if(s)return[await yCe(this,this._editor.getModel(),s.colorInfo,s.provider)]}return[]}renderHoverParts(e,t){return wCe(this,this._editor,this._themeService,t,e)}};gO=bCe([CCe(1,To)],gO);class Wnt{constructor(e,t,n,r){this.owner=e,this.range=t,this.model=n,this.provider=r}}let TI=class{constructor(e,t){this._editor=e,this._themeService=t,this._color=null}async createColorHover(e,t,n){if(!this._editor.hasModel()||!r_.get(this._editor))return null;const o=await gCe(n,this._editor.getModel(),Cn.None);let s=null,a=null;for(const d of o){const h=d.colorInfo;B.containsRange(h.range,e.range)&&(s=h,a=d.provider)}const l=s??e,c=a??t,u=!!s;return{colorHover:await yCe(this,this._editor.getModel(),l,c),foundInEditor:u}}async updateEditorModel(e){if(!this._editor.hasModel())return;const t=e.model;let n=new B(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(await OM(this._editor.getModel(),t,this._color,n,e),n=SCe(this._editor,n,t))}renderHoverParts(e,t){return wCe(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};TI=bCe([CCe(1,To)],TI);async function yCe(i,e,t,n){const r=e.getValueInRange(t.range),{red:o,green:s,blue:a,alpha:l}=t.color,c=new Tn(Math.round(o*255),Math.round(s*255),Math.round(a*255),l),u=new me(c),d=await pCe(e,t,n,Cn.None),h=new knt(u,[],0);return h.colorPresentations=d||[],h.guessColorPresentation(u,r),i instanceof gO?new Bnt(i,B.lift(t.range),h,n):new Wnt(i,B.lift(t.range),h,n)}function wCe(i,e,t,n,r){if(n.length===0||!e.hasModel())return fe.None;if(r.setMinimumDimensions){const h=e.getOption(67)+8;r.setMinimumDimensions(new Kn(302,h))}const o=new Te,s=n[0],a=e.getModel(),l=s.model,c=o.add(new Fnt(r.fragment,l,e.getOption(142),t,i instanceof TI));r.setColorPicker(c);let u=!1,d=new B(s.range.startLineNumber,s.range.startColumn,s.range.endLineNumber,s.range.endColumn);if(i instanceof TI){const h=n[0].model.color;i.color=h,OM(a,l,h,d,s),o.add(l.onColorFlushed(f=>{i.color=f}))}else o.add(l.onColorFlushed(async h=>{await OM(a,l,h,d,s),u=!0,d=SCe(e,d,l)}));return o.add(l.onDidChangeColor(h=>{OM(a,l,h,d,s)})),o.add(e.onDidChangeModelContent(h=>{u?u=!1:(r.hide(),e.focus())})),o}function SCe(i,e,t){var n,r;const o=[],s=(n=t.presentation.textEdit)!==null&&n!==void 0?n:{range:e,text:t.presentation.label,forceMoveMarkers:!1};o.push(s),t.presentation.additionalTextEdits&&o.push(...t.presentation.additionalTextEdits);const a=B.lift(s.range),l=i.getModel()._setTrackedRange(null,a,3);return i.executeEdits("colorpicker",o),i.pushUndoStop(),(r=i.getModel()._getTrackedRange(l))!==null&&r!==void 0?r:a}async function OM(i,e,t,n,r){const o=await pCe(i,{range:n,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},r.provider,Cn.None);e.colorPresentations=o||[]}function Uz(i,e){return!!i[e]}class I9{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=Uz(e.event,t.triggerModifier),this.hasSideBySideModifier=Uz(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class Lae{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=Uz(e,t.triggerModifier)}}class KR{constructor(e,t,n,r){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=n,this.triggerSideBySideModifier=r}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function Eae(i){return i==="altKey"?Ln?new KR(57,"metaKey",6,"altKey"):new KR(5,"ctrlKey",6,"altKey"):Ln?new KR(6,"altKey",57,"metaKey"):new KR(6,"altKey",5,"ctrlKey")}class M3 extends fe{constructor(e,t){var n;super(),this._onMouseMoveOrRelevantKeyDown=this._register(new se),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new se),this.onExecute=this._onExecute.event,this._onCancel=this._register(new se),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=(n=t==null?void 0:t.extractLineNumberFromMouseEvent)!==null&&n!==void 0?n:r=>r.target.position?r.target.position.lineNumber:0,this._opts=Eae(this._editor.getOption(78)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(r=>{if(r.hasChanged(78)){const o=Eae(this._editor.getOption(78));if(this._opts.equals(o))return;this._opts=o,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(r=>this._onEditorMouseMove(new I9(r,this._opts)))),this._register(this._editor.onMouseDown(r=>this._onEditorMouseDown(new I9(r,this._opts)))),this._register(this._editor.onMouseUp(r=>this._onEditorMouseUp(new I9(r,this._opts)))),this._register(this._editor.onKeyDown(r=>this._onEditorKeyDown(new Lae(r,this._opts)))),this._register(this._editor.onKeyUp(r=>this._onEditorKeyUp(new Lae(r,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(r=>this._onDidChangeCursorSelection(r))),this._register(this._editor.onDidChangeModel(r=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(r=>{(r.scrollTopChanged||r.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=this._extractLineNumberFromMouseEvent(e)}_onEditorMouseUp(e){const t=this._extractLineNumberFromMouseEvent(e);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 $nt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},bg=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let o_=class extends $w{constructor(e,t,n,r,o,s,a,l,c,u,d,h,f){super(e,{...r.getRawOptions(),overflowWidgetsDomNode:r.getOverflowWidgetsDomNode()},n,o,s,a,l,c,u,d,h,f),this._parentEditor=r,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(r.onDidChangeConfiguration(g=>this._onParentConfigurationChanged(g)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){r4(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};o_=$nt([bg(4,Ot),bg(5,Un),bg(6,sr),bg(7,Vt),bg(8,To),bg(9,$r),bg(10,ud),bg(11,Di),bg(12,_t)],o_);const Dae=new me(new Tn(0,122,204)),Hnt={showArrow:!0,showFrame:!0,className:"",frameColor:Dae,arrowColor:Dae,keepEditorSelection:!1},Vnt="vs.editor.contrib.zoneWidget";class znt{constructor(e,t,n,r,o,s,a,l){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=n,this.heightInLines=r,this.showInHiddenAreas=a,this.ordinal=l,this._onDomNodeTop=o,this._onComputedHeight=s}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class Unt{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}let xCe=class LCe{constructor(e){this._editor=e,this._ruleName=LCe._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),aH(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(){aH(this._ruleName),qA(`.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){e.column===1&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:B.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}};xCe._IdGenerator=new WX(".arrow-decoration-");class jnt{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new Te,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=Mg(t),r4(this.options,Hnt,!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(n=>{const r=this._getWidth(n);this.domNode.style.width=r+"px",this.domNode.style.left=this._getLeft(n)+"px",this._onWidth(r)}))}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._positionMarkerId.clear(),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 xCe(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){const e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){const e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){var t;if(this.domNode.style.height=`${e}px`,this.container){const n=e-this._decoratingElementsHeight();this.container.style.height=`${n}px`;const r=this.editor.getLayoutInfo();this._doLayout(n,this._getWidth(r))}(t=this._resizeSash)===null||t===void 0||t.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,t){const n=B.isIRange(e)?B.lift(e):B.fromPositions(e);this._isShowing=!0,this._showImpl(n,t),this._isShowing=!1,this._positionMarkerId.set([{range:n,options:sn.EMPTY}])}hide(){var e;this._viewZone&&(this.editor.changeViewZones(t=>{this._viewZone&&t.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),(e=this._arrow)===null||e===void 0||e.hide(),this._positionMarkerId.clear()}_decoratingElementsHeight(){const e=this.editor.getOption(67);let t=0;if(this.options.showArrow){const n=Math.round(e/3);t+=2*n}if(this.options.showFrame){const n=Math.round(e/9);t+=2*n}return t}_showImpl(e,t){const n=e.getStartPosition(),r=this.editor.getLayoutInfo(),o=this._getWidth(r);this.domNode.style.width=`${o}px`,this.domNode.style.left=this._getLeft(r)+"px";const s=document.createElement("div");s.style.overflow="hidden";const a=this.editor.getOption(67);if(!this.options.allowUnlimitedHeight){const h=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,h)}let l=0,c=0;if(this._arrow&&this.options.showArrow&&(l=Math.round(a/3),this._arrow.height=l,this._arrow.show(n)),this.options.showFrame&&(c=Math.round(a/9)),this.editor.changeViewZones(h=>{this._viewZone&&h.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new znt(s,n.lineNumber,n.column,t,f=>this._onViewZoneTop(f),f=>this._onViewZoneHeight(f),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=h.addZone(this._viewZone),this._overlayWidget=new Unt(Vnt+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const h=this.options.frameWidth?this.options.frameWidth:c;this.container.style.borderTopWidth=h+"px",this.container.style.borderBottomWidth=h+"px"}const u=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=u+"px",this.container.style.overflow="hidden"),this._doLayout(u,o),this.options.keepEditorSelection||this.editor.setSelection(e);const d=this.editor.getModel();if(d){const h=d.validateRange(new B(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(h,h.startLineNumber===d.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,0):this.editor.revealRange(e,0)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e){this._viewZone&&this._viewZone.heightInLines!==e&&this.editor.changeViewZones(t=>{this._viewZone&&(this._viewZone.heightInLines=e,t.layoutZone(this._viewZone.id))})}_initSash(){if(this._resizeSash)return;this._resizeSash=this._disposables.add(new Ls(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0);let e;this._disposables.add(this._resizeSash.onDidStart(t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines})})),this._disposables.add(this._resizeSash.onDidEnd(()=>{e=void 0})),this._disposables.add(this._resizeSash.onDidChange(t=>{if(e){const n=(t.currentY-e.startY)/this.editor.getOption(67),r=n<0?Math.ceil(n):Math.floor(n),o=e.heightInLines+r;o>5&&o<35&&this._relayout(o)}}))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(this.domNode.style.height===null?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){const e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}}var ECe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},DCe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const ICe=yn("IPeekViewService");In(ICe,class{constructor(){this._widgets=new Map}addExclusiveWidget(i,e){const t=this._widgets.get(i);t&&(t.listener.dispose(),t.widget.dispose());const n=()=>{const r=this._widgets.get(i);r&&r.widget===e&&(r.listener.dispose(),this._widgets.delete(i))};this._widgets.set(i,{widget:e,listener:e.onDidClose(n)})}},1);var il;(function(i){i.inPeekEditor=new st("inReferenceSearchEditor",!0,w("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),i.notInPeekEditor=i.inPeekEditor.toNegated()})(il||(il={}));let NI=class{constructor(e,t){e instanceof o_&&il.inPeekEditor.bindTo(t)}dispose(){}};NI.ID="editor.contrib.referenceController";NI=ECe([DCe(1,Vt)],NI);jn(NI.ID,NI,0);function Knt(i){const e=i.get(Un).getFocusedCodeEditor();return e instanceof o_?e.getParentEditor():e}const Gnt={headerBackgroundColor:me.white,primaryHeadingColor:me.fromHex("#333333"),secondaryHeadingColor:me.fromHex("#6c6c6cb3")};let pO=class extends jnt{constructor(e,t,n){super(e,t),this.instantiationService=n,this._onDidClose=new se,this.onDidClose=this._onDidClose.event,r4(this.options,Gnt,!1)}dispose(){this.disposed||(this.disposed=!0,super.dispose(),this._onDidClose.fire(this))}style(e){const 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();const 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=He(".head"),this._bodyElement=He(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=He(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),Sr(this._titleElement,"click",o=>this._onTitleClick(o))),ke(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=He("span.filename"),this._secondaryHeading=He("span.dirname"),this._metaHeading=He("span.meta"),ke(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const n=He(".peekview-actions");ke(this._headElement,n);const r=this._getActionBarOptions();this._actionbarWidget=new au(n,r),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new xl("peekview.close",w("label.close","Close"),Wt.asClassName(Xe.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:q_e.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:Ns(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,bl(this._metaHeading)):fa(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const n=Math.ceil(this.editor.getOption(67)*1.2),r=Math.round(e-(n+2));this._doLayoutHead(n,t),this._doLayoutBody(r,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`)}};pO=ECe([DCe(2,Ot)],pO);const qnt=X("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:me.black,hcLight:me.white},w("peekViewTitleBackground","Background color of the peek view title area.")),kCe=X("peekViewTitleLabel.foreground",{dark:me.white,light:me.black,hcDark:me.white,hcLight:Ku},w("peekViewTitleForeground","Color of the peek view title.")),TCe=X("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},w("peekViewTitleInfoForeground","Color of the peek view title info.")),Xnt=X("peekView.border",{dark:Za,light:Za,hcDark:Sn,hcLight:Sn},w("peekViewBorder","Color of the peek view borders and arrow.")),Ynt=X("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:me.black,hcLight:me.white},w("peekViewResultsBackground","Background color of the peek view result list."));X("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:me.white,hcLight:Ku},w("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));X("peekViewResult.fileForeground",{dark:me.white,light:"#1E1E1E",hcDark:me.white,hcLight:Ku},w("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));X("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},w("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));X("peekViewResult.selectionForeground",{dark:me.white,light:"#6C6C6C",hcDark:me.white,hcLight:Ku},w("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const tv=X("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:me.black,hcLight:me.white},w("peekViewEditorBackground","Background color of the peek view editor."));X("peekViewEditorGutter.background",{dark:tv,light:tv,hcDark:tv,hcLight:tv},w("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));X("peekViewEditorStickyScroll.background",{dark:tv,light:tv,hcDark:tv,hcLight:tv},w("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));X("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},w("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));X("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},w("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));X("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:zi,hcLight:zi},w("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));class s_{constructor(e,t,n,r){this.isProviderFirst=e,this.parent=t,this.link=n,this._rangeCallback=r,this.id=hV.nextId()}get uri(){return this.link.uri}get range(){var e,t;return(t=(e=this._range)!==null&&e!==void 0?e:this.link.targetSelectionRange)!==null&&t!==void 0?t:this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){var e;const t=(e=this.parent.getPreview(this))===null||e===void 0?void 0:e.preview(this.range);return t?w({key:"aria.oneReference.preview",comment:["Placeholders are: 0: filename, 1:line number, 2: column number, 3: preview snippet of source code"]},"{0} in {1} on line {2} at column {3}",t.value,su(this.uri),this.range.startLineNumber,this.range.startColumn):w("aria.oneReference","in {0} on line {1} at column {2}",su(this.uri),this.range.startLineNumber,this.range.startColumn)}}class Znt{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const n=this._modelReference.object.textEditorModel;if(!n)return;const{startLineNumber:r,startColumn:o,endLineNumber:s,endColumn:a}=e,l=n.getWordUntilPosition({lineNumber:r,column:o-t}),c=new B(r,l.startColumn,r,o),u=new B(s,a,s,1073741824),d=n.getValueInRange(c).replace(/^\s+/,""),h=n.getValueInRange(e),f=n.getValueInRange(u).replace(/\s+$/,"");return{value:d+h+f,highlight:{start:d.length,end:d.length+h.length}}}}class RI{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new Tr}dispose(){si(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?w("aria.fileReferences.1","1 symbol in {0}, full path {1}",su(this.uri),this.uri.fsPath):w("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,su(this.uri),this.uri.fsPath)}async resolve(e){if(this._previews.size!==0)return this;for(const t of this.children)if(!this._previews.has(t.uri))try{const n=await e.createModelReference(t.uri);this._previews.set(t.uri,new Znt(n))}catch(n){en(n)}return this}}class El{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new se,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[n]=e;e.sort(El._compareReferences);let r;for(const o of e)if((!r||!Ui.isEqual(r.uri,o.uri,!0))&&(r=new RI(this,o.uri),this.groups.push(r)),r.children.length===0||El._compareReferences(o,r.children[r.children.length-1])!==0){const s=new s_(n===o,r,o,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(s),r.children.push(s)}}dispose(){si(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new El(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?w("aria.result.0","No results found"):this.references.length===1?w("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?w("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):w("aria.result.nm","Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:n}=e;let r=n.children.indexOf(e);const o=n.children.length,s=n.parent.groups.length;return s===1||t&&r+10?(t?r=(r+1)%o:r=(r+o-1)%o,n.children[r]):(r=n.parent.groups.indexOf(n),t?(r=(r+1)%s,n.parent.groups[r].children[0]):(r=(r+s-1)%s,n.parent.groups[r].children[n.parent.groups[r].children.length-1]))}nearestReference(e,t){const n=this.references.map((r,o)=>({idx:o,prefixLen:Vv(r.uri.toString(),e.toString()),offsetDist:Math.abs(r.range.startLineNumber-t.lineNumber)*100+Math.abs(r.range.startColumn-t.column)})).sort((r,o)=>r.prefixLen>o.prefixLen?-1:r.prefixLeno.offsetDist?1:0)[0];if(n)return this.references[n.idx]}referenceAt(e,t){for(const n of this.references)if(n.uri.toString()===e.toString()&&B.containsPosition(n.range,t))return n}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return Ui.compare(e.uri,t.uri)||B.compareRangesUsingStarts(e.range,t.range)}}var A3=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},P3=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},jz;let Kz=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof El||e instanceof RI}getChildren(e){if(e instanceof El)return e.groups;if(e instanceof RI)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};Kz=A3([P3(0,ol)],Kz);class Qnt{getHeight(){return 23}getTemplateId(e){return e instanceof RI?MI.id:dT.id}}let Gz=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof s_){const n=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(n)return n.value}return su(e.uri)}};Gz=A3([P3(0,ci)],Gz);class Jnt{getId(e){return e instanceof s_?e.id:e.uri}}let qz=class extends fe{constructor(e,t){super(),this._labelService=t;const n=document.createElement("div");n.classList.add("reference-file"),this.file=this._register(new ZP(n,{supportHighlights:!0})),this.badge=new XV(ke(n,He(".count")),{},K_e),e.appendChild(n)}set(e,t){const n=z4(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(n,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});const r=e.children.length;this.badge.setCount(r),r>1?this.badge.setTitleFormat(w("referencesCount","{0} references",r)):this.badge.setTitleFormat(w("referenceCount","{0} reference",r))}};qz=A3([P3(1,Vw)],qz);let MI=jz=class{constructor(e){this._instantiationService=e,this.templateId=jz.id}renderTemplate(e){return this._instantiationService.createInstance(qz,e)}renderElement(e,t,n){n.set(e.element,qk(e.filterData))}disposeTemplate(e){e.dispose()}};MI.id="FileReferencesRenderer";MI=jz=A3([P3(0,Ot)],MI);class eit{constructor(e){this.label=new Ev(e)}set(e,t){var n;const r=(n=e.parent.getPreview(e))===null||n===void 0?void 0:n.preview(e.range);if(!r||!r.value)this.label.set(`${su(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:o,highlight:s}=r;t&&!rh.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(o,qk(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(o,[s]))}}}class dT{constructor(){this.templateId=dT.id}renderTemplate(e){return new eit(e)}renderElement(e,t,n){n.set(e.element,e.filterData)}disposeTemplate(){}}dT.id="OneReferenceRenderer";class tit{getWidgetAriaLabel(){return w("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var nit=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Cg=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class O3{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new Te,this._callOnModelChange=new Te,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(const t of this._model.references)if(t.uri.toString()===e.uri.toString()){this._addDecorations(t.parent);return}}}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));const t=[],n=[];for(let r=0,o=e.children.length;r{const o=r.deltaDecorations([],t);for(let s=0;s{o.equals(9)&&(this._keybindingService.dispatchEvent(o,o.target),o.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(rit,"ReferencesWidget",this._treeContainer,new Qnt,[this._instantiationService.createInstance(MI),this._instantiationService.createInstance(dT)],this._instantiationService.createInstance(Kz),n),this._splitView.addView({onDidChange:Je.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:o=>{this._preview.layout({height:this._dim.height,width:o})}},jP.Distribute),this._splitView.addView({onDidChange:Je.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:o=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${o}px`,this._tree.layout(this._dim.height,o)}},jP.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const r=(o,s)=>{o instanceof s_&&(s==="show"&&this._revealReference(o,!1),this._onDidSelectReference.fire({element:o,kind:s,source:"tree"}))};this._tree.onDidOpen(o=>{o.sideBySide?r(o.element,"side"):o.editorOptions.pinned?r(o.element,"goto"):r(o.element,"show")}),fa(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new Kn(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=w("noResults","No results"),bl(this._messageContainer),Promise.resolve(void 0)):(fa(this._messageContainer),this._decorationsManager=new O3(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:n}=e;if(t.detail!==2)return;const r=this._getFocusedReference();r&&this._onDidSelectReference.fire({element:{uri:r.uri,range:n.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),bl(this._treeContainer),bl(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(this._model.groups.length===1?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){const[e]=this._tree.getFocus();if(e instanceof s_)return e;if(e instanceof RI&&e.children.length>0)return e.children[0]}async revealReference(e){await this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})}async _revealReference(e,t){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==an.inMemory?this.setTitle(bze(e.uri),this._uriLabel.getUriLabel(z4(e.uri))):this.setTitle(w("peekView.alternateTitle","References"));const n=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent?this._tree.reveal(e):(t&&this._tree.reveal(e.parent),await this._tree.expand(e.parent),this._tree.reveal(e));const r=await n;if(!this._model){r.dispose();return}si(this._previewModelReference);const o=r.object;if(o){const s=this._preview.getModel()===o.textEditorModel?0:1,a=B.lift(e.range).collapseToStart();this._previewModelReference=r,this._preview.setModel(o.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,s)}else this._preview.setModel(this._previewNotAvailableMessage),r.dispose()}};Xz=nit([Cg(3,To),Cg(4,ol),Cg(5,Ot),Cg(6,ICe),Cg(7,Vw),Cg(8,U4),Cg(9,ci),Cg(10,ji),Cg(11,Di)],Xz);var oit=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},i1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},FM;const wC=new st("referenceSearchVisible",!1,w("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let a_=FM=class{static get(e){return e.getContribution(FM.ID)}constructor(e,t,n,r,o,s,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=r,this._notificationService=o,this._instantiationService=s,this._storageService=a,this._configurationService=l,this._disposables=new Te,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=wC.bindTo(n)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),(e=this._widget)===null||e===void 0||e.dispose(),(t=this._model)===null||t===void 0||t.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,n){let r;if(this._widget&&(r=this._widget.position),this.closeWidget(),r&&e.containsPosition(r))return;this._peekMode=n,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=iit.fromJSON(this._storageService.get(o,0,"{}"));this._widget=this._instantiationService.createInstance(Xz,this._editor,this._defaultTreeKeyboardSupport,s),this._widget.setTitle(w("labelLoading","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(l=>{const{element:c,kind:u}=l;if(c)switch(u){case"open":(l.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(c,!1,!1);break;case"side":this.openReference(c,!0,!1);break;case"goto":n?this._gotoReference(c,!0):this.openReference(c,!1,!0);break}}));const a=++this._requestIdPool;t.then(l=>{var c;if(a!==this._requestIdPool||!this._widget){l.dispose();return}return(c=this._model)===null||c===void 0||c.dispose(),this._model=l,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(w("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));const u=this._editor.getModel().uri,d=new ae(e.startLineNumber,e.startColumn),h=this._model.nearestReference(u,d);if(h)return this._widget.setSelection(h).then(()=>{this._widget&&this._editor.getOption(87)==="editor"&&this._widget.focusOnPreviewEditor()})}})},l=>{this._notificationService.error(l)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}async goToNextOrPreviousReference(e){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const n=this._model.nearestReference(this._editor.getModel().uri,t);if(!n)return;const r=this._model.nextOrPreviousReference(n,e),o=this._editor.hasTextFocus(),s=this._widget.isPreviewEditorFocused();await this._widget.setSelection(r),await this._gotoReference(r,!1),o?this._editor.focus():this._widget&&s&&this._widget.focusOnPreviewEditor()}async revealReference(e){!this._editor.hasModel()||!this._model||!this._widget||await this._widget.revealReference(e)}closeWidget(e=!0){var t,n;(t=this._widget)===null||t===void 0||t.dispose(),(n=this._model)===null||n===void 0||n.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(e,t){var n;(n=this._widget)===null||n===void 0||n.hide(),this._ignoreModelChangeEvent=!0;const r=B.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:r,selectionSource:"code.jump",pinned:t}},this._editor).then(o=>{var s;if(this._ignoreModelChangeEvent=!1,!o||!this._widget){this.closeWidget();return}if(this._editor===o)this._widget.show(r),this._widget.focusOnReferenceTree();else{const a=FM.get(o),l=this._model.clone();this.closeWidget(),o.focus(),a==null||a.toggleWidget(r,Io(c=>Promise.resolve(l)),(s=this._peekMode)!==null&&s!==void 0?s:!1)}},o=>{this._ignoreModelChangeEvent=!1,en(o)})}openReference(e,t,n){t||this.closeWidget();const{uri:r,range:o}=e;this._editorService.openCodeEditor({resource:r,options:{selection:o,selectionSource:"code.jump",pinned:n}},this._editor,t)}};a_.ID="editor.contrib.referencesController";a_=FM=oit([i1(2,Vt),i1(3,Un),i1(4,$r),i1(5,Ot),i1(6,dd),i1(7,gn)],a_);function SC(i,e){const t=Knt(i);if(!t)return;const n=a_.get(t);n&&e(n)}nl.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:co(2089,60),when:De.or(wC,il.inPeekEditor),handler(i){SC(i,e=>{e.changeFocusBetweenPreviewAndReferences()})}});nl.registerCommandAndKeybindingRule({id:"goToNextReference",weight:100-10,primary:62,secondary:[70],when:De.or(wC,il.inPeekEditor),handler(i){SC(i,e=>{e.goToNextOrPreviousReference(!0)})}});nl.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:100-10,primary:1086,secondary:[1094],when:De.or(wC,il.inPeekEditor),handler(i){SC(i,e=>{e.goToNextOrPreviousReference(!1)})}});Dn.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");Dn.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");Dn.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");Dn.registerCommand("closeReferenceSearch",i=>SC(i,e=>e.closeWidget()));nl.registerKeybindingRule({id:"closeReferenceSearch",weight:100-101,primary:9,secondary:[1033],when:De.and(il.inPeekEditor,De.not("config.editor.stablePeek"))});nl.registerKeybindingRule({id:"closeReferenceSearch",weight:200+50,primary:9,secondary:[1033],when:De.and(wC,De.not("config.editor.stablePeek"),De.or(j.editorTextFocus,XXe.negate()))});nl.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:De.and(wC,v0e,oY.negate(),sY.negate()),handler(i){var e;const n=(e=i.get(mu).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(n)&&n[0]instanceof s_&&SC(i,r=>r.revealReference(n[0]))}});nl.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:De.and(wC,v0e,oY.negate(),sY.negate()),handler(i){var e;const n=(e=i.get(mu).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(n)&&n[0]instanceof s_&&SC(i,r=>r.openReference(n[0],!0,!0))}});Dn.registerCommand("openReference",i=>{var e;const n=(e=i.get(mu).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(n)&&n[0]instanceof s_&&SC(i,r=>r.openReference(n[0],!1,!0))});var NCe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},WL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const HY=new st("hasSymbols",!1,w("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),F3=yn("ISymbolNavigationService");let Yz=class{constructor(e,t,n,r){this._editorService=t,this._notificationService=n,this._keybindingService=r,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=HY.bindTo(e)}reset(){var e,t;this._ctxHasSymbols.reset(),(e=this._currentState)===null||e===void 0||e.dispose(),(t=this._currentMessage)===null||t===void 0||t.dispose(),this._currentModel=void 0,this._currentIdx=-1}put(e){const t=e.parent.parent;if(t.references.length<=1){this.reset();return}this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const n=new Zz(this._editorService),r=n.onDidChange(o=>{if(this._ignoreEditorChange)return;const s=this._editorService.getActiveCodeEditor();if(!s)return;const a=s.getModel(),l=s.getPosition();if(!a||!l)return;let c=!1,u=!1;for(const d of t.references)if(hX(d.uri,a.uri))c=!0,u=u||B.containsPosition(d.range,l);else if(c)break;(!c||!u)&&this.reset()});this._currentState=Zu(n,r)}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:B.collapseToStart(t.range),selectionRevealType:3}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){var e;(e=this._currentMessage)===null||e===void 0||e.dispose();const t=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),n=t?w("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):w("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(n)}};Yz=NCe([WL(0,Vt),WL(1,Un),WL(2,$r),WL(3,ci)],Yz);In(F3,Yz,1);et(new class extends Vo{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:HY,kbOpts:{weight:100,primary:70}})}runEditorCommand(i,e){return i.get(F3).revealNext(e)}});nl.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:HY,primary:9,handler(i){i.get(F3).reset()}});let Zz=class{constructor(e){this._listener=new Map,this._disposables=new Te,this._onDidChange=new se,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(),si(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,Zu(e.onDidChangeCursorPosition(t=>this._onDidChange.fire({editor:e})),e.onDidChangeModelContent(t=>this._onDidChange.fire({editor:e}))))}_onDidRemoveEditor(e){var t;(t=this._listener.get(e))===null||t===void 0||t.dispose(),this._listener.delete(e)}};Zz=NCe([WL(0,Un)],Zz);async function hT(i,e,t,n){const o=t.ordered(i).map(a=>Promise.resolve(n(a,i,e)).then(void 0,l=>{Zr(l)})),s=await Promise.all(o);return lh(s.flat())}function B3(i,e,t,n){return hT(e,t,i,(r,o,s)=>r.provideDefinition(o,s,n))}function RCe(i,e,t,n){return hT(e,t,i,(r,o,s)=>r.provideDeclaration(o,s,n))}function MCe(i,e,t,n){return hT(e,t,i,(r,o,s)=>r.provideImplementation(o,s,n))}function ACe(i,e,t,n){return hT(e,t,i,(r,o,s)=>r.provideTypeDefinition(o,s,n))}function W3(i,e,t,n,r){return hT(e,t,i,async(o,s,a)=>{const l=await o.provideReferences(s,a,{includeDeclaration:!0},r);if(!n||!l||l.length!==2)return l;const c=await o.provideReferences(s,a,{includeDeclaration:!1},r);return c&&c.length===1?c:l})}async function fT(i){const e=await i(),t=new El(e,""),n=t.references.map(r=>r.link);return t.dispose(),n}tg("_executeDefinitionProvider",(i,e,t)=>{const n=i.get(_t),r=B3(n.definitionProvider,e,t,Cn.None);return fT(()=>r)});tg("_executeTypeDefinitionProvider",(i,e,t)=>{const n=i.get(_t),r=ACe(n.typeDefinitionProvider,e,t,Cn.None);return fT(()=>r)});tg("_executeDeclarationProvider",(i,e,t)=>{const n=i.get(_t),r=RCe(n.declarationProvider,e,t,Cn.None);return fT(()=>r)});tg("_executeReferenceProvider",(i,e,t)=>{const n=i.get(_t),r=W3(n.referenceProvider,e,t,!1,Cn.None);return fT(()=>r)});tg("_executeImplementationProvider",(i,e,t)=>{const n=i.get(_t),r=MCe(n.implementationProvider,e,t,Cn.None);return fT(()=>r)});var Yx,Zx,Qx,GR,qR,XR,YR,ZR;ts.appendMenuItem($.EditorContext,{submenu:$.EditorContextPeek,title:w("peek.submenu","Peek"),group:"navigation",order:100});class eS{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof eS||ae.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}class Gs extends Sh{static all(){return Gs._allSymbolNavigationCommands.values()}static _patchConfig(e){const t={...e,f1:!0};if(t.menu)for(const n of En.wrap(t.menu))(n.id===$.EditorContext||n.id===$.EditorContextPeek)&&(n.when=De.and(e.precondition,n.when));return t}constructor(e,t){super(Gs._patchConfig(t)),this.configuration=e,Gs._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,n,r){if(!t.hasModel())return Promise.resolve(void 0);const o=e.get($r),s=e.get(Un),a=e.get(k_),l=e.get(F3),c=e.get(_t),u=e.get(Ot),d=t.getModel(),h=t.getPosition(),f=eS.is(n)?n:new eS(d,h),g=new n_(t,5),p=Rk(this._getLocationModel(c,f.model,f.position,g.token),g.token).then(async v=>{var m;if(!v||g.token.isCancellationRequested)return;kl(v.ariaMessage);let _;if(v.referenceAt(d.uri,h)){const S=this._getAlternativeCommand(t);!Gs._activeAlternativeCommands.has(S)&&Gs._allSymbolNavigationCommands.has(S)&&(_=Gs._allSymbolNavigationCommands.get(S))}const y=v.references.length;if(y===0){if(!this.configuration.muteMessage){const S=d.getWordAtPosition(h);(m=xa.get(t))===null||m===void 0||m.showMessage(this._getNoResultFoundMessage(S),h)}}else if(y===1&&_)Gs._activeAlternativeCommands.add(this.desc.id),u.invokeFunction(S=>_.runEditorCommand(S,t,n,r).finally(()=>{Gs._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(s,l,t,v,r)},v=>{o.error(v)}).finally(()=>{g.dispose()});return a.showWhile(p,250),p}async _onResult(e,t,n,r,o){const s=this._getGoToPreference(n);if(!(n instanceof o_)&&(this.configuration.openInPeek||s==="peek"&&r.references.length>1))this._openInPeek(n,r,o);else{const a=r.firstReference(),l=r.references.length>1&&s==="gotoAndPeek",c=await this._openReference(n,e,a,this.configuration.openToSide,!l);l&&c?this._openInPeek(c,r,o):r.dispose(),s==="goto"&&t.put(a)}}async _openReference(e,t,n,r,o){let s;if(I5e(n)&&(s=n.targetSelectionRange),s||(s=n.range),!s)return;const a=await t.openCodeEditor({resource:n.uri,options:{selection:B.collapseToStart(s),selectionRevealType:3,selectionSource:"code.jump"}},e,r);if(a){if(o){const l=a.getModel(),c=a.createDecorationsCollection([{range:s,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&c.clear()},350)}return a}}_openInPeek(e,t,n){const r=a_.get(e);r&&e.hasModel()?r.toggleWidget(n??e.getSelection(),Io(o=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}Gs._allSymbolNavigationCommands=new Map;Gs._activeAlternativeCommands=new Set;class gT extends Gs{async _getLocationModel(e,t,n,r){return new El(await B3(e.definitionProvider,t,n,r),w("def.title","Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?w("noResultWord","No definition found for '{0}'",e.word):w("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleDefinitions}}Ei((Yx=class extends gT{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:Yx.id,title:{...$n("actions.goToDecl.label","Go to Definition"),mnemonicTitle:w({key:"miGotoDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Definition")},precondition:j.hasDefinitionProvider,keybinding:[{when:j.editorTextFocus,primary:70,weight:100},{when:De.and(j.editorTextFocus,f0e),primary:2118,weight:100}],menu:[{id:$.EditorContext,group:"navigation",order:1.1},{id:$.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),Dn.registerCommandAlias("editor.action.goToDeclaration",Yx.id)}},Yx.id="editor.action.revealDefinition",Yx));Ei((Zx=class extends gT{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:Zx.id,title:$n("actions.goToDeclToSide.label","Open Definition to the Side"),precondition:De.and(j.hasDefinitionProvider,j.isInEmbeddedEditor.toNegated()),keybinding:[{when:j.editorTextFocus,primary:co(2089,70),weight:100},{when:De.and(j.editorTextFocus,f0e),primary:co(2089,2118),weight:100}]}),Dn.registerCommandAlias("editor.action.openDeclarationToTheSide",Zx.id)}},Zx.id="editor.action.revealDefinitionAside",Zx));Ei((Qx=class extends gT{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:Qx.id,title:$n("actions.previewDecl.label","Peek Definition"),precondition:De.and(j.hasDefinitionProvider,il.notInPeekEditor,j.isInEmbeddedEditor.toNegated()),keybinding:{when:j.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:$.EditorContextPeek,group:"peek",order:2}}),Dn.registerCommandAlias("editor.action.previewDeclaration",Qx.id)}},Qx.id="editor.action.peekDefinition",Qx));class PCe extends Gs{async _getLocationModel(e,t,n,r){return new El(await RCe(e.declarationProvider,t,n,r),w("decl.title","Declarations"))}_getNoResultFoundMessage(e){return e&&e.word?w("decl.noResultWord","No declaration found for '{0}'",e.word):w("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(58).multipleDeclarations}}Ei((GR=class extends PCe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:GR.id,title:{...$n("actions.goToDeclaration.label","Go to Declaration"),mnemonicTitle:w({key:"miGotoDeclaration",comment:["&& denotes a mnemonic"]},"Go to &&Declaration")},precondition:De.and(j.hasDeclarationProvider,j.isInEmbeddedEditor.toNegated()),menu:[{id:$.EditorContext,group:"navigation",order:1.3},{id:$.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?w("decl.noResultWord","No declaration found for '{0}'",e.word):w("decl.generic.noResults","No declaration found")}},GR.id="editor.action.revealDeclaration",GR));Ei(class extends PCe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:$n("actions.peekDecl.label","Peek Declaration"),precondition:De.and(j.hasDeclarationProvider,il.notInPeekEditor,j.isInEmbeddedEditor.toNegated()),menu:{id:$.EditorContextPeek,group:"peek",order:3}})}});class OCe extends Gs{async _getLocationModel(e,t,n,r){return new El(await ACe(e.typeDefinitionProvider,t,n,r),w("typedef.title","Type Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?w("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):w("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleTypeDefinitions}}Ei((qR=class extends OCe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:qR.ID,title:{...$n("actions.goToTypeDefinition.label","Go to Type Definition"),mnemonicTitle:w({key:"miGotoTypeDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Type Definition")},precondition:j.hasTypeDefinitionProvider,keybinding:{when:j.editorTextFocus,primary:0,weight:100},menu:[{id:$.EditorContext,group:"navigation",order:1.4},{id:$.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},qR.ID="editor.action.goToTypeDefinition",qR));Ei((XR=class extends OCe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:XR.ID,title:$n("actions.peekTypeDefinition.label","Peek Type Definition"),precondition:De.and(j.hasTypeDefinitionProvider,il.notInPeekEditor,j.isInEmbeddedEditor.toNegated()),menu:{id:$.EditorContextPeek,group:"peek",order:4}})}},XR.ID="editor.action.peekTypeDefinition",XR));class FCe extends Gs{async _getLocationModel(e,t,n,r){return new El(await MCe(e.implementationProvider,t,n,r),w("impl.title","Implementations"))}_getNoResultFoundMessage(e){return e&&e.word?w("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):w("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(58).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(58).multipleImplementations}}Ei((YR=class extends FCe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:YR.ID,title:{...$n("actions.goToImplementation.label","Go to Implementations"),mnemonicTitle:w({key:"miGotoImplementation",comment:["&& denotes a mnemonic"]},"Go to &&Implementations")},precondition:j.hasImplementationProvider,keybinding:{when:j.editorTextFocus,primary:2118,weight:100},menu:[{id:$.EditorContext,group:"navigation",order:1.45},{id:$.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},YR.ID="editor.action.goToImplementation",YR));Ei((ZR=class extends FCe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:ZR.ID,title:$n("actions.peekImplementation.label","Peek Implementations"),precondition:De.and(j.hasImplementationProvider,il.notInPeekEditor,j.isInEmbeddedEditor.toNegated()),keybinding:{when:j.editorTextFocus,primary:3142,weight:100},menu:{id:$.EditorContextPeek,group:"peek",order:5}})}},ZR.ID="editor.action.peekImplementation",ZR));class BCe extends Gs{_getNoResultFoundMessage(e){return e?w("references.no","No references found for '{0}'",e.word):w("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(58).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(58).multipleReferences}}Ei(class extends BCe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{...$n("goToReferences.label","Go to References"),mnemonicTitle:w({key:"miGotoReference",comment:["&& denotes a mnemonic"]},"Go to &&References")},precondition:De.and(j.hasReferenceProvider,il.notInPeekEditor,j.isInEmbeddedEditor.toNegated()),keybinding:{when:j.editorTextFocus,primary:1094,weight:100},menu:[{id:$.EditorContext,group:"navigation",order:1.45},{id:$.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}async _getLocationModel(e,t,n,r){return new El(await W3(e.referenceProvider,t,n,!0,r),w("ref.title","References"))}});Ei(class extends BCe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:$n("references.action.label","Peek References"),precondition:De.and(j.hasReferenceProvider,il.notInPeekEditor,j.isInEmbeddedEditor.toNegated()),menu:{id:$.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(e,t,n,r){return new El(await W3(e.referenceProvider,t,n,!1,r),w("ref.title","References"))}});class sit extends Gs{constructor(e,t,n){super(e,{id:"editor.action.goToLocation",title:$n("label.generic","Go to Any Symbol"),precondition:De.and(il.notInPeekEditor,j.isInEmbeddedEditor.toNegated())}),this._references=t,this._gotoMultipleBehaviour=n}async _getLocationModel(e,t,n,r){return new El(this._references,w("generic.title","Locations"))}_getNoResultFoundMessage(e){return e&&w("generic.noResult","No results for '{0}'",e.word)||""}_getGoToPreference(e){var t;return(t=this._gotoMultipleBehaviour)!==null&&t!==void 0?t:e.getOption(58).multipleReferences}_getAlternativeCommand(){return""}}Dn.registerCommand({id:"editor.action.goToLocations",metadata:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:At},{name:"position",description:"The position at which to start",constraint:ae.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:async(i,e,t,n,r,o,s)=>{Xn(At.isUri(e)),Xn(ae.isIPosition(t)),Xn(Array.isArray(n)),Xn(typeof r>"u"||typeof r=="string"),Xn(typeof s>"u"||typeof s=="boolean");const a=i.get(Un),l=await a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(qf(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(c=>{const u=new class extends sit{_getNoResultFoundMessage(d){return o||super._getNoResultFoundMessage(d)}}({muteMessage:!o,openInPeek:!!s,openToSide:!1},n,r);c.get(Ot).invokeFunction(u.run.bind(u),l)})}});Dn.registerCommand({id:"editor.action.peekLocations",metadata:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:At},{name:"position",description:"The position at which to start",constraint:ae.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:async(i,e,t,n,r)=>{i.get(sr).executeCommand("editor.action.goToLocations",e,t,n,r,void 0,!0)}});Dn.registerCommand({id:"editor.action.findReferences",handler:(i,e,t)=>{Xn(At.isUri(e)),Xn(ae.isIPosition(t));const n=i.get(_t),r=i.get(Un);return r.openCodeEditor({resource:e},r.getFocusedCodeEditor()).then(o=>{if(!qf(o)||!o.hasModel())return;const s=a_.get(o);if(!s)return;const a=Io(c=>W3(n.referenceProvider,o.getModel(),ae.lift(t),!1,c).then(u=>new El(u,w("ref.title","References")))),l=new B(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(s.toggleWidget(l,a,!1))})}});Dn.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");var ait=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},k9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},$L;let Kb=$L=class{constructor(e,t,n,r){this.textModelResolverService=t,this.languageService=n,this.languageFeaturesService=r,this.toUnhook=new Te,this.toUnhookForKeyboard=new Te,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const o=new M3(e);this.toUnhook.add(o),this.toUnhook.add(o.onMouseMoveOrRelevantKeyDown(([s,a])=>{this.startFindDefinitionFromMouse(s,a??void 0)})),this.toUnhook.add(o.onExecute(s=>{this.isEnabled(s)&&this.gotoDefinition(s.target.position,s.hasSideBySideModifier).catch(a=>{en(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(o.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution($L.ID)}async startFindDefinitionFromCursor(e){await this.startFindDefinition(e),this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()})),this.toUnhookForKeyboard.add(this.editor.onKeyDown(t=>{t&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())}))}startFindDefinitionFromMouse(e,t){if(e.target.type===9&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t)){this.currentWordAtPosition=null,this.removeLinkDecorations();return}const n=e.target.position;this.startFindDefinition(n)}async startFindDefinition(e){var t;this.toUnhookForKeyboard.clear();const n=e?(t=this.editor.getModel())===null||t===void 0?void 0:t.getWordAtPosition(e):null;if(!n){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===n.startColumn&&this.currentWordAtPosition.endColumn===n.endColumn&&this.currentWordAtPosition.word===n.word)return;this.currentWordAtPosition=n;const r=new tbe(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=Io(a=>this.findDefinition(e,a));let o;try{o=await this.previousPromise}catch(a){en(a);return}if(!o||!o.length||!r.validate(this.editor)){this.removeLinkDecorations();return}const s=o[0].originSelectionRange?B.lift(o[0].originSelectionRange):new B(e.lineNumber,n.startColumn,e.lineNumber,n.endColumn);if(o.length>1){let a=s;for(const{originSelectionRange:l}of o)l&&(a=B.plusRange(a,l));this.addDecoration(a,new Is().appendText(w("multipleResults","Click to show {0} definitions.",o.length)))}else{const a=o[0];if(!a.uri)return;this.textModelResolverService.createModelReference(a.uri).then(l=>{if(!l.object||!l.object.textEditorModel){l.dispose();return}const{object:{textEditorModel:c}}=l,{startLineNumber:u}=a.range;if(u<1||u>c.getLineCount()){l.dispose();return}const d=this.getPreviewValue(c,u,a),h=this.languageService.guessLanguageIdByFilepathOrFirstLine(c.uri);this.addDecoration(s,d?new Is().appendCodeblock(h||"",d):void 0),l.dispose()})}}getPreviewValue(e,t,n){let r=n.range;return r.endLineNumber-r.startLineNumber>=$L.MAX_SOURCE_PREVIEW_LINES&&(r=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,r)}stripIndentationFromPreviewRange(e,t,n){let o=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a{const r=!t&&this.editor.getOption(88)&&!this.isInPeekEditor(n);return new gT({openToSide:t,openInPeek:r,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(n)})}isInPeekEditor(e){const t=e.get(Vt);return il.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};Kb.ID="editor.contrib.gotodefinitionatposition";Kb.MAX_SOURCE_PREVIEW_LINES=8;Kb=$L=ait([k9(1,ol),k9(2,ji),k9(3,_t)],Kb);jn(Kb.ID,Kb,2);let lit=class{constructor(e,t,n){this.value=e,this.isComplete=t,this.hasLoadingMessage=n}};class WCe extends fe{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new se),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new pi(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new pi(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new pi(()=>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(60).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=gBe(e=>this._computer.computeAsync(e)),(async()=>{try{for await(const e of this._asyncIterable)e&&(this._result.push(e),this._fireResult());this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0)}catch(e){en(e)}})()):this._asyncIterableDone=!0}_triggerSyncComputation(){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync())),this._setState(this._asyncIterableDone?0:3)}_triggerLoadingMessage(){this._state===3&&this._setState(4)}_fireResult(){if(this._state===1||this._state===2)return;const e=this._state===0,t=this._state===4;this._onResult.fire(new lit(this._result.slice(0),e,t))}start(e){if(e===0)this._state===0&&(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();break}}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 T9{constructor(e,t,n,r){this.priority=e,this.range=t,this.initialMousePosX=n,this.initialMousePosY=r,this.type=1}equals(e){return e.type===1&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===1&&t.lineNumber===this.range.startLineNumber}}class cb{constructor(e,t,n,r,o,s){this.priority=e,this.owner=t,this.range=n,this.initialMousePosX=r,this.initialMousePosY=o,this.supportsMarkerHover=s,this.type=2}equals(e){return e.type===2&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===2&&this.owner===e.owner}}const A_=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class VY{constructor(){this._onDidWillResize=new se,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new se,this.onDidResize=this._onDidResize.event,this._sashListener=new Te,this._size=new Kn(0,0),this._minSize=new Kn(0,0),this._maxSize=new Kn(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new Ls(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new Ls(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new Ls(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:zP.North}),this._southSash=new Ls(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:zP.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let e,t=0,n=0;this._sashListener.add(Je.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,n=0)})),this._sashListener.add(Je.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,n=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(r=>{e&&(n=r.currentX-r.startX,this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(r=>{e&&(n=-(r.currentX-r.startX),this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(r=>{e&&(t=-(r.currentY-r.startY),this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(r=>{e&&(t=r.currentY-r.startY,this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(Je.any(this._eastSash.onDidReset,this._westSash.onDidReset)(r=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(Je.any(this._northSash.onDidReset,this._southSash.onDidReset)(r=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,n,r){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=n?3:0,this._westSash.state=r?3:0}layout(e=this.size.height,t=this.size.width){const{height:n,width:r}=this._minSize,{height:o,width:s}=this._maxSize;e=Math.max(n,Math.min(o,e)),t=Math.max(r,Math.min(s,t));const a=new Kn(t,e);Kn.equals(a,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=a,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}}const cit=30,uit=24;class dit extends fe{constructor(e,t=new Kn(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new VY),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=Kn.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(n=>{this._resize(new Kn(n.dimension.width,n.dimension.height)),n.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){var e;return!((e=this._contentPosition)===null||e===void 0)&&e.position?ae.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);return!t||!n?void 0:Br(t).top+n.top-cit}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);if(!t||!n)return;const r=Br(t),o=Tp(t.ownerDocument.body),s=r.top+n.top+n.height;return o.height-s-uit}_findPositionPreference(e,t){var n,r;const o=Math.min((n=this._availableVerticalSpaceBelow(t))!==null&&n!==void 0?n:1/0,e),s=Math.min((r=this._availableVerticalSpaceAbove(t))!==null&&r!==void 0?r:1/0,e),a=Math.min(Math.max(s,o),e),l=Math.min(e,a);let c;return this._editor.getOption(60).above?c=l<=s?1:2:c=l<=o?2:1,c===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),c}_resize(e){this._resizableNode.layout(e.height,e.width)}}var zY=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},K0=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},BM,qh;const Iae=He;let mO=BM=class extends fe{constructor(e,t,n){super(),this._editor=e,this._instantiationService=t,this._keybindingService=n,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(kv,this._editor)),this._participants=[];for(const r of A_.getAll())this._participants.push(this._instantiationService.createInstance(r,this._editor));this._participants.sort((r,o)=>r.hoverOrdinal-o.hoverOrdinal),this._computer=new _O(this._editor,this._participants),this._hoverOperation=this._register(new WCe(this._editor,this._computer)),this._register(this._hoverOperation.onResult(r=>{if(!this._computer.anchor)return;const o=r.hasLoadingMessage?this._addLoadingMessage(r.value):r.value;this._withResult(new $Ce(this._computer.anchor,o,r.isComplete))})),this._register(Sr(this._widget.getDomNode(),"keydown",r=>{r.equals(9)&&this.hide()})),this._register(hr.onDidChange(()=>{this._widget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))}_startShowingOrUpdateHover(e,t,n,r,o){return!this._widget.position||!this._currentResult?e?(this._startHoverOperationIfNecessary(e,t,n,r,!1),!0):!1:this._editor.getOption(60).sticky&&o&&this._widget.isMouseGettingCloser(o.event.posx,o.event.posy)?(e&&this._startHoverOperationIfNecessary(e,t,n,r,!0),!0):e?e&&this._currentResult.anchor.equals(e)?!0:e.canAdoptVisibleHover(this._currentResult.anchor,this._widget.position)?(this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,n,r,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,n,r,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,n,r,o){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=r,this._computer.source=n,this._computer.insistOnKeepingHoverVisible=o,this._hoverOperation.start(t))}_setCurrentResult(e){this._currentResult!==e&&(e&&e.messages.length===0&&(e=null),this._currentResult=e,this._currentResult?this._renderMessages(this._currentResult.anchor,this._currentResult.messages):this._widget.hide())}_addLoadingMessage(e){if(this._computer.anchor){for(const t of this._participants)if(t.createLoadingMessage){const n=t.createLoadingMessage(this._computer.anchor);if(n)return e.slice(0).concat([n])}}return e}_withResult(e){this._widget.position&&this._currentResult&&this._currentResult.isComplete&&(!e.isComplete||this._computer.insistOnKeepingHoverVisible&&e.messages.length===0)||this._setCurrentResult(e)}_renderMessages(e,t){const{showAtPosition:n,showAtSecondaryPosition:r,highlightRange:o}=BM.computeHoverRanges(this._editor,e.range,t),s=new Te,a=s.add(new vO(this._keybindingService)),l=document.createDocumentFragment();let c=null;const u={fragment:l,statusBar:a,setColorPicker:h=>c=h,onContentsChanged:()=>this._widget.onContentsChanged(),setMinimumDimensions:h=>this._widget.setMinimumDimensions(h),hide:()=>this.hide()};for(const h of this._participants){const f=t.filter(g=>g.owner===h);f.length>0&&s.add(h.renderHoverParts(u,f))}const d=t.some(h=>h.isBeforeContent);if(a.hasContent&&l.appendChild(a.hoverElement),l.hasChildNodes()){if(o){const h=this._editor.createDecorationsCollection();h.set([{range:o,options:BM._DECORATION_OPTIONS}]),s.add(Rt(()=>{h.clear()}))}this._widget.showAt(l,new fit(e.initialMousePosX,e.initialMousePosY,c,n,r,this._editor.getOption(60).above,this._computer.shouldFocus,this._computer.source,d,s))}else s.dispose()}static computeHoverRanges(e,t,n){let r=1;if(e.hasModel()){const d=e._getViewModel(),h=d.coordinatesConverter,f=h.convertModelRangeToViewRange(t),g=new ae(f.startLineNumber,d.getLineMinColumn(f.startLineNumber));r=h.convertViewPositionToModelPosition(g).column}const o=t.startLineNumber;let s=t.startColumn,a=n[0].range,l=null;for(const d of n)a=B.plusRange(a,d.range),d.range.startLineNumber===o&&d.range.endLineNumber===o&&(s=Math.max(Math.min(s,d.range.startColumn),r)),d.forceShowAtRange&&(l=d.range);const c=l?l.getStartPosition():new ae(o,t.startColumn),u=l?l.getStartPosition():new ae(o,s);return{showAtPosition:c,showAtSecondaryPosition:u,highlightRange:a}}showsOrWillShow(e){if(this._widget.isResizing)return!0;const t=[];for(const r of this._participants)if(r.suggestHoverAnchor){const o=r.suggestHoverAnchor(e);o&&t.push(o)}const n=e.target;if(n.type===6&&t.push(new T9(0,n.range,e.event.posx,e.event.posy)),n.type===7){const r=this._editor.getOption(50).typicalHalfwidthCharacterWidth/2;!n.detail.isAfterLines&&typeof n.detail.horizontalDistanceToText=="number"&&n.detail.horizontalDistanceToTexto.priority-r.priority),this._startShowingOrUpdateHover(t[0],0,0,!1,e))}startShowingAtRange(e,t,n,r){this._startShowingOrUpdateHover(new T9(0,e,void 0,void 0),t,n,r,null)}containsNode(e){return e?this._widget.getDomNode().contains(e):!1}focus(){this._widget.focus()}scrollUp(){this._widget.scrollUp()}scrollDown(){this._widget.scrollDown()}scrollLeft(){this._widget.scrollLeft()}scrollRight(){this._widget.scrollRight()}pageUp(){this._widget.pageUp()}pageDown(){this._widget.pageDown()}goToTop(){this._widget.goToTop()}goToBottom(){this._widget.goToBottom()}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}get isColorPickerVisible(){return this._widget.isColorPickerVisible}get isVisibleFromKeyboard(){return this._widget.isVisibleFromKeyboard}get isVisible(){return this._widget.isVisible}get isFocused(){return this._widget.isFocused}get isResizing(){return this._widget.isResizing}get widget(){return this._widget}};mO._DECORATION_OPTIONS=sn.register({description:"content-hover-highlight",className:"hoverHighlight"});mO=BM=zY([K0(1,Ot),K0(2,ci)],mO);class $Ce{constructor(e,t,n){this.anchor=e,this.messages=t,this.isComplete=n}filter(e){const t=this.messages.filter(n=>n.isValidForHoverAnchor(e));return t.length===this.messages.length?this:new hit(this,this.anchor,t,this.isComplete)}}class hit extends $Ce{constructor(e,t,n,r){super(t,n,r),this.original=e}filter(e){return this.original.filter(e)}}class fit{constructor(e,t,n,r,o,s,a,l,c,u){this.initialMousePosX=e,this.initialMousePosY=t,this.colorPicker=n,this.showAtPosition=r,this.showAtSecondaryPosition=o,this.preferAbove=s,this.stoleFocus=a,this.source=l,this.isBeforeContent=c,this.disposables=u,this.closestMouseDistance=void 0}}const kae=30,N9=10,git=6;let kv=qh=class extends dit{get isColorPickerVisible(){var e;return!!(!((e=this._visibleData)===null||e===void 0)&&e.colorPicker)}get isVisibleFromKeyboard(){var e;return((e=this._visibleData)===null||e===void 0?void 0:e.source)===1}get isVisible(){var e;return(e=this._hoverVisibleKey.get())!==null&&e!==void 0?e:!1}get isFocused(){var e;return(e=this._hoverFocusedKey.get())!==null&&e!==void 0?e:!1}constructor(e,t,n,r,o){const s=e.getOption(67)+8,a=150,l=new Kn(a,s);super(e,l),this._configurationService=n,this._accessibilityService=r,this._keybindingService=o,this._hover=this._register(new TX),this._minimumSize=l,this._hoverVisibleKey=j.hoverVisible.bindTo(t),this._hoverFocusedKey=j.hoverFocused.bindTo(t),ke(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._register(this._editor.onDidLayoutChange(()=>{this.isVisible&&this._updateMaxDimensions()})),this._register(this._editor.onDidChangeConfiguration(u=>{u.hasChanged(50)&&this._updateFont()}));const c=this._register(dh(this._resizableNode.domNode));this._register(c.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(c.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._setHoverData(void 0),this._editor.addContentWidget(this)}dispose(){var e;super.dispose(),(e=this._visibleData)===null||e===void 0||e.disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return qh.ID}static _applyDimensions(e,t,n){const r=typeof t=="number"?`${t}px`:t,o=typeof n=="number"?`${n}px`:n;e.style.width=r,e.style.height=o}_setContentsDomNodeDimensions(e,t){const n=this._hover.contentsDomNode;return qh._applyDimensions(n,e,t)}_setContainerDomNodeDimensions(e,t){const n=this._hover.containerDomNode;return qh._applyDimensions(n,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,n){const r=typeof t=="number"?`${t}px`:t,o=typeof n=="number"?`${n}px`:n;e.style.maxWidth=r,e.style.maxHeight=o}_setHoverWidgetMaxDimensions(e,t){qh._applyMaxDimensions(this._hover.contentsDomNode,e,t),qh._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?`${e}px`:e),this._layoutContentWidget()}_hasHorizontalScrollbar(){const e=this._hover.scrollbar.getScrollDimensions();return e.scrollWidth>e.width}_adjustContentsBottomPadding(){const e=this._hover.contentsDomNode,t=`${this._hover.scrollbar.options.horizontalScrollbarSize}px`;e.style.paddingBottom!==t&&(e.style.paddingBottom=t)}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none");const t=e.width,n=e.height;this._setHoverWidgetDimensions(t,n),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._setContentsDomNodeDimensions(t,n-N9))}_updateResizableNodeMaxDimensions(){var e,t;const n=(e=this._findMaximumRenderingWidth())!==null&&e!==void 0?e:1/0,r=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._resizableNode.maxSize=new Kn(n,r),this._setHoverWidgetMaxDimensions(n,r)}_resize(e){var t,n;qh._lastDimensions=new Kn(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),(n=(t=this._visibleData)===null||t===void 0?void 0:t.colorPicker)===null||n===void 0||n.layout()}_findAvailableSpaceVertically(){var e;const t=(e=this._visibleData)===null||e===void 0?void 0:e.showAtPosition;if(t)return this._positionPreference===1?this._availableVerticalSpaceAbove(t):this._availableVerticalSpaceBelow(t)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let t=git;return Array.from(this._hover.contentsDomNode.children).forEach(n=>{t+=n.clientHeight}),this._hasHorizontalScrollbar()&&(t+=N9),Math.min(e,t)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const e=Array.from(this._hover.contentsDomNode.children).some(t=>t.scrollWidth>t.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const e=this._isHoverTextOverflowing(),t=typeof this._contentWidth>"u"?0:this._contentWidth-2;return e||this._hover.containerDomNode.clientWidth"u"||typeof this._visibleData.initialMousePosY>"u")return this._visibleData.initialMousePosX=e,this._visibleData.initialMousePosY=t,!1;const n=Br(this.getDomNode());typeof this._visibleData.closestMouseDistance>"u"&&(this._visibleData.closestMouseDistance=Tae(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,n.left,n.top,n.width,n.height));const r=Tae(e,t,n.left,n.top,n.width,n.height);return r>this._visibleData.closestMouseDistance+4?!1:(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,r),!0)}_setHoverData(e){var t;(t=this._visibleData)===null||t===void 0||t.disposables.dispose(),this._visibleData=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_updateFont(){const{fontSize:e,lineHeight:t}=this._editor.getOption(50),n=this._hover.contentsDomNode;n.style.fontSize=`${e}px`,n.style.lineHeight=`${t/e}`,Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(o=>this._editor.applyFontInfo(o))}_updateContent(e){const t=this._hover.contentsDomNode;t.style.paddingBottom="",t.textContent="",t.appendChild(e)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){const e=Math.max(this._editor.getLayoutInfo().height/4,250,qh._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,qh._lastDimensions.width);this._setHoverWidgetMaxDimensions(t,e)}_render(e,t){this._setHoverData(t),this._updateFont(),this._updateContent(e),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){var e;return this._visibleData?{position:this._visibleData.showAtPosition,secondaryPosition:this._visibleData.showAtSecondaryPosition,positionAffinity:this._visibleData.isBeforeContent?3:void 0,preference:[(e=this._positionPreference)!==null&&e!==void 0?e:1]}:null}showAt(e,t){var n,r,o,s;if(!this._editor||!this._editor.hasModel())return;this._render(e,t);const a=qg(this._hover.containerDomNode),l=t.showAtPosition;this._positionPreference=(n=this._findPositionPreference(a,l))!==null&&n!==void 0?n:1,this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),(r=t.colorPicker)===null||r===void 0||r.layout();const u=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&y_e(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(s=(o=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||o===void 0?void 0:o.getAriaLabel())!==null&&s!==void 0?s:"");u&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+u)}hide(){if(!this._visibleData)return;const e=this._visibleData.stoleFocus||this._hoverFocusedKey.get();this._setHoverData(void 0),this._resizableNode.maxSize=new Kn(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){const e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions("auto","auto")}_adjustHoverHeightForScrollbar(e){var t;const n=this._hover.containerDomNode,r=this._hover.contentsDomNode,o=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._setContainerDomNodeDimensions(ua(n),Math.min(o,e)),this._setContentsDomNodeDimensions(ua(r),Math.min(o,e-N9))}setMinimumDimensions(e){this._minimumSize=new Kn(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=typeof this._contentWidth>"u"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new Kn(e,this._minimumSize.height)}onContentsChanged(){var e;this._removeConstraintsRenderNormally();const t=this._hover.containerDomNode;let n=qg(t),r=ua(t);if(this._resizableNode.layout(n,r),this._setHoverWidgetDimensions(r,n),n=qg(t),r=ua(t),this._contentWidth=r,this._updateMinimumWidth(),this._resizableNode.layout(n,r),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._adjustHoverHeightForScrollbar(n)),!((e=this._visibleData)===null||e===void 0)&&e.showAtPosition){const o=qg(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(o,this._visibleData.showAtPosition)}this._layoutContentWidget()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-kae})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+kae})}pageUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e-t})}pageDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e+t})}goToTop(){this._hover.scrollbar.setScrollPosition({scrollTop:0})}goToBottom(){this._hover.scrollbar.setScrollPosition({scrollTop:this._hover.scrollbar.getScrollDimensions().scrollHeight})}};kv.ID="editor.contrib.resizableContentHoverWidget";kv._lastDimensions=new Kn(0,0);kv=qh=zY([K0(1,Vt),K0(2,gn),K0(3,ud),K0(4,ci)],kv);let vO=class extends fe{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=Iae("div.hover-row.status-bar"),this.actionsElement=ke(this.hoverElement,Iae("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),n=t?t.getLabel():null;return this._hasContent=!0,this._register(G4.render(this.actionsElement,e,n))}append(e){const t=ke(this.actionsElement,e);return this._hasContent=!0,t}};vO=zY([K0(0,ci)],vO);class _O{get anchor(){return this._anchor}set anchor(e){this._anchor=e}get shouldFocus(){return this._shouldFocus}set shouldFocus(e){this._shouldFocus=e}get source(){return this._source}set source(e){this._source=e}get insistOnKeepingHoverVisible(){return this._insistOnKeepingHoverVisible}set insistOnKeepingHoverVisible(e){this._insistOnKeepingHoverVisible=e}constructor(e,t){this._editor=e,this._participants=t,this._anchor=null,this._shouldFocus=!1,this._source=0,this._insistOnKeepingHoverVisible=!1}static _getLineDecorations(e,t){if(t.type!==1&&!t.supportsMarkerHover)return[];const n=e.getModel(),r=t.range.startLineNumber;if(r>n.getLineCount())return[];const o=n.getLineMaxColumn(r);return e.getLineDecorations(r).filter(s=>{if(s.options.isWholeLine)return!0;const a=s.range.startLineNumber===r?s.range.startColumn:1,l=s.range.endLineNumber===r?s.range.endColumn:o;if(s.options.showIfCollapsed){if(a>t.range.startColumn+1||t.range.endColumn-1>l)return!1}else if(a>t.range.startColumn||t.range.endColumn>l)return!1;return!0})}computeAsync(e){const t=this._anchor;if(!this._editor.hasModel()||!t)return Kr.EMPTY;const n=_O._getLineDecorations(this._editor,t);return Kr.merge(this._participants.map(r=>r.computeAsync?r.computeAsync(t,n,e):Kr.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=_O._getLineDecorations(this._editor,this._anchor);let t=[];for(const n of this._participants)t=t.concat(n.computeSync(this._anchor,e));return lh(t)}}function Tae(i,e,t,n,r,o){const s=t+r/2,a=n+o/2,l=Math.max(Math.abs(i-s)-r/2,0),c=Math.max(Math.abs(e-a)-o/2,0);return Math.sqrt(l*l+c*c)}const Nae=He;class ew extends fe{constructor(e,t,n){super(),this._renderDisposeables=this._register(new Te),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new TX),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new Uf({editor:this._editor},t,n)),this._computer=new pit(this._editor),this._hoverOperation=this._register(new WCe(this._editor,this._computer)),this._register(this._hoverOperation.onResult(r=>{this._withResult(r.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(50)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return ew.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_onModelDecorationsChanged(){this._isVisible&&(this._hoverOperation.cancel(),this._hoverOperation.start(0))}startShowingAt(e,t){this._computer.lineNumber===e&&this._computer.lane===t||(this._hoverOperation.cancel(),this.hide(),this._computer.lineNumber=e,this._computer.lane=t,this._hoverOperation.start(0))}hide(){this._computer.lineNumber=-1,this._hoverOperation.cancel(),this._isVisible&&(this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible))}_withResult(e){this._messages=e,this._messages.length>0?this._renderMessages(this._computer.lineNumber,this._messages):this.hide()}_renderMessages(e,t){this._renderDisposeables.clear();const n=document.createDocumentFragment();for(const r of t){const o=Nae("div.hover-row.markdown-hover"),s=ke(o,Nae("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(r.value));s.appendChild(a.element),n.appendChild(o)}this._updateContents(n),this._showAt(e)}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}_showAt(e){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const t=this._editor.getLayoutInfo(),n=this._editor.getTopForLineNumber(e),r=this._editor.getScrollTop(),o=this._editor.getOption(67),s=this._hover.containerDomNode.clientHeight,a=n-r-(s-o)/2,l=t.glyphMarginLeft+t.glyphMarginWidth+(this._computer.lane==="lineNo"?t.lineNumbersWidth:0);this._hover.containerDomNode.style.left=`${l}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(a),0)}px`}}ew.ID="editor.contrib.modesGlyphHoverWidget";class pit{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}get lane(){return this._laneOrLine}set lane(e){this._laneOrLine=e}constructor(e){this._editor=e,this._lineNumber=-1,this._laneOrLine=$f.Center}computeSync(){var e,t;const n=a=>({value:a}),r=this._editor.getLineDecorations(this._lineNumber),o=[],s=this._laneOrLine==="lineNo";if(!r)return o;for(const a of r){const l=(t=(e=a.options.glyphMargin)===null||e===void 0?void 0:e.position)!==null&&t!==void 0?t:$f.Center;if(!s&&l!==this._laneOrLine)continue;const c=s?a.options.lineNumberHoverMessage:a.options.glyphMarginHoverMessage;!c||Hw(c)||o.push(...eq(c).map(n))}return o}}class mit{constructor(e,t,n){this.provider=e,this.hover=t,this.ordinal=n}}async function vit(i,e,t,n,r){try{const o=await Promise.resolve(i.provideHover(t,n,r));if(o&&bit(o))return new mit(i,o,e)}catch(o){Zr(o)}}function UY(i,e,t,n){const o=i.ordered(e).map((s,a)=>vit(s,a,e,t,n));return Kr.fromPromises(o).coalesce()}function _it(i,e,t,n){return UY(i,e,t,n).map(r=>r.hover).toPromise()}tg("_executeHoverProvider",(i,e,t)=>{const n=i.get(_t);return _it(n.hoverProvider,e,t,Cn.None)});function bit(i){const e=typeof i.range<"u",t=typeof i.contents<"u"&&i.contents&&i.contents.length>0;return e&&t}var Cit=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},QR=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Rae=He;class jd{constructor(e,t,n,r,o){this.owner=e,this.range=t,this.contents=n,this.isBeforeContent=r,this.ordinal=o}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let bO=class{constructor(e,t,n,r,o){this._editor=e,this._languageService=t,this._openerService=n,this._configurationService=r,this._languageFeaturesService=o,this.hoverOrdinal=3}createLoadingMessage(e){return new jd(this,e.range,[new Is().appendText(w("modesContentHover.loading","Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const n=this._editor.getModel(),r=e.range.startLineNumber,o=n.getLineMaxColumn(r),s=[];let a=1e3;const l=n.getLineLength(r),c=n.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),u=this._editor.getOption(117),d=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:c});let h=!1;u>=0&&l>u&&e.range.startColumn>=u&&(h=!0,s.push(new jd(this,e.range,[{value:w("stopped rendering","Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!h&&typeof d=="number"&&l>=d&&s.push(new jd(this,e.range,[{value:w("too many characters","Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,a++));let f=!1;for(const g of t){const p=g.range.startLineNumber===r?g.range.startColumn:1,v=g.range.endLineNumber===r?g.range.endColumn:o,m=g.options.hoverMessage;if(!m||Hw(m))continue;g.options.beforeContentClassName&&(f=!0);const _=new B(e.range.startLineNumber,p,e.range.startLineNumber,v);s.push(new jd(this,_,eq(m),f,a++))}return s}computeAsync(e,t,n){if(!this._editor.hasModel()||e.type!==1)return Kr.EMPTY;const r=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(r))return Kr.EMPTY;const o=new ae(e.range.startLineNumber,e.range.startColumn);return UY(this._languageFeaturesService.hoverProvider,r,o,n).filter(s=>!Hw(s.hover.contents)).map(s=>{const a=s.hover.range?B.lift(s.hover.range):e.range;return new jd(this,a,s.hover.contents,!1,s.ordinal)})}renderHoverParts(e,t){return HCe(e,t,this._editor,this._languageService,this._openerService)}};bO=Cit([QR(1,ji),QR(2,al),QR(3,gn),QR(4,_t)],bO);function HCe(i,e,t,n,r){e.sort((s,a)=>s.ordinal-a.ordinal);const o=new Te;for(const s of e)for(const a of s.contents){if(Hw(a))continue;const l=Rae("div.hover-row.markdown-hover"),c=ke(l,Rae("div.hover-contents")),u=o.add(new Uf({editor:t},n,r));o.add(u.onDidRenderAsync(()=>{c.className="hover-contents code-hover-contents",i.onContentsChanged()}));const d=o.add(u.render(a));c.appendChild(d.element),i.fragment.appendChild(l)}return o}var VCe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},CO=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class Mae{constructor(e,t,n){this.marker=e,this.index=t,this.total=n}}let Qz=class{constructor(e,t,n){this._markerService=t,this._configService=n,this._onDidChange=new se,this.onDidChange=this._onDidChange.event,this._dispoables=new Te,this._markers=[],this._nextIdx=-1,At.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const r=this._configService.getValue("problems.sortOrder"),o=(a,l)=>{let c=LD(a.resource.toString(),l.resource.toString());return c===0&&(r==="position"?c=B.compareRangesUsingStarts(a,l)||pr.compare(a.severity,l.severity):c=pr.compare(a.severity,l.severity)||B.compareRangesUsingStarts(a,l)),c},s=()=>{this._markers=this._markerService.read({resource:At.isUri(e)?e:void 0,severities:pr.Error|pr.Warning|pr.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(o)};s(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(l=>this._resourceFilter(l)))&&(s(),this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e?!0:!this._resourceFilter||!e?!1:this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new Mae(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,n){let r=!1,o=this._markers.findIndex(s=>s.resource.toString()===e.uri.toString());o<0&&(o=_D(this._markers,{resource:e.uri},(s,a)=>LD(s.resource.toString(),a.resource.toString())),o<0&&(o=~o));for(let s=o;sr.resource.toString()===e.toString());if(!(n<0)){for(;n=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},r1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},tU;class wit{constructor(e,t,n,r,o){this._openerService=r,this._labelService=o,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new Te,this._editor=t;const s=document.createElement("div");s.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),s.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),s.appendChild(this._relatedBlock),this._disposables.add(Sr(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&n(l)})),this._scrollable=new pve(s,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{s.style.left=`-${a.scrollLeft}px`,s.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){si(this._disposables)}update(e){const{source:t,message:n,relatedInformation:r,code:o}=e;let s=((t==null?void 0:t.length)||0)+2;o&&(typeof o=="string"?s+=o.length:s+=o.value.length);const a=Jf(n);this._lines=a.length,this._longestLineLength=0;for(const h of a)this._longestLineLength=Math.max(h.length+s,this._longestLineLength);Ns(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const h of a)l=document.createElement("div"),l.innerText=h,h===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||o){const h=document.createElement("span");if(h.classList.add("details"),l.appendChild(h),t){const f=document.createElement("span");f.innerText=t,f.classList.add("source"),h.appendChild(f)}if(o)if(typeof o=="string"){const f=document.createElement("span");f.innerText=`(${o})`,f.classList.add("code"),h.appendChild(f)}else{this._codeLink=He("a.code-link"),this._codeLink.setAttribute("href",`${o.target.toString()}`),this._codeLink.onclick=g=>{this._openerService.open(o.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()};const f=ke(this._codeLink,He("span"));f.innerText=o.value,h.appendChild(this._codeLink)}}if(Ns(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),Ts(r)){const h=this._relatedBlock.appendChild(document.createElement("div"));h.style.paddingTop=`${Math.floor(this._editor.getOption(67)*.66)}px`,this._lines+=1;for(const f of r){const g=document.createElement("div"),p=document.createElement("a");p.classList.add("filename"),p.innerText=`${this._labelService.getUriBasenameLabel(f.resource)}(${f.startLineNumber}, ${f.startColumn}): `,p.title=this._labelService.getUriLabel(f.resource),this._relatedDiagnostics.set(p,f);const v=document.createElement("span");v.innerText=f.message,g.appendChild(p),g.appendChild(v),this._lines+=1,h.appendChild(g)}}const c=this._editor.getOption(50),u=Math.ceil(c.typicalFullwidthCharacterWidth*this._longestLineLength*.75),d=c.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:u,scrollHeight:d})}layout(e,t){this._scrollable.getDomNode().style.height=`${e}px`,this._scrollable.getDomNode().style.width=`${t}px`,this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case pr.Error:t=w("Error","Error");break;case pr.Warning:t=w("Warning","Warning");break;case pr.Info:t=w("Info","Info");break;case pr.Hint:t=w("Hint","Hint");break}let n=w("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const r=this._editor.getModel();return r&&e.startLineNumber<=r.getLineCount()&&e.startLineNumber>=1&&(n=`${r.getLineContent(e.startLineNumber)}, ${n}`),n}}let tS=tU=class extends pO{constructor(e,t,n,r,o,s,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},o),this._themeService=t,this._openerService=n,this._menuService=r,this._contextKeyService=s,this._labelService=a,this._callOnDispose=new Te,this._onDidSelectRelatedInformation=new se,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=pr.Warning,this._backgroundColor=me.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(Eit);let t=nU,n=Sit;this._severity===pr.Warning?(t=WM,n=xit):this._severity===pr.Info&&(t=iU,n=Lit);const r=e.getColor(t),o=e.getColor(n);this.style({arrowColor:r,frameColor:r,headerBackgroundColor:o,primaryHeadingColor:e.getColor(kCe),secondaryHeadingColor:e.getColor(TCe)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(e){super._fillHead(e),this._disposables.add(this._actionbarWidget.actionRunner.onWillRun(r=>this.editor.focus()));const t=[],n=this._menuService.createMenu(tU.TitleMenu,this._contextKeyService);i3(n,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),n.dispose()}_fillTitleIcon(e){this._icon=ke(e,He(""))}_fillBody(e){this._parentContainer=e,e.classList.add("marker-widget"),this._parentContainer.tabIndex=0,this._parentContainer.setAttribute("role","tooltip"),this._container=document.createElement("div"),e.appendChild(this._container),this._message=new wit(this._container,this.editor,t=>this._onDidSelectRelatedInformation.fire(t),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(e,t,n){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const r=B.lift(e),o=this.editor.getPosition(),s=o&&r.containsPosition(o)?o:r.getStartPosition();super.show(s,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=n>1?w("problems","{0} of {1} problems",t,n):w("change","{0} of {1} problem",t,n);this.setTitle(su(a.uri),l)}this._icon.className=`codicon ${eU.className(pr.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(s,0),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}};tS.TitleMenu=new $("gotoErrorTitleMenu");tS=tU=yit([r1(1,To),r1(2,al),r1(3,hu),r1(4,Ot),r1(5,Vt),r1(6,Vw)],tS);const Aae=VD(wf,Y7e),Pae=VD(qs,$D),Oae=VD(Za,HD),nU=X("editorMarkerNavigationError.background",{dark:Aae,light:Aae,hcDark:Sn,hcLight:Sn},w("editorMarkerNavigationError","Editor marker navigation widget error color.")),Sit=X("editorMarkerNavigationError.headerBackground",{dark:It(nU,.1),light:It(nU,.1),hcDark:null,hcLight:null},w("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),WM=X("editorMarkerNavigationWarning.background",{dark:Pae,light:Pae,hcDark:Sn,hcLight:Sn},w("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),xit=X("editorMarkerNavigationWarning.headerBackground",{dark:It(WM,.1),light:It(WM,.1),hcDark:"#0C141F",hcLight:It(WM,.2)},w("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),iU=X("editorMarkerNavigationInfo.background",{dark:Oae,light:Oae,hcDark:Sn,hcLight:Sn},w("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),Lit=X("editorMarkerNavigationInfo.headerBackground",{dark:It(iU,.1),light:It(iU,.1),hcDark:null,hcLight:null},w("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),Eit=X("editorMarkerNavigation.background",{dark:Eo,light:Eo,hcDark:Eo,hcLight:Eo},w("editorMarkerNavigationBackground","Editor marker navigation widget background."));var Dit=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},JR=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},HL;let l_=HL=class{static get(e){return e.getContribution(HL.ID)}constructor(e,t,n,r,o){this._markerNavigationService=t,this._contextKeyService=n,this._editorService=r,this._instantiationService=o,this._sessionDispoables=new Te,this._editor=e,this._widgetVisible=UCe.bindTo(this._contextKeyService)}dispose(){this._cleanUp(),this._sessionDispoables.dispose()}_cleanUp(){this._widgetVisible.reset(),this._sessionDispoables.clear(),this._widget=void 0,this._model=void 0}_getOrCreateModel(e){if(this._model&&this._model.matches(e))return this._model;let t=!1;return this._model&&(t=!0,this._cleanUp()),this._model=this._markerNavigationService.getMarkerList(e),t&&this._model.move(!0,this._editor.getModel(),this._editor.getPosition()),this._widget=this._instantiationService.createInstance(tS,this._editor),this._widget.onDidClose(()=>this.close(),this,this._sessionDispoables),this._widgetVisible.set(!0),this._sessionDispoables.add(this._model),this._sessionDispoables.add(this._widget),this._sessionDispoables.add(this._editor.onDidChangeCursorPosition(n=>{var r,o,s;(!(!((r=this._model)===null||r===void 0)&&r.selected)||!B.containsPosition((o=this._model)===null||o===void 0?void 0:o.selected.marker,n.position))&&((s=this._model)===null||s===void 0||s.resetIndex())})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const n=this._model.find(this._editor.getModel().uri,this._widget.position);n?this._widget.updateMarker(n.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(n=>{this._editorService.openCodeEditor({resource:n.resource,options:{pinned:!0,revealIfOpened:!0,selection:B.lift(n).collapseToStart()}},this._editor),this.close(!1)})),this._sessionDispoables.add(this._editor.onDidChangeModel(()=>this._cleanUp())),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(this._editor.hasModel()){const t=this._getOrCreateModel(this._editor.getModel().uri);t.resetIndex(),t.move(!0,this._editor.getModel(),new ae(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}async nagivate(e,t){var n,r;if(this._editor.hasModel()){const o=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(o.move(e,this._editor.getModel(),this._editor.getPosition()),!o.selected)return;if(o.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const s=await this._editorService.openCodeEditor({resource:o.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:o.selected.marker}},this._editor);s&&((n=HL.get(s))===null||n===void 0||n.close(),(r=HL.get(s))===null||r===void 0||r.nagivate(e,t))}else this._widget.showAtMarker(o.selected.marker,o.selected.index,o.selected.total)}}};l_.ID="editor.contrib.markerController";l_=HL=Dit([JR(1,zCe),JR(2,Vt),JR(3,Un),JR(4,Ot)],l_);class $3 extends gt{constructor(e,t,n){super(n),this._next=e,this._multiFile=t}async run(e,t){var n;t.hasModel()&&((n=l_.get(t))===null||n===void 0||n.nagivate(this._next,this._multiFile))}}class Tv extends $3{constructor(){super(!0,!1,{id:Tv.ID,label:Tv.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:j.focus,primary:578,weight:100},menuOpts:{menuId:tS.TitleMenu,title:Tv.LABEL,icon:Mr("marker-navigation-next",Xe.arrowDown,w("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}Tv.ID="editor.action.marker.next";Tv.LABEL=w("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class ub extends $3{constructor(){super(!1,!1,{id:ub.ID,label:ub.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:j.focus,primary:1602,weight:100},menuOpts:{menuId:tS.TitleMenu,title:ub.LABEL,icon:Mr("marker-navigation-previous",Xe.arrowUp,w("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}ub.ID="editor.action.marker.prev";ub.LABEL=w("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class Iit extends $3{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:w("markerAction.nextInFiles.label","Go to Next Problem in Files (Error, Warning, Info)"),alias:"Go to Next Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:j.focus,primary:66,weight:100},menuOpts:{menuId:$.MenubarGoMenu,title:w({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class kit extends $3{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:w("markerAction.previousInFiles.label","Go to Previous Problem in Files (Error, Warning, Info)"),alias:"Go to Previous Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:j.focus,primary:1090,weight:100},menuOpts:{menuId:$.MenubarGoMenu,title:w({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}jn(l_.ID,l_,4);Be(Tv);Be(ub);Be(Iit);Be(kit);const UCe=new st("markersNavigationVisible",!1),Tit=Vo.bindToContribution(l_.get);et(new Tit({id:"closeMarkersNavigation",precondition:UCe,handler:i=>i.close(),kbOpts:{weight:100+50,kbExpr:j.focus,primary:9,secondary:[1033]}}));var Nit=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},R9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Iu=He;class Rit{constructor(e,t,n){this.owner=e,this.range=t,this.marker=n}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const Fae={type:1,filter:{include:Ut.QuickFix},triggerAction:Tl.QuickFixHover};let rU=class{constructor(e,t,n,r){this._editor=e,this._markerDecorationsService=t,this._openerService=n,this._languageFeaturesService=r,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1&&!e.supportsMarkerHover)return[];const n=this._editor.getModel(),r=e.range.startLineNumber,o=n.getLineMaxColumn(r),s=[];for(const a of t){const l=a.range.startLineNumber===r?a.range.startColumn:1,c=a.range.endLineNumber===r?a.range.endColumn:o,u=this._markerDecorationsService.getMarker(n.uri,a);if(!u)continue;const d=new B(e.range.startLineNumber,l,e.range.startLineNumber,c);s.push(new Rit(this,d,u))}return s}renderHoverParts(e,t){if(!t.length)return fe.None;const n=new Te;t.forEach(o=>e.fragment.appendChild(this.renderMarkerHover(o,n)));const r=t.length===1?t[0]:t.sort((o,s)=>pr.compare(o.marker.severity,s.marker.severity))[0];return this.renderMarkerStatusbar(e,r,n),n}renderMarkerHover(e,t){const n=Iu("div.hover-row"),r=ke(n,Iu("div.marker.hover-contents")),{source:o,message:s,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(r);const c=ke(r,Iu("span"));if(c.style.whiteSpace="pre-wrap",c.innerText=s,o||a)if(a&&typeof a!="string"){const u=Iu("span");if(o){const g=ke(u,Iu("span"));g.innerText=o}const d=ke(u,Iu("a.code-link"));d.setAttribute("href",a.target.toString()),t.add(ye(d,"click",g=>{this._openerService.open(a.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()}));const h=ke(d,Iu("span"));h.innerText=a.value;const f=ke(r,u);f.style.opacity="0.6",f.style.paddingLeft="6px"}else{const u=ke(r,Iu("span"));u.style.opacity="0.6",u.style.paddingLeft="6px",u.innerText=o&&a?`${o}(${a})`:o||`(${a})`}if(Ts(l))for(const{message:u,resource:d,startLineNumber:h,startColumn:f}of l){const g=ke(r,Iu("div"));g.style.marginTop="8px";const p=ke(g,Iu("a"));p.innerText=`${su(d)}(${h}, ${f}): `,p.style.cursor="pointer",t.add(ye(p,"click",m=>{m.stopPropagation(),m.preventDefault(),this._openerService&&this._openerService.open(d,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:h,startColumn:f}}}).catch(en)}));const v=ke(g,Iu("span"));v.innerText=u,this._editor.applyFontInfo(v)}return n}renderMarkerStatusbar(e,t,n){if(t.marker.severity===pr.Error||t.marker.severity===pr.Warning||t.marker.severity===pr.Info){const r=l_.get(this._editor);r&&e.statusBar.addAction({label:w("view problem","View Problem"),commandId:Tv.ID,run:()=>{e.hide(),r.showAtMarker(t.marker),this._editor.focus()}})}if(!this._editor.getOption(91)){const r=e.statusBar.append(Iu("div"));this.recentMarkerCodeActionsInfo&&(HP.makeKey(this.recentMarkerCodeActionsInfo.marker)===HP.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(r.textContent=w("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?fe.None:jv(()=>r.textContent=w("checkingForQuickFixes","Checking for quick fixes..."),200,n);r.textContent||(r.textContent=String.fromCharCode(160));const s=this.getCodeActions(t.marker);n.add(Rt(()=>s.cancel())),s.then(a=>{if(o.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),r.textContent=w("noQuickFixes","No quick fixes available");return}r.style.display="none";let l=!1;n.add(Rt(()=>{l||a.dispose()})),e.statusBar.addAction({label:w("quick fixes","Quick Fix..."),commandId:PY,run:c=>{l=!0;const u=i_.get(this._editor),d=Br(c);e.hide(),u==null||u.showCodeActions(Fae,a,{x:d.left,y:d.top,width:d.width,height:d.height})}})},en)}}getCodeActions(e){return Io(t=>ME(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new B(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),Fae,mp.None,t))}};rU=Nit([R9(1,Gq),R9(2,al),R9(3,_t)],rU);const jCe="editor.action.inlineSuggest.commit",KCe="editor.action.inlineSuggest.showPrevious",GCe="editor.action.inlineSuggest.showNext";var jY=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Kd=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},$M;let oU=class extends fe{constructor(e,t,n){super(),this.editor=e,this.model=t,this.instantiationService=n,this.alwaysShowToolbar=Vi(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=Yt(this,r=>{var o,s,a;const l=(o=this.model.read(r))===null||o===void 0?void 0:o.primaryGhostText.read(r);if(!this.alwaysShowToolbar.read(r)||!l||l.parts.length===0)return this.sessionPosition=void 0,null;const c=l.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==l.lineNumber&&(this.sessionPosition=void 0);const u=new ae(l.lineNumber,Math.min(c,(a=(s=this.sessionPosition)===null||s===void 0?void 0:s.column)!==null&&a!==void 0?a:Number.MAX_SAFE_INTEGER));return this.sessionPosition=u,u}),this._register(Dh((r,o)=>{const s=this.model.read(r);if(!s||!this.alwaysShowToolbar.read(r))return;const a=o.add(this.instantiationService.createInstance(c_,this.editor,!0,this.position,s.selectedInlineCompletionIndex,s.inlineCompletionsCount,s.selectedInlineCompletion.map(l=>{var c;return(c=l==null?void 0:l.inlineCompletion.source.inlineCompletions.commands)!==null&&c!==void 0?c:[]})));e.addContentWidget(a),o.add(Rt(()=>e.removeContentWidget(a))),o.add(bn(l=>{this.position.read(l)&&s.lastTriggerKind.read(l)!==fp.Explicit&&s.triggerExplicitly()}))}))}};oU=jY([Kd(2,Ot)],oU);const Mit=Mr("inline-suggestion-hints-next",Xe.chevronRight,w("parameterHintsNextIcon","Icon for show next parameter hint.")),Ait=Mr("inline-suggestion-hints-previous",Xe.chevronLeft,w("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let c_=$M=class extends fe{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,n){const r=new xl(e,t,n,!0,()=>this._commandService.executeCommand(e)),o=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let s=t;return o&&(s=w({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",t,o.getLabel())),r.tooltip=s,r}constructor(e,t,n,r,o,s,a,l,c,u,d){super(),this.editor=e,this.withBorder=t,this._position=n,this._currentSuggestionIdx=r,this._suggestionCount=o,this._extraCommands=s,this._commandService=a,this.keybindingService=c,this._contextKeyService=u,this._menuService=d,this.id=`InlineSuggestionHintsContentWidget${$M.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=gi("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[gi("div@toolBar")]),this.previousAction=this.createCommandAction(KCe,w("previous","Previous"),Wt.asClassName(Ait)),this.availableSuggestionCountAction=new xl("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(GCe,w("next","Next"),Wt.asClassName(Mit)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu($.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new pi(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new pi(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.lastCommands=[],this.toolBar=this._register(l.createInstance(sU,this.nodes.toolBar,$.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:h=>h.startsWith("primary")},actionViewItemProvider:(h,f)=>{if(h instanceof pc)return l.createInstance(Oit,h,void 0);if(h===this.availableSuggestionCountAction){const g=new Pit(void 0,h,{label:!0,icon:!1});return g.setClass("availableSuggestionCount"),g}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(h=>{$M._dropDownVisible=h})),this._register(bn(h=>{this._position.read(h),this.editor.layoutContentWidget(this)})),this._register(bn(h=>{const f=this._suggestionCount.read(h),g=this._currentSuggestionIdx.read(h);f!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${g+1}/${f}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),f!==void 0&&f>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(bn(h=>{const f=this._extraCommands.read(h);if(or(this.lastCommands,f))return;this.lastCommands=f;const g=f.map(p=>({class:void 0,id:p.id,enabled:!0,tooltip:p.tooltip||"",label:p.title,run:v=>this._commandService.executeCommand(p.id)}));for(const[p,v]of this.inlineCompletionsActionsMenus.getActions())for(const m of v)m instanceof pc&&g.push(m);g.length>0&&g.unshift(new lo),this.toolBar.setAdditionalSecondaryActions(g)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};c_._dropDownVisible=!1;c_.id=0;c_=$M=jY([Kd(6,sr),Kd(7,Ot),Kd(8,ci),Kd(9,Vt),Kd(10,hu)],c_);class Pit extends jw{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}updateTooltip(){}}let Oit=class extends e_{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=gi("div.keybinding").root;new PS(t,yl,{disableTitle:!0,...S0e}).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}updateTooltip(){}},sU=class extends LI{constructor(e,t,n,r,o,s,a,l){super(e,{resetMenu:t,...n},r,o,s,a,l),this.menuId=t,this.options2=n,this.menuService=r,this.contextKeyService=o,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var e,t,n,r,o,s,a;const l=[],c=[];i3(this.menu,(e=this.options2)===null||e===void 0?void 0:e.menuOptions,{primary:l,secondary:c},(n=(t=this.options2)===null||t===void 0?void 0:t.toolbarOptions)===null||n===void 0?void 0:n.primaryGroup,(o=(r=this.options2)===null||r===void 0?void 0:r.toolbarOptions)===null||o===void 0?void 0:o.shouldInlineSubmenu,(a=(s=this.options2)===null||s===void 0?void 0:s.toolbarOptions)===null||a===void 0?void 0:a.useSeparatorsInPrimaryActions),c.push(...this.additionalActions),l.unshift(...this.prependedPrimaryActions),this.setActions(l,c)}setPrependedPrimaryActions(e){or(this.prependedPrimaryActions,e,(t,n)=>t===n)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){or(this.additionalActions,e,(t,n)=>t===n)||(this.additionalActions=e,this.updateToolbar())}};sU=jY([Kd(3,hu),Kd(4,Vt),Kd(5,Ol),Kd(6,ci),Kd(7,ea)],sU);var Fit=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},e2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},aU;const Bit=!1;let rl=aU=class extends fe{constructor(e,t,n,r,o){super(),this._editor=e,this._instantiationService=t,this._openerService=n,this._languageService=r,this._keybindingService=o,this._listenersStore=new Te,this._hoverState={mouseDown:!1,contentHoverFocused:!1,activatedByDecoratorClick:!1},this._reactToEditorMouseMoveRunner=this._register(new pi(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookListeners(),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(60)&&(this._unhookListeners(),this._hookListeners())}))}static get(e){return e.getContribution(aU.ID)}_hookListeners(){const e=this._editor.getOption(60);this._hoverSettings={enabled:e.enabled,sticky:e.sticky,hidingDelay:e.delay},e.enabled?(this._listenersStore.add(this._editor.onMouseDown(t=>this._onEditorMouseDown(t))),this._listenersStore.add(this._editor.onMouseUp(()=>this._onEditorMouseUp())),this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))):(this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))),this._listenersStore.add(this._editor.onMouseLeave(t=>this._onEditorMouseLeave(t))),this._listenersStore.add(this._editor.onDidChangeModel(()=>{this._cancelScheduler(),this._hideWidgets()})),this._listenersStore.add(this._editor.onDidChangeModelContent(()=>this._cancelScheduler())),this._listenersStore.add(this._editor.onDidScrollChange(t=>this._onEditorScrollChanged(t)))}_unhookListeners(){this._listenersStore.clear()}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){var t;this._hoverState.mouseDown=!0;const n=e.target;if(n.type===9&&n.detail===kv.ID){this._hoverState.contentHoverFocused=!0;return}n.type===12&&n.detail===ew.ID||(n.type!==12&&(this._hoverState.contentHoverFocused=!1),!(!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing)&&this._hideWidgets())}_onEditorMouseUp(){this._hoverState.mouseDown=!1}_onEditorMouseLeave(e){var t,n;this._cancelScheduler();const r=e.event.browserEvent.relatedTarget;!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing||!((n=this._contentWidget)===null||n===void 0)&&n.containsNode(r)||this._hideWidgets()}_isMouseOverWidget(e){var t,n,r,o,s;const a=e.target,l=this._hoverSettings.sticky;return!!(l&&a.type===9&&a.detail===kv.ID||l&&(!((t=this._contentWidget)===null||t===void 0)&&t.containsNode((n=e.event.browserEvent.view)===null||n===void 0?void 0:n.document.activeElement))&&!(!((o=(r=e.event.browserEvent.view)===null||r===void 0?void 0:r.getSelection())===null||o===void 0)&&o.isCollapsed)||!l&&a.type===9&&a.detail===kv.ID&&(!((s=this._contentWidget)===null||s===void 0)&&s.isColorPickerVisible)||l&&a.type===12&&a.detail===ew.ID)}_onEditorMouseMove(e){var t,n,r,o;if(this._mouseMoveEvent=e,!((t=this._contentWidget)===null||t===void 0)&&t.isFocused||!((n=this._contentWidget)===null||n===void 0)&&n.isResizing||this._hoverState.mouseDown&&this._hoverState.contentHoverFocused)return;const s=this._hoverSettings.sticky;if(s&&(!((r=this._contentWidget)===null||r===void 0)&&r.isVisibleFromKeyboard))return;if(this._isMouseOverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}const l=this._hoverSettings.hidingDelay;if(!((o=this._contentWidget)===null||o===void 0)&&o.isVisible&&s&&l>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(l);return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){var t,n,r,o;if(!e)return;const s=e.target,a=(t=s.element)===null||t===void 0?void 0:t.classList.contains("colorpicker-color-decoration"),l=this._editor.getOption(147),c=this._hoverSettings.enabled,u=this._hoverState.activatedByDecoratorClick;if(a&&(l==="click"&&!u||l==="hover"&&!c&&!Bit||l==="clickAndHover"&&!c&&!u)||!a&&!c&&!u){this._hideWidgets();return}if(this._getOrCreateContentWidget().showsOrWillShow(e)){(n=this._glyphWidget)===null||n===void 0||n.hide();return}if(s.type===2&&s.position&&s.detail.glyphMarginLane){(r=this._contentWidget)===null||r===void 0||r.hide(),this._getOrCreateGlyphWidget().startShowingAt(s.position.lineNumber,s.detail.glyphMarginLane);return}if(s.type===3&&s.position){(o=this._contentWidget)===null||o===void 0||o.hide(),this._getOrCreateGlyphWidget().startShowingAt(s.position.lineNumber,"lineNo");return}this._hideWidgets()}_onKeyDown(e){var t;if(!this._editor.hasModel())return;const n=this._keybindingService.softDispatch(e,this._editor.getDomNode()),r=n.kind===1||n.kind===2&&n.commandId==="editor.action.showHover"&&((t=this._contentWidget)===null||t===void 0?void 0:t.isVisible);e.keyCode===5||e.keyCode===6||e.keyCode===57||e.keyCode===4||r||this._hideWidgets()}_hideWidgets(){var e,t,n;this._hoverState.mouseDown&&this._hoverState.contentHoverFocused&&(!((e=this._contentWidget)===null||e===void 0)&&e.isColorPickerVisible)||c_.dropDownVisible||(this._hoverState.activatedByDecoratorClick=!1,this._hoverState.contentHoverFocused=!1,(t=this._glyphWidget)===null||t===void 0||t.hide(),(n=this._contentWidget)===null||n===void 0||n.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(mO,this._editor)),this._contentWidget}_getOrCreateGlyphWidget(){return this._glyphWidget||(this._glyphWidget=new ew(this._editor,this._languageService,this._openerService)),this._glyphWidget}showContentHover(e,t,n,r,o=!1){this._hoverState.activatedByDecoratorClick=o,this._getOrCreateContentWidget().startShowingAtRange(e,t,n,r)}focus(){var e;(e=this._contentWidget)===null||e===void 0||e.focus()}scrollUp(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollUp()}scrollDown(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollDown()}scrollLeft(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollLeft()}scrollRight(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollRight()}pageUp(){var e;(e=this._contentWidget)===null||e===void 0||e.pageUp()}pageDown(){var e;(e=this._contentWidget)===null||e===void 0||e.pageDown()}goToTop(){var e;(e=this._contentWidget)===null||e===void 0||e.goToTop()}goToBottom(){var e;(e=this._contentWidget)===null||e===void 0||e.goToBottom()}get isColorPickerVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isColorPickerVisible}get isHoverVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isVisible}dispose(){var e,t;super.dispose(),this._unhookListeners(),this._listenersStore.dispose(),(e=this._glyphWidget)===null||e===void 0||e.dispose(),(t=this._contentWidget)===null||t===void 0||t.dispose()}};rl.ID="editor.contrib.hover";rl=aU=Fit([e2(1,Ot),e2(2,al),e2(3,ji),e2(4,ci)],rl);var Dd;(function(i){i.NoAutoFocus="noAutoFocus",i.FocusIfVisible="focusIfVisible",i.AutoFocusImmediately="autoFocusImmediately"})(Dd||(Dd={}));class Wit extends gt{constructor(){super({id:"editor.action.showHover",label:w({key:"showOrFocusHover",comment:["Label for action that will trigger the showing/focusing of a hover in the editor.","If the hover is not visible, it will show the hover.","This allows for users to show the hover without using the mouse."]},"Show or Focus Hover"),metadata:{description:"Show or Focus Hover",args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if and when the hover should take focus upon being triggered by this action.",enum:[Dd.NoAutoFocus,Dd.FocusIfVisible,Dd.AutoFocusImmediately],enumDescriptions:[w("showOrFocusHover.focus.noAutoFocus","The hover will not automatically take focus."),w("showOrFocusHover.focus.focusIfVisible","The hover will take focus only if it is already visible."),w("showOrFocusHover.focus.autoFocusImmediately","The hover will automatically take focus when it appears.")],default:Dd.FocusIfVisible}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:j.editorTextFocus,primary:co(2089,2087),weight:100}})}run(e,t,n){if(!t.hasModel())return;const r=rl.get(t);if(!r)return;const o=n==null?void 0:n.focus;let s=Dd.FocusIfVisible;Object.values(Dd).includes(o)?s=o:typeof o=="boolean"&&o&&(s=Dd.AutoFocusImmediately);const a=c=>{const u=t.getPosition(),d=new B(u.lineNumber,u.column,u.lineNumber,u.column);r.showContentHover(d,1,1,c)},l=t.getOption(2)===2;r.isHoverVisible?s!==Dd.NoAutoFocus?r.focus():a(l):a(l||s===Dd.AutoFocusImmediately)}}class $it extends gt{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:w({key:"showDefinitionPreviewHover",comment:["Label for action that will trigger the showing of definition preview hover in the editor.","This allows for users to show the definition preview hover without using the mouse."]},"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0})}run(e,t){const n=rl.get(t);if(!n)return;const r=t.getPosition();if(!r)return;const o=new B(r.lineNumber,r.column,r.lineNumber,r.column),s=Kb.get(t);if(!s)return;s.startFindDefinitionFromCursor(r).then(()=>{n.showContentHover(o,1,1,!0)})}}class Hit extends gt{constructor(){super({id:"editor.action.scrollUpHover",label:w({key:"scrollUpHover",comment:["Action that allows to scroll up in the hover widget with the up arrow when the hover widget is focused."]},"Scroll Up Hover"),alias:"Scroll Up Hover",precondition:j.hoverFocused,kbOpts:{kbExpr:j.hoverFocused,primary:16,weight:100}})}run(e,t){const n=rl.get(t);n&&n.scrollUp()}}class Vit extends gt{constructor(){super({id:"editor.action.scrollDownHover",label:w({key:"scrollDownHover",comment:["Action that allows to scroll down in the hover widget with the up arrow when the hover widget is focused."]},"Scroll Down Hover"),alias:"Scroll Down Hover",precondition:j.hoverFocused,kbOpts:{kbExpr:j.hoverFocused,primary:18,weight:100}})}run(e,t){const n=rl.get(t);n&&n.scrollDown()}}class zit extends gt{constructor(){super({id:"editor.action.scrollLeftHover",label:w({key:"scrollLeftHover",comment:["Action that allows to scroll left in the hover widget with the left arrow when the hover widget is focused."]},"Scroll Left Hover"),alias:"Scroll Left Hover",precondition:j.hoverFocused,kbOpts:{kbExpr:j.hoverFocused,primary:15,weight:100}})}run(e,t){const n=rl.get(t);n&&n.scrollLeft()}}class Uit extends gt{constructor(){super({id:"editor.action.scrollRightHover",label:w({key:"scrollRightHover",comment:["Action that allows to scroll right in the hover widget with the right arrow when the hover widget is focused."]},"Scroll Right Hover"),alias:"Scroll Right Hover",precondition:j.hoverFocused,kbOpts:{kbExpr:j.hoverFocused,primary:17,weight:100}})}run(e,t){const n=rl.get(t);n&&n.scrollRight()}}class jit extends gt{constructor(){super({id:"editor.action.pageUpHover",label:w({key:"pageUpHover",comment:["Action that allows to page up in the hover widget with the page up command when the hover widget is focused."]},"Page Up Hover"),alias:"Page Up Hover",precondition:j.hoverFocused,kbOpts:{kbExpr:j.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){const n=rl.get(t);n&&n.pageUp()}}class Kit extends gt{constructor(){super({id:"editor.action.pageDownHover",label:w({key:"pageDownHover",comment:["Action that allows to page down in the hover widget with the page down command when the hover widget is focused."]},"Page Down Hover"),alias:"Page Down Hover",precondition:j.hoverFocused,kbOpts:{kbExpr:j.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){const n=rl.get(t);n&&n.pageDown()}}class Git extends gt{constructor(){super({id:"editor.action.goToTopHover",label:w({key:"goToTopHover",comment:["Action that allows to go to the top of the hover widget with the home command when the hover widget is focused."]},"Go To Top Hover"),alias:"Go To Bottom Hover",precondition:j.hoverFocused,kbOpts:{kbExpr:j.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){const n=rl.get(t);n&&n.goToTop()}}class qit extends gt{constructor(){super({id:"editor.action.goToBottomHover",label:w({key:"goToBottomHover",comment:["Action that allows to go to the bottom in the hover widget with the end command when the hover widget is focused."]},"Go To Bottom Hover"),alias:"Go To Bottom Hover",precondition:j.hoverFocused,kbOpts:{kbExpr:j.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){const n=rl.get(t);n&&n.goToBottom()}}jn(rl.ID,rl,2);Be(Wit);Be($it);Be(Hit);Be(Vit);Be(zit);Be(Uit);Be(jit);Be(Kit);Be(Git);Be(qit);A_.register(bO);A_.register(rU);fu((i,e)=>{const t=i.getColor(rve);t&&(e.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${t.transparent(.5)}; }`))});class lU extends fe{constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){const t=this._editor.getOption(147);if(t!=="click"&&t!=="clickAndHover")return;const n=e.target;if(n.type!==6||!n.detail.injectedText||n.detail.injectedText.options.attachedData!==vCe||!n.range)return;const r=this._editor.getContribution(rl.ID);if(r&&!r.isColorPickerVisible){const o=new B(n.range.startLineNumber,n.range.startColumn+1,n.range.endLineNumber,n.range.endColumn+1);r.showContentHover(o,1,0,!1,!0)}}}lU.ID="editor.contrib.colorContribution";jn(lU.ID,lU,2);A_.register(gO);var qCe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},$d=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},cU,uU;let u_=cU=class extends fe{constructor(e,t,n,r,o,s,a){super(),this._editor=e,this._modelService=n,this._keybindingService=r,this._instantiationService=o,this._languageFeatureService=s,this._languageConfigurationService=a,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=j.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=j.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){var e;this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||(e=this._standaloneColorPickerWidget)===null||e===void 0||e.focus():this._standaloneColorPickerWidget=new yO(this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused,this._instantiationService,this._modelService,this._keybindingService,this._languageFeatureService,this._languageConfigurationService))}hide(){var e;this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),(e=this._standaloneColorPickerWidget)===null||e===void 0||e.hide(),this._editor.focus()}insertColor(){var e;(e=this._standaloneColorPickerWidget)===null||e===void 0||e.updateEditor(),this.hide()}static get(e){return e.getContribution(cU.ID)}};u_.ID="editor.contrib.standaloneColorPickerController";u_=cU=qCe([$d(1,Vt),$d(2,tr),$d(3,ci),$d(4,Ot),$d(5,_t),$d(6,Di)],u_);jn(u_.ID,u_,1);const Bae=8,Xit=22;let yO=uU=class extends fe{constructor(e,t,n,r,o,s,a,l){var c;super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=n,this._modelService=o,this._keybindingService=s,this._languageFeaturesService=a,this._languageConfigurationService=l,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new se),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=r.createInstance(TI,this._editor),this._position=(c=this._editor._getViewModel())===null||c===void 0?void 0:c.getPrimaryCursorState().modelState.position;const u=this._editor.getSelection(),d=u?{startLineNumber:u.startLineNumber,startColumn:u.startColumn,endLineNumber:u.endLineNumber,endColumn:u.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},h=this._register(dh(this._body));this._register(h.onDidBlur(f=>{this.hide()})),this._register(h.onDidFocus(f=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(f=>{var g;const p=(g=f.target.element)===null||g===void 0?void 0:g.classList;p&&p.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(f=>{this._render(f.value,f.foundInEditor)})),this._start(d),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return uU.ID}getDomNode(){return this._body}getPosition(){if(!this._position)return null;const e=this._editor.getOption(60).above;return{position:this._position,secondaryPosition:this._position,preference:e?[1,2]:[2,1],positionAffinity:2}}hide(){this.dispose(),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerFocused.set(!1),this._editor.removeContentWidget(this),this._editor.focus()}focus(){this._standaloneColorPickerFocused.set(!0),this._body.focus()}async _start(e){const t=await this._computeAsync(e);t&&this._onResult.fire(new Yit(t.result,t.foundInEditor))}async _computeAsync(e){if(!this._editor.hasModel())return null;const t={range:e,color:{red:0,green:0,blue:0,alpha:1}},n=await this._standaloneColorPickerParticipant.createColorHover(t,new WY(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return n?{result:n.colorHover,foundInEditor:n.foundInEditor}:null}_render(e,t){const n=document.createDocumentFragment(),r=this._register(new vO(this._keybindingService));let o;const s={fragment:n,statusBar:r,setColorPicker:p=>o=p,onContentsChanged:()=>{},hide:()=>this.hide()};if(this._colorHover=e,this._register(this._standaloneColorPickerParticipant.renderHoverParts(s,[e])),o===void 0)return;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(this._editor.getLayoutInfo().width*.66,500)+"px",this._body.tabIndex=0,this._body.appendChild(n),o.layout();const a=o.body,l=a.saturationBox.domNode.clientWidth,c=a.domNode.clientWidth-l-Xit-Bae,u=o.body.enterButton;u==null||u.onClicked(()=>{this.updateEditor(),this.hide()});const d=o.header,h=d.pickedColorNode;h.style.width=l+Bae+"px";const f=d.originalColorNode;f.style.width=c+"px";const g=o.header.closeButton;g==null||g.onClicked(()=>{this.hide()}),t&&(u&&(u.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}};yO.ID="editor.contrib.standaloneColorPickerWidget";yO=uU=qCe([$d(3,Ot),$d(4,tr),$d(5,ci),$d(6,_t),$d(7,Di)],yO);class Yit{constructor(e,t){this.value=e,this.foundInEditor=t}}class Zit extends Sh{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{...$n("showOrFocusStandaloneColorPicker","Show or Focus Standalone Color Picker"),mnemonicTitle:w({key:"mishowOrFocusStandaloneColorPicker",comment:["&& denotes a mnemonic"]},"&&Show or Focus Standalone Color Picker")},precondition:void 0,menu:[{id:$.CommandPalette}]})}runEditorCommand(e,t){var n;(n=u_.get(t))===null||n===void 0||n.showOrFocus()}}class Qit extends gt{constructor(){super({id:"editor.action.hideColorPicker",label:w({key:"hideColorPicker",comment:["Action that hides the color picker"]},"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:j.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100}})}run(e,t){var n;(n=u_.get(t))===null||n===void 0||n.hide()}}class Jit extends gt{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:w({key:"insertColorWithStandaloneColorPicker",comment:["Action that inserts color with standalone color picker"]},"Insert Color with Standalone Color Picker"),alias:"Insert Color with Standalone Color Picker",precondition:j.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100}})}run(e,t){var n;(n=u_.get(t))===null||n===void 0||n.insertColor()}}Be(Qit);Be(Jit);Ei(Zit);class nv{constructor(e,t,n){this.languageConfigurationService=n,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,n){if(n<0)return!1;const r=t.length,o=e.length;if(n+r>o)return!1;for(let s=0;s=65&&a<=90&&a+32===l)&&!(l>=65&&l<=90&&l+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,n,r,o,s){const a=e.startLineNumber,l=e.startColumn,c=e.endLineNumber,u=e.endColumn,d=o.getLineContent(a),h=o.getLineContent(c);let f=d.lastIndexOf(t,l-1+t.length),g=h.indexOf(n,u-1-n.length);if(f!==-1&&g!==-1)if(a===c)d.substring(f+t.length,g).indexOf(n)>=0&&(f=-1,g=-1);else{const v=d.substring(f+t.length),m=h.substring(0,g);(v.indexOf(n)>=0||m.indexOf(n)>=0)&&(f=-1,g=-1)}let p;f!==-1&&g!==-1?(r&&f+t.length0&&h.charCodeAt(g-1)===32&&(n=" "+n,g-=1),p=nv._createRemoveBlockCommentOperations(new B(a,f+t.length+1,c,g+1),t,n)):(p=nv._createAddBlockCommentOperations(e,t,n,this._insertSpace),this._usedEndToken=p.length===1?n:null);for(const v of p)s.addTrackedEditOperation(v.range,v.text)}static _createRemoveBlockCommentOperations(e,t,n){const r=[];return B.isEmpty(e)?r.push(Xi.delete(new B(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+n.length))):(r.push(Xi.delete(new B(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),r.push(Xi.delete(new B(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+n.length)))),r}static _createAddBlockCommentOperations(e,t,n,r){const o=[];return B.isEmpty(e)?o.push(Xi.replace(new B(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+n)):(o.push(Xi.insert(new ae(e.startLineNumber,e.startColumn),t+(r?" ":""))),o.push(Xi.insert(new ae(e.endLineNumber,e.endColumn),(r?" ":"")+n))),o}getEditOperations(e,t){const n=this._selection.startLineNumber,r=this._selection.startColumn;e.tokenization.tokenizeIfCheap(n);const o=e.getLanguageIdAtPosition(n,r),s=this.languageConfigurationService.getLanguageConfiguration(o).comments;!s||!s.blockCommentStartToken||!s.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,s.blockCommentStartToken,s.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const n=t.getInverseEditOperations();if(n.length===2){const r=n[0],o=n[1];return new yt(r.range.endLineNumber,r.range.endColumn,o.range.startLineNumber,o.range.startColumn)}else{const r=n[0].range,o=this._usedEndToken?-this._usedEndToken.length-1:0;return new yt(r.endLineNumber,r.endColumn+o,r.endLineNumber,r.endColumn+o)}}}class Tg{constructor(e,t,n,r,o,s,a){this.languageConfigurationService=e,this._selection=t,this._tabSize=n,this._type=r,this._insertSpace=o,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=s,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,n,r){e.tokenization.tokenizeIfCheap(t);const o=e.getLanguageIdAtPosition(t,1),s=r.getLanguageConfiguration(o).comments,a=s?s.lineCommentToken:null;if(!a)return null;const l=[];for(let c=0,u=n-t+1;co?t[l].commentStrOffset=s-1:t[l].commentStrOffset=s}}}class KY extends gt{constructor(e,t){super(t),this._type=e}run(e,t){const n=e.get(Di);if(!t.hasModel())return;const r=t.getModel(),o=[],s=r.getOptions(),a=t.getOption(23),l=t.getSelections().map((u,d)=>({selection:u,index:d,ignoreFirstLine:!1}));l.sort((u,d)=>B.compareRangesUsingStarts(u.selection,d.selection));let c=l[0];for(let u=1;u=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},o0=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},dU;let nS=dU=class{static get(e){return e.getContribution(dU.ID)}constructor(e,t,n,r,o,s,a,l){this._contextMenuService=t,this._contextViewService=n,this._contextKeyService=r,this._keybindingService=o,this._menuService=s,this._configurationService=a,this._workspaceContextService=l,this._toDispose=new Te,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu(c=>this._onContextMenu(c))),this._toDispose.add(this._editor.onMouseWheel(c=>{if(this._contextMenuIsBeingShownCount>0){const u=this._contextViewService.getContextViewElement(),d=c.srcElement;d.shadowRoot&&Tb(u)===d.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(c=>{this._editor.getOption(24)&&c.keyCode===58&&(c.preventDefault(),c.stopPropagation(),this.showContextMenu())}))}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(24)){this._editor.focus(),e.target.position&&!this._editor.getSelection().containsPosition(e.target.position)&&this._editor.setPosition(e.target.position);return}if(e.target.type===12||e.target.type===6&&e.target.detail.injectedText)return;if(e.event.preventDefault(),e.event.stopPropagation(),e.target.type===11)return this._showScrollbarContextMenu(e.event);if(e.target.type!==6&&e.target.type!==7&&e.target.type!==1)return;if(this._editor.focus(),e.target.position){let n=!1;for(const r of this._editor.getSelections())if(r.containsPosition(e.target.position)){n=!0;break}n||this._editor.setPosition(e.target.position)}let t=null;e.target.type!==1&&(t=e.event),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(24)||!this._editor.hasModel())return;const t=this._getMenuActions(this._editor.getModel(),this._editor.isSimpleWidget?$.SimpleEditorContext:$.EditorContext);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const n=[],r=this._menuService.createMenu(t,this._contextKeyService),o=r.getActions({arg:e.uri});r.dispose();for(const s of o){const[,a]=s;let l=0;for(const c of a)if(c instanceof TD){const u=this._getMenuActions(e,c.item.submenu);u.length>0&&(n.push(new Lw(c.id,c.label,u)),l++)}else n.push(c),l++;l&&n.push(new lo)}return n.length&&n.pop(),n}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;const n=this._editor.getOption(60);this._editor.updateOptions({hover:{enabled:!1}});let r=t;if(!r){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const s=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),a=Br(this._editor.getDomNode()),l=a.left+s.left,c=a.top+s.top+s.height;r={x:l,y:c}}const o=this._editor.getOption(127)&&!ch;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:o?this._editor.getDomNode():void 0,getAnchor:()=>r,getActions:()=>e,getActionViewItem:s=>{const a=this._keybindingFor(s);if(a)return new jw(s,s,{label:!0,keybinding:a.getLabel(),isMenu:!0});const l=s;return typeof l.getActionViewItem=="function"?l.getActionViewItem():new jw(s,s,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:s=>this._keybindingFor(s),onHide:s=>{this._contextMenuIsBeingShownCount--,this._editor.updateOptions({hover:n})}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel()||RGe(this._workspaceContextService.getWorkspace()))return;const t=this._editor.getOption(73);let n=0;const r=c=>({id:`menu-action-${++n}`,label:c.label,tooltip:"",class:void 0,enabled:typeof c.enabled>"u"?!0:c.enabled,checked:c.checked,run:c.run}),o=(c,u)=>new Lw(`menu-action-${++n}`,c,u,void 0),s=(c,u,d,h,f)=>{if(!u)return r({label:c,enabled:u,run:()=>{}});const g=v=>()=>{this._configurationService.updateValue(d,v)},p=[];for(const v of f)p.push(r({label:v.label,checked:h===v.value,run:g(v.value)}));return o(c,p)},a=[];a.push(r({label:w("context.minimap.minimap","Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new lo),a.push(r({label:w("context.minimap.renderCharacters","Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(s(w("context.minimap.size","Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:w("context.minimap.size.proportional","Proportional"),value:"proportional"},{label:w("context.minimap.size.fill","Fill"),value:"fill"},{label:w("context.minimap.size.fit","Fit"),value:"fit"}])),a.push(s(w("context.minimap.slider","Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:w("context.minimap.slider.mouseover","Mouse Over"),value:"mouseover"},{label:w("context.minimap.slider.always","Always"),value:"always"}]));const l=this._editor.getOption(127)&&!ch;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:l?this._editor.getDomNode():void 0,getAnchor:()=>e,getActions:()=>a,onHide:c=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}};nS.ID="editor.contrib.contextmenu";nS=dU=rrt([o0(1,Ol),o0(2,ng),o0(3,Vt),o0(4,ci),o0(5,hu),o0(6,gn),o0(7,Pb)],nS);class ort extends gt{constructor(){super({id:"editor.action.showContextMenu",label:w("action.showContextMenu.label","Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:j.textInputFocus,primary:1092,weight:100}})}run(e,t){var n;(n=nS.get(t))===null||n===void 0||n.showContextMenu()}}jn(nS.ID,nS,2);Be(ort);class M9{constructor(e){this.selections=e}equals(e){const t=this.selections.length,n=e.selections.length;if(t!==n)return!1;for(let r=0;r{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeModelContent(t=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeCursorSelection(t=>{if(this._isCursorUndoRedo||!t.oldSelections||t.oldModelVersionId!==t.modelVersionId)return;const n=new M9(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(n)||(this._undoStack.push(new A9(n,e.getScrollTop(),e.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())}))}cursorUndo(){!this._editor.hasModel()||this._undoStack.length===0||(this._redoStack.push(new A9(new M9(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._undoStack.pop()))}cursorRedo(){!this._editor.hasModel()||this._redoStack.length===0||(this._undoStack.push(new A9(new M9(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._redoStack.pop()))}_applyState(e){this._isCursorUndoRedo=!0,this._editor.setSelections(e.cursorState.selections),this._editor.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft}),this._isCursorUndoRedo=!1}}Gb.ID="editor.contrib.cursorUndoRedoController";class srt extends gt{constructor(){super({id:"cursorUndo",label:w("cursor.undo","Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:j.textInputFocus,primary:2099,weight:100}})}run(e,t,n){var r;(r=Gb.get(t))===null||r===void 0||r.cursorUndo()}}class art extends gt{constructor(){super({id:"cursorRedo",label:w("cursor.redo","Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,n){var r;(r=Gb.get(t))===null||r===void 0||r.cursorRedo()}}jn(Gb.ID,Gb,0);Be(srt);Be(art);class lrt{constructor(e,t,n){this.selection=e,this.targetPosition=t,this.copy=n,this.targetSelection=null}getEditOperations(e,t){const n=e.getValueInRange(this.selection);if(this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new B(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),n),this.selection.containsPosition(this.targetPosition)&&!(this.copy&&(this.selection.getEndPosition().equals(this.targetPosition)||this.selection.getStartPosition().equals(this.targetPosition)))){this.targetSelection=this.selection;return}if(this.copy){this.targetSelection=new yt(this.targetPosition.lineNumber,this.targetPosition.column,this.selection.endLineNumber-this.selection.startLineNumber+this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumber>this.selection.endLineNumber){this.targetSelection=new yt(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumberthis._onEditorMouseDown(t))),this._register(this._editor.onMouseUp(t=>this._onEditorMouseUp(t))),this._register(this._editor.onMouseDrag(t=>this._onEditorMouseDrag(t))),this._register(this._editor.onMouseDrop(t=>this._onEditorMouseDrop(t))),this._register(this._editor.onMouseDropCanceled(()=>this._onEditorMouseDropCanceled())),this._register(this._editor.onKeyDown(t=>this.onEditorKeyDown(t))),this._register(this._editor.onKeyUp(t=>this.onEditorKeyUp(t))),this._register(this._editor.onDidBlurEditorWidget(()=>this.onEditorBlur())),this._register(this._editor.onDidBlurEditorText(()=>this.onEditorBlur())),this._mouseDown=!1,this._modifierPressed=!1,this._dragSelection=null}onEditorBlur(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1}onEditorKeyDown(e){!this._editor.getOption(35)||this._editor.getOption(22)||(o1(e)&&(this._modifierPressed=!0),this._mouseDown&&o1(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(35)||this._editor.getOption(22)||(o1(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===vp.TRIGGER_KEY_VALUE&&this._editor.updateOptions({mouseStyle:"default"}))}_onEditorMouseDown(e){this._mouseDown=!0}_onEditorMouseUp(e){this._mouseDown=!1,this._editor.updateOptions({mouseStyle:"text"})}_onEditorMouseDrag(e){const t=e.target;if(this._dragSelection===null){const r=(this._editor.getSelections()||[]).filter(o=>t.position&&o.containsPosition(t.position));if(r.length===1)this._dragSelection=r[0];else return}o1(e.event)?this._editor.updateOptions({mouseStyle:"copy"}):this._editor.updateOptions({mouseStyle:"default"}),t.position&&(this._dragSelection.containsPosition(t.position)?this._removeDecoration():this.showAt(t.position))}_onEditorMouseDropCanceled(){this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}_onEditorMouseDrop(e){if(e.target&&(this._hitContent(e.target)||this._hitMargin(e.target))&&e.target.position){const t=new ae(e.target.position.lineNumber,e.target.position.column);if(this._dragSelection===null){let n=null;if(e.event.shiftKey){const r=this._editor.getSelection();if(r){const{selectionStartLineNumber:o,selectionStartColumn:s}=r;n=[new yt(o,s,t.lineNumber,t.column)]}}else n=(this._editor.getSelections()||[]).map(r=>r.containsPosition(t)?new yt(t.lineNumber,t.column,t.lineNumber,t.column):r);this._editor.setSelections(n||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(o1(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(vp.ID,new lrt(this._dragSelection,t,o1(e.event)||this._modifierPressed)),this._editor.pushUndoStop())}this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}showAt(e){this._dndDecorationIds.set([{range:new B(e.lineNumber,e.column,e.lineNumber,e.column),options:vp._DECORATION_OPTIONS}]),this._editor.revealPosition(e,1)}_removeDecoration(){this._dndDecorationIds.clear()}_hitContent(e){return e.type===6||e.type===7}_hitMargin(e){return e.type===2||e.type===3||e.type===4}dispose(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1,super.dispose()}}vp.ID="editor.contrib.dragAndDrop";vp.TRIGGER_KEY_VALUE=Ln?6:5;vp._DECORATION_OPTIONS=sn.register({description:"dnd-target",className:"dnd-target"});jn(vp.ID,vp,2);var GY=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},AI=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const H3=w("builtIn","Built-in");class qY{async provideDocumentPasteEdits(e,t,n,r,o){const s=await this.getEdit(n,o);return s?{insertText:s.insertText,label:s.label,detail:s.detail,handledMimeType:s.handledMimeType,yieldTo:s.yieldTo}:void 0}async provideDocumentOnDropEdits(e,t,n,r){const o=await this.getEdit(n,r);return o?{insertText:o.insertText,label:o.label,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}:void 0}}class XCe extends qY{constructor(){super(...arguments),this.id="text",this.dropMimeTypes=[Cr.text],this.pasteMimeTypes=[Cr.text]}async getEdit(e,t){const n=e.get(Cr.text);if(!n||e.has(Cr.uriList))return;const r=await n.asString();return{handledMimeType:Cr.text,label:w("text.label","Insert Plain Text"),detail:H3,insertText:r}}}class YCe extends qY{constructor(){super(...arguments),this.id="uri",this.dropMimeTypes=[Cr.uriList],this.pasteMimeTypes=[Cr.uriList]}async getEdit(e,t){const n=await ZCe(e);if(!n.length||t.isCancellationRequested)return;let r=0;const o=n.map(({uri:a,originalText:l})=>a.scheme===an.file?a.fsPath:(r++,l)).join(" ");let s;return r>0?s=n.length>1?w("defaultDropProvider.uriList.uris","Insert Uris"):w("defaultDropProvider.uriList.uri","Insert Uri"):s=n.length>1?w("defaultDropProvider.uriList.paths","Insert Paths"):w("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:Cr.uriList,insertText:o,label:s,detail:H3}}}let wO=class extends qY{constructor(e){super(),this._workspaceContextService=e,this.id="relativePath",this.dropMimeTypes=[Cr.uriList],this.pasteMimeTypes=[Cr.uriList]}async getEdit(e,t){const n=await ZCe(e);if(!n.length||t.isCancellationRequested)return;const r=lh(n.map(({uri:o})=>{const s=this._workspaceContextService.getWorkspaceFolder(o);return s?Sze(s.uri,o):void 0}));if(r.length)return{handledMimeType:Cr.uriList,insertText:r.join(" "),label:n.length>1?w("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):w("defaultDropProvider.uriList.relativePath","Insert Relative Path"),detail:H3}}};wO=GY([AI(0,Pb)],wO);class crt{constructor(){this.id="html",this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:Cr.text}]}async provideDocumentPasteEdits(e,t,n,r,o){if(r.trigger!=="explicit"&&r.only!==this.id)return;const s=n.get("text/html"),a=await(s==null?void 0:s.asString());if(!(!a||o.isCancellationRequested))return{insertText:a,yieldTo:this._yieldTo,label:w("pasteHtmlLabel","Insert HTML"),detail:H3}}}async function ZCe(i){const e=i.get(Cr.uriList);if(!e)return[];const t=await e.asString(),n=[];for(const r of N3.parse(t))try{n.push({uri:At.parse(r),originalText:r})}catch{}return n}let hU=class extends fe{constructor(e,t){super(),this._register(e.documentOnDropEditProvider.register("*",new XCe)),this._register(e.documentOnDropEditProvider.register("*",new YCe)),this._register(e.documentOnDropEditProvider.register("*",new wO(t)))}};hU=GY([AI(0,_t),AI(1,Pb)],hU);let fU=class extends fe{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new XCe)),this._register(e.documentPasteEditProvider.register("*",new YCe)),this._register(e.documentPasteEditProvider.register("*",new wO(t))),this._register(e.documentPasteEditProvider.register("*",new crt))}};fU=GY([AI(0,_t),AI(1,Pb)],fU);jn(Rp.ID,Rp,0);nT(fU);et(new class extends Vo{constructor(){super({id:Ybe,precondition:Zbe,kbOpts:{weight:100,primary:2137}})}runEditorCommand(i,e,t){var n;return(n=Rp.get(e))===null||n===void 0?void 0:n.changePasteType()}});Be(class extends gt{constructor(){super({id:"editor.action.pasteAs",label:w("pasteAs","Paste As..."),alias:"Paste As...",precondition:j.writable,metadata:{description:"Paste as",args:[{name:"args",schema:{type:"object",properties:{id:{type:"string",description:w("pasteAs.id","The id of the paste edit to try applying. If not provided, the editor will show a picker.")}}}}]}})}run(i,e,t){var n;const r=typeof(t==null?void 0:t.id)=="string"?t.id:void 0;return(n=Rp.get(e))===null||n===void 0?void 0:n.pasteAs(r)}});Be(class extends gt{constructor(){super({id:"editor.action.pasteAsText",label:w("pasteAsText","Paste as Text"),alias:"Paste as Text",precondition:j.writable})}run(i,e,t){var n;return(n=Rp.get(e))===null||n===void 0?void 0:n.pasteAs("text")}});class urt{constructor(){this._dragOperations=new Map}removeDragOperationTransfer(e){if(e&&this._dragOperations.has(e)){const t=this._dragOperations.get(e);return this._dragOperations.delete(e),t}}}class Wae{constructor(e){this.identifier=e}}const QCe=yn("treeViewsDndService");In(QCe,urt,1);var drt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},t2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},gU;const JCe="editor.experimental.dropIntoEditor.defaultProvider",e1e="editor.changeDropType",t1e=new st("dropWidgetVisible",!1,w("dropWidgetVisible","Whether the drop widget is showing"));let iS=gU=class extends fe{static get(e){return e.getContribution(gU.ID)}constructor(e,t,n,r,o){super(),this._configService=n,this._languageFeaturesService=r,this._treeViewsDragAndDropService=o,this.treeItemsTransfer=DI.getInstance(),this._dropProgressManager=this._register(t.createInstance(uO,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(hO,"dropIntoEditor",e,t1e,{id:e1e,label:w("postDropWidgetTitle","Show drop options...")})),this._register(e.onDropIntoEditor(s=>this.onDropIntoEditor(e,s.position,s.event)))}changeDropType(){this._postDropWidgetManager.tryShowSelector()}async onDropIntoEditor(e,t,n){var r;if(!n.dataTransfer||!e.hasModel())return;(r=this._currentOperation)===null||r===void 0||r.cancel(),e.focus(),e.setPosition(t);const o=Io(async s=>{const a=new n_(e,1,void 0,s);try{const l=await this.extractDataTransferData(n);if(l.size===0||a.token.isCancellationRequested)return;const c=e.getModel();if(!c)return;const u=this._languageFeaturesService.documentOnDropEditProvider.ordered(c).filter(h=>h.dropMimeTypes?h.dropMimeTypes.some(f=>l.matches(f)):!0),d=await this.getDropEdits(u,c,t,l,a);if(a.token.isCancellationRequested)return;if(d.length){const h=this.getInitialActiveEditIndex(c,d),f=e.getOption(36).showDropSelector==="afterDrop";await this._postDropWidgetManager.applyEditAndShowIfNeeded([B.fromPositions(t)],{activeEditIndex:h,allEdits:d},f,s)}}finally{a.dispose(),this._currentOperation===o&&(this._currentOperation=void 0)}});this._dropProgressManager.showWhile(t,w("dropIntoEditorProgress","Running drop handlers. Click to cancel"),o),this._currentOperation=o}async getDropEdits(e,t,n,r,o){const s=await Rk(Promise.all(e.map(async l=>{try{const c=await l.provideDocumentOnDropEdits(t,n,r,o.token);if(c)return{...c,providerId:l.id}}catch(c){console.error(c)}})),o.token),a=lh(s??[]);return qbe(a)}getInitialActiveEditIndex(e,t){const n=this._configService.getValue(JCe,{resource:e.uri});for(const[r,o]of Object.entries(n)){const s=t.findIndex(a=>o===a.providerId&&a.handledMimeType&&Vbe(r,[a.handledMimeType]));if(s>=0)return s}return 0}async extractDataTransferData(e){if(!e.dataTransfer)return new Hbe;const t=jbe(e.dataTransfer);if(this.treeItemsTransfer.hasData(Wae.prototype)){const n=this.treeItemsTransfer.getData(Wae.prototype);if(Array.isArray(n))for(const r of n){const o=await this._treeViewsDragAndDropService.removeDragOperationTransfer(r.identifier);if(o)for(const[s,a]of o)t.replace(s,a)}}return t}};iS.ID="editor.contrib.dropIntoEditorController";iS=gU=drt([t2(1,Ot),t2(2,gn),t2(3,_t),t2(4,QCe)],iS);jn(iS.ID,iS,2);et(new class extends Vo{constructor(){super({id:e1e,precondition:t1e,kbOpts:{weight:100,primary:2137}})}runEditorCommand(i,e,t){var n;(n=iS.get(e))===null||n===void 0||n.changeDropType()}});nT(hU);ar.as(xh.Configuration).registerConfiguration({...Z4,properties:{[JCe]:{type:"object",scope:5,description:w("defaultProviderDescription","Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}});class Us{constructor(e){this._editor=e,this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null,this._startPosition=this._editor.getPosition()}dispose(){this._editor.removeDecorations(this._allDecorations()),this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}reset(){this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}getCount(){return this._decorations.length}getFindScope(){return this._findScopeDecorationIds[0]?this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]):null}getFindScopes(){if(this._findScopeDecorationIds.length){const e=this._findScopeDecorationIds.map(t=>this._editor.getModel().getDecorationRange(t)).filter(t=>!!t);if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){const t=this._decorations.indexOf(e);return t>=0?t+1:1}getDecorationRangeAt(e){const t=e{if(this._highlightedDecorationId!==null&&(r.changeDecorationOptions(this._highlightedDecorationId,Us._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,r.changeDecorationOptions(this._highlightedDecorationId,Us._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(r.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let o=this._editor.getModel().getDecorationRange(t);if(o.startLineNumber!==o.endLineNumber&&o.endColumn===1){const s=o.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(s);o=new B(o.startLineNumber,o.startColumn,s,a)}this._rangeHighlightDecorationId=r.addDecoration(o,Us._RANGE_HIGHLIGHT_DECORATION)}}),n}set(e,t){this._editor.changeDecorations(n=>{let r=Us._FIND_MATCH_DECORATION;const o=[];if(e.length>1e3){r=Us._FIND_MATCH_NO_OVERVIEW_DECORATION;const a=this._editor.getModel().getLineCount(),c=this._editor.getLayoutInfo().height/a,u=Math.max(2,Math.ceil(3/c));let d=e[0].range.startLineNumber,h=e[0].range.endLineNumber;for(let f=1,g=e.length;f=p.startLineNumber?p.endLineNumber>h&&(h=p.endLineNumber):(o.push({range:new B(d,1,h,1),options:Us._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),d=p.startLineNumber,h=p.endLineNumber)}o.push({range:new B(d,1,h,1),options:Us._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const s=new Array(e.length);for(let a=0,l=e.length;an.removeDecoration(a)),this._findScopeDecorationIds=[]),t!=null&&t.length&&(this._findScopeDecorationIds=t.map(a=>n.addDecoration(a,Us._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){const n=this._decorations[t],r=this._editor.getModel().getDecorationRange(n);if(!(!r||r.endLineNumber>e.lineNumber)){if(r.endLineNumbere.column))return r}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,n=this._decorations.length;te.lineNumber)return o;if(!(o.startColumn0){const n=[];for(let s=0;sB.compareRangesUsingStarts(s.range,a.range));const r=[];let o=n[0];for(let s=1;s0?e[0].toUpperCase()+e.substr(1):i[0][0].toUpperCase()!==i[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function $ae(i,e,t){return i[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&i[0].split(t).length===e.split(t).length}function Hae(i,e,t){const n=e.split(t),r=i[0].split(t);let o="";return n.forEach((s,a)=>{o+=n1e([r[a]],s)+t}),o.slice(0,-1)}class Vae{constructor(e){this.staticValue=e,this.kind=0}}class frt{constructor(e){this.pieces=e,this.kind=1}}class rS{static fromStaticValue(e){return new rS([db.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new Vae(""):e.length===1&&e[0].staticValue!==null?this._state=new Vae(e[0].staticValue):this._state=new frt(e)}buildReplaceString(e,t){if(this._state.kind===0)return t?n1e(e,this._state.staticValue):this._state.staticValue;let n="";for(let r=0,o=this._state.pieces.length;r0){const l=[],c=s.caseOps.length;let u=0;for(let d=0,h=a.length;d=c){l.push(a.slice(d));break}switch(s.caseOps[u]){case"U":l.push(a[d].toUpperCase());break;case"u":l.push(a[d].toUpperCase()),u++;break;case"L":l.push(a[d].toLowerCase());break;case"l":l.push(a[d].toLowerCase()),u++;break;default:l.push(a[d])}}a=l.join("")}n+=a}return n}static _substitute(e,t){if(t===null)return"";if(e===0)return t[0];let n="";for(;e>0;){if(e=r)break;const s=i.charCodeAt(n);switch(s){case 92:t.emitUnchanged(n-1),t.emitStatic("\\",n+1);break;case 110:t.emitUnchanged(n-1),t.emitStatic(` +`,n+1);break;case 116:t.emitUnchanged(n-1),t.emitStatic(" ",n+1);break;case 117:case 85:case 108:case 76:t.emitUnchanged(n-1),t.emitStatic("",n+1),e.push(String.fromCharCode(s));break}continue}if(o===36){if(n++,n>=r)break;const s=i.charCodeAt(n);if(s===36){t.emitUnchanged(n-1),t.emitStatic("$",n+1);continue}if(s===48||s===38){t.emitUnchanged(n-1),t.emitMatchIndex(0,n+1,e),e.length=0;continue}if(49<=s&&s<=57){let a=s-48;if(n+1this.research(!1),100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(n=>{(n.reason===3||n.reason===5||n.reason===6)&&this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(n=>{this._ignoreModelContentChanged||(n.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(n=>this._onStateChanged(n))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,si(this._startSearchingTimer),this._toDispose.dispose()}_onStateChanged(e){this._isDisposed||this._editor.hasModel()&&(e.searchString||e.isReplaceRevealed||e.isRegex||e.wholeWord||e.matchCase||e.searchScope)&&(this._editor.getModel().isTooLargeForSyncing()?(this._startSearchingTimer.cancel(),this._startSearchingTimer.setIfNotSet(()=>{e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor)},mrt)):e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor))}static _getSearchRange(e,t){return t||e.getFullModelRange()}research(e,t){let n=null;typeof t<"u"?t!==null&&(Array.isArray(t)?n=t:n=[t]):n=this._decorations.getFindScopes(),n!==null&&(n=n.map(a=>{if(a.startLineNumber!==a.endLineNumber){let l=a.endLineNumber;return a.endColumn===1&&(l=l-1),new B(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));const r=this._findMatches(n,!1,iv);this._decorations.set(r,n);const o=this._editor.getSelection();let s=this._decorations.getCurrentMatchesPosition(o);if(s===0&&r.length>0){const a=AD(r.map(l=>l.range),l=>B.compareRangesUsingStarts(l,o)>=0);s=a>0?a-1+1:s}this._state.changeMatchInfo(s,this._decorations.getCount(),void 0),e&&this._editor.getOption(41).cursorMoveOnType&&this._moveToNextMatch(this._decorations.getStartPosition())}_hasMatches(){return this._state.matchesCount>0}_cannotFind(){if(!this._hasMatches()){const e=this._decorations.getFindScope();return e&&this._editor.revealRangeInCenterIfOutsideViewport(e,0),!0}return!1}_setCurrentFindMatch(e){const t=this._decorations.setCurrentFindMatch(e);this._state.changeMatchInfo(t,this._decorations.getCount(),e),this._editor.setSelection(e),this._editor.revealRangeInCenterIfOutsideViewport(e,0)}_prevSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:n,column:r}=e;const o=this._editor.getModel();return t||r===1?(n===1?n=o.getLineCount():n--,r=o.getLineMaxColumn(n)):r--,new ae(n,r)}_moveToPrevMatch(e,t=!1){if(!this._state.canNavigateBack()){const u=this._decorations.matchAfterPosition(e);u&&this._setCurrentFindMatch(u);return}if(this._decorations.getCount()=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:n,column:r}=e;const o=this._editor.getModel();return t||r===o.getLineMaxColumn(n)?(n===o.getLineCount()?n=1:n++,r=1):r++,new ae(n,r)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const n=this._decorations.matchBeforePosition(e);n&&this._setCurrentFindMatch(n);return}if(this._decorations.getCount()AE._getSearchRange(this._editor.getModel(),o));return this._editor.getModel().findMatches(this._state.searchString,r,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(130):null,t,n)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();e===null&&this._state.matchesCount>=iv?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new f0(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(130):null).parseSearchRequest();if(!t)return;let n=t.regex;if(!n.multiline){let d="mu";n.ignoreCase&&(d+="i"),n.global&&(d+="g"),n=new RegExp(n.source,d)}const r=this._editor.getModel(),o=r.getValue(1),s=r.getFullModelRange(),a=this._getReplacePattern();let l;const c=this._state.preserveCase;a.hasReplacementPatterns||c?l=o.replace(n,function(){return a.buildReplaceString(arguments,c)}):l=o.replace(n,a.buildReplaceString(null,c));const u=new oX(s,l,this._editor.getSelection());this._executeEditorCommand("replaceAll",u)}_regularReplaceAll(e){const t=this._getReplacePattern(),n=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),r=[];for(let s=0,a=n.length;ss.range),r);this._executeEditorCommand("replaceAll",o)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let n=this._findMatches(e,!1,1073741824).map(o=>new yt(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn));const r=this._editor.getSelection();for(let o=0,s=n.length;othis._hide(),2e3)),this._isVisible=!1,this._editor=e,this._state=t,this._keybindingService=n,this._domNode=document.createElement("div"),this._domNode.className="findOptionsWidget",this._domNode.style.display="none",this._domNode.style.top="10px",this._domNode.style.zIndex="12",this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true");const r={inputActiveOptionBorder:ht(Xq),inputActiveOptionForeground:ht(Yq),inputActiveOptionBackground:ht(B0)};this.caseSensitive=this._register(new t0e({appendTitle:this._keybindingLabelFor(Ni.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase,...r})),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new n0e({appendTitle:this._keybindingLabelFor(Ni.ToggleWholeWordCommand),isChecked:this._state.wholeWord,...r})),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new i0e({appendTitle:this._keybindingLabelFor(Ni.ToggleRegexCommand),isChecked:this._state.isRegex,...r})),this._domNode.appendChild(this.regex.domNode),this._register(this.regex.onChange(()=>{this._state.change({isRegex:this.regex.checked},!1)})),this._editor.addOverlayWidget(this),this._register(this._state.onFindReplaceStateChange(o=>{let s=!1;o.isRegex&&(this.regex.checked=this._state.isRegex,s=!0),o.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,s=!0),o.matchCase&&(this.caseSensitive.checked=this._state.matchCase,s=!0),!this._state.isRevealed&&s&&this._revealTemporarily()})),this._register(ye(this._domNode,Ge.MOUSE_LEAVE,o=>this._onMouseLeave())),this._register(ye(this._domNode,"mouseover",o=>this._onMouseOver()))}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return z3.ID}getDomNode(){return this._domNode}getPosition(){return{preference:0}}highlightFindOptions(){this._revealTemporarily()}_revealTemporarily(){this._show(),this._hideSoon.schedule()}_onMouseLeave(){this._hideSoon.schedule()}_onMouseOver(){this._hideSoon.cancel()}_show(){this._isVisible||(this._isVisible=!0,this._domNode.style.display="block")}_hide(){this._isVisible&&(this._isVisible=!1,this._domNode.style.display="none")}}z3.ID="editor.contrib.findOptionsWidget";function a2(i,e){return i===1?!0:i===2?!1:e}class vrt extends fe{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return a2(this._isRegexOverride,this._isRegex)}get wholeWord(){return a2(this._wholeWordOverride,this._wholeWord)}get matchCase(){return a2(this._matchCaseOverride,this._matchCase)}get preserveCase(){return a2(this._preserveCaseOverride,this._preserveCase)}get actualIsRegex(){return this._isRegex}get actualWholeWord(){return this._wholeWord}get actualMatchCase(){return this._matchCase}get actualPreserveCase(){return this._preserveCase}get searchScope(){return this._searchScope}get matchesPosition(){return this._matchesPosition}get matchesCount(){return this._matchesCount}get currentMatch(){return this._currentMatch}constructor(){super(),this._onFindReplaceStateChange=this._register(new se),this.onFindReplaceStateChange=this._onFindReplaceStateChange.event,this._searchString="",this._replaceString="",this._isRevealed=!1,this._isReplaceRevealed=!1,this._isRegex=!1,this._isRegexOverride=0,this._wholeWord=!1,this._wholeWordOverride=0,this._matchCase=!1,this._matchCaseOverride=0,this._preserveCase=!1,this._preserveCaseOverride=0,this._searchScope=null,this._matchesPosition=0,this._matchesCount=0,this._currentMatch=null,this._loop=!0,this._isSearching=!1,this._filters=null}changeMatchInfo(e,t,n){const r={moveCursor:!1,updateHistory:!1,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let o=!1;t===0&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,r.matchesPosition=!0,o=!0),this._matchesCount!==t&&(this._matchesCount=t,r.matchesCount=!0,o=!0),typeof n<"u"&&(B.equalsRange(this._currentMatch,n)||(this._currentMatch=n,r.currentMatch=!0,o=!0)),o&&this._onFindReplaceStateChange.fire(r)}change(e,t,n=!0){var r;const o={moveCursor:t,updateHistory:n,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let s=!1;const a=this.isRegex,l=this.wholeWord,c=this.matchCase,u=this.preserveCase;typeof e.searchString<"u"&&this._searchString!==e.searchString&&(this._searchString=e.searchString,o.searchString=!0,s=!0),typeof e.replaceString<"u"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,o.replaceString=!0,s=!0),typeof e.isRevealed<"u"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,o.isRevealed=!0,s=!0),typeof e.isReplaceRevealed<"u"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,o.isReplaceRevealed=!0,s=!0),typeof e.isRegex<"u"&&(this._isRegex=e.isRegex),typeof e.wholeWord<"u"&&(this._wholeWord=e.wholeWord),typeof e.matchCase<"u"&&(this._matchCase=e.matchCase),typeof e.preserveCase<"u"&&(this._preserveCase=e.preserveCase),typeof e.searchScope<"u"&&(!((r=e.searchScope)===null||r===void 0)&&r.every(d=>{var h;return(h=this._searchScope)===null||h===void 0?void 0:h.some(f=>!B.equalsRange(f,d))})||(this._searchScope=e.searchScope,o.searchScope=!0,s=!0)),typeof e.loop<"u"&&this._loop!==e.loop&&(this._loop=e.loop,o.loop=!0,s=!0),typeof e.isSearching<"u"&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,o.isSearching=!0,s=!0),typeof e.filters<"u"&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,o.filters=!0,s=!0),this._isRegexOverride=typeof e.isRegexOverride<"u"?e.isRegexOverride:0,this._wholeWordOverride=typeof e.wholeWordOverride<"u"?e.wholeWordOverride:0,this._matchCaseOverride=typeof e.matchCaseOverride<"u"?e.matchCaseOverride:0,this._preserveCaseOverride=typeof e.preserveCaseOverride<"u"?e.preserveCaseOverride:0,a!==this.isRegex&&(s=!0,o.isRegex=!0),l!==this.wholeWord&&(s=!0,o.wholeWord=!0),c!==this.matchCase&&(s=!0,o.matchCase=!0),u!==this.preserveCase&&(s=!0,o.preserveCase=!0),s&&this._onFindReplaceStateChange.fire(o)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition=iv}}const _rt=w("defaultLabel","input"),brt=w("label.preserveCaseToggle","Preserve Case");class Crt extends AS{constructor(e){super({icon:Xe.preserveCase,title:brt+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class yrt extends yc{constructor(e,t,n,r){super(),this._showOptionButtons=n,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new se),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new se),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new se),this._onInput=this._register(new se),this._onKeyUp=this._register(new se),this._onPreserveCaseKeyDown=this._register(new se),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=r.placeholder||"",this.validation=r.validation,this.label=r.label||_rt;const o=r.appendPreserveCaseLabel||"",s=r.history||[],a=!!r.flexibleHeight,l=!!r.flexibleWidth,c=r.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new r0e(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:s,showHistoryHint:r.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:c,inputBoxStyles:r.inputBoxStyles})),this.preserveCase=this._register(new Crt({appendTitle:o,isChecked:!1,...r.toggleStyles})),this._register(this.preserveCase.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(h=>{this._onPreserveCaseKeyDown.fire(h)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;const u=[this.preserveCase.domNode];this.onkeydown(this.domNode,h=>{if(h.equals(15)||h.equals(17)||h.equals(9)){const f=u.indexOf(this.domNode.ownerDocument.activeElement);if(f>=0){let g=-1;h.equals(17)?g=(f+1)%u.length:h.equals(15)&&(f===0?g=u.length-1:g=f-1),h.equals(9)?(u[f].blur(),this.inputBox.focus()):g>=0&&u[g].focus(),hn.stop(h,!0)}}});const d=document.createElement("div");d.className="controls",d.style.display=this._showOptionButtons?"block":"none",d.appendChild(this.preserveCase.domNode),this.domNode.appendChild(d),e==null||e.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,h=>this._onKeyDown.fire(h)),this.onkeyup(this.inputBox.inputElement,h=>this._onKeyUp.fire(h)),this.oninput(this.inputBox.inputElement,h=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,h=>this._onMouseDown.fire(h))}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()}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}validate(){var e;(e=this.inputBox)===null||e===void 0||e.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}var i1e=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},r1e=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const YY=new st("suggestWidgetVisible",!1,w("suggestWidgetVisible","Whether suggestion are visible")),ZY="historyNavigationWidgetFocus",o1e="historyNavigationForwardsEnabled",s1e="historyNavigationBackwardsEnabled";let _p;const l2=[];function a1e(i,e){if(l2.includes(e))throw new Error("Cannot register the same widget multiple times");l2.push(e);const t=new Te,n=new st(ZY,!1).bindTo(i),r=new st(o1e,!0).bindTo(i),o=new st(s1e,!0).bindTo(i),s=()=>{n.set(!0),_p=e},a=()=>{n.set(!1),_p===e&&(_p=void 0)};return Mk(e.element)&&s(),t.add(e.onDidFocus(()=>s())),t.add(e.onDidBlur(()=>a())),t.add(Rt(()=>{l2.splice(l2.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:r,historyNavigationBackwardsEnablement:o,dispose(){t.dispose()}}}let pU=class extends o0e{constructor(e,t,n,r){super(e,t,n);const o=this._register(r.createScoped(this.inputBox.element));this._register(a1e(o,this.inputBox))}};pU=i1e([r1e(3,Vt)],pU);let mU=class extends yrt{constructor(e,t,n,r,o=!1){super(e,t,o,n);const s=this._register(r.createScoped(this.inputBox.element));this._register(a1e(s,this.inputBox))}};mU=i1e([r1e(3,Vt)],mU);nl.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:De.and(De.has(ZY),De.equals(s1e,!0),De.not("isComposing"),YY.isEqualTo(!1)),primary:16,secondary:[528],handler:i=>{_p==null||_p.showPreviousValue()}});nl.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:De.and(De.has(ZY),De.equals(o1e,!0),De.not("isComposing"),YY.isEqualTo(!1)),primary:18,secondary:[530],handler:i=>{_p==null||_p.showNextValue()}});function zae(i){var e,t;return((e=i.lookupKeybinding("history.showPrevious"))===null||e===void 0?void 0:e.getElectronAccelerator())==="Up"&&((t=i.lookupKeybinding("history.showNext"))===null||t===void 0?void 0:t.getElectronAccelerator())==="Down"}const wrt=Mr("find-selection",Xe.selection,w("findSelectionIcon","Icon for 'Find in Selection' in the editor find widget.")),Uae=Mr("find-collapsed",Xe.chevronRight,w("findCollapsedIcon","Icon to indicate that the editor find widget is collapsed.")),jae=Mr("find-expanded",Xe.chevronDown,w("findExpandedIcon","Icon to indicate that the editor find widget is expanded.")),Srt=Mr("find-replace",Xe.replace,w("findReplaceIcon","Icon for 'Replace' in the editor find widget.")),xrt=Mr("find-replace-all",Xe.replaceAll,w("findReplaceAllIcon","Icon for 'Replace All' in the editor find widget.")),Lrt=Mr("find-previous-match",Xe.arrowUp,w("findPreviousMatchIcon","Icon for 'Find Previous' in the editor find widget.")),Ert=Mr("find-next-match",Xe.arrowDown,w("findNextMatchIcon","Icon for 'Find Next' in the editor find widget.")),Drt=w("label.findDialog","Find / Replace"),Irt=w("label.find","Find"),krt=w("placeholder.find","Find"),Trt=w("label.previousMatchButton","Previous Match"),Nrt=w("label.nextMatchButton","Next Match"),Rrt=w("label.toggleSelectionFind","Find in Selection"),Mrt=w("label.closeButton","Close"),Art=w("label.replace","Replace"),Prt=w("placeholder.replace","Replace"),Ort=w("label.replaceButton","Replace"),Frt=w("label.replaceAllButton","Replace All"),Brt=w("label.toggleReplaceButton","Toggle Replace"),Wrt=w("title.matchesCountLimit","Only the first {0} results are highlighted, but all find operations work on the entire text.",iv),$rt=w("label.matchesLocation","{0} of {1}"),Kae=w("label.noResults","No results"),zh=419,Hrt=275,Vrt=Hrt-54;let Jx=69;const zrt=33,Gae="ctrlEnterReplaceAll.windows.donotask",qae=Ln?256:2048;class P9{constructor(e){this.afterLineNumber=e,this.heightInPx=zrt,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function Xae(i,e,t){const n=!!e.match(/\n/);if(t&&n&&t.selectionStart>0){i.stopPropagation();return}}function Yae(i,e,t){const n=!!e.match(/\n/);if(t&&n&&t.selectionEndthis._updateHistoryDelayer.cancel())),this._register(this._state.onFindReplaceStateChange(u=>this._onStateChanged(u))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration(u=>{if(u.hasChanged(91)&&(this._codeEditor.getOption(91)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),u.hasChanged(144)&&this._tryUpdateWidgetWidth(),u.hasChanged(2)&&this.updateAccessibilitySupport(),u.hasChanged(41)){const d=this._codeEditor.getOption(41).loop;this._state.change({loop:d},!1);const h=this._codeEditor.getOption(41).addExtraSpaceOnTop;h&&!this._viewZone&&(this._viewZone=new P9(0),this._showViewZone()),!h&&this._viewZone&&this._removeViewZone()}})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(async()=>{if(this._isVisible){const u=await this._controller.getGlobalBufferTerm();u&&u!==this._state.searchString&&(this._state.change({searchString:u},!1),this._findInput.select())}})),this._findInputFocused=V3.bindTo(s),this._findFocusTracker=this._register(dh(this._findInput.inputBox.inputElement)),this._register(this._findFocusTracker.onDidFocus(()=>{this._findInputFocused.set(!0),this._updateSearchScope()})),this._register(this._findFocusTracker.onDidBlur(()=>{this._findInputFocused.set(!1)})),this._replaceInputFocused=XY.bindTo(s),this._replaceFocusTracker=this._register(dh(this._replaceInput.inputBox.inputElement)),this._register(this._replaceFocusTracker.onDidFocus(()=>{this._replaceInputFocused.set(!0),this._updateSearchScope()})),this._register(this._replaceFocusTracker.onDidBlur(()=>{this._replaceInputFocused.set(!1)})),this._codeEditor.addOverlayWidget(this),this._codeEditor.getOption(41).addExtraSpaceOnTop&&(this._viewZone=new P9(0)),this._register(this._codeEditor.onDidChangeModel(()=>{this._isVisible&&(this._viewZoneId=void 0)})),this._register(this._codeEditor.onDidScrollChange(u=>{if(u.scrollTopChanged){this._layoutViewZone();return}setTimeout(()=>{this._layoutViewZone()},0)}))}getId(){return U3.ID}getDomNode(){return this._domNode}getPosition(){return this._isVisible?{preference:0}:null}_onStateChanged(e){if(e.searchString){try{this._ignoreChangeEvent=!0,this._findInput.setValue(this._state.searchString)}finally{this._ignoreChangeEvent=!1}this._updateButtons()}if(e.replaceString&&(this._replaceInput.inputBox.value=this._state.replaceString),e.isRevealed&&(this._state.isRevealed?this._reveal():this._hide(!0)),e.isReplaceRevealed&&(this._state.isReplaceRevealed?!this._codeEditor.getOption(91)&&!this._isReplaceVisible&&(this._isReplaceVisible=!0,this._replaceInput.width=ua(this._findInput.domNode),this._updateButtons(),this._replaceInput.inputBox.layout()):this._isReplaceVisible&&(this._isReplaceVisible=!1,this._updateButtons())),(e.isRevealed||e.isReplaceRevealed)&&(this._state.isRevealed||this._state.isReplaceRevealed)&&this._tryUpdateHeight()&&this._showViewZone(),e.isRegex&&this._findInput.setRegex(this._state.isRegex),e.wholeWord&&this._findInput.setWholeWords(this._state.wholeWord),e.matchCase&&this._findInput.setCaseSensitive(this._state.matchCase),e.preserveCase&&this._replaceInput.setPreserveCase(this._state.preserveCase),e.searchScope&&(this._state.searchScope?this._toggleSelectionFind.checked=!0:this._toggleSelectionFind.checked=!1,this._updateToggleSelectionFindButton()),e.searchString||e.matchesCount||e.matchesPosition){const t=this._state.searchString.length>0&&this._state.matchesCount===0;this._domNode.classList.toggle("no-results",t),this._updateMatchesCount(),this._updateButtons()}(e.searchString||e.currentMatch)&&this._layoutViewZone(),e.updateHistory&&this._delayedUpdateHistory(),e.loop&&this._updateButtons()}_delayedUpdateHistory(){this._updateHistoryDelayer.trigger(this._updateHistory.bind(this)).then(void 0,en)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){this._matchesCount.style.minWidth=Jx+"px",this._state.matchesCount>=iv?this._matchesCount.title=Wrt:this._matchesCount.title="",this._matchesCount.firstChild&&this._matchesCount.removeChild(this._matchesCount.firstChild);let e;if(this._state.matchesCount>0){let t=String(this._state.matchesCount);this._state.matchesCount>=iv&&(t+="+");let n=String(this._state.matchesPosition);n==="0"&&(n="?"),e=Eb($rt,n,t)}else e=Kae;this._matchesCount.appendChild(document.createTextNode(e)),kl(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),Jx=Math.max(Jx,this._matchesCount.clientWidth)}_getAriaLabel(e,t,n){if(e===Kae)return n===""?w("ariaSearchNoResultEmpty","{0} found",e):w("ariaSearchNoResult","{0} found for '{1}'",e,n);if(t){const r=w("ariaSearchNoResultWithLineNum","{0} found for '{1}', at {2}",e,n,t.startLineNumber+":"+t.startColumn),o=this._codeEditor.getModel();return o&&t.startLineNumber<=o.getLineCount()&&t.startLineNumber>=1?`${o.getLineContent(t.startLineNumber)}, ${r}`:r}return w("ariaSearchNoResultWithLineNumNoCurrentMatch","{0} found for '{1}'",e,n)}_updateToggleSelectionFindButton(){const e=this._codeEditor.getSelection(),t=e?e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn:!1,n=this._toggleSelectionFind.checked;this._isVisible&&(n||t)?this._toggleSelectionFind.enable():this._toggleSelectionFind.disable()}_updateButtons(){this._findInput.setEnabled(this._isVisible),this._replaceInput.setEnabled(this._isVisible&&this._isReplaceVisible),this._updateToggleSelectionFindButton(),this._closeBtn.setEnabled(this._isVisible);const e=this._state.searchString.length>0,t=!!this._state.matchesCount;this._prevBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateBack()),this._nextBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateForward()),this._replaceBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._replaceAllBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._domNode.classList.toggle("replaceToggled",this._isReplaceVisible),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);const n=!this._codeEditor.getOption(91);this._toggleReplaceBtn.setEnabled(this._isVisible&&n)}_reveal(){if(this._revealTimeouts.forEach(e=>{clearTimeout(e)}),this._revealTimeouts=[],!this._isVisible){this._isVisible=!0;const e=this._codeEditor.getSelection();switch(this._codeEditor.getOption(41).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":{const n=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=n;break}}this._tryUpdateWidgetWidth(),this._updateButtons(),this._revealTimeouts.push(setTimeout(()=>{this._domNode.classList.add("visible"),this._domNode.setAttribute("aria-hidden","false")},0)),this._revealTimeouts.push(setTimeout(()=>{this._findInput.validate()},200)),this._codeEditor.layoutOverlayWidget(this);let t=!0;if(this._codeEditor.getOption(41).seedSearchStringFromSelection&&e){const n=this._codeEditor.getDomNode();if(n){const r=Br(n),o=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),s=r.left+(o?o.left:0),a=o?o.top:0;if(this._viewZone&&ae.startLineNumber&&(t=!1);const l=nme(this._domNode).left;s>l&&(t=!1);const c=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());r.left+(c?c.left:0)>l&&(t=!1)}}}this._showViewZone(t)}}_hide(e){this._revealTimeouts.forEach(t=>{clearTimeout(t)}),this._revealTimeouts=[],this._isVisible&&(this._isVisible=!1,this._updateButtons(),this._domNode.classList.remove("visible"),this._domNode.setAttribute("aria-hidden","true"),this._findInput.clearMessage(),e&&this._codeEditor.focus(),this._codeEditor.layoutOverlayWidget(this),this._removeViewZone())}_layoutViewZone(e){if(!this._codeEditor.getOption(41).addExtraSpaceOnTop){this._removeViewZone();return}if(!this._isVisible)return;const n=this._viewZone;this._viewZoneId!==void 0||!n||this._codeEditor.changeViewZones(r=>{n.heightInPx=this._getHeight(),this._viewZoneId=r.addZone(n),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+n.heightInPx)})}_showViewZone(e=!0){if(!this._isVisible||!this._codeEditor.getOption(41).addExtraSpaceOnTop)return;this._viewZone===void 0&&(this._viewZone=new P9(0));const n=this._viewZone;this._codeEditor.changeViewZones(r=>{if(this._viewZoneId!==void 0){const o=this._getHeight();if(o===n.heightInPx)return;const s=o-n.heightInPx;n.heightInPx=o,r.layoutZone(this._viewZoneId),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+s);return}else{let o=this._getHeight();if(o-=this._codeEditor.getOption(84).top,o<=0)return;n.heightInPx=o,this._viewZoneId=r.addZone(n),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+o)}})}_removeViewZone(){this._codeEditor.changeViewZones(e=>{this._viewZoneId!==void 0&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0,this._viewZone&&(this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()-this._viewZone.heightInPx),this._viewZone=void 0))})}_tryUpdateWidgetWidth(){if(!this._isVisible||!this._domNode.isConnected)return;const e=this._codeEditor.getLayoutInfo();if(e.contentWidth<=0){this._domNode.classList.add("hiddenEditor");return}else this._domNode.classList.contains("hiddenEditor")&&this._domNode.classList.remove("hiddenEditor");const n=e.width,r=e.minimap.minimapWidth;let o=!1,s=!1,a=!1;if(this._resized&&ua(this._domNode)>zh){this._domNode.style.maxWidth=`${n-28-r-15}px`,this._replaceInput.width=ua(this._findInput.domNode);return}if(zh+28+r>=n&&(s=!0),zh+28+r-Jx>=n&&(a=!0),zh+28+r-Jx>=n+50&&(o=!0),this._domNode.classList.toggle("collapsed-find-widget",o),this._domNode.classList.toggle("narrow-find-widget",a),this._domNode.classList.toggle("reduced-find-widget",s),!a&&!o&&(this._domNode.style.maxWidth=`${n-28-r-15}px`),this._findInput.layout({collapsedFindWidget:o,narrowFindWidget:a,reducedFindWidget:s}),this._resized){const l=this._findInput.inputBox.element.clientWidth;l>0&&(this._replaceInput.width=l)}else this._isReplaceVisible&&(this._replaceInput.width=ua(this._findInput.domNode))}_getHeight(){let e=0;return e+=4,e+=this._findInput.inputBox.height+2,this._isReplaceVisible&&(e+=4,e+=this._replaceInput.inputBox.height+2),e+=4,e}_tryUpdateHeight(){const e=this._getHeight();return this._cachedHeight!==null&&this._cachedHeight===e?!1:(this._cachedHeight=e,this._domNode.style.height=`${e}px`,!0)}focusFindInput(){this._findInput.select(),this._findInput.focus()}focusReplaceInput(){this._replaceInput.select(),this._replaceInput.focus()}highlightFindOptions(){this._findInput.highlightFindOptions()}_updateSearchScope(){if(this._codeEditor.hasModel()&&this._toggleSelectionFind.checked){const e=this._codeEditor.getSelections();e.map(t=>{t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(t.endLineNumber-1)));const n=this._state.currentMatch;return t.startLineNumber!==t.endLineNumber&&!B.equalsRange(t,n)?t:null}).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){if(e.equals(qae|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._findInput.inputBox.insertAtCursor(` `),e.preventDefault();return}if(e.equals(2)){this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return Xae(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return Yae(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(qae|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{Rs&&Jd&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(w("ctrlEnter.keybindingChanged","Ctrl+Enter now inserts line break instead of replacing all. You can modify the keybinding for editor.action.replaceAll to override this behavior.")),this._ctrlEnterReplaceAllWarningPrompted=!0,this._storageService.store(Gae,!0,0,0)),this._replaceInput.inputBox.insertAtCursor(` -`),e.preventDefault();return}if(e.equals(2)){this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(1026)){this._findInput.focus(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return Xae(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return Yae(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"))}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}_buildDomNode(){this._findInput=this._register(new pU(null,this._contextViewProvider,{width:Vrt,label:Irt,placeholder:krt,appendCaseSensitiveLabel:this._keybindingLabelFor(Ni.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(Ni.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(Ni.ToggleRegexCommand),validation:l=>{if(l.length===0||!this._findInput.getRegex())return null;try{return new RegExp(l,"gu"),null}catch(c){return{content:c.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>zae(this._keybindingService),inputBoxStyles:FP,toggleStyles:OP},this._contextKeyService)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown(l=>this._onFindInputKeyDown(l))),this._register(this._findInput.inputBox.onDidChange(()=>{this._ignoreChangeEvent||this._state.change({searchString:this._findInput.getValue()},!0)})),this._register(this._findInput.onDidOptionChange(()=>{this._state.change({isRegex:this._findInput.getRegex(),wholeWord:this._findInput.getWholeWords(),matchCase:this._findInput.getCaseSensitive()},!0)})),this._register(this._findInput.onCaseSensitiveKeyDown(l=>{l.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),l.preventDefault())})),this._register(this._findInput.onRegexKeyDown(l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),l.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(l=>{this._tryUpdateHeight()&&this._showViewZone()})),Da&&this._register(this._findInput.onMouseDown(l=>this._onFindInputMouseDown(l))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount(),this._prevBtn=this._register(new s1({label:Trt+this._keybindingLabelFor(Ni.PreviousMatchFindAction),icon:Lrt,onTrigger:()=>{Vm(this._codeEditor.getAction(Ni.PreviousMatchFindAction)).run().then(void 0,en)}})),this._nextBtn=this._register(new s1({label:Nrt+this._keybindingLabelFor(Ni.NextMatchFindAction),icon:Ert,onTrigger:()=>{Vm(this._codeEditor.getAction(Ni.NextMatchFindAction)).run().then(void 0,en)}}));const n=document.createElement("div");n.className="find-part",n.appendChild(this._findInput.domNode);const r=document.createElement("div");r.className="find-actions",n.appendChild(r),r.appendChild(this._matchesCount),r.appendChild(this._prevBtn.domNode),r.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new AS({icon:wrt,title:Rrt+this._keybindingLabelFor(Ni.ToggleSearchScopeCommand),isChecked:!1,inputActiveOptionBackground:ht(W0),inputActiveOptionBorder:ht(Xq),inputActiveOptionForeground:ht(Yq)})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){let l=this._codeEditor.getSelections();l=l.map(c=>(c.endColumn===1&&c.endLineNumber>c.startLineNumber&&(c=c.setEndPosition(c.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(c.endLineNumber-1))),c.isEmpty()?null:c)).filter(c=>!!c),l.length&&this._state.change({searchScope:l},!0)}}else this._state.change({searchScope:null},!0)})),r.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new s1({label:Mrt+this._keybindingLabelFor(Ni.CloseFindWidgetCommand),icon:N0e,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),l.preventDefault())}})),this._replaceInput=this._register(new mU(null,void 0,{label:Art,placeholder:Prt,appendPreserveCaseLabel:this._keybindingLabelFor(Ni.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>zae(this._keybindingService),inputBoxStyles:FP,toggleStyles:OP},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown(l=>this._onReplaceInputKeyDown(l))),this._register(this._replaceInput.inputBox.onDidChange(()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)})),this._register(this._replaceInput.inputBox.onDidHeightChange(l=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()})),this._register(this._replaceInput.onDidOptionChange(()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)})),this._register(this._replaceInput.onPreserveCaseKeyDown(l=>{l.equals(2)&&(this._prevBtn.isEnabled()?this._prevBtn.focus():this._nextBtn.isEnabled()?this._nextBtn.focus():this._toggleSelectionFind.enabled?this._toggleSelectionFind.focus():this._closeBtn.isEnabled()&&this._closeBtn.focus(),l.preventDefault())})),this._replaceBtn=this._register(new s1({label:Ort+this._keybindingLabelFor(Ni.ReplaceOneAction),icon:Srt,onTrigger:()=>{this._controller.replace()},onKeyDown:l=>{l.equals(1026)&&(this._closeBtn.focus(),l.preventDefault())}})),this._replaceAllBtn=this._register(new s1({label:Frt+this._keybindingLabelFor(Ni.ReplaceAllAction),icon:xrt,onTrigger:()=>{this._controller.replaceAll()}}));const o=document.createElement("div");o.className="replace-part",o.appendChild(this._replaceInput.domNode);const s=document.createElement("div");s.className="replace-actions",o.appendChild(s),s.appendChild(this._replaceBtn.domNode),s.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new s1({label:Brt,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=ua(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}})),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible),this._domNode=document.createElement("div"),this._domNode.className="editor-widget find-widget",this._domNode.setAttribute("aria-hidden","true"),this._domNode.ariaLabel=Drt,this._domNode.role="dialog",this._domNode.style.width=`${zh}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(n),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(o),this._resizeSash=this._register(new Ls(this._domNode,this,{orientation:0,size:2})),this._resized=!1;let a=zh;this._register(this._resizeSash.onDidStart(()=>{a=ua(this._domNode)})),this._register(this._resizeSash.onDidChange(l=>{this._resized=!0;const c=a+l.startX-l.currentX;if(cu||(this._domNode.style.width=`${c}px`,this._isReplaceVisible&&(this._replaceInput.width=ua(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const l=ua(this._domNode);if(l{this._opts.onTrigger(),n.preventDefault()}),this.onkeydown(this._domNode,n=>{var r,o;if(n.equals(10)||n.equals(3)){this._opts.onTrigger(),n.preventDefault();return}(o=(r=this._opts).onKeyDown)===null||o===void 0||o.call(r,n)})}get domNode(){return this._domNode}isEnabled(){return this._domNode.tabIndex>=0}focus(){this._domNode.focus()}setEnabled(e){this._domNode.classList.toggle("disabled",!e),this._domNode.setAttribute("aria-disabled",String(!e)),this._domNode.tabIndex=e?0:-1}setExpanded(e){this._domNode.setAttribute("aria-expanded",String(!!e)),e?(this._domNode.classList.remove(...Wt.asClassNameArray(Uae)),this._domNode.classList.add(...Wt.asClassNameArray(jae))):(this._domNode.classList.remove(...Wt.asClassNameArray(jae)),this._domNode.classList.add(...Wt.asClassNameArray(Uae)))}}fu((i,e)=>{const t=i.getColor(Gm);t&&e.addRule(`.monaco-editor .findMatch { border: 1px ${ih(i.type)?"dotted":"solid"} ${t}; box-sizing: border-box; }`);const n=i.getColor(sWe);n&&e.addRule(`.monaco-editor .findScope { border: 1px ${ih(i.type)?"dashed":"solid"} ${n}; }`);const r=i.getColor(Sn);r&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${r}; }`)});var l1e=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Pd=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},vU;const Urt=524288;function _U(i,e="single",t=!1){if(!i.hasModel())return null;const n=i.getSelection();if(e==="single"&&n.startLineNumber===n.endLineNumber||e==="multiple"){if(n.isEmpty()){const r=i.getConfiguredWordAtPosition(n.getStartPosition());if(r&&t===!1)return r.word}else if(i.getModel().getValueLengthInRange(n)this._onStateChanged(s))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{const s=this._editor.getModel()&&this._state.isRevealed;this.disposeModel(),this._state.change({searchScope:null,matchCase:this._storageService.getBoolean("editor.matchCase",1,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,!1),isRegex:this._storageService.getBoolean("editor.isRegex",1,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,!1)},!1),s&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(41).loop})}))}dispose(){this.disposeModel(),super.dispose()}disposeModel(){this._model&&(this._model.dispose(),this._model=null)}_onStateChanged(e){this.saveQueryState(e),e.isRevealed&&(this._state.isRevealed?this._findWidgetVisible.set(!0):(this._findWidgetVisible.reset(),this.disposeModel())),e.searchString&&this.setGlobalBufferTerm(this._state.searchString)}saveQueryState(e){e.isRegex&&this._storageService.store("editor.isRegex",this._state.actualIsRegex,1,1),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,1,1),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,1,1),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,1,1)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",1,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",1,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,this._state.preserveCase)},!1)}isFindInputFocused(){return!!V3.getValue(this._contextKeyService)}getState(){return this._state}closeFindWidget(){this._state.change({isRevealed:!1,searchScope:null},!1),this._editor.focus()}toggleCaseSensitive(){this._state.change({matchCase:!this._state.matchCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleWholeWords(){this._state.change({wholeWord:!this._state.wholeWord},!1),this._state.isRevealed||this.highlightFindOptions()}toggleRegex(){this._state.change({isRegex:!this._state.isRegex},!1),this._state.isRevealed||this.highlightFindOptions()}togglePreserveCase(){this._state.change({preserveCase:!this._state.preserveCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleSearchScope(){if(this._state.searchScope)this._state.change({searchScope:null},!0);else if(this._editor.hasModel()){let e=this._editor.getSelections();e=e.map(t=>(t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._editor.getModel().getLineMaxColumn(t.endLineNumber-1))),t.isEmpty()?null:t)).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}setSearchString(e){this._state.isRegex&&(e=fc(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}async _start(e,t){if(this.disposeModel(),!this._editor.hasModel())return;const n={...t,isRevealed:!0};if(e.seedSearchStringFromSelection==="single"){const r=_U(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);r&&(this._state.isRegex?n.searchString=fc(r):n.searchString=r)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const r=_U(this._editor,e.seedSearchStringFromSelection);r&&(n.searchString=r)}if(!n.searchString&&e.seedSearchStringFromGlobalClipboard){const r=await this.getGlobalBufferTerm();if(!this._editor.hasModel())return;r&&(n.searchString=r)}if(e.forceRevealReplace||n.isReplaceRevealed?n.isReplaceRevealed=!0:this._findWidgetVisible.get()||(n.isReplaceRevealed=!1),e.updateSearchScope){const r=this._editor.getSelections();r.some(o=>!o.isEmpty())&&(n.searchScope=r)}n.loop=e.loop,this._state.change(n,!1),this._model||(this._model=new AE(this._editor,this._state))}start(e,t){return this._start(e,t)}moveToNextMatch(){return this._model?(this._model.moveToNextMatch(),!0):!1}moveToPrevMatch(){return this._model?(this._model.moveToPrevMatch(),!0):!1}goToMatch(e){return this._model?(this._model.moveToMatch(e),!0):!1}replace(){return this._model?(this._model.replace(),!0):!1}replaceAll(){var e;return this._model?!((e=this._editor.getModel())===null||e===void 0)&&e.isTooLargeForHeapOperation()?(this._notificationService.warn(w("too.large.for.replaceall","The file is too large to perform a replace all operation.")),!1):(this._model.replaceAll(),!0):!1}selectAllMatches(){return this._model?(this._model.selectAllMatches(),this._editor.focus(),!0):!1}async getGlobalBufferTerm(){return this._editor.getOption(41).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""}setGlobalBufferTerm(e){this._editor.getOption(41).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)}};ka.ID="editor.contrib.findController";ka=vU=l1e([Pd(1,Vt),Pd(2,dd),Pd(3,jp),Pd(4,$r)],ka);let bU=class extends ka{constructor(e,t,n,r,o,s,a,l){super(e,n,a,l,s),this._contextViewService=t,this._keybindingService=r,this._themeService=o,this._widget=null,this._findOptionsWidget=null}async _start(e,t){this._widget||this._createFindWidget();const n=this._editor.getSelection();let r=!1;switch(this._editor.getOption(41).autoFindInSelection){case"always":r=!0;break;case"never":r=!1;break;case"multiline":{r=!!n&&n.startLineNumber!==n.endLineNumber;break}}e.updateSearchScope=e.updateSearchScope||r,await super._start(e,t),this._widget&&(e.shouldFocus===2?this._widget.focusReplaceInput():e.shouldFocus===1&&this._widget.focusFindInput())}highlightFindOptions(e=!1){this._widget||this._createFindWidget(),this._state.isRevealed&&!e?this._widget.highlightFindOptions():this._findOptionsWidget.highlightFindOptions()}_createFindWidget(){this._widget=this._register(new U3(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService)),this._findOptionsWidget=this._register(new z3(this._editor,this._state,this._keybindingService))}};bU=l1e([Pd(1,ng),Pd(2,Vt),Pd(3,ci),Pd(4,To),Pd(5,$r),Pd(6,dd),Pd(7,jp)],bU);const jrt=Cme(new bme({id:Ni.StartFindAction,label:w("startFindAction","Find"),alias:"Find",precondition:De.or(j.focus,De.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:$.MenubarEditMenu,group:"3_find",title:w({key:"miFind",comment:["&& denotes a mnemonic"]},"&&Find"),order:1}}));jrt.addImplementation(0,(i,e,t)=>{const n=ka.get(e);return n?n.start({forceRevealReplace:!1,seedSearchStringFromSelection:e.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(41).globalFindClipboard,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(41).loop}):!1});const Krt={description:"Open a new In-Editor Find Widget.",args:[{name:"Open a new In-Editor Find Widget args",schema:{properties:{searchString:{type:"string"},replaceString:{type:"string"},isRegex:{type:"boolean"},matchWholeWord:{type:"boolean"},isCaseSensitive:{type:"boolean"},preserveCase:{type:"boolean"},findInSelection:{type:"boolean"}}}}]};class Grt extends gt{constructor(){super({id:Ni.StartFindWithArgs,label:w("startFindWithArgsAction","Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},metadata:Krt})}async run(e,t,n){const r=ka.get(t);if(r){const o=n?{searchString:n.searchString,replaceString:n.replaceString,isReplaceRevealed:n.replaceString!==void 0,isRegex:n.isRegex,wholeWord:n.matchWholeWord,matchCase:n.isCaseSensitive,preserveCase:n.preserveCase}:{};await r.start({forceRevealReplace:!1,seedSearchStringFromSelection:r.getState().searchString.length===0&&t.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:1,shouldAnimate:!0,updateSearchScope:(n==null?void 0:n.findInSelection)||!1,loop:t.getOption(41).loop},o),r.setGlobalBufferTerm(r.getState().searchString)}}}class qrt extends gt{constructor(){super({id:Ni.StartFindWithSelection,label:w("startFindWithSelectionAction","Find With Selection"),alias:"Find With Selection",precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:2083},weight:100}})}async run(e,t){const n=ka.get(t);n&&(await n.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),n.setGlobalBufferTerm(n.getState().searchString))}}class c1e extends gt{async run(e,t){const n=ka.get(t);n&&!this._run(n)&&(await n.start({forceRevealReplace:!1,seedSearchStringFromSelection:n.getState().searchString.length===0&&t.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(n))}}class Xrt extends c1e{constructor(){super({id:Ni.NextMatchFindAction,label:w("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:j.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:De.and(j.focus,V3),primary:3,weight:100}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class Yrt extends c1e{constructor(){super({id:Ni.PreviousMatchFindAction,label:w("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:j.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:De.and(j.focus,V3),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}class Zrt extends gt{constructor(){super({id:Ni.GoToMatchFindAction,label:w("findMatchAction.goToMatch","Go to Match..."),alias:"Go to Match...",precondition:Kp}),this._highlightDecorations=[]}run(e,t,n){const r=ka.get(t);if(!r)return;const o=r.getState().matchesCount;if(o<1){e.get($r).notify({severity:j4.Warning,message:w("findMatchAction.noResults","No matches. Try searching for something else.")});return}const a=e.get(Eh).createInputBox();a.placeholder=w("findMatchAction.inputPlaceHolder","Type a number to go to a specific match (between 1 and {0})",o);const l=u=>{const d=parseInt(u);if(isNaN(d))return;const h=r.getState().matchesCount;if(d>0&&d<=h)return d-1;if(d<0&&d>=-h)return h+d},c=u=>{const d=l(u);if(typeof d=="number"){a.validationMessage=void 0,r.goToMatch(d);const h=r.getState().currentMatch;h&&this.addDecorations(t,h)}else a.validationMessage=w("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",r.getState().matchesCount),this.clearDecorations(t)};a.onDidChangeValue(u=>{c(u)}),a.onDidAccept(()=>{const u=l(a.value);typeof u=="number"?(r.goToMatch(u),a.hide()):a.validationMessage=w("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",r.getState().matchesCount)}),a.onDidHide(()=>{this.clearDecorations(t),a.dispose()}),a.show()}clearDecorations(e){e.changeDecorations(t=>{this._highlightDecorations=t.deltaDecorations(this._highlightDecorations,[])})}addDecorations(e,t){e.changeDecorations(n=>{this._highlightDecorations=n.deltaDecorations(this._highlightDecorations,[{range:t,options:{description:"find-match-quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"find-match-quick-access-range-highlight-overview",overviewRuler:{color:fr(Cve),position:mc.Full}}}])})}}class u1e extends gt{async run(e,t){const n=ka.get(t);if(!n)return;const r=_U(t,"single",!1);r&&n.setSearchString(r),this._run(n)||(await n.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(n))}}class Qrt extends u1e{constructor(){super({id:Ni.NextSelectionMatchFindAction,label:w("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:j.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class Jrt extends u1e{constructor(){super({id:Ni.PreviousSelectionMatchFindAction,label:w("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:j.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const eot=Cme(new bme({id:Ni.StartFindReplaceAction,label:w("startReplace","Replace"),alias:"Replace",precondition:De.or(j.focus,De.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:$.MenubarEditMenu,group:"3_find",title:w({key:"miReplace",comment:["&& denotes a mnemonic"]},"&&Replace"),order:2}}));eot.addImplementation(0,(i,e,t)=>{if(!e.hasModel()||e.getOption(91))return!1;const n=ka.get(e);if(!n)return!1;const r=e.getSelection(),o=n.isFindInputFocused(),s=!r.isEmpty()&&r.startLineNumber===r.endLineNumber&&e.getOption(41).seedSearchStringFromSelection!=="never"&&!o,a=o||s?2:1;return n.start({forceRevealReplace:!0,seedSearchStringFromSelection:s?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(41).seedSearchStringFromSelection!=="never",shouldFocus:a,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(41).loop})});jn(ka.ID,bU,0);Be(Grt);Be(qrt);Be(Xrt);Be(Yrt);Be(Zrt);Be(Qrt);Be(Jrt);const Ih=Vo.bindToContribution(ka.get);et(new Ih({id:Ni.CloseFindWidgetCommand,precondition:Kp,handler:i=>i.closeFindWidget(),kbOpts:{weight:100+5,kbExpr:De.and(j.focus,De.not("isComposing")),primary:9,secondary:[1033]}}));et(new Ih({id:Ni.ToggleCaseSensitiveCommand,precondition:void 0,handler:i=>i.toggleCaseSensitive(),kbOpts:{weight:100+5,kbExpr:j.focus,primary:n2.primary,mac:n2.mac,win:n2.win,linux:n2.linux}}));et(new Ih({id:Ni.ToggleWholeWordCommand,precondition:void 0,handler:i=>i.toggleWholeWords(),kbOpts:{weight:100+5,kbExpr:j.focus,primary:i2.primary,mac:i2.mac,win:i2.win,linux:i2.linux}}));et(new Ih({id:Ni.ToggleRegexCommand,precondition:void 0,handler:i=>i.toggleRegex(),kbOpts:{weight:100+5,kbExpr:j.focus,primary:r2.primary,mac:r2.mac,win:r2.win,linux:r2.linux}}));et(new Ih({id:Ni.ToggleSearchScopeCommand,precondition:void 0,handler:i=>i.toggleSearchScope(),kbOpts:{weight:100+5,kbExpr:j.focus,primary:o2.primary,mac:o2.mac,win:o2.win,linux:o2.linux}}));et(new Ih({id:Ni.TogglePreserveCaseCommand,precondition:void 0,handler:i=>i.togglePreserveCase(),kbOpts:{weight:100+5,kbExpr:j.focus,primary:s2.primary,mac:s2.mac,win:s2.win,linux:s2.linux}}));et(new Ih({id:Ni.ReplaceOneAction,precondition:Kp,handler:i=>i.replace(),kbOpts:{weight:100+5,kbExpr:j.focus,primary:3094}}));et(new Ih({id:Ni.ReplaceOneAction,precondition:Kp,handler:i=>i.replace(),kbOpts:{weight:100+5,kbExpr:De.and(j.focus,XY),primary:3}}));et(new Ih({id:Ni.ReplaceAllAction,precondition:Kp,handler:i=>i.replaceAll(),kbOpts:{weight:100+5,kbExpr:j.focus,primary:2563}}));et(new Ih({id:Ni.ReplaceAllAction,precondition:Kp,handler:i=>i.replaceAll(),kbOpts:{weight:100+5,kbExpr:De.and(j.focus,XY),primary:void 0,mac:{primary:2051}}}));et(new Ih({id:Ni.SelectAllMatchesAction,precondition:Kp,handler:i=>i.selectAllMatches(),kbOpts:{weight:100+5,kbExpr:j.focus,primary:515}}));const tot={[0]:" ",[1]:"u",[2]:"r"},Zae=65535,Od=16777215,Qae=4278190080;class O9{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,n=e%32;return(this._states[t]&1<Zae)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new O9(e.length),this._userDefinedStates=new O9(e.length),this._recoveredStates=new O9(e.length),this._types=n,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(n,r)=>{const o=e[e.length-1];return this.getStartLineNumber(o)<=n&&this.getEndLineNumber(o)>=r};for(let n=0,r=this._startIndexes.length;nOd||s>Od)throw new Error("startLineNumber or endLineNumber must not exceed "+Od);for(;e.length>0&&!t(o,s);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(n),this._startIndexes[n]=o+((a&255)<<24),this._endIndexes[n]=s+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&Od}getEndLineNumber(e){return this._endIndexes[e]&Od}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){return this._collapseStates.get(e)}setCollapsed(e,t){this._collapseStates.set(e,t)}isUserDefined(e){return this._userDefinedStates.get(e)}setUserDefined(e,t){return this._userDefinedStates.set(e,t)}isRecovered(e){return this._recoveredStates.get(e)}setRecovered(e,t){return this._recoveredStates.set(e,t)}getSource(e){return this.isUserDefined(e)?1:this.isRecovered(e)?2:0}setSource(e,t){t===1?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):t===2?(this.setUserDefined(e,!1),this.setRecovered(e,!0)):(this.setUserDefined(e,!1),this.setRecovered(e,!1))}setCollapsedAllOfType(e,t){let n=!1;if(this._types)for(let r=0;r>>24)+((this._endIndexes[e]&Qae)>>>16);return t===Zae?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,n=this._startIndexes.length;if(n===0)return-1;for(;t=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);t!==-1;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){const e=[];for(let t=0;tArray.isArray(p)?m=>mm=u.startLineNumber))c&&c.startLineNumber===u.startLineNumber?(u.source===1?p=u:(p=c,p.isCollapsed=u.isCollapsed&&c.endLineNumber===u.endLineNumber,p.source=0),c=o(++a)):(p=u,u.isCollapsed&&u.source===0&&(p.source=2)),u=s(++l);else{let v=l,m=u;for(;;){if(!m||m.startLineNumber>c.endLineNumber){p=c;break}if(m.source===1&&m.endLineNumber>c.endLineNumber)break;m=s(++v)}c=o(++a)}if(p){for(;h&&h.endLineNumberp.startLineNumber&&p.startLineNumber>f&&p.endLineNumber<=n&&(!h||h.endLineNumber>=p.endLineNumber)&&(g.push(p),f=p.startLineNumber,h&&d.push(h),h=p)}}return g}}class not{constructor(e,t){this.ranges=e,this.index=t}get startLineNumber(){return this.ranges.getStartLineNumber(this.index)}get endLineNumber(){return this.ranges.getEndLineNumber(this.index)}get regionIndex(){return this.index}get parentIndex(){return this.ranges.getParentIndex(this.index)}get isCollapsed(){return this.ranges.isCollapsed(this.index)}containedBy(e){return e.startLineNumber<=this.startLineNumber&&e.endLineNumber>=this.endLineNumber}containsLine(e){return this.startLineNumber<=e&&e<=this.endLineNumber}}class iot{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new se,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new ec(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(e){if(!e.length)return;e=e.sort((n,r)=>n.regionIndex-r.regionIndex);const t={};this._decorationProvider.changeDecorations(n=>{let r=0,o=-1,s=-1;const a=l=>{for(;rs&&(s=c),r++}};for(const l of e){const c=l.regionIndex,u=this._editorDecorationIds[c];if(u&&!t[u]){t[u]=!0,a(c);const d=!this._regions.isCollapsed(c);this._regions.setCollapsed(c,d),o=Math.max(o,this._regions.getEndLineNumber(c))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,n=r=>{for(const o of e)if(!(o.startLineNumber>r.endLineNumber||r.startLineNumber>o.endLineNumber))return!0;return!1};for(let r=0;rn&&(n=a)}this._decorationProvider.changeDecorations(r=>this._editorDecorationIds=r.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e=[]){const t=(r,o)=>{for(const s of e)if(r=s.endLineNumber||s.startLineNumber<1||s.endLineNumber>n)continue;const a=this._getLinesChecksum(s.startLineNumber+1,s.endLineNumber);t.push({startLineNumber:s.startLineNumber,endLineNumber:s.endLineNumber,isCollapsed:s.isCollapsed,source:s.source,checksum:a})}return t.length>0?t:void 0}applyMemento(e){var t,n;if(!Array.isArray(e))return;const r=[],o=this._textModel.getLineCount();for(const a of e){if(a.startLineNumber>=a.endLineNumber||a.startLineNumber<1||a.endLineNumber>o)continue;const l=this._getLinesChecksum(a.startLineNumber+1,a.endLineNumber);(!a.checksum||l===a.checksum)&&r.push({startLineNumber:a.startLineNumber,endLineNumber:a.endLineNumber,type:void 0,isCollapsed:(t=a.isCollapsed)!==null&&t!==void 0?t:!0,source:(n=a.source)!==null&&n!==void 0?n:0})}const s=ec.sanitizeAndMerge(this._regions,r,o);this.updatePost(ec.fromFoldRanges(s))}_getLinesChecksum(e,t){return l4(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const n=[];if(this._regions){let r=this._regions.findRange(e),o=1;for(;r>=0;){const s=this._regions.toRegion(r);(!t||t(s,o))&&n.push(s),o++,r=s.parentIndex}}return n}getRegionAtLine(e){if(this._regions){const t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null}getRegionsInside(e,t){const n=[],r=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const s=[];for(let a=r,l=this._regions.length;a0&&!c.containedBy(s[s.length-1]);)s.pop();s.push(c),t(c,s.length)&&n.push(c)}else break}}else for(let s=r,a=this._regions.length;s1){const a=i.getRegionsInside(o,(l,c)=>l.isCollapsed!==s&&c0)for(const o of n){const s=i.getRegionAtLine(o);if(s&&(s.isCollapsed!==e&&r.push(s),t>1)){const a=i.getRegionsInside(s,(l,c)=>l.isCollapsed!==e&&cs.isCollapsed!==e&&aa.isCollapsed!==e&&l<=t);r.push(...s)}i.toggleCollapseState(r)}function rot(i,e,t){const n=[];for(const r of t){const o=i.getAllRegionsAtLine(r,s=>s.isCollapsed!==e);o.length>0&&n.push(o[0])}i.toggleCollapseState(n)}function oot(i,e,t,n){const r=(s,a)=>a===e&&s.isCollapsed!==t&&!n.some(l=>s.containsLine(l)),o=i.getRegionsInside(null,r);i.toggleCollapseState(o)}function f1e(i,e,t){const n=[];for(const s of t){const a=i.getAllRegionsAtLine(s,void 0);a.length>0&&n.push(a[0])}const r=s=>n.every(a=>!a.containedBy(s)&&!s.containedBy(a))&&s.isCollapsed!==e,o=i.getRegionsInside(null,r);i.toggleCollapseState(o)}function QY(i,e,t){const n=i.textModel,r=i.regions,o=[];for(let s=r.length-1;s>=0;s--)if(t!==r.isCollapsed(s)){const a=r.getStartLineNumber(s);e.test(n.getLineContent(a))&&o.push(r.toRegion(s))}i.toggleCollapseState(o)}function JY(i,e,t){const n=i.regions,r=[];for(let o=n.length-1;o>=0;o--)t!==n.isCollapsed(o)&&e===n.getType(o)&&r.push(n.toRegion(o));i.toggleCollapseState(r)}function sot(i,e){let t=null;const n=e.getRegionAtLine(i);if(n!==null&&(t=n.startLineNumber,i===t)){const r=n.parentIndex;r!==-1?t=e.regions.getStartLineNumber(r):t=null}return t}function aot(i,e){let t=e.getRegionAtLine(i);if(t!==null&&t.startLineNumber===i){if(i!==t.startLineNumber)return t.startLineNumber;{const n=t.parentIndex;let r=0;for(n!==-1&&(r=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=r)return null;if(t.parentIndex===n)return t.startLineNumber}else return null}}else if(e.regions.length>0)for(t=e.regions.toRegion(e.regions.length-1);t!==null;){if(t.startLineNumber0?t=e.regions.toRegion(t.regionIndex-1):t=null}return null}function lot(i,e){let t=e.getRegionAtLine(i);if(t!==null&&t.startLineNumber===i){const n=t.parentIndex;let r=0;if(n!==-1)r=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;r=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex=r)return null;if(t.parentIndex===n)return t.startLineNumber}else return null}else if(e.regions.length>0)for(t=e.regions.toRegion(0);t!==null;){if(t.startLineNumber>i)return t.startLineNumber;t.regionIndexthis.updateHiddenRanges()),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}notifyChangeModelContent(e){this._hiddenRanges.length&&!this._hasLineChanges&&(this._hasLineChanges=e.changes.some(t=>t.range.endLineNumber!==t.range.startLineNumber||Zv(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let n=0,r=0,o=Number.MAX_VALUE,s=-1;const a=this._foldingModel.regions;for(;n0}isHidden(e){return Jae(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const n=this._foldingModel.textModel;let r=null;const o=s=>((!r||!uot(s,r))&&(r=Jae(this._hiddenRanges,s)),r?r.startLineNumber-1:null);for(let s=0,a=e.length;s0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function uot(i,e){return i>=e.startLineNumber&&i<=e.endLineNumber}function Jae(i,e){const t=AD(i,n=>e=0&&i[t].endLineNumber>=e?i[t]:null}const dot=5e3,hot="indent";class eZ{constructor(e,t,n){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=n,this.id=hot}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,n=t&&!!t.offSide,r=t&&t.markers;return Promise.resolve(pot(this.editorModel,n,r,this.foldingRangesLimit))}}let fot=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,n){if(e>Od||t>Od)return;const r=this._length;this._startIndexes[r]=e,this._endIndexes[r]=t,this._length++,n<1e3&&(this._indentOccurrences[n]=(this._indentOccurrences[n]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const n=new Uint32Array(this._length),r=new Uint32Array(this._length);for(let o=this._length-1,s=0;o>=0;o--,s++)n[s]=this._startIndexes[o],r[s]=this._endIndexes[o];return new ec(n,r)}else{this._foldingRangesLimit.update(this._length,t);let n=0,r=this._indentOccurrences.length;for(let l=0;lt){r=l;break}n+=c}}const o=e.getOptions().tabSize,s=new Uint32Array(t),a=new Uint32Array(t);for(let l=this._length-1,c=0;l>=0;l--){const u=this._startIndexes[l],d=e.getLineContent(u),h=H4(d,o);(h{}};function pot(i,e,t,n=got){const r=i.getOptions().tabSize,o=new fot(n);let s;t&&(s=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],l=i.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let c=i.getLineCount();c>0;c--){const u=i.getLineContent(c),d=H4(u,r);let h=a[a.length-1];if(d===-1){e&&(h.endAbove=c);continue}let f;if(s&&(f=u.match(s)))if(f[1]){let g=a.length-1;for(;g>0&&a[g].indent!==-2;)g--;if(g>0){a.length=g+1,h=a[g],o.insertFirst(c,h.line,d),h.line=c,h.indent=d,h.endAbove=c;continue}}else{a.push({indent:-2,endAbove:c,line:c});continue}if(h.indent>d){do a.pop(),h=a[a.length-1];while(h.indent>d);const g=h.endAbove-1;g-c>=1&&o.insertFirst(c,g,d)}h.indent===d?h.endAbove=c:a.push({indent:d,endAbove:c,line:c})}return o.toIndentRanges(i)}const mot=X("editor.foldBackground",{light:It(Km,.3),dark:It(Km,.3),hcDark:null,hcLight:null},w("foldBackgroundBackground","Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);X("editorGutter.foldingControlForeground",{dark:Cf,light:Cf,hcDark:Cf,hcLight:Cf},w("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));const j3=Mr("folding-expanded",Xe.chevronDown,w("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),K3=Mr("folding-collapsed",Xe.chevronRight,w("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin.")),g1e=Mr("folding-manual-collapsed",K3,w("foldingManualCollapedIcon","Icon for manually collapsed ranges in the editor glyph margin.")),p1e=Mr("folding-manual-expanded",j3,w("foldingManualExpandedIcon","Icon for manually expanded ranges in the editor glyph margin.")),tZ={color:fr(mot),position:Ll.Inline},zS=w("linesCollapsed","Click to expand the range."),G3=w("linesExpanded","Click to collapse the range.");class jr{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,n){return t?jr.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?jr.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:jr.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:jr.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?n?this.showFoldingHighlights?jr.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:jr.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?jr.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:jr.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?n?jr.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:jr.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:n?jr.MANUALLY_EXPANDED_VISUAL_DECORATION:jr.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}}jr.COLLAPSED_VISUAL_DECORATION=sn.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:zS,firstLineDecorationClassName:Wt.asClassName(K3)});jr.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=sn.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:tZ,isWholeLine:!0,linesDecorationsTooltip:zS,firstLineDecorationClassName:Wt.asClassName(K3)});jr.MANUALLY_COLLAPSED_VISUAL_DECORATION=sn.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:zS,firstLineDecorationClassName:Wt.asClassName(g1e)});jr.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=sn.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:tZ,isWholeLine:!0,linesDecorationsTooltip:zS,firstLineDecorationClassName:Wt.asClassName(g1e)});jr.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=sn.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:zS});jr.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=sn.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:tZ,isWholeLine:!0,linesDecorationsTooltip:zS});jr.EXPANDED_VISUAL_DECORATION=sn.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Wt.asClassName(j3),linesDecorationsTooltip:G3});jr.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=sn.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:Wt.asClassName(j3),linesDecorationsTooltip:G3});jr.MANUALLY_EXPANDED_VISUAL_DECORATION=sn.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Wt.asClassName(p1e),linesDecorationsTooltip:G3});jr.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=sn.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:Wt.asClassName(p1e),linesDecorationsTooltip:G3});jr.NO_CONTROLS_EXPANDED_RANGE_DECORATION=sn.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0});jr.HIDDEN_RANGE_DECORATION=sn.register({description:"folding-hidden-range-decoration",stickiness:1});const vot={},_ot="syntax";class nZ{constructor(e,t,n,r,o){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=n,this.foldingRangesLimit=r,this.fallbackRangeProvider=o,this.id=_ot,this.disposables=new Te,o&&this.disposables.add(o);for(const s of t)typeof s.onDidChange=="function"&&this.disposables.add(s.onDidChange(n))}compute(e){return bot(this.providers,this.editorModel,e).then(t=>{var n,r;return t?yot(t,this.foldingRangesLimit):(r=(n=this.fallbackRangeProvider)===null||n===void 0?void 0:n.compute(e))!==null&&r!==void 0?r:null})}dispose(){this.disposables.dispose()}}function bot(i,e,t){let n=null;const r=i.map((o,s)=>Promise.resolve(o.provideFoldingRanges(e,vot,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(n)||(n=[]);const l=e.getLineCount();for(const c of a)c.start>0&&c.end>c.start&&c.end<=l&&n.push({start:c.start,end:c.end,rank:s,kind:c.kind})}},Zr));return Promise.all(r).then(o=>n)}class Cot{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,n,r){if(e>Od||t>Od)return;const o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._nestingLevels[o]=r,this._types[o]=n,this._length++,r<30&&(this._nestingLevelCounts[r]=(this._nestingLevelCounts[r]||0)+1)}toIndentRanges(){const e=this._foldingRangesLimit.limit;if(this._length<=e){this._foldingRangesLimit.update(this._length,!1);const t=new Uint32Array(this._length),n=new Uint32Array(this._length);for(let r=0;re){n=a;break}t+=l}}const r=new Uint32Array(e),o=new Uint32Array(e),s=[];for(let a=0,l=0;a{let l=s.start-a.start;return l===0&&(l=s.rank-a.rank),l}),n=new Cot(e);let r;const o=[];for(const s of t)if(!r)r=s,n.add(s.start,s.end,s.kind&&s.kind.value,o.length);else if(s.start>r.start)if(s.end<=r.end)o.push(r),r=s,n.add(s.start,s.end,s.kind&&s.kind.value,o.length);else{if(s.start>r.end){do r=o.pop();while(r&&s.start>r.end);r&&o.push(r),r=s}n.add(s.start,s.end,s.kind&&s.kind.value,o.length)}return n.toIndentRanges()}var wot=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},eL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},N1;const Os=new st("foldingEnabled",!1);let Xf=N1=class extends fe{static get(e){return e.getContribution(N1.ID)}static getFoldingRangeProviders(e,t){var n,r;const o=e.foldingRangeProvider.ordered(t);return(r=(n=N1._foldingRangeSelector)===null||n===void 0?void 0:n.call(N1,o,t))!==null&&r!==void 0?r:o}constructor(e,t,n,r,o,s){super(),this.contextKeyService=t,this.languageConfigurationService=n,this.languageFeaturesService=s,this.localToDispose=this._register(new Te),this.editor=e,this._foldingLimitReporter=new m1e(e);const a=this.editor.getOptions();this._isEnabled=a.get(43),this._useFoldingProviders=a.get(44)!=="indentation",this._unfoldOnClickAfterEndOfLine=a.get(48),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=a.get(46),this.updateDebounceInfo=o.for(s.foldingRangeProvider,"Folding",{min:200}),this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new jr(e),this.foldingDecorationProvider.showFoldingControls=a.get(110),this.foldingDecorationProvider.showFoldingHighlights=a.get(45),this.foldingEnabled=Os.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(l=>{if(l.hasChanged(43)&&(this._isEnabled=this.editor.getOptions().get(43),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),l.hasChanged(47)&&this.onModelChanged(),l.hasChanged(110)||l.hasChanged(45)){const c=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=c.get(110),this.foldingDecorationProvider.showFoldingHighlights=c.get(45),this.triggerFoldingModelChanged()}l.hasChanged(44)&&(this._useFoldingProviders=this.editor.getOptions().get(44)!=="indentation",this.onFoldingStrategyChanged()),l.hasChanged(48)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(48)),l.hasChanged(46)&&(this._foldingImportsByDefault=this.editor.getOptions().get(46))})),this.onModelChanged()}saveViewState(){const e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){const t=this.foldingModel.getMemento(),n=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:n,foldedImports:this._currentModelHasFoldedImports}}}restoreViewState(e){const t=this.editor.getModel();if(!(!t||!this._isEnabled||t.isTooLargeForTokenization()||!this.hiddenRangeModel)&&e&&(this._currentModelHasFoldedImports=!!e.foldedImports,e.collapsedRegions&&e.collapsedRegions.length>0&&this.foldingModel)){this._restoringViewState=!0;try{this.foldingModel.applyMemento(e.collapsedRegions)}finally{this._restoringViewState=!1}}}onModelChanged(){this.localToDispose.clear();const e=this.editor.getModel();!this._isEnabled||!e||e.isTooLargeForTokenization()||(this._currentModelHasFoldedImports=!1,this.foldingModel=new iot(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new cot(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new nd(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new pi(()=>this.revealCursor(),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(this.languageFeaturesService.foldingRangeProvider.onDidChange(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelContent(t=>this.onDidChangeModelContent(t))),this.localToDispose.add(this.editor.onDidChangeCursorPosition(()=>this.onCursorPositionChanged())),this.localToDispose.add(this.editor.onMouseDown(t=>this.onEditorMouseDown(t))),this.localToDispose.add(this.editor.onMouseUp(t=>this.onEditorMouseUp(t))),this.localToDispose.add({dispose:()=>{var t,n;this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),(t=this.updateScheduler)===null||t===void 0||t.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,(n=this.rangeProvider)===null||n===void 0||n.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){var e;(e=this.rangeProvider)===null||e===void 0||e.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new eZ(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const n=N1.getFoldingRangeProviders(this.languageFeaturesService,e);n.length>0&&(this.rangeProvider=new nZ(e,n,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){var t;(t=this.hiddenRangeModel)===null||t===void 0||t.notifyChangeModelContent(e),this.triggerFoldingModelChanged()}triggerFoldingModelChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger(()=>{const e=this.foldingModel;if(!e)return null;const t=new Ms,n=this.getRangeProvider(e.textModel),r=this.foldingRegionPromise=Io(o=>n.compute(o));return r.then(o=>{if(o&&r===this.foldingRegionPromise){let s;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const u=o.setCollapsedAllOfType(ba.Imports.value,!0);u&&(s=_h.capture(this.editor),this._currentModelHasFoldedImports=u)}const a=this.editor.getSelections(),l=a?a.map(u=>u.startLineNumber):[];e.update(o,l),s==null||s.restore(this.editor);const c=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=c)}return e})}).then(void 0,e=>(en(e),null)))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){const t=this.editor.getSelections();t&&this.hiddenRangeModel.adjustSelections(t)&&this.editor.setSelections(t)}this.editor.setHiddenAreas(e,this)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then(t=>{if(t){const n=this.editor.getSelections();if(n&&n.length>0){const r=[];for(const o of n){const s=o.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(s)&&r.push(...t.getAllRegionsAtLine(s,a=>a.isCollapsed&&s>a.startLineNumber))}r.length&&(t.toggleCollapseState(r),this.reveal(n[0].getPosition()))}}}).then(void 0,en)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range||!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let n=!1;switch(e.target.type){case 4:{const r=e.target.detail,o=e.target.element.offsetLeft;if(r.offsetX-o<4)return;n=!0;break}case 7:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case 6:{if(this.hiddenRangeModel.hasRanges()){const r=this.editor.getModel();if(r&&t.startColumn===r.getLineMaxColumn(t.startLineNumber))break}return}default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:n}}onEditorMouseUp(e){const t=this.foldingModel;if(!t||!this.mouseDownInfo||!e.target)return;const n=this.mouseDownInfo.lineNumber,r=this.mouseDownInfo.iconClicked,o=e.target.range;if(!o||o.startLineNumber!==n)return;if(r){if(e.target.type!==4)return}else{const a=this.editor.getModel();if(!a||o.startColumn!==a.getLineMaxColumn(n))return}const s=t.getRegionAtLine(n);if(s&&s.startLineNumber===n){const a=s.isCollapsed;if(r||a){const l=e.event.altKey;let c=[];if(l){const u=h=>!h.containedBy(s)&&!s.containedBy(h),d=t.getRegionsInside(null,u);for(const h of d)h.isCollapsed&&c.push(h);c.length===0&&(c=d)}else{const u=e.event.middleButton||e.event.shiftKey;if(u)for(const d of t.getRegionsInside(s))d.isCollapsed===a&&c.push(d);(a||!u||c.length===0)&&c.push(s)}t.toggleCollapseState(c),this.reveal({lineNumber:n,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};Xf.ID="editor.contrib.folding";Xf=N1=wot([eL(1,Vt),eL(2,Di),eL(3,$r),eL(4,gu),eL(5,_t)],Xf);class m1e{constructor(e){this.editor=e,this._onDidChange=new se,this._computed=0,this._limited=!1}get limit(){return this.editor.getOptions().get(47)}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}class ta extends gt{runEditorCommand(e,t,n){const r=e.get(Di),o=Xf.get(t);if(!o)return;const s=o.getFoldingModel();if(s)return this.reportTelemetry(e,t),s.then(a=>{if(a){this.invoke(o,a,t,n,r);const l=t.getSelection();l&&o.reveal(l.getStartPosition())}})}getSelectedLines(e){const t=e.getSelections();return t?t.map(n=>n.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(n=>n+1):this.getSelectedLines(t)}run(e,t){}}function v1e(i){if(!Cl(i)){if(!va(i))return!1;const e=i;if(!Cl(e.levels)&&!Hv(e.levels)||!Cl(e.direction)&&!Sa(e.direction)||!Cl(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(Hv)))return!1}return!0}class Sot extends ta{constructor(){super({id:"editor.unfold",label:w("unfoldAction.label","Unfold"),alias:"Unfold",precondition:Os,kbOpts:{kbExpr:j.editorTextFocus,primary:3166,mac:{primary:2654},weight:100},metadata:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:`Property-value pairs that can be passed through this argument: +`),e.preventDefault();return}if(e.equals(2)){this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(1026)){this._findInput.focus(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return Xae(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return Yae(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"))}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}_buildDomNode(){this._findInput=this._register(new pU(null,this._contextViewProvider,{width:Vrt,label:Irt,placeholder:krt,appendCaseSensitiveLabel:this._keybindingLabelFor(Ni.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(Ni.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(Ni.ToggleRegexCommand),validation:l=>{if(l.length===0||!this._findInput.getRegex())return null;try{return new RegExp(l,"gu"),null}catch(c){return{content:c.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>zae(this._keybindingService),inputBoxStyles:FP,toggleStyles:OP},this._contextKeyService)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown(l=>this._onFindInputKeyDown(l))),this._register(this._findInput.inputBox.onDidChange(()=>{this._ignoreChangeEvent||this._state.change({searchString:this._findInput.getValue()},!0)})),this._register(this._findInput.onDidOptionChange(()=>{this._state.change({isRegex:this._findInput.getRegex(),wholeWord:this._findInput.getWholeWords(),matchCase:this._findInput.getCaseSensitive()},!0)})),this._register(this._findInput.onCaseSensitiveKeyDown(l=>{l.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),l.preventDefault())})),this._register(this._findInput.onRegexKeyDown(l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),l.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(l=>{this._tryUpdateHeight()&&this._showViewZone()})),Da&&this._register(this._findInput.onMouseDown(l=>this._onFindInputMouseDown(l))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount(),this._prevBtn=this._register(new s1({label:Trt+this._keybindingLabelFor(Ni.PreviousMatchFindAction),icon:Lrt,onTrigger:()=>{zm(this._codeEditor.getAction(Ni.PreviousMatchFindAction)).run().then(void 0,en)}})),this._nextBtn=this._register(new s1({label:Nrt+this._keybindingLabelFor(Ni.NextMatchFindAction),icon:Ert,onTrigger:()=>{zm(this._codeEditor.getAction(Ni.NextMatchFindAction)).run().then(void 0,en)}}));const n=document.createElement("div");n.className="find-part",n.appendChild(this._findInput.domNode);const r=document.createElement("div");r.className="find-actions",n.appendChild(r),r.appendChild(this._matchesCount),r.appendChild(this._prevBtn.domNode),r.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new AS({icon:wrt,title:Rrt+this._keybindingLabelFor(Ni.ToggleSearchScopeCommand),isChecked:!1,inputActiveOptionBackground:ht(B0),inputActiveOptionBorder:ht(Xq),inputActiveOptionForeground:ht(Yq)})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){let l=this._codeEditor.getSelections();l=l.map(c=>(c.endColumn===1&&c.endLineNumber>c.startLineNumber&&(c=c.setEndPosition(c.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(c.endLineNumber-1))),c.isEmpty()?null:c)).filter(c=>!!c),l.length&&this._state.change({searchScope:l},!0)}}else this._state.change({searchScope:null},!0)})),r.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new s1({label:Mrt+this._keybindingLabelFor(Ni.CloseFindWidgetCommand),icon:N0e,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),l.preventDefault())}})),this._replaceInput=this._register(new mU(null,void 0,{label:Art,placeholder:Prt,appendPreserveCaseLabel:this._keybindingLabelFor(Ni.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>zae(this._keybindingService),inputBoxStyles:FP,toggleStyles:OP},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown(l=>this._onReplaceInputKeyDown(l))),this._register(this._replaceInput.inputBox.onDidChange(()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)})),this._register(this._replaceInput.inputBox.onDidHeightChange(l=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()})),this._register(this._replaceInput.onDidOptionChange(()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)})),this._register(this._replaceInput.onPreserveCaseKeyDown(l=>{l.equals(2)&&(this._prevBtn.isEnabled()?this._prevBtn.focus():this._nextBtn.isEnabled()?this._nextBtn.focus():this._toggleSelectionFind.enabled?this._toggleSelectionFind.focus():this._closeBtn.isEnabled()&&this._closeBtn.focus(),l.preventDefault())})),this._replaceBtn=this._register(new s1({label:Ort+this._keybindingLabelFor(Ni.ReplaceOneAction),icon:Srt,onTrigger:()=>{this._controller.replace()},onKeyDown:l=>{l.equals(1026)&&(this._closeBtn.focus(),l.preventDefault())}})),this._replaceAllBtn=this._register(new s1({label:Frt+this._keybindingLabelFor(Ni.ReplaceAllAction),icon:xrt,onTrigger:()=>{this._controller.replaceAll()}}));const o=document.createElement("div");o.className="replace-part",o.appendChild(this._replaceInput.domNode);const s=document.createElement("div");s.className="replace-actions",o.appendChild(s),s.appendChild(this._replaceBtn.domNode),s.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new s1({label:Brt,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=ua(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}})),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible),this._domNode=document.createElement("div"),this._domNode.className="editor-widget find-widget",this._domNode.setAttribute("aria-hidden","true"),this._domNode.ariaLabel=Drt,this._domNode.role="dialog",this._domNode.style.width=`${zh}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(n),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(o),this._resizeSash=this._register(new Ls(this._domNode,this,{orientation:0,size:2})),this._resized=!1;let a=zh;this._register(this._resizeSash.onDidStart(()=>{a=ua(this._domNode)})),this._register(this._resizeSash.onDidChange(l=>{this._resized=!0;const c=a+l.startX-l.currentX;if(cu||(this._domNode.style.width=`${c}px`,this._isReplaceVisible&&(this._replaceInput.width=ua(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const l=ua(this._domNode);if(l{this._opts.onTrigger(),n.preventDefault()}),this.onkeydown(this._domNode,n=>{var r,o;if(n.equals(10)||n.equals(3)){this._opts.onTrigger(),n.preventDefault();return}(o=(r=this._opts).onKeyDown)===null||o===void 0||o.call(r,n)})}get domNode(){return this._domNode}isEnabled(){return this._domNode.tabIndex>=0}focus(){this._domNode.focus()}setEnabled(e){this._domNode.classList.toggle("disabled",!e),this._domNode.setAttribute("aria-disabled",String(!e)),this._domNode.tabIndex=e?0:-1}setExpanded(e){this._domNode.setAttribute("aria-expanded",String(!!e)),e?(this._domNode.classList.remove(...Wt.asClassNameArray(Uae)),this._domNode.classList.add(...Wt.asClassNameArray(jae))):(this._domNode.classList.remove(...Wt.asClassNameArray(jae)),this._domNode.classList.add(...Wt.asClassNameArray(Uae)))}}fu((i,e)=>{const t=i.getColor(qm);t&&e.addRule(`.monaco-editor .findMatch { border: 1px ${ih(i.type)?"dotted":"solid"} ${t}; box-sizing: border-box; }`);const n=i.getColor(sWe);n&&e.addRule(`.monaco-editor .findScope { border: 1px ${ih(i.type)?"dashed":"solid"} ${n}; }`);const r=i.getColor(Sn);r&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${r}; }`)});var l1e=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Pd=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},vU;const Urt=524288;function _U(i,e="single",t=!1){if(!i.hasModel())return null;const n=i.getSelection();if(e==="single"&&n.startLineNumber===n.endLineNumber||e==="multiple"){if(n.isEmpty()){const r=i.getConfiguredWordAtPosition(n.getStartPosition());if(r&&t===!1)return r.word}else if(i.getModel().getValueLengthInRange(n)this._onStateChanged(s))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{const s=this._editor.getModel()&&this._state.isRevealed;this.disposeModel(),this._state.change({searchScope:null,matchCase:this._storageService.getBoolean("editor.matchCase",1,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,!1),isRegex:this._storageService.getBoolean("editor.isRegex",1,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,!1)},!1),s&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(41).loop})}))}dispose(){this.disposeModel(),super.dispose()}disposeModel(){this._model&&(this._model.dispose(),this._model=null)}_onStateChanged(e){this.saveQueryState(e),e.isRevealed&&(this._state.isRevealed?this._findWidgetVisible.set(!0):(this._findWidgetVisible.reset(),this.disposeModel())),e.searchString&&this.setGlobalBufferTerm(this._state.searchString)}saveQueryState(e){e.isRegex&&this._storageService.store("editor.isRegex",this._state.actualIsRegex,1,1),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,1,1),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,1,1),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,1,1)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",1,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",1,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,this._state.preserveCase)},!1)}isFindInputFocused(){return!!V3.getValue(this._contextKeyService)}getState(){return this._state}closeFindWidget(){this._state.change({isRevealed:!1,searchScope:null},!1),this._editor.focus()}toggleCaseSensitive(){this._state.change({matchCase:!this._state.matchCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleWholeWords(){this._state.change({wholeWord:!this._state.wholeWord},!1),this._state.isRevealed||this.highlightFindOptions()}toggleRegex(){this._state.change({isRegex:!this._state.isRegex},!1),this._state.isRevealed||this.highlightFindOptions()}togglePreserveCase(){this._state.change({preserveCase:!this._state.preserveCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleSearchScope(){if(this._state.searchScope)this._state.change({searchScope:null},!0);else if(this._editor.hasModel()){let e=this._editor.getSelections();e=e.map(t=>(t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._editor.getModel().getLineMaxColumn(t.endLineNumber-1))),t.isEmpty()?null:t)).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}setSearchString(e){this._state.isRegex&&(e=fc(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}async _start(e,t){if(this.disposeModel(),!this._editor.hasModel())return;const n={...t,isRevealed:!0};if(e.seedSearchStringFromSelection==="single"){const r=_U(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);r&&(this._state.isRegex?n.searchString=fc(r):n.searchString=r)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const r=_U(this._editor,e.seedSearchStringFromSelection);r&&(n.searchString=r)}if(!n.searchString&&e.seedSearchStringFromGlobalClipboard){const r=await this.getGlobalBufferTerm();if(!this._editor.hasModel())return;r&&(n.searchString=r)}if(e.forceRevealReplace||n.isReplaceRevealed?n.isReplaceRevealed=!0:this._findWidgetVisible.get()||(n.isReplaceRevealed=!1),e.updateSearchScope){const r=this._editor.getSelections();r.some(o=>!o.isEmpty())&&(n.searchScope=r)}n.loop=e.loop,this._state.change(n,!1),this._model||(this._model=new AE(this._editor,this._state))}start(e,t){return this._start(e,t)}moveToNextMatch(){return this._model?(this._model.moveToNextMatch(),!0):!1}moveToPrevMatch(){return this._model?(this._model.moveToPrevMatch(),!0):!1}goToMatch(e){return this._model?(this._model.moveToMatch(e),!0):!1}replace(){return this._model?(this._model.replace(),!0):!1}replaceAll(){var e;return this._model?!((e=this._editor.getModel())===null||e===void 0)&&e.isTooLargeForHeapOperation()?(this._notificationService.warn(w("too.large.for.replaceall","The file is too large to perform a replace all operation.")),!1):(this._model.replaceAll(),!0):!1}selectAllMatches(){return this._model?(this._model.selectAllMatches(),this._editor.focus(),!0):!1}async getGlobalBufferTerm(){return this._editor.getOption(41).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""}setGlobalBufferTerm(e){this._editor.getOption(41).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)}};ka.ID="editor.contrib.findController";ka=vU=l1e([Pd(1,Vt),Pd(2,dd),Pd(3,Kp),Pd(4,$r)],ka);let bU=class extends ka{constructor(e,t,n,r,o,s,a,l){super(e,n,a,l,s),this._contextViewService=t,this._keybindingService=r,this._themeService=o,this._widget=null,this._findOptionsWidget=null}async _start(e,t){this._widget||this._createFindWidget();const n=this._editor.getSelection();let r=!1;switch(this._editor.getOption(41).autoFindInSelection){case"always":r=!0;break;case"never":r=!1;break;case"multiline":{r=!!n&&n.startLineNumber!==n.endLineNumber;break}}e.updateSearchScope=e.updateSearchScope||r,await super._start(e,t),this._widget&&(e.shouldFocus===2?this._widget.focusReplaceInput():e.shouldFocus===1&&this._widget.focusFindInput())}highlightFindOptions(e=!1){this._widget||this._createFindWidget(),this._state.isRevealed&&!e?this._widget.highlightFindOptions():this._findOptionsWidget.highlightFindOptions()}_createFindWidget(){this._widget=this._register(new U3(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService)),this._findOptionsWidget=this._register(new z3(this._editor,this._state,this._keybindingService))}};bU=l1e([Pd(1,ng),Pd(2,Vt),Pd(3,ci),Pd(4,To),Pd(5,$r),Pd(6,dd),Pd(7,Kp)],bU);const jrt=Cme(new bme({id:Ni.StartFindAction,label:w("startFindAction","Find"),alias:"Find",precondition:De.or(j.focus,De.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:$.MenubarEditMenu,group:"3_find",title:w({key:"miFind",comment:["&& denotes a mnemonic"]},"&&Find"),order:1}}));jrt.addImplementation(0,(i,e,t)=>{const n=ka.get(e);return n?n.start({forceRevealReplace:!1,seedSearchStringFromSelection:e.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(41).globalFindClipboard,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(41).loop}):!1});const Krt={description:"Open a new In-Editor Find Widget.",args:[{name:"Open a new In-Editor Find Widget args",schema:{properties:{searchString:{type:"string"},replaceString:{type:"string"},isRegex:{type:"boolean"},matchWholeWord:{type:"boolean"},isCaseSensitive:{type:"boolean"},preserveCase:{type:"boolean"},findInSelection:{type:"boolean"}}}}]};class Grt extends gt{constructor(){super({id:Ni.StartFindWithArgs,label:w("startFindWithArgsAction","Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},metadata:Krt})}async run(e,t,n){const r=ka.get(t);if(r){const o=n?{searchString:n.searchString,replaceString:n.replaceString,isReplaceRevealed:n.replaceString!==void 0,isRegex:n.isRegex,wholeWord:n.matchWholeWord,matchCase:n.isCaseSensitive,preserveCase:n.preserveCase}:{};await r.start({forceRevealReplace:!1,seedSearchStringFromSelection:r.getState().searchString.length===0&&t.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:1,shouldAnimate:!0,updateSearchScope:(n==null?void 0:n.findInSelection)||!1,loop:t.getOption(41).loop},o),r.setGlobalBufferTerm(r.getState().searchString)}}}class qrt extends gt{constructor(){super({id:Ni.StartFindWithSelection,label:w("startFindWithSelectionAction","Find With Selection"),alias:"Find With Selection",precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:2083},weight:100}})}async run(e,t){const n=ka.get(t);n&&(await n.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),n.setGlobalBufferTerm(n.getState().searchString))}}class c1e extends gt{async run(e,t){const n=ka.get(t);n&&!this._run(n)&&(await n.start({forceRevealReplace:!1,seedSearchStringFromSelection:n.getState().searchString.length===0&&t.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(n))}}class Xrt extends c1e{constructor(){super({id:Ni.NextMatchFindAction,label:w("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:j.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:De.and(j.focus,V3),primary:3,weight:100}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class Yrt extends c1e{constructor(){super({id:Ni.PreviousMatchFindAction,label:w("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:j.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:De.and(j.focus,V3),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}class Zrt extends gt{constructor(){super({id:Ni.GoToMatchFindAction,label:w("findMatchAction.goToMatch","Go to Match..."),alias:"Go to Match...",precondition:Gp}),this._highlightDecorations=[]}run(e,t,n){const r=ka.get(t);if(!r)return;const o=r.getState().matchesCount;if(o<1){e.get($r).notify({severity:j4.Warning,message:w("findMatchAction.noResults","No matches. Try searching for something else.")});return}const a=e.get(Eh).createInputBox();a.placeholder=w("findMatchAction.inputPlaceHolder","Type a number to go to a specific match (between 1 and {0})",o);const l=u=>{const d=parseInt(u);if(isNaN(d))return;const h=r.getState().matchesCount;if(d>0&&d<=h)return d-1;if(d<0&&d>=-h)return h+d},c=u=>{const d=l(u);if(typeof d=="number"){a.validationMessage=void 0,r.goToMatch(d);const h=r.getState().currentMatch;h&&this.addDecorations(t,h)}else a.validationMessage=w("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",r.getState().matchesCount),this.clearDecorations(t)};a.onDidChangeValue(u=>{c(u)}),a.onDidAccept(()=>{const u=l(a.value);typeof u=="number"?(r.goToMatch(u),a.hide()):a.validationMessage=w("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",r.getState().matchesCount)}),a.onDidHide(()=>{this.clearDecorations(t),a.dispose()}),a.show()}clearDecorations(e){e.changeDecorations(t=>{this._highlightDecorations=t.deltaDecorations(this._highlightDecorations,[])})}addDecorations(e,t){e.changeDecorations(n=>{this._highlightDecorations=n.deltaDecorations(this._highlightDecorations,[{range:t,options:{description:"find-match-quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"find-match-quick-access-range-highlight-overview",overviewRuler:{color:fr(Cve),position:mc.Full}}}])})}}class u1e extends gt{async run(e,t){const n=ka.get(t);if(!n)return;const r=_U(t,"single",!1);r&&n.setSearchString(r),this._run(n)||(await n.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(n))}}class Qrt extends u1e{constructor(){super({id:Ni.NextSelectionMatchFindAction,label:w("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:j.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class Jrt extends u1e{constructor(){super({id:Ni.PreviousSelectionMatchFindAction,label:w("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:j.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const eot=Cme(new bme({id:Ni.StartFindReplaceAction,label:w("startReplace","Replace"),alias:"Replace",precondition:De.or(j.focus,De.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:$.MenubarEditMenu,group:"3_find",title:w({key:"miReplace",comment:["&& denotes a mnemonic"]},"&&Replace"),order:2}}));eot.addImplementation(0,(i,e,t)=>{if(!e.hasModel()||e.getOption(91))return!1;const n=ka.get(e);if(!n)return!1;const r=e.getSelection(),o=n.isFindInputFocused(),s=!r.isEmpty()&&r.startLineNumber===r.endLineNumber&&e.getOption(41).seedSearchStringFromSelection!=="never"&&!o,a=o||s?2:1;return n.start({forceRevealReplace:!0,seedSearchStringFromSelection:s?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(41).seedSearchStringFromSelection!=="never",shouldFocus:a,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(41).loop})});jn(ka.ID,bU,0);Be(Grt);Be(qrt);Be(Xrt);Be(Yrt);Be(Zrt);Be(Qrt);Be(Jrt);const Ih=Vo.bindToContribution(ka.get);et(new Ih({id:Ni.CloseFindWidgetCommand,precondition:Gp,handler:i=>i.closeFindWidget(),kbOpts:{weight:100+5,kbExpr:De.and(j.focus,De.not("isComposing")),primary:9,secondary:[1033]}}));et(new Ih({id:Ni.ToggleCaseSensitiveCommand,precondition:void 0,handler:i=>i.toggleCaseSensitive(),kbOpts:{weight:100+5,kbExpr:j.focus,primary:n2.primary,mac:n2.mac,win:n2.win,linux:n2.linux}}));et(new Ih({id:Ni.ToggleWholeWordCommand,precondition:void 0,handler:i=>i.toggleWholeWords(),kbOpts:{weight:100+5,kbExpr:j.focus,primary:i2.primary,mac:i2.mac,win:i2.win,linux:i2.linux}}));et(new Ih({id:Ni.ToggleRegexCommand,precondition:void 0,handler:i=>i.toggleRegex(),kbOpts:{weight:100+5,kbExpr:j.focus,primary:r2.primary,mac:r2.mac,win:r2.win,linux:r2.linux}}));et(new Ih({id:Ni.ToggleSearchScopeCommand,precondition:void 0,handler:i=>i.toggleSearchScope(),kbOpts:{weight:100+5,kbExpr:j.focus,primary:o2.primary,mac:o2.mac,win:o2.win,linux:o2.linux}}));et(new Ih({id:Ni.TogglePreserveCaseCommand,precondition:void 0,handler:i=>i.togglePreserveCase(),kbOpts:{weight:100+5,kbExpr:j.focus,primary:s2.primary,mac:s2.mac,win:s2.win,linux:s2.linux}}));et(new Ih({id:Ni.ReplaceOneAction,precondition:Gp,handler:i=>i.replace(),kbOpts:{weight:100+5,kbExpr:j.focus,primary:3094}}));et(new Ih({id:Ni.ReplaceOneAction,precondition:Gp,handler:i=>i.replace(),kbOpts:{weight:100+5,kbExpr:De.and(j.focus,XY),primary:3}}));et(new Ih({id:Ni.ReplaceAllAction,precondition:Gp,handler:i=>i.replaceAll(),kbOpts:{weight:100+5,kbExpr:j.focus,primary:2563}}));et(new Ih({id:Ni.ReplaceAllAction,precondition:Gp,handler:i=>i.replaceAll(),kbOpts:{weight:100+5,kbExpr:De.and(j.focus,XY),primary:void 0,mac:{primary:2051}}}));et(new Ih({id:Ni.SelectAllMatchesAction,precondition:Gp,handler:i=>i.selectAllMatches(),kbOpts:{weight:100+5,kbExpr:j.focus,primary:515}}));const tot={[0]:" ",[1]:"u",[2]:"r"},Zae=65535,Od=16777215,Qae=4278190080;class O9{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,n=e%32;return(this._states[t]&1<Zae)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new O9(e.length),this._userDefinedStates=new O9(e.length),this._recoveredStates=new O9(e.length),this._types=n,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(n,r)=>{const o=e[e.length-1];return this.getStartLineNumber(o)<=n&&this.getEndLineNumber(o)>=r};for(let n=0,r=this._startIndexes.length;nOd||s>Od)throw new Error("startLineNumber or endLineNumber must not exceed "+Od);for(;e.length>0&&!t(o,s);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(n),this._startIndexes[n]=o+((a&255)<<24),this._endIndexes[n]=s+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&Od}getEndLineNumber(e){return this._endIndexes[e]&Od}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){return this._collapseStates.get(e)}setCollapsed(e,t){this._collapseStates.set(e,t)}isUserDefined(e){return this._userDefinedStates.get(e)}setUserDefined(e,t){return this._userDefinedStates.set(e,t)}isRecovered(e){return this._recoveredStates.get(e)}setRecovered(e,t){return this._recoveredStates.set(e,t)}getSource(e){return this.isUserDefined(e)?1:this.isRecovered(e)?2:0}setSource(e,t){t===1?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):t===2?(this.setUserDefined(e,!1),this.setRecovered(e,!0)):(this.setUserDefined(e,!1),this.setRecovered(e,!1))}setCollapsedAllOfType(e,t){let n=!1;if(this._types)for(let r=0;r>>24)+((this._endIndexes[e]&Qae)>>>16);return t===Zae?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,n=this._startIndexes.length;if(n===0)return-1;for(;t=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);t!==-1;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){const e=[];for(let t=0;tArray.isArray(p)?m=>mm=u.startLineNumber))c&&c.startLineNumber===u.startLineNumber?(u.source===1?p=u:(p=c,p.isCollapsed=u.isCollapsed&&c.endLineNumber===u.endLineNumber,p.source=0),c=o(++a)):(p=u,u.isCollapsed&&u.source===0&&(p.source=2)),u=s(++l);else{let v=l,m=u;for(;;){if(!m||m.startLineNumber>c.endLineNumber){p=c;break}if(m.source===1&&m.endLineNumber>c.endLineNumber)break;m=s(++v)}c=o(++a)}if(p){for(;h&&h.endLineNumberp.startLineNumber&&p.startLineNumber>f&&p.endLineNumber<=n&&(!h||h.endLineNumber>=p.endLineNumber)&&(g.push(p),f=p.startLineNumber,h&&d.push(h),h=p)}}return g}}class not{constructor(e,t){this.ranges=e,this.index=t}get startLineNumber(){return this.ranges.getStartLineNumber(this.index)}get endLineNumber(){return this.ranges.getEndLineNumber(this.index)}get regionIndex(){return this.index}get parentIndex(){return this.ranges.getParentIndex(this.index)}get isCollapsed(){return this.ranges.isCollapsed(this.index)}containedBy(e){return e.startLineNumber<=this.startLineNumber&&e.endLineNumber>=this.endLineNumber}containsLine(e){return this.startLineNumber<=e&&e<=this.endLineNumber}}class iot{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new se,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new ec(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(e){if(!e.length)return;e=e.sort((n,r)=>n.regionIndex-r.regionIndex);const t={};this._decorationProvider.changeDecorations(n=>{let r=0,o=-1,s=-1;const a=l=>{for(;rs&&(s=c),r++}};for(const l of e){const c=l.regionIndex,u=this._editorDecorationIds[c];if(u&&!t[u]){t[u]=!0,a(c);const d=!this._regions.isCollapsed(c);this._regions.setCollapsed(c,d),o=Math.max(o,this._regions.getEndLineNumber(c))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,n=r=>{for(const o of e)if(!(o.startLineNumber>r.endLineNumber||r.startLineNumber>o.endLineNumber))return!0;return!1};for(let r=0;rn&&(n=a)}this._decorationProvider.changeDecorations(r=>this._editorDecorationIds=r.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e=[]){const t=(r,o)=>{for(const s of e)if(r=s.endLineNumber||s.startLineNumber<1||s.endLineNumber>n)continue;const a=this._getLinesChecksum(s.startLineNumber+1,s.endLineNumber);t.push({startLineNumber:s.startLineNumber,endLineNumber:s.endLineNumber,isCollapsed:s.isCollapsed,source:s.source,checksum:a})}return t.length>0?t:void 0}applyMemento(e){var t,n;if(!Array.isArray(e))return;const r=[],o=this._textModel.getLineCount();for(const a of e){if(a.startLineNumber>=a.endLineNumber||a.startLineNumber<1||a.endLineNumber>o)continue;const l=this._getLinesChecksum(a.startLineNumber+1,a.endLineNumber);(!a.checksum||l===a.checksum)&&r.push({startLineNumber:a.startLineNumber,endLineNumber:a.endLineNumber,type:void 0,isCollapsed:(t=a.isCollapsed)!==null&&t!==void 0?t:!0,source:(n=a.source)!==null&&n!==void 0?n:0})}const s=ec.sanitizeAndMerge(this._regions,r,o);this.updatePost(ec.fromFoldRanges(s))}_getLinesChecksum(e,t){return l4(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const n=[];if(this._regions){let r=this._regions.findRange(e),o=1;for(;r>=0;){const s=this._regions.toRegion(r);(!t||t(s,o))&&n.push(s),o++,r=s.parentIndex}}return n}getRegionAtLine(e){if(this._regions){const t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null}getRegionsInside(e,t){const n=[],r=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const s=[];for(let a=r,l=this._regions.length;a0&&!c.containedBy(s[s.length-1]);)s.pop();s.push(c),t(c,s.length)&&n.push(c)}else break}}else for(let s=r,a=this._regions.length;s1){const a=i.getRegionsInside(o,(l,c)=>l.isCollapsed!==s&&c0)for(const o of n){const s=i.getRegionAtLine(o);if(s&&(s.isCollapsed!==e&&r.push(s),t>1)){const a=i.getRegionsInside(s,(l,c)=>l.isCollapsed!==e&&cs.isCollapsed!==e&&aa.isCollapsed!==e&&l<=t);r.push(...s)}i.toggleCollapseState(r)}function rot(i,e,t){const n=[];for(const r of t){const o=i.getAllRegionsAtLine(r,s=>s.isCollapsed!==e);o.length>0&&n.push(o[0])}i.toggleCollapseState(n)}function oot(i,e,t,n){const r=(s,a)=>a===e&&s.isCollapsed!==t&&!n.some(l=>s.containsLine(l)),o=i.getRegionsInside(null,r);i.toggleCollapseState(o)}function f1e(i,e,t){const n=[];for(const s of t){const a=i.getAllRegionsAtLine(s,void 0);a.length>0&&n.push(a[0])}const r=s=>n.every(a=>!a.containedBy(s)&&!s.containedBy(a))&&s.isCollapsed!==e,o=i.getRegionsInside(null,r);i.toggleCollapseState(o)}function QY(i,e,t){const n=i.textModel,r=i.regions,o=[];for(let s=r.length-1;s>=0;s--)if(t!==r.isCollapsed(s)){const a=r.getStartLineNumber(s);e.test(n.getLineContent(a))&&o.push(r.toRegion(s))}i.toggleCollapseState(o)}function JY(i,e,t){const n=i.regions,r=[];for(let o=n.length-1;o>=0;o--)t!==n.isCollapsed(o)&&e===n.getType(o)&&r.push(n.toRegion(o));i.toggleCollapseState(r)}function sot(i,e){let t=null;const n=e.getRegionAtLine(i);if(n!==null&&(t=n.startLineNumber,i===t)){const r=n.parentIndex;r!==-1?t=e.regions.getStartLineNumber(r):t=null}return t}function aot(i,e){let t=e.getRegionAtLine(i);if(t!==null&&t.startLineNumber===i){if(i!==t.startLineNumber)return t.startLineNumber;{const n=t.parentIndex;let r=0;for(n!==-1&&(r=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=r)return null;if(t.parentIndex===n)return t.startLineNumber}else return null}}else if(e.regions.length>0)for(t=e.regions.toRegion(e.regions.length-1);t!==null;){if(t.startLineNumber0?t=e.regions.toRegion(t.regionIndex-1):t=null}return null}function lot(i,e){let t=e.getRegionAtLine(i);if(t!==null&&t.startLineNumber===i){const n=t.parentIndex;let r=0;if(n!==-1)r=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;r=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex=r)return null;if(t.parentIndex===n)return t.startLineNumber}else return null}else if(e.regions.length>0)for(t=e.regions.toRegion(0);t!==null;){if(t.startLineNumber>i)return t.startLineNumber;t.regionIndexthis.updateHiddenRanges()),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}notifyChangeModelContent(e){this._hiddenRanges.length&&!this._hasLineChanges&&(this._hasLineChanges=e.changes.some(t=>t.range.endLineNumber!==t.range.startLineNumber||Yv(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let n=0,r=0,o=Number.MAX_VALUE,s=-1;const a=this._foldingModel.regions;for(;n0}isHidden(e){return Jae(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const n=this._foldingModel.textModel;let r=null;const o=s=>((!r||!uot(s,r))&&(r=Jae(this._hiddenRanges,s)),r?r.startLineNumber-1:null);for(let s=0,a=e.length;s0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function uot(i,e){return i>=e.startLineNumber&&i<=e.endLineNumber}function Jae(i,e){const t=AD(i,n=>e=0&&i[t].endLineNumber>=e?i[t]:null}const dot=5e3,hot="indent";class eZ{constructor(e,t,n){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=n,this.id=hot}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,n=t&&!!t.offSide,r=t&&t.markers;return Promise.resolve(pot(this.editorModel,n,r,this.foldingRangesLimit))}}let fot=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,n){if(e>Od||t>Od)return;const r=this._length;this._startIndexes[r]=e,this._endIndexes[r]=t,this._length++,n<1e3&&(this._indentOccurrences[n]=(this._indentOccurrences[n]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const n=new Uint32Array(this._length),r=new Uint32Array(this._length);for(let o=this._length-1,s=0;o>=0;o--,s++)n[s]=this._startIndexes[o],r[s]=this._endIndexes[o];return new ec(n,r)}else{this._foldingRangesLimit.update(this._length,t);let n=0,r=this._indentOccurrences.length;for(let l=0;lt){r=l;break}n+=c}}const o=e.getOptions().tabSize,s=new Uint32Array(t),a=new Uint32Array(t);for(let l=this._length-1,c=0;l>=0;l--){const u=this._startIndexes[l],d=e.getLineContent(u),h=H4(d,o);(h{}};function pot(i,e,t,n=got){const r=i.getOptions().tabSize,o=new fot(n);let s;t&&(s=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],l=i.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let c=i.getLineCount();c>0;c--){const u=i.getLineContent(c),d=H4(u,r);let h=a[a.length-1];if(d===-1){e&&(h.endAbove=c);continue}let f;if(s&&(f=u.match(s)))if(f[1]){let g=a.length-1;for(;g>0&&a[g].indent!==-2;)g--;if(g>0){a.length=g+1,h=a[g],o.insertFirst(c,h.line,d),h.line=c,h.indent=d,h.endAbove=c;continue}}else{a.push({indent:-2,endAbove:c,line:c});continue}if(h.indent>d){do a.pop(),h=a[a.length-1];while(h.indent>d);const g=h.endAbove-1;g-c>=1&&o.insertFirst(c,g,d)}h.indent===d?h.endAbove=c:a.push({indent:d,endAbove:c,line:c})}return o.toIndentRanges(i)}const mot=X("editor.foldBackground",{light:It(Gm,.3),dark:It(Gm,.3),hcDark:null,hcLight:null},w("foldBackgroundBackground","Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);X("editorGutter.foldingControlForeground",{dark:Cf,light:Cf,hcDark:Cf,hcLight:Cf},w("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));const j3=Mr("folding-expanded",Xe.chevronDown,w("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),K3=Mr("folding-collapsed",Xe.chevronRight,w("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin.")),g1e=Mr("folding-manual-collapsed",K3,w("foldingManualCollapedIcon","Icon for manually collapsed ranges in the editor glyph margin.")),p1e=Mr("folding-manual-expanded",j3,w("foldingManualExpandedIcon","Icon for manually expanded ranges in the editor glyph margin.")),tZ={color:fr(mot),position:Ll.Inline},zS=w("linesCollapsed","Click to expand the range."),G3=w("linesExpanded","Click to collapse the range.");class jr{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,n){return t?jr.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?jr.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:jr.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:jr.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?n?this.showFoldingHighlights?jr.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:jr.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?jr.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:jr.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?n?jr.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:jr.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:n?jr.MANUALLY_EXPANDED_VISUAL_DECORATION:jr.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}}jr.COLLAPSED_VISUAL_DECORATION=sn.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:zS,firstLineDecorationClassName:Wt.asClassName(K3)});jr.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=sn.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:tZ,isWholeLine:!0,linesDecorationsTooltip:zS,firstLineDecorationClassName:Wt.asClassName(K3)});jr.MANUALLY_COLLAPSED_VISUAL_DECORATION=sn.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:zS,firstLineDecorationClassName:Wt.asClassName(g1e)});jr.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=sn.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:tZ,isWholeLine:!0,linesDecorationsTooltip:zS,firstLineDecorationClassName:Wt.asClassName(g1e)});jr.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=sn.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:zS});jr.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=sn.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:tZ,isWholeLine:!0,linesDecorationsTooltip:zS});jr.EXPANDED_VISUAL_DECORATION=sn.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Wt.asClassName(j3),linesDecorationsTooltip:G3});jr.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=sn.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:Wt.asClassName(j3),linesDecorationsTooltip:G3});jr.MANUALLY_EXPANDED_VISUAL_DECORATION=sn.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Wt.asClassName(p1e),linesDecorationsTooltip:G3});jr.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=sn.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:Wt.asClassName(p1e),linesDecorationsTooltip:G3});jr.NO_CONTROLS_EXPANDED_RANGE_DECORATION=sn.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0});jr.HIDDEN_RANGE_DECORATION=sn.register({description:"folding-hidden-range-decoration",stickiness:1});const vot={},_ot="syntax";class nZ{constructor(e,t,n,r,o){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=n,this.foldingRangesLimit=r,this.fallbackRangeProvider=o,this.id=_ot,this.disposables=new Te,o&&this.disposables.add(o);for(const s of t)typeof s.onDidChange=="function"&&this.disposables.add(s.onDidChange(n))}compute(e){return bot(this.providers,this.editorModel,e).then(t=>{var n,r;return t?yot(t,this.foldingRangesLimit):(r=(n=this.fallbackRangeProvider)===null||n===void 0?void 0:n.compute(e))!==null&&r!==void 0?r:null})}dispose(){this.disposables.dispose()}}function bot(i,e,t){let n=null;const r=i.map((o,s)=>Promise.resolve(o.provideFoldingRanges(e,vot,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(n)||(n=[]);const l=e.getLineCount();for(const c of a)c.start>0&&c.end>c.start&&c.end<=l&&n.push({start:c.start,end:c.end,rank:s,kind:c.kind})}},Zr));return Promise.all(r).then(o=>n)}class Cot{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,n,r){if(e>Od||t>Od)return;const o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._nestingLevels[o]=r,this._types[o]=n,this._length++,r<30&&(this._nestingLevelCounts[r]=(this._nestingLevelCounts[r]||0)+1)}toIndentRanges(){const e=this._foldingRangesLimit.limit;if(this._length<=e){this._foldingRangesLimit.update(this._length,!1);const t=new Uint32Array(this._length),n=new Uint32Array(this._length);for(let r=0;re){n=a;break}t+=l}}const r=new Uint32Array(e),o=new Uint32Array(e),s=[];for(let a=0,l=0;a{let l=s.start-a.start;return l===0&&(l=s.rank-a.rank),l}),n=new Cot(e);let r;const o=[];for(const s of t)if(!r)r=s,n.add(s.start,s.end,s.kind&&s.kind.value,o.length);else if(s.start>r.start)if(s.end<=r.end)o.push(r),r=s,n.add(s.start,s.end,s.kind&&s.kind.value,o.length);else{if(s.start>r.end){do r=o.pop();while(r&&s.start>r.end);r&&o.push(r),r=s}n.add(s.start,s.end,s.kind&&s.kind.value,o.length)}return n.toIndentRanges()}var wot=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},eL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},N1;const Os=new st("foldingEnabled",!1);let Xf=N1=class extends fe{static get(e){return e.getContribution(N1.ID)}static getFoldingRangeProviders(e,t){var n,r;const o=e.foldingRangeProvider.ordered(t);return(r=(n=N1._foldingRangeSelector)===null||n===void 0?void 0:n.call(N1,o,t))!==null&&r!==void 0?r:o}constructor(e,t,n,r,o,s){super(),this.contextKeyService=t,this.languageConfigurationService=n,this.languageFeaturesService=s,this.localToDispose=this._register(new Te),this.editor=e,this._foldingLimitReporter=new m1e(e);const a=this.editor.getOptions();this._isEnabled=a.get(43),this._useFoldingProviders=a.get(44)!=="indentation",this._unfoldOnClickAfterEndOfLine=a.get(48),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=a.get(46),this.updateDebounceInfo=o.for(s.foldingRangeProvider,"Folding",{min:200}),this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new jr(e),this.foldingDecorationProvider.showFoldingControls=a.get(110),this.foldingDecorationProvider.showFoldingHighlights=a.get(45),this.foldingEnabled=Os.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(l=>{if(l.hasChanged(43)&&(this._isEnabled=this.editor.getOptions().get(43),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),l.hasChanged(47)&&this.onModelChanged(),l.hasChanged(110)||l.hasChanged(45)){const c=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=c.get(110),this.foldingDecorationProvider.showFoldingHighlights=c.get(45),this.triggerFoldingModelChanged()}l.hasChanged(44)&&(this._useFoldingProviders=this.editor.getOptions().get(44)!=="indentation",this.onFoldingStrategyChanged()),l.hasChanged(48)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(48)),l.hasChanged(46)&&(this._foldingImportsByDefault=this.editor.getOptions().get(46))})),this.onModelChanged()}saveViewState(){const e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){const t=this.foldingModel.getMemento(),n=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:n,foldedImports:this._currentModelHasFoldedImports}}}restoreViewState(e){const t=this.editor.getModel();if(!(!t||!this._isEnabled||t.isTooLargeForTokenization()||!this.hiddenRangeModel)&&e&&(this._currentModelHasFoldedImports=!!e.foldedImports,e.collapsedRegions&&e.collapsedRegions.length>0&&this.foldingModel)){this._restoringViewState=!0;try{this.foldingModel.applyMemento(e.collapsedRegions)}finally{this._restoringViewState=!1}}}onModelChanged(){this.localToDispose.clear();const e=this.editor.getModel();!this._isEnabled||!e||e.isTooLargeForTokenization()||(this._currentModelHasFoldedImports=!1,this.foldingModel=new iot(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new cot(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new nd(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new pi(()=>this.revealCursor(),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(this.languageFeaturesService.foldingRangeProvider.onDidChange(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelContent(t=>this.onDidChangeModelContent(t))),this.localToDispose.add(this.editor.onDidChangeCursorPosition(()=>this.onCursorPositionChanged())),this.localToDispose.add(this.editor.onMouseDown(t=>this.onEditorMouseDown(t))),this.localToDispose.add(this.editor.onMouseUp(t=>this.onEditorMouseUp(t))),this.localToDispose.add({dispose:()=>{var t,n;this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),(t=this.updateScheduler)===null||t===void 0||t.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,(n=this.rangeProvider)===null||n===void 0||n.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){var e;(e=this.rangeProvider)===null||e===void 0||e.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new eZ(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const n=N1.getFoldingRangeProviders(this.languageFeaturesService,e);n.length>0&&(this.rangeProvider=new nZ(e,n,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){var t;(t=this.hiddenRangeModel)===null||t===void 0||t.notifyChangeModelContent(e),this.triggerFoldingModelChanged()}triggerFoldingModelChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger(()=>{const e=this.foldingModel;if(!e)return null;const t=new Ms,n=this.getRangeProvider(e.textModel),r=this.foldingRegionPromise=Io(o=>n.compute(o));return r.then(o=>{if(o&&r===this.foldingRegionPromise){let s;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const u=o.setCollapsedAllOfType(ba.Imports.value,!0);u&&(s=_h.capture(this.editor),this._currentModelHasFoldedImports=u)}const a=this.editor.getSelections(),l=a?a.map(u=>u.startLineNumber):[];e.update(o,l),s==null||s.restore(this.editor);const c=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=c)}return e})}).then(void 0,e=>(en(e),null)))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){const t=this.editor.getSelections();t&&this.hiddenRangeModel.adjustSelections(t)&&this.editor.setSelections(t)}this.editor.setHiddenAreas(e,this)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then(t=>{if(t){const n=this.editor.getSelections();if(n&&n.length>0){const r=[];for(const o of n){const s=o.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(s)&&r.push(...t.getAllRegionsAtLine(s,a=>a.isCollapsed&&s>a.startLineNumber))}r.length&&(t.toggleCollapseState(r),this.reveal(n[0].getPosition()))}}}).then(void 0,en)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range||!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let n=!1;switch(e.target.type){case 4:{const r=e.target.detail,o=e.target.element.offsetLeft;if(r.offsetX-o<4)return;n=!0;break}case 7:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case 6:{if(this.hiddenRangeModel.hasRanges()){const r=this.editor.getModel();if(r&&t.startColumn===r.getLineMaxColumn(t.startLineNumber))break}return}default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:n}}onEditorMouseUp(e){const t=this.foldingModel;if(!t||!this.mouseDownInfo||!e.target)return;const n=this.mouseDownInfo.lineNumber,r=this.mouseDownInfo.iconClicked,o=e.target.range;if(!o||o.startLineNumber!==n)return;if(r){if(e.target.type!==4)return}else{const a=this.editor.getModel();if(!a||o.startColumn!==a.getLineMaxColumn(n))return}const s=t.getRegionAtLine(n);if(s&&s.startLineNumber===n){const a=s.isCollapsed;if(r||a){const l=e.event.altKey;let c=[];if(l){const u=h=>!h.containedBy(s)&&!s.containedBy(h),d=t.getRegionsInside(null,u);for(const h of d)h.isCollapsed&&c.push(h);c.length===0&&(c=d)}else{const u=e.event.middleButton||e.event.shiftKey;if(u)for(const d of t.getRegionsInside(s))d.isCollapsed===a&&c.push(d);(a||!u||c.length===0)&&c.push(s)}t.toggleCollapseState(c),this.reveal({lineNumber:n,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};Xf.ID="editor.contrib.folding";Xf=N1=wot([eL(1,Vt),eL(2,Di),eL(3,$r),eL(4,gu),eL(5,_t)],Xf);class m1e{constructor(e){this.editor=e,this._onDidChange=new se,this._computed=0,this._limited=!1}get limit(){return this.editor.getOptions().get(47)}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}class ta extends gt{runEditorCommand(e,t,n){const r=e.get(Di),o=Xf.get(t);if(!o)return;const s=o.getFoldingModel();if(s)return this.reportTelemetry(e,t),s.then(a=>{if(a){this.invoke(o,a,t,n,r);const l=t.getSelection();l&&o.reveal(l.getStartPosition())}})}getSelectedLines(e){const t=e.getSelections();return t?t.map(n=>n.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(n=>n+1):this.getSelectedLines(t)}run(e,t){}}function v1e(i){if(!Cl(i)){if(!va(i))return!1;const e=i;if(!Cl(e.levels)&&!$v(e.levels)||!Cl(e.direction)&&!Sa(e.direction)||!Cl(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every($v)))return!1}return!0}class Sot extends ta{constructor(){super({id:"editor.unfold",label:w("unfoldAction.label","Unfold"),alias:"Unfold",precondition:Os,kbOpts:{kbExpr:j.editorTextFocus,primary:3166,mac:{primary:2654},weight:100},metadata:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:`Property-value pairs that can be passed through this argument: * 'levels': Number of levels to unfold. If not set, defaults to 1. * 'direction': If 'up', unfold given number of levels up otherwise unfolds down. * 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the unfold action to. If not set, the active selection(s) will be used. @@ -780,51 +780,51 @@ ${e.toString()}`}}class tO{constructor(e=new Kk,t=!1,n,r=cZe){var o;this._servic * 'direction': If 'up', folds given number of levels up otherwise folds down. * 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the fold action to. If not set, the active selection(s) will be used. If no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead. - `,constraint:v1e,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,n,r){const o=this.getLineNumbers(r,n),s=r&&r.levels,a=r&&r.direction;typeof s!="number"&&typeof a!="string"?rot(t,!0,o):a==="up"?h1e(t,!0,s||1,o):VS(t,!0,s||1,o)}}class Eot extends ta{constructor(){super({id:"editor.toggleFold",label:w("toggleFoldAction.label","Toggle Fold"),alias:"Toggle Fold",precondition:Os,kbOpts:{kbExpr:j.editorTextFocus,primary:co(2089,2090),weight:100}})}invoke(e,t,n){const r=this.getSelectedLines(n);d1e(t,1,r)}}class Dot extends ta{constructor(){super({id:"editor.foldRecursively",label:w("foldRecursivelyAction.label","Fold Recursively"),alias:"Fold Recursively",precondition:Os,kbOpts:{kbExpr:j.editorTextFocus,primary:co(2089,2140),weight:100}})}invoke(e,t,n){const r=this.getSelectedLines(n);VS(t,!0,Number.MAX_VALUE,r)}}class Iot extends ta{constructor(){super({id:"editor.foldAllBlockComments",label:w("foldAllBlockComments.label","Fold All Block Comments"),alias:"Fold All Block Comments",precondition:Os,kbOpts:{kbExpr:j.editorTextFocus,primary:co(2089,2138),weight:100}})}invoke(e,t,n,r,o){if(t.regions.hasTypes())JY(t,ba.Comment.value,!0);else{const s=n.getModel();if(!s)return;const a=o.getLanguageConfiguration(s.getLanguageId()).comments;if(a&&a.blockCommentStartToken){const l=new RegExp("^\\s*"+fc(a.blockCommentStartToken));QY(t,l,!0)}}}}class kot extends ta{constructor(){super({id:"editor.foldAllMarkerRegions",label:w("foldAllMarkerRegions.label","Fold All Regions"),alias:"Fold All Regions",precondition:Os,kbOpts:{kbExpr:j.editorTextFocus,primary:co(2089,2077),weight:100}})}invoke(e,t,n,r,o){if(t.regions.hasTypes())JY(t,ba.Region.value,!0);else{const s=n.getModel();if(!s)return;const a=o.getLanguageConfiguration(s.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);QY(t,l,!0)}}}}class Tot extends ta{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:w("unfoldAllMarkerRegions.label","Unfold All Regions"),alias:"Unfold All Regions",precondition:Os,kbOpts:{kbExpr:j.editorTextFocus,primary:co(2089,2078),weight:100}})}invoke(e,t,n,r,o){if(t.regions.hasTypes())JY(t,ba.Region.value,!1);else{const s=n.getModel();if(!s)return;const a=o.getLanguageConfiguration(s.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);QY(t,l,!1)}}}}class Not extends ta{constructor(){super({id:"editor.foldAllExcept",label:w("foldAllExcept.label","Fold All Except Selected"),alias:"Fold All Except Selected",precondition:Os,kbOpts:{kbExpr:j.editorTextFocus,primary:co(2089,2136),weight:100}})}invoke(e,t,n){const r=this.getSelectedLines(n);f1e(t,!0,r)}}class Rot extends ta{constructor(){super({id:"editor.unfoldAllExcept",label:w("unfoldAllExcept.label","Unfold All Except Selected"),alias:"Unfold All Except Selected",precondition:Os,kbOpts:{kbExpr:j.editorTextFocus,primary:co(2089,2134),weight:100}})}invoke(e,t,n){const r=this.getSelectedLines(n);f1e(t,!1,r)}}class Mot extends ta{constructor(){super({id:"editor.foldAll",label:w("foldAllAction.label","Fold All"),alias:"Fold All",precondition:Os,kbOpts:{kbExpr:j.editorTextFocus,primary:co(2089,2069),weight:100}})}invoke(e,t,n){VS(t,!0)}}class Aot extends ta{constructor(){super({id:"editor.unfoldAll",label:w("unfoldAllAction.label","Unfold All"),alias:"Unfold All",precondition:Os,kbOpts:{kbExpr:j.editorTextFocus,primary:co(2089,2088),weight:100}})}invoke(e,t,n){VS(t,!1)}}class qb extends ta{getFoldingLevel(){return parseInt(this.id.substr(qb.ID_PREFIX.length))}invoke(e,t,n){oot(t,this.getFoldingLevel(),!0,this.getSelectedLines(n))}}qb.ID_PREFIX="editor.foldLevel";qb.ID=i=>qb.ID_PREFIX+i;class Pot extends ta{constructor(){super({id:"editor.gotoParentFold",label:w("gotoParentFold.label","Go to Parent Fold"),alias:"Go to Parent Fold",precondition:Os,kbOpts:{kbExpr:j.editorTextFocus,weight:100}})}invoke(e,t,n){const r=this.getSelectedLines(n);if(r.length>0){const o=sot(r[0],t);o!==null&&n.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class Oot extends ta{constructor(){super({id:"editor.gotoPreviousFold",label:w("gotoPreviousFold.label","Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:Os,kbOpts:{kbExpr:j.editorTextFocus,weight:100}})}invoke(e,t,n){const r=this.getSelectedLines(n);if(r.length>0){const o=aot(r[0],t);o!==null&&n.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class Fot extends ta{constructor(){super({id:"editor.gotoNextFold",label:w("gotoNextFold.label","Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:Os,kbOpts:{kbExpr:j.editorTextFocus,weight:100}})}invoke(e,t,n){const r=this.getSelectedLines(n);if(r.length>0){const o=lot(r[0],t);o!==null&&n.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class Bot extends ta{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:w("createManualFoldRange.label","Create Folding Range from Selection"),alias:"Create Folding Range from Selection",precondition:Os,kbOpts:{kbExpr:j.editorTextFocus,primary:co(2089,2135),weight:100}})}invoke(e,t,n){var r;const o=[],s=n.getSelections();if(s){for(const a of s){let l=a.endLineNumber;a.endColumn===1&&--l,l>a.startLineNumber&&(o.push({startLineNumber:a.startLineNumber,endLineNumber:l,type:void 0,isCollapsed:!0,source:1}),n.setSelection({startLineNumber:a.startLineNumber,startColumn:1,endLineNumber:a.startLineNumber,endColumn:1}))}if(o.length>0){o.sort((l,c)=>l.startLineNumber-c.startLineNumber);const a=ec.sanitizeAndMerge(t.regions,o,(r=n.getModel())===null||r===void 0?void 0:r.getLineCount());t.updatePost(ec.fromFoldRanges(a))}}}}class Wot extends ta{constructor(){super({id:"editor.removeManualFoldingRanges",label:w("removeManualFoldingRanges.label","Remove Manual Folding Ranges"),alias:"Remove Manual Folding Ranges",precondition:Os,kbOpts:{kbExpr:j.editorTextFocus,primary:co(2089,2137),weight:100}})}invoke(e,t,n){const r=n.getSelections();if(r){const o=[];for(const s of r){const{startLineNumber:a,endLineNumber:l}=s;o.push(l>=a?{startLineNumber:a,endLineNumber:l}:{endLineNumber:l,startLineNumber:a})}t.removeManualRanges(o),e.triggerFoldingModelChanged()}}}jn(Xf.ID,Xf,0);Be(Sot);Be(xot);Be(Lot);Be(Dot);Be(Mot);Be(Aot);Be(Iot);Be(kot);Be(Tot);Be(Not);Be(Rot);Be(Eot);Be(Pot);Be(Oot);Be(Fot);Be(Bot);Be(Wot);for(let i=1;i<=7;i++)U8e(new qb({id:qb.ID(i),label:w("foldLevelAction.label","Fold Level {0}",i),alias:`Fold Level ${i}`,precondition:Os,kbOpts:{kbExpr:j.editorTextFocus,primary:co(2089,2048|21+i),weight:100}}));Dn.registerCommand("_executeFoldingRangeProvider",async function(i,...e){const[t]=e;if(!(t instanceof At))throw eu();const n=i.get(_t),r=i.get(tr).getModel(t);if(!r)throw eu();const o=i.get(gn);if(!o.getValue("editor.folding",{resource:t}))return[];const s=i.get(Di),a=o.getValue("editor.foldingStrategy",{resource:t}),l={get limit(){return o.getValue("editor.foldingMaximumRegions",{resource:t})},update:(f,g)=>{}},c=new eZ(r,s,l);let u=c;if(a!=="indentation"){const f=Xf.getFoldingRangeProviders(n,r);f.length&&(u=new nZ(r,f,()=>{},l,c))}const d=await u.compute(Cn.None),h=[];try{if(d)for(let f=0;f=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},PE=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let PI=class{constructor(e,t,n,r){this._editor=e,this._languageFeaturesService=t,this._workerService=n,this._accessibilitySignalService=r,this._disposables=new Te,this._sessionDisposables=new Te,this._disposables.add(t.onTypeFormattingEditProvider.onDidChange(this._update,this)),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(o=>{o.hasChanged(56)&&this._update()})),this._update()}dispose(){this._disposables.dispose(),this._sessionDisposables.dispose()}_update(){if(this._sessionDisposables.clear(),!this._editor.getOption(56)||!this._editor.hasModel())return;const e=this._editor.getModel(),[t]=this._languageFeaturesService.onTypeFormattingEditProvider.ordered(e);if(!t||!t.autoFormatTriggerCharacters)return;const n=new JA;for(const r of t.autoFormatTriggerCharacters)n.add(r.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType(r=>{const o=r.charCodeAt(r.length-1);n.has(o)&&this._trigger(String.fromCharCode(o))}))}_trigger(e){if(!this._editor.hasModel()||this._editor.getSelections().length>1||!this._editor.getSelection().isEmpty())return;const t=this._editor.getModel(),n=this._editor.getPosition(),r=new wr,o=this._editor.onDidChangeModelContent(s=>{if(s.isFlush){r.cancel(),o.dispose();return}for(let a=0,l=s.changes.length;a{r.token.isCancellationRequested||Ts(s)&&(this._accessibilitySignalService.playSignal(cn.format,{userGesture:!1}),Zw.execute(this._editor,s,!0))}).finally(()=>{o.dispose()})}};PI.ID="editor.contrib.autoFormat";PI=_1e([PE(1,_t),PE(2,hd),PE(3,M_)],PI);let OI=class{constructor(e,t,n){this.editor=e,this._languageFeaturesService=t,this._instantiationService=n,this._callOnDispose=new Te,this._callOnModel=new Te,this._callOnDispose.add(e.onDidChangeConfiguration(()=>this._update())),this._callOnDispose.add(e.onDidChangeModel(()=>this._update())),this._callOnDispose.add(e.onDidChangeModelLanguage(()=>this._update())),this._callOnDispose.add(t.documentRangeFormattingEditProvider.onDidChange(this._update,this))}dispose(){this._callOnDispose.dispose(),this._callOnModel.dispose()}_update(){this._callOnModel.clear(),this.editor.getOption(55)&&this.editor.hasModel()&&this._languageFeaturesService.documentRangeFormattingEditProvider.has(this.editor.getModel())&&this._callOnModel.add(this.editor.onDidPaste(({range:e})=>this._trigger(e)))}_trigger(e){this.editor.hasModel()&&(this.editor.getSelections().length>1||this._instantiationService.invokeFunction(rbe,this.editor,e,2,mp.None,Cn.None,!1).catch(en))}};OI.ID="editor.contrib.formatOnPaste";OI=_1e([PE(1,_t),PE(2,Ot)],OI);class zot extends gt{constructor(){super({id:"editor.action.formatDocument",label:w("formatDocument.label","Format Document"),alias:"Format Document",precondition:De.and(j.notInCompositeEditor,j.writable,j.hasDocumentFormattingProvider),kbOpts:{kbExpr:j.editorTextFocus,primary:1572,linux:{primary:3111},weight:100},contextMenuOpts:{group:"1_modification",order:1.3}})}async run(e,t){if(t.hasModel()){const n=e.get(Ot);await e.get(T_).showWhile(n.invokeFunction(Cet,t,1,mp.None,Cn.None,!0),250)}}}class Uot extends gt{constructor(){super({id:"editor.action.formatSelection",label:w("formatSelection.label","Format Selection"),alias:"Format Selection",precondition:De.and(j.writable,j.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:j.editorTextFocus,primary:co(2089,2084),weight:100},contextMenuOpts:{when:j.hasNonEmptySelection,group:"1_modification",order:1.31}})}async run(e,t){if(!t.hasModel())return;const n=e.get(Ot),r=t.getModel(),o=t.getSelections().map(a=>a.isEmpty()?new B(a.startLineNumber,1,a.startLineNumber,r.getLineMaxColumn(a.startLineNumber)):a);await e.get(T_).showWhile(n.invokeFunction(rbe,t,o,1,mp.None,Cn.None,!0),250)}}jn(PI.ID,PI,2);jn(OI.ID,OI,2);Be(zot);Be(Uot);Dn.registerCommand("editor.action.format",async i=>{const e=i.get(Un).getFocusedCodeEditor();if(!e||!e.hasModel())return;const t=i.get(sr);e.getSelection().isEmpty()?await t.executeCommand("editor.action.formatDocument"):await t.executeCommand("editor.action.formatSelection")});var jot=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},F9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class by{remove(){var e;(e=this.parent)===null||e===void 0||e.children.delete(this.id)}static findId(e,t){let n;typeof e=="string"?n=`${t.id}/${e}`:(n=`${t.id}/${e.name}`,t.children.get(n)!==void 0&&(n=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let r=n;for(let o=0;t.children.get(r)!==void 0;o++)r=`${n}_${o}`;return r}static empty(e){return e.children.size===0}}class CU extends by{constructor(e,t,n){super(),this.id=e,this.parent=t,this.symbol=n,this.children=new Map}}class b1e extends by{constructor(e,t,n,r){super(),this.id=e,this.parent=t,this.label=n,this.order=r,this.children=new Map}}class Fg extends by{static create(e,t,n){const r=new wr(n),o=new Fg(t.uri),s=e.ordered(t),a=s.map((c,u)=>{var d;const h=by.findId(`provider_${u}`,o),f=new b1e(h,o,(d=c.displayName)!==null&&d!==void 0?d:"Unknown Outline Provider",u);return Promise.resolve(c.provideDocumentSymbols(t,r.token)).then(g=>{for(const p of g||[])Fg._makeOutlineElement(p,f);return f},g=>(Zr(g),f)).then(g=>{by.empty(g)?g.remove():o._groups.set(h,g)})}),l=e.onDidChange(()=>{const c=e.ordered(t);or(c,s)||r.cancel()});return Promise.all(a).then(()=>r.token.isCancellationRequested&&!n.isCancellationRequested?Fg.create(e,t,n):o._compact()).finally(()=>{r.dispose(),l.dispose(),r.dispose()})}static _makeOutlineElement(e,t){const n=by.findId(e,t),r=new CU(n,t,e);if(e.children)for(const o of e.children)Fg._makeOutlineElement(o,r);t.children.set(r.id,r)}constructor(e){super(),this.uri=e,this.id="root",this.parent=void 0,this._groups=new Map,this.children=new Map,this.id="root",this.parent=void 0}_compact(){let e=0;for(const[t,n]of this._groups)n.children.size===0?this._groups.delete(t):e+=1;if(e!==1)this.children=this._groups;else{const t=En.first(this._groups.values());for(const[,n]of t.children)n.parent=this,this.children.set(n.id,n)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof CU?e.push(t.symbol):e.push(...En.map(t.children.values(),n=>n.symbol));return e.sort((t,n)=>B.compareRangesUsingStarts(t.range,n.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return Fg._flattenDocumentSymbols(t,e,""),t.sort((n,r)=>ae.compare(B.getStartPosition(n.range),B.getStartPosition(r.range))||ae.compare(B.getEndPosition(r.range),B.getEndPosition(n.range)))}static _flattenDocumentSymbols(e,t,n){for(const r of t)e.push({kind:r.kind,tags:r.tags,name:r.name,detail:r.detail,containerName:r.containerName||n,range:r.range,selectionRange:r.selectionRange,children:void 0}),r.children&&Fg._flattenDocumentSymbols(e,r.children,r.name)}}const pT=yn("IOutlineModelService");let yU=class{constructor(e,t,n){this._languageFeaturesService=e,this._disposables=new Te,this._cache=new D_(10,.7),this._debounceInformation=t.for(e.documentSymbolProvider,"DocumentSymbols",{min:350}),this._disposables.add(n.onModelRemoved(r=>{this._cache.delete(r.id)}))}dispose(){this._disposables.dispose()}async getOrCreate(e,t){const n=this._languageFeaturesService.documentSymbolProvider,r=n.ordered(e);let o=this._cache.get(e.id);if(!o||o.versionId!==e.getVersionId()||!or(o.provider,r)){const a=new wr;o={versionId:e.getVersionId(),provider:r,promiseCnt:0,source:a,promise:Fg.create(n,e,a.token),model:void 0},this._cache.set(e.id,o);const l=Date.now();o.promise.then(c=>{o.model=c,this._debounceInformation.update(e,Date.now()-l)}).catch(c=>{this._cache.delete(e.id)})}if(o.model)return o.model;o.promiseCnt+=1;const s=t.onCancellationRequested(()=>{--o.promiseCnt===0&&(o.source.cancel(),this._cache.delete(e.id))});try{return await o.promise}finally{s.dispose()}}};yU=jot([F9(0,_t),F9(1,gu),F9(2,tr)],yU);In(pT,yU,1);Dn.registerCommand("_executeDocumentSymbolProvider",async function(i,...e){const[t]=e;Xn(At.isUri(t));const n=i.get(pT),o=await i.get(ol).createModelReference(t);try{return(await n.getOrCreate(o.object.textEditorModel,Cn.None)).getTopLevelSymbols()}finally{o.dispose()}});class $o extends fe{constructor(e,t){super(),this.contextKeyService=e,this.model=t,this.inlineCompletionVisible=$o.inlineSuggestionVisible.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentation=$o.inlineSuggestionHasIndentation.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentationLessThanTabSize=$o.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService),this.suppressSuggestions=$o.suppressSuggestions.bindTo(this.contextKeyService),this._register(bn(n=>{const r=this.model.read(n),o=r==null?void 0:r.state.read(n),s=!!(o!=null&&o.inlineCompletion)&&(o==null?void 0:o.primaryGhostText)!==void 0&&!(o!=null&&o.primaryGhostText.isEmpty());this.inlineCompletionVisible.set(s),o!=null&&o.primaryGhostText&&(o!=null&&o.inlineCompletion)&&this.suppressSuggestions.set(o.inlineCompletion.inlineCompletion.source.inlineCompletions.suppressSuggestions)})),this._register(bn(n=>{const r=this.model.read(n);let o=!1,s=!0;const a=r==null?void 0:r.primaryGhostText.read(n);if(r!=null&&r.selectedSuggestItem&&a&&a.parts.length>0){const{column:l,lines:c}=a.parts[0],u=c[0],d=r.textModel.getLineIndentColumn(a.lineNumber);if(l<=d){let f=Ys(u);f===-1&&(f=u.length-1),o=f>0;const g=r.textModel.getOptions().tabSize;s=go.visibleColumnFromColumn(u,f+1,g){const o=B.lift(r.range);return{startOffset:t.getOffset(o.getStartPosition()),endOffset:t.getOffset(o.getEndPosition()),text:r.text}});n.sort((r,o)=>o.startOffset-r.startOffset);for(const r of n)i=i.substring(0,r.startOffset)+r.text+i.substring(r.endOffset);return i}class Got{constructor(e){this.lineStartOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;tqb.ID_PREFIX+i;class Pot extends ta{constructor(){super({id:"editor.gotoParentFold",label:w("gotoParentFold.label","Go to Parent Fold"),alias:"Go to Parent Fold",precondition:Os,kbOpts:{kbExpr:j.editorTextFocus,weight:100}})}invoke(e,t,n){const r=this.getSelectedLines(n);if(r.length>0){const o=sot(r[0],t);o!==null&&n.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class Oot extends ta{constructor(){super({id:"editor.gotoPreviousFold",label:w("gotoPreviousFold.label","Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:Os,kbOpts:{kbExpr:j.editorTextFocus,weight:100}})}invoke(e,t,n){const r=this.getSelectedLines(n);if(r.length>0){const o=aot(r[0],t);o!==null&&n.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class Fot extends ta{constructor(){super({id:"editor.gotoNextFold",label:w("gotoNextFold.label","Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:Os,kbOpts:{kbExpr:j.editorTextFocus,weight:100}})}invoke(e,t,n){const r=this.getSelectedLines(n);if(r.length>0){const o=lot(r[0],t);o!==null&&n.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class Bot extends ta{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:w("createManualFoldRange.label","Create Folding Range from Selection"),alias:"Create Folding Range from Selection",precondition:Os,kbOpts:{kbExpr:j.editorTextFocus,primary:co(2089,2135),weight:100}})}invoke(e,t,n){var r;const o=[],s=n.getSelections();if(s){for(const a of s){let l=a.endLineNumber;a.endColumn===1&&--l,l>a.startLineNumber&&(o.push({startLineNumber:a.startLineNumber,endLineNumber:l,type:void 0,isCollapsed:!0,source:1}),n.setSelection({startLineNumber:a.startLineNumber,startColumn:1,endLineNumber:a.startLineNumber,endColumn:1}))}if(o.length>0){o.sort((l,c)=>l.startLineNumber-c.startLineNumber);const a=ec.sanitizeAndMerge(t.regions,o,(r=n.getModel())===null||r===void 0?void 0:r.getLineCount());t.updatePost(ec.fromFoldRanges(a))}}}}class Wot extends ta{constructor(){super({id:"editor.removeManualFoldingRanges",label:w("removeManualFoldingRanges.label","Remove Manual Folding Ranges"),alias:"Remove Manual Folding Ranges",precondition:Os,kbOpts:{kbExpr:j.editorTextFocus,primary:co(2089,2137),weight:100}})}invoke(e,t,n){const r=n.getSelections();if(r){const o=[];for(const s of r){const{startLineNumber:a,endLineNumber:l}=s;o.push(l>=a?{startLineNumber:a,endLineNumber:l}:{endLineNumber:l,startLineNumber:a})}t.removeManualRanges(o),e.triggerFoldingModelChanged()}}}jn(Xf.ID,Xf,0);Be(Sot);Be(xot);Be(Lot);Be(Dot);Be(Mot);Be(Aot);Be(Iot);Be(kot);Be(Tot);Be(Not);Be(Rot);Be(Eot);Be(Pot);Be(Oot);Be(Fot);Be(Bot);Be(Wot);for(let i=1;i<=7;i++)U8e(new qb({id:qb.ID(i),label:w("foldLevelAction.label","Fold Level {0}",i),alias:`Fold Level ${i}`,precondition:Os,kbOpts:{kbExpr:j.editorTextFocus,primary:co(2089,2048|21+i),weight:100}}));Dn.registerCommand("_executeFoldingRangeProvider",async function(i,...e){const[t]=e;if(!(t instanceof At))throw eu();const n=i.get(_t),r=i.get(tr).getModel(t);if(!r)throw eu();const o=i.get(gn);if(!o.getValue("editor.folding",{resource:t}))return[];const s=i.get(Di),a=o.getValue("editor.foldingStrategy",{resource:t}),l={get limit(){return o.getValue("editor.foldingMaximumRegions",{resource:t})},update:(f,g)=>{}},c=new eZ(r,s,l);let u=c;if(a!=="indentation"){const f=Xf.getFoldingRangeProviders(n,r);f.length&&(u=new nZ(r,f,()=>{},l,c))}const d=await u.compute(Cn.None),h=[];try{if(d)for(let f=0;f=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},PE=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let PI=class{constructor(e,t,n,r){this._editor=e,this._languageFeaturesService=t,this._workerService=n,this._accessibilitySignalService=r,this._disposables=new Te,this._sessionDisposables=new Te,this._disposables.add(t.onTypeFormattingEditProvider.onDidChange(this._update,this)),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(o=>{o.hasChanged(56)&&this._update()})),this._update()}dispose(){this._disposables.dispose(),this._sessionDisposables.dispose()}_update(){if(this._sessionDisposables.clear(),!this._editor.getOption(56)||!this._editor.hasModel())return;const e=this._editor.getModel(),[t]=this._languageFeaturesService.onTypeFormattingEditProvider.ordered(e);if(!t||!t.autoFormatTriggerCharacters)return;const n=new JA;for(const r of t.autoFormatTriggerCharacters)n.add(r.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType(r=>{const o=r.charCodeAt(r.length-1);n.has(o)&&this._trigger(String.fromCharCode(o))}))}_trigger(e){if(!this._editor.hasModel()||this._editor.getSelections().length>1||!this._editor.getSelection().isEmpty())return;const t=this._editor.getModel(),n=this._editor.getPosition(),r=new wr,o=this._editor.onDidChangeModelContent(s=>{if(s.isFlush){r.cancel(),o.dispose();return}for(let a=0,l=s.changes.length;a{r.token.isCancellationRequested||Ts(s)&&(this._accessibilitySignalService.playSignal(cn.format,{userGesture:!1}),Zw.execute(this._editor,s,!0))}).finally(()=>{o.dispose()})}};PI.ID="editor.contrib.autoFormat";PI=_1e([PE(1,_t),PE(2,hd),PE(3,R_)],PI);let OI=class{constructor(e,t,n){this.editor=e,this._languageFeaturesService=t,this._instantiationService=n,this._callOnDispose=new Te,this._callOnModel=new Te,this._callOnDispose.add(e.onDidChangeConfiguration(()=>this._update())),this._callOnDispose.add(e.onDidChangeModel(()=>this._update())),this._callOnDispose.add(e.onDidChangeModelLanguage(()=>this._update())),this._callOnDispose.add(t.documentRangeFormattingEditProvider.onDidChange(this._update,this))}dispose(){this._callOnDispose.dispose(),this._callOnModel.dispose()}_update(){this._callOnModel.clear(),this.editor.getOption(55)&&this.editor.hasModel()&&this._languageFeaturesService.documentRangeFormattingEditProvider.has(this.editor.getModel())&&this._callOnModel.add(this.editor.onDidPaste(({range:e})=>this._trigger(e)))}_trigger(e){this.editor.hasModel()&&(this.editor.getSelections().length>1||this._instantiationService.invokeFunction(rbe,this.editor,e,2,mp.None,Cn.None,!1).catch(en))}};OI.ID="editor.contrib.formatOnPaste";OI=_1e([PE(1,_t),PE(2,Ot)],OI);class zot extends gt{constructor(){super({id:"editor.action.formatDocument",label:w("formatDocument.label","Format Document"),alias:"Format Document",precondition:De.and(j.notInCompositeEditor,j.writable,j.hasDocumentFormattingProvider),kbOpts:{kbExpr:j.editorTextFocus,primary:1572,linux:{primary:3111},weight:100},contextMenuOpts:{group:"1_modification",order:1.3}})}async run(e,t){if(t.hasModel()){const n=e.get(Ot);await e.get(k_).showWhile(n.invokeFunction(Cet,t,1,mp.None,Cn.None,!0),250)}}}class Uot extends gt{constructor(){super({id:"editor.action.formatSelection",label:w("formatSelection.label","Format Selection"),alias:"Format Selection",precondition:De.and(j.writable,j.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:j.editorTextFocus,primary:co(2089,2084),weight:100},contextMenuOpts:{when:j.hasNonEmptySelection,group:"1_modification",order:1.31}})}async run(e,t){if(!t.hasModel())return;const n=e.get(Ot),r=t.getModel(),o=t.getSelections().map(a=>a.isEmpty()?new B(a.startLineNumber,1,a.startLineNumber,r.getLineMaxColumn(a.startLineNumber)):a);await e.get(k_).showWhile(n.invokeFunction(rbe,t,o,1,mp.None,Cn.None,!0),250)}}jn(PI.ID,PI,2);jn(OI.ID,OI,2);Be(zot);Be(Uot);Dn.registerCommand("editor.action.format",async i=>{const e=i.get(Un).getFocusedCodeEditor();if(!e||!e.hasModel())return;const t=i.get(sr);e.getSelection().isEmpty()?await t.executeCommand("editor.action.formatDocument"):await t.executeCommand("editor.action.formatSelection")});var jot=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},F9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class by{remove(){var e;(e=this.parent)===null||e===void 0||e.children.delete(this.id)}static findId(e,t){let n;typeof e=="string"?n=`${t.id}/${e}`:(n=`${t.id}/${e.name}`,t.children.get(n)!==void 0&&(n=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let r=n;for(let o=0;t.children.get(r)!==void 0;o++)r=`${n}_${o}`;return r}static empty(e){return e.children.size===0}}class CU extends by{constructor(e,t,n){super(),this.id=e,this.parent=t,this.symbol=n,this.children=new Map}}class b1e extends by{constructor(e,t,n,r){super(),this.id=e,this.parent=t,this.label=n,this.order=r,this.children=new Map}}class Fg extends by{static create(e,t,n){const r=new wr(n),o=new Fg(t.uri),s=e.ordered(t),a=s.map((c,u)=>{var d;const h=by.findId(`provider_${u}`,o),f=new b1e(h,o,(d=c.displayName)!==null&&d!==void 0?d:"Unknown Outline Provider",u);return Promise.resolve(c.provideDocumentSymbols(t,r.token)).then(g=>{for(const p of g||[])Fg._makeOutlineElement(p,f);return f},g=>(Zr(g),f)).then(g=>{by.empty(g)?g.remove():o._groups.set(h,g)})}),l=e.onDidChange(()=>{const c=e.ordered(t);or(c,s)||r.cancel()});return Promise.all(a).then(()=>r.token.isCancellationRequested&&!n.isCancellationRequested?Fg.create(e,t,n):o._compact()).finally(()=>{r.dispose(),l.dispose(),r.dispose()})}static _makeOutlineElement(e,t){const n=by.findId(e,t),r=new CU(n,t,e);if(e.children)for(const o of e.children)Fg._makeOutlineElement(o,r);t.children.set(r.id,r)}constructor(e){super(),this.uri=e,this.id="root",this.parent=void 0,this._groups=new Map,this.children=new Map,this.id="root",this.parent=void 0}_compact(){let e=0;for(const[t,n]of this._groups)n.children.size===0?this._groups.delete(t):e+=1;if(e!==1)this.children=this._groups;else{const t=En.first(this._groups.values());for(const[,n]of t.children)n.parent=this,this.children.set(n.id,n)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof CU?e.push(t.symbol):e.push(...En.map(t.children.values(),n=>n.symbol));return e.sort((t,n)=>B.compareRangesUsingStarts(t.range,n.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return Fg._flattenDocumentSymbols(t,e,""),t.sort((n,r)=>ae.compare(B.getStartPosition(n.range),B.getStartPosition(r.range))||ae.compare(B.getEndPosition(r.range),B.getEndPosition(n.range)))}static _flattenDocumentSymbols(e,t,n){for(const r of t)e.push({kind:r.kind,tags:r.tags,name:r.name,detail:r.detail,containerName:r.containerName||n,range:r.range,selectionRange:r.selectionRange,children:void 0}),r.children&&Fg._flattenDocumentSymbols(e,r.children,r.name)}}const pT=yn("IOutlineModelService");let yU=class{constructor(e,t,n){this._languageFeaturesService=e,this._disposables=new Te,this._cache=new E_(10,.7),this._debounceInformation=t.for(e.documentSymbolProvider,"DocumentSymbols",{min:350}),this._disposables.add(n.onModelRemoved(r=>{this._cache.delete(r.id)}))}dispose(){this._disposables.dispose()}async getOrCreate(e,t){const n=this._languageFeaturesService.documentSymbolProvider,r=n.ordered(e);let o=this._cache.get(e.id);if(!o||o.versionId!==e.getVersionId()||!or(o.provider,r)){const a=new wr;o={versionId:e.getVersionId(),provider:r,promiseCnt:0,source:a,promise:Fg.create(n,e,a.token),model:void 0},this._cache.set(e.id,o);const l=Date.now();o.promise.then(c=>{o.model=c,this._debounceInformation.update(e,Date.now()-l)}).catch(c=>{this._cache.delete(e.id)})}if(o.model)return o.model;o.promiseCnt+=1;const s=t.onCancellationRequested(()=>{--o.promiseCnt===0&&(o.source.cancel(),this._cache.delete(e.id))});try{return await o.promise}finally{s.dispose()}}};yU=jot([F9(0,_t),F9(1,gu),F9(2,tr)],yU);In(pT,yU,1);Dn.registerCommand("_executeDocumentSymbolProvider",async function(i,...e){const[t]=e;Xn(At.isUri(t));const n=i.get(pT),o=await i.get(ol).createModelReference(t);try{return(await n.getOrCreate(o.object.textEditorModel,Cn.None)).getTopLevelSymbols()}finally{o.dispose()}});class $o extends fe{constructor(e,t){super(),this.contextKeyService=e,this.model=t,this.inlineCompletionVisible=$o.inlineSuggestionVisible.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentation=$o.inlineSuggestionHasIndentation.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentationLessThanTabSize=$o.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService),this.suppressSuggestions=$o.suppressSuggestions.bindTo(this.contextKeyService),this._register(bn(n=>{const r=this.model.read(n),o=r==null?void 0:r.state.read(n),s=!!(o!=null&&o.inlineCompletion)&&(o==null?void 0:o.primaryGhostText)!==void 0&&!(o!=null&&o.primaryGhostText.isEmpty());this.inlineCompletionVisible.set(s),o!=null&&o.primaryGhostText&&(o!=null&&o.inlineCompletion)&&this.suppressSuggestions.set(o.inlineCompletion.inlineCompletion.source.inlineCompletions.suppressSuggestions)})),this._register(bn(n=>{const r=this.model.read(n);let o=!1,s=!0;const a=r==null?void 0:r.primaryGhostText.read(n);if(r!=null&&r.selectedSuggestItem&&a&&a.parts.length>0){const{column:l,lines:c}=a.parts[0],u=c[0],d=r.textModel.getLineIndentColumn(a.lineNumber);if(l<=d){let f=Ys(u);f===-1&&(f=u.length-1),o=f>0;const g=r.textModel.getOptions().tabSize;s=go.visibleColumnFromColumn(u,f+1,g){const o=B.lift(r.range);return{startOffset:t.getOffset(o.getStartPosition()),endOffset:t.getOffset(o.getEndPosition()),text:r.text}});n.sort((r,o)=>o.startOffset-r.startOffset);for(const r of n)i=i.substring(0,r.startOffset)+r.text+i.substring(r.endOffset);return i}class Got{constructor(e){this.lineStartOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;tt)throw new qi(`startColumn ${e} cannot be after endColumnExclusive ${t}`)}toRange(e){return new B(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}}function y1e(i,e){const t=new Te,n=i.createDecorationsCollection();return t.add(_3({debugName:()=>`Apply decorations from ${e.debugName}`},r=>{const o=e.read(r);n.set(o)})),t.add({dispose:()=>{n.clear()}}),t}function q3(i,e){return new ae(i.lineNumber+e.lineNumber-1,e.lineNumber===1?i.column+e.column-1:e.column)}function ele(i,e){return new ae(i.lineNumber-e.lineNumber+1,i.lineNumber-e.lineNumber===0?i.column-e.column+1:i.column)}function iZ(i){let e=1,t=1;for(const n of i)n===` `?(e++,t=1):t++;return new ae(e,t)}function Yot(i){var e;const t=[];let n=0,r=0,o=0;for(const s of i){const a=(e=s.text)!==null&&e!==void 0?e:"",l=iZ(a),c=ae.lift({lineNumber:s.range.startLineNumber+r,column:s.range.startColumn+(s.range.startLineNumber===n?o:0)}),u=q3(c,l);t.push(B.fromPositions(c,u)),r+=l.lineNumber-s.range.endLineNumber+s.range.startLineNumber-1,o=u.column-s.range.endColumn,n=s.range.endLineNumber}return t}class SO{constructor(e){this._indexMap=e}static createSortPermutation(e,t){const n=Array.from(e.keys()).sort((r,o)=>t(e[r],e[o]));return new SO(n)}apply(e){return e.map((t,n)=>e[this._indexMap[n]])}inverse(){const e=this._indexMap.slice();for(let t=0;tt.equals(e.parts[n]))}renderForScreenReader(e){if(this.parts.length===0)return"";const t=this.parts[this.parts.length-1],n=e.substr(0,t.column-1);return Kot(n,this.parts.map(o=>({range:{startLineNumber:1,endLineNumber:1,startColumn:o.column,endColumn:o.column},text:o.lines.join(` `)}))).substring(this.parts[0].column-1)}isEmpty(){return this.parts.every(e=>e.lines.length===0)}get lineCount(){return 1+this.parts.reduce((e,t)=>e+t.lines.length-1,0)}}class xO{constructor(e,t,n){this.column=e,this.text=t,this.preview=n,this.lines=Jf(this.text)}equals(e){return this.column===e.column&&this.lines.length===e.lines.length&&this.lines.every((t,n)=>t===e.lines[n])}}class wU{constructor(e,t,n,r=0){this.lineNumber=e,this.columnRange=t,this.text=n,this.additionalReservedLineCount=r,this.parts=[new xO(this.columnRange.endColumnExclusive,this.text,!1)],this.newLines=Jf(this.text)}renderForScreenReader(e){return this.newLines.join(` -`)}get lineCount(){return this.newLines.length}isEmpty(){return this.parts.every(e=>e.lines.length===0)}equals(e){return this.lineNumber===e.lineNumber&&this.columnRange.equals(e.columnRange)&&this.newLines.length===e.newLines.length&&this.newLines.every((t,n)=>t===e.newLines[n])&&this.additionalReservedLineCount===e.additionalReservedLineCount}}function tle(i,e){return or(i,e,w1e)}function w1e(i,e){return i===e?!0:!i||!e?!1:i instanceof FI&&e instanceof FI||i instanceof wU&&e instanceof wU?i.equals(e):!1}var Zot=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Qot=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const nle="ghost-text";let SU=class extends fe{constructor(e,t,n){super(),this.editor=e,this.model=t,this.languageService=n,this.isDisposed=Hn(this,!1),this.currentTextModel=Vi(this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=Yt(this,r=>{if(this.isDisposed.read(r))return;const o=this.currentTextModel.read(r);if(o!==this.model.targetTextModel.read(r))return;const s=this.model.ghostText.read(r);if(!s)return;const a=s instanceof wU?s.columnRange:void 0,l=[],c=[];function u(p,v){if(c.length>0){const m=c[c.length-1];v&&m.decorations.push(new Ca(m.content.length+1,m.content.length+1+p[0].length,v,0)),m.content+=p[0],p=p.slice(1)}for(const m of p)c.push({content:m,decorations:v?[new Ca(1,m.length+1,v,0)]:[]})}const d=o.getLineContent(s.lineNumber);let h,f=0;for(const p of s.parts){let v=p.lines;h===void 0?(l.push({column:p.column,text:v[0],preview:p.preview}),v=v.slice(1)):u([d.substring(f,p.column-1)],void 0),v.length>0&&(u(v,nle),h===void 0&&p.column<=d.length&&(h=p.column)),f=p.column-1}h!==void 0&&u([d.substring(f)],void 0);const g=h!==void 0?new C1e(h,d.length+1):void 0;return{replacedRange:a,inlineTexts:l,additionalLines:c,hiddenRange:g,lineNumber:s.lineNumber,additionalReservedLineCount:this.model.minReservedLineCount.read(r),targetTextModel:o}}),this.decorations=Yt(this,r=>{const o=this.uiState.read(r);if(!o)return[];const s=[];o.replacedRange&&s.push({range:o.replacedRange.toRange(o.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace",description:"GhostTextReplacement"}}),o.hiddenRange&&s.push({range:o.hiddenRange.toRange(o.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const a of o.inlineTexts)s.push({range:B.fromPositions(new ae(o.lineNumber,a.column)),options:{description:nle,after:{content:a.text,inlineClassName:a.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:ju.Left},showIfCollapsed:!0}});return s}),this.additionalLinesWidget=this._register(new S1e(this.editor,this.languageService.languageIdCodec,Yt(r=>{const o=this.uiState.read(r);return o?{lineNumber:o.lineNumber,additionalLines:o.additionalLines,minReservedLineCount:o.additionalReservedLineCount,targetTextModel:o.targetTextModel}:void 0}))),this._register(Rt(()=>{this.isDisposed.set(!0,void 0)})),this._register(y1e(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};SU=Zot([Qot(2,ji)],SU);class S1e extends fe{get viewZoneId(){return this._viewZoneId}constructor(e,t,n){super(),this.editor=e,this.languageIdCodec=t,this.lines=n,this._viewZoneId=void 0,this.editorOptionsChanged=ma("editorOptionChanged",Je.filter(this.editor.onDidChangeConfiguration,r=>r.hasChanged(33)||r.hasChanged(117)||r.hasChanged(99)||r.hasChanged(94)||r.hasChanged(51)||r.hasChanged(50)||r.hasChanged(67))),this._register(bn(r=>{const o=this.lines.read(r);this.editorOptionsChanged.read(r),o?this.updateLines(o.lineNumber,o.additionalLines,o.minReservedLineCount):this.clear()}))}dispose(){super.dispose(),this.clear()}clear(){this.editor.changeViewZones(e=>{this._viewZoneId&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0)})}updateLines(e,t,n){const r=this.editor.getModel();if(!r)return;const{tabSize:o}=r.getOptions();this.editor.changeViewZones(s=>{this._viewZoneId&&(s.removeZone(this._viewZoneId),this._viewZoneId=void 0);const a=Math.max(t.length,n);if(a>0){const l=document.createElement("div");Jot(l,o,t,this.editor.getOptions(),this.languageIdCodec),this._viewZoneId=s.addZone({afterLineNumber:e,heightInLines:a,domNode:l,afterColumnAffinity:1})}})}}function Jot(i,e,t,n,r){const o=n.get(33),s=n.get(117),a="none",l=n.get(94),c=n.get(51),u=n.get(50),d=n.get(67),h=new DS(1e4);h.appendString('
');for(let p=0,v=t.length;p');const y=Tk(_),S=xw(_),L=Lo.createEmpty(_,r);Fk(new I_(u.isMonospace&&!o,u.canUseHalfwidthRightwardsArrow,_,!1,y,S,0,L,m.decorations,e,0,u.spaceWidth,u.middotWidth,u.wsmiddotWidth,s,a,l,c!==ic.OFF,null),h),h.appendString("
")}h.appendString(""),ps(i,u);const f=h.build(),g=ile?ile.createHTML(f):f;i.innerHTML=g}const ile=Hp("editorGhostText",{createHTML:i=>i});function est(i,e){const t=new Hve,n=new zve(t,c=>e.getLanguageConfiguration(c)),r=new Vve(new tst([i]),n),o=HH(r,[],void 0,!0);let s="";const a=i.getLineContent();function l(c,u){if(c.kind===2)if(l(c.openingBracket,u),u=gr(u,c.openingBracket.length),c.child&&(l(c.child,u),u=gr(u,c.child.length)),c.closingBracket)l(c.closingBracket,u),u=gr(u,c.closingBracket.length);else{const h=n.getSingleLanguageBracketTokens(c.openingBracket.languageId).findClosingTokenText(c.openingBracket.bracketIds);s+=h}else if(c.kind!==3){if(c.kind===0||c.kind===1)s+=a.substring(u,gr(u,c.length));else if(c.kind===4)for(const d of c.children)l(d,u),u=gr(u,d.length)}}return l(o,ya),s}class tst{constructor(e){this.lines=e,this.tokenization={getLineTokens:t=>this.lines[t-1]}}getLineCount(){return this.lines.length}getLineLength(e){return this.lines[e-1].getLineContent().length}}async function nst(i,e,t,n,r=Cn.None,o){const s=ost(e,t),a=i.all(t),l=new Wq;for(const m of a)m.groupId&&l.add(m.groupId,m);function c(m){if(!m.yieldsToGroupIds)return[];const _=[];for(const y of m.yieldsToGroupIds||[]){const S=l.get(y);for(const L of S)_.push(L)}return _}const u=new Map,d=new Set;function h(m,_){if(_=[..._,m],d.has(m))return _;d.add(m);try{const y=c(m);for(const S of y){const L=h(S,_);if(L)return L}}finally{d.delete(m)}}function f(m){const _=u.get(m);if(_)return _;const y=h(m,[]);y&&Zr(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${y.map(L=>L.toString?L.toString():""+L).join(" -> ")}`));const S=new a4;return u.set(m,S.p),(async()=>{if(!y){const L=c(m);for(const E of L){const D=await f(E);if(D&&D.items.length>0)return}}try{return await m.provideInlineCompletions(t,e,n,r)}catch(L){Zr(L);return}})().then(L=>S.complete(L),L=>S.error(L)),S.p}const g=await Promise.all(a.map(async m=>({provider:m,completions:await f(m)}))),p=new Map,v=[];for(const m of g){const _=m.completions;if(!_)continue;const y=new rst(_,m.provider);v.push(y);for(const S of _.items){const L=LO.from(S,y,s,t,o);p.set(L.hash(),L)}}return new ist(Array.from(p.values()),new Set(p.keys()),v)}class ist{constructor(e,t,n){this.completions=e,this.hashs=t,this.providerResults=n}has(e){return this.hashs.has(e.hash())}dispose(){for(const e of this.providerResults)e.removeRef()}}class rst{constructor(e,t){this.inlineCompletions=e,this.provider=t,this.refCount=1}addRef(){this.refCount++}removeRef(){this.refCount--,this.refCount===0&&this.provider.freeInlineCompletions(this.inlineCompletions)}}class LO{static from(e,t,n,r,o){let s,a,l=e.range?B.lift(e.range):n;if(typeof e.insertText=="string"){if(s=e.insertText,o&&e.completeBracketPairs){s=rle(s,l.getStartPosition(),r,o);const c=s.length-e.insertText.length;c!==0&&(l=new B(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn+c))}a=void 0}else if("snippet"in e.insertText){const c=e.insertText.snippet.length;if(o&&e.completeBracketPairs){e.insertText.snippet=rle(e.insertText.snippet,l.getStartPosition(),r,o);const d=e.insertText.snippet.length-c;d!==0&&(l=new B(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn+d))}const u=new Hb().parse(e.insertText.snippet);u.children.length===1&&u.children[0]instanceof pa?(s=u.children[0].value,a=void 0):(s=u.toString(),a={snippet:e.insertText.snippet,range:l})}else w4(e.insertText);return new LO(s,e.command,l,s,a,e.additionalTextEdits||Xot(),e,t)}constructor(e,t,n,r,o,s,a,l){this.filterText=e,this.command=t,this.range=n,this.insertText=r,this.snippetInfo=o,this.additionalTextEdits=s,this.sourceInlineCompletion=a,this.source=l,e=e.replace(/\r\n|\r/g,` +`)}get lineCount(){return this.newLines.length}isEmpty(){return this.parts.every(e=>e.lines.length===0)}equals(e){return this.lineNumber===e.lineNumber&&this.columnRange.equals(e.columnRange)&&this.newLines.length===e.newLines.length&&this.newLines.every((t,n)=>t===e.newLines[n])&&this.additionalReservedLineCount===e.additionalReservedLineCount}}function tle(i,e){return or(i,e,w1e)}function w1e(i,e){return i===e?!0:!i||!e?!1:i instanceof FI&&e instanceof FI||i instanceof wU&&e instanceof wU?i.equals(e):!1}var Zot=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Qot=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const nle="ghost-text";let SU=class extends fe{constructor(e,t,n){super(),this.editor=e,this.model=t,this.languageService=n,this.isDisposed=Hn(this,!1),this.currentTextModel=Vi(this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=Yt(this,r=>{if(this.isDisposed.read(r))return;const o=this.currentTextModel.read(r);if(o!==this.model.targetTextModel.read(r))return;const s=this.model.ghostText.read(r);if(!s)return;const a=s instanceof wU?s.columnRange:void 0,l=[],c=[];function u(p,v){if(c.length>0){const m=c[c.length-1];v&&m.decorations.push(new Ca(m.content.length+1,m.content.length+1+p[0].length,v,0)),m.content+=p[0],p=p.slice(1)}for(const m of p)c.push({content:m,decorations:v?[new Ca(1,m.length+1,v,0)]:[]})}const d=o.getLineContent(s.lineNumber);let h,f=0;for(const p of s.parts){let v=p.lines;h===void 0?(l.push({column:p.column,text:v[0],preview:p.preview}),v=v.slice(1)):u([d.substring(f,p.column-1)],void 0),v.length>0&&(u(v,nle),h===void 0&&p.column<=d.length&&(h=p.column)),f=p.column-1}h!==void 0&&u([d.substring(f)],void 0);const g=h!==void 0?new C1e(h,d.length+1):void 0;return{replacedRange:a,inlineTexts:l,additionalLines:c,hiddenRange:g,lineNumber:s.lineNumber,additionalReservedLineCount:this.model.minReservedLineCount.read(r),targetTextModel:o}}),this.decorations=Yt(this,r=>{const o=this.uiState.read(r);if(!o)return[];const s=[];o.replacedRange&&s.push({range:o.replacedRange.toRange(o.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace",description:"GhostTextReplacement"}}),o.hiddenRange&&s.push({range:o.hiddenRange.toRange(o.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const a of o.inlineTexts)s.push({range:B.fromPositions(new ae(o.lineNumber,a.column)),options:{description:nle,after:{content:a.text,inlineClassName:a.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:ju.Left},showIfCollapsed:!0}});return s}),this.additionalLinesWidget=this._register(new S1e(this.editor,this.languageService.languageIdCodec,Yt(r=>{const o=this.uiState.read(r);return o?{lineNumber:o.lineNumber,additionalLines:o.additionalLines,minReservedLineCount:o.additionalReservedLineCount,targetTextModel:o.targetTextModel}:void 0}))),this._register(Rt(()=>{this.isDisposed.set(!0,void 0)})),this._register(y1e(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};SU=Zot([Qot(2,ji)],SU);class S1e extends fe{get viewZoneId(){return this._viewZoneId}constructor(e,t,n){super(),this.editor=e,this.languageIdCodec=t,this.lines=n,this._viewZoneId=void 0,this.editorOptionsChanged=ma("editorOptionChanged",Je.filter(this.editor.onDidChangeConfiguration,r=>r.hasChanged(33)||r.hasChanged(117)||r.hasChanged(99)||r.hasChanged(94)||r.hasChanged(51)||r.hasChanged(50)||r.hasChanged(67))),this._register(bn(r=>{const o=this.lines.read(r);this.editorOptionsChanged.read(r),o?this.updateLines(o.lineNumber,o.additionalLines,o.minReservedLineCount):this.clear()}))}dispose(){super.dispose(),this.clear()}clear(){this.editor.changeViewZones(e=>{this._viewZoneId&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0)})}updateLines(e,t,n){const r=this.editor.getModel();if(!r)return;const{tabSize:o}=r.getOptions();this.editor.changeViewZones(s=>{this._viewZoneId&&(s.removeZone(this._viewZoneId),this._viewZoneId=void 0);const a=Math.max(t.length,n);if(a>0){const l=document.createElement("div");Jot(l,o,t,this.editor.getOptions(),this.languageIdCodec),this._viewZoneId=s.addZone({afterLineNumber:e,heightInLines:a,domNode:l,afterColumnAffinity:1})}})}}function Jot(i,e,t,n,r){const o=n.get(33),s=n.get(117),a="none",l=n.get(94),c=n.get(51),u=n.get(50),d=n.get(67),h=new DS(1e4);h.appendString('
');for(let p=0,v=t.length;p');const y=Tk(_),S=xw(_),L=Lo.createEmpty(_,r);Fk(new D_(u.isMonospace&&!o,u.canUseHalfwidthRightwardsArrow,_,!1,y,S,0,L,m.decorations,e,0,u.spaceWidth,u.middotWidth,u.wsmiddotWidth,s,a,l,c!==ic.OFF,null),h),h.appendString("
")}h.appendString(""),ps(i,u);const f=h.build(),g=ile?ile.createHTML(f):f;i.innerHTML=g}const ile=Vp("editorGhostText",{createHTML:i=>i});function est(i,e){const t=new Hve,n=new zve(t,c=>e.getLanguageConfiguration(c)),r=new Vve(new tst([i]),n),o=HH(r,[],void 0,!0);let s="";const a=i.getLineContent();function l(c,u){if(c.kind===2)if(l(c.openingBracket,u),u=gr(u,c.openingBracket.length),c.child&&(l(c.child,u),u=gr(u,c.child.length)),c.closingBracket)l(c.closingBracket,u),u=gr(u,c.closingBracket.length);else{const h=n.getSingleLanguageBracketTokens(c.openingBracket.languageId).findClosingTokenText(c.openingBracket.bracketIds);s+=h}else if(c.kind!==3){if(c.kind===0||c.kind===1)s+=a.substring(u,gr(u,c.length));else if(c.kind===4)for(const d of c.children)l(d,u),u=gr(u,d.length)}}return l(o,ya),s}class tst{constructor(e){this.lines=e,this.tokenization={getLineTokens:t=>this.lines[t-1]}}getLineCount(){return this.lines.length}getLineLength(e){return this.lines[e-1].getLineContent().length}}async function nst(i,e,t,n,r=Cn.None,o){const s=ost(e,t),a=i.all(t),l=new Wq;for(const m of a)m.groupId&&l.add(m.groupId,m);function c(m){if(!m.yieldsToGroupIds)return[];const _=[];for(const y of m.yieldsToGroupIds||[]){const S=l.get(y);for(const L of S)_.push(L)}return _}const u=new Map,d=new Set;function h(m,_){if(_=[..._,m],d.has(m))return _;d.add(m);try{const y=c(m);for(const S of y){const L=h(S,_);if(L)return L}}finally{d.delete(m)}}function f(m){const _=u.get(m);if(_)return _;const y=h(m,[]);y&&Zr(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${y.map(L=>L.toString?L.toString():""+L).join(" -> ")}`));const S=new a4;return u.set(m,S.p),(async()=>{if(!y){const L=c(m);for(const E of L){const D=await f(E);if(D&&D.items.length>0)return}}try{return await m.provideInlineCompletions(t,e,n,r)}catch(L){Zr(L);return}})().then(L=>S.complete(L),L=>S.error(L)),S.p}const g=await Promise.all(a.map(async m=>({provider:m,completions:await f(m)}))),p=new Map,v=[];for(const m of g){const _=m.completions;if(!_)continue;const y=new rst(_,m.provider);v.push(y);for(const S of _.items){const L=LO.from(S,y,s,t,o);p.set(L.hash(),L)}}return new ist(Array.from(p.values()),new Set(p.keys()),v)}class ist{constructor(e,t,n){this.completions=e,this.hashs=t,this.providerResults=n}has(e){return this.hashs.has(e.hash())}dispose(){for(const e of this.providerResults)e.removeRef()}}class rst{constructor(e,t){this.inlineCompletions=e,this.provider=t,this.refCount=1}addRef(){this.refCount++}removeRef(){this.refCount--,this.refCount===0&&this.provider.freeInlineCompletions(this.inlineCompletions)}}class LO{static from(e,t,n,r,o){let s,a,l=e.range?B.lift(e.range):n;if(typeof e.insertText=="string"){if(s=e.insertText,o&&e.completeBracketPairs){s=rle(s,l.getStartPosition(),r,o);const c=s.length-e.insertText.length;c!==0&&(l=new B(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn+c))}a=void 0}else if("snippet"in e.insertText){const c=e.insertText.snippet.length;if(o&&e.completeBracketPairs){e.insertText.snippet=rle(e.insertText.snippet,l.getStartPosition(),r,o);const d=e.insertText.snippet.length-c;d!==0&&(l=new B(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn+d))}const u=new Hb().parse(e.insertText.snippet);u.children.length===1&&u.children[0]instanceof pa?(s=u.children[0].value,a=void 0):(s=u.toString(),a={snippet:e.insertText.snippet,range:l})}else w4(e.insertText);return new LO(s,e.command,l,s,a,e.additionalTextEdits||Xot(),e,t)}constructor(e,t,n,r,o,s,a,l){this.filterText=e,this.command=t,this.range=n,this.insertText=r,this.snippetInfo=o,this.additionalTextEdits=s,this.sourceInlineCompletion=a,this.source=l,e=e.replace(/\r\n|\r/g,` `),r=e.replace(/\r\n|\r/g,` -`)}withRange(e){return new LO(this.filterText,this.command,e,this.insertText,this.snippetInfo,this.additionalTextEdits,this.sourceInlineCompletion,this.source)}hash(){return JSON.stringify({insertText:this.insertText,range:this.range.toString()})}}function ost(i,e){const t=e.getWordAtPosition(i),n=e.getLineMaxColumn(i.lineNumber);return t?new B(i.lineNumber,t.startColumn,i.lineNumber,n):B.fromPositions(i,i.with(void 0,n))}function rle(i,e,t,n){const o=t.getLineContent(e.lineNumber).substring(0,e.column-1)+i,s=t.tokenization.tokenizeLineWithEdit(e,o.length-(e.column-1),i),a=s==null?void 0:s.sliceAndInflate(e.column-1,o.length,0);return a?est(a,n):i}class h_{constructor(e,t){this.range=e,this.text=t}removeCommonPrefix(e,t){const n=t?this.range.intersectRanges(t):this.range;if(!n)return this;const r=e.getValueInRange(n,1),o=zv(r,this.text),s=q3(this.range.getStartPosition(),iZ(r.substring(0,o))),a=this.text.substring(o),l=B.fromPositions(s,this.range.getEndPosition());return new h_(l,a)}augments(e){return this.text.startsWith(e.text)&&sst(this.range,e.range)}computeGhostText(e,t,n,r=0){let o=this.removeCommonPrefix(e);if(o.range.endLineNumber!==o.range.startLineNumber)return;const s=e.getLineContent(o.range.startLineNumber),a=bi(s).length;if(o.range.startColumn-1<=a){const g=bi(o.text).length,p=s.substring(o.range.startColumn-1,a),[v,m]=[o.range.getStartPosition(),o.range.getEndPosition()],_=v.column+p.length<=m.column?v.delta(0,p.length):m,y=B.fromPositions(_,m),S=o.text.startsWith(p)?o.text.substring(p.length):o.text.substring(g);o=new h_(y,S)}const c=e.getValueInRange(o.range),u=ast(c,o.text);if(!u)return;const d=o.range.startLineNumber,h=new Array;if(t==="prefix"){const g=u.filter(p=>p.originalLength===0);if(g.length>1||g.length===1&&g[0].originalStart!==c.length)return}const f=o.text.length-r;for(const g of u){const p=o.range.startColumn+g.originalStart+g.originalLength;if(t==="subwordSmart"&&n&&n.lineNumber===o.range.startLineNumber&&p0)return;if(g.modifiedLength===0)continue;const v=g.modifiedStart+g.modifiedLength,m=Math.max(g.modifiedStart,Math.min(v,f)),_=o.text.substring(g.modifiedStart,m),y=o.text.substring(m,Math.max(g.modifiedStart,v));_.length>0&&h.push(new xO(p,_,!1)),y.length>0&&h.push(new xO(p,y,!0))}return new FI(d,h)}}function sst(i,e){return e.getStartPosition().equals(i.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(i.getEndPosition())}let Uh;function ast(i,e){if((Uh==null?void 0:Uh.originalValue)===i&&(Uh==null?void 0:Uh.newValue)===e)return Uh==null?void 0:Uh.changes;{let t=sle(i,e,!0);if(t){const n=ole(t);if(n>0){const r=sle(i,e,!1);r&&ole(r)5e3||e.length>5e3)return;function n(c){let u=0;for(let d=0,h=c.length;du&&(u=f)}return u}const r=Math.max(n(i),n(e));function o(c){if(c<0)throw new Error("unexpected");return r+c+1}function s(c){let u=0,d=0;const h=new Int32Array(c.length);for(let f=0,g=c.length;fa},{getElements:()=>l}).ComputeDiff(!1).changes}var lst=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ale=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let xU=class extends fe{constructor(e,t,n,r,o){super(),this.textModel=e,this.versionId=t,this._debounceValue=n,this.languageFeaturesService=r,this.languageConfigurationService=o,this._updateOperation=this._register(new Ho),this.inlineCompletions=yI("inlineCompletions",void 0),this.suggestWidgetInlineCompletions=yI("suggestWidgetInlineCompletions",void 0),this._register(this.textModel.onDidChangeContent(()=>{this._updateOperation.clear()}))}fetch(e,t,n){var r,o;const s=new ust(e,t,this.textModel.getVersionId()),a=t.selectedSuggestionInfo?this.suggestWidgetInlineCompletions:this.inlineCompletions;if(!((r=this._updateOperation.value)===null||r===void 0)&&r.request.satisfies(s))return this._updateOperation.value.promise;if(!((o=a.get())===null||o===void 0)&&o.request.satisfies(s))return Promise.resolve(!0);const l=!!this._updateOperation.value;this._updateOperation.clear();const c=new wr,u=(async()=>{if((l||t.triggerKind===fp.Automatic)&&await cst(this._debounceValue.get(this.textModel),c.token),c.token.isCancellationRequested||this.textModel.getVersionId()!==s.versionId)return!1;const f=new Date,g=await nst(this.languageFeaturesService.inlineCompletionsProvider,e,this.textModel,t,c.token,this.languageConfigurationService);if(c.token.isCancellationRequested||this.textModel.getVersionId()!==s.versionId)return!1;const p=new Date;this._debounceValue.update(this.textModel,p.getTime()-f.getTime());const v=new fst(g,s,this.textModel,this.versionId);if(n){const m=n.toInlineCompletion(void 0);n.canBeReused(this.textModel,e)&&!g.has(m)&&v.prepend(n.inlineCompletion,m.range,!0)}return this._updateOperation.clear(),Ri(m=>{a.set(v,m)}),!0})(),d=new hst(s,c,u);return this._updateOperation.value=d,u}clear(e){this._updateOperation.clear(),this.inlineCompletions.set(void 0,e),this.suggestWidgetInlineCompletions.set(void 0,e)}clearSuggestWidgetInlineCompletions(e){var t;!((t=this._updateOperation.value)===null||t===void 0)&&t.request.context.selectedSuggestionInfo&&this._updateOperation.clear(),this.suggestWidgetInlineCompletions.set(void 0,e)}cancelUpdate(){this._updateOperation.clear()}};xU=lst([ale(3,_t),ale(4,Di)],xU);function cst(i,e){return new Promise(t=>{let n;const r=setTimeout(()=>{n&&n.dispose(),t()},i);e&&(n=e.onCancellationRequested(()=>{clearTimeout(r),n&&n.dispose(),t()}))})}class ust{constructor(e,t,n){this.position=e,this.context=t,this.versionId=n}satisfies(e){return this.position.equals(e.position)&&dst(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,(t,n)=>t.equals(n))&&(e.context.triggerKind===fp.Automatic||this.context.triggerKind===fp.Explicit)&&this.versionId===e.versionId}}function dst(i,e,t){return!i||!e?i===e:t(i,e)}class hst{constructor(e,t,n){this.request=e,this.cancellationTokenSource=t,this.promise=n}dispose(){this.cancellationTokenSource.cancel()}}class fst{get inlineCompletions(){return this._inlineCompletions}constructor(e,t,n,r){this.inlineCompletionProviderResult=e,this.request=t,this.textModel=n,this.versionId=r,this._refCount=1,this._prependedInlineCompletionItems=[],this._rangeVersionIdValue=0,this._rangeVersionId=Yt(this,s=>{this.versionId.read(s);let a=!1;for(const l of this._inlineCompletions)a=a||l._updateRange(this.textModel);return a&&this._rangeVersionIdValue++,this._rangeVersionIdValue});const o=n.deltaDecorations([],e.completions.map(s=>({range:s.range,options:{description:"inline-completion-tracking-range"}})));this._inlineCompletions=e.completions.map((s,a)=>new lle(s,o[a],this._rangeVersionId))}clone(){return this._refCount++,this}dispose(){if(this._refCount--,this._refCount===0){setTimeout(()=>{this.textModel.isDisposed()||this.textModel.deltaDecorations(this._inlineCompletions.map(e=>e.decorationId),[])},0),this.inlineCompletionProviderResult.dispose();for(const e of this._prependedInlineCompletionItems)e.source.removeRef()}}prepend(e,t,n){n&&e.source.addRef();const r=this.textModel.deltaDecorations([],[{range:t,options:{description:"inline-completion-tracking-range"}}])[0];this._inlineCompletions.unshift(new lle(e,r,this._rangeVersionId,t)),this._prependedInlineCompletionItems.push(e)}}class lle{get forwardStable(){var e;return(e=this.inlineCompletion.source.inlineCompletions.enableForwardStability)!==null&&e!==void 0?e:!1}constructor(e,t,n,r){this.inlineCompletion=e,this.decorationId=t,this.rangeVersion=n,this.semanticId=JSON.stringify([this.inlineCompletion.filterText,this.inlineCompletion.insertText,this.inlineCompletion.range.getStartPosition().toString()]),this._isValid=!0,this._updatedRange=r??e.range}toInlineCompletion(e){return this.inlineCompletion.withRange(this._getUpdatedRange(e))}toSingleTextEdit(e){return new h_(this._getUpdatedRange(e),this.inlineCompletion.insertText)}isVisible(e,t,n){const r=this._toFilterTextReplacement(n).removeCommonPrefix(e);if(!this._isValid||!this.inlineCompletion.range.getStartPosition().equals(this._getUpdatedRange(n).getStartPosition())||t.lineNumber!==r.range.startLineNumber)return!1;const o=e.getValueInRange(r.range,1),s=r.text,a=Math.max(0,t.column-r.range.startColumn);let l=s.substring(0,a),c=s.substring(a),u=o.substring(0,a),d=o.substring(a);const h=e.getLineIndentColumn(r.range.startLineNumber);return r.range.startColumn<=h&&(u=u.trimStart(),u.length===0&&(d=d.trimStart()),l=l.trimStart(),l.length===0&&(c=c.trimStart())),l.startsWith(u)&&!!L_e(d,c)}canBeReused(e,t){return this._isValid&&this._getUpdatedRange(void 0).containsPosition(t)&&this.isVisible(e,t,void 0)&&!this._isSmallerThanOriginal(void 0)}_toFilterTextReplacement(e){return new h_(this._getUpdatedRange(e),this.inlineCompletion.filterText)}_isSmallerThanOriginal(e){return cle(this._getUpdatedRange(e)).isBefore(cle(this.inlineCompletion.range))}_getUpdatedRange(e){return this.rangeVersion.read(e),this._updatedRange}_updateRange(e){const t=e.getDecorationRange(this.decorationId);return t?this._updatedRange.equalsRange(t)?!1:(this._updatedRange=t,!0):(this._isValid=!1,!0)}}function cle(i){return i.startLineNumber===i.endLineNumber?new ae(1,1+i.endColumn-i.startColumn):new ae(1+i.endLineNumber-i.startLineNumber,i.endColumn)}const ln={Visible:YY,HasFocusedSuggestion:new st("suggestWidgetHasFocusedSuggestion",!1,w("suggestWidgetHasSelection","Whether any suggestion is focused")),DetailsVisible:new st("suggestWidgetDetailsVisible",!1,w("suggestWidgetDetailsVisible","Whether suggestion details are visible")),MultipleSuggestions:new st("suggestWidgetMultipleSuggestions",!1,w("suggestWidgetMultipleSuggestions","Whether there are multiple suggestions to pick from")),MakesTextEdit:new st("suggestionMakesTextEdit",!0,w("suggestionMakesTextEdit","Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new st("acceptSuggestionOnEnter",!0,w("acceptSuggestionOnEnter","Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new st("suggestionHasInsertAndReplaceRange",!1,w("suggestionHasInsertAndReplaceRange","Whether the current suggestion has insert and replace behaviour")),InsertMode:new st("suggestionInsertMode",void 0,{type:"string",description:w("suggestionInsertMode","Whether the default behaviour is to insert or replace")}),CanResolve:new st("suggestionCanResolve",!1,w("suggestionCanResolve","Whether the current suggestion supports to resolve further details"))},Tv=new $("suggestWidgetStatusBar");class gst{constructor(e,t,n,r){var o;this.position=e,this.completion=t,this.container=n,this.provider=r,this.isInvalid=!1,this.score=rh.Default,this.distance=0,this.textLabel=typeof t.label=="string"?t.label:(o=t.label)===null||o===void 0?void 0:o.label,this.labelLow=this.textLabel.toLowerCase(),this.isInvalid=!this.textLabel,this.sortTextLow=t.sortText&&t.sortText.toLowerCase(),this.filterTextLow=t.filterText&&t.filterText.toLowerCase(),this.extensionId=t.extensionId,B.isIRange(t.range)?(this.editStart=new ae(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new ae(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new ae(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||B.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new ae(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new ae(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new ae(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||B.spansMultipleLines(t.range.insert)||B.spansMultipleLines(t.range.replace)||t.range.insert.startLineNumber!==e.lineNumber||t.range.replace.startLineNumber!==e.lineNumber||t.range.insert.startColumn!==t.range.replace.startColumn),typeof r.resolveCompletionItem!="function"&&(this._resolveCache=Promise.resolve(),this._resolveDuration=0)}get isResolved(){return this._resolveDuration!==void 0}get resolveDuration(){return this._resolveDuration!==void 0?this._resolveDuration:-1}async resolve(e){if(!this._resolveCache){const t=e.onCancellationRequested(()=>{this._resolveCache=void 0,this._resolveDuration=void 0}),n=new Ms(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(r=>{Object.assign(this.completion,r),this._resolveDuration=n.elapsed()},r=>{wh(r)&&(this._resolveCache=void 0,this._resolveDuration=void 0)}).finally(()=>{t.dispose()})}return this._resolveCache}}class BI{constructor(e=2,t=new Set,n=new Set,r=new Map,o=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=n,this.providerItemsToReuse=r,this.showDeprecated=o}}BI.default=new BI;let pst;function mst(){return pst}class vst{constructor(e,t,n,r){this.items=e,this.needsClipboard=t,this.durations=n,this.disposable=r}}async function rZ(i,e,t,n=BI.default,r={triggerKind:0},o=Cn.None){const s=new Ms;t=t.clone();const a=e.getWordAtPosition(t),l=a?new B(t.lineNumber,a.startColumn,t.lineNumber,a.endColumn):B.fromPositions(t),c={replace:l,insert:l.setEndPosition(t.lineNumber,t.column)},u=[],d=new Te,h=[];let f=!1;const g=(v,m,_)=>{var y,S,L;let E=!1;if(!m)return E;for(const D of m.suggestions)if(!n.kindFilter.has(D.kind)){if(!n.showDeprecated&&(!((y=D==null?void 0:D.tags)===null||y===void 0)&&y.includes(1)))continue;D.range||(D.range=c),D.sortText||(D.sortText=typeof D.label=="string"?D.label:D.label.label),!f&&D.insertTextRules&&D.insertTextRules&4&&(f=Hb.guessNeedsClipboard(D.insertText)),u.push(new gst(t,D,m,v)),E=!0}return aq(m)&&d.add(m),h.push({providerName:(S=v._debugDisplayName)!==null&&S!==void 0?S:"unknown_provider",elapsedProvider:(L=m.duration)!==null&&L!==void 0?L:-1,elapsedOverall:_.elapsed()}),E},p=(async()=>{})();for(const v of i.orderedGroups(e)){let m=!1;if(await Promise.all(v.map(async _=>{if(n.providerItemsToReuse.has(_)){const y=n.providerItemsToReuse.get(_);y.forEach(S=>u.push(S)),m=m||y.length>0;return}if(!(n.providerFilter.size>0&&!n.providerFilter.has(_)))try{const y=new Ms,S=await _.provideCompletionItems(e,t,r,o);m=g(_,S,y)||m}catch(y){Zr(y)}})),m||o.isCancellationRequested)break}return await p,o.isCancellationRequested?(d.dispose(),Promise.reject(new L_)):new vst(u.sort(Cst(n.snippetSortOrder)),f,{entries:h,elapsed:s.elapsed()},d)}function oZ(i,e){if(i.sortTextLow&&e.sortTextLow){if(i.sortTextLowe.sortTextLow)return 1}return i.textLabele.textLabel?1:i.completion.kind-e.completion.kind}function _st(i,e){if(i.completion.kind!==e.completion.kind){if(i.completion.kind===27)return-1;if(e.completion.kind===27)return 1}return oZ(i,e)}function bst(i,e){if(i.completion.kind!==e.completion.kind){if(i.completion.kind===27)return 1;if(e.completion.kind===27)return-1}return oZ(i,e)}const X3=new Map;X3.set(0,_st);X3.set(2,bst);X3.set(1,oZ);function Cst(i){return X3.get(i)}Dn.registerCommand("_executeCompletionItemProvider",async(i,...e)=>{const[t,n,r,o]=e;Xn(At.isUri(t)),Xn(ae.isIPosition(n)),Xn(typeof r=="string"||!r),Xn(typeof o=="number"||!o);const{completionProvider:s}=i.get(_t),a=await i.get(ol).createModelReference(t);try{const l={incomplete:!1,suggestions:[]},c=[],u=a.object.textEditorModel.validatePosition(n),d=await rZ(s,a.object.textEditorModel,u,void 0,{triggerCharacter:r??void 0,triggerKind:r?1:0});for(const h of d.items)c.length<(o??0)&&c.push(h.resolve(Cn.None)),l.incomplete=l.incomplete||h.container.incomplete,l.suggestions.push(h.completion);try{return await Promise.all(c),l}finally{setTimeout(()=>d.disposable.dispose(),100)}}finally{a.dispose()}});function yst(i,e){var t;(t=i.getContribution("editor.contrib.suggestController"))===null||t===void 0||t.triggerSuggest(new Set().add(e),void 0,!0)}class Cy{static isAllOff(e){return e.other==="off"&&e.comments==="off"&&e.strings==="off"}static isAllOn(e){return e.other==="on"&&e.comments==="on"&&e.strings==="on"}static valueFor(e,t){switch(t){case 1:return e.comments;case 2:return e.strings;default:return e.other}}}function ule(i,e=Rs){return vze(i,e)?i.charAt(0).toUpperCase()+i.slice(1):i}var wst=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Sst=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class dle{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){const n=t.resolve(e);if(n!==void 0)return n}}}class hle{constructor(e,t,n,r){this._model=e,this._selection=t,this._selectionIdx=n,this._overtypingCapturer=r}resolve(e){const{name:t}=e;if(t==="SELECTION"||t==="TM_SELECTED_TEXT"){let n=this._model.getValueInRange(this._selection)||void 0,r=this._selection.startLineNumber!==this._selection.endLineNumber;if(!n&&this._overtypingCapturer){const o=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);o&&(n=o.value,r=o.multiline)}if(n&&r&&e.snippet){const o=this._model.getLineContent(this._selection.startLineNumber),s=bi(o,0,this._selection.startColumn-1);let a=s;e.snippet.walk(c=>c===e?!1:(c instanceof pa&&(a=bi(Jf(c.value).pop())),!0));const l=zv(a,s);n=n.replace(/(\r\n|\r|\n)(.*)/g,(c,u,d)=>`${u}${a.substr(l)}${d}`)}return n}else{if(t==="TM_CURRENT_LINE")return this._model.getLineContent(this._selection.positionLineNumber);if(t==="TM_CURRENT_WORD"){const n=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return n&&n.word||void 0}else{if(t==="TM_LINE_INDEX")return String(this._selection.positionLineNumber-1);if(t==="TM_LINE_NUMBER")return String(this._selection.positionLineNumber);if(t==="CURSOR_INDEX")return String(this._selectionIdx);if(t==="CURSOR_NUMBER")return String(this._selectionIdx+1)}}}}class fle{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return vv(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const n=vv(this._model.uri.fsPath),r=n.lastIndexOf(".");return r<=0?n:n.slice(0,r)}else{if(t==="TM_DIRECTORY")return Lpe(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(z4(this._model.uri));if(t==="TM_FILEPATH")return this._labelService.getUriLabel(this._model.uri);if(t==="RELATIVE_FILEPATH")return this._labelService.getUriLabel(this._model.uri,{relative:!0,noPrefix:!0})}}}class gle{constructor(e,t,n,r){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=n,this._spread=r}resolve(e){if(e.name!=="CLIPBOARD")return;const t=this._readClipboardText();if(t){if(this._spread){const n=t.split(/\r\n|\n|\r/).filter(r=>!Rpe(r));if(n.length===this._selectionCount)return n[this._selectionIdx]}return t}}}let EO=class{constructor(e,t,n){this._model=e,this._selection=t,this._languageConfigurationService=n}resolve(e){const{name:t}=e,n=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),r=this._languageConfigurationService.getLanguageConfiguration(n).comments;if(r){if(t==="LINE_COMMENT")return r.lineCommentToken||void 0;if(t==="BLOCK_COMMENT_START")return r.blockCommentStartToken||void 0;if(t==="BLOCK_COMMENT_END")return r.blockCommentEndToken||void 0}}};EO=wst([Sst(2,Di)],EO);class Xd{constructor(){this._date=new Date}resolve(e){const{name:t}=e;if(t==="CURRENT_YEAR")return String(this._date.getFullYear());if(t==="CURRENT_YEAR_SHORT")return String(this._date.getFullYear()).slice(-2);if(t==="CURRENT_MONTH")return String(this._date.getMonth().valueOf()+1).padStart(2,"0");if(t==="CURRENT_DATE")return String(this._date.getDate().valueOf()).padStart(2,"0");if(t==="CURRENT_HOUR")return String(this._date.getHours().valueOf()).padStart(2,"0");if(t==="CURRENT_MINUTE")return String(this._date.getMinutes().valueOf()).padStart(2,"0");if(t==="CURRENT_SECOND")return String(this._date.getSeconds().valueOf()).padStart(2,"0");if(t==="CURRENT_DAY_NAME")return Xd.dayNames[this._date.getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return Xd.dayNamesShort[this._date.getDay()];if(t==="CURRENT_MONTH_NAME")return Xd.monthNames[this._date.getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return Xd.monthNamesShort[this._date.getMonth()];if(t==="CURRENT_SECONDS_UNIX")return String(Math.floor(this._date.getTime()/1e3));if(t==="CURRENT_TIMEZONE_OFFSET"){const n=this._date.getTimezoneOffset(),r=n>0?"-":"+",o=Math.trunc(Math.abs(n/60)),s=o<10?"0"+o:o,a=Math.abs(n)-o*60,l=a<10?"0"+a:a;return r+s+":"+l}}}Xd.dayNames=[w("Sunday","Sunday"),w("Monday","Monday"),w("Tuesday","Tuesday"),w("Wednesday","Wednesday"),w("Thursday","Thursday"),w("Friday","Friday"),w("Saturday","Saturday")];Xd.dayNamesShort=[w("SundayShort","Sun"),w("MondayShort","Mon"),w("TuesdayShort","Tue"),w("WednesdayShort","Wed"),w("ThursdayShort","Thu"),w("FridayShort","Fri"),w("SaturdayShort","Sat")];Xd.monthNames=[w("January","January"),w("February","February"),w("March","March"),w("April","April"),w("May","May"),w("June","June"),w("July","July"),w("August","August"),w("September","September"),w("October","October"),w("November","November"),w("December","December")];Xd.monthNamesShort=[w("JanuaryShort","Jan"),w("FebruaryShort","Feb"),w("MarchShort","Mar"),w("AprilShort","Apr"),w("MayShort","May"),w("JuneShort","Jun"),w("JulyShort","Jul"),w("AugustShort","Aug"),w("SeptemberShort","Sep"),w("OctoberShort","Oct"),w("NovemberShort","Nov"),w("DecemberShort","Dec")];class ple{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=kGe(this._workspaceService.getWorkspace());if(!EGe(t)){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(t);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(t)}}_resolveWorkspaceName(e){if(CV(e))return vv(e.uri.path);let t=vv(e.configPath.path);return t.endsWith(yV)&&(t=t.substr(0,t.length-yV.length-1)),t}_resoveWorkspacePath(e){if(CV(e))return ule(e.uri.fsPath);const t=vv(e.configPath.path);let n=e.configPath.fsPath;return n.endsWith(t)&&(n=n.substr(0,n.length-t.length-1)),n?ule(n):"/"}}class mle{resolve(e){const{name:t}=e;if(t==="RANDOM")return Math.random().toString().slice(-6);if(t==="RANDOM_HEX")return Math.random().toString(16).slice(-6);if(t==="UUID")return T3()}}var xst=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Lst=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Ld;class Wc{constructor(e,t,n){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=n,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=Tne(t.placeholders,Vc.compareByIndex),this._placeholderGroupsIdx=-1}initialize(e){this._offset=e.newPosition}dispose(){this._placeholderDecorations&&this._editor.removeDecorations([...this._placeholderDecorations.values()]),this._placeholderGroups.length=0}_initDecorations(){if(this._offset===-1)throw new Error("Snippet not initialized!");if(this._placeholderDecorations)return;this._placeholderDecorations=new Map;const e=this._editor.getModel();this._editor.changeDecorations(t=>{for(const n of this._snippet.placeholders){const r=this._snippet.offset(n),o=this._snippet.fullLen(n),s=B.fromPositions(e.getPositionAt(this._offset+r),e.getPositionAt(this._offset+r+o)),a=n.isFinalTabstop?Wc._decor.inactiveFinal:Wc._decor.inactive,l=t.addDecoration(s,a);this._placeholderDecorations.set(n,l)}})}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const r=[];for(const o of this._placeholderGroups[this._placeholderGroupsIdx])if(o.transform){const s=this._placeholderDecorations.get(o),a=this._editor.getModel().getDecorationRange(s),l=this._editor.getModel().getValueInRange(a),c=o.transform.resolve(l).split(/\r\n|\r|\n/);for(let u=1;u0&&this._editor.executeEdits("snippet.placeholderTransform",r)}let t=!1;e===!0&&this._placeholderGroupsIdx0&&(this._placeholderGroupsIdx-=1,t=!0);const n=this._editor.getModel().changeDecorations(r=>{const o=new Set,s=[];for(const a of this._placeholderGroups[this._placeholderGroupsIdx]){const l=this._placeholderDecorations.get(a),c=this._editor.getModel().getDecorationRange(l);s.push(new yt(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),r.changeDecorationOptions(l,a.isFinalTabstop?Wc._decor.activeFinal:Wc._decor.active),o.add(a);for(const u of this._snippet.enclosingPlaceholders(a)){const d=this._placeholderDecorations.get(u);r.changeDecorationOptions(d,u.isFinalTabstop?Wc._decor.activeFinal:Wc._decor.active),o.add(u)}}for(const[a,l]of this._placeholderDecorations)o.has(a)||r.changeDecorationOptions(l,a.isFinalTabstop?Wc._decor.inactiveFinal:Wc._decor.inactive);return s});return t?this.move(e):n??[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof Vc){const n=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(n).isEmpty()&&t.toString().length>0)return!0}t=t.parent}return!1}get isAtFirstPlaceholder(){return this._placeholderGroupsIdx<=0||this._placeholderGroups.length===0}get isAtLastPlaceholder(){return this._placeholderGroupsIdx===this._placeholderGroups.length-1}get hasPlaceholder(){return this._snippet.placeholders.length>0}get isTrivialSnippet(){if(this._snippet.placeholders.length===0)return!0;if(this._snippet.placeholders.length===1){const[e]=this._snippet.placeholders;if(e.isFinalTabstop&&this._snippet.rightMostDescendant===e)return!0}return!1}computePossibleSelections(){const e=new Map;for(const t of this._placeholderGroups){let n;for(const r of t){if(r.isFinalTabstop)break;n||(n=[],e.set(r.index,n));const o=this._placeholderDecorations.get(r),s=this._editor.getModel().getDecorationRange(o);if(!s){e.delete(r.index);break}n.push(s)}}return e}get activeChoice(){if(!this._placeholderDecorations)return;const e=this._placeholderGroups[this._placeholderGroupsIdx][0];if(!(e!=null&&e.choice))return;const t=this._placeholderDecorations.get(e);if(!t)return;const n=this._editor.getModel().getDecorationRange(t);if(n)return{range:n,choice:e.choice}}get hasChoice(){let e=!1;return this._snippet.walk(t=>(e=t instanceof HS,!e)),e}merge(e){const t=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations(n=>{for(const r of this._placeholderGroups[this._placeholderGroupsIdx]){const o=e.shift();console.assert(o._offset!==-1),console.assert(!o._placeholderDecorations);const s=o._snippet.placeholderInfo.last.index;for(const l of o._snippet.placeholderInfo.all)l.isFinalTabstop?l.index=r.index+(s+1)/this._nestingLevel:l.index=r.index+l.index/this._nestingLevel;this._snippet.replace(r,o._snippet.children);const a=this._placeholderDecorations.get(r);n.removeDecoration(a),this._placeholderDecorations.delete(r);for(const l of o._snippet.placeholders){const c=o._snippet.offset(l),u=o._snippet.fullLen(l),d=B.fromPositions(t.getPositionAt(o._offset+c),t.getPositionAt(o._offset+c+u)),h=n.addDecoration(d,Wc._decor.inactive);this._placeholderDecorations.set(l,h)}}this._placeholderGroups=Tne(this._snippet.placeholders,Vc.compareByIndex)})}}Wc._decor={active:sn.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:sn.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:sn.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:sn.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})};const vle={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let DO=Ld=class{static adjustWhitespace(e,t,n,r,o){const s=e.getLineContent(t.lineNumber),a=bi(s,0,t.column-1);let l;return r.walk(c=>{if(!(c instanceof pa)||c.parent instanceof HS||o&&!o.has(c))return!0;const u=c.value.split(/\r\n|\r|\n/);if(n){const h=r.offset(c);if(h===0)u[0]=e.normalizeIndentation(u[0]);else{l=l??r.toString();const f=l.charCodeAt(h-1);(f===10||f===13)&&(u[0]=e.normalizeIndentation(a+u[0]))}for(let f=1;fS.get(Pb)),g=e.invokeWithinContext(S=>new fle(S.get(Vw),h)),p=()=>a,v=h.getValueInRange(Ld.adjustSelection(h,e.getSelection(),n,0)),m=h.getValueInRange(Ld.adjustSelection(h,e.getSelection(),0,r)),_=h.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),y=e.getSelections().map((S,L)=>({selection:S,idx:L})).sort((S,L)=>B.compareRangesUsingStarts(S.selection,L.selection));for(const{selection:S,idx:L}of y){let E=Ld.adjustSelection(h,S,n,0),D=Ld.adjustSelection(h,S,0,r);v!==h.getValueInRange(E)&&(E=S),m!==h.getValueInRange(D)&&(D=S);const k=S.setStartPosition(E.startLineNumber,E.startColumn).setEndPosition(D.endLineNumber,D.endColumn),T=new Hb().parse(t,!0,o),M=k.getStartPosition(),A=Ld.adjustWhitespace(h,M,s||L>0&&_!==h.getLineFirstNonWhitespaceColumn(S.positionLineNumber),T);T.resolveVariables(new dle([g,new gle(p,L,y.length,e.getOption(79)==="spread"),new hle(h,S,L,l),new EO(h,S,c),new Xd,new ple(f),new mle])),u[L]=Xi.replace(k,T.toString()),u[L].identifier={major:L,minor:0},u[L]._isTracked=!0,d[L]=new Wc(e,T,A)}return{edits:u,snippets:d}}static createEditsAndSnippetsFromEdits(e,t,n,r,o,s,a){if(!e.hasModel()||t.length===0)return{edits:[],snippets:[]};const l=[],c=e.getModel(),u=new Hb,d=new lT,h=new dle([e.invokeWithinContext(g=>new fle(g.get(Vw),c)),new gle(()=>o,0,e.getSelections().length,e.getOption(79)==="spread"),new hle(c,e.getSelection(),0,s),new EO(c,e.getSelection(),a),new Xd,new ple(e.invokeWithinContext(g=>g.get(Pb))),new mle]);t=t.sort((g,p)=>B.compareRangesUsingStarts(g.range,p.range));let f=0;for(let g=0;g0){const L=t[g-1].range,E=B.fromPositions(L.getEndPosition(),p.getStartPosition()),D=new pa(c.getValueInRange(E));d.appendChild(D),f+=D.value.length}const m=u.parseFragment(v,d);Ld.adjustWhitespace(c,p.getStartPosition(),!0,d,new Set(m)),d.resolveVariables(h);const _=d.toString(),y=_.slice(f);f=_.length;const S=Xi.replace(p,y);S.identifier={major:g,minor:0},S._isTracked=!0,l.push(S)}return u.ensureFinalTabstop(d,n,!0),{edits:l,snippets:[new Wc(e,d,"")]}}constructor(e,t,n=vle,r){this._editor=e,this._template=t,this._options=n,this._languageConfigurationService=r,this._templateMerges=[],this._snippets=[]}dispose(){si(this._snippets)}_logInfo(){return`template="${this._template}", merged_templates="${this._templateMerges.join(" -> ")}"`}insert(){if(!this._editor.hasModel())return;const{edits:e,snippets:t}=typeof this._template=="string"?Ld.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):Ld.createEditsAndSnippetsFromEdits(this._editor,this._template,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService);this._snippets=t,this._editor.executeEdits("snippet",e,n=>{const r=n.filter(o=>!!o.identifier);for(let o=0;oyt.fromPositions(o.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=vle){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:n,snippets:r}=Ld.createEditsAndSnippetsFromSelections(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",n,o=>{const s=o.filter(l=>!!l.identifier);for(let l=0;lyt.fromPositions(l.range.getEndPosition()))})}next(){const e=this._move(!0);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}prev(){const e=this._move(!1);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}_move(e){const t=[];for(const n of this._snippets){const r=n.move(e);t.push(...r)}return t}get isAtFirstPlaceholder(){return this._snippets[0].isAtFirstPlaceholder}get isAtLastPlaceholder(){return this._snippets[0].isAtLastPlaceholder}get hasPlaceholder(){return this._snippets[0].hasPlaceholder}get hasChoice(){return this._snippets[0].hasChoice}get activeChoice(){return this._snippets[0].activeChoice}isSelectionWithinPlaceholders(){if(!this.hasPlaceholder)return!1;const e=this._editor.getSelections();if(e.length{o.push(...r.get(s))})}e.sort(B.compareRangesUsingStarts);for(const[n,r]of t){if(r.length!==e.length){t.delete(n);continue}r.sort(B.compareRangesUsingStarts);for(let o=0;o0}};DO=Ld=xst([Lst(3,Di)],DO);var Est=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},c2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},R1;const _le={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let ns=R1=class{static get(e){return e.getContribution(R1.ID)}constructor(e,t,n,r,o){this._editor=e,this._logService=t,this._languageFeaturesService=n,this._languageConfigurationService=o,this._snippetListener=new Te,this._modelVersionId=-1,this._inSnippet=R1.InSnippetMode.bindTo(r),this._hasNextTabstop=R1.HasNextTabstop.bindTo(r),this._hasPrevTabstop=R1.HasPrevTabstop.bindTo(r)}dispose(){var e;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),(e=this._session)===null||e===void 0||e.dispose(),this._snippetListener.dispose()}insert(e,t){try{this._doInsert(e,typeof t>"u"?_le:{..._le,...t})}catch(n){this.cancel(),this._logService.error(n),this._logService.error("snippet_error"),this._logService.error("insert_template=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"")}}_doInsert(e,t){var n;if(this._editor.hasModel()){if(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session&&typeof e!="string"&&this.cancel(),this._session?(Xn(typeof e=="string"),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new DO(this._editor,e,t,this._languageConfigurationService),this._session.insert()),t.undoStopAfter&&this._editor.getModel().pushStackElement(),!((n=this._session)===null||n===void 0)&&n.hasChoice){const r={_debugDisplayName:"snippetChoiceCompletions",provideCompletionItems:(u,d)=>{if(!this._session||u!==this._editor.getModel()||!ae.equals(this._editor.getPosition(),d))return;const{activeChoice:h}=this._session;if(!h||h.choice.options.length===0)return;const f=u.getValueInRange(h.range),g=!!h.choice.options.find(v=>v.value===f),p=[];for(let v=0;v{s==null||s.dispose(),a=!1},c=()=>{a||(s=this._languageFeaturesService.completionProvider.register({language:o.getLanguageId(),pattern:o.uri.fsPath,scheme:o.uri.scheme,exclusive:!0},r),this._snippetListener.add(s),a=!0)};this._choiceCompletions={provider:r,enable:c,disable:l}}this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent(r=>r.isFlush&&this.cancel())),this._snippetListener.add(this._editor.onDidChangeModel(()=>this.cancel())),this._snippetListener.add(this._editor.onDidChangeCursorSelection(()=>this._updateState()))}}_updateState(){if(!(!this._session||!this._editor.hasModel())){if(this._modelVersionId===this._editor.getModel().getAlternativeVersionId())return this.cancel();if(!this._session.hasPlaceholder)return this.cancel();if(this._session.isAtLastPlaceholder||!this._session.isSelectionWithinPlaceholders())return this._editor.getModel().pushStackElement(),this.cancel();this._inSnippet.set(!0),this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder),this._hasNextTabstop.set(!this._session.isAtLastPlaceholder),this._handleChoice()}}_handleChoice(){var e;if(!this._session||!this._editor.hasModel()){this._currentChoice=void 0;return}const{activeChoice:t}=this._session;if(!t||!this._choiceCompletions){(e=this._choiceCompletions)===null||e===void 0||e.disable(),this._currentChoice=void 0;return}this._currentChoice!==t.choice&&(this._currentChoice=t.choice,this._choiceCompletions.enable(),queueMicrotask(()=>{yst(this._editor,this._choiceCompletions.provider)}))}finish(){for(;this._inSnippet.get();)this.next()}cancel(e=!1){var t;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),this._currentChoice=void 0,(t=this._session)===null||t===void 0||t.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){var e;(e=this._session)===null||e===void 0||e.prev(),this._updateState()}next(){var e;(e=this._session)===null||e===void 0||e.next(),this._updateState()}isInSnippet(){return!!this._inSnippet.get()}};ns.ID="snippetController2";ns.InSnippetMode=new st("inSnippetMode",!1,w("inSnippetMode","Whether the editor in current in snippet mode"));ns.HasNextTabstop=new st("hasNextTabstop",!1,w("hasNextTabstop","Whether there is a next tab stop when in snippet mode"));ns.HasPrevTabstop=new st("hasPrevTabstop",!1,w("hasPrevTabstop","Whether there is a previous tab stop when in snippet mode"));ns=R1=Est([c2(1,Ta),c2(2,_t),c2(3,Vt),c2(4,Di)],ns);jn(ns.ID,ns,4);const Y3=Vo.bindToContribution(ns.get);et(new Y3({id:"jumpToNextSnippetPlaceholder",precondition:De.and(ns.InSnippetMode,ns.HasNextTabstop),handler:i=>i.next(),kbOpts:{weight:100+30,kbExpr:j.editorTextFocus,primary:2}}));et(new Y3({id:"jumpToPrevSnippetPlaceholder",precondition:De.and(ns.InSnippetMode,ns.HasPrevTabstop),handler:i=>i.prev(),kbOpts:{weight:100+30,kbExpr:j.editorTextFocus,primary:1026}}));et(new Y3({id:"leaveSnippet",precondition:ns.InSnippetMode,handler:i=>i.cancel(!0),kbOpts:{weight:100+30,kbExpr:j.editorTextFocus,primary:9,secondary:[1033]}}));et(new Y3({id:"acceptSnippet",precondition:ns.InSnippetMode,handler:i=>i.finish()}));var Dst=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},B9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},ql;(function(i){i[i.Undo=0]="Undo",i[i.Redo=1]="Redo",i[i.AcceptWord=2]="AcceptWord",i[i.Other=3]="Other"})(ql||(ql={}));let LU=class extends fe{get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,n,r,o,s,a,l,c,u,d,h){super(),this.textModel=e,this.selectedSuggestItem=t,this.textModelVersionId=n,this._positions=r,this._debounceValue=o,this._suggestPreviewEnabled=s,this._suggestPreviewMode=a,this._inlineSuggestMode=l,this._enabled=c,this._instantiationService=u,this._commandService=d,this._languageConfigurationService=h,this._source=this._register(this._instantiationService.createInstance(xU,this.textModel,this.textModelVersionId,this._debounceValue)),this._isActive=Hn(this,!1),this._forceUpdateSignal=pY("forceUpdate"),this._selectedInlineCompletionId=Hn(this,void 0),this._primaryPosition=Yt(this,g=>{var p;return(p=this._positions.read(g)[0])!==null&&p!==void 0?p:new ae(1,1)}),this._isAcceptingPartially=!1,this._preserveCurrentCompletionReasons=new Set([ql.Redo,ql.Undo,ql.AcceptWord]),this._fetchInlineCompletions=FZe({owner:this,createEmptyChangeSummary:()=>({preserveCurrentCompletion:!1,inlineCompletionTriggerKind:fp.Automatic}),handleChange:(g,p)=>(g.didChange(this.textModelVersionId)&&this._preserveCurrentCompletionReasons.has(g.change)?p.preserveCurrentCompletion=!0:g.didChange(this._forceUpdateSignal)&&(p.inlineCompletionTriggerKind=g.change),!0)},(g,p)=>{if(this._forceUpdateSignal.read(g),!(this._enabled.read(g)&&this.selectedSuggestItem.read(g)||this._isActive.read(g))){this._source.cancelUpdate();return}this.textModelVersionId.read(g);const m=this.selectedInlineCompletion.get(),_=p.preserveCurrentCompletion||m!=null&&m.forwardStable?m:void 0,y=this._source.suggestWidgetInlineCompletions.get(),S=this.selectedSuggestItem.read(g);if(y&&!S){const D=this._source.inlineCompletions.get();Ri(k=>{(!D||y.request.versionId>D.request.versionId)&&this._source.inlineCompletions.set(y.clone(),k),this._source.clearSuggestWidgetInlineCompletions(k)})}const L=this._primaryPosition.read(g),E={triggerKind:p.inlineCompletionTriggerKind,selectedSuggestionInfo:S==null?void 0:S.toSelectedSuggestionInfo()};return this._source.fetch(L,E,_)}),this._filteredInlineCompletionItems=Yt(this,g=>{const p=this._source.inlineCompletions.read(g);if(!p)return[];const v=this._primaryPosition.read(g);return p.inlineCompletions.filter(_=>_.isVisible(this.textModel,v,g))}),this.selectedInlineCompletionIndex=Yt(this,g=>{const p=this._selectedInlineCompletionId.read(g),v=this._filteredInlineCompletionItems.read(g),m=this._selectedInlineCompletionId===void 0?-1:v.findIndex(_=>_.semanticId===p);return m===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):m}),this.selectedInlineCompletion=Yt(this,g=>{const p=this._filteredInlineCompletionItems.read(g),v=this.selectedInlineCompletionIndex.read(g);return p[v]}),this.lastTriggerKind=this._source.inlineCompletions.map(this,g=>g==null?void 0:g.request.context.triggerKind),this.inlineCompletionsCount=Yt(this,g=>{if(this.lastTriggerKind.read(g)===fp.Explicit)return this._filteredInlineCompletionItems.read(g).length}),this.state=Qy({owner:this,equalityComparer:(g,p)=>!g||!p?g===p:tle(g.ghostTexts,p.ghostTexts)&&g.inlineCompletion===p.inlineCompletion&&g.suggestItem===p.suggestItem},g=>{var p,v;const m=this.textModel,_=this.selectedSuggestItem.read(g);if(_){const y=_.toSingleTextEdit().removeCommonPrefix(m),S=this._computeAugmentation(y,g);if(!this._suggestPreviewEnabled.read(g)&&!S)return;const E=(p=S==null?void 0:S.edit)!==null&&p!==void 0?p:y,D=S?S.edit.text.length-y.text.length:0,k=this._suggestPreviewMode.read(g),T=this._positions.read(g),M=[E,...W9(this.textModel,T,E)],A=M.map((R,F)=>R.computeGhostText(m,k,T[F],D)).filter(kf),N=(v=A[0])!==null&&v!==void 0?v:new FI(E.range.endLineNumber,[]);return{edits:M,primaryGhostText:N,ghostTexts:A,inlineCompletion:S==null?void 0:S.completion,suggestItem:_}}else{if(!this._isActive.read(g))return;const y=this.selectedInlineCompletion.read(g);if(!y)return;const S=y.toSingleTextEdit(g),L=this._inlineSuggestMode.read(g),E=this._positions.read(g),D=[S,...W9(this.textModel,E,S)],k=D.map((T,M)=>T.computeGhostText(m,L,E[M],0)).filter(kf);return k[0]?{edits:D,primaryGhostText:k[0],ghostTexts:k,inlineCompletion:y,suggestItem:void 0}:void 0}}),this.ghostTexts=Qy({owner:this,equalityComparer:tle},g=>{const p=this.state.read(g);if(p)return p.ghostTexts}),this.primaryGhostText=Qy({owner:this,equalityComparer:w1e},g=>{const p=this.state.read(g);if(p)return p==null?void 0:p.primaryGhostText}),this._register(oT(this._fetchInlineCompletions));let f;this._register(bn(g=>{var p,v;const m=this.state.read(g),_=m==null?void 0:m.inlineCompletion;if((_==null?void 0:_.semanticId)!==(f==null?void 0:f.semanticId)&&(f=_,_)){const y=_.inlineCompletion,S=y.source;(v=(p=S.provider).handleItemDidShow)===null||v===void 0||v.call(p,S.inlineCompletions,y.sourceInlineCompletion,y.insertText)}}))}async trigger(e){this._isActive.set(!0,e),await this._fetchInlineCompletions.get()}async triggerExplicitly(e){CI(e,t=>{this._isActive.set(!0,t),this._forceUpdateSignal.trigger(t,fp.Explicit)}),await this._fetchInlineCompletions.get()}stop(e){CI(e,t=>{this._isActive.set(!1,t),this._source.clear(t)})}_computeAugmentation(e,t){const n=this.textModel,r=this._source.suggestWidgetInlineCompletions.read(t),o=r?r.inlineCompletions:[this.selectedInlineCompletion.read(t)].filter(kf);return u9e(o,a=>{let l=a.toSingleTextEdit(t);return l=l.removeCommonPrefix(n,B.fromPositions(l.range.getStartPosition(),e.range.getEndPosition())),l.augments(e)?{completion:a,edit:l}:void 0})}async _deltaSelectedInlineCompletionIndex(e){await this.triggerExplicitly();const t=this._filteredInlineCompletionItems.get()||[];if(t.length>0){const n=(this.selectedInlineCompletionIndex.get()+e+t.length)%t.length;this._selectedInlineCompletionId.set(t[n].semanticId,void 0)}else this._selectedInlineCompletionId.set(void 0,void 0)}async next(){await this._deltaSelectedInlineCompletionIndex(1)}async previous(){await this._deltaSelectedInlineCompletionIndex(-1)}async accept(e){var t;if(e.getModel()!==this.textModel)throw new qi;const n=this.state.get();if(!n||n.primaryGhostText.isEmpty()||!n.inlineCompletion)return;const r=n.inlineCompletion.toInlineCompletion(void 0);if(e.pushUndoStop(),r.snippetInfo)e.executeEdits("inlineSuggestion.accept",[Xi.replaceMove(r.range,""),...r.additionalTextEdits]),e.setPosition(r.snippetInfo.range.getStartPosition(),"inlineCompletionAccept"),(t=ns.get(e))===null||t===void 0||t.insert(r.snippetInfo.snippet,{undoStopBefore:!1});else{const o=n.edits,s=ble(o).map(a=>yt.fromPositions(a));e.executeEdits("inlineSuggestion.accept",[...o.map(a=>Xi.replaceMove(a.range,a.text)),...r.additionalTextEdits]),e.setSelections(s,"inlineCompletionAccept")}r.command&&r.source.addRef(),Ri(o=>{this._source.clear(o),this._isActive.set(!1,o)}),r.command&&(await this._commandService.executeCommand(r.command.id,...r.command.arguments||[]).then(void 0,Zr),r.source.removeRef())}async acceptNextWord(e){await this._acceptNext(e,(t,n)=>{const r=this.textModel.getLanguageIdAtPosition(t.lineNumber,t.column),o=this._languageConfigurationService.getLanguageConfiguration(r),s=new RegExp(o.wordDefinition.source,o.wordDefinition.flags.replace("g","")),a=n.match(s);let l=0;a&&a.index!==void 0?a.index===0?l=a[0].length:l=a.index:l=n.length;const u=/\s+/g.exec(n);return u&&u.index!==void 0&&u.index+u[0].length{const r=n.match(/\n/);return r&&r.index!==void 0?r.index+1:n.length})}async _acceptNext(e,t){if(e.getModel()!==this.textModel)throw new qi;const n=this.state.get();if(!n||n.primaryGhostText.isEmpty()||!n.inlineCompletion)return;const r=n.primaryGhostText,o=n.inlineCompletion.toInlineCompletion(void 0);if(o.snippetInfo||o.filterText!==o.insertText){await this.accept(e);return}const s=r.parts[0],a=new ae(r.lineNumber,s.column),l=s.text,c=t(a,l);if(c===l.length&&r.parts.length===1){this.accept(e);return}const u=l.substring(0,c),d=this._positions.get(),h=d[0];o.source.addRef();try{this._isAcceptingPartially=!0;try{e.pushUndoStop();const f=B.fromPositions(h,a),g=e.getModel().getValueInRange(f)+u,p=new h_(f,g),v=[p,...W9(this.textModel,d,p)],m=ble(v).map(_=>yt.fromPositions(_));e.executeEdits("inlineSuggestion.accept",v.map(_=>Xi.replaceMove(_.range,_.text))),e.setSelections(m,"inlineCompletionPartialAccept")}finally{this._isAcceptingPartially=!1}if(o.source.provider.handlePartialAccept){const f=B.fromPositions(o.range.getStartPosition(),q3(a,iZ(u))),g=e.getModel().getValueInRange(f,1);o.source.provider.handlePartialAccept(o.source.inlineCompletions,o.sourceInlineCompletion,g.length)}}finally{o.source.removeRef()}}handleSuggestAccepted(e){var t,n;const r=e.toSingleTextEdit().removeCommonPrefix(this.textModel),o=this._computeAugmentation(r,void 0);if(!o)return;const s=o.completion.inlineCompletion;(n=(t=s.source.provider).handlePartialAccept)===null||n===void 0||n.call(t,s.source.inlineCompletions,s.sourceInlineCompletion,r.text.length)}};LU=Dst([B9(9,Ot),B9(10,sr),B9(11,Di)],LU);function W9(i,e,t){if(e.length===1)return[];const n=e[0],r=e.slice(1),o=t.range.getStartPosition(),s=t.range.getEndPosition(),a=i.getValueInRange(B.fromPositions(n,s)),l=ele(n,o);if(l.lineNumber<1)return en(new qi(`positionWithinTextEdit line number should be bigger than 0. - Invalid subtraction between ${n.toString()} and ${o.toString()}`)),[];const c=Ist(t.text,l);return r.map(u=>{const d=q3(ele(u,o),s),h=i.getValueInRange(B.fromPositions(u,d)),f=zv(a,h),g=B.fromPositions(u,u.delta(0,f));return new h_(g,c)})}function Ist(i,e){let t="";const n=H5e(i);for(let r=e.lineNumber-1;rB.compareRangesUsingStarts(r.range,o.range)),t=Yot(e.apply(i));return e.inverse().apply(t).map(r=>r.getEndPosition())}var kst=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Cle=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},VL;class sZ{constructor(e){this.name=e}select(e,t,n){if(n.length===0)return 0;const r=n[0].score[0];for(let o=0;ol&&d.type===n[c].completion.kind&&d.insertText===n[c].completion.insertText&&(l=d.touch,a=c),n[c].completion.preselect&&s===-1)return s=c}return a!==-1?a:s!==-1?s:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();const t=0;for(const[n,r]of e)r.touch=t,r.type=typeof r.type=="number"?r.type:SD.fromString(r.type),this._cache.set(n,r);this._seq=this._cache.size}}class Nst extends sZ{constructor(){super("recentlyUsedByPrefix"),this._trie=qy.forStrings(),this._seq=0}memorize(e,t,n){const{word:r}=e.getWordUntilPosition(t),o=`${e.getLanguageId()}/${r}`;this._trie.set(o,{type:n.completion.kind,insertText:n.completion.insertText,touch:this._seq++})}select(e,t,n){const{word:r}=e.getWordUntilPosition(t);if(!r)return super.select(e,t,n);const o=`${e.getLanguageId()}/${r}`;let s=this._trie.get(o);if(s||(s=this._trie.findSubstr(o)),s)for(let a=0;ae.push([n,t])),e.sort((t,n)=>-(t[1].touch-n[1].touch)).forEach((t,n)=>t[1].touch=n),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,n]of e)n.type=typeof n.type=="number"?n.type:SD.fromString(n.type),this._trie.set(t,n)}}}let WI=VL=class{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new Te,this._persistSoon=new pi(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(n=>{n.reason===cI.SHUTDOWN&&this._saveState()}))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,n){this._withStrategy(e,t).memorize(e,t,n),this._persistSoon.schedule()}select(e,t,n){return this._withStrategy(e,t).select(e,t,n)}_withStrategy(e,t){var n;const r=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if(((n=this._strategy)===null||n===void 0?void 0:n.name)!==r){this._saveState();const o=VL._strategyCtors.get(r)||x1e;this._strategy=new o;try{const a=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,l=this._storageService.get(`${VL._storagePrefix}/${r}`,a);l&&this._strategy.fromJSON(JSON.parse(l))}catch{}}return this._strategy}_saveState(){if(this._strategy){const t=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,n=JSON.stringify(this._strategy);this._storageService.store(`${VL._storagePrefix}/${this._strategy.name}`,n,t,1)}}};WI._strategyCtors=new Map([["recentlyUsedByPrefix",Nst],["recentlyUsed",Tst],["first",x1e]]);WI._storagePrefix="suggest/memories";WI=VL=kst([Cle(0,dd),Cle(1,gn)],WI);const Z3=yn("ISuggestMemories");In(Z3,WI,1);var Rst=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Mst=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},EU;let $I=EU=class{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=EU.AtEnd.bindTo(t),this._configListener=this._editor.onDidChangeConfiguration(n=>n.hasChanged(123)&&this._update()),this._update()}dispose(){var e;this._configListener.dispose(),(e=this._selectionListener)===null||e===void 0||e.dispose(),this._ckAtEnd.reset()}_update(){const e=this._editor.getOption(123)==="on";if(this._enabled!==e)if(this._enabled=e,this._enabled){const t=()=>{if(!this._editor.hasModel()){this._ckAtEnd.set(!1);return}const n=this._editor.getModel(),r=this._editor.getSelection(),o=n.getWordAtPosition(r.getStartPosition());if(!o){this._ckAtEnd.set(!1);return}this._ckAtEnd.set(o.endColumn===r.getStartPosition().column)};this._selectionListener=this._editor.onDidChangeCursorSelection(t),t()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}};$I.AtEnd=new st("atEndOfWord",!1);$I=EU=Rst([Mst(1,Vt)],$I);var Ast=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Pst=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},zL;let Xb=zL=class{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=zL.OtherSuggestions.bindTo(t)}dispose(){this.reset()}reset(){var e;this._ckOtherSuggestions.reset(),(e=this._listener)===null||e===void 0||e.dispose(),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:e,index:t},n){if(e.items.length===0){this.reset();return}if(zL._moveIndex(!0,e,t)===t){this.reset();return}this._acceptNext=n,this._model=e,this._index=t,this._listener=this._editor.onDidChangeCursorPosition(()=>{this._ignore||this.reset()}),this._ckOtherSuggestions.set(!0)}static _moveIndex(e,t,n){let r=n;for(let o=t.items.length;o>0&&(r=(r+t.items.length+(e?1:-1))%t.items.length,!(r===n||!t.items[r].completion.additionalTextEdits));o--);return r}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(this._model)try{this._ignore=!0,this._index=zL._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}};Xb.OtherSuggestions=new st("hasOtherSuggestions",!1);Xb=zL=Ast([Pst(1,Vt)],Xb);class Ost{constructor(e,t,n,r){this._disposables=new Te,this._disposables.add(n.onDidSuggest(o=>{o.completionModel.items.length===0&&this.reset()})),this._disposables.add(n.onDidCancel(o=>{this.reset()})),this._disposables.add(t.onDidShow(()=>this._onItem(t.getFocusedItem()))),this._disposables.add(t.onDidFocus(this._onItem,this)),this._disposables.add(t.onDidHide(this.reset,this)),this._disposables.add(e.onWillType(o=>{if(this._active&&!t.isFrozen()&&n.state!==0){const s=o.charCodeAt(o.length-1);this._active.acceptCharacters.has(s)&&e.getOption(0)&&r(this._active.item)}}))}_onItem(e){if(!e||!Ts(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const t=new JA;for(const n of e.item.completion.commitCharacters)n.length>0&&t.add(n.charCodeAt(0));this._active={acceptCharacters:t,item:e}}reset(){this._active=void 0}dispose(){this._disposables.dispose()}}class Xl{async provideSelectionRanges(e,t){const n=[];for(const r of t){const o=[];n.push(o);const s=new Map;await new Promise(a=>Xl._bracketsRightYield(a,0,e,r,s)),await new Promise(a=>Xl._bracketsLeftYield(a,0,e,r,s,o))}return n}static _bracketsRightYield(e,t,n,r,o){const s=new Map,a=Date.now();for(;;){if(t>=Xl._maxRounds){e();break}if(!r){e();break}const l=n.bracketPairs.findNextBracket(r);if(!l){e();break}if(Date.now()-a>Xl._maxDuration){setTimeout(()=>Xl._bracketsRightYield(e,t+1,n,r,o));break}if(l.bracketInfo.isOpeningBracket){const u=l.bracketInfo.bracketText,d=s.has(u)?s.get(u):0;s.set(u,d+1)}else{const u=l.bracketInfo.getOpeningBrackets()[0].bracketText;let d=s.has(u)?s.get(u):0;if(d-=1,s.set(u,Math.max(0,d)),d<0){let h=o.get(u);h||(h=new _a,o.set(u,h)),h.push(l.range)}}r=l.range.getEndPosition()}}static _bracketsLeftYield(e,t,n,r,o,s){const a=new Map,l=Date.now();for(;;){if(t>=Xl._maxRounds&&o.size===0){e();break}if(!r){e();break}const c=n.bracketPairs.findPrevBracket(r);if(!c){e();break}if(Date.now()-l>Xl._maxDuration){setTimeout(()=>Xl._bracketsLeftYield(e,t+1,n,r,o,s));break}if(c.bracketInfo.isOpeningBracket){const d=c.bracketInfo.bracketText;let h=a.has(d)?a.get(d):0;if(h-=1,a.set(d,Math.max(0,h)),h<0){const f=o.get(d);if(f){const g=f.shift();f.size===0&&o.delete(d);const p=B.fromPositions(c.range.getEndPosition(),g.getStartPosition()),v=B.fromPositions(c.range.getStartPosition(),g.getEndPosition());s.push({range:p}),s.push({range:v}),Xl._addBracketLeading(n,v,s)}}}else{const d=c.bracketInfo.getOpeningBrackets()[0].bracketText,h=a.has(d)?a.get(d):0;a.set(d,h+1)}r=c.range.getStartPosition()}}static _addBracketLeading(e,t,n){if(t.startLineNumber===t.endLineNumber)return;const r=t.startLineNumber,o=e.getLineFirstNonWhitespaceColumn(r);o!==0&&o!==t.startColumn&&(n.push({range:B.fromPositions(new ae(r,o),t.getEndPosition())}),n.push({range:B.fromPositions(new ae(r,1),t.getEndPosition())}));const s=r-1;if(s>0){const a=e.getLineFirstNonWhitespaceColumn(s);a===t.startColumn&&a!==e.getLineLastNonWhitespaceColumn(s)&&(n.push({range:B.fromPositions(new ae(s,a),t.getEndPosition())}),n.push({range:B.fromPositions(new ae(s,1),t.getEndPosition())}))}}}Xl._maxDuration=30;Xl._maxRounds=2;class Hd{static async create(e,t){if(!t.getOption(118).localityBonus||!t.hasModel())return Hd.None;const n=t.getModel(),r=t.getPosition();if(!e.canComputeWordRanges(n.uri))return Hd.None;const[o]=await new Xl().provideSelectionRanges(n,[r]);if(o.length===0)return Hd.None;const s=await e.computeWordRanges(n.uri,o[0].range);if(!s)return Hd.None;const a=n.getWordUntilPosition(r);return delete s[a.word],new class extends Hd{distance(l,c){if(!r.equals(t.getPosition()))return 0;if(c.kind===17)return 2<<20;const u=typeof c.label=="string"?c.label:c.label.label,d=s[u];if(epe(d))return 2<<20;const h=_D(d,B.fromPositions(l),B.compareRangesUsingStarts),f=h>=0?d[h]:d[Math.max(0,~h-1)];let g=o.length;for(const p of o){if(!B.containsRange(p.range,f))break;g-=1}return g}}}}Hd.None=new class extends Hd{distance(){return 0}};let yle=class{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}};class Bm{constructor(e,t,n,r,o,s,a=X4.default,l=void 0){this.clipboardText=l,this._snippetCompareFn=Bm._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=r,this._options=o,this._refilterKind=1,this._lineContext=n,this._fuzzyScoreOptions=a,s==="top"?this._snippetCompareFn=Bm._compareCompletionItemsSnippetsUp:s==="bottom"&&(this._snippetCompareFn=Bm._compareCompletionItemsSnippetsDown)}get lineContext(){return this._lineContext}set lineContext(e){(this._lineContext.leadingLineContent!==e.leadingLineContent||this._lineContext.characterCountDelta!==e.characterCountDelta)&&(this._refilterKind=this._lineContext.characterCountDelta0&&n[0].container.incomplete&&e.add(t);return e}get stats(){return this._ensureCachedState(),this._stats}_ensureCachedState(){this._refilterKind!==0&&this._createCachedState()}_createCachedState(){this._itemsByProvider=new Map;const e=[],{leadingLineContent:t,characterCountDelta:n}=this._lineContext;let r="",o="";const s=this._refilterKind===1?this._items:this._filteredItems,a=[],l=!this._options.filterGraceful||s.length>2e3?Ab:yKe;for(let c=0;c=f)u.score=rh.Default;else if(typeof u.completion.filterText=="string"){const p=l(r,o,g,u.completion.filterText,u.filterTextLow,0,this._fuzzyScoreOptions);if(!p)continue;J$(u.completion.filterText,u.textLabel)===0?u.score=p:(u.score=vKe(r,o,g,u.textLabel,u.labelLow,0),u.score[0]=p[0])}else{const p=l(r,o,g,u.textLabel,u.labelLow,0,this._fuzzyScoreOptions);if(!p)continue;u.score=p}}u.idx=c,u.distance=this._wordDistance.distance(u.position,u.completion),a.push(u),e.push(u.textLabel.length)}this._filteredItems=a.sort(this._snippetCompareFn),this._refilterKind=0,this._stats={pLabelLen:e.length?e$(e.length-.85,e,(c,u)=>c-u):0}}static _compareCompletionItems(e,t){return e.score[0]>t.score[0]?-1:e.score[0]t.distance?1:e.idxt.idx?1:0}static _compareCompletionItemsSnippetsDown(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===27)return 1;if(t.completion.kind===27)return-1}return Bm._compareCompletionItems(e,t)}static _compareCompletionItemsSnippetsUp(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===27)return-1;if(t.completion.kind===27)return 1}return Bm._compareCompletionItems(e,t)}}var Fst=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},am=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},DU;class a0{static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),n=e.getPosition();t.tokenization.tokenizeIfCheap(n.lineNumber);const r=t.getWordAtPosition(n);return!(!r||r.endColumn!==n.column&&r.startColumn+1!==n.column||!isNaN(Number(r.word)))}constructor(e,t,n){this.leadingLineContent=e.getLineContent(t.lineNumber).substr(0,t.column-1),this.leadingWord=e.getWordUntilPosition(t),this.lineNumber=t.lineNumber,this.column=t.column,this.triggerOptions=n}}function Bst(i,e,t){if(!e.getContextKeyValue($o.inlineSuggestionVisible.key))return!0;const n=e.getContextKeyValue($o.suppressSuggestions.key);return n!==void 0?!n:!i.getOption(62).suppressSuggestions}function Wst(i,e,t){if(!e.getContextKeyValue("inlineSuggestionVisible"))return!0;const n=e.getContextKeyValue($o.suppressSuggestions.key);return n!==void 0?!n:!i.getOption(62).suppressSuggestions}let IO=DU=class{constructor(e,t,n,r,o,s,a,l,c){this._editor=e,this._editorWorkerService=t,this._clipboardService=n,this._telemetryService=r,this._logService=o,this._contextKeyService=s,this._configurationService=a,this._languageFeaturesService=l,this._envService=c,this._toDispose=new Te,this._triggerCharacterListener=new Te,this._triggerQuickSuggest=new cd,this._triggerState=void 0,this._completionDisposables=new Te,this._onDidCancel=new se,this._onDidTrigger=new se,this._onDidSuggest=new se,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._telemetryGate=0,this._currentSelection=this._editor.getSelection()||new yt(1,1,1,1),this._toDispose.add(this._editor.onDidChangeModel(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeModelLanguage(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeConfiguration(()=>{this._updateTriggerCharacters()})),this._toDispose.add(this._languageFeaturesService.completionProvider.onDidChange(()=>{this._updateTriggerCharacters(),this._updateActiveSuggestSession()}));let u=!1;this._toDispose.add(this._editor.onDidCompositionStart(()=>{u=!0})),this._toDispose.add(this._editor.onDidCompositionEnd(()=>{u=!1,this._onCompositionEnd()})),this._toDispose.add(this._editor.onDidChangeCursorSelection(d=>{u||this._onCursorChange(d)})),this._toDispose.add(this._editor.onDidChangeModelContent(()=>{!u&&this._triggerState!==void 0&&this._refilterCompletionItems()})),this._updateTriggerCharacters()}dispose(){si(this._triggerCharacterListener),si([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(91)||!this._editor.hasModel()||!this._editor.getOption(121))return;const e=new Map;for(const n of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const r of n.triggerCharacters||[]){let o=e.get(r);o||(o=new Set,o.add(mst()),e.set(r,o)),o.add(n)}const t=n=>{var r;if(!Wst(this._editor,this._contextKeyService,this._configurationService)||a0.shouldAutoTrigger(this._editor))return;if(!n){const a=this._editor.getPosition();n=this._editor.getModel().getLineContent(a.lineNumber).substr(0,a.column-1)}let o="";Db(n.charCodeAt(n.length-1))?xo(n.charCodeAt(n.length-2))&&(o=n.substr(n.length-2)):o=n.charAt(n.length-1);const s=e.get(o);if(s){const a=new Map;if(this._completionModel)for(const[l,c]of this._completionModel.getItemsByProvider())s.has(l)||a.set(l,c);this.trigger({auto:!0,triggerKind:1,triggerCharacter:o,retrigger:!!this._completionModel,clipboardText:(r=this._completionModel)===null||r===void 0?void 0:r.clipboardText,completionOptions:{providerFilter:s,providerItemsToReuse:a}})}};this._triggerCharacterListener.add(this._editor.onDidType(t)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(()=>t()))}get state(){return this._triggerState?this._triggerState.auto?2:1:0}cancel(e=!1){var t;this._triggerState!==void 0&&(this._triggerQuickSuggest.cancel(),(t=this._requestToken)===null||t===void 0||t.cancel(),this._requestToken=void 0,this._triggerState=void 0,this._completionModel=void 0,this._context=void 0,this._onDidCancel.fire({retrigger:e}))}clear(){this._completionDisposables.clear()}_updateActiveSuggestSession(){this._triggerState!==void 0&&(!this._editor.hasModel()||!this._languageFeaturesService.completionProvider.has(this._editor.getModel())?this.cancel():this.trigger({auto:this._triggerState.auto,retrigger:!0}))}_onCursorChange(e){if(!this._editor.hasModel())return;const t=this._currentSelection;if(this._currentSelection=this._editor.getSelection(),!e.selection.isEmpty()||e.reason!==0&&e.reason!==3||e.source!=="keyboard"&&e.source!=="deleteLeft"){this.cancel();return}this._triggerState===void 0&&e.reason===0?(t.containsRange(this._currentSelection)||t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():this._triggerState!==void 0&&e.reason===3&&this._refilterCompletionItems()}_onCompositionEnd(){this._triggerState===void 0?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){var e;Cy.isAllOff(this._editor.getOption(89))||this._editor.getOption(118).snippetsPreventQuickSuggestions&&(!((e=ns.get(this._editor))===null||e===void 0)&&e.isInSnippet())||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._triggerState!==void 0||!a0.shouldAutoTrigger(this._editor)||!this._editor.hasModel()||!this._editor.hasWidgetFocus())return;const t=this._editor.getModel(),n=this._editor.getPosition(),r=this._editor.getOption(89);if(!Cy.isAllOff(r)){if(!Cy.isAllOn(r)){t.tokenization.tokenizeIfCheap(n.lineNumber);const o=t.tokenization.getLineTokens(n.lineNumber),s=o.getStandardTokenType(o.findTokenIndexAtOffset(Math.max(n.column-1-1,0)));if(Cy.valueFor(r,s)!=="on")return}Bst(this._editor,this._contextKeyService,this._configurationService)&&this._languageFeaturesService.completionProvider.has(t)&&this.trigger({auto:!0})}},this._editor.getOption(90)))}_refilterCompletionItems(){Xn(this._editor.hasModel()),Xn(this._triggerState!==void 0);const e=this._editor.getModel(),t=this._editor.getPosition(),n=new a0(e,t,{...this._triggerState,refilter:!0});this._onNewContext(n)}trigger(e){var t,n,r,o,s,a;if(!this._editor.hasModel())return;const l=this._editor.getModel(),c=new a0(l,this._editor.getPosition(),e);this.cancel(e.retrigger),this._triggerState=e,this._onDidTrigger.fire({auto:e.auto,shy:(t=e.shy)!==null&&t!==void 0?t:!1,position:this._editor.getPosition()}),this._context=c;let u={triggerKind:(n=e.triggerKind)!==null&&n!==void 0?n:0};e.triggerCharacter&&(u={triggerKind:1,triggerCharacter:e.triggerCharacter}),this._requestToken=new wr;const d=this._editor.getOption(112);let h=1;switch(d){case"top":h=0;break;case"bottom":h=2;break}const{itemKind:f,showDeprecated:g}=DU.createSuggestFilter(this._editor),p=new BI(h,(o=(r=e.completionOptions)===null||r===void 0?void 0:r.kindFilter)!==null&&o!==void 0?o:f,(s=e.completionOptions)===null||s===void 0?void 0:s.providerFilter,(a=e.completionOptions)===null||a===void 0?void 0:a.providerItemsToReuse,g),v=Hd.create(this._editorWorkerService,this._editor),m=rZ(this._languageFeaturesService.completionProvider,l,this._editor.getPosition(),p,u,this._requestToken.token);Promise.all([m,v]).then(async([_,y])=>{var S;if((S=this._requestToken)===null||S===void 0||S.dispose(),!this._editor.hasModel())return;let L=e==null?void 0:e.clipboardText;if(!L&&_.needsClipboard&&(L=await this._clipboardService.readText()),this._triggerState===void 0)return;const E=this._editor.getModel(),D=new a0(E,this._editor.getPosition(),e),k={...X4.default,firstMatchCanBeWeak:!this._editor.getOption(118).matchOnWordStartOnly};if(this._completionModel=new Bm(_.items,this._context.column,{leadingLineContent:D.leadingLineContent,characterCountDelta:D.column-this._context.column},y,this._editor.getOption(118),this._editor.getOption(112),k,L),this._completionDisposables.add(_.disposable),this._onNewContext(D),this._reportDurationsTelemetry(_.durations),!this._envService.isBuilt||this._envService.isExtensionDevelopment)for(const T of _.items)T.isInvalid&&this._logService.warn(`[suggest] did IGNORE invalid completion item from ${T.provider._debugDisplayName}`,T.completion)}).catch(en)}_reportDurationsTelemetry(e){this._telemetryGate++%230===0&&setTimeout(()=>{this._telemetryService.publicLog2("suggest.durations.json",{data:JSON.stringify(e)}),this._logService.debug("suggest.durations.json",e)})}static createSuggestFilter(e){const t=new Set;e.getOption(112)==="none"&&t.add(27);const r=e.getOption(118);return r.showMethods||t.add(0),r.showFunctions||t.add(1),r.showConstructors||t.add(2),r.showFields||t.add(3),r.showVariables||t.add(4),r.showClasses||t.add(5),r.showStructs||t.add(6),r.showInterfaces||t.add(7),r.showModules||t.add(8),r.showProperties||t.add(9),r.showEvents||t.add(10),r.showOperators||t.add(11),r.showUnits||t.add(12),r.showValues||t.add(13),r.showConstants||t.add(14),r.showEnums||t.add(15),r.showEnumMembers||t.add(16),r.showKeywords||t.add(17),r.showWords||t.add(18),r.showColors||t.add(19),r.showFiles||t.add(20),r.showReferences||t.add(21),r.showColors||t.add(22),r.showFolders||t.add(23),r.showTypeParameters||t.add(24),r.showSnippets||t.add(27),r.showUsers||t.add(25),r.showIssues||t.add(26),{itemKind:t,showDeprecated:r.showDeprecated}}_onNewContext(e){if(this._context){if(e.lineNumber!==this._context.lineNumber){this.cancel();return}if(bi(e.leadingLineContent)!==bi(this._context.leadingLineContent)){this.cancel();return}if(e.columnthis._context.leadingWord.startColumn){if(a0.shouldAutoTrigger(this._editor)&&this._context){const n=this._completionModel.getItemsByProvider();this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerItemsToReuse:n}})}return}if(e.column>this._context.column&&this._completionModel.getIncompleteProvider().size>0&&e.leadingWord.word.length!==0){const t=new Map,n=new Set;for(const[r,o]of this._completionModel.getItemsByProvider())o.length>0&&o[0].container.incomplete?n.add(r):t.set(r,o);this.trigger({auto:this._context.triggerOptions.auto,triggerKind:2,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerFilter:n,providerItemsToReuse:t}})}else{const t=this._completionModel.lineContext;let n=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},this._completionModel.items.length===0){const r=a0.shouldAutoTrigger(this._editor);if(!this._context){this.cancel();return}if(r&&this._context.leadingWord.endColumn0,n&&e.leadingWord.word.length===0){this.cancel();return}}this._onDidSuggest.fire({completionModel:this._completionModel,triggerOptions:e.triggerOptions,isFrozen:n})}}}}};IO=DU=Fst([am(1,hd),am(2,jp),am(3,ea),am(4,Ta),am(5,Vt),am(6,gn),am(7,_t),am(8,EX)],IO);class Q3{constructor(e,t){this._disposables=new Te,this._lastOvertyped=[],this._locked=!1,this._disposables.add(e.onWillType(()=>{if(this._locked||!e.hasModel())return;const n=e.getSelections(),r=n.length;let o=!1;for(let a=0;aQ3._maxSelectionLength)return;this._lastOvertyped[a]={value:s.getValueInRange(l),multiline:l.startLineNumber!==l.endLineNumber}}})),this._disposables.add(t.onDidTrigger(n=>{this._locked=!0})),this._disposables.add(t.onDidCancel(n=>{this._locked=!1}))}getLastOvertypedInfo(e){if(e>=0&&e=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},$9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Hst=class L1e extends t_{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();this.label&&(this.label.textContent=w({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",this._action.label,L1e.symbolPrintEnter(e)))}static symbolPrintEnter(e){var t;return(t=e.getLabel())===null||t===void 0?void 0:t.replace(/\benter\b/gi,"⏎")}},IU=class{constructor(e,t,n,r,o){this._menuId=t,this._menuService=r,this._contextKeyService=o,this._menuDisposables=new Te,this.element=ke(e,He(".suggest-status-bar"));const s=a=>a instanceof pc?n.createInstance(Hst,a,void 0):void 0;this._leftActions=new au(this.element,{actionViewItemProvider:s}),this._rightActions=new au(this.element,{actionViewItemProvider:s}),this._leftActions.domNode.classList.add("left"),this._rightActions.domNode.classList.add("right")}dispose(){this._menuDisposables.dispose(),this._leftActions.dispose(),this._rightActions.dispose(),this.element.remove()}show(){const e=this._menuService.createMenu(this._menuId,this._contextKeyService),t=()=>{const n=[],r=[];for(const[o,s]of e.getActions())o==="left"?n.push(...s):r.push(...s);this._leftActions.clear(),this._leftActions.push(n),this._rightActions.clear(),this._rightActions.push(r)};this._menuDisposables.add(e.onDidChange(()=>t())),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};IU=$st([$9(2,Ot),$9(3,hu),$9(4,Vt)],IU);var Vst=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},zst=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};function aZ(i){return!!i&&!!(i.completion.documentation||i.completion.detail&&i.completion.detail!==i.completion.label)}let kU=class{constructor(e,t){this._editor=e,this._onDidClose=new se,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new se,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new Te,this._renderDisposeable=new Te,this._borderWidth=1,this._size=new Kn(330,0),this.domNode=He(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(Uf,{editor:e}),this._body=He(".body"),this._scrollbar=new Hk(this._body,{alwaysConsumeMouseWheel:!0}),ke(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=ke(this._body,He(".header")),this._close=ke(this._header,He("span"+Wt.asCSSSelector(Xe.close))),this._close.title=w("details.close","Close"),this._type=ke(this._header,He("p.type")),this._docs=ke(this._body,He("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(50)&&this._configureFont()}))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(50),n=t.getMassagedFontFamily(),r=e.get(119)||t.fontSize,o=e.get(120)||t.lineHeight,s=t.fontWeight,a=`${r}px`,l=`${o}px`;this.domNode.style.fontSize=a,this.domNode.style.lineHeight=`${o/r}`,this.domNode.style.fontWeight=s,this.domNode.style.fontFeatureSettings=t.fontFeatureSettings,this._type.style.fontFamily=n,this._close.style.height=l,this._close.style.width=l}getLayoutInfo(){const e=this._editor.getOption(120)||this._editor.getOption(50).lineHeight,t=this._borderWidth,n=t*2;return{lineHeight:e,borderWidth:t,borderHeight:n,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=w("loading","Loading..."),this._docs.textContent="",this.domNode.classList.remove("no-docs","no-type"),this.layout(this.size.width,this.getLayoutInfo().lineHeight*2),this._onDidChangeContents.fire(this)}renderItem(e,t){var n,r;this._renderDisposeable.clear();let{detail:o,documentation:s}=e.completion;if(t){let a="";a+=`score: ${e.score[0]} +`)}withRange(e){return new LO(this.filterText,this.command,e,this.insertText,this.snippetInfo,this.additionalTextEdits,this.sourceInlineCompletion,this.source)}hash(){return JSON.stringify({insertText:this.insertText,range:this.range.toString()})}}function ost(i,e){const t=e.getWordAtPosition(i),n=e.getLineMaxColumn(i.lineNumber);return t?new B(i.lineNumber,t.startColumn,i.lineNumber,n):B.fromPositions(i,i.with(void 0,n))}function rle(i,e,t,n){const o=t.getLineContent(e.lineNumber).substring(0,e.column-1)+i,s=t.tokenization.tokenizeLineWithEdit(e,o.length-(e.column-1),i),a=s==null?void 0:s.sliceAndInflate(e.column-1,o.length,0);return a?est(a,n):i}class d_{constructor(e,t){this.range=e,this.text=t}removeCommonPrefix(e,t){const n=t?this.range.intersectRanges(t):this.range;if(!n)return this;const r=e.getValueInRange(n,1),o=Vv(r,this.text),s=q3(this.range.getStartPosition(),iZ(r.substring(0,o))),a=this.text.substring(o),l=B.fromPositions(s,this.range.getEndPosition());return new d_(l,a)}augments(e){return this.text.startsWith(e.text)&&sst(this.range,e.range)}computeGhostText(e,t,n,r=0){let o=this.removeCommonPrefix(e);if(o.range.endLineNumber!==o.range.startLineNumber)return;const s=e.getLineContent(o.range.startLineNumber),a=bi(s).length;if(o.range.startColumn-1<=a){const g=bi(o.text).length,p=s.substring(o.range.startColumn-1,a),[v,m]=[o.range.getStartPosition(),o.range.getEndPosition()],_=v.column+p.length<=m.column?v.delta(0,p.length):m,y=B.fromPositions(_,m),S=o.text.startsWith(p)?o.text.substring(p.length):o.text.substring(g);o=new d_(y,S)}const c=e.getValueInRange(o.range),u=ast(c,o.text);if(!u)return;const d=o.range.startLineNumber,h=new Array;if(t==="prefix"){const g=u.filter(p=>p.originalLength===0);if(g.length>1||g.length===1&&g[0].originalStart!==c.length)return}const f=o.text.length-r;for(const g of u){const p=o.range.startColumn+g.originalStart+g.originalLength;if(t==="subwordSmart"&&n&&n.lineNumber===o.range.startLineNumber&&p0)return;if(g.modifiedLength===0)continue;const v=g.modifiedStart+g.modifiedLength,m=Math.max(g.modifiedStart,Math.min(v,f)),_=o.text.substring(g.modifiedStart,m),y=o.text.substring(m,Math.max(g.modifiedStart,v));_.length>0&&h.push(new xO(p,_,!1)),y.length>0&&h.push(new xO(p,y,!0))}return new FI(d,h)}}function sst(i,e){return e.getStartPosition().equals(i.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(i.getEndPosition())}let Uh;function ast(i,e){if((Uh==null?void 0:Uh.originalValue)===i&&(Uh==null?void 0:Uh.newValue)===e)return Uh==null?void 0:Uh.changes;{let t=sle(i,e,!0);if(t){const n=ole(t);if(n>0){const r=sle(i,e,!1);r&&ole(r)5e3||e.length>5e3)return;function n(c){let u=0;for(let d=0,h=c.length;du&&(u=f)}return u}const r=Math.max(n(i),n(e));function o(c){if(c<0)throw new Error("unexpected");return r+c+1}function s(c){let u=0,d=0;const h=new Int32Array(c.length);for(let f=0,g=c.length;fa},{getElements:()=>l}).ComputeDiff(!1).changes}var lst=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ale=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let xU=class extends fe{constructor(e,t,n,r,o){super(),this.textModel=e,this.versionId=t,this._debounceValue=n,this.languageFeaturesService=r,this.languageConfigurationService=o,this._updateOperation=this._register(new Ho),this.inlineCompletions=yI("inlineCompletions",void 0),this.suggestWidgetInlineCompletions=yI("suggestWidgetInlineCompletions",void 0),this._register(this.textModel.onDidChangeContent(()=>{this._updateOperation.clear()}))}fetch(e,t,n){var r,o;const s=new ust(e,t,this.textModel.getVersionId()),a=t.selectedSuggestionInfo?this.suggestWidgetInlineCompletions:this.inlineCompletions;if(!((r=this._updateOperation.value)===null||r===void 0)&&r.request.satisfies(s))return this._updateOperation.value.promise;if(!((o=a.get())===null||o===void 0)&&o.request.satisfies(s))return Promise.resolve(!0);const l=!!this._updateOperation.value;this._updateOperation.clear();const c=new wr,u=(async()=>{if((l||t.triggerKind===fp.Automatic)&&await cst(this._debounceValue.get(this.textModel),c.token),c.token.isCancellationRequested||this.textModel.getVersionId()!==s.versionId)return!1;const f=new Date,g=await nst(this.languageFeaturesService.inlineCompletionsProvider,e,this.textModel,t,c.token,this.languageConfigurationService);if(c.token.isCancellationRequested||this.textModel.getVersionId()!==s.versionId)return!1;const p=new Date;this._debounceValue.update(this.textModel,p.getTime()-f.getTime());const v=new fst(g,s,this.textModel,this.versionId);if(n){const m=n.toInlineCompletion(void 0);n.canBeReused(this.textModel,e)&&!g.has(m)&&v.prepend(n.inlineCompletion,m.range,!0)}return this._updateOperation.clear(),Ri(m=>{a.set(v,m)}),!0})(),d=new hst(s,c,u);return this._updateOperation.value=d,u}clear(e){this._updateOperation.clear(),this.inlineCompletions.set(void 0,e),this.suggestWidgetInlineCompletions.set(void 0,e)}clearSuggestWidgetInlineCompletions(e){var t;!((t=this._updateOperation.value)===null||t===void 0)&&t.request.context.selectedSuggestionInfo&&this._updateOperation.clear(),this.suggestWidgetInlineCompletions.set(void 0,e)}cancelUpdate(){this._updateOperation.clear()}};xU=lst([ale(3,_t),ale(4,Di)],xU);function cst(i,e){return new Promise(t=>{let n;const r=setTimeout(()=>{n&&n.dispose(),t()},i);e&&(n=e.onCancellationRequested(()=>{clearTimeout(r),n&&n.dispose(),t()}))})}class ust{constructor(e,t,n){this.position=e,this.context=t,this.versionId=n}satisfies(e){return this.position.equals(e.position)&&dst(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,(t,n)=>t.equals(n))&&(e.context.triggerKind===fp.Automatic||this.context.triggerKind===fp.Explicit)&&this.versionId===e.versionId}}function dst(i,e,t){return!i||!e?i===e:t(i,e)}class hst{constructor(e,t,n){this.request=e,this.cancellationTokenSource=t,this.promise=n}dispose(){this.cancellationTokenSource.cancel()}}class fst{get inlineCompletions(){return this._inlineCompletions}constructor(e,t,n,r){this.inlineCompletionProviderResult=e,this.request=t,this.textModel=n,this.versionId=r,this._refCount=1,this._prependedInlineCompletionItems=[],this._rangeVersionIdValue=0,this._rangeVersionId=Yt(this,s=>{this.versionId.read(s);let a=!1;for(const l of this._inlineCompletions)a=a||l._updateRange(this.textModel);return a&&this._rangeVersionIdValue++,this._rangeVersionIdValue});const o=n.deltaDecorations([],e.completions.map(s=>({range:s.range,options:{description:"inline-completion-tracking-range"}})));this._inlineCompletions=e.completions.map((s,a)=>new lle(s,o[a],this._rangeVersionId))}clone(){return this._refCount++,this}dispose(){if(this._refCount--,this._refCount===0){setTimeout(()=>{this.textModel.isDisposed()||this.textModel.deltaDecorations(this._inlineCompletions.map(e=>e.decorationId),[])},0),this.inlineCompletionProviderResult.dispose();for(const e of this._prependedInlineCompletionItems)e.source.removeRef()}}prepend(e,t,n){n&&e.source.addRef();const r=this.textModel.deltaDecorations([],[{range:t,options:{description:"inline-completion-tracking-range"}}])[0];this._inlineCompletions.unshift(new lle(e,r,this._rangeVersionId,t)),this._prependedInlineCompletionItems.push(e)}}class lle{get forwardStable(){var e;return(e=this.inlineCompletion.source.inlineCompletions.enableForwardStability)!==null&&e!==void 0?e:!1}constructor(e,t,n,r){this.inlineCompletion=e,this.decorationId=t,this.rangeVersion=n,this.semanticId=JSON.stringify([this.inlineCompletion.filterText,this.inlineCompletion.insertText,this.inlineCompletion.range.getStartPosition().toString()]),this._isValid=!0,this._updatedRange=r??e.range}toInlineCompletion(e){return this.inlineCompletion.withRange(this._getUpdatedRange(e))}toSingleTextEdit(e){return new d_(this._getUpdatedRange(e),this.inlineCompletion.insertText)}isVisible(e,t,n){const r=this._toFilterTextReplacement(n).removeCommonPrefix(e);if(!this._isValid||!this.inlineCompletion.range.getStartPosition().equals(this._getUpdatedRange(n).getStartPosition())||t.lineNumber!==r.range.startLineNumber)return!1;const o=e.getValueInRange(r.range,1),s=r.text,a=Math.max(0,t.column-r.range.startColumn);let l=s.substring(0,a),c=s.substring(a),u=o.substring(0,a),d=o.substring(a);const h=e.getLineIndentColumn(r.range.startLineNumber);return r.range.startColumn<=h&&(u=u.trimStart(),u.length===0&&(d=d.trimStart()),l=l.trimStart(),l.length===0&&(c=c.trimStart())),l.startsWith(u)&&!!L_e(d,c)}canBeReused(e,t){return this._isValid&&this._getUpdatedRange(void 0).containsPosition(t)&&this.isVisible(e,t,void 0)&&!this._isSmallerThanOriginal(void 0)}_toFilterTextReplacement(e){return new d_(this._getUpdatedRange(e),this.inlineCompletion.filterText)}_isSmallerThanOriginal(e){return cle(this._getUpdatedRange(e)).isBefore(cle(this.inlineCompletion.range))}_getUpdatedRange(e){return this.rangeVersion.read(e),this._updatedRange}_updateRange(e){const t=e.getDecorationRange(this.decorationId);return t?this._updatedRange.equalsRange(t)?!1:(this._updatedRange=t,!0):(this._isValid=!1,!0)}}function cle(i){return i.startLineNumber===i.endLineNumber?new ae(1,1+i.endColumn-i.startColumn):new ae(1+i.endLineNumber-i.startLineNumber,i.endColumn)}const ln={Visible:YY,HasFocusedSuggestion:new st("suggestWidgetHasFocusedSuggestion",!1,w("suggestWidgetHasSelection","Whether any suggestion is focused")),DetailsVisible:new st("suggestWidgetDetailsVisible",!1,w("suggestWidgetDetailsVisible","Whether suggestion details are visible")),MultipleSuggestions:new st("suggestWidgetMultipleSuggestions",!1,w("suggestWidgetMultipleSuggestions","Whether there are multiple suggestions to pick from")),MakesTextEdit:new st("suggestionMakesTextEdit",!0,w("suggestionMakesTextEdit","Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new st("acceptSuggestionOnEnter",!0,w("acceptSuggestionOnEnter","Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new st("suggestionHasInsertAndReplaceRange",!1,w("suggestionHasInsertAndReplaceRange","Whether the current suggestion has insert and replace behaviour")),InsertMode:new st("suggestionInsertMode",void 0,{type:"string",description:w("suggestionInsertMode","Whether the default behaviour is to insert or replace")}),CanResolve:new st("suggestionCanResolve",!1,w("suggestionCanResolve","Whether the current suggestion supports to resolve further details"))},Nv=new $("suggestWidgetStatusBar");class gst{constructor(e,t,n,r){var o;this.position=e,this.completion=t,this.container=n,this.provider=r,this.isInvalid=!1,this.score=rh.Default,this.distance=0,this.textLabel=typeof t.label=="string"?t.label:(o=t.label)===null||o===void 0?void 0:o.label,this.labelLow=this.textLabel.toLowerCase(),this.isInvalid=!this.textLabel,this.sortTextLow=t.sortText&&t.sortText.toLowerCase(),this.filterTextLow=t.filterText&&t.filterText.toLowerCase(),this.extensionId=t.extensionId,B.isIRange(t.range)?(this.editStart=new ae(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new ae(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new ae(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||B.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new ae(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new ae(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new ae(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||B.spansMultipleLines(t.range.insert)||B.spansMultipleLines(t.range.replace)||t.range.insert.startLineNumber!==e.lineNumber||t.range.replace.startLineNumber!==e.lineNumber||t.range.insert.startColumn!==t.range.replace.startColumn),typeof r.resolveCompletionItem!="function"&&(this._resolveCache=Promise.resolve(),this._resolveDuration=0)}get isResolved(){return this._resolveDuration!==void 0}get resolveDuration(){return this._resolveDuration!==void 0?this._resolveDuration:-1}async resolve(e){if(!this._resolveCache){const t=e.onCancellationRequested(()=>{this._resolveCache=void 0,this._resolveDuration=void 0}),n=new Ms(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(r=>{Object.assign(this.completion,r),this._resolveDuration=n.elapsed()},r=>{wh(r)&&(this._resolveCache=void 0,this._resolveDuration=void 0)}).finally(()=>{t.dispose()})}return this._resolveCache}}class BI{constructor(e=2,t=new Set,n=new Set,r=new Map,o=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=n,this.providerItemsToReuse=r,this.showDeprecated=o}}BI.default=new BI;let pst;function mst(){return pst}class vst{constructor(e,t,n,r){this.items=e,this.needsClipboard=t,this.durations=n,this.disposable=r}}async function rZ(i,e,t,n=BI.default,r={triggerKind:0},o=Cn.None){const s=new Ms;t=t.clone();const a=e.getWordAtPosition(t),l=a?new B(t.lineNumber,a.startColumn,t.lineNumber,a.endColumn):B.fromPositions(t),c={replace:l,insert:l.setEndPosition(t.lineNumber,t.column)},u=[],d=new Te,h=[];let f=!1;const g=(v,m,_)=>{var y,S,L;let E=!1;if(!m)return E;for(const D of m.suggestions)if(!n.kindFilter.has(D.kind)){if(!n.showDeprecated&&(!((y=D==null?void 0:D.tags)===null||y===void 0)&&y.includes(1)))continue;D.range||(D.range=c),D.sortText||(D.sortText=typeof D.label=="string"?D.label:D.label.label),!f&&D.insertTextRules&&D.insertTextRules&4&&(f=Hb.guessNeedsClipboard(D.insertText)),u.push(new gst(t,D,m,v)),E=!0}return aq(m)&&d.add(m),h.push({providerName:(S=v._debugDisplayName)!==null&&S!==void 0?S:"unknown_provider",elapsedProvider:(L=m.duration)!==null&&L!==void 0?L:-1,elapsedOverall:_.elapsed()}),E},p=(async()=>{})();for(const v of i.orderedGroups(e)){let m=!1;if(await Promise.all(v.map(async _=>{if(n.providerItemsToReuse.has(_)){const y=n.providerItemsToReuse.get(_);y.forEach(S=>u.push(S)),m=m||y.length>0;return}if(!(n.providerFilter.size>0&&!n.providerFilter.has(_)))try{const y=new Ms,S=await _.provideCompletionItems(e,t,r,o);m=g(_,S,y)||m}catch(y){Zr(y)}})),m||o.isCancellationRequested)break}return await p,o.isCancellationRequested?(d.dispose(),Promise.reject(new x_)):new vst(u.sort(Cst(n.snippetSortOrder)),f,{entries:h,elapsed:s.elapsed()},d)}function oZ(i,e){if(i.sortTextLow&&e.sortTextLow){if(i.sortTextLowe.sortTextLow)return 1}return i.textLabele.textLabel?1:i.completion.kind-e.completion.kind}function _st(i,e){if(i.completion.kind!==e.completion.kind){if(i.completion.kind===27)return-1;if(e.completion.kind===27)return 1}return oZ(i,e)}function bst(i,e){if(i.completion.kind!==e.completion.kind){if(i.completion.kind===27)return 1;if(e.completion.kind===27)return-1}return oZ(i,e)}const X3=new Map;X3.set(0,_st);X3.set(2,bst);X3.set(1,oZ);function Cst(i){return X3.get(i)}Dn.registerCommand("_executeCompletionItemProvider",async(i,...e)=>{const[t,n,r,o]=e;Xn(At.isUri(t)),Xn(ae.isIPosition(n)),Xn(typeof r=="string"||!r),Xn(typeof o=="number"||!o);const{completionProvider:s}=i.get(_t),a=await i.get(ol).createModelReference(t);try{const l={incomplete:!1,suggestions:[]},c=[],u=a.object.textEditorModel.validatePosition(n),d=await rZ(s,a.object.textEditorModel,u,void 0,{triggerCharacter:r??void 0,triggerKind:r?1:0});for(const h of d.items)c.length<(o??0)&&c.push(h.resolve(Cn.None)),l.incomplete=l.incomplete||h.container.incomplete,l.suggestions.push(h.completion);try{return await Promise.all(c),l}finally{setTimeout(()=>d.disposable.dispose(),100)}}finally{a.dispose()}});function yst(i,e){var t;(t=i.getContribution("editor.contrib.suggestController"))===null||t===void 0||t.triggerSuggest(new Set().add(e),void 0,!0)}class Cy{static isAllOff(e){return e.other==="off"&&e.comments==="off"&&e.strings==="off"}static isAllOn(e){return e.other==="on"&&e.comments==="on"&&e.strings==="on"}static valueFor(e,t){switch(t){case 1:return e.comments;case 2:return e.strings;default:return e.other}}}function ule(i,e=Rs){return vze(i,e)?i.charAt(0).toUpperCase()+i.slice(1):i}var wst=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Sst=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class dle{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){const n=t.resolve(e);if(n!==void 0)return n}}}class hle{constructor(e,t,n,r){this._model=e,this._selection=t,this._selectionIdx=n,this._overtypingCapturer=r}resolve(e){const{name:t}=e;if(t==="SELECTION"||t==="TM_SELECTED_TEXT"){let n=this._model.getValueInRange(this._selection)||void 0,r=this._selection.startLineNumber!==this._selection.endLineNumber;if(!n&&this._overtypingCapturer){const o=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);o&&(n=o.value,r=o.multiline)}if(n&&r&&e.snippet){const o=this._model.getLineContent(this._selection.startLineNumber),s=bi(o,0,this._selection.startColumn-1);let a=s;e.snippet.walk(c=>c===e?!1:(c instanceof pa&&(a=bi(Jf(c.value).pop())),!0));const l=Vv(a,s);n=n.replace(/(\r\n|\r|\n)(.*)/g,(c,u,d)=>`${u}${a.substr(l)}${d}`)}return n}else{if(t==="TM_CURRENT_LINE")return this._model.getLineContent(this._selection.positionLineNumber);if(t==="TM_CURRENT_WORD"){const n=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return n&&n.word||void 0}else{if(t==="TM_LINE_INDEX")return String(this._selection.positionLineNumber-1);if(t==="TM_LINE_NUMBER")return String(this._selection.positionLineNumber);if(t==="CURSOR_INDEX")return String(this._selectionIdx);if(t==="CURSOR_NUMBER")return String(this._selectionIdx+1)}}}}class fle{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return _v(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const n=_v(this._model.uri.fsPath),r=n.lastIndexOf(".");return r<=0?n:n.slice(0,r)}else{if(t==="TM_DIRECTORY")return Lpe(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(z4(this._model.uri));if(t==="TM_FILEPATH")return this._labelService.getUriLabel(this._model.uri);if(t==="RELATIVE_FILEPATH")return this._labelService.getUriLabel(this._model.uri,{relative:!0,noPrefix:!0})}}}class gle{constructor(e,t,n,r){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=n,this._spread=r}resolve(e){if(e.name!=="CLIPBOARD")return;const t=this._readClipboardText();if(t){if(this._spread){const n=t.split(/\r\n|\n|\r/).filter(r=>!Rpe(r));if(n.length===this._selectionCount)return n[this._selectionIdx]}return t}}}let EO=class{constructor(e,t,n){this._model=e,this._selection=t,this._languageConfigurationService=n}resolve(e){const{name:t}=e,n=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),r=this._languageConfigurationService.getLanguageConfiguration(n).comments;if(r){if(t==="LINE_COMMENT")return r.lineCommentToken||void 0;if(t==="BLOCK_COMMENT_START")return r.blockCommentStartToken||void 0;if(t==="BLOCK_COMMENT_END")return r.blockCommentEndToken||void 0}}};EO=wst([Sst(2,Di)],EO);class Xd{constructor(){this._date=new Date}resolve(e){const{name:t}=e;if(t==="CURRENT_YEAR")return String(this._date.getFullYear());if(t==="CURRENT_YEAR_SHORT")return String(this._date.getFullYear()).slice(-2);if(t==="CURRENT_MONTH")return String(this._date.getMonth().valueOf()+1).padStart(2,"0");if(t==="CURRENT_DATE")return String(this._date.getDate().valueOf()).padStart(2,"0");if(t==="CURRENT_HOUR")return String(this._date.getHours().valueOf()).padStart(2,"0");if(t==="CURRENT_MINUTE")return String(this._date.getMinutes().valueOf()).padStart(2,"0");if(t==="CURRENT_SECOND")return String(this._date.getSeconds().valueOf()).padStart(2,"0");if(t==="CURRENT_DAY_NAME")return Xd.dayNames[this._date.getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return Xd.dayNamesShort[this._date.getDay()];if(t==="CURRENT_MONTH_NAME")return Xd.monthNames[this._date.getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return Xd.monthNamesShort[this._date.getMonth()];if(t==="CURRENT_SECONDS_UNIX")return String(Math.floor(this._date.getTime()/1e3));if(t==="CURRENT_TIMEZONE_OFFSET"){const n=this._date.getTimezoneOffset(),r=n>0?"-":"+",o=Math.trunc(Math.abs(n/60)),s=o<10?"0"+o:o,a=Math.abs(n)-o*60,l=a<10?"0"+a:a;return r+s+":"+l}}}Xd.dayNames=[w("Sunday","Sunday"),w("Monday","Monday"),w("Tuesday","Tuesday"),w("Wednesday","Wednesday"),w("Thursday","Thursday"),w("Friday","Friday"),w("Saturday","Saturday")];Xd.dayNamesShort=[w("SundayShort","Sun"),w("MondayShort","Mon"),w("TuesdayShort","Tue"),w("WednesdayShort","Wed"),w("ThursdayShort","Thu"),w("FridayShort","Fri"),w("SaturdayShort","Sat")];Xd.monthNames=[w("January","January"),w("February","February"),w("March","March"),w("April","April"),w("May","May"),w("June","June"),w("July","July"),w("August","August"),w("September","September"),w("October","October"),w("November","November"),w("December","December")];Xd.monthNamesShort=[w("JanuaryShort","Jan"),w("FebruaryShort","Feb"),w("MarchShort","Mar"),w("AprilShort","Apr"),w("MayShort","May"),w("JuneShort","Jun"),w("JulyShort","Jul"),w("AugustShort","Aug"),w("SeptemberShort","Sep"),w("OctoberShort","Oct"),w("NovemberShort","Nov"),w("DecemberShort","Dec")];class ple{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=kGe(this._workspaceService.getWorkspace());if(!EGe(t)){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(t);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(t)}}_resolveWorkspaceName(e){if(CV(e))return _v(e.uri.path);let t=_v(e.configPath.path);return t.endsWith(yV)&&(t=t.substr(0,t.length-yV.length-1)),t}_resoveWorkspacePath(e){if(CV(e))return ule(e.uri.fsPath);const t=_v(e.configPath.path);let n=e.configPath.fsPath;return n.endsWith(t)&&(n=n.substr(0,n.length-t.length-1)),n?ule(n):"/"}}class mle{resolve(e){const{name:t}=e;if(t==="RANDOM")return Math.random().toString().slice(-6);if(t==="RANDOM_HEX")return Math.random().toString(16).slice(-6);if(t==="UUID")return T3()}}var xst=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Lst=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Ld;class Wc{constructor(e,t,n){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=n,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=Tne(t.placeholders,Vc.compareByIndex),this._placeholderGroupsIdx=-1}initialize(e){this._offset=e.newPosition}dispose(){this._placeholderDecorations&&this._editor.removeDecorations([...this._placeholderDecorations.values()]),this._placeholderGroups.length=0}_initDecorations(){if(this._offset===-1)throw new Error("Snippet not initialized!");if(this._placeholderDecorations)return;this._placeholderDecorations=new Map;const e=this._editor.getModel();this._editor.changeDecorations(t=>{for(const n of this._snippet.placeholders){const r=this._snippet.offset(n),o=this._snippet.fullLen(n),s=B.fromPositions(e.getPositionAt(this._offset+r),e.getPositionAt(this._offset+r+o)),a=n.isFinalTabstop?Wc._decor.inactiveFinal:Wc._decor.inactive,l=t.addDecoration(s,a);this._placeholderDecorations.set(n,l)}})}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const r=[];for(const o of this._placeholderGroups[this._placeholderGroupsIdx])if(o.transform){const s=this._placeholderDecorations.get(o),a=this._editor.getModel().getDecorationRange(s),l=this._editor.getModel().getValueInRange(a),c=o.transform.resolve(l).split(/\r\n|\r|\n/);for(let u=1;u0&&this._editor.executeEdits("snippet.placeholderTransform",r)}let t=!1;e===!0&&this._placeholderGroupsIdx0&&(this._placeholderGroupsIdx-=1,t=!0);const n=this._editor.getModel().changeDecorations(r=>{const o=new Set,s=[];for(const a of this._placeholderGroups[this._placeholderGroupsIdx]){const l=this._placeholderDecorations.get(a),c=this._editor.getModel().getDecorationRange(l);s.push(new yt(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),r.changeDecorationOptions(l,a.isFinalTabstop?Wc._decor.activeFinal:Wc._decor.active),o.add(a);for(const u of this._snippet.enclosingPlaceholders(a)){const d=this._placeholderDecorations.get(u);r.changeDecorationOptions(d,u.isFinalTabstop?Wc._decor.activeFinal:Wc._decor.active),o.add(u)}}for(const[a,l]of this._placeholderDecorations)o.has(a)||r.changeDecorationOptions(l,a.isFinalTabstop?Wc._decor.inactiveFinal:Wc._decor.inactive);return s});return t?this.move(e):n??[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof Vc){const n=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(n).isEmpty()&&t.toString().length>0)return!0}t=t.parent}return!1}get isAtFirstPlaceholder(){return this._placeholderGroupsIdx<=0||this._placeholderGroups.length===0}get isAtLastPlaceholder(){return this._placeholderGroupsIdx===this._placeholderGroups.length-1}get hasPlaceholder(){return this._snippet.placeholders.length>0}get isTrivialSnippet(){if(this._snippet.placeholders.length===0)return!0;if(this._snippet.placeholders.length===1){const[e]=this._snippet.placeholders;if(e.isFinalTabstop&&this._snippet.rightMostDescendant===e)return!0}return!1}computePossibleSelections(){const e=new Map;for(const t of this._placeholderGroups){let n;for(const r of t){if(r.isFinalTabstop)break;n||(n=[],e.set(r.index,n));const o=this._placeholderDecorations.get(r),s=this._editor.getModel().getDecorationRange(o);if(!s){e.delete(r.index);break}n.push(s)}}return e}get activeChoice(){if(!this._placeholderDecorations)return;const e=this._placeholderGroups[this._placeholderGroupsIdx][0];if(!(e!=null&&e.choice))return;const t=this._placeholderDecorations.get(e);if(!t)return;const n=this._editor.getModel().getDecorationRange(t);if(n)return{range:n,choice:e.choice}}get hasChoice(){let e=!1;return this._snippet.walk(t=>(e=t instanceof HS,!e)),e}merge(e){const t=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations(n=>{for(const r of this._placeholderGroups[this._placeholderGroupsIdx]){const o=e.shift();console.assert(o._offset!==-1),console.assert(!o._placeholderDecorations);const s=o._snippet.placeholderInfo.last.index;for(const l of o._snippet.placeholderInfo.all)l.isFinalTabstop?l.index=r.index+(s+1)/this._nestingLevel:l.index=r.index+l.index/this._nestingLevel;this._snippet.replace(r,o._snippet.children);const a=this._placeholderDecorations.get(r);n.removeDecoration(a),this._placeholderDecorations.delete(r);for(const l of o._snippet.placeholders){const c=o._snippet.offset(l),u=o._snippet.fullLen(l),d=B.fromPositions(t.getPositionAt(o._offset+c),t.getPositionAt(o._offset+c+u)),h=n.addDecoration(d,Wc._decor.inactive);this._placeholderDecorations.set(l,h)}}this._placeholderGroups=Tne(this._snippet.placeholders,Vc.compareByIndex)})}}Wc._decor={active:sn.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:sn.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:sn.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:sn.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})};const vle={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let DO=Ld=class{static adjustWhitespace(e,t,n,r,o){const s=e.getLineContent(t.lineNumber),a=bi(s,0,t.column-1);let l;return r.walk(c=>{if(!(c instanceof pa)||c.parent instanceof HS||o&&!o.has(c))return!0;const u=c.value.split(/\r\n|\r|\n/);if(n){const h=r.offset(c);if(h===0)u[0]=e.normalizeIndentation(u[0]);else{l=l??r.toString();const f=l.charCodeAt(h-1);(f===10||f===13)&&(u[0]=e.normalizeIndentation(a+u[0]))}for(let f=1;fS.get(Pb)),g=e.invokeWithinContext(S=>new fle(S.get(Vw),h)),p=()=>a,v=h.getValueInRange(Ld.adjustSelection(h,e.getSelection(),n,0)),m=h.getValueInRange(Ld.adjustSelection(h,e.getSelection(),0,r)),_=h.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),y=e.getSelections().map((S,L)=>({selection:S,idx:L})).sort((S,L)=>B.compareRangesUsingStarts(S.selection,L.selection));for(const{selection:S,idx:L}of y){let E=Ld.adjustSelection(h,S,n,0),D=Ld.adjustSelection(h,S,0,r);v!==h.getValueInRange(E)&&(E=S),m!==h.getValueInRange(D)&&(D=S);const k=S.setStartPosition(E.startLineNumber,E.startColumn).setEndPosition(D.endLineNumber,D.endColumn),T=new Hb().parse(t,!0,o),M=k.getStartPosition(),A=Ld.adjustWhitespace(h,M,s||L>0&&_!==h.getLineFirstNonWhitespaceColumn(S.positionLineNumber),T);T.resolveVariables(new dle([g,new gle(p,L,y.length,e.getOption(79)==="spread"),new hle(h,S,L,l),new EO(h,S,c),new Xd,new ple(f),new mle])),u[L]=Xi.replace(k,T.toString()),u[L].identifier={major:L,minor:0},u[L]._isTracked=!0,d[L]=new Wc(e,T,A)}return{edits:u,snippets:d}}static createEditsAndSnippetsFromEdits(e,t,n,r,o,s,a){if(!e.hasModel()||t.length===0)return{edits:[],snippets:[]};const l=[],c=e.getModel(),u=new Hb,d=new lT,h=new dle([e.invokeWithinContext(g=>new fle(g.get(Vw),c)),new gle(()=>o,0,e.getSelections().length,e.getOption(79)==="spread"),new hle(c,e.getSelection(),0,s),new EO(c,e.getSelection(),a),new Xd,new ple(e.invokeWithinContext(g=>g.get(Pb))),new mle]);t=t.sort((g,p)=>B.compareRangesUsingStarts(g.range,p.range));let f=0;for(let g=0;g0){const L=t[g-1].range,E=B.fromPositions(L.getEndPosition(),p.getStartPosition()),D=new pa(c.getValueInRange(E));d.appendChild(D),f+=D.value.length}const m=u.parseFragment(v,d);Ld.adjustWhitespace(c,p.getStartPosition(),!0,d,new Set(m)),d.resolveVariables(h);const _=d.toString(),y=_.slice(f);f=_.length;const S=Xi.replace(p,y);S.identifier={major:g,minor:0},S._isTracked=!0,l.push(S)}return u.ensureFinalTabstop(d,n,!0),{edits:l,snippets:[new Wc(e,d,"")]}}constructor(e,t,n=vle,r){this._editor=e,this._template=t,this._options=n,this._languageConfigurationService=r,this._templateMerges=[],this._snippets=[]}dispose(){si(this._snippets)}_logInfo(){return`template="${this._template}", merged_templates="${this._templateMerges.join(" -> ")}"`}insert(){if(!this._editor.hasModel())return;const{edits:e,snippets:t}=typeof this._template=="string"?Ld.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):Ld.createEditsAndSnippetsFromEdits(this._editor,this._template,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService);this._snippets=t,this._editor.executeEdits("snippet",e,n=>{const r=n.filter(o=>!!o.identifier);for(let o=0;oyt.fromPositions(o.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=vle){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:n,snippets:r}=Ld.createEditsAndSnippetsFromSelections(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",n,o=>{const s=o.filter(l=>!!l.identifier);for(let l=0;lyt.fromPositions(l.range.getEndPosition()))})}next(){const e=this._move(!0);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}prev(){const e=this._move(!1);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}_move(e){const t=[];for(const n of this._snippets){const r=n.move(e);t.push(...r)}return t}get isAtFirstPlaceholder(){return this._snippets[0].isAtFirstPlaceholder}get isAtLastPlaceholder(){return this._snippets[0].isAtLastPlaceholder}get hasPlaceholder(){return this._snippets[0].hasPlaceholder}get hasChoice(){return this._snippets[0].hasChoice}get activeChoice(){return this._snippets[0].activeChoice}isSelectionWithinPlaceholders(){if(!this.hasPlaceholder)return!1;const e=this._editor.getSelections();if(e.length{o.push(...r.get(s))})}e.sort(B.compareRangesUsingStarts);for(const[n,r]of t){if(r.length!==e.length){t.delete(n);continue}r.sort(B.compareRangesUsingStarts);for(let o=0;o0}};DO=Ld=xst([Lst(3,Di)],DO);var Est=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},c2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},R1;const _le={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let ns=R1=class{static get(e){return e.getContribution(R1.ID)}constructor(e,t,n,r,o){this._editor=e,this._logService=t,this._languageFeaturesService=n,this._languageConfigurationService=o,this._snippetListener=new Te,this._modelVersionId=-1,this._inSnippet=R1.InSnippetMode.bindTo(r),this._hasNextTabstop=R1.HasNextTabstop.bindTo(r),this._hasPrevTabstop=R1.HasPrevTabstop.bindTo(r)}dispose(){var e;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),(e=this._session)===null||e===void 0||e.dispose(),this._snippetListener.dispose()}insert(e,t){try{this._doInsert(e,typeof t>"u"?_le:{..._le,...t})}catch(n){this.cancel(),this._logService.error(n),this._logService.error("snippet_error"),this._logService.error("insert_template=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"")}}_doInsert(e,t){var n;if(this._editor.hasModel()){if(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session&&typeof e!="string"&&this.cancel(),this._session?(Xn(typeof e=="string"),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new DO(this._editor,e,t,this._languageConfigurationService),this._session.insert()),t.undoStopAfter&&this._editor.getModel().pushStackElement(),!((n=this._session)===null||n===void 0)&&n.hasChoice){const r={_debugDisplayName:"snippetChoiceCompletions",provideCompletionItems:(u,d)=>{if(!this._session||u!==this._editor.getModel()||!ae.equals(this._editor.getPosition(),d))return;const{activeChoice:h}=this._session;if(!h||h.choice.options.length===0)return;const f=u.getValueInRange(h.range),g=!!h.choice.options.find(v=>v.value===f),p=[];for(let v=0;v{s==null||s.dispose(),a=!1},c=()=>{a||(s=this._languageFeaturesService.completionProvider.register({language:o.getLanguageId(),pattern:o.uri.fsPath,scheme:o.uri.scheme,exclusive:!0},r),this._snippetListener.add(s),a=!0)};this._choiceCompletions={provider:r,enable:c,disable:l}}this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent(r=>r.isFlush&&this.cancel())),this._snippetListener.add(this._editor.onDidChangeModel(()=>this.cancel())),this._snippetListener.add(this._editor.onDidChangeCursorSelection(()=>this._updateState()))}}_updateState(){if(!(!this._session||!this._editor.hasModel())){if(this._modelVersionId===this._editor.getModel().getAlternativeVersionId())return this.cancel();if(!this._session.hasPlaceholder)return this.cancel();if(this._session.isAtLastPlaceholder||!this._session.isSelectionWithinPlaceholders())return this._editor.getModel().pushStackElement(),this.cancel();this._inSnippet.set(!0),this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder),this._hasNextTabstop.set(!this._session.isAtLastPlaceholder),this._handleChoice()}}_handleChoice(){var e;if(!this._session||!this._editor.hasModel()){this._currentChoice=void 0;return}const{activeChoice:t}=this._session;if(!t||!this._choiceCompletions){(e=this._choiceCompletions)===null||e===void 0||e.disable(),this._currentChoice=void 0;return}this._currentChoice!==t.choice&&(this._currentChoice=t.choice,this._choiceCompletions.enable(),queueMicrotask(()=>{yst(this._editor,this._choiceCompletions.provider)}))}finish(){for(;this._inSnippet.get();)this.next()}cancel(e=!1){var t;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),this._currentChoice=void 0,(t=this._session)===null||t===void 0||t.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){var e;(e=this._session)===null||e===void 0||e.prev(),this._updateState()}next(){var e;(e=this._session)===null||e===void 0||e.next(),this._updateState()}isInSnippet(){return!!this._inSnippet.get()}};ns.ID="snippetController2";ns.InSnippetMode=new st("inSnippetMode",!1,w("inSnippetMode","Whether the editor in current in snippet mode"));ns.HasNextTabstop=new st("hasNextTabstop",!1,w("hasNextTabstop","Whether there is a next tab stop when in snippet mode"));ns.HasPrevTabstop=new st("hasPrevTabstop",!1,w("hasPrevTabstop","Whether there is a previous tab stop when in snippet mode"));ns=R1=Est([c2(1,Ta),c2(2,_t),c2(3,Vt),c2(4,Di)],ns);jn(ns.ID,ns,4);const Y3=Vo.bindToContribution(ns.get);et(new Y3({id:"jumpToNextSnippetPlaceholder",precondition:De.and(ns.InSnippetMode,ns.HasNextTabstop),handler:i=>i.next(),kbOpts:{weight:100+30,kbExpr:j.editorTextFocus,primary:2}}));et(new Y3({id:"jumpToPrevSnippetPlaceholder",precondition:De.and(ns.InSnippetMode,ns.HasPrevTabstop),handler:i=>i.prev(),kbOpts:{weight:100+30,kbExpr:j.editorTextFocus,primary:1026}}));et(new Y3({id:"leaveSnippet",precondition:ns.InSnippetMode,handler:i=>i.cancel(!0),kbOpts:{weight:100+30,kbExpr:j.editorTextFocus,primary:9,secondary:[1033]}}));et(new Y3({id:"acceptSnippet",precondition:ns.InSnippetMode,handler:i=>i.finish()}));var Dst=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},B9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},ql;(function(i){i[i.Undo=0]="Undo",i[i.Redo=1]="Redo",i[i.AcceptWord=2]="AcceptWord",i[i.Other=3]="Other"})(ql||(ql={}));let LU=class extends fe{get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,n,r,o,s,a,l,c,u,d,h){super(),this.textModel=e,this.selectedSuggestItem=t,this.textModelVersionId=n,this._positions=r,this._debounceValue=o,this._suggestPreviewEnabled=s,this._suggestPreviewMode=a,this._inlineSuggestMode=l,this._enabled=c,this._instantiationService=u,this._commandService=d,this._languageConfigurationService=h,this._source=this._register(this._instantiationService.createInstance(xU,this.textModel,this.textModelVersionId,this._debounceValue)),this._isActive=Hn(this,!1),this._forceUpdateSignal=pY("forceUpdate"),this._selectedInlineCompletionId=Hn(this,void 0),this._primaryPosition=Yt(this,g=>{var p;return(p=this._positions.read(g)[0])!==null&&p!==void 0?p:new ae(1,1)}),this._isAcceptingPartially=!1,this._preserveCurrentCompletionReasons=new Set([ql.Redo,ql.Undo,ql.AcceptWord]),this._fetchInlineCompletions=FZe({owner:this,createEmptyChangeSummary:()=>({preserveCurrentCompletion:!1,inlineCompletionTriggerKind:fp.Automatic}),handleChange:(g,p)=>(g.didChange(this.textModelVersionId)&&this._preserveCurrentCompletionReasons.has(g.change)?p.preserveCurrentCompletion=!0:g.didChange(this._forceUpdateSignal)&&(p.inlineCompletionTriggerKind=g.change),!0)},(g,p)=>{if(this._forceUpdateSignal.read(g),!(this._enabled.read(g)&&this.selectedSuggestItem.read(g)||this._isActive.read(g))){this._source.cancelUpdate();return}this.textModelVersionId.read(g);const m=this.selectedInlineCompletion.get(),_=p.preserveCurrentCompletion||m!=null&&m.forwardStable?m:void 0,y=this._source.suggestWidgetInlineCompletions.get(),S=this.selectedSuggestItem.read(g);if(y&&!S){const D=this._source.inlineCompletions.get();Ri(k=>{(!D||y.request.versionId>D.request.versionId)&&this._source.inlineCompletions.set(y.clone(),k),this._source.clearSuggestWidgetInlineCompletions(k)})}const L=this._primaryPosition.read(g),E={triggerKind:p.inlineCompletionTriggerKind,selectedSuggestionInfo:S==null?void 0:S.toSelectedSuggestionInfo()};return this._source.fetch(L,E,_)}),this._filteredInlineCompletionItems=Yt(this,g=>{const p=this._source.inlineCompletions.read(g);if(!p)return[];const v=this._primaryPosition.read(g);return p.inlineCompletions.filter(_=>_.isVisible(this.textModel,v,g))}),this.selectedInlineCompletionIndex=Yt(this,g=>{const p=this._selectedInlineCompletionId.read(g),v=this._filteredInlineCompletionItems.read(g),m=this._selectedInlineCompletionId===void 0?-1:v.findIndex(_=>_.semanticId===p);return m===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):m}),this.selectedInlineCompletion=Yt(this,g=>{const p=this._filteredInlineCompletionItems.read(g),v=this.selectedInlineCompletionIndex.read(g);return p[v]}),this.lastTriggerKind=this._source.inlineCompletions.map(this,g=>g==null?void 0:g.request.context.triggerKind),this.inlineCompletionsCount=Yt(this,g=>{if(this.lastTriggerKind.read(g)===fp.Explicit)return this._filteredInlineCompletionItems.read(g).length}),this.state=Qy({owner:this,equalityComparer:(g,p)=>!g||!p?g===p:tle(g.ghostTexts,p.ghostTexts)&&g.inlineCompletion===p.inlineCompletion&&g.suggestItem===p.suggestItem},g=>{var p,v;const m=this.textModel,_=this.selectedSuggestItem.read(g);if(_){const y=_.toSingleTextEdit().removeCommonPrefix(m),S=this._computeAugmentation(y,g);if(!this._suggestPreviewEnabled.read(g)&&!S)return;const E=(p=S==null?void 0:S.edit)!==null&&p!==void 0?p:y,D=S?S.edit.text.length-y.text.length:0,k=this._suggestPreviewMode.read(g),T=this._positions.read(g),M=[E,...W9(this.textModel,T,E)],A=M.map((R,F)=>R.computeGhostText(m,k,T[F],D)).filter(kf),N=(v=A[0])!==null&&v!==void 0?v:new FI(E.range.endLineNumber,[]);return{edits:M,primaryGhostText:N,ghostTexts:A,inlineCompletion:S==null?void 0:S.completion,suggestItem:_}}else{if(!this._isActive.read(g))return;const y=this.selectedInlineCompletion.read(g);if(!y)return;const S=y.toSingleTextEdit(g),L=this._inlineSuggestMode.read(g),E=this._positions.read(g),D=[S,...W9(this.textModel,E,S)],k=D.map((T,M)=>T.computeGhostText(m,L,E[M],0)).filter(kf);return k[0]?{edits:D,primaryGhostText:k[0],ghostTexts:k,inlineCompletion:y,suggestItem:void 0}:void 0}}),this.ghostTexts=Qy({owner:this,equalityComparer:tle},g=>{const p=this.state.read(g);if(p)return p.ghostTexts}),this.primaryGhostText=Qy({owner:this,equalityComparer:w1e},g=>{const p=this.state.read(g);if(p)return p==null?void 0:p.primaryGhostText}),this._register(oT(this._fetchInlineCompletions));let f;this._register(bn(g=>{var p,v;const m=this.state.read(g),_=m==null?void 0:m.inlineCompletion;if((_==null?void 0:_.semanticId)!==(f==null?void 0:f.semanticId)&&(f=_,_)){const y=_.inlineCompletion,S=y.source;(v=(p=S.provider).handleItemDidShow)===null||v===void 0||v.call(p,S.inlineCompletions,y.sourceInlineCompletion,y.insertText)}}))}async trigger(e){this._isActive.set(!0,e),await this._fetchInlineCompletions.get()}async triggerExplicitly(e){CI(e,t=>{this._isActive.set(!0,t),this._forceUpdateSignal.trigger(t,fp.Explicit)}),await this._fetchInlineCompletions.get()}stop(e){CI(e,t=>{this._isActive.set(!1,t),this._source.clear(t)})}_computeAugmentation(e,t){const n=this.textModel,r=this._source.suggestWidgetInlineCompletions.read(t),o=r?r.inlineCompletions:[this.selectedInlineCompletion.read(t)].filter(kf);return u9e(o,a=>{let l=a.toSingleTextEdit(t);return l=l.removeCommonPrefix(n,B.fromPositions(l.range.getStartPosition(),e.range.getEndPosition())),l.augments(e)?{completion:a,edit:l}:void 0})}async _deltaSelectedInlineCompletionIndex(e){await this.triggerExplicitly();const t=this._filteredInlineCompletionItems.get()||[];if(t.length>0){const n=(this.selectedInlineCompletionIndex.get()+e+t.length)%t.length;this._selectedInlineCompletionId.set(t[n].semanticId,void 0)}else this._selectedInlineCompletionId.set(void 0,void 0)}async next(){await this._deltaSelectedInlineCompletionIndex(1)}async previous(){await this._deltaSelectedInlineCompletionIndex(-1)}async accept(e){var t;if(e.getModel()!==this.textModel)throw new qi;const n=this.state.get();if(!n||n.primaryGhostText.isEmpty()||!n.inlineCompletion)return;const r=n.inlineCompletion.toInlineCompletion(void 0);if(e.pushUndoStop(),r.snippetInfo)e.executeEdits("inlineSuggestion.accept",[Xi.replaceMove(r.range,""),...r.additionalTextEdits]),e.setPosition(r.snippetInfo.range.getStartPosition(),"inlineCompletionAccept"),(t=ns.get(e))===null||t===void 0||t.insert(r.snippetInfo.snippet,{undoStopBefore:!1});else{const o=n.edits,s=ble(o).map(a=>yt.fromPositions(a));e.executeEdits("inlineSuggestion.accept",[...o.map(a=>Xi.replaceMove(a.range,a.text)),...r.additionalTextEdits]),e.setSelections(s,"inlineCompletionAccept")}r.command&&r.source.addRef(),Ri(o=>{this._source.clear(o),this._isActive.set(!1,o)}),r.command&&(await this._commandService.executeCommand(r.command.id,...r.command.arguments||[]).then(void 0,Zr),r.source.removeRef())}async acceptNextWord(e){await this._acceptNext(e,(t,n)=>{const r=this.textModel.getLanguageIdAtPosition(t.lineNumber,t.column),o=this._languageConfigurationService.getLanguageConfiguration(r),s=new RegExp(o.wordDefinition.source,o.wordDefinition.flags.replace("g","")),a=n.match(s);let l=0;a&&a.index!==void 0?a.index===0?l=a[0].length:l=a.index:l=n.length;const u=/\s+/g.exec(n);return u&&u.index!==void 0&&u.index+u[0].length{const r=n.match(/\n/);return r&&r.index!==void 0?r.index+1:n.length})}async _acceptNext(e,t){if(e.getModel()!==this.textModel)throw new qi;const n=this.state.get();if(!n||n.primaryGhostText.isEmpty()||!n.inlineCompletion)return;const r=n.primaryGhostText,o=n.inlineCompletion.toInlineCompletion(void 0);if(o.snippetInfo||o.filterText!==o.insertText){await this.accept(e);return}const s=r.parts[0],a=new ae(r.lineNumber,s.column),l=s.text,c=t(a,l);if(c===l.length&&r.parts.length===1){this.accept(e);return}const u=l.substring(0,c),d=this._positions.get(),h=d[0];o.source.addRef();try{this._isAcceptingPartially=!0;try{e.pushUndoStop();const f=B.fromPositions(h,a),g=e.getModel().getValueInRange(f)+u,p=new d_(f,g),v=[p,...W9(this.textModel,d,p)],m=ble(v).map(_=>yt.fromPositions(_));e.executeEdits("inlineSuggestion.accept",v.map(_=>Xi.replaceMove(_.range,_.text))),e.setSelections(m,"inlineCompletionPartialAccept")}finally{this._isAcceptingPartially=!1}if(o.source.provider.handlePartialAccept){const f=B.fromPositions(o.range.getStartPosition(),q3(a,iZ(u))),g=e.getModel().getValueInRange(f,1);o.source.provider.handlePartialAccept(o.source.inlineCompletions,o.sourceInlineCompletion,g.length)}}finally{o.source.removeRef()}}handleSuggestAccepted(e){var t,n;const r=e.toSingleTextEdit().removeCommonPrefix(this.textModel),o=this._computeAugmentation(r,void 0);if(!o)return;const s=o.completion.inlineCompletion;(n=(t=s.source.provider).handlePartialAccept)===null||n===void 0||n.call(t,s.source.inlineCompletions,s.sourceInlineCompletion,r.text.length)}};LU=Dst([B9(9,Ot),B9(10,sr),B9(11,Di)],LU);function W9(i,e,t){if(e.length===1)return[];const n=e[0],r=e.slice(1),o=t.range.getStartPosition(),s=t.range.getEndPosition(),a=i.getValueInRange(B.fromPositions(n,s)),l=ele(n,o);if(l.lineNumber<1)return en(new qi(`positionWithinTextEdit line number should be bigger than 0. + Invalid subtraction between ${n.toString()} and ${o.toString()}`)),[];const c=Ist(t.text,l);return r.map(u=>{const d=q3(ele(u,o),s),h=i.getValueInRange(B.fromPositions(u,d)),f=Vv(a,h),g=B.fromPositions(u,u.delta(0,f));return new d_(g,c)})}function Ist(i,e){let t="";const n=H5e(i);for(let r=e.lineNumber-1;rB.compareRangesUsingStarts(r.range,o.range)),t=Yot(e.apply(i));return e.inverse().apply(t).map(r=>r.getEndPosition())}var kst=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Cle=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},VL;class sZ{constructor(e){this.name=e}select(e,t,n){if(n.length===0)return 0;const r=n[0].score[0];for(let o=0;ol&&d.type===n[c].completion.kind&&d.insertText===n[c].completion.insertText&&(l=d.touch,a=c),n[c].completion.preselect&&s===-1)return s=c}return a!==-1?a:s!==-1?s:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();const t=0;for(const[n,r]of e)r.touch=t,r.type=typeof r.type=="number"?r.type:SD.fromString(r.type),this._cache.set(n,r);this._seq=this._cache.size}}class Nst extends sZ{constructor(){super("recentlyUsedByPrefix"),this._trie=qy.forStrings(),this._seq=0}memorize(e,t,n){const{word:r}=e.getWordUntilPosition(t),o=`${e.getLanguageId()}/${r}`;this._trie.set(o,{type:n.completion.kind,insertText:n.completion.insertText,touch:this._seq++})}select(e,t,n){const{word:r}=e.getWordUntilPosition(t);if(!r)return super.select(e,t,n);const o=`${e.getLanguageId()}/${r}`;let s=this._trie.get(o);if(s||(s=this._trie.findSubstr(o)),s)for(let a=0;ae.push([n,t])),e.sort((t,n)=>-(t[1].touch-n[1].touch)).forEach((t,n)=>t[1].touch=n),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,n]of e)n.type=typeof n.type=="number"?n.type:SD.fromString(n.type),this._trie.set(t,n)}}}let WI=VL=class{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new Te,this._persistSoon=new pi(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(n=>{n.reason===cI.SHUTDOWN&&this._saveState()}))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,n){this._withStrategy(e,t).memorize(e,t,n),this._persistSoon.schedule()}select(e,t,n){return this._withStrategy(e,t).select(e,t,n)}_withStrategy(e,t){var n;const r=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if(((n=this._strategy)===null||n===void 0?void 0:n.name)!==r){this._saveState();const o=VL._strategyCtors.get(r)||x1e;this._strategy=new o;try{const a=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,l=this._storageService.get(`${VL._storagePrefix}/${r}`,a);l&&this._strategy.fromJSON(JSON.parse(l))}catch{}}return this._strategy}_saveState(){if(this._strategy){const t=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,n=JSON.stringify(this._strategy);this._storageService.store(`${VL._storagePrefix}/${this._strategy.name}`,n,t,1)}}};WI._strategyCtors=new Map([["recentlyUsedByPrefix",Nst],["recentlyUsed",Tst],["first",x1e]]);WI._storagePrefix="suggest/memories";WI=VL=kst([Cle(0,dd),Cle(1,gn)],WI);const Z3=yn("ISuggestMemories");In(Z3,WI,1);var Rst=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Mst=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},EU;let $I=EU=class{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=EU.AtEnd.bindTo(t),this._configListener=this._editor.onDidChangeConfiguration(n=>n.hasChanged(123)&&this._update()),this._update()}dispose(){var e;this._configListener.dispose(),(e=this._selectionListener)===null||e===void 0||e.dispose(),this._ckAtEnd.reset()}_update(){const e=this._editor.getOption(123)==="on";if(this._enabled!==e)if(this._enabled=e,this._enabled){const t=()=>{if(!this._editor.hasModel()){this._ckAtEnd.set(!1);return}const n=this._editor.getModel(),r=this._editor.getSelection(),o=n.getWordAtPosition(r.getStartPosition());if(!o){this._ckAtEnd.set(!1);return}this._ckAtEnd.set(o.endColumn===r.getStartPosition().column)};this._selectionListener=this._editor.onDidChangeCursorSelection(t),t()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}};$I.AtEnd=new st("atEndOfWord",!1);$I=EU=Rst([Mst(1,Vt)],$I);var Ast=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Pst=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},zL;let Xb=zL=class{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=zL.OtherSuggestions.bindTo(t)}dispose(){this.reset()}reset(){var e;this._ckOtherSuggestions.reset(),(e=this._listener)===null||e===void 0||e.dispose(),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:e,index:t},n){if(e.items.length===0){this.reset();return}if(zL._moveIndex(!0,e,t)===t){this.reset();return}this._acceptNext=n,this._model=e,this._index=t,this._listener=this._editor.onDidChangeCursorPosition(()=>{this._ignore||this.reset()}),this._ckOtherSuggestions.set(!0)}static _moveIndex(e,t,n){let r=n;for(let o=t.items.length;o>0&&(r=(r+t.items.length+(e?1:-1))%t.items.length,!(r===n||!t.items[r].completion.additionalTextEdits));o--);return r}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(this._model)try{this._ignore=!0,this._index=zL._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}};Xb.OtherSuggestions=new st("hasOtherSuggestions",!1);Xb=zL=Ast([Pst(1,Vt)],Xb);class Ost{constructor(e,t,n,r){this._disposables=new Te,this._disposables.add(n.onDidSuggest(o=>{o.completionModel.items.length===0&&this.reset()})),this._disposables.add(n.onDidCancel(o=>{this.reset()})),this._disposables.add(t.onDidShow(()=>this._onItem(t.getFocusedItem()))),this._disposables.add(t.onDidFocus(this._onItem,this)),this._disposables.add(t.onDidHide(this.reset,this)),this._disposables.add(e.onWillType(o=>{if(this._active&&!t.isFrozen()&&n.state!==0){const s=o.charCodeAt(o.length-1);this._active.acceptCharacters.has(s)&&e.getOption(0)&&r(this._active.item)}}))}_onItem(e){if(!e||!Ts(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const t=new JA;for(const n of e.item.completion.commitCharacters)n.length>0&&t.add(n.charCodeAt(0));this._active={acceptCharacters:t,item:e}}reset(){this._active=void 0}dispose(){this._disposables.dispose()}}class Xl{async provideSelectionRanges(e,t){const n=[];for(const r of t){const o=[];n.push(o);const s=new Map;await new Promise(a=>Xl._bracketsRightYield(a,0,e,r,s)),await new Promise(a=>Xl._bracketsLeftYield(a,0,e,r,s,o))}return n}static _bracketsRightYield(e,t,n,r,o){const s=new Map,a=Date.now();for(;;){if(t>=Xl._maxRounds){e();break}if(!r){e();break}const l=n.bracketPairs.findNextBracket(r);if(!l){e();break}if(Date.now()-a>Xl._maxDuration){setTimeout(()=>Xl._bracketsRightYield(e,t+1,n,r,o));break}if(l.bracketInfo.isOpeningBracket){const u=l.bracketInfo.bracketText,d=s.has(u)?s.get(u):0;s.set(u,d+1)}else{const u=l.bracketInfo.getOpeningBrackets()[0].bracketText;let d=s.has(u)?s.get(u):0;if(d-=1,s.set(u,Math.max(0,d)),d<0){let h=o.get(u);h||(h=new _a,o.set(u,h)),h.push(l.range)}}r=l.range.getEndPosition()}}static _bracketsLeftYield(e,t,n,r,o,s){const a=new Map,l=Date.now();for(;;){if(t>=Xl._maxRounds&&o.size===0){e();break}if(!r){e();break}const c=n.bracketPairs.findPrevBracket(r);if(!c){e();break}if(Date.now()-l>Xl._maxDuration){setTimeout(()=>Xl._bracketsLeftYield(e,t+1,n,r,o,s));break}if(c.bracketInfo.isOpeningBracket){const d=c.bracketInfo.bracketText;let h=a.has(d)?a.get(d):0;if(h-=1,a.set(d,Math.max(0,h)),h<0){const f=o.get(d);if(f){const g=f.shift();f.size===0&&o.delete(d);const p=B.fromPositions(c.range.getEndPosition(),g.getStartPosition()),v=B.fromPositions(c.range.getStartPosition(),g.getEndPosition());s.push({range:p}),s.push({range:v}),Xl._addBracketLeading(n,v,s)}}}else{const d=c.bracketInfo.getOpeningBrackets()[0].bracketText,h=a.has(d)?a.get(d):0;a.set(d,h+1)}r=c.range.getStartPosition()}}static _addBracketLeading(e,t,n){if(t.startLineNumber===t.endLineNumber)return;const r=t.startLineNumber,o=e.getLineFirstNonWhitespaceColumn(r);o!==0&&o!==t.startColumn&&(n.push({range:B.fromPositions(new ae(r,o),t.getEndPosition())}),n.push({range:B.fromPositions(new ae(r,1),t.getEndPosition())}));const s=r-1;if(s>0){const a=e.getLineFirstNonWhitespaceColumn(s);a===t.startColumn&&a!==e.getLineLastNonWhitespaceColumn(s)&&(n.push({range:B.fromPositions(new ae(s,a),t.getEndPosition())}),n.push({range:B.fromPositions(new ae(s,1),t.getEndPosition())}))}}}Xl._maxDuration=30;Xl._maxRounds=2;class Hd{static async create(e,t){if(!t.getOption(118).localityBonus||!t.hasModel())return Hd.None;const n=t.getModel(),r=t.getPosition();if(!e.canComputeWordRanges(n.uri))return Hd.None;const[o]=await new Xl().provideSelectionRanges(n,[r]);if(o.length===0)return Hd.None;const s=await e.computeWordRanges(n.uri,o[0].range);if(!s)return Hd.None;const a=n.getWordUntilPosition(r);return delete s[a.word],new class extends Hd{distance(l,c){if(!r.equals(t.getPosition()))return 0;if(c.kind===17)return 2<<20;const u=typeof c.label=="string"?c.label:c.label.label,d=s[u];if(epe(d))return 2<<20;const h=_D(d,B.fromPositions(l),B.compareRangesUsingStarts),f=h>=0?d[h]:d[Math.max(0,~h-1)];let g=o.length;for(const p of o){if(!B.containsRange(p.range,f))break;g-=1}return g}}}}Hd.None=new class extends Hd{distance(){return 0}};let yle=class{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}};class Wm{constructor(e,t,n,r,o,s,a=X4.default,l=void 0){this.clipboardText=l,this._snippetCompareFn=Wm._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=r,this._options=o,this._refilterKind=1,this._lineContext=n,this._fuzzyScoreOptions=a,s==="top"?this._snippetCompareFn=Wm._compareCompletionItemsSnippetsUp:s==="bottom"&&(this._snippetCompareFn=Wm._compareCompletionItemsSnippetsDown)}get lineContext(){return this._lineContext}set lineContext(e){(this._lineContext.leadingLineContent!==e.leadingLineContent||this._lineContext.characterCountDelta!==e.characterCountDelta)&&(this._refilterKind=this._lineContext.characterCountDelta0&&n[0].container.incomplete&&e.add(t);return e}get stats(){return this._ensureCachedState(),this._stats}_ensureCachedState(){this._refilterKind!==0&&this._createCachedState()}_createCachedState(){this._itemsByProvider=new Map;const e=[],{leadingLineContent:t,characterCountDelta:n}=this._lineContext;let r="",o="";const s=this._refilterKind===1?this._items:this._filteredItems,a=[],l=!this._options.filterGraceful||s.length>2e3?Ab:yKe;for(let c=0;c=f)u.score=rh.Default;else if(typeof u.completion.filterText=="string"){const p=l(r,o,g,u.completion.filterText,u.filterTextLow,0,this._fuzzyScoreOptions);if(!p)continue;J$(u.completion.filterText,u.textLabel)===0?u.score=p:(u.score=vKe(r,o,g,u.textLabel,u.labelLow,0),u.score[0]=p[0])}else{const p=l(r,o,g,u.textLabel,u.labelLow,0,this._fuzzyScoreOptions);if(!p)continue;u.score=p}}u.idx=c,u.distance=this._wordDistance.distance(u.position,u.completion),a.push(u),e.push(u.textLabel.length)}this._filteredItems=a.sort(this._snippetCompareFn),this._refilterKind=0,this._stats={pLabelLen:e.length?e$(e.length-.85,e,(c,u)=>c-u):0}}static _compareCompletionItems(e,t){return e.score[0]>t.score[0]?-1:e.score[0]t.distance?1:e.idxt.idx?1:0}static _compareCompletionItemsSnippetsDown(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===27)return 1;if(t.completion.kind===27)return-1}return Wm._compareCompletionItems(e,t)}static _compareCompletionItemsSnippetsUp(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===27)return-1;if(t.completion.kind===27)return 1}return Wm._compareCompletionItems(e,t)}}var Fst=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},lm=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},DU;class s0{static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),n=e.getPosition();t.tokenization.tokenizeIfCheap(n.lineNumber);const r=t.getWordAtPosition(n);return!(!r||r.endColumn!==n.column&&r.startColumn+1!==n.column||!isNaN(Number(r.word)))}constructor(e,t,n){this.leadingLineContent=e.getLineContent(t.lineNumber).substr(0,t.column-1),this.leadingWord=e.getWordUntilPosition(t),this.lineNumber=t.lineNumber,this.column=t.column,this.triggerOptions=n}}function Bst(i,e,t){if(!e.getContextKeyValue($o.inlineSuggestionVisible.key))return!0;const n=e.getContextKeyValue($o.suppressSuggestions.key);return n!==void 0?!n:!i.getOption(62).suppressSuggestions}function Wst(i,e,t){if(!e.getContextKeyValue("inlineSuggestionVisible"))return!0;const n=e.getContextKeyValue($o.suppressSuggestions.key);return n!==void 0?!n:!i.getOption(62).suppressSuggestions}let IO=DU=class{constructor(e,t,n,r,o,s,a,l,c){this._editor=e,this._editorWorkerService=t,this._clipboardService=n,this._telemetryService=r,this._logService=o,this._contextKeyService=s,this._configurationService=a,this._languageFeaturesService=l,this._envService=c,this._toDispose=new Te,this._triggerCharacterListener=new Te,this._triggerQuickSuggest=new cd,this._triggerState=void 0,this._completionDisposables=new Te,this._onDidCancel=new se,this._onDidTrigger=new se,this._onDidSuggest=new se,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._telemetryGate=0,this._currentSelection=this._editor.getSelection()||new yt(1,1,1,1),this._toDispose.add(this._editor.onDidChangeModel(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeModelLanguage(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeConfiguration(()=>{this._updateTriggerCharacters()})),this._toDispose.add(this._languageFeaturesService.completionProvider.onDidChange(()=>{this._updateTriggerCharacters(),this._updateActiveSuggestSession()}));let u=!1;this._toDispose.add(this._editor.onDidCompositionStart(()=>{u=!0})),this._toDispose.add(this._editor.onDidCompositionEnd(()=>{u=!1,this._onCompositionEnd()})),this._toDispose.add(this._editor.onDidChangeCursorSelection(d=>{u||this._onCursorChange(d)})),this._toDispose.add(this._editor.onDidChangeModelContent(()=>{!u&&this._triggerState!==void 0&&this._refilterCompletionItems()})),this._updateTriggerCharacters()}dispose(){si(this._triggerCharacterListener),si([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(91)||!this._editor.hasModel()||!this._editor.getOption(121))return;const e=new Map;for(const n of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const r of n.triggerCharacters||[]){let o=e.get(r);o||(o=new Set,o.add(mst()),e.set(r,o)),o.add(n)}const t=n=>{var r;if(!Wst(this._editor,this._contextKeyService,this._configurationService)||s0.shouldAutoTrigger(this._editor))return;if(!n){const a=this._editor.getPosition();n=this._editor.getModel().getLineContent(a.lineNumber).substr(0,a.column-1)}let o="";Db(n.charCodeAt(n.length-1))?xo(n.charCodeAt(n.length-2))&&(o=n.substr(n.length-2)):o=n.charAt(n.length-1);const s=e.get(o);if(s){const a=new Map;if(this._completionModel)for(const[l,c]of this._completionModel.getItemsByProvider())s.has(l)||a.set(l,c);this.trigger({auto:!0,triggerKind:1,triggerCharacter:o,retrigger:!!this._completionModel,clipboardText:(r=this._completionModel)===null||r===void 0?void 0:r.clipboardText,completionOptions:{providerFilter:s,providerItemsToReuse:a}})}};this._triggerCharacterListener.add(this._editor.onDidType(t)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(()=>t()))}get state(){return this._triggerState?this._triggerState.auto?2:1:0}cancel(e=!1){var t;this._triggerState!==void 0&&(this._triggerQuickSuggest.cancel(),(t=this._requestToken)===null||t===void 0||t.cancel(),this._requestToken=void 0,this._triggerState=void 0,this._completionModel=void 0,this._context=void 0,this._onDidCancel.fire({retrigger:e}))}clear(){this._completionDisposables.clear()}_updateActiveSuggestSession(){this._triggerState!==void 0&&(!this._editor.hasModel()||!this._languageFeaturesService.completionProvider.has(this._editor.getModel())?this.cancel():this.trigger({auto:this._triggerState.auto,retrigger:!0}))}_onCursorChange(e){if(!this._editor.hasModel())return;const t=this._currentSelection;if(this._currentSelection=this._editor.getSelection(),!e.selection.isEmpty()||e.reason!==0&&e.reason!==3||e.source!=="keyboard"&&e.source!=="deleteLeft"){this.cancel();return}this._triggerState===void 0&&e.reason===0?(t.containsRange(this._currentSelection)||t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():this._triggerState!==void 0&&e.reason===3&&this._refilterCompletionItems()}_onCompositionEnd(){this._triggerState===void 0?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){var e;Cy.isAllOff(this._editor.getOption(89))||this._editor.getOption(118).snippetsPreventQuickSuggestions&&(!((e=ns.get(this._editor))===null||e===void 0)&&e.isInSnippet())||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._triggerState!==void 0||!s0.shouldAutoTrigger(this._editor)||!this._editor.hasModel()||!this._editor.hasWidgetFocus())return;const t=this._editor.getModel(),n=this._editor.getPosition(),r=this._editor.getOption(89);if(!Cy.isAllOff(r)){if(!Cy.isAllOn(r)){t.tokenization.tokenizeIfCheap(n.lineNumber);const o=t.tokenization.getLineTokens(n.lineNumber),s=o.getStandardTokenType(o.findTokenIndexAtOffset(Math.max(n.column-1-1,0)));if(Cy.valueFor(r,s)!=="on")return}Bst(this._editor,this._contextKeyService,this._configurationService)&&this._languageFeaturesService.completionProvider.has(t)&&this.trigger({auto:!0})}},this._editor.getOption(90)))}_refilterCompletionItems(){Xn(this._editor.hasModel()),Xn(this._triggerState!==void 0);const e=this._editor.getModel(),t=this._editor.getPosition(),n=new s0(e,t,{...this._triggerState,refilter:!0});this._onNewContext(n)}trigger(e){var t,n,r,o,s,a;if(!this._editor.hasModel())return;const l=this._editor.getModel(),c=new s0(l,this._editor.getPosition(),e);this.cancel(e.retrigger),this._triggerState=e,this._onDidTrigger.fire({auto:e.auto,shy:(t=e.shy)!==null&&t!==void 0?t:!1,position:this._editor.getPosition()}),this._context=c;let u={triggerKind:(n=e.triggerKind)!==null&&n!==void 0?n:0};e.triggerCharacter&&(u={triggerKind:1,triggerCharacter:e.triggerCharacter}),this._requestToken=new wr;const d=this._editor.getOption(112);let h=1;switch(d){case"top":h=0;break;case"bottom":h=2;break}const{itemKind:f,showDeprecated:g}=DU.createSuggestFilter(this._editor),p=new BI(h,(o=(r=e.completionOptions)===null||r===void 0?void 0:r.kindFilter)!==null&&o!==void 0?o:f,(s=e.completionOptions)===null||s===void 0?void 0:s.providerFilter,(a=e.completionOptions)===null||a===void 0?void 0:a.providerItemsToReuse,g),v=Hd.create(this._editorWorkerService,this._editor),m=rZ(this._languageFeaturesService.completionProvider,l,this._editor.getPosition(),p,u,this._requestToken.token);Promise.all([m,v]).then(async([_,y])=>{var S;if((S=this._requestToken)===null||S===void 0||S.dispose(),!this._editor.hasModel())return;let L=e==null?void 0:e.clipboardText;if(!L&&_.needsClipboard&&(L=await this._clipboardService.readText()),this._triggerState===void 0)return;const E=this._editor.getModel(),D=new s0(E,this._editor.getPosition(),e),k={...X4.default,firstMatchCanBeWeak:!this._editor.getOption(118).matchOnWordStartOnly};if(this._completionModel=new Wm(_.items,this._context.column,{leadingLineContent:D.leadingLineContent,characterCountDelta:D.column-this._context.column},y,this._editor.getOption(118),this._editor.getOption(112),k,L),this._completionDisposables.add(_.disposable),this._onNewContext(D),this._reportDurationsTelemetry(_.durations),!this._envService.isBuilt||this._envService.isExtensionDevelopment)for(const T of _.items)T.isInvalid&&this._logService.warn(`[suggest] did IGNORE invalid completion item from ${T.provider._debugDisplayName}`,T.completion)}).catch(en)}_reportDurationsTelemetry(e){this._telemetryGate++%230===0&&setTimeout(()=>{this._telemetryService.publicLog2("suggest.durations.json",{data:JSON.stringify(e)}),this._logService.debug("suggest.durations.json",e)})}static createSuggestFilter(e){const t=new Set;e.getOption(112)==="none"&&t.add(27);const r=e.getOption(118);return r.showMethods||t.add(0),r.showFunctions||t.add(1),r.showConstructors||t.add(2),r.showFields||t.add(3),r.showVariables||t.add(4),r.showClasses||t.add(5),r.showStructs||t.add(6),r.showInterfaces||t.add(7),r.showModules||t.add(8),r.showProperties||t.add(9),r.showEvents||t.add(10),r.showOperators||t.add(11),r.showUnits||t.add(12),r.showValues||t.add(13),r.showConstants||t.add(14),r.showEnums||t.add(15),r.showEnumMembers||t.add(16),r.showKeywords||t.add(17),r.showWords||t.add(18),r.showColors||t.add(19),r.showFiles||t.add(20),r.showReferences||t.add(21),r.showColors||t.add(22),r.showFolders||t.add(23),r.showTypeParameters||t.add(24),r.showSnippets||t.add(27),r.showUsers||t.add(25),r.showIssues||t.add(26),{itemKind:t,showDeprecated:r.showDeprecated}}_onNewContext(e){if(this._context){if(e.lineNumber!==this._context.lineNumber){this.cancel();return}if(bi(e.leadingLineContent)!==bi(this._context.leadingLineContent)){this.cancel();return}if(e.columnthis._context.leadingWord.startColumn){if(s0.shouldAutoTrigger(this._editor)&&this._context){const n=this._completionModel.getItemsByProvider();this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerItemsToReuse:n}})}return}if(e.column>this._context.column&&this._completionModel.getIncompleteProvider().size>0&&e.leadingWord.word.length!==0){const t=new Map,n=new Set;for(const[r,o]of this._completionModel.getItemsByProvider())o.length>0&&o[0].container.incomplete?n.add(r):t.set(r,o);this.trigger({auto:this._context.triggerOptions.auto,triggerKind:2,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerFilter:n,providerItemsToReuse:t}})}else{const t=this._completionModel.lineContext;let n=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},this._completionModel.items.length===0){const r=s0.shouldAutoTrigger(this._editor);if(!this._context){this.cancel();return}if(r&&this._context.leadingWord.endColumn0,n&&e.leadingWord.word.length===0){this.cancel();return}}this._onDidSuggest.fire({completionModel:this._completionModel,triggerOptions:e.triggerOptions,isFrozen:n})}}}}};IO=DU=Fst([lm(1,hd),lm(2,Kp),lm(3,ea),lm(4,Ta),lm(5,Vt),lm(6,gn),lm(7,_t),lm(8,EX)],IO);class Q3{constructor(e,t){this._disposables=new Te,this._lastOvertyped=[],this._locked=!1,this._disposables.add(e.onWillType(()=>{if(this._locked||!e.hasModel())return;const n=e.getSelections(),r=n.length;let o=!1;for(let a=0;aQ3._maxSelectionLength)return;this._lastOvertyped[a]={value:s.getValueInRange(l),multiline:l.startLineNumber!==l.endLineNumber}}})),this._disposables.add(t.onDidTrigger(n=>{this._locked=!0})),this._disposables.add(t.onDidCancel(n=>{this._locked=!1}))}getLastOvertypedInfo(e){if(e>=0&&e=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},$9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Hst=class L1e extends e_{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();this.label&&(this.label.textContent=w({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",this._action.label,L1e.symbolPrintEnter(e)))}static symbolPrintEnter(e){var t;return(t=e.getLabel())===null||t===void 0?void 0:t.replace(/\benter\b/gi,"⏎")}},IU=class{constructor(e,t,n,r,o){this._menuId=t,this._menuService=r,this._contextKeyService=o,this._menuDisposables=new Te,this.element=ke(e,He(".suggest-status-bar"));const s=a=>a instanceof pc?n.createInstance(Hst,a,void 0):void 0;this._leftActions=new au(this.element,{actionViewItemProvider:s}),this._rightActions=new au(this.element,{actionViewItemProvider:s}),this._leftActions.domNode.classList.add("left"),this._rightActions.domNode.classList.add("right")}dispose(){this._menuDisposables.dispose(),this._leftActions.dispose(),this._rightActions.dispose(),this.element.remove()}show(){const e=this._menuService.createMenu(this._menuId,this._contextKeyService),t=()=>{const n=[],r=[];for(const[o,s]of e.getActions())o==="left"?n.push(...s):r.push(...s);this._leftActions.clear(),this._leftActions.push(n),this._rightActions.clear(),this._rightActions.push(r)};this._menuDisposables.add(e.onDidChange(()=>t())),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};IU=$st([$9(2,Ot),$9(3,hu),$9(4,Vt)],IU);var Vst=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},zst=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};function aZ(i){return!!i&&!!(i.completion.documentation||i.completion.detail&&i.completion.detail!==i.completion.label)}let kU=class{constructor(e,t){this._editor=e,this._onDidClose=new se,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new se,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new Te,this._renderDisposeable=new Te,this._borderWidth=1,this._size=new Kn(330,0),this.domNode=He(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(Uf,{editor:e}),this._body=He(".body"),this._scrollbar=new Hk(this._body,{alwaysConsumeMouseWheel:!0}),ke(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=ke(this._body,He(".header")),this._close=ke(this._header,He("span"+Wt.asCSSSelector(Xe.close))),this._close.title=w("details.close","Close"),this._type=ke(this._header,He("p.type")),this._docs=ke(this._body,He("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(50)&&this._configureFont()}))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(50),n=t.getMassagedFontFamily(),r=e.get(119)||t.fontSize,o=e.get(120)||t.lineHeight,s=t.fontWeight,a=`${r}px`,l=`${o}px`;this.domNode.style.fontSize=a,this.domNode.style.lineHeight=`${o/r}`,this.domNode.style.fontWeight=s,this.domNode.style.fontFeatureSettings=t.fontFeatureSettings,this._type.style.fontFamily=n,this._close.style.height=l,this._close.style.width=l}getLayoutInfo(){const e=this._editor.getOption(120)||this._editor.getOption(50).lineHeight,t=this._borderWidth,n=t*2;return{lineHeight:e,borderWidth:t,borderHeight:n,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=w("loading","Loading..."),this._docs.textContent="",this.domNode.classList.remove("no-docs","no-type"),this.layout(this.size.width,this.getLayoutInfo().lineHeight*2),this._onDidChangeContents.fire(this)}renderItem(e,t){var n,r;this._renderDisposeable.clear();let{detail:o,documentation:s}=e.completion;if(t){let a="";a+=`score: ${e.score[0]} `,a+=`prefix: ${(n=e.word)!==null&&n!==void 0?n:"(no prefix)"} `,a+=`word: ${e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel} `,a+=`distance: ${e.distance} (localityBonus-setting) `,a+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"} `,a+=`commit_chars: ${(r=e.completion.commitCharacters)===null||r===void 0?void 0:r.join("")} -`,s=new Is().appendCodeblock("empty",a),o=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!aZ(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),o){const a=o.length>1e5?`${o.substr(0,1e5)}…`:o;this._type.textContent=a,this._type.title=a,bl(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(a))}else Ns(this._type),this._type.title="",fa(this._type),this.domNode.classList.add("no-type");if(Ns(this._docs),typeof s=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=s;else if(s){this._docs.classList.add("markdown-docs"),Ns(this._docs);const a=this._markdownRenderer.render(s);this._docs.appendChild(a.element),this._renderDisposeable.add(a),this._renderDisposeable.add(this._markdownRenderer.onDidRenderAsync(()=>{this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}))}this.domNode.style.userSelect="text",this.domNode.tabIndex=-1,this._close.onmousedown=a=>{a.preventDefault(),a.stopPropagation()},this._close.onclick=a=>{a.preventDefault(),a.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get isEmpty(){return this.domNode.classList.contains("no-docs")}get size(){return this._size}layout(e,t){const n=new Kn(e,t);Kn.equals(n,this._size)||(this._size=n,XBe(this.domNode,e,t)),this._scrollbar.scanDomNode()}scrollDown(e=8){this._body.scrollTop+=e}scrollUp(e=8){this._body.scrollTop-=e}scrollTop(){this._body.scrollTop=0}scrollBottom(){this._body.scrollTop=this._body.scrollHeight}pageDown(){this.scrollDown(80)}pageUp(){this.scrollUp(80)}set borderWidth(e){this._borderWidth=e}get borderWidth(){return this._borderWidth}};kU=Vst([zst(1,Ot)],kU);class Ust{constructor(e,t){this.widget=e,this._editor=t,this.allowEditorOverflow=!0,this._disposables=new Te,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new VY,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let n,r,o=0,s=0;this._disposables.add(this._resizable.onDidWillResize(()=>{n=this._topLeft,r=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(a=>{if(n&&r){this.widget.layout(a.dimension.width,a.dimension.height);let l=!1;a.west&&(s=r.width-a.dimension.width,l=!0),a.north&&(o=r.height-a.dimension.height,l=!0),l&&this._applyTopLeft({top:n.top+o,left:n.left+s})}a.done&&(n=void 0,r=void 0,o=0,s=0,this._userSize=a.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{var a;this._anchorBox&&this._placeAtAnchor(this._anchorBox,(a=this._userSize)!==null&&a!==void 0?a:this.widget.size,this._preferAlignAtTop)}))}dispose(){this._resizable.dispose(),this._disposables.dispose(),this.hide()}getId(){return"suggest.details"}getDomNode(){return this._resizable.domNode}getPosition(){return this._topLeft?{preference:this._topLeft}:null}show(){this._added||(this._editor.addOverlayWidget(this),this._added=!0)}hide(e=!1){this._resizable.clearSashHoverState(),this._added&&(this._editor.removeOverlayWidget(this),this._added=!1,this._anchorBox=void 0,this._topLeft=void 0),e&&(this._userSize=void 0,this.widget.clearContents())}placeAtAnchor(e,t){var n;const r=e.getBoundingClientRect();this._anchorBox=r,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,(n=this._userSize)!==null&&n!==void 0?n:this.widget.size,t)}_placeAtAnchor(e,t,n){var r;const o=kp(this.getDomNode().ownerDocument.body),s=this.widget.getLayoutInfo(),a=new Kn(220,2*s.lineHeight),l=e.top,c=function(){const E=o.width-(e.left+e.width+s.borderWidth+s.horizontalPadding),D=-s.borderWidth+e.left+e.width,k=new Kn(E,o.height-e.top-s.borderHeight-s.verticalPadding),T=k.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:l,left:D,fit:E-t.width,maxSizeTop:k,maxSizeBottom:T,minSize:a.with(Math.min(E,a.width))}}(),u=function(){const E=e.left-s.borderWidth-s.horizontalPadding,D=Math.max(s.horizontalPadding,e.left-t.width-s.borderWidth),k=new Kn(E,o.height-e.top-s.borderHeight-s.verticalPadding),T=k.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:l,left:D,fit:E-t.width,maxSizeTop:k,maxSizeBottom:T,minSize:a.with(Math.min(E,a.width))}}(),d=function(){const E=e.left,D=-s.borderWidth+e.top+e.height,k=new Kn(e.width-s.borderHeight,o.height-e.top-e.height-s.verticalPadding);return{top:D,left:E,fit:k.height-t.height,maxSizeBottom:k,maxSizeTop:k,minSize:a.with(k.width)}}(),h=[c,u,d],f=(r=h.find(E=>E.fit>=0))!==null&&r!==void 0?r:h.sort((E,D)=>D.fit-E.fit)[0],g=e.top+e.height-s.borderHeight;let p,v=t.height;const m=Math.max(f.maxSizeTop.height,f.maxSizeBottom.height);v>m&&(v=m);let _;n?v<=f.maxSizeTop.height?(p=!0,_=f.maxSizeTop):(p=!1,_=f.maxSizeBottom):v<=f.maxSizeBottom.height?(p=!1,_=f.maxSizeBottom):(p=!0,_=f.maxSizeTop);let{top:y,left:S}=f;!p&&v>e.height&&(y=g-v);const L=this._editor.getDomNode();if(L){const E=L.getBoundingClientRect();y-=E.top,S-=E.left}this._applyTopLeft({left:S,top:y}),this._resizable.enableSashes(!p,f===c,p,f!==c),this._resizable.minSize=f.minSize,this._resizable.maxSize=_,this._resizable.layout(v,Math.min(_.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this._editor.layoutOverlayWidget(this)}}var xf;(function(i){i[i.FILE=0]="FILE",i[i.FOLDER=1]="FOLDER",i[i.ROOT_FOLDER=2]="ROOT_FOLDER"})(xf||(xf={}));const jst=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function u2(i,e,t,n,r){if(r)return[`codicon-${r.id}`,"predefined-file-icon"];const o=n===xf.ROOT_FOLDER?["rootfolder-icon"]:n===xf.FOLDER?["folder-icon"]:["file-icon"];if(t){let s;if(t.scheme===an.data)s=Qv.parseMetaData(t).get(Qv.META_DATA_LABEL);else{const a=t.path.match(jst);a?(s=d2(a[2].toLowerCase()),a[1]&&o.push(`${d2(a[1].toLowerCase())}-name-dir-icon`)):s=d2(t.authority.toLowerCase())}if(n===xf.ROOT_FOLDER)o.push(`${s}-root-name-folder-icon`);else if(n===xf.FOLDER)o.push(`${s}-name-folder-icon`);else{if(s){if(o.push(`${s}-name-file-icon`),o.push("name-file-icon"),s.length<=255){const l=s.split(".");for(let c=1;c=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},H9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},lm;function E1e(i){return`suggest-aria-id:${i}`}const qst=Mr("suggest-more-info",Xe.chevronRight,w("suggestMoreInfoIcon","Icon for more information in the suggest widget.")),Xst=new(lm=class{extract(e,t){if(e.textLabel.match(lm._regexStrict))return t[0]=e.textLabel,!0;if(e.completion.detail&&e.completion.detail.match(lm._regexStrict))return t[0]=e.completion.detail,!0;if(e.completion.documentation){const n=typeof e.completion.documentation=="string"?e.completion.documentation:e.completion.documentation.value,r=lm._regexRelaxed.exec(n);if(r&&(r.index===0||r.index+r[0].length===n.length))return t[0]=r[0],!0}return!1}},lm._regexRelaxed=/(#([\da-fA-F]{3}){1,2}|(rgb|hsl)a\(\s*(\d{1,3}%?\s*,\s*){3}(1|0?\.\d+)\)|(rgb|hsl)\(\s*\d{1,3}%?(\s*,\s*\d{1,3}%?){2}\s*\))/,lm._regexStrict=new RegExp(`^${lm._regexRelaxed.source}$`,"i"),lm);let TU=class{constructor(e,t,n,r){this._editor=e,this._modelService=t,this._languageService=n,this._themeService=r,this._onDidToggleDetails=new se,this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(e){const t=new Te,n=e;n.classList.add("show-file-icons");const r=ke(e,He(".icon")),o=ke(r,He("span.colorspan")),s=ke(e,He(".contents")),a=ke(s,He(".main")),l=ke(a,He(".icon-label.codicon")),c=ke(a,He("span.left")),u=ke(a,He("span.right")),d=new ZP(c,{supportHighlights:!0,supportIcons:!0});t.add(d);const h=ke(c,He("span.signature-label")),f=ke(c,He("span.qualifier-label")),g=ke(u,He("span.details-label")),p=ke(u,He("span.readMore"+Wt.asCSSSelector(qst)));return p.title=w("readMore","Read More"),{root:n,left:c,right:u,icon:r,colorspan:o,iconLabel:d,iconContainer:l,parametersLabel:h,qualifierLabel:f,detailsLabel:g,readMore:p,disposables:t,configureFont:()=>{const m=this._editor.getOptions(),_=m.get(50),y=_.getMassagedFontFamily(),S=_.fontFeatureSettings,L=m.get(119)||_.fontSize,E=m.get(120)||_.lineHeight,D=_.fontWeight,k=_.letterSpacing,T=`${L}px`,M=`${E}px`,A=`${k}px`;n.style.fontSize=T,n.style.fontWeight=D,n.style.letterSpacing=A,a.style.fontFamily=y,a.style.fontFeatureSettings=S,a.style.lineHeight=M,r.style.height=M,r.style.width=M,p.style.height=M,p.style.width=M}}}renderElement(e,t,n){n.configureFont();const{completion:r}=e;n.root.id=E1e(t),n.colorspan.style.backgroundColor="";const o={labelEscapeNewLines:!0,matches:qk(e.score)},s=[];if(r.kind===19&&Xst.extract(e,s))n.icon.className="icon customcolor",n.iconContainer.className="icon hide",n.colorspan.style.backgroundColor=s[0];else if(r.kind===20&&this._themeService.getFileIconTheme().hasFileIcons){n.icon.className="icon hide",n.iconContainer.className="icon hide";const a=u2(this._modelService,this._languageService,At.from({scheme:"fake",path:e.textLabel}),xf.FILE),l=u2(this._modelService,this._languageService,At.from({scheme:"fake",path:r.detail}),xf.FILE);o.extraClasses=a.length>l.length?a:l}else r.kind===23&&this._themeService.getFileIconTheme().hasFolderIcons?(n.icon.className="icon hide",n.iconContainer.className="icon hide",o.extraClasses=[u2(this._modelService,this._languageService,At.from({scheme:"fake",path:e.textLabel}),xf.FOLDER),u2(this._modelService,this._languageService,At.from({scheme:"fake",path:r.detail}),xf.FOLDER)].flat()):(n.icon.className="icon hide",n.iconContainer.className="",n.iconContainer.classList.add("suggest-icon",...Wt.asClassNameArray(SD.toIcon(r.kind))));r.tags&&r.tags.indexOf(1)>=0&&(o.extraClasses=(o.extraClasses||[]).concat(["deprecated"]),o.matches=[]),n.iconLabel.setLabel(e.textLabel,void 0,o),typeof r.label=="string"?(n.parametersLabel.textContent="",n.detailsLabel.textContent=V9(r.detail||""),n.root.classList.add("string-label")):(n.parametersLabel.textContent=V9(r.label.detail||""),n.detailsLabel.textContent=V9(r.label.description||""),n.root.classList.remove("string-label")),this._editor.getOption(118).showInlineDetails?bl(n.detailsLabel):fa(n.detailsLabel),aZ(e)?(n.right.classList.add("can-expand-details"),bl(n.readMore),n.readMore.onmousedown=a=>{a.stopPropagation(),a.preventDefault()},n.readMore.onclick=a=>{a.stopPropagation(),a.preventDefault(),this._onDidToggleDetails.fire()}):(n.right.classList.remove("can-expand-details"),fa(n.readMore),n.readMore.onmousedown=null,n.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};TU=Gst([H9(1,tr),H9(2,ji),H9(3,To)],TU);function V9(i){return i.replace(/\r\n|\r|\n/g,"")}var Yst=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},h2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},M1;X("editorSuggestWidget.background",{dark:Nr,light:Nr,hcDark:Nr,hcLight:Nr},w("editorSuggestWidgetBackground","Background color of the suggest widget."));X("editorSuggestWidget.border",{dark:Jg,light:Jg,hcDark:Jg,hcLight:Jg},w("editorSuggestWidgetBorder","Border color of the suggest widget."));const f2=X("editorSuggestWidget.foreground",{dark:Ku,light:Ku,hcDark:Ku,hcLight:Ku},w("editorSuggestWidgetForeground","Foreground color of the suggest widget."));X("editorSuggestWidget.selectedForeground",{dark:$0,light:$0,hcDark:$0,hcLight:$0},w("editorSuggestWidgetSelectedForeground","Foreground color of the selected entry in the suggest widget."));X("editorSuggestWidget.selectedIconForeground",{dark:sy,light:sy,hcDark:sy,hcLight:sy},w("editorSuggestWidgetSelectedIconForeground","Icon foreground color of the selected entry in the suggest widget."));const Zst=X("editorSuggestWidget.selectedBackground",{dark:H0,light:H0,hcDark:H0,hcLight:H0},w("editorSuggestWidgetSelectedBackground","Background color of the selected entry in the suggest widget."));X("editorSuggestWidget.highlightForeground",{dark:Gu,light:Gu,hcDark:Gu,hcLight:Gu},w("editorSuggestWidgetHighlightForeground","Color of the match highlights in the suggest widget."));X("editorSuggestWidget.focusHighlightForeground",{dark:cR,light:cR,hcDark:cR,hcLight:cR},w("editorSuggestWidgetFocusHighlightForeground","Color of the match highlights in the suggest widget when an item is focused."));X("editorSuggestWidgetStatus.foreground",{dark:It(f2,.5),light:It(f2,.5),hcDark:It(f2,.5),hcLight:It(f2,.5)},w("editorSuggestWidgetStatusForeground","Foreground color of the suggest widget status."));class Qst{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof s_}`}restore(){var e;const t=(e=this._service.get(this._key,0))!==null&&e!==void 0?e:"";try{const n=JSON.parse(t);if(Kn.is(n))return Kn.lift(n)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}let HI=M1=class{constructor(e,t,n,r,o){this.editor=e,this._storageService=t,this._state=0,this._isAuto=!1,this._pendingLayout=new Ho,this._pendingShowDetails=new Ho,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new cd,this._disposables=new Te,this._onDidSelect=new Lb,this._onDidFocus=new Lb,this._onDidHide=new se,this._onDidShow=new se,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new se,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new VY,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new Jst(this,e),this._persistedSize=new Qst(t,e);class s{constructor(f,g,p=!1,v=!1){this.persistedSize=f,this.currentSize=g,this.persistHeight=p,this.persistWidth=v}}let a;this._disposables.add(this.element.onDidWillResize(()=>{this._contentWidget.lockPreference(),a=new s(this._persistedSize.restore(),this.element.size)})),this._disposables.add(this.element.onDidResize(h=>{var f,g,p,v;if(this._resize(h.dimension.width,h.dimension.height),a&&(a.persistHeight=a.persistHeight||!!h.north||!!h.south,a.persistWidth=a.persistWidth||!!h.east||!!h.west),!!h.done){if(a){const{itemHeight:m,defaultSize:_}=this.getLayoutInfo(),y=Math.round(m/2);let{width:S,height:L}=this.element.size;(!a.persistHeight||Math.abs(a.currentSize.height-L)<=y)&&(L=(g=(f=a.persistedSize)===null||f===void 0?void 0:f.height)!==null&&g!==void 0?g:_.height),(!a.persistWidth||Math.abs(a.currentSize.width-S)<=y)&&(S=(v=(p=a.persistedSize)===null||p===void 0?void 0:p.width)!==null&&v!==void 0?v:_.width),this._persistedSize.store(new Kn(S,L))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=ke(this.element.domNode,He(".message")),this._listElement=ke(this.element.domNode,He(".tree"));const l=this._disposables.add(o.createInstance(kU,this.editor));l.onDidClose(this.toggleDetails,this,this._disposables),this._details=new Ust(l,this.editor);const c=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(118).showIcons);c();const u=o.createInstance(TU,this.editor);this._disposables.add(u),this._disposables.add(u.onDidToggleDetails(()=>this.toggleDetails())),this._list=new wc("SuggestWidget",this._listElement,{getHeight:h=>this.getLayoutInfo().itemHeight,getTemplateId:h=>"suggestion"},[u],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>"option",getWidgetAriaLabel:()=>w("suggest","Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:h=>{let f=h.textLabel;if(typeof h.completion.label!="string"){const{detail:m,description:_}=h.completion.label;m&&_?f=w("label.full","{0} {1}, {2}",f,m,_):m?f=w("label.detail","{0} {1}",f,m):_&&(f=w("label.desc","{0}, {1}",f,_))}if(!h.isResolved||!this._isDetailsVisible())return f;const{documentation:g,detail:p}=h.completion,v=Eb("{0}{1}",p||"",g?typeof g=="string"?g:g.value:"");return w("ariaCurrenttSuggestionReadDetails","{0}, docs: {1}",f,v)}}}),this._list.style(RS({listInactiveFocusBackground:Zst,listInactiveFocusOutline:zi})),this._status=o.createInstance(IU,this.element.domNode,Tv);const d=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(118).showStatusBar);d(),this._disposables.add(r.onDidColorThemeChange(h=>this._onThemeChange(h))),this._onThemeChange(r.getColorTheme()),this._disposables.add(this._list.onMouseDown(h=>this._onListMouseDownOrTap(h))),this._disposables.add(this._list.onTap(h=>this._onListMouseDownOrTap(h))),this._disposables.add(this._list.onDidChangeSelection(h=>this._onListSelection(h))),this._disposables.add(this._list.onDidChangeFocus(h=>this._onListFocus(h))),this._disposables.add(this.editor.onDidChangeCursorSelection(()=>this._onCursorSelectionChanged())),this._disposables.add(this.editor.onDidChangeConfiguration(h=>{h.hasChanged(118)&&(d(),c()),this._completionModel&&(h.hasChanged(50)||h.hasChanged(119)||h.hasChanged(120))&&this._list.splice(0,this._list.length,this._completionModel.items)})),this._ctxSuggestWidgetVisible=ln.Visible.bindTo(n),this._ctxSuggestWidgetDetailsVisible=ln.DetailsVisible.bindTo(n),this._ctxSuggestWidgetMultipleSuggestions=ln.MultipleSuggestions.bindTo(n),this._ctxSuggestWidgetHasFocusedSuggestion=ln.HasFocusedSuggestion.bindTo(n),this._disposables.add(Sr(this._details.widget.domNode,"keydown",h=>{this._onDetailsKeydown.fire(h)})),this._disposables.add(this.editor.onMouseDown(h=>this._onEditorMouseDown(h)))}dispose(){var e;this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),(e=this._loadingTimeout)===null||e===void 0||e.dispose(),this._pendingLayout.dispose(),this._pendingShowDetails.dispose(),this._showTimeout.dispose(),this._contentWidget.dispose(),this.element.dispose()}_onEditorMouseDown(e){this._details.widget.domNode.contains(e.target.element)?this._details.widget.domNode.focus():this.element.domNode.contains(e.target.element)&&this.editor.focus()}_onCursorSelectionChanged(){this._state!==0&&this._contentWidget.layout()}_onListMouseDownOrTap(e){typeof e.element>"u"||typeof e.index>"u"||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation(),this._select(e.element,e.index))}_onListSelection(e){e.elements.length&&this._select(e.elements[0],e.indexes[0])}_select(e,t){const n=this._completionModel;n&&(this._onDidSelect.fire({item:e,index:t,model:n}),this.editor.focus())}_onThemeChange(e){this._details.widget.borderWidth=ih(e.type)?2:1}_onListFocus(e){var t;if(this._ignoreFocusEvents)return;if(!e.elements.length){this._currentSuggestionDetails&&(this._currentSuggestionDetails.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=void 0),this.editor.setAriaOptions({activeDescendant:void 0}),this._ctxSuggestWidgetHasFocusedSuggestion.set(!1);return}if(!this._completionModel)return;this._ctxSuggestWidgetHasFocusedSuggestion.set(!0);const n=e.elements[0],r=e.indexes[0];n!==this._focusedItem&&((t=this._currentSuggestionDetails)===null||t===void 0||t.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=n,this._list.reveal(r),this._currentSuggestionDetails=Io(async o=>{const s=Kv(()=>{this._isDetailsVisible()&&this.showDetails(!0)},250),a=o.onCancellationRequested(()=>s.dispose());try{return await n.resolve(o)}finally{s.dispose(),a.dispose()}}),this._currentSuggestionDetails.then(()=>{r>=this._list.length||n!==this._list.element(r)||(this._ignoreFocusEvents=!0,this._list.splice(r,1,[n]),this._list.setFocus([r]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this.showDetails(!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:E1e(r)}))}).catch(en)),this._onDidFocus.fire({item:n,index:r,model:this._completionModel})}_setState(e){if(this._state!==e)switch(this._state=e,this.element.domNode.classList.toggle("frozen",e===4),this.element.domNode.classList.remove("message"),e){case 0:fa(this._messageElement,this._listElement,this._status.element),this._details.hide(!0),this._status.hide(),this._contentWidget.hide(),this._ctxSuggestWidgetVisible.reset(),this._ctxSuggestWidgetMultipleSuggestions.reset(),this._ctxSuggestWidgetHasFocusedSuggestion.reset(),this._showTimeout.cancel(),this.element.domNode.classList.remove("visible"),this._list.splice(0,this._list.length),this._focusedItem=void 0,this._cappedHeight=void 0,this._explainMode=!1;break;case 1:this.element.domNode.classList.add("message"),this._messageElement.textContent=M1.LOADING_MESSAGE,fa(this._listElement,this._status.element),bl(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Hf(M1.LOADING_MESSAGE);break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=M1.NO_SUGGESTIONS_MESSAGE,fa(this._listElement,this._status.element),bl(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Hf(M1.NO_SUGGESTIONS_MESSAGE);break;case 3:fa(this._messageElement),bl(this._listElement,this._status.element),this._show();break;case 4:fa(this._messageElement),bl(this._listElement,this._status.element),this._show();break;case 5:fa(this._messageElement),bl(this._listElement,this._status.element),this._details.show(),this._show();break}}_show(){this._status.show(),this._contentWidget.show(),this._layout(this._persistedSize.restore()),this._ctxSuggestWidgetVisible.set(!0),this._showTimeout.cancelAndSet(()=>{this.element.domNode.classList.add("visible"),this._onDidShow.fire(this)},100)}showTriggered(e,t){this._state===0&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!e,this._isAuto||(this._loadingTimeout=Kv(()=>this._setState(1),t)))}showSuggestions(e,t,n,r,o){var s,a;if(this._contentWidget.setPosition(this.editor.getPosition()),(s=this._loadingTimeout)===null||s===void 0||s.dispose(),(a=this._currentSuggestionDetails)===null||a===void 0||a.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),n&&this._state!==2&&this._state!==0){this._setState(4);return}const l=this._completionModel.items.length,c=l===0;if(this._ctxSuggestWidgetMultipleSuggestions.set(l>1),c){this._setState(r?0:2),this._completionModel=void 0;return}this._focusedItem=void 0,this._onDidFocus.pause(),this._onDidSelect.pause();try{this._list.splice(0,this._list.length,this._completionModel.items),this._setState(n?4:3),this._list.reveal(t,0),this._list.setFocus(o?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=KA(Pt(this.element.domNode),()=>{this._pendingLayout.clear(),this._layout(this.element.size),this._details.widget.domNode.classList.remove("focused")})}focusSelected(){this._list.length>0&&this._list.setFocus([0])}selectNextPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageDown(),!0;case 1:return!this._isAuto;default:return this._list.focusNextPage(),!0}}selectNext(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusNext(1,!0),!0}}selectLast(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollBottom(),!0;case 1:return!this._isAuto;default:return this._list.focusLast(),!0}}selectPreviousPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageUp(),!0;case 1:return!this._isAuto;default:return this._list.focusPreviousPage(),!0}}selectPrevious(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusPrevious(1,!0),!1}}selectFirst(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollTop(),!0;case 1:return!this._isAuto;default:return this._list.focusFirst(),!0}}getFocusedItem(){if(this._state!==0&&this._state!==2&&this._state!==1&&this._completionModel&&this._list.getFocus().length>0)return{item:this._list.getFocusedElements()[0],index:this._list.getFocus()[0],model:this._completionModel}}toggleDetailsFocus(){this._state===5?(this._setState(3),this._details.widget.domNode.classList.remove("focused")):this._state===3&&this._isDetailsVisible()&&(this._setState(5),this._details.widget.domNode.classList.add("focused"))}toggleDetails(){this._isDetailsVisible()?(this._pendingShowDetails.clear(),this._ctxSuggestWidgetDetailsVisible.set(!1),this._setDetailsVisible(!1),this._details.hide(),this.element.domNode.classList.remove("shows-details")):(aZ(this._list.getFocusedElements()[0])||this._explainMode)&&(this._state===3||this._state===5||this._state===4)&&(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this.showDetails(!1))}showDetails(e){this._pendingShowDetails.value=KA(Pt(this.element.domNode),()=>{this._pendingShowDetails.clear(),this._details.show(),e?this._details.widget.renderLoading():this._details.widget.renderItem(this._list.getFocusedElements()[0],this._explainMode),this._details.widget.isEmpty?this._details.hide():(this._positionDetails(),this.element.domNode.classList.add("shows-details")),this.editor.focus()})}toggleExplainMode(){this._list.getFocusedElements()[0]&&(this._explainMode=!this._explainMode,this._isDetailsVisible()?this.showDetails(!1):this.toggleDetails())}resetPersistedSize(){this._persistedSize.reset()}hideWidget(){var e;this._pendingLayout.clear(),this._pendingShowDetails.clear(),(e=this._loadingTimeout)===null||e===void 0||e.dispose(),this._setState(0),this._onDidHide.fire(this),this.element.clearSashHoverState();const t=this._persistedSize.restore(),n=Math.ceil(this.getLayoutInfo().itemHeight*4.3);t&&t.heightc&&(l=c);const u=this._completionModel?this._completionModel.stats.pLabelLen*s.typicalHalfwidthCharacterWidth:l,d=s.statusBarHeight+this._list.contentHeight+s.borderHeight,h=s.itemHeight+s.statusBarHeight,f=Br(this.editor.getDomNode()),g=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),p=f.top+g.top+g.height,v=Math.min(o.height-p-s.verticalPadding,d),m=f.top+g.top-s.verticalPadding,_=Math.min(m,d);let y=Math.min(Math.max(_,v)+s.borderHeight,d);a===((t=this._cappedHeight)===null||t===void 0?void 0:t.capped)&&(a=this._cappedHeight.wanted),ay&&(a=y);const S=150;a>v||this._forceRenderingAbove&&m>S?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),y=_):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),y=v),this.element.preferredSize=new Kn(u,s.defaultSize.height),this.element.maxSize=new Kn(c,y),this.element.minSize=new Kn(220,h),this._cappedHeight=a===d?{wanted:(r=(n=this._cappedHeight)===null||n===void 0?void 0:n.wanted)!==null&&r!==void 0?r:e.height,capped:a}:void 0}this._resize(l,a)}_resize(e,t){const{width:n,height:r}=this.element.maxSize;e=Math.min(n,e),t=Math.min(r,t);const{statusBarHeight:o}=this.getLayoutInfo();this._list.layout(t-o,e),this._listElement.style.height=`${t-o}px`,this.element.layout(t,e),this._contentWidget.layout(),this._positionDetails()}_positionDetails(){var e;this._isDetailsVisible()&&this._details.placeAtAnchor(this.element.domNode,((e=this._contentWidget.getPosition())===null||e===void 0?void 0:e.preference[0])===2)}getLayoutInfo(){const e=this.editor.getOption(50),t=da(this.editor.getOption(120)||e.lineHeight,8,1e3),n=!this.editor.getOption(118).showStatusBar||this._state===2||this._state===1?0:t,r=this._details.widget.borderWidth,o=2*r;return{itemHeight:t,statusBarHeight:n,borderWidth:r,borderHeight:o,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new Kn(430,n+12*t+o)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",0,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,0,0)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}};HI.LOADING_MESSAGE=w("suggestWidget.loading","Loading...");HI.NO_SUGGESTIONS_MESSAGE=w("suggestWidget.noSuggestions","No suggestions.");HI=M1=Yst([h2(1,dd),h2(2,Vt),h2(3,To),h2(4,Ot)],HI);class Jst{constructor(e,t){this._widget=e,this._editor=t,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._preferenceLocked=!1,this._added=!1,this._hidden=!1}dispose(){this._added&&(this._added=!1,this._editor.removeContentWidget(this))}getId(){return"editor.widget.suggestWidget"}getDomNode(){return this._widget.element.domNode}show(){this._hidden=!1,this._added||(this._added=!0,this._editor.addContentWidget(this))}hide(){this._hidden||(this._hidden=!0,this.layout())}layout(){this._editor.layoutContentWidget(this)}getPosition(){return this._hidden||!this._position||!this._preference?null:{position:this._position,preference:[this._preference]}}beforeRender(){const{height:e,width:t}=this._widget.element.size,{borderWidth:n,horizontalPadding:r}=this._widget.getLayoutInfo();return new Kn(t+2*n+r,e+2*n)}afterRender(e){this._widget._afterRender(e)}setPreference(e){this._preferenceLocked||(this._preference=e)}lockPreference(){this._preferenceLocked=!0}unlockPreference(){this._preferenceLocked=!1}setPosition(e){this._position=e}}var eat=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},a1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},NU;class tat{constructor(e,t){if(this._model=e,this._position=t,this._decorationOptions=sn.register({description:"suggest-line-suffix",stickiness:1}),e.getLineMaxColumn(t.lineNumber)!==t.column){const r=e.getOffsetAt(t),o=e.getPositionAt(r+1);e.changeDecorations(s=>{this._marker&&s.removeDecoration(this._marker),this._marker=s.addDecoration(B.fromPositions(t,o),this._decorationOptions)})}}dispose(){this._marker&&!this._model.isDisposed()&&this._model.changeDecorations(e=>{e.removeDecoration(this._marker),this._marker=void 0})}delta(e){if(this._model.isDisposed()||this._position.lineNumber!==e.lineNumber)return 0;if(this._marker){const t=this._model.getDecorationRange(this._marker);return this._model.getOffsetAt(t.getStartPosition())-this._model.getOffsetAt(e)}else return this._model.getLineMaxColumn(e.lineNumber)-e.column}}let Xu=NU=class{static get(e){return e.getContribution(NU.ID)}constructor(e,t,n,r,o,s,a){this._memoryService=t,this._commandService=n,this._contextKeyService=r,this._instantiationService=o,this._logService=s,this._telemetryService=a,this._lineSuffix=new Ho,this._toDispose=new Te,this._selectors=new nat(d=>d.priority),this._onWillInsertSuggestItem=new se,this.onWillInsertSuggestItem=this._onWillInsertSuggestItem.event,this.editor=e,this.model=o.createInstance(IO,this.editor),this._selectors.register({priority:0,select:(d,h,f)=>this._memoryService.select(d,h,f)});const l=ln.InsertMode.bindTo(r);l.set(e.getOption(118).insertMode),this._toDispose.add(this.model.onDidTrigger(()=>l.set(e.getOption(118).insertMode))),this.widget=this._toDispose.add(new s6(Pt(e.getDomNode()),()=>{const d=this._instantiationService.createInstance(HI,this.editor);this._toDispose.add(d),this._toDispose.add(d.onDidSelect(v=>this._insertSuggestion(v,0),this));const h=new Ost(this.editor,d,this.model,v=>this._insertSuggestion(v,2));this._toDispose.add(h);const f=ln.MakesTextEdit.bindTo(this._contextKeyService),g=ln.HasInsertAndReplaceRange.bindTo(this._contextKeyService),p=ln.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(Rt(()=>{f.reset(),g.reset(),p.reset()})),this._toDispose.add(d.onDidFocus(({item:v})=>{const m=this.editor.getPosition(),_=v.editStart.column,y=m.column;let S=!0;this.editor.getOption(1)==="smart"&&this.model.state===2&&!v.completion.additionalTextEdits&&!(v.completion.insertTextRules&4)&&y-_===v.completion.insertText.length&&(S=this.editor.getModel().getValueInRange({startLineNumber:m.lineNumber,startColumn:_,endLineNumber:m.lineNumber,endColumn:y})!==v.completion.insertText),f.set(S),g.set(!ae.equals(v.editInsertEnd,v.editReplaceEnd)),p.set(!!v.provider.resolveCompletionItem||!!v.completion.documentation||v.completion.detail!==v.completion.label)})),this._toDispose.add(d.onDetailsKeyDown(v=>{if(v.toKeyCodeChord().equals(new Ip(!0,!1,!1,!1,33))||Ln&&v.toKeyCodeChord().equals(new Ip(!1,!1,!1,!0,33))){v.stopPropagation();return}v.toKeyCodeChord().isModifierKey()||this.editor.focus()})),d})),this._overtypingCapturer=this._toDispose.add(new s6(Pt(e.getDomNode()),()=>this._toDispose.add(new Q3(this.editor,this.model)))),this._alternatives=this._toDispose.add(new s6(Pt(e.getDomNode()),()=>this._toDispose.add(new Xb(this.editor,this._contextKeyService)))),this._toDispose.add(o.createInstance($I,e)),this._toDispose.add(this.model.onDidTrigger(d=>{this.widget.value.showTriggered(d.auto,d.shy?250:50),this._lineSuffix.value=new tat(this.editor.getModel(),d.position)})),this._toDispose.add(this.model.onDidSuggest(d=>{if(d.triggerOptions.shy)return;let h=-1;for(const g of this._selectors.itemsOrderedByPriorityDesc)if(h=g.select(this.editor.getModel(),this.editor.getPosition(),d.completionModel.items),h!==-1)break;if(h===-1&&(h=0),this.model.state===0)return;let f=!1;if(d.triggerOptions.auto){const g=this.editor.getOption(118);g.selectionMode==="never"||g.selectionMode==="always"?f=g.selectionMode==="never":g.selectionMode==="whenTriggerCharacter"?f=d.triggerOptions.triggerKind!==1:g.selectionMode==="whenQuickSuggestion"&&(f=d.triggerOptions.triggerKind===1&&!d.triggerOptions.refilter)}this.widget.value.showSuggestions(d.completionModel,h,d.isFrozen,d.triggerOptions.auto,f)})),this._toDispose.add(this.model.onDidCancel(d=>{d.retrigger||this.widget.value.hideWidget()})),this._toDispose.add(this.editor.onDidBlurEditorWidget(()=>{this.model.cancel(),this.model.clear()}));const c=ln.AcceptSuggestionsOnEnter.bindTo(r),u=()=>{const d=this.editor.getOption(1);c.set(d==="on"||d==="smart")};this._toDispose.add(this.editor.onDidChangeConfiguration(()=>u())),u()}dispose(){this._alternatives.dispose(),this._toDispose.dispose(),this.widget.dispose(),this.model.dispose(),this._lineSuffix.dispose(),this._onWillInsertSuggestItem.dispose()}_insertSuggestion(e,t){if(!e||!e.item){this._alternatives.value.reset(),this.model.cancel(),this.model.clear();return}if(!this.editor.hasModel())return;const n=ns.get(this.editor);if(!n)return;this._onWillInsertSuggestItem.fire({item:e.item});const r=this.editor.getModel(),o=r.getAlternativeVersionId(),{item:s}=e,a=[],l=new wr;t&1||this.editor.pushUndoStop();const c=this.getOverwriteInfo(s,!!(t&8));this._memoryService.memorize(r,this.editor.getPosition(),s);const u=s.isResolved;let d=-1,h=-1;if(Array.isArray(s.completion.additionalTextEdits)){this.model.cancel();const g=_h.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",s.completion.additionalTextEdits.map(p=>{let v=B.lift(p.range);if(v.startLineNumber===s.position.lineNumber&&v.startColumn>s.position.column){const m=this.editor.getPosition().column-s.position.column,_=m,y=B.spansMultipleLines(v)?0:m;v=new B(v.startLineNumber,v.startColumn+_,v.endLineNumber,v.endColumn+y)}return Xi.replaceMove(v,p.text)})),g.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!u){const g=new Ms;let p;const v=r.onDidChangeContent(S=>{if(S.isFlush){l.cancel(),v.dispose();return}for(const L of S.changes){const E=B.getEndPosition(L.range);(!p||ae.isBefore(E,p))&&(p=E)}}),m=t;t|=2;let _=!1;const y=this.editor.onWillType(()=>{y.dispose(),_=!0,m&2||this.editor.pushUndoStop()});a.push(s.resolve(l.token).then(()=>{if(!s.completion.additionalTextEdits||l.token.isCancellationRequested)return;if(p&&s.completion.additionalTextEdits.some(L=>ae.isBefore(p,B.getStartPosition(L.range))))return!1;_&&this.editor.pushUndoStop();const S=_h.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",s.completion.additionalTextEdits.map(L=>Xi.replaceMove(B.lift(L.range),L.text))),S.restoreRelativeVerticalPositionOfCursor(this.editor),(_||!(m&2))&&this.editor.pushUndoStop(),!0}).then(S=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",g.elapsed(),S),h=S===!0?1:S===!1?0:-2}).finally(()=>{v.dispose(),y.dispose()}))}let{insertText:f}=s.completion;if(s.completion.insertTextRules&4||(f=Hb.escape(f)),this.model.cancel(),n.insert(f,{overwriteBefore:c.overwriteBefore,overwriteAfter:c.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(s.completion.insertTextRules&1),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),t&2||this.editor.pushUndoStop(),s.completion.command)if(s.completion.command.id===mT.id)this.model.trigger({auto:!0,retrigger:!0});else{const g=new Ms;a.push(this._commandService.executeCommand(s.completion.command.id,...s.completion.command.arguments?[...s.completion.command.arguments]:[]).catch(p=>{s.completion.extensionId?Zr(p):en(p)}).finally(()=>{d=g.elapsed()}))}t&4&&this._alternatives.value.set(e,g=>{for(l.cancel();r.canUndo();){o!==r.getAlternativeVersionId()&&r.undo(),this._insertSuggestion(g,3|(t&8?8:0));break}}),this._alertCompletionItem(s),Promise.all(a).finally(()=>{this._reportSuggestionAcceptedTelemetry(s,r,u,d,h),this.model.clear(),l.dispose()})}_reportSuggestionAcceptedTelemetry(e,t,n,r,o){var s,a,l;Math.floor(Math.random()*100)!==0&&this._telemetryService.publicLog2("suggest.acceptedSuggestion",{extensionId:(a=(s=e.extensionId)===null||s===void 0?void 0:s.value)!==null&&a!==void 0?a:"unknown",providerId:(l=e.provider._debugDisplayName)!==null&&l!==void 0?l:"unknown",kind:e.completion.kind,basenameHash:l4(su(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:Cze(t.uri),resolveInfo:e.provider.resolveCompletionItem?n?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:r,additionalEditsAsync:o})}getOverwriteInfo(e,t){Xn(this.editor.hasModel());let n=this.editor.getOption(118).insertMode==="replace";t&&(n=!n);const r=e.position.column-e.editStart.column,o=(n?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column,s=this.editor.getPosition().column-e.position.column,a=this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0;return{overwriteBefore:r+s,overwriteAfter:o+a}}_alertCompletionItem(e){if(Ts(e.completion.additionalTextEdits)){const t=w("aria.alert.snippet","Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);kl(t)}}triggerSuggest(e,t,n){this.editor.hasModel()&&(this.model.trigger({auto:t??!1,completionOptions:{providerFilter:e,kindFilter:n?new Set:void 0}}),this.editor.revealPosition(this.editor.getPosition(),0),this.editor.focus())}triggerSuggestAndAcceptBest(e){if(!this.editor.hasModel())return;const t=this.editor.getPosition(),n=()=>{t.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},r=o=>{if(o.completion.insertTextRules&4||o.completion.additionalTextEdits)return!0;const s=this.editor.getPosition(),a=o.editStart.column,l=s.column;return l-a!==o.completion.insertText.length?!0:this.editor.getModel().getValueInRange({startLineNumber:s.lineNumber,startColumn:a,endLineNumber:s.lineNumber,endColumn:l})!==o.completion.insertText};Je.once(this.model.onDidTrigger)(o=>{const s=[];Je.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{si(s),n()},void 0,s),this.model.onDidSuggest(({completionModel:a})=>{if(si(s),a.items.length===0){n();return}const l=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),a.items),c=a.items[l];if(!r(c)){n();return}this.editor.pushUndoStop(),this._insertSuggestion({index:l,item:c,model:a},7)},void 0,s)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,0),this.editor.focus()}acceptSelectedSuggestion(e,t){const n=this.widget.value.getFocusedItem();let r=0;e&&(r|=4),t&&(r|=8),this._insertSuggestion(n,r)}acceptNextSuggestion(){this._alternatives.value.next()}acceptPrevSuggestion(){this._alternatives.value.prev()}cancelSuggestWidget(){this.model.cancel(),this.model.clear(),this.widget.value.hideWidget()}focusSuggestion(){this.widget.value.focusSelected()}selectNextSuggestion(){this.widget.value.selectNext()}selectNextPageSuggestion(){this.widget.value.selectNextPage()}selectLastSuggestion(){this.widget.value.selectLast()}selectPrevSuggestion(){this.widget.value.selectPrevious()}selectPrevPageSuggestion(){this.widget.value.selectPreviousPage()}selectFirstSuggestion(){this.widget.value.selectFirst()}toggleSuggestionDetails(){this.widget.value.toggleDetails()}toggleExplainMode(){this.widget.value.toggleExplainMode()}toggleSuggestionFocus(){this.widget.value.toggleDetailsFocus()}resetWidgetSize(){this.widget.value.resetPersistedSize()}forceRenderingAbove(){this.widget.value.forceRenderingAbove()}stopForceRenderingAbove(){this.widget.isInitialized&&this.widget.value.stopForceRenderingAbove()}registerSelector(e){return this._selectors.register(e)}};Xu.ID="editor.contrib.suggestController";Xu=NU=eat([a1(1,Z3),a1(2,sr),a1(3,Vt),a1(4,Ot),a1(5,Ta),a1(6,ea)],Xu);class nat{constructor(e){this.prioritySelector=e,this._items=new Array}register(e){if(this._items.indexOf(e)!==-1)throw new Error("Value is already registered");return this._items.push(e),this._items.sort((t,n)=>this.prioritySelector(n)-this.prioritySelector(t)),{dispose:()=>{const t=this._items.indexOf(e);t>=0&&this._items.splice(t,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}class mT extends gt{constructor(){super({id:mT.id,label:w("suggest.trigger.label","Trigger Suggest"),alias:"Trigger Suggest",precondition:De.and(j.writable,j.hasCompletionItemProvider,ln.Visible.toNegated()),kbOpts:{kbExpr:j.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t,n){const r=Xu.get(t);if(!r)return;let o;n&&typeof n=="object"&&n.auto===!0&&(o=!0),r.triggerSuggest(void 0,o,void 0)}}mT.id="editor.action.triggerSuggest";jn(Xu.ID,Xu,2);Be(mT);const _c=100+90,Ma=Vo.bindToContribution(Xu.get);et(new Ma({id:"acceptSelectedSuggestion",precondition:De.and(ln.Visible,ln.HasFocusedSuggestion),handler(i){i.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:2,kbExpr:De.and(ln.Visible,j.textInputFocus),weight:_c},{primary:3,kbExpr:De.and(ln.Visible,j.textInputFocus,ln.AcceptSuggestionsOnEnter,ln.MakesTextEdit),weight:_c}],menuOpts:[{menuId:Tv,title:w("accept.insert","Insert"),group:"left",order:1,when:ln.HasInsertAndReplaceRange.toNegated()},{menuId:Tv,title:w("accept.insert","Insert"),group:"left",order:1,when:De.and(ln.HasInsertAndReplaceRange,ln.InsertMode.isEqualTo("insert"))},{menuId:Tv,title:w("accept.replace","Replace"),group:"left",order:1,when:De.and(ln.HasInsertAndReplaceRange,ln.InsertMode.isEqualTo("replace"))}]}));et(new Ma({id:"acceptAlternativeSelectedSuggestion",precondition:De.and(ln.Visible,j.textInputFocus,ln.HasFocusedSuggestion),kbOpts:{weight:_c,kbExpr:j.textInputFocus,primary:1027,secondary:[1026]},handler(i){i.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:Tv,group:"left",order:2,when:De.and(ln.HasInsertAndReplaceRange,ln.InsertMode.isEqualTo("insert")),title:w("accept.replace","Replace")},{menuId:Tv,group:"left",order:2,when:De.and(ln.HasInsertAndReplaceRange,ln.InsertMode.isEqualTo("replace")),title:w("accept.insert","Insert")}]}));Dn.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");et(new Ma({id:"hideSuggestWidget",precondition:ln.Visible,handler:i=>i.cancelSuggestWidget(),kbOpts:{weight:_c,kbExpr:j.textInputFocus,primary:9,secondary:[1033]}}));et(new Ma({id:"selectNextSuggestion",precondition:De.and(ln.Visible,De.or(ln.MultipleSuggestions,ln.HasFocusedSuggestion.negate())),handler:i=>i.selectNextSuggestion(),kbOpts:{weight:_c,kbExpr:j.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}}));et(new Ma({id:"selectNextPageSuggestion",precondition:De.and(ln.Visible,De.or(ln.MultipleSuggestions,ln.HasFocusedSuggestion.negate())),handler:i=>i.selectNextPageSuggestion(),kbOpts:{weight:_c,kbExpr:j.textInputFocus,primary:12,secondary:[2060]}}));et(new Ma({id:"selectLastSuggestion",precondition:De.and(ln.Visible,De.or(ln.MultipleSuggestions,ln.HasFocusedSuggestion.negate())),handler:i=>i.selectLastSuggestion()}));et(new Ma({id:"selectPrevSuggestion",precondition:De.and(ln.Visible,De.or(ln.MultipleSuggestions,ln.HasFocusedSuggestion.negate())),handler:i=>i.selectPrevSuggestion(),kbOpts:{weight:_c,kbExpr:j.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}}));et(new Ma({id:"selectPrevPageSuggestion",precondition:De.and(ln.Visible,De.or(ln.MultipleSuggestions,ln.HasFocusedSuggestion.negate())),handler:i=>i.selectPrevPageSuggestion(),kbOpts:{weight:_c,kbExpr:j.textInputFocus,primary:11,secondary:[2059]}}));et(new Ma({id:"selectFirstSuggestion",precondition:De.and(ln.Visible,De.or(ln.MultipleSuggestions,ln.HasFocusedSuggestion.negate())),handler:i=>i.selectFirstSuggestion()}));et(new Ma({id:"focusSuggestion",precondition:De.and(ln.Visible,ln.HasFocusedSuggestion.negate()),handler:i=>i.focusSuggestion(),kbOpts:{weight:_c,kbExpr:j.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}}}));et(new Ma({id:"focusAndAcceptSuggestion",precondition:De.and(ln.Visible,ln.HasFocusedSuggestion.negate()),handler:i=>{i.focusSuggestion(),i.acceptSelectedSuggestion(!0,!1)}}));et(new Ma({id:"toggleSuggestionDetails",precondition:De.and(ln.Visible,ln.HasFocusedSuggestion),handler:i=>i.toggleSuggestionDetails(),kbOpts:{weight:_c,kbExpr:j.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:Tv,group:"right",order:1,when:De.and(ln.DetailsVisible,ln.CanResolve),title:w("detail.more","show less")},{menuId:Tv,group:"right",order:1,when:De.and(ln.DetailsVisible.toNegated(),ln.CanResolve),title:w("detail.less","show more")}]}));et(new Ma({id:"toggleExplainMode",precondition:ln.Visible,handler:i=>i.toggleExplainMode(),kbOpts:{weight:100,primary:2138}}));et(new Ma({id:"toggleSuggestionFocus",precondition:ln.Visible,handler:i=>i.toggleSuggestionFocus(),kbOpts:{weight:_c,kbExpr:j.textInputFocus,primary:2570,mac:{primary:778}}}));et(new Ma({id:"insertBestCompletion",precondition:De.and(j.textInputFocus,De.equals("config.editor.tabCompletion","on"),$I.AtEnd,ln.Visible.toNegated(),Xb.OtherSuggestions.toNegated(),ns.InSnippetMode.toNegated()),handler:(i,e)=>{i.triggerSuggestAndAcceptBest(va(e)?{fallback:"tab",...e}:{fallback:"tab"})},kbOpts:{weight:_c,primary:2}}));et(new Ma({id:"insertNextSuggestion",precondition:De.and(j.textInputFocus,De.equals("config.editor.tabCompletion","on"),Xb.OtherSuggestions,ln.Visible.toNegated(),ns.InSnippetMode.toNegated()),handler:i=>i.acceptNextSuggestion(),kbOpts:{weight:_c,kbExpr:j.textInputFocus,primary:2}}));et(new Ma({id:"insertPrevSuggestion",precondition:De.and(j.textInputFocus,De.equals("config.editor.tabCompletion","on"),Xb.OtherSuggestions,ln.Visible.toNegated(),ns.InSnippetMode.toNegated()),handler:i=>i.acceptPrevSuggestion(),kbOpts:{weight:_c,kbExpr:j.textInputFocus,primary:1026}}));Be(class extends gt{constructor(){super({id:"editor.action.resetSuggestSize",label:w("suggest.reset.label","Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(i,e){var t;(t=Xu.get(e))===null||t===void 0||t.resetWidgetSize()}});class iat extends fe{get selectedItem(){return this._selectedItem}constructor(e,t,n,r){super(),this.editor=e,this.suggestControllerPreselector=t,this.checkModelVersion=n,this.onWillAccept=r,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._selectedItem=Hn(this,void 0),this._register(e.onKeyDown(s=>{s.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))})),this._register(e.onKeyUp(s=>{s.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))}));const o=Xu.get(this.editor);if(o){this._register(o.registerSelector({priority:100,select:(l,c,u)=>{var d;Ri(m=>this.checkModelVersion(m));const h=this.editor.getModel();if(!h)return-1;const f=(d=this.suggestControllerPreselector())===null||d===void 0?void 0:d.removeCommonPrefix(h);if(!f)return-1;const g=ae.lift(c),p=u.map((m,_)=>{const S=OE.fromSuggestion(o,h,g,m,this.isShiftKeyPressed).toSingleTextEdit().removeCommonPrefix(h),L=f.augments(S);return{index:_,valid:L,prefixLength:S.text.length,suggestItem:m}}).filter(m=>m&&m.valid&&m.prefixLength>0),v=Bq(p,Jc(m=>m.prefixLength,dp));return v?v.index:-1}}));let s=!1;const a=()=>{s||(s=!0,this._register(o.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})),this._register(o.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.update(!1)})),this._register(o.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})))};this._register(Je.once(o.model.onDidTrigger)(l=>{a()})),this._register(o.onWillInsertSuggestItem(l=>{const c=this.editor.getPosition(),u=this.editor.getModel();if(!c||!u)return;const d=OE.fromSuggestion(o,u,c,l.item,this.isShiftKeyPressed);this.onWillAccept(d)}))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();(this._isActive!==e||!rat(this._currentSuggestItemInfo,t))&&(this._isActive=e,this._currentSuggestItemInfo=t,Ri(n=>{this.checkModelVersion(n),this._selectedItem.set(this._isActive?this._currentSuggestItemInfo:void 0,n)}))}getSuggestItemInfo(){const e=Xu.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem(),n=this.editor.getPosition(),r=this.editor.getModel();if(!(!t||!n||!r))return OE.fromSuggestion(e,r,n,t.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){const e=Xu.get(this.editor);e==null||e.stopForceRenderingAbove()}forceRenderingAbove(){const e=Xu.get(this.editor);e==null||e.forceRenderingAbove()}}class OE{static fromSuggestion(e,t,n,r,o){let{insertText:s}=r.completion,a=!1;if(r.completion.insertTextRules&4){const c=new Hb().parse(s);c.children.length<100&&DO.adjustWhitespace(t,n,!0,c),s=c.toString(),a=!0}const l=e.getOverwriteInfo(r,o);return new OE(B.fromPositions(n.delta(0,-l.overwriteBefore),n.delta(0,Math.max(l.overwriteAfter,0))),s,r.completion.kind,a)}constructor(e,t,n,r){this.range=e,this.insertText=t,this.completionItemKind=n,this.isSnippetText=r}equals(e){return this.range.equalsRange(e.range)&&this.insertText===e.insertText&&this.completionItemKind===e.completionItemKind&&this.isSnippetText===e.isSnippetText}toSelectedSuggestionInfo(){return new Tpe(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}toSingleTextEdit(){return new h_(this.range,this.insertText)}}function rat(i,e){return i===e?!0:!i||!e?!1:i.equals(e)}var oat=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},cm=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},RU;let bc=RU=class extends fe{static get(e){return e.getContribution(RU.ID)}constructor(e,t,n,r,o,s,a,l,c){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=n,this._configurationService=r,this._commandService=o,this._debounceService=s,this._languageFeaturesService=a,this._accessibilitySignalService=l,this._keybindingService=c,this.model=this._register(yI("inlineCompletionModel",void 0)),this._textModelVersionId=Hn(this,-1),this._positions=Hn(this,[new ae(1,1)]),this._suggestWidgetAdaptor=this._register(new iat(this.editor,()=>{var f,g;return(g=(f=this.model.get())===null||f===void 0?void 0:f.selectedInlineCompletion.get())===null||g===void 0?void 0:g.toSingleTextEdit(void 0)},f=>this.updateObservables(f,ql.Other),f=>{Ri(g=>{var p;this.updateObservables(g,ql.Other),(p=this.model.get())===null||p===void 0||p.handleSuggestAccepted(f)})})),this._enabled=Vi(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).enabled),this._fontFamily=Vi(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).fontFamily),this._ghostTexts=Yt(this,f=>{var g;const p=this.model.read(f);return(g=p==null?void 0:p.ghostTexts.read(f))!==null&&g!==void 0?g:[]}),this._stablizedGhostTexts=sat(this._ghostTexts,this._store),this._ghostTextWidgets=VZe(this,this._stablizedGhostTexts,(f,g)=>g.add(this._instantiationService.createInstance(SU,this.editor,{ghostText:f,minReservedLineCount:ap(0),targetTextModel:this.model.map(p=>p==null?void 0:p.textModel)}))).recomputeInitiallyAndOnChange(this._store),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this._playAccessibilitySignal=pY(this),this._isReadonly=Vi(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(91)),this._textModel=Vi(this.editor.onDidChangeModel,()=>this.editor.getModel()),this._textModelIfWritable=Yt(f=>this._isReadonly.read(f)?void 0:this._textModel.read(f)),this._register(new $o(this._contextKeyService,this.model)),this._register(bn(f=>{const g=this._textModelIfWritable.read(f);Ri(p=>{if(this.model.set(void 0,p),this.updateObservables(p,ql.Other),g){const v=t.createInstance(LU,g,this._suggestWidgetAdaptor.selectedItem,this._textModelVersionId,this._positions,this._debounceValue,Vi(e.onDidChangeConfiguration,()=>e.getOption(118).preview),Vi(e.onDidChangeConfiguration,()=>e.getOption(118).previewMode),Vi(e.onDidChangeConfiguration,()=>e.getOption(62).mode),this._enabled);this.model.set(v,p)}})}));const u=this._register(sme());this._register(bn(f=>{const g=this._fontFamily.read(f);u.setStyle(g===""||g==="default"?"":` +`,s=new Is().appendCodeblock("empty",a),o=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!aZ(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),o){const a=o.length>1e5?`${o.substr(0,1e5)}…`:o;this._type.textContent=a,this._type.title=a,bl(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(a))}else Ns(this._type),this._type.title="",fa(this._type),this.domNode.classList.add("no-type");if(Ns(this._docs),typeof s=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=s;else if(s){this._docs.classList.add("markdown-docs"),Ns(this._docs);const a=this._markdownRenderer.render(s);this._docs.appendChild(a.element),this._renderDisposeable.add(a),this._renderDisposeable.add(this._markdownRenderer.onDidRenderAsync(()=>{this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}))}this.domNode.style.userSelect="text",this.domNode.tabIndex=-1,this._close.onmousedown=a=>{a.preventDefault(),a.stopPropagation()},this._close.onclick=a=>{a.preventDefault(),a.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get isEmpty(){return this.domNode.classList.contains("no-docs")}get size(){return this._size}layout(e,t){const n=new Kn(e,t);Kn.equals(n,this._size)||(this._size=n,XBe(this.domNode,e,t)),this._scrollbar.scanDomNode()}scrollDown(e=8){this._body.scrollTop+=e}scrollUp(e=8){this._body.scrollTop-=e}scrollTop(){this._body.scrollTop=0}scrollBottom(){this._body.scrollTop=this._body.scrollHeight}pageDown(){this.scrollDown(80)}pageUp(){this.scrollUp(80)}set borderWidth(e){this._borderWidth=e}get borderWidth(){return this._borderWidth}};kU=Vst([zst(1,Ot)],kU);class Ust{constructor(e,t){this.widget=e,this._editor=t,this.allowEditorOverflow=!0,this._disposables=new Te,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new VY,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let n,r,o=0,s=0;this._disposables.add(this._resizable.onDidWillResize(()=>{n=this._topLeft,r=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(a=>{if(n&&r){this.widget.layout(a.dimension.width,a.dimension.height);let l=!1;a.west&&(s=r.width-a.dimension.width,l=!0),a.north&&(o=r.height-a.dimension.height,l=!0),l&&this._applyTopLeft({top:n.top+o,left:n.left+s})}a.done&&(n=void 0,r=void 0,o=0,s=0,this._userSize=a.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{var a;this._anchorBox&&this._placeAtAnchor(this._anchorBox,(a=this._userSize)!==null&&a!==void 0?a:this.widget.size,this._preferAlignAtTop)}))}dispose(){this._resizable.dispose(),this._disposables.dispose(),this.hide()}getId(){return"suggest.details"}getDomNode(){return this._resizable.domNode}getPosition(){return this._topLeft?{preference:this._topLeft}:null}show(){this._added||(this._editor.addOverlayWidget(this),this._added=!0)}hide(e=!1){this._resizable.clearSashHoverState(),this._added&&(this._editor.removeOverlayWidget(this),this._added=!1,this._anchorBox=void 0,this._topLeft=void 0),e&&(this._userSize=void 0,this.widget.clearContents())}placeAtAnchor(e,t){var n;const r=e.getBoundingClientRect();this._anchorBox=r,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,(n=this._userSize)!==null&&n!==void 0?n:this.widget.size,t)}_placeAtAnchor(e,t,n){var r;const o=Tp(this.getDomNode().ownerDocument.body),s=this.widget.getLayoutInfo(),a=new Kn(220,2*s.lineHeight),l=e.top,c=function(){const E=o.width-(e.left+e.width+s.borderWidth+s.horizontalPadding),D=-s.borderWidth+e.left+e.width,k=new Kn(E,o.height-e.top-s.borderHeight-s.verticalPadding),T=k.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:l,left:D,fit:E-t.width,maxSizeTop:k,maxSizeBottom:T,minSize:a.with(Math.min(E,a.width))}}(),u=function(){const E=e.left-s.borderWidth-s.horizontalPadding,D=Math.max(s.horizontalPadding,e.left-t.width-s.borderWidth),k=new Kn(E,o.height-e.top-s.borderHeight-s.verticalPadding),T=k.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:l,left:D,fit:E-t.width,maxSizeTop:k,maxSizeBottom:T,minSize:a.with(Math.min(E,a.width))}}(),d=function(){const E=e.left,D=-s.borderWidth+e.top+e.height,k=new Kn(e.width-s.borderHeight,o.height-e.top-e.height-s.verticalPadding);return{top:D,left:E,fit:k.height-t.height,maxSizeBottom:k,maxSizeTop:k,minSize:a.with(k.width)}}(),h=[c,u,d],f=(r=h.find(E=>E.fit>=0))!==null&&r!==void 0?r:h.sort((E,D)=>D.fit-E.fit)[0],g=e.top+e.height-s.borderHeight;let p,v=t.height;const m=Math.max(f.maxSizeTop.height,f.maxSizeBottom.height);v>m&&(v=m);let _;n?v<=f.maxSizeTop.height?(p=!0,_=f.maxSizeTop):(p=!1,_=f.maxSizeBottom):v<=f.maxSizeBottom.height?(p=!1,_=f.maxSizeBottom):(p=!0,_=f.maxSizeTop);let{top:y,left:S}=f;!p&&v>e.height&&(y=g-v);const L=this._editor.getDomNode();if(L){const E=L.getBoundingClientRect();y-=E.top,S-=E.left}this._applyTopLeft({left:S,top:y}),this._resizable.enableSashes(!p,f===c,p,f!==c),this._resizable.minSize=f.minSize,this._resizable.maxSize=_,this._resizable.layout(v,Math.min(_.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this._editor.layoutOverlayWidget(this)}}var xf;(function(i){i[i.FILE=0]="FILE",i[i.FOLDER=1]="FOLDER",i[i.ROOT_FOLDER=2]="ROOT_FOLDER"})(xf||(xf={}));const jst=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function u2(i,e,t,n,r){if(r)return[`codicon-${r.id}`,"predefined-file-icon"];const o=n===xf.ROOT_FOLDER?["rootfolder-icon"]:n===xf.FOLDER?["folder-icon"]:["file-icon"];if(t){let s;if(t.scheme===an.data)s=Zv.parseMetaData(t).get(Zv.META_DATA_LABEL);else{const a=t.path.match(jst);a?(s=d2(a[2].toLowerCase()),a[1]&&o.push(`${d2(a[1].toLowerCase())}-name-dir-icon`)):s=d2(t.authority.toLowerCase())}if(n===xf.ROOT_FOLDER)o.push(`${s}-root-name-folder-icon`);else if(n===xf.FOLDER)o.push(`${s}-name-folder-icon`);else{if(s){if(o.push(`${s}-name-file-icon`),o.push("name-file-icon"),s.length<=255){const l=s.split(".");for(let c=1;c=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},H9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},cm;function E1e(i){return`suggest-aria-id:${i}`}const qst=Mr("suggest-more-info",Xe.chevronRight,w("suggestMoreInfoIcon","Icon for more information in the suggest widget.")),Xst=new(cm=class{extract(e,t){if(e.textLabel.match(cm._regexStrict))return t[0]=e.textLabel,!0;if(e.completion.detail&&e.completion.detail.match(cm._regexStrict))return t[0]=e.completion.detail,!0;if(e.completion.documentation){const n=typeof e.completion.documentation=="string"?e.completion.documentation:e.completion.documentation.value,r=cm._regexRelaxed.exec(n);if(r&&(r.index===0||r.index+r[0].length===n.length))return t[0]=r[0],!0}return!1}},cm._regexRelaxed=/(#([\da-fA-F]{3}){1,2}|(rgb|hsl)a\(\s*(\d{1,3}%?\s*,\s*){3}(1|0?\.\d+)\)|(rgb|hsl)\(\s*\d{1,3}%?(\s*,\s*\d{1,3}%?){2}\s*\))/,cm._regexStrict=new RegExp(`^${cm._regexRelaxed.source}$`,"i"),cm);let TU=class{constructor(e,t,n,r){this._editor=e,this._modelService=t,this._languageService=n,this._themeService=r,this._onDidToggleDetails=new se,this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(e){const t=new Te,n=e;n.classList.add("show-file-icons");const r=ke(e,He(".icon")),o=ke(r,He("span.colorspan")),s=ke(e,He(".contents")),a=ke(s,He(".main")),l=ke(a,He(".icon-label.codicon")),c=ke(a,He("span.left")),u=ke(a,He("span.right")),d=new ZP(c,{supportHighlights:!0,supportIcons:!0});t.add(d);const h=ke(c,He("span.signature-label")),f=ke(c,He("span.qualifier-label")),g=ke(u,He("span.details-label")),p=ke(u,He("span.readMore"+Wt.asCSSSelector(qst)));return p.title=w("readMore","Read More"),{root:n,left:c,right:u,icon:r,colorspan:o,iconLabel:d,iconContainer:l,parametersLabel:h,qualifierLabel:f,detailsLabel:g,readMore:p,disposables:t,configureFont:()=>{const m=this._editor.getOptions(),_=m.get(50),y=_.getMassagedFontFamily(),S=_.fontFeatureSettings,L=m.get(119)||_.fontSize,E=m.get(120)||_.lineHeight,D=_.fontWeight,k=_.letterSpacing,T=`${L}px`,M=`${E}px`,A=`${k}px`;n.style.fontSize=T,n.style.fontWeight=D,n.style.letterSpacing=A,a.style.fontFamily=y,a.style.fontFeatureSettings=S,a.style.lineHeight=M,r.style.height=M,r.style.width=M,p.style.height=M,p.style.width=M}}}renderElement(e,t,n){n.configureFont();const{completion:r}=e;n.root.id=E1e(t),n.colorspan.style.backgroundColor="";const o={labelEscapeNewLines:!0,matches:qk(e.score)},s=[];if(r.kind===19&&Xst.extract(e,s))n.icon.className="icon customcolor",n.iconContainer.className="icon hide",n.colorspan.style.backgroundColor=s[0];else if(r.kind===20&&this._themeService.getFileIconTheme().hasFileIcons){n.icon.className="icon hide",n.iconContainer.className="icon hide";const a=u2(this._modelService,this._languageService,At.from({scheme:"fake",path:e.textLabel}),xf.FILE),l=u2(this._modelService,this._languageService,At.from({scheme:"fake",path:r.detail}),xf.FILE);o.extraClasses=a.length>l.length?a:l}else r.kind===23&&this._themeService.getFileIconTheme().hasFolderIcons?(n.icon.className="icon hide",n.iconContainer.className="icon hide",o.extraClasses=[u2(this._modelService,this._languageService,At.from({scheme:"fake",path:e.textLabel}),xf.FOLDER),u2(this._modelService,this._languageService,At.from({scheme:"fake",path:r.detail}),xf.FOLDER)].flat()):(n.icon.className="icon hide",n.iconContainer.className="",n.iconContainer.classList.add("suggest-icon",...Wt.asClassNameArray(SD.toIcon(r.kind))));r.tags&&r.tags.indexOf(1)>=0&&(o.extraClasses=(o.extraClasses||[]).concat(["deprecated"]),o.matches=[]),n.iconLabel.setLabel(e.textLabel,void 0,o),typeof r.label=="string"?(n.parametersLabel.textContent="",n.detailsLabel.textContent=V9(r.detail||""),n.root.classList.add("string-label")):(n.parametersLabel.textContent=V9(r.label.detail||""),n.detailsLabel.textContent=V9(r.label.description||""),n.root.classList.remove("string-label")),this._editor.getOption(118).showInlineDetails?bl(n.detailsLabel):fa(n.detailsLabel),aZ(e)?(n.right.classList.add("can-expand-details"),bl(n.readMore),n.readMore.onmousedown=a=>{a.stopPropagation(),a.preventDefault()},n.readMore.onclick=a=>{a.stopPropagation(),a.preventDefault(),this._onDidToggleDetails.fire()}):(n.right.classList.remove("can-expand-details"),fa(n.readMore),n.readMore.onmousedown=null,n.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};TU=Gst([H9(1,tr),H9(2,ji),H9(3,To)],TU);function V9(i){return i.replace(/\r\n|\r|\n/g,"")}var Yst=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},h2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},M1;X("editorSuggestWidget.background",{dark:Nr,light:Nr,hcDark:Nr,hcLight:Nr},w("editorSuggestWidgetBackground","Background color of the suggest widget."));X("editorSuggestWidget.border",{dark:Jg,light:Jg,hcDark:Jg,hcLight:Jg},w("editorSuggestWidgetBorder","Border color of the suggest widget."));const f2=X("editorSuggestWidget.foreground",{dark:Ku,light:Ku,hcDark:Ku,hcLight:Ku},w("editorSuggestWidgetForeground","Foreground color of the suggest widget."));X("editorSuggestWidget.selectedForeground",{dark:W0,light:W0,hcDark:W0,hcLight:W0},w("editorSuggestWidgetSelectedForeground","Foreground color of the selected entry in the suggest widget."));X("editorSuggestWidget.selectedIconForeground",{dark:sy,light:sy,hcDark:sy,hcLight:sy},w("editorSuggestWidgetSelectedIconForeground","Icon foreground color of the selected entry in the suggest widget."));const Zst=X("editorSuggestWidget.selectedBackground",{dark:$0,light:$0,hcDark:$0,hcLight:$0},w("editorSuggestWidgetSelectedBackground","Background color of the selected entry in the suggest widget."));X("editorSuggestWidget.highlightForeground",{dark:Gu,light:Gu,hcDark:Gu,hcLight:Gu},w("editorSuggestWidgetHighlightForeground","Color of the match highlights in the suggest widget."));X("editorSuggestWidget.focusHighlightForeground",{dark:cR,light:cR,hcDark:cR,hcLight:cR},w("editorSuggestWidgetFocusHighlightForeground","Color of the match highlights in the suggest widget when an item is focused."));X("editorSuggestWidgetStatus.foreground",{dark:It(f2,.5),light:It(f2,.5),hcDark:It(f2,.5),hcLight:It(f2,.5)},w("editorSuggestWidgetStatusForeground","Foreground color of the suggest widget status."));class Qst{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof o_}`}restore(){var e;const t=(e=this._service.get(this._key,0))!==null&&e!==void 0?e:"";try{const n=JSON.parse(t);if(Kn.is(n))return Kn.lift(n)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}let HI=M1=class{constructor(e,t,n,r,o){this.editor=e,this._storageService=t,this._state=0,this._isAuto=!1,this._pendingLayout=new Ho,this._pendingShowDetails=new Ho,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new cd,this._disposables=new Te,this._onDidSelect=new Lb,this._onDidFocus=new Lb,this._onDidHide=new se,this._onDidShow=new se,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new se,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new VY,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new Jst(this,e),this._persistedSize=new Qst(t,e);class s{constructor(f,g,p=!1,v=!1){this.persistedSize=f,this.currentSize=g,this.persistHeight=p,this.persistWidth=v}}let a;this._disposables.add(this.element.onDidWillResize(()=>{this._contentWidget.lockPreference(),a=new s(this._persistedSize.restore(),this.element.size)})),this._disposables.add(this.element.onDidResize(h=>{var f,g,p,v;if(this._resize(h.dimension.width,h.dimension.height),a&&(a.persistHeight=a.persistHeight||!!h.north||!!h.south,a.persistWidth=a.persistWidth||!!h.east||!!h.west),!!h.done){if(a){const{itemHeight:m,defaultSize:_}=this.getLayoutInfo(),y=Math.round(m/2);let{width:S,height:L}=this.element.size;(!a.persistHeight||Math.abs(a.currentSize.height-L)<=y)&&(L=(g=(f=a.persistedSize)===null||f===void 0?void 0:f.height)!==null&&g!==void 0?g:_.height),(!a.persistWidth||Math.abs(a.currentSize.width-S)<=y)&&(S=(v=(p=a.persistedSize)===null||p===void 0?void 0:p.width)!==null&&v!==void 0?v:_.width),this._persistedSize.store(new Kn(S,L))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=ke(this.element.domNode,He(".message")),this._listElement=ke(this.element.domNode,He(".tree"));const l=this._disposables.add(o.createInstance(kU,this.editor));l.onDidClose(this.toggleDetails,this,this._disposables),this._details=new Ust(l,this.editor);const c=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(118).showIcons);c();const u=o.createInstance(TU,this.editor);this._disposables.add(u),this._disposables.add(u.onDidToggleDetails(()=>this.toggleDetails())),this._list=new wc("SuggestWidget",this._listElement,{getHeight:h=>this.getLayoutInfo().itemHeight,getTemplateId:h=>"suggestion"},[u],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>"option",getWidgetAriaLabel:()=>w("suggest","Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:h=>{let f=h.textLabel;if(typeof h.completion.label!="string"){const{detail:m,description:_}=h.completion.label;m&&_?f=w("label.full","{0} {1}, {2}",f,m,_):m?f=w("label.detail","{0} {1}",f,m):_&&(f=w("label.desc","{0}, {1}",f,_))}if(!h.isResolved||!this._isDetailsVisible())return f;const{documentation:g,detail:p}=h.completion,v=Eb("{0}{1}",p||"",g?typeof g=="string"?g:g.value:"");return w("ariaCurrenttSuggestionReadDetails","{0}, docs: {1}",f,v)}}}),this._list.style(RS({listInactiveFocusBackground:Zst,listInactiveFocusOutline:zi})),this._status=o.createInstance(IU,this.element.domNode,Nv);const d=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(118).showStatusBar);d(),this._disposables.add(r.onDidColorThemeChange(h=>this._onThemeChange(h))),this._onThemeChange(r.getColorTheme()),this._disposables.add(this._list.onMouseDown(h=>this._onListMouseDownOrTap(h))),this._disposables.add(this._list.onTap(h=>this._onListMouseDownOrTap(h))),this._disposables.add(this._list.onDidChangeSelection(h=>this._onListSelection(h))),this._disposables.add(this._list.onDidChangeFocus(h=>this._onListFocus(h))),this._disposables.add(this.editor.onDidChangeCursorSelection(()=>this._onCursorSelectionChanged())),this._disposables.add(this.editor.onDidChangeConfiguration(h=>{h.hasChanged(118)&&(d(),c()),this._completionModel&&(h.hasChanged(50)||h.hasChanged(119)||h.hasChanged(120))&&this._list.splice(0,this._list.length,this._completionModel.items)})),this._ctxSuggestWidgetVisible=ln.Visible.bindTo(n),this._ctxSuggestWidgetDetailsVisible=ln.DetailsVisible.bindTo(n),this._ctxSuggestWidgetMultipleSuggestions=ln.MultipleSuggestions.bindTo(n),this._ctxSuggestWidgetHasFocusedSuggestion=ln.HasFocusedSuggestion.bindTo(n),this._disposables.add(Sr(this._details.widget.domNode,"keydown",h=>{this._onDetailsKeydown.fire(h)})),this._disposables.add(this.editor.onMouseDown(h=>this._onEditorMouseDown(h)))}dispose(){var e;this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),(e=this._loadingTimeout)===null||e===void 0||e.dispose(),this._pendingLayout.dispose(),this._pendingShowDetails.dispose(),this._showTimeout.dispose(),this._contentWidget.dispose(),this.element.dispose()}_onEditorMouseDown(e){this._details.widget.domNode.contains(e.target.element)?this._details.widget.domNode.focus():this.element.domNode.contains(e.target.element)&&this.editor.focus()}_onCursorSelectionChanged(){this._state!==0&&this._contentWidget.layout()}_onListMouseDownOrTap(e){typeof e.element>"u"||typeof e.index>"u"||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation(),this._select(e.element,e.index))}_onListSelection(e){e.elements.length&&this._select(e.elements[0],e.indexes[0])}_select(e,t){const n=this._completionModel;n&&(this._onDidSelect.fire({item:e,index:t,model:n}),this.editor.focus())}_onThemeChange(e){this._details.widget.borderWidth=ih(e.type)?2:1}_onListFocus(e){var t;if(this._ignoreFocusEvents)return;if(!e.elements.length){this._currentSuggestionDetails&&(this._currentSuggestionDetails.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=void 0),this.editor.setAriaOptions({activeDescendant:void 0}),this._ctxSuggestWidgetHasFocusedSuggestion.set(!1);return}if(!this._completionModel)return;this._ctxSuggestWidgetHasFocusedSuggestion.set(!0);const n=e.elements[0],r=e.indexes[0];n!==this._focusedItem&&((t=this._currentSuggestionDetails)===null||t===void 0||t.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=n,this._list.reveal(r),this._currentSuggestionDetails=Io(async o=>{const s=jv(()=>{this._isDetailsVisible()&&this.showDetails(!0)},250),a=o.onCancellationRequested(()=>s.dispose());try{return await n.resolve(o)}finally{s.dispose(),a.dispose()}}),this._currentSuggestionDetails.then(()=>{r>=this._list.length||n!==this._list.element(r)||(this._ignoreFocusEvents=!0,this._list.splice(r,1,[n]),this._list.setFocus([r]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this.showDetails(!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:E1e(r)}))}).catch(en)),this._onDidFocus.fire({item:n,index:r,model:this._completionModel})}_setState(e){if(this._state!==e)switch(this._state=e,this.element.domNode.classList.toggle("frozen",e===4),this.element.domNode.classList.remove("message"),e){case 0:fa(this._messageElement,this._listElement,this._status.element),this._details.hide(!0),this._status.hide(),this._contentWidget.hide(),this._ctxSuggestWidgetVisible.reset(),this._ctxSuggestWidgetMultipleSuggestions.reset(),this._ctxSuggestWidgetHasFocusedSuggestion.reset(),this._showTimeout.cancel(),this.element.domNode.classList.remove("visible"),this._list.splice(0,this._list.length),this._focusedItem=void 0,this._cappedHeight=void 0,this._explainMode=!1;break;case 1:this.element.domNode.classList.add("message"),this._messageElement.textContent=M1.LOADING_MESSAGE,fa(this._listElement,this._status.element),bl(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Hf(M1.LOADING_MESSAGE);break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=M1.NO_SUGGESTIONS_MESSAGE,fa(this._listElement,this._status.element),bl(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Hf(M1.NO_SUGGESTIONS_MESSAGE);break;case 3:fa(this._messageElement),bl(this._listElement,this._status.element),this._show();break;case 4:fa(this._messageElement),bl(this._listElement,this._status.element),this._show();break;case 5:fa(this._messageElement),bl(this._listElement,this._status.element),this._details.show(),this._show();break}}_show(){this._status.show(),this._contentWidget.show(),this._layout(this._persistedSize.restore()),this._ctxSuggestWidgetVisible.set(!0),this._showTimeout.cancelAndSet(()=>{this.element.domNode.classList.add("visible"),this._onDidShow.fire(this)},100)}showTriggered(e,t){this._state===0&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!e,this._isAuto||(this._loadingTimeout=jv(()=>this._setState(1),t)))}showSuggestions(e,t,n,r,o){var s,a;if(this._contentWidget.setPosition(this.editor.getPosition()),(s=this._loadingTimeout)===null||s===void 0||s.dispose(),(a=this._currentSuggestionDetails)===null||a===void 0||a.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),n&&this._state!==2&&this._state!==0){this._setState(4);return}const l=this._completionModel.items.length,c=l===0;if(this._ctxSuggestWidgetMultipleSuggestions.set(l>1),c){this._setState(r?0:2),this._completionModel=void 0;return}this._focusedItem=void 0,this._onDidFocus.pause(),this._onDidSelect.pause();try{this._list.splice(0,this._list.length,this._completionModel.items),this._setState(n?4:3),this._list.reveal(t,0),this._list.setFocus(o?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=KA(Pt(this.element.domNode),()=>{this._pendingLayout.clear(),this._layout(this.element.size),this._details.widget.domNode.classList.remove("focused")})}focusSelected(){this._list.length>0&&this._list.setFocus([0])}selectNextPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageDown(),!0;case 1:return!this._isAuto;default:return this._list.focusNextPage(),!0}}selectNext(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusNext(1,!0),!0}}selectLast(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollBottom(),!0;case 1:return!this._isAuto;default:return this._list.focusLast(),!0}}selectPreviousPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageUp(),!0;case 1:return!this._isAuto;default:return this._list.focusPreviousPage(),!0}}selectPrevious(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusPrevious(1,!0),!1}}selectFirst(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollTop(),!0;case 1:return!this._isAuto;default:return this._list.focusFirst(),!0}}getFocusedItem(){if(this._state!==0&&this._state!==2&&this._state!==1&&this._completionModel&&this._list.getFocus().length>0)return{item:this._list.getFocusedElements()[0],index:this._list.getFocus()[0],model:this._completionModel}}toggleDetailsFocus(){this._state===5?(this._setState(3),this._details.widget.domNode.classList.remove("focused")):this._state===3&&this._isDetailsVisible()&&(this._setState(5),this._details.widget.domNode.classList.add("focused"))}toggleDetails(){this._isDetailsVisible()?(this._pendingShowDetails.clear(),this._ctxSuggestWidgetDetailsVisible.set(!1),this._setDetailsVisible(!1),this._details.hide(),this.element.domNode.classList.remove("shows-details")):(aZ(this._list.getFocusedElements()[0])||this._explainMode)&&(this._state===3||this._state===5||this._state===4)&&(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this.showDetails(!1))}showDetails(e){this._pendingShowDetails.value=KA(Pt(this.element.domNode),()=>{this._pendingShowDetails.clear(),this._details.show(),e?this._details.widget.renderLoading():this._details.widget.renderItem(this._list.getFocusedElements()[0],this._explainMode),this._details.widget.isEmpty?this._details.hide():(this._positionDetails(),this.element.domNode.classList.add("shows-details")),this.editor.focus()})}toggleExplainMode(){this._list.getFocusedElements()[0]&&(this._explainMode=!this._explainMode,this._isDetailsVisible()?this.showDetails(!1):this.toggleDetails())}resetPersistedSize(){this._persistedSize.reset()}hideWidget(){var e;this._pendingLayout.clear(),this._pendingShowDetails.clear(),(e=this._loadingTimeout)===null||e===void 0||e.dispose(),this._setState(0),this._onDidHide.fire(this),this.element.clearSashHoverState();const t=this._persistedSize.restore(),n=Math.ceil(this.getLayoutInfo().itemHeight*4.3);t&&t.heightc&&(l=c);const u=this._completionModel?this._completionModel.stats.pLabelLen*s.typicalHalfwidthCharacterWidth:l,d=s.statusBarHeight+this._list.contentHeight+s.borderHeight,h=s.itemHeight+s.statusBarHeight,f=Br(this.editor.getDomNode()),g=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),p=f.top+g.top+g.height,v=Math.min(o.height-p-s.verticalPadding,d),m=f.top+g.top-s.verticalPadding,_=Math.min(m,d);let y=Math.min(Math.max(_,v)+s.borderHeight,d);a===((t=this._cappedHeight)===null||t===void 0?void 0:t.capped)&&(a=this._cappedHeight.wanted),ay&&(a=y);const S=150;a>v||this._forceRenderingAbove&&m>S?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),y=_):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),y=v),this.element.preferredSize=new Kn(u,s.defaultSize.height),this.element.maxSize=new Kn(c,y),this.element.minSize=new Kn(220,h),this._cappedHeight=a===d?{wanted:(r=(n=this._cappedHeight)===null||n===void 0?void 0:n.wanted)!==null&&r!==void 0?r:e.height,capped:a}:void 0}this._resize(l,a)}_resize(e,t){const{width:n,height:r}=this.element.maxSize;e=Math.min(n,e),t=Math.min(r,t);const{statusBarHeight:o}=this.getLayoutInfo();this._list.layout(t-o,e),this._listElement.style.height=`${t-o}px`,this.element.layout(t,e),this._contentWidget.layout(),this._positionDetails()}_positionDetails(){var e;this._isDetailsVisible()&&this._details.placeAtAnchor(this.element.domNode,((e=this._contentWidget.getPosition())===null||e===void 0?void 0:e.preference[0])===2)}getLayoutInfo(){const e=this.editor.getOption(50),t=da(this.editor.getOption(120)||e.lineHeight,8,1e3),n=!this.editor.getOption(118).showStatusBar||this._state===2||this._state===1?0:t,r=this._details.widget.borderWidth,o=2*r;return{itemHeight:t,statusBarHeight:n,borderWidth:r,borderHeight:o,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new Kn(430,n+12*t+o)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",0,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,0,0)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}};HI.LOADING_MESSAGE=w("suggestWidget.loading","Loading...");HI.NO_SUGGESTIONS_MESSAGE=w("suggestWidget.noSuggestions","No suggestions.");HI=M1=Yst([h2(1,dd),h2(2,Vt),h2(3,To),h2(4,Ot)],HI);class Jst{constructor(e,t){this._widget=e,this._editor=t,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._preferenceLocked=!1,this._added=!1,this._hidden=!1}dispose(){this._added&&(this._added=!1,this._editor.removeContentWidget(this))}getId(){return"editor.widget.suggestWidget"}getDomNode(){return this._widget.element.domNode}show(){this._hidden=!1,this._added||(this._added=!0,this._editor.addContentWidget(this))}hide(){this._hidden||(this._hidden=!0,this.layout())}layout(){this._editor.layoutContentWidget(this)}getPosition(){return this._hidden||!this._position||!this._preference?null:{position:this._position,preference:[this._preference]}}beforeRender(){const{height:e,width:t}=this._widget.element.size,{borderWidth:n,horizontalPadding:r}=this._widget.getLayoutInfo();return new Kn(t+2*n+r,e+2*n)}afterRender(e){this._widget._afterRender(e)}setPreference(e){this._preferenceLocked||(this._preference=e)}lockPreference(){this._preferenceLocked=!0}unlockPreference(){this._preferenceLocked=!1}setPosition(e){this._position=e}}var eat=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},a1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},NU;class tat{constructor(e,t){if(this._model=e,this._position=t,this._decorationOptions=sn.register({description:"suggest-line-suffix",stickiness:1}),e.getLineMaxColumn(t.lineNumber)!==t.column){const r=e.getOffsetAt(t),o=e.getPositionAt(r+1);e.changeDecorations(s=>{this._marker&&s.removeDecoration(this._marker),this._marker=s.addDecoration(B.fromPositions(t,o),this._decorationOptions)})}}dispose(){this._marker&&!this._model.isDisposed()&&this._model.changeDecorations(e=>{e.removeDecoration(this._marker),this._marker=void 0})}delta(e){if(this._model.isDisposed()||this._position.lineNumber!==e.lineNumber)return 0;if(this._marker){const t=this._model.getDecorationRange(this._marker);return this._model.getOffsetAt(t.getStartPosition())-this._model.getOffsetAt(e)}else return this._model.getLineMaxColumn(e.lineNumber)-e.column}}let Xu=NU=class{static get(e){return e.getContribution(NU.ID)}constructor(e,t,n,r,o,s,a){this._memoryService=t,this._commandService=n,this._contextKeyService=r,this._instantiationService=o,this._logService=s,this._telemetryService=a,this._lineSuffix=new Ho,this._toDispose=new Te,this._selectors=new nat(d=>d.priority),this._onWillInsertSuggestItem=new se,this.onWillInsertSuggestItem=this._onWillInsertSuggestItem.event,this.editor=e,this.model=o.createInstance(IO,this.editor),this._selectors.register({priority:0,select:(d,h,f)=>this._memoryService.select(d,h,f)});const l=ln.InsertMode.bindTo(r);l.set(e.getOption(118).insertMode),this._toDispose.add(this.model.onDidTrigger(()=>l.set(e.getOption(118).insertMode))),this.widget=this._toDispose.add(new s6(Pt(e.getDomNode()),()=>{const d=this._instantiationService.createInstance(HI,this.editor);this._toDispose.add(d),this._toDispose.add(d.onDidSelect(v=>this._insertSuggestion(v,0),this));const h=new Ost(this.editor,d,this.model,v=>this._insertSuggestion(v,2));this._toDispose.add(h);const f=ln.MakesTextEdit.bindTo(this._contextKeyService),g=ln.HasInsertAndReplaceRange.bindTo(this._contextKeyService),p=ln.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(Rt(()=>{f.reset(),g.reset(),p.reset()})),this._toDispose.add(d.onDidFocus(({item:v})=>{const m=this.editor.getPosition(),_=v.editStart.column,y=m.column;let S=!0;this.editor.getOption(1)==="smart"&&this.model.state===2&&!v.completion.additionalTextEdits&&!(v.completion.insertTextRules&4)&&y-_===v.completion.insertText.length&&(S=this.editor.getModel().getValueInRange({startLineNumber:m.lineNumber,startColumn:_,endLineNumber:m.lineNumber,endColumn:y})!==v.completion.insertText),f.set(S),g.set(!ae.equals(v.editInsertEnd,v.editReplaceEnd)),p.set(!!v.provider.resolveCompletionItem||!!v.completion.documentation||v.completion.detail!==v.completion.label)})),this._toDispose.add(d.onDetailsKeyDown(v=>{if(v.toKeyCodeChord().equals(new kp(!0,!1,!1,!1,33))||Ln&&v.toKeyCodeChord().equals(new kp(!1,!1,!1,!0,33))){v.stopPropagation();return}v.toKeyCodeChord().isModifierKey()||this.editor.focus()})),d})),this._overtypingCapturer=this._toDispose.add(new s6(Pt(e.getDomNode()),()=>this._toDispose.add(new Q3(this.editor,this.model)))),this._alternatives=this._toDispose.add(new s6(Pt(e.getDomNode()),()=>this._toDispose.add(new Xb(this.editor,this._contextKeyService)))),this._toDispose.add(o.createInstance($I,e)),this._toDispose.add(this.model.onDidTrigger(d=>{this.widget.value.showTriggered(d.auto,d.shy?250:50),this._lineSuffix.value=new tat(this.editor.getModel(),d.position)})),this._toDispose.add(this.model.onDidSuggest(d=>{if(d.triggerOptions.shy)return;let h=-1;for(const g of this._selectors.itemsOrderedByPriorityDesc)if(h=g.select(this.editor.getModel(),this.editor.getPosition(),d.completionModel.items),h!==-1)break;if(h===-1&&(h=0),this.model.state===0)return;let f=!1;if(d.triggerOptions.auto){const g=this.editor.getOption(118);g.selectionMode==="never"||g.selectionMode==="always"?f=g.selectionMode==="never":g.selectionMode==="whenTriggerCharacter"?f=d.triggerOptions.triggerKind!==1:g.selectionMode==="whenQuickSuggestion"&&(f=d.triggerOptions.triggerKind===1&&!d.triggerOptions.refilter)}this.widget.value.showSuggestions(d.completionModel,h,d.isFrozen,d.triggerOptions.auto,f)})),this._toDispose.add(this.model.onDidCancel(d=>{d.retrigger||this.widget.value.hideWidget()})),this._toDispose.add(this.editor.onDidBlurEditorWidget(()=>{this.model.cancel(),this.model.clear()}));const c=ln.AcceptSuggestionsOnEnter.bindTo(r),u=()=>{const d=this.editor.getOption(1);c.set(d==="on"||d==="smart")};this._toDispose.add(this.editor.onDidChangeConfiguration(()=>u())),u()}dispose(){this._alternatives.dispose(),this._toDispose.dispose(),this.widget.dispose(),this.model.dispose(),this._lineSuffix.dispose(),this._onWillInsertSuggestItem.dispose()}_insertSuggestion(e,t){if(!e||!e.item){this._alternatives.value.reset(),this.model.cancel(),this.model.clear();return}if(!this.editor.hasModel())return;const n=ns.get(this.editor);if(!n)return;this._onWillInsertSuggestItem.fire({item:e.item});const r=this.editor.getModel(),o=r.getAlternativeVersionId(),{item:s}=e,a=[],l=new wr;t&1||this.editor.pushUndoStop();const c=this.getOverwriteInfo(s,!!(t&8));this._memoryService.memorize(r,this.editor.getPosition(),s);const u=s.isResolved;let d=-1,h=-1;if(Array.isArray(s.completion.additionalTextEdits)){this.model.cancel();const g=_h.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",s.completion.additionalTextEdits.map(p=>{let v=B.lift(p.range);if(v.startLineNumber===s.position.lineNumber&&v.startColumn>s.position.column){const m=this.editor.getPosition().column-s.position.column,_=m,y=B.spansMultipleLines(v)?0:m;v=new B(v.startLineNumber,v.startColumn+_,v.endLineNumber,v.endColumn+y)}return Xi.replaceMove(v,p.text)})),g.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!u){const g=new Ms;let p;const v=r.onDidChangeContent(S=>{if(S.isFlush){l.cancel(),v.dispose();return}for(const L of S.changes){const E=B.getEndPosition(L.range);(!p||ae.isBefore(E,p))&&(p=E)}}),m=t;t|=2;let _=!1;const y=this.editor.onWillType(()=>{y.dispose(),_=!0,m&2||this.editor.pushUndoStop()});a.push(s.resolve(l.token).then(()=>{if(!s.completion.additionalTextEdits||l.token.isCancellationRequested)return;if(p&&s.completion.additionalTextEdits.some(L=>ae.isBefore(p,B.getStartPosition(L.range))))return!1;_&&this.editor.pushUndoStop();const S=_h.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",s.completion.additionalTextEdits.map(L=>Xi.replaceMove(B.lift(L.range),L.text))),S.restoreRelativeVerticalPositionOfCursor(this.editor),(_||!(m&2))&&this.editor.pushUndoStop(),!0}).then(S=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",g.elapsed(),S),h=S===!0?1:S===!1?0:-2}).finally(()=>{v.dispose(),y.dispose()}))}let{insertText:f}=s.completion;if(s.completion.insertTextRules&4||(f=Hb.escape(f)),this.model.cancel(),n.insert(f,{overwriteBefore:c.overwriteBefore,overwriteAfter:c.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(s.completion.insertTextRules&1),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),t&2||this.editor.pushUndoStop(),s.completion.command)if(s.completion.command.id===mT.id)this.model.trigger({auto:!0,retrigger:!0});else{const g=new Ms;a.push(this._commandService.executeCommand(s.completion.command.id,...s.completion.command.arguments?[...s.completion.command.arguments]:[]).catch(p=>{s.completion.extensionId?Zr(p):en(p)}).finally(()=>{d=g.elapsed()}))}t&4&&this._alternatives.value.set(e,g=>{for(l.cancel();r.canUndo();){o!==r.getAlternativeVersionId()&&r.undo(),this._insertSuggestion(g,3|(t&8?8:0));break}}),this._alertCompletionItem(s),Promise.all(a).finally(()=>{this._reportSuggestionAcceptedTelemetry(s,r,u,d,h),this.model.clear(),l.dispose()})}_reportSuggestionAcceptedTelemetry(e,t,n,r,o){var s,a,l;Math.floor(Math.random()*100)!==0&&this._telemetryService.publicLog2("suggest.acceptedSuggestion",{extensionId:(a=(s=e.extensionId)===null||s===void 0?void 0:s.value)!==null&&a!==void 0?a:"unknown",providerId:(l=e.provider._debugDisplayName)!==null&&l!==void 0?l:"unknown",kind:e.completion.kind,basenameHash:l4(su(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:Cze(t.uri),resolveInfo:e.provider.resolveCompletionItem?n?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:r,additionalEditsAsync:o})}getOverwriteInfo(e,t){Xn(this.editor.hasModel());let n=this.editor.getOption(118).insertMode==="replace";t&&(n=!n);const r=e.position.column-e.editStart.column,o=(n?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column,s=this.editor.getPosition().column-e.position.column,a=this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0;return{overwriteBefore:r+s,overwriteAfter:o+a}}_alertCompletionItem(e){if(Ts(e.completion.additionalTextEdits)){const t=w("aria.alert.snippet","Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);kl(t)}}triggerSuggest(e,t,n){this.editor.hasModel()&&(this.model.trigger({auto:t??!1,completionOptions:{providerFilter:e,kindFilter:n?new Set:void 0}}),this.editor.revealPosition(this.editor.getPosition(),0),this.editor.focus())}triggerSuggestAndAcceptBest(e){if(!this.editor.hasModel())return;const t=this.editor.getPosition(),n=()=>{t.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},r=o=>{if(o.completion.insertTextRules&4||o.completion.additionalTextEdits)return!0;const s=this.editor.getPosition(),a=o.editStart.column,l=s.column;return l-a!==o.completion.insertText.length?!0:this.editor.getModel().getValueInRange({startLineNumber:s.lineNumber,startColumn:a,endLineNumber:s.lineNumber,endColumn:l})!==o.completion.insertText};Je.once(this.model.onDidTrigger)(o=>{const s=[];Je.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{si(s),n()},void 0,s),this.model.onDidSuggest(({completionModel:a})=>{if(si(s),a.items.length===0){n();return}const l=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),a.items),c=a.items[l];if(!r(c)){n();return}this.editor.pushUndoStop(),this._insertSuggestion({index:l,item:c,model:a},7)},void 0,s)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,0),this.editor.focus()}acceptSelectedSuggestion(e,t){const n=this.widget.value.getFocusedItem();let r=0;e&&(r|=4),t&&(r|=8),this._insertSuggestion(n,r)}acceptNextSuggestion(){this._alternatives.value.next()}acceptPrevSuggestion(){this._alternatives.value.prev()}cancelSuggestWidget(){this.model.cancel(),this.model.clear(),this.widget.value.hideWidget()}focusSuggestion(){this.widget.value.focusSelected()}selectNextSuggestion(){this.widget.value.selectNext()}selectNextPageSuggestion(){this.widget.value.selectNextPage()}selectLastSuggestion(){this.widget.value.selectLast()}selectPrevSuggestion(){this.widget.value.selectPrevious()}selectPrevPageSuggestion(){this.widget.value.selectPreviousPage()}selectFirstSuggestion(){this.widget.value.selectFirst()}toggleSuggestionDetails(){this.widget.value.toggleDetails()}toggleExplainMode(){this.widget.value.toggleExplainMode()}toggleSuggestionFocus(){this.widget.value.toggleDetailsFocus()}resetWidgetSize(){this.widget.value.resetPersistedSize()}forceRenderingAbove(){this.widget.value.forceRenderingAbove()}stopForceRenderingAbove(){this.widget.isInitialized&&this.widget.value.stopForceRenderingAbove()}registerSelector(e){return this._selectors.register(e)}};Xu.ID="editor.contrib.suggestController";Xu=NU=eat([a1(1,Z3),a1(2,sr),a1(3,Vt),a1(4,Ot),a1(5,Ta),a1(6,ea)],Xu);class nat{constructor(e){this.prioritySelector=e,this._items=new Array}register(e){if(this._items.indexOf(e)!==-1)throw new Error("Value is already registered");return this._items.push(e),this._items.sort((t,n)=>this.prioritySelector(n)-this.prioritySelector(t)),{dispose:()=>{const t=this._items.indexOf(e);t>=0&&this._items.splice(t,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}class mT extends gt{constructor(){super({id:mT.id,label:w("suggest.trigger.label","Trigger Suggest"),alias:"Trigger Suggest",precondition:De.and(j.writable,j.hasCompletionItemProvider,ln.Visible.toNegated()),kbOpts:{kbExpr:j.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t,n){const r=Xu.get(t);if(!r)return;let o;n&&typeof n=="object"&&n.auto===!0&&(o=!0),r.triggerSuggest(void 0,o,void 0)}}mT.id="editor.action.triggerSuggest";jn(Xu.ID,Xu,2);Be(mT);const _c=100+90,Ma=Vo.bindToContribution(Xu.get);et(new Ma({id:"acceptSelectedSuggestion",precondition:De.and(ln.Visible,ln.HasFocusedSuggestion),handler(i){i.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:2,kbExpr:De.and(ln.Visible,j.textInputFocus),weight:_c},{primary:3,kbExpr:De.and(ln.Visible,j.textInputFocus,ln.AcceptSuggestionsOnEnter,ln.MakesTextEdit),weight:_c}],menuOpts:[{menuId:Nv,title:w("accept.insert","Insert"),group:"left",order:1,when:ln.HasInsertAndReplaceRange.toNegated()},{menuId:Nv,title:w("accept.insert","Insert"),group:"left",order:1,when:De.and(ln.HasInsertAndReplaceRange,ln.InsertMode.isEqualTo("insert"))},{menuId:Nv,title:w("accept.replace","Replace"),group:"left",order:1,when:De.and(ln.HasInsertAndReplaceRange,ln.InsertMode.isEqualTo("replace"))}]}));et(new Ma({id:"acceptAlternativeSelectedSuggestion",precondition:De.and(ln.Visible,j.textInputFocus,ln.HasFocusedSuggestion),kbOpts:{weight:_c,kbExpr:j.textInputFocus,primary:1027,secondary:[1026]},handler(i){i.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:Nv,group:"left",order:2,when:De.and(ln.HasInsertAndReplaceRange,ln.InsertMode.isEqualTo("insert")),title:w("accept.replace","Replace")},{menuId:Nv,group:"left",order:2,when:De.and(ln.HasInsertAndReplaceRange,ln.InsertMode.isEqualTo("replace")),title:w("accept.insert","Insert")}]}));Dn.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");et(new Ma({id:"hideSuggestWidget",precondition:ln.Visible,handler:i=>i.cancelSuggestWidget(),kbOpts:{weight:_c,kbExpr:j.textInputFocus,primary:9,secondary:[1033]}}));et(new Ma({id:"selectNextSuggestion",precondition:De.and(ln.Visible,De.or(ln.MultipleSuggestions,ln.HasFocusedSuggestion.negate())),handler:i=>i.selectNextSuggestion(),kbOpts:{weight:_c,kbExpr:j.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}}));et(new Ma({id:"selectNextPageSuggestion",precondition:De.and(ln.Visible,De.or(ln.MultipleSuggestions,ln.HasFocusedSuggestion.negate())),handler:i=>i.selectNextPageSuggestion(),kbOpts:{weight:_c,kbExpr:j.textInputFocus,primary:12,secondary:[2060]}}));et(new Ma({id:"selectLastSuggestion",precondition:De.and(ln.Visible,De.or(ln.MultipleSuggestions,ln.HasFocusedSuggestion.negate())),handler:i=>i.selectLastSuggestion()}));et(new Ma({id:"selectPrevSuggestion",precondition:De.and(ln.Visible,De.or(ln.MultipleSuggestions,ln.HasFocusedSuggestion.negate())),handler:i=>i.selectPrevSuggestion(),kbOpts:{weight:_c,kbExpr:j.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}}));et(new Ma({id:"selectPrevPageSuggestion",precondition:De.and(ln.Visible,De.or(ln.MultipleSuggestions,ln.HasFocusedSuggestion.negate())),handler:i=>i.selectPrevPageSuggestion(),kbOpts:{weight:_c,kbExpr:j.textInputFocus,primary:11,secondary:[2059]}}));et(new Ma({id:"selectFirstSuggestion",precondition:De.and(ln.Visible,De.or(ln.MultipleSuggestions,ln.HasFocusedSuggestion.negate())),handler:i=>i.selectFirstSuggestion()}));et(new Ma({id:"focusSuggestion",precondition:De.and(ln.Visible,ln.HasFocusedSuggestion.negate()),handler:i=>i.focusSuggestion(),kbOpts:{weight:_c,kbExpr:j.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}}}));et(new Ma({id:"focusAndAcceptSuggestion",precondition:De.and(ln.Visible,ln.HasFocusedSuggestion.negate()),handler:i=>{i.focusSuggestion(),i.acceptSelectedSuggestion(!0,!1)}}));et(new Ma({id:"toggleSuggestionDetails",precondition:De.and(ln.Visible,ln.HasFocusedSuggestion),handler:i=>i.toggleSuggestionDetails(),kbOpts:{weight:_c,kbExpr:j.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:Nv,group:"right",order:1,when:De.and(ln.DetailsVisible,ln.CanResolve),title:w("detail.more","show less")},{menuId:Nv,group:"right",order:1,when:De.and(ln.DetailsVisible.toNegated(),ln.CanResolve),title:w("detail.less","show more")}]}));et(new Ma({id:"toggleExplainMode",precondition:ln.Visible,handler:i=>i.toggleExplainMode(),kbOpts:{weight:100,primary:2138}}));et(new Ma({id:"toggleSuggestionFocus",precondition:ln.Visible,handler:i=>i.toggleSuggestionFocus(),kbOpts:{weight:_c,kbExpr:j.textInputFocus,primary:2570,mac:{primary:778}}}));et(new Ma({id:"insertBestCompletion",precondition:De.and(j.textInputFocus,De.equals("config.editor.tabCompletion","on"),$I.AtEnd,ln.Visible.toNegated(),Xb.OtherSuggestions.toNegated(),ns.InSnippetMode.toNegated()),handler:(i,e)=>{i.triggerSuggestAndAcceptBest(va(e)?{fallback:"tab",...e}:{fallback:"tab"})},kbOpts:{weight:_c,primary:2}}));et(new Ma({id:"insertNextSuggestion",precondition:De.and(j.textInputFocus,De.equals("config.editor.tabCompletion","on"),Xb.OtherSuggestions,ln.Visible.toNegated(),ns.InSnippetMode.toNegated()),handler:i=>i.acceptNextSuggestion(),kbOpts:{weight:_c,kbExpr:j.textInputFocus,primary:2}}));et(new Ma({id:"insertPrevSuggestion",precondition:De.and(j.textInputFocus,De.equals("config.editor.tabCompletion","on"),Xb.OtherSuggestions,ln.Visible.toNegated(),ns.InSnippetMode.toNegated()),handler:i=>i.acceptPrevSuggestion(),kbOpts:{weight:_c,kbExpr:j.textInputFocus,primary:1026}}));Be(class extends gt{constructor(){super({id:"editor.action.resetSuggestSize",label:w("suggest.reset.label","Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(i,e){var t;(t=Xu.get(e))===null||t===void 0||t.resetWidgetSize()}});class iat extends fe{get selectedItem(){return this._selectedItem}constructor(e,t,n,r){super(),this.editor=e,this.suggestControllerPreselector=t,this.checkModelVersion=n,this.onWillAccept=r,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._selectedItem=Hn(this,void 0),this._register(e.onKeyDown(s=>{s.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))})),this._register(e.onKeyUp(s=>{s.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))}));const o=Xu.get(this.editor);if(o){this._register(o.registerSelector({priority:100,select:(l,c,u)=>{var d;Ri(m=>this.checkModelVersion(m));const h=this.editor.getModel();if(!h)return-1;const f=(d=this.suggestControllerPreselector())===null||d===void 0?void 0:d.removeCommonPrefix(h);if(!f)return-1;const g=ae.lift(c),p=u.map((m,_)=>{const S=OE.fromSuggestion(o,h,g,m,this.isShiftKeyPressed).toSingleTextEdit().removeCommonPrefix(h),L=f.augments(S);return{index:_,valid:L,prefixLength:S.text.length,suggestItem:m}}).filter(m=>m&&m.valid&&m.prefixLength>0),v=Bq(p,Jc(m=>m.prefixLength,dp));return v?v.index:-1}}));let s=!1;const a=()=>{s||(s=!0,this._register(o.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})),this._register(o.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.update(!1)})),this._register(o.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})))};this._register(Je.once(o.model.onDidTrigger)(l=>{a()})),this._register(o.onWillInsertSuggestItem(l=>{const c=this.editor.getPosition(),u=this.editor.getModel();if(!c||!u)return;const d=OE.fromSuggestion(o,u,c,l.item,this.isShiftKeyPressed);this.onWillAccept(d)}))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();(this._isActive!==e||!rat(this._currentSuggestItemInfo,t))&&(this._isActive=e,this._currentSuggestItemInfo=t,Ri(n=>{this.checkModelVersion(n),this._selectedItem.set(this._isActive?this._currentSuggestItemInfo:void 0,n)}))}getSuggestItemInfo(){const e=Xu.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem(),n=this.editor.getPosition(),r=this.editor.getModel();if(!(!t||!n||!r))return OE.fromSuggestion(e,r,n,t.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){const e=Xu.get(this.editor);e==null||e.stopForceRenderingAbove()}forceRenderingAbove(){const e=Xu.get(this.editor);e==null||e.forceRenderingAbove()}}class OE{static fromSuggestion(e,t,n,r,o){let{insertText:s}=r.completion,a=!1;if(r.completion.insertTextRules&4){const c=new Hb().parse(s);c.children.length<100&&DO.adjustWhitespace(t,n,!0,c),s=c.toString(),a=!0}const l=e.getOverwriteInfo(r,o);return new OE(B.fromPositions(n.delta(0,-l.overwriteBefore),n.delta(0,Math.max(l.overwriteAfter,0))),s,r.completion.kind,a)}constructor(e,t,n,r){this.range=e,this.insertText=t,this.completionItemKind=n,this.isSnippetText=r}equals(e){return this.range.equalsRange(e.range)&&this.insertText===e.insertText&&this.completionItemKind===e.completionItemKind&&this.isSnippetText===e.isSnippetText}toSelectedSuggestionInfo(){return new Tpe(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}toSingleTextEdit(){return new d_(this.range,this.insertText)}}function rat(i,e){return i===e?!0:!i||!e?!1:i.equals(e)}var oat=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},um=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},RU;let bc=RU=class extends fe{static get(e){return e.getContribution(RU.ID)}constructor(e,t,n,r,o,s,a,l,c){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=n,this._configurationService=r,this._commandService=o,this._debounceService=s,this._languageFeaturesService=a,this._accessibilitySignalService=l,this._keybindingService=c,this.model=this._register(yI("inlineCompletionModel",void 0)),this._textModelVersionId=Hn(this,-1),this._positions=Hn(this,[new ae(1,1)]),this._suggestWidgetAdaptor=this._register(new iat(this.editor,()=>{var f,g;return(g=(f=this.model.get())===null||f===void 0?void 0:f.selectedInlineCompletion.get())===null||g===void 0?void 0:g.toSingleTextEdit(void 0)},f=>this.updateObservables(f,ql.Other),f=>{Ri(g=>{var p;this.updateObservables(g,ql.Other),(p=this.model.get())===null||p===void 0||p.handleSuggestAccepted(f)})})),this._enabled=Vi(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).enabled),this._fontFamily=Vi(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).fontFamily),this._ghostTexts=Yt(this,f=>{var g;const p=this.model.read(f);return(g=p==null?void 0:p.ghostTexts.read(f))!==null&&g!==void 0?g:[]}),this._stablizedGhostTexts=sat(this._ghostTexts,this._store),this._ghostTextWidgets=VZe(this,this._stablizedGhostTexts,(f,g)=>g.add(this._instantiationService.createInstance(SU,this.editor,{ghostText:f,minReservedLineCount:ap(0),targetTextModel:this.model.map(p=>p==null?void 0:p.textModel)}))).recomputeInitiallyAndOnChange(this._store),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this._playAccessibilitySignal=pY(this),this._isReadonly=Vi(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(91)),this._textModel=Vi(this.editor.onDidChangeModel,()=>this.editor.getModel()),this._textModelIfWritable=Yt(f=>this._isReadonly.read(f)?void 0:this._textModel.read(f)),this._register(new $o(this._contextKeyService,this.model)),this._register(bn(f=>{const g=this._textModelIfWritable.read(f);Ri(p=>{if(this.model.set(void 0,p),this.updateObservables(p,ql.Other),g){const v=t.createInstance(LU,g,this._suggestWidgetAdaptor.selectedItem,this._textModelVersionId,this._positions,this._debounceValue,Vi(e.onDidChangeConfiguration,()=>e.getOption(118).preview),Vi(e.onDidChangeConfiguration,()=>e.getOption(118).previewMode),Vi(e.onDidChangeConfiguration,()=>e.getOption(62).mode),this._enabled);this.model.set(v,p)}})}));const u=this._register(sme());this._register(bn(f=>{const g=this._fontFamily.read(f);u.setStyle(g===""||g==="default"?"":` .monaco-editor .ghost-text-decoration, .monaco-editor .ghost-text-decoration-preview, .monaco-editor .ghost-text { font-family: ${g}; -}`)}));const d=f=>{var g;return f.isUndoing?ql.Undo:f.isRedoing?ql.Redo:!((g=this.model.get())===null||g===void 0)&&g.isAcceptingPartially?ql.AcceptWord:ql.Other};this._register(e.onDidChangeModelContent(f=>Ri(g=>this.updateObservables(g,d(f))))),this._register(e.onDidChangeCursorPosition(f=>Ri(g=>{var p;this.updateObservables(g,ql.Other),(f.reason===3||f.source==="api")&&((p=this.model.get())===null||p===void 0||p.stop(g))}))),this._register(e.onDidType(()=>Ri(f=>{var g;this.updateObservables(f,ql.Other),this._enabled.get()&&((g=this.model.get())===null||g===void 0||g.trigger(f))}))),this._register(this._commandService.onDidExecuteCommand(f=>{new Set([Vy.Tab.id,Vy.DeleteLeft.id,Vy.DeleteRight.id,jCe,"acceptSelectedSuggestion"]).has(f.commandId)&&e.hasTextFocus()&&this._enabled.get()&&Ri(p=>{var v;(v=this.model.get())===null||v===void 0||v.trigger(p)})})),this._register(this.editor.onDidBlurEditorWidget(()=>{this._contextKeyService.getContextKeyValue("accessibleViewIsShown")||this._configurationService.getValue("editor.inlineSuggest.keepOnBlur")||e.getOption(62).keepOnBlur||u_.dropDownVisible||Ri(f=>{var g;(g=this.model.get())===null||g===void 0||g.stop(f)})})),this._register(bn(f=>{var g;const p=(g=this.model.read(f))===null||g===void 0?void 0:g.state.read(f);p!=null&&p.suggestItem?p.primaryGhostText.lineCount>=2&&this._suggestWidgetAdaptor.forceRenderingAbove():this._suggestWidgetAdaptor.stopForceRenderingAbove()})),this._register(Rt(()=>{this._suggestWidgetAdaptor.stopForceRenderingAbove()}));let h;this._register(rT({handleChange:(f,g)=>(f.didChange(this._playAccessibilitySignal)&&(h=void 0),!0)},async f=>{this._playAccessibilitySignal.read(f);const g=this.model.read(f),p=g==null?void 0:g.state.read(f);if(!g||!p||!p.inlineCompletion){h=void 0;return}if(p.inlineCompletion.semanticId!==h){h=p.inlineCompletion.semanticId;const v=g.textModel.getLineContent(p.primaryGhostText.lineNumber);this._accessibilitySignalService.playSignal(cn.inlineSuggestion).then(()=>{this.editor.getOption(8)&&this.provideScreenReaderUpdate(p.primaryGhostText.renderForScreenReader(v))})}})),this._register(new oU(this.editor,this.model,this._instantiationService)),this._register(this._configurationService.onDidChangeConfiguration(f=>{f.affectsConfiguration("accessibility.verbosity.inlineCompletions")&&this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")})})),this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")})}playAccessibilitySignal(e){this._playAccessibilitySignal.trigger(e)}provideScreenReaderUpdate(e){const t=this._contextKeyService.getContextKeyValue("accessibleViewIsShown"),n=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let r;!t&&n&&this.editor.getOption(148)&&(r=w("showAccessibleViewHint","Inspect this in the accessible view ({0})",n.getAriaLabel())),kl(r?e+", "+r:e)}updateObservables(e,t){var n,r,o;const s=this.editor.getModel();this._textModelVersionId.set((n=s==null?void 0:s.getVersionId())!==null&&n!==void 0?n:-1,e,t),this._positions.set((o=(r=this.editor.getSelections())===null||r===void 0?void 0:r.map(a=>a.getPosition()))!==null&&o!==void 0?o:[new ae(1,1)],e)}shouldShowHoverAt(e){var t;const n=(t=this.model.get())===null||t===void 0?void 0:t.primaryGhostText.get();return n?n.parts.some(r=>e.containsPosition(new ae(n.lineNumber,r.column))):!1}shouldShowHoverAtViewZone(e){var t,n;return(n=(t=this._ghostTextWidgets.get()[0])===null||t===void 0?void 0:t.ownsViewZone(e))!==null&&n!==void 0?n:!1}};bc.ID="editor.contrib.inlineCompletionsController";bc=RU=oat([cm(1,Ot),cm(2,Vt),cm(3,gn),cm(4,sr),cm(5,gu),cm(6,_t),cm(7,M_),cm(8,ci)],bc);function sat(i,e){const t=Hn("result",[]),n=[];return e.add(bn(r=>{const o=i.read(r);Ri(s=>{if(o.length!==n.length){n.length=o.length;for(let a=0;aa.set(o[l],s))})})),t}class J3 extends gt{constructor(){super({id:J3.ID,label:w("action.inlineSuggest.showNext","Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:De.and(j.writable,$o.inlineSuggestionVisible),kbOpts:{weight:100,primary:606}})}async run(e,t){var n;const r=bc.get(t);(n=r==null?void 0:r.model.get())===null||n===void 0||n.next()}}J3.ID=GCe;class e5 extends gt{constructor(){super({id:e5.ID,label:w("action.inlineSuggest.showPrevious","Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:De.and(j.writable,$o.inlineSuggestionVisible),kbOpts:{weight:100,primary:604}})}async run(e,t){var n;const r=bc.get(t);(n=r==null?void 0:r.model.get())===null||n===void 0||n.previous()}}e5.ID=KCe;class aat extends gt{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:w("action.inlineSuggest.trigger","Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:j.writable})}async run(e,t){const n=bc.get(t);await OZe(async r=>{var o;await((o=n==null?void 0:n.model.get())===null||o===void 0?void 0:o.triggerExplicitly(r)),n==null||n.playAccessibilitySignal(r)})}}class lat extends gt{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:w("action.inlineSuggest.acceptNextWord","Accept Next Word Of Inline Suggestion"),alias:"Accept Next Word Of Inline Suggestion",precondition:De.and(j.writable,$o.inlineSuggestionVisible),kbOpts:{weight:100+1,primary:2065,kbExpr:De.and(j.writable,$o.inlineSuggestionVisible)},menuOpts:[{menuId:$.InlineSuggestionToolbar,title:w("acceptWord","Accept Word"),group:"primary",order:2}]})}async run(e,t){var n;const r=bc.get(t);await((n=r==null?void 0:r.model.get())===null||n===void 0?void 0:n.acceptNextWord(r.editor))}}class cat extends gt{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:w("action.inlineSuggest.acceptNextLine","Accept Next Line Of Inline Suggestion"),alias:"Accept Next Line Of Inline Suggestion",precondition:De.and(j.writable,$o.inlineSuggestionVisible),kbOpts:{weight:100+1},menuOpts:[{menuId:$.InlineSuggestionToolbar,title:w("acceptLine","Accept Line"),group:"secondary",order:2}]})}async run(e,t){var n;const r=bc.get(t);await((n=r==null?void 0:r.model.get())===null||n===void 0?void 0:n.acceptNextLine(r.editor))}}class uat extends gt{constructor(){super({id:jCe,label:w("action.inlineSuggest.accept","Accept Inline Suggestion"),alias:"Accept Inline Suggestion",precondition:$o.inlineSuggestionVisible,menuOpts:[{menuId:$.InlineSuggestionToolbar,title:w("accept","Accept"),group:"primary",order:1}],kbOpts:{primary:2,weight:200,kbExpr:De.and($o.inlineSuggestionVisible,j.tabMovesFocus.toNegated(),$o.inlineSuggestionHasIndentationLessThanTabSize,ln.Visible.toNegated(),j.hoverFocused.toNegated())}})}async run(e,t){var n;const r=bc.get(t);r&&((n=r.model.get())===null||n===void 0||n.accept(r.editor),r.editor.focus())}}class t5 extends gt{constructor(){super({id:t5.ID,label:w("action.inlineSuggest.hide","Hide Inline Suggestion"),alias:"Hide Inline Suggestion",precondition:$o.inlineSuggestionVisible,kbOpts:{weight:100,primary:9}})}async run(e,t){const n=bc.get(t);Ri(r=>{var o;(o=n==null?void 0:n.model.get())===null||o===void 0||o.stop(r)})}}t5.ID="editor.action.inlineSuggest.hide";class n5 extends sl{constructor(){super({id:n5.ID,title:w("action.inlineSuggest.alwaysShowToolbar","Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:$.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:De.equals("config.editor.inlineSuggest.showToolbar","always")})}async run(e,t){const n=e.get(gn),o=n.getValue("editor.inlineSuggest.showToolbar")==="always"?"onHover":"always";n.updateValue("editor.inlineSuggest.showToolbar",o)}}n5.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar";var dat=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},tL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class hat{constructor(e,t,n){this.owner=e,this.range=t,this.controller=n}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let MU=class{constructor(e,t,n,r,o,s){this._editor=e,this._languageService=t,this._openerService=n,this.accessibilityService=r,this._instantiationService=o,this._telemetryService=s,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=bc.get(this._editor);if(!t)return null;const n=e.target;if(n.type===8){const r=n.detail;if(t.shouldShowHoverAtViewZone(r.viewZoneId))return new ub(1e3,this,B.fromPositions(this._editor.getModel().validatePosition(r.positionBefore||r.position)),e.event.posx,e.event.posy,!1)}return n.type===7&&t.shouldShowHoverAt(n.range)?new ub(1e3,this,n.range,e.event.posx,e.event.posy,!1):n.type===6&&n.detail.mightBeForeignElement&&t.shouldShowHoverAt(n.range)?new ub(1e3,this,n.range,e.event.posx,e.event.posy,!1):null}computeSync(e,t){if(this._editor.getOption(62).showToolbar!=="onHover")return[];const n=bc.get(this._editor);return n&&n.shouldShowHoverAt(e.range)?[new hat(this,e.range,n)]:[]}renderHoverParts(e,t){const n=new Te,r=t[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(8)&&this.renderScreenReaderText(e,r,n);const o=r.controller.model.get(),s=this._instantiationService.createInstance(u_,this._editor,!1,ap(null),o.selectedInlineCompletionIndex,o.inlineCompletionsCount,o.selectedInlineCompletion.map(a=>{var l;return(l=a==null?void 0:a.inlineCompletion.source.inlineCompletions.commands)!==null&&l!==void 0?l:[]}));return e.fragment.appendChild(s.getDomNode()),o.triggerExplicitly(),n.add(s),n}renderScreenReaderText(e,t,n){const r=He,o=r("div.hover-row.markdown-hover"),s=ke(o,r("div.hover-contents",{["aria-live"]:"assertive"})),a=n.add(new Uf({editor:this._editor},this._languageService,this._openerService)),l=c=>{n.add(a.onDidRenderAsync(()=>{s.className="hover-contents code-hover-contents",e.onContentsChanged()}));const u=w("inlineSuggestionFollows","Suggestion:"),d=n.add(a.render(new Is().appendText(u).appendCodeblock("text",c)));s.replaceChildren(d.element)};n.add(bn(c=>{var u;const d=(u=t.controller.model.read(c))===null||u===void 0?void 0:u.primaryGhostText.read(c);if(d){const h=this._editor.getModel().getLineContent(d.lineNumber);l(d.renderForScreenReader(h))}else gs(s)})),e.fragment.appendChild(o)}};MU=dat([tL(1,ji),tL(2,al),tL(3,ud),tL(4,Ot),tL(5,ea)],MU);jn(bc.ID,bc,3);Be(aat);Be(J3);Be(e5);Be(lat);Be(cat);Be(uat);Be(t5);Ei(n5);P_.register(MU);function vl(i,e){let t=0;for(let n=0;n=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},gat=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};function D1e(i,e,t,n,r){if(i.getLineCount()===1&&i.getLineMaxColumn(1)===1)return[];const o=e.getLanguageConfiguration(i.getLanguageId()).indentationRules;if(!o)return[];for(n=Math.min(n,i.getLineCount());t<=n&&o.unIndentedLinePattern;){const v=i.getLineContent(t);if(!o.unIndentedLinePattern.test(v))break;t++}if(t>n-1)return[];const{tabSize:s,indentSize:a,insertSpaces:l}=i.getOptions(),c=(v,m)=>(m=m||1,jc.shiftIndent(v,v.length+m,s,a,l)),u=(v,m)=>(m=m||1,jc.unshiftIndent(v,v.length+m,s,a,l)),d=[];let h;const f=i.getLineContent(t);let g=f;if(r!=null){h=r;const v=bi(f);g=h+f.substring(v.length),o.decreaseIndentPattern&&o.decreaseIndentPattern.test(g)&&(h=u(h),g=h+f.substring(v.length)),f!==g&&d.push(Xi.replaceMove(new yt(t,1,t,v.length+1),cP(h,a,l)))}else h=bi(f);let p=h;o.increaseIndentPattern&&o.increaseIndentPattern.test(g)?(p=c(p),h=c(h)):o.indentNextLinePattern&&o.indentNextLinePattern.test(g)&&(p=c(p)),t++;for(let v=t;v<=n;v++){const m=i.getLineContent(v),_=bi(m),y=p+m.substring(_.length);o.decreaseIndentPattern&&o.decreaseIndentPattern.test(y)&&(p=u(p),h=u(h)),_!==p&&d.push(Xi.replaceMove(new yt(v,1,v,_.length+1),cP(p,a,l))),!(o.unIndentedLinePattern&&o.unIndentedLinePattern.test(m))&&(o.increaseIndentPattern&&o.increaseIndentPattern.test(y)?(h=c(h),p=h):o.indentNextLinePattern&&o.indentNextLinePattern.test(y)?p=c(p):p=h)}return d}class i5 extends gt{constructor(){super({id:i5.ID,label:w("indentationToSpaces","Convert Indentation to Spaces"),alias:"Convert Indentation to Spaces",precondition:j.writable})}run(e,t){const n=t.getModel();if(!n)return;const r=n.getOptions(),o=t.getSelection();if(!o)return;const s=new _at(o,r.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop(),n.updateOptions({insertSpaces:!0})}}i5.ID="editor.action.indentationToSpaces";class r5 extends gt{constructor(){super({id:r5.ID,label:w("indentationToTabs","Convert Indentation to Tabs"),alias:"Convert Indentation to Tabs",precondition:j.writable})}run(e,t){const n=t.getModel();if(!n)return;const r=n.getOptions(),o=t.getSelection();if(!o)return;const s=new bat(o,r.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop(),n.updateOptions({insertSpaces:!1})}}r5.ID="editor.action.indentationToTabs";class lZ extends gt{constructor(e,t,n){super(n),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const n=e.get(Eh),r=e.get(tr),o=t.getModel();if(!o)return;const s=r.getCreationOptions(o.getLanguageId(),o.uri,o.isForSimpleWidget),a=o.getOptions(),l=[1,2,3,4,5,6,7,8].map(u=>({id:u.toString(),label:u.toString(),description:u===s.tabSize&&u===a.tabSize?w("configuredTabSize","Configured Tab Size"):u===s.tabSize?w("defaultTabSize","Default Tab Size"):u===a.tabSize?w("currentTabSize","Current Tab Size"):void 0})),c=Math.min(o.getOptions().tabSize-1,7);setTimeout(()=>{n.pick(l,{placeHolder:w({key:"selectTabWidth",comment:["Tab corresponds to the tab key"]},"Select Tab Size for Current File"),activeItem:l[c]}).then(u=>{if(u&&o&&!o.isDisposed()){const d=parseInt(u.label,10);this.displaySizeOnly?o.updateOptions({tabSize:d}):o.updateOptions({tabSize:d,indentSize:d,insertSpaces:this.insertSpaces})}})},50)}}class o5 extends lZ{constructor(){super(!1,!1,{id:o5.ID,label:w("indentUsingTabs","Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0})}}o5.ID="editor.action.indentUsingTabs";class s5 extends lZ{constructor(){super(!0,!1,{id:s5.ID,label:w("indentUsingSpaces","Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0})}}s5.ID="editor.action.indentUsingSpaces";class a5 extends lZ{constructor(){super(!0,!0,{id:a5.ID,label:w("changeTabDisplaySize","Change Tab Display Size"),alias:"Change Tab Display Size",precondition:void 0})}}a5.ID="editor.action.changeTabDisplaySize";class l5 extends gt{constructor(){super({id:l5.ID,label:w("detectIndentation","Detect Indentation from Content"),alias:"Detect Indentation from Content",precondition:void 0})}run(e,t){const n=e.get(tr),r=t.getModel();if(!r)return;const o=n.getCreationOptions(r.getLanguageId(),r.uri,r.isForSimpleWidget);r.detectIndentation(o.insertSpaces,o.tabSize)}}l5.ID="editor.action.detectIndentation";class pat extends gt{constructor(){super({id:"editor.action.reindentlines",label:w("editor.reindentlines","Reindent Lines"),alias:"Reindent Lines",precondition:j.writable})}run(e,t){const n=e.get(Di),r=t.getModel();if(!r)return;const o=D1e(r,n,1,r.getLineCount());o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}}class mat extends gt{constructor(){super({id:"editor.action.reindentselectedlines",label:w("editor.reindentselectedlines","Reindent Selected Lines"),alias:"Reindent Selected Lines",precondition:j.writable})}run(e,t){const n=e.get(Di),r=t.getModel();if(!r)return;const o=t.getSelections();if(o===null)return;const s=[];for(const a of o){let l=a.startLineNumber,c=a.endLineNumber;if(l!==c&&a.endColumn===1&&c--,l===1){if(l===c)continue}else l--;const u=D1e(r,n,l,c);s.push(...u)}s.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop())}}class vat{constructor(e,t){this._initialSelection=t,this._edits=[],this._selectionId=null;for(const n of e)n.range&&typeof n.text=="string"&&this._edits.push(n)}getEditOperations(e,t){for(const r of this._edits)t.addEditOperation(B.lift(r.range),r.text);let n=!1;Array.isArray(this._edits)&&this._edits.length===1&&this._initialSelection.isEmpty()&&(this._edits[0].range.startColumn===this._initialSelection.endColumn&&this._edits[0].range.startLineNumber===this._initialSelection.endLineNumber?(n=!0,this._selectionId=t.trackSelection(this._initialSelection,!0)):this._edits[0].range.endColumn===this._initialSelection.startColumn&&this._edits[0].range.endLineNumber===this._initialSelection.startLineNumber&&(n=!0,this._selectionId=t.trackSelection(this._initialSelection,!1))),n||(this._selectionId=t.trackSelection(this._initialSelection))}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}let VI=class{constructor(e,t){this.editor=e,this._languageConfigurationService=t,this.callOnDispose=new Te,this.callOnModel=new Te,this.callOnDispose.add(e.onDidChangeConfiguration(()=>this.update())),this.callOnDispose.add(e.onDidChangeModel(()=>this.update())),this.callOnDispose.add(e.onDidChangeModelLanguage(()=>this.update()))}update(){this.callOnModel.clear(),!(this.editor.getOption(12)<4||this.editor.getOption(55))&&this.editor.hasModel()&&this.callOnModel.add(this.editor.onDidPaste(({range:e})=>{this.trigger(e)}))}trigger(e){const t=this.editor.getSelections();if(t===null||t.length>1)return;const n=this.editor.getModel();if(!n||!n.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const r=this.editor.getOption(12),{tabSize:o,indentSize:s,insertSpaces:a}=n.getOptions(),l=[],c={shiftIndent:f=>jc.shiftIndent(f,f.length+1,o,s,a),unshiftIndent:f=>jc.unshiftIndent(f,f.length+1,o,s,a)};let u=e.startLineNumber;for(;u<=e.endLineNumber;){if(this.shouldIgnoreLine(n,u)){u++;continue}break}if(u>e.endLineNumber)return;let d=n.getLineContent(u);if(!/\S/.test(d.substring(0,e.startColumn-1))){const f=gE(r,n,n.getLanguageId(),u,c,this._languageConfigurationService);if(f!==null){const g=bi(d),p=vl(f,o),v=vl(g,o);if(p!==v){const m=FE(p,o,a);l.push({range:new B(u,1,u,g.length+1),text:m}),d=m+d.substr(g.length)}else{const m=Ive(n,u,this._languageConfigurationService);if(m===0||m===8)return}}}const h=u;for(;un.tokenization.getLineTokens(p),getLanguageId:()=>n.getLanguageId(),getLanguageIdAtPosition:(p,v)=>n.getLanguageIdAtPosition(p,v)},getLineContent:p=>p===h?d:n.getLineContent(p)},n.getLanguageId(),u+1,c,this._languageConfigurationService);if(g!==null){const p=vl(g,o),v=vl(bi(n.getLineContent(u+1)),o);if(p!==v){const m=p-v;for(let _=u+1;_<=e.endLineNumber;_++){const y=n.getLineContent(_),S=bi(y),E=vl(S,o)+m,D=FE(E,o,a);D!==S&&l.push({range:new B(_,1,_,S.length+1),text:D})}}}}if(l.length>0){this.editor.pushUndoStop();const f=new vat(l,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",f),this.editor.pushUndoStop()}}shouldIgnoreLine(e,t){e.tokenization.forceTokenization(t);const n=e.getLineFirstNonWhitespaceColumn(t);if(n===0)return!0;const r=e.tokenization.getLineTokens(t);if(r.getCount()>0){const o=r.findTokenIndexAtOffset(n);if(o>=0&&r.getStandardTokenType(o)===1)return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}};VI.ID="editor.contrib.autoIndentOnPaste";VI=fat([gat(1,Di)],VI);function I1e(i,e,t,n){if(i.getLineCount()===1&&i.getLineMaxColumn(1)===1)return;let r="";for(let s=0;sthis._currentResolve=void 0)),await this._currentResolve}}async _doResolve(e){var t,n,r;try{const o=await Promise.resolve(this.provider.resolveInlayHint(this.hint,e));this.hint.tooltip=(t=o==null?void 0:o.tooltip)!==null&&t!==void 0?t:this.hint.tooltip,this.hint.label=(n=o==null?void 0:o.label)!==null&&n!==void 0?n:this.hint.label,this.hint.textEdits=(r=o==null?void 0:o.textEdits)!==null&&r!==void 0?r:this.hint.textEdits,this._isResolved=!0}catch(o){Zr(o),this._isResolved=!1}}}class fb{static async create(e,t,n,r){const o=[],s=e.ordered(t).reverse().map(a=>n.map(async l=>{try{const c=await a.provideInlayHints(t,l,r);(c!=null&&c.hints.length||a.onDidChangeInlayHints)&&o.push([c??fb._emptyInlayHintList,a])}catch(c){Zr(c)}}));if(await Promise.all(s.flat()),r.isCancellationRequested||t.isDisposed())throw new L_;return new fb(n,o,t)}constructor(e,t,n){this._disposables=new Te,this.ranges=e,this.provider=new Set;const r=[];for(const[o,s]of t){this._disposables.add(o),this.provider.add(s);for(const a of o.hints){const l=n.validatePosition(a.position);let c="before";const u=fb._getRangeAtPosition(n,l);let d;u.getStartPosition().isBefore(l)?(d=B.fromPositions(u.getStartPosition(),l),c="after"):(d=B.fromPositions(l,u.getEndPosition()),c="before"),r.push(new cZ(a,new k1e(d,c),s))}}this.items=r.sort((o,s)=>ae.compare(o.hint.position,s.hint.position))}dispose(){this._disposables.dispose()}static _getRangeAtPosition(e,t){const n=t.lineNumber,r=e.getWordAtPosition(t);if(r)return new B(n,r.startColumn,n,r.endColumn);e.tokenization.tokenizeIfCheap(n);const o=e.tokenization.getLineTokens(n),s=t.column-1,a=o.findTokenIndexAtOffset(s);let l=o.getStartOffset(a),c=o.getEndOffset(a);return c-l===1&&(l===s&&a>1?(l=o.getStartOffset(a-1),c=o.getEndOffset(a-1)):c===s&&aty(g)?g.command.id:T3()));for(const g of Gs.all())h.has(g.desc.id)&&d.push(new xl(g.desc.id,pc.label(g.desc,{renderShortTitle:!0}),void 0,!0,async()=>{const p=await o.createModelReference(u.uri);try{const v=new eS(p.object.textEditorModel,B.getStartPosition(u.range)),m=n.item.anchor.range;await l.invokeFunction(g.runEditorCommand.bind(g),e,v,m)}finally{p.dispose()}}));if(n.part.command){const{command:g}=n.part;d.push(new lo),d.push(new xl(g.id,g.title,void 0,!0,async()=>{var p;try{await a.executeCommand(g.id,...(p=g.arguments)!==null&&p!==void 0?p:[])}catch(v){c.notify({severity:j4.Error,source:n.item.provider.displayName,message:v})}}))}const f=e.getOption(127);s.showContextMenu({domForShadowRoot:f&&(r=e.getDomNode())!==null&&r!==void 0?r:void 0,getAnchor:()=>{const g=Br(t);return{x:g.left,y:g.top+g.height+8}},getActions:()=>d,onHide:()=>{e.focus()},autoSelectFirstItem:!0})}async function T1e(i,e,t,n){const o=await i.get(ol).createModelReference(n.uri);await t.invokeWithinContext(async s=>{const a=e.hasSideBySideModifier,l=s.get(Vt),c=il.inPeekEditor.getValue(l),u=!a&&t.getOption(88)&&!c;return new gT({openToSide:a,openInPeek:u,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(s,new eS(o.object.textEditorModel,B.getStartPosition(n.range)),B.lift(n.range))}),o.dispose()}var wat=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},l1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},A1;class kO{constructor(){this._entries=new D_(50)}get(e){const t=kO._key(e);return this._entries.get(t)}set(e,t){const n=kO._key(e);this._entries.set(n,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}const N1e=yn("IInlayHintsCache");In(N1e,kO,1);class AU{constructor(e,t){this.item=e,this.index=t}get part(){const e=this.item.hint.label;return typeof e=="string"?{label:e}:e[this.index]}}class Sat{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}let f_=A1=class{static get(e){var t;return(t=e.getContribution(A1.ID))!==null&&t!==void 0?t:void 0}constructor(e,t,n,r,o,s,a){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=r,this._commandService=o,this._notificationService=s,this._instaService=a,this._disposables=new Te,this._sessionDisposables=new Te,this._decorationsMetadata=new Map,this._ruleFactory=new Wk(this._editor),this._activeRenderMode=0,this._debounceInfo=n.for(t.inlayHintsProvider,"InlayHint",{min:25}),this._disposables.add(t.inlayHintsProvider.onDidChange(()=>this._update())),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(l=>{l.hasChanged(140)&&this._update()})),this._update()}dispose(){this._sessionDisposables.dispose(),this._removeAllDecorations(),this._disposables.dispose()}_update(){this._sessionDisposables.clear(),this._removeAllDecorations();const e=this._editor.getOption(140);if(e.enabled==="off")return;const t=this._editor.getModel();if(!t||!this._languageFeaturesService.inlayHintsProvider.has(t))return;if(e.enabled==="on")this._activeRenderMode=0;else{let a,l;e.enabled==="onUnlessPressed"?(a=0,l=1):(a=1,l=0),this._activeRenderMode=a,this._sessionDisposables.add(Xg.getInstance().event(c=>{if(!this._editor.hasModel())return;const u=c.altKey&&c.ctrlKey&&!(c.shiftKey||c.metaKey)?l:a;if(u!==this._activeRenderMode){this._activeRenderMode=u;const d=this._editor.getModel(),h=this._copyInlayHintsWithCurrentAnchor(d);this._updateHintsDecorators([d.getFullModelRange()],h),s.schedule(0)}}))}const n=this._inlayHintsCache.get(t);n&&this._updateHintsDecorators([t.getFullModelRange()],n),this._sessionDisposables.add(Rt(()=>{t.isDisposed()||this._cacheHintsForFastRestore(t)}));let r;const o=new Set,s=new pi(async()=>{const a=Date.now();r==null||r.dispose(!0),r=new wr;const l=t.onWillDispose(()=>r==null?void 0:r.cancel());try{const c=r.token,u=await fb.create(this._languageFeaturesService.inlayHintsProvider,t,this._getHintsRanges(),c);if(s.delay=this._debounceInfo.update(t,Date.now()-a),c.isCancellationRequested){u.dispose();return}for(const d of u.provider)typeof d.onDidChangeInlayHints=="function"&&!o.has(d)&&(o.add(d),this._sessionDisposables.add(d.onDidChangeInlayHints(()=>{s.isScheduled()||s.schedule()})));this._sessionDisposables.add(u),this._updateHintsDecorators(u.ranges,u.items),this._cacheHintsForFastRestore(t)}catch(c){en(c)}finally{r.dispose(),l.dispose()}},this._debounceInfo.get(t));this._sessionDisposables.add(s),this._sessionDisposables.add(Rt(()=>r==null?void 0:r.dispose(!0))),s.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange(a=>{(a.scrollTopChanged||!s.isScheduled())&&s.schedule()})),this._sessionDisposables.add(this._editor.onDidChangeModelContent(a=>{r==null||r.cancel();const l=Math.max(s.delay,1250);s.schedule(l)})),this._sessionDisposables.add(this._installDblClickGesture(()=>s.schedule(0))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const e=new Te,t=e.add(new M3(this._editor)),n=new Te;return e.add(n),e.add(t.onMouseMoveOrRelevantKeyDown(r=>{const[o]=r,s=this._getInlayHintLabelPart(o),a=this._editor.getModel();if(!s||!a){n.clear();return}const l=new wr;n.add(Rt(()=>l.dispose(!0))),s.item.resolve(l.token),this._activeInlayHintPart=s.part.command||s.part.location?new Sat(s,o.hasTriggerModifier):void 0;const c=a.validatePosition(s.item.hint.position).lineNumber,u=new B(c,1,c,a.getLineMaxColumn(c)),d=this._getInlineHintsForRange(u);this._updateHintsDecorators([u],d),n.add(Rt(()=>{this._activeInlayHintPart=void 0,this._updateHintsDecorators([u],d)}))})),e.add(t.onCancel(()=>n.clear())),e.add(t.onExecute(async r=>{const o=this._getInlayHintLabelPart(r);if(o){const s=o.part;s.location?this._instaService.invokeFunction(T1e,r,this._editor,s.location):u$.is(s.command)&&await this._invokeCommand(s.command,o.item)}})),e}_getInlineHintsForRange(e){const t=new Set;for(const n of this._decorationsMetadata.values())e.containsRange(n.item.anchor.range)&&t.add(n.item);return Array.from(t)}_installDblClickGesture(e){return this._editor.onMouseUp(async t=>{if(t.event.detail!==2)return;const n=this._getInlayHintLabelPart(t);if(n&&(t.event.preventDefault(),await n.item.resolve(Cn.None),Ts(n.item.hint.textEdits))){const r=n.item.hint.textEdits.map(o=>Xi.replace(B.lift(o.range),o.text));this._editor.executeEdits("inlayHint.default",r),e()}})}_installContextMenu(){return this._editor.onContextMenu(async e=>{if(!(e.event.target instanceof HTMLElement))return;const t=this._getInlayHintLabelPart(e);t&&await this._instaService.invokeFunction(yat,this._editor,e.event.target,t)})}_getInlayHintLabelPart(e){var t;if(e.target.type!==6)return;const n=(t=e.target.detail.injectedText)===null||t===void 0?void 0:t.options;if(n instanceof e_&&(n==null?void 0:n.attachedData)instanceof AU)return n.attachedData}async _invokeCommand(e,t){var n;try{await this._commandService.executeCommand(e.id,...(n=e.arguments)!==null&&n!==void 0?n:[])}catch(r){this._notificationService.notify({severity:j4.Error,source:t.provider.displayName,message:r})}}_cacheHintsForFastRestore(e){const t=this._copyInlayHintsWithCurrentAnchor(e);this._inlayHintsCache.set(e,t)}_copyInlayHintsWithCurrentAnchor(e){const t=new Map;for(const[n,r]of this._decorationsMetadata){if(t.has(r.item))continue;const o=e.getDecorationRange(n);if(o){const s=new k1e(o,r.item.anchor.direction),a=r.item.with({anchor:s});t.set(r.item,a)}}return Array.from(t.values())}_getHintsRanges(){const t=this._editor.getModel(),n=this._editor.getVisibleRangesPlusViewportAboveBelow(),r=[];for(const o of n.sort(B.compareRangesUsingStarts)){const s=t.validateRange(new B(o.startLineNumber-30,o.startColumn,o.endLineNumber+30,o.endColumn));r.length===0||!B.areIntersectingOrTouching(r[r.length-1],s)?r.push(s):r[r.length-1]=B.plusRange(r[r.length-1],s)}return r}_updateHintsDecorators(e,t){var n,r;const o=[],s=(v,m,_,y,S)=>{const L={content:_,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:m.className,cursorStops:y,attachedData:S};o.push({item:v,classNameRef:m,decoration:{range:v.anchor.range,options:{description:"InlayHint",showIfCollapsed:v.anchor.range.isEmpty(),collapseOnReplaceEdit:!v.anchor.range.isEmpty(),stickiness:0,[v.anchor.direction]:this._activeRenderMode===0?L:void 0}}})},a=(v,m)=>{const _=this._ruleFactory.createClassNameRef({width:`${l/3|0}px`,display:"inline-block"});s(v,_," ",m?ju.Right:ju.None)},{fontSize:l,fontFamily:c,padding:u,isUniform:d}=this._getLayoutInfo(),h="--code-editorInlayHintsFontFamily";this._editor.getContainerDomNode().style.setProperty(h,c);let f={line:0,totalLen:0};for(const v of t){if(f.line!==v.anchor.range.startLineNumber&&(f={line:v.anchor.range.startLineNumber,totalLen:0}),f.totalLen>A1._MAX_LABEL_LEN)continue;v.hint.paddingLeft&&a(v,!1);const m=typeof v.hint.label=="string"?[{label:v.hint.label}]:v.hint.label;for(let _=0;_0&&(D=D.slice(0,-T)+"…",k=!0),s(v,this._ruleFactory.createClassNameRef(E),xat(D),L&&!v.hint.paddingRight?ju.Right:ju.None,new AU(v,_)),k)break}if(v.hint.paddingRight&&a(v,!0),o.length>A1._MAX_DECORATORS)break}const g=[];for(const[v,m]of this._decorationsMetadata){const _=(r=this._editor.getModel())===null||r===void 0?void 0:r.getDecorationRange(v);_&&e.some(y=>y.containsRange(_))&&(g.push(v),m.classNameRef.dispose(),this._decorationsMetadata.delete(v))}const p=_h.capture(this._editor);this._editor.changeDecorations(v=>{const m=v.deltaDecorations(g,o.map(_=>_.decoration));for(let _=0;_n)&&(o=n);const s=e.fontFamily||r;return{fontSize:o,fontFamily:s,padding:t,isUniform:!t&&s===r&&o===n}}_removeAllDecorations(){this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));for(const e of this._decorationsMetadata.values())e.classNameRef.dispose();this._decorationsMetadata.clear()}};f_.ID="editor.contrib.InlayHints";f_._MAX_DECORATORS=1500;f_._MAX_LABEL_LEN=43;f_=A1=wat([l1(1,_t),l1(2,gu),l1(3,N1e),l1(4,sr),l1(5,$r),l1(6,Ot)],f_);function xat(i){const e=" ";return i.replace(/[ \t]/g,e)}Dn.registerCommand("_executeInlayHintProvider",async(i,...e)=>{const[t,n]=e;Xn(At.isUri(t)),Xn(B.isIRange(n));const{inlayHintsProvider:r}=i.get(_t),o=await i.get(ol).createModelReference(t);try{const s=await fb.create(r,o.object.textEditorModel,[B.lift(n)],Cn.None),a=s.items.map(l=>l.hint);return setTimeout(()=>s.dispose(),0),a}finally{o.dispose()}});var Lat=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},nL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class wle extends ub{constructor(e,t,n,r){super(10,t,e.item.anchor.range,n,r,!0),this.part=e}}let PU=class extends bO{constructor(e,t,n,r,o,s){super(e,t,n,r,s),this._resolverService=o,this.hoverOrdinal=6}suggestHoverAnchor(e){var t;if(!f_.get(this._editor)||e.target.type!==6)return null;const r=(t=e.target.detail.injectedText)===null||t===void 0?void 0:t.options;return r instanceof e_&&r.attachedData instanceof AU?new wle(r.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,t,n){return e instanceof wle?new Kr(async r=>{const{part:o}=e;if(await o.item.resolve(n),n.isCancellationRequested)return;let s;typeof o.item.hint.tooltip=="string"?s=new Is().appendText(o.item.hint.tooltip):o.item.hint.tooltip&&(s=o.item.hint.tooltip),s&&r.emitOne(new jd(this,e.range,[s],!1,0)),Ts(o.item.hint.textEdits)&&r.emitOne(new jd(this,e.range,[new Is().appendText(w("hint.dbl","Double-click to insert"))],!1,10001));let a;if(typeof o.part.tooltip=="string"?a=new Is().appendText(o.part.tooltip):o.part.tooltip&&(a=o.part.tooltip),a&&r.emitOne(new jd(this,e.range,[a],!1,1)),o.part.location||o.part.command){let c;const d=this._editor.getOption(78)==="altKey"?Ln?w("links.navigate.kb.meta.mac","cmd + click"):w("links.navigate.kb.meta","ctrl + click"):Ln?w("links.navigate.kb.alt.mac","option + click"):w("links.navigate.kb.alt","alt + click");o.part.location&&o.part.command?c=new Is().appendText(w("hint.defAndCommand","Go to Definition ({0}), right click for more",d)):o.part.location?c=new Is().appendText(w("hint.def","Go to Definition ({0})",d)):o.part.command&&(c=new Is(`[${w("hint.cmd","Execute Command")}](${Cat(o.part.command)} "${o.part.command.title}") (${d})`,{isTrusted:!0})),c&&r.emitOne(new jd(this,e.range,[c],!1,1e4))}const l=await this._resolveInlayHintLabelPartHover(o,n);for await(const c of l)r.emitOne(c)}):Kr.EMPTY}async _resolveInlayHintLabelPartHover(e,t){if(!e.part.location)return Kr.EMPTY;const{uri:n,range:r}=e.part.location,o=await this._resolverService.createModelReference(n);try{const s=o.object.textEditorModel;return this._languageFeaturesService.hoverProvider.has(s)?UY(this._languageFeaturesService.hoverProvider,s,new ae(r.startLineNumber,r.startColumn),t).filter(a=>!Hw(a.hover.contents)).map(a=>new jd(this,e.item.anchor.range,a.hover.contents,!1,2+a.ordinal)):Kr.EMPTY}finally{o.dispose()}}};PU=Lat([nL(1,ji),nL(2,al),nL(3,gn),nL(4,ol),nL(5,_t)],PU);jn(f_.ID,f_,1);P_.register(PU);class Eat{constructor(e,t,n){this._editRange=e,this._originalSelection=t,this._text=n}getEditOperations(e,t){t.addTrackedEditOperation(this._editRange,this._text)}computeCursorState(e,t){const r=t.getInverseEditOperations()[0].range;return this._originalSelection.isEmpty()?new yt(r.endLineNumber,Math.min(this._originalSelection.positionColumn,r.endColumn),r.endLineNumber,Math.min(this._originalSelection.positionColumn,r.endColumn)):new yt(r.endLineNumber,r.endColumn-this._text.length,r.endLineNumber,r.endColumn)}}var Dat=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Iat=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},HM;let g_=HM=class{static get(e){return e.getContribution(HM.ID)}constructor(e,t){this.editor=e,this.editorWorkerService=t,this.decorations=this.editor.createDecorationsCollection()}dispose(){}run(e,t){var n;(n=this.currentRequest)===null||n===void 0||n.cancel();const r=this.editor.getSelection(),o=this.editor.getModel();if(!o||!r)return;let s=r;if(s.startLineNumber!==s.endLineNumber)return;const a=new tbe(this.editor,5),l=o.uri;return this.editorWorkerService.canNavigateValueSet(l)?(this.currentRequest=Io(c=>this.editorWorkerService.navigateValueSet(l,s,t)),this.currentRequest.then(c=>{var u;if(!c||!c.range||!c.value||!a.validate(this.editor))return;const d=B.lift(c.range);let h=c.range;const f=c.value.length-(s.endColumn-s.startColumn);h={startLineNumber:h.startLineNumber,startColumn:h.startColumn,endLineNumber:h.endLineNumber,endColumn:h.startColumn+c.value.length},f>1&&(s=new yt(s.startLineNumber,s.startColumn,s.endLineNumber,s.endColumn+f-1));const g=new Eat(d,s,c.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,g),this.editor.pushUndoStop(),this.decorations.set([{range:h,options:HM.DECORATION}]),(u=this.decorationRemover)===null||u===void 0||u.cancel(),this.decorationRemover=jv(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(en)}).catch(en)):Promise.resolve(void 0)}};g_.ID="editor.contrib.inPlaceReplaceController";g_.DECORATION=sn.register({description:"in-place-replace",className:"valueSetReplacement"});g_=HM=Dat([Iat(1,hd)],g_);class kat extends gt{constructor(){super({id:"editor.action.inPlaceReplace.up",label:w("InPlaceReplaceAction.previous.label","Replace with Previous Value"),alias:"Replace with Previous Value",precondition:j.writable,kbOpts:{kbExpr:j.editorTextFocus,primary:3159,weight:100}})}run(e,t){const n=g_.get(t);return n?n.run(this.id,!1):Promise.resolve(void 0)}}class Tat extends gt{constructor(){super({id:"editor.action.inPlaceReplace.down",label:w("InPlaceReplaceAction.next.label","Replace with Next Value"),alias:"Replace with Next Value",precondition:j.writable,kbOpts:{kbExpr:j.editorTextFocus,primary:3161,weight:100}})}run(e,t){const n=g_.get(t);return n?n.run(this.id,!0):Promise.resolve(void 0)}}jn(g_.ID,g_,4);Be(kat);Be(Tat);class Nat extends gt{constructor(){super({id:"expandLineSelection",label:w("expandLineSelection","Expand Line Selection"),alias:"Expand Line Selection",precondition:void 0,kbOpts:{weight:0,kbExpr:j.textInputFocus,primary:2090}})}run(e,t,n){if(n=n||{},!t.hasModel())return;const r=t._getViewModel();r.model.pushStackElement(),r.setCursorStates(n.source,3,Go.expandLineSelection(r,r.getCursorStates())),r.revealPrimaryCursor(n.source,!0)}}Be(Nat);class Rat{constructor(e,t){this._selection=e,this._cursors=t,this._selectionId=null}getEditOperations(e,t){const n=Mat(e,this._cursors);for(let r=0,o=n.length;rs.lineNumber===a.lineNumber?s.column-a.column:s.lineNumber-a.lineNumber);for(let s=e.length-2;s>=0;s--)e[s].lineNumber===e[s+1].lineNumber&&e.splice(s,1);const t=[];let n=0,r=0;const o=e.length;for(let s=1,a=i.getLineCount();s<=a;s++){const l=i.getLineContent(s),c=l.length+1;let u=0;if(r{var g;return f.isUndoing?ql.Undo:f.isRedoing?ql.Redo:!((g=this.model.get())===null||g===void 0)&&g.isAcceptingPartially?ql.AcceptWord:ql.Other};this._register(e.onDidChangeModelContent(f=>Ri(g=>this.updateObservables(g,d(f))))),this._register(e.onDidChangeCursorPosition(f=>Ri(g=>{var p;this.updateObservables(g,ql.Other),(f.reason===3||f.source==="api")&&((p=this.model.get())===null||p===void 0||p.stop(g))}))),this._register(e.onDidType(()=>Ri(f=>{var g;this.updateObservables(f,ql.Other),this._enabled.get()&&((g=this.model.get())===null||g===void 0||g.trigger(f))}))),this._register(this._commandService.onDidExecuteCommand(f=>{new Set([Vy.Tab.id,Vy.DeleteLeft.id,Vy.DeleteRight.id,jCe,"acceptSelectedSuggestion"]).has(f.commandId)&&e.hasTextFocus()&&this._enabled.get()&&Ri(p=>{var v;(v=this.model.get())===null||v===void 0||v.trigger(p)})})),this._register(this.editor.onDidBlurEditorWidget(()=>{this._contextKeyService.getContextKeyValue("accessibleViewIsShown")||this._configurationService.getValue("editor.inlineSuggest.keepOnBlur")||e.getOption(62).keepOnBlur||c_.dropDownVisible||Ri(f=>{var g;(g=this.model.get())===null||g===void 0||g.stop(f)})})),this._register(bn(f=>{var g;const p=(g=this.model.read(f))===null||g===void 0?void 0:g.state.read(f);p!=null&&p.suggestItem?p.primaryGhostText.lineCount>=2&&this._suggestWidgetAdaptor.forceRenderingAbove():this._suggestWidgetAdaptor.stopForceRenderingAbove()})),this._register(Rt(()=>{this._suggestWidgetAdaptor.stopForceRenderingAbove()}));let h;this._register(rT({handleChange:(f,g)=>(f.didChange(this._playAccessibilitySignal)&&(h=void 0),!0)},async f=>{this._playAccessibilitySignal.read(f);const g=this.model.read(f),p=g==null?void 0:g.state.read(f);if(!g||!p||!p.inlineCompletion){h=void 0;return}if(p.inlineCompletion.semanticId!==h){h=p.inlineCompletion.semanticId;const v=g.textModel.getLineContent(p.primaryGhostText.lineNumber);this._accessibilitySignalService.playSignal(cn.inlineSuggestion).then(()=>{this.editor.getOption(8)&&this.provideScreenReaderUpdate(p.primaryGhostText.renderForScreenReader(v))})}})),this._register(new oU(this.editor,this.model,this._instantiationService)),this._register(this._configurationService.onDidChangeConfiguration(f=>{f.affectsConfiguration("accessibility.verbosity.inlineCompletions")&&this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")})})),this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")})}playAccessibilitySignal(e){this._playAccessibilitySignal.trigger(e)}provideScreenReaderUpdate(e){const t=this._contextKeyService.getContextKeyValue("accessibleViewIsShown"),n=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let r;!t&&n&&this.editor.getOption(148)&&(r=w("showAccessibleViewHint","Inspect this in the accessible view ({0})",n.getAriaLabel())),kl(r?e+", "+r:e)}updateObservables(e,t){var n,r,o;const s=this.editor.getModel();this._textModelVersionId.set((n=s==null?void 0:s.getVersionId())!==null&&n!==void 0?n:-1,e,t),this._positions.set((o=(r=this.editor.getSelections())===null||r===void 0?void 0:r.map(a=>a.getPosition()))!==null&&o!==void 0?o:[new ae(1,1)],e)}shouldShowHoverAt(e){var t;const n=(t=this.model.get())===null||t===void 0?void 0:t.primaryGhostText.get();return n?n.parts.some(r=>e.containsPosition(new ae(n.lineNumber,r.column))):!1}shouldShowHoverAtViewZone(e){var t,n;return(n=(t=this._ghostTextWidgets.get()[0])===null||t===void 0?void 0:t.ownsViewZone(e))!==null&&n!==void 0?n:!1}};bc.ID="editor.contrib.inlineCompletionsController";bc=RU=oat([um(1,Ot),um(2,Vt),um(3,gn),um(4,sr),um(5,gu),um(6,_t),um(7,R_),um(8,ci)],bc);function sat(i,e){const t=Hn("result",[]),n=[];return e.add(bn(r=>{const o=i.read(r);Ri(s=>{if(o.length!==n.length){n.length=o.length;for(let a=0;aa.set(o[l],s))})})),t}class J3 extends gt{constructor(){super({id:J3.ID,label:w("action.inlineSuggest.showNext","Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:De.and(j.writable,$o.inlineSuggestionVisible),kbOpts:{weight:100,primary:606}})}async run(e,t){var n;const r=bc.get(t);(n=r==null?void 0:r.model.get())===null||n===void 0||n.next()}}J3.ID=GCe;class e5 extends gt{constructor(){super({id:e5.ID,label:w("action.inlineSuggest.showPrevious","Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:De.and(j.writable,$o.inlineSuggestionVisible),kbOpts:{weight:100,primary:604}})}async run(e,t){var n;const r=bc.get(t);(n=r==null?void 0:r.model.get())===null||n===void 0||n.previous()}}e5.ID=KCe;class aat extends gt{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:w("action.inlineSuggest.trigger","Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:j.writable})}async run(e,t){const n=bc.get(t);await OZe(async r=>{var o;await((o=n==null?void 0:n.model.get())===null||o===void 0?void 0:o.triggerExplicitly(r)),n==null||n.playAccessibilitySignal(r)})}}class lat extends gt{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:w("action.inlineSuggest.acceptNextWord","Accept Next Word Of Inline Suggestion"),alias:"Accept Next Word Of Inline Suggestion",precondition:De.and(j.writable,$o.inlineSuggestionVisible),kbOpts:{weight:100+1,primary:2065,kbExpr:De.and(j.writable,$o.inlineSuggestionVisible)},menuOpts:[{menuId:$.InlineSuggestionToolbar,title:w("acceptWord","Accept Word"),group:"primary",order:2}]})}async run(e,t){var n;const r=bc.get(t);await((n=r==null?void 0:r.model.get())===null||n===void 0?void 0:n.acceptNextWord(r.editor))}}class cat extends gt{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:w("action.inlineSuggest.acceptNextLine","Accept Next Line Of Inline Suggestion"),alias:"Accept Next Line Of Inline Suggestion",precondition:De.and(j.writable,$o.inlineSuggestionVisible),kbOpts:{weight:100+1},menuOpts:[{menuId:$.InlineSuggestionToolbar,title:w("acceptLine","Accept Line"),group:"secondary",order:2}]})}async run(e,t){var n;const r=bc.get(t);await((n=r==null?void 0:r.model.get())===null||n===void 0?void 0:n.acceptNextLine(r.editor))}}class uat extends gt{constructor(){super({id:jCe,label:w("action.inlineSuggest.accept","Accept Inline Suggestion"),alias:"Accept Inline Suggestion",precondition:$o.inlineSuggestionVisible,menuOpts:[{menuId:$.InlineSuggestionToolbar,title:w("accept","Accept"),group:"primary",order:1}],kbOpts:{primary:2,weight:200,kbExpr:De.and($o.inlineSuggestionVisible,j.tabMovesFocus.toNegated(),$o.inlineSuggestionHasIndentationLessThanTabSize,ln.Visible.toNegated(),j.hoverFocused.toNegated())}})}async run(e,t){var n;const r=bc.get(t);r&&((n=r.model.get())===null||n===void 0||n.accept(r.editor),r.editor.focus())}}class t5 extends gt{constructor(){super({id:t5.ID,label:w("action.inlineSuggest.hide","Hide Inline Suggestion"),alias:"Hide Inline Suggestion",precondition:$o.inlineSuggestionVisible,kbOpts:{weight:100,primary:9}})}async run(e,t){const n=bc.get(t);Ri(r=>{var o;(o=n==null?void 0:n.model.get())===null||o===void 0||o.stop(r)})}}t5.ID="editor.action.inlineSuggest.hide";class n5 extends sl{constructor(){super({id:n5.ID,title:w("action.inlineSuggest.alwaysShowToolbar","Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:$.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:De.equals("config.editor.inlineSuggest.showToolbar","always")})}async run(e,t){const n=e.get(gn),o=n.getValue("editor.inlineSuggest.showToolbar")==="always"?"onHover":"always";n.updateValue("editor.inlineSuggest.showToolbar",o)}}n5.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar";var dat=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},tL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class hat{constructor(e,t,n){this.owner=e,this.range=t,this.controller=n}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let MU=class{constructor(e,t,n,r,o,s){this._editor=e,this._languageService=t,this._openerService=n,this.accessibilityService=r,this._instantiationService=o,this._telemetryService=s,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=bc.get(this._editor);if(!t)return null;const n=e.target;if(n.type===8){const r=n.detail;if(t.shouldShowHoverAtViewZone(r.viewZoneId))return new cb(1e3,this,B.fromPositions(this._editor.getModel().validatePosition(r.positionBefore||r.position)),e.event.posx,e.event.posy,!1)}return n.type===7&&t.shouldShowHoverAt(n.range)?new cb(1e3,this,n.range,e.event.posx,e.event.posy,!1):n.type===6&&n.detail.mightBeForeignElement&&t.shouldShowHoverAt(n.range)?new cb(1e3,this,n.range,e.event.posx,e.event.posy,!1):null}computeSync(e,t){if(this._editor.getOption(62).showToolbar!=="onHover")return[];const n=bc.get(this._editor);return n&&n.shouldShowHoverAt(e.range)?[new hat(this,e.range,n)]:[]}renderHoverParts(e,t){const n=new Te,r=t[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(8)&&this.renderScreenReaderText(e,r,n);const o=r.controller.model.get(),s=this._instantiationService.createInstance(c_,this._editor,!1,ap(null),o.selectedInlineCompletionIndex,o.inlineCompletionsCount,o.selectedInlineCompletion.map(a=>{var l;return(l=a==null?void 0:a.inlineCompletion.source.inlineCompletions.commands)!==null&&l!==void 0?l:[]}));return e.fragment.appendChild(s.getDomNode()),o.triggerExplicitly(),n.add(s),n}renderScreenReaderText(e,t,n){const r=He,o=r("div.hover-row.markdown-hover"),s=ke(o,r("div.hover-contents",{["aria-live"]:"assertive"})),a=n.add(new Uf({editor:this._editor},this._languageService,this._openerService)),l=c=>{n.add(a.onDidRenderAsync(()=>{s.className="hover-contents code-hover-contents",e.onContentsChanged()}));const u=w("inlineSuggestionFollows","Suggestion:"),d=n.add(a.render(new Is().appendText(u).appendCodeblock("text",c)));s.replaceChildren(d.element)};n.add(bn(c=>{var u;const d=(u=t.controller.model.read(c))===null||u===void 0?void 0:u.primaryGhostText.read(c);if(d){const h=this._editor.getModel().getLineContent(d.lineNumber);l(d.renderForScreenReader(h))}else gs(s)})),e.fragment.appendChild(o)}};MU=dat([tL(1,ji),tL(2,al),tL(3,ud),tL(4,Ot),tL(5,ea)],MU);jn(bc.ID,bc,3);Be(aat);Be(J3);Be(e5);Be(lat);Be(cat);Be(uat);Be(t5);Ei(n5);A_.register(MU);function vl(i,e){let t=0;for(let n=0;n=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},gat=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};function D1e(i,e,t,n,r){if(i.getLineCount()===1&&i.getLineMaxColumn(1)===1)return[];const o=e.getLanguageConfiguration(i.getLanguageId()).indentationRules;if(!o)return[];for(n=Math.min(n,i.getLineCount());t<=n&&o.unIndentedLinePattern;){const v=i.getLineContent(t);if(!o.unIndentedLinePattern.test(v))break;t++}if(t>n-1)return[];const{tabSize:s,indentSize:a,insertSpaces:l}=i.getOptions(),c=(v,m)=>(m=m||1,jc.shiftIndent(v,v.length+m,s,a,l)),u=(v,m)=>(m=m||1,jc.unshiftIndent(v,v.length+m,s,a,l)),d=[];let h;const f=i.getLineContent(t);let g=f;if(r!=null){h=r;const v=bi(f);g=h+f.substring(v.length),o.decreaseIndentPattern&&o.decreaseIndentPattern.test(g)&&(h=u(h),g=h+f.substring(v.length)),f!==g&&d.push(Xi.replaceMove(new yt(t,1,t,v.length+1),cP(h,a,l)))}else h=bi(f);let p=h;o.increaseIndentPattern&&o.increaseIndentPattern.test(g)?(p=c(p),h=c(h)):o.indentNextLinePattern&&o.indentNextLinePattern.test(g)&&(p=c(p)),t++;for(let v=t;v<=n;v++){const m=i.getLineContent(v),_=bi(m),y=p+m.substring(_.length);o.decreaseIndentPattern&&o.decreaseIndentPattern.test(y)&&(p=u(p),h=u(h)),_!==p&&d.push(Xi.replaceMove(new yt(v,1,v,_.length+1),cP(p,a,l))),!(o.unIndentedLinePattern&&o.unIndentedLinePattern.test(m))&&(o.increaseIndentPattern&&o.increaseIndentPattern.test(y)?(h=c(h),p=h):o.indentNextLinePattern&&o.indentNextLinePattern.test(y)?p=c(p):p=h)}return d}class i5 extends gt{constructor(){super({id:i5.ID,label:w("indentationToSpaces","Convert Indentation to Spaces"),alias:"Convert Indentation to Spaces",precondition:j.writable})}run(e,t){const n=t.getModel();if(!n)return;const r=n.getOptions(),o=t.getSelection();if(!o)return;const s=new _at(o,r.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop(),n.updateOptions({insertSpaces:!0})}}i5.ID="editor.action.indentationToSpaces";class r5 extends gt{constructor(){super({id:r5.ID,label:w("indentationToTabs","Convert Indentation to Tabs"),alias:"Convert Indentation to Tabs",precondition:j.writable})}run(e,t){const n=t.getModel();if(!n)return;const r=n.getOptions(),o=t.getSelection();if(!o)return;const s=new bat(o,r.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop(),n.updateOptions({insertSpaces:!1})}}r5.ID="editor.action.indentationToTabs";class lZ extends gt{constructor(e,t,n){super(n),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const n=e.get(Eh),r=e.get(tr),o=t.getModel();if(!o)return;const s=r.getCreationOptions(o.getLanguageId(),o.uri,o.isForSimpleWidget),a=o.getOptions(),l=[1,2,3,4,5,6,7,8].map(u=>({id:u.toString(),label:u.toString(),description:u===s.tabSize&&u===a.tabSize?w("configuredTabSize","Configured Tab Size"):u===s.tabSize?w("defaultTabSize","Default Tab Size"):u===a.tabSize?w("currentTabSize","Current Tab Size"):void 0})),c=Math.min(o.getOptions().tabSize-1,7);setTimeout(()=>{n.pick(l,{placeHolder:w({key:"selectTabWidth",comment:["Tab corresponds to the tab key"]},"Select Tab Size for Current File"),activeItem:l[c]}).then(u=>{if(u&&o&&!o.isDisposed()){const d=parseInt(u.label,10);this.displaySizeOnly?o.updateOptions({tabSize:d}):o.updateOptions({tabSize:d,indentSize:d,insertSpaces:this.insertSpaces})}})},50)}}class o5 extends lZ{constructor(){super(!1,!1,{id:o5.ID,label:w("indentUsingTabs","Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0})}}o5.ID="editor.action.indentUsingTabs";class s5 extends lZ{constructor(){super(!0,!1,{id:s5.ID,label:w("indentUsingSpaces","Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0})}}s5.ID="editor.action.indentUsingSpaces";class a5 extends lZ{constructor(){super(!0,!0,{id:a5.ID,label:w("changeTabDisplaySize","Change Tab Display Size"),alias:"Change Tab Display Size",precondition:void 0})}}a5.ID="editor.action.changeTabDisplaySize";class l5 extends gt{constructor(){super({id:l5.ID,label:w("detectIndentation","Detect Indentation from Content"),alias:"Detect Indentation from Content",precondition:void 0})}run(e,t){const n=e.get(tr),r=t.getModel();if(!r)return;const o=n.getCreationOptions(r.getLanguageId(),r.uri,r.isForSimpleWidget);r.detectIndentation(o.insertSpaces,o.tabSize)}}l5.ID="editor.action.detectIndentation";class pat extends gt{constructor(){super({id:"editor.action.reindentlines",label:w("editor.reindentlines","Reindent Lines"),alias:"Reindent Lines",precondition:j.writable})}run(e,t){const n=e.get(Di),r=t.getModel();if(!r)return;const o=D1e(r,n,1,r.getLineCount());o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}}class mat extends gt{constructor(){super({id:"editor.action.reindentselectedlines",label:w("editor.reindentselectedlines","Reindent Selected Lines"),alias:"Reindent Selected Lines",precondition:j.writable})}run(e,t){const n=e.get(Di),r=t.getModel();if(!r)return;const o=t.getSelections();if(o===null)return;const s=[];for(const a of o){let l=a.startLineNumber,c=a.endLineNumber;if(l!==c&&a.endColumn===1&&c--,l===1){if(l===c)continue}else l--;const u=D1e(r,n,l,c);s.push(...u)}s.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop())}}class vat{constructor(e,t){this._initialSelection=t,this._edits=[],this._selectionId=null;for(const n of e)n.range&&typeof n.text=="string"&&this._edits.push(n)}getEditOperations(e,t){for(const r of this._edits)t.addEditOperation(B.lift(r.range),r.text);let n=!1;Array.isArray(this._edits)&&this._edits.length===1&&this._initialSelection.isEmpty()&&(this._edits[0].range.startColumn===this._initialSelection.endColumn&&this._edits[0].range.startLineNumber===this._initialSelection.endLineNumber?(n=!0,this._selectionId=t.trackSelection(this._initialSelection,!0)):this._edits[0].range.endColumn===this._initialSelection.startColumn&&this._edits[0].range.endLineNumber===this._initialSelection.startLineNumber&&(n=!0,this._selectionId=t.trackSelection(this._initialSelection,!1))),n||(this._selectionId=t.trackSelection(this._initialSelection))}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}let VI=class{constructor(e,t){this.editor=e,this._languageConfigurationService=t,this.callOnDispose=new Te,this.callOnModel=new Te,this.callOnDispose.add(e.onDidChangeConfiguration(()=>this.update())),this.callOnDispose.add(e.onDidChangeModel(()=>this.update())),this.callOnDispose.add(e.onDidChangeModelLanguage(()=>this.update()))}update(){this.callOnModel.clear(),!(this.editor.getOption(12)<4||this.editor.getOption(55))&&this.editor.hasModel()&&this.callOnModel.add(this.editor.onDidPaste(({range:e})=>{this.trigger(e)}))}trigger(e){const t=this.editor.getSelections();if(t===null||t.length>1)return;const n=this.editor.getModel();if(!n||!n.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const r=this.editor.getOption(12),{tabSize:o,indentSize:s,insertSpaces:a}=n.getOptions(),l=[],c={shiftIndent:f=>jc.shiftIndent(f,f.length+1,o,s,a),unshiftIndent:f=>jc.unshiftIndent(f,f.length+1,o,s,a)};let u=e.startLineNumber;for(;u<=e.endLineNumber;){if(this.shouldIgnoreLine(n,u)){u++;continue}break}if(u>e.endLineNumber)return;let d=n.getLineContent(u);if(!/\S/.test(d.substring(0,e.startColumn-1))){const f=gE(r,n,n.getLanguageId(),u,c,this._languageConfigurationService);if(f!==null){const g=bi(d),p=vl(f,o),v=vl(g,o);if(p!==v){const m=FE(p,o,a);l.push({range:new B(u,1,u,g.length+1),text:m}),d=m+d.substr(g.length)}else{const m=Ive(n,u,this._languageConfigurationService);if(m===0||m===8)return}}}const h=u;for(;un.tokenization.getLineTokens(p),getLanguageId:()=>n.getLanguageId(),getLanguageIdAtPosition:(p,v)=>n.getLanguageIdAtPosition(p,v)},getLineContent:p=>p===h?d:n.getLineContent(p)},n.getLanguageId(),u+1,c,this._languageConfigurationService);if(g!==null){const p=vl(g,o),v=vl(bi(n.getLineContent(u+1)),o);if(p!==v){const m=p-v;for(let _=u+1;_<=e.endLineNumber;_++){const y=n.getLineContent(_),S=bi(y),E=vl(S,o)+m,D=FE(E,o,a);D!==S&&l.push({range:new B(_,1,_,S.length+1),text:D})}}}}if(l.length>0){this.editor.pushUndoStop();const f=new vat(l,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",f),this.editor.pushUndoStop()}}shouldIgnoreLine(e,t){e.tokenization.forceTokenization(t);const n=e.getLineFirstNonWhitespaceColumn(t);if(n===0)return!0;const r=e.tokenization.getLineTokens(t);if(r.getCount()>0){const o=r.findTokenIndexAtOffset(n);if(o>=0&&r.getStandardTokenType(o)===1)return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}};VI.ID="editor.contrib.autoIndentOnPaste";VI=fat([gat(1,Di)],VI);function I1e(i,e,t,n){if(i.getLineCount()===1&&i.getLineMaxColumn(1)===1)return;let r="";for(let s=0;sthis._currentResolve=void 0)),await this._currentResolve}}async _doResolve(e){var t,n,r;try{const o=await Promise.resolve(this.provider.resolveInlayHint(this.hint,e));this.hint.tooltip=(t=o==null?void 0:o.tooltip)!==null&&t!==void 0?t:this.hint.tooltip,this.hint.label=(n=o==null?void 0:o.label)!==null&&n!==void 0?n:this.hint.label,this.hint.textEdits=(r=o==null?void 0:o.textEdits)!==null&&r!==void 0?r:this.hint.textEdits,this._isResolved=!0}catch(o){Zr(o),this._isResolved=!1}}}class hb{static async create(e,t,n,r){const o=[],s=e.ordered(t).reverse().map(a=>n.map(async l=>{try{const c=await a.provideInlayHints(t,l,r);(c!=null&&c.hints.length||a.onDidChangeInlayHints)&&o.push([c??hb._emptyInlayHintList,a])}catch(c){Zr(c)}}));if(await Promise.all(s.flat()),r.isCancellationRequested||t.isDisposed())throw new x_;return new hb(n,o,t)}constructor(e,t,n){this._disposables=new Te,this.ranges=e,this.provider=new Set;const r=[];for(const[o,s]of t){this._disposables.add(o),this.provider.add(s);for(const a of o.hints){const l=n.validatePosition(a.position);let c="before";const u=hb._getRangeAtPosition(n,l);let d;u.getStartPosition().isBefore(l)?(d=B.fromPositions(u.getStartPosition(),l),c="after"):(d=B.fromPositions(l,u.getEndPosition()),c="before"),r.push(new cZ(a,new k1e(d,c),s))}}this.items=r.sort((o,s)=>ae.compare(o.hint.position,s.hint.position))}dispose(){this._disposables.dispose()}static _getRangeAtPosition(e,t){const n=t.lineNumber,r=e.getWordAtPosition(t);if(r)return new B(n,r.startColumn,n,r.endColumn);e.tokenization.tokenizeIfCheap(n);const o=e.tokenization.getLineTokens(n),s=t.column-1,a=o.findTokenIndexAtOffset(s);let l=o.getStartOffset(a),c=o.getEndOffset(a);return c-l===1&&(l===s&&a>1?(l=o.getStartOffset(a-1),c=o.getEndOffset(a-1)):c===s&&aty(g)?g.command.id:T3()));for(const g of Gs.all())h.has(g.desc.id)&&d.push(new xl(g.desc.id,pc.label(g.desc,{renderShortTitle:!0}),void 0,!0,async()=>{const p=await o.createModelReference(u.uri);try{const v=new eS(p.object.textEditorModel,B.getStartPosition(u.range)),m=n.item.anchor.range;await l.invokeFunction(g.runEditorCommand.bind(g),e,v,m)}finally{p.dispose()}}));if(n.part.command){const{command:g}=n.part;d.push(new lo),d.push(new xl(g.id,g.title,void 0,!0,async()=>{var p;try{await a.executeCommand(g.id,...(p=g.arguments)!==null&&p!==void 0?p:[])}catch(v){c.notify({severity:j4.Error,source:n.item.provider.displayName,message:v})}}))}const f=e.getOption(127);s.showContextMenu({domForShadowRoot:f&&(r=e.getDomNode())!==null&&r!==void 0?r:void 0,getAnchor:()=>{const g=Br(t);return{x:g.left,y:g.top+g.height+8}},getActions:()=>d,onHide:()=>{e.focus()},autoSelectFirstItem:!0})}async function T1e(i,e,t,n){const o=await i.get(ol).createModelReference(n.uri);await t.invokeWithinContext(async s=>{const a=e.hasSideBySideModifier,l=s.get(Vt),c=il.inPeekEditor.getValue(l),u=!a&&t.getOption(88)&&!c;return new gT({openToSide:a,openInPeek:u,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(s,new eS(o.object.textEditorModel,B.getStartPosition(n.range)),B.lift(n.range))}),o.dispose()}var wat=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},l1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},A1;class kO{constructor(){this._entries=new E_(50)}get(e){const t=kO._key(e);return this._entries.get(t)}set(e,t){const n=kO._key(e);this._entries.set(n,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}const N1e=yn("IInlayHintsCache");In(N1e,kO,1);class AU{constructor(e,t){this.item=e,this.index=t}get part(){const e=this.item.hint.label;return typeof e=="string"?{label:e}:e[this.index]}}class Sat{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}let h_=A1=class{static get(e){var t;return(t=e.getContribution(A1.ID))!==null&&t!==void 0?t:void 0}constructor(e,t,n,r,o,s,a){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=r,this._commandService=o,this._notificationService=s,this._instaService=a,this._disposables=new Te,this._sessionDisposables=new Te,this._decorationsMetadata=new Map,this._ruleFactory=new Wk(this._editor),this._activeRenderMode=0,this._debounceInfo=n.for(t.inlayHintsProvider,"InlayHint",{min:25}),this._disposables.add(t.inlayHintsProvider.onDidChange(()=>this._update())),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(l=>{l.hasChanged(140)&&this._update()})),this._update()}dispose(){this._sessionDisposables.dispose(),this._removeAllDecorations(),this._disposables.dispose()}_update(){this._sessionDisposables.clear(),this._removeAllDecorations();const e=this._editor.getOption(140);if(e.enabled==="off")return;const t=this._editor.getModel();if(!t||!this._languageFeaturesService.inlayHintsProvider.has(t))return;if(e.enabled==="on")this._activeRenderMode=0;else{let a,l;e.enabled==="onUnlessPressed"?(a=0,l=1):(a=1,l=0),this._activeRenderMode=a,this._sessionDisposables.add(Xg.getInstance().event(c=>{if(!this._editor.hasModel())return;const u=c.altKey&&c.ctrlKey&&!(c.shiftKey||c.metaKey)?l:a;if(u!==this._activeRenderMode){this._activeRenderMode=u;const d=this._editor.getModel(),h=this._copyInlayHintsWithCurrentAnchor(d);this._updateHintsDecorators([d.getFullModelRange()],h),s.schedule(0)}}))}const n=this._inlayHintsCache.get(t);n&&this._updateHintsDecorators([t.getFullModelRange()],n),this._sessionDisposables.add(Rt(()=>{t.isDisposed()||this._cacheHintsForFastRestore(t)}));let r;const o=new Set,s=new pi(async()=>{const a=Date.now();r==null||r.dispose(!0),r=new wr;const l=t.onWillDispose(()=>r==null?void 0:r.cancel());try{const c=r.token,u=await hb.create(this._languageFeaturesService.inlayHintsProvider,t,this._getHintsRanges(),c);if(s.delay=this._debounceInfo.update(t,Date.now()-a),c.isCancellationRequested){u.dispose();return}for(const d of u.provider)typeof d.onDidChangeInlayHints=="function"&&!o.has(d)&&(o.add(d),this._sessionDisposables.add(d.onDidChangeInlayHints(()=>{s.isScheduled()||s.schedule()})));this._sessionDisposables.add(u),this._updateHintsDecorators(u.ranges,u.items),this._cacheHintsForFastRestore(t)}catch(c){en(c)}finally{r.dispose(),l.dispose()}},this._debounceInfo.get(t));this._sessionDisposables.add(s),this._sessionDisposables.add(Rt(()=>r==null?void 0:r.dispose(!0))),s.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange(a=>{(a.scrollTopChanged||!s.isScheduled())&&s.schedule()})),this._sessionDisposables.add(this._editor.onDidChangeModelContent(a=>{r==null||r.cancel();const l=Math.max(s.delay,1250);s.schedule(l)})),this._sessionDisposables.add(this._installDblClickGesture(()=>s.schedule(0))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const e=new Te,t=e.add(new M3(this._editor)),n=new Te;return e.add(n),e.add(t.onMouseMoveOrRelevantKeyDown(r=>{const[o]=r,s=this._getInlayHintLabelPart(o),a=this._editor.getModel();if(!s||!a){n.clear();return}const l=new wr;n.add(Rt(()=>l.dispose(!0))),s.item.resolve(l.token),this._activeInlayHintPart=s.part.command||s.part.location?new Sat(s,o.hasTriggerModifier):void 0;const c=a.validatePosition(s.item.hint.position).lineNumber,u=new B(c,1,c,a.getLineMaxColumn(c)),d=this._getInlineHintsForRange(u);this._updateHintsDecorators([u],d),n.add(Rt(()=>{this._activeInlayHintPart=void 0,this._updateHintsDecorators([u],d)}))})),e.add(t.onCancel(()=>n.clear())),e.add(t.onExecute(async r=>{const o=this._getInlayHintLabelPart(r);if(o){const s=o.part;s.location?this._instaService.invokeFunction(T1e,r,this._editor,s.location):u$.is(s.command)&&await this._invokeCommand(s.command,o.item)}})),e}_getInlineHintsForRange(e){const t=new Set;for(const n of this._decorationsMetadata.values())e.containsRange(n.item.anchor.range)&&t.add(n.item);return Array.from(t)}_installDblClickGesture(e){return this._editor.onMouseUp(async t=>{if(t.event.detail!==2)return;const n=this._getInlayHintLabelPart(t);if(n&&(t.event.preventDefault(),await n.item.resolve(Cn.None),Ts(n.item.hint.textEdits))){const r=n.item.hint.textEdits.map(o=>Xi.replace(B.lift(o.range),o.text));this._editor.executeEdits("inlayHint.default",r),e()}})}_installContextMenu(){return this._editor.onContextMenu(async e=>{if(!(e.event.target instanceof HTMLElement))return;const t=this._getInlayHintLabelPart(e);t&&await this._instaService.invokeFunction(yat,this._editor,e.event.target,t)})}_getInlayHintLabelPart(e){var t;if(e.target.type!==6)return;const n=(t=e.target.detail.injectedText)===null||t===void 0?void 0:t.options;if(n instanceof Jv&&(n==null?void 0:n.attachedData)instanceof AU)return n.attachedData}async _invokeCommand(e,t){var n;try{await this._commandService.executeCommand(e.id,...(n=e.arguments)!==null&&n!==void 0?n:[])}catch(r){this._notificationService.notify({severity:j4.Error,source:t.provider.displayName,message:r})}}_cacheHintsForFastRestore(e){const t=this._copyInlayHintsWithCurrentAnchor(e);this._inlayHintsCache.set(e,t)}_copyInlayHintsWithCurrentAnchor(e){const t=new Map;for(const[n,r]of this._decorationsMetadata){if(t.has(r.item))continue;const o=e.getDecorationRange(n);if(o){const s=new k1e(o,r.item.anchor.direction),a=r.item.with({anchor:s});t.set(r.item,a)}}return Array.from(t.values())}_getHintsRanges(){const t=this._editor.getModel(),n=this._editor.getVisibleRangesPlusViewportAboveBelow(),r=[];for(const o of n.sort(B.compareRangesUsingStarts)){const s=t.validateRange(new B(o.startLineNumber-30,o.startColumn,o.endLineNumber+30,o.endColumn));r.length===0||!B.areIntersectingOrTouching(r[r.length-1],s)?r.push(s):r[r.length-1]=B.plusRange(r[r.length-1],s)}return r}_updateHintsDecorators(e,t){var n,r;const o=[],s=(v,m,_,y,S)=>{const L={content:_,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:m.className,cursorStops:y,attachedData:S};o.push({item:v,classNameRef:m,decoration:{range:v.anchor.range,options:{description:"InlayHint",showIfCollapsed:v.anchor.range.isEmpty(),collapseOnReplaceEdit:!v.anchor.range.isEmpty(),stickiness:0,[v.anchor.direction]:this._activeRenderMode===0?L:void 0}}})},a=(v,m)=>{const _=this._ruleFactory.createClassNameRef({width:`${l/3|0}px`,display:"inline-block"});s(v,_," ",m?ju.Right:ju.None)},{fontSize:l,fontFamily:c,padding:u,isUniform:d}=this._getLayoutInfo(),h="--code-editorInlayHintsFontFamily";this._editor.getContainerDomNode().style.setProperty(h,c);let f={line:0,totalLen:0};for(const v of t){if(f.line!==v.anchor.range.startLineNumber&&(f={line:v.anchor.range.startLineNumber,totalLen:0}),f.totalLen>A1._MAX_LABEL_LEN)continue;v.hint.paddingLeft&&a(v,!1);const m=typeof v.hint.label=="string"?[{label:v.hint.label}]:v.hint.label;for(let _=0;_0&&(D=D.slice(0,-T)+"…",k=!0),s(v,this._ruleFactory.createClassNameRef(E),xat(D),L&&!v.hint.paddingRight?ju.Right:ju.None,new AU(v,_)),k)break}if(v.hint.paddingRight&&a(v,!0),o.length>A1._MAX_DECORATORS)break}const g=[];for(const[v,m]of this._decorationsMetadata){const _=(r=this._editor.getModel())===null||r===void 0?void 0:r.getDecorationRange(v);_&&e.some(y=>y.containsRange(_))&&(g.push(v),m.classNameRef.dispose(),this._decorationsMetadata.delete(v))}const p=_h.capture(this._editor);this._editor.changeDecorations(v=>{const m=v.deltaDecorations(g,o.map(_=>_.decoration));for(let _=0;_n)&&(o=n);const s=e.fontFamily||r;return{fontSize:o,fontFamily:s,padding:t,isUniform:!t&&s===r&&o===n}}_removeAllDecorations(){this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));for(const e of this._decorationsMetadata.values())e.classNameRef.dispose();this._decorationsMetadata.clear()}};h_.ID="editor.contrib.InlayHints";h_._MAX_DECORATORS=1500;h_._MAX_LABEL_LEN=43;h_=A1=wat([l1(1,_t),l1(2,gu),l1(3,N1e),l1(4,sr),l1(5,$r),l1(6,Ot)],h_);function xat(i){const e=" ";return i.replace(/[ \t]/g,e)}Dn.registerCommand("_executeInlayHintProvider",async(i,...e)=>{const[t,n]=e;Xn(At.isUri(t)),Xn(B.isIRange(n));const{inlayHintsProvider:r}=i.get(_t),o=await i.get(ol).createModelReference(t);try{const s=await hb.create(r,o.object.textEditorModel,[B.lift(n)],Cn.None),a=s.items.map(l=>l.hint);return setTimeout(()=>s.dispose(),0),a}finally{o.dispose()}});var Lat=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},nL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class wle extends cb{constructor(e,t,n,r){super(10,t,e.item.anchor.range,n,r,!0),this.part=e}}let PU=class extends bO{constructor(e,t,n,r,o,s){super(e,t,n,r,s),this._resolverService=o,this.hoverOrdinal=6}suggestHoverAnchor(e){var t;if(!h_.get(this._editor)||e.target.type!==6)return null;const r=(t=e.target.detail.injectedText)===null||t===void 0?void 0:t.options;return r instanceof Jv&&r.attachedData instanceof AU?new wle(r.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,t,n){return e instanceof wle?new Kr(async r=>{const{part:o}=e;if(await o.item.resolve(n),n.isCancellationRequested)return;let s;typeof o.item.hint.tooltip=="string"?s=new Is().appendText(o.item.hint.tooltip):o.item.hint.tooltip&&(s=o.item.hint.tooltip),s&&r.emitOne(new jd(this,e.range,[s],!1,0)),Ts(o.item.hint.textEdits)&&r.emitOne(new jd(this,e.range,[new Is().appendText(w("hint.dbl","Double-click to insert"))],!1,10001));let a;if(typeof o.part.tooltip=="string"?a=new Is().appendText(o.part.tooltip):o.part.tooltip&&(a=o.part.tooltip),a&&r.emitOne(new jd(this,e.range,[a],!1,1)),o.part.location||o.part.command){let c;const d=this._editor.getOption(78)==="altKey"?Ln?w("links.navigate.kb.meta.mac","cmd + click"):w("links.navigate.kb.meta","ctrl + click"):Ln?w("links.navigate.kb.alt.mac","option + click"):w("links.navigate.kb.alt","alt + click");o.part.location&&o.part.command?c=new Is().appendText(w("hint.defAndCommand","Go to Definition ({0}), right click for more",d)):o.part.location?c=new Is().appendText(w("hint.def","Go to Definition ({0})",d)):o.part.command&&(c=new Is(`[${w("hint.cmd","Execute Command")}](${Cat(o.part.command)} "${o.part.command.title}") (${d})`,{isTrusted:!0})),c&&r.emitOne(new jd(this,e.range,[c],!1,1e4))}const l=await this._resolveInlayHintLabelPartHover(o,n);for await(const c of l)r.emitOne(c)}):Kr.EMPTY}async _resolveInlayHintLabelPartHover(e,t){if(!e.part.location)return Kr.EMPTY;const{uri:n,range:r}=e.part.location,o=await this._resolverService.createModelReference(n);try{const s=o.object.textEditorModel;return this._languageFeaturesService.hoverProvider.has(s)?UY(this._languageFeaturesService.hoverProvider,s,new ae(r.startLineNumber,r.startColumn),t).filter(a=>!Hw(a.hover.contents)).map(a=>new jd(this,e.item.anchor.range,a.hover.contents,!1,2+a.ordinal)):Kr.EMPTY}finally{o.dispose()}}};PU=Lat([nL(1,ji),nL(2,al),nL(3,gn),nL(4,ol),nL(5,_t)],PU);jn(h_.ID,h_,1);A_.register(PU);class Eat{constructor(e,t,n){this._editRange=e,this._originalSelection=t,this._text=n}getEditOperations(e,t){t.addTrackedEditOperation(this._editRange,this._text)}computeCursorState(e,t){const r=t.getInverseEditOperations()[0].range;return this._originalSelection.isEmpty()?new yt(r.endLineNumber,Math.min(this._originalSelection.positionColumn,r.endColumn),r.endLineNumber,Math.min(this._originalSelection.positionColumn,r.endColumn)):new yt(r.endLineNumber,r.endColumn-this._text.length,r.endLineNumber,r.endColumn)}}var Dat=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Iat=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},HM;let f_=HM=class{static get(e){return e.getContribution(HM.ID)}constructor(e,t){this.editor=e,this.editorWorkerService=t,this.decorations=this.editor.createDecorationsCollection()}dispose(){}run(e,t){var n;(n=this.currentRequest)===null||n===void 0||n.cancel();const r=this.editor.getSelection(),o=this.editor.getModel();if(!o||!r)return;let s=r;if(s.startLineNumber!==s.endLineNumber)return;const a=new tbe(this.editor,5),l=o.uri;return this.editorWorkerService.canNavigateValueSet(l)?(this.currentRequest=Io(c=>this.editorWorkerService.navigateValueSet(l,s,t)),this.currentRequest.then(c=>{var u;if(!c||!c.range||!c.value||!a.validate(this.editor))return;const d=B.lift(c.range);let h=c.range;const f=c.value.length-(s.endColumn-s.startColumn);h={startLineNumber:h.startLineNumber,startColumn:h.startColumn,endLineNumber:h.endLineNumber,endColumn:h.startColumn+c.value.length},f>1&&(s=new yt(s.startLineNumber,s.startColumn,s.endLineNumber,s.endColumn+f-1));const g=new Eat(d,s,c.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,g),this.editor.pushUndoStop(),this.decorations.set([{range:h,options:HM.DECORATION}]),(u=this.decorationRemover)===null||u===void 0||u.cancel(),this.decorationRemover=Uv(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(en)}).catch(en)):Promise.resolve(void 0)}};f_.ID="editor.contrib.inPlaceReplaceController";f_.DECORATION=sn.register({description:"in-place-replace",className:"valueSetReplacement"});f_=HM=Dat([Iat(1,hd)],f_);class kat extends gt{constructor(){super({id:"editor.action.inPlaceReplace.up",label:w("InPlaceReplaceAction.previous.label","Replace with Previous Value"),alias:"Replace with Previous Value",precondition:j.writable,kbOpts:{kbExpr:j.editorTextFocus,primary:3159,weight:100}})}run(e,t){const n=f_.get(t);return n?n.run(this.id,!1):Promise.resolve(void 0)}}class Tat extends gt{constructor(){super({id:"editor.action.inPlaceReplace.down",label:w("InPlaceReplaceAction.next.label","Replace with Next Value"),alias:"Replace with Next Value",precondition:j.writable,kbOpts:{kbExpr:j.editorTextFocus,primary:3161,weight:100}})}run(e,t){const n=f_.get(t);return n?n.run(this.id,!0):Promise.resolve(void 0)}}jn(f_.ID,f_,4);Be(kat);Be(Tat);class Nat extends gt{constructor(){super({id:"expandLineSelection",label:w("expandLineSelection","Expand Line Selection"),alias:"Expand Line Selection",precondition:void 0,kbOpts:{weight:0,kbExpr:j.textInputFocus,primary:2090}})}run(e,t,n){if(n=n||{},!t.hasModel())return;const r=t._getViewModel();r.model.pushStackElement(),r.setCursorStates(n.source,3,Go.expandLineSelection(r,r.getCursorStates())),r.revealPrimaryCursor(n.source,!0)}}Be(Nat);class Rat{constructor(e,t){this._selection=e,this._cursors=t,this._selectionId=null}getEditOperations(e,t){const n=Mat(e,this._cursors);for(let r=0,o=n.length;rs.lineNumber===a.lineNumber?s.column-a.column:s.lineNumber-a.lineNumber);for(let s=e.length-2;s>=0;s--)e[s].lineNumber===e[s+1].lineNumber&&e.splice(s,1);const t=[];let n=0,r=0;const o=e.length;for(let s=1,a=i.getLineCount();s<=a;s++){const l=i.getLineContent(s),c=l.length+1;let u=0;if(r=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Pat=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let OU=class{constructor(e,t,n,r){this._languageConfigurationService=r,this._selection=e,this._isMovingDown=t,this._autoIndent=n,this._selectionId=null,this._moveEndLineSelectionShrink=!1}getEditOperations(e,t){const n=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===n){this._selectionId=t.trackSelection(this._selection);return}if(!this._isMovingDown&&this._selection.startLineNumber===1){this._selectionId=t.trackSelection(this._selection);return}this._moveEndPositionDown=!1;let r=this._selection;r.startLineNumbere.tokenization.getLineTokens(u),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(u,d)=>e.getLanguageIdAtPosition(u,d)},getLineContent:null};if(r.startLineNumber===r.endLineNumber&&e.getLineMaxColumn(r.startLineNumber)===1){const u=r.startLineNumber,d=this._isMovingDown?u+1:u-1;e.getLineMaxColumn(d)===1?t.addEditOperation(new B(1,1,1,1),null):(t.addEditOperation(new B(u,1,u,1),e.getLineContent(d)),t.addEditOperation(new B(d,1,d,e.getLineMaxColumn(d)),null)),r=new yt(d,1,d,1)}else{let u,d;if(this._isMovingDown){u=r.endLineNumber+1,d=e.getLineContent(u),t.addEditOperation(new B(u-1,e.getLineMaxColumn(u-1),u,e.getLineMaxColumn(u)),null);let h=d;if(this.shouldAutoIndent(e,r)){const f=this.matchEnterRule(e,l,o,u,r.startLineNumber-1);if(f!==null){const p=bi(e.getLineContent(u)),v=f+vl(p,o);h=FE(v,o,a)+this.trimStart(d)}else{c.getLineContent=v=>v===r.startLineNumber?e.getLineContent(u):e.getLineContent(v);const p=gE(this._autoIndent,c,e.getLanguageIdAtPosition(u,1),r.startLineNumber,l,this._languageConfigurationService);if(p!==null){const v=bi(e.getLineContent(u)),m=vl(p,o),_=vl(v,o);m!==_&&(h=FE(m,o,a)+this.trimStart(d))}}t.addEditOperation(new B(r.startLineNumber,1,r.startLineNumber,1),h+` `);const g=this.matchEnterRuleMovingDown(e,l,o,r.startLineNumber,u,h);if(g!==null)g!==0&&this.getIndentEditsOfMovingBlock(e,t,r,o,a,g);else{c.getLineContent=v=>v===r.startLineNumber?h:v>=r.startLineNumber+1&&v<=r.endLineNumber+1?e.getLineContent(v-1):e.getLineContent(v);const p=gE(this._autoIndent,c,e.getLanguageIdAtPosition(u,1),r.startLineNumber+1,l,this._languageConfigurationService);if(p!==null){const v=bi(e.getLineContent(r.startLineNumber)),m=vl(p,o),_=vl(v,o);if(m!==_){const y=m-_;this.getIndentEditsOfMovingBlock(e,t,r,o,a,y)}}}}else t.addEditOperation(new B(r.startLineNumber,1,r.startLineNumber,1),h+` `)}else if(u=r.startLineNumber-1,d=e.getLineContent(u),t.addEditOperation(new B(u,1,u+1,1),null),t.addEditOperation(new B(r.endLineNumber,e.getLineMaxColumn(r.endLineNumber),r.endLineNumber,e.getLineMaxColumn(r.endLineNumber)),` -`+d),this.shouldAutoIndent(e,r)){c.getLineContent=f=>f===u?e.getLineContent(r.startLineNumber):e.getLineContent(f);const h=this.matchEnterRule(e,l,o,r.startLineNumber,r.startLineNumber-2);if(h!==null)h!==0&&this.getIndentEditsOfMovingBlock(e,t,r,o,a,h);else{const f=gE(this._autoIndent,c,e.getLanguageIdAtPosition(r.startLineNumber,1),u,l,this._languageConfigurationService);if(f!==null){const g=bi(e.getLineContent(r.startLineNumber)),p=vl(f,o),v=vl(g,o);if(p!==v){const m=p-v;this.getIndentEditsOfMovingBlock(e,t,r,o,a,m)}}}}}this._selectionId=t.trackSelection(r)}buildIndentConverter(e,t,n){return{shiftIndent:r=>jc.shiftIndent(r,r.length+1,e,t,n),unshiftIndent:r=>jc.unshiftIndent(r,r.length+1,e,t,n)}}parseEnterResult(e,t,n,r,o){if(o){let s=o.indentation;o.indentAction===qr.None||o.indentAction===qr.Indent?s=o.indentation+o.appendText:o.indentAction===qr.IndentOutdent?s=o.indentation:o.indentAction===qr.Outdent&&(s=t.unshiftIndent(o.indentation)+o.appendText);const a=e.getLineContent(r);if(this.trimStart(a).indexOf(this.trimStart(s))>=0){const l=bi(e.getLineContent(r));let c=bi(s);const u=Ive(e,r,this._languageConfigurationService);u!==null&&u&2&&(c=t.unshiftIndent(c));const d=vl(c,n),h=vl(l,n);return d-h}}return null}matchEnterRuleMovingDown(e,t,n,r,o,s){if(th(s)>=0){const a=e.getLineMaxColumn(o),l=Hy(this._autoIndent,e,new B(o,a,o,a),this._languageConfigurationService);return this.parseEnterResult(e,t,n,r,l)}else{let a=r-1;for(;a>=1;){const u=e.getLineContent(a);if(th(u)>=0)break;a--}if(a<1||r>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=Hy(this._autoIndent,e,new B(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,n,r,c)}}matchEnterRule(e,t,n,r,o,s){let a=o;for(;a>=1;){let u;if(a===o&&s!==void 0?u=s:u=e.getLineContent(a),th(u)>=0)break;a--}if(a<1||r>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=Hy(this._autoIndent,e,new B(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,n,r,c)}trimStart(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4||!e.tokenization.isCheapToTokenize(t.startLineNumber))return!1;const n=e.getLanguageIdAtPosition(t.startLineNumber,1),r=e.getLanguageIdAtPosition(t.endLineNumber,1);return!(n!==r||this._languageConfigurationService.getLanguageConfiguration(n).indentRulesSupport===null)}getIndentEditsOfMovingBlock(e,t,n,r,o,s){for(let a=n.startLineNumber;a<=n.endLineNumber;a++){const l=e.getLineContent(a),c=bi(l),d=vl(c,r)+s,h=FE(d,r,o);h!==c&&(t.addEditOperation(new B(a,1,a,c.length+1),h),a===n.endLineNumber&&n.endColumn<=c.length+1&&h===""&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,t){let n=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(n=n.setEndPosition(n.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&n.startLineNumber=r)return null;const o=[];for(let a=n;a<=r;a++)o.push(i.getLineContent(a));let s=o.slice(0);return s.sort(Nv.getCollator().compare),t===!0&&(s=s.reverse()),{startLineNumber:n,endLineNumber:r,before:o,after:s}}function Oat(i,e,t){const n=M1e(i,e,t);return n?Xi.replace(new B(n.startLineNumber,1,n.endLineNumber,i.getLineMaxColumn(n.endLineNumber)),n.after.join(` -`)):null}class A1e extends gt{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const n=t.getSelections().map((s,a)=>({selection:s,index:a,ignore:!1}));n.sort((s,a)=>B.compareRangesUsingStarts(s.selection,a.selection));let r=n[0];for(let s=1;snew ae(a.positionLineNumber,a.positionColumn)));const o=t.getSelection();if(o===null)return;const s=new Rat(o,r);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop()}}c5.ID="editor.action.trimTrailingWhitespace";class jat extends gt{constructor(){super({id:"editor.action.deleteLines",label:w("lines.delete","Delete Line"),alias:"Delete Line",precondition:j.writable,kbOpts:{kbExpr:j.textInputFocus,primary:3113,weight:100}})}run(e,t){if(!t.hasModel())return;const n=this._getLinesToRemove(t),r=t.getModel();if(r.getLineCount()===1&&r.getLineMaxColumn(1)===1)return;let o=0;const s=[],a=[];for(let l=0,c=n.length;l1&&(d-=1,f=r.getLineMaxColumn(d)),s.push(Xi.replace(new yt(d,f,h,g),"")),a.push(new yt(d-o,u.positionColumn,d-o,u.positionColumn)),o+=u.endLineNumber-u.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,s,a),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map(o=>{let s=o.endLineNumber;return o.startLineNumbero.startLineNumber===s.startLineNumber?o.endLineNumber-s.endLineNumber:o.startLineNumber-s.startLineNumber);const n=[];let r=t[0];for(let o=1;o=t[o].startLineNumber?r.endLineNumber=t[o].endLineNumber:(n.push(r),r=t[o]);return n.push(r),n}}class Kat extends gt{constructor(){super({id:"editor.action.indentLines",label:w("lines.indent","Indent Line"),alias:"Indent Line",precondition:j.writable,kbOpts:{kbExpr:j.editorTextFocus,primary:2142,weight:100}})}run(e,t){const n=t._getViewModel();n&&(t.pushUndoStop(),t.executeCommands(this.id,rr.indent(n.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class Gat extends gt{constructor(){super({id:"editor.action.outdentLines",label:w("lines.outdent","Outdent Line"),alias:"Outdent Line",precondition:j.writable,kbOpts:{kbExpr:j.editorTextFocus,primary:2140,weight:100}})}run(e,t){Vy.Outdent.runEditorCommand(e,t,null)}}class qat extends gt{constructor(){super({id:"editor.action.insertLineBefore",label:w("lines.insertBefore","Insert Line Above"),alias:"Insert Line Above",precondition:j.writable,kbOpts:{kbExpr:j.editorTextFocus,primary:3075,weight:100}})}run(e,t){const n=t._getViewModel();n&&(t.pushUndoStop(),t.executeCommands(this.id,rr.lineInsertBefore(n.cursorConfig,t.getModel(),t.getSelections())))}}class Xat extends gt{constructor(){super({id:"editor.action.insertLineAfter",label:w("lines.insertAfter","Insert Line Below"),alias:"Insert Line Below",precondition:j.writable,kbOpts:{kbExpr:j.editorTextFocus,primary:2051,weight:100}})}run(e,t){const n=t._getViewModel();n&&(t.pushUndoStop(),t.executeCommands(this.id,rr.lineInsertAfter(n.cursorConfig,t.getModel(),t.getSelections())))}}class F1e extends gt{run(e,t){if(!t.hasModel())return;const n=t.getSelection(),r=this._getRangesToDelete(t),o=[];for(let l=0,c=r.length-1;lXi.replace(l,""));t.pushUndoStop(),t.executeEdits(this.id,a,s),t.pushUndoStop()}}class Yat extends F1e{constructor(){super({id:"deleteAllLeft",label:w("lines.deleteAllLeft","Delete All Left"),alias:"Delete All Left",precondition:j.writable,kbOpts:{kbExpr:j.textInputFocus,primary:0,mac:{primary:2049},weight:100}})}_getEndCursorState(e,t){let n=null;const r=[];let o=0;return t.forEach(s=>{let a;if(s.endColumn===1&&o>0){const l=s.startLineNumber-o;a=new yt(l,s.startColumn,l,s.startColumn)}else a=new yt(s.startLineNumber,s.startColumn,s.startLineNumber,s.startColumn);o+=s.endLineNumber-s.startLineNumber,s.intersectRanges(e)?n=a:r.push(a)}),n&&r.unshift(n),r}_getRangesToDelete(e){const t=e.getSelections();if(t===null)return[];let n=t;const r=e.getModel();return r===null?[]:(n.sort(B.compareRangesUsingStarts),n=n.map(o=>{if(o.isEmpty())if(o.startColumn===1){const s=Math.max(1,o.startLineNumber-1),a=o.startLineNumber===1?1:r.getLineLength(s)+1;return new B(s,a,o.startLineNumber,1)}else return new B(o.startLineNumber,1,o.startLineNumber,o.startColumn);else return new B(o.startLineNumber,1,o.endLineNumber,o.endColumn)}),n)}}class Zat extends F1e{constructor(){super({id:"deleteAllRight",label:w("lines.deleteAllRight","Delete All Right"),alias:"Delete All Right",precondition:j.writable,kbOpts:{kbExpr:j.textInputFocus,primary:0,mac:{primary:297,secondary:[2068]},weight:100}})}_getEndCursorState(e,t){let n=null;const r=[];for(let o=0,s=t.length,a=0;o{if(o.isEmpty()){const s=t.getLineMaxColumn(o.startLineNumber);return o.startColumn===s?new B(o.startLineNumber,o.startColumn,o.startLineNumber+1,1):new B(o.startLineNumber,o.startColumn,o.startLineNumber,s)}return o});return r.sort(B.compareRangesUsingStarts),r}}class Qat extends gt{constructor(){super({id:"editor.action.joinLines",label:w("lines.joinLines","Join Lines"),alias:"Join Lines",precondition:j.writable,kbOpts:{kbExpr:j.editorTextFocus,primary:0,mac:{primary:296},weight:100}})}run(e,t){const n=t.getSelections();if(n===null)return;let r=t.getSelection();if(r===null)return;n.sort(B.compareRangesUsingStarts);const o=[],s=n.reduce((h,f)=>h.isEmpty()?h.endLineNumber===f.startLineNumber?(r.equalsSelection(h)&&(r=f),f):f.startLineNumber>h.endLineNumber+1?(o.push(h),f):new yt(h.startLineNumber,h.startColumn,f.endLineNumber,f.endColumn):f.startLineNumber>h.endLineNumber?(o.push(h),f):new yt(h.startLineNumber,h.startColumn,f.endLineNumber,f.endColumn));o.push(s);const a=t.getModel();if(a===null)return;const l=[],c=[];let u=r,d=0;for(let h=0,f=o.length;h=1){let M=!0;L===""&&(M=!1),M&&(L.charAt(L.length-1)===" "||L.charAt(L.length-1)===" ")&&(M=!1,L=L.replace(/[\s\uFEFF\xA0]+$/g," "));const A=k.substr(T-1);L+=(M?" ":"")+A,M?m=A.length+1:m=A.length}else m=0}const E=new B(p,v,_,y);if(!E.isEmpty()){let D;g.isEmpty()?(l.push(Xi.replace(E,L)),D=new yt(E.startLineNumber-d,L.length-m+1,p-d,L.length-m+1)):g.startLineNumber===g.endLineNumber?(l.push(Xi.replace(E,L)),D=new yt(g.startLineNumber-d,g.startColumn,g.endLineNumber-d,g.endColumn)):(l.push(Xi.replace(E,L)),D=new yt(g.startLineNumber-d,g.startColumn,g.startLineNumber-d,L.length-S)),B.intersectRanges(E,r)!==null?u=D:c.push(D)}d+=E.endLineNumber-E.startLineNumber}c.unshift(u),t.pushUndoStop(),t.executeEdits(this.id,l,c),t.pushUndoStop()}}class Jat extends gt{constructor(){super({id:"editor.action.transpose",label:w("editor.transpose","Transpose Characters around the Cursor"),alias:"Transpose Characters around the Cursor",precondition:j.writable})}run(e,t){const n=t.getSelections();if(n===null)return;const r=t.getModel();if(r===null)return;const o=[];for(let s=0,a=n.length;s=u){if(c.lineNumber===r.getLineCount())continue;const d=new B(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),h=r.getValueInRange(d).split("").reverse().join("");o.push(new os(new yt(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),h))}else{const d=new B(c.lineNumber,Math.max(1,c.column-1),c.lineNumber,c.column+1),h=r.getValueInRange(d).split("").reverse().join("");o.push(new oX(d,h,new yt(c.lineNumber,c.column+1,c.lineNumber,c.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class US extends gt{run(e,t){const n=t.getSelections();if(n===null)return;const r=t.getModel();if(r===null)return;const o=t.getOption(130),s=[];for(const a of n)if(a.isEmpty()){const l=a.getStartPosition(),c=t.getConfiguredWordAtPosition(l);if(!c)continue;const u=new B(l.lineNumber,c.startColumn,l.lineNumber,c.endColumn),d=r.getValueInRange(u);s.push(Xi.replace(u,this._modifyText(d,o)))}else{const l=r.getValueInRange(a);s.push(Xi.replace(a,this._modifyText(l,o)))}t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop()}}class elt extends US{constructor(){super({id:"editor.action.transformToUppercase",label:w("editor.transformToUppercase","Transform to Uppercase"),alias:"Transform to Uppercase",precondition:j.writable})}_modifyText(e,t){return e.toLocaleUpperCase()}}class tlt extends US{constructor(){super({id:"editor.action.transformToLowercase",label:w("editor.transformToLowercase","Transform to Lowercase"),alias:"Transform to Lowercase",precondition:j.writable})}_modifyText(e,t){return e.toLocaleLowerCase()}}class xC{constructor(e,t){this._pattern=e,this._flags=t,this._actual=null,this._evaluated=!1}get(){if(!this._evaluated){this._evaluated=!0;try{this._actual=new RegExp(this._pattern,this._flags)}catch{}}return this._actual}isSupported(){return this.get()!==null}}class zI extends US{constructor(){super({id:"editor.action.transformToTitlecase",label:w("editor.transformToTitlecase","Transform to Title Case"),alias:"Transform to Title Case",precondition:j.writable})}_modifyText(e,t){const n=zI.titleBoundary.get();return n?e.toLocaleLowerCase().replace(n,r=>r.toLocaleUpperCase()):e}}zI.titleBoundary=new xC("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");class Rv extends US{constructor(){super({id:"editor.action.transformToSnakecase",label:w("editor.transformToSnakecase","Transform to Snake Case"),alias:"Transform to Snake Case",precondition:j.writable})}_modifyText(e,t){const n=Rv.caseBoundary.get(),r=Rv.singleLetters.get();return!n||!r?e:e.replace(n,"$1_$2").replace(r,"$1_$2$3").toLocaleLowerCase()}}Rv.caseBoundary=new xC("(\\p{Ll})(\\p{Lu})","gmu");Rv.singleLetters=new xC("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");class UI extends US{constructor(){super({id:"editor.action.transformToCamelcase",label:w("editor.transformToCamelcase","Transform to Camel Case"),alias:"Transform to Camel Case",precondition:j.writable})}_modifyText(e,t){const n=UI.wordBoundary.get();if(!n)return e;const r=e.split(n);return r.shift()+r.map(s=>s.substring(0,1).toLocaleUpperCase()+s.substring(1)).join("")}}UI.wordBoundary=new xC("[_\\s-]","gm");class bp extends US{static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every(t=>t.isSupported())}constructor(){super({id:"editor.action.transformToKebabcase",label:w("editor.transformToKebabcase","Transform to Kebab Case"),alias:"Transform to Kebab Case",precondition:j.writable})}_modifyText(e,t){const n=bp.caseBoundary.get(),r=bp.singleLetters.get(),o=bp.underscoreBoundary.get();return!n||!r||!o?e:e.replace(o,"$1-$3").replace(n,"$1-$2").replace(r,"$1-$2").toLocaleLowerCase()}}bp.caseBoundary=new xC("(\\p{Ll})(\\p{Lu})","gmu");bp.singleLetters=new xC("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu");bp.underscoreBoundary=new xC("(\\S)(_)(\\S)","gm");Be(Fat);Be(Bat);Be(Wat);Be($at);Be(Hat);Be(Vat);Be(zat);Be(Uat);Be(c5);Be(jat);Be(Kat);Be(Gat);Be(qat);Be(Xat);Be(Yat);Be(Zat);Be(Qat);Be(Jat);Be(elt);Be(tlt);Rv.caseBoundary.isSupported()&&Rv.singleLetters.isSupported()&&Be(Rv);UI.wordBoundary.isSupported()&&Be(UI);zI.titleBoundary.isSupported()&&Be(zI);bp.isSupported()&&Be(bp);var nlt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},g2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},VM;const B1e=new st("LinkedEditingInputVisible",!1),ilt="linked-editing-decoration";let p_=VM=class extends fe{static get(e){return e.getContribution(VM.ID)}constructor(e,t,n,r,o){super(),this.languageConfigurationService=r,this._syncRangesToken=0,this._localToDispose=this._register(new Te),this._editor=e,this._providers=n.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=B1e.bindTo(t),this._debounceInformation=o.for(this._providers,"Linked Editing",{max:200}),this._currentDecorations=this._editor.createDecorationsCollection(),this._languageWordPattern=null,this._currentWordPattern=null,this._ignoreChangeEvent=!1,this._localToDispose=this._register(new Te),this._rangeUpdateTriggerPromise=null,this._rangeSyncTriggerPromise=null,this._currentRequestCts=null,this._currentRequestPosition=null,this._currentRequestModelVersion=null,this._register(this._editor.onDidChangeModel(()=>this.reinitialize(!0))),this._register(this._editor.onDidChangeConfiguration(s=>{(s.hasChanged(70)||s.hasChanged(93))&&this.reinitialize(!1)})),this._register(this._providers.onDidChange(()=>this.reinitialize(!1))),this._register(this._editor.onDidChangeModelLanguage(()=>this.reinitialize(!0))),this.reinitialize(!0)}reinitialize(e){const t=this._editor.getModel(),n=t!==null&&(this._editor.getOption(70)||this._editor.getOption(93))&&this._providers.has(t);if(n===this._enabled&&!e||(this._enabled=n,this.clearRanges(),this._localToDispose.clear(),!n||t===null))return;this._localToDispose.add(Je.runAndSubscribe(t.onDidChangeLanguageConfiguration,()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition()}));const r=new nd(this._debounceInformation.get(t)),o=()=>{var l;this._rangeUpdateTriggerPromise=r.trigger(()=>this.updateRanges(),(l=this._debounceDuration)!==null&&l!==void 0?l:this._debounceInformation.get(t))},s=new nd(0),a=l=>{this._rangeSyncTriggerPromise=s.trigger(()=>this._syncRanges(l))};this._localToDispose.add(this._editor.onDidChangeCursorPosition(()=>{o()})),this._localToDispose.add(this._editor.onDidChangeModelContent(l=>{if(!this._ignoreChangeEvent&&this._currentDecorations.length>0){const c=this._currentDecorations.getRange(0);if(c&&l.changes.every(u=>c.intersectRanges(u.range))){a(this._syncRangesToken);return}}o()})),this._localToDispose.add({dispose:()=>{r.dispose(),s.dispose()}}),this.updateRanges()}_syncRanges(e){if(!this._editor.hasModel()||e!==this._syncRangesToken||this._currentDecorations.length===0)return;const t=this._editor.getModel(),n=this._currentDecorations.getRange(0);if(!n||n.startLineNumber!==n.endLineNumber)return this.clearRanges();const r=t.getValueInRange(n);if(this._currentWordPattern){const s=r.match(this._currentWordPattern);if((s?s[0].length:0)!==r.length)return this.clearRanges()}const o=[];for(let s=1,a=this._currentDecorations.length;s1){this.clearRanges();return}const n=this._editor.getModel(),r=n.getVersionId();if(this._currentRequestPosition&&this._currentRequestModelVersion===r){if(t.equals(this._currentRequestPosition))return;if(this._currentDecorations.length>0){const s=this._currentDecorations.getRange(0);if(s&&s.containsPosition(t))return}}this.clearRanges(),this._currentRequestPosition=t,this._currentRequestModelVersion=r;const o=this._currentRequestCts=new wr;try{const s=new Ms(!1),a=await W1e(this._providers,n,t,o.token);if(this._debounceInformation.update(n,s.elapsed()),o!==this._currentRequestCts||(this._currentRequestCts=null,r!==n.getVersionId()))return;let l=[];a!=null&&a.ranges&&(l=a.ranges),this._currentWordPattern=(a==null?void 0:a.wordPattern)||this._languageWordPattern;let c=!1;for(let d=0,h=l.length;d({range:d,options:VM.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations.set(u),this._syncRangesToken++}catch(s){wh(s)||en(s),(this._currentRequestCts===o||!this._currentRequestCts)&&this.clearRanges()}}};p_.ID="editor.contrib.linkedEditing";p_.DECORATION=sn.register({description:"linked-editing",stickiness:0,className:ilt});p_=VM=nlt([g2(1,Vt),g2(2,_t),g2(3,Di),g2(4,gu)],p_);class rlt extends gt{constructor(){super({id:"editor.action.linkedEditing",label:w("linkedEditing.label","Start Linked Editing"),alias:"Start Linked Editing",precondition:De.and(j.writable,j.hasRenameProvider),kbOpts:{kbExpr:j.editorTextFocus,primary:3132,weight:100}})}runCommand(e,t){const n=e.get(Un),[r,o]=Array.isArray(t)&&t||[void 0,void 0];return At.isUri(r)&&ae.isIPosition(o)?n.openCodeEditor({resource:r},n.getActiveCodeEditor()).then(s=>{s&&(s.setPosition(o),s.invokeWithinContext(a=>(this.reportTelemetry(a,s),this.run(a,s))))},en):super.runCommand(e,t)}run(e,t){const n=p_.get(t);return n?Promise.resolve(n.updateRanges(!0)):Promise.resolve()}}const olt=Vo.bindToContribution(p_.get);et(new olt({id:"cancelLinkedEditingInput",precondition:B1e,handler:i=>i.clearRanges(),kbOpts:{kbExpr:j.editorTextFocus,weight:100+99,primary:9,secondary:[1033]}}));function W1e(i,e,t,n){const r=i.ordered(e);return wq(r.map(o=>async()=>{try{return await o.provideLinkedEditingRanges(e,t,n)}catch(s){Zr(s);return}}),o=>!!o&&Ts(o==null?void 0:o.ranges))}X("editor.linkedEditingBackground",{dark:me.fromHex("#f00").transparent(.3),light:me.fromHex("#f00").transparent(.3),hcDark:me.fromHex("#f00").transparent(.3),hcLight:me.white},w("editorLinkedEditingBackground","Background color when the editor auto renames on type."));tg("_executeLinkedEditingProvider",(i,e,t)=>{const{linkedEditingRangeProvider:n}=i.get(_t);return W1e(n,e,t,Cn.None)});jn(p_.ID,p_,1);Be(rlt);let slt=class{constructor(e,t){this._link=e,this._provider=t}toJSON(){return{range:this.range,url:this.url,tooltip:this.tooltip}}get range(){return this._link.range}get url(){return this._link.url}get tooltip(){return this._link.tooltip}async resolve(e){return this._link.url?this._link.url:typeof this._provider.resolveLink=="function"?Promise.resolve(this._provider.resolveLink(this._link,e)).then(t=>(this._link=t||this._link,this._link.url?this.resolve(e):Promise.reject(new Error("missing")))):Promise.reject(new Error("missing"))}};class TO{constructor(e){this._disposables=new Te;let t=[];for(const[n,r]of e){const o=n.links.map(s=>new slt(s,r));t=TO._union(t,o),aq(n)&&this._disposables.add(n)}this.links=t}dispose(){this._disposables.dispose(),this.links.length=0}static _union(e,t){const n=[];let r,o,s,a;for(r=0,s=0,o=e.length,a=t.length;rPromise.resolve(o.provideLinks(e,t)).then(a=>{a&&(n[s]=[a,o])},Zr));return Promise.all(r).then(()=>{const o=new TO(lh(n));return t.isCancellationRequested?(o.dispose(),new TO([])):o})}Dn.registerCommand("_executeLinkProvider",async(i,...e)=>{let[t,n]=e;Xn(t instanceof At),typeof n!="number"&&(n=0);const{linkProvider:r}=i.get(_t),o=i.get(tr).getModel(t);if(!o)return[];const s=await $1e(r,o,Cn.None);if(!s)return[];for(let l=0;l=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},p2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},FU;let oS=FU=class extends fe{static get(e){return e.getContribution(FU.ID)}constructor(e,t,n,r,o){super(),this.editor=e,this.openerService=t,this.notificationService=n,this.languageFeaturesService=r,this.providers=this.languageFeaturesService.linkProvider,this.debounceInformation=o.for(this.providers,"Links",{min:1e3,max:4e3}),this.computeLinks=this._register(new pi(()=>this.computeLinksNow(),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const s=this._register(new M3(e));this._register(s.onMouseMoveOrRelevantKeyDown(([a,l])=>{this._onEditorMouseMove(a,l)})),this._register(s.onExecute(a=>{this.onEditorMouseUp(a)})),this._register(s.onCancel(a=>{this.cleanUpActiveLinkDecoration()})),this._register(e.onDidChangeConfiguration(a=>{a.hasChanged(71)&&(this.updateDecorations([]),this.stop(),this.computeLinks.schedule(0))})),this._register(e.onDidChangeModelContent(a=>{this.editor.hasModel()&&this.computeLinks.schedule(this.debounceInformation.get(this.editor.getModel()))})),this._register(e.onDidChangeModel(a=>{this.currentOccurrences={},this.activeLinkDecorationId=null,this.stop(),this.computeLinks.schedule(0)})),this._register(e.onDidChangeModelLanguage(a=>{this.stop(),this.computeLinks.schedule(0)})),this._register(this.providers.onDidChange(a=>{this.stop(),this.computeLinks.schedule(0)})),this.computeLinks.schedule(0)}async computeLinksNow(){if(!this.editor.hasModel()||!this.editor.getOption(71))return;const e=this.editor.getModel();if(!e.isTooLargeForSyncing()&&this.providers.has(e)){this.activeLinksList&&(this.activeLinksList.dispose(),this.activeLinksList=null),this.computePromise=Io(t=>$1e(this.providers,e,t));try{const t=new Ms(!1);if(this.activeLinksList=await this.computePromise,this.debounceInformation.update(e,t.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(t){en(t)}finally{this.computePromise=null}}}updateDecorations(e){const t=this.editor.getOption(78)==="altKey",n=[],r=Object.keys(this.currentOccurrences);for(const s of r){const a=this.currentOccurrences[s];n.push(a.decorationId)}const o=[];if(e)for(const s of e)o.push(tw.decoration(s,t));this.editor.changeDecorations(s=>{const a=s.deltaDecorations(n,o);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let l=0,c=a.length;l{r.activate(o,n),this.activeLinkDecorationId=r.decorationId})}else this.cleanUpActiveLinkDecoration()}cleanUpActiveLinkDecoration(){const e=this.editor.getOption(78)==="altKey";if(this.activeLinkDecorationId){const t=this.currentOccurrences[this.activeLinkDecorationId];t&&this.editor.changeDecorations(n=>{t.deactivate(n,e)}),this.activeLinkDecorationId=null}}onEditorMouseUp(e){if(!this.isEnabled(e))return;const t=this.getLinkOccurrence(e.target.position);t&&this.openLinkOccurrence(t,e.hasSideBySideModifier,!0)}openLinkOccurrence(e,t,n=!1){if(!this.openerService)return;const{link:r}=e;r.resolve(Cn.None).then(o=>{if(typeof o=="string"&&this.editor.hasModel()){const s=this.editor.getModel().uri;if(s.scheme===an.file&&o.startsWith(`${an.file}:`)){const a=At.parse(o);if(a.scheme===an.file){const l=Gh(a);let c=null;l.startsWith("/./")?c=`.${l.substr(1)}`:l.startsWith("//./")&&(c=`.${l.substr(2)}`),c&&(o=yze(s,c))}}}return this.openerService.open(o,{openToSide:t,fromUserGesture:n,allowContributedOpeners:!0,allowCommands:!0,fromWorkspace:!0})},o=>{const s=o instanceof Error?o.message:o;s==="invalid"?this.notificationService.warn(w("invalid.url","Failed to open this link because it is not well-formed: {0}",r.url.toString())):s==="missing"?this.notificationService.warn(w("missing.url","Failed to open this link because its target is missing.")):en(o)})}getLinkOccurrence(e){if(!this.editor.hasModel()||!e)return null;const t=this.editor.getModel().getDecorationsInRange({startLineNumber:e.lineNumber,startColumn:e.column,endLineNumber:e.lineNumber,endColumn:e.column},0,!0);for(const n of t){const r=this.currentOccurrences[n.id];if(r)return r}return null}isEnabled(e,t){return!!(e.target.type===6&&(e.hasTriggerModifier||t&&t.keyCodeIsTriggerKey))}stop(){var e;this.computeLinks.cancel(),this.activeLinksList&&((e=this.activeLinksList)===null||e===void 0||e.dispose(),this.activeLinksList=null),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop()}};oS.ID="editor.linkDetector";oS=FU=alt([p2(1,al),p2(2,$r),p2(3,_t),p2(4,gu)],oS);const Sle={general:sn.register({description:"detected-link",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:sn.register({description:"detected-link-active",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class tw{static decoration(e,t){return{range:e.range,options:tw._getOptions(e,t,!1)}}static _getOptions(e,t,n){const r={...n?Sle.active:Sle.general};return r.hoverMessage=llt(e,t),r}constructor(e,t){this.link=e,this.decorationId=t}activate(e,t){e.changeDecorationOptions(this.decorationId,tw._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,tw._getOptions(this.link,t,!1))}}function llt(i,e){const t=i.url&&/^command:/i.test(i.url.toString()),n=i.tooltip?i.tooltip:t?w("links.navigate.executeCmd","Execute command"):w("links.navigate.follow","Follow link"),r=e?Ln?w("links.navigate.kb.meta.mac","cmd + click"):w("links.navigate.kb.meta","ctrl + click"):Ln?w("links.navigate.kb.alt.mac","option + click"):w("links.navigate.kb.alt","alt + click");if(i.url){let o="";if(/^command:/i.test(i.url.toString())){const a=i.url.toString().match(/^command:([^?#]+)/);if(a){const l=a[1];o=w("tooltip.explanation","Execute command {0}",l)}}return new Is("",!0).appendLink(i.url.toString(!0).replace(/ /g,"%20"),n,o).appendMarkdown(` (${r})`)}else return new Is().appendText(`${n} (${r})`)}class clt extends gt{constructor(){super({id:"editor.action.openLink",label:w("label","Open Link"),alias:"Open Link",precondition:void 0})}run(e,t){const n=oS.get(t);if(!n||!t.hasModel())return;const r=t.getSelections();for(const o of r){const s=n.getLinkOccurrence(o.getEndPosition());s&&n.openLinkOccurrence(s,!1)}}}jn(oS.ID,oS,1);Be(clt);class BU extends fe{constructor(e){super(),this._editor=e,this._register(this._editor.onMouseDown(t=>{const n=this._editor.getOption(117);n>=0&&t.target.type===6&&t.target.position.column>=n&&this._editor.updateOptions({stopRenderingLineAfter:-1})}))}}BU.ID="editor.contrib.longLinesHelper";jn(BU.ID,BU,2);const m2=X("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},w("wordHighlight","Background color of a symbol during read-access, like reading a variable. The color must not be opaque so as not to hide underlying decorations."),!0);X("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},w("wordHighlightStrong","Background color of a symbol during write-access, like writing to a variable. The color must not be opaque so as not to hide underlying decorations."),!0);X("editor.wordHighlightTextBackground",{light:m2,dark:m2,hcDark:m2,hcLight:m2},w("wordHighlightText","Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0);const v2=X("editor.wordHighlightBorder",{light:null,dark:null,hcDark:zi,hcLight:zi},w("wordHighlightBorder","Border color of a symbol during read-access, like reading a variable."));X("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:zi,hcLight:zi},w("wordHighlightStrongBorder","Border color of a symbol during write-access, like writing to a variable."));X("editor.wordHighlightTextBorder",{light:v2,dark:v2,hcDark:v2,hcLight:v2},w("wordHighlightTextBorder","Border color of a textual occurrence for a symbol."));const ult=X("editorOverviewRuler.wordHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},w("overviewRulerWordHighlightForeground","Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),dlt=X("editorOverviewRuler.wordHighlightStrongForeground",{dark:"#C0A0C0CC",light:"#C0A0C0CC",hcDark:"#C0A0C0CC",hcLight:"#C0A0C0CC"},w("overviewRulerWordHighlightStrongForeground","Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),hlt=X("editorOverviewRuler.wordHighlightTextForeground",{dark:NL,light:NL,hcDark:NL,hcLight:NL},w("overviewRulerWordHighlightTextForeground","Overview ruler marker color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0),flt=sn.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:fr(dlt),position:mc.Center},minimap:{color:fr(M4),position:Ll.Inline}}),glt=sn.register({description:"word-highlight-text",stickiness:1,className:"wordHighlightText",overviewRuler:{color:fr(hlt),position:mc.Center},minimap:{color:fr(M4),position:Ll.Inline}}),plt=sn.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",overviewRuler:{color:fr(NL),position:mc.Center},minimap:{color:fr(M4),position:Ll.Inline}}),mlt=sn.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"}),vlt=sn.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:fr(ult),position:mc.Center},minimap:{color:fr(M4),position:Ll.Inline}});function _lt(i){return i===xD.Write?flt:i===xD.Text?glt:vlt}function blt(i){return i?mlt:plt}fu((i,e)=>{const t=i.getColor(Zq);t&&e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`)});var Clt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ylt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},WU;function O_(i,e){const t=e.filter(n=>!i.find(r=>r.equals(n)));if(t.length>=1){const n=t.map(o=>`line ${o.viewState.position.lineNumber} column ${o.viewState.position.column}`).join(", "),r=t.length===1?w("cursorAdded","Cursor added: {0}",n):w("cursorsAdded","Cursors added: {0}",n);Hf(r)}}class wlt extends gt{constructor(){super({id:"editor.action.insertCursorAbove",label:w("mutlicursor.insertAbove","Add Cursor Above"),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:j.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:$.MenubarSelectionMenu,group:"3_multi",title:w({key:"miInsertCursorAbove",comment:["&& denotes a mnemonic"]},"&&Add Cursor Above"),order:2}})}run(e,t,n){if(!t.hasModel())return;let r=!0;n&&n.logicalLine===!1&&(r=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const s=o.getCursorStates();o.setCursorStates(n.source,3,Go.addCursorUp(o,s,r)),o.revealTopMostCursor(n.source),O_(s,o.getCursorStates())}}class Slt extends gt{constructor(){super({id:"editor.action.insertCursorBelow",label:w("mutlicursor.insertBelow","Add Cursor Below"),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:j.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:$.MenubarSelectionMenu,group:"3_multi",title:w({key:"miInsertCursorBelow",comment:["&& denotes a mnemonic"]},"A&&dd Cursor Below"),order:3}})}run(e,t,n){if(!t.hasModel())return;let r=!0;n&&n.logicalLine===!1&&(r=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const s=o.getCursorStates();o.setCursorStates(n.source,3,Go.addCursorDown(o,s,r)),o.revealBottomMostCursor(n.source),O_(s,o.getCursorStates())}}class xlt extends gt{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:w("mutlicursor.insertAtEndOfEachLineSelected","Add Cursors to Line Ends"),alias:"Add Cursors to Line Ends",precondition:void 0,kbOpts:{kbExpr:j.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:$.MenubarSelectionMenu,group:"3_multi",title:w({key:"miInsertCursorAtEndOfEachLineSelected",comment:["&& denotes a mnemonic"]},"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,t,n){if(!e.isEmpty()){for(let r=e.startLineNumber;r1&&n.push(new yt(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const n=t.getModel(),r=t.getSelections(),o=t._getViewModel(),s=o.getCursorStates(),a=[];r.forEach(l=>this.getCursorsForSelection(l,n,a)),a.length>0&&t.setSelections(a),O_(s,o.getCursorStates())}}class Llt extends gt{constructor(){super({id:"editor.action.addCursorsToBottom",label:w("mutlicursor.addCursorsToBottom","Add Cursors To Bottom"),alias:"Add Cursors To Bottom",precondition:void 0})}run(e,t){if(!t.hasModel())return;const n=t.getSelections(),r=t.getModel().getLineCount(),o=[];for(let l=n[0].startLineNumber;l<=r;l++)o.push(new yt(l,n[0].startColumn,l,n[0].endColumn));const s=t._getViewModel(),a=s.getCursorStates();o.length>0&&t.setSelections(o),O_(a,s.getCursorStates())}}class Elt extends gt{constructor(){super({id:"editor.action.addCursorsToTop",label:w("mutlicursor.addCursorsToTop","Add Cursors To Top"),alias:"Add Cursors To Top",precondition:void 0})}run(e,t){if(!t.hasModel())return;const n=t.getSelections(),r=[];for(let a=n[0].startLineNumber;a>=1;a--)r.push(new yt(a,n[0].startColumn,a,n[0].endColumn));const o=t._getViewModel(),s=o.getCursorStates();r.length>0&&t.setSelections(r),O_(s,o.getCursorStates())}}class _2{constructor(e,t,n){this.selections=e,this.revealRange=t,this.revealScrollType=n}}class jI{static create(e,t){if(!e.hasModel())return null;const n=t.getState();if(!e.hasTextFocus()&&n.isRevealed&&n.searchString.length>0)return new jI(e,t,!1,n.searchString,n.wholeWord,n.matchCase,null);let r=!1,o,s;const a=e.getSelections();a.length===1&&a[0].isEmpty()?(r=!0,o=!0,s=!0):(o=n.wholeWord,s=n.matchCase);const l=e.getSelection();let c,u=null;if(l.isEmpty()){const d=e.getConfiguredWordAtPosition(l.getStartPosition());if(!d)return null;c=d.word,u=new yt(l.startLineNumber,d.startColumn,l.startLineNumber,d.endColumn)}else c=e.getModel().getValueInRange(l).replace(/\r\n/g,` -`);return new jI(e,t,r,c,o,s,u)}constructor(e,t,n,r,o,s,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=n,this.searchText=r,this.wholeWord=o,this.matchCase=s,this.currentMatch=a}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new _2(t.concat(e),e,0)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new _2(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const r=this.currentMatch;return this.currentMatch=null,r}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],n=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(130):null,!1);return n?new yt(n.range.startLineNumber,n.range.startColumn,n.range.endLineNumber,n.range.endColumn):null}addSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new _2(t.concat(e),e,0)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new _2(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const r=this.currentMatch;return this.currentMatch=null,r}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],n=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(130):null,!1);return n?new yt(n.range.startLineNumber,n.range.startColumn,n.range.endLineNumber,n.range.endColumn):null}selectAll(e){if(!this._editor.hasModel())return[];this.findController.highlightFindOptions();const t=this._editor.getModel();return e?t.findMatches(this.searchText,e,!1,this.matchCase,this.wholeWord?this._editor.getOption(130):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(130):null,!1,1073741824)}}class Yb extends fe{static get(e){return e.getContribution(Yb.ID)}constructor(e){super(),this._sessionDispose=this._register(new Te),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=jI.create(this._editor,e);if(!t)return;this._session=t;const n={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(n.wholeWordOverride=1,n.matchCaseOverride=1,n.isRegexOverride=2),e.getState().change(n,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(r=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(r=>{(r.matchCase||r.wholeWord)&&this._endSession()}))}}_endSession(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){const e={wholeWordOverride:0,matchCaseOverride:0,isRegexOverride:0};this._session.findController.getState().change(e,!1)}this._session=null}_setSelections(e){this._ignoreSelectionChange=!0,this._editor.setSelections(e),this._ignoreSelectionChange=!1}_expandEmptyToWord(e,t){if(!t.isEmpty())return t;const n=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return n?new yt(t.startLineNumber,n.startColumn,t.startLineNumber,n.endColumn):t}_applySessionResult(e){e&&(this._setSelections(e.selections),e.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange,e.revealScrollType))}getSession(e){return this._session}addSelectionToNextFindMatch(e){if(this._editor.hasModel()){if(!this._session){const t=this._editor.getSelections();if(t.length>1){const r=e.getState().matchCase;if(!H1e(this._editor.getModel(),t,r)){const s=this._editor.getModel(),a=[];for(let l=0,c=t.length;l0&&n.isRegex){const r=this._editor.getModel();n.searchScope?t=r.findMatches(n.searchString,n.searchScope,n.isRegex,n.matchCase,n.wholeWord?this._editor.getOption(130):null,!1,1073741824):t=r.findMatches(n.searchString,!0,n.isRegex,n.matchCase,n.wholeWord?this._editor.getOption(130):null,!1,1073741824)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(n.searchScope)}if(t.length>0){const r=this._editor.getSelection();for(let o=0,s=t.length;onew yt(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn)))}}}Yb.ID="editor.contrib.multiCursorController";class jS extends gt{run(e,t){const n=Yb.get(t);if(!n)return;const r=t._getViewModel();if(r){const o=r.getCursorStates(),s=ka.get(t);if(s)this._run(n,s);else{const a=e.get(Ot).createInstance(ka,t);this._run(n,a),a.dispose()}O_(o,r.getCursorStates())}}}class Dlt extends jS{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:w("addSelectionToNextFindMatch","Add Selection To Next Find Match"),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:j.focus,primary:2082,weight:100},menuOpts:{menuId:$.MenubarSelectionMenu,group:"3_multi",title:w({key:"miAddSelectionToNextFindMatch",comment:["&& denotes a mnemonic"]},"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class Ilt extends jS{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:w("addSelectionToPreviousFindMatch","Add Selection To Previous Find Match"),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:$.MenubarSelectionMenu,group:"3_multi",title:w({key:"miAddSelectionToPreviousFindMatch",comment:["&& denotes a mnemonic"]},"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class klt extends jS{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:w("moveSelectionToNextFindMatch","Move Last Selection To Next Find Match"),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:j.focus,primary:co(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class Tlt extends jS{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:w("moveSelectionToPreviousFindMatch","Move Last Selection To Previous Find Match"),alias:"Move Last Selection To Previous Find Match",precondition:void 0})}_run(e,t){e.moveSelectionToPreviousFindMatch(t)}}class Nlt extends jS{constructor(){super({id:"editor.action.selectHighlights",label:w("selectAllOccurrencesOfFindMatch","Select All Occurrences of Find Match"),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:j.focus,primary:3114,weight:100},menuOpts:{menuId:$.MenubarSelectionMenu,group:"3_multi",title:w({key:"miSelectHighlights",comment:["&& denotes a mnemonic"]},"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class Rlt extends jS{constructor(){super({id:"editor.action.changeAll",label:w("changeAll.label","Change All Occurrences"),alias:"Change All Occurrences",precondition:De.and(j.writable,j.editorTextFocus),kbOpts:{kbExpr:j.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class Mlt{constructor(e,t,n,r,o){this._model=e,this._searchText=t,this._matchCase=n,this._wordSeparators=r,this._modelVersionId=this._model.getVersionId(),this._cachedFindMatches=null,o&&this._model===o._model&&this._searchText===o._searchText&&this._matchCase===o._matchCase&&this._wordSeparators===o._wordSeparators&&this._modelVersionId===o._modelVersionId&&(this._cachedFindMatches=o._cachedFindMatches)}findMatches(){return this._cachedFindMatches===null&&(this._cachedFindMatches=this._model.findMatches(this._searchText,!0,!1,this._matchCase,this._wordSeparators,!1).map(e=>e.range),this._cachedFindMatches.sort(B.compareRangesUsingStarts)),this._cachedFindMatches}}let KI=WU=class extends fe{constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(108),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new pi(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(r=>{this._isEnabled=e.getOption(108)})),this._register(e.onDidChangeCursorSelection(r=>{this._isEnabled&&(r.selection.isEmpty()?r.reason===3?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())})),this._register(e.onDidChangeModel(r=>{this._setState(null)})),this._register(e.onDidChangeModelContent(r=>{this._isEnabled&&this.updateSoon.schedule()}));const n=ka.get(e);n&&this._register(n.getState().onFindReplaceStateChange(r=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(WU._createState(this.state,this._isEnabled,this.editor))}static _createState(e,t,n){if(!t||!n.hasModel())return null;const r=n.getSelection();if(r.startLineNumber!==r.endLineNumber)return null;const o=Yb.get(n);if(!o)return null;const s=ka.get(n);if(!s)return null;let a=o.getSession(s);if(!a){const u=n.getSelections();if(u.length>1){const h=s.getState().matchCase;if(!H1e(n.getModel(),u,h))return null}a=jI.create(n,s)}if(!a||a.currentMatch||/^[ \t]+$/.test(a.searchText)||a.searchText.length>200)return null;const l=s.getState(),c=l.matchCase;if(l.isRevealed){let u=l.searchString;c||(u=u.toLowerCase());let d=a.searchText;if(c||(d=d.toLowerCase()),u===d&&a.matchCase===l.matchCase&&a.wholeWord===l.wholeWord&&!l.isRegex)return null}return new Mlt(n.getModel(),a.searchText,a.matchCase,a.wholeWord?n.getOption(130):null,e)}_setState(e){if(this.state=e,!this.state){this._decorations.clear();return}if(!this.editor.hasModel())return;const t=this.editor.getModel();if(t.isTooLargeForTokenization())return;const n=this.state.findMatches(),r=this.editor.getSelections();r.sort(B.compareRangesUsingStarts);const o=[];for(let c=0,u=0,d=n.length,h=r.length;c=h)o.push(f),c++;else{const g=B.compareRangesUsingStarts(f,r[u]);g<0?((r[u].isEmpty()||!B.areIntersecting(f,r[u]))&&o.push(f),c++):(g>0||c++,u++)}}const s=this.editor.getOption(81)!=="off",a=this._languageFeaturesService.documentHighlightProvider.has(t)&&s,l=o.map(c=>({range:c,options:blt(a)}));this._decorations.set(l)}dispose(){this._setState(null),super.dispose()}};KI.ID="editor.contrib.selectionHighlighter";KI=WU=Clt([ylt(1,_t)],KI);function H1e(i,e,t){const n=xle(i,e[0],!t);for(let r=1,o=e.length;r=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Hlt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const z9="inline-edit";let $U=class extends fe{constructor(e,t,n){super(),this.editor=e,this.model=t,this.languageService=n,this.isDisposed=Hn(this,!1),this.currentTextModel=Vi(this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=Yt(this,r=>{var o;if(this.isDisposed.read(r))return;const s=this.currentTextModel.read(r);if(s!==this.model.targetTextModel.read(r))return;const a=this.model.ghostText.read(r);if(!a)return;let l=(o=this.model.range)===null||o===void 0?void 0:o.read(r);l&&l.startLineNumber===l.endLineNumber&&l.startColumn===l.endColumn&&(l=void 0);const c=(l?l.startLineNumber===l.endLineNumber:!0)&&a.parts.length===1&&a.parts[0].lines.length===1,u=a.parts.length===1&&a.parts[0].lines.every(y=>y.length===0),d=[],h=[];function f(y,S){if(h.length>0){const L=h[h.length-1];S&&L.decorations.push(new Ca(L.content.length+1,L.content.length+1+y[0].length,S,0)),L.content+=y[0],y=y.slice(1)}for(const L of y)h.push({content:L,decorations:S?[new Ca(1,L.length+1,S,0)]:[]})}const g=s.getLineContent(a.lineNumber);let p,v=0;if(!u){for(const y of a.parts){let S=y.lines;l&&!c&&(f(S,z9),S=[]),p===void 0?(d.push({column:y.column,text:S[0],preview:y.preview}),S=S.slice(1)):f([g.substring(v,y.column-1)],void 0),S.length>0&&(f(S,z9),p===void 0&&y.column<=g.length&&(p=y.column)),v=y.column-1}p!==void 0&&f([g.substring(v)],void 0)}const m=p!==void 0?new C1e(p,g.length+1):void 0,_=c||!l?a.lineNumber:l.endLineNumber-1;return{inlineTexts:d,additionalLines:h,hiddenRange:m,lineNumber:_,additionalReservedLineCount:this.model.minReservedLineCount.read(r),targetTextModel:s,range:l,isSingleLine:c,isPureRemove:u,backgroundColoring:this.model.backgroundColoring.read(r)}}),this.decorations=Yt(this,r=>{const o=this.uiState.read(r);if(!o)return[];const s=[];if(o.hiddenRange&&s.push({range:o.hiddenRange.toRange(o.lineNumber),options:{inlineClassName:"inline-edit-hidden",description:"inline-edit-hidden"}}),o.range){const a=[];if(o.isSingleLine)a.push(o.range);else if(o.isPureRemove){const c=o.range.endLineNumber-o.range.startLineNumber;for(let u=0;u{const o=this.uiState.read(r);return o&&!o.isPureRemove?{lineNumber:o.lineNumber,additionalLines:o.additionalLines,minReservedLineCount:o.additionalReservedLineCount,targetTextModel:o.targetTextModel}:void 0}))),this._register(Rt(()=>{this.isDisposed.set(!0,void 0)})),this._register(y1e(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};$U=$lt([Hlt(2,ji)],$U);var uZ=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Ug=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},zM;let HU=class extends fe{constructor(e,t,n){super(),this.editor=e,this.model=t,this.instantiationService=n,this.alwaysShowToolbar=Vi(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(63).showToolbar==="always"),this.sessionPosition=void 0,this.position=Yt(this,r=>{var o,s,a;const l=(o=this.model.read(r))===null||o===void 0?void 0:o.widget.model.ghostText.read(r);if(!this.alwaysShowToolbar.read(r)||!l||l.parts.length===0)return this.sessionPosition=void 0,null;const c=l.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==l.lineNumber&&(this.sessionPosition=void 0);const u=new ae(l.lineNumber,Math.min(c,(a=(s=this.sessionPosition)===null||s===void 0?void 0:s.column)!==null&&a!==void 0?a:Number.MAX_SAFE_INTEGER));return this.sessionPosition=u,u}),this._register(Dh((r,o)=>{if(!this.model.read(r)||!this.alwaysShowToolbar.read(r))return;const a=o.add(this.instantiationService.createInstance(sS,this.editor,!0,this.position));e.addContentWidget(a),o.add(Rt(()=>e.removeContentWidget(a)))}))}};HU=uZ([Ug(2,Ot)],HU);let sS=zM=class extends fe{constructor(e,t,n,r,o,s){super(),this.editor=e,this.withBorder=t,this._position=n,this._contextKeyService=o,this._menuService=s,this.id=`InlineEditHintsContentWidget${zM.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=gi("div.inlineEditHints",{className:this.withBorder?".withBorder":""},[gi("div@toolBar")]),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu($.InlineEditActions,this._contextKeyService)),this.toolBar=this._register(r.createInstance(VU,this.nodes.toolBar,this.editor,$.InlineEditToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:a=>a.startsWith("primary")},actionViewItemProvider:(a,l)=>{if(a instanceof pc)return r.createInstance(Vlt,a,void 0)},telemetrySource:"InlineEditToolbar"})),this._register(this.toolBar.onDidChangeDropdownVisibility(a=>{zM._dropDownVisible=a})),this._register(bn(a=>{this._position.read(a),this.editor.layoutContentWidget(this)})),this._register(bn(a=>{const l=[];for(const[c,u]of this.inlineCompletionsActionsMenus.getActions())for(const d of u)d instanceof pc&&l.push(d);l.length>0&&l.unshift(new lo),this.toolBar.setAdditionalSecondaryActions(l)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};sS._dropDownVisible=!1;sS.id=0;sS=zM=uZ([Ug(3,Ot),Ug(4,Vt),Ug(5,hu)],sS);class Vlt extends t_{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=gi("div.keybinding").root;new PS(t,yl,{disableTitle:!0,...S0e}).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineEditStatusBarItemLabel")}}updateTooltip(){}}let VU=class extends LI{constructor(e,t,n,r,o,s,a,l,c){super(e,{resetMenu:n,...r},o,s,a,l,c),this.editor=t,this.menuId=n,this.options2=r,this.menuService=o,this.contextKeyService=s,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this._store.add(this.editor.onDidChangeCursorPosition(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var e,t,n,r,o,s,a;const l=[],c=[];i3(this.menu,(e=this.options2)===null||e===void 0?void 0:e.menuOptions,{primary:l,secondary:c},(n=(t=this.options2)===null||t===void 0?void 0:t.toolbarOptions)===null||n===void 0?void 0:n.primaryGroup,(o=(r=this.options2)===null||r===void 0?void 0:r.toolbarOptions)===null||o===void 0?void 0:o.shouldInlineSubmenu,(a=(s=this.options2)===null||s===void 0?void 0:s.toolbarOptions)===null||a===void 0?void 0:a.useSeparatorsInPrimaryActions),c.push(...this.additionalActions),l.unshift(...this.prependedPrimaryActions),this.setActions(l,c)}setAdditionalSecondaryActions(e){or(this.additionalActions,e,(t,n)=>t===n)||(this.additionalActions=e,this.updateToolbar())}};VU=uZ([Ug(4,hu),Ug(5,Vt),Ug(6,Ol),Ug(7,ci),Ug(8,ea)],VU);var zlt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},iL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},q0;class Ult{constructor(e,t){this.widget=e,this.edit=t}dispose(){this.widget.dispose()}}let mo=q0=class extends fe{static get(e){return e.getContribution(q0.ID)}constructor(e,t,n,r,o,s){super(),this.editor=e,this.instantiationService=t,this.contextKeyService=n,this.languageFeaturesService=r,this._commandService=o,this._configurationService=s,this._isVisibleContext=q0.inlineEditVisibleContext.bindTo(this.contextKeyService),this._isCursorAtInlineEditContext=q0.cursorAtInlineEditContext.bindTo(this.contextKeyService),this._currentEdit=this._register(yI(this,void 0)),this._isAccepting=!1,this._enabled=Vi(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(63).enabled),this._fontFamily=Vi(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(63).fontFamily),this._backgroundColoring=Vi(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(63).backgroundColoring);const a=ma("InlineEditController.modelContentChangedSignal",e.onDidChangeModelContent);this._register(bn(h=>{this._enabled.read(h)&&(a.read(h),this.getInlineEdit(e,!0))}));const l=Vi(e.onDidChangeCursorPosition,()=>e.getPosition());this._register(bn(h=>{if(!this._enabled.read(h))return;const f=l.read(h);f&&this.checkCursorPosition(f)})),this._register(bn(h=>{const f=this._currentEdit.read(h);if(this._isCursorAtInlineEditContext.set(!1),!f){this._isVisibleContext.set(!1);return}this._isVisibleContext.set(!0);const g=e.getPosition();g&&this.checkCursorPosition(g)}));const c=ma("InlineEditController.editorBlurSignal",e.onDidBlurEditorWidget);this._register(bn(h=>{var f;this._enabled.read(h)&&(c.read(h),!(this._configurationService.getValue("editor.experimentalInlineEdit.keepOnBlur")||e.getOption(63).keepOnBlur)&&((f=this._currentRequestCts)===null||f===void 0||f.dispose(),this._currentRequestCts=void 0,this.clear(!1)))}));const u=ma("InlineEditController.editorFocusSignal",e.onDidFocusEditorText);this._register(bn(h=>{this._enabled.read(h)&&(u.read(h),this.getInlineEdit(e,!0))}));const d=this._register(sme());this._register(bn(h=>{const f=this._fontFamily.read(h);d.setStyle(f===""||f==="default"?"":` +`+d),this.shouldAutoIndent(e,r)){c.getLineContent=f=>f===u?e.getLineContent(r.startLineNumber):e.getLineContent(f);const h=this.matchEnterRule(e,l,o,r.startLineNumber,r.startLineNumber-2);if(h!==null)h!==0&&this.getIndentEditsOfMovingBlock(e,t,r,o,a,h);else{const f=gE(this._autoIndent,c,e.getLanguageIdAtPosition(r.startLineNumber,1),u,l,this._languageConfigurationService);if(f!==null){const g=bi(e.getLineContent(r.startLineNumber)),p=vl(f,o),v=vl(g,o);if(p!==v){const m=p-v;this.getIndentEditsOfMovingBlock(e,t,r,o,a,m)}}}}}this._selectionId=t.trackSelection(r)}buildIndentConverter(e,t,n){return{shiftIndent:r=>jc.shiftIndent(r,r.length+1,e,t,n),unshiftIndent:r=>jc.unshiftIndent(r,r.length+1,e,t,n)}}parseEnterResult(e,t,n,r,o){if(o){let s=o.indentation;o.indentAction===qr.None||o.indentAction===qr.Indent?s=o.indentation+o.appendText:o.indentAction===qr.IndentOutdent?s=o.indentation:o.indentAction===qr.Outdent&&(s=t.unshiftIndent(o.indentation)+o.appendText);const a=e.getLineContent(r);if(this.trimStart(a).indexOf(this.trimStart(s))>=0){const l=bi(e.getLineContent(r));let c=bi(s);const u=Ive(e,r,this._languageConfigurationService);u!==null&&u&2&&(c=t.unshiftIndent(c));const d=vl(c,n),h=vl(l,n);return d-h}}return null}matchEnterRuleMovingDown(e,t,n,r,o,s){if(th(s)>=0){const a=e.getLineMaxColumn(o),l=Hy(this._autoIndent,e,new B(o,a,o,a),this._languageConfigurationService);return this.parseEnterResult(e,t,n,r,l)}else{let a=r-1;for(;a>=1;){const u=e.getLineContent(a);if(th(u)>=0)break;a--}if(a<1||r>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=Hy(this._autoIndent,e,new B(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,n,r,c)}}matchEnterRule(e,t,n,r,o,s){let a=o;for(;a>=1;){let u;if(a===o&&s!==void 0?u=s:u=e.getLineContent(a),th(u)>=0)break;a--}if(a<1||r>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=Hy(this._autoIndent,e,new B(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,n,r,c)}trimStart(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4||!e.tokenization.isCheapToTokenize(t.startLineNumber))return!1;const n=e.getLanguageIdAtPosition(t.startLineNumber,1),r=e.getLanguageIdAtPosition(t.endLineNumber,1);return!(n!==r||this._languageConfigurationService.getLanguageConfiguration(n).indentRulesSupport===null)}getIndentEditsOfMovingBlock(e,t,n,r,o,s){for(let a=n.startLineNumber;a<=n.endLineNumber;a++){const l=e.getLineContent(a),c=bi(l),d=vl(c,r)+s,h=FE(d,r,o);h!==c&&(t.addEditOperation(new B(a,1,a,c.length+1),h),a===n.endLineNumber&&n.endColumn<=c.length+1&&h===""&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,t){let n=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(n=n.setEndPosition(n.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&n.startLineNumber=r)return null;const o=[];for(let a=n;a<=r;a++)o.push(i.getLineContent(a));let s=o.slice(0);return s.sort(Rv.getCollator().compare),t===!0&&(s=s.reverse()),{startLineNumber:n,endLineNumber:r,before:o,after:s}}function Oat(i,e,t){const n=M1e(i,e,t);return n?Xi.replace(new B(n.startLineNumber,1,n.endLineNumber,i.getLineMaxColumn(n.endLineNumber)),n.after.join(` +`)):null}class A1e extends gt{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const n=t.getSelections().map((s,a)=>({selection:s,index:a,ignore:!1}));n.sort((s,a)=>B.compareRangesUsingStarts(s.selection,a.selection));let r=n[0];for(let s=1;snew ae(a.positionLineNumber,a.positionColumn)));const o=t.getSelection();if(o===null)return;const s=new Rat(o,r);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop()}}c5.ID="editor.action.trimTrailingWhitespace";class jat extends gt{constructor(){super({id:"editor.action.deleteLines",label:w("lines.delete","Delete Line"),alias:"Delete Line",precondition:j.writable,kbOpts:{kbExpr:j.textInputFocus,primary:3113,weight:100}})}run(e,t){if(!t.hasModel())return;const n=this._getLinesToRemove(t),r=t.getModel();if(r.getLineCount()===1&&r.getLineMaxColumn(1)===1)return;let o=0;const s=[],a=[];for(let l=0,c=n.length;l1&&(d-=1,f=r.getLineMaxColumn(d)),s.push(Xi.replace(new yt(d,f,h,g),"")),a.push(new yt(d-o,u.positionColumn,d-o,u.positionColumn)),o+=u.endLineNumber-u.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,s,a),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map(o=>{let s=o.endLineNumber;return o.startLineNumbero.startLineNumber===s.startLineNumber?o.endLineNumber-s.endLineNumber:o.startLineNumber-s.startLineNumber);const n=[];let r=t[0];for(let o=1;o=t[o].startLineNumber?r.endLineNumber=t[o].endLineNumber:(n.push(r),r=t[o]);return n.push(r),n}}class Kat extends gt{constructor(){super({id:"editor.action.indentLines",label:w("lines.indent","Indent Line"),alias:"Indent Line",precondition:j.writable,kbOpts:{kbExpr:j.editorTextFocus,primary:2142,weight:100}})}run(e,t){const n=t._getViewModel();n&&(t.pushUndoStop(),t.executeCommands(this.id,rr.indent(n.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class Gat extends gt{constructor(){super({id:"editor.action.outdentLines",label:w("lines.outdent","Outdent Line"),alias:"Outdent Line",precondition:j.writable,kbOpts:{kbExpr:j.editorTextFocus,primary:2140,weight:100}})}run(e,t){Vy.Outdent.runEditorCommand(e,t,null)}}class qat extends gt{constructor(){super({id:"editor.action.insertLineBefore",label:w("lines.insertBefore","Insert Line Above"),alias:"Insert Line Above",precondition:j.writable,kbOpts:{kbExpr:j.editorTextFocus,primary:3075,weight:100}})}run(e,t){const n=t._getViewModel();n&&(t.pushUndoStop(),t.executeCommands(this.id,rr.lineInsertBefore(n.cursorConfig,t.getModel(),t.getSelections())))}}class Xat extends gt{constructor(){super({id:"editor.action.insertLineAfter",label:w("lines.insertAfter","Insert Line Below"),alias:"Insert Line Below",precondition:j.writable,kbOpts:{kbExpr:j.editorTextFocus,primary:2051,weight:100}})}run(e,t){const n=t._getViewModel();n&&(t.pushUndoStop(),t.executeCommands(this.id,rr.lineInsertAfter(n.cursorConfig,t.getModel(),t.getSelections())))}}class F1e extends gt{run(e,t){if(!t.hasModel())return;const n=t.getSelection(),r=this._getRangesToDelete(t),o=[];for(let l=0,c=r.length-1;lXi.replace(l,""));t.pushUndoStop(),t.executeEdits(this.id,a,s),t.pushUndoStop()}}class Yat extends F1e{constructor(){super({id:"deleteAllLeft",label:w("lines.deleteAllLeft","Delete All Left"),alias:"Delete All Left",precondition:j.writable,kbOpts:{kbExpr:j.textInputFocus,primary:0,mac:{primary:2049},weight:100}})}_getEndCursorState(e,t){let n=null;const r=[];let o=0;return t.forEach(s=>{let a;if(s.endColumn===1&&o>0){const l=s.startLineNumber-o;a=new yt(l,s.startColumn,l,s.startColumn)}else a=new yt(s.startLineNumber,s.startColumn,s.startLineNumber,s.startColumn);o+=s.endLineNumber-s.startLineNumber,s.intersectRanges(e)?n=a:r.push(a)}),n&&r.unshift(n),r}_getRangesToDelete(e){const t=e.getSelections();if(t===null)return[];let n=t;const r=e.getModel();return r===null?[]:(n.sort(B.compareRangesUsingStarts),n=n.map(o=>{if(o.isEmpty())if(o.startColumn===1){const s=Math.max(1,o.startLineNumber-1),a=o.startLineNumber===1?1:r.getLineLength(s)+1;return new B(s,a,o.startLineNumber,1)}else return new B(o.startLineNumber,1,o.startLineNumber,o.startColumn);else return new B(o.startLineNumber,1,o.endLineNumber,o.endColumn)}),n)}}class Zat extends F1e{constructor(){super({id:"deleteAllRight",label:w("lines.deleteAllRight","Delete All Right"),alias:"Delete All Right",precondition:j.writable,kbOpts:{kbExpr:j.textInputFocus,primary:0,mac:{primary:297,secondary:[2068]},weight:100}})}_getEndCursorState(e,t){let n=null;const r=[];for(let o=0,s=t.length,a=0;o{if(o.isEmpty()){const s=t.getLineMaxColumn(o.startLineNumber);return o.startColumn===s?new B(o.startLineNumber,o.startColumn,o.startLineNumber+1,1):new B(o.startLineNumber,o.startColumn,o.startLineNumber,s)}return o});return r.sort(B.compareRangesUsingStarts),r}}class Qat extends gt{constructor(){super({id:"editor.action.joinLines",label:w("lines.joinLines","Join Lines"),alias:"Join Lines",precondition:j.writable,kbOpts:{kbExpr:j.editorTextFocus,primary:0,mac:{primary:296},weight:100}})}run(e,t){const n=t.getSelections();if(n===null)return;let r=t.getSelection();if(r===null)return;n.sort(B.compareRangesUsingStarts);const o=[],s=n.reduce((h,f)=>h.isEmpty()?h.endLineNumber===f.startLineNumber?(r.equalsSelection(h)&&(r=f),f):f.startLineNumber>h.endLineNumber+1?(o.push(h),f):new yt(h.startLineNumber,h.startColumn,f.endLineNumber,f.endColumn):f.startLineNumber>h.endLineNumber?(o.push(h),f):new yt(h.startLineNumber,h.startColumn,f.endLineNumber,f.endColumn));o.push(s);const a=t.getModel();if(a===null)return;const l=[],c=[];let u=r,d=0;for(let h=0,f=o.length;h=1){let M=!0;L===""&&(M=!1),M&&(L.charAt(L.length-1)===" "||L.charAt(L.length-1)===" ")&&(M=!1,L=L.replace(/[\s\uFEFF\xA0]+$/g," "));const A=k.substr(T-1);L+=(M?" ":"")+A,M?m=A.length+1:m=A.length}else m=0}const E=new B(p,v,_,y);if(!E.isEmpty()){let D;g.isEmpty()?(l.push(Xi.replace(E,L)),D=new yt(E.startLineNumber-d,L.length-m+1,p-d,L.length-m+1)):g.startLineNumber===g.endLineNumber?(l.push(Xi.replace(E,L)),D=new yt(g.startLineNumber-d,g.startColumn,g.endLineNumber-d,g.endColumn)):(l.push(Xi.replace(E,L)),D=new yt(g.startLineNumber-d,g.startColumn,g.startLineNumber-d,L.length-S)),B.intersectRanges(E,r)!==null?u=D:c.push(D)}d+=E.endLineNumber-E.startLineNumber}c.unshift(u),t.pushUndoStop(),t.executeEdits(this.id,l,c),t.pushUndoStop()}}class Jat extends gt{constructor(){super({id:"editor.action.transpose",label:w("editor.transpose","Transpose Characters around the Cursor"),alias:"Transpose Characters around the Cursor",precondition:j.writable})}run(e,t){const n=t.getSelections();if(n===null)return;const r=t.getModel();if(r===null)return;const o=[];for(let s=0,a=n.length;s=u){if(c.lineNumber===r.getLineCount())continue;const d=new B(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),h=r.getValueInRange(d).split("").reverse().join("");o.push(new os(new yt(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),h))}else{const d=new B(c.lineNumber,Math.max(1,c.column-1),c.lineNumber,c.column+1),h=r.getValueInRange(d).split("").reverse().join("");o.push(new oX(d,h,new yt(c.lineNumber,c.column+1,c.lineNumber,c.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class US extends gt{run(e,t){const n=t.getSelections();if(n===null)return;const r=t.getModel();if(r===null)return;const o=t.getOption(130),s=[];for(const a of n)if(a.isEmpty()){const l=a.getStartPosition(),c=t.getConfiguredWordAtPosition(l);if(!c)continue;const u=new B(l.lineNumber,c.startColumn,l.lineNumber,c.endColumn),d=r.getValueInRange(u);s.push(Xi.replace(u,this._modifyText(d,o)))}else{const l=r.getValueInRange(a);s.push(Xi.replace(a,this._modifyText(l,o)))}t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop()}}class elt extends US{constructor(){super({id:"editor.action.transformToUppercase",label:w("editor.transformToUppercase","Transform to Uppercase"),alias:"Transform to Uppercase",precondition:j.writable})}_modifyText(e,t){return e.toLocaleUpperCase()}}class tlt extends US{constructor(){super({id:"editor.action.transformToLowercase",label:w("editor.transformToLowercase","Transform to Lowercase"),alias:"Transform to Lowercase",precondition:j.writable})}_modifyText(e,t){return e.toLocaleLowerCase()}}class xC{constructor(e,t){this._pattern=e,this._flags=t,this._actual=null,this._evaluated=!1}get(){if(!this._evaluated){this._evaluated=!0;try{this._actual=new RegExp(this._pattern,this._flags)}catch{}}return this._actual}isSupported(){return this.get()!==null}}class zI extends US{constructor(){super({id:"editor.action.transformToTitlecase",label:w("editor.transformToTitlecase","Transform to Title Case"),alias:"Transform to Title Case",precondition:j.writable})}_modifyText(e,t){const n=zI.titleBoundary.get();return n?e.toLocaleLowerCase().replace(n,r=>r.toLocaleUpperCase()):e}}zI.titleBoundary=new xC("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");class Mv extends US{constructor(){super({id:"editor.action.transformToSnakecase",label:w("editor.transformToSnakecase","Transform to Snake Case"),alias:"Transform to Snake Case",precondition:j.writable})}_modifyText(e,t){const n=Mv.caseBoundary.get(),r=Mv.singleLetters.get();return!n||!r?e:e.replace(n,"$1_$2").replace(r,"$1_$2$3").toLocaleLowerCase()}}Mv.caseBoundary=new xC("(\\p{Ll})(\\p{Lu})","gmu");Mv.singleLetters=new xC("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");class UI extends US{constructor(){super({id:"editor.action.transformToCamelcase",label:w("editor.transformToCamelcase","Transform to Camel Case"),alias:"Transform to Camel Case",precondition:j.writable})}_modifyText(e,t){const n=UI.wordBoundary.get();if(!n)return e;const r=e.split(n);return r.shift()+r.map(s=>s.substring(0,1).toLocaleUpperCase()+s.substring(1)).join("")}}UI.wordBoundary=new xC("[_\\s-]","gm");class bp extends US{static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every(t=>t.isSupported())}constructor(){super({id:"editor.action.transformToKebabcase",label:w("editor.transformToKebabcase","Transform to Kebab Case"),alias:"Transform to Kebab Case",precondition:j.writable})}_modifyText(e,t){const n=bp.caseBoundary.get(),r=bp.singleLetters.get(),o=bp.underscoreBoundary.get();return!n||!r||!o?e:e.replace(o,"$1-$3").replace(n,"$1-$2").replace(r,"$1-$2").toLocaleLowerCase()}}bp.caseBoundary=new xC("(\\p{Ll})(\\p{Lu})","gmu");bp.singleLetters=new xC("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu");bp.underscoreBoundary=new xC("(\\S)(_)(\\S)","gm");Be(Fat);Be(Bat);Be(Wat);Be($at);Be(Hat);Be(Vat);Be(zat);Be(Uat);Be(c5);Be(jat);Be(Kat);Be(Gat);Be(qat);Be(Xat);Be(Yat);Be(Zat);Be(Qat);Be(Jat);Be(elt);Be(tlt);Mv.caseBoundary.isSupported()&&Mv.singleLetters.isSupported()&&Be(Mv);UI.wordBoundary.isSupported()&&Be(UI);zI.titleBoundary.isSupported()&&Be(zI);bp.isSupported()&&Be(bp);var nlt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},g2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},VM;const B1e=new st("LinkedEditingInputVisible",!1),ilt="linked-editing-decoration";let g_=VM=class extends fe{static get(e){return e.getContribution(VM.ID)}constructor(e,t,n,r,o){super(),this.languageConfigurationService=r,this._syncRangesToken=0,this._localToDispose=this._register(new Te),this._editor=e,this._providers=n.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=B1e.bindTo(t),this._debounceInformation=o.for(this._providers,"Linked Editing",{max:200}),this._currentDecorations=this._editor.createDecorationsCollection(),this._languageWordPattern=null,this._currentWordPattern=null,this._ignoreChangeEvent=!1,this._localToDispose=this._register(new Te),this._rangeUpdateTriggerPromise=null,this._rangeSyncTriggerPromise=null,this._currentRequestCts=null,this._currentRequestPosition=null,this._currentRequestModelVersion=null,this._register(this._editor.onDidChangeModel(()=>this.reinitialize(!0))),this._register(this._editor.onDidChangeConfiguration(s=>{(s.hasChanged(70)||s.hasChanged(93))&&this.reinitialize(!1)})),this._register(this._providers.onDidChange(()=>this.reinitialize(!1))),this._register(this._editor.onDidChangeModelLanguage(()=>this.reinitialize(!0))),this.reinitialize(!0)}reinitialize(e){const t=this._editor.getModel(),n=t!==null&&(this._editor.getOption(70)||this._editor.getOption(93))&&this._providers.has(t);if(n===this._enabled&&!e||(this._enabled=n,this.clearRanges(),this._localToDispose.clear(),!n||t===null))return;this._localToDispose.add(Je.runAndSubscribe(t.onDidChangeLanguageConfiguration,()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition()}));const r=new nd(this._debounceInformation.get(t)),o=()=>{var l;this._rangeUpdateTriggerPromise=r.trigger(()=>this.updateRanges(),(l=this._debounceDuration)!==null&&l!==void 0?l:this._debounceInformation.get(t))},s=new nd(0),a=l=>{this._rangeSyncTriggerPromise=s.trigger(()=>this._syncRanges(l))};this._localToDispose.add(this._editor.onDidChangeCursorPosition(()=>{o()})),this._localToDispose.add(this._editor.onDidChangeModelContent(l=>{if(!this._ignoreChangeEvent&&this._currentDecorations.length>0){const c=this._currentDecorations.getRange(0);if(c&&l.changes.every(u=>c.intersectRanges(u.range))){a(this._syncRangesToken);return}}o()})),this._localToDispose.add({dispose:()=>{r.dispose(),s.dispose()}}),this.updateRanges()}_syncRanges(e){if(!this._editor.hasModel()||e!==this._syncRangesToken||this._currentDecorations.length===0)return;const t=this._editor.getModel(),n=this._currentDecorations.getRange(0);if(!n||n.startLineNumber!==n.endLineNumber)return this.clearRanges();const r=t.getValueInRange(n);if(this._currentWordPattern){const s=r.match(this._currentWordPattern);if((s?s[0].length:0)!==r.length)return this.clearRanges()}const o=[];for(let s=1,a=this._currentDecorations.length;s1){this.clearRanges();return}const n=this._editor.getModel(),r=n.getVersionId();if(this._currentRequestPosition&&this._currentRequestModelVersion===r){if(t.equals(this._currentRequestPosition))return;if(this._currentDecorations.length>0){const s=this._currentDecorations.getRange(0);if(s&&s.containsPosition(t))return}}this.clearRanges(),this._currentRequestPosition=t,this._currentRequestModelVersion=r;const o=this._currentRequestCts=new wr;try{const s=new Ms(!1),a=await W1e(this._providers,n,t,o.token);if(this._debounceInformation.update(n,s.elapsed()),o!==this._currentRequestCts||(this._currentRequestCts=null,r!==n.getVersionId()))return;let l=[];a!=null&&a.ranges&&(l=a.ranges),this._currentWordPattern=(a==null?void 0:a.wordPattern)||this._languageWordPattern;let c=!1;for(let d=0,h=l.length;d({range:d,options:VM.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations.set(u),this._syncRangesToken++}catch(s){wh(s)||en(s),(this._currentRequestCts===o||!this._currentRequestCts)&&this.clearRanges()}}};g_.ID="editor.contrib.linkedEditing";g_.DECORATION=sn.register({description:"linked-editing",stickiness:0,className:ilt});g_=VM=nlt([g2(1,Vt),g2(2,_t),g2(3,Di),g2(4,gu)],g_);class rlt extends gt{constructor(){super({id:"editor.action.linkedEditing",label:w("linkedEditing.label","Start Linked Editing"),alias:"Start Linked Editing",precondition:De.and(j.writable,j.hasRenameProvider),kbOpts:{kbExpr:j.editorTextFocus,primary:3132,weight:100}})}runCommand(e,t){const n=e.get(Un),[r,o]=Array.isArray(t)&&t||[void 0,void 0];return At.isUri(r)&&ae.isIPosition(o)?n.openCodeEditor({resource:r},n.getActiveCodeEditor()).then(s=>{s&&(s.setPosition(o),s.invokeWithinContext(a=>(this.reportTelemetry(a,s),this.run(a,s))))},en):super.runCommand(e,t)}run(e,t){const n=g_.get(t);return n?Promise.resolve(n.updateRanges(!0)):Promise.resolve()}}const olt=Vo.bindToContribution(g_.get);et(new olt({id:"cancelLinkedEditingInput",precondition:B1e,handler:i=>i.clearRanges(),kbOpts:{kbExpr:j.editorTextFocus,weight:100+99,primary:9,secondary:[1033]}}));function W1e(i,e,t,n){const r=i.ordered(e);return wq(r.map(o=>async()=>{try{return await o.provideLinkedEditingRanges(e,t,n)}catch(s){Zr(s);return}}),o=>!!o&&Ts(o==null?void 0:o.ranges))}X("editor.linkedEditingBackground",{dark:me.fromHex("#f00").transparent(.3),light:me.fromHex("#f00").transparent(.3),hcDark:me.fromHex("#f00").transparent(.3),hcLight:me.white},w("editorLinkedEditingBackground","Background color when the editor auto renames on type."));tg("_executeLinkedEditingProvider",(i,e,t)=>{const{linkedEditingRangeProvider:n}=i.get(_t);return W1e(n,e,t,Cn.None)});jn(g_.ID,g_,1);Be(rlt);let slt=class{constructor(e,t){this._link=e,this._provider=t}toJSON(){return{range:this.range,url:this.url,tooltip:this.tooltip}}get range(){return this._link.range}get url(){return this._link.url}get tooltip(){return this._link.tooltip}async resolve(e){return this._link.url?this._link.url:typeof this._provider.resolveLink=="function"?Promise.resolve(this._provider.resolveLink(this._link,e)).then(t=>(this._link=t||this._link,this._link.url?this.resolve(e):Promise.reject(new Error("missing")))):Promise.reject(new Error("missing"))}};class TO{constructor(e){this._disposables=new Te;let t=[];for(const[n,r]of e){const o=n.links.map(s=>new slt(s,r));t=TO._union(t,o),aq(n)&&this._disposables.add(n)}this.links=t}dispose(){this._disposables.dispose(),this.links.length=0}static _union(e,t){const n=[];let r,o,s,a;for(r=0,s=0,o=e.length,a=t.length;rPromise.resolve(o.provideLinks(e,t)).then(a=>{a&&(n[s]=[a,o])},Zr));return Promise.all(r).then(()=>{const o=new TO(lh(n));return t.isCancellationRequested?(o.dispose(),new TO([])):o})}Dn.registerCommand("_executeLinkProvider",async(i,...e)=>{let[t,n]=e;Xn(t instanceof At),typeof n!="number"&&(n=0);const{linkProvider:r}=i.get(_t),o=i.get(tr).getModel(t);if(!o)return[];const s=await $1e(r,o,Cn.None);if(!s)return[];for(let l=0;l=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},p2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},FU;let oS=FU=class extends fe{static get(e){return e.getContribution(FU.ID)}constructor(e,t,n,r,o){super(),this.editor=e,this.openerService=t,this.notificationService=n,this.languageFeaturesService=r,this.providers=this.languageFeaturesService.linkProvider,this.debounceInformation=o.for(this.providers,"Links",{min:1e3,max:4e3}),this.computeLinks=this._register(new pi(()=>this.computeLinksNow(),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const s=this._register(new M3(e));this._register(s.onMouseMoveOrRelevantKeyDown(([a,l])=>{this._onEditorMouseMove(a,l)})),this._register(s.onExecute(a=>{this.onEditorMouseUp(a)})),this._register(s.onCancel(a=>{this.cleanUpActiveLinkDecoration()})),this._register(e.onDidChangeConfiguration(a=>{a.hasChanged(71)&&(this.updateDecorations([]),this.stop(),this.computeLinks.schedule(0))})),this._register(e.onDidChangeModelContent(a=>{this.editor.hasModel()&&this.computeLinks.schedule(this.debounceInformation.get(this.editor.getModel()))})),this._register(e.onDidChangeModel(a=>{this.currentOccurrences={},this.activeLinkDecorationId=null,this.stop(),this.computeLinks.schedule(0)})),this._register(e.onDidChangeModelLanguage(a=>{this.stop(),this.computeLinks.schedule(0)})),this._register(this.providers.onDidChange(a=>{this.stop(),this.computeLinks.schedule(0)})),this.computeLinks.schedule(0)}async computeLinksNow(){if(!this.editor.hasModel()||!this.editor.getOption(71))return;const e=this.editor.getModel();if(!e.isTooLargeForSyncing()&&this.providers.has(e)){this.activeLinksList&&(this.activeLinksList.dispose(),this.activeLinksList=null),this.computePromise=Io(t=>$1e(this.providers,e,t));try{const t=new Ms(!1);if(this.activeLinksList=await this.computePromise,this.debounceInformation.update(e,t.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(t){en(t)}finally{this.computePromise=null}}}updateDecorations(e){const t=this.editor.getOption(78)==="altKey",n=[],r=Object.keys(this.currentOccurrences);for(const s of r){const a=this.currentOccurrences[s];n.push(a.decorationId)}const o=[];if(e)for(const s of e)o.push(tw.decoration(s,t));this.editor.changeDecorations(s=>{const a=s.deltaDecorations(n,o);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let l=0,c=a.length;l{r.activate(o,n),this.activeLinkDecorationId=r.decorationId})}else this.cleanUpActiveLinkDecoration()}cleanUpActiveLinkDecoration(){const e=this.editor.getOption(78)==="altKey";if(this.activeLinkDecorationId){const t=this.currentOccurrences[this.activeLinkDecorationId];t&&this.editor.changeDecorations(n=>{t.deactivate(n,e)}),this.activeLinkDecorationId=null}}onEditorMouseUp(e){if(!this.isEnabled(e))return;const t=this.getLinkOccurrence(e.target.position);t&&this.openLinkOccurrence(t,e.hasSideBySideModifier,!0)}openLinkOccurrence(e,t,n=!1){if(!this.openerService)return;const{link:r}=e;r.resolve(Cn.None).then(o=>{if(typeof o=="string"&&this.editor.hasModel()){const s=this.editor.getModel().uri;if(s.scheme===an.file&&o.startsWith(`${an.file}:`)){const a=At.parse(o);if(a.scheme===an.file){const l=Gh(a);let c=null;l.startsWith("/./")?c=`.${l.substr(1)}`:l.startsWith("//./")&&(c=`.${l.substr(2)}`),c&&(o=yze(s,c))}}}return this.openerService.open(o,{openToSide:t,fromUserGesture:n,allowContributedOpeners:!0,allowCommands:!0,fromWorkspace:!0})},o=>{const s=o instanceof Error?o.message:o;s==="invalid"?this.notificationService.warn(w("invalid.url","Failed to open this link because it is not well-formed: {0}",r.url.toString())):s==="missing"?this.notificationService.warn(w("missing.url","Failed to open this link because its target is missing.")):en(o)})}getLinkOccurrence(e){if(!this.editor.hasModel()||!e)return null;const t=this.editor.getModel().getDecorationsInRange({startLineNumber:e.lineNumber,startColumn:e.column,endLineNumber:e.lineNumber,endColumn:e.column},0,!0);for(const n of t){const r=this.currentOccurrences[n.id];if(r)return r}return null}isEnabled(e,t){return!!(e.target.type===6&&(e.hasTriggerModifier||t&&t.keyCodeIsTriggerKey))}stop(){var e;this.computeLinks.cancel(),this.activeLinksList&&((e=this.activeLinksList)===null||e===void 0||e.dispose(),this.activeLinksList=null),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop()}};oS.ID="editor.linkDetector";oS=FU=alt([p2(1,al),p2(2,$r),p2(3,_t),p2(4,gu)],oS);const Sle={general:sn.register({description:"detected-link",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:sn.register({description:"detected-link-active",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class tw{static decoration(e,t){return{range:e.range,options:tw._getOptions(e,t,!1)}}static _getOptions(e,t,n){const r={...n?Sle.active:Sle.general};return r.hoverMessage=llt(e,t),r}constructor(e,t){this.link=e,this.decorationId=t}activate(e,t){e.changeDecorationOptions(this.decorationId,tw._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,tw._getOptions(this.link,t,!1))}}function llt(i,e){const t=i.url&&/^command:/i.test(i.url.toString()),n=i.tooltip?i.tooltip:t?w("links.navigate.executeCmd","Execute command"):w("links.navigate.follow","Follow link"),r=e?Ln?w("links.navigate.kb.meta.mac","cmd + click"):w("links.navigate.kb.meta","ctrl + click"):Ln?w("links.navigate.kb.alt.mac","option + click"):w("links.navigate.kb.alt","alt + click");if(i.url){let o="";if(/^command:/i.test(i.url.toString())){const a=i.url.toString().match(/^command:([^?#]+)/);if(a){const l=a[1];o=w("tooltip.explanation","Execute command {0}",l)}}return new Is("",!0).appendLink(i.url.toString(!0).replace(/ /g,"%20"),n,o).appendMarkdown(` (${r})`)}else return new Is().appendText(`${n} (${r})`)}class clt extends gt{constructor(){super({id:"editor.action.openLink",label:w("label","Open Link"),alias:"Open Link",precondition:void 0})}run(e,t){const n=oS.get(t);if(!n||!t.hasModel())return;const r=t.getSelections();for(const o of r){const s=n.getLinkOccurrence(o.getEndPosition());s&&n.openLinkOccurrence(s,!1)}}}jn(oS.ID,oS,1);Be(clt);class BU extends fe{constructor(e){super(),this._editor=e,this._register(this._editor.onMouseDown(t=>{const n=this._editor.getOption(117);n>=0&&t.target.type===6&&t.target.position.column>=n&&this._editor.updateOptions({stopRenderingLineAfter:-1})}))}}BU.ID="editor.contrib.longLinesHelper";jn(BU.ID,BU,2);const m2=X("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},w("wordHighlight","Background color of a symbol during read-access, like reading a variable. The color must not be opaque so as not to hide underlying decorations."),!0);X("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},w("wordHighlightStrong","Background color of a symbol during write-access, like writing to a variable. The color must not be opaque so as not to hide underlying decorations."),!0);X("editor.wordHighlightTextBackground",{light:m2,dark:m2,hcDark:m2,hcLight:m2},w("wordHighlightText","Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0);const v2=X("editor.wordHighlightBorder",{light:null,dark:null,hcDark:zi,hcLight:zi},w("wordHighlightBorder","Border color of a symbol during read-access, like reading a variable."));X("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:zi,hcLight:zi},w("wordHighlightStrongBorder","Border color of a symbol during write-access, like writing to a variable."));X("editor.wordHighlightTextBorder",{light:v2,dark:v2,hcDark:v2,hcLight:v2},w("wordHighlightTextBorder","Border color of a textual occurrence for a symbol."));const ult=X("editorOverviewRuler.wordHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},w("overviewRulerWordHighlightForeground","Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),dlt=X("editorOverviewRuler.wordHighlightStrongForeground",{dark:"#C0A0C0CC",light:"#C0A0C0CC",hcDark:"#C0A0C0CC",hcLight:"#C0A0C0CC"},w("overviewRulerWordHighlightStrongForeground","Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),hlt=X("editorOverviewRuler.wordHighlightTextForeground",{dark:NL,light:NL,hcDark:NL,hcLight:NL},w("overviewRulerWordHighlightTextForeground","Overview ruler marker color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0),flt=sn.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:fr(dlt),position:mc.Center},minimap:{color:fr(M4),position:Ll.Inline}}),glt=sn.register({description:"word-highlight-text",stickiness:1,className:"wordHighlightText",overviewRuler:{color:fr(hlt),position:mc.Center},minimap:{color:fr(M4),position:Ll.Inline}}),plt=sn.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",overviewRuler:{color:fr(NL),position:mc.Center},minimap:{color:fr(M4),position:Ll.Inline}}),mlt=sn.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"}),vlt=sn.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:fr(ult),position:mc.Center},minimap:{color:fr(M4),position:Ll.Inline}});function _lt(i){return i===xD.Write?flt:i===xD.Text?glt:vlt}function blt(i){return i?mlt:plt}fu((i,e)=>{const t=i.getColor(Zq);t&&e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`)});var Clt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ylt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},WU;function P_(i,e){const t=e.filter(n=>!i.find(r=>r.equals(n)));if(t.length>=1){const n=t.map(o=>`line ${o.viewState.position.lineNumber} column ${o.viewState.position.column}`).join(", "),r=t.length===1?w("cursorAdded","Cursor added: {0}",n):w("cursorsAdded","Cursors added: {0}",n);Hf(r)}}class wlt extends gt{constructor(){super({id:"editor.action.insertCursorAbove",label:w("mutlicursor.insertAbove","Add Cursor Above"),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:j.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:$.MenubarSelectionMenu,group:"3_multi",title:w({key:"miInsertCursorAbove",comment:["&& denotes a mnemonic"]},"&&Add Cursor Above"),order:2}})}run(e,t,n){if(!t.hasModel())return;let r=!0;n&&n.logicalLine===!1&&(r=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const s=o.getCursorStates();o.setCursorStates(n.source,3,Go.addCursorUp(o,s,r)),o.revealTopMostCursor(n.source),P_(s,o.getCursorStates())}}class Slt extends gt{constructor(){super({id:"editor.action.insertCursorBelow",label:w("mutlicursor.insertBelow","Add Cursor Below"),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:j.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:$.MenubarSelectionMenu,group:"3_multi",title:w({key:"miInsertCursorBelow",comment:["&& denotes a mnemonic"]},"A&&dd Cursor Below"),order:3}})}run(e,t,n){if(!t.hasModel())return;let r=!0;n&&n.logicalLine===!1&&(r=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const s=o.getCursorStates();o.setCursorStates(n.source,3,Go.addCursorDown(o,s,r)),o.revealBottomMostCursor(n.source),P_(s,o.getCursorStates())}}class xlt extends gt{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:w("mutlicursor.insertAtEndOfEachLineSelected","Add Cursors to Line Ends"),alias:"Add Cursors to Line Ends",precondition:void 0,kbOpts:{kbExpr:j.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:$.MenubarSelectionMenu,group:"3_multi",title:w({key:"miInsertCursorAtEndOfEachLineSelected",comment:["&& denotes a mnemonic"]},"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,t,n){if(!e.isEmpty()){for(let r=e.startLineNumber;r1&&n.push(new yt(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const n=t.getModel(),r=t.getSelections(),o=t._getViewModel(),s=o.getCursorStates(),a=[];r.forEach(l=>this.getCursorsForSelection(l,n,a)),a.length>0&&t.setSelections(a),P_(s,o.getCursorStates())}}class Llt extends gt{constructor(){super({id:"editor.action.addCursorsToBottom",label:w("mutlicursor.addCursorsToBottom","Add Cursors To Bottom"),alias:"Add Cursors To Bottom",precondition:void 0})}run(e,t){if(!t.hasModel())return;const n=t.getSelections(),r=t.getModel().getLineCount(),o=[];for(let l=n[0].startLineNumber;l<=r;l++)o.push(new yt(l,n[0].startColumn,l,n[0].endColumn));const s=t._getViewModel(),a=s.getCursorStates();o.length>0&&t.setSelections(o),P_(a,s.getCursorStates())}}class Elt extends gt{constructor(){super({id:"editor.action.addCursorsToTop",label:w("mutlicursor.addCursorsToTop","Add Cursors To Top"),alias:"Add Cursors To Top",precondition:void 0})}run(e,t){if(!t.hasModel())return;const n=t.getSelections(),r=[];for(let a=n[0].startLineNumber;a>=1;a--)r.push(new yt(a,n[0].startColumn,a,n[0].endColumn));const o=t._getViewModel(),s=o.getCursorStates();r.length>0&&t.setSelections(r),P_(s,o.getCursorStates())}}class _2{constructor(e,t,n){this.selections=e,this.revealRange=t,this.revealScrollType=n}}class jI{static create(e,t){if(!e.hasModel())return null;const n=t.getState();if(!e.hasTextFocus()&&n.isRevealed&&n.searchString.length>0)return new jI(e,t,!1,n.searchString,n.wholeWord,n.matchCase,null);let r=!1,o,s;const a=e.getSelections();a.length===1&&a[0].isEmpty()?(r=!0,o=!0,s=!0):(o=n.wholeWord,s=n.matchCase);const l=e.getSelection();let c,u=null;if(l.isEmpty()){const d=e.getConfiguredWordAtPosition(l.getStartPosition());if(!d)return null;c=d.word,u=new yt(l.startLineNumber,d.startColumn,l.startLineNumber,d.endColumn)}else c=e.getModel().getValueInRange(l).replace(/\r\n/g,` +`);return new jI(e,t,r,c,o,s,u)}constructor(e,t,n,r,o,s,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=n,this.searchText=r,this.wholeWord=o,this.matchCase=s,this.currentMatch=a}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new _2(t.concat(e),e,0)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new _2(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const r=this.currentMatch;return this.currentMatch=null,r}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],n=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(130):null,!1);return n?new yt(n.range.startLineNumber,n.range.startColumn,n.range.endLineNumber,n.range.endColumn):null}addSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new _2(t.concat(e),e,0)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new _2(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const r=this.currentMatch;return this.currentMatch=null,r}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],n=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(130):null,!1);return n?new yt(n.range.startLineNumber,n.range.startColumn,n.range.endLineNumber,n.range.endColumn):null}selectAll(e){if(!this._editor.hasModel())return[];this.findController.highlightFindOptions();const t=this._editor.getModel();return e?t.findMatches(this.searchText,e,!1,this.matchCase,this.wholeWord?this._editor.getOption(130):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(130):null,!1,1073741824)}}class Yb extends fe{static get(e){return e.getContribution(Yb.ID)}constructor(e){super(),this._sessionDispose=this._register(new Te),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=jI.create(this._editor,e);if(!t)return;this._session=t;const n={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(n.wholeWordOverride=1,n.matchCaseOverride=1,n.isRegexOverride=2),e.getState().change(n,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(r=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(r=>{(r.matchCase||r.wholeWord)&&this._endSession()}))}}_endSession(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){const e={wholeWordOverride:0,matchCaseOverride:0,isRegexOverride:0};this._session.findController.getState().change(e,!1)}this._session=null}_setSelections(e){this._ignoreSelectionChange=!0,this._editor.setSelections(e),this._ignoreSelectionChange=!1}_expandEmptyToWord(e,t){if(!t.isEmpty())return t;const n=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return n?new yt(t.startLineNumber,n.startColumn,t.startLineNumber,n.endColumn):t}_applySessionResult(e){e&&(this._setSelections(e.selections),e.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange,e.revealScrollType))}getSession(e){return this._session}addSelectionToNextFindMatch(e){if(this._editor.hasModel()){if(!this._session){const t=this._editor.getSelections();if(t.length>1){const r=e.getState().matchCase;if(!H1e(this._editor.getModel(),t,r)){const s=this._editor.getModel(),a=[];for(let l=0,c=t.length;l0&&n.isRegex){const r=this._editor.getModel();n.searchScope?t=r.findMatches(n.searchString,n.searchScope,n.isRegex,n.matchCase,n.wholeWord?this._editor.getOption(130):null,!1,1073741824):t=r.findMatches(n.searchString,!0,n.isRegex,n.matchCase,n.wholeWord?this._editor.getOption(130):null,!1,1073741824)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(n.searchScope)}if(t.length>0){const r=this._editor.getSelection();for(let o=0,s=t.length;onew yt(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn)))}}}Yb.ID="editor.contrib.multiCursorController";class jS extends gt{run(e,t){const n=Yb.get(t);if(!n)return;const r=t._getViewModel();if(r){const o=r.getCursorStates(),s=ka.get(t);if(s)this._run(n,s);else{const a=e.get(Ot).createInstance(ka,t);this._run(n,a),a.dispose()}P_(o,r.getCursorStates())}}}class Dlt extends jS{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:w("addSelectionToNextFindMatch","Add Selection To Next Find Match"),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:j.focus,primary:2082,weight:100},menuOpts:{menuId:$.MenubarSelectionMenu,group:"3_multi",title:w({key:"miAddSelectionToNextFindMatch",comment:["&& denotes a mnemonic"]},"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class Ilt extends jS{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:w("addSelectionToPreviousFindMatch","Add Selection To Previous Find Match"),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:$.MenubarSelectionMenu,group:"3_multi",title:w({key:"miAddSelectionToPreviousFindMatch",comment:["&& denotes a mnemonic"]},"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class klt extends jS{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:w("moveSelectionToNextFindMatch","Move Last Selection To Next Find Match"),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:j.focus,primary:co(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class Tlt extends jS{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:w("moveSelectionToPreviousFindMatch","Move Last Selection To Previous Find Match"),alias:"Move Last Selection To Previous Find Match",precondition:void 0})}_run(e,t){e.moveSelectionToPreviousFindMatch(t)}}class Nlt extends jS{constructor(){super({id:"editor.action.selectHighlights",label:w("selectAllOccurrencesOfFindMatch","Select All Occurrences of Find Match"),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:j.focus,primary:3114,weight:100},menuOpts:{menuId:$.MenubarSelectionMenu,group:"3_multi",title:w({key:"miSelectHighlights",comment:["&& denotes a mnemonic"]},"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class Rlt extends jS{constructor(){super({id:"editor.action.changeAll",label:w("changeAll.label","Change All Occurrences"),alias:"Change All Occurrences",precondition:De.and(j.writable,j.editorTextFocus),kbOpts:{kbExpr:j.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class Mlt{constructor(e,t,n,r,o){this._model=e,this._searchText=t,this._matchCase=n,this._wordSeparators=r,this._modelVersionId=this._model.getVersionId(),this._cachedFindMatches=null,o&&this._model===o._model&&this._searchText===o._searchText&&this._matchCase===o._matchCase&&this._wordSeparators===o._wordSeparators&&this._modelVersionId===o._modelVersionId&&(this._cachedFindMatches=o._cachedFindMatches)}findMatches(){return this._cachedFindMatches===null&&(this._cachedFindMatches=this._model.findMatches(this._searchText,!0,!1,this._matchCase,this._wordSeparators,!1).map(e=>e.range),this._cachedFindMatches.sort(B.compareRangesUsingStarts)),this._cachedFindMatches}}let KI=WU=class extends fe{constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(108),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new pi(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(r=>{this._isEnabled=e.getOption(108)})),this._register(e.onDidChangeCursorSelection(r=>{this._isEnabled&&(r.selection.isEmpty()?r.reason===3?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())})),this._register(e.onDidChangeModel(r=>{this._setState(null)})),this._register(e.onDidChangeModelContent(r=>{this._isEnabled&&this.updateSoon.schedule()}));const n=ka.get(e);n&&this._register(n.getState().onFindReplaceStateChange(r=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(WU._createState(this.state,this._isEnabled,this.editor))}static _createState(e,t,n){if(!t||!n.hasModel())return null;const r=n.getSelection();if(r.startLineNumber!==r.endLineNumber)return null;const o=Yb.get(n);if(!o)return null;const s=ka.get(n);if(!s)return null;let a=o.getSession(s);if(!a){const u=n.getSelections();if(u.length>1){const h=s.getState().matchCase;if(!H1e(n.getModel(),u,h))return null}a=jI.create(n,s)}if(!a||a.currentMatch||/^[ \t]+$/.test(a.searchText)||a.searchText.length>200)return null;const l=s.getState(),c=l.matchCase;if(l.isRevealed){let u=l.searchString;c||(u=u.toLowerCase());let d=a.searchText;if(c||(d=d.toLowerCase()),u===d&&a.matchCase===l.matchCase&&a.wholeWord===l.wholeWord&&!l.isRegex)return null}return new Mlt(n.getModel(),a.searchText,a.matchCase,a.wholeWord?n.getOption(130):null,e)}_setState(e){if(this.state=e,!this.state){this._decorations.clear();return}if(!this.editor.hasModel())return;const t=this.editor.getModel();if(t.isTooLargeForTokenization())return;const n=this.state.findMatches(),r=this.editor.getSelections();r.sort(B.compareRangesUsingStarts);const o=[];for(let c=0,u=0,d=n.length,h=r.length;c=h)o.push(f),c++;else{const g=B.compareRangesUsingStarts(f,r[u]);g<0?((r[u].isEmpty()||!B.areIntersecting(f,r[u]))&&o.push(f),c++):(g>0||c++,u++)}}const s=this.editor.getOption(81)!=="off",a=this._languageFeaturesService.documentHighlightProvider.has(t)&&s,l=o.map(c=>({range:c,options:blt(a)}));this._decorations.set(l)}dispose(){this._setState(null),super.dispose()}};KI.ID="editor.contrib.selectionHighlighter";KI=WU=Clt([ylt(1,_t)],KI);function H1e(i,e,t){const n=xle(i,e[0],!t);for(let r=1,o=e.length;r=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Hlt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const z9="inline-edit";let $U=class extends fe{constructor(e,t,n){super(),this.editor=e,this.model=t,this.languageService=n,this.isDisposed=Hn(this,!1),this.currentTextModel=Vi(this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=Yt(this,r=>{var o;if(this.isDisposed.read(r))return;const s=this.currentTextModel.read(r);if(s!==this.model.targetTextModel.read(r))return;const a=this.model.ghostText.read(r);if(!a)return;let l=(o=this.model.range)===null||o===void 0?void 0:o.read(r);l&&l.startLineNumber===l.endLineNumber&&l.startColumn===l.endColumn&&(l=void 0);const c=(l?l.startLineNumber===l.endLineNumber:!0)&&a.parts.length===1&&a.parts[0].lines.length===1,u=a.parts.length===1&&a.parts[0].lines.every(y=>y.length===0),d=[],h=[];function f(y,S){if(h.length>0){const L=h[h.length-1];S&&L.decorations.push(new Ca(L.content.length+1,L.content.length+1+y[0].length,S,0)),L.content+=y[0],y=y.slice(1)}for(const L of y)h.push({content:L,decorations:S?[new Ca(1,L.length+1,S,0)]:[]})}const g=s.getLineContent(a.lineNumber);let p,v=0;if(!u){for(const y of a.parts){let S=y.lines;l&&!c&&(f(S,z9),S=[]),p===void 0?(d.push({column:y.column,text:S[0],preview:y.preview}),S=S.slice(1)):f([g.substring(v,y.column-1)],void 0),S.length>0&&(f(S,z9),p===void 0&&y.column<=g.length&&(p=y.column)),v=y.column-1}p!==void 0&&f([g.substring(v)],void 0)}const m=p!==void 0?new C1e(p,g.length+1):void 0,_=c||!l?a.lineNumber:l.endLineNumber-1;return{inlineTexts:d,additionalLines:h,hiddenRange:m,lineNumber:_,additionalReservedLineCount:this.model.minReservedLineCount.read(r),targetTextModel:s,range:l,isSingleLine:c,isPureRemove:u,backgroundColoring:this.model.backgroundColoring.read(r)}}),this.decorations=Yt(this,r=>{const o=this.uiState.read(r);if(!o)return[];const s=[];if(o.hiddenRange&&s.push({range:o.hiddenRange.toRange(o.lineNumber),options:{inlineClassName:"inline-edit-hidden",description:"inline-edit-hidden"}}),o.range){const a=[];if(o.isSingleLine)a.push(o.range);else if(o.isPureRemove){const c=o.range.endLineNumber-o.range.startLineNumber;for(let u=0;u{const o=this.uiState.read(r);return o&&!o.isPureRemove?{lineNumber:o.lineNumber,additionalLines:o.additionalLines,minReservedLineCount:o.additionalReservedLineCount,targetTextModel:o.targetTextModel}:void 0}))),this._register(Rt(()=>{this.isDisposed.set(!0,void 0)})),this._register(y1e(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};$U=$lt([Hlt(2,ji)],$U);var uZ=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Ug=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},zM;let HU=class extends fe{constructor(e,t,n){super(),this.editor=e,this.model=t,this.instantiationService=n,this.alwaysShowToolbar=Vi(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(63).showToolbar==="always"),this.sessionPosition=void 0,this.position=Yt(this,r=>{var o,s,a;const l=(o=this.model.read(r))===null||o===void 0?void 0:o.widget.model.ghostText.read(r);if(!this.alwaysShowToolbar.read(r)||!l||l.parts.length===0)return this.sessionPosition=void 0,null;const c=l.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==l.lineNumber&&(this.sessionPosition=void 0);const u=new ae(l.lineNumber,Math.min(c,(a=(s=this.sessionPosition)===null||s===void 0?void 0:s.column)!==null&&a!==void 0?a:Number.MAX_SAFE_INTEGER));return this.sessionPosition=u,u}),this._register(Dh((r,o)=>{if(!this.model.read(r)||!this.alwaysShowToolbar.read(r))return;const a=o.add(this.instantiationService.createInstance(sS,this.editor,!0,this.position));e.addContentWidget(a),o.add(Rt(()=>e.removeContentWidget(a)))}))}};HU=uZ([Ug(2,Ot)],HU);let sS=zM=class extends fe{constructor(e,t,n,r,o,s){super(),this.editor=e,this.withBorder=t,this._position=n,this._contextKeyService=o,this._menuService=s,this.id=`InlineEditHintsContentWidget${zM.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=gi("div.inlineEditHints",{className:this.withBorder?".withBorder":""},[gi("div@toolBar")]),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu($.InlineEditActions,this._contextKeyService)),this.toolBar=this._register(r.createInstance(VU,this.nodes.toolBar,this.editor,$.InlineEditToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:a=>a.startsWith("primary")},actionViewItemProvider:(a,l)=>{if(a instanceof pc)return r.createInstance(Vlt,a,void 0)},telemetrySource:"InlineEditToolbar"})),this._register(this.toolBar.onDidChangeDropdownVisibility(a=>{zM._dropDownVisible=a})),this._register(bn(a=>{this._position.read(a),this.editor.layoutContentWidget(this)})),this._register(bn(a=>{const l=[];for(const[c,u]of this.inlineCompletionsActionsMenus.getActions())for(const d of u)d instanceof pc&&l.push(d);l.length>0&&l.unshift(new lo),this.toolBar.setAdditionalSecondaryActions(l)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};sS._dropDownVisible=!1;sS.id=0;sS=zM=uZ([Ug(3,Ot),Ug(4,Vt),Ug(5,hu)],sS);class Vlt extends e_{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=gi("div.keybinding").root;new PS(t,yl,{disableTitle:!0,...S0e}).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineEditStatusBarItemLabel")}}updateTooltip(){}}let VU=class extends LI{constructor(e,t,n,r,o,s,a,l,c){super(e,{resetMenu:n,...r},o,s,a,l,c),this.editor=t,this.menuId=n,this.options2=r,this.menuService=o,this.contextKeyService=s,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this._store.add(this.editor.onDidChangeCursorPosition(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var e,t,n,r,o,s,a;const l=[],c=[];i3(this.menu,(e=this.options2)===null||e===void 0?void 0:e.menuOptions,{primary:l,secondary:c},(n=(t=this.options2)===null||t===void 0?void 0:t.toolbarOptions)===null||n===void 0?void 0:n.primaryGroup,(o=(r=this.options2)===null||r===void 0?void 0:r.toolbarOptions)===null||o===void 0?void 0:o.shouldInlineSubmenu,(a=(s=this.options2)===null||s===void 0?void 0:s.toolbarOptions)===null||a===void 0?void 0:a.useSeparatorsInPrimaryActions),c.push(...this.additionalActions),l.unshift(...this.prependedPrimaryActions),this.setActions(l,c)}setAdditionalSecondaryActions(e){or(this.additionalActions,e,(t,n)=>t===n)||(this.additionalActions=e,this.updateToolbar())}};VU=uZ([Ug(4,hu),Ug(5,Vt),Ug(6,Ol),Ug(7,ci),Ug(8,ea)],VU);var zlt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},iL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},G0;class Ult{constructor(e,t){this.widget=e,this.edit=t}dispose(){this.widget.dispose()}}let mo=G0=class extends fe{static get(e){return e.getContribution(G0.ID)}constructor(e,t,n,r,o,s){super(),this.editor=e,this.instantiationService=t,this.contextKeyService=n,this.languageFeaturesService=r,this._commandService=o,this._configurationService=s,this._isVisibleContext=G0.inlineEditVisibleContext.bindTo(this.contextKeyService),this._isCursorAtInlineEditContext=G0.cursorAtInlineEditContext.bindTo(this.contextKeyService),this._currentEdit=this._register(yI(this,void 0)),this._isAccepting=!1,this._enabled=Vi(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(63).enabled),this._fontFamily=Vi(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(63).fontFamily),this._backgroundColoring=Vi(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(63).backgroundColoring);const a=ma("InlineEditController.modelContentChangedSignal",e.onDidChangeModelContent);this._register(bn(h=>{this._enabled.read(h)&&(a.read(h),this.getInlineEdit(e,!0))}));const l=Vi(e.onDidChangeCursorPosition,()=>e.getPosition());this._register(bn(h=>{if(!this._enabled.read(h))return;const f=l.read(h);f&&this.checkCursorPosition(f)})),this._register(bn(h=>{const f=this._currentEdit.read(h);if(this._isCursorAtInlineEditContext.set(!1),!f){this._isVisibleContext.set(!1);return}this._isVisibleContext.set(!0);const g=e.getPosition();g&&this.checkCursorPosition(g)}));const c=ma("InlineEditController.editorBlurSignal",e.onDidBlurEditorWidget);this._register(bn(h=>{var f;this._enabled.read(h)&&(c.read(h),!(this._configurationService.getValue("editor.experimentalInlineEdit.keepOnBlur")||e.getOption(63).keepOnBlur)&&((f=this._currentRequestCts)===null||f===void 0||f.dispose(),this._currentRequestCts=void 0,this.clear(!1)))}));const u=ma("InlineEditController.editorFocusSignal",e.onDidFocusEditorText);this._register(bn(h=>{this._enabled.read(h)&&(u.read(h),this.getInlineEdit(e,!0))}));const d=this._register(sme());this._register(bn(h=>{const f=this._fontFamily.read(h);d.setStyle(f===""||f==="default"?"":` .monaco-editor .inline-edit-decoration, .monaco-editor .inline-edit-decoration-preview, .monaco-editor .inline-edit { font-family: ${f}; }`)})),this._register(new HU(this.editor,this._currentEdit,this.instantiationService))}checkCursorPosition(e){var t;if(!this._currentEdit){this._isCursorAtInlineEditContext.set(!1);return}const n=(t=this._currentEdit.get())===null||t===void 0?void 0:t.edit;if(!n){this._isCursorAtInlineEditContext.set(!1);return}this._isCursorAtInlineEditContext.set(B.containsPosition(n.range,e))}validateInlineEdit(e,t){var n,r;if(t.text.includes(` `)&&t.range.startLineNumber!==t.range.endLineNumber&&t.range.startColumn!==t.range.endColumn){if(t.range.startColumn!==1)return!1;const s=t.range.endLineNumber,a=t.range.endColumn,l=(r=(n=e.getModel())===null||n===void 0?void 0:n.getLineLength(s))!==null&&r!==void 0?r:0;if(a!==l+1)return!1}return!0}async fetchInlineEdit(e,t){this._currentRequestCts&&this._currentRequestCts.dispose(!0);const n=e.getModel();if(!n)return;const r=n.getVersionId(),o=this.languageFeaturesService.inlineEditProvider.all(n);if(o.length===0)return;const s=o[0];this._currentRequestCts=new wr;const a=this._currentRequestCts.token,l=t?$A.Automatic:$A.Invoke;if(t&&await jlt(50,a),a.isCancellationRequested||n.isDisposed()||n.getVersionId()!==r)return;const u=await s.provideInlineEdit(n,{triggerKind:l},a);if(u&&!(a.isCancellationRequested||n.isDisposed()||n.getVersionId()!==r)&&this.validateInlineEdit(e,u))return u}async getInlineEdit(e,t){var n;this._isCursorAtInlineEditContext.set(!1),this.clear(),this._isAccepting=!1;const r=await this.fetchInlineEdit(e,t);if(!r)return;const o=r.range.endLineNumber,s=r.range.endColumn,a=new FI(o,[new xO(s,r.text,!1)]),l=this.instantiationService.createInstance($U,this.editor,{ghostText:ap(a),minReservedLineCount:ap(0),targetTextModel:ap((n=this.editor.getModel())!==null&&n!==void 0?n:void 0),range:ap(r.range),backgroundColoring:this._backgroundColoring});this._currentEdit.set(new Ult(l,r),void 0)}async trigger(){await this.getInlineEdit(this.editor,!1)}async jumpBack(){this._jumpBackPosition&&(this.editor.setPosition(this._jumpBackPosition),this.editor.revealPositionInCenterIfOutsideViewport(this._jumpBackPosition))}accept(){var e;this._isAccepting=!0;const t=(e=this._currentEdit.get())===null||e===void 0?void 0:e.edit;if(!t)return;let n=t.text;t.text.startsWith(` -`)&&(n=t.text.substring(1)),this.editor.pushUndoStop(),this.editor.executeEdits("acceptCurrent",[Xi.replace(B.lift(t.range),n)]),t.accepted&&this._commandService.executeCommand(t.accepted.id,...t.accepted.arguments||[]),this.freeEdit(t),this._currentEdit.set(void 0,void 0)}jumpToCurrent(){var e,t;this._jumpBackPosition=(e=this.editor.getSelection())===null||e===void 0?void 0:e.getStartPosition();const n=(t=this._currentEdit.get())===null||t===void 0?void 0:t.edit;if(!n)return;const r=ae.lift({lineNumber:n.range.startLineNumber,column:n.range.startColumn});this.editor.setPosition(r),this.editor.revealPositionInCenterIfOutsideViewport(r)}clear(e=!0){var t;const n=(t=this._currentEdit.get())===null||t===void 0?void 0:t.edit;n&&(n!=null&&n.rejected)&&!this._isAccepting&&e&&this._commandService.executeCommand(n.rejected.id,...n.rejected.arguments||[]),n&&this.freeEdit(n),this._currentEdit.set(void 0,void 0)}freeEdit(e){const t=this.editor.getModel();if(!t)return;const n=this.languageFeaturesService.inlineEditProvider.all(t);n.length!==0&&n[0].freeInlineEdit(e)}shouldShowHoverAt(e){const t=this._currentEdit.get();if(!t)return!1;const n=t.edit,r=t.widget.model;if(B.containsPosition(n.range,e.getStartPosition())||B.containsPosition(n.range,e.getEndPosition()))return!0;const s=r.ghostText.get();return s?s.parts.some(a=>e.containsPosition(new ae(s.lineNumber,a.column))):!1}shouldShowHoverAtViewZone(e){var t,n;return(n=(t=this._currentEdit.get())===null||t===void 0?void 0:t.widget.ownsViewZone(e))!==null&&n!==void 0?n:!1}};mo.ID="editor.contrib.inlineEditController";mo.inlineEditVisibleKey="inlineEditVisible";mo.inlineEditVisibleContext=new st(q0.inlineEditVisibleKey,!1);mo.cursorAtInlineEditKey="cursorAtInlineEdit";mo.cursorAtInlineEditContext=new st(q0.cursorAtInlineEditKey,!1);mo=q0=zlt([iL(1,Ot),iL(2,Vt),iL(3,_t),iL(4,sr),iL(5,gn)],mo);function jlt(i,e){return new Promise(t=>{let n;const r=setTimeout(()=>{n&&n.dispose(),t()},i);e&&(n=e.onCancellationRequested(()=>{clearTimeout(r),n&&n.dispose(),t()}))})}class Klt extends gt{constructor(){super({id:Olt,label:"Accept Inline Edit",alias:"Accept Inline Edit",precondition:De.and(j.writable,mo.inlineEditVisibleContext),kbOpts:[{weight:100+1,primary:2,kbExpr:De.and(j.writable,mo.inlineEditVisibleContext,mo.cursorAtInlineEditContext)}],menuOpts:[{menuId:$.InlineEditToolbar,title:"Accept",group:"primary",order:1}]})}async run(e,t){const n=mo.get(t);n==null||n.accept()}}class Glt extends gt{constructor(){const e=De.and(j.writable,De.not(mo.inlineEditVisibleKey));super({id:"editor.action.inlineEdit.trigger",label:"Trigger Inline Edit",alias:"Trigger Inline Edit",precondition:e,kbOpts:{weight:100+1,primary:2646,kbExpr:e}})}async run(e,t){const n=mo.get(t);n==null||n.trigger()}}class qlt extends gt{constructor(){const e=De.and(j.writable,mo.inlineEditVisibleContext,De.not(mo.cursorAtInlineEditKey));super({id:Blt,label:"Jump to Inline Edit",alias:"Jump to Inline Edit",precondition:e,kbOpts:{weight:100+1,primary:2646,kbExpr:e},menuOpts:[{menuId:$.InlineEditToolbar,title:"Jump To Edit",group:"primary",order:3,when:e}]})}async run(e,t){const n=mo.get(t);n==null||n.jumpToCurrent()}}class Xlt extends gt{constructor(){const e=De.and(j.writable,mo.cursorAtInlineEditContext);super({id:Wlt,label:"Jump Back from Inline Edit",alias:"Jump Back from Inline Edit",precondition:e,kbOpts:{weight:100+10,primary:2646,kbExpr:e},menuOpts:[{menuId:$.InlineEditToolbar,title:"Jump Back",group:"primary",order:3,when:e}]})}async run(e,t){const n=mo.get(t);n==null||n.jumpBack()}}class Ylt extends gt{constructor(){const e=De.and(j.writable,mo.inlineEditVisibleContext);super({id:Flt,label:"Reject Inline Edit",alias:"Reject Inline Edit",precondition:e,kbOpts:{weight:100,primary:9,kbExpr:e},menuOpts:[{menuId:$.InlineEditToolbar,title:"Reject",group:"secondary",order:2}]})}async run(e,t){const n=mo.get(t);n==null||n.clear()}}var Zlt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Lle=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class Qlt{constructor(e,t,n){this.owner=e,this.range=t,this.controller=n}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let zU=class{constructor(e,t,n){this._editor=e,this._instantiationService=t,this._telemetryService=n,this.hoverOrdinal=5}suggestHoverAnchor(e){const t=mo.get(this._editor);if(!t)return null;const n=e.target;if(n.type===8){const r=n.detail;if(t.shouldShowHoverAtViewZone(r.viewZoneId)){const o=n.range;return new ub(1e3,this,o,e.event.posx,e.event.posy,!1)}}return n.type===7&&t.shouldShowHoverAt(n.range)?new ub(1e3,this,n.range,e.event.posx,e.event.posy,!1):n.type===6&&n.detail.mightBeForeignElement&&t.shouldShowHoverAt(n.range)?new ub(1e3,this,n.range,e.event.posx,e.event.posy,!1):null}computeSync(e,t){if(this._editor.getOption(63).showToolbar!=="onHover")return[];const n=mo.get(this._editor);return n&&n.shouldShowHoverAt(e.range)?[new Qlt(this,e.range,n)]:[]}renderHoverParts(e,t){const n=new Te;this._telemetryService.publicLog2("inlineEditHover.shown");const r=this._instantiationService.createInstance(sS,this._editor,!1,ap(null));return e.fragment.appendChild(r.getDomNode()),n.add(r),n}};zU=Zlt([Lle(1,Ot),Lle(2,ea)],zU);Be(Klt);Be(Ylt);Be(qlt);Be(Xlt);Be(Glt);jn(mo.ID,mo,3);P_.register(zU);const Zb={Visible:new st("parameterHintsVisible",!1),MultipleSignatures:new st("parameterHintsMultipleSignatures",!1)};async function V1e(i,e,t,n,r){const o=i.ordered(e);for(const s of o)try{const a=await s.provideSignatureHelp(e,t,r,n);if(a)return a}catch(a){Zr(a)}}Dn.registerCommand("_executeSignatureHelpProvider",async(i,...e)=>{const[t,n,r]=e;Xn(At.isUri(t)),Xn(ae.isIPosition(n)),Xn(typeof r=="string"||!r);const o=i.get(_t),s=await i.get(ol).createModelReference(t);try{const a=await V1e(o.signatureHelpProvider,s.object.textEditorModel,ae.lift(n),{triggerKind:Tf.Invoke,isRetrigger:!1,triggerCharacter:r},Cn.None);return a?(setTimeout(()=>a.dispose(),0),a.value):void 0}finally{s.dispose()}});var Im;(function(i){i.Default={type:0};class e{constructor(r,o){this.request=r,this.previouslyActiveHints=o,this.type=2}}i.Pending=e;class t{constructor(r){this.hints=r,this.type=1}}i.Active=t})(Im||(Im={}));class u5 extends fe{constructor(e,t,n=u5.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new se),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=Im.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new Ho),this.triggerChars=new JA,this.retriggerChars=new JA,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new nd(n),this._register(this.editor.onDidBlurEditorWidget(()=>this.cancel())),this._register(this.editor.onDidChangeConfiguration(()=>this.onEditorConfigurationChange())),this._register(this.editor.onDidChangeModel(r=>this.onModelChanged())),this._register(this.editor.onDidChangeModelLanguage(r=>this.onModelChanged())),this._register(this.editor.onDidChangeCursorSelection(r=>this.onCursorChange(r))),this._register(this.editor.onDidChangeModelContent(r=>this.onModelContentChange())),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType(r=>this.onDidType(r))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){this._state.type===2&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=Im.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){const n=this.editor.getModel();if(!n||!this.providers.has(n))return;const r=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(r),t).catch(en)}next(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,n=t%e===e-1,r=this.editor.getOption(86).cycle;if((e<2||n)&&!r){this.cancel();return}this.updateActiveSignature(n&&r?0:t+1)}previous(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,n=t===0,r=this.editor.getOption(86).cycle;if((e<2||n)&&!r){this.cancel();return}this.updateActiveSignature(n&&r?e-1:t-1)}updateActiveSignature(e){this.state.type===1&&(this.state=new Im.Active({...this.state.hints,activeSignature:e}),this._onChangedHints.fire(this.state.hints))}async doTrigger(e){const t=this.state.type===1||this.state.type===2,n=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;const r=this._pendingTriggers.reduce(Jlt);this._pendingTriggers=[];const o={triggerKind:r.triggerKind,triggerCharacter:r.triggerCharacter,isRetrigger:t,activeSignatureHelp:n};if(!this.editor.hasModel())return!1;const s=this.editor.getModel(),a=this.editor.getPosition();this.state=new Im.Pending(Io(l=>V1e(this.providers,s,a,o,l)),n);try{const l=await this.state.request;return e!==this.triggerId?(l==null||l.dispose(),!1):!l||!l.value.signatures||l.value.signatures.length===0?(l==null||l.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1):(this.state=new Im.Active(l.value),this._lastSignatureHelpResult.value=l,this._onChangedHints.fire(this.state.hints),!0)}catch(l){return e===this.triggerId&&(this.state=Im.Default),en(l),!1}}getLastActiveHints(){switch(this.state.type){case 1:return this.state.hints;case 2:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return this.state.type===1||this.state.type===2||this.throttledDelayer.isTriggered()}onModelChanged(){this.cancel(),this.triggerChars.clear(),this.retriggerChars.clear();const e=this.editor.getModel();if(e)for(const t of this.providers.ordered(e)){for(const n of t.signatureHelpTriggerCharacters||[])if(n.length){const r=n.charCodeAt(0);this.triggerChars.add(r),this.retriggerChars.add(r)}for(const n of t.signatureHelpRetriggerCharacters||[])n.length&&this.retriggerChars.add(n.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const t=e.length-1,n=e.charCodeAt(t);(this.triggerChars.has(n)||this.isTriggered&&this.retriggerChars.has(n))&&this.trigger({triggerKind:Tf.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:Tf.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:Tf.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(86).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}}u5.DEFAULT_DELAY=120;function Jlt(i,e){switch(e.triggerKind){case Tf.Invoke:return e;case Tf.ContentChange:return i;case Tf.TriggerCharacter:default:return e}}var ect=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},U9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},UU;const Ul=He,tct=Mr("parameter-hints-next",Xe.chevronDown,w("parameterHintsNextIcon","Icon for show next parameter hint.")),nct=Mr("parameter-hints-previous",Xe.chevronUp,w("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let NO=UU=class extends fe{constructor(e,t,n,r,o){super(),this.editor=e,this.model=t,this.renderDisposeables=this._register(new Te),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new Uf({editor:e},o,r)),this.keyVisible=Zb.Visible.bindTo(n),this.keyMultipleSignatures=Zb.MultipleSignatures.bindTo(n)}createParameterHintDOMNodes(){const e=Ul(".editor-widget.parameter-hints-widget"),t=ke(e,Ul(".phwrapper"));t.tabIndex=-1;const n=ke(t,Ul(".controls")),r=ke(n,Ul(".button"+Wt.asCSSSelector(nct))),o=ke(n,Ul(".overloads")),s=ke(n,Ul(".button"+Wt.asCSSSelector(tct)));this._register(ye(r,"click",h=>{hn.stop(h),this.previous()})),this._register(ye(s,"click",h=>{hn.stop(h),this.next()}));const a=Ul(".body"),l=new Hk(a,{alwaysConsumeMouseWheel:!0});this._register(l),t.appendChild(l.getDomNode());const c=ke(a,Ul(".signature")),u=ke(a,Ul(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:c,overloads:o,docs:u,scrollbar:l},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(h=>{this.visible&&this.editor.layoutContentWidget(this)}));const d=()=>{if(!this.domNodes)return;const h=this.editor.getOption(50);this.domNodes.element.style.fontSize=`${h.fontSize}px`,this.domNodes.element.style.lineHeight=`${h.lineHeight/h.fontSize}`};d(),this._register(Je.chain(this.editor.onDidChangeConfiguration.bind(this.editor),h=>h.filter(f=>f.hasChanged(50)))(d)),this._register(this.editor.onDidLayoutChange(h=>this.updateMaxHeight())),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout(()=>{var e;(e=this.domNodes)===null||e===void 0||e.element.classList.add("visible")},100),this.editor.layoutContentWidget(this))}hide(){var e;this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,(e=this.domNodes)===null||e===void 0||e.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){var t;if(this.renderDisposeables.clear(),!this.domNodes)return;const n=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",n),this.keyMultipleSignatures.set(n),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const r=e.signatures[e.activeSignature];if(!r)return;const o=ke(this.domNodes.signature,Ul(".code")),s=this.editor.getOption(50);o.style.fontSize=`${s.fontSize}px`,o.style.fontFamily=s.fontFamily;const a=r.parameters.length>0,l=(t=r.activeParameter)!==null&&t!==void 0?t:e.activeParameter;if(a)this.renderParameters(o,r,l);else{const d=ke(o,Ul("span"));d.textContent=r.label}const c=r.parameters[l];if(c!=null&&c.documentation){const d=Ul("span.documentation");if(typeof c.documentation=="string")d.textContent=c.documentation;else{const h=this.renderMarkdownDocs(c.documentation);d.appendChild(h.element)}ke(this.domNodes.docs,Ul("p",{},d))}if(r.documentation!==void 0)if(typeof r.documentation=="string")ke(this.domNodes.docs,Ul("p",{},r.documentation));else{const d=this.renderMarkdownDocs(r.documentation);ke(this.domNodes.docs,d.element)}const u=this.hasDocs(r,c);if(this.domNodes.signature.classList.toggle("has-docs",u),this.domNodes.docs.classList.toggle("empty",!u),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,c){let d="";const h=r.parameters[l];Array.isArray(h.label)?d=r.label.substring(h.label[0],h.label[1]):d=h.label,h.documentation&&(d+=typeof h.documentation=="string"?`, ${h.documentation}`:`, ${h.documentation.value}`),r.documentation&&(d+=typeof r.documentation=="string"?`, ${r.documentation}`:`, ${r.documentation.value}`),this.announcedLabel!==d&&(kl(w("hint","{0}, hint",d)),this.announcedLabel=d)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=this.renderDisposeables.add(this.markdownRenderer.render(e,{asyncRenderCallback:()=>{var n;(n=this.domNodes)===null||n===void 0||n.scrollbar.scanDomNode()}}));return t.element.classList.add("markdown-docs"),t}hasDocs(e,t){return!!(t&&typeof t.documentation=="string"&&Vm(t.documentation).length>0||t&&typeof t.documentation=="object"&&Vm(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&Vm(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&Vm(e.documentation.value).length>0)}renderParameters(e,t,n){const[r,o]=this.getParameterLabelOffsets(t,n),s=document.createElement("span");s.textContent=t.label.substring(0,r);const a=document.createElement("span");a.textContent=t.label.substring(r,o),a.className="parameter active";const l=document.createElement("span");l.textContent=t.label.substring(o),ke(e,s,a,l)}getParameterLabelOffsets(e,t){const n=e.parameters[t];if(n){if(Array.isArray(n.label))return n.label;if(n.label.length){const r=new RegExp(`(\\W|^)${fc(n.label)}(?=\\W|$)`,"g");r.test(e.label);const o=r.lastIndex-n.label.length;return o>=0?[o,r.lastIndex]:[0,0]}else return[0,0]}else return[0,0]}next(){this.editor.focus(),this.model.next()}previous(){this.editor.focus(),this.model.previous()}getDomNode(){return this.domNodes||this.createParameterHintDOMNodes(),this.domNodes.element}getId(){return UU.ID}updateMaxHeight(){if(!this.domNodes)return;const t=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=t;const n=this.domNodes.element.getElementsByClassName("phwrapper");n.length&&(n[0].style.maxHeight=t)}};NO.ID="editor.widget.parameterHintsWidget";NO=UU=ect([U9(2,Vt),U9(3,al),U9(4,ji)],NO);X("editorHoverWidget.highlightForeground",{dark:Gu,light:Gu,hcDark:Gu,hcLight:Gu},w("editorHoverWidgetHighlightForeground","Foreground color of the active item in the parameter hint."));var ict=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Ele=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},jU;let Qb=jU=class extends fe{static get(e){return e.getContribution(jU.ID)}constructor(e,t,n){super(),this.editor=e,this.model=this._register(new u5(e,n.signatureHelpProvider)),this._register(this.model.onChangedHints(r=>{var o;r?(this.widget.value.show(),this.widget.value.render(r)):(o=this.widget.rawValue)===null||o===void 0||o.hide()})),this.widget=new Qf(()=>this._register(t.createInstance(NO,this.editor,this.model)))}cancel(){this.model.cancel()}previous(){var e;(e=this.widget.rawValue)===null||e===void 0||e.previous()}next(){var e;(e=this.widget.rawValue)===null||e===void 0||e.next()}trigger(e){this.model.trigger(e,0)}};Qb.ID="editor.controller.parameterHints";Qb=jU=ict([Ele(1,Ot),Ele(2,_t)],Qb);class rct extends gt{constructor(){super({id:"editor.action.triggerParameterHints",label:w("parameterHints.trigger.label","Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:j.hasSignatureHelpProvider,kbOpts:{kbExpr:j.editorTextFocus,primary:3082,weight:100}})}run(e,t){const n=Qb.get(t);n==null||n.trigger({triggerKind:Tf.Invoke})}}jn(Qb.ID,Qb,2);Be(rct);const dZ=100+75,hZ=Vo.bindToContribution(Qb.get);et(new hZ({id:"closeParameterHints",precondition:Zb.Visible,handler:i=>i.cancel(),kbOpts:{weight:dZ,kbExpr:j.focus,primary:9,secondary:[1033]}}));et(new hZ({id:"showPrevParameterHint",precondition:De.and(Zb.Visible,Zb.MultipleSignatures),handler:i=>i.previous(),kbOpts:{weight:dZ,kbExpr:j.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}}));et(new hZ({id:"showNextParameterHint",precondition:De.and(Zb.Visible,Zb.MultipleSignatures),handler:i=>i.next(),kbOpts:{weight:dZ,kbExpr:j.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));var oct=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},b2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const KS=new st("renameInputVisible",!1,w("renameInputVisible","Whether the rename input widget is visible")),KU=new st("renameInputFocused",!1,w("renameInputFocused","Whether the rename input widget is focused"));let GU=class{constructor(e,t,n,r,o,s){this._editor=e,this._acceptKeybindings=t,this._themeService=n,this._keybindingService=r,this._logService=s,this._disposables=new Te,this.allowEditorOverflow=!0,this._visibleContextKey=KS.bindTo(o),this._focusedContextKey=KU.bindTo(o),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{a.hasChanged(50)&&this._updateFont()})),this._disposables.add(n.onDidColorThemeChange(this._updateStyles,this))}dispose(){this._disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return"__renameInputWidget"}getDomNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="monaco-editor rename-box",this._input=document.createElement("input"),this._input.className="rename-input",this._input.type="text",this._input.setAttribute("aria-label",w("renameAriaLabel","Rename input. Type new name and press Enter to commit.")),this._disposables.add(ye(this._input,"focus",()=>{this._focusedContextKey.set(!0)})),this._disposables.add(ye(this._input,"blur",()=>{this._focusedContextKey.reset()})),this._domNode.appendChild(this._input),this._candidatesView=this._disposables.add(new sct(this._domNode,{fontInfo:this._editor.getOption(50),onSelectionChange:()=>this.acceptInput(!1)})),this._label=document.createElement("div"),this._label.className="rename-label",this._domNode.appendChild(this._label),this._updateFont(),this._updateStyles(this._themeService.getColorTheme())),this._domNode}_updateStyles(e){var t,n,r,o;if(!this._input||!this._domNode)return;const s=e.getColor(Yg),a=e.getColor(Qme);this._domNode.style.backgroundColor=String((t=e.getColor(Nr))!==null&&t!==void 0?t:""),this._domNode.style.boxShadow=s?` 0 0 8px 2px ${s}`:"",this._domNode.style.border=a?`1px solid ${a}`:"",this._domNode.style.color=String((n=e.getColor(eve))!==null&&n!==void 0?n:""),this._input.style.backgroundColor=String((r=e.getColor(Jme))!==null&&r!==void 0?r:"");const l=e.getColor(tve);this._input.style.borderWidth=l?"1px":"0px",this._input.style.borderStyle=l?"solid":"none",this._input.style.borderColor=(o=l==null?void 0:l.toString())!==null&&o!==void 0?o:"none"}_updateFont(){if(!this._input||!this._label||!this._candidatesView)return;const e=this._editor.getOption(50);this._input.style.fontFamily=e.fontFamily,this._input.style.fontWeight=e.fontWeight,this._input.style.fontSize=`${e.fontSize}px`,this._candidatesView.updateFont(e),this._label.style.fontSize=`${this._computeLabelFontSize(e.fontSize)}px`}_computeLabelFontSize(e){return e*.8}getPosition(){if(!this._visible||!this._editor.hasModel()||!this._editor.getDomNode())return null;const e=kp(this.getDomNode().ownerDocument.body),t=Br(this._editor.getDomNode()),n=this._getTopForPosition();this._nPxAvailableAbove=n+t.top,this._nPxAvailableBelow=e.height-this._nPxAvailableAbove;const r=this._editor.getOption(67),{totalHeight:o}=Jb.getLayoutInfo({lineHeight:r}),s=this._nPxAvailableBelow>o*6?[2,1]:[1,2];return{position:this._position,preference:s}}beforeRender(){var e,t;const[n,r]=this._acceptKeybindings;return this._label.innerText=w({key:"label",comment:['placeholders are keybindings, e.g "F2 to Rename, Shift+F2 to Preview"']},"{0} to Rename, {1} to Preview",(e=this._keybindingService.lookupKeybinding(n))===null||e===void 0?void 0:e.getLabel(),(t=this._keybindingService.lookupKeybinding(r))===null||t===void 0?void 0:t.getLabel()),this._domNode.style.minWidth="200px",null}afterRender(e){if(this._trace("invoking afterRender, position: ",e?"not null":"null"),e===null){this.cancelInput(!0,"afterRender (because position is null)");return}if(!this._editor.hasModel()||!this._editor.getDomNode())return;Xn(this._candidatesView),Xn(this._nPxAvailableAbove!==void 0),Xn(this._nPxAvailableBelow!==void 0);const t=qg(this._input),n=qg(this._label);let r;e===2?r=this._nPxAvailableBelow:r=this._nPxAvailableAbove,this._candidatesView.layout({height:r-n-t,width:ua(this._input)})}acceptInput(e){var t;this._trace("invoking acceptInput"),(t=this._currentAcceptInput)===null||t===void 0||t.call(this,e)}cancelInput(e,t){var n;this._trace(`invoking cancelInput, caller: ${t}, _currentCancelInput: ${this._currentAcceptInput?"not undefined":"undefined"}`),(n=this._currentCancelInput)===null||n===void 0||n.call(this,e)}focusNextRenameSuggestion(){var e;(e=this._candidatesView)===null||e===void 0||e.focusNext()}focusPreviousRenameSuggestion(){var e;!((e=this._candidatesView)===null||e===void 0)&&e.focusPrevious()||this._input.focus()}getInput(e,t,n,r,o,s,a){this._domNode.classList.toggle("preview",o),this._position=new ae(e.startLineNumber,e.startColumn),this._input.value=t,this._input.setAttribute("selectionStart",n.toString()),this._input.setAttribute("selectionEnd",r.toString()),this._input.size=Math.max((e.endColumn-e.startColumn)*1.1,20);const l=new Te;return l.add(Rt(()=>a.dispose(!0))),this._updateRenameCandidates(s,t,a.token),new Promise(c=>{this._currentCancelInput=u=>{var d;return this._trace("invoking _currentCancelInput"),this._currentAcceptInput=void 0,this._currentCancelInput=void 0,(d=this._candidatesView)===null||d===void 0||d.clearCandidates(),c(u),!0},this._currentAcceptInput=u=>{this._trace("invoking _currentAcceptInput"),Xn(this._input!==void 0),Xn(this._candidatesView!==void 0);const d=this._candidatesView.nCandidates;let h,f;const g=this._candidatesView.focusedCandidate;if(g!==void 0?(this._trace("using new name from renameSuggestion"),h=g,f="renameSuggestion"):(this._trace("using new name from inputField"),h=this._input.value,f="inputField"),h===t||h.trim().length===0){this.cancelInput(!0,"_currentAcceptInput (because newName === value || newName.trim().length === 0)");return}this._currentAcceptInput=void 0,this._currentCancelInput=void 0,this._candidatesView.clearCandidates(),c({newName:h,wantsPreview:o&&u,source:f,nRenameSuggestions:d})},l.add(a.token.onCancellationRequested(()=>this.cancelInput(!0,"cts.token.onCancellationRequested"))),l.add(this._editor.onDidBlurEditorWidget(()=>{var u;return this.cancelInput(!(!((u=this._domNode)===null||u===void 0)&&u.ownerDocument.hasFocus()),"editor.onDidBlurEditorWidget")})),this._show()}).finally(()=>{l.dispose(),this._hide()})}_show(){this._trace("invoking _show"),this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,0),this._visible=!0,this._visibleContextKey.set(!0),this._editor.layoutContentWidget(this),setTimeout(()=>{this._input.focus(),this._input.setSelectionRange(parseInt(this._input.getAttribute("selectionStart")),parseInt(this._input.getAttribute("selectionEnd")))},100)}async _updateRenameCandidates(e,t,n){const r=(...c)=>this._trace("_updateRenameCandidates",...c);r("start");const o=await Rk(Promise.allSettled(e),n);if(o===void 0){r("returning early - received updateRenameCandidates results - undefined");return}const s=o.flatMap(c=>c.status==="fulfilled"&&kf(c.value)?c.value:[]);r(`received updateRenameCandidates results - total (unfiltered) ${s.length} candidates.`);const a=Lp(s,c=>c.newSymbolName);r(`distinct candidates - ${a.length} candidates.`);const l=a.filter(({newSymbolName:c})=>{var u;return c.trim().length>0&&c!==((u=this._input)===null||u===void 0?void 0:u.value)&&c!==t});if(r(`valid distinct candidates - ${s.length} candidates.`),l.length<1){r("returning early - no valid distinct candidates");return}r("setting candidates"),this._candidatesView.setCandidates(l),r("asking editor to re-layout"),this._editor.layoutContentWidget(this)}_hide(){this._trace("invoked _hide"),this._visible=!1,this._visibleContextKey.reset(),this._editor.layoutContentWidget(this)}_getTopForPosition(){const e=this._editor.getVisibleRanges();let t;return e.length>0?t=e[0].startLineNumber:(this._logService.warn("RenameInputField#_getTopForPosition: this should not happen - visibleRanges is empty"),t=Math.max(1,this._position.lineNumber-5)),this._editor.getTopForLineNumber(this._position.lineNumber)-this._editor.getTopForLineNumber(t)}_trace(...e){this._logService.trace("RenameInputField",...e)}};GU=oct([b2(2,To),b2(3,ci),b2(4,Vt),b2(5,Ta)],GU);class sct{constructor(e,t){this._disposables=new Te,this._availableHeight=0,this._minimumWidth=0,this._lineHeight=t.fontInfo.lineHeight,this._typicalHalfwidthCharacterWidth=t.fontInfo.typicalHalfwidthCharacterWidth,this._listContainer=document.createElement("div"),this._listContainer.style.fontFamily=t.fontInfo.fontFamily,this._listContainer.style.fontWeight=t.fontInfo.fontWeight,this._listContainer.style.fontSize=`${t.fontInfo.fontSize}px`,e.appendChild(this._listContainer);const n=this,r=new class{getTemplateId(s){return"candidate"}getHeight(s){return n._candidateViewHeight}},o=new class{constructor(){this.templateId="candidate"}renderTemplate(s){return new Jb(s,{lineHeight:n._lineHeight})}renderElement(s,a,l){l.model=s}disposeTemplate(s){s.dispose()}};this._listWidget=new wc("NewSymbolNameCandidates",this._listContainer,r,[o],{keyboardSupport:!1,mouseSupport:!0,multipleSelectionSupport:!1}),this._disposables.add(this._listWidget.onDidChangeSelection(s=>{s.elements.length>0&&t.onSelectionChange()})),this._disposables.add(this._listWidget.onDidBlur(s=>{this._listWidget.setFocus([])})),this._listWidget.style(R_)}dispose(){this._listWidget.dispose(),this._disposables.dispose()}layout({height:e,width:t}){this._availableHeight=e,this._minimumWidth=t}setCandidates(e){this._listWidget.splice(0,0,e);const t=this._pickListHeight(e.length),n=this._pickListWidth(e);this._listWidget.layout(t,n),this._listContainer.style.height=`${t}px`,this._listContainer.style.width=`${n}px`,Hf(w("renameSuggestionsReceivedAria","Received {0} rename suggestions",e.length))}clearCandidates(){this._listContainer.style.height="0px",this._listContainer.style.width="0px",this._listWidget.splice(0,this._listWidget.length,[])}get nCandidates(){return this._listWidget.length}get focusedCandidate(){if(this._listWidget.length===0)return;const e=this._listWidget.getSelectedElements()[0];if(e!==void 0)return e.newSymbolName;const t=this._listWidget.getFocusedElements()[0];if(t!==void 0)return t.newSymbolName}updateFont(e){this._listContainer.style.fontFamily=e.fontFamily,this._listContainer.style.fontWeight=e.fontWeight,this._listContainer.style.fontSize=`${e.fontSize}px`,this._lineHeight=e.lineHeight,this._listWidget.rerender()}focusNext(){this._listWidget.length!==0&&(this._listWidget.isDOMFocused()?this._listWidget.focusNext():(this._listWidget.domFocus(),this._listWidget.focusFirst()),this._listWidget.reveal(this._listWidget.getFocus()[0]))}focusPrevious(){if(this._listWidget.length===0)return!1;this._listWidget.domFocus();const e=this._listWidget.getFocus()[0];return e!==0&&(this._listWidget.focusPrevious(),this._listWidget.reveal(this._listWidget.getFocus()[0])),e>0}get _candidateViewHeight(){const{totalHeight:e}=Jb.getLayoutInfo({lineHeight:this._lineHeight});return e}_pickListHeight(e){const t=this._candidateViewHeight*e,n=7;return Math.min(t,this._availableHeight,this._candidateViewHeight*n)}_pickListWidth(e){const t=Math.ceil(Math.max(...e.map(r=>r.newSymbolName.length))*this._typicalHalfwidthCharacterWidth);return Math.max(this._minimumWidth,4+16+5+t+10)}}class Jb{constructor(e,{lineHeight:t}){this.domNode=document.createElement("div"),this.domNode.style.display="flex",this.domNode.style.alignItems="center",this.domNode.style.height=`${t}px`,this.domNode.style.padding=`${Jb._PADDING}px`,this._icon=document.createElement("div"),this._icon.style.display="flex",this._icon.style.alignItems="center",this._icon.style.width=this._icon.style.height=`${t*.8}px`,this.domNode.appendChild(this._icon),this._label=document.createElement("div"),this._icon.style.display="flex",this._icon.style.alignItems="center",this._label.style.marginLeft="5px",this.domNode.appendChild(this._label),e.appendChild(this.domNode)}set model(e){this._icon.children.length===0&&this._icon.appendChild(nI(Xe.sparkle)),this._label.innerText=e.newSymbolName}static getLayoutInfo({lineHeight:e}){return{totalHeight:e+Jb._PADDING*2}}dispose(){}}Jb._PADDING=2;var act=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},um=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},qU;class fZ{constructor(e,t,n){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=n.ordered(e)}hasProvider(){return this._providers.length>0}async resolveRenameLocation(e){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx0?t.join(` +`)&&(n=t.text.substring(1)),this.editor.pushUndoStop(),this.editor.executeEdits("acceptCurrent",[Xi.replace(B.lift(t.range),n)]),t.accepted&&this._commandService.executeCommand(t.accepted.id,...t.accepted.arguments||[]),this.freeEdit(t),this._currentEdit.set(void 0,void 0)}jumpToCurrent(){var e,t;this._jumpBackPosition=(e=this.editor.getSelection())===null||e===void 0?void 0:e.getStartPosition();const n=(t=this._currentEdit.get())===null||t===void 0?void 0:t.edit;if(!n)return;const r=ae.lift({lineNumber:n.range.startLineNumber,column:n.range.startColumn});this.editor.setPosition(r),this.editor.revealPositionInCenterIfOutsideViewport(r)}clear(e=!0){var t;const n=(t=this._currentEdit.get())===null||t===void 0?void 0:t.edit;n&&(n!=null&&n.rejected)&&!this._isAccepting&&e&&this._commandService.executeCommand(n.rejected.id,...n.rejected.arguments||[]),n&&this.freeEdit(n),this._currentEdit.set(void 0,void 0)}freeEdit(e){const t=this.editor.getModel();if(!t)return;const n=this.languageFeaturesService.inlineEditProvider.all(t);n.length!==0&&n[0].freeInlineEdit(e)}shouldShowHoverAt(e){const t=this._currentEdit.get();if(!t)return!1;const n=t.edit,r=t.widget.model;if(B.containsPosition(n.range,e.getStartPosition())||B.containsPosition(n.range,e.getEndPosition()))return!0;const s=r.ghostText.get();return s?s.parts.some(a=>e.containsPosition(new ae(s.lineNumber,a.column))):!1}shouldShowHoverAtViewZone(e){var t,n;return(n=(t=this._currentEdit.get())===null||t===void 0?void 0:t.widget.ownsViewZone(e))!==null&&n!==void 0?n:!1}};mo.ID="editor.contrib.inlineEditController";mo.inlineEditVisibleKey="inlineEditVisible";mo.inlineEditVisibleContext=new st(G0.inlineEditVisibleKey,!1);mo.cursorAtInlineEditKey="cursorAtInlineEdit";mo.cursorAtInlineEditContext=new st(G0.cursorAtInlineEditKey,!1);mo=G0=zlt([iL(1,Ot),iL(2,Vt),iL(3,_t),iL(4,sr),iL(5,gn)],mo);function jlt(i,e){return new Promise(t=>{let n;const r=setTimeout(()=>{n&&n.dispose(),t()},i);e&&(n=e.onCancellationRequested(()=>{clearTimeout(r),n&&n.dispose(),t()}))})}class Klt extends gt{constructor(){super({id:Olt,label:"Accept Inline Edit",alias:"Accept Inline Edit",precondition:De.and(j.writable,mo.inlineEditVisibleContext),kbOpts:[{weight:100+1,primary:2,kbExpr:De.and(j.writable,mo.inlineEditVisibleContext,mo.cursorAtInlineEditContext)}],menuOpts:[{menuId:$.InlineEditToolbar,title:"Accept",group:"primary",order:1}]})}async run(e,t){const n=mo.get(t);n==null||n.accept()}}class Glt extends gt{constructor(){const e=De.and(j.writable,De.not(mo.inlineEditVisibleKey));super({id:"editor.action.inlineEdit.trigger",label:"Trigger Inline Edit",alias:"Trigger Inline Edit",precondition:e,kbOpts:{weight:100+1,primary:2646,kbExpr:e}})}async run(e,t){const n=mo.get(t);n==null||n.trigger()}}class qlt extends gt{constructor(){const e=De.and(j.writable,mo.inlineEditVisibleContext,De.not(mo.cursorAtInlineEditKey));super({id:Blt,label:"Jump to Inline Edit",alias:"Jump to Inline Edit",precondition:e,kbOpts:{weight:100+1,primary:2646,kbExpr:e},menuOpts:[{menuId:$.InlineEditToolbar,title:"Jump To Edit",group:"primary",order:3,when:e}]})}async run(e,t){const n=mo.get(t);n==null||n.jumpToCurrent()}}class Xlt extends gt{constructor(){const e=De.and(j.writable,mo.cursorAtInlineEditContext);super({id:Wlt,label:"Jump Back from Inline Edit",alias:"Jump Back from Inline Edit",precondition:e,kbOpts:{weight:100+10,primary:2646,kbExpr:e},menuOpts:[{menuId:$.InlineEditToolbar,title:"Jump Back",group:"primary",order:3,when:e}]})}async run(e,t){const n=mo.get(t);n==null||n.jumpBack()}}class Ylt extends gt{constructor(){const e=De.and(j.writable,mo.inlineEditVisibleContext);super({id:Flt,label:"Reject Inline Edit",alias:"Reject Inline Edit",precondition:e,kbOpts:{weight:100,primary:9,kbExpr:e},menuOpts:[{menuId:$.InlineEditToolbar,title:"Reject",group:"secondary",order:2}]})}async run(e,t){const n=mo.get(t);n==null||n.clear()}}var Zlt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Lle=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class Qlt{constructor(e,t,n){this.owner=e,this.range=t,this.controller=n}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let zU=class{constructor(e,t,n){this._editor=e,this._instantiationService=t,this._telemetryService=n,this.hoverOrdinal=5}suggestHoverAnchor(e){const t=mo.get(this._editor);if(!t)return null;const n=e.target;if(n.type===8){const r=n.detail;if(t.shouldShowHoverAtViewZone(r.viewZoneId)){const o=n.range;return new cb(1e3,this,o,e.event.posx,e.event.posy,!1)}}return n.type===7&&t.shouldShowHoverAt(n.range)?new cb(1e3,this,n.range,e.event.posx,e.event.posy,!1):n.type===6&&n.detail.mightBeForeignElement&&t.shouldShowHoverAt(n.range)?new cb(1e3,this,n.range,e.event.posx,e.event.posy,!1):null}computeSync(e,t){if(this._editor.getOption(63).showToolbar!=="onHover")return[];const n=mo.get(this._editor);return n&&n.shouldShowHoverAt(e.range)?[new Qlt(this,e.range,n)]:[]}renderHoverParts(e,t){const n=new Te;this._telemetryService.publicLog2("inlineEditHover.shown");const r=this._instantiationService.createInstance(sS,this._editor,!1,ap(null));return e.fragment.appendChild(r.getDomNode()),n.add(r),n}};zU=Zlt([Lle(1,Ot),Lle(2,ea)],zU);Be(Klt);Be(Ylt);Be(qlt);Be(Xlt);Be(Glt);jn(mo.ID,mo,3);A_.register(zU);const Zb={Visible:new st("parameterHintsVisible",!1),MultipleSignatures:new st("parameterHintsMultipleSignatures",!1)};async function V1e(i,e,t,n,r){const o=i.ordered(e);for(const s of o)try{const a=await s.provideSignatureHelp(e,t,r,n);if(a)return a}catch(a){Zr(a)}}Dn.registerCommand("_executeSignatureHelpProvider",async(i,...e)=>{const[t,n,r]=e;Xn(At.isUri(t)),Xn(ae.isIPosition(n)),Xn(typeof r=="string"||!r);const o=i.get(_t),s=await i.get(ol).createModelReference(t);try{const a=await V1e(o.signatureHelpProvider,s.object.textEditorModel,ae.lift(n),{triggerKind:Tf.Invoke,isRetrigger:!1,triggerCharacter:r},Cn.None);return a?(setTimeout(()=>a.dispose(),0),a.value):void 0}finally{s.dispose()}});var km;(function(i){i.Default={type:0};class e{constructor(r,o){this.request=r,this.previouslyActiveHints=o,this.type=2}}i.Pending=e;class t{constructor(r){this.hints=r,this.type=1}}i.Active=t})(km||(km={}));class u5 extends fe{constructor(e,t,n=u5.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new se),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=km.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new Ho),this.triggerChars=new JA,this.retriggerChars=new JA,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new nd(n),this._register(this.editor.onDidBlurEditorWidget(()=>this.cancel())),this._register(this.editor.onDidChangeConfiguration(()=>this.onEditorConfigurationChange())),this._register(this.editor.onDidChangeModel(r=>this.onModelChanged())),this._register(this.editor.onDidChangeModelLanguage(r=>this.onModelChanged())),this._register(this.editor.onDidChangeCursorSelection(r=>this.onCursorChange(r))),this._register(this.editor.onDidChangeModelContent(r=>this.onModelContentChange())),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType(r=>this.onDidType(r))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){this._state.type===2&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=km.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){const n=this.editor.getModel();if(!n||!this.providers.has(n))return;const r=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(r),t).catch(en)}next(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,n=t%e===e-1,r=this.editor.getOption(86).cycle;if((e<2||n)&&!r){this.cancel();return}this.updateActiveSignature(n&&r?0:t+1)}previous(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,n=t===0,r=this.editor.getOption(86).cycle;if((e<2||n)&&!r){this.cancel();return}this.updateActiveSignature(n&&r?e-1:t-1)}updateActiveSignature(e){this.state.type===1&&(this.state=new km.Active({...this.state.hints,activeSignature:e}),this._onChangedHints.fire(this.state.hints))}async doTrigger(e){const t=this.state.type===1||this.state.type===2,n=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;const r=this._pendingTriggers.reduce(Jlt);this._pendingTriggers=[];const o={triggerKind:r.triggerKind,triggerCharacter:r.triggerCharacter,isRetrigger:t,activeSignatureHelp:n};if(!this.editor.hasModel())return!1;const s=this.editor.getModel(),a=this.editor.getPosition();this.state=new km.Pending(Io(l=>V1e(this.providers,s,a,o,l)),n);try{const l=await this.state.request;return e!==this.triggerId?(l==null||l.dispose(),!1):!l||!l.value.signatures||l.value.signatures.length===0?(l==null||l.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1):(this.state=new km.Active(l.value),this._lastSignatureHelpResult.value=l,this._onChangedHints.fire(this.state.hints),!0)}catch(l){return e===this.triggerId&&(this.state=km.Default),en(l),!1}}getLastActiveHints(){switch(this.state.type){case 1:return this.state.hints;case 2:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return this.state.type===1||this.state.type===2||this.throttledDelayer.isTriggered()}onModelChanged(){this.cancel(),this.triggerChars.clear(),this.retriggerChars.clear();const e=this.editor.getModel();if(e)for(const t of this.providers.ordered(e)){for(const n of t.signatureHelpTriggerCharacters||[])if(n.length){const r=n.charCodeAt(0);this.triggerChars.add(r),this.retriggerChars.add(r)}for(const n of t.signatureHelpRetriggerCharacters||[])n.length&&this.retriggerChars.add(n.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const t=e.length-1,n=e.charCodeAt(t);(this.triggerChars.has(n)||this.isTriggered&&this.retriggerChars.has(n))&&this.trigger({triggerKind:Tf.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:Tf.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:Tf.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(86).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}}u5.DEFAULT_DELAY=120;function Jlt(i,e){switch(e.triggerKind){case Tf.Invoke:return e;case Tf.ContentChange:return i;case Tf.TriggerCharacter:default:return e}}var ect=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},U9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},UU;const Ul=He,tct=Mr("parameter-hints-next",Xe.chevronDown,w("parameterHintsNextIcon","Icon for show next parameter hint.")),nct=Mr("parameter-hints-previous",Xe.chevronUp,w("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let NO=UU=class extends fe{constructor(e,t,n,r,o){super(),this.editor=e,this.model=t,this.renderDisposeables=this._register(new Te),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new Uf({editor:e},o,r)),this.keyVisible=Zb.Visible.bindTo(n),this.keyMultipleSignatures=Zb.MultipleSignatures.bindTo(n)}createParameterHintDOMNodes(){const e=Ul(".editor-widget.parameter-hints-widget"),t=ke(e,Ul(".phwrapper"));t.tabIndex=-1;const n=ke(t,Ul(".controls")),r=ke(n,Ul(".button"+Wt.asCSSSelector(nct))),o=ke(n,Ul(".overloads")),s=ke(n,Ul(".button"+Wt.asCSSSelector(tct)));this._register(ye(r,"click",h=>{hn.stop(h),this.previous()})),this._register(ye(s,"click",h=>{hn.stop(h),this.next()}));const a=Ul(".body"),l=new Hk(a,{alwaysConsumeMouseWheel:!0});this._register(l),t.appendChild(l.getDomNode());const c=ke(a,Ul(".signature")),u=ke(a,Ul(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:c,overloads:o,docs:u,scrollbar:l},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(h=>{this.visible&&this.editor.layoutContentWidget(this)}));const d=()=>{if(!this.domNodes)return;const h=this.editor.getOption(50);this.domNodes.element.style.fontSize=`${h.fontSize}px`,this.domNodes.element.style.lineHeight=`${h.lineHeight/h.fontSize}`};d(),this._register(Je.chain(this.editor.onDidChangeConfiguration.bind(this.editor),h=>h.filter(f=>f.hasChanged(50)))(d)),this._register(this.editor.onDidLayoutChange(h=>this.updateMaxHeight())),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout(()=>{var e;(e=this.domNodes)===null||e===void 0||e.element.classList.add("visible")},100),this.editor.layoutContentWidget(this))}hide(){var e;this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,(e=this.domNodes)===null||e===void 0||e.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){var t;if(this.renderDisposeables.clear(),!this.domNodes)return;const n=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",n),this.keyMultipleSignatures.set(n),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const r=e.signatures[e.activeSignature];if(!r)return;const o=ke(this.domNodes.signature,Ul(".code")),s=this.editor.getOption(50);o.style.fontSize=`${s.fontSize}px`,o.style.fontFamily=s.fontFamily;const a=r.parameters.length>0,l=(t=r.activeParameter)!==null&&t!==void 0?t:e.activeParameter;if(a)this.renderParameters(o,r,l);else{const d=ke(o,Ul("span"));d.textContent=r.label}const c=r.parameters[l];if(c!=null&&c.documentation){const d=Ul("span.documentation");if(typeof c.documentation=="string")d.textContent=c.documentation;else{const h=this.renderMarkdownDocs(c.documentation);d.appendChild(h.element)}ke(this.domNodes.docs,Ul("p",{},d))}if(r.documentation!==void 0)if(typeof r.documentation=="string")ke(this.domNodes.docs,Ul("p",{},r.documentation));else{const d=this.renderMarkdownDocs(r.documentation);ke(this.domNodes.docs,d.element)}const u=this.hasDocs(r,c);if(this.domNodes.signature.classList.toggle("has-docs",u),this.domNodes.docs.classList.toggle("empty",!u),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,c){let d="";const h=r.parameters[l];Array.isArray(h.label)?d=r.label.substring(h.label[0],h.label[1]):d=h.label,h.documentation&&(d+=typeof h.documentation=="string"?`, ${h.documentation}`:`, ${h.documentation.value}`),r.documentation&&(d+=typeof r.documentation=="string"?`, ${r.documentation}`:`, ${r.documentation.value}`),this.announcedLabel!==d&&(kl(w("hint","{0}, hint",d)),this.announcedLabel=d)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=this.renderDisposeables.add(this.markdownRenderer.render(e,{asyncRenderCallback:()=>{var n;(n=this.domNodes)===null||n===void 0||n.scrollbar.scanDomNode()}}));return t.element.classList.add("markdown-docs"),t}hasDocs(e,t){return!!(t&&typeof t.documentation=="string"&&zm(t.documentation).length>0||t&&typeof t.documentation=="object"&&zm(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&zm(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&zm(e.documentation.value).length>0)}renderParameters(e,t,n){const[r,o]=this.getParameterLabelOffsets(t,n),s=document.createElement("span");s.textContent=t.label.substring(0,r);const a=document.createElement("span");a.textContent=t.label.substring(r,o),a.className="parameter active";const l=document.createElement("span");l.textContent=t.label.substring(o),ke(e,s,a,l)}getParameterLabelOffsets(e,t){const n=e.parameters[t];if(n){if(Array.isArray(n.label))return n.label;if(n.label.length){const r=new RegExp(`(\\W|^)${fc(n.label)}(?=\\W|$)`,"g");r.test(e.label);const o=r.lastIndex-n.label.length;return o>=0?[o,r.lastIndex]:[0,0]}else return[0,0]}else return[0,0]}next(){this.editor.focus(),this.model.next()}previous(){this.editor.focus(),this.model.previous()}getDomNode(){return this.domNodes||this.createParameterHintDOMNodes(),this.domNodes.element}getId(){return UU.ID}updateMaxHeight(){if(!this.domNodes)return;const t=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=t;const n=this.domNodes.element.getElementsByClassName("phwrapper");n.length&&(n[0].style.maxHeight=t)}};NO.ID="editor.widget.parameterHintsWidget";NO=UU=ect([U9(2,Vt),U9(3,al),U9(4,ji)],NO);X("editorHoverWidget.highlightForeground",{dark:Gu,light:Gu,hcDark:Gu,hcLight:Gu},w("editorHoverWidgetHighlightForeground","Foreground color of the active item in the parameter hint."));var ict=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Ele=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},jU;let Qb=jU=class extends fe{static get(e){return e.getContribution(jU.ID)}constructor(e,t,n){super(),this.editor=e,this.model=this._register(new u5(e,n.signatureHelpProvider)),this._register(this.model.onChangedHints(r=>{var o;r?(this.widget.value.show(),this.widget.value.render(r)):(o=this.widget.rawValue)===null||o===void 0||o.hide()})),this.widget=new Qf(()=>this._register(t.createInstance(NO,this.editor,this.model)))}cancel(){this.model.cancel()}previous(){var e;(e=this.widget.rawValue)===null||e===void 0||e.previous()}next(){var e;(e=this.widget.rawValue)===null||e===void 0||e.next()}trigger(e){this.model.trigger(e,0)}};Qb.ID="editor.controller.parameterHints";Qb=jU=ict([Ele(1,Ot),Ele(2,_t)],Qb);class rct extends gt{constructor(){super({id:"editor.action.triggerParameterHints",label:w("parameterHints.trigger.label","Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:j.hasSignatureHelpProvider,kbOpts:{kbExpr:j.editorTextFocus,primary:3082,weight:100}})}run(e,t){const n=Qb.get(t);n==null||n.trigger({triggerKind:Tf.Invoke})}}jn(Qb.ID,Qb,2);Be(rct);const dZ=100+75,hZ=Vo.bindToContribution(Qb.get);et(new hZ({id:"closeParameterHints",precondition:Zb.Visible,handler:i=>i.cancel(),kbOpts:{weight:dZ,kbExpr:j.focus,primary:9,secondary:[1033]}}));et(new hZ({id:"showPrevParameterHint",precondition:De.and(Zb.Visible,Zb.MultipleSignatures),handler:i=>i.previous(),kbOpts:{weight:dZ,kbExpr:j.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}}));et(new hZ({id:"showNextParameterHint",precondition:De.and(Zb.Visible,Zb.MultipleSignatures),handler:i=>i.next(),kbOpts:{weight:dZ,kbExpr:j.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));var oct=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},b2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const KS=new st("renameInputVisible",!1,w("renameInputVisible","Whether the rename input widget is visible")),KU=new st("renameInputFocused",!1,w("renameInputFocused","Whether the rename input widget is focused"));let GU=class{constructor(e,t,n,r,o,s){this._editor=e,this._acceptKeybindings=t,this._themeService=n,this._keybindingService=r,this._logService=s,this._disposables=new Te,this.allowEditorOverflow=!0,this._visibleContextKey=KS.bindTo(o),this._focusedContextKey=KU.bindTo(o),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{a.hasChanged(50)&&this._updateFont()})),this._disposables.add(n.onDidColorThemeChange(this._updateStyles,this))}dispose(){this._disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return"__renameInputWidget"}getDomNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="monaco-editor rename-box",this._input=document.createElement("input"),this._input.className="rename-input",this._input.type="text",this._input.setAttribute("aria-label",w("renameAriaLabel","Rename input. Type new name and press Enter to commit.")),this._disposables.add(ye(this._input,"focus",()=>{this._focusedContextKey.set(!0)})),this._disposables.add(ye(this._input,"blur",()=>{this._focusedContextKey.reset()})),this._domNode.appendChild(this._input),this._candidatesView=this._disposables.add(new sct(this._domNode,{fontInfo:this._editor.getOption(50),onSelectionChange:()=>this.acceptInput(!1)})),this._label=document.createElement("div"),this._label.className="rename-label",this._domNode.appendChild(this._label),this._updateFont(),this._updateStyles(this._themeService.getColorTheme())),this._domNode}_updateStyles(e){var t,n,r,o;if(!this._input||!this._domNode)return;const s=e.getColor(Yg),a=e.getColor(Qme);this._domNode.style.backgroundColor=String((t=e.getColor(Nr))!==null&&t!==void 0?t:""),this._domNode.style.boxShadow=s?` 0 0 8px 2px ${s}`:"",this._domNode.style.border=a?`1px solid ${a}`:"",this._domNode.style.color=String((n=e.getColor(eve))!==null&&n!==void 0?n:""),this._input.style.backgroundColor=String((r=e.getColor(Jme))!==null&&r!==void 0?r:"");const l=e.getColor(tve);this._input.style.borderWidth=l?"1px":"0px",this._input.style.borderStyle=l?"solid":"none",this._input.style.borderColor=(o=l==null?void 0:l.toString())!==null&&o!==void 0?o:"none"}_updateFont(){if(!this._input||!this._label||!this._candidatesView)return;const e=this._editor.getOption(50);this._input.style.fontFamily=e.fontFamily,this._input.style.fontWeight=e.fontWeight,this._input.style.fontSize=`${e.fontSize}px`,this._candidatesView.updateFont(e),this._label.style.fontSize=`${this._computeLabelFontSize(e.fontSize)}px`}_computeLabelFontSize(e){return e*.8}getPosition(){if(!this._visible||!this._editor.hasModel()||!this._editor.getDomNode())return null;const e=Tp(this.getDomNode().ownerDocument.body),t=Br(this._editor.getDomNode()),n=this._getTopForPosition();this._nPxAvailableAbove=n+t.top,this._nPxAvailableBelow=e.height-this._nPxAvailableAbove;const r=this._editor.getOption(67),{totalHeight:o}=Jb.getLayoutInfo({lineHeight:r}),s=this._nPxAvailableBelow>o*6?[2,1]:[1,2];return{position:this._position,preference:s}}beforeRender(){var e,t;const[n,r]=this._acceptKeybindings;return this._label.innerText=w({key:"label",comment:['placeholders are keybindings, e.g "F2 to Rename, Shift+F2 to Preview"']},"{0} to Rename, {1} to Preview",(e=this._keybindingService.lookupKeybinding(n))===null||e===void 0?void 0:e.getLabel(),(t=this._keybindingService.lookupKeybinding(r))===null||t===void 0?void 0:t.getLabel()),this._domNode.style.minWidth="200px",null}afterRender(e){if(this._trace("invoking afterRender, position: ",e?"not null":"null"),e===null){this.cancelInput(!0,"afterRender (because position is null)");return}if(!this._editor.hasModel()||!this._editor.getDomNode())return;Xn(this._candidatesView),Xn(this._nPxAvailableAbove!==void 0),Xn(this._nPxAvailableBelow!==void 0);const t=qg(this._input),n=qg(this._label);let r;e===2?r=this._nPxAvailableBelow:r=this._nPxAvailableAbove,this._candidatesView.layout({height:r-n-t,width:ua(this._input)})}acceptInput(e){var t;this._trace("invoking acceptInput"),(t=this._currentAcceptInput)===null||t===void 0||t.call(this,e)}cancelInput(e,t){var n;this._trace(`invoking cancelInput, caller: ${t}, _currentCancelInput: ${this._currentAcceptInput?"not undefined":"undefined"}`),(n=this._currentCancelInput)===null||n===void 0||n.call(this,e)}focusNextRenameSuggestion(){var e;(e=this._candidatesView)===null||e===void 0||e.focusNext()}focusPreviousRenameSuggestion(){var e;!((e=this._candidatesView)===null||e===void 0)&&e.focusPrevious()||this._input.focus()}getInput(e,t,n,r,o,s,a){this._domNode.classList.toggle("preview",o),this._position=new ae(e.startLineNumber,e.startColumn),this._input.value=t,this._input.setAttribute("selectionStart",n.toString()),this._input.setAttribute("selectionEnd",r.toString()),this._input.size=Math.max((e.endColumn-e.startColumn)*1.1,20);const l=new Te;return l.add(Rt(()=>a.dispose(!0))),this._updateRenameCandidates(s,t,a.token),new Promise(c=>{this._currentCancelInput=u=>{var d;return this._trace("invoking _currentCancelInput"),this._currentAcceptInput=void 0,this._currentCancelInput=void 0,(d=this._candidatesView)===null||d===void 0||d.clearCandidates(),c(u),!0},this._currentAcceptInput=u=>{this._trace("invoking _currentAcceptInput"),Xn(this._input!==void 0),Xn(this._candidatesView!==void 0);const d=this._candidatesView.nCandidates;let h,f;const g=this._candidatesView.focusedCandidate;if(g!==void 0?(this._trace("using new name from renameSuggestion"),h=g,f="renameSuggestion"):(this._trace("using new name from inputField"),h=this._input.value,f="inputField"),h===t||h.trim().length===0){this.cancelInput(!0,"_currentAcceptInput (because newName === value || newName.trim().length === 0)");return}this._currentAcceptInput=void 0,this._currentCancelInput=void 0,this._candidatesView.clearCandidates(),c({newName:h,wantsPreview:o&&u,source:f,nRenameSuggestions:d})},l.add(a.token.onCancellationRequested(()=>this.cancelInput(!0,"cts.token.onCancellationRequested"))),l.add(this._editor.onDidBlurEditorWidget(()=>{var u;return this.cancelInput(!(!((u=this._domNode)===null||u===void 0)&&u.ownerDocument.hasFocus()),"editor.onDidBlurEditorWidget")})),this._show()}).finally(()=>{l.dispose(),this._hide()})}_show(){this._trace("invoking _show"),this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,0),this._visible=!0,this._visibleContextKey.set(!0),this._editor.layoutContentWidget(this),setTimeout(()=>{this._input.focus(),this._input.setSelectionRange(parseInt(this._input.getAttribute("selectionStart")),parseInt(this._input.getAttribute("selectionEnd")))},100)}async _updateRenameCandidates(e,t,n){const r=(...c)=>this._trace("_updateRenameCandidates",...c);r("start");const o=await Rk(Promise.allSettled(e),n);if(o===void 0){r("returning early - received updateRenameCandidates results - undefined");return}const s=o.flatMap(c=>c.status==="fulfilled"&&kf(c.value)?c.value:[]);r(`received updateRenameCandidates results - total (unfiltered) ${s.length} candidates.`);const a=Ep(s,c=>c.newSymbolName);r(`distinct candidates - ${a.length} candidates.`);const l=a.filter(({newSymbolName:c})=>{var u;return c.trim().length>0&&c!==((u=this._input)===null||u===void 0?void 0:u.value)&&c!==t});if(r(`valid distinct candidates - ${s.length} candidates.`),l.length<1){r("returning early - no valid distinct candidates");return}r("setting candidates"),this._candidatesView.setCandidates(l),r("asking editor to re-layout"),this._editor.layoutContentWidget(this)}_hide(){this._trace("invoked _hide"),this._visible=!1,this._visibleContextKey.reset(),this._editor.layoutContentWidget(this)}_getTopForPosition(){const e=this._editor.getVisibleRanges();let t;return e.length>0?t=e[0].startLineNumber:(this._logService.warn("RenameInputField#_getTopForPosition: this should not happen - visibleRanges is empty"),t=Math.max(1,this._position.lineNumber-5)),this._editor.getTopForLineNumber(this._position.lineNumber)-this._editor.getTopForLineNumber(t)}_trace(...e){this._logService.trace("RenameInputField",...e)}};GU=oct([b2(2,To),b2(3,ci),b2(4,Vt),b2(5,Ta)],GU);class sct{constructor(e,t){this._disposables=new Te,this._availableHeight=0,this._minimumWidth=0,this._lineHeight=t.fontInfo.lineHeight,this._typicalHalfwidthCharacterWidth=t.fontInfo.typicalHalfwidthCharacterWidth,this._listContainer=document.createElement("div"),this._listContainer.style.fontFamily=t.fontInfo.fontFamily,this._listContainer.style.fontWeight=t.fontInfo.fontWeight,this._listContainer.style.fontSize=`${t.fontInfo.fontSize}px`,e.appendChild(this._listContainer);const n=this,r=new class{getTemplateId(s){return"candidate"}getHeight(s){return n._candidateViewHeight}},o=new class{constructor(){this.templateId="candidate"}renderTemplate(s){return new Jb(s,{lineHeight:n._lineHeight})}renderElement(s,a,l){l.model=s}disposeTemplate(s){s.dispose()}};this._listWidget=new wc("NewSymbolNameCandidates",this._listContainer,r,[o],{keyboardSupport:!1,mouseSupport:!0,multipleSelectionSupport:!1}),this._disposables.add(this._listWidget.onDidChangeSelection(s=>{s.elements.length>0&&t.onSelectionChange()})),this._disposables.add(this._listWidget.onDidBlur(s=>{this._listWidget.setFocus([])})),this._listWidget.style(N_)}dispose(){this._listWidget.dispose(),this._disposables.dispose()}layout({height:e,width:t}){this._availableHeight=e,this._minimumWidth=t}setCandidates(e){this._listWidget.splice(0,0,e);const t=this._pickListHeight(e.length),n=this._pickListWidth(e);this._listWidget.layout(t,n),this._listContainer.style.height=`${t}px`,this._listContainer.style.width=`${n}px`,Hf(w("renameSuggestionsReceivedAria","Received {0} rename suggestions",e.length))}clearCandidates(){this._listContainer.style.height="0px",this._listContainer.style.width="0px",this._listWidget.splice(0,this._listWidget.length,[])}get nCandidates(){return this._listWidget.length}get focusedCandidate(){if(this._listWidget.length===0)return;const e=this._listWidget.getSelectedElements()[0];if(e!==void 0)return e.newSymbolName;const t=this._listWidget.getFocusedElements()[0];if(t!==void 0)return t.newSymbolName}updateFont(e){this._listContainer.style.fontFamily=e.fontFamily,this._listContainer.style.fontWeight=e.fontWeight,this._listContainer.style.fontSize=`${e.fontSize}px`,this._lineHeight=e.lineHeight,this._listWidget.rerender()}focusNext(){this._listWidget.length!==0&&(this._listWidget.isDOMFocused()?this._listWidget.focusNext():(this._listWidget.domFocus(),this._listWidget.focusFirst()),this._listWidget.reveal(this._listWidget.getFocus()[0]))}focusPrevious(){if(this._listWidget.length===0)return!1;this._listWidget.domFocus();const e=this._listWidget.getFocus()[0];return e!==0&&(this._listWidget.focusPrevious(),this._listWidget.reveal(this._listWidget.getFocus()[0])),e>0}get _candidateViewHeight(){const{totalHeight:e}=Jb.getLayoutInfo({lineHeight:this._lineHeight});return e}_pickListHeight(e){const t=this._candidateViewHeight*e,n=7;return Math.min(t,this._availableHeight,this._candidateViewHeight*n)}_pickListWidth(e){const t=Math.ceil(Math.max(...e.map(r=>r.newSymbolName.length))*this._typicalHalfwidthCharacterWidth);return Math.max(this._minimumWidth,4+16+5+t+10)}}class Jb{constructor(e,{lineHeight:t}){this.domNode=document.createElement("div"),this.domNode.style.display="flex",this.domNode.style.alignItems="center",this.domNode.style.height=`${t}px`,this.domNode.style.padding=`${Jb._PADDING}px`,this._icon=document.createElement("div"),this._icon.style.display="flex",this._icon.style.alignItems="center",this._icon.style.width=this._icon.style.height=`${t*.8}px`,this.domNode.appendChild(this._icon),this._label=document.createElement("div"),this._icon.style.display="flex",this._icon.style.alignItems="center",this._label.style.marginLeft="5px",this.domNode.appendChild(this._label),e.appendChild(this.domNode)}set model(e){this._icon.children.length===0&&this._icon.appendChild(nI(Xe.sparkle)),this._label.innerText=e.newSymbolName}static getLayoutInfo({lineHeight:e}){return{totalHeight:e+Jb._PADDING*2}}dispose(){}}Jb._PADDING=2;var act=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},dm=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},qU;class fZ{constructor(e,t,n){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=n.ordered(e)}hasProvider(){return this._providers.length>0}async resolveRenameLocation(e){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx0?t.join(` `):void 0}:{range:B.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join(` `):void 0}}async provideRenameEdits(e,t){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)}async _provideRenameEdits(e,t,n,r){const o=this._providers[t];if(!o)return{edits:[],rejectReason:n.join(` -`)};const s=await o.provideRenameEdits(this.model,this.position,e,r);if(s){if(s.rejectReason)return this._provideRenameEdits(e,t+1,n.concat(s.rejectReason),r)}else return this._provideRenameEdits(e,t+1,n.concat(w("no result","No result.")),r);return s}}async function lct(i,e,t,n){const r=new fZ(e,t,i),o=await r.resolveRenameLocation(Cn.None);return o!=null&&o.rejectReason?{edits:[],rejectReason:o.rejectReason}:r.provideRenameEdits(n,Cn.None)}let Rp=qU=class{static get(e){return e.getContribution(qU.ID)}constructor(e,t,n,r,o,s,a,l,c){this.editor=e,this._instaService=t,this._notificationService=n,this._bulkEditService=r,this._progressService=o,this._logService=s,this._configService=a,this._languageFeaturesService=l,this._telemetryService=c,this._disposableStore=new Te,this._cts=new wr,this._renameInputField=this._disposableStore.add(this._instaService.createInstance(GU,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){var e,t;const n=this._logService.trace.bind(this._logService,"[rename]");if(this._cts.dispose(!0),this._cts=new wr,!this.editor.hasModel()){n("editor has no model");return}const r=this.editor.getPosition(),o=new fZ(this.editor.getModel(),r,this._languageFeaturesService.renameProvider);if(!o.hasProvider()){n("skeleton has no provider");return}const s=new i_(this.editor,5,void 0,this._cts.token);let a;try{n("resolving rename location");const y=o.resolveRenameLocation(s.token);this._progressService.showWhile(y,250),a=await y,n("resolved rename location")}catch(y){n("resolve rename location failed",JSON.stringify(y,null," ")),(e=xa.get(this.editor))===null||e===void 0||e.showMessage(y||w("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),r);return}finally{s.dispose()}if(!a){n("returning early - no loc");return}if(a.rejectReason){n(`returning early - rejected with reason: ${a.rejectReason}`,a.rejectReason),(t=xa.get(this.editor))===null||t===void 0||t.showMessage(a.rejectReason,r);return}if(s.token.isCancellationRequested){n("returning early - cts1 cancelled");return}const l=new i_(this.editor,5,a.range,this._cts.token),c=this.editor.getModel(),u=new wr(l.token),d=this._languageFeaturesService.newSymbolNamesProvider.all(c),h=d.map(y=>y.provideNewSymbolNames(c,a.range,u.token));n(`requested new symbol names from ${d.length} providers`);const f=this.editor.getSelection();let g=0,p=a.text.length;!B.isEmpty(f)&&!B.spansMultipleLines(f)&&B.containsRange(a.range,f)&&(g=Math.max(0,f.startColumn-a.range.startColumn),p=Math.min(a.range.endColumn,f.endColumn)-a.range.startColumn),n("creating rename input field and awaiting its result");const v=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),m=await this._renameInputField.getInput(a.range,a.text,g,p,v,h,u);if(n("received response from rename input field"),d.length>0&&this._reportTelemetry(d.length,c.getLanguageId(),m),typeof m=="boolean"){n(`returning early - rename input field response - ${m}`),m&&this.editor.focus(),l.dispose();return}this.editor.focus(),n("requesting rename edits");const _=Rk(o.provideRenameEdits(m.newName,l.token),l.token).then(async y=>{if(!y){n("returning early - no rename edits result");return}if(!this.editor.hasModel()){n("returning early - no model after rename edits are provided");return}if(y.rejectReason){n(`returning early - rejected with reason: ${y.rejectReason}`),this._notificationService.info(y.rejectReason);return}this.editor.setSelection(B.fromPositions(this.editor.getSelection().getPosition())),n("applying edits"),this._bulkEditService.apply(y,{editor:this.editor,showPreview:m.wantsPreview,label:w("label","Renaming '{0}' to '{1}'",a==null?void 0:a.text,m.newName),code:"undoredo.rename",quotableLabel:w("quotableLabel","Renaming {0} to {1}",a==null?void 0:a.text,m.newName),respectAutoSaveConfig:!0}).then(S=>{n("edits applied"),S.ariaSummary&&kl(w("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",a.text,m.newName,S.ariaSummary))}).catch(S=>{n(`error when applying edits ${JSON.stringify(S,null," ")}`),this._notificationService.error(w("rename.failedApply","Rename failed to apply edits")),this._logService.error(S)})},y=>{n("error when providing rename edits",JSON.stringify(y,null," ")),this._notificationService.error(w("rename.failed","Rename failed to compute edits")),this._logService.error(y)}).finally(()=>{l.dispose()});return n("returning rename operation"),this._progressService.showWhile(_,250),_}acceptRenameInput(e){this._renameInputField.acceptInput(e)}cancelRenameInput(){this._renameInputField.cancelInput(!0,"cancelRenameInput command")}focusNextRenameSuggestion(){this._renameInputField.focusNextRenameSuggestion()}focusPreviousRenameSuggestion(){this._renameInputField.focusPreviousRenameSuggestion()}_reportTelemetry(e,t,n){const r=typeof n=="boolean"?{kind:"cancelled",languageId:t,nRenameSuggestionProviders:e}:{kind:"accepted",languageId:t,nRenameSuggestionProviders:e,source:n.source,nRenameSuggestions:n.nRenameSuggestions,wantsPreview:n.wantsPreview};this._telemetryService.publicLog2("renameInvokedEvent",r)}};Rp.ID="editor.contrib.renameController";Rp=qU=act([um(1,Ot),um(2,$r),um(3,Xk),um(4,T_),um(5,Ta),um(6,Hq),um(7,_t),um(8,ea)],Rp);class cct extends gt{constructor(){super({id:"editor.action.rename",label:w("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:De.and(j.writable,j.hasRenameProvider),kbOpts:{kbExpr:j.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const n=e.get(Un),[r,o]=Array.isArray(t)&&t||[void 0,void 0];return At.isUri(r)&&ae.isIPosition(o)?n.openCodeEditor({resource:r},n.getActiveCodeEditor()).then(s=>{s&&(s.setPosition(o),s.invokeWithinContext(a=>(this.reportTelemetry(a,s),this.run(a,s))))},en):super.runCommand(e,t)}run(e,t){const n=e.get(Ta),r=Rp.get(t);return r?(n.trace("[RenameAction] got controller, running..."),r.run()):(n.trace("[RenameAction] returning early - controller missing"),Promise.resolve())}}jn(Rp.ID,Rp,4);Be(cct);const gZ=Vo.bindToContribution(Rp.get);et(new gZ({id:"acceptRenameInput",precondition:KS,handler:i=>i.acceptRenameInput(!1),kbOpts:{weight:100+99,kbExpr:De.and(j.focus,De.not("isComposing")),primary:3}}));et(new gZ({id:"acceptRenameInputWithPreview",precondition:De.and(KS,De.has("config.editor.rename.enablePreview")),handler:i=>i.acceptRenameInput(!0),kbOpts:{weight:100+99,kbExpr:De.and(j.focus,De.not("isComposing")),primary:1024+3}}));et(new gZ({id:"cancelRenameInput",precondition:KS,handler:i=>i.cancelRenameInput(),kbOpts:{weight:100+99,kbExpr:j.focus,primary:9,secondary:[1033]}}));Ei(class extends sl{constructor(){super({id:"focusNextRenameSuggestion",title:{...$n("focusNextRenameSuggestion","Focus Next Rename Suggestion")},precondition:KS,keybinding:[{primary:2,secondary:[18],weight:100+99}]})}run(e){const t=e.get(Un).getFocusedCodeEditor();if(!t)return;const n=Rp.get(t);n&&n.focusNextRenameSuggestion()}});Ei(class extends sl{constructor(){super({id:"focusPreviousRenameSuggestion",title:{...$n("focusPreviousRenameSuggestion","Focus Previous Rename Suggestion")},precondition:KS,keybinding:[{when:KU,primary:6,weight:100+99},{when:KU.toNegated(),primary:1026,secondary:[16],weight:100+99}]})}run(e){const t=e.get(Un).getFocusedCodeEditor();if(!t)return;const n=Rp.get(t);n&&n.focusPreviousRenameSuggestion()}});tg("_executeDocumentRenameProvider",function(i,e,t,...n){const[r]=n;Xn(typeof r=="string");const{renameProvider:o}=i.get(_t);return lct(o,e,t,r)});tg("_executePrepareRename",async function(i,e,t){const{renameProvider:n}=i.get(_t),o=await new fZ(e,t,n).resolveRenameLocation(Cn.None);if(o!=null&&o.rejectReason)throw new Error(o.rejectReason);return o});ar.as(xh.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:w("enablePreview","Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});function uct(i){for(let e=0,t=i.length;e0?t[0]:[]}async function K1e(i,e,t,n,r){const o=gct(i,e),s=await Promise.all(o.map(async a=>{let l,c=null;try{l=await a.provideDocumentSemanticTokens(e,a===t?n:null,r)}catch(u){c=u,l=null}return(!l||!d5(l)&&!U1e(l))&&(l=null),new fct(a,l,c)}));for(const a of s){if(a.error)throw a.error;if(a.tokens)return a}return s.length>0?s[0]:null}function pct(i,e){const t=i.orderedGroups(e);return t.length>0?t[0]:null}class mct{constructor(e,t){this.provider=e,this.tokens=t}}function vct(i,e){return i.has(e)}function G1e(i,e){const t=i.orderedGroups(e);return t.length>0?t[0]:[]}async function pZ(i,e,t,n){const r=G1e(i,e),o=await Promise.all(r.map(async s=>{let a;try{a=await s.provideDocumentRangeSemanticTokens(e,t,n)}catch(l){Zr(l),a=null}return(!a||!d5(a))&&(a=null),new mct(s,a)}));for(const s of o)if(s.tokens)return s;return o.length>0?o[0]:null}Dn.registerCommand("_provideDocumentSemanticTokensLegend",async(i,...e)=>{const[t]=e;Xn(t instanceof At);const n=i.get(tr).getModel(t);if(!n)return;const{documentSemanticTokensProvider:r}=i.get(_t),o=pct(r,n);return o?o[0].getLegend():i.get(sr).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)});Dn.registerCommand("_provideDocumentSemanticTokens",async(i,...e)=>{const[t]=e;Xn(t instanceof At);const n=i.get(tr).getModel(t);if(!n)return;const{documentSemanticTokensProvider:r}=i.get(_t);if(!j1e(r,n))return i.get(sr).executeCommand("_provideDocumentRangeSemanticTokens",t,n.getFullModelRange());const o=await K1e(r,n,null,null,Cn.None);if(!o)return;const{provider:s,tokens:a}=o;if(!a||!d5(a))return;const l=z1e({id:0,type:"full",data:a.data});return a.resultId&&s.releaseDocumentSemanticTokens(a.resultId),l});Dn.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(i,...e)=>{const[t,n]=e;Xn(t instanceof At);const r=i.get(tr).getModel(t);if(!r)return;const{documentRangeSemanticTokensProvider:o}=i.get(_t),s=G1e(o,r);if(s.length===0)return;if(s.length===1)return s[0].getLegend();if(!n||!B.isIRange(n))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),s[0].getLegend();const a=await pZ(o,r,B.lift(n),Cn.None);if(a)return a.provider.getLegend()});Dn.registerCommand("_provideDocumentRangeSemanticTokens",async(i,...e)=>{const[t,n]=e;Xn(t instanceof At),Xn(B.isIRange(n));const r=i.get(tr).getModel(t);if(!r)return;const{documentRangeSemanticTokensProvider:o}=i.get(_t),s=await pZ(o,r,B.lift(n),Cn.None);if(!(!s||!s.tokens))return z1e({id:0,type:"full",data:s.tokens.data})});const mZ="editor.semanticHighlighting";function UM(i,e,t){var n;const r=(n=t.getValue(mZ,{overrideIdentifier:i.getLanguageId(),resource:i.uri}))===null||n===void 0?void 0:n.enabled;return typeof r=="boolean"?r:e.getColorTheme().semanticHighlighting}var q1e=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},af=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},wm;let XU=class extends fe{constructor(e,t,n,r,o,s){super(),this._watchers=Object.create(null);const a=u=>{this._watchers[u.uri.toString()]=new GI(u,e,n,o,s)},l=(u,d)=>{d.dispose(),delete this._watchers[u.uri.toString()]},c=()=>{for(const u of t.getModels()){const d=this._watchers[u.uri.toString()];UM(u,n,r)?d||a(u):d&&l(u,d)}};t.getModels().forEach(u=>{UM(u,n,r)&&a(u)}),this._register(t.onModelAdded(u=>{UM(u,n,r)&&a(u)})),this._register(t.onModelRemoved(u=>{const d=this._watchers[u.uri.toString()];d&&l(u,d)})),this._register(r.onDidChangeConfiguration(u=>{u.affectsConfiguration(mZ)&&c()})),this._register(n.onDidColorThemeChange(c))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};XU=q1e([af(0,K4),af(1,tr),af(2,To),af(3,gn),af(4,gu),af(5,_t)],XU);let GI=wm=class extends fe{constructor(e,t,n,r,o){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=o.documentSemanticTokensProvider,this._debounceInformation=r.for(this._provider,"DocumentSemanticTokens",{min:wm.REQUEST_MIN_DELAY,max:wm.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new pi(()=>this._fetchDocumentSemanticTokensNow(),wm.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._providersChangedDuringRequest=!1,this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeAttached(()=>{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 s=()=>{si(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const a of this._provider.all(e))typeof a.onDidChange=="function"&&this._documentProvidersChangeListeners.push(a.onDidChange(()=>{if(this._currentDocumentRequestCancellationTokenSource){this._providersChangedDuringRequest=!0;return}this._fetchDocumentSemanticTokens.schedule(0)}))};s(),this._register(this._provider.onDidChange(()=>{s(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(n.onDidColorThemeChange(a=>{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),si(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!j1e(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new wr,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,n=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,r=K1e(this._provider,this._model,t,n,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const o=[],s=this._model.onDidChangeContent(l=>{o.push(l)}),a=new Ms(!1);r.then(l=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),!l)this._setDocumentSemanticTokens(null,null,null,o);else{const{provider:c,tokens:u}=l,d=this._semanticTokensStylingService.getStyling(c);this._setDocumentSemanticTokens(c,u||null,d,o)}},l=>{l&&(wh(l)||typeof l.message=="string"&&l.message.indexOf("busy")!==-1)||en(l),this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),(o.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,n,r,o){o=Math.min(o,n.length-r,e.length-t);for(let s=0;s{(r.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed){e&&t&&e.releaseDocumentSemanticTokens(t.resultId);return}if(!e||!n){this._model.tokenization.setSemanticTokens(null,!1);return}if(!t){this._model.tokenization.setSemanticTokens(null,!0),s();return}if(U1e(t)){if(!o){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:o.data};else{let a=0;for(const h of t.edits)a+=(h.data?h.data.length:0)-h.deleteCount;const l=o.data,c=new Uint32Array(l.length+a);let u=l.length,d=c.length;for(let h=t.edits.length-1;h>=0;h--){const f=t.edits[h];if(f.start>l.length){n.warnInvalidEditStart(o.resultId,t.resultId,h,f.start,l.length),this._model.tokenization.setSemanticTokens(null,!0);return}const g=u-(f.start+f.deleteCount);g>0&&(wm._copy(l,u-g,c,d-g,g),d-=g),f.data&&(wm._copy(f.data,0,c,d-f.data.length,f.data.length),d-=f.data.length),u=f.start}u>0&&wm._copy(l,0,c,0,u),t={resultId:t.resultId,data:c}}}if(d5(t)){this._currentDocumentResponse=new _ct(e,t.resultId,t.data);const a=m_e(t,n,this._model.getLanguageId());if(r.length>0)for(const l of r)for(const c of a)for(const u of l.changes)c.applyEdit(u.range,u.text);this._model.tokenization.setSemanticTokens(a,!0)}else this._model.tokenization.setSemanticTokens(null,!0);s()}};GI.REQUEST_MIN_DELAY=300;GI.REQUEST_MAX_DELAY=2e3;GI=wm=q1e([af(1,K4),af(2,To),af(3,gu),af(4,_t)],GI);class _ct{constructor(e,t,n){this.provider=e,this.resultId=t,this.data=n}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}nT(XU);var bct=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},rL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let qI=class extends fe{constructor(e,t,n,r,o,s){super(),this._semanticTokensStylingService=t,this._themeService=n,this._configurationService=r,this._editor=e,this._provider=s.documentRangeSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new pi(()=>this._tokenizeViewportNow(),100)),this._outstandingRequests=[];const a=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))};this._register(this._editor.onDidScrollChange(()=>{a()})),this._register(this._editor.onDidChangeModel(()=>{this._cancelAll(),a()})),this._register(this._editor.onDidChangeModelContent(l=>{this._cancelAll(),a()})),this._register(this._provider.onDidChange(()=>{this._cancelAll(),a()})),this._register(this._configurationService.onDidChangeConfiguration(l=>{l.affectsConfiguration(mZ)&&(this._cancelAll(),a())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),a()})),a()}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,n=this._outstandingRequests.length;tthis._requestRange(e,n)))}_requestRange(e,t){const n=e.getVersionId(),r=Io(s=>Promise.resolve(pZ(this._provider,e,t,s))),o=new Ms(!1);return r.then(s=>{if(this._debounceInformation.update(e,o.elapsed()),!s||!s.tokens||e.isDisposed()||e.getVersionId()!==n)return;const{provider:a,tokens:l}=s,c=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,m_e(l,c,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(r),()=>this._removeOutstandingRequest(r)),r}};qI.ID="editor.contrib.viewportSemanticTokens";qI=bct([rL(1,K4),rL(2,To),rL(3,gn),rL(4,gu),rL(5,_t)],qI);jn(qI.ID,qI,1);class Cct{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const n=[];for(const r of t){const o=[];n.push(o),this.selectSubwords&&this._addInWordRanges(o,e,r),this._addWordRanges(o,e,r),this._addWhitespaceLine(o,e,r),o.push({range:e.getFullModelRange()})}return n}_addInWordRanges(e,t,n){const r=t.getWordAtPosition(n);if(!r)return;const{word:o,startColumn:s}=r,a=n.column-s;let l=a,c=a,u=0;for(;l>=0;l--){const d=o.charCodeAt(l);if(l!==a&&(d===95||d===45))break;if(zm(d)&&nf(u))break;u=d}for(l+=1;c0&&t.getLineFirstNonWhitespaceColumn(n.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(n.lineNumber)===0&&e.push({range:new B(n.lineNumber,1,n.lineNumber,t.getLineMaxColumn(n.lineNumber))})}}var yct=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},wct=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},YU;class vZ{constructor(e,t){this.index=e,this.ranges=t}mov(e){const t=this.index+(e?1:-1);if(t<0||t>=this.ranges.length)return this;const n=new vZ(t,this.ranges);return n.ranges[t].equalsRange(this.ranges[this.index])?n.mov(e):n}}let aS=YU=class{static get(e){return e.getContribution(YU.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){var e;(e=this._selectionListener)===null||e===void 0||e.dispose()}async run(e){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),n=this._editor.getModel();if(this._state||await Y1e(this._languageFeaturesService.selectionRangeProvider,n,t.map(o=>o.getPosition()),this._editor.getOption(113),Cn.None).then(o=>{var s;if(!(!Ts(o)||o.length!==t.length)&&!(!this._editor.hasModel()||!or(this._editor.getSelections(),t,(a,l)=>a.equalsSelection(l)))){for(let a=0;al.containsPosition(t[a].getStartPosition())&&l.containsPosition(t[a].getEndPosition())),o[a].unshift(t[a]);this._state=o.map(a=>new vZ(0,a)),(s=this._selectionListener)===null||s===void 0||s.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{var a;this._ignoreSelection||((a=this._selectionListener)===null||a===void 0||a.dispose(),this._state=void 0)})}}),!this._state)return;this._state=this._state.map(o=>o.mov(e));const r=this._state.map(o=>yt.fromPositions(o.ranges[o.index].getStartPosition(),o.ranges[o.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(r)}finally{this._ignoreSelection=!1}}};aS.ID="editor.contrib.smartSelectController";aS=YU=yct([wct(1,_t)],aS);class X1e extends gt{constructor(e,t){super(t),this._forward=e}async run(e,t){const n=aS.get(t);n&&await n.run(this._forward)}}class Sct extends X1e{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:w("smartSelect.expand","Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:j.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:$.MenubarSelectionMenu,group:"1_basic",title:w({key:"miSmartSelectGrow",comment:["&& denotes a mnemonic"]},"&&Expand Selection"),order:2}})}}Dn.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class xct extends X1e{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:w("smartSelect.shrink","Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:j.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:$.MenubarSelectionMenu,group:"1_basic",title:w({key:"miSmartSelectShrink",comment:["&& denotes a mnemonic"]},"&&Shrink Selection"),order:3}})}}jn(aS.ID,aS,4);Be(Sct);Be(xct);async function Y1e(i,e,t,n,r){const o=i.all(e).concat(new Cct(n.selectSubwords));o.length===1&&o.unshift(new Xl);const s=[],a=[];for(const l of o)s.push(Promise.resolve(l.provideSelectionRanges(e,t,r)).then(c=>{if(Ts(c)&&c.length===t.length)for(let u=0;u{if(l.length===0)return[];l.sort((h,f)=>ae.isBefore(h.getStartPosition(),f.getStartPosition())?1:ae.isBefore(f.getStartPosition(),h.getStartPosition())||ae.isBefore(h.getEndPosition(),f.getEndPosition())?-1:ae.isBefore(f.getEndPosition(),h.getEndPosition())?1:0);const c=[];let u;for(const h of l)(!u||B.containsRange(h,u)&&!B.equalsRange(h,u))&&(c.push(h),u=h);if(!n.selectLeadingAndTrailingWhitespace)return c;const d=[c[0]];for(let h=1;hi}),j9="data-sticky-line-index",kle="data-sticky-is-line",Ect="data-sticky-is-line-number",Tle="data-sticky-is-folding-icon";class Dct extends fe{constructor(e){super(),this._editor=e,this._foldingIconStore=new Te,this._rootDomNode=document.createElement("div"),this._lineNumbersDomNode=document.createElement("div"),this._linesDomNodeScrollable=document.createElement("div"),this._linesDomNode=document.createElement("div"),this._lineHeight=this._editor.getOption(67),this._renderedStickyLines=[],this._lineNumbers=[],this._lastLineRelativePosition=0,this._minContentWidthInPx=0,this._isOnGlyphMargin=!1,this._lineNumbersDomNode.className="sticky-widget-line-numbers",this._lineNumbersDomNode.setAttribute("role","none"),this._linesDomNode.className="sticky-widget-lines",this._linesDomNode.setAttribute("role","list"),this._linesDomNodeScrollable.className="sticky-widget-lines-scrollable",this._linesDomNodeScrollable.appendChild(this._linesDomNode),this._rootDomNode.className="sticky-widget",this._rootDomNode.classList.toggle("peek",e instanceof s_),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(115).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(115)&&t(),n.hasChanged(67)&&(this._lineHeight=this._editor.getOption(67))})),this._register(this._editor.onDidScrollChange(n=>{n.scrollLeftChanged&&t(),n.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{t(),this._updateWidgetWidth()})),this._register(this._foldingIconStore),t(),this._register(this._editor.onDidLayoutChange(n=>{this._updateWidgetWidth()})),this._updateWidgetWidth()}get lineNumbers(){return this._lineNumbers}get lineNumberCount(){return this._lineNumbers.length}getRenderedStickyLine(e){return this._renderedStickyLines.find(t=>t.lineNumber===e)}getCurrentLines(){return this._lineNumbers}setState(e,t,n){if(n===void 0&&(!this._previousState&&!e||this._previousState&&this._previousState.equals(e)))return;const r=this._isWidgetHeightZero(e),o=r?void 0:e,s=r?0:this._findLineToRebuildWidgetFrom(e,n);this._renderRootNode(o,t,s),this._previousState=e}_isWidgetHeightZero(e){if(!e)return!0;const t=e.startLineNumbers.length*this._lineHeight+e.lastLineRelativePosition;if(t>0){this._lastLineRelativePosition=e.lastLineRelativePosition;const n=[...e.startLineNumbers];e.showEndForLine!==null&&(n[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=n}else this._lastLineRelativePosition=0,this._lineNumbers=[];return t===0}_findLineToRebuildWidgetFrom(e,t){if(!e||!this._previousState)return 0;if(t!==void 0)return t;const n=this._previousState,r=e.startLineNumbers.findIndex(o=>!n.startLineNumbers.includes(o));return r===-1?0:r}_updateWidgetWidth(){const e=this._editor.getLayoutInfo(),t=e.contentLeft;this._lineNumbersDomNode.style.width=`${t}px`,this._linesDomNodeScrollable.style.setProperty("--vscode-editorStickyScroll-scrollableWidth",`${this._editor.getScrollWidth()-e.verticalScrollbarWidth}px`),this._rootDomNode.style.width=`${e.width-e.verticalScrollbarWidth}px`}_clearStickyLinesFromLine(e){this._foldingIconStore.clear();for(let t=e;ta.scrollWidth))+r.verticalScrollbarWidth,this._editor.layoutOverlayWidget(this)}_setFoldingHoverListeners(){this._editor.getOption(110)==="mouseover"&&(this._foldingIconStore.add(ye(this._lineNumbersDomNode,Ge.MOUSE_ENTER,()=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(ye(this._lineNumbersDomNode,Ge.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,n,r){const o=this._editor._getViewModel();if(!o)return;const s=o.coordinatesConverter.convertModelPositionToViewPosition(new ae(t,1)).lineNumber,a=o.getViewLineRenderingData(s),l=this._editor.getOption(68);let c;try{c=Ca.filter(a.inlineDecorations,s,a.minColumn,a.maxColumn)}catch{c=[]}const u=new I_(!0,!0,a.content,a.continuesWithWrappedLine,a.isBasicASCII,a.containsRTL,0,a.tokens,c,a.tabSize,a.startVisibleColumn,1,1,1,500,"none",!0,!0,null),d=new DS(2e3),h=Fk(u,d);let f;Ile?f=Ile.createHTML(d.build()):f=d.build();const g=document.createElement("span");g.setAttribute(j9,String(e)),g.setAttribute(kle,""),g.setAttribute("role","listitem"),g.tabIndex=0,g.className="sticky-line-content",g.classList.add(`stickyLine${t}`),g.style.lineHeight=`${this._lineHeight}px`,g.innerHTML=f;const p=document.createElement("span");p.setAttribute(j9,String(e)),p.setAttribute(Ect,""),p.className="sticky-line-number",p.style.lineHeight=`${this._lineHeight}px`;const v=r.contentLeft;p.style.width=`${v}px`;const m=document.createElement("span");l.renderType===1||l.renderType===3&&t%10===0?m.innerText=t.toString():l.renderType===2&&(m.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),m.className="sticky-line-number-inner",m.style.lineHeight=`${this._lineHeight}px`,m.style.width=`${r.lineNumbersWidth}px`,m.style.paddingLeft=`${r.lineNumbersLeft}px`,p.appendChild(m);const _=this._renderFoldingIconForLine(n,t);_&&p.appendChild(_.domNode),this._editor.applyFontInfo(g),this._editor.applyFontInfo(m),p.style.lineHeight=`${this._lineHeight}px`,g.style.lineHeight=`${this._lineHeight}px`,p.style.height=`${this._lineHeight}px`,g.style.height=`${this._lineHeight}px`;const y=new Ict(e,t,g,p,_,h.characterMapping,g.scrollWidth);return this._updateTopAndZIndexOfStickyLine(y)}_updateTopAndZIndexOfStickyLine(e){var t;const n=e.index,r=e.lineDomNode,o=e.lineNumberDomNode,s=n===this._lineNumbers.length-1,a="0",l="1";r.style.zIndex=s?a:l,o.style.zIndex=s?a:l;const c=`${n*this._lineHeight+this._lastLineRelativePosition+(!((t=e.foldingIcon)===null||t===void 0)&&t.isCollapsed?1:0)}px`,u=`${n*this._lineHeight}px`;return r.style.top=s?c:u,o.style.top=s?c:u,e}_renderFoldingIconForLine(e,t){const n=this._editor.getOption(110);if(!e||n==="never")return;const r=e.regions,o=r.findRange(t),s=r.getStartLineNumber(o);if(!(t===s))return;const l=r.isCollapsed(o),c=new kct(l,s,r.getEndLineNumber(o),this._lineHeight);return c.setVisible(this._isOnGlyphMargin?!0:l||n==="always"),c.domNode.setAttribute(Tle,""),c}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:null}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const n=tX(t.characterMapping,e,0);return new ae(t.lineNumber,n)}getLineNumberFromChildDomNode(e){var t,n;return(n=(t=this._getRenderedStickyLineFromChildDomNode(e))===null||t===void 0?void 0:t.lineNumber)!==null&&n!==void 0?n:null}_getRenderedStickyLineFromChildDomNode(e){const t=this.getLineIndexFromChildDomNode(e);return t===null||t<0||t>=this._renderedStickyLines.length?null:this._renderedStickyLines[t]}getLineIndexFromChildDomNode(e){const t=this._getAttributeValue(e,j9);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,kle)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,Tle)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const n=e.getAttribute(t);if(n!==null)return n;e=e.parentElement}}}class Ict{constructor(e,t,n,r,o,s,a){this.index=e,this.lineNumber=t,this.lineDomNode=n,this.lineNumberDomNode=r,this.foldingIcon=o,this.characterMapping=s,this.scrollWidth=a}}class kct{constructor(e,t,n,r){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=n,this.dimension=r,this.domNode=document.createElement("div"),this.domNode.style.width=`${r}px`,this.domNode.style.height=`${r}px`,this.domNode.className=Wt.asClassName(e?K3:j3)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class BE{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class RO{constructor(e,t,n){this.range=e,this.children=t,this.parent=n}}class Z1e{constructor(e,t,n,r){this.uri=e,this.version=t,this.element=n,this.outlineProviderId=r}}var h5=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},XI=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},WE;(function(i){i.OUTLINE_MODEL="outlineModel",i.FOLDING_PROVIDER_MODEL="foldingProviderModel",i.INDENTATION_MODEL="indentationModel"})(WE||(WE={}));var iv;(function(i){i[i.VALID=0]="VALID",i[i.INVALID=1]="INVALID",i[i.CANCELED=2]="CANCELED"})(iv||(iv={}));let ZU=class extends fe{constructor(e,t,n,r){super(),this._editor=e,this._languageConfigurationService=t,this._languageFeaturesService=n,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new nd(300)),this._updateOperation=this._register(new Te);const o=new QU(n),s=new ej(this._editor,n),a=new JU(this._editor,t);switch(r){case WE.OUTLINE_MODEL:this._modelProviders.push(o),this._modelProviders.push(s),this._modelProviders.push(a);break;case WE.FOLDING_PROVIDER_MODEL:this._modelProviders.push(s),this._modelProviders.push(a);break;case WE.INDENTATION_MODEL:this._modelProviders.push(a);break}}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}async update(e,t,n){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),await this._updateScheduler.trigger(async()=>{for(const r of this._modelProviders){const{statusPromise:o,modelPromise:s}=r.computeStickyModel(e,t,n);this._modelPromise=s;const a=await o;if(this._modelPromise!==s)return null;switch(a){case iv.CANCELED:return this._updateOperation.clear(),null;case iv.VALID:return r.stickyModel}}return null}).catch(r=>(en(r),null))}};ZU=h5([XI(1,Di),XI(2,_t)],ZU);class Q1e{constructor(){this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,iv.INVALID}computeStickyModel(e,t,n){if(n.isCancellationRequested||!this.isProviderValid(e))return{statusPromise:this._invalid(),modelPromise:null};const r=Io(o=>this.createModelFromProvider(e,t,o));return{statusPromise:r.then(o=>this.isModelValid(o)?n.isCancellationRequested?iv.CANCELED:(this._stickyModel=this.createStickyModel(e,t,n,o),iv.VALID):this._invalid()).then(void 0,o=>(en(o),iv.CANCELED)),modelPromise:r}}isModelValid(e){return!0}isProviderValid(e){return!0}}let QU=class extends Q1e{constructor(e){super(),this._languageFeaturesService=e}createModelFromProvider(e,t,n){return Fg.create(this._languageFeaturesService.documentSymbolProvider,e,n)}createStickyModel(e,t,n,r){var o;const{stickyOutlineElement:s,providerID:a}=this._stickyModelFromOutlineModel(r,(o=this._stickyModel)===null||o===void 0?void 0:o.outlineProviderId);return new Z1e(e.uri,t,s,a)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let n;if(En.first(e.children.values())instanceof b1e){const a=En.find(e.children.values(),l=>l.id===t);if(a)n=a.children;else{let l="",c=-1,u;for(const[d,h]of e.children.entries()){const f=this._findSumOfRangesOfGroup(h);f>c&&(u=h,c=f,l=h.id)}t=l,n=u.children}}else n=e.children;const r=[],o=Array.from(n.values()).sort((a,l)=>{const c=new BE(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),u=new BE(l.symbol.range.startLineNumber,l.symbol.range.endLineNumber);return this._comparator(c,u)});for(const a of o)r.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new RO(void 0,r,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const n=[];for(const o of e.children.values())if(o.symbol.selectionRange.startLineNumber!==o.symbol.range.endLineNumber)if(o.symbol.selectionRange.startLineNumber!==t)n.push(this._stickyModelFromOutlineElement(o,o.symbol.selectionRange.startLineNumber));else for(const s of o.children.values())n.push(this._stickyModelFromOutlineElement(s,o.symbol.selectionRange.startLineNumber));n.sort((o,s)=>this._comparator(o.range,s.range));const r=new BE(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new RO(r,n,void 0)}_comparator(e,t){return e.startLineNumber!==t.startLineNumber?e.startLineNumber-t.startLineNumber:t.endLineNumber-e.endLineNumber}_findSumOfRangesOfGroup(e){let t=0;for(const n of e.children.values())t+=this._findSumOfRangesOfGroup(n);return e instanceof CU?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};QU=h5([XI(0,_t)],QU);class J1e extends Q1e{constructor(e){super(),this._foldingLimitReporter=new m1e(e)}createStickyModel(e,t,n,r){const o=this._fromFoldingRegions(r);return new Z1e(e.uri,t,o,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,n=[],r=new RO(void 0,[],void 0);for(let o=0;o0}createModelFromProvider(e,t,n){const r=Xf.getFoldingRangeProviders(this._languageFeaturesService,e);return new nZ(e,r,()=>this.createModelFromProvider(e,t,n),this._foldingLimitReporter,void 0).compute(n)}};ej=h5([XI(1,_t)],ej);var Tct=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Nle=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class Nct{constructor(e,t,n){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=n}}let tj=class extends fe{constructor(e,t,n){super(),this._languageFeaturesService=t,this._languageConfigurationService=n,this._onDidChangeStickyScroll=this._register(new se),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._options=null,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new Te),this._updateSoon=this._register(new pi(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(115)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._stickyModelProvider=null,this._sessionStore.clear(),this._options=this._editor.getOption(115),this._options.enabled&&(this._stickyModelProvider=this._sessionStore.add(new ZU(this._editor,this._languageConfigurationService,this._languageFeaturesService,this._options.defaultModel)),this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,this._onDidChangeStickyScroll.fire(),this.update()})),this._sessionStore.add(this._editor.onDidChangeHiddenAreas(()=>this.update())),this._sessionStore.add(this._editor.onDidChangeModelContent(()=>this._updateSoon.schedule())),this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>this.update())),this.update())}getVersionId(){var e;return(e=this._model)===null||e===void 0?void 0:e.version}async update(){var e;(e=this._cts)===null||e===void 0||e.dispose(!0),this._cts=new wr,await this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()}async updateStickyModel(e){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization()){this._model=null;return}const t=this._editor.getModel(),n=t.getVersionId(),r=await this._stickyModelProvider.update(t,n,e);e.isCancellationRequested||(this._model=r)}updateIndex(e){return e===-1?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,t,n,r,o){if(t.children.length===0)return;let s=o;const a=[];for(let u=0;uu-d)),c=this.updateIndex(_D(a,e.startLineNumber+r,(u,d)=>u-d));for(let u=l;u<=c;u++){const d=t.children[u];if(!d)return;if(d.range){const h=d.range.startLineNumber,f=d.range.endLineNumber;e.startLineNumber<=f+1&&h-1<=e.endLineNumber&&h!==s&&(s=h,n.push(new Nct(h,f-1,r+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,d,n,r+1,h))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,d,n,r,o)}}getCandidateStickyLinesIntersecting(e){var t,n;if(!(!((t=this._model)===null||t===void 0)&&t.element))return[];let r=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,r,0,-1);const o=(n=this._editor._getViewModel())===null||n===void 0?void 0:n.getHiddenAreas();if(o)for(const s of o)r=r.filter(a=>!(a.startLineNumber>=s.startLineNumber&&a.endLineNumber<=s.endLineNumber+1));return r}};tj=Tct([Nle(1,_t),Nle(2,Di)],tj);var Rct=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},c1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},nj;let Yf=nj=class extends fe{constructor(e,t,n,r,o,s,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=n,this._instaService=r,this._contextKeyService=a,this._sessionStore=new Te,this._foldingModel=null,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._showEndForLine=null,this._stickyScrollWidget=new Dct(this._editor),this._stickyLineCandidateProvider=new tj(this._editor,n,o),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=new Dle([],[],0),this._onDidResize(),this._readConfiguration();const l=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration(u=>{(u.hasChanged(115)||u.hasChanged(73)||u.hasChanged(67)||u.hasChanged(110))&&this._readConfiguration()})),this._register(ye(l,Ge.CONTEXT_MENU,async u=>{this._onContextMenu(Pt(l),u)})),this._stickyScrollFocusedContextKey=j.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=j.stickyScrollVisible.bindTo(this._contextKeyService);const c=this._register(dh(l));this._register(c.onDidBlur(u=>{this._positionRevealed===!1&&l.clientHeight===0?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()})),this._register(c.onDidFocus(u=>{this.focus()})),this._registerMouseListeners(),this._register(ye(l,Ge.MOUSE_DOWN,u=>{this._onMouseDown=!0}))}static get(e){return e.getContribution(nj.ID)}_disposeFocusStickyScrollStore(){var e;this._stickyScrollFocusedContextKey.set(!1),(e=this._focusDisposableStore)===null||e===void 0||e.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}focus(){if(this._onMouseDown){this._onMouseDown=!1,this._editor.focus();return}this._stickyScrollFocusedContextKey.get()!==!0&&(this._focused=!0,this._focusDisposableStore=new Te,this._stickyScrollFocusedContextKey.set(!0),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumbers.length-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}focusNext(){this._focusedStickyElementIndex0&&this._focusNav(!1)}selectEditor(){this._editor.focus()}_focusNav(e){this._focusedStickyElementIndex=e?this._focusedStickyElementIndex+1:this._focusedStickyElementIndex-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex)}goToFocused(){const e=this._stickyScrollWidget.lineNumbers;this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:e[this._focusedStickyElementIndex],column:1})}_revealPosition(e){this._reveaInEditor(e,()=>this._editor.revealPosition(e))}_revealLineInCenterIfOutsideViewport(e){this._reveaInEditor(e,()=>this._editor.revealLineInCenterIfOutsideViewport(e.lineNumber,0))}_reveaInEditor(e,t){this._focused&&this._disposeFocusStickyScrollStore(),this._positionRevealed=!0,t(),this._editor.setSelection(B.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new Te),t=this._register(new M3(this._editor,{extractLineNumberFromMouseEvent:o=>{const s=this._stickyScrollWidget.getEditorPositionFromNode(o.target.element);return s?s.lineNumber:0}})),n=o=>{if(!this._editor.hasModel()||o.target.type!==12||o.target.detail!==this._stickyScrollWidget.getId())return null;const s=o.target.element;if(!s||s.innerText!==s.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(s);return a?{range:new B(a.lineNumber,a.column,a.lineNumber,a.column+s.innerText.length),textElement:s}:null},r=this._stickyScrollWidget.getDomNode();this._register(Sr(r,Ge.CLICK,o=>{if(o.ctrlKey||o.altKey||o.metaKey||!o.leftButton)return;if(o.shiftKey){const c=this._stickyScrollWidget.getLineIndexFromChildDomNode(o.target);if(c===null)return;const u=new ae(this._endLineNumbers[c],1);this._revealLineInCenterIfOutsideViewport(u);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(o.target)){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(o.target);this._toggleFoldingRegionForLine(c);return}if(!this._stickyScrollWidget.isInStickyLine(o.target))return;let l=this._stickyScrollWidget.getEditorPositionFromNode(o.target);if(!l){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(o.target);if(c===null)return;l=new ae(c,1)}this._revealPosition(l)})),this._register(Sr(r,Ge.MOUSE_MOVE,o=>{if(o.shiftKey){const s=this._stickyScrollWidget.getLineIndexFromChildDomNode(o.target);if(s===null||this._showEndForLine!==null&&this._showEndForLine===s)return;this._showEndForLine=s,this._renderStickyScroll();return}this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(ye(r,Ge.MOUSE_LEAVE,o=>{this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([o,s])=>{const a=n(o);if(!a||!o.hasTriggerModifier||!this._editor.hasModel()){e.clear();return}const{range:l,textElement:c}=a;if(!l.equalsRange(this._stickyRangeProjectedOnEditor))this._stickyRangeProjectedOnEditor=l,e.clear();else if(c.style.textDecoration==="underline")return;const u=new wr;e.add(Rt(()=>u.dispose(!0)));let d;B3(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new ae(l.startLineNumber,l.startColumn+1),u.token).then(h=>{if(!u.token.isCancellationRequested)if(h.length!==0){this._candidateDefinitionsLength=h.length;const f=c;d!==f?(e.clear(),d=f,d.style.textDecoration="underline",e.add(Rt(()=>{d.style.textDecoration="none"}))):d||(d=f,d.style.textDecoration="underline",e.add(Rt(()=>{d.style.textDecoration="none"})))}else e.clear()})})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(async o=>{if(o.target.type!==12||o.target.detail!==this._stickyScrollWidget.getId())return;const s=this._stickyScrollWidget.getEditorPositionFromNode(o.target.element);s&&(!this._editor.hasModel()||!this._stickyRangeProjectedOnEditor||(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:s.lineNumber,column:1})),this._instaService.invokeFunction(T1e,o,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor})))}))}_onContextMenu(e,t){const n=new Uu(e,t);this._contextMenuService.showContextMenu({menuId:$.StickyScrollContext,getAnchor:()=>n})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getRenderedStickyLine(e),n=t==null?void 0:t.foldingIcon;if(!n)return;d1e(this._foldingModel,Number.MAX_VALUE,[e]),n.isCollapsed=!n.isCollapsed;const r=(n.isCollapsed?this._editor.getTopForLineNumber(n.foldingEndLine):this._editor.getTopForLineNumber(n.foldingStartLine))-this._editor.getOption(67)*t.index+1;this._editor.setScrollTop(r),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(115);if(e.enabled===!1){this._editor.removeOverlayWidget(this._stickyScrollWidget),this._sessionStore.clear(),this._enabled=!1;return}else e.enabled&&!this._enabled&&(this._editor.addOverlayWidget(this._stickyScrollWidget),this._sessionStore.add(this._editor.onDidScrollChange(n=>{n.scrollTopChanged&&(this._showEndForLine=null,this._renderStickyScroll())})),this._sessionStore.add(this._editor.onDidLayoutChange(()=>this._onDidResize())),this._sessionStore.add(this._editor.onDidChangeModelTokens(n=>this._onTokensChange(n))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(()=>{this._showEndForLine=null,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(68).renderType===2&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=null,this._renderStickyScroll(0)}))}_needsUpdate(e){const t=this._stickyScrollWidget.getCurrentLines();for(const n of t)for(const r of e.ranges)if(n>=r.fromLineNumber&&n<=r.toLineNumber)return!0;return!1}_onTokensChange(e){this._needsUpdate(e)&&this._renderStickyScroll(0)}_onDidResize(){const t=this._editor.getLayoutInfo().height/this._editor.getOption(67);this._maxStickyLines=Math.round(t*.25)}async _renderStickyScroll(e){var t,n;const r=this._editor.getModel();if(!r||r.isTooLargeForTokenization()){this._foldingModel=null,this._stickyScrollWidget.setState(void 0,null);return}const o=this._stickyLineCandidateProvider.getVersionId();if(o===void 0||o===r.getVersionId())if(this._foldingModel=(n=await((t=Xf.get(this._editor))===null||t===void 0?void 0:t.getFoldingModel()))!==null&&n!==void 0?n:null,this._widgetState=this.findScrollWidgetState(),this._stickyScrollVisibleContextKey.set(this._widgetState.startLineNumbers.length!==0),!this._focused)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e);else if(this._focusedStickyElementIndex===-1)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const s=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(s)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}}findScrollWidgetState(){const e=this._editor.getOption(67),t=Math.min(this._maxStickyLines,this._editor.getOption(115).maxLineCount),n=this._editor.getScrollTop();let r=0;const o=[],s=[],a=this._editor.getVisibleRanges();if(a.length!==0){const l=new BE(a[0].startLineNumber,a[a.length-1].endLineNumber),c=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(l);for(const u of c){const d=u.startLineNumber,h=u.endLineNumber,f=u.nestingDepth;if(h-d>0){const g=(f-1)*e,p=f*e,v=this._editor.getBottomForLineNumber(d)-n,m=this._editor.getTopForLineNumber(h)-n,_=this._editor.getBottomForLineNumber(h)-n;if(g>m&&g<=_){o.push(d),s.push(h+1),r=_-p;break}else p>v&&p<=_&&(o.push(d),s.push(h+1));if(o.length===t)break}}}return this._endLineNumbers=s,new Dle(o,s,r,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}};Yf.ID="store.contrib.stickyScrollController";Yf=nj=Rct([c1(1,Ol),c1(2,_t),c1(3,Ot),c1(4,Di),c1(5,gu),c1(6,Vt)],Yf);class Mct extends sl{constructor(){super({id:"editor.action.toggleStickyScroll",title:{...$n("toggleEditorStickyScroll","Toggle Editor Sticky Scroll"),mnemonicTitle:w({key:"mitoggleStickyScroll",comment:["&& denotes a mnemonic"]},"&&Toggle Editor Sticky Scroll")},category:Lct.View,toggled:{condition:De.equals("config.editor.stickyScroll.enabled",!0),title:w("stickyScroll","Sticky Scroll"),mnemonicTitle:w({key:"miStickyScroll",comment:["&& denotes a mnemonic"]},"&&Sticky Scroll")},menu:[{id:$.CommandPalette},{id:$.MenubarAppearanceMenu,group:"4_editor",order:3},{id:$.StickyScrollContext}]})}async run(e){const t=e.get(gn),n=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",n)}}const f5=100;class Act extends Sh{constructor(){super({id:"editor.action.focusStickyScroll",title:{...$n("focusStickyScroll","Focus Sticky Scroll"),mnemonicTitle:w({key:"mifocusStickyScroll",comment:["&& denotes a mnemonic"]},"&&Focus Sticky Scroll")},precondition:De.and(De.has("config.editor.stickyScroll.enabled"),j.stickyScrollVisible),menu:[{id:$.CommandPalette}]})}runEditorCommand(e,t){var n;(n=Yf.get(t))===null||n===void 0||n.focus()}}class Pct extends Sh{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:$n("selectNextStickyScrollLine.title","Select next sticky scroll line"),precondition:j.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:f5,primary:18}})}runEditorCommand(e,t){var n;(n=Yf.get(t))===null||n===void 0||n.focusNext()}}class Oct extends Sh{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:$n("selectPreviousStickyScrollLine.title","Select previous sticky scroll line"),precondition:j.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:f5,primary:16}})}runEditorCommand(e,t){var n;(n=Yf.get(t))===null||n===void 0||n.focusPrevious()}}class Fct extends Sh{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:$n("goToFocusedStickyScrollLine.title","Go to focused sticky scroll line"),precondition:j.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:f5,primary:3}})}runEditorCommand(e,t){var n;(n=Yf.get(t))===null||n===void 0||n.goToFocused()}}class Bct extends Sh{constructor(){super({id:"editor.action.selectEditor",title:$n("selectEditor.title","Select Editor"),precondition:j.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:f5,primary:9}})}runEditorCommand(e,t){var n;(n=Yf.get(t))===null||n===void 0||n.selectEditor()}}jn(Yf.ID,Yf,1);Ei(Mct);Ei(Act);Ei(Oct);Ei(Pct);Ei(Fct);Ei(Bct);var eye=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},UL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class Wct{constructor(e,t,n,r,o,s){this.range=e,this.insertText=t,this.filterText=n,this.additionalTextEdits=r,this.command=o,this.completion=s}}let ij=class extends Y3e{constructor(e,t,n,r,o,s){super(o.disposable),this.model=e,this.line=t,this.word=n,this.completionModel=r,this._suggestMemoryService=s}canBeReused(e,t,n){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===n.startColumn&&this.word.endColumn=0&&l.resolve(Cn.None)}return t}};ij=eye([UL(5,Z3)],ij);let rj=class extends fe{constructor(e,t,n,r){super(),this._languageFeatureService=e,this._clipboardService=t,this._suggestMemoryService=n,this._editorService=r,this._store.add(e.inlineCompletionsProvider.register("*",this))}async provideInlineCompletions(e,t,n,r){var o;if(n.selectedSuggestionInfo)return;let s;for(const g of this._editorService.listCodeEditors())if(g.getModel()===e){s=g;break}if(!s)return;const a=s.getOption(89);if(Cy.isAllOff(a))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const l=e.tokenization.getLineTokens(t.lineNumber),c=l.getStandardTokenType(l.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(Cy.valueFor(a,c)!=="inline")return;let u=e.getWordAtPosition(t),d;if(u!=null&&u.word||(d=this._getTriggerCharacterInfo(e,t)),!(u!=null&&u.word)&&!d||(u||(u=e.getWordUntilPosition(t)),u.endColumn!==t.column))return;let h;const f=e.getValueInRange(new B(t.lineNumber,1,t.lineNumber,t.column));if(!d&&(!((o=this._lastResult)===null||o===void 0)&&o.canBeReused(e,t.lineNumber,u))){const g=new yle(f,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=g,this._lastResult.acquire(),h=this._lastResult}else{const g=await rZ(this._languageFeatureService.completionProvider,e,t,new BI(void 0,IO.createSuggestFilter(s).itemKind,d==null?void 0:d.providers),d&&{triggerKind:1,triggerCharacter:d.ch},r);let p;g.needsClipboard&&(p=await this._clipboardService.readText());const v=new Bm(g.items,t.column,new yle(f,0),Hd.None,s.getOption(118),s.getOption(112),{boostFullMatch:!1,firstMatchCanBeWeak:!1},p);h=new ij(e,t.lineNumber,u,v,g,this._suggestMemoryService)}return this._lastResult=h,h}handleItemDidShow(e,t){t.completion.resolve(Cn.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var n;const r=e.getValueInRange(B.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),o=new Set;for(const s of this._languageFeatureService.completionProvider.all(e))!((n=s.triggerCharacters)===null||n===void 0)&&n.includes(r)&&o.add(s);if(o.size!==0)return{providers:o,ch:r}}};rj=eye([UL(0,_t),UL(1,jp),UL(2,Z3),UL(3,Un)],rj);nT(rj);class $ct extends gt{constructor(){super({id:"editor.action.forceRetokenize",label:w("forceRetokenize","Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;const n=t.getModel();n.tokenization.resetTokenization();const r=new Ms;n.tokenization.forceTokenization(n.getLineCount()),r.stop(),console.log(`tokenization took ${r.elapsed()}`)}}Be($ct);class g5 extends sl{constructor(){super({id:g5.ID,title:$n({key:"toggle.tabMovesFocus",comment:["Turn on/off use of tab key for moving focus around VS Code"]},"Toggle Tab Key Moves Focus"),precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},f1:!0})}run(){const t=!Rw.getTabFocusMode();Rw.setTabFocusMode(t),kl(t?w("toggle.tabMovesFocus.on","Pressing Tab will now move focus to the next focusable element"):w("toggle.tabMovesFocus.off","Pressing Tab will now insert the tab character"))}}g5.ID="editor.action.toggleTabFocusMode";Ei(g5);var Hct=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Vct=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let oj=class extends fe{get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute("aria-disabled","false"),this.el.tabIndex=0,this.el.style.pointerEvents="auto",this.el.style.opacity="1",this.el.style.cursor="pointer",this._enabled=!1):(this.el.setAttribute("aria-disabled","true"),this.el.tabIndex=-1,this.el.style.pointerEvents="none",this.el.style.opacity="0.4",this.el.style.cursor="default",this._enabled=!0),this._enabled=e}constructor(e,t,n={},r){var o;super(),this._link=t,this._enabled=!0,this.el=ke(e,He("a.monaco-link",{tabIndex:(o=t.tabIndex)!==null&&o!==void 0?o:0,href:t.href,title:t.title},t.label)),this.el.setAttribute("role","button");const s=this._register(new wn(this.el,"click")),a=this._register(new wn(this.el,"keypress")),l=Je.chain(a.event,d=>d.map(h=>new Ai(h)).filter(h=>h.keyCode===3)),c=this._register(new wn(this.el,Si.Tap)).event;this._register(wi.addTarget(this.el));const u=Je.any(s.event,l,c);this._register(u(d=>{this.enabled&&(hn.stop(d,!0),n!=null&&n.opener?n.opener(this._link.href):r.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}};oj=Hct([Vct(3,al)],oj);var tye=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},nye=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const zct=26;let sj=class extends fe{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(aj))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show({...e,onClose:()=>{var t;this.hide(),(t=e.onClose)===null||t===void 0||t.call(e)}}),this._editor.setBanner(this.banner.element,zct)}};sj=tye([nye(1,Ot)],sj);let aj=class extends fe{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(Uf,{}),this.element=He("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(e){if(e.ariaLabel)return e.ariaLabel;if(typeof e.message=="string")return e.message}getBannerMessage(e){if(typeof e=="string"){const t=He("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){Ns(this.element)}show(e){Ns(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const n=ke(this.element,He("div.icon-container"));n.setAttribute("aria-hidden","true"),e.icon&&n.appendChild(He(`div${Wt.asCSSSelector(e.icon)}`));const r=ke(this.element,He("div.message-container"));if(r.setAttribute("aria-hidden","true"),r.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=ke(this.element,He("div.message-actions-container")),e.actions)for(const s of e.actions)this._register(this.instantiationService.createInstance(oj,this.messageActionsContainer,{...s,tabIndex:-1},{}));const o=ke(this.element,He("div.action-container"));this.actionBar=this._register(new au(o)),this.actionBar.push(this._register(new xl("banner.close","Close Banner",Wt.asClassName(N0e),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};aj=tye([nye(0,Ot)],aj);var _Z=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},nw=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Uct=Mr("extensions-warning-message",Xe.warning,w("warningIcon","Icon shown with a warning message in the extensions editor."));let lS=class extends fe{constructor(e,t,n,r){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=n,this._highlighter=null,this._bannerClosed=!1,this._updateState=o=>{if(o&&o.hasMore){if(this._bannerClosed)return;const s=Math.max(o.ambiguousCharacterCount,o.nonBasicAsciiCharacterCount,o.invisibleCharacterCount);let a;if(o.nonBasicAsciiCharacterCount>=s)a={message:w("unicodeHighlighting.thisDocumentHasManyNonBasicAsciiUnicodeCharacters","This document contains many non-basic ASCII unicode characters"),command:new qS};else if(o.ambiguousCharacterCount>=s)a={message:w("unicodeHighlighting.thisDocumentHasManyAmbiguousUnicodeCharacters","This document contains many ambiguous unicode characters"),command:new F_};else if(o.invisibleCharacterCount>=s)a={message:w("unicodeHighlighting.thisDocumentHasManyInvisibleUnicodeCharacters","This document contains many invisible unicode characters"),command:new GS};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:Uct,actions:[{label:a.command.shortLabel,href:`command:${a.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(r.createInstance(sj,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(125),this._register(n.onDidChangeTrust(o=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(o=>{o.hasChanged(125)&&(this._options=e.getOption(125),this._updateHighlighter())})),this._updateHighlighter()}dispose(){this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),super.dispose()}_updateHighlighter(){if(this._updateState(null),this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),!this._editor.hasModel())return;const e=jct(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(n=>n===!1))return;const t={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map(n=>n.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(n=>n==="_os"?new Intl.NumberFormat().resolvedOptions().locale:n==="_vscode"?Y4e:n)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new lj(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new Kct(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}};lS.ID="editor.contrib.unicodeHighlighter";lS=_Z([nw(1,hd),nw(2,F_e),nw(3,Ot)],lS);function jct(i,e){return{nonBasicASCII:e.nonBasicASCII===Kl?!i:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===Kl?!i:e.includeComments,includeStrings:e.includeStrings===Kl?!i:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let lj=class extends fe{constructor(e,t,n,r){super(),this._editor=e,this._options=t,this._updateState=n,this._editorWorkerService=r,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new pi(()=>this._update(),250)),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then(t=>{if(this._model.isDisposed()||this._model.getVersionId()!==e)return;this._updateState(t);const n=[];if(!t.hasMore)for(const r of t.ranges)n.push({range:r,options:MO.instance.getDecorationFromOptions(this._options)});this._decorations.set(n)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!wX(t,e))return null;const n=t.getValueInRange(e.range);return{reason:rye(n,this._options),inComment:SX(t,e),inString:xX(t,e)}}};lj=_Z([nw(3,hd)],lj);class Kct extends fe{constructor(e,t,n){super(),this._editor=e,this._options=t,this._updateState=n,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new pi(()=>this._update(),250)),this._register(this._editor.onDidLayoutChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidScrollChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeHiddenAreas(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._editor.getVisibleRanges(),t=[],n={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const r of e){const o=Oq.computeUnicodeHighlights(this._model,this._options,r);for(const s of o.ranges)n.ranges.push(s);n.ambiguousCharacterCount+=n.ambiguousCharacterCount,n.invisibleCharacterCount+=n.invisibleCharacterCount,n.nonBasicAsciiCharacterCount+=n.nonBasicAsciiCharacterCount,n.hasMore=n.hasMore||o.hasMore}if(!n.hasMore)for(const r of n.ranges)t.push({range:r,options:MO.instance.getDecorationFromOptions(this._options)});this._updateState(n),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),n=t.getValueInRange(e.range);return wX(t,e)?{reason:rye(n,this._options),inComment:SX(t,e),inString:xX(t,e)}:null}}const iye=w("unicodeHighlight.configureUnicodeHighlightOptions","Configure Unicode Highlight Options");let cj=class{constructor(e,t,n){this._editor=e,this._languageService=t,this._openerService=n,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const n=this._editor.getModel(),r=this._editor.getContribution(lS.ID);if(!r)return[];const o=[],s=new Set;let a=300;for(const l of t){const c=r.getDecorationInfo(l);if(!c)continue;const d=n.getValueInRange(l.range).codePointAt(0),h=K9(d);let f;switch(c.reason.kind){case 0:{Tk(c.reason.confusableWith)?f=w("unicodeHighlight.characterIsAmbiguousASCII","The character {0} could be confused with the ASCII character {1}, which is more common in source code.",h,K9(c.reason.confusableWith.codePointAt(0))):f=w("unicodeHighlight.characterIsAmbiguous","The character {0} could be confused with the character {1}, which is more common in source code.",h,K9(c.reason.confusableWith.codePointAt(0)));break}case 1:f=w("unicodeHighlight.characterIsInvisible","The character {0} is invisible.",h);break;case 2:f=w("unicodeHighlight.characterIsNonBasicAscii","The character {0} is not a basic ASCII character.",h);break}if(s.has(f))continue;s.add(f);const g={codePoint:d,reason:c.reason,inComment:c.inComment,inString:c.inString},p=w("unicodeHighlight.adjustSettings","Adjust settings"),v=`command:${vT.ID}?${encodeURIComponent(JSON.stringify(g))}`,m=new Is("",!0).appendMarkdown(f).appendText(" ").appendLink(v,p,iye);o.push(new jd(this,l.range,[m],!1,a++))}return o}renderHoverParts(e,t){return HCe(e,t,this._editor,this._languageService,this._openerService)}};cj=_Z([nw(1,ji),nw(2,al)],cj);function uj(i){return`U+${i.toString(16).padStart(4,"0")}`}function K9(i){let e=`\`${uj(i)}\``;return Nf.isInvisibleCharacter(i)||(e+=` "${`${Gct(i)}`}"`),e}function Gct(i){return i===96?"`` ` ``":"`"+String.fromCodePoint(i)+"`"}function rye(i,e){return Oq.computeUnicodeHighlightReason(i,e)}class MO{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const n=`${e}${t}`;let r=this.map.get(n);return r||(r=sn.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(n,r)),r}}MO.instance=new MO;class qct extends gt{constructor(){super({id:F_.ID,label:w("action.unicodeHighlight.disableHighlightingInComments","Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=w("unicodeHighlight.disableHighlightingInComments.shortLabel","Disable Highlight In Comments")}async run(e,t,n){const r=e==null?void 0:e.get(gn);r&&this.runAction(r)}async runAction(e){await e.updateValue(Ga.includeComments,!1,2)}}class Xct extends gt{constructor(){super({id:F_.ID,label:w("action.unicodeHighlight.disableHighlightingInStrings","Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=w("unicodeHighlight.disableHighlightingInStrings.shortLabel","Disable Highlight In Strings")}async run(e,t,n){const r=e==null?void 0:e.get(gn);r&&this.runAction(r)}async runAction(e){await e.updateValue(Ga.includeStrings,!1,2)}}class F_ extends gt{constructor(){super({id:F_.ID,label:w("action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters","Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=w("unicodeHighlight.disableHighlightingOfAmbiguousCharacters.shortLabel","Disable Ambiguous Highlight")}async run(e,t,n){const r=e==null?void 0:e.get(gn);r&&this.runAction(r)}async runAction(e){await e.updateValue(Ga.ambiguousCharacters,!1,2)}}F_.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";class GS extends gt{constructor(){super({id:GS.ID,label:w("action.unicodeHighlight.disableHighlightingOfInvisibleCharacters","Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=w("unicodeHighlight.disableHighlightingOfInvisibleCharacters.shortLabel","Disable Invisible Highlight")}async run(e,t,n){const r=e==null?void 0:e.get(gn);r&&this.runAction(r)}async runAction(e){await e.updateValue(Ga.invisibleCharacters,!1,2)}}GS.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";class qS extends gt{constructor(){super({id:qS.ID,label:w("action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters","Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=w("unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters.shortLabel","Disable Non ASCII Highlight")}async run(e,t,n){const r=e==null?void 0:e.get(gn);r&&this.runAction(r)}async runAction(e){await e.updateValue(Ga.nonBasicASCII,!1,2)}}qS.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";class vT extends gt{constructor(){super({id:vT.ID,label:w("action.unicodeHighlight.showExcludeOptions","Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}async run(e,t,n){const{codePoint:r,reason:o,inString:s,inComment:a}=n,l=String.fromCodePoint(r),c=e.get(Eh),u=e.get(gn);function d(g){return Nf.isInvisibleCharacter(g)?w("unicodeHighlight.excludeInvisibleCharFromBeingHighlighted","Exclude {0} (invisible character) from being highlighted",uj(g)):w("unicodeHighlight.excludeCharFromBeingHighlighted","Exclude {0} from being highlighted",`${uj(g)} "${l}"`)}const h=[];if(o.kind===0)for(const g of o.notAmbiguousInLocales)h.push({label:w("unicodeHighlight.allowCommonCharactersInLanguage",'Allow unicode characters that are more common in the language "{0}".',g),run:async()=>{Zct(u,[g])}});if(h.push({label:d(r),run:()=>Yct(u,[r])}),a){const g=new qct;h.push({label:g.label,run:async()=>g.runAction(u)})}else if(s){const g=new Xct;h.push({label:g.label,run:async()=>g.runAction(u)})}if(o.kind===0){const g=new F_;h.push({label:g.label,run:async()=>g.runAction(u)})}else if(o.kind===1){const g=new GS;h.push({label:g.label,run:async()=>g.runAction(u)})}else if(o.kind===2){const g=new qS;h.push({label:g.label,run:async()=>g.runAction(u)})}else Qct(o);const f=await c.pick(h,{title:iye});f&&await f.run()}}vT.ID="editor.action.unicodeHighlight.showExcludeOptions";async function Yct(i,e){const t=i.getValue(Ga.allowedCharacters);let n;typeof t=="object"&&t?n=t:n={};for(const r of e)n[String.fromCodePoint(r)]=!0;await i.updateValue(Ga.allowedCharacters,n,2)}async function Zct(i,e){var t;const n=(t=i.inspect(Ga.allowedLocales).user)===null||t===void 0?void 0:t.value;let r;typeof n=="object"&&n?r=Object.assign({},n):r={};for(const o of e)r[o]=!0;await i.updateValue(Ga.allowedLocales,r,2)}function Qct(i){throw new Error(`Unexpected value: ${i}`)}Be(F_);Be(GS);Be(qS);Be(vT);jn(lS.ID,lS,1);P_.register(cj);var Jct=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Rle=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const oye="ignoreUnusualLineTerminators";function eut(i,e,t){i.setModelProperty(e.uri,oye,t)}function tut(i,e){return i.getModelProperty(e.uri,oye)}let YI=class extends fe{constructor(e,t,n){super(),this._editor=e,this._dialogService=t,this._codeEditorService=n,this._isPresentingDialog=!1,this._config=this._editor.getOption(126),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(126)&&(this._config=this._editor.getOption(126),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(r=>{r.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||tut(this._codeEditorService,e)===!0||this._editor.getOption(91))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let n;try{this._isPresentingDialog=!0,n=await this._dialogService.confirm({title:w("unusualLineTerminators.title","Unusual Line Terminators"),message:w("unusualLineTerminators.message","Detected unusual line terminators"),detail:w("unusualLineTerminators.detail","The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",su(e.uri)),primaryButton:w({key:"unusualLineTerminators.fix",comment:["&& denotes a mnemonic"]},"&&Remove Unusual Line Terminators"),cancelButton:w("unusualLineTerminators.ignore","Ignore")})}finally{this._isPresentingDialog=!1}if(!n.confirmed){eut(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}};YI.ID="editor.contrib.unusualLineTerminatorsDetector";YI=Jct([Rle(1,Gk),Rle(2,Un)],YI);jn(YI.ID,YI,1);var sye=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},jM=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},ho,dj;const p5=new st("hasWordHighlights",!1);function aye(i,e,t,n){const r=i.ordered(e);return wq(r.map(o=>()=>Promise.resolve(o.provideDocumentHighlights(e,t,n)).then(void 0,Zr)),Ts).then(o=>{if(o){const s=new Tr;return s.set(e.uri,o),s}return new Tr})}function nut(i,e,t,n,r,o){const s=i.ordered(e);return wq(s.map(a=>()=>{const l=o.filter(c=>Fme(c)).filter(c=>IX(a.selector,c.uri,c.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(a.provideMultiDocumentHighlights(e,t,l,r)).then(void 0,Zr)}),a=>a instanceof Tr&&a.size>0)}class bZ{constructor(e,t,n){this._model=e,this._selection=t,this._wordSeparators=n,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=Io(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const n=e.getWordAtPosition(t.getPosition());return n?new B(t.startLineNumber,n.startColumn,t.startLineNumber,n.endColumn):null}isValid(e,t,n){const r=t.startLineNumber,o=t.startColumn,s=t.endColumn,a=this._getCurrentWordRange(e,t);let l=!!(this._wordRange&&this._wordRange.equalsRange(a));for(let c=0,u=n.length;!l&&c=s&&(l=!0)}return l}cancel(){this.result.cancel()}}class iut extends bZ{constructor(e,t,n,r){super(e,t,n),this._providers=r}_compute(e,t,n,r){return aye(this._providers,e,t.getPosition(),r).then(o=>o||new Tr)}}class rut extends bZ{constructor(e,t,n,r,o){super(e,t,n),this._providers=r,this._otherModels=o}_compute(e,t,n,r){return nut(this._providers,e,t.getPosition(),n,r,this._otherModels).then(o=>o||new Tr)}}class lye extends bZ{constructor(e,t,n,r,o){super(e,t,r),this._otherModels=o,this._selectionIsEmpty=t.isEmpty(),this._word=n}_compute(e,t,n,r){return jv(250,r).then(()=>{const o=new Tr;let s;if(this._word?s=this._word:s=e.getWordAtPosition(t.getPosition()),!s)return new Tr;const a=[e,...this._otherModels];for(const l of a){if(l.isDisposed())continue;const u=l.findMatches(s.word,!0,!1,!0,n,!1).map(d=>({range:d.range,kind:xD.Text}));u&&o.set(l.uri,u)}return o})}isValid(e,t,n){const r=t.isEmpty();return this._selectionIsEmpty!==r?!1:super.isValid(e,t,n)}}function out(i,e,t,n,r){return i.has(e)?new iut(e,t,r,i):new lye(e,t,n,r,[])}function sut(i,e,t,n,r,o){return i.has(e)?new rut(e,t,r,i,o):new lye(e,t,n,r,o)}tg("_executeDocumentHighlights",async(i,e,t)=>{const n=i.get(_t),r=await aye(n.documentHighlightProvider,e,t,Cn.None);return r==null?void 0:r.get(e.uri)});let ZI=ho=class{constructor(e,t,n,r,o){this.toUnhook=new Te,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new Tr,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this.providers=t,this.multiDocumentProviders=n,this.codeEditorService=o,this._hasWordHighlights=p5.bindTo(r),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(81),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(s=>{this._ignorePositionChangeEvent||this.occurrencesHighlight!=="off"&&this._onPositionChanged(s)})),this.toUnhook.add(e.onDidFocusEditorText(s=>{this.occurrencesHighlight!=="off"&&(this.workerRequest||this._run())})),this.toUnhook.add(e.onDidChangeModelContent(s=>{this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(s=>{!s.newModelUrl&&s.oldModelUrl?this._stopSingular():ho.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(s=>{const a=this.editor.getOption(81);this.occurrencesHighlight!==a&&(this.occurrencesHighlight=a,this._stopAll())})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,ho.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(){this.occurrencesHighlight!=="off"&&this._run()}_getSortedHighlights(){return this.decorations.getRanges().sort(B.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),n=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))+1)%e.length,r=e[n];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(r.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(r);const o=this._getWord();if(o){const s=this.editor.getModel().getLineContent(r.startLineNumber);kl(`${s}, ${n+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),n=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,r=e[n];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(r.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(r);const o=this._getWord();if(o){const s=this.editor.getModel().getLineContent(r.startLineNumber);kl(`${s}, ${n+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=ho.storedDecorations.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),ho.storedDecorations.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(){const e=this.codeEditorService.listCodeEditors(),t=[];for(const n of e){if(!n.hasModel())continue;const r=ho.storedDecorations.get(n.getModel().uri);if(!r)continue;n.removeDecorations(r),t.push(n.getModel().uri);const o=Mp.get(n);o!=null&&o.wordHighlighter&&o.wordHighlighter.decorations.length>0&&(o.wordHighlighter.decorations.clear(),o.wordHighlighter.workerRequest=null,o.wordHighlighter._hasWordHighlights.set(!1))}for(const n of t)ho.storedDecorations.delete(n)}_stopSingular(){var e,t,n,r;this._removeSingleDecorations(),this.editor.hasTextFocus()&&(((e=this.editor.getModel())===null||e===void 0?void 0:e.uri.scheme)!==an.vscodeNotebookCell&&((n=(t=ho.query)===null||t===void 0?void 0:t.modelInfo)===null||n===void 0?void 0:n.model.uri.scheme)!==an.vscodeNotebookCell?(ho.query=null,this._run()):!((r=ho.query)===null||r===void 0)&&r.modelInfo&&(ho.query.modelInfo=null)),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_stopAll(){this._removeAllDecorations(),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){var t;if(this.occurrencesHighlight==="off"){this._stopAll();return}if(e.reason!==3&&((t=this.editor.getModel())===null||t===void 0?void 0:t.uri.scheme)!==an.vscodeNotebookCell){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,n=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:n})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===an.vscodeNotebookCell){const o=[],s=this.codeEditorService.listCodeEditors();for(const a of s){const l=a.getModel();l&&l!==e&&l.uri.scheme===an.vscodeNotebookCell&&o.push(l)}return o}const n=[],r=this.codeEditorService.listCodeEditors();for(const o of r){if(!EY(o))continue;const s=o.getModel();s&&e===s.modified&&n.push(s.modified)}if(n.length)return n;if(this.occurrencesHighlight==="singleFile")return[];for(const o of r){const s=o.getModel();s&&s!==e&&n.push(s)}return n}_run(){var e;let t;if(this.editor.hasTextFocus()){const r=this.editor.getSelection();if(!r||r.startLineNumber!==r.endLineNumber){ho.query=null,this._stopAll();return}const o=r.startColumn,s=r.endColumn,a=this._getWord();if(!a||a.startColumn>o||a.endColumn{r===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=s||[],this._beginRenderDecorations())},en)}}computeWithModel(e,t,n,r){return r.length?sut(this.multiDocumentProviders,e,t,n,this.editor.getOption(130),r):out(this.providers,e,t,n,this.editor.getOption(130))}_beginRenderDecorations(){const e=new Date().getTime(),t=this.lastCursorPositionChangeTime+250;e>=t?(this.renderDecorationsTimer=-1,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},t-e)}renderDecorations(){var e,t,n;this.renderDecorationsTimer=-1;const r=this.codeEditorService.listCodeEditors();for(const o of r){const s=Mp.get(o);if(!s)continue;const a=[],l=(e=o.getModel())===null||e===void 0?void 0:e.uri;if(l&&this.workerRequestValue.has(l)){const c=ho.storedDecorations.get(l),u=this.workerRequestValue.get(l);if(u)for(const h of u)h.range&&a.push({range:h.range,options:_lt(h.kind)});let d=[];o.changeDecorations(h=>{d=h.deltaDecorations(c??[],a)}),ho.storedDecorations=ho.storedDecorations.set(l,d),a.length>0&&((t=s.wordHighlighter)===null||t===void 0||t.decorations.set(a),(n=s.wordHighlighter)===null||n===void 0||n._hasWordHighlights.set(!0))}}}dispose(){this._stopSingular(),this.toUnhook.dispose()}};ZI.storedDecorations=new Tr;ZI.query=null;ZI=ho=sye([jM(4,Un)],ZI);let Mp=dj=class extends fe{static get(e){return e.getContribution(dj.ID)}constructor(e,t,n,r){super(),this._wordHighlighter=null;const o=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this._wordHighlighter=new ZI(e,n.documentHighlightProvider,n.multiDocumentHighlightProvider,t,r))};this._register(e.onDidChangeModel(s=>{this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),o()})),o()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){var e;(e=this._wordHighlighter)===null||e===void 0||e.moveNext()}moveBack(){var e;(e=this._wordHighlighter)===null||e===void 0||e.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore()}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}};Mp.ID="editor.contrib.wordHighlighter";Mp=dj=sye([jM(1,Vt),jM(2,_t),jM(3,Un)],Mp);class cye extends gt{constructor(e,t){super(t),this._isNext=e}run(e,t){const n=Mp.get(t);n&&(this._isNext?n.moveNext():n.moveBack())}}class aut extends cye{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:w("wordHighlight.next.label","Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:p5,kbOpts:{kbExpr:j.editorTextFocus,primary:65,weight:100}})}}class lut extends cye{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:w("wordHighlight.previous.label","Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:p5,kbOpts:{kbExpr:j.editorTextFocus,primary:1089,weight:100}})}}class cut extends gt{constructor(){super({id:"editor.action.wordHighlight.trigger",label:w("wordHighlight.trigger.label","Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:p5.toNegated(),kbOpts:{kbExpr:j.editorTextFocus,primary:0,weight:100}})}run(e,t,n){const r=Mp.get(t);r&&r.restoreViewState(!0)}}jn(Mp.ID,Mp,0);Be(aut);Be(lut);Be(cut);class m5 extends Vo{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){if(!t.hasModel())return;const r=ou(t.getOption(130)),o=t.getModel(),a=t.getSelections().map(l=>{const c=new ae(l.positionLineNumber,l.positionColumn),u=this._move(r,o,c,this._wordNavigationType);return this._moveTo(l,u,this._inSelectionMode)});if(o.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,a.map(l=>Wn.fromModelSelection(l))),a.length===1){const l=new ae(a[0].positionLineNumber,a[0].positionColumn);t.revealPosition(l,0)}}_moveTo(e,t,n){return n?new yt(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new yt(t.lineNumber,t.column,t.lineNumber,t.column)}}class B_ extends m5{_move(e,t,n,r){return Zn.moveWordLeft(e,t,n,r)}}class W_ extends m5{_move(e,t,n,r){return Zn.moveWordRight(e,t,n,r)}}class uut extends B_{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class dut extends B_{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class hut extends B_{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:De.and(j.textInputFocus,(e=De.and(Bk,o3))===null||e===void 0?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class fut extends B_{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class gut extends B_{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class put extends B_{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:De.and(j.textInputFocus,(e=De.and(Bk,o3))===null||e===void 0?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class mut extends B_{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,n,r){return super._move(ou(yh.wordSeparators.defaultValue),t,n,r)}}class vut extends B_{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,n,r){return super._move(ou(yh.wordSeparators.defaultValue),t,n,r)}}class _ut extends W_{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class but extends W_{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:De.and(j.textInputFocus,(e=De.and(Bk,o3))===null||e===void 0?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class Cut extends W_{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class yut extends W_{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class wut extends W_{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:De.and(j.textInputFocus,(e=De.and(Bk,o3))===null||e===void 0?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class Sut extends W_{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class xut extends W_{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,n,r){return super._move(ou(yh.wordSeparators.defaultValue),t,n,r)}}class Lut extends W_{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,n,r){return super._move(ou(yh.wordSeparators.defaultValue),t,n,r)}}class v5 extends Vo{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){const r=e.get(Di);if(!t.hasModel())return;const o=ou(t.getOption(130)),s=t.getModel(),a=t.getSelections(),l=t.getOption(6),c=t.getOption(11),u=r.getLanguageConfiguration(s.getLanguageId()).getAutoClosingPairs(),d=t._getViewModel(),h=a.map(f=>{const g=this._delete({wordSeparators:o,model:s,selection:f,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(9),autoClosingBrackets:l,autoClosingQuotes:c,autoClosingPairs:u,autoClosedCharacters:d.getCursorAutoClosedCharacters()},this._wordNavigationType);return new os(g,"")});t.pushUndoStop(),t.executeCommands(this.id,h),t.pushUndoStop()}}class CZ extends v5{_delete(e,t){const n=Zn.deleteWordLeft(e,t);return n||new B(1,1,1,1)}}class yZ extends v5{_delete(e,t){const n=Zn.deleteWordRight(e,t);if(n)return n;const r=e.model.getLineCount(),o=e.model.getLineMaxColumn(r);return new B(r,o,r,o)}}class Eut extends CZ{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:j.writable})}}class Dut extends CZ{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:j.writable})}}class Iut extends CZ{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:j.writable,kbOpts:{kbExpr:j.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class kut extends yZ{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:j.writable})}}class Tut extends yZ{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:j.writable})}}class Nut extends yZ{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:j.writable,kbOpts:{kbExpr:j.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class Rut extends gt{constructor(){super({id:"deleteInsideWord",precondition:j.writable,label:w("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,t,n){if(!t.hasModel())return;const r=ou(t.getOption(130)),o=t.getModel(),a=t.getSelections().map(l=>{const c=Zn.deleteInsideWord(r,o,l);return new os(c,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}et(new uut);et(new dut);et(new hut);et(new fut);et(new gut);et(new put);et(new _ut);et(new but);et(new Cut);et(new yut);et(new wut);et(new Sut);et(new mut);et(new vut);et(new xut);et(new Lut);et(new Eut);et(new Dut);et(new Iut);et(new kut);et(new Tut);et(new Nut);Be(Rut);class Mut extends v5{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:j.writable,kbOpts:{kbExpr:j.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const n=B4.deleteWordPartLeft(e);return n||new B(1,1,1,1)}}class Aut extends v5{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:j.writable,kbOpts:{kbExpr:j.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const n=B4.deleteWordPartRight(e);if(n)return n;const r=e.model.getLineCount(),o=e.model.getLineMaxColumn(r);return new B(r,o,r,o)}}class uye extends m5{_move(e,t,n,r){return B4.moveWordPartLeft(e,t,n)}}class Put extends uye{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:j.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}Dn.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class Out extends uye{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:j.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}Dn.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class dye extends m5{_move(e,t,n,r){return B4.moveWordPartRight(e,t,n)}}class Fut extends dye{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:j.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class But extends dye{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:j.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}et(new Mut);et(new Aut);et(new Put);et(new Out);et(new Fut);et(new But);class hj extends fe{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=xa.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(92);t||(this.editor.isSimpleWidget?t=new Is(w("editor.simple.readonly","Cannot edit in read-only input")):t=new Is(w("editor.readonly","Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}}hj.ID="editor.contrib.readOnlyMessageController";jn(hj.ID,hj,2);var Wut=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Mle=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let fj=class extends fe{constructor(e,t,n){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=n,this._currentModel=Hn(this,void 0);const r=ma("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),o=ma("_textModel.onDidChangeContent",Je.debounce(s=>this._textModel.onDidChangeContent(s),()=>{},100));this._register(Dh(async(s,a)=>{r.read(s),o.read(s);const l=a.add(new qZe),c=await this._outlineModelService.getOrCreate(this._textModel,l.token);a.isDisposed||this._currentModel.set(c,void 0)}))}getBreadcrumbItems(e,t){const n=this._currentModel.read(t);if(!n)return[];const r=n.asListOfDocumentSymbols().filter(o=>e.contains(o.range.startLineNumber)&&!e.contains(o.range.endLineNumber));return r.sort(npe(Jc(o=>o.range.endLineNumber-o.range.startLineNumber,dp))),r.map(o=>({name:o.name,kind:o.kind,startLineNumber:o.range.startLineNumber}))}};fj=Wut([Mle(1,_t),Mle(2,pT)],fj);wI.setBreadcrumbsSourceFactory((i,e)=>e.createInstance(fj,i));class gj extends fe{constructor(e){super(),this.editor=e,this.widget=null,ch&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(91);!this.widget&&e?this.widget=new _5(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}}gj.ID="editor.contrib.iPadShowKeyboard";class _5 extends fe{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(ye(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(ye(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return _5.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}}_5.ID="editor.contrib.ShowKeyboardWidget";jn(gj.ID,gj,3);var $ut=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Ale=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},pj;let cS=pj=class extends fe{static get(e){return e.getContribution(pj.ID)}constructor(e,t,n){super(),this._editor=e,this._languageService=n,this._widget=null,this._register(this._editor.onDidChangeModel(r=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(r=>this.stop())),this._register(hr.onDidChange(r=>this.stop())),this._register(this._editor.onKeyUp(r=>r.keyCode===9&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new b5(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}};cS.ID="editor.contrib.inspectTokens";cS=pj=$ut([Ale(1,Sc),Ale(2,ji)],cS);class Hut extends gt{constructor(){super({id:"editor.action.inspectTokens",label:wV.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){const n=cS.get(t);n==null||n.launch()}}function Vut(i){let e="";for(let t=0,n=i.length;tNw,tokenize:(r,o,s)=>zq(e,s),tokenizeEncoded:(r,o,s)=>T4(n,s)}}class b5 extends fe{constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=zut(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(n=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return b5._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let n=0;for(let l=t.tokens1.length-1;l>=0;l--){const c=t.tokens1[l];if(e.column-1>=c.offset){n=l;break}}let r=0;for(let l=t.tokens2.length>>>1;l>=0;l--)if(e.column-1>=t.tokens2[l<<1]){r=l;break}const o=this._model.getLineContent(e.lineNumber);let s="";if(n=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Ple=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},jL;let AO=jL=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=ar.as(_C.Quickaccess)}provide(e){const t=new Te;return t.add(e.onDidAccept(()=>{const[n]=e.selectedItems;n&&this.quickInputService.quickAccess.show(n.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(n=>{const r=this.registry.getQuickAccessProvider(n.substr(jL.PREFIX.length));r&&r.prefix&&r.prefix!==jL.PREFIX&&this.quickInputService.quickAccess.show(r.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(n=>n.prefix!==jL.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,n)=>t.prefix.localeCompare(n.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const n=t.prefix||e.prefix,r=n||"…";return{prefix:n,label:r,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:w("helpPickAriaLabel","{0}, {1}",r,t.description),description:t.description}})}};AO.PREFIX="?";AO=jL=Uut([Ple(0,Eh),Ple(1,ci)],AO);ar.as(_C.Quickaccess).registerQuickAccessProvider({ctor:AO,prefix:"",helpEntries:[{description:SV.helpQuickAccessActionLabel}]});class hye{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t){var n;const r=new Te;e.canAcceptInBackground=!!(!((n=this.options)===null||n===void 0)&&n.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const o=r.add(new Ho);return o.value=this.doProvide(e,t),r.add(this.onDidActiveTextEditorControlChange(()=>{o.value=void 0,o.value=this.doProvide(e,t)})),r}doProvide(e,t){var n;const r=new Te,o=this.activeTextEditorControl;if(o&&this.canProvideWithTextEditor(o)){const s={editor:o},a=nbe(o);if(a){let l=(n=o.saveViewState())!==null&&n!==void 0?n:void 0;r.add(a.onDidChangeCursorPosition(()=>{var c;l=(c=o.saveViewState())!==null&&c!==void 0?c:void 0})),s.restoreViewState=()=>{l&&o===this.activeTextEditorControl&&o.restoreViewState(l)},r.add(Vv(t.onCancellationRequested)(()=>{var c;return(c=s.restoreViewState)===null||c===void 0?void 0:c.call(s)}))}r.add(Rt(()=>this.clearDecorations(o))),r.add(this.provideWithTextEditor(s,e,t))}else r.add(this.provideWithoutTextEditor(e,t));return r}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const n=e.getModel();n&&"getLineContent"in n&&Hf(`${n.getLineContent(t.range.startLineNumber)}`)}getModel(e){var t;return EY(e)?(t=e.getModel())===null||t===void 0?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(n=>{const r=[];this.rangeHighlightDecorationId&&(r.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),r.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const o=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:fr(Cve),position:mc.Full}}}],[s,a]=n.deltaDecorations(r,o);this.rangeHighlightDecorationId={rangeHighlightId:s,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(n=>{n.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}class C5 extends hye{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=w("cannotRunGotoLine","Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,fe.None}provideWithTextEditor(e,t,n){const r=e.editor,o=new Te;o.add(t.onDidAccept(l=>{const[c]=t.selectedItems;if(c){if(!this.isValidLineNumber(r,c.lineNumber))return;this.gotoLocation(e,{range:this.toRange(c.lineNumber,c.column),keyMods:t.keyMods,preserveFocus:l.inBackground}),l.inBackground||t.hide()}}));const s=()=>{const l=this.parsePosition(r,t.value.trim().substr(C5.PREFIX.length)),c=this.getPickLabel(r,l.lineNumber,l.column);if(t.items=[{lineNumber:l.lineNumber,column:l.column,label:c}],t.ariaLabel=c,!this.isValidLineNumber(r,l.lineNumber)){this.clearDecorations(r);return}const u=this.toRange(l.lineNumber,l.column);r.revealRangeInCenter(u,0),this.addDecorations(r,u)};s(),o.add(t.onDidChangeValue(()=>s()));const a=nbe(r);return a&&a.getOptions().get(68).renderType===2&&(a.updateOptions({lineNumbers:"on"}),o.add(Rt(()=>a.updateOptions({lineNumbers:"relative"})))),o}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const n=t.split(/,|:|#/).map(o=>parseInt(o,10)).filter(o=>!isNaN(o)),r=this.lineCount(e)+1;return{lineNumber:n[0]>0?n[0]:r+n[0],column:n[1]}}getPickLabel(e,t,n){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,n)?w("gotoLineColumnLabel","Go to line {0} and character {1}.",t,n):w("gotoLineLabel","Go to line {0}.",t);const r=e.getPosition()||{lineNumber:1,column:1},o=this.lineCount(e);return o>1?w("gotoLineLabelEmptyWithLimit","Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",r.lineNumber,r.column,o):w("gotoLineLabelEmpty","Current Line: {0}, Character: {1}. Type a line number to navigate to.",r.lineNumber,r.column)}isValidLineNumber(e,t){return!t||typeof t!="number"?!1:t>0&&t<=this.lineCount(e)}isValidColumn(e,t,n){if(!n||typeof n!="number")return!1;const r=this.getModel(e);if(!r)return!1;const o={lineNumber:t,column:n};return r.validatePosition(o).equals(o)}lineCount(e){var t,n;return(n=(t=this.getModel(e))===null||t===void 0?void 0:t.getLineCount())!==null&&n!==void 0?n:0}}C5.PREFIX=":";var jut=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Kut=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let QI=class extends C5{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=Je.None}get activeTextEditorControl(){var e;return(e=this.editorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}};QI=jut([Kut(0,Un)],QI);let wZ=class fye extends gt{constructor(){super({id:fye.ID,label:TP.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:j.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(Eh).quickAccess.show(QI.PREFIX)}};wZ.ID="editor.action.gotoLine";Be(wZ);ar.as(_C.Quickaccess).registerQuickAccessProvider({ctor:QI,prefix:QI.PREFIX,helpEntries:[{description:TP.gotoLineActionLabel,commandId:wZ.ID}]});const gye=[void 0,[]];function G9(i,e,t=0,n=0){const r=e;return r.values&&r.values.length>1?Gut(i,r.values,t,n):pye(i,e,t,n)}function Gut(i,e,t,n){let r=0;const o=[];for(const s of e){const[a,l]=pye(i,s,t,n);if(typeof a!="number")return gye;r+=a,o.push(...l)}return[r,qut(o)]}function pye(i,e,t,n){const r=Ab(e.original,e.originalLowercase,t,i,i.toLowerCase(),n,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return r?[r[0],qk(r)]:gye}function qut(i){const e=i.sort((r,o)=>r.start-o.start),t=[];let n;for(const r of e)!n||!Xut(n,r)?(n=r,t.push(r)):(n.start=Math.min(n.start,r.start),n.end=Math.max(n.end,r.end));return t}function Xut(i,e){return!(i.end=0,s=Ole(i);let a;const l=i.split(mye);if(l.length>1)for(const c of l){const u=Ole(c),{pathNormalized:d,normalized:h,normalizedLowercase:f}=Fle(c);h&&(a||(a=[]),a.push({original:c,originalLowercase:c.toLowerCase(),pathNormalized:d,normalized:h,normalizedLowercase:f,expectContiguousMatch:u}))}return{original:i,originalLowercase:e,pathNormalized:t,normalized:n,normalizedLowercase:r,values:a,containsPathSeparator:o,expectContiguousMatch:s}}function Fle(i){let e;Rs?e=i.replace(/\//g,eh):e=i.replace(/\\/g,eh);const t=W5e(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function Ble(i){return Array.isArray(i)?mj(i.map(e=>e.original).join(mye)):mj(i.original)}var Yut=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Wle=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},iw;let Pf=iw=class extends hye{constructor(e,t,n=Object.create(null)){super(n),this._languageFeaturesService=e,this._outlineModelService=t,this.options=n,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,w("cannotRunGotoSymbolWithoutEditor","To go to a symbol, first open a text editor with symbol information.")),fe.None}provideWithTextEditor(e,t,n){const r=e.editor,o=this.getModel(r);return o?this._languageFeaturesService.documentSymbolProvider.has(o)?this.doProvideWithEditorSymbols(e,o,t,n):this.doProvideWithoutEditorSymbols(e,o,t,n):fe.None}doProvideWithoutEditorSymbols(e,t,n,r){const o=new Te;return this.provideLabelPick(n,w("cannotRunGotoSymbolWithoutSymbolProvider","The active text editor does not provide symbol information.")),(async()=>!await this.waitForLanguageSymbolRegistry(t,o)||r.isCancellationRequested||o.add(this.doProvideWithEditorSymbols(e,t,n,r)))(),o}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}async waitForLanguageSymbolRegistry(e,t){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const n=new a4,r=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(r.dispose(),n.complete(!0))}));return t.add(Rt(()=>n.complete(!1))),n.p}doProvideWithEditorSymbols(e,t,n,r){var o;const s=e.editor,a=new Te;a.add(n.onDidAccept(d=>{const[h]=n.selectedItems;h&&h.range&&(this.gotoLocation(e,{range:h.range.selection,keyMods:n.keyMods,preserveFocus:d.inBackground}),d.inBackground||n.hide())})),a.add(n.onDidTriggerItemButton(({item:d})=>{d&&d.range&&(this.gotoLocation(e,{range:d.range.selection,keyMods:n.keyMods,forceSideBySide:!0}),n.hide())}));const l=this.getDocumentSymbols(t,r);let c;const u=async d=>{c==null||c.dispose(!0),n.busy=!1,c=new wr(r),n.busy=!0;try{const h=mj(n.value.substr(iw.PREFIX.length).trim()),f=await this.doGetSymbolPicks(l,h,void 0,c.token);if(r.isCancellationRequested)return;if(f.length>0){if(n.items=f,d&&h.original.length===0){const g=RD(f,p=>!!(p.type!=="separator"&&p.range&&B.containsPosition(p.range.decoration,d)));g&&(n.activeItems=[g])}}else h.original.length>0?this.provideLabelPick(n,w("noMatchingSymbolResults","No matching editor symbols")):this.provideLabelPick(n,w("noSymbolResults","No editor symbols"))}finally{r.isCancellationRequested||(n.busy=!1)}};return a.add(n.onDidChangeValue(()=>u(void 0))),u((o=s.getSelection())===null||o===void 0?void 0:o.getPosition()),a.add(n.onDidChangeActive(()=>{const[d]=n.activeItems;d&&d.range&&(s.revealRangeInCenter(d.range.selection,0),this.addDecorations(s,d.range.decoration))})),a}async doGetSymbolPicks(e,t,n,r){var o,s;const a=await e;if(r.isCancellationRequested)return[];const l=t.original.indexOf(iw.SCOPE_PREFIX)===0,c=l?1:0;let u,d;t.values&&t.values.length>1?(u=Ble(t.values[0]),d=Ble(t.values.slice(1))):u=t;let h;const f=(s=(o=this.options)===null||o===void 0?void 0:o.openSideBySideDirection)===null||s===void 0?void 0:s.call(o);f&&(h=[{iconClass:f==="right"?Wt.asClassName(Xe.splitHorizontal):Wt.asClassName(Xe.splitVertical),tooltip:f==="right"?w("openToSide","Open to the Side"):w("openToBottom","Open to the Bottom")}]);const g=[];for(let m=0;mc){let N=!1;if(u!==t&&([D,k]=G9(S,{...t,values:void 0},c,L),typeof D=="number"&&(N=!0)),typeof D!="number"&&([D,k]=G9(S,u,c,L),typeof D!="number"))continue;if(!N&&d){if(E&&d.original.length>0&&([T,M]=G9(E,d)),typeof T!="number")continue;typeof D=="number"&&(D+=T)}}const A=_.tags&&_.tags.indexOf(1)>=0;g.push({index:m,kind:_.kind,score:D,label:S,ariaLabel:T5e(_.name,_.kind),description:E,highlights:A?void 0:{label:k,description:M},range:{selection:B.collapseToStart(_.selectionRange),decoration:_.range},strikethrough:A,buttons:h})}const p=g.sort((m,_)=>l?this.compareByKindAndScore(m,_):this.compareByScore(m,_));let v=[];if(l){let S=function(){_&&typeof m=="number"&&y>0&&(_.label=Eb(X9[m]||q9,y))},m,_,y=0;for(const L of p)m!==L.kind?(S(),m=L.kind,y=1,_={type:"separator"},v.push(_)):y++,v.push(L);S()}else p.length>0&&(v=[{label:w("symbols","symbols ({0})",g.length),type:"separator"},...p]);return v}compareByScore(e,t){if(typeof e.score!="number"&&typeof t.score=="number")return 1;if(typeof e.score=="number"&&typeof t.score!="number")return-1;if(typeof e.score=="number"&&typeof t.score=="number"){if(e.score>t.score)return-1;if(e.scoret.index?1:0}compareByKindAndScore(e,t){const n=X9[e.kind]||q9,r=X9[t.kind]||q9,o=n.localeCompare(r);return o===0?this.compareByScore(e,t):o}async getDocumentSymbols(e,t){const n=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:n.asListOfDocumentSymbols()}};Pf.PREFIX="@";Pf.SCOPE_PREFIX=":";Pf.PREFIX_BY_CATEGORY=`${iw.PREFIX}${iw.SCOPE_PREFIX}`;Pf=iw=Yut([Wle(0,_t),Wle(1,pT)],Pf);const q9=w("property","properties ({0})"),X9={[5]:w("method","methods ({0})"),[11]:w("function","functions ({0})"),[8]:w("_constructor","constructors ({0})"),[12]:w("variable","variables ({0})"),[4]:w("class","classes ({0})"),[22]:w("struct","structs ({0})"),[23]:w("event","events ({0})"),[24]:w("operator","operators ({0})"),[10]:w("interface","interfaces ({0})"),[2]:w("namespace","namespaces ({0})"),[3]:w("package","packages ({0})"),[25]:w("typeParameter","type parameters ({0})"),[1]:w("modules","modules ({0})"),[6]:w("property","properties ({0})"),[9]:w("enum","enumerations ({0})"),[21]:w("enumMember","enumeration members ({0})"),[14]:w("string","strings ({0})"),[0]:w("file","files ({0})"),[17]:w("array","arrays ({0})"),[15]:w("number","numbers ({0})"),[16]:w("boolean","booleans ({0})"),[18]:w("object","objects ({0})"),[19]:w("key","keys ({0})"),[7]:w("field","fields ({0})"),[13]:w("constant","constants ({0})")};var Zut=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Y9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let vj=class extends Pf{constructor(e,t,n){super(t,n),this.editorService=e,this.onDidActiveTextEditorControlChange=Je.None}get activeTextEditorControl(){var e;return(e=this.editorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}};vj=Zut([Y9(0,Un),Y9(1,_t),Y9(2,pT)],vj);class _T extends gt{constructor(){super({id:_T.ID,label:oI.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:j.hasDocumentSymbolProvider,kbOpts:{kbExpr:j.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(Eh).quickAccess.show(Pf.PREFIX,{itemActivation:Md.NONE})}}_T.ID="editor.action.quickOutline";Be(_T);ar.as(_C.Quickaccess).registerQuickAccessProvider({ctor:vj,prefix:Pf.PREFIX,helpEntries:[{description:oI.quickOutlineActionLabel,prefix:Pf.PREFIX,commandId:_T.ID},{description:oI.quickOutlineByCategoryActionLabel,prefix:Pf.PREFIX_BY_CATEGORY}]});function Z9(i,e){return e&&(i.stack||i.stacktrace)?w("stackTrace.format","{0}: {1}",Hle(i),$le(i.stack)||$le(i.stacktrace)):Hle(i)}function $le(i){return Array.isArray(i)?i.join(` -`):i}function Hle(i){return i.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${i.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof i.code=="string"&&typeof i.errno=="number"&&typeof i.syscall=="string"?w("nodeExceptionMessage","A system error occurred ({0})",i.message):i.message||w("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function vye(i=null,e=!1){if(!i)return w("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(i)){const t=lh(i),n=vye(t[0],e);return t.length>1?w("error.moreErrors","{0} ({1} errors in total)",n,t.length):n}if(Sa(i))return i;if(i.detail){const t=i.detail;if(t.error)return Z9(t.error,e);if(t.exception)return Z9(t.exception,e)}return i.stack?Z9(i,e):i.message?i.message:w("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function Qut(i){var e;const t=new Map;for(const n of i)t.set(n,((e=t.get(n))!==null&&e!==void 0?e:0)+1);return t}class $E{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const n=this.computeEmbedding(e),r=new Map,o=[];for(const[s,a]of this.documents){if(t.isCancellationRequested)return[];for(const l of a.chunks){const c=this.computeSimilarityScore(l,n,r);c>0&&o.push({key:s,score:c})}}return o}static termFrequencies(e){return Qut($E.splitTerms(e))}static*splitTerms(e){const t=n=>n.toLowerCase();for(const[n]of e.matchAll(/\b\p{Letter}[\p{Letter}\d]{2,}\b/gu)){yield t(n);const r=n.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(r.length>1)for(const o of r)o.length>2&&/\p{Letter}{3,}/gu.test(o)&&(yield t(o))}}updateDocuments(e){var t;for(const{key:n}of e)this.deleteDocument(n);for(const n of e){const r=[];for(const o of n.textChunks){const s=$E.termFrequencies(o);for(const a of s.keys())this.chunkOccurrences.set(a,((t=this.chunkOccurrences.get(a))!==null&&t!==void 0?t:0)+1);r.push({text:o,tf:s})}this.chunkCount+=r.length,this.documents.set(n.key,{chunks:r})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const n of t.chunks)for(const r of n.tf.keys()){const o=this.chunkOccurrences.get(r);if(typeof o=="number"){const s=o-1;s<=0?this.chunkOccurrences.delete(r):this.chunkOccurrences.set(r,s)}}}}computeSimilarityScore(e,t,n){let r=0;for(const[o,s]of Object.entries(t)){const a=e.tf.get(o);if(!a)continue;let l=n.get(o);typeof l!="number"&&(l=this.computeIdf(o),n.set(o,l));const c=a*l;r+=c*s}return r}computeEmbedding(e){const t=$E.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){var t;const n=(t=this.chunkOccurrences.get(e))!==null&&t!==void 0?t:0;return n>0?Math.log((this.chunkCount+1)/n):0}computeTfidf(e){const t=Object.create(null);for(const[n,r]of e){const o=this.computeIdf(n);o>0&&(t[n]=r*o)}return t}}function Jut(i){var e,t;const n=i.slice(0);n.sort((o,s)=>s.score-o.score);const r=(t=(e=n[0])===null||e===void 0?void 0:e.score)!==null&&t!==void 0?t:0;if(r>0)for(const o of n)o.score/=r;return n}var yy;(function(i){i[i.NO_ACTION=0]="NO_ACTION",i[i.CLOSE_PICKER=1]="CLOSE_PICKER",i[i.REFRESH_PICKER=2]="REFRESH_PICKER",i[i.REMOVE_ITEM=3]="REMOVE_ITEM"})(yy||(yy={}));function Q9(i){const e=i;return Array.isArray(e.items)}function Vle(i){const e=i;return!!e.picks&&e.additionalPicks instanceof Promise}class edt extends fe{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,n){var r;const o=new Te;e.canAcceptInBackground=!!(!((r=this.options)===null||r===void 0)&&r.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let s;const a=o.add(new Ho),l=async()=>{var c;const u=a.value=new Te;s==null||s.dispose(!0),e.busy=!1,s=new wr(t);const d=s.token;let h=e.value.substring(this.prefix.length);!((c=this.options)===null||c===void 0)&&c.shouldSkipTrimPickFilter||(h=h.trim());const f=this._getPicks(h,u,d,n),g=(v,m)=>{var _;let y,S;if(Q9(v)?(y=v.items,S=v.active):y=v,y.length===0){if(m)return!1;(h.length>0||e.hideInput)&&(!((_=this.options)===null||_===void 0)&&_.noResultsPick)&&(CD(this.options.noResultsPick)?y=[this.options.noResultsPick(h)]:y=[this.options.noResultsPick])}return e.items=y,S&&(e.activeItems=[S]),!0},p=async v=>{let m=!1,_=!1;await Promise.all([(async()=>{typeof v.mergeDelay=="number"&&(await jv(v.mergeDelay),d.isCancellationRequested)||_||(m=g(v.picks,!0))})(),(async()=>{e.busy=!0;try{const y=await v.additionalPicks;if(d.isCancellationRequested)return;let S,L;Q9(v.picks)?(S=v.picks.items,L=v.picks.active):S=v.picks;let E,D;if(Q9(y)?(E=y.items,D=y.active):E=y,E.length>0||!m){let k;if(!L&&!D){const T=e.activeItems[0];T&&S.indexOf(T)!==-1&&(k=T)}g({items:[...S,...E],active:L||D||k})}}finally{d.isCancellationRequested||(e.busy=!1),_=!0}})()])};if(f!==null)if(Vle(f))await p(f);else if(!(f instanceof Promise))g(f);else{e.busy=!0;try{const v=await f;if(d.isCancellationRequested)return;Vle(v)?await p(v):g(v)}finally{d.isCancellationRequested||(e.busy=!1)}}};return o.add(e.onDidChangeValue(()=>l())),l(),o.add(e.onDidAccept(c=>{const[u]=e.selectedItems;typeof(u==null?void 0:u.accept)=="function"&&(c.inBackground||e.hide(),u.accept(e.keyMods,c))})),o.add(e.onDidTriggerItemButton(async({button:c,item:u})=>{var d,h;if(typeof u.trigger=="function"){const f=(h=(d=u.buttons)===null||d===void 0?void 0:d.indexOf(c))!==null&&h!==void 0?h:-1;if(f>=0){const g=u.trigger(f,e.keyMods),p=typeof g=="number"?g:await g;if(t.isCancellationRequested)return;switch(p){case yy.NO_ACTION:break;case yy.CLOSE_PICKER:e.hide();break;case yy.REFRESH_PICKER:l();break;case yy.REMOVE_ITEM:{const v=e.items.indexOf(u);if(v!==-1){const m=e.items.slice(),_=m.splice(v,1),y=e.activeItems.filter(L=>L!==_[0]),S=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=m,y&&(e.activeItems=y),e.keepScrollPosition=S}break}}}}})),o}}var _ye=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},R0=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},_0,to;let eC=_0=class extends edt{constructor(e,t,n,r,o,s){super(_0.PREFIX,e),this.instantiationService=t,this.keybindingService=n,this.commandService=r,this.telemetryService=o,this.dialogService=s,this.commandsHistory=this._register(this.instantiationService.createInstance(m_)),this.options=e}async _getPicks(e,t,n,r){var o,s,a,l;const c=await this.getCommandPicks(n);if(n.isCancellationRequested)return[];const u=Vv(()=>{const m=new $E;m.updateDocuments(c.map(y=>({key:y.commandId,textChunks:[this.getTfIdfChunk(y)]})));const _=m.calculateScores(e,n);return Jut(_).filter(y=>y.score>_0.TFIDF_THRESHOLD).slice(0,_0.TFIDF_MAX_RESULTS)}),d=[];for(const m of c){const _=(o=_0.WORD_FILTER(e,m.label))!==null&&o!==void 0?o:void 0,y=m.commandAlias&&(s=_0.WORD_FILTER(e,m.commandAlias))!==null&&s!==void 0?s:void 0;if(_||y)m.highlights={label:_,detail:this.options.showAlias?y:void 0},d.push(m);else if(e===m.commandId)d.push(m);else if(e.length>=3){const S=u();if(n.isCancellationRequested)return[];const L=S.find(E=>E.key===m.commandId);L&&(m.tfIdfScore=L.score,d.push(m))}}const h=new Map;for(const m of d){const _=h.get(m.label);_?(m.description=m.commandId,_.description=_.commandId):h.set(m.label,m)}d.sort((m,_)=>{if(m.tfIdfScore&&_.tfIdfScore)return m.tfIdfScore===_.tfIdfScore?m.label.localeCompare(_.label):_.tfIdfScore-m.tfIdfScore;if(m.tfIdfScore)return 1;if(_.tfIdfScore)return-1;const y=this.commandsHistory.peek(m.commandId),S=this.commandsHistory.peek(_.commandId);if(y&&S)return y>S?-1:1;if(y)return-1;if(S)return 1;if(this.options.suggestedCommandIds){const L=this.options.suggestedCommandIds.has(m.commandId),E=this.options.suggestedCommandIds.has(_.commandId);if(L&&E)return 0;if(L)return-1;if(E)return 1}return m.label.localeCompare(_.label)});const f=[];let g=!1,p=!0,v=!!this.options.suggestedCommandIds;for(let m=0;m{var m;const _=await this.getAdditionalCommandPicks(c,d,e,n);if(n.isCancellationRequested)return[];const y=_.map(S=>this.toCommandPick(S,r));return p&&((m=y[0])===null||m===void 0?void 0:m.type)!=="separator"&&y.unshift({type:"separator",label:w("suggested","similar commands")}),y})()}:f}toCommandPick(e,t){if(e.type==="separator")return e;const n=this.keybindingService.lookupKeybinding(e.commandId),r=n?w("commandPickAriaLabelWithKeybinding","{0}, {1}",e.label,n.getAriaLabel()):e.label;return{...e,ariaLabel:r,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:n,accept:async()=>{var o,s;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:(o=t==null?void 0:t.from)!==null&&o!==void 0?o:"quick open"});try{!((s=e.args)===null||s===void 0)&&s.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(a){wh(a)||this.dialogService.error(w("canNotRun","Command '{0}' resulted in an error",e.label),vye(a))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:n}){let r=e;return t&&t!==e&&(r+=` - ${t}`),n&&n.value!==e&&(r+=` - ${n.value===n.original?n.value:`${n.value} (${n.original})`}`),r}};eC.PREFIX=">";eC.TFIDF_THRESHOLD=.5;eC.TFIDF_MAX_RESULTS=5;eC.WORD_FILTER=RX(iI,fKe,x_e);eC=_0=_ye([R0(1,Ot),R0(2,ci),R0(3,sr),R0(4,ea),R0(5,Gk)],eC);let m_=to=class extends fe{constructor(e,t){super(),this.storageService=e,this.configurationService=t,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e))),this._register(this.storageService.onWillSaveState(e=>{e.reason===cI.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=to.getConfiguredCommandHistoryLength(this.configurationService),to.cache&&to.cache.limit!==this.configuredCommandsHistoryLength&&(to.cache.limit=this.configuredCommandsHistoryLength,to.hasChanges=!0))}load(){const e=this.storageService.get(to.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch{}const n=to.cache=new D_(this.configuredCommandsHistoryLength,1);if(t){let r;t.usesLRU?r=t.entries:r=t.entries.sort((o,s)=>o.value-s.value),r.forEach(o=>n.set(o.key,o.value))}to.counter=this.storageService.getNumber(to.PREF_KEY_COUNTER,0,to.counter)}push(e){to.cache&&(to.cache.set(e,to.counter++),to.hasChanges=!0)}peek(e){var t;return(t=to.cache)===null||t===void 0?void 0:t.peek(e)}saveState(){if(!to.cache||!to.hasChanges)return;const e={usesLRU:!0,entries:[]};to.cache.forEach((t,n)=>e.entries.push({key:n,value:t})),this.storageService.store(to.PREF_KEY_CACHE,JSON.stringify(e),0,0),this.storageService.store(to.PREF_KEY_COUNTER,to.counter,0,0),to.hasChanges=!1}static getConfiguredCommandHistoryLength(e){var t,n;const o=(n=(t=e.getValue().workbench)===null||t===void 0?void 0:t.commandPalette)===null||n===void 0?void 0:n.history;return typeof o=="number"?o:to.DEFAULT_COMMANDS_HISTORY_LENGTH}};m_.DEFAULT_COMMANDS_HISTORY_LENGTH=50;m_.PREF_KEY_CACHE="commandPalette.mru.cache";m_.PREF_KEY_COUNTER="commandPalette.mru.counter";m_.counter=1;m_.hasChanges=!1;m_=to=_ye([R0(0,dd),R0(1,gn)],m_);class tdt extends eC{constructor(e,t,n,r,o,s){super(e,t,n,r,o,s)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const n of e.getSupportedActions())t.push({commandId:n.id,commandAlias:n.alias,label:BX(n.label)||n.id});return t}}var ndt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},u1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let JI=class extends tdt{get activeTextEditorControl(){var e;return(e=this.codeEditorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}constructor(e,t,n,r,o,s){super({showAlias:!1},e,n,r,o,s),this.codeEditorService=t}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}};JI=ndt([u1(0,Ot),u1(1,Un),u1(2,ci),u1(3,sr),u1(4,ea),u1(5,Gk)],JI);class bT extends gt{constructor(){super({id:bT.ID,label:NP.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:j.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(Eh).quickAccess.show(JI.PREFIX)}}bT.ID="editor.action.quickCommand";Be(bT);ar.as(_C.Quickaccess).registerQuickAccessProvider({ctor:JI,prefix:JI.PREFIX,helpEntries:[{description:NP.quickCommandHelp,commandId:bT.ID}]});var idt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},d1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let _j=class extends l_{constructor(e,t,n,r,o,s,a){super(!0,e,t,n,r,o,s,a)}};_j=idt([d1(1,Vt),d1(2,Un),d1(3,$r),d1(4,Ot),d1(5,dd),d1(6,gn)],_j);jn(l_.ID,_j,4);class rdt extends gt{constructor(){super({id:"editor.action.toggleHighContrast",label:xV.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const n=e.get(Sc),r=n.getColorTheme();ih(r.type)?(n.setTheme(this._originalThemeName||(Pw(r.type)?Zy:zg)),this._originalThemeName=null):(n.setTheme(Pw(r.type)?lb:cb),this._originalThemeName=r.themeName)}}Be(rdt);const odt=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:sbe,Emitter:DY,KeyCode:abe,KeyMod:lbe,MarkerSeverity:fbe,MarkerTag:gbe,Position:cbe,Range:ube,Selection:dbe,SelectionDirection:hbe,Token:mbe,Uri:pbe,editor:vbe,languages:sT},Symbol.toStringTag,{value:"Module"}));function sdt(){return new Worker("/ir-virtual-machine/assets/editor.worker-3daf6cbf.js")}function adt(){return new Worker("/ir-virtual-machine/assets/json.worker-4a7a65e0.js")}function ldt(){return new Worker("/ir-virtual-machine/assets/css.worker-4b5427ce.js")}function cdt(){return new Worker("/ir-virtual-machine/assets/html.worker-85cb56ae.js")}function udt(){return new Worker("/ir-virtual-machine/assets/ts.worker-3bc0f4a5.js")}const ddt="_main_buuwy_1",hdt="_divRight_buuwy_7",fdt="_divVmWrapper_buuwy_14",gdt="_divVmContentBase_buuwy_20",pdt="_divVmContentVertical_buuwy_20",mdt="_divVmContentHorizontal_buuwy_20",oL={main:ddt,divRight:hdt,divVmWrapper:fdt,divVmContentBase:gdt,divVmContentVertical:pdt,divVmContentHorizontal:mdt},vdt="_asideSideBarWrapper_chse2_1",_dt="_divIconWrapperBase_chse2_11",bdt="_divIconWrapperLower_chse2_11",Cdt="_divIconWrapperUpper_chse2_11",ydt="_articleAbout_chse2_25",wdt="_aDemoSources_chse2_43",Sdt="_menuDemos_chse2_47",h1={asideSideBarWrapper:vdt,divIconWrapperBase:_dt,divIconWrapperLower:bdt,divIconWrapperUpper:Cdt,articleAbout:ydt,aDemoSources:wdt,menuDemos:Sdt};var xdt=C.createContext({});const SZ=xdt;function zn(i){return zn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zn(i)}function Ldt(i,e){if(zn(i)!=="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(zn(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function bye(i){var e=Ldt(i,"string");return zn(e)==="symbol"?e:String(e)}function be(i,e,t){return e=bye(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function zle(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,n)}return t}function te(i){for(var e=1;ei.length)&&(e=i.length);for(var t=0,n=new Array(e);ty.provideNewSymbolNames(c,a.range,u.token));n(`requested new symbol names from ${d.length} providers`);const f=this.editor.getSelection();let g=0,p=a.text.length;!B.isEmpty(f)&&!B.spansMultipleLines(f)&&B.containsRange(a.range,f)&&(g=Math.max(0,f.startColumn-a.range.startColumn),p=Math.min(a.range.endColumn,f.endColumn)-a.range.startColumn),n("creating rename input field and awaiting its result");const v=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),m=await this._renameInputField.getInput(a.range,a.text,g,p,v,h,u);if(n("received response from rename input field"),d.length>0&&this._reportTelemetry(d.length,c.getLanguageId(),m),typeof m=="boolean"){n(`returning early - rename input field response - ${m}`),m&&this.editor.focus(),l.dispose();return}this.editor.focus(),n("requesting rename edits");const _=Rk(o.provideRenameEdits(m.newName,l.token),l.token).then(async y=>{if(!y){n("returning early - no rename edits result");return}if(!this.editor.hasModel()){n("returning early - no model after rename edits are provided");return}if(y.rejectReason){n(`returning early - rejected with reason: ${y.rejectReason}`),this._notificationService.info(y.rejectReason);return}this.editor.setSelection(B.fromPositions(this.editor.getSelection().getPosition())),n("applying edits"),this._bulkEditService.apply(y,{editor:this.editor,showPreview:m.wantsPreview,label:w("label","Renaming '{0}' to '{1}'",a==null?void 0:a.text,m.newName),code:"undoredo.rename",quotableLabel:w("quotableLabel","Renaming {0} to {1}",a==null?void 0:a.text,m.newName),respectAutoSaveConfig:!0}).then(S=>{n("edits applied"),S.ariaSummary&&kl(w("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",a.text,m.newName,S.ariaSummary))}).catch(S=>{n(`error when applying edits ${JSON.stringify(S,null," ")}`),this._notificationService.error(w("rename.failedApply","Rename failed to apply edits")),this._logService.error(S)})},y=>{n("error when providing rename edits",JSON.stringify(y,null," ")),this._notificationService.error(w("rename.failed","Rename failed to compute edits")),this._logService.error(y)}).finally(()=>{l.dispose()});return n("returning rename operation"),this._progressService.showWhile(_,250),_}acceptRenameInput(e){this._renameInputField.acceptInput(e)}cancelRenameInput(){this._renameInputField.cancelInput(!0,"cancelRenameInput command")}focusNextRenameSuggestion(){this._renameInputField.focusNextRenameSuggestion()}focusPreviousRenameSuggestion(){this._renameInputField.focusPreviousRenameSuggestion()}_reportTelemetry(e,t,n){const r=typeof n=="boolean"?{kind:"cancelled",languageId:t,nRenameSuggestionProviders:e}:{kind:"accepted",languageId:t,nRenameSuggestionProviders:e,source:n.source,nRenameSuggestions:n.nRenameSuggestions,wantsPreview:n.wantsPreview};this._telemetryService.publicLog2("renameInvokedEvent",r)}};Mp.ID="editor.contrib.renameController";Mp=qU=act([dm(1,Ot),dm(2,$r),dm(3,Xk),dm(4,k_),dm(5,Ta),dm(6,Hq),dm(7,_t),dm(8,ea)],Mp);class cct extends gt{constructor(){super({id:"editor.action.rename",label:w("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:De.and(j.writable,j.hasRenameProvider),kbOpts:{kbExpr:j.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const n=e.get(Un),[r,o]=Array.isArray(t)&&t||[void 0,void 0];return At.isUri(r)&&ae.isIPosition(o)?n.openCodeEditor({resource:r},n.getActiveCodeEditor()).then(s=>{s&&(s.setPosition(o),s.invokeWithinContext(a=>(this.reportTelemetry(a,s),this.run(a,s))))},en):super.runCommand(e,t)}run(e,t){const n=e.get(Ta),r=Mp.get(t);return r?(n.trace("[RenameAction] got controller, running..."),r.run()):(n.trace("[RenameAction] returning early - controller missing"),Promise.resolve())}}jn(Mp.ID,Mp,4);Be(cct);const gZ=Vo.bindToContribution(Mp.get);et(new gZ({id:"acceptRenameInput",precondition:KS,handler:i=>i.acceptRenameInput(!1),kbOpts:{weight:100+99,kbExpr:De.and(j.focus,De.not("isComposing")),primary:3}}));et(new gZ({id:"acceptRenameInputWithPreview",precondition:De.and(KS,De.has("config.editor.rename.enablePreview")),handler:i=>i.acceptRenameInput(!0),kbOpts:{weight:100+99,kbExpr:De.and(j.focus,De.not("isComposing")),primary:1024+3}}));et(new gZ({id:"cancelRenameInput",precondition:KS,handler:i=>i.cancelRenameInput(),kbOpts:{weight:100+99,kbExpr:j.focus,primary:9,secondary:[1033]}}));Ei(class extends sl{constructor(){super({id:"focusNextRenameSuggestion",title:{...$n("focusNextRenameSuggestion","Focus Next Rename Suggestion")},precondition:KS,keybinding:[{primary:2,secondary:[18],weight:100+99}]})}run(e){const t=e.get(Un).getFocusedCodeEditor();if(!t)return;const n=Mp.get(t);n&&n.focusNextRenameSuggestion()}});Ei(class extends sl{constructor(){super({id:"focusPreviousRenameSuggestion",title:{...$n("focusPreviousRenameSuggestion","Focus Previous Rename Suggestion")},precondition:KS,keybinding:[{when:KU,primary:6,weight:100+99},{when:KU.toNegated(),primary:1026,secondary:[16],weight:100+99}]})}run(e){const t=e.get(Un).getFocusedCodeEditor();if(!t)return;const n=Mp.get(t);n&&n.focusPreviousRenameSuggestion()}});tg("_executeDocumentRenameProvider",function(i,e,t,...n){const[r]=n;Xn(typeof r=="string");const{renameProvider:o}=i.get(_t);return lct(o,e,t,r)});tg("_executePrepareRename",async function(i,e,t){const{renameProvider:n}=i.get(_t),o=await new fZ(e,t,n).resolveRenameLocation(Cn.None);if(o!=null&&o.rejectReason)throw new Error(o.rejectReason);return o});ar.as(xh.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:w("enablePreview","Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});function uct(i){for(let e=0,t=i.length;e0?t[0]:[]}async function K1e(i,e,t,n,r){const o=gct(i,e),s=await Promise.all(o.map(async a=>{let l,c=null;try{l=await a.provideDocumentSemanticTokens(e,a===t?n:null,r)}catch(u){c=u,l=null}return(!l||!d5(l)&&!U1e(l))&&(l=null),new fct(a,l,c)}));for(const a of s){if(a.error)throw a.error;if(a.tokens)return a}return s.length>0?s[0]:null}function pct(i,e){const t=i.orderedGroups(e);return t.length>0?t[0]:null}class mct{constructor(e,t){this.provider=e,this.tokens=t}}function vct(i,e){return i.has(e)}function G1e(i,e){const t=i.orderedGroups(e);return t.length>0?t[0]:[]}async function pZ(i,e,t,n){const r=G1e(i,e),o=await Promise.all(r.map(async s=>{let a;try{a=await s.provideDocumentRangeSemanticTokens(e,t,n)}catch(l){Zr(l),a=null}return(!a||!d5(a))&&(a=null),new mct(s,a)}));for(const s of o)if(s.tokens)return s;return o.length>0?o[0]:null}Dn.registerCommand("_provideDocumentSemanticTokensLegend",async(i,...e)=>{const[t]=e;Xn(t instanceof At);const n=i.get(tr).getModel(t);if(!n)return;const{documentSemanticTokensProvider:r}=i.get(_t),o=pct(r,n);return o?o[0].getLegend():i.get(sr).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)});Dn.registerCommand("_provideDocumentSemanticTokens",async(i,...e)=>{const[t]=e;Xn(t instanceof At);const n=i.get(tr).getModel(t);if(!n)return;const{documentSemanticTokensProvider:r}=i.get(_t);if(!j1e(r,n))return i.get(sr).executeCommand("_provideDocumentRangeSemanticTokens",t,n.getFullModelRange());const o=await K1e(r,n,null,null,Cn.None);if(!o)return;const{provider:s,tokens:a}=o;if(!a||!d5(a))return;const l=z1e({id:0,type:"full",data:a.data});return a.resultId&&s.releaseDocumentSemanticTokens(a.resultId),l});Dn.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(i,...e)=>{const[t,n]=e;Xn(t instanceof At);const r=i.get(tr).getModel(t);if(!r)return;const{documentRangeSemanticTokensProvider:o}=i.get(_t),s=G1e(o,r);if(s.length===0)return;if(s.length===1)return s[0].getLegend();if(!n||!B.isIRange(n))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),s[0].getLegend();const a=await pZ(o,r,B.lift(n),Cn.None);if(a)return a.provider.getLegend()});Dn.registerCommand("_provideDocumentRangeSemanticTokens",async(i,...e)=>{const[t,n]=e;Xn(t instanceof At),Xn(B.isIRange(n));const r=i.get(tr).getModel(t);if(!r)return;const{documentRangeSemanticTokensProvider:o}=i.get(_t),s=await pZ(o,r,B.lift(n),Cn.None);if(!(!s||!s.tokens))return z1e({id:0,type:"full",data:s.tokens.data})});const mZ="editor.semanticHighlighting";function UM(i,e,t){var n;const r=(n=t.getValue(mZ,{overrideIdentifier:i.getLanguageId(),resource:i.uri}))===null||n===void 0?void 0:n.enabled;return typeof r=="boolean"?r:e.getColorTheme().semanticHighlighting}var q1e=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},af=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Sm;let XU=class extends fe{constructor(e,t,n,r,o,s){super(),this._watchers=Object.create(null);const a=u=>{this._watchers[u.uri.toString()]=new GI(u,e,n,o,s)},l=(u,d)=>{d.dispose(),delete this._watchers[u.uri.toString()]},c=()=>{for(const u of t.getModels()){const d=this._watchers[u.uri.toString()];UM(u,n,r)?d||a(u):d&&l(u,d)}};t.getModels().forEach(u=>{UM(u,n,r)&&a(u)}),this._register(t.onModelAdded(u=>{UM(u,n,r)&&a(u)})),this._register(t.onModelRemoved(u=>{const d=this._watchers[u.uri.toString()];d&&l(u,d)})),this._register(r.onDidChangeConfiguration(u=>{u.affectsConfiguration(mZ)&&c()})),this._register(n.onDidColorThemeChange(c))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};XU=q1e([af(0,K4),af(1,tr),af(2,To),af(3,gn),af(4,gu),af(5,_t)],XU);let GI=Sm=class extends fe{constructor(e,t,n,r,o){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=o.documentSemanticTokensProvider,this._debounceInformation=r.for(this._provider,"DocumentSemanticTokens",{min:Sm.REQUEST_MIN_DELAY,max:Sm.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new pi(()=>this._fetchDocumentSemanticTokensNow(),Sm.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._providersChangedDuringRequest=!1,this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeAttached(()=>{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 s=()=>{si(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const a of this._provider.all(e))typeof a.onDidChange=="function"&&this._documentProvidersChangeListeners.push(a.onDidChange(()=>{if(this._currentDocumentRequestCancellationTokenSource){this._providersChangedDuringRequest=!0;return}this._fetchDocumentSemanticTokens.schedule(0)}))};s(),this._register(this._provider.onDidChange(()=>{s(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(n.onDidColorThemeChange(a=>{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),si(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!j1e(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new wr,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,n=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,r=K1e(this._provider,this._model,t,n,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const o=[],s=this._model.onDidChangeContent(l=>{o.push(l)}),a=new Ms(!1);r.then(l=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),!l)this._setDocumentSemanticTokens(null,null,null,o);else{const{provider:c,tokens:u}=l,d=this._semanticTokensStylingService.getStyling(c);this._setDocumentSemanticTokens(c,u||null,d,o)}},l=>{l&&(wh(l)||typeof l.message=="string"&&l.message.indexOf("busy")!==-1)||en(l),this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),(o.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,n,r,o){o=Math.min(o,n.length-r,e.length-t);for(let s=0;s{(r.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed){e&&t&&e.releaseDocumentSemanticTokens(t.resultId);return}if(!e||!n){this._model.tokenization.setSemanticTokens(null,!1);return}if(!t){this._model.tokenization.setSemanticTokens(null,!0),s();return}if(U1e(t)){if(!o){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:o.data};else{let a=0;for(const h of t.edits)a+=(h.data?h.data.length:0)-h.deleteCount;const l=o.data,c=new Uint32Array(l.length+a);let u=l.length,d=c.length;for(let h=t.edits.length-1;h>=0;h--){const f=t.edits[h];if(f.start>l.length){n.warnInvalidEditStart(o.resultId,t.resultId,h,f.start,l.length),this._model.tokenization.setSemanticTokens(null,!0);return}const g=u-(f.start+f.deleteCount);g>0&&(Sm._copy(l,u-g,c,d-g,g),d-=g),f.data&&(Sm._copy(f.data,0,c,d-f.data.length,f.data.length),d-=f.data.length),u=f.start}u>0&&Sm._copy(l,0,c,0,u),t={resultId:t.resultId,data:c}}}if(d5(t)){this._currentDocumentResponse=new _ct(e,t.resultId,t.data);const a=m_e(t,n,this._model.getLanguageId());if(r.length>0)for(const l of r)for(const c of a)for(const u of l.changes)c.applyEdit(u.range,u.text);this._model.tokenization.setSemanticTokens(a,!0)}else this._model.tokenization.setSemanticTokens(null,!0);s()}};GI.REQUEST_MIN_DELAY=300;GI.REQUEST_MAX_DELAY=2e3;GI=Sm=q1e([af(1,K4),af(2,To),af(3,gu),af(4,_t)],GI);class _ct{constructor(e,t,n){this.provider=e,this.resultId=t,this.data=n}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}nT(XU);var bct=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},rL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let qI=class extends fe{constructor(e,t,n,r,o,s){super(),this._semanticTokensStylingService=t,this._themeService=n,this._configurationService=r,this._editor=e,this._provider=s.documentRangeSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new pi(()=>this._tokenizeViewportNow(),100)),this._outstandingRequests=[];const a=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))};this._register(this._editor.onDidScrollChange(()=>{a()})),this._register(this._editor.onDidChangeModel(()=>{this._cancelAll(),a()})),this._register(this._editor.onDidChangeModelContent(l=>{this._cancelAll(),a()})),this._register(this._provider.onDidChange(()=>{this._cancelAll(),a()})),this._register(this._configurationService.onDidChangeConfiguration(l=>{l.affectsConfiguration(mZ)&&(this._cancelAll(),a())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),a()})),a()}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,n=this._outstandingRequests.length;tthis._requestRange(e,n)))}_requestRange(e,t){const n=e.getVersionId(),r=Io(s=>Promise.resolve(pZ(this._provider,e,t,s))),o=new Ms(!1);return r.then(s=>{if(this._debounceInformation.update(e,o.elapsed()),!s||!s.tokens||e.isDisposed()||e.getVersionId()!==n)return;const{provider:a,tokens:l}=s,c=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,m_e(l,c,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(r),()=>this._removeOutstandingRequest(r)),r}};qI.ID="editor.contrib.viewportSemanticTokens";qI=bct([rL(1,K4),rL(2,To),rL(3,gn),rL(4,gu),rL(5,_t)],qI);jn(qI.ID,qI,1);class Cct{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const n=[];for(const r of t){const o=[];n.push(o),this.selectSubwords&&this._addInWordRanges(o,e,r),this._addWordRanges(o,e,r),this._addWhitespaceLine(o,e,r),o.push({range:e.getFullModelRange()})}return n}_addInWordRanges(e,t,n){const r=t.getWordAtPosition(n);if(!r)return;const{word:o,startColumn:s}=r,a=n.column-s;let l=a,c=a,u=0;for(;l>=0;l--){const d=o.charCodeAt(l);if(l!==a&&(d===95||d===45))break;if(Um(d)&&nf(u))break;u=d}for(l+=1;c0&&t.getLineFirstNonWhitespaceColumn(n.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(n.lineNumber)===0&&e.push({range:new B(n.lineNumber,1,n.lineNumber,t.getLineMaxColumn(n.lineNumber))})}}var yct=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},wct=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},YU;class vZ{constructor(e,t){this.index=e,this.ranges=t}mov(e){const t=this.index+(e?1:-1);if(t<0||t>=this.ranges.length)return this;const n=new vZ(t,this.ranges);return n.ranges[t].equalsRange(this.ranges[this.index])?n.mov(e):n}}let aS=YU=class{static get(e){return e.getContribution(YU.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){var e;(e=this._selectionListener)===null||e===void 0||e.dispose()}async run(e){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),n=this._editor.getModel();if(this._state||await Y1e(this._languageFeaturesService.selectionRangeProvider,n,t.map(o=>o.getPosition()),this._editor.getOption(113),Cn.None).then(o=>{var s;if(!(!Ts(o)||o.length!==t.length)&&!(!this._editor.hasModel()||!or(this._editor.getSelections(),t,(a,l)=>a.equalsSelection(l)))){for(let a=0;al.containsPosition(t[a].getStartPosition())&&l.containsPosition(t[a].getEndPosition())),o[a].unshift(t[a]);this._state=o.map(a=>new vZ(0,a)),(s=this._selectionListener)===null||s===void 0||s.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{var a;this._ignoreSelection||((a=this._selectionListener)===null||a===void 0||a.dispose(),this._state=void 0)})}}),!this._state)return;this._state=this._state.map(o=>o.mov(e));const r=this._state.map(o=>yt.fromPositions(o.ranges[o.index].getStartPosition(),o.ranges[o.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(r)}finally{this._ignoreSelection=!1}}};aS.ID="editor.contrib.smartSelectController";aS=YU=yct([wct(1,_t)],aS);class X1e extends gt{constructor(e,t){super(t),this._forward=e}async run(e,t){const n=aS.get(t);n&&await n.run(this._forward)}}class Sct extends X1e{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:w("smartSelect.expand","Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:j.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:$.MenubarSelectionMenu,group:"1_basic",title:w({key:"miSmartSelectGrow",comment:["&& denotes a mnemonic"]},"&&Expand Selection"),order:2}})}}Dn.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class xct extends X1e{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:w("smartSelect.shrink","Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:j.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:$.MenubarSelectionMenu,group:"1_basic",title:w({key:"miSmartSelectShrink",comment:["&& denotes a mnemonic"]},"&&Shrink Selection"),order:3}})}}jn(aS.ID,aS,4);Be(Sct);Be(xct);async function Y1e(i,e,t,n,r){const o=i.all(e).concat(new Cct(n.selectSubwords));o.length===1&&o.unshift(new Xl);const s=[],a=[];for(const l of o)s.push(Promise.resolve(l.provideSelectionRanges(e,t,r)).then(c=>{if(Ts(c)&&c.length===t.length)for(let u=0;u{if(l.length===0)return[];l.sort((h,f)=>ae.isBefore(h.getStartPosition(),f.getStartPosition())?1:ae.isBefore(f.getStartPosition(),h.getStartPosition())||ae.isBefore(h.getEndPosition(),f.getEndPosition())?-1:ae.isBefore(f.getEndPosition(),h.getEndPosition())?1:0);const c=[];let u;for(const h of l)(!u||B.containsRange(h,u)&&!B.equalsRange(h,u))&&(c.push(h),u=h);if(!n.selectLeadingAndTrailingWhitespace)return c;const d=[c[0]];for(let h=1;hi}),j9="data-sticky-line-index",kle="data-sticky-is-line",Ect="data-sticky-is-line-number",Tle="data-sticky-is-folding-icon";class Dct extends fe{constructor(e){super(),this._editor=e,this._foldingIconStore=new Te,this._rootDomNode=document.createElement("div"),this._lineNumbersDomNode=document.createElement("div"),this._linesDomNodeScrollable=document.createElement("div"),this._linesDomNode=document.createElement("div"),this._lineHeight=this._editor.getOption(67),this._renderedStickyLines=[],this._lineNumbers=[],this._lastLineRelativePosition=0,this._minContentWidthInPx=0,this._isOnGlyphMargin=!1,this._lineNumbersDomNode.className="sticky-widget-line-numbers",this._lineNumbersDomNode.setAttribute("role","none"),this._linesDomNode.className="sticky-widget-lines",this._linesDomNode.setAttribute("role","list"),this._linesDomNodeScrollable.className="sticky-widget-lines-scrollable",this._linesDomNodeScrollable.appendChild(this._linesDomNode),this._rootDomNode.className="sticky-widget",this._rootDomNode.classList.toggle("peek",e instanceof o_),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(115).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(115)&&t(),n.hasChanged(67)&&(this._lineHeight=this._editor.getOption(67))})),this._register(this._editor.onDidScrollChange(n=>{n.scrollLeftChanged&&t(),n.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{t(),this._updateWidgetWidth()})),this._register(this._foldingIconStore),t(),this._register(this._editor.onDidLayoutChange(n=>{this._updateWidgetWidth()})),this._updateWidgetWidth()}get lineNumbers(){return this._lineNumbers}get lineNumberCount(){return this._lineNumbers.length}getRenderedStickyLine(e){return this._renderedStickyLines.find(t=>t.lineNumber===e)}getCurrentLines(){return this._lineNumbers}setState(e,t,n){if(n===void 0&&(!this._previousState&&!e||this._previousState&&this._previousState.equals(e)))return;const r=this._isWidgetHeightZero(e),o=r?void 0:e,s=r?0:this._findLineToRebuildWidgetFrom(e,n);this._renderRootNode(o,t,s),this._previousState=e}_isWidgetHeightZero(e){if(!e)return!0;const t=e.startLineNumbers.length*this._lineHeight+e.lastLineRelativePosition;if(t>0){this._lastLineRelativePosition=e.lastLineRelativePosition;const n=[...e.startLineNumbers];e.showEndForLine!==null&&(n[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=n}else this._lastLineRelativePosition=0,this._lineNumbers=[];return t===0}_findLineToRebuildWidgetFrom(e,t){if(!e||!this._previousState)return 0;if(t!==void 0)return t;const n=this._previousState,r=e.startLineNumbers.findIndex(o=>!n.startLineNumbers.includes(o));return r===-1?0:r}_updateWidgetWidth(){const e=this._editor.getLayoutInfo(),t=e.contentLeft;this._lineNumbersDomNode.style.width=`${t}px`,this._linesDomNodeScrollable.style.setProperty("--vscode-editorStickyScroll-scrollableWidth",`${this._editor.getScrollWidth()-e.verticalScrollbarWidth}px`),this._rootDomNode.style.width=`${e.width-e.verticalScrollbarWidth}px`}_clearStickyLinesFromLine(e){this._foldingIconStore.clear();for(let t=e;ta.scrollWidth))+r.verticalScrollbarWidth,this._editor.layoutOverlayWidget(this)}_setFoldingHoverListeners(){this._editor.getOption(110)==="mouseover"&&(this._foldingIconStore.add(ye(this._lineNumbersDomNode,Ge.MOUSE_ENTER,()=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(ye(this._lineNumbersDomNode,Ge.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,n,r){const o=this._editor._getViewModel();if(!o)return;const s=o.coordinatesConverter.convertModelPositionToViewPosition(new ae(t,1)).lineNumber,a=o.getViewLineRenderingData(s),l=this._editor.getOption(68);let c;try{c=Ca.filter(a.inlineDecorations,s,a.minColumn,a.maxColumn)}catch{c=[]}const u=new D_(!0,!0,a.content,a.continuesWithWrappedLine,a.isBasicASCII,a.containsRTL,0,a.tokens,c,a.tabSize,a.startVisibleColumn,1,1,1,500,"none",!0,!0,null),d=new DS(2e3),h=Fk(u,d);let f;Ile?f=Ile.createHTML(d.build()):f=d.build();const g=document.createElement("span");g.setAttribute(j9,String(e)),g.setAttribute(kle,""),g.setAttribute("role","listitem"),g.tabIndex=0,g.className="sticky-line-content",g.classList.add(`stickyLine${t}`),g.style.lineHeight=`${this._lineHeight}px`,g.innerHTML=f;const p=document.createElement("span");p.setAttribute(j9,String(e)),p.setAttribute(Ect,""),p.className="sticky-line-number",p.style.lineHeight=`${this._lineHeight}px`;const v=r.contentLeft;p.style.width=`${v}px`;const m=document.createElement("span");l.renderType===1||l.renderType===3&&t%10===0?m.innerText=t.toString():l.renderType===2&&(m.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),m.className="sticky-line-number-inner",m.style.lineHeight=`${this._lineHeight}px`,m.style.width=`${r.lineNumbersWidth}px`,m.style.paddingLeft=`${r.lineNumbersLeft}px`,p.appendChild(m);const _=this._renderFoldingIconForLine(n,t);_&&p.appendChild(_.domNode),this._editor.applyFontInfo(g),this._editor.applyFontInfo(m),p.style.lineHeight=`${this._lineHeight}px`,g.style.lineHeight=`${this._lineHeight}px`,p.style.height=`${this._lineHeight}px`,g.style.height=`${this._lineHeight}px`;const y=new Ict(e,t,g,p,_,h.characterMapping,g.scrollWidth);return this._updateTopAndZIndexOfStickyLine(y)}_updateTopAndZIndexOfStickyLine(e){var t;const n=e.index,r=e.lineDomNode,o=e.lineNumberDomNode,s=n===this._lineNumbers.length-1,a="0",l="1";r.style.zIndex=s?a:l,o.style.zIndex=s?a:l;const c=`${n*this._lineHeight+this._lastLineRelativePosition+(!((t=e.foldingIcon)===null||t===void 0)&&t.isCollapsed?1:0)}px`,u=`${n*this._lineHeight}px`;return r.style.top=s?c:u,o.style.top=s?c:u,e}_renderFoldingIconForLine(e,t){const n=this._editor.getOption(110);if(!e||n==="never")return;const r=e.regions,o=r.findRange(t),s=r.getStartLineNumber(o);if(!(t===s))return;const l=r.isCollapsed(o),c=new kct(l,s,r.getEndLineNumber(o),this._lineHeight);return c.setVisible(this._isOnGlyphMargin?!0:l||n==="always"),c.domNode.setAttribute(Tle,""),c}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:null}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const n=tX(t.characterMapping,e,0);return new ae(t.lineNumber,n)}getLineNumberFromChildDomNode(e){var t,n;return(n=(t=this._getRenderedStickyLineFromChildDomNode(e))===null||t===void 0?void 0:t.lineNumber)!==null&&n!==void 0?n:null}_getRenderedStickyLineFromChildDomNode(e){const t=this.getLineIndexFromChildDomNode(e);return t===null||t<0||t>=this._renderedStickyLines.length?null:this._renderedStickyLines[t]}getLineIndexFromChildDomNode(e){const t=this._getAttributeValue(e,j9);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,kle)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,Tle)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const n=e.getAttribute(t);if(n!==null)return n;e=e.parentElement}}}class Ict{constructor(e,t,n,r,o,s,a){this.index=e,this.lineNumber=t,this.lineDomNode=n,this.lineNumberDomNode=r,this.foldingIcon=o,this.characterMapping=s,this.scrollWidth=a}}class kct{constructor(e,t,n,r){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=n,this.dimension=r,this.domNode=document.createElement("div"),this.domNode.style.width=`${r}px`,this.domNode.style.height=`${r}px`,this.domNode.className=Wt.asClassName(e?K3:j3)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class BE{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class RO{constructor(e,t,n){this.range=e,this.children=t,this.parent=n}}class Z1e{constructor(e,t,n,r){this.uri=e,this.version=t,this.element=n,this.outlineProviderId=r}}var h5=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},XI=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},WE;(function(i){i.OUTLINE_MODEL="outlineModel",i.FOLDING_PROVIDER_MODEL="foldingProviderModel",i.INDENTATION_MODEL="indentationModel"})(WE||(WE={}));var rv;(function(i){i[i.VALID=0]="VALID",i[i.INVALID=1]="INVALID",i[i.CANCELED=2]="CANCELED"})(rv||(rv={}));let ZU=class extends fe{constructor(e,t,n,r){super(),this._editor=e,this._languageConfigurationService=t,this._languageFeaturesService=n,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new nd(300)),this._updateOperation=this._register(new Te);const o=new QU(n),s=new ej(this._editor,n),a=new JU(this._editor,t);switch(r){case WE.OUTLINE_MODEL:this._modelProviders.push(o),this._modelProviders.push(s),this._modelProviders.push(a);break;case WE.FOLDING_PROVIDER_MODEL:this._modelProviders.push(s),this._modelProviders.push(a);break;case WE.INDENTATION_MODEL:this._modelProviders.push(a);break}}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}async update(e,t,n){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),await this._updateScheduler.trigger(async()=>{for(const r of this._modelProviders){const{statusPromise:o,modelPromise:s}=r.computeStickyModel(e,t,n);this._modelPromise=s;const a=await o;if(this._modelPromise!==s)return null;switch(a){case rv.CANCELED:return this._updateOperation.clear(),null;case rv.VALID:return r.stickyModel}}return null}).catch(r=>(en(r),null))}};ZU=h5([XI(1,Di),XI(2,_t)],ZU);class Q1e{constructor(){this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,rv.INVALID}computeStickyModel(e,t,n){if(n.isCancellationRequested||!this.isProviderValid(e))return{statusPromise:this._invalid(),modelPromise:null};const r=Io(o=>this.createModelFromProvider(e,t,o));return{statusPromise:r.then(o=>this.isModelValid(o)?n.isCancellationRequested?rv.CANCELED:(this._stickyModel=this.createStickyModel(e,t,n,o),rv.VALID):this._invalid()).then(void 0,o=>(en(o),rv.CANCELED)),modelPromise:r}}isModelValid(e){return!0}isProviderValid(e){return!0}}let QU=class extends Q1e{constructor(e){super(),this._languageFeaturesService=e}createModelFromProvider(e,t,n){return Fg.create(this._languageFeaturesService.documentSymbolProvider,e,n)}createStickyModel(e,t,n,r){var o;const{stickyOutlineElement:s,providerID:a}=this._stickyModelFromOutlineModel(r,(o=this._stickyModel)===null||o===void 0?void 0:o.outlineProviderId);return new Z1e(e.uri,t,s,a)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let n;if(En.first(e.children.values())instanceof b1e){const a=En.find(e.children.values(),l=>l.id===t);if(a)n=a.children;else{let l="",c=-1,u;for(const[d,h]of e.children.entries()){const f=this._findSumOfRangesOfGroup(h);f>c&&(u=h,c=f,l=h.id)}t=l,n=u.children}}else n=e.children;const r=[],o=Array.from(n.values()).sort((a,l)=>{const c=new BE(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),u=new BE(l.symbol.range.startLineNumber,l.symbol.range.endLineNumber);return this._comparator(c,u)});for(const a of o)r.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new RO(void 0,r,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const n=[];for(const o of e.children.values())if(o.symbol.selectionRange.startLineNumber!==o.symbol.range.endLineNumber)if(o.symbol.selectionRange.startLineNumber!==t)n.push(this._stickyModelFromOutlineElement(o,o.symbol.selectionRange.startLineNumber));else for(const s of o.children.values())n.push(this._stickyModelFromOutlineElement(s,o.symbol.selectionRange.startLineNumber));n.sort((o,s)=>this._comparator(o.range,s.range));const r=new BE(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new RO(r,n,void 0)}_comparator(e,t){return e.startLineNumber!==t.startLineNumber?e.startLineNumber-t.startLineNumber:t.endLineNumber-e.endLineNumber}_findSumOfRangesOfGroup(e){let t=0;for(const n of e.children.values())t+=this._findSumOfRangesOfGroup(n);return e instanceof CU?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};QU=h5([XI(0,_t)],QU);class J1e extends Q1e{constructor(e){super(),this._foldingLimitReporter=new m1e(e)}createStickyModel(e,t,n,r){const o=this._fromFoldingRegions(r);return new Z1e(e.uri,t,o,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,n=[],r=new RO(void 0,[],void 0);for(let o=0;o0}createModelFromProvider(e,t,n){const r=Xf.getFoldingRangeProviders(this._languageFeaturesService,e);return new nZ(e,r,()=>this.createModelFromProvider(e,t,n),this._foldingLimitReporter,void 0).compute(n)}};ej=h5([XI(1,_t)],ej);var Tct=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Nle=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class Nct{constructor(e,t,n){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=n}}let tj=class extends fe{constructor(e,t,n){super(),this._languageFeaturesService=t,this._languageConfigurationService=n,this._onDidChangeStickyScroll=this._register(new se),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._options=null,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new Te),this._updateSoon=this._register(new pi(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(115)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._stickyModelProvider=null,this._sessionStore.clear(),this._options=this._editor.getOption(115),this._options.enabled&&(this._stickyModelProvider=this._sessionStore.add(new ZU(this._editor,this._languageConfigurationService,this._languageFeaturesService,this._options.defaultModel)),this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,this._onDidChangeStickyScroll.fire(),this.update()})),this._sessionStore.add(this._editor.onDidChangeHiddenAreas(()=>this.update())),this._sessionStore.add(this._editor.onDidChangeModelContent(()=>this._updateSoon.schedule())),this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>this.update())),this.update())}getVersionId(){var e;return(e=this._model)===null||e===void 0?void 0:e.version}async update(){var e;(e=this._cts)===null||e===void 0||e.dispose(!0),this._cts=new wr,await this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()}async updateStickyModel(e){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization()){this._model=null;return}const t=this._editor.getModel(),n=t.getVersionId(),r=await this._stickyModelProvider.update(t,n,e);e.isCancellationRequested||(this._model=r)}updateIndex(e){return e===-1?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,t,n,r,o){if(t.children.length===0)return;let s=o;const a=[];for(let u=0;uu-d)),c=this.updateIndex(_D(a,e.startLineNumber+r,(u,d)=>u-d));for(let u=l;u<=c;u++){const d=t.children[u];if(!d)return;if(d.range){const h=d.range.startLineNumber,f=d.range.endLineNumber;e.startLineNumber<=f+1&&h-1<=e.endLineNumber&&h!==s&&(s=h,n.push(new Nct(h,f-1,r+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,d,n,r+1,h))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,d,n,r,o)}}getCandidateStickyLinesIntersecting(e){var t,n;if(!(!((t=this._model)===null||t===void 0)&&t.element))return[];let r=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,r,0,-1);const o=(n=this._editor._getViewModel())===null||n===void 0?void 0:n.getHiddenAreas();if(o)for(const s of o)r=r.filter(a=>!(a.startLineNumber>=s.startLineNumber&&a.endLineNumber<=s.endLineNumber+1));return r}};tj=Tct([Nle(1,_t),Nle(2,Di)],tj);var Rct=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},c1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},nj;let Yf=nj=class extends fe{constructor(e,t,n,r,o,s,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=n,this._instaService=r,this._contextKeyService=a,this._sessionStore=new Te,this._foldingModel=null,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._showEndForLine=null,this._stickyScrollWidget=new Dct(this._editor),this._stickyLineCandidateProvider=new tj(this._editor,n,o),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=new Dle([],[],0),this._onDidResize(),this._readConfiguration();const l=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration(u=>{(u.hasChanged(115)||u.hasChanged(73)||u.hasChanged(67)||u.hasChanged(110))&&this._readConfiguration()})),this._register(ye(l,Ge.CONTEXT_MENU,async u=>{this._onContextMenu(Pt(l),u)})),this._stickyScrollFocusedContextKey=j.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=j.stickyScrollVisible.bindTo(this._contextKeyService);const c=this._register(dh(l));this._register(c.onDidBlur(u=>{this._positionRevealed===!1&&l.clientHeight===0?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()})),this._register(c.onDidFocus(u=>{this.focus()})),this._registerMouseListeners(),this._register(ye(l,Ge.MOUSE_DOWN,u=>{this._onMouseDown=!0}))}static get(e){return e.getContribution(nj.ID)}_disposeFocusStickyScrollStore(){var e;this._stickyScrollFocusedContextKey.set(!1),(e=this._focusDisposableStore)===null||e===void 0||e.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}focus(){if(this._onMouseDown){this._onMouseDown=!1,this._editor.focus();return}this._stickyScrollFocusedContextKey.get()!==!0&&(this._focused=!0,this._focusDisposableStore=new Te,this._stickyScrollFocusedContextKey.set(!0),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumbers.length-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}focusNext(){this._focusedStickyElementIndex0&&this._focusNav(!1)}selectEditor(){this._editor.focus()}_focusNav(e){this._focusedStickyElementIndex=e?this._focusedStickyElementIndex+1:this._focusedStickyElementIndex-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex)}goToFocused(){const e=this._stickyScrollWidget.lineNumbers;this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:e[this._focusedStickyElementIndex],column:1})}_revealPosition(e){this._reveaInEditor(e,()=>this._editor.revealPosition(e))}_revealLineInCenterIfOutsideViewport(e){this._reveaInEditor(e,()=>this._editor.revealLineInCenterIfOutsideViewport(e.lineNumber,0))}_reveaInEditor(e,t){this._focused&&this._disposeFocusStickyScrollStore(),this._positionRevealed=!0,t(),this._editor.setSelection(B.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new Te),t=this._register(new M3(this._editor,{extractLineNumberFromMouseEvent:o=>{const s=this._stickyScrollWidget.getEditorPositionFromNode(o.target.element);return s?s.lineNumber:0}})),n=o=>{if(!this._editor.hasModel()||o.target.type!==12||o.target.detail!==this._stickyScrollWidget.getId())return null;const s=o.target.element;if(!s||s.innerText!==s.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(s);return a?{range:new B(a.lineNumber,a.column,a.lineNumber,a.column+s.innerText.length),textElement:s}:null},r=this._stickyScrollWidget.getDomNode();this._register(Sr(r,Ge.CLICK,o=>{if(o.ctrlKey||o.altKey||o.metaKey||!o.leftButton)return;if(o.shiftKey){const c=this._stickyScrollWidget.getLineIndexFromChildDomNode(o.target);if(c===null)return;const u=new ae(this._endLineNumbers[c],1);this._revealLineInCenterIfOutsideViewport(u);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(o.target)){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(o.target);this._toggleFoldingRegionForLine(c);return}if(!this._stickyScrollWidget.isInStickyLine(o.target))return;let l=this._stickyScrollWidget.getEditorPositionFromNode(o.target);if(!l){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(o.target);if(c===null)return;l=new ae(c,1)}this._revealPosition(l)})),this._register(Sr(r,Ge.MOUSE_MOVE,o=>{if(o.shiftKey){const s=this._stickyScrollWidget.getLineIndexFromChildDomNode(o.target);if(s===null||this._showEndForLine!==null&&this._showEndForLine===s)return;this._showEndForLine=s,this._renderStickyScroll();return}this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(ye(r,Ge.MOUSE_LEAVE,o=>{this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([o,s])=>{const a=n(o);if(!a||!o.hasTriggerModifier||!this._editor.hasModel()){e.clear();return}const{range:l,textElement:c}=a;if(!l.equalsRange(this._stickyRangeProjectedOnEditor))this._stickyRangeProjectedOnEditor=l,e.clear();else if(c.style.textDecoration==="underline")return;const u=new wr;e.add(Rt(()=>u.dispose(!0)));let d;B3(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new ae(l.startLineNumber,l.startColumn+1),u.token).then(h=>{if(!u.token.isCancellationRequested)if(h.length!==0){this._candidateDefinitionsLength=h.length;const f=c;d!==f?(e.clear(),d=f,d.style.textDecoration="underline",e.add(Rt(()=>{d.style.textDecoration="none"}))):d||(d=f,d.style.textDecoration="underline",e.add(Rt(()=>{d.style.textDecoration="none"})))}else e.clear()})})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(async o=>{if(o.target.type!==12||o.target.detail!==this._stickyScrollWidget.getId())return;const s=this._stickyScrollWidget.getEditorPositionFromNode(o.target.element);s&&(!this._editor.hasModel()||!this._stickyRangeProjectedOnEditor||(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:s.lineNumber,column:1})),this._instaService.invokeFunction(T1e,o,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor})))}))}_onContextMenu(e,t){const n=new Uu(e,t);this._contextMenuService.showContextMenu({menuId:$.StickyScrollContext,getAnchor:()=>n})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getRenderedStickyLine(e),n=t==null?void 0:t.foldingIcon;if(!n)return;d1e(this._foldingModel,Number.MAX_VALUE,[e]),n.isCollapsed=!n.isCollapsed;const r=(n.isCollapsed?this._editor.getTopForLineNumber(n.foldingEndLine):this._editor.getTopForLineNumber(n.foldingStartLine))-this._editor.getOption(67)*t.index+1;this._editor.setScrollTop(r),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(115);if(e.enabled===!1){this._editor.removeOverlayWidget(this._stickyScrollWidget),this._sessionStore.clear(),this._enabled=!1;return}else e.enabled&&!this._enabled&&(this._editor.addOverlayWidget(this._stickyScrollWidget),this._sessionStore.add(this._editor.onDidScrollChange(n=>{n.scrollTopChanged&&(this._showEndForLine=null,this._renderStickyScroll())})),this._sessionStore.add(this._editor.onDidLayoutChange(()=>this._onDidResize())),this._sessionStore.add(this._editor.onDidChangeModelTokens(n=>this._onTokensChange(n))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(()=>{this._showEndForLine=null,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(68).renderType===2&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=null,this._renderStickyScroll(0)}))}_needsUpdate(e){const t=this._stickyScrollWidget.getCurrentLines();for(const n of t)for(const r of e.ranges)if(n>=r.fromLineNumber&&n<=r.toLineNumber)return!0;return!1}_onTokensChange(e){this._needsUpdate(e)&&this._renderStickyScroll(0)}_onDidResize(){const t=this._editor.getLayoutInfo().height/this._editor.getOption(67);this._maxStickyLines=Math.round(t*.25)}async _renderStickyScroll(e){var t,n;const r=this._editor.getModel();if(!r||r.isTooLargeForTokenization()){this._foldingModel=null,this._stickyScrollWidget.setState(void 0,null);return}const o=this._stickyLineCandidateProvider.getVersionId();if(o===void 0||o===r.getVersionId())if(this._foldingModel=(n=await((t=Xf.get(this._editor))===null||t===void 0?void 0:t.getFoldingModel()))!==null&&n!==void 0?n:null,this._widgetState=this.findScrollWidgetState(),this._stickyScrollVisibleContextKey.set(this._widgetState.startLineNumbers.length!==0),!this._focused)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e);else if(this._focusedStickyElementIndex===-1)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const s=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(s)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}}findScrollWidgetState(){const e=this._editor.getOption(67),t=Math.min(this._maxStickyLines,this._editor.getOption(115).maxLineCount),n=this._editor.getScrollTop();let r=0;const o=[],s=[],a=this._editor.getVisibleRanges();if(a.length!==0){const l=new BE(a[0].startLineNumber,a[a.length-1].endLineNumber),c=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(l);for(const u of c){const d=u.startLineNumber,h=u.endLineNumber,f=u.nestingDepth;if(h-d>0){const g=(f-1)*e,p=f*e,v=this._editor.getBottomForLineNumber(d)-n,m=this._editor.getTopForLineNumber(h)-n,_=this._editor.getBottomForLineNumber(h)-n;if(g>m&&g<=_){o.push(d),s.push(h+1),r=_-p;break}else p>v&&p<=_&&(o.push(d),s.push(h+1));if(o.length===t)break}}}return this._endLineNumbers=s,new Dle(o,s,r,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}};Yf.ID="store.contrib.stickyScrollController";Yf=nj=Rct([c1(1,Ol),c1(2,_t),c1(3,Ot),c1(4,Di),c1(5,gu),c1(6,Vt)],Yf);class Mct extends sl{constructor(){super({id:"editor.action.toggleStickyScroll",title:{...$n("toggleEditorStickyScroll","Toggle Editor Sticky Scroll"),mnemonicTitle:w({key:"mitoggleStickyScroll",comment:["&& denotes a mnemonic"]},"&&Toggle Editor Sticky Scroll")},category:Lct.View,toggled:{condition:De.equals("config.editor.stickyScroll.enabled",!0),title:w("stickyScroll","Sticky Scroll"),mnemonicTitle:w({key:"miStickyScroll",comment:["&& denotes a mnemonic"]},"&&Sticky Scroll")},menu:[{id:$.CommandPalette},{id:$.MenubarAppearanceMenu,group:"4_editor",order:3},{id:$.StickyScrollContext}]})}async run(e){const t=e.get(gn),n=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",n)}}const f5=100;class Act extends Sh{constructor(){super({id:"editor.action.focusStickyScroll",title:{...$n("focusStickyScroll","Focus Sticky Scroll"),mnemonicTitle:w({key:"mifocusStickyScroll",comment:["&& denotes a mnemonic"]},"&&Focus Sticky Scroll")},precondition:De.and(De.has("config.editor.stickyScroll.enabled"),j.stickyScrollVisible),menu:[{id:$.CommandPalette}]})}runEditorCommand(e,t){var n;(n=Yf.get(t))===null||n===void 0||n.focus()}}class Pct extends Sh{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:$n("selectNextStickyScrollLine.title","Select next sticky scroll line"),precondition:j.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:f5,primary:18}})}runEditorCommand(e,t){var n;(n=Yf.get(t))===null||n===void 0||n.focusNext()}}class Oct extends Sh{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:$n("selectPreviousStickyScrollLine.title","Select previous sticky scroll line"),precondition:j.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:f5,primary:16}})}runEditorCommand(e,t){var n;(n=Yf.get(t))===null||n===void 0||n.focusPrevious()}}class Fct extends Sh{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:$n("goToFocusedStickyScrollLine.title","Go to focused sticky scroll line"),precondition:j.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:f5,primary:3}})}runEditorCommand(e,t){var n;(n=Yf.get(t))===null||n===void 0||n.goToFocused()}}class Bct extends Sh{constructor(){super({id:"editor.action.selectEditor",title:$n("selectEditor.title","Select Editor"),precondition:j.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:f5,primary:9}})}runEditorCommand(e,t){var n;(n=Yf.get(t))===null||n===void 0||n.selectEditor()}}jn(Yf.ID,Yf,1);Ei(Mct);Ei(Act);Ei(Oct);Ei(Pct);Ei(Fct);Ei(Bct);var eye=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},UL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class Wct{constructor(e,t,n,r,o,s){this.range=e,this.insertText=t,this.filterText=n,this.additionalTextEdits=r,this.command=o,this.completion=s}}let ij=class extends Y3e{constructor(e,t,n,r,o,s){super(o.disposable),this.model=e,this.line=t,this.word=n,this.completionModel=r,this._suggestMemoryService=s}canBeReused(e,t,n){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===n.startColumn&&this.word.endColumn=0&&l.resolve(Cn.None)}return t}};ij=eye([UL(5,Z3)],ij);let rj=class extends fe{constructor(e,t,n,r){super(),this._languageFeatureService=e,this._clipboardService=t,this._suggestMemoryService=n,this._editorService=r,this._store.add(e.inlineCompletionsProvider.register("*",this))}async provideInlineCompletions(e,t,n,r){var o;if(n.selectedSuggestionInfo)return;let s;for(const g of this._editorService.listCodeEditors())if(g.getModel()===e){s=g;break}if(!s)return;const a=s.getOption(89);if(Cy.isAllOff(a))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const l=e.tokenization.getLineTokens(t.lineNumber),c=l.getStandardTokenType(l.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(Cy.valueFor(a,c)!=="inline")return;let u=e.getWordAtPosition(t),d;if(u!=null&&u.word||(d=this._getTriggerCharacterInfo(e,t)),!(u!=null&&u.word)&&!d||(u||(u=e.getWordUntilPosition(t)),u.endColumn!==t.column))return;let h;const f=e.getValueInRange(new B(t.lineNumber,1,t.lineNumber,t.column));if(!d&&(!((o=this._lastResult)===null||o===void 0)&&o.canBeReused(e,t.lineNumber,u))){const g=new yle(f,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=g,this._lastResult.acquire(),h=this._lastResult}else{const g=await rZ(this._languageFeatureService.completionProvider,e,t,new BI(void 0,IO.createSuggestFilter(s).itemKind,d==null?void 0:d.providers),d&&{triggerKind:1,triggerCharacter:d.ch},r);let p;g.needsClipboard&&(p=await this._clipboardService.readText());const v=new Wm(g.items,t.column,new yle(f,0),Hd.None,s.getOption(118),s.getOption(112),{boostFullMatch:!1,firstMatchCanBeWeak:!1},p);h=new ij(e,t.lineNumber,u,v,g,this._suggestMemoryService)}return this._lastResult=h,h}handleItemDidShow(e,t){t.completion.resolve(Cn.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var n;const r=e.getValueInRange(B.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),o=new Set;for(const s of this._languageFeatureService.completionProvider.all(e))!((n=s.triggerCharacters)===null||n===void 0)&&n.includes(r)&&o.add(s);if(o.size!==0)return{providers:o,ch:r}}};rj=eye([UL(0,_t),UL(1,Kp),UL(2,Z3),UL(3,Un)],rj);nT(rj);class $ct extends gt{constructor(){super({id:"editor.action.forceRetokenize",label:w("forceRetokenize","Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;const n=t.getModel();n.tokenization.resetTokenization();const r=new Ms;n.tokenization.forceTokenization(n.getLineCount()),r.stop(),console.log(`tokenization took ${r.elapsed()}`)}}Be($ct);class g5 extends sl{constructor(){super({id:g5.ID,title:$n({key:"toggle.tabMovesFocus",comment:["Turn on/off use of tab key for moving focus around VS Code"]},"Toggle Tab Key Moves Focus"),precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},f1:!0})}run(){const t=!Rw.getTabFocusMode();Rw.setTabFocusMode(t),kl(t?w("toggle.tabMovesFocus.on","Pressing Tab will now move focus to the next focusable element"):w("toggle.tabMovesFocus.off","Pressing Tab will now insert the tab character"))}}g5.ID="editor.action.toggleTabFocusMode";Ei(g5);var Hct=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Vct=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let oj=class extends fe{get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute("aria-disabled","false"),this.el.tabIndex=0,this.el.style.pointerEvents="auto",this.el.style.opacity="1",this.el.style.cursor="pointer",this._enabled=!1):(this.el.setAttribute("aria-disabled","true"),this.el.tabIndex=-1,this.el.style.pointerEvents="none",this.el.style.opacity="0.4",this.el.style.cursor="default",this._enabled=!0),this._enabled=e}constructor(e,t,n={},r){var o;super(),this._link=t,this._enabled=!0,this.el=ke(e,He("a.monaco-link",{tabIndex:(o=t.tabIndex)!==null&&o!==void 0?o:0,href:t.href,title:t.title},t.label)),this.el.setAttribute("role","button");const s=this._register(new wn(this.el,"click")),a=this._register(new wn(this.el,"keypress")),l=Je.chain(a.event,d=>d.map(h=>new Ai(h)).filter(h=>h.keyCode===3)),c=this._register(new wn(this.el,Si.Tap)).event;this._register(wi.addTarget(this.el));const u=Je.any(s.event,l,c);this._register(u(d=>{this.enabled&&(hn.stop(d,!0),n!=null&&n.opener?n.opener(this._link.href):r.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}};oj=Hct([Vct(3,al)],oj);var tye=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},nye=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const zct=26;let sj=class extends fe{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(aj))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show({...e,onClose:()=>{var t;this.hide(),(t=e.onClose)===null||t===void 0||t.call(e)}}),this._editor.setBanner(this.banner.element,zct)}};sj=tye([nye(1,Ot)],sj);let aj=class extends fe{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(Uf,{}),this.element=He("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(e){if(e.ariaLabel)return e.ariaLabel;if(typeof e.message=="string")return e.message}getBannerMessage(e){if(typeof e=="string"){const t=He("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){Ns(this.element)}show(e){Ns(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const n=ke(this.element,He("div.icon-container"));n.setAttribute("aria-hidden","true"),e.icon&&n.appendChild(He(`div${Wt.asCSSSelector(e.icon)}`));const r=ke(this.element,He("div.message-container"));if(r.setAttribute("aria-hidden","true"),r.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=ke(this.element,He("div.message-actions-container")),e.actions)for(const s of e.actions)this._register(this.instantiationService.createInstance(oj,this.messageActionsContainer,{...s,tabIndex:-1},{}));const o=ke(this.element,He("div.action-container"));this.actionBar=this._register(new au(o)),this.actionBar.push(this._register(new xl("banner.close","Close Banner",Wt.asClassName(N0e),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};aj=tye([nye(0,Ot)],aj);var _Z=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},nw=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Uct=Mr("extensions-warning-message",Xe.warning,w("warningIcon","Icon shown with a warning message in the extensions editor."));let lS=class extends fe{constructor(e,t,n,r){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=n,this._highlighter=null,this._bannerClosed=!1,this._updateState=o=>{if(o&&o.hasMore){if(this._bannerClosed)return;const s=Math.max(o.ambiguousCharacterCount,o.nonBasicAsciiCharacterCount,o.invisibleCharacterCount);let a;if(o.nonBasicAsciiCharacterCount>=s)a={message:w("unicodeHighlighting.thisDocumentHasManyNonBasicAsciiUnicodeCharacters","This document contains many non-basic ASCII unicode characters"),command:new qS};else if(o.ambiguousCharacterCount>=s)a={message:w("unicodeHighlighting.thisDocumentHasManyAmbiguousUnicodeCharacters","This document contains many ambiguous unicode characters"),command:new O_};else if(o.invisibleCharacterCount>=s)a={message:w("unicodeHighlighting.thisDocumentHasManyInvisibleUnicodeCharacters","This document contains many invisible unicode characters"),command:new GS};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:Uct,actions:[{label:a.command.shortLabel,href:`command:${a.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(r.createInstance(sj,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(125),this._register(n.onDidChangeTrust(o=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(o=>{o.hasChanged(125)&&(this._options=e.getOption(125),this._updateHighlighter())})),this._updateHighlighter()}dispose(){this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),super.dispose()}_updateHighlighter(){if(this._updateState(null),this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),!this._editor.hasModel())return;const e=jct(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(n=>n===!1))return;const t={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map(n=>n.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(n=>n==="_os"?new Intl.NumberFormat().resolvedOptions().locale:n==="_vscode"?Y4e:n)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new lj(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new Kct(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}};lS.ID="editor.contrib.unicodeHighlighter";lS=_Z([nw(1,hd),nw(2,F_e),nw(3,Ot)],lS);function jct(i,e){return{nonBasicASCII:e.nonBasicASCII===Kl?!i:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===Kl?!i:e.includeComments,includeStrings:e.includeStrings===Kl?!i:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let lj=class extends fe{constructor(e,t,n,r){super(),this._editor=e,this._options=t,this._updateState=n,this._editorWorkerService=r,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new pi(()=>this._update(),250)),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then(t=>{if(this._model.isDisposed()||this._model.getVersionId()!==e)return;this._updateState(t);const n=[];if(!t.hasMore)for(const r of t.ranges)n.push({range:r,options:MO.instance.getDecorationFromOptions(this._options)});this._decorations.set(n)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!wX(t,e))return null;const n=t.getValueInRange(e.range);return{reason:rye(n,this._options),inComment:SX(t,e),inString:xX(t,e)}}};lj=_Z([nw(3,hd)],lj);class Kct extends fe{constructor(e,t,n){super(),this._editor=e,this._options=t,this._updateState=n,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new pi(()=>this._update(),250)),this._register(this._editor.onDidLayoutChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidScrollChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeHiddenAreas(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._editor.getVisibleRanges(),t=[],n={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const r of e){const o=Oq.computeUnicodeHighlights(this._model,this._options,r);for(const s of o.ranges)n.ranges.push(s);n.ambiguousCharacterCount+=n.ambiguousCharacterCount,n.invisibleCharacterCount+=n.invisibleCharacterCount,n.nonBasicAsciiCharacterCount+=n.nonBasicAsciiCharacterCount,n.hasMore=n.hasMore||o.hasMore}if(!n.hasMore)for(const r of n.ranges)t.push({range:r,options:MO.instance.getDecorationFromOptions(this._options)});this._updateState(n),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),n=t.getValueInRange(e.range);return wX(t,e)?{reason:rye(n,this._options),inComment:SX(t,e),inString:xX(t,e)}:null}}const iye=w("unicodeHighlight.configureUnicodeHighlightOptions","Configure Unicode Highlight Options");let cj=class{constructor(e,t,n){this._editor=e,this._languageService=t,this._openerService=n,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const n=this._editor.getModel(),r=this._editor.getContribution(lS.ID);if(!r)return[];const o=[],s=new Set;let a=300;for(const l of t){const c=r.getDecorationInfo(l);if(!c)continue;const d=n.getValueInRange(l.range).codePointAt(0),h=K9(d);let f;switch(c.reason.kind){case 0:{Tk(c.reason.confusableWith)?f=w("unicodeHighlight.characterIsAmbiguousASCII","The character {0} could be confused with the ASCII character {1}, which is more common in source code.",h,K9(c.reason.confusableWith.codePointAt(0))):f=w("unicodeHighlight.characterIsAmbiguous","The character {0} could be confused with the character {1}, which is more common in source code.",h,K9(c.reason.confusableWith.codePointAt(0)));break}case 1:f=w("unicodeHighlight.characterIsInvisible","The character {0} is invisible.",h);break;case 2:f=w("unicodeHighlight.characterIsNonBasicAscii","The character {0} is not a basic ASCII character.",h);break}if(s.has(f))continue;s.add(f);const g={codePoint:d,reason:c.reason,inComment:c.inComment,inString:c.inString},p=w("unicodeHighlight.adjustSettings","Adjust settings"),v=`command:${vT.ID}?${encodeURIComponent(JSON.stringify(g))}`,m=new Is("",!0).appendMarkdown(f).appendText(" ").appendLink(v,p,iye);o.push(new jd(this,l.range,[m],!1,a++))}return o}renderHoverParts(e,t){return HCe(e,t,this._editor,this._languageService,this._openerService)}};cj=_Z([nw(1,ji),nw(2,al)],cj);function uj(i){return`U+${i.toString(16).padStart(4,"0")}`}function K9(i){let e=`\`${uj(i)}\``;return Nf.isInvisibleCharacter(i)||(e+=` "${`${Gct(i)}`}"`),e}function Gct(i){return i===96?"`` ` ``":"`"+String.fromCodePoint(i)+"`"}function rye(i,e){return Oq.computeUnicodeHighlightReason(i,e)}class MO{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const n=`${e}${t}`;let r=this.map.get(n);return r||(r=sn.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(n,r)),r}}MO.instance=new MO;class qct extends gt{constructor(){super({id:O_.ID,label:w("action.unicodeHighlight.disableHighlightingInComments","Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=w("unicodeHighlight.disableHighlightingInComments.shortLabel","Disable Highlight In Comments")}async run(e,t,n){const r=e==null?void 0:e.get(gn);r&&this.runAction(r)}async runAction(e){await e.updateValue(Ga.includeComments,!1,2)}}class Xct extends gt{constructor(){super({id:O_.ID,label:w("action.unicodeHighlight.disableHighlightingInStrings","Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=w("unicodeHighlight.disableHighlightingInStrings.shortLabel","Disable Highlight In Strings")}async run(e,t,n){const r=e==null?void 0:e.get(gn);r&&this.runAction(r)}async runAction(e){await e.updateValue(Ga.includeStrings,!1,2)}}class O_ extends gt{constructor(){super({id:O_.ID,label:w("action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters","Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=w("unicodeHighlight.disableHighlightingOfAmbiguousCharacters.shortLabel","Disable Ambiguous Highlight")}async run(e,t,n){const r=e==null?void 0:e.get(gn);r&&this.runAction(r)}async runAction(e){await e.updateValue(Ga.ambiguousCharacters,!1,2)}}O_.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";class GS extends gt{constructor(){super({id:GS.ID,label:w("action.unicodeHighlight.disableHighlightingOfInvisibleCharacters","Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=w("unicodeHighlight.disableHighlightingOfInvisibleCharacters.shortLabel","Disable Invisible Highlight")}async run(e,t,n){const r=e==null?void 0:e.get(gn);r&&this.runAction(r)}async runAction(e){await e.updateValue(Ga.invisibleCharacters,!1,2)}}GS.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";class qS extends gt{constructor(){super({id:qS.ID,label:w("action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters","Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=w("unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters.shortLabel","Disable Non ASCII Highlight")}async run(e,t,n){const r=e==null?void 0:e.get(gn);r&&this.runAction(r)}async runAction(e){await e.updateValue(Ga.nonBasicASCII,!1,2)}}qS.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";class vT extends gt{constructor(){super({id:vT.ID,label:w("action.unicodeHighlight.showExcludeOptions","Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}async run(e,t,n){const{codePoint:r,reason:o,inString:s,inComment:a}=n,l=String.fromCodePoint(r),c=e.get(Eh),u=e.get(gn);function d(g){return Nf.isInvisibleCharacter(g)?w("unicodeHighlight.excludeInvisibleCharFromBeingHighlighted","Exclude {0} (invisible character) from being highlighted",uj(g)):w("unicodeHighlight.excludeCharFromBeingHighlighted","Exclude {0} from being highlighted",`${uj(g)} "${l}"`)}const h=[];if(o.kind===0)for(const g of o.notAmbiguousInLocales)h.push({label:w("unicodeHighlight.allowCommonCharactersInLanguage",'Allow unicode characters that are more common in the language "{0}".',g),run:async()=>{Zct(u,[g])}});if(h.push({label:d(r),run:()=>Yct(u,[r])}),a){const g=new qct;h.push({label:g.label,run:async()=>g.runAction(u)})}else if(s){const g=new Xct;h.push({label:g.label,run:async()=>g.runAction(u)})}if(o.kind===0){const g=new O_;h.push({label:g.label,run:async()=>g.runAction(u)})}else if(o.kind===1){const g=new GS;h.push({label:g.label,run:async()=>g.runAction(u)})}else if(o.kind===2){const g=new qS;h.push({label:g.label,run:async()=>g.runAction(u)})}else Qct(o);const f=await c.pick(h,{title:iye});f&&await f.run()}}vT.ID="editor.action.unicodeHighlight.showExcludeOptions";async function Yct(i,e){const t=i.getValue(Ga.allowedCharacters);let n;typeof t=="object"&&t?n=t:n={};for(const r of e)n[String.fromCodePoint(r)]=!0;await i.updateValue(Ga.allowedCharacters,n,2)}async function Zct(i,e){var t;const n=(t=i.inspect(Ga.allowedLocales).user)===null||t===void 0?void 0:t.value;let r;typeof n=="object"&&n?r=Object.assign({},n):r={};for(const o of e)r[o]=!0;await i.updateValue(Ga.allowedLocales,r,2)}function Qct(i){throw new Error(`Unexpected value: ${i}`)}Be(O_);Be(GS);Be(qS);Be(vT);jn(lS.ID,lS,1);A_.register(cj);var Jct=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Rle=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const oye="ignoreUnusualLineTerminators";function eut(i,e,t){i.setModelProperty(e.uri,oye,t)}function tut(i,e){return i.getModelProperty(e.uri,oye)}let YI=class extends fe{constructor(e,t,n){super(),this._editor=e,this._dialogService=t,this._codeEditorService=n,this._isPresentingDialog=!1,this._config=this._editor.getOption(126),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(126)&&(this._config=this._editor.getOption(126),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(r=>{r.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||tut(this._codeEditorService,e)===!0||this._editor.getOption(91))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let n;try{this._isPresentingDialog=!0,n=await this._dialogService.confirm({title:w("unusualLineTerminators.title","Unusual Line Terminators"),message:w("unusualLineTerminators.message","Detected unusual line terminators"),detail:w("unusualLineTerminators.detail","The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",su(e.uri)),primaryButton:w({key:"unusualLineTerminators.fix",comment:["&& denotes a mnemonic"]},"&&Remove Unusual Line Terminators"),cancelButton:w("unusualLineTerminators.ignore","Ignore")})}finally{this._isPresentingDialog=!1}if(!n.confirmed){eut(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}};YI.ID="editor.contrib.unusualLineTerminatorsDetector";YI=Jct([Rle(1,Gk),Rle(2,Un)],YI);jn(YI.ID,YI,1);var sye=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},jM=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},ho,dj;const p5=new st("hasWordHighlights",!1);function aye(i,e,t,n){const r=i.ordered(e);return wq(r.map(o=>()=>Promise.resolve(o.provideDocumentHighlights(e,t,n)).then(void 0,Zr)),Ts).then(o=>{if(o){const s=new Tr;return s.set(e.uri,o),s}return new Tr})}function nut(i,e,t,n,r,o){const s=i.ordered(e);return wq(s.map(a=>()=>{const l=o.filter(c=>Fme(c)).filter(c=>IX(a.selector,c.uri,c.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(a.provideMultiDocumentHighlights(e,t,l,r)).then(void 0,Zr)}),a=>a instanceof Tr&&a.size>0)}class bZ{constructor(e,t,n){this._model=e,this._selection=t,this._wordSeparators=n,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=Io(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const n=e.getWordAtPosition(t.getPosition());return n?new B(t.startLineNumber,n.startColumn,t.startLineNumber,n.endColumn):null}isValid(e,t,n){const r=t.startLineNumber,o=t.startColumn,s=t.endColumn,a=this._getCurrentWordRange(e,t);let l=!!(this._wordRange&&this._wordRange.equalsRange(a));for(let c=0,u=n.length;!l&&c=s&&(l=!0)}return l}cancel(){this.result.cancel()}}class iut extends bZ{constructor(e,t,n,r){super(e,t,n),this._providers=r}_compute(e,t,n,r){return aye(this._providers,e,t.getPosition(),r).then(o=>o||new Tr)}}class rut extends bZ{constructor(e,t,n,r,o){super(e,t,n),this._providers=r,this._otherModels=o}_compute(e,t,n,r){return nut(this._providers,e,t.getPosition(),n,r,this._otherModels).then(o=>o||new Tr)}}class lye extends bZ{constructor(e,t,n,r,o){super(e,t,r),this._otherModels=o,this._selectionIsEmpty=t.isEmpty(),this._word=n}_compute(e,t,n,r){return Uv(250,r).then(()=>{const o=new Tr;let s;if(this._word?s=this._word:s=e.getWordAtPosition(t.getPosition()),!s)return new Tr;const a=[e,...this._otherModels];for(const l of a){if(l.isDisposed())continue;const u=l.findMatches(s.word,!0,!1,!0,n,!1).map(d=>({range:d.range,kind:xD.Text}));u&&o.set(l.uri,u)}return o})}isValid(e,t,n){const r=t.isEmpty();return this._selectionIsEmpty!==r?!1:super.isValid(e,t,n)}}function out(i,e,t,n,r){return i.has(e)?new iut(e,t,r,i):new lye(e,t,n,r,[])}function sut(i,e,t,n,r,o){return i.has(e)?new rut(e,t,r,i,o):new lye(e,t,n,r,o)}tg("_executeDocumentHighlights",async(i,e,t)=>{const n=i.get(_t),r=await aye(n.documentHighlightProvider,e,t,Cn.None);return r==null?void 0:r.get(e.uri)});let ZI=ho=class{constructor(e,t,n,r,o){this.toUnhook=new Te,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new Tr,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this.providers=t,this.multiDocumentProviders=n,this.codeEditorService=o,this._hasWordHighlights=p5.bindTo(r),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(81),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(s=>{this._ignorePositionChangeEvent||this.occurrencesHighlight!=="off"&&this._onPositionChanged(s)})),this.toUnhook.add(e.onDidFocusEditorText(s=>{this.occurrencesHighlight!=="off"&&(this.workerRequest||this._run())})),this.toUnhook.add(e.onDidChangeModelContent(s=>{this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(s=>{!s.newModelUrl&&s.oldModelUrl?this._stopSingular():ho.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(s=>{const a=this.editor.getOption(81);this.occurrencesHighlight!==a&&(this.occurrencesHighlight=a,this._stopAll())})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,ho.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(){this.occurrencesHighlight!=="off"&&this._run()}_getSortedHighlights(){return this.decorations.getRanges().sort(B.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),n=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))+1)%e.length,r=e[n];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(r.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(r);const o=this._getWord();if(o){const s=this.editor.getModel().getLineContent(r.startLineNumber);kl(`${s}, ${n+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),n=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,r=e[n];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(r.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(r);const o=this._getWord();if(o){const s=this.editor.getModel().getLineContent(r.startLineNumber);kl(`${s}, ${n+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=ho.storedDecorations.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),ho.storedDecorations.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(){const e=this.codeEditorService.listCodeEditors(),t=[];for(const n of e){if(!n.hasModel())continue;const r=ho.storedDecorations.get(n.getModel().uri);if(!r)continue;n.removeDecorations(r),t.push(n.getModel().uri);const o=Ap.get(n);o!=null&&o.wordHighlighter&&o.wordHighlighter.decorations.length>0&&(o.wordHighlighter.decorations.clear(),o.wordHighlighter.workerRequest=null,o.wordHighlighter._hasWordHighlights.set(!1))}for(const n of t)ho.storedDecorations.delete(n)}_stopSingular(){var e,t,n,r;this._removeSingleDecorations(),this.editor.hasTextFocus()&&(((e=this.editor.getModel())===null||e===void 0?void 0:e.uri.scheme)!==an.vscodeNotebookCell&&((n=(t=ho.query)===null||t===void 0?void 0:t.modelInfo)===null||n===void 0?void 0:n.model.uri.scheme)!==an.vscodeNotebookCell?(ho.query=null,this._run()):!((r=ho.query)===null||r===void 0)&&r.modelInfo&&(ho.query.modelInfo=null)),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_stopAll(){this._removeAllDecorations(),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){var t;if(this.occurrencesHighlight==="off"){this._stopAll();return}if(e.reason!==3&&((t=this.editor.getModel())===null||t===void 0?void 0:t.uri.scheme)!==an.vscodeNotebookCell){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,n=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:n})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===an.vscodeNotebookCell){const o=[],s=this.codeEditorService.listCodeEditors();for(const a of s){const l=a.getModel();l&&l!==e&&l.uri.scheme===an.vscodeNotebookCell&&o.push(l)}return o}const n=[],r=this.codeEditorService.listCodeEditors();for(const o of r){if(!EY(o))continue;const s=o.getModel();s&&e===s.modified&&n.push(s.modified)}if(n.length)return n;if(this.occurrencesHighlight==="singleFile")return[];for(const o of r){const s=o.getModel();s&&s!==e&&n.push(s)}return n}_run(){var e;let t;if(this.editor.hasTextFocus()){const r=this.editor.getSelection();if(!r||r.startLineNumber!==r.endLineNumber){ho.query=null,this._stopAll();return}const o=r.startColumn,s=r.endColumn,a=this._getWord();if(!a||a.startColumn>o||a.endColumn{r===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=s||[],this._beginRenderDecorations())},en)}}computeWithModel(e,t,n,r){return r.length?sut(this.multiDocumentProviders,e,t,n,this.editor.getOption(130),r):out(this.providers,e,t,n,this.editor.getOption(130))}_beginRenderDecorations(){const e=new Date().getTime(),t=this.lastCursorPositionChangeTime+250;e>=t?(this.renderDecorationsTimer=-1,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},t-e)}renderDecorations(){var e,t,n;this.renderDecorationsTimer=-1;const r=this.codeEditorService.listCodeEditors();for(const o of r){const s=Ap.get(o);if(!s)continue;const a=[],l=(e=o.getModel())===null||e===void 0?void 0:e.uri;if(l&&this.workerRequestValue.has(l)){const c=ho.storedDecorations.get(l),u=this.workerRequestValue.get(l);if(u)for(const h of u)h.range&&a.push({range:h.range,options:_lt(h.kind)});let d=[];o.changeDecorations(h=>{d=h.deltaDecorations(c??[],a)}),ho.storedDecorations=ho.storedDecorations.set(l,d),a.length>0&&((t=s.wordHighlighter)===null||t===void 0||t.decorations.set(a),(n=s.wordHighlighter)===null||n===void 0||n._hasWordHighlights.set(!0))}}}dispose(){this._stopSingular(),this.toUnhook.dispose()}};ZI.storedDecorations=new Tr;ZI.query=null;ZI=ho=sye([jM(4,Un)],ZI);let Ap=dj=class extends fe{static get(e){return e.getContribution(dj.ID)}constructor(e,t,n,r){super(),this._wordHighlighter=null;const o=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this._wordHighlighter=new ZI(e,n.documentHighlightProvider,n.multiDocumentHighlightProvider,t,r))};this._register(e.onDidChangeModel(s=>{this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),o()})),o()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){var e;(e=this._wordHighlighter)===null||e===void 0||e.moveNext()}moveBack(){var e;(e=this._wordHighlighter)===null||e===void 0||e.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore()}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}};Ap.ID="editor.contrib.wordHighlighter";Ap=dj=sye([jM(1,Vt),jM(2,_t),jM(3,Un)],Ap);class cye extends gt{constructor(e,t){super(t),this._isNext=e}run(e,t){const n=Ap.get(t);n&&(this._isNext?n.moveNext():n.moveBack())}}class aut extends cye{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:w("wordHighlight.next.label","Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:p5,kbOpts:{kbExpr:j.editorTextFocus,primary:65,weight:100}})}}class lut extends cye{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:w("wordHighlight.previous.label","Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:p5,kbOpts:{kbExpr:j.editorTextFocus,primary:1089,weight:100}})}}class cut extends gt{constructor(){super({id:"editor.action.wordHighlight.trigger",label:w("wordHighlight.trigger.label","Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:p5.toNegated(),kbOpts:{kbExpr:j.editorTextFocus,primary:0,weight:100}})}run(e,t,n){const r=Ap.get(t);r&&r.restoreViewState(!0)}}jn(Ap.ID,Ap,0);Be(aut);Be(lut);Be(cut);class m5 extends Vo{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){if(!t.hasModel())return;const r=ou(t.getOption(130)),o=t.getModel(),a=t.getSelections().map(l=>{const c=new ae(l.positionLineNumber,l.positionColumn),u=this._move(r,o,c,this._wordNavigationType);return this._moveTo(l,u,this._inSelectionMode)});if(o.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,a.map(l=>Wn.fromModelSelection(l))),a.length===1){const l=new ae(a[0].positionLineNumber,a[0].positionColumn);t.revealPosition(l,0)}}_moveTo(e,t,n){return n?new yt(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new yt(t.lineNumber,t.column,t.lineNumber,t.column)}}class F_ extends m5{_move(e,t,n,r){return Zn.moveWordLeft(e,t,n,r)}}class B_ extends m5{_move(e,t,n,r){return Zn.moveWordRight(e,t,n,r)}}class uut extends F_{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class dut extends F_{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class hut extends F_{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:De.and(j.textInputFocus,(e=De.and(Bk,o3))===null||e===void 0?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class fut extends F_{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class gut extends F_{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class put extends F_{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:De.and(j.textInputFocus,(e=De.and(Bk,o3))===null||e===void 0?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class mut extends F_{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,n,r){return super._move(ou(yh.wordSeparators.defaultValue),t,n,r)}}class vut extends F_{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,n,r){return super._move(ou(yh.wordSeparators.defaultValue),t,n,r)}}class _ut extends B_{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class but extends B_{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:De.and(j.textInputFocus,(e=De.and(Bk,o3))===null||e===void 0?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class Cut extends B_{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class yut extends B_{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class wut extends B_{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:De.and(j.textInputFocus,(e=De.and(Bk,o3))===null||e===void 0?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class Sut extends B_{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class xut extends B_{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,n,r){return super._move(ou(yh.wordSeparators.defaultValue),t,n,r)}}class Lut extends B_{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,n,r){return super._move(ou(yh.wordSeparators.defaultValue),t,n,r)}}class v5 extends Vo{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){const r=e.get(Di);if(!t.hasModel())return;const o=ou(t.getOption(130)),s=t.getModel(),a=t.getSelections(),l=t.getOption(6),c=t.getOption(11),u=r.getLanguageConfiguration(s.getLanguageId()).getAutoClosingPairs(),d=t._getViewModel(),h=a.map(f=>{const g=this._delete({wordSeparators:o,model:s,selection:f,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(9),autoClosingBrackets:l,autoClosingQuotes:c,autoClosingPairs:u,autoClosedCharacters:d.getCursorAutoClosedCharacters()},this._wordNavigationType);return new os(g,"")});t.pushUndoStop(),t.executeCommands(this.id,h),t.pushUndoStop()}}class CZ extends v5{_delete(e,t){const n=Zn.deleteWordLeft(e,t);return n||new B(1,1,1,1)}}class yZ extends v5{_delete(e,t){const n=Zn.deleteWordRight(e,t);if(n)return n;const r=e.model.getLineCount(),o=e.model.getLineMaxColumn(r);return new B(r,o,r,o)}}class Eut extends CZ{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:j.writable})}}class Dut extends CZ{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:j.writable})}}class Iut extends CZ{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:j.writable,kbOpts:{kbExpr:j.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class kut extends yZ{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:j.writable})}}class Tut extends yZ{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:j.writable})}}class Nut extends yZ{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:j.writable,kbOpts:{kbExpr:j.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class Rut extends gt{constructor(){super({id:"deleteInsideWord",precondition:j.writable,label:w("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,t,n){if(!t.hasModel())return;const r=ou(t.getOption(130)),o=t.getModel(),a=t.getSelections().map(l=>{const c=Zn.deleteInsideWord(r,o,l);return new os(c,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}et(new uut);et(new dut);et(new hut);et(new fut);et(new gut);et(new put);et(new _ut);et(new but);et(new Cut);et(new yut);et(new wut);et(new Sut);et(new mut);et(new vut);et(new xut);et(new Lut);et(new Eut);et(new Dut);et(new Iut);et(new kut);et(new Tut);et(new Nut);Be(Rut);class Mut extends v5{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:j.writable,kbOpts:{kbExpr:j.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const n=B4.deleteWordPartLeft(e);return n||new B(1,1,1,1)}}class Aut extends v5{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:j.writable,kbOpts:{kbExpr:j.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const n=B4.deleteWordPartRight(e);if(n)return n;const r=e.model.getLineCount(),o=e.model.getLineMaxColumn(r);return new B(r,o,r,o)}}class uye extends m5{_move(e,t,n,r){return B4.moveWordPartLeft(e,t,n)}}class Put extends uye{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:j.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}Dn.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class Out extends uye{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:j.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}Dn.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class dye extends m5{_move(e,t,n,r){return B4.moveWordPartRight(e,t,n)}}class Fut extends dye{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:j.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class But extends dye{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:j.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}et(new Mut);et(new Aut);et(new Put);et(new Out);et(new Fut);et(new But);class hj extends fe{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=xa.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(92);t||(this.editor.isSimpleWidget?t=new Is(w("editor.simple.readonly","Cannot edit in read-only input")):t=new Is(w("editor.readonly","Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}}hj.ID="editor.contrib.readOnlyMessageController";jn(hj.ID,hj,2);var Wut=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Mle=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let fj=class extends fe{constructor(e,t,n){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=n,this._currentModel=Hn(this,void 0);const r=ma("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),o=ma("_textModel.onDidChangeContent",Je.debounce(s=>this._textModel.onDidChangeContent(s),()=>{},100));this._register(Dh(async(s,a)=>{r.read(s),o.read(s);const l=a.add(new qZe),c=await this._outlineModelService.getOrCreate(this._textModel,l.token);a.isDisposed||this._currentModel.set(c,void 0)}))}getBreadcrumbItems(e,t){const n=this._currentModel.read(t);if(!n)return[];const r=n.asListOfDocumentSymbols().filter(o=>e.contains(o.range.startLineNumber)&&!e.contains(o.range.endLineNumber));return r.sort(npe(Jc(o=>o.range.endLineNumber-o.range.startLineNumber,dp))),r.map(o=>({name:o.name,kind:o.kind,startLineNumber:o.range.startLineNumber}))}};fj=Wut([Mle(1,_t),Mle(2,pT)],fj);wI.setBreadcrumbsSourceFactory((i,e)=>e.createInstance(fj,i));class gj extends fe{constructor(e){super(),this.editor=e,this.widget=null,ch&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(91);!this.widget&&e?this.widget=new _5(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}}gj.ID="editor.contrib.iPadShowKeyboard";class _5 extends fe{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(ye(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(ye(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return _5.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}}_5.ID="editor.contrib.ShowKeyboardWidget";jn(gj.ID,gj,3);var $ut=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Ale=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},pj;let cS=pj=class extends fe{static get(e){return e.getContribution(pj.ID)}constructor(e,t,n){super(),this._editor=e,this._languageService=n,this._widget=null,this._register(this._editor.onDidChangeModel(r=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(r=>this.stop())),this._register(hr.onDidChange(r=>this.stop())),this._register(this._editor.onKeyUp(r=>r.keyCode===9&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new b5(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}};cS.ID="editor.contrib.inspectTokens";cS=pj=$ut([Ale(1,Sc),Ale(2,ji)],cS);class Hut extends gt{constructor(){super({id:"editor.action.inspectTokens",label:wV.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){const n=cS.get(t);n==null||n.launch()}}function Vut(i){let e="";for(let t=0,n=i.length;tNw,tokenize:(r,o,s)=>zq(e,s),tokenizeEncoded:(r,o,s)=>T4(n,s)}}class b5 extends fe{constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=zut(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(n=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return b5._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let n=0;for(let l=t.tokens1.length-1;l>=0;l--){const c=t.tokens1[l];if(e.column-1>=c.offset){n=l;break}}let r=0;for(let l=t.tokens2.length>>>1;l>=0;l--)if(e.column-1>=t.tokens2[l<<1]){r=l;break}const o=this._model.getLineContent(e.lineNumber);let s="";if(n=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Ple=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},jL;let AO=jL=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=ar.as(_C.Quickaccess)}provide(e){const t=new Te;return t.add(e.onDidAccept(()=>{const[n]=e.selectedItems;n&&this.quickInputService.quickAccess.show(n.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(n=>{const r=this.registry.getQuickAccessProvider(n.substr(jL.PREFIX.length));r&&r.prefix&&r.prefix!==jL.PREFIX&&this.quickInputService.quickAccess.show(r.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(n=>n.prefix!==jL.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,n)=>t.prefix.localeCompare(n.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const n=t.prefix||e.prefix,r=n||"…";return{prefix:n,label:r,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:w("helpPickAriaLabel","{0}, {1}",r,t.description),description:t.description}})}};AO.PREFIX="?";AO=jL=Uut([Ple(0,Eh),Ple(1,ci)],AO);ar.as(_C.Quickaccess).registerQuickAccessProvider({ctor:AO,prefix:"",helpEntries:[{description:SV.helpQuickAccessActionLabel}]});class hye{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t){var n;const r=new Te;e.canAcceptInBackground=!!(!((n=this.options)===null||n===void 0)&&n.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const o=r.add(new Ho);return o.value=this.doProvide(e,t),r.add(this.onDidActiveTextEditorControlChange(()=>{o.value=void 0,o.value=this.doProvide(e,t)})),r}doProvide(e,t){var n;const r=new Te,o=this.activeTextEditorControl;if(o&&this.canProvideWithTextEditor(o)){const s={editor:o},a=nbe(o);if(a){let l=(n=o.saveViewState())!==null&&n!==void 0?n:void 0;r.add(a.onDidChangeCursorPosition(()=>{var c;l=(c=o.saveViewState())!==null&&c!==void 0?c:void 0})),s.restoreViewState=()=>{l&&o===this.activeTextEditorControl&&o.restoreViewState(l)},r.add(Hv(t.onCancellationRequested)(()=>{var c;return(c=s.restoreViewState)===null||c===void 0?void 0:c.call(s)}))}r.add(Rt(()=>this.clearDecorations(o))),r.add(this.provideWithTextEditor(s,e,t))}else r.add(this.provideWithoutTextEditor(e,t));return r}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const n=e.getModel();n&&"getLineContent"in n&&Hf(`${n.getLineContent(t.range.startLineNumber)}`)}getModel(e){var t;return EY(e)?(t=e.getModel())===null||t===void 0?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(n=>{const r=[];this.rangeHighlightDecorationId&&(r.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),r.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const o=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:fr(Cve),position:mc.Full}}}],[s,a]=n.deltaDecorations(r,o);this.rangeHighlightDecorationId={rangeHighlightId:s,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(n=>{n.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}class C5 extends hye{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=w("cannotRunGotoLine","Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,fe.None}provideWithTextEditor(e,t,n){const r=e.editor,o=new Te;o.add(t.onDidAccept(l=>{const[c]=t.selectedItems;if(c){if(!this.isValidLineNumber(r,c.lineNumber))return;this.gotoLocation(e,{range:this.toRange(c.lineNumber,c.column),keyMods:t.keyMods,preserveFocus:l.inBackground}),l.inBackground||t.hide()}}));const s=()=>{const l=this.parsePosition(r,t.value.trim().substr(C5.PREFIX.length)),c=this.getPickLabel(r,l.lineNumber,l.column);if(t.items=[{lineNumber:l.lineNumber,column:l.column,label:c}],t.ariaLabel=c,!this.isValidLineNumber(r,l.lineNumber)){this.clearDecorations(r);return}const u=this.toRange(l.lineNumber,l.column);r.revealRangeInCenter(u,0),this.addDecorations(r,u)};s(),o.add(t.onDidChangeValue(()=>s()));const a=nbe(r);return a&&a.getOptions().get(68).renderType===2&&(a.updateOptions({lineNumbers:"on"}),o.add(Rt(()=>a.updateOptions({lineNumbers:"relative"})))),o}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const n=t.split(/,|:|#/).map(o=>parseInt(o,10)).filter(o=>!isNaN(o)),r=this.lineCount(e)+1;return{lineNumber:n[0]>0?n[0]:r+n[0],column:n[1]}}getPickLabel(e,t,n){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,n)?w("gotoLineColumnLabel","Go to line {0} and character {1}.",t,n):w("gotoLineLabel","Go to line {0}.",t);const r=e.getPosition()||{lineNumber:1,column:1},o=this.lineCount(e);return o>1?w("gotoLineLabelEmptyWithLimit","Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",r.lineNumber,r.column,o):w("gotoLineLabelEmpty","Current Line: {0}, Character: {1}. Type a line number to navigate to.",r.lineNumber,r.column)}isValidLineNumber(e,t){return!t||typeof t!="number"?!1:t>0&&t<=this.lineCount(e)}isValidColumn(e,t,n){if(!n||typeof n!="number")return!1;const r=this.getModel(e);if(!r)return!1;const o={lineNumber:t,column:n};return r.validatePosition(o).equals(o)}lineCount(e){var t,n;return(n=(t=this.getModel(e))===null||t===void 0?void 0:t.getLineCount())!==null&&n!==void 0?n:0}}C5.PREFIX=":";var jut=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Kut=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let QI=class extends C5{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=Je.None}get activeTextEditorControl(){var e;return(e=this.editorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}};QI=jut([Kut(0,Un)],QI);let wZ=class fye extends gt{constructor(){super({id:fye.ID,label:TP.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:j.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(Eh).quickAccess.show(QI.PREFIX)}};wZ.ID="editor.action.gotoLine";Be(wZ);ar.as(_C.Quickaccess).registerQuickAccessProvider({ctor:QI,prefix:QI.PREFIX,helpEntries:[{description:TP.gotoLineActionLabel,commandId:wZ.ID}]});const gye=[void 0,[]];function G9(i,e,t=0,n=0){const r=e;return r.values&&r.values.length>1?Gut(i,r.values,t,n):pye(i,e,t,n)}function Gut(i,e,t,n){let r=0;const o=[];for(const s of e){const[a,l]=pye(i,s,t,n);if(typeof a!="number")return gye;r+=a,o.push(...l)}return[r,qut(o)]}function pye(i,e,t,n){const r=Ab(e.original,e.originalLowercase,t,i,i.toLowerCase(),n,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return r?[r[0],qk(r)]:gye}function qut(i){const e=i.sort((r,o)=>r.start-o.start),t=[];let n;for(const r of e)!n||!Xut(n,r)?(n=r,t.push(r)):(n.start=Math.min(n.start,r.start),n.end=Math.max(n.end,r.end));return t}function Xut(i,e){return!(i.end=0,s=Ole(i);let a;const l=i.split(mye);if(l.length>1)for(const c of l){const u=Ole(c),{pathNormalized:d,normalized:h,normalizedLowercase:f}=Fle(c);h&&(a||(a=[]),a.push({original:c,originalLowercase:c.toLowerCase(),pathNormalized:d,normalized:h,normalizedLowercase:f,expectContiguousMatch:u}))}return{original:i,originalLowercase:e,pathNormalized:t,normalized:n,normalizedLowercase:r,values:a,containsPathSeparator:o,expectContiguousMatch:s}}function Fle(i){let e;Rs?e=i.replace(/\//g,eh):e=i.replace(/\\/g,eh);const t=W5e(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function Ble(i){return Array.isArray(i)?mj(i.map(e=>e.original).join(mye)):mj(i.original)}var Yut=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Wle=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},iw;let Pf=iw=class extends hye{constructor(e,t,n=Object.create(null)){super(n),this._languageFeaturesService=e,this._outlineModelService=t,this.options=n,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,w("cannotRunGotoSymbolWithoutEditor","To go to a symbol, first open a text editor with symbol information.")),fe.None}provideWithTextEditor(e,t,n){const r=e.editor,o=this.getModel(r);return o?this._languageFeaturesService.documentSymbolProvider.has(o)?this.doProvideWithEditorSymbols(e,o,t,n):this.doProvideWithoutEditorSymbols(e,o,t,n):fe.None}doProvideWithoutEditorSymbols(e,t,n,r){const o=new Te;return this.provideLabelPick(n,w("cannotRunGotoSymbolWithoutSymbolProvider","The active text editor does not provide symbol information.")),(async()=>!await this.waitForLanguageSymbolRegistry(t,o)||r.isCancellationRequested||o.add(this.doProvideWithEditorSymbols(e,t,n,r)))(),o}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}async waitForLanguageSymbolRegistry(e,t){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const n=new a4,r=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(r.dispose(),n.complete(!0))}));return t.add(Rt(()=>n.complete(!1))),n.p}doProvideWithEditorSymbols(e,t,n,r){var o;const s=e.editor,a=new Te;a.add(n.onDidAccept(d=>{const[h]=n.selectedItems;h&&h.range&&(this.gotoLocation(e,{range:h.range.selection,keyMods:n.keyMods,preserveFocus:d.inBackground}),d.inBackground||n.hide())})),a.add(n.onDidTriggerItemButton(({item:d})=>{d&&d.range&&(this.gotoLocation(e,{range:d.range.selection,keyMods:n.keyMods,forceSideBySide:!0}),n.hide())}));const l=this.getDocumentSymbols(t,r);let c;const u=async d=>{c==null||c.dispose(!0),n.busy=!1,c=new wr(r),n.busy=!0;try{const h=mj(n.value.substr(iw.PREFIX.length).trim()),f=await this.doGetSymbolPicks(l,h,void 0,c.token);if(r.isCancellationRequested)return;if(f.length>0){if(n.items=f,d&&h.original.length===0){const g=RD(f,p=>!!(p.type!=="separator"&&p.range&&B.containsPosition(p.range.decoration,d)));g&&(n.activeItems=[g])}}else h.original.length>0?this.provideLabelPick(n,w("noMatchingSymbolResults","No matching editor symbols")):this.provideLabelPick(n,w("noSymbolResults","No editor symbols"))}finally{r.isCancellationRequested||(n.busy=!1)}};return a.add(n.onDidChangeValue(()=>u(void 0))),u((o=s.getSelection())===null||o===void 0?void 0:o.getPosition()),a.add(n.onDidChangeActive(()=>{const[d]=n.activeItems;d&&d.range&&(s.revealRangeInCenter(d.range.selection,0),this.addDecorations(s,d.range.decoration))})),a}async doGetSymbolPicks(e,t,n,r){var o,s;const a=await e;if(r.isCancellationRequested)return[];const l=t.original.indexOf(iw.SCOPE_PREFIX)===0,c=l?1:0;let u,d;t.values&&t.values.length>1?(u=Ble(t.values[0]),d=Ble(t.values.slice(1))):u=t;let h;const f=(s=(o=this.options)===null||o===void 0?void 0:o.openSideBySideDirection)===null||s===void 0?void 0:s.call(o);f&&(h=[{iconClass:f==="right"?Wt.asClassName(Xe.splitHorizontal):Wt.asClassName(Xe.splitVertical),tooltip:f==="right"?w("openToSide","Open to the Side"):w("openToBottom","Open to the Bottom")}]);const g=[];for(let m=0;mc){let N=!1;if(u!==t&&([D,k]=G9(S,{...t,values:void 0},c,L),typeof D=="number"&&(N=!0)),typeof D!="number"&&([D,k]=G9(S,u,c,L),typeof D!="number"))continue;if(!N&&d){if(E&&d.original.length>0&&([T,M]=G9(E,d)),typeof T!="number")continue;typeof D=="number"&&(D+=T)}}const A=_.tags&&_.tags.indexOf(1)>=0;g.push({index:m,kind:_.kind,score:D,label:S,ariaLabel:T5e(_.name,_.kind),description:E,highlights:A?void 0:{label:k,description:M},range:{selection:B.collapseToStart(_.selectionRange),decoration:_.range},strikethrough:A,buttons:h})}const p=g.sort((m,_)=>l?this.compareByKindAndScore(m,_):this.compareByScore(m,_));let v=[];if(l){let S=function(){_&&typeof m=="number"&&y>0&&(_.label=Eb(X9[m]||q9,y))},m,_,y=0;for(const L of p)m!==L.kind?(S(),m=L.kind,y=1,_={type:"separator"},v.push(_)):y++,v.push(L);S()}else p.length>0&&(v=[{label:w("symbols","symbols ({0})",g.length),type:"separator"},...p]);return v}compareByScore(e,t){if(typeof e.score!="number"&&typeof t.score=="number")return 1;if(typeof e.score=="number"&&typeof t.score!="number")return-1;if(typeof e.score=="number"&&typeof t.score=="number"){if(e.score>t.score)return-1;if(e.scoret.index?1:0}compareByKindAndScore(e,t){const n=X9[e.kind]||q9,r=X9[t.kind]||q9,o=n.localeCompare(r);return o===0?this.compareByScore(e,t):o}async getDocumentSymbols(e,t){const n=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:n.asListOfDocumentSymbols()}};Pf.PREFIX="@";Pf.SCOPE_PREFIX=":";Pf.PREFIX_BY_CATEGORY=`${iw.PREFIX}${iw.SCOPE_PREFIX}`;Pf=iw=Yut([Wle(0,_t),Wle(1,pT)],Pf);const q9=w("property","properties ({0})"),X9={[5]:w("method","methods ({0})"),[11]:w("function","functions ({0})"),[8]:w("_constructor","constructors ({0})"),[12]:w("variable","variables ({0})"),[4]:w("class","classes ({0})"),[22]:w("struct","structs ({0})"),[23]:w("event","events ({0})"),[24]:w("operator","operators ({0})"),[10]:w("interface","interfaces ({0})"),[2]:w("namespace","namespaces ({0})"),[3]:w("package","packages ({0})"),[25]:w("typeParameter","type parameters ({0})"),[1]:w("modules","modules ({0})"),[6]:w("property","properties ({0})"),[9]:w("enum","enumerations ({0})"),[21]:w("enumMember","enumeration members ({0})"),[14]:w("string","strings ({0})"),[0]:w("file","files ({0})"),[17]:w("array","arrays ({0})"),[15]:w("number","numbers ({0})"),[16]:w("boolean","booleans ({0})"),[18]:w("object","objects ({0})"),[19]:w("key","keys ({0})"),[7]:w("field","fields ({0})"),[13]:w("constant","constants ({0})")};var Zut=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Y9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let vj=class extends Pf{constructor(e,t,n){super(t,n),this.editorService=e,this.onDidActiveTextEditorControlChange=Je.None}get activeTextEditorControl(){var e;return(e=this.editorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}};vj=Zut([Y9(0,Un),Y9(1,_t),Y9(2,pT)],vj);class _T extends gt{constructor(){super({id:_T.ID,label:oI.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:j.hasDocumentSymbolProvider,kbOpts:{kbExpr:j.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(Eh).quickAccess.show(Pf.PREFIX,{itemActivation:Md.NONE})}}_T.ID="editor.action.quickOutline";Be(_T);ar.as(_C.Quickaccess).registerQuickAccessProvider({ctor:vj,prefix:Pf.PREFIX,helpEntries:[{description:oI.quickOutlineActionLabel,prefix:Pf.PREFIX,commandId:_T.ID},{description:oI.quickOutlineByCategoryActionLabel,prefix:Pf.PREFIX_BY_CATEGORY}]});function Z9(i,e){return e&&(i.stack||i.stacktrace)?w("stackTrace.format","{0}: {1}",Hle(i),$le(i.stack)||$le(i.stacktrace)):Hle(i)}function $le(i){return Array.isArray(i)?i.join(` +`):i}function Hle(i){return i.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${i.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof i.code=="string"&&typeof i.errno=="number"&&typeof i.syscall=="string"?w("nodeExceptionMessage","A system error occurred ({0})",i.message):i.message||w("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function vye(i=null,e=!1){if(!i)return w("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(i)){const t=lh(i),n=vye(t[0],e);return t.length>1?w("error.moreErrors","{0} ({1} errors in total)",n,t.length):n}if(Sa(i))return i;if(i.detail){const t=i.detail;if(t.error)return Z9(t.error,e);if(t.exception)return Z9(t.exception,e)}return i.stack?Z9(i,e):i.message?i.message:w("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function Qut(i){var e;const t=new Map;for(const n of i)t.set(n,((e=t.get(n))!==null&&e!==void 0?e:0)+1);return t}class $E{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const n=this.computeEmbedding(e),r=new Map,o=[];for(const[s,a]of this.documents){if(t.isCancellationRequested)return[];for(const l of a.chunks){const c=this.computeSimilarityScore(l,n,r);c>0&&o.push({key:s,score:c})}}return o}static termFrequencies(e){return Qut($E.splitTerms(e))}static*splitTerms(e){const t=n=>n.toLowerCase();for(const[n]of e.matchAll(/\b\p{Letter}[\p{Letter}\d]{2,}\b/gu)){yield t(n);const r=n.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(r.length>1)for(const o of r)o.length>2&&/\p{Letter}{3,}/gu.test(o)&&(yield t(o))}}updateDocuments(e){var t;for(const{key:n}of e)this.deleteDocument(n);for(const n of e){const r=[];for(const o of n.textChunks){const s=$E.termFrequencies(o);for(const a of s.keys())this.chunkOccurrences.set(a,((t=this.chunkOccurrences.get(a))!==null&&t!==void 0?t:0)+1);r.push({text:o,tf:s})}this.chunkCount+=r.length,this.documents.set(n.key,{chunks:r})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const n of t.chunks)for(const r of n.tf.keys()){const o=this.chunkOccurrences.get(r);if(typeof o=="number"){const s=o-1;s<=0?this.chunkOccurrences.delete(r):this.chunkOccurrences.set(r,s)}}}}computeSimilarityScore(e,t,n){let r=0;for(const[o,s]of Object.entries(t)){const a=e.tf.get(o);if(!a)continue;let l=n.get(o);typeof l!="number"&&(l=this.computeIdf(o),n.set(o,l));const c=a*l;r+=c*s}return r}computeEmbedding(e){const t=$E.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){var t;const n=(t=this.chunkOccurrences.get(e))!==null&&t!==void 0?t:0;return n>0?Math.log((this.chunkCount+1)/n):0}computeTfidf(e){const t=Object.create(null);for(const[n,r]of e){const o=this.computeIdf(n);o>0&&(t[n]=r*o)}return t}}function Jut(i){var e,t;const n=i.slice(0);n.sort((o,s)=>s.score-o.score);const r=(t=(e=n[0])===null||e===void 0?void 0:e.score)!==null&&t!==void 0?t:0;if(r>0)for(const o of n)o.score/=r;return n}var yy;(function(i){i[i.NO_ACTION=0]="NO_ACTION",i[i.CLOSE_PICKER=1]="CLOSE_PICKER",i[i.REFRESH_PICKER=2]="REFRESH_PICKER",i[i.REMOVE_ITEM=3]="REMOVE_ITEM"})(yy||(yy={}));function Q9(i){const e=i;return Array.isArray(e.items)}function Vle(i){const e=i;return!!e.picks&&e.additionalPicks instanceof Promise}class edt extends fe{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,n){var r;const o=new Te;e.canAcceptInBackground=!!(!((r=this.options)===null||r===void 0)&&r.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let s;const a=o.add(new Ho),l=async()=>{var c;const u=a.value=new Te;s==null||s.dispose(!0),e.busy=!1,s=new wr(t);const d=s.token;let h=e.value.substring(this.prefix.length);!((c=this.options)===null||c===void 0)&&c.shouldSkipTrimPickFilter||(h=h.trim());const f=this._getPicks(h,u,d,n),g=(v,m)=>{var _;let y,S;if(Q9(v)?(y=v.items,S=v.active):y=v,y.length===0){if(m)return!1;(h.length>0||e.hideInput)&&(!((_=this.options)===null||_===void 0)&&_.noResultsPick)&&(CD(this.options.noResultsPick)?y=[this.options.noResultsPick(h)]:y=[this.options.noResultsPick])}return e.items=y,S&&(e.activeItems=[S]),!0},p=async v=>{let m=!1,_=!1;await Promise.all([(async()=>{typeof v.mergeDelay=="number"&&(await Uv(v.mergeDelay),d.isCancellationRequested)||_||(m=g(v.picks,!0))})(),(async()=>{e.busy=!0;try{const y=await v.additionalPicks;if(d.isCancellationRequested)return;let S,L;Q9(v.picks)?(S=v.picks.items,L=v.picks.active):S=v.picks;let E,D;if(Q9(y)?(E=y.items,D=y.active):E=y,E.length>0||!m){let k;if(!L&&!D){const T=e.activeItems[0];T&&S.indexOf(T)!==-1&&(k=T)}g({items:[...S,...E],active:L||D||k})}}finally{d.isCancellationRequested||(e.busy=!1),_=!0}})()])};if(f!==null)if(Vle(f))await p(f);else if(!(f instanceof Promise))g(f);else{e.busy=!0;try{const v=await f;if(d.isCancellationRequested)return;Vle(v)?await p(v):g(v)}finally{d.isCancellationRequested||(e.busy=!1)}}};return o.add(e.onDidChangeValue(()=>l())),l(),o.add(e.onDidAccept(c=>{const[u]=e.selectedItems;typeof(u==null?void 0:u.accept)=="function"&&(c.inBackground||e.hide(),u.accept(e.keyMods,c))})),o.add(e.onDidTriggerItemButton(async({button:c,item:u})=>{var d,h;if(typeof u.trigger=="function"){const f=(h=(d=u.buttons)===null||d===void 0?void 0:d.indexOf(c))!==null&&h!==void 0?h:-1;if(f>=0){const g=u.trigger(f,e.keyMods),p=typeof g=="number"?g:await g;if(t.isCancellationRequested)return;switch(p){case yy.NO_ACTION:break;case yy.CLOSE_PICKER:e.hide();break;case yy.REFRESH_PICKER:l();break;case yy.REMOVE_ITEM:{const v=e.items.indexOf(u);if(v!==-1){const m=e.items.slice(),_=m.splice(v,1),y=e.activeItems.filter(L=>L!==_[0]),S=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=m,y&&(e.activeItems=y),e.keepScrollPosition=S}break}}}}})),o}}var _ye=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},N0=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},v0,to;let eC=v0=class extends edt{constructor(e,t,n,r,o,s){super(v0.PREFIX,e),this.instantiationService=t,this.keybindingService=n,this.commandService=r,this.telemetryService=o,this.dialogService=s,this.commandsHistory=this._register(this.instantiationService.createInstance(p_)),this.options=e}async _getPicks(e,t,n,r){var o,s,a,l;const c=await this.getCommandPicks(n);if(n.isCancellationRequested)return[];const u=Hv(()=>{const m=new $E;m.updateDocuments(c.map(y=>({key:y.commandId,textChunks:[this.getTfIdfChunk(y)]})));const _=m.calculateScores(e,n);return Jut(_).filter(y=>y.score>v0.TFIDF_THRESHOLD).slice(0,v0.TFIDF_MAX_RESULTS)}),d=[];for(const m of c){const _=(o=v0.WORD_FILTER(e,m.label))!==null&&o!==void 0?o:void 0,y=m.commandAlias&&(s=v0.WORD_FILTER(e,m.commandAlias))!==null&&s!==void 0?s:void 0;if(_||y)m.highlights={label:_,detail:this.options.showAlias?y:void 0},d.push(m);else if(e===m.commandId)d.push(m);else if(e.length>=3){const S=u();if(n.isCancellationRequested)return[];const L=S.find(E=>E.key===m.commandId);L&&(m.tfIdfScore=L.score,d.push(m))}}const h=new Map;for(const m of d){const _=h.get(m.label);_?(m.description=m.commandId,_.description=_.commandId):h.set(m.label,m)}d.sort((m,_)=>{if(m.tfIdfScore&&_.tfIdfScore)return m.tfIdfScore===_.tfIdfScore?m.label.localeCompare(_.label):_.tfIdfScore-m.tfIdfScore;if(m.tfIdfScore)return 1;if(_.tfIdfScore)return-1;const y=this.commandsHistory.peek(m.commandId),S=this.commandsHistory.peek(_.commandId);if(y&&S)return y>S?-1:1;if(y)return-1;if(S)return 1;if(this.options.suggestedCommandIds){const L=this.options.suggestedCommandIds.has(m.commandId),E=this.options.suggestedCommandIds.has(_.commandId);if(L&&E)return 0;if(L)return-1;if(E)return 1}return m.label.localeCompare(_.label)});const f=[];let g=!1,p=!0,v=!!this.options.suggestedCommandIds;for(let m=0;m{var m;const _=await this.getAdditionalCommandPicks(c,d,e,n);if(n.isCancellationRequested)return[];const y=_.map(S=>this.toCommandPick(S,r));return p&&((m=y[0])===null||m===void 0?void 0:m.type)!=="separator"&&y.unshift({type:"separator",label:w("suggested","similar commands")}),y})()}:f}toCommandPick(e,t){if(e.type==="separator")return e;const n=this.keybindingService.lookupKeybinding(e.commandId),r=n?w("commandPickAriaLabelWithKeybinding","{0}, {1}",e.label,n.getAriaLabel()):e.label;return{...e,ariaLabel:r,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:n,accept:async()=>{var o,s;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:(o=t==null?void 0:t.from)!==null&&o!==void 0?o:"quick open"});try{!((s=e.args)===null||s===void 0)&&s.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(a){wh(a)||this.dialogService.error(w("canNotRun","Command '{0}' resulted in an error",e.label),vye(a))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:n}){let r=e;return t&&t!==e&&(r+=` - ${t}`),n&&n.value!==e&&(r+=` - ${n.value===n.original?n.value:`${n.value} (${n.original})`}`),r}};eC.PREFIX=">";eC.TFIDF_THRESHOLD=.5;eC.TFIDF_MAX_RESULTS=5;eC.WORD_FILTER=RX(iI,fKe,x_e);eC=v0=_ye([N0(1,Ot),N0(2,ci),N0(3,sr),N0(4,ea),N0(5,Gk)],eC);let p_=to=class extends fe{constructor(e,t){super(),this.storageService=e,this.configurationService=t,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e))),this._register(this.storageService.onWillSaveState(e=>{e.reason===cI.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=to.getConfiguredCommandHistoryLength(this.configurationService),to.cache&&to.cache.limit!==this.configuredCommandsHistoryLength&&(to.cache.limit=this.configuredCommandsHistoryLength,to.hasChanges=!0))}load(){const e=this.storageService.get(to.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch{}const n=to.cache=new E_(this.configuredCommandsHistoryLength,1);if(t){let r;t.usesLRU?r=t.entries:r=t.entries.sort((o,s)=>o.value-s.value),r.forEach(o=>n.set(o.key,o.value))}to.counter=this.storageService.getNumber(to.PREF_KEY_COUNTER,0,to.counter)}push(e){to.cache&&(to.cache.set(e,to.counter++),to.hasChanges=!0)}peek(e){var t;return(t=to.cache)===null||t===void 0?void 0:t.peek(e)}saveState(){if(!to.cache||!to.hasChanges)return;const e={usesLRU:!0,entries:[]};to.cache.forEach((t,n)=>e.entries.push({key:n,value:t})),this.storageService.store(to.PREF_KEY_CACHE,JSON.stringify(e),0,0),this.storageService.store(to.PREF_KEY_COUNTER,to.counter,0,0),to.hasChanges=!1}static getConfiguredCommandHistoryLength(e){var t,n;const o=(n=(t=e.getValue().workbench)===null||t===void 0?void 0:t.commandPalette)===null||n===void 0?void 0:n.history;return typeof o=="number"?o:to.DEFAULT_COMMANDS_HISTORY_LENGTH}};p_.DEFAULT_COMMANDS_HISTORY_LENGTH=50;p_.PREF_KEY_CACHE="commandPalette.mru.cache";p_.PREF_KEY_COUNTER="commandPalette.mru.counter";p_.counter=1;p_.hasChanges=!1;p_=to=_ye([N0(0,dd),N0(1,gn)],p_);class tdt extends eC{constructor(e,t,n,r,o,s){super(e,t,n,r,o,s)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const n of e.getSupportedActions())t.push({commandId:n.id,commandAlias:n.alias,label:BX(n.label)||n.id});return t}}var ndt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},u1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let JI=class extends tdt{get activeTextEditorControl(){var e;return(e=this.codeEditorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}constructor(e,t,n,r,o,s){super({showAlias:!1},e,n,r,o,s),this.codeEditorService=t}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}};JI=ndt([u1(0,Ot),u1(1,Un),u1(2,ci),u1(3,sr),u1(4,ea),u1(5,Gk)],JI);class bT extends gt{constructor(){super({id:bT.ID,label:NP.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:j.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(Eh).quickAccess.show(JI.PREFIX)}}bT.ID="editor.action.quickCommand";Be(bT);ar.as(_C.Quickaccess).registerQuickAccessProvider({ctor:JI,prefix:JI.PREFIX,helpEntries:[{description:NP.quickCommandHelp,commandId:bT.ID}]});var idt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},d1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let _j=class extends a_{constructor(e,t,n,r,o,s,a){super(!0,e,t,n,r,o,s,a)}};_j=idt([d1(1,Vt),d1(2,Un),d1(3,$r),d1(4,Ot),d1(5,dd),d1(6,gn)],_j);jn(a_.ID,_j,4);class rdt extends gt{constructor(){super({id:"editor.action.toggleHighContrast",label:xV.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const n=e.get(Sc),r=n.getColorTheme();ih(r.type)?(n.setTheme(this._originalThemeName||(Pw(r.type)?Zy:zg)),this._originalThemeName=null):(n.setTheme(Pw(r.type)?ab:lb),this._originalThemeName=r.themeName)}}Be(rdt);const odt=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:sbe,Emitter:DY,KeyCode:abe,KeyMod:lbe,MarkerSeverity:fbe,MarkerTag:gbe,Position:cbe,Range:ube,Selection:dbe,SelectionDirection:hbe,Token:mbe,Uri:pbe,editor:vbe,languages:sT},Symbol.toStringTag,{value:"Module"}));function sdt(){return new Worker("/ir-virtual-machine/assets/editor.worker-3daf6cbf.js")}function adt(){return new Worker("/ir-virtual-machine/assets/json.worker-4a7a65e0.js")}function ldt(){return new Worker("/ir-virtual-machine/assets/css.worker-4b5427ce.js")}function cdt(){return new Worker("/ir-virtual-machine/assets/html.worker-85cb56ae.js")}function udt(){return new Worker("/ir-virtual-machine/assets/ts.worker-3bc0f4a5.js")}const ddt="_main_buuwy_1",hdt="_divRight_buuwy_7",fdt="_divVmWrapper_buuwy_14",gdt="_divVmContentBase_buuwy_20",pdt="_divVmContentVertical_buuwy_20",mdt="_divVmContentHorizontal_buuwy_20",oL={main:ddt,divRight:hdt,divVmWrapper:fdt,divVmContentBase:gdt,divVmContentVertical:pdt,divVmContentHorizontal:mdt},vdt="_asideSideBarWrapper_chse2_1",_dt="_divIconWrapperBase_chse2_11",bdt="_divIconWrapperLower_chse2_11",Cdt="_divIconWrapperUpper_chse2_11",ydt="_articleAbout_chse2_25",wdt="_aDemoSources_chse2_43",Sdt="_menuDemos_chse2_47",h1={asideSideBarWrapper:vdt,divIconWrapperBase:_dt,divIconWrapperLower:bdt,divIconWrapperUpper:Cdt,articleAbout:ydt,aDemoSources:wdt,menuDemos:Sdt};var xdt=C.createContext({});const SZ=xdt;function zn(i){return zn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zn(i)}function Ldt(i,e){if(zn(i)!=="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(zn(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function bye(i){var e=Ldt(i,"string");return zn(e)==="symbol"?e:String(e)}function be(i,e,t){return e=bye(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function zle(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,n)}return t}function te(i){for(var e=1;ei.length)&&(e=i.length);for(var t=0,n=new Array(e);t=0)&&Object.prototype.propertyIsEnumerable.call(i,n)&&(t[n]=i[n])}return t}var Cj={},Ddt={get exports(){return Cj},set exports(i){Cj=i}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames -*/(function(i){(function(){var e={}.hasOwnProperty;function t(){for(var n=[],r=0;r1)&&(i=1),i}function y2(i){return i<=1?"".concat(Number(i)*100,"%"):i}function X0(i){return i.length===1?"0"+i:String(i)}function Tdt(i,e,t){return{r:La(i,255)*255,g:La(e,255)*255,b:La(t,255)*255}}function Ule(i,e,t){i=La(i,255),e=La(e,255),t=La(t,255);var n=Math.max(i,e,t),r=Math.min(i,e,t),o=0,s=0,a=(n+r)/2;if(n===r)s=0,o=0;else{var l=n-r;switch(s=a>.5?l/(2-n-r):l/(n+r),n){case i:o=(e-t)/l+(e1&&(t-=1),t<1/6?i+(e-i)*(6*t):t<1/2?e:t<2/3?i+(e-i)*(2/3-t)*6:i}function Ndt(i,e,t){var n,r,o;if(i=La(i,360),e=La(e,100),t=La(t,100),e===0)r=t,o=t,n=t;else{var s=t<.5?t*(1+e):t+e-t*e,a=2*t-s;n=J9(a,s,i+1/3),r=J9(a,s,i),o=J9(a,s,i-1/3)}return{r:n*255,g:r*255,b:o*255}}function yj(i,e,t){i=La(i,255),e=La(e,255),t=La(t,255);var n=Math.max(i,e,t),r=Math.min(i,e,t),o=0,s=n,a=n-r,l=n===0?0:a/n;if(n===r)o=0;else{switch(n){case i:o=(e-t)/a+(e>16,g:(i&65280)>>8,b:i&255}}var Sj={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function P1(i){var e={r:0,g:0,b:0},t=1,n=null,r=null,o=null,s=!1,a=!1;return typeof i=="string"&&(i=Bdt(i)),typeof i=="object"&&(yg(i.r)&&yg(i.g)&&yg(i.b)?(e=Tdt(i.r,i.g,i.b),s=!0,a=String(i.r).substr(-1)==="%"?"prgb":"rgb"):yg(i.h)&&yg(i.s)&&yg(i.v)?(n=y2(i.s),r=y2(i.v),e=Rdt(i.h,n,r),s=!0,a="hsv"):yg(i.h)&&yg(i.s)&&yg(i.l)&&(n=y2(i.s),o=y2(i.l),e=Ndt(i.h,n,o),s=!0,a="hsl"),Object.prototype.hasOwnProperty.call(i,"a")&&(t=i.a)),t=wye(t),{ok:s,format:i.format||a,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}var Odt="[-\\+]?\\d+%?",Fdt="[-\\+]?\\d*\\.\\d+%?",rv="(?:".concat(Fdt,")|(?:").concat(Odt,")"),e7="[\\s|\\(]+(".concat(rv,")[,|\\s]+(").concat(rv,")[,|\\s]+(").concat(rv,")\\s*\\)?"),t7="[\\s|\\(]+(".concat(rv,")[,|\\s]+(").concat(rv,")[,|\\s]+(").concat(rv,")[,|\\s]+(").concat(rv,")\\s*\\)?"),Ed={CSS_UNIT:new RegExp(rv),rgb:new RegExp("rgb"+e7),rgba:new RegExp("rgba"+t7),hsl:new RegExp("hsl"+e7),hsla:new RegExp("hsla"+t7),hsv:new RegExp("hsv"+e7),hsva:new RegExp("hsva"+t7),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function Bdt(i){if(i=i.trim().toLowerCase(),i.length===0)return!1;var e=!1;if(Sj[i])i=Sj[i],e=!0;else if(i==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=Ed.rgb.exec(i);return t?{r:t[1],g:t[2],b:t[3]}:(t=Ed.rgba.exec(i),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Ed.hsl.exec(i),t?{h:t[1],s:t[2],l:t[3]}:(t=Ed.hsla.exec(i),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Ed.hsv.exec(i),t?{h:t[1],s:t[2],v:t[3]}:(t=Ed.hsva.exec(i),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Ed.hex8.exec(i),t?{r:Bc(t[1]),g:Bc(t[2]),b:Bc(t[3]),a:jle(t[4]),format:e?"name":"hex8"}:(t=Ed.hex6.exec(i),t?{r:Bc(t[1]),g:Bc(t[2]),b:Bc(t[3]),format:e?"name":"hex"}:(t=Ed.hex4.exec(i),t?{r:Bc(t[1]+t[1]),g:Bc(t[2]+t[2]),b:Bc(t[3]+t[3]),a:jle(t[4]+t[4]),format:e?"name":"hex8"}:(t=Ed.hex3.exec(i),t?{r:Bc(t[1]+t[1]),g:Bc(t[2]+t[2]),b:Bc(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function yg(i){return!!Ed.CSS_UNIT.exec(String(i))}var Yr=function(){function i(e,t){e===void 0&&(e=""),t===void 0&&(t={});var n;if(e instanceof i)return e;typeof e=="number"&&(e=Pdt(e)),this.originalInput=e;var r=P1(e);this.originalInput=e,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=(n=t.format)!==null&&n!==void 0?n:r.format,this.gradientType=t.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return i.prototype.isDark=function(){return this.getBrightness()<128},i.prototype.isLight=function(){return!this.isDark()},i.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},i.prototype.getLuminance=function(){var e=this.toRgb(),t,n,r,o=e.r/255,s=e.g/255,a=e.b/255;return o<=.03928?t=o/12.92:t=Math.pow((o+.055)/1.055,2.4),s<=.03928?n=s/12.92:n=Math.pow((s+.055)/1.055,2.4),a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),.2126*t+.7152*n+.0722*r},i.prototype.getAlpha=function(){return this.a},i.prototype.setAlpha=function(e){return this.a=wye(e),this.roundA=Math.round(100*this.a)/100,this},i.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},i.prototype.toHsv=function(){var e=yj(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},i.prototype.toHsvString=function(){var e=yj(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.v*100);return this.a===1?"hsv(".concat(t,", ").concat(n,"%, ").concat(r,"%)"):"hsva(".concat(t,", ").concat(n,"%, ").concat(r,"%, ").concat(this.roundA,")")},i.prototype.toHsl=function(){var e=Ule(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},i.prototype.toHslString=function(){var e=Ule(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.l*100);return this.a===1?"hsl(".concat(t,", ").concat(n,"%, ").concat(r,"%)"):"hsla(".concat(t,", ").concat(n,"%, ").concat(r,"%, ").concat(this.roundA,")")},i.prototype.toHex=function(e){return e===void 0&&(e=!1),wj(this.r,this.g,this.b,e)},i.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},i.prototype.toHex8=function(e){return e===void 0&&(e=!1),Mdt(this.r,this.g,this.b,this.a,e)},i.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},i.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},i.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},i.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(t,", ").concat(n,")"):"rgba(".concat(e,", ").concat(t,", ").concat(n,", ").concat(this.roundA,")")},i.prototype.toPercentageRgb=function(){var e=function(t){return"".concat(Math.round(La(t,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},i.prototype.toPercentageRgbString=function(){var e=function(t){return Math.round(La(t,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},i.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+wj(this.r,this.g,this.b,!1),t=0,n=Object.entries(Sj);t=0,o=!t&&r&&(e.startsWith("hex")||e==="name");return o?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(n=this.toRgbString()),e==="prgb"&&(n=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(n=this.toHexString()),e==="hex3"&&(n=this.toHexString(!0)),e==="hex4"&&(n=this.toHex8String(!0)),e==="hex8"&&(n=this.toHex8String()),e==="name"&&(n=this.toName()),e==="hsl"&&(n=this.toHslString()),e==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},i.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},i.prototype.clone=function(){return new i(this.toString())},i.prototype.lighten=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l+=e/100,t.l=C2(t.l),new i(t)},i.prototype.brighten=function(e){e===void 0&&(e=10);var t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),new i(t)},i.prototype.darken=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l-=e/100,t.l=C2(t.l),new i(t)},i.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},i.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},i.prototype.desaturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s-=e/100,t.s=C2(t.s),new i(t)},i.prototype.saturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s+=e/100,t.s=C2(t.s),new i(t)},i.prototype.greyscale=function(){return this.desaturate(100)},i.prototype.spin=function(e){var t=this.toHsl(),n=(t.h+e)%360;return t.h=n<0?360+n:n,new i(t)},i.prototype.mix=function(e,t){t===void 0&&(t=50);var n=this.toRgb(),r=new i(e).toRgb(),o=t/100,s={r:(r.r-n.r)*o+n.r,g:(r.g-n.g)*o+n.g,b:(r.b-n.b)*o+n.b,a:(r.a-n.a)*o+n.a};return new i(s)},i.prototype.analogous=function(e,t){e===void 0&&(e=6),t===void 0&&(t=30);var n=this.toHsl(),r=360/t,o=[this];for(n.h=(n.h-(r*e>>1)+720)%360;--e;)n.h=(n.h+r)%360,o.push(new i(n));return o},i.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new i(e)},i.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var t=this.toHsv(),n=t.h,r=t.s,o=t.v,s=[],a=1/e;e--;)s.push(new i({h:n,s:r,v:o})),o=(o+a)%1;return s},i.prototype.splitcomplement=function(){var e=this.toHsl(),t=e.h;return[this,new i({h:(t+72)%360,s:e.s,l:e.l}),new i({h:(t+216)%360,s:e.s,l:e.l})]},i.prototype.onBackground=function(e){var t=this.toRgb(),n=new i(e).toRgb(),r=t.a+n.a*(1-t.a);return new i({r:(t.r*t.a+n.r*n.a*(1-t.a))/r,g:(t.g*t.a+n.g*n.a*(1-t.a))/r,b:(t.b*t.a+n.b*n.a*(1-t.a))/r,a:r})},i.prototype.triad=function(){return this.polyad(3)},i.prototype.tetrad=function(){return this.polyad(4)},i.prototype.polyad=function(e){for(var t=this.toHsl(),n=t.h,r=[this],o=360/e,s=1;s=60&&Math.round(i.h)<=240?n=t?Math.round(i.h)-w2*e:Math.round(i.h)+w2*e:n=t?Math.round(i.h)+w2*e:Math.round(i.h)-w2*e,n<0?n+=360:n>=360&&(n-=360),n}function Xle(i,e,t){if(i.h===0&&i.s===0)return i.s;var n;return t?n=i.s-Kle*e:e===xye?n=i.s+Kle:n=i.s+Wdt*e,n>1&&(n=1),t&&e===Sye&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2))}function Yle(i,e,t){var n;return t?n=i.v+$dt*e:n=i.v-Hdt*e,n>1&&(n=1),Number(n.toFixed(2))}function Ap(i){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=[],n=P1(i),r=Sye;r>0;r-=1){var o=Gle(n),s=S2(P1({h:qle(o,r,!0),s:Xle(o,r,!0),v:Yle(o,r,!0)}));t.push(s)}t.push(S2(n));for(var a=1;a<=xye;a+=1){var l=Gle(n),c=S2(P1({h:qle(l,a),s:Xle(l,a),v:Yle(l,a)}));t.push(c)}return e.theme==="dark"?Vdt.map(function(u){var d=u.index,h=u.opacity,f=S2(zdt(P1(e.backgroundColor||"#141414"),P1(t[d]),h*100));return f}):t}var rw={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1677FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},n7={},i7={};Object.keys(rw).forEach(function(i){n7[i]=Ap(rw[i]),n7[i].primary=n7[i][5],i7[i]=Ap(rw[i],{theme:"dark",backgroundColor:"#141414"}),i7[i].primary=i7[i][5]});var xj={},Udt=function(e){};function jdt(i,e){}function Kdt(i,e){}function Gdt(){xj={}}function Lye(i,e,t){!e&&!xj[t]&&(i(!1,t),xj[t]=!0)}function ao(i,e){Lye(jdt,i,e)}function qdt(i,e){Lye(Kdt,i,e)}ao.preMessage=Udt;ao.resetWarned=Gdt;ao.noteOnce=qdt;function Zs(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function gb(i,e){if(!i)return!1;if(i.contains)return i.contains(e);for(var t=e;t;){if(t===i)return!0;t=t.parentNode}return!1}var Zle="data-rc-order",Xdt="rc-util-key",Lj=new Map;function Eye(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=i.mark;return e?e.startsWith("data-")?e:"data-".concat(e):Xdt}function y5(i){if(i.attachTo)return i.attachTo;var e=document.querySelector("head");return e||document.body}function Ydt(i){return i==="queue"?"prependQueue":i?"prepend":"append"}function Dye(i){return Array.from((Lj.get(i)||i).children).filter(function(e){return e.tagName==="STYLE"})}function Iye(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Zs())return null;var t=e.csp,n=e.prepend,r=document.createElement("style");r.setAttribute(Zle,Ydt(n)),t!=null&&t.nonce&&(r.nonce=t==null?void 0:t.nonce),r.innerHTML=i;var o=y5(e),s=o.firstChild;if(n){if(n==="queue"){var a=Dye(o).filter(function(l){return["prepend","prependQueue"].includes(l.getAttribute(Zle))});if(a.length)return o.insertBefore(r,a[a.length-1].nextSibling),r}o.insertBefore(r,s)}else o.appendChild(r);return r}function kye(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=y5(e);return Dye(t).find(function(n){return n.getAttribute(Eye(e))===i})}function PO(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=kye(i,e);if(t){var n=y5(e);n.removeChild(t)}}function Zdt(i,e){var t=Lj.get(i);if(!t||!gb(document,t)){var n=Iye("",e),r=n.parentNode;Lj.set(i,r),i.removeChild(n)}}function uS(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=y5(t);Zdt(n,t);var r=kye(e,t);if(r){var o,s;if((o=t.csp)!==null&&o!==void 0&&o.nonce&&r.nonce!==((s=t.csp)===null||s===void 0?void 0:s.nonce)){var a;r.nonce=(a=t.csp)===null||a===void 0?void 0:a.nonce}return r.innerHTML!==i&&(r.innerHTML=i),r}var l=Iye(i,t);return l.setAttribute(Eye(t),e),l}function Qdt(i,e){ao(i,"[@ant-design/icons] ".concat(e))}function Qle(i){return zn(i)==="object"&&typeof i.name=="string"&&typeof i.theme=="string"&&(zn(i.icon)==="object"||typeof i.icon=="function")}function Jle(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(i).reduce(function(e,t){var n=i[t];switch(t){case"class":e.className=n,delete e.class;break;default:e[t]=n}return e},{})}function Ej(i,e,t){return t?$e.createElement(i.tag,te(te({key:e},Jle(i.attrs)),t),(i.children||[]).map(function(n,r){return Ej(n,"".concat(e,"-").concat(i.tag,"-").concat(r))})):$e.createElement(i.tag,te({key:e},Jle(i.attrs)),(i.children||[]).map(function(n,r){return Ej(n,"".concat(e,"-").concat(i.tag,"-").concat(r))}))}function Tye(i){return Ap(i)[0]}function Nye(i){return i?Array.isArray(i)?i:[i]:[]}var Jdt=` +*/(function(i){(function(){var e={}.hasOwnProperty;function t(){for(var n=[],r=0;r1)&&(i=1),i}function y2(i){return i<=1?"".concat(Number(i)*100,"%"):i}function q0(i){return i.length===1?"0"+i:String(i)}function Tdt(i,e,t){return{r:La(i,255)*255,g:La(e,255)*255,b:La(t,255)*255}}function Ule(i,e,t){i=La(i,255),e=La(e,255),t=La(t,255);var n=Math.max(i,e,t),r=Math.min(i,e,t),o=0,s=0,a=(n+r)/2;if(n===r)s=0,o=0;else{var l=n-r;switch(s=a>.5?l/(2-n-r):l/(n+r),n){case i:o=(e-t)/l+(e1&&(t-=1),t<1/6?i+(e-i)*(6*t):t<1/2?e:t<2/3?i+(e-i)*(2/3-t)*6:i}function Ndt(i,e,t){var n,r,o;if(i=La(i,360),e=La(e,100),t=La(t,100),e===0)r=t,o=t,n=t;else{var s=t<.5?t*(1+e):t+e-t*e,a=2*t-s;n=J9(a,s,i+1/3),r=J9(a,s,i),o=J9(a,s,i-1/3)}return{r:n*255,g:r*255,b:o*255}}function yj(i,e,t){i=La(i,255),e=La(e,255),t=La(t,255);var n=Math.max(i,e,t),r=Math.min(i,e,t),o=0,s=n,a=n-r,l=n===0?0:a/n;if(n===r)o=0;else{switch(n){case i:o=(e-t)/a+(e>16,g:(i&65280)>>8,b:i&255}}var Sj={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function P1(i){var e={r:0,g:0,b:0},t=1,n=null,r=null,o=null,s=!1,a=!1;return typeof i=="string"&&(i=Bdt(i)),typeof i=="object"&&(yg(i.r)&&yg(i.g)&&yg(i.b)?(e=Tdt(i.r,i.g,i.b),s=!0,a=String(i.r).substr(-1)==="%"?"prgb":"rgb"):yg(i.h)&&yg(i.s)&&yg(i.v)?(n=y2(i.s),r=y2(i.v),e=Rdt(i.h,n,r),s=!0,a="hsv"):yg(i.h)&&yg(i.s)&&yg(i.l)&&(n=y2(i.s),o=y2(i.l),e=Ndt(i.h,n,o),s=!0,a="hsl"),Object.prototype.hasOwnProperty.call(i,"a")&&(t=i.a)),t=wye(t),{ok:s,format:i.format||a,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}var Odt="[-\\+]?\\d+%?",Fdt="[-\\+]?\\d*\\.\\d+%?",ov="(?:".concat(Fdt,")|(?:").concat(Odt,")"),e7="[\\s|\\(]+(".concat(ov,")[,|\\s]+(").concat(ov,")[,|\\s]+(").concat(ov,")\\s*\\)?"),t7="[\\s|\\(]+(".concat(ov,")[,|\\s]+(").concat(ov,")[,|\\s]+(").concat(ov,")[,|\\s]+(").concat(ov,")\\s*\\)?"),Ed={CSS_UNIT:new RegExp(ov),rgb:new RegExp("rgb"+e7),rgba:new RegExp("rgba"+t7),hsl:new RegExp("hsl"+e7),hsla:new RegExp("hsla"+t7),hsv:new RegExp("hsv"+e7),hsva:new RegExp("hsva"+t7),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function Bdt(i){if(i=i.trim().toLowerCase(),i.length===0)return!1;var e=!1;if(Sj[i])i=Sj[i],e=!0;else if(i==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=Ed.rgb.exec(i);return t?{r:t[1],g:t[2],b:t[3]}:(t=Ed.rgba.exec(i),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Ed.hsl.exec(i),t?{h:t[1],s:t[2],l:t[3]}:(t=Ed.hsla.exec(i),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Ed.hsv.exec(i),t?{h:t[1],s:t[2],v:t[3]}:(t=Ed.hsva.exec(i),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Ed.hex8.exec(i),t?{r:Bc(t[1]),g:Bc(t[2]),b:Bc(t[3]),a:jle(t[4]),format:e?"name":"hex8"}:(t=Ed.hex6.exec(i),t?{r:Bc(t[1]),g:Bc(t[2]),b:Bc(t[3]),format:e?"name":"hex"}:(t=Ed.hex4.exec(i),t?{r:Bc(t[1]+t[1]),g:Bc(t[2]+t[2]),b:Bc(t[3]+t[3]),a:jle(t[4]+t[4]),format:e?"name":"hex8"}:(t=Ed.hex3.exec(i),t?{r:Bc(t[1]+t[1]),g:Bc(t[2]+t[2]),b:Bc(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function yg(i){return!!Ed.CSS_UNIT.exec(String(i))}var Yr=function(){function i(e,t){e===void 0&&(e=""),t===void 0&&(t={});var n;if(e instanceof i)return e;typeof e=="number"&&(e=Pdt(e)),this.originalInput=e;var r=P1(e);this.originalInput=e,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=(n=t.format)!==null&&n!==void 0?n:r.format,this.gradientType=t.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return i.prototype.isDark=function(){return this.getBrightness()<128},i.prototype.isLight=function(){return!this.isDark()},i.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},i.prototype.getLuminance=function(){var e=this.toRgb(),t,n,r,o=e.r/255,s=e.g/255,a=e.b/255;return o<=.03928?t=o/12.92:t=Math.pow((o+.055)/1.055,2.4),s<=.03928?n=s/12.92:n=Math.pow((s+.055)/1.055,2.4),a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),.2126*t+.7152*n+.0722*r},i.prototype.getAlpha=function(){return this.a},i.prototype.setAlpha=function(e){return this.a=wye(e),this.roundA=Math.round(100*this.a)/100,this},i.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},i.prototype.toHsv=function(){var e=yj(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},i.prototype.toHsvString=function(){var e=yj(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.v*100);return this.a===1?"hsv(".concat(t,", ").concat(n,"%, ").concat(r,"%)"):"hsva(".concat(t,", ").concat(n,"%, ").concat(r,"%, ").concat(this.roundA,")")},i.prototype.toHsl=function(){var e=Ule(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},i.prototype.toHslString=function(){var e=Ule(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.l*100);return this.a===1?"hsl(".concat(t,", ").concat(n,"%, ").concat(r,"%)"):"hsla(".concat(t,", ").concat(n,"%, ").concat(r,"%, ").concat(this.roundA,")")},i.prototype.toHex=function(e){return e===void 0&&(e=!1),wj(this.r,this.g,this.b,e)},i.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},i.prototype.toHex8=function(e){return e===void 0&&(e=!1),Mdt(this.r,this.g,this.b,this.a,e)},i.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},i.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},i.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},i.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(t,", ").concat(n,")"):"rgba(".concat(e,", ").concat(t,", ").concat(n,", ").concat(this.roundA,")")},i.prototype.toPercentageRgb=function(){var e=function(t){return"".concat(Math.round(La(t,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},i.prototype.toPercentageRgbString=function(){var e=function(t){return Math.round(La(t,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},i.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+wj(this.r,this.g,this.b,!1),t=0,n=Object.entries(Sj);t=0,o=!t&&r&&(e.startsWith("hex")||e==="name");return o?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(n=this.toRgbString()),e==="prgb"&&(n=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(n=this.toHexString()),e==="hex3"&&(n=this.toHexString(!0)),e==="hex4"&&(n=this.toHex8String(!0)),e==="hex8"&&(n=this.toHex8String()),e==="name"&&(n=this.toName()),e==="hsl"&&(n=this.toHslString()),e==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},i.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},i.prototype.clone=function(){return new i(this.toString())},i.prototype.lighten=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l+=e/100,t.l=C2(t.l),new i(t)},i.prototype.brighten=function(e){e===void 0&&(e=10);var t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),new i(t)},i.prototype.darken=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l-=e/100,t.l=C2(t.l),new i(t)},i.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},i.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},i.prototype.desaturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s-=e/100,t.s=C2(t.s),new i(t)},i.prototype.saturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s+=e/100,t.s=C2(t.s),new i(t)},i.prototype.greyscale=function(){return this.desaturate(100)},i.prototype.spin=function(e){var t=this.toHsl(),n=(t.h+e)%360;return t.h=n<0?360+n:n,new i(t)},i.prototype.mix=function(e,t){t===void 0&&(t=50);var n=this.toRgb(),r=new i(e).toRgb(),o=t/100,s={r:(r.r-n.r)*o+n.r,g:(r.g-n.g)*o+n.g,b:(r.b-n.b)*o+n.b,a:(r.a-n.a)*o+n.a};return new i(s)},i.prototype.analogous=function(e,t){e===void 0&&(e=6),t===void 0&&(t=30);var n=this.toHsl(),r=360/t,o=[this];for(n.h=(n.h-(r*e>>1)+720)%360;--e;)n.h=(n.h+r)%360,o.push(new i(n));return o},i.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new i(e)},i.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var t=this.toHsv(),n=t.h,r=t.s,o=t.v,s=[],a=1/e;e--;)s.push(new i({h:n,s:r,v:o})),o=(o+a)%1;return s},i.prototype.splitcomplement=function(){var e=this.toHsl(),t=e.h;return[this,new i({h:(t+72)%360,s:e.s,l:e.l}),new i({h:(t+216)%360,s:e.s,l:e.l})]},i.prototype.onBackground=function(e){var t=this.toRgb(),n=new i(e).toRgb(),r=t.a+n.a*(1-t.a);return new i({r:(t.r*t.a+n.r*n.a*(1-t.a))/r,g:(t.g*t.a+n.g*n.a*(1-t.a))/r,b:(t.b*t.a+n.b*n.a*(1-t.a))/r,a:r})},i.prototype.triad=function(){return this.polyad(3)},i.prototype.tetrad=function(){return this.polyad(4)},i.prototype.polyad=function(e){for(var t=this.toHsl(),n=t.h,r=[this],o=360/e,s=1;s=60&&Math.round(i.h)<=240?n=t?Math.round(i.h)-w2*e:Math.round(i.h)+w2*e:n=t?Math.round(i.h)+w2*e:Math.round(i.h)-w2*e,n<0?n+=360:n>=360&&(n-=360),n}function Xle(i,e,t){if(i.h===0&&i.s===0)return i.s;var n;return t?n=i.s-Kle*e:e===xye?n=i.s+Kle:n=i.s+Wdt*e,n>1&&(n=1),t&&e===Sye&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2))}function Yle(i,e,t){var n;return t?n=i.v+$dt*e:n=i.v-Hdt*e,n>1&&(n=1),Number(n.toFixed(2))}function Pp(i){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=[],n=P1(i),r=Sye;r>0;r-=1){var o=Gle(n),s=S2(P1({h:qle(o,r,!0),s:Xle(o,r,!0),v:Yle(o,r,!0)}));t.push(s)}t.push(S2(n));for(var a=1;a<=xye;a+=1){var l=Gle(n),c=S2(P1({h:qle(l,a),s:Xle(l,a),v:Yle(l,a)}));t.push(c)}return e.theme==="dark"?Vdt.map(function(u){var d=u.index,h=u.opacity,f=S2(zdt(P1(e.backgroundColor||"#141414"),P1(t[d]),h*100));return f}):t}var rw={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1677FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},n7={},i7={};Object.keys(rw).forEach(function(i){n7[i]=Pp(rw[i]),n7[i].primary=n7[i][5],i7[i]=Pp(rw[i],{theme:"dark",backgroundColor:"#141414"}),i7[i].primary=i7[i][5]});var xj={},Udt=function(e){};function jdt(i,e){}function Kdt(i,e){}function Gdt(){xj={}}function Lye(i,e,t){!e&&!xj[t]&&(i(!1,t),xj[t]=!0)}function ao(i,e){Lye(jdt,i,e)}function qdt(i,e){Lye(Kdt,i,e)}ao.preMessage=Udt;ao.resetWarned=Gdt;ao.noteOnce=qdt;function Zs(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function fb(i,e){if(!i)return!1;if(i.contains)return i.contains(e);for(var t=e;t;){if(t===i)return!0;t=t.parentNode}return!1}var Zle="data-rc-order",Xdt="rc-util-key",Lj=new Map;function Eye(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=i.mark;return e?e.startsWith("data-")?e:"data-".concat(e):Xdt}function y5(i){if(i.attachTo)return i.attachTo;var e=document.querySelector("head");return e||document.body}function Ydt(i){return i==="queue"?"prependQueue":i?"prepend":"append"}function Dye(i){return Array.from((Lj.get(i)||i).children).filter(function(e){return e.tagName==="STYLE"})}function Iye(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Zs())return null;var t=e.csp,n=e.prepend,r=document.createElement("style");r.setAttribute(Zle,Ydt(n)),t!=null&&t.nonce&&(r.nonce=t==null?void 0:t.nonce),r.innerHTML=i;var o=y5(e),s=o.firstChild;if(n){if(n==="queue"){var a=Dye(o).filter(function(l){return["prepend","prependQueue"].includes(l.getAttribute(Zle))});if(a.length)return o.insertBefore(r,a[a.length-1].nextSibling),r}o.insertBefore(r,s)}else o.appendChild(r);return r}function kye(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=y5(e);return Dye(t).find(function(n){return n.getAttribute(Eye(e))===i})}function PO(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=kye(i,e);if(t){var n=y5(e);n.removeChild(t)}}function Zdt(i,e){var t=Lj.get(i);if(!t||!fb(document,t)){var n=Iye("",e),r=n.parentNode;Lj.set(i,r),i.removeChild(n)}}function uS(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=y5(t);Zdt(n,t);var r=kye(e,t);if(r){var o,s;if((o=t.csp)!==null&&o!==void 0&&o.nonce&&r.nonce!==((s=t.csp)===null||s===void 0?void 0:s.nonce)){var a;r.nonce=(a=t.csp)===null||a===void 0?void 0:a.nonce}return r.innerHTML!==i&&(r.innerHTML=i),r}var l=Iye(i,t);return l.setAttribute(Eye(t),e),l}function Qdt(i,e){ao(i,"[@ant-design/icons] ".concat(e))}function Qle(i){return zn(i)==="object"&&typeof i.name=="string"&&typeof i.theme=="string"&&(zn(i.icon)==="object"||typeof i.icon=="function")}function Jle(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(i).reduce(function(e,t){var n=i[t];switch(t){case"class":e.className=n,delete e.class;break;default:e[t]=n}return e},{})}function Ej(i,e,t){return t?$e.createElement(i.tag,te(te({key:e},Jle(i.attrs)),t),(i.children||[]).map(function(n,r){return Ej(n,"".concat(e,"-").concat(i.tag,"-").concat(r))})):$e.createElement(i.tag,te({key:e},Jle(i.attrs)),(i.children||[]).map(function(n,r){return Ej(n,"".concat(e,"-").concat(i.tag,"-").concat(r))}))}function Tye(i){return Pp(i)[0]}function Nye(i){return i?Array.isArray(i)?i:[i]:[]}var Jdt=` .anticon { display: inline-block; color: inherit; @@ -878,9 +878,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho transform: rotate(360deg); } } -`,eht=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Jdt,t=C.useContext(SZ),n=t.csp,r=t.prefixCls,o=e;r&&(o=o.replace(/anticon/g,r)),C.useEffect(function(){uS(o,"@ant-design-icons",{prepend:!0,csp:n})},[])},tht=["icon","className","onClick","style","primaryColor","secondaryColor"],HE={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function nht(i){var e=i.primaryColor,t=i.secondaryColor;HE.primaryColor=e,HE.secondaryColor=t||Tye(e),HE.calculated=!!t}function iht(){return te({},HE)}var w5=function(e){var t=e.icon,n=e.className,r=e.onClick,o=e.style,s=e.primaryColor,a=e.secondaryColor,l=Nn(e,tht),c=HE;if(s&&(c={primaryColor:s,secondaryColor:a||Tye(s)}),eht(),Qdt(Qle(t),"icon should be icon definiton, but got ".concat(t)),!Qle(t))return null;var u=t;return u&&typeof u.icon=="function"&&(u=te(te({},u),{},{icon:u.icon(c.primaryColor,c.secondaryColor)})),Ej(u.icon,"svg-".concat(u.name),te({className:n,onClick:r,style:o,"data-icon":u.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},l))};w5.displayName="IconReact";w5.getTwoToneColors=iht;w5.setTwoToneColors=nht;const LZ=w5;function Rye(i){var e=Nye(i),t=Ae(e,2),n=t[0],r=t[1];return LZ.setTwoToneColors({primaryColor:n,secondaryColor:r})}function rht(){var i=LZ.getTwoToneColors();return i.calculated?[i.primaryColor,i.secondaryColor]:i.primaryColor}var oht=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];Rye("#1890ff");var S5=C.forwardRef(function(i,e){var t,n=i.className,r=i.icon,o=i.spin,s=i.rotate,a=i.tabIndex,l=i.onClick,c=i.twoToneColor,u=Nn(i,oht),d=C.useContext(SZ),h=d.prefixCls,f=h===void 0?"anticon":h,g=d.rootClassName,p=xe(g,f,(t={},be(t,"".concat(f,"-").concat(r.name),!!r.name),be(t,"".concat(f,"-spin"),!!o||r.name==="loading"),t),n),v=a;v===void 0&&l&&(v=-1);var m=s?{msTransform:"rotate(".concat(s,"deg)"),transform:"rotate(".concat(s,"deg)")}:void 0,_=Nye(c),y=Ae(_,2),S=y[0],L=y[1];return C.createElement("span",te(te({role:"img","aria-label":r.name},u),{},{ref:e,tabIndex:v,onClick:l,className:p}),C.createElement(LZ,{icon:r,primaryColor:S,secondaryColor:L,style:m}))});S5.displayName="AntdIcon";S5.getTwoToneColor=rht;S5.setTwoToneColor=Rye;const Ci=S5;var sht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M632 888H392c-4.4 0-8 3.6-8 8v32c0 17.7 14.3 32 32 32h192c17.7 0 32-14.3 32-32v-32c0-4.4-3.6-8-8-8zM512 64c-181.1 0-328 146.9-328 328 0 121.4 66 227.4 164 284.1V792c0 17.7 14.3 32 32 32h264c17.7 0 32-14.3 32-32V676.1c98-56.7 164-162.7 164-284.1 0-181.1-146.9-328-328-328zm127.9 549.8L604 634.6V752H420V634.6l-35.9-20.8C305.4 568.3 256 484.5 256 392c0-141.4 114.6-256 256-256s256 114.6 256 256c0 92.5-49.4 176.3-128.1 221.8z"}}]},name:"bulb",theme:"outlined"};const aht=sht;var Mye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:aht}))};Mye.displayName="BulbOutlined";const ece=C.forwardRef(Mye);var lht={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"filled"};const cht=lht;var Aye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:cht}))};Aye.displayName="CaretDownFilled";const uht=C.forwardRef(Aye);var dht={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"outlined"};const hht=dht;var Pye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:hht}))};Pye.displayName="CaretDownOutlined";const fht=C.forwardRef(Pye);var ght={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M715.8 493.5L335 165.1c-14.2-12.2-35-1.2-35 18.5v656.8c0 19.7 20.8 30.7 35 18.5l380.8-328.4c10.9-9.4 10.9-27.6 0-37z"}}]},name:"caret-right",theme:"outlined"};const pht=ght;var Oye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:pht}))};Oye.displayName="CaretRightOutlined";const mht=C.forwardRef(Oye);var vht={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"}}]},name:"caret-up",theme:"outlined"};const _ht=vht;var Fye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:_ht}))};Fye.displayName="CaretUpOutlined";const bht=C.forwardRef(Fye);var Cht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"}}]},name:"check-circle",theme:"filled"};const yht=Cht;var Bye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:yht}))};Bye.displayName="CheckCircleFilled";const EZ=C.forwardRef(Bye);var wht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"};const Sht=wht;var Wye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Sht}))};Wye.displayName="CheckOutlined";const $ye=C.forwardRef(Wye);var xht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"}}]},name:"close-circle",theme:"filled"};const Lht=xht;var Hye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Lht}))};Hye.displayName="CloseCircleFilled";const XS=C.forwardRef(Hye);var Eht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"}}]},name:"close",theme:"outlined"};const Dht=Eht;var Vye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Dht}))};Vye.displayName="CloseOutlined";const CT=C.forwardRef(Vye);var Iht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"}}]},name:"double-left",theme:"outlined"};const kht=Iht;var zye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:kht}))};zye.displayName="DoubleLeftOutlined";const tce=C.forwardRef(zye);var Tht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z"}}]},name:"double-right",theme:"outlined"};const Nht=Tht;var Uye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Nht}))};Uye.displayName="DoubleRightOutlined";const nce=C.forwardRef(Uye);var Rht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"};const Mht=Rht;var jye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Mht}))};jye.displayName="DownOutlined";const DZ=C.forwardRef(jye);var Aht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"};const Pht=Aht;var Kye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Pht}))};Kye.displayName="EllipsisOutlined";const Gye=C.forwardRef(Kye);var Oht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"exclamation-circle",theme:"filled"};const Fht=Oht;var qye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Fht}))};qye.displayName="ExclamationCircleFilled";const Xye=C.forwardRef(qye);var Bht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"};const Wht=Bht;var Yye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Wht}))};Yye.displayName="EyeInvisibleOutlined";const $ht=C.forwardRef(Yye);var Hht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"};const Vht=Hht;var Zye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Vht}))};Zye.displayName="EyeOutlined";const Qye=C.forwardRef(Zye);var zht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM544 472c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v108H372c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h108v108c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V644h108c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V472z"}}]},name:"file-add",theme:"outlined"};const Uht=zht;var Jye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Uht}))};Jye.displayName="FileAddOutlined";const jht=C.forwardRef(Jye);var Kht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"};const Ght=Kht;var ewe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Ght}))};ewe.displayName="FileOutlined";const twe=C.forwardRef(ewe);var qht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z"}}]},name:"filter",theme:"filled"};const Xht=qht;var nwe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Xht}))};nwe.displayName="FilterFilled";const Yht=C.forwardRef(nwe);var Zht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"};const Qht=Zht;var iwe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Qht}))};iwe.displayName="FolderOpenOutlined";const rwe=C.forwardRef(iwe);var Jht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"};const eft=Jht;var owe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:eft}))};owe.displayName="FolderOutlined";const tft=C.forwardRef(owe);var nft={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M825.8 498L538.4 249.9c-10.7-9.2-26.4-.9-26.4 14v496.3c0 14.9 15.7 23.2 26.4 14L825.8 526c8.3-7.2 8.3-20.8 0-28zm-320 0L218.4 249.9c-10.7-9.2-26.4-.9-26.4 14v496.3c0 14.9 15.7 23.2 26.4 14L505.8 526c4.1-3.6 6.2-8.8 6.2-14 0-5.2-2.1-10.4-6.2-14z"}}]},name:"forward",theme:"outlined"};const ift=nft;var swe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:ift}))};swe.displayName="ForwardOutlined";const rft=C.forwardRef(swe);var oft={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"};const sft=oft;var awe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:sft}))};awe.displayName="HolderOutlined";const aft=C.forwardRef(awe);var lft={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"};const cft=lft;var lwe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:cft}))};lwe.displayName="InfoCircleFilled";const cwe=C.forwardRef(lwe);var uft={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"}}]},name:"info-circle",theme:"outlined"};const dft=uft;var uwe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:dft}))};uwe.displayName="InfoCircleOutlined";const dwe=C.forwardRef(uwe);var hft={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"};const fft=hft;var hwe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:fft}))};hwe.displayName="LeftOutlined";const ice=C.forwardRef(hwe);var gft={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"};const pft=gft;var fwe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:pft}))};fwe.displayName="LoadingOutlined";const ek=C.forwardRef(fwe);var mft={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"};const vft=mft;var gwe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:vft}))};gwe.displayName="MinusSquareOutlined";const _ft=C.forwardRef(gwe);var bft={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"};const Cft=bft;var pwe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Cft}))};pwe.displayName="PlusSquareOutlined";const yft=C.forwardRef(pwe);var wft={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"}}]},name:"reload",theme:"outlined"};const Sft=wft;var mwe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Sft}))};mwe.displayName="ReloadOutlined";const xft=C.forwardRef(mwe);var Lft={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"};const Eft=Lft;var vwe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Eft}))};vwe.displayName="RightOutlined";const Dj=C.forwardRef(vwe);var Dft={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M893.3 293.3L730.7 130.7c-7.5-7.5-16.7-13-26.7-16V112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V338.5c0-17-6.7-33.2-18.7-45.2zM384 184h256v104H384V184zm456 656H184V184h136v136c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V205.8l136 136V840zM512 442c-79.5 0-144 64.5-144 144s64.5 144 144 144 144-64.5 144-144-64.5-144-144-144zm0 224c-44.2 0-80-35.8-80-80s35.8-80 80-80 80 35.8 80 80-35.8 80-80 80z"}}]},name:"save",theme:"outlined"};const Ift=Dft;var _we=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Ift}))};_we.displayName="SaveOutlined";const kft=C.forwardRef(_we);var Tft={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"};const Nft=Tft;var bwe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Nft}))};bwe.displayName="SearchOutlined";const IZ=C.forwardRef(bwe);var Rft={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3zM664.8 561.6l36.1 210.3L512 672.7 323.1 772l36.1-210.3-152.8-149L417.6 382 512 190.7 606.4 382l211.2 30.7-152.8 148.9z"}}]},name:"star",theme:"outlined"};const Mft=Rft;var Cwe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Mft}))};Cwe.displayName="StarOutlined";const Aft=C.forwardRef(Cwe);var Pft={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372 0-89 31.3-170.8 83.5-234.8l523.3 523.3C682.8 852.7 601 884 512 884zm288.5-137.2L277.2 223.5C341.2 171.3 423 140 512 140c205.4 0 372 166.6 372 372 0 89-31.3 170.8-83.5 234.8z"}}]},name:"stop",theme:"outlined"};const Oft=Pft;var ywe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Oft}))};ywe.displayName="StopOutlined";const Fft=C.forwardRef(ywe);var Bft={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M140 188h584v164h76V144c0-17.7-14.3-32-32-32H96c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h544v-76H140V188z"}},{tag:"path",attrs:{d:"M414.3 256h-60.6c-3.4 0-6.4 2.2-7.6 5.4L219 629.4c-.3.8-.4 1.7-.4 2.6 0 4.4 3.6 8 8 8h55.1c3.4 0 6.4-2.2 7.6-5.4L322 540h196.2L422 261.4a8.42 8.42 0 00-7.7-5.4zm12.4 228h-85.5L384 360.2 426.7 484zM936 528H800v-93c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v93H592c-13.3 0-24 10.7-24 24v176c0 13.3 10.7 24 24 24h136v152c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V752h136c13.3 0 24-10.7 24-24V552c0-13.3-10.7-24-24-24zM728 680h-88v-80h88v80zm160 0h-88v-80h88v80z"}}]},name:"translation",theme:"outlined"};const Wft=Bft;var wwe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Wft}))};wwe.displayName="TranslationOutlined";const $ft=C.forwardRef(wwe);var Hft={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"};const Vft=Hft;var Swe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Vft}))};Swe.displayName="UpOutlined";const zft=C.forwardRef(Swe);function vs(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function rce(i,e){for(var t=0;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Vn(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function jft(i,e){if(e&&(zn(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Vn(i)}function Th(i){var e=Uft();return function(){var n=OO(i),r;if(e){var o=OO(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return jft(this,r)}}function rd(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=[];return $e.Children.forEach(i,function(n){n==null&&!e.keepEmpty||(Array.isArray(n)?t=t.concat(rd(n)):mD.isFragment(n)&&n.props?t=t.concat(rd(n.props.children,e)):t.push(n))}),t}function LC(i,e,t){var n=C.useRef({});return(!("value"in n.current)||t(n.current.condition,e))&&(n.current.value=i(),n.current.condition=e),n.current.value}function tk(i,e){typeof i=="function"?i(e):zn(i)==="object"&&i&&"current"in i&&(i.current=e)}function vu(){for(var i=arguments.length,e=new Array(i),t=0;t0},i.prototype.connect_=function(){!kj||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Zft?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},i.prototype.disconnect_=function(){!kj||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},i.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=t===void 0?"":t,r=Yft.some(function(o){return!!~n.indexOf(o)});r&&this.refresh()},i.getInstance=function(){return this.instance_||(this.instance_=new i),this.instance_},i.instance_=null,i}(),Lwe=function(i,e){for(var t=0,n=Object.keys(e);t"u"||!(Element instanceof Object))){if(!(e instanceof dS(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new sgt(e)),this.controller_.addObserver(this),this.controller_.refresh())}},i.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof dS(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},i.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},i.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},i.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(n){return new agt(n.target,n.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},i.prototype.clearActive=function(){this.activeObservations_.splice(0)},i.prototype.hasActive=function(){return this.activeObservations_.length>0},i}(),Dwe=typeof WeakMap<"u"?new WeakMap:new xwe,Iwe=function(){function i(e){if(!(this instanceof i))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=Qft.getInstance(),n=new lgt(e,t,this);Dwe.set(this,n)}return i}();["observe","unobserve","disconnect"].forEach(function(i){Iwe.prototype[i]=function(){var e;return(e=Dwe.get(this))[i].apply(e,arguments)}});var kwe=function(){return typeof BO.ResizeObserver<"u"?BO.ResizeObserver:Iwe}(),ov=new Map;function cgt(i){i.forEach(function(e){var t,n=e.target;(t=ov.get(n))===null||t===void 0||t.forEach(function(r){return r(n)})})}var Twe=new kwe(cgt);function ugt(i,e){ov.has(i)||(ov.set(i,new Set),Twe.observe(i)),ov.get(i).add(e)}function dgt(i,e){ov.has(i)&&(ov.get(i).delete(e),ov.get(i).size||(Twe.unobserve(i),ov.delete(i)))}var hgt=function(i){kh(t,i);var e=Th(t);function t(){return vs(this,t),e.apply(this,arguments)}return _s(t,[{key:"render",value:function(){return this.props.children}}]),t}(C.Component),Tj=C.createContext(null);function fgt(i){var e=i.children,t=i.onBatchResize,n=C.useRef(0),r=C.useRef([]),o=C.useContext(Tj),s=C.useCallback(function(a,l,c){n.current+=1;var u=n.current;r.current.push({size:a,element:l,data:c}),Promise.resolve().then(function(){u===n.current&&(t==null||t(r.current),r.current=[])}),o==null||o(a,l,c)},[t,o]);return C.createElement(Tj.Provider,{value:s},e)}function ggt(i,e){var t=i.children,n=i.disabled,r=C.useRef(null),o=C.useRef(null),s=C.useContext(Tj),a=typeof t=="function",l=a?t(r):t,c=C.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),u=!a&&C.isValidElement(l)&&$_(l),d=u?l.ref:null,h=C.useMemo(function(){return vu(d,r)},[d,r]),f=function(){return nk(r.current)||nk(o.current)};C.useImperativeHandle(e,function(){return f()});var g=C.useRef(i);g.current=i;var p=C.useCallback(function(v){var m=g.current,_=m.onResize,y=m.data,S=v.getBoundingClientRect(),L=S.width,E=S.height,D=v.offsetWidth,k=v.offsetHeight,T=Math.floor(L),M=Math.floor(E);if(c.current.width!==T||c.current.height!==M||c.current.offsetWidth!==D||c.current.offsetHeight!==k){var A={width:T,height:M,offsetWidth:D,offsetHeight:k};c.current=A;var N=D===Math.round(L)?L:D,R=k===Math.round(E)?E:k,F=te(te({},A),{},{offsetWidth:N,offsetHeight:R});s==null||s(F,v,y),_&&Promise.resolve().then(function(){_(F,v)})}},[]);return C.useEffect(function(){var v=f();return v&&!n&&ugt(v,p),function(){return dgt(v,p)}},[r.current,n]),C.createElement(hgt,{ref:o},u?C.cloneElement(l,{ref:h}):l)}var pgt=C.forwardRef(ggt),mgt="rc-observer-key";function vgt(i,e){var t=i.children,n=typeof t=="function"?[t]:rd(t);return n.map(function(r,o){var s=(r==null?void 0:r.key)||"".concat(mgt,"-").concat(o);return C.createElement(pgt,St({},i,{key:s,ref:o===0?e:void 0}),r)})}var Nh=C.forwardRef(vgt);Nh.Collection=fgt;function ll(i,e){var t=te({},i);return Array.isArray(e)&&e.forEach(function(n){delete t[n]}),t}function _gt(i){if(Array.isArray(i))return bj(i)}function Nwe(i){if(typeof Symbol<"u"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function bgt(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ft(i){return _gt(i)||Nwe(i)||xZ(i)||bgt()}function kZ(i){for(var e=0,t,n=0,r=i.length;r>=4;++n,r-=4)t=i.charCodeAt(n)&255|(i.charCodeAt(++n)&255)<<8|(i.charCodeAt(++n)&255)<<16|(i.charCodeAt(++n)&255)<<24,t=(t&65535)*1540483477+((t>>>16)*59797<<16),t^=t>>>24,e=(t&65535)*1540483477+((t>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(r){case 3:e^=(i.charCodeAt(n+2)&255)<<16;case 2:e^=(i.charCodeAt(n+1)&255)<<8;case 1:e^=i.charCodeAt(n)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}function Pp(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=new Set;function r(o,s){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,l=n.has(o);if(ao(!l,"Warning: There may be circular references"),l)return!1;if(o===s)return!0;if(t&&a>1)return!1;n.add(o);var c=a+1;if(Array.isArray(o)){if(!Array.isArray(s)||o.length!==s.length)return!1;for(var u=0;u2&&arguments[2]!==void 0?arguments[2]:{},n=t.salt,r=n===void 0?"":n,o=t.override,s=o===void 0?Lgt:o,a=t.formatToken,l=C.useMemo(function(){return Object.assign.apply(Object,[{}].concat(ft(e)))},[e]),c=C.useMemo(function(){return HO(l)},[l]),u=C.useMemo(function(){return HO(s)},[s]),d=Mwe("token",[r,i.id,c,u],function(){var h=i.getDerivativeToken(l),f=te(te({},h),s);a&&(f=a(f));var g=wgt(f,r);f._tokenKey=g,Dgt(g);var p="".concat(Egt,"-").concat(kZ(g));return f._hashId=p,[f,p]},function(h){kgt(h[0]._tokenKey)});return d}var Ngt={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Pwe="comm",Owe="rule",Fwe="decl",Rgt="@import",Mgt="@keyframes",Agt=Math.abs,TZ=String.fromCharCode;function Bwe(i){return i.trim()}function Rj(i,e,t){return i.replace(e,t)}function Pgt(i,e){return i.indexOf(e)}function ik(i,e){return i.charCodeAt(e)|0}function rk(i,e,t){return i.slice(e,t)}function km(i){return i.length}function Wwe(i){return i.length}function x2(i,e){return e.push(i),i}var E5=1,hS=1,$we=0,od=0,ds=0,YS="";function NZ(i,e,t,n,r,o,s){return{value:i,root:e,parent:t,type:n,props:r,children:o,line:E5,column:hS,length:s,return:""}}function Ogt(){return ds}function Fgt(){return ds=od>0?ik(YS,--od):0,hS--,ds===10&&(hS=1,E5--),ds}function oh(){return ds=od<$we?ik(YS,od++):0,hS++,ds===10&&(hS=1,E5++),ds}function pb(){return ik(YS,od)}function KM(){return od}function D5(i,e){return rk(YS,i,e)}function Mj(i){switch(i){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Bgt(i){return E5=hS=1,$we=km(YS=i),od=0,[]}function Wgt(i){return YS="",i}function o7(i){return Bwe(D5(od-1,Aj(i===91?i+2:i===40?i+1:i)))}function $gt(i){for(;(ds=pb())&&ds<33;)oh();return Mj(i)>2||Mj(ds)>3?"":" "}function Hgt(i,e){for(;--e&&oh()&&!(ds<48||ds>102||ds>57&&ds<65||ds>70&&ds<97););return D5(i,KM()+(e<6&&pb()==32&&oh()==32))}function Aj(i){for(;oh();)switch(ds){case i:return od;case 34:case 39:i!==34&&i!==39&&Aj(ds);break;case 40:i===41&&Aj(i);break;case 92:oh();break}return od}function Vgt(i,e){for(;oh()&&i+ds!==47+10;)if(i+ds===42+42&&pb()===47)break;return"/*"+D5(e,od-1)+"*"+TZ(i===47?i:oh())}function zgt(i){for(;!Mj(pb());)oh();return D5(i,od)}function Ugt(i){return Wgt(GM("",null,null,null,[""],i=Bgt(i),0,[0],i))}function GM(i,e,t,n,r,o,s,a,l){for(var c=0,u=0,d=s,h=0,f=0,g=0,p=1,v=1,m=1,_=0,y="",S=r,L=o,E=n,D=y;v;)switch(g=_,_=oh()){case 40:if(g!=108&&ik(D,d-1)==58){Pgt(D+=Rj(o7(_),"&","&\f"),"&\f")!=-1&&(m=-1);break}case 34:case 39:case 91:D+=o7(_);break;case 9:case 10:case 13:case 32:D+=$gt(g);break;case 92:D+=Hgt(KM()-1,7);continue;case 47:switch(pb()){case 42:case 47:x2(jgt(Vgt(oh(),KM()),e,t),l);break;default:D+="/"}break;case 123*p:a[c++]=km(D)*m;case 125*p:case 59:case 0:switch(_){case 0:case 125:v=0;case 59+u:f>0&&km(D)-d&&x2(f>32?ace(D+";",n,t,d-1):ace(Rj(D," ","")+";",n,t,d-2),l);break;case 59:D+=";";default:if(x2(E=sce(D,e,t,c,u,r,a,y,S=[],L=[],d),o),_===123)if(u===0)GM(D,e,E,E,S,o,d,a,L);else switch(h===99&&ik(D,3)===110?100:h){case 100:case 109:case 115:GM(i,E,E,n&&x2(sce(i,E,E,0,0,r,a,y,r,S=[],d),L),r,L,d,a,n?S:L);break;default:GM(D,E,E,E,[""],L,0,a,L)}}c=u=f=0,p=m=1,y=D="",d=s;break;case 58:d=1+km(D),f=g;default:if(p<1){if(_==123)--p;else if(_==125&&p++==0&&Fgt()==125)continue}switch(D+=TZ(_),_*p){case 38:m=u>0?1:(D+="\f",-1);break;case 44:a[c++]=(km(D)-1)*m,m=1;break;case 64:pb()===45&&(D+=o7(oh())),h=pb(),u=d=km(y=D+=zgt(KM())),_++;break;case 45:g===45&&km(D)==2&&(p=0)}}return o}function sce(i,e,t,n,r,o,s,a,l,c,u){for(var d=r-1,h=r===0?o:[""],f=Wwe(h),g=0,p=0,v=0;g0?h[m]+" "+_:Rj(_,/&\f/g,h[m])))&&(l[v++]=y);return NZ(i,e,t,r===0?Owe:a,l,c,u)}function jgt(i,e,t){return NZ(i,e,t,Pwe,TZ(Ogt()),rk(i,2,-2),0)}function ace(i,e,t,n){return NZ(i,e,t,Fwe,rk(i,0,n),rk(i,n+1,-1),n)}function Pj(i,e){for(var t="",n=Wwe(i),r=0;r1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{root:!0,parentSelectors:[]},r=n.root,o=n.injectHash,s=n.parentSelectors,a=t.hashId,l=t.layer;t.path;var c=t.hashPriority,u=t.transformers,d=u===void 0?[]:u;t.linters;var h="",f={};function g(y){var S=y.getName(a);if(!f[S]){var L=i(y.style,t,{root:!1,parentSelectors:s}),E=Ae(L,1),D=E[0];f[S]="@keyframes ".concat(y.getName(a)).concat(D)}}function p(y){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return y.forEach(function(L){Array.isArray(L)?p(L,S):L&&S.push(L)}),S}var v=p(Array.isArray(e)?e:[e]);if(v.forEach(function(y){var S=typeof y=="string"&&!r?{}:y;if(typeof S=="string")h+="".concat(S,` -`);else if(S._keyframe)g(S);else{var L=d.reduce(function(E,D){var k;return(D==null||(k=D.visit)===null||k===void 0?void 0:k.call(D,E))||E},S);Object.keys(L).forEach(function(E){var D=L[E];if(zn(D)==="object"&&D&&(E!=="animationName"||!D._keyframe)&&!qgt(D)){var k=!1,T=E.trim(),M=!1;(r||o)&&a?T.startsWith("@")?k=!0:T=Xgt(E,a,c):r&&!a&&(T==="&"||T==="")&&(T="",M=!0);var A=i(D,t,{root:M,injectHash:k,parentSelectors:[].concat(ft(s),[T])}),N=Ae(A,2),R=N[0],F=N[1];f=te(te({},f),F),h+="".concat(T).concat(R)}else{var W,H=(W=D==null?void 0:D.value)!==null&&W!==void 0?W:D,G=E.replace(/[A-Z]/g,function(K){return"-".concat(K.toLowerCase())}),U=H;!Ngt[E]&&typeof U=="number"&&U!==0&&(U="".concat(U,"px")),E==="animationName"&&D!==null&&D!==void 0&&D._keyframe&&(g(D),U=D.getName(a)),h+="".concat(G,":").concat(U,";")}})}}),!r)h="{".concat(h,"}");else if(l&&xgt()){var m=l.split(","),_=m[m.length-1].trim();h="@layer ".concat(_," {").concat(h,"}"),m.length>1&&(h="@layer ".concat(l,"{%%%:%}").concat(h))}return[h,f]};function Zgt(i,e){return kZ("".concat(i.join("%")).concat(e))}function Qgt(){return null}function Oj(i,e){var t=i.token,n=i.path,r=i.hashId,o=i.layer,s=i.nonce,a=C.useContext(Rwe),l=a.autoClear;a.mock;var c=a.defaultCache,u=a.hashPriority,d=a.container,h=a.ssrInline,f=a.transformers,g=a.linters,p=t._tokenKey,v=[p].concat(ft(n)),m=lce,_=Mwe("style",v,function(){var D=e(),k=Ygt(D,{hashId:r,hashPriority:u,layer:o,path:n.join("-"),transformers:f,linters:g}),T=Ae(k,2),M=T[0],A=T[1],N=cce(M),R=Zgt(v,N);if(m){var F={mark:ow,prepend:"queue",attachTo:d},W=typeof s=="function"?s():s;W&&(F.csp={nonce:W});var H=uS(N,R,F);H[VE]=$O,H.setAttribute(Nj,p),Object.keys(A).forEach(function(G){uS(cce(A[G]),"_effect-".concat(G),F)})}return[N,p,R]},function(D,k){var T=Ae(D,3),M=T[2];(k||l)&&lce&&PO(M,{mark:ow})}),y=Ae(_,3),S=y[0],L=y[1],E=y[2];return function(D){var k;if(!h||m||!c)k=C.createElement(Qgt,null);else{var T;k=C.createElement("style",St({},(T={},be(T,Nj,L),be(T,ow,E),T),{dangerouslySetInnerHTML:{__html:S}}))}return C.createElement(C.Fragment,null,k,D)}}var mi=function(){function i(e,t){vs(this,i),be(this,"name",void 0),be(this,"style",void 0),be(this,"_keyframe",!0),this.name=e,this.style=t}return _s(i,[{key:"getName",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return t?"".concat(t,"-").concat(this.name):this.name}}]),i}();function Jgt(i,e){if(i.length!==e.length)return!1;for(var t=0;t1&&arguments[1]!==void 0?arguments[1]:!1,s={map:this.cache};return t.forEach(function(a){if(!s)s=void 0;else{var l,c;s=(l=s)===null||l===void 0||(c=l.map)===null||c===void 0?void 0:c.get(a)}}),(n=s)!==null&&n!==void 0&&n.value&&o&&(s.value[1]=this.cacheCallTimes++),(r=s)===null||r===void 0?void 0:r.value}},{key:"get",value:function(t){var n;return(n=this.internalGet(t,!0))===null||n===void 0?void 0:n[0]}},{key:"has",value:function(t){return!!this.internalGet(t)}},{key:"set",value:function(t,n){var r=this;if(!this.has(t)){if(this.size()+1>i.MAX_CACHE_SIZE+i.MAX_CACHE_OFFSET){var o=this.keys.reduce(function(c,u){var d=Ae(c,2),h=d[1];return r.internalGet(u)[1]0,void 0),uce+=1}return _s(i,[{key:"getDerivativeToken",value:function(t){return this.derivatives.reduce(function(n,r){return r(t,n)},void 0)}}]),i}(),s7=new RZ;function Hwe(i){var e=Array.isArray(i)?i:[i];return s7.has(e)||s7.set(e,new ept(e)),s7.get(e)}function f1(i){return i.notSplit=!0,i}f1(["borderTop","borderBottom"]),f1(["borderTop"]),f1(["borderBottom"]),f1(["borderLeft","borderRight"]),f1(["borderLeft"]),f1(["borderRight"]);var Y0="RC_FORM_INTERNAL_HOOKS",Er=function(){ao(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},fS=C.createContext({getFieldValue:Er,getFieldsValue:Er,getFieldError:Er,getFieldWarning:Er,getFieldsError:Er,isFieldsTouched:Er,isFieldTouched:Er,isFieldValidating:Er,isFieldsValidating:Er,resetFields:Er,setFields:Er,setFieldValue:Er,setFieldsValue:Er,validateFields:Er,submit:Er,getInternalHooks:function(){return Er(),{dispatch:Er,initEntityValue:Er,registerField:Er,useSubscribe:Er,setInitialValues:Er,destroyForm:Er,setCallbacks:Er,registerWatch:Er,getFields:Er,setValidateMessages:Er,setPreserve:Er,getInitialValue:Er}}});function Fj(i){return i==null?[]:Array.isArray(i)?i:[i]}function tpt(i){return i&&!!i._init}function Nl(){Nl=function(){return i};var i={},e=Object.prototype,t=e.hasOwnProperty,n=Object.defineProperty||function(N,R,F){N[R]=F.value},r=typeof Symbol=="function"?Symbol:{},o=r.iterator||"@@iterator",s=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function l(N,R,F){return Object.defineProperty(N,R,{value:F,enumerable:!0,configurable:!0,writable:!0}),N[R]}try{l({},"")}catch{l=function(F,W,H){return F[W]=H}}function c(N,R,F,W){var H=R&&R.prototype instanceof h?R:h,G=Object.create(H.prototype),U=new T(W||[]);return n(G,"_invoke",{value:L(N,F,U)}),G}function u(N,R,F){try{return{type:"normal",arg:N.call(R,F)}}catch(W){return{type:"throw",arg:W}}}i.wrap=c;var d={};function h(){}function f(){}function g(){}var p={};l(p,o,function(){return this});var v=Object.getPrototypeOf,m=v&&v(v(M([])));m&&m!==e&&t.call(m,o)&&(p=m);var _=g.prototype=h.prototype=Object.create(p);function y(N){["next","throw","return"].forEach(function(R){l(N,R,function(F){return this._invoke(R,F)})})}function S(N,R){function F(H,G,U,K){var re=u(N[H],N,G);if(re.type!=="throw"){var Y=re.arg,J=Y.value;return J&&zn(J)=="object"&&t.call(J,"__await")?R.resolve(J.__await).then(function(Q){F("next",Q,U,K)},function(Q){F("throw",Q,U,K)}):R.resolve(J).then(function(Q){Y.value=Q,U(Y)},function(Q){return F("throw",Q,U,K)})}K(re.arg)}var W;n(this,"_invoke",{value:function(G,U){function K(){return new R(function(re,Y){F(G,U,re,Y)})}return W=W?W.then(K,K):K()}})}function L(N,R,F){var W="suspendedStart";return function(H,G){if(W==="executing")throw new Error("Generator is already running");if(W==="completed"){if(H==="throw")throw G;return A()}for(F.method=H,F.arg=G;;){var U=F.delegate;if(U){var K=E(U,F);if(K){if(K===d)continue;return K}}if(F.method==="next")F.sent=F._sent=F.arg;else if(F.method==="throw"){if(W==="suspendedStart")throw W="completed",F.arg;F.dispatchException(F.arg)}else F.method==="return"&&F.abrupt("return",F.arg);W="executing";var re=u(N,R,F);if(re.type==="normal"){if(W=F.done?"completed":"suspendedYield",re.arg===d)continue;return{value:re.arg,done:F.done}}re.type==="throw"&&(W="completed",F.method="throw",F.arg=re.arg)}}}function E(N,R){var F=R.method,W=N.iterator[F];if(W===void 0)return R.delegate=null,F==="throw"&&N.iterator.return&&(R.method="return",R.arg=void 0,E(N,R),R.method==="throw")||F!=="return"&&(R.method="throw",R.arg=new TypeError("The iterator does not provide a '"+F+"' method")),d;var H=u(W,N.iterator,R.arg);if(H.type==="throw")return R.method="throw",R.arg=H.arg,R.delegate=null,d;var G=H.arg;return G?G.done?(R[N.resultName]=G.value,R.next=N.nextLoc,R.method!=="return"&&(R.method="next",R.arg=void 0),R.delegate=null,d):G:(R.method="throw",R.arg=new TypeError("iterator result is not an object"),R.delegate=null,d)}function D(N){var R={tryLoc:N[0]};1 in N&&(R.catchLoc=N[1]),2 in N&&(R.finallyLoc=N[2],R.afterLoc=N[3]),this.tryEntries.push(R)}function k(N){var R=N.completion||{};R.type="normal",delete R.arg,N.completion=R}function T(N){this.tryEntries=[{tryLoc:"root"}],N.forEach(D,this),this.reset(!0)}function M(N){if(N){var R=N[o];if(R)return R.call(N);if(typeof N.next=="function")return N;if(!isNaN(N.length)){var F=-1,W=function H(){for(;++F=0;--H){var G=this.tryEntries[H],U=G.completion;if(G.tryLoc==="root")return W("end");if(G.tryLoc<=this.prev){var K=t.call(G,"catchLoc"),re=t.call(G,"finallyLoc");if(K&&re){if(this.prev=0;--W){var H=this.tryEntries[W];if(H.tryLoc<=this.prev&&t.call(H,"finallyLoc")&&this.prev=0;--F){var W=this.tryEntries[F];if(W.finallyLoc===R)return this.complete(W.completion,W.afterLoc),k(W),d}},catch:function(R){for(var F=this.tryEntries.length-1;F>=0;--F){var W=this.tryEntries[F];if(W.tryLoc===R){var H=W.completion;if(H.type==="throw"){var G=H.arg;k(W)}return G}}throw new Error("illegal catch attempt")},delegateYield:function(R,F,W){return this.delegate={iterator:M(R),resultName:F,nextLoc:W},this.method==="next"&&(this.arg=void 0),d}},i}function dce(i,e,t,n,r,o,s){try{var a=i[o](s),l=a.value}catch(c){t(c);return}a.done?e(l):Promise.resolve(l).then(n,r)}function EC(i){return function(){var e=this,t=arguments;return new Promise(function(n,r){var o=i.apply(e,t);function s(l){dce(o,n,r,s,a,"next",l)}function a(l){dce(o,n,r,s,a,"throw",l)}s(void 0)})}}function Z0(){return Z0=Object.assign?Object.assign.bind():function(i){for(var e=1;e"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function qM(i,e,t){return ipt()?qM=Reflect.construct.bind():qM=function(r,o,s){var a=[null];a.push.apply(a,o);var l=Function.bind.apply(r,a),c=new l;return s&&ok(c,s.prototype),c},qM.apply(null,arguments)}function rpt(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function Wj(i){var e=typeof Map=="function"?new Map:void 0;return Wj=function(n){if(n===null||!rpt(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,r)}function r(){return qM(n,arguments,Bj(this).constructor)}return r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),ok(r,n)},Wj(i)}var opt=/%[sdj%]/g,spt=function(){};typeof process<"u"&&process.env;function $j(i){if(!i||!i.length)return null;var e={};return i.forEach(function(t){var n=t.field;e[n]=e[n]||[],e[n].push(t)}),e}function Zc(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n=o)return a;switch(a){case"%s":return String(t[r++]);case"%d":return Number(t[r++]);case"%j":try{return JSON.stringify(t[r++])}catch{return"[Circular]"}break;default:return a}});return s}return i}function apt(i){return i==="string"||i==="url"||i==="hex"||i==="email"||i==="date"||i==="pattern"}function Ps(i,e){return!!(i==null||e==="array"&&Array.isArray(i)&&!i.length||apt(e)&&typeof i=="string"&&!i)}function lpt(i,e,t){var n=[],r=0,o=i.length;function s(a){n.push.apply(n,a||[]),r++,r===o&&t(n)}i.forEach(function(a){e(a,s)})}function hce(i,e,t){var n=0,r=i.length;function o(s){if(s&&s.length){t(s);return}var a=n;n=n+1,a0&&arguments[0]!==void 0?arguments[0]:Jdt,t=C.useContext(SZ),n=t.csp,r=t.prefixCls,o=e;r&&(o=o.replace(/anticon/g,r)),C.useEffect(function(){uS(o,"@ant-design-icons",{prepend:!0,csp:n})},[])},tht=["icon","className","onClick","style","primaryColor","secondaryColor"],HE={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function nht(i){var e=i.primaryColor,t=i.secondaryColor;HE.primaryColor=e,HE.secondaryColor=t||Tye(e),HE.calculated=!!t}function iht(){return te({},HE)}var w5=function(e){var t=e.icon,n=e.className,r=e.onClick,o=e.style,s=e.primaryColor,a=e.secondaryColor,l=Nn(e,tht),c=HE;if(s&&(c={primaryColor:s,secondaryColor:a||Tye(s)}),eht(),Qdt(Qle(t),"icon should be icon definiton, but got ".concat(t)),!Qle(t))return null;var u=t;return u&&typeof u.icon=="function"&&(u=te(te({},u),{},{icon:u.icon(c.primaryColor,c.secondaryColor)})),Ej(u.icon,"svg-".concat(u.name),te({className:n,onClick:r,style:o,"data-icon":u.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},l))};w5.displayName="IconReact";w5.getTwoToneColors=iht;w5.setTwoToneColors=nht;const LZ=w5;function Rye(i){var e=Nye(i),t=Ae(e,2),n=t[0],r=t[1];return LZ.setTwoToneColors({primaryColor:n,secondaryColor:r})}function rht(){var i=LZ.getTwoToneColors();return i.calculated?[i.primaryColor,i.secondaryColor]:i.primaryColor}var oht=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];Rye("#1890ff");var S5=C.forwardRef(function(i,e){var t,n=i.className,r=i.icon,o=i.spin,s=i.rotate,a=i.tabIndex,l=i.onClick,c=i.twoToneColor,u=Nn(i,oht),d=C.useContext(SZ),h=d.prefixCls,f=h===void 0?"anticon":h,g=d.rootClassName,p=xe(g,f,(t={},be(t,"".concat(f,"-").concat(r.name),!!r.name),be(t,"".concat(f,"-spin"),!!o||r.name==="loading"),t),n),v=a;v===void 0&&l&&(v=-1);var m=s?{msTransform:"rotate(".concat(s,"deg)"),transform:"rotate(".concat(s,"deg)")}:void 0,_=Nye(c),y=Ae(_,2),S=y[0],L=y[1];return C.createElement("span",te(te({role:"img","aria-label":r.name},u),{},{ref:e,tabIndex:v,onClick:l,className:p}),C.createElement(LZ,{icon:r,primaryColor:S,secondaryColor:L,style:m}))});S5.displayName="AntdIcon";S5.getTwoToneColor=rht;S5.setTwoToneColor=Rye;const Ci=S5;var sht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M632 888H392c-4.4 0-8 3.6-8 8v32c0 17.7 14.3 32 32 32h192c17.7 0 32-14.3 32-32v-32c0-4.4-3.6-8-8-8zM512 64c-181.1 0-328 146.9-328 328 0 121.4 66 227.4 164 284.1V792c0 17.7 14.3 32 32 32h264c17.7 0 32-14.3 32-32V676.1c98-56.7 164-162.7 164-284.1 0-181.1-146.9-328-328-328zm127.9 549.8L604 634.6V752H420V634.6l-35.9-20.8C305.4 568.3 256 484.5 256 392c0-141.4 114.6-256 256-256s256 114.6 256 256c0 92.5-49.4 176.3-128.1 221.8z"}}]},name:"bulb",theme:"outlined"};const aht=sht;var Mye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:aht}))};Mye.displayName="BulbOutlined";const ece=C.forwardRef(Mye);var lht={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"filled"};const cht=lht;var Aye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:cht}))};Aye.displayName="CaretDownFilled";const uht=C.forwardRef(Aye);var dht={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"outlined"};const hht=dht;var Pye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:hht}))};Pye.displayName="CaretDownOutlined";const fht=C.forwardRef(Pye);var ght={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M715.8 493.5L335 165.1c-14.2-12.2-35-1.2-35 18.5v656.8c0 19.7 20.8 30.7 35 18.5l380.8-328.4c10.9-9.4 10.9-27.6 0-37z"}}]},name:"caret-right",theme:"outlined"};const pht=ght;var Oye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:pht}))};Oye.displayName="CaretRightOutlined";const mht=C.forwardRef(Oye);var vht={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"}}]},name:"caret-up",theme:"outlined"};const _ht=vht;var Fye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:_ht}))};Fye.displayName="CaretUpOutlined";const bht=C.forwardRef(Fye);var Cht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"}}]},name:"check-circle",theme:"filled"};const yht=Cht;var Bye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:yht}))};Bye.displayName="CheckCircleFilled";const EZ=C.forwardRef(Bye);var wht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"};const Sht=wht;var Wye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Sht}))};Wye.displayName="CheckOutlined";const $ye=C.forwardRef(Wye);var xht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"}}]},name:"close-circle",theme:"filled"};const Lht=xht;var Hye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Lht}))};Hye.displayName="CloseCircleFilled";const XS=C.forwardRef(Hye);var Eht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"}}]},name:"close",theme:"outlined"};const Dht=Eht;var Vye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Dht}))};Vye.displayName="CloseOutlined";const CT=C.forwardRef(Vye);var Iht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"}}]},name:"double-left",theme:"outlined"};const kht=Iht;var zye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:kht}))};zye.displayName="DoubleLeftOutlined";const tce=C.forwardRef(zye);var Tht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z"}}]},name:"double-right",theme:"outlined"};const Nht=Tht;var Uye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Nht}))};Uye.displayName="DoubleRightOutlined";const nce=C.forwardRef(Uye);var Rht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"};const Mht=Rht;var jye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Mht}))};jye.displayName="DownOutlined";const DZ=C.forwardRef(jye);var Aht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"};const Pht=Aht;var Kye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Pht}))};Kye.displayName="EllipsisOutlined";const Gye=C.forwardRef(Kye);var Oht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"exclamation-circle",theme:"filled"};const Fht=Oht;var qye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Fht}))};qye.displayName="ExclamationCircleFilled";const Xye=C.forwardRef(qye);var Bht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"};const Wht=Bht;var Yye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Wht}))};Yye.displayName="EyeInvisibleOutlined";const $ht=C.forwardRef(Yye);var Hht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"};const Vht=Hht;var Zye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Vht}))};Zye.displayName="EyeOutlined";const Qye=C.forwardRef(Zye);var zht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM544 472c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v108H372c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h108v108c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V644h108c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V472z"}}]},name:"file-add",theme:"outlined"};const Uht=zht;var Jye=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Uht}))};Jye.displayName="FileAddOutlined";const jht=C.forwardRef(Jye);var Kht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"};const Ght=Kht;var ewe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Ght}))};ewe.displayName="FileOutlined";const twe=C.forwardRef(ewe);var qht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z"}}]},name:"filter",theme:"filled"};const Xht=qht;var nwe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Xht}))};nwe.displayName="FilterFilled";const Yht=C.forwardRef(nwe);var Zht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"};const Qht=Zht;var iwe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Qht}))};iwe.displayName="FolderOpenOutlined";const rwe=C.forwardRef(iwe);var Jht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"};const eft=Jht;var owe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:eft}))};owe.displayName="FolderOutlined";const tft=C.forwardRef(owe);var nft={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M825.8 498L538.4 249.9c-10.7-9.2-26.4-.9-26.4 14v496.3c0 14.9 15.7 23.2 26.4 14L825.8 526c8.3-7.2 8.3-20.8 0-28zm-320 0L218.4 249.9c-10.7-9.2-26.4-.9-26.4 14v496.3c0 14.9 15.7 23.2 26.4 14L505.8 526c4.1-3.6 6.2-8.8 6.2-14 0-5.2-2.1-10.4-6.2-14z"}}]},name:"forward",theme:"outlined"};const ift=nft;var swe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:ift}))};swe.displayName="ForwardOutlined";const rft=C.forwardRef(swe);var oft={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"};const sft=oft;var awe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:sft}))};awe.displayName="HolderOutlined";const aft=C.forwardRef(awe);var lft={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"};const cft=lft;var lwe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:cft}))};lwe.displayName="InfoCircleFilled";const cwe=C.forwardRef(lwe);var uft={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"}}]},name:"info-circle",theme:"outlined"};const dft=uft;var uwe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:dft}))};uwe.displayName="InfoCircleOutlined";const dwe=C.forwardRef(uwe);var hft={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"};const fft=hft;var hwe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:fft}))};hwe.displayName="LeftOutlined";const ice=C.forwardRef(hwe);var gft={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"};const pft=gft;var fwe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:pft}))};fwe.displayName="LoadingOutlined";const ek=C.forwardRef(fwe);var mft={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"};const vft=mft;var gwe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:vft}))};gwe.displayName="MinusSquareOutlined";const _ft=C.forwardRef(gwe);var bft={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"};const Cft=bft;var pwe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Cft}))};pwe.displayName="PlusSquareOutlined";const yft=C.forwardRef(pwe);var wft={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"}}]},name:"reload",theme:"outlined"};const Sft=wft;var mwe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Sft}))};mwe.displayName="ReloadOutlined";const xft=C.forwardRef(mwe);var Lft={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"};const Eft=Lft;var vwe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Eft}))};vwe.displayName="RightOutlined";const Dj=C.forwardRef(vwe);var Dft={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M893.3 293.3L730.7 130.7c-7.5-7.5-16.7-13-26.7-16V112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V338.5c0-17-6.7-33.2-18.7-45.2zM384 184h256v104H384V184zm456 656H184V184h136v136c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V205.8l136 136V840zM512 442c-79.5 0-144 64.5-144 144s64.5 144 144 144 144-64.5 144-144-64.5-144-144-144zm0 224c-44.2 0-80-35.8-80-80s35.8-80 80-80 80 35.8 80 80-35.8 80-80 80z"}}]},name:"save",theme:"outlined"};const Ift=Dft;var _we=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Ift}))};_we.displayName="SaveOutlined";const kft=C.forwardRef(_we);var Tft={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"};const Nft=Tft;var bwe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Nft}))};bwe.displayName="SearchOutlined";const IZ=C.forwardRef(bwe);var Rft={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3zM664.8 561.6l36.1 210.3L512 672.7 323.1 772l36.1-210.3-152.8-149L417.6 382 512 190.7 606.4 382l211.2 30.7-152.8 148.9z"}}]},name:"star",theme:"outlined"};const Mft=Rft;var Cwe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Mft}))};Cwe.displayName="StarOutlined";const Aft=C.forwardRef(Cwe);var Pft={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372 0-89 31.3-170.8 83.5-234.8l523.3 523.3C682.8 852.7 601 884 512 884zm288.5-137.2L277.2 223.5C341.2 171.3 423 140 512 140c205.4 0 372 166.6 372 372 0 89-31.3 170.8-83.5 234.8z"}}]},name:"stop",theme:"outlined"};const Oft=Pft;var ywe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Oft}))};ywe.displayName="StopOutlined";const Fft=C.forwardRef(ywe);var Bft={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M140 188h584v164h76V144c0-17.7-14.3-32-32-32H96c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h544v-76H140V188z"}},{tag:"path",attrs:{d:"M414.3 256h-60.6c-3.4 0-6.4 2.2-7.6 5.4L219 629.4c-.3.8-.4 1.7-.4 2.6 0 4.4 3.6 8 8 8h55.1c3.4 0 6.4-2.2 7.6-5.4L322 540h196.2L422 261.4a8.42 8.42 0 00-7.7-5.4zm12.4 228h-85.5L384 360.2 426.7 484zM936 528H800v-93c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v93H592c-13.3 0-24 10.7-24 24v176c0 13.3 10.7 24 24 24h136v152c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V752h136c13.3 0 24-10.7 24-24V552c0-13.3-10.7-24-24-24zM728 680h-88v-80h88v80zm160 0h-88v-80h88v80z"}}]},name:"translation",theme:"outlined"};const Wft=Bft;var wwe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Wft}))};wwe.displayName="TranslationOutlined";const $ft=C.forwardRef(wwe);var Hft={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"};const Vft=Hft;var Swe=function(e,t){return C.createElement(Ci,te(te({},e),{},{ref:t,icon:Vft}))};Swe.displayName="UpOutlined";const zft=C.forwardRef(Swe);function vs(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function rce(i,e){for(var t=0;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Vn(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function jft(i,e){if(e&&(zn(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Vn(i)}function Th(i){var e=Uft();return function(){var n=OO(i),r;if(e){var o=OO(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return jft(this,r)}}function rd(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=[];return $e.Children.forEach(i,function(n){n==null&&!e.keepEmpty||(Array.isArray(n)?t=t.concat(rd(n)):mD.isFragment(n)&&n.props?t=t.concat(rd(n.props.children,e)):t.push(n))}),t}function LC(i,e,t){var n=C.useRef({});return(!("value"in n.current)||t(n.current.condition,e))&&(n.current.value=i(),n.current.condition=e),n.current.value}function tk(i,e){typeof i=="function"?i(e):zn(i)==="object"&&i&&"current"in i&&(i.current=e)}function vu(){for(var i=arguments.length,e=new Array(i),t=0;t0},i.prototype.connect_=function(){!kj||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Zft?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},i.prototype.disconnect_=function(){!kj||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},i.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=t===void 0?"":t,r=Yft.some(function(o){return!!~n.indexOf(o)});r&&this.refresh()},i.getInstance=function(){return this.instance_||(this.instance_=new i),this.instance_},i.instance_=null,i}(),Lwe=function(i,e){for(var t=0,n=Object.keys(e);t"u"||!(Element instanceof Object))){if(!(e instanceof dS(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new sgt(e)),this.controller_.addObserver(this),this.controller_.refresh())}},i.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof dS(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},i.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},i.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},i.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(n){return new agt(n.target,n.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},i.prototype.clearActive=function(){this.activeObservations_.splice(0)},i.prototype.hasActive=function(){return this.activeObservations_.length>0},i}(),Dwe=typeof WeakMap<"u"?new WeakMap:new xwe,Iwe=function(){function i(e){if(!(this instanceof i))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=Qft.getInstance(),n=new lgt(e,t,this);Dwe.set(this,n)}return i}();["observe","unobserve","disconnect"].forEach(function(i){Iwe.prototype[i]=function(){var e;return(e=Dwe.get(this))[i].apply(e,arguments)}});var kwe=function(){return typeof BO.ResizeObserver<"u"?BO.ResizeObserver:Iwe}(),sv=new Map;function cgt(i){i.forEach(function(e){var t,n=e.target;(t=sv.get(n))===null||t===void 0||t.forEach(function(r){return r(n)})})}var Twe=new kwe(cgt);function ugt(i,e){sv.has(i)||(sv.set(i,new Set),Twe.observe(i)),sv.get(i).add(e)}function dgt(i,e){sv.has(i)&&(sv.get(i).delete(e),sv.get(i).size||(Twe.unobserve(i),sv.delete(i)))}var hgt=function(i){kh(t,i);var e=Th(t);function t(){return vs(this,t),e.apply(this,arguments)}return _s(t,[{key:"render",value:function(){return this.props.children}}]),t}(C.Component),Tj=C.createContext(null);function fgt(i){var e=i.children,t=i.onBatchResize,n=C.useRef(0),r=C.useRef([]),o=C.useContext(Tj),s=C.useCallback(function(a,l,c){n.current+=1;var u=n.current;r.current.push({size:a,element:l,data:c}),Promise.resolve().then(function(){u===n.current&&(t==null||t(r.current),r.current=[])}),o==null||o(a,l,c)},[t,o]);return C.createElement(Tj.Provider,{value:s},e)}function ggt(i,e){var t=i.children,n=i.disabled,r=C.useRef(null),o=C.useRef(null),s=C.useContext(Tj),a=typeof t=="function",l=a?t(r):t,c=C.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),u=!a&&C.isValidElement(l)&&W_(l),d=u?l.ref:null,h=C.useMemo(function(){return vu(d,r)},[d,r]),f=function(){return nk(r.current)||nk(o.current)};C.useImperativeHandle(e,function(){return f()});var g=C.useRef(i);g.current=i;var p=C.useCallback(function(v){var m=g.current,_=m.onResize,y=m.data,S=v.getBoundingClientRect(),L=S.width,E=S.height,D=v.offsetWidth,k=v.offsetHeight,T=Math.floor(L),M=Math.floor(E);if(c.current.width!==T||c.current.height!==M||c.current.offsetWidth!==D||c.current.offsetHeight!==k){var A={width:T,height:M,offsetWidth:D,offsetHeight:k};c.current=A;var N=D===Math.round(L)?L:D,R=k===Math.round(E)?E:k,F=te(te({},A),{},{offsetWidth:N,offsetHeight:R});s==null||s(F,v,y),_&&Promise.resolve().then(function(){_(F,v)})}},[]);return C.useEffect(function(){var v=f();return v&&!n&&ugt(v,p),function(){return dgt(v,p)}},[r.current,n]),C.createElement(hgt,{ref:o},u?C.cloneElement(l,{ref:h}):l)}var pgt=C.forwardRef(ggt),mgt="rc-observer-key";function vgt(i,e){var t=i.children,n=typeof t=="function"?[t]:rd(t);return n.map(function(r,o){var s=(r==null?void 0:r.key)||"".concat(mgt,"-").concat(o);return C.createElement(pgt,St({},i,{key:s,ref:o===0?e:void 0}),r)})}var Nh=C.forwardRef(vgt);Nh.Collection=fgt;function ll(i,e){var t=te({},i);return Array.isArray(e)&&e.forEach(function(n){delete t[n]}),t}function _gt(i){if(Array.isArray(i))return bj(i)}function Nwe(i){if(typeof Symbol<"u"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function bgt(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ft(i){return _gt(i)||Nwe(i)||xZ(i)||bgt()}function kZ(i){for(var e=0,t,n=0,r=i.length;r>=4;++n,r-=4)t=i.charCodeAt(n)&255|(i.charCodeAt(++n)&255)<<8|(i.charCodeAt(++n)&255)<<16|(i.charCodeAt(++n)&255)<<24,t=(t&65535)*1540483477+((t>>>16)*59797<<16),t^=t>>>24,e=(t&65535)*1540483477+((t>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(r){case 3:e^=(i.charCodeAt(n+2)&255)<<16;case 2:e^=(i.charCodeAt(n+1)&255)<<8;case 1:e^=i.charCodeAt(n)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}function Op(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=new Set;function r(o,s){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,l=n.has(o);if(ao(!l,"Warning: There may be circular references"),l)return!1;if(o===s)return!0;if(t&&a>1)return!1;n.add(o);var c=a+1;if(Array.isArray(o)){if(!Array.isArray(s)||o.length!==s.length)return!1;for(var u=0;u2&&arguments[2]!==void 0?arguments[2]:{},n=t.salt,r=n===void 0?"":n,o=t.override,s=o===void 0?Lgt:o,a=t.formatToken,l=C.useMemo(function(){return Object.assign.apply(Object,[{}].concat(ft(e)))},[e]),c=C.useMemo(function(){return HO(l)},[l]),u=C.useMemo(function(){return HO(s)},[s]),d=Mwe("token",[r,i.id,c,u],function(){var h=i.getDerivativeToken(l),f=te(te({},h),s);a&&(f=a(f));var g=wgt(f,r);f._tokenKey=g,Dgt(g);var p="".concat(Egt,"-").concat(kZ(g));return f._hashId=p,[f,p]},function(h){kgt(h[0]._tokenKey)});return d}var Ngt={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Pwe="comm",Owe="rule",Fwe="decl",Rgt="@import",Mgt="@keyframes",Agt=Math.abs,TZ=String.fromCharCode;function Bwe(i){return i.trim()}function Rj(i,e,t){return i.replace(e,t)}function Pgt(i,e){return i.indexOf(e)}function ik(i,e){return i.charCodeAt(e)|0}function rk(i,e,t){return i.slice(e,t)}function Tm(i){return i.length}function Wwe(i){return i.length}function x2(i,e){return e.push(i),i}var E5=1,hS=1,$we=0,od=0,ds=0,YS="";function NZ(i,e,t,n,r,o,s){return{value:i,root:e,parent:t,type:n,props:r,children:o,line:E5,column:hS,length:s,return:""}}function Ogt(){return ds}function Fgt(){return ds=od>0?ik(YS,--od):0,hS--,ds===10&&(hS=1,E5--),ds}function oh(){return ds=od<$we?ik(YS,od++):0,hS++,ds===10&&(hS=1,E5++),ds}function gb(){return ik(YS,od)}function KM(){return od}function D5(i,e){return rk(YS,i,e)}function Mj(i){switch(i){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Bgt(i){return E5=hS=1,$we=Tm(YS=i),od=0,[]}function Wgt(i){return YS="",i}function o7(i){return Bwe(D5(od-1,Aj(i===91?i+2:i===40?i+1:i)))}function $gt(i){for(;(ds=gb())&&ds<33;)oh();return Mj(i)>2||Mj(ds)>3?"":" "}function Hgt(i,e){for(;--e&&oh()&&!(ds<48||ds>102||ds>57&&ds<65||ds>70&&ds<97););return D5(i,KM()+(e<6&&gb()==32&&oh()==32))}function Aj(i){for(;oh();)switch(ds){case i:return od;case 34:case 39:i!==34&&i!==39&&Aj(ds);break;case 40:i===41&&Aj(i);break;case 92:oh();break}return od}function Vgt(i,e){for(;oh()&&i+ds!==47+10;)if(i+ds===42+42&&gb()===47)break;return"/*"+D5(e,od-1)+"*"+TZ(i===47?i:oh())}function zgt(i){for(;!Mj(gb());)oh();return D5(i,od)}function Ugt(i){return Wgt(GM("",null,null,null,[""],i=Bgt(i),0,[0],i))}function GM(i,e,t,n,r,o,s,a,l){for(var c=0,u=0,d=s,h=0,f=0,g=0,p=1,v=1,m=1,_=0,y="",S=r,L=o,E=n,D=y;v;)switch(g=_,_=oh()){case 40:if(g!=108&&ik(D,d-1)==58){Pgt(D+=Rj(o7(_),"&","&\f"),"&\f")!=-1&&(m=-1);break}case 34:case 39:case 91:D+=o7(_);break;case 9:case 10:case 13:case 32:D+=$gt(g);break;case 92:D+=Hgt(KM()-1,7);continue;case 47:switch(gb()){case 42:case 47:x2(jgt(Vgt(oh(),KM()),e,t),l);break;default:D+="/"}break;case 123*p:a[c++]=Tm(D)*m;case 125*p:case 59:case 0:switch(_){case 0:case 125:v=0;case 59+u:f>0&&Tm(D)-d&&x2(f>32?ace(D+";",n,t,d-1):ace(Rj(D," ","")+";",n,t,d-2),l);break;case 59:D+=";";default:if(x2(E=sce(D,e,t,c,u,r,a,y,S=[],L=[],d),o),_===123)if(u===0)GM(D,e,E,E,S,o,d,a,L);else switch(h===99&&ik(D,3)===110?100:h){case 100:case 109:case 115:GM(i,E,E,n&&x2(sce(i,E,E,0,0,r,a,y,r,S=[],d),L),r,L,d,a,n?S:L);break;default:GM(D,E,E,E,[""],L,0,a,L)}}c=u=f=0,p=m=1,y=D="",d=s;break;case 58:d=1+Tm(D),f=g;default:if(p<1){if(_==123)--p;else if(_==125&&p++==0&&Fgt()==125)continue}switch(D+=TZ(_),_*p){case 38:m=u>0?1:(D+="\f",-1);break;case 44:a[c++]=(Tm(D)-1)*m,m=1;break;case 64:gb()===45&&(D+=o7(oh())),h=gb(),u=d=Tm(y=D+=zgt(KM())),_++;break;case 45:g===45&&Tm(D)==2&&(p=0)}}return o}function sce(i,e,t,n,r,o,s,a,l,c,u){for(var d=r-1,h=r===0?o:[""],f=Wwe(h),g=0,p=0,v=0;g0?h[m]+" "+_:Rj(_,/&\f/g,h[m])))&&(l[v++]=y);return NZ(i,e,t,r===0?Owe:a,l,c,u)}function jgt(i,e,t){return NZ(i,e,t,Pwe,TZ(Ogt()),rk(i,2,-2),0)}function ace(i,e,t,n){return NZ(i,e,t,Fwe,rk(i,0,n),rk(i,n+1,-1),n)}function Pj(i,e){for(var t="",n=Wwe(i),r=0;r1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{root:!0,parentSelectors:[]},r=n.root,o=n.injectHash,s=n.parentSelectors,a=t.hashId,l=t.layer;t.path;var c=t.hashPriority,u=t.transformers,d=u===void 0?[]:u;t.linters;var h="",f={};function g(y){var S=y.getName(a);if(!f[S]){var L=i(y.style,t,{root:!1,parentSelectors:s}),E=Ae(L,1),D=E[0];f[S]="@keyframes ".concat(y.getName(a)).concat(D)}}function p(y){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return y.forEach(function(L){Array.isArray(L)?p(L,S):L&&S.push(L)}),S}var v=p(Array.isArray(e)?e:[e]);if(v.forEach(function(y){var S=typeof y=="string"&&!r?{}:y;if(typeof S=="string")h+="".concat(S,` +`);else if(S._keyframe)g(S);else{var L=d.reduce(function(E,D){var k;return(D==null||(k=D.visit)===null||k===void 0?void 0:k.call(D,E))||E},S);Object.keys(L).forEach(function(E){var D=L[E];if(zn(D)==="object"&&D&&(E!=="animationName"||!D._keyframe)&&!qgt(D)){var k=!1,T=E.trim(),M=!1;(r||o)&&a?T.startsWith("@")?k=!0:T=Xgt(E,a,c):r&&!a&&(T==="&"||T==="")&&(T="",M=!0);var A=i(D,t,{root:M,injectHash:k,parentSelectors:[].concat(ft(s),[T])}),N=Ae(A,2),R=N[0],F=N[1];f=te(te({},f),F),h+="".concat(T).concat(R)}else{var W,H=(W=D==null?void 0:D.value)!==null&&W!==void 0?W:D,G=E.replace(/[A-Z]/g,function(K){return"-".concat(K.toLowerCase())}),U=H;!Ngt[E]&&typeof U=="number"&&U!==0&&(U="".concat(U,"px")),E==="animationName"&&D!==null&&D!==void 0&&D._keyframe&&(g(D),U=D.getName(a)),h+="".concat(G,":").concat(U,";")}})}}),!r)h="{".concat(h,"}");else if(l&&xgt()){var m=l.split(","),_=m[m.length-1].trim();h="@layer ".concat(_," {").concat(h,"}"),m.length>1&&(h="@layer ".concat(l,"{%%%:%}").concat(h))}return[h,f]};function Zgt(i,e){return kZ("".concat(i.join("%")).concat(e))}function Qgt(){return null}function Oj(i,e){var t=i.token,n=i.path,r=i.hashId,o=i.layer,s=i.nonce,a=C.useContext(Rwe),l=a.autoClear;a.mock;var c=a.defaultCache,u=a.hashPriority,d=a.container,h=a.ssrInline,f=a.transformers,g=a.linters,p=t._tokenKey,v=[p].concat(ft(n)),m=lce,_=Mwe("style",v,function(){var D=e(),k=Ygt(D,{hashId:r,hashPriority:u,layer:o,path:n.join("-"),transformers:f,linters:g}),T=Ae(k,2),M=T[0],A=T[1],N=cce(M),R=Zgt(v,N);if(m){var F={mark:ow,prepend:"queue",attachTo:d},W=typeof s=="function"?s():s;W&&(F.csp={nonce:W});var H=uS(N,R,F);H[VE]=$O,H.setAttribute(Nj,p),Object.keys(A).forEach(function(G){uS(cce(A[G]),"_effect-".concat(G),F)})}return[N,p,R]},function(D,k){var T=Ae(D,3),M=T[2];(k||l)&&lce&&PO(M,{mark:ow})}),y=Ae(_,3),S=y[0],L=y[1],E=y[2];return function(D){var k;if(!h||m||!c)k=C.createElement(Qgt,null);else{var T;k=C.createElement("style",St({},(T={},be(T,Nj,L),be(T,ow,E),T),{dangerouslySetInnerHTML:{__html:S}}))}return C.createElement(C.Fragment,null,k,D)}}var mi=function(){function i(e,t){vs(this,i),be(this,"name",void 0),be(this,"style",void 0),be(this,"_keyframe",!0),this.name=e,this.style=t}return _s(i,[{key:"getName",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return t?"".concat(t,"-").concat(this.name):this.name}}]),i}();function Jgt(i,e){if(i.length!==e.length)return!1;for(var t=0;t1&&arguments[1]!==void 0?arguments[1]:!1,s={map:this.cache};return t.forEach(function(a){if(!s)s=void 0;else{var l,c;s=(l=s)===null||l===void 0||(c=l.map)===null||c===void 0?void 0:c.get(a)}}),(n=s)!==null&&n!==void 0&&n.value&&o&&(s.value[1]=this.cacheCallTimes++),(r=s)===null||r===void 0?void 0:r.value}},{key:"get",value:function(t){var n;return(n=this.internalGet(t,!0))===null||n===void 0?void 0:n[0]}},{key:"has",value:function(t){return!!this.internalGet(t)}},{key:"set",value:function(t,n){var r=this;if(!this.has(t)){if(this.size()+1>i.MAX_CACHE_SIZE+i.MAX_CACHE_OFFSET){var o=this.keys.reduce(function(c,u){var d=Ae(c,2),h=d[1];return r.internalGet(u)[1]0,void 0),uce+=1}return _s(i,[{key:"getDerivativeToken",value:function(t){return this.derivatives.reduce(function(n,r){return r(t,n)},void 0)}}]),i}(),s7=new RZ;function Hwe(i){var e=Array.isArray(i)?i:[i];return s7.has(e)||s7.set(e,new ept(e)),s7.get(e)}function f1(i){return i.notSplit=!0,i}f1(["borderTop","borderBottom"]),f1(["borderTop"]),f1(["borderBottom"]),f1(["borderLeft","borderRight"]),f1(["borderLeft"]),f1(["borderRight"]);var X0="RC_FORM_INTERNAL_HOOKS",Er=function(){ao(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},fS=C.createContext({getFieldValue:Er,getFieldsValue:Er,getFieldError:Er,getFieldWarning:Er,getFieldsError:Er,isFieldsTouched:Er,isFieldTouched:Er,isFieldValidating:Er,isFieldsValidating:Er,resetFields:Er,setFields:Er,setFieldValue:Er,setFieldsValue:Er,validateFields:Er,submit:Er,getInternalHooks:function(){return Er(),{dispatch:Er,initEntityValue:Er,registerField:Er,useSubscribe:Er,setInitialValues:Er,destroyForm:Er,setCallbacks:Er,registerWatch:Er,getFields:Er,setValidateMessages:Er,setPreserve:Er,getInitialValue:Er}}});function Fj(i){return i==null?[]:Array.isArray(i)?i:[i]}function tpt(i){return i&&!!i._init}function Nl(){Nl=function(){return i};var i={},e=Object.prototype,t=e.hasOwnProperty,n=Object.defineProperty||function(N,R,F){N[R]=F.value},r=typeof Symbol=="function"?Symbol:{},o=r.iterator||"@@iterator",s=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function l(N,R,F){return Object.defineProperty(N,R,{value:F,enumerable:!0,configurable:!0,writable:!0}),N[R]}try{l({},"")}catch{l=function(F,W,H){return F[W]=H}}function c(N,R,F,W){var H=R&&R.prototype instanceof h?R:h,G=Object.create(H.prototype),U=new T(W||[]);return n(G,"_invoke",{value:L(N,F,U)}),G}function u(N,R,F){try{return{type:"normal",arg:N.call(R,F)}}catch(W){return{type:"throw",arg:W}}}i.wrap=c;var d={};function h(){}function f(){}function g(){}var p={};l(p,o,function(){return this});var v=Object.getPrototypeOf,m=v&&v(v(M([])));m&&m!==e&&t.call(m,o)&&(p=m);var _=g.prototype=h.prototype=Object.create(p);function y(N){["next","throw","return"].forEach(function(R){l(N,R,function(F){return this._invoke(R,F)})})}function S(N,R){function F(H,G,U,K){var re=u(N[H],N,G);if(re.type!=="throw"){var Y=re.arg,J=Y.value;return J&&zn(J)=="object"&&t.call(J,"__await")?R.resolve(J.__await).then(function(Q){F("next",Q,U,K)},function(Q){F("throw",Q,U,K)}):R.resolve(J).then(function(Q){Y.value=Q,U(Y)},function(Q){return F("throw",Q,U,K)})}K(re.arg)}var W;n(this,"_invoke",{value:function(G,U){function K(){return new R(function(re,Y){F(G,U,re,Y)})}return W=W?W.then(K,K):K()}})}function L(N,R,F){var W="suspendedStart";return function(H,G){if(W==="executing")throw new Error("Generator is already running");if(W==="completed"){if(H==="throw")throw G;return A()}for(F.method=H,F.arg=G;;){var U=F.delegate;if(U){var K=E(U,F);if(K){if(K===d)continue;return K}}if(F.method==="next")F.sent=F._sent=F.arg;else if(F.method==="throw"){if(W==="suspendedStart")throw W="completed",F.arg;F.dispatchException(F.arg)}else F.method==="return"&&F.abrupt("return",F.arg);W="executing";var re=u(N,R,F);if(re.type==="normal"){if(W=F.done?"completed":"suspendedYield",re.arg===d)continue;return{value:re.arg,done:F.done}}re.type==="throw"&&(W="completed",F.method="throw",F.arg=re.arg)}}}function E(N,R){var F=R.method,W=N.iterator[F];if(W===void 0)return R.delegate=null,F==="throw"&&N.iterator.return&&(R.method="return",R.arg=void 0,E(N,R),R.method==="throw")||F!=="return"&&(R.method="throw",R.arg=new TypeError("The iterator does not provide a '"+F+"' method")),d;var H=u(W,N.iterator,R.arg);if(H.type==="throw")return R.method="throw",R.arg=H.arg,R.delegate=null,d;var G=H.arg;return G?G.done?(R[N.resultName]=G.value,R.next=N.nextLoc,R.method!=="return"&&(R.method="next",R.arg=void 0),R.delegate=null,d):G:(R.method="throw",R.arg=new TypeError("iterator result is not an object"),R.delegate=null,d)}function D(N){var R={tryLoc:N[0]};1 in N&&(R.catchLoc=N[1]),2 in N&&(R.finallyLoc=N[2],R.afterLoc=N[3]),this.tryEntries.push(R)}function k(N){var R=N.completion||{};R.type="normal",delete R.arg,N.completion=R}function T(N){this.tryEntries=[{tryLoc:"root"}],N.forEach(D,this),this.reset(!0)}function M(N){if(N){var R=N[o];if(R)return R.call(N);if(typeof N.next=="function")return N;if(!isNaN(N.length)){var F=-1,W=function H(){for(;++F=0;--H){var G=this.tryEntries[H],U=G.completion;if(G.tryLoc==="root")return W("end");if(G.tryLoc<=this.prev){var K=t.call(G,"catchLoc"),re=t.call(G,"finallyLoc");if(K&&re){if(this.prev=0;--W){var H=this.tryEntries[W];if(H.tryLoc<=this.prev&&t.call(H,"finallyLoc")&&this.prev=0;--F){var W=this.tryEntries[F];if(W.finallyLoc===R)return this.complete(W.completion,W.afterLoc),k(W),d}},catch:function(R){for(var F=this.tryEntries.length-1;F>=0;--F){var W=this.tryEntries[F];if(W.tryLoc===R){var H=W.completion;if(H.type==="throw"){var G=H.arg;k(W)}return G}}throw new Error("illegal catch attempt")},delegateYield:function(R,F,W){return this.delegate={iterator:M(R),resultName:F,nextLoc:W},this.method==="next"&&(this.arg=void 0),d}},i}function dce(i,e,t,n,r,o,s){try{var a=i[o](s),l=a.value}catch(c){t(c);return}a.done?e(l):Promise.resolve(l).then(n,r)}function EC(i){return function(){var e=this,t=arguments;return new Promise(function(n,r){var o=i.apply(e,t);function s(l){dce(o,n,r,s,a,"next",l)}function a(l){dce(o,n,r,s,a,"throw",l)}s(void 0)})}}function Y0(){return Y0=Object.assign?Object.assign.bind():function(i){for(var e=1;e"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function qM(i,e,t){return ipt()?qM=Reflect.construct.bind():qM=function(r,o,s){var a=[null];a.push.apply(a,o);var l=Function.bind.apply(r,a),c=new l;return s&&ok(c,s.prototype),c},qM.apply(null,arguments)}function rpt(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function Wj(i){var e=typeof Map=="function"?new Map:void 0;return Wj=function(n){if(n===null||!rpt(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,r)}function r(){return qM(n,arguments,Bj(this).constructor)}return r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),ok(r,n)},Wj(i)}var opt=/%[sdj%]/g,spt=function(){};typeof process<"u"&&process.env;function $j(i){if(!i||!i.length)return null;var e={};return i.forEach(function(t){var n=t.field;e[n]=e[n]||[],e[n].push(t)}),e}function Zc(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n=o)return a;switch(a){case"%s":return String(t[r++]);case"%d":return Number(t[r++]);case"%j":try{return JSON.stringify(t[r++])}catch{return"[Circular]"}break;default:return a}});return s}return i}function apt(i){return i==="string"||i==="url"||i==="hex"||i==="email"||i==="date"||i==="pattern"}function Ps(i,e){return!!(i==null||e==="array"&&Array.isArray(i)&&!i.length||apt(e)&&typeof i=="string"&&!i)}function lpt(i,e,t){var n=[],r=0,o=i.length;function s(a){n.push.apply(n,a||[]),r++,r===o&&t(n)}i.forEach(function(a){e(a,s)})}function hce(i,e,t){var n=0,r=i.length;function o(s){if(s&&s.length){t(s);return}var a=n;n=n+1,a()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},KL={integer:function(e){return KL.number(e)&&parseInt(e,10)===e},float:function(e){return KL.number(e)&&!KL.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date:function(e){return typeof e.getTime=="function"&&typeof e.getMonth=="function"&&typeof e.getYear=="function"&&!isNaN(e.getTime())},number:function(e){return isNaN(e)?!1:typeof e=="number"},object:function(e){return typeof e=="object"&&!KL.array(e)},method:function(e){return typeof e=="function"},email:function(e){return typeof e=="string"&&e.length<=320&&!!e.match(mce.email)},url:function(e){return typeof e=="string"&&e.length<=2048&&!!e.match(gpt())},hex:function(e){return typeof e=="string"&&!!e.match(mce.hex)}},ppt=function(e,t,n,r,o){if(e.required&&t===void 0){Vwe(e,t,n,r,o);return}var s=["integer","float","array","regexp","object","method","email","number","date","url","hex"],a=e.type;s.indexOf(a)>-1?KL[a](t)||r.push(Zc(o.messages.types[a],e.fullField,e.type)):a&&typeof t!==e.type&&r.push(Zc(o.messages.types[a],e.fullField,e.type))},mpt=function(e,t,n,r,o){var s=typeof e.len=="number",a=typeof e.min=="number",l=typeof e.max=="number",c=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,u=t,d=null,h=typeof t=="number",f=typeof t=="string",g=Array.isArray(t);if(h?d="number":f?d="string":g&&(d="array"),!d)return!1;g&&(u=t.length),f&&(u=t.replace(c,"_").length),s?u!==e.len&&r.push(Zc(o.messages[d].len,e.fullField,e.len)):a&&!l&&ue.max?r.push(Zc(o.messages[d].max,e.fullField,e.max)):a&&l&&(ue.max)&&r.push(Zc(o.messages[d].range,e.fullField,e.min,e.max))},g1="enum",vpt=function(e,t,n,r,o){e[g1]=Array.isArray(e[g1])?e[g1]:[],e[g1].indexOf(t)===-1&&r.push(Zc(o.messages[g1],e.fullField,e[g1].join(", ")))},_pt=function(e,t,n,r,o){if(e.pattern){if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(t)||r.push(Zc(o.messages.pattern.mismatch,e.fullField,t,e.pattern));else if(typeof e.pattern=="string"){var s=new RegExp(e.pattern);s.test(t)||r.push(Zc(o.messages.pattern.mismatch,e.fullField,t,e.pattern))}}},xi={required:Vwe,whitespace:fpt,type:ppt,range:mpt,enum:vpt,pattern:_pt},bpt=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Ps(t,"string")&&!e.required)return n();xi.required(e,t,r,s,o,"string"),Ps(t,"string")||(xi.type(e,t,r,s,o),xi.range(e,t,r,s,o),xi.pattern(e,t,r,s,o),e.whitespace===!0&&xi.whitespace(e,t,r,s,o))}n(s)},Cpt=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Ps(t)&&!e.required)return n();xi.required(e,t,r,s,o),t!==void 0&&xi.type(e,t,r,s,o)}n(s)},ypt=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(t===""&&(t=void 0),Ps(t)&&!e.required)return n();xi.required(e,t,r,s,o),t!==void 0&&(xi.type(e,t,r,s,o),xi.range(e,t,r,s,o))}n(s)},wpt=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Ps(t)&&!e.required)return n();xi.required(e,t,r,s,o),t!==void 0&&xi.type(e,t,r,s,o)}n(s)},Spt=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Ps(t)&&!e.required)return n();xi.required(e,t,r,s,o),Ps(t)||xi.type(e,t,r,s,o)}n(s)},xpt=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Ps(t)&&!e.required)return n();xi.required(e,t,r,s,o),t!==void 0&&(xi.type(e,t,r,s,o),xi.range(e,t,r,s,o))}n(s)},Lpt=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Ps(t)&&!e.required)return n();xi.required(e,t,r,s,o),t!==void 0&&(xi.type(e,t,r,s,o),xi.range(e,t,r,s,o))}n(s)},Ept=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(t==null&&!e.required)return n();xi.required(e,t,r,s,o,"array"),t!=null&&(xi.type(e,t,r,s,o),xi.range(e,t,r,s,o))}n(s)},Dpt=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Ps(t)&&!e.required)return n();xi.required(e,t,r,s,o),t!==void 0&&xi.type(e,t,r,s,o)}n(s)},Ipt="enum",kpt=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Ps(t)&&!e.required)return n();xi.required(e,t,r,s,o),t!==void 0&&xi[Ipt](e,t,r,s,o)}n(s)},Tpt=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Ps(t,"string")&&!e.required)return n();xi.required(e,t,r,s,o),Ps(t,"string")||xi.pattern(e,t,r,s,o)}n(s)},Npt=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Ps(t,"date")&&!e.required)return n();if(xi.required(e,t,r,s,o),!Ps(t,"date")){var l;t instanceof Date?l=t:l=new Date(t),xi.type(e,l,r,s,o),l&&xi.range(e,l.getTime(),r,s,o)}}n(s)},Rpt=function(e,t,n,r,o){var s=[],a=Array.isArray(t)?"array":typeof t;xi.required(e,t,r,s,o,a),n(s)},a7=function(e,t,n,r,o){var s=e.type,a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(Ps(t,s)&&!e.required)return n();xi.required(e,t,r,a,o,s),Ps(t,s)||xi.type(e,t,r,a,o)}n(a)},Mpt=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Ps(t)&&!e.required)return n();xi.required(e,t,r,s,o)}n(s)},UE={string:bpt,method:Cpt,number:ypt,boolean:wpt,regexp:Spt,integer:xpt,float:Lpt,array:Ept,object:Dpt,enum:kpt,pattern:Tpt,date:Npt,url:a7,hex:a7,email:a7,required:Rpt,any:Mpt};function Hj(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var Vj=Hj(),yT=function(){function i(t){this.rules=null,this._messages=Vj,this.define(t)}var e=i.prototype;return e.define=function(n){var r=this;if(!n)throw new Error("Cannot configure a schema with no rules");if(typeof n!="object"||Array.isArray(n))throw new Error("Rules must be an object");this.rules={},Object.keys(n).forEach(function(o){var s=n[o];r.rules[o]=Array.isArray(s)?s:[s]})},e.messages=function(n){return n&&(this._messages=pce(Hj(),n)),this._messages},e.validate=function(n,r,o){var s=this;r===void 0&&(r={}),o===void 0&&(o=function(){});var a=n,l=r,c=o;if(typeof l=="function"&&(c=l,l={}),!this.rules||Object.keys(this.rules).length===0)return c&&c(null,a),Promise.resolve(a);function u(p){var v=[],m={};function _(S){if(Array.isArray(S)){var L;v=(L=v).concat.apply(L,S)}else v.push(S)}for(var y=0;y3&&arguments[3]!==void 0?arguments[3]:!1;return e.length&&n&&t===void 0&&!Yd(i,e.slice(0,-1))?i:jwe(i,e,t,n)}function I5(i){return Array.isArray(i)?Ppt(i):zn(i)==="object"&&i!==null?Apt(i):i}function Apt(i){if(Object.getPrototypeOf(i)===Object.prototype){var e={};for(var t in i)e[t]=I5(i[t]);return e}return i}function Ppt(i){return i.map(function(e){return I5(e)})}function qo(i){return Fj(i)}function vce(i,e){var t={};return e.forEach(function(n){var r=Yd(i,n);t=Sm(t,n,r)}),t}function jE(i,e){return i&&i.some(function(t){return Gwe(t,e)})}function _ce(i){return zn(i)==="object"&&i!==null&&Object.getPrototypeOf(i)===Object.prototype}function Kwe(i,e){var t=Array.isArray(i)?ft(i):te({},i);return e&&Object.keys(e).forEach(function(n){var r=t[n],o=e[n],s=_ce(r)&&_ce(o);t[n]=s?Kwe(r,o||{}):I5(o)}),t}function KE(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n=n||t<0||t>=n)return i;var r=i[e],o=e-t;return o>0?[].concat(ft(i.slice(0,t)),[r],ft(i.slice(t,e)),ft(i.slice(e+1,n))):o<0?[].concat(ft(i.slice(0,e)),ft(i.slice(e+1,t+1)),[r],ft(i.slice(t+1,n))):i}var Cce=yT;function Bpt(i,e){return i.replace(/\$\{\w+\}/g,function(t){var n=t.slice(2,-1);return e[n]})}var yce="CODE_LOGIC_ERROR";function zj(i,e,t,n,r){return Uj.apply(this,arguments)}function Uj(){return Uj=EC(Nl().mark(function i(e,t,n,r,o){var s,a,l,c,u,d,h,f,g;return Nl().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return s=te({},n),delete s.ruleIndex,Cce.warning=function(){},s.validator&&(a=s.validator,s.validator=function(){try{return a.apply(void 0,arguments)}catch(m){return console.error(m),Promise.reject(yce)}}),l=null,s&&s.type==="array"&&s.defaultField&&(l=s.defaultField,delete s.defaultField),c=new Cce(be({},e,[s])),u=KE({},zwe,r.validateMessages),c.messages(u),d=[],v.prev=10,v.next=13,Promise.resolve(c.validate(be({},e,t),te({},r)));case 13:v.next=18;break;case 15:v.prev=15,v.t0=v.catch(10),v.t0.errors&&(d=v.t0.errors.map(function(m,_){var y=m.message,S=y===yce?u.default:y;return C.isValidElement(S)?C.cloneElement(S,{key:"error_".concat(_)}):S}));case 18:if(!(!d.length&&l)){v.next=23;break}return v.next=21,Promise.all(t.map(function(m,_){return zj("".concat(e,".").concat(_),m,l,r,o)}));case 21:return h=v.sent,v.abrupt("return",h.reduce(function(m,_){return[].concat(ft(m),ft(_))},[]));case 23:return f=te(te({},n),{},{name:e,enum:(n.enum||[]).join(", ")},o),g=d.map(function(m){return typeof m=="string"?Bpt(m,f):m}),v.abrupt("return",g);case 26:case"end":return v.stop()}},i,null,[[10,15]])})),Uj.apply(this,arguments)}function Wpt(i,e,t,n,r,o){var s=i.join("."),a=t.map(function(u,d){var h=u.validator,f=te(te({},u),{},{ruleIndex:d});return h&&(f.validator=function(g,p,v){var m=!1,_=function(){for(var L=arguments.length,E=new Array(L),D=0;D0&&arguments[0]!==void 0?arguments[0]:ku;if(r.validatePromise===d){var L;r.validatePromise=null;var E=[],D=[];(L=S.forEach)===null||L===void 0||L.call(S,function(k){var T=k.rule.warningOnly,M=k.errors,A=M===void 0?ku:M;T?D.push.apply(D,ft(A)):E.push.apply(E,ft(A))}),r.errors=E,r.warnings=D,r.triggerMetaEvent(),r.reRender()}}),y});return r.validatePromise=d,r.dirty=!0,r.errors=ku,r.warnings=ku,r.triggerMetaEvent(),r.reRender(),d},r.isFieldValidating=function(){return!!r.validatePromise},r.isFieldTouched=function(){return r.touched},r.isFieldDirty=function(){if(r.dirty||r.props.initialValue!==void 0)return!0;var l=r.props.fieldContext,c=l.getInternalHooks(Y0),u=c.getInitialValue;return u(r.getNamePath())!==void 0},r.getErrors=function(){return r.errors},r.getWarnings=function(){return r.warnings},r.isListField=function(){return r.props.isListField},r.isList=function(){return r.props.isList},r.isPreserve=function(){return r.props.preserve},r.getMeta=function(){r.prevValidating=r.isFieldValidating();var l={touched:r.isFieldTouched(),validating:r.prevValidating,errors:r.errors,warnings:r.warnings,name:r.getNamePath(),validated:r.validatePromise===null};return l},r.getOnlyChild=function(l){if(typeof l=="function"){var c=r.getMeta();return te(te({},r.getOnlyChild(l(r.getControlled(),c,r.props.fieldContext))),{},{isFunction:!0})}var u=rd(l);return u.length!==1||!C.isValidElement(u[0])?{child:u,isFunction:!1}:{child:u[0],isFunction:!1}},r.getValue=function(l){var c=r.props.fieldContext.getFieldsValue,u=r.getNamePath();return Yd(l||c(!0),u)},r.getControlled=function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=r.props,u=c.trigger,d=c.validateTrigger,h=c.getValueFromEvent,f=c.normalize,g=c.valuePropName,p=c.getValueProps,v=c.fieldContext,m=d!==void 0?d:v.validateTrigger,_=r.getNamePath(),y=v.getInternalHooks,S=v.getFieldsValue,L=y(Y0),E=L.dispatch,D=r.getValue(),k=p||function(N){return be({},g,N)},T=l[u],M=te(te({},l),k(D));M[u]=function(){r.touched=!0,r.dirty=!0,r.triggerMetaEvent();for(var N,R=arguments.length,F=new Array(R),W=0;W=0&&M<=A.length?(u.keys=[].concat(ft(u.keys.slice(0,M)),[u.id],ft(u.keys.slice(M))),y([].concat(ft(A.slice(0,M)),[T],ft(A.slice(M))))):(u.keys=[].concat(ft(u.keys),[u.id]),y([].concat(ft(A),[T]))),u.id+=1},remove:function(T){var M=L(),A=new Set(Array.isArray(T)?T:[T]);A.size<=0||(u.keys=u.keys.filter(function(N,R){return!A.has(R)}),y(M.filter(function(N,R){return!A.has(R)})))},move:function(T,M){if(T!==M){var A=L();T<0||T>=A.length||M<0||M>=A.length||(u.keys=bce(u.keys,T,M),y(bce(A,T,M)))}}},D=_||[];return Array.isArray(D)||(D=[]),r(D.map(function(k,T){var M=u.keys[T];return M===void 0&&(u.keys[T]=u.id,M=u.keys[T],u.id+=1),{name:T,key:M,isListField:!0}}),E,v)})))};function jpt(i){var e=!1,t=i.length,n=[];return i.length?new Promise(function(r,o){i.forEach(function(s,a){s.catch(function(l){return e=!0,l}).then(function(l){t-=1,n[a]=l,!(t>0)&&(e&&o(n),r(n))})})}):Promise.resolve([])}var Xwe="__@field_split__";function l7(i){return i.map(function(e){return"".concat(zn(e),":").concat(e)}).join(Xwe)}var p1=function(){function i(){vs(this,i),this.kvs=new Map}return _s(i,[{key:"set",value:function(t,n){this.kvs.set(l7(t),n)}},{key:"get",value:function(t){return this.kvs.get(l7(t))}},{key:"update",value:function(t,n){var r=this.get(t),o=n(r);o?this.set(t,o):this.delete(t)}},{key:"delete",value:function(t){this.kvs.delete(l7(t))}},{key:"map",value:function(t){return ft(this.kvs.entries()).map(function(n){var r=Ae(n,2),o=r[0],s=r[1],a=o.split(Xwe);return t({key:a.map(function(l){var c=l.match(/^([^:]*):(.*)$/),u=Ae(c,3),d=u[1],h=u[2];return d==="number"?Number(h):h}),value:s})})}},{key:"toJSON",value:function(){var t={};return this.map(function(n){var r=n.key,o=n.value;return t[r.join(".")]=o,null}),t}}]),i}(),Kpt=["name"],Gpt=_s(function i(e){var t=this;vs(this,i),this.formHooked=!1,this.forceRootUpdate=void 0,this.subscribable=!0,this.store={},this.fieldEntities=[],this.initialValues={},this.callbacks={},this.validateMessages=null,this.preserve=null,this.lastValidatePromise=null,this.getForm=function(){return{getFieldValue:t.getFieldValue,getFieldsValue:t.getFieldsValue,getFieldError:t.getFieldError,getFieldWarning:t.getFieldWarning,getFieldsError:t.getFieldsError,isFieldsTouched:t.isFieldsTouched,isFieldTouched:t.isFieldTouched,isFieldValidating:t.isFieldValidating,isFieldsValidating:t.isFieldsValidating,resetFields:t.resetFields,setFields:t.setFields,setFieldValue:t.setFieldValue,setFieldsValue:t.setFieldsValue,validateFields:t.validateFields,submit:t.submit,_init:!0,getInternalHooks:t.getInternalHooks}},this.getInternalHooks=function(n){return n===Y0?(t.formHooked=!0,{dispatch:t.dispatch,initEntityValue:t.initEntityValue,registerField:t.registerField,useSubscribe:t.useSubscribe,setInitialValues:t.setInitialValues,destroyForm:t.destroyForm,setCallbacks:t.setCallbacks,setValidateMessages:t.setValidateMessages,getFields:t.getFields,setPreserve:t.setPreserve,getInitialValue:t.getInitialValue,registerWatch:t.registerWatch}):(ao(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)},this.useSubscribe=function(n){t.subscribable=n},this.prevWithoutPreserves=null,this.setInitialValues=function(n,r){if(t.initialValues=n||{},r){var o,s=KE({},n,t.store);(o=t.prevWithoutPreserves)===null||o===void 0||o.map(function(a){var l=a.key;s=Sm(s,l,Yd(n,l))}),t.prevWithoutPreserves=null,t.updateStore(s)}},this.destroyForm=function(){var n=new p1;t.getFieldEntities(!0).forEach(function(r){t.isMergedPreserve(r.isPreserve())||n.set(r.getNamePath(),!0)}),t.prevWithoutPreserves=n},this.getInitialValue=function(n){var r=Yd(t.initialValues,n);return n.length?I5(r):r},this.setCallbacks=function(n){t.callbacks=n},this.setValidateMessages=function(n){t.validateMessages=n},this.setPreserve=function(n){t.preserve=n},this.watchList=[],this.registerWatch=function(n){return t.watchList.push(n),function(){t.watchList=t.watchList.filter(function(r){return r!==n})}},this.notifyWatch=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(t.watchList.length){var r=t.getFieldsValue(),o=t.getFieldsValue(!0);t.watchList.forEach(function(s){s(r,o,n)})}},this.timeoutId=null,this.warningUnhooked=function(){},this.updateStore=function(n){t.store=n},this.getFieldEntities=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return n?t.fieldEntities.filter(function(r){return r.getNamePath().length}):t.fieldEntities},this.getFieldsMap=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=new p1;return t.getFieldEntities(n).forEach(function(o){var s=o.getNamePath();r.set(s,o)}),r},this.getFieldEntitiesForNamePathList=function(n){if(!n)return t.getFieldEntities(!0);var r=t.getFieldsMap(!0);return n.map(function(o){var s=qo(o);return r.get(s)||{INVALIDATE_NAME_PATH:qo(o)}})},this.getFieldsValue=function(n,r){if(t.warningUnhooked(),n===!0&&!r)return t.store;var o=t.getFieldEntitiesForNamePathList(Array.isArray(n)?n:null),s=[];return o.forEach(function(a){var l,c="INVALIDATE_NAME_PATH"in a?a.INVALIDATE_NAME_PATH:a.getNamePath();if(!(!n&&(!((l=a.isListField)===null||l===void 0)&&l.call(a))))if(!r)s.push(c);else{var u="getMeta"in a?a.getMeta():null;r(u)&&s.push(c)}}),vce(t.store,s.map(qo))},this.getFieldValue=function(n){t.warningUnhooked();var r=qo(n);return Yd(t.store,r)},this.getFieldsError=function(n){t.warningUnhooked();var r=t.getFieldEntitiesForNamePathList(n);return r.map(function(o,s){return o&&!("INVALIDATE_NAME_PATH"in o)?{name:o.getNamePath(),errors:o.getErrors(),warnings:o.getWarnings()}:{name:qo(n[s]),errors:[],warnings:[]}})},this.getFieldError=function(n){t.warningUnhooked();var r=qo(n),o=t.getFieldsError([r])[0];return o.errors},this.getFieldWarning=function(n){t.warningUnhooked();var r=qo(n),o=t.getFieldsError([r])[0];return o.warnings},this.isFieldsTouched=function(){t.warningUnhooked();for(var n=arguments.length,r=new Array(n),o=0;o0&&arguments[0]!==void 0?arguments[0]:{},r=new p1,o=t.getFieldEntities(!0);o.forEach(function(l){var c=l.props.initialValue,u=l.getNamePath();if(c!==void 0){var d=r.get(u)||new Set;d.add({entity:l,value:c}),r.set(u,d)}});var s=function(c){c.forEach(function(u){var d=u.props.initialValue;if(d!==void 0){var h=u.getNamePath(),f=t.getInitialValue(h);if(f!==void 0)ao(!1,"Form already set 'initialValues' with path '".concat(h.join("."),"'. Field can not overwrite it."));else{var g=r.get(h);if(g&&g.size>1)ao(!1,"Multiple Field with path '".concat(h.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(g){var p=t.getFieldValue(h);(!n.skipExist||p===void 0)&&t.updateStore(Sm(t.store,h,ft(g)[0].value))}}}})},a;n.entities?a=n.entities:n.namePathList?(a=[],n.namePathList.forEach(function(l){var c=r.get(l);if(c){var u;(u=a).push.apply(u,ft(ft(c).map(function(d){return d.entity})))}})):a=o,s(a)},this.resetFields=function(n){t.warningUnhooked();var r=t.store;if(!n){t.updateStore(KE({},t.initialValues)),t.resetWithFieldInitialValue(),t.notifyObservers(r,null,{type:"reset"}),t.notifyWatch();return}var o=n.map(qo);o.forEach(function(s){var a=t.getInitialValue(s);t.updateStore(Sm(t.store,s,a))}),t.resetWithFieldInitialValue({namePathList:o}),t.notifyObservers(r,o,{type:"reset"}),t.notifyWatch(o)},this.setFields=function(n){t.warningUnhooked();var r=t.store,o=[];n.forEach(function(s){var a=s.name,l=Nn(s,Kpt),c=qo(a);o.push(c),"value"in l&&t.updateStore(Sm(t.store,c,l.value)),t.notifyObservers(r,[c],{type:"setField",data:s})}),t.notifyWatch(o)},this.getFields=function(){var n=t.getFieldEntities(!0),r=n.map(function(o){var s=o.getNamePath(),a=o.getMeta(),l=te(te({},a),{},{name:s,value:t.getFieldValue(s)});return Object.defineProperty(l,"originRCField",{value:!0}),l});return r},this.initEntityValue=function(n){var r=n.props.initialValue;if(r!==void 0){var o=n.getNamePath(),s=Yd(t.store,o);s===void 0&&t.updateStore(Sm(t.store,o,r))}},this.isMergedPreserve=function(n){var r=n!==void 0?n:t.preserve;return r??!0},this.registerField=function(n){t.fieldEntities.push(n);var r=n.getNamePath();if(t.notifyWatch([r]),n.props.initialValue!==void 0){var o=t.store;t.resetWithFieldInitialValue({entities:[n],skipExist:!0}),t.notifyObservers(o,[n.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(s,a){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(t.fieldEntities=t.fieldEntities.filter(function(d){return d!==n}),!t.isMergedPreserve(a)&&(!s||l.length>1)){var c=s?void 0:t.getInitialValue(r);if(r.length&&t.getFieldValue(r)!==c&&t.fieldEntities.every(function(d){return!Gwe(d.getNamePath(),r)})){var u=t.store;t.updateStore(Sm(u,r,c,!0)),t.notifyObservers(u,[r],{type:"remove"}),t.triggerDependenciesUpdate(u,r)}}t.notifyWatch([r])}},this.dispatch=function(n){switch(n.type){case"updateValue":{var r=n.namePath,o=n.value;t.updateValue(r,o);break}case"validateField":{var s=n.namePath,a=n.triggerName;t.validateFields([s],{triggerName:a});break}}},this.notifyObservers=function(n,r,o){if(t.subscribable){var s=te(te({},o),{},{store:t.getFieldsValue(!0)});t.getFieldEntities().forEach(function(a){var l=a.onStoreChange;l(n,r,s)})}else t.forceRootUpdate()},this.triggerDependenciesUpdate=function(n,r){var o=t.getDependencyChildrenFields(r);return o.length&&t.validateFields(o),t.notifyObservers(n,o,{type:"dependenciesUpdate",relatedFields:[r].concat(ft(o))}),o},this.updateValue=function(n,r){var o=qo(n),s=t.store;t.updateStore(Sm(t.store,o,r)),t.notifyObservers(s,[o],{type:"valueUpdate",source:"internal"}),t.notifyWatch([o]);var a=t.triggerDependenciesUpdate(s,o),l=t.callbacks.onValuesChange;if(l){var c=vce(t.store,[o]);l(c,t.getFieldsValue())}t.triggerOnFieldsChange([o].concat(ft(a)))},this.setFieldsValue=function(n){t.warningUnhooked();var r=t.store;if(n){var o=KE(t.store,n);t.updateStore(o)}t.notifyObservers(r,null,{type:"valueUpdate",source:"external"}),t.notifyWatch()},this.setFieldValue=function(n,r){t.setFields([{name:n,value:r}])},this.getDependencyChildrenFields=function(n){var r=new Set,o=[],s=new p1;t.getFieldEntities().forEach(function(l){var c=l.props.dependencies;(c||[]).forEach(function(u){var d=qo(u);s.update(d,function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Set;return h.add(l),h})})});var a=function l(c){var u=s.get(c)||new Set;u.forEach(function(d){if(!r.has(d)){r.add(d);var h=d.getNamePath();d.isFieldDirty()&&h.length&&(o.push(h),l(h))}})};return a(n),o},this.triggerOnFieldsChange=function(n,r){var o=t.callbacks.onFieldsChange;if(o){var s=t.getFields();if(r){var a=new p1;r.forEach(function(c){var u=c.name,d=c.errors;a.set(u,d)}),s.forEach(function(c){c.errors=a.get(c.name)||c.errors})}var l=s.filter(function(c){var u=c.name;return jE(n,u)});o(l,s)}},this.validateFields=function(n,r){t.warningUnhooked();var o=!!n,s=o?n.map(qo):[],a=[];t.getFieldEntities(!0).forEach(function(u){if(o||s.push(u.getNamePath()),r!=null&&r.recursive&&o){var d=u.getNamePath();d.every(function(g,p){return n[p]===g||n[p]===void 0})&&s.push(d)}if(!(!u.props.rules||!u.props.rules.length)){var h=u.getNamePath();if(!o||jE(s,h)){var f=u.validateRules(te({validateMessages:te(te({},zwe),t.validateMessages)},r));a.push(f.then(function(){return{name:h,errors:[],warnings:[]}}).catch(function(g){var p,v=[],m=[];return(p=g.forEach)===null||p===void 0||p.call(g,function(_){var y=_.rule.warningOnly,S=_.errors;y?m.push.apply(m,ft(S)):v.push.apply(v,ft(S))}),v.length?Promise.reject({name:h,errors:v,warnings:m}):{name:h,errors:v,warnings:m}}))}}});var l=jpt(a);t.lastValidatePromise=l,l.catch(function(u){return u}).then(function(u){var d=u.map(function(h){var f=h.name;return f});t.notifyObservers(t.store,d,{type:"validateFinish"}),t.triggerOnFieldsChange(d,u)});var c=l.then(function(){return t.lastValidatePromise===l?Promise.resolve(t.getFieldsValue(s)):Promise.reject([])}).catch(function(u){var d=u.filter(function(h){return h&&h.errors.length});return Promise.reject({values:t.getFieldsValue(s),errorFields:d,outOfDate:t.lastValidatePromise!==l})});return c.catch(function(u){return u}),t.triggerOnFieldsChange(s),c},this.submit=function(){t.warningUnhooked(),t.validateFields().then(function(n){var r=t.callbacks.onFinish;if(r)try{r(n)}catch(o){console.error(o)}}).catch(function(n){var r=t.callbacks.onFinishFailed;r&&r(n)})},this.forceRootUpdate=e});function Ywe(i){var e=C.useRef(),t=C.useState({}),n=Ae(t,2),r=n[1];if(!e.current)if(i)e.current=i;else{var o=function(){r({})},s=new Gpt(o);e.current=s.getForm()}return[e.current]}var Gj=C.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),Zwe=function(e){var t=e.validateMessages,n=e.onFormChange,r=e.onFormFinish,o=e.children,s=C.useContext(Gj),a=C.useRef({});return C.createElement(Gj.Provider,{value:te(te({},s),{},{validateMessages:te(te({},s.validateMessages),t),triggerFormChange:function(c,u){n&&n(c,{changedFields:u,forms:a.current}),s.triggerFormChange(c,u)},triggerFormFinish:function(c,u){r&&r(c,{values:u,forms:a.current}),s.triggerFormFinish(c,u)},registerForm:function(c,u){c&&(a.current=te(te({},a.current),{},be({},c,u))),s.registerForm(c,u)},unregisterForm:function(c){var u=te({},a.current);delete u[c],a.current=u,s.unregisterForm(c)}})},o)},qpt=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed"],Xpt=function(e,t){var n=e.name,r=e.initialValues,o=e.fields,s=e.form,a=e.preserve,l=e.children,c=e.component,u=c===void 0?"form":c,d=e.validateMessages,h=e.validateTrigger,f=h===void 0?"onChange":h,g=e.onValuesChange,p=e.onFieldsChange,v=e.onFinish,m=e.onFinishFailed,_=Nn(e,qpt),y=C.useContext(Gj),S=Ywe(s),L=Ae(S,1),E=L[0],D=E.getInternalHooks(Y0),k=D.useSubscribe,T=D.setInitialValues,M=D.setCallbacks,A=D.setValidateMessages,N=D.setPreserve,R=D.destroyForm;C.useImperativeHandle(t,function(){return E}),C.useEffect(function(){return y.registerForm(n,E),function(){y.unregisterForm(n)}},[y,E,n]),A(te(te({},y.validateMessages),d)),M({onValuesChange:g,onFieldsChange:function(J){if(y.triggerFormChange(n,J),p){for(var Q=arguments.length,ue=new Array(Q>1?Q-1:0),de=1;de{const t=C.useContext(AZ),n=C.useMemo(()=>{var o;const s=e||tC[i],a=(o=t==null?void 0:t[i])!==null&&o!==void 0?o:{};return Object.assign(Object.assign({},typeof s=="function"?s():s),a||{})},[i,e,t]),r=C.useMemo(()=>{const o=t==null?void 0:t.locale;return t!=null&&t.exist&&!o?tC.locale:o},[t]);return[n,r]},ST=imt,rmt="internalMark",omt=i=>{const{locale:e={},children:t,_ANT_MARK__:n}=i;C.useEffect(()=>(Lce(e&&e.Modal),()=>{Lce()}),[e]);const r=C.useMemo(()=>Object.assign(Object.assign({},e),{exist:!0}),[e]);return C.createElement(AZ.Provider,{value:r},t)},smt=omt,amt="5.4.2",sk=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"],lmt=i=>{const{controlHeight:e}=i;return{controlHeightSM:e*.75,controlHeightXS:e*.5,controlHeightLG:e*1.25}},tSe=lmt;function cmt(i){const{sizeUnit:e,sizeStep:t}=i;return{sizeXXL:e*(t+8),sizeXL:e*(t+4),sizeLG:e*(t+2),sizeMD:e*(t+1),sizeMS:e*t,size:e*t,sizeSM:e*(t-1),sizeXS:e*(t-2),sizeXXS:e*(t-3)}}const PZ={blue:"#1677ff",purple:"#722ED1",cyan:"#13C2C2",green:"#52C41A",magenta:"#EB2F96",pink:"#eb2f96",red:"#F5222D",orange:"#FA8C16",yellow:"#FADB14",volcano:"#FA541C",geekblue:"#2F54EB",gold:"#FAAD14",lime:"#A0D911"},umt=Object.assign(Object.assign({},PZ),{colorPrimary:"#1677ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1677ff",colorTextBase:"",colorBgBase:"",fontFamily:`-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, +`).replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),o=new RegExp("(?:^"+t+"$)|(?:^"+r+"$)"),s=new RegExp("^"+t+"$"),a=new RegExp("^"+r+"$"),l=function(S){return S&&S.exact?o:new RegExp("(?:"+e(S)+t+e(S)+")|(?:"+e(S)+r+e(S)+")","g")};l.v4=function(y){return y&&y.exact?s:new RegExp(""+e(y)+t+e(y),"g")},l.v6=function(y){return y&&y.exact?a:new RegExp(""+e(y)+r+e(y),"g")};var c="(?:(?:[a-z]+:)?//)",u="(?:\\S+(?::\\S*)?@)?",d=l.v4().source,h=l.v6().source,f="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",g="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",p="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",v="(?::\\d{2,5})?",m='(?:[/?#][^\\s"]*)?',_="(?:"+c+"|www\\.)"+u+"(?:localhost|"+d+"|"+h+"|"+f+g+p+")"+v+m;return L2=new RegExp("(?:^"+_+"$)","i"),L2},mce={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},KL={integer:function(e){return KL.number(e)&&parseInt(e,10)===e},float:function(e){return KL.number(e)&&!KL.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date:function(e){return typeof e.getTime=="function"&&typeof e.getMonth=="function"&&typeof e.getYear=="function"&&!isNaN(e.getTime())},number:function(e){return isNaN(e)?!1:typeof e=="number"},object:function(e){return typeof e=="object"&&!KL.array(e)},method:function(e){return typeof e=="function"},email:function(e){return typeof e=="string"&&e.length<=320&&!!e.match(mce.email)},url:function(e){return typeof e=="string"&&e.length<=2048&&!!e.match(gpt())},hex:function(e){return typeof e=="string"&&!!e.match(mce.hex)}},ppt=function(e,t,n,r,o){if(e.required&&t===void 0){Vwe(e,t,n,r,o);return}var s=["integer","float","array","regexp","object","method","email","number","date","url","hex"],a=e.type;s.indexOf(a)>-1?KL[a](t)||r.push(Zc(o.messages.types[a],e.fullField,e.type)):a&&typeof t!==e.type&&r.push(Zc(o.messages.types[a],e.fullField,e.type))},mpt=function(e,t,n,r,o){var s=typeof e.len=="number",a=typeof e.min=="number",l=typeof e.max=="number",c=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,u=t,d=null,h=typeof t=="number",f=typeof t=="string",g=Array.isArray(t);if(h?d="number":f?d="string":g&&(d="array"),!d)return!1;g&&(u=t.length),f&&(u=t.replace(c,"_").length),s?u!==e.len&&r.push(Zc(o.messages[d].len,e.fullField,e.len)):a&&!l&&ue.max?r.push(Zc(o.messages[d].max,e.fullField,e.max)):a&&l&&(ue.max)&&r.push(Zc(o.messages[d].range,e.fullField,e.min,e.max))},g1="enum",vpt=function(e,t,n,r,o){e[g1]=Array.isArray(e[g1])?e[g1]:[],e[g1].indexOf(t)===-1&&r.push(Zc(o.messages[g1],e.fullField,e[g1].join(", ")))},_pt=function(e,t,n,r,o){if(e.pattern){if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(t)||r.push(Zc(o.messages.pattern.mismatch,e.fullField,t,e.pattern));else if(typeof e.pattern=="string"){var s=new RegExp(e.pattern);s.test(t)||r.push(Zc(o.messages.pattern.mismatch,e.fullField,t,e.pattern))}}},xi={required:Vwe,whitespace:fpt,type:ppt,range:mpt,enum:vpt,pattern:_pt},bpt=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Ps(t,"string")&&!e.required)return n();xi.required(e,t,r,s,o,"string"),Ps(t,"string")||(xi.type(e,t,r,s,o),xi.range(e,t,r,s,o),xi.pattern(e,t,r,s,o),e.whitespace===!0&&xi.whitespace(e,t,r,s,o))}n(s)},Cpt=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Ps(t)&&!e.required)return n();xi.required(e,t,r,s,o),t!==void 0&&xi.type(e,t,r,s,o)}n(s)},ypt=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(t===""&&(t=void 0),Ps(t)&&!e.required)return n();xi.required(e,t,r,s,o),t!==void 0&&(xi.type(e,t,r,s,o),xi.range(e,t,r,s,o))}n(s)},wpt=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Ps(t)&&!e.required)return n();xi.required(e,t,r,s,o),t!==void 0&&xi.type(e,t,r,s,o)}n(s)},Spt=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Ps(t)&&!e.required)return n();xi.required(e,t,r,s,o),Ps(t)||xi.type(e,t,r,s,o)}n(s)},xpt=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Ps(t)&&!e.required)return n();xi.required(e,t,r,s,o),t!==void 0&&(xi.type(e,t,r,s,o),xi.range(e,t,r,s,o))}n(s)},Lpt=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Ps(t)&&!e.required)return n();xi.required(e,t,r,s,o),t!==void 0&&(xi.type(e,t,r,s,o),xi.range(e,t,r,s,o))}n(s)},Ept=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(t==null&&!e.required)return n();xi.required(e,t,r,s,o,"array"),t!=null&&(xi.type(e,t,r,s,o),xi.range(e,t,r,s,o))}n(s)},Dpt=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Ps(t)&&!e.required)return n();xi.required(e,t,r,s,o),t!==void 0&&xi.type(e,t,r,s,o)}n(s)},Ipt="enum",kpt=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Ps(t)&&!e.required)return n();xi.required(e,t,r,s,o),t!==void 0&&xi[Ipt](e,t,r,s,o)}n(s)},Tpt=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Ps(t,"string")&&!e.required)return n();xi.required(e,t,r,s,o),Ps(t,"string")||xi.pattern(e,t,r,s,o)}n(s)},Npt=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Ps(t,"date")&&!e.required)return n();if(xi.required(e,t,r,s,o),!Ps(t,"date")){var l;t instanceof Date?l=t:l=new Date(t),xi.type(e,l,r,s,o),l&&xi.range(e,l.getTime(),r,s,o)}}n(s)},Rpt=function(e,t,n,r,o){var s=[],a=Array.isArray(t)?"array":typeof t;xi.required(e,t,r,s,o,a),n(s)},a7=function(e,t,n,r,o){var s=e.type,a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(Ps(t,s)&&!e.required)return n();xi.required(e,t,r,a,o,s),Ps(t,s)||xi.type(e,t,r,a,o)}n(a)},Mpt=function(e,t,n,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Ps(t)&&!e.required)return n();xi.required(e,t,r,s,o)}n(s)},UE={string:bpt,method:Cpt,number:ypt,boolean:wpt,regexp:Spt,integer:xpt,float:Lpt,array:Ept,object:Dpt,enum:kpt,pattern:Tpt,date:Npt,url:a7,hex:a7,email:a7,required:Rpt,any:Mpt};function Hj(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var Vj=Hj(),yT=function(){function i(t){this.rules=null,this._messages=Vj,this.define(t)}var e=i.prototype;return e.define=function(n){var r=this;if(!n)throw new Error("Cannot configure a schema with no rules");if(typeof n!="object"||Array.isArray(n))throw new Error("Rules must be an object");this.rules={},Object.keys(n).forEach(function(o){var s=n[o];r.rules[o]=Array.isArray(s)?s:[s]})},e.messages=function(n){return n&&(this._messages=pce(Hj(),n)),this._messages},e.validate=function(n,r,o){var s=this;r===void 0&&(r={}),o===void 0&&(o=function(){});var a=n,l=r,c=o;if(typeof l=="function"&&(c=l,l={}),!this.rules||Object.keys(this.rules).length===0)return c&&c(null,a),Promise.resolve(a);function u(p){var v=[],m={};function _(S){if(Array.isArray(S)){var L;v=(L=v).concat.apply(L,S)}else v.push(S)}for(var y=0;y3&&arguments[3]!==void 0?arguments[3]:!1;return e.length&&n&&t===void 0&&!Yd(i,e.slice(0,-1))?i:jwe(i,e,t,n)}function I5(i){return Array.isArray(i)?Ppt(i):zn(i)==="object"&&i!==null?Apt(i):i}function Apt(i){if(Object.getPrototypeOf(i)===Object.prototype){var e={};for(var t in i)e[t]=I5(i[t]);return e}return i}function Ppt(i){return i.map(function(e){return I5(e)})}function qo(i){return Fj(i)}function vce(i,e){var t={};return e.forEach(function(n){var r=Yd(i,n);t=xm(t,n,r)}),t}function jE(i,e){return i&&i.some(function(t){return Gwe(t,e)})}function _ce(i){return zn(i)==="object"&&i!==null&&Object.getPrototypeOf(i)===Object.prototype}function Kwe(i,e){var t=Array.isArray(i)?ft(i):te({},i);return e&&Object.keys(e).forEach(function(n){var r=t[n],o=e[n],s=_ce(r)&&_ce(o);t[n]=s?Kwe(r,o||{}):I5(o)}),t}function KE(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n=n||t<0||t>=n)return i;var r=i[e],o=e-t;return o>0?[].concat(ft(i.slice(0,t)),[r],ft(i.slice(t,e)),ft(i.slice(e+1,n))):o<0?[].concat(ft(i.slice(0,e)),ft(i.slice(e+1,t+1)),[r],ft(i.slice(t+1,n))):i}var Cce=yT;function Bpt(i,e){return i.replace(/\$\{\w+\}/g,function(t){var n=t.slice(2,-1);return e[n]})}var yce="CODE_LOGIC_ERROR";function zj(i,e,t,n,r){return Uj.apply(this,arguments)}function Uj(){return Uj=EC(Nl().mark(function i(e,t,n,r,o){var s,a,l,c,u,d,h,f,g;return Nl().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return s=te({},n),delete s.ruleIndex,Cce.warning=function(){},s.validator&&(a=s.validator,s.validator=function(){try{return a.apply(void 0,arguments)}catch(m){return console.error(m),Promise.reject(yce)}}),l=null,s&&s.type==="array"&&s.defaultField&&(l=s.defaultField,delete s.defaultField),c=new Cce(be({},e,[s])),u=KE({},zwe,r.validateMessages),c.messages(u),d=[],v.prev=10,v.next=13,Promise.resolve(c.validate(be({},e,t),te({},r)));case 13:v.next=18;break;case 15:v.prev=15,v.t0=v.catch(10),v.t0.errors&&(d=v.t0.errors.map(function(m,_){var y=m.message,S=y===yce?u.default:y;return C.isValidElement(S)?C.cloneElement(S,{key:"error_".concat(_)}):S}));case 18:if(!(!d.length&&l)){v.next=23;break}return v.next=21,Promise.all(t.map(function(m,_){return zj("".concat(e,".").concat(_),m,l,r,o)}));case 21:return h=v.sent,v.abrupt("return",h.reduce(function(m,_){return[].concat(ft(m),ft(_))},[]));case 23:return f=te(te({},n),{},{name:e,enum:(n.enum||[]).join(", ")},o),g=d.map(function(m){return typeof m=="string"?Bpt(m,f):m}),v.abrupt("return",g);case 26:case"end":return v.stop()}},i,null,[[10,15]])})),Uj.apply(this,arguments)}function Wpt(i,e,t,n,r,o){var s=i.join("."),a=t.map(function(u,d){var h=u.validator,f=te(te({},u),{},{ruleIndex:d});return h&&(f.validator=function(g,p,v){var m=!1,_=function(){for(var L=arguments.length,E=new Array(L),D=0;D0&&arguments[0]!==void 0?arguments[0]:ku;if(r.validatePromise===d){var L;r.validatePromise=null;var E=[],D=[];(L=S.forEach)===null||L===void 0||L.call(S,function(k){var T=k.rule.warningOnly,M=k.errors,A=M===void 0?ku:M;T?D.push.apply(D,ft(A)):E.push.apply(E,ft(A))}),r.errors=E,r.warnings=D,r.triggerMetaEvent(),r.reRender()}}),y});return r.validatePromise=d,r.dirty=!0,r.errors=ku,r.warnings=ku,r.triggerMetaEvent(),r.reRender(),d},r.isFieldValidating=function(){return!!r.validatePromise},r.isFieldTouched=function(){return r.touched},r.isFieldDirty=function(){if(r.dirty||r.props.initialValue!==void 0)return!0;var l=r.props.fieldContext,c=l.getInternalHooks(X0),u=c.getInitialValue;return u(r.getNamePath())!==void 0},r.getErrors=function(){return r.errors},r.getWarnings=function(){return r.warnings},r.isListField=function(){return r.props.isListField},r.isList=function(){return r.props.isList},r.isPreserve=function(){return r.props.preserve},r.getMeta=function(){r.prevValidating=r.isFieldValidating();var l={touched:r.isFieldTouched(),validating:r.prevValidating,errors:r.errors,warnings:r.warnings,name:r.getNamePath(),validated:r.validatePromise===null};return l},r.getOnlyChild=function(l){if(typeof l=="function"){var c=r.getMeta();return te(te({},r.getOnlyChild(l(r.getControlled(),c,r.props.fieldContext))),{},{isFunction:!0})}var u=rd(l);return u.length!==1||!C.isValidElement(u[0])?{child:u,isFunction:!1}:{child:u[0],isFunction:!1}},r.getValue=function(l){var c=r.props.fieldContext.getFieldsValue,u=r.getNamePath();return Yd(l||c(!0),u)},r.getControlled=function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=r.props,u=c.trigger,d=c.validateTrigger,h=c.getValueFromEvent,f=c.normalize,g=c.valuePropName,p=c.getValueProps,v=c.fieldContext,m=d!==void 0?d:v.validateTrigger,_=r.getNamePath(),y=v.getInternalHooks,S=v.getFieldsValue,L=y(X0),E=L.dispatch,D=r.getValue(),k=p||function(N){return be({},g,N)},T=l[u],M=te(te({},l),k(D));M[u]=function(){r.touched=!0,r.dirty=!0,r.triggerMetaEvent();for(var N,R=arguments.length,F=new Array(R),W=0;W=0&&M<=A.length?(u.keys=[].concat(ft(u.keys.slice(0,M)),[u.id],ft(u.keys.slice(M))),y([].concat(ft(A.slice(0,M)),[T],ft(A.slice(M))))):(u.keys=[].concat(ft(u.keys),[u.id]),y([].concat(ft(A),[T]))),u.id+=1},remove:function(T){var M=L(),A=new Set(Array.isArray(T)?T:[T]);A.size<=0||(u.keys=u.keys.filter(function(N,R){return!A.has(R)}),y(M.filter(function(N,R){return!A.has(R)})))},move:function(T,M){if(T!==M){var A=L();T<0||T>=A.length||M<0||M>=A.length||(u.keys=bce(u.keys,T,M),y(bce(A,T,M)))}}},D=_||[];return Array.isArray(D)||(D=[]),r(D.map(function(k,T){var M=u.keys[T];return M===void 0&&(u.keys[T]=u.id,M=u.keys[T],u.id+=1),{name:T,key:M,isListField:!0}}),E,v)})))};function jpt(i){var e=!1,t=i.length,n=[];return i.length?new Promise(function(r,o){i.forEach(function(s,a){s.catch(function(l){return e=!0,l}).then(function(l){t-=1,n[a]=l,!(t>0)&&(e&&o(n),r(n))})})}):Promise.resolve([])}var Xwe="__@field_split__";function l7(i){return i.map(function(e){return"".concat(zn(e),":").concat(e)}).join(Xwe)}var p1=function(){function i(){vs(this,i),this.kvs=new Map}return _s(i,[{key:"set",value:function(t,n){this.kvs.set(l7(t),n)}},{key:"get",value:function(t){return this.kvs.get(l7(t))}},{key:"update",value:function(t,n){var r=this.get(t),o=n(r);o?this.set(t,o):this.delete(t)}},{key:"delete",value:function(t){this.kvs.delete(l7(t))}},{key:"map",value:function(t){return ft(this.kvs.entries()).map(function(n){var r=Ae(n,2),o=r[0],s=r[1],a=o.split(Xwe);return t({key:a.map(function(l){var c=l.match(/^([^:]*):(.*)$/),u=Ae(c,3),d=u[1],h=u[2];return d==="number"?Number(h):h}),value:s})})}},{key:"toJSON",value:function(){var t={};return this.map(function(n){var r=n.key,o=n.value;return t[r.join(".")]=o,null}),t}}]),i}(),Kpt=["name"],Gpt=_s(function i(e){var t=this;vs(this,i),this.formHooked=!1,this.forceRootUpdate=void 0,this.subscribable=!0,this.store={},this.fieldEntities=[],this.initialValues={},this.callbacks={},this.validateMessages=null,this.preserve=null,this.lastValidatePromise=null,this.getForm=function(){return{getFieldValue:t.getFieldValue,getFieldsValue:t.getFieldsValue,getFieldError:t.getFieldError,getFieldWarning:t.getFieldWarning,getFieldsError:t.getFieldsError,isFieldsTouched:t.isFieldsTouched,isFieldTouched:t.isFieldTouched,isFieldValidating:t.isFieldValidating,isFieldsValidating:t.isFieldsValidating,resetFields:t.resetFields,setFields:t.setFields,setFieldValue:t.setFieldValue,setFieldsValue:t.setFieldsValue,validateFields:t.validateFields,submit:t.submit,_init:!0,getInternalHooks:t.getInternalHooks}},this.getInternalHooks=function(n){return n===X0?(t.formHooked=!0,{dispatch:t.dispatch,initEntityValue:t.initEntityValue,registerField:t.registerField,useSubscribe:t.useSubscribe,setInitialValues:t.setInitialValues,destroyForm:t.destroyForm,setCallbacks:t.setCallbacks,setValidateMessages:t.setValidateMessages,getFields:t.getFields,setPreserve:t.setPreserve,getInitialValue:t.getInitialValue,registerWatch:t.registerWatch}):(ao(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)},this.useSubscribe=function(n){t.subscribable=n},this.prevWithoutPreserves=null,this.setInitialValues=function(n,r){if(t.initialValues=n||{},r){var o,s=KE({},n,t.store);(o=t.prevWithoutPreserves)===null||o===void 0||o.map(function(a){var l=a.key;s=xm(s,l,Yd(n,l))}),t.prevWithoutPreserves=null,t.updateStore(s)}},this.destroyForm=function(){var n=new p1;t.getFieldEntities(!0).forEach(function(r){t.isMergedPreserve(r.isPreserve())||n.set(r.getNamePath(),!0)}),t.prevWithoutPreserves=n},this.getInitialValue=function(n){var r=Yd(t.initialValues,n);return n.length?I5(r):r},this.setCallbacks=function(n){t.callbacks=n},this.setValidateMessages=function(n){t.validateMessages=n},this.setPreserve=function(n){t.preserve=n},this.watchList=[],this.registerWatch=function(n){return t.watchList.push(n),function(){t.watchList=t.watchList.filter(function(r){return r!==n})}},this.notifyWatch=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(t.watchList.length){var r=t.getFieldsValue(),o=t.getFieldsValue(!0);t.watchList.forEach(function(s){s(r,o,n)})}},this.timeoutId=null,this.warningUnhooked=function(){},this.updateStore=function(n){t.store=n},this.getFieldEntities=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return n?t.fieldEntities.filter(function(r){return r.getNamePath().length}):t.fieldEntities},this.getFieldsMap=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=new p1;return t.getFieldEntities(n).forEach(function(o){var s=o.getNamePath();r.set(s,o)}),r},this.getFieldEntitiesForNamePathList=function(n){if(!n)return t.getFieldEntities(!0);var r=t.getFieldsMap(!0);return n.map(function(o){var s=qo(o);return r.get(s)||{INVALIDATE_NAME_PATH:qo(o)}})},this.getFieldsValue=function(n,r){if(t.warningUnhooked(),n===!0&&!r)return t.store;var o=t.getFieldEntitiesForNamePathList(Array.isArray(n)?n:null),s=[];return o.forEach(function(a){var l,c="INVALIDATE_NAME_PATH"in a?a.INVALIDATE_NAME_PATH:a.getNamePath();if(!(!n&&(!((l=a.isListField)===null||l===void 0)&&l.call(a))))if(!r)s.push(c);else{var u="getMeta"in a?a.getMeta():null;r(u)&&s.push(c)}}),vce(t.store,s.map(qo))},this.getFieldValue=function(n){t.warningUnhooked();var r=qo(n);return Yd(t.store,r)},this.getFieldsError=function(n){t.warningUnhooked();var r=t.getFieldEntitiesForNamePathList(n);return r.map(function(o,s){return o&&!("INVALIDATE_NAME_PATH"in o)?{name:o.getNamePath(),errors:o.getErrors(),warnings:o.getWarnings()}:{name:qo(n[s]),errors:[],warnings:[]}})},this.getFieldError=function(n){t.warningUnhooked();var r=qo(n),o=t.getFieldsError([r])[0];return o.errors},this.getFieldWarning=function(n){t.warningUnhooked();var r=qo(n),o=t.getFieldsError([r])[0];return o.warnings},this.isFieldsTouched=function(){t.warningUnhooked();for(var n=arguments.length,r=new Array(n),o=0;o0&&arguments[0]!==void 0?arguments[0]:{},r=new p1,o=t.getFieldEntities(!0);o.forEach(function(l){var c=l.props.initialValue,u=l.getNamePath();if(c!==void 0){var d=r.get(u)||new Set;d.add({entity:l,value:c}),r.set(u,d)}});var s=function(c){c.forEach(function(u){var d=u.props.initialValue;if(d!==void 0){var h=u.getNamePath(),f=t.getInitialValue(h);if(f!==void 0)ao(!1,"Form already set 'initialValues' with path '".concat(h.join("."),"'. Field can not overwrite it."));else{var g=r.get(h);if(g&&g.size>1)ao(!1,"Multiple Field with path '".concat(h.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(g){var p=t.getFieldValue(h);(!n.skipExist||p===void 0)&&t.updateStore(xm(t.store,h,ft(g)[0].value))}}}})},a;n.entities?a=n.entities:n.namePathList?(a=[],n.namePathList.forEach(function(l){var c=r.get(l);if(c){var u;(u=a).push.apply(u,ft(ft(c).map(function(d){return d.entity})))}})):a=o,s(a)},this.resetFields=function(n){t.warningUnhooked();var r=t.store;if(!n){t.updateStore(KE({},t.initialValues)),t.resetWithFieldInitialValue(),t.notifyObservers(r,null,{type:"reset"}),t.notifyWatch();return}var o=n.map(qo);o.forEach(function(s){var a=t.getInitialValue(s);t.updateStore(xm(t.store,s,a))}),t.resetWithFieldInitialValue({namePathList:o}),t.notifyObservers(r,o,{type:"reset"}),t.notifyWatch(o)},this.setFields=function(n){t.warningUnhooked();var r=t.store,o=[];n.forEach(function(s){var a=s.name,l=Nn(s,Kpt),c=qo(a);o.push(c),"value"in l&&t.updateStore(xm(t.store,c,l.value)),t.notifyObservers(r,[c],{type:"setField",data:s})}),t.notifyWatch(o)},this.getFields=function(){var n=t.getFieldEntities(!0),r=n.map(function(o){var s=o.getNamePath(),a=o.getMeta(),l=te(te({},a),{},{name:s,value:t.getFieldValue(s)});return Object.defineProperty(l,"originRCField",{value:!0}),l});return r},this.initEntityValue=function(n){var r=n.props.initialValue;if(r!==void 0){var o=n.getNamePath(),s=Yd(t.store,o);s===void 0&&t.updateStore(xm(t.store,o,r))}},this.isMergedPreserve=function(n){var r=n!==void 0?n:t.preserve;return r??!0},this.registerField=function(n){t.fieldEntities.push(n);var r=n.getNamePath();if(t.notifyWatch([r]),n.props.initialValue!==void 0){var o=t.store;t.resetWithFieldInitialValue({entities:[n],skipExist:!0}),t.notifyObservers(o,[n.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(s,a){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(t.fieldEntities=t.fieldEntities.filter(function(d){return d!==n}),!t.isMergedPreserve(a)&&(!s||l.length>1)){var c=s?void 0:t.getInitialValue(r);if(r.length&&t.getFieldValue(r)!==c&&t.fieldEntities.every(function(d){return!Gwe(d.getNamePath(),r)})){var u=t.store;t.updateStore(xm(u,r,c,!0)),t.notifyObservers(u,[r],{type:"remove"}),t.triggerDependenciesUpdate(u,r)}}t.notifyWatch([r])}},this.dispatch=function(n){switch(n.type){case"updateValue":{var r=n.namePath,o=n.value;t.updateValue(r,o);break}case"validateField":{var s=n.namePath,a=n.triggerName;t.validateFields([s],{triggerName:a});break}}},this.notifyObservers=function(n,r,o){if(t.subscribable){var s=te(te({},o),{},{store:t.getFieldsValue(!0)});t.getFieldEntities().forEach(function(a){var l=a.onStoreChange;l(n,r,s)})}else t.forceRootUpdate()},this.triggerDependenciesUpdate=function(n,r){var o=t.getDependencyChildrenFields(r);return o.length&&t.validateFields(o),t.notifyObservers(n,o,{type:"dependenciesUpdate",relatedFields:[r].concat(ft(o))}),o},this.updateValue=function(n,r){var o=qo(n),s=t.store;t.updateStore(xm(t.store,o,r)),t.notifyObservers(s,[o],{type:"valueUpdate",source:"internal"}),t.notifyWatch([o]);var a=t.triggerDependenciesUpdate(s,o),l=t.callbacks.onValuesChange;if(l){var c=vce(t.store,[o]);l(c,t.getFieldsValue())}t.triggerOnFieldsChange([o].concat(ft(a)))},this.setFieldsValue=function(n){t.warningUnhooked();var r=t.store;if(n){var o=KE(t.store,n);t.updateStore(o)}t.notifyObservers(r,null,{type:"valueUpdate",source:"external"}),t.notifyWatch()},this.setFieldValue=function(n,r){t.setFields([{name:n,value:r}])},this.getDependencyChildrenFields=function(n){var r=new Set,o=[],s=new p1;t.getFieldEntities().forEach(function(l){var c=l.props.dependencies;(c||[]).forEach(function(u){var d=qo(u);s.update(d,function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Set;return h.add(l),h})})});var a=function l(c){var u=s.get(c)||new Set;u.forEach(function(d){if(!r.has(d)){r.add(d);var h=d.getNamePath();d.isFieldDirty()&&h.length&&(o.push(h),l(h))}})};return a(n),o},this.triggerOnFieldsChange=function(n,r){var o=t.callbacks.onFieldsChange;if(o){var s=t.getFields();if(r){var a=new p1;r.forEach(function(c){var u=c.name,d=c.errors;a.set(u,d)}),s.forEach(function(c){c.errors=a.get(c.name)||c.errors})}var l=s.filter(function(c){var u=c.name;return jE(n,u)});o(l,s)}},this.validateFields=function(n,r){t.warningUnhooked();var o=!!n,s=o?n.map(qo):[],a=[];t.getFieldEntities(!0).forEach(function(u){if(o||s.push(u.getNamePath()),r!=null&&r.recursive&&o){var d=u.getNamePath();d.every(function(g,p){return n[p]===g||n[p]===void 0})&&s.push(d)}if(!(!u.props.rules||!u.props.rules.length)){var h=u.getNamePath();if(!o||jE(s,h)){var f=u.validateRules(te({validateMessages:te(te({},zwe),t.validateMessages)},r));a.push(f.then(function(){return{name:h,errors:[],warnings:[]}}).catch(function(g){var p,v=[],m=[];return(p=g.forEach)===null||p===void 0||p.call(g,function(_){var y=_.rule.warningOnly,S=_.errors;y?m.push.apply(m,ft(S)):v.push.apply(v,ft(S))}),v.length?Promise.reject({name:h,errors:v,warnings:m}):{name:h,errors:v,warnings:m}}))}}});var l=jpt(a);t.lastValidatePromise=l,l.catch(function(u){return u}).then(function(u){var d=u.map(function(h){var f=h.name;return f});t.notifyObservers(t.store,d,{type:"validateFinish"}),t.triggerOnFieldsChange(d,u)});var c=l.then(function(){return t.lastValidatePromise===l?Promise.resolve(t.getFieldsValue(s)):Promise.reject([])}).catch(function(u){var d=u.filter(function(h){return h&&h.errors.length});return Promise.reject({values:t.getFieldsValue(s),errorFields:d,outOfDate:t.lastValidatePromise!==l})});return c.catch(function(u){return u}),t.triggerOnFieldsChange(s),c},this.submit=function(){t.warningUnhooked(),t.validateFields().then(function(n){var r=t.callbacks.onFinish;if(r)try{r(n)}catch(o){console.error(o)}}).catch(function(n){var r=t.callbacks.onFinishFailed;r&&r(n)})},this.forceRootUpdate=e});function Ywe(i){var e=C.useRef(),t=C.useState({}),n=Ae(t,2),r=n[1];if(!e.current)if(i)e.current=i;else{var o=function(){r({})},s=new Gpt(o);e.current=s.getForm()}return[e.current]}var Gj=C.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),Zwe=function(e){var t=e.validateMessages,n=e.onFormChange,r=e.onFormFinish,o=e.children,s=C.useContext(Gj),a=C.useRef({});return C.createElement(Gj.Provider,{value:te(te({},s),{},{validateMessages:te(te({},s.validateMessages),t),triggerFormChange:function(c,u){n&&n(c,{changedFields:u,forms:a.current}),s.triggerFormChange(c,u)},triggerFormFinish:function(c,u){r&&r(c,{values:u,forms:a.current}),s.triggerFormFinish(c,u)},registerForm:function(c,u){c&&(a.current=te(te({},a.current),{},be({},c,u))),s.registerForm(c,u)},unregisterForm:function(c){var u=te({},a.current);delete u[c],a.current=u,s.unregisterForm(c)}})},o)},qpt=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed"],Xpt=function(e,t){var n=e.name,r=e.initialValues,o=e.fields,s=e.form,a=e.preserve,l=e.children,c=e.component,u=c===void 0?"form":c,d=e.validateMessages,h=e.validateTrigger,f=h===void 0?"onChange":h,g=e.onValuesChange,p=e.onFieldsChange,v=e.onFinish,m=e.onFinishFailed,_=Nn(e,qpt),y=C.useContext(Gj),S=Ywe(s),L=Ae(S,1),E=L[0],D=E.getInternalHooks(X0),k=D.useSubscribe,T=D.setInitialValues,M=D.setCallbacks,A=D.setValidateMessages,N=D.setPreserve,R=D.destroyForm;C.useImperativeHandle(t,function(){return E}),C.useEffect(function(){return y.registerForm(n,E),function(){y.unregisterForm(n)}},[y,E,n]),A(te(te({},y.validateMessages),d)),M({onValuesChange:g,onFieldsChange:function(J){if(y.triggerFormChange(n,J),p){for(var Q=arguments.length,ue=new Array(Q>1?Q-1:0),de=1;de{const t=C.useContext(AZ),n=C.useMemo(()=>{var o;const s=e||tC[i],a=(o=t==null?void 0:t[i])!==null&&o!==void 0?o:{};return Object.assign(Object.assign({},typeof s=="function"?s():s),a||{})},[i,e,t]),r=C.useMemo(()=>{const o=t==null?void 0:t.locale;return t!=null&&t.exist&&!o?tC.locale:o},[t]);return[n,r]},ST=imt,rmt="internalMark",omt=i=>{const{locale:e={},children:t,_ANT_MARK__:n}=i;C.useEffect(()=>(Lce(e&&e.Modal),()=>{Lce()}),[e]);const r=C.useMemo(()=>Object.assign(Object.assign({},e),{exist:!0}),[e]);return C.createElement(AZ.Provider,{value:r},t)},smt=omt,amt="5.4.2",sk=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"],lmt=i=>{const{controlHeight:e}=i;return{controlHeightSM:e*.75,controlHeightXS:e*.5,controlHeightLG:e*1.25}},tSe=lmt;function cmt(i){const{sizeUnit:e,sizeStep:t}=i;return{sizeXXL:e*(t+8),sizeXL:e*(t+4),sizeLG:e*(t+2),sizeMD:e*(t+1),sizeMS:e*t,size:e*t,sizeSM:e*(t-1),sizeXS:e*(t-2),sizeXXS:e*(t-3)}}const PZ={blue:"#1677ff",purple:"#722ED1",cyan:"#13C2C2",green:"#52C41A",magenta:"#EB2F96",pink:"#eb2f96",red:"#F5222D",orange:"#FA8C16",yellow:"#FADB14",volcano:"#FA541C",geekblue:"#2F54EB",gold:"#FAAD14",lime:"#A0D911"},umt=Object.assign(Object.assign({},PZ),{colorPrimary:"#1677ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1677ff",colorTextBase:"",colorBgBase:"",fontFamily:`-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', -'Noto Color Emoji'`,fontFamilyCode:"'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace",fontSize:14,lineWidth:1,lineType:"solid",motionUnit:.1,motionBase:0,motionEaseOutCirc:"cubic-bezier(0.08, 0.82, 0.17, 1)",motionEaseInOutCirc:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",motionEaseOut:"cubic-bezier(0.215, 0.61, 0.355, 1)",motionEaseInOut:"cubic-bezier(0.645, 0.045, 0.355, 1)",motionEaseOutBack:"cubic-bezier(0.12, 0.4, 0.29, 1.46)",motionEaseInBack:"cubic-bezier(0.71, -0.46, 0.88, 0.6)",motionEaseInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",motionEaseOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",borderRadius:6,sizeUnit:4,sizeStep:4,sizePopupArrow:16,controlHeight:32,zIndexBase:0,zIndexPopupBase:1e3,opacityImage:1,wireframe:!1}),k5=umt;function nSe(i,e){let{generateColorPalettes:t,generateNeutralColorPalettes:n}=e;const{colorSuccess:r,colorWarning:o,colorError:s,colorInfo:a,colorPrimary:l,colorBgBase:c,colorTextBase:u}=i,d=t(l),h=t(r),f=t(o),g=t(s),p=t(a),v=n(c,u);return Object.assign(Object.assign({},v),{colorPrimaryBg:d[1],colorPrimaryBgHover:d[2],colorPrimaryBorder:d[3],colorPrimaryBorderHover:d[4],colorPrimaryHover:d[5],colorPrimary:d[6],colorPrimaryActive:d[7],colorPrimaryTextHover:d[8],colorPrimaryText:d[9],colorPrimaryTextActive:d[10],colorSuccessBg:h[1],colorSuccessBgHover:h[2],colorSuccessBorder:h[3],colorSuccessBorderHover:h[4],colorSuccessHover:h[4],colorSuccess:h[6],colorSuccessActive:h[7],colorSuccessTextHover:h[8],colorSuccessText:h[9],colorSuccessTextActive:h[10],colorErrorBg:g[1],colorErrorBgHover:g[2],colorErrorBorder:g[3],colorErrorBorderHover:g[4],colorErrorHover:g[5],colorError:g[6],colorErrorActive:g[7],colorErrorTextHover:g[8],colorErrorText:g[9],colorErrorTextActive:g[10],colorWarningBg:f[1],colorWarningBgHover:f[2],colorWarningBorder:f[3],colorWarningBorderHover:f[4],colorWarningHover:f[4],colorWarning:f[6],colorWarningActive:f[7],colorWarningTextHover:f[8],colorWarningText:f[9],colorWarningTextActive:f[10],colorInfoBg:p[1],colorInfoBgHover:p[2],colorInfoBorder:p[3],colorInfoBorderHover:p[4],colorInfoHover:p[4],colorInfo:p[6],colorInfoActive:p[7],colorInfoTextHover:p[8],colorInfoText:p[9],colorInfoTextActive:p[10],colorBgMask:new Yr("#000").setAlpha(.45).toRgbString(),colorWhite:"#fff"})}const dmt=i=>{let e=i,t=i,n=i,r=i;return i<6&&i>=5?e=i+1:i<16&&i>=6?e=i+2:i>=16&&(e=16),i<7&&i>=5?t=4:i<8&&i>=7?t=5:i<14&&i>=8?t=6:i<16&&i>=14?t=7:i>=16&&(t=8),i<6&&i>=2?n=1:i>=6&&(n=2),i>4&&i<8?r=4:i>=8&&(r=6),{borderRadius:i>16?16:i,borderRadiusXS:n,borderRadiusSM:t,borderRadiusLG:e,borderRadiusOuter:r}},hmt=dmt;function fmt(i){const{motionUnit:e,motionBase:t,borderRadius:n,lineWidth:r}=i;return Object.assign({motionDurationFast:`${(t+e).toFixed(1)}s`,motionDurationMid:`${(t+e*2).toFixed(1)}s`,motionDurationSlow:`${(t+e*3).toFixed(1)}s`,lineWidthBold:r+1},hmt(n))}const wg=(i,e)=>new Yr(i).setAlpha(e).toRgbString(),sL=(i,e)=>new Yr(i).darken(e).toHexString(),gmt=i=>{const e=Ap(i);return{1:e[0],2:e[1],3:e[2],4:e[3],5:e[4],6:e[5],7:e[6],8:e[4],9:e[5],10:e[6]}},pmt=(i,e)=>{const t=i||"#fff",n=e||"#000";return{colorBgBase:t,colorTextBase:n,colorText:wg(n,.88),colorTextSecondary:wg(n,.65),colorTextTertiary:wg(n,.45),colorTextQuaternary:wg(n,.25),colorFill:wg(n,.15),colorFillSecondary:wg(n,.06),colorFillTertiary:wg(n,.04),colorFillQuaternary:wg(n,.02),colorBgLayout:sL(t,4),colorBgContainer:sL(t,0),colorBgElevated:sL(t,0),colorBgSpotlight:wg(n,.85),colorBorder:sL(t,15),colorBorderSecondary:sL(t,6)}};function mmt(i){const e=new Array(10).fill(null).map((t,n)=>{const r=n-1,o=i*Math.pow(2.71828,r/5),s=n>1?Math.floor(o):Math.ceil(o);return Math.floor(s/2)*2});return e[1]=i,e.map(t=>{const n=t+8;return{size:t,lineHeight:n/t}})}const vmt=i=>{const e=mmt(i),t=e.map(r=>r.size),n=e.map(r=>r.lineHeight);return{fontSizeSM:t[0],fontSize:t[1],fontSizeLG:t[2],fontSizeXL:t[3],fontSizeHeading1:t[6],fontSizeHeading2:t[5],fontSizeHeading3:t[4],fontSizeHeading4:t[3],fontSizeHeading5:t[2],lineHeight:n[1],lineHeightLG:n[2],lineHeightSM:n[0],lineHeightHeading1:n[6],lineHeightHeading2:n[5],lineHeightHeading3:n[4],lineHeightHeading4:n[3],lineHeightHeading5:n[2]}},iSe=vmt;function T5(i){const e=Object.keys(PZ).map(t=>{const n=Ap(i[t]);return new Array(10).fill(1).reduce((r,o,s)=>(r[`${t}-${s+1}`]=n[s],r[`${t}${s+1}`]=n[s],r),{})}).reduce((t,n)=>(t=Object.assign(Object.assign({},t),n),t),{});return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},i),e),nSe(i,{generateColorPalettes:gmt,generateNeutralColorPalettes:pmt})),iSe(i.fontSize)),cmt(i)),tSe(i)),fmt(i))}function c7(i){return i>=0&&i<=255}function E2(i,e){const{r:t,g:n,b:r,a:o}=new Yr(i).toRgb();if(o<1)return i;const{r:s,g:a,b:l}=new Yr(e).toRgb();for(let c=.01;c<=1;c+=.01){const u=Math.round((t-s*(1-c))/c),d=Math.round((n-a*(1-c))/c),h=Math.round((r-l*(1-c))/c);if(c7(u)&&c7(d)&&c7(h))return new Yr({r:u,g:d,b:h,a:Math.round(c*100)/100}).toRgbString()}return new Yr({r:t,g:n,b:r,a:1}).toRgbString()}var _mt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{delete n[h]});const r=Object.assign(Object.assign({},t),n),o=480,s=576,a=768,l=992,c=1200,u=1600;return Object.assign(Object.assign(Object.assign({},r),{colorLink:r.colorInfoText,colorLinkHover:r.colorInfoHover,colorLinkActive:r.colorInfoActive,colorFillContent:r.colorFillSecondary,colorFillContentHover:r.colorFill,colorFillAlter:r.colorFillQuaternary,colorBgContainerDisabled:r.colorFillTertiary,colorBorderBg:r.colorBgContainer,colorSplit:E2(r.colorBorderSecondary,r.colorBgContainer),colorTextPlaceholder:r.colorTextQuaternary,colorTextDisabled:r.colorTextQuaternary,colorTextHeading:r.colorText,colorTextLabel:r.colorTextSecondary,colorTextDescription:r.colorTextTertiary,colorTextLightSolid:r.colorWhite,colorHighlight:r.colorError,colorBgTextHover:r.colorFillSecondary,colorBgTextActive:r.colorFill,colorIcon:r.colorTextTertiary,colorIconHover:r.colorText,colorErrorOutline:E2(r.colorErrorBg,r.colorBgContainer),colorWarningOutline:E2(r.colorWarningBg,r.colorBgContainer),fontSizeIcon:r.fontSizeSM,lineWidthFocus:r.lineWidth*4,lineWidth:r.lineWidth,controlOutlineWidth:r.lineWidth*2,controlInteractiveSize:r.controlHeight/2,controlItemBgHover:r.colorFillTertiary,controlItemBgActive:r.colorPrimaryBg,controlItemBgActiveHover:r.colorPrimaryBgHover,controlItemBgActiveDisabled:r.colorFill,controlTmpOutline:r.colorFillQuaternary,controlOutline:E2(r.colorPrimaryBg,r.colorBgContainer),lineType:r.lineType,borderRadius:r.borderRadius,borderRadiusXS:r.borderRadiusXS,borderRadiusSM:r.borderRadiusSM,borderRadiusLG:r.borderRadiusLG,fontWeightStrong:600,opacityLoading:.65,linkDecoration:"none",linkHoverDecoration:"none",linkFocusDecoration:"none",controlPaddingHorizontal:12,controlPaddingHorizontalSM:8,paddingXXS:r.sizeXXS,paddingXS:r.sizeXS,paddingSM:r.sizeSM,padding:r.size,paddingMD:r.sizeMD,paddingLG:r.sizeLG,paddingXL:r.sizeXL,paddingContentHorizontalLG:r.sizeLG,paddingContentVerticalLG:r.sizeMS,paddingContentHorizontal:r.sizeMS,paddingContentVertical:r.sizeSM,paddingContentHorizontalSM:r.size,paddingContentVerticalSM:r.sizeXS,marginXXS:r.sizeXXS,marginXS:r.sizeXS,marginSM:r.sizeSM,margin:r.size,marginMD:r.sizeMD,marginLG:r.sizeLG,marginXL:r.sizeXL,marginXXL:r.sizeXXL,boxShadow:` +'Noto Color Emoji'`,fontFamilyCode:"'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace",fontSize:14,lineWidth:1,lineType:"solid",motionUnit:.1,motionBase:0,motionEaseOutCirc:"cubic-bezier(0.08, 0.82, 0.17, 1)",motionEaseInOutCirc:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",motionEaseOut:"cubic-bezier(0.215, 0.61, 0.355, 1)",motionEaseInOut:"cubic-bezier(0.645, 0.045, 0.355, 1)",motionEaseOutBack:"cubic-bezier(0.12, 0.4, 0.29, 1.46)",motionEaseInBack:"cubic-bezier(0.71, -0.46, 0.88, 0.6)",motionEaseInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",motionEaseOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",borderRadius:6,sizeUnit:4,sizeStep:4,sizePopupArrow:16,controlHeight:32,zIndexBase:0,zIndexPopupBase:1e3,opacityImage:1,wireframe:!1}),k5=umt;function nSe(i,e){let{generateColorPalettes:t,generateNeutralColorPalettes:n}=e;const{colorSuccess:r,colorWarning:o,colorError:s,colorInfo:a,colorPrimary:l,colorBgBase:c,colorTextBase:u}=i,d=t(l),h=t(r),f=t(o),g=t(s),p=t(a),v=n(c,u);return Object.assign(Object.assign({},v),{colorPrimaryBg:d[1],colorPrimaryBgHover:d[2],colorPrimaryBorder:d[3],colorPrimaryBorderHover:d[4],colorPrimaryHover:d[5],colorPrimary:d[6],colorPrimaryActive:d[7],colorPrimaryTextHover:d[8],colorPrimaryText:d[9],colorPrimaryTextActive:d[10],colorSuccessBg:h[1],colorSuccessBgHover:h[2],colorSuccessBorder:h[3],colorSuccessBorderHover:h[4],colorSuccessHover:h[4],colorSuccess:h[6],colorSuccessActive:h[7],colorSuccessTextHover:h[8],colorSuccessText:h[9],colorSuccessTextActive:h[10],colorErrorBg:g[1],colorErrorBgHover:g[2],colorErrorBorder:g[3],colorErrorBorderHover:g[4],colorErrorHover:g[5],colorError:g[6],colorErrorActive:g[7],colorErrorTextHover:g[8],colorErrorText:g[9],colorErrorTextActive:g[10],colorWarningBg:f[1],colorWarningBgHover:f[2],colorWarningBorder:f[3],colorWarningBorderHover:f[4],colorWarningHover:f[4],colorWarning:f[6],colorWarningActive:f[7],colorWarningTextHover:f[8],colorWarningText:f[9],colorWarningTextActive:f[10],colorInfoBg:p[1],colorInfoBgHover:p[2],colorInfoBorder:p[3],colorInfoBorderHover:p[4],colorInfoHover:p[4],colorInfo:p[6],colorInfoActive:p[7],colorInfoTextHover:p[8],colorInfoText:p[9],colorInfoTextActive:p[10],colorBgMask:new Yr("#000").setAlpha(.45).toRgbString(),colorWhite:"#fff"})}const dmt=i=>{let e=i,t=i,n=i,r=i;return i<6&&i>=5?e=i+1:i<16&&i>=6?e=i+2:i>=16&&(e=16),i<7&&i>=5?t=4:i<8&&i>=7?t=5:i<14&&i>=8?t=6:i<16&&i>=14?t=7:i>=16&&(t=8),i<6&&i>=2?n=1:i>=6&&(n=2),i>4&&i<8?r=4:i>=8&&(r=6),{borderRadius:i>16?16:i,borderRadiusXS:n,borderRadiusSM:t,borderRadiusLG:e,borderRadiusOuter:r}},hmt=dmt;function fmt(i){const{motionUnit:e,motionBase:t,borderRadius:n,lineWidth:r}=i;return Object.assign({motionDurationFast:`${(t+e).toFixed(1)}s`,motionDurationMid:`${(t+e*2).toFixed(1)}s`,motionDurationSlow:`${(t+e*3).toFixed(1)}s`,lineWidthBold:r+1},hmt(n))}const wg=(i,e)=>new Yr(i).setAlpha(e).toRgbString(),sL=(i,e)=>new Yr(i).darken(e).toHexString(),gmt=i=>{const e=Pp(i);return{1:e[0],2:e[1],3:e[2],4:e[3],5:e[4],6:e[5],7:e[6],8:e[4],9:e[5],10:e[6]}},pmt=(i,e)=>{const t=i||"#fff",n=e||"#000";return{colorBgBase:t,colorTextBase:n,colorText:wg(n,.88),colorTextSecondary:wg(n,.65),colorTextTertiary:wg(n,.45),colorTextQuaternary:wg(n,.25),colorFill:wg(n,.15),colorFillSecondary:wg(n,.06),colorFillTertiary:wg(n,.04),colorFillQuaternary:wg(n,.02),colorBgLayout:sL(t,4),colorBgContainer:sL(t,0),colorBgElevated:sL(t,0),colorBgSpotlight:wg(n,.85),colorBorder:sL(t,15),colorBorderSecondary:sL(t,6)}};function mmt(i){const e=new Array(10).fill(null).map((t,n)=>{const r=n-1,o=i*Math.pow(2.71828,r/5),s=n>1?Math.floor(o):Math.ceil(o);return Math.floor(s/2)*2});return e[1]=i,e.map(t=>{const n=t+8;return{size:t,lineHeight:n/t}})}const vmt=i=>{const e=mmt(i),t=e.map(r=>r.size),n=e.map(r=>r.lineHeight);return{fontSizeSM:t[0],fontSize:t[1],fontSizeLG:t[2],fontSizeXL:t[3],fontSizeHeading1:t[6],fontSizeHeading2:t[5],fontSizeHeading3:t[4],fontSizeHeading4:t[3],fontSizeHeading5:t[2],lineHeight:n[1],lineHeightLG:n[2],lineHeightSM:n[0],lineHeightHeading1:n[6],lineHeightHeading2:n[5],lineHeightHeading3:n[4],lineHeightHeading4:n[3],lineHeightHeading5:n[2]}},iSe=vmt;function T5(i){const e=Object.keys(PZ).map(t=>{const n=Pp(i[t]);return new Array(10).fill(1).reduce((r,o,s)=>(r[`${t}-${s+1}`]=n[s],r[`${t}${s+1}`]=n[s],r),{})}).reduce((t,n)=>(t=Object.assign(Object.assign({},t),n),t),{});return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},i),e),nSe(i,{generateColorPalettes:gmt,generateNeutralColorPalettes:pmt})),iSe(i.fontSize)),cmt(i)),tSe(i)),fmt(i))}function c7(i){return i>=0&&i<=255}function E2(i,e){const{r:t,g:n,b:r,a:o}=new Yr(i).toRgb();if(o<1)return i;const{r:s,g:a,b:l}=new Yr(e).toRgb();for(let c=.01;c<=1;c+=.01){const u=Math.round((t-s*(1-c))/c),d=Math.round((n-a*(1-c))/c),h=Math.round((r-l*(1-c))/c);if(c7(u)&&c7(d)&&c7(h))return new Yr({r:u,g:d,b:h,a:Math.round(c*100)/100}).toRgbString()}return new Yr({r:t,g:n,b:r,a:1}).toRgbString()}var _mt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{delete n[h]});const r=Object.assign(Object.assign({},t),n),o=480,s=576,a=768,l=992,c=1200,u=1600;return Object.assign(Object.assign(Object.assign({},r),{colorLink:r.colorInfoText,colorLinkHover:r.colorInfoHover,colorLinkActive:r.colorInfoActive,colorFillContent:r.colorFillSecondary,colorFillContentHover:r.colorFill,colorFillAlter:r.colorFillQuaternary,colorBgContainerDisabled:r.colorFillTertiary,colorBorderBg:r.colorBgContainer,colorSplit:E2(r.colorBorderSecondary,r.colorBgContainer),colorTextPlaceholder:r.colorTextQuaternary,colorTextDisabled:r.colorTextQuaternary,colorTextHeading:r.colorText,colorTextLabel:r.colorTextSecondary,colorTextDescription:r.colorTextTertiary,colorTextLightSolid:r.colorWhite,colorHighlight:r.colorError,colorBgTextHover:r.colorFillSecondary,colorBgTextActive:r.colorFill,colorIcon:r.colorTextTertiary,colorIconHover:r.colorText,colorErrorOutline:E2(r.colorErrorBg,r.colorBgContainer),colorWarningOutline:E2(r.colorWarningBg,r.colorBgContainer),fontSizeIcon:r.fontSizeSM,lineWidthFocus:r.lineWidth*4,lineWidth:r.lineWidth,controlOutlineWidth:r.lineWidth*2,controlInteractiveSize:r.controlHeight/2,controlItemBgHover:r.colorFillTertiary,controlItemBgActive:r.colorPrimaryBg,controlItemBgActiveHover:r.colorPrimaryBgHover,controlItemBgActiveDisabled:r.colorFill,controlTmpOutline:r.colorFillQuaternary,controlOutline:E2(r.colorPrimaryBg,r.colorBgContainer),lineType:r.lineType,borderRadius:r.borderRadius,borderRadiusXS:r.borderRadiusXS,borderRadiusSM:r.borderRadiusSM,borderRadiusLG:r.borderRadiusLG,fontWeightStrong:600,opacityLoading:.65,linkDecoration:"none",linkHoverDecoration:"none",linkFocusDecoration:"none",controlPaddingHorizontal:12,controlPaddingHorizontalSM:8,paddingXXS:r.sizeXXS,paddingXS:r.sizeXS,paddingSM:r.sizeSM,padding:r.size,paddingMD:r.sizeMD,paddingLG:r.sizeLG,paddingXL:r.sizeXL,paddingContentHorizontalLG:r.sizeLG,paddingContentVerticalLG:r.sizeMS,paddingContentHorizontal:r.sizeMS,paddingContentVertical:r.sizeSM,paddingContentHorizontalSM:r.size,paddingContentVerticalSM:r.sizeXS,marginXXS:r.sizeXXS,marginXS:r.sizeXS,marginSM:r.sizeSM,margin:r.size,marginMD:r.sizeMD,marginLG:r.sizeLG,marginXL:r.sizeXL,marginXXL:r.sizeXXL,boxShadow:` 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05) @@ -925,13 +925,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho 0 -6px 16px 0 rgba(0, 0, 0, 0.08), 0 -3px 6px -4px rgba(0, 0, 0, 0.12), 0 -9px 28px 8px rgba(0, 0, 0, 0.05) - `,boxShadowTabsOverflowLeft:"inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowRight:"inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowTop:"inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowBottom:"inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"}),n)}const OZ="anticon",Cmt=(i,e)=>e||(i?`ant-${i}`:"ant"),Rn=C.createContext({getPrefixCls:Cmt,iconPrefixCls:OZ}),ymt=i=>({color:i.colorLink,textDecoration:"none",outline:"none",cursor:"pointer",transition:`color ${i.motionDurationSlow}`,"&:focus, &:hover":{color:i.colorLinkHover},"&:active":{color:i.colorLinkActive}}),wmt=(i,e,t,n,r)=>{const o=i/2,s=0,a=o,l=t*1/Math.sqrt(2),c=o-t*(1-1/Math.sqrt(2)),u=o-e*(1/Math.sqrt(2)),d=t*(Math.sqrt(2)-1)+e*(1/Math.sqrt(2)),h=2*o-u,f=d,g=2*o-l,p=c,v=2*o-s,m=a,_=o*Math.sqrt(2)+t*(Math.sqrt(2)-2);return{pointerEvents:"none",width:i,height:i,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:i,height:i/2,background:n,clipPath:`path('M ${s} ${a} A ${t} ${t} 0 0 0 ${l} ${c} L ${u} ${d} A ${e} ${e} 0 0 1 ${h} ${f} L ${g} ${p} A ${t} ${t} 0 0 0 ${v} ${m} Z')`,content:'""'},"&::after":{content:'""',position:"absolute",width:_,height:_,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${e}px 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:r,zIndex:0,background:"transparent"}}},mb={overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},Wr=i=>({boxSizing:"border-box",margin:0,padding:0,color:i.colorText,fontSize:i.fontSize,lineHeight:i.lineHeight,listStyle:"none",fontFamily:i.fontFamily}),xT=()=>({display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),ak=()=>({"&::before":{display:"table",content:'""'},"&::after":{display:"table",clear:"both",content:'""'}}),Smt=i=>({a:{color:i.colorLink,textDecoration:i.linkDecoration,backgroundColor:"transparent",outline:"none",cursor:"pointer",transition:`color ${i.motionDurationSlow}`,"-webkit-text-decoration-skip":"objects","&:hover":{color:i.colorLinkHover},"&:active":{color:i.colorLinkActive},[`&:active, - &:hover`]:{textDecoration:i.linkHoverDecoration,outline:0},"&:focus":{textDecoration:i.linkFocusDecoration,outline:0},"&[disabled]":{color:i.colorTextDisabled,cursor:"not-allowed"}}}),xmt=(i,e)=>{const{fontFamily:t,fontSize:n}=i,r=`[class^="${e}"], [class*=" ${e}"]`;return{[r]:{fontFamily:t,fontSize:n,boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"},[r]:{boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}}}}},Op=i=>({outline:`${i.lineWidthFocus}px solid ${i.colorPrimaryBorder}`,outlineOffset:1,transition:"outline-offset 0s, outline 0s"}),lk=i=>({"&:focus-visible":Object.assign({},Op(i))});function vo(i,e,t,n){return r=>{const[o,s,a]=DC(),{getPrefixCls:l,iconPrefixCls:c,csp:u}=C.useContext(Rn),d=l(),h={theme:o,token:s,hashId:a,nonce:()=>u==null?void 0:u.nonce};return Oj(Object.assign(Object.assign({},h),{path:["Shared",d]}),()=>[{"&":Smt(s)}]),[Oj(Object.assign(Object.assign({},h),{path:[i,r,c]}),()=>{const{token:f,flush:g}=Emt(s),p=typeof t=="function"?t(f):t,v=Object.assign(Object.assign({},p),s[i]),m=`.${r}`,_=Oi(f,{componentCls:m,prefixCls:r,iconCls:`.${c}`,antCls:`.${d}`},v),y=e(_,{hashId:a,prefixCls:r,rootPrefixCls:d,iconPrefixCls:c,overrideComponentToken:s[i]});return g(i,v),[(n==null?void 0:n.resetStyle)===!1?null:xmt(s,r),y]}),a]}}const rSe=typeof CSSINJS_STATISTIC<"u";let qj=!0;function Oi(){for(var i=arguments.length,e=new Array(i),t=0;t{Object.keys(r).forEach(s=>{Object.defineProperty(n,s,{configurable:!0,enumerable:!0,get:()=>r[s]})})}),qj=!0,n}function Lmt(){}function Emt(i){let e,t=i,n=Lmt;return rSe&&(e=new Set,t=new Proxy(i,{get(r,o){return qj&&e.add(o),r[o]}}),n=(r,o)=>{Array.from(e)}),{token:t,keys:e,flush:n}}function Dmt(i,e){return sk.reduce((t,n)=>{const r=i[`${n}1`],o=i[`${n}3`],s=i[`${n}6`],a=i[`${n}7`];return Object.assign(Object.assign({},t),e(n,{lightColor:r,lightBorderColor:o,darkColor:s,textColor:a}))},{})}const Imt=Hwe(T5),VO={token:k5,hashed:!0},oSe=$e.createContext(VO);function DC(){const{token:i,hashed:e,theme:t,components:n}=$e.useContext(oSe),r=`${amt}-${e||""}`,o=t||Imt,[s,a]=Tgt(o,[k5,i],{salt:r,override:Object.assign({override:i},n),formatToken:bmt});return[o,s,e?a:""]}const kmt=`-ant-${Date.now()}-${Math.random()}`;function Tmt(i,e){const t={},n=(s,a)=>{let l=s.clone();return l=(a==null?void 0:a(l))||l,l.toRgbString()},r=(s,a)=>{const l=new Yr(s),c=Ap(l.toRgbString());t[`${a}-color`]=n(l),t[`${a}-color-disabled`]=c[1],t[`${a}-color-hover`]=c[4],t[`${a}-color-active`]=c[6],t[`${a}-color-outline`]=l.clone().setAlpha(.2).toRgbString(),t[`${a}-color-deprecated-bg`]=c[0],t[`${a}-color-deprecated-border`]=c[2]};if(e.primaryColor){r(e.primaryColor,"primary");const s=new Yr(e.primaryColor),a=Ap(s.toRgbString());a.forEach((c,u)=>{t[`primary-${u+1}`]=c}),t["primary-color-deprecated-l-35"]=n(s,c=>c.lighten(35)),t["primary-color-deprecated-l-20"]=n(s,c=>c.lighten(20)),t["primary-color-deprecated-t-20"]=n(s,c=>c.tint(20)),t["primary-color-deprecated-t-50"]=n(s,c=>c.tint(50)),t["primary-color-deprecated-f-12"]=n(s,c=>c.setAlpha(c.getAlpha()*.12));const l=new Yr(a[0]);t["primary-color-active-deprecated-f-30"]=n(l,c=>c.setAlpha(c.getAlpha()*.3)),t["primary-color-active-deprecated-d-02"]=n(l,c=>c.darken(2))}return e.successColor&&r(e.successColor,"success"),e.warningColor&&r(e.warningColor,"warning"),e.errorColor&&r(e.errorColor,"error"),e.infoColor&&r(e.infoColor,"info"),` + `,boxShadowTabsOverflowLeft:"inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowRight:"inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowTop:"inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowBottom:"inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"}),n)}const OZ="anticon",Cmt=(i,e)=>e||(i?`ant-${i}`:"ant"),Rn=C.createContext({getPrefixCls:Cmt,iconPrefixCls:OZ}),ymt=i=>({color:i.colorLink,textDecoration:"none",outline:"none",cursor:"pointer",transition:`color ${i.motionDurationSlow}`,"&:focus, &:hover":{color:i.colorLinkHover},"&:active":{color:i.colorLinkActive}}),wmt=(i,e,t,n,r)=>{const o=i/2,s=0,a=o,l=t*1/Math.sqrt(2),c=o-t*(1-1/Math.sqrt(2)),u=o-e*(1/Math.sqrt(2)),d=t*(Math.sqrt(2)-1)+e*(1/Math.sqrt(2)),h=2*o-u,f=d,g=2*o-l,p=c,v=2*o-s,m=a,_=o*Math.sqrt(2)+t*(Math.sqrt(2)-2);return{pointerEvents:"none",width:i,height:i,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:i,height:i/2,background:n,clipPath:`path('M ${s} ${a} A ${t} ${t} 0 0 0 ${l} ${c} L ${u} ${d} A ${e} ${e} 0 0 1 ${h} ${f} L ${g} ${p} A ${t} ${t} 0 0 0 ${v} ${m} Z')`,content:'""'},"&::after":{content:'""',position:"absolute",width:_,height:_,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${e}px 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:r,zIndex:0,background:"transparent"}}},pb={overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},Wr=i=>({boxSizing:"border-box",margin:0,padding:0,color:i.colorText,fontSize:i.fontSize,lineHeight:i.lineHeight,listStyle:"none",fontFamily:i.fontFamily}),xT=()=>({display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),ak=()=>({"&::before":{display:"table",content:'""'},"&::after":{display:"table",clear:"both",content:'""'}}),Smt=i=>({a:{color:i.colorLink,textDecoration:i.linkDecoration,backgroundColor:"transparent",outline:"none",cursor:"pointer",transition:`color ${i.motionDurationSlow}`,"-webkit-text-decoration-skip":"objects","&:hover":{color:i.colorLinkHover},"&:active":{color:i.colorLinkActive},[`&:active, + &:hover`]:{textDecoration:i.linkHoverDecoration,outline:0},"&:focus":{textDecoration:i.linkFocusDecoration,outline:0},"&[disabled]":{color:i.colorTextDisabled,cursor:"not-allowed"}}}),xmt=(i,e)=>{const{fontFamily:t,fontSize:n}=i,r=`[class^="${e}"], [class*=" ${e}"]`;return{[r]:{fontFamily:t,fontSize:n,boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"},[r]:{boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}}}}},Fp=i=>({outline:`${i.lineWidthFocus}px solid ${i.colorPrimaryBorder}`,outlineOffset:1,transition:"outline-offset 0s, outline 0s"}),lk=i=>({"&:focus-visible":Object.assign({},Fp(i))});function vo(i,e,t,n){return r=>{const[o,s,a]=DC(),{getPrefixCls:l,iconPrefixCls:c,csp:u}=C.useContext(Rn),d=l(),h={theme:o,token:s,hashId:a,nonce:()=>u==null?void 0:u.nonce};return Oj(Object.assign(Object.assign({},h),{path:["Shared",d]}),()=>[{"&":Smt(s)}]),[Oj(Object.assign(Object.assign({},h),{path:[i,r,c]}),()=>{const{token:f,flush:g}=Emt(s),p=typeof t=="function"?t(f):t,v=Object.assign(Object.assign({},p),s[i]),m=`.${r}`,_=Oi(f,{componentCls:m,prefixCls:r,iconCls:`.${c}`,antCls:`.${d}`},v),y=e(_,{hashId:a,prefixCls:r,rootPrefixCls:d,iconPrefixCls:c,overrideComponentToken:s[i]});return g(i,v),[(n==null?void 0:n.resetStyle)===!1?null:xmt(s,r),y]}),a]}}const rSe=typeof CSSINJS_STATISTIC<"u";let qj=!0;function Oi(){for(var i=arguments.length,e=new Array(i),t=0;t{Object.keys(r).forEach(s=>{Object.defineProperty(n,s,{configurable:!0,enumerable:!0,get:()=>r[s]})})}),qj=!0,n}function Lmt(){}function Emt(i){let e,t=i,n=Lmt;return rSe&&(e=new Set,t=new Proxy(i,{get(r,o){return qj&&e.add(o),r[o]}}),n=(r,o)=>{Array.from(e)}),{token:t,keys:e,flush:n}}function Dmt(i,e){return sk.reduce((t,n)=>{const r=i[`${n}1`],o=i[`${n}3`],s=i[`${n}6`],a=i[`${n}7`];return Object.assign(Object.assign({},t),e(n,{lightColor:r,lightBorderColor:o,darkColor:s,textColor:a}))},{})}const Imt=Hwe(T5),VO={token:k5,hashed:!0},oSe=$e.createContext(VO);function DC(){const{token:i,hashed:e,theme:t,components:n}=$e.useContext(oSe),r=`${amt}-${e||""}`,o=t||Imt,[s,a]=Tgt(o,[k5,i],{salt:r,override:Object.assign({override:i},n),formatToken:bmt});return[o,s,e?a:""]}const kmt=`-ant-${Date.now()}-${Math.random()}`;function Tmt(i,e){const t={},n=(s,a)=>{let l=s.clone();return l=(a==null?void 0:a(l))||l,l.toRgbString()},r=(s,a)=>{const l=new Yr(s),c=Pp(l.toRgbString());t[`${a}-color`]=n(l),t[`${a}-color-disabled`]=c[1],t[`${a}-color-hover`]=c[4],t[`${a}-color-active`]=c[6],t[`${a}-color-outline`]=l.clone().setAlpha(.2).toRgbString(),t[`${a}-color-deprecated-bg`]=c[0],t[`${a}-color-deprecated-border`]=c[2]};if(e.primaryColor){r(e.primaryColor,"primary");const s=new Yr(e.primaryColor),a=Pp(s.toRgbString());a.forEach((c,u)=>{t[`primary-${u+1}`]=c}),t["primary-color-deprecated-l-35"]=n(s,c=>c.lighten(35)),t["primary-color-deprecated-l-20"]=n(s,c=>c.lighten(20)),t["primary-color-deprecated-t-20"]=n(s,c=>c.tint(20)),t["primary-color-deprecated-t-50"]=n(s,c=>c.tint(50)),t["primary-color-deprecated-f-12"]=n(s,c=>c.setAlpha(c.getAlpha()*.12));const l=new Yr(a[0]);t["primary-color-active-deprecated-f-30"]=n(l,c=>c.setAlpha(c.getAlpha()*.3)),t["primary-color-active-deprecated-d-02"]=n(l,c=>c.darken(2))}return e.successColor&&r(e.successColor,"success"),e.warningColor&&r(e.warningColor,"warning"),e.errorColor&&r(e.errorColor,"error"),e.infoColor&&r(e.infoColor,"info"),` :root { ${Object.keys(t).map(s=>`--${i}-${s}: ${t[s]};`).join(` `)} } - `.trim()}function Nmt(i,e){const t=Tmt(i,e);Zs()&&uS(t,`${kmt}-dynamic-theme`)}const Xj=C.createContext(!1),Rmt=i=>{let{children:e,disabled:t}=i;const n=C.useContext(Xj);return C.createElement(Xj.Provider,{value:t??n},e)},H_=Xj,Yj=C.createContext(void 0),Mmt=i=>{let{children:e,size:t}=i;const n=C.useContext(Yj);return C.createElement(Yj.Provider,{value:t||n},e)},Rh=Yj;function Amt(){const i=C.useContext(H_),e=C.useContext(Rh);return{componentDisabled:i,componentSize:e}}function Pmt(i,e){const t=i||{},n=t.inherit===!1||!e?VO:e;return LC(()=>{if(!i)return e;const o=Object.assign({},n.components);return Object.keys(i.components||{}).forEach(s=>{o[s]=Object.assign(Object.assign({},o[s]),i.components[s])}),Object.assign(Object.assign(Object.assign({},n),t),{token:Object.assign(Object.assign({},n.token),t.token),components:o})},[t,n],(o,s)=>o.some((a,l)=>{const c=s[l];return!Pp(a,c,!0)}))}const Omt=(i,e)=>{const[t,n]=DC();return Oj({theme:t,token:n,hashId:"",path:["ant-design-icons",i],nonce:()=>e==null?void 0:e.nonce},()=>[{[`.${i}`]:Object.assign(Object.assign({},xT()),{[`.${i} .${i}-icon`]:{display:"block"}})}])},Fmt=Omt;var Bmt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{let{prefixCls:e,iconPrefixCls:t,theme:n}=i;e!==void 0&&(zO=e),t!==void 0&&(sSe=t),n&&Nmt(YM(),n)},FZ=()=>({getPrefixCls:(i,e)=>e||(i?`${YM()}-${i}`:YM()),getIconPrefixCls:Hmt,getRootPrefixCls:()=>zO||YM()}),zmt=i=>{const{children:e,csp:t,autoInsertSpaceInButton:n,form:r,locale:o,componentSize:s,direction:a,space:l,virtual:c,dropdownMatchSelectWidth:u,legacyLocale:d,parentContext:h,iconPrefixCls:f,theme:g,componentDisabled:p}=i,v=C.useCallback((R,F)=>{const{prefixCls:W}=i;if(F)return F;const H=W||h.getPrefixCls("");return R?`${H}-${R}`:H},[h.getPrefixCls,i.prefixCls]),m=f||h.iconPrefixCls||OZ,_=m!==h.iconPrefixCls,y=t||h.csp,S=Fmt(m,y),L=Pmt(g,h.theme),E={csp:y,autoInsertSpaceInButton:n,locale:o||d,direction:a,space:l,virtual:c,dropdownMatchSelectWidth:u,getPrefixCls:v,iconPrefixCls:m,theme:L},D=Object.assign({},h);Object.keys(E).forEach(R=>{E[R]!==void 0&&(D[R]=E[R])}),Wmt.forEach(R=>{const F=i[R];F&&(D[R]=F)});const k=LC(()=>D,D,(R,F)=>{const W=Object.keys(R),H=Object.keys(F);return W.length!==H.length||W.some(G=>R[G]!==F[G])}),T=C.useMemo(()=>({prefixCls:m,csp:y}),[m,y]);let M=_?S(e):e;const A=C.useMemo(()=>{var R,F,W;return KE({},((R=tC.Form)===null||R===void 0?void 0:R.defaultValidateMessages)||{},((W=(F=k.locale)===null||F===void 0?void 0:F.Form)===null||W===void 0?void 0:W.defaultValidateMessages)||{},(r==null?void 0:r.validateMessages)||{})},[k,r==null?void 0:r.validateMessages]);Object.keys(A).length>0&&(M=C.createElement(Zwe,{validateMessages:A},e)),o&&(M=C.createElement(smt,{locale:o,_ANT_MARK__:rmt},M)),(m||y)&&(M=C.createElement(SZ.Provider,{value:T},M)),s&&(M=C.createElement(Mmt,{size:s},M));const N=C.useMemo(()=>{const R=L||{},{algorithm:F,token:W}=R,H=Bmt(R,["algorithm","token"]),G=F&&(!Array.isArray(F)||F.length>0)?Hwe(F):void 0;return Object.assign(Object.assign({},H),{theme:G,token:Object.assign(Object.assign({},k5),W)})},[L]);return g&&(M=C.createElement(oSe.Provider,{value:N},M)),p!==void 0&&(M=C.createElement(Rmt,{disabled:p},M)),C.createElement(Rn.Provider,{value:k},M)},ZS=i=>{const e=C.useContext(Rn),t=C.useContext(AZ);return C.createElement(zmt,Object.assign({parentContext:e,legacyLocale:t},i))};ZS.ConfigContext=Rn;ZS.SizeContext=Rh;ZS.config=Vmt;ZS.useConfig=Amt;Object.defineProperty(ZS,"SizeContext",{get:()=>Rh});const LT=ZS;var aSe=function(e){return+setTimeout(e,16)},lSe=function(e){return clearTimeout(e)};typeof window<"u"&&"requestAnimationFrame"in window&&(aSe=function(e){return window.requestAnimationFrame(e)},lSe=function(e){return window.cancelAnimationFrame(e)});var Ece=0,BZ=new Map;function cSe(i){BZ.delete(i)}var Zi=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Ece+=1;var n=Ece;function r(o){if(o===0)cSe(n),e();else{var s=aSe(function(){r(o-1)});BZ.set(n,s)}}return r(t),n};Zi.cancel=function(i){var e=BZ.get(i);return cSe(e),lSe(e)};function lp(i,e,t,n){var r=_w.unstable_batchedUpdates?function(s){_w.unstable_batchedUpdates(t,s)}:t;return i.addEventListener&&i.addEventListener(e,r,n),{remove:function(){i.removeEventListener&&i.removeEventListener(e,r,n)}}}var Umt=C.createContext({}),jmt=function(i){kh(t,i);var e=Th(t);function t(){return vs(this,t),e.apply(this,arguments)}return _s(t,[{key:"render",value:function(){return this.props.children}}]),t}(C.Component);function Mv(i){var e=C.useRef(!1),t=C.useState(i),n=Ae(t,2),r=n[0],o=n[1];C.useEffect(function(){return e.current=!1,function(){e.current=!0}},[]);function s(a,l){l&&e.current||o(a)}return[r,s]}var O1="none",D2="appear",I2="enter",k2="leave",Dce="none",lf="prepare",wy="start",Sy="active",WZ="end",uSe="prepared";function Ice(i,e){var t={};return t[i.toLowerCase()]=e.toLowerCase(),t["Webkit".concat(i)]="webkit".concat(e),t["Moz".concat(i)]="moz".concat(e),t["ms".concat(i)]="MS".concat(e),t["O".concat(i)]="o".concat(e.toLowerCase()),t}function Kmt(i,e){var t={animationend:Ice("Animation","AnimationEnd"),transitionend:Ice("Transition","TransitionEnd")};return i&&("AnimationEvent"in e||delete t.animationend.animation,"TransitionEvent"in e||delete t.transitionend.transition),t}var Gmt=Kmt(Zs(),typeof window<"u"?window:{}),dSe={};if(Zs()){var qmt=document.createElement("div");dSe=qmt.style}var T2={};function hSe(i){if(T2[i])return T2[i];var e=Gmt[i];if(e)for(var t=Object.keys(e),n=t.length,r=0;r1&&arguments[1]!==void 0?arguments[1]:2;e();var o=Zi(function(){r<=1?n({isCanceled:function(){return o!==i.current}}):t(n,r-1)});i.current=o}return C.useEffect(function(){return function(){e()}},[]),[t,e]};var Zmt=[lf,wy,Sy,WZ],Qmt=[lf,uSe],vSe=!1,Jmt=!0;function _Se(i){return i===Sy||i===WZ}const evt=function(i,e,t){var n=Mv(Dce),r=Ae(n,2),o=r[0],s=r[1],a=Ymt(),l=Ae(a,2),c=l[0],u=l[1];function d(){s(lf,!0)}var h=e?Qmt:Zmt;return mSe(function(){if(o!==Dce&&o!==WZ){var f=h.indexOf(o),g=h[f+1],p=t(o);p===vSe?s(g,!0):g&&c(function(v){function m(){v.isCanceled()||s(g,!0)}p===!0?m():Promise.resolve(p).then(m)})}},[i,o]),C.useEffect(function(){return function(){u()}},[]),[d,o]};function tvt(i,e,t,n){var r=n.motionEnter,o=r===void 0?!0:r,s=n.motionAppear,a=s===void 0?!0:s,l=n.motionLeave,c=l===void 0?!0:l,u=n.motionDeadline,d=n.motionLeaveImmediately,h=n.onAppearPrepare,f=n.onEnterPrepare,g=n.onLeavePrepare,p=n.onAppearStart,v=n.onEnterStart,m=n.onLeaveStart,_=n.onAppearActive,y=n.onEnterActive,S=n.onLeaveActive,L=n.onAppearEnd,E=n.onEnterEnd,D=n.onLeaveEnd,k=n.onVisibleChanged,T=Mv(),M=Ae(T,2),A=M[0],N=M[1],R=Mv(O1),F=Ae(R,2),W=F[0],H=F[1],G=Mv(null),U=Ae(G,2),K=U[0],re=U[1],Y=C.useRef(!1),J=C.useRef(null);function Q(){return t()}var ue=C.useRef(!1);function de(){H(O1,!0),re(null,!0)}function _e(Re){var ct=Q();if(!(Re&&!Re.deadline&&Re.target!==ct)){var ie=ue.current,le;W===D2&&ie?le=L==null?void 0:L(ct,Re):W===I2&&ie?le=E==null?void 0:E(ct,Re):W===k2&&ie&&(le=D==null?void 0:D(ct,Re)),W!==O1&&ie&&le!==!1&&de()}}var ve=Xmt(_e),Ve=Ae(ve,1),Ze=Ve[0],We=C.useMemo(function(){var Re,ct,ie;switch(W){case D2:return Re={},be(Re,lf,h),be(Re,wy,p),be(Re,Sy,_),Re;case I2:return ct={},be(ct,lf,f),be(ct,wy,v),be(ct,Sy,y),ct;case k2:return ie={},be(ie,lf,g),be(ie,wy,m),be(ie,Sy,S),ie;default:return{}}},[W]),pe=evt(W,!i,function(Re){if(Re===lf){var ct=We[lf];return ct?ct(Q()):vSe}if(Ne in We){var ie;re(((ie=We[Ne])===null||ie===void 0?void 0:ie.call(We,Q(),null))||null)}return Ne===Sy&&(Ze(Q()),u>0&&(clearTimeout(J.current),J.current=setTimeout(function(){_e({deadline:!0})},u))),Ne===uSe&&de(),Jmt}),Pe=Ae(pe,2),Se=Pe[0],Ne=Pe[1],Me=_Se(Ne);ue.current=Me,mSe(function(){N(e);var Re=Y.current;Y.current=!0;var ct;!Re&&e&&a&&(ct=D2),Re&&e&&o&&(ct=I2),(Re&&!e&&c||!Re&&d&&!e&&c)&&(ct=k2),ct&&(H(ct),Se())},[e]),C.useEffect(function(){(W===D2&&!a||W===I2&&!o||W===k2&&!c)&&H(O1)},[a,o,c]),C.useEffect(function(){return function(){Y.current=!1,clearTimeout(J.current)}},[]);var Qe=C.useRef(!1);C.useEffect(function(){A&&(Qe.current=!0),A!==void 0&&W===O1&&((Qe.current||A)&&(k==null||k(A)),Qe.current=!0)},[A,W]);var Ke=K;return We[lf]&&Ne===wy&&(Ke=te({transition:"none"},Ke)),[W,Ne,Ke,A??e]}function nvt(i){var e=i;zn(i)==="object"&&(e=i.transitionSupport);function t(r,o){return!!(r.motionName&&e&&o!==!1)}var n=C.forwardRef(function(r,o){var s=r.visible,a=s===void 0?!0:s,l=r.removeOnLeave,c=l===void 0?!0:l,u=r.forceRender,d=r.children,h=r.motionName,f=r.leavedClassName,g=r.eventProps,p=C.useContext(Umt),v=p.motion,m=t(r,v),_=C.useRef(),y=C.useRef();function S(){try{return _.current instanceof HTMLElement?_.current:nk(y.current)}catch{return null}}var L=tvt(m,a,S,r),E=Ae(L,4),D=E[0],k=E[1],T=E[2],M=E[3],A=C.useRef(M);M&&(A.current=!0);var N=C.useCallback(function(K){_.current=K,tk(o,K)},[o]),R,F=te(te({},g),{},{visible:a});if(!d)R=null;else if(D===O1)M?R=d(te({},F),N):!c&&A.current&&f?R=d(te(te({},F),{},{className:f}),N):u||!c&&!f?R=d(te(te({},F),{},{style:{display:"none"}}),N):R=null;else{var W,H;k===lf?H="prepare":_Se(k)?H="active":k===wy&&(H="start"),R=d(te(te({},F),{},{className:xe(Nce(h,D),(W={},be(W,Nce(h,"".concat(D,"-").concat(H)),H),be(W,h,typeof h=="string"),W)),style:T}),N)}if(C.isValidElement(R)&&$_(R)){var G=R,U=G.ref;U||(R=C.cloneElement(R,{ref:N}))}return C.createElement(jmt,{ref:y},R)});return n.displayName="CSSMotion",n}const fd=nvt(pSe);var Zj="add",Qj="keep",Jj="remove",u7="removed";function ivt(i){var e;return i&&zn(i)==="object"&&"key"in i?e=i:e={key:i},te(te({},e),{},{key:String(e.key)})}function eK(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return i.map(ivt)}function rvt(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=[],n=0,r=e.length,o=eK(i),s=eK(e);o.forEach(function(c){for(var u=!1,d=n;d1});return l.forEach(function(c){t=t.filter(function(u){var d=u.key,h=u.status;return d!==c||h!==Jj}),t.forEach(function(u){u.key===c&&(u.status=Qj)})}),t}var ovt=["component","children","onVisibleChanged","onAllRemoved"],svt=["status"],avt=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function lvt(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:fd,t=function(n){kh(o,n);var r=Th(o);function o(){var s;vs(this,o);for(var a=arguments.length,l=new Array(a),c=0;c((t.startsWith("data-")||t.startsWith("aria-")||t==="role")&&!t.startsWith("data-__")&&(e[t]=i[t]),e),{})}const{isValidElement:bh}=she;function bSe(i){return i&&bh(i)&&i.type===C.Fragment}function dvt(i,e,t){return bh(i)?C.cloneElement(i,typeof t=="function"?t(i.props||{}):t):e}function Qs(i,e){return dvt(i,i,e)}function tc(i){var e=C.useRef();e.current=i;var t=C.useCallback(function(){for(var n,r=arguments.length,o=new Array(r),s=0;s"u")return 0;const r=e?"scrollTop":"scrollLeft";let o=0;return tK(i)?o=i[e?"pageYOffset":"pageXOffset"]:i instanceof Document?o=i.documentElement[r]:(i instanceof HTMLElement||i)&&(o=i[r]),i&&!tK(i)&&typeof o!="number"&&(o=(n=((t=i.ownerDocument)!==null&&t!==void 0?t:i).documentElement)===null||n===void 0?void 0:n[r]),o}function fvt(i,e,t,n){const r=t-e;return i/=n/2,i<1?r/2*i*i*i+e:r/2*((i-=2)*i*i+2)+e}function gvt(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{getContainer:t=()=>window,callback:n,duration:r=450}=e,o=t(),s=hvt(o,!0),a=Date.now(),l=()=>{const u=Date.now()-a,d=fvt(u>r?r:u,s,i,r);tK(o)?o.scrollTo(window.pageXOffset,d):o instanceof Document||o.constructor.name==="HTMLDocument"?o.documentElement.scrollTop=d:o.scrollTop=d,u=vt.F1&&t<=vt.F12)return!1;switch(t){case vt.ALT:case vt.CAPS_LOCK:case vt.CONTEXT_MENU:case vt.CTRL:case vt.DOWN:case vt.END:case vt.ESC:case vt.HOME:case vt.INSERT:case vt.LEFT:case vt.MAC_FF_META:case vt.META:case vt.NUMLOCK:case vt.NUM_CENTER:case vt.PAGE_DOWN:case vt.PAGE_UP:case vt.PAUSE:case vt.PRINT_SCREEN:case vt.RIGHT:case vt.SHIFT:case vt.UP:case vt.WIN_KEY:case vt.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=vt.ZERO&&e<=vt.NINE||e>=vt.NUM_ZERO&&e<=vt.NUM_MULTIPLY||e>=vt.A&&e<=vt.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&e===0)return!0;switch(e){case vt.SPACE:case vt.QUESTION_MARK:case vt.NUM_PLUS:case vt.NUM_MINUS:case vt.NUM_PERIOD:case vt.NUM_DIVISION:case vt.SEMICOLON:case vt.DASH:case vt.EQUALS:case vt.COMMA:case vt.PERIOD:case vt.SLASH:case vt.APOSTROPHE:case vt.SINGLE_QUOTE:case vt.OPEN_SQUARE_BRACKET:case vt.BACKSLASH:case vt.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},pvt=C.forwardRef(function(i,e){var t=i.prefixCls,n=i.style,r=i.className,o=i.duration,s=o===void 0?4.5:o,a=i.eventKey,l=i.content,c=i.closable,u=i.closeIcon,d=u===void 0?"x":u,h=i.props,f=i.onClick,g=i.onNoticeClose,p=i.times,v=C.useState(!1),m=Ae(v,2),_=m[0],y=m[1],S=function(){g(a)},L=function(k){(k.key==="Enter"||k.code==="Enter"||k.keyCode===vt.ENTER)&&S()};C.useEffect(function(){if(!_&&s>0){var D=setTimeout(function(){S()},s*1e3);return function(){clearTimeout(D)}}},[s,_,p]);var E="".concat(t,"-notice");return C.createElement("div",St({},h,{ref:e,className:xe(E,r,be({},"".concat(E,"-closable"),c)),style:n,onMouseEnter:function(){y(!0)},onMouseLeave:function(){y(!1)},onClick:f}),C.createElement("div",{className:"".concat(E,"-content")},l),c&&C.createElement("a",{tabIndex:0,className:"".concat(E,"-close"),onKeyDown:L,onClick:function(k){k.preventDefault(),k.stopPropagation(),S()}},d))});const CSe=pvt;var mvt=C.forwardRef(function(i,e){var t=i.prefixCls,n=t===void 0?"rc-notification":t,r=i.container,o=i.motion,s=i.maxCount,a=i.className,l=i.style,c=i.onAllRemoved,u=C.useState([]),d=Ae(u,2),h=d[0],f=d[1],g=function(D){var k,T=h.find(function(M){return M.key===D});T==null||(k=T.onClose)===null||k===void 0||k.call(T),f(function(M){return M.filter(function(A){return A.key!==D})})};C.useImperativeHandle(e,function(){return{open:function(D){f(function(k){var T=ft(k),M=T.findIndex(function(R){return R.key===D.key}),A=te({},D);if(M>=0){var N;A.times=(((N=k[M])===null||N===void 0?void 0:N.times)||0)+1,T[M]=A}else A.times=0,T.push(A);return s>0&&T.length>s&&(T=T.slice(-s)),T})},close:function(D){g(D)},destroy:function(){f([])}}});var p=C.useState({}),v=Ae(p,2),m=v[0],_=v[1];C.useEffect(function(){var E={};h.forEach(function(D){var k=D.placement,T=k===void 0?"topRight":k;T&&(E[T]=E[T]||[],E[T].push(D))}),Object.keys(m).forEach(function(D){E[D]=E[D]||[]}),_(E)},[h]);var y=function(D){_(function(k){var T=te({},k),M=T[D]||[];return M.length||delete T[D],T})},S=C.useRef(!1);if(C.useEffect(function(){Object.keys(m).length>0?S.current=!0:S.current&&(c==null||c(),S.current=!1)},[m]),!r)return null;var L=Object.keys(m);return sh.createPortal(C.createElement(C.Fragment,null,L.map(function(E){var D=m[E],k=D.map(function(M){return{config:M,key:M.key}}),T=typeof o=="function"?o(E):o;return C.createElement(cvt,St({key:E,className:xe(n,"".concat(n,"-").concat(E),a==null?void 0:a(E)),style:l==null?void 0:l(E),keys:k,motionAppear:!0},T,{onAllRemoved:function(){y(E)}}),function(M,A){var N=M.config,R=M.className,F=M.style,W=N.key,H=N.times,G=N.className,U=N.style;return C.createElement(CSe,St({},N,{ref:A,prefixCls:n,className:xe(R,G),style:te(te({},F),U),times:H,key:W,eventKey:W,onNoticeClose:g}))})})),r)}),vvt=["getContainer","motion","prefixCls","maxCount","className","style","onAllRemoved"],_vt=function(){return document.body},Rce=0;function bvt(){for(var i={},e=arguments.length,t=new Array(e),n=0;n0&&arguments[0]!==void 0?arguments[0]:{},e=i.getContainer,t=e===void 0?_vt:e,n=i.motion,r=i.prefixCls,o=i.maxCount,s=i.className,a=i.style,l=i.onAllRemoved,c=Nn(i,vvt),u=C.useState(),d=Ae(u,2),h=d[0],f=d[1],g=C.useRef(),p=C.createElement(mvt,{container:h,ref:g,prefixCls:r,motion:n,maxCount:o,className:s,style:a,onAllRemoved:l}),v=C.useState([]),m=Ae(v,2),_=m[0],y=m[1],S=C.useMemo(function(){return{open:function(E){var D=bvt(c,E);(D.key===null||D.key===void 0)&&(D.key="rc-notification-".concat(Rce),Rce+=1),y(function(k){return[].concat(ft(k),[{type:"open",config:D}])})},close:function(E){y(function(D){return[].concat(ft(D),[{type:"close",key:E}])})},destroy:function(){y(function(E){return[].concat(ft(E),[{type:"destroy"}])})}}},[]);return C.useEffect(function(){f(t())}),C.useEffect(function(){g.current&&_.length&&(_.forEach(function(L){switch(L.type){case"open":g.current.open(L.config);break;case"close":g.current.close(L.key);break;case"destroy":g.current.destroy();break}}),y([]))},[_]),[S,p]}const yvt=i=>{const{componentCls:e,iconCls:t,boxShadow:n,colorText:r,colorBgElevated:o,colorSuccess:s,colorError:a,colorWarning:l,colorInfo:c,fontSizeLG:u,motionEaseInOutCirc:d,motionDurationSlow:h,marginXS:f,paddingXS:g,borderRadiusLG:p,zIndexPopup:v,messageNoticeContentPadding:m}=i,_=new mi("MessageMoveIn",{"0%":{padding:0,transform:"translateY(-100%)",opacity:0},"100%":{padding:g,transform:"translateY(0)",opacity:1}}),y=new mi("MessageMoveOut",{"0%":{maxHeight:i.height,padding:g,opacity:1},"100%":{maxHeight:0,padding:0,opacity:0}});return[{[e]:Object.assign(Object.assign({},Wr(i)),{color:r,position:"fixed",top:f,width:"100%",pointerEvents:"none",zIndex:v,[`${e}-move-up`]:{animationFillMode:"forwards"},[` + `.trim()}function Nmt(i,e){const t=Tmt(i,e);Zs()&&uS(t,`${kmt}-dynamic-theme`)}const Xj=C.createContext(!1),Rmt=i=>{let{children:e,disabled:t}=i;const n=C.useContext(Xj);return C.createElement(Xj.Provider,{value:t??n},e)},$_=Xj,Yj=C.createContext(void 0),Mmt=i=>{let{children:e,size:t}=i;const n=C.useContext(Yj);return C.createElement(Yj.Provider,{value:t||n},e)},Rh=Yj;function Amt(){const i=C.useContext($_),e=C.useContext(Rh);return{componentDisabled:i,componentSize:e}}function Pmt(i,e){const t=i||{},n=t.inherit===!1||!e?VO:e;return LC(()=>{if(!i)return e;const o=Object.assign({},n.components);return Object.keys(i.components||{}).forEach(s=>{o[s]=Object.assign(Object.assign({},o[s]),i.components[s])}),Object.assign(Object.assign(Object.assign({},n),t),{token:Object.assign(Object.assign({},n.token),t.token),components:o})},[t,n],(o,s)=>o.some((a,l)=>{const c=s[l];return!Op(a,c,!0)}))}const Omt=(i,e)=>{const[t,n]=DC();return Oj({theme:t,token:n,hashId:"",path:["ant-design-icons",i],nonce:()=>e==null?void 0:e.nonce},()=>[{[`.${i}`]:Object.assign(Object.assign({},xT()),{[`.${i} .${i}-icon`]:{display:"block"}})}])},Fmt=Omt;var Bmt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{let{prefixCls:e,iconPrefixCls:t,theme:n}=i;e!==void 0&&(zO=e),t!==void 0&&(sSe=t),n&&Nmt(YM(),n)},FZ=()=>({getPrefixCls:(i,e)=>e||(i?`${YM()}-${i}`:YM()),getIconPrefixCls:Hmt,getRootPrefixCls:()=>zO||YM()}),zmt=i=>{const{children:e,csp:t,autoInsertSpaceInButton:n,form:r,locale:o,componentSize:s,direction:a,space:l,virtual:c,dropdownMatchSelectWidth:u,legacyLocale:d,parentContext:h,iconPrefixCls:f,theme:g,componentDisabled:p}=i,v=C.useCallback((R,F)=>{const{prefixCls:W}=i;if(F)return F;const H=W||h.getPrefixCls("");return R?`${H}-${R}`:H},[h.getPrefixCls,i.prefixCls]),m=f||h.iconPrefixCls||OZ,_=m!==h.iconPrefixCls,y=t||h.csp,S=Fmt(m,y),L=Pmt(g,h.theme),E={csp:y,autoInsertSpaceInButton:n,locale:o||d,direction:a,space:l,virtual:c,dropdownMatchSelectWidth:u,getPrefixCls:v,iconPrefixCls:m,theme:L},D=Object.assign({},h);Object.keys(E).forEach(R=>{E[R]!==void 0&&(D[R]=E[R])}),Wmt.forEach(R=>{const F=i[R];F&&(D[R]=F)});const k=LC(()=>D,D,(R,F)=>{const W=Object.keys(R),H=Object.keys(F);return W.length!==H.length||W.some(G=>R[G]!==F[G])}),T=C.useMemo(()=>({prefixCls:m,csp:y}),[m,y]);let M=_?S(e):e;const A=C.useMemo(()=>{var R,F,W;return KE({},((R=tC.Form)===null||R===void 0?void 0:R.defaultValidateMessages)||{},((W=(F=k.locale)===null||F===void 0?void 0:F.Form)===null||W===void 0?void 0:W.defaultValidateMessages)||{},(r==null?void 0:r.validateMessages)||{})},[k,r==null?void 0:r.validateMessages]);Object.keys(A).length>0&&(M=C.createElement(Zwe,{validateMessages:A},e)),o&&(M=C.createElement(smt,{locale:o,_ANT_MARK__:rmt},M)),(m||y)&&(M=C.createElement(SZ.Provider,{value:T},M)),s&&(M=C.createElement(Mmt,{size:s},M));const N=C.useMemo(()=>{const R=L||{},{algorithm:F,token:W}=R,H=Bmt(R,["algorithm","token"]),G=F&&(!Array.isArray(F)||F.length>0)?Hwe(F):void 0;return Object.assign(Object.assign({},H),{theme:G,token:Object.assign(Object.assign({},k5),W)})},[L]);return g&&(M=C.createElement(oSe.Provider,{value:N},M)),p!==void 0&&(M=C.createElement(Rmt,{disabled:p},M)),C.createElement(Rn.Provider,{value:k},M)},ZS=i=>{const e=C.useContext(Rn),t=C.useContext(AZ);return C.createElement(zmt,Object.assign({parentContext:e,legacyLocale:t},i))};ZS.ConfigContext=Rn;ZS.SizeContext=Rh;ZS.config=Vmt;ZS.useConfig=Amt;Object.defineProperty(ZS,"SizeContext",{get:()=>Rh});const LT=ZS;var aSe=function(e){return+setTimeout(e,16)},lSe=function(e){return clearTimeout(e)};typeof window<"u"&&"requestAnimationFrame"in window&&(aSe=function(e){return window.requestAnimationFrame(e)},lSe=function(e){return window.cancelAnimationFrame(e)});var Ece=0,BZ=new Map;function cSe(i){BZ.delete(i)}var Zi=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Ece+=1;var n=Ece;function r(o){if(o===0)cSe(n),e();else{var s=aSe(function(){r(o-1)});BZ.set(n,s)}}return r(t),n};Zi.cancel=function(i){var e=BZ.get(i);return cSe(e),lSe(e)};function lp(i,e,t,n){var r=_w.unstable_batchedUpdates?function(s){_w.unstable_batchedUpdates(t,s)}:t;return i.addEventListener&&i.addEventListener(e,r,n),{remove:function(){i.removeEventListener&&i.removeEventListener(e,r,n)}}}var Umt=C.createContext({}),jmt=function(i){kh(t,i);var e=Th(t);function t(){return vs(this,t),e.apply(this,arguments)}return _s(t,[{key:"render",value:function(){return this.props.children}}]),t}(C.Component);function Av(i){var e=C.useRef(!1),t=C.useState(i),n=Ae(t,2),r=n[0],o=n[1];C.useEffect(function(){return e.current=!1,function(){e.current=!0}},[]);function s(a,l){l&&e.current||o(a)}return[r,s]}var O1="none",D2="appear",I2="enter",k2="leave",Dce="none",lf="prepare",wy="start",Sy="active",WZ="end",uSe="prepared";function Ice(i,e){var t={};return t[i.toLowerCase()]=e.toLowerCase(),t["Webkit".concat(i)]="webkit".concat(e),t["Moz".concat(i)]="moz".concat(e),t["ms".concat(i)]="MS".concat(e),t["O".concat(i)]="o".concat(e.toLowerCase()),t}function Kmt(i,e){var t={animationend:Ice("Animation","AnimationEnd"),transitionend:Ice("Transition","TransitionEnd")};return i&&("AnimationEvent"in e||delete t.animationend.animation,"TransitionEvent"in e||delete t.transitionend.transition),t}var Gmt=Kmt(Zs(),typeof window<"u"?window:{}),dSe={};if(Zs()){var qmt=document.createElement("div");dSe=qmt.style}var T2={};function hSe(i){if(T2[i])return T2[i];var e=Gmt[i];if(e)for(var t=Object.keys(e),n=t.length,r=0;r1&&arguments[1]!==void 0?arguments[1]:2;e();var o=Zi(function(){r<=1?n({isCanceled:function(){return o!==i.current}}):t(n,r-1)});i.current=o}return C.useEffect(function(){return function(){e()}},[]),[t,e]};var Zmt=[lf,wy,Sy,WZ],Qmt=[lf,uSe],vSe=!1,Jmt=!0;function _Se(i){return i===Sy||i===WZ}const evt=function(i,e,t){var n=Av(Dce),r=Ae(n,2),o=r[0],s=r[1],a=Ymt(),l=Ae(a,2),c=l[0],u=l[1];function d(){s(lf,!0)}var h=e?Qmt:Zmt;return mSe(function(){if(o!==Dce&&o!==WZ){var f=h.indexOf(o),g=h[f+1],p=t(o);p===vSe?s(g,!0):g&&c(function(v){function m(){v.isCanceled()||s(g,!0)}p===!0?m():Promise.resolve(p).then(m)})}},[i,o]),C.useEffect(function(){return function(){u()}},[]),[d,o]};function tvt(i,e,t,n){var r=n.motionEnter,o=r===void 0?!0:r,s=n.motionAppear,a=s===void 0?!0:s,l=n.motionLeave,c=l===void 0?!0:l,u=n.motionDeadline,d=n.motionLeaveImmediately,h=n.onAppearPrepare,f=n.onEnterPrepare,g=n.onLeavePrepare,p=n.onAppearStart,v=n.onEnterStart,m=n.onLeaveStart,_=n.onAppearActive,y=n.onEnterActive,S=n.onLeaveActive,L=n.onAppearEnd,E=n.onEnterEnd,D=n.onLeaveEnd,k=n.onVisibleChanged,T=Av(),M=Ae(T,2),A=M[0],N=M[1],R=Av(O1),F=Ae(R,2),W=F[0],H=F[1],G=Av(null),U=Ae(G,2),K=U[0],re=U[1],Y=C.useRef(!1),J=C.useRef(null);function Q(){return t()}var ue=C.useRef(!1);function de(){H(O1,!0),re(null,!0)}function _e(Re){var ct=Q();if(!(Re&&!Re.deadline&&Re.target!==ct)){var ie=ue.current,le;W===D2&&ie?le=L==null?void 0:L(ct,Re):W===I2&&ie?le=E==null?void 0:E(ct,Re):W===k2&&ie&&(le=D==null?void 0:D(ct,Re)),W!==O1&&ie&&le!==!1&&de()}}var ve=Xmt(_e),Ve=Ae(ve,1),Ze=Ve[0],We=C.useMemo(function(){var Re,ct,ie;switch(W){case D2:return Re={},be(Re,lf,h),be(Re,wy,p),be(Re,Sy,_),Re;case I2:return ct={},be(ct,lf,f),be(ct,wy,v),be(ct,Sy,y),ct;case k2:return ie={},be(ie,lf,g),be(ie,wy,m),be(ie,Sy,S),ie;default:return{}}},[W]),pe=evt(W,!i,function(Re){if(Re===lf){var ct=We[lf];return ct?ct(Q()):vSe}if(Ne in We){var ie;re(((ie=We[Ne])===null||ie===void 0?void 0:ie.call(We,Q(),null))||null)}return Ne===Sy&&(Ze(Q()),u>0&&(clearTimeout(J.current),J.current=setTimeout(function(){_e({deadline:!0})},u))),Ne===uSe&&de(),Jmt}),Pe=Ae(pe,2),Se=Pe[0],Ne=Pe[1],Me=_Se(Ne);ue.current=Me,mSe(function(){N(e);var Re=Y.current;Y.current=!0;var ct;!Re&&e&&a&&(ct=D2),Re&&e&&o&&(ct=I2),(Re&&!e&&c||!Re&&d&&!e&&c)&&(ct=k2),ct&&(H(ct),Se())},[e]),C.useEffect(function(){(W===D2&&!a||W===I2&&!o||W===k2&&!c)&&H(O1)},[a,o,c]),C.useEffect(function(){return function(){Y.current=!1,clearTimeout(J.current)}},[]);var Qe=C.useRef(!1);C.useEffect(function(){A&&(Qe.current=!0),A!==void 0&&W===O1&&((Qe.current||A)&&(k==null||k(A)),Qe.current=!0)},[A,W]);var Ke=K;return We[lf]&&Ne===wy&&(Ke=te({transition:"none"},Ke)),[W,Ne,Ke,A??e]}function nvt(i){var e=i;zn(i)==="object"&&(e=i.transitionSupport);function t(r,o){return!!(r.motionName&&e&&o!==!1)}var n=C.forwardRef(function(r,o){var s=r.visible,a=s===void 0?!0:s,l=r.removeOnLeave,c=l===void 0?!0:l,u=r.forceRender,d=r.children,h=r.motionName,f=r.leavedClassName,g=r.eventProps,p=C.useContext(Umt),v=p.motion,m=t(r,v),_=C.useRef(),y=C.useRef();function S(){try{return _.current instanceof HTMLElement?_.current:nk(y.current)}catch{return null}}var L=tvt(m,a,S,r),E=Ae(L,4),D=E[0],k=E[1],T=E[2],M=E[3],A=C.useRef(M);M&&(A.current=!0);var N=C.useCallback(function(K){_.current=K,tk(o,K)},[o]),R,F=te(te({},g),{},{visible:a});if(!d)R=null;else if(D===O1)M?R=d(te({},F),N):!c&&A.current&&f?R=d(te(te({},F),{},{className:f}),N):u||!c&&!f?R=d(te(te({},F),{},{style:{display:"none"}}),N):R=null;else{var W,H;k===lf?H="prepare":_Se(k)?H="active":k===wy&&(H="start"),R=d(te(te({},F),{},{className:xe(Nce(h,D),(W={},be(W,Nce(h,"".concat(D,"-").concat(H)),H),be(W,h,typeof h=="string"),W)),style:T}),N)}if(C.isValidElement(R)&&W_(R)){var G=R,U=G.ref;U||(R=C.cloneElement(R,{ref:N}))}return C.createElement(jmt,{ref:y},R)});return n.displayName="CSSMotion",n}const fd=nvt(pSe);var Zj="add",Qj="keep",Jj="remove",u7="removed";function ivt(i){var e;return i&&zn(i)==="object"&&"key"in i?e=i:e={key:i},te(te({},e),{},{key:String(e.key)})}function eK(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return i.map(ivt)}function rvt(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=[],n=0,r=e.length,o=eK(i),s=eK(e);o.forEach(function(c){for(var u=!1,d=n;d1});return l.forEach(function(c){t=t.filter(function(u){var d=u.key,h=u.status;return d!==c||h!==Jj}),t.forEach(function(u){u.key===c&&(u.status=Qj)})}),t}var ovt=["component","children","onVisibleChanged","onAllRemoved"],svt=["status"],avt=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function lvt(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:fd,t=function(n){kh(o,n);var r=Th(o);function o(){var s;vs(this,o);for(var a=arguments.length,l=new Array(a),c=0;c((t.startsWith("data-")||t.startsWith("aria-")||t==="role")&&!t.startsWith("data-__")&&(e[t]=i[t]),e),{})}const{isValidElement:bh}=she;function bSe(i){return i&&bh(i)&&i.type===C.Fragment}function dvt(i,e,t){return bh(i)?C.cloneElement(i,typeof t=="function"?t(i.props||{}):t):e}function Qs(i,e){return dvt(i,i,e)}function tc(i){var e=C.useRef();e.current=i;var t=C.useCallback(function(){for(var n,r=arguments.length,o=new Array(r),s=0;s"u")return 0;const r=e?"scrollTop":"scrollLeft";let o=0;return tK(i)?o=i[e?"pageYOffset":"pageXOffset"]:i instanceof Document?o=i.documentElement[r]:(i instanceof HTMLElement||i)&&(o=i[r]),i&&!tK(i)&&typeof o!="number"&&(o=(n=((t=i.ownerDocument)!==null&&t!==void 0?t:i).documentElement)===null||n===void 0?void 0:n[r]),o}function fvt(i,e,t,n){const r=t-e;return i/=n/2,i<1?r/2*i*i*i+e:r/2*((i-=2)*i*i+2)+e}function gvt(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{getContainer:t=()=>window,callback:n,duration:r=450}=e,o=t(),s=hvt(o,!0),a=Date.now(),l=()=>{const u=Date.now()-a,d=fvt(u>r?r:u,s,i,r);tK(o)?o.scrollTo(window.pageXOffset,d):o instanceof Document||o.constructor.name==="HTMLDocument"?o.documentElement.scrollTop=d:o.scrollTop=d,u=vt.F1&&t<=vt.F12)return!1;switch(t){case vt.ALT:case vt.CAPS_LOCK:case vt.CONTEXT_MENU:case vt.CTRL:case vt.DOWN:case vt.END:case vt.ESC:case vt.HOME:case vt.INSERT:case vt.LEFT:case vt.MAC_FF_META:case vt.META:case vt.NUMLOCK:case vt.NUM_CENTER:case vt.PAGE_DOWN:case vt.PAGE_UP:case vt.PAUSE:case vt.PRINT_SCREEN:case vt.RIGHT:case vt.SHIFT:case vt.UP:case vt.WIN_KEY:case vt.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=vt.ZERO&&e<=vt.NINE||e>=vt.NUM_ZERO&&e<=vt.NUM_MULTIPLY||e>=vt.A&&e<=vt.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&e===0)return!0;switch(e){case vt.SPACE:case vt.QUESTION_MARK:case vt.NUM_PLUS:case vt.NUM_MINUS:case vt.NUM_PERIOD:case vt.NUM_DIVISION:case vt.SEMICOLON:case vt.DASH:case vt.EQUALS:case vt.COMMA:case vt.PERIOD:case vt.SLASH:case vt.APOSTROPHE:case vt.SINGLE_QUOTE:case vt.OPEN_SQUARE_BRACKET:case vt.BACKSLASH:case vt.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},pvt=C.forwardRef(function(i,e){var t=i.prefixCls,n=i.style,r=i.className,o=i.duration,s=o===void 0?4.5:o,a=i.eventKey,l=i.content,c=i.closable,u=i.closeIcon,d=u===void 0?"x":u,h=i.props,f=i.onClick,g=i.onNoticeClose,p=i.times,v=C.useState(!1),m=Ae(v,2),_=m[0],y=m[1],S=function(){g(a)},L=function(k){(k.key==="Enter"||k.code==="Enter"||k.keyCode===vt.ENTER)&&S()};C.useEffect(function(){if(!_&&s>0){var D=setTimeout(function(){S()},s*1e3);return function(){clearTimeout(D)}}},[s,_,p]);var E="".concat(t,"-notice");return C.createElement("div",St({},h,{ref:e,className:xe(E,r,be({},"".concat(E,"-closable"),c)),style:n,onMouseEnter:function(){y(!0)},onMouseLeave:function(){y(!1)},onClick:f}),C.createElement("div",{className:"".concat(E,"-content")},l),c&&C.createElement("a",{tabIndex:0,className:"".concat(E,"-close"),onKeyDown:L,onClick:function(k){k.preventDefault(),k.stopPropagation(),S()}},d))});const CSe=pvt;var mvt=C.forwardRef(function(i,e){var t=i.prefixCls,n=t===void 0?"rc-notification":t,r=i.container,o=i.motion,s=i.maxCount,a=i.className,l=i.style,c=i.onAllRemoved,u=C.useState([]),d=Ae(u,2),h=d[0],f=d[1],g=function(D){var k,T=h.find(function(M){return M.key===D});T==null||(k=T.onClose)===null||k===void 0||k.call(T),f(function(M){return M.filter(function(A){return A.key!==D})})};C.useImperativeHandle(e,function(){return{open:function(D){f(function(k){var T=ft(k),M=T.findIndex(function(R){return R.key===D.key}),A=te({},D);if(M>=0){var N;A.times=(((N=k[M])===null||N===void 0?void 0:N.times)||0)+1,T[M]=A}else A.times=0,T.push(A);return s>0&&T.length>s&&(T=T.slice(-s)),T})},close:function(D){g(D)},destroy:function(){f([])}}});var p=C.useState({}),v=Ae(p,2),m=v[0],_=v[1];C.useEffect(function(){var E={};h.forEach(function(D){var k=D.placement,T=k===void 0?"topRight":k;T&&(E[T]=E[T]||[],E[T].push(D))}),Object.keys(m).forEach(function(D){E[D]=E[D]||[]}),_(E)},[h]);var y=function(D){_(function(k){var T=te({},k),M=T[D]||[];return M.length||delete T[D],T})},S=C.useRef(!1);if(C.useEffect(function(){Object.keys(m).length>0?S.current=!0:S.current&&(c==null||c(),S.current=!1)},[m]),!r)return null;var L=Object.keys(m);return sh.createPortal(C.createElement(C.Fragment,null,L.map(function(E){var D=m[E],k=D.map(function(M){return{config:M,key:M.key}}),T=typeof o=="function"?o(E):o;return C.createElement(cvt,St({key:E,className:xe(n,"".concat(n,"-").concat(E),a==null?void 0:a(E)),style:l==null?void 0:l(E),keys:k,motionAppear:!0},T,{onAllRemoved:function(){y(E)}}),function(M,A){var N=M.config,R=M.className,F=M.style,W=N.key,H=N.times,G=N.className,U=N.style;return C.createElement(CSe,St({},N,{ref:A,prefixCls:n,className:xe(R,G),style:te(te({},F),U),times:H,key:W,eventKey:W,onNoticeClose:g}))})})),r)}),vvt=["getContainer","motion","prefixCls","maxCount","className","style","onAllRemoved"],_vt=function(){return document.body},Rce=0;function bvt(){for(var i={},e=arguments.length,t=new Array(e),n=0;n0&&arguments[0]!==void 0?arguments[0]:{},e=i.getContainer,t=e===void 0?_vt:e,n=i.motion,r=i.prefixCls,o=i.maxCount,s=i.className,a=i.style,l=i.onAllRemoved,c=Nn(i,vvt),u=C.useState(),d=Ae(u,2),h=d[0],f=d[1],g=C.useRef(),p=C.createElement(mvt,{container:h,ref:g,prefixCls:r,motion:n,maxCount:o,className:s,style:a,onAllRemoved:l}),v=C.useState([]),m=Ae(v,2),_=m[0],y=m[1],S=C.useMemo(function(){return{open:function(E){var D=bvt(c,E);(D.key===null||D.key===void 0)&&(D.key="rc-notification-".concat(Rce),Rce+=1),y(function(k){return[].concat(ft(k),[{type:"open",config:D}])})},close:function(E){y(function(D){return[].concat(ft(D),[{type:"close",key:E}])})},destroy:function(){y(function(E){return[].concat(ft(E),[{type:"destroy"}])})}}},[]);return C.useEffect(function(){f(t())}),C.useEffect(function(){g.current&&_.length&&(_.forEach(function(L){switch(L.type){case"open":g.current.open(L.config);break;case"close":g.current.close(L.key);break;case"destroy":g.current.destroy();break}}),y([]))},[_]),[S,p]}const yvt=i=>{const{componentCls:e,iconCls:t,boxShadow:n,colorText:r,colorBgElevated:o,colorSuccess:s,colorError:a,colorWarning:l,colorInfo:c,fontSizeLG:u,motionEaseInOutCirc:d,motionDurationSlow:h,marginXS:f,paddingXS:g,borderRadiusLG:p,zIndexPopup:v,messageNoticeContentPadding:m}=i,_=new mi("MessageMoveIn",{"0%":{padding:0,transform:"translateY(-100%)",opacity:0},"100%":{padding:g,transform:"translateY(0)",opacity:1}}),y=new mi("MessageMoveOut",{"0%":{maxHeight:i.height,padding:g,opacity:1},"100%":{maxHeight:0,padding:0,opacity:0}});return[{[e]:Object.assign(Object.assign({},Wr(i)),{color:r,position:"fixed",top:f,width:"100%",pointerEvents:"none",zIndex:v,[`${e}-move-up`]:{animationFillMode:"forwards"},[` ${e}-move-up-appear, ${e}-move-up-enter `]:{animationName:_,animationDuration:h,animationPlayState:"paused",animationTimingFunction:d},[` @@ -939,13 +939,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho ${e}-move-up-enter${e}-move-up-enter-active `]:{animationPlayState:"running"},[`${e}-move-up-leave`]:{animationName:y,animationDuration:h,animationPlayState:"paused",animationTimingFunction:d},[`${e}-move-up-leave${e}-move-up-leave-active`]:{animationPlayState:"running"},"&-rtl":{direction:"rtl",span:{direction:"rtl"}}})},{[`${e}-notice`]:{padding:g,textAlign:"center",[`${e}-custom-content > ${t}`]:{verticalAlign:"text-bottom",marginInlineEnd:f,fontSize:u},[`${e}-notice-content`]:{display:"inline-block",padding:m,background:o,borderRadius:p,boxShadow:n,pointerEvents:"all"},[`${e}-success > ${t}`]:{color:s},[`${e}-error > ${t}`]:{color:a},[`${e}-warning > ${t}`]:{color:l},[` ${e}-info > ${t}, - ${e}-loading > ${t}`]:{color:c}}},{[`${e}-notice-pure-panel`]:{padding:0,textAlign:"start"}}]},ySe=vo("Message",i=>{const e=Oi(i,{messageNoticeContentPadding:`${(i.controlHeightLG-i.fontSize*i.lineHeight)/2}px ${i.paddingSM}px`});return[yvt(e)]},i=>({height:150,zIndexPopup:i.zIndexPopupBase+10}));function wvt(i,e){return{motionName:e??`${i}-move-up`}}function $Z(i){let e;const t=new Promise(r=>{e=i(()=>{r(!0)})}),n=()=>{e==null||e()};return n.then=(r,o)=>t.then(r,o),n.promise=t,n}var Svt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{top:t,prefixCls:n,getContainer:r,maxCount:o,duration:s=Ivt,rtl:a,transitionName:l,onAllRemoved:c}=i,{getPrefixCls:u,getPopupContainer:d}=C.useContext(Rn),h=n||u("message"),[,f]=ySe(h),g=()=>({left:"50%",transform:"translateX(-50%)",top:t??Dvt}),p=()=>xe(f,a?`${h}-rtl`:""),v=()=>wvt(h,l),m=C.createElement("span",{className:`${h}-close-x`},C.createElement(CT,{className:`${h}-close-icon`})),[_,y]=Cvt({prefixCls:h,style:g,className:p,motion:v,closable:!1,closeIcon:m,duration:s,getContainer:()=>(r==null?void 0:r())||(d==null?void 0:d())||document.body,maxCount:o,onAllRemoved:c});return C.useImperativeHandle(e,()=>Object.assign(Object.assign({},_),{prefixCls:h,hashId:f})),y});let Mce=0;function SSe(i){const e=C.useRef(null);return[C.useMemo(()=>{const n=l=>{var c;(c=e.current)===null||c===void 0||c.close(l)},r=l=>{if(!e.current){const L=()=>{};return L.then=()=>{},L}const{open:c,prefixCls:u,hashId:d}=e.current,h=`${u}-notice`,{content:f,icon:g,type:p,key:v,className:m,onClose:_}=l,y=Evt(l,["content","icon","type","key","className","onClose"]);let S=v;return S==null&&(Mce+=1,S=`antd-message-${Mce}`),$Z(L=>(c(Object.assign(Object.assign({},y),{key:S,content:C.createElement(wSe,{prefixCls:u,type:p,icon:g},f),placement:"top",className:xe(p&&`${h}-${p}`,d,m),onClose:()=>{_==null||_(),L()}})),()=>{n(S)}))},s={open:r,destroy:l=>{var c;l!==void 0?n(l):(c=e.current)===null||c===void 0||c.destroy()}};return["info","success","warning","error","loading"].forEach(l=>{const c=(u,d,h)=>{let f;u&&typeof u=="object"&&"content"in u?f=u:f={content:u};let g,p;typeof d=="function"?p=d:(g=d,p=h);const v=Object.assign(Object.assign({onClose:p,duration:g},f),{type:l});return r(v)};s[l]=c}),s},[]),C.createElement(kvt,Object.assign({key:"message-holder"},i,{ref:e}))]}function Tvt(i){return SSe(i)}function Nvt(){const[i,e]=C.useState([]),t=C.useCallback(n=>(e(r=>[].concat(ft(r),[n])),()=>{e(r=>r.filter(o=>o!==n))}),[]);return[i,t]}var ET=te({},uPe),Rvt=ET.version,Mvt=ET.render,Avt=ET.unmountComponentAtNode,N5;try{var Pvt=Number((Rvt||"").split(".")[0]);Pvt>=18&&(N5=ET.createRoot)}catch{}function Ace(i){var e=ET.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;e&&zn(e)==="object"&&(e.usingClientEntryPoint=i)}var UO="__rc_react_root__";function Ovt(i,e){Ace(!0);var t=e[UO]||N5(e);Ace(!1),t.render(i),e[UO]=t}function Fvt(i,e){Mvt(i,e)}function HZ(i,e){if(N5){Ovt(i,e);return}Fvt(i,e)}function Bvt(i){return nK.apply(this,arguments)}function nK(){return nK=EC(Nl().mark(function i(e){return Nl().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",Promise.resolve().then(function(){var r;(r=e[UO])===null||r===void 0||r.unmount(),delete e[UO]}));case 1:case"end":return n.stop()}},i)})),nK.apply(this,arguments)}function Wvt(i){Avt(i)}function xSe(i){return iK.apply(this,arguments)}function iK(){return iK=EC(Nl().mark(function i(e){return Nl().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(N5===void 0){n.next=2;break}return n.abrupt("return",Bvt(e));case 2:Wvt(e);case 3:case"end":return n.stop()}},i)})),iK.apply(this,arguments)}const DT=function(i){if(!i)return!1;if(i instanceof Element){if(i.offsetParent)return!0;if(i.getBBox){var e=i.getBBox(),t=e.width,n=e.height;if(t||n)return!0}if(i.getBoundingClientRect){var r=i.getBoundingClientRect(),o=r.width,s=r.height;if(o||s)return!0}}return!1},$vt=i=>{const{componentCls:e,colorPrimary:t}=i;return{[e]:{position:"absolute",background:"transparent",pointerEvents:"none",boxSizing:"border-box",color:`var(--wave-color, ${t})`,boxShadow:"0 0 0 0 currentcolor",opacity:.2,"&.wave-motion-appear":{transition:[`box-shadow 0.4s ${i.motionEaseOutCirc}`,`opacity 2s ${i.motionEaseOutCirc}`].join(","),"&-active":{boxShadow:"0 0 0 6px currentcolor",opacity:0}}}}},Hvt=vo("Wave",i=>[$vt(i)]);function Vvt(i){const e=(i||"").match(/rgba?\((\d*), (\d*), (\d*)(, [\d.]*)?\)/);return e&&e[1]&&e[2]&&e[3]?!(e[1]===e[2]&&e[2]===e[3]):!0}function d7(i){return i&&i!=="#fff"&&i!=="#ffffff"&&i!=="rgb(255, 255, 255)"&&i!=="rgba(255, 255, 255, 1)"&&Vvt(i)&&!/rgba\((?:\d*, ){3}0\)/.test(i)&&i!=="transparent"}function zvt(i){const{borderTopColor:e,borderColor:t,backgroundColor:n}=getComputedStyle(i);return d7(e)?e:d7(t)?t:d7(n)?n:null}function h7(i){return Number.isNaN(i)?0:i}const Uvt=i=>{const{className:e,target:t}=i,n=C.useRef(null),[r,o]=C.useState(null),[s,a]=C.useState([]),[l,c]=C.useState(0),[u,d]=C.useState(0),[h,f]=C.useState(0),[g,p]=C.useState(0),[v,m]=C.useState(!1),_={left:l,top:u,width:h,height:g,borderRadius:s.map(S=>`${S}px`).join(" ")};r&&(_["--wave-color"]=r);function y(){const S=getComputedStyle(t);o(zvt(t));const L=S.position==="static",{borderLeftWidth:E,borderTopWidth:D}=S;c(L?t.offsetLeft:h7(-parseFloat(E))),d(L?t.offsetTop:h7(-parseFloat(D))),f(t.offsetWidth),p(t.offsetHeight);const{borderTopLeftRadius:k,borderTopRightRadius:T,borderBottomLeftRadius:M,borderBottomRightRadius:A}=S;a([k,T,A,M].map(N=>h7(parseFloat(N))))}return C.useEffect(()=>{if(t){const S=Zi(()=>{y(),m(!0)});let L;return typeof ResizeObserver<"u"&&(L=new ResizeObserver(y),L.observe(t)),()=>{Zi.cancel(S),L==null||L.disconnect()}}},[]),v?C.createElement(fd,{visible:!0,motionAppear:!0,motionName:"wave-motion",motionDeadline:5e3,onAppearEnd:(S,L)=>{var E;if(L.deadline||L.propertyName==="opacity"){const D=(E=n.current)===null||E===void 0?void 0:E.parentElement;xSe(D).then(()=>{var k;(k=D.parentElement)===null||k===void 0||k.removeChild(D)})}return!1}},S=>{let{className:L}=S;return C.createElement("div",{ref:n,className:xe(e,L),style:_})}):null};function jvt(i,e){const t=document.createElement("div");t.style.position="absolute",t.style.left="0px",t.style.top="0px",i==null||i.insertBefore(t,i==null?void 0:i.firstChild),HZ(C.createElement(Uvt,{target:i,className:e}),t)}function Kvt(i,e){function t(){const n=i.current;jvt(n,e)}return t}const Gvt=i=>{const{children:e,disabled:t}=i,{getPrefixCls:n}=C.useContext(Rn),r=C.useRef(null),o=n("wave"),[,s]=Hvt(o),a=Kvt(r,xe(o,s));if($e.useEffect(()=>{const c=r.current;if(!c||c.nodeType!==1||t)return;const u=d=>{d.target.tagName==="INPUT"||!DT(d.target)||!c.getAttribute||c.getAttribute("disabled")||c.disabled||c.className.includes("disabled")||c.className.includes("-leave")||a()};return c.addEventListener("click",u,!0),()=>{c.removeEventListener("click",u,!0)}},[t]),!$e.isValidElement(e))return e??null;const l=$_(e)?vu(e.ref,r):r;return Qs(e,{ref:l})},qvt=Gvt,Xvt=i=>{const{componentCls:e}=i;return{[e]:{display:"inline-flex","&-block":{display:"flex",width:"100%"},"&-vertical":{flexDirection:"column"}}}},Yvt=Xvt,Zvt=i=>{const{componentCls:e}=i;return{[e]:{display:"inline-flex","&-rtl":{direction:"rtl"},"&-vertical":{flexDirection:"column"},"&-align":{flexDirection:"column","&-center":{alignItems:"center"},"&-start":{alignItems:"flex-start"},"&-end":{alignItems:"flex-end"},"&-baseline":{alignItems:"baseline"}},[`${e}-item:empty`]:{display:"none"}}}},LSe=vo("Space",i=>[Zvt(i),Yvt(i)],()=>({}),{resetStyle:!1});var ESe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const t=C.useContext(R5),n=C.useMemo(()=>{if(!t)return"";const{compactDirection:r,isFirstItem:o,isLastItem:s}=t,a=r==="vertical"?"-vertical-":"-";return xe({[`${i}-compact${a}item`]:!0,[`${i}-compact${a}first-item`]:o,[`${i}-compact${a}last-item`]:s,[`${i}-compact${a}item-rtl`]:e==="rtl"})},[i,e,t]);return{compactSize:t==null?void 0:t.compactSize,compactDirection:t==null?void 0:t.compactDirection,compactItemClassnames:n}},gS=i=>{let{children:e}=i;return C.createElement(R5.Provider,{value:null},e)},Qvt=i=>{var{children:e}=i,t=ESe(i,["children"]);return C.createElement(R5.Provider,{value:t},e)},Jvt=i=>{const{getPrefixCls:e,direction:t}=C.useContext(Rn),{size:n="middle",direction:r,block:o,prefixCls:s,className:a,rootClassName:l,children:c}=i,u=ESe(i,["size","direction","block","prefixCls","className","rootClassName","children"]),d=e("space-compact",s),[h,f]=LSe(d),g=xe(d,f,{[`${d}-rtl`]:t==="rtl",[`${d}-block`]:o,[`${d}-vertical`]:r==="vertical"},a,l),p=C.useContext(R5),v=rd(c),m=C.useMemo(()=>v.map((_,y)=>{const S=_&&_.key||`${d}-item-${y}`;return C.createElement(Qvt,{key:S,compactSize:n,compactDirection:r,isFirstItem:y===0&&(!p||(p==null?void 0:p.isFirstItem)),isLastItem:y===v.length-1&&(!p||(p==null?void 0:p.isLastItem))},_)}),[n,v,p]);return v.length===0?null:h(C.createElement("div",Object.assign({className:g},u),m))},e_t=Jvt,f7=()=>({width:0,opacity:0,transform:"scale(0)"}),g7=i=>({width:i.scrollWidth,opacity:1,transform:"scale(1)"}),t_t=i=>{let{prefixCls:e,loading:t,existIcon:n}=i;const r=!!t;return n?$e.createElement("span",{className:`${e}-loading-icon`},$e.createElement(ek,null)):$e.createElement(fd,{visible:r,motionName:`${e}-loading-icon-motion`,removeOnLeave:!0,onAppearStart:f7,onAppearActive:g7,onEnterStart:f7,onEnterActive:g7,onLeaveStart:g7,onLeaveActive:f7},(o,s)=>{let{className:a,style:l}=o;return $e.createElement("span",{className:`${e}-loading-icon`,style:l,ref:s},$e.createElement(ek,{className:a}))})},n_t=t_t;var i_t=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{getPrefixCls:e,direction:t}=C.useContext(Rn),{prefixCls:n,size:r,className:o}=i,s=i_t(i,["prefixCls","size","className"]),a=e("btn-group",n),[,,l]=DC();let c="";switch(r){case"large":c="lg";break;case"small":c="sm";break}const u=xe(a,{[`${a}-${c}`]:c,[`${a}-rtl`]:t==="rtl"},o,l);return C.createElement(DSe.Provider,{value:r},C.createElement("div",Object.assign({},s,{className:u})))},o_t=r_t,Pce=/^[\u4e00-\u9fa5]{2}$/,rK=Pce.test.bind(Pce);function s_t(i){return typeof i=="string"}function p7(i){return i==="text"||i==="link"}function a_t(i,e){if(i==null)return;const t=e?" ":"";return typeof i!="string"&&typeof i!="number"&&s_t(i.type)&&rK(i.props.children)?Qs(i,{children:i.props.children.split("").join(t)}):typeof i=="string"?rK(i)?$e.createElement("span",null,i.split("").join(t)):$e.createElement("span",null,i):bSe(i)?$e.createElement("span",null,i):i}function l_t(i,e){let t=!1;const n=[];return $e.Children.forEach(i,r=>{const o=typeof r,s=o==="string"||o==="number";if(t&&s){const a=n.length-1,l=n[a];n[a]=`${l}${r}`}else n.push(r);t=s}),$e.Children.map(n,r=>a_t(r,e))}const Oce=(i,e)=>({[`> span, > ${i}`]:{"&:not(:last-child)":{[`&, & > ${i}`]:{"&:not(:disabled)":{borderInlineEndColor:e}}},"&:not(:first-child)":{[`&, & > ${i}`]:{"&:not(:disabled)":{borderInlineStartColor:e}}}}}),c_t=i=>{const{componentCls:e,fontSize:t,lineWidth:n,colorPrimaryHover:r,colorErrorHover:o}=i;return{[`${e}-group`]:[{position:"relative",display:"inline-flex",[`> span, > ${e}`]:{"&:not(:last-child)":{[`&, & > ${e}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},"&:not(:first-child)":{marginInlineStart:-n,[`&, & > ${e}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}},[e]:{position:"relative",zIndex:1,[`&:hover, + ${e}-loading > ${t}`]:{color:c}}},{[`${e}-notice-pure-panel`]:{padding:0,textAlign:"start"}}]},ySe=vo("Message",i=>{const e=Oi(i,{messageNoticeContentPadding:`${(i.controlHeightLG-i.fontSize*i.lineHeight)/2}px ${i.paddingSM}px`});return[yvt(e)]},i=>({height:150,zIndexPopup:i.zIndexPopupBase+10}));function wvt(i,e){return{motionName:e??`${i}-move-up`}}function $Z(i){let e;const t=new Promise(r=>{e=i(()=>{r(!0)})}),n=()=>{e==null||e()};return n.then=(r,o)=>t.then(r,o),n.promise=t,n}var Svt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{top:t,prefixCls:n,getContainer:r,maxCount:o,duration:s=Ivt,rtl:a,transitionName:l,onAllRemoved:c}=i,{getPrefixCls:u,getPopupContainer:d}=C.useContext(Rn),h=n||u("message"),[,f]=ySe(h),g=()=>({left:"50%",transform:"translateX(-50%)",top:t??Dvt}),p=()=>xe(f,a?`${h}-rtl`:""),v=()=>wvt(h,l),m=C.createElement("span",{className:`${h}-close-x`},C.createElement(CT,{className:`${h}-close-icon`})),[_,y]=Cvt({prefixCls:h,style:g,className:p,motion:v,closable:!1,closeIcon:m,duration:s,getContainer:()=>(r==null?void 0:r())||(d==null?void 0:d())||document.body,maxCount:o,onAllRemoved:c});return C.useImperativeHandle(e,()=>Object.assign(Object.assign({},_),{prefixCls:h,hashId:f})),y});let Mce=0;function SSe(i){const e=C.useRef(null);return[C.useMemo(()=>{const n=l=>{var c;(c=e.current)===null||c===void 0||c.close(l)},r=l=>{if(!e.current){const L=()=>{};return L.then=()=>{},L}const{open:c,prefixCls:u,hashId:d}=e.current,h=`${u}-notice`,{content:f,icon:g,type:p,key:v,className:m,onClose:_}=l,y=Evt(l,["content","icon","type","key","className","onClose"]);let S=v;return S==null&&(Mce+=1,S=`antd-message-${Mce}`),$Z(L=>(c(Object.assign(Object.assign({},y),{key:S,content:C.createElement(wSe,{prefixCls:u,type:p,icon:g},f),placement:"top",className:xe(p&&`${h}-${p}`,d,m),onClose:()=>{_==null||_(),L()}})),()=>{n(S)}))},s={open:r,destroy:l=>{var c;l!==void 0?n(l):(c=e.current)===null||c===void 0||c.destroy()}};return["info","success","warning","error","loading"].forEach(l=>{const c=(u,d,h)=>{let f;u&&typeof u=="object"&&"content"in u?f=u:f={content:u};let g,p;typeof d=="function"?p=d:(g=d,p=h);const v=Object.assign(Object.assign({onClose:p,duration:g},f),{type:l});return r(v)};s[l]=c}),s},[]),C.createElement(kvt,Object.assign({key:"message-holder"},i,{ref:e}))]}function Tvt(i){return SSe(i)}function Nvt(){const[i,e]=C.useState([]),t=C.useCallback(n=>(e(r=>[].concat(ft(r),[n])),()=>{e(r=>r.filter(o=>o!==n))}),[]);return[i,t]}var ET=te({},uPe),Rvt=ET.version,Mvt=ET.render,Avt=ET.unmountComponentAtNode,N5;try{var Pvt=Number((Rvt||"").split(".")[0]);Pvt>=18&&(N5=ET.createRoot)}catch{}function Ace(i){var e=ET.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;e&&zn(e)==="object"&&(e.usingClientEntryPoint=i)}var UO="__rc_react_root__";function Ovt(i,e){Ace(!0);var t=e[UO]||N5(e);Ace(!1),t.render(i),e[UO]=t}function Fvt(i,e){Mvt(i,e)}function HZ(i,e){if(N5){Ovt(i,e);return}Fvt(i,e)}function Bvt(i){return nK.apply(this,arguments)}function nK(){return nK=EC(Nl().mark(function i(e){return Nl().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",Promise.resolve().then(function(){var r;(r=e[UO])===null||r===void 0||r.unmount(),delete e[UO]}));case 1:case"end":return n.stop()}},i)})),nK.apply(this,arguments)}function Wvt(i){Avt(i)}function xSe(i){return iK.apply(this,arguments)}function iK(){return iK=EC(Nl().mark(function i(e){return Nl().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(N5===void 0){n.next=2;break}return n.abrupt("return",Bvt(e));case 2:Wvt(e);case 3:case"end":return n.stop()}},i)})),iK.apply(this,arguments)}const DT=function(i){if(!i)return!1;if(i instanceof Element){if(i.offsetParent)return!0;if(i.getBBox){var e=i.getBBox(),t=e.width,n=e.height;if(t||n)return!0}if(i.getBoundingClientRect){var r=i.getBoundingClientRect(),o=r.width,s=r.height;if(o||s)return!0}}return!1},$vt=i=>{const{componentCls:e,colorPrimary:t}=i;return{[e]:{position:"absolute",background:"transparent",pointerEvents:"none",boxSizing:"border-box",color:`var(--wave-color, ${t})`,boxShadow:"0 0 0 0 currentcolor",opacity:.2,"&.wave-motion-appear":{transition:[`box-shadow 0.4s ${i.motionEaseOutCirc}`,`opacity 2s ${i.motionEaseOutCirc}`].join(","),"&-active":{boxShadow:"0 0 0 6px currentcolor",opacity:0}}}}},Hvt=vo("Wave",i=>[$vt(i)]);function Vvt(i){const e=(i||"").match(/rgba?\((\d*), (\d*), (\d*)(, [\d.]*)?\)/);return e&&e[1]&&e[2]&&e[3]?!(e[1]===e[2]&&e[2]===e[3]):!0}function d7(i){return i&&i!=="#fff"&&i!=="#ffffff"&&i!=="rgb(255, 255, 255)"&&i!=="rgba(255, 255, 255, 1)"&&Vvt(i)&&!/rgba\((?:\d*, ){3}0\)/.test(i)&&i!=="transparent"}function zvt(i){const{borderTopColor:e,borderColor:t,backgroundColor:n}=getComputedStyle(i);return d7(e)?e:d7(t)?t:d7(n)?n:null}function h7(i){return Number.isNaN(i)?0:i}const Uvt=i=>{const{className:e,target:t}=i,n=C.useRef(null),[r,o]=C.useState(null),[s,a]=C.useState([]),[l,c]=C.useState(0),[u,d]=C.useState(0),[h,f]=C.useState(0),[g,p]=C.useState(0),[v,m]=C.useState(!1),_={left:l,top:u,width:h,height:g,borderRadius:s.map(S=>`${S}px`).join(" ")};r&&(_["--wave-color"]=r);function y(){const S=getComputedStyle(t);o(zvt(t));const L=S.position==="static",{borderLeftWidth:E,borderTopWidth:D}=S;c(L?t.offsetLeft:h7(-parseFloat(E))),d(L?t.offsetTop:h7(-parseFloat(D))),f(t.offsetWidth),p(t.offsetHeight);const{borderTopLeftRadius:k,borderTopRightRadius:T,borderBottomLeftRadius:M,borderBottomRightRadius:A}=S;a([k,T,A,M].map(N=>h7(parseFloat(N))))}return C.useEffect(()=>{if(t){const S=Zi(()=>{y(),m(!0)});let L;return typeof ResizeObserver<"u"&&(L=new ResizeObserver(y),L.observe(t)),()=>{Zi.cancel(S),L==null||L.disconnect()}}},[]),v?C.createElement(fd,{visible:!0,motionAppear:!0,motionName:"wave-motion",motionDeadline:5e3,onAppearEnd:(S,L)=>{var E;if(L.deadline||L.propertyName==="opacity"){const D=(E=n.current)===null||E===void 0?void 0:E.parentElement;xSe(D).then(()=>{var k;(k=D.parentElement)===null||k===void 0||k.removeChild(D)})}return!1}},S=>{let{className:L}=S;return C.createElement("div",{ref:n,className:xe(e,L),style:_})}):null};function jvt(i,e){const t=document.createElement("div");t.style.position="absolute",t.style.left="0px",t.style.top="0px",i==null||i.insertBefore(t,i==null?void 0:i.firstChild),HZ(C.createElement(Uvt,{target:i,className:e}),t)}function Kvt(i,e){function t(){const n=i.current;jvt(n,e)}return t}const Gvt=i=>{const{children:e,disabled:t}=i,{getPrefixCls:n}=C.useContext(Rn),r=C.useRef(null),o=n("wave"),[,s]=Hvt(o),a=Kvt(r,xe(o,s));if($e.useEffect(()=>{const c=r.current;if(!c||c.nodeType!==1||t)return;const u=d=>{d.target.tagName==="INPUT"||!DT(d.target)||!c.getAttribute||c.getAttribute("disabled")||c.disabled||c.className.includes("disabled")||c.className.includes("-leave")||a()};return c.addEventListener("click",u,!0),()=>{c.removeEventListener("click",u,!0)}},[t]),!$e.isValidElement(e))return e??null;const l=W_(e)?vu(e.ref,r):r;return Qs(e,{ref:l})},qvt=Gvt,Xvt=i=>{const{componentCls:e}=i;return{[e]:{display:"inline-flex","&-block":{display:"flex",width:"100%"},"&-vertical":{flexDirection:"column"}}}},Yvt=Xvt,Zvt=i=>{const{componentCls:e}=i;return{[e]:{display:"inline-flex","&-rtl":{direction:"rtl"},"&-vertical":{flexDirection:"column"},"&-align":{flexDirection:"column","&-center":{alignItems:"center"},"&-start":{alignItems:"flex-start"},"&-end":{alignItems:"flex-end"},"&-baseline":{alignItems:"baseline"}},[`${e}-item:empty`]:{display:"none"}}}},LSe=vo("Space",i=>[Zvt(i),Yvt(i)],()=>({}),{resetStyle:!1});var ESe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const t=C.useContext(R5),n=C.useMemo(()=>{if(!t)return"";const{compactDirection:r,isFirstItem:o,isLastItem:s}=t,a=r==="vertical"?"-vertical-":"-";return xe({[`${i}-compact${a}item`]:!0,[`${i}-compact${a}first-item`]:o,[`${i}-compact${a}last-item`]:s,[`${i}-compact${a}item-rtl`]:e==="rtl"})},[i,e,t]);return{compactSize:t==null?void 0:t.compactSize,compactDirection:t==null?void 0:t.compactDirection,compactItemClassnames:n}},gS=i=>{let{children:e}=i;return C.createElement(R5.Provider,{value:null},e)},Qvt=i=>{var{children:e}=i,t=ESe(i,["children"]);return C.createElement(R5.Provider,{value:t},e)},Jvt=i=>{const{getPrefixCls:e,direction:t}=C.useContext(Rn),{size:n="middle",direction:r,block:o,prefixCls:s,className:a,rootClassName:l,children:c}=i,u=ESe(i,["size","direction","block","prefixCls","className","rootClassName","children"]),d=e("space-compact",s),[h,f]=LSe(d),g=xe(d,f,{[`${d}-rtl`]:t==="rtl",[`${d}-block`]:o,[`${d}-vertical`]:r==="vertical"},a,l),p=C.useContext(R5),v=rd(c),m=C.useMemo(()=>v.map((_,y)=>{const S=_&&_.key||`${d}-item-${y}`;return C.createElement(Qvt,{key:S,compactSize:n,compactDirection:r,isFirstItem:y===0&&(!p||(p==null?void 0:p.isFirstItem)),isLastItem:y===v.length-1&&(!p||(p==null?void 0:p.isLastItem))},_)}),[n,v,p]);return v.length===0?null:h(C.createElement("div",Object.assign({className:g},u),m))},e_t=Jvt,f7=()=>({width:0,opacity:0,transform:"scale(0)"}),g7=i=>({width:i.scrollWidth,opacity:1,transform:"scale(1)"}),t_t=i=>{let{prefixCls:e,loading:t,existIcon:n}=i;const r=!!t;return n?$e.createElement("span",{className:`${e}-loading-icon`},$e.createElement(ek,null)):$e.createElement(fd,{visible:r,motionName:`${e}-loading-icon-motion`,removeOnLeave:!0,onAppearStart:f7,onAppearActive:g7,onEnterStart:f7,onEnterActive:g7,onLeaveStart:g7,onLeaveActive:f7},(o,s)=>{let{className:a,style:l}=o;return $e.createElement("span",{className:`${e}-loading-icon`,style:l,ref:s},$e.createElement(ek,{className:a}))})},n_t=t_t;var i_t=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{getPrefixCls:e,direction:t}=C.useContext(Rn),{prefixCls:n,size:r,className:o}=i,s=i_t(i,["prefixCls","size","className"]),a=e("btn-group",n),[,,l]=DC();let c="";switch(r){case"large":c="lg";break;case"small":c="sm";break}const u=xe(a,{[`${a}-${c}`]:c,[`${a}-rtl`]:t==="rtl"},o,l);return C.createElement(DSe.Provider,{value:r},C.createElement("div",Object.assign({},s,{className:u})))},o_t=r_t,Pce=/^[\u4e00-\u9fa5]{2}$/,rK=Pce.test.bind(Pce);function s_t(i){return typeof i=="string"}function p7(i){return i==="text"||i==="link"}function a_t(i,e){if(i==null)return;const t=e?" ":"";return typeof i!="string"&&typeof i!="number"&&s_t(i.type)&&rK(i.props.children)?Qs(i,{children:i.props.children.split("").join(t)}):typeof i=="string"?rK(i)?$e.createElement("span",null,i.split("").join(t)):$e.createElement("span",null,i):bSe(i)?$e.createElement("span",null,i):i}function l_t(i,e){let t=!1;const n=[];return $e.Children.forEach(i,r=>{const o=typeof r,s=o==="string"||o==="number";if(t&&s){const a=n.length-1,l=n[a];n[a]=`${l}${r}`}else n.push(r);t=s}),$e.Children.map(n,r=>a_t(r,e))}const Oce=(i,e)=>({[`> span, > ${i}`]:{"&:not(:last-child)":{[`&, & > ${i}`]:{"&:not(:disabled)":{borderInlineEndColor:e}}},"&:not(:first-child)":{[`&, & > ${i}`]:{"&:not(:disabled)":{borderInlineStartColor:e}}}}}),c_t=i=>{const{componentCls:e,fontSize:t,lineWidth:n,colorPrimaryHover:r,colorErrorHover:o}=i;return{[`${e}-group`]:[{position:"relative",display:"inline-flex",[`> span, > ${e}`]:{"&:not(:last-child)":{[`&, & > ${e}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},"&:not(:first-child)":{marginInlineStart:-n,[`&, & > ${e}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}},[e]:{position:"relative",zIndex:1,[`&:hover, &:focus, - &:active`]:{zIndex:2},"&[disabled]":{zIndex:0}},[`${e}-icon-only`]:{fontSize:t}},Oce(`${e}-primary`,r),Oce(`${e}-danger`,o)]}},u_t=c_t;function d_t(i,e,t){const{focusElCls:n,focus:r,borderElCls:o}=t,s=o?"> *":"",a=["hover",r?"focus":null,"active"].filter(Boolean).map(l=>`&:${l} ${s}`).join(",");return{[`&-item:not(${e}-last-item)`]:{marginInlineEnd:-i.lineWidth},"&-item":Object.assign(Object.assign({[a]:{zIndex:2}},n?{[`&${n}`]:{zIndex:2}}:{}),{[`&[disabled] ${s}`]:{zIndex:0}})}}function h_t(i,e,t){const{borderElCls:n}=t,r=n?`> ${n}`:"";return{[`&-item:not(${e}-first-item):not(${e}-last-item) ${r}`]:{borderRadius:0},[`&-item:not(${e}-last-item)${e}-first-item`]:{[`& ${r}, &${i}-sm ${r}, &${i}-lg ${r}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&-item:not(${e}-first-item)${e}-last-item`]:{[`& ${r}, &${i}-sm ${r}, &${i}-lg ${r}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}}function M5(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{focus:!0};const{componentCls:t}=i,n=`${t}-compact`;return{[n]:Object.assign(Object.assign({},d_t(i,n,e)),h_t(t,n,e))}}function f_t(i,e){return{[`&-item:not(${e}-last-item)`]:{marginBottom:-i.lineWidth},"&-item":{"&:hover,&:focus,&:active":{zIndex:2},"&[disabled]":{zIndex:0}}}}function g_t(i,e){return{[`&-item:not(${e}-first-item):not(${e}-last-item)`]:{borderRadius:0},[`&-item${e}-first-item:not(${e}-last-item)`]:{[`&, &${i}-sm, &${i}-lg`]:{borderEndEndRadius:0,borderEndStartRadius:0}},[`&-item${e}-last-item:not(${e}-first-item)`]:{[`&, &${i}-sm, &${i}-lg`]:{borderStartStartRadius:0,borderStartEndRadius:0}}}}function p_t(i){const e=`${i.componentCls}-compact-vertical`;return{[e]:Object.assign(Object.assign({},f_t(i,e)),g_t(i.componentCls,e))}}const m_t=i=>{const{componentCls:e,iconCls:t}=i;return{[e]:{outline:"none",position:"relative",display:"inline-block",fontWeight:400,whiteSpace:"nowrap",textAlign:"center",backgroundImage:"none",backgroundColor:"transparent",border:`${i.lineWidth}px ${i.lineType} transparent`,cursor:"pointer",transition:`all ${i.motionDurationMid} ${i.motionEaseInOut}`,userSelect:"none",touchAction:"manipulation",lineHeight:i.lineHeight,color:i.colorText,"> span":{display:"inline-block"},[`> ${t} + span, > span + ${t}`]:{marginInlineStart:i.marginXS},"> a":{color:"currentColor"},"&:not(:disabled)":Object.assign({},lk(i)),[`&-icon-only${e}-compact-item`]:{flex:"none"},[`&-compact-item${e}-primary`]:{[`&:not([disabled]) + ${e}-compact-item${e}-primary:not([disabled])`]:{position:"relative","&:before":{position:"absolute",top:-i.lineWidth,insetInlineStart:-i.lineWidth,display:"inline-block",width:i.lineWidth,height:`calc(100% + ${i.lineWidth*2}px)`,backgroundColor:i.colorPrimaryHover,content:'""'}}},"&-compact-vertical-item":{[`&${e}-primary`]:{[`&:not([disabled]) + ${e}-compact-vertical-item${e}-primary:not([disabled])`]:{position:"relative","&:before":{position:"absolute",top:-i.lineWidth,insetInlineStart:-i.lineWidth,display:"inline-block",width:`calc(100% + ${i.lineWidth*2}px)`,height:i.lineWidth,backgroundColor:i.colorPrimaryHover,content:'""'}}}}}}},Fp=(i,e)=>({"&:not(:disabled)":{"&:hover":i,"&:active":e}}),v_t=i=>({minWidth:i.controlHeight,paddingInlineStart:0,paddingInlineEnd:0,borderRadius:"50%"}),__t=i=>({borderRadius:i.controlHeight,paddingInlineStart:i.controlHeight/2,paddingInlineEnd:i.controlHeight/2}),oK=i=>({cursor:"not-allowed",borderColor:i.colorBorder,color:i.colorTextDisabled,backgroundColor:i.colorBgContainerDisabled,boxShadow:"none"}),jO=(i,e,t,n,r,o,s)=>({[`&${i}-background-ghost`]:Object.assign(Object.assign({color:e||void 0,backgroundColor:"transparent",borderColor:t||void 0,boxShadow:"none"},Fp(Object.assign({backgroundColor:"transparent"},o),Object.assign({backgroundColor:"transparent"},s))),{"&:disabled":{cursor:"not-allowed",color:n||void 0,borderColor:r||void 0}})}),VZ=i=>({"&:disabled":Object.assign({},oK(i))}),ISe=i=>Object.assign({},VZ(i)),KO=i=>({"&:disabled":{cursor:"not-allowed",color:i.colorTextDisabled}}),kSe=i=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ISe(i)),{backgroundColor:i.colorBgContainer,borderColor:i.colorBorder,boxShadow:`0 ${i.controlOutlineWidth}px 0 ${i.controlTmpOutline}`}),Fp({color:i.colorPrimaryHover,borderColor:i.colorPrimaryHover},{color:i.colorPrimaryActive,borderColor:i.colorPrimaryActive})),jO(i.componentCls,i.colorBgContainer,i.colorBgContainer,i.colorTextDisabled,i.colorBorder)),{[`&${i.componentCls}-dangerous`]:Object.assign(Object.assign(Object.assign({color:i.colorError,borderColor:i.colorError},Fp({color:i.colorErrorHover,borderColor:i.colorErrorBorderHover},{color:i.colorErrorActive,borderColor:i.colorErrorActive})),jO(i.componentCls,i.colorError,i.colorError,i.colorTextDisabled,i.colorBorder)),VZ(i))}),b_t=i=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ISe(i)),{color:i.colorTextLightSolid,backgroundColor:i.colorPrimary,boxShadow:`0 ${i.controlOutlineWidth}px 0 ${i.controlOutline}`}),Fp({color:i.colorTextLightSolid,backgroundColor:i.colorPrimaryHover},{color:i.colorTextLightSolid,backgroundColor:i.colorPrimaryActive})),jO(i.componentCls,i.colorPrimary,i.colorPrimary,i.colorTextDisabled,i.colorBorder,{color:i.colorPrimaryHover,borderColor:i.colorPrimaryHover},{color:i.colorPrimaryActive,borderColor:i.colorPrimaryActive})),{[`&${i.componentCls}-dangerous`]:Object.assign(Object.assign(Object.assign({backgroundColor:i.colorError,boxShadow:`0 ${i.controlOutlineWidth}px 0 ${i.colorErrorOutline}`},Fp({backgroundColor:i.colorErrorHover},{backgroundColor:i.colorErrorActive})),jO(i.componentCls,i.colorError,i.colorError,i.colorTextDisabled,i.colorBorder,{color:i.colorErrorHover,borderColor:i.colorErrorHover},{color:i.colorErrorActive,borderColor:i.colorErrorActive})),VZ(i))}),C_t=i=>Object.assign(Object.assign({},kSe(i)),{borderStyle:"dashed"}),y_t=i=>Object.assign(Object.assign(Object.assign({color:i.colorLink},Fp({color:i.colorLinkHover},{color:i.colorLinkActive})),KO(i)),{[`&${i.componentCls}-dangerous`]:Object.assign(Object.assign({color:i.colorError},Fp({color:i.colorErrorHover},{color:i.colorErrorActive})),KO(i))}),w_t=i=>Object.assign(Object.assign(Object.assign({},Fp({color:i.colorText,backgroundColor:i.colorBgTextHover},{color:i.colorText,backgroundColor:i.colorBgTextActive})),KO(i)),{[`&${i.componentCls}-dangerous`]:Object.assign(Object.assign({color:i.colorError},KO(i)),Fp({color:i.colorErrorHover,backgroundColor:i.colorErrorBg},{color:i.colorErrorHover,backgroundColor:i.colorErrorBg}))}),S_t=i=>Object.assign(Object.assign({},oK(i)),{[`&${i.componentCls}:hover`]:Object.assign({},oK(i))}),x_t=i=>{const{componentCls:e}=i;return{[`${e}-default`]:kSe(i),[`${e}-primary`]:b_t(i),[`${e}-dashed`]:C_t(i),[`${e}-link`]:y_t(i),[`${e}-text`]:w_t(i),[`${e}-disabled`]:S_t(i)}},zZ=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const{componentCls:t,iconCls:n,controlHeight:r,fontSize:o,lineHeight:s,lineWidth:a,borderRadius:l,buttonPaddingHorizontal:c}=i,u=Math.max(0,(r-o*s)/2-a),d=c-a,h=`${t}-icon-only`;return[{[`${t}${e}`]:{fontSize:o,height:r,padding:`${u}px ${d}px`,borderRadius:l,[`&${h}`]:{width:r,paddingInlineStart:0,paddingInlineEnd:0,[`&${t}-round`]:{width:"auto"},"> span":{transform:"scale(1.143)"}},[`&${t}-loading`]:{opacity:i.opacityLoading,cursor:"default"},[`${t}-loading-icon`]:{transition:`width ${i.motionDurationSlow} ${i.motionEaseInOut}, opacity ${i.motionDurationSlow} ${i.motionEaseInOut}`},[`&:not(${h}) ${t}-loading-icon > ${n}`]:{marginInlineEnd:i.marginXS}}},{[`${t}${t}-circle${e}`]:v_t(i)},{[`${t}${t}-round${e}`]:__t(i)}]},L_t=i=>zZ(i),E_t=i=>{const e=Oi(i,{controlHeight:i.controlHeightSM,padding:i.paddingXS,buttonPaddingHorizontal:8,borderRadius:i.borderRadiusSM});return zZ(e,`${i.componentCls}-sm`)},D_t=i=>{const e=Oi(i,{controlHeight:i.controlHeightLG,fontSize:i.fontSizeLG,borderRadius:i.borderRadiusLG});return zZ(e,`${i.componentCls}-lg`)},I_t=i=>{const{componentCls:e}=i;return{[e]:{[`&${e}-block`]:{width:"100%"}}}},k_t=vo("Button",i=>{const{controlTmpOutline:e,paddingContentHorizontal:t}=i,n=Oi(i,{colorOutlineDefault:e,buttonPaddingHorizontal:t});return[m_t(n),E_t(n),L_t(n),D_t(n),I_t(n),x_t(n),u_t(n),M5(i),p_t(i)]});var T_t=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{loading:t=!1,prefixCls:n,type:r="default",danger:o,shape:s="default",size:a,disabled:l,className:c,rootClassName:u,children:d,icon:h,ghost:f=!1,block:g=!1,htmlType:p="button"}=i,v=T_t(i,["loading","prefixCls","type","danger","shape","size","disabled","className","rootClassName","children","icon","ghost","block","htmlType"]),{getPrefixCls:m,autoInsertSpaceInButton:_,direction:y}=C.useContext(Rn),S=m("btn",n),[L,E]=k_t(S),D=C.useContext(Rh),k=C.useContext(H_),T=l??k,M=C.useContext(DSe),A=C.useMemo(()=>N_t(t),[t]),[N,R]=C.useState(A.loading),[F,W]=C.useState(!1),H=e||C.createRef(),G=()=>C.Children.count(d)===1&&!h&&!p7(r),U=()=>{if(!H||!H.current||_===!1)return;const Se=H.current.textContent;G()&&rK(Se)?F||W(!0):F&&W(!1)};C.useEffect(()=>{let Se=null;A.delay>0?Se=window.setTimeout(()=>{Se=null,R(!0)},A.delay):R(A.loading);function Ne(){Se&&(window.clearTimeout(Se),Se=null)}return Ne},[A]),C.useEffect(U,[H]);const K=Se=>{const{onClick:Ne}=i;if(N||T){Se.preventDefault();return}Ne==null||Ne(Se)},re=_!==!1,{compactSize:Y,compactItemClassnames:J}=QS(S,y),Q={large:"lg",small:"sm",middle:void 0},ue=Y||M||a||D,de=ue&&Q[ue]||"",_e=N?"loading":h,ve=ll(v,["navigate"]),Ve=ve.href!==void 0&&T,Ze=xe(S,E,{[`${S}-${s}`]:s!=="default"&&s,[`${S}-${r}`]:r,[`${S}-${de}`]:de,[`${S}-icon-only`]:!d&&d!==0&&!!_e,[`${S}-background-ghost`]:f&&!p7(r),[`${S}-loading`]:N,[`${S}-two-chinese-chars`]:F&&re&&!N,[`${S}-block`]:g,[`${S}-dangerous`]:!!o,[`${S}-rtl`]:y==="rtl",[`${S}-disabled`]:Ve},J,c,u),We=h&&!N?h:C.createElement(n_t,{existIcon:!!h,prefixCls:S,loading:!!N}),pe=d||d===0?l_t(d,G()&&re):null;if(ve.href!==void 0)return L(C.createElement("a",Object.assign({},ve,{className:Ze,onClick:K,ref:H}),We,pe));let Pe=C.createElement("button",Object.assign({},v,{type:p,className:Ze,onClick:K,disabled:T,ref:H}),We,pe);return p7(r)||(Pe=C.createElement(qvt,{disabled:!!N},Pe)),L(Pe)},UZ=C.forwardRef(R_t);UZ.Group=o_t;UZ.__ANT_BUTTON=!0;const Ju=UZ;function Fce(i){return!!(i&&i.then)}const M_t=i=>{const{type:e,children:t,prefixCls:n,buttonProps:r,close:o,autoFocus:s,emitEvent:a,quitOnNullishReturnValue:l,actionFn:c}=i,u=C.useRef(!1),d=C.useRef(null),[h,f]=Mv(!1),g=function(){o==null||o.apply(void 0,arguments)};C.useEffect(()=>{let m=null;return s&&(m=setTimeout(()=>{var _;(_=d.current)===null||_===void 0||_.focus()})),()=>{m&&clearTimeout(m)}},[]);const p=m=>{Fce(m)&&(f(!0),m.then(function(){f(!1,!0),g.apply(void 0,arguments),u.current=!1},_=>(f(!1,!0),u.current=!1,Promise.reject(_))))},v=m=>{if(u.current)return;if(u.current=!0,!c){g();return}let _;if(a){if(_=c(m),l&&!Fce(_)){u.current=!1,g(m);return}}else if(c.length)_=c(o),u.current=!1;else if(_=c(),!_){g();return}p(_)};return C.createElement(Ju,Object.assign({},TSe(e),{onClick:v,loading:h,prefixCls:n},r,{ref:d}),t)},Bce=M_t,m7=()=>({height:0,opacity:0}),Wce=i=>{const{scrollHeight:e}=i;return{height:e,opacity:1}},A_t=i=>({height:i?i.offsetHeight:0}),v7=(i,e)=>(e==null?void 0:e.deadline)===!0||e.propertyName==="height",NSe=function(){return{motionName:`${arguments.length>0&&arguments[0]!==void 0?arguments[0]:"ant"}-motion-collapse`,onAppearStart:m7,onEnterStart:m7,onAppearActive:Wce,onEnterActive:Wce,onLeaveStart:A_t,onLeaveActive:m7,onAppearEnd:v7,onEnterEnd:v7,onLeaveEnd:v7,motionDeadline:500}},P_t=i=>i!==void 0&&(i==="topLeft"||i==="topRight")?"slide-down":"slide-up",nC=(i,e,t)=>t!==void 0?t:`${i}-${e}`;var RSe=C.createContext(null),br=Zs()?C.useLayoutEffect:C.useEffect,GE=function(e,t){var n=C.useRef(!0);br(function(){if(!n.current)return e()},t),br(function(){return n.current=!1,function(){n.current=!0}},[])},$ce=[];function O_t(i,e){var t=C.useState(function(){if(!Zs())return null;var g=document.createElement("div");return g}),n=Ae(t,1),r=n[0],o=C.useRef(!1),s=C.useContext(RSe),a=C.useState($ce),l=Ae(a,2),c=l[0],u=l[1],d=s||(o.current?void 0:function(g){u(function(p){var v=[g].concat(ft(p));return v})});function h(){r.parentElement||document.body.appendChild(r),o.current=!0}function f(){var g;(g=r.parentElement)===null||g===void 0||g.removeChild(r),o.current=!1}return br(function(){return i?s?s(h):h():f(),f},[i]),br(function(){c.length&&(c.forEach(function(g){return g()}),u($ce))},[c]),[r,d]}var _7;function GO(i){if(typeof document>"u")return 0;if(i||_7===void 0){var e=document.createElement("div");e.style.width="100%",e.style.height="200px";var t=document.createElement("div"),n=t.style;n.position="absolute",n.top="0",n.left="0",n.pointerEvents="none",n.visibility="hidden",n.width="200px",n.height="150px",n.overflow="hidden",t.appendChild(e),document.body.appendChild(t);var r=e.offsetWidth;t.style.overflow="scroll";var o=e.offsetWidth;r===o&&(o=t.clientWidth),document.body.removeChild(t),_7=r-o}return _7}function Hce(i){var e=i.match(/^(.*)px$/),t=Number(e==null?void 0:e[1]);return Number.isNaN(t)?GO():t}function Vce(i){if(typeof document>"u"||!i||!(i instanceof Element))return{width:0,height:0};var e=getComputedStyle(i,"::-webkit-scrollbar"),t=e.width,n=e.height;return{width:Hce(t),height:Hce(n)}}function F_t(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var B_t="rc-util-locker-".concat(Date.now()),zce=0;function W_t(i){var e=!!i,t=C.useState(function(){return zce+=1,"".concat(B_t,"_").concat(zce)}),n=Ae(t,1),r=n[0];br(function(){if(e){var o=GO(),s=F_t();uS(` + &:active`]:{zIndex:2},"&[disabled]":{zIndex:0}},[`${e}-icon-only`]:{fontSize:t}},Oce(`${e}-primary`,r),Oce(`${e}-danger`,o)]}},u_t=c_t;function d_t(i,e,t){const{focusElCls:n,focus:r,borderElCls:o}=t,s=o?"> *":"",a=["hover",r?"focus":null,"active"].filter(Boolean).map(l=>`&:${l} ${s}`).join(",");return{[`&-item:not(${e}-last-item)`]:{marginInlineEnd:-i.lineWidth},"&-item":Object.assign(Object.assign({[a]:{zIndex:2}},n?{[`&${n}`]:{zIndex:2}}:{}),{[`&[disabled] ${s}`]:{zIndex:0}})}}function h_t(i,e,t){const{borderElCls:n}=t,r=n?`> ${n}`:"";return{[`&-item:not(${e}-first-item):not(${e}-last-item) ${r}`]:{borderRadius:0},[`&-item:not(${e}-last-item)${e}-first-item`]:{[`& ${r}, &${i}-sm ${r}, &${i}-lg ${r}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&-item:not(${e}-first-item)${e}-last-item`]:{[`& ${r}, &${i}-sm ${r}, &${i}-lg ${r}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}}function M5(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{focus:!0};const{componentCls:t}=i,n=`${t}-compact`;return{[n]:Object.assign(Object.assign({},d_t(i,n,e)),h_t(t,n,e))}}function f_t(i,e){return{[`&-item:not(${e}-last-item)`]:{marginBottom:-i.lineWidth},"&-item":{"&:hover,&:focus,&:active":{zIndex:2},"&[disabled]":{zIndex:0}}}}function g_t(i,e){return{[`&-item:not(${e}-first-item):not(${e}-last-item)`]:{borderRadius:0},[`&-item${e}-first-item:not(${e}-last-item)`]:{[`&, &${i}-sm, &${i}-lg`]:{borderEndEndRadius:0,borderEndStartRadius:0}},[`&-item${e}-last-item:not(${e}-first-item)`]:{[`&, &${i}-sm, &${i}-lg`]:{borderStartStartRadius:0,borderStartEndRadius:0}}}}function p_t(i){const e=`${i.componentCls}-compact-vertical`;return{[e]:Object.assign(Object.assign({},f_t(i,e)),g_t(i.componentCls,e))}}const m_t=i=>{const{componentCls:e,iconCls:t}=i;return{[e]:{outline:"none",position:"relative",display:"inline-block",fontWeight:400,whiteSpace:"nowrap",textAlign:"center",backgroundImage:"none",backgroundColor:"transparent",border:`${i.lineWidth}px ${i.lineType} transparent`,cursor:"pointer",transition:`all ${i.motionDurationMid} ${i.motionEaseInOut}`,userSelect:"none",touchAction:"manipulation",lineHeight:i.lineHeight,color:i.colorText,"> span":{display:"inline-block"},[`> ${t} + span, > span + ${t}`]:{marginInlineStart:i.marginXS},"> a":{color:"currentColor"},"&:not(:disabled)":Object.assign({},lk(i)),[`&-icon-only${e}-compact-item`]:{flex:"none"},[`&-compact-item${e}-primary`]:{[`&:not([disabled]) + ${e}-compact-item${e}-primary:not([disabled])`]:{position:"relative","&:before":{position:"absolute",top:-i.lineWidth,insetInlineStart:-i.lineWidth,display:"inline-block",width:i.lineWidth,height:`calc(100% + ${i.lineWidth*2}px)`,backgroundColor:i.colorPrimaryHover,content:'""'}}},"&-compact-vertical-item":{[`&${e}-primary`]:{[`&:not([disabled]) + ${e}-compact-vertical-item${e}-primary:not([disabled])`]:{position:"relative","&:before":{position:"absolute",top:-i.lineWidth,insetInlineStart:-i.lineWidth,display:"inline-block",width:`calc(100% + ${i.lineWidth*2}px)`,height:i.lineWidth,backgroundColor:i.colorPrimaryHover,content:'""'}}}}}}},Bp=(i,e)=>({"&:not(:disabled)":{"&:hover":i,"&:active":e}}),v_t=i=>({minWidth:i.controlHeight,paddingInlineStart:0,paddingInlineEnd:0,borderRadius:"50%"}),__t=i=>({borderRadius:i.controlHeight,paddingInlineStart:i.controlHeight/2,paddingInlineEnd:i.controlHeight/2}),oK=i=>({cursor:"not-allowed",borderColor:i.colorBorder,color:i.colorTextDisabled,backgroundColor:i.colorBgContainerDisabled,boxShadow:"none"}),jO=(i,e,t,n,r,o,s)=>({[`&${i}-background-ghost`]:Object.assign(Object.assign({color:e||void 0,backgroundColor:"transparent",borderColor:t||void 0,boxShadow:"none"},Bp(Object.assign({backgroundColor:"transparent"},o),Object.assign({backgroundColor:"transparent"},s))),{"&:disabled":{cursor:"not-allowed",color:n||void 0,borderColor:r||void 0}})}),VZ=i=>({"&:disabled":Object.assign({},oK(i))}),ISe=i=>Object.assign({},VZ(i)),KO=i=>({"&:disabled":{cursor:"not-allowed",color:i.colorTextDisabled}}),kSe=i=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ISe(i)),{backgroundColor:i.colorBgContainer,borderColor:i.colorBorder,boxShadow:`0 ${i.controlOutlineWidth}px 0 ${i.controlTmpOutline}`}),Bp({color:i.colorPrimaryHover,borderColor:i.colorPrimaryHover},{color:i.colorPrimaryActive,borderColor:i.colorPrimaryActive})),jO(i.componentCls,i.colorBgContainer,i.colorBgContainer,i.colorTextDisabled,i.colorBorder)),{[`&${i.componentCls}-dangerous`]:Object.assign(Object.assign(Object.assign({color:i.colorError,borderColor:i.colorError},Bp({color:i.colorErrorHover,borderColor:i.colorErrorBorderHover},{color:i.colorErrorActive,borderColor:i.colorErrorActive})),jO(i.componentCls,i.colorError,i.colorError,i.colorTextDisabled,i.colorBorder)),VZ(i))}),b_t=i=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ISe(i)),{color:i.colorTextLightSolid,backgroundColor:i.colorPrimary,boxShadow:`0 ${i.controlOutlineWidth}px 0 ${i.controlOutline}`}),Bp({color:i.colorTextLightSolid,backgroundColor:i.colorPrimaryHover},{color:i.colorTextLightSolid,backgroundColor:i.colorPrimaryActive})),jO(i.componentCls,i.colorPrimary,i.colorPrimary,i.colorTextDisabled,i.colorBorder,{color:i.colorPrimaryHover,borderColor:i.colorPrimaryHover},{color:i.colorPrimaryActive,borderColor:i.colorPrimaryActive})),{[`&${i.componentCls}-dangerous`]:Object.assign(Object.assign(Object.assign({backgroundColor:i.colorError,boxShadow:`0 ${i.controlOutlineWidth}px 0 ${i.colorErrorOutline}`},Bp({backgroundColor:i.colorErrorHover},{backgroundColor:i.colorErrorActive})),jO(i.componentCls,i.colorError,i.colorError,i.colorTextDisabled,i.colorBorder,{color:i.colorErrorHover,borderColor:i.colorErrorHover},{color:i.colorErrorActive,borderColor:i.colorErrorActive})),VZ(i))}),C_t=i=>Object.assign(Object.assign({},kSe(i)),{borderStyle:"dashed"}),y_t=i=>Object.assign(Object.assign(Object.assign({color:i.colorLink},Bp({color:i.colorLinkHover},{color:i.colorLinkActive})),KO(i)),{[`&${i.componentCls}-dangerous`]:Object.assign(Object.assign({color:i.colorError},Bp({color:i.colorErrorHover},{color:i.colorErrorActive})),KO(i))}),w_t=i=>Object.assign(Object.assign(Object.assign({},Bp({color:i.colorText,backgroundColor:i.colorBgTextHover},{color:i.colorText,backgroundColor:i.colorBgTextActive})),KO(i)),{[`&${i.componentCls}-dangerous`]:Object.assign(Object.assign({color:i.colorError},KO(i)),Bp({color:i.colorErrorHover,backgroundColor:i.colorErrorBg},{color:i.colorErrorHover,backgroundColor:i.colorErrorBg}))}),S_t=i=>Object.assign(Object.assign({},oK(i)),{[`&${i.componentCls}:hover`]:Object.assign({},oK(i))}),x_t=i=>{const{componentCls:e}=i;return{[`${e}-default`]:kSe(i),[`${e}-primary`]:b_t(i),[`${e}-dashed`]:C_t(i),[`${e}-link`]:y_t(i),[`${e}-text`]:w_t(i),[`${e}-disabled`]:S_t(i)}},zZ=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const{componentCls:t,iconCls:n,controlHeight:r,fontSize:o,lineHeight:s,lineWidth:a,borderRadius:l,buttonPaddingHorizontal:c}=i,u=Math.max(0,(r-o*s)/2-a),d=c-a,h=`${t}-icon-only`;return[{[`${t}${e}`]:{fontSize:o,height:r,padding:`${u}px ${d}px`,borderRadius:l,[`&${h}`]:{width:r,paddingInlineStart:0,paddingInlineEnd:0,[`&${t}-round`]:{width:"auto"},"> span":{transform:"scale(1.143)"}},[`&${t}-loading`]:{opacity:i.opacityLoading,cursor:"default"},[`${t}-loading-icon`]:{transition:`width ${i.motionDurationSlow} ${i.motionEaseInOut}, opacity ${i.motionDurationSlow} ${i.motionEaseInOut}`},[`&:not(${h}) ${t}-loading-icon > ${n}`]:{marginInlineEnd:i.marginXS}}},{[`${t}${t}-circle${e}`]:v_t(i)},{[`${t}${t}-round${e}`]:__t(i)}]},L_t=i=>zZ(i),E_t=i=>{const e=Oi(i,{controlHeight:i.controlHeightSM,padding:i.paddingXS,buttonPaddingHorizontal:8,borderRadius:i.borderRadiusSM});return zZ(e,`${i.componentCls}-sm`)},D_t=i=>{const e=Oi(i,{controlHeight:i.controlHeightLG,fontSize:i.fontSizeLG,borderRadius:i.borderRadiusLG});return zZ(e,`${i.componentCls}-lg`)},I_t=i=>{const{componentCls:e}=i;return{[e]:{[`&${e}-block`]:{width:"100%"}}}},k_t=vo("Button",i=>{const{controlTmpOutline:e,paddingContentHorizontal:t}=i,n=Oi(i,{colorOutlineDefault:e,buttonPaddingHorizontal:t});return[m_t(n),E_t(n),L_t(n),D_t(n),I_t(n),x_t(n),u_t(n),M5(i),p_t(i)]});var T_t=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{loading:t=!1,prefixCls:n,type:r="default",danger:o,shape:s="default",size:a,disabled:l,className:c,rootClassName:u,children:d,icon:h,ghost:f=!1,block:g=!1,htmlType:p="button"}=i,v=T_t(i,["loading","prefixCls","type","danger","shape","size","disabled","className","rootClassName","children","icon","ghost","block","htmlType"]),{getPrefixCls:m,autoInsertSpaceInButton:_,direction:y}=C.useContext(Rn),S=m("btn",n),[L,E]=k_t(S),D=C.useContext(Rh),k=C.useContext($_),T=l??k,M=C.useContext(DSe),A=C.useMemo(()=>N_t(t),[t]),[N,R]=C.useState(A.loading),[F,W]=C.useState(!1),H=e||C.createRef(),G=()=>C.Children.count(d)===1&&!h&&!p7(r),U=()=>{if(!H||!H.current||_===!1)return;const Se=H.current.textContent;G()&&rK(Se)?F||W(!0):F&&W(!1)};C.useEffect(()=>{let Se=null;A.delay>0?Se=window.setTimeout(()=>{Se=null,R(!0)},A.delay):R(A.loading);function Ne(){Se&&(window.clearTimeout(Se),Se=null)}return Ne},[A]),C.useEffect(U,[H]);const K=Se=>{const{onClick:Ne}=i;if(N||T){Se.preventDefault();return}Ne==null||Ne(Se)},re=_!==!1,{compactSize:Y,compactItemClassnames:J}=QS(S,y),Q={large:"lg",small:"sm",middle:void 0},ue=Y||M||a||D,de=ue&&Q[ue]||"",_e=N?"loading":h,ve=ll(v,["navigate"]),Ve=ve.href!==void 0&&T,Ze=xe(S,E,{[`${S}-${s}`]:s!=="default"&&s,[`${S}-${r}`]:r,[`${S}-${de}`]:de,[`${S}-icon-only`]:!d&&d!==0&&!!_e,[`${S}-background-ghost`]:f&&!p7(r),[`${S}-loading`]:N,[`${S}-two-chinese-chars`]:F&&re&&!N,[`${S}-block`]:g,[`${S}-dangerous`]:!!o,[`${S}-rtl`]:y==="rtl",[`${S}-disabled`]:Ve},J,c,u),We=h&&!N?h:C.createElement(n_t,{existIcon:!!h,prefixCls:S,loading:!!N}),pe=d||d===0?l_t(d,G()&&re):null;if(ve.href!==void 0)return L(C.createElement("a",Object.assign({},ve,{className:Ze,onClick:K,ref:H}),We,pe));let Pe=C.createElement("button",Object.assign({},v,{type:p,className:Ze,onClick:K,disabled:T,ref:H}),We,pe);return p7(r)||(Pe=C.createElement(qvt,{disabled:!!N},Pe)),L(Pe)},UZ=C.forwardRef(R_t);UZ.Group=o_t;UZ.__ANT_BUTTON=!0;const Ju=UZ;function Fce(i){return!!(i&&i.then)}const M_t=i=>{const{type:e,children:t,prefixCls:n,buttonProps:r,close:o,autoFocus:s,emitEvent:a,quitOnNullishReturnValue:l,actionFn:c}=i,u=C.useRef(!1),d=C.useRef(null),[h,f]=Av(!1),g=function(){o==null||o.apply(void 0,arguments)};C.useEffect(()=>{let m=null;return s&&(m=setTimeout(()=>{var _;(_=d.current)===null||_===void 0||_.focus()})),()=>{m&&clearTimeout(m)}},[]);const p=m=>{Fce(m)&&(f(!0),m.then(function(){f(!1,!0),g.apply(void 0,arguments),u.current=!1},_=>(f(!1,!0),u.current=!1,Promise.reject(_))))},v=m=>{if(u.current)return;if(u.current=!0,!c){g();return}let _;if(a){if(_=c(m),l&&!Fce(_)){u.current=!1,g(m);return}}else if(c.length)_=c(o),u.current=!1;else if(_=c(),!_){g();return}p(_)};return C.createElement(Ju,Object.assign({},TSe(e),{onClick:v,loading:h,prefixCls:n},r,{ref:d}),t)},Bce=M_t,m7=()=>({height:0,opacity:0}),Wce=i=>{const{scrollHeight:e}=i;return{height:e,opacity:1}},A_t=i=>({height:i?i.offsetHeight:0}),v7=(i,e)=>(e==null?void 0:e.deadline)===!0||e.propertyName==="height",NSe=function(){return{motionName:`${arguments.length>0&&arguments[0]!==void 0?arguments[0]:"ant"}-motion-collapse`,onAppearStart:m7,onEnterStart:m7,onAppearActive:Wce,onEnterActive:Wce,onLeaveStart:A_t,onLeaveActive:m7,onAppearEnd:v7,onEnterEnd:v7,onLeaveEnd:v7,motionDeadline:500}},P_t=i=>i!==void 0&&(i==="topLeft"||i==="topRight")?"slide-down":"slide-up",nC=(i,e,t)=>t!==void 0?t:`${i}-${e}`;var RSe=C.createContext(null),br=Zs()?C.useLayoutEffect:C.useEffect,GE=function(e,t){var n=C.useRef(!0);br(function(){if(!n.current)return e()},t),br(function(){return n.current=!1,function(){n.current=!0}},[])},$ce=[];function O_t(i,e){var t=C.useState(function(){if(!Zs())return null;var g=document.createElement("div");return g}),n=Ae(t,1),r=n[0],o=C.useRef(!1),s=C.useContext(RSe),a=C.useState($ce),l=Ae(a,2),c=l[0],u=l[1],d=s||(o.current?void 0:function(g){u(function(p){var v=[g].concat(ft(p));return v})});function h(){r.parentElement||document.body.appendChild(r),o.current=!0}function f(){var g;(g=r.parentElement)===null||g===void 0||g.removeChild(r),o.current=!1}return br(function(){return i?s?s(h):h():f(),f},[i]),br(function(){c.length&&(c.forEach(function(g){return g()}),u($ce))},[c]),[r,d]}var _7;function GO(i){if(typeof document>"u")return 0;if(i||_7===void 0){var e=document.createElement("div");e.style.width="100%",e.style.height="200px";var t=document.createElement("div"),n=t.style;n.position="absolute",n.top="0",n.left="0",n.pointerEvents="none",n.visibility="hidden",n.width="200px",n.height="150px",n.overflow="hidden",t.appendChild(e),document.body.appendChild(t);var r=e.offsetWidth;t.style.overflow="scroll";var o=e.offsetWidth;r===o&&(o=t.clientWidth),document.body.removeChild(t),_7=r-o}return _7}function Hce(i){var e=i.match(/^(.*)px$/),t=Number(e==null?void 0:e[1]);return Number.isNaN(t)?GO():t}function Vce(i){if(typeof document>"u"||!i||!(i instanceof Element))return{width:0,height:0};var e=getComputedStyle(i,"::-webkit-scrollbar"),t=e.width,n=e.height;return{width:Hce(t),height:Hce(n)}}function F_t(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var B_t="rc-util-locker-".concat(Date.now()),zce=0;function W_t(i){var e=!!i,t=C.useState(function(){return zce+=1,"".concat(B_t,"_").concat(zce)}),n=Ae(t,1),r=n[0];br(function(){if(e){var o=GO(),s=F_t();uS(` html body { overflow-y: hidden; `.concat(s?"width: calc(100% - ".concat(o,"px);"):"",` -}`),r)}else PO(r);return function(){PO(r)}},[e,r])}var Uce=!1;function $_t(i){return typeof i=="boolean"&&(Uce=i),Uce}var jce=function(e){return e===!1?!1:!Zs()||!e?null:typeof e=="string"?document.querySelector(e):typeof e=="function"?e():e},jZ=C.forwardRef(function(i,e){var t=i.open,n=i.autoLock,r=i.getContainer;i.debug;var o=i.autoDestroy,s=o===void 0?!0:o,a=i.children,l=C.useState(t),c=Ae(l,2),u=c[0],d=c[1],h=u||t;C.useEffect(function(){(s||t)&&d(t)},[t,s]);var f=C.useState(function(){return jce(r)}),g=Ae(f,2),p=g[0],v=g[1];C.useEffect(function(){var A=jce(r);v(A??null)});var m=O_t(h&&!p),_=Ae(m,2),y=_[0],S=_[1],L=p??y;W_t(n&&t&&Zs()&&(L===y||L===document.body));var E=null;if(a&&$_(a)&&e){var D=a;E=D.ref}var k=x5(E,e);if(!h||!Zs()||p===void 0)return null;var T=L===!1||$_t(),M=a;return e&&(M=C.cloneElement(a,{ref:k})),C.createElement(RSe.Provider,{value:S},T?M:sh.createPortal(M,L))});function H_t(){var i=te({},she);return i.useId}var Kce=0;function MSe(i){var e=C.useState("ssr-id"),t=Ae(e,2),n=t[0],r=t[1],o=H_t(),s=o==null?void 0:o();return C.useEffect(function(){if(!o){var a=Kce;Kce+=1,r("rc_unique_".concat(a))}},[]),i||s||n}var V_t=`accept acceptCharset accessKey action allowFullScreen allowTransparency +}`),r)}else PO(r);return function(){PO(r)}},[e,r])}var Uce=!1;function $_t(i){return typeof i=="boolean"&&(Uce=i),Uce}var jce=function(e){return e===!1?!1:!Zs()||!e?null:typeof e=="string"?document.querySelector(e):typeof e=="function"?e():e},jZ=C.forwardRef(function(i,e){var t=i.open,n=i.autoLock,r=i.getContainer;i.debug;var o=i.autoDestroy,s=o===void 0?!0:o,a=i.children,l=C.useState(t),c=Ae(l,2),u=c[0],d=c[1],h=u||t;C.useEffect(function(){(s||t)&&d(t)},[t,s]);var f=C.useState(function(){return jce(r)}),g=Ae(f,2),p=g[0],v=g[1];C.useEffect(function(){var A=jce(r);v(A??null)});var m=O_t(h&&!p),_=Ae(m,2),y=_[0],S=_[1],L=p??y;W_t(n&&t&&Zs()&&(L===y||L===document.body));var E=null;if(a&&W_(a)&&e){var D=a;E=D.ref}var k=x5(E,e);if(!h||!Zs()||p===void 0)return null;var T=L===!1||$_t(),M=a;return e&&(M=C.cloneElement(a,{ref:k})),C.createElement(RSe.Provider,{value:S},T?M:sh.createPortal(M,L))});function H_t(){var i=te({},she);return i.useId}var Kce=0;function MSe(i){var e=C.useState("ssr-id"),t=Ae(e,2),n=t[0],r=t[1],o=H_t(),s=o==null?void 0:o();return C.useEffect(function(){if(!o){var a=Kce;Kce+=1,r("rc_unique_".concat(a))}},[]),i||s||n}var V_t=`accept acceptCharset accessKey action allowFullScreen allowTransparency alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge charSet checked classID className colSpan cols content contentEditable contextMenu controls coords crossOrigin data dateTime default defer dir disabled download draggable @@ -962,7 +962,7 @@ html body { onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata - onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,U_t="".concat(V_t," ").concat(z_t).split(/[\s\n]+/),j_t="aria-",K_t="data-";function Gce(i,e){return i.indexOf(e)===0}function Bp(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t;e===!1?t={aria:!0,data:!0,attr:!0}:e===!0?t={aria:!0}:t=te({},e);var n={};return Object.keys(i).forEach(function(r){(t.aria&&(r==="role"||Gce(r,j_t))||t.data&&Gce(r,K_t)||t.attr&&U_t.includes(r))&&(n[r]=i[r])}),n}function qce(i,e,t){var n=e;return!n&&t&&(n="".concat(i,"-").concat(t)),n}function Xce(i,e){var t=i["page".concat(e?"Y":"X","Offset")],n="scroll".concat(e?"Top":"Left");if(typeof t!="number"){var r=i.document;t=r.documentElement[n],typeof t!="number"&&(t=r.body[n])}return t}function G_t(i){var e=i.getBoundingClientRect(),t={left:e.left,top:e.top},n=i.ownerDocument,r=n.defaultView||n.parentWindow;return t.left+=Xce(r),t.top+=Xce(r,!0),t}const q_t=C.memo(function(i){var e=i.children;return e},function(i,e){var t=e.shouldUpdate;return!t});var Yce={width:0,height:0,overflow:"hidden",outline:"none"},ASe=$e.forwardRef(function(i,e){var t=i.prefixCls,n=i.className,r=i.style,o=i.title,s=i.ariaId,a=i.footer,l=i.closable,c=i.closeIcon,u=i.onClose,d=i.children,h=i.bodyStyle,f=i.bodyProps,g=i.modalRender,p=i.onMouseDown,v=i.onMouseUp,m=i.holderRef,_=i.visible,y=i.forceRender,S=i.width,L=i.height,E=C.useRef(),D=C.useRef();$e.useImperativeHandle(e,function(){return{focus:function(){var F;(F=E.current)===null||F===void 0||F.focus()},changeActive:function(F){var W=document,H=W.activeElement;F&&H===D.current?E.current.focus():!F&&H===E.current&&D.current.focus()}}});var k={};S!==void 0&&(k.width=S),L!==void 0&&(k.height=L);var T;a&&(T=$e.createElement("div",{className:"".concat(t,"-footer")},a));var M;o&&(M=$e.createElement("div",{className:"".concat(t,"-header")},$e.createElement("div",{className:"".concat(t,"-title"),id:s},o)));var A;l&&(A=$e.createElement("button",{type:"button",onClick:u,"aria-label":"Close",className:"".concat(t,"-close")},c||$e.createElement("span",{className:"".concat(t,"-close-x")})));var N=$e.createElement("div",{className:"".concat(t,"-content")},A,M,$e.createElement("div",St({className:"".concat(t,"-body"),style:h},f),d),T);return $e.createElement("div",{key:"dialog-element",role:"dialog","aria-labelledby":o?s:null,"aria-modal":"true",ref:m,style:te(te({},r),k),className:xe(t,n),onMouseDown:p,onMouseUp:v},$e.createElement("div",{tabIndex:0,ref:E,style:Yce,"aria-hidden":"true"}),$e.createElement(q_t,{shouldUpdate:_||y},g?g(N):N),$e.createElement("div",{tabIndex:0,ref:D,style:Yce,"aria-hidden":"true"}))}),PSe=C.forwardRef(function(i,e){var t=i.prefixCls,n=i.title,r=i.style,o=i.className,s=i.visible,a=i.forceRender,l=i.destroyOnClose,c=i.motionName,u=i.ariaId,d=i.onVisibleChanged,h=i.mousePosition,f=C.useRef(),g=C.useState(),p=Ae(g,2),v=p[0],m=p[1],_={};v&&(_.transformOrigin=v);function y(){var S=G_t(f.current);m(h?"".concat(h.x-S.left,"px ").concat(h.y-S.top,"px"):"")}return C.createElement(fd,{visible:s,onVisibleChanged:d,onAppearPrepare:y,onEnterPrepare:y,forceRender:a,motionName:c,removeOnLeave:l,ref:f},function(S,L){var E=S.className,D=S.style;return C.createElement(ASe,St({},i,{ref:e,title:n,ariaId:u,prefixCls:t,holderRef:L,style:te(te(te({},D),r),_),className:xe(o,E)}))})});PSe.displayName="Content";function X_t(i){var e=i.prefixCls,t=i.style,n=i.visible,r=i.maskProps,o=i.motionName;return C.createElement(fd,{key:"mask",visible:n,motionName:o,leavedClassName:"".concat(e,"-mask-hidden")},function(s,a){var l=s.className,c=s.style;return C.createElement("div",St({ref:a,style:te(te({},c),t),className:xe("".concat(e,"-mask"),l)},r))})}function Y_t(i){var e=i.prefixCls,t=e===void 0?"rc-dialog":e,n=i.zIndex,r=i.visible,o=r===void 0?!1:r,s=i.keyboard,a=s===void 0?!0:s,l=i.focusTriggerAfterClose,c=l===void 0?!0:l,u=i.wrapStyle,d=i.wrapClassName,h=i.wrapProps,f=i.onClose,g=i.afterOpenChange,p=i.afterClose,v=i.transitionName,m=i.animation,_=i.closable,y=_===void 0?!0:_,S=i.mask,L=S===void 0?!0:S,E=i.maskTransitionName,D=i.maskAnimation,k=i.maskClosable,T=k===void 0?!0:k,M=i.maskStyle,A=i.maskProps,N=i.rootClassName,R=C.useRef(),F=C.useRef(),W=C.useRef(),H=C.useState(o),G=Ae(H,2),U=G[0],K=G[1],re=MSe();function Y(){gb(F.current,document.activeElement)||(R.current=document.activeElement)}function J(){if(!gb(F.current,document.activeElement)){var pe;(pe=W.current)===null||pe===void 0||pe.focus()}}function Q(pe){if(pe)J();else{if(K(!1),L&&R.current&&c){try{R.current.focus({preventScroll:!0})}catch{}R.current=null}U&&(p==null||p())}g==null||g(pe)}function ue(pe){f==null||f(pe)}var de=C.useRef(!1),_e=C.useRef(),ve=function(){clearTimeout(_e.current),de.current=!0},Ve=function(){_e.current=setTimeout(function(){de.current=!1})},Ze=null;T&&(Ze=function(Pe){de.current?de.current=!1:F.current===Pe.target&&ue(Pe)});function We(pe){if(a&&pe.keyCode===vt.ESC){pe.stopPropagation(),ue(pe);return}o&&pe.keyCode===vt.TAB&&W.current.changeActive(!pe.shiftKey)}return C.useEffect(function(){o&&(K(!0),Y())},[o]),C.useEffect(function(){return function(){clearTimeout(_e.current)}},[]),C.createElement("div",St({className:xe("".concat(t,"-root"),N)},Bp(i,{data:!0})),C.createElement(X_t,{prefixCls:t,visible:L&&o,motionName:qce(t,E,D),style:te({zIndex:n},M),maskProps:A}),C.createElement("div",St({tabIndex:-1,onKeyDown:We,className:xe("".concat(t,"-wrap"),d),ref:F,onClick:Ze,style:te(te({zIndex:n},u),{},{display:U?null:"none"})},h),C.createElement(PSe,St({},i,{onMouseDown:ve,onMouseUp:Ve,ref:W,closable:y,ariaId:re,prefixCls:t,visible:o&&U,onClose:ue,onVisibleChanged:Q,motionName:qce(t,v,m)}))))}var OSe=function(e){var t=e.visible,n=e.getContainer,r=e.forceRender,o=e.destroyOnClose,s=o===void 0?!1:o,a=e.afterClose,l=C.useState(t),c=Ae(l,2),u=c[0],d=c[1];return C.useEffect(function(){t&&d(!0)},[t]),!r&&s&&!u?null:C.createElement(jZ,{open:t||r||u,autoDestroy:!1,getContainer:n,autoLock:t||u},C.createElement(Y_t,St({},e,{destroyOnClose:s,afterClose:function(){a==null||a(),d(!1)}})))};OSe.displayName="Dialog";const Zf=C.createContext({}),ck=i=>{let{children:e,status:t,override:n}=i;const r=C.useContext(Zf),o=C.useMemo(()=>{const s=Object.assign({},r);return n&&delete s.isFormItemInput,t&&(delete s.status,delete s.hasFeedback,delete s.feedbackIcon),s},[t,n,r]);return C.createElement(Zf.Provider,{value:o},e)};var FSe=function(e){if(Zs()&&window.document.documentElement){var t=Array.isArray(e)?e:[e],n=window.document.documentElement;return t.some(function(r){return r in n.style})}return!1},Z_t=function(e,t){if(!FSe(e))return!1;var n=document.createElement("div"),r=n.style[e];return n.style[e]=t,n.style[e]!==r};function Q_t(i,e){return!Array.isArray(i)&&e!==void 0?Z_t(i,e):FSe(i)}const BSe=()=>Zs()&&window.document.documentElement;let N2;const J_t=()=>{if(!BSe())return!1;if(N2!==void 0)return N2;const i=document.createElement("div");return i.style.display="flex",i.style.flexDirection="column",i.style.rowGap="1px",i.appendChild(document.createElement("div")),i.appendChild(document.createElement("div")),document.body.appendChild(i),N2=i.scrollHeight===1,document.body.removeChild(i),N2},e0t=i=>({animationDuration:i,animationFillMode:"both"}),t0t=i=>({animationDuration:i,animationFillMode:"both"}),A5=function(i,e,t,n){const o=(arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1)?"&":"";return{[` + onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,U_t="".concat(V_t," ").concat(z_t).split(/[\s\n]+/),j_t="aria-",K_t="data-";function Gce(i,e){return i.indexOf(e)===0}function Wp(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t;e===!1?t={aria:!0,data:!0,attr:!0}:e===!0?t={aria:!0}:t=te({},e);var n={};return Object.keys(i).forEach(function(r){(t.aria&&(r==="role"||Gce(r,j_t))||t.data&&Gce(r,K_t)||t.attr&&U_t.includes(r))&&(n[r]=i[r])}),n}function qce(i,e,t){var n=e;return!n&&t&&(n="".concat(i,"-").concat(t)),n}function Xce(i,e){var t=i["page".concat(e?"Y":"X","Offset")],n="scroll".concat(e?"Top":"Left");if(typeof t!="number"){var r=i.document;t=r.documentElement[n],typeof t!="number"&&(t=r.body[n])}return t}function G_t(i){var e=i.getBoundingClientRect(),t={left:e.left,top:e.top},n=i.ownerDocument,r=n.defaultView||n.parentWindow;return t.left+=Xce(r),t.top+=Xce(r,!0),t}const q_t=C.memo(function(i){var e=i.children;return e},function(i,e){var t=e.shouldUpdate;return!t});var Yce={width:0,height:0,overflow:"hidden",outline:"none"},ASe=$e.forwardRef(function(i,e){var t=i.prefixCls,n=i.className,r=i.style,o=i.title,s=i.ariaId,a=i.footer,l=i.closable,c=i.closeIcon,u=i.onClose,d=i.children,h=i.bodyStyle,f=i.bodyProps,g=i.modalRender,p=i.onMouseDown,v=i.onMouseUp,m=i.holderRef,_=i.visible,y=i.forceRender,S=i.width,L=i.height,E=C.useRef(),D=C.useRef();$e.useImperativeHandle(e,function(){return{focus:function(){var F;(F=E.current)===null||F===void 0||F.focus()},changeActive:function(F){var W=document,H=W.activeElement;F&&H===D.current?E.current.focus():!F&&H===E.current&&D.current.focus()}}});var k={};S!==void 0&&(k.width=S),L!==void 0&&(k.height=L);var T;a&&(T=$e.createElement("div",{className:"".concat(t,"-footer")},a));var M;o&&(M=$e.createElement("div",{className:"".concat(t,"-header")},$e.createElement("div",{className:"".concat(t,"-title"),id:s},o)));var A;l&&(A=$e.createElement("button",{type:"button",onClick:u,"aria-label":"Close",className:"".concat(t,"-close")},c||$e.createElement("span",{className:"".concat(t,"-close-x")})));var N=$e.createElement("div",{className:"".concat(t,"-content")},A,M,$e.createElement("div",St({className:"".concat(t,"-body"),style:h},f),d),T);return $e.createElement("div",{key:"dialog-element",role:"dialog","aria-labelledby":o?s:null,"aria-modal":"true",ref:m,style:te(te({},r),k),className:xe(t,n),onMouseDown:p,onMouseUp:v},$e.createElement("div",{tabIndex:0,ref:E,style:Yce,"aria-hidden":"true"}),$e.createElement(q_t,{shouldUpdate:_||y},g?g(N):N),$e.createElement("div",{tabIndex:0,ref:D,style:Yce,"aria-hidden":"true"}))}),PSe=C.forwardRef(function(i,e){var t=i.prefixCls,n=i.title,r=i.style,o=i.className,s=i.visible,a=i.forceRender,l=i.destroyOnClose,c=i.motionName,u=i.ariaId,d=i.onVisibleChanged,h=i.mousePosition,f=C.useRef(),g=C.useState(),p=Ae(g,2),v=p[0],m=p[1],_={};v&&(_.transformOrigin=v);function y(){var S=G_t(f.current);m(h?"".concat(h.x-S.left,"px ").concat(h.y-S.top,"px"):"")}return C.createElement(fd,{visible:s,onVisibleChanged:d,onAppearPrepare:y,onEnterPrepare:y,forceRender:a,motionName:c,removeOnLeave:l,ref:f},function(S,L){var E=S.className,D=S.style;return C.createElement(ASe,St({},i,{ref:e,title:n,ariaId:u,prefixCls:t,holderRef:L,style:te(te(te({},D),r),_),className:xe(o,E)}))})});PSe.displayName="Content";function X_t(i){var e=i.prefixCls,t=i.style,n=i.visible,r=i.maskProps,o=i.motionName;return C.createElement(fd,{key:"mask",visible:n,motionName:o,leavedClassName:"".concat(e,"-mask-hidden")},function(s,a){var l=s.className,c=s.style;return C.createElement("div",St({ref:a,style:te(te({},c),t),className:xe("".concat(e,"-mask"),l)},r))})}function Y_t(i){var e=i.prefixCls,t=e===void 0?"rc-dialog":e,n=i.zIndex,r=i.visible,o=r===void 0?!1:r,s=i.keyboard,a=s===void 0?!0:s,l=i.focusTriggerAfterClose,c=l===void 0?!0:l,u=i.wrapStyle,d=i.wrapClassName,h=i.wrapProps,f=i.onClose,g=i.afterOpenChange,p=i.afterClose,v=i.transitionName,m=i.animation,_=i.closable,y=_===void 0?!0:_,S=i.mask,L=S===void 0?!0:S,E=i.maskTransitionName,D=i.maskAnimation,k=i.maskClosable,T=k===void 0?!0:k,M=i.maskStyle,A=i.maskProps,N=i.rootClassName,R=C.useRef(),F=C.useRef(),W=C.useRef(),H=C.useState(o),G=Ae(H,2),U=G[0],K=G[1],re=MSe();function Y(){fb(F.current,document.activeElement)||(R.current=document.activeElement)}function J(){if(!fb(F.current,document.activeElement)){var pe;(pe=W.current)===null||pe===void 0||pe.focus()}}function Q(pe){if(pe)J();else{if(K(!1),L&&R.current&&c){try{R.current.focus({preventScroll:!0})}catch{}R.current=null}U&&(p==null||p())}g==null||g(pe)}function ue(pe){f==null||f(pe)}var de=C.useRef(!1),_e=C.useRef(),ve=function(){clearTimeout(_e.current),de.current=!0},Ve=function(){_e.current=setTimeout(function(){de.current=!1})},Ze=null;T&&(Ze=function(Pe){de.current?de.current=!1:F.current===Pe.target&&ue(Pe)});function We(pe){if(a&&pe.keyCode===vt.ESC){pe.stopPropagation(),ue(pe);return}o&&pe.keyCode===vt.TAB&&W.current.changeActive(!pe.shiftKey)}return C.useEffect(function(){o&&(K(!0),Y())},[o]),C.useEffect(function(){return function(){clearTimeout(_e.current)}},[]),C.createElement("div",St({className:xe("".concat(t,"-root"),N)},Wp(i,{data:!0})),C.createElement(X_t,{prefixCls:t,visible:L&&o,motionName:qce(t,E,D),style:te({zIndex:n},M),maskProps:A}),C.createElement("div",St({tabIndex:-1,onKeyDown:We,className:xe("".concat(t,"-wrap"),d),ref:F,onClick:Ze,style:te(te({zIndex:n},u),{},{display:U?null:"none"})},h),C.createElement(PSe,St({},i,{onMouseDown:ve,onMouseUp:Ve,ref:W,closable:y,ariaId:re,prefixCls:t,visible:o&&U,onClose:ue,onVisibleChanged:Q,motionName:qce(t,v,m)}))))}var OSe=function(e){var t=e.visible,n=e.getContainer,r=e.forceRender,o=e.destroyOnClose,s=o===void 0?!1:o,a=e.afterClose,l=C.useState(t),c=Ae(l,2),u=c[0],d=c[1];return C.useEffect(function(){t&&d(!0)},[t]),!r&&s&&!u?null:C.createElement(jZ,{open:t||r||u,autoDestroy:!1,getContainer:n,autoLock:t||u},C.createElement(Y_t,St({},e,{destroyOnClose:s,afterClose:function(){a==null||a(),d(!1)}})))};OSe.displayName="Dialog";const Zf=C.createContext({}),ck=i=>{let{children:e,status:t,override:n}=i;const r=C.useContext(Zf),o=C.useMemo(()=>{const s=Object.assign({},r);return n&&delete s.isFormItemInput,t&&(delete s.status,delete s.hasFeedback,delete s.feedbackIcon),s},[t,n,r]);return C.createElement(Zf.Provider,{value:o},e)};var FSe=function(e){if(Zs()&&window.document.documentElement){var t=Array.isArray(e)?e:[e],n=window.document.documentElement;return t.some(function(r){return r in n.style})}return!1},Z_t=function(e,t){if(!FSe(e))return!1;var n=document.createElement("div"),r=n.style[e];return n.style[e]=t,n.style[e]!==r};function Q_t(i,e){return!Array.isArray(i)&&e!==void 0?Z_t(i,e):FSe(i)}const BSe=()=>Zs()&&window.document.documentElement;let N2;const J_t=()=>{if(!BSe())return!1;if(N2!==void 0)return N2;const i=document.createElement("div");return i.style.display="flex",i.style.flexDirection="column",i.style.rowGap="1px",i.appendChild(document.createElement("div")),i.appendChild(document.createElement("div")),document.body.appendChild(i),N2=i.scrollHeight===1,document.body.removeChild(i),N2},e0t=i=>({animationDuration:i,animationFillMode:"both"}),t0t=i=>({animationDuration:i,animationFillMode:"both"}),A5=function(i,e,t,n){const o=(arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1)?"&":"";return{[` ${o}${i}-enter, ${o}${i}-appear `]:Object.assign(Object.assign({},e0t(n)),{animationPlayState:"paused"}),[`${o}${i}-leave`]:Object.assign(Object.assign({},t0t(n)),{animationPlayState:"paused"}),[` @@ -985,15 +985,15 @@ html body { opacity ${i.motionDurationMid} ${i.motionEaseInOut} !important`}}}),WSe=T0t;function Jce(i){return{position:i,top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0}}const N0t=i=>{const{componentCls:e,antCls:t}=i;return[{[`${e}-root`]:{[`${e}${t}-zoom-enter, ${e}${t}-zoom-appear`]:{transform:"none",opacity:0,animationDuration:i.motionDurationSlow,userSelect:"none"},[`${e}${t}-zoom-leave ${e}-content`]:{pointerEvents:"none"},[`${e}-mask`]:Object.assign(Object.assign({},Jce("fixed")),{zIndex:i.zIndexPopupBase,height:"100%",backgroundColor:i.colorBgMask,[`${e}-hidden`]:{display:"none"}}),[`${e}-wrap`]:Object.assign(Object.assign({},Jce("fixed")),{overflow:"auto",outline:0,WebkitOverflowScrolling:"touch"})}},{[`${e}-root`]:r0t(i)}]},R0t=i=>{const{componentCls:e}=i;return[{[`${e}-root`]:{[`${e}-wrap`]:{zIndex:i.zIndexPopupBase,position:"fixed",inset:0,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch"},[`${e}-wrap-rtl`]:{direction:"rtl"},[`${e}-centered`]:{textAlign:"center","&::before":{display:"inline-block",width:0,height:"100%",verticalAlign:"middle",content:'""'},[e]:{top:0,display:"inline-block",paddingBottom:0,textAlign:"start",verticalAlign:"middle"}},[`@media (max-width: ${i.screenSMMax})`]:{[e]:{maxWidth:"calc(100vw - 16px)",margin:`${i.marginXS} auto`},[`${e}-centered`]:{[e]:{flex:1}}}}},{[e]:Object.assign(Object.assign({},Wr(i)),{pointerEvents:"none",position:"relative",top:100,width:"auto",maxWidth:`calc(100vw - ${i.margin*2}px)`,margin:"0 auto",paddingBottom:i.paddingLG,[`${e}-title`]:{margin:0,color:i.modalHeadingColor,fontWeight:i.fontWeightStrong,fontSize:i.modalHeaderTitleFontSize,lineHeight:i.modalHeaderTitleLineHeight,wordWrap:"break-word"},[`${e}-content`]:{position:"relative",backgroundColor:i.modalContentBg,backgroundClip:"padding-box",border:0,borderRadius:i.borderRadiusLG,boxShadow:i.boxShadow,pointerEvents:"auto",padding:`${i.paddingMD}px ${i.paddingContentHorizontalLG}px`},[`${e}-close`]:Object.assign({position:"absolute",top:(i.modalHeaderCloseSize-i.modalCloseBtnSize)/2,insetInlineEnd:(i.modalHeaderCloseSize-i.modalCloseBtnSize)/2,zIndex:i.zIndexPopupBase+10,padding:0,color:i.modalCloseColor,fontWeight:i.fontWeightStrong,lineHeight:1,textDecoration:"none",background:"transparent",borderRadius:i.borderRadiusSM,width:i.modalConfirmIconSize,height:i.modalConfirmIconSize,border:0,outline:0,cursor:"pointer",transition:`color ${i.motionDurationMid}, background-color ${i.motionDurationMid}`,"&-x":{display:"block",fontSize:i.fontSizeLG,fontStyle:"normal",lineHeight:`${i.modalCloseBtnSize}px`,textAlign:"center",textTransform:"none",textRendering:"auto"},"&:hover":{color:i.modalIconHoverColor,backgroundColor:i.wireframe?"transparent":i.colorFillContent,textDecoration:"none"},"&:active":{backgroundColor:i.wireframe?"transparent":i.colorFillContentHover}},lk(i)),[`${e}-header`]:{color:i.colorText,background:i.modalHeaderBg,borderRadius:`${i.borderRadiusLG}px ${i.borderRadiusLG}px 0 0`,marginBottom:i.marginXS},[`${e}-body`]:{fontSize:i.fontSize,lineHeight:i.lineHeight,wordWrap:"break-word"},[`${e}-footer`]:{textAlign:"end",background:i.modalFooterBg,marginTop:i.marginSM,[`${i.antCls}-btn + ${i.antCls}-btn:not(${i.antCls}-dropdown-trigger)`]:{marginBottom:0,marginInlineStart:i.marginXS}},[`${e}-open`]:{overflow:"hidden"}})},{[`${e}-pure-panel`]:{top:"auto",padding:0,display:"flex",flexDirection:"column",[`${e}-content, ${e}-body, ${e}-confirm-body-wrapper`]:{display:"flex",flexDirection:"column",flex:"auto"},[`${e}-confirm-body`]:{marginBottom:"auto"}}}]},M0t=i=>{const{componentCls:e}=i,t=`${e}-confirm`;return{[t]:{"&-rtl":{direction:"rtl"},[`${i.antCls}-modal-header`]:{display:"none"},[`${t}-body-wrapper`]:Object.assign({},ak()),[`${t}-body`]:{display:"flex",flexWrap:"wrap",alignItems:"center",[`${t}-title`]:{flex:"0 0 100%",display:"block",overflow:"hidden",color:i.colorTextHeading,fontWeight:i.fontWeightStrong,fontSize:i.modalHeaderTitleFontSize,lineHeight:i.modalHeaderTitleLineHeight,[`+ ${t}-content`]:{marginBlockStart:i.marginXS,flexBasis:"100%",maxWidth:`calc(100% - ${i.modalConfirmIconSize+i.marginSM}px)`}},[`${t}-content`]:{color:i.colorText,fontSize:i.fontSize},[`> ${i.iconCls}`]:{flex:"none",marginInlineEnd:i.marginSM,fontSize:i.modalConfirmIconSize,[`+ ${t}-title`]:{flex:1},[`+ ${t}-title + ${t}-content`]:{marginInlineStart:i.modalConfirmIconSize+i.marginSM}}},[`${t}-btns`]:{textAlign:"end",marginTop:i.marginSM,[`${i.antCls}-btn + ${i.antCls}-btn`]:{marginBottom:0,marginInlineStart:i.marginXS}}},[`${t}-error ${t}-body > ${i.iconCls}`]:{color:i.colorError},[`${t}-warning ${t}-body > ${i.iconCls}, - ${t}-confirm ${t}-body > ${i.iconCls}`]:{color:i.colorWarning},[`${t}-info ${t}-body > ${i.iconCls}`]:{color:i.colorInfo},[`${t}-success ${t}-body > ${i.iconCls}`]:{color:i.colorSuccess}}},A0t=i=>{const{componentCls:e}=i;return{[`${e}-root`]:{[`${e}-wrap-rtl`]:{direction:"rtl",[`${e}-confirm-body`]:{direction:"rtl"}}}}},P0t=i=>{const{componentCls:e,antCls:t}=i,n=`${e}-confirm`;return{[e]:{[`${e}-content`]:{padding:0},[`${e}-header`]:{padding:i.modalHeaderPadding,borderBottom:`${i.modalHeaderBorderWidth}px ${i.modalHeaderBorderStyle} ${i.modalHeaderBorderColorSplit}`,marginBottom:0},[`${e}-body`]:{padding:i.modalBodyPadding},[`${e}-footer`]:{padding:`${i.modalFooterPaddingVertical}px ${i.modalFooterPaddingHorizontal}px`,borderTop:`${i.modalFooterBorderWidth}px ${i.modalFooterBorderStyle} ${i.modalFooterBorderColorSplit}`,borderRadius:`0 0 ${i.borderRadiusLG}px ${i.borderRadiusLG}px`,marginTop:0}},[n]:{[`${t}-modal-body`]:{padding:`${i.padding*2}px ${i.padding*2}px ${i.paddingLG}px`},[`${n}-body`]:{[`> ${i.iconCls}`]:{marginInlineEnd:i.margin,[`+ ${n}-title + ${n}-content`]:{marginInlineStart:i.modalConfirmIconSize+i.margin}}},[`${n}-btns`]:{marginTop:i.marginLG}}}},$Se=vo("Modal",i=>{const e=i.padding,t=i.fontSizeHeading5,n=i.lineHeightHeading5,r=Oi(i,{modalBodyPadding:i.paddingLG,modalHeaderBg:i.colorBgElevated,modalHeaderPadding:`${e}px ${i.paddingLG}px`,modalHeaderBorderWidth:i.lineWidth,modalHeaderBorderStyle:i.lineType,modalHeaderTitleLineHeight:n,modalHeaderTitleFontSize:t,modalHeaderBorderColorSplit:i.colorSplit,modalHeaderCloseSize:n*t+e*2,modalContentBg:i.colorBgElevated,modalHeadingColor:i.colorTextHeading,modalCloseColor:i.colorTextDescription,modalFooterBg:"transparent",modalFooterBorderColorSplit:i.colorSplit,modalFooterBorderStyle:i.lineType,modalFooterPaddingVertical:i.paddingXS,modalFooterPaddingHorizontal:i.padding,modalFooterBorderWidth:i.lineWidth,modalConfirmTitleFontSize:i.fontSizeLG,modalIconHoverColor:i.colorIconHover,modalConfirmIconSize:i.fontSize*i.lineHeight,modalCloseBtnSize:i.controlHeightLG*.55});return[R0t(r),M0t(r),A0t(r),N0t(r),i.wireframe&&P0t(r),IT(r,"zoom")]});var O0t=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{okText:e,okType:t="primary",cancelText:n,confirmLoading:r,onOk:o,onCancel:s,okButtonProps:a,cancelButtonProps:l}=i,[c]=ST("Modal",eSe());return C.createElement(C.Fragment,null,C.createElement(Ju,Object.assign({onClick:s},l),n||(c==null?void 0:c.cancelText)),C.createElement(Ju,Object.assign({},TSe(t),{loading:r,onClick:o},a),e||(c==null?void 0:c.okText)))},F0t=i=>{const{prefixCls:e,className:t,closeIcon:n,closable:r,type:o,title:s,children:a}=i,l=O0t(i,["prefixCls","className","closeIcon","closable","type","title","children"]),{getPrefixCls:c}=C.useContext(Rn),u=c(),d=e||c("modal"),[,h]=$Se(d),f=`${d}-confirm`;let g={};return o?g={closable:r??!1,title:"",footer:"",children:C.createElement(USe,Object.assign({},i,{confirmPrefixCls:f,rootPrefixCls:u,content:a}))}:g={closable:r??!0,title:s,footer:i.footer===void 0?C.createElement(VSe,Object.assign({},i)):i.footer,children:a},C.createElement(ASe,Object.assign({prefixCls:d,className:xe(h,`${d}-pure-panel`,o&&f,o&&`${f}-${o}`,t)},l,{closeIcon:HSe(d,n),closable:r},g))},B0t=F0t;var W0t=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{sK={x:i.pageX,y:i.pageY},setTimeout(()=>{sK=null},100)};BSe()&&document.documentElement.addEventListener("click",$0t,!0);const H0t=i=>{var e;const{getPopupContainer:t,getPrefixCls:n,direction:r}=C.useContext(Rn),o=M=>{const{onCancel:A}=i;A==null||A(M)},s=M=>{const{onOk:A}=i;A==null||A(M)},{prefixCls:a,className:l,rootClassName:c,open:u,wrapClassName:d,centered:h,getContainer:f,closeIcon:g,focusTriggerAfterClose:p=!0,visible:v,width:m=520,footer:_}=i,y=W0t(i,["prefixCls","className","rootClassName","open","wrapClassName","centered","getContainer","closeIcon","focusTriggerAfterClose","visible","width","footer"]),S=n("modal",a),L=n(),[E,D]=$Se(S),k=xe(d,{[`${S}-centered`]:!!h,[`${S}-wrap-rtl`]:r==="rtl"}),T=_===void 0?C.createElement(VSe,Object.assign({},i,{onOk:s,onCancel:o})):_;return E(C.createElement(gS,null,C.createElement(ck,{status:!0,override:!0},C.createElement(OSe,Object.assign({width:m},y,{getContainer:f===void 0?t:f,prefixCls:S,rootClassName:xe(D,c),wrapClassName:k,footer:T,visible:u??v,mousePosition:(e=y.mousePosition)!==null&&e!==void 0?e:sK,onClose:o,closeIcon:HSe(S,g),focusTriggerAfterClose:p,transitionName:nC(L,"zoom",i.transitionName),maskTransitionName:nC(L,"fade",i.maskTransitionName),className:xe(D,l)})))))},zSe=H0t;function USe(i){const{icon:e,onCancel:t,onOk:n,close:r,okText:o,okButtonProps:s,cancelText:a,cancelButtonProps:l,confirmPrefixCls:c,rootPrefixCls:u,type:d,okCancel:h,footer:f,locale:g}=i;let p=e;if(!e&&e!==null)switch(d){case"info":p=C.createElement(cwe,null);break;case"success":p=C.createElement(EZ,null);break;case"error":p=C.createElement(XS,null);break;default:p=C.createElement(Xye,null)}const v=i.okType||"primary",m=h??d==="confirm",_=i.autoFocusButton===null?!1:i.autoFocusButton||"ok",[y]=ST("Modal"),S=g||y,L=m&&C.createElement(Bce,{actionFn:t,close:r,autoFocus:_==="cancel",buttonProps:l,prefixCls:`${u}-btn`},a||(S==null?void 0:S.cancelText));return C.createElement("div",{className:`${c}-body-wrapper`},C.createElement("div",{className:`${c}-body`},p,i.title===void 0?null:C.createElement("span",{className:`${c}-title`},i.title),C.createElement("div",{className:`${c}-content`},i.content)),f===void 0?C.createElement("div",{className:`${c}-btns`},L,C.createElement(Bce,{type:v,actionFn:n,close:r,autoFocus:_==="ok",buttonProps:s,prefixCls:`${u}-btn`},o||(m?S==null?void 0:S.okText:S==null?void 0:S.justOkText))):f)}const jSe=i=>{const{close:e,zIndex:t,afterClose:n,visible:r,open:o,keyboard:s,centered:a,getContainer:l,maskStyle:c,direction:u,prefixCls:d,wrapClassName:h,rootPrefixCls:f,iconPrefixCls:g,bodyStyle:p,closable:v=!1,closeIcon:m,modalRender:_,focusTriggerAfterClose:y}=i,S=`${d}-confirm`,L=i.width||416,E=i.style||{},D=i.mask===void 0?!0:i.mask,k=i.maskClosable===void 0?!1:i.maskClosable,T=xe(S,`${S}-${i.type}`,{[`${S}-rtl`]:u==="rtl"},i.className);return C.createElement(LT,{prefixCls:f,iconPrefixCls:g,direction:u},C.createElement(zSe,{prefixCls:d,className:T,wrapClassName:xe({[`${S}-centered`]:!!i.centered},h),onCancel:()=>e==null?void 0:e({triggerCancel:!0}),open:o,title:"",footer:null,transitionName:nC(f,"zoom",i.transitionName),maskTransitionName:nC(f,"fade",i.maskTransitionName),mask:D,maskClosable:k,maskStyle:c,style:E,bodyStyle:p,width:L,zIndex:t,afterClose:n,keyboard:s,centered:a,getContainer:l,closable:v,closeIcon:m,modalRender:_,focusTriggerAfterClose:y},C.createElement(USe,Object.assign({},i,{confirmPrefixCls:S}))))},V0t=[],Q0=V0t;var z0t=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);rh&&h.triggerCancel);i.onCancel&&d&&i.onCancel.apply(i,[()=>{}].concat(ft(c.slice(1))));for(let h=0;h{const f=eSe(),{getPrefixCls:g,getIconPrefixCls:p}=FZ(),v=g(void 0,U0t()),m=d||`${v}-modal`,_=p();HZ(C.createElement(jSe,Object.assign({},h,{prefixCls:m,rootPrefixCls:v,iconPrefixCls:_,okText:c,locale:f,cancelText:u||f.cancelText})),e)})}function s(){for(var l=arguments.length,c=new Array(l),u=0;u{typeof i.afterClose=="function"&&i.afterClose(),r.apply(this,c)}}),t.visible&&delete t.visible,o(t)}function a(l){typeof l=="function"?t=l(t):t=Object.assign(Object.assign({},t),l),o(t)}return o(t),Q0.push(s),{destroy:s,update:a}}function GSe(i){return Object.assign(Object.assign({},i),{type:"warning"})}function qSe(i){return Object.assign(Object.assign({},i),{type:"info"})}function XSe(i){return Object.assign(Object.assign({},i),{type:"success"})}function YSe(i){return Object.assign(Object.assign({},i),{type:"error"})}function ZSe(i){return Object.assign(Object.assign({},i),{type:"confirm"})}function j0t(i){let{rootPrefixCls:e}=i;KSe=e}const K0t=(i,e)=>{let{afterClose:t,config:n}=i;var r;const[o,s]=C.useState(!0),[a,l]=C.useState(n),{direction:c,getPrefixCls:u}=C.useContext(Rn),d=u("modal"),h=u(),f=()=>{var m;t(),(m=a.afterClose)===null||m===void 0||m.call(a)},g=function(){s(!1);for(var m=arguments.length,_=new Array(m),y=0;yL&&L.triggerCancel);a.onCancel&&S&&a.onCancel.apply(a,[()=>{}].concat(ft(_.slice(1))))};C.useImperativeHandle(e,()=>({destroy:g,update:m=>{l(_=>Object.assign(Object.assign({},_),m))}}));const p=(r=a.okCancel)!==null&&r!==void 0?r:a.type==="confirm",[v]=ST("Modal",tC.Modal);return C.createElement(jSe,Object.assign({prefixCls:d,rootPrefixCls:h},a,{close:g,open:o,afterClose:f,okText:a.okText||(p?v==null?void 0:v.okText:v==null?void 0:v.justOkText),direction:a.direction||c,cancelText:a.cancelText||(v==null?void 0:v.cancelText)}))},G0t=C.forwardRef(K0t);let eue=0;const q0t=C.memo(C.forwardRef((i,e)=>{const[t,n]=Nvt();return C.useImperativeHandle(e,()=>({patchElement:n}),[]),C.createElement(C.Fragment,null,t)}));function X0t(){const i=C.useRef(null),[e,t]=C.useState([]);C.useEffect(()=>{e.length&&(ft(e).forEach(s=>{s()}),t([]))},[e]);const n=C.useCallback(o=>function(a){var l;eue+=1;const c=C.createRef();let u;const d=C.createElement(G0t,{key:`modal-${eue}`,config:o(a),ref:c,afterClose:()=>{u==null||u()}});return u=(l=i.current)===null||l===void 0?void 0:l.patchElement(d),u&&Q0.push(u),{destroy:()=>{function h(){var f;(f=c.current)===null||f===void 0||f.destroy()}c.current?h():t(f=>[].concat(ft(f),[h]))},update:h=>{function f(){var g;(g=c.current)===null||g===void 0||g.update(h)}c.current?f():t(g=>[].concat(ft(g),[f]))}}},[]);return[C.useMemo(()=>({info:n(qSe),success:n(XSe),error:n(YSe),warning:n(GSe),confirm:n(ZSe)}),[]),C.createElement(q0t,{key:"modal-holder",ref:i})]}function b7(i){return i!==void 0}function Ja(i,e){var t=e||{},n=t.defaultValue,r=t.value,o=t.onChange,s=t.postState,a=Mv(function(){return b7(r)?r:b7(n)?typeof n=="function"?n():n:typeof i=="function"?i():i}),l=Ae(a,2),c=l[0],u=l[1],d=r!==void 0?r:c,h=s?s(d):d,f=tc(o),g=Mv([d]),p=Ae(g,2),v=p[0],m=p[1];GE(function(){var y=v[0];c!==y&&f(c,y)},[v]),GE(function(){b7(r)||u(r)},[r]);var _=tc(function(y,S){u(y,S),m([d],S)});return[h,_]}const P5=function(){if(typeof navigator>"u"||typeof window>"u")return!1;var i=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(i)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(i==null?void 0:i.substr(0,4))};var QSe=C.createContext(null);function Y0t(){return C.useContext(QSe)}function Z0t(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,e=C.useState(!1),t=Ae(e,2),n=t[0],r=t[1],o=C.useRef(null),s=function(){window.clearTimeout(o.current)};C.useEffect(function(){return s},[]);var a=function(c,u){s(),o.current=window.setTimeout(function(){r(c),u&&u()},i)};return[n,a,s]}function JSe(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,e=C.useRef(null),t=C.useRef(null);C.useEffect(function(){return function(){window.clearTimeout(t.current)}},[]);function n(r){(r||e.current===null)&&(e.current=r),window.clearTimeout(t.current),t.current=window.setTimeout(function(){e.current=null},i)}return[function(){return e.current},n]}function Q0t(i,e,t,n){var r=C.useRef(null);r.current={open:e,triggerOpen:t,customizedTrigger:n},C.useEffect(function(){function o(s){var a;if(!((a=r.current)!==null&&a!==void 0&&a.customizedTrigger)){var l=s.target;l.shadowRoot&&s.composed&&(l=s.composedPath()[0]||l),r.current.open&&i().filter(function(c){return c}).every(function(c){return!c.contains(l)&&c!==l})&&r.current.triggerOpen(!1)}}return window.addEventListener("mousedown",o),function(){return window.removeEventListener("mousedown",o)}},[])}var J0t=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],m1=void 0;function ebt(i,e){var t=i.prefixCls,n=i.invalidate,r=i.item,o=i.renderItem,s=i.responsive,a=i.responsiveDisabled,l=i.registerSize,c=i.itemKey,u=i.className,d=i.style,h=i.children,f=i.display,g=i.order,p=i.component,v=p===void 0?"div":p,m=Nn(i,J0t),_=s&&!f;function y(k){l(c,k)}C.useEffect(function(){return function(){y(null)}},[]);var S=o&&r!==m1?o(r):h,L;n||(L={opacity:_?0:1,height:_?0:m1,overflowY:_?"hidden":m1,order:s?g:m1,pointerEvents:_?"none":m1,position:_?"absolute":m1});var E={};_&&(E["aria-hidden"]=!0);var D=C.createElement(v,St({className:xe(!n&&t,u),style:te(te({},L),d)},E,m,{ref:e}),S);return s&&(D=C.createElement(Nh,{onResize:function(T){var M=T.offsetWidth;y(M)},disabled:a},D)),D}var qE=C.forwardRef(ebt);qE.displayName="Item";function tbt(i){if(typeof MessageChannel>"u")Zi(i);else{var e=new MessageChannel;e.port1.onmessage=function(){return i()},e.port2.postMessage(void 0)}}function nbt(){var i=C.useRef(null),e=function(n){i.current||(i.current=[],tbt(function(){sh.unstable_batchedUpdates(function(){i.current.forEach(function(r){r()}),i.current=null})})),i.current.push(n)};return e}function aL(i,e){var t=C.useState(e),n=Ae(t,2),r=n[0],o=n[1],s=tc(function(a){i(function(){o(a)})});return[r,s]}var ibt=["component"],rbt=["className"],obt=["className"],sbt=function(e,t){var n=C.useContext(XO);if(!n){var r=e.component,o=r===void 0?"div":r,s=Nn(e,ibt);return C.createElement(o,St({},s,{ref:t}))}var a=n.className,l=Nn(n,rbt),c=e.className,u=Nn(e,obt);return C.createElement(XO.Provider,{value:null},C.createElement(qE,St({ref:t,className:xe(a,c)},l,u)))},exe=C.forwardRef(sbt);exe.displayName="RawItem";var abt=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],XO=C.createContext(null),txe="responsive",nxe="invalidate";function lbt(i){return"+ ".concat(i.length," ...")}function cbt(i,e){var t=i.prefixCls,n=t===void 0?"rc-overflow":t,r=i.data,o=r===void 0?[]:r,s=i.renderItem,a=i.renderRawItem,l=i.itemKey,c=i.itemWidth,u=c===void 0?10:c,d=i.ssr,h=i.style,f=i.className,g=i.maxCount,p=i.renderRest,v=i.renderRawRest,m=i.suffix,_=i.component,y=_===void 0?"div":_,S=i.itemComponent,L=i.onVisibleChange,E=Nn(i,abt),D=d==="full",k=nbt(),T=aL(k,null),M=Ae(T,2),A=M[0],N=M[1],R=A||0,F=aL(k,new Map),W=Ae(F,2),H=W[0],G=W[1],U=aL(k,0),K=Ae(U,2),re=K[0],Y=K[1],J=aL(k,0),Q=Ae(J,2),ue=Q[0],de=Q[1],_e=aL(k,0),ve=Ae(_e,2),Ve=ve[0],Ze=ve[1],We=C.useState(null),pe=Ae(We,2),Pe=pe[0],Se=pe[1],Ne=C.useState(null),Me=Ae(Ne,2),Qe=Me[0],Ke=Me[1],Re=C.useMemo(function(){return Qe===null&&D?Number.MAX_SAFE_INTEGER:Qe||0},[Qe,A]),ct=C.useState(!1),ie=Ae(ct,2),le=ie[0],ce=ie[1],z="".concat(n,"-item"),q=Math.max(re,ue),oe=g===txe,ne=o.length&&oe,he=g===nxe,Le=ne||typeof g=="number"&&o.length>g,Fe=C.useMemo(function(){var lt=o;return ne?A===null&&D?lt=o:lt=o.slice(0,Math.min(o.length,R/u)):typeof g=="number"&&(lt=o.slice(0,g)),lt},[o,u,A,g,ne]),ze=C.useMemo(function(){return ne?o.slice(Re+1):o.slice(Fe.length)},[o,Fe,ne,Re]),Ue=C.useCallback(function(lt,ut){var dt;return typeof l=="function"?l(lt):(dt=l&&(lt==null?void 0:lt[l]))!==null&&dt!==void 0?dt:ut},[l]),nt=C.useCallback(s||function(lt){return lt},[s]);function it(lt,ut,dt){Qe===lt&&(ut===void 0||ut===Pe)||(Ke(lt),dt||(ce(ltR){it(Mt-1,lt-Kt-Ve+ue);break}}m&&xn(0)+Ve>R&&Se(null)}},[R,H,ue,Ve,Ue,Fe]);var rt=le&&!!ze.length,wt={};Pe!==null&&ne&&(wt={position:"absolute",left:Pe,top:0});var Bt={prefixCls:z,responsive:ne,component:S,invalidate:he},Nt=a?function(lt,ut){var dt=Ue(lt,ut);return C.createElement(XO.Provider,{key:dt,value:te(te({},Bt),{},{order:ut,item:lt,itemKey:dt,registerSize:tt,display:ut<=Re})},a(lt,ut))}:function(lt,ut){var dt=Ue(lt,ut);return C.createElement(qE,St({},Bt,{order:ut,key:dt,item:lt,renderItem:nt,itemKey:dt,registerSize:tt,display:ut<=Re}))},nn,Mn={order:rt?Re:Number.MAX_SAFE_INTEGER,className:"".concat(z,"-rest"),registerSize:Zt,display:rt};if(v)v&&(nn=C.createElement(XO.Provider,{value:te(te({},Bt),Mn)},v(ze)));else{var zt=p||lbt;nn=C.createElement(qE,St({},Bt,Mn),typeof zt=="function"?zt(ze):zt)}var Qt=C.createElement(y,St({className:xe(!he&&n,f),style:h,ref:e},E),Fe.map(Nt),Le?nn:null,m&&C.createElement(qE,St({},Bt,{responsive:oe,responsiveDisabled:!ne,order:Re,className:"".concat(z,"-suffix"),registerSize:Tt,display:!0,style:wt}),m));return oe&&(Qt=C.createElement(Nh,{onResize:at,disabled:!ne},Qt)),Qt}var Of=C.forwardRef(cbt);Of.displayName="Overflow";Of.Item=exe;Of.RESPONSIVE=txe;Of.INVALIDATE=nxe;var YO=function(e){var t=e.className,n=e.customizeIcon,r=e.customizeIconProps,o=e.onMouseDown,s=e.onClick,a=e.children,l;return typeof n=="function"?l=n(r):l=n,C.createElement("span",{className:t,onMouseDown:function(u){u.preventDefault(),o&&o(u)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:s,"aria-hidden":!0},l!==void 0?l:C.createElement("span",{className:xe(t.split(/\s+/).map(function(c){return"".concat(c,"-icon")}))},a))},ubt=function(e,t){var n,r,o=e.prefixCls,s=e.id,a=e.inputElement,l=e.disabled,c=e.tabIndex,u=e.autoFocus,d=e.autoComplete,h=e.editable,f=e.activeDescendantId,g=e.value,p=e.maxLength,v=e.onKeyDown,m=e.onMouseDown,_=e.onChange,y=e.onPaste,S=e.onCompositionStart,L=e.onCompositionEnd,E=e.open,D=e.attrs,k=a||C.createElement("input",null),T=k,M=T.ref,A=T.props,N=A.onKeyDown,R=A.onChange,F=A.onMouseDown,W=A.onCompositionStart,H=A.onCompositionEnd,G=A.style;return"maxLength"in k.props,k=C.cloneElement(k,te(te(te({type:"search"},A),{},{id:s,ref:vu(t,M),disabled:l,tabIndex:c,autoComplete:d||"off",autoFocus:u,className:xe("".concat(o,"-selection-search-input"),(n=k)===null||n===void 0||(r=n.props)===null||r===void 0?void 0:r.className),role:"combobox","aria-expanded":E,"aria-haspopup":"listbox","aria-owns":"".concat(s,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(s,"_list"),"aria-activedescendant":f},D),{},{value:h?g:"",maxLength:p,readOnly:!h,unselectable:h?null:"on",style:te(te({},G),{},{opacity:h?null:0}),onKeyDown:function(K){v(K),N&&N(K)},onMouseDown:function(K){m(K),F&&F(K)},onChange:function(K){_(K),R&&R(K)},onCompositionStart:function(K){S(K),W&&W(K)},onCompositionEnd:function(K){L(K),H&&H(K)},onPaste:y})),k},YZ=C.forwardRef(ubt);YZ.displayName="Input";function ixe(i){return Array.isArray(i)?i:i!==void 0?[i]:[]}var dbt=typeof window<"u"&&window.document&&window.document.documentElement,hbt=dbt;function fbt(i){return i!=null}function tue(i){return["string","number"].includes(zn(i))}function rxe(i){var e=void 0;return i&&(tue(i.title)?e=i.title.toString():tue(i.label)&&(e=i.label.toString())),e}function gbt(i,e){hbt?C.useLayoutEffect(i,e):C.useEffect(i,e)}function pbt(i){var e;return(e=i.key)!==null&&e!==void 0?e:i.value}var nue=function(e){e.preventDefault(),e.stopPropagation()},mbt=function(e){var t=e.id,n=e.prefixCls,r=e.values,o=e.open,s=e.searchValue,a=e.autoClearSearchValue,l=e.inputRef,c=e.placeholder,u=e.disabled,d=e.mode,h=e.showSearch,f=e.autoFocus,g=e.autoComplete,p=e.activeDescendantId,v=e.tabIndex,m=e.removeIcon,_=e.maxTagCount,y=e.maxTagTextLength,S=e.maxTagPlaceholder,L=S===void 0?function(Se){return"+ ".concat(Se.length," ...")}:S,E=e.tagRender,D=e.onToggleOpen,k=e.onRemove,T=e.onInputChange,M=e.onInputPaste,A=e.onInputKeyDown,N=e.onInputMouseDown,R=e.onInputCompositionStart,F=e.onInputCompositionEnd,W=C.useRef(null),H=C.useState(0),G=Ae(H,2),U=G[0],K=G[1],re=C.useState(!1),Y=Ae(re,2),J=Y[0],Q=Y[1],ue="".concat(n,"-selection"),de=o||d==="multiple"&&a===!1||d==="tags"?s:"",_e=d==="tags"||d==="multiple"&&a===!1||h&&(o||J);gbt(function(){K(W.current.scrollWidth)},[de]);function ve(Se,Ne,Me,Qe,Ke){return C.createElement("span",{className:xe("".concat(ue,"-item"),be({},"".concat(ue,"-item-disabled"),Me)),title:rxe(Se)},C.createElement("span",{className:"".concat(ue,"-item-content")},Ne),Qe&&C.createElement(YO,{className:"".concat(ue,"-item-remove"),onMouseDown:nue,onClick:Ke,customizeIcon:m},"×"))}function Ve(Se,Ne,Me,Qe,Ke){var Re=function(ie){nue(ie),D(!o)};return C.createElement("span",{onMouseDown:Re},E({label:Ne,value:Se,disabled:Me,closable:Qe,onClose:Ke}))}function Ze(Se){var Ne=Se.disabled,Me=Se.label,Qe=Se.value,Ke=!u&&!Ne,Re=Me;if(typeof y=="number"&&(typeof Me=="string"||typeof Me=="number")){var ct=String(Re);ct.length>y&&(Re="".concat(ct.slice(0,y),"..."))}var ie=function(ce){ce&&ce.stopPropagation(),k(Se)};return typeof E=="function"?Ve(Qe,Re,Ne,Ke,ie):ve(Se,Re,Ne,Ke,ie)}function We(Se){var Ne=typeof L=="function"?L(Se):L;return ve({title:Ne},Ne,!1)}var pe=C.createElement("div",{className:"".concat(ue,"-search"),style:{width:U},onFocus:function(){Q(!0)},onBlur:function(){Q(!1)}},C.createElement(YZ,{ref:l,open:o,prefixCls:n,id:t,inputElement:null,disabled:u,autoFocus:f,autoComplete:g,editable:_e,activeDescendantId:p,value:de,onKeyDown:A,onMouseDown:N,onChange:T,onPaste:M,onCompositionStart:R,onCompositionEnd:F,tabIndex:v,attrs:Bp(e,!0)}),C.createElement("span",{ref:W,className:"".concat(ue,"-search-mirror"),"aria-hidden":!0},de," ")),Pe=C.createElement(Of,{prefixCls:"".concat(ue,"-overflow"),data:r,renderItem:Ze,renderRest:We,suffix:pe,itemKey:pbt,maxCount:_});return C.createElement(C.Fragment,null,Pe,!r.length&&!de&&C.createElement("span",{className:"".concat(ue,"-placeholder")},c))},vbt=function(e){var t=e.inputElement,n=e.prefixCls,r=e.id,o=e.inputRef,s=e.disabled,a=e.autoFocus,l=e.autoComplete,c=e.activeDescendantId,u=e.mode,d=e.open,h=e.values,f=e.placeholder,g=e.tabIndex,p=e.showSearch,v=e.searchValue,m=e.activeValue,_=e.maxLength,y=e.onInputKeyDown,S=e.onInputMouseDown,L=e.onInputChange,E=e.onInputPaste,D=e.onInputCompositionStart,k=e.onInputCompositionEnd,T=e.title,M=C.useState(!1),A=Ae(M,2),N=A[0],R=A[1],F=u==="combobox",W=F||p,H=h[0],G=v||"";F&&m&&!N&&(G=m),C.useEffect(function(){F&&R(!1)},[F,m]);var U=u!=="combobox"&&!d&&!p?!1:!!G,K=T===void 0?rxe(H):T,re=function(){if(H)return null;var J=U?{visibility:"hidden"}:void 0;return C.createElement("span",{className:"".concat(n,"-selection-placeholder"),style:J},f)};return C.createElement(C.Fragment,null,C.createElement("span",{className:"".concat(n,"-selection-search")},C.createElement(YZ,{ref:o,prefixCls:n,id:r,open:d,inputElement:t,disabled:s,autoFocus:a,autoComplete:l,editable:W,activeDescendantId:c,value:G,onKeyDown:y,onMouseDown:S,onChange:function(J){R(!0),L(J)},onPaste:E,onCompositionStart:D,onCompositionEnd:k,tabIndex:g,attrs:Bp(e,!0),maxLength:F?_:void 0})),!F&&H?C.createElement("span",{className:"".concat(n,"-selection-item"),title:K,style:U?{visibility:"hidden"}:void 0},H.label):null,re())};function _bt(i){return![vt.ESC,vt.SHIFT,vt.BACKSPACE,vt.TAB,vt.WIN_KEY,vt.ALT,vt.META,vt.WIN_KEY_RIGHT,vt.CTRL,vt.SEMICOLON,vt.EQUALS,vt.CAPS_LOCK,vt.CONTEXT_MENU,vt.F1,vt.F2,vt.F3,vt.F4,vt.F5,vt.F6,vt.F7,vt.F8,vt.F9,vt.F10,vt.F11,vt.F12].includes(i)}var bbt=function(e,t){var n=C.useRef(null),r=C.useRef(!1),o=e.prefixCls,s=e.open,a=e.mode,l=e.showSearch,c=e.tokenWithEnter,u=e.autoClearSearchValue,d=e.onSearch,h=e.onSearchSubmit,f=e.onToggleOpen,g=e.onInputKeyDown,p=e.domRef;C.useImperativeHandle(t,function(){return{focus:function(){n.current.focus()},blur:function(){n.current.blur()}}});var v=JSe(0),m=Ae(v,2),_=m[0],y=m[1],S=function(G){var U=G.which;(U===vt.UP||U===vt.DOWN)&&G.preventDefault(),g&&g(G),U===vt.ENTER&&a==="tags"&&!r.current&&!s&&(h==null||h(G.target.value)),_bt(U)&&f(!0)},L=function(){y(!0)},E=C.useRef(null),D=function(G){d(G,!0,r.current)!==!1&&f(!0)},k=function(){r.current=!0},T=function(G){r.current=!1,a!=="combobox"&&D(G.target.value)},M=function(G){var U=G.target.value;if(c&&E.current&&/[\r\n]/.test(E.current)){var K=E.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");U=U.replace(K,E.current)}E.current=null,D(U)},A=function(G){var U=G.clipboardData,K=U.getData("text");E.current=K},N=function(G){var U=G.target;if(U!==n.current){var K=document.body.style.msTouchAction!==void 0;K?setTimeout(function(){n.current.focus()}):n.current.focus()}},R=function(G){var U=_();G.target!==n.current&&!U&&a!=="combobox"&&G.preventDefault(),(a!=="combobox"&&(!l||!U)||!s)&&(s&&u!==!1&&d("",!0,!1),f())},F={inputRef:n,onInputKeyDown:S,onInputMouseDown:L,onInputChange:M,onInputPaste:A,onInputCompositionStart:k,onInputCompositionEnd:T},W=a==="multiple"||a==="tags"?C.createElement(mbt,St({},e,F)):C.createElement(vbt,St({},e,F));return C.createElement("div",{ref:p,className:"".concat(o,"-selector"),onClick:N,onMouseDown:R},W)},oxe=C.forwardRef(bbt);oxe.displayName="Selector";var iue=C.createContext(null);function rue(i){return i?Array.isArray(i)?i:[i]:[]}function Cbt(i,e,t,n){return C.useMemo(function(){var r=rue(t??e),o=rue(n??e),s=new Set(r),a=new Set(o);return i&&(s.has("hover")&&(s.delete("hover"),s.add("click")),a.has("hover")&&(a.delete("hover"),a.add("click"))),[s,a]},[i,e,t,n])}function ybt(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2?arguments[2]:void 0;return t?i[0]===e[0]:i[0]===e[0]&&i[1]===e[1]}function wbt(i,e,t,n){for(var r=t.points,o=Object.keys(i),s=0;s0&&arguments[0]!==void 0?arguments[0]:"";return[i[0],i[1]]}function v1(i,e){var t=e[0],n=e[1],r,o;return t==="t"?o=i.y:t==="b"?o=i.y+i.height:o=i.y+i.height/2,n==="l"?r=i.x:n==="r"?r=i.x+i.width:r=i.x+i.width/2,{x:r,y:o}}function dm(i,e){var t={t:"b",b:"t",l:"r",r:"l"};return i.map(function(n,r){return r===e?t[n]||"c":n}).join("")}function xbt(i,e,t,n,r,o,s){var a=C.useState({ready:!1,offsetX:0,offsetY:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:r[n]||{}}),l=Ae(a,2),c=l[0],u=l[1],d=C.useRef(0),h=C.useMemo(function(){return e?aK(e):[]},[e]),f=C.useRef({}),g=function(){f.current={}};i||g();var p=tc(function(){if(e&&t&&i){let zo=function(Pa,Oa){var Bl=M.x+Pa,cl=M.y+Oa,Wl=Bl+J,_u=cl+Y,bu=Math.max(Bl,de.left),xc=Math.max(cl,de.top),Fa=Math.min(Wl,de.right),Ba=Math.min(_u,de.bottom);return Math.max(0,(Fa-bu)*(Ba-xc))},bo=function(){Mn=M.y+nt,zt=Mn+Y,Qt=M.x+Ue,lt=Qt+J};var _=e,y=_.style.left,S=_.style.top,L=_.ownerDocument,E=TT(_),D=te(te({},r[n]),o);_.style.left="0",_.style.top="0";var k;if(Array.isArray(t))k={x:t[0],y:t[1],width:0,height:0};else{var T=t.getBoundingClientRect();k={x:T.x,y:T.y,width:T.width,height:T.height}}var M=_.getBoundingClientRect(),A=E.getComputedStyle(_),N=A.width,R=A.height,F=L.documentElement,W=F.clientWidth,H=F.clientHeight,G=F.scrollWidth,U=F.scrollHeight,K=F.scrollTop,re=F.scrollLeft,Y=M.height,J=M.width,Q=k.height,ue=k.width,de=D.htmlRegion==="scroll"?{left:-re,top:-K,right:G-re,bottom:U-K}:{left:0,top:0,right:W,bottom:H};de=Sbt(de,h),_.style.left=y,_.style.top=S;var _e=ZO(Math.round(J/parseFloat(N)*1e3)/1e3),ve=ZO(Math.round(Y/parseFloat(R)*1e3)/1e3);if(_e===0||ve===0||FO(t)&&!DT(t))return;var Ve=D.offset,Ze=D.targetOffset,We=Ve||[],pe=Ae(We,2),Pe=pe[0],Se=Pe===void 0?0:Pe,Ne=pe[1],Me=Ne===void 0?0:Ne,Qe=Ze||[],Ke=Ae(Qe,2),Re=Ke[0],ct=Re===void 0?0:Re,ie=Ke[1],le=ie===void 0?0:ie;k.x+=ct,k.y+=le;var ce=D.points||[],z=Ae(ce,2),q=z[0],oe=z[1],ne=sue(oe),he=sue(q),Le=v1(k,ne),Fe=v1(M,he),ze=te({},D),Ue=Le.x-Fe.x+Se,nt=Le.y-Fe.y+Me,it=zo(Ue,nt),at=v1(k,["t","l"]),tt=v1(M,["t","l"]),Zt=v1(k,["b","r"]),Tt=v1(M,["b","r"]),xn=D.overflow||{},rt=xn.adjustX,wt=xn.adjustY,Bt=xn.shiftX,Nt=xn.shiftY,nn=function(Oa){return typeof Oa=="boolean"?Oa:Oa>=0},Mn,zt,Qt,lt;bo();var ut=nn(wt),dt=he[0]===ne[0];if(ut&&he[0]==="t"&&(zt>de.bottom||f.current.bt)){var Mt=nt;dt?Mt-=Y-Q:Mt=at.y-Tt.y-Me,zo(Ue,Mt)>=it?(f.current.bt=!0,nt=Mt,ze.points=[dm(he,0),dm(ne,0)]):f.current.bt=!1}if(ut&&he[0]==="b"&&(Mn=it?(f.current.tb=!0,nt=Kt,ze.points=[dm(he,0),dm(ne,0)]):f.current.tb=!1}var mn=nn(rt),lr=he[1]===ne[1];if(mn&&he[1]==="l"&&(lt>de.right||f.current.rl)){var nr=Ue;lr?nr-=J-ue:nr=at.x-Tt.x-Se,zo(nr,nt)>=it?(f.current.rl=!0,Ue=nr,ze.points=[dm(he,1),dm(ne,1)]):f.current.rl=!1}if(mn&&he[1]==="r"&&(Qt=it?(f.current.lr=!0,Ue=Hr,ze.points=[dm(he,1),dm(ne,1)]):f.current.lr=!1}bo();var Jn=Bt===!0?0:Bt;typeof Jn=="number"&&(Qtde.right&&(Ue-=lt-de.right,k.x>de.right-Jn&&(Ue+=k.x-de.right+Jn)));var Ii=Nt===!0?0:Nt;typeof Ii=="number"&&(Mnde.bottom&&(nt-=zt-de.bottom,k.y>de.bottom-Ii&&(nt+=k.y-de.bottom+Ii)));var _o=M.x+Ue,No=_o+J,bs=M.y+nt,Cs=bs+Y,$t=k.x,we=$t+ue,bt=k.y,xt=bt+Q,Gn=Math.max(_o,$t),cr=Math.min(No,we),Vr=(Gn+cr)/2,ei=Vr-_o,Qr=Math.max(bs,bt),Fs=Math.min(Cs,xt),Fl=(Qr+Fs)/2,Aa=Fl-bs;s==null||s(e,ze),u({ready:!0,offsetX:Ue/_e,offsetY:nt/ve,arrowX:ei/_e,arrowY:Aa/ve,scaleX:_e,scaleY:ve,align:ze})}}),v=function(){d.current+=1;var y=d.current;Promise.resolve().then(function(){d.current===y&&p()})},m=function(){u(function(y){return te(te({},y),{},{ready:!1})})};return br(m,[n]),br(function(){i||m()},[i]),[c.ready,c.offsetX,c.offsetY,c.arrowX,c.arrowY,c.scaleX,c.scaleY,c.align,v]}function Lbt(i,e,t,n){br(function(){if(i&&e&&t){let u=function(){n()};var r=e,o=t,s=aK(r),a=aK(o),l=TT(o),c=new Set([l].concat(ft(s),ft(a)));return c.forEach(function(d){d.addEventListener("scroll",u,{passive:!0})}),l.addEventListener("resize",u,{passive:!0}),n(),function(){c.forEach(function(d){d.removeEventListener("scroll",u),l.removeEventListener("resize",u)})}}},[i,e,t])}function Ebt(i){var e=i.prefixCls,t=i.align,n=i.arrowX,r=n===void 0?0:n,o=i.arrowY,s=o===void 0?0:o,a=C.useRef();if(!t||!t.points)return null;var l={position:"absolute"};if(t.autoArrow!==!1){var c=t.points[0],u=t.points[1],d=c[0],h=c[1],f=u[0],g=u[1];d===f||!["t","b"].includes(d)?l.top=s:d==="t"?l.top=0:l.bottom=0,h===g||!["l","r"].includes(h)?l.left=r:h==="l"?l.left=0:l.right=0}return C.createElement("div",{ref:a,className:"".concat(e,"-arrow"),style:l})}function Dbt(i){var e=i.prefixCls,t=i.open,n=i.zIndex,r=i.mask,o=i.motion;return r?React.createElement(fd,St({},o,{motionAppear:!0,visible:t,removeOnLeave:!0}),function(s){var a=s.className;return React.createElement("div",{style:{zIndex:n},className:xe("".concat(e,"-mask"),a)})}):null}var Ibt=C.memo(function(i){var e=i.children;return e},function(i,e){return e.cache}),kbt=C.forwardRef(function(i,e){var t=i.popup,n=i.className,r=i.prefixCls,o=i.style,s=i.target,a=i.onVisibleChanged,l=i.open,c=i.keepDom,u=i.onClick,d=i.mask,h=i.arrow,f=i.align,g=i.arrowX,p=i.arrowY,v=i.motion,m=i.maskMotion,_=i.forceRender,y=i.getPopupContainer,S=i.autoDestroy,L=i.portal,E=i.zIndex,D=i.onMouseEnter,k=i.onMouseLeave,T=i.ready,M=i.offsetX,A=i.offsetY,N=i.onAlign,R=i.onPrepare,F=i.stretch,W=i.targetWidth,H=i.targetHeight,G=typeof t=="function"?t():t,U=l||c,K=(y==null?void 0:y.length)>0,re=C.useState(!y||!K),Y=Ae(re,2),J=Y[0],Q=Y[1];if(br(function(){!J&&K&&s&&Q(!0)},[J,K,s]),!J)return null;var ue=T||!l?{left:M,top:A}:{left:"-1000vw",top:"-1000vh"},de={};return F&&(F.includes("height")&&H?de.height=H:F.includes("minHeight")&&H&&(de.minHeight=H),F.includes("width")&&W?de.width=W:F.includes("minWidth")&&W&&(de.minWidth=W)),l||(de.pointerEvents="none"),C.createElement(L,{open:_||U,getContainer:y&&function(){return y(s)},autoDestroy:S},C.createElement(Dbt,{prefixCls:r,open:l,zIndex:E,mask:d,motion:m}),C.createElement(Nh,{onResize:N,disabled:!l},function(_e){return C.createElement(fd,St({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:_,leavedClassName:"".concat(r,"-hidden")},v,{onAppearPrepare:R,onEnterPrepare:R,visible:l,onVisibleChanged:function(Ve){var Ze;v==null||(Ze=v.onVisibleChanged)===null||Ze===void 0||Ze.call(v,Ve),a(Ve)}}),function(ve,Ve){var Ze=ve.className,We=ve.style,pe=xe(r,Ze,n);return C.createElement("div",{ref:vu(_e,e,Ve),className:pe,style:te(te(te(te({},ue),de),We),{},{boxSizing:"border-box",zIndex:E},o),onMouseEnter:D,onMouseLeave:k,onClick:u},h&&C.createElement(Ebt,{prefixCls:r,align:f,arrowX:g,arrowY:p}),C.createElement(Ibt,{cache:!l},G))})}))}),Tbt=C.forwardRef(function(i,e){var t=i.children,n=i.getTriggerDOMNode,r=$_(t),o=C.useCallback(function(a){tk(e,n?n(a):a)},[n]),s=x5(o,t.ref);return r?C.cloneElement(t,{ref:s}):t}),Nbt=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function Rbt(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:jZ,e=C.forwardRef(function(t,n){var r=t.prefixCls,o=r===void 0?"rc-trigger-popup":r,s=t.children,a=t.action,l=a===void 0?"hover":a,c=t.showAction,u=t.hideAction,d=t.popupVisible,h=t.defaultPopupVisible,f=t.onPopupVisibleChange,g=t.afterPopupVisibleChange,p=t.mouseEnterDelay,v=t.mouseLeaveDelay,m=v===void 0?.1:v,_=t.focusDelay,y=t.blurDelay,S=t.mask,L=t.maskClosable,E=L===void 0?!0:L,D=t.getPopupContainer,k=t.forceRender,T=t.autoDestroy,M=t.destroyPopupOnHide,A=t.popup,N=t.popupClassName,R=t.popupStyle,F=t.popupPlacement,W=t.builtinPlacements,H=W===void 0?{}:W,G=t.popupAlign,U=t.zIndex,K=t.stretch,re=t.getPopupClassNameFromAlign,Y=t.alignPoint,J=t.onPopupClick,Q=t.onPopupAlign,ue=t.arrow,de=t.popupMotion,_e=t.maskMotion,ve=t.popupTransitionName,Ve=t.popupAnimation,Ze=t.maskTransitionName,We=t.maskAnimation,pe=t.className,Pe=t.getTriggerDOMNode,Se=Nn(t,Nbt),Ne=T||M||!1,Me=C.useState(!1),Qe=Ae(Me,2),Ke=Qe[0],Re=Qe[1];br(function(){Re(P5())},[]);var ct=C.useRef({}),ie=C.useContext(iue),le=C.useMemo(function(){return{registerSubPopup:function(Yn,Qi){ct.current[Yn]=Qi,ie==null||ie.registerSubPopup(Yn,Qi)}}},[ie]),ce=MSe(),z=C.useState(null),q=Ae(z,2),oe=q[0],ne=q[1],he=tc(function(fn){FO(fn)&&oe!==fn&&ne(fn),ie==null||ie.registerSubPopup(ce,fn)}),Le=C.useState(null),Fe=Ae(Le,2),ze=Fe[0],Ue=Fe[1],nt=tc(function(fn){FO(fn)&&ze!==fn&&Ue(fn)}),it=C.Children.only(s),at=(it==null?void 0:it.props)||{},tt={},Zt=tc(function(fn){var Yn,Qi,Ar=ze;return(Ar==null?void 0:Ar.contains(fn))||(Ar==null||(Yn=Ar.getRootNode())===null||Yn===void 0?void 0:Yn.host)===fn||fn===Ar||(oe==null?void 0:oe.contains(fn))||(oe==null||(Qi=oe.getRootNode())===null||Qi===void 0?void 0:Qi.host)===fn||fn===oe||Object.values(ct.current).some(function(zr){return(zr==null?void 0:zr.contains(fn))||fn===zr})}),Tt=oue(o,de,Ve,ve),xn=oue(o,_e,We,Ze),rt=C.useState(h||!1),wt=Ae(rt,2),Bt=wt[0],Nt=wt[1],nn=d??Bt,Mn=tc(function(fn){d===void 0&&Nt(fn)});br(function(){Nt(d||!1)},[d]);var zt=C.useRef(nn);zt.current=nn;var Qt=tc(function(fn){nn!==fn&&(Mn(fn),f==null||f(fn))}),lt=C.useRef(),ut=function(){clearTimeout(lt.current)},dt=function(Yn){var Qi=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;ut(),Qi===0?Qt(Yn):lt.current=setTimeout(function(){Qt(Yn)},Qi*1e3)};C.useEffect(function(){return ut},[]);var Mt=C.useState(!1),Kt=Ae(Mt,2),mn=Kt[0],lr=Kt[1],nr=C.useRef(!0);br(function(){(!nr.current||nn)&&lr(!0),nr.current=!0},[nn]);var Hr=C.useState(null),Jn=Ae(Hr,2),Ii=Jn[0],_o=Jn[1],No=C.useState([0,0]),bs=Ae(No,2),Cs=bs[0],$t=bs[1],we=function(Yn){$t([Yn.clientX,Yn.clientY])},bt=xbt(nn,oe,Y?Cs:ze,F,H,G,Q),xt=Ae(bt,9),Gn=xt[0],cr=xt[1],Vr=xt[2],ei=xt[3],Qr=xt[4],Fs=xt[5],Fl=xt[6],Aa=xt[7],zo=xt[8],bo=tc(function(){mn||zo()});Lbt(nn,ze,oe,bo),br(function(){bo()},[Cs]),br(function(){nn&&!(H!=null&&H[F])&&bo()},[JSON.stringify(G)]);var Pa=C.useMemo(function(){var fn=wbt(H,o,Aa,Y);return xe(fn,re==null?void 0:re(Aa))},[Aa,re,H,o,Y]);C.useImperativeHandle(n,function(){return{forceAlign:bo}});var Oa=function(Yn){lr(!1),zo(),g==null||g(Yn)},Bl=function(){return new Promise(function(Yn){_o(function(){return Yn})})};br(function(){Ii&&(zo(),Ii(),_o(null))},[Ii]);var cl=C.useState(0),Wl=Ae(cl,2),_u=Wl[0],bu=Wl[1],xc=C.useState(0),Fa=Ae(xc,2),Ba=Fa[0],qt=Fa[1],Ft=function(Yn,Qi){if(bo(),K){var Ar=Qi.getBoundingClientRect();bu(Ar.width),qt(Ar.height)}},Pn=Cbt(Ke,l,c,u),Xt=Ae(Pn,2),Gt=Xt[0],oi=Xt[1],Fi=function(Yn,Qi,Ar,zr){tt[Yn]=function(kC){var og;zr==null||zr(kC),dt(Qi,Ar);for(var ix=arguments.length,zT=new Array(ix>1?ix-1:0),TC=1;TC1?Qi-1:0),zr=1;zr1?Qi-1:0),zr=1;zr1&&arguments[1]!==void 0?arguments[1]:{},t=e.fieldNames,n=e.childrenAsData,r=[],o=lxe(t,!1),s=o.label,a=o.value,l=o.options;function c(u,d){u.forEach(function(h){var f=h[s];if(d||!(l in h)){var g=h[a];r.push({key:aue(h,r.length),groupOption:d,data:h,label:f,value:g})}else{var p=f;p===void 0&&n&&(p=h.label),r.push({key:aue(h,r.length),group:!0,data:h,label:p}),c(h[l],!0)}})}return c(i,!1),r}function lK(i){var e=te({},i);return"props"in e||Object.defineProperty(e,"props",{get:function(){return ao(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),e}}),e}function Fbt(i,e){if(!e||!e.length)return null;var t=!1;function n(o,s){var a=Uwe(s),l=a[0],c=a.slice(1);if(!l)return[o];var u=o.split(l);return t=t||u.length>1,u.reduce(function(d,h){return[].concat(ft(d),ft(n(h,c)))},[]).filter(function(d){return d})}var r=n(i,e);return t?r:null}var Bbt=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","showArrow","inputIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],Wbt=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"];function cK(i){return i==="tags"||i==="multiple"}var $bt=C.forwardRef(function(i,e){var t,n,r=i.id,o=i.prefixCls,s=i.className,a=i.showSearch,l=i.tagRender,c=i.direction,u=i.omitDomProps,d=i.displayValues,h=i.onDisplayValuesChange,f=i.emptyOptions,g=i.notFoundContent,p=g===void 0?"Not Found":g,v=i.onClear,m=i.mode,_=i.disabled,y=i.loading,S=i.getInputElement,L=i.getRawInputElement,E=i.open,D=i.defaultOpen,k=i.onDropdownVisibleChange,T=i.activeValue,M=i.onActiveValueChange,A=i.activeDescendantId,N=i.searchValue,R=i.autoClearSearchValue,F=i.onSearch,W=i.onSearchSplit,H=i.tokenSeparators,G=i.allowClear,U=i.showArrow,K=i.inputIcon,re=i.clearIcon,Y=i.OptionList,J=i.animation,Q=i.transitionName,ue=i.dropdownStyle,de=i.dropdownClassName,_e=i.dropdownMatchSelectWidth,ve=i.dropdownRender,Ve=i.dropdownAlign,Ze=i.placement,We=i.builtinPlacements,pe=i.getPopupContainer,Pe=i.showAction,Se=Pe===void 0?[]:Pe,Ne=i.onFocus,Me=i.onBlur,Qe=i.onKeyUp,Ke=i.onKeyDown,Re=i.onMouseDown,ct=Nn(i,Bbt),ie=cK(m),le=(a!==void 0?a:ie)||m==="combobox",ce=te({},ct);Wbt.forEach(function(qt){delete ce[qt]}),u==null||u.forEach(function(qt){delete ce[qt]});var z=C.useState(!1),q=Ae(z,2),oe=q[0],ne=q[1];C.useEffect(function(){ne(P5())},[]);var he=C.useRef(null),Le=C.useRef(null),Fe=C.useRef(null),ze=C.useRef(null),Ue=C.useRef(null),nt=Z0t(),it=Ae(nt,3),at=it[0],tt=it[1],Zt=it[2];C.useImperativeHandle(e,function(){var qt,Ft;return{focus:(qt=ze.current)===null||qt===void 0?void 0:qt.focus,blur:(Ft=ze.current)===null||Ft===void 0?void 0:Ft.blur,scrollTo:function(Xt){var Gt;return(Gt=Ue.current)===null||Gt===void 0?void 0:Gt.scrollTo(Xt)}}});var Tt=C.useMemo(function(){var qt;if(m!=="combobox")return N;var Ft=(qt=d[0])===null||qt===void 0?void 0:qt.value;return typeof Ft=="string"||typeof Ft=="number"?String(Ft):""},[N,m,d]),xn=m==="combobox"&&typeof S=="function"&&S()||null,rt=typeof L=="function"&&L(),wt=x5(Le,rt==null||(t=rt.props)===null||t===void 0?void 0:t.ref),Bt=C.useState(!1),Nt=Ae(Bt,2),nn=Nt[0],Mn=Nt[1];br(function(){Mn(!0)},[]);var zt=Ja(!1,{defaultValue:D,value:E}),Qt=Ae(zt,2),lt=Qt[0],ut=Qt[1],dt=nn?lt:!1,Mt=!p&&f;(_||Mt&&dt&&m==="combobox")&&(dt=!1);var Kt=Mt?!1:dt,mn=C.useCallback(function(qt){var Ft=qt!==void 0?qt:!dt;_||(ut(Ft),dt!==Ft&&(k==null||k(Ft)))},[_,dt,ut,k]),lr=C.useMemo(function(){return(H||[]).some(function(qt){return[` + ${t}-confirm ${t}-body > ${i.iconCls}`]:{color:i.colorWarning},[`${t}-info ${t}-body > ${i.iconCls}`]:{color:i.colorInfo},[`${t}-success ${t}-body > ${i.iconCls}`]:{color:i.colorSuccess}}},A0t=i=>{const{componentCls:e}=i;return{[`${e}-root`]:{[`${e}-wrap-rtl`]:{direction:"rtl",[`${e}-confirm-body`]:{direction:"rtl"}}}}},P0t=i=>{const{componentCls:e,antCls:t}=i,n=`${e}-confirm`;return{[e]:{[`${e}-content`]:{padding:0},[`${e}-header`]:{padding:i.modalHeaderPadding,borderBottom:`${i.modalHeaderBorderWidth}px ${i.modalHeaderBorderStyle} ${i.modalHeaderBorderColorSplit}`,marginBottom:0},[`${e}-body`]:{padding:i.modalBodyPadding},[`${e}-footer`]:{padding:`${i.modalFooterPaddingVertical}px ${i.modalFooterPaddingHorizontal}px`,borderTop:`${i.modalFooterBorderWidth}px ${i.modalFooterBorderStyle} ${i.modalFooterBorderColorSplit}`,borderRadius:`0 0 ${i.borderRadiusLG}px ${i.borderRadiusLG}px`,marginTop:0}},[n]:{[`${t}-modal-body`]:{padding:`${i.padding*2}px ${i.padding*2}px ${i.paddingLG}px`},[`${n}-body`]:{[`> ${i.iconCls}`]:{marginInlineEnd:i.margin,[`+ ${n}-title + ${n}-content`]:{marginInlineStart:i.modalConfirmIconSize+i.margin}}},[`${n}-btns`]:{marginTop:i.marginLG}}}},$Se=vo("Modal",i=>{const e=i.padding,t=i.fontSizeHeading5,n=i.lineHeightHeading5,r=Oi(i,{modalBodyPadding:i.paddingLG,modalHeaderBg:i.colorBgElevated,modalHeaderPadding:`${e}px ${i.paddingLG}px`,modalHeaderBorderWidth:i.lineWidth,modalHeaderBorderStyle:i.lineType,modalHeaderTitleLineHeight:n,modalHeaderTitleFontSize:t,modalHeaderBorderColorSplit:i.colorSplit,modalHeaderCloseSize:n*t+e*2,modalContentBg:i.colorBgElevated,modalHeadingColor:i.colorTextHeading,modalCloseColor:i.colorTextDescription,modalFooterBg:"transparent",modalFooterBorderColorSplit:i.colorSplit,modalFooterBorderStyle:i.lineType,modalFooterPaddingVertical:i.paddingXS,modalFooterPaddingHorizontal:i.padding,modalFooterBorderWidth:i.lineWidth,modalConfirmTitleFontSize:i.fontSizeLG,modalIconHoverColor:i.colorIconHover,modalConfirmIconSize:i.fontSize*i.lineHeight,modalCloseBtnSize:i.controlHeightLG*.55});return[R0t(r),M0t(r),A0t(r),N0t(r),i.wireframe&&P0t(r),IT(r,"zoom")]});var O0t=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{okText:e,okType:t="primary",cancelText:n,confirmLoading:r,onOk:o,onCancel:s,okButtonProps:a,cancelButtonProps:l}=i,[c]=ST("Modal",eSe());return C.createElement(C.Fragment,null,C.createElement(Ju,Object.assign({onClick:s},l),n||(c==null?void 0:c.cancelText)),C.createElement(Ju,Object.assign({},TSe(t),{loading:r,onClick:o},a),e||(c==null?void 0:c.okText)))},F0t=i=>{const{prefixCls:e,className:t,closeIcon:n,closable:r,type:o,title:s,children:a}=i,l=O0t(i,["prefixCls","className","closeIcon","closable","type","title","children"]),{getPrefixCls:c}=C.useContext(Rn),u=c(),d=e||c("modal"),[,h]=$Se(d),f=`${d}-confirm`;let g={};return o?g={closable:r??!1,title:"",footer:"",children:C.createElement(USe,Object.assign({},i,{confirmPrefixCls:f,rootPrefixCls:u,content:a}))}:g={closable:r??!0,title:s,footer:i.footer===void 0?C.createElement(VSe,Object.assign({},i)):i.footer,children:a},C.createElement(ASe,Object.assign({prefixCls:d,className:xe(h,`${d}-pure-panel`,o&&f,o&&`${f}-${o}`,t)},l,{closeIcon:HSe(d,n),closable:r},g))},B0t=F0t;var W0t=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{sK={x:i.pageX,y:i.pageY},setTimeout(()=>{sK=null},100)};BSe()&&document.documentElement.addEventListener("click",$0t,!0);const H0t=i=>{var e;const{getPopupContainer:t,getPrefixCls:n,direction:r}=C.useContext(Rn),o=M=>{const{onCancel:A}=i;A==null||A(M)},s=M=>{const{onOk:A}=i;A==null||A(M)},{prefixCls:a,className:l,rootClassName:c,open:u,wrapClassName:d,centered:h,getContainer:f,closeIcon:g,focusTriggerAfterClose:p=!0,visible:v,width:m=520,footer:_}=i,y=W0t(i,["prefixCls","className","rootClassName","open","wrapClassName","centered","getContainer","closeIcon","focusTriggerAfterClose","visible","width","footer"]),S=n("modal",a),L=n(),[E,D]=$Se(S),k=xe(d,{[`${S}-centered`]:!!h,[`${S}-wrap-rtl`]:r==="rtl"}),T=_===void 0?C.createElement(VSe,Object.assign({},i,{onOk:s,onCancel:o})):_;return E(C.createElement(gS,null,C.createElement(ck,{status:!0,override:!0},C.createElement(OSe,Object.assign({width:m},y,{getContainer:f===void 0?t:f,prefixCls:S,rootClassName:xe(D,c),wrapClassName:k,footer:T,visible:u??v,mousePosition:(e=y.mousePosition)!==null&&e!==void 0?e:sK,onClose:o,closeIcon:HSe(S,g),focusTriggerAfterClose:p,transitionName:nC(L,"zoom",i.transitionName),maskTransitionName:nC(L,"fade",i.maskTransitionName),className:xe(D,l)})))))},zSe=H0t;function USe(i){const{icon:e,onCancel:t,onOk:n,close:r,okText:o,okButtonProps:s,cancelText:a,cancelButtonProps:l,confirmPrefixCls:c,rootPrefixCls:u,type:d,okCancel:h,footer:f,locale:g}=i;let p=e;if(!e&&e!==null)switch(d){case"info":p=C.createElement(cwe,null);break;case"success":p=C.createElement(EZ,null);break;case"error":p=C.createElement(XS,null);break;default:p=C.createElement(Xye,null)}const v=i.okType||"primary",m=h??d==="confirm",_=i.autoFocusButton===null?!1:i.autoFocusButton||"ok",[y]=ST("Modal"),S=g||y,L=m&&C.createElement(Bce,{actionFn:t,close:r,autoFocus:_==="cancel",buttonProps:l,prefixCls:`${u}-btn`},a||(S==null?void 0:S.cancelText));return C.createElement("div",{className:`${c}-body-wrapper`},C.createElement("div",{className:`${c}-body`},p,i.title===void 0?null:C.createElement("span",{className:`${c}-title`},i.title),C.createElement("div",{className:`${c}-content`},i.content)),f===void 0?C.createElement("div",{className:`${c}-btns`},L,C.createElement(Bce,{type:v,actionFn:n,close:r,autoFocus:_==="ok",buttonProps:s,prefixCls:`${u}-btn`},o||(m?S==null?void 0:S.okText:S==null?void 0:S.justOkText))):f)}const jSe=i=>{const{close:e,zIndex:t,afterClose:n,visible:r,open:o,keyboard:s,centered:a,getContainer:l,maskStyle:c,direction:u,prefixCls:d,wrapClassName:h,rootPrefixCls:f,iconPrefixCls:g,bodyStyle:p,closable:v=!1,closeIcon:m,modalRender:_,focusTriggerAfterClose:y}=i,S=`${d}-confirm`,L=i.width||416,E=i.style||{},D=i.mask===void 0?!0:i.mask,k=i.maskClosable===void 0?!1:i.maskClosable,T=xe(S,`${S}-${i.type}`,{[`${S}-rtl`]:u==="rtl"},i.className);return C.createElement(LT,{prefixCls:f,iconPrefixCls:g,direction:u},C.createElement(zSe,{prefixCls:d,className:T,wrapClassName:xe({[`${S}-centered`]:!!i.centered},h),onCancel:()=>e==null?void 0:e({triggerCancel:!0}),open:o,title:"",footer:null,transitionName:nC(f,"zoom",i.transitionName),maskTransitionName:nC(f,"fade",i.maskTransitionName),mask:D,maskClosable:k,maskStyle:c,style:E,bodyStyle:p,width:L,zIndex:t,afterClose:n,keyboard:s,centered:a,getContainer:l,closable:v,closeIcon:m,modalRender:_,focusTriggerAfterClose:y},C.createElement(USe,Object.assign({},i,{confirmPrefixCls:S}))))},V0t=[],Z0=V0t;var z0t=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);rh&&h.triggerCancel);i.onCancel&&d&&i.onCancel.apply(i,[()=>{}].concat(ft(c.slice(1))));for(let h=0;h{const f=eSe(),{getPrefixCls:g,getIconPrefixCls:p}=FZ(),v=g(void 0,U0t()),m=d||`${v}-modal`,_=p();HZ(C.createElement(jSe,Object.assign({},h,{prefixCls:m,rootPrefixCls:v,iconPrefixCls:_,okText:c,locale:f,cancelText:u||f.cancelText})),e)})}function s(){for(var l=arguments.length,c=new Array(l),u=0;u{typeof i.afterClose=="function"&&i.afterClose(),r.apply(this,c)}}),t.visible&&delete t.visible,o(t)}function a(l){typeof l=="function"?t=l(t):t=Object.assign(Object.assign({},t),l),o(t)}return o(t),Z0.push(s),{destroy:s,update:a}}function GSe(i){return Object.assign(Object.assign({},i),{type:"warning"})}function qSe(i){return Object.assign(Object.assign({},i),{type:"info"})}function XSe(i){return Object.assign(Object.assign({},i),{type:"success"})}function YSe(i){return Object.assign(Object.assign({},i),{type:"error"})}function ZSe(i){return Object.assign(Object.assign({},i),{type:"confirm"})}function j0t(i){let{rootPrefixCls:e}=i;KSe=e}const K0t=(i,e)=>{let{afterClose:t,config:n}=i;var r;const[o,s]=C.useState(!0),[a,l]=C.useState(n),{direction:c,getPrefixCls:u}=C.useContext(Rn),d=u("modal"),h=u(),f=()=>{var m;t(),(m=a.afterClose)===null||m===void 0||m.call(a)},g=function(){s(!1);for(var m=arguments.length,_=new Array(m),y=0;yL&&L.triggerCancel);a.onCancel&&S&&a.onCancel.apply(a,[()=>{}].concat(ft(_.slice(1))))};C.useImperativeHandle(e,()=>({destroy:g,update:m=>{l(_=>Object.assign(Object.assign({},_),m))}}));const p=(r=a.okCancel)!==null&&r!==void 0?r:a.type==="confirm",[v]=ST("Modal",tC.Modal);return C.createElement(jSe,Object.assign({prefixCls:d,rootPrefixCls:h},a,{close:g,open:o,afterClose:f,okText:a.okText||(p?v==null?void 0:v.okText:v==null?void 0:v.justOkText),direction:a.direction||c,cancelText:a.cancelText||(v==null?void 0:v.cancelText)}))},G0t=C.forwardRef(K0t);let eue=0;const q0t=C.memo(C.forwardRef((i,e)=>{const[t,n]=Nvt();return C.useImperativeHandle(e,()=>({patchElement:n}),[]),C.createElement(C.Fragment,null,t)}));function X0t(){const i=C.useRef(null),[e,t]=C.useState([]);C.useEffect(()=>{e.length&&(ft(e).forEach(s=>{s()}),t([]))},[e]);const n=C.useCallback(o=>function(a){var l;eue+=1;const c=C.createRef();let u;const d=C.createElement(G0t,{key:`modal-${eue}`,config:o(a),ref:c,afterClose:()=>{u==null||u()}});return u=(l=i.current)===null||l===void 0?void 0:l.patchElement(d),u&&Z0.push(u),{destroy:()=>{function h(){var f;(f=c.current)===null||f===void 0||f.destroy()}c.current?h():t(f=>[].concat(ft(f),[h]))},update:h=>{function f(){var g;(g=c.current)===null||g===void 0||g.update(h)}c.current?f():t(g=>[].concat(ft(g),[f]))}}},[]);return[C.useMemo(()=>({info:n(qSe),success:n(XSe),error:n(YSe),warning:n(GSe),confirm:n(ZSe)}),[]),C.createElement(q0t,{key:"modal-holder",ref:i})]}function b7(i){return i!==void 0}function Ja(i,e){var t=e||{},n=t.defaultValue,r=t.value,o=t.onChange,s=t.postState,a=Av(function(){return b7(r)?r:b7(n)?typeof n=="function"?n():n:typeof i=="function"?i():i}),l=Ae(a,2),c=l[0],u=l[1],d=r!==void 0?r:c,h=s?s(d):d,f=tc(o),g=Av([d]),p=Ae(g,2),v=p[0],m=p[1];GE(function(){var y=v[0];c!==y&&f(c,y)},[v]),GE(function(){b7(r)||u(r)},[r]);var _=tc(function(y,S){u(y,S),m([d],S)});return[h,_]}const P5=function(){if(typeof navigator>"u"||typeof window>"u")return!1;var i=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(i)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(i==null?void 0:i.substr(0,4))};var QSe=C.createContext(null);function Y0t(){return C.useContext(QSe)}function Z0t(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,e=C.useState(!1),t=Ae(e,2),n=t[0],r=t[1],o=C.useRef(null),s=function(){window.clearTimeout(o.current)};C.useEffect(function(){return s},[]);var a=function(c,u){s(),o.current=window.setTimeout(function(){r(c),u&&u()},i)};return[n,a,s]}function JSe(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,e=C.useRef(null),t=C.useRef(null);C.useEffect(function(){return function(){window.clearTimeout(t.current)}},[]);function n(r){(r||e.current===null)&&(e.current=r),window.clearTimeout(t.current),t.current=window.setTimeout(function(){e.current=null},i)}return[function(){return e.current},n]}function Q0t(i,e,t,n){var r=C.useRef(null);r.current={open:e,triggerOpen:t,customizedTrigger:n},C.useEffect(function(){function o(s){var a;if(!((a=r.current)!==null&&a!==void 0&&a.customizedTrigger)){var l=s.target;l.shadowRoot&&s.composed&&(l=s.composedPath()[0]||l),r.current.open&&i().filter(function(c){return c}).every(function(c){return!c.contains(l)&&c!==l})&&r.current.triggerOpen(!1)}}return window.addEventListener("mousedown",o),function(){return window.removeEventListener("mousedown",o)}},[])}var J0t=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],m1=void 0;function ebt(i,e){var t=i.prefixCls,n=i.invalidate,r=i.item,o=i.renderItem,s=i.responsive,a=i.responsiveDisabled,l=i.registerSize,c=i.itemKey,u=i.className,d=i.style,h=i.children,f=i.display,g=i.order,p=i.component,v=p===void 0?"div":p,m=Nn(i,J0t),_=s&&!f;function y(k){l(c,k)}C.useEffect(function(){return function(){y(null)}},[]);var S=o&&r!==m1?o(r):h,L;n||(L={opacity:_?0:1,height:_?0:m1,overflowY:_?"hidden":m1,order:s?g:m1,pointerEvents:_?"none":m1,position:_?"absolute":m1});var E={};_&&(E["aria-hidden"]=!0);var D=C.createElement(v,St({className:xe(!n&&t,u),style:te(te({},L),d)},E,m,{ref:e}),S);return s&&(D=C.createElement(Nh,{onResize:function(T){var M=T.offsetWidth;y(M)},disabled:a},D)),D}var qE=C.forwardRef(ebt);qE.displayName="Item";function tbt(i){if(typeof MessageChannel>"u")Zi(i);else{var e=new MessageChannel;e.port1.onmessage=function(){return i()},e.port2.postMessage(void 0)}}function nbt(){var i=C.useRef(null),e=function(n){i.current||(i.current=[],tbt(function(){sh.unstable_batchedUpdates(function(){i.current.forEach(function(r){r()}),i.current=null})})),i.current.push(n)};return e}function aL(i,e){var t=C.useState(e),n=Ae(t,2),r=n[0],o=n[1],s=tc(function(a){i(function(){o(a)})});return[r,s]}var ibt=["component"],rbt=["className"],obt=["className"],sbt=function(e,t){var n=C.useContext(XO);if(!n){var r=e.component,o=r===void 0?"div":r,s=Nn(e,ibt);return C.createElement(o,St({},s,{ref:t}))}var a=n.className,l=Nn(n,rbt),c=e.className,u=Nn(e,obt);return C.createElement(XO.Provider,{value:null},C.createElement(qE,St({ref:t,className:xe(a,c)},l,u)))},exe=C.forwardRef(sbt);exe.displayName="RawItem";var abt=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],XO=C.createContext(null),txe="responsive",nxe="invalidate";function lbt(i){return"+ ".concat(i.length," ...")}function cbt(i,e){var t=i.prefixCls,n=t===void 0?"rc-overflow":t,r=i.data,o=r===void 0?[]:r,s=i.renderItem,a=i.renderRawItem,l=i.itemKey,c=i.itemWidth,u=c===void 0?10:c,d=i.ssr,h=i.style,f=i.className,g=i.maxCount,p=i.renderRest,v=i.renderRawRest,m=i.suffix,_=i.component,y=_===void 0?"div":_,S=i.itemComponent,L=i.onVisibleChange,E=Nn(i,abt),D=d==="full",k=nbt(),T=aL(k,null),M=Ae(T,2),A=M[0],N=M[1],R=A||0,F=aL(k,new Map),W=Ae(F,2),H=W[0],G=W[1],U=aL(k,0),K=Ae(U,2),re=K[0],Y=K[1],J=aL(k,0),Q=Ae(J,2),ue=Q[0],de=Q[1],_e=aL(k,0),ve=Ae(_e,2),Ve=ve[0],Ze=ve[1],We=C.useState(null),pe=Ae(We,2),Pe=pe[0],Se=pe[1],Ne=C.useState(null),Me=Ae(Ne,2),Qe=Me[0],Ke=Me[1],Re=C.useMemo(function(){return Qe===null&&D?Number.MAX_SAFE_INTEGER:Qe||0},[Qe,A]),ct=C.useState(!1),ie=Ae(ct,2),le=ie[0],ce=ie[1],z="".concat(n,"-item"),q=Math.max(re,ue),oe=g===txe,ne=o.length&&oe,he=g===nxe,Le=ne||typeof g=="number"&&o.length>g,Fe=C.useMemo(function(){var lt=o;return ne?A===null&&D?lt=o:lt=o.slice(0,Math.min(o.length,R/u)):typeof g=="number"&&(lt=o.slice(0,g)),lt},[o,u,A,g,ne]),ze=C.useMemo(function(){return ne?o.slice(Re+1):o.slice(Fe.length)},[o,Fe,ne,Re]),Ue=C.useCallback(function(lt,ut){var dt;return typeof l=="function"?l(lt):(dt=l&&(lt==null?void 0:lt[l]))!==null&&dt!==void 0?dt:ut},[l]),nt=C.useCallback(s||function(lt){return lt},[s]);function it(lt,ut,dt){Qe===lt&&(ut===void 0||ut===Pe)||(Ke(lt),dt||(ce(ltR){it(Mt-1,lt-Kt-Ve+ue);break}}m&&xn(0)+Ve>R&&Se(null)}},[R,H,ue,Ve,Ue,Fe]);var rt=le&&!!ze.length,wt={};Pe!==null&&ne&&(wt={position:"absolute",left:Pe,top:0});var Bt={prefixCls:z,responsive:ne,component:S,invalidate:he},Nt=a?function(lt,ut){var dt=Ue(lt,ut);return C.createElement(XO.Provider,{key:dt,value:te(te({},Bt),{},{order:ut,item:lt,itemKey:dt,registerSize:tt,display:ut<=Re})},a(lt,ut))}:function(lt,ut){var dt=Ue(lt,ut);return C.createElement(qE,St({},Bt,{order:ut,key:dt,item:lt,renderItem:nt,itemKey:dt,registerSize:tt,display:ut<=Re}))},nn,Mn={order:rt?Re:Number.MAX_SAFE_INTEGER,className:"".concat(z,"-rest"),registerSize:Zt,display:rt};if(v)v&&(nn=C.createElement(XO.Provider,{value:te(te({},Bt),Mn)},v(ze)));else{var zt=p||lbt;nn=C.createElement(qE,St({},Bt,Mn),typeof zt=="function"?zt(ze):zt)}var Qt=C.createElement(y,St({className:xe(!he&&n,f),style:h,ref:e},E),Fe.map(Nt),Le?nn:null,m&&C.createElement(qE,St({},Bt,{responsive:oe,responsiveDisabled:!ne,order:Re,className:"".concat(z,"-suffix"),registerSize:Tt,display:!0,style:wt}),m));return oe&&(Qt=C.createElement(Nh,{onResize:at,disabled:!ne},Qt)),Qt}var Of=C.forwardRef(cbt);Of.displayName="Overflow";Of.Item=exe;Of.RESPONSIVE=txe;Of.INVALIDATE=nxe;var YO=function(e){var t=e.className,n=e.customizeIcon,r=e.customizeIconProps,o=e.onMouseDown,s=e.onClick,a=e.children,l;return typeof n=="function"?l=n(r):l=n,C.createElement("span",{className:t,onMouseDown:function(u){u.preventDefault(),o&&o(u)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:s,"aria-hidden":!0},l!==void 0?l:C.createElement("span",{className:xe(t.split(/\s+/).map(function(c){return"".concat(c,"-icon")}))},a))},ubt=function(e,t){var n,r,o=e.prefixCls,s=e.id,a=e.inputElement,l=e.disabled,c=e.tabIndex,u=e.autoFocus,d=e.autoComplete,h=e.editable,f=e.activeDescendantId,g=e.value,p=e.maxLength,v=e.onKeyDown,m=e.onMouseDown,_=e.onChange,y=e.onPaste,S=e.onCompositionStart,L=e.onCompositionEnd,E=e.open,D=e.attrs,k=a||C.createElement("input",null),T=k,M=T.ref,A=T.props,N=A.onKeyDown,R=A.onChange,F=A.onMouseDown,W=A.onCompositionStart,H=A.onCompositionEnd,G=A.style;return"maxLength"in k.props,k=C.cloneElement(k,te(te(te({type:"search"},A),{},{id:s,ref:vu(t,M),disabled:l,tabIndex:c,autoComplete:d||"off",autoFocus:u,className:xe("".concat(o,"-selection-search-input"),(n=k)===null||n===void 0||(r=n.props)===null||r===void 0?void 0:r.className),role:"combobox","aria-expanded":E,"aria-haspopup":"listbox","aria-owns":"".concat(s,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(s,"_list"),"aria-activedescendant":f},D),{},{value:h?g:"",maxLength:p,readOnly:!h,unselectable:h?null:"on",style:te(te({},G),{},{opacity:h?null:0}),onKeyDown:function(K){v(K),N&&N(K)},onMouseDown:function(K){m(K),F&&F(K)},onChange:function(K){_(K),R&&R(K)},onCompositionStart:function(K){S(K),W&&W(K)},onCompositionEnd:function(K){L(K),H&&H(K)},onPaste:y})),k},YZ=C.forwardRef(ubt);YZ.displayName="Input";function ixe(i){return Array.isArray(i)?i:i!==void 0?[i]:[]}var dbt=typeof window<"u"&&window.document&&window.document.documentElement,hbt=dbt;function fbt(i){return i!=null}function tue(i){return["string","number"].includes(zn(i))}function rxe(i){var e=void 0;return i&&(tue(i.title)?e=i.title.toString():tue(i.label)&&(e=i.label.toString())),e}function gbt(i,e){hbt?C.useLayoutEffect(i,e):C.useEffect(i,e)}function pbt(i){var e;return(e=i.key)!==null&&e!==void 0?e:i.value}var nue=function(e){e.preventDefault(),e.stopPropagation()},mbt=function(e){var t=e.id,n=e.prefixCls,r=e.values,o=e.open,s=e.searchValue,a=e.autoClearSearchValue,l=e.inputRef,c=e.placeholder,u=e.disabled,d=e.mode,h=e.showSearch,f=e.autoFocus,g=e.autoComplete,p=e.activeDescendantId,v=e.tabIndex,m=e.removeIcon,_=e.maxTagCount,y=e.maxTagTextLength,S=e.maxTagPlaceholder,L=S===void 0?function(Se){return"+ ".concat(Se.length," ...")}:S,E=e.tagRender,D=e.onToggleOpen,k=e.onRemove,T=e.onInputChange,M=e.onInputPaste,A=e.onInputKeyDown,N=e.onInputMouseDown,R=e.onInputCompositionStart,F=e.onInputCompositionEnd,W=C.useRef(null),H=C.useState(0),G=Ae(H,2),U=G[0],K=G[1],re=C.useState(!1),Y=Ae(re,2),J=Y[0],Q=Y[1],ue="".concat(n,"-selection"),de=o||d==="multiple"&&a===!1||d==="tags"?s:"",_e=d==="tags"||d==="multiple"&&a===!1||h&&(o||J);gbt(function(){K(W.current.scrollWidth)},[de]);function ve(Se,Ne,Me,Qe,Ke){return C.createElement("span",{className:xe("".concat(ue,"-item"),be({},"".concat(ue,"-item-disabled"),Me)),title:rxe(Se)},C.createElement("span",{className:"".concat(ue,"-item-content")},Ne),Qe&&C.createElement(YO,{className:"".concat(ue,"-item-remove"),onMouseDown:nue,onClick:Ke,customizeIcon:m},"×"))}function Ve(Se,Ne,Me,Qe,Ke){var Re=function(ie){nue(ie),D(!o)};return C.createElement("span",{onMouseDown:Re},E({label:Ne,value:Se,disabled:Me,closable:Qe,onClose:Ke}))}function Ze(Se){var Ne=Se.disabled,Me=Se.label,Qe=Se.value,Ke=!u&&!Ne,Re=Me;if(typeof y=="number"&&(typeof Me=="string"||typeof Me=="number")){var ct=String(Re);ct.length>y&&(Re="".concat(ct.slice(0,y),"..."))}var ie=function(ce){ce&&ce.stopPropagation(),k(Se)};return typeof E=="function"?Ve(Qe,Re,Ne,Ke,ie):ve(Se,Re,Ne,Ke,ie)}function We(Se){var Ne=typeof L=="function"?L(Se):L;return ve({title:Ne},Ne,!1)}var pe=C.createElement("div",{className:"".concat(ue,"-search"),style:{width:U},onFocus:function(){Q(!0)},onBlur:function(){Q(!1)}},C.createElement(YZ,{ref:l,open:o,prefixCls:n,id:t,inputElement:null,disabled:u,autoFocus:f,autoComplete:g,editable:_e,activeDescendantId:p,value:de,onKeyDown:A,onMouseDown:N,onChange:T,onPaste:M,onCompositionStart:R,onCompositionEnd:F,tabIndex:v,attrs:Wp(e,!0)}),C.createElement("span",{ref:W,className:"".concat(ue,"-search-mirror"),"aria-hidden":!0},de," ")),Pe=C.createElement(Of,{prefixCls:"".concat(ue,"-overflow"),data:r,renderItem:Ze,renderRest:We,suffix:pe,itemKey:pbt,maxCount:_});return C.createElement(C.Fragment,null,Pe,!r.length&&!de&&C.createElement("span",{className:"".concat(ue,"-placeholder")},c))},vbt=function(e){var t=e.inputElement,n=e.prefixCls,r=e.id,o=e.inputRef,s=e.disabled,a=e.autoFocus,l=e.autoComplete,c=e.activeDescendantId,u=e.mode,d=e.open,h=e.values,f=e.placeholder,g=e.tabIndex,p=e.showSearch,v=e.searchValue,m=e.activeValue,_=e.maxLength,y=e.onInputKeyDown,S=e.onInputMouseDown,L=e.onInputChange,E=e.onInputPaste,D=e.onInputCompositionStart,k=e.onInputCompositionEnd,T=e.title,M=C.useState(!1),A=Ae(M,2),N=A[0],R=A[1],F=u==="combobox",W=F||p,H=h[0],G=v||"";F&&m&&!N&&(G=m),C.useEffect(function(){F&&R(!1)},[F,m]);var U=u!=="combobox"&&!d&&!p?!1:!!G,K=T===void 0?rxe(H):T,re=function(){if(H)return null;var J=U?{visibility:"hidden"}:void 0;return C.createElement("span",{className:"".concat(n,"-selection-placeholder"),style:J},f)};return C.createElement(C.Fragment,null,C.createElement("span",{className:"".concat(n,"-selection-search")},C.createElement(YZ,{ref:o,prefixCls:n,id:r,open:d,inputElement:t,disabled:s,autoFocus:a,autoComplete:l,editable:W,activeDescendantId:c,value:G,onKeyDown:y,onMouseDown:S,onChange:function(J){R(!0),L(J)},onPaste:E,onCompositionStart:D,onCompositionEnd:k,tabIndex:g,attrs:Wp(e,!0),maxLength:F?_:void 0})),!F&&H?C.createElement("span",{className:"".concat(n,"-selection-item"),title:K,style:U?{visibility:"hidden"}:void 0},H.label):null,re())};function _bt(i){return![vt.ESC,vt.SHIFT,vt.BACKSPACE,vt.TAB,vt.WIN_KEY,vt.ALT,vt.META,vt.WIN_KEY_RIGHT,vt.CTRL,vt.SEMICOLON,vt.EQUALS,vt.CAPS_LOCK,vt.CONTEXT_MENU,vt.F1,vt.F2,vt.F3,vt.F4,vt.F5,vt.F6,vt.F7,vt.F8,vt.F9,vt.F10,vt.F11,vt.F12].includes(i)}var bbt=function(e,t){var n=C.useRef(null),r=C.useRef(!1),o=e.prefixCls,s=e.open,a=e.mode,l=e.showSearch,c=e.tokenWithEnter,u=e.autoClearSearchValue,d=e.onSearch,h=e.onSearchSubmit,f=e.onToggleOpen,g=e.onInputKeyDown,p=e.domRef;C.useImperativeHandle(t,function(){return{focus:function(){n.current.focus()},blur:function(){n.current.blur()}}});var v=JSe(0),m=Ae(v,2),_=m[0],y=m[1],S=function(G){var U=G.which;(U===vt.UP||U===vt.DOWN)&&G.preventDefault(),g&&g(G),U===vt.ENTER&&a==="tags"&&!r.current&&!s&&(h==null||h(G.target.value)),_bt(U)&&f(!0)},L=function(){y(!0)},E=C.useRef(null),D=function(G){d(G,!0,r.current)!==!1&&f(!0)},k=function(){r.current=!0},T=function(G){r.current=!1,a!=="combobox"&&D(G.target.value)},M=function(G){var U=G.target.value;if(c&&E.current&&/[\r\n]/.test(E.current)){var K=E.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");U=U.replace(K,E.current)}E.current=null,D(U)},A=function(G){var U=G.clipboardData,K=U.getData("text");E.current=K},N=function(G){var U=G.target;if(U!==n.current){var K=document.body.style.msTouchAction!==void 0;K?setTimeout(function(){n.current.focus()}):n.current.focus()}},R=function(G){var U=_();G.target!==n.current&&!U&&a!=="combobox"&&G.preventDefault(),(a!=="combobox"&&(!l||!U)||!s)&&(s&&u!==!1&&d("",!0,!1),f())},F={inputRef:n,onInputKeyDown:S,onInputMouseDown:L,onInputChange:M,onInputPaste:A,onInputCompositionStart:k,onInputCompositionEnd:T},W=a==="multiple"||a==="tags"?C.createElement(mbt,St({},e,F)):C.createElement(vbt,St({},e,F));return C.createElement("div",{ref:p,className:"".concat(o,"-selector"),onClick:N,onMouseDown:R},W)},oxe=C.forwardRef(bbt);oxe.displayName="Selector";var iue=C.createContext(null);function rue(i){return i?Array.isArray(i)?i:[i]:[]}function Cbt(i,e,t,n){return C.useMemo(function(){var r=rue(t??e),o=rue(n??e),s=new Set(r),a=new Set(o);return i&&(s.has("hover")&&(s.delete("hover"),s.add("click")),a.has("hover")&&(a.delete("hover"),a.add("click"))),[s,a]},[i,e,t,n])}function ybt(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2?arguments[2]:void 0;return t?i[0]===e[0]:i[0]===e[0]&&i[1]===e[1]}function wbt(i,e,t,n){for(var r=t.points,o=Object.keys(i),s=0;s0&&arguments[0]!==void 0?arguments[0]:"";return[i[0],i[1]]}function v1(i,e){var t=e[0],n=e[1],r,o;return t==="t"?o=i.y:t==="b"?o=i.y+i.height:o=i.y+i.height/2,n==="l"?r=i.x:n==="r"?r=i.x+i.width:r=i.x+i.width/2,{x:r,y:o}}function hm(i,e){var t={t:"b",b:"t",l:"r",r:"l"};return i.map(function(n,r){return r===e?t[n]||"c":n}).join("")}function xbt(i,e,t,n,r,o,s){var a=C.useState({ready:!1,offsetX:0,offsetY:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:r[n]||{}}),l=Ae(a,2),c=l[0],u=l[1],d=C.useRef(0),h=C.useMemo(function(){return e?aK(e):[]},[e]),f=C.useRef({}),g=function(){f.current={}};i||g();var p=tc(function(){if(e&&t&&i){let zo=function(Pa,Oa){var Bl=M.x+Pa,cl=M.y+Oa,Wl=Bl+J,_u=cl+Y,bu=Math.max(Bl,de.left),xc=Math.max(cl,de.top),Fa=Math.min(Wl,de.right),Ba=Math.min(_u,de.bottom);return Math.max(0,(Fa-bu)*(Ba-xc))},bo=function(){Mn=M.y+nt,zt=Mn+Y,Qt=M.x+Ue,lt=Qt+J};var _=e,y=_.style.left,S=_.style.top,L=_.ownerDocument,E=TT(_),D=te(te({},r[n]),o);_.style.left="0",_.style.top="0";var k;if(Array.isArray(t))k={x:t[0],y:t[1],width:0,height:0};else{var T=t.getBoundingClientRect();k={x:T.x,y:T.y,width:T.width,height:T.height}}var M=_.getBoundingClientRect(),A=E.getComputedStyle(_),N=A.width,R=A.height,F=L.documentElement,W=F.clientWidth,H=F.clientHeight,G=F.scrollWidth,U=F.scrollHeight,K=F.scrollTop,re=F.scrollLeft,Y=M.height,J=M.width,Q=k.height,ue=k.width,de=D.htmlRegion==="scroll"?{left:-re,top:-K,right:G-re,bottom:U-K}:{left:0,top:0,right:W,bottom:H};de=Sbt(de,h),_.style.left=y,_.style.top=S;var _e=ZO(Math.round(J/parseFloat(N)*1e3)/1e3),ve=ZO(Math.round(Y/parseFloat(R)*1e3)/1e3);if(_e===0||ve===0||FO(t)&&!DT(t))return;var Ve=D.offset,Ze=D.targetOffset,We=Ve||[],pe=Ae(We,2),Pe=pe[0],Se=Pe===void 0?0:Pe,Ne=pe[1],Me=Ne===void 0?0:Ne,Qe=Ze||[],Ke=Ae(Qe,2),Re=Ke[0],ct=Re===void 0?0:Re,ie=Ke[1],le=ie===void 0?0:ie;k.x+=ct,k.y+=le;var ce=D.points||[],z=Ae(ce,2),q=z[0],oe=z[1],ne=sue(oe),he=sue(q),Le=v1(k,ne),Fe=v1(M,he),ze=te({},D),Ue=Le.x-Fe.x+Se,nt=Le.y-Fe.y+Me,it=zo(Ue,nt),at=v1(k,["t","l"]),tt=v1(M,["t","l"]),Zt=v1(k,["b","r"]),Tt=v1(M,["b","r"]),xn=D.overflow||{},rt=xn.adjustX,wt=xn.adjustY,Bt=xn.shiftX,Nt=xn.shiftY,nn=function(Oa){return typeof Oa=="boolean"?Oa:Oa>=0},Mn,zt,Qt,lt;bo();var ut=nn(wt),dt=he[0]===ne[0];if(ut&&he[0]==="t"&&(zt>de.bottom||f.current.bt)){var Mt=nt;dt?Mt-=Y-Q:Mt=at.y-Tt.y-Me,zo(Ue,Mt)>=it?(f.current.bt=!0,nt=Mt,ze.points=[hm(he,0),hm(ne,0)]):f.current.bt=!1}if(ut&&he[0]==="b"&&(Mn=it?(f.current.tb=!0,nt=Kt,ze.points=[hm(he,0),hm(ne,0)]):f.current.tb=!1}var mn=nn(rt),lr=he[1]===ne[1];if(mn&&he[1]==="l"&&(lt>de.right||f.current.rl)){var nr=Ue;lr?nr-=J-ue:nr=at.x-Tt.x-Se,zo(nr,nt)>=it?(f.current.rl=!0,Ue=nr,ze.points=[hm(he,1),hm(ne,1)]):f.current.rl=!1}if(mn&&he[1]==="r"&&(Qt=it?(f.current.lr=!0,Ue=Hr,ze.points=[hm(he,1),hm(ne,1)]):f.current.lr=!1}bo();var Jn=Bt===!0?0:Bt;typeof Jn=="number"&&(Qtde.right&&(Ue-=lt-de.right,k.x>de.right-Jn&&(Ue+=k.x-de.right+Jn)));var Ii=Nt===!0?0:Nt;typeof Ii=="number"&&(Mnde.bottom&&(nt-=zt-de.bottom,k.y>de.bottom-Ii&&(nt+=k.y-de.bottom+Ii)));var _o=M.x+Ue,No=_o+J,bs=M.y+nt,Cs=bs+Y,$t=k.x,we=$t+ue,bt=k.y,xt=bt+Q,Gn=Math.max(_o,$t),cr=Math.min(No,we),Vr=(Gn+cr)/2,ei=Vr-_o,Qr=Math.max(bs,bt),Fs=Math.min(Cs,xt),Fl=(Qr+Fs)/2,Aa=Fl-bs;s==null||s(e,ze),u({ready:!0,offsetX:Ue/_e,offsetY:nt/ve,arrowX:ei/_e,arrowY:Aa/ve,scaleX:_e,scaleY:ve,align:ze})}}),v=function(){d.current+=1;var y=d.current;Promise.resolve().then(function(){d.current===y&&p()})},m=function(){u(function(y){return te(te({},y),{},{ready:!1})})};return br(m,[n]),br(function(){i||m()},[i]),[c.ready,c.offsetX,c.offsetY,c.arrowX,c.arrowY,c.scaleX,c.scaleY,c.align,v]}function Lbt(i,e,t,n){br(function(){if(i&&e&&t){let u=function(){n()};var r=e,o=t,s=aK(r),a=aK(o),l=TT(o),c=new Set([l].concat(ft(s),ft(a)));return c.forEach(function(d){d.addEventListener("scroll",u,{passive:!0})}),l.addEventListener("resize",u,{passive:!0}),n(),function(){c.forEach(function(d){d.removeEventListener("scroll",u),l.removeEventListener("resize",u)})}}},[i,e,t])}function Ebt(i){var e=i.prefixCls,t=i.align,n=i.arrowX,r=n===void 0?0:n,o=i.arrowY,s=o===void 0?0:o,a=C.useRef();if(!t||!t.points)return null;var l={position:"absolute"};if(t.autoArrow!==!1){var c=t.points[0],u=t.points[1],d=c[0],h=c[1],f=u[0],g=u[1];d===f||!["t","b"].includes(d)?l.top=s:d==="t"?l.top=0:l.bottom=0,h===g||!["l","r"].includes(h)?l.left=r:h==="l"?l.left=0:l.right=0}return C.createElement("div",{ref:a,className:"".concat(e,"-arrow"),style:l})}function Dbt(i){var e=i.prefixCls,t=i.open,n=i.zIndex,r=i.mask,o=i.motion;return r?React.createElement(fd,St({},o,{motionAppear:!0,visible:t,removeOnLeave:!0}),function(s){var a=s.className;return React.createElement("div",{style:{zIndex:n},className:xe("".concat(e,"-mask"),a)})}):null}var Ibt=C.memo(function(i){var e=i.children;return e},function(i,e){return e.cache}),kbt=C.forwardRef(function(i,e){var t=i.popup,n=i.className,r=i.prefixCls,o=i.style,s=i.target,a=i.onVisibleChanged,l=i.open,c=i.keepDom,u=i.onClick,d=i.mask,h=i.arrow,f=i.align,g=i.arrowX,p=i.arrowY,v=i.motion,m=i.maskMotion,_=i.forceRender,y=i.getPopupContainer,S=i.autoDestroy,L=i.portal,E=i.zIndex,D=i.onMouseEnter,k=i.onMouseLeave,T=i.ready,M=i.offsetX,A=i.offsetY,N=i.onAlign,R=i.onPrepare,F=i.stretch,W=i.targetWidth,H=i.targetHeight,G=typeof t=="function"?t():t,U=l||c,K=(y==null?void 0:y.length)>0,re=C.useState(!y||!K),Y=Ae(re,2),J=Y[0],Q=Y[1];if(br(function(){!J&&K&&s&&Q(!0)},[J,K,s]),!J)return null;var ue=T||!l?{left:M,top:A}:{left:"-1000vw",top:"-1000vh"},de={};return F&&(F.includes("height")&&H?de.height=H:F.includes("minHeight")&&H&&(de.minHeight=H),F.includes("width")&&W?de.width=W:F.includes("minWidth")&&W&&(de.minWidth=W)),l||(de.pointerEvents="none"),C.createElement(L,{open:_||U,getContainer:y&&function(){return y(s)},autoDestroy:S},C.createElement(Dbt,{prefixCls:r,open:l,zIndex:E,mask:d,motion:m}),C.createElement(Nh,{onResize:N,disabled:!l},function(_e){return C.createElement(fd,St({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:_,leavedClassName:"".concat(r,"-hidden")},v,{onAppearPrepare:R,onEnterPrepare:R,visible:l,onVisibleChanged:function(Ve){var Ze;v==null||(Ze=v.onVisibleChanged)===null||Ze===void 0||Ze.call(v,Ve),a(Ve)}}),function(ve,Ve){var Ze=ve.className,We=ve.style,pe=xe(r,Ze,n);return C.createElement("div",{ref:vu(_e,e,Ve),className:pe,style:te(te(te(te({},ue),de),We),{},{boxSizing:"border-box",zIndex:E},o),onMouseEnter:D,onMouseLeave:k,onClick:u},h&&C.createElement(Ebt,{prefixCls:r,align:f,arrowX:g,arrowY:p}),C.createElement(Ibt,{cache:!l},G))})}))}),Tbt=C.forwardRef(function(i,e){var t=i.children,n=i.getTriggerDOMNode,r=W_(t),o=C.useCallback(function(a){tk(e,n?n(a):a)},[n]),s=x5(o,t.ref);return r?C.cloneElement(t,{ref:s}):t}),Nbt=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function Rbt(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:jZ,e=C.forwardRef(function(t,n){var r=t.prefixCls,o=r===void 0?"rc-trigger-popup":r,s=t.children,a=t.action,l=a===void 0?"hover":a,c=t.showAction,u=t.hideAction,d=t.popupVisible,h=t.defaultPopupVisible,f=t.onPopupVisibleChange,g=t.afterPopupVisibleChange,p=t.mouseEnterDelay,v=t.mouseLeaveDelay,m=v===void 0?.1:v,_=t.focusDelay,y=t.blurDelay,S=t.mask,L=t.maskClosable,E=L===void 0?!0:L,D=t.getPopupContainer,k=t.forceRender,T=t.autoDestroy,M=t.destroyPopupOnHide,A=t.popup,N=t.popupClassName,R=t.popupStyle,F=t.popupPlacement,W=t.builtinPlacements,H=W===void 0?{}:W,G=t.popupAlign,U=t.zIndex,K=t.stretch,re=t.getPopupClassNameFromAlign,Y=t.alignPoint,J=t.onPopupClick,Q=t.onPopupAlign,ue=t.arrow,de=t.popupMotion,_e=t.maskMotion,ve=t.popupTransitionName,Ve=t.popupAnimation,Ze=t.maskTransitionName,We=t.maskAnimation,pe=t.className,Pe=t.getTriggerDOMNode,Se=Nn(t,Nbt),Ne=T||M||!1,Me=C.useState(!1),Qe=Ae(Me,2),Ke=Qe[0],Re=Qe[1];br(function(){Re(P5())},[]);var ct=C.useRef({}),ie=C.useContext(iue),le=C.useMemo(function(){return{registerSubPopup:function(Yn,Qi){ct.current[Yn]=Qi,ie==null||ie.registerSubPopup(Yn,Qi)}}},[ie]),ce=MSe(),z=C.useState(null),q=Ae(z,2),oe=q[0],ne=q[1],he=tc(function(fn){FO(fn)&&oe!==fn&&ne(fn),ie==null||ie.registerSubPopup(ce,fn)}),Le=C.useState(null),Fe=Ae(Le,2),ze=Fe[0],Ue=Fe[1],nt=tc(function(fn){FO(fn)&&ze!==fn&&Ue(fn)}),it=C.Children.only(s),at=(it==null?void 0:it.props)||{},tt={},Zt=tc(function(fn){var Yn,Qi,Ar=ze;return(Ar==null?void 0:Ar.contains(fn))||(Ar==null||(Yn=Ar.getRootNode())===null||Yn===void 0?void 0:Yn.host)===fn||fn===Ar||(oe==null?void 0:oe.contains(fn))||(oe==null||(Qi=oe.getRootNode())===null||Qi===void 0?void 0:Qi.host)===fn||fn===oe||Object.values(ct.current).some(function(zr){return(zr==null?void 0:zr.contains(fn))||fn===zr})}),Tt=oue(o,de,Ve,ve),xn=oue(o,_e,We,Ze),rt=C.useState(h||!1),wt=Ae(rt,2),Bt=wt[0],Nt=wt[1],nn=d??Bt,Mn=tc(function(fn){d===void 0&&Nt(fn)});br(function(){Nt(d||!1)},[d]);var zt=C.useRef(nn);zt.current=nn;var Qt=tc(function(fn){nn!==fn&&(Mn(fn),f==null||f(fn))}),lt=C.useRef(),ut=function(){clearTimeout(lt.current)},dt=function(Yn){var Qi=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;ut(),Qi===0?Qt(Yn):lt.current=setTimeout(function(){Qt(Yn)},Qi*1e3)};C.useEffect(function(){return ut},[]);var Mt=C.useState(!1),Kt=Ae(Mt,2),mn=Kt[0],lr=Kt[1],nr=C.useRef(!0);br(function(){(!nr.current||nn)&&lr(!0),nr.current=!0},[nn]);var Hr=C.useState(null),Jn=Ae(Hr,2),Ii=Jn[0],_o=Jn[1],No=C.useState([0,0]),bs=Ae(No,2),Cs=bs[0],$t=bs[1],we=function(Yn){$t([Yn.clientX,Yn.clientY])},bt=xbt(nn,oe,Y?Cs:ze,F,H,G,Q),xt=Ae(bt,9),Gn=xt[0],cr=xt[1],Vr=xt[2],ei=xt[3],Qr=xt[4],Fs=xt[5],Fl=xt[6],Aa=xt[7],zo=xt[8],bo=tc(function(){mn||zo()});Lbt(nn,ze,oe,bo),br(function(){bo()},[Cs]),br(function(){nn&&!(H!=null&&H[F])&&bo()},[JSON.stringify(G)]);var Pa=C.useMemo(function(){var fn=wbt(H,o,Aa,Y);return xe(fn,re==null?void 0:re(Aa))},[Aa,re,H,o,Y]);C.useImperativeHandle(n,function(){return{forceAlign:bo}});var Oa=function(Yn){lr(!1),zo(),g==null||g(Yn)},Bl=function(){return new Promise(function(Yn){_o(function(){return Yn})})};br(function(){Ii&&(zo(),Ii(),_o(null))},[Ii]);var cl=C.useState(0),Wl=Ae(cl,2),_u=Wl[0],bu=Wl[1],xc=C.useState(0),Fa=Ae(xc,2),Ba=Fa[0],qt=Fa[1],Ft=function(Yn,Qi){if(bo(),K){var Ar=Qi.getBoundingClientRect();bu(Ar.width),qt(Ar.height)}},Pn=Cbt(Ke,l,c,u),Xt=Ae(Pn,2),Gt=Xt[0],oi=Xt[1],Fi=function(Yn,Qi,Ar,zr){tt[Yn]=function(kC){var og;zr==null||zr(kC),dt(Qi,Ar);for(var ix=arguments.length,zT=new Array(ix>1?ix-1:0),TC=1;TC1?Qi-1:0),zr=1;zr1?Qi-1:0),zr=1;zr1&&arguments[1]!==void 0?arguments[1]:{},t=e.fieldNames,n=e.childrenAsData,r=[],o=lxe(t,!1),s=o.label,a=o.value,l=o.options;function c(u,d){u.forEach(function(h){var f=h[s];if(d||!(l in h)){var g=h[a];r.push({key:aue(h,r.length),groupOption:d,data:h,label:f,value:g})}else{var p=f;p===void 0&&n&&(p=h.label),r.push({key:aue(h,r.length),group:!0,data:h,label:p}),c(h[l],!0)}})}return c(i,!1),r}function lK(i){var e=te({},i);return"props"in e||Object.defineProperty(e,"props",{get:function(){return ao(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),e}}),e}function Fbt(i,e){if(!e||!e.length)return null;var t=!1;function n(o,s){var a=Uwe(s),l=a[0],c=a.slice(1);if(!l)return[o];var u=o.split(l);return t=t||u.length>1,u.reduce(function(d,h){return[].concat(ft(d),ft(n(h,c)))},[]).filter(function(d){return d})}var r=n(i,e);return t?r:null}var Bbt=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","showArrow","inputIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],Wbt=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"];function cK(i){return i==="tags"||i==="multiple"}var $bt=C.forwardRef(function(i,e){var t,n,r=i.id,o=i.prefixCls,s=i.className,a=i.showSearch,l=i.tagRender,c=i.direction,u=i.omitDomProps,d=i.displayValues,h=i.onDisplayValuesChange,f=i.emptyOptions,g=i.notFoundContent,p=g===void 0?"Not Found":g,v=i.onClear,m=i.mode,_=i.disabled,y=i.loading,S=i.getInputElement,L=i.getRawInputElement,E=i.open,D=i.defaultOpen,k=i.onDropdownVisibleChange,T=i.activeValue,M=i.onActiveValueChange,A=i.activeDescendantId,N=i.searchValue,R=i.autoClearSearchValue,F=i.onSearch,W=i.onSearchSplit,H=i.tokenSeparators,G=i.allowClear,U=i.showArrow,K=i.inputIcon,re=i.clearIcon,Y=i.OptionList,J=i.animation,Q=i.transitionName,ue=i.dropdownStyle,de=i.dropdownClassName,_e=i.dropdownMatchSelectWidth,ve=i.dropdownRender,Ve=i.dropdownAlign,Ze=i.placement,We=i.builtinPlacements,pe=i.getPopupContainer,Pe=i.showAction,Se=Pe===void 0?[]:Pe,Ne=i.onFocus,Me=i.onBlur,Qe=i.onKeyUp,Ke=i.onKeyDown,Re=i.onMouseDown,ct=Nn(i,Bbt),ie=cK(m),le=(a!==void 0?a:ie)||m==="combobox",ce=te({},ct);Wbt.forEach(function(qt){delete ce[qt]}),u==null||u.forEach(function(qt){delete ce[qt]});var z=C.useState(!1),q=Ae(z,2),oe=q[0],ne=q[1];C.useEffect(function(){ne(P5())},[]);var he=C.useRef(null),Le=C.useRef(null),Fe=C.useRef(null),ze=C.useRef(null),Ue=C.useRef(null),nt=Z0t(),it=Ae(nt,3),at=it[0],tt=it[1],Zt=it[2];C.useImperativeHandle(e,function(){var qt,Ft;return{focus:(qt=ze.current)===null||qt===void 0?void 0:qt.focus,blur:(Ft=ze.current)===null||Ft===void 0?void 0:Ft.blur,scrollTo:function(Xt){var Gt;return(Gt=Ue.current)===null||Gt===void 0?void 0:Gt.scrollTo(Xt)}}});var Tt=C.useMemo(function(){var qt;if(m!=="combobox")return N;var Ft=(qt=d[0])===null||qt===void 0?void 0:qt.value;return typeof Ft=="string"||typeof Ft=="number"?String(Ft):""},[N,m,d]),xn=m==="combobox"&&typeof S=="function"&&S()||null,rt=typeof L=="function"&&L(),wt=x5(Le,rt==null||(t=rt.props)===null||t===void 0?void 0:t.ref),Bt=C.useState(!1),Nt=Ae(Bt,2),nn=Nt[0],Mn=Nt[1];br(function(){Mn(!0)},[]);var zt=Ja(!1,{defaultValue:D,value:E}),Qt=Ae(zt,2),lt=Qt[0],ut=Qt[1],dt=nn?lt:!1,Mt=!p&&f;(_||Mt&&dt&&m==="combobox")&&(dt=!1);var Kt=Mt?!1:dt,mn=C.useCallback(function(qt){var Ft=qt!==void 0?qt:!dt;_||(ut(Ft),dt!==Ft&&(k==null||k(Ft)))},[_,dt,ut,k]),lr=C.useMemo(function(){return(H||[]).some(function(qt){return[` `,`\r -`].includes(qt)})},[H]),nr=function(Ft,Pn,Xt){var Gt=!0,oi=Ft;M==null||M(null);var Fi=Xt?null:Fbt(Ft,H);return m!=="combobox"&&Fi&&(oi="",W==null||W(Fi),mn(!1),Gt=!1),F&&Tt!==oi&&F(oi,{source:Pn?"typing":"effect"}),Gt},Hr=function(Ft){!Ft||!Ft.trim()||F(Ft,{source:"submit"})};C.useEffect(function(){!dt&&!ie&&m!=="combobox"&&nr("",!1,!1)},[dt]),C.useEffect(function(){lt&&_&&ut(!1),_&&tt(!1)},[_]);var Jn=JSe(),Ii=Ae(Jn,2),_o=Ii[0],No=Ii[1],bs=function(Ft){var Pn=_o(),Xt=Ft.which;if(Xt===vt.ENTER&&(m!=="combobox"&&Ft.preventDefault(),dt||mn(!0)),No(!!Tt),Xt===vt.BACKSPACE&&!Pn&&ie&&!Tt&&d.length){for(var Gt=ft(d),oi=null,Fi=Gt.length-1;Fi>=0;Fi-=1){var Co=Gt[Fi];if(!Co.disabled){Gt.splice(Fi,1),oi=Co;break}}oi&&h(Gt,{type:"remove",values:[oi]})}for(var Bs=arguments.length,ul=new Array(Bs>1?Bs-1:0),Ws=1;Ws1?Pn-1:0),Gt=1;Gt1?Fi-1:0),Bs=1;Bs1&&arguments[1]!==void 0?arguments[1]:!1;return rd(i).map(function(t,n){if(!C.isValidElement(t)||!t.type)return null;var r=t,o=r.type.isSelectOptGroup,s=r.key,a=r.props,l=a.children,c=Nn(a,Gbt);return e||!o?qbt(t):te(te({key:"__RC_SELECT_GRP__".concat(s===null?n:s,"__"),label:s},c),{},{options:cxe(l)})}).filter(function(t){return t})}function Xbt(i,e,t,n,r){return C.useMemo(function(){var o=i,s=!i;s&&(o=cxe(e));var a=new Map,l=new Map,c=function(h,f,g){g&&typeof g=="string"&&h.set(f[g],f)};function u(d){for(var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,f=0;fl},n}return _s(t,[{key:"componentDidMount",value:function(){this.scrollbarRef.current.addEventListener("touchstart",this.onScrollbarTouchStart),this.thumbRef.current.addEventListener("touchstart",this.onMouseDown)}},{key:"componentDidUpdate",value:function(r){r.scrollTop!==this.props.scrollTop&&this.delayHidden()}},{key:"componentWillUnmount",value:function(){this.removeEvents(),clearTimeout(this.visibleTimeout)}},{key:"render",value:function(){var r=this.state,o=r.dragging,s=r.visible,a=this.props.prefixCls,l=this.getSpinHeight(),c=this.getTop(),u=this.showScroll(),d=u&&s;return C.createElement("div",{ref:this.scrollbarRef,className:xe("".concat(a,"-scrollbar"),be({},"".concat(a,"-scrollbar-show"),u)),style:{width:8,top:0,bottom:0,right:0,position:"absolute",display:d?null:"none"},onMouseDown:this.onContainerMouseDown,onMouseMove:this.delayHidden},C.createElement("div",{ref:this.thumbRef,className:xe("".concat(a,"-scrollbar-thumb"),be({},"".concat(a,"-scrollbar-thumb-moving"),o)),style:{width:"100%",height:l,top:c,left:0,position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"},onMouseDown:this.onMouseDown}))}}]),t}(C.Component);function Qbt(i){var e=i.children,t=i.setRef,n=C.useCallback(function(r){t(r)},[]);return C.cloneElement(e,{ref:n})}function Jbt(i,e,t,n,r,o){var s=o.getKey;return i.slice(e,t+1).map(function(a,l){var c=e+l,u=r(a,c,{}),d=s(a);return C.createElement(Qbt,{key:d,setRef:function(f){return n(a,f)}},u)})}var eCt=function(){function i(){vs(this,i),this.maps=void 0,this.maps=Object.create(null)}return _s(i,[{key:"set",value:function(t,n){this.maps[t]=n}},{key:"get",value:function(t){return this.maps[t]}}]),i}();function tCt(i,e,t){var n=C.useState(0),r=Ae(n,2),o=r[0],s=r[1],a=C.useRef(new Map),l=C.useRef(new eCt),c=C.useRef();function u(){Zi.cancel(c.current)}function d(){u(),c.current=Zi(function(){a.current.forEach(function(f,g){if(f&&f.offsetParent){var p=nk(f),v=p.offsetHeight;l.current.get(g)!==v&&l.current.set(g,p.offsetHeight)}}),s(function(f){return f+1})})}function h(f,g){var p=i(f),v=a.current.get(p);g?(a.current.set(p,g),d()):a.current.delete(p),!v!=!g&&(g?e==null||e(f):t==null||t(f))}return C.useEffect(function(){return u},[]),[h,d,l.current,o]}function nCt(i,e,t,n,r,o,s,a){var l=C.useRef();return function(c){if(c==null){a();return}if(Zi.cancel(l.current),typeof c=="number")s(c);else if(c&&zn(c)==="object"){var u,d=c.align;"index"in c?u=c.index:u=e.findIndex(function(p){return r(p)===c.key});var h=c.offset,f=h===void 0?0:h,g=function p(v,m){if(!(v<0||!i.current)){var _=i.current.clientHeight,y=!1,S=m;if(_){for(var L=m||d,E=0,D=0,k=0,T=Math.min(e.length,u),M=0;M<=T;M+=1){var A=r(e[M]);D=E;var N=t.get(A);k=D+(N===void 0?n:N),E=k,M===u&&N===void 0&&(y=!0)}var R=null;switch(L){case"top":R=D-f;break;case"bottom":R=k-_+f;break;default:{var F=i.current.scrollTop,W=F+_;DW&&(S="bottom")}}R!==null&&R!==i.current.scrollTop&&s(R)}l.current=Zi(function(){y&&o(),p(v-1,S)},2)}};g(3)}}}function iCt(i,e,t){var n=i.length,r=e.length,o,s;if(n===0&&r===0)return null;n"u"?"undefined":zn(navigator))==="object"&&/Firefox/i.test(navigator.userAgent);const dxe=function(i,e){var t=C.useRef(!1),n=C.useRef(null);function r(){clearTimeout(n.current),t.current=!0,n.current=setTimeout(function(){t.current=!1},50)}var o=C.useRef({top:i,bottom:e});return o.current.top=i,o.current.bottom=e,function(s){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l=s<0&&o.current.top||s>0&&o.current.bottom;return a&&l?(clearTimeout(n.current),t.current=!1):(!l||t.current)&&r(),!t.current&&l}};function sCt(i,e,t,n){var r=C.useRef(0),o=C.useRef(null),s=C.useRef(null),a=C.useRef(!1),l=dxe(e,t);function c(d){if(i){Zi.cancel(o.current);var h=d.deltaY;r.current+=h,s.current=h,!l(h)&&(oCt||d.preventDefault(),o.current=Zi(function(){var f=a.current?10:1;n(r.current*f),r.current=0}))}}function u(d){i&&(a.current=d.detail===s.current)}return[c,u]}var aCt=14/15;function lCt(i,e,t){var n=C.useRef(!1),r=C.useRef(0),o=C.useRef(null),s=C.useRef(null),a,l=function(h){if(n.current){var f=Math.ceil(h.touches[0].pageY),g=r.current-f;r.current=f,t(g)&&h.preventDefault(),clearInterval(s.current),s.current=setInterval(function(){g*=aCt,(!t(g,!0)||Math.abs(g)<=.1)&&clearInterval(s.current)},16)}},c=function(){n.current=!1,a()},u=function(h){a(),h.touches.length===1&&!n.current&&(n.current=!0,r.current=Math.ceil(h.touches[0].pageY),o.current=h.target,o.current.addEventListener("touchmove",l),o.current.addEventListener("touchend",c))};a=function(){o.current&&(o.current.removeEventListener("touchmove",l),o.current.removeEventListener("touchend",c))},br(function(){return i&&e.current.addEventListener("touchstart",u),function(){var d;(d=e.current)===null||d===void 0||d.removeEventListener("touchstart",u),a(),clearInterval(s.current)}},[i])}var cCt=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","component","onScroll","onVisibleChange","innerProps"],uCt=[],dCt={overflowY:"auto",overflowAnchor:"none"};function hCt(i,e){var t=i.prefixCls,n=t===void 0?"rc-virtual-list":t,r=i.className,o=i.height,s=i.itemHeight,a=i.fullHeight,l=a===void 0?!0:a,c=i.style,u=i.data,d=i.children,h=i.itemKey,f=i.virtual,g=i.component,p=g===void 0?"div":g,v=i.onScroll,m=i.onVisibleChange,_=i.innerProps,y=Nn(i,cCt),S=!!(f!==!1&&o&&s),L=S&&u&&s*u.length>o,E=C.useState(0),D=Ae(E,2),k=D[0],T=D[1],M=C.useState(!1),A=Ae(M,2),N=A[0],R=A[1],F=xe(n,r),W=u||uCt,H=C.useRef(),G=C.useRef(),U=C.useRef(),K=C.useCallback(function(it){return typeof h=="function"?h(it):it==null?void 0:it[h]},[h]),re={getKey:K};function Y(it){T(function(at){var tt;typeof it=="function"?tt=it(at):tt=it;var Zt=ie(tt);return H.current.scrollTop=Zt,Zt})}var J=C.useRef({start:0,end:W.length}),Q=C.useRef(),ue=rCt(W,K),de=Ae(ue,1),_e=de[0];Q.current=_e;var ve=tCt(K,null,null),Ve=Ae(ve,4),Ze=Ve[0],We=Ve[1],pe=Ve[2],Pe=Ve[3],Se=C.useMemo(function(){if(!S)return{scrollHeight:void 0,start:0,end:W.length-1,offset:void 0};if(!L){var it;return{scrollHeight:((it=G.current)===null||it===void 0?void 0:it.offsetHeight)||0,start:0,end:W.length-1,offset:void 0}}for(var at=0,tt,Zt,Tt,xn=W.length,rt=0;rt=k&&tt===void 0&&(tt=rt,Zt=at),nn>k+o&&Tt===void 0&&(Tt=rt),at=nn}return tt===void 0&&(tt=0,Zt=0,Tt=Math.ceil(o/s)),Tt===void 0&&(Tt=W.length-1),Tt=Math.min(Tt+1,W.length),{scrollHeight:at,start:tt,end:Tt,offset:Zt}},[L,S,k,W,Pe,o]),Ne=Se.scrollHeight,Me=Se.start,Qe=Se.end,Ke=Se.offset;J.current.start=Me,J.current.end=Qe;var Re=Ne-o,ct=C.useRef(Re);ct.current=Re;function ie(it){var at=it;return Number.isNaN(ct.current)||(at=Math.min(at,ct.current)),at=Math.max(at,0),at}var le=k<=0,ce=k>=Re,z=dxe(le,ce);function q(it){var at=it;Y(at)}function oe(it){var at=it.currentTarget.scrollTop;at!==k&&Y(at),v==null||v(it)}var ne=sCt(S,le,ce,function(it){Y(function(at){var tt=at+it;return tt})}),he=Ae(ne,2),Le=he[0],Fe=he[1];lCt(S,H,function(it,at){return z(it,at)?!1:(Le({preventDefault:function(){},deltaY:it}),!0)}),br(function(){function it(at){S&&at.preventDefault()}return H.current.addEventListener("wheel",Le),H.current.addEventListener("DOMMouseScroll",Fe),H.current.addEventListener("MozMousePixelScroll",it),function(){H.current&&(H.current.removeEventListener("wheel",Le),H.current.removeEventListener("DOMMouseScroll",Fe),H.current.removeEventListener("MozMousePixelScroll",it))}},[S]);var ze=nCt(H,W,pe,s,K,We,Y,function(){var it;(it=U.current)===null||it===void 0||it.delayHidden()});C.useImperativeHandle(e,function(){return{scrollTo:ze}}),br(function(){if(m){var it=W.slice(Me,Qe+1);m(it,W)}},[Me,Qe,W]);var Ue=Jbt(W,Me,Qe,Ze,d,re),nt=null;return o&&(nt=te(be({},l?"height":"maxHeight",o),dCt),S&&(nt.overflowY="hidden",N&&(nt.pointerEvents="none"))),C.createElement("div",St({style:te(te({},c),{},{position:"relative"}),className:F},y),C.createElement(p,{className:"".concat(n,"-holder"),style:nt,ref:H,onScroll:oe},C.createElement(uxe,{prefixCls:n,height:Ne,offset:Ke,onInnerResize:We,ref:G,innerProps:_},Ue)),S&&C.createElement(Zbt,{ref:U,prefixCls:n,scrollTop:k,height:o,scrollHeight:Ne,count:W.length,onScroll:q,onStartMove:function(){R(!0)},onStopMove:function(){R(!1)}}))}var JZ=C.forwardRef(hCt);JZ.displayName="List";var hxe=C.createContext(null);function fCt(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var gCt=["disabled","title","children","style","className"];function due(i){return typeof i=="string"||typeof i=="number"}var pCt=function(e,t){var n=Y0t(),r=n.prefixCls,o=n.id,s=n.open,a=n.multiple,l=n.mode,c=n.searchValue,u=n.toggleOpen,d=n.notFoundContent,h=n.onPopupScroll,f=C.useContext(hxe),g=f.flattenOptions,p=f.onActiveValue,v=f.defaultActiveFirstOption,m=f.onSelect,_=f.menuItemSelectedIcon,y=f.rawValues,S=f.fieldNames,L=f.virtual,E=f.listHeight,D=f.listItemHeight,k="".concat(r,"-item"),T=LC(function(){return g},[s,g],function(_e,ve){return ve[0]&&_e[1]!==ve[1]}),M=C.useRef(null),A=function(ve){ve.preventDefault()},N=function(ve){M.current&&M.current.scrollTo(typeof ve=="number"?{index:ve}:ve)},R=function(ve){for(var Ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Ze=T.length,We=0;We1&&arguments[1]!==void 0?arguments[1]:!1;G(ve);var Ze={source:Ve?"keyboard":"mouse"},We=T[ve];if(!We){p(null,-1,Ze);return}p(We.value,ve,Ze)};C.useEffect(function(){U(v!==!1?R(0):-1)},[T.length,c]);var K=C.useCallback(function(_e){return y.has(_e)&&l!=="combobox"},[l,ft(y).toString(),y.size]);C.useEffect(function(){var _e=setTimeout(function(){if(!a&&s&&y.size===1){var Ve=Array.from(y)[0],Ze=T.findIndex(function(We){var pe=We.data;return pe.value===Ve});Ze!==-1&&(U(Ze),N(Ze))}});if(s){var ve;(ve=M.current)===null||ve===void 0||ve.scrollTo(void 0)}return function(){return clearTimeout(_e)}},[s,c,g.length]);var re=function(ve){ve!==void 0&&m(ve,{selected:!y.has(ve)}),a||u(!1)};if(C.useImperativeHandle(t,function(){return{onKeyDown:function(ve){var Ve=ve.which,Ze=ve.ctrlKey;switch(Ve){case vt.N:case vt.P:case vt.UP:case vt.DOWN:{var We=0;if(Ve===vt.UP?We=-1:Ve===vt.DOWN?We=1:fCt()&&Ze&&(Ve===vt.N?We=1:Ve===vt.P&&(We=-1)),We!==0){var pe=R(H+We,We);N(pe),U(pe,!0)}break}case vt.ENTER:{var Pe=T[H];Pe&&!Pe.data.disabled?re(Pe.value):re(void 0),s&&ve.preventDefault();break}case vt.ESC:u(!1),s&&ve.stopPropagation()}},onKeyUp:function(){},scrollTo:function(ve){N(ve)}}}),T.length===0)return C.createElement("div",{role:"listbox",id:"".concat(o,"_list"),className:"".concat(k,"-empty"),onMouseDown:A},d);var Y=Object.keys(S).map(function(_e){return S[_e]}),J=function(ve){return ve.label};function Q(_e,ve){var Ve=_e.group;return{role:Ve?"presentation":"option",id:"".concat(o,"_list_").concat(ve)}}var ue=function(ve){var Ve=T[ve];if(!Ve)return null;var Ze=Ve.data||{},We=Ze.value,pe=Ve.group,Pe=Bp(Ze,!0),Se=J(Ve);return Ve?C.createElement("div",St({"aria-label":typeof Se=="string"&&!pe?Se:null},Pe,{key:ve},Q(Ve,ve),{"aria-selected":K(We)}),We):null},de={role:"listbox",id:"".concat(o,"_list")};return C.createElement(C.Fragment,null,L&&C.createElement("div",St({},de,{style:{height:0,width:0,overflow:"hidden"}}),ue(H-1),ue(H),ue(H+1)),C.createElement(JZ,{itemKey:"key",ref:M,data:T,height:E,itemHeight:D,fullHeight:!1,onMouseDown:A,onScroll:h,virtual:L,innerProps:L?null:de},function(_e,ve){var Ve,Ze=_e.group,We=_e.groupOption,pe=_e.data,Pe=_e.label,Se=_e.value,Ne=pe.key;if(Ze){var Me,Qe=(Me=pe.title)!==null&&Me!==void 0?Me:due(Pe)?Pe.toString():void 0;return C.createElement("div",{className:xe(k,"".concat(k,"-group")),title:Qe},Pe!==void 0?Pe:Ne)}var Ke=pe.disabled,Re=pe.title;pe.children;var ct=pe.style,ie=pe.className,le=Nn(pe,gCt),ce=ll(le,Y),z=K(Se),q="".concat(k,"-option"),oe=xe(k,q,ie,(Ve={},be(Ve,"".concat(q,"-grouped"),We),be(Ve,"".concat(q,"-active"),H===ve&&!Ke),be(Ve,"".concat(q,"-disabled"),Ke),be(Ve,"".concat(q,"-selected"),z),Ve)),ne=J(_e),he=!_||typeof _=="function"||z,Le=typeof ne=="number"?ne:ne||Se,Fe=due(Le)?Le.toString():void 0;return Re!==void 0&&(Fe=Re),C.createElement("div",St({},Bp(ce),L?{}:Q(_e,ve),{"aria-selected":z,className:oe,title:Fe,onMouseMove:function(){H===ve||Ke||U(ve)},onClick:function(){Ke||re(Se)},style:ct}),C.createElement("div",{className:"".concat(q,"-content")},Le),C.isValidElement(_)||z,he&&C.createElement(YO,{className:"".concat(k,"-option-state"),customizeIcon:_,customizeIconProps:{isSelected:z}},z?"✓":null))}))},fxe=C.forwardRef(pCt);fxe.displayName="OptionList";var mCt=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","listHeight","listItemHeight","value","defaultValue","labelInValue","onChange"],vCt=["inputValue"];function _Ct(i){return!i||zn(i)!=="object"}var bCt=C.forwardRef(function(i,e){var t=i.id,n=i.mode,r=i.prefixCls,o=r===void 0?"rc-select":r,s=i.backfill,a=i.fieldNames,l=i.inputValue,c=i.searchValue,u=i.onSearch,d=i.autoClearSearchValue,h=d===void 0?!0:d,f=i.onSelect,g=i.onDeselect,p=i.dropdownMatchSelectWidth,v=p===void 0?!0:p,m=i.filterOption,_=i.filterSort,y=i.optionFilterProp,S=i.optionLabelProp,L=i.options,E=i.children,D=i.defaultActiveFirstOption,k=i.menuItemSelectedIcon,T=i.virtual,M=i.listHeight,A=M===void 0?200:M,N=i.listItemHeight,R=N===void 0?20:N,F=i.value,W=i.defaultValue,H=i.labelInValue,G=i.onChange,U=Nn(i,mCt),K=jbt(t),re=cK(n),Y=!!(!L&&E),J=C.useMemo(function(){return m===void 0&&n==="combobox"?!1:m},[m,n]),Q=C.useMemo(function(){return lxe(a,Y)},[JSON.stringify(a),Y]),ue=Ja("",{value:c!==void 0?c:l,postState:function(ut){return ut||""}}),de=Ae(ue,2),_e=de[0],ve=de[1],Ve=Xbt(L,E,Q,y,S),Ze=Ve.valueOptions,We=Ve.labelOptions,pe=Ve.options,Pe=C.useCallback(function(lt){var ut=ixe(lt);return ut.map(function(dt){var Mt,Kt,mn,lr,nr;if(_Ct(dt))Mt=dt;else{var Hr;mn=dt.key,Kt=dt.label,Mt=(Hr=dt.value)!==null&&Hr!==void 0?Hr:mn}var Jn=Ze.get(Mt);if(Jn){var Ii;Kt===void 0&&(Kt=Jn==null?void 0:Jn[S||Q.label]),mn===void 0&&(mn=(Ii=Jn==null?void 0:Jn.key)!==null&&Ii!==void 0?Ii:Mt),lr=Jn==null?void 0:Jn.disabled,nr=Jn==null?void 0:Jn.title}return{label:Kt,value:Mt,key:mn,disabled:lr,title:nr}})},[Q,S,Ze]),Se=Ja(W,{value:F}),Ne=Ae(Se,2),Me=Ne[0],Qe=Ne[1],Ke=C.useMemo(function(){var lt,ut=Pe(Me);return n==="combobox"&&!((lt=ut[0])!==null&<!==void 0&<.value)?[]:ut},[Me,Pe,n]),Re=Hbt(Ke,Ze),ct=Ae(Re,2),ie=ct[0],le=ct[1],ce=C.useMemo(function(){if(!n&&ie.length===1){var lt=ie[0];if(lt.value===null&&(lt.label===null||lt.label===void 0))return[]}return ie.map(function(ut){var dt;return te(te({},ut),{},{label:(dt=ut.label)!==null&&dt!==void 0?dt:ut.value})})},[n,ie]),z=C.useMemo(function(){return new Set(ie.map(function(lt){return lt.value}))},[ie]);C.useEffect(function(){if(n==="combobox"){var lt,ut=(lt=ie[0])===null||lt===void 0?void 0:lt.value;ve(fbt(ut)?String(ut):"")}},[ie]);var q=cue(function(lt,ut){var dt,Mt=ut??lt;return dt={},be(dt,Q.value,lt),be(dt,Q.label,Mt),dt}),oe=C.useMemo(function(){if(n!=="tags")return pe;var lt=ft(pe),ut=function(Mt){return Ze.has(Mt)};return ft(ie).sort(function(dt,Mt){return dt.value2&&arguments[2]!==void 0?arguments[2]:{},Mt=dt.source,Kt=Mt===void 0?"keyboard":Mt;xn(ut),s&&n==="combobox"&<!==null&&Kt==="keyboard"&&at(String(lt))},[s,n]),Bt=function(ut,dt,Mt){var Kt=function(){var Cs,$t=le(ut);return[H?{label:$t==null?void 0:$t[Q.label],value:ut,key:(Cs=$t==null?void 0:$t.key)!==null&&Cs!==void 0?Cs:ut}:ut,lK($t)]};if(dt&&f){var mn=Kt(),lr=Ae(mn,2),nr=lr[0],Hr=lr[1];f(nr,Hr)}else if(!dt&&g&&Mt!=="clear"){var Jn=Kt(),Ii=Ae(Jn,2),_o=Ii[0],No=Ii[1];g(_o,No)}},Nt=cue(function(lt,ut){var dt,Mt=re?ut.selected:!0;Mt?dt=re?[].concat(ft(ie),[lt]):[lt]:dt=ie.filter(function(Kt){return Kt.value!==lt}),ze(dt),Bt(lt,Mt),n==="combobox"?at(""):(!cK||h)&&(ve(""),at(""))}),nn=function(ut,dt){ze(ut);var Mt=dt.type,Kt=dt.values;(Mt==="remove"||Mt==="clear")&&Kt.forEach(function(mn){Bt(mn.value,!1,Mt)})},Mn=function(ut,dt){if(ve(ut),at(null),dt.source==="submit"){var Mt=(ut||"").trim();if(Mt){var Kt=Array.from(new Set([].concat(ft(z),[Mt])));ze(Kt),Bt(Mt,!0),ve("")}return}dt.source!=="blur"&&(n==="combobox"&&ze(ut),u==null||u(ut))},zt=function(ut){var dt=ut;n!=="tags"&&(dt=ut.map(function(Kt){var mn=We.get(Kt);return mn==null?void 0:mn.value}).filter(function(Kt){return Kt!==void 0}));var Mt=Array.from(new Set([].concat(ft(z),ft(dt))));ze(Mt),Mt.forEach(function(Kt){Bt(Kt,!0)})},Qt=C.useMemo(function(){var lt=T!==!1&&v!==!1;return te(te({},Ve),{},{flattenOptions:Fe,onActiveValue:wt,defaultActiveFirstOption:rt,onSelect:Nt,menuItemSelectedIcon:k,rawValues:z,fieldNames:Q,virtual:lt,listHeight:A,listItemHeight:R,childrenAsData:Y})},[Ve,Fe,wt,rt,Nt,k,z,Q,T,v,A,R,Y]);return C.createElement(hxe.Provider,{value:Qt},C.createElement($bt,St({},U,{id:K,prefixCls:o,ref:e,omitDomProps:vCt,mode:n,displayValues:ce,onDisplayValuesChange:nn,searchValue:_e,onSearch:Mn,autoClearSearchValue:h,onSearchSplit:zt,dropdownMatchSelectWidth:v,OptionList:fxe,emptyOptions:!Fe.length,activeValue:it,activeDescendantId:"".concat(K,"_list_").concat(Tt)})))}),eQ=bCt;eQ.Option=QZ;eQ.OptGroup=ZZ;function gxe(i,e,t){return function(r){const{prefixCls:o,style:s}=r,a=C.useRef(null),[l,c]=C.useState(0),[u,d]=C.useState(0),[h,f]=Ja(!1,{value:r.open}),{getPrefixCls:g}=C.useContext(Rn),p=g(e||"select",o);return C.useEffect(()=>{if(f(!0),typeof ResizeObserver<"u"){const v=new ResizeObserver(_=>{const y=_[0].target;c(y.offsetHeight+8),d(y.offsetWidth)}),m=setInterval(()=>{var _;const y=t?`.${t(p)}`:`.${p}-dropdown`,S=(_=a.current)===null||_===void 0?void 0:_.querySelector(y);S&&(clearInterval(m),v.observe(S))},10);return()=>{clearInterval(m),v.disconnect()}}},[]),C.createElement(LT,{theme:{token:{motionDurationFast:"0.01s",motionDurationMid:"0.01s",motionDurationSlow:"0.01s"}}},C.createElement("div",{ref:a,style:{paddingBottom:l,position:"relative",width:"fit-content",minWidth:u}},C.createElement(i,Object.assign({},r,{style:Object.assign(Object.assign({},s),{margin:0}),open:h,visible:h,getPopupContainer:()=>a.current}))))}}function Cp(i,e,t){return xe({[`${i}-status-success`]:e==="success",[`${i}-status-warning`]:e==="warning",[`${i}-status-error`]:e==="error",[`${i}-status-validating`]:e==="validating",[`${i}-has-feedback`]:t})}const O5=(i,e)=>e||i,CCt=()=>{const[,i]=DC(),e=new Yr(i.colorBgBase);let t={};return e.toHsl().l<.5&&(t={opacity:.65}),C.createElement("svg",{style:t,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},C.createElement("g",{fill:"none",fillRule:"evenodd"},C.createElement("g",{transform:"translate(24 31.67)"},C.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),C.createElement("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"}),C.createElement("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),C.createElement("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"}),C.createElement("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"})),C.createElement("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"}),C.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},C.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),C.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},yCt=CCt,wCt=()=>{const[,i]=DC(),{colorFill:e,colorFillTertiary:t,colorFillQuaternary:n,colorBgContainer:r}=i,{borderColor:o,shadowColor:s,contentColor:a}=C.useMemo(()=>({borderColor:new Yr(e).onBackground(r).toHexShortString(),shadowColor:new Yr(t).onBackground(r).toHexShortString(),contentColor:new Yr(n).onBackground(r).toHexShortString()}),[e,t,n,r]);return C.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},C.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},C.createElement("ellipse",{fill:s,cx:"32",cy:"33",rx:"32",ry:"7"}),C.createElement("g",{fillRule:"nonzero",stroke:o},C.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),C.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:a}))))},SCt=wCt,xCt=i=>{const{componentCls:e,margin:t,marginXS:n,marginXL:r,fontSize:o,lineHeight:s}=i;return{[e]:{marginInline:n,fontSize:o,lineHeight:s,textAlign:"center",[`${e}-image`]:{height:i.emptyImgHeight,marginBottom:n,opacity:i.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${e}-description`]:{color:i.colorText},[`${e}-footer`]:{marginTop:t},"&-normal":{marginBlock:r,color:i.colorTextDisabled,[`${e}-description`]:{color:i.colorTextDisabled},[`${e}-image`]:{height:i.emptyImgHeightMD}},"&-small":{marginBlock:n,color:i.colorTextDisabled,[`${e}-image`]:{height:i.emptyImgHeightSM}}}}},LCt=vo("Empty",i=>{const{componentCls:e,controlHeightLG:t}=i,n=Oi(i,{emptyImgCls:`${e}-img`,emptyImgHeight:t*2.5,emptyImgHeightMD:t,emptyImgHeightSM:t*.875});return[xCt(n)]});var ECt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var{className:e,rootClassName:t,prefixCls:n,image:r=pxe,description:o,children:s,imageStyle:a}=i,l=ECt(i,["className","rootClassName","prefixCls","image","description","children","imageStyle"]);const{getPrefixCls:c,direction:u}=C.useContext(Rn),d=c("empty",n),[h,f]=LCt(d),[g]=ST("Empty"),p=typeof o<"u"?o:g==null?void 0:g.description,v=typeof p=="string"?p:"empty";let m=null;return typeof r=="string"?m=C.createElement("img",{alt:v,src:r}):m=r,h(C.createElement("div",Object.assign({className:xe(f,d,{[`${d}-normal`]:r===mxe,[`${d}-rtl`]:u==="rtl"},e,t)},l),C.createElement("div",{className:`${d}-image`,style:a},m),p&&C.createElement("div",{className:`${d}-description`},p),s&&C.createElement("div",{className:`${d}-footer`},s)))};tQ.PRESENTED_IMAGE_DEFAULT=pxe;tQ.PRESENTED_IMAGE_SIMPLE=mxe;const A0=tQ,DCt=i=>{const{componentName:e}=i,{getPrefixCls:t}=C.useContext(Rn),n=t("empty");switch(e){case"Table":case"List":return $e.createElement(A0,{image:A0.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return $e.createElement(A0,{image:A0.PRESENTED_IMAGE_SIMPLE,className:`${n}-small`});default:return $e.createElement(A0,null)}},nQ=DCt,ICt=i=>{const{controlPaddingHorizontal:e}=i;return{position:"relative",display:"block",minHeight:i.controlHeight,padding:`${(i.controlHeight-i.fontSize*i.lineHeight)/2}px ${e}px`,color:i.colorText,fontWeight:"normal",fontSize:i.fontSize,lineHeight:i.lineHeight,boxSizing:"border-box"}},kCt=i=>{const{antCls:e,componentCls:t}=i,n=`${t}-item`;return[{[`${t}-dropdown`]:Object.assign(Object.assign({},Wr(i)),{position:"absolute",top:-9999,zIndex:i.zIndexPopup,boxSizing:"border-box",padding:i.paddingXXS,overflow:"hidden",fontSize:i.fontSize,fontVariant:"initial",backgroundColor:i.colorBgElevated,borderRadius:i.borderRadiusLG,outline:"none",boxShadow:i.boxShadowSecondary,[` +`].includes(qt)})},[H]),nr=function(Ft,Pn,Xt){var Gt=!0,oi=Ft;M==null||M(null);var Fi=Xt?null:Fbt(Ft,H);return m!=="combobox"&&Fi&&(oi="",W==null||W(Fi),mn(!1),Gt=!1),F&&Tt!==oi&&F(oi,{source:Pn?"typing":"effect"}),Gt},Hr=function(Ft){!Ft||!Ft.trim()||F(Ft,{source:"submit"})};C.useEffect(function(){!dt&&!ie&&m!=="combobox"&&nr("",!1,!1)},[dt]),C.useEffect(function(){lt&&_&&ut(!1),_&&tt(!1)},[_]);var Jn=JSe(),Ii=Ae(Jn,2),_o=Ii[0],No=Ii[1],bs=function(Ft){var Pn=_o(),Xt=Ft.which;if(Xt===vt.ENTER&&(m!=="combobox"&&Ft.preventDefault(),dt||mn(!0)),No(!!Tt),Xt===vt.BACKSPACE&&!Pn&&ie&&!Tt&&d.length){for(var Gt=ft(d),oi=null,Fi=Gt.length-1;Fi>=0;Fi-=1){var Co=Gt[Fi];if(!Co.disabled){Gt.splice(Fi,1),oi=Co;break}}oi&&h(Gt,{type:"remove",values:[oi]})}for(var Bs=arguments.length,ul=new Array(Bs>1?Bs-1:0),Ws=1;Ws1?Pn-1:0),Gt=1;Gt1?Fi-1:0),Bs=1;Bs1&&arguments[1]!==void 0?arguments[1]:!1;return rd(i).map(function(t,n){if(!C.isValidElement(t)||!t.type)return null;var r=t,o=r.type.isSelectOptGroup,s=r.key,a=r.props,l=a.children,c=Nn(a,Gbt);return e||!o?qbt(t):te(te({key:"__RC_SELECT_GRP__".concat(s===null?n:s,"__"),label:s},c),{},{options:cxe(l)})}).filter(function(t){return t})}function Xbt(i,e,t,n,r){return C.useMemo(function(){var o=i,s=!i;s&&(o=cxe(e));var a=new Map,l=new Map,c=function(h,f,g){g&&typeof g=="string"&&h.set(f[g],f)};function u(d){for(var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,f=0;fl},n}return _s(t,[{key:"componentDidMount",value:function(){this.scrollbarRef.current.addEventListener("touchstart",this.onScrollbarTouchStart),this.thumbRef.current.addEventListener("touchstart",this.onMouseDown)}},{key:"componentDidUpdate",value:function(r){r.scrollTop!==this.props.scrollTop&&this.delayHidden()}},{key:"componentWillUnmount",value:function(){this.removeEvents(),clearTimeout(this.visibleTimeout)}},{key:"render",value:function(){var r=this.state,o=r.dragging,s=r.visible,a=this.props.prefixCls,l=this.getSpinHeight(),c=this.getTop(),u=this.showScroll(),d=u&&s;return C.createElement("div",{ref:this.scrollbarRef,className:xe("".concat(a,"-scrollbar"),be({},"".concat(a,"-scrollbar-show"),u)),style:{width:8,top:0,bottom:0,right:0,position:"absolute",display:d?null:"none"},onMouseDown:this.onContainerMouseDown,onMouseMove:this.delayHidden},C.createElement("div",{ref:this.thumbRef,className:xe("".concat(a,"-scrollbar-thumb"),be({},"".concat(a,"-scrollbar-thumb-moving"),o)),style:{width:"100%",height:l,top:c,left:0,position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"},onMouseDown:this.onMouseDown}))}}]),t}(C.Component);function Qbt(i){var e=i.children,t=i.setRef,n=C.useCallback(function(r){t(r)},[]);return C.cloneElement(e,{ref:n})}function Jbt(i,e,t,n,r,o){var s=o.getKey;return i.slice(e,t+1).map(function(a,l){var c=e+l,u=r(a,c,{}),d=s(a);return C.createElement(Qbt,{key:d,setRef:function(f){return n(a,f)}},u)})}var eCt=function(){function i(){vs(this,i),this.maps=void 0,this.maps=Object.create(null)}return _s(i,[{key:"set",value:function(t,n){this.maps[t]=n}},{key:"get",value:function(t){return this.maps[t]}}]),i}();function tCt(i,e,t){var n=C.useState(0),r=Ae(n,2),o=r[0],s=r[1],a=C.useRef(new Map),l=C.useRef(new eCt),c=C.useRef();function u(){Zi.cancel(c.current)}function d(){u(),c.current=Zi(function(){a.current.forEach(function(f,g){if(f&&f.offsetParent){var p=nk(f),v=p.offsetHeight;l.current.get(g)!==v&&l.current.set(g,p.offsetHeight)}}),s(function(f){return f+1})})}function h(f,g){var p=i(f),v=a.current.get(p);g?(a.current.set(p,g),d()):a.current.delete(p),!v!=!g&&(g?e==null||e(f):t==null||t(f))}return C.useEffect(function(){return u},[]),[h,d,l.current,o]}function nCt(i,e,t,n,r,o,s,a){var l=C.useRef();return function(c){if(c==null){a();return}if(Zi.cancel(l.current),typeof c=="number")s(c);else if(c&&zn(c)==="object"){var u,d=c.align;"index"in c?u=c.index:u=e.findIndex(function(p){return r(p)===c.key});var h=c.offset,f=h===void 0?0:h,g=function p(v,m){if(!(v<0||!i.current)){var _=i.current.clientHeight,y=!1,S=m;if(_){for(var L=m||d,E=0,D=0,k=0,T=Math.min(e.length,u),M=0;M<=T;M+=1){var A=r(e[M]);D=E;var N=t.get(A);k=D+(N===void 0?n:N),E=k,M===u&&N===void 0&&(y=!0)}var R=null;switch(L){case"top":R=D-f;break;case"bottom":R=k-_+f;break;default:{var F=i.current.scrollTop,W=F+_;DW&&(S="bottom")}}R!==null&&R!==i.current.scrollTop&&s(R)}l.current=Zi(function(){y&&o(),p(v-1,S)},2)}};g(3)}}}function iCt(i,e,t){var n=i.length,r=e.length,o,s;if(n===0&&r===0)return null;n"u"?"undefined":zn(navigator))==="object"&&/Firefox/i.test(navigator.userAgent);const dxe=function(i,e){var t=C.useRef(!1),n=C.useRef(null);function r(){clearTimeout(n.current),t.current=!0,n.current=setTimeout(function(){t.current=!1},50)}var o=C.useRef({top:i,bottom:e});return o.current.top=i,o.current.bottom=e,function(s){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l=s<0&&o.current.top||s>0&&o.current.bottom;return a&&l?(clearTimeout(n.current),t.current=!1):(!l||t.current)&&r(),!t.current&&l}};function sCt(i,e,t,n){var r=C.useRef(0),o=C.useRef(null),s=C.useRef(null),a=C.useRef(!1),l=dxe(e,t);function c(d){if(i){Zi.cancel(o.current);var h=d.deltaY;r.current+=h,s.current=h,!l(h)&&(oCt||d.preventDefault(),o.current=Zi(function(){var f=a.current?10:1;n(r.current*f),r.current=0}))}}function u(d){i&&(a.current=d.detail===s.current)}return[c,u]}var aCt=14/15;function lCt(i,e,t){var n=C.useRef(!1),r=C.useRef(0),o=C.useRef(null),s=C.useRef(null),a,l=function(h){if(n.current){var f=Math.ceil(h.touches[0].pageY),g=r.current-f;r.current=f,t(g)&&h.preventDefault(),clearInterval(s.current),s.current=setInterval(function(){g*=aCt,(!t(g,!0)||Math.abs(g)<=.1)&&clearInterval(s.current)},16)}},c=function(){n.current=!1,a()},u=function(h){a(),h.touches.length===1&&!n.current&&(n.current=!0,r.current=Math.ceil(h.touches[0].pageY),o.current=h.target,o.current.addEventListener("touchmove",l),o.current.addEventListener("touchend",c))};a=function(){o.current&&(o.current.removeEventListener("touchmove",l),o.current.removeEventListener("touchend",c))},br(function(){return i&&e.current.addEventListener("touchstart",u),function(){var d;(d=e.current)===null||d===void 0||d.removeEventListener("touchstart",u),a(),clearInterval(s.current)}},[i])}var cCt=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","component","onScroll","onVisibleChange","innerProps"],uCt=[],dCt={overflowY:"auto",overflowAnchor:"none"};function hCt(i,e){var t=i.prefixCls,n=t===void 0?"rc-virtual-list":t,r=i.className,o=i.height,s=i.itemHeight,a=i.fullHeight,l=a===void 0?!0:a,c=i.style,u=i.data,d=i.children,h=i.itemKey,f=i.virtual,g=i.component,p=g===void 0?"div":g,v=i.onScroll,m=i.onVisibleChange,_=i.innerProps,y=Nn(i,cCt),S=!!(f!==!1&&o&&s),L=S&&u&&s*u.length>o,E=C.useState(0),D=Ae(E,2),k=D[0],T=D[1],M=C.useState(!1),A=Ae(M,2),N=A[0],R=A[1],F=xe(n,r),W=u||uCt,H=C.useRef(),G=C.useRef(),U=C.useRef(),K=C.useCallback(function(it){return typeof h=="function"?h(it):it==null?void 0:it[h]},[h]),re={getKey:K};function Y(it){T(function(at){var tt;typeof it=="function"?tt=it(at):tt=it;var Zt=ie(tt);return H.current.scrollTop=Zt,Zt})}var J=C.useRef({start:0,end:W.length}),Q=C.useRef(),ue=rCt(W,K),de=Ae(ue,1),_e=de[0];Q.current=_e;var ve=tCt(K,null,null),Ve=Ae(ve,4),Ze=Ve[0],We=Ve[1],pe=Ve[2],Pe=Ve[3],Se=C.useMemo(function(){if(!S)return{scrollHeight:void 0,start:0,end:W.length-1,offset:void 0};if(!L){var it;return{scrollHeight:((it=G.current)===null||it===void 0?void 0:it.offsetHeight)||0,start:0,end:W.length-1,offset:void 0}}for(var at=0,tt,Zt,Tt,xn=W.length,rt=0;rt=k&&tt===void 0&&(tt=rt,Zt=at),nn>k+o&&Tt===void 0&&(Tt=rt),at=nn}return tt===void 0&&(tt=0,Zt=0,Tt=Math.ceil(o/s)),Tt===void 0&&(Tt=W.length-1),Tt=Math.min(Tt+1,W.length),{scrollHeight:at,start:tt,end:Tt,offset:Zt}},[L,S,k,W,Pe,o]),Ne=Se.scrollHeight,Me=Se.start,Qe=Se.end,Ke=Se.offset;J.current.start=Me,J.current.end=Qe;var Re=Ne-o,ct=C.useRef(Re);ct.current=Re;function ie(it){var at=it;return Number.isNaN(ct.current)||(at=Math.min(at,ct.current)),at=Math.max(at,0),at}var le=k<=0,ce=k>=Re,z=dxe(le,ce);function q(it){var at=it;Y(at)}function oe(it){var at=it.currentTarget.scrollTop;at!==k&&Y(at),v==null||v(it)}var ne=sCt(S,le,ce,function(it){Y(function(at){var tt=at+it;return tt})}),he=Ae(ne,2),Le=he[0],Fe=he[1];lCt(S,H,function(it,at){return z(it,at)?!1:(Le({preventDefault:function(){},deltaY:it}),!0)}),br(function(){function it(at){S&&at.preventDefault()}return H.current.addEventListener("wheel",Le),H.current.addEventListener("DOMMouseScroll",Fe),H.current.addEventListener("MozMousePixelScroll",it),function(){H.current&&(H.current.removeEventListener("wheel",Le),H.current.removeEventListener("DOMMouseScroll",Fe),H.current.removeEventListener("MozMousePixelScroll",it))}},[S]);var ze=nCt(H,W,pe,s,K,We,Y,function(){var it;(it=U.current)===null||it===void 0||it.delayHidden()});C.useImperativeHandle(e,function(){return{scrollTo:ze}}),br(function(){if(m){var it=W.slice(Me,Qe+1);m(it,W)}},[Me,Qe,W]);var Ue=Jbt(W,Me,Qe,Ze,d,re),nt=null;return o&&(nt=te(be({},l?"height":"maxHeight",o),dCt),S&&(nt.overflowY="hidden",N&&(nt.pointerEvents="none"))),C.createElement("div",St({style:te(te({},c),{},{position:"relative"}),className:F},y),C.createElement(p,{className:"".concat(n,"-holder"),style:nt,ref:H,onScroll:oe},C.createElement(uxe,{prefixCls:n,height:Ne,offset:Ke,onInnerResize:We,ref:G,innerProps:_},Ue)),S&&C.createElement(Zbt,{ref:U,prefixCls:n,scrollTop:k,height:o,scrollHeight:Ne,count:W.length,onScroll:q,onStartMove:function(){R(!0)},onStopMove:function(){R(!1)}}))}var JZ=C.forwardRef(hCt);JZ.displayName="List";var hxe=C.createContext(null);function fCt(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var gCt=["disabled","title","children","style","className"];function due(i){return typeof i=="string"||typeof i=="number"}var pCt=function(e,t){var n=Y0t(),r=n.prefixCls,o=n.id,s=n.open,a=n.multiple,l=n.mode,c=n.searchValue,u=n.toggleOpen,d=n.notFoundContent,h=n.onPopupScroll,f=C.useContext(hxe),g=f.flattenOptions,p=f.onActiveValue,v=f.defaultActiveFirstOption,m=f.onSelect,_=f.menuItemSelectedIcon,y=f.rawValues,S=f.fieldNames,L=f.virtual,E=f.listHeight,D=f.listItemHeight,k="".concat(r,"-item"),T=LC(function(){return g},[s,g],function(_e,ve){return ve[0]&&_e[1]!==ve[1]}),M=C.useRef(null),A=function(ve){ve.preventDefault()},N=function(ve){M.current&&M.current.scrollTo(typeof ve=="number"?{index:ve}:ve)},R=function(ve){for(var Ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Ze=T.length,We=0;We1&&arguments[1]!==void 0?arguments[1]:!1;G(ve);var Ze={source:Ve?"keyboard":"mouse"},We=T[ve];if(!We){p(null,-1,Ze);return}p(We.value,ve,Ze)};C.useEffect(function(){U(v!==!1?R(0):-1)},[T.length,c]);var K=C.useCallback(function(_e){return y.has(_e)&&l!=="combobox"},[l,ft(y).toString(),y.size]);C.useEffect(function(){var _e=setTimeout(function(){if(!a&&s&&y.size===1){var Ve=Array.from(y)[0],Ze=T.findIndex(function(We){var pe=We.data;return pe.value===Ve});Ze!==-1&&(U(Ze),N(Ze))}});if(s){var ve;(ve=M.current)===null||ve===void 0||ve.scrollTo(void 0)}return function(){return clearTimeout(_e)}},[s,c,g.length]);var re=function(ve){ve!==void 0&&m(ve,{selected:!y.has(ve)}),a||u(!1)};if(C.useImperativeHandle(t,function(){return{onKeyDown:function(ve){var Ve=ve.which,Ze=ve.ctrlKey;switch(Ve){case vt.N:case vt.P:case vt.UP:case vt.DOWN:{var We=0;if(Ve===vt.UP?We=-1:Ve===vt.DOWN?We=1:fCt()&&Ze&&(Ve===vt.N?We=1:Ve===vt.P&&(We=-1)),We!==0){var pe=R(H+We,We);N(pe),U(pe,!0)}break}case vt.ENTER:{var Pe=T[H];Pe&&!Pe.data.disabled?re(Pe.value):re(void 0),s&&ve.preventDefault();break}case vt.ESC:u(!1),s&&ve.stopPropagation()}},onKeyUp:function(){},scrollTo:function(ve){N(ve)}}}),T.length===0)return C.createElement("div",{role:"listbox",id:"".concat(o,"_list"),className:"".concat(k,"-empty"),onMouseDown:A},d);var Y=Object.keys(S).map(function(_e){return S[_e]}),J=function(ve){return ve.label};function Q(_e,ve){var Ve=_e.group;return{role:Ve?"presentation":"option",id:"".concat(o,"_list_").concat(ve)}}var ue=function(ve){var Ve=T[ve];if(!Ve)return null;var Ze=Ve.data||{},We=Ze.value,pe=Ve.group,Pe=Wp(Ze,!0),Se=J(Ve);return Ve?C.createElement("div",St({"aria-label":typeof Se=="string"&&!pe?Se:null},Pe,{key:ve},Q(Ve,ve),{"aria-selected":K(We)}),We):null},de={role:"listbox",id:"".concat(o,"_list")};return C.createElement(C.Fragment,null,L&&C.createElement("div",St({},de,{style:{height:0,width:0,overflow:"hidden"}}),ue(H-1),ue(H),ue(H+1)),C.createElement(JZ,{itemKey:"key",ref:M,data:T,height:E,itemHeight:D,fullHeight:!1,onMouseDown:A,onScroll:h,virtual:L,innerProps:L?null:de},function(_e,ve){var Ve,Ze=_e.group,We=_e.groupOption,pe=_e.data,Pe=_e.label,Se=_e.value,Ne=pe.key;if(Ze){var Me,Qe=(Me=pe.title)!==null&&Me!==void 0?Me:due(Pe)?Pe.toString():void 0;return C.createElement("div",{className:xe(k,"".concat(k,"-group")),title:Qe},Pe!==void 0?Pe:Ne)}var Ke=pe.disabled,Re=pe.title;pe.children;var ct=pe.style,ie=pe.className,le=Nn(pe,gCt),ce=ll(le,Y),z=K(Se),q="".concat(k,"-option"),oe=xe(k,q,ie,(Ve={},be(Ve,"".concat(q,"-grouped"),We),be(Ve,"".concat(q,"-active"),H===ve&&!Ke),be(Ve,"".concat(q,"-disabled"),Ke),be(Ve,"".concat(q,"-selected"),z),Ve)),ne=J(_e),he=!_||typeof _=="function"||z,Le=typeof ne=="number"?ne:ne||Se,Fe=due(Le)?Le.toString():void 0;return Re!==void 0&&(Fe=Re),C.createElement("div",St({},Wp(ce),L?{}:Q(_e,ve),{"aria-selected":z,className:oe,title:Fe,onMouseMove:function(){H===ve||Ke||U(ve)},onClick:function(){Ke||re(Se)},style:ct}),C.createElement("div",{className:"".concat(q,"-content")},Le),C.isValidElement(_)||z,he&&C.createElement(YO,{className:"".concat(k,"-option-state"),customizeIcon:_,customizeIconProps:{isSelected:z}},z?"✓":null))}))},fxe=C.forwardRef(pCt);fxe.displayName="OptionList";var mCt=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","listHeight","listItemHeight","value","defaultValue","labelInValue","onChange"],vCt=["inputValue"];function _Ct(i){return!i||zn(i)!=="object"}var bCt=C.forwardRef(function(i,e){var t=i.id,n=i.mode,r=i.prefixCls,o=r===void 0?"rc-select":r,s=i.backfill,a=i.fieldNames,l=i.inputValue,c=i.searchValue,u=i.onSearch,d=i.autoClearSearchValue,h=d===void 0?!0:d,f=i.onSelect,g=i.onDeselect,p=i.dropdownMatchSelectWidth,v=p===void 0?!0:p,m=i.filterOption,_=i.filterSort,y=i.optionFilterProp,S=i.optionLabelProp,L=i.options,E=i.children,D=i.defaultActiveFirstOption,k=i.menuItemSelectedIcon,T=i.virtual,M=i.listHeight,A=M===void 0?200:M,N=i.listItemHeight,R=N===void 0?20:N,F=i.value,W=i.defaultValue,H=i.labelInValue,G=i.onChange,U=Nn(i,mCt),K=jbt(t),re=cK(n),Y=!!(!L&&E),J=C.useMemo(function(){return m===void 0&&n==="combobox"?!1:m},[m,n]),Q=C.useMemo(function(){return lxe(a,Y)},[JSON.stringify(a),Y]),ue=Ja("",{value:c!==void 0?c:l,postState:function(ut){return ut||""}}),de=Ae(ue,2),_e=de[0],ve=de[1],Ve=Xbt(L,E,Q,y,S),Ze=Ve.valueOptions,We=Ve.labelOptions,pe=Ve.options,Pe=C.useCallback(function(lt){var ut=ixe(lt);return ut.map(function(dt){var Mt,Kt,mn,lr,nr;if(_Ct(dt))Mt=dt;else{var Hr;mn=dt.key,Kt=dt.label,Mt=(Hr=dt.value)!==null&&Hr!==void 0?Hr:mn}var Jn=Ze.get(Mt);if(Jn){var Ii;Kt===void 0&&(Kt=Jn==null?void 0:Jn[S||Q.label]),mn===void 0&&(mn=(Ii=Jn==null?void 0:Jn.key)!==null&&Ii!==void 0?Ii:Mt),lr=Jn==null?void 0:Jn.disabled,nr=Jn==null?void 0:Jn.title}return{label:Kt,value:Mt,key:mn,disabled:lr,title:nr}})},[Q,S,Ze]),Se=Ja(W,{value:F}),Ne=Ae(Se,2),Me=Ne[0],Qe=Ne[1],Ke=C.useMemo(function(){var lt,ut=Pe(Me);return n==="combobox"&&!((lt=ut[0])!==null&<!==void 0&<.value)?[]:ut},[Me,Pe,n]),Re=Hbt(Ke,Ze),ct=Ae(Re,2),ie=ct[0],le=ct[1],ce=C.useMemo(function(){if(!n&&ie.length===1){var lt=ie[0];if(lt.value===null&&(lt.label===null||lt.label===void 0))return[]}return ie.map(function(ut){var dt;return te(te({},ut),{},{label:(dt=ut.label)!==null&&dt!==void 0?dt:ut.value})})},[n,ie]),z=C.useMemo(function(){return new Set(ie.map(function(lt){return lt.value}))},[ie]);C.useEffect(function(){if(n==="combobox"){var lt,ut=(lt=ie[0])===null||lt===void 0?void 0:lt.value;ve(fbt(ut)?String(ut):"")}},[ie]);var q=cue(function(lt,ut){var dt,Mt=ut??lt;return dt={},be(dt,Q.value,lt),be(dt,Q.label,Mt),dt}),oe=C.useMemo(function(){if(n!=="tags")return pe;var lt=ft(pe),ut=function(Mt){return Ze.has(Mt)};return ft(ie).sort(function(dt,Mt){return dt.value2&&arguments[2]!==void 0?arguments[2]:{},Mt=dt.source,Kt=Mt===void 0?"keyboard":Mt;xn(ut),s&&n==="combobox"&<!==null&&Kt==="keyboard"&&at(String(lt))},[s,n]),Bt=function(ut,dt,Mt){var Kt=function(){var Cs,$t=le(ut);return[H?{label:$t==null?void 0:$t[Q.label],value:ut,key:(Cs=$t==null?void 0:$t.key)!==null&&Cs!==void 0?Cs:ut}:ut,lK($t)]};if(dt&&f){var mn=Kt(),lr=Ae(mn,2),nr=lr[0],Hr=lr[1];f(nr,Hr)}else if(!dt&&g&&Mt!=="clear"){var Jn=Kt(),Ii=Ae(Jn,2),_o=Ii[0],No=Ii[1];g(_o,No)}},Nt=cue(function(lt,ut){var dt,Mt=re?ut.selected:!0;Mt?dt=re?[].concat(ft(ie),[lt]):[lt]:dt=ie.filter(function(Kt){return Kt.value!==lt}),ze(dt),Bt(lt,Mt),n==="combobox"?at(""):(!cK||h)&&(ve(""),at(""))}),nn=function(ut,dt){ze(ut);var Mt=dt.type,Kt=dt.values;(Mt==="remove"||Mt==="clear")&&Kt.forEach(function(mn){Bt(mn.value,!1,Mt)})},Mn=function(ut,dt){if(ve(ut),at(null),dt.source==="submit"){var Mt=(ut||"").trim();if(Mt){var Kt=Array.from(new Set([].concat(ft(z),[Mt])));ze(Kt),Bt(Mt,!0),ve("")}return}dt.source!=="blur"&&(n==="combobox"&&ze(ut),u==null||u(ut))},zt=function(ut){var dt=ut;n!=="tags"&&(dt=ut.map(function(Kt){var mn=We.get(Kt);return mn==null?void 0:mn.value}).filter(function(Kt){return Kt!==void 0}));var Mt=Array.from(new Set([].concat(ft(z),ft(dt))));ze(Mt),Mt.forEach(function(Kt){Bt(Kt,!0)})},Qt=C.useMemo(function(){var lt=T!==!1&&v!==!1;return te(te({},Ve),{},{flattenOptions:Fe,onActiveValue:wt,defaultActiveFirstOption:rt,onSelect:Nt,menuItemSelectedIcon:k,rawValues:z,fieldNames:Q,virtual:lt,listHeight:A,listItemHeight:R,childrenAsData:Y})},[Ve,Fe,wt,rt,Nt,k,z,Q,T,v,A,R,Y]);return C.createElement(hxe.Provider,{value:Qt},C.createElement($bt,St({},U,{id:K,prefixCls:o,ref:e,omitDomProps:vCt,mode:n,displayValues:ce,onDisplayValuesChange:nn,searchValue:_e,onSearch:Mn,autoClearSearchValue:h,onSearchSplit:zt,dropdownMatchSelectWidth:v,OptionList:fxe,emptyOptions:!Fe.length,activeValue:it,activeDescendantId:"".concat(K,"_list_").concat(Tt)})))}),eQ=bCt;eQ.Option=QZ;eQ.OptGroup=ZZ;function gxe(i,e,t){return function(r){const{prefixCls:o,style:s}=r,a=C.useRef(null),[l,c]=C.useState(0),[u,d]=C.useState(0),[h,f]=Ja(!1,{value:r.open}),{getPrefixCls:g}=C.useContext(Rn),p=g(e||"select",o);return C.useEffect(()=>{if(f(!0),typeof ResizeObserver<"u"){const v=new ResizeObserver(_=>{const y=_[0].target;c(y.offsetHeight+8),d(y.offsetWidth)}),m=setInterval(()=>{var _;const y=t?`.${t(p)}`:`.${p}-dropdown`,S=(_=a.current)===null||_===void 0?void 0:_.querySelector(y);S&&(clearInterval(m),v.observe(S))},10);return()=>{clearInterval(m),v.disconnect()}}},[]),C.createElement(LT,{theme:{token:{motionDurationFast:"0.01s",motionDurationMid:"0.01s",motionDurationSlow:"0.01s"}}},C.createElement("div",{ref:a,style:{paddingBottom:l,position:"relative",width:"fit-content",minWidth:u}},C.createElement(i,Object.assign({},r,{style:Object.assign(Object.assign({},s),{margin:0}),open:h,visible:h,getPopupContainer:()=>a.current}))))}}function Cp(i,e,t){return xe({[`${i}-status-success`]:e==="success",[`${i}-status-warning`]:e==="warning",[`${i}-status-error`]:e==="error",[`${i}-status-validating`]:e==="validating",[`${i}-has-feedback`]:t})}const O5=(i,e)=>e||i,CCt=()=>{const[,i]=DC(),e=new Yr(i.colorBgBase);let t={};return e.toHsl().l<.5&&(t={opacity:.65}),C.createElement("svg",{style:t,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},C.createElement("g",{fill:"none",fillRule:"evenodd"},C.createElement("g",{transform:"translate(24 31.67)"},C.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),C.createElement("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"}),C.createElement("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),C.createElement("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"}),C.createElement("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"})),C.createElement("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"}),C.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},C.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),C.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},yCt=CCt,wCt=()=>{const[,i]=DC(),{colorFill:e,colorFillTertiary:t,colorFillQuaternary:n,colorBgContainer:r}=i,{borderColor:o,shadowColor:s,contentColor:a}=C.useMemo(()=>({borderColor:new Yr(e).onBackground(r).toHexShortString(),shadowColor:new Yr(t).onBackground(r).toHexShortString(),contentColor:new Yr(n).onBackground(r).toHexShortString()}),[e,t,n,r]);return C.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},C.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},C.createElement("ellipse",{fill:s,cx:"32",cy:"33",rx:"32",ry:"7"}),C.createElement("g",{fillRule:"nonzero",stroke:o},C.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),C.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:a}))))},SCt=wCt,xCt=i=>{const{componentCls:e,margin:t,marginXS:n,marginXL:r,fontSize:o,lineHeight:s}=i;return{[e]:{marginInline:n,fontSize:o,lineHeight:s,textAlign:"center",[`${e}-image`]:{height:i.emptyImgHeight,marginBottom:n,opacity:i.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${e}-description`]:{color:i.colorText},[`${e}-footer`]:{marginTop:t},"&-normal":{marginBlock:r,color:i.colorTextDisabled,[`${e}-description`]:{color:i.colorTextDisabled},[`${e}-image`]:{height:i.emptyImgHeightMD}},"&-small":{marginBlock:n,color:i.colorTextDisabled,[`${e}-image`]:{height:i.emptyImgHeightSM}}}}},LCt=vo("Empty",i=>{const{componentCls:e,controlHeightLG:t}=i,n=Oi(i,{emptyImgCls:`${e}-img`,emptyImgHeight:t*2.5,emptyImgHeightMD:t,emptyImgHeightSM:t*.875});return[xCt(n)]});var ECt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var{className:e,rootClassName:t,prefixCls:n,image:r=pxe,description:o,children:s,imageStyle:a}=i,l=ECt(i,["className","rootClassName","prefixCls","image","description","children","imageStyle"]);const{getPrefixCls:c,direction:u}=C.useContext(Rn),d=c("empty",n),[h,f]=LCt(d),[g]=ST("Empty"),p=typeof o<"u"?o:g==null?void 0:g.description,v=typeof p=="string"?p:"empty";let m=null;return typeof r=="string"?m=C.createElement("img",{alt:v,src:r}):m=r,h(C.createElement("div",Object.assign({className:xe(f,d,{[`${d}-normal`]:r===mxe,[`${d}-rtl`]:u==="rtl"},e,t)},l),C.createElement("div",{className:`${d}-image`,style:a},m),p&&C.createElement("div",{className:`${d}-description`},p),s&&C.createElement("div",{className:`${d}-footer`},s)))};tQ.PRESENTED_IMAGE_DEFAULT=pxe;tQ.PRESENTED_IMAGE_SIMPLE=mxe;const M0=tQ,DCt=i=>{const{componentName:e}=i,{getPrefixCls:t}=C.useContext(Rn),n=t("empty");switch(e){case"Table":case"List":return $e.createElement(M0,{image:M0.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return $e.createElement(M0,{image:M0.PRESENTED_IMAGE_SIMPLE,className:`${n}-small`});default:return $e.createElement(M0,null)}},nQ=DCt,ICt=i=>{const{controlPaddingHorizontal:e}=i;return{position:"relative",display:"block",minHeight:i.controlHeight,padding:`${(i.controlHeight-i.fontSize*i.lineHeight)/2}px ${e}px`,color:i.colorText,fontWeight:"normal",fontSize:i.fontSize,lineHeight:i.lineHeight,boxSizing:"border-box"}},kCt=i=>{const{antCls:e,componentCls:t}=i,n=`${t}-item`;return[{[`${t}-dropdown`]:Object.assign(Object.assign({},Wr(i)),{position:"absolute",top:-9999,zIndex:i.zIndexPopup,boxSizing:"border-box",padding:i.paddingXXS,overflow:"hidden",fontSize:i.fontSize,fontVariant:"initial",backgroundColor:i.colorBgElevated,borderRadius:i.borderRadiusLG,outline:"none",boxShadow:i.boxShadowSecondary,[` &${e}-slide-up-enter${e}-slide-up-enter-active${t}-dropdown-placement-bottomLeft, &${e}-slide-up-appear${e}-slide-up-appear-active${t}-dropdown-placement-bottomLeft `]:{animationName:KZ},[` &${e}-slide-up-enter${e}-slide-up-enter-active${t}-dropdown-placement-topLeft, &${e}-slide-up-appear${e}-slide-up-appear-active${t}-dropdown-placement-topLeft - `]:{animationName:qZ},[`&${e}-slide-up-leave${e}-slide-up-leave-active${t}-dropdown-placement-bottomLeft`]:{animationName:GZ},[`&${e}-slide-up-leave${e}-slide-up-leave-active${t}-dropdown-placement-topLeft`]:{animationName:XZ},"&-hidden":{display:"none"},[`${n}`]:Object.assign(Object.assign({},ICt(i)),{cursor:"pointer",transition:`background ${i.motionDurationSlow} ease`,borderRadius:i.borderRadiusSM,"&-group":{color:i.colorTextDescription,fontSize:i.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign(Object.assign({flex:"auto"},mb),{"> *":Object.assign({},mb)}),"&-state":{flex:"none"},[`&-active:not(${n}-option-disabled)`]:{backgroundColor:i.controlItemBgHover},[`&-selected:not(${n}-option-disabled)`]:{color:i.colorText,fontWeight:i.fontWeightStrong,backgroundColor:i.controlItemBgActive,[`${n}-option-state`]:{color:i.colorPrimary}},"&-disabled":{[`&${n}-option-selected`]:{backgroundColor:i.colorBgContainerDisabled},color:i.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:i.controlPaddingHorizontal*2}}}),"&-rtl":{direction:"rtl"}})},pS(i,"slide-up"),pS(i,"slide-down"),qO(i,"move-up"),qO(i,"move-down")]},TCt=kCt,_1=2;function vxe(i){let{controlHeightSM:e,controlHeight:t,lineWidth:n}=i;const r=(t-e)/2-n,o=Math.ceil(r/2);return[r,o]}function y7(i,e){const{componentCls:t,iconCls:n}=i,r=`${t}-selection-overflow`,o=i.controlHeightSM,[s]=vxe(i),a=e?`${t}-${e}`:"";return{[`${t}-multiple${a}`]:{fontSize:i.fontSize,[r]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"100%",display:"inline-flex"}},[`${t}-selector`]:{display:"flex",flexWrap:"wrap",alignItems:"center",padding:`${s-_1}px ${_1*2}px`,borderRadius:i.borderRadius,[`${t}-show-search&`]:{cursor:"text"},[`${t}-disabled&`]:{background:i.colorBgContainerDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:`${_1}px 0`,lineHeight:`${o}px`,content:'"\\a0"'}},[` + `]:{animationName:qZ},[`&${e}-slide-up-leave${e}-slide-up-leave-active${t}-dropdown-placement-bottomLeft`]:{animationName:GZ},[`&${e}-slide-up-leave${e}-slide-up-leave-active${t}-dropdown-placement-topLeft`]:{animationName:XZ},"&-hidden":{display:"none"},[`${n}`]:Object.assign(Object.assign({},ICt(i)),{cursor:"pointer",transition:`background ${i.motionDurationSlow} ease`,borderRadius:i.borderRadiusSM,"&-group":{color:i.colorTextDescription,fontSize:i.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign(Object.assign({flex:"auto"},pb),{"> *":Object.assign({},pb)}),"&-state":{flex:"none"},[`&-active:not(${n}-option-disabled)`]:{backgroundColor:i.controlItemBgHover},[`&-selected:not(${n}-option-disabled)`]:{color:i.colorText,fontWeight:i.fontWeightStrong,backgroundColor:i.controlItemBgActive,[`${n}-option-state`]:{color:i.colorPrimary}},"&-disabled":{[`&${n}-option-selected`]:{backgroundColor:i.colorBgContainerDisabled},color:i.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:i.controlPaddingHorizontal*2}}}),"&-rtl":{direction:"rtl"}})},pS(i,"slide-up"),pS(i,"slide-down"),qO(i,"move-up"),qO(i,"move-down")]},TCt=kCt,_1=2;function vxe(i){let{controlHeightSM:e,controlHeight:t,lineWidth:n}=i;const r=(t-e)/2-n,o=Math.ceil(r/2);return[r,o]}function y7(i,e){const{componentCls:t,iconCls:n}=i,r=`${t}-selection-overflow`,o=i.controlHeightSM,[s]=vxe(i),a=e?`${t}-${e}`:"";return{[`${t}-multiple${a}`]:{fontSize:i.fontSize,[r]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"100%",display:"inline-flex"}},[`${t}-selector`]:{display:"flex",flexWrap:"wrap",alignItems:"center",padding:`${s-_1}px ${_1*2}px`,borderRadius:i.borderRadius,[`${t}-show-search&`]:{cursor:"text"},[`${t}-disabled&`]:{background:i.colorBgContainerDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:`${_1}px 0`,lineHeight:`${o}px`,content:'"\\a0"'}},[` &${t}-show-arrow ${t}-selector, &${t}-allow-clear ${t}-selector `]:{paddingInlineEnd:i.fontSizeIcon+i.controlPaddingHorizontal},[`${t}-selection-item`]:{position:"relative",display:"flex",flex:"none",boxSizing:"border-box",maxWidth:"100%",height:o,marginTop:_1,marginBottom:_1,lineHeight:`${o-i.lineWidth*2}px`,background:i.colorFillSecondary,border:`${i.lineWidth}px solid ${i.colorSplit}`,borderRadius:i.borderRadiusSM,cursor:"default",transition:`font-size ${i.motionDurationSlow}, line-height ${i.motionDurationSlow}, height ${i.motionDurationSlow}`,userSelect:"none",marginInlineEnd:_1*2,paddingInlineStart:i.paddingXS,paddingInlineEnd:i.paddingXS/2,[`${t}-disabled&`]:{color:i.colorTextDisabled,borderColor:i.colorBorder,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:i.paddingXS/2,overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},xT()),{display:"inline-block",color:i.colorIcon,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${n}`]:{verticalAlign:"-0.2em"},"&:hover":{color:i.colorIconHover}})},[`${r}-item + ${r}-item`]:{[`${t}-selection-search`]:{marginInlineStart:0}},[`${t}-selection-search`]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:i.inputPaddingHorizontalBase-s,[` @@ -1008,10 +1008,10 @@ html body { `]:{paddingInlineEnd:s},[`&${t}-open ${t}-selection-item`]:{color:i.colorTextPlaceholder},[`&:not(${t}-customize-input)`]:{[`${t}-selector`]:{width:"100%",height:i.controlHeight,padding:`0 ${n}px`,[`${t}-selection-search-input`]:{height:o},"&:after":{lineHeight:`${o}px`}}},[`&${t}-customize-input`]:{[`${t}-selector`]:{"&:after":{display:"none"},[`${t}-selection-search`]:{position:"static",width:"100%"},[`${t}-selection-placeholder`]:{position:"absolute",insetInlineStart:0,insetInlineEnd:0,padding:`0 ${n}px`,"&:after":{display:"none"}}}}}}}function RCt(i){const{componentCls:e}=i,t=i.controlPaddingHorizontalSM-i.lineWidth;return[w7(i),w7(Oi(i,{controlHeight:i.controlHeightSM,borderRadius:i.borderRadiusSM}),"sm"),{[`${e}-single${e}-sm`]:{[`&:not(${e}-customize-input)`]:{[`${e}-selection-search`]:{insetInlineStart:t,insetInlineEnd:t},[`${e}-selector`]:{padding:`0 ${t}px`},[`&${e}-show-arrow ${e}-selection-search`]:{insetInlineEnd:t+i.fontSize*1.5},[` &${e}-show-arrow ${e}-selection-item, &${e}-show-arrow ${e}-selection-placeholder - `]:{paddingInlineEnd:i.fontSize*1.5}}}},w7(Oi(i,{controlHeight:i.controlHeightLG,fontSize:i.fontSizeLG,borderRadius:i.borderRadiusLG}),"lg")]}const MCt=i=>{const{componentCls:e}=i;return{position:"relative",backgroundColor:i.colorBgContainer,border:`${i.lineWidth}px ${i.lineType} ${i.colorBorder}`,transition:`all ${i.motionDurationMid} ${i.motionEaseInOut}`,input:{cursor:"pointer"},[`${e}-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit"}},[`${e}-disabled&`]:{color:i.colorTextDisabled,background:i.colorBgContainerDisabled,cursor:"not-allowed",[`${e}-multiple&`]:{background:i.colorBgContainerDisabled},input:{cursor:"not-allowed"}}}},S7=function(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const{componentCls:n,borderHoverColor:r,outlineColor:o,antCls:s}=e,a=t?{[`${n}-selector`]:{borderColor:r}}:{};return{[i]:{[`&:not(${n}-disabled):not(${n}-customize-input):not(${s}-pagination-size-changer)`]:Object.assign(Object.assign({},a),{[`${n}-focused& ${n}-selector`]:{borderColor:r,boxShadow:`0 0 0 ${e.controlOutlineWidth}px ${o}`,outline:0},[`&:hover ${n}-selector`]:{borderColor:r}})}}},ACt=i=>{const{componentCls:e}=i;return{[`${e}-selection-search-input`]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none","&::-webkit-search-cancel-button":{display:"none","-webkit-appearance":"none"}}}},PCt=i=>{const{componentCls:e,inputPaddingHorizontalBase:t,iconCls:n}=i;return{[e]:Object.assign(Object.assign({},Wr(i)),{position:"relative",display:"inline-block",cursor:"pointer",[`&:not(${e}-customize-input) ${e}-selector`]:Object.assign(Object.assign({},MCt(i)),ACt(i)),[`${e}-selection-item`]:Object.assign(Object.assign({flex:1,fontWeight:"normal"},mb),{"> *":Object.assign({lineHeight:"inherit"},mb)}),[`${e}-selection-placeholder`]:Object.assign(Object.assign({},mb),{flex:1,color:i.colorTextPlaceholder,pointerEvents:"none"}),[`${e}-arrow`]:Object.assign(Object.assign({},xT()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:t,height:i.fontSizeIcon,marginTop:-i.fontSizeIcon/2,color:i.colorTextQuaternary,fontSize:i.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",[n]:{verticalAlign:"top",transition:`transform ${i.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${e}-suffix)`]:{pointerEvents:"auto"}},[`${e}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${e}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:t,zIndex:1,display:"inline-block",width:i.fontSizeIcon,height:i.fontSizeIcon,marginTop:-i.fontSizeIcon/2,color:i.colorTextQuaternary,fontSize:i.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",background:i.colorBgContainer,cursor:"pointer",opacity:0,transition:`color ${i.motionDurationMid} ease, opacity ${i.motionDurationSlow} ease`,textRendering:"auto","&:before":{display:"block"},"&:hover":{color:i.colorTextTertiary}},"&:hover":{[`${e}-clear`]:{opacity:1}}}),[`${e}-has-feedback`]:{[`${e}-clear`]:{insetInlineEnd:t+i.fontSize+i.paddingXXS}}}},OCt=i=>{const{componentCls:e}=i;return[{[e]:{[`&-borderless ${e}-selector`]:{backgroundColor:"transparent !important",borderColor:"transparent !important",boxShadow:"none !important"},[`&${e}-in-form-item`]:{width:"100%"}}},PCt(i),RCt(i),NCt(i),TCt(i),{[`${e}-rtl`]:{direction:"rtl"}},S7(e,Oi(i,{borderHoverColor:i.colorPrimaryHover,outlineColor:i.controlOutline})),S7(`${e}-status-error`,Oi(i,{borderHoverColor:i.colorErrorHover,outlineColor:i.colorErrorOutline}),!0),S7(`${e}-status-warning`,Oi(i,{borderHoverColor:i.colorWarningHover,outlineColor:i.colorWarningOutline}),!0),M5(i,{borderElCls:`${e}-selector`,focusElCls:`${e}-focused`})]},FCt=vo("Select",(i,e)=>{let{rootPrefixCls:t}=e;const n=Oi(i,{rootPrefixCls:t,inputPaddingHorizontalBase:i.paddingSM-1});return[OCt(n)]},i=>({zIndexPopup:i.zIndexPopupBase+50})),R2={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:"visible"},BCt={bottomLeft:Object.assign(Object.assign({},R2),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},R2),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},R2),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},R2),{points:["br","tr"],offset:[0,-4]})};function WCt(i){return i||BCt}function $Ct(i){return i??!0}function HCt(i){let{suffixIcon:e,clearIcon:t,menuItemSelectedIcon:n,removeIcon:r,loading:o,multiple:s,hasFeedback:a,prefixCls:l,showArrow:c,feedbackIcon:u}=i;const d=t??C.createElement(XS,null),h=v=>C.createElement(C.Fragment,null,c!==!1&&v,a&&u);let f=null;if(e!==void 0)f=h(e);else if(o)f=h(C.createElement(ek,{spin:!0}));else{const v=`${l}-suffix`;f=m=>{let{open:_,showSearch:y}=m;return h(_&&y?C.createElement(IZ,{className:v}):C.createElement(DZ,{className:v}))}}let g=null;n!==void 0?g=n:s?g=C.createElement($ye,null):g=null;let p=null;return r!==void 0?p=r:p=C.createElement(CT,null),{clearIcon:d,suffixIcon:f,itemIcon:g,removeIcon:p}}var VCt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var{prefixCls:t,bordered:n=!0,className:r,rootClassName:o,getPopupContainer:s,popupClassName:a,dropdownClassName:l,listHeight:c=256,placement:u,listItemHeight:d=24,size:h,disabled:f,notFoundContent:g,status:p,showArrow:v,builtinPlacements:m}=i,_=VCt(i,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","showArrow","builtinPlacements"]);const{getPopupContainer:y,getPrefixCls:S,renderEmpty:L,direction:E,virtual:D,dropdownMatchSelectWidth:k,select:T}=C.useContext(Rn),M=C.useContext(Rh),A=S("select",t),N=S(),{compactSize:R,compactItemClassnames:F}=QS(A,E),[W,H]=FCt(A),G=C.useMemo(()=>{const{mode:Re}=_;if(Re!=="combobox")return Re===_xe?"combobox":Re},[_.mode]),U=G==="multiple"||G==="tags",K=$Ct(v),{status:re,hasFeedback:Y,isFormItemInput:J,feedbackIcon:Q}=C.useContext(Zf),ue=O5(re,p);let de;g!==void 0?de=g:G==="combobox"?de=null:de=(L==null?void 0:L("Select"))||C.createElement(nQ,{componentName:"Select"});const{suffixIcon:_e,itemIcon:ve,removeIcon:Ve,clearIcon:Ze}=HCt(Object.assign(Object.assign({},_),{multiple:U,hasFeedback:Y,feedbackIcon:Q,showArrow:K,prefixCls:A})),We=ll(_,["suffixIcon","itemIcon"]),pe=xe(a||l,{[`${A}-dropdown-${E}`]:E==="rtl"},o,H),Pe=R||h||M,Se=C.useContext(H_),Ne=f??Se,Me=xe({[`${A}-lg`]:Pe==="large",[`${A}-sm`]:Pe==="small",[`${A}-rtl`]:E==="rtl",[`${A}-borderless`]:!n,[`${A}-in-form-item`]:J},Cp(A,ue,Y),F,r,o,H),Qe=C.useMemo(()=>u!==void 0?u:E==="rtl"?"bottomRight":"bottomLeft",[u,E]),Ke=WCt(m);return W(C.createElement(eQ,Object.assign({ref:e,virtual:D,dropdownMatchSelectWidth:k,showSearch:T==null?void 0:T.showSearch},We,{builtinPlacements:Ke,transitionName:nC(N,P_t(u),_.transitionName),listHeight:c,listItemHeight:d,mode:G,prefixCls:A,placement:Qe,direction:E,inputIcon:_e,menuItemSelectedIcon:ve,removeIcon:Ve,clearIcon:Ze,notFoundContent:de,className:Me,getPopupContainer:s||y,dropdownClassName:pe,showArrow:Y||K,disabled:Ne})))},JS=C.forwardRef(zCt),UCt=gxe(JS);JS.SECRET_COMBOBOX_MODE_DO_NOT_USE=_xe;JS.Option=QZ;JS.OptGroup=ZZ;JS._InternalPanelDoNotUseOrYouWillBeFired=UCt;const F5=JS;function bxe(){const[,i]=C.useReducer(e=>e+1,0);return i}const v_=["xxl","xl","lg","md","sm","xs"],jCt=i=>({xs:`(max-width: ${i.screenXSMax}px)`,sm:`(min-width: ${i.screenSM}px)`,md:`(min-width: ${i.screenMD}px)`,lg:`(min-width: ${i.screenLG}px)`,xl:`(min-width: ${i.screenXL}px)`,xxl:`(min-width: ${i.screenXXL}px)`}),KCt=i=>{const e=i,t=[].concat(v_).reverse();return t.forEach((n,r)=>{const o=n.toUpperCase(),s=`screen${o}Min`,a=`screen${o}`;if(!(e[s]<=e[a]))throw new Error(`${s}<=${a} fails : !(${e[s]}<=${e[a]})`);if(r{const t=new Map;let n=-1,r={};return{matchHandlers:{},dispatch(o){return r=o,t.forEach(s=>s(r)),t.size>=1},subscribe(o){return t.size||this.register(),n+=1,t.set(n,o),o(r),n},unsubscribe(o){t.delete(o),t.size||this.unregister()},unregister(){Object.keys(e).forEach(o=>{const s=e[o],a=this.matchHandlers[s];a==null||a.mql.removeListener(a==null?void 0:a.listener)}),t.clear()},register(){Object.keys(e).forEach(o=>{const s=e[o],a=c=>{let{matches:u}=c;this.dispatch(Object.assign(Object.assign({},r),{[o]:u}))},l=window.matchMedia(s);l.addListener(a),this.matchHandlers[s]={mql:l,listener:a},a(l)})},responsiveMap:e}},[i])}function B5(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;const e=C.useRef({}),t=bxe(),n=Cxe();return C.useEffect(()=>{const r=n.subscribe(o=>{e.current=o,i&&t()});return()=>n.unsubscribe(r)},[]),e.current}const uK=C.createContext("default"),hue=i=>{let{children:e,size:t}=i;const n=C.useContext(uK);return C.createElement(uK.Provider,{value:t||n},e)},GCt=i=>{const{antCls:e,componentCls:t,iconCls:n,avatarBg:r,avatarColor:o,avatarSizeBase:s,avatarSizeLG:a,avatarSizeSM:l,avatarFontSizeBase:c,avatarFontSizeLG:u,avatarFontSizeSM:d,borderRadius:h,borderRadiusLG:f,borderRadiusSM:g,lineWidth:p,lineType:v}=i,m=(_,y,S)=>({width:_,height:_,lineHeight:`${_-p*2}px`,borderRadius:"50%",[`&${t}-square`]:{borderRadius:S},[`${t}-string`]:{position:"absolute",left:{_skip_check_:!0,value:"50%"},transformOrigin:"0 center"},[`&${t}-icon`]:{fontSize:y,[`> ${n}`]:{margin:0}}});return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},Wr(i)),{position:"relative",display:"inline-block",overflow:"hidden",color:o,whiteSpace:"nowrap",textAlign:"center",verticalAlign:"middle",background:r,border:`${p}px ${v} transparent`,["&-image"]:{background:"transparent"},[`${e}-image-img`]:{display:"block"}}),m(s,c,h)),{["&-lg"]:Object.assign({},m(a,u,f)),["&-sm"]:Object.assign({},m(l,d,g)),"> img":{display:"block",width:"100%",height:"100%",objectFit:"cover"}})}},qCt=i=>{const{componentCls:e,avatarGroupBorderColor:t,avatarGroupSpace:n}=i;return{[`${e}-group`]:{display:"inline-flex",[`${e}`]:{borderColor:t},["> *:not(:first-child)"]:{marginInlineStart:n}}}},yxe=vo("Avatar",i=>{const{colorTextLightSolid:e,controlHeight:t,controlHeightLG:n,controlHeightSM:r,fontSize:o,fontSizeLG:s,fontSizeXL:a,fontSizeHeading3:l,marginXS:c,colorBorderBg:u,colorTextPlaceholder:d}=i,h=Oi(i,{avatarBg:d,avatarColor:e,avatarSizeBase:t,avatarSizeLG:n,avatarSizeSM:r,avatarFontSizeBase:Math.round((s+a)/2),avatarFontSizeLG:l,avatarFontSizeSM:o,avatarGroupSpace:-c,avatarGroupBorderColor:u});return[GCt(h),qCt(h)]});var XCt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const t=C.useContext(uK),[n,r]=C.useState(1),[o,s]=C.useState(!1),[a,l]=C.useState(!0),c=C.useRef(null),u=C.useRef(null),d=vu(e,c),{getPrefixCls:h}=C.useContext(Rn),f=()=>{if(!u.current||!c.current)return;const ue=u.current.offsetWidth,de=c.current.offsetWidth;if(ue!==0&&de!==0){const{gap:_e=4}=i;_e*2{s(!0)},[]),C.useEffect(()=>{l(!0),r(1)},[i.src]),C.useEffect(()=>{f()},[i.gap]);const g=()=>{const{onError:ue}=i;(ue?ue():void 0)!==!1&&l(!1)},{prefixCls:p,shape:v="circle",size:m="default",src:_,srcSet:y,icon:S,className:L,rootClassName:E,alt:D,draggable:k,children:T,crossOrigin:M}=i,A=XCt(i,["prefixCls","shape","size","src","srcSet","icon","className","rootClassName","alt","draggable","children","crossOrigin"]),N=m==="default"?t:m,R=Object.keys(typeof N=="object"?N||{}:{}).some(ue=>["xs","sm","md","lg","xl","xxl"].includes(ue)),F=B5(R),W=C.useMemo(()=>{if(typeof N!="object")return{};const ue=v_.find(_e=>F[_e]),de=N[ue];return de?{width:de,height:de,lineHeight:`${de}px`,fontSize:S?de/2:18}:{}},[F,N]),H=h("avatar",p),[G,U]=yxe(H),K=xe({[`${H}-lg`]:N==="large",[`${H}-sm`]:N==="small"}),re=C.isValidElement(_),Y=xe(H,K,{[`${H}-${v}`]:!!v,[`${H}-image`]:re||_&&a,[`${H}-icon`]:!!S},L,E,U),J=typeof N=="number"?{width:N,height:N,lineHeight:`${N}px`,fontSize:S?N/2:18}:{};let Q;if(typeof _=="string"&&a)Q=C.createElement("img",{src:_,draggable:k,srcSet:y,onError:g,alt:D,crossOrigin:M});else if(re)Q=_;else if(S)Q=S;else if(o||n!==1){const ue=`scale(${n}) translateX(-50%)`,de={msTransform:ue,WebkitTransform:ue,transform:ue},_e=typeof N=="number"?{lineHeight:`${N}px`}:{};Q=C.createElement(Nh,{onResize:f},C.createElement("span",{className:`${H}-string`,ref:u,style:Object.assign(Object.assign({},_e),de)},T))}else Q=C.createElement("span",{className:`${H}-string`,style:{opacity:0},ref:u},T);return delete A.onError,delete A.gap,G(C.createElement("span",Object.assign({},A,{style:Object.assign(Object.assign(Object.assign({},J),W),A.style),className:Y,ref:d}),Q))},ZCt=C.forwardRef(YCt),wxe=ZCt;var b1={shiftX:64,adjustY:1},C1={adjustX:1,shiftY:!0},Tu=[0,0],QCt={left:{points:["cr","cl"],overflow:C1,offset:[-4,0],targetOffset:Tu},right:{points:["cl","cr"],overflow:C1,offset:[4,0],targetOffset:Tu},top:{points:["bc","tc"],overflow:b1,offset:[0,-4],targetOffset:Tu},bottom:{points:["tc","bc"],overflow:b1,offset:[0,4],targetOffset:Tu},topLeft:{points:["bl","tl"],overflow:b1,offset:[0,-4],targetOffset:Tu},leftTop:{points:["tr","tl"],overflow:C1,offset:[-4,0],targetOffset:Tu},topRight:{points:["br","tr"],overflow:b1,offset:[0,-4],targetOffset:Tu},rightTop:{points:["tl","tr"],overflow:C1,offset:[4,0],targetOffset:Tu},bottomRight:{points:["tr","br"],overflow:b1,offset:[0,4],targetOffset:Tu},rightBottom:{points:["bl","br"],overflow:C1,offset:[4,0],targetOffset:Tu},bottomLeft:{points:["tl","bl"],overflow:b1,offset:[0,4],targetOffset:Tu},leftBottom:{points:["br","bl"],overflow:C1,offset:[-4,0],targetOffset:Tu}};function iQ(i){var e=i.children,t=i.prefixCls,n=i.id,r=i.overlayInnerStyle,o=i.className,s=i.style;return C.createElement("div",{className:xe("".concat(t,"-content"),o),style:s},C.createElement("div",{className:"".concat(t,"-inner"),id:n,role:"tooltip",style:r},typeof e=="function"?e():e))}var JCt=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"],e1t=function(e,t){var n=e.overlayClassName,r=e.trigger,o=r===void 0?["hover"]:r,s=e.mouseEnterDelay,a=s===void 0?0:s,l=e.mouseLeaveDelay,c=l===void 0?.1:l,u=e.overlayStyle,d=e.prefixCls,h=d===void 0?"rc-tooltip":d,f=e.children,g=e.onVisibleChange,p=e.afterVisibleChange,v=e.transitionName,m=e.animation,_=e.motion,y=e.placement,S=y===void 0?"right":y,L=e.align,E=L===void 0?{}:L,D=e.destroyTooltipOnHide,k=D===void 0?!1:D,T=e.defaultVisible,M=e.getTooltipContainer,A=e.overlayInnerStyle;e.arrowContent;var N=e.overlay,R=e.id,F=e.showArrow,W=F===void 0?!0:F,H=Nn(e,JCt),G=C.useRef(null);C.useImperativeHandle(t,function(){return G.current});var U=te({},H);"visible"in e&&(U.popupVisible=e.visible);var K=function(){return C.createElement(iQ,{key:"content",prefixCls:h,id:R,overlayInnerStyle:A},N)};return C.createElement(sxe,St({popupClassName:n,prefixCls:h,popup:K,action:o,builtinPlacements:QCt,popupPlacement:S,ref:G,popupAlign:E,getPopupContainer:M,onPopupVisibleChange:g,afterPopupVisibleChange:p,popupTransitionName:v,popupAnimation:m,popupMotion:_,defaultPopupVisible:T,autoDestroy:k,mouseLeaveDelay:c,popupStyle:u,mouseEnterDelay:a,arrow:W},U),f)};const t1t=C.forwardRef(e1t),Sxe=8;function rQ(i){const e=Sxe,{contentRadius:t,limitVerticalRadius:n}=i,r=t>12?t+2:12;return{dropdownArrowOffset:r,dropdownArrowOffsetVertical:n?e:r}}function M2(i,e){return i?e:{}}function oQ(i,e){const{componentCls:t,sizePopupArrow:n,borderRadiusXS:r,borderRadiusOuter:o,boxShadowPopoverArrow:s}=i,{colorBg:a,contentRadius:l=i.borderRadiusLG,limitVerticalRadius:c,arrowDistance:u=0,arrowPlacement:d={left:!0,right:!0,top:!0,bottom:!0}}=e,{dropdownArrowOffsetVertical:h,dropdownArrowOffset:f}=rQ({contentRadius:l,limitVerticalRadius:c});return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({[`${t}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},wmt(n,r,o,a,s)),{"&:before":{background:a}})]},M2(!!d.top,{[[`&-placement-top ${t}-arrow`,`&-placement-topLeft ${t}-arrow`,`&-placement-topRight ${t}-arrow`].join(",")]:{bottom:u,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top ${t}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},[`&-placement-topLeft ${t}-arrow`]:{left:{_skip_check_:!0,value:f}},[`&-placement-topRight ${t}-arrow`]:{right:{_skip_check_:!0,value:f}}})),M2(!!d.bottom,{[[`&-placement-bottom ${t}-arrow`,`&-placement-bottomLeft ${t}-arrow`,`&-placement-bottomRight ${t}-arrow`].join(",")]:{top:u,transform:"translateY(-100%)"},[`&-placement-bottom ${t}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},[`&-placement-bottomLeft ${t}-arrow`]:{left:{_skip_check_:!0,value:f}},[`&-placement-bottomRight ${t}-arrow`]:{right:{_skip_check_:!0,value:f}}})),M2(!!d.left,{[[`&-placement-left ${t}-arrow`,`&-placement-leftTop ${t}-arrow`,`&-placement-leftBottom ${t}-arrow`].join(",")]:{right:{_skip_check_:!0,value:u},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left ${t}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop ${t}-arrow`]:{top:h},[`&-placement-leftBottom ${t}-arrow`]:{bottom:h}})),M2(!!d.right,{[[`&-placement-right ${t}-arrow`,`&-placement-rightTop ${t}-arrow`,`&-placement-rightBottom ${t}-arrow`].join(",")]:{left:{_skip_check_:!0,value:u},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right ${t}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop ${t}-arrow`]:{top:h},[`&-placement-rightBottom ${t}-arrow`]:{bottom:h}}))}}function n1t(i,e,t,n){if(n===!1)return{adjustX:!1,adjustY:!1};const r=n&&typeof n=="object"?n:{},o={};switch(i){case"top":case"bottom":o.shiftX=e.dropdownArrowOffset*2+t;break;case"left":case"right":o.shiftY=e.dropdownArrowOffsetVertical*2+t;break}const s=Object.assign(Object.assign({},o),r);return s.shiftX||(s.adjustX=!0),s.shiftY||(s.adjustY=!0),s}const fue={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},i1t={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},r1t=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function xxe(i){const{arrowWidth:e,autoAdjustOverflow:t,arrowPointAtCenter:n,offset:r,borderRadius:o}=i,s=e/2,a={};return Object.keys(fue).forEach(l=>{const c=n&&i1t[l]||fue[l],u=Object.assign(Object.assign({},c),{offset:[0,0]});switch(a[l]=u,r1t.has(l)&&(u.autoArrow=!1),l){case"top":case"topLeft":case"topRight":u.offset[1]=-s-r;break;case"bottom":case"bottomLeft":case"bottomRight":u.offset[1]=s+r;break;case"left":case"leftTop":case"leftBottom":u.offset[0]=-s-r;break;case"right":case"rightTop":case"rightBottom":u.offset[0]=s+r;break}const d=rQ({contentRadius:o,limitVerticalRadius:!0});if(n)switch(l){case"topLeft":case"bottomLeft":u.offset[0]=-d.dropdownArrowOffset-s;break;case"topRight":case"bottomRight":u.offset[0]=d.dropdownArrowOffset+s;break;case"leftTop":case"rightTop":u.offset[1]=-d.dropdownArrowOffset-s;break;case"leftBottom":case"rightBottom":u.offset[1]=d.dropdownArrowOffset+s;break}u.overflow=n1t(l,d,e,t)}),a}const hm=(i,e)=>new Yr(i).setAlpha(e).toRgbString(),y1=(i,e)=>new Yr(i).lighten(e).toHexString(),o1t=i=>{const e=Ap(i,{theme:"dark"});return{1:e[0],2:e[1],3:e[2],4:e[3],5:e[6],6:e[5],7:e[4],8:e[6],9:e[5],10:e[4]}},s1t=(i,e)=>{const t=i||"#000",n=e||"#fff";return{colorBgBase:t,colorTextBase:n,colorText:hm(n,.85),colorTextSecondary:hm(n,.65),colorTextTertiary:hm(n,.45),colorTextQuaternary:hm(n,.25),colorFill:hm(n,.18),colorFillSecondary:hm(n,.12),colorFillTertiary:hm(n,.08),colorFillQuaternary:hm(n,.04),colorBgElevated:y1(t,12),colorBgContainer:y1(t,8),colorBgLayout:y1(t,0),colorBgSpotlight:y1(t,26),colorBorder:y1(t,26),colorBorderSecondary:y1(t,19)}},a1t=(i,e)=>{const t=Object.keys(PZ).map(r=>{const o=Ap(i[r],{theme:"dark"});return new Array(10).fill(1).reduce((s,a,l)=>(s[`${r}-${l+1}`]=o[l],s[`${r}${l+1}`]=o[l],s),{})}).reduce((r,o)=>(r=Object.assign(Object.assign({},r),o),r),{}),n=e??T5(i);return Object.assign(Object.assign(Object.assign({},n),t),nSe(i,{generateColorPalettes:o1t,generateNeutralColorPalettes:s1t}))},l1t=a1t;function c1t(i){const{sizeUnit:e,sizeStep:t}=i,n=t-2;return{sizeXXL:e*(n+10),sizeXL:e*(n+6),sizeLG:e*(n+2),sizeMD:e*(n+2),sizeMS:e*(n+1),size:e*n,sizeSM:e*n,sizeXS:e*(n-1),sizeXXS:e*(n-1)}}const u1t=(i,e)=>{const t=e??T5(i),n=t.fontSizeSM,r=t.controlHeight-4;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t),c1t(e??i)),iSe(n)),{controlHeight:r}),tSe(Object.assign(Object.assign({},t),{controlHeight:r})))},d1t=u1t;function h1t(){const[i,e,t]=DC();return{theme:i,token:e,hashId:t}}const Lxe={defaultConfig:VO,defaultSeed:VO.token,useToken:h1t,defaultAlgorithm:T5,darkAlgorithm:l1t,compactAlgorithm:d1t},f1t=i=>{const{componentCls:e,tooltipMaxWidth:t,tooltipColor:n,tooltipBg:r,tooltipBorderRadius:o,zIndexPopup:s,controlHeight:a,boxShadowSecondary:l,paddingSM:c,paddingXS:u,tooltipRadiusOuter:d}=i;return[{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},Wr(i)),{position:"absolute",zIndex:s,display:"block",width:"max-content",maxWidth:t,visibility:"visible","&-hidden":{display:"none"},"--antd-arrow-background-color":r,[`${e}-inner`]:{minWidth:a,minHeight:a,padding:`${c/2}px ${u}px`,color:n,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:r,borderRadius:o,boxShadow:l},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${e}-inner`]:{borderRadius:Math.min(o,Sxe)}},[`${e}-content`]:{position:"relative"}}),Dmt(i,(h,f)=>{let{darkColor:g}=f;return{[`&${e}-${h}`]:{[`${e}-inner`]:{backgroundColor:g},[`${e}-arrow`]:{"--antd-arrow-background-color":g}}}})),{"&-rtl":{direction:"rtl"}})},oQ(Oi(i,{borderRadiusOuter:d}),{colorBg:"var(--antd-arrow-background-color)",contentRadius:o,limitVerticalRadius:!0}),{[`${e}-pure`]:{position:"relative",maxWidth:"none",margin:i.sizePopupArrow}}]},Exe=(i,e)=>vo("Tooltip",n=>{if(e===!1)return[];const{borderRadius:r,colorTextLightSolid:o,colorBgDefault:s,borderRadiusOuter:a}=n,l=Oi(n,{tooltipMaxWidth:250,tooltipColor:o,tooltipBorderRadius:r,tooltipBg:s,tooltipRadiusOuter:a>4?4:a});return[f1t(l),IT(n,"zoom-big-fast")]},n=>{let{zIndexPopupBase:r,colorBgSpotlight:o}=n;return{zIndexPopup:r+70,colorBgDefault:o}})(i),g1t=sk.map(i=>`${i}-inverse`);function p1t(i){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)?[].concat(ft(g1t),ft(sk)).includes(i):sk.includes(i)}function Dxe(i,e){const t=p1t(e),n=xe({[`${i}-${e}`]:e&&t}),r={},o={};return e&&!t&&(r.background=e,o["--antd-arrow-background-color"]=e),{className:n,overlayStyle:r,arrowStyle:o}}function m1t(i){const{prefixCls:e,className:t,placement:n="top",title:r,color:o,overlayInnerStyle:s}=i,{getPrefixCls:a}=C.useContext(Rn),l=a("tooltip",e),[c,u]=Exe(l,!0),d=Dxe(l,o),h=Object.assign(Object.assign({},s),d.overlayStyle),f=d.arrowStyle;return c(C.createElement("div",{className:xe(u,l,`${l}-pure`,`${l}-placement-${n}`,t,d.className),style:f},C.createElement("div",{className:`${l}-arrow`}),C.createElement(iQ,Object.assign({},i,{className:u,prefixCls:l,overlayInnerStyle:h}),r)))}var v1t=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const t={},n=Object.assign({},i);return e.forEach(r=>{i&&r in i&&(t[r]=i[r],delete n[r])}),{picked:t,omitted:n}};function C1t(i,e){const t=i.type;if((t.__ANT_BUTTON===!0||i.type==="button")&&i.props.disabled||t.__ANT_SWITCH===!0&&(i.props.disabled||i.props.loading)||t.__ANT_RADIO===!0&&i.props.disabled){const{picked:n,omitted:r}=b1t(i.props.style,["position","left","right","top","bottom","float","display","zIndex"]),o=Object.assign(Object.assign({display:"inline-block"},n),{cursor:"not-allowed",width:i.props.block?"100%":void 0}),s=Object.assign(Object.assign({},r),{pointerEvents:"none"}),a=Qs(i,{style:s,className:null});return C.createElement("span",{style:o,className:xe(i.props.className,`${e}-disabled-compatible-wrapper`)},a)}return i}const Ixe=C.forwardRef((i,e)=>{var t,n;const{prefixCls:r,openClassName:o,getTooltipContainer:s,overlayClassName:a,color:l,overlayInnerStyle:c,children:u,afterOpenChange:d,afterVisibleChange:h,destroyTooltipOnHide:f,arrow:g=!0,title:p,overlay:v,builtinPlacements:m,arrowPointAtCenter:_=!1,autoAdjustOverflow:y=!0}=i,S=!!g,{token:L}=_1t(),{getPopupContainer:E,getPrefixCls:D,direction:k}=C.useContext(Rn),T=C.useRef(null),M=()=>{var Re;(Re=T.current)===null||Re===void 0||Re.forceAlign()};C.useImperativeHandle(e,()=>({forceAlign:M,forcePopupAlign:()=>{M()}}));const[A,N]=Ja(!1,{value:(t=i.open)!==null&&t!==void 0?t:i.visible,defaultValue:(n=i.defaultOpen)!==null&&n!==void 0?n:i.defaultVisible}),R=!p&&!v&&p!==0,F=Re=>{var ct,ie;N(R?!1:Re),R||((ct=i.onOpenChange)===null||ct===void 0||ct.call(i,Re),(ie=i.onVisibleChange)===null||ie===void 0||ie.call(i,Re))},W=C.useMemo(()=>{var Re,ct;let ie=_;return typeof g=="object"&&(ie=(ct=(Re=g.pointAtCenter)!==null&&Re!==void 0?Re:g.arrowPointAtCenter)!==null&&ct!==void 0?ct:_),m||xxe({arrowPointAtCenter:ie,autoAdjustOverflow:y,arrowWidth:S?L.sizePopupArrow:0,borderRadius:L.borderRadius,offset:L.marginXXS})},[_,g,m,L]),H=(Re,ct)=>{const ie=Object.keys(W).find(le=>{var ce,z;return W[le].points[0]===((ce=ct.points)===null||ce===void 0?void 0:ce[0])&&W[le].points[1]===((z=ct.points)===null||z===void 0?void 0:z[1])});if(ie){const le=Re.getBoundingClientRect(),ce={top:"50%",left:"50%"};/top|Bottom/.test(ie)?ce.top=`${le.height-ct.offset[1]}px`:/Top|bottom/.test(ie)&&(ce.top=`${-ct.offset[1]}px`),/left|Right/.test(ie)?ce.left=`${le.width-ct.offset[0]}px`:/right|Left/.test(ie)&&(ce.left=`${-ct.offset[0]}px`),Re.style.transformOrigin=`${ce.left} ${ce.top}`}},G=C.useMemo(()=>p===0?p:v||p||"",[v,p]),{getPopupContainer:U,placement:K="top",mouseEnterDelay:re=.1,mouseLeaveDelay:Y=.1,overlayStyle:J,rootClassName:Q}=i,ue=v1t(i,["getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName"]),de=D("tooltip",r),_e=D(),ve=i["data-popover-inject"];let Ve=A;!("open"in i)&&!("visible"in i)&&R&&(Ve=!1);const Ze=C1t(bh(u)&&!bSe(u)?u:C.createElement("span",null,u),de),We=Ze.props,pe=!We.className||typeof We.className=="string"?xe(We.className,{[o||`${de}-open`]:!0}):We.className,[Pe,Se]=Exe(de,!ve),Ne=Dxe(de,l),Me=Object.assign(Object.assign({},c),Ne.overlayStyle),Qe=Ne.arrowStyle,Ke=xe(a,{[`${de}-rtl`]:k==="rtl"},Ne.className,Q,Se);return Pe(C.createElement(t1t,Object.assign({},ue,{showArrow:S,placement:K,mouseEnterDelay:re,mouseLeaveDelay:Y,prefixCls:de,overlayClassName:Ke,overlayStyle:Object.assign(Object.assign({},Qe),J),getTooltipContainer:U||s||E,ref:T,builtinPlacements:W,overlay:G,visible:Ve,onVisibleChange:F,afterVisibleChange:d??h,onPopupAlign:H,overlayInnerStyle:Me,arrowContent:C.createElement("span",{className:`${de}-arrow-content`}),motion:{motionName:nC(_e,"zoom-big-fast",i.transitionName),motionDeadline:1e3},destroyTooltipOnHide:!!f}),Ve?Qs(Ze,{className:pe}):Ze))});Ixe._InternalPanelDoNotUseOrYouWillBeFired=m1t;const NT=Ixe,QO=i=>i?typeof i=="function"?i():i:null,y1t=i=>{const{componentCls:e,popoverBg:t,popoverColor:n,width:r,fontWeightStrong:o,popoverPadding:s,boxShadowSecondary:a,colorTextHeading:l,borderRadiusLG:c,zIndexPopup:u,marginXS:d,colorBgElevated:h}=i;return[{[e]:Object.assign(Object.assign({},Wr(i)),{position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:u,fontWeight:"normal",whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text","--antd-arrow-background-color":h,"&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},[`${e}-content`]:{position:"relative"},[`${e}-inner`]:{backgroundColor:t,backgroundClip:"padding-box",borderRadius:c,boxShadow:a,padding:s},[`${e}-title`]:{minWidth:r,marginBottom:d,color:l,fontWeight:o},[`${e}-inner-content`]:{color:n}})},oQ(i,{colorBg:"var(--antd-arrow-background-color)"}),{[`${e}-pure`]:{position:"relative",maxWidth:"none",margin:i.sizePopupArrow,display:"inline-block",[`${e}-content`]:{display:"inline-block"}}}]},w1t=i=>{const{componentCls:e}=i;return{[e]:sk.map(t=>{const n=i[`${t}6`];return{[`&${e}-${t}`]:{"--antd-arrow-background-color":n,[`${e}-inner`]:{backgroundColor:n},[`${e}-arrow`]:{background:"transparent"}}}})}},S1t=i=>{const{componentCls:e,lineWidth:t,lineType:n,colorSplit:r,paddingSM:o,controlHeight:s,fontSize:a,lineHeight:l,padding:c}=i,u=s-Math.round(a*l),d=u/2,h=u/2-t,f=c;return{[e]:{[`${e}-inner`]:{padding:0},[`${e}-title`]:{margin:0,padding:`${d}px ${f}px ${h}px`,borderBottom:`${t}px ${n} ${r}`},[`${e}-inner-content`]:{padding:`${o}px ${f}px`}}}},kxe=vo("Popover",i=>{const{colorBgElevated:e,colorText:t,wireframe:n}=i,r=Oi(i,{popoverBg:e,popoverColor:t,popoverPadding:12});return[y1t(r),w1t(r),n&&S1t(r),IT(r,"zoom-big")]},i=>{let{zIndexPopupBase:e}=i;return{zIndexPopup:e+30,width:177}});var x1t=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{if(!(!e&&!t))return C.createElement(C.Fragment,null,e&&C.createElement("div",{className:`${i}-title`},QO(e)),C.createElement("div",{className:`${i}-inner-content`},QO(t)))};function E1t(i){const{hashId:e,prefixCls:t,className:n,style:r,placement:o="top",title:s,content:a,children:l}=i;return C.createElement("div",{className:xe(e,t,`${t}-pure`,`${t}-placement-${o}`,n),style:r},C.createElement("div",{className:`${t}-arrow`}),C.createElement(iQ,Object.assign({},i,{className:e,prefixCls:t}),l||L1t(t,s,a)))}function D1t(i){const{prefixCls:e}=i,t=x1t(i,["prefixCls"]),{getPrefixCls:n}=C.useContext(Rn),r=n("popover",e),[o,s]=kxe(r);return o(C.createElement(E1t,Object.assign({},t,{prefixCls:r,hashId:s})))}var I1t=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{let{title:e,content:t,prefixCls:n}=i;return!e&&!t?null:C.createElement(C.Fragment,null,e&&C.createElement("div",{className:`${n}-title`},QO(e)),C.createElement("div",{className:`${n}-inner-content`},QO(t)))},Txe=C.forwardRef((i,e)=>{const{prefixCls:t,title:n,content:r,overlayClassName:o,placement:s="top",trigger:a="hover",mouseEnterDelay:l=.1,mouseLeaveDelay:c=.1,overlayStyle:u={}}=i,d=I1t(i,["prefixCls","title","content","overlayClassName","placement","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle"]),{getPrefixCls:h}=C.useContext(Rn),f=h("popover",t),[g,p]=kxe(f),v=h(),m=xe(o,p);return g(C.createElement(NT,Object.assign({placement:s,trigger:a,mouseEnterDelay:l,mouseLeaveDelay:c,overlayStyle:u},d,{prefixCls:f,overlayClassName:m,ref:e,overlay:C.createElement(k1t,{prefixCls:f,title:n,content:r}),transitionName:nC(v,"zoom-big",d.transitionName),"data-popover-inject":!0})))});Txe._InternalPanelDoNotUseOrYouWillBeFired=D1t;const T1t=Txe,N1t=i=>{const{getPrefixCls:e,direction:t}=C.useContext(Rn),{prefixCls:n,className:r,rootClassName:o,maxCount:s,maxStyle:a,size:l}=i,c=e("avatar",n),u=`${c}-group`,[d,h]=yxe(c),f=xe(u,{[`${u}-rtl`]:t==="rtl"},r,o,h),{children:g,maxPopoverPlacement:p="top",maxPopoverTrigger:v="hover"}=i,m=rd(g).map((y,S)=>Qs(y,{key:`avatar-key-${S}`})),_=m.length;if(s&&s<_){const y=m.slice(0,s),S=m.slice(s,_);return y.push(C.createElement(T1t,{key:"avatar-popover-key",content:S,trigger:v,placement:p,overlayClassName:`${u}-popover`},C.createElement(wxe,{style:a},`+${_-s}`))),d(C.createElement(hue,{size:l},C.createElement("div",{className:f,style:i.style},y)))}return d(C.createElement(hue,{size:l},C.createElement("div",{className:f,style:i.style},m)))},R1t=N1t,Nxe=wxe;Nxe.Group=R1t;const M1t=Nxe;var A1t=C.forwardRef(function(i,e){var t=i.didUpdate,n=i.getContainer,r=i.children,o=C.useRef(),s=C.useRef();C.useImperativeHandle(e,function(){return{}});var a=C.useRef(!1);return!a.current&&Zs()&&(s.current=n(),o.current=s.current.parentNode,a.current=!0),C.useEffect(function(){t==null||t(i)}),C.useEffect(function(){return s.current.parentNode===null&&o.current!==null&&o.current.appendChild(s.current),function(){var l,c;(l=s.current)===null||l===void 0||(c=l.parentNode)===null||c===void 0||c.removeChild(s.current)}},[]),s.current?_w.createPortal(r,s.current):null});function P1t(i,e,t){return t?i[0]===e[0]:i[0]===e[0]&&i[1]===e[1]}function O1t(i,e,t){var n=i[e]||{};return te(te({},n),t)}function F1t(i,e,t,n){for(var r=t.points,o=Object.keys(i),s=0;s=0&&t.left>=0&&t.bottom>t.top&&t.right>t.left?t:null}function ayt(i,e,t,n){var r=ni.clone(i),o={width:e.width,height:e.height};return n.adjustX&&r.left=t.left&&r.left+o.width>t.right&&(o.width-=r.left+o.width-t.right),n.adjustX&&r.left+o.width>t.right&&(r.left=Math.max(t.right-o.width,t.left)),n.adjustY&&r.top=t.top&&r.top+o.height>t.bottom&&(o.height-=r.top+o.height-t.bottom),n.adjustY&&r.top+o.height>t.bottom&&(r.top=Math.max(t.bottom-o.height,t.top)),ni.mix(r,o)}function cQ(i){var e,t,n;if(!ni.isWindow(i)&&i.nodeType!==9)e=ni.offset(i),t=ni.outerWidth(i),n=ni.outerHeight(i);else{var r=ni.getWindow(i);e={left:ni.getWindowScrollLeft(r),top:ni.getWindowScrollTop(r)},t=ni.viewportWidth(r),n=ni.viewportHeight(r)}return e.width=t,e.height=n,e}function Sue(i,e){var t=e.charAt(0),n=e.charAt(1),r=i.width,o=i.height,s=i.left,a=i.top;return t==="c"?a+=o/2:t==="b"&&(a+=o),n==="c"?s+=r/2:n==="r"&&(s+=r),{left:s,top:a}}function P2(i,e,t,n,r){var o=Sue(e,t[1]),s=Sue(i,t[0]),a=[s.left-o.left,s.top-o.top];return{left:Math.round(i.left-a[0]+n[0]-r[0]),top:Math.round(i.top-a[1]+n[1]-r[1])}}function xue(i,e,t){return i.leftt.right}function Lue(i,e,t){return i.topt.bottom}function lyt(i,e,t){return i.left>t.right||i.left+e.widtht.bottom||i.top+e.height=t.right||n.top>=t.bottom}function uQ(i,e,t){var n=t.target||e,r=cQ(n),o=!uyt(n,t.overflow&&t.overflow.alwaysByViewport);return $xe(i,r,t,o)}uQ.__getOffsetParent=gK;uQ.__getVisibleRectForElement=lQ;function dyt(i,e,t){var n,r,o=ni.getDocument(i),s=o.defaultView||o.parentWindow,a=ni.getWindowScrollLeft(s),l=ni.getWindowScrollTop(s),c=ni.viewportWidth(s),u=ni.viewportHeight(s);"pageX"in e?n=e.pageX:n=a+e.clientX,"pageY"in e?r=e.pageY:r=l+e.clientY;var d={left:n,top:r,width:0,height:0},h=n>=0&&n<=a+c&&r>=0&&r<=l+u,f=[t.points[0],"cc"];return $xe(i,d,pue(pue({},t),{},{points:f}),h)}const hyt=function(i,e){var t=$e.useRef(!1),n=$e.useRef(null);function r(){window.clearTimeout(n.current)}function o(s){if(r(),!t.current||s===!0){if(i(s)===!1)return;t.current=!0,n.current=window.setTimeout(function(){t.current=!1},e)}else n.current=window.setTimeout(function(){t.current=!1,o()},e)}return[o,function(){t.current=!1,r()}]};function fyt(i,e){return i===e?!0:!i||!e?!1:"pageX"in e&&"pageY"in e?i.pageX===e.pageX&&i.pageY===e.pageY:"clientX"in e&&"clientY"in e?i.clientX===e.clientX&&i.clientY===e.clientY:!1}function gyt(i,e){i!==document.activeElement&&gb(e,i)&&typeof i.focus=="function"&&i.focus()}function Iue(i,e){var t=null,n=null;function r(s){var a=Ae(s,1),l=a[0].target;if(document.documentElement.contains(l)){var c=l.getBoundingClientRect(),u=c.width,d=c.height,h=Math.floor(u),f=Math.floor(d);(t!==h||n!==f)&&Promise.resolve().then(function(){e({width:h,height:f})}),t=h,n=f}}var o=new kwe(r);return i&&o.observe(i),function(){o.disconnect()}}function kue(i){return typeof i!="function"?null:i()}function Tue(i){return zn(i)!=="object"||!i?null:i}var pyt=function(e,t){var n=e.children,r=e.disabled,o=e.target,s=e.align,a=e.onAlign,l=e.monitorWindowResize,c=e.monitorBufferTime,u=c===void 0?0:c,d=$e.useRef({}),h=$e.useRef(),f=$e.Children.only(n),g=$e.useRef({});g.current.disabled=r,g.current.target=o,g.current.align=s,g.current.onAlign=a;var p=hyt(function(){var A=g.current,N=A.disabled,R=A.target,F=A.align,W=A.onAlign,H=h.current;if(!N&&R&&H){var G,U=kue(R),K=Tue(R);d.current.element=U,d.current.point=K,d.current.align=F;var re=document,Y=re.activeElement;return U&&DT(U)?G=uQ(H,U,F):K&&(G=dyt(H,K,F)),gyt(Y,H),W&&G&&W(H,G),!0}return!1},u),v=Ae(p,2),m=v[0],_=v[1],y=$e.useState(),S=Ae(y,2),L=S[0],E=S[1],D=$e.useState(),k=Ae(D,2),T=k[0],M=k[1];return br(function(){E(kue(o)),M(Tue(o))}),$e.useEffect(function(){(d.current.element!==L||!fyt(d.current.point,T)||!Pp(d.current.align,s))&&m()}),$e.useEffect(function(){var A=Iue(h.current,m);return A},[h.current]),$e.useEffect(function(){var A=Iue(L,m);return A},[L]),$e.useEffect(function(){r?_():m()},[r]),$e.useEffect(function(){if(l){var A=lp(window,"resize",m);return A.remove}},[l]),$e.useEffect(function(){return function(){_()}},[]),$e.useImperativeHandle(t,function(){return{forceAlign:function(){return m(!0)}}}),$e.isValidElement(f)&&(f=$e.cloneElement(f,{ref:vu(f.ref,h)})),f},Hxe=$e.forwardRef(pyt);Hxe.displayName="Align";var Nue=["measure","alignPre","align",null,"motion"];const myt=function(i,e){var t=Mv(null),n=Ae(t,2),r=n[0],o=n[1],s=C.useRef();function a(u){o(u,!0)}function l(){Zi.cancel(s.current)}function c(u){l(),s.current=Zi(function(){a(function(d){switch(r){case"align":return"motion";case"motion":return"stable"}return d}),u==null||u()})}return C.useEffect(function(){a("measure")},[i]),C.useEffect(function(){switch(r){case"measure":e();break}r&&(s.current=Zi(EC(Nl().mark(function u(){var d,h;return Nl().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:d=Nue.indexOf(r),h=Nue[d+1],h&&d!==-1&&a(h);case 3:case"end":return g.stop()}},u)}))))},[r]),C.useEffect(function(){return function(){l()}},[]),[r,c]},vyt=function(i){var e=C.useState({width:0,height:0}),t=Ae(e,2),n=t[0],r=t[1];function o(a){var l=a.offsetWidth,c=a.offsetHeight,u=a.getBoundingClientRect(),d=u.width,h=u.height;Math.abs(l-d)<1&&Math.abs(c-h)<1&&(l=d,c=h),r({width:l,height:c})}var s=C.useMemo(function(){var a={};if(i){var l=n.width,c=n.height;i.indexOf("height")!==-1&&c?a.height=c:i.indexOf("minHeight")!==-1&&c&&(a.minHeight=c),i.indexOf("width")!==-1&&l?a.width=l:i.indexOf("minWidth")!==-1&&l&&(a.minWidth=l)}return a},[i,n]);return[s,o]};var Vxe=C.forwardRef(function(i,e){var t=i.visible,n=i.prefixCls,r=i.className,o=i.style,s=i.children,a=i.zIndex,l=i.stretch,c=i.destroyPopupOnHide,u=i.forceRender,d=i.align,h=i.point,f=i.getRootDomNode,g=i.getClassNameFromAlign,p=i.onAlign,v=i.onMouseEnter,m=i.onMouseLeave,_=i.onMouseDown,y=i.onTouchStart,S=i.onClick,L=C.useRef(),E=C.useRef(),D=C.useState(),k=Ae(D,2),T=k[0],M=k[1],A=vyt(l),N=Ae(A,2),R=N[0],F=N[1];function W(){l&&F(f())}var H=myt(t,W),G=Ae(H,2),U=G[0],K=G[1],re=C.useState(0),Y=Ae(re,2),J=Y[0],Q=Y[1],ue=C.useRef();br(function(){U==="alignPre"&&Q(0)},[U]);function de(){return h||f}function _e(){var Se;(Se=L.current)===null||Se===void 0||Se.forceAlign()}function ve(Se,Ne){var Me=g(Ne);T!==Me&&M(Me),Q(function(Qe){return Qe+1}),U==="align"&&(p==null||p(Se,Ne))}br(function(){U==="align"&&(J<3?_e():K(function(){var Se;(Se=ue.current)===null||Se===void 0||Se.call(ue)}))},[J]);var Ve=te({},Rxe(i));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(Se){var Ne=Ve[Se];Ve[Se]=function(Me,Qe){return K(),Ne==null?void 0:Ne(Me,Qe)}});function Ze(){return new Promise(function(Se){ue.current=Se})}C.useEffect(function(){!Ve.motionName&&U==="motion"&&K()},[Ve.motionName,U]),C.useImperativeHandle(e,function(){return{forceAlign:_e,getElement:function(){return E.current}}});var We=te(te({},R),{},{zIndex:a,opacity:U==="motion"||U==="stable"||!t?void 0:0,pointerEvents:!t&&U!=="stable"?"none":void 0},o),pe=!0;d!=null&&d.points&&(U==="align"||U==="stable")&&(pe=!1);var Pe=s;return C.Children.count(s)>1&&(Pe=C.createElement("div",{className:"".concat(n,"-content")},s)),C.createElement(fd,St({visible:t,ref:E,leavedClassName:"".concat(n,"-hidden")},Ve,{onAppearPrepare:Ze,onEnterPrepare:Ze,removeOnLeave:c,forceRender:u}),function(Se,Ne){var Me=Se.className,Qe=Se.style,Ke=xe(n,r,T,Me);return C.createElement(Hxe,{target:de(),key:"popup",ref:L,monitorWindowResize:!0,disabled:pe,align:d,onAlign:ve},C.createElement("div",{ref:Ne,className:Ke,onMouseEnter:v,onMouseLeave:m,onMouseDownCapture:_,onTouchStartCapture:y,onClick:S,style:te(te({},Qe),We)},Pe))})});Vxe.displayName="PopupInner";var zxe=C.forwardRef(function(i,e){var t=i.prefixCls,n=i.visible,r=i.zIndex,o=i.children,s=i.mobile;s=s===void 0?{}:s;var a=s.popupClassName,l=s.popupStyle,c=s.popupMotion,u=c===void 0?{}:c,d=s.popupRender,h=i.onClick,f=C.useRef();C.useImperativeHandle(e,function(){return{forceAlign:function(){},getElement:function(){return f.current}}});var g=te({zIndex:r},l),p=o;return C.Children.count(o)>1&&(p=C.createElement("div",{className:"".concat(t,"-content")},o)),d&&(p=d(p)),C.createElement(fd,St({visible:n,ref:f,removeOnLeave:!0},u),function(v,m){var _=v.className,y=v.style,S=xe(t,a,_);return C.createElement("div",{ref:m,className:S,onClick:h,style:te(te({},y),g)},p)})});zxe.displayName="MobilePopupInner";var _yt=["visible","mobile"],Uxe=C.forwardRef(function(i,e){var t=i.visible,n=i.mobile,r=Nn(i,_yt),o=C.useState(t),s=Ae(o,2),a=s[0],l=s[1],c=C.useState(!1),u=Ae(c,2),d=u[0],h=u[1],f=te(te({},r),{},{visible:a});C.useEffect(function(){l(t),t&&n&&h(P5())},[t,n]);var g=d?C.createElement(zxe,St({},f,{mobile:n,ref:e})):C.createElement(Vxe,St({},f,{ref:e}));return C.createElement("div",null,C.createElement(B1t,f),g)});Uxe.displayName="Popup";var Rue=C.createContext(null);function I7(){}function byt(){return""}function Cyt(i){return i?i.ownerDocument:window.document}var yyt=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function wyt(i){var e=function(t){kh(r,t);var n=Th(r);function r(o){var s;vs(this,r),s=n.call(this,o),be(Vn(s),"popupRef",C.createRef()),be(Vn(s),"triggerRef",C.createRef()),be(Vn(s),"portalContainer",void 0),be(Vn(s),"attachId",void 0),be(Vn(s),"clickOutsideHandler",void 0),be(Vn(s),"touchOutsideHandler",void 0),be(Vn(s),"contextMenuOutsideHandler1",void 0),be(Vn(s),"contextMenuOutsideHandler2",void 0),be(Vn(s),"mouseDownTimeout",void 0),be(Vn(s),"focusTime",void 0),be(Vn(s),"preClickTime",void 0),be(Vn(s),"preTouchTime",void 0),be(Vn(s),"delayTimer",void 0),be(Vn(s),"hasPopupMouseDown",void 0),be(Vn(s),"onMouseEnter",function(l){var c=s.props.mouseEnterDelay;s.fireEvents("onMouseEnter",l),s.delaySetPopupVisible(!0,c,c?null:l)}),be(Vn(s),"onMouseMove",function(l){s.fireEvents("onMouseMove",l),s.setPoint(l)}),be(Vn(s),"onMouseLeave",function(l){s.fireEvents("onMouseLeave",l),s.delaySetPopupVisible(!1,s.props.mouseLeaveDelay)}),be(Vn(s),"onPopupMouseEnter",function(){s.clearDelayTimer()}),be(Vn(s),"onPopupMouseLeave",function(l){var c;l.relatedTarget&&!l.relatedTarget.setTimeout&&gb((c=s.popupRef.current)===null||c===void 0?void 0:c.getElement(),l.relatedTarget)||s.delaySetPopupVisible(!1,s.props.mouseLeaveDelay)}),be(Vn(s),"onFocus",function(l){s.fireEvents("onFocus",l),s.clearDelayTimer(),s.isFocusToShow()&&(s.focusTime=Date.now(),s.delaySetPopupVisible(!0,s.props.focusDelay))}),be(Vn(s),"onMouseDown",function(l){s.fireEvents("onMouseDown",l),s.preClickTime=Date.now()}),be(Vn(s),"onTouchStart",function(l){s.fireEvents("onTouchStart",l),s.preTouchTime=Date.now()}),be(Vn(s),"onBlur",function(l){s.fireEvents("onBlur",l),s.clearDelayTimer(),s.isBlurToHide()&&s.delaySetPopupVisible(!1,s.props.blurDelay)}),be(Vn(s),"onContextMenu",function(l){l.preventDefault(),s.fireEvents("onContextMenu",l),s.setPopupVisible(!0,l)}),be(Vn(s),"onContextMenuClose",function(){s.isContextMenuToShow()&&s.close()}),be(Vn(s),"onClick",function(l){if(s.fireEvents("onClick",l),s.focusTime){var c;if(s.preClickTime&&s.preTouchTime?c=Math.min(s.preClickTime,s.preTouchTime):s.preClickTime?c=s.preClickTime:s.preTouchTime&&(c=s.preTouchTime),Math.abs(c-s.focusTime)<20)return;s.focusTime=0}s.preClickTime=0,s.preTouchTime=0,s.isClickToShow()&&(s.isClickToHide()||s.isBlurToHide())&&l&&l.preventDefault&&l.preventDefault();var u=!s.state.popupVisible;(s.isClickToHide()&&!u||u&&s.isClickToShow())&&s.setPopupVisible(!s.state.popupVisible,l)}),be(Vn(s),"onPopupMouseDown",function(){if(s.hasPopupMouseDown=!0,clearTimeout(s.mouseDownTimeout),s.mouseDownTimeout=window.setTimeout(function(){s.hasPopupMouseDown=!1},0),s.context){var l;(l=s.context).onPopupMouseDown.apply(l,arguments)}}),be(Vn(s),"onDocumentClick",function(l){if(!(s.props.mask&&!s.props.maskClosable)){var c=l.target,u=s.getRootDomNode(),d=s.getPopupDomNode();(!gb(u,c)||s.isContextMenuOnly())&&!gb(d,c)&&!s.hasPopupMouseDown&&s.close()}}),be(Vn(s),"getRootDomNode",function(){var l=s.props.getTriggerDOMNode;if(l)return l(s.triggerRef.current);try{var c=nk(s.triggerRef.current);if(c)return c}catch{}return _w.findDOMNode(Vn(s))}),be(Vn(s),"getPopupClassNameFromAlign",function(l){var c=[],u=s.props,d=u.popupPlacement,h=u.builtinPlacements,f=u.prefixCls,g=u.alignPoint,p=u.getPopupClassNameFromAlign;return d&&h&&c.push(F1t(h,f,l,g)),p&&c.push(p(l)),c.join(" ")}),be(Vn(s),"getComponent",function(){var l=s.props,c=l.prefixCls,u=l.destroyPopupOnHide,d=l.popupClassName,h=l.onPopupAlign,f=l.popupMotion,g=l.popupAnimation,p=l.popupTransitionName,v=l.popupStyle,m=l.mask,_=l.maskAnimation,y=l.maskTransitionName,S=l.maskMotion,L=l.zIndex,E=l.popup,D=l.stretch,k=l.alignPoint,T=l.mobile,M=l.forceRender,A=l.onPopupClick,N=s.state,R=N.popupVisible,F=N.point,W=s.getPopupAlign(),H={};return s.isMouseEnterToShow()&&(H.onMouseEnter=s.onPopupMouseEnter),s.isMouseLeaveToHide()&&(H.onMouseLeave=s.onPopupMouseLeave),H.onMouseDown=s.onPopupMouseDown,H.onTouchStart=s.onPopupMouseDown,C.createElement(Uxe,St({prefixCls:c,destroyPopupOnHide:u,visible:R,point:k&&F,className:d,align:W,onAlign:h,animation:g,getClassNameFromAlign:s.getPopupClassNameFromAlign},H,{stretch:D,getRootDomNode:s.getRootDomNode,style:v,mask:m,zIndex:L,transitionName:p,maskAnimation:_,maskTransitionName:y,maskMotion:S,ref:s.popupRef,motion:f,mobile:T,forceRender:M,onClick:A}),typeof E=="function"?E():E)}),be(Vn(s),"attachParent",function(l){Zi.cancel(s.attachId);var c=s.props,u=c.getPopupContainer,d=c.getDocument,h=s.getRootDomNode(),f;u?(h||u.length===0)&&(f=u(h)):f=d(s.getRootDomNode()).body,f?f.appendChild(l):s.attachId=Zi(function(){s.attachParent(l)})}),be(Vn(s),"getContainer",function(){if(!s.portalContainer){var l=s.props.getDocument,c=l(s.getRootDomNode()).createElement("div");c.style.position="absolute",c.style.top="0",c.style.left="0",c.style.width="100%",s.portalContainer=c}return s.attachParent(s.portalContainer),s.portalContainer}),be(Vn(s),"setPoint",function(l){var c=s.props.alignPoint;!c||!l||s.setState({point:{pageX:l.pageX,pageY:l.pageY}})}),be(Vn(s),"handlePortalUpdate",function(){s.state.prevPopupVisible!==s.state.popupVisible&&s.props.afterPopupVisibleChange(s.state.popupVisible)}),be(Vn(s),"triggerContextValue",{onPopupMouseDown:s.onPopupMouseDown});var a;return"popupVisible"in o?a=!!o.popupVisible:a=!!o.defaultPopupVisible,s.state={prevPopupVisible:a,popupVisible:a},yyt.forEach(function(l){s["fire".concat(l)]=function(c){s.fireEvents(l,c)}}),s}return _s(r,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var s=this.props,a=this.state;if(a.popupVisible){var l;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(l=s.getDocument(this.getRootDomNode()),this.clickOutsideHandler=lp(l,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(l=l||s.getDocument(this.getRootDomNode()),this.touchOutsideHandler=lp(l,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(l=l||s.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=lp(l,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=lp(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),Zi.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var s;return((s=this.popupRef.current)===null||s===void 0?void 0:s.getElement())||null}},{key:"getPopupAlign",value:function(){var s=this.props,a=s.popupPlacement,l=s.popupAlign,c=s.builtinPlacements;return a&&c?O1t(c,a,l):l}},{key:"setPopupVisible",value:function(s,a){var l=this.props.alignPoint,c=this.state.popupVisible;this.clearDelayTimer(),c!==s&&("popupVisible"in this.props||this.setState({popupVisible:s,prevPopupVisible:c}),this.props.onPopupVisibleChange(s)),l&&a&&s&&this.setPoint(a)}},{key:"delaySetPopupVisible",value:function(s,a,l){var c=this,u=a*1e3;if(this.clearDelayTimer(),u){var d=l?{pageX:l.pageX,pageY:l.pageY}:null;this.delayTimer=window.setTimeout(function(){c.setPopupVisible(s,d),c.clearDelayTimer()},u)}else this.setPopupVisible(s,l)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(s){var a=this.props.children.props,l=this.props;return a[s]&&l[s]?this["fire".concat(s)]:a[s]||l[s]}},{key:"isClickToShow",value:function(){var s=this.props,a=s.action,l=s.showAction;return a.indexOf("click")!==-1||l.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var s=this.props.action;return s==="contextMenu"||s.length===1&&s[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var s=this.props,a=s.action,l=s.showAction;return a.indexOf("contextMenu")!==-1||l.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var s=this.props,a=s.action,l=s.hideAction;return a.indexOf("click")!==-1||l.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var s=this.props,a=s.action,l=s.showAction;return a.indexOf("hover")!==-1||l.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var s=this.props,a=s.action,l=s.hideAction;return a.indexOf("hover")!==-1||l.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var s=this.props,a=s.action,l=s.showAction;return a.indexOf("focus")!==-1||l.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var s=this.props,a=s.action,l=s.hideAction;return a.indexOf("focus")!==-1||l.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var s;(s=this.popupRef.current)===null||s===void 0||s.forceAlign()}}},{key:"fireEvents",value:function(s,a){var l=this.props.children.props[s];l&&l(a);var c=this.props[s];c&&c(a)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var s=this.state.popupVisible,a=this.props,l=a.children,c=a.forceRender,u=a.alignPoint,d=a.className,h=a.autoDestroy,f=C.Children.only(l),g={key:"trigger"};this.isContextMenuToShow()?g.onContextMenu=this.onContextMenu:g.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(g.onClick=this.onClick,g.onMouseDown=this.onMouseDown,g.onTouchStart=this.onTouchStart):(g.onClick=this.createTwoChains("onClick"),g.onMouseDown=this.createTwoChains("onMouseDown"),g.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(g.onMouseEnter=this.onMouseEnter,u&&(g.onMouseMove=this.onMouseMove)):g.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?g.onMouseLeave=this.onMouseLeave:g.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(g.onFocus=this.onFocus,g.onBlur=this.onBlur):(g.onFocus=this.createTwoChains("onFocus"),g.onBlur=this.createTwoChains("onBlur"));var p=xe(f&&f.props&&f.props.className,d);p&&(g.className=p);var v=te({},g);$_(f)&&(v.ref=vu(this.triggerRef,f.ref));var m=C.cloneElement(f,v),_;return(s||this.popupRef.current||c)&&(_=C.createElement(i,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!s&&h&&(_=null),C.createElement(Rue.Provider,{value:this.triggerContextValue},m,_)}}],[{key:"getDerivedStateFromProps",value:function(s,a){var l=s.popupVisible,c={};return l!==void 0&&a.popupVisible!==l&&(c.popupVisible=l,c.prevPopupVisible=a.popupVisible),c}}]),r}(C.Component);return be(e,"contextType",Rue),be(e,"defaultProps",{prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:byt,getDocument:Cyt,onPopupVisibleChange:I7,afterPopupVisibleChange:I7,onPopupAlign:I7,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1}),e}const jxe=wyt(A1t);var w1={adjustX:1,adjustY:1},S1=[0,0],Syt={topLeft:{points:["bl","tl"],overflow:w1,offset:[0,-4],targetOffset:S1},topCenter:{points:["bc","tc"],overflow:w1,offset:[0,-4],targetOffset:S1},topRight:{points:["br","tr"],overflow:w1,offset:[0,-4],targetOffset:S1},bottomLeft:{points:["tl","bl"],overflow:w1,offset:[0,4],targetOffset:S1},bottomCenter:{points:["tc","bc"],overflow:w1,offset:[0,4],targetOffset:S1},bottomRight:{points:["tr","br"],overflow:w1,offset:[0,4],targetOffset:S1}};function Mue(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(DT(i)){var t=i.nodeName.toLowerCase(),n=["input","select","textarea","button"].includes(t)||i.isContentEditable||t==="a"&&!!i.getAttribute("href"),r=i.getAttribute("tabindex"),o=Number(r),s=null;return r&&!Number.isNaN(o)?s=o:n&&s===null&&(s=0),n&&i.disabled&&(s=null),s!==null&&(s>=0||e&&s<0)}return!1}function Kxe(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=ft(i.querySelectorAll("*")).filter(function(n){return Mue(n,e)});return Mue(i,e)&&t.unshift(i),t}var xyt=vt.ESC,Lyt=vt.TAB;function Eyt(i){var e=i.visible,t=i.setTriggerVisible,n=i.triggerRef,r=i.onVisibleChange,o=i.autoFocus,s=C.useRef(!1),a=function(){if(e&&n.current){var d,h,f,g;(d=n.current)===null||d===void 0||(h=d.triggerRef)===null||h===void 0||(f=h.current)===null||f===void 0||(g=f.focus)===null||g===void 0||g.call(f),t(!1),typeof r=="function"&&r(!1)}},l=function(){var d,h,f,g,p=Kxe((d=n.current)===null||d===void 0||(h=d.popupRef)===null||h===void 0||(f=h.current)===null||f===void 0||(g=f.getElement)===null||g===void 0?void 0:g.call(f)),v=p[0];return v!=null&&v.focus?(v.focus(),s.current=!0,!0):!1},c=function(d){switch(d.keyCode){case xyt:a();break;case Lyt:{var h=!1;s.current||(h=l()),h?d.preventDefault():a();break}}};C.useEffect(function(){return e?(window.addEventListener("keydown",c),o&&Zi(l,3),function(){window.removeEventListener("keydown",c),s.current=!1}):function(){s.current=!1}},[e])}var Dyt=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus"];function Iyt(i,e){var t=i.arrow,n=t===void 0?!1:t,r=i.prefixCls,o=r===void 0?"rc-dropdown":r,s=i.transitionName,a=i.animation,l=i.align,c=i.placement,u=c===void 0?"bottomLeft":c,d=i.placements,h=d===void 0?Syt:d,f=i.getPopupContainer,g=i.showAction,p=i.hideAction,v=i.overlayClassName,m=i.overlayStyle,_=i.visible,y=i.trigger,S=y===void 0?["hover"]:y,L=i.autoFocus,E=Nn(i,Dyt),D=C.useState(),k=Ae(D,2),T=k[0],M=k[1],A="visible"in i?_:T,N=C.useRef(null);C.useImperativeHandle(e,function(){return N.current}),Eyt({visible:A,setTriggerVisible:M,triggerRef:N,onVisibleChange:i.onVisibleChange,autoFocus:L});var R=function(){var Q=i.overlay,ue;return typeof Q=="function"?ue=Q():ue=Q,ue},F=function(Q){var ue=i.onOverlayClick;M(!1),ue&&ue(Q)},W=function(Q){var ue=i.onVisibleChange;M(Q),typeof ue=="function"&&ue(Q)},H=function(){var Q=R();return C.createElement(C.Fragment,null,n&&C.createElement("div",{className:"".concat(o,"-arrow")}),Q)},G=function(){var Q=i.overlay;return typeof Q=="function"?H:H()},U=function(){var Q=i.minOverlayWidthMatchTrigger,ue=i.alignPoint;return"minOverlayWidthMatchTrigger"in i?Q:!ue},K=function(){var Q=i.openClassName;return Q!==void 0?Q:"".concat(o,"-open")},re=function(){var Q=i.children,ue=Q.props?Q.props:{},de=xe(ue.className,K());return A&&Q?C.cloneElement(Q,{className:de}):Q},Y=p;return!Y&&S.indexOf("contextMenu")!==-1&&(Y=["click"]),C.createElement(jxe,te(te({builtinPlacements:h},E),{},{prefixCls:o,ref:N,popupClassName:xe(v,be({},"".concat(o,"-show-arrow"),n)),popupStyle:m,action:S,showAction:g,hideAction:Y||[],popupPlacement:u,popupAlign:l,popupTransitionName:s,popupAnimation:a,popupVisible:A,stretch:U()?"minWidth":"",popup:G(),onPopupVisibleChange:W,onPopupClick:F,getPopupContainer:f}),re())}const kyt=C.forwardRef(Iyt);var Gxe=C.createContext(null);function dQ(i,e){return i===void 0?null:"".concat(i,"-").concat(e)}function qxe(i){var e=C.useContext(Gxe);return dQ(e,i)}var Tyt=["children","locked"],Ch=C.createContext(null);function Nyt(i,e){var t=te({},i);return Object.keys(e).forEach(function(n){var r=e[n];r!==void 0&&(t[n]=r)}),t}function dk(i){var e=i.children,t=i.locked,n=Nn(i,Tyt),r=C.useContext(Ch),o=LC(function(){return Nyt(r,n)},[r,n],function(s,a){return!t&&(s[0]!==a[0]||!Pp(s[1],a[1],!0))});return C.createElement(Ch.Provider,{value:o},e)}var Ryt=[],Xxe=C.createContext(null);function $5(){return C.useContext(Xxe)}var Yxe=C.createContext(Ryt);function ex(i){var e=C.useContext(Yxe);return C.useMemo(function(){return i!==void 0?[].concat(ft(e),[i]):e},[e,i])}var Zxe=C.createContext(null),hQ=C.createContext({}),pK=vt.LEFT,mK=vt.RIGHT,vK=vt.UP,ZM=vt.DOWN,QM=vt.ENTER,Qxe=vt.ESC,cL=vt.HOME,uL=vt.END,Aue=[vK,ZM,pK,mK];function Myt(i,e,t,n){var r,o,s,a,l="prev",c="next",u="children",d="parent";if(i==="inline"&&n===QM)return{inlineTrigger:!0};var h=(r={},be(r,vK,l),be(r,ZM,c),r),f=(o={},be(o,pK,t?c:l),be(o,mK,t?l:c),be(o,ZM,u),be(o,QM,u),o),g=(s={},be(s,vK,l),be(s,ZM,c),be(s,QM,u),be(s,Qxe,d),be(s,pK,t?u:d),be(s,mK,t?d:u),s),p={inline:h,horizontal:f,vertical:g,inlineSub:h,horizontalSub:g,verticalSub:g},v=(a=p["".concat(i).concat(e?"":"Sub")])===null||a===void 0?void 0:a[n];switch(v){case l:return{offset:-1,sibling:!0};case c:return{offset:1,sibling:!0};case d:return{offset:-1,sibling:!1};case u:return{offset:1,sibling:!1};default:return null}}function Ayt(i){for(var e=i;e;){if(e.getAttribute("data-menu-list"))return e;e=e.parentElement}return null}function Pyt(i,e){for(var t=i||document.activeElement;t;){if(e.has(t))return t;t=t.parentElement}return null}function Jxe(i,e){var t=Kxe(i,!0);return t.filter(function(n){return e.has(n)})}function Pue(i,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!i)return null;var r=Jxe(i,e),o=r.length,s=r.findIndex(function(a){return t===a});return n<0?s===-1?s=o-1:s-=1:n>0&&(s+=1),s=(s+o)%o,r[s]}function Oyt(i,e,t,n,r,o,s,a,l,c){var u=C.useRef(),d=C.useRef();d.current=e;var h=function(){Zi.cancel(u.current)};return C.useEffect(function(){return function(){h()}},[]),function(f){var g=f.which;if([].concat(Aue,[QM,Qxe,cL,uL]).includes(g)){var p,v,m,_=function(){p=new Set,v=new Map,m=new Map;var W=o();return W.forEach(function(H){var G=document.querySelector("[data-menu-id='".concat(dQ(n,H),"']"));G&&(p.add(G),m.set(G,H),v.set(H,G))}),p};_();var y=v.get(e),S=Pyt(y,p),L=m.get(S),E=Myt(i,s(L,!0).length===1,t,g);if(!E&&g!==cL&&g!==uL)return;(Aue.includes(g)||[cL,uL].includes(g))&&f.preventDefault();var D=function(W){if(W){var H=W,G=W.querySelector("a");G!=null&&G.getAttribute("href")&&(H=G);var U=m.get(W);a(U),h(),u.current=Zi(function(){d.current===U&&H.focus()})}};if([cL,uL].includes(g)||E.sibling||!S){var k;!S||i==="inline"?k=r.current:k=Ayt(S);var T,M=Jxe(k,p);g===cL?T=M[0]:g===uL?T=M[M.length-1]:T=Pue(k,p,S,E.offset),D(T)}else if(E.inlineTrigger)l(L);else if(E.offset>0)l(L,!0),h(),u.current=Zi(function(){_();var F=S.getAttribute("aria-controls"),W=document.getElementById(F),H=Pue(W,p);D(H)},5);else if(E.offset<0){var A=s(L,!0),N=A[A.length-2],R=v.get(N);l(N,!1),D(R)}}c==null||c(f)}}function Fyt(i){Promise.resolve().then(i)}var fQ="__RC_UTIL_PATH_SPLIT__",Oue=function(e){return e.join(fQ)},Byt=function(e){return e.split(fQ)},_K="rc-menu-more";function Wyt(){var i=C.useState({}),e=Ae(i,2),t=e[1],n=C.useRef(new Map),r=C.useRef(new Map),o=C.useState([]),s=Ae(o,2),a=s[0],l=s[1],c=C.useRef(0),u=C.useRef(!1),d=function(){u.current||t({})},h=C.useCallback(function(y,S){var L=Oue(S);r.current.set(L,y),n.current.set(y,L),c.current+=1;var E=c.current;Fyt(function(){E===c.current&&d()})},[]),f=C.useCallback(function(y,S){var L=Oue(S);r.current.delete(L),n.current.delete(y)},[]),g=C.useCallback(function(y){l(y)},[]),p=C.useCallback(function(y,S){var L=n.current.get(y)||"",E=Byt(L);return S&&a.includes(E[0])&&E.unshift(_K),E},[a]),v=C.useCallback(function(y,S){return y.some(function(L){var E=p(L,!0);return E.includes(S)})},[p]),m=function(){var S=ft(n.current.keys());return a.length&&S.push(_K),S},_=C.useCallback(function(y){var S="".concat(n.current.get(y)).concat(fQ),L=new Set;return ft(r.current.keys()).forEach(function(E){E.startsWith(S)&&L.add(r.current.get(E))}),L},[]);return C.useEffect(function(){return function(){u.current=!0}},[]),{registerPath:h,unregisterPath:f,refreshOverflowKeys:g,isSubPathKey:v,getKeyPath:p,getKeys:m,getSubPathKeys:_}}function F1(i){var e=C.useRef(i);e.current=i;var t=C.useCallback(function(){for(var n,r=arguments.length,o=new Array(r),s=0;s1&&(_.motionAppear=!1);var y=_.onVisibleChanged;return _.onVisibleChanged=function(S){return!h.current&&!S&&v(!0),y==null?void 0:y(S)},p?null:C.createElement(dk,{mode:o,locked:!h.current},C.createElement(fd,St({visible:m},_,{forceRender:l,removeOnLeave:!1,leavedClassName:"".concat(a,"-hidden")}),function(S){var L=S.className,E=S.style;return C.createElement(gQ,{id:e,className:L,style:E},r)}))}var rwt=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],owt=["active"],swt=function(e){var t,n=e.style,r=e.className,o=e.title,s=e.eventKey;e.warnKey;var a=e.disabled,l=e.internalPopupClose,c=e.children,u=e.itemIcon,d=e.expandIcon,h=e.popupClassName,f=e.popupOffset,g=e.onClick,p=e.onMouseEnter,v=e.onMouseLeave,m=e.onTitleClick,_=e.onTitleMouseEnter,y=e.onTitleMouseLeave,S=Nn(e,rwt),L=qxe(s),E=C.useContext(Ch),D=E.prefixCls,k=E.mode,T=E.openKeys,M=E.disabled,A=E.overflowDisabled,N=E.activeKey,R=E.selectedKeys,F=E.itemIcon,W=E.expandIcon,H=E.onItemClick,G=E.onOpenChange,U=E.onActive,K=C.useContext(hQ),re=K._internalRenderSubMenuItem,Y=C.useContext(Zxe),J=Y.isSubPathKey,Q=ex(),ue="".concat(D,"-submenu"),de=M||a,_e=C.useRef(),ve=C.useRef(),Ve=u||F,Ze=d||W,We=T.includes(s),pe=!A&&We,Pe=J(R,s),Se=eLe(s,de,_,y),Ne=Se.active,Me=Nn(Se,owt),Qe=C.useState(!1),Ke=Ae(Qe,2),Re=Ke[0],ct=Ke[1],ie=function(tt){de||ct(tt)},le=function(tt){ie(!0),p==null||p({key:s,domEvent:tt})},ce=function(tt){ie(!1),v==null||v({key:s,domEvent:tt})},z=C.useMemo(function(){return Ne||(k!=="inline"?Re||J([N],s):!1)},[k,Ne,N,Re,s,J]),q=tLe(Q.length),oe=function(tt){de||(m==null||m({key:s,domEvent:tt}),k==="inline"&&G(s,!We))},ne=F1(function(at){g==null||g(eF(at)),H(at)}),he=function(tt){k!=="inline"&&G(s,tt)},Le=function(){U(s)},Fe=L&&"".concat(L,"-popup"),ze=C.createElement("div",St({role:"menuitem",style:q,className:"".concat(ue,"-title"),tabIndex:de?null:-1,ref:_e,title:typeof o=="string"?o:null,"data-menu-id":A&&L?null:L,"aria-expanded":pe,"aria-haspopup":!0,"aria-controls":Fe,"aria-disabled":de,onClick:oe,onFocus:Le},Me),o,C.createElement(nLe,{icon:k!=="horizontal"?Ze:null,props:te(te({},e),{},{isOpen:pe,isSubMenu:!0})},C.createElement("i",{className:"".concat(ue,"-arrow")}))),Ue=C.useRef(k);if(k!=="inline"&&Q.length>1?Ue.current="vertical":Ue.current=k,!A){var nt=Ue.current;ze=C.createElement(nwt,{mode:nt,prefixCls:ue,visible:!l&&pe&&k!=="inline",popupClassName:h,popupOffset:f,popup:C.createElement(dk,{mode:nt==="horizontal"?"vertical":nt},C.createElement(gQ,{id:Fe,ref:ve},c)),disabled:de,onVisibleChange:he},ze)}var it=C.createElement(Of.Item,St({role:"none"},S,{component:"li",style:n,className:xe(ue,"".concat(ue,"-").concat(k),r,(t={},be(t,"".concat(ue,"-open"),pe),be(t,"".concat(ue,"-active"),z),be(t,"".concat(ue,"-selected"),Pe),be(t,"".concat(ue,"-disabled"),de),t)),onMouseEnter:le,onMouseLeave:ce}),ze,!A&&C.createElement(iwt,{id:Fe,open:pe,keyPath:Q},c));return re&&(it=re(it,e,{selected:Pe,active:z,open:pe,disabled:de})),C.createElement(dk,{onItemClick:ne,mode:k==="horizontal"?"vertical":k,itemIcon:Ve,expandIcon:Ze},it)};function V5(i){var e=i.eventKey,t=i.children,n=ex(e),r=pQ(t,n),o=$5();C.useEffect(function(){if(o)return o.registerPath(e,n),function(){o.unregisterPath(e,n)}},[n]);var s;return o?s=r:s=C.createElement(swt,i,r),C.createElement(Yxe.Provider,{value:n},s)}var awt=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem"],x1=[],lwt=C.forwardRef(function(i,e){var t,n,r=i,o=r.prefixCls,s=o===void 0?"rc-menu":o,a=r.rootClassName,l=r.style,c=r.className,u=r.tabIndex,d=u===void 0?0:u,h=r.items,f=r.children,g=r.direction,p=r.id,v=r.mode,m=v===void 0?"vertical":v,_=r.inlineCollapsed,y=r.disabled,S=r.disabledOverflow,L=r.subMenuOpenDelay,E=L===void 0?.1:L,D=r.subMenuCloseDelay,k=D===void 0?.1:D,T=r.forceSubMenuRender,M=r.defaultOpenKeys,A=r.openKeys,N=r.activeKey,R=r.defaultActiveFirst,F=r.selectable,W=F===void 0?!0:F,H=r.multiple,G=H===void 0?!1:H,U=r.defaultSelectedKeys,K=r.selectedKeys,re=r.onSelect,Y=r.onDeselect,J=r.inlineIndent,Q=J===void 0?24:J,ue=r.motion,de=r.defaultMotions,_e=r.triggerSubMenuAction,ve=_e===void 0?"hover":_e,Ve=r.builtinPlacements,Ze=r.itemIcon,We=r.expandIcon,pe=r.overflowedIndicator,Pe=pe===void 0?"...":pe,Se=r.overflowedIndicatorPopupClassName,Ne=r.getPopupContainer,Me=r.onClick,Qe=r.onOpenChange,Ke=r.onKeyDown;r.openAnimation,r.openTransitionName;var Re=r._internalRenderMenuItem,ct=r._internalRenderSubMenuItem,ie=Nn(r,awt),le=C.useMemo(function(){return Qyt(f,h,x1)},[f,h]),ce=C.useState(!1),z=Ae(ce,2),q=z[0],oe=z[1],ne=C.useRef(),he=Hyt(p),Le=g==="rtl",Fe=Ja(M,{value:A,postState:function(Ft){return Ft||x1}}),ze=Ae(Fe,2),Ue=ze[0],nt=ze[1],it=function(Ft){var Pn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function Xt(){nt(Ft),Qe==null||Qe(Ft)}Pn?sh.flushSync(Xt):Xt()},at=C.useState(Ue),tt=Ae(at,2),Zt=tt[0],Tt=tt[1],xn=C.useRef(!1),rt=C.useMemo(function(){return(m==="inline"||m==="vertical")&&_?["vertical",_]:[m,!1]},[m,_]),wt=Ae(rt,2),Bt=wt[0],Nt=wt[1],nn=Bt==="inline",Mn=C.useState(Bt),zt=Ae(Mn,2),Qt=zt[0],lt=zt[1],ut=C.useState(Nt),dt=Ae(ut,2),Mt=dt[0],Kt=dt[1];C.useEffect(function(){lt(Bt),Kt(Nt),xn.current&&(nn?nt(Zt):it(x1))},[Bt,Nt]);var mn=C.useState(0),lr=Ae(mn,2),nr=lr[0],Hr=lr[1],Jn=nr>=le.length-1||Qt!=="horizontal"||S;C.useEffect(function(){nn&&Tt(Ue)},[Ue]),C.useEffect(function(){return xn.current=!0,function(){xn.current=!1}},[]);var Ii=Wyt(),_o=Ii.registerPath,No=Ii.unregisterPath,bs=Ii.refreshOverflowKeys,Cs=Ii.isSubPathKey,$t=Ii.getKeyPath,we=Ii.getKeys,bt=Ii.getSubPathKeys,xt=C.useMemo(function(){return{registerPath:_o,unregisterPath:No}},[_o,No]),Gn=C.useMemo(function(){return{isSubPathKey:Cs}},[Cs]);C.useEffect(function(){bs(Jn?x1:le.slice(nr+1).map(function(qt){return qt.key}))},[nr,Jn]);var cr=Ja(N||R&&((t=le[0])===null||t===void 0?void 0:t.key),{value:N}),Vr=Ae(cr,2),ei=Vr[0],Qr=Vr[1],Fs=F1(function(qt){Qr(qt)}),Fl=F1(function(){Qr(void 0)});C.useImperativeHandle(e,function(){return{list:ne.current,focus:function(Ft){var Pn,Xt=ei??((Pn=le.find(function(Co){return!Co.props.disabled}))===null||Pn===void 0?void 0:Pn.key);if(Xt){var Gt,oi,Fi;(Gt=ne.current)===null||Gt===void 0||(oi=Gt.querySelector("li[data-menu-id='".concat(dQ(he,Xt),"']")))===null||oi===void 0||(Fi=oi.focus)===null||Fi===void 0||Fi.call(oi,Ft)}}}});var Aa=Ja(U||[],{value:K,postState:function(Ft){return Array.isArray(Ft)?Ft:Ft==null?x1:[Ft]}}),zo=Ae(Aa,2),bo=zo[0],Pa=zo[1],Oa=function(Ft){if(W){var Pn=Ft.key,Xt=bo.includes(Pn),Gt;G?Xt?Gt=bo.filter(function(Fi){return Fi!==Pn}):Gt=[].concat(ft(bo),[Pn]):Gt=[Pn],Pa(Gt);var oi=te(te({},Ft),{},{selectedKeys:Gt});Xt?Y==null||Y(oi):re==null||re(oi)}!G&&Ue.length&&Qt!=="inline"&&it(x1)},Bl=F1(function(qt){Me==null||Me(eF(qt)),Oa(qt)}),cl=F1(function(qt,Ft){var Pn=Ue.filter(function(Gt){return Gt!==qt});if(Ft)Pn.push(qt);else if(Qt!=="inline"){var Xt=bt(qt);Pn=Pn.filter(function(Gt){return!Xt.has(Gt)})}Pp(Ue,Pn,!0)||it(Pn,!0)}),Wl=F1(Ne),_u=function(Ft,Pn){var Xt=Pn??!Ue.includes(Ft);cl(Ft,Xt)},bu=Oyt(Qt,ei,Le,he,ne,we,$t,Qr,_u,Ke);C.useEffect(function(){oe(!0)},[]);var xc=C.useMemo(function(){return{_internalRenderMenuItem:Re,_internalRenderSubMenuItem:ct}},[Re,ct]),Fa=Qt!=="horizontal"||S?le:le.map(function(qt,Ft){return C.createElement(dk,{key:qt.key,overflowDisabled:Ft>nr},qt)}),Ba=C.createElement(Of,St({id:p,ref:ne,prefixCls:"".concat(s,"-overflow"),component:"ul",itemComponent:H5,className:xe(s,"".concat(s,"-root"),"".concat(s,"-").concat(Qt),c,(n={},be(n,"".concat(s,"-inline-collapsed"),Mt),be(n,"".concat(s,"-rtl"),Le),n),a),dir:g,style:l,role:"menu",tabIndex:d,data:Fa,renderRawItem:function(Ft){return Ft},renderRawRest:function(Ft){var Pn=Ft.length,Xt=Pn?le.slice(-Pn):null;return C.createElement(V5,{eventKey:_K,title:Pe,disabled:Jn,internalPopupClose:Pn===0,popupClassName:Se},Xt)},maxCount:Qt!=="horizontal"||S?Of.INVALIDATE:Of.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(Ft){Hr(Ft)},onKeyDown:bu},ie));return C.createElement(hQ.Provider,{value:xc},C.createElement(Gxe.Provider,{value:he},C.createElement(dk,{prefixCls:s,rootClassName:a,mode:Qt,openKeys:Ue,rtl:Le,disabled:y,motion:q?ue:null,defaultMotions:q?de:null,activeKey:ei,onActive:Fs,onInactive:Fl,selectedKeys:bo,inlineIndent:Q,subMenuOpenDelay:E,subMenuCloseDelay:k,forceSubMenuRender:T,builtinPlacements:Ve,triggerSubMenuAction:ve,getPopupContainer:Wl,itemIcon:Ze,expandIcon:We,onItemClick:Bl,onOpenChange:cl},C.createElement(Zxe.Provider,{value:Gn},Ba),C.createElement("div",{style:{display:"none"},"aria-hidden":!0},C.createElement(Xxe.Provider,{value:xt},le)))))}),cwt=["className","title","eventKey","children"],uwt=["children"],dwt=function(e){var t=e.className,n=e.title;e.eventKey;var r=e.children,o=Nn(e,cwt),s=C.useContext(Ch),a=s.prefixCls,l="".concat(a,"-item-group");return C.createElement("li",St({role:"presentation"},o,{onClick:function(u){return u.stopPropagation()},className:xe(l,t)}),C.createElement("div",{role:"presentation",className:"".concat(l,"-title"),title:typeof n=="string"?n:void 0},n),C.createElement("ul",{role:"group",className:"".concat(l,"-list")},r))};function z5(i){var e=i.children,t=Nn(i,uwt),n=ex(t.eventKey),r=pQ(e,n),o=$5();return o?r:C.createElement(dwt,ll(t,["warnKey"]),r)}function mQ(i){var e=i.className,t=i.style,n=C.useContext(Ch),r=n.prefixCls,o=$5();return o?null:C.createElement("li",{className:xe("".concat(r,"-item-divider"),e),style:t})}var MT=lwt;MT.Item=H5;MT.SubMenu=V5;MT.ItemGroup=z5;MT.Divider=mQ;const hwt=i=>{const{componentCls:e,motionDurationSlow:t,menuHorizontalHeight:n,colorSplit:r,lineWidth:o,lineType:s,menuItemPaddingInline:a}=i;return{[`${e}-horizontal`]:{lineHeight:`${n}px`,border:0,borderBottom:`${o}px ${s} ${r}`,boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},[`${e}-item, ${e}-submenu`]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:a},[`> ${e}-item:hover, + `]:{paddingInlineEnd:i.fontSize*1.5}}}},w7(Oi(i,{controlHeight:i.controlHeightLG,fontSize:i.fontSizeLG,borderRadius:i.borderRadiusLG}),"lg")]}const MCt=i=>{const{componentCls:e}=i;return{position:"relative",backgroundColor:i.colorBgContainer,border:`${i.lineWidth}px ${i.lineType} ${i.colorBorder}`,transition:`all ${i.motionDurationMid} ${i.motionEaseInOut}`,input:{cursor:"pointer"},[`${e}-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit"}},[`${e}-disabled&`]:{color:i.colorTextDisabled,background:i.colorBgContainerDisabled,cursor:"not-allowed",[`${e}-multiple&`]:{background:i.colorBgContainerDisabled},input:{cursor:"not-allowed"}}}},S7=function(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const{componentCls:n,borderHoverColor:r,outlineColor:o,antCls:s}=e,a=t?{[`${n}-selector`]:{borderColor:r}}:{};return{[i]:{[`&:not(${n}-disabled):not(${n}-customize-input):not(${s}-pagination-size-changer)`]:Object.assign(Object.assign({},a),{[`${n}-focused& ${n}-selector`]:{borderColor:r,boxShadow:`0 0 0 ${e.controlOutlineWidth}px ${o}`,outline:0},[`&:hover ${n}-selector`]:{borderColor:r}})}}},ACt=i=>{const{componentCls:e}=i;return{[`${e}-selection-search-input`]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none","&::-webkit-search-cancel-button":{display:"none","-webkit-appearance":"none"}}}},PCt=i=>{const{componentCls:e,inputPaddingHorizontalBase:t,iconCls:n}=i;return{[e]:Object.assign(Object.assign({},Wr(i)),{position:"relative",display:"inline-block",cursor:"pointer",[`&:not(${e}-customize-input) ${e}-selector`]:Object.assign(Object.assign({},MCt(i)),ACt(i)),[`${e}-selection-item`]:Object.assign(Object.assign({flex:1,fontWeight:"normal"},pb),{"> *":Object.assign({lineHeight:"inherit"},pb)}),[`${e}-selection-placeholder`]:Object.assign(Object.assign({},pb),{flex:1,color:i.colorTextPlaceholder,pointerEvents:"none"}),[`${e}-arrow`]:Object.assign(Object.assign({},xT()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:t,height:i.fontSizeIcon,marginTop:-i.fontSizeIcon/2,color:i.colorTextQuaternary,fontSize:i.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",[n]:{verticalAlign:"top",transition:`transform ${i.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${e}-suffix)`]:{pointerEvents:"auto"}},[`${e}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${e}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:t,zIndex:1,display:"inline-block",width:i.fontSizeIcon,height:i.fontSizeIcon,marginTop:-i.fontSizeIcon/2,color:i.colorTextQuaternary,fontSize:i.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",background:i.colorBgContainer,cursor:"pointer",opacity:0,transition:`color ${i.motionDurationMid} ease, opacity ${i.motionDurationSlow} ease`,textRendering:"auto","&:before":{display:"block"},"&:hover":{color:i.colorTextTertiary}},"&:hover":{[`${e}-clear`]:{opacity:1}}}),[`${e}-has-feedback`]:{[`${e}-clear`]:{insetInlineEnd:t+i.fontSize+i.paddingXXS}}}},OCt=i=>{const{componentCls:e}=i;return[{[e]:{[`&-borderless ${e}-selector`]:{backgroundColor:"transparent !important",borderColor:"transparent !important",boxShadow:"none !important"},[`&${e}-in-form-item`]:{width:"100%"}}},PCt(i),RCt(i),NCt(i),TCt(i),{[`${e}-rtl`]:{direction:"rtl"}},S7(e,Oi(i,{borderHoverColor:i.colorPrimaryHover,outlineColor:i.controlOutline})),S7(`${e}-status-error`,Oi(i,{borderHoverColor:i.colorErrorHover,outlineColor:i.colorErrorOutline}),!0),S7(`${e}-status-warning`,Oi(i,{borderHoverColor:i.colorWarningHover,outlineColor:i.colorWarningOutline}),!0),M5(i,{borderElCls:`${e}-selector`,focusElCls:`${e}-focused`})]},FCt=vo("Select",(i,e)=>{let{rootPrefixCls:t}=e;const n=Oi(i,{rootPrefixCls:t,inputPaddingHorizontalBase:i.paddingSM-1});return[OCt(n)]},i=>({zIndexPopup:i.zIndexPopupBase+50})),R2={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:"visible"},BCt={bottomLeft:Object.assign(Object.assign({},R2),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},R2),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},R2),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},R2),{points:["br","tr"],offset:[0,-4]})};function WCt(i){return i||BCt}function $Ct(i){return i??!0}function HCt(i){let{suffixIcon:e,clearIcon:t,menuItemSelectedIcon:n,removeIcon:r,loading:o,multiple:s,hasFeedback:a,prefixCls:l,showArrow:c,feedbackIcon:u}=i;const d=t??C.createElement(XS,null),h=v=>C.createElement(C.Fragment,null,c!==!1&&v,a&&u);let f=null;if(e!==void 0)f=h(e);else if(o)f=h(C.createElement(ek,{spin:!0}));else{const v=`${l}-suffix`;f=m=>{let{open:_,showSearch:y}=m;return h(_&&y?C.createElement(IZ,{className:v}):C.createElement(DZ,{className:v}))}}let g=null;n!==void 0?g=n:s?g=C.createElement($ye,null):g=null;let p=null;return r!==void 0?p=r:p=C.createElement(CT,null),{clearIcon:d,suffixIcon:f,itemIcon:g,removeIcon:p}}var VCt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var{prefixCls:t,bordered:n=!0,className:r,rootClassName:o,getPopupContainer:s,popupClassName:a,dropdownClassName:l,listHeight:c=256,placement:u,listItemHeight:d=24,size:h,disabled:f,notFoundContent:g,status:p,showArrow:v,builtinPlacements:m}=i,_=VCt(i,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","showArrow","builtinPlacements"]);const{getPopupContainer:y,getPrefixCls:S,renderEmpty:L,direction:E,virtual:D,dropdownMatchSelectWidth:k,select:T}=C.useContext(Rn),M=C.useContext(Rh),A=S("select",t),N=S(),{compactSize:R,compactItemClassnames:F}=QS(A,E),[W,H]=FCt(A),G=C.useMemo(()=>{const{mode:Re}=_;if(Re!=="combobox")return Re===_xe?"combobox":Re},[_.mode]),U=G==="multiple"||G==="tags",K=$Ct(v),{status:re,hasFeedback:Y,isFormItemInput:J,feedbackIcon:Q}=C.useContext(Zf),ue=O5(re,p);let de;g!==void 0?de=g:G==="combobox"?de=null:de=(L==null?void 0:L("Select"))||C.createElement(nQ,{componentName:"Select"});const{suffixIcon:_e,itemIcon:ve,removeIcon:Ve,clearIcon:Ze}=HCt(Object.assign(Object.assign({},_),{multiple:U,hasFeedback:Y,feedbackIcon:Q,showArrow:K,prefixCls:A})),We=ll(_,["suffixIcon","itemIcon"]),pe=xe(a||l,{[`${A}-dropdown-${E}`]:E==="rtl"},o,H),Pe=R||h||M,Se=C.useContext($_),Ne=f??Se,Me=xe({[`${A}-lg`]:Pe==="large",[`${A}-sm`]:Pe==="small",[`${A}-rtl`]:E==="rtl",[`${A}-borderless`]:!n,[`${A}-in-form-item`]:J},Cp(A,ue,Y),F,r,o,H),Qe=C.useMemo(()=>u!==void 0?u:E==="rtl"?"bottomRight":"bottomLeft",[u,E]),Ke=WCt(m);return W(C.createElement(eQ,Object.assign({ref:e,virtual:D,dropdownMatchSelectWidth:k,showSearch:T==null?void 0:T.showSearch},We,{builtinPlacements:Ke,transitionName:nC(N,P_t(u),_.transitionName),listHeight:c,listItemHeight:d,mode:G,prefixCls:A,placement:Qe,direction:E,inputIcon:_e,menuItemSelectedIcon:ve,removeIcon:Ve,clearIcon:Ze,notFoundContent:de,className:Me,getPopupContainer:s||y,dropdownClassName:pe,showArrow:Y||K,disabled:Ne})))},JS=C.forwardRef(zCt),UCt=gxe(JS);JS.SECRET_COMBOBOX_MODE_DO_NOT_USE=_xe;JS.Option=QZ;JS.OptGroup=ZZ;JS._InternalPanelDoNotUseOrYouWillBeFired=UCt;const F5=JS;function bxe(){const[,i]=C.useReducer(e=>e+1,0);return i}const m_=["xxl","xl","lg","md","sm","xs"],jCt=i=>({xs:`(max-width: ${i.screenXSMax}px)`,sm:`(min-width: ${i.screenSM}px)`,md:`(min-width: ${i.screenMD}px)`,lg:`(min-width: ${i.screenLG}px)`,xl:`(min-width: ${i.screenXL}px)`,xxl:`(min-width: ${i.screenXXL}px)`}),KCt=i=>{const e=i,t=[].concat(m_).reverse();return t.forEach((n,r)=>{const o=n.toUpperCase(),s=`screen${o}Min`,a=`screen${o}`;if(!(e[s]<=e[a]))throw new Error(`${s}<=${a} fails : !(${e[s]}<=${e[a]})`);if(r{const t=new Map;let n=-1,r={};return{matchHandlers:{},dispatch(o){return r=o,t.forEach(s=>s(r)),t.size>=1},subscribe(o){return t.size||this.register(),n+=1,t.set(n,o),o(r),n},unsubscribe(o){t.delete(o),t.size||this.unregister()},unregister(){Object.keys(e).forEach(o=>{const s=e[o],a=this.matchHandlers[s];a==null||a.mql.removeListener(a==null?void 0:a.listener)}),t.clear()},register(){Object.keys(e).forEach(o=>{const s=e[o],a=c=>{let{matches:u}=c;this.dispatch(Object.assign(Object.assign({},r),{[o]:u}))},l=window.matchMedia(s);l.addListener(a),this.matchHandlers[s]={mql:l,listener:a},a(l)})},responsiveMap:e}},[i])}function B5(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;const e=C.useRef({}),t=bxe(),n=Cxe();return C.useEffect(()=>{const r=n.subscribe(o=>{e.current=o,i&&t()});return()=>n.unsubscribe(r)},[]),e.current}const uK=C.createContext("default"),hue=i=>{let{children:e,size:t}=i;const n=C.useContext(uK);return C.createElement(uK.Provider,{value:t||n},e)},GCt=i=>{const{antCls:e,componentCls:t,iconCls:n,avatarBg:r,avatarColor:o,avatarSizeBase:s,avatarSizeLG:a,avatarSizeSM:l,avatarFontSizeBase:c,avatarFontSizeLG:u,avatarFontSizeSM:d,borderRadius:h,borderRadiusLG:f,borderRadiusSM:g,lineWidth:p,lineType:v}=i,m=(_,y,S)=>({width:_,height:_,lineHeight:`${_-p*2}px`,borderRadius:"50%",[`&${t}-square`]:{borderRadius:S},[`${t}-string`]:{position:"absolute",left:{_skip_check_:!0,value:"50%"},transformOrigin:"0 center"},[`&${t}-icon`]:{fontSize:y,[`> ${n}`]:{margin:0}}});return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},Wr(i)),{position:"relative",display:"inline-block",overflow:"hidden",color:o,whiteSpace:"nowrap",textAlign:"center",verticalAlign:"middle",background:r,border:`${p}px ${v} transparent`,["&-image"]:{background:"transparent"},[`${e}-image-img`]:{display:"block"}}),m(s,c,h)),{["&-lg"]:Object.assign({},m(a,u,f)),["&-sm"]:Object.assign({},m(l,d,g)),"> img":{display:"block",width:"100%",height:"100%",objectFit:"cover"}})}},qCt=i=>{const{componentCls:e,avatarGroupBorderColor:t,avatarGroupSpace:n}=i;return{[`${e}-group`]:{display:"inline-flex",[`${e}`]:{borderColor:t},["> *:not(:first-child)"]:{marginInlineStart:n}}}},yxe=vo("Avatar",i=>{const{colorTextLightSolid:e,controlHeight:t,controlHeightLG:n,controlHeightSM:r,fontSize:o,fontSizeLG:s,fontSizeXL:a,fontSizeHeading3:l,marginXS:c,colorBorderBg:u,colorTextPlaceholder:d}=i,h=Oi(i,{avatarBg:d,avatarColor:e,avatarSizeBase:t,avatarSizeLG:n,avatarSizeSM:r,avatarFontSizeBase:Math.round((s+a)/2),avatarFontSizeLG:l,avatarFontSizeSM:o,avatarGroupSpace:-c,avatarGroupBorderColor:u});return[GCt(h),qCt(h)]});var XCt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const t=C.useContext(uK),[n,r]=C.useState(1),[o,s]=C.useState(!1),[a,l]=C.useState(!0),c=C.useRef(null),u=C.useRef(null),d=vu(e,c),{getPrefixCls:h}=C.useContext(Rn),f=()=>{if(!u.current||!c.current)return;const ue=u.current.offsetWidth,de=c.current.offsetWidth;if(ue!==0&&de!==0){const{gap:_e=4}=i;_e*2{s(!0)},[]),C.useEffect(()=>{l(!0),r(1)},[i.src]),C.useEffect(()=>{f()},[i.gap]);const g=()=>{const{onError:ue}=i;(ue?ue():void 0)!==!1&&l(!1)},{prefixCls:p,shape:v="circle",size:m="default",src:_,srcSet:y,icon:S,className:L,rootClassName:E,alt:D,draggable:k,children:T,crossOrigin:M}=i,A=XCt(i,["prefixCls","shape","size","src","srcSet","icon","className","rootClassName","alt","draggable","children","crossOrigin"]),N=m==="default"?t:m,R=Object.keys(typeof N=="object"?N||{}:{}).some(ue=>["xs","sm","md","lg","xl","xxl"].includes(ue)),F=B5(R),W=C.useMemo(()=>{if(typeof N!="object")return{};const ue=m_.find(_e=>F[_e]),de=N[ue];return de?{width:de,height:de,lineHeight:`${de}px`,fontSize:S?de/2:18}:{}},[F,N]),H=h("avatar",p),[G,U]=yxe(H),K=xe({[`${H}-lg`]:N==="large",[`${H}-sm`]:N==="small"}),re=C.isValidElement(_),Y=xe(H,K,{[`${H}-${v}`]:!!v,[`${H}-image`]:re||_&&a,[`${H}-icon`]:!!S},L,E,U),J=typeof N=="number"?{width:N,height:N,lineHeight:`${N}px`,fontSize:S?N/2:18}:{};let Q;if(typeof _=="string"&&a)Q=C.createElement("img",{src:_,draggable:k,srcSet:y,onError:g,alt:D,crossOrigin:M});else if(re)Q=_;else if(S)Q=S;else if(o||n!==1){const ue=`scale(${n}) translateX(-50%)`,de={msTransform:ue,WebkitTransform:ue,transform:ue},_e=typeof N=="number"?{lineHeight:`${N}px`}:{};Q=C.createElement(Nh,{onResize:f},C.createElement("span",{className:`${H}-string`,ref:u,style:Object.assign(Object.assign({},_e),de)},T))}else Q=C.createElement("span",{className:`${H}-string`,style:{opacity:0},ref:u},T);return delete A.onError,delete A.gap,G(C.createElement("span",Object.assign({},A,{style:Object.assign(Object.assign(Object.assign({},J),W),A.style),className:Y,ref:d}),Q))},ZCt=C.forwardRef(YCt),wxe=ZCt;var b1={shiftX:64,adjustY:1},C1={adjustX:1,shiftY:!0},Tu=[0,0],QCt={left:{points:["cr","cl"],overflow:C1,offset:[-4,0],targetOffset:Tu},right:{points:["cl","cr"],overflow:C1,offset:[4,0],targetOffset:Tu},top:{points:["bc","tc"],overflow:b1,offset:[0,-4],targetOffset:Tu},bottom:{points:["tc","bc"],overflow:b1,offset:[0,4],targetOffset:Tu},topLeft:{points:["bl","tl"],overflow:b1,offset:[0,-4],targetOffset:Tu},leftTop:{points:["tr","tl"],overflow:C1,offset:[-4,0],targetOffset:Tu},topRight:{points:["br","tr"],overflow:b1,offset:[0,-4],targetOffset:Tu},rightTop:{points:["tl","tr"],overflow:C1,offset:[4,0],targetOffset:Tu},bottomRight:{points:["tr","br"],overflow:b1,offset:[0,4],targetOffset:Tu},rightBottom:{points:["bl","br"],overflow:C1,offset:[4,0],targetOffset:Tu},bottomLeft:{points:["tl","bl"],overflow:b1,offset:[0,4],targetOffset:Tu},leftBottom:{points:["br","bl"],overflow:C1,offset:[-4,0],targetOffset:Tu}};function iQ(i){var e=i.children,t=i.prefixCls,n=i.id,r=i.overlayInnerStyle,o=i.className,s=i.style;return C.createElement("div",{className:xe("".concat(t,"-content"),o),style:s},C.createElement("div",{className:"".concat(t,"-inner"),id:n,role:"tooltip",style:r},typeof e=="function"?e():e))}var JCt=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"],e1t=function(e,t){var n=e.overlayClassName,r=e.trigger,o=r===void 0?["hover"]:r,s=e.mouseEnterDelay,a=s===void 0?0:s,l=e.mouseLeaveDelay,c=l===void 0?.1:l,u=e.overlayStyle,d=e.prefixCls,h=d===void 0?"rc-tooltip":d,f=e.children,g=e.onVisibleChange,p=e.afterVisibleChange,v=e.transitionName,m=e.animation,_=e.motion,y=e.placement,S=y===void 0?"right":y,L=e.align,E=L===void 0?{}:L,D=e.destroyTooltipOnHide,k=D===void 0?!1:D,T=e.defaultVisible,M=e.getTooltipContainer,A=e.overlayInnerStyle;e.arrowContent;var N=e.overlay,R=e.id,F=e.showArrow,W=F===void 0?!0:F,H=Nn(e,JCt),G=C.useRef(null);C.useImperativeHandle(t,function(){return G.current});var U=te({},H);"visible"in e&&(U.popupVisible=e.visible);var K=function(){return C.createElement(iQ,{key:"content",prefixCls:h,id:R,overlayInnerStyle:A},N)};return C.createElement(sxe,St({popupClassName:n,prefixCls:h,popup:K,action:o,builtinPlacements:QCt,popupPlacement:S,ref:G,popupAlign:E,getPopupContainer:M,onPopupVisibleChange:g,afterPopupVisibleChange:p,popupTransitionName:v,popupAnimation:m,popupMotion:_,defaultPopupVisible:T,autoDestroy:k,mouseLeaveDelay:c,popupStyle:u,mouseEnterDelay:a,arrow:W},U),f)};const t1t=C.forwardRef(e1t),Sxe=8;function rQ(i){const e=Sxe,{contentRadius:t,limitVerticalRadius:n}=i,r=t>12?t+2:12;return{dropdownArrowOffset:r,dropdownArrowOffsetVertical:n?e:r}}function M2(i,e){return i?e:{}}function oQ(i,e){const{componentCls:t,sizePopupArrow:n,borderRadiusXS:r,borderRadiusOuter:o,boxShadowPopoverArrow:s}=i,{colorBg:a,contentRadius:l=i.borderRadiusLG,limitVerticalRadius:c,arrowDistance:u=0,arrowPlacement:d={left:!0,right:!0,top:!0,bottom:!0}}=e,{dropdownArrowOffsetVertical:h,dropdownArrowOffset:f}=rQ({contentRadius:l,limitVerticalRadius:c});return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({[`${t}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},wmt(n,r,o,a,s)),{"&:before":{background:a}})]},M2(!!d.top,{[[`&-placement-top ${t}-arrow`,`&-placement-topLeft ${t}-arrow`,`&-placement-topRight ${t}-arrow`].join(",")]:{bottom:u,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top ${t}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},[`&-placement-topLeft ${t}-arrow`]:{left:{_skip_check_:!0,value:f}},[`&-placement-topRight ${t}-arrow`]:{right:{_skip_check_:!0,value:f}}})),M2(!!d.bottom,{[[`&-placement-bottom ${t}-arrow`,`&-placement-bottomLeft ${t}-arrow`,`&-placement-bottomRight ${t}-arrow`].join(",")]:{top:u,transform:"translateY(-100%)"},[`&-placement-bottom ${t}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},[`&-placement-bottomLeft ${t}-arrow`]:{left:{_skip_check_:!0,value:f}},[`&-placement-bottomRight ${t}-arrow`]:{right:{_skip_check_:!0,value:f}}})),M2(!!d.left,{[[`&-placement-left ${t}-arrow`,`&-placement-leftTop ${t}-arrow`,`&-placement-leftBottom ${t}-arrow`].join(",")]:{right:{_skip_check_:!0,value:u},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left ${t}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop ${t}-arrow`]:{top:h},[`&-placement-leftBottom ${t}-arrow`]:{bottom:h}})),M2(!!d.right,{[[`&-placement-right ${t}-arrow`,`&-placement-rightTop ${t}-arrow`,`&-placement-rightBottom ${t}-arrow`].join(",")]:{left:{_skip_check_:!0,value:u},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right ${t}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop ${t}-arrow`]:{top:h},[`&-placement-rightBottom ${t}-arrow`]:{bottom:h}}))}}function n1t(i,e,t,n){if(n===!1)return{adjustX:!1,adjustY:!1};const r=n&&typeof n=="object"?n:{},o={};switch(i){case"top":case"bottom":o.shiftX=e.dropdownArrowOffset*2+t;break;case"left":case"right":o.shiftY=e.dropdownArrowOffsetVertical*2+t;break}const s=Object.assign(Object.assign({},o),r);return s.shiftX||(s.adjustX=!0),s.shiftY||(s.adjustY=!0),s}const fue={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},i1t={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},r1t=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function xxe(i){const{arrowWidth:e,autoAdjustOverflow:t,arrowPointAtCenter:n,offset:r,borderRadius:o}=i,s=e/2,a={};return Object.keys(fue).forEach(l=>{const c=n&&i1t[l]||fue[l],u=Object.assign(Object.assign({},c),{offset:[0,0]});switch(a[l]=u,r1t.has(l)&&(u.autoArrow=!1),l){case"top":case"topLeft":case"topRight":u.offset[1]=-s-r;break;case"bottom":case"bottomLeft":case"bottomRight":u.offset[1]=s+r;break;case"left":case"leftTop":case"leftBottom":u.offset[0]=-s-r;break;case"right":case"rightTop":case"rightBottom":u.offset[0]=s+r;break}const d=rQ({contentRadius:o,limitVerticalRadius:!0});if(n)switch(l){case"topLeft":case"bottomLeft":u.offset[0]=-d.dropdownArrowOffset-s;break;case"topRight":case"bottomRight":u.offset[0]=d.dropdownArrowOffset+s;break;case"leftTop":case"rightTop":u.offset[1]=-d.dropdownArrowOffset-s;break;case"leftBottom":case"rightBottom":u.offset[1]=d.dropdownArrowOffset+s;break}u.overflow=n1t(l,d,e,t)}),a}const fm=(i,e)=>new Yr(i).setAlpha(e).toRgbString(),y1=(i,e)=>new Yr(i).lighten(e).toHexString(),o1t=i=>{const e=Pp(i,{theme:"dark"});return{1:e[0],2:e[1],3:e[2],4:e[3],5:e[6],6:e[5],7:e[4],8:e[6],9:e[5],10:e[4]}},s1t=(i,e)=>{const t=i||"#000",n=e||"#fff";return{colorBgBase:t,colorTextBase:n,colorText:fm(n,.85),colorTextSecondary:fm(n,.65),colorTextTertiary:fm(n,.45),colorTextQuaternary:fm(n,.25),colorFill:fm(n,.18),colorFillSecondary:fm(n,.12),colorFillTertiary:fm(n,.08),colorFillQuaternary:fm(n,.04),colorBgElevated:y1(t,12),colorBgContainer:y1(t,8),colorBgLayout:y1(t,0),colorBgSpotlight:y1(t,26),colorBorder:y1(t,26),colorBorderSecondary:y1(t,19)}},a1t=(i,e)=>{const t=Object.keys(PZ).map(r=>{const o=Pp(i[r],{theme:"dark"});return new Array(10).fill(1).reduce((s,a,l)=>(s[`${r}-${l+1}`]=o[l],s[`${r}${l+1}`]=o[l],s),{})}).reduce((r,o)=>(r=Object.assign(Object.assign({},r),o),r),{}),n=e??T5(i);return Object.assign(Object.assign(Object.assign({},n),t),nSe(i,{generateColorPalettes:o1t,generateNeutralColorPalettes:s1t}))},l1t=a1t;function c1t(i){const{sizeUnit:e,sizeStep:t}=i,n=t-2;return{sizeXXL:e*(n+10),sizeXL:e*(n+6),sizeLG:e*(n+2),sizeMD:e*(n+2),sizeMS:e*(n+1),size:e*n,sizeSM:e*n,sizeXS:e*(n-1),sizeXXS:e*(n-1)}}const u1t=(i,e)=>{const t=e??T5(i),n=t.fontSizeSM,r=t.controlHeight-4;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t),c1t(e??i)),iSe(n)),{controlHeight:r}),tSe(Object.assign(Object.assign({},t),{controlHeight:r})))},d1t=u1t;function h1t(){const[i,e,t]=DC();return{theme:i,token:e,hashId:t}}const Lxe={defaultConfig:VO,defaultSeed:VO.token,useToken:h1t,defaultAlgorithm:T5,darkAlgorithm:l1t,compactAlgorithm:d1t},f1t=i=>{const{componentCls:e,tooltipMaxWidth:t,tooltipColor:n,tooltipBg:r,tooltipBorderRadius:o,zIndexPopup:s,controlHeight:a,boxShadowSecondary:l,paddingSM:c,paddingXS:u,tooltipRadiusOuter:d}=i;return[{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},Wr(i)),{position:"absolute",zIndex:s,display:"block",width:"max-content",maxWidth:t,visibility:"visible","&-hidden":{display:"none"},"--antd-arrow-background-color":r,[`${e}-inner`]:{minWidth:a,minHeight:a,padding:`${c/2}px ${u}px`,color:n,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:r,borderRadius:o,boxShadow:l},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${e}-inner`]:{borderRadius:Math.min(o,Sxe)}},[`${e}-content`]:{position:"relative"}}),Dmt(i,(h,f)=>{let{darkColor:g}=f;return{[`&${e}-${h}`]:{[`${e}-inner`]:{backgroundColor:g},[`${e}-arrow`]:{"--antd-arrow-background-color":g}}}})),{"&-rtl":{direction:"rtl"}})},oQ(Oi(i,{borderRadiusOuter:d}),{colorBg:"var(--antd-arrow-background-color)",contentRadius:o,limitVerticalRadius:!0}),{[`${e}-pure`]:{position:"relative",maxWidth:"none",margin:i.sizePopupArrow}}]},Exe=(i,e)=>vo("Tooltip",n=>{if(e===!1)return[];const{borderRadius:r,colorTextLightSolid:o,colorBgDefault:s,borderRadiusOuter:a}=n,l=Oi(n,{tooltipMaxWidth:250,tooltipColor:o,tooltipBorderRadius:r,tooltipBg:s,tooltipRadiusOuter:a>4?4:a});return[f1t(l),IT(n,"zoom-big-fast")]},n=>{let{zIndexPopupBase:r,colorBgSpotlight:o}=n;return{zIndexPopup:r+70,colorBgDefault:o}})(i),g1t=sk.map(i=>`${i}-inverse`);function p1t(i){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)?[].concat(ft(g1t),ft(sk)).includes(i):sk.includes(i)}function Dxe(i,e){const t=p1t(e),n=xe({[`${i}-${e}`]:e&&t}),r={},o={};return e&&!t&&(r.background=e,o["--antd-arrow-background-color"]=e),{className:n,overlayStyle:r,arrowStyle:o}}function m1t(i){const{prefixCls:e,className:t,placement:n="top",title:r,color:o,overlayInnerStyle:s}=i,{getPrefixCls:a}=C.useContext(Rn),l=a("tooltip",e),[c,u]=Exe(l,!0),d=Dxe(l,o),h=Object.assign(Object.assign({},s),d.overlayStyle),f=d.arrowStyle;return c(C.createElement("div",{className:xe(u,l,`${l}-pure`,`${l}-placement-${n}`,t,d.className),style:f},C.createElement("div",{className:`${l}-arrow`}),C.createElement(iQ,Object.assign({},i,{className:u,prefixCls:l,overlayInnerStyle:h}),r)))}var v1t=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const t={},n=Object.assign({},i);return e.forEach(r=>{i&&r in i&&(t[r]=i[r],delete n[r])}),{picked:t,omitted:n}};function C1t(i,e){const t=i.type;if((t.__ANT_BUTTON===!0||i.type==="button")&&i.props.disabled||t.__ANT_SWITCH===!0&&(i.props.disabled||i.props.loading)||t.__ANT_RADIO===!0&&i.props.disabled){const{picked:n,omitted:r}=b1t(i.props.style,["position","left","right","top","bottom","float","display","zIndex"]),o=Object.assign(Object.assign({display:"inline-block"},n),{cursor:"not-allowed",width:i.props.block?"100%":void 0}),s=Object.assign(Object.assign({},r),{pointerEvents:"none"}),a=Qs(i,{style:s,className:null});return C.createElement("span",{style:o,className:xe(i.props.className,`${e}-disabled-compatible-wrapper`)},a)}return i}const Ixe=C.forwardRef((i,e)=>{var t,n;const{prefixCls:r,openClassName:o,getTooltipContainer:s,overlayClassName:a,color:l,overlayInnerStyle:c,children:u,afterOpenChange:d,afterVisibleChange:h,destroyTooltipOnHide:f,arrow:g=!0,title:p,overlay:v,builtinPlacements:m,arrowPointAtCenter:_=!1,autoAdjustOverflow:y=!0}=i,S=!!g,{token:L}=_1t(),{getPopupContainer:E,getPrefixCls:D,direction:k}=C.useContext(Rn),T=C.useRef(null),M=()=>{var Re;(Re=T.current)===null||Re===void 0||Re.forceAlign()};C.useImperativeHandle(e,()=>({forceAlign:M,forcePopupAlign:()=>{M()}}));const[A,N]=Ja(!1,{value:(t=i.open)!==null&&t!==void 0?t:i.visible,defaultValue:(n=i.defaultOpen)!==null&&n!==void 0?n:i.defaultVisible}),R=!p&&!v&&p!==0,F=Re=>{var ct,ie;N(R?!1:Re),R||((ct=i.onOpenChange)===null||ct===void 0||ct.call(i,Re),(ie=i.onVisibleChange)===null||ie===void 0||ie.call(i,Re))},W=C.useMemo(()=>{var Re,ct;let ie=_;return typeof g=="object"&&(ie=(ct=(Re=g.pointAtCenter)!==null&&Re!==void 0?Re:g.arrowPointAtCenter)!==null&&ct!==void 0?ct:_),m||xxe({arrowPointAtCenter:ie,autoAdjustOverflow:y,arrowWidth:S?L.sizePopupArrow:0,borderRadius:L.borderRadius,offset:L.marginXXS})},[_,g,m,L]),H=(Re,ct)=>{const ie=Object.keys(W).find(le=>{var ce,z;return W[le].points[0]===((ce=ct.points)===null||ce===void 0?void 0:ce[0])&&W[le].points[1]===((z=ct.points)===null||z===void 0?void 0:z[1])});if(ie){const le=Re.getBoundingClientRect(),ce={top:"50%",left:"50%"};/top|Bottom/.test(ie)?ce.top=`${le.height-ct.offset[1]}px`:/Top|bottom/.test(ie)&&(ce.top=`${-ct.offset[1]}px`),/left|Right/.test(ie)?ce.left=`${le.width-ct.offset[0]}px`:/right|Left/.test(ie)&&(ce.left=`${-ct.offset[0]}px`),Re.style.transformOrigin=`${ce.left} ${ce.top}`}},G=C.useMemo(()=>p===0?p:v||p||"",[v,p]),{getPopupContainer:U,placement:K="top",mouseEnterDelay:re=.1,mouseLeaveDelay:Y=.1,overlayStyle:J,rootClassName:Q}=i,ue=v1t(i,["getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName"]),de=D("tooltip",r),_e=D(),ve=i["data-popover-inject"];let Ve=A;!("open"in i)&&!("visible"in i)&&R&&(Ve=!1);const Ze=C1t(bh(u)&&!bSe(u)?u:C.createElement("span",null,u),de),We=Ze.props,pe=!We.className||typeof We.className=="string"?xe(We.className,{[o||`${de}-open`]:!0}):We.className,[Pe,Se]=Exe(de,!ve),Ne=Dxe(de,l),Me=Object.assign(Object.assign({},c),Ne.overlayStyle),Qe=Ne.arrowStyle,Ke=xe(a,{[`${de}-rtl`]:k==="rtl"},Ne.className,Q,Se);return Pe(C.createElement(t1t,Object.assign({},ue,{showArrow:S,placement:K,mouseEnterDelay:re,mouseLeaveDelay:Y,prefixCls:de,overlayClassName:Ke,overlayStyle:Object.assign(Object.assign({},Qe),J),getTooltipContainer:U||s||E,ref:T,builtinPlacements:W,overlay:G,visible:Ve,onVisibleChange:F,afterVisibleChange:d??h,onPopupAlign:H,overlayInnerStyle:Me,arrowContent:C.createElement("span",{className:`${de}-arrow-content`}),motion:{motionName:nC(_e,"zoom-big-fast",i.transitionName),motionDeadline:1e3},destroyTooltipOnHide:!!f}),Ve?Qs(Ze,{className:pe}):Ze))});Ixe._InternalPanelDoNotUseOrYouWillBeFired=m1t;const NT=Ixe,QO=i=>i?typeof i=="function"?i():i:null,y1t=i=>{const{componentCls:e,popoverBg:t,popoverColor:n,width:r,fontWeightStrong:o,popoverPadding:s,boxShadowSecondary:a,colorTextHeading:l,borderRadiusLG:c,zIndexPopup:u,marginXS:d,colorBgElevated:h}=i;return[{[e]:Object.assign(Object.assign({},Wr(i)),{position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:u,fontWeight:"normal",whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text","--antd-arrow-background-color":h,"&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},[`${e}-content`]:{position:"relative"},[`${e}-inner`]:{backgroundColor:t,backgroundClip:"padding-box",borderRadius:c,boxShadow:a,padding:s},[`${e}-title`]:{minWidth:r,marginBottom:d,color:l,fontWeight:o},[`${e}-inner-content`]:{color:n}})},oQ(i,{colorBg:"var(--antd-arrow-background-color)"}),{[`${e}-pure`]:{position:"relative",maxWidth:"none",margin:i.sizePopupArrow,display:"inline-block",[`${e}-content`]:{display:"inline-block"}}}]},w1t=i=>{const{componentCls:e}=i;return{[e]:sk.map(t=>{const n=i[`${t}6`];return{[`&${e}-${t}`]:{"--antd-arrow-background-color":n,[`${e}-inner`]:{backgroundColor:n},[`${e}-arrow`]:{background:"transparent"}}}})}},S1t=i=>{const{componentCls:e,lineWidth:t,lineType:n,colorSplit:r,paddingSM:o,controlHeight:s,fontSize:a,lineHeight:l,padding:c}=i,u=s-Math.round(a*l),d=u/2,h=u/2-t,f=c;return{[e]:{[`${e}-inner`]:{padding:0},[`${e}-title`]:{margin:0,padding:`${d}px ${f}px ${h}px`,borderBottom:`${t}px ${n} ${r}`},[`${e}-inner-content`]:{padding:`${o}px ${f}px`}}}},kxe=vo("Popover",i=>{const{colorBgElevated:e,colorText:t,wireframe:n}=i,r=Oi(i,{popoverBg:e,popoverColor:t,popoverPadding:12});return[y1t(r),w1t(r),n&&S1t(r),IT(r,"zoom-big")]},i=>{let{zIndexPopupBase:e}=i;return{zIndexPopup:e+30,width:177}});var x1t=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{if(!(!e&&!t))return C.createElement(C.Fragment,null,e&&C.createElement("div",{className:`${i}-title`},QO(e)),C.createElement("div",{className:`${i}-inner-content`},QO(t)))};function E1t(i){const{hashId:e,prefixCls:t,className:n,style:r,placement:o="top",title:s,content:a,children:l}=i;return C.createElement("div",{className:xe(e,t,`${t}-pure`,`${t}-placement-${o}`,n),style:r},C.createElement("div",{className:`${t}-arrow`}),C.createElement(iQ,Object.assign({},i,{className:e,prefixCls:t}),l||L1t(t,s,a)))}function D1t(i){const{prefixCls:e}=i,t=x1t(i,["prefixCls"]),{getPrefixCls:n}=C.useContext(Rn),r=n("popover",e),[o,s]=kxe(r);return o(C.createElement(E1t,Object.assign({},t,{prefixCls:r,hashId:s})))}var I1t=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{let{title:e,content:t,prefixCls:n}=i;return!e&&!t?null:C.createElement(C.Fragment,null,e&&C.createElement("div",{className:`${n}-title`},QO(e)),C.createElement("div",{className:`${n}-inner-content`},QO(t)))},Txe=C.forwardRef((i,e)=>{const{prefixCls:t,title:n,content:r,overlayClassName:o,placement:s="top",trigger:a="hover",mouseEnterDelay:l=.1,mouseLeaveDelay:c=.1,overlayStyle:u={}}=i,d=I1t(i,["prefixCls","title","content","overlayClassName","placement","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle"]),{getPrefixCls:h}=C.useContext(Rn),f=h("popover",t),[g,p]=kxe(f),v=h(),m=xe(o,p);return g(C.createElement(NT,Object.assign({placement:s,trigger:a,mouseEnterDelay:l,mouseLeaveDelay:c,overlayStyle:u},d,{prefixCls:f,overlayClassName:m,ref:e,overlay:C.createElement(k1t,{prefixCls:f,title:n,content:r}),transitionName:nC(v,"zoom-big",d.transitionName),"data-popover-inject":!0})))});Txe._InternalPanelDoNotUseOrYouWillBeFired=D1t;const T1t=Txe,N1t=i=>{const{getPrefixCls:e,direction:t}=C.useContext(Rn),{prefixCls:n,className:r,rootClassName:o,maxCount:s,maxStyle:a,size:l}=i,c=e("avatar",n),u=`${c}-group`,[d,h]=yxe(c),f=xe(u,{[`${u}-rtl`]:t==="rtl"},r,o,h),{children:g,maxPopoverPlacement:p="top",maxPopoverTrigger:v="hover"}=i,m=rd(g).map((y,S)=>Qs(y,{key:`avatar-key-${S}`})),_=m.length;if(s&&s<_){const y=m.slice(0,s),S=m.slice(s,_);return y.push(C.createElement(T1t,{key:"avatar-popover-key",content:S,trigger:v,placement:p,overlayClassName:`${u}-popover`},C.createElement(wxe,{style:a},`+${_-s}`))),d(C.createElement(hue,{size:l},C.createElement("div",{className:f,style:i.style},y)))}return d(C.createElement(hue,{size:l},C.createElement("div",{className:f,style:i.style},m)))},R1t=N1t,Nxe=wxe;Nxe.Group=R1t;const M1t=Nxe;var A1t=C.forwardRef(function(i,e){var t=i.didUpdate,n=i.getContainer,r=i.children,o=C.useRef(),s=C.useRef();C.useImperativeHandle(e,function(){return{}});var a=C.useRef(!1);return!a.current&&Zs()&&(s.current=n(),o.current=s.current.parentNode,a.current=!0),C.useEffect(function(){t==null||t(i)}),C.useEffect(function(){return s.current.parentNode===null&&o.current!==null&&o.current.appendChild(s.current),function(){var l,c;(l=s.current)===null||l===void 0||(c=l.parentNode)===null||c===void 0||c.removeChild(s.current)}},[]),s.current?_w.createPortal(r,s.current):null});function P1t(i,e,t){return t?i[0]===e[0]:i[0]===e[0]&&i[1]===e[1]}function O1t(i,e,t){var n=i[e]||{};return te(te({},n),t)}function F1t(i,e,t,n){for(var r=t.points,o=Object.keys(i),s=0;s=0&&t.left>=0&&t.bottom>t.top&&t.right>t.left?t:null}function ayt(i,e,t,n){var r=ni.clone(i),o={width:e.width,height:e.height};return n.adjustX&&r.left=t.left&&r.left+o.width>t.right&&(o.width-=r.left+o.width-t.right),n.adjustX&&r.left+o.width>t.right&&(r.left=Math.max(t.right-o.width,t.left)),n.adjustY&&r.top=t.top&&r.top+o.height>t.bottom&&(o.height-=r.top+o.height-t.bottom),n.adjustY&&r.top+o.height>t.bottom&&(r.top=Math.max(t.bottom-o.height,t.top)),ni.mix(r,o)}function cQ(i){var e,t,n;if(!ni.isWindow(i)&&i.nodeType!==9)e=ni.offset(i),t=ni.outerWidth(i),n=ni.outerHeight(i);else{var r=ni.getWindow(i);e={left:ni.getWindowScrollLeft(r),top:ni.getWindowScrollTop(r)},t=ni.viewportWidth(r),n=ni.viewportHeight(r)}return e.width=t,e.height=n,e}function Sue(i,e){var t=e.charAt(0),n=e.charAt(1),r=i.width,o=i.height,s=i.left,a=i.top;return t==="c"?a+=o/2:t==="b"&&(a+=o),n==="c"?s+=r/2:n==="r"&&(s+=r),{left:s,top:a}}function P2(i,e,t,n,r){var o=Sue(e,t[1]),s=Sue(i,t[0]),a=[s.left-o.left,s.top-o.top];return{left:Math.round(i.left-a[0]+n[0]-r[0]),top:Math.round(i.top-a[1]+n[1]-r[1])}}function xue(i,e,t){return i.leftt.right}function Lue(i,e,t){return i.topt.bottom}function lyt(i,e,t){return i.left>t.right||i.left+e.widtht.bottom||i.top+e.height=t.right||n.top>=t.bottom}function uQ(i,e,t){var n=t.target||e,r=cQ(n),o=!uyt(n,t.overflow&&t.overflow.alwaysByViewport);return $xe(i,r,t,o)}uQ.__getOffsetParent=gK;uQ.__getVisibleRectForElement=lQ;function dyt(i,e,t){var n,r,o=ni.getDocument(i),s=o.defaultView||o.parentWindow,a=ni.getWindowScrollLeft(s),l=ni.getWindowScrollTop(s),c=ni.viewportWidth(s),u=ni.viewportHeight(s);"pageX"in e?n=e.pageX:n=a+e.clientX,"pageY"in e?r=e.pageY:r=l+e.clientY;var d={left:n,top:r,width:0,height:0},h=n>=0&&n<=a+c&&r>=0&&r<=l+u,f=[t.points[0],"cc"];return $xe(i,d,pue(pue({},t),{},{points:f}),h)}const hyt=function(i,e){var t=$e.useRef(!1),n=$e.useRef(null);function r(){window.clearTimeout(n.current)}function o(s){if(r(),!t.current||s===!0){if(i(s)===!1)return;t.current=!0,n.current=window.setTimeout(function(){t.current=!1},e)}else n.current=window.setTimeout(function(){t.current=!1,o()},e)}return[o,function(){t.current=!1,r()}]};function fyt(i,e){return i===e?!0:!i||!e?!1:"pageX"in e&&"pageY"in e?i.pageX===e.pageX&&i.pageY===e.pageY:"clientX"in e&&"clientY"in e?i.clientX===e.clientX&&i.clientY===e.clientY:!1}function gyt(i,e){i!==document.activeElement&&fb(e,i)&&typeof i.focus=="function"&&i.focus()}function Iue(i,e){var t=null,n=null;function r(s){var a=Ae(s,1),l=a[0].target;if(document.documentElement.contains(l)){var c=l.getBoundingClientRect(),u=c.width,d=c.height,h=Math.floor(u),f=Math.floor(d);(t!==h||n!==f)&&Promise.resolve().then(function(){e({width:h,height:f})}),t=h,n=f}}var o=new kwe(r);return i&&o.observe(i),function(){o.disconnect()}}function kue(i){return typeof i!="function"?null:i()}function Tue(i){return zn(i)!=="object"||!i?null:i}var pyt=function(e,t){var n=e.children,r=e.disabled,o=e.target,s=e.align,a=e.onAlign,l=e.monitorWindowResize,c=e.monitorBufferTime,u=c===void 0?0:c,d=$e.useRef({}),h=$e.useRef(),f=$e.Children.only(n),g=$e.useRef({});g.current.disabled=r,g.current.target=o,g.current.align=s,g.current.onAlign=a;var p=hyt(function(){var A=g.current,N=A.disabled,R=A.target,F=A.align,W=A.onAlign,H=h.current;if(!N&&R&&H){var G,U=kue(R),K=Tue(R);d.current.element=U,d.current.point=K,d.current.align=F;var re=document,Y=re.activeElement;return U&&DT(U)?G=uQ(H,U,F):K&&(G=dyt(H,K,F)),gyt(Y,H),W&&G&&W(H,G),!0}return!1},u),v=Ae(p,2),m=v[0],_=v[1],y=$e.useState(),S=Ae(y,2),L=S[0],E=S[1],D=$e.useState(),k=Ae(D,2),T=k[0],M=k[1];return br(function(){E(kue(o)),M(Tue(o))}),$e.useEffect(function(){(d.current.element!==L||!fyt(d.current.point,T)||!Op(d.current.align,s))&&m()}),$e.useEffect(function(){var A=Iue(h.current,m);return A},[h.current]),$e.useEffect(function(){var A=Iue(L,m);return A},[L]),$e.useEffect(function(){r?_():m()},[r]),$e.useEffect(function(){if(l){var A=lp(window,"resize",m);return A.remove}},[l]),$e.useEffect(function(){return function(){_()}},[]),$e.useImperativeHandle(t,function(){return{forceAlign:function(){return m(!0)}}}),$e.isValidElement(f)&&(f=$e.cloneElement(f,{ref:vu(f.ref,h)})),f},Hxe=$e.forwardRef(pyt);Hxe.displayName="Align";var Nue=["measure","alignPre","align",null,"motion"];const myt=function(i,e){var t=Av(null),n=Ae(t,2),r=n[0],o=n[1],s=C.useRef();function a(u){o(u,!0)}function l(){Zi.cancel(s.current)}function c(u){l(),s.current=Zi(function(){a(function(d){switch(r){case"align":return"motion";case"motion":return"stable"}return d}),u==null||u()})}return C.useEffect(function(){a("measure")},[i]),C.useEffect(function(){switch(r){case"measure":e();break}r&&(s.current=Zi(EC(Nl().mark(function u(){var d,h;return Nl().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:d=Nue.indexOf(r),h=Nue[d+1],h&&d!==-1&&a(h);case 3:case"end":return g.stop()}},u)}))))},[r]),C.useEffect(function(){return function(){l()}},[]),[r,c]},vyt=function(i){var e=C.useState({width:0,height:0}),t=Ae(e,2),n=t[0],r=t[1];function o(a){var l=a.offsetWidth,c=a.offsetHeight,u=a.getBoundingClientRect(),d=u.width,h=u.height;Math.abs(l-d)<1&&Math.abs(c-h)<1&&(l=d,c=h),r({width:l,height:c})}var s=C.useMemo(function(){var a={};if(i){var l=n.width,c=n.height;i.indexOf("height")!==-1&&c?a.height=c:i.indexOf("minHeight")!==-1&&c&&(a.minHeight=c),i.indexOf("width")!==-1&&l?a.width=l:i.indexOf("minWidth")!==-1&&l&&(a.minWidth=l)}return a},[i,n]);return[s,o]};var Vxe=C.forwardRef(function(i,e){var t=i.visible,n=i.prefixCls,r=i.className,o=i.style,s=i.children,a=i.zIndex,l=i.stretch,c=i.destroyPopupOnHide,u=i.forceRender,d=i.align,h=i.point,f=i.getRootDomNode,g=i.getClassNameFromAlign,p=i.onAlign,v=i.onMouseEnter,m=i.onMouseLeave,_=i.onMouseDown,y=i.onTouchStart,S=i.onClick,L=C.useRef(),E=C.useRef(),D=C.useState(),k=Ae(D,2),T=k[0],M=k[1],A=vyt(l),N=Ae(A,2),R=N[0],F=N[1];function W(){l&&F(f())}var H=myt(t,W),G=Ae(H,2),U=G[0],K=G[1],re=C.useState(0),Y=Ae(re,2),J=Y[0],Q=Y[1],ue=C.useRef();br(function(){U==="alignPre"&&Q(0)},[U]);function de(){return h||f}function _e(){var Se;(Se=L.current)===null||Se===void 0||Se.forceAlign()}function ve(Se,Ne){var Me=g(Ne);T!==Me&&M(Me),Q(function(Qe){return Qe+1}),U==="align"&&(p==null||p(Se,Ne))}br(function(){U==="align"&&(J<3?_e():K(function(){var Se;(Se=ue.current)===null||Se===void 0||Se.call(ue)}))},[J]);var Ve=te({},Rxe(i));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(Se){var Ne=Ve[Se];Ve[Se]=function(Me,Qe){return K(),Ne==null?void 0:Ne(Me,Qe)}});function Ze(){return new Promise(function(Se){ue.current=Se})}C.useEffect(function(){!Ve.motionName&&U==="motion"&&K()},[Ve.motionName,U]),C.useImperativeHandle(e,function(){return{forceAlign:_e,getElement:function(){return E.current}}});var We=te(te({},R),{},{zIndex:a,opacity:U==="motion"||U==="stable"||!t?void 0:0,pointerEvents:!t&&U!=="stable"?"none":void 0},o),pe=!0;d!=null&&d.points&&(U==="align"||U==="stable")&&(pe=!1);var Pe=s;return C.Children.count(s)>1&&(Pe=C.createElement("div",{className:"".concat(n,"-content")},s)),C.createElement(fd,St({visible:t,ref:E,leavedClassName:"".concat(n,"-hidden")},Ve,{onAppearPrepare:Ze,onEnterPrepare:Ze,removeOnLeave:c,forceRender:u}),function(Se,Ne){var Me=Se.className,Qe=Se.style,Ke=xe(n,r,T,Me);return C.createElement(Hxe,{target:de(),key:"popup",ref:L,monitorWindowResize:!0,disabled:pe,align:d,onAlign:ve},C.createElement("div",{ref:Ne,className:Ke,onMouseEnter:v,onMouseLeave:m,onMouseDownCapture:_,onTouchStartCapture:y,onClick:S,style:te(te({},Qe),We)},Pe))})});Vxe.displayName="PopupInner";var zxe=C.forwardRef(function(i,e){var t=i.prefixCls,n=i.visible,r=i.zIndex,o=i.children,s=i.mobile;s=s===void 0?{}:s;var a=s.popupClassName,l=s.popupStyle,c=s.popupMotion,u=c===void 0?{}:c,d=s.popupRender,h=i.onClick,f=C.useRef();C.useImperativeHandle(e,function(){return{forceAlign:function(){},getElement:function(){return f.current}}});var g=te({zIndex:r},l),p=o;return C.Children.count(o)>1&&(p=C.createElement("div",{className:"".concat(t,"-content")},o)),d&&(p=d(p)),C.createElement(fd,St({visible:n,ref:f,removeOnLeave:!0},u),function(v,m){var _=v.className,y=v.style,S=xe(t,a,_);return C.createElement("div",{ref:m,className:S,onClick:h,style:te(te({},y),g)},p)})});zxe.displayName="MobilePopupInner";var _yt=["visible","mobile"],Uxe=C.forwardRef(function(i,e){var t=i.visible,n=i.mobile,r=Nn(i,_yt),o=C.useState(t),s=Ae(o,2),a=s[0],l=s[1],c=C.useState(!1),u=Ae(c,2),d=u[0],h=u[1],f=te(te({},r),{},{visible:a});C.useEffect(function(){l(t),t&&n&&h(P5())},[t,n]);var g=d?C.createElement(zxe,St({},f,{mobile:n,ref:e})):C.createElement(Vxe,St({},f,{ref:e}));return C.createElement("div",null,C.createElement(B1t,f),g)});Uxe.displayName="Popup";var Rue=C.createContext(null);function I7(){}function byt(){return""}function Cyt(i){return i?i.ownerDocument:window.document}var yyt=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function wyt(i){var e=function(t){kh(r,t);var n=Th(r);function r(o){var s;vs(this,r),s=n.call(this,o),be(Vn(s),"popupRef",C.createRef()),be(Vn(s),"triggerRef",C.createRef()),be(Vn(s),"portalContainer",void 0),be(Vn(s),"attachId",void 0),be(Vn(s),"clickOutsideHandler",void 0),be(Vn(s),"touchOutsideHandler",void 0),be(Vn(s),"contextMenuOutsideHandler1",void 0),be(Vn(s),"contextMenuOutsideHandler2",void 0),be(Vn(s),"mouseDownTimeout",void 0),be(Vn(s),"focusTime",void 0),be(Vn(s),"preClickTime",void 0),be(Vn(s),"preTouchTime",void 0),be(Vn(s),"delayTimer",void 0),be(Vn(s),"hasPopupMouseDown",void 0),be(Vn(s),"onMouseEnter",function(l){var c=s.props.mouseEnterDelay;s.fireEvents("onMouseEnter",l),s.delaySetPopupVisible(!0,c,c?null:l)}),be(Vn(s),"onMouseMove",function(l){s.fireEvents("onMouseMove",l),s.setPoint(l)}),be(Vn(s),"onMouseLeave",function(l){s.fireEvents("onMouseLeave",l),s.delaySetPopupVisible(!1,s.props.mouseLeaveDelay)}),be(Vn(s),"onPopupMouseEnter",function(){s.clearDelayTimer()}),be(Vn(s),"onPopupMouseLeave",function(l){var c;l.relatedTarget&&!l.relatedTarget.setTimeout&&fb((c=s.popupRef.current)===null||c===void 0?void 0:c.getElement(),l.relatedTarget)||s.delaySetPopupVisible(!1,s.props.mouseLeaveDelay)}),be(Vn(s),"onFocus",function(l){s.fireEvents("onFocus",l),s.clearDelayTimer(),s.isFocusToShow()&&(s.focusTime=Date.now(),s.delaySetPopupVisible(!0,s.props.focusDelay))}),be(Vn(s),"onMouseDown",function(l){s.fireEvents("onMouseDown",l),s.preClickTime=Date.now()}),be(Vn(s),"onTouchStart",function(l){s.fireEvents("onTouchStart",l),s.preTouchTime=Date.now()}),be(Vn(s),"onBlur",function(l){s.fireEvents("onBlur",l),s.clearDelayTimer(),s.isBlurToHide()&&s.delaySetPopupVisible(!1,s.props.blurDelay)}),be(Vn(s),"onContextMenu",function(l){l.preventDefault(),s.fireEvents("onContextMenu",l),s.setPopupVisible(!0,l)}),be(Vn(s),"onContextMenuClose",function(){s.isContextMenuToShow()&&s.close()}),be(Vn(s),"onClick",function(l){if(s.fireEvents("onClick",l),s.focusTime){var c;if(s.preClickTime&&s.preTouchTime?c=Math.min(s.preClickTime,s.preTouchTime):s.preClickTime?c=s.preClickTime:s.preTouchTime&&(c=s.preTouchTime),Math.abs(c-s.focusTime)<20)return;s.focusTime=0}s.preClickTime=0,s.preTouchTime=0,s.isClickToShow()&&(s.isClickToHide()||s.isBlurToHide())&&l&&l.preventDefault&&l.preventDefault();var u=!s.state.popupVisible;(s.isClickToHide()&&!u||u&&s.isClickToShow())&&s.setPopupVisible(!s.state.popupVisible,l)}),be(Vn(s),"onPopupMouseDown",function(){if(s.hasPopupMouseDown=!0,clearTimeout(s.mouseDownTimeout),s.mouseDownTimeout=window.setTimeout(function(){s.hasPopupMouseDown=!1},0),s.context){var l;(l=s.context).onPopupMouseDown.apply(l,arguments)}}),be(Vn(s),"onDocumentClick",function(l){if(!(s.props.mask&&!s.props.maskClosable)){var c=l.target,u=s.getRootDomNode(),d=s.getPopupDomNode();(!fb(u,c)||s.isContextMenuOnly())&&!fb(d,c)&&!s.hasPopupMouseDown&&s.close()}}),be(Vn(s),"getRootDomNode",function(){var l=s.props.getTriggerDOMNode;if(l)return l(s.triggerRef.current);try{var c=nk(s.triggerRef.current);if(c)return c}catch{}return _w.findDOMNode(Vn(s))}),be(Vn(s),"getPopupClassNameFromAlign",function(l){var c=[],u=s.props,d=u.popupPlacement,h=u.builtinPlacements,f=u.prefixCls,g=u.alignPoint,p=u.getPopupClassNameFromAlign;return d&&h&&c.push(F1t(h,f,l,g)),p&&c.push(p(l)),c.join(" ")}),be(Vn(s),"getComponent",function(){var l=s.props,c=l.prefixCls,u=l.destroyPopupOnHide,d=l.popupClassName,h=l.onPopupAlign,f=l.popupMotion,g=l.popupAnimation,p=l.popupTransitionName,v=l.popupStyle,m=l.mask,_=l.maskAnimation,y=l.maskTransitionName,S=l.maskMotion,L=l.zIndex,E=l.popup,D=l.stretch,k=l.alignPoint,T=l.mobile,M=l.forceRender,A=l.onPopupClick,N=s.state,R=N.popupVisible,F=N.point,W=s.getPopupAlign(),H={};return s.isMouseEnterToShow()&&(H.onMouseEnter=s.onPopupMouseEnter),s.isMouseLeaveToHide()&&(H.onMouseLeave=s.onPopupMouseLeave),H.onMouseDown=s.onPopupMouseDown,H.onTouchStart=s.onPopupMouseDown,C.createElement(Uxe,St({prefixCls:c,destroyPopupOnHide:u,visible:R,point:k&&F,className:d,align:W,onAlign:h,animation:g,getClassNameFromAlign:s.getPopupClassNameFromAlign},H,{stretch:D,getRootDomNode:s.getRootDomNode,style:v,mask:m,zIndex:L,transitionName:p,maskAnimation:_,maskTransitionName:y,maskMotion:S,ref:s.popupRef,motion:f,mobile:T,forceRender:M,onClick:A}),typeof E=="function"?E():E)}),be(Vn(s),"attachParent",function(l){Zi.cancel(s.attachId);var c=s.props,u=c.getPopupContainer,d=c.getDocument,h=s.getRootDomNode(),f;u?(h||u.length===0)&&(f=u(h)):f=d(s.getRootDomNode()).body,f?f.appendChild(l):s.attachId=Zi(function(){s.attachParent(l)})}),be(Vn(s),"getContainer",function(){if(!s.portalContainer){var l=s.props.getDocument,c=l(s.getRootDomNode()).createElement("div");c.style.position="absolute",c.style.top="0",c.style.left="0",c.style.width="100%",s.portalContainer=c}return s.attachParent(s.portalContainer),s.portalContainer}),be(Vn(s),"setPoint",function(l){var c=s.props.alignPoint;!c||!l||s.setState({point:{pageX:l.pageX,pageY:l.pageY}})}),be(Vn(s),"handlePortalUpdate",function(){s.state.prevPopupVisible!==s.state.popupVisible&&s.props.afterPopupVisibleChange(s.state.popupVisible)}),be(Vn(s),"triggerContextValue",{onPopupMouseDown:s.onPopupMouseDown});var a;return"popupVisible"in o?a=!!o.popupVisible:a=!!o.defaultPopupVisible,s.state={prevPopupVisible:a,popupVisible:a},yyt.forEach(function(l){s["fire".concat(l)]=function(c){s.fireEvents(l,c)}}),s}return _s(r,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var s=this.props,a=this.state;if(a.popupVisible){var l;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(l=s.getDocument(this.getRootDomNode()),this.clickOutsideHandler=lp(l,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(l=l||s.getDocument(this.getRootDomNode()),this.touchOutsideHandler=lp(l,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(l=l||s.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=lp(l,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=lp(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),Zi.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var s;return((s=this.popupRef.current)===null||s===void 0?void 0:s.getElement())||null}},{key:"getPopupAlign",value:function(){var s=this.props,a=s.popupPlacement,l=s.popupAlign,c=s.builtinPlacements;return a&&c?O1t(c,a,l):l}},{key:"setPopupVisible",value:function(s,a){var l=this.props.alignPoint,c=this.state.popupVisible;this.clearDelayTimer(),c!==s&&("popupVisible"in this.props||this.setState({popupVisible:s,prevPopupVisible:c}),this.props.onPopupVisibleChange(s)),l&&a&&s&&this.setPoint(a)}},{key:"delaySetPopupVisible",value:function(s,a,l){var c=this,u=a*1e3;if(this.clearDelayTimer(),u){var d=l?{pageX:l.pageX,pageY:l.pageY}:null;this.delayTimer=window.setTimeout(function(){c.setPopupVisible(s,d),c.clearDelayTimer()},u)}else this.setPopupVisible(s,l)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(s){var a=this.props.children.props,l=this.props;return a[s]&&l[s]?this["fire".concat(s)]:a[s]||l[s]}},{key:"isClickToShow",value:function(){var s=this.props,a=s.action,l=s.showAction;return a.indexOf("click")!==-1||l.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var s=this.props.action;return s==="contextMenu"||s.length===1&&s[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var s=this.props,a=s.action,l=s.showAction;return a.indexOf("contextMenu")!==-1||l.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var s=this.props,a=s.action,l=s.hideAction;return a.indexOf("click")!==-1||l.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var s=this.props,a=s.action,l=s.showAction;return a.indexOf("hover")!==-1||l.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var s=this.props,a=s.action,l=s.hideAction;return a.indexOf("hover")!==-1||l.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var s=this.props,a=s.action,l=s.showAction;return a.indexOf("focus")!==-1||l.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var s=this.props,a=s.action,l=s.hideAction;return a.indexOf("focus")!==-1||l.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var s;(s=this.popupRef.current)===null||s===void 0||s.forceAlign()}}},{key:"fireEvents",value:function(s,a){var l=this.props.children.props[s];l&&l(a);var c=this.props[s];c&&c(a)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var s=this.state.popupVisible,a=this.props,l=a.children,c=a.forceRender,u=a.alignPoint,d=a.className,h=a.autoDestroy,f=C.Children.only(l),g={key:"trigger"};this.isContextMenuToShow()?g.onContextMenu=this.onContextMenu:g.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(g.onClick=this.onClick,g.onMouseDown=this.onMouseDown,g.onTouchStart=this.onTouchStart):(g.onClick=this.createTwoChains("onClick"),g.onMouseDown=this.createTwoChains("onMouseDown"),g.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(g.onMouseEnter=this.onMouseEnter,u&&(g.onMouseMove=this.onMouseMove)):g.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?g.onMouseLeave=this.onMouseLeave:g.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(g.onFocus=this.onFocus,g.onBlur=this.onBlur):(g.onFocus=this.createTwoChains("onFocus"),g.onBlur=this.createTwoChains("onBlur"));var p=xe(f&&f.props&&f.props.className,d);p&&(g.className=p);var v=te({},g);W_(f)&&(v.ref=vu(this.triggerRef,f.ref));var m=C.cloneElement(f,v),_;return(s||this.popupRef.current||c)&&(_=C.createElement(i,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!s&&h&&(_=null),C.createElement(Rue.Provider,{value:this.triggerContextValue},m,_)}}],[{key:"getDerivedStateFromProps",value:function(s,a){var l=s.popupVisible,c={};return l!==void 0&&a.popupVisible!==l&&(c.popupVisible=l,c.prevPopupVisible=a.popupVisible),c}}]),r}(C.Component);return be(e,"contextType",Rue),be(e,"defaultProps",{prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:byt,getDocument:Cyt,onPopupVisibleChange:I7,afterPopupVisibleChange:I7,onPopupAlign:I7,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1}),e}const jxe=wyt(A1t);var w1={adjustX:1,adjustY:1},S1=[0,0],Syt={topLeft:{points:["bl","tl"],overflow:w1,offset:[0,-4],targetOffset:S1},topCenter:{points:["bc","tc"],overflow:w1,offset:[0,-4],targetOffset:S1},topRight:{points:["br","tr"],overflow:w1,offset:[0,-4],targetOffset:S1},bottomLeft:{points:["tl","bl"],overflow:w1,offset:[0,4],targetOffset:S1},bottomCenter:{points:["tc","bc"],overflow:w1,offset:[0,4],targetOffset:S1},bottomRight:{points:["tr","br"],overflow:w1,offset:[0,4],targetOffset:S1}};function Mue(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(DT(i)){var t=i.nodeName.toLowerCase(),n=["input","select","textarea","button"].includes(t)||i.isContentEditable||t==="a"&&!!i.getAttribute("href"),r=i.getAttribute("tabindex"),o=Number(r),s=null;return r&&!Number.isNaN(o)?s=o:n&&s===null&&(s=0),n&&i.disabled&&(s=null),s!==null&&(s>=0||e&&s<0)}return!1}function Kxe(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=ft(i.querySelectorAll("*")).filter(function(n){return Mue(n,e)});return Mue(i,e)&&t.unshift(i),t}var xyt=vt.ESC,Lyt=vt.TAB;function Eyt(i){var e=i.visible,t=i.setTriggerVisible,n=i.triggerRef,r=i.onVisibleChange,o=i.autoFocus,s=C.useRef(!1),a=function(){if(e&&n.current){var d,h,f,g;(d=n.current)===null||d===void 0||(h=d.triggerRef)===null||h===void 0||(f=h.current)===null||f===void 0||(g=f.focus)===null||g===void 0||g.call(f),t(!1),typeof r=="function"&&r(!1)}},l=function(){var d,h,f,g,p=Kxe((d=n.current)===null||d===void 0||(h=d.popupRef)===null||h===void 0||(f=h.current)===null||f===void 0||(g=f.getElement)===null||g===void 0?void 0:g.call(f)),v=p[0];return v!=null&&v.focus?(v.focus(),s.current=!0,!0):!1},c=function(d){switch(d.keyCode){case xyt:a();break;case Lyt:{var h=!1;s.current||(h=l()),h?d.preventDefault():a();break}}};C.useEffect(function(){return e?(window.addEventListener("keydown",c),o&&Zi(l,3),function(){window.removeEventListener("keydown",c),s.current=!1}):function(){s.current=!1}},[e])}var Dyt=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus"];function Iyt(i,e){var t=i.arrow,n=t===void 0?!1:t,r=i.prefixCls,o=r===void 0?"rc-dropdown":r,s=i.transitionName,a=i.animation,l=i.align,c=i.placement,u=c===void 0?"bottomLeft":c,d=i.placements,h=d===void 0?Syt:d,f=i.getPopupContainer,g=i.showAction,p=i.hideAction,v=i.overlayClassName,m=i.overlayStyle,_=i.visible,y=i.trigger,S=y===void 0?["hover"]:y,L=i.autoFocus,E=Nn(i,Dyt),D=C.useState(),k=Ae(D,2),T=k[0],M=k[1],A="visible"in i?_:T,N=C.useRef(null);C.useImperativeHandle(e,function(){return N.current}),Eyt({visible:A,setTriggerVisible:M,triggerRef:N,onVisibleChange:i.onVisibleChange,autoFocus:L});var R=function(){var Q=i.overlay,ue;return typeof Q=="function"?ue=Q():ue=Q,ue},F=function(Q){var ue=i.onOverlayClick;M(!1),ue&&ue(Q)},W=function(Q){var ue=i.onVisibleChange;M(Q),typeof ue=="function"&&ue(Q)},H=function(){var Q=R();return C.createElement(C.Fragment,null,n&&C.createElement("div",{className:"".concat(o,"-arrow")}),Q)},G=function(){var Q=i.overlay;return typeof Q=="function"?H:H()},U=function(){var Q=i.minOverlayWidthMatchTrigger,ue=i.alignPoint;return"minOverlayWidthMatchTrigger"in i?Q:!ue},K=function(){var Q=i.openClassName;return Q!==void 0?Q:"".concat(o,"-open")},re=function(){var Q=i.children,ue=Q.props?Q.props:{},de=xe(ue.className,K());return A&&Q?C.cloneElement(Q,{className:de}):Q},Y=p;return!Y&&S.indexOf("contextMenu")!==-1&&(Y=["click"]),C.createElement(jxe,te(te({builtinPlacements:h},E),{},{prefixCls:o,ref:N,popupClassName:xe(v,be({},"".concat(o,"-show-arrow"),n)),popupStyle:m,action:S,showAction:g,hideAction:Y||[],popupPlacement:u,popupAlign:l,popupTransitionName:s,popupAnimation:a,popupVisible:A,stretch:U()?"minWidth":"",popup:G(),onPopupVisibleChange:W,onPopupClick:F,getPopupContainer:f}),re())}const kyt=C.forwardRef(Iyt);var Gxe=C.createContext(null);function dQ(i,e){return i===void 0?null:"".concat(i,"-").concat(e)}function qxe(i){var e=C.useContext(Gxe);return dQ(e,i)}var Tyt=["children","locked"],Ch=C.createContext(null);function Nyt(i,e){var t=te({},i);return Object.keys(e).forEach(function(n){var r=e[n];r!==void 0&&(t[n]=r)}),t}function dk(i){var e=i.children,t=i.locked,n=Nn(i,Tyt),r=C.useContext(Ch),o=LC(function(){return Nyt(r,n)},[r,n],function(s,a){return!t&&(s[0]!==a[0]||!Op(s[1],a[1],!0))});return C.createElement(Ch.Provider,{value:o},e)}var Ryt=[],Xxe=C.createContext(null);function $5(){return C.useContext(Xxe)}var Yxe=C.createContext(Ryt);function ex(i){var e=C.useContext(Yxe);return C.useMemo(function(){return i!==void 0?[].concat(ft(e),[i]):e},[e,i])}var Zxe=C.createContext(null),hQ=C.createContext({}),pK=vt.LEFT,mK=vt.RIGHT,vK=vt.UP,ZM=vt.DOWN,QM=vt.ENTER,Qxe=vt.ESC,cL=vt.HOME,uL=vt.END,Aue=[vK,ZM,pK,mK];function Myt(i,e,t,n){var r,o,s,a,l="prev",c="next",u="children",d="parent";if(i==="inline"&&n===QM)return{inlineTrigger:!0};var h=(r={},be(r,vK,l),be(r,ZM,c),r),f=(o={},be(o,pK,t?c:l),be(o,mK,t?l:c),be(o,ZM,u),be(o,QM,u),o),g=(s={},be(s,vK,l),be(s,ZM,c),be(s,QM,u),be(s,Qxe,d),be(s,pK,t?u:d),be(s,mK,t?d:u),s),p={inline:h,horizontal:f,vertical:g,inlineSub:h,horizontalSub:g,verticalSub:g},v=(a=p["".concat(i).concat(e?"":"Sub")])===null||a===void 0?void 0:a[n];switch(v){case l:return{offset:-1,sibling:!0};case c:return{offset:1,sibling:!0};case d:return{offset:-1,sibling:!1};case u:return{offset:1,sibling:!1};default:return null}}function Ayt(i){for(var e=i;e;){if(e.getAttribute("data-menu-list"))return e;e=e.parentElement}return null}function Pyt(i,e){for(var t=i||document.activeElement;t;){if(e.has(t))return t;t=t.parentElement}return null}function Jxe(i,e){var t=Kxe(i,!0);return t.filter(function(n){return e.has(n)})}function Pue(i,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!i)return null;var r=Jxe(i,e),o=r.length,s=r.findIndex(function(a){return t===a});return n<0?s===-1?s=o-1:s-=1:n>0&&(s+=1),s=(s+o)%o,r[s]}function Oyt(i,e,t,n,r,o,s,a,l,c){var u=C.useRef(),d=C.useRef();d.current=e;var h=function(){Zi.cancel(u.current)};return C.useEffect(function(){return function(){h()}},[]),function(f){var g=f.which;if([].concat(Aue,[QM,Qxe,cL,uL]).includes(g)){var p,v,m,_=function(){p=new Set,v=new Map,m=new Map;var W=o();return W.forEach(function(H){var G=document.querySelector("[data-menu-id='".concat(dQ(n,H),"']"));G&&(p.add(G),m.set(G,H),v.set(H,G))}),p};_();var y=v.get(e),S=Pyt(y,p),L=m.get(S),E=Myt(i,s(L,!0).length===1,t,g);if(!E&&g!==cL&&g!==uL)return;(Aue.includes(g)||[cL,uL].includes(g))&&f.preventDefault();var D=function(W){if(W){var H=W,G=W.querySelector("a");G!=null&&G.getAttribute("href")&&(H=G);var U=m.get(W);a(U),h(),u.current=Zi(function(){d.current===U&&H.focus()})}};if([cL,uL].includes(g)||E.sibling||!S){var k;!S||i==="inline"?k=r.current:k=Ayt(S);var T,M=Jxe(k,p);g===cL?T=M[0]:g===uL?T=M[M.length-1]:T=Pue(k,p,S,E.offset),D(T)}else if(E.inlineTrigger)l(L);else if(E.offset>0)l(L,!0),h(),u.current=Zi(function(){_();var F=S.getAttribute("aria-controls"),W=document.getElementById(F),H=Pue(W,p);D(H)},5);else if(E.offset<0){var A=s(L,!0),N=A[A.length-2],R=v.get(N);l(N,!1),D(R)}}c==null||c(f)}}function Fyt(i){Promise.resolve().then(i)}var fQ="__RC_UTIL_PATH_SPLIT__",Oue=function(e){return e.join(fQ)},Byt=function(e){return e.split(fQ)},_K="rc-menu-more";function Wyt(){var i=C.useState({}),e=Ae(i,2),t=e[1],n=C.useRef(new Map),r=C.useRef(new Map),o=C.useState([]),s=Ae(o,2),a=s[0],l=s[1],c=C.useRef(0),u=C.useRef(!1),d=function(){u.current||t({})},h=C.useCallback(function(y,S){var L=Oue(S);r.current.set(L,y),n.current.set(y,L),c.current+=1;var E=c.current;Fyt(function(){E===c.current&&d()})},[]),f=C.useCallback(function(y,S){var L=Oue(S);r.current.delete(L),n.current.delete(y)},[]),g=C.useCallback(function(y){l(y)},[]),p=C.useCallback(function(y,S){var L=n.current.get(y)||"",E=Byt(L);return S&&a.includes(E[0])&&E.unshift(_K),E},[a]),v=C.useCallback(function(y,S){return y.some(function(L){var E=p(L,!0);return E.includes(S)})},[p]),m=function(){var S=ft(n.current.keys());return a.length&&S.push(_K),S},_=C.useCallback(function(y){var S="".concat(n.current.get(y)).concat(fQ),L=new Set;return ft(r.current.keys()).forEach(function(E){E.startsWith(S)&&L.add(r.current.get(E))}),L},[]);return C.useEffect(function(){return function(){u.current=!0}},[]),{registerPath:h,unregisterPath:f,refreshOverflowKeys:g,isSubPathKey:v,getKeyPath:p,getKeys:m,getSubPathKeys:_}}function F1(i){var e=C.useRef(i);e.current=i;var t=C.useCallback(function(){for(var n,r=arguments.length,o=new Array(r),s=0;s1&&(_.motionAppear=!1);var y=_.onVisibleChanged;return _.onVisibleChanged=function(S){return!h.current&&!S&&v(!0),y==null?void 0:y(S)},p?null:C.createElement(dk,{mode:o,locked:!h.current},C.createElement(fd,St({visible:m},_,{forceRender:l,removeOnLeave:!1,leavedClassName:"".concat(a,"-hidden")}),function(S){var L=S.className,E=S.style;return C.createElement(gQ,{id:e,className:L,style:E},r)}))}var rwt=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],owt=["active"],swt=function(e){var t,n=e.style,r=e.className,o=e.title,s=e.eventKey;e.warnKey;var a=e.disabled,l=e.internalPopupClose,c=e.children,u=e.itemIcon,d=e.expandIcon,h=e.popupClassName,f=e.popupOffset,g=e.onClick,p=e.onMouseEnter,v=e.onMouseLeave,m=e.onTitleClick,_=e.onTitleMouseEnter,y=e.onTitleMouseLeave,S=Nn(e,rwt),L=qxe(s),E=C.useContext(Ch),D=E.prefixCls,k=E.mode,T=E.openKeys,M=E.disabled,A=E.overflowDisabled,N=E.activeKey,R=E.selectedKeys,F=E.itemIcon,W=E.expandIcon,H=E.onItemClick,G=E.onOpenChange,U=E.onActive,K=C.useContext(hQ),re=K._internalRenderSubMenuItem,Y=C.useContext(Zxe),J=Y.isSubPathKey,Q=ex(),ue="".concat(D,"-submenu"),de=M||a,_e=C.useRef(),ve=C.useRef(),Ve=u||F,Ze=d||W,We=T.includes(s),pe=!A&&We,Pe=J(R,s),Se=eLe(s,de,_,y),Ne=Se.active,Me=Nn(Se,owt),Qe=C.useState(!1),Ke=Ae(Qe,2),Re=Ke[0],ct=Ke[1],ie=function(tt){de||ct(tt)},le=function(tt){ie(!0),p==null||p({key:s,domEvent:tt})},ce=function(tt){ie(!1),v==null||v({key:s,domEvent:tt})},z=C.useMemo(function(){return Ne||(k!=="inline"?Re||J([N],s):!1)},[k,Ne,N,Re,s,J]),q=tLe(Q.length),oe=function(tt){de||(m==null||m({key:s,domEvent:tt}),k==="inline"&&G(s,!We))},ne=F1(function(at){g==null||g(eF(at)),H(at)}),he=function(tt){k!=="inline"&&G(s,tt)},Le=function(){U(s)},Fe=L&&"".concat(L,"-popup"),ze=C.createElement("div",St({role:"menuitem",style:q,className:"".concat(ue,"-title"),tabIndex:de?null:-1,ref:_e,title:typeof o=="string"?o:null,"data-menu-id":A&&L?null:L,"aria-expanded":pe,"aria-haspopup":!0,"aria-controls":Fe,"aria-disabled":de,onClick:oe,onFocus:Le},Me),o,C.createElement(nLe,{icon:k!=="horizontal"?Ze:null,props:te(te({},e),{},{isOpen:pe,isSubMenu:!0})},C.createElement("i",{className:"".concat(ue,"-arrow")}))),Ue=C.useRef(k);if(k!=="inline"&&Q.length>1?Ue.current="vertical":Ue.current=k,!A){var nt=Ue.current;ze=C.createElement(nwt,{mode:nt,prefixCls:ue,visible:!l&&pe&&k!=="inline",popupClassName:h,popupOffset:f,popup:C.createElement(dk,{mode:nt==="horizontal"?"vertical":nt},C.createElement(gQ,{id:Fe,ref:ve},c)),disabled:de,onVisibleChange:he},ze)}var it=C.createElement(Of.Item,St({role:"none"},S,{component:"li",style:n,className:xe(ue,"".concat(ue,"-").concat(k),r,(t={},be(t,"".concat(ue,"-open"),pe),be(t,"".concat(ue,"-active"),z),be(t,"".concat(ue,"-selected"),Pe),be(t,"".concat(ue,"-disabled"),de),t)),onMouseEnter:le,onMouseLeave:ce}),ze,!A&&C.createElement(iwt,{id:Fe,open:pe,keyPath:Q},c));return re&&(it=re(it,e,{selected:Pe,active:z,open:pe,disabled:de})),C.createElement(dk,{onItemClick:ne,mode:k==="horizontal"?"vertical":k,itemIcon:Ve,expandIcon:Ze},it)};function V5(i){var e=i.eventKey,t=i.children,n=ex(e),r=pQ(t,n),o=$5();C.useEffect(function(){if(o)return o.registerPath(e,n),function(){o.unregisterPath(e,n)}},[n]);var s;return o?s=r:s=C.createElement(swt,i,r),C.createElement(Yxe.Provider,{value:n},s)}var awt=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem"],x1=[],lwt=C.forwardRef(function(i,e){var t,n,r=i,o=r.prefixCls,s=o===void 0?"rc-menu":o,a=r.rootClassName,l=r.style,c=r.className,u=r.tabIndex,d=u===void 0?0:u,h=r.items,f=r.children,g=r.direction,p=r.id,v=r.mode,m=v===void 0?"vertical":v,_=r.inlineCollapsed,y=r.disabled,S=r.disabledOverflow,L=r.subMenuOpenDelay,E=L===void 0?.1:L,D=r.subMenuCloseDelay,k=D===void 0?.1:D,T=r.forceSubMenuRender,M=r.defaultOpenKeys,A=r.openKeys,N=r.activeKey,R=r.defaultActiveFirst,F=r.selectable,W=F===void 0?!0:F,H=r.multiple,G=H===void 0?!1:H,U=r.defaultSelectedKeys,K=r.selectedKeys,re=r.onSelect,Y=r.onDeselect,J=r.inlineIndent,Q=J===void 0?24:J,ue=r.motion,de=r.defaultMotions,_e=r.triggerSubMenuAction,ve=_e===void 0?"hover":_e,Ve=r.builtinPlacements,Ze=r.itemIcon,We=r.expandIcon,pe=r.overflowedIndicator,Pe=pe===void 0?"...":pe,Se=r.overflowedIndicatorPopupClassName,Ne=r.getPopupContainer,Me=r.onClick,Qe=r.onOpenChange,Ke=r.onKeyDown;r.openAnimation,r.openTransitionName;var Re=r._internalRenderMenuItem,ct=r._internalRenderSubMenuItem,ie=Nn(r,awt),le=C.useMemo(function(){return Qyt(f,h,x1)},[f,h]),ce=C.useState(!1),z=Ae(ce,2),q=z[0],oe=z[1],ne=C.useRef(),he=Hyt(p),Le=g==="rtl",Fe=Ja(M,{value:A,postState:function(Ft){return Ft||x1}}),ze=Ae(Fe,2),Ue=ze[0],nt=ze[1],it=function(Ft){var Pn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function Xt(){nt(Ft),Qe==null||Qe(Ft)}Pn?sh.flushSync(Xt):Xt()},at=C.useState(Ue),tt=Ae(at,2),Zt=tt[0],Tt=tt[1],xn=C.useRef(!1),rt=C.useMemo(function(){return(m==="inline"||m==="vertical")&&_?["vertical",_]:[m,!1]},[m,_]),wt=Ae(rt,2),Bt=wt[0],Nt=wt[1],nn=Bt==="inline",Mn=C.useState(Bt),zt=Ae(Mn,2),Qt=zt[0],lt=zt[1],ut=C.useState(Nt),dt=Ae(ut,2),Mt=dt[0],Kt=dt[1];C.useEffect(function(){lt(Bt),Kt(Nt),xn.current&&(nn?nt(Zt):it(x1))},[Bt,Nt]);var mn=C.useState(0),lr=Ae(mn,2),nr=lr[0],Hr=lr[1],Jn=nr>=le.length-1||Qt!=="horizontal"||S;C.useEffect(function(){nn&&Tt(Ue)},[Ue]),C.useEffect(function(){return xn.current=!0,function(){xn.current=!1}},[]);var Ii=Wyt(),_o=Ii.registerPath,No=Ii.unregisterPath,bs=Ii.refreshOverflowKeys,Cs=Ii.isSubPathKey,$t=Ii.getKeyPath,we=Ii.getKeys,bt=Ii.getSubPathKeys,xt=C.useMemo(function(){return{registerPath:_o,unregisterPath:No}},[_o,No]),Gn=C.useMemo(function(){return{isSubPathKey:Cs}},[Cs]);C.useEffect(function(){bs(Jn?x1:le.slice(nr+1).map(function(qt){return qt.key}))},[nr,Jn]);var cr=Ja(N||R&&((t=le[0])===null||t===void 0?void 0:t.key),{value:N}),Vr=Ae(cr,2),ei=Vr[0],Qr=Vr[1],Fs=F1(function(qt){Qr(qt)}),Fl=F1(function(){Qr(void 0)});C.useImperativeHandle(e,function(){return{list:ne.current,focus:function(Ft){var Pn,Xt=ei??((Pn=le.find(function(Co){return!Co.props.disabled}))===null||Pn===void 0?void 0:Pn.key);if(Xt){var Gt,oi,Fi;(Gt=ne.current)===null||Gt===void 0||(oi=Gt.querySelector("li[data-menu-id='".concat(dQ(he,Xt),"']")))===null||oi===void 0||(Fi=oi.focus)===null||Fi===void 0||Fi.call(oi,Ft)}}}});var Aa=Ja(U||[],{value:K,postState:function(Ft){return Array.isArray(Ft)?Ft:Ft==null?x1:[Ft]}}),zo=Ae(Aa,2),bo=zo[0],Pa=zo[1],Oa=function(Ft){if(W){var Pn=Ft.key,Xt=bo.includes(Pn),Gt;G?Xt?Gt=bo.filter(function(Fi){return Fi!==Pn}):Gt=[].concat(ft(bo),[Pn]):Gt=[Pn],Pa(Gt);var oi=te(te({},Ft),{},{selectedKeys:Gt});Xt?Y==null||Y(oi):re==null||re(oi)}!G&&Ue.length&&Qt!=="inline"&&it(x1)},Bl=F1(function(qt){Me==null||Me(eF(qt)),Oa(qt)}),cl=F1(function(qt,Ft){var Pn=Ue.filter(function(Gt){return Gt!==qt});if(Ft)Pn.push(qt);else if(Qt!=="inline"){var Xt=bt(qt);Pn=Pn.filter(function(Gt){return!Xt.has(Gt)})}Op(Ue,Pn,!0)||it(Pn,!0)}),Wl=F1(Ne),_u=function(Ft,Pn){var Xt=Pn??!Ue.includes(Ft);cl(Ft,Xt)},bu=Oyt(Qt,ei,Le,he,ne,we,$t,Qr,_u,Ke);C.useEffect(function(){oe(!0)},[]);var xc=C.useMemo(function(){return{_internalRenderMenuItem:Re,_internalRenderSubMenuItem:ct}},[Re,ct]),Fa=Qt!=="horizontal"||S?le:le.map(function(qt,Ft){return C.createElement(dk,{key:qt.key,overflowDisabled:Ft>nr},qt)}),Ba=C.createElement(Of,St({id:p,ref:ne,prefixCls:"".concat(s,"-overflow"),component:"ul",itemComponent:H5,className:xe(s,"".concat(s,"-root"),"".concat(s,"-").concat(Qt),c,(n={},be(n,"".concat(s,"-inline-collapsed"),Mt),be(n,"".concat(s,"-rtl"),Le),n),a),dir:g,style:l,role:"menu",tabIndex:d,data:Fa,renderRawItem:function(Ft){return Ft},renderRawRest:function(Ft){var Pn=Ft.length,Xt=Pn?le.slice(-Pn):null;return C.createElement(V5,{eventKey:_K,title:Pe,disabled:Jn,internalPopupClose:Pn===0,popupClassName:Se},Xt)},maxCount:Qt!=="horizontal"||S?Of.INVALIDATE:Of.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(Ft){Hr(Ft)},onKeyDown:bu},ie));return C.createElement(hQ.Provider,{value:xc},C.createElement(Gxe.Provider,{value:he},C.createElement(dk,{prefixCls:s,rootClassName:a,mode:Qt,openKeys:Ue,rtl:Le,disabled:y,motion:q?ue:null,defaultMotions:q?de:null,activeKey:ei,onActive:Fs,onInactive:Fl,selectedKeys:bo,inlineIndent:Q,subMenuOpenDelay:E,subMenuCloseDelay:k,forceSubMenuRender:T,builtinPlacements:Ve,triggerSubMenuAction:ve,getPopupContainer:Wl,itemIcon:Ze,expandIcon:We,onItemClick:Bl,onOpenChange:cl},C.createElement(Zxe.Provider,{value:Gn},Ba),C.createElement("div",{style:{display:"none"},"aria-hidden":!0},C.createElement(Xxe.Provider,{value:xt},le)))))}),cwt=["className","title","eventKey","children"],uwt=["children"],dwt=function(e){var t=e.className,n=e.title;e.eventKey;var r=e.children,o=Nn(e,cwt),s=C.useContext(Ch),a=s.prefixCls,l="".concat(a,"-item-group");return C.createElement("li",St({role:"presentation"},o,{onClick:function(u){return u.stopPropagation()},className:xe(l,t)}),C.createElement("div",{role:"presentation",className:"".concat(l,"-title"),title:typeof n=="string"?n:void 0},n),C.createElement("ul",{role:"group",className:"".concat(l,"-list")},r))};function z5(i){var e=i.children,t=Nn(i,uwt),n=ex(t.eventKey),r=pQ(e,n),o=$5();return o?r:C.createElement(dwt,ll(t,["warnKey"]),r)}function mQ(i){var e=i.className,t=i.style,n=C.useContext(Ch),r=n.prefixCls,o=$5();return o?null:C.createElement("li",{className:xe("".concat(r,"-item-divider"),e),style:t})}var MT=lwt;MT.Item=H5;MT.SubMenu=V5;MT.ItemGroup=z5;MT.Divider=mQ;const hwt=i=>{const{componentCls:e,motionDurationSlow:t,menuHorizontalHeight:n,colorSplit:r,lineWidth:o,lineType:s,menuItemPaddingInline:a}=i;return{[`${e}-horizontal`]:{lineHeight:`${n}px`,border:0,borderBottom:`${o}px ${s} ${r}`,boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},[`${e}-item, ${e}-submenu`]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:a},[`> ${e}-item:hover, > ${e}-item-active, > ${e}-submenu ${e}-submenu-title:hover`]:{backgroundColor:"transparent"},[`${e}-item, ${e}-submenu-title`]:{transition:[`border-color ${t}`,`background ${t}`].join(",")},[`${e}-submenu-arrow`]:{display:"none"}}}},fwt=hwt,gwt=i=>{let{componentCls:e,menuArrowOffset:t}=i;return{[`${e}-rtl`]:{direction:"rtl"},[`${e}-submenu-rtl`]:{transformOrigin:"100% 0"},[`${e}-rtl${e}-vertical, - ${e}-submenu-rtl ${e}-vertical`]:{[`${e}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateY(-${t})`},"&::after":{transform:`rotate(45deg) translateY(${t})`}}}}},pwt=gwt,Bue=i=>Object.assign({},Op(i)),mwt=(i,e)=>{const{componentCls:t,colorItemText:n,colorItemTextSelected:r,colorGroupTitle:o,colorItemBg:s,colorSubItemBg:a,colorItemBgSelected:l,colorActiveBarHeight:c,colorActiveBarWidth:u,colorActiveBarBorderSize:d,motionDurationSlow:h,motionEaseInOut:f,motionEaseOut:g,menuItemPaddingInline:p,motionDurationMid:v,colorItemTextHover:m,lineType:_,colorSplit:y,colorItemTextDisabled:S,colorDangerItemText:L,colorDangerItemTextHover:E,colorDangerItemTextSelected:D,colorDangerItemBgActive:k,colorDangerItemBgSelected:T,colorItemBgHover:M,menuSubMenuBg:A,colorItemTextSelectedHorizontal:N,colorItemBgSelectedHorizontal:R}=i;return{[`${t}-${e}, ${t}-${e} > ${t}`]:{color:n,background:s,[`&${t}-root:focus-visible`]:Object.assign({},Bue(i)),[`${t}-item-group-title`]:{color:o},[`${t}-submenu-selected`]:{[`> ${t}-submenu-title`]:{color:r}},[`${t}-item-disabled, ${t}-submenu-disabled`]:{color:`${S} !important`},[`${t}-item:hover, ${t}-submenu-title:hover`]:{[`&:not(${t}-item-selected):not(${t}-submenu-selected)`]:{color:m}},[`&:not(${t}-horizontal)`]:{[`${t}-item:not(${t}-item-selected)`]:{"&:hover":{backgroundColor:M},"&:active":{backgroundColor:l}},[`${t}-submenu-title`]:{"&:hover":{backgroundColor:M},"&:active":{backgroundColor:l}}},[`${t}-item-danger`]:{color:L,[`&${t}-item:hover`]:{[`&:not(${t}-item-selected):not(${t}-submenu-selected)`]:{color:E}},[`&${t}-item:active`]:{background:k}},[`${t}-item a`]:{"&, &:hover":{color:"inherit"}},[`${t}-item-selected`]:{color:r,[`&${t}-item-danger`]:{color:D},["a, a:hover"]:{color:"inherit"}},[`& ${t}-item-selected`]:{backgroundColor:l,[`&${t}-item-danger`]:{backgroundColor:T}},[`${t}-item, ${t}-submenu-title`]:{[`&:not(${t}-item-disabled):focus-visible`]:Object.assign({},Bue(i))},[`&${t}-submenu > ${t}`]:{backgroundColor:A},[`&${t}-popup > ${t}`]:{backgroundColor:s},[`&${t}-horizontal`]:Object.assign(Object.assign({},e==="dark"?{borderBottom:0}:{}),{[`> ${t}-item, > ${t}-submenu`]:{top:d,marginTop:-d,marginBottom:0,borderRadius:0,"&::after":{position:"absolute",insetInline:p,bottom:0,borderBottom:`${c}px solid transparent`,transition:`border-color ${h} ${f}`,content:'""'},["&:hover, &-active, &-open"]:{"&::after":{borderBottomWidth:c,borderBottomColor:N}},["&-selected"]:{color:N,backgroundColor:R,"&::after":{borderBottomWidth:c,borderBottomColor:N}}}}),[`&${t}-root`]:{[`&${t}-inline, &${t}-vertical`]:{borderInlineEnd:`${d}px ${_} ${y}`}},[`&${t}-inline`]:{[`${t}-sub${t}-inline`]:{background:a},[`${t}-item, ${t}-submenu-title`]:d&&u?{width:`calc(100% + ${d}px)`}:{},[`${t}-item`]:{position:"relative","&::after":{position:"absolute",insetBlock:0,insetInlineEnd:0,borderInlineEnd:`${u}px solid ${r}`,transform:"scaleY(0.0001)",opacity:0,transition:[`transform ${v} ${g}`,`opacity ${v} ${g}`].join(","),content:'""'},[`&${t}-item-danger`]:{"&::after":{borderInlineEndColor:D}}},[`${t}-selected, ${t}-item-selected`]:{"&::after":{transform:"scaleY(1)",opacity:1,transition:[`transform ${v} ${f}`,`opacity ${v} ${f}`].join(",")}}}}}},Wue=mwt,$ue=i=>{const{componentCls:e,menuItemHeight:t,itemMarginInline:n,padding:r,menuArrowSize:o,marginXS:s,marginXXS:a}=i,l=r+o+s;return{[`${e}-item`]:{position:"relative"},[`${e}-item, ${e}-submenu-title`]:{height:t,lineHeight:`${t}px`,paddingInline:r,overflow:"hidden",textOverflow:"ellipsis",marginInline:n,marginBlock:a,width:`calc(100% - ${n*2}px)`},[`${e}-submenu`]:{paddingBottom:.02},[`> ${e}-item, + ${e}-submenu-rtl ${e}-vertical`]:{[`${e}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateY(-${t})`},"&::after":{transform:`rotate(45deg) translateY(${t})`}}}}},pwt=gwt,Bue=i=>Object.assign({},Fp(i)),mwt=(i,e)=>{const{componentCls:t,colorItemText:n,colorItemTextSelected:r,colorGroupTitle:o,colorItemBg:s,colorSubItemBg:a,colorItemBgSelected:l,colorActiveBarHeight:c,colorActiveBarWidth:u,colorActiveBarBorderSize:d,motionDurationSlow:h,motionEaseInOut:f,motionEaseOut:g,menuItemPaddingInline:p,motionDurationMid:v,colorItemTextHover:m,lineType:_,colorSplit:y,colorItemTextDisabled:S,colorDangerItemText:L,colorDangerItemTextHover:E,colorDangerItemTextSelected:D,colorDangerItemBgActive:k,colorDangerItemBgSelected:T,colorItemBgHover:M,menuSubMenuBg:A,colorItemTextSelectedHorizontal:N,colorItemBgSelectedHorizontal:R}=i;return{[`${t}-${e}, ${t}-${e} > ${t}`]:{color:n,background:s,[`&${t}-root:focus-visible`]:Object.assign({},Bue(i)),[`${t}-item-group-title`]:{color:o},[`${t}-submenu-selected`]:{[`> ${t}-submenu-title`]:{color:r}},[`${t}-item-disabled, ${t}-submenu-disabled`]:{color:`${S} !important`},[`${t}-item:hover, ${t}-submenu-title:hover`]:{[`&:not(${t}-item-selected):not(${t}-submenu-selected)`]:{color:m}},[`&:not(${t}-horizontal)`]:{[`${t}-item:not(${t}-item-selected)`]:{"&:hover":{backgroundColor:M},"&:active":{backgroundColor:l}},[`${t}-submenu-title`]:{"&:hover":{backgroundColor:M},"&:active":{backgroundColor:l}}},[`${t}-item-danger`]:{color:L,[`&${t}-item:hover`]:{[`&:not(${t}-item-selected):not(${t}-submenu-selected)`]:{color:E}},[`&${t}-item:active`]:{background:k}},[`${t}-item a`]:{"&, &:hover":{color:"inherit"}},[`${t}-item-selected`]:{color:r,[`&${t}-item-danger`]:{color:D},["a, a:hover"]:{color:"inherit"}},[`& ${t}-item-selected`]:{backgroundColor:l,[`&${t}-item-danger`]:{backgroundColor:T}},[`${t}-item, ${t}-submenu-title`]:{[`&:not(${t}-item-disabled):focus-visible`]:Object.assign({},Bue(i))},[`&${t}-submenu > ${t}`]:{backgroundColor:A},[`&${t}-popup > ${t}`]:{backgroundColor:s},[`&${t}-horizontal`]:Object.assign(Object.assign({},e==="dark"?{borderBottom:0}:{}),{[`> ${t}-item, > ${t}-submenu`]:{top:d,marginTop:-d,marginBottom:0,borderRadius:0,"&::after":{position:"absolute",insetInline:p,bottom:0,borderBottom:`${c}px solid transparent`,transition:`border-color ${h} ${f}`,content:'""'},["&:hover, &-active, &-open"]:{"&::after":{borderBottomWidth:c,borderBottomColor:N}},["&-selected"]:{color:N,backgroundColor:R,"&::after":{borderBottomWidth:c,borderBottomColor:N}}}}),[`&${t}-root`]:{[`&${t}-inline, &${t}-vertical`]:{borderInlineEnd:`${d}px ${_} ${y}`}},[`&${t}-inline`]:{[`${t}-sub${t}-inline`]:{background:a},[`${t}-item, ${t}-submenu-title`]:d&&u?{width:`calc(100% + ${d}px)`}:{},[`${t}-item`]:{position:"relative","&::after":{position:"absolute",insetBlock:0,insetInlineEnd:0,borderInlineEnd:`${u}px solid ${r}`,transform:"scaleY(0.0001)",opacity:0,transition:[`transform ${v} ${g}`,`opacity ${v} ${g}`].join(","),content:'""'},[`&${t}-item-danger`]:{"&::after":{borderInlineEndColor:D}}},[`${t}-selected, ${t}-item-selected`]:{"&::after":{transform:"scaleY(1)",opacity:1,transition:[`transform ${v} ${f}`,`opacity ${v} ${f}`].join(",")}}}}}},Wue=mwt,$ue=i=>{const{componentCls:e,menuItemHeight:t,itemMarginInline:n,padding:r,menuArrowSize:o,marginXS:s,marginXXS:a}=i,l=r+o+s;return{[`${e}-item`]:{position:"relative"},[`${e}-item, ${e}-submenu-title`]:{height:t,lineHeight:`${t}px`,paddingInline:r,overflow:"hidden",textOverflow:"ellipsis",marginInline:n,marginBlock:a,width:`calc(100% - ${n*2}px)`},[`${e}-submenu`]:{paddingBottom:.02},[`> ${e}-item, > ${e}-submenu > ${e}-submenu-title`]:{height:t,lineHeight:`${t}px`},[`${e}-item-group-list ${e}-submenu-title, ${e}-submenu-title`]:{paddingInlineEnd:l}}},vwt=i=>{const{componentCls:e,iconCls:t,menuItemHeight:n,colorTextLightSolid:r,dropdownWidth:o,controlHeightLG:s,motionDurationMid:a,motionEaseOut:l,paddingXL:c,fontSizeSM:u,fontSizeLG:d,motionDurationSlow:h,paddingXS:f,boxShadowSecondary:g}=i,p={height:n,lineHeight:`${n}px`,listStylePosition:"inside",listStyleType:"disc"};return[{[e]:{["&-inline, &-vertical"]:Object.assign({[`&${e}-root`]:{boxShadow:"none"}},$ue(i))},[`${e}-submenu-popup`]:{[`${e}-vertical`]:Object.assign(Object.assign({},$ue(i)),{boxShadow:g})}},{[`${e}-submenu-popup ${e}-vertical${e}-sub`]:{minWidth:o,maxHeight:`calc(100vh - ${s*2.5}px)`,padding:"0",overflow:"hidden",borderInlineEnd:0,"&:not([class*='-active'])":{overflowX:"hidden",overflowY:"auto"}}},{[`${e}-inline`]:{width:"100%",[`&${e}-root`]:{[`${e}-item, ${e}-submenu-title`]:{display:"flex",alignItems:"center",transition:[`border-color ${h}`,`background ${h}`,`padding ${a} ${l}`].join(","),[`> ${e}-title-content`]:{flex:"auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},"> *":{flex:"none"}}},[`${e}-sub${e}-inline`]:{padding:0,border:0,borderRadius:0,boxShadow:"none",[`& > ${e}-submenu > ${e}-submenu-title`]:p,[`& ${e}-item-group-title`]:{paddingInlineStart:c}},[`${e}-item`]:p}},{[`${e}-inline-collapsed`]:{width:n*2,[`&${e}-root`]:{[`${e}-item, ${e}-submenu ${e}-submenu-title`]:{[`> ${e}-inline-collapsed-noicon`]:{fontSize:d,textAlign:"center"}}},[`> ${e}-item, > ${e}-item-group > ${e}-item-group-list > ${e}-item, @@ -1019,7 +1019,7 @@ html body { > ${e}-submenu > ${e}-submenu-title`]:{insetInlineStart:0,paddingInline:`calc(50% - ${u}px)`,textOverflow:"clip",[` ${e}-submenu-arrow, ${e}-submenu-expand-icon - `]:{opacity:0},[`${e}-item-icon, ${t}`]:{margin:0,fontSize:d,lineHeight:`${n}px`,"+ span":{display:"inline-block",opacity:0}}},[`${e}-item-icon, ${t}`]:{display:"inline-block"},"&-tooltip":{pointerEvents:"none",[`${e}-item-icon, ${t}`]:{display:"none"},"a, a:hover":{color:r}},[`${e}-item-group-title`]:Object.assign(Object.assign({},mb),{paddingInline:f})}}]},_wt=vwt,Hue=i=>{const{componentCls:e,fontSize:t,motionDurationSlow:n,motionDurationMid:r,motionEaseInOut:o,motionEaseOut:s,iconCls:a,controlHeightSM:l}=i;return{[`${e}-item, ${e}-submenu-title`]:{position:"relative",display:"block",margin:0,whiteSpace:"nowrap",cursor:"pointer",transition:[`border-color ${n}`,`background ${n}`,`padding ${n} ${o}`].join(","),[`${e}-item-icon, ${a}`]:{minWidth:t,fontSize:t,transition:[`font-size ${r} ${s}`,`margin ${n} ${o}`,`color ${n}`].join(","),"+ span":{marginInlineStart:l-t,opacity:1,transition:[`opacity ${n} ${o}`,`margin ${n}`,`color ${n}`].join(",")}},[`${e}-item-icon`]:Object.assign({},xT()),[`&${e}-item-only-child`]:{[`> ${a}, > ${e}-item-icon`]:{marginInlineEnd:0}}},[`${e}-item-disabled, ${e}-submenu-disabled`]:{background:"none !important",cursor:"not-allowed","&::after":{borderColor:"transparent !important"},a:{color:"inherit !important"},[`> ${e}-submenu-title`]:{color:"inherit !important",cursor:"not-allowed"}}}},Vue=i=>{const{componentCls:e,motionDurationSlow:t,motionEaseInOut:n,borderRadius:r,menuArrowSize:o,menuArrowOffset:s}=i;return{[`${e}-submenu`]:{["&-expand-icon, &-arrow"]:{position:"absolute",top:"50%",insetInlineEnd:i.margin,width:o,color:"currentcolor",transform:"translateY(-50%)",transition:`transform ${t} ${n}, opacity ${t}`},"&-arrow":{"&::before, &::after":{position:"absolute",width:o*.6,height:o*.15,backgroundColor:"currentcolor",borderRadius:r,transition:[`background ${t} ${n}`,`transform ${t} ${n}`,`top ${t} ${n}`,`color ${t} ${n}`].join(","),content:'""'},"&::before":{transform:`rotate(45deg) translateY(-${s})`},"&::after":{transform:`rotate(-45deg) translateY(${s})`}}}}},bwt=i=>{const{antCls:e,componentCls:t,fontSize:n,motionDurationSlow:r,motionDurationMid:o,motionEaseInOut:s,lineHeight:a,paddingXS:l,padding:c,colorSplit:u,lineWidth:d,zIndexPopup:h,borderRadiusLG:f,radiusSubMenuItem:g,menuArrowSize:p,menuArrowOffset:v,lineType:m,menuPanelMaskInset:_}=i;return[{"":{[`${t}`]:Object.assign(Object.assign({},ak()),{["&-hidden"]:{display:"none"}})},[`${t}-submenu-hidden`]:{display:"none"}},{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Wr(i)),ak()),{marginBottom:0,paddingInlineStart:0,fontSize:n,lineHeight:0,listStyle:"none",outline:"none",transition:[`background ${r}`,`width ${r} cubic-bezier(0.2, 0, 0, 1) 0s`].join(","),["ul, ol"]:{margin:0,padding:0,listStyle:"none"},["&-overflow"]:{display:"flex",[`${t}-item`]:{flex:"none"}},[`${t}-item, ${t}-submenu, ${t}-submenu-title`]:{borderRadius:i.radiusItem},[`${t}-item-group-title`]:{padding:`${l}px ${c}px`,fontSize:n,lineHeight:a,transition:`all ${r}`},[`&-horizontal ${t}-submenu`]:{transition:[`border-color ${r} ${s}`,`background ${r} ${s}`].join(",")},[`${t}-submenu, ${t}-submenu-inline`]:{transition:[`border-color ${r} ${s}`,`background ${r} ${s}`,`padding ${o} ${s}`].join(",")},[`${t}-submenu ${t}-sub`]:{cursor:"initial",transition:[`background ${r} ${s}`,`padding ${r} ${s}`].join(",")},[`${t}-title-content`]:{transition:`color ${r}`},[`${t}-item a`]:{"&::before":{position:"absolute",inset:0,backgroundColor:"transparent",content:'""'}},[`${t}-item-divider`]:{overflow:"hidden",lineHeight:0,borderColor:u,borderStyle:m,borderWidth:0,borderTopWidth:d,marginBlock:d,padding:0,"&-dashed":{borderStyle:"dashed"}}}),Hue(i)),{[`${t}-item-group`]:{[`${t}-item-group-list`]:{margin:0,padding:0,[`${t}-item, ${t}-submenu-title`]:{paddingInline:`${n*2}px ${c}px`}}},"&-submenu":{"&-popup":{position:"absolute",zIndex:h,background:"transparent",borderRadius:f,boxShadow:"none",transformOrigin:"0 0","&::before":{position:"absolute",inset:`${_}px 0 0`,zIndex:-1,width:"100%",height:"100%",opacity:0,content:'""'}},"&-placement-rightTop::before":{top:0,insetInlineStart:_},[`> ${t}`]:Object.assign(Object.assign(Object.assign({borderRadius:f},Hue(i)),Vue(i)),{[`${t}-item, ${t}-submenu > ${t}-submenu-title`]:{borderRadius:g},[`${t}-submenu-title::after`]:{transition:`transform ${r} ${s}`}})}}),Vue(i)),{[`&-inline-collapsed ${t}-submenu-arrow, + `]:{opacity:0},[`${e}-item-icon, ${t}`]:{margin:0,fontSize:d,lineHeight:`${n}px`,"+ span":{display:"inline-block",opacity:0}}},[`${e}-item-icon, ${t}`]:{display:"inline-block"},"&-tooltip":{pointerEvents:"none",[`${e}-item-icon, ${t}`]:{display:"none"},"a, a:hover":{color:r}},[`${e}-item-group-title`]:Object.assign(Object.assign({},pb),{paddingInline:f})}}]},_wt=vwt,Hue=i=>{const{componentCls:e,fontSize:t,motionDurationSlow:n,motionDurationMid:r,motionEaseInOut:o,motionEaseOut:s,iconCls:a,controlHeightSM:l}=i;return{[`${e}-item, ${e}-submenu-title`]:{position:"relative",display:"block",margin:0,whiteSpace:"nowrap",cursor:"pointer",transition:[`border-color ${n}`,`background ${n}`,`padding ${n} ${o}`].join(","),[`${e}-item-icon, ${a}`]:{minWidth:t,fontSize:t,transition:[`font-size ${r} ${s}`,`margin ${n} ${o}`,`color ${n}`].join(","),"+ span":{marginInlineStart:l-t,opacity:1,transition:[`opacity ${n} ${o}`,`margin ${n}`,`color ${n}`].join(",")}},[`${e}-item-icon`]:Object.assign({},xT()),[`&${e}-item-only-child`]:{[`> ${a}, > ${e}-item-icon`]:{marginInlineEnd:0}}},[`${e}-item-disabled, ${e}-submenu-disabled`]:{background:"none !important",cursor:"not-allowed","&::after":{borderColor:"transparent !important"},a:{color:"inherit !important"},[`> ${e}-submenu-title`]:{color:"inherit !important",cursor:"not-allowed"}}}},Vue=i=>{const{componentCls:e,motionDurationSlow:t,motionEaseInOut:n,borderRadius:r,menuArrowSize:o,menuArrowOffset:s}=i;return{[`${e}-submenu`]:{["&-expand-icon, &-arrow"]:{position:"absolute",top:"50%",insetInlineEnd:i.margin,width:o,color:"currentcolor",transform:"translateY(-50%)",transition:`transform ${t} ${n}, opacity ${t}`},"&-arrow":{"&::before, &::after":{position:"absolute",width:o*.6,height:o*.15,backgroundColor:"currentcolor",borderRadius:r,transition:[`background ${t} ${n}`,`transform ${t} ${n}`,`top ${t} ${n}`,`color ${t} ${n}`].join(","),content:'""'},"&::before":{transform:`rotate(45deg) translateY(-${s})`},"&::after":{transform:`rotate(-45deg) translateY(${s})`}}}}},bwt=i=>{const{antCls:e,componentCls:t,fontSize:n,motionDurationSlow:r,motionDurationMid:o,motionEaseInOut:s,lineHeight:a,paddingXS:l,padding:c,colorSplit:u,lineWidth:d,zIndexPopup:h,borderRadiusLG:f,radiusSubMenuItem:g,menuArrowSize:p,menuArrowOffset:v,lineType:m,menuPanelMaskInset:_}=i;return[{"":{[`${t}`]:Object.assign(Object.assign({},ak()),{["&-hidden"]:{display:"none"}})},[`${t}-submenu-hidden`]:{display:"none"}},{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Wr(i)),ak()),{marginBottom:0,paddingInlineStart:0,fontSize:n,lineHeight:0,listStyle:"none",outline:"none",transition:[`background ${r}`,`width ${r} cubic-bezier(0.2, 0, 0, 1) 0s`].join(","),["ul, ol"]:{margin:0,padding:0,listStyle:"none"},["&-overflow"]:{display:"flex",[`${t}-item`]:{flex:"none"}},[`${t}-item, ${t}-submenu, ${t}-submenu-title`]:{borderRadius:i.radiusItem},[`${t}-item-group-title`]:{padding:`${l}px ${c}px`,fontSize:n,lineHeight:a,transition:`all ${r}`},[`&-horizontal ${t}-submenu`]:{transition:[`border-color ${r} ${s}`,`background ${r} ${s}`].join(",")},[`${t}-submenu, ${t}-submenu-inline`]:{transition:[`border-color ${r} ${s}`,`background ${r} ${s}`,`padding ${o} ${s}`].join(",")},[`${t}-submenu ${t}-sub`]:{cursor:"initial",transition:[`background ${r} ${s}`,`padding ${r} ${s}`].join(",")},[`${t}-title-content`]:{transition:`color ${r}`},[`${t}-item a`]:{"&::before":{position:"absolute",inset:0,backgroundColor:"transparent",content:'""'}},[`${t}-item-divider`]:{overflow:"hidden",lineHeight:0,borderColor:u,borderStyle:m,borderWidth:0,borderTopWidth:d,marginBlock:d,padding:0,"&-dashed":{borderStyle:"dashed"}}}),Hue(i)),{[`${t}-item-group`]:{[`${t}-item-group-list`]:{margin:0,padding:0,[`${t}-item, ${t}-submenu-title`]:{paddingInline:`${n*2}px ${c}px`}}},"&-submenu":{"&-popup":{position:"absolute",zIndex:h,background:"transparent",borderRadius:f,boxShadow:"none",transformOrigin:"0 0","&::before":{position:"absolute",inset:`${_}px 0 0`,zIndex:-1,width:"100%",height:"100%",opacity:0,content:'""'}},"&-placement-rightTop::before":{top:0,insetInlineStart:_},[`> ${t}`]:Object.assign(Object.assign(Object.assign({borderRadius:f},Hue(i)),Vue(i)),{[`${t}-item, ${t}-submenu > ${t}-submenu-title`]:{borderRadius:g},[`${t}-submenu-title::after`]:{transition:`transform ${r} ${s}`}})}}),Vue(i)),{[`&-inline-collapsed ${t}-submenu-arrow, &-inline ${t}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateX(${v})`},"&::after":{transform:`rotate(45deg) translateX(-${v})`}},[`${t}-submenu-open${t}-submenu-inline > ${t}-submenu-title > ${t}-submenu-arrow`]:{transform:`translateY(-${p*.2}px)`,"&::after":{transform:`rotate(-45deg) translateX(-${v})`},"&::before":{transform:`rotate(45deg) translateX(${v})`}}})},{[`${e}-layout-header`]:{[t]:{lineHeight:"inherit"}}}]},Cwt=(i,e)=>vo("Menu",(n,r)=>{let{overrideComponentToken:o}=r;if(e===!1)return[];const{colorBgElevated:s,colorPrimary:a,colorError:l,colorErrorHover:c,colorTextLightSolid:u,controlHeightLG:d,fontSize:h}=n,f=h/7*5,g=Oi(n,{menuItemHeight:d,menuItemPaddingInline:n.margin,menuArrowSize:f,menuHorizontalHeight:d*1.15,menuArrowOffset:`${f*.25}px`,menuPanelMaskInset:-7,menuSubMenuBg:s}),p=new Yr(u).setAlpha(.65).toRgbString(),v=Oi(g,{colorItemText:p,colorItemTextHover:u,colorGroupTitle:p,colorItemTextSelected:u,colorItemBg:"#001529",colorSubItemBg:"#000c17",colorItemBgActive:"transparent",colorItemBgSelected:a,colorActiveBarWidth:0,colorActiveBarHeight:0,colorActiveBarBorderSize:0,colorItemTextDisabled:new Yr(u).setAlpha(.25).toRgbString(),colorDangerItemText:l,colorDangerItemTextHover:c,colorDangerItemTextSelected:u,colorDangerItemBgActive:l,colorDangerItemBgSelected:l,menuSubMenuBg:"#001529",colorItemTextSelectedHorizontal:u,colorItemBgSelectedHorizontal:a},Object.assign({},o));return[bwt(g),fwt(g),_wt(g),Wue(g,"light"),Wue(v,"dark"),pwt(g),WSe(g),pS(g,"slide-up"),pS(g,"slide-down"),IT(g,"zoom-big")]},n=>{const{colorPrimary:r,colorError:o,colorTextDisabled:s,colorErrorBg:a,colorText:l,colorTextDescription:c,colorBgContainer:u,colorFillAlter:d,colorFillContent:h,lineWidth:f,lineWidthBold:g,controlItemBgActive:p,colorBgTextHover:v}=n;return{dropdownWidth:160,zIndexPopup:n.zIndexPopupBase+50,radiusItem:n.borderRadiusLG,radiusSubMenuItem:n.borderRadiusSM,colorItemText:l,colorItemTextHover:l,colorItemTextHoverHorizontal:r,colorGroupTitle:c,colorItemTextSelected:r,colorItemTextSelectedHorizontal:r,colorItemBg:u,colorItemBgHover:v,colorItemBgActive:h,colorSubItemBg:d,colorItemBgSelected:p,colorItemBgSelectedHorizontal:"transparent",colorActiveBarWidth:0,colorActiveBarHeight:g,colorActiveBarBorderSize:f,colorItemTextDisabled:s,colorDangerItemText:o,colorDangerItemTextHover:o,colorDangerItemTextSelected:o,colorDangerItemBgActive:a,colorDangerItemBgSelected:a,itemMarginInline:n.marginXXS}})(i);var ywt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{children:e}=i,t=ywt(i,["children"]),n=C.useContext(CK),r=C.useMemo(()=>Object.assign(Object.assign({},n),t),[n,t.prefixCls,t.mode,t.selectable]);return C.createElement(CK.Provider,{value:r},e)},zue=CK;var wwt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{prefixCls:e,className:t,dashed:n}=i,r=wwt(i,["prefixCls","className","dashed"]),{getPrefixCls:o}=C.useContext(Rn),s=o("menu",e),a=xe({[`${s}-item-divider-dashed`]:!!n},t);return C.createElement(mQ,Object.assign({className:a},r))},oLe=Swt;globalThis&&globalThis.__rest;const sLe=C.createContext({}),xwt=C.createContext({prefixCls:"",firstLevel:!0,inlineCollapsed:!1}),tF=xwt,Lwt=i=>{var e;const{className:t,children:n,icon:r,title:o,danger:s}=i,{prefixCls:a,firstLevel:l,direction:c,disableMenuItemTitleTooltip:u,inlineCollapsed:d}=C.useContext(tF),h=_=>{const y=C.createElement("span",{className:`${a}-title-content`},n);return(!r||bh(n)&&n.type==="span")&&n&&_&&l&&typeof n=="string"?C.createElement("div",{className:`${a}-inline-collapsed-noicon`},n.charAt(0)):y},{siderCollapsed:f}=C.useContext(sLe);let g=o;typeof o>"u"?g=l?n:"":o===!1&&(g="");const p={title:g};!f&&!d&&(p.title=null,p.open=!1);const v=rd(n).length;let m=C.createElement(H5,Object.assign({},ll(i,["title","icon","danger"]),{className:xe({[`${a}-item-danger`]:s,[`${a}-item-only-child`]:(r?v+1:v)===1},t),title:typeof o=="string"?o:void 0}),Qs(r,{className:xe(bh(r)?(e=r.props)===null||e===void 0?void 0:e.className:"",`${a}-item-icon`)}),h(d));return u||(m=C.createElement(NT,Object.assign({},p,{placement:c==="rtl"?"left":"right",overlayClassName:`${a}-inline-collapsed-tooltip`}),m)),m},aLe=Lwt,Ewt=i=>{var e;const{popupClassName:t,icon:n,title:r,theme:o}=i,s=C.useContext(tF),{prefixCls:a,inlineCollapsed:l,theme:c,mode:u}=s,d=ex();let h;if(!n)h=l&&!d.length&&r&&typeof r=="string"?C.createElement("div",{className:`${a}-inline-collapsed-noicon`},r.charAt(0)):C.createElement("span",{className:`${a}-title-content`},r);else{const p=bh(r)&&r.type==="span";h=C.createElement(C.Fragment,null,Qs(n,{className:xe(bh(n)?(e=n.props)===null||e===void 0?void 0:e.className:"",`${a}-item-icon`)}),p?r:C.createElement("span",{className:`${a}-title-content`},r))}const f=C.useMemo(()=>Object.assign(Object.assign({},s),{firstLevel:!1}),[s]),g=u==="horizontal"?[0,8]:[10,0];return C.createElement(tF.Provider,{value:f},C.createElement(V5,Object.assign({popupOffset:g},ll(i,["icon"]),{title:h,popupClassName:xe(a,t,`${a}-${o||c}`)})))},lLe=Ewt;var Dwt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{if(e&&typeof e=="object"){const n=e,{label:r,children:o,key:s,type:a}=n,l=Dwt(n,["label","children","key","type"]),c=s??`tmp-${t}`;return o||a==="group"?a==="group"?C.createElement(z5,Object.assign({key:c},l,{title:r}),yK(o)):C.createElement(lLe,Object.assign({key:c},l,{title:r}),yK(o)):a==="divider"?C.createElement(oLe,Object.assign({key:c},l)):C.createElement(aLe,Object.assign({key:c},l),r)}return null}).filter(e=>e)}function Iwt(i){return C.useMemo(()=>i&&yK(i),[i])}var kwt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var t,n;const r=C.useContext(zue),o=r||{},{getPrefixCls:s,getPopupContainer:a,direction:l}=C.useContext(Rn),c=s(),{prefixCls:u,className:d,theme:h="light",expandIcon:f,_internalDisableMenuItemTitleTooltip:g,inlineCollapsed:p,siderCollapsed:v,items:m,children:_,rootClassName:y,mode:S,selectable:L,onClick:E}=i,D=kwt(i,["prefixCls","className","theme","expandIcon","_internalDisableMenuItemTitleTooltip","inlineCollapsed","siderCollapsed","items","children","rootClassName","mode","selectable","onClick"]),k=ll(D,["collapsedWidth"]),T=Iwt(m)||_;(t=o.validator)===null||t===void 0||t.call(o,{mode:S});const M=tc(function(){var Y;E==null||E.apply(void 0,arguments),(Y=o.onClick)===null||Y===void 0||Y.call(o)}),A=o.mode||S,N=L??o.selectable,R=C.useMemo(()=>v!==void 0?v:p,[p,v]),F={horizontal:{motionName:`${c}-slide-up`},inline:NSe(c),other:{motionName:`${c}-zoom-big`}},W=s("menu",u||o.prefixCls),[H,G]=Cwt(W,!r),U=xe(`${W}-${h}`,d);let K;if(typeof f=="function")K=f;else{const Y=f||o.expandIcon;K=Qs(Y,{className:xe(`${W}-submenu-expand-icon`,(n=Y==null?void 0:Y.props)===null||n===void 0?void 0:n.className)})}const re=C.useMemo(()=>({prefixCls:W,inlineCollapsed:R||!1,direction:l,firstLevel:!0,theme:h,mode:A,disableMenuItemTitleTooltip:g}),[W,R,l,g,h]);return H(C.createElement(zue.Provider,{value:null},C.createElement(tF.Provider,{value:re},C.createElement(MT,Object.assign({getPopupContainer:a,overflowedIndicator:C.createElement(Gye,null),overflowedIndicatorPopupClassName:`${W}-${h}`,mode:A,selectable:N,onClick:M},k,{inlineCollapsed:R,className:U,prefixCls:W,direction:l,defaultMotions:F,expandIcon:K,ref:e,rootClassName:xe(y,G)}),T))))}),Nwt=Twt,AT=C.forwardRef((i,e)=>{const t=C.useRef(null),n=C.useContext(sLe);return C.useImperativeHandle(e,()=>({menu:t.current,focus:r=>{var o;(o=t.current)===null||o===void 0||o.focus(r)}})),C.createElement(Nwt,Object.assign({ref:t},i,n))});AT.Item=aLe;AT.SubMenu=lLe;AT.Divider=oLe;AT.ItemGroup=z5;const vQ=AT,cLe=()=>{const[i,e]=C.useState(!1);return C.useEffect(()=>{e(J_t())},[]),i};function Rwt(i){let{className:e,direction:t,index:n,marginDirection:r,children:o,split:s,wrap:a}=i;const{horizontalSize:l,verticalSize:c,latestIndex:u,supportFlexGap:d}=C.useContext(uLe);let h={};return d||(t==="vertical"?n{const{getPrefixCls:e,space:t,direction:n}=C.useContext(Rn),{size:r=(t==null?void 0:t.size)||"small",align:o,className:s,rootClassName:a,children:l,direction:c="horizontal",prefixCls:u,split:d,style:h,wrap:f=!1}=i,g=Mwt(i,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap"]),p=cLe(),[v,m]=C.useMemo(()=>(Array.isArray(r)?r:[r,r]).map(F=>Pwt(F)),[r]),_=rd(l,{keepEmpty:!0}),y=o===void 0&&c==="horizontal"?"center":o,S=e("space",u),[L,E]=LSe(S),D=xe(S,E,`${S}-${c}`,{[`${S}-rtl`]:n==="rtl",[`${S}-align-${y}`]:y},s,a),k=`${S}-item`,T=n==="rtl"?"marginLeft":"marginRight";let M=0;const A=_.map((F,W)=>{F!=null&&(M=W);const H=F&&F.key||`${k}-${W}`;return C.createElement(Rwt,{className:k,key:H,direction:c,index:W,marginDirection:T,split:d,wrap:f},F)}),N=C.useMemo(()=>({horizontalSize:v,verticalSize:m,latestIndex:M,supportFlexGap:p}),[v,m,M,p]);if(_.length===0)return null;const R={};return f&&(R.flexWrap="wrap",p||(R.marginBottom=-m)),p&&(R.columnGap=v,R.rowGap=m),L(C.createElement("div",Object.assign({className:D,style:Object.assign(Object.assign({},R),h)},g),C.createElement(uLe.Provider,{value:N},A)))},dLe=Owt;dLe.Compact=e_t;const wK=dLe,Fwt=i=>{const{componentCls:e,menuCls:t,colorError:n,colorTextLightSolid:r}=i,o=`${t}-item`;return{[`${e}, ${e}-menu-submenu`]:{[`${t} ${o}`]:{[`&${o}-danger:not(${o}-disabled)`]:{color:n,"&:hover":{color:r,backgroundColor:n}}}}}},Bwt=Fwt,Wwt=i=>{const{componentCls:e,menuCls:t,zIndexPopup:n,dropdownArrowDistance:r,sizePopupArrow:o,antCls:s,iconCls:a,motionDurationMid:l,dropdownPaddingVertical:c,fontSize:u,dropdownEdgeChildPadding:d,colorTextDisabled:h,fontSizeIcon:f,controlPaddingHorizontal:g,colorBgElevated:p}=i;return[{[e]:Object.assign(Object.assign({},Wr(i)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:n,display:"block","&::before":{position:"absolute",insetBlock:-r+o/2,zIndex:-9999,opacity:1e-4,content:'""'},[`&-trigger${s}-btn > ${a}-down`]:{fontSize:f,transform:"none"},[`${e}-wrap`]:{position:"relative",[`${s}-btn > ${a}-down`]:{fontSize:f},[`${a}-down::before`]:{transition:`transform ${l}`}},[`${e}-wrap-open`]:{[`${a}-down::before`]:{transform:"rotate(180deg)"}},[` &-hidden, &-menu-hidden, @@ -1039,7 +1039,7 @@ html body { &${s}-slide-down-leave${s}-slide-down-leave-active${e}-placement-bottomRight`]:{animationName:GZ},[`&${s}-slide-up-leave${s}-slide-up-leave-active${e}-placement-topLeft, &${s}-slide-up-leave${s}-slide-up-leave-active${e}-placement-top, &${s}-slide-up-leave${s}-slide-up-leave-active${e}-placement-topRight`]:{animationName:XZ}})},oQ(i,{colorBg:p,limitVerticalRadius:!0,arrowPlacement:{top:!0,bottom:!0}}),{[`${e} ${t}`]:{position:"relative",margin:0},[`${t}-submenu-popup`]:{position:"absolute",zIndex:n,background:"transparent",boxShadow:"none",transformOrigin:"0 0","ul, li":{listStyle:"none",margin:0}},[`${e}, ${e}-menu-submenu`]:{[t]:Object.assign(Object.assign({padding:d,listStyleType:"none",backgroundColor:p,backgroundClip:"padding-box",borderRadius:i.borderRadiusLG,outline:"none",boxShadow:i.boxShadowSecondary},lk(i)),{[`${t}-item-group-title`]:{padding:`${c}px ${g}px`,color:i.colorTextDescription,transition:`all ${l}`},[`${t}-item`]:{position:"relative",display:"flex",alignItems:"center"},[`${t}-item-icon`]:{minWidth:u,marginInlineEnd:i.marginXS,fontSize:i.fontSizeSM},[`${t}-title-content`]:{flex:"auto","> a":{color:"inherit",transition:`all ${l}`,"&:hover":{color:"inherit"},"&::after":{position:"absolute",inset:0,content:'""'}}},[`${t}-item, ${t}-submenu-title`]:Object.assign(Object.assign({clear:"both",margin:0,padding:`${c}px ${g}px`,color:i.colorText,fontWeight:"normal",fontSize:u,lineHeight:i.lineHeight,cursor:"pointer",transition:`all ${l}`,borderRadius:i.borderRadiusSM,["&:hover, &-active"]:{backgroundColor:i.controlItemBgHover}},lk(i)),{"&-selected":{color:i.colorPrimary,backgroundColor:i.controlItemBgActive,"&:hover, &-active":{backgroundColor:i.controlItemBgActiveHover}},"&-disabled":{color:h,cursor:"not-allowed","&:hover":{color:h,backgroundColor:p,cursor:"not-allowed"},a:{pointerEvents:"none"}},"&-divider":{height:1,margin:`${i.marginXXS}px 0`,overflow:"hidden",lineHeight:0,backgroundColor:i.colorSplit},[`${e}-menu-submenu-expand-icon`]:{position:"absolute",insetInlineEnd:i.paddingXS,[`${e}-menu-submenu-arrow-icon`]:{marginInlineEnd:"0 !important",color:i.colorTextDescription,fontSize:f,fontStyle:"normal"}}}),[`${t}-item-group-list`]:{margin:`0 ${i.marginXS}px`,padding:0,listStyle:"none"},[`${t}-submenu-title`]:{paddingInlineEnd:g+i.fontSizeSM},[`${t}-submenu-vertical`]:{position:"relative"},[`${t}-submenu${t}-submenu-disabled ${e}-menu-submenu-title`]:{[`&, ${e}-menu-submenu-arrow-icon`]:{color:h,backgroundColor:p,cursor:"not-allowed"}},[`${t}-submenu-selected ${e}-menu-submenu-title`]:{color:i.colorPrimary}})}},[pS(i,"slide-up"),pS(i,"slide-down"),qO(i,"move-up"),qO(i,"move-down"),IT(i,"zoom-big")]]},hLe=vo("Dropdown",(i,e)=>{let{rootPrefixCls:t}=e;const{marginXXS:n,sizePopupArrow:r,controlHeight:o,fontSize:s,lineHeight:a,paddingXXS:l,componentCls:c,borderRadiusLG:u}=i,d=(o-s*a)/2,{dropdownArrowOffset:h}=rQ({contentRadius:u}),f=Oi(i,{menuCls:`${c}-menu`,rootPrefixCls:t,dropdownArrowDistance:r/2+n,dropdownArrowOffset:h,dropdownPaddingVertical:d,dropdownEdgeChildPadding:l});return[Wwt(f),Bwt(f)]},i=>({zIndexPopup:i.zIndexPopupBase+50}));var $wt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{getPopupContainer:e,getPrefixCls:t,direction:n}=C.useContext(Rn),{prefixCls:r,type:o="default",danger:s,disabled:a,loading:l,onClick:c,htmlType:u,children:d,className:h,menu:f,arrow:g,autoFocus:p,overlay:v,trigger:m,align:_,open:y,onOpenChange:S,placement:L,getPopupContainer:E,href:D,icon:k=C.createElement(Gye,null),title:T,buttonsRender:M=We=>We,mouseEnterDelay:A,mouseLeaveDelay:N,overlayClassName:R,overlayStyle:F,destroyPopupOnHide:W,dropdownRender:H}=i,G=$wt(i,["prefixCls","type","danger","disabled","loading","onClick","htmlType","children","className","menu","arrow","autoFocus","overlay","trigger","align","open","onOpenChange","placement","getPopupContainer","href","icon","title","buttonsRender","mouseEnterDelay","mouseLeaveDelay","overlayClassName","overlayStyle","destroyPopupOnHide","dropdownRender"]),U=t("dropdown",r),K=`${U}-button`,[re,Y]=hLe(U),J={menu:f,arrow:g,autoFocus:p,align:_,disabled:a,trigger:a?[]:m,onOpenChange:S,getPopupContainer:E||e,mouseEnterDelay:A,mouseLeaveDelay:N,overlayClassName:R,overlayStyle:F,destroyPopupOnHide:W,dropdownRender:H},{compactSize:Q,compactItemClassnames:ue}=QS(U,n),de=xe(K,ue,h,Y);"overlay"in i&&(J.overlay=v),"open"in i&&(J.open=y),"placement"in i?J.placement=L:J.placement=n==="rtl"?"bottomLeft":"bottomRight";const _e=C.createElement(Ju,{type:o,danger:s,disabled:a,loading:l,onClick:c,htmlType:u,href:D,title:T},d),ve=C.createElement(Ju,{type:o,danger:s,icon:k}),[Ve,Ze]=M([_e,ve]);return re(C.createElement(wK.Compact,Object.assign({className:de,size:Q,block:!0},G),Ve,C.createElement(hk,Object.assign({},J),Ze)))};fLe.__ANT_BUTTON=!0;const Hwt=fLe,U5=i=>{const{menu:e,arrow:t,prefixCls:n,children:r,trigger:o,disabled:s,dropdownRender:a,getPopupContainer:l,overlayClassName:c,rootClassName:u,open:d,onOpenChange:h,visible:f,onVisibleChange:g,mouseEnterDelay:p=.15,mouseLeaveDelay:v=.1,autoAdjustOverflow:m=!0,placement:_="",overlay:y,transitionName:S}=i,{getPopupContainer:L,getPrefixCls:E,direction:D}=C.useContext(Rn),k=C.useMemo(()=>{const de=E();return S!==void 0?S:_.includes("top")?`${de}-slide-down`:`${de}-slide-up`},[E,_,S]),T=C.useMemo(()=>_?_.includes("Center")?_.slice(0,_.indexOf("Center")):_:D==="rtl"?"bottomRight":"bottomLeft",[_,D]),M=E("dropdown",n),[A,N]=hLe(M),{token:R}=Lxe.useToken(),F=C.Children.only(r),W=Qs(F,{className:xe(`${M}-trigger`,{[`${M}-rtl`]:D==="rtl"},F.props.className),disabled:s}),H=s?[]:o;let G;H&&H.includes("contextMenu")&&(G=!0);const[U,K]=Ja(!1,{value:d??f}),re=tc(de=>{h==null||h(de),g==null||g(de),K(de)}),Y=xe(c,u,N,{[`${M}-rtl`]:D==="rtl"}),J=xxe({arrowPointAtCenter:typeof t=="object"&&t.pointAtCenter,autoAdjustOverflow:m,offset:R.marginXXS,arrowWidth:t?R.sizePopupArrow:0,borderRadius:R.borderRadius}),Q=C.useCallback(()=>{K(!1)},[]),ue=()=>{let de;return e!=null&&e.items?de=C.createElement(vQ,Object.assign({},e)):typeof y=="function"?de=y():de=y,a&&(de=a(de)),de=C.Children.only(typeof de=="string"?C.createElement("span",null,de):de),C.createElement(rLe,{prefixCls:`${M}-menu`,expandIcon:C.createElement("span",{className:`${M}-menu-submenu-arrow`},C.createElement(Dj,{className:`${M}-menu-submenu-arrow-icon`})),mode:"vertical",selectable:!1,onClick:Q,validator:_e=>{}},C.createElement(gS,null,de))};return A(C.createElement(kyt,Object.assign({alignPoint:G},ll(i,["rootClassName"]),{mouseEnterDelay:p,mouseLeaveDelay:v,visible:U,builtinPlacements:J,arrow:!!t,overlayClassName:Y,prefixCls:M,getPopupContainer:l||L,transitionName:k,trigger:H,overlay:ue,placement:T,onVisibleChange:re}),W))};U5.Button=Hwt;const Vwt=gxe(U5,"dropdown",i=>i),zwt=i=>C.createElement(Vwt,Object.assign({},i),C.createElement("span",null));U5._InternalPanelDoNotUseOrYouWillBeFired=zwt;const hk=U5,gLe=C.createContext(null),Uwt=gLe.Provider,pLe=C.createContext(null),jwt=pLe.Provider;var Kwt=["prefixCls","className","style","checked","disabled","defaultChecked","type","onChange"],mLe=C.forwardRef(function(i,e){var t,n=i.prefixCls,r=n===void 0?"rc-checkbox":n,o=i.className,s=i.style,a=i.checked,l=i.disabled,c=i.defaultChecked,u=c===void 0?!1:c,d=i.type,h=d===void 0?"checkbox":d,f=i.onChange,g=Nn(i,Kwt),p=C.useRef(null),v=Ja(u,{value:a}),m=Ae(v,2),_=m[0],y=m[1];C.useImperativeHandle(e,function(){return{focus:function(){var D;(D=p.current)===null||D===void 0||D.focus()},blur:function(){var D;(D=p.current)===null||D===void 0||D.blur()},input:p.current}});var S=xe(r,o,(t={},be(t,"".concat(r,"-checked"),_),be(t,"".concat(r,"-disabled"),l),t)),L=function(D){l||("checked"in i||y(D.target.checked),f==null||f({target:te(te({},i),{},{checked:D.target.checked}),stopPropagation:function(){D.stopPropagation()},preventDefault:function(){D.preventDefault()},nativeEvent:D.nativeEvent}))};return C.createElement("span",{className:S,style:s},C.createElement("input",St({},g,{className:"".concat(r,"-input"),ref:p,onChange:L,disabled:l,checked:!!_,type:h})),C.createElement("span",{className:"".concat(r,"-inner")}))});const Gwt=new mi("antRadioEffect",{"0%":{transform:"scale(1)",opacity:.5},"100%":{transform:"scale(1.6)",opacity:0}}),qwt=i=>{const{componentCls:e,antCls:t}=i,n=`${e}-group`;return{[n]:Object.assign(Object.assign({},Wr(i)),{display:"inline-block",fontSize:0,[`&${n}-rtl`]:{direction:"rtl"},[`${t}-badge ${t}-badge-count`]:{zIndex:1},[`> ${t}-badge:not(:first-child) > ${t}-button-wrapper`]:{borderInlineStart:"none"}})}},Xwt=i=>{const{componentCls:e,radioWrapperMarginRight:t,radioCheckedColor:n,radioSize:r,motionDurationSlow:o,motionDurationMid:s,motionEaseInOut:a,motionEaseInOutCirc:l,radioButtonBg:c,colorBorder:u,lineWidth:d,radioDotSize:h,colorBgContainerDisabled:f,colorTextDisabled:g,paddingXS:p,radioDotDisabledColor:v,lineType:m,radioDotDisabledSize:_,wireframe:y,colorWhite:S}=i,L=`${e}-inner`;return{[`${e}-wrapper`]:Object.assign(Object.assign({},Wr(i)),{position:"relative",display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:t,cursor:"pointer",[`&${e}-wrapper-rtl`]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:i.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},[`${e}-checked::after`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:`${d}px ${m} ${n}`,borderRadius:"50%",visibility:"hidden",animationName:Gwt,animationDuration:o,animationTimingFunction:a,animationFillMode:"both",content:'""'},[e]:Object.assign(Object.assign({},Wr(i)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center"}),[`${e}-wrapper:hover &, - &:hover ${L}`]:{borderColor:n},[`${e}-input:focus-visible + ${L}`]:Object.assign({},Op(i)),[`${e}:hover::after, ${e}-wrapper:hover &::after`]:{visibility:"visible"},[`${e}-inner`]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:r,height:r,marginBlockStart:r/-2,marginInlineStart:r/-2,backgroundColor:y?n:S,borderBlockStart:0,borderInlineStart:0,borderRadius:r,transform:"scale(0)",opacity:0,transition:`all ${o} ${l}`,content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:r,height:r,backgroundColor:c,borderColor:u,borderStyle:"solid",borderWidth:d,borderRadius:"50%",transition:`all ${s}`},[`${e}-input`]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,insetBlockEnd:0,insetInlineStart:0,zIndex:1,cursor:"pointer",opacity:0},[`${e}-checked`]:{[L]:{borderColor:n,backgroundColor:y?c:n,"&::after":{transform:`scale(${h/r})`,opacity:1,transition:`all ${o} ${l}`}}},[`${e}-disabled`]:{cursor:"not-allowed",[L]:{backgroundColor:f,borderColor:u,cursor:"not-allowed","&::after":{backgroundColor:v}},[`${e}-input`]:{cursor:"not-allowed"},[`${e}-disabled + span`]:{color:g,cursor:"not-allowed"},[`&${e}-checked`]:{[L]:{"&::after":{transform:`scale(${_/r})`}}}},[`span${e} + *`]:{paddingInlineStart:p,paddingInlineEnd:p}})}},Ywt=i=>{const{radioButtonColor:e,controlHeight:t,componentCls:n,lineWidth:r,lineType:o,colorBorder:s,motionDurationSlow:a,motionDurationMid:l,radioButtonPaddingHorizontal:c,fontSize:u,radioButtonBg:d,fontSizeLG:h,controlHeightLG:f,controlHeightSM:g,paddingXS:p,borderRadius:v,borderRadiusSM:m,borderRadiusLG:_,radioCheckedColor:y,radioButtonCheckedBg:S,radioButtonHoverColor:L,radioButtonActiveColor:E,radioSolidCheckedColor:D,colorTextDisabled:k,colorBgContainerDisabled:T,radioDisabledButtonCheckedColor:M,radioDisabledButtonCheckedBg:A}=i;return{[`${n}-button-wrapper`]:{position:"relative",display:"inline-block",height:t,margin:0,paddingInline:c,paddingBlock:0,color:e,fontSize:u,lineHeight:`${t-r*2}px`,background:d,border:`${r}px ${o} ${s}`,borderBlockStartWidth:r+.02,borderInlineStartWidth:0,borderInlineEndWidth:r,cursor:"pointer",transition:[`color ${l}`,`background ${l}`,`border-color ${l}`,`box-shadow ${l}`].join(","),a:{color:e},[`> ${n}-button`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:-r,insetInlineStart:-r,display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:r,paddingInline:0,backgroundColor:s,transition:`background-color ${a}`,content:'""'}},"&:first-child":{borderInlineStart:`${r}px ${o} ${s}`,borderStartStartRadius:v,borderEndStartRadius:v},"&:last-child":{borderStartEndRadius:v,borderEndEndRadius:v},"&:first-child:last-child":{borderRadius:v},[`${n}-group-large &`]:{height:f,fontSize:h,lineHeight:`${f-r*2}px`,"&:first-child":{borderStartStartRadius:_,borderEndStartRadius:_},"&:last-child":{borderStartEndRadius:_,borderEndEndRadius:_}},[`${n}-group-small &`]:{height:g,paddingInline:p-r,paddingBlock:0,lineHeight:`${g-r*2}px`,"&:first-child":{borderStartStartRadius:m,borderEndStartRadius:m},"&:last-child":{borderStartEndRadius:m,borderEndEndRadius:m}},"&:hover":{position:"relative",color:y},"&:has(:focus-visible)":Object.assign({},Op(i)),[`${n}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:"none"},[`&-checked:not(${n}-button-wrapper-disabled)`]:{zIndex:1,color:y,background:S,borderColor:y,"&::before":{backgroundColor:y},"&:first-child":{borderColor:y},"&:hover":{color:L,borderColor:L,"&::before":{backgroundColor:L}},"&:active":{color:E,borderColor:E,"&::before":{backgroundColor:E}}},[`${n}-group-solid &-checked:not(${n}-button-wrapper-disabled)`]:{color:D,background:y,borderColor:y,"&:hover":{color:D,background:L,borderColor:L},"&:active":{color:D,background:E,borderColor:E}},"&-disabled":{color:k,backgroundColor:T,borderColor:s,cursor:"not-allowed","&:first-child, &:hover":{color:k,backgroundColor:T,borderColor:s}},[`&-disabled${n}-button-wrapper-checked`]:{color:M,backgroundColor:A,borderColor:s,boxShadow:"none"}}}},vLe=vo("Radio",i=>{const{padding:e,lineWidth:t,controlItemBgActiveDisabled:n,colorTextDisabled:r,colorBgContainer:o,fontSizeLG:s,controlOutline:a,colorPrimaryHover:l,colorPrimaryActive:c,colorText:u,colorPrimary:d,marginXS:h,controlOutlineWidth:f,colorTextLightSolid:g,wireframe:p}=i,v=`0 0 0 ${f}px ${a}`,m=v,_=s,y=4,S=_-y*2,L=p?S:_-(y+t)*2,E=d,D=u,k=l,T=c,M=e-t,R=Oi(i,{radioFocusShadow:v,radioButtonFocusShadow:m,radioSize:_,radioDotSize:L,radioDotDisabledSize:S,radioCheckedColor:E,radioDotDisabledColor:r,radioSolidCheckedColor:g,radioButtonBg:o,radioButtonCheckedBg:o,radioButtonColor:D,radioButtonHoverColor:k,radioButtonActiveColor:T,radioButtonPaddingHorizontal:M,radioDisabledButtonCheckedBg:n,radioDisabledButtonCheckedColor:r,radioWrapperMarginRight:h});return[qwt(R),Xwt(R),Ywt(R)]});var Zwt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var t,n;const r=C.useContext(gLe),o=C.useContext(pLe),{getPrefixCls:s,direction:a}=C.useContext(Rn),l=C.useRef(null),c=vu(e,l),{isFormItemInput:u}=C.useContext(Zf),d=T=>{var M,A;(M=i.onChange)===null||M===void 0||M.call(i,T),(A=r==null?void 0:r.onChange)===null||A===void 0||A.call(r,T)},{prefixCls:h,className:f,rootClassName:g,children:p,style:v}=i,m=Zwt(i,["prefixCls","className","rootClassName","children","style"]),_=s("radio",h),y=((r==null?void 0:r.optionType)||o)==="button"?`${_}-button`:_,[S,L]=vLe(_),E=Object.assign({},m),D=C.useContext(H_);r&&(E.name=r.name,E.onChange=d,E.checked=i.value===r.value,E.disabled=(t=E.disabled)!==null&&t!==void 0?t:r.disabled),E.disabled=(n=E.disabled)!==null&&n!==void 0?n:D;const k=xe(`${y}-wrapper`,{[`${y}-wrapper-checked`]:E.checked,[`${y}-wrapper-disabled`]:E.disabled,[`${y}-wrapper-rtl`]:a==="rtl",[`${y}-wrapper-in-form-item`]:u},f,g,L);return S(C.createElement("label",{className:k,style:v,onMouseEnter:i.onMouseEnter,onMouseLeave:i.onMouseLeave},C.createElement(mLe,Object.assign({},E,{type:"radio",prefixCls:y,ref:c})),p!==void 0?C.createElement("span",null,p):null))},Jwt=C.forwardRef(Qwt),nF=Jwt,eSt=C.forwardRef((i,e)=>{const{getPrefixCls:t,direction:n}=C.useContext(Rn),r=C.useContext(Rh),[o,s]=Ja(i.defaultValue,{value:i.value}),a=R=>{const F=o,W=R.target.value;"value"in i||s(W);const{onChange:H}=i;H&&W!==F&&H(R)},{prefixCls:l,className:c,rootClassName:u,options:d,buttonStyle:h="outline",disabled:f,children:g,size:p,style:v,id:m,onMouseEnter:_,onMouseLeave:y,onFocus:S,onBlur:L}=i,E=t("radio",l),D=`${E}-group`,[k,T]=vLe(E);let M=g;d&&d.length>0&&(M=d.map(R=>typeof R=="string"||typeof R=="number"?C.createElement(nF,{key:R.toString(),prefixCls:E,disabled:f,value:R,checked:o===R},R):C.createElement(nF,{key:`radio-group-value-options-${R.value}`,prefixCls:E,disabled:R.disabled||f,value:R.value,checked:o===R.value,style:R.style},R.label)));const A=p||r,N=xe(D,`${D}-${h}`,{[`${D}-${A}`]:A,[`${D}-rtl`]:n==="rtl"},c,u,T);return k(C.createElement("div",Object.assign({},uvt(i),{className:N,style:v,onMouseEnter:_,onMouseLeave:y,onFocus:S,onBlur:L,id:m,ref:e}),C.createElement(Uwt,{value:{onChange:a,value:o,disabled:i.disabled,name:i.name,optionType:i.optionType}},M)))}),tSt=C.memo(eSt);var nSt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{getPrefixCls:t}=C.useContext(Rn),{prefixCls:n}=i,r=nSt(i,["prefixCls"]),o=t("radio",n);return C.createElement(jwt,{value:"button"},C.createElement(nF,Object.assign({prefixCls:o},r,{type:"radio",ref:e})))},rSt=C.forwardRef(iSt),j5=nF;j5.Button=rSt;j5.Group=tSt;j5.__ANT_RADIO=!0;const _Le=j5,bLe=i=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:i,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),PT=i=>({borderColor:i.inputBorderHoverColor,borderInlineEndWidth:i.lineWidth}),iF=i=>({borderColor:i.inputBorderHoverColor,boxShadow:`0 0 0 ${i.controlOutlineWidth}px ${i.controlOutline}`,borderInlineEndWidth:i.lineWidth,outline:0}),_Q=i=>({color:i.colorTextDisabled,backgroundColor:i.colorBgContainerDisabled,borderColor:i.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover":Object.assign({},PT(Oi(i,{inputBorderHoverColor:i.colorBorder})))}),CLe=i=>{const{inputPaddingVerticalLG:e,fontSizeLG:t,lineHeightLG:n,borderRadiusLG:r,inputPaddingHorizontalLG:o}=i;return{padding:`${e}px ${o}px`,fontSize:t,lineHeight:n,borderRadius:r}},bQ=i=>({padding:`${i.inputPaddingVerticalSM}px ${i.controlPaddingHorizontalSM-1}px`,borderRadius:i.borderRadiusSM}),K5=(i,e)=>{const{componentCls:t,colorError:n,colorWarning:r,colorErrorOutline:o,colorWarningOutline:s,colorErrorBorderHover:a,colorWarningBorderHover:l}=i;return{[`&-status-error:not(${e}-disabled):not(${e}-borderless)${e}`]:{borderColor:n,"&:hover":{borderColor:a},"&:focus, &-focused":Object.assign({},iF(Oi(i,{inputBorderActiveColor:n,inputBorderHoverColor:n,controlOutline:o}))),[`${t}-prefix, ${t}-suffix`]:{color:n}},[`&-status-warning:not(${e}-disabled):not(${e}-borderless)${e}`]:{borderColor:r,"&:hover":{borderColor:l},"&:focus, &-focused":Object.assign({},iF(Oi(i,{inputBorderActiveColor:r,inputBorderHoverColor:r,controlOutline:s}))),[`${t}-prefix, ${t}-suffix`]:{color:r}}}},OT=i=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${i.inputPaddingVertical}px ${i.inputPaddingHorizontal}px`,color:i.colorText,fontSize:i.fontSize,lineHeight:i.lineHeight,backgroundColor:i.colorBgContainer,backgroundImage:"none",borderWidth:i.lineWidth,borderStyle:i.lineType,borderColor:i.colorBorder,borderRadius:i.borderRadius,transition:`all ${i.motionDurationMid}`},bLe(i.colorTextPlaceholder)),{"&:hover":Object.assign({},PT(i)),"&:focus, &-focused":Object.assign({},iF(i)),"&-disabled, &[disabled]":Object.assign({},_Q(i)),"&-borderless":{"&, &:hover, &:focus, &-focused, &-disabled, &[disabled]":{backgroundColor:"transparent",border:"none",boxShadow:"none"}},"textarea&":{maxWidth:"100%",height:"auto",minHeight:i.controlHeight,lineHeight:i.lineHeight,verticalAlign:"bottom",transition:`all ${i.motionDurationSlow}, height 0s`,resize:"vertical"},"&-lg":Object.assign({},CLe(i)),"&-sm":Object.assign({},bQ(i)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),yLe=i=>{const{componentCls:e,antCls:t}=i;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,["&[class*='col-']"]:{paddingInlineEnd:i.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${e}, &-lg > ${e}-group-addon`]:Object.assign({},CLe(i)),[`&-sm ${e}, &-sm > ${e}-group-addon`]:Object.assign({},bQ(i)),[`&-lg ${t}-select-single ${t}-select-selector`]:{height:i.controlHeightLG},[`&-sm ${t}-select-single ${t}-select-selector`]:{height:i.controlHeightSM},[`> ${e}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${e}-group`]:{["&-addon, &-wrap"]:{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:`0 ${i.inputPaddingHorizontal}px`,color:i.colorText,fontWeight:"normal",fontSize:i.fontSize,textAlign:"center",backgroundColor:i.colorFillAlter,border:`${i.lineWidth}px ${i.lineType} ${i.colorBorder}`,borderRadius:i.borderRadius,transition:`all ${i.motionDurationSlow}`,lineHeight:1,[`${t}-select`]:{margin:`-${i.inputPaddingVertical+1}px -${i.inputPaddingHorizontal}px`,[`&${t}-select-single:not(${t}-select-customize-input)`]:{[`${t}-select-selector`]:{backgroundColor:"inherit",border:`${i.lineWidth}px ${i.lineType} transparent`,boxShadow:"none"}},"&-open, &-focused":{[`${t}-select-selector`]:{color:i.colorPrimary}}},[`${t}-cascader-picker`]:{margin:`-9px -${i.inputPaddingHorizontal}px`,backgroundColor:"transparent",[`${t}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}},[`${e}`]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${e}-search-with-button &`]:{zIndex:0}}},[`> ${e}:first-child, ${e}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${t}-select ${t}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${e}-affix-wrapper`]:{[`&:not(:first-child) ${e}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${e}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${e}:last-child, ${e}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${t}-select ${t}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${e}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${e}-search &`]:{borderStartStartRadius:i.borderRadius,borderEndStartRadius:i.borderRadius}},[`&:not(:first-child), ${e}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${e}-group-compact`]:Object.assign(Object.assign({display:"block"},ak()),{[`${e}-group-addon, ${e}-group-wrap, > ${e}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:i.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},[`& > ${e}-affix-wrapper`]:{display:"inline-flex"},[`& > ${t}-picker-range`]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:-i.lineWidth,borderInlineEndWidth:i.lineWidth},[`${e}`]:{float:"none"},[`& > ${t}-select > ${t}-select-selector, + &:hover ${L}`]:{borderColor:n},[`${e}-input:focus-visible + ${L}`]:Object.assign({},Fp(i)),[`${e}:hover::after, ${e}-wrapper:hover &::after`]:{visibility:"visible"},[`${e}-inner`]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:r,height:r,marginBlockStart:r/-2,marginInlineStart:r/-2,backgroundColor:y?n:S,borderBlockStart:0,borderInlineStart:0,borderRadius:r,transform:"scale(0)",opacity:0,transition:`all ${o} ${l}`,content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:r,height:r,backgroundColor:c,borderColor:u,borderStyle:"solid",borderWidth:d,borderRadius:"50%",transition:`all ${s}`},[`${e}-input`]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,insetBlockEnd:0,insetInlineStart:0,zIndex:1,cursor:"pointer",opacity:0},[`${e}-checked`]:{[L]:{borderColor:n,backgroundColor:y?c:n,"&::after":{transform:`scale(${h/r})`,opacity:1,transition:`all ${o} ${l}`}}},[`${e}-disabled`]:{cursor:"not-allowed",[L]:{backgroundColor:f,borderColor:u,cursor:"not-allowed","&::after":{backgroundColor:v}},[`${e}-input`]:{cursor:"not-allowed"},[`${e}-disabled + span`]:{color:g,cursor:"not-allowed"},[`&${e}-checked`]:{[L]:{"&::after":{transform:`scale(${_/r})`}}}},[`span${e} + *`]:{paddingInlineStart:p,paddingInlineEnd:p}})}},Ywt=i=>{const{radioButtonColor:e,controlHeight:t,componentCls:n,lineWidth:r,lineType:o,colorBorder:s,motionDurationSlow:a,motionDurationMid:l,radioButtonPaddingHorizontal:c,fontSize:u,radioButtonBg:d,fontSizeLG:h,controlHeightLG:f,controlHeightSM:g,paddingXS:p,borderRadius:v,borderRadiusSM:m,borderRadiusLG:_,radioCheckedColor:y,radioButtonCheckedBg:S,radioButtonHoverColor:L,radioButtonActiveColor:E,radioSolidCheckedColor:D,colorTextDisabled:k,colorBgContainerDisabled:T,radioDisabledButtonCheckedColor:M,radioDisabledButtonCheckedBg:A}=i;return{[`${n}-button-wrapper`]:{position:"relative",display:"inline-block",height:t,margin:0,paddingInline:c,paddingBlock:0,color:e,fontSize:u,lineHeight:`${t-r*2}px`,background:d,border:`${r}px ${o} ${s}`,borderBlockStartWidth:r+.02,borderInlineStartWidth:0,borderInlineEndWidth:r,cursor:"pointer",transition:[`color ${l}`,`background ${l}`,`border-color ${l}`,`box-shadow ${l}`].join(","),a:{color:e},[`> ${n}-button`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:-r,insetInlineStart:-r,display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:r,paddingInline:0,backgroundColor:s,transition:`background-color ${a}`,content:'""'}},"&:first-child":{borderInlineStart:`${r}px ${o} ${s}`,borderStartStartRadius:v,borderEndStartRadius:v},"&:last-child":{borderStartEndRadius:v,borderEndEndRadius:v},"&:first-child:last-child":{borderRadius:v},[`${n}-group-large &`]:{height:f,fontSize:h,lineHeight:`${f-r*2}px`,"&:first-child":{borderStartStartRadius:_,borderEndStartRadius:_},"&:last-child":{borderStartEndRadius:_,borderEndEndRadius:_}},[`${n}-group-small &`]:{height:g,paddingInline:p-r,paddingBlock:0,lineHeight:`${g-r*2}px`,"&:first-child":{borderStartStartRadius:m,borderEndStartRadius:m},"&:last-child":{borderStartEndRadius:m,borderEndEndRadius:m}},"&:hover":{position:"relative",color:y},"&:has(:focus-visible)":Object.assign({},Fp(i)),[`${n}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:"none"},[`&-checked:not(${n}-button-wrapper-disabled)`]:{zIndex:1,color:y,background:S,borderColor:y,"&::before":{backgroundColor:y},"&:first-child":{borderColor:y},"&:hover":{color:L,borderColor:L,"&::before":{backgroundColor:L}},"&:active":{color:E,borderColor:E,"&::before":{backgroundColor:E}}},[`${n}-group-solid &-checked:not(${n}-button-wrapper-disabled)`]:{color:D,background:y,borderColor:y,"&:hover":{color:D,background:L,borderColor:L},"&:active":{color:D,background:E,borderColor:E}},"&-disabled":{color:k,backgroundColor:T,borderColor:s,cursor:"not-allowed","&:first-child, &:hover":{color:k,backgroundColor:T,borderColor:s}},[`&-disabled${n}-button-wrapper-checked`]:{color:M,backgroundColor:A,borderColor:s,boxShadow:"none"}}}},vLe=vo("Radio",i=>{const{padding:e,lineWidth:t,controlItemBgActiveDisabled:n,colorTextDisabled:r,colorBgContainer:o,fontSizeLG:s,controlOutline:a,colorPrimaryHover:l,colorPrimaryActive:c,colorText:u,colorPrimary:d,marginXS:h,controlOutlineWidth:f,colorTextLightSolid:g,wireframe:p}=i,v=`0 0 0 ${f}px ${a}`,m=v,_=s,y=4,S=_-y*2,L=p?S:_-(y+t)*2,E=d,D=u,k=l,T=c,M=e-t,R=Oi(i,{radioFocusShadow:v,radioButtonFocusShadow:m,radioSize:_,radioDotSize:L,radioDotDisabledSize:S,radioCheckedColor:E,radioDotDisabledColor:r,radioSolidCheckedColor:g,radioButtonBg:o,radioButtonCheckedBg:o,radioButtonColor:D,radioButtonHoverColor:k,radioButtonActiveColor:T,radioButtonPaddingHorizontal:M,radioDisabledButtonCheckedBg:n,radioDisabledButtonCheckedColor:r,radioWrapperMarginRight:h});return[qwt(R),Xwt(R),Ywt(R)]});var Zwt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var t,n;const r=C.useContext(gLe),o=C.useContext(pLe),{getPrefixCls:s,direction:a}=C.useContext(Rn),l=C.useRef(null),c=vu(e,l),{isFormItemInput:u}=C.useContext(Zf),d=T=>{var M,A;(M=i.onChange)===null||M===void 0||M.call(i,T),(A=r==null?void 0:r.onChange)===null||A===void 0||A.call(r,T)},{prefixCls:h,className:f,rootClassName:g,children:p,style:v}=i,m=Zwt(i,["prefixCls","className","rootClassName","children","style"]),_=s("radio",h),y=((r==null?void 0:r.optionType)||o)==="button"?`${_}-button`:_,[S,L]=vLe(_),E=Object.assign({},m),D=C.useContext($_);r&&(E.name=r.name,E.onChange=d,E.checked=i.value===r.value,E.disabled=(t=E.disabled)!==null&&t!==void 0?t:r.disabled),E.disabled=(n=E.disabled)!==null&&n!==void 0?n:D;const k=xe(`${y}-wrapper`,{[`${y}-wrapper-checked`]:E.checked,[`${y}-wrapper-disabled`]:E.disabled,[`${y}-wrapper-rtl`]:a==="rtl",[`${y}-wrapper-in-form-item`]:u},f,g,L);return S(C.createElement("label",{className:k,style:v,onMouseEnter:i.onMouseEnter,onMouseLeave:i.onMouseLeave},C.createElement(mLe,Object.assign({},E,{type:"radio",prefixCls:y,ref:c})),p!==void 0?C.createElement("span",null,p):null))},Jwt=C.forwardRef(Qwt),nF=Jwt,eSt=C.forwardRef((i,e)=>{const{getPrefixCls:t,direction:n}=C.useContext(Rn),r=C.useContext(Rh),[o,s]=Ja(i.defaultValue,{value:i.value}),a=R=>{const F=o,W=R.target.value;"value"in i||s(W);const{onChange:H}=i;H&&W!==F&&H(R)},{prefixCls:l,className:c,rootClassName:u,options:d,buttonStyle:h="outline",disabled:f,children:g,size:p,style:v,id:m,onMouseEnter:_,onMouseLeave:y,onFocus:S,onBlur:L}=i,E=t("radio",l),D=`${E}-group`,[k,T]=vLe(E);let M=g;d&&d.length>0&&(M=d.map(R=>typeof R=="string"||typeof R=="number"?C.createElement(nF,{key:R.toString(),prefixCls:E,disabled:f,value:R,checked:o===R},R):C.createElement(nF,{key:`radio-group-value-options-${R.value}`,prefixCls:E,disabled:R.disabled||f,value:R.value,checked:o===R.value,style:R.style},R.label)));const A=p||r,N=xe(D,`${D}-${h}`,{[`${D}-${A}`]:A,[`${D}-rtl`]:n==="rtl"},c,u,T);return k(C.createElement("div",Object.assign({},uvt(i),{className:N,style:v,onMouseEnter:_,onMouseLeave:y,onFocus:S,onBlur:L,id:m,ref:e}),C.createElement(Uwt,{value:{onChange:a,value:o,disabled:i.disabled,name:i.name,optionType:i.optionType}},M)))}),tSt=C.memo(eSt);var nSt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{getPrefixCls:t}=C.useContext(Rn),{prefixCls:n}=i,r=nSt(i,["prefixCls"]),o=t("radio",n);return C.createElement(jwt,{value:"button"},C.createElement(nF,Object.assign({prefixCls:o},r,{type:"radio",ref:e})))},rSt=C.forwardRef(iSt),j5=nF;j5.Button=rSt;j5.Group=tSt;j5.__ANT_RADIO=!0;const _Le=j5,bLe=i=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:i,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),PT=i=>({borderColor:i.inputBorderHoverColor,borderInlineEndWidth:i.lineWidth}),iF=i=>({borderColor:i.inputBorderHoverColor,boxShadow:`0 0 0 ${i.controlOutlineWidth}px ${i.controlOutline}`,borderInlineEndWidth:i.lineWidth,outline:0}),_Q=i=>({color:i.colorTextDisabled,backgroundColor:i.colorBgContainerDisabled,borderColor:i.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover":Object.assign({},PT(Oi(i,{inputBorderHoverColor:i.colorBorder})))}),CLe=i=>{const{inputPaddingVerticalLG:e,fontSizeLG:t,lineHeightLG:n,borderRadiusLG:r,inputPaddingHorizontalLG:o}=i;return{padding:`${e}px ${o}px`,fontSize:t,lineHeight:n,borderRadius:r}},bQ=i=>({padding:`${i.inputPaddingVerticalSM}px ${i.controlPaddingHorizontalSM-1}px`,borderRadius:i.borderRadiusSM}),K5=(i,e)=>{const{componentCls:t,colorError:n,colorWarning:r,colorErrorOutline:o,colorWarningOutline:s,colorErrorBorderHover:a,colorWarningBorderHover:l}=i;return{[`&-status-error:not(${e}-disabled):not(${e}-borderless)${e}`]:{borderColor:n,"&:hover":{borderColor:a},"&:focus, &-focused":Object.assign({},iF(Oi(i,{inputBorderActiveColor:n,inputBorderHoverColor:n,controlOutline:o}))),[`${t}-prefix, ${t}-suffix`]:{color:n}},[`&-status-warning:not(${e}-disabled):not(${e}-borderless)${e}`]:{borderColor:r,"&:hover":{borderColor:l},"&:focus, &-focused":Object.assign({},iF(Oi(i,{inputBorderActiveColor:r,inputBorderHoverColor:r,controlOutline:s}))),[`${t}-prefix, ${t}-suffix`]:{color:r}}}},OT=i=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${i.inputPaddingVertical}px ${i.inputPaddingHorizontal}px`,color:i.colorText,fontSize:i.fontSize,lineHeight:i.lineHeight,backgroundColor:i.colorBgContainer,backgroundImage:"none",borderWidth:i.lineWidth,borderStyle:i.lineType,borderColor:i.colorBorder,borderRadius:i.borderRadius,transition:`all ${i.motionDurationMid}`},bLe(i.colorTextPlaceholder)),{"&:hover":Object.assign({},PT(i)),"&:focus, &-focused":Object.assign({},iF(i)),"&-disabled, &[disabled]":Object.assign({},_Q(i)),"&-borderless":{"&, &:hover, &:focus, &-focused, &-disabled, &[disabled]":{backgroundColor:"transparent",border:"none",boxShadow:"none"}},"textarea&":{maxWidth:"100%",height:"auto",minHeight:i.controlHeight,lineHeight:i.lineHeight,verticalAlign:"bottom",transition:`all ${i.motionDurationSlow}, height 0s`,resize:"vertical"},"&-lg":Object.assign({},CLe(i)),"&-sm":Object.assign({},bQ(i)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),yLe=i=>{const{componentCls:e,antCls:t}=i;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,["&[class*='col-']"]:{paddingInlineEnd:i.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${e}, &-lg > ${e}-group-addon`]:Object.assign({},CLe(i)),[`&-sm ${e}, &-sm > ${e}-group-addon`]:Object.assign({},bQ(i)),[`&-lg ${t}-select-single ${t}-select-selector`]:{height:i.controlHeightLG},[`&-sm ${t}-select-single ${t}-select-selector`]:{height:i.controlHeightSM},[`> ${e}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${e}-group`]:{["&-addon, &-wrap"]:{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:`0 ${i.inputPaddingHorizontal}px`,color:i.colorText,fontWeight:"normal",fontSize:i.fontSize,textAlign:"center",backgroundColor:i.colorFillAlter,border:`${i.lineWidth}px ${i.lineType} ${i.colorBorder}`,borderRadius:i.borderRadius,transition:`all ${i.motionDurationSlow}`,lineHeight:1,[`${t}-select`]:{margin:`-${i.inputPaddingVertical+1}px -${i.inputPaddingHorizontal}px`,[`&${t}-select-single:not(${t}-select-customize-input)`]:{[`${t}-select-selector`]:{backgroundColor:"inherit",border:`${i.lineWidth}px ${i.lineType} transparent`,boxShadow:"none"}},"&-open, &-focused":{[`${t}-select-selector`]:{color:i.colorPrimary}}},[`${t}-cascader-picker`]:{margin:`-9px -${i.inputPaddingHorizontal}px`,backgroundColor:"transparent",[`${t}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}},[`${e}`]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${e}-search-with-button &`]:{zIndex:0}}},[`> ${e}:first-child, ${e}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${t}-select ${t}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${e}-affix-wrapper`]:{[`&:not(:first-child) ${e}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${e}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${e}:last-child, ${e}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${t}-select ${t}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${e}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${e}-search &`]:{borderStartStartRadius:i.borderRadius,borderEndStartRadius:i.borderRadius}},[`&:not(:first-child), ${e}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${e}-group-compact`]:Object.assign(Object.assign({display:"block"},ak()),{[`${e}-group-addon, ${e}-group-wrap, > ${e}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:i.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},[`& > ${e}-affix-wrapper`]:{display:"inline-flex"},[`& > ${t}-picker-range`]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:-i.lineWidth,borderInlineEndWidth:i.lineWidth},[`${e}`]:{float:"none"},[`& > ${t}-select > ${t}-select-selector, & > ${t}-select-auto-complete ${e}, & > ${t}-cascader-picker ${e}, & > ${e}-group-wrapper ${e}`]:{borderInlineEndWidth:i.lineWidth,borderRadius:0,"&:hover":{zIndex:1},"&:focus":{zIndex:1}},[`& > ${t}-select-focused`]:{zIndex:1},[`& > ${t}-select > ${t}-select-arrow`]:{zIndex:1},[`& > *:first-child, @@ -1050,13 +1050,13 @@ html body { & > ${t}-cascader-picker:last-child ${e}, & > ${t}-cascader-picker-focused:last-child ${e}`]:{borderInlineEndWidth:i.lineWidth,borderStartEndRadius:i.borderRadius,borderEndEndRadius:i.borderRadius},[`& > ${t}-select-auto-complete ${e}`]:{verticalAlign:"top"},[`${e}-group-wrapper + ${e}-group-wrapper`]:{marginInlineStart:-i.lineWidth,[`${e}-affix-wrapper`]:{borderRadius:0}},[`${e}-group-wrapper:not(:last-child)`]:{[`&${e}-search > ${e}-group`]:{[`& > ${e}-group-addon > ${e}-search-button`]:{borderRadius:0},[`& > ${e}`]:{borderStartStartRadius:i.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:i.borderRadius}}}})}},oSt=i=>{const{componentCls:e,controlHeightSM:t,lineWidth:n}=i,r=16,o=(t-n*2-r)/2;return{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},Wr(i)),OT(i)),K5(i,e)),{'&[type="color"]':{height:i.controlHeight,[`&${e}-lg`]:{height:i.controlHeightLG},[`&${e}-sm`]:{height:t,paddingTop:o,paddingBottom:o}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{"-webkit-appearance":"none"}})}},sSt=i=>{const{componentCls:e}=i;return{[`${e}-clear-icon`]:{margin:0,color:i.colorTextQuaternary,fontSize:i.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${i.motionDurationSlow}`,"&:hover":{color:i.colorTextTertiary},"&:active":{color:i.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${i.inputAffixPadding}px`}}}},aSt=i=>{const{componentCls:e,inputAffixPadding:t,colorTextDescription:n,motionDurationSlow:r,colorIcon:o,colorIconHover:s,iconCls:a}=i;return{[`${e}-affix-wrapper`]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},OT(i)),{display:"inline-flex",[`&:not(${e}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},PT(i)),{zIndex:1,[`${e}-search-with-button &`]:{zIndex:0}}),"&-focused, &:focus":{zIndex:1},"&-disabled":{[`${e}[disabled]`]:{background:"transparent"}},[`> input${e}`]:{padding:0,fontSize:"inherit",border:"none",borderRadius:0,outline:"none","&:focus":{boxShadow:"none !important"}},"&::before":{width:0,visibility:"hidden",content:'"\\a0"'},[`${e}`]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:i.paddingXS}},"&-show-count-suffix":{color:n},"&-show-count-has-suffix":{marginInlineEnd:i.paddingXXS},"&-prefix":{marginInlineEnd:t},"&-suffix":{marginInlineStart:t}}}),sSt(i)),{[`${a}${e}-password-icon`]:{color:o,cursor:"pointer",transition:`all ${r}`,"&:hover":{color:s}}}),K5(i,`${e}-affix-wrapper`))}},lSt=i=>{const{componentCls:e,colorError:t,colorWarning:n,borderRadiusLG:r,borderRadiusSM:o}=i;return{[`${e}-group`]:Object.assign(Object.assign(Object.assign({},Wr(i)),yLe(i)),{"&-rtl":{direction:"rtl"},"&-wrapper":{display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${e}-group-addon`]:{borderRadius:r}},"&-sm":{[`${e}-group-addon`]:{borderRadius:o}},"&-status-error":{[`${e}-group-addon`]:{color:t,borderColor:t}},"&-status-warning":{[`${e}-group-addon`]:{color:n,borderColor:n}},"&-disabled":{[`${e}-group-addon`]:Object.assign({},_Q(i))}}})}},cSt=i=>{const{componentCls:e,antCls:t}=i,n=`${e}-search`;return{[n]:{[`${e}`]:{"&:hover, &:focus":{borderColor:i.colorPrimaryHover,[`+ ${e}-group-addon ${n}-button:not(${t}-btn-primary)`]:{borderInlineStartColor:i.colorPrimaryHover}}},[`${e}-affix-wrapper`]:{borderRadius:0},[`${e}-lg`]:{lineHeight:i.lineHeightLG-2e-4},[`> ${e}-group`]:{[`> ${e}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${n}-button`]:{paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:i.borderRadius,borderEndEndRadius:i.borderRadius,borderEndStartRadius:0},[`${n}-button:not(${t}-btn-primary)`]:{color:i.colorTextDescription,"&:hover":{color:i.colorPrimaryHover},"&:active":{color:i.colorPrimaryActive},[`&${t}-btn-loading::before`]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},[`${n}-button`]:{height:i.controlHeight,"&:hover, &:focus":{zIndex:1}},[`&-large ${n}-button`]:{height:i.controlHeightLG},[`&-small ${n}-button`]:{height:i.controlHeightSM},"&-rtl":{direction:"rtl"},[`&${e}-compact-item`]:{[`&:not(${e}-compact-last-item)`]:{[`${e}-group-addon`]:{[`${e}-search-button`]:{marginInlineEnd:-i.lineWidth,borderRadius:0}}},[`&:not(${e}-compact-first-item)`]:{[`${e},${e}-affix-wrapper`]:{borderRadius:0}},[`> ${e}-group-addon ${e}-search-button, > ${e}, - ${e}-affix-wrapper`]:{"&:hover,&:focus,&:active":{zIndex:2}},[`> ${e}-affix-wrapper-focused`]:{zIndex:2}}}}};function CQ(i){return Oi(i,{inputAffixPadding:i.paddingXXS,inputPaddingVertical:Math.max(Math.round((i.controlHeight-i.fontSize*i.lineHeight)/2*10)/10-i.lineWidth,3),inputPaddingVerticalLG:Math.ceil((i.controlHeightLG-i.fontSizeLG*i.lineHeightLG)/2*10)/10-i.lineWidth,inputPaddingVerticalSM:Math.max(Math.round((i.controlHeightSM-i.fontSize*i.lineHeight)/2*10)/10-i.lineWidth,0),inputPaddingHorizontal:i.paddingSM-i.lineWidth,inputPaddingHorizontalSM:i.paddingXS-i.lineWidth,inputPaddingHorizontalLG:i.controlPaddingHorizontal-i.lineWidth,inputBorderHoverColor:i.colorPrimaryHover,inputBorderActiveColor:i.colorPrimaryHover})}const uSt=i=>{const{componentCls:e,paddingLG:t}=i,n=`${e}-textarea`;return{[n]:{position:"relative","&-show-count":{[`> ${e}`]:{height:"100%"},[`${e}-data-count`]:{position:"absolute",bottom:-i.fontSize*i.lineHeight,insetInlineEnd:0,color:i.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},[`&-affix-wrapper${n}-has-feedback`]:{[`${e}`]:{paddingInlineEnd:t}},[`&-affix-wrapper${e}-affix-wrapper`]:{padding:0,[`> textarea${e}`]:{fontSize:"inherit",border:"none",outline:"none","&:focus":{boxShadow:"none !important"}},[`${e}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${e}-clear-icon`]:{position:"absolute",insetInlineEnd:i.paddingXS,insetBlockStart:i.paddingXS},[`${n}-suffix`]:{position:"absolute",top:0,insetInlineEnd:i.inputPaddingHorizontal,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}}}}},yQ=vo("Input",i=>{const e=CQ(i);return[oSt(e),uSt(e),aSt(e),lSt(e),cSt(e),M5(e)]});function dSt(i,e,t){var n=t||{},r=n.noTrailing,o=r===void 0?!1:r,s=n.noLeading,a=s===void 0?!1:s,l=n.debounceMode,c=l===void 0?void 0:l,u,d=!1,h=0;function f(){u&&clearTimeout(u)}function g(v){var m=v||{},_=m.upcomingOnly,y=_===void 0?!1:_;f(),d=!y}function p(){for(var v=arguments.length,m=new Array(v),_=0;_i?a?(h=Date.now(),o||(u=setTimeout(c?E:L,i))):L():o!==!0&&(u=setTimeout(c?E:L,c===void 0?i-S:i))}return p.cancel=g,p}function hSt(i,e,t){var n=t||{},r=n.atBegin,o=r===void 0?!1:r;return dSt(i,e,{debounceMode:o!==!1})}function wLe(i,e){var t=new Set;return i.forEach(function(n){e.has(n)||t.add(n)}),t}function fSt(i){var e=i||{},t=e.disabled,n=e.disableCheckbox,r=e.checkable;return!!(t||n)||r===!1}function gSt(i,e,t,n){for(var r=new Set(i),o=new Set,s=0;s<=t;s+=1){var a=e.get(s)||new Set;a.forEach(function(d){var h=d.key,f=d.node,g=d.children,p=g===void 0?[]:g;r.has(h)&&!n(f)&&p.filter(function(v){return!n(v.node)}).forEach(function(v){r.add(v.key)})})}for(var l=new Set,c=t;c>=0;c-=1){var u=e.get(c)||new Set;u.forEach(function(d){var h=d.parent,f=d.node;if(!(n(f)||!d.parent||l.has(d.parent.key))){if(n(d.parent.node)){l.add(h.key);return}var g=!0,p=!1;(h.children||[]).filter(function(v){return!n(v.node)}).forEach(function(v){var m=v.key,_=r.has(m);g&&!_&&(g=!1),!p&&(_||o.has(m))&&(p=!0)}),g&&r.add(h.key),p&&o.add(h.key),l.add(h.key)}})}return{checkedKeys:Array.from(r),halfCheckedKeys:Array.from(wLe(o,r))}}function pSt(i,e,t,n,r){for(var o=new Set(i),s=new Set(e),a=0;a<=n;a+=1){var l=t.get(a)||new Set;l.forEach(function(h){var f=h.key,g=h.node,p=h.children,v=p===void 0?[]:p;!o.has(f)&&!s.has(f)&&!r(g)&&v.filter(function(m){return!r(m.node)}).forEach(function(m){o.delete(m.key)})})}s=new Set;for(var c=new Set,u=n;u>=0;u-=1){var d=t.get(u)||new Set;d.forEach(function(h){var f=h.parent,g=h.node;if(!(r(g)||!h.parent||c.has(h.parent.key))){if(r(h.parent.node)){c.add(f.key);return}var p=!0,v=!1;(f.children||[]).filter(function(m){return!r(m.node)}).forEach(function(m){var _=m.key,y=o.has(_);p&&!y&&(p=!1),!v&&(y||s.has(_))&&(v=!0)}),p||o.delete(f.key),v&&s.add(f.key),c.add(f.key)}})}return{checkedKeys:Array.from(o),halfCheckedKeys:Array.from(wLe(s,o))}}function aw(i,e,t,n){var r=[],o;n?o=n:o=fSt;var s=new Set(i.filter(function(u){var d=!!t[u];return d||r.push(u),d})),a=new Map,l=0;Object.keys(t).forEach(function(u){var d=t[u],h=d.level,f=a.get(h);f||(f=new Set,a.set(h,f)),f.add(d),l=Math.max(l,h)}),ao(!r.length,"Tree missing follow keys: ".concat(r.slice(0,100).map(function(u){return"'".concat(u,"'")}).join(", ")));var c;return e===!0?c=gSt(s,a,l,o):c=pSt(s,e.halfCheckedKeys,a,l,o),c}var wQ=C.createContext(null),mSt=function(e){for(var t=e.prefixCls,n=e.level,r=e.isStart,o=e.isEnd,s="".concat(t,"-indent-unit"),a=[],l=0;l=0&&t.splice(n,1),t}function Lg(i,e){var t=(i||[]).slice();return t.indexOf(e)===-1&&t.push(e),t}function SQ(i){return i.split("-")}function SLe(i,e){return"".concat(i,"-").concat(e)}function ySt(i){return i&&i.type&&i.type.isTreeNode}function wSt(i,e){var t=[],n=e[i];function r(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];o.forEach(function(s){var a=s.key,l=s.children;t.push(a),r(l)})}return r(n.children),t}function SSt(i){if(i.parent){var e=SQ(i.pos);return Number(e[e.length-1])===i.parent.children.length-1}return!1}function xSt(i){var e=SQ(i.pos);return Number(e[e.length-1])===0}function Kue(i,e,t,n,r,o,s,a,l,c){var u,d=i.clientX,h=i.clientY,f=i.target.getBoundingClientRect(),g=f.top,p=f.height,v=(c==="rtl"?-1:1)*(((r==null?void 0:r.x)||0)-d),m=(v-12)/n,_=a[t.props.eventKey];if(h-1.5?o({dragNode:N,dropNode:R,dropPosition:1})?T=1:F=!1:o({dragNode:N,dropNode:R,dropPosition:0})?T=0:o({dragNode:N,dropNode:R,dropPosition:1})?T=1:F=!1:o({dragNode:N,dropNode:R,dropPosition:1})?T=1:F=!1,{dropPosition:T,dropLevelOffset:M,dropTargetKey:_.key,dropTargetPos:_.pos,dragOverNodeKey:k,dropContainerKey:T===0?null:((u=_.parent)===null||u===void 0?void 0:u.key)||null,dropAllowed:F}}function Gue(i,e){if(i){var t=e.multiple;return t?i.slice():i.length?[i[0]]:i}}function k7(i){if(!i)return null;var e;if(Array.isArray(i))e={checkedKeys:i,halfCheckedKeys:void 0};else if(zn(i)==="object")e={checkedKeys:i.checked||void 0,halfCheckedKeys:i.halfChecked||void 0};else return ao(!1,"`checkedKeys` is not an array or an object"),null;return e}function SK(i,e){var t=new Set;function n(r){if(!t.has(r)){var o=e[r];if(o){t.add(r);var s=o.parent,a=o.node;a.disabled||s&&n(s.key)}}}return(i||[]).forEach(function(r){n(r)}),ft(t)}var LSt=["children"];function FT(i,e){return i??e}function rF(i){var e=i||{},t=e.title,n=e._title,r=e.key,o=e.children,s=t||"title";return{title:s,_title:n||[s],key:r||"key",children:o||"children"}}function xLe(i){function e(t){var n=rd(t);return n.map(function(r){if(!ySt(r))return ao(!r,"Tree/TreeNode can only accept TreeNode as children."),null;var o=r.key,s=r.props,a=s.children,l=Nn(s,LSt),c=te({key:o},l),u=e(a);return u.length&&(c.children=u),c}).filter(function(r){return r})}return e(i)}function T7(i,e,t){var n=rF(t),r=n._title,o=n.key,s=n.children,a=new Set(e===!0?[]:e),l=[];function c(u){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return u.map(function(h,f){for(var g=SLe(d?d.pos:"0",f),p=FT(h[o],g),v,m=0;m1&&arguments[1]!==void 0?arguments[1]:{},t=e.initWrapper,n=e.processEntity,r=e.onProcessFinished,o=e.externalGetKey,s=e.childrenPropName,a=e.fieldNames,l=arguments.length>2?arguments[2]:void 0,c=o||l,u={},d={},h={posEntities:u,keyEntities:d};return t&&(h=t(h)||h),ESt(i,function(f){var g=f.node,p=f.index,v=f.pos,m=f.key,_=f.parentPos,y=f.level,S=f.nodes,L={node:g,nodes:S,index:p,key:m,pos:v,level:y},E=FT(m,v);u[v]=L,d[E]=L,L.parent=u[_],L.parent&&(L.parent.children=L.parent.children||[],L.parent.children.push(L)),n&&n(L,h)},{externalGetKey:c,childrenPropName:s,fieldNames:a}),r&&r(h),h}function XE(i,e){var t=e.expandedKeys,n=e.selectedKeys,r=e.loadedKeys,o=e.loadingKeys,s=e.checkedKeys,a=e.halfCheckedKeys,l=e.dragOverNodeKey,c=e.dropPosition,u=e.keyEntities,d=u[i],h={eventKey:i,expanded:t.indexOf(i)!==-1,selected:n.indexOf(i)!==-1,loaded:r.indexOf(i)!==-1,loading:o.indexOf(i)!==-1,checked:s.indexOf(i)!==-1,halfChecked:a.indexOf(i)!==-1,pos:String(d?d.pos:""),dragOver:l===i&&c===0,dragOverGapTop:l===i&&c===-1,dragOverGapBottom:l===i&&c===1};return h}function ss(i){var e=i.data,t=i.expanded,n=i.selected,r=i.checked,o=i.loaded,s=i.loading,a=i.halfChecked,l=i.dragOver,c=i.dragOverGapTop,u=i.dragOverGapBottom,d=i.pos,h=i.active,f=i.eventKey,g=te(te({},e),{},{expanded:t,selected:n,checked:r,loaded:o,loading:s,halfChecked:a,dragOver:l,dragOverGapTop:c,dragOverGapBottom:u,pos:d,active:h,key:f});return"props"in g||Object.defineProperty(g,"props",{get:function(){return ao(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),i}}),g}const DSt=new mi("antCheckboxEffect",{"0%":{transform:"scale(1)",opacity:.5},"100%":{transform:"scale(1.6)",opacity:0}}),ISt=i=>{const{checkboxCls:e}=i,t=`${e}-wrapper`;return[{[`${e}-group`]:Object.assign(Object.assign({},Wr(i)),{display:"inline-flex"}),[t]:Object.assign(Object.assign({},Wr(i)),{display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},[`& + ${t}`]:{marginInlineStart:i.marginXS},[`&${t}-in-form-item`]:{'input[type="checkbox"]':{width:14,height:14}}}),[e]:Object.assign(Object.assign({},Wr(i)),{position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",alignSelf:"start",transform:`translate(0, ${i.lineHeight*i.fontSize/2-i.checkboxSize/2}px)`,[`${e}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0,margin:0,[`&:focus-visible + ${e}-inner`]:Object.assign({},Op(i))},[`${e}-inner`]:{boxSizing:"border-box",position:"relative",top:0,insetInlineStart:0,display:"block",width:i.checkboxSize,height:i.checkboxSize,direction:"ltr",backgroundColor:i.colorBgContainer,border:`${i.lineWidth}px ${i.lineType} ${i.colorBorder}`,borderRadius:i.borderRadiusSM,borderCollapse:"separate",transition:`all ${i.motionDurationSlow}`,"&:after":{boxSizing:"border-box",position:"absolute",top:"50%",insetInlineStart:"21.5%",display:"table",width:i.checkboxSize/14*5,height:i.checkboxSize/14*8,border:`${i.lineWidthBold}px solid ${i.colorWhite}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:`all ${i.motionDurationFast} ${i.motionEaseInBack}, opacity ${i.motionDurationFast}`}},"& + span":{paddingInlineStart:i.paddingXS,paddingInlineEnd:i.paddingXS}})},{[e]:{"&-indeterminate":{[`${e}-inner`]:{"&:after":{top:"50%",insetInlineStart:"50%",width:i.fontSizeLG/2,height:i.fontSizeLG/2,backgroundColor:i.colorPrimary,border:0,transform:"translate(-50%, -50%) scale(1)",opacity:1,content:'""'}}}}},{[`${t}:hover ${e}:after`]:{visibility:"visible"},[` + ${e}-affix-wrapper`]:{"&:hover,&:focus,&:active":{zIndex:2}},[`> ${e}-affix-wrapper-focused`]:{zIndex:2}}}}};function CQ(i){return Oi(i,{inputAffixPadding:i.paddingXXS,inputPaddingVertical:Math.max(Math.round((i.controlHeight-i.fontSize*i.lineHeight)/2*10)/10-i.lineWidth,3),inputPaddingVerticalLG:Math.ceil((i.controlHeightLG-i.fontSizeLG*i.lineHeightLG)/2*10)/10-i.lineWidth,inputPaddingVerticalSM:Math.max(Math.round((i.controlHeightSM-i.fontSize*i.lineHeight)/2*10)/10-i.lineWidth,0),inputPaddingHorizontal:i.paddingSM-i.lineWidth,inputPaddingHorizontalSM:i.paddingXS-i.lineWidth,inputPaddingHorizontalLG:i.controlPaddingHorizontal-i.lineWidth,inputBorderHoverColor:i.colorPrimaryHover,inputBorderActiveColor:i.colorPrimaryHover})}const uSt=i=>{const{componentCls:e,paddingLG:t}=i,n=`${e}-textarea`;return{[n]:{position:"relative","&-show-count":{[`> ${e}`]:{height:"100%"},[`${e}-data-count`]:{position:"absolute",bottom:-i.fontSize*i.lineHeight,insetInlineEnd:0,color:i.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},[`&-affix-wrapper${n}-has-feedback`]:{[`${e}`]:{paddingInlineEnd:t}},[`&-affix-wrapper${e}-affix-wrapper`]:{padding:0,[`> textarea${e}`]:{fontSize:"inherit",border:"none",outline:"none","&:focus":{boxShadow:"none !important"}},[`${e}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${e}-clear-icon`]:{position:"absolute",insetInlineEnd:i.paddingXS,insetBlockStart:i.paddingXS},[`${n}-suffix`]:{position:"absolute",top:0,insetInlineEnd:i.inputPaddingHorizontal,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}}}}},yQ=vo("Input",i=>{const e=CQ(i);return[oSt(e),uSt(e),aSt(e),lSt(e),cSt(e),M5(e)]});function dSt(i,e,t){var n=t||{},r=n.noTrailing,o=r===void 0?!1:r,s=n.noLeading,a=s===void 0?!1:s,l=n.debounceMode,c=l===void 0?void 0:l,u,d=!1,h=0;function f(){u&&clearTimeout(u)}function g(v){var m=v||{},_=m.upcomingOnly,y=_===void 0?!1:_;f(),d=!y}function p(){for(var v=arguments.length,m=new Array(v),_=0;_i?a?(h=Date.now(),o||(u=setTimeout(c?E:L,i))):L():o!==!0&&(u=setTimeout(c?E:L,c===void 0?i-S:i))}return p.cancel=g,p}function hSt(i,e,t){var n=t||{},r=n.atBegin,o=r===void 0?!1:r;return dSt(i,e,{debounceMode:o!==!1})}function wLe(i,e){var t=new Set;return i.forEach(function(n){e.has(n)||t.add(n)}),t}function fSt(i){var e=i||{},t=e.disabled,n=e.disableCheckbox,r=e.checkable;return!!(t||n)||r===!1}function gSt(i,e,t,n){for(var r=new Set(i),o=new Set,s=0;s<=t;s+=1){var a=e.get(s)||new Set;a.forEach(function(d){var h=d.key,f=d.node,g=d.children,p=g===void 0?[]:g;r.has(h)&&!n(f)&&p.filter(function(v){return!n(v.node)}).forEach(function(v){r.add(v.key)})})}for(var l=new Set,c=t;c>=0;c-=1){var u=e.get(c)||new Set;u.forEach(function(d){var h=d.parent,f=d.node;if(!(n(f)||!d.parent||l.has(d.parent.key))){if(n(d.parent.node)){l.add(h.key);return}var g=!0,p=!1;(h.children||[]).filter(function(v){return!n(v.node)}).forEach(function(v){var m=v.key,_=r.has(m);g&&!_&&(g=!1),!p&&(_||o.has(m))&&(p=!0)}),g&&r.add(h.key),p&&o.add(h.key),l.add(h.key)}})}return{checkedKeys:Array.from(r),halfCheckedKeys:Array.from(wLe(o,r))}}function pSt(i,e,t,n,r){for(var o=new Set(i),s=new Set(e),a=0;a<=n;a+=1){var l=t.get(a)||new Set;l.forEach(function(h){var f=h.key,g=h.node,p=h.children,v=p===void 0?[]:p;!o.has(f)&&!s.has(f)&&!r(g)&&v.filter(function(m){return!r(m.node)}).forEach(function(m){o.delete(m.key)})})}s=new Set;for(var c=new Set,u=n;u>=0;u-=1){var d=t.get(u)||new Set;d.forEach(function(h){var f=h.parent,g=h.node;if(!(r(g)||!h.parent||c.has(h.parent.key))){if(r(h.parent.node)){c.add(f.key);return}var p=!0,v=!1;(f.children||[]).filter(function(m){return!r(m.node)}).forEach(function(m){var _=m.key,y=o.has(_);p&&!y&&(p=!1),!v&&(y||s.has(_))&&(v=!0)}),p||o.delete(f.key),v&&s.add(f.key),c.add(f.key)}})}return{checkedKeys:Array.from(o),halfCheckedKeys:Array.from(wLe(s,o))}}function aw(i,e,t,n){var r=[],o;n?o=n:o=fSt;var s=new Set(i.filter(function(u){var d=!!t[u];return d||r.push(u),d})),a=new Map,l=0;Object.keys(t).forEach(function(u){var d=t[u],h=d.level,f=a.get(h);f||(f=new Set,a.set(h,f)),f.add(d),l=Math.max(l,h)}),ao(!r.length,"Tree missing follow keys: ".concat(r.slice(0,100).map(function(u){return"'".concat(u,"'")}).join(", ")));var c;return e===!0?c=gSt(s,a,l,o):c=pSt(s,e.halfCheckedKeys,a,l,o),c}var wQ=C.createContext(null),mSt=function(e){for(var t=e.prefixCls,n=e.level,r=e.isStart,o=e.isEnd,s="".concat(t,"-indent-unit"),a=[],l=0;l=0&&t.splice(n,1),t}function Lg(i,e){var t=(i||[]).slice();return t.indexOf(e)===-1&&t.push(e),t}function SQ(i){return i.split("-")}function SLe(i,e){return"".concat(i,"-").concat(e)}function ySt(i){return i&&i.type&&i.type.isTreeNode}function wSt(i,e){var t=[],n=e[i];function r(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];o.forEach(function(s){var a=s.key,l=s.children;t.push(a),r(l)})}return r(n.children),t}function SSt(i){if(i.parent){var e=SQ(i.pos);return Number(e[e.length-1])===i.parent.children.length-1}return!1}function xSt(i){var e=SQ(i.pos);return Number(e[e.length-1])===0}function Kue(i,e,t,n,r,o,s,a,l,c){var u,d=i.clientX,h=i.clientY,f=i.target.getBoundingClientRect(),g=f.top,p=f.height,v=(c==="rtl"?-1:1)*(((r==null?void 0:r.x)||0)-d),m=(v-12)/n,_=a[t.props.eventKey];if(h-1.5?o({dragNode:N,dropNode:R,dropPosition:1})?T=1:F=!1:o({dragNode:N,dropNode:R,dropPosition:0})?T=0:o({dragNode:N,dropNode:R,dropPosition:1})?T=1:F=!1:o({dragNode:N,dropNode:R,dropPosition:1})?T=1:F=!1,{dropPosition:T,dropLevelOffset:M,dropTargetKey:_.key,dropTargetPos:_.pos,dragOverNodeKey:k,dropContainerKey:T===0?null:((u=_.parent)===null||u===void 0?void 0:u.key)||null,dropAllowed:F}}function Gue(i,e){if(i){var t=e.multiple;return t?i.slice():i.length?[i[0]]:i}}function k7(i){if(!i)return null;var e;if(Array.isArray(i))e={checkedKeys:i,halfCheckedKeys:void 0};else if(zn(i)==="object")e={checkedKeys:i.checked||void 0,halfCheckedKeys:i.halfChecked||void 0};else return ao(!1,"`checkedKeys` is not an array or an object"),null;return e}function SK(i,e){var t=new Set;function n(r){if(!t.has(r)){var o=e[r];if(o){t.add(r);var s=o.parent,a=o.node;a.disabled||s&&n(s.key)}}}return(i||[]).forEach(function(r){n(r)}),ft(t)}var LSt=["children"];function FT(i,e){return i??e}function rF(i){var e=i||{},t=e.title,n=e._title,r=e.key,o=e.children,s=t||"title";return{title:s,_title:n||[s],key:r||"key",children:o||"children"}}function xLe(i){function e(t){var n=rd(t);return n.map(function(r){if(!ySt(r))return ao(!r,"Tree/TreeNode can only accept TreeNode as children."),null;var o=r.key,s=r.props,a=s.children,l=Nn(s,LSt),c=te({key:o},l),u=e(a);return u.length&&(c.children=u),c}).filter(function(r){return r})}return e(i)}function T7(i,e,t){var n=rF(t),r=n._title,o=n.key,s=n.children,a=new Set(e===!0?[]:e),l=[];function c(u){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return u.map(function(h,f){for(var g=SLe(d?d.pos:"0",f),p=FT(h[o],g),v,m=0;m1&&arguments[1]!==void 0?arguments[1]:{},t=e.initWrapper,n=e.processEntity,r=e.onProcessFinished,o=e.externalGetKey,s=e.childrenPropName,a=e.fieldNames,l=arguments.length>2?arguments[2]:void 0,c=o||l,u={},d={},h={posEntities:u,keyEntities:d};return t&&(h=t(h)||h),ESt(i,function(f){var g=f.node,p=f.index,v=f.pos,m=f.key,_=f.parentPos,y=f.level,S=f.nodes,L={node:g,nodes:S,index:p,key:m,pos:v,level:y},E=FT(m,v);u[v]=L,d[E]=L,L.parent=u[_],L.parent&&(L.parent.children=L.parent.children||[],L.parent.children.push(L)),n&&n(L,h)},{externalGetKey:c,childrenPropName:s,fieldNames:a}),r&&r(h),h}function XE(i,e){var t=e.expandedKeys,n=e.selectedKeys,r=e.loadedKeys,o=e.loadingKeys,s=e.checkedKeys,a=e.halfCheckedKeys,l=e.dragOverNodeKey,c=e.dropPosition,u=e.keyEntities,d=u[i],h={eventKey:i,expanded:t.indexOf(i)!==-1,selected:n.indexOf(i)!==-1,loaded:r.indexOf(i)!==-1,loading:o.indexOf(i)!==-1,checked:s.indexOf(i)!==-1,halfChecked:a.indexOf(i)!==-1,pos:String(d?d.pos:""),dragOver:l===i&&c===0,dragOverGapTop:l===i&&c===-1,dragOverGapBottom:l===i&&c===1};return h}function ss(i){var e=i.data,t=i.expanded,n=i.selected,r=i.checked,o=i.loaded,s=i.loading,a=i.halfChecked,l=i.dragOver,c=i.dragOverGapTop,u=i.dragOverGapBottom,d=i.pos,h=i.active,f=i.eventKey,g=te(te({},e),{},{expanded:t,selected:n,checked:r,loaded:o,loading:s,halfChecked:a,dragOver:l,dragOverGapTop:c,dragOverGapBottom:u,pos:d,active:h,key:f});return"props"in g||Object.defineProperty(g,"props",{get:function(){return ao(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),i}}),g}const DSt=new mi("antCheckboxEffect",{"0%":{transform:"scale(1)",opacity:.5},"100%":{transform:"scale(1.6)",opacity:0}}),ISt=i=>{const{checkboxCls:e}=i,t=`${e}-wrapper`;return[{[`${e}-group`]:Object.assign(Object.assign({},Wr(i)),{display:"inline-flex"}),[t]:Object.assign(Object.assign({},Wr(i)),{display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},[`& + ${t}`]:{marginInlineStart:i.marginXS},[`&${t}-in-form-item`]:{'input[type="checkbox"]':{width:14,height:14}}}),[e]:Object.assign(Object.assign({},Wr(i)),{position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",alignSelf:"start",transform:`translate(0, ${i.lineHeight*i.fontSize/2-i.checkboxSize/2}px)`,[`${e}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0,margin:0,[`&:focus-visible + ${e}-inner`]:Object.assign({},Fp(i))},[`${e}-inner`]:{boxSizing:"border-box",position:"relative",top:0,insetInlineStart:0,display:"block",width:i.checkboxSize,height:i.checkboxSize,direction:"ltr",backgroundColor:i.colorBgContainer,border:`${i.lineWidth}px ${i.lineType} ${i.colorBorder}`,borderRadius:i.borderRadiusSM,borderCollapse:"separate",transition:`all ${i.motionDurationSlow}`,"&:after":{boxSizing:"border-box",position:"absolute",top:"50%",insetInlineStart:"21.5%",display:"table",width:i.checkboxSize/14*5,height:i.checkboxSize/14*8,border:`${i.lineWidthBold}px solid ${i.colorWhite}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:`all ${i.motionDurationFast} ${i.motionEaseInBack}, opacity ${i.motionDurationFast}`}},"& + span":{paddingInlineStart:i.paddingXS,paddingInlineEnd:i.paddingXS}})},{[e]:{"&-indeterminate":{[`${e}-inner`]:{"&:after":{top:"50%",insetInlineStart:"50%",width:i.fontSizeLG/2,height:i.fontSizeLG/2,backgroundColor:i.colorPrimary,border:0,transform:"translate(-50%, -50%) scale(1)",opacity:1,content:'""'}}}}},{[`${t}:hover ${e}:after`]:{visibility:"visible"},[` ${t}:not(${t}-disabled), ${e}:not(${e}-disabled) `]:{[`&:hover ${e}-inner`]:{borderColor:i.colorPrimary}},[`${t}:not(${t}-disabled)`]:{[`&:hover ${e}-checked:not(${e}-disabled) ${e}-inner`]:{backgroundColor:i.colorPrimaryHover,borderColor:"transparent"},[`&:hover ${e}-checked:not(${e}-disabled):after`]:{borderColor:i.colorPrimaryHover}}},{[`${e}-checked`]:{[`${e}-inner`]:{backgroundColor:i.colorPrimary,borderColor:i.colorPrimary,"&:after":{opacity:1,transform:"rotate(45deg) scale(1) translate(-50%,-50%)",transition:`all ${i.motionDurationMid} ${i.motionEaseOutBack} ${i.motionDurationFast}`}},"&:after":{position:"absolute",top:0,insetInlineStart:0,width:"100%",height:"100%",borderRadius:i.borderRadiusSM,visibility:"hidden",border:`${i.lineWidthBold}px solid ${i.colorPrimary}`,animationName:DSt,animationDuration:i.motionDurationSlow,animationTimingFunction:"ease-in-out",animationFillMode:"backwards",content:'""',transition:`all ${i.motionDurationSlow}`}},[` ${t}-checked:not(${t}-disabled), ${e}-checked:not(${e}-disabled) - `]:{[`&:hover ${e}-inner`]:{backgroundColor:i.colorPrimaryHover,borderColor:"transparent"},[`&:hover ${e}:after`]:{borderColor:i.colorPrimaryHover}}},{[`${t}-disabled`]:{cursor:"not-allowed"},[`${e}-disabled`]:{[`&, ${e}-input`]:{cursor:"not-allowed",pointerEvents:"none"},[`${e}-inner`]:{background:i.colorBgContainerDisabled,borderColor:i.colorBorder,"&:after":{borderColor:i.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:i.colorTextDisabled},[`&${e}-indeterminate ${e}-inner::after`]:{background:i.colorTextDisabled}}}]};function LLe(i,e){const t=Oi(e,{checkboxCls:`.${i}`,checkboxSize:e.controlInteractiveSize});return[ISt(t)]}const ELe=vo("Checkbox",(i,e)=>{let{prefixCls:t}=e;return[LLe(t,i)]});var kSt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var{defaultValue:t,children:n,options:r=[],prefixCls:o,className:s,rootClassName:a,style:l,onChange:c}=i,u=kSt(i,["defaultValue","children","options","prefixCls","className","rootClassName","style","onChange"]);const{getPrefixCls:d,direction:h}=C.useContext(Rn),[f,g]=C.useState(u.value||t||[]),[p,v]=C.useState([]);C.useEffect(()=>{"value"in u&&g(u.value||[])},[u.value]);const m=()=>r.map(N=>typeof N=="string"||typeof N=="number"?{label:N,value:N}:N),_=N=>{v(R=>R.filter(F=>F!==N))},y=N=>{v(R=>[].concat(ft(R),[N]))},S=N=>{const R=f.indexOf(N.value),F=ft(f);R===-1?F.push(N.value):F.splice(R,1),"value"in u||g(F);const W=m();c==null||c(F.filter(H=>p.includes(H)).sort((H,G)=>{const U=W.findIndex(re=>re.value===H),K=W.findIndex(re=>re.value===G);return U-K}))},L=d("checkbox",o),E=`${L}-group`,[D,k]=ELe(L),T=ll(u,["value","disabled"]);r&&r.length>0&&(n=m().map(N=>C.createElement(ILe,{prefixCls:L,key:N.value.toString(),disabled:"disabled"in N?N.disabled:u.disabled,value:N.value,checked:f.includes(N.value),onChange:N.onChange,className:`${E}-item`,style:N.style},N.label)));const M={toggleOption:S,value:f,disabled:u.disabled,name:u.name,registerValue:y,cancelValue:_},A=xe(E,{[`${E}-rtl`]:h==="rtl"},s,a,k);return D(C.createElement("div",Object.assign({className:A,style:l},T,{ref:e}),C.createElement(DLe.Provider,{value:M},n)))},NSt=C.forwardRef(TSt),RSt=C.memo(NSt);var MSt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var t,{prefixCls:n,className:r,rootClassName:o,children:s,indeterminate:a=!1,style:l,onMouseEnter:c,onMouseLeave:u,skipGroup:d=!1,disabled:h}=i,f=MSt(i,["prefixCls","className","rootClassName","children","indeterminate","style","onMouseEnter","onMouseLeave","skipGroup","disabled"]);const{getPrefixCls:g,direction:p}=C.useContext(Rn),v=C.useContext(DLe),{isFormItemInput:m}=C.useContext(Zf),_=C.useContext(H_),y=(t=(v==null?void 0:v.disabled)||h)!==null&&t!==void 0?t:_,S=C.useRef(f.value);C.useEffect(()=>{v==null||v.registerValue(f.value)},[]),C.useEffect(()=>{if(!d)return f.value!==S.current&&(v==null||v.cancelValue(S.current),v==null||v.registerValue(f.value),S.current=f.value),()=>v==null?void 0:v.cancelValue(f.value)},[f.value]);const L=g("checkbox",n),[E,D]=ELe(L),k=Object.assign({},f);v&&!d&&(k.onChange=function(){f.onChange&&f.onChange.apply(f,arguments),v.toggleOption&&v.toggleOption({label:s,value:f.value})},k.name=v.name,k.checked=v.value.includes(f.value));const T=xe({[`${L}-wrapper`]:!0,[`${L}-rtl`]:p==="rtl",[`${L}-wrapper-checked`]:k.checked,[`${L}-wrapper-disabled`]:y,[`${L}-wrapper-in-form-item`]:m},r,o,D),M=xe({[`${L}-indeterminate`]:a},D),A=a?"mixed":void 0;return E(C.createElement("label",{className:T,style:l,onMouseEnter:c,onMouseLeave:u},C.createElement(mLe,Object.assign({"aria-checked":A},k,{prefixCls:L,className:M,disabled:y,ref:e})),s!==void 0&&C.createElement("span",null,s)))},PSt=C.forwardRef(ASt),ILe=PSt,LQ=ILe;LQ.Group=RSt;LQ.__ANT_CHECKBOX=!0;const oF=LQ,OSt=C.createContext({}),kLe=OSt,FSt=i=>{const{componentCls:e}=i;return{[e]:{display:"flex",flexFlow:"row wrap",minWidth:0,"&::before, &::after":{display:"flex"},"&-no-wrap":{flexWrap:"nowrap"},"&-start":{justifyContent:"flex-start"},"&-center":{justifyContent:"center"},"&-end":{justifyContent:"flex-end"},"&-space-between":{justifyContent:"space-between"},"&-space-around":{justifyContent:"space-around"},"&-space-evenly":{justifyContent:"space-evenly"},"&-top":{alignItems:"flex-start"},"&-middle":{alignItems:"center"},"&-bottom":{alignItems:"flex-end"}}}},BSt=i=>{const{componentCls:e}=i;return{[e]:{position:"relative",maxWidth:"100%",minHeight:1}}},WSt=(i,e)=>{const{componentCls:t,gridColumns:n}=i,r={};for(let o=n;o>=0;o--)o===0?(r[`${t}${e}-${o}`]={display:"none"},r[`${t}-push-${o}`]={insetInlineStart:"auto"},r[`${t}-pull-${o}`]={insetInlineEnd:"auto"},r[`${t}${e}-push-${o}`]={insetInlineStart:"auto"},r[`${t}${e}-pull-${o}`]={insetInlineEnd:"auto"},r[`${t}${e}-offset-${o}`]={marginInlineStart:0},r[`${t}${e}-order-${o}`]={order:0}):(r[`${t}${e}-${o}`]={display:"block",flex:`0 0 ${o/n*100}%`,maxWidth:`${o/n*100}%`},r[`${t}${e}-push-${o}`]={insetInlineStart:`${o/n*100}%`},r[`${t}${e}-pull-${o}`]={insetInlineEnd:`${o/n*100}%`},r[`${t}${e}-offset-${o}`]={marginInlineStart:`${o/n*100}%`},r[`${t}${e}-order-${o}`]={order:o});return r},xK=(i,e)=>WSt(i,e),$St=(i,e,t)=>({[`@media (min-width: ${e}px)`]:Object.assign({},xK(i,t))}),HSt=vo("Grid",i=>[FSt(i)]),VSt=vo("Grid",i=>{const e=Oi(i,{gridColumns:24}),t={"-sm":e.screenSMMin,"-md":e.screenMDMin,"-lg":e.screenLGMin,"-xl":e.screenXLMin,"-xxl":e.screenXXLMin};return[BSt(e),xK(e,""),xK(e,"-xs"),Object.keys(t).map(n=>$St(e,t[n],n)).reduce((n,r)=>Object.assign(Object.assign({},n),r),{})]});var zSt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{getPrefixCls:t,direction:n}=C.useContext(Rn),{gutter:r,wrap:o,supportFlexGap:s}=C.useContext(kLe),{prefixCls:a,span:l,order:c,offset:u,push:d,pull:h,className:f,children:g,flex:p,style:v}=i,m=zSt(i,["prefixCls","span","order","offset","push","pull","className","children","flex","style"]),_=t("col",a),[y,S]=VSt(_);let L={};jSt.forEach(k=>{let T={};const M=i[k];typeof M=="number"?T.span=M:typeof M=="object"&&(T=M||{}),delete m[k],L=Object.assign(Object.assign({},L),{[`${_}-${k}-${T.span}`]:T.span!==void 0,[`${_}-${k}-order-${T.order}`]:T.order||T.order===0,[`${_}-${k}-offset-${T.offset}`]:T.offset||T.offset===0,[`${_}-${k}-push-${T.push}`]:T.push||T.push===0,[`${_}-${k}-pull-${T.pull}`]:T.pull||T.pull===0,[`${_}-rtl`]:n==="rtl"})});const E=xe(_,{[`${_}-${l}`]:l!==void 0,[`${_}-order-${c}`]:c,[`${_}-offset-${u}`]:u,[`${_}-push-${d}`]:d,[`${_}-pull-${h}`]:h},f,L,S),D={};if(r&&r[0]>0){const k=r[0]/2;D.paddingLeft=k,D.paddingRight=k}if(r&&r[1]>0&&!s){const k=r[1]/2;D.paddingTop=k,D.paddingBottom=k}return p&&(D.flex=USt(p),o===!1&&!D.minWidth&&(D.minWidth=0)),y(C.createElement("div",Object.assign({},m,{style:Object.assign(Object.assign({},D),v),className:E,ref:e}),g))}),GSt=KSt;var qSt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{if(typeof i=="string"&&n(i),typeof i=="object")for(let o=0;o{r()},[JSON.stringify(i),e]),t}const XSt=C.forwardRef((i,e)=>{const{prefixCls:t,justify:n,align:r,className:o,style:s,children:a,gutter:l=0,wrap:c}=i,u=qSt(i,["prefixCls","justify","align","className","style","children","gutter","wrap"]),{getPrefixCls:d,direction:h}=C.useContext(Rn),[f,g]=C.useState({xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0}),[p,v]=C.useState({xs:!1,sm:!1,md:!1,lg:!1,xl:!1,xxl:!1}),m=que(r,p),_=que(n,p),y=cLe(),S=C.useRef(l),L=Cxe();C.useEffect(()=>{const U=L.subscribe(K=>{v(K);const re=S.current||0;(!Array.isArray(re)&&typeof re=="object"||Array.isArray(re)&&(typeof re[0]=="object"||typeof re[1]=="object"))&&g(K)});return()=>L.unsubscribe(U)},[]);const E=()=>{const U=[void 0,void 0];return(Array.isArray(l)?l:[l,void 0]).forEach((re,Y)=>{if(typeof re=="object")for(let J=0;J0?M[0]/-2:void 0,F=M[1]!=null&&M[1]>0?M[1]/-2:void 0;R&&(N.marginLeft=R,N.marginRight=R),y?[,N.rowGap]=M:F&&(N.marginTop=F,N.marginBottom=F);const[W,H]=M,G=C.useMemo(()=>({gutter:[W,H],wrap:c,supportFlexGap:y}),[W,H,c,y]);return k(C.createElement(kLe.Provider,{value:G},C.createElement("div",Object.assign({},u,{className:A,style:Object.assign(Object.assign({},N),s),ref:e}),a)))}),YSt=XSt;function Xue(i){var e=i.getBoundingClientRect(),t=document.documentElement;return{left:e.left+(window.pageXOffset||t.scrollLeft)-(t.clientLeft||document.body.clientLeft||0),top:e.top+(window.pageYOffset||t.scrollTop)-(t.clientTop||document.body.clientTop||0)}}const ZSt=i=>{const{getPrefixCls:e,direction:t}=C.useContext(Rn),{prefixCls:n,className:r=""}=i,o=e("input-group",n),s=e("input"),[a,l]=yQ(s),c=xe(o,{[`${o}-lg`]:i.size==="large",[`${o}-sm`]:i.size==="small",[`${o}-compact`]:i.compact,[`${o}-rtl`]:t==="rtl"},l,r),u=C.useContext(Zf),d=C.useMemo(()=>Object.assign(Object.assign({},u),{isFormItemInput:!1}),[u]);return a(C.createElement("span",{className:c,style:i.style,onMouseEnter:i.onMouseEnter,onMouseLeave:i.onMouseLeave,onFocus:i.onFocus,onBlur:i.onBlur},C.createElement(Zf.Provider,{value:d},i.children)))},QSt=ZSt;function L1(i){return!!(i.addonBefore||i.addonAfter)}function N7(i){return!!(i.prefix||i.suffix||i.allowClear)}function YE(i,e,t,n){if(t){var r=e;if(e.type==="click"){var o=i.cloneNode(!0);r=Object.create(e,{target:{value:o},currentTarget:{value:o}}),o.value="",t(r);return}if(n!==void 0){r=Object.create(e,{target:{value:i},currentTarget:{value:i}}),i.value=n,t(r);return}t(r)}}function JSt(i,e){if(i){i.focus(e);var t=e||{},n=t.cursor;if(n){var r=i.value.length;switch(n){case"start":i.setSelectionRange(0,0);break;case"end":i.setSelectionRange(r,r);break;default:i.setSelectionRange(0,r)}}}}function LK(i){return typeof i>"u"||i===null?"":String(i)}var TLe=function(e){var t,n,r=e.inputElement,o=e.prefixCls,s=e.prefix,a=e.suffix,l=e.addonBefore,c=e.addonAfter,u=e.className,d=e.style,h=e.disabled,f=e.readOnly,g=e.focused,p=e.triggerFocus,v=e.allowClear,m=e.value,_=e.handleReset,y=e.hidden,S=e.classes,L=e.classNames,E=e.dataAttrs,D=e.styles,k=C.useRef(null),T=function(Y){var J;(J=k.current)!==null&&J!==void 0&&J.contains(Y.target)&&(p==null||p())},M=function(){var Y;if(!v)return null;var J=!h&&!f&&m,Q="".concat(o,"-clear-icon"),ue=zn(v)==="object"&&v!==null&&v!==void 0&&v.clearIcon?v.clearIcon:"✖";return $e.createElement("span",{onClick:_,onMouseDown:function(_e){return _e.preventDefault()},className:xe(Q,(Y={},be(Y,"".concat(Q,"-hidden"),!J),be(Y,"".concat(Q,"-has-suffix"),!!a),Y)),role:"button",tabIndex:-1},ue)},A=C.cloneElement(r,{value:m,hidden:y,className:xe((t=r.props)===null||t===void 0?void 0:t.className,!N7(e)&&!L1(e)&&u)||null,style:te(te({},(n=r.props)===null||n===void 0?void 0:n.style),!N7(e)&&!L1(e)?d:{})});if(N7(e)){var N,R="".concat(o,"-affix-wrapper"),F=xe(R,(N={},be(N,"".concat(R,"-disabled"),h),be(N,"".concat(R,"-focused"),g),be(N,"".concat(R,"-readonly"),f),be(N,"".concat(R,"-input-with-clear-btn"),a&&v&&m),N),!L1(e)&&u,S==null?void 0:S.affixWrapper),W=(a||v)&&$e.createElement("span",{className:xe("".concat(o,"-suffix"),L==null?void 0:L.suffix),style:D==null?void 0:D.suffix},M(),a);A=$e.createElement("span",St({className:F,style:L1(e)?void 0:d,hidden:!L1(e)&&y,onClick:T},E==null?void 0:E.affixWrapper,{ref:k}),s&&$e.createElement("span",{className:xe("".concat(o,"-prefix"),L==null?void 0:L.prefix),style:D==null?void 0:D.prefix},s),C.cloneElement(r,{value:m,hidden:null}),W)}if(L1(e)){var H="".concat(o,"-group"),G="".concat(H,"-addon"),U=xe("".concat(o,"-wrapper"),H,S==null?void 0:S.wrapper),K=xe("".concat(o,"-group-wrapper"),u,S==null?void 0:S.group);return $e.createElement("span",{className:K,style:d,hidden:y},$e.createElement("span",{className:U},l&&$e.createElement("span",{className:G},l),C.cloneElement(A,{hidden:null}),c&&$e.createElement("span",{className:G},c)))}return A},ext=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","classes","classNames","styles"],txt=C.forwardRef(function(i,e){var t=i.autoComplete,n=i.onChange,r=i.onFocus,o=i.onBlur,s=i.onPressEnter,a=i.onKeyDown,l=i.prefixCls,c=l===void 0?"rc-input":l,u=i.disabled,d=i.htmlSize,h=i.className,f=i.maxLength,g=i.suffix,p=i.showCount,v=i.type,m=v===void 0?"text":v,_=i.classes,y=i.classNames,S=i.styles,L=Nn(i,ext),E=Ja(i.defaultValue,{value:i.value}),D=Ae(E,2),k=D[0],T=D[1],M=C.useState(!1),A=Ae(M,2),N=A[0],R=A[1],F=C.useRef(null),W=function(ue){F.current&&JSt(F.current,ue)};C.useImperativeHandle(e,function(){return{focus:W,blur:function(){var ue;(ue=F.current)===null||ue===void 0||ue.blur()},setSelectionRange:function(ue,de,_e){var ve;(ve=F.current)===null||ve===void 0||ve.setSelectionRange(ue,de,_e)},select:function(){var ue;(ue=F.current)===null||ue===void 0||ue.select()},input:F.current}}),C.useEffect(function(){R(function(Q){return Q&&u?!1:Q})},[u]);var H=function(ue){i.value===void 0&&T(ue.target.value),F.current&&YE(F.current,ue,n)},G=function(ue){s&&ue.key==="Enter"&&s(ue),a==null||a(ue)},U=function(ue){R(!0),r==null||r(ue)},K=function(ue){R(!1),o==null||o(ue)},re=function(ue){T(""),W(),F.current&&YE(F.current,ue,n)},Y=function(){var ue=ll(i,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","classes","htmlSize","styles","classNames"]);return $e.createElement("input",St({autoComplete:t},ue,{onChange:H,onFocus:U,onBlur:K,onKeyDown:G,className:xe(c,be({},"".concat(c,"-disabled"),u),y==null?void 0:y.input),style:S==null?void 0:S.input,ref:F,size:d,type:m}))},J=function(){var ue=Number(f)>0;if(g||p){var de=LK(k),_e=ft(de).length,ve=zn(p)==="object"?p.formatter({value:de,count:_e,maxLength:f}):"".concat(_e).concat(ue?" / ".concat(f):"");return $e.createElement($e.Fragment,null,!!p&&$e.createElement("span",{className:xe("".concat(c,"-show-count-suffix"),be({},"".concat(c,"-show-count-has-suffix"),!!g),y==null?void 0:y.count),style:te({},S==null?void 0:S.count)},ve),g)}return null};return $e.createElement(TLe,St({},L,{prefixCls:c,className:h,inputElement:Y(),handleReset:re,value:LK(k),focused:N,triggerFocus:W,suffix:J(),disabled:u,classes:_,classNames:y,styles:S}))});function NLe(i,e){const t=C.useRef([]),n=()=>{t.current.push(setTimeout(()=>{var r,o,s,a;!((r=i.current)===null||r===void 0)&&r.input&&((o=i.current)===null||o===void 0?void 0:o.input.getAttribute("type"))==="password"&&(!((s=i.current)===null||s===void 0)&&s.input.hasAttribute("value"))&&((a=i.current)===null||a===void 0||a.input.removeAttribute("value"))}))};return C.useEffect(()=>(e&&n(),()=>t.current.forEach(r=>{r&&clearTimeout(r)})),[]),n}function nxt(i){return!!(i.prefix||i.suffix||i.allowClear)}var ixt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{prefixCls:t,bordered:n=!0,status:r,size:o,disabled:s,onBlur:a,onFocus:l,suffix:c,allowClear:u,addonAfter:d,addonBefore:h,className:f,rootClassName:g,onChange:p,classNames:v}=i,m=ixt(i,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","rootClassName","onChange","classNames"]),{getPrefixCls:_,direction:y,input:S}=$e.useContext(Rn),L=_("input",t),E=C.useRef(null),[D,k]=yQ(L),{compactSize:T,compactItemClassnames:M}=QS(L,y),A=$e.useContext(Rh),N=T||o||A,R=$e.useContext(H_),F=s??R,{status:W,hasFeedback:H,feedbackIcon:G}=C.useContext(Zf),U=O5(W,r),K=nxt(i)||!!H,re=C.useRef(K);C.useEffect(()=>{K&&re.current,re.current=K},[K]);const Y=NLe(E,!0),J=ve=>{Y(),a==null||a(ve)},Q=ve=>{Y(),l==null||l(ve)},ue=ve=>{Y(),p==null||p(ve)},de=(H||c)&&$e.createElement($e.Fragment,null,c,H&&G);let _e;return typeof u=="object"&&(u!=null&&u.clearIcon)?_e=u:u&&(_e={clearIcon:$e.createElement(XS,null)}),D($e.createElement(txt,Object.assign({ref:vu(e,E),prefixCls:L,autoComplete:S==null?void 0:S.autoComplete},m,{disabled:F,onBlur:J,onFocus:Q,suffix:de,allowClear:_e,className:xe(f,g,M),onChange:ue,addonAfter:d&&$e.createElement(gS,null,$e.createElement(ck,{override:!0,status:!0},d)),addonBefore:h&&$e.createElement(gS,null,$e.createElement(ck,{override:!0,status:!0},h)),classNames:Object.assign(Object.assign({},v),{input:xe({[`${L}-sm`]:N==="small",[`${L}-lg`]:N==="large",[`${L}-rtl`]:y==="rtl",[`${L}-borderless`]:!n},!K&&Cp(L,U),v==null?void 0:v.input,k)}),classes:{affixWrapper:xe({[`${L}-affix-wrapper-sm`]:N==="small",[`${L}-affix-wrapper-lg`]:N==="large",[`${L}-affix-wrapper-rtl`]:y==="rtl",[`${L}-affix-wrapper-borderless`]:!n},Cp(`${L}-affix-wrapper`,U,H),k),wrapper:xe({[`${L}-group-rtl`]:y==="rtl"},k),group:xe({[`${L}-group-wrapper-sm`]:N==="small",[`${L}-group-wrapper-lg`]:N==="large",[`${L}-group-wrapper-rtl`]:y==="rtl",[`${L}-group-wrapper-disabled`]:F},Cp(`${L}-group-wrapper`,U,H),k)}})))}),EQ=oxt;var sxt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);ri?C.createElement(Qye,null):C.createElement($ht,null),lxt={click:"onClick",hover:"onMouseOver"},cxt=C.forwardRef((i,e)=>{const{visibilityToggle:t=!0}=i,n=typeof t=="object"&&t.visible!==void 0,[r,o]=C.useState(()=>n?t.visible:!1),s=C.useRef(null);C.useEffect(()=>{n&&o(t.visible)},[n,t]);const a=NLe(s),l=()=>{const{disabled:L}=i;L||(r&&a(),o(E=>{var D;const k=!E;return typeof t=="object"&&((D=t.onVisibleChange)===null||D===void 0||D.call(t,k)),k}))},c=L=>{const{action:E="click",iconRender:D=axt}=i,k=lxt[E]||"",T=D(r),M={[k]:l,className:`${L}-icon`,key:"passwordIcon",onMouseDown:A=>{A.preventDefault()},onMouseUp:A=>{A.preventDefault()}};return C.cloneElement(C.isValidElement(T)?T:C.createElement("span",null,T),M)},{className:u,prefixCls:d,inputPrefixCls:h,size:f}=i,g=sxt(i,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:p}=C.useContext(Rn),v=p("input",h),m=p("input-password",d),_=t&&c(m),y=xe(m,u,{[`${m}-${f}`]:!!f}),S=Object.assign(Object.assign({},ll(g,["suffix","iconRender","visibilityToggle"])),{type:r?"text":"password",className:y,prefixCls:v,suffix:_});return f&&(S.size=f),C.createElement(EQ,Object.assign({ref:vu(e,s)},S))}),uxt=cxt;var dxt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{prefixCls:t,inputPrefixCls:n,className:r,size:o,suffix:s,enterButton:a=!1,addonAfter:l,loading:c,disabled:u,onSearch:d,onChange:h,onCompositionStart:f,onCompositionEnd:g}=i,p=dxt(i,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),{getPrefixCls:v,direction:m}=C.useContext(Rn),_=C.useContext(Rh),y=C.useRef(!1),S=v("input-search",t),L=v("input",n),{compactSize:E}=QS(S,m),D=E||o||_,k=C.useRef(null),T=Y=>{Y&&Y.target&&Y.type==="click"&&d&&d(Y.target.value,Y),h&&h(Y)},M=Y=>{var J;document.activeElement===((J=k.current)===null||J===void 0?void 0:J.input)&&Y.preventDefault()},A=Y=>{var J,Q;d&&d((Q=(J=k.current)===null||J===void 0?void 0:J.input)===null||Q===void 0?void 0:Q.value,Y)},N=Y=>{y.current||c||A(Y)},R=typeof a=="boolean"?C.createElement(IZ,null):null,F=`${S}-button`;let W;const H=a||{},G=H.type&&H.type.__ANT_BUTTON===!0;G||H.type==="button"?W=Qs(H,Object.assign({onMouseDown:M,onClick:Y=>{var J,Q;(Q=(J=H==null?void 0:H.props)===null||J===void 0?void 0:J.onClick)===null||Q===void 0||Q.call(J,Y),A(Y)},key:"enterButton"},G?{className:F,size:D}:{})):W=C.createElement(Ju,{className:F,type:a?"primary":void 0,size:D,disabled:u,key:"enterButton",onMouseDown:M,onClick:A,loading:c,icon:R},a),l&&(W=[W,Qs(l,{key:"addonAfter"})]);const U=xe(S,{[`${S}-rtl`]:m==="rtl",[`${S}-${D}`]:!!D,[`${S}-with-button`]:!!a},r),K=Y=>{y.current=!0,f==null||f(Y)},re=Y=>{y.current=!1,g==null||g(Y)};return C.createElement(EQ,Object.assign({ref:vu(k,e),onPressEnter:N},p,{size:D,onCompositionStart:K,onCompositionEnd:re,prefixCls:L,addonAfter:W,suffix:s,onChange:T,className:U,disabled:u}))}),fxt=hxt;var gxt=` + `]:{[`&:hover ${e}-inner`]:{backgroundColor:i.colorPrimaryHover,borderColor:"transparent"},[`&:hover ${e}:after`]:{borderColor:i.colorPrimaryHover}}},{[`${t}-disabled`]:{cursor:"not-allowed"},[`${e}-disabled`]:{[`&, ${e}-input`]:{cursor:"not-allowed",pointerEvents:"none"},[`${e}-inner`]:{background:i.colorBgContainerDisabled,borderColor:i.colorBorder,"&:after":{borderColor:i.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:i.colorTextDisabled},[`&${e}-indeterminate ${e}-inner::after`]:{background:i.colorTextDisabled}}}]};function LLe(i,e){const t=Oi(e,{checkboxCls:`.${i}`,checkboxSize:e.controlInteractiveSize});return[ISt(t)]}const ELe=vo("Checkbox",(i,e)=>{let{prefixCls:t}=e;return[LLe(t,i)]});var kSt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var{defaultValue:t,children:n,options:r=[],prefixCls:o,className:s,rootClassName:a,style:l,onChange:c}=i,u=kSt(i,["defaultValue","children","options","prefixCls","className","rootClassName","style","onChange"]);const{getPrefixCls:d,direction:h}=C.useContext(Rn),[f,g]=C.useState(u.value||t||[]),[p,v]=C.useState([]);C.useEffect(()=>{"value"in u&&g(u.value||[])},[u.value]);const m=()=>r.map(N=>typeof N=="string"||typeof N=="number"?{label:N,value:N}:N),_=N=>{v(R=>R.filter(F=>F!==N))},y=N=>{v(R=>[].concat(ft(R),[N]))},S=N=>{const R=f.indexOf(N.value),F=ft(f);R===-1?F.push(N.value):F.splice(R,1),"value"in u||g(F);const W=m();c==null||c(F.filter(H=>p.includes(H)).sort((H,G)=>{const U=W.findIndex(re=>re.value===H),K=W.findIndex(re=>re.value===G);return U-K}))},L=d("checkbox",o),E=`${L}-group`,[D,k]=ELe(L),T=ll(u,["value","disabled"]);r&&r.length>0&&(n=m().map(N=>C.createElement(ILe,{prefixCls:L,key:N.value.toString(),disabled:"disabled"in N?N.disabled:u.disabled,value:N.value,checked:f.includes(N.value),onChange:N.onChange,className:`${E}-item`,style:N.style},N.label)));const M={toggleOption:S,value:f,disabled:u.disabled,name:u.name,registerValue:y,cancelValue:_},A=xe(E,{[`${E}-rtl`]:h==="rtl"},s,a,k);return D(C.createElement("div",Object.assign({className:A,style:l},T,{ref:e}),C.createElement(DLe.Provider,{value:M},n)))},NSt=C.forwardRef(TSt),RSt=C.memo(NSt);var MSt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var t,{prefixCls:n,className:r,rootClassName:o,children:s,indeterminate:a=!1,style:l,onMouseEnter:c,onMouseLeave:u,skipGroup:d=!1,disabled:h}=i,f=MSt(i,["prefixCls","className","rootClassName","children","indeterminate","style","onMouseEnter","onMouseLeave","skipGroup","disabled"]);const{getPrefixCls:g,direction:p}=C.useContext(Rn),v=C.useContext(DLe),{isFormItemInput:m}=C.useContext(Zf),_=C.useContext($_),y=(t=(v==null?void 0:v.disabled)||h)!==null&&t!==void 0?t:_,S=C.useRef(f.value);C.useEffect(()=>{v==null||v.registerValue(f.value)},[]),C.useEffect(()=>{if(!d)return f.value!==S.current&&(v==null||v.cancelValue(S.current),v==null||v.registerValue(f.value),S.current=f.value),()=>v==null?void 0:v.cancelValue(f.value)},[f.value]);const L=g("checkbox",n),[E,D]=ELe(L),k=Object.assign({},f);v&&!d&&(k.onChange=function(){f.onChange&&f.onChange.apply(f,arguments),v.toggleOption&&v.toggleOption({label:s,value:f.value})},k.name=v.name,k.checked=v.value.includes(f.value));const T=xe({[`${L}-wrapper`]:!0,[`${L}-rtl`]:p==="rtl",[`${L}-wrapper-checked`]:k.checked,[`${L}-wrapper-disabled`]:y,[`${L}-wrapper-in-form-item`]:m},r,o,D),M=xe({[`${L}-indeterminate`]:a},D),A=a?"mixed":void 0;return E(C.createElement("label",{className:T,style:l,onMouseEnter:c,onMouseLeave:u},C.createElement(mLe,Object.assign({"aria-checked":A},k,{prefixCls:L,className:M,disabled:y,ref:e})),s!==void 0&&C.createElement("span",null,s)))},PSt=C.forwardRef(ASt),ILe=PSt,LQ=ILe;LQ.Group=RSt;LQ.__ANT_CHECKBOX=!0;const oF=LQ,OSt=C.createContext({}),kLe=OSt,FSt=i=>{const{componentCls:e}=i;return{[e]:{display:"flex",flexFlow:"row wrap",minWidth:0,"&::before, &::after":{display:"flex"},"&-no-wrap":{flexWrap:"nowrap"},"&-start":{justifyContent:"flex-start"},"&-center":{justifyContent:"center"},"&-end":{justifyContent:"flex-end"},"&-space-between":{justifyContent:"space-between"},"&-space-around":{justifyContent:"space-around"},"&-space-evenly":{justifyContent:"space-evenly"},"&-top":{alignItems:"flex-start"},"&-middle":{alignItems:"center"},"&-bottom":{alignItems:"flex-end"}}}},BSt=i=>{const{componentCls:e}=i;return{[e]:{position:"relative",maxWidth:"100%",minHeight:1}}},WSt=(i,e)=>{const{componentCls:t,gridColumns:n}=i,r={};for(let o=n;o>=0;o--)o===0?(r[`${t}${e}-${o}`]={display:"none"},r[`${t}-push-${o}`]={insetInlineStart:"auto"},r[`${t}-pull-${o}`]={insetInlineEnd:"auto"},r[`${t}${e}-push-${o}`]={insetInlineStart:"auto"},r[`${t}${e}-pull-${o}`]={insetInlineEnd:"auto"},r[`${t}${e}-offset-${o}`]={marginInlineStart:0},r[`${t}${e}-order-${o}`]={order:0}):(r[`${t}${e}-${o}`]={display:"block",flex:`0 0 ${o/n*100}%`,maxWidth:`${o/n*100}%`},r[`${t}${e}-push-${o}`]={insetInlineStart:`${o/n*100}%`},r[`${t}${e}-pull-${o}`]={insetInlineEnd:`${o/n*100}%`},r[`${t}${e}-offset-${o}`]={marginInlineStart:`${o/n*100}%`},r[`${t}${e}-order-${o}`]={order:o});return r},xK=(i,e)=>WSt(i,e),$St=(i,e,t)=>({[`@media (min-width: ${e}px)`]:Object.assign({},xK(i,t))}),HSt=vo("Grid",i=>[FSt(i)]),VSt=vo("Grid",i=>{const e=Oi(i,{gridColumns:24}),t={"-sm":e.screenSMMin,"-md":e.screenMDMin,"-lg":e.screenLGMin,"-xl":e.screenXLMin,"-xxl":e.screenXXLMin};return[BSt(e),xK(e,""),xK(e,"-xs"),Object.keys(t).map(n=>$St(e,t[n],n)).reduce((n,r)=>Object.assign(Object.assign({},n),r),{})]});var zSt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{getPrefixCls:t,direction:n}=C.useContext(Rn),{gutter:r,wrap:o,supportFlexGap:s}=C.useContext(kLe),{prefixCls:a,span:l,order:c,offset:u,push:d,pull:h,className:f,children:g,flex:p,style:v}=i,m=zSt(i,["prefixCls","span","order","offset","push","pull","className","children","flex","style"]),_=t("col",a),[y,S]=VSt(_);let L={};jSt.forEach(k=>{let T={};const M=i[k];typeof M=="number"?T.span=M:typeof M=="object"&&(T=M||{}),delete m[k],L=Object.assign(Object.assign({},L),{[`${_}-${k}-${T.span}`]:T.span!==void 0,[`${_}-${k}-order-${T.order}`]:T.order||T.order===0,[`${_}-${k}-offset-${T.offset}`]:T.offset||T.offset===0,[`${_}-${k}-push-${T.push}`]:T.push||T.push===0,[`${_}-${k}-pull-${T.pull}`]:T.pull||T.pull===0,[`${_}-rtl`]:n==="rtl"})});const E=xe(_,{[`${_}-${l}`]:l!==void 0,[`${_}-order-${c}`]:c,[`${_}-offset-${u}`]:u,[`${_}-push-${d}`]:d,[`${_}-pull-${h}`]:h},f,L,S),D={};if(r&&r[0]>0){const k=r[0]/2;D.paddingLeft=k,D.paddingRight=k}if(r&&r[1]>0&&!s){const k=r[1]/2;D.paddingTop=k,D.paddingBottom=k}return p&&(D.flex=USt(p),o===!1&&!D.minWidth&&(D.minWidth=0)),y(C.createElement("div",Object.assign({},m,{style:Object.assign(Object.assign({},D),v),className:E,ref:e}),g))}),GSt=KSt;var qSt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{if(typeof i=="string"&&n(i),typeof i=="object")for(let o=0;o{r()},[JSON.stringify(i),e]),t}const XSt=C.forwardRef((i,e)=>{const{prefixCls:t,justify:n,align:r,className:o,style:s,children:a,gutter:l=0,wrap:c}=i,u=qSt(i,["prefixCls","justify","align","className","style","children","gutter","wrap"]),{getPrefixCls:d,direction:h}=C.useContext(Rn),[f,g]=C.useState({xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0}),[p,v]=C.useState({xs:!1,sm:!1,md:!1,lg:!1,xl:!1,xxl:!1}),m=que(r,p),_=que(n,p),y=cLe(),S=C.useRef(l),L=Cxe();C.useEffect(()=>{const U=L.subscribe(K=>{v(K);const re=S.current||0;(!Array.isArray(re)&&typeof re=="object"||Array.isArray(re)&&(typeof re[0]=="object"||typeof re[1]=="object"))&&g(K)});return()=>L.unsubscribe(U)},[]);const E=()=>{const U=[void 0,void 0];return(Array.isArray(l)?l:[l,void 0]).forEach((re,Y)=>{if(typeof re=="object")for(let J=0;J0?M[0]/-2:void 0,F=M[1]!=null&&M[1]>0?M[1]/-2:void 0;R&&(N.marginLeft=R,N.marginRight=R),y?[,N.rowGap]=M:F&&(N.marginTop=F,N.marginBottom=F);const[W,H]=M,G=C.useMemo(()=>({gutter:[W,H],wrap:c,supportFlexGap:y}),[W,H,c,y]);return k(C.createElement(kLe.Provider,{value:G},C.createElement("div",Object.assign({},u,{className:A,style:Object.assign(Object.assign({},N),s),ref:e}),a)))}),YSt=XSt;function Xue(i){var e=i.getBoundingClientRect(),t=document.documentElement;return{left:e.left+(window.pageXOffset||t.scrollLeft)-(t.clientLeft||document.body.clientLeft||0),top:e.top+(window.pageYOffset||t.scrollTop)-(t.clientTop||document.body.clientTop||0)}}const ZSt=i=>{const{getPrefixCls:e,direction:t}=C.useContext(Rn),{prefixCls:n,className:r=""}=i,o=e("input-group",n),s=e("input"),[a,l]=yQ(s),c=xe(o,{[`${o}-lg`]:i.size==="large",[`${o}-sm`]:i.size==="small",[`${o}-compact`]:i.compact,[`${o}-rtl`]:t==="rtl"},l,r),u=C.useContext(Zf),d=C.useMemo(()=>Object.assign(Object.assign({},u),{isFormItemInput:!1}),[u]);return a(C.createElement("span",{className:c,style:i.style,onMouseEnter:i.onMouseEnter,onMouseLeave:i.onMouseLeave,onFocus:i.onFocus,onBlur:i.onBlur},C.createElement(Zf.Provider,{value:d},i.children)))},QSt=ZSt;function L1(i){return!!(i.addonBefore||i.addonAfter)}function N7(i){return!!(i.prefix||i.suffix||i.allowClear)}function YE(i,e,t,n){if(t){var r=e;if(e.type==="click"){var o=i.cloneNode(!0);r=Object.create(e,{target:{value:o},currentTarget:{value:o}}),o.value="",t(r);return}if(n!==void 0){r=Object.create(e,{target:{value:i},currentTarget:{value:i}}),i.value=n,t(r);return}t(r)}}function JSt(i,e){if(i){i.focus(e);var t=e||{},n=t.cursor;if(n){var r=i.value.length;switch(n){case"start":i.setSelectionRange(0,0);break;case"end":i.setSelectionRange(r,r);break;default:i.setSelectionRange(0,r)}}}}function LK(i){return typeof i>"u"||i===null?"":String(i)}var TLe=function(e){var t,n,r=e.inputElement,o=e.prefixCls,s=e.prefix,a=e.suffix,l=e.addonBefore,c=e.addonAfter,u=e.className,d=e.style,h=e.disabled,f=e.readOnly,g=e.focused,p=e.triggerFocus,v=e.allowClear,m=e.value,_=e.handleReset,y=e.hidden,S=e.classes,L=e.classNames,E=e.dataAttrs,D=e.styles,k=C.useRef(null),T=function(Y){var J;(J=k.current)!==null&&J!==void 0&&J.contains(Y.target)&&(p==null||p())},M=function(){var Y;if(!v)return null;var J=!h&&!f&&m,Q="".concat(o,"-clear-icon"),ue=zn(v)==="object"&&v!==null&&v!==void 0&&v.clearIcon?v.clearIcon:"✖";return $e.createElement("span",{onClick:_,onMouseDown:function(_e){return _e.preventDefault()},className:xe(Q,(Y={},be(Y,"".concat(Q,"-hidden"),!J),be(Y,"".concat(Q,"-has-suffix"),!!a),Y)),role:"button",tabIndex:-1},ue)},A=C.cloneElement(r,{value:m,hidden:y,className:xe((t=r.props)===null||t===void 0?void 0:t.className,!N7(e)&&!L1(e)&&u)||null,style:te(te({},(n=r.props)===null||n===void 0?void 0:n.style),!N7(e)&&!L1(e)?d:{})});if(N7(e)){var N,R="".concat(o,"-affix-wrapper"),F=xe(R,(N={},be(N,"".concat(R,"-disabled"),h),be(N,"".concat(R,"-focused"),g),be(N,"".concat(R,"-readonly"),f),be(N,"".concat(R,"-input-with-clear-btn"),a&&v&&m),N),!L1(e)&&u,S==null?void 0:S.affixWrapper),W=(a||v)&&$e.createElement("span",{className:xe("".concat(o,"-suffix"),L==null?void 0:L.suffix),style:D==null?void 0:D.suffix},M(),a);A=$e.createElement("span",St({className:F,style:L1(e)?void 0:d,hidden:!L1(e)&&y,onClick:T},E==null?void 0:E.affixWrapper,{ref:k}),s&&$e.createElement("span",{className:xe("".concat(o,"-prefix"),L==null?void 0:L.prefix),style:D==null?void 0:D.prefix},s),C.cloneElement(r,{value:m,hidden:null}),W)}if(L1(e)){var H="".concat(o,"-group"),G="".concat(H,"-addon"),U=xe("".concat(o,"-wrapper"),H,S==null?void 0:S.wrapper),K=xe("".concat(o,"-group-wrapper"),u,S==null?void 0:S.group);return $e.createElement("span",{className:K,style:d,hidden:y},$e.createElement("span",{className:U},l&&$e.createElement("span",{className:G},l),C.cloneElement(A,{hidden:null}),c&&$e.createElement("span",{className:G},c)))}return A},ext=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","classes","classNames","styles"],txt=C.forwardRef(function(i,e){var t=i.autoComplete,n=i.onChange,r=i.onFocus,o=i.onBlur,s=i.onPressEnter,a=i.onKeyDown,l=i.prefixCls,c=l===void 0?"rc-input":l,u=i.disabled,d=i.htmlSize,h=i.className,f=i.maxLength,g=i.suffix,p=i.showCount,v=i.type,m=v===void 0?"text":v,_=i.classes,y=i.classNames,S=i.styles,L=Nn(i,ext),E=Ja(i.defaultValue,{value:i.value}),D=Ae(E,2),k=D[0],T=D[1],M=C.useState(!1),A=Ae(M,2),N=A[0],R=A[1],F=C.useRef(null),W=function(ue){F.current&&JSt(F.current,ue)};C.useImperativeHandle(e,function(){return{focus:W,blur:function(){var ue;(ue=F.current)===null||ue===void 0||ue.blur()},setSelectionRange:function(ue,de,_e){var ve;(ve=F.current)===null||ve===void 0||ve.setSelectionRange(ue,de,_e)},select:function(){var ue;(ue=F.current)===null||ue===void 0||ue.select()},input:F.current}}),C.useEffect(function(){R(function(Q){return Q&&u?!1:Q})},[u]);var H=function(ue){i.value===void 0&&T(ue.target.value),F.current&&YE(F.current,ue,n)},G=function(ue){s&&ue.key==="Enter"&&s(ue),a==null||a(ue)},U=function(ue){R(!0),r==null||r(ue)},K=function(ue){R(!1),o==null||o(ue)},re=function(ue){T(""),W(),F.current&&YE(F.current,ue,n)},Y=function(){var ue=ll(i,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","classes","htmlSize","styles","classNames"]);return $e.createElement("input",St({autoComplete:t},ue,{onChange:H,onFocus:U,onBlur:K,onKeyDown:G,className:xe(c,be({},"".concat(c,"-disabled"),u),y==null?void 0:y.input),style:S==null?void 0:S.input,ref:F,size:d,type:m}))},J=function(){var ue=Number(f)>0;if(g||p){var de=LK(k),_e=ft(de).length,ve=zn(p)==="object"?p.formatter({value:de,count:_e,maxLength:f}):"".concat(_e).concat(ue?" / ".concat(f):"");return $e.createElement($e.Fragment,null,!!p&&$e.createElement("span",{className:xe("".concat(c,"-show-count-suffix"),be({},"".concat(c,"-show-count-has-suffix"),!!g),y==null?void 0:y.count),style:te({},S==null?void 0:S.count)},ve),g)}return null};return $e.createElement(TLe,St({},L,{prefixCls:c,className:h,inputElement:Y(),handleReset:re,value:LK(k),focused:N,triggerFocus:W,suffix:J(),disabled:u,classes:_,classNames:y,styles:S}))});function NLe(i,e){const t=C.useRef([]),n=()=>{t.current.push(setTimeout(()=>{var r,o,s,a;!((r=i.current)===null||r===void 0)&&r.input&&((o=i.current)===null||o===void 0?void 0:o.input.getAttribute("type"))==="password"&&(!((s=i.current)===null||s===void 0)&&s.input.hasAttribute("value"))&&((a=i.current)===null||a===void 0||a.input.removeAttribute("value"))}))};return C.useEffect(()=>(e&&n(),()=>t.current.forEach(r=>{r&&clearTimeout(r)})),[]),n}function nxt(i){return!!(i.prefix||i.suffix||i.allowClear)}var ixt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{prefixCls:t,bordered:n=!0,status:r,size:o,disabled:s,onBlur:a,onFocus:l,suffix:c,allowClear:u,addonAfter:d,addonBefore:h,className:f,rootClassName:g,onChange:p,classNames:v}=i,m=ixt(i,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","rootClassName","onChange","classNames"]),{getPrefixCls:_,direction:y,input:S}=$e.useContext(Rn),L=_("input",t),E=C.useRef(null),[D,k]=yQ(L),{compactSize:T,compactItemClassnames:M}=QS(L,y),A=$e.useContext(Rh),N=T||o||A,R=$e.useContext($_),F=s??R,{status:W,hasFeedback:H,feedbackIcon:G}=C.useContext(Zf),U=O5(W,r),K=nxt(i)||!!H,re=C.useRef(K);C.useEffect(()=>{K&&re.current,re.current=K},[K]);const Y=NLe(E,!0),J=ve=>{Y(),a==null||a(ve)},Q=ve=>{Y(),l==null||l(ve)},ue=ve=>{Y(),p==null||p(ve)},de=(H||c)&&$e.createElement($e.Fragment,null,c,H&&G);let _e;return typeof u=="object"&&(u!=null&&u.clearIcon)?_e=u:u&&(_e={clearIcon:$e.createElement(XS,null)}),D($e.createElement(txt,Object.assign({ref:vu(e,E),prefixCls:L,autoComplete:S==null?void 0:S.autoComplete},m,{disabled:F,onBlur:J,onFocus:Q,suffix:de,allowClear:_e,className:xe(f,g,M),onChange:ue,addonAfter:d&&$e.createElement(gS,null,$e.createElement(ck,{override:!0,status:!0},d)),addonBefore:h&&$e.createElement(gS,null,$e.createElement(ck,{override:!0,status:!0},h)),classNames:Object.assign(Object.assign({},v),{input:xe({[`${L}-sm`]:N==="small",[`${L}-lg`]:N==="large",[`${L}-rtl`]:y==="rtl",[`${L}-borderless`]:!n},!K&&Cp(L,U),v==null?void 0:v.input,k)}),classes:{affixWrapper:xe({[`${L}-affix-wrapper-sm`]:N==="small",[`${L}-affix-wrapper-lg`]:N==="large",[`${L}-affix-wrapper-rtl`]:y==="rtl",[`${L}-affix-wrapper-borderless`]:!n},Cp(`${L}-affix-wrapper`,U,H),k),wrapper:xe({[`${L}-group-rtl`]:y==="rtl"},k),group:xe({[`${L}-group-wrapper-sm`]:N==="small",[`${L}-group-wrapper-lg`]:N==="large",[`${L}-group-wrapper-rtl`]:y==="rtl",[`${L}-group-wrapper-disabled`]:F},Cp(`${L}-group-wrapper`,U,H),k)}})))}),EQ=oxt;var sxt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);ri?C.createElement(Qye,null):C.createElement($ht,null),lxt={click:"onClick",hover:"onMouseOver"},cxt=C.forwardRef((i,e)=>{const{visibilityToggle:t=!0}=i,n=typeof t=="object"&&t.visible!==void 0,[r,o]=C.useState(()=>n?t.visible:!1),s=C.useRef(null);C.useEffect(()=>{n&&o(t.visible)},[n,t]);const a=NLe(s),l=()=>{const{disabled:L}=i;L||(r&&a(),o(E=>{var D;const k=!E;return typeof t=="object"&&((D=t.onVisibleChange)===null||D===void 0||D.call(t,k)),k}))},c=L=>{const{action:E="click",iconRender:D=axt}=i,k=lxt[E]||"",T=D(r),M={[k]:l,className:`${L}-icon`,key:"passwordIcon",onMouseDown:A=>{A.preventDefault()},onMouseUp:A=>{A.preventDefault()}};return C.cloneElement(C.isValidElement(T)?T:C.createElement("span",null,T),M)},{className:u,prefixCls:d,inputPrefixCls:h,size:f}=i,g=sxt(i,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:p}=C.useContext(Rn),v=p("input",h),m=p("input-password",d),_=t&&c(m),y=xe(m,u,{[`${m}-${f}`]:!!f}),S=Object.assign(Object.assign({},ll(g,["suffix","iconRender","visibilityToggle"])),{type:r?"text":"password",className:y,prefixCls:v,suffix:_});return f&&(S.size=f),C.createElement(EQ,Object.assign({ref:vu(e,s)},S))}),uxt=cxt;var dxt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{prefixCls:t,inputPrefixCls:n,className:r,size:o,suffix:s,enterButton:a=!1,addonAfter:l,loading:c,disabled:u,onSearch:d,onChange:h,onCompositionStart:f,onCompositionEnd:g}=i,p=dxt(i,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),{getPrefixCls:v,direction:m}=C.useContext(Rn),_=C.useContext(Rh),y=C.useRef(!1),S=v("input-search",t),L=v("input",n),{compactSize:E}=QS(S,m),D=E||o||_,k=C.useRef(null),T=Y=>{Y&&Y.target&&Y.type==="click"&&d&&d(Y.target.value,Y),h&&h(Y)},M=Y=>{var J;document.activeElement===((J=k.current)===null||J===void 0?void 0:J.input)&&Y.preventDefault()},A=Y=>{var J,Q;d&&d((Q=(J=k.current)===null||J===void 0?void 0:J.input)===null||Q===void 0?void 0:Q.value,Y)},N=Y=>{y.current||c||A(Y)},R=typeof a=="boolean"?C.createElement(IZ,null):null,F=`${S}-button`;let W;const H=a||{},G=H.type&&H.type.__ANT_BUTTON===!0;G||H.type==="button"?W=Qs(H,Object.assign({onMouseDown:M,onClick:Y=>{var J,Q;(Q=(J=H==null?void 0:H.props)===null||J===void 0?void 0:J.onClick)===null||Q===void 0||Q.call(J,Y),A(Y)},key:"enterButton"},G?{className:F,size:D}:{})):W=C.createElement(Ju,{className:F,type:a?"primary":void 0,size:D,disabled:u,key:"enterButton",onMouseDown:M,onClick:A,loading:c,icon:R},a),l&&(W=[W,Qs(l,{key:"addonAfter"})]);const U=xe(S,{[`${S}-rtl`]:m==="rtl",[`${S}-${D}`]:!!D,[`${S}-with-button`]:!!a},r),K=Y=>{y.current=!0,f==null||f(Y)},re=Y=>{y.current=!1,g==null||g(Y)};return C.createElement(EQ,Object.assign({ref:vu(k,e),onPressEnter:N},p,{size:D,onCompositionStart:K,onCompositionEnd:re,prefixCls:L,addonAfter:W,suffix:s,onChange:T,className:U,disabled:u}))}),fxt=hxt;var gxt=` min-height:0 !important; max-height:none !important; height:0 !important; @@ -1067,7 +1067,7 @@ html body { top:0 !important; right:0 !important; pointer-events: none !important; -`,pxt=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],R7={},Nu;function mxt(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=i.getAttribute("id")||i.getAttribute("data-reactid")||i.getAttribute("name");if(e&&R7[t])return R7[t];var n=window.getComputedStyle(i),r=n.getPropertyValue("box-sizing")||n.getPropertyValue("-moz-box-sizing")||n.getPropertyValue("-webkit-box-sizing"),o=parseFloat(n.getPropertyValue("padding-bottom"))+parseFloat(n.getPropertyValue("padding-top")),s=parseFloat(n.getPropertyValue("border-bottom-width"))+parseFloat(n.getPropertyValue("border-top-width")),a=pxt.map(function(c){return"".concat(c,":").concat(n.getPropertyValue(c))}).join(";"),l={sizingStyle:a,paddingSize:o,borderSize:s,boxSizing:r};return e&&t&&(R7[t]=l),l}function vxt(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;Nu||(Nu=document.createElement("textarea"),Nu.setAttribute("tab-index","-1"),Nu.setAttribute("aria-hidden","true"),document.body.appendChild(Nu)),i.getAttribute("wrap")?Nu.setAttribute("wrap",i.getAttribute("wrap")):Nu.removeAttribute("wrap");var r=mxt(i,e),o=r.paddingSize,s=r.borderSize,a=r.boxSizing,l=r.sizingStyle;Nu.setAttribute("style","".concat(l,";").concat(gxt)),Nu.value=i.value||i.placeholder||"";var c=void 0,u=void 0,d,h=Nu.scrollHeight;if(a==="border-box"?h+=s:a==="content-box"&&(h-=o),t!==null||n!==null){Nu.value=" ";var f=Nu.scrollHeight-o;t!==null&&(c=f*t,a==="border-box"&&(c=c+o+s),h=Math.max(c,h)),n!==null&&(u=f*n,a==="border-box"&&(u=u+o+s),d=h>u?"":"hidden",h=Math.min(u,h))}var g={height:h,overflowY:d,resize:"none"};return c&&(g.minHeight=c),u&&(g.maxHeight=u),g}var _xt=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],M7=0,A7=1,P7=2,bxt=C.forwardRef(function(i,e){var t=i,n=t.prefixCls;t.onPressEnter;var r=t.defaultValue,o=t.value,s=t.autoSize,a=t.onResize,l=t.className,c=t.style,u=t.disabled,d=t.onChange;t.onInternalAutoSize;var h=Nn(t,_xt),f=Ja(r,{value:o,postState:function(ue){return ue??""}}),g=Ae(f,2),p=g[0],v=g[1],m=function(ue){v(ue.target.value),d==null||d(ue)},_=C.useRef();C.useImperativeHandle(e,function(){return{textArea:_.current}});var y=C.useMemo(function(){return s&&zn(s)==="object"?[s.minRows,s.maxRows]:[]},[s]),S=Ae(y,2),L=S[0],E=S[1],D=!!s,k=function(){try{if(document.activeElement===_.current){var ue=_.current,de=ue.selectionStart,_e=ue.selectionEnd,ve=ue.scrollTop;_.current.setSelectionRange(de,_e),_.current.scrollTop=ve}}catch{}},T=C.useState(P7),M=Ae(T,2),A=M[0],N=M[1],R=C.useState(),F=Ae(R,2),W=F[0],H=F[1],G=function(){N(M7)};br(function(){D&&G()},[o,L,E,D]),br(function(){if(A===M7)N(A7);else if(A===A7){var Q=vxt(_.current,!1,L,E);N(P7),H(Q)}else k()},[A]);var U=C.useRef(),K=function(){Zi.cancel(U.current)},re=function(ue){A===P7&&(a==null||a(ue),s&&(K(),U.current=Zi(function(){G()})))};C.useEffect(function(){return K},[]);var Y=D?W:null,J=te(te({},c),Y);return(A===M7||A===A7)&&(J.overflowY="hidden",J.overflowX="hidden"),C.createElement(Nh,{onResize:re,disabled:!(s||a)},C.createElement("textarea",St({},h,{ref:_,style:J,className:xe(n,l,be({},"".concat(n,"-disabled"),u)),disabled:u,value:p,onChange:m})))}),Cxt=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","classes","showCount","className","style","disabled","hidden","classNames","styles"];function RLe(i,e){return ft(i||"").slice(0,e).join("")}function Yue(i,e,t,n){var r=t;return i?r=RLe(t,n):ft(e||"").lengthn&&(r=e),r}var yxt=$e.forwardRef(function(i,e){var t,n=i.defaultValue,r=i.value,o=i.onFocus,s=i.onBlur,a=i.onChange,l=i.allowClear,c=i.maxLength,u=i.onCompositionStart,d=i.onCompositionEnd,h=i.suffix,f=i.prefixCls,g=f===void 0?"rc-textarea":f,p=i.classes,v=i.showCount,m=i.className,_=i.style,y=i.disabled,S=i.hidden,L=i.classNames,E=i.styles,D=Nn(i,Cxt),k=Ja(n,{value:r,defaultValue:n}),T=Ae(k,2),M=T[0],A=T[1],N=C.useRef(null),R=$e.useState(!1),F=Ae(R,2),W=F[0],H=F[1],G=$e.useState(!1),U=Ae(G,2),K=U[0],re=U[1],Y=$e.useRef(),J=$e.useRef(0),Q=function(){N.current.textArea.focus()};C.useImperativeHandle(e,function(){return{resizableTextArea:N.current,focus:Q,blur:function(){N.current.textArea.blur()}}}),C.useEffect(function(){H(function(Ke){return!y&&Ke})},[y]);var ue=Number(c)>0,de=function(Re){re(!0),Y.current=M,J.current=Re.currentTarget.selectionStart,u==null||u(Re)},_e=function(Re){re(!1);var ct=Re.currentTarget.value;if(ue){var ie,le=J.current>=c+1||J.current===((ie=Y.current)===null||ie===void 0?void 0:ie.length);ct=Yue(le,Y.current,ct,c)}ct!==M&&(A(ct),YE(Re.currentTarget,Re,a,ct)),d==null||d(Re)},ve=function(Re){var ct=Re.target.value;if(!K&&ue){var ie=Re.target.selectionStart>=c+1||Re.target.selectionStart===ct.length||!Re.target.selectionStart;ct=Yue(ie,M,ct,c)}A(ct),YE(Re.currentTarget,Re,a,ct)},Ve=function(Re){var ct=D.onPressEnter,ie=D.onKeyDown;Re.key==="Enter"&&ct&&ct(Re),ie==null||ie(Re)},Ze=function(Re){H(!0),o==null||o(Re)},We=function(Re){H(!1),s==null||s(Re)},pe=function(Re){A(""),Q(),YE(N.current.textArea,Re,a)},Pe=LK(M);!K&&ue&&r==null&&(Pe=RLe(Pe,c));var Se=h,Ne;if(v){var Me=ft(Pe).length;zn(v)==="object"?Ne=v.formatter({value:Pe,count:Me,maxLength:c}):Ne="".concat(Me).concat(ue?" / ".concat(c):""),Se=$e.createElement($e.Fragment,null,Se,$e.createElement("span",{className:xe("".concat(g,"-data-count"),L==null?void 0:L.count),style:E==null?void 0:E.count},Ne))}var Qe=$e.createElement(TLe,{value:Pe,allowClear:l,handleReset:pe,suffix:Se,prefixCls:g,classes:{affixWrapper:xe(p==null?void 0:p.affixWrapper,(t={},be(t,"".concat(g,"-show-count"),v),be(t,"".concat(g,"-textarea-allow-clear"),l),t))},disabled:y,focused:W,className:m,style:_,dataAttrs:{affixWrapper:{"data-count":typeof Ne=="string"?Ne:void 0}},hidden:S,inputElement:$e.createElement(bxt,St({},D,{onKeyDown:Ve,onChange:ve,onFocus:Ze,onBlur:We,onCompositionStart:de,onCompositionEnd:_e,className:L==null?void 0:L.textarea,style:te(te({},E==null?void 0:E.textarea),{},{resize:_==null?void 0:_.resize}),disabled:y,prefixCls:g,ref:N}))});return Qe}),wxt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var{prefixCls:t,bordered:n=!0,size:r,disabled:o,status:s,allowClear:a,showCount:l,classNames:c}=i,u=wxt(i,["prefixCls","bordered","size","disabled","status","allowClear","showCount","classNames"]);const{getPrefixCls:d,direction:h}=C.useContext(Rn),f=C.useContext(Rh),g=r||f,p=C.useContext(H_),v=o??p,{status:m,hasFeedback:_,feedbackIcon:y}=C.useContext(Zf),S=O5(m,s),L=C.useRef(null);C.useImperativeHandle(e,()=>{var M;return{resizableTextArea:(M=L.current)===null||M===void 0?void 0:M.resizableTextArea,focus:A=>{var N,R;rxt((R=(N=L.current)===null||N===void 0?void 0:N.resizableTextArea)===null||R===void 0?void 0:R.textArea,A)},blur:()=>{var A;return(A=L.current)===null||A===void 0?void 0:A.blur()}}});const E=d("input",t);let D;typeof a=="object"&&(a!=null&&a.clearIcon)?D=a:a&&(D={clearIcon:C.createElement(XS,null)});const[k,T]=yQ(E);return k(C.createElement(yxt,Object.assign({},u,{disabled:v,allowClear:D,classes:{affixWrapper:xe(`${E}-textarea-affix-wrapper`,{[`${E}-affix-wrapper-rtl`]:h==="rtl",[`${E}-affix-wrapper-borderless`]:!n,[`${E}-affix-wrapper-sm`]:g==="small",[`${E}-affix-wrapper-lg`]:g==="large",[`${E}-textarea-show-count`]:l},Cp(`${E}-affix-wrapper`,S),T)},classNames:Object.assign(Object.assign({},c),{textarea:xe({[`${E}-borderless`]:!n,[`${E}-sm`]:g==="small",[`${E}-lg`]:g==="large"},Cp(E,S),T,c==null?void 0:c.textarea)}),prefixCls:E,suffix:_&&C.createElement("span",{className:`${E}-textarea-suffix`},y),showCount:l,ref:L})))}),xxt=Sxt,BT=EQ;BT.Group=QSt;BT.Search=fxt;BT.TextArea=xxt;BT.Password=uxt;const Lxt=BT;function EK(){return typeof BigInt=="function"}function vb(i){var e=i.trim(),t=e.startsWith("-");t&&(e=e.slice(1)),e=e.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,""),e.startsWith(".")&&(e="0".concat(e));var n=e||"0",r=n.split("."),o=r[0]||"0",s=r[1]||"0";o==="0"&&s==="0"&&(t=!1);var a=t?"-":"";return{negative:t,negativeStr:a,trimStr:n,integerStr:o,decimalStr:s,fullStr:"".concat(a).concat(n)}}function DQ(i){var e=String(i);return!Number.isNaN(Number(e))&&e.includes("e")}function fk(i){var e=String(i);if(DQ(i)){var t=Number(e.slice(e.indexOf("e-")+2)),n=e.match(/\.(\d+)/);return n!=null&&n[1]&&(t+=n[1].length),t}return e.includes(".")&&IQ(e)?e.length-e.indexOf(".")-1:0}function G5(i){var e=String(i);if(DQ(i)){if(i>Number.MAX_SAFE_INTEGER)return String(EK()?BigInt(i).toString():Number.MAX_SAFE_INTEGER);if(iNumber.MAX_SAFE_INTEGER)return new i(Number.MAX_SAFE_INTEGER);if(r0&&arguments[0]!==void 0?arguments[0]:!0;return t?this.isInvalidate()?"":G5(this.number):this.origin}}]),i}(),Dxt=function(){function i(e){if(vs(this,i),be(this,"origin",""),be(this,"negative",void 0),be(this,"integer",void 0),be(this,"decimal",void 0),be(this,"decimalLen",void 0),be(this,"empty",void 0),be(this,"nan",void 0),MLe(e)){this.empty=!0;return}if(this.origin=String(e),e==="-"||Number.isNaN(e)){this.nan=!0;return}var t=e;if(DQ(t)&&(t=Number(t)),t=typeof t=="string"?t:G5(t),IQ(t)){var n=vb(t);this.negative=n.negative;var r=n.trimStr.split(".");this.integer=BigInt(r[0]);var o=r[1]||"0";this.decimal=BigInt(o),this.decimalLen=o.length}else this.nan=!0}return _s(i,[{key:"getMark",value:function(){return this.negative?"-":""}},{key:"getIntegerStr",value:function(){return this.integer.toString()}},{key:"getDecimalStr",value:function(){return this.decimal.toString().padStart(this.decimalLen,"0")}},{key:"alignDecimal",value:function(t){var n="".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(t,"0"));return BigInt(n)}},{key:"negate",value:function(){var t=new i(this.toString());return t.negative=!t.negative,t}},{key:"add",value:function(t){if(this.isInvalidate())return new i(t);var n=new i(t);if(n.isInvalidate())return this;var r=Math.max(this.getDecimalStr().length,n.getDecimalStr().length),o=this.alignDecimal(r),s=n.alignDecimal(r),a=(o+s).toString(),l=vb(a),c=l.negativeStr,u=l.trimStr,d="".concat(c).concat(u.padStart(r+1,"0"));return new i("".concat(d.slice(0,-r),".").concat(d.slice(-r)))}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return this.nan}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(t){return this.toString()===(t==null?void 0:t.toString())}},{key:"lessEquals",value:function(t){return this.add(t.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return t?this.isInvalidate()?"":vb("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),i}();function Id(i){return EK()?new Dxt(i):new Ext(i)}function JM(i,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(i==="")return"";var r=vb(i),o=r.negativeStr,s=r.integerStr,a=r.decimalStr,l="".concat(e).concat(a),c="".concat(o).concat(s);if(t>=0){var u=Number(a[t]);if(u>=5&&!n){var d=Id(i).add("".concat(o,"0.").concat("0".repeat(t)).concat(10-u));return JM(d.toString(),e,t,n)}return t===0?c:"".concat(c).concat(e).concat(a.padEnd(t,"0").slice(0,t))}return l===".0"?c:"".concat(c).concat(l)}var Ixt=function(){var e=C.useState(!1),t=Ae(e,2),n=t[0],r=t[1];return br(function(){r(P5())},[]),n},kxt=200,Txt=600;function Nxt(i){var e=i.prefixCls,t=i.upNode,n=i.downNode,r=i.upDisabled,o=i.downDisabled,s=i.onStep,a=C.useRef(),l=C.useRef();l.current=s;var c=function(m,_){m.preventDefault(),l.current(_);function y(){l.current(_),a.current=setTimeout(y,kxt)}a.current=setTimeout(y,Txt)},u=function(){clearTimeout(a.current)};C.useEffect(function(){return u},[]);var d=Ixt();if(d)return null;var h="".concat(e,"-handler"),f=xe(h,"".concat(h,"-up"),be({},"".concat(h,"-up-disabled"),r)),g=xe(h,"".concat(h,"-down"),be({},"".concat(h,"-down-disabled"),o)),p={unselectable:"on",role:"button",onMouseUp:u,onMouseLeave:u};return C.createElement("div",{className:"".concat(h,"-wrap")},C.createElement("span",St({},p,{onMouseDown:function(m){c(m,!0)},"aria-label":"Increase Value","aria-disabled":r,className:f}),t||C.createElement("span",{unselectable:"on",className:"".concat(e,"-handler-up-inner")})),C.createElement("span",St({},p,{onMouseDown:function(m){c(m,!1)},"aria-label":"Decrease Value","aria-disabled":o,className:g}),n||C.createElement("span",{unselectable:"on",className:"".concat(e,"-handler-down-inner")})))}function Zue(i){var e=typeof i=="number"?G5(i):vb(i).fullStr,t=e.includes(".");return t?vb(e.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:i+"0"}function Rxt(i,e){var t=C.useRef(null);function n(){try{var o=i.selectionStart,s=i.selectionEnd,a=i.value,l=a.substring(0,o),c=a.substring(s);t.current={start:o,end:s,value:a,beforeTxt:l,afterTxt:c}}catch{}}function r(){if(i&&t.current&&e)try{var o=i.value,s=t.current,a=s.beforeTxt,l=s.afterTxt,c=s.start,u=o.length;if(o.endsWith(l))u=o.length-t.current.afterTxt.length;else if(o.startsWith(a))u=a.length;else{var d=a[c-1],h=o.indexOf(d,c-1);h!==-1&&(u=h+1)}i.setSelectionRange(u,u)}catch(f){ao(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(f.message))}}return[n,r]}const Mxt=function(){var i=C.useRef(0),e=function(){Zi.cancel(i.current)};return C.useEffect(function(){return e},[]),function(t){e(),i.current=Zi(function(){t()})}};var Axt=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","controls","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep"],Que=function(e,t){return e||t.isEmpty()?t.toString():t.toNumber()},Jue=function(e){var t=Id(e);return t.isInvalidate()?null:t},ALe=C.forwardRef(function(i,e){var t,n=i.prefixCls,r=n===void 0?"rc-input-number":n,o=i.className,s=i.style,a=i.min,l=i.max,c=i.step,u=c===void 0?1:c,d=i.defaultValue,h=i.value,f=i.disabled,g=i.readOnly,p=i.upHandler,v=i.downHandler,m=i.keyboard,_=i.controls,y=_===void 0?!0:_,S=i.stringMode,L=i.parser,E=i.formatter,D=i.precision,k=i.decimalSeparator,T=i.onChange,M=i.onInput,A=i.onPressEnter,N=i.onStep,R=Nn(i,Axt),F="".concat(r,"-input"),W=C.useRef(null),H=C.useState(!1),G=Ae(H,2),U=G[0],K=G[1],re=C.useRef(!1),Y=C.useRef(!1),J=C.useRef(!1),Q=C.useState(function(){return Id(h??d)}),ue=Ae(Q,2),de=ue[0],_e=ue[1];function ve(rt){h===void 0&&_e(rt)}var Ve=C.useCallback(function(rt,wt){if(!wt)return D>=0?D:Math.max(fk(rt),fk(u))},[D,u]),Ze=C.useCallback(function(rt){var wt=String(rt);if(L)return L(wt);var Bt=wt;return k&&(Bt=Bt.replace(k,".")),Bt.replace(/[^\w.-]+/g,"")},[L,k]),We=C.useRef(""),pe=C.useCallback(function(rt,wt){if(E)return E(rt,{userTyping:wt,input:String(We.current)});var Bt=typeof rt=="number"?G5(rt):rt;if(!wt){var Nt=Ve(Bt,wt);if(IQ(Bt)&&(k||Nt>=0)){var nn=k||".";Bt=JM(Bt,nn,Nt)}}return Bt},[E,Ve,k]),Pe=C.useState(function(){var rt=d??h;return de.isInvalidate()&&["string","number"].includes(zn(rt))?Number.isNaN(rt)?"":rt:pe(de.toString(),!1)}),Se=Ae(Pe,2),Ne=Se[0],Me=Se[1];We.current=Ne;function Qe(rt,wt){Me(pe(rt.isInvalidate()?rt.toString(!1):rt.toString(!wt),wt))}var Ke=C.useMemo(function(){return Jue(l)},[l,D]),Re=C.useMemo(function(){return Jue(a)},[a,D]),ct=C.useMemo(function(){return!Ke||!de||de.isInvalidate()?!1:Ke.lessEquals(de)},[Ke,de]),ie=C.useMemo(function(){return!Re||!de||de.isInvalidate()?!1:de.lessEquals(Re)},[Re,de]),le=Rxt(W.current,U),ce=Ae(le,2),z=ce[0],q=ce[1],oe=function(wt){return Ke&&!wt.lessEquals(Ke)?Ke:Re&&!Re.lessEquals(wt)?Re:null},ne=function(wt){return!oe(wt)},he=function(wt,Bt){var Nt=wt,nn=ne(Nt)||Nt.isEmpty();if(!Nt.isEmpty()&&!Bt&&(Nt=oe(Nt)||Nt,nn=!0),!g&&!f&&nn){var Mn=Nt.toString(),zt=Ve(Mn,Bt);return zt>=0&&(Nt=Id(JM(Mn,".",zt)),ne(Nt)||(Nt=Id(JM(Mn,".",zt,!0)))),Nt.equals(de)||(ve(Nt),T==null||T(Nt.isEmpty()?null:Que(S,Nt)),h===void 0&&Qe(Nt,Bt)),Nt}return de},Le=Mxt(),Fe=function rt(wt){if(z(),Me(wt),!Y.current){var Bt=Ze(wt),Nt=Id(Bt);Nt.isNaN()||he(Nt,!0)}M==null||M(wt),Le(function(){var nn=wt;L||(nn=wt.replace(/。/g,".")),nn!==wt&&rt(nn)})},ze=function(){Y.current=!0},Ue=function(){Y.current=!1,Fe(W.current.value)},nt=function(wt){Fe(wt.target.value)},it=function(wt){var Bt;if(!(wt&&ct||!wt&&ie)){re.current=!1;var Nt=Id(J.current?Zue(u):u);wt||(Nt=Nt.negate());var nn=(de||Id(0)).add(Nt.toString()),Mn=he(nn,!1);N==null||N(Que(S,Mn),{offset:J.current?Zue(u):u,type:wt?"up":"down"}),(Bt=W.current)===null||Bt===void 0||Bt.focus()}},at=function(wt){var Bt=Id(Ze(Ne)),Nt=Bt;Bt.isNaN()?Nt=de:Nt=he(Bt,wt),h!==void 0?Qe(de,!1):Nt.isNaN()||Qe(Nt,!1)},tt=function(){re.current=!0},Zt=function(wt){var Bt=wt.which,Nt=wt.shiftKey;re.current=!0,Nt?J.current=!0:J.current=!1,Bt===vt.ENTER&&(Y.current||(re.current=!1),at(!1),A==null||A(wt)),m!==!1&&!Y.current&&[vt.UP,vt.DOWN].includes(Bt)&&(it(vt.UP===Bt),wt.preventDefault())},Tt=function(){re.current=!1,J.current=!1},xn=function(){at(!1),K(!1),re.current=!1};return GE(function(){de.isInvalidate()||Qe(de,!1)},[D]),GE(function(){var rt=Id(h);_e(rt);var wt=Id(Ze(Ne));(!rt.equals(wt)||!re.current||E)&&Qe(rt,re.current)},[h]),GE(function(){E&&q()},[Ne]),C.createElement("div",{className:xe(r,o,(t={},be(t,"".concat(r,"-focused"),U),be(t,"".concat(r,"-disabled"),f),be(t,"".concat(r,"-readonly"),g),be(t,"".concat(r,"-not-a-number"),de.isNaN()),be(t,"".concat(r,"-out-of-range"),!de.isInvalidate()&&!ne(de)),t)),style:s,onFocus:function(){K(!0)},onBlur:xn,onKeyDown:Zt,onKeyUp:Tt,onCompositionStart:ze,onCompositionEnd:Ue,onBeforeInput:tt},y&&C.createElement(Nxt,{prefixCls:r,upNode:p,downNode:v,upDisabled:ct,downDisabled:ie,onStep:it}),C.createElement("div",{className:"".concat(F,"-wrap")},C.createElement("input",St({autoComplete:"off",role:"spinbutton","aria-valuemin":a,"aria-valuemax":l,"aria-valuenow":de.isInvalidate()?null:de.toString(),step:u},R,{ref:vu(W,e),className:F,value:Ne,onChange:nt,disabled:f,readOnly:g}))))});ALe.displayName="InputNumber";const Pxt=i=>{const{componentCls:e,lineWidth:t,lineType:n,colorBorder:r,borderRadius:o,fontSizeLG:s,controlHeightLG:a,controlHeightSM:l,colorError:c,inputPaddingHorizontalSM:u,colorTextDescription:d,motionDurationMid:h,colorPrimary:f,controlHeight:g,inputPaddingHorizontal:p,colorBgContainer:v,colorTextDisabled:m,borderRadiusSM:_,borderRadiusLG:y,controlWidth:S,handleVisible:L}=i;return[{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},Wr(i)),OT(i)),K5(i,e)),{display:"inline-block",width:S,margin:0,padding:0,border:`${t}px ${n} ${r}`,borderRadius:o,"&-rtl":{direction:"rtl",[`${e}-input`]:{direction:"rtl"}},"&-lg":{padding:0,fontSize:s,borderRadius:y,[`input${e}-input`]:{height:a-2*t}},"&-sm":{padding:0,borderRadius:_,[`input${e}-input`]:{height:l-2*t,padding:`0 ${u}px`}},"&:hover":Object.assign({},PT(i)),"&-focused":Object.assign({},iF(i)),"&-disabled":Object.assign(Object.assign({},_Q(i)),{[`${e}-input`]:{cursor:"not-allowed"}}),"&-out-of-range":{input:{color:c}},"&-group":Object.assign(Object.assign(Object.assign({},Wr(i)),yLe(i)),{"&-wrapper":{display:"inline-block",textAlign:"start",verticalAlign:"top",[`${e}-affix-wrapper`]:{width:"100%"},"&-lg":{[`${e}-group-addon`]:{borderRadius:y}},"&-sm":{[`${e}-group-addon`]:{borderRadius:_}}}}),[e]:{"&-input":Object.assign(Object.assign({width:"100%",height:g-2*t,padding:`0 ${p}px`,textAlign:"start",backgroundColor:"transparent",border:0,borderRadius:o,outline:0,transition:`all ${h} linear`,appearance:"textfield",color:i.colorText,fontSize:"inherit",verticalAlign:"top"},bLe(i.colorTextPlaceholder)),{'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,webkitAppearance:"none",appearance:"none"}})}})},{[e]:{[`&:hover ${e}-handler-wrap, &-focused ${e}-handler-wrap`]:{opacity:1},[`${e}-handler-wrap`]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,width:i.handleWidth,height:"100%",background:v,borderStartStartRadius:0,borderStartEndRadius:o,borderEndEndRadius:o,borderEndStartRadius:0,opacity:L===!0?1:0,display:"flex",flexDirection:"column",alignItems:"stretch",transition:`opacity ${h} linear ${h}`,[`${e}-handler`]:{display:"flex",alignItems:"center",justifyContent:"center",flex:"auto",height:"40%",[` +`,pxt=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],R7={},Nu;function mxt(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=i.getAttribute("id")||i.getAttribute("data-reactid")||i.getAttribute("name");if(e&&R7[t])return R7[t];var n=window.getComputedStyle(i),r=n.getPropertyValue("box-sizing")||n.getPropertyValue("-moz-box-sizing")||n.getPropertyValue("-webkit-box-sizing"),o=parseFloat(n.getPropertyValue("padding-bottom"))+parseFloat(n.getPropertyValue("padding-top")),s=parseFloat(n.getPropertyValue("border-bottom-width"))+parseFloat(n.getPropertyValue("border-top-width")),a=pxt.map(function(c){return"".concat(c,":").concat(n.getPropertyValue(c))}).join(";"),l={sizingStyle:a,paddingSize:o,borderSize:s,boxSizing:r};return e&&t&&(R7[t]=l),l}function vxt(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;Nu||(Nu=document.createElement("textarea"),Nu.setAttribute("tab-index","-1"),Nu.setAttribute("aria-hidden","true"),document.body.appendChild(Nu)),i.getAttribute("wrap")?Nu.setAttribute("wrap",i.getAttribute("wrap")):Nu.removeAttribute("wrap");var r=mxt(i,e),o=r.paddingSize,s=r.borderSize,a=r.boxSizing,l=r.sizingStyle;Nu.setAttribute("style","".concat(l,";").concat(gxt)),Nu.value=i.value||i.placeholder||"";var c=void 0,u=void 0,d,h=Nu.scrollHeight;if(a==="border-box"?h+=s:a==="content-box"&&(h-=o),t!==null||n!==null){Nu.value=" ";var f=Nu.scrollHeight-o;t!==null&&(c=f*t,a==="border-box"&&(c=c+o+s),h=Math.max(c,h)),n!==null&&(u=f*n,a==="border-box"&&(u=u+o+s),d=h>u?"":"hidden",h=Math.min(u,h))}var g={height:h,overflowY:d,resize:"none"};return c&&(g.minHeight=c),u&&(g.maxHeight=u),g}var _xt=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],M7=0,A7=1,P7=2,bxt=C.forwardRef(function(i,e){var t=i,n=t.prefixCls;t.onPressEnter;var r=t.defaultValue,o=t.value,s=t.autoSize,a=t.onResize,l=t.className,c=t.style,u=t.disabled,d=t.onChange;t.onInternalAutoSize;var h=Nn(t,_xt),f=Ja(r,{value:o,postState:function(ue){return ue??""}}),g=Ae(f,2),p=g[0],v=g[1],m=function(ue){v(ue.target.value),d==null||d(ue)},_=C.useRef();C.useImperativeHandle(e,function(){return{textArea:_.current}});var y=C.useMemo(function(){return s&&zn(s)==="object"?[s.minRows,s.maxRows]:[]},[s]),S=Ae(y,2),L=S[0],E=S[1],D=!!s,k=function(){try{if(document.activeElement===_.current){var ue=_.current,de=ue.selectionStart,_e=ue.selectionEnd,ve=ue.scrollTop;_.current.setSelectionRange(de,_e),_.current.scrollTop=ve}}catch{}},T=C.useState(P7),M=Ae(T,2),A=M[0],N=M[1],R=C.useState(),F=Ae(R,2),W=F[0],H=F[1],G=function(){N(M7)};br(function(){D&&G()},[o,L,E,D]),br(function(){if(A===M7)N(A7);else if(A===A7){var Q=vxt(_.current,!1,L,E);N(P7),H(Q)}else k()},[A]);var U=C.useRef(),K=function(){Zi.cancel(U.current)},re=function(ue){A===P7&&(a==null||a(ue),s&&(K(),U.current=Zi(function(){G()})))};C.useEffect(function(){return K},[]);var Y=D?W:null,J=te(te({},c),Y);return(A===M7||A===A7)&&(J.overflowY="hidden",J.overflowX="hidden"),C.createElement(Nh,{onResize:re,disabled:!(s||a)},C.createElement("textarea",St({},h,{ref:_,style:J,className:xe(n,l,be({},"".concat(n,"-disabled"),u)),disabled:u,value:p,onChange:m})))}),Cxt=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","classes","showCount","className","style","disabled","hidden","classNames","styles"];function RLe(i,e){return ft(i||"").slice(0,e).join("")}function Yue(i,e,t,n){var r=t;return i?r=RLe(t,n):ft(e||"").lengthn&&(r=e),r}var yxt=$e.forwardRef(function(i,e){var t,n=i.defaultValue,r=i.value,o=i.onFocus,s=i.onBlur,a=i.onChange,l=i.allowClear,c=i.maxLength,u=i.onCompositionStart,d=i.onCompositionEnd,h=i.suffix,f=i.prefixCls,g=f===void 0?"rc-textarea":f,p=i.classes,v=i.showCount,m=i.className,_=i.style,y=i.disabled,S=i.hidden,L=i.classNames,E=i.styles,D=Nn(i,Cxt),k=Ja(n,{value:r,defaultValue:n}),T=Ae(k,2),M=T[0],A=T[1],N=C.useRef(null),R=$e.useState(!1),F=Ae(R,2),W=F[0],H=F[1],G=$e.useState(!1),U=Ae(G,2),K=U[0],re=U[1],Y=$e.useRef(),J=$e.useRef(0),Q=function(){N.current.textArea.focus()};C.useImperativeHandle(e,function(){return{resizableTextArea:N.current,focus:Q,blur:function(){N.current.textArea.blur()}}}),C.useEffect(function(){H(function(Ke){return!y&&Ke})},[y]);var ue=Number(c)>0,de=function(Re){re(!0),Y.current=M,J.current=Re.currentTarget.selectionStart,u==null||u(Re)},_e=function(Re){re(!1);var ct=Re.currentTarget.value;if(ue){var ie,le=J.current>=c+1||J.current===((ie=Y.current)===null||ie===void 0?void 0:ie.length);ct=Yue(le,Y.current,ct,c)}ct!==M&&(A(ct),YE(Re.currentTarget,Re,a,ct)),d==null||d(Re)},ve=function(Re){var ct=Re.target.value;if(!K&&ue){var ie=Re.target.selectionStart>=c+1||Re.target.selectionStart===ct.length||!Re.target.selectionStart;ct=Yue(ie,M,ct,c)}A(ct),YE(Re.currentTarget,Re,a,ct)},Ve=function(Re){var ct=D.onPressEnter,ie=D.onKeyDown;Re.key==="Enter"&&ct&&ct(Re),ie==null||ie(Re)},Ze=function(Re){H(!0),o==null||o(Re)},We=function(Re){H(!1),s==null||s(Re)},pe=function(Re){A(""),Q(),YE(N.current.textArea,Re,a)},Pe=LK(M);!K&&ue&&r==null&&(Pe=RLe(Pe,c));var Se=h,Ne;if(v){var Me=ft(Pe).length;zn(v)==="object"?Ne=v.formatter({value:Pe,count:Me,maxLength:c}):Ne="".concat(Me).concat(ue?" / ".concat(c):""),Se=$e.createElement($e.Fragment,null,Se,$e.createElement("span",{className:xe("".concat(g,"-data-count"),L==null?void 0:L.count),style:E==null?void 0:E.count},Ne))}var Qe=$e.createElement(TLe,{value:Pe,allowClear:l,handleReset:pe,suffix:Se,prefixCls:g,classes:{affixWrapper:xe(p==null?void 0:p.affixWrapper,(t={},be(t,"".concat(g,"-show-count"),v),be(t,"".concat(g,"-textarea-allow-clear"),l),t))},disabled:y,focused:W,className:m,style:_,dataAttrs:{affixWrapper:{"data-count":typeof Ne=="string"?Ne:void 0}},hidden:S,inputElement:$e.createElement(bxt,St({},D,{onKeyDown:Ve,onChange:ve,onFocus:Ze,onBlur:We,onCompositionStart:de,onCompositionEnd:_e,className:L==null?void 0:L.textarea,style:te(te({},E==null?void 0:E.textarea),{},{resize:_==null?void 0:_.resize}),disabled:y,prefixCls:g,ref:N}))});return Qe}),wxt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var{prefixCls:t,bordered:n=!0,size:r,disabled:o,status:s,allowClear:a,showCount:l,classNames:c}=i,u=wxt(i,["prefixCls","bordered","size","disabled","status","allowClear","showCount","classNames"]);const{getPrefixCls:d,direction:h}=C.useContext(Rn),f=C.useContext(Rh),g=r||f,p=C.useContext($_),v=o??p,{status:m,hasFeedback:_,feedbackIcon:y}=C.useContext(Zf),S=O5(m,s),L=C.useRef(null);C.useImperativeHandle(e,()=>{var M;return{resizableTextArea:(M=L.current)===null||M===void 0?void 0:M.resizableTextArea,focus:A=>{var N,R;rxt((R=(N=L.current)===null||N===void 0?void 0:N.resizableTextArea)===null||R===void 0?void 0:R.textArea,A)},blur:()=>{var A;return(A=L.current)===null||A===void 0?void 0:A.blur()}}});const E=d("input",t);let D;typeof a=="object"&&(a!=null&&a.clearIcon)?D=a:a&&(D={clearIcon:C.createElement(XS,null)});const[k,T]=yQ(E);return k(C.createElement(yxt,Object.assign({},u,{disabled:v,allowClear:D,classes:{affixWrapper:xe(`${E}-textarea-affix-wrapper`,{[`${E}-affix-wrapper-rtl`]:h==="rtl",[`${E}-affix-wrapper-borderless`]:!n,[`${E}-affix-wrapper-sm`]:g==="small",[`${E}-affix-wrapper-lg`]:g==="large",[`${E}-textarea-show-count`]:l},Cp(`${E}-affix-wrapper`,S),T)},classNames:Object.assign(Object.assign({},c),{textarea:xe({[`${E}-borderless`]:!n,[`${E}-sm`]:g==="small",[`${E}-lg`]:g==="large"},Cp(E,S),T,c==null?void 0:c.textarea)}),prefixCls:E,suffix:_&&C.createElement("span",{className:`${E}-textarea-suffix`},y),showCount:l,ref:L})))}),xxt=Sxt,BT=EQ;BT.Group=QSt;BT.Search=fxt;BT.TextArea=xxt;BT.Password=uxt;const Lxt=BT;function EK(){return typeof BigInt=="function"}function mb(i){var e=i.trim(),t=e.startsWith("-");t&&(e=e.slice(1)),e=e.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,""),e.startsWith(".")&&(e="0".concat(e));var n=e||"0",r=n.split("."),o=r[0]||"0",s=r[1]||"0";o==="0"&&s==="0"&&(t=!1);var a=t?"-":"";return{negative:t,negativeStr:a,trimStr:n,integerStr:o,decimalStr:s,fullStr:"".concat(a).concat(n)}}function DQ(i){var e=String(i);return!Number.isNaN(Number(e))&&e.includes("e")}function fk(i){var e=String(i);if(DQ(i)){var t=Number(e.slice(e.indexOf("e-")+2)),n=e.match(/\.(\d+)/);return n!=null&&n[1]&&(t+=n[1].length),t}return e.includes(".")&&IQ(e)?e.length-e.indexOf(".")-1:0}function G5(i){var e=String(i);if(DQ(i)){if(i>Number.MAX_SAFE_INTEGER)return String(EK()?BigInt(i).toString():Number.MAX_SAFE_INTEGER);if(iNumber.MAX_SAFE_INTEGER)return new i(Number.MAX_SAFE_INTEGER);if(r0&&arguments[0]!==void 0?arguments[0]:!0;return t?this.isInvalidate()?"":G5(this.number):this.origin}}]),i}(),Dxt=function(){function i(e){if(vs(this,i),be(this,"origin",""),be(this,"negative",void 0),be(this,"integer",void 0),be(this,"decimal",void 0),be(this,"decimalLen",void 0),be(this,"empty",void 0),be(this,"nan",void 0),MLe(e)){this.empty=!0;return}if(this.origin=String(e),e==="-"||Number.isNaN(e)){this.nan=!0;return}var t=e;if(DQ(t)&&(t=Number(t)),t=typeof t=="string"?t:G5(t),IQ(t)){var n=mb(t);this.negative=n.negative;var r=n.trimStr.split(".");this.integer=BigInt(r[0]);var o=r[1]||"0";this.decimal=BigInt(o),this.decimalLen=o.length}else this.nan=!0}return _s(i,[{key:"getMark",value:function(){return this.negative?"-":""}},{key:"getIntegerStr",value:function(){return this.integer.toString()}},{key:"getDecimalStr",value:function(){return this.decimal.toString().padStart(this.decimalLen,"0")}},{key:"alignDecimal",value:function(t){var n="".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(t,"0"));return BigInt(n)}},{key:"negate",value:function(){var t=new i(this.toString());return t.negative=!t.negative,t}},{key:"add",value:function(t){if(this.isInvalidate())return new i(t);var n=new i(t);if(n.isInvalidate())return this;var r=Math.max(this.getDecimalStr().length,n.getDecimalStr().length),o=this.alignDecimal(r),s=n.alignDecimal(r),a=(o+s).toString(),l=mb(a),c=l.negativeStr,u=l.trimStr,d="".concat(c).concat(u.padStart(r+1,"0"));return new i("".concat(d.slice(0,-r),".").concat(d.slice(-r)))}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return this.nan}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(t){return this.toString()===(t==null?void 0:t.toString())}},{key:"lessEquals",value:function(t){return this.add(t.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return t?this.isInvalidate()?"":mb("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),i}();function Id(i){return EK()?new Dxt(i):new Ext(i)}function JM(i,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(i==="")return"";var r=mb(i),o=r.negativeStr,s=r.integerStr,a=r.decimalStr,l="".concat(e).concat(a),c="".concat(o).concat(s);if(t>=0){var u=Number(a[t]);if(u>=5&&!n){var d=Id(i).add("".concat(o,"0.").concat("0".repeat(t)).concat(10-u));return JM(d.toString(),e,t,n)}return t===0?c:"".concat(c).concat(e).concat(a.padEnd(t,"0").slice(0,t))}return l===".0"?c:"".concat(c).concat(l)}var Ixt=function(){var e=C.useState(!1),t=Ae(e,2),n=t[0],r=t[1];return br(function(){r(P5())},[]),n},kxt=200,Txt=600;function Nxt(i){var e=i.prefixCls,t=i.upNode,n=i.downNode,r=i.upDisabled,o=i.downDisabled,s=i.onStep,a=C.useRef(),l=C.useRef();l.current=s;var c=function(m,_){m.preventDefault(),l.current(_);function y(){l.current(_),a.current=setTimeout(y,kxt)}a.current=setTimeout(y,Txt)},u=function(){clearTimeout(a.current)};C.useEffect(function(){return u},[]);var d=Ixt();if(d)return null;var h="".concat(e,"-handler"),f=xe(h,"".concat(h,"-up"),be({},"".concat(h,"-up-disabled"),r)),g=xe(h,"".concat(h,"-down"),be({},"".concat(h,"-down-disabled"),o)),p={unselectable:"on",role:"button",onMouseUp:u,onMouseLeave:u};return C.createElement("div",{className:"".concat(h,"-wrap")},C.createElement("span",St({},p,{onMouseDown:function(m){c(m,!0)},"aria-label":"Increase Value","aria-disabled":r,className:f}),t||C.createElement("span",{unselectable:"on",className:"".concat(e,"-handler-up-inner")})),C.createElement("span",St({},p,{onMouseDown:function(m){c(m,!1)},"aria-label":"Decrease Value","aria-disabled":o,className:g}),n||C.createElement("span",{unselectable:"on",className:"".concat(e,"-handler-down-inner")})))}function Zue(i){var e=typeof i=="number"?G5(i):mb(i).fullStr,t=e.includes(".");return t?mb(e.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:i+"0"}function Rxt(i,e){var t=C.useRef(null);function n(){try{var o=i.selectionStart,s=i.selectionEnd,a=i.value,l=a.substring(0,o),c=a.substring(s);t.current={start:o,end:s,value:a,beforeTxt:l,afterTxt:c}}catch{}}function r(){if(i&&t.current&&e)try{var o=i.value,s=t.current,a=s.beforeTxt,l=s.afterTxt,c=s.start,u=o.length;if(o.endsWith(l))u=o.length-t.current.afterTxt.length;else if(o.startsWith(a))u=a.length;else{var d=a[c-1],h=o.indexOf(d,c-1);h!==-1&&(u=h+1)}i.setSelectionRange(u,u)}catch(f){ao(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(f.message))}}return[n,r]}const Mxt=function(){var i=C.useRef(0),e=function(){Zi.cancel(i.current)};return C.useEffect(function(){return e},[]),function(t){e(),i.current=Zi(function(){t()})}};var Axt=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","controls","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep"],Que=function(e,t){return e||t.isEmpty()?t.toString():t.toNumber()},Jue=function(e){var t=Id(e);return t.isInvalidate()?null:t},ALe=C.forwardRef(function(i,e){var t,n=i.prefixCls,r=n===void 0?"rc-input-number":n,o=i.className,s=i.style,a=i.min,l=i.max,c=i.step,u=c===void 0?1:c,d=i.defaultValue,h=i.value,f=i.disabled,g=i.readOnly,p=i.upHandler,v=i.downHandler,m=i.keyboard,_=i.controls,y=_===void 0?!0:_,S=i.stringMode,L=i.parser,E=i.formatter,D=i.precision,k=i.decimalSeparator,T=i.onChange,M=i.onInput,A=i.onPressEnter,N=i.onStep,R=Nn(i,Axt),F="".concat(r,"-input"),W=C.useRef(null),H=C.useState(!1),G=Ae(H,2),U=G[0],K=G[1],re=C.useRef(!1),Y=C.useRef(!1),J=C.useRef(!1),Q=C.useState(function(){return Id(h??d)}),ue=Ae(Q,2),de=ue[0],_e=ue[1];function ve(rt){h===void 0&&_e(rt)}var Ve=C.useCallback(function(rt,wt){if(!wt)return D>=0?D:Math.max(fk(rt),fk(u))},[D,u]),Ze=C.useCallback(function(rt){var wt=String(rt);if(L)return L(wt);var Bt=wt;return k&&(Bt=Bt.replace(k,".")),Bt.replace(/[^\w.-]+/g,"")},[L,k]),We=C.useRef(""),pe=C.useCallback(function(rt,wt){if(E)return E(rt,{userTyping:wt,input:String(We.current)});var Bt=typeof rt=="number"?G5(rt):rt;if(!wt){var Nt=Ve(Bt,wt);if(IQ(Bt)&&(k||Nt>=0)){var nn=k||".";Bt=JM(Bt,nn,Nt)}}return Bt},[E,Ve,k]),Pe=C.useState(function(){var rt=d??h;return de.isInvalidate()&&["string","number"].includes(zn(rt))?Number.isNaN(rt)?"":rt:pe(de.toString(),!1)}),Se=Ae(Pe,2),Ne=Se[0],Me=Se[1];We.current=Ne;function Qe(rt,wt){Me(pe(rt.isInvalidate()?rt.toString(!1):rt.toString(!wt),wt))}var Ke=C.useMemo(function(){return Jue(l)},[l,D]),Re=C.useMemo(function(){return Jue(a)},[a,D]),ct=C.useMemo(function(){return!Ke||!de||de.isInvalidate()?!1:Ke.lessEquals(de)},[Ke,de]),ie=C.useMemo(function(){return!Re||!de||de.isInvalidate()?!1:de.lessEquals(Re)},[Re,de]),le=Rxt(W.current,U),ce=Ae(le,2),z=ce[0],q=ce[1],oe=function(wt){return Ke&&!wt.lessEquals(Ke)?Ke:Re&&!Re.lessEquals(wt)?Re:null},ne=function(wt){return!oe(wt)},he=function(wt,Bt){var Nt=wt,nn=ne(Nt)||Nt.isEmpty();if(!Nt.isEmpty()&&!Bt&&(Nt=oe(Nt)||Nt,nn=!0),!g&&!f&&nn){var Mn=Nt.toString(),zt=Ve(Mn,Bt);return zt>=0&&(Nt=Id(JM(Mn,".",zt)),ne(Nt)||(Nt=Id(JM(Mn,".",zt,!0)))),Nt.equals(de)||(ve(Nt),T==null||T(Nt.isEmpty()?null:Que(S,Nt)),h===void 0&&Qe(Nt,Bt)),Nt}return de},Le=Mxt(),Fe=function rt(wt){if(z(),Me(wt),!Y.current){var Bt=Ze(wt),Nt=Id(Bt);Nt.isNaN()||he(Nt,!0)}M==null||M(wt),Le(function(){var nn=wt;L||(nn=wt.replace(/。/g,".")),nn!==wt&&rt(nn)})},ze=function(){Y.current=!0},Ue=function(){Y.current=!1,Fe(W.current.value)},nt=function(wt){Fe(wt.target.value)},it=function(wt){var Bt;if(!(wt&&ct||!wt&&ie)){re.current=!1;var Nt=Id(J.current?Zue(u):u);wt||(Nt=Nt.negate());var nn=(de||Id(0)).add(Nt.toString()),Mn=he(nn,!1);N==null||N(Que(S,Mn),{offset:J.current?Zue(u):u,type:wt?"up":"down"}),(Bt=W.current)===null||Bt===void 0||Bt.focus()}},at=function(wt){var Bt=Id(Ze(Ne)),Nt=Bt;Bt.isNaN()?Nt=de:Nt=he(Bt,wt),h!==void 0?Qe(de,!1):Nt.isNaN()||Qe(Nt,!1)},tt=function(){re.current=!0},Zt=function(wt){var Bt=wt.which,Nt=wt.shiftKey;re.current=!0,Nt?J.current=!0:J.current=!1,Bt===vt.ENTER&&(Y.current||(re.current=!1),at(!1),A==null||A(wt)),m!==!1&&!Y.current&&[vt.UP,vt.DOWN].includes(Bt)&&(it(vt.UP===Bt),wt.preventDefault())},Tt=function(){re.current=!1,J.current=!1},xn=function(){at(!1),K(!1),re.current=!1};return GE(function(){de.isInvalidate()||Qe(de,!1)},[D]),GE(function(){var rt=Id(h);_e(rt);var wt=Id(Ze(Ne));(!rt.equals(wt)||!re.current||E)&&Qe(rt,re.current)},[h]),GE(function(){E&&q()},[Ne]),C.createElement("div",{className:xe(r,o,(t={},be(t,"".concat(r,"-focused"),U),be(t,"".concat(r,"-disabled"),f),be(t,"".concat(r,"-readonly"),g),be(t,"".concat(r,"-not-a-number"),de.isNaN()),be(t,"".concat(r,"-out-of-range"),!de.isInvalidate()&&!ne(de)),t)),style:s,onFocus:function(){K(!0)},onBlur:xn,onKeyDown:Zt,onKeyUp:Tt,onCompositionStart:ze,onCompositionEnd:Ue,onBeforeInput:tt},y&&C.createElement(Nxt,{prefixCls:r,upNode:p,downNode:v,upDisabled:ct,downDisabled:ie,onStep:it}),C.createElement("div",{className:"".concat(F,"-wrap")},C.createElement("input",St({autoComplete:"off",role:"spinbutton","aria-valuemin":a,"aria-valuemax":l,"aria-valuenow":de.isInvalidate()?null:de.toString(),step:u},R,{ref:vu(W,e),className:F,value:Ne,onChange:nt,disabled:f,readOnly:g}))))});ALe.displayName="InputNumber";const Pxt=i=>{const{componentCls:e,lineWidth:t,lineType:n,colorBorder:r,borderRadius:o,fontSizeLG:s,controlHeightLG:a,controlHeightSM:l,colorError:c,inputPaddingHorizontalSM:u,colorTextDescription:d,motionDurationMid:h,colorPrimary:f,controlHeight:g,inputPaddingHorizontal:p,colorBgContainer:v,colorTextDisabled:m,borderRadiusSM:_,borderRadiusLG:y,controlWidth:S,handleVisible:L}=i;return[{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},Wr(i)),OT(i)),K5(i,e)),{display:"inline-block",width:S,margin:0,padding:0,border:`${t}px ${n} ${r}`,borderRadius:o,"&-rtl":{direction:"rtl",[`${e}-input`]:{direction:"rtl"}},"&-lg":{padding:0,fontSize:s,borderRadius:y,[`input${e}-input`]:{height:a-2*t}},"&-sm":{padding:0,borderRadius:_,[`input${e}-input`]:{height:l-2*t,padding:`0 ${u}px`}},"&:hover":Object.assign({},PT(i)),"&-focused":Object.assign({},iF(i)),"&-disabled":Object.assign(Object.assign({},_Q(i)),{[`${e}-input`]:{cursor:"not-allowed"}}),"&-out-of-range":{input:{color:c}},"&-group":Object.assign(Object.assign(Object.assign({},Wr(i)),yLe(i)),{"&-wrapper":{display:"inline-block",textAlign:"start",verticalAlign:"top",[`${e}-affix-wrapper`]:{width:"100%"},"&-lg":{[`${e}-group-addon`]:{borderRadius:y}},"&-sm":{[`${e}-group-addon`]:{borderRadius:_}}}}),[e]:{"&-input":Object.assign(Object.assign({width:"100%",height:g-2*t,padding:`0 ${p}px`,textAlign:"start",backgroundColor:"transparent",border:0,borderRadius:o,outline:0,transition:`all ${h} linear`,appearance:"textfield",color:i.colorText,fontSize:"inherit",verticalAlign:"top"},bLe(i.colorTextPlaceholder)),{'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,webkitAppearance:"none",appearance:"none"}})}})},{[e]:{[`&:hover ${e}-handler-wrap, &-focused ${e}-handler-wrap`]:{opacity:1},[`${e}-handler-wrap`]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,width:i.handleWidth,height:"100%",background:v,borderStartStartRadius:0,borderStartEndRadius:o,borderEndEndRadius:o,borderEndStartRadius:0,opacity:L===!0?1:0,display:"flex",flexDirection:"column",alignItems:"stretch",transition:`opacity ${h} linear ${h}`,[`${e}-handler`]:{display:"flex",alignItems:"center",justifyContent:"center",flex:"auto",height:"40%",[` ${e}-handler-up-inner, ${e}-handler-down-inner `]:{marginInlineEnd:0,fontSize:i.handleFontSize}}},[`${e}-handler`]:{height:"50%",overflow:"hidden",color:d,fontWeight:"bold",lineHeight:0,textAlign:"center",cursor:"pointer",borderInlineStart:`${t}px ${n} ${r}`,transition:`all ${h} linear`,"&:active":{background:i.colorFillAlter},"&:hover":{height:"60%",[` @@ -1079,7 +1079,7 @@ html body { `]:{cursor:"not-allowed"},[` ${e}-handler-up-disabled:hover &-handler-up-inner, ${e}-handler-down-disabled:hover &-handler-down-inner - `]:{color:m}}},{[`${e}-borderless`]:{borderColor:"transparent",boxShadow:"none",[`${e}-handler-down`]:{borderBlockStartWidth:0}}}]},Oxt=i=>{const{componentCls:e,inputPaddingHorizontal:t,inputAffixPadding:n,controlWidth:r,borderRadiusLG:o,borderRadiusSM:s}=i;return{[`${e}-affix-wrapper`]:Object.assign(Object.assign(Object.assign({},OT(i)),K5(i,`${e}-affix-wrapper`)),{position:"relative",display:"inline-flex",width:r,padding:0,paddingInlineStart:t,"&-lg":{borderRadius:o},"&-sm":{borderRadius:s},[`&:not(${e}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},PT(i)),{zIndex:1}),"&-focused, &:focus":{zIndex:1},"&-disabled":{[`${e}[disabled]`]:{background:"transparent"}},[`> div${e}`]:{width:"100%",border:"none",outline:"none",[`&${e}-focused`]:{boxShadow:"none !important"}},[`input${e}-input`]:{padding:0},"&::before":{width:0,visibility:"hidden",content:'"\\a0"'},[`${e}-handler-wrap`]:{zIndex:2},[e]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center",pointerEvents:"none"},"&-prefix":{marginInlineEnd:n},"&-suffix":{position:"absolute",insetBlockStart:0,insetInlineEnd:0,zIndex:1,height:"100%",marginInlineEnd:t,marginInlineStart:n}}})}},Fxt=vo("InputNumber",i=>{const e=CQ(i);return[Pxt(e),Oxt(e),M5(e)]},i=>({controlWidth:90,handleWidth:i.controlHeightSM-i.lineWidth*2,handleFontSize:i.fontSize/2,handleVisible:"auto"}));var Bxt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{getPrefixCls:t,direction:n}=C.useContext(Rn),r=C.useContext(Rh),[o,s]=C.useState(!1),a=C.useRef(null);C.useImperativeHandle(e,()=>a.current);const{className:l,rootClassName:c,size:u,disabled:d,prefixCls:h,addonBefore:f,addonAfter:g,prefix:p,bordered:v=!0,readOnly:m,status:_,controls:y}=i,S=Bxt(i,["className","rootClassName","size","disabled","prefixCls","addonBefore","addonAfter","prefix","bordered","readOnly","status","controls"]),L=t("input-number",h),[E,D]=Fxt(L),{compactSize:k,compactItemClassnames:T}=QS(L,n);let M=C.createElement(zft,{className:`${L}-handler-up-inner`}),A=C.createElement(DZ,{className:`${L}-handler-down-inner`});const N=typeof y=="boolean"?y:void 0;typeof y=="object"&&(M=typeof y.upIcon>"u"?M:C.createElement("span",{className:`${L}-handler-up-inner`},y.upIcon),A=typeof y.downIcon>"u"?A:C.createElement("span",{className:`${L}-handler-down-inner`},y.downIcon));const{hasFeedback:R,status:F,isFormItemInput:W,feedbackIcon:H}=C.useContext(Zf),G=O5(F,_),U=k||u||r,K=p!=null||R,re=!!(f||g),Y=C.useContext(H_),J=d??Y,Q=xe({[`${L}-lg`]:U==="large",[`${L}-sm`]:U==="small",[`${L}-rtl`]:n==="rtl",[`${L}-borderless`]:!v,[`${L}-in-form-item`]:W},Cp(L,G),T,D,l,!K&&!re&&c);let ue=C.createElement(ALe,Object.assign({ref:a,disabled:J,className:Q,upHandler:M,downHandler:A,prefixCls:L,readOnly:m,controls:N},S));if(K){const de=xe(`${L}-affix-wrapper`,Cp(`${L}-affix-wrapper`,G,R),{[`${L}-affix-wrapper-focused`]:o,[`${L}-affix-wrapper-disabled`]:i.disabled,[`${L}-affix-wrapper-sm`]:U==="small",[`${L}-affix-wrapper-lg`]:U==="large",[`${L}-affix-wrapper-rtl`]:n==="rtl",[`${L}-affix-wrapper-readonly`]:m,[`${L}-affix-wrapper-borderless`]:!v},!re&&l,!re&&c,D);ue=C.createElement("div",{className:de,style:i.style,onMouseUp:()=>a.current.focus()},p&&C.createElement("span",{className:`${L}-prefix`},p),Qs(ue,{style:null,value:i.value,onFocus:_e=>{var ve;s(!0),(ve=i.onFocus)===null||ve===void 0||ve.call(i,_e)},onBlur:_e=>{var ve;s(!1),(ve=i.onBlur)===null||ve===void 0||ve.call(i,_e)}}),R&&C.createElement("span",{className:`${L}-suffix`},H))}if(re){const de=`${L}-group`,_e=`${de}-addon`,ve=f?C.createElement("div",{className:_e},f):null,Ve=g?C.createElement("div",{className:_e},g):null,Ze=xe(`${L}-wrapper`,de,D,{[`${de}-rtl`]:n==="rtl"}),We=xe(`${L}-group-wrapper`,{[`${L}-group-wrapper-sm`]:U==="small",[`${L}-group-wrapper-lg`]:U==="large",[`${L}-group-wrapper-rtl`]:n==="rtl"},Cp(`${L}-group-wrapper`,G,R),D,l,c);ue=C.createElement("div",{className:We,style:i.style},C.createElement("div",{className:Ze},ve&&C.createElement(gS,null,C.createElement(ck,{status:!0,override:!0},ve)),Qs(ue,{style:null,disabled:J}),Ve&&C.createElement(gS,null,C.createElement(ck,{status:!0,override:!0},Ve))))}return E(ue)}),OLe=PLe,Wxt=i=>C.createElement(LT,{theme:{components:{InputNumber:{handleVisible:!0}}}},C.createElement(PLe,Object.assign({},i)));OLe._InternalPanelDoNotUseOrYouWillBeFired=Wxt;const O7=OLe;var b0={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40};const $xt={items_per_page:"条/页",jump_to:"跳至",jump_to_confirm:"确定",page:"页",prev_page:"上一页",next_page:"下一页",prev_5:"向前 5 页",next_5:"向后 5 页",prev_3:"向前 3 页",next_3:"向后 3 页",page_size:"页码"};var FLe=function(i){kh(t,i);var e=Th(t);function t(){var n;vs(this,t);for(var r=arguments.length,o=new Array(r),s=0;s=0||a.relatedTarget.className.indexOf("".concat(d,"-item"))>=0))&&u(n.getValidValue()))},n.go=function(a){var l=n.state.goInputText;l!==""&&(a.keyCode===b0.ENTER||a.type==="click")&&(n.setState({goInputText:""}),n.props.quickGo(n.getValidValue()))},n}return _s(t,[{key:"getPageSizeOptions",value:function(){var r=this.props,o=r.pageSize,s=r.pageSizeOptions;return s.some(function(a){return a.toString()===o.toString()})?s:s.concat([o.toString()]).sort(function(a,l){var c=Number.isNaN(Number(a))?0:Number(a),u=Number.isNaN(Number(l))?0:Number(l);return c-u})}},{key:"render",value:function(){var r=this,o=this.props,s=o.pageSize,a=o.locale,l=o.rootPrefixCls,c=o.changeSize,u=o.quickGo,d=o.goButton,h=o.selectComponentClass,f=o.buildOptionText,g=o.selectPrefixCls,p=o.disabled,v=this.state.goInputText,m="".concat(l,"-options"),_=h,y=null,S=null,L=null;if(!c&&!u)return null;var E=this.getPageSizeOptions();if(c&&_){var D=E.map(function(k,T){return $e.createElement(_.Option,{key:T,value:k.toString()},(f||r.buildOptionText)(k))});y=$e.createElement(_,{disabled:p,prefixCls:g,showSearch:!1,className:"".concat(m,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(s||E[0]).toString(),onChange:this.changeSize,getPopupContainer:function(T){return T.parentNode},"aria-label":a.page_size,defaultOpen:!1},D)}return u&&(d&&(L=typeof d=="boolean"?$e.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:p,className:"".concat(m,"-quick-jumper-button")},a.jump_to_confirm):$e.createElement("span",{onClick:this.go,onKeyUp:this.go},d)),S=$e.createElement("div",{className:"".concat(m,"-quick-jumper")},a.jump_to,$e.createElement("input",{disabled:p,type:"text",value:v,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur,"aria-label":a.page}),a.page,L)),$e.createElement("li",{className:"".concat(m)},y,S)}}]),t}($e.Component);FLe.defaultProps={pageSizeOptions:["10","20","50","100"]};var dL=function(e){var t,n=e.rootPrefixCls,r=e.page,o=e.active,s=e.className,a=e.showTitle,l=e.onClick,c=e.onKeyPress,u=e.itemRender,d="".concat(n,"-item"),h=xe(d,"".concat(d,"-").concat(r),(t={},be(t,"".concat(d,"-active"),o),be(t,"".concat(d,"-disabled"),!r),be(t,e.className,s),t)),f=function(){l(r)},g=function(v){c(v,l,r)};return $e.createElement("li",{title:a?r.toString():null,className:h,onClick:f,onKeyPress:g,tabIndex:0},u(r,"page",$e.createElement("a",{rel:"nofollow"},r)))};function DK(){}function ede(i){var e=Number(i);return typeof e=="number"&&!Number.isNaN(e)&&isFinite(e)&&Math.floor(e)===e}var Hxt=function(e,t,n){return n};function fm(i,e,t){var n=typeof i>"u"?e.pageSize:i;return Math.floor((t.total-1)/n)+1}var BLe=function(i){kh(t,i);var e=Th(t);function t(n){var r;vs(this,t),r=e.call(this,n),r.paginationNode=$e.createRef(),r.getJumpPrevPage=function(){return Math.max(1,r.state.current-(r.props.showLessItems?3:5))},r.getJumpNextPage=function(){return Math.min(fm(void 0,r.state,r.props),r.state.current+(r.props.showLessItems?3:5))},r.getItemIcon=function(c,u){var d=r.props.prefixCls,h=c||$e.createElement("button",{type:"button","aria-label":u,className:"".concat(d,"-item-link")});return typeof c=="function"&&(h=$e.createElement(c,te({},r.props))),h},r.isValid=function(c){var u=r.props.total;return ede(c)&&c!==r.state.current&&ede(u)&&u>0},r.shouldDisplayQuickJumper=function(){var c=r.props,u=c.showQuickJumper,d=c.total,h=r.state.pageSize;return d<=h?!1:u},r.handleKeyDown=function(c){(c.keyCode===b0.ARROW_UP||c.keyCode===b0.ARROW_DOWN)&&c.preventDefault()},r.handleKeyUp=function(c){var u=r.getValidValue(c),d=r.state.currentInputValue;u!==d&&r.setState({currentInputValue:u}),c.keyCode===b0.ENTER?r.handleChange(u):c.keyCode===b0.ARROW_UP?r.handleChange(u-1):c.keyCode===b0.ARROW_DOWN&&r.handleChange(u+1)},r.handleBlur=function(c){var u=r.getValidValue(c);r.handleChange(u)},r.changePageSize=function(c){var u=r.state.current,d=fm(c,r.state,r.props);u=u>d?d:u,d===0&&(u=r.state.current),typeof c=="number"&&("pageSize"in r.props||r.setState({pageSize:c}),"current"in r.props||r.setState({current:u,currentInputValue:u})),r.props.onShowSizeChange(u,c),"onChange"in r.props&&r.props.onChange&&r.props.onChange(u,c)},r.handleChange=function(c){var u=r.props,d=u.disabled,h=u.onChange,f=r.state,g=f.pageSize,p=f.current,v=f.currentInputValue;if(r.isValid(c)&&!d){var m=fm(void 0,r.state,r.props),_=c;return c>m?_=m:c<1&&(_=1),"current"in r.props||r.setState({current:_}),_!==v&&r.setState({currentInputValue:_}),h(_,g),_}return p},r.prev=function(){r.hasPrev()&&r.handleChange(r.state.current-1)},r.next=function(){r.hasNext()&&r.handleChange(r.state.current+1)},r.jumpPrev=function(){r.handleChange(r.getJumpPrevPage())},r.jumpNext=function(){r.handleChange(r.getJumpNextPage())},r.hasPrev=function(){return r.state.current>1},r.hasNext=function(){return r.state.current2?d-2:0),f=2;f=s?l=s:l=Number(o),l}},{key:"getShowSizeChanger",value:function(){var r=this.props,o=r.showSizeChanger,s=r.total,a=r.totalBoundaryShowSizeChanger;return typeof o<"u"?o:s>a}},{key:"render",value:function(){var r=this,o=this.props,s=o.prefixCls,a=o.className,l=o.style,c=o.disabled,u=o.hideOnSinglePage,d=o.total,h=o.locale,f=o.showQuickJumper,g=o.showLessItems,p=o.showTitle,v=o.showTotal,m=o.simple,_=o.itemRender,y=o.showPrevNextJumpers,S=o.jumpPrevIcon,L=o.jumpNextIcon,E=o.selectComponentClass,D=o.selectPrefixCls,k=o.pageSizeOptions,T=this.state,M=T.current,A=T.pageSize,N=T.currentInputValue;if(u===!0&&d<=A)return null;var R=fm(void 0,this.state,this.props),F=[],W=null,H=null,G=null,U=null,K=null,re=f&&f.goButton,Y=g?1:2,J=M-1>0?M-1:0,Q=M+1d?d:M*A]));if(m)return re&&(typeof re=="boolean"?K=$e.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},h.jump_to_confirm):K=$e.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},re),K=$e.createElement("li",{title:p?"".concat(h.jump_to).concat(M,"/").concat(R):null,className:"".concat(s,"-simple-pager")},K)),$e.createElement("ul",St({className:xe(s,"".concat(s,"-simple"),be({},"".concat(s,"-disabled"),c),a),style:l,ref:this.paginationNode},ue),de,$e.createElement("li",{title:p?h.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:xe("".concat(s,"-prev"),be({},"".concat(s,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(J)),$e.createElement("li",{title:p?"".concat(M,"/").concat(R):null,className:"".concat(s,"-simple-pager")},$e.createElement("input",{type:"text",value:N,disabled:c,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,onBlur:this.handleBlur,size:3}),$e.createElement("span",{className:"".concat(s,"-slash")},"/"),R),$e.createElement("li",{title:p?h.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:xe("".concat(s,"-next"),be({},"".concat(s,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Q)),K);if(R<=3+Y*2){var _e={locale:h,rootPrefixCls:s,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:p,itemRender:_};R||F.push($e.createElement(dL,St({},_e,{key:"noPager",page:1,className:"".concat(s,"-item-disabled")})));for(var ve=1;ve<=R;ve+=1){var Ve=M===ve;F.push($e.createElement(dL,St({},_e,{key:ve,page:ve,active:Ve})))}}else{var Ze=g?h.prev_3:h.prev_5,We=g?h.next_3:h.next_5;y&&(W=$e.createElement("li",{title:p?Ze:null,key:"prev",onClick:this.jumpPrev,tabIndex:0,onKeyPress:this.runIfEnterJumpPrev,className:xe("".concat(s,"-jump-prev"),be({},"".concat(s,"-jump-prev-custom-icon"),!!S))},_(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(S,"prev page"))),H=$e.createElement("li",{title:p?We:null,key:"next",tabIndex:0,onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:xe("".concat(s,"-jump-next"),be({},"".concat(s,"-jump-next-custom-icon"),!!L))},_(this.getJumpNextPage(),"jump-next",this.getItemIcon(L,"next page")))),U=$e.createElement(dL,{locale:h,last:!0,rootPrefixCls:s,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:R,page:R,active:!1,showTitle:p,itemRender:_}),G=$e.createElement(dL,{locale:h,rootPrefixCls:s,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:p,itemRender:_});var pe=Math.max(1,M-Y),Pe=Math.min(M+Y,R);M-1<=Y&&(Pe=1+Y*2),R-M<=Y&&(pe=R-Y*2);for(var Se=pe;Se<=Pe;Se+=1){var Ne=M===Se;F.push($e.createElement(dL,{locale:h,rootPrefixCls:s,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Se,page:Se,active:Ne,showTitle:p,itemRender:_}))}M-1>=Y*2&&M!==1+2&&(F[0]=C.cloneElement(F[0],{className:"".concat(s,"-item-after-jump-prev")}),F.unshift(W)),R-M>=Y*2&&M!==R-2&&(F[F.length-1]=C.cloneElement(F[F.length-1],{className:"".concat(s,"-item-before-jump-next")}),F.push(H)),pe!==1&&F.unshift(G),Pe!==R&&F.push(U)}var Me=!this.hasPrev()||!R,Qe=!this.hasNext()||!R;return $e.createElement("ul",St({className:xe(s,a,be({},"".concat(s,"-disabled"),c)),style:l,ref:this.paginationNode},ue),de,$e.createElement("li",{title:p?h.prev_page:null,onClick:this.prev,tabIndex:Me?null:0,onKeyPress:this.runIfEnterPrev,className:xe("".concat(s,"-prev"),be({},"".concat(s,"-disabled"),Me)),"aria-disabled":Me},this.renderPrev(J)),F,$e.createElement("li",{title:p?h.next_page:null,onClick:this.next,tabIndex:Qe?null:0,onKeyPress:this.runIfEnterNext,className:xe("".concat(s,"-next"),be({},"".concat(s,"-disabled"),Qe)),"aria-disabled":Qe},this.renderNext(Q)),$e.createElement(FLe,{disabled:c,locale:h,rootPrefixCls:s,selectComponentClass:E,selectPrefixCls:D,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:M,pageSize:A,pageSizeOptions:k,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:re}))}}],[{key:"getDerivedStateFromProps",value:function(r,o){var s={};if("current"in r&&(s.current=r.current,r.current!==o.current&&(s.currentInputValue=s.current)),"pageSize"in r&&r.pageSize!==o.pageSize){var a=o.current,l=fm(r.pageSize,o,r);a=a>l?l:a,"current"in r||(s.current=a,s.currentInputValue=a),s.pageSize=r.pageSize}return s}}]),t}($e.Component);BLe.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:DK,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:DK,locale:$xt,style:{},itemRender:Hxt,totalBoundaryShowSizeChanger:50};const WLe=i=>C.createElement(F5,Object.assign({},i,{size:"small"})),$Le=i=>C.createElement(F5,Object.assign({},i,{size:"middle"}));WLe.Option=F5.Option;$Le.Option=F5.Option;const Vxt=i=>{const{componentCls:e}=i;return{[`${e}-disabled`]:{"&, &:hover":{cursor:"not-allowed",[`${e}-item-link`]:{color:i.colorTextDisabled,cursor:"not-allowed"}},"&:focus-visible":{cursor:"not-allowed",[`${e}-item-link`]:{color:i.colorTextDisabled,cursor:"not-allowed"}}},[`&${e}-disabled`]:{cursor:"not-allowed",[`&${e}-mini`]:{[` + `]:{color:m}}},{[`${e}-borderless`]:{borderColor:"transparent",boxShadow:"none",[`${e}-handler-down`]:{borderBlockStartWidth:0}}}]},Oxt=i=>{const{componentCls:e,inputPaddingHorizontal:t,inputAffixPadding:n,controlWidth:r,borderRadiusLG:o,borderRadiusSM:s}=i;return{[`${e}-affix-wrapper`]:Object.assign(Object.assign(Object.assign({},OT(i)),K5(i,`${e}-affix-wrapper`)),{position:"relative",display:"inline-flex",width:r,padding:0,paddingInlineStart:t,"&-lg":{borderRadius:o},"&-sm":{borderRadius:s},[`&:not(${e}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},PT(i)),{zIndex:1}),"&-focused, &:focus":{zIndex:1},"&-disabled":{[`${e}[disabled]`]:{background:"transparent"}},[`> div${e}`]:{width:"100%",border:"none",outline:"none",[`&${e}-focused`]:{boxShadow:"none !important"}},[`input${e}-input`]:{padding:0},"&::before":{width:0,visibility:"hidden",content:'"\\a0"'},[`${e}-handler-wrap`]:{zIndex:2},[e]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center",pointerEvents:"none"},"&-prefix":{marginInlineEnd:n},"&-suffix":{position:"absolute",insetBlockStart:0,insetInlineEnd:0,zIndex:1,height:"100%",marginInlineEnd:t,marginInlineStart:n}}})}},Fxt=vo("InputNumber",i=>{const e=CQ(i);return[Pxt(e),Oxt(e),M5(e)]},i=>({controlWidth:90,handleWidth:i.controlHeightSM-i.lineWidth*2,handleFontSize:i.fontSize/2,handleVisible:"auto"}));var Bxt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{getPrefixCls:t,direction:n}=C.useContext(Rn),r=C.useContext(Rh),[o,s]=C.useState(!1),a=C.useRef(null);C.useImperativeHandle(e,()=>a.current);const{className:l,rootClassName:c,size:u,disabled:d,prefixCls:h,addonBefore:f,addonAfter:g,prefix:p,bordered:v=!0,readOnly:m,status:_,controls:y}=i,S=Bxt(i,["className","rootClassName","size","disabled","prefixCls","addonBefore","addonAfter","prefix","bordered","readOnly","status","controls"]),L=t("input-number",h),[E,D]=Fxt(L),{compactSize:k,compactItemClassnames:T}=QS(L,n);let M=C.createElement(zft,{className:`${L}-handler-up-inner`}),A=C.createElement(DZ,{className:`${L}-handler-down-inner`});const N=typeof y=="boolean"?y:void 0;typeof y=="object"&&(M=typeof y.upIcon>"u"?M:C.createElement("span",{className:`${L}-handler-up-inner`},y.upIcon),A=typeof y.downIcon>"u"?A:C.createElement("span",{className:`${L}-handler-down-inner`},y.downIcon));const{hasFeedback:R,status:F,isFormItemInput:W,feedbackIcon:H}=C.useContext(Zf),G=O5(F,_),U=k||u||r,K=p!=null||R,re=!!(f||g),Y=C.useContext($_),J=d??Y,Q=xe({[`${L}-lg`]:U==="large",[`${L}-sm`]:U==="small",[`${L}-rtl`]:n==="rtl",[`${L}-borderless`]:!v,[`${L}-in-form-item`]:W},Cp(L,G),T,D,l,!K&&!re&&c);let ue=C.createElement(ALe,Object.assign({ref:a,disabled:J,className:Q,upHandler:M,downHandler:A,prefixCls:L,readOnly:m,controls:N},S));if(K){const de=xe(`${L}-affix-wrapper`,Cp(`${L}-affix-wrapper`,G,R),{[`${L}-affix-wrapper-focused`]:o,[`${L}-affix-wrapper-disabled`]:i.disabled,[`${L}-affix-wrapper-sm`]:U==="small",[`${L}-affix-wrapper-lg`]:U==="large",[`${L}-affix-wrapper-rtl`]:n==="rtl",[`${L}-affix-wrapper-readonly`]:m,[`${L}-affix-wrapper-borderless`]:!v},!re&&l,!re&&c,D);ue=C.createElement("div",{className:de,style:i.style,onMouseUp:()=>a.current.focus()},p&&C.createElement("span",{className:`${L}-prefix`},p),Qs(ue,{style:null,value:i.value,onFocus:_e=>{var ve;s(!0),(ve=i.onFocus)===null||ve===void 0||ve.call(i,_e)},onBlur:_e=>{var ve;s(!1),(ve=i.onBlur)===null||ve===void 0||ve.call(i,_e)}}),R&&C.createElement("span",{className:`${L}-suffix`},H))}if(re){const de=`${L}-group`,_e=`${de}-addon`,ve=f?C.createElement("div",{className:_e},f):null,Ve=g?C.createElement("div",{className:_e},g):null,Ze=xe(`${L}-wrapper`,de,D,{[`${de}-rtl`]:n==="rtl"}),We=xe(`${L}-group-wrapper`,{[`${L}-group-wrapper-sm`]:U==="small",[`${L}-group-wrapper-lg`]:U==="large",[`${L}-group-wrapper-rtl`]:n==="rtl"},Cp(`${L}-group-wrapper`,G,R),D,l,c);ue=C.createElement("div",{className:We,style:i.style},C.createElement("div",{className:Ze},ve&&C.createElement(gS,null,C.createElement(ck,{status:!0,override:!0},ve)),Qs(ue,{style:null,disabled:J}),Ve&&C.createElement(gS,null,C.createElement(ck,{status:!0,override:!0},Ve))))}return E(ue)}),OLe=PLe,Wxt=i=>C.createElement(LT,{theme:{components:{InputNumber:{handleVisible:!0}}}},C.createElement(PLe,Object.assign({},i)));OLe._InternalPanelDoNotUseOrYouWillBeFired=Wxt;const O7=OLe;var _0={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40};const $xt={items_per_page:"条/页",jump_to:"跳至",jump_to_confirm:"确定",page:"页",prev_page:"上一页",next_page:"下一页",prev_5:"向前 5 页",next_5:"向后 5 页",prev_3:"向前 3 页",next_3:"向后 3 页",page_size:"页码"};var FLe=function(i){kh(t,i);var e=Th(t);function t(){var n;vs(this,t);for(var r=arguments.length,o=new Array(r),s=0;s=0||a.relatedTarget.className.indexOf("".concat(d,"-item"))>=0))&&u(n.getValidValue()))},n.go=function(a){var l=n.state.goInputText;l!==""&&(a.keyCode===_0.ENTER||a.type==="click")&&(n.setState({goInputText:""}),n.props.quickGo(n.getValidValue()))},n}return _s(t,[{key:"getPageSizeOptions",value:function(){var r=this.props,o=r.pageSize,s=r.pageSizeOptions;return s.some(function(a){return a.toString()===o.toString()})?s:s.concat([o.toString()]).sort(function(a,l){var c=Number.isNaN(Number(a))?0:Number(a),u=Number.isNaN(Number(l))?0:Number(l);return c-u})}},{key:"render",value:function(){var r=this,o=this.props,s=o.pageSize,a=o.locale,l=o.rootPrefixCls,c=o.changeSize,u=o.quickGo,d=o.goButton,h=o.selectComponentClass,f=o.buildOptionText,g=o.selectPrefixCls,p=o.disabled,v=this.state.goInputText,m="".concat(l,"-options"),_=h,y=null,S=null,L=null;if(!c&&!u)return null;var E=this.getPageSizeOptions();if(c&&_){var D=E.map(function(k,T){return $e.createElement(_.Option,{key:T,value:k.toString()},(f||r.buildOptionText)(k))});y=$e.createElement(_,{disabled:p,prefixCls:g,showSearch:!1,className:"".concat(m,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(s||E[0]).toString(),onChange:this.changeSize,getPopupContainer:function(T){return T.parentNode},"aria-label":a.page_size,defaultOpen:!1},D)}return u&&(d&&(L=typeof d=="boolean"?$e.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:p,className:"".concat(m,"-quick-jumper-button")},a.jump_to_confirm):$e.createElement("span",{onClick:this.go,onKeyUp:this.go},d)),S=$e.createElement("div",{className:"".concat(m,"-quick-jumper")},a.jump_to,$e.createElement("input",{disabled:p,type:"text",value:v,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur,"aria-label":a.page}),a.page,L)),$e.createElement("li",{className:"".concat(m)},y,S)}}]),t}($e.Component);FLe.defaultProps={pageSizeOptions:["10","20","50","100"]};var dL=function(e){var t,n=e.rootPrefixCls,r=e.page,o=e.active,s=e.className,a=e.showTitle,l=e.onClick,c=e.onKeyPress,u=e.itemRender,d="".concat(n,"-item"),h=xe(d,"".concat(d,"-").concat(r),(t={},be(t,"".concat(d,"-active"),o),be(t,"".concat(d,"-disabled"),!r),be(t,e.className,s),t)),f=function(){l(r)},g=function(v){c(v,l,r)};return $e.createElement("li",{title:a?r.toString():null,className:h,onClick:f,onKeyPress:g,tabIndex:0},u(r,"page",$e.createElement("a",{rel:"nofollow"},r)))};function DK(){}function ede(i){var e=Number(i);return typeof e=="number"&&!Number.isNaN(e)&&isFinite(e)&&Math.floor(e)===e}var Hxt=function(e,t,n){return n};function gm(i,e,t){var n=typeof i>"u"?e.pageSize:i;return Math.floor((t.total-1)/n)+1}var BLe=function(i){kh(t,i);var e=Th(t);function t(n){var r;vs(this,t),r=e.call(this,n),r.paginationNode=$e.createRef(),r.getJumpPrevPage=function(){return Math.max(1,r.state.current-(r.props.showLessItems?3:5))},r.getJumpNextPage=function(){return Math.min(gm(void 0,r.state,r.props),r.state.current+(r.props.showLessItems?3:5))},r.getItemIcon=function(c,u){var d=r.props.prefixCls,h=c||$e.createElement("button",{type:"button","aria-label":u,className:"".concat(d,"-item-link")});return typeof c=="function"&&(h=$e.createElement(c,te({},r.props))),h},r.isValid=function(c){var u=r.props.total;return ede(c)&&c!==r.state.current&&ede(u)&&u>0},r.shouldDisplayQuickJumper=function(){var c=r.props,u=c.showQuickJumper,d=c.total,h=r.state.pageSize;return d<=h?!1:u},r.handleKeyDown=function(c){(c.keyCode===_0.ARROW_UP||c.keyCode===_0.ARROW_DOWN)&&c.preventDefault()},r.handleKeyUp=function(c){var u=r.getValidValue(c),d=r.state.currentInputValue;u!==d&&r.setState({currentInputValue:u}),c.keyCode===_0.ENTER?r.handleChange(u):c.keyCode===_0.ARROW_UP?r.handleChange(u-1):c.keyCode===_0.ARROW_DOWN&&r.handleChange(u+1)},r.handleBlur=function(c){var u=r.getValidValue(c);r.handleChange(u)},r.changePageSize=function(c){var u=r.state.current,d=gm(c,r.state,r.props);u=u>d?d:u,d===0&&(u=r.state.current),typeof c=="number"&&("pageSize"in r.props||r.setState({pageSize:c}),"current"in r.props||r.setState({current:u,currentInputValue:u})),r.props.onShowSizeChange(u,c),"onChange"in r.props&&r.props.onChange&&r.props.onChange(u,c)},r.handleChange=function(c){var u=r.props,d=u.disabled,h=u.onChange,f=r.state,g=f.pageSize,p=f.current,v=f.currentInputValue;if(r.isValid(c)&&!d){var m=gm(void 0,r.state,r.props),_=c;return c>m?_=m:c<1&&(_=1),"current"in r.props||r.setState({current:_}),_!==v&&r.setState({currentInputValue:_}),h(_,g),_}return p},r.prev=function(){r.hasPrev()&&r.handleChange(r.state.current-1)},r.next=function(){r.hasNext()&&r.handleChange(r.state.current+1)},r.jumpPrev=function(){r.handleChange(r.getJumpPrevPage())},r.jumpNext=function(){r.handleChange(r.getJumpNextPage())},r.hasPrev=function(){return r.state.current>1},r.hasNext=function(){return r.state.current2?d-2:0),f=2;f=s?l=s:l=Number(o),l}},{key:"getShowSizeChanger",value:function(){var r=this.props,o=r.showSizeChanger,s=r.total,a=r.totalBoundaryShowSizeChanger;return typeof o<"u"?o:s>a}},{key:"render",value:function(){var r=this,o=this.props,s=o.prefixCls,a=o.className,l=o.style,c=o.disabled,u=o.hideOnSinglePage,d=o.total,h=o.locale,f=o.showQuickJumper,g=o.showLessItems,p=o.showTitle,v=o.showTotal,m=o.simple,_=o.itemRender,y=o.showPrevNextJumpers,S=o.jumpPrevIcon,L=o.jumpNextIcon,E=o.selectComponentClass,D=o.selectPrefixCls,k=o.pageSizeOptions,T=this.state,M=T.current,A=T.pageSize,N=T.currentInputValue;if(u===!0&&d<=A)return null;var R=gm(void 0,this.state,this.props),F=[],W=null,H=null,G=null,U=null,K=null,re=f&&f.goButton,Y=g?1:2,J=M-1>0?M-1:0,Q=M+1d?d:M*A]));if(m)return re&&(typeof re=="boolean"?K=$e.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},h.jump_to_confirm):K=$e.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},re),K=$e.createElement("li",{title:p?"".concat(h.jump_to).concat(M,"/").concat(R):null,className:"".concat(s,"-simple-pager")},K)),$e.createElement("ul",St({className:xe(s,"".concat(s,"-simple"),be({},"".concat(s,"-disabled"),c),a),style:l,ref:this.paginationNode},ue),de,$e.createElement("li",{title:p?h.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:xe("".concat(s,"-prev"),be({},"".concat(s,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(J)),$e.createElement("li",{title:p?"".concat(M,"/").concat(R):null,className:"".concat(s,"-simple-pager")},$e.createElement("input",{type:"text",value:N,disabled:c,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,onBlur:this.handleBlur,size:3}),$e.createElement("span",{className:"".concat(s,"-slash")},"/"),R),$e.createElement("li",{title:p?h.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:xe("".concat(s,"-next"),be({},"".concat(s,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Q)),K);if(R<=3+Y*2){var _e={locale:h,rootPrefixCls:s,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:p,itemRender:_};R||F.push($e.createElement(dL,St({},_e,{key:"noPager",page:1,className:"".concat(s,"-item-disabled")})));for(var ve=1;ve<=R;ve+=1){var Ve=M===ve;F.push($e.createElement(dL,St({},_e,{key:ve,page:ve,active:Ve})))}}else{var Ze=g?h.prev_3:h.prev_5,We=g?h.next_3:h.next_5;y&&(W=$e.createElement("li",{title:p?Ze:null,key:"prev",onClick:this.jumpPrev,tabIndex:0,onKeyPress:this.runIfEnterJumpPrev,className:xe("".concat(s,"-jump-prev"),be({},"".concat(s,"-jump-prev-custom-icon"),!!S))},_(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(S,"prev page"))),H=$e.createElement("li",{title:p?We:null,key:"next",tabIndex:0,onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:xe("".concat(s,"-jump-next"),be({},"".concat(s,"-jump-next-custom-icon"),!!L))},_(this.getJumpNextPage(),"jump-next",this.getItemIcon(L,"next page")))),U=$e.createElement(dL,{locale:h,last:!0,rootPrefixCls:s,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:R,page:R,active:!1,showTitle:p,itemRender:_}),G=$e.createElement(dL,{locale:h,rootPrefixCls:s,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:p,itemRender:_});var pe=Math.max(1,M-Y),Pe=Math.min(M+Y,R);M-1<=Y&&(Pe=1+Y*2),R-M<=Y&&(pe=R-Y*2);for(var Se=pe;Se<=Pe;Se+=1){var Ne=M===Se;F.push($e.createElement(dL,{locale:h,rootPrefixCls:s,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Se,page:Se,active:Ne,showTitle:p,itemRender:_}))}M-1>=Y*2&&M!==1+2&&(F[0]=C.cloneElement(F[0],{className:"".concat(s,"-item-after-jump-prev")}),F.unshift(W)),R-M>=Y*2&&M!==R-2&&(F[F.length-1]=C.cloneElement(F[F.length-1],{className:"".concat(s,"-item-before-jump-next")}),F.push(H)),pe!==1&&F.unshift(G),Pe!==R&&F.push(U)}var Me=!this.hasPrev()||!R,Qe=!this.hasNext()||!R;return $e.createElement("ul",St({className:xe(s,a,be({},"".concat(s,"-disabled"),c)),style:l,ref:this.paginationNode},ue),de,$e.createElement("li",{title:p?h.prev_page:null,onClick:this.prev,tabIndex:Me?null:0,onKeyPress:this.runIfEnterPrev,className:xe("".concat(s,"-prev"),be({},"".concat(s,"-disabled"),Me)),"aria-disabled":Me},this.renderPrev(J)),F,$e.createElement("li",{title:p?h.next_page:null,onClick:this.next,tabIndex:Qe?null:0,onKeyPress:this.runIfEnterNext,className:xe("".concat(s,"-next"),be({},"".concat(s,"-disabled"),Qe)),"aria-disabled":Qe},this.renderNext(Q)),$e.createElement(FLe,{disabled:c,locale:h,rootPrefixCls:s,selectComponentClass:E,selectPrefixCls:D,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:M,pageSize:A,pageSizeOptions:k,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:re}))}}],[{key:"getDerivedStateFromProps",value:function(r,o){var s={};if("current"in r&&(s.current=r.current,r.current!==o.current&&(s.currentInputValue=s.current)),"pageSize"in r&&r.pageSize!==o.pageSize){var a=o.current,l=gm(r.pageSize,o,r);a=a>l?l:a,"current"in r||(s.current=a,s.currentInputValue=a),s.pageSize=r.pageSize}return s}}]),t}($e.Component);BLe.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:DK,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:DK,locale:$xt,style:{},itemRender:Hxt,totalBoundaryShowSizeChanger:50};const WLe=i=>C.createElement(F5,Object.assign({},i,{size:"small"})),$Le=i=>C.createElement(F5,Object.assign({},i,{size:"middle"}));WLe.Option=F5.Option;$Le.Option=F5.Option;const Vxt=i=>{const{componentCls:e}=i;return{[`${e}-disabled`]:{"&, &:hover":{cursor:"not-allowed",[`${e}-item-link`]:{color:i.colorTextDisabled,cursor:"not-allowed"}},"&:focus-visible":{cursor:"not-allowed",[`${e}-item-link`]:{color:i.colorTextDisabled,cursor:"not-allowed"}}},[`&${e}-disabled`]:{cursor:"not-allowed",[`&${e}-mini`]:{[` &:hover ${e}-item:not(${e}-item-active), &:active ${e}-item:not(${e}-item-active), &:hover ${e}-item-link, @@ -1090,7 +1090,7 @@ html body { `]:{backgroundColor:"transparent",borderColor:"transparent","&::after":{height:i.paginationItemSizeSM,lineHeight:`${i.paginationItemSizeSM}px`}},[`&${e}-mini ${e}-jump-prev, &${e}-mini ${e}-jump-next`]:{height:i.paginationItemSizeSM,marginInlineEnd:0,lineHeight:`${i.paginationItemSizeSM}px`},[`&${e}-mini ${e}-options`]:{marginInlineStart:i.paginationMiniOptionsMarginInlineStart,["&-size-changer"]:{top:i.paginationMiniOptionsSizeChangerTop},["&-quick-jumper"]:{height:i.paginationItemSizeSM,lineHeight:`${i.paginationItemSizeSM}px`,input:Object.assign(Object.assign({},bQ(i)),{width:i.paginationMiniQuickJumperInputWidth,height:i.controlHeightSM})}}}},Uxt=i=>{const{componentCls:e}=i;return{[` &${e}-simple ${e}-prev, &${e}-simple ${e}-next - `]:{height:i.paginationItemSizeSM,lineHeight:`${i.paginationItemSizeSM}px`,verticalAlign:"top",[`${e}-item-link`]:{height:i.paginationItemSizeSM,backgroundColor:"transparent",border:0,"&:hover":{backgroundColor:i.colorBgTextHover},"&:active":{backgroundColor:i.colorBgTextActive},"&::after":{height:i.paginationItemSizeSM,lineHeight:`${i.paginationItemSizeSM}px`}}},[`&${e}-simple ${e}-simple-pager`]:{display:"inline-block",height:i.paginationItemSizeSM,marginInlineEnd:i.marginXS,input:{boxSizing:"border-box",height:"100%",marginInlineEnd:i.marginXS,padding:`0 ${i.paginationItemPaddingInline}px`,textAlign:"center",backgroundColor:i.paginationItemInputBg,border:`${i.lineWidth}px ${i.lineType} ${i.colorBorder}`,borderRadius:i.borderRadius,outline:"none",transition:`border-color ${i.motionDurationMid}`,color:"inherit","&:hover":{borderColor:i.colorPrimary},"&:focus":{borderColor:i.colorPrimaryHover,boxShadow:`${i.inputOutlineOffset}px 0 ${i.controlOutlineWidth}px ${i.controlOutline}`},"&[disabled]":{color:i.colorTextDisabled,backgroundColor:i.colorBgContainerDisabled,borderColor:i.colorBorder,cursor:"not-allowed"}}}}},jxt=i=>{const{componentCls:e}=i;return{[`${e}-jump-prev, ${e}-jump-next`]:{outline:0,[`${e}-item-container`]:{position:"relative",[`${e}-item-link-icon`]:{color:i.colorPrimary,fontSize:i.fontSizeSM,opacity:0,transition:`all ${i.motionDurationMid}`,"&-svg":{top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,margin:"auto"}},[`${e}-item-ellipsis`]:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,display:"block",margin:"auto",color:i.colorTextDisabled,fontFamily:"Arial, Helvetica, sans-serif",letterSpacing:i.paginationEllipsisLetterSpacing,textAlign:"center",textIndent:i.paginationEllipsisTextIndent,opacity:1,transition:`all ${i.motionDurationMid}`}},"&:hover":{[`${e}-item-link-icon`]:{opacity:1},[`${e}-item-ellipsis`]:{opacity:0}},"&:focus-visible":Object.assign({[`${e}-item-link-icon`]:{opacity:1},[`${e}-item-ellipsis`]:{opacity:0}},Op(i))},[` + `]:{height:i.paginationItemSizeSM,lineHeight:`${i.paginationItemSizeSM}px`,verticalAlign:"top",[`${e}-item-link`]:{height:i.paginationItemSizeSM,backgroundColor:"transparent",border:0,"&:hover":{backgroundColor:i.colorBgTextHover},"&:active":{backgroundColor:i.colorBgTextActive},"&::after":{height:i.paginationItemSizeSM,lineHeight:`${i.paginationItemSizeSM}px`}}},[`&${e}-simple ${e}-simple-pager`]:{display:"inline-block",height:i.paginationItemSizeSM,marginInlineEnd:i.marginXS,input:{boxSizing:"border-box",height:"100%",marginInlineEnd:i.marginXS,padding:`0 ${i.paginationItemPaddingInline}px`,textAlign:"center",backgroundColor:i.paginationItemInputBg,border:`${i.lineWidth}px ${i.lineType} ${i.colorBorder}`,borderRadius:i.borderRadius,outline:"none",transition:`border-color ${i.motionDurationMid}`,color:"inherit","&:hover":{borderColor:i.colorPrimary},"&:focus":{borderColor:i.colorPrimaryHover,boxShadow:`${i.inputOutlineOffset}px 0 ${i.controlOutlineWidth}px ${i.controlOutline}`},"&[disabled]":{color:i.colorTextDisabled,backgroundColor:i.colorBgContainerDisabled,borderColor:i.colorBorder,cursor:"not-allowed"}}}}},jxt=i=>{const{componentCls:e}=i;return{[`${e}-jump-prev, ${e}-jump-next`]:{outline:0,[`${e}-item-container`]:{position:"relative",[`${e}-item-link-icon`]:{color:i.colorPrimary,fontSize:i.fontSizeSM,opacity:0,transition:`all ${i.motionDurationMid}`,"&-svg":{top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,margin:"auto"}},[`${e}-item-ellipsis`]:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,display:"block",margin:"auto",color:i.colorTextDisabled,fontFamily:"Arial, Helvetica, sans-serif",letterSpacing:i.paginationEllipsisLetterSpacing,textAlign:"center",textIndent:i.paginationEllipsisTextIndent,opacity:1,transition:`all ${i.motionDurationMid}`}},"&:hover":{[`${e}-item-link-icon`]:{opacity:1},[`${e}-item-ellipsis`]:{opacity:0}},"&:focus-visible":Object.assign({[`${e}-item-link-icon`]:{opacity:1},[`${e}-item-ellipsis`]:{opacity:0}},Fp(i))},[` ${e}-prev, ${e}-jump-prev, ${e}-jump-next @@ -1099,10 +1099,10 @@ html body { ${e}-next, ${e}-jump-prev, ${e}-jump-next - `]:{display:"inline-block",minWidth:i.paginationItemSize,height:i.paginationItemSize,color:i.colorText,fontFamily:i.paginationFontFamily,lineHeight:`${i.paginationItemSize}px`,textAlign:"center",verticalAlign:"middle",listStyle:"none",borderRadius:i.borderRadius,cursor:"pointer",transition:`all ${i.motionDurationMid}`},[`${e}-prev, ${e}-next`]:{fontFamily:"Arial, Helvetica, sans-serif",outline:0,button:{color:i.colorText,cursor:"pointer",userSelect:"none"},[`${e}-item-link`]:{display:"block",width:"100%",height:"100%",padding:0,fontSize:i.fontSizeSM,textAlign:"center",backgroundColor:"transparent",border:`${i.lineWidth}px ${i.lineType} transparent`,borderRadius:i.borderRadius,outline:"none",transition:`border ${i.motionDurationMid}`},[`&:focus-visible ${e}-item-link`]:Object.assign({},Op(i)),[`&:hover ${e}-item-link`]:{backgroundColor:i.colorBgTextHover},[`&:active ${e}-item-link`]:{backgroundColor:i.colorBgTextActive},[`&${e}-disabled:hover`]:{[`${e}-item-link`]:{backgroundColor:"transparent"}}},[`${e}-slash`]:{marginInlineEnd:i.paginationSlashMarginInlineEnd,marginInlineStart:i.paginationSlashMarginInlineStart},[`${e}-options`]:{display:"inline-block",marginInlineStart:i.margin,verticalAlign:"middle","&-size-changer.-select":{display:"inline-block",width:"auto"},"&-quick-jumper":{display:"inline-block",height:i.controlHeight,marginInlineStart:i.marginXS,lineHeight:`${i.controlHeight}px`,verticalAlign:"top",input:Object.assign(Object.assign({},OT(i)),{width:i.controlHeightLG*1.25,height:i.controlHeight,boxSizing:"border-box",margin:0,marginInlineStart:i.marginXS,marginInlineEnd:i.marginXS})}}}},Kxt=i=>{const{componentCls:e}=i;return{[`${e}-item`]:Object.assign(Object.assign({display:"inline-block",minWidth:i.paginationItemSize,height:i.paginationItemSize,marginInlineEnd:i.marginXS,fontFamily:i.paginationFontFamily,lineHeight:`${i.paginationItemSize-2}px`,textAlign:"center",verticalAlign:"middle",listStyle:"none",backgroundColor:"transparent",border:`${i.lineWidth}px ${i.lineType} transparent`,borderRadius:i.borderRadius,outline:0,cursor:"pointer",userSelect:"none",a:{display:"block",padding:`0 ${i.paginationItemPaddingInline}px`,color:i.colorText,transition:"none","&:hover":{textDecoration:"none"}},[`&:not(${e}-item-active)`]:{"&:hover":{transition:`all ${i.motionDurationMid}`,backgroundColor:i.colorBgTextHover},"&:active":{backgroundColor:i.colorBgTextActive}}},lk(i)),{"&-active":{fontWeight:i.paginationFontWeightActive,backgroundColor:i.paginationItemBgActive,borderColor:i.colorPrimary,a:{color:i.colorPrimary},"&:hover":{borderColor:i.colorPrimaryHover},"&:hover a":{color:i.colorPrimaryHover}}})}},Gxt=i=>{const{componentCls:e}=i;return{[e]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Wr(i)),{"ul, ol":{margin:0,padding:0,listStyle:"none"},"&::after":{display:"block",clear:"both",height:0,overflow:"hidden",visibility:"hidden",content:'""'},[`${e}-total-text`]:{display:"inline-block",height:i.paginationItemSize,marginInlineEnd:i.marginXS,lineHeight:`${i.paginationItemSize-2}px`,verticalAlign:"middle"}}),Kxt(i)),jxt(i)),Uxt(i)),zxt(i)),Vxt(i)),{[`@media only screen and (max-width: ${i.screenLG}px)`]:{[`${e}-item`]:{"&-after-jump-prev, &-before-jump-next":{display:"none"}}},[`@media only screen and (max-width: ${i.screenSM}px)`]:{[`${e}-options`]:{display:"none"}}}),[`&${i.componentCls}-rtl`]:{direction:"rtl"}}},qxt=i=>{const{componentCls:e}=i;return{[`${e}${e}-disabled`]:{"&, &:hover":{[`${e}-item-link`]:{borderColor:i.colorBorder}},"&:focus-visible":{[`${e}-item-link`]:{borderColor:i.colorBorder}},[`${e}-item, ${e}-item-link`]:{backgroundColor:i.colorBgContainerDisabled,borderColor:i.colorBorder,[`&:hover:not(${e}-item-active)`]:{backgroundColor:i.colorBgContainerDisabled,borderColor:i.colorBorder,a:{color:i.colorTextDisabled}},[`&${e}-item-active`]:{backgroundColor:i.paginationItemDisabledBgActive}},[`${e}-prev, ${e}-next`]:{"&:hover button":{backgroundColor:i.colorBgContainerDisabled,borderColor:i.colorBorder,color:i.colorTextDisabled},[`${e}-item-link`]:{backgroundColor:i.colorBgContainerDisabled,borderColor:i.colorBorder}}},[e]:{[`${e}-prev, ${e}-next`]:{"&:hover button":{borderColor:i.colorPrimaryHover,backgroundColor:i.paginationItemBg},[`${e}-item-link`]:{backgroundColor:i.paginationItemLinkBg,borderColor:i.colorBorder},[`&:hover ${e}-item-link`]:{borderColor:i.colorPrimary,backgroundColor:i.paginationItemBg,color:i.colorPrimary},[`&${e}-disabled`]:{[`${e}-item-link`]:{borderColor:i.colorBorder,color:i.colorTextDisabled}}},[`${e}-item`]:{backgroundColor:i.paginationItemBg,border:`${i.lineWidth}px ${i.lineType} ${i.colorBorder}`,[`&:hover:not(${e}-item-active)`]:{borderColor:i.colorPrimary,backgroundColor:i.paginationItemBg,a:{color:i.colorPrimary}},"&-active":{borderColor:i.colorPrimary}}}}},Xxt=vo("Pagination",i=>{const e=Oi(i,{paginationItemSize:i.controlHeight,paginationFontFamily:i.fontFamily,paginationItemBg:i.colorBgContainer,paginationItemBgActive:i.colorBgContainer,paginationFontWeightActive:i.fontWeightStrong,paginationItemSizeSM:i.controlHeightSM,paginationItemInputBg:i.colorBgContainer,paginationMiniOptionsSizeChangerTop:0,paginationItemDisabledBgActive:i.controlItemBgActiveDisabled,paginationItemDisabledColorActive:i.colorTextDisabled,paginationItemLinkBg:i.colorBgContainer,inputOutlineOffset:"0 0",paginationMiniOptionsMarginInlineStart:i.marginXXS/2,paginationMiniQuickJumperInputWidth:i.controlHeightLG*1.1,paginationItemPaddingInline:i.marginXXS*1.5,paginationEllipsisLetterSpacing:i.marginXXS/2,paginationSlashMarginInlineStart:i.marginXXS,paginationSlashMarginInlineEnd:i.marginSM,paginationEllipsisTextIndent:"0.13em"},CQ(i));return[Gxt(e),i.wireframe&&qxt(e)]});var Yxt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var{prefixCls:e,selectPrefixCls:t,className:n,rootClassName:r,size:o,locale:s,selectComponentClass:a,responsive:l,showSizeChanger:c}=i,u=Yxt(i,["prefixCls","selectPrefixCls","className","rootClassName","size","locale","selectComponentClass","responsive","showSizeChanger"]);const{xs:d}=B5(l),{getPrefixCls:h,direction:f,pagination:g={}}=C.useContext(Rn),p=h("pagination",e),[v,m]=Xxt(p),_=c??g.showSizeChanger,y=C.useMemo(()=>{const T=C.createElement("span",{className:`${p}-item-ellipsis`},"•••"),M=C.createElement("button",{className:`${p}-item-link`,type:"button",tabIndex:-1},f==="rtl"?C.createElement(Dj,null):C.createElement(ice,null)),A=C.createElement("button",{className:`${p}-item-link`,type:"button",tabIndex:-1},f==="rtl"?C.createElement(ice,null):C.createElement(Dj,null)),N=C.createElement("a",{className:`${p}-item-link`},C.createElement("div",{className:`${p}-item-container`},f==="rtl"?C.createElement(nce,{className:`${p}-item-link-icon`}):C.createElement(tce,{className:`${p}-item-link-icon`}),T)),R=C.createElement("a",{className:`${p}-item-link`},C.createElement("div",{className:`${p}-item-container`},f==="rtl"?C.createElement(tce,{className:`${p}-item-link-icon`}):C.createElement(nce,{className:`${p}-item-link-icon`}),T));return{prevIcon:M,nextIcon:A,jumpPrevIcon:N,jumpNextIcon:R}},[f,p]),[S]=ST("Pagination",Qwe),L=Object.assign(Object.assign({},S),s),E=o==="small"||!!(d&&!o&&l),D=h("select",t),k=xe({[`${p}-mini`]:E,[`${p}-rtl`]:f==="rtl"},n,r,m);return v(C.createElement(BLe,Object.assign({},y,u,{prefixCls:p,selectPrefixCls:D,className:k,selectComponentClass:a||(E?WLe:$Le),locale:L,showSizeChanger:_})))},kQ=Zxt,Qxt=new mi("antSpinMove",{to:{opacity:1}}),Jxt=new mi("antRotate",{to:{transform:"rotate(405deg)"}}),eLt=i=>({[`${i.componentCls}`]:Object.assign(Object.assign({},Wr(i)),{position:"absolute",display:"none",color:i.colorPrimary,textAlign:"center",verticalAlign:"middle",opacity:0,transition:`transform ${i.motionDurationSlow} ${i.motionEaseInOutCirc}`,"&-spinning":{position:"static",display:"inline-block",opacity:1},"&-nested-loading":{position:"relative",[`> div > ${i.componentCls}`]:{position:"absolute",top:0,insetInlineStart:0,zIndex:4,display:"block",width:"100%",height:"100%",maxHeight:i.contentHeight,[`${i.componentCls}-dot`]:{position:"absolute",top:"50%",insetInlineStart:"50%",margin:-i.spinDotSize/2},[`${i.componentCls}-text`]:{position:"absolute",top:"50%",width:"100%",paddingTop:(i.spinDotSize-i.fontSize)/2+2,textShadow:`0 1px 2px ${i.colorBgContainer}`},[`&${i.componentCls}-show-text ${i.componentCls}-dot`]:{marginTop:-(i.spinDotSize/2)-10},"&-sm":{[`${i.componentCls}-dot`]:{margin:-i.spinDotSizeSM/2},[`${i.componentCls}-text`]:{paddingTop:(i.spinDotSizeSM-i.fontSize)/2+2},[`&${i.componentCls}-show-text ${i.componentCls}-dot`]:{marginTop:-(i.spinDotSizeSM/2)-10}},"&-lg":{[`${i.componentCls}-dot`]:{margin:-(i.spinDotSizeLG/2)},[`${i.componentCls}-text`]:{paddingTop:(i.spinDotSizeLG-i.fontSize)/2+2},[`&${i.componentCls}-show-text ${i.componentCls}-dot`]:{marginTop:-(i.spinDotSizeLG/2)-10}}},[`${i.componentCls}-container`]:{position:"relative",transition:`opacity ${i.motionDurationSlow}`,"&::after":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:"100%",height:"100%",background:i.colorBgContainer,opacity:0,transition:`all ${i.motionDurationSlow}`,content:'""',pointerEvents:"none"}},[`${i.componentCls}-blur`]:{clear:"both",opacity:.5,userSelect:"none",pointerEvents:"none",["&::after"]:{opacity:.4,pointerEvents:"auto"}}},["&-tip"]:{color:i.spinDotDefault},[`${i.componentCls}-dot`]:{position:"relative",display:"inline-block",fontSize:i.spinDotSize,width:"1em",height:"1em","&-item":{position:"absolute",display:"block",width:(i.spinDotSize-i.marginXXS/2)/2,height:(i.spinDotSize-i.marginXXS/2)/2,backgroundColor:i.colorPrimary,borderRadius:"100%",transform:"scale(0.75)",transformOrigin:"50% 50%",opacity:.3,animationName:Qxt,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"alternate","&:nth-child(1)":{top:0,insetInlineStart:0},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:"0.4s"},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:"0.8s"},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:"1.2s"}},"&-spin":{transform:"rotate(45deg)",animationName:Jxt,animationDuration:"1.2s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},[`&-sm ${i.componentCls}-dot`]:{fontSize:i.spinDotSizeSM,i:{width:(i.spinDotSizeSM-i.marginXXS/2)/2,height:(i.spinDotSizeSM-i.marginXXS/2)/2}},[`&-lg ${i.componentCls}-dot`]:{fontSize:i.spinDotSizeLG,i:{width:(i.spinDotSizeLG-i.marginXXS)/2,height:(i.spinDotSizeLG-i.marginXXS)/2}},[`&${i.componentCls}-show-text ${i.componentCls}-text`]:{display:"block"}})}),tLt=vo("Spin",i=>{const e=Oi(i,{spinDotDefault:i.colorTextDescription,spinDotSize:i.controlHeightLG/2,spinDotSizeSM:i.controlHeightLG*.35,spinDotSizeLG:i.controlHeight});return[eLt(e)]},{contentHeight:400});var nLt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{spinPrefixCls:e,spinning:t=!0,delay:n=0,className:r,rootClassName:o,size:s="default",tip:a,wrapperClassName:l,style:c,children:u,hashId:d}=i,h=nLt(i,["spinPrefixCls","spinning","delay","className","rootClassName","size","tip","wrapperClassName","style","children","hashId"]),[f,g]=C.useState(()=>t&&!rLt(t,n));C.useEffect(()=>{if(t){const L=hSt(n,()=>{g(!0)});return L(),()=>{var E;(E=L==null?void 0:L.cancel)===null||E===void 0||E.call(L)}}g(!1)},[n,t]);const p=C.useMemo(()=>typeof u<"u",[u]),{direction:v}=C.useContext(Rn),m=xe(e,{[`${e}-sm`]:s==="small",[`${e}-lg`]:s==="large",[`${e}-spinning`]:f,[`${e}-show-text`]:!!a,[`${e}-rtl`]:v==="rtl"},r,o,d),_=xe(`${e}-container`,{[`${e}-blur`]:f}),y=ll(h,["indicator","prefixCls"]),S=C.createElement("div",Object.assign({},y,{style:c,className:m,"aria-live":"polite","aria-busy":f}),iLt(e,i),a?C.createElement("div",{className:`${e}-text`},a):null);return p?C.createElement("div",Object.assign({},y,{className:xe(`${e}-nested-loading`,l,d)}),f&&C.createElement("div",{key:"loading"},S),C.createElement("div",{className:_,key:"container"},u)):S},HLe=i=>{const{prefixCls:e}=i,{getPrefixCls:t}=C.useContext(Rn),n=t("spin",e),[r,o]=tLt(n),s=Object.assign(Object.assign({},i),{spinPrefixCls:n,hashId:o});return r(C.createElement(oLt,Object.assign({},s)))};HLe.setDefaultIndicator=i=>{eA=i};const VLe=HLe;function zLe(){const i=Object.assign({},arguments.length<=0?void 0:arguments[0]);for(let e=1;e{const r=t[n];r!==void 0&&(i[n]=r)})}return i}var ULe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var{prefixCls:e,className:t,avatar:n,title:r,description:o}=i,s=ULe(i,["prefixCls","className","avatar","title","description"]);const{getPrefixCls:a}=C.useContext(Rn),l=a("list",e),c=xe(`${l}-item-meta`,t),u=$e.createElement("div",{className:`${l}-item-meta-content`},r&&$e.createElement("h4",{className:`${l}-item-meta-title`},r),o&&$e.createElement("div",{className:`${l}-item-meta-description`},o));return $e.createElement("div",Object.assign({},s,{className:c}),n&&$e.createElement("div",{className:`${l}-item-meta-avatar`},n),(r||o)&&u)},aLt=(i,e)=>{var{prefixCls:t,children:n,actions:r,extra:o,className:s,colStyle:a}=i,l=ULe(i,["prefixCls","children","actions","extra","className","colStyle"]);const{grid:c,itemLayout:u}=C.useContext(TQ),{getPrefixCls:d}=C.useContext(Rn),h=()=>{let _;return C.Children.forEach(n,y=>{typeof y=="string"&&(_=!0)}),_&&C.Children.count(n)>1},f=()=>u==="vertical"?!!o:!h(),g=d("list",t),p=r&&r.length>0&&$e.createElement("ul",{className:`${g}-item-action`,key:"actions"},r.map((_,y)=>$e.createElement("li",{key:`${g}-item-action-${y}`},_,y!==r.length-1&&$e.createElement("em",{className:`${g}-item-action-split`})))),v=c?"div":"li",m=$e.createElement(v,Object.assign({},l,c?{}:{ref:e},{className:xe(`${g}-item`,{[`${g}-item-no-flex`]:!f()},s)}),u==="vertical"&&o?[$e.createElement("div",{className:`${g}-item-main`,key:"content"},n,p),$e.createElement("div",{className:`${g}-item-extra`,key:"extra"},o)]:[n,p,Qs(o,{key:"extra"})]);return c?$e.createElement(GSt,{ref:e,flex:1,style:a},m):m},jLe=C.forwardRef(aLt);jLe.Meta=sLt;const lLt=jLe,cLt=i=>{const{listBorderedCls:e,componentCls:t,paddingLG:n,margin:r,padding:o,listItemPaddingSM:s,marginLG:a,borderRadiusLG:l}=i;return{[`${e}`]:{border:`${i.lineWidth}px ${i.lineType} ${i.colorBorder}`,borderRadius:l,[`${t}-header,${t}-footer,${t}-item`]:{paddingInline:n},[`${t}-pagination`]:{margin:`${r}px ${a}px`}},[`${e}${t}-sm`]:{[`${t}-item,${t}-header,${t}-footer`]:{padding:s}},[`${e}${t}-lg`]:{[`${t}-item,${t}-header,${t}-footer`]:{padding:`${o}px ${n}px`}}}},uLt=i=>{const{componentCls:e,screenSM:t,screenMD:n,marginLG:r,marginSM:o,margin:s}=i;return{[`@media screen and (max-width:${n})`]:{[`${e}`]:{[`${e}-item`]:{[`${e}-item-action`]:{marginInlineStart:r}}},[`${e}-vertical`]:{[`${e}-item`]:{[`${e}-item-extra`]:{marginInlineStart:r}}}},[`@media screen and (max-width: ${t})`]:{[`${e}`]:{[`${e}-item`]:{flexWrap:"wrap",[`${e}-action`]:{marginInlineStart:o}}},[`${e}-vertical`]:{[`${e}-item`]:{flexWrap:"wrap-reverse",[`${e}-item-main`]:{minWidth:i.contentWidth},[`${e}-item-extra`]:{margin:`auto auto ${s}px`}}}}}},dLt=i=>{const{componentCls:e,antCls:t,controlHeight:n,minHeight:r,paddingSM:o,marginLG:s,padding:a,listItemPadding:l,colorPrimary:c,listItemPaddingSM:u,listItemPaddingLG:d,paddingXS:h,margin:f,colorText:g,colorTextDescription:p,motionDurationSlow:v,lineWidth:m}=i,_={};return["start","center","end"].forEach(y=>{_[`&-align-${y}`]={textAlign:y}}),{[`${e}`]:Object.assign(Object.assign({},Wr(i)),{position:"relative","*":{outline:"none"},[`${e}-header, ${e}-footer`]:{background:"transparent",paddingBlock:o},[`${e}-pagination`]:Object.assign(Object.assign({marginBlockStart:s},_),{[`${t}-pagination-options`]:{textAlign:"start"}}),[`${e}-spin`]:{minHeight:r,textAlign:"center"},[`${e}-items`]:{margin:0,padding:0,listStyle:"none"},[`${e}-item`]:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:l,color:g,[`${e}-item-meta`]:{display:"flex",flex:1,alignItems:"flex-start",maxWidth:"100%",[`${e}-item-meta-avatar`]:{marginInlineEnd:a},[`${e}-item-meta-content`]:{flex:"1 0",width:0,color:g},[`${e}-item-meta-title`]:{margin:`0 0 ${i.marginXXS}px 0`,color:g,fontSize:i.fontSize,lineHeight:i.lineHeight,"> a":{color:g,transition:`all ${v}`,["&:hover"]:{color:c}}},[`${e}-item-meta-description`]:{color:p,fontSize:i.fontSize,lineHeight:i.lineHeight}},[`${e}-item-action`]:{flex:"0 0 auto",marginInlineStart:i.marginXXL,padding:0,fontSize:0,listStyle:"none",["& > li"]:{position:"relative",display:"inline-block",padding:`0 ${h}px`,color:p,fontSize:i.fontSize,lineHeight:i.lineHeight,textAlign:"center",["&:first-child"]:{paddingInlineStart:0}},[`${e}-item-action-split`]:{position:"absolute",insetBlockStart:"50%",insetInlineEnd:0,width:m,height:Math.ceil(i.fontSize*i.lineHeight)-i.marginXXS*2,transform:"translateY(-50%)",backgroundColor:i.colorSplit}}},[`${e}-empty`]:{padding:`${a}px 0`,color:p,fontSize:i.fontSizeSM,textAlign:"center"},[`${e}-empty-text`]:{padding:a,color:i.colorTextDisabled,fontSize:i.fontSize,textAlign:"center"},[`${e}-item-no-flex`]:{display:"block"}}),[`${e}-grid ${t}-col > ${e}-item`]:{display:"block",maxWidth:"100%",marginBlockEnd:f,paddingBlock:0,borderBlockEnd:"none"},[`${e}-vertical ${e}-item`]:{alignItems:"initial",[`${e}-item-main`]:{display:"block",flex:1},[`${e}-item-extra`]:{marginInlineStart:s},[`${e}-item-meta`]:{marginBlockEnd:a,[`${e}-item-meta-title`]:{marginBlockStart:0,marginBlockEnd:o,color:g,fontSize:i.fontSizeLG,lineHeight:i.lineHeightLG}},[`${e}-item-action`]:{marginBlockStart:a,marginInlineStart:"auto","> li":{padding:`0 ${a}px`,["&:first-child"]:{paddingInlineStart:0}}}},[`${e}-split ${e}-item`]:{borderBlockEnd:`${i.lineWidth}px ${i.lineType} ${i.colorSplit}`,["&:last-child"]:{borderBlockEnd:"none"}},[`${e}-split ${e}-header`]:{borderBlockEnd:`${i.lineWidth}px ${i.lineType} ${i.colorSplit}`},[`${e}-split${e}-empty ${e}-footer`]:{borderTop:`${i.lineWidth}px ${i.lineType} ${i.colorSplit}`},[`${e}-loading ${e}-spin-nested-loading`]:{minHeight:n},[`${e}-split${e}-something-after-last-item ${t}-spin-container > ${e}-items > ${e}-item:last-child`]:{borderBlockEnd:`${i.lineWidth}px ${i.lineType} ${i.colorSplit}`},[`${e}-lg ${e}-item`]:{padding:d},[`${e}-sm ${e}-item`]:{padding:u},[`${e}:not(${e}-vertical)`]:{[`${e}-item-no-flex`]:{[`${e}-item-action`]:{float:"right"}}}}},hLt=vo("List",i=>{const e=Oi(i,{listBorderedCls:`${i.componentCls}-bordered`,minHeight:i.controlHeightLG,listItemPadding:`${i.paddingContentVertical}px 0`,listItemPaddingSM:`${i.paddingContentVerticalSM}px ${i.paddingContentHorizontal}px`,listItemPaddingLG:`${i.paddingContentVerticalLG}px ${i.paddingContentHorizontalLG}px`});return[dLt(e),cLt(e),uLt(e)]},{contentWidth:220});var fLt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r(Re,ct)=>{D(Re),T(ct),t&&t[Ke]&&t[Ke](Re,ct)},W=F("onChange"),H=F("onShowSizeChange"),G=(Ke,Re)=>{if(!_)return null;let ct;return typeof m=="function"?ct=m(Ke):m?ct=Ke[m]:ct=Ke.key,ct||(ct=`list-item-${Re}`),C.createElement(C.Fragment,{key:ct},_(Ke,Re))},U=()=>!!(u||t||p),K=M("list",n),[re,Y]=hLt(K);let J=v;typeof J=="boolean"&&(J={spinning:J});const Q=J&&J.spinning;let ue="";switch(f){case"large":ue="lg";break;case"small":ue="sm";break}const de=xe(K,{[`${K}-vertical`]:c==="vertical",[`${K}-${ue}`]:ue,[`${K}-split`]:o,[`${K}-bordered`]:r,[`${K}-loading`]:Q,[`${K}-grid`]:!!d,[`${K}-something-after-last-item`]:U(),[`${K}-rtl`]:N==="rtl"},s,a,Y),_e=zLe(R,{total:h.length,current:E,pageSize:k},t||{}),ve=Math.ceil(_e.total/_e.pageSize);_e.current>ve&&(_e.current=ve);const Ve=t?C.createElement("div",{className:xe(`${K}-pagination`,`${K}-pagination-align-${(e=_e==null?void 0:_e.align)!==null&&e!==void 0?e:"end"}`)},C.createElement(kQ,Object.assign({},_e,{onChange:W,onShowSizeChange:H}))):null;let Ze=ft(h);t&&h.length>(_e.current-1)*_e.pageSize&&(Ze=ft(h).splice((_e.current-1)*_e.pageSize,_e.pageSize));const We=Object.keys(d||{}).some(Ke=>["xs","sm","md","lg","xl","xxl"].includes(Ke)),pe=B5(We),Pe=C.useMemo(()=>{for(let Ke=0;Ke{if(!d)return;const Ke=Pe&&d[Pe]?d[Pe]:d.column;if(Ke)return{width:`${100/Ke}%`,maxWidth:`${100/Ke}%`}},[d==null?void 0:d.column,Pe]);let Ne=Q&&C.createElement("div",{style:{minHeight:53}});if(Ze.length>0){const Ke=Ze.map((Re,ct)=>G(Re,ct));Ne=d?C.createElement(YSt,{gutter:d.gutter},C.Children.map(Ke,Re=>C.createElement("div",{key:Re==null?void 0:Re.key,style:Se},Re))):C.createElement("ul",{className:`${K}-items`},Ke)}else!l&&!Q&&(Ne=C.createElement("div",{className:`${K}-empty-text`},y&&y.emptyText||(A==null?void 0:A("List"))||C.createElement(nQ,{componentName:"List"})));const Me=_e.position||"bottom",Qe=C.useMemo(()=>({grid:d,itemLayout:c}),[JSON.stringify(d),c]);return re(C.createElement(TQ.Provider,{value:Qe},C.createElement("div",Object.assign({className:de},S),(Me==="top"||Me==="both")&&Ve,g&&C.createElement("div",{className:`${K}-header`},g),C.createElement(VLe,Object.assign({},J),Ne,l),p&&C.createElement("div",{className:`${K}-footer`},p),u||(Me==="bottom"||Me==="both")&&Ve)))}tA.Item=lLt;let Ou=null,J0=i=>i(),gk=[],sF={};function gLt(){const{prefixCls:i,getContainer:e,duration:t,rtl:n,maxCount:r,top:o}=sF,s=i??FZ().getPrefixCls("message"),a=(e==null?void 0:e())||document.body;return{prefixCls:s,container:a,duration:t,rtl:n,maxCount:r,top:o}}const pLt=C.forwardRef((i,e)=>{const t=()=>{const{prefixCls:d,container:h,maxCount:f,duration:g,rtl:p,top:v}=gLt();return{prefixCls:d,getContainer:()=>h,maxCount:f,duration:g,rtl:p,top:v}},[n,r]=C.useState(t),[o,s]=SSe(n),a=FZ(),l=a.getRootPrefixCls(),c=a.getIconPrefixCls(),u=()=>{r(t)};return C.useEffect(u,[]),C.useImperativeHandle(e,()=>{const d=Object.assign({},o);return Object.keys(d).forEach(h=>{d[h]=function(){return u(),o[h].apply(o,arguments)}}),{instance:d,sync:u}}),C.createElement(LT,{prefixCls:l,iconPrefixCls:c},s)});function q5(){if(!Ou){const i=document.createDocumentFragment(),e={fragment:i};Ou=e,J0(()=>{HZ(C.createElement(pLt,{ref:t=>{const{instance:n,sync:r}=t||{};Promise.resolve().then(()=>{!e.instance&&n&&(e.instance=n,e.sync=r,q5())})}}),i)});return}Ou.instance&&(gk.forEach(i=>{const{type:e,skipped:t}=i;if(!t)switch(e){case"open":{J0(()=>{const n=Ou.instance.open(Object.assign(Object.assign({},sF),i.config));n==null||n.then(i.resolve),i.setCloseFn(n)});break}case"destroy":J0(()=>{Ou==null||Ou.instance.destroy(i.key)});break;default:J0(()=>{var n;const r=(n=Ou.instance)[e].apply(n,ft(i.args));r==null||r.then(i.resolve),i.setCloseFn(r)})}}),gk=[])}function mLt(i){sF=Object.assign(Object.assign({},sF),i),J0(()=>{var e;(e=Ou==null?void 0:Ou.sync)===null||e===void 0||e.call(Ou)})}function vLt(i){const e=$Z(t=>{let n;const r={type:"open",config:i,resolve:t,setCloseFn:o=>{n=o}};return gk.push(r),()=>{n?J0(()=>{n()}):r.skipped=!0}});return q5(),e}function _Lt(i,e){const t=$Z(n=>{let r;const o={type:i,args:e,resolve:n,setCloseFn:s=>{r=s}};return gk.push(o),()=>{r?J0(()=>{r()}):o.skipped=!0}});return q5(),t}function bLt(i){gk.push({type:"destroy",key:i}),q5()}const CLt=["success","info","warning","error","loading"],yLt={open:vLt,destroy:bLt,config:mLt,useMessage:Tvt,_InternalPanelDoNotUseOrYouWillBeFired:Lvt},KLe=yLt;CLt.forEach(i=>{KLe[i]=function(){for(var e=arguments.length,t=new Array(e),n=0;n10&&arguments[10]!==void 0?arguments[10]:0,h=n/100*360*((360-s)/360),f=s===0?0:{bottom:0,top:180,left:90,right:-90}[a],g=(100-r)/100*t;return c==="round"&&r!==100&&(g+=u/2,g>=t&&(g=t-.01)),{stroke:typeof l=="string"?l:void 0,strokeDasharray:"".concat(t,"px ").concat(e),strokeDashoffset:g+d,transform:"rotate(".concat(o+h+f,"deg)"),transformOrigin:"0 0",transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},NQ=function(e){var t=e.id,n=e.prefixCls,r=e.steps,o=e.strokeWidth,s=e.trailWidth,a=e.gapDegree,l=a===void 0?0:a,c=e.gapPosition,u=e.trailColor,d=e.strokeLinecap,h=e.style,f=e.className,g=e.strokeColor,p=e.percent,v=Nn(e,DLt),m=ELt(t),_="".concat(m,"-gradient"),y=hL/2-o/2,S=Math.PI*2*y,L=l>0?90+l/2:-90,E=S*((360-l)/360),D=zn(r)==="object"?r:{count:r,space:2},k=D.count,T=D.space,M=F7(S,E,0,100,L,l,c,u,d,o),A=ide(p),N=ide(g),R=N.find(function(G){return G&&zn(G)==="object"}),F=SLt(),W=function(){var U=0;return A.map(function(K,re){var Y=N[re]||N[N.length-1],J=Y&&zn(Y)==="object"?"url(#".concat(_,")"):void 0,Q=F7(S,E,U,K,L,l,c,Y,d,o);return U+=K,C.createElement("circle",{key:re,className:"".concat(n,"-circle-path"),r:y,cx:0,cy:0,stroke:J,strokeLinecap:d,strokeWidth:o,opacity:K===0?0:1,style:Q,ref:function(de){F[re]=de}})}).reverse()},H=function(){var U=Math.round(k*(A[0]/100)),K=100/k,re=0;return new Array(k).fill(null).map(function(Y,J){var Q=J<=U-1?N[0]:u,ue=Q&&zn(Q)==="object"?"url(#".concat(_,")"):void 0,de=F7(S,E,re,K,L,l,c,Q,"butt",o,T);return re+=(E-de.strokeDashoffset+T)*100/E,C.createElement("circle",{key:J,className:"".concat(n,"-circle-path"),r:y,cx:0,cy:0,stroke:ue,strokeWidth:o,opacity:1,style:de,ref:function(ve){F[J]=ve}})})};return C.createElement("svg",St({className:xe("".concat(n,"-circle"),f),viewBox:"".concat(-hL/2," ").concat(-hL/2," ").concat(hL," ").concat(hL),style:h,id:t,role:"presentation"},v),R&&C.createElement("defs",null,C.createElement("linearGradient",{id:_,x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(R).sort(function(G,U){return nde(G)-nde(U)}).map(function(G,U){return C.createElement("stop",{key:U,offset:G,stopColor:R[G]})}))),!k&&C.createElement("circle",{className:"".concat(n,"-circle-trail"),r:y,cx:0,cy:0,stroke:u,strokeLinecap:d,strokeWidth:s||o,style:M}),k?H():W())};NQ.defaultProps=wLt;NQ.displayName="Circle";function _b(i){return!i||i<0?0:i>100?100:i}function lF(i){let{success:e,successPercent:t}=i,n=t;return e&&"progress"in e&&(n=e.progress),e&&"percent"in e&&(n=e.percent),n}const ILt=i=>{let{percent:e,success:t,successPercent:n}=i;const r=_b(lF({success:t,successPercent:n}));return[r,_b(_b(e)-r)]},kLt=i=>{let{success:e={},strokeColor:t}=i;const{strokeColor:n}=e;return[n||rw.green,t||null]},X5=(i,e,t)=>{var n,r,o,s;let a=-1,l=-1;if(e==="step"){const c=t.steps,u=t.strokeWidth;typeof i=="string"||typeof i>"u"?(a=i==="small"?2:14,l=u??8):typeof i=="number"?[a,l]=[i,i]:[a=14,l=8]=i,a*=c}else if(e==="line"){const c=t==null?void 0:t.strokeWidth;typeof i=="string"||typeof i>"u"?l=c||(i==="small"?6:8):typeof i=="number"?[a,l]=[i,i]:[a=-1,l=8]=i}else(e==="circle"||e==="dashboard")&&(typeof i=="string"||typeof i>"u"?[a,l]=i==="small"?[60,60]:[120,120]:typeof i=="number"?[a,l]=[i,i]:(a=(r=(n=i[0])!==null&&n!==void 0?n:i[1])!==null&&r!==void 0?r:120,l=(s=(o=i[0])!==null&&o!==void 0?o:i[1])!==null&&s!==void 0?s:120));return[a,l]},TLt=3,NLt=i=>TLt/i*100,RLt=i=>{const{prefixCls:e,trailColor:t=null,strokeLinecap:n="round",gapPosition:r,gapDegree:o,width:s=120,type:a,children:l,success:c,size:u}=i,d=u??[s,s],[h,f]=X5(d,"circle");let{strokeWidth:g}=i;g===void 0&&(g=Math.max(NLt(h),6));const p={width:h,height:f,fontSize:h*.15+6},v=C.useMemo(()=>{if(o||o===0)return o;if(a==="dashboard")return 75},[o,a]),m=r||a==="dashboard"&&"bottom"||void 0,_=Object.prototype.toString.call(i.strokeColor)==="[object Object]",y=kLt({success:c,strokeColor:i.strokeColor}),S=xe(`${e}-inner`,{[`${e}-circle-gradient`]:_}),L=C.createElement(NQ,{percent:ILt(i),strokeWidth:g,trailWidth:g,strokeColor:y,strokeLinecap:n,trailColor:t,prefixCls:e,gapDegree:v,gapPosition:m});return C.createElement("div",{className:S,style:p},h<=20?C.createElement(NT,{title:l},C.createElement("span",null,L)):C.createElement(C.Fragment,null,L,l))},MLt=RLt;var ALt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{let e=[];return Object.keys(i).forEach(t=>{const n=parseFloat(t.replace(/%/g,""));isNaN(n)||e.push({key:n,value:i[t]})}),e=e.sort((t,n)=>t.key-n.key),e.map(t=>{let{key:n,value:r}=t;return`${r} ${n}%`}).join(", ")},OLt=(i,e)=>{const{from:t=rw.blue,to:n=rw.blue,direction:r=e==="rtl"?"to left":"to right"}=i,o=ALt(i,["from","to","direction"]);if(Object.keys(o).length!==0){const s=PLt(o);return{backgroundImage:`linear-gradient(${r}, ${s})`}}return{backgroundImage:`linear-gradient(${r}, ${t}, ${n})`}},FLt=i=>{const{prefixCls:e,direction:t,percent:n,size:r,strokeWidth:o,strokeColor:s,strokeLinecap:a="round",children:l,trailColor:c=null,success:u}=i,d=s&&typeof s!="string"?OLt(s,t):{backgroundColor:s},h=a==="square"||a==="butt"?0:void 0,f={backgroundColor:c||void 0,borderRadius:h},g=r??[-1,o||(r==="small"?6:8)],[p,v]=X5(g,"line",{strokeWidth:o}),m=Object.assign({width:`${_b(n)}%`,height:v,borderRadius:h},d),_=lF(i),y={width:`${_b(_)}%`,height:v,borderRadius:h,backgroundColor:u==null?void 0:u.strokeColor},S={width:p<0?"100%":p,height:v};return C.createElement(C.Fragment,null,C.createElement("div",{className:`${e}-outer`,style:S},C.createElement("div",{className:`${e}-inner`,style:f},C.createElement("div",{className:`${e}-bg`,style:m}),_!==void 0?C.createElement("div",{className:`${e}-success-bg`,style:y}):null)),l)},BLt=FLt,WLt=i=>{const{size:e,steps:t,percent:n=0,strokeWidth:r=8,strokeColor:o,trailColor:s=null,prefixCls:a,children:l}=i,c=Math.round(t*(n/100)),d=e??[e==="small"?2:14,r],[h,f]=X5(d,"step",{steps:t,strokeWidth:r}),g=h/t,p=new Array(t);for(let v=0;v{const{componentCls:e,iconCls:t}=i;return{[e]:Object.assign(Object.assign({},Wr(i)),{display:"inline-block","&-rtl":{direction:"rtl"},"&-line":{position:"relative",width:"100%",fontSize:i.fontSize,marginInlineEnd:i.marginXS,marginBottom:i.marginXS},[`${e}-outer`]:{display:"inline-block",width:"100%"},[`&${e}-show-info`]:{[`${e}-outer`]:{marginInlineEnd:`calc(-2em - ${i.marginXS}px)`,paddingInlineEnd:`calc(2em + ${i.paddingXS}px)`}},[`${e}-inner`]:{position:"relative",display:"inline-block",width:"100%",overflow:"hidden",verticalAlign:"middle",backgroundColor:i.progressRemainingColor,borderRadius:i.progressLineRadius},[`${e}-inner:not(${e}-circle-gradient)`]:{[`${e}-circle-path`]:{stroke:i.colorInfo}},[`${e}-success-bg, ${e}-bg`]:{position:"relative",backgroundColor:i.colorInfo,borderRadius:i.progressLineRadius,transition:`all ${i.motionDurationSlow} ${i.motionEaseInOutCirc}`},[`${e}-success-bg`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,backgroundColor:i.colorSuccess},[`${e}-text`]:{display:"inline-block",width:"2em",marginInlineStart:i.marginXS,color:i.progressInfoTextColor,lineHeight:1,whiteSpace:"nowrap",textAlign:"start",verticalAlign:"middle",wordBreak:"normal",[t]:{fontSize:i.fontSize}},[`&${e}-status-active`]:{[`${e}-bg::before`]:{position:"absolute",inset:0,backgroundColor:i.colorBgContainer,borderRadius:i.progressLineRadius,opacity:0,animationName:HLt,animationDuration:i.progressActiveMotionDuration,animationTimingFunction:i.motionEaseOutQuint,animationIterationCount:"infinite",content:'""'}},[`&${e}-status-exception`]:{[`${e}-bg`]:{backgroundColor:i.colorError},[`${e}-text`]:{color:i.colorError}},[`&${e}-status-exception ${e}-inner:not(${e}-circle-gradient)`]:{[`${e}-circle-path`]:{stroke:i.colorError}},[`&${e}-status-success`]:{[`${e}-bg`]:{backgroundColor:i.colorSuccess},[`${e}-text`]:{color:i.colorSuccess}},[`&${e}-status-success ${e}-inner:not(${e}-circle-gradient)`]:{[`${e}-circle-path`]:{stroke:i.colorSuccess}}})}},zLt=i=>{const{componentCls:e,iconCls:t}=i;return{[e]:{[`${e}-circle-trail`]:{stroke:i.progressRemainingColor},[`&${e}-circle ${e}-inner`]:{position:"relative",lineHeight:1,backgroundColor:"transparent"},[`&${e}-circle ${e}-text`]:{position:"absolute",insetBlockStart:"50%",insetInlineStart:0,width:"100%",margin:0,padding:0,color:i.colorText,lineHeight:1,whiteSpace:"normal",textAlign:"center",transform:"translateY(-50%)",[t]:{fontSize:`${i.fontSize/i.fontSizeSM}em`}},[`${e}-circle&-status-exception`]:{[`${e}-text`]:{color:i.colorError}},[`${e}-circle&-status-success`]:{[`${e}-text`]:{color:i.colorSuccess}}},[`${e}-inline-circle`]:{lineHeight:1,[`${e}-inner`]:{verticalAlign:"bottom"}}}},ULt=i=>{const{componentCls:e}=i;return{[e]:{[`${e}-steps`]:{display:"inline-block","&-outer":{display:"flex",flexDirection:"row",alignItems:"center"},"&-item":{flexShrink:0,minWidth:i.progressStepMinWidth,marginInlineEnd:i.progressStepMarginInlineEnd,backgroundColor:i.progressRemainingColor,transition:`all ${i.motionDurationSlow}`,"&-active":{backgroundColor:i.colorInfo}}}}}},jLt=i=>{const{componentCls:e,iconCls:t}=i;return{[e]:{[`${e}-small&-line, ${e}-small&-line ${e}-text ${t}`]:{fontSize:i.fontSizeSM}}}},KLt=vo("Progress",i=>{const e=i.marginXXS/2,t=Oi(i,{progressLineRadius:100,progressInfoTextColor:i.colorText,progressDefaultColor:i.colorInfo,progressRemainingColor:i.colorFillSecondary,progressStepMarginInlineEnd:e,progressStepMinWidth:e,progressActiveMotionDuration:"2.4s"});return[VLt(t),zLt(t),ULt(t),jLt(t)]});var GLt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{prefixCls:e,className:t,rootClassName:n,steps:r,strokeColor:o,percent:s=0,size:a="default",showInfo:l=!0,type:c="line",status:u,format:d}=i,h=GLt(i,["prefixCls","className","rootClassName","steps","strokeColor","percent","size","showInfo","type","status","format"]),f=C.useMemo(()=>{var T,M;const A=lF(i);return parseInt(A!==void 0?(T=A??0)===null||T===void 0?void 0:T.toString():(M=s??0)===null||M===void 0?void 0:M.toString(),10)},[s,i.success,i.successPercent]),g=C.useMemo(()=>!qLt.includes(u)&&f>=100?"success":u||"normal",[u,f]),{getPrefixCls:p,direction:v}=C.useContext(Rn),m=p("progress",e),[_,y]=KLt(m),S=C.useMemo(()=>{if(!l)return null;const T=lF(i);let M;const A=d||(R=>`${R}%`),N=c==="line";return d||g!=="exception"&&g!=="success"?M=A(_b(s),_b(T)):g==="exception"?M=N?C.createElement(XS,null):C.createElement(CT,null):g==="success"&&(M=N?C.createElement(EZ,null):C.createElement($ye,null)),C.createElement("span",{className:`${m}-text`,title:typeof M=="string"?M:void 0},M)},[l,s,f,g,c,m,d]),L=Array.isArray(o)?o[0]:o,E=typeof o=="string"||Array.isArray(o)?o:void 0;let D;c==="line"?D=r?C.createElement($Lt,Object.assign({},i,{strokeColor:E,prefixCls:m,steps:r}),S):C.createElement(BLt,Object.assign({},i,{strokeColor:L,prefixCls:m,direction:v}),S):(c==="circle"||c==="dashboard")&&(D=C.createElement(MLt,Object.assign({},i,{strokeColor:L,prefixCls:m,progressStatus:g}),S));const k=xe(m,{[`${m}-inline-circle`]:c==="circle"&&X5(a,"circle")[0]<=20,[`${m}-${c==="dashboard"&&"circle"||r&&"steps"||c}`]:!0,[`${m}-status-${g}`]:!0,[`${m}-show-info`]:l,[`${m}-${a}`]:typeof a=="string",[`${m}-rtl`]:v==="rtl"},t,n,y);return _(C.createElement("div",Object.assign({className:k,role:"progressbar"},ll(h,["trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","success","successPercent"])),D))},rde=XLt;var Tm={};function YLt(i){var e=C.createContext(void 0),t=function(r){var o=r.value,s=r.children,a=C.useRef(o);a.current=o;var l=C.useState(function(){return{getValue:function(){return a.current},listeners:new Set}}),c=Ae(l,1),u=c[0];return br(function(){sh.unstable_batchedUpdates(function(){u.listeners.forEach(function(d){d(o)})})},[o]),C.createElement(e.Provider,{value:u},s)};return{Context:e,Provider:t,defaultValue:i}}function Ah(i,e){var t=tc(typeof e=="function"?e:function(d){if(e===void 0)return d;if(!Array.isArray(e))return d[e];var h={};return e.forEach(function(f){h[f]=d[f]}),h}),n=C.useContext(i==null?void 0:i.Context),r=n||{},o=r.listeners,s=r.getValue,a=C.useRef();a.current=t(n?s():i==null?void 0:i.defaultValue);var l=C.useState({}),c=Ae(l,2),u=c[1];return br(function(){if(!n)return;function d(h){var f=t(h);Pp(a.current,f,!0)||u({})}return o.add(d),function(){o.delete(d)}},[n]),a.current}var qLe=C.createContext(0);function XLe(){return C.useContext(qLe)}function ZLt(i,e){var t=$_(i),n=function(o,s){var a=t?{ref:s}:{},l=C.useRef(0),c=C.useRef(o);return(!e||e(c.current,o))&&(l.current+=1),c.current=o,C.createElement(qLe.Provider,{value:l.current},C.createElement(i,St({},o,a)))};return t?C.forwardRef(n):n}function Y5(i,e){var t=$_(i),n=function(o,s){var a=t?{ref:s}:{};return XLe(),C.createElement(i,St({},o,a))};return t?C.memo(C.forwardRef(n),e):C.memo(n,e)}var gd=YLt();function QLt(i,e){var t=C.useRef(0);t.current+=1;var n=C.useRef(i),r=[];Object.keys(i||{}).map(function(s){var a;(i==null?void 0:i[s])!==((a=n.current)===null||a===void 0?void 0:a[s])&&r.push(s)}),n.current=i;var o=C.useRef([]);return r.length&&(o.current=r),C.useDebugValue(t.current),C.useDebugValue(o.current.join(", ")),e&&console.log("".concat(e,":"),t.current,o.current),t.current}var JLt=C.memo(function(){var i=QLt();return C.createElement("h1",null,"Render Times: ",i)});JLt.displayName="RenderBlock";var YLe=C.createContext({renderWithProps:!1}),eEt="RC_TABLE_KEY";function tEt(i){return i==null?[]:Array.isArray(i)?i:[i]}function Z5(i){var e=[],t={};return i.forEach(function(n){for(var r=n||{},o=r.key,s=r.dataIndex,a=o||tEt(s).join("-")||eEt;t[a];)a="".concat(a,"_next");t[a]=!0,e.push(a)}),e}function kK(i){return i!=null}function nEt(i){return i&&zn(i)==="object"&&!Array.isArray(i)&&!C.isValidElement(i)}function iEt(i,e,t,n,r,o){var s=C.useContext(YLe),a=XLe(),l=LC(function(){if(kK(n))return[n];var c=e==null||e===""?[]:Array.isArray(e)?e:[e],u=Yd(i,c),d=u,h=void 0;if(r){var f=r(u,i,t);nEt(f)?(d=f.children,h=f.props,s.renderWithProps=!0):d=f}return[d,h]},[a,i,n,e,r,t],function(c,u){if(o){var d=Ae(c,2),h=d[1],f=Ae(u,2),g=f[1];return o(g,h)}return s.renderWithProps?!0:!Pp(c,u,!0)});return l}function rEt(i,e,t,n){var r=i+e-1;return i<=n&&r>=t}function oEt(i,e){return Ah(gd,function(t){var n=rEt(i,e||1,t.hoverStartRow,t.hoverEndRow);return[n,t.onHover]})}var sEt=function(e){var t=e.ellipsis,n=e.rowType,r=e.children,o,s=t===!0?{showTitle:!0}:t;return s&&(s.showTitle||n==="header")&&(typeof r=="string"||typeof r=="number"?o=r.toString():C.isValidElement(r)&&typeof r.props.children=="string"&&(o=r.props.children)),o};function aEt(i){var e,t,n,r,o,s,a,l,c=i.component,u=i.children,d=i.ellipsis,h=i.scope,f=i.prefixCls,g=i.className,p=i.align,v=i.record,m=i.render,_=i.dataIndex,y=i.renderIndex,S=i.shouldCellUpdate,L=i.index,E=i.rowType,D=i.colSpan,k=i.rowSpan,T=i.fixLeft,M=i.fixRight,A=i.firstFixLeft,N=i.lastFixLeft,R=i.firstFixRight,F=i.lastFixRight,W=i.appendNode,H=i.additionalProps,G=H===void 0?{}:H,U=i.isSticky,K="".concat(f,"-cell"),re=Ah(gd,["supportSticky","allColumnsFixedLeft"]),Y=re.supportSticky,J=re.allColumnsFixedLeft,Q=iEt(v,_,y,u,m,S),ue=Ae(Q,2),de=ue[0],_e=ue[1],ve={},Ve=typeof T=="number"&&Y,Ze=typeof M=="number"&&Y;Ve&&(ve.position="sticky",ve.left=T),Ze&&(ve.position="sticky",ve.right=M);var We=(e=(t=(n=_e==null?void 0:_e.colSpan)!==null&&n!==void 0?n:G.colSpan)!==null&&t!==void 0?t:D)!==null&&e!==void 0?e:1,pe=(r=(o=(s=_e==null?void 0:_e.rowSpan)!==null&&s!==void 0?s:G.rowSpan)!==null&&o!==void 0?o:k)!==null&&r!==void 0?r:1,Pe=oEt(L,pe),Se=Ae(Pe,2),Ne=Se[0],Me=Se[1],Qe=function(q){var oe;v&&Me(L,L+pe-1),G==null||(oe=G.onMouseEnter)===null||oe===void 0||oe.call(G,q)},Ke=function(q){var oe;v&&Me(-1,-1),G==null||(oe=G.onMouseLeave)===null||oe===void 0||oe.call(G,q)};if(We===0||pe===0)return null;var Re=(a=G.title)!==null&&a!==void 0?a:sEt({rowType:E,ellipsis:d,children:de}),ct=xe(K,g,(l={},be(l,"".concat(K,"-fix-left"),Ve&&Y),be(l,"".concat(K,"-fix-left-first"),A&&Y),be(l,"".concat(K,"-fix-left-last"),N&&Y),be(l,"".concat(K,"-fix-left-all"),N&&J&&Y),be(l,"".concat(K,"-fix-right"),Ze&&Y),be(l,"".concat(K,"-fix-right-first"),R&&Y),be(l,"".concat(K,"-fix-right-last"),F&&Y),be(l,"".concat(K,"-ellipsis"),d),be(l,"".concat(K,"-with-append"),W),be(l,"".concat(K,"-fix-sticky"),(Ve||Ze)&&U&&Y),be(l,"".concat(K,"-row-hover"),!_e&&Ne),l),G.className,_e==null?void 0:_e.className),ie={};p&&(ie.textAlign=p);var le=te(te(te(te({},G.style),ie),ve),_e==null?void 0:_e.style),ce=de;return zn(ce)==="object"&&!Array.isArray(ce)&&!C.isValidElement(ce)&&(ce=null),d&&(N||R)&&(ce=C.createElement("span",{className:"".concat(K,"-content")},ce)),C.createElement(c,St({},_e,G,{className:ct,style:le,title:Re,scope:h,onMouseEnter:Qe,onMouseLeave:Ke,colSpan:We!==1?We:null,rowSpan:pe!==1?pe:null}),W,ce)}const Q5=C.memo(aEt);function RQ(i,e,t,n,r,o){var s=t[i]||{},a=t[e]||{},l,c;s.fixed==="left"?l=n.left[r==="rtl"?e:i]:a.fixed==="right"&&(c=n.right[r==="rtl"?i:e]);var u=!1,d=!1,h=!1,f=!1,g=t[e+1],p=t[i-1],v=!(o!=null&&o.children);if(r==="rtl"){if(l!==void 0){var m=p&&p.fixed==="left";f=!m&&v}else if(c!==void 0){var _=g&&g.fixed==="right";h=!_&&v}}else if(l!==void 0){var y=g&&g.fixed==="left";u=!y&&v}else if(c!==void 0){var S=p&&p.fixed==="right";d=!S&&v}return{fixLeft:l,fixRight:c,lastFixLeft:u,firstFixRight:d,lastFixRight:h,firstFixLeft:f,isSticky:n.isSticky}}var ZLe=C.createContext({});function lEt(i){var e=i.className,t=i.index,n=i.children,r=i.colSpan,o=r===void 0?1:r,s=i.rowSpan,a=i.align,l=Ah(gd,["prefixCls","direction"]),c=l.prefixCls,u=l.direction,d=C.useContext(ZLe),h=d.scrollColumnIndex,f=d.stickyOffsets,g=d.flattenColumns,p=d.columns,v=t+o-1,m=v+1===h?o+1:o,_=RQ(t,t+m-1,g,f,u,p==null?void 0:p[t]);return C.createElement(Q5,St({className:e,index:t,component:"td",prefixCls:c,record:null,dataIndex:null,align:a,colSpan:m,rowSpan:s,render:function(){return n}},_))}var cEt=["children"];function uEt(i){var e=i.children,t=Nn(i,cEt);return C.createElement("tr",t,e)}function J5(i){var e=i.children;return e}J5.Row=uEt;J5.Cell=lEt;function dEt(i){var e=i.children,t=i.stickyOffsets,n=i.flattenColumns,r=i.columns,o=Ah(gd,"prefixCls"),s=n.length-1,a=n[s],l=C.useMemo(function(){return{stickyOffsets:t,flattenColumns:n,scrollColumnIndex:a!=null&&a.scrollbar?s:null,columns:r}},[a,n,s,t,r]);return C.createElement(ZLe.Provider,{value:l},C.createElement("tfoot",{className:"".concat(o,"-summary")},e))}const B2=Y5(dEt);var QLe=J5;function hEt(i){return null}function fEt(i){return null}function JLe(i,e,t,n,r,o){var s=[];s.push({record:i,indent:e,index:o});var a=r(i),l=n==null?void 0:n.has(a);if(i&&Array.isArray(i[t])&&l)for(var c=0;c1?Me-1:0),Ke=1;Ke=0;a-=1){var l=e[a],c=t&&t[a],u=c&&c[ZE];if(l||u||s){var d=u||{};d.columnType;var h=Nn(d,yEt);r.unshift(C.createElement("col",St({key:a,style:{width:l}},h))),s=!0}}return C.createElement("colgroup",null,r)}var wEt=["className","noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName","onScroll","maxContentScroll","children"];function SEt(i,e){return C.useMemo(function(){for(var t=[],n=0;n=0})},[o]),M=o[o.length-1],A={fixed:M?M.fixed:null,scrollbar:!0,onHeaderCell:function(){return{className:"".concat(y,"-cell-scrollbar")}}},N=C.useMemo(function(){return E?[].concat(ft(r),[A]):r},[E,r]),R=C.useMemo(function(){return E?[].concat(ft(o),[A]):o},[E,o]),F=C.useMemo(function(){var H=l.right,G=l.left;return te(te({},l),{},{left:c==="rtl"?[].concat(ft(G.map(function(U){return U+E})),[0]):G,right:c==="rtl"?H:[].concat(ft(H.map(function(U){return U+E})),[0]),isSticky:L})},[E,l,L]),W=SEt(s,a);return C.createElement("div",{style:te({overflow:"hidden"},L?{top:d,bottom:h}:{}),ref:k,className:xe(t,be({},f,!!f))},C.createElement("table",{style:{tableLayout:"fixed",visibility:n||W?null:"hidden"}},(!n||!p||T)&&C.createElement(iEe,{colWidths:W?[].concat(ft(W),[E]):[],columCount:a+1,columns:R}),v(te(te({},m),{},{stickyOffsets:F,columns:N,flattenColumns:R}))))});rEe.displayName="FixedHolder";const ode=C.memo(rEe);function oEe(i){var e=i.cells,t=i.stickyOffsets,n=i.flattenColumns,r=i.rowComponent,o=i.cellComponent,s=i.tdCellComponent,a=i.onHeaderRow,l=i.index,c=Ah(gd,["prefixCls","direction"]),u=c.prefixCls,d=c.direction,h;a&&(h=a(e.map(function(g){return g.column}),l));var f=Z5(e.map(function(g){return g.column}));return C.createElement(r,h,e.map(function(g,p){var v=g.column,m=RQ(g.colStart,g.colEnd,n,t,d,v),_;return v&&v.onHeaderCell&&(_=g.column.onHeaderCell(v)),C.createElement(Q5,St({},g,{scope:v.title?g.colSpan>1?"colgroup":"col":null,ellipsis:v.ellipsis,align:v.align,component:v.title?o:s,prefixCls:u,key:f[p]},m,{additionalProps:_,rowType:"header"}))}))}oEe.displayName="HeaderRow";function xEt(i){var e=[];function t(s,a){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;e[l]=e[l]||[];var c=a,u=s.filter(Boolean).map(function(d){var h={key:d.key,className:d.className||"",children:d.title,column:d,colStart:c},f=1,g=d.children;return g&&g.length>0&&(f=t(g,c,l+1).reduce(function(p,v){return p+v},0),h.hasSubColumns=!0),"colSpan"in d&&(f=d.colSpan),"rowSpan"in d&&(h.rowSpan=d.rowSpan),h.colSpan=f,h.colEnd=h.colStart+f-1,e[l].push(h),c+=f,f});return u}t(i,0);for(var n=e.length,r=function(a){e[a].forEach(function(l){!("rowSpan"in l)&&!l.hasSubColumns&&(l.rowSpan=n-a)})},o=0;o0?[].concat(ft(e),ft(TK(o).map(function(s){return te({fixed:r},s)}))):[].concat(ft(e),[te(te({},t),{},{fixed:r})])},[])}function IEt(i){return i.map(function(e){var t=e.fixed,n=Nn(e,DEt),r=t;return t==="left"?r="right":t==="right"&&(r="left"),te({fixed:r},n)})}function kEt(i,e){var t=i.prefixCls,n=i.columns,r=i.children,o=i.expandable,s=i.expandedKeys,a=i.columnTitle,l=i.getRowKey,c=i.onTriggerExpand,u=i.expandIcon,d=i.rowExpandable,h=i.expandIconColumnIndex,f=i.direction,g=i.expandRowByClick,p=i.columnWidth,v=i.fixed,m=C.useMemo(function(){return n||MQ(r)},[n,r]),_=C.useMemo(function(){if(o){var L,E=m.slice();if(!E.includes(Tm)){var D=h||0;D>=0&&E.splice(D,0,Tm)}var k=E.indexOf(Tm);E=E.filter(function(N,R){return N!==Tm||R===k});var T=m[k],M;(v==="left"||v)&&!h?M="left":(v==="right"||v)&&h===m.length?M="right":M=T?T.fixed:null;var A=(L={},be(L,ZE,{className:"".concat(t,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),be(L,"title",a),be(L,"fixed",M),be(L,"className","".concat(t,"-row-expand-icon-cell")),be(L,"width",p),be(L,"render",function(R,F,W){var H=l(F,W),G=s.has(H),U=d?d(F):!0,K=u({prefixCls:t,expanded:G,expandable:U,record:F,onExpand:c});return g?C.createElement("span",{onClick:function(Y){return Y.stopPropagation()}},K):K}),L);return E.map(function(N){return N===Tm?A:N})}return m.filter(function(N){return N!==Tm})},[o,m,l,s,u,f]),y=C.useMemo(function(){var L=_;return e&&(L=e(L)),L.length||(L=[{render:function(){return null}}]),L},[e,_,f]),S=C.useMemo(function(){return f==="rtl"?IEt(TK(y)):TK(y)},[y,f]);return[y,S]}function TEt(i){var e,t=i.prefixCls,n=i.record,r=i.onExpand,o=i.expanded,s=i.expandable,a="".concat(t,"-row-expand-icon");if(!s)return C.createElement("span",{className:xe(a,"".concat(t,"-row-spaced"))});var l=function(u){r(n,u),u.stopPropagation()};return C.createElement("span",{className:xe(a,(e={},be(e,"".concat(t,"-row-expanded"),o),be(e,"".concat(t,"-row-collapsed"),!o),e)),onClick:l})}function NEt(i,e,t){var n=[];function r(o){(o||[]).forEach(function(s,a){n.push(e(s,a)),r(s[t])})}return r(i),n}function REt(i,e,t){var n=CEt(i),r=n.expandIcon,o=n.expandedRowKeys,s=n.defaultExpandedRowKeys,a=n.defaultExpandAllRows,l=n.expandedRowRender,c=n.onExpand,u=n.onExpandedRowsChange,d=n.childrenColumnName,h=r||TEt,f=d||"children",g=C.useMemo(function(){return l?"row":i.expandable&&i.internalHooks===cF&&i.expandable.__PARENT_RENDER_ICON__||e.some(function(L){return L&&zn(L)==="object"&&L[f]})?"nest":!1},[!!l,e]),p=C.useState(function(){return s||(a?NEt(e,t,f):[])}),v=Ae(p,2),m=v[0],_=v[1],y=C.useMemo(function(){return new Set(o||m||[])},[o,m]),S=C.useCallback(function(L){var E=t(L,e.indexOf(L)),D,k=y.has(E);k?(y.delete(E),D=ft(y)):D=[].concat(ft(y),[E]),_(D),c&&c(!k,L),u&&u(D)},[t,y,e,c,u]);return[n,g,y,h,f,S]}function MEt(i,e,t,n){var r=i.map(function(o,s){return RQ(s,s,i,e,t,n==null?void 0:n[s])});return LC(function(){return r},[r],function(o,s){return!Pp(o,s)})}function sEe(i){var e=C.useRef(i),t=C.useState({}),n=Ae(t,2),r=n[1],o=C.useRef(null),s=C.useRef([]);function a(l){s.current.push(l);var c=Promise.resolve();o.current=c,c.then(function(){if(o.current===c){var u=s.current,d=e.current;s.current=[],u.forEach(function(h){e.current=h(e.current)}),o.current=null,d!==e.current&&r({})}})}return C.useEffect(function(){return function(){o.current=null}},[]),[e.current,a]}function AEt(i){var e=C.useRef(i||null),t=C.useRef();function n(){window.clearTimeout(t.current)}function r(s){e.current=s,n(),t.current=window.setTimeout(function(){e.current=null,t.current=void 0},100)}function o(){return e.current}return C.useEffect(function(){return n},[]),[r,o]}function PEt(){var i=C.useState(-1),e=Ae(i,2),t=e[0],n=e[1],r=C.useState(-1),o=Ae(r,2),s=o[0],a=o[1],l=C.useCallback(function(c,u){n(c),a(u)},[]);return[t,s,l]}var ade=Zs()?window:null;function OEt(i,e){var t=zn(i)==="object"?i:{},n=t.offsetHeader,r=n===void 0?0:n,o=t.offsetSummary,s=o===void 0?0:o,a=t.offsetScroll,l=a===void 0?0:a,c=t.getContainer,u=c===void 0?function(){return ade}:c,d=u()||ade;return C.useMemo(function(){var h=!!i;return{isSticky:h,stickyClassName:h?"".concat(e,"-sticky-holder"):"",offsetHeader:r,offsetSummary:s,offsetScroll:l,container:d}},[l,r,s,e,d])}function FEt(i,e,t){var n=C.useMemo(function(){for(var r=[],o=[],s=0,a=0,l=0;l=d&&(G=d-h),s({scrollLeft:G/d*(u+2)}),_.current.x=R.pageX},M=function(){if(o.current){var R=Xue(o.current).top,F=R+o.current.offsetHeight,W=l===window?document.documentElement.scrollTop+window.innerHeight:Xue(l).top+l.clientHeight;F-GO()<=W||R>=W-a?m(function(H){return te(te({},H),{},{isHiddenScrollBar:!0})}):m(function(H){return te(te({},H),{},{isHiddenScrollBar:!1})})}},A=function(R){m(function(F){return te(te({},F),{},{scrollLeft:R/u*d||0})})};return C.useImperativeHandle(t,function(){return{setScrollLeft:A}}),C.useEffect(function(){var N=lp(document.body,"mouseup",D,!1),R=lp(document.body,"mousemove",T,!1);return M(),function(){N.remove(),R.remove()}},[h,L]),C.useEffect(function(){var N=lp(l,"scroll",M,!1),R=lp(window,"resize",M,!1);return function(){N.remove(),R.remove()}},[l]),C.useEffect(function(){v.isHiddenScrollBar||m(function(N){var R=o.current;return R?te(te({},N),{},{scrollLeft:R.scrollLeft/R.scrollWidth*R.clientWidth}):N})},[v.isHiddenScrollBar]),u<=d||!h||v.isHiddenScrollBar?null:C.createElement("div",{style:{height:GO(),width:d,bottom:a},className:"".concat(c,"-sticky-scroll")},C.createElement("div",{onMouseDown:k,ref:f,className:xe("".concat(c,"-sticky-scroll-bar"),be({},"".concat(c,"-sticky-scroll-bar-active"),L)),style:{width:"".concat(h,"px"),transform:"translate3d(".concat(v.scrollLeft,"px, 0, 0)")}}))};const WEt=C.forwardRef(BEt);var $Et=[],HEt={},cF="rc-table-internal-hook";function VEt(){return"No Data"}function zEt(i){var e,t=te({rowKey:"key",prefixCls:"rc-table",emptyText:VEt},i),n=t.prefixCls,r=t.className,o=t.rowClassName,s=t.style,a=t.data,l=t.rowKey,c=t.scroll,u=t.tableLayout,d=t.direction,h=t.title,f=t.footer,g=t.summary,p=t.caption,v=t.id,m=t.showHeader,_=t.components,y=t.emptyText,S=t.onRow,L=t.onHeaderRow,E=t.internalHooks,D=t.transformColumns,k=t.internalRefs,T=t.sticky,M=a||$Et,A=!!M.length,N=C.useCallback(function(Xt,Gt){return Yd(_,Xt)||Gt},[_]),R=C.useMemo(function(){return typeof l=="function"?l:function(Xt){var Gt=Xt&&Xt[l];return Gt}},[l]),F=PEt(),W=Ae(F,3),H=W[0],G=W[1],U=W[2],K=REt(t,M,R),re=Ae(K,6),Y=re[0],J=re[1],Q=re[2],ue=re[3],de=re[4],_e=re[5],ve=C.useState(0),Ve=Ae(ve,2),Ze=Ve[0],We=Ve[1],pe=kEt(te(te(te({},t),Y),{},{expandable:!!Y.expandedRowRender,columnTitle:Y.columnTitle,expandedKeys:Q,getRowKey:R,onTriggerExpand:_e,expandIcon:ue,expandIconColumnIndex:Y.expandIconColumnIndex,direction:d}),E===cF?D:null),Pe=Ae(pe,2),Se=Pe[0],Ne=Pe[1],Me=C.useMemo(function(){return{columns:Se,flattenColumns:Ne}},[Se,Ne]),Qe=C.useRef(),Ke=C.useRef(),Re=C.useRef(),ct=C.useRef(),ie=C.useRef(),le=C.useState(!1),ce=Ae(le,2),z=ce[0],q=ce[1],oe=C.useState(!1),ne=Ae(oe,2),he=ne[0],Le=ne[1],Fe=sEe(new Map),ze=Ae(Fe,2),Ue=ze[0],nt=ze[1],it=Z5(Ne),at=it.map(function(Xt){return Ue.get(Xt)}),tt=C.useMemo(function(){return at},[at.join("_")]),Zt=FEt(tt,Ne.length,d),Tt=c&&kK(c.y),xn=c&&kK(c.x)||!!Y.fixed,rt=xn&&Ne.some(function(Xt){var Gt=Xt.fixed;return Gt}),wt=C.useRef(),Bt=OEt(T,n),Nt=Bt.isSticky,nn=Bt.offsetHeader,Mn=Bt.offsetSummary,zt=Bt.offsetScroll,Qt=Bt.stickyClassName,lt=Bt.container,ut=C.useMemo(function(){return g==null?void 0:g(M)},[g,M]),dt=(Tt||Nt)&&C.isValidElement(ut)&&ut.type===J5&&ut.props.fixed,Mt,Kt,mn;Tt&&(Kt={overflowY:"scroll",maxHeight:c.y}),xn&&(Mt={overflowX:"auto"},Tt||(Kt={overflowY:"hidden"}),mn={width:(c==null?void 0:c.x)===!0?"auto":c==null?void 0:c.x,minWidth:"100%"});var lr=C.useCallback(function(Xt,Gt){DT(Qe.current)&&nt(function(oi){if(oi.get(Xt)!==Gt){var Fi=new Map(oi);return Fi.set(Xt,Gt),Fi}return oi})},[]),nr=AEt(null),Hr=Ae(nr,2),Jn=Hr[0],Ii=Hr[1];function _o(Xt,Gt){Gt&&(typeof Gt=="function"?Gt(Xt):Gt.scrollLeft!==Xt&&(Gt.scrollLeft=Xt,Gt.scrollLeft!==Xt&&setTimeout(function(){Gt.scrollLeft=Xt},0)))}var No=tc(function(Xt){var Gt=Xt.currentTarget,oi=Xt.scrollLeft,Fi=d==="rtl",Co=typeof oi=="number"?oi:Gt.scrollLeft,Bs=Gt||HEt;if(!Ii()||Ii()===Bs){var ul;Jn(Bs),_o(Co,Ke.current),_o(Co,Re.current),_o(Co,ie.current),_o(Co,(ul=wt.current)===null||ul===void 0?void 0:ul.setScrollLeft)}if(Gt){var Ws=Gt.scrollWidth,Lc=Gt.clientWidth;if(Ws===Lc){q(!1),Le(!1);return}Fi?(q(-Co0)):(q(Co>0),Le(Co{r(o,c),c.stopPropagation()},className:xe(l,{[`${l}-spaced`]:!a,[`${l}-expanded`]:a&&s,[`${l}-collapsed`]:a&&!s}),"aria-label":s?i.collapse:i.expand,"aria-expanded":s})}}const GEt=aEe((i,e)=>{const{_renderTimes:t}=i,{_renderTimes:n}=e;return t!==n});function iC(i,e){return"key"in i&&i.key!==void 0&&i.key!==null?i.key:i.dataIndex?Array.isArray(i.dataIndex)?i.dataIndex.join("."):i.dataIndex:e}function WT(i,e){return e?`${e}-${i}`:`${i}`}function tB(i,e){return typeof i=="function"?i(e):i}function qEt(i,e){const t=tB(i,e);return Object.prototype.toString.call(t)==="[object Object]"?"":t}function lEe(i){if(i==null)throw new TypeError("Cannot destructure "+i)}var XEt=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],cEe=function(e,t){var n=e.className,r=e.style,o=e.motion,s=e.motionNodes,a=e.motionType,l=e.onMotionStart,c=e.onMotionEnd,u=e.active,d=e.treeNodeRequiredProps,h=Nn(e,XEt),f=C.useState(!0),g=Ae(f,2),p=g[0],v=g[1],m=C.useContext(wQ),_=m.prefixCls,y=C.useRef(!1),S=function(){y.current||c(),y.current=!0};return C.useEffect(function(){s&&a==="hide"&&p&&v(!1)},[s]),C.useEffect(function(){return s&&l(),function(){s&&S()}},[]),s?C.createElement(fd,St({ref:t,visible:p},o,{motionAppear:a==="show",onAppearEnd:S,onLeaveEnd:S}),function(L,E){var D=L.className,k=L.style;return C.createElement("div",{ref:E,className:xe("".concat(_,"-treenode-motion"),D),style:k},s.map(function(T){var M=St({},(lEe(T.data),T.data)),A=T.title,N=T.key,R=T.isStart,F=T.isEnd;delete M.children;var W=XE(N,d);return C.createElement(mS,St({},M,W,{title:A,active:u,data:T.data,key:N,isStart:R,isEnd:F}))}))}):C.createElement(mS,St({domRef:t,className:n,style:r},h,{active:u}))};cEe.displayName="MotionTreeNode";var YEt=C.forwardRef(cEe);function ZEt(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=i.length,n=e.length;if(Math.abs(t-n)!==1)return{add:!1,key:null};function r(o,s){var a=new Map;o.forEach(function(c){a.set(c,!0)});var l=s.filter(function(c){return!a.has(c)});return l.length===1?l[0]:null}return t ").concat(e);return e}var dEe=C.forwardRef(function(i,e){var t=i.prefixCls,n=i.data;i.selectable,i.checkable;var r=i.expandedKeys,o=i.selectedKeys,s=i.checkedKeys,a=i.loadedKeys,l=i.loadingKeys,c=i.halfCheckedKeys,u=i.keyEntities,d=i.disabled,h=i.dragging,f=i.dragOverNodeKey,g=i.dropPosition,p=i.motion,v=i.height,m=i.itemHeight,_=i.virtual,y=i.focusable,S=i.activeItem,L=i.focused,E=i.tabIndex,D=i.onKeyDown,k=i.onFocus,T=i.onBlur,M=i.onActiveChange,A=i.onListChangeStart,N=i.onListChangeEnd,R=Nn(i,QEt),F=C.useRef(null),W=C.useRef(null);C.useImperativeHandle(e,function(){return{scrollTo:function(le){F.current.scrollTo(le)},getIndentWidth:function(){return W.current.offsetWidth}}});var H=C.useState(r),G=Ae(H,2),U=G[0],K=G[1],re=C.useState(n),Y=Ae(re,2),J=Y[0],Q=Y[1],ue=C.useState(n),de=Ae(ue,2),_e=de[0],ve=de[1],Ve=C.useState([]),Ze=Ae(Ve,2),We=Ze[0],pe=Ze[1],Pe=C.useState(null),Se=Ae(Pe,2),Ne=Se[0],Me=Se[1],Qe=C.useRef(n);Qe.current=n;function Ke(){var ie=Qe.current;Q(ie),ve(ie),pe([]),Me(null),N()}C.useEffect(function(){K(r);var ie=ZEt(U,r);if(ie.key!==null)if(ie.add){var le=J.findIndex(function(he){var Le=he.key;return Le===ie.key}),ce=hde(cde(J,n,ie.key),_,v,m),z=J.slice();z.splice(le+1,0,dde),ve(z),pe(ce),Me("show")}else{var q=n.findIndex(function(he){var Le=he.key;return Le===ie.key}),oe=hde(cde(n,J,ie.key),_,v,m),ne=n.slice();ne.splice(q+1,0,dde),ve(ne),pe(oe),Me("hide")}else J!==n&&(Q(n),ve(n))},[r,n]),C.useEffect(function(){h||Ke()},[h]);var Re=p?_e:n,ct={expandedKeys:r,selectedKeys:o,loadedKeys:a,loadingKeys:l,checkedKeys:s,halfCheckedKeys:c,dragOverNodeKey:f,dropPosition:g,keyEntities:u};return C.createElement(C.Fragment,null,L&&S&&C.createElement("span",{style:ude,"aria-live":"assertive"},eDt(S)),C.createElement("div",null,C.createElement("input",{style:ude,disabled:y===!1||d,tabIndex:y!==!1?E:null,onKeyDown:D,onFocus:k,onBlur:T,value:"",onChange:JEt,"aria-label":"for screen reader"})),C.createElement("div",{className:"".concat(t,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},C.createElement("div",{className:"".concat(t,"-indent")},C.createElement("div",{ref:W,className:"".concat(t,"-indent-unit")}))),C.createElement(JZ,St({},R,{data:Re,itemKey:fde,height:v,fullHeight:!1,virtual:_,itemHeight:m,prefixCls:"".concat(t,"-list"),ref:F,onVisibleChange:function(le,ce){var z=new Set(le),q=ce.filter(function(oe){return!z.has(oe)});q.some(function(oe){return fde(oe)===rC})&&Ke()}}),function(ie){var le=ie.pos,ce=St({},(lEe(ie.data),ie.data)),z=ie.title,q=ie.key,oe=ie.isStart,ne=ie.isEnd,he=FT(q,le);delete ce.key,delete ce.children;var Le=XE(he,ct);return C.createElement(YEt,St({},ce,Le,{title:z,active:!!S&&q===S.key,pos:le,data:ie.data,isStart:oe,isEnd:ne,motion:p,motionNodes:q===rC?We:null,motionType:Ne,onMotionStart:A,onMotionEnd:Ke,treeNodeRequiredProps:ct,onMouseMove:function(){M(null)}}))}))});dEe.displayName="NodeList";function tDt(i){var e=i.dropPosition,t=i.dropLevelOffset,n=i.indent,r={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(e){case-1:r.top=0,r.left=-t*n;break;case 1:r.bottom=0,r.left=-t*n;break;case 0:r.bottom=0,r.left=n;break}return C.createElement("div",{style:r})}var nDt=10,AQ=function(i){kh(t,i);var e=Th(t);function t(){var n;vs(this,t);for(var r=arguments.length,o=new Array(r),s=0;s2&&arguments[2]!==void 0?arguments[2]:!1,d=n.state,h=d.dragChildrenKeys,f=d.dropPosition,g=d.dropTargetKey,p=d.dropTargetPos,v=d.dropAllowed;if(v){var m=n.props.onDrop;if(n.setState({dragOverNodeKey:null}),n.cleanDragState(),g!==null){var _=te(te({},XE(g,n.getTreeNodeRequiredProps())),{},{active:((c=n.getActiveItem())===null||c===void 0?void 0:c.key)===g,data:n.state.keyEntities[g].node}),y=h.indexOf(g)!==-1;ao(!y,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var S=SQ(p),L={event:a,node:ss(_),dragNode:n.dragNode?ss(n.dragNode.props):null,dragNodesKeys:[n.dragNode.props.eventKey].concat(h),dropToGap:f!==0,dropPosition:f+Number(S[S.length-1])};u||m==null||m(L),n.dragNode=null}}},n.cleanDragState=function(){var a=n.state.draggingNodeKey;a!==null&&n.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),n.dragStartMousePosition=null,n.currentMouseOverDroppableNodeKey=null},n.triggerExpandActionExpand=function(a,l){var c=n.state,u=c.expandedKeys,d=c.flattenNodes,h=l.expanded,f=l.key,g=l.isLeaf;if(!(g||a.shiftKey||a.metaKey||a.ctrlKey)){var p=d.filter(function(m){return m.key===f})[0],v=ss(te(te({},XE(f,n.getTreeNodeRequiredProps())),{},{data:p.data}));n.setExpandedKeys(h?Xh(u,f):Lg(u,f)),n.onNodeExpand(a,v)}},n.onNodeClick=function(a,l){var c=n.props,u=c.onClick,d=c.expandAction;d==="click"&&n.triggerExpandActionExpand(a,l),u==null||u(a,l)},n.onNodeDoubleClick=function(a,l){var c=n.props,u=c.onDoubleClick,d=c.expandAction;d==="doubleClick"&&n.triggerExpandActionExpand(a,l),u==null||u(a,l)},n.onNodeSelect=function(a,l){var c=n.state.selectedKeys,u=n.state,d=u.keyEntities,h=u.fieldNames,f=n.props,g=f.onSelect,p=f.multiple,v=l.selected,m=l[h.key],_=!v;_?p?c=Lg(c,m):c=[m]:c=Xh(c,m);var y=c.map(function(S){var L=d[S];return L?L.node:null}).filter(function(S){return S});n.setUncontrolledState({selectedKeys:c}),g==null||g(c,{event:"select",selected:_,node:l,selectedNodes:y,nativeEvent:a.nativeEvent})},n.onNodeCheck=function(a,l,c){var u=n.state,d=u.keyEntities,h=u.checkedKeys,f=u.halfCheckedKeys,g=n.props,p=g.checkStrictly,v=g.onCheck,m=l.key,_,y={event:"check",node:l,checked:c,nativeEvent:a.nativeEvent};if(p){var S=c?Lg(h,m):Xh(h,m),L=Xh(f,m);_={checked:S,halfChecked:L},y.checkedNodes=S.map(function(A){return d[A]}).filter(function(A){return A}).map(function(A){return A.node}),n.setUncontrolledState({checkedKeys:S})}else{var E=aw([].concat(ft(h),[m]),!0,d),D=E.checkedKeys,k=E.halfCheckedKeys;if(!c){var T=new Set(D);T.delete(m);var M=aw(Array.from(T),{checked:!1,halfCheckedKeys:k},d);D=M.checkedKeys,k=M.halfCheckedKeys}_=D,y.checkedNodes=[],y.checkedNodesPositions=[],y.halfCheckedKeys=k,D.forEach(function(A){var N=d[A];if(N){var R=N.node,F=N.pos;y.checkedNodes.push(R),y.checkedNodesPositions.push({node:R,pos:F})}}),n.setUncontrolledState({checkedKeys:D},!1,{halfCheckedKeys:k})}v==null||v(_,y)},n.onNodeLoad=function(a){var l=a.key,c=new Promise(function(u,d){n.setState(function(h){var f=h.loadedKeys,g=f===void 0?[]:f,p=h.loadingKeys,v=p===void 0?[]:p,m=n.props,_=m.loadData,y=m.onLoad;if(!_||g.indexOf(l)!==-1||v.indexOf(l)!==-1)return null;var S=_(a);return S.then(function(){var L=n.state.loadedKeys,E=Lg(L,l);y==null||y(E,{event:"load",node:a}),n.setUncontrolledState({loadedKeys:E}),n.setState(function(D){return{loadingKeys:Xh(D.loadingKeys,l)}}),u()}).catch(function(L){if(n.setState(function(D){return{loadingKeys:Xh(D.loadingKeys,l)}}),n.loadingRetryTimes[l]=(n.loadingRetryTimes[l]||0)+1,n.loadingRetryTimes[l]>=nDt){var E=n.state.loadedKeys;ao(!1,"Retry for `loadData` many times but still failed. No more retry."),n.setUncontrolledState({loadedKeys:Lg(E,l)}),u()}d(L)}),{loadingKeys:Lg(v,l)}})});return c.catch(function(){}),c},n.onNodeMouseEnter=function(a,l){var c=n.props.onMouseEnter;c==null||c({event:a,node:l})},n.onNodeMouseLeave=function(a,l){var c=n.props.onMouseLeave;c==null||c({event:a,node:l})},n.onNodeContextMenu=function(a,l){var c=n.props.onRightClick;c&&(a.preventDefault(),c({event:a,node:l}))},n.onFocus=function(){var a=n.props.onFocus;n.setState({focused:!0});for(var l=arguments.length,c=new Array(l),u=0;u1&&arguments[1]!==void 0?arguments[1]:!1,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!n.destroyed){var u=!1,d=!0,h={};Object.keys(a).forEach(function(f){if(f in n.props){d=!1;return}u=!0,h[f]=a[f]}),u&&(!l||d)&&n.setState(te(te({},h),c))}},n.scrollTo=function(a){n.listRef.current.scrollTo(a)},n}return _s(t,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var r=this.props.activeKey;r!==void 0&&r!==this.state.activeKey&&(this.setState({activeKey:r}),r!==null&&this.scrollTo({key:r}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var r,o=this.state,s=o.focused,a=o.flattenNodes,l=o.keyEntities,c=o.draggingNodeKey,u=o.activeKey,d=o.dropLevelOffset,h=o.dropContainerKey,f=o.dropTargetKey,g=o.dropPosition,p=o.dragOverNodeKey,v=o.indent,m=this.props,_=m.prefixCls,y=m.className,S=m.style,L=m.showLine,E=m.focusable,D=m.tabIndex,k=D===void 0?0:D,T=m.selectable,M=m.showIcon,A=m.icon,N=m.switcherIcon,R=m.draggable,F=m.checkable,W=m.checkStrictly,H=m.disabled,G=m.motion,U=m.loadData,K=m.filterTreeNode,re=m.height,Y=m.itemHeight,J=m.virtual,Q=m.titleRender,ue=m.dropIndicatorRender,de=m.onContextMenu,_e=m.onScroll,ve=m.direction,Ve=m.rootClassName,Ze=m.rootStyle,We=Bp(this.props,{aria:!0,data:!0}),pe;return R&&(zn(R)==="object"?pe=R:typeof R=="function"?pe={nodeDraggable:R}:pe={}),C.createElement(wQ.Provider,{value:{prefixCls:_,selectable:T,showIcon:M,icon:A,switcherIcon:N,draggable:pe,draggingNodeKey:c,checkable:F,checkStrictly:W,disabled:H,keyEntities:l,dropLevelOffset:d,dropContainerKey:h,dropTargetKey:f,dropPosition:g,dragOverNodeKey:p,indent:v,direction:ve,dropIndicatorRender:ue,loadData:U,filterTreeNode:K,titleRender:Q,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},C.createElement("div",{role:"tree",className:xe(_,y,Ve,(r={},be(r,"".concat(_,"-show-line"),L),be(r,"".concat(_,"-focused"),s),be(r,"".concat(_,"-active-focused"),u!==null),r)),style:Ze},C.createElement(dEe,St({ref:this.listRef,prefixCls:_,style:S,data:a,disabled:H,selectable:T,checkable:!!F,motion:G,dragging:c!==null,height:re,itemHeight:Y,virtual:J,focusable:E,focused:s,tabIndex:k,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:de,onScroll:_e},this.getTreeNodeRequiredProps(),We))))}}],[{key:"getDerivedStateFromProps",value:function(r,o){var s=o.prevProps,a={prevProps:r};function l(E){return!s&&E in r||s&&s[E]!==r[E]}var c,u=o.fieldNames;if(l("fieldNames")&&(u=rF(r.fieldNames),a.fieldNames=u),l("treeData")?c=r.treeData:l("children")&&(ao(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),c=xLe(r.children)),c){a.treeData=c;var d=xQ(c,{fieldNames:u});a.keyEntities=te(be({},rC,uEe),d.keyEntities)}var h=a.keyEntities||o.keyEntities;if(l("expandedKeys")||s&&l("autoExpandParent"))a.expandedKeys=r.autoExpandParent||!s&&r.defaultExpandParent?SK(r.expandedKeys,h):r.expandedKeys;else if(!s&&r.defaultExpandAll){var f=te({},h);delete f[rC],a.expandedKeys=Object.keys(f).map(function(E){return f[E].key})}else!s&&r.defaultExpandedKeys&&(a.expandedKeys=r.autoExpandParent||r.defaultExpandParent?SK(r.defaultExpandedKeys,h):r.defaultExpandedKeys);if(a.expandedKeys||delete a.expandedKeys,c||a.expandedKeys){var g=T7(c||o.treeData,a.expandedKeys||o.expandedKeys,u);a.flattenNodes=g}if(r.selectable&&(l("selectedKeys")?a.selectedKeys=Gue(r.selectedKeys,r):!s&&r.defaultSelectedKeys&&(a.selectedKeys=Gue(r.defaultSelectedKeys,r))),r.checkable){var p;if(l("checkedKeys")?p=k7(r.checkedKeys)||{}:!s&&r.defaultCheckedKeys?p=k7(r.defaultCheckedKeys)||{}:c&&(p=k7(r.checkedKeys)||{checkedKeys:o.checkedKeys,halfCheckedKeys:o.halfCheckedKeys}),p){var v=p,m=v.checkedKeys,_=m===void 0?[]:m,y=v.halfCheckedKeys,S=y===void 0?[]:y;if(!r.checkStrictly){var L=aw(_,!0,h);_=L.checkedKeys,S=L.halfCheckedKeys}a.checkedKeys=_,a.halfCheckedKeys=S}}return l("loadedKeys")&&(a.loadedKeys=r.loadedKeys),a}}]),t}(C.Component);AQ.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:tDt,allowDrop:function(){return!0},expandAction:!1};AQ.TreeNode=mS;const iDt=new mi("ant-tree-node-fx-do-not-use",{"0%":{opacity:0},"100%":{opacity:1}}),rDt=(i,e)=>({[`.${i}-switcher-icon`]:{display:"inline-block",fontSize:10,verticalAlign:"baseline",svg:{transition:`transform ${e.motionDurationSlow}`}}}),oDt=(i,e)=>({[`.${i}-drop-indicator`]:{position:"absolute",zIndex:1,height:2,backgroundColor:e.colorPrimary,borderRadius:1,pointerEvents:"none","&:after":{position:"absolute",top:-3,insetInlineStart:-6,width:8,height:8,backgroundColor:"transparent",border:`${e.lineWidthBold}px solid ${e.colorPrimary}`,borderRadius:"50%",content:'""'}}}),sDt=(i,e)=>{const{treeCls:t,treeNodeCls:n,treeNodePadding:r,treeTitleHeight:o}=e,s=(o-e.fontSizeLG)/2,a=e.paddingXS;return{[t]:Object.assign(Object.assign({},Wr(e)),{background:e.colorBgContainer,borderRadius:e.borderRadius,transition:`background-color ${e.motionDurationSlow}`,[`&${t}-rtl`]:{[`${t}-switcher`]:{"&_close":{[`${t}-switcher-icon`]:{svg:{transform:"rotate(90deg)"}}}}},[`&-focused:not(:hover):not(${t}-active-focused)`]:Object.assign({},Op(e)),[`${t}-list-holder-inner`]:{alignItems:"flex-start"},[`&${t}-block-node`]:{[`${t}-list-holder-inner`]:{alignItems:"stretch",[`${t}-node-content-wrapper`]:{flex:"auto"},[`${n}.dragging`]:{position:"relative","&:after":{position:"absolute",top:0,insetInlineEnd:0,bottom:r,insetInlineStart:0,border:`1px solid ${e.colorPrimary}`,opacity:0,animationName:iDt,animationDuration:e.motionDurationSlow,animationPlayState:"running",animationFillMode:"forwards",content:'""',pointerEvents:"none"}}}},[`${n}`]:{display:"flex",alignItems:"flex-start",padding:`0 0 ${r}px 0`,outline:"none","&-rtl":{direction:"rtl"},"&-disabled":{[`${t}-node-content-wrapper`]:{color:e.colorTextDisabled,cursor:"not-allowed","&:hover":{background:"transparent"}}},[`&-active ${t}-node-content-wrapper`]:Object.assign({},Op(e)),[`&:not(${n}-disabled).filter-node ${t}-title`]:{color:"inherit",fontWeight:500},"&-draggable":{[`${t}-draggable-icon`]:{width:o,lineHeight:`${o}px`,textAlign:"center",visibility:"visible",opacity:.2,transition:`opacity ${e.motionDurationSlow}`,[`${n}:hover &`]:{opacity:.45}},[`&${n}-disabled`]:{[`${t}-draggable-icon`]:{visibility:"hidden"}}}},[`${t}-indent`]:{alignSelf:"stretch",whiteSpace:"nowrap",userSelect:"none","&-unit":{display:"inline-block",width:o}},[`${t}-draggable-icon`]:{visibility:"hidden"},[`${t}-switcher`]:Object.assign(Object.assign({},rDt(i,e)),{position:"relative",flex:"none",alignSelf:"stretch",width:o,margin:0,lineHeight:`${o}px`,textAlign:"center",cursor:"pointer",userSelect:"none","&-noop":{cursor:"default"},"&_close":{[`${t}-switcher-icon`]:{svg:{transform:"rotate(-90deg)"}}},"&-loading-icon":{color:e.colorPrimary},"&-leaf-line":{position:"relative",zIndex:1,display:"inline-block",width:"100%",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:o/2,bottom:-r,marginInlineStart:-1,borderInlineEnd:`1px solid ${e.colorBorder}`,content:'""'},"&:after":{position:"absolute",width:o/2*.8,height:o/2,borderBottom:`1px solid ${e.colorBorder}`,content:'""'}}}),[`${t}-checkbox`]:{top:"initial",marginInlineEnd:a,marginBlockStart:s},[`${t}-node-content-wrapper, ${t}-checkbox + span`]:{position:"relative",zIndex:"auto",minHeight:o,margin:0,padding:`0 ${e.paddingXS/2}px`,color:"inherit",lineHeight:`${o}px`,background:"transparent",borderRadius:e.borderRadius,cursor:"pointer",transition:`all ${e.motionDurationMid}, border 0s, line-height 0s, box-shadow 0s`,"&:hover":{backgroundColor:e.controlItemBgHover},[`&${t}-node-selected`]:{backgroundColor:e.controlItemBgActive},[`${t}-iconEle`]:{display:"inline-block",width:o,height:o,lineHeight:`${o}px`,textAlign:"center",verticalAlign:"top","&:empty":{display:"none"}}},[`${t}-unselectable ${t}-node-content-wrapper:hover`]:{backgroundColor:"transparent"},[`${t}-node-content-wrapper`]:Object.assign({lineHeight:`${o}px`,userSelect:"none"},oDt(i,e)),[`${n}.drop-container`]:{"> [draggable]":{boxShadow:`0 0 0 2px ${e.colorPrimary}`}},"&-show-line":{[`${t}-indent`]:{"&-unit":{position:"relative",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:o/2,bottom:-r,borderInlineEnd:`1px solid ${e.colorBorder}`,content:'""'},"&-end":{"&:before":{display:"none"}}}},[`${t}-switcher`]:{background:"transparent","&-line-icon":{verticalAlign:"-0.15em"}}},[`${n}-leaf-last`]:{[`${t}-switcher`]:{"&-leaf-line":{"&:before":{top:"auto !important",bottom:"auto !important",height:`${o/2}px !important`}}}}})}},aDt=i=>{const{treeCls:e,treeNodeCls:t,treeNodePadding:n}=i;return{[`${e}${e}-directory`]:{[t]:{position:"relative","&:before":{position:"absolute",top:0,insetInlineEnd:0,bottom:n,insetInlineStart:0,transition:`background-color ${i.motionDurationMid}`,content:'""',pointerEvents:"none"},"&:hover":{"&:before":{background:i.controlItemBgHover}},"> *":{zIndex:1},[`${e}-switcher`]:{transition:`color ${i.motionDurationMid}`},[`${e}-node-content-wrapper`]:{borderRadius:0,userSelect:"none","&:hover":{background:"transparent"},[`&${e}-node-selected`]:{color:i.colorTextLightSolid,background:"transparent"}},"&-selected":{[` + `]:{display:"inline-block",minWidth:i.paginationItemSize,height:i.paginationItemSize,color:i.colorText,fontFamily:i.paginationFontFamily,lineHeight:`${i.paginationItemSize}px`,textAlign:"center",verticalAlign:"middle",listStyle:"none",borderRadius:i.borderRadius,cursor:"pointer",transition:`all ${i.motionDurationMid}`},[`${e}-prev, ${e}-next`]:{fontFamily:"Arial, Helvetica, sans-serif",outline:0,button:{color:i.colorText,cursor:"pointer",userSelect:"none"},[`${e}-item-link`]:{display:"block",width:"100%",height:"100%",padding:0,fontSize:i.fontSizeSM,textAlign:"center",backgroundColor:"transparent",border:`${i.lineWidth}px ${i.lineType} transparent`,borderRadius:i.borderRadius,outline:"none",transition:`border ${i.motionDurationMid}`},[`&:focus-visible ${e}-item-link`]:Object.assign({},Fp(i)),[`&:hover ${e}-item-link`]:{backgroundColor:i.colorBgTextHover},[`&:active ${e}-item-link`]:{backgroundColor:i.colorBgTextActive},[`&${e}-disabled:hover`]:{[`${e}-item-link`]:{backgroundColor:"transparent"}}},[`${e}-slash`]:{marginInlineEnd:i.paginationSlashMarginInlineEnd,marginInlineStart:i.paginationSlashMarginInlineStart},[`${e}-options`]:{display:"inline-block",marginInlineStart:i.margin,verticalAlign:"middle","&-size-changer.-select":{display:"inline-block",width:"auto"},"&-quick-jumper":{display:"inline-block",height:i.controlHeight,marginInlineStart:i.marginXS,lineHeight:`${i.controlHeight}px`,verticalAlign:"top",input:Object.assign(Object.assign({},OT(i)),{width:i.controlHeightLG*1.25,height:i.controlHeight,boxSizing:"border-box",margin:0,marginInlineStart:i.marginXS,marginInlineEnd:i.marginXS})}}}},Kxt=i=>{const{componentCls:e}=i;return{[`${e}-item`]:Object.assign(Object.assign({display:"inline-block",minWidth:i.paginationItemSize,height:i.paginationItemSize,marginInlineEnd:i.marginXS,fontFamily:i.paginationFontFamily,lineHeight:`${i.paginationItemSize-2}px`,textAlign:"center",verticalAlign:"middle",listStyle:"none",backgroundColor:"transparent",border:`${i.lineWidth}px ${i.lineType} transparent`,borderRadius:i.borderRadius,outline:0,cursor:"pointer",userSelect:"none",a:{display:"block",padding:`0 ${i.paginationItemPaddingInline}px`,color:i.colorText,transition:"none","&:hover":{textDecoration:"none"}},[`&:not(${e}-item-active)`]:{"&:hover":{transition:`all ${i.motionDurationMid}`,backgroundColor:i.colorBgTextHover},"&:active":{backgroundColor:i.colorBgTextActive}}},lk(i)),{"&-active":{fontWeight:i.paginationFontWeightActive,backgroundColor:i.paginationItemBgActive,borderColor:i.colorPrimary,a:{color:i.colorPrimary},"&:hover":{borderColor:i.colorPrimaryHover},"&:hover a":{color:i.colorPrimaryHover}}})}},Gxt=i=>{const{componentCls:e}=i;return{[e]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Wr(i)),{"ul, ol":{margin:0,padding:0,listStyle:"none"},"&::after":{display:"block",clear:"both",height:0,overflow:"hidden",visibility:"hidden",content:'""'},[`${e}-total-text`]:{display:"inline-block",height:i.paginationItemSize,marginInlineEnd:i.marginXS,lineHeight:`${i.paginationItemSize-2}px`,verticalAlign:"middle"}}),Kxt(i)),jxt(i)),Uxt(i)),zxt(i)),Vxt(i)),{[`@media only screen and (max-width: ${i.screenLG}px)`]:{[`${e}-item`]:{"&-after-jump-prev, &-before-jump-next":{display:"none"}}},[`@media only screen and (max-width: ${i.screenSM}px)`]:{[`${e}-options`]:{display:"none"}}}),[`&${i.componentCls}-rtl`]:{direction:"rtl"}}},qxt=i=>{const{componentCls:e}=i;return{[`${e}${e}-disabled`]:{"&, &:hover":{[`${e}-item-link`]:{borderColor:i.colorBorder}},"&:focus-visible":{[`${e}-item-link`]:{borderColor:i.colorBorder}},[`${e}-item, ${e}-item-link`]:{backgroundColor:i.colorBgContainerDisabled,borderColor:i.colorBorder,[`&:hover:not(${e}-item-active)`]:{backgroundColor:i.colorBgContainerDisabled,borderColor:i.colorBorder,a:{color:i.colorTextDisabled}},[`&${e}-item-active`]:{backgroundColor:i.paginationItemDisabledBgActive}},[`${e}-prev, ${e}-next`]:{"&:hover button":{backgroundColor:i.colorBgContainerDisabled,borderColor:i.colorBorder,color:i.colorTextDisabled},[`${e}-item-link`]:{backgroundColor:i.colorBgContainerDisabled,borderColor:i.colorBorder}}},[e]:{[`${e}-prev, ${e}-next`]:{"&:hover button":{borderColor:i.colorPrimaryHover,backgroundColor:i.paginationItemBg},[`${e}-item-link`]:{backgroundColor:i.paginationItemLinkBg,borderColor:i.colorBorder},[`&:hover ${e}-item-link`]:{borderColor:i.colorPrimary,backgroundColor:i.paginationItemBg,color:i.colorPrimary},[`&${e}-disabled`]:{[`${e}-item-link`]:{borderColor:i.colorBorder,color:i.colorTextDisabled}}},[`${e}-item`]:{backgroundColor:i.paginationItemBg,border:`${i.lineWidth}px ${i.lineType} ${i.colorBorder}`,[`&:hover:not(${e}-item-active)`]:{borderColor:i.colorPrimary,backgroundColor:i.paginationItemBg,a:{color:i.colorPrimary}},"&-active":{borderColor:i.colorPrimary}}}}},Xxt=vo("Pagination",i=>{const e=Oi(i,{paginationItemSize:i.controlHeight,paginationFontFamily:i.fontFamily,paginationItemBg:i.colorBgContainer,paginationItemBgActive:i.colorBgContainer,paginationFontWeightActive:i.fontWeightStrong,paginationItemSizeSM:i.controlHeightSM,paginationItemInputBg:i.colorBgContainer,paginationMiniOptionsSizeChangerTop:0,paginationItemDisabledBgActive:i.controlItemBgActiveDisabled,paginationItemDisabledColorActive:i.colorTextDisabled,paginationItemLinkBg:i.colorBgContainer,inputOutlineOffset:"0 0",paginationMiniOptionsMarginInlineStart:i.marginXXS/2,paginationMiniQuickJumperInputWidth:i.controlHeightLG*1.1,paginationItemPaddingInline:i.marginXXS*1.5,paginationEllipsisLetterSpacing:i.marginXXS/2,paginationSlashMarginInlineStart:i.marginXXS,paginationSlashMarginInlineEnd:i.marginSM,paginationEllipsisTextIndent:"0.13em"},CQ(i));return[Gxt(e),i.wireframe&&qxt(e)]});var Yxt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var{prefixCls:e,selectPrefixCls:t,className:n,rootClassName:r,size:o,locale:s,selectComponentClass:a,responsive:l,showSizeChanger:c}=i,u=Yxt(i,["prefixCls","selectPrefixCls","className","rootClassName","size","locale","selectComponentClass","responsive","showSizeChanger"]);const{xs:d}=B5(l),{getPrefixCls:h,direction:f,pagination:g={}}=C.useContext(Rn),p=h("pagination",e),[v,m]=Xxt(p),_=c??g.showSizeChanger,y=C.useMemo(()=>{const T=C.createElement("span",{className:`${p}-item-ellipsis`},"•••"),M=C.createElement("button",{className:`${p}-item-link`,type:"button",tabIndex:-1},f==="rtl"?C.createElement(Dj,null):C.createElement(ice,null)),A=C.createElement("button",{className:`${p}-item-link`,type:"button",tabIndex:-1},f==="rtl"?C.createElement(ice,null):C.createElement(Dj,null)),N=C.createElement("a",{className:`${p}-item-link`},C.createElement("div",{className:`${p}-item-container`},f==="rtl"?C.createElement(nce,{className:`${p}-item-link-icon`}):C.createElement(tce,{className:`${p}-item-link-icon`}),T)),R=C.createElement("a",{className:`${p}-item-link`},C.createElement("div",{className:`${p}-item-container`},f==="rtl"?C.createElement(tce,{className:`${p}-item-link-icon`}):C.createElement(nce,{className:`${p}-item-link-icon`}),T));return{prevIcon:M,nextIcon:A,jumpPrevIcon:N,jumpNextIcon:R}},[f,p]),[S]=ST("Pagination",Qwe),L=Object.assign(Object.assign({},S),s),E=o==="small"||!!(d&&!o&&l),D=h("select",t),k=xe({[`${p}-mini`]:E,[`${p}-rtl`]:f==="rtl"},n,r,m);return v(C.createElement(BLe,Object.assign({},y,u,{prefixCls:p,selectPrefixCls:D,className:k,selectComponentClass:a||(E?WLe:$Le),locale:L,showSizeChanger:_})))},kQ=Zxt,Qxt=new mi("antSpinMove",{to:{opacity:1}}),Jxt=new mi("antRotate",{to:{transform:"rotate(405deg)"}}),eLt=i=>({[`${i.componentCls}`]:Object.assign(Object.assign({},Wr(i)),{position:"absolute",display:"none",color:i.colorPrimary,textAlign:"center",verticalAlign:"middle",opacity:0,transition:`transform ${i.motionDurationSlow} ${i.motionEaseInOutCirc}`,"&-spinning":{position:"static",display:"inline-block",opacity:1},"&-nested-loading":{position:"relative",[`> div > ${i.componentCls}`]:{position:"absolute",top:0,insetInlineStart:0,zIndex:4,display:"block",width:"100%",height:"100%",maxHeight:i.contentHeight,[`${i.componentCls}-dot`]:{position:"absolute",top:"50%",insetInlineStart:"50%",margin:-i.spinDotSize/2},[`${i.componentCls}-text`]:{position:"absolute",top:"50%",width:"100%",paddingTop:(i.spinDotSize-i.fontSize)/2+2,textShadow:`0 1px 2px ${i.colorBgContainer}`},[`&${i.componentCls}-show-text ${i.componentCls}-dot`]:{marginTop:-(i.spinDotSize/2)-10},"&-sm":{[`${i.componentCls}-dot`]:{margin:-i.spinDotSizeSM/2},[`${i.componentCls}-text`]:{paddingTop:(i.spinDotSizeSM-i.fontSize)/2+2},[`&${i.componentCls}-show-text ${i.componentCls}-dot`]:{marginTop:-(i.spinDotSizeSM/2)-10}},"&-lg":{[`${i.componentCls}-dot`]:{margin:-(i.spinDotSizeLG/2)},[`${i.componentCls}-text`]:{paddingTop:(i.spinDotSizeLG-i.fontSize)/2+2},[`&${i.componentCls}-show-text ${i.componentCls}-dot`]:{marginTop:-(i.spinDotSizeLG/2)-10}}},[`${i.componentCls}-container`]:{position:"relative",transition:`opacity ${i.motionDurationSlow}`,"&::after":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:"100%",height:"100%",background:i.colorBgContainer,opacity:0,transition:`all ${i.motionDurationSlow}`,content:'""',pointerEvents:"none"}},[`${i.componentCls}-blur`]:{clear:"both",opacity:.5,userSelect:"none",pointerEvents:"none",["&::after"]:{opacity:.4,pointerEvents:"auto"}}},["&-tip"]:{color:i.spinDotDefault},[`${i.componentCls}-dot`]:{position:"relative",display:"inline-block",fontSize:i.spinDotSize,width:"1em",height:"1em","&-item":{position:"absolute",display:"block",width:(i.spinDotSize-i.marginXXS/2)/2,height:(i.spinDotSize-i.marginXXS/2)/2,backgroundColor:i.colorPrimary,borderRadius:"100%",transform:"scale(0.75)",transformOrigin:"50% 50%",opacity:.3,animationName:Qxt,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"alternate","&:nth-child(1)":{top:0,insetInlineStart:0},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:"0.4s"},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:"0.8s"},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:"1.2s"}},"&-spin":{transform:"rotate(45deg)",animationName:Jxt,animationDuration:"1.2s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},[`&-sm ${i.componentCls}-dot`]:{fontSize:i.spinDotSizeSM,i:{width:(i.spinDotSizeSM-i.marginXXS/2)/2,height:(i.spinDotSizeSM-i.marginXXS/2)/2}},[`&-lg ${i.componentCls}-dot`]:{fontSize:i.spinDotSizeLG,i:{width:(i.spinDotSizeLG-i.marginXXS)/2,height:(i.spinDotSizeLG-i.marginXXS)/2}},[`&${i.componentCls}-show-text ${i.componentCls}-text`]:{display:"block"}})}),tLt=vo("Spin",i=>{const e=Oi(i,{spinDotDefault:i.colorTextDescription,spinDotSize:i.controlHeightLG/2,spinDotSizeSM:i.controlHeightLG*.35,spinDotSizeLG:i.controlHeight});return[eLt(e)]},{contentHeight:400});var nLt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{spinPrefixCls:e,spinning:t=!0,delay:n=0,className:r,rootClassName:o,size:s="default",tip:a,wrapperClassName:l,style:c,children:u,hashId:d}=i,h=nLt(i,["spinPrefixCls","spinning","delay","className","rootClassName","size","tip","wrapperClassName","style","children","hashId"]),[f,g]=C.useState(()=>t&&!rLt(t,n));C.useEffect(()=>{if(t){const L=hSt(n,()=>{g(!0)});return L(),()=>{var E;(E=L==null?void 0:L.cancel)===null||E===void 0||E.call(L)}}g(!1)},[n,t]);const p=C.useMemo(()=>typeof u<"u",[u]),{direction:v}=C.useContext(Rn),m=xe(e,{[`${e}-sm`]:s==="small",[`${e}-lg`]:s==="large",[`${e}-spinning`]:f,[`${e}-show-text`]:!!a,[`${e}-rtl`]:v==="rtl"},r,o,d),_=xe(`${e}-container`,{[`${e}-blur`]:f}),y=ll(h,["indicator","prefixCls"]),S=C.createElement("div",Object.assign({},y,{style:c,className:m,"aria-live":"polite","aria-busy":f}),iLt(e,i),a?C.createElement("div",{className:`${e}-text`},a):null);return p?C.createElement("div",Object.assign({},y,{className:xe(`${e}-nested-loading`,l,d)}),f&&C.createElement("div",{key:"loading"},S),C.createElement("div",{className:_,key:"container"},u)):S},HLe=i=>{const{prefixCls:e}=i,{getPrefixCls:t}=C.useContext(Rn),n=t("spin",e),[r,o]=tLt(n),s=Object.assign(Object.assign({},i),{spinPrefixCls:n,hashId:o});return r(C.createElement(oLt,Object.assign({},s)))};HLe.setDefaultIndicator=i=>{eA=i};const VLe=HLe;function zLe(){const i=Object.assign({},arguments.length<=0?void 0:arguments[0]);for(let e=1;e{const r=t[n];r!==void 0&&(i[n]=r)})}return i}var ULe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var{prefixCls:e,className:t,avatar:n,title:r,description:o}=i,s=ULe(i,["prefixCls","className","avatar","title","description"]);const{getPrefixCls:a}=C.useContext(Rn),l=a("list",e),c=xe(`${l}-item-meta`,t),u=$e.createElement("div",{className:`${l}-item-meta-content`},r&&$e.createElement("h4",{className:`${l}-item-meta-title`},r),o&&$e.createElement("div",{className:`${l}-item-meta-description`},o));return $e.createElement("div",Object.assign({},s,{className:c}),n&&$e.createElement("div",{className:`${l}-item-meta-avatar`},n),(r||o)&&u)},aLt=(i,e)=>{var{prefixCls:t,children:n,actions:r,extra:o,className:s,colStyle:a}=i,l=ULe(i,["prefixCls","children","actions","extra","className","colStyle"]);const{grid:c,itemLayout:u}=C.useContext(TQ),{getPrefixCls:d}=C.useContext(Rn),h=()=>{let _;return C.Children.forEach(n,y=>{typeof y=="string"&&(_=!0)}),_&&C.Children.count(n)>1},f=()=>u==="vertical"?!!o:!h(),g=d("list",t),p=r&&r.length>0&&$e.createElement("ul",{className:`${g}-item-action`,key:"actions"},r.map((_,y)=>$e.createElement("li",{key:`${g}-item-action-${y}`},_,y!==r.length-1&&$e.createElement("em",{className:`${g}-item-action-split`})))),v=c?"div":"li",m=$e.createElement(v,Object.assign({},l,c?{}:{ref:e},{className:xe(`${g}-item`,{[`${g}-item-no-flex`]:!f()},s)}),u==="vertical"&&o?[$e.createElement("div",{className:`${g}-item-main`,key:"content"},n,p),$e.createElement("div",{className:`${g}-item-extra`,key:"extra"},o)]:[n,p,Qs(o,{key:"extra"})]);return c?$e.createElement(GSt,{ref:e,flex:1,style:a},m):m},jLe=C.forwardRef(aLt);jLe.Meta=sLt;const lLt=jLe,cLt=i=>{const{listBorderedCls:e,componentCls:t,paddingLG:n,margin:r,padding:o,listItemPaddingSM:s,marginLG:a,borderRadiusLG:l}=i;return{[`${e}`]:{border:`${i.lineWidth}px ${i.lineType} ${i.colorBorder}`,borderRadius:l,[`${t}-header,${t}-footer,${t}-item`]:{paddingInline:n},[`${t}-pagination`]:{margin:`${r}px ${a}px`}},[`${e}${t}-sm`]:{[`${t}-item,${t}-header,${t}-footer`]:{padding:s}},[`${e}${t}-lg`]:{[`${t}-item,${t}-header,${t}-footer`]:{padding:`${o}px ${n}px`}}}},uLt=i=>{const{componentCls:e,screenSM:t,screenMD:n,marginLG:r,marginSM:o,margin:s}=i;return{[`@media screen and (max-width:${n})`]:{[`${e}`]:{[`${e}-item`]:{[`${e}-item-action`]:{marginInlineStart:r}}},[`${e}-vertical`]:{[`${e}-item`]:{[`${e}-item-extra`]:{marginInlineStart:r}}}},[`@media screen and (max-width: ${t})`]:{[`${e}`]:{[`${e}-item`]:{flexWrap:"wrap",[`${e}-action`]:{marginInlineStart:o}}},[`${e}-vertical`]:{[`${e}-item`]:{flexWrap:"wrap-reverse",[`${e}-item-main`]:{minWidth:i.contentWidth},[`${e}-item-extra`]:{margin:`auto auto ${s}px`}}}}}},dLt=i=>{const{componentCls:e,antCls:t,controlHeight:n,minHeight:r,paddingSM:o,marginLG:s,padding:a,listItemPadding:l,colorPrimary:c,listItemPaddingSM:u,listItemPaddingLG:d,paddingXS:h,margin:f,colorText:g,colorTextDescription:p,motionDurationSlow:v,lineWidth:m}=i,_={};return["start","center","end"].forEach(y=>{_[`&-align-${y}`]={textAlign:y}}),{[`${e}`]:Object.assign(Object.assign({},Wr(i)),{position:"relative","*":{outline:"none"},[`${e}-header, ${e}-footer`]:{background:"transparent",paddingBlock:o},[`${e}-pagination`]:Object.assign(Object.assign({marginBlockStart:s},_),{[`${t}-pagination-options`]:{textAlign:"start"}}),[`${e}-spin`]:{minHeight:r,textAlign:"center"},[`${e}-items`]:{margin:0,padding:0,listStyle:"none"},[`${e}-item`]:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:l,color:g,[`${e}-item-meta`]:{display:"flex",flex:1,alignItems:"flex-start",maxWidth:"100%",[`${e}-item-meta-avatar`]:{marginInlineEnd:a},[`${e}-item-meta-content`]:{flex:"1 0",width:0,color:g},[`${e}-item-meta-title`]:{margin:`0 0 ${i.marginXXS}px 0`,color:g,fontSize:i.fontSize,lineHeight:i.lineHeight,"> a":{color:g,transition:`all ${v}`,["&:hover"]:{color:c}}},[`${e}-item-meta-description`]:{color:p,fontSize:i.fontSize,lineHeight:i.lineHeight}},[`${e}-item-action`]:{flex:"0 0 auto",marginInlineStart:i.marginXXL,padding:0,fontSize:0,listStyle:"none",["& > li"]:{position:"relative",display:"inline-block",padding:`0 ${h}px`,color:p,fontSize:i.fontSize,lineHeight:i.lineHeight,textAlign:"center",["&:first-child"]:{paddingInlineStart:0}},[`${e}-item-action-split`]:{position:"absolute",insetBlockStart:"50%",insetInlineEnd:0,width:m,height:Math.ceil(i.fontSize*i.lineHeight)-i.marginXXS*2,transform:"translateY(-50%)",backgroundColor:i.colorSplit}}},[`${e}-empty`]:{padding:`${a}px 0`,color:p,fontSize:i.fontSizeSM,textAlign:"center"},[`${e}-empty-text`]:{padding:a,color:i.colorTextDisabled,fontSize:i.fontSize,textAlign:"center"},[`${e}-item-no-flex`]:{display:"block"}}),[`${e}-grid ${t}-col > ${e}-item`]:{display:"block",maxWidth:"100%",marginBlockEnd:f,paddingBlock:0,borderBlockEnd:"none"},[`${e}-vertical ${e}-item`]:{alignItems:"initial",[`${e}-item-main`]:{display:"block",flex:1},[`${e}-item-extra`]:{marginInlineStart:s},[`${e}-item-meta`]:{marginBlockEnd:a,[`${e}-item-meta-title`]:{marginBlockStart:0,marginBlockEnd:o,color:g,fontSize:i.fontSizeLG,lineHeight:i.lineHeightLG}},[`${e}-item-action`]:{marginBlockStart:a,marginInlineStart:"auto","> li":{padding:`0 ${a}px`,["&:first-child"]:{paddingInlineStart:0}}}},[`${e}-split ${e}-item`]:{borderBlockEnd:`${i.lineWidth}px ${i.lineType} ${i.colorSplit}`,["&:last-child"]:{borderBlockEnd:"none"}},[`${e}-split ${e}-header`]:{borderBlockEnd:`${i.lineWidth}px ${i.lineType} ${i.colorSplit}`},[`${e}-split${e}-empty ${e}-footer`]:{borderTop:`${i.lineWidth}px ${i.lineType} ${i.colorSplit}`},[`${e}-loading ${e}-spin-nested-loading`]:{minHeight:n},[`${e}-split${e}-something-after-last-item ${t}-spin-container > ${e}-items > ${e}-item:last-child`]:{borderBlockEnd:`${i.lineWidth}px ${i.lineType} ${i.colorSplit}`},[`${e}-lg ${e}-item`]:{padding:d},[`${e}-sm ${e}-item`]:{padding:u},[`${e}:not(${e}-vertical)`]:{[`${e}-item-no-flex`]:{[`${e}-item-action`]:{float:"right"}}}}},hLt=vo("List",i=>{const e=Oi(i,{listBorderedCls:`${i.componentCls}-bordered`,minHeight:i.controlHeightLG,listItemPadding:`${i.paddingContentVertical}px 0`,listItemPaddingSM:`${i.paddingContentVerticalSM}px ${i.paddingContentHorizontal}px`,listItemPaddingLG:`${i.paddingContentVerticalLG}px ${i.paddingContentHorizontalLG}px`});return[dLt(e),cLt(e),uLt(e)]},{contentWidth:220});var fLt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r(Re,ct)=>{D(Re),T(ct),t&&t[Ke]&&t[Ke](Re,ct)},W=F("onChange"),H=F("onShowSizeChange"),G=(Ke,Re)=>{if(!_)return null;let ct;return typeof m=="function"?ct=m(Ke):m?ct=Ke[m]:ct=Ke.key,ct||(ct=`list-item-${Re}`),C.createElement(C.Fragment,{key:ct},_(Ke,Re))},U=()=>!!(u||t||p),K=M("list",n),[re,Y]=hLt(K);let J=v;typeof J=="boolean"&&(J={spinning:J});const Q=J&&J.spinning;let ue="";switch(f){case"large":ue="lg";break;case"small":ue="sm";break}const de=xe(K,{[`${K}-vertical`]:c==="vertical",[`${K}-${ue}`]:ue,[`${K}-split`]:o,[`${K}-bordered`]:r,[`${K}-loading`]:Q,[`${K}-grid`]:!!d,[`${K}-something-after-last-item`]:U(),[`${K}-rtl`]:N==="rtl"},s,a,Y),_e=zLe(R,{total:h.length,current:E,pageSize:k},t||{}),ve=Math.ceil(_e.total/_e.pageSize);_e.current>ve&&(_e.current=ve);const Ve=t?C.createElement("div",{className:xe(`${K}-pagination`,`${K}-pagination-align-${(e=_e==null?void 0:_e.align)!==null&&e!==void 0?e:"end"}`)},C.createElement(kQ,Object.assign({},_e,{onChange:W,onShowSizeChange:H}))):null;let Ze=ft(h);t&&h.length>(_e.current-1)*_e.pageSize&&(Ze=ft(h).splice((_e.current-1)*_e.pageSize,_e.pageSize));const We=Object.keys(d||{}).some(Ke=>["xs","sm","md","lg","xl","xxl"].includes(Ke)),pe=B5(We),Pe=C.useMemo(()=>{for(let Ke=0;Ke{if(!d)return;const Ke=Pe&&d[Pe]?d[Pe]:d.column;if(Ke)return{width:`${100/Ke}%`,maxWidth:`${100/Ke}%`}},[d==null?void 0:d.column,Pe]);let Ne=Q&&C.createElement("div",{style:{minHeight:53}});if(Ze.length>0){const Ke=Ze.map((Re,ct)=>G(Re,ct));Ne=d?C.createElement(YSt,{gutter:d.gutter},C.Children.map(Ke,Re=>C.createElement("div",{key:Re==null?void 0:Re.key,style:Se},Re))):C.createElement("ul",{className:`${K}-items`},Ke)}else!l&&!Q&&(Ne=C.createElement("div",{className:`${K}-empty-text`},y&&y.emptyText||(A==null?void 0:A("List"))||C.createElement(nQ,{componentName:"List"})));const Me=_e.position||"bottom",Qe=C.useMemo(()=>({grid:d,itemLayout:c}),[JSON.stringify(d),c]);return re(C.createElement(TQ.Provider,{value:Qe},C.createElement("div",Object.assign({className:de},S),(Me==="top"||Me==="both")&&Ve,g&&C.createElement("div",{className:`${K}-header`},g),C.createElement(VLe,Object.assign({},J),Ne,l),p&&C.createElement("div",{className:`${K}-footer`},p),u||(Me==="bottom"||Me==="both")&&Ve)))}tA.Item=lLt;let Ou=null,Q0=i=>i(),gk=[],sF={};function gLt(){const{prefixCls:i,getContainer:e,duration:t,rtl:n,maxCount:r,top:o}=sF,s=i??FZ().getPrefixCls("message"),a=(e==null?void 0:e())||document.body;return{prefixCls:s,container:a,duration:t,rtl:n,maxCount:r,top:o}}const pLt=C.forwardRef((i,e)=>{const t=()=>{const{prefixCls:d,container:h,maxCount:f,duration:g,rtl:p,top:v}=gLt();return{prefixCls:d,getContainer:()=>h,maxCount:f,duration:g,rtl:p,top:v}},[n,r]=C.useState(t),[o,s]=SSe(n),a=FZ(),l=a.getRootPrefixCls(),c=a.getIconPrefixCls(),u=()=>{r(t)};return C.useEffect(u,[]),C.useImperativeHandle(e,()=>{const d=Object.assign({},o);return Object.keys(d).forEach(h=>{d[h]=function(){return u(),o[h].apply(o,arguments)}}),{instance:d,sync:u}}),C.createElement(LT,{prefixCls:l,iconPrefixCls:c},s)});function q5(){if(!Ou){const i=document.createDocumentFragment(),e={fragment:i};Ou=e,Q0(()=>{HZ(C.createElement(pLt,{ref:t=>{const{instance:n,sync:r}=t||{};Promise.resolve().then(()=>{!e.instance&&n&&(e.instance=n,e.sync=r,q5())})}}),i)});return}Ou.instance&&(gk.forEach(i=>{const{type:e,skipped:t}=i;if(!t)switch(e){case"open":{Q0(()=>{const n=Ou.instance.open(Object.assign(Object.assign({},sF),i.config));n==null||n.then(i.resolve),i.setCloseFn(n)});break}case"destroy":Q0(()=>{Ou==null||Ou.instance.destroy(i.key)});break;default:Q0(()=>{var n;const r=(n=Ou.instance)[e].apply(n,ft(i.args));r==null||r.then(i.resolve),i.setCloseFn(r)})}}),gk=[])}function mLt(i){sF=Object.assign(Object.assign({},sF),i),Q0(()=>{var e;(e=Ou==null?void 0:Ou.sync)===null||e===void 0||e.call(Ou)})}function vLt(i){const e=$Z(t=>{let n;const r={type:"open",config:i,resolve:t,setCloseFn:o=>{n=o}};return gk.push(r),()=>{n?Q0(()=>{n()}):r.skipped=!0}});return q5(),e}function _Lt(i,e){const t=$Z(n=>{let r;const o={type:i,args:e,resolve:n,setCloseFn:s=>{r=s}};return gk.push(o),()=>{r?Q0(()=>{r()}):o.skipped=!0}});return q5(),t}function bLt(i){gk.push({type:"destroy",key:i}),q5()}const CLt=["success","info","warning","error","loading"],yLt={open:vLt,destroy:bLt,config:mLt,useMessage:Tvt,_InternalPanelDoNotUseOrYouWillBeFired:Lvt},KLe=yLt;CLt.forEach(i=>{KLe[i]=function(){for(var e=arguments.length,t=new Array(e),n=0;n10&&arguments[10]!==void 0?arguments[10]:0,h=n/100*360*((360-s)/360),f=s===0?0:{bottom:0,top:180,left:90,right:-90}[a],g=(100-r)/100*t;return c==="round"&&r!==100&&(g+=u/2,g>=t&&(g=t-.01)),{stroke:typeof l=="string"?l:void 0,strokeDasharray:"".concat(t,"px ").concat(e),strokeDashoffset:g+d,transform:"rotate(".concat(o+h+f,"deg)"),transformOrigin:"0 0",transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},NQ=function(e){var t=e.id,n=e.prefixCls,r=e.steps,o=e.strokeWidth,s=e.trailWidth,a=e.gapDegree,l=a===void 0?0:a,c=e.gapPosition,u=e.trailColor,d=e.strokeLinecap,h=e.style,f=e.className,g=e.strokeColor,p=e.percent,v=Nn(e,DLt),m=ELt(t),_="".concat(m,"-gradient"),y=hL/2-o/2,S=Math.PI*2*y,L=l>0?90+l/2:-90,E=S*((360-l)/360),D=zn(r)==="object"?r:{count:r,space:2},k=D.count,T=D.space,M=F7(S,E,0,100,L,l,c,u,d,o),A=ide(p),N=ide(g),R=N.find(function(G){return G&&zn(G)==="object"}),F=SLt(),W=function(){var U=0;return A.map(function(K,re){var Y=N[re]||N[N.length-1],J=Y&&zn(Y)==="object"?"url(#".concat(_,")"):void 0,Q=F7(S,E,U,K,L,l,c,Y,d,o);return U+=K,C.createElement("circle",{key:re,className:"".concat(n,"-circle-path"),r:y,cx:0,cy:0,stroke:J,strokeLinecap:d,strokeWidth:o,opacity:K===0?0:1,style:Q,ref:function(de){F[re]=de}})}).reverse()},H=function(){var U=Math.round(k*(A[0]/100)),K=100/k,re=0;return new Array(k).fill(null).map(function(Y,J){var Q=J<=U-1?N[0]:u,ue=Q&&zn(Q)==="object"?"url(#".concat(_,")"):void 0,de=F7(S,E,re,K,L,l,c,Q,"butt",o,T);return re+=(E-de.strokeDashoffset+T)*100/E,C.createElement("circle",{key:J,className:"".concat(n,"-circle-path"),r:y,cx:0,cy:0,stroke:ue,strokeWidth:o,opacity:1,style:de,ref:function(ve){F[J]=ve}})})};return C.createElement("svg",St({className:xe("".concat(n,"-circle"),f),viewBox:"".concat(-hL/2," ").concat(-hL/2," ").concat(hL," ").concat(hL),style:h,id:t,role:"presentation"},v),R&&C.createElement("defs",null,C.createElement("linearGradient",{id:_,x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(R).sort(function(G,U){return nde(G)-nde(U)}).map(function(G,U){return C.createElement("stop",{key:U,offset:G,stopColor:R[G]})}))),!k&&C.createElement("circle",{className:"".concat(n,"-circle-trail"),r:y,cx:0,cy:0,stroke:u,strokeLinecap:d,strokeWidth:s||o,style:M}),k?H():W())};NQ.defaultProps=wLt;NQ.displayName="Circle";function vb(i){return!i||i<0?0:i>100?100:i}function lF(i){let{success:e,successPercent:t}=i,n=t;return e&&"progress"in e&&(n=e.progress),e&&"percent"in e&&(n=e.percent),n}const ILt=i=>{let{percent:e,success:t,successPercent:n}=i;const r=vb(lF({success:t,successPercent:n}));return[r,vb(vb(e)-r)]},kLt=i=>{let{success:e={},strokeColor:t}=i;const{strokeColor:n}=e;return[n||rw.green,t||null]},X5=(i,e,t)=>{var n,r,o,s;let a=-1,l=-1;if(e==="step"){const c=t.steps,u=t.strokeWidth;typeof i=="string"||typeof i>"u"?(a=i==="small"?2:14,l=u??8):typeof i=="number"?[a,l]=[i,i]:[a=14,l=8]=i,a*=c}else if(e==="line"){const c=t==null?void 0:t.strokeWidth;typeof i=="string"||typeof i>"u"?l=c||(i==="small"?6:8):typeof i=="number"?[a,l]=[i,i]:[a=-1,l=8]=i}else(e==="circle"||e==="dashboard")&&(typeof i=="string"||typeof i>"u"?[a,l]=i==="small"?[60,60]:[120,120]:typeof i=="number"?[a,l]=[i,i]:(a=(r=(n=i[0])!==null&&n!==void 0?n:i[1])!==null&&r!==void 0?r:120,l=(s=(o=i[0])!==null&&o!==void 0?o:i[1])!==null&&s!==void 0?s:120));return[a,l]},TLt=3,NLt=i=>TLt/i*100,RLt=i=>{const{prefixCls:e,trailColor:t=null,strokeLinecap:n="round",gapPosition:r,gapDegree:o,width:s=120,type:a,children:l,success:c,size:u}=i,d=u??[s,s],[h,f]=X5(d,"circle");let{strokeWidth:g}=i;g===void 0&&(g=Math.max(NLt(h),6));const p={width:h,height:f,fontSize:h*.15+6},v=C.useMemo(()=>{if(o||o===0)return o;if(a==="dashboard")return 75},[o,a]),m=r||a==="dashboard"&&"bottom"||void 0,_=Object.prototype.toString.call(i.strokeColor)==="[object Object]",y=kLt({success:c,strokeColor:i.strokeColor}),S=xe(`${e}-inner`,{[`${e}-circle-gradient`]:_}),L=C.createElement(NQ,{percent:ILt(i),strokeWidth:g,trailWidth:g,strokeColor:y,strokeLinecap:n,trailColor:t,prefixCls:e,gapDegree:v,gapPosition:m});return C.createElement("div",{className:S,style:p},h<=20?C.createElement(NT,{title:l},C.createElement("span",null,L)):C.createElement(C.Fragment,null,L,l))},MLt=RLt;var ALt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{let e=[];return Object.keys(i).forEach(t=>{const n=parseFloat(t.replace(/%/g,""));isNaN(n)||e.push({key:n,value:i[t]})}),e=e.sort((t,n)=>t.key-n.key),e.map(t=>{let{key:n,value:r}=t;return`${r} ${n}%`}).join(", ")},OLt=(i,e)=>{const{from:t=rw.blue,to:n=rw.blue,direction:r=e==="rtl"?"to left":"to right"}=i,o=ALt(i,["from","to","direction"]);if(Object.keys(o).length!==0){const s=PLt(o);return{backgroundImage:`linear-gradient(${r}, ${s})`}}return{backgroundImage:`linear-gradient(${r}, ${t}, ${n})`}},FLt=i=>{const{prefixCls:e,direction:t,percent:n,size:r,strokeWidth:o,strokeColor:s,strokeLinecap:a="round",children:l,trailColor:c=null,success:u}=i,d=s&&typeof s!="string"?OLt(s,t):{backgroundColor:s},h=a==="square"||a==="butt"?0:void 0,f={backgroundColor:c||void 0,borderRadius:h},g=r??[-1,o||(r==="small"?6:8)],[p,v]=X5(g,"line",{strokeWidth:o}),m=Object.assign({width:`${vb(n)}%`,height:v,borderRadius:h},d),_=lF(i),y={width:`${vb(_)}%`,height:v,borderRadius:h,backgroundColor:u==null?void 0:u.strokeColor},S={width:p<0?"100%":p,height:v};return C.createElement(C.Fragment,null,C.createElement("div",{className:`${e}-outer`,style:S},C.createElement("div",{className:`${e}-inner`,style:f},C.createElement("div",{className:`${e}-bg`,style:m}),_!==void 0?C.createElement("div",{className:`${e}-success-bg`,style:y}):null)),l)},BLt=FLt,WLt=i=>{const{size:e,steps:t,percent:n=0,strokeWidth:r=8,strokeColor:o,trailColor:s=null,prefixCls:a,children:l}=i,c=Math.round(t*(n/100)),d=e??[e==="small"?2:14,r],[h,f]=X5(d,"step",{steps:t,strokeWidth:r}),g=h/t,p=new Array(t);for(let v=0;v{const{componentCls:e,iconCls:t}=i;return{[e]:Object.assign(Object.assign({},Wr(i)),{display:"inline-block","&-rtl":{direction:"rtl"},"&-line":{position:"relative",width:"100%",fontSize:i.fontSize,marginInlineEnd:i.marginXS,marginBottom:i.marginXS},[`${e}-outer`]:{display:"inline-block",width:"100%"},[`&${e}-show-info`]:{[`${e}-outer`]:{marginInlineEnd:`calc(-2em - ${i.marginXS}px)`,paddingInlineEnd:`calc(2em + ${i.paddingXS}px)`}},[`${e}-inner`]:{position:"relative",display:"inline-block",width:"100%",overflow:"hidden",verticalAlign:"middle",backgroundColor:i.progressRemainingColor,borderRadius:i.progressLineRadius},[`${e}-inner:not(${e}-circle-gradient)`]:{[`${e}-circle-path`]:{stroke:i.colorInfo}},[`${e}-success-bg, ${e}-bg`]:{position:"relative",backgroundColor:i.colorInfo,borderRadius:i.progressLineRadius,transition:`all ${i.motionDurationSlow} ${i.motionEaseInOutCirc}`},[`${e}-success-bg`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,backgroundColor:i.colorSuccess},[`${e}-text`]:{display:"inline-block",width:"2em",marginInlineStart:i.marginXS,color:i.progressInfoTextColor,lineHeight:1,whiteSpace:"nowrap",textAlign:"start",verticalAlign:"middle",wordBreak:"normal",[t]:{fontSize:i.fontSize}},[`&${e}-status-active`]:{[`${e}-bg::before`]:{position:"absolute",inset:0,backgroundColor:i.colorBgContainer,borderRadius:i.progressLineRadius,opacity:0,animationName:HLt,animationDuration:i.progressActiveMotionDuration,animationTimingFunction:i.motionEaseOutQuint,animationIterationCount:"infinite",content:'""'}},[`&${e}-status-exception`]:{[`${e}-bg`]:{backgroundColor:i.colorError},[`${e}-text`]:{color:i.colorError}},[`&${e}-status-exception ${e}-inner:not(${e}-circle-gradient)`]:{[`${e}-circle-path`]:{stroke:i.colorError}},[`&${e}-status-success`]:{[`${e}-bg`]:{backgroundColor:i.colorSuccess},[`${e}-text`]:{color:i.colorSuccess}},[`&${e}-status-success ${e}-inner:not(${e}-circle-gradient)`]:{[`${e}-circle-path`]:{stroke:i.colorSuccess}}})}},zLt=i=>{const{componentCls:e,iconCls:t}=i;return{[e]:{[`${e}-circle-trail`]:{stroke:i.progressRemainingColor},[`&${e}-circle ${e}-inner`]:{position:"relative",lineHeight:1,backgroundColor:"transparent"},[`&${e}-circle ${e}-text`]:{position:"absolute",insetBlockStart:"50%",insetInlineStart:0,width:"100%",margin:0,padding:0,color:i.colorText,lineHeight:1,whiteSpace:"normal",textAlign:"center",transform:"translateY(-50%)",[t]:{fontSize:`${i.fontSize/i.fontSizeSM}em`}},[`${e}-circle&-status-exception`]:{[`${e}-text`]:{color:i.colorError}},[`${e}-circle&-status-success`]:{[`${e}-text`]:{color:i.colorSuccess}}},[`${e}-inline-circle`]:{lineHeight:1,[`${e}-inner`]:{verticalAlign:"bottom"}}}},ULt=i=>{const{componentCls:e}=i;return{[e]:{[`${e}-steps`]:{display:"inline-block","&-outer":{display:"flex",flexDirection:"row",alignItems:"center"},"&-item":{flexShrink:0,minWidth:i.progressStepMinWidth,marginInlineEnd:i.progressStepMarginInlineEnd,backgroundColor:i.progressRemainingColor,transition:`all ${i.motionDurationSlow}`,"&-active":{backgroundColor:i.colorInfo}}}}}},jLt=i=>{const{componentCls:e,iconCls:t}=i;return{[e]:{[`${e}-small&-line, ${e}-small&-line ${e}-text ${t}`]:{fontSize:i.fontSizeSM}}}},KLt=vo("Progress",i=>{const e=i.marginXXS/2,t=Oi(i,{progressLineRadius:100,progressInfoTextColor:i.colorText,progressDefaultColor:i.colorInfo,progressRemainingColor:i.colorFillSecondary,progressStepMarginInlineEnd:e,progressStepMinWidth:e,progressActiveMotionDuration:"2.4s"});return[VLt(t),zLt(t),ULt(t),jLt(t)]});var GLt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const{prefixCls:e,className:t,rootClassName:n,steps:r,strokeColor:o,percent:s=0,size:a="default",showInfo:l=!0,type:c="line",status:u,format:d}=i,h=GLt(i,["prefixCls","className","rootClassName","steps","strokeColor","percent","size","showInfo","type","status","format"]),f=C.useMemo(()=>{var T,M;const A=lF(i);return parseInt(A!==void 0?(T=A??0)===null||T===void 0?void 0:T.toString():(M=s??0)===null||M===void 0?void 0:M.toString(),10)},[s,i.success,i.successPercent]),g=C.useMemo(()=>!qLt.includes(u)&&f>=100?"success":u||"normal",[u,f]),{getPrefixCls:p,direction:v}=C.useContext(Rn),m=p("progress",e),[_,y]=KLt(m),S=C.useMemo(()=>{if(!l)return null;const T=lF(i);let M;const A=d||(R=>`${R}%`),N=c==="line";return d||g!=="exception"&&g!=="success"?M=A(vb(s),vb(T)):g==="exception"?M=N?C.createElement(XS,null):C.createElement(CT,null):g==="success"&&(M=N?C.createElement(EZ,null):C.createElement($ye,null)),C.createElement("span",{className:`${m}-text`,title:typeof M=="string"?M:void 0},M)},[l,s,f,g,c,m,d]),L=Array.isArray(o)?o[0]:o,E=typeof o=="string"||Array.isArray(o)?o:void 0;let D;c==="line"?D=r?C.createElement($Lt,Object.assign({},i,{strokeColor:E,prefixCls:m,steps:r}),S):C.createElement(BLt,Object.assign({},i,{strokeColor:L,prefixCls:m,direction:v}),S):(c==="circle"||c==="dashboard")&&(D=C.createElement(MLt,Object.assign({},i,{strokeColor:L,prefixCls:m,progressStatus:g}),S));const k=xe(m,{[`${m}-inline-circle`]:c==="circle"&&X5(a,"circle")[0]<=20,[`${m}-${c==="dashboard"&&"circle"||r&&"steps"||c}`]:!0,[`${m}-status-${g}`]:!0,[`${m}-show-info`]:l,[`${m}-${a}`]:typeof a=="string",[`${m}-rtl`]:v==="rtl"},t,n,y);return _(C.createElement("div",Object.assign({className:k,role:"progressbar"},ll(h,["trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","success","successPercent"])),D))},rde=XLt;var Nm={};function YLt(i){var e=C.createContext(void 0),t=function(r){var o=r.value,s=r.children,a=C.useRef(o);a.current=o;var l=C.useState(function(){return{getValue:function(){return a.current},listeners:new Set}}),c=Ae(l,1),u=c[0];return br(function(){sh.unstable_batchedUpdates(function(){u.listeners.forEach(function(d){d(o)})})},[o]),C.createElement(e.Provider,{value:u},s)};return{Context:e,Provider:t,defaultValue:i}}function Ah(i,e){var t=tc(typeof e=="function"?e:function(d){if(e===void 0)return d;if(!Array.isArray(e))return d[e];var h={};return e.forEach(function(f){h[f]=d[f]}),h}),n=C.useContext(i==null?void 0:i.Context),r=n||{},o=r.listeners,s=r.getValue,a=C.useRef();a.current=t(n?s():i==null?void 0:i.defaultValue);var l=C.useState({}),c=Ae(l,2),u=c[1];return br(function(){if(!n)return;function d(h){var f=t(h);Op(a.current,f,!0)||u({})}return o.add(d),function(){o.delete(d)}},[n]),a.current}var qLe=C.createContext(0);function XLe(){return C.useContext(qLe)}function ZLt(i,e){var t=W_(i),n=function(o,s){var a=t?{ref:s}:{},l=C.useRef(0),c=C.useRef(o);return(!e||e(c.current,o))&&(l.current+=1),c.current=o,C.createElement(qLe.Provider,{value:l.current},C.createElement(i,St({},o,a)))};return t?C.forwardRef(n):n}function Y5(i,e){var t=W_(i),n=function(o,s){var a=t?{ref:s}:{};return XLe(),C.createElement(i,St({},o,a))};return t?C.memo(C.forwardRef(n),e):C.memo(n,e)}var gd=YLt();function QLt(i,e){var t=C.useRef(0);t.current+=1;var n=C.useRef(i),r=[];Object.keys(i||{}).map(function(s){var a;(i==null?void 0:i[s])!==((a=n.current)===null||a===void 0?void 0:a[s])&&r.push(s)}),n.current=i;var o=C.useRef([]);return r.length&&(o.current=r),C.useDebugValue(t.current),C.useDebugValue(o.current.join(", ")),e&&console.log("".concat(e,":"),t.current,o.current),t.current}var JLt=C.memo(function(){var i=QLt();return C.createElement("h1",null,"Render Times: ",i)});JLt.displayName="RenderBlock";var YLe=C.createContext({renderWithProps:!1}),eEt="RC_TABLE_KEY";function tEt(i){return i==null?[]:Array.isArray(i)?i:[i]}function Z5(i){var e=[],t={};return i.forEach(function(n){for(var r=n||{},o=r.key,s=r.dataIndex,a=o||tEt(s).join("-")||eEt;t[a];)a="".concat(a,"_next");t[a]=!0,e.push(a)}),e}function kK(i){return i!=null}function nEt(i){return i&&zn(i)==="object"&&!Array.isArray(i)&&!C.isValidElement(i)}function iEt(i,e,t,n,r,o){var s=C.useContext(YLe),a=XLe(),l=LC(function(){if(kK(n))return[n];var c=e==null||e===""?[]:Array.isArray(e)?e:[e],u=Yd(i,c),d=u,h=void 0;if(r){var f=r(u,i,t);nEt(f)?(d=f.children,h=f.props,s.renderWithProps=!0):d=f}return[d,h]},[a,i,n,e,r,t],function(c,u){if(o){var d=Ae(c,2),h=d[1],f=Ae(u,2),g=f[1];return o(g,h)}return s.renderWithProps?!0:!Op(c,u,!0)});return l}function rEt(i,e,t,n){var r=i+e-1;return i<=n&&r>=t}function oEt(i,e){return Ah(gd,function(t){var n=rEt(i,e||1,t.hoverStartRow,t.hoverEndRow);return[n,t.onHover]})}var sEt=function(e){var t=e.ellipsis,n=e.rowType,r=e.children,o,s=t===!0?{showTitle:!0}:t;return s&&(s.showTitle||n==="header")&&(typeof r=="string"||typeof r=="number"?o=r.toString():C.isValidElement(r)&&typeof r.props.children=="string"&&(o=r.props.children)),o};function aEt(i){var e,t,n,r,o,s,a,l,c=i.component,u=i.children,d=i.ellipsis,h=i.scope,f=i.prefixCls,g=i.className,p=i.align,v=i.record,m=i.render,_=i.dataIndex,y=i.renderIndex,S=i.shouldCellUpdate,L=i.index,E=i.rowType,D=i.colSpan,k=i.rowSpan,T=i.fixLeft,M=i.fixRight,A=i.firstFixLeft,N=i.lastFixLeft,R=i.firstFixRight,F=i.lastFixRight,W=i.appendNode,H=i.additionalProps,G=H===void 0?{}:H,U=i.isSticky,K="".concat(f,"-cell"),re=Ah(gd,["supportSticky","allColumnsFixedLeft"]),Y=re.supportSticky,J=re.allColumnsFixedLeft,Q=iEt(v,_,y,u,m,S),ue=Ae(Q,2),de=ue[0],_e=ue[1],ve={},Ve=typeof T=="number"&&Y,Ze=typeof M=="number"&&Y;Ve&&(ve.position="sticky",ve.left=T),Ze&&(ve.position="sticky",ve.right=M);var We=(e=(t=(n=_e==null?void 0:_e.colSpan)!==null&&n!==void 0?n:G.colSpan)!==null&&t!==void 0?t:D)!==null&&e!==void 0?e:1,pe=(r=(o=(s=_e==null?void 0:_e.rowSpan)!==null&&s!==void 0?s:G.rowSpan)!==null&&o!==void 0?o:k)!==null&&r!==void 0?r:1,Pe=oEt(L,pe),Se=Ae(Pe,2),Ne=Se[0],Me=Se[1],Qe=function(q){var oe;v&&Me(L,L+pe-1),G==null||(oe=G.onMouseEnter)===null||oe===void 0||oe.call(G,q)},Ke=function(q){var oe;v&&Me(-1,-1),G==null||(oe=G.onMouseLeave)===null||oe===void 0||oe.call(G,q)};if(We===0||pe===0)return null;var Re=(a=G.title)!==null&&a!==void 0?a:sEt({rowType:E,ellipsis:d,children:de}),ct=xe(K,g,(l={},be(l,"".concat(K,"-fix-left"),Ve&&Y),be(l,"".concat(K,"-fix-left-first"),A&&Y),be(l,"".concat(K,"-fix-left-last"),N&&Y),be(l,"".concat(K,"-fix-left-all"),N&&J&&Y),be(l,"".concat(K,"-fix-right"),Ze&&Y),be(l,"".concat(K,"-fix-right-first"),R&&Y),be(l,"".concat(K,"-fix-right-last"),F&&Y),be(l,"".concat(K,"-ellipsis"),d),be(l,"".concat(K,"-with-append"),W),be(l,"".concat(K,"-fix-sticky"),(Ve||Ze)&&U&&Y),be(l,"".concat(K,"-row-hover"),!_e&&Ne),l),G.className,_e==null?void 0:_e.className),ie={};p&&(ie.textAlign=p);var le=te(te(te(te({},G.style),ie),ve),_e==null?void 0:_e.style),ce=de;return zn(ce)==="object"&&!Array.isArray(ce)&&!C.isValidElement(ce)&&(ce=null),d&&(N||R)&&(ce=C.createElement("span",{className:"".concat(K,"-content")},ce)),C.createElement(c,St({},_e,G,{className:ct,style:le,title:Re,scope:h,onMouseEnter:Qe,onMouseLeave:Ke,colSpan:We!==1?We:null,rowSpan:pe!==1?pe:null}),W,ce)}const Q5=C.memo(aEt);function RQ(i,e,t,n,r,o){var s=t[i]||{},a=t[e]||{},l,c;s.fixed==="left"?l=n.left[r==="rtl"?e:i]:a.fixed==="right"&&(c=n.right[r==="rtl"?i:e]);var u=!1,d=!1,h=!1,f=!1,g=t[e+1],p=t[i-1],v=!(o!=null&&o.children);if(r==="rtl"){if(l!==void 0){var m=p&&p.fixed==="left";f=!m&&v}else if(c!==void 0){var _=g&&g.fixed==="right";h=!_&&v}}else if(l!==void 0){var y=g&&g.fixed==="left";u=!y&&v}else if(c!==void 0){var S=p&&p.fixed==="right";d=!S&&v}return{fixLeft:l,fixRight:c,lastFixLeft:u,firstFixRight:d,lastFixRight:h,firstFixLeft:f,isSticky:n.isSticky}}var ZLe=C.createContext({});function lEt(i){var e=i.className,t=i.index,n=i.children,r=i.colSpan,o=r===void 0?1:r,s=i.rowSpan,a=i.align,l=Ah(gd,["prefixCls","direction"]),c=l.prefixCls,u=l.direction,d=C.useContext(ZLe),h=d.scrollColumnIndex,f=d.stickyOffsets,g=d.flattenColumns,p=d.columns,v=t+o-1,m=v+1===h?o+1:o,_=RQ(t,t+m-1,g,f,u,p==null?void 0:p[t]);return C.createElement(Q5,St({className:e,index:t,component:"td",prefixCls:c,record:null,dataIndex:null,align:a,colSpan:m,rowSpan:s,render:function(){return n}},_))}var cEt=["children"];function uEt(i){var e=i.children,t=Nn(i,cEt);return C.createElement("tr",t,e)}function J5(i){var e=i.children;return e}J5.Row=uEt;J5.Cell=lEt;function dEt(i){var e=i.children,t=i.stickyOffsets,n=i.flattenColumns,r=i.columns,o=Ah(gd,"prefixCls"),s=n.length-1,a=n[s],l=C.useMemo(function(){return{stickyOffsets:t,flattenColumns:n,scrollColumnIndex:a!=null&&a.scrollbar?s:null,columns:r}},[a,n,s,t,r]);return C.createElement(ZLe.Provider,{value:l},C.createElement("tfoot",{className:"".concat(o,"-summary")},e))}const B2=Y5(dEt);var QLe=J5;function hEt(i){return null}function fEt(i){return null}function JLe(i,e,t,n,r,o){var s=[];s.push({record:i,indent:e,index:o});var a=r(i),l=n==null?void 0:n.has(a);if(i&&Array.isArray(i[t])&&l)for(var c=0;c1?Me-1:0),Ke=1;Ke=0;a-=1){var l=e[a],c=t&&t[a],u=c&&c[ZE];if(l||u||s){var d=u||{};d.columnType;var h=Nn(d,yEt);r.unshift(C.createElement("col",St({key:a,style:{width:l}},h))),s=!0}}return C.createElement("colgroup",null,r)}var wEt=["className","noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName","onScroll","maxContentScroll","children"];function SEt(i,e){return C.useMemo(function(){for(var t=[],n=0;n=0})},[o]),M=o[o.length-1],A={fixed:M?M.fixed:null,scrollbar:!0,onHeaderCell:function(){return{className:"".concat(y,"-cell-scrollbar")}}},N=C.useMemo(function(){return E?[].concat(ft(r),[A]):r},[E,r]),R=C.useMemo(function(){return E?[].concat(ft(o),[A]):o},[E,o]),F=C.useMemo(function(){var H=l.right,G=l.left;return te(te({},l),{},{left:c==="rtl"?[].concat(ft(G.map(function(U){return U+E})),[0]):G,right:c==="rtl"?H:[].concat(ft(H.map(function(U){return U+E})),[0]),isSticky:L})},[E,l,L]),W=SEt(s,a);return C.createElement("div",{style:te({overflow:"hidden"},L?{top:d,bottom:h}:{}),ref:k,className:xe(t,be({},f,!!f))},C.createElement("table",{style:{tableLayout:"fixed",visibility:n||W?null:"hidden"}},(!n||!p||T)&&C.createElement(iEe,{colWidths:W?[].concat(ft(W),[E]):[],columCount:a+1,columns:R}),v(te(te({},m),{},{stickyOffsets:F,columns:N,flattenColumns:R}))))});rEe.displayName="FixedHolder";const ode=C.memo(rEe);function oEe(i){var e=i.cells,t=i.stickyOffsets,n=i.flattenColumns,r=i.rowComponent,o=i.cellComponent,s=i.tdCellComponent,a=i.onHeaderRow,l=i.index,c=Ah(gd,["prefixCls","direction"]),u=c.prefixCls,d=c.direction,h;a&&(h=a(e.map(function(g){return g.column}),l));var f=Z5(e.map(function(g){return g.column}));return C.createElement(r,h,e.map(function(g,p){var v=g.column,m=RQ(g.colStart,g.colEnd,n,t,d,v),_;return v&&v.onHeaderCell&&(_=g.column.onHeaderCell(v)),C.createElement(Q5,St({},g,{scope:v.title?g.colSpan>1?"colgroup":"col":null,ellipsis:v.ellipsis,align:v.align,component:v.title?o:s,prefixCls:u,key:f[p]},m,{additionalProps:_,rowType:"header"}))}))}oEe.displayName="HeaderRow";function xEt(i){var e=[];function t(s,a){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;e[l]=e[l]||[];var c=a,u=s.filter(Boolean).map(function(d){var h={key:d.key,className:d.className||"",children:d.title,column:d,colStart:c},f=1,g=d.children;return g&&g.length>0&&(f=t(g,c,l+1).reduce(function(p,v){return p+v},0),h.hasSubColumns=!0),"colSpan"in d&&(f=d.colSpan),"rowSpan"in d&&(h.rowSpan=d.rowSpan),h.colSpan=f,h.colEnd=h.colStart+f-1,e[l].push(h),c+=f,f});return u}t(i,0);for(var n=e.length,r=function(a){e[a].forEach(function(l){!("rowSpan"in l)&&!l.hasSubColumns&&(l.rowSpan=n-a)})},o=0;o0?[].concat(ft(e),ft(TK(o).map(function(s){return te({fixed:r},s)}))):[].concat(ft(e),[te(te({},t),{},{fixed:r})])},[])}function IEt(i){return i.map(function(e){var t=e.fixed,n=Nn(e,DEt),r=t;return t==="left"?r="right":t==="right"&&(r="left"),te({fixed:r},n)})}function kEt(i,e){var t=i.prefixCls,n=i.columns,r=i.children,o=i.expandable,s=i.expandedKeys,a=i.columnTitle,l=i.getRowKey,c=i.onTriggerExpand,u=i.expandIcon,d=i.rowExpandable,h=i.expandIconColumnIndex,f=i.direction,g=i.expandRowByClick,p=i.columnWidth,v=i.fixed,m=C.useMemo(function(){return n||MQ(r)},[n,r]),_=C.useMemo(function(){if(o){var L,E=m.slice();if(!E.includes(Nm)){var D=h||0;D>=0&&E.splice(D,0,Nm)}var k=E.indexOf(Nm);E=E.filter(function(N,R){return N!==Nm||R===k});var T=m[k],M;(v==="left"||v)&&!h?M="left":(v==="right"||v)&&h===m.length?M="right":M=T?T.fixed:null;var A=(L={},be(L,ZE,{className:"".concat(t,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),be(L,"title",a),be(L,"fixed",M),be(L,"className","".concat(t,"-row-expand-icon-cell")),be(L,"width",p),be(L,"render",function(R,F,W){var H=l(F,W),G=s.has(H),U=d?d(F):!0,K=u({prefixCls:t,expanded:G,expandable:U,record:F,onExpand:c});return g?C.createElement("span",{onClick:function(Y){return Y.stopPropagation()}},K):K}),L);return E.map(function(N){return N===Nm?A:N})}return m.filter(function(N){return N!==Nm})},[o,m,l,s,u,f]),y=C.useMemo(function(){var L=_;return e&&(L=e(L)),L.length||(L=[{render:function(){return null}}]),L},[e,_,f]),S=C.useMemo(function(){return f==="rtl"?IEt(TK(y)):TK(y)},[y,f]);return[y,S]}function TEt(i){var e,t=i.prefixCls,n=i.record,r=i.onExpand,o=i.expanded,s=i.expandable,a="".concat(t,"-row-expand-icon");if(!s)return C.createElement("span",{className:xe(a,"".concat(t,"-row-spaced"))});var l=function(u){r(n,u),u.stopPropagation()};return C.createElement("span",{className:xe(a,(e={},be(e,"".concat(t,"-row-expanded"),o),be(e,"".concat(t,"-row-collapsed"),!o),e)),onClick:l})}function NEt(i,e,t){var n=[];function r(o){(o||[]).forEach(function(s,a){n.push(e(s,a)),r(s[t])})}return r(i),n}function REt(i,e,t){var n=CEt(i),r=n.expandIcon,o=n.expandedRowKeys,s=n.defaultExpandedRowKeys,a=n.defaultExpandAllRows,l=n.expandedRowRender,c=n.onExpand,u=n.onExpandedRowsChange,d=n.childrenColumnName,h=r||TEt,f=d||"children",g=C.useMemo(function(){return l?"row":i.expandable&&i.internalHooks===cF&&i.expandable.__PARENT_RENDER_ICON__||e.some(function(L){return L&&zn(L)==="object"&&L[f]})?"nest":!1},[!!l,e]),p=C.useState(function(){return s||(a?NEt(e,t,f):[])}),v=Ae(p,2),m=v[0],_=v[1],y=C.useMemo(function(){return new Set(o||m||[])},[o,m]),S=C.useCallback(function(L){var E=t(L,e.indexOf(L)),D,k=y.has(E);k?(y.delete(E),D=ft(y)):D=[].concat(ft(y),[E]),_(D),c&&c(!k,L),u&&u(D)},[t,y,e,c,u]);return[n,g,y,h,f,S]}function MEt(i,e,t,n){var r=i.map(function(o,s){return RQ(s,s,i,e,t,n==null?void 0:n[s])});return LC(function(){return r},[r],function(o,s){return!Op(o,s)})}function sEe(i){var e=C.useRef(i),t=C.useState({}),n=Ae(t,2),r=n[1],o=C.useRef(null),s=C.useRef([]);function a(l){s.current.push(l);var c=Promise.resolve();o.current=c,c.then(function(){if(o.current===c){var u=s.current,d=e.current;s.current=[],u.forEach(function(h){e.current=h(e.current)}),o.current=null,d!==e.current&&r({})}})}return C.useEffect(function(){return function(){o.current=null}},[]),[e.current,a]}function AEt(i){var e=C.useRef(i||null),t=C.useRef();function n(){window.clearTimeout(t.current)}function r(s){e.current=s,n(),t.current=window.setTimeout(function(){e.current=null,t.current=void 0},100)}function o(){return e.current}return C.useEffect(function(){return n},[]),[r,o]}function PEt(){var i=C.useState(-1),e=Ae(i,2),t=e[0],n=e[1],r=C.useState(-1),o=Ae(r,2),s=o[0],a=o[1],l=C.useCallback(function(c,u){n(c),a(u)},[]);return[t,s,l]}var ade=Zs()?window:null;function OEt(i,e){var t=zn(i)==="object"?i:{},n=t.offsetHeader,r=n===void 0?0:n,o=t.offsetSummary,s=o===void 0?0:o,a=t.offsetScroll,l=a===void 0?0:a,c=t.getContainer,u=c===void 0?function(){return ade}:c,d=u()||ade;return C.useMemo(function(){var h=!!i;return{isSticky:h,stickyClassName:h?"".concat(e,"-sticky-holder"):"",offsetHeader:r,offsetSummary:s,offsetScroll:l,container:d}},[l,r,s,e,d])}function FEt(i,e,t){var n=C.useMemo(function(){for(var r=[],o=[],s=0,a=0,l=0;l=d&&(G=d-h),s({scrollLeft:G/d*(u+2)}),_.current.x=R.pageX},M=function(){if(o.current){var R=Xue(o.current).top,F=R+o.current.offsetHeight,W=l===window?document.documentElement.scrollTop+window.innerHeight:Xue(l).top+l.clientHeight;F-GO()<=W||R>=W-a?m(function(H){return te(te({},H),{},{isHiddenScrollBar:!0})}):m(function(H){return te(te({},H),{},{isHiddenScrollBar:!1})})}},A=function(R){m(function(F){return te(te({},F),{},{scrollLeft:R/u*d||0})})};return C.useImperativeHandle(t,function(){return{setScrollLeft:A}}),C.useEffect(function(){var N=lp(document.body,"mouseup",D,!1),R=lp(document.body,"mousemove",T,!1);return M(),function(){N.remove(),R.remove()}},[h,L]),C.useEffect(function(){var N=lp(l,"scroll",M,!1),R=lp(window,"resize",M,!1);return function(){N.remove(),R.remove()}},[l]),C.useEffect(function(){v.isHiddenScrollBar||m(function(N){var R=o.current;return R?te(te({},N),{},{scrollLeft:R.scrollLeft/R.scrollWidth*R.clientWidth}):N})},[v.isHiddenScrollBar]),u<=d||!h||v.isHiddenScrollBar?null:C.createElement("div",{style:{height:GO(),width:d,bottom:a},className:"".concat(c,"-sticky-scroll")},C.createElement("div",{onMouseDown:k,ref:f,className:xe("".concat(c,"-sticky-scroll-bar"),be({},"".concat(c,"-sticky-scroll-bar-active"),L)),style:{width:"".concat(h,"px"),transform:"translate3d(".concat(v.scrollLeft,"px, 0, 0)")}}))};const WEt=C.forwardRef(BEt);var $Et=[],HEt={},cF="rc-table-internal-hook";function VEt(){return"No Data"}function zEt(i){var e,t=te({rowKey:"key",prefixCls:"rc-table",emptyText:VEt},i),n=t.prefixCls,r=t.className,o=t.rowClassName,s=t.style,a=t.data,l=t.rowKey,c=t.scroll,u=t.tableLayout,d=t.direction,h=t.title,f=t.footer,g=t.summary,p=t.caption,v=t.id,m=t.showHeader,_=t.components,y=t.emptyText,S=t.onRow,L=t.onHeaderRow,E=t.internalHooks,D=t.transformColumns,k=t.internalRefs,T=t.sticky,M=a||$Et,A=!!M.length,N=C.useCallback(function(Xt,Gt){return Yd(_,Xt)||Gt},[_]),R=C.useMemo(function(){return typeof l=="function"?l:function(Xt){var Gt=Xt&&Xt[l];return Gt}},[l]),F=PEt(),W=Ae(F,3),H=W[0],G=W[1],U=W[2],K=REt(t,M,R),re=Ae(K,6),Y=re[0],J=re[1],Q=re[2],ue=re[3],de=re[4],_e=re[5],ve=C.useState(0),Ve=Ae(ve,2),Ze=Ve[0],We=Ve[1],pe=kEt(te(te(te({},t),Y),{},{expandable:!!Y.expandedRowRender,columnTitle:Y.columnTitle,expandedKeys:Q,getRowKey:R,onTriggerExpand:_e,expandIcon:ue,expandIconColumnIndex:Y.expandIconColumnIndex,direction:d}),E===cF?D:null),Pe=Ae(pe,2),Se=Pe[0],Ne=Pe[1],Me=C.useMemo(function(){return{columns:Se,flattenColumns:Ne}},[Se,Ne]),Qe=C.useRef(),Ke=C.useRef(),Re=C.useRef(),ct=C.useRef(),ie=C.useRef(),le=C.useState(!1),ce=Ae(le,2),z=ce[0],q=ce[1],oe=C.useState(!1),ne=Ae(oe,2),he=ne[0],Le=ne[1],Fe=sEe(new Map),ze=Ae(Fe,2),Ue=ze[0],nt=ze[1],it=Z5(Ne),at=it.map(function(Xt){return Ue.get(Xt)}),tt=C.useMemo(function(){return at},[at.join("_")]),Zt=FEt(tt,Ne.length,d),Tt=c&&kK(c.y),xn=c&&kK(c.x)||!!Y.fixed,rt=xn&&Ne.some(function(Xt){var Gt=Xt.fixed;return Gt}),wt=C.useRef(),Bt=OEt(T,n),Nt=Bt.isSticky,nn=Bt.offsetHeader,Mn=Bt.offsetSummary,zt=Bt.offsetScroll,Qt=Bt.stickyClassName,lt=Bt.container,ut=C.useMemo(function(){return g==null?void 0:g(M)},[g,M]),dt=(Tt||Nt)&&C.isValidElement(ut)&&ut.type===J5&&ut.props.fixed,Mt,Kt,mn;Tt&&(Kt={overflowY:"scroll",maxHeight:c.y}),xn&&(Mt={overflowX:"auto"},Tt||(Kt={overflowY:"hidden"}),mn={width:(c==null?void 0:c.x)===!0?"auto":c==null?void 0:c.x,minWidth:"100%"});var lr=C.useCallback(function(Xt,Gt){DT(Qe.current)&&nt(function(oi){if(oi.get(Xt)!==Gt){var Fi=new Map(oi);return Fi.set(Xt,Gt),Fi}return oi})},[]),nr=AEt(null),Hr=Ae(nr,2),Jn=Hr[0],Ii=Hr[1];function _o(Xt,Gt){Gt&&(typeof Gt=="function"?Gt(Xt):Gt.scrollLeft!==Xt&&(Gt.scrollLeft=Xt,Gt.scrollLeft!==Xt&&setTimeout(function(){Gt.scrollLeft=Xt},0)))}var No=tc(function(Xt){var Gt=Xt.currentTarget,oi=Xt.scrollLeft,Fi=d==="rtl",Co=typeof oi=="number"?oi:Gt.scrollLeft,Bs=Gt||HEt;if(!Ii()||Ii()===Bs){var ul;Jn(Bs),_o(Co,Ke.current),_o(Co,Re.current),_o(Co,ie.current),_o(Co,(ul=wt.current)===null||ul===void 0?void 0:ul.setScrollLeft)}if(Gt){var Ws=Gt.scrollWidth,Lc=Gt.clientWidth;if(Ws===Lc){q(!1),Le(!1);return}Fi?(q(-Co0)):(q(Co>0),Le(Co{r(o,c),c.stopPropagation()},className:xe(l,{[`${l}-spaced`]:!a,[`${l}-expanded`]:a&&s,[`${l}-collapsed`]:a&&!s}),"aria-label":s?i.collapse:i.expand,"aria-expanded":s})}}const GEt=aEe((i,e)=>{const{_renderTimes:t}=i,{_renderTimes:n}=e;return t!==n});function iC(i,e){return"key"in i&&i.key!==void 0&&i.key!==null?i.key:i.dataIndex?Array.isArray(i.dataIndex)?i.dataIndex.join("."):i.dataIndex:e}function WT(i,e){return e?`${e}-${i}`:`${i}`}function tB(i,e){return typeof i=="function"?i(e):i}function qEt(i,e){const t=tB(i,e);return Object.prototype.toString.call(t)==="[object Object]"?"":t}function lEe(i){if(i==null)throw new TypeError("Cannot destructure "+i)}var XEt=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],cEe=function(e,t){var n=e.className,r=e.style,o=e.motion,s=e.motionNodes,a=e.motionType,l=e.onMotionStart,c=e.onMotionEnd,u=e.active,d=e.treeNodeRequiredProps,h=Nn(e,XEt),f=C.useState(!0),g=Ae(f,2),p=g[0],v=g[1],m=C.useContext(wQ),_=m.prefixCls,y=C.useRef(!1),S=function(){y.current||c(),y.current=!0};return C.useEffect(function(){s&&a==="hide"&&p&&v(!1)},[s]),C.useEffect(function(){return s&&l(),function(){s&&S()}},[]),s?C.createElement(fd,St({ref:t,visible:p},o,{motionAppear:a==="show",onAppearEnd:S,onLeaveEnd:S}),function(L,E){var D=L.className,k=L.style;return C.createElement("div",{ref:E,className:xe("".concat(_,"-treenode-motion"),D),style:k},s.map(function(T){var M=St({},(lEe(T.data),T.data)),A=T.title,N=T.key,R=T.isStart,F=T.isEnd;delete M.children;var W=XE(N,d);return C.createElement(mS,St({},M,W,{title:A,active:u,data:T.data,key:N,isStart:R,isEnd:F}))}))}):C.createElement(mS,St({domRef:t,className:n,style:r},h,{active:u}))};cEe.displayName="MotionTreeNode";var YEt=C.forwardRef(cEe);function ZEt(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=i.length,n=e.length;if(Math.abs(t-n)!==1)return{add:!1,key:null};function r(o,s){var a=new Map;o.forEach(function(c){a.set(c,!0)});var l=s.filter(function(c){return!a.has(c)});return l.length===1?l[0]:null}return t ").concat(e);return e}var dEe=C.forwardRef(function(i,e){var t=i.prefixCls,n=i.data;i.selectable,i.checkable;var r=i.expandedKeys,o=i.selectedKeys,s=i.checkedKeys,a=i.loadedKeys,l=i.loadingKeys,c=i.halfCheckedKeys,u=i.keyEntities,d=i.disabled,h=i.dragging,f=i.dragOverNodeKey,g=i.dropPosition,p=i.motion,v=i.height,m=i.itemHeight,_=i.virtual,y=i.focusable,S=i.activeItem,L=i.focused,E=i.tabIndex,D=i.onKeyDown,k=i.onFocus,T=i.onBlur,M=i.onActiveChange,A=i.onListChangeStart,N=i.onListChangeEnd,R=Nn(i,QEt),F=C.useRef(null),W=C.useRef(null);C.useImperativeHandle(e,function(){return{scrollTo:function(le){F.current.scrollTo(le)},getIndentWidth:function(){return W.current.offsetWidth}}});var H=C.useState(r),G=Ae(H,2),U=G[0],K=G[1],re=C.useState(n),Y=Ae(re,2),J=Y[0],Q=Y[1],ue=C.useState(n),de=Ae(ue,2),_e=de[0],ve=de[1],Ve=C.useState([]),Ze=Ae(Ve,2),We=Ze[0],pe=Ze[1],Pe=C.useState(null),Se=Ae(Pe,2),Ne=Se[0],Me=Se[1],Qe=C.useRef(n);Qe.current=n;function Ke(){var ie=Qe.current;Q(ie),ve(ie),pe([]),Me(null),N()}C.useEffect(function(){K(r);var ie=ZEt(U,r);if(ie.key!==null)if(ie.add){var le=J.findIndex(function(he){var Le=he.key;return Le===ie.key}),ce=hde(cde(J,n,ie.key),_,v,m),z=J.slice();z.splice(le+1,0,dde),ve(z),pe(ce),Me("show")}else{var q=n.findIndex(function(he){var Le=he.key;return Le===ie.key}),oe=hde(cde(n,J,ie.key),_,v,m),ne=n.slice();ne.splice(q+1,0,dde),ve(ne),pe(oe),Me("hide")}else J!==n&&(Q(n),ve(n))},[r,n]),C.useEffect(function(){h||Ke()},[h]);var Re=p?_e:n,ct={expandedKeys:r,selectedKeys:o,loadedKeys:a,loadingKeys:l,checkedKeys:s,halfCheckedKeys:c,dragOverNodeKey:f,dropPosition:g,keyEntities:u};return C.createElement(C.Fragment,null,L&&S&&C.createElement("span",{style:ude,"aria-live":"assertive"},eDt(S)),C.createElement("div",null,C.createElement("input",{style:ude,disabled:y===!1||d,tabIndex:y!==!1?E:null,onKeyDown:D,onFocus:k,onBlur:T,value:"",onChange:JEt,"aria-label":"for screen reader"})),C.createElement("div",{className:"".concat(t,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},C.createElement("div",{className:"".concat(t,"-indent")},C.createElement("div",{ref:W,className:"".concat(t,"-indent-unit")}))),C.createElement(JZ,St({},R,{data:Re,itemKey:fde,height:v,fullHeight:!1,virtual:_,itemHeight:m,prefixCls:"".concat(t,"-list"),ref:F,onVisibleChange:function(le,ce){var z=new Set(le),q=ce.filter(function(oe){return!z.has(oe)});q.some(function(oe){return fde(oe)===rC})&&Ke()}}),function(ie){var le=ie.pos,ce=St({},(lEe(ie.data),ie.data)),z=ie.title,q=ie.key,oe=ie.isStart,ne=ie.isEnd,he=FT(q,le);delete ce.key,delete ce.children;var Le=XE(he,ct);return C.createElement(YEt,St({},ce,Le,{title:z,active:!!S&&q===S.key,pos:le,data:ie.data,isStart:oe,isEnd:ne,motion:p,motionNodes:q===rC?We:null,motionType:Ne,onMotionStart:A,onMotionEnd:Ke,treeNodeRequiredProps:ct,onMouseMove:function(){M(null)}}))}))});dEe.displayName="NodeList";function tDt(i){var e=i.dropPosition,t=i.dropLevelOffset,n=i.indent,r={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(e){case-1:r.top=0,r.left=-t*n;break;case 1:r.bottom=0,r.left=-t*n;break;case 0:r.bottom=0,r.left=n;break}return C.createElement("div",{style:r})}var nDt=10,AQ=function(i){kh(t,i);var e=Th(t);function t(){var n;vs(this,t);for(var r=arguments.length,o=new Array(r),s=0;s2&&arguments[2]!==void 0?arguments[2]:!1,d=n.state,h=d.dragChildrenKeys,f=d.dropPosition,g=d.dropTargetKey,p=d.dropTargetPos,v=d.dropAllowed;if(v){var m=n.props.onDrop;if(n.setState({dragOverNodeKey:null}),n.cleanDragState(),g!==null){var _=te(te({},XE(g,n.getTreeNodeRequiredProps())),{},{active:((c=n.getActiveItem())===null||c===void 0?void 0:c.key)===g,data:n.state.keyEntities[g].node}),y=h.indexOf(g)!==-1;ao(!y,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var S=SQ(p),L={event:a,node:ss(_),dragNode:n.dragNode?ss(n.dragNode.props):null,dragNodesKeys:[n.dragNode.props.eventKey].concat(h),dropToGap:f!==0,dropPosition:f+Number(S[S.length-1])};u||m==null||m(L),n.dragNode=null}}},n.cleanDragState=function(){var a=n.state.draggingNodeKey;a!==null&&n.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),n.dragStartMousePosition=null,n.currentMouseOverDroppableNodeKey=null},n.triggerExpandActionExpand=function(a,l){var c=n.state,u=c.expandedKeys,d=c.flattenNodes,h=l.expanded,f=l.key,g=l.isLeaf;if(!(g||a.shiftKey||a.metaKey||a.ctrlKey)){var p=d.filter(function(m){return m.key===f})[0],v=ss(te(te({},XE(f,n.getTreeNodeRequiredProps())),{},{data:p.data}));n.setExpandedKeys(h?Xh(u,f):Lg(u,f)),n.onNodeExpand(a,v)}},n.onNodeClick=function(a,l){var c=n.props,u=c.onClick,d=c.expandAction;d==="click"&&n.triggerExpandActionExpand(a,l),u==null||u(a,l)},n.onNodeDoubleClick=function(a,l){var c=n.props,u=c.onDoubleClick,d=c.expandAction;d==="doubleClick"&&n.triggerExpandActionExpand(a,l),u==null||u(a,l)},n.onNodeSelect=function(a,l){var c=n.state.selectedKeys,u=n.state,d=u.keyEntities,h=u.fieldNames,f=n.props,g=f.onSelect,p=f.multiple,v=l.selected,m=l[h.key],_=!v;_?p?c=Lg(c,m):c=[m]:c=Xh(c,m);var y=c.map(function(S){var L=d[S];return L?L.node:null}).filter(function(S){return S});n.setUncontrolledState({selectedKeys:c}),g==null||g(c,{event:"select",selected:_,node:l,selectedNodes:y,nativeEvent:a.nativeEvent})},n.onNodeCheck=function(a,l,c){var u=n.state,d=u.keyEntities,h=u.checkedKeys,f=u.halfCheckedKeys,g=n.props,p=g.checkStrictly,v=g.onCheck,m=l.key,_,y={event:"check",node:l,checked:c,nativeEvent:a.nativeEvent};if(p){var S=c?Lg(h,m):Xh(h,m),L=Xh(f,m);_={checked:S,halfChecked:L},y.checkedNodes=S.map(function(A){return d[A]}).filter(function(A){return A}).map(function(A){return A.node}),n.setUncontrolledState({checkedKeys:S})}else{var E=aw([].concat(ft(h),[m]),!0,d),D=E.checkedKeys,k=E.halfCheckedKeys;if(!c){var T=new Set(D);T.delete(m);var M=aw(Array.from(T),{checked:!1,halfCheckedKeys:k},d);D=M.checkedKeys,k=M.halfCheckedKeys}_=D,y.checkedNodes=[],y.checkedNodesPositions=[],y.halfCheckedKeys=k,D.forEach(function(A){var N=d[A];if(N){var R=N.node,F=N.pos;y.checkedNodes.push(R),y.checkedNodesPositions.push({node:R,pos:F})}}),n.setUncontrolledState({checkedKeys:D},!1,{halfCheckedKeys:k})}v==null||v(_,y)},n.onNodeLoad=function(a){var l=a.key,c=new Promise(function(u,d){n.setState(function(h){var f=h.loadedKeys,g=f===void 0?[]:f,p=h.loadingKeys,v=p===void 0?[]:p,m=n.props,_=m.loadData,y=m.onLoad;if(!_||g.indexOf(l)!==-1||v.indexOf(l)!==-1)return null;var S=_(a);return S.then(function(){var L=n.state.loadedKeys,E=Lg(L,l);y==null||y(E,{event:"load",node:a}),n.setUncontrolledState({loadedKeys:E}),n.setState(function(D){return{loadingKeys:Xh(D.loadingKeys,l)}}),u()}).catch(function(L){if(n.setState(function(D){return{loadingKeys:Xh(D.loadingKeys,l)}}),n.loadingRetryTimes[l]=(n.loadingRetryTimes[l]||0)+1,n.loadingRetryTimes[l]>=nDt){var E=n.state.loadedKeys;ao(!1,"Retry for `loadData` many times but still failed. No more retry."),n.setUncontrolledState({loadedKeys:Lg(E,l)}),u()}d(L)}),{loadingKeys:Lg(v,l)}})});return c.catch(function(){}),c},n.onNodeMouseEnter=function(a,l){var c=n.props.onMouseEnter;c==null||c({event:a,node:l})},n.onNodeMouseLeave=function(a,l){var c=n.props.onMouseLeave;c==null||c({event:a,node:l})},n.onNodeContextMenu=function(a,l){var c=n.props.onRightClick;c&&(a.preventDefault(),c({event:a,node:l}))},n.onFocus=function(){var a=n.props.onFocus;n.setState({focused:!0});for(var l=arguments.length,c=new Array(l),u=0;u1&&arguments[1]!==void 0?arguments[1]:!1,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!n.destroyed){var u=!1,d=!0,h={};Object.keys(a).forEach(function(f){if(f in n.props){d=!1;return}u=!0,h[f]=a[f]}),u&&(!l||d)&&n.setState(te(te({},h),c))}},n.scrollTo=function(a){n.listRef.current.scrollTo(a)},n}return _s(t,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var r=this.props.activeKey;r!==void 0&&r!==this.state.activeKey&&(this.setState({activeKey:r}),r!==null&&this.scrollTo({key:r}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var r,o=this.state,s=o.focused,a=o.flattenNodes,l=o.keyEntities,c=o.draggingNodeKey,u=o.activeKey,d=o.dropLevelOffset,h=o.dropContainerKey,f=o.dropTargetKey,g=o.dropPosition,p=o.dragOverNodeKey,v=o.indent,m=this.props,_=m.prefixCls,y=m.className,S=m.style,L=m.showLine,E=m.focusable,D=m.tabIndex,k=D===void 0?0:D,T=m.selectable,M=m.showIcon,A=m.icon,N=m.switcherIcon,R=m.draggable,F=m.checkable,W=m.checkStrictly,H=m.disabled,G=m.motion,U=m.loadData,K=m.filterTreeNode,re=m.height,Y=m.itemHeight,J=m.virtual,Q=m.titleRender,ue=m.dropIndicatorRender,de=m.onContextMenu,_e=m.onScroll,ve=m.direction,Ve=m.rootClassName,Ze=m.rootStyle,We=Wp(this.props,{aria:!0,data:!0}),pe;return R&&(zn(R)==="object"?pe=R:typeof R=="function"?pe={nodeDraggable:R}:pe={}),C.createElement(wQ.Provider,{value:{prefixCls:_,selectable:T,showIcon:M,icon:A,switcherIcon:N,draggable:pe,draggingNodeKey:c,checkable:F,checkStrictly:W,disabled:H,keyEntities:l,dropLevelOffset:d,dropContainerKey:h,dropTargetKey:f,dropPosition:g,dragOverNodeKey:p,indent:v,direction:ve,dropIndicatorRender:ue,loadData:U,filterTreeNode:K,titleRender:Q,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},C.createElement("div",{role:"tree",className:xe(_,y,Ve,(r={},be(r,"".concat(_,"-show-line"),L),be(r,"".concat(_,"-focused"),s),be(r,"".concat(_,"-active-focused"),u!==null),r)),style:Ze},C.createElement(dEe,St({ref:this.listRef,prefixCls:_,style:S,data:a,disabled:H,selectable:T,checkable:!!F,motion:G,dragging:c!==null,height:re,itemHeight:Y,virtual:J,focusable:E,focused:s,tabIndex:k,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:de,onScroll:_e},this.getTreeNodeRequiredProps(),We))))}}],[{key:"getDerivedStateFromProps",value:function(r,o){var s=o.prevProps,a={prevProps:r};function l(E){return!s&&E in r||s&&s[E]!==r[E]}var c,u=o.fieldNames;if(l("fieldNames")&&(u=rF(r.fieldNames),a.fieldNames=u),l("treeData")?c=r.treeData:l("children")&&(ao(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),c=xLe(r.children)),c){a.treeData=c;var d=xQ(c,{fieldNames:u});a.keyEntities=te(be({},rC,uEe),d.keyEntities)}var h=a.keyEntities||o.keyEntities;if(l("expandedKeys")||s&&l("autoExpandParent"))a.expandedKeys=r.autoExpandParent||!s&&r.defaultExpandParent?SK(r.expandedKeys,h):r.expandedKeys;else if(!s&&r.defaultExpandAll){var f=te({},h);delete f[rC],a.expandedKeys=Object.keys(f).map(function(E){return f[E].key})}else!s&&r.defaultExpandedKeys&&(a.expandedKeys=r.autoExpandParent||r.defaultExpandParent?SK(r.defaultExpandedKeys,h):r.defaultExpandedKeys);if(a.expandedKeys||delete a.expandedKeys,c||a.expandedKeys){var g=T7(c||o.treeData,a.expandedKeys||o.expandedKeys,u);a.flattenNodes=g}if(r.selectable&&(l("selectedKeys")?a.selectedKeys=Gue(r.selectedKeys,r):!s&&r.defaultSelectedKeys&&(a.selectedKeys=Gue(r.defaultSelectedKeys,r))),r.checkable){var p;if(l("checkedKeys")?p=k7(r.checkedKeys)||{}:!s&&r.defaultCheckedKeys?p=k7(r.defaultCheckedKeys)||{}:c&&(p=k7(r.checkedKeys)||{checkedKeys:o.checkedKeys,halfCheckedKeys:o.halfCheckedKeys}),p){var v=p,m=v.checkedKeys,_=m===void 0?[]:m,y=v.halfCheckedKeys,S=y===void 0?[]:y;if(!r.checkStrictly){var L=aw(_,!0,h);_=L.checkedKeys,S=L.halfCheckedKeys}a.checkedKeys=_,a.halfCheckedKeys=S}}return l("loadedKeys")&&(a.loadedKeys=r.loadedKeys),a}}]),t}(C.Component);AQ.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:tDt,allowDrop:function(){return!0},expandAction:!1};AQ.TreeNode=mS;const iDt=new mi("ant-tree-node-fx-do-not-use",{"0%":{opacity:0},"100%":{opacity:1}}),rDt=(i,e)=>({[`.${i}-switcher-icon`]:{display:"inline-block",fontSize:10,verticalAlign:"baseline",svg:{transition:`transform ${e.motionDurationSlow}`}}}),oDt=(i,e)=>({[`.${i}-drop-indicator`]:{position:"absolute",zIndex:1,height:2,backgroundColor:e.colorPrimary,borderRadius:1,pointerEvents:"none","&:after":{position:"absolute",top:-3,insetInlineStart:-6,width:8,height:8,backgroundColor:"transparent",border:`${e.lineWidthBold}px solid ${e.colorPrimary}`,borderRadius:"50%",content:'""'}}}),sDt=(i,e)=>{const{treeCls:t,treeNodeCls:n,treeNodePadding:r,treeTitleHeight:o}=e,s=(o-e.fontSizeLG)/2,a=e.paddingXS;return{[t]:Object.assign(Object.assign({},Wr(e)),{background:e.colorBgContainer,borderRadius:e.borderRadius,transition:`background-color ${e.motionDurationSlow}`,[`&${t}-rtl`]:{[`${t}-switcher`]:{"&_close":{[`${t}-switcher-icon`]:{svg:{transform:"rotate(90deg)"}}}}},[`&-focused:not(:hover):not(${t}-active-focused)`]:Object.assign({},Fp(e)),[`${t}-list-holder-inner`]:{alignItems:"flex-start"},[`&${t}-block-node`]:{[`${t}-list-holder-inner`]:{alignItems:"stretch",[`${t}-node-content-wrapper`]:{flex:"auto"},[`${n}.dragging`]:{position:"relative","&:after":{position:"absolute",top:0,insetInlineEnd:0,bottom:r,insetInlineStart:0,border:`1px solid ${e.colorPrimary}`,opacity:0,animationName:iDt,animationDuration:e.motionDurationSlow,animationPlayState:"running",animationFillMode:"forwards",content:'""',pointerEvents:"none"}}}},[`${n}`]:{display:"flex",alignItems:"flex-start",padding:`0 0 ${r}px 0`,outline:"none","&-rtl":{direction:"rtl"},"&-disabled":{[`${t}-node-content-wrapper`]:{color:e.colorTextDisabled,cursor:"not-allowed","&:hover":{background:"transparent"}}},[`&-active ${t}-node-content-wrapper`]:Object.assign({},Fp(e)),[`&:not(${n}-disabled).filter-node ${t}-title`]:{color:"inherit",fontWeight:500},"&-draggable":{[`${t}-draggable-icon`]:{width:o,lineHeight:`${o}px`,textAlign:"center",visibility:"visible",opacity:.2,transition:`opacity ${e.motionDurationSlow}`,[`${n}:hover &`]:{opacity:.45}},[`&${n}-disabled`]:{[`${t}-draggable-icon`]:{visibility:"hidden"}}}},[`${t}-indent`]:{alignSelf:"stretch",whiteSpace:"nowrap",userSelect:"none","&-unit":{display:"inline-block",width:o}},[`${t}-draggable-icon`]:{visibility:"hidden"},[`${t}-switcher`]:Object.assign(Object.assign({},rDt(i,e)),{position:"relative",flex:"none",alignSelf:"stretch",width:o,margin:0,lineHeight:`${o}px`,textAlign:"center",cursor:"pointer",userSelect:"none","&-noop":{cursor:"default"},"&_close":{[`${t}-switcher-icon`]:{svg:{transform:"rotate(-90deg)"}}},"&-loading-icon":{color:e.colorPrimary},"&-leaf-line":{position:"relative",zIndex:1,display:"inline-block",width:"100%",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:o/2,bottom:-r,marginInlineStart:-1,borderInlineEnd:`1px solid ${e.colorBorder}`,content:'""'},"&:after":{position:"absolute",width:o/2*.8,height:o/2,borderBottom:`1px solid ${e.colorBorder}`,content:'""'}}}),[`${t}-checkbox`]:{top:"initial",marginInlineEnd:a,marginBlockStart:s},[`${t}-node-content-wrapper, ${t}-checkbox + span`]:{position:"relative",zIndex:"auto",minHeight:o,margin:0,padding:`0 ${e.paddingXS/2}px`,color:"inherit",lineHeight:`${o}px`,background:"transparent",borderRadius:e.borderRadius,cursor:"pointer",transition:`all ${e.motionDurationMid}, border 0s, line-height 0s, box-shadow 0s`,"&:hover":{backgroundColor:e.controlItemBgHover},[`&${t}-node-selected`]:{backgroundColor:e.controlItemBgActive},[`${t}-iconEle`]:{display:"inline-block",width:o,height:o,lineHeight:`${o}px`,textAlign:"center",verticalAlign:"top","&:empty":{display:"none"}}},[`${t}-unselectable ${t}-node-content-wrapper:hover`]:{backgroundColor:"transparent"},[`${t}-node-content-wrapper`]:Object.assign({lineHeight:`${o}px`,userSelect:"none"},oDt(i,e)),[`${n}.drop-container`]:{"> [draggable]":{boxShadow:`0 0 0 2px ${e.colorPrimary}`}},"&-show-line":{[`${t}-indent`]:{"&-unit":{position:"relative",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:o/2,bottom:-r,borderInlineEnd:`1px solid ${e.colorBorder}`,content:'""'},"&-end":{"&:before":{display:"none"}}}},[`${t}-switcher`]:{background:"transparent","&-line-icon":{verticalAlign:"-0.15em"}}},[`${n}-leaf-last`]:{[`${t}-switcher`]:{"&-leaf-line":{"&:before":{top:"auto !important",bottom:"auto !important",height:`${o/2}px !important`}}}}})}},aDt=i=>{const{treeCls:e,treeNodeCls:t,treeNodePadding:n}=i;return{[`${e}${e}-directory`]:{[t]:{position:"relative","&:before":{position:"absolute",top:0,insetInlineEnd:0,bottom:n,insetInlineStart:0,transition:`background-color ${i.motionDurationMid}`,content:'""',pointerEvents:"none"},"&:hover":{"&:before":{background:i.controlItemBgHover}},"> *":{zIndex:1},[`${e}-switcher`]:{transition:`color ${i.motionDurationMid}`},[`${e}-node-content-wrapper`]:{borderRadius:0,userSelect:"none","&:hover":{background:"transparent"},[`&${e}-node-selected`]:{color:i.colorTextLightSolid,background:"transparent"}},"&-selected":{[` &:hover::before, &::before - `]:{background:i.colorPrimary},[`${e}-switcher`]:{color:i.colorTextLightSolid},[`${e}-node-content-wrapper`]:{color:i.colorTextLightSolid,background:"transparent"}}}}}},lDt=(i,e)=>{const t=`.${i}`,n=`${t}-treenode`,r=e.paddingXS/2,o=e.controlHeightSM,s=Oi(e,{treeCls:t,treeNodeCls:n,treeNodePadding:r,treeTitleHeight:o});return[sDt(i,s),aDt(s)]},cDt=vo("Tree",(i,e)=>{let{prefixCls:t}=e;return[{[i.componentCls]:LLe(`${t}-checkbox`,i)},lDt(t,i),WSe(i)]}),gde=4;function uDt(i){const{dropPosition:e,dropLevelOffset:t,prefixCls:n,indent:r,direction:o="ltr"}=i,s=o==="ltr"?"left":"right",a=o==="ltr"?"right":"left",l={[s]:-t*r+gde,[a]:0};switch(e){case-1:l.top=-3;break;case 1:l.bottom=-3;break;default:l.bottom=-3,l[s]=r+gde;break}return $e.createElement("div",{style:l,className:`${n}-drop-indicator`})}const dDt=i=>{const{prefixCls:e,switcherIcon:t,treeNodeProps:n,showLine:r}=i,{isLeaf:o,expanded:s,loading:a}=n;if(a)return C.createElement(ek,{className:`${e}-switcher-loading-icon`});let l;if(r&&typeof r=="object"&&(l=r.showLeafIcon),o){if(!r)return null;if(typeof l!="boolean"&&l){const d=typeof l=="function"?l(n):l,h=`${e}-switcher-line-custom-icon`;return bh(d)?Qs(d,{className:xe(d.props.className||"",h)}):d}return l?C.createElement(twe,{className:`${e}-switcher-line-icon`}):C.createElement("span",{className:`${e}-switcher-leaf-line`})}const c=`${e}-switcher-icon`,u=typeof t=="function"?t(n):t;return bh(u)?Qs(u,{className:xe(u.props.className||"",c)}):u!==void 0?u:r?s?C.createElement(_ft,{className:`${e}-switcher-line-icon`}):C.createElement(yft,{className:`${e}-switcher-line-icon`}):C.createElement(uht,{className:c})},hDt=dDt,fDt=$e.forwardRef((i,e)=>{const{getPrefixCls:t,direction:n,virtual:r}=$e.useContext(Rn),{prefixCls:o,className:s,showIcon:a=!1,showLine:l,switcherIcon:c,blockNode:u=!1,children:d,checkable:h=!1,selectable:f=!0,draggable:g,motion:p}=i,v=t("tree",o),m=t(),_=p??Object.assign(Object.assign({},NSe(m)),{motionAppear:!1}),y=Object.assign(Object.assign({},i),{checkable:h,selectable:f,showIcon:a,motion:_,blockNode:u,showLine:!!l,dropIndicatorRender:uDt}),[S,L]=cDt(v),E=$e.useMemo(()=>{if(!g)return!1;let k={};switch(typeof g){case"function":k.nodeDraggable=g;break;case"object":k=Object.assign({},g);break}return k.icon!==!1&&(k.icon=k.icon||$e.createElement(aft,null)),k},[g]),D=k=>$e.createElement(hDt,{prefixCls:v,switcherIcon:c,treeNodeProps:k,showLine:l});return S($e.createElement(AQ,Object.assign({itemHeight:20,ref:e,virtual:r},y,{prefixCls:v,className:xe({[`${v}-icon-hide`]:!a,[`${v}-block-node`]:u,[`${v}-unselectable`]:!f,[`${v}-rtl`]:n==="rtl"},s,L),direction:n,checkable:h&&$e.createElement("span",{className:`${v}-checkbox-inner`}),selectable:f,switcherIcon:D,draggable:E}),d))}),hEe=fDt;var Ng;(function(i){i[i.None=0]="None",i[i.Start=1]="Start",i[i.End=2]="End"})(Ng||(Ng={}));function PQ(i,e){function t(n){const{key:r,children:o}=n;e(r,n)!==!1&&PQ(o||[],e)}i.forEach(t)}function gDt(i){let{treeData:e,expandedKeys:t,startKey:n,endKey:r}=i;const o=[];let s=Ng.None;if(n&&n===r)return[n];if(!n||!r)return[];function a(l){return l===n||l===r}return PQ(e,l=>{if(s===Ng.End)return!1;if(a(l)){if(o.push(l),s===Ng.None)s=Ng.Start;else if(s===Ng.Start)return s=Ng.End,!1}else s===Ng.Start&&o.push(l);return t.includes(l)}),o}function B7(i,e){const t=ft(e),n=[];return PQ(i,(r,o)=>{const s=t.indexOf(r);return s!==-1&&(n.push(o),t.splice(s,1)),!!t.length}),n}var pde=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var{defaultExpandAll:t,defaultExpandParent:n,defaultExpandedKeys:r}=i,o=pde(i,["defaultExpandAll","defaultExpandParent","defaultExpandedKeys"]);const s=C.useRef(),a=C.useRef(),l=()=>{const{keyEntities:k}=xQ(mde(o));let T;return t?T=Object.keys(k):n?T=SK(o.expandedKeys||r||[],k):T=o.expandedKeys||r,T},[c,u]=C.useState(o.selectedKeys||o.defaultSelectedKeys||[]),[d,h]=C.useState(()=>l());C.useEffect(()=>{"selectedKeys"in o&&u(o.selectedKeys)},[o.selectedKeys]),C.useEffect(()=>{"expandedKeys"in o&&h(o.expandedKeys)},[o.expandedKeys]);const f=(k,T)=>{var M;return"expandedKeys"in o||h(k),(M=o.onExpand)===null||M===void 0?void 0:M.call(o,k,T)},g=(k,T)=>{var M;const{multiple:A}=o,{node:N,nativeEvent:R}=T,{key:F=""}=N,W=mde(o),H=Object.assign(Object.assign({},T),{selected:!0}),G=(R==null?void 0:R.ctrlKey)||(R==null?void 0:R.metaKey),U=R==null?void 0:R.shiftKey;let K;A&&G?(K=k,s.current=F,a.current=K,H.selectedNodes=B7(W,K)):A&&U?(K=Array.from(new Set([].concat(ft(a.current||[]),ft(gDt({treeData:W,expandedKeys:d,startKey:F,endKey:s.current}))))),H.selectedNodes=B7(W,K)):(K=[F],s.current=F,a.current=K,H.selectedNodes=B7(W,K)),(M=o.onSelect)===null||M===void 0||M.call(o,K,H),"selectedKeys"in o||u(K)},{getPrefixCls:p,direction:v}=C.useContext(Rn),{prefixCls:m,className:_,showIcon:y=!0,expandAction:S="click"}=o,L=pde(o,["prefixCls","className","showIcon","expandAction"]),E=p("tree",m),D=xe(`${E}-directory`,{[`${E}-directory-rtl`]:v==="rtl"},_);return C.createElement(hEe,Object.assign({icon:pDt,ref:e,blockNode:!0},L,{showIcon:y,expandAction:S,prefixCls:E,className:D,expandedKeys:d,selectedKeys:c,onSelect:g,onExpand:f}))},vDt=C.forwardRef(mDt),_Dt=vDt,OQ=hEe;OQ.DirectoryTree=_Dt;OQ.TreeNode=mS;const bDt=OQ;function CDt(i){const e=C.useRef(i),t=bxe();return[()=>e.current,n=>{e.current=n,t()}]}function vde(i){let{value:e,onChange:t,filterSearch:n,tablePrefixCls:r,locale:o}=i;return n?C.createElement("div",{className:`${r}-filter-dropdown-search`},C.createElement(Lxt,{prefix:C.createElement(IZ,null),placeholder:o.filterSearchPlaceholder,onChange:t,value:e,htmlSize:1,className:`${r}-filter-dropdown-search-input`})):null}const yDt=i=>{const{keyCode:e}=i;e===vt.ENTER&&i.stopPropagation()},wDt=i=>C.createElement("div",{className:i.className,onClick:e=>e.stopPropagation(),onKeyDown:yDt},i.children),SDt=wDt;function xDt(i){return i.some(e=>{let{children:t}=e;return t})}function fEe(i,e){return typeof e=="string"||typeof e=="number"?e==null?void 0:e.toString().toLowerCase().includes(i.trim().toLowerCase()):!1}function gEe(i){let{filters:e,prefixCls:t,filteredKeys:n,filterMultiple:r,searchValue:o,filterSearch:s}=i;return e.map((a,l)=>{const c=String(a.value);if(a.children)return{key:c||l,label:a.text,popupClassName:`${t}-dropdown-submenu`,children:gEe({filters:a.children,prefixCls:t,filteredKeys:n,filterMultiple:r,searchValue:o,filterSearch:s})};const u=r?oF:_Le,d={key:a.value!==void 0?c:l,label:C.createElement(C.Fragment,null,C.createElement(u,{checked:n.includes(c)}),C.createElement("span",null,a.text))};return o.trim()?typeof s=="function"?s(o,a)?d:null:fEe(o,a.text)?d:null:d})}function LDt(i){var e,t;const{tablePrefixCls:n,prefixCls:r,column:o,dropdownPrefixCls:s,columnKey:a,filterMultiple:l,filterMode:c="menu",filterSearch:u=!1,filterState:d,triggerFilter:h,locale:f,children:g,getPopupContainer:p}=i,{filterDropdownOpen:v,onFilterDropdownOpenChange:m,filterResetToDefaultFilteredValue:_,defaultFilteredValue:y,filterDropdownVisible:S,onFilterDropdownVisibleChange:L}=o,[E,D]=C.useState(!1),k=!!(d&&(!((e=d.filteredKeys)===null||e===void 0)&&e.length||d.forceFiltered)),T=Me=>{D(Me),m==null||m(Me),L==null||L(Me)},M=(t=v??S)!==null&&t!==void 0?t:E,A=d==null?void 0:d.filteredKeys,[N,R]=CDt(A||[]),F=Me=>{let{selectedKeys:Qe}=Me;R(Qe)},W=(Me,Qe)=>{let{node:Ke,checked:Re}=Qe;F(l?{selectedKeys:Me}:{selectedKeys:Re&&Ke.key?[Ke.key]:[]})};C.useEffect(()=>{E&&F({selectedKeys:A||[]})},[A]);const[H,G]=C.useState([]),U=Me=>{G(Me)},[K,re]=C.useState(""),Y=Me=>{const{value:Qe}=Me.target;re(Qe)};C.useEffect(()=>{E||re("")},[E]);const J=Me=>{const Qe=Me&&Me.length?Me:null;if(Qe===null&&(!d||!d.filteredKeys)||Pp(Qe,d==null?void 0:d.filteredKeys,!0))return null;h({column:o,key:a,filteredKeys:Qe})},Q=()=>{T(!1),J(N())},ue=function(){let{confirm:Me,closeDropdown:Qe}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{confirm:!1,closeDropdown:!1};Me&&J([]),Qe&&T(!1),re(""),R(_?(y||[]).map(Ke=>String(Ke)):[])},de=function(){let{closeDropdown:Me}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{closeDropdown:!0};Me&&T(!1),J(N())},_e=Me=>{Me&&A!==void 0&&R(A||[]),T(Me),!Me&&!o.filterDropdown&&Q()},ve=xe({[`${s}-menu-without-submenu`]:!xDt(o.filters||[])}),Ve=Me=>{if(Me.target.checked){const Qe=lw(o==null?void 0:o.filters).map(Ke=>String(Ke));R(Qe)}else R([])},Ze=Me=>{let{filters:Qe}=Me;return(Qe||[]).map((Ke,Re)=>{const ct=String(Ke.value),ie={title:Ke.text,key:Ke.value!==void 0?ct:Re};return Ke.children&&(ie.children=Ze({filters:Ke.children})),ie})},We=Me=>{var Qe;return Object.assign(Object.assign({},Me),{text:Me.title,value:Me.key,children:((Qe=Me.children)===null||Qe===void 0?void 0:Qe.map(Ke=>We(Ke)))||[]})};let pe;if(typeof o.filterDropdown=="function")pe=o.filterDropdown({prefixCls:`${s}-custom`,setSelectedKeys:Me=>F({selectedKeys:Me}),selectedKeys:N(),confirm:de,clearFilters:ue,filters:o.filters,visible:M,close:()=>{T(!1)}});else if(o.filterDropdown)pe=o.filterDropdown;else{const Me=N()||[],Qe=()=>(o.filters||[]).length===0?C.createElement(A0,{image:A0.PRESENTED_IMAGE_SIMPLE,description:f.filterEmptyText,imageStyle:{height:24},style:{margin:0,padding:"16px 0"}}):c==="tree"?C.createElement(C.Fragment,null,C.createElement(vde,{filterSearch:u,value:K,onChange:Y,tablePrefixCls:n,locale:f}),C.createElement("div",{className:`${n}-filter-dropdown-tree`},l?C.createElement(oF,{checked:Me.length===lw(o.filters).length,indeterminate:Me.length>0&&Me.lengthtypeof u=="function"?u(K,We(Re)):fEe(K,Re.title):void 0}))):C.createElement(C.Fragment,null,C.createElement(vde,{filterSearch:u,value:K,onChange:Y,tablePrefixCls:n,locale:f}),C.createElement(vQ,{selectable:!0,multiple:l,prefixCls:`${s}-menu`,className:ve,onSelect:F,onDeselect:F,selectedKeys:Me,getPopupContainer:p,openKeys:H,onOpenChange:U,items:gEe({filters:o.filters||[],filterSearch:u,prefixCls:r,filteredKeys:N(),filterMultiple:l,searchValue:K})})),Ke=()=>_?Pp((y||[]).map(Re=>String(Re)),Me,!0):Me.length===0;pe=C.createElement(C.Fragment,null,Qe(),C.createElement("div",{className:`${r}-dropdown-btns`},C.createElement(Ju,{type:"link",size:"small",disabled:Ke(),onClick:()=>ue()},f.filterReset),C.createElement(Ju,{type:"primary",size:"small",onClick:Q},f.filterConfirm)))}o.filterDropdown&&(pe=C.createElement(rLe,{selectable:void 0},pe));const Pe=()=>C.createElement(SDt,{className:`${r}-dropdown`},pe);let Se;typeof o.filterIcon=="function"?Se=o.filterIcon(k):o.filterIcon?Se=o.filterIcon:Se=C.createElement(Yht,null);const{direction:Ne}=C.useContext(Rn);return C.createElement("div",{className:`${r}-column`},C.createElement("span",{className:`${n}-column-title`},g),C.createElement(hk,{dropdownRender:Pe,trigger:["click"],open:M,onOpenChange:_e,getPopupContainer:p,placement:Ne==="rtl"?"bottomLeft":"bottomRight"},C.createElement("span",{role:"button",tabIndex:-1,className:xe(`${r}-trigger`,{active:k}),onClick:Me=>{Me.stopPropagation()}},Se)))}function RK(i,e,t){let n=[];return(i||[]).forEach((r,o)=>{var s;const a=WT(o,t);if(r.filters||"filterDropdown"in r||"onFilter"in r)if("filteredValue"in r){let l=r.filteredValue;"filterDropdown"in r||(l=(s=l==null?void 0:l.map(String))!==null&&s!==void 0?s:l),n.push({column:r,key:iC(r,a),filteredKeys:l,forceFiltered:r.filtered})}else n.push({column:r,key:iC(r,a),filteredKeys:e&&r.defaultFilteredValue?r.defaultFilteredValue:void 0,forceFiltered:r.filtered});"children"in r&&(n=[].concat(ft(n),ft(RK(r.children,e,a))))}),n}function pEe(i,e,t,n,r,o,s,a){return t.map((l,c)=>{const u=WT(c,a),{filterMultiple:d=!0,filterMode:h,filterSearch:f}=l;let g=l;if(g.filters||g.filterDropdown){const p=iC(g,u),v=n.find(m=>{let{key:_}=m;return p===_});g=Object.assign(Object.assign({},g),{title:m=>C.createElement(LDt,{tablePrefixCls:i,prefixCls:`${i}-filter`,dropdownPrefixCls:e,column:g,columnKey:p,filterState:v,filterMultiple:d,filterMode:h,filterSearch:f,triggerFilter:o,locale:r,getPopupContainer:s},tB(l.title,m))})}return"children"in g&&(g=Object.assign(Object.assign({},g),{children:pEe(i,e,g.children,n,r,o,s,u)})),g})}function lw(i){let e=[];return(i||[]).forEach(t=>{let{value:n,children:r}=t;e.push(n),r&&(e=[].concat(ft(e),ft(lw(r))))}),e}function _de(i){const e={};return i.forEach(t=>{let{key:n,filteredKeys:r,column:o}=t;const{filters:s,filterDropdown:a}=o;if(a)e[n]=r||null;else if(Array.isArray(r)){const l=lw(s);e[n]=l.filter(c=>r.includes(String(c)))}else e[n]=null}),e}function bde(i,e){return e.reduce((t,n)=>{const{column:{onFilter:r,filters:o},filteredKeys:s}=n;return r&&s&&s.length?t.filter(a=>s.some(l=>{const c=lw(o),u=c.findIndex(h=>String(h)===String(l)),d=u!==-1?c[u]:l;return r(d,a)})):t},i)}const mEe=i=>i.flatMap(e=>"children"in e?[e].concat(ft(mEe(e.children||[]))):[e]);function EDt(i){let{prefixCls:e,dropdownPrefixCls:t,mergedColumns:n,onFilterChange:r,getPopupContainer:o,locale:s}=i;const a=C.useMemo(()=>mEe(n||[]),[n]),[l,c]=C.useState(()=>RK(a,!0)),u=C.useMemo(()=>{const g=RK(a,!1);if(g.length===0)return g;let p=!0;if(g.forEach(v=>{let{filteredKeys:m}=v;m!==void 0&&(p=!1)}),p){const v=(a||[]).map((m,_)=>iC(m,WT(_)));return l.filter(m=>{let{key:_}=m;return v.includes(_)}).map(m=>{const _=a[v.findIndex(y=>y===m.key)];return Object.assign(Object.assign({},m),{column:Object.assign(Object.assign({},m.column),_),forceFiltered:_.filtered})})}return g},[a,l]),d=C.useMemo(()=>_de(u),[u]),h=g=>{const p=u.filter(v=>{let{key:m}=v;return m!==g.key});p.push(g),c(p),r(_de(p),p)};return[g=>pEe(e,t,g,u,s,h,o),u,d]}function DDt(i,e,t){const n=C.useRef({});function r(o){if(!n.current||n.current.data!==i||n.current.childrenColumnName!==e||n.current.getRowKey!==t){let a=function(l){l.forEach((c,u)=>{const d=t(c,u);s.set(d,c),c&&typeof c=="object"&&e in c&&a(c[e]||[])})};const s=new Map;a(i),n.current={data:i,childrenColumnName:e,kvMap:s,getRowKey:t}}return n.current.kvMap.get(o)}return[r]}var IDt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const o=i[r];typeof o!="function"&&(t[r]=o)}),t}function TDt(i,e,t){const n=t&&typeof t=="object"?t:{},{total:r=0}=n,o=IDt(n,["total"]),[s,a]=C.useState(()=>({current:"defaultCurrent"in o?o.defaultCurrent:1,pageSize:"defaultPageSize"in o?o.defaultPageSize:vEe})),l=zLe(s,o,{total:r>0?r:i}),c=Math.ceil((r||i)/l.pageSize);l.current>c&&(l.current=c||1);const u=(h,f)=>{a({current:h??1,pageSize:f||l.pageSize})},d=(h,f)=>{var g;t&&((g=t.onChange)===null||g===void 0||g.call(t,h,f)),u(h,f),e(h,f||(l==null?void 0:l.pageSize))};return t===!1?[{},()=>{}]:[Object.assign(Object.assign({},l),{onChange:d}),u]}const xm={},MK="SELECT_ALL",AK="SELECT_INVERT",PK="SELECT_NONE",Cde=[],_Ee=(i,e)=>{let t=[];return(e||[]).forEach(n=>{t.push(n),n&&typeof n=="object"&&i in n&&(t=[].concat(ft(t),ft(_Ee(i,n[i]))))}),t},NDt=(i,e)=>{const{preserveSelectedRowKeys:t,selectedRowKeys:n,defaultSelectedRowKeys:r,getCheckboxProps:o,onChange:s,onSelect:a,onSelectAll:l,onSelectInvert:c,onSelectNone:u,onSelectMultiple:d,columnWidth:h,type:f,selections:g,fixed:p,renderCell:v,hideSelectAll:m,checkStrictly:_=!0}=e||{},{prefixCls:y,data:S,pageData:L,getRecordByKey:E,getRowKey:D,expandType:k,childrenColumnName:T,locale:M,getPopupContainer:A}=i,[N,R]=Ja(n||r||Cde,{value:n}),F=C.useRef(new Map),W=C.useCallback(We=>{if(t){const pe=new Map;We.forEach(Pe=>{let Se=E(Pe);!Se&&F.current.has(Pe)&&(Se=F.current.get(Pe)),pe.set(Pe,Se)}),F.current=pe}},[E,t]);C.useEffect(()=>{W(N)},[N]);const{keyEntities:H}=C.useMemo(()=>_?{keyEntities:null}:xQ(S,{externalGetKey:D,childrenPropName:T}),[S,D,_,T]),G=C.useMemo(()=>_Ee(T,L),[T,L]),U=C.useMemo(()=>{const We=new Map;return G.forEach((pe,Pe)=>{const Se=D(pe,Pe),Ne=(o?o(pe):null)||{};We.set(Se,Ne)}),We},[G,D,o]),K=C.useCallback(We=>{var pe;return!!(!((pe=U.get(D(We)))===null||pe===void 0)&&pe.disabled)},[U,D]),[re,Y]=C.useMemo(()=>{if(_)return[N||[],[]];const{checkedKeys:We,halfCheckedKeys:pe}=aw(N,!0,H,K);return[We||[],pe]},[N,_,H,K]),J=C.useMemo(()=>{const We=f==="radio"?re.slice(0,1):re;return new Set(We)},[re,f]),Q=C.useMemo(()=>f==="radio"?new Set:new Set(Y),[Y,f]),[ue,de]=C.useState(null);C.useEffect(()=>{e||R(Cde)},[!!e]);const _e=C.useCallback((We,pe)=>{let Pe,Se;W(We),t?(Pe=We,Se=We.map(Ne=>F.current.get(Ne))):(Pe=[],Se=[],We.forEach(Ne=>{const Me=E(Ne);Me!==void 0&&(Pe.push(Ne),Se.push(Me))})),R(Pe),s==null||s(Pe,Se,{type:pe})},[R,E,s,t]),ve=C.useCallback((We,pe,Pe,Se)=>{if(a){const Ne=Pe.map(Me=>E(Me));a(E(We),pe,Ne,Se)}_e(Pe,"single")},[a,E,_e]),Ve=C.useMemo(()=>!g||m?null:(g===!0?[MK,AK,PK]:g).map(pe=>pe===MK?{key:"all",text:M.selectionAll,onSelect(){_e(S.map((Pe,Se)=>D(Pe,Se)).filter(Pe=>{const Se=U.get(Pe);return!(Se!=null&&Se.disabled)||J.has(Pe)}),"all")}}:pe===AK?{key:"invert",text:M.selectInvert,onSelect(){const Pe=new Set(J);L.forEach((Ne,Me)=>{const Qe=D(Ne,Me),Ke=U.get(Qe);Ke!=null&&Ke.disabled||(Pe.has(Qe)?Pe.delete(Qe):Pe.add(Qe))});const Se=Array.from(Pe);c&&c(Se),_e(Se,"invert")}}:pe===PK?{key:"none",text:M.selectNone,onSelect(){u==null||u(),_e(Array.from(J).filter(Pe=>{const Se=U.get(Pe);return Se==null?void 0:Se.disabled}),"none")}}:pe).map(pe=>Object.assign(Object.assign({},pe),{onSelect:function(){for(var Pe,Se,Ne=arguments.length,Me=new Array(Ne),Qe=0;Qe{var pe;if(!e)return We.filter(he=>he!==xm);let Pe=ft(We);const Se=new Set(J),Ne=G.map(D).filter(he=>!U.get(he).disabled),Me=Ne.every(he=>Se.has(he)),Qe=Ne.some(he=>Se.has(he)),Ke=()=>{const he=[];Me?Ne.forEach(Fe=>{Se.delete(Fe),he.push(Fe)}):Ne.forEach(Fe=>{Se.has(Fe)||(Se.add(Fe),he.push(Fe))});const Le=Array.from(Se);l==null||l(!Me,Le.map(Fe=>E(Fe)),he.map(Fe=>E(Fe))),_e(Le,"all"),de(null)};let Re;if(f!=="radio"){let he;if(Ve){const nt={getPopupContainer:A,items:Ve.map((it,at)=>{const{key:tt,text:Zt,onSelect:Tt}=it;return{key:tt??at,onClick:()=>{Tt==null||Tt(Ne)},label:Zt}})};he=C.createElement("div",{className:`${y}-selection-extra`},C.createElement(hk,{menu:nt,getPopupContainer:A},C.createElement("span",null,C.createElement(DZ,null))))}const Le=G.map((nt,it)=>{const at=D(nt,it),tt=U.get(at)||{};return Object.assign({checked:Se.has(at)},tt)}).filter(nt=>{let{disabled:it}=nt;return it}),Fe=!!Le.length&&Le.length===G.length,ze=Fe&&Le.every(nt=>{let{checked:it}=nt;return it}),Ue=Fe&&Le.some(nt=>{let{checked:it}=nt;return it});Re=!m&&C.createElement("div",{className:`${y}-selection`},C.createElement(oF,{checked:Fe?ze:!!G.length&&Me,indeterminate:Fe?!ze&&Ue:!Me&&Qe,onChange:Ke,disabled:G.length===0||Fe,"aria-label":he?"Custom selection":"Select all",skipGroup:!0}),he)}let ct;f==="radio"?ct=(he,Le,Fe)=>{const ze=D(Le,Fe),Ue=Se.has(ze);return{node:C.createElement(_Le,Object.assign({},U.get(ze),{checked:Ue,onClick:nt=>nt.stopPropagation(),onChange:nt=>{Se.has(ze)||ve(ze,!0,[ze],nt.nativeEvent)}})),checked:Ue}}:ct=(he,Le,Fe)=>{var ze;const Ue=D(Le,Fe),nt=Se.has(Ue),it=Q.has(Ue),at=U.get(Ue);let tt;return k==="nest"?tt=it:tt=(ze=at==null?void 0:at.indeterminate)!==null&&ze!==void 0?ze:it,{node:C.createElement(oF,Object.assign({},at,{indeterminate:tt,checked:nt,skipGroup:!0,onClick:Zt=>Zt.stopPropagation(),onChange:Zt=>{let{nativeEvent:Tt}=Zt;const{shiftKey:xn}=Tt;let rt=-1,wt=-1;if(xn&&_){const Bt=new Set([ue,Ue]);Ne.some((Nt,nn)=>{if(Bt.has(Nt))if(rt===-1)rt=nn;else return wt=nn,!0;return!1})}if(wt!==-1&&rt!==wt&&_){const Bt=Ne.slice(rt,wt+1),Nt=[];nt?Bt.forEach(Mn=>{Se.has(Mn)&&(Nt.push(Mn),Se.delete(Mn))}):Bt.forEach(Mn=>{Se.has(Mn)||(Nt.push(Mn),Se.add(Mn))});const nn=Array.from(Se);d==null||d(!nt,nn.map(Mn=>E(Mn)),Nt.map(Mn=>E(Mn))),_e(nn,"multiple")}else{const Bt=re;if(_){const Nt=nt?Xh(Bt,Ue):Lg(Bt,Ue);ve(Ue,!nt,Nt,Tt)}else{const Nt=aw([].concat(ft(Bt),[Ue]),!0,H,K),{checkedKeys:nn,halfCheckedKeys:Mn}=Nt;let zt=nn;if(nt){const Qt=new Set(nn);Qt.delete(Ue),zt=aw(Array.from(Qt),{checked:!1,halfCheckedKeys:Mn},H,K).checkedKeys}ve(Ue,!nt,zt,Tt)}}de(nt?null:Ue)}})),checked:nt}};const ie=(he,Le,Fe)=>{const{node:ze,checked:Ue}=ct(he,Le,Fe);return v?v(Ue,Le,Fe,ze):ze};if(!Pe.includes(xm))if(Pe.findIndex(he=>{var Le;return((Le=he[ZE])===null||Le===void 0?void 0:Le.columnType)==="EXPAND_COLUMN"})===0){const[he,...Le]=Pe;Pe=[he,xm].concat(ft(Le))}else Pe=[xm].concat(ft(Pe));const le=Pe.indexOf(xm);Pe=Pe.filter((he,Le)=>he!==xm||Le===le);const ce=Pe[le-1],z=Pe[le+1];let q=p;q===void 0&&((z==null?void 0:z.fixed)!==void 0?q=z.fixed:(ce==null?void 0:ce.fixed)!==void 0&&(q=ce.fixed)),q&&ce&&((pe=ce[ZE])===null||pe===void 0?void 0:pe.columnType)==="EXPAND_COLUMN"&&ce.fixed===void 0&&(ce.fixed=q);const oe=xe(`${y}-selection-col`,{[`${y}-selection-col-with-dropdown`]:g&&f==="checkbox"}),ne={fixed:q,width:h,className:`${y}-selection-column`,title:e.columnTitle||Re,render:ie,[ZE]:{className:oe}};return Pe.map(he=>he===xm?ne:he)},[D,G,e,re,J,Q,h,Ve,k,ue,U,d,ve,K]),J]},nA="ascend",W7="descend";function uF(i){return typeof i.sorter=="object"&&typeof i.sorter.multiple=="number"?i.sorter.multiple:!1}function yde(i){return typeof i=="function"?i:i&&typeof i=="object"&&i.compare?i.compare:!1}function RDt(i,e){return e?i[i.indexOf(e)+1]:i[0]}function OK(i,e,t){let n=[];function r(o,s){n.push({column:o,key:iC(o,s),multiplePriority:uF(o),sortOrder:o.sortOrder})}return(i||[]).forEach((o,s)=>{const a=WT(s,t);o.children?("sortOrder"in o&&r(o,a),n=[].concat(ft(n),ft(OK(o.children,e,a)))):o.sorter&&("sortOrder"in o?r(o,a):e&&o.defaultSortOrder&&n.push({column:o,key:iC(o,a),multiplePriority:uF(o),sortOrder:o.defaultSortOrder}))}),n}function bEe(i,e,t,n,r,o,s,a){return(e||[]).map((l,c)=>{const u=WT(c,a);let d=l;if(d.sorter){const h=d.sortDirections||r,f=d.showSorterTooltip===void 0?s:d.showSorterTooltip,g=iC(d,u),p=t.find(T=>{let{key:M}=T;return M===g}),v=p?p.sortOrder:null,m=RDt(h,v),_=h.includes(nA)&&C.createElement(bht,{className:xe(`${i}-column-sorter-up`,{active:v===nA})}),y=h.includes(W7)&&C.createElement(fht,{className:xe(`${i}-column-sorter-down`,{active:v===W7})}),{cancelSort:S,triggerAsc:L,triggerDesc:E}=o||{};let D=S;m===W7?D=E:m===nA&&(D=L);const k=typeof f=="object"?f:{title:D};d=Object.assign(Object.assign({},d),{className:xe(d.className,{[`${i}-column-sort`]:v}),title:T=>{const M=C.createElement("div",{className:`${i}-column-sorters`},C.createElement("span",{className:`${i}-column-title`},tB(l.title,T)),C.createElement("span",{className:xe(`${i}-column-sorter`,{[`${i}-column-sorter-full`]:!!(_&&y)})},C.createElement("span",{className:`${i}-column-sorter-inner`,"aria-hidden":"true"},_,y)));return f?C.createElement(NT,Object.assign({},k),M):M},onHeaderCell:T=>{const M=l.onHeaderCell&&l.onHeaderCell(T)||{},A=M.onClick,N=M.onKeyDown;M.onClick=W=>{n({column:l,key:g,sortOrder:m,multiplePriority:uF(l)}),A==null||A(W)},M.onKeyDown=W=>{W.keyCode===vt.ENTER&&(n({column:l,key:g,sortOrder:m,multiplePriority:uF(l)}),N==null||N(W))};const R=qEt(l.title,{}),F=R==null?void 0:R.toString();return v?M["aria-sort"]=v==="ascend"?"ascending":"descending":M["aria-label"]=F||"",M.className=xe(M.className,`${i}-column-has-sorters`),M.tabIndex=0,l.ellipsis&&(M.title=(R??"").toString()),M}})}return"children"in d&&(d=Object.assign(Object.assign({},d),{children:bEe(i,d.children,t,n,r,o,s,u)})),d})}function wde(i){const{column:e,sortOrder:t}=i;return{column:e,order:t,field:e.dataIndex,columnKey:e.key}}function Sde(i){const e=i.filter(t=>{let{sortOrder:n}=t;return n}).map(wde);return e.length===0&&i.length?Object.assign(Object.assign({},wde(i[i.length-1])),{column:void 0}):e.length<=1?e[0]||{}:e}function FK(i,e,t){const n=e.slice().sort((s,a)=>a.multiplePriority-s.multiplePriority),r=i.slice(),o=n.filter(s=>{let{column:{sorter:a},sortOrder:l}=s;return yde(a)&&l});return o.length?r.sort((s,a)=>{for(let l=0;l{const a=s[t];return a?Object.assign(Object.assign({},s),{[t]:FK(a,e,t)}):s}):r}function MDt(i){let{prefixCls:e,mergedColumns:t,onSorterChange:n,sortDirections:r,tableLocale:o,showSorterTooltip:s}=i;const[a,l]=C.useState(OK(t,!0)),c=C.useMemo(()=>{let g=!0;const p=OK(t,!1);if(!p.length)return a;const v=[];function m(y){g?v.push(y):v.push(Object.assign(Object.assign({},y),{sortOrder:null}))}let _=null;return p.forEach(y=>{_===null?(m(y),y.sortOrder&&(y.multiplePriority===!1?g=!1:_=!0)):(_&&y.multiplePriority!==!1||(g=!1),m(y))}),v},[t,a]),u=C.useMemo(()=>{const g=c.map(p=>{let{column:v,sortOrder:m}=p;return{column:v,order:m}});return{sortColumns:g,sortColumn:g[0]&&g[0].column,sortOrder:g[0]&&g[0].order}},[c]);function d(g){let p;g.multiplePriority===!1||!c.length||c[0].multiplePriority===!1?p=[g]:p=[].concat(ft(c.filter(v=>{let{key:m}=v;return m!==g.key})),[g]),l(p),n(Sde(p),p)}return[g=>bEe(e,g,c,d,r,o,s),c,u,()=>Sde(c)]}function CEe(i,e){return i.map(t=>{const n=Object.assign({},t);return n.title=tB(t.title,e),"children"in n&&(n.children=CEe(n.children,e)),n})}function ADt(i){return[C.useCallback(t=>CEe(t,i),[i])]}const PDt=i=>{const{componentCls:e}=i,t=`${i.lineWidth}px ${i.lineType} ${i.tableBorderColor}`,n=(r,o,s)=>({[`&${e}-${r}`]:{[`> ${e}-container`]:{[`> ${e}-content, > ${e}-body`]:{[` + `]:{background:i.colorPrimary},[`${e}-switcher`]:{color:i.colorTextLightSolid},[`${e}-node-content-wrapper`]:{color:i.colorTextLightSolid,background:"transparent"}}}}}},lDt=(i,e)=>{const t=`.${i}`,n=`${t}-treenode`,r=e.paddingXS/2,o=e.controlHeightSM,s=Oi(e,{treeCls:t,treeNodeCls:n,treeNodePadding:r,treeTitleHeight:o});return[sDt(i,s),aDt(s)]},cDt=vo("Tree",(i,e)=>{let{prefixCls:t}=e;return[{[i.componentCls]:LLe(`${t}-checkbox`,i)},lDt(t,i),WSe(i)]}),gde=4;function uDt(i){const{dropPosition:e,dropLevelOffset:t,prefixCls:n,indent:r,direction:o="ltr"}=i,s=o==="ltr"?"left":"right",a=o==="ltr"?"right":"left",l={[s]:-t*r+gde,[a]:0};switch(e){case-1:l.top=-3;break;case 1:l.bottom=-3;break;default:l.bottom=-3,l[s]=r+gde;break}return $e.createElement("div",{style:l,className:`${n}-drop-indicator`})}const dDt=i=>{const{prefixCls:e,switcherIcon:t,treeNodeProps:n,showLine:r}=i,{isLeaf:o,expanded:s,loading:a}=n;if(a)return C.createElement(ek,{className:`${e}-switcher-loading-icon`});let l;if(r&&typeof r=="object"&&(l=r.showLeafIcon),o){if(!r)return null;if(typeof l!="boolean"&&l){const d=typeof l=="function"?l(n):l,h=`${e}-switcher-line-custom-icon`;return bh(d)?Qs(d,{className:xe(d.props.className||"",h)}):d}return l?C.createElement(twe,{className:`${e}-switcher-line-icon`}):C.createElement("span",{className:`${e}-switcher-leaf-line`})}const c=`${e}-switcher-icon`,u=typeof t=="function"?t(n):t;return bh(u)?Qs(u,{className:xe(u.props.className||"",c)}):u!==void 0?u:r?s?C.createElement(_ft,{className:`${e}-switcher-line-icon`}):C.createElement(yft,{className:`${e}-switcher-line-icon`}):C.createElement(uht,{className:c})},hDt=dDt,fDt=$e.forwardRef((i,e)=>{const{getPrefixCls:t,direction:n,virtual:r}=$e.useContext(Rn),{prefixCls:o,className:s,showIcon:a=!1,showLine:l,switcherIcon:c,blockNode:u=!1,children:d,checkable:h=!1,selectable:f=!0,draggable:g,motion:p}=i,v=t("tree",o),m=t(),_=p??Object.assign(Object.assign({},NSe(m)),{motionAppear:!1}),y=Object.assign(Object.assign({},i),{checkable:h,selectable:f,showIcon:a,motion:_,blockNode:u,showLine:!!l,dropIndicatorRender:uDt}),[S,L]=cDt(v),E=$e.useMemo(()=>{if(!g)return!1;let k={};switch(typeof g){case"function":k.nodeDraggable=g;break;case"object":k=Object.assign({},g);break}return k.icon!==!1&&(k.icon=k.icon||$e.createElement(aft,null)),k},[g]),D=k=>$e.createElement(hDt,{prefixCls:v,switcherIcon:c,treeNodeProps:k,showLine:l});return S($e.createElement(AQ,Object.assign({itemHeight:20,ref:e,virtual:r},y,{prefixCls:v,className:xe({[`${v}-icon-hide`]:!a,[`${v}-block-node`]:u,[`${v}-unselectable`]:!f,[`${v}-rtl`]:n==="rtl"},s,L),direction:n,checkable:h&&$e.createElement("span",{className:`${v}-checkbox-inner`}),selectable:f,switcherIcon:D,draggable:E}),d))}),hEe=fDt;var Ng;(function(i){i[i.None=0]="None",i[i.Start=1]="Start",i[i.End=2]="End"})(Ng||(Ng={}));function PQ(i,e){function t(n){const{key:r,children:o}=n;e(r,n)!==!1&&PQ(o||[],e)}i.forEach(t)}function gDt(i){let{treeData:e,expandedKeys:t,startKey:n,endKey:r}=i;const o=[];let s=Ng.None;if(n&&n===r)return[n];if(!n||!r)return[];function a(l){return l===n||l===r}return PQ(e,l=>{if(s===Ng.End)return!1;if(a(l)){if(o.push(l),s===Ng.None)s=Ng.Start;else if(s===Ng.Start)return s=Ng.End,!1}else s===Ng.Start&&o.push(l);return t.includes(l)}),o}function B7(i,e){const t=ft(e),n=[];return PQ(i,(r,o)=>{const s=t.indexOf(r);return s!==-1&&(n.push(o),t.splice(s,1)),!!t.length}),n}var pde=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{var{defaultExpandAll:t,defaultExpandParent:n,defaultExpandedKeys:r}=i,o=pde(i,["defaultExpandAll","defaultExpandParent","defaultExpandedKeys"]);const s=C.useRef(),a=C.useRef(),l=()=>{const{keyEntities:k}=xQ(mde(o));let T;return t?T=Object.keys(k):n?T=SK(o.expandedKeys||r||[],k):T=o.expandedKeys||r,T},[c,u]=C.useState(o.selectedKeys||o.defaultSelectedKeys||[]),[d,h]=C.useState(()=>l());C.useEffect(()=>{"selectedKeys"in o&&u(o.selectedKeys)},[o.selectedKeys]),C.useEffect(()=>{"expandedKeys"in o&&h(o.expandedKeys)},[o.expandedKeys]);const f=(k,T)=>{var M;return"expandedKeys"in o||h(k),(M=o.onExpand)===null||M===void 0?void 0:M.call(o,k,T)},g=(k,T)=>{var M;const{multiple:A}=o,{node:N,nativeEvent:R}=T,{key:F=""}=N,W=mde(o),H=Object.assign(Object.assign({},T),{selected:!0}),G=(R==null?void 0:R.ctrlKey)||(R==null?void 0:R.metaKey),U=R==null?void 0:R.shiftKey;let K;A&&G?(K=k,s.current=F,a.current=K,H.selectedNodes=B7(W,K)):A&&U?(K=Array.from(new Set([].concat(ft(a.current||[]),ft(gDt({treeData:W,expandedKeys:d,startKey:F,endKey:s.current}))))),H.selectedNodes=B7(W,K)):(K=[F],s.current=F,a.current=K,H.selectedNodes=B7(W,K)),(M=o.onSelect)===null||M===void 0||M.call(o,K,H),"selectedKeys"in o||u(K)},{getPrefixCls:p,direction:v}=C.useContext(Rn),{prefixCls:m,className:_,showIcon:y=!0,expandAction:S="click"}=o,L=pde(o,["prefixCls","className","showIcon","expandAction"]),E=p("tree",m),D=xe(`${E}-directory`,{[`${E}-directory-rtl`]:v==="rtl"},_);return C.createElement(hEe,Object.assign({icon:pDt,ref:e,blockNode:!0},L,{showIcon:y,expandAction:S,prefixCls:E,className:D,expandedKeys:d,selectedKeys:c,onSelect:g,onExpand:f}))},vDt=C.forwardRef(mDt),_Dt=vDt,OQ=hEe;OQ.DirectoryTree=_Dt;OQ.TreeNode=mS;const bDt=OQ;function CDt(i){const e=C.useRef(i),t=bxe();return[()=>e.current,n=>{e.current=n,t()}]}function vde(i){let{value:e,onChange:t,filterSearch:n,tablePrefixCls:r,locale:o}=i;return n?C.createElement("div",{className:`${r}-filter-dropdown-search`},C.createElement(Lxt,{prefix:C.createElement(IZ,null),placeholder:o.filterSearchPlaceholder,onChange:t,value:e,htmlSize:1,className:`${r}-filter-dropdown-search-input`})):null}const yDt=i=>{const{keyCode:e}=i;e===vt.ENTER&&i.stopPropagation()},wDt=i=>C.createElement("div",{className:i.className,onClick:e=>e.stopPropagation(),onKeyDown:yDt},i.children),SDt=wDt;function xDt(i){return i.some(e=>{let{children:t}=e;return t})}function fEe(i,e){return typeof e=="string"||typeof e=="number"?e==null?void 0:e.toString().toLowerCase().includes(i.trim().toLowerCase()):!1}function gEe(i){let{filters:e,prefixCls:t,filteredKeys:n,filterMultiple:r,searchValue:o,filterSearch:s}=i;return e.map((a,l)=>{const c=String(a.value);if(a.children)return{key:c||l,label:a.text,popupClassName:`${t}-dropdown-submenu`,children:gEe({filters:a.children,prefixCls:t,filteredKeys:n,filterMultiple:r,searchValue:o,filterSearch:s})};const u=r?oF:_Le,d={key:a.value!==void 0?c:l,label:C.createElement(C.Fragment,null,C.createElement(u,{checked:n.includes(c)}),C.createElement("span",null,a.text))};return o.trim()?typeof s=="function"?s(o,a)?d:null:fEe(o,a.text)?d:null:d})}function LDt(i){var e,t;const{tablePrefixCls:n,prefixCls:r,column:o,dropdownPrefixCls:s,columnKey:a,filterMultiple:l,filterMode:c="menu",filterSearch:u=!1,filterState:d,triggerFilter:h,locale:f,children:g,getPopupContainer:p}=i,{filterDropdownOpen:v,onFilterDropdownOpenChange:m,filterResetToDefaultFilteredValue:_,defaultFilteredValue:y,filterDropdownVisible:S,onFilterDropdownVisibleChange:L}=o,[E,D]=C.useState(!1),k=!!(d&&(!((e=d.filteredKeys)===null||e===void 0)&&e.length||d.forceFiltered)),T=Me=>{D(Me),m==null||m(Me),L==null||L(Me)},M=(t=v??S)!==null&&t!==void 0?t:E,A=d==null?void 0:d.filteredKeys,[N,R]=CDt(A||[]),F=Me=>{let{selectedKeys:Qe}=Me;R(Qe)},W=(Me,Qe)=>{let{node:Ke,checked:Re}=Qe;F(l?{selectedKeys:Me}:{selectedKeys:Re&&Ke.key?[Ke.key]:[]})};C.useEffect(()=>{E&&F({selectedKeys:A||[]})},[A]);const[H,G]=C.useState([]),U=Me=>{G(Me)},[K,re]=C.useState(""),Y=Me=>{const{value:Qe}=Me.target;re(Qe)};C.useEffect(()=>{E||re("")},[E]);const J=Me=>{const Qe=Me&&Me.length?Me:null;if(Qe===null&&(!d||!d.filteredKeys)||Op(Qe,d==null?void 0:d.filteredKeys,!0))return null;h({column:o,key:a,filteredKeys:Qe})},Q=()=>{T(!1),J(N())},ue=function(){let{confirm:Me,closeDropdown:Qe}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{confirm:!1,closeDropdown:!1};Me&&J([]),Qe&&T(!1),re(""),R(_?(y||[]).map(Ke=>String(Ke)):[])},de=function(){let{closeDropdown:Me}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{closeDropdown:!0};Me&&T(!1),J(N())},_e=Me=>{Me&&A!==void 0&&R(A||[]),T(Me),!Me&&!o.filterDropdown&&Q()},ve=xe({[`${s}-menu-without-submenu`]:!xDt(o.filters||[])}),Ve=Me=>{if(Me.target.checked){const Qe=lw(o==null?void 0:o.filters).map(Ke=>String(Ke));R(Qe)}else R([])},Ze=Me=>{let{filters:Qe}=Me;return(Qe||[]).map((Ke,Re)=>{const ct=String(Ke.value),ie={title:Ke.text,key:Ke.value!==void 0?ct:Re};return Ke.children&&(ie.children=Ze({filters:Ke.children})),ie})},We=Me=>{var Qe;return Object.assign(Object.assign({},Me),{text:Me.title,value:Me.key,children:((Qe=Me.children)===null||Qe===void 0?void 0:Qe.map(Ke=>We(Ke)))||[]})};let pe;if(typeof o.filterDropdown=="function")pe=o.filterDropdown({prefixCls:`${s}-custom`,setSelectedKeys:Me=>F({selectedKeys:Me}),selectedKeys:N(),confirm:de,clearFilters:ue,filters:o.filters,visible:M,close:()=>{T(!1)}});else if(o.filterDropdown)pe=o.filterDropdown;else{const Me=N()||[],Qe=()=>(o.filters||[]).length===0?C.createElement(M0,{image:M0.PRESENTED_IMAGE_SIMPLE,description:f.filterEmptyText,imageStyle:{height:24},style:{margin:0,padding:"16px 0"}}):c==="tree"?C.createElement(C.Fragment,null,C.createElement(vde,{filterSearch:u,value:K,onChange:Y,tablePrefixCls:n,locale:f}),C.createElement("div",{className:`${n}-filter-dropdown-tree`},l?C.createElement(oF,{checked:Me.length===lw(o.filters).length,indeterminate:Me.length>0&&Me.lengthtypeof u=="function"?u(K,We(Re)):fEe(K,Re.title):void 0}))):C.createElement(C.Fragment,null,C.createElement(vde,{filterSearch:u,value:K,onChange:Y,tablePrefixCls:n,locale:f}),C.createElement(vQ,{selectable:!0,multiple:l,prefixCls:`${s}-menu`,className:ve,onSelect:F,onDeselect:F,selectedKeys:Me,getPopupContainer:p,openKeys:H,onOpenChange:U,items:gEe({filters:o.filters||[],filterSearch:u,prefixCls:r,filteredKeys:N(),filterMultiple:l,searchValue:K})})),Ke=()=>_?Op((y||[]).map(Re=>String(Re)),Me,!0):Me.length===0;pe=C.createElement(C.Fragment,null,Qe(),C.createElement("div",{className:`${r}-dropdown-btns`},C.createElement(Ju,{type:"link",size:"small",disabled:Ke(),onClick:()=>ue()},f.filterReset),C.createElement(Ju,{type:"primary",size:"small",onClick:Q},f.filterConfirm)))}o.filterDropdown&&(pe=C.createElement(rLe,{selectable:void 0},pe));const Pe=()=>C.createElement(SDt,{className:`${r}-dropdown`},pe);let Se;typeof o.filterIcon=="function"?Se=o.filterIcon(k):o.filterIcon?Se=o.filterIcon:Se=C.createElement(Yht,null);const{direction:Ne}=C.useContext(Rn);return C.createElement("div",{className:`${r}-column`},C.createElement("span",{className:`${n}-column-title`},g),C.createElement(hk,{dropdownRender:Pe,trigger:["click"],open:M,onOpenChange:_e,getPopupContainer:p,placement:Ne==="rtl"?"bottomLeft":"bottomRight"},C.createElement("span",{role:"button",tabIndex:-1,className:xe(`${r}-trigger`,{active:k}),onClick:Me=>{Me.stopPropagation()}},Se)))}function RK(i,e,t){let n=[];return(i||[]).forEach((r,o)=>{var s;const a=WT(o,t);if(r.filters||"filterDropdown"in r||"onFilter"in r)if("filteredValue"in r){let l=r.filteredValue;"filterDropdown"in r||(l=(s=l==null?void 0:l.map(String))!==null&&s!==void 0?s:l),n.push({column:r,key:iC(r,a),filteredKeys:l,forceFiltered:r.filtered})}else n.push({column:r,key:iC(r,a),filteredKeys:e&&r.defaultFilteredValue?r.defaultFilteredValue:void 0,forceFiltered:r.filtered});"children"in r&&(n=[].concat(ft(n),ft(RK(r.children,e,a))))}),n}function pEe(i,e,t,n,r,o,s,a){return t.map((l,c)=>{const u=WT(c,a),{filterMultiple:d=!0,filterMode:h,filterSearch:f}=l;let g=l;if(g.filters||g.filterDropdown){const p=iC(g,u),v=n.find(m=>{let{key:_}=m;return p===_});g=Object.assign(Object.assign({},g),{title:m=>C.createElement(LDt,{tablePrefixCls:i,prefixCls:`${i}-filter`,dropdownPrefixCls:e,column:g,columnKey:p,filterState:v,filterMultiple:d,filterMode:h,filterSearch:f,triggerFilter:o,locale:r,getPopupContainer:s},tB(l.title,m))})}return"children"in g&&(g=Object.assign(Object.assign({},g),{children:pEe(i,e,g.children,n,r,o,s,u)})),g})}function lw(i){let e=[];return(i||[]).forEach(t=>{let{value:n,children:r}=t;e.push(n),r&&(e=[].concat(ft(e),ft(lw(r))))}),e}function _de(i){const e={};return i.forEach(t=>{let{key:n,filteredKeys:r,column:o}=t;const{filters:s,filterDropdown:a}=o;if(a)e[n]=r||null;else if(Array.isArray(r)){const l=lw(s);e[n]=l.filter(c=>r.includes(String(c)))}else e[n]=null}),e}function bde(i,e){return e.reduce((t,n)=>{const{column:{onFilter:r,filters:o},filteredKeys:s}=n;return r&&s&&s.length?t.filter(a=>s.some(l=>{const c=lw(o),u=c.findIndex(h=>String(h)===String(l)),d=u!==-1?c[u]:l;return r(d,a)})):t},i)}const mEe=i=>i.flatMap(e=>"children"in e?[e].concat(ft(mEe(e.children||[]))):[e]);function EDt(i){let{prefixCls:e,dropdownPrefixCls:t,mergedColumns:n,onFilterChange:r,getPopupContainer:o,locale:s}=i;const a=C.useMemo(()=>mEe(n||[]),[n]),[l,c]=C.useState(()=>RK(a,!0)),u=C.useMemo(()=>{const g=RK(a,!1);if(g.length===0)return g;let p=!0;if(g.forEach(v=>{let{filteredKeys:m}=v;m!==void 0&&(p=!1)}),p){const v=(a||[]).map((m,_)=>iC(m,WT(_)));return l.filter(m=>{let{key:_}=m;return v.includes(_)}).map(m=>{const _=a[v.findIndex(y=>y===m.key)];return Object.assign(Object.assign({},m),{column:Object.assign(Object.assign({},m.column),_),forceFiltered:_.filtered})})}return g},[a,l]),d=C.useMemo(()=>_de(u),[u]),h=g=>{const p=u.filter(v=>{let{key:m}=v;return m!==g.key});p.push(g),c(p),r(_de(p),p)};return[g=>pEe(e,t,g,u,s,h,o),u,d]}function DDt(i,e,t){const n=C.useRef({});function r(o){if(!n.current||n.current.data!==i||n.current.childrenColumnName!==e||n.current.getRowKey!==t){let a=function(l){l.forEach((c,u)=>{const d=t(c,u);s.set(d,c),c&&typeof c=="object"&&e in c&&a(c[e]||[])})};const s=new Map;a(i),n.current={data:i,childrenColumnName:e,kvMap:s,getRowKey:t}}return n.current.kvMap.get(o)}return[r]}var IDt=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r{const o=i[r];typeof o!="function"&&(t[r]=o)}),t}function TDt(i,e,t){const n=t&&typeof t=="object"?t:{},{total:r=0}=n,o=IDt(n,["total"]),[s,a]=C.useState(()=>({current:"defaultCurrent"in o?o.defaultCurrent:1,pageSize:"defaultPageSize"in o?o.defaultPageSize:vEe})),l=zLe(s,o,{total:r>0?r:i}),c=Math.ceil((r||i)/l.pageSize);l.current>c&&(l.current=c||1);const u=(h,f)=>{a({current:h??1,pageSize:f||l.pageSize})},d=(h,f)=>{var g;t&&((g=t.onChange)===null||g===void 0||g.call(t,h,f)),u(h,f),e(h,f||(l==null?void 0:l.pageSize))};return t===!1?[{},()=>{}]:[Object.assign(Object.assign({},l),{onChange:d}),u]}const Lm={},MK="SELECT_ALL",AK="SELECT_INVERT",PK="SELECT_NONE",Cde=[],_Ee=(i,e)=>{let t=[];return(e||[]).forEach(n=>{t.push(n),n&&typeof n=="object"&&i in n&&(t=[].concat(ft(t),ft(_Ee(i,n[i]))))}),t},NDt=(i,e)=>{const{preserveSelectedRowKeys:t,selectedRowKeys:n,defaultSelectedRowKeys:r,getCheckboxProps:o,onChange:s,onSelect:a,onSelectAll:l,onSelectInvert:c,onSelectNone:u,onSelectMultiple:d,columnWidth:h,type:f,selections:g,fixed:p,renderCell:v,hideSelectAll:m,checkStrictly:_=!0}=e||{},{prefixCls:y,data:S,pageData:L,getRecordByKey:E,getRowKey:D,expandType:k,childrenColumnName:T,locale:M,getPopupContainer:A}=i,[N,R]=Ja(n||r||Cde,{value:n}),F=C.useRef(new Map),W=C.useCallback(We=>{if(t){const pe=new Map;We.forEach(Pe=>{let Se=E(Pe);!Se&&F.current.has(Pe)&&(Se=F.current.get(Pe)),pe.set(Pe,Se)}),F.current=pe}},[E,t]);C.useEffect(()=>{W(N)},[N]);const{keyEntities:H}=C.useMemo(()=>_?{keyEntities:null}:xQ(S,{externalGetKey:D,childrenPropName:T}),[S,D,_,T]),G=C.useMemo(()=>_Ee(T,L),[T,L]),U=C.useMemo(()=>{const We=new Map;return G.forEach((pe,Pe)=>{const Se=D(pe,Pe),Ne=(o?o(pe):null)||{};We.set(Se,Ne)}),We},[G,D,o]),K=C.useCallback(We=>{var pe;return!!(!((pe=U.get(D(We)))===null||pe===void 0)&&pe.disabled)},[U,D]),[re,Y]=C.useMemo(()=>{if(_)return[N||[],[]];const{checkedKeys:We,halfCheckedKeys:pe}=aw(N,!0,H,K);return[We||[],pe]},[N,_,H,K]),J=C.useMemo(()=>{const We=f==="radio"?re.slice(0,1):re;return new Set(We)},[re,f]),Q=C.useMemo(()=>f==="radio"?new Set:new Set(Y),[Y,f]),[ue,de]=C.useState(null);C.useEffect(()=>{e||R(Cde)},[!!e]);const _e=C.useCallback((We,pe)=>{let Pe,Se;W(We),t?(Pe=We,Se=We.map(Ne=>F.current.get(Ne))):(Pe=[],Se=[],We.forEach(Ne=>{const Me=E(Ne);Me!==void 0&&(Pe.push(Ne),Se.push(Me))})),R(Pe),s==null||s(Pe,Se,{type:pe})},[R,E,s,t]),ve=C.useCallback((We,pe,Pe,Se)=>{if(a){const Ne=Pe.map(Me=>E(Me));a(E(We),pe,Ne,Se)}_e(Pe,"single")},[a,E,_e]),Ve=C.useMemo(()=>!g||m?null:(g===!0?[MK,AK,PK]:g).map(pe=>pe===MK?{key:"all",text:M.selectionAll,onSelect(){_e(S.map((Pe,Se)=>D(Pe,Se)).filter(Pe=>{const Se=U.get(Pe);return!(Se!=null&&Se.disabled)||J.has(Pe)}),"all")}}:pe===AK?{key:"invert",text:M.selectInvert,onSelect(){const Pe=new Set(J);L.forEach((Ne,Me)=>{const Qe=D(Ne,Me),Ke=U.get(Qe);Ke!=null&&Ke.disabled||(Pe.has(Qe)?Pe.delete(Qe):Pe.add(Qe))});const Se=Array.from(Pe);c&&c(Se),_e(Se,"invert")}}:pe===PK?{key:"none",text:M.selectNone,onSelect(){u==null||u(),_e(Array.from(J).filter(Pe=>{const Se=U.get(Pe);return Se==null?void 0:Se.disabled}),"none")}}:pe).map(pe=>Object.assign(Object.assign({},pe),{onSelect:function(){for(var Pe,Se,Ne=arguments.length,Me=new Array(Ne),Qe=0;Qe{var pe;if(!e)return We.filter(he=>he!==Lm);let Pe=ft(We);const Se=new Set(J),Ne=G.map(D).filter(he=>!U.get(he).disabled),Me=Ne.every(he=>Se.has(he)),Qe=Ne.some(he=>Se.has(he)),Ke=()=>{const he=[];Me?Ne.forEach(Fe=>{Se.delete(Fe),he.push(Fe)}):Ne.forEach(Fe=>{Se.has(Fe)||(Se.add(Fe),he.push(Fe))});const Le=Array.from(Se);l==null||l(!Me,Le.map(Fe=>E(Fe)),he.map(Fe=>E(Fe))),_e(Le,"all"),de(null)};let Re;if(f!=="radio"){let he;if(Ve){const nt={getPopupContainer:A,items:Ve.map((it,at)=>{const{key:tt,text:Zt,onSelect:Tt}=it;return{key:tt??at,onClick:()=>{Tt==null||Tt(Ne)},label:Zt}})};he=C.createElement("div",{className:`${y}-selection-extra`},C.createElement(hk,{menu:nt,getPopupContainer:A},C.createElement("span",null,C.createElement(DZ,null))))}const Le=G.map((nt,it)=>{const at=D(nt,it),tt=U.get(at)||{};return Object.assign({checked:Se.has(at)},tt)}).filter(nt=>{let{disabled:it}=nt;return it}),Fe=!!Le.length&&Le.length===G.length,ze=Fe&&Le.every(nt=>{let{checked:it}=nt;return it}),Ue=Fe&&Le.some(nt=>{let{checked:it}=nt;return it});Re=!m&&C.createElement("div",{className:`${y}-selection`},C.createElement(oF,{checked:Fe?ze:!!G.length&&Me,indeterminate:Fe?!ze&&Ue:!Me&&Qe,onChange:Ke,disabled:G.length===0||Fe,"aria-label":he?"Custom selection":"Select all",skipGroup:!0}),he)}let ct;f==="radio"?ct=(he,Le,Fe)=>{const ze=D(Le,Fe),Ue=Se.has(ze);return{node:C.createElement(_Le,Object.assign({},U.get(ze),{checked:Ue,onClick:nt=>nt.stopPropagation(),onChange:nt=>{Se.has(ze)||ve(ze,!0,[ze],nt.nativeEvent)}})),checked:Ue}}:ct=(he,Le,Fe)=>{var ze;const Ue=D(Le,Fe),nt=Se.has(Ue),it=Q.has(Ue),at=U.get(Ue);let tt;return k==="nest"?tt=it:tt=(ze=at==null?void 0:at.indeterminate)!==null&&ze!==void 0?ze:it,{node:C.createElement(oF,Object.assign({},at,{indeterminate:tt,checked:nt,skipGroup:!0,onClick:Zt=>Zt.stopPropagation(),onChange:Zt=>{let{nativeEvent:Tt}=Zt;const{shiftKey:xn}=Tt;let rt=-1,wt=-1;if(xn&&_){const Bt=new Set([ue,Ue]);Ne.some((Nt,nn)=>{if(Bt.has(Nt))if(rt===-1)rt=nn;else return wt=nn,!0;return!1})}if(wt!==-1&&rt!==wt&&_){const Bt=Ne.slice(rt,wt+1),Nt=[];nt?Bt.forEach(Mn=>{Se.has(Mn)&&(Nt.push(Mn),Se.delete(Mn))}):Bt.forEach(Mn=>{Se.has(Mn)||(Nt.push(Mn),Se.add(Mn))});const nn=Array.from(Se);d==null||d(!nt,nn.map(Mn=>E(Mn)),Nt.map(Mn=>E(Mn))),_e(nn,"multiple")}else{const Bt=re;if(_){const Nt=nt?Xh(Bt,Ue):Lg(Bt,Ue);ve(Ue,!nt,Nt,Tt)}else{const Nt=aw([].concat(ft(Bt),[Ue]),!0,H,K),{checkedKeys:nn,halfCheckedKeys:Mn}=Nt;let zt=nn;if(nt){const Qt=new Set(nn);Qt.delete(Ue),zt=aw(Array.from(Qt),{checked:!1,halfCheckedKeys:Mn},H,K).checkedKeys}ve(Ue,!nt,zt,Tt)}}de(nt?null:Ue)}})),checked:nt}};const ie=(he,Le,Fe)=>{const{node:ze,checked:Ue}=ct(he,Le,Fe);return v?v(Ue,Le,Fe,ze):ze};if(!Pe.includes(Lm))if(Pe.findIndex(he=>{var Le;return((Le=he[ZE])===null||Le===void 0?void 0:Le.columnType)==="EXPAND_COLUMN"})===0){const[he,...Le]=Pe;Pe=[he,Lm].concat(ft(Le))}else Pe=[Lm].concat(ft(Pe));const le=Pe.indexOf(Lm);Pe=Pe.filter((he,Le)=>he!==Lm||Le===le);const ce=Pe[le-1],z=Pe[le+1];let q=p;q===void 0&&((z==null?void 0:z.fixed)!==void 0?q=z.fixed:(ce==null?void 0:ce.fixed)!==void 0&&(q=ce.fixed)),q&&ce&&((pe=ce[ZE])===null||pe===void 0?void 0:pe.columnType)==="EXPAND_COLUMN"&&ce.fixed===void 0&&(ce.fixed=q);const oe=xe(`${y}-selection-col`,{[`${y}-selection-col-with-dropdown`]:g&&f==="checkbox"}),ne={fixed:q,width:h,className:`${y}-selection-column`,title:e.columnTitle||Re,render:ie,[ZE]:{className:oe}};return Pe.map(he=>he===Lm?ne:he)},[D,G,e,re,J,Q,h,Ve,k,ue,U,d,ve,K]),J]},nA="ascend",W7="descend";function uF(i){return typeof i.sorter=="object"&&typeof i.sorter.multiple=="number"?i.sorter.multiple:!1}function yde(i){return typeof i=="function"?i:i&&typeof i=="object"&&i.compare?i.compare:!1}function RDt(i,e){return e?i[i.indexOf(e)+1]:i[0]}function OK(i,e,t){let n=[];function r(o,s){n.push({column:o,key:iC(o,s),multiplePriority:uF(o),sortOrder:o.sortOrder})}return(i||[]).forEach((o,s)=>{const a=WT(s,t);o.children?("sortOrder"in o&&r(o,a),n=[].concat(ft(n),ft(OK(o.children,e,a)))):o.sorter&&("sortOrder"in o?r(o,a):e&&o.defaultSortOrder&&n.push({column:o,key:iC(o,a),multiplePriority:uF(o),sortOrder:o.defaultSortOrder}))}),n}function bEe(i,e,t,n,r,o,s,a){return(e||[]).map((l,c)=>{const u=WT(c,a);let d=l;if(d.sorter){const h=d.sortDirections||r,f=d.showSorterTooltip===void 0?s:d.showSorterTooltip,g=iC(d,u),p=t.find(T=>{let{key:M}=T;return M===g}),v=p?p.sortOrder:null,m=RDt(h,v),_=h.includes(nA)&&C.createElement(bht,{className:xe(`${i}-column-sorter-up`,{active:v===nA})}),y=h.includes(W7)&&C.createElement(fht,{className:xe(`${i}-column-sorter-down`,{active:v===W7})}),{cancelSort:S,triggerAsc:L,triggerDesc:E}=o||{};let D=S;m===W7?D=E:m===nA&&(D=L);const k=typeof f=="object"?f:{title:D};d=Object.assign(Object.assign({},d),{className:xe(d.className,{[`${i}-column-sort`]:v}),title:T=>{const M=C.createElement("div",{className:`${i}-column-sorters`},C.createElement("span",{className:`${i}-column-title`},tB(l.title,T)),C.createElement("span",{className:xe(`${i}-column-sorter`,{[`${i}-column-sorter-full`]:!!(_&&y)})},C.createElement("span",{className:`${i}-column-sorter-inner`,"aria-hidden":"true"},_,y)));return f?C.createElement(NT,Object.assign({},k),M):M},onHeaderCell:T=>{const M=l.onHeaderCell&&l.onHeaderCell(T)||{},A=M.onClick,N=M.onKeyDown;M.onClick=W=>{n({column:l,key:g,sortOrder:m,multiplePriority:uF(l)}),A==null||A(W)},M.onKeyDown=W=>{W.keyCode===vt.ENTER&&(n({column:l,key:g,sortOrder:m,multiplePriority:uF(l)}),N==null||N(W))};const R=qEt(l.title,{}),F=R==null?void 0:R.toString();return v?M["aria-sort"]=v==="ascend"?"ascending":"descending":M["aria-label"]=F||"",M.className=xe(M.className,`${i}-column-has-sorters`),M.tabIndex=0,l.ellipsis&&(M.title=(R??"").toString()),M}})}return"children"in d&&(d=Object.assign(Object.assign({},d),{children:bEe(i,d.children,t,n,r,o,s,u)})),d})}function wde(i){const{column:e,sortOrder:t}=i;return{column:e,order:t,field:e.dataIndex,columnKey:e.key}}function Sde(i){const e=i.filter(t=>{let{sortOrder:n}=t;return n}).map(wde);return e.length===0&&i.length?Object.assign(Object.assign({},wde(i[i.length-1])),{column:void 0}):e.length<=1?e[0]||{}:e}function FK(i,e,t){const n=e.slice().sort((s,a)=>a.multiplePriority-s.multiplePriority),r=i.slice(),o=n.filter(s=>{let{column:{sorter:a},sortOrder:l}=s;return yde(a)&&l});return o.length?r.sort((s,a)=>{for(let l=0;l{const a=s[t];return a?Object.assign(Object.assign({},s),{[t]:FK(a,e,t)}):s}):r}function MDt(i){let{prefixCls:e,mergedColumns:t,onSorterChange:n,sortDirections:r,tableLocale:o,showSorterTooltip:s}=i;const[a,l]=C.useState(OK(t,!0)),c=C.useMemo(()=>{let g=!0;const p=OK(t,!1);if(!p.length)return a;const v=[];function m(y){g?v.push(y):v.push(Object.assign(Object.assign({},y),{sortOrder:null}))}let _=null;return p.forEach(y=>{_===null?(m(y),y.sortOrder&&(y.multiplePriority===!1?g=!1:_=!0)):(_&&y.multiplePriority!==!1||(g=!1),m(y))}),v},[t,a]),u=C.useMemo(()=>{const g=c.map(p=>{let{column:v,sortOrder:m}=p;return{column:v,order:m}});return{sortColumns:g,sortColumn:g[0]&&g[0].column,sortOrder:g[0]&&g[0].order}},[c]);function d(g){let p;g.multiplePriority===!1||!c.length||c[0].multiplePriority===!1?p=[g]:p=[].concat(ft(c.filter(v=>{let{key:m}=v;return m!==g.key})),[g]),l(p),n(Sde(p),p)}return[g=>bEe(e,g,c,d,r,o,s),c,u,()=>Sde(c)]}function CEe(i,e){return i.map(t=>{const n=Object.assign({},t);return n.title=tB(t.title,e),"children"in n&&(n.children=CEe(n.children,e)),n})}function ADt(i){return[C.useCallback(t=>CEe(t,i),[i])]}const PDt=i=>{const{componentCls:e}=i,t=`${i.lineWidth}px ${i.lineType} ${i.tableBorderColor}`,n=(r,o,s)=>({[`&${e}-${r}`]:{[`> ${e}-container`]:{[`> ${e}-content, > ${e}-body`]:{[` > table > tbody > tr > th, > table > tbody > tr > td `]:{[`> ${e}-expanded-row-fixed`]:{margin:`-${o}px -${s+i.lineWidth}px`}}}}}});return{[`${e}-wrapper`]:{[`${e}${e}-bordered`]:Object.assign(Object.assign(Object.assign({[`> ${e}-title`]:{border:t,borderBottom:0},[`> ${e}-container`]:{borderInlineStart:t,[` @@ -1129,7 +1129,7 @@ html body { `]:{"> table":{borderTop:t}}},[`&${e}-scroll-horizontal`]:{[`> ${e}-container > ${e}-body`]:{"> table > tbody":{[` > tr${e}-expanded-row, > tr${e}-placeholder - `]:{["> th, > td"]:{borderInlineEnd:0}}}}}},n("middle",i.tablePaddingVerticalMiddle,i.tablePaddingHorizontalMiddle)),n("small",i.tablePaddingVerticalSmall,i.tablePaddingHorizontalSmall)),{[`> ${e}-footer`]:{border:t,borderTop:0}}),[`${e}-cell`]:{[`${e}-container:first-child`]:{borderTop:0},"&-scrollbar:not([rowspan])":{boxShadow:`0 ${i.lineWidth}px 0 ${i.lineWidth}px ${i.tableHeaderBg}`}}}}},ODt=PDt,FDt=i=>{const{componentCls:e}=i;return{[`${e}-wrapper`]:{[`${e}-cell-ellipsis`]:Object.assign(Object.assign({},mb),{wordBreak:"keep-all",[` + `]:{["> th, > td"]:{borderInlineEnd:0}}}}}},n("middle",i.tablePaddingVerticalMiddle,i.tablePaddingHorizontalMiddle)),n("small",i.tablePaddingVerticalSmall,i.tablePaddingHorizontalSmall)),{[`> ${e}-footer`]:{border:t,borderTop:0}}),[`${e}-cell`]:{[`${e}-container:first-child`]:{borderTop:0},"&-scrollbar:not([rowspan])":{boxShadow:`0 ${i.lineWidth}px 0 ${i.lineWidth}px ${i.tableHeaderBg}`}}}}},ODt=PDt,FDt=i=>{const{componentCls:e}=i;return{[`${e}-wrapper`]:{[`${e}-cell-ellipsis`]:Object.assign(Object.assign({},pb),{wordBreak:"keep-all",[` &${e}-cell-fix-left-last, &${e}-cell-fix-right-first `]:{overflow:"visible",[`${e}-cell-content`]:{display:"block",overflow:"hidden",textOverflow:"ellipsis"}},[`${e}-column-title`]:{overflow:"hidden",textOverflow:"ellipsis",wordBreak:"keep-all"}})}}},BDt=FDt,WDt=i=>{const{componentCls:e}=i;return{[`${e}-wrapper`]:{[`${e}-tbody > tr${e}-placeholder`]:{textAlign:"center",color:i.colorTextDisabled,[` @@ -1181,16 +1181,16 @@ html body { &${e}-row:hover > td, > th${e}-cell-row-hover > td${e}-cell-row-hover - `]:{background:p},[`&${e}-row-selected`]:{["> th, > td"]:{background:v},["&:hover > th, &:hover > td"]:{background:m}}}},[`${e}-footer`]:{padding:`${n}px ${r}px`,color:_,background:y}})}},cIt=vo("Table",i=>{const{controlItemBgActive:e,controlItemBgActiveHover:t,colorTextPlaceholder:n,colorTextHeading:r,colorSplit:o,colorBorderSecondary:s,fontSize:a,padding:l,paddingXS:c,paddingSM:u,controlHeight:d,colorFillAlter:h,colorIcon:f,colorIconHover:g,opacityLoading:p,colorBgContainer:v,borderRadiusLG:m,colorFillContent:_,colorFillSecondary:y,controlInteractiveSize:S}=i,L=new Yr(f),E=new Yr(g),D=e,k=2,T=new Yr(y).onBackground(v).toHexShortString(),M=new Yr(_).onBackground(v).toHexShortString(),A=new Yr(h).onBackground(v).toHexShortString(),N=Oi(i,{tableFontSize:a,tableBg:v,tableRadius:m,tablePaddingVertical:l,tablePaddingHorizontal:l,tablePaddingVerticalMiddle:u,tablePaddingHorizontalMiddle:c,tablePaddingVerticalSmall:c,tablePaddingHorizontalSmall:c,tableBorderColor:s,tableHeaderTextColor:r,tableHeaderBg:A,tableFooterTextColor:r,tableFooterBg:A,tableHeaderCellSplitColor:s,tableHeaderSortBg:T,tableHeaderSortHoverBg:M,tableHeaderIconColor:L.clone().setAlpha(L.getAlpha()*p).toRgbString(),tableHeaderIconColorHover:E.clone().setAlpha(E.getAlpha()*p).toRgbString(),tableBodySortBg:A,tableFixedHeaderSortActiveBg:T,tableHeaderFilterActiveBg:_,tableFilterDropdownBg:v,tableRowHoverBg:A,tableSelectedRowBg:D,tableSelectedRowHoverBg:t,zIndexTableFixed:k,zIndexTableSticky:k+1,tableFontSizeMiddle:a,tableFontSizeSmall:a,tableSelectionColumnWidth:d,tableExpandIconBg:v,tableExpandColumnWidth:S+2*i.padding,tableExpandedRowBg:h,tableFilterDropdownWidth:120,tableFilterDropdownHeight:264,tableFilterDropdownSearchWidth:140,tableScrollThumbSize:8,tableScrollThumbBg:n,tableScrollThumbBgHover:r,tableScrollBg:o});return[lIt(N),qDt(N),xde(N),rIt(N),UDt(N),ODt(N),YDt(N),VDt(N),xde(N),$Dt(N),eIt(N),KDt(N),sIt(N),BDt(N),nIt(N),QDt(N)]}),uIt=[],dIt=(i,e)=>{const{prefixCls:t,className:n,rootClassName:r,style:o,size:s,bordered:a,dropdownPrefixCls:l,dataSource:c,pagination:u,rowSelection:d,rowKey:h="key",rowClassName:f,columns:g,children:p,childrenColumnName:v,onChange:m,getPopupContainer:_,loading:y,expandIcon:S,expandable:L,expandedRowRender:E,expandIconColumnIndex:D,indentSize:k,scroll:T,sortDirections:M,locale:A,showSorterTooltip:N=!0}=i,R=C.useMemo(()=>g||MQ(p),[g,p]),F=C.useMemo(()=>R.some(zt=>zt.responsive),[R]),W=B5(F),H=C.useMemo(()=>{const zt=new Set(Object.keys(W).filter(Qt=>W[Qt]));return R.filter(Qt=>!Qt.responsive||Qt.responsive.some(lt=>zt.has(lt)))},[R,W]),G=ll(i,["className","style","columns"]),U=C.useContext(Rh),{locale:K=tC,direction:re,renderEmpty:Y,getPrefixCls:J,getPopupContainer:Q}=C.useContext(Rn),ue=s||U,de=Object.assign(Object.assign({},K.Table),A),_e=c||uIt,ve=J("table",t),Ve=J("dropdown",l),Ze=Object.assign({childrenColumnName:v,expandIconColumnIndex:D},L),{childrenColumnName:We="children"}=Ze,pe=C.useMemo(()=>_e.some(zt=>zt==null?void 0:zt[We])?"nest":E||L&&L.expandedRowRender?"row":null,[_e]),Pe={body:C.useRef()},Se=C.useMemo(()=>typeof h=="function"?h:zt=>zt==null?void 0:zt[h],[h]),[Ne]=DDt(_e,We,Se),Me={},Qe=function(zt,Qt){let lt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;var ut,dt,Mt;const Kt=Object.assign(Object.assign({},Me),zt);lt&&((ut=Me.resetPagination)===null||ut===void 0||ut.call(Me),!((dt=Kt.pagination)===null||dt===void 0)&&dt.current&&(Kt.pagination.current=1),u&&u.onChange&&u.onChange(1,(Mt=Kt.pagination)===null||Mt===void 0?void 0:Mt.pageSize)),T&&T.scrollToFirstRowOnChange!==!1&&Pe.body.current&&gvt(0,{getContainer:()=>Pe.body.current}),m==null||m(Kt.pagination,Kt.filters,Kt.sorter,{currentDataSource:bde(FK(_e,Kt.sorterStates,We),Kt.filterStates),action:Qt})},Ke=(zt,Qt)=>{Qe({sorter:zt,sorterStates:Qt},"sort",!1)},[Re,ct,ie,le]=MDt({prefixCls:ve,mergedColumns:H,onSorterChange:Ke,sortDirections:M||["ascend","descend"],tableLocale:de,showSorterTooltip:N}),ce=C.useMemo(()=>FK(_e,ct,We),[_e,ct]);Me.sorter=le(),Me.sorterStates=ct;const z=(zt,Qt)=>{Qe({filters:zt,filterStates:Qt},"filter",!0)},[q,oe,ne]=EDt({prefixCls:ve,locale:de,dropdownPrefixCls:Ve,mergedColumns:H,onFilterChange:z,getPopupContainer:_||Q}),he=bde(ce,oe);Me.filters=ne,Me.filterStates=oe;const Le=C.useMemo(()=>{const zt={};return Object.keys(ne).forEach(Qt=>{ne[Qt]!==null&&(zt[Qt]=ne[Qt])}),Object.assign(Object.assign({},ie),{filters:zt})},[ie,ne]),[Fe]=ADt(Le),ze=(zt,Qt)=>{Qe({pagination:Object.assign(Object.assign({},Me.pagination),{current:zt,pageSize:Qt})},"paginate")},[Ue,nt]=TDt(he.length,ze,u);Me.pagination=u===!1?{}:kDt(Ue,u),Me.resetPagination=nt;const it=C.useMemo(()=>{if(u===!1||!Ue.pageSize)return he;const{current:zt=1,total:Qt,pageSize:lt=vEe}=Ue;return he.lengthlt?he.slice((zt-1)*lt,zt*lt):he:he.slice((zt-1)*lt,zt*lt)},[!!u,he,Ue&&Ue.current,Ue&&Ue.pageSize,Ue&&Ue.total]),[at,tt]=NDt({prefixCls:ve,data:he,pageData:it,getRowKey:Se,getRecordByKey:Ne,expandType:pe,childrenColumnName:We,locale:de,getPopupContainer:_||Q},d),Zt=(zt,Qt,lt)=>{let ut;return typeof f=="function"?ut=xe(f(zt,Qt,lt)):ut=xe(f),xe({[`${ve}-row-selected`]:tt.has(Se(zt,Qt))},ut)};Ze.__PARENT_RENDER_ICON__=Ze.expandIcon,Ze.expandIcon=Ze.expandIcon||S||KEt(de),pe==="nest"&&Ze.expandIconColumnIndex===void 0?Ze.expandIconColumnIndex=d?1:0:Ze.expandIconColumnIndex>0&&d&&(Ze.expandIconColumnIndex-=1),typeof Ze.indentSize!="number"&&(Ze.indentSize=typeof k=="number"?k:15);const Tt=C.useCallback(zt=>Fe(at(q(Re(zt)))),[Re,q,at]);let xn,rt;if(u!==!1&&(Ue!=null&&Ue.total)){let zt;Ue.size?zt=Ue.size:zt=ue==="small"||ue==="middle"?"small":void 0;const Qt=dt=>C.createElement(kQ,Object.assign({},Ue,{className:xe(`${ve}-pagination ${ve}-pagination-${dt}`,Ue.className),size:zt})),lt=re==="rtl"?"left":"right",{position:ut}=Ue;if(ut!==null&&Array.isArray(ut)){const dt=ut.find(mn=>mn.includes("top")),Mt=ut.find(mn=>mn.includes("bottom")),Kt=ut.every(mn=>`${mn}`=="none");!dt&&!Mt&&!Kt&&(rt=Qt(lt)),dt&&(xn=Qt(dt.toLowerCase().replace("top",""))),Mt&&(rt=Qt(Mt.toLowerCase().replace("bottom","")))}else rt=Qt(lt)}let wt;typeof y=="boolean"?wt={spinning:y}:typeof y=="object"&&(wt=Object.assign({spinning:!0},y));const[Bt,Nt]=cIt(ve),nn=xe(`${ve}-wrapper`,{[`${ve}-wrapper-rtl`]:re==="rtl"},n,r,Nt),Mn=A&&A.emptyText||(Y==null?void 0:Y("Table"))||C.createElement(nQ,{componentName:"Table"});return Bt(C.createElement("div",{ref:e,className:nn,style:o},C.createElement(VLe,Object.assign({spinning:!1},wt),xn,C.createElement(GEt,Object.assign({},G,{columns:H,direction:re,expandable:Ze,prefixCls:ve,className:xe({[`${ve}-middle`]:ue==="middle",[`${ve}-small`]:ue==="small",[`${ve}-bordered`]:a,[`${ve}-empty`]:_e.length===0}),data:it,rowKey:Se,rowClassName:Zt,emptyText:Mn,internalHooks:cF,internalRefs:Pe,transformColumns:Tt})),rt)))},hIt=C.forwardRef(dIt),fIt=(i,e)=>{const t=C.useRef(0);return t.current+=1,C.createElement(hIt,Object.assign({},i,{ref:e,_renderTimes:t.current}))},Gp=C.forwardRef(fIt);Gp.SELECTION_COLUMN=xm;Gp.EXPAND_COLUMN=Tm;Gp.SELECTION_ALL=MK;Gp.SELECTION_INVERT=AK;Gp.SELECTION_NONE=PK;Gp.Column=UEt;Gp.ColumnGroup=jEt;Gp.Summary=QLe;const gIt=Gp,pIt="_divIconWrapper_1eud3_1",mIt={divIconWrapper:pIt},c0=i=>kn("div",{className:mIt.divIconWrapper,onClick:e=>{e.stopPropagation(),i.onClick!==void 0&&i.onClick()},children:[i.icon,i.label!==void 0&&Oe("label",{children:i.label})]});class vIt{constructor(){Ss(this,"vms",[])}get length(){return this.vms.length}add(e){this.vms.push(e)}delete(e){this.vms.splice(e,1)}at(e){return this.vms[e]}}const __=new vIt,Av=1024,Pv=Av*1024,Lde=100,FQ=20,W2=5e3;function Gd(i){for(var e=arguments.length,t=Array(e>1?e-1:0),n=1;n3?e.i-4:e.i:Array.isArray(i)?1:BQ(i)?2:WQ(i)?3:0}function cw(i,e){return tx(i)===2?i.has(e):Object.prototype.hasOwnProperty.call(i,e)}function _It(i,e){return tx(i)===2?i.get(e):i[e]}function yEe(i,e,t){var n=tx(i);n===2?i.set(e,t):n===3?i.add(t):i[e]=t}function wEe(i,e){return i===e?i!==0||1/i==1/e:i!=i&&e!=e}function BQ(i){return xIt&&i instanceof Map}function WQ(i){return LIt&&i instanceof Set}function C0(i){return i.o||i.t}function $Q(i){if(Array.isArray(i))return Array.prototype.slice.call(i);var e=xEe(i);delete e[fo];for(var t=uw(e),n=0;n1&&(i.set=i.add=i.clear=i.delete=bIt),Object.freeze(i),e&&oC(i,function(t,n){return HQ(n,!0)},!0)),i}function bIt(){Gd(2)}function VQ(i){return i==null||typeof i!="object"||Object.isFrozen(i)}function Ff(i){var e=HK[i];return e||Gd(18,i),e}function CIt(i,e){HK[i]||(HK[i]=e)}function BK(){return pk}function $7(i,e){e&&(Ff("Patches"),i.u=[],i.s=[],i.v=e)}function dF(i){WK(i),i.p.forEach(yIt),i.p=null}function WK(i){i===pk&&(pk=i.l)}function Ede(i){return pk={p:[],l:pk,h:i,m:!0,_:0}}function yIt(i){var e=i[fo];e.i===0||e.i===1?e.j():e.g=!0}function H7(i,e){e._=e.p.length;var t=e.p[0],n=i!==void 0&&i!==t;return e.h.O||Ff("ES5").S(e,i,n),n?(t[fo].P&&(dF(e),Gd(4)),Wp(i)&&(i=hF(e,i),e.l||fF(e,i)),e.u&&Ff("Patches").M(t[fo].t,i,e.u,e.s)):i=hF(e,t,[]),dF(e),e.u&&e.v(e.u,e.s),i!==SEe?i:void 0}function hF(i,e,t){if(VQ(e))return e;var n=e[fo];if(!n)return oC(e,function(a,l){return Dde(i,n,e,a,l,t)},!0),e;if(n.A!==i)return e;if(!n.P)return fF(i,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var r=n.i===4||n.i===5?n.o=$Q(n.k):n.o,o=r,s=!1;n.i===3&&(o=new Set(r),r.clear(),s=!0),oC(o,function(a,l){return Dde(i,n,r,a,l,t,s)}),fF(i,r,!1),t&&i.u&&Ff("Patches").N(n,t,i.u,i.s)}return n.o}function Dde(i,e,t,n,r,o,s){if(b_(r)){var a=hF(i,r,o&&e&&e.i!==3&&!cw(e.R,n)?o.concat(n):void 0);if(yEe(t,n,a),!b_(a))return;i.m=!1}else s&&t.add(r);if(Wp(r)&&!VQ(r)){if(!i.h.D&&i._<1)return;hF(i,r),e&&e.A.l||fF(i,r)}}function fF(i,e,t){t===void 0&&(t=!1),!i.l&&i.h.D&&i.m&&HQ(e,t)}function V7(i,e){var t=i[fo];return(t?C0(t):i)[e]}function Ide(i,e){if(e in i)for(var t=Object.getPrototypeOf(i);t;){var n=Object.getOwnPropertyDescriptor(t,e);if(n)return n;t=Object.getPrototypeOf(t)}}function Wm(i){i.P||(i.P=!0,i.l&&Wm(i.l))}function z7(i){i.o||(i.o=$Q(i.t))}function $K(i,e,t){var n=BQ(e)?Ff("MapSet").F(e,t):WQ(e)?Ff("MapSet").T(e,t):i.O?function(r,o){var s=Array.isArray(r),a={i:s?1:0,A:o?o.A:BK(),P:!1,I:!1,R:{},l:o,t:r,k:null,o:null,j:null,C:!1},l=a,c=mk;s&&(l=[a],c=qL);var u=Proxy.revocable(l,c),d=u.revoke,h=u.proxy;return a.k=h,a.j=d,h}(e,t):Ff("ES5").J(e,t);return(t?t.A:BK()).p.push(n),n}function wIt(i){return b_(i)||Gd(22,i),function e(t){if(!Wp(t))return t;var n,r=t[fo],o=tx(t);if(r){if(!r.P&&(r.i<4||!Ff("ES5").K(r)))return r.t;r.I=!0,n=kde(t,o),r.I=!1}else n=kde(t,o);return oC(n,function(s,a){r&&_It(r.t,s)===a||yEe(n,s,e(a))}),o===3?new Set(n):n}(i)}function kde(i,e){switch(e){case 2:return new Map(i);case 3:return Array.from(i)}return $Q(i)}function SIt(){function i(o,s){var a=r[o];return a?a.enumerable=s:r[o]=a={configurable:!0,enumerable:s,get:function(){var l=this[fo];return mk.get(l,o)},set:function(l){var c=this[fo];mk.set(c,o,l)}},a}function e(o){for(var s=o.length-1;s>=0;s--){var a=o[s][fo];if(!a.P)switch(a.i){case 5:n(a)&&Wm(a);break;case 4:t(a)&&Wm(a)}}}function t(o){for(var s=o.t,a=o.k,l=uw(a),c=l.length-1;c>=0;c--){var u=l[c];if(u!==fo){var d=s[u];if(d===void 0&&!cw(s,u))return!0;var h=a[u],f=h&&h[fo];if(f?f.t!==d:!wEe(h,d))return!0}}var g=!!s[fo];return l.length!==uw(s).length+(g?0:1)}function n(o){var s=o.k;if(s.length!==o.t.length)return!0;var a=Object.getOwnPropertyDescriptor(s,s.length-1);if(a&&!a.get)return!0;for(var l=0;l1?m-1:0),y=1;y1?u-1:0),h=1;h=0;r--){var o=n[r];if(o.path.length===0&&o.op==="replace"){t=o.value;break}}r>-1&&(n=n.slice(r+1));var s=Ff("Patches").$;return b_(t)?s(t,n):this.produce(t,function(a){return s(a,n)})},i}(),lu=new DIt,LEe=lu.produce;lu.produceWithPatches.bind(lu);lu.setAutoFreeze.bind(lu);lu.setUseProxies.bind(lu);lu.applyPatches.bind(lu);lu.createDraft.bind(lu);lu.finishDraft.bind(lu);function ja(i){return"Minified Redux error #"+i+"; visit https://redux.js.org/Errors?code="+i+" for the full message or use the non-minified dev environment for full errors. "}var Mde=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),U7=function(){return Math.random().toString(36).substring(7).split("").join(".")},gF={INIT:"@@redux/INIT"+U7(),REPLACE:"@@redux/REPLACE"+U7(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+U7()}};function IIt(i){if(typeof i!="object"||i===null)return!1;for(var e=i;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(i)===e}function EEe(i,e,t){var n;if(typeof e=="function"&&typeof t=="function"||typeof t=="function"&&typeof arguments[3]=="function")throw new Error(ja(0));if(typeof e=="function"&&typeof t>"u"&&(t=e,e=void 0),typeof t<"u"){if(typeof t!="function")throw new Error(ja(1));return t(EEe)(i,e)}if(typeof i!="function")throw new Error(ja(2));var r=i,o=e,s=[],a=s,l=!1;function c(){a===s&&(a=s.slice())}function u(){if(l)throw new Error(ja(3));return o}function d(p){if(typeof p!="function")throw new Error(ja(4));if(l)throw new Error(ja(5));var v=!0;return c(),a.push(p),function(){if(v){if(l)throw new Error(ja(6));v=!1,c();var _=a.indexOf(p);a.splice(_,1),s=null}}}function h(p){if(!IIt(p))throw new Error(ja(7));if(typeof p.type>"u")throw new Error(ja(8));if(l)throw new Error(ja(9));try{l=!0,o=r(o,p)}finally{l=!1}for(var v=s=a,m=0;m"u")throw new Error(ja(12));if(typeof t(void 0,{type:gF.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ja(13))})}function TIt(i){for(var e=Object.keys(i),t={},n=0;n"u")throw c&&c.type,new Error(ja(14));d[f]=v,u=u||v!==p}return u=u||o.length!==Object.keys(l).length,u?d:l}}function pF(){for(var i=arguments.length,e=new Array(i),t=0;t0&&o[o.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]{const t=i.vmPageStates[i.activeVmIndex].consoleOutputs.length,n=e.length;n>=W2?i.vmPageStates[i.activeVmIndex].consoleOutputs=e.slice(n-W2):(t+n>W2&&(i.vmPageStates[i.activeVmIndex].consoleOutputs=i.vmPageStates[i.activeVmIndex].consoleOutputs.slice(t+n-W2)),i.vmPageStates[i.activeVmIndex].consoleOutputs.push(...e))},NEe=UQ({name:"vm",initialState:lkt,reducers:{setActiveVmIndex:(i,e)=>{i.activeVmIndex=e.payload},setName:(i,e)=>{i.vmPageStates[e.payload.index].name=e.payload.newName},addVmPageState:(i,e)=>{const t=akt();i.vmPageStates.push({...e.payload,id:t}),i.activeVmIndex=i.vmPageStates.length-1},deleteVmPageState:(i,e)=>{(i.activeVmIndex>e.payload||i.activeVmIndex===e.payload&&i.activeVmIndex===i.vmPageStates.length-1)&&i.activeVmIndex--,i.vmPageStates.splice(e.payload,1)},setIsIrChanged:(i,e)=>{i.vmPageStates[i.activeVmIndex].isIrChanged=e.payload},addConsoleOutputs:(i,e)=>{$de(i,e.payload)},setConsoleInputPrompt:(i,e)=>{i.vmPageStates[i.activeVmIndex].consoleInputPrompt=e.payload},setConsoleInput:(i,e)=>{i.vmPageStates[i.activeVmIndex].consoleInput=e.payload},setShouldIndicateCurrentLineNumber:(i,e)=>{i.vmPageStates[i.activeVmIndex].shouldIndicateCurrentLineNumber=e.payload},setLocalVariableTablesPagination:(i,e)=>{i.vmPageStates[i.activeVmIndex].localVariableTablesPagination={...i.vmPageStates[i.activeVmIndex].localVariableTablesPagination,...e.payload}},reset:i=>{i.vmPageStates[i.activeVmIndex].shouldIndicateCurrentLineNumber=!1,i.vmPageStates[i.activeVmIndex].consoleInputPrompt=[],i.vmPageStates[i.activeVmIndex].consoleInput="",i.vmPageStates[i.activeVmIndex].localVariableTablesPagination={...i.vmPageStates[i.activeVmIndex].localVariableTablesPagination,currentIndex:1}},resetAndSetIrString:(i,e)=>{i.vmPageStates[i.activeVmIndex].shouldIndicateCurrentLineNumber=!1,i.vmPageStates[i.activeVmIndex].consoleInputPrompt=[],i.vmPageStates[i.activeVmIndex].consoleInput="",i.vmPageStates[i.activeVmIndex].localVariableTablesPagination={...i.vmPageStates[i.activeVmIndex].localVariableTablesPagination,currentIndex:1},i.vmPageStates[i.activeVmIndex].irString=e.payload,i.vmPageStates[i.activeVmIndex].isIrChanged=!0},clearConsoleInputAndPrompt:i=>{i.vmPageStates[i.activeVmIndex].consoleInputPrompt=[],i.vmPageStates[i.activeVmIndex].consoleInput=""},clearConsoleInputAndOutput:i=>{i.vmPageStates[i.activeVmIndex].consoleOutputs=[],i.vmPageStates[i.activeVmIndex].consoleInput=""},syncVmState:i=>{const e=__.at(i.activeVmIndex);i.vmPageStates[i.activeVmIndex].state=e.state,i.vmPageStates[i.activeVmIndex].globalVariableDetails=e.globalVariableDetails,i.vmPageStates[i.activeVmIndex].localVariableDetailsStack=e.localVariableDetailsStack,i.vmPageStates[i.activeVmIndex].options=e.currentOptions,i.vmPageStates[i.activeVmIndex].stepCount=e.stepCount,i.vmPageStates[i.activeVmIndex].memoryUsage=e.memoryUsage,i.vmPageStates[i.activeVmIndex].peakMemoryUsage=e.currentPeakMemoryUsage,i.vmPageStates[i.activeVmIndex].staticErrors=e.staticErrors,i.vmPageStates[i.activeVmIndex].runtimeErrors=e.runtimeErrors,i.vmPageStates[i.activeVmIndex].currentLineNumber=e.currentLineNumber,e.flushWriteBuffer(t=>$de(i,t))}}}),{setActiveVmIndex:ckt,setName:ukt,addVmPageState:REe,deleteVmPageState:dkt,setIsIrChanged:hkt,addConsoleOutputs:Hde,setConsoleInputPrompt:fkt,setConsoleInput:gkt,setShouldIndicateCurrentLineNumber:H2,setLocalVariableTablesPagination:pkt,reset:mkt,resetAndSetIrString:vkt,clearConsoleInputAndPrompt:_kt,clearConsoleInputAndOutput:bkt,syncVmState:cp}=NEe.actions,Ckt=NEe.reducer,Vde=new Int32Array(1);function Zl(i){return Vde[0]=i,Vde[0]}function Oc(i,e){return Zl(i+e)}function V2(i,e){return Zl(i-e)}function ykt(i,e){const t=(i&4294901760)>>>16,n=i&65535,r=(e&4294901760)>>>16,o=e&65535;return Zl((t*o+n*r<<16)+n*o)}function wkt(i,e){return Zl(i/e)}var zK=(i=>(i[i.SUCCESS=0]="SUCCESS",i[i.OUT_OF_BOUND=1]="OUT_OF_BOUND",i))(zK||{}),MEe=(i=>(i[i.SUCCESS=0]="SUCCESS",i[i.OUT_OF_BOUND=1]="OUT_OF_BOUND",i))(MEe||{});function zde(i,e){return i<0||i+4>e.length?{value:null,status:1}:{value:Zl(e[i]|e[i+1]<<8|e[i+2]<<16|e[i+3]<<24),status:0}}function Skt(i,e,t){return e<0||e+4>t.length?1:(t[e]=i&255,t[e+1]=(i&65280)>>>8,t[e+2]=(i&16711680)>>>16,t[e+3]=(i&4278190080)>>>24,0)}var iA=(i=>(i[i.IMM=0]="IMM",i[i.ID=1]="ID",i[i.ADDRESS_ID=2]="ADDRESS_ID",i[i.DEREF_ID=3]="DEREF_ID",i))(iA||{}),XL=(i=>(i[i.ADD=0]="ADD",i[i.SUB=1]="SUB",i[i.MUL=2]="MUL",i[i.DIV=3]="DIV",i))(XL||{}),y0=(i=>(i[i.EQ=0]="EQ",i[i.NE=1]="NE",i[i.LT=2]="LT",i[i.LE=3]="LE",i[i.GT=4]="GT",i[i.GE=5]="GE",i))(y0||{}),YL=(i=>(i[i.ID=0]="ID",i[i.DEREF_ID=1]="DEREF_ID",i))(YL||{}),UK=(i=>(i[i.SINGULAR=0]="SINGULAR",i[i.BINARY_MATH_OP=1]="BINARY_MATH_OP",i))(UK||{}),B1=(i=>(i[i.FUNCTION=0]="FUNCTION",i[i.ASSIGN=1]="ASSIGN",i[i.DEC=2]="DEC",i[i.GLOBAL_DEC=3]="GLOBAL_DEC",i[i.LABEL=4]="LABEL",i[i.GOTO=5]="GOTO",i[i.IF=6]="IF",i[i.ARG=7]="ARG",i[i.CALL=8]="CALL",i[i.ASSIGN_CALL=9]="ASSIGN_CALL",i[i.PARAM=10]="PARAM",i[i.RETURN=11]="RETURN",i[i.READ=12]="READ",i[i.WRITE=13]="WRITE",i[i.EMPTY=14]="EMPTY",i[i.COMMENT=15]="COMMENT",i[i.ERROR=16]="ERROR",i))(B1||{}),Mo=(i=>(i[i.ASSIGN=1]="ASSIGN",i[i.DEC=2]="DEC",i[i.GLOBAL_DEC=3]="GLOBAL_DEC",i[i.GOTO=5]="GOTO",i[i.IF=6]="IF",i[i.ARG=7]="ARG",i[i.CALL=8]="CALL",i[i.ASSIGN_CALL=9]="ASSIGN_CALL",i[i.PARAM=10]="PARAM",i[i.RETURN=11]="RETURN",i[i.READ=12]="READ",i[i.WRITE=13]="WRITE",i))(Mo||{});const rA=["FUNCTION","DEC","GLOBAL_DEC","LABEL","GOTO","IF","ARG","PARAM","CALL","RETURN","READ","WRITE"],xkt=new Set(rA),Vd="[a-zA-Z_$][\\w$]*",AEe="\\d+",jK="-?\\d+";class Lkt{constructor(){Ss(this,"patternId",new RegExp(`^(?${Vd})$`));Ss(this,"patternSize",new RegExp(`^(?${AEe})$`));Ss(this,"patternSingular",new RegExp(`^(#(?${jK}))$|^(?${Vd})$|^(\\*(?${Vd}))$|^(&(?${Vd}))$`));Ss(this,"patternLValue",new RegExp(`^((?${Vd}))$|^(\\*(?${Vd}))$`));Ss(this,"illegalInstructionFormatError",{type:16,messageKey:"ILLEGAL_INSTRUCTION_FORMAT"})}purify(e){return e.trim().replaceAll(/[ \t]+/g," ")}decodeComponentId(e){const t=e.match(this.patternId);return t===null||xkt.has(e)?null:t.groups.id}decodeComponentSize(e){const t=e.match(this.patternSize);if(t===null)return null;const n=parseInt(t.groups.size);return Number.isSafeInteger(n)?Zl(n):1/0}decodeComponentSingular(e){const t=e.match(this.patternSingular);if(t===null)return null;if(t.groups.imm!==void 0){const n=parseInt(t.groups.imm);return Number.isSafeInteger(n)?{type:0,imm:Zl(n)}:{type:0,imm:1/0}}else return t.groups.id!==void 0?{type:1,id:t.groups.id}:t.groups.derefId!==void 0?{type:3,id:t.groups.derefId}:{type:2,id:t.groups.addressId}}decodeComponentLValue(e){const t=e.match(this.patternLValue);return t===null?null:t.groups.id!==void 0?{type:0,id:t.groups.id}:{type:1,id:t.groups.derefId}}decodeFunction(e){if(e.length!==3||e[2]!==":")return this.illegalInstructionFormatError;const t=this.decodeComponentId(e[1]);return t===null?{type:16,messageKey:"FUNCTION_ILLEGAL_ID"}:{type:0,value:{id:t}}}decodeAssign(e){if(e.length!==3&&e.length!==5||e[1]!==":=")return this.illegalInstructionFormatError;const t=this.decodeComponentLValue(e[0]);if(t===null)return{type:16,messageKey:"ASSIGN_ILLEGAL_LEFT"};const n=this.decodeComponentSingular(e[2]);if(n===null)return{type:16,messageKey:e.length===3?"ASSIGN_ILLEGAL_RIGHT":"ASSIGN_ILLEGAL_RIGHT_OPERAND1"};if(n.type===0&&!Number.isFinite(n.imm))return{type:16,messageKey:e.length===3?"ASSIGN_RIGHT_IMM_TOO_LARGE":"ASSIGN_RIGHT_OPERAND1_IMM_TOO_LARGE"};if(e.length===3)return{type:1,value:{lValue:t,rValue:{type:0,singular:n}}};{let r=0;switch(e[3]){case"+":r=0;break;case"-":r=1;break;case"*":r=2;break;case"/":r=3;break;default:return{type:16,messageKey:"ASSIGN_ILLEGAL_RIGHT_OPERATOR"}}const o=this.decodeComponentSingular(e[4]);return o===null?{type:16,messageKey:"ASSIGN_ILLEGAL_RIGHT_OPERAND2"}:o.type===0&&!Number.isFinite(o.imm)?{type:16,messageKey:"ASSIGN_RIGHT_OPERAND2_IMM_TOO_LARGE"}:{type:1,value:{lValue:t,rValue:{type:1,singularL:n,singularR:o,binaryMathOp:r}}}}}decodeDec(e){if(e.length!==3)return this.illegalInstructionFormatError;const t=this.decodeComponentId(e[1]);if(t===null)return{type:16,messageKey:"DEC_ILLEGAL_ID"};const n=this.decodeComponentSize(e[2]);return n===null?{type:16,messageKey:"DEC_ILLEGAL_SIZE_FORMAT"}:Number.isFinite(n)?n%4!==0?{type:16,messageKey:"DEC_SIZE_NOT_4_MULTIPLE"}:{type:2,value:{id:t,size:n}}:{type:16,messageKey:"DEC_SIZE_TOO_LARGE"}}decodeGlobalDec(e){if(e.length!==3)return this.illegalInstructionFormatError;const t=this.decodeComponentId(e[1]);if(t===null)return{type:16,messageKey:"GLOBAL_DEC_ILLEGAL_ID"};const n=this.decodeComponentSize(e[2]);return n===null?{type:16,messageKey:"GLOBAL_DEC_ILLEGAL_SIZE_FORMAT"}:Number.isFinite(n)?n%4!==0?{type:16,messageKey:"GLOBAL_DEC_SIZE_NOT_4_MULTIPLE"}:{type:3,value:{id:t,size:n}}:{type:16,messageKey:"GLOBAL_DEC_SIZE_TOO_LARGE"}}decodeLabel(e){if(e.length!==3||e[2]!==":")return this.illegalInstructionFormatError;const t=this.decodeComponentId(e[1]);return t===null?{type:16,messageKey:"LABEL_ILLEGAL_ID"}:{type:4,value:{id:t}}}decodeGoto(e){if(e.length!==2)return this.illegalInstructionFormatError;const t=this.decodeComponentId(e[1]);return t===null?{type:16,messageKey:"GOTO_ILLEGAL_ID"}:{type:5,value:{id:t}}}decodeIf(e){if(e.length!==6||e[4]!=="GOTO")return this.illegalInstructionFormatError;const t=this.decodeComponentSingular(e[1]);if(t===null)return{type:16,messageKey:"IF_ILLEGAL_COND_OPERAND1"};if(t.type===0&&!Number.isFinite(t.imm))return{type:16,messageKey:"IF_COND_OPERAND1_IMM_TOO_LARGE"};let n=0;switch(e[2]){case"==":n=0;break;case"!=":n=1;break;case"<":n=2;break;case"<=":n=3;break;case">":n=4;break;case">=":n=5;break;default:return{type:16,messageKey:"IF_ILLEGAL_COND_OPERATOR"}}const r=this.decodeComponentSingular(e[3]);if(r===null)return{type:16,messageKey:"IF_ILLEGAL_COND_OPERAND2"};if(r.type===0&&!Number.isFinite(r.imm))return{type:16,messageKey:"IF_COND_OPERAND2_IMM_TOO_LARGE"};const o=this.decodeComponentId(e[5]);return o===null?{type:16,messageKey:"IF_ILLEGAL_GOTO_ID"}:{type:6,value:{condition:{singularL:t,singularR:r,binaryRelOp:n},gotoId:o}}}decodeArg(e){if(e.length!==2)return this.illegalInstructionFormatError;const t=this.decodeComponentSingular(e[1]);return t===null?{type:16,messageKey:"ARG_ILLEGAL"}:t.type===0&&!Number.isFinite(t.imm)?{type:16,messageKey:"ARG_IMM_TOO_LARGE"}:{type:7,value:{value:t}}}decodeCall(e){if(e.length!==2)return this.illegalInstructionFormatError;const t=this.decodeComponentId(e[1]);return t===null?{type:16,messageKey:"CALL_ILLEGAL_ID"}:{type:8,value:{id:t}}}decodeAssignCall(e){if(e.length!==4||e[1]!==":="||e[2]!=="CALL")return this.illegalInstructionFormatError;const t=this.decodeComponentLValue(e[0]);if(t===null)return{type:16,messageKey:"ASSIGN_ILLEGAL_LEFT"};const n=this.decodeComponentId(e[3]);return n===null?{type:16,messageKey:"CALL_ILLEGAL_ID"}:{type:9,value:{lValue:t,functionId:n}}}decodeParam(e){if(e.length!==2)return this.illegalInstructionFormatError;const t=this.decodeComponentId(e[1]);return t===null?{type:16,messageKey:"PARAM_ILLEGAL_ID"}:{type:10,value:{id:t}}}decodeReturn(e){if(e.length!==2)return this.illegalInstructionFormatError;const t=this.decodeComponentSingular(e[1]);return t===null?{type:16,messageKey:"RETURN_ILLEGAL"}:t.type===0&&!Number.isFinite(t.imm)?{type:16,messageKey:"RETURN_IMM_TOO_LARGE"}:{type:11,value:{value:t}}}decodeRead(e){if(e.length!==2)return this.illegalInstructionFormatError;const t=this.decodeComponentLValue(e[1]);return t===null?{type:16,messageKey:"READ_ILLEGAL"}:{type:12,value:{lValue:t}}}decodeWrite(e){if(e.length!==2)return this.illegalInstructionFormatError;const t=this.decodeComponentSingular(e[1]);return t===null?{type:16,messageKey:"WRITE_ILLEGAL"}:t.type===0&&!Number.isFinite(t.imm)?{type:16,messageKey:"WRITE_IMM_TOO_LARGE"}:{type:13,value:{value:t}}}decode(e){if(e.match(/^[ \t]*$/))return{type:14};const t={type:16,messageKey:"UNRECOGNIZED_INSTRUCTION"},n=this.purify(e);if(n.startsWith(";"))return{type:15};const r=n.split(" ");if(r.length<1)return t;switch(r[0]){case"FUNCTION":return this.decodeFunction(r);case"DEC":return this.decodeDec(r);case"GLOBAL_DEC":return this.decodeGlobalDec(r);case"LABEL":return this.decodeLabel(r);case"GOTO":return this.decodeGoto(r);case"IF":return this.decodeIf(r);case"ARG":return this.decodeArg(r);case"CALL":return this.decodeCall(r);case"PARAM":return this.decodeParam(r);case"RETURN":return this.decodeReturn(r);case"READ":return this.decodeRead(r);case"WRITE":return this.decodeWrite(r);default:{const o=this.decodeAssign(r);if(o.type===1)return o;const s=this.decodeAssignCall(r);return s.type===9?s:o}}}}var sa={},Ekt={get exports(){return sa},set exports(i){sa=i}};/** + `]:{background:p},[`&${e}-row-selected`]:{["> th, > td"]:{background:v},["&:hover > th, &:hover > td"]:{background:m}}}},[`${e}-footer`]:{padding:`${n}px ${r}px`,color:_,background:y}})}},cIt=vo("Table",i=>{const{controlItemBgActive:e,controlItemBgActiveHover:t,colorTextPlaceholder:n,colorTextHeading:r,colorSplit:o,colorBorderSecondary:s,fontSize:a,padding:l,paddingXS:c,paddingSM:u,controlHeight:d,colorFillAlter:h,colorIcon:f,colorIconHover:g,opacityLoading:p,colorBgContainer:v,borderRadiusLG:m,colorFillContent:_,colorFillSecondary:y,controlInteractiveSize:S}=i,L=new Yr(f),E=new Yr(g),D=e,k=2,T=new Yr(y).onBackground(v).toHexShortString(),M=new Yr(_).onBackground(v).toHexShortString(),A=new Yr(h).onBackground(v).toHexShortString(),N=Oi(i,{tableFontSize:a,tableBg:v,tableRadius:m,tablePaddingVertical:l,tablePaddingHorizontal:l,tablePaddingVerticalMiddle:u,tablePaddingHorizontalMiddle:c,tablePaddingVerticalSmall:c,tablePaddingHorizontalSmall:c,tableBorderColor:s,tableHeaderTextColor:r,tableHeaderBg:A,tableFooterTextColor:r,tableFooterBg:A,tableHeaderCellSplitColor:s,tableHeaderSortBg:T,tableHeaderSortHoverBg:M,tableHeaderIconColor:L.clone().setAlpha(L.getAlpha()*p).toRgbString(),tableHeaderIconColorHover:E.clone().setAlpha(E.getAlpha()*p).toRgbString(),tableBodySortBg:A,tableFixedHeaderSortActiveBg:T,tableHeaderFilterActiveBg:_,tableFilterDropdownBg:v,tableRowHoverBg:A,tableSelectedRowBg:D,tableSelectedRowHoverBg:t,zIndexTableFixed:k,zIndexTableSticky:k+1,tableFontSizeMiddle:a,tableFontSizeSmall:a,tableSelectionColumnWidth:d,tableExpandIconBg:v,tableExpandColumnWidth:S+2*i.padding,tableExpandedRowBg:h,tableFilterDropdownWidth:120,tableFilterDropdownHeight:264,tableFilterDropdownSearchWidth:140,tableScrollThumbSize:8,tableScrollThumbBg:n,tableScrollThumbBgHover:r,tableScrollBg:o});return[lIt(N),qDt(N),xde(N),rIt(N),UDt(N),ODt(N),YDt(N),VDt(N),xde(N),$Dt(N),eIt(N),KDt(N),sIt(N),BDt(N),nIt(N),QDt(N)]}),uIt=[],dIt=(i,e)=>{const{prefixCls:t,className:n,rootClassName:r,style:o,size:s,bordered:a,dropdownPrefixCls:l,dataSource:c,pagination:u,rowSelection:d,rowKey:h="key",rowClassName:f,columns:g,children:p,childrenColumnName:v,onChange:m,getPopupContainer:_,loading:y,expandIcon:S,expandable:L,expandedRowRender:E,expandIconColumnIndex:D,indentSize:k,scroll:T,sortDirections:M,locale:A,showSorterTooltip:N=!0}=i,R=C.useMemo(()=>g||MQ(p),[g,p]),F=C.useMemo(()=>R.some(zt=>zt.responsive),[R]),W=B5(F),H=C.useMemo(()=>{const zt=new Set(Object.keys(W).filter(Qt=>W[Qt]));return R.filter(Qt=>!Qt.responsive||Qt.responsive.some(lt=>zt.has(lt)))},[R,W]),G=ll(i,["className","style","columns"]),U=C.useContext(Rh),{locale:K=tC,direction:re,renderEmpty:Y,getPrefixCls:J,getPopupContainer:Q}=C.useContext(Rn),ue=s||U,de=Object.assign(Object.assign({},K.Table),A),_e=c||uIt,ve=J("table",t),Ve=J("dropdown",l),Ze=Object.assign({childrenColumnName:v,expandIconColumnIndex:D},L),{childrenColumnName:We="children"}=Ze,pe=C.useMemo(()=>_e.some(zt=>zt==null?void 0:zt[We])?"nest":E||L&&L.expandedRowRender?"row":null,[_e]),Pe={body:C.useRef()},Se=C.useMemo(()=>typeof h=="function"?h:zt=>zt==null?void 0:zt[h],[h]),[Ne]=DDt(_e,We,Se),Me={},Qe=function(zt,Qt){let lt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;var ut,dt,Mt;const Kt=Object.assign(Object.assign({},Me),zt);lt&&((ut=Me.resetPagination)===null||ut===void 0||ut.call(Me),!((dt=Kt.pagination)===null||dt===void 0)&&dt.current&&(Kt.pagination.current=1),u&&u.onChange&&u.onChange(1,(Mt=Kt.pagination)===null||Mt===void 0?void 0:Mt.pageSize)),T&&T.scrollToFirstRowOnChange!==!1&&Pe.body.current&&gvt(0,{getContainer:()=>Pe.body.current}),m==null||m(Kt.pagination,Kt.filters,Kt.sorter,{currentDataSource:bde(FK(_e,Kt.sorterStates,We),Kt.filterStates),action:Qt})},Ke=(zt,Qt)=>{Qe({sorter:zt,sorterStates:Qt},"sort",!1)},[Re,ct,ie,le]=MDt({prefixCls:ve,mergedColumns:H,onSorterChange:Ke,sortDirections:M||["ascend","descend"],tableLocale:de,showSorterTooltip:N}),ce=C.useMemo(()=>FK(_e,ct,We),[_e,ct]);Me.sorter=le(),Me.sorterStates=ct;const z=(zt,Qt)=>{Qe({filters:zt,filterStates:Qt},"filter",!0)},[q,oe,ne]=EDt({prefixCls:ve,locale:de,dropdownPrefixCls:Ve,mergedColumns:H,onFilterChange:z,getPopupContainer:_||Q}),he=bde(ce,oe);Me.filters=ne,Me.filterStates=oe;const Le=C.useMemo(()=>{const zt={};return Object.keys(ne).forEach(Qt=>{ne[Qt]!==null&&(zt[Qt]=ne[Qt])}),Object.assign(Object.assign({},ie),{filters:zt})},[ie,ne]),[Fe]=ADt(Le),ze=(zt,Qt)=>{Qe({pagination:Object.assign(Object.assign({},Me.pagination),{current:zt,pageSize:Qt})},"paginate")},[Ue,nt]=TDt(he.length,ze,u);Me.pagination=u===!1?{}:kDt(Ue,u),Me.resetPagination=nt;const it=C.useMemo(()=>{if(u===!1||!Ue.pageSize)return he;const{current:zt=1,total:Qt,pageSize:lt=vEe}=Ue;return he.lengthlt?he.slice((zt-1)*lt,zt*lt):he:he.slice((zt-1)*lt,zt*lt)},[!!u,he,Ue&&Ue.current,Ue&&Ue.pageSize,Ue&&Ue.total]),[at,tt]=NDt({prefixCls:ve,data:he,pageData:it,getRowKey:Se,getRecordByKey:Ne,expandType:pe,childrenColumnName:We,locale:de,getPopupContainer:_||Q},d),Zt=(zt,Qt,lt)=>{let ut;return typeof f=="function"?ut=xe(f(zt,Qt,lt)):ut=xe(f),xe({[`${ve}-row-selected`]:tt.has(Se(zt,Qt))},ut)};Ze.__PARENT_RENDER_ICON__=Ze.expandIcon,Ze.expandIcon=Ze.expandIcon||S||KEt(de),pe==="nest"&&Ze.expandIconColumnIndex===void 0?Ze.expandIconColumnIndex=d?1:0:Ze.expandIconColumnIndex>0&&d&&(Ze.expandIconColumnIndex-=1),typeof Ze.indentSize!="number"&&(Ze.indentSize=typeof k=="number"?k:15);const Tt=C.useCallback(zt=>Fe(at(q(Re(zt)))),[Re,q,at]);let xn,rt;if(u!==!1&&(Ue!=null&&Ue.total)){let zt;Ue.size?zt=Ue.size:zt=ue==="small"||ue==="middle"?"small":void 0;const Qt=dt=>C.createElement(kQ,Object.assign({},Ue,{className:xe(`${ve}-pagination ${ve}-pagination-${dt}`,Ue.className),size:zt})),lt=re==="rtl"?"left":"right",{position:ut}=Ue;if(ut!==null&&Array.isArray(ut)){const dt=ut.find(mn=>mn.includes("top")),Mt=ut.find(mn=>mn.includes("bottom")),Kt=ut.every(mn=>`${mn}`=="none");!dt&&!Mt&&!Kt&&(rt=Qt(lt)),dt&&(xn=Qt(dt.toLowerCase().replace("top",""))),Mt&&(rt=Qt(Mt.toLowerCase().replace("bottom","")))}else rt=Qt(lt)}let wt;typeof y=="boolean"?wt={spinning:y}:typeof y=="object"&&(wt=Object.assign({spinning:!0},y));const[Bt,Nt]=cIt(ve),nn=xe(`${ve}-wrapper`,{[`${ve}-wrapper-rtl`]:re==="rtl"},n,r,Nt),Mn=A&&A.emptyText||(Y==null?void 0:Y("Table"))||C.createElement(nQ,{componentName:"Table"});return Bt(C.createElement("div",{ref:e,className:nn,style:o},C.createElement(VLe,Object.assign({spinning:!1},wt),xn,C.createElement(GEt,Object.assign({},G,{columns:H,direction:re,expandable:Ze,prefixCls:ve,className:xe({[`${ve}-middle`]:ue==="middle",[`${ve}-small`]:ue==="small",[`${ve}-bordered`]:a,[`${ve}-empty`]:_e.length===0}),data:it,rowKey:Se,rowClassName:Zt,emptyText:Mn,internalHooks:cF,internalRefs:Pe,transformColumns:Tt})),rt)))},hIt=C.forwardRef(dIt),fIt=(i,e)=>{const t=C.useRef(0);return t.current+=1,C.createElement(hIt,Object.assign({},i,{ref:e,_renderTimes:t.current}))},qp=C.forwardRef(fIt);qp.SELECTION_COLUMN=Lm;qp.EXPAND_COLUMN=Nm;qp.SELECTION_ALL=MK;qp.SELECTION_INVERT=AK;qp.SELECTION_NONE=PK;qp.Column=UEt;qp.ColumnGroup=jEt;qp.Summary=QLe;const gIt=qp,pIt="_divIconWrapper_1eud3_1",mIt={divIconWrapper:pIt},l0=i=>kn("div",{className:mIt.divIconWrapper,onClick:e=>{e.stopPropagation(),i.onClick!==void 0&&i.onClick()},children:[i.icon,i.label!==void 0&&Oe("label",{children:i.label})]});class vIt{constructor(){Ss(this,"vms",[])}get length(){return this.vms.length}add(e){this.vms.push(e)}delete(e){this.vms.splice(e,1)}at(e){return this.vms[e]}}const v_=new vIt,_b=1024,yp=_b*1024,Lde=100,FQ=20,W2=5e3;function Gd(i){for(var e=arguments.length,t=Array(e>1?e-1:0),n=1;n3?e.i-4:e.i:Array.isArray(i)?1:BQ(i)?2:WQ(i)?3:0}function cw(i,e){return tx(i)===2?i.has(e):Object.prototype.hasOwnProperty.call(i,e)}function _It(i,e){return tx(i)===2?i.get(e):i[e]}function yEe(i,e,t){var n=tx(i);n===2?i.set(e,t):n===3?i.add(t):i[e]=t}function wEe(i,e){return i===e?i!==0||1/i==1/e:i!=i&&e!=e}function BQ(i){return xIt&&i instanceof Map}function WQ(i){return LIt&&i instanceof Set}function b0(i){return i.o||i.t}function $Q(i){if(Array.isArray(i))return Array.prototype.slice.call(i);var e=xEe(i);delete e[fo];for(var t=uw(e),n=0;n1&&(i.set=i.add=i.clear=i.delete=bIt),Object.freeze(i),e&&oC(i,function(t,n){return HQ(n,!0)},!0)),i}function bIt(){Gd(2)}function VQ(i){return i==null||typeof i!="object"||Object.isFrozen(i)}function Ff(i){var e=HK[i];return e||Gd(18,i),e}function CIt(i,e){HK[i]||(HK[i]=e)}function BK(){return pk}function $7(i,e){e&&(Ff("Patches"),i.u=[],i.s=[],i.v=e)}function dF(i){WK(i),i.p.forEach(yIt),i.p=null}function WK(i){i===pk&&(pk=i.l)}function Ede(i){return pk={p:[],l:pk,h:i,m:!0,_:0}}function yIt(i){var e=i[fo];e.i===0||e.i===1?e.j():e.g=!0}function H7(i,e){e._=e.p.length;var t=e.p[0],n=i!==void 0&&i!==t;return e.h.O||Ff("ES5").S(e,i,n),n?(t[fo].P&&(dF(e),Gd(4)),$p(i)&&(i=hF(e,i),e.l||fF(e,i)),e.u&&Ff("Patches").M(t[fo].t,i,e.u,e.s)):i=hF(e,t,[]),dF(e),e.u&&e.v(e.u,e.s),i!==SEe?i:void 0}function hF(i,e,t){if(VQ(e))return e;var n=e[fo];if(!n)return oC(e,function(a,l){return Dde(i,n,e,a,l,t)},!0),e;if(n.A!==i)return e;if(!n.P)return fF(i,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var r=n.i===4||n.i===5?n.o=$Q(n.k):n.o,o=r,s=!1;n.i===3&&(o=new Set(r),r.clear(),s=!0),oC(o,function(a,l){return Dde(i,n,r,a,l,t,s)}),fF(i,r,!1),t&&i.u&&Ff("Patches").N(n,t,i.u,i.s)}return n.o}function Dde(i,e,t,n,r,o,s){if(__(r)){var a=hF(i,r,o&&e&&e.i!==3&&!cw(e.R,n)?o.concat(n):void 0);if(yEe(t,n,a),!__(a))return;i.m=!1}else s&&t.add(r);if($p(r)&&!VQ(r)){if(!i.h.D&&i._<1)return;hF(i,r),e&&e.A.l||fF(i,r)}}function fF(i,e,t){t===void 0&&(t=!1),!i.l&&i.h.D&&i.m&&HQ(e,t)}function V7(i,e){var t=i[fo];return(t?b0(t):i)[e]}function Ide(i,e){if(e in i)for(var t=Object.getPrototypeOf(i);t;){var n=Object.getOwnPropertyDescriptor(t,e);if(n)return n;t=Object.getPrototypeOf(t)}}function $m(i){i.P||(i.P=!0,i.l&&$m(i.l))}function z7(i){i.o||(i.o=$Q(i.t))}function $K(i,e,t){var n=BQ(e)?Ff("MapSet").F(e,t):WQ(e)?Ff("MapSet").T(e,t):i.O?function(r,o){var s=Array.isArray(r),a={i:s?1:0,A:o?o.A:BK(),P:!1,I:!1,R:{},l:o,t:r,k:null,o:null,j:null,C:!1},l=a,c=mk;s&&(l=[a],c=qL);var u=Proxy.revocable(l,c),d=u.revoke,h=u.proxy;return a.k=h,a.j=d,h}(e,t):Ff("ES5").J(e,t);return(t?t.A:BK()).p.push(n),n}function wIt(i){return __(i)||Gd(22,i),function e(t){if(!$p(t))return t;var n,r=t[fo],o=tx(t);if(r){if(!r.P&&(r.i<4||!Ff("ES5").K(r)))return r.t;r.I=!0,n=kde(t,o),r.I=!1}else n=kde(t,o);return oC(n,function(s,a){r&&_It(r.t,s)===a||yEe(n,s,e(a))}),o===3?new Set(n):n}(i)}function kde(i,e){switch(e){case 2:return new Map(i);case 3:return Array.from(i)}return $Q(i)}function SIt(){function i(o,s){var a=r[o];return a?a.enumerable=s:r[o]=a={configurable:!0,enumerable:s,get:function(){var l=this[fo];return mk.get(l,o)},set:function(l){var c=this[fo];mk.set(c,o,l)}},a}function e(o){for(var s=o.length-1;s>=0;s--){var a=o[s][fo];if(!a.P)switch(a.i){case 5:n(a)&&$m(a);break;case 4:t(a)&&$m(a)}}}function t(o){for(var s=o.t,a=o.k,l=uw(a),c=l.length-1;c>=0;c--){var u=l[c];if(u!==fo){var d=s[u];if(d===void 0&&!cw(s,u))return!0;var h=a[u],f=h&&h[fo];if(f?f.t!==d:!wEe(h,d))return!0}}var g=!!s[fo];return l.length!==uw(s).length+(g?0:1)}function n(o){var s=o.k;if(s.length!==o.t.length)return!0;var a=Object.getOwnPropertyDescriptor(s,s.length-1);if(a&&!a.get)return!0;for(var l=0;l1?m-1:0),y=1;y1?u-1:0),h=1;h=0;r--){var o=n[r];if(o.path.length===0&&o.op==="replace"){t=o.value;break}}r>-1&&(n=n.slice(r+1));var s=Ff("Patches").$;return __(t)?s(t,n):this.produce(t,function(a){return s(a,n)})},i}(),lu=new DIt,LEe=lu.produce;lu.produceWithPatches.bind(lu);lu.setAutoFreeze.bind(lu);lu.setUseProxies.bind(lu);lu.applyPatches.bind(lu);lu.createDraft.bind(lu);lu.finishDraft.bind(lu);function ja(i){return"Minified Redux error #"+i+"; visit https://redux.js.org/Errors?code="+i+" for the full message or use the non-minified dev environment for full errors. "}var Mde=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),U7=function(){return Math.random().toString(36).substring(7).split("").join(".")},gF={INIT:"@@redux/INIT"+U7(),REPLACE:"@@redux/REPLACE"+U7(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+U7()}};function IIt(i){if(typeof i!="object"||i===null)return!1;for(var e=i;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(i)===e}function EEe(i,e,t){var n;if(typeof e=="function"&&typeof t=="function"||typeof t=="function"&&typeof arguments[3]=="function")throw new Error(ja(0));if(typeof e=="function"&&typeof t>"u"&&(t=e,e=void 0),typeof t<"u"){if(typeof t!="function")throw new Error(ja(1));return t(EEe)(i,e)}if(typeof i!="function")throw new Error(ja(2));var r=i,o=e,s=[],a=s,l=!1;function c(){a===s&&(a=s.slice())}function u(){if(l)throw new Error(ja(3));return o}function d(p){if(typeof p!="function")throw new Error(ja(4));if(l)throw new Error(ja(5));var v=!0;return c(),a.push(p),function(){if(v){if(l)throw new Error(ja(6));v=!1,c();var _=a.indexOf(p);a.splice(_,1),s=null}}}function h(p){if(!IIt(p))throw new Error(ja(7));if(typeof p.type>"u")throw new Error(ja(8));if(l)throw new Error(ja(9));try{l=!0,o=r(o,p)}finally{l=!1}for(var v=s=a,m=0;m"u")throw new Error(ja(12));if(typeof t(void 0,{type:gF.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ja(13))})}function TIt(i){for(var e=Object.keys(i),t={},n=0;n"u")throw c&&c.type,new Error(ja(14));d[f]=v,u=u||v!==p}return u=u||o.length!==Object.keys(l).length,u?d:l}}function pF(){for(var i=arguments.length,e=new Array(i),t=0;t0&&o[o.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]{const t=i.vmPageStates[i.activeVmIndex].consoleOutputs.length,n=e.length;n>=W2?i.vmPageStates[i.activeVmIndex].consoleOutputs=e.slice(n-W2):(t+n>W2&&(i.vmPageStates[i.activeVmIndex].consoleOutputs=i.vmPageStates[i.activeVmIndex].consoleOutputs.slice(t+n-W2)),i.vmPageStates[i.activeVmIndex].consoleOutputs.push(...e))},NEe=UQ({name:"vm",initialState:lkt,reducers:{setActiveVmIndex:(i,e)=>{i.activeVmIndex=e.payload},setName:(i,e)=>{i.vmPageStates[e.payload.index].name=e.payload.newName},addVmPageState:(i,e)=>{const t=akt();i.vmPageStates.push({...e.payload,id:t}),i.activeVmIndex=i.vmPageStates.length-1},deleteVmPageState:(i,e)=>{(i.activeVmIndex>e.payload||i.activeVmIndex===e.payload&&i.activeVmIndex===i.vmPageStates.length-1)&&i.activeVmIndex--,i.vmPageStates.splice(e.payload,1)},setIsIrChanged:(i,e)=>{i.vmPageStates[i.activeVmIndex].isIrChanged=e.payload},addConsoleOutputs:(i,e)=>{$de(i,e.payload)},setConsoleInputPrompt:(i,e)=>{i.vmPageStates[i.activeVmIndex].consoleInputPrompt=e.payload},setConsoleInput:(i,e)=>{i.vmPageStates[i.activeVmIndex].consoleInput=e.payload},setShouldIndicateCurrentLineNumber:(i,e)=>{i.vmPageStates[i.activeVmIndex].shouldIndicateCurrentLineNumber=e.payload},setLocalVariableTablesPagination:(i,e)=>{i.vmPageStates[i.activeVmIndex].localVariableTablesPagination={...i.vmPageStates[i.activeVmIndex].localVariableTablesPagination,...e.payload}},reset:i=>{i.vmPageStates[i.activeVmIndex].shouldIndicateCurrentLineNumber=!1,i.vmPageStates[i.activeVmIndex].consoleInputPrompt=[],i.vmPageStates[i.activeVmIndex].consoleInput="",i.vmPageStates[i.activeVmIndex].localVariableTablesPagination={...i.vmPageStates[i.activeVmIndex].localVariableTablesPagination,currentIndex:1}},resetAndSetIrString:(i,e)=>{i.vmPageStates[i.activeVmIndex].shouldIndicateCurrentLineNumber=!1,i.vmPageStates[i.activeVmIndex].consoleInputPrompt=[],i.vmPageStates[i.activeVmIndex].consoleInput="",i.vmPageStates[i.activeVmIndex].localVariableTablesPagination={...i.vmPageStates[i.activeVmIndex].localVariableTablesPagination,currentIndex:1},i.vmPageStates[i.activeVmIndex].irString=e.payload,i.vmPageStates[i.activeVmIndex].isIrChanged=!0},clearConsoleInputAndPrompt:i=>{i.vmPageStates[i.activeVmIndex].consoleInputPrompt=[],i.vmPageStates[i.activeVmIndex].consoleInput=""},clearConsoleInputAndOutput:i=>{i.vmPageStates[i.activeVmIndex].consoleOutputs=[],i.vmPageStates[i.activeVmIndex].consoleInput=""},syncVmState:i=>{const e=v_.at(i.activeVmIndex);i.vmPageStates[i.activeVmIndex].state=e.state,i.vmPageStates[i.activeVmIndex].globalVariableDetails=e.globalVariableDetails,i.vmPageStates[i.activeVmIndex].localVariableDetailsStack=e.localVariableDetailsStack,i.vmPageStates[i.activeVmIndex].options=e.currentOptions,i.vmPageStates[i.activeVmIndex].stepCount=e.stepCount,i.vmPageStates[i.activeVmIndex].memoryUsage=e.memoryUsage,i.vmPageStates[i.activeVmIndex].peakMemoryUsage=e.currentPeakMemoryUsage,i.vmPageStates[i.activeVmIndex].staticErrors=e.staticErrors,i.vmPageStates[i.activeVmIndex].runtimeErrors=e.runtimeErrors,i.vmPageStates[i.activeVmIndex].currentLineNumber=e.currentLineNumber,e.flushWriteBuffer(t=>$de(i,t))}}}),{setActiveVmIndex:ckt,setName:ukt,addVmPageState:REe,deleteVmPageState:dkt,setIsIrChanged:hkt,addConsoleOutputs:Hde,setConsoleInputPrompt:fkt,setConsoleInput:gkt,setShouldIndicateCurrentLineNumber:H2,setLocalVariableTablesPagination:pkt,reset:mkt,resetAndSetIrString:vkt,clearConsoleInputAndPrompt:_kt,clearConsoleInputAndOutput:bkt,syncVmState:cp}=NEe.actions,Ckt=NEe.reducer,Vde=new Int32Array(1);function Zl(i){return Vde[0]=i,Vde[0]}function Oc(i,e){return Zl(i+e)}function V2(i,e){return Zl(i-e)}function ykt(i,e){const t=(i&4294901760)>>>16,n=i&65535,r=(e&4294901760)>>>16,o=e&65535;return Zl((t*o+n*r<<16)+n*o)}function wkt(i,e){return Zl(i/e)}var zK=(i=>(i[i.SUCCESS=0]="SUCCESS",i[i.OUT_OF_BOUND=1]="OUT_OF_BOUND",i))(zK||{}),MEe=(i=>(i[i.SUCCESS=0]="SUCCESS",i[i.OUT_OF_BOUND=1]="OUT_OF_BOUND",i))(MEe||{});function zde(i,e){return i<0||i+4>e.length?{value:null,status:1}:{value:Zl(e[i]|e[i+1]<<8|e[i+2]<<16|e[i+3]<<24),status:0}}function Skt(i,e,t){return e<0||e+4>t.length?1:(t[e]=i&255,t[e+1]=(i&65280)>>>8,t[e+2]=(i&16711680)>>>16,t[e+3]=(i&4278190080)>>>24,0)}var iA=(i=>(i[i.IMM=0]="IMM",i[i.ID=1]="ID",i[i.ADDRESS_ID=2]="ADDRESS_ID",i[i.DEREF_ID=3]="DEREF_ID",i))(iA||{}),XL=(i=>(i[i.ADD=0]="ADD",i[i.SUB=1]="SUB",i[i.MUL=2]="MUL",i[i.DIV=3]="DIV",i))(XL||{}),C0=(i=>(i[i.EQ=0]="EQ",i[i.NE=1]="NE",i[i.LT=2]="LT",i[i.LE=3]="LE",i[i.GT=4]="GT",i[i.GE=5]="GE",i))(C0||{}),YL=(i=>(i[i.ID=0]="ID",i[i.DEREF_ID=1]="DEREF_ID",i))(YL||{}),UK=(i=>(i[i.SINGULAR=0]="SINGULAR",i[i.BINARY_MATH_OP=1]="BINARY_MATH_OP",i))(UK||{}),B1=(i=>(i[i.FUNCTION=0]="FUNCTION",i[i.ASSIGN=1]="ASSIGN",i[i.DEC=2]="DEC",i[i.GLOBAL_DEC=3]="GLOBAL_DEC",i[i.LABEL=4]="LABEL",i[i.GOTO=5]="GOTO",i[i.IF=6]="IF",i[i.ARG=7]="ARG",i[i.CALL=8]="CALL",i[i.ASSIGN_CALL=9]="ASSIGN_CALL",i[i.PARAM=10]="PARAM",i[i.RETURN=11]="RETURN",i[i.READ=12]="READ",i[i.WRITE=13]="WRITE",i[i.EMPTY=14]="EMPTY",i[i.COMMENT=15]="COMMENT",i[i.ERROR=16]="ERROR",i))(B1||{}),Mo=(i=>(i[i.ASSIGN=1]="ASSIGN",i[i.DEC=2]="DEC",i[i.GLOBAL_DEC=3]="GLOBAL_DEC",i[i.GOTO=5]="GOTO",i[i.IF=6]="IF",i[i.ARG=7]="ARG",i[i.CALL=8]="CALL",i[i.ASSIGN_CALL=9]="ASSIGN_CALL",i[i.PARAM=10]="PARAM",i[i.RETURN=11]="RETURN",i[i.READ=12]="READ",i[i.WRITE=13]="WRITE",i))(Mo||{});const rA=["FUNCTION","DEC","GLOBAL_DEC","LABEL","GOTO","IF","ARG","PARAM","CALL","RETURN","READ","WRITE"],xkt=new Set(rA),Vd="[a-zA-Z_$][\\w$]*",AEe="\\d+",jK="-?\\d+";class Lkt{constructor(){Ss(this,"patternId",new RegExp(`^(?${Vd})$`));Ss(this,"patternSize",new RegExp(`^(?${AEe})$`));Ss(this,"patternSingular",new RegExp(`^(#(?${jK}))$|^(?${Vd})$|^(\\*(?${Vd}))$|^(&(?${Vd}))$`));Ss(this,"patternLValue",new RegExp(`^((?${Vd}))$|^(\\*(?${Vd}))$`));Ss(this,"illegalInstructionFormatError",{type:16,messageKey:"ILLEGAL_INSTRUCTION_FORMAT"})}purify(e){return e.trim().replaceAll(/[ \t]+/g," ")}decodeComponentId(e){const t=e.match(this.patternId);return t===null||xkt.has(e)?null:t.groups.id}decodeComponentSize(e){const t=e.match(this.patternSize);if(t===null)return null;const n=parseInt(t.groups.size);return Number.isSafeInteger(n)?Zl(n):1/0}decodeComponentSingular(e){const t=e.match(this.patternSingular);if(t===null)return null;if(t.groups.imm!==void 0){const n=parseInt(t.groups.imm);return Number.isSafeInteger(n)?{type:0,imm:Zl(n)}:{type:0,imm:1/0}}else return t.groups.id!==void 0?{type:1,id:t.groups.id}:t.groups.derefId!==void 0?{type:3,id:t.groups.derefId}:{type:2,id:t.groups.addressId}}decodeComponentLValue(e){const t=e.match(this.patternLValue);return t===null?null:t.groups.id!==void 0?{type:0,id:t.groups.id}:{type:1,id:t.groups.derefId}}decodeFunction(e){if(e.length!==3||e[2]!==":")return this.illegalInstructionFormatError;const t=this.decodeComponentId(e[1]);return t===null?{type:16,messageKey:"FUNCTION_ILLEGAL_ID"}:{type:0,value:{id:t}}}decodeAssign(e){if(e.length!==3&&e.length!==5||e[1]!==":=")return this.illegalInstructionFormatError;const t=this.decodeComponentLValue(e[0]);if(t===null)return{type:16,messageKey:"ASSIGN_ILLEGAL_LEFT"};const n=this.decodeComponentSingular(e[2]);if(n===null)return{type:16,messageKey:e.length===3?"ASSIGN_ILLEGAL_RIGHT":"ASSIGN_ILLEGAL_RIGHT_OPERAND1"};if(n.type===0&&!Number.isFinite(n.imm))return{type:16,messageKey:e.length===3?"ASSIGN_RIGHT_IMM_TOO_LARGE":"ASSIGN_RIGHT_OPERAND1_IMM_TOO_LARGE"};if(e.length===3)return{type:1,value:{lValue:t,rValue:{type:0,singular:n}}};{let r=0;switch(e[3]){case"+":r=0;break;case"-":r=1;break;case"*":r=2;break;case"/":r=3;break;default:return{type:16,messageKey:"ASSIGN_ILLEGAL_RIGHT_OPERATOR"}}const o=this.decodeComponentSingular(e[4]);return o===null?{type:16,messageKey:"ASSIGN_ILLEGAL_RIGHT_OPERAND2"}:o.type===0&&!Number.isFinite(o.imm)?{type:16,messageKey:"ASSIGN_RIGHT_OPERAND2_IMM_TOO_LARGE"}:{type:1,value:{lValue:t,rValue:{type:1,singularL:n,singularR:o,binaryMathOp:r}}}}}decodeDec(e){if(e.length!==3)return this.illegalInstructionFormatError;const t=this.decodeComponentId(e[1]);if(t===null)return{type:16,messageKey:"DEC_ILLEGAL_ID"};const n=this.decodeComponentSize(e[2]);return n===null?{type:16,messageKey:"DEC_ILLEGAL_SIZE_FORMAT"}:Number.isFinite(n)?n%4!==0?{type:16,messageKey:"DEC_SIZE_NOT_4_MULTIPLE"}:{type:2,value:{id:t,size:n}}:{type:16,messageKey:"DEC_SIZE_TOO_LARGE"}}decodeGlobalDec(e){if(e.length!==3)return this.illegalInstructionFormatError;const t=this.decodeComponentId(e[1]);if(t===null)return{type:16,messageKey:"GLOBAL_DEC_ILLEGAL_ID"};const n=this.decodeComponentSize(e[2]);return n===null?{type:16,messageKey:"GLOBAL_DEC_ILLEGAL_SIZE_FORMAT"}:Number.isFinite(n)?n%4!==0?{type:16,messageKey:"GLOBAL_DEC_SIZE_NOT_4_MULTIPLE"}:{type:3,value:{id:t,size:n}}:{type:16,messageKey:"GLOBAL_DEC_SIZE_TOO_LARGE"}}decodeLabel(e){if(e.length!==3||e[2]!==":")return this.illegalInstructionFormatError;const t=this.decodeComponentId(e[1]);return t===null?{type:16,messageKey:"LABEL_ILLEGAL_ID"}:{type:4,value:{id:t}}}decodeGoto(e){if(e.length!==2)return this.illegalInstructionFormatError;const t=this.decodeComponentId(e[1]);return t===null?{type:16,messageKey:"GOTO_ILLEGAL_ID"}:{type:5,value:{id:t}}}decodeIf(e){if(e.length!==6||e[4]!=="GOTO")return this.illegalInstructionFormatError;const t=this.decodeComponentSingular(e[1]);if(t===null)return{type:16,messageKey:"IF_ILLEGAL_COND_OPERAND1"};if(t.type===0&&!Number.isFinite(t.imm))return{type:16,messageKey:"IF_COND_OPERAND1_IMM_TOO_LARGE"};let n=0;switch(e[2]){case"==":n=0;break;case"!=":n=1;break;case"<":n=2;break;case"<=":n=3;break;case">":n=4;break;case">=":n=5;break;default:return{type:16,messageKey:"IF_ILLEGAL_COND_OPERATOR"}}const r=this.decodeComponentSingular(e[3]);if(r===null)return{type:16,messageKey:"IF_ILLEGAL_COND_OPERAND2"};if(r.type===0&&!Number.isFinite(r.imm))return{type:16,messageKey:"IF_COND_OPERAND2_IMM_TOO_LARGE"};const o=this.decodeComponentId(e[5]);return o===null?{type:16,messageKey:"IF_ILLEGAL_GOTO_ID"}:{type:6,value:{condition:{singularL:t,singularR:r,binaryRelOp:n},gotoId:o}}}decodeArg(e){if(e.length!==2)return this.illegalInstructionFormatError;const t=this.decodeComponentSingular(e[1]);return t===null?{type:16,messageKey:"ARG_ILLEGAL"}:t.type===0&&!Number.isFinite(t.imm)?{type:16,messageKey:"ARG_IMM_TOO_LARGE"}:{type:7,value:{value:t}}}decodeCall(e){if(e.length!==2)return this.illegalInstructionFormatError;const t=this.decodeComponentId(e[1]);return t===null?{type:16,messageKey:"CALL_ILLEGAL_ID"}:{type:8,value:{id:t}}}decodeAssignCall(e){if(e.length!==4||e[1]!==":="||e[2]!=="CALL")return this.illegalInstructionFormatError;const t=this.decodeComponentLValue(e[0]);if(t===null)return{type:16,messageKey:"ASSIGN_ILLEGAL_LEFT"};const n=this.decodeComponentId(e[3]);return n===null?{type:16,messageKey:"CALL_ILLEGAL_ID"}:{type:9,value:{lValue:t,functionId:n}}}decodeParam(e){if(e.length!==2)return this.illegalInstructionFormatError;const t=this.decodeComponentId(e[1]);return t===null?{type:16,messageKey:"PARAM_ILLEGAL_ID"}:{type:10,value:{id:t}}}decodeReturn(e){if(e.length!==2)return this.illegalInstructionFormatError;const t=this.decodeComponentSingular(e[1]);return t===null?{type:16,messageKey:"RETURN_ILLEGAL"}:t.type===0&&!Number.isFinite(t.imm)?{type:16,messageKey:"RETURN_IMM_TOO_LARGE"}:{type:11,value:{value:t}}}decodeRead(e){if(e.length!==2)return this.illegalInstructionFormatError;const t=this.decodeComponentLValue(e[1]);return t===null?{type:16,messageKey:"READ_ILLEGAL"}:{type:12,value:{lValue:t}}}decodeWrite(e){if(e.length!==2)return this.illegalInstructionFormatError;const t=this.decodeComponentSingular(e[1]);return t===null?{type:16,messageKey:"WRITE_ILLEGAL"}:t.type===0&&!Number.isFinite(t.imm)?{type:16,messageKey:"WRITE_IMM_TOO_LARGE"}:{type:13,value:{value:t}}}decode(e){if(e.match(/^[ \t]*$/))return{type:14};const t={type:16,messageKey:"UNRECOGNIZED_INSTRUCTION"},n=this.purify(e);if(n.startsWith(";"))return{type:15};const r=n.split(" ");if(r.length<1)return t;switch(r[0]){case"FUNCTION":return this.decodeFunction(r);case"DEC":return this.decodeDec(r);case"GLOBAL_DEC":return this.decodeGlobalDec(r);case"LABEL":return this.decodeLabel(r);case"GOTO":return this.decodeGoto(r);case"IF":return this.decodeIf(r);case"ARG":return this.decodeArg(r);case"CALL":return this.decodeCall(r);case"PARAM":return this.decodeParam(r);case"RETURN":return this.decodeReturn(r);case"READ":return this.decodeRead(r);case"WRITE":return this.decodeWrite(r);default:{const o=this.decodeAssign(r);if(o.type===1)return o;const s=this.decodeAssignCall(r);return s.type===9?s:o}}}}var sa={},Ekt={get exports(){return sa},set exports(i){sa=i}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */(function(i,e){(function(){var t,n="4.17.21",r=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",c=500,u="__lodash_placeholder__",d=1,h=2,f=4,g=1,p=2,v=1,m=2,_=4,y=8,S=16,L=32,E=64,D=128,k=256,T=512,M=30,A="...",N=800,R=16,F=1,W=2,H=3,G=1/0,U=9007199254740991,K=17976931348623157e292,re=0/0,Y=4294967295,J=Y-1,Q=Y>>>1,ue=[["ary",D],["bind",v],["bindKey",m],["curry",y],["curryRight",S],["flip",T],["partial",L],["partialRight",E],["rearg",k]],de="[object Arguments]",_e="[object Array]",ve="[object AsyncFunction]",Ve="[object Boolean]",Ze="[object Date]",We="[object DOMException]",pe="[object Error]",Pe="[object Function]",Se="[object GeneratorFunction]",Ne="[object Map]",Me="[object Number]",Qe="[object Null]",Ke="[object Object]",Re="[object Promise]",ct="[object Proxy]",ie="[object RegExp]",le="[object Set]",ce="[object String]",z="[object Symbol]",q="[object Undefined]",oe="[object WeakMap]",ne="[object WeakSet]",he="[object ArrayBuffer]",Le="[object DataView]",Fe="[object Float32Array]",ze="[object Float64Array]",Ue="[object Int8Array]",nt="[object Int16Array]",it="[object Int32Array]",at="[object Uint8Array]",tt="[object Uint8ClampedArray]",Zt="[object Uint16Array]",Tt="[object Uint32Array]",xn=/\b__p \+= '';/g,rt=/\b(__p \+=) '' \+/g,wt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Bt=/&(?:amp|lt|gt|quot|#39);/g,Nt=/[&<>"']/g,nn=RegExp(Bt.source),Mn=RegExp(Nt.source),zt=/<%-([\s\S]+?)%>/g,Qt=/<%([\s\S]+?)%>/g,lt=/<%=([\s\S]+?)%>/g,ut=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,dt=/^\w*$/,Mt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Kt=/[\\^$.*+?()[\]{}|]/g,mn=RegExp(Kt.source),lr=/^\s+/,nr=/\s/,Hr=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Jn=/\{\n\/\* \[wrapped with (.+)\] \*/,Ii=/,? & /,_o=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,No=/[()=,{}\[\]\/\s]/,bs=/\\(\\)?/g,Cs=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,$t=/\w*$/,we=/^[-+]0x[0-9a-f]+$/i,bt=/^0b[01]+$/i,xt=/^\[object .+?Constructor\]$/,Gn=/^0o[0-7]+$/i,cr=/^(?:0|[1-9]\d*)$/,Vr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ei=/($^)/,Qr=/['\n\r\u2028\u2029\\]/g,Fs="\\ud800-\\udfff",Fl="\\u0300-\\u036f",Aa="\\ufe20-\\ufe2f",zo="\\u20d0-\\u20ff",bo=Fl+Aa+zo,Pa="\\u2700-\\u27bf",Oa="a-z\\xdf-\\xf6\\xf8-\\xff",Bl="\\xac\\xb1\\xd7\\xf7",cl="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Wl="\\u2000-\\u206f",_u=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",bu="A-Z\\xc0-\\xd6\\xd8-\\xde",xc="\\ufe0e\\ufe0f",Fa=Bl+cl+Wl+_u,Ba="['’]",qt="["+Fs+"]",Ft="["+Fa+"]",Pn="["+bo+"]",Xt="\\d+",Gt="["+Pa+"]",oi="["+Oa+"]",Fi="[^"+Fs+Fa+Xt+Pa+Oa+bu+"]",Co="\\ud83c[\\udffb-\\udfff]",Bs="(?:"+Pn+"|"+Co+")",ul="[^"+Fs+"]",Ws="(?:\\ud83c[\\udde6-\\uddff]){2}",Lc="[\\ud800-\\udbff][\\udc00-\\udfff]",rg="["+bu+"]",IC="\\u200d",nx="(?:"+oi+"|"+Fi+")",aB="(?:"+rg+"|"+Fi+")",VT="(?:"+Ba+"(?:d|ll|m|re|s|t|ve))?",fn="(?:"+Ba+"(?:D|LL|M|RE|S|T|VE))?",Yn=Bs+"?",Qi="["+xc+"]?",Ar="(?:"+IC+"(?:"+[ul,Ws,Lc].join("|")+")"+Qi+Yn+")*",zr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",kC="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",og=Qi+Yn+Ar,ix="(?:"+[Gt,Ws,Lc].join("|")+")"+og,zT="(?:"+[ul+Pn+"?",Pn,Ws,Lc,qt].join("|")+")",TC=RegExp(Ba,"g"),UEe=RegExp(Pn,"g"),lB=RegExp(Co+"(?="+Co+")|"+zT+og,"g"),jEe=RegExp([rg+"?"+oi+"+"+VT+"(?="+[Ft,rg,"$"].join("|")+")",aB+"+"+fn+"(?="+[Ft,rg+nx,"$"].join("|")+")",rg+"?"+nx+"+"+VT,rg+"+"+fn,kC,zr,Xt,ix].join("|"),"g"),KEe=RegExp("["+IC+Fs+bo+xc+"]"),GEe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,qEe=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],XEe=-1,Jr={};Jr[Fe]=Jr[ze]=Jr[Ue]=Jr[nt]=Jr[it]=Jr[at]=Jr[tt]=Jr[Zt]=Jr[Tt]=!0,Jr[de]=Jr[_e]=Jr[he]=Jr[Ve]=Jr[Le]=Jr[Ze]=Jr[pe]=Jr[Pe]=Jr[Ne]=Jr[Me]=Jr[Ke]=Jr[ie]=Jr[le]=Jr[ce]=Jr[oe]=!1;var Ur={};Ur[de]=Ur[_e]=Ur[he]=Ur[Le]=Ur[Ve]=Ur[Ze]=Ur[Fe]=Ur[ze]=Ur[Ue]=Ur[nt]=Ur[it]=Ur[Ne]=Ur[Me]=Ur[Ke]=Ur[ie]=Ur[le]=Ur[ce]=Ur[z]=Ur[at]=Ur[tt]=Ur[Zt]=Ur[Tt]=!0,Ur[pe]=Ur[Pe]=Ur[oe]=!1;var YEe={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},ZEe={"&":"&","<":"<",">":">",'"':""","'":"'"},QEe={"&":"&","<":"<",">":">",""":'"',"'":"'"},JEe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},eDe=parseFloat,tDe=parseInt,KQ=typeof bx=="object"&&bx&&bx.Object===Object&&bx,nDe=typeof self=="object"&&self&&self.Object===Object&&self,na=KQ||nDe||Function("return this")(),cB=e&&!e.nodeType&&e,V_=cB&&!0&&i&&!i.nodeType&&i,GQ=V_&&V_.exports===cB,uB=GQ&&KQ.process,Cu=function(){try{var Ee=V_&&V_.require&&V_.require("util").types;return Ee||uB&&uB.binding&&uB.binding("util")}catch{}}(),qQ=Cu&&Cu.isArrayBuffer,XQ=Cu&&Cu.isDate,YQ=Cu&&Cu.isMap,ZQ=Cu&&Cu.isRegExp,QQ=Cu&&Cu.isSet,JQ=Cu&&Cu.isTypedArray;function Ec(Ee,ot,Ye){switch(Ye.length){case 0:return Ee.call(ot);case 1:return Ee.call(ot,Ye[0]);case 2:return Ee.call(ot,Ye[0],Ye[1]);case 3:return Ee.call(ot,Ye[0],Ye[1],Ye[2])}return Ee.apply(ot,Ye)}function iDe(Ee,ot,Ye,tn){for(var ti=-1,ir=Ee==null?0:Ee.length;++ti-1}function dB(Ee,ot,Ye){for(var tn=-1,ti=Ee==null?0:Ee.length;++tn-1;);return Ye}function aJ(Ee,ot){for(var Ye=Ee.length;Ye--&&NC(ot,Ee[Ye],0)>-1;);return Ye}function hDe(Ee,ot){for(var Ye=Ee.length,tn=0;Ye--;)Ee[Ye]===ot&&++tn;return tn}var fDe=pB(YEe),gDe=pB(ZEe);function pDe(Ee){return"\\"+JEe[Ee]}function mDe(Ee,ot){return Ee==null?t:Ee[ot]}function RC(Ee){return KEe.test(Ee)}function vDe(Ee){return GEe.test(Ee)}function _De(Ee){for(var ot,Ye=[];!(ot=Ee.next()).done;)Ye.push(ot.value);return Ye}function bB(Ee){var ot=-1,Ye=Array(Ee.size);return Ee.forEach(function(tn,ti){Ye[++ot]=[ti,tn]}),Ye}function lJ(Ee,ot){return function(Ye){return Ee(ot(Ye))}}function Yp(Ee,ot){for(var Ye=-1,tn=Ee.length,ti=0,ir=[];++Ye-1}function oIe(b,x){var I=this.__data__,P=aN(I,b);return P<0?(++this.size,I.push([b,x])):I[P][1]=x,this}sg.prototype.clear=tIe,sg.prototype.delete=nIe,sg.prototype.get=iIe,sg.prototype.has=rIe,sg.prototype.set=oIe;function ag(b){var x=-1,I=b==null?0:b.length;for(this.clear();++x=x?b:x)),b}function xu(b,x,I,P,V,ee){var ge,Ce=x&d,Ie=x&h,pt=x&f;if(I&&(ge=V?I(b,P,V,ee):I(b)),ge!==t)return ge;if(!yo(b))return b;var mt=ii(b);if(mt){if(ge=cke(b),!Ce)return $l(b,ge)}else{var Ct=$a(b),jt=Ct==Pe||Ct==Se;if(nm(b))return UJ(b,Ce);if(Ct==Ke||Ct==de||jt&&!V){if(ge=Ie||jt?{}:cee(b),!Ce)return Ie?QIe(b,yIe(ge,b)):ZIe(b,CJ(ge,b))}else{if(!Ur[Ct])return V?b:{};ge=uke(b,Ct,Ce)}}ee||(ee=new md);var dn=ee.get(b);if(dn)return dn;ee.set(b,ge),Bee(b)?b.forEach(function(Fn){ge.add(xu(Fn,x,I,Fn,b,ee))}):Oee(b)&&b.forEach(function(Fn,vi){ge.set(vi,xu(Fn,x,I,vi,b,ee))});var On=pt?Ie?jB:UB:Ie?Vl:$s,ui=mt?t:On(b);return yu(ui||b,function(Fn,vi){ui&&(vi=Fn,Fn=b[vi]),ux(ge,vi,xu(Fn,x,I,vi,b,ee))}),ge}function wIe(b){var x=$s(b);return function(I){return yJ(I,b,x)}}function yJ(b,x,I){var P=I.length;if(b==null)return!P;for(b=Pr(b);P--;){var V=I[P],ee=x[V],ge=b[V];if(ge===t&&!(V in b)||!ee(ge))return!1}return!0}function wJ(b,x,I){if(typeof b!="function")throw new wu(s);return vx(function(){b.apply(t,I)},x)}function dx(b,x,I,P){var V=-1,ee=UT,ge=!0,Ce=b.length,Ie=[],pt=x.length;if(!Ce)return Ie;I&&(x=uo(x,Dc(I))),P?(ee=dB,ge=!1):x.length>=r&&(ee=rx,ge=!1,x=new j_(x));e:for(;++VV?0:V+I),P=P===t||P>V?V:ai(P),P<0&&(P+=V),P=I>P?0:$ee(P);I0&&I(Ce)?x>1?ia(Ce,x-1,I,P,V):Xp(V,Ce):P||(V[V.length]=Ce)}return V}var EB=YJ(),LJ=YJ(!0);function Ph(b,x){return b&&EB(b,x,$s)}function DB(b,x){return b&&LJ(b,x,$s)}function cN(b,x){return qp(x,function(I){return hg(b[I])})}function G_(b,x){x=em(x,b);for(var I=0,P=x.length;b!=null&&Ix}function LIe(b,x){return b!=null&&mr.call(b,x)}function EIe(b,x){return b!=null&&x in Pr(b)}function DIe(b,x,I){return b>=Wa(x,I)&&b=120&&mt.length>=120)?new j_(ge&&mt):t}mt=b[0];var Ct=-1,jt=Ce[0];e:for(;++Ct-1;)Ce!==b&&eN.call(Ce,Ie,1),eN.call(b,Ie,1);return b}function OJ(b,x){for(var I=b?x.length:0,P=I-1;I--;){var V=x[I];if(I==P||V!==ee){var ee=V;dg(V)?eN.call(b,V,1):FB(b,V)}}return b}function AB(b,x){return b+iN(mJ()*(x-b+1))}function $Ie(b,x,I,P){for(var V=-1,ee=ws(nN((x-b)/(I||1)),0),ge=Ye(ee);ee--;)ge[P?ee:++V]=b,b+=I;return ge}function PB(b,x){var I="";if(!b||x<1||x>U)return I;do x%2&&(I+=b),x=iN(x/2),x&&(b+=b);while(x);return I}function fi(b,x){return QB(hee(b,x,zl),b+"")}function HIe(b){return bJ(zC(b))}function VIe(b,x){var I=zC(b);return CN(I,K_(x,0,I.length))}function gx(b,x,I,P){if(!yo(b))return b;x=em(x,b);for(var V=-1,ee=x.length,ge=ee-1,Ce=b;Ce!=null&&++VV?0:V+x),I=I>V?V:I,I<0&&(I+=V),V=x>I?0:I-x>>>0,x>>>=0;for(var ee=Ye(V);++P>>1,ge=b[ee];ge!==null&&!kc(ge)&&(I?ge<=x:ge=r){var pt=x?null:nke(b);if(pt)return KT(pt);ge=!1,V=rx,Ie=new j_}else Ie=x?[]:Ce;e:for(;++P=P?b:Lu(b,x,I)}var zJ=MDe||function(b){return na.clearTimeout(b)};function UJ(b,x){if(x)return b.slice();var I=b.length,P=dJ?dJ(I):new b.constructor(I);return b.copy(P),P}function HB(b){var x=new b.constructor(b.byteLength);return new QT(x).set(new QT(b)),x}function GIe(b,x){var I=x?HB(b.buffer):b.buffer;return new b.constructor(I,b.byteOffset,b.byteLength)}function qIe(b){var x=new b.constructor(b.source,$t.exec(b));return x.lastIndex=b.lastIndex,x}function XIe(b){return cx?Pr(cx.call(b)):{}}function jJ(b,x){var I=x?HB(b.buffer):b.buffer;return new b.constructor(I,b.byteOffset,b.length)}function KJ(b,x){if(b!==x){var I=b!==t,P=b===null,V=b===b,ee=kc(b),ge=x!==t,Ce=x===null,Ie=x===x,pt=kc(x);if(!Ce&&!pt&&!ee&&b>x||ee&&ge&&Ie&&!Ce&&!pt||P&&ge&&Ie||!I&&Ie||!V)return 1;if(!P&&!ee&&!pt&&b=Ce)return Ie;var pt=I[P];return Ie*(pt=="desc"?-1:1)}}return b.index-x.index}function GJ(b,x,I,P){for(var V=-1,ee=b.length,ge=I.length,Ce=-1,Ie=x.length,pt=ws(ee-ge,0),mt=Ye(Ie+pt),Ct=!P;++Ce1?I[V-1]:t,ge=V>2?I[2]:t;for(ee=b.length>3&&typeof ee=="function"?(V--,ee):t,ge&&hl(I[0],I[1],ge)&&(ee=V<3?t:ee,V=1),x=Pr(x);++P-1?V[ee?x[ge]:ge]:t}}function JJ(b){return ug(function(x){var I=x.length,P=I,V=Su.prototype.thru;for(b&&x.reverse();P--;){var ee=x[P];if(typeof ee!="function")throw new wu(s);if(V&&!ge&&_N(ee)=="wrapper")var ge=new Su([],!0)}for(P=ge?P:I;++P1&&ki.reverse(),mt&&IeCe))return!1;var pt=ee.get(b),mt=ee.get(x);if(pt&&mt)return pt==x&&mt==b;var Ct=-1,jt=!0,dn=I&p?new j_:t;for(ee.set(b,x),ee.set(x,b);++Ct1?"& ":"")+x[P],x=x.join(I>2?", ":" "),b.replace(Hr,`{ + */(function(i,e){(function(){var t,n="4.17.21",r=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",c=500,u="__lodash_placeholder__",d=1,h=2,f=4,g=1,p=2,v=1,m=2,_=4,y=8,S=16,L=32,E=64,D=128,k=256,T=512,M=30,A="...",N=800,R=16,F=1,W=2,H=3,G=1/0,U=9007199254740991,K=17976931348623157e292,re=0/0,Y=4294967295,J=Y-1,Q=Y>>>1,ue=[["ary",D],["bind",v],["bindKey",m],["curry",y],["curryRight",S],["flip",T],["partial",L],["partialRight",E],["rearg",k]],de="[object Arguments]",_e="[object Array]",ve="[object AsyncFunction]",Ve="[object Boolean]",Ze="[object Date]",We="[object DOMException]",pe="[object Error]",Pe="[object Function]",Se="[object GeneratorFunction]",Ne="[object Map]",Me="[object Number]",Qe="[object Null]",Ke="[object Object]",Re="[object Promise]",ct="[object Proxy]",ie="[object RegExp]",le="[object Set]",ce="[object String]",z="[object Symbol]",q="[object Undefined]",oe="[object WeakMap]",ne="[object WeakSet]",he="[object ArrayBuffer]",Le="[object DataView]",Fe="[object Float32Array]",ze="[object Float64Array]",Ue="[object Int8Array]",nt="[object Int16Array]",it="[object Int32Array]",at="[object Uint8Array]",tt="[object Uint8ClampedArray]",Zt="[object Uint16Array]",Tt="[object Uint32Array]",xn=/\b__p \+= '';/g,rt=/\b(__p \+=) '' \+/g,wt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Bt=/&(?:amp|lt|gt|quot|#39);/g,Nt=/[&<>"']/g,nn=RegExp(Bt.source),Mn=RegExp(Nt.source),zt=/<%-([\s\S]+?)%>/g,Qt=/<%([\s\S]+?)%>/g,lt=/<%=([\s\S]+?)%>/g,ut=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,dt=/^\w*$/,Mt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Kt=/[\\^$.*+?()[\]{}|]/g,mn=RegExp(Kt.source),lr=/^\s+/,nr=/\s/,Hr=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Jn=/\{\n\/\* \[wrapped with (.+)\] \*/,Ii=/,? & /,_o=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,No=/[()=,{}\[\]\/\s]/,bs=/\\(\\)?/g,Cs=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,$t=/\w*$/,we=/^[-+]0x[0-9a-f]+$/i,bt=/^0b[01]+$/i,xt=/^\[object .+?Constructor\]$/,Gn=/^0o[0-7]+$/i,cr=/^(?:0|[1-9]\d*)$/,Vr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ei=/($^)/,Qr=/['\n\r\u2028\u2029\\]/g,Fs="\\ud800-\\udfff",Fl="\\u0300-\\u036f",Aa="\\ufe20-\\ufe2f",zo="\\u20d0-\\u20ff",bo=Fl+Aa+zo,Pa="\\u2700-\\u27bf",Oa="a-z\\xdf-\\xf6\\xf8-\\xff",Bl="\\xac\\xb1\\xd7\\xf7",cl="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Wl="\\u2000-\\u206f",_u=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",bu="A-Z\\xc0-\\xd6\\xd8-\\xde",xc="\\ufe0e\\ufe0f",Fa=Bl+cl+Wl+_u,Ba="['’]",qt="["+Fs+"]",Ft="["+Fa+"]",Pn="["+bo+"]",Xt="\\d+",Gt="["+Pa+"]",oi="["+Oa+"]",Fi="[^"+Fs+Fa+Xt+Pa+Oa+bu+"]",Co="\\ud83c[\\udffb-\\udfff]",Bs="(?:"+Pn+"|"+Co+")",ul="[^"+Fs+"]",Ws="(?:\\ud83c[\\udde6-\\uddff]){2}",Lc="[\\ud800-\\udbff][\\udc00-\\udfff]",rg="["+bu+"]",IC="\\u200d",nx="(?:"+oi+"|"+Fi+")",aB="(?:"+rg+"|"+Fi+")",VT="(?:"+Ba+"(?:d|ll|m|re|s|t|ve))?",fn="(?:"+Ba+"(?:D|LL|M|RE|S|T|VE))?",Yn=Bs+"?",Qi="["+xc+"]?",Ar="(?:"+IC+"(?:"+[ul,Ws,Lc].join("|")+")"+Qi+Yn+")*",zr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",kC="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",og=Qi+Yn+Ar,ix="(?:"+[Gt,Ws,Lc].join("|")+")"+og,zT="(?:"+[ul+Pn+"?",Pn,Ws,Lc,qt].join("|")+")",TC=RegExp(Ba,"g"),UEe=RegExp(Pn,"g"),lB=RegExp(Co+"(?="+Co+")|"+zT+og,"g"),jEe=RegExp([rg+"?"+oi+"+"+VT+"(?="+[Ft,rg,"$"].join("|")+")",aB+"+"+fn+"(?="+[Ft,rg+nx,"$"].join("|")+")",rg+"?"+nx+"+"+VT,rg+"+"+fn,kC,zr,Xt,ix].join("|"),"g"),KEe=RegExp("["+IC+Fs+bo+xc+"]"),GEe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,qEe=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],XEe=-1,Jr={};Jr[Fe]=Jr[ze]=Jr[Ue]=Jr[nt]=Jr[it]=Jr[at]=Jr[tt]=Jr[Zt]=Jr[Tt]=!0,Jr[de]=Jr[_e]=Jr[he]=Jr[Ve]=Jr[Le]=Jr[Ze]=Jr[pe]=Jr[Pe]=Jr[Ne]=Jr[Me]=Jr[Ke]=Jr[ie]=Jr[le]=Jr[ce]=Jr[oe]=!1;var Ur={};Ur[de]=Ur[_e]=Ur[he]=Ur[Le]=Ur[Ve]=Ur[Ze]=Ur[Fe]=Ur[ze]=Ur[Ue]=Ur[nt]=Ur[it]=Ur[Ne]=Ur[Me]=Ur[Ke]=Ur[ie]=Ur[le]=Ur[ce]=Ur[z]=Ur[at]=Ur[tt]=Ur[Zt]=Ur[Tt]=!0,Ur[pe]=Ur[Pe]=Ur[oe]=!1;var YEe={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},ZEe={"&":"&","<":"<",">":">",'"':""","'":"'"},QEe={"&":"&","<":"<",">":">",""":'"',"'":"'"},JEe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},eDe=parseFloat,tDe=parseInt,KQ=typeof bx=="object"&&bx&&bx.Object===Object&&bx,nDe=typeof self=="object"&&self&&self.Object===Object&&self,na=KQ||nDe||Function("return this")(),cB=e&&!e.nodeType&&e,H_=cB&&!0&&i&&!i.nodeType&&i,GQ=H_&&H_.exports===cB,uB=GQ&&KQ.process,Cu=function(){try{var Ee=H_&&H_.require&&H_.require("util").types;return Ee||uB&&uB.binding&&uB.binding("util")}catch{}}(),qQ=Cu&&Cu.isArrayBuffer,XQ=Cu&&Cu.isDate,YQ=Cu&&Cu.isMap,ZQ=Cu&&Cu.isRegExp,QQ=Cu&&Cu.isSet,JQ=Cu&&Cu.isTypedArray;function Ec(Ee,ot,Ye){switch(Ye.length){case 0:return Ee.call(ot);case 1:return Ee.call(ot,Ye[0]);case 2:return Ee.call(ot,Ye[0],Ye[1]);case 3:return Ee.call(ot,Ye[0],Ye[1],Ye[2])}return Ee.apply(ot,Ye)}function iDe(Ee,ot,Ye,tn){for(var ti=-1,ir=Ee==null?0:Ee.length;++ti-1}function dB(Ee,ot,Ye){for(var tn=-1,ti=Ee==null?0:Ee.length;++tn-1;);return Ye}function aJ(Ee,ot){for(var Ye=Ee.length;Ye--&&NC(ot,Ee[Ye],0)>-1;);return Ye}function hDe(Ee,ot){for(var Ye=Ee.length,tn=0;Ye--;)Ee[Ye]===ot&&++tn;return tn}var fDe=pB(YEe),gDe=pB(ZEe);function pDe(Ee){return"\\"+JEe[Ee]}function mDe(Ee,ot){return Ee==null?t:Ee[ot]}function RC(Ee){return KEe.test(Ee)}function vDe(Ee){return GEe.test(Ee)}function _De(Ee){for(var ot,Ye=[];!(ot=Ee.next()).done;)Ye.push(ot.value);return Ye}function bB(Ee){var ot=-1,Ye=Array(Ee.size);return Ee.forEach(function(tn,ti){Ye[++ot]=[ti,tn]}),Ye}function lJ(Ee,ot){return function(Ye){return Ee(ot(Ye))}}function Zp(Ee,ot){for(var Ye=-1,tn=Ee.length,ti=0,ir=[];++Ye-1}function oIe(b,x){var I=this.__data__,P=aN(I,b);return P<0?(++this.size,I.push([b,x])):I[P][1]=x,this}sg.prototype.clear=tIe,sg.prototype.delete=nIe,sg.prototype.get=iIe,sg.prototype.has=rIe,sg.prototype.set=oIe;function ag(b){var x=-1,I=b==null?0:b.length;for(this.clear();++x=x?b:x)),b}function xu(b,x,I,P,V,ee){var ge,Ce=x&d,Ie=x&h,pt=x&f;if(I&&(ge=V?I(b,P,V,ee):I(b)),ge!==t)return ge;if(!yo(b))return b;var mt=ii(b);if(mt){if(ge=cke(b),!Ce)return $l(b,ge)}else{var Ct=$a(b),jt=Ct==Pe||Ct==Se;if(im(b))return UJ(b,Ce);if(Ct==Ke||Ct==de||jt&&!V){if(ge=Ie||jt?{}:cee(b),!Ce)return Ie?QIe(b,yIe(ge,b)):ZIe(b,CJ(ge,b))}else{if(!Ur[Ct])return V?b:{};ge=uke(b,Ct,Ce)}}ee||(ee=new md);var dn=ee.get(b);if(dn)return dn;ee.set(b,ge),Bee(b)?b.forEach(function(Fn){ge.add(xu(Fn,x,I,Fn,b,ee))}):Oee(b)&&b.forEach(function(Fn,vi){ge.set(vi,xu(Fn,x,I,vi,b,ee))});var On=pt?Ie?jB:UB:Ie?Vl:$s,ui=mt?t:On(b);return yu(ui||b,function(Fn,vi){ui&&(vi=Fn,Fn=b[vi]),ux(ge,vi,xu(Fn,x,I,vi,b,ee))}),ge}function wIe(b){var x=$s(b);return function(I){return yJ(I,b,x)}}function yJ(b,x,I){var P=I.length;if(b==null)return!P;for(b=Pr(b);P--;){var V=I[P],ee=x[V],ge=b[V];if(ge===t&&!(V in b)||!ee(ge))return!1}return!0}function wJ(b,x,I){if(typeof b!="function")throw new wu(s);return vx(function(){b.apply(t,I)},x)}function dx(b,x,I,P){var V=-1,ee=UT,ge=!0,Ce=b.length,Ie=[],pt=x.length;if(!Ce)return Ie;I&&(x=uo(x,Dc(I))),P?(ee=dB,ge=!1):x.length>=r&&(ee=rx,ge=!1,x=new U_(x));e:for(;++VV?0:V+I),P=P===t||P>V?V:ai(P),P<0&&(P+=V),P=I>P?0:$ee(P);I0&&I(Ce)?x>1?ia(Ce,x-1,I,P,V):Yp(V,Ce):P||(V[V.length]=Ce)}return V}var EB=YJ(),LJ=YJ(!0);function Ph(b,x){return b&&EB(b,x,$s)}function DB(b,x){return b&&LJ(b,x,$s)}function cN(b,x){return Xp(x,function(I){return hg(b[I])})}function K_(b,x){x=tm(x,b);for(var I=0,P=x.length;b!=null&&Ix}function LIe(b,x){return b!=null&&mr.call(b,x)}function EIe(b,x){return b!=null&&x in Pr(b)}function DIe(b,x,I){return b>=Wa(x,I)&&b=120&&mt.length>=120)?new U_(ge&&mt):t}mt=b[0];var Ct=-1,jt=Ce[0];e:for(;++Ct-1;)Ce!==b&&eN.call(Ce,Ie,1),eN.call(b,Ie,1);return b}function OJ(b,x){for(var I=b?x.length:0,P=I-1;I--;){var V=x[I];if(I==P||V!==ee){var ee=V;dg(V)?eN.call(b,V,1):FB(b,V)}}return b}function AB(b,x){return b+iN(mJ()*(x-b+1))}function $Ie(b,x,I,P){for(var V=-1,ee=ws(nN((x-b)/(I||1)),0),ge=Ye(ee);ee--;)ge[P?ee:++V]=b,b+=I;return ge}function PB(b,x){var I="";if(!b||x<1||x>U)return I;do x%2&&(I+=b),x=iN(x/2),x&&(b+=b);while(x);return I}function fi(b,x){return QB(hee(b,x,zl),b+"")}function HIe(b){return bJ(zC(b))}function VIe(b,x){var I=zC(b);return CN(I,j_(x,0,I.length))}function gx(b,x,I,P){if(!yo(b))return b;x=tm(x,b);for(var V=-1,ee=x.length,ge=ee-1,Ce=b;Ce!=null&&++VV?0:V+x),I=I>V?V:I,I<0&&(I+=V),V=x>I?0:I-x>>>0,x>>>=0;for(var ee=Ye(V);++P>>1,ge=b[ee];ge!==null&&!kc(ge)&&(I?ge<=x:ge=r){var pt=x?null:nke(b);if(pt)return KT(pt);ge=!1,V=rx,Ie=new U_}else Ie=x?[]:Ce;e:for(;++P=P?b:Lu(b,x,I)}var zJ=MDe||function(b){return na.clearTimeout(b)};function UJ(b,x){if(x)return b.slice();var I=b.length,P=dJ?dJ(I):new b.constructor(I);return b.copy(P),P}function HB(b){var x=new b.constructor(b.byteLength);return new QT(x).set(new QT(b)),x}function GIe(b,x){var I=x?HB(b.buffer):b.buffer;return new b.constructor(I,b.byteOffset,b.byteLength)}function qIe(b){var x=new b.constructor(b.source,$t.exec(b));return x.lastIndex=b.lastIndex,x}function XIe(b){return cx?Pr(cx.call(b)):{}}function jJ(b,x){var I=x?HB(b.buffer):b.buffer;return new b.constructor(I,b.byteOffset,b.length)}function KJ(b,x){if(b!==x){var I=b!==t,P=b===null,V=b===b,ee=kc(b),ge=x!==t,Ce=x===null,Ie=x===x,pt=kc(x);if(!Ce&&!pt&&!ee&&b>x||ee&&ge&&Ie&&!Ce&&!pt||P&&ge&&Ie||!I&&Ie||!V)return 1;if(!P&&!ee&&!pt&&b=Ce)return Ie;var pt=I[P];return Ie*(pt=="desc"?-1:1)}}return b.index-x.index}function GJ(b,x,I,P){for(var V=-1,ee=b.length,ge=I.length,Ce=-1,Ie=x.length,pt=ws(ee-ge,0),mt=Ye(Ie+pt),Ct=!P;++Ce1?I[V-1]:t,ge=V>2?I[2]:t;for(ee=b.length>3&&typeof ee=="function"?(V--,ee):t,ge&&hl(I[0],I[1],ge)&&(ee=V<3?t:ee,V=1),x=Pr(x);++P-1?V[ee?x[ge]:ge]:t}}function JJ(b){return ug(function(x){var I=x.length,P=I,V=Su.prototype.thru;for(b&&x.reverse();P--;){var ee=x[P];if(typeof ee!="function")throw new wu(s);if(V&&!ge&&_N(ee)=="wrapper")var ge=new Su([],!0)}for(P=ge?P:I;++P1&&ki.reverse(),mt&&IeCe))return!1;var pt=ee.get(b),mt=ee.get(x);if(pt&&mt)return pt==x&&mt==b;var Ct=-1,jt=!0,dn=I&p?new U_:t;for(ee.set(b,x),ee.set(x,b);++Ct1?"& ":"")+x[P],x=x.join(I>2?", ":" "),b.replace(Hr,`{ /* [wrapped with `+x+`] */ -`)}function hke(b){return ii(b)||Y_(b)||!!(gJ&&b&&b[gJ])}function dg(b,x){var I=typeof b;return x=x??U,!!x&&(I=="number"||I!="symbol"&&cr.test(b))&&b>-1&&b%1==0&&b0){if(++x>=N)return arguments[0]}else x=0;return b.apply(t,arguments)}}function CN(b,x){var I=-1,P=b.length,V=P-1;for(x=x===t?P:x;++I1?b[x-1]:t;return I=typeof I=="function"?(b.pop(),I):t,xee(b,I)});function Lee(b){var x=Z(b);return x.__chain__=!0,x}function STe(b,x){return x(b),b}function yN(b,x){return x(b)}var xTe=ug(function(b){var x=b.length,I=x?b[0]:0,P=this.__wrapped__,V=function(ee){return LB(ee,b)};return x>1||this.__actions__.length||!(P instanceof yi)||!dg(I)?this.thru(V):(P=P.slice(I,+I+(x?1:0)),P.__actions__.push({func:yN,args:[V],thisArg:t}),new Su(P,this.__chain__).thru(function(ee){return x&&!ee.length&&ee.push(t),ee}))});function LTe(){return Lee(this)}function ETe(){return new Su(this.value(),this.__chain__)}function DTe(){this.__values__===t&&(this.__values__=Wee(this.value()));var b=this.__index__>=this.__values__.length,x=b?t:this.__values__[this.__index__++];return{done:b,value:x}}function ITe(){return this}function kTe(b){for(var x,I=this;I instanceof sN;){var P=_ee(I);P.__index__=0,P.__values__=t,x?V.__wrapped__=P:x=P;var V=P;I=I.__wrapped__}return V.__wrapped__=b,x}function TTe(){var b=this.__wrapped__;if(b instanceof yi){var x=b;return this.__actions__.length&&(x=new yi(this)),x=x.reverse(),x.__actions__.push({func:yN,args:[JB],thisArg:t}),new Su(x,this.__chain__)}return this.thru(JB)}function NTe(){return HJ(this.__wrapped__,this.__actions__)}var RTe=fN(function(b,x,I){mr.call(b,I)?++b[I]:lg(b,I,1)});function MTe(b,x,I){var P=ii(b)?eJ:SIe;return I&&hl(b,x,I)&&(x=t),P(b,An(x,3))}function ATe(b,x){var I=ii(b)?qp:xJ;return I(b,An(x,3))}var PTe=QJ(bee),OTe=QJ(Cee);function FTe(b,x){return ia(wN(b,x),1)}function BTe(b,x){return ia(wN(b,x),G)}function WTe(b,x,I){return I=I===t?1:ai(I),ia(wN(b,x),I)}function Eee(b,x){var I=ii(b)?yu:Qp;return I(b,An(x,3))}function Dee(b,x){var I=ii(b)?rDe:SJ;return I(b,An(x,3))}var $Te=fN(function(b,x,I){mr.call(b,I)?b[I].push(x):lg(b,I,[x])});function HTe(b,x,I,P){b=Hl(b)?b:zC(b),I=I&&!P?ai(I):0;var V=b.length;return I<0&&(I=ws(V+I,0)),DN(b)?I<=V&&b.indexOf(x,I)>-1:!!V&&NC(b,x,I)>-1}var VTe=fi(function(b,x,I){var P=-1,V=typeof x=="function",ee=Hl(b)?Ye(b.length):[];return Qp(b,function(ge){ee[++P]=V?Ec(x,ge,I):hx(ge,x,I)}),ee}),zTe=fN(function(b,x,I){lg(b,I,x)});function wN(b,x){var I=ii(b)?uo:TJ;return I(b,An(x,3))}function UTe(b,x,I,P){return b==null?[]:(ii(x)||(x=x==null?[]:[x]),I=P?t:I,ii(I)||(I=I==null?[]:[I]),AJ(b,x,I))}var jTe=fN(function(b,x,I){b[I?0:1].push(x)},function(){return[[],[]]});function KTe(b,x,I){var P=ii(b)?hB:rJ,V=arguments.length<3;return P(b,An(x,4),I,V,Qp)}function GTe(b,x,I){var P=ii(b)?oDe:rJ,V=arguments.length<3;return P(b,An(x,4),I,V,SJ)}function qTe(b,x){var I=ii(b)?qp:xJ;return I(b,LN(An(x,3)))}function XTe(b){var x=ii(b)?bJ:HIe;return x(b)}function YTe(b,x,I){(I?hl(b,x,I):x===t)?x=1:x=ai(x);var P=ii(b)?_Ie:VIe;return P(b,x)}function ZTe(b){var x=ii(b)?bIe:UIe;return x(b)}function QTe(b){if(b==null)return 0;if(Hl(b))return DN(b)?MC(b):b.length;var x=$a(b);return x==Ne||x==le?b.size:NB(b).length}function JTe(b,x,I){var P=ii(b)?fB:jIe;return I&&hl(b,x,I)&&(x=t),P(b,An(x,3))}var eNe=fi(function(b,x){if(b==null)return[];var I=x.length;return I>1&&hl(b,x[0],x[1])?x=[]:I>2&&hl(x[0],x[1],x[2])&&(x=[x[0]]),AJ(b,ia(x,1),[])}),SN=ADe||function(){return na.Date.now()};function tNe(b,x){if(typeof x!="function")throw new wu(s);return b=ai(b),function(){if(--b<1)return x.apply(this,arguments)}}function Iee(b,x,I){return x=I?t:x,x=b&&x==null?b.length:x,cg(b,D,t,t,t,t,x)}function kee(b,x){var I;if(typeof x!="function")throw new wu(s);return b=ai(b),function(){return--b>0&&(I=x.apply(this,arguments)),b<=1&&(x=t),I}}var t8=fi(function(b,x,I){var P=v;if(I.length){var V=Yp(I,HC(t8));P|=L}return cg(b,P,x,I,V)}),Tee=fi(function(b,x,I){var P=v|m;if(I.length){var V=Yp(I,HC(Tee));P|=L}return cg(x,P,b,I,V)});function Nee(b,x,I){x=I?t:x;var P=cg(b,y,t,t,t,t,t,x);return P.placeholder=Nee.placeholder,P}function Ree(b,x,I){x=I?t:x;var P=cg(b,S,t,t,t,t,t,x);return P.placeholder=Ree.placeholder,P}function Mee(b,x,I){var P,V,ee,ge,Ce,Ie,pt=0,mt=!1,Ct=!1,jt=!0;if(typeof b!="function")throw new wu(s);x=Du(x)||0,yo(I)&&(mt=!!I.leading,Ct="maxWait"in I,ee=Ct?ws(Du(I.maxWait)||0,x):ee,jt="trailing"in I?!!I.trailing:jt);function dn(jo){var _d=P,gg=V;return P=V=t,pt=jo,ge=b.apply(gg,_d),ge}function On(jo){return pt=jo,Ce=vx(vi,x),mt?dn(jo):ge}function ui(jo){var _d=jo-Ie,gg=jo-pt,Qee=x-_d;return Ct?Wa(Qee,ee-gg):Qee}function Fn(jo){var _d=jo-Ie,gg=jo-pt;return Ie===t||_d>=x||_d<0||Ct&&gg>=ee}function vi(){var jo=SN();if(Fn(jo))return ki(jo);Ce=vx(vi,ui(jo))}function ki(jo){return Ce=t,jt&&P?dn(jo):(P=V=t,ge)}function Tc(){Ce!==t&&zJ(Ce),pt=0,P=Ie=V=Ce=t}function fl(){return Ce===t?ge:ki(SN())}function Nc(){var jo=SN(),_d=Fn(jo);if(P=arguments,V=this,Ie=jo,_d){if(Ce===t)return On(Ie);if(Ct)return zJ(Ce),Ce=vx(vi,x),dn(Ie)}return Ce===t&&(Ce=vx(vi,x)),ge}return Nc.cancel=Tc,Nc.flush=fl,Nc}var nNe=fi(function(b,x){return wJ(b,1,x)}),iNe=fi(function(b,x,I){return wJ(b,Du(x)||0,I)});function rNe(b){return cg(b,T)}function xN(b,x){if(typeof b!="function"||x!=null&&typeof x!="function")throw new wu(s);var I=function(){var P=arguments,V=x?x.apply(this,P):P[0],ee=I.cache;if(ee.has(V))return ee.get(V);var ge=b.apply(this,P);return I.cache=ee.set(V,ge)||ee,ge};return I.cache=new(xN.Cache||ag),I}xN.Cache=ag;function LN(b){if(typeof b!="function")throw new wu(s);return function(){var x=arguments;switch(x.length){case 0:return!b.call(this);case 1:return!b.call(this,x[0]);case 2:return!b.call(this,x[0],x[1]);case 3:return!b.call(this,x[0],x[1],x[2])}return!b.apply(this,x)}}function oNe(b){return kee(2,b)}var sNe=KIe(function(b,x){x=x.length==1&&ii(x[0])?uo(x[0],Dc(An())):uo(ia(x,1),Dc(An()));var I=x.length;return fi(function(P){for(var V=-1,ee=Wa(P.length,I);++V=x}),Y_=DJ(function(){return arguments}())?DJ:function(b){return Ro(b)&&mr.call(b,"callee")&&!fJ.call(b,"callee")},ii=Ye.isArray,yNe=qQ?Dc(qQ):kIe;function Hl(b){return b!=null&&EN(b.length)&&!hg(b)}function Uo(b){return Ro(b)&&Hl(b)}function wNe(b){return b===!0||b===!1||Ro(b)&&dl(b)==Ve}var nm=ODe||f8,SNe=XQ?Dc(XQ):TIe;function xNe(b){return Ro(b)&&b.nodeType===1&&!_x(b)}function LNe(b){if(b==null)return!0;if(Hl(b)&&(ii(b)||typeof b=="string"||typeof b.splice=="function"||nm(b)||VC(b)||Y_(b)))return!b.length;var x=$a(b);if(x==Ne||x==le)return!b.size;if(mx(b))return!NB(b).length;for(var I in b)if(mr.call(b,I))return!1;return!0}function ENe(b,x){return fx(b,x)}function DNe(b,x,I){I=typeof I=="function"?I:t;var P=I?I(b,x):t;return P===t?fx(b,x,t,I):!!P}function i8(b){if(!Ro(b))return!1;var x=dl(b);return x==pe||x==We||typeof b.message=="string"&&typeof b.name=="string"&&!_x(b)}function INe(b){return typeof b=="number"&&pJ(b)}function hg(b){if(!yo(b))return!1;var x=dl(b);return x==Pe||x==Se||x==ve||x==ct}function Pee(b){return typeof b=="number"&&b==ai(b)}function EN(b){return typeof b=="number"&&b>-1&&b%1==0&&b<=U}function yo(b){var x=typeof b;return b!=null&&(x=="object"||x=="function")}function Ro(b){return b!=null&&typeof b=="object"}var Oee=YQ?Dc(YQ):RIe;function kNe(b,x){return b===x||TB(b,x,GB(x))}function TNe(b,x,I){return I=typeof I=="function"?I:t,TB(b,x,GB(x),I)}function NNe(b){return Fee(b)&&b!=+b}function RNe(b){if(pke(b))throw new ti(o);return IJ(b)}function MNe(b){return b===null}function ANe(b){return b==null}function Fee(b){return typeof b=="number"||Ro(b)&&dl(b)==Me}function _x(b){if(!Ro(b)||dl(b)!=Ke)return!1;var x=JT(b);if(x===null)return!0;var I=mr.call(x,"constructor")&&x.constructor;return typeof I=="function"&&I instanceof I&&XT.call(I)==TDe}var r8=ZQ?Dc(ZQ):MIe;function PNe(b){return Pee(b)&&b>=-U&&b<=U}var Bee=QQ?Dc(QQ):AIe;function DN(b){return typeof b=="string"||!ii(b)&&Ro(b)&&dl(b)==ce}function kc(b){return typeof b=="symbol"||Ro(b)&&dl(b)==z}var VC=JQ?Dc(JQ):PIe;function ONe(b){return b===t}function FNe(b){return Ro(b)&&$a(b)==oe}function BNe(b){return Ro(b)&&dl(b)==ne}var WNe=vN(RB),$Ne=vN(function(b,x){return b<=x});function Wee(b){if(!b)return[];if(Hl(b))return DN(b)?pd(b):$l(b);if(ox&&b[ox])return _De(b[ox]());var x=$a(b),I=x==Ne?bB:x==le?KT:zC;return I(b)}function fg(b){if(!b)return b===0?b:0;if(b=Du(b),b===G||b===-G){var x=b<0?-1:1;return x*K}return b===b?b:0}function ai(b){var x=fg(b),I=x%1;return x===x?I?x-I:x:0}function $ee(b){return b?K_(ai(b),0,Y):0}function Du(b){if(typeof b=="number")return b;if(kc(b))return re;if(yo(b)){var x=typeof b.valueOf=="function"?b.valueOf():b;b=yo(x)?x+"":x}if(typeof b!="string")return b===0?b:+b;b=oJ(b);var I=bt.test(b);return I||Gn.test(b)?tDe(b.slice(2),I?2:8):we.test(b)?re:+b}function Hee(b){return Oh(b,Vl(b))}function HNe(b){return b?K_(ai(b),-U,U):b===0?b:0}function ur(b){return b==null?"":Ic(b)}var VNe=WC(function(b,x){if(mx(x)||Hl(x)){Oh(x,$s(x),b);return}for(var I in x)mr.call(x,I)&&ux(b,I,x[I])}),Vee=WC(function(b,x){Oh(x,Vl(x),b)}),IN=WC(function(b,x,I,P){Oh(x,Vl(x),b,P)}),zNe=WC(function(b,x,I,P){Oh(x,$s(x),b,P)}),UNe=ug(LB);function jNe(b,x){var I=BC(b);return x==null?I:CJ(I,x)}var KNe=fi(function(b,x){b=Pr(b);var I=-1,P=x.length,V=P>2?x[2]:t;for(V&&hl(x[0],x[1],V)&&(P=1);++I1),ee}),Oh(b,jB(b),I),P&&(I=xu(I,d|h|f,ike));for(var V=x.length;V--;)FB(I,x[V]);return I});function uRe(b,x){return Uee(b,LN(An(x)))}var dRe=ug(function(b,x){return b==null?{}:BIe(b,x)});function Uee(b,x){if(b==null)return{};var I=uo(jB(b),function(P){return[P]});return x=An(x),PJ(b,I,function(P,V){return x(P,V[0])})}function hRe(b,x,I){x=em(x,b);var P=-1,V=x.length;for(V||(V=1,b=t);++Px){var P=b;b=x,x=P}if(I||b%1||x%1){var V=mJ();return Wa(b+V*(x-b+eDe("1e-"+((V+"").length-1))),x)}return AB(b,x)}var SRe=$C(function(b,x,I){return x=x.toLowerCase(),b+(I?Gee(x):x)});function Gee(b){return a8(ur(b).toLowerCase())}function qee(b){return b=ur(b),b&&b.replace(Vr,fDe).replace(UEe,"")}function xRe(b,x,I){b=ur(b),x=Ic(x);var P=b.length;I=I===t?P:K_(ai(I),0,P);var V=I;return I-=x.length,I>=0&&b.slice(I,V)==x}function LRe(b){return b=ur(b),b&&Mn.test(b)?b.replace(Nt,gDe):b}function ERe(b){return b=ur(b),b&&mn.test(b)?b.replace(Kt,"\\$&"):b}var DRe=$C(function(b,x,I){return b+(I?"-":"")+x.toLowerCase()}),IRe=$C(function(b,x,I){return b+(I?" ":"")+x.toLowerCase()}),kRe=ZJ("toLowerCase");function TRe(b,x,I){b=ur(b),x=ai(x);var P=x?MC(b):0;if(!x||P>=x)return b;var V=(x-P)/2;return mN(iN(V),I)+b+mN(nN(V),I)}function NRe(b,x,I){b=ur(b),x=ai(x);var P=x?MC(b):0;return x&&P>>0,I?(b=ur(b),b&&(typeof x=="string"||x!=null&&!r8(x))&&(x=Ic(x),!x&&RC(b))?tm(pd(b),0,I):b.split(x,I)):[]}var BRe=$C(function(b,x,I){return b+(I?" ":"")+a8(x)});function WRe(b,x,I){return b=ur(b),I=I==null?0:K_(ai(I),0,b.length),x=Ic(x),b.slice(I,I+x.length)==x}function $Re(b,x,I){var P=Z.templateSettings;I&&hl(b,x,I)&&(x=t),b=ur(b),x=IN({},x,P,ree);var V=IN({},x.imports,P.imports,ree),ee=$s(V),ge=_B(V,ee),Ce,Ie,pt=0,mt=x.interpolate||ei,Ct="__p += '",jt=CB((x.escape||ei).source+"|"+mt.source+"|"+(mt===lt?Cs:ei).source+"|"+(x.evaluate||ei).source+"|$","g"),dn="//# sourceURL="+(mr.call(x,"sourceURL")?(x.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++XEe+"]")+` +`)}function hke(b){return ii(b)||X_(b)||!!(gJ&&b&&b[gJ])}function dg(b,x){var I=typeof b;return x=x??U,!!x&&(I=="number"||I!="symbol"&&cr.test(b))&&b>-1&&b%1==0&&b0){if(++x>=N)return arguments[0]}else x=0;return b.apply(t,arguments)}}function CN(b,x){var I=-1,P=b.length,V=P-1;for(x=x===t?P:x;++I1?b[x-1]:t;return I=typeof I=="function"?(b.pop(),I):t,xee(b,I)});function Lee(b){var x=Z(b);return x.__chain__=!0,x}function STe(b,x){return x(b),b}function yN(b,x){return x(b)}var xTe=ug(function(b){var x=b.length,I=x?b[0]:0,P=this.__wrapped__,V=function(ee){return LB(ee,b)};return x>1||this.__actions__.length||!(P instanceof yi)||!dg(I)?this.thru(V):(P=P.slice(I,+I+(x?1:0)),P.__actions__.push({func:yN,args:[V],thisArg:t}),new Su(P,this.__chain__).thru(function(ee){return x&&!ee.length&&ee.push(t),ee}))});function LTe(){return Lee(this)}function ETe(){return new Su(this.value(),this.__chain__)}function DTe(){this.__values__===t&&(this.__values__=Wee(this.value()));var b=this.__index__>=this.__values__.length,x=b?t:this.__values__[this.__index__++];return{done:b,value:x}}function ITe(){return this}function kTe(b){for(var x,I=this;I instanceof sN;){var P=_ee(I);P.__index__=0,P.__values__=t,x?V.__wrapped__=P:x=P;var V=P;I=I.__wrapped__}return V.__wrapped__=b,x}function TTe(){var b=this.__wrapped__;if(b instanceof yi){var x=b;return this.__actions__.length&&(x=new yi(this)),x=x.reverse(),x.__actions__.push({func:yN,args:[JB],thisArg:t}),new Su(x,this.__chain__)}return this.thru(JB)}function NTe(){return HJ(this.__wrapped__,this.__actions__)}var RTe=fN(function(b,x,I){mr.call(b,I)?++b[I]:lg(b,I,1)});function MTe(b,x,I){var P=ii(b)?eJ:SIe;return I&&hl(b,x,I)&&(x=t),P(b,An(x,3))}function ATe(b,x){var I=ii(b)?Xp:xJ;return I(b,An(x,3))}var PTe=QJ(bee),OTe=QJ(Cee);function FTe(b,x){return ia(wN(b,x),1)}function BTe(b,x){return ia(wN(b,x),G)}function WTe(b,x,I){return I=I===t?1:ai(I),ia(wN(b,x),I)}function Eee(b,x){var I=ii(b)?yu:Jp;return I(b,An(x,3))}function Dee(b,x){var I=ii(b)?rDe:SJ;return I(b,An(x,3))}var $Te=fN(function(b,x,I){mr.call(b,I)?b[I].push(x):lg(b,I,[x])});function HTe(b,x,I,P){b=Hl(b)?b:zC(b),I=I&&!P?ai(I):0;var V=b.length;return I<0&&(I=ws(V+I,0)),DN(b)?I<=V&&b.indexOf(x,I)>-1:!!V&&NC(b,x,I)>-1}var VTe=fi(function(b,x,I){var P=-1,V=typeof x=="function",ee=Hl(b)?Ye(b.length):[];return Jp(b,function(ge){ee[++P]=V?Ec(x,ge,I):hx(ge,x,I)}),ee}),zTe=fN(function(b,x,I){lg(b,I,x)});function wN(b,x){var I=ii(b)?uo:TJ;return I(b,An(x,3))}function UTe(b,x,I,P){return b==null?[]:(ii(x)||(x=x==null?[]:[x]),I=P?t:I,ii(I)||(I=I==null?[]:[I]),AJ(b,x,I))}var jTe=fN(function(b,x,I){b[I?0:1].push(x)},function(){return[[],[]]});function KTe(b,x,I){var P=ii(b)?hB:rJ,V=arguments.length<3;return P(b,An(x,4),I,V,Jp)}function GTe(b,x,I){var P=ii(b)?oDe:rJ,V=arguments.length<3;return P(b,An(x,4),I,V,SJ)}function qTe(b,x){var I=ii(b)?Xp:xJ;return I(b,LN(An(x,3)))}function XTe(b){var x=ii(b)?bJ:HIe;return x(b)}function YTe(b,x,I){(I?hl(b,x,I):x===t)?x=1:x=ai(x);var P=ii(b)?_Ie:VIe;return P(b,x)}function ZTe(b){var x=ii(b)?bIe:UIe;return x(b)}function QTe(b){if(b==null)return 0;if(Hl(b))return DN(b)?MC(b):b.length;var x=$a(b);return x==Ne||x==le?b.size:NB(b).length}function JTe(b,x,I){var P=ii(b)?fB:jIe;return I&&hl(b,x,I)&&(x=t),P(b,An(x,3))}var eNe=fi(function(b,x){if(b==null)return[];var I=x.length;return I>1&&hl(b,x[0],x[1])?x=[]:I>2&&hl(x[0],x[1],x[2])&&(x=[x[0]]),AJ(b,ia(x,1),[])}),SN=ADe||function(){return na.Date.now()};function tNe(b,x){if(typeof x!="function")throw new wu(s);return b=ai(b),function(){if(--b<1)return x.apply(this,arguments)}}function Iee(b,x,I){return x=I?t:x,x=b&&x==null?b.length:x,cg(b,D,t,t,t,t,x)}function kee(b,x){var I;if(typeof x!="function")throw new wu(s);return b=ai(b),function(){return--b>0&&(I=x.apply(this,arguments)),b<=1&&(x=t),I}}var t8=fi(function(b,x,I){var P=v;if(I.length){var V=Zp(I,HC(t8));P|=L}return cg(b,P,x,I,V)}),Tee=fi(function(b,x,I){var P=v|m;if(I.length){var V=Zp(I,HC(Tee));P|=L}return cg(x,P,b,I,V)});function Nee(b,x,I){x=I?t:x;var P=cg(b,y,t,t,t,t,t,x);return P.placeholder=Nee.placeholder,P}function Ree(b,x,I){x=I?t:x;var P=cg(b,S,t,t,t,t,t,x);return P.placeholder=Ree.placeholder,P}function Mee(b,x,I){var P,V,ee,ge,Ce,Ie,pt=0,mt=!1,Ct=!1,jt=!0;if(typeof b!="function")throw new wu(s);x=Du(x)||0,yo(I)&&(mt=!!I.leading,Ct="maxWait"in I,ee=Ct?ws(Du(I.maxWait)||0,x):ee,jt="trailing"in I?!!I.trailing:jt);function dn(jo){var _d=P,gg=V;return P=V=t,pt=jo,ge=b.apply(gg,_d),ge}function On(jo){return pt=jo,Ce=vx(vi,x),mt?dn(jo):ge}function ui(jo){var _d=jo-Ie,gg=jo-pt,Qee=x-_d;return Ct?Wa(Qee,ee-gg):Qee}function Fn(jo){var _d=jo-Ie,gg=jo-pt;return Ie===t||_d>=x||_d<0||Ct&&gg>=ee}function vi(){var jo=SN();if(Fn(jo))return ki(jo);Ce=vx(vi,ui(jo))}function ki(jo){return Ce=t,jt&&P?dn(jo):(P=V=t,ge)}function Tc(){Ce!==t&&zJ(Ce),pt=0,P=Ie=V=Ce=t}function fl(){return Ce===t?ge:ki(SN())}function Nc(){var jo=SN(),_d=Fn(jo);if(P=arguments,V=this,Ie=jo,_d){if(Ce===t)return On(Ie);if(Ct)return zJ(Ce),Ce=vx(vi,x),dn(Ie)}return Ce===t&&(Ce=vx(vi,x)),ge}return Nc.cancel=Tc,Nc.flush=fl,Nc}var nNe=fi(function(b,x){return wJ(b,1,x)}),iNe=fi(function(b,x,I){return wJ(b,Du(x)||0,I)});function rNe(b){return cg(b,T)}function xN(b,x){if(typeof b!="function"||x!=null&&typeof x!="function")throw new wu(s);var I=function(){var P=arguments,V=x?x.apply(this,P):P[0],ee=I.cache;if(ee.has(V))return ee.get(V);var ge=b.apply(this,P);return I.cache=ee.set(V,ge)||ee,ge};return I.cache=new(xN.Cache||ag),I}xN.Cache=ag;function LN(b){if(typeof b!="function")throw new wu(s);return function(){var x=arguments;switch(x.length){case 0:return!b.call(this);case 1:return!b.call(this,x[0]);case 2:return!b.call(this,x[0],x[1]);case 3:return!b.call(this,x[0],x[1],x[2])}return!b.apply(this,x)}}function oNe(b){return kee(2,b)}var sNe=KIe(function(b,x){x=x.length==1&&ii(x[0])?uo(x[0],Dc(An())):uo(ia(x,1),Dc(An()));var I=x.length;return fi(function(P){for(var V=-1,ee=Wa(P.length,I);++V=x}),X_=DJ(function(){return arguments}())?DJ:function(b){return Ro(b)&&mr.call(b,"callee")&&!fJ.call(b,"callee")},ii=Ye.isArray,yNe=qQ?Dc(qQ):kIe;function Hl(b){return b!=null&&EN(b.length)&&!hg(b)}function Uo(b){return Ro(b)&&Hl(b)}function wNe(b){return b===!0||b===!1||Ro(b)&&dl(b)==Ve}var im=ODe||f8,SNe=XQ?Dc(XQ):TIe;function xNe(b){return Ro(b)&&b.nodeType===1&&!_x(b)}function LNe(b){if(b==null)return!0;if(Hl(b)&&(ii(b)||typeof b=="string"||typeof b.splice=="function"||im(b)||VC(b)||X_(b)))return!b.length;var x=$a(b);if(x==Ne||x==le)return!b.size;if(mx(b))return!NB(b).length;for(var I in b)if(mr.call(b,I))return!1;return!0}function ENe(b,x){return fx(b,x)}function DNe(b,x,I){I=typeof I=="function"?I:t;var P=I?I(b,x):t;return P===t?fx(b,x,t,I):!!P}function i8(b){if(!Ro(b))return!1;var x=dl(b);return x==pe||x==We||typeof b.message=="string"&&typeof b.name=="string"&&!_x(b)}function INe(b){return typeof b=="number"&&pJ(b)}function hg(b){if(!yo(b))return!1;var x=dl(b);return x==Pe||x==Se||x==ve||x==ct}function Pee(b){return typeof b=="number"&&b==ai(b)}function EN(b){return typeof b=="number"&&b>-1&&b%1==0&&b<=U}function yo(b){var x=typeof b;return b!=null&&(x=="object"||x=="function")}function Ro(b){return b!=null&&typeof b=="object"}var Oee=YQ?Dc(YQ):RIe;function kNe(b,x){return b===x||TB(b,x,GB(x))}function TNe(b,x,I){return I=typeof I=="function"?I:t,TB(b,x,GB(x),I)}function NNe(b){return Fee(b)&&b!=+b}function RNe(b){if(pke(b))throw new ti(o);return IJ(b)}function MNe(b){return b===null}function ANe(b){return b==null}function Fee(b){return typeof b=="number"||Ro(b)&&dl(b)==Me}function _x(b){if(!Ro(b)||dl(b)!=Ke)return!1;var x=JT(b);if(x===null)return!0;var I=mr.call(x,"constructor")&&x.constructor;return typeof I=="function"&&I instanceof I&&XT.call(I)==TDe}var r8=ZQ?Dc(ZQ):MIe;function PNe(b){return Pee(b)&&b>=-U&&b<=U}var Bee=QQ?Dc(QQ):AIe;function DN(b){return typeof b=="string"||!ii(b)&&Ro(b)&&dl(b)==ce}function kc(b){return typeof b=="symbol"||Ro(b)&&dl(b)==z}var VC=JQ?Dc(JQ):PIe;function ONe(b){return b===t}function FNe(b){return Ro(b)&&$a(b)==oe}function BNe(b){return Ro(b)&&dl(b)==ne}var WNe=vN(RB),$Ne=vN(function(b,x){return b<=x});function Wee(b){if(!b)return[];if(Hl(b))return DN(b)?pd(b):$l(b);if(ox&&b[ox])return _De(b[ox]());var x=$a(b),I=x==Ne?bB:x==le?KT:zC;return I(b)}function fg(b){if(!b)return b===0?b:0;if(b=Du(b),b===G||b===-G){var x=b<0?-1:1;return x*K}return b===b?b:0}function ai(b){var x=fg(b),I=x%1;return x===x?I?x-I:x:0}function $ee(b){return b?j_(ai(b),0,Y):0}function Du(b){if(typeof b=="number")return b;if(kc(b))return re;if(yo(b)){var x=typeof b.valueOf=="function"?b.valueOf():b;b=yo(x)?x+"":x}if(typeof b!="string")return b===0?b:+b;b=oJ(b);var I=bt.test(b);return I||Gn.test(b)?tDe(b.slice(2),I?2:8):we.test(b)?re:+b}function Hee(b){return Oh(b,Vl(b))}function HNe(b){return b?j_(ai(b),-U,U):b===0?b:0}function ur(b){return b==null?"":Ic(b)}var VNe=WC(function(b,x){if(mx(x)||Hl(x)){Oh(x,$s(x),b);return}for(var I in x)mr.call(x,I)&&ux(b,I,x[I])}),Vee=WC(function(b,x){Oh(x,Vl(x),b)}),IN=WC(function(b,x,I,P){Oh(x,Vl(x),b,P)}),zNe=WC(function(b,x,I,P){Oh(x,$s(x),b,P)}),UNe=ug(LB);function jNe(b,x){var I=BC(b);return x==null?I:CJ(I,x)}var KNe=fi(function(b,x){b=Pr(b);var I=-1,P=x.length,V=P>2?x[2]:t;for(V&&hl(x[0],x[1],V)&&(P=1);++I1),ee}),Oh(b,jB(b),I),P&&(I=xu(I,d|h|f,ike));for(var V=x.length;V--;)FB(I,x[V]);return I});function uRe(b,x){return Uee(b,LN(An(x)))}var dRe=ug(function(b,x){return b==null?{}:BIe(b,x)});function Uee(b,x){if(b==null)return{};var I=uo(jB(b),function(P){return[P]});return x=An(x),PJ(b,I,function(P,V){return x(P,V[0])})}function hRe(b,x,I){x=tm(x,b);var P=-1,V=x.length;for(V||(V=1,b=t);++Px){var P=b;b=x,x=P}if(I||b%1||x%1){var V=mJ();return Wa(b+V*(x-b+eDe("1e-"+((V+"").length-1))),x)}return AB(b,x)}var SRe=$C(function(b,x,I){return x=x.toLowerCase(),b+(I?Gee(x):x)});function Gee(b){return a8(ur(b).toLowerCase())}function qee(b){return b=ur(b),b&&b.replace(Vr,fDe).replace(UEe,"")}function xRe(b,x,I){b=ur(b),x=Ic(x);var P=b.length;I=I===t?P:j_(ai(I),0,P);var V=I;return I-=x.length,I>=0&&b.slice(I,V)==x}function LRe(b){return b=ur(b),b&&Mn.test(b)?b.replace(Nt,gDe):b}function ERe(b){return b=ur(b),b&&mn.test(b)?b.replace(Kt,"\\$&"):b}var DRe=$C(function(b,x,I){return b+(I?"-":"")+x.toLowerCase()}),IRe=$C(function(b,x,I){return b+(I?" ":"")+x.toLowerCase()}),kRe=ZJ("toLowerCase");function TRe(b,x,I){b=ur(b),x=ai(x);var P=x?MC(b):0;if(!x||P>=x)return b;var V=(x-P)/2;return mN(iN(V),I)+b+mN(nN(V),I)}function NRe(b,x,I){b=ur(b),x=ai(x);var P=x?MC(b):0;return x&&P>>0,I?(b=ur(b),b&&(typeof x=="string"||x!=null&&!r8(x))&&(x=Ic(x),!x&&RC(b))?nm(pd(b),0,I):b.split(x,I)):[]}var BRe=$C(function(b,x,I){return b+(I?" ":"")+a8(x)});function WRe(b,x,I){return b=ur(b),I=I==null?0:j_(ai(I),0,b.length),x=Ic(x),b.slice(I,I+x.length)==x}function $Re(b,x,I){var P=Z.templateSettings;I&&hl(b,x,I)&&(x=t),b=ur(b),x=IN({},x,P,ree);var V=IN({},x.imports,P.imports,ree),ee=$s(V),ge=_B(V,ee),Ce,Ie,pt=0,mt=x.interpolate||ei,Ct="__p += '",jt=CB((x.escape||ei).source+"|"+mt.source+"|"+(mt===lt?Cs:ei).source+"|"+(x.evaluate||ei).source+"|$","g"),dn="//# sourceURL="+(mr.call(x,"sourceURL")?(x.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++XEe+"]")+` `;b.replace(jt,function(Fn,vi,ki,Tc,fl,Nc){return ki||(ki=Tc),Ct+=b.slice(pt,Nc).replace(Qr,pDe),vi&&(Ce=!0,Ct+=`' + __e(`+vi+`) + '`),fl&&(Ie=!0,Ct+=`'; @@ -1207,6 +1207,6 @@ __p += '`),ki&&(Ct+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+Ct+`return __p -}`;var ui=Yee(function(){return ir(ee,dn+"return "+Ct).apply(t,ge)});if(ui.source=Ct,i8(ui))throw ui;return ui}function HRe(b){return ur(b).toLowerCase()}function VRe(b){return ur(b).toUpperCase()}function zRe(b,x,I){if(b=ur(b),b&&(I||x===t))return oJ(b);if(!b||!(x=Ic(x)))return b;var P=pd(b),V=pd(x),ee=sJ(P,V),ge=aJ(P,V)+1;return tm(P,ee,ge).join("")}function URe(b,x,I){if(b=ur(b),b&&(I||x===t))return b.slice(0,cJ(b)+1);if(!b||!(x=Ic(x)))return b;var P=pd(b),V=aJ(P,pd(x))+1;return tm(P,0,V).join("")}function jRe(b,x,I){if(b=ur(b),b&&(I||x===t))return b.replace(lr,"");if(!b||!(x=Ic(x)))return b;var P=pd(b),V=sJ(P,pd(x));return tm(P,V).join("")}function KRe(b,x){var I=M,P=A;if(yo(x)){var V="separator"in x?x.separator:V;I="length"in x?ai(x.length):I,P="omission"in x?Ic(x.omission):P}b=ur(b);var ee=b.length;if(RC(b)){var ge=pd(b);ee=ge.length}if(I>=ee)return b;var Ce=I-MC(P);if(Ce<1)return P;var Ie=ge?tm(ge,0,Ce).join(""):b.slice(0,Ce);if(V===t)return Ie+P;if(ge&&(Ce+=Ie.length-Ce),r8(V)){if(b.slice(Ce).search(V)){var pt,mt=Ie;for(V.global||(V=CB(V.source,ur($t.exec(V))+"g")),V.lastIndex=0;pt=V.exec(mt);)var Ct=pt.index;Ie=Ie.slice(0,Ct===t?Ce:Ct)}}else if(b.indexOf(Ic(V),Ce)!=Ce){var jt=Ie.lastIndexOf(V);jt>-1&&(Ie=Ie.slice(0,jt))}return Ie+P}function GRe(b){return b=ur(b),b&&nn.test(b)?b.replace(Bt,wDe):b}var qRe=$C(function(b,x,I){return b+(I?" ":"")+x.toUpperCase()}),a8=ZJ("toUpperCase");function Xee(b,x,I){return b=ur(b),x=I?t:x,x===t?vDe(b)?LDe(b):lDe(b):b.match(x)||[]}var Yee=fi(function(b,x){try{return Ec(b,t,x)}catch(I){return i8(I)?I:new ti(I)}}),XRe=ug(function(b,x){return yu(x,function(I){I=Fh(I),lg(b,I,t8(b[I],b))}),b});function YRe(b){var x=b==null?0:b.length,I=An();return b=x?uo(b,function(P){if(typeof P[1]!="function")throw new wu(s);return[I(P[0]),P[1]]}):[],fi(function(P){for(var V=-1;++VU)return[];var I=Y,P=Wa(b,Y);x=An(x),b-=Y;for(var V=vB(P,x);++I0||x<0)?new yi(I):(b<0?I=I.takeRight(-b):b&&(I=I.drop(b)),x!==t&&(x=ai(x),I=x<0?I.dropRight(-x):I.take(x-b)),I)},yi.prototype.takeRightWhile=function(b){return this.reverse().takeWhile(b).reverse()},yi.prototype.toArray=function(){return this.take(Y)},Ph(yi.prototype,function(b,x){var I=/^(?:filter|find|map|reject)|While$/.test(x),P=/^(?:head|last)$/.test(x),V=Z[P?"take"+(x=="last"?"Right":""):x],ee=P||/^find/.test(x);V&&(Z.prototype[x]=function(){var ge=this.__wrapped__,Ce=P?[1]:arguments,Ie=ge instanceof yi,pt=Ce[0],mt=Ie||ii(ge),Ct=function(vi){var ki=V.apply(Z,Xp([vi],Ce));return P&&jt?ki[0]:ki};mt&&I&&typeof pt=="function"&&pt.length!=1&&(Ie=mt=!1);var jt=this.__chain__,dn=!!this.__actions__.length,On=ee&&!jt,ui=Ie&&!dn;if(!ee&&mt){ge=ui?ge:new yi(this);var Fn=b.apply(ge,Ce);return Fn.__actions__.push({func:yN,args:[Ct],thisArg:t}),new Su(Fn,jt)}return On&&ui?b.apply(this,Ce):(Fn=this.thru(Ct),On?P?Fn.value()[0]:Fn.value():Fn)})}),yu(["pop","push","shift","sort","splice","unshift"],function(b){var x=GT[b],I=/^(?:push|sort|unshift)$/.test(b)?"tap":"thru",P=/^(?:pop|shift)$/.test(b);Z.prototype[b]=function(){var V=arguments;if(P&&!this.__chain__){var ee=this.value();return x.apply(ii(ee)?ee:[],V)}return this[I](function(ge){return x.apply(ii(ge)?ge:[],V)})}}),Ph(yi.prototype,function(b,x){var I=Z[x];if(I){var P=I.name+"";mr.call(FC,P)||(FC[P]=[]),FC[P].push({name:x,func:I})}}),FC[gN(t,m).name]=[{name:"wrapper",func:t}],yi.prototype.clone=GDe,yi.prototype.reverse=qDe,yi.prototype.value=XDe,Z.prototype.at=xTe,Z.prototype.chain=LTe,Z.prototype.commit=ETe,Z.prototype.next=DTe,Z.prototype.plant=kTe,Z.prototype.reverse=TTe,Z.prototype.toJSON=Z.prototype.valueOf=Z.prototype.value=NTe,Z.prototype.first=Z.prototype.head,ox&&(Z.prototype[ox]=ITe),Z},AC=EDe();V_?((V_.exports=AC)._=AC,cB._=AC):na._=AC}).call(bx)})(Ekt,sa);var Gi=(i=>(i[i.INITIAL=0]="INITIAL",i[i.BUSY=1]="BUSY",i[i.WAIT_INPUT=2]="WAIT_INPUT",i[i.FREE=3]="FREE",i[i.STATIC_CHECK_FAILED=4]="STATIC_CHECK_FAILED",i[i.RUNTIME_ERROR=5]="RUNTIME_ERROR",i[i.MAX_STEP_REACHED=6]="MAX_STEP_REACHED",i[i.EXITED_NORMALLY=7]="EXITED_NORMALLY",i[i.EXITED_ABNORMALLY=8]="EXITED_ABNORMALLY",i[i.CLOSED=9]="CLOSED",i))(Gi||{});const Dkt={instructions:[],text:[],memory:new Uint8Array},Ude={total:0,stack:0,globalVariable:0},jde={mainFunctionAddressBefore:-1,globalVariableTable:{},variableTableStack:[],assignCallLValueStack:[]},Kde={stepCount:0,timeElapsed:0,state:0,callStack:[],staticErrors:[],runtimeErrors:[]};var Ql=(i=>(i[i.SUCCESS=0]="SUCCESS",i[i.ERROR=1]="ERROR",i[i.WARNING=2]="WARNING",i[i.INPUT=3]="INPUT",i[i.OUTPUT=4]="OUTPUT",i[i.PROMPT=5]="PROMPT",i[i.ARROW=6]="ARROW",i))(Ql||{});const zd={maxExecutionStepCount:{min:0,max:999999999},memorySize:{min:1*Av,max:32*Pv},stackSize:{min:512,max:32*Pv-512}},Gde={maxExecutionStepCount:5e6,memorySize:1536*Av,stackSize:1*Pv};class PEe{constructor(){Ss(this,"initialRegisters",{eax:0,ebx:0,ecx:0,edx:0,ebp:0,esp:Gde.memorySize,eip:0});Ss(this,"decoder",new Lkt);Ss(this,"memory",sa.cloneDeep(Dkt));Ss(this,"registers",sa.cloneDeep(this.initialRegisters));Ss(this,"tables",sa.cloneDeep(jde));Ss(this,"executionStatus",sa.cloneDeep(Kde));Ss(this,"peakMemoryUsage",sa.cloneDeep(Ude));Ss(this,"options",sa.cloneDeep(Gde));Ss(this,"executionStartTime",new Date);Ss(this,"writeBuffer",[]);Ss(this,"readConsole",()=>Promise.resolve(""));Ss(this,"entryFunctionName","main")}setReadConsoleFn(e){this.readConsole=e}getSingleVariableValues(e){const t=[];for(let n=e.address;n=this.memory.text.length?-1:this.memory.text[this.registers.eip].lineNumber}get instructions(){return this.memory.instructions}get globalVariableDetails(){return this.getSingleTableVariableDetails(this.tables.globalVariableTable)}get localVariableDetailsStack(){const e=[];for(let t=0;t(n=Math.max(n,r.min),n=Math.min(n,r.max),n);e.maxExecutionStepCount!==void 0&&(e.maxExecutionStepCount=t(e.maxExecutionStepCount,zd.maxExecutionStepCount),this.options.maxExecutionStepCount=e.maxExecutionStepCount),e.memorySize!==void 0&&(e.memorySize=t(e.memorySize,zd.memorySize),e.memorySize=t(e.memorySize,{min:this.options.stackSize,max:zd.memorySize.max}),this.options.memorySize=e.memorySize,this.initialRegisters.esp=Zl(e.memorySize),this.registers.esp=Zl(e.memorySize),this.updatePeakMemoryUsage()),e.stackSize!==void 0&&(e.stackSize=t(e.stackSize,zd.stackSize),e.stackSize=t(e.stackSize,{min:zd.stackSize.min,max:this.options.memorySize}),this.options.stackSize=e.stackSize)}reset(){this.memory.text=[],this.memory.memory=new Uint8Array,this.registers=sa.cloneDeep(this.initialRegisters),this.tables=sa.cloneDeep(jde),this.executionStatus=sa.cloneDeep(Kde),this.peakMemoryUsage=sa.cloneDeep(Ude),this.writeBuffer=[]}close(){this.executionStatus.state=9}loadNewInstructions(e){this.reset(),this.memory.instructions=e}loadAndDecodeNewInstructions(e){this.loadNewInstructions(e),this.decodeInstructions(!0)}decodeInstructions(e){const t=new Map,n=new Map;for(let r=0;rn;case y0.GE:return t>=n}}async execute(e){do{if((this.executionStatus.state===7||this.executionStatus.state===8||this.executionStatus.state===0)&&(this.reset(),this.prepareExcution()),this.executionStatus.state!==3)return;if(this.executionStatus.state=1,this.options.maxExecutionStepCount>0&&this.executionStatus.stepCount>=this.options.maxExecutionStepCount){this.executionStatus.state=6,this.writeBuffer.push([{key:"MAX_STEP_REACHED",values:{maxExecutionStepCount:this.options.maxExecutionStepCount},type:1}]);return}if(this.registers.eip>=this.memory.text.length||this.registers.eip<0){this.executionStatus.state=5,this.writeBuffer.push([{key:"RUNTIME_ERROR_PREFIX_NO_LN",type:1},{key:"INSTRUCTION_READ_OUT_OF_BOUND",values:{address:this.registers.eip},type:1}]);return}this.executionStatus.stepCount++;const t=this.memory.text[this.registers.eip];switch(t.type){case Mo.ARG:{const n=this.getSingularValue(t.value.value);if(n===null||!this.pushl(n))return;this.registers.ecx=Oc(this.registers.ecx,4);break}case Mo.ASSIGN:{const n=this.getRValue(t.value.rValue);if(n===null)return;const r=this.getLValueAddress(t.value.lValue);if(r===null||!this.storeMemory32(n,r))return;break}case Mo.ASSIGN_CALL:case Mo.CALL:{const n=t.type===Mo.CALL?t.value.id:t.value.functionId;if(this.registers.ebx=this.registers.esp,!this.pushl(this.registers.ecx)||(this.registers.ecx=0,!this.pushl(this.registers.eip))||!this.pushl(this.registers.ebp))return;this.registers.ebp=this.registers.esp,t.type===Mo.ASSIGN_CALL?this.tables.assignCallLValueStack.push(t.value.lValue):this.tables.assignCallLValueStack.push(null),this.tables.variableTableStack.push({}),this.executionStatus.callStack.push(n),this.registers.eip=t.value.functionAddressBefore;break}case Mo.DEC:{if(this.createStackVariable(t.value.id,t.value.size)===null)return;break}case Mo.GOTO:{this.registers.eip=t.value.gotoAddressBefore;break}case Mo.IF:{const n=this.getCondValue(t.value.condition);if(n===null)return;n&&(this.registers.eip=t.value.gotoAddressBefore);break}case Mo.PARAM:{const n=t.value.id;if(n in this.tables.variableTableStack[this.tables.variableTableStack.length-1]){this.writeRuntimeError({key:"DUPLICATE_PARAM_ID",values:{id:n,lastLineNumber:this.tables.variableTableStack[this.tables.variableTableStack.length-1][n].lineNumber}});return}if(this.loadMemory32(this.registers.ebx)===null)return;this.tables.variableTableStack[this.tables.variableTableStack.length-1][n]={address:this.registers.ebx,size:4,lineNumber:t.lineNumber},this.registers.ebx=Oc(this.registers.ebx,4);break}case Mo.RETURN:{const n=this.getSingularValue(t.value.value);if(n===null)return;this.registers.eax=n,this.registers.esp=this.registers.ebp,this.updatePeakMemoryUsage();const r=this.popl();if(r===null)return;this.registers.ebp=r;const o=this.popl();if(o===null)return;this.registers.eip=o;const s=this.popl();if(s===null)return;if(this.registers.esp=Oc(this.registers.esp,s),this.updatePeakMemoryUsage(),this.registers.ecx=0,this.tables.variableTableStack.length===0){this.writeRuntimeError({key:"EMPTY_VARIABLE_TABLE_STACK"});return}if(this.executionStatus.callStack.pop(),this.tables.variableTableStack.pop(),this.registers.eip===this.memory.text.length){this.finalizeExcution();return}const a=this.tables.assignCallLValueStack.pop();if(a!==null){const l=this.getLValueAddress(a);if(l===null||!this.storeMemory32(this.registers.eax,l))return}break}case Mo.READ:{const n=t.value,r=this.getLValueAddress(n.lValue);if(r===null)return;const o=n.lValue.type===YL.ID?n.lValue.id:"*"+n.lValue.id;this.executionStatus.state=2;const s=await this.readConsole([{key:"READ_PROMPT",values:{name:o}}]);if(this.state!==2)return;this.executionStatus.state=1;const a=parseInt(s);if(isNaN(a)){this.writeRuntimeError({key:"INPUT_INT_ILLEGAL"});return}if(!Number.isSafeInteger(a)){this.writeRuntimeError({key:"INPUT_INT_ABS_TOO_LARGE"});return}if(!this.storeMemory32(Zl(a),r))return;break}case Mo.WRITE:{const n=this.getSingularValue(t.value.value);if(n===null)return;this.writeBuffer.push([{key:"WRITE_OUTPUT",values:{value:n},type:4}]);break}}for(this.registers.eip=Oc(this.registers.eip,1);this.registers.eip=0&&this.memory.text[this.registers.eip].type===Mo.GLOBAL_DEC;)this.registers.eip=Oc(this.registers.eip,1);this.executionStatus.state=3}while(e)}async executeSingleStep(){await this.execute(!1)}async executeContinuously(){await this.execute(!0)}}function Ikt(i,e=18){let t=0,n=0;for(let r=0;re){t=r;break}return n<=e?i:i.substring(0,t)+"..."}function kkt(i){for(let e=1;;e++){const t=`Untitled-${e}`;if(i.every(n=>n!==t))return t}}function OEe(i){return i.split(/\r\n|[\r\n]/)}function Tkt(i){return i.trim().split(/\s/).filter(e=>e.length>0)}function Nkt(i){return i",READ_INPUT:"{value}",PROGRAM_EXITED:"程序执行结束,返回值为{returnValue}。",EXECUTION_STEP_COUNT_TIME:"总执行步数:{stepCount, number};总执行耗时:{time, number}ms"},Pkt={APP_TITLE:"IR Virtual Machine",ADD:"New",IMPORT:"Import",DEMOS:"Demos",DEMO_SOURCES:"Sources",SAVE:"Save",THEME:"Theme",ABOUT:"About",CLOSE:"Close",CONFIRM_UNSAVED_CLOSE:"Save changes to {name} before close?",SAVE_CLOSE:"Save&Close",UNSAVE_CLOSE:"Close",OK:"OK",CANCEL:"Cancel",EMPTY_PLACEHOLDER_DESC:"An IR virtual machine for HIT/NJU Compilation Principle labs",EMPTY_PLACEHOLDER_HINT_TITLE:"You may:",EMPTY_PLACEHOLDER_HINT_1:"Add or import .ir files in left sidebar",EMPTY_PLACEHOLDER_HINT_2:"Drag one or more .ir files inside",EMPTY_PLACEHOLDER_HINT_3:"Try out Demos in left sidebar",FETCH_FAILED:"fetch() for {url} failed",NOT_AN_IR_FILE:"{fileName} is not an ir file",IR_IMPORT_FAILED:"Failed to import {fileName}",RUN:"Run",RUN_STEP:"Step",RESET:"Reset",CLEAR_CONSOLE:"Clear",STEP_COUNT:"Step Count: ",STEP_COUNT_NUMBER:"{stepCount, number}",STATE:"VM State: ",STATE_INITIAL:"Initial",STATE_BUSY:"Busy",STATE_WAIT_INPUT:"Awaiting Input",STATE_FREE:"Free",STATE_STATIC_CHECK_FAILED:"IR Static Check Error",STATE_RUNTIME_ERROR:"Runtime Error",STATE_MAX_STEP_REACHED:"Max Step Count Reached",STATE_EXITED_NORMALLY:"Exited Normally (Return value 0)",STATE_EXITED_ABNORMALLY:"Exited Abnormally (Return value not 0)",MAX_EXECUTION_STEP_COUNT:"Max Steps",SET_0_MEANS_NO_STEP_LIMIT:"No step limit if set to 0",MEMORY_SIZE:"Memory Size/B",STACK_SIZE:"Stack Size/B",TOTAL_MEMORY_USAGE:"Total Memory Usage: ",STACK_MEMORY_USAGE:"Stack Memory Usage: ",GLOBAL_VARIABLE_MEMORY_USAGE:"GlobalVar Memory Usage: ",PEAK_MEMORY_USAGE:"Peak Usage: ",PERCENTAGE_USAGE:"{percentage, number, ::.0}%",BYTE_USAGE:"{used}B/{total}B",ARBITRARY_UNIT_MEMORY_USAGE:"{used, number, ::.0}{unit}/{total, number, ::.0}{unit}",BYTE_SIZE:"{size}B",ARBITRARY_UNIT_SIZE:"{size, number, ::.0}{unit}",GLOBAL_VARIABLE_TABLE:"Global Variable Table",LOCAL_VARIABLE_TABLE:"Local Variable Table",VARIABLE_ID:"ID",ADDRESS:"Address",SIZE:"Size",VALUES:"Value",EMPTY_VATIABLE_TABLE:"(Empty)",CALL_STACK_DEPTH:"Call stack depth {depth}",STATIC_ERROR_PREFIX:"Static Check Error (Line {lineNumber}): ",STATIC_ERROR_PREFIX_NO_LINE_NUMBER:"Static Check Error: ",DECODE_ERROR_PREFIX:"IR Decoding Error (Line {lineNumber}): ",UNRECOGNIZED_INSTRUCTION:"Unrecognized IR instruction",ILLEGAL_INSTRUCTION_FORMAT:"Illegal IR format",FUNCTION_ILLEGAL_ID:"FUNCTION id illegal",ASSIGN_ILLEGAL_LEFT:"Illegal left hand side of assignment",ASSIGN_ILLEGAL_RIGHT:"Illegal right hand side of assignment",ASSIGN_RIGHT_IMM_TOO_LARGE:"Right hand side immediate number of assignment too large",ASSIGN_ILLEGAL_RIGHT_OPERATOR:"Illegal math operator on RHS of assignment",ASSIGN_ILLEGAL_RIGHT_OPERAND1:"Illegal first Singular operand on RHS of assignment",ASSIGN_RIGHT_OPERAND1_IMM_TOO_LARGE:"First immediate number operand on RHS of assignment too large",ASSIGN_ILLEGAL_RIGHT_OPERAND2:"Illegal second Singular operand on RHS of assignment",ASSIGN_RIGHT_OPERAND2_IMM_TOO_LARGE:"Second immediate number operand on RHS of assignment too large",DEC_ILLEGAL_ID:"DEC's id illegal",DEC_ILLEGAL_SIZE_FORMAT:"DEC's size format illegal",DEC_SIZE_TOO_LARGE:"DEC's size too large",DEC_SIZE_NOT_4_MULTIPLE:"DEC's size not a multiple of 4",GLOBAL_DEC_ILLEGAL_ID:"GLOBAL_DEC's id illegal",GLOBAL_DEC_ILLEGAL_SIZE_FORMAT:"GLOBAL_DEC's size format illegal",GLOBAL_DEC_SIZE_TOO_LARGE:"GLOBAL_DEC's size too large",GLOBAL_DEC_SIZE_NOT_4_MULTIPLE:"GLOBAL_DEC's size not a multiple of 4",LABEL_ILLEGAL_ID:"LABEL's id illegal",GOTO_ILLEGAL_ID:"GOTO's id illegal",DUPLICATE_LABEL_ID:"LABEL's label id ''{id}'' already declared (last declared at line {lastLineNumber})",DUPLICATE_FUNCTION_ID:"FUNCTION's function id ''{id}'' already declared (last declared at line {lastLineNumber})",FUNCTION_NOT_FOUND:"Can't find function ''{id}''",LABEL_NOT_FOUND:"Can't find label ''{id}''",IF_ILLEGAL_COND_OPERATOR:"IF's relop illegal",IF_ILLEGAL_COND_OPERAND1:"IF's first Singular operand in condition illegal",IF_COND_OPERAND1_IMM_TOO_LARGE:"IF's first immediate number operand in condition too large",IF_ILLEGAL_COND_OPERAND2:"IF's second Singular operand in condition illegal",IF_COND_OPERAND2_IMM_TOO_LARGE:"IF's second immediate number operand in condition too large",IF_ILLEGAL_GOTO_ID:"IF's GOTO id illegal",ARG_ILLEGAL:"ARG's Singular arg illegal",ARG_IMM_TOO_LARGE:"ARG's immediate number arg too large",CALL_ILLEGAL_ID:"CALL's function id illegal",PARAM_ILLEGAL_ID:"PARAM's param id illegal",RETURN_ILLEGAL:"RETURN's Singular return value illegal",RETURN_IMM_TOO_LARGE:"RETURN's immediate number return value too large",READ_ILLEGAL:"Illegal LValue for READ",WRITE_ILLEGAL:"Illegal Singular for WRITE",WRITE_IMM_TOO_LARGE:"Immediate number for WRITE too large",NO_MAIN_FUNCTION:"Function 'main' is not defined",RUNTIME_ERROR_PREFIX:"Runtime Error (Line {lineNumber}): ",RUNTIME_ERROR_PREFIX_NO_LN:"Runtime Error: ",GLOBAL_VARIABLE_SEGMENT_OVERFLOW:"Global variable segment overflow",STACK_OVERFLOW:"Stack overflow",VARIABLE_NOT_FOUND:"Can't find variable ''{id}''",INSTRUCTION_READ_OUT_OF_BOUND:"Reading instruction from {address} is out of bound",MEMORY_READ_OUT_OF_BOUND:"Reading 4 bytes from {address} is out of bound",MEMORY_WRITE_OUT_OF_BOUND:"Writing 4 bytes to {address} is out of bound",EMPTY_VARIABLE_TABLE_STACK:"Empty local variable stack",DUPLICATE_DEC_ID:"DEC's variable id ''{id}'' already declared (last declared at line {lastLineNumber})",DUPLICATE_GLOBAL_DEC_ID:"GLOBAL_DEC's global variable id ''{id}'' already declared (last declared at line {lastLineNumber})",DUPLICATE_PARAM_ID:"PARAM's param id ''{id}'' already declared (last declared at line {lastLineNumber})",DIVIDE_BY_ZERO:"Cannot divide by 0",MAX_STEP_REACHED:"Maximum execution step count reached ({maxExecutionStepCount, number})",INPUT_INT_ILLEGAL:"Illegal input integer",INPUT_INT_ABS_TOO_LARGE:"Absolute value of input integer too large",WRITE_OUTPUT:"{value}",READ_PROMPT:"Please enter a value for {name}:",CONSOLE_ARROW:">",READ_INPUT:"{value}",PROGRAM_EXITED:"Program exited with return value {returnValue}.",EXECUTION_STEP_COUNT_TIME:"Execution step count: {stepCount, number}; Execution time: {time, number}ms"},oA=[{name:"简体中文",locale:Akt},{name:"English",locale:Pkt}],Okt={currentLocale:oA[0].locale},FEe=UQ({name:"locale",initialState:Okt,reducers:{setLocale:(i,e)=>{i.currentLocale=e.payload}}}),{setLocale:Fkt}=FEe.actions,Bkt=FEe.reducer,KK=[{name:"Light",className:"themeLight"}],Wkt={currentClassName:KK[0].className},BEe=UQ({name:"theme",initialState:Wkt,reducers:{setTheme:(i,e)=>{i.currentClassName=e.payload}}}),{setTheme:$kt}=BEe.actions,Hkt=BEe.reducer,WEe=(i,e)=>{const t=URL.createObjectURL(new Blob([e],{type:"data:attachment/plain"})),n=document.createElement("a");n.href=t,n.download=i.endsWith(".ir")?i:`${i}.ir`,n.click(),URL.revokeObjectURL(t)},$Ee=(i,e,t,n)=>{const r=new PEe;n!==void 0&&r.configure(n),r.loadAndDecodeNewInstructions(OEe(t)),__.add(r),i(REe({name:e,irPath:"",isIrChanged:!1,irString:t,state:r.state,globalVariableDetails:r.globalVariableDetails,localVariableDetailsStack:r.localVariableDetailsStack,options:r.currentOptions,stepCount:r.stepCount,memoryUsage:r.memoryUsage,peakMemoryUsage:r.currentPeakMemoryUsage,consoleOutputs:[],consoleInputPrompt:[],consoleInput:"",staticErrors:r.staticErrors,runtimeErrors:r.runtimeErrors,currentLineNumber:r.currentLineNumber,shouldIndicateCurrentLineNumber:!1,localVariableTablesPagination:{size:FQ,currentIndex:1}}))},HEe=(i,e,t)=>{if(!t.name.endsWith(".ir")){aF.error(e.formatMessage({id:"NOT_AN_IR_FILE"},{fileName:t.name}));return}const n=new FileReader;n.readAsText(t),n.onload=r=>{if(r.target===null){aF.error(e.formatMessage({id:"IR_IMPORT_FAILED"},{fileName:t.name})),document.getElementById("inImportIr").value="";return}$Ee(i,t.name,r.target.result)}},qde="demos.json",Vkt=({vmIndex:i})=>{const e=Cc(),t=yS(),n=Gr(h=>{var f;return(f=h.vm.vmPageStates[i])==null?void 0:f.name}),r=Gr(h=>{var f;return(f=h.vm.vmPageStates[i])==null?void 0:f.irString}),o=Gr(h=>kkt(h.vm.vmPageStates.map(f=>f.name))),[s,a]=C.useState(!1),[l,c]=C.useState(!1),[u,d]=C.useState([]);return C.useEffect(()=>{l&&fetch(qde).then(h=>h.ok?h.text():Promise.reject()).catch(()=>{aF.error(e.formatMessage({id:"FETCH_FAILED"},{url:qde}))}).then(h=>{if(!h)return;const f=JSON.parse(h);d(f.map((g,p)=>({key:`g${p}`,icon:Oe(Aft,{}),label:`${g.groupName} (${g.demos.length})`,children:[{key:`g${p}i`,label:Oe(tA,{itemLayout:"horizontal",size:"small",dataSource:g.demos,renderItem:v=>Oe(tA.Item,{onClick:()=>{fetch(v.irUrl).then(m=>m.ok?m.text():Promise.reject()).catch(()=>{aF.error(e.formatMessage({id:"FETCH_FAILED"},{url:v.irUrl}))}).then(m=>{m&&($Ee(t,v.irUrl.split("/").at(-1),m,v.vmOptions),c(!1))})},children:Oe(tA.Item.Meta,{avatar:Oe(M1t,{icon:Oe(ece,{})}),title:v.name,description:v.remark})})})}]})))})},[l]),kn("aside",{className:h1.asideSideBarWrapper,children:[kn("div",{className:h1.divIconWrapperUpper,children:[Oe(c0,{icon:Oe(jht,{}),label:e.formatMessage({id:"ADD"}),onClick:()=>{const h=new PEe;__.add(h),t(REe({name:o,irPath:"",isIrChanged:!1,irString:"",state:h.state,globalVariableDetails:h.globalVariableDetails,localVariableDetailsStack:h.localVariableDetailsStack,options:h.currentOptions,stepCount:h.stepCount,memoryUsage:h.memoryUsage,peakMemoryUsage:h.currentPeakMemoryUsage,consoleOutputs:[],consoleInputPrompt:[],consoleInput:"",staticErrors:h.staticErrors,runtimeErrors:h.runtimeErrors,currentLineNumber:h.currentLineNumber,shouldIndicateCurrentLineNumber:!1,localVariableTablesPagination:{size:FQ,currentIndex:1}}))}}),Oe(c0,{icon:Oe(ece,{}),label:e.formatMessage({id:"DEMOS"}),onClick:()=>c(!0)}),Oe(c0,{icon:Oe(rwe,{}),label:e.formatMessage({id:"IMPORT"}),onClick:()=>{var h;(h=document.getElementById("inImportIr"))==null||h.click()}}),Oe("input",{id:"inImportIr",style:{display:"none"},type:"file",accept:".ir",multiple:!0,onChange:h=>{if(!(h.currentTarget===null||h.currentTarget.files===null||h.currentTarget.files.length===0)){for(const f of h.target.files)HEe(t,e,f);document.getElementById("inImportIr").value=""}}}),Oe(c0,{icon:Oe(kft,{}),label:e.formatMessage({id:"SAVE"}),onClick:()=>{n!==void 0&&(WEe(n,r),t(hkt(!1)))}})]}),kn("div",{className:h1.divIconWrapperLower,children:[Oe(hk,{menu:{items:oA.map((h,f)=>({key:f,label:h.name})),onClick:h=>{t(Fkt(oA[parseInt(h.key)].locale)),document.title=oA[parseInt(h.key)].locale.APP_TITLE}},placement:"topLeft",children:Oe(wK,{children:Oe(c0,{icon:Oe($ft,{}),label:"Lang"})})}),Oe(hk,{menu:{items:KK.map((h,f)=>({key:f,label:h.name})),onClick:h=>{t($kt(KK[parseInt(h.key)].className))}},placement:"topLeft",children:Oe(wK,{children:Oe(c0,{icon:Oe(Qye,{}),label:e.formatMessage({id:"THEME"})})})}),Oe(c0,{icon:Oe(dwe,{}),label:e.formatMessage({id:"ABOUT"}),onClick:()=>a(!0)})]}),Oe(IK,{open:s,title:e.formatMessage({id:"ABOUT"}),centered:!0,closable:!1,onCancel:()=>a(!1),footer:[Oe(Ju,{onClick:()=>a(!1),children:e.formatMessage({id:"OK"})})],children:kn("article",{className:h1.articleAbout,children:[Oe("p",{className:"title",children:"IR虚拟机💎IR Virtual Machine"}),kn("p",{children:[Oe("div",{children:"哈尔滨工业大学 120L021615 崔子健"}),Oe("div",{children:"Ernest Cui, Harbin Institute of Technology"})]}),kn("p",{children:[Oe("div",{children:"April 🌼 2023"}),Oe("div",{children:"V3.0 March 🌸 2024"})]}),kn("p",{children:[Oe("div",{children:"🎉 感谢陈鄞、单丽莉老师的大力支持"}),Oe("div",{children:"㊙️ 虚拟机的说明请见仓库首页的文档"}),Oe("div",{children:"⚙️ 仓库中的CLI版本可用于自动化测试"})]}),kn("p",{className:"info",children:[Oe("a",{href:"https://ernestthepoet.github.io/ir-virtual-machine/",children:"Github Pages镜像"}),"·",Oe("a",{href:"https://ecui.gitee.io/ir-virtual-machine/",children:"Gitee Pages镜像"}),"·",Oe("a",{href:"https://irvm.netlify.app/",children:"Netlify镜像"})]}),kn("p",{className:"info",children:[Oe("a",{href:"https://github.com/ErnestThePoet/ir-virtual-machine",children:"Github仓库"}),"·",Oe("a",{href:"https://gitee.com/ecui/ir-virtual-machine",children:"Gitee仓库"}),"·",Oe("a",{href:"mailto: ecuiships@126.com",children:"ecuiships@126.com"})]})]})}),Oe(IK,{open:l,title:kn("span",{children:[e.formatMessage({id:"DEMOS"}),kn("a",{className:h1.aDemoSources,href:"https://github.com/ErnestThePoet/ir-virtual-machine/tree/master/public/demos",children:["(",e.formatMessage({id:"DEMO_SOURCES"}),")"]})]}),centered:!0,closable:!0,onCancel:()=>c(!1),footer:!0,children:Oe(vQ,{className:h1.menuDemos,mode:"inline",selectable:!1,items:u})})]})},zkt="_navTabBarWrapper_nfao3_1",Ukt={navTabBarWrapper:zkt},jkt="_divTabBarItemWrapperBase_11raq_1",Kkt="_divTabBarItemWrapperActive_11raq_1",Gkt="_divTabBarItemWrapperInactive_11raq_1",qkt="_divIconTitleWrapper_11raq_23",Xkt="_divCloseWrapper_11raq_28",Ykt="_divCloseWrapperChanged_11raq_28",Zkt="_iconVm_11raq_53",Qkt="_iconClose_11raq_60",Jkt="_lblTitle_11raq_65",eTt="_iconDot_11raq_71",tTt="_inVmRename_11raq_78",jh={divTabBarItemWrapperBase:jkt,divTabBarItemWrapperActive:Kkt,divTabBarItemWrapperInactive:Gkt,divIconTitleWrapper:qkt,divCloseWrapper:Xkt,divCloseWrapperChanged:Ykt,iconVm:Zkt,iconClose:Qkt,lblTitle:Jkt,iconDot:eTt,inVmRename:tTt},nTt=i=>kn("svg",{...i,version:"1.1",id:"layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 50 50",enableBackground:"new 0 0 50 50",children:[kn("g",{children:[Oe("path",{d:"M14.16,36.09L7.2,13.91h2.06l6.27,20.5h0.19l6.27-20.5h2.06l-6.95,22.19H14.16z"}),Oe("path",{d:`M27.25,36.09V13.91h1.94v22.19H27.25z M33.31,26.2l-3.89-10.06h-0.55v-2.23h1.55l3.89,10.17h0.08l0.23,2.13H33.31z\r +}`;var ui=Yee(function(){return ir(ee,dn+"return "+Ct).apply(t,ge)});if(ui.source=Ct,i8(ui))throw ui;return ui}function HRe(b){return ur(b).toLowerCase()}function VRe(b){return ur(b).toUpperCase()}function zRe(b,x,I){if(b=ur(b),b&&(I||x===t))return oJ(b);if(!b||!(x=Ic(x)))return b;var P=pd(b),V=pd(x),ee=sJ(P,V),ge=aJ(P,V)+1;return nm(P,ee,ge).join("")}function URe(b,x,I){if(b=ur(b),b&&(I||x===t))return b.slice(0,cJ(b)+1);if(!b||!(x=Ic(x)))return b;var P=pd(b),V=aJ(P,pd(x))+1;return nm(P,0,V).join("")}function jRe(b,x,I){if(b=ur(b),b&&(I||x===t))return b.replace(lr,"");if(!b||!(x=Ic(x)))return b;var P=pd(b),V=sJ(P,pd(x));return nm(P,V).join("")}function KRe(b,x){var I=M,P=A;if(yo(x)){var V="separator"in x?x.separator:V;I="length"in x?ai(x.length):I,P="omission"in x?Ic(x.omission):P}b=ur(b);var ee=b.length;if(RC(b)){var ge=pd(b);ee=ge.length}if(I>=ee)return b;var Ce=I-MC(P);if(Ce<1)return P;var Ie=ge?nm(ge,0,Ce).join(""):b.slice(0,Ce);if(V===t)return Ie+P;if(ge&&(Ce+=Ie.length-Ce),r8(V)){if(b.slice(Ce).search(V)){var pt,mt=Ie;for(V.global||(V=CB(V.source,ur($t.exec(V))+"g")),V.lastIndex=0;pt=V.exec(mt);)var Ct=pt.index;Ie=Ie.slice(0,Ct===t?Ce:Ct)}}else if(b.indexOf(Ic(V),Ce)!=Ce){var jt=Ie.lastIndexOf(V);jt>-1&&(Ie=Ie.slice(0,jt))}return Ie+P}function GRe(b){return b=ur(b),b&&nn.test(b)?b.replace(Bt,wDe):b}var qRe=$C(function(b,x,I){return b+(I?" ":"")+x.toUpperCase()}),a8=ZJ("toUpperCase");function Xee(b,x,I){return b=ur(b),x=I?t:x,x===t?vDe(b)?LDe(b):lDe(b):b.match(x)||[]}var Yee=fi(function(b,x){try{return Ec(b,t,x)}catch(I){return i8(I)?I:new ti(I)}}),XRe=ug(function(b,x){return yu(x,function(I){I=Fh(I),lg(b,I,t8(b[I],b))}),b});function YRe(b){var x=b==null?0:b.length,I=An();return b=x?uo(b,function(P){if(typeof P[1]!="function")throw new wu(s);return[I(P[0]),P[1]]}):[],fi(function(P){for(var V=-1;++VU)return[];var I=Y,P=Wa(b,Y);x=An(x),b-=Y;for(var V=vB(P,x);++I0||x<0)?new yi(I):(b<0?I=I.takeRight(-b):b&&(I=I.drop(b)),x!==t&&(x=ai(x),I=x<0?I.dropRight(-x):I.take(x-b)),I)},yi.prototype.takeRightWhile=function(b){return this.reverse().takeWhile(b).reverse()},yi.prototype.toArray=function(){return this.take(Y)},Ph(yi.prototype,function(b,x){var I=/^(?:filter|find|map|reject)|While$/.test(x),P=/^(?:head|last)$/.test(x),V=Z[P?"take"+(x=="last"?"Right":""):x],ee=P||/^find/.test(x);V&&(Z.prototype[x]=function(){var ge=this.__wrapped__,Ce=P?[1]:arguments,Ie=ge instanceof yi,pt=Ce[0],mt=Ie||ii(ge),Ct=function(vi){var ki=V.apply(Z,Yp([vi],Ce));return P&&jt?ki[0]:ki};mt&&I&&typeof pt=="function"&&pt.length!=1&&(Ie=mt=!1);var jt=this.__chain__,dn=!!this.__actions__.length,On=ee&&!jt,ui=Ie&&!dn;if(!ee&&mt){ge=ui?ge:new yi(this);var Fn=b.apply(ge,Ce);return Fn.__actions__.push({func:yN,args:[Ct],thisArg:t}),new Su(Fn,jt)}return On&&ui?b.apply(this,Ce):(Fn=this.thru(Ct),On?P?Fn.value()[0]:Fn.value():Fn)})}),yu(["pop","push","shift","sort","splice","unshift"],function(b){var x=GT[b],I=/^(?:push|sort|unshift)$/.test(b)?"tap":"thru",P=/^(?:pop|shift)$/.test(b);Z.prototype[b]=function(){var V=arguments;if(P&&!this.__chain__){var ee=this.value();return x.apply(ii(ee)?ee:[],V)}return this[I](function(ge){return x.apply(ii(ge)?ge:[],V)})}}),Ph(yi.prototype,function(b,x){var I=Z[x];if(I){var P=I.name+"";mr.call(FC,P)||(FC[P]=[]),FC[P].push({name:x,func:I})}}),FC[gN(t,m).name]=[{name:"wrapper",func:t}],yi.prototype.clone=GDe,yi.prototype.reverse=qDe,yi.prototype.value=XDe,Z.prototype.at=xTe,Z.prototype.chain=LTe,Z.prototype.commit=ETe,Z.prototype.next=DTe,Z.prototype.plant=kTe,Z.prototype.reverse=TTe,Z.prototype.toJSON=Z.prototype.valueOf=Z.prototype.value=NTe,Z.prototype.first=Z.prototype.head,ox&&(Z.prototype[ox]=ITe),Z},AC=EDe();H_?((H_.exports=AC)._=AC,cB._=AC):na._=AC}).call(bx)})(Ekt,sa);var Gi=(i=>(i[i.INITIAL=0]="INITIAL",i[i.BUSY=1]="BUSY",i[i.WAIT_INPUT=2]="WAIT_INPUT",i[i.FREE=3]="FREE",i[i.STATIC_CHECK_FAILED=4]="STATIC_CHECK_FAILED",i[i.RUNTIME_ERROR=5]="RUNTIME_ERROR",i[i.MAX_STEP_REACHED=6]="MAX_STEP_REACHED",i[i.EXITED_NORMALLY=7]="EXITED_NORMALLY",i[i.EXITED_ABNORMALLY=8]="EXITED_ABNORMALLY",i[i.CLOSED=9]="CLOSED",i))(Gi||{});const Dkt={instructions:[],text:[],memory:new Uint8Array},Ude={total:0,stack:0,globalVariable:0},jde={mainFunctionAddressBefore:-1,globalVariableTable:{},variableTableStack:[],assignCallLValueStack:[]},Kde={stepCount:0,timeElapsed:0,state:0,callStack:[],staticErrors:[],runtimeErrors:[]};var Ql=(i=>(i[i.SUCCESS=0]="SUCCESS",i[i.ERROR=1]="ERROR",i[i.WARNING=2]="WARNING",i[i.INPUT=3]="INPUT",i[i.OUTPUT=4]="OUTPUT",i[i.PROMPT=5]="PROMPT",i[i.ARROW=6]="ARROW",i))(Ql||{});const zd={maxExecutionStepCount:{min:0,max:999999999},memorySize:{min:1*_b,max:32*yp},stackSize:{min:512,max:32*yp-512}},Gde={maxExecutionStepCount:5e6,memorySize:2*yp,stackSize:1*yp};class PEe{constructor(){Ss(this,"initialRegisters",{eax:0,ebx:0,ecx:0,edx:0,ebp:0,esp:Gde.memorySize,eip:0});Ss(this,"decoder",new Lkt);Ss(this,"memory",sa.cloneDeep(Dkt));Ss(this,"registers",sa.cloneDeep(this.initialRegisters));Ss(this,"tables",sa.cloneDeep(jde));Ss(this,"executionStatus",sa.cloneDeep(Kde));Ss(this,"peakMemoryUsage",sa.cloneDeep(Ude));Ss(this,"options",sa.cloneDeep(Gde));Ss(this,"executionStartTime",new Date);Ss(this,"writeBuffer",[]);Ss(this,"readConsole",()=>Promise.resolve(""));Ss(this,"entryFunctionName","main")}setReadConsoleFn(e){this.readConsole=e}getSingleVariableValues(e){const t=[];for(let n=e.address;n=this.memory.text.length?-1:this.memory.text[this.registers.eip].lineNumber}get instructions(){return this.memory.instructions}get globalVariableDetails(){return this.getSingleTableVariableDetails(this.tables.globalVariableTable)}get localVariableDetailsStack(){const e=[];for(let t=0;t(n=Math.max(n,r.min),n=Math.min(n,r.max),n);e.maxExecutionStepCount!==void 0&&(e.maxExecutionStepCount=t(e.maxExecutionStepCount,zd.maxExecutionStepCount),this.options.maxExecutionStepCount=e.maxExecutionStepCount),e.memorySize!==void 0&&(e.memorySize=t(e.memorySize,zd.memorySize),e.memorySize=t(e.memorySize,{min:this.options.stackSize,max:zd.memorySize.max}),this.options.memorySize=e.memorySize,this.initialRegisters.esp=Zl(e.memorySize),this.registers.esp=Zl(e.memorySize),this.updatePeakMemoryUsage()),e.stackSize!==void 0&&(e.stackSize=t(e.stackSize,zd.stackSize),e.stackSize=t(e.stackSize,{min:zd.stackSize.min,max:this.options.memorySize}),this.options.stackSize=e.stackSize)}reset(){this.memory.text=[],this.memory.memory=new Uint8Array,this.registers=sa.cloneDeep(this.initialRegisters),this.tables=sa.cloneDeep(jde),this.executionStatus=sa.cloneDeep(Kde),this.peakMemoryUsage=sa.cloneDeep(Ude),this.writeBuffer=[]}close(){this.executionStatus.state=9}loadNewInstructions(e){this.reset(),this.memory.instructions=e}loadAndDecodeNewInstructions(e){this.loadNewInstructions(e),this.decodeInstructions(!0)}decodeInstructions(e){const t=new Map,n=new Map;for(let r=0;rn;case C0.GE:return t>=n}}async execute(e){do{if((this.executionStatus.state===7||this.executionStatus.state===8||this.executionStatus.state===0)&&(this.reset(),this.prepareExcution()),this.executionStatus.state!==3)return;if(this.executionStatus.state=1,this.options.maxExecutionStepCount>0&&this.executionStatus.stepCount>=this.options.maxExecutionStepCount){this.executionStatus.state=6,this.writeBuffer.push([{key:"MAX_STEP_REACHED",values:{maxExecutionStepCount:this.options.maxExecutionStepCount},type:1}]);return}if(this.registers.eip>=this.memory.text.length||this.registers.eip<0){this.executionStatus.state=5,this.writeBuffer.push([{key:"RUNTIME_ERROR_PREFIX_NO_LN",type:1},{key:"INSTRUCTION_READ_OUT_OF_BOUND",values:{address:this.registers.eip},type:1}]);return}this.executionStatus.stepCount++;const t=this.memory.text[this.registers.eip];switch(t.type){case Mo.ARG:{const n=this.getSingularValue(t.value.value);if(n===null||!this.pushl(n))return;this.registers.ecx=Oc(this.registers.ecx,4);break}case Mo.ASSIGN:{const n=this.getRValue(t.value.rValue);if(n===null)return;const r=this.getLValueAddress(t.value.lValue);if(r===null||!this.storeMemory32(n,r))return;break}case Mo.ASSIGN_CALL:case Mo.CALL:{const n=t.type===Mo.CALL?t.value.id:t.value.functionId;if(this.registers.ebx=this.registers.esp,!this.pushl(this.registers.ecx)||(this.registers.ecx=0,!this.pushl(this.registers.eip))||!this.pushl(this.registers.ebp))return;this.registers.ebp=this.registers.esp,t.type===Mo.ASSIGN_CALL?this.tables.assignCallLValueStack.push(t.value.lValue):this.tables.assignCallLValueStack.push(null),this.tables.variableTableStack.push({}),this.executionStatus.callStack.push(n),this.registers.eip=t.value.functionAddressBefore;break}case Mo.DEC:{if(this.createStackVariable(t.value.id,t.value.size)===null)return;break}case Mo.GOTO:{this.registers.eip=t.value.gotoAddressBefore;break}case Mo.IF:{const n=this.getCondValue(t.value.condition);if(n===null)return;n&&(this.registers.eip=t.value.gotoAddressBefore);break}case Mo.PARAM:{const n=t.value.id;if(n in this.tables.variableTableStack[this.tables.variableTableStack.length-1]){this.writeRuntimeError({key:"DUPLICATE_PARAM_ID",values:{id:n,lastLineNumber:this.tables.variableTableStack[this.tables.variableTableStack.length-1][n].lineNumber}});return}if(this.loadMemory32(this.registers.ebx)===null)return;this.tables.variableTableStack[this.tables.variableTableStack.length-1][n]={address:this.registers.ebx,size:4,lineNumber:t.lineNumber},this.registers.ebx=Oc(this.registers.ebx,4);break}case Mo.RETURN:{const n=this.getSingularValue(t.value.value);if(n===null)return;this.registers.eax=n,this.registers.esp=this.registers.ebp,this.updatePeakMemoryUsage();const r=this.popl();if(r===null)return;this.registers.ebp=r;const o=this.popl();if(o===null)return;this.registers.eip=o;const s=this.popl();if(s===null)return;if(this.registers.esp=Oc(this.registers.esp,s),this.updatePeakMemoryUsage(),this.registers.ecx=0,this.tables.variableTableStack.length===0){this.writeRuntimeError({key:"EMPTY_VARIABLE_TABLE_STACK"});return}if(this.executionStatus.callStack.pop(),this.tables.variableTableStack.pop(),this.registers.eip===this.memory.text.length){this.finalizeExcution();return}const a=this.tables.assignCallLValueStack.pop();if(a!==null){const l=this.getLValueAddress(a);if(l===null||!this.storeMemory32(this.registers.eax,l))return}break}case Mo.READ:{const n=t.value,r=this.getLValueAddress(n.lValue);if(r===null)return;const o=n.lValue.type===YL.ID?n.lValue.id:"*"+n.lValue.id;this.executionStatus.state=2;const s=await this.readConsole([{key:"READ_PROMPT",values:{name:o}}]);if(this.state!==2)return;this.executionStatus.state=1;const a=parseInt(s);if(isNaN(a)){this.writeRuntimeError({key:"INPUT_INT_ILLEGAL"});return}if(!Number.isSafeInteger(a)){this.writeRuntimeError({key:"INPUT_INT_ABS_TOO_LARGE"});return}if(!this.storeMemory32(Zl(a),r))return;break}case Mo.WRITE:{const n=this.getSingularValue(t.value.value);if(n===null)return;this.writeBuffer.push([{key:"WRITE_OUTPUT",values:{value:n},type:4}]);break}}for(this.registers.eip=Oc(this.registers.eip,1);this.registers.eip=0&&this.memory.text[this.registers.eip].type===Mo.GLOBAL_DEC;)this.registers.eip=Oc(this.registers.eip,1);this.executionStatus.state=3}while(e)}async executeSingleStep(){await this.execute(!1)}async executeContinuously(){await this.execute(!0)}}function Ikt(i,e=18){let t=0,n=0;for(let r=0;re){t=r;break}return n<=e?i:i.substring(0,t)+"..."}function kkt(i){for(let e=1;;e++){const t=`Untitled-${e}`;if(i.every(n=>n!==t))return t}}function OEe(i){return i.split(/\r\n|[\r\n]/)}function Tkt(i){return i.trim().split(/\s/).filter(e=>e.length>0)}function Nkt(i){return i<_b?{size:i,unit:"B"}:i",READ_INPUT:"{value}",PROGRAM_EXITED:"程序执行结束,返回值为{returnValue}。",EXECUTION_STEP_COUNT_TIME:"总执行步数:{stepCount, number};总执行耗时:{time, number}ms"},Pkt={APP_TITLE:"IR Virtual Machine",ADD:"New",IMPORT:"Import",DEMOS:"Demos",DEMO_SOURCES:"Sources",SAVE:"Save",THEME:"Theme",ABOUT:"About",CLOSE:"Close",CONFIRM_UNSAVED_CLOSE:"Save changes to {name} before close?",SAVE_CLOSE:"Save&Close",UNSAVE_CLOSE:"Close",OK:"OK",CANCEL:"Cancel",EMPTY_PLACEHOLDER_DESC:"An IR virtual machine for HIT/NJU Compilation Principle labs",EMPTY_PLACEHOLDER_HINT_TITLE:"You may:",EMPTY_PLACEHOLDER_HINT_1:"Add or import .ir files in left sidebar",EMPTY_PLACEHOLDER_HINT_2:"Drag one or more .ir files inside",EMPTY_PLACEHOLDER_HINT_3:"Try out Demos in left sidebar",FETCH_FAILED:"fetch() for {url} failed",NOT_AN_IR_FILE:"{fileName} is not an ir file",IR_IMPORT_FAILED:"Failed to import {fileName}",RUN:"Run",RUN_STEP:"Step",RESET:"Reset",CLEAR_CONSOLE:"Clear",STEP_COUNT:"Step Count: ",STEP_COUNT_NUMBER:"{stepCount, number}",STATE:"VM State: ",STATE_INITIAL:"Initial",STATE_BUSY:"Busy",STATE_WAIT_INPUT:"Awaiting Input",STATE_FREE:"Free",STATE_STATIC_CHECK_FAILED:"IR Static Check Error",STATE_RUNTIME_ERROR:"Runtime Error",STATE_MAX_STEP_REACHED:"Max Step Count Reached",STATE_EXITED_NORMALLY:"Exited Normally (Return value 0)",STATE_EXITED_ABNORMALLY:"Exited Abnormally (Return value not 0)",MAX_EXECUTION_STEP_COUNT:"Max Steps",SET_0_MEANS_NO_STEP_LIMIT:"No step limit if set to 0",MEMORY_SIZE:"Memory Size/B",STACK_SIZE:"Stack Size/B",TOTAL_MEMORY_USAGE:"Total Memory Usage: ",STACK_MEMORY_USAGE:"Stack Memory Usage: ",GLOBAL_VARIABLE_MEMORY_USAGE:"GlobalVar Memory Usage: ",PEAK_MEMORY_USAGE:"Peak Usage: ",PERCENTAGE_USAGE:"{percentage, number, ::.0}%",BYTE_USAGE:"{used}B/{total}B",ARBITRARY_UNIT_MEMORY_USAGE:"{used, number, ::.0}{unit}/{total, number, ::.0}{unit}",BYTE_SIZE:"{size}B",ARBITRARY_UNIT_SIZE:"{size, number, ::.0}{unit}",GLOBAL_VARIABLE_TABLE:"Global Variable Table",LOCAL_VARIABLE_TABLE:"Local Variable Table",VARIABLE_ID:"ID",ADDRESS:"Address",SIZE:"Size",VALUES:"Value",EMPTY_VATIABLE_TABLE:"(Empty)",CALL_STACK_DEPTH:"Call stack depth {depth}",STATIC_ERROR_PREFIX:"Static Check Error (Line {lineNumber}): ",STATIC_ERROR_PREFIX_NO_LINE_NUMBER:"Static Check Error: ",DECODE_ERROR_PREFIX:"IR Decoding Error (Line {lineNumber}): ",UNRECOGNIZED_INSTRUCTION:"Unrecognized IR instruction",ILLEGAL_INSTRUCTION_FORMAT:"Illegal IR format",FUNCTION_ILLEGAL_ID:"FUNCTION id illegal",ASSIGN_ILLEGAL_LEFT:"Illegal left hand side of assignment",ASSIGN_ILLEGAL_RIGHT:"Illegal right hand side of assignment",ASSIGN_RIGHT_IMM_TOO_LARGE:"Right hand side immediate number of assignment too large",ASSIGN_ILLEGAL_RIGHT_OPERATOR:"Illegal math operator on RHS of assignment",ASSIGN_ILLEGAL_RIGHT_OPERAND1:"Illegal first Singular operand on RHS of assignment",ASSIGN_RIGHT_OPERAND1_IMM_TOO_LARGE:"First immediate number operand on RHS of assignment too large",ASSIGN_ILLEGAL_RIGHT_OPERAND2:"Illegal second Singular operand on RHS of assignment",ASSIGN_RIGHT_OPERAND2_IMM_TOO_LARGE:"Second immediate number operand on RHS of assignment too large",DEC_ILLEGAL_ID:"DEC's id illegal",DEC_ILLEGAL_SIZE_FORMAT:"DEC's size format illegal",DEC_SIZE_TOO_LARGE:"DEC's size too large",DEC_SIZE_NOT_4_MULTIPLE:"DEC's size not a multiple of 4",GLOBAL_DEC_ILLEGAL_ID:"GLOBAL_DEC's id illegal",GLOBAL_DEC_ILLEGAL_SIZE_FORMAT:"GLOBAL_DEC's size format illegal",GLOBAL_DEC_SIZE_TOO_LARGE:"GLOBAL_DEC's size too large",GLOBAL_DEC_SIZE_NOT_4_MULTIPLE:"GLOBAL_DEC's size not a multiple of 4",LABEL_ILLEGAL_ID:"LABEL's id illegal",GOTO_ILLEGAL_ID:"GOTO's id illegal",DUPLICATE_LABEL_ID:"LABEL's label id ''{id}'' already declared (last declared at line {lastLineNumber})",DUPLICATE_FUNCTION_ID:"FUNCTION's function id ''{id}'' already declared (last declared at line {lastLineNumber})",FUNCTION_NOT_FOUND:"Can't find function ''{id}''",LABEL_NOT_FOUND:"Can't find label ''{id}''",IF_ILLEGAL_COND_OPERATOR:"IF's relop illegal",IF_ILLEGAL_COND_OPERAND1:"IF's first Singular operand in condition illegal",IF_COND_OPERAND1_IMM_TOO_LARGE:"IF's first immediate number operand in condition too large",IF_ILLEGAL_COND_OPERAND2:"IF's second Singular operand in condition illegal",IF_COND_OPERAND2_IMM_TOO_LARGE:"IF's second immediate number operand in condition too large",IF_ILLEGAL_GOTO_ID:"IF's GOTO id illegal",ARG_ILLEGAL:"ARG's Singular arg illegal",ARG_IMM_TOO_LARGE:"ARG's immediate number arg too large",CALL_ILLEGAL_ID:"CALL's function id illegal",PARAM_ILLEGAL_ID:"PARAM's param id illegal",RETURN_ILLEGAL:"RETURN's Singular return value illegal",RETURN_IMM_TOO_LARGE:"RETURN's immediate number return value too large",READ_ILLEGAL:"Illegal LValue for READ",WRITE_ILLEGAL:"Illegal Singular for WRITE",WRITE_IMM_TOO_LARGE:"Immediate number for WRITE too large",NO_MAIN_FUNCTION:"Function 'main' is not defined",RUNTIME_ERROR_PREFIX:"Runtime Error (Line {lineNumber}): ",RUNTIME_ERROR_PREFIX_NO_LN:"Runtime Error: ",GLOBAL_VARIABLE_SEGMENT_OVERFLOW:"Global variable segment overflow",STACK_OVERFLOW:"Stack overflow",VARIABLE_NOT_FOUND:"Can't find variable ''{id}''",INSTRUCTION_READ_OUT_OF_BOUND:"Reading instruction from {address} is out of bound",MEMORY_READ_OUT_OF_BOUND:"Reading 4 bytes from {address} is out of bound",MEMORY_WRITE_OUT_OF_BOUND:"Writing 4 bytes to {address} is out of bound",EMPTY_VARIABLE_TABLE_STACK:"Empty local variable stack",DUPLICATE_DEC_ID:"DEC's variable id ''{id}'' already declared (last declared at line {lastLineNumber})",DUPLICATE_GLOBAL_DEC_ID:"GLOBAL_DEC's global variable id ''{id}'' already declared (last declared at line {lastLineNumber})",DUPLICATE_PARAM_ID:"PARAM's param id ''{id}'' already declared (last declared at line {lastLineNumber})",DIVIDE_BY_ZERO:"Cannot divide by 0",MAX_STEP_REACHED:"Maximum execution step count reached ({maxExecutionStepCount, number})",INPUT_INT_ILLEGAL:"Illegal input integer",INPUT_INT_ABS_TOO_LARGE:"Absolute value of input integer too large",WRITE_OUTPUT:"{value}",READ_PROMPT:"Please enter a value for {name}:",CONSOLE_ARROW:">",READ_INPUT:"{value}",PROGRAM_EXITED:"Program exited with return value {returnValue}.",EXECUTION_STEP_COUNT_TIME:"Execution step count: {stepCount, number}; Execution time: {time, number}ms"},oA=[{name:"简体中文",locale:Akt},{name:"English",locale:Pkt}],Okt={currentLocale:oA[0].locale},FEe=UQ({name:"locale",initialState:Okt,reducers:{setLocale:(i,e)=>{i.currentLocale=e.payload}}}),{setLocale:Fkt}=FEe.actions,Bkt=FEe.reducer,KK=[{name:"Light",className:"themeLight"}],Wkt={currentClassName:KK[0].className},BEe=UQ({name:"theme",initialState:Wkt,reducers:{setTheme:(i,e)=>{i.currentClassName=e.payload}}}),{setTheme:$kt}=BEe.actions,Hkt=BEe.reducer,WEe=(i,e)=>{const t=URL.createObjectURL(new Blob([e],{type:"data:attachment/plain"})),n=document.createElement("a");n.href=t,n.download=i.endsWith(".ir")?i:`${i}.ir`,n.click(),URL.revokeObjectURL(t)},$Ee=(i,e,t,n)=>{const r=new PEe;n!==void 0&&r.configure(n),r.loadAndDecodeNewInstructions(OEe(t)),v_.add(r),i(REe({name:e,irPath:"",isIrChanged:!1,irString:t,state:r.state,globalVariableDetails:r.globalVariableDetails,localVariableDetailsStack:r.localVariableDetailsStack,options:r.currentOptions,stepCount:r.stepCount,memoryUsage:r.memoryUsage,peakMemoryUsage:r.currentPeakMemoryUsage,consoleOutputs:[],consoleInputPrompt:[],consoleInput:"",staticErrors:r.staticErrors,runtimeErrors:r.runtimeErrors,currentLineNumber:r.currentLineNumber,shouldIndicateCurrentLineNumber:!1,localVariableTablesPagination:{size:FQ,currentIndex:1}}))},HEe=(i,e,t)=>{if(!t.name.endsWith(".ir")){aF.error(e.formatMessage({id:"NOT_AN_IR_FILE"},{fileName:t.name}));return}const n=new FileReader;n.readAsText(t),n.onload=r=>{if(r.target===null){aF.error(e.formatMessage({id:"IR_IMPORT_FAILED"},{fileName:t.name})),document.getElementById("inImportIr").value="";return}$Ee(i,t.name,r.target.result)}},qde="demos.json",Vkt=({vmIndex:i})=>{const e=Cc(),t=yS(),n=Gr(h=>{var f;return(f=h.vm.vmPageStates[i])==null?void 0:f.name}),r=Gr(h=>{var f;return(f=h.vm.vmPageStates[i])==null?void 0:f.irString}),o=Gr(h=>kkt(h.vm.vmPageStates.map(f=>f.name))),[s,a]=C.useState(!1),[l,c]=C.useState(!1),[u,d]=C.useState([]);return C.useEffect(()=>{l&&fetch(qde).then(h=>h.ok?h.text():Promise.reject()).catch(()=>{aF.error(e.formatMessage({id:"FETCH_FAILED"},{url:qde}))}).then(h=>{if(!h)return;const f=JSON.parse(h);d(f.map((g,p)=>({key:`g${p}`,icon:Oe(Aft,{}),label:`${g.groupName} (${g.demos.length})`,children:[{key:`g${p}i`,label:Oe(tA,{itemLayout:"horizontal",size:"small",dataSource:g.demos,renderItem:v=>Oe(tA.Item,{onClick:()=>{fetch(v.irUrl).then(m=>m.ok?m.text():Promise.reject()).catch(()=>{aF.error(e.formatMessage({id:"FETCH_FAILED"},{url:v.irUrl}))}).then(m=>{m&&($Ee(t,v.irUrl.split("/").at(-1),m,v.vmOptions),c(!1))})},children:Oe(tA.Item.Meta,{avatar:Oe(M1t,{icon:Oe(ece,{})}),title:v.name,description:v.remark})})})}]})))})},[l]),kn("aside",{className:h1.asideSideBarWrapper,children:[kn("div",{className:h1.divIconWrapperUpper,children:[Oe(l0,{icon:Oe(jht,{}),label:e.formatMessage({id:"ADD"}),onClick:()=>{const h=new PEe;v_.add(h),t(REe({name:o,irPath:"",isIrChanged:!1,irString:"",state:h.state,globalVariableDetails:h.globalVariableDetails,localVariableDetailsStack:h.localVariableDetailsStack,options:h.currentOptions,stepCount:h.stepCount,memoryUsage:h.memoryUsage,peakMemoryUsage:h.currentPeakMemoryUsage,consoleOutputs:[],consoleInputPrompt:[],consoleInput:"",staticErrors:h.staticErrors,runtimeErrors:h.runtimeErrors,currentLineNumber:h.currentLineNumber,shouldIndicateCurrentLineNumber:!1,localVariableTablesPagination:{size:FQ,currentIndex:1}}))}}),Oe(l0,{icon:Oe(ece,{}),label:e.formatMessage({id:"DEMOS"}),onClick:()=>c(!0)}),Oe(l0,{icon:Oe(rwe,{}),label:e.formatMessage({id:"IMPORT"}),onClick:()=>{var h;(h=document.getElementById("inImportIr"))==null||h.click()}}),Oe("input",{id:"inImportIr",style:{display:"none"},type:"file",accept:".ir",multiple:!0,onChange:h=>{if(!(h.currentTarget===null||h.currentTarget.files===null||h.currentTarget.files.length===0)){for(const f of h.target.files)HEe(t,e,f);document.getElementById("inImportIr").value=""}}}),Oe(l0,{icon:Oe(kft,{}),label:e.formatMessage({id:"SAVE"}),onClick:()=>{n!==void 0&&(WEe(n,r),t(hkt(!1)))}})]}),kn("div",{className:h1.divIconWrapperLower,children:[Oe(hk,{menu:{items:oA.map((h,f)=>({key:f,label:h.name})),onClick:h=>{t(Fkt(oA[parseInt(h.key)].locale)),document.title=oA[parseInt(h.key)].locale.APP_TITLE}},placement:"topLeft",children:Oe(wK,{children:Oe(l0,{icon:Oe($ft,{}),label:"Lang"})})}),Oe(hk,{menu:{items:KK.map((h,f)=>({key:f,label:h.name})),onClick:h=>{t($kt(KK[parseInt(h.key)].className))}},placement:"topLeft",children:Oe(wK,{children:Oe(l0,{icon:Oe(Qye,{}),label:e.formatMessage({id:"THEME"})})})}),Oe(l0,{icon:Oe(dwe,{}),label:e.formatMessage({id:"ABOUT"}),onClick:()=>a(!0)})]}),Oe(IK,{open:s,title:e.formatMessage({id:"ABOUT"}),centered:!0,closable:!1,onCancel:()=>a(!1),footer:[Oe(Ju,{onClick:()=>a(!1),children:e.formatMessage({id:"OK"})})],children:kn("article",{className:h1.articleAbout,children:[Oe("p",{className:"title",children:"IR虚拟机💎IR Virtual Machine"}),kn("p",{children:[Oe("div",{children:"哈尔滨工业大学 120L021615 崔子健"}),Oe("div",{children:"Ernest Cui, Harbin Institute of Technology"})]}),kn("p",{children:[Oe("div",{children:"April 🌼 2023"}),Oe("div",{children:"V3.0 March 🌸 2024"})]}),kn("p",{children:[Oe("div",{children:"🎉 感谢陈鄞、单丽莉老师的大力支持"}),Oe("div",{children:"㊙️ 虚拟机的说明请见仓库首页的文档"}),Oe("div",{children:"⚙️ 仓库中的CLI版本可用于自动化测试"})]}),kn("p",{className:"info",children:[Oe("a",{href:"https://ernestthepoet.github.io/ir-virtual-machine/",children:"Github Pages镜像"}),"·",Oe("a",{href:"https://ecui.gitee.io/ir-virtual-machine/",children:"Gitee Pages镜像"}),"·",Oe("a",{href:"https://irvm.netlify.app/",children:"Netlify镜像"})]}),kn("p",{className:"info",children:[Oe("a",{href:"https://github.com/ErnestThePoet/ir-virtual-machine",children:"Github仓库"}),"·",Oe("a",{href:"https://gitee.com/ecui/ir-virtual-machine",children:"Gitee仓库"}),"·",Oe("a",{href:"mailto: ecuiships@126.com",children:"ecuiships@126.com"})]})]})}),Oe(IK,{open:l,title:kn("span",{children:[e.formatMessage({id:"DEMOS"}),kn("a",{className:h1.aDemoSources,href:"https://github.com/ErnestThePoet/ir-virtual-machine/tree/master/public/demos",children:["(",e.formatMessage({id:"DEMO_SOURCES"}),")"]})]}),centered:!0,closable:!0,onCancel:()=>c(!1),footer:!0,children:Oe(vQ,{className:h1.menuDemos,mode:"inline",selectable:!1,items:u})})]})},zkt="_navTabBarWrapper_nfao3_1",Ukt={navTabBarWrapper:zkt},jkt="_divTabBarItemWrapperBase_11raq_1",Kkt="_divTabBarItemWrapperActive_11raq_1",Gkt="_divTabBarItemWrapperInactive_11raq_1",qkt="_divIconTitleWrapper_11raq_23",Xkt="_divCloseWrapper_11raq_28",Ykt="_divCloseWrapperChanged_11raq_28",Zkt="_iconVm_11raq_53",Qkt="_iconClose_11raq_60",Jkt="_lblTitle_11raq_65",eTt="_iconDot_11raq_71",tTt="_inVmRename_11raq_78",jh={divTabBarItemWrapperBase:jkt,divTabBarItemWrapperActive:Kkt,divTabBarItemWrapperInactive:Gkt,divIconTitleWrapper:qkt,divCloseWrapper:Xkt,divCloseWrapperChanged:Ykt,iconVm:Zkt,iconClose:Qkt,lblTitle:Jkt,iconDot:eTt,inVmRename:tTt},nTt=i=>kn("svg",{...i,version:"1.1",id:"layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 50 50",enableBackground:"new 0 0 50 50",children:[kn("g",{children:[Oe("path",{d:"M14.16,36.09L7.2,13.91h2.06l6.27,20.5h0.19l6.27-20.5h2.06l-6.95,22.19H14.16z"}),Oe("path",{d:`M27.25,36.09V13.91h1.94v22.19H27.25z M33.31,26.2l-3.89-10.06h-0.55v-2.23h1.55l3.89,10.17h0.08l0.23,2.13H33.31z\r M34.06,26.2l0.3-2.13h0.08l3.89-10.17h1.73v2.23h-0.73L35.44,26.2H34.06z M39.56,36.09V13.91h1.94v22.19H39.56z`})]}),Oe("g",{children:Oe("path",{fill:"none",strokeWidth:"2",strokeMiterlimit:"10",d:`M1.5,36.5c0,3.87,3.13,7,7,7h33c3.87,0,7-3.13,7-7\r - v-22c0-3.87-3.13-7-7-7h-33c-3.87,0-7,3.13-7,7V36.5z`})}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{})]}),iTt=i=>kn("svg",{...i,version:"1.1",id:"layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 50 50",enableBackground:"new 0 0 50 50",children:[Oe("circle",{cx:"25",cy:"25",r:"25"}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{})]}),rTt=i=>{const e=Cc(),[t,n]=C.useState(!1),[r,o]=C.useState(i.title);return C.useEffect(()=>{if(t){const s=document.getElementById("inVmRename");s!==null&&(s.focus(),s.select())}},[t]),kn("div",{className:xe({[jh.divTabBarItemWrapperActive]:i.isActive,[jh.divTabBarItemWrapperInactive]:!i.isActive}),onClick:s=>{s.stopPropagation(),i.onClick()},title:i.title,onDoubleClick:()=>{o(i.title),n(!0)},children:[kn("div",{className:jh.divIconTitleWrapper,children:[Oe(nTt,{className:jh.iconVm}),t?Oe("input",{id:"inVmRename",className:jh.inVmRename,value:r,onChange:s=>o(s.currentTarget.value),onKeyDown:s=>{s.key==="Enter"&&(i.onRename(r),n(!1))},onBlur:()=>{i.onRename(r),n(!1)}}):Oe("label",{className:jh.lblTitle,children:Ikt(i.title)})]}),kn("div",{className:xe({[jh.divCloseWrapperChanged]:i.isChanged,[jh.divCloseWrapper]:!i.isChanged}),title:e.formatMessage({id:"CLOSE"}),onClick:s=>{s.stopPropagation(),i.onCloseClick()},children:[i.isChanged&&Oe(iTt,{className:jh.iconDot}),Oe(CT,{className:jh.iconClose})]})]})},oTt=()=>{var l;const i=Cc(),e=Gr(c=>c.vm),t=yS(),[n,r]=C.useState(!1),[o,s]=C.useState(0),a=c=>{t(dkt(c)),__.at(c).close(),__.delete(c)};return kn("nav",{className:Ukt.navTabBarWrapper,children:[e.vmPageStates.map((c,u)=>Oe(rTt,{title:c.name,isActive:u===e.activeVmIndex,isChanged:c.isIrChanged,onClick:()=>t(ckt(u)),onCloseClick:()=>{if(!c.isIrChanged){a(u);return}s(u),r(!0)},onRename:d=>{d!==""&&t(ukt({index:u,newName:d}))}},c.id)),Oe(IK,{open:n,title:i.formatMessage({id:"CONFIRM_UNSAVED_CLOSE"},{name:(l=e.vmPageStates[o])==null?void 0:l.name}),onCancel:()=>r(!1),footer:[Oe(Ju,{onClick:()=>r(!1),children:i.formatMessage({id:"CANCEL"})}),Oe(Ju,{danger:!0,onClick:()=>{a(o),r(!1)},children:i.formatMessage({id:"UNSAVE_CLOSE"})}),Oe(Ju,{type:"primary",onClick:()=>{WEe(e.vmPageStates[e.activeVmIndex].name,e.vmPageStates[e.activeVmIndex].irString),a(o),r(!1)},children:i.formatMessage({id:"SAVE_CLOSE"})})]})]})},sTt="_divEmptyHolder_3r6f3_11",aTt="_imgLogo_3r6f3_25",lTt="_divEmptyHolderText_3r6f3_30",cTt="_spanDesc_3r6f3_39",uTt="_divEmptyHolderHintsWrapper_3r6f3_45",fL={divEmptyHolder:sTt,"empty-holder-in":"_empty-holder-in_3r6f3_1",imgLogo:aTt,divEmptyHolderText:lTt,spanDesc:cTt,divEmptyHolderHintsWrapper:uTt};function dTt(){const i=navigator.userAgent.toLowerCase();return i.includes("android")||i.includes("harmony")||i.includes("iphone")||i.includes("ipad")||i.includes("mobile")}const hTt=()=>{const i=Cc();return kn("div",{className:fL.divEmptyHolder,children:[Oe("img",{className:fL.imgLogo,src:"logo.svg",alt:"IR Virtual Machine"}),kn("div",{className:fL.divEmptyHolderText,children:[Oe("span",{className:fL.spanDesc,children:i.formatMessage({id:"EMPTY_PLACEHOLDER_DESC"})}),kn("div",{className:fL.divEmptyHolderHintsWrapper,children:[Oe("span",{className:"hint-title",children:i.formatMessage({id:"EMPTY_PLACEHOLDER_HINT_TITLE"})}),Oe("span",{children:i.formatMessage({id:"EMPTY_PLACEHOLDER_HINT_1"})}),!dTt()&&Oe("span",{children:i.formatMessage({id:"EMPTY_PLACEHOLDER_HINT_2"})}),Oe("span",{children:i.formatMessage({id:"EMPTY_PLACEHOLDER_HINT_3"})})]})]})]})};const fTt="_divMonacoEditorWrapper_1a3zn_1",gTt={divMonacoEditorWrapper:fTt};let Xde=!1;const gL="ir";function pTt(i){if(Xde)return;i.languages.register({id:gL}),i.editor.defineTheme("ir-theme",{base:"vs",inherit:!0,rules:[{token:"function",foreground:"#74531f"},{token:"number.size",foreground:"#0097ff"}],colors:{}});const e="[ \\t\\r\\n]+";i.languages.setMonarchTokensProvider(gL,{keywords:rA,identifier:Vd,whitespace:e,defaultToken:"source",tokenizer:{root:[[`#${jK}`,"number"],[AEe,"number.size"],[/(:=)|(\+)|(-)|(\*)|(\/)|(==)|(!=)|(<=)|(<)|(>=)|(>)|(&)/,"operators"],[/:/,"delimiter"],[/;.*/,"comment"],[/@whitespace/,"white"],[/(FUNCTION)(@whitespace)(@identifier)/,["keyword","white","function"]],[/(CALL)(@whitespace)(@identifier)/,["keyword","white","function"]],[/@identifier/,{cases:{"@keywords":"keyword","@default":"identifier"}}]]}});const t=["FUNCTION ${1:id} :","DEC ${1:id} ${2:size}","GLOBAL_DEC ${1:id} ${2:size}","LABEL ${1:id} :","GOTO ${1:label}","IF ${1:condition} GOTO ${2:label}","ARG ${1:value}","PARAM ${1:id}","CALL ${1:id}","RETURN ${1:value}","READ ${1:id}","WRITE ${1:value}"];i.languages.registerCompletionItemProvider(gL,{provideCompletionItems:(n,r)=>{const o=n.getWordUntilPosition(r),s={startLineNumber:r.lineNumber,endLineNumber:r.lineNumber,startColumn:o.startColumn,endColumn:o.endColumn};return{suggestions:[...rA.map(a=>({label:a,kind:i.languages.CompletionItemKind.Keyword,insertText:a,range:s})),...rA.map((a,l)=>({label:`${a} Snippet`,kind:i.languages.CompletionItemKind.Snippet,insertText:t[l],insertTextRules:i.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:s}))]}}}),i.languages.registerFoldingRangeProvider(gL,{provideFoldingRanges:n=>{const r=n.getLinesContent(),o=[];let s=-1,a=-1,l=-1;for(let c=0;c{const e=Cc(),t=Gr(v=>v.vm.vmPageStates[i].staticErrors),n=Gr(v=>v.vm.vmPageStates[i].runtimeErrors),r=Gr(v=>v.vm.vmPageStates[i].currentLineNumber),o=Gr(v=>v.vm.vmPageStates[i].shouldIndicateCurrentLineNumber),s=Gr(v=>v.vm.vmPageStates[i].irString),a=C.useRef(null),l=C.useRef(null),c=C.useRef(null),u=C.useRef(null),d=C.useRef(null),h=yS(),f=__.at(i),g=()=>{a.current!==null&&l.current!==null&&l.current.getModel()!==null&&a.current.editor.setModelMarkers(l.current.getModel(),"IR Decoder",t.map(v=>({startLineNumber:v.startLineNumber,endLineNumber:v.endLineNumber,startColumn:v.startColumn,endColumn:v.endColumn+1,message:e.formatMessage({id:v.message.key},v.message.values),severity:a.current.MarkerSeverity.Error})))};C.useEffect(g,[t,e.messages]),C.useEffect(()=>{c.current!==null&&c.current.clear(),a.current!==null&&l.current!==null&&l.current.getModel()!==null&&(n.length>0&&l.current.revealLineInCenterIfOutsideViewport(r),c.current=l.current.createDecorationsCollection(n.map(v=>({range:new a.current.Range(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn),options:{isWholeLine:!0,className:"rangeError",marginClassName:"rangeError",hoverMessage:{value:e.formatMessage({id:v.message.key},v.message.values)}}}))))},[n,e.messages]),C.useEffect(()=>{u.current!==null&&u.current.clear(),!(!o||f.instructions[r-1]===void 0)&&a.current!==null&&l.current!==null&&(l.current.revealLineInCenterIfOutsideViewport(r),u.current=l.current.createDecorationsCollection([{range:new a.current.Range(r,1,r,f.instructions[r-1].length+1),options:{isWholeLine:!0,className:"rangeCurrentLine",marginClassName:"rangeCurrentLine"}}]))},[r,o]);const p=v=>{if(v===void 0)return;const m=new Date().getTime();(d.current===null||d.current.time{f.decodeInstructions(!0),h(cp())},Lde)}),f.loadNewInstructions(OEe(v)),h(vkt(v)),h(cp())};return Oe("div",{className:gTt.divMonacoEditorWrapper,children:Oe(T4e,{language:"ir",theme:"ir-theme",beforeMount:v=>{a.current=v,pTt(v)},onMount:v=>{l.current=v,v.setValue(s),g()},onChange:v=>p(v),options:{scrollbar:{verticalScrollbarSize:13,horizontalScrollbarSize:13},minimap:{enabled:!1}}})})},vTt="_divVmConsoleWrapper_107q9_1",_Tt="_divVmConsole_107q9_1",bTt="_divVmConsoleBoxShadow_107q9_42",CTt="_divConsoleBlankArea_107q9_46",z2={divVmConsoleWrapper:vTt,divVmConsole:_Tt,divVmConsoleBoxShadow:bTt,divConsoleBlankArea:CTt},yTt="_divInputBlockWrapper_a2tx0_1",wTt="_spanArrow_a2tx0_7",STt="_spanPrompt_a2tx0_11",U2={divInputBlockWrapper:yTt,spanArrow:wTt,spanPrompt:STt,in:"_in_a2tx0_16"},xTt=i=>{const e=Cc();return kn("div",{className:U2.divInputBlockWrapper,children:[Oe("span",{className:U2.spanArrow,children:e.formatMessage({id:"CONSOLE_ARROW"})}),Oe("span",{className:U2.spanPrompt,children:i.prompt.reduce((t,n)=>t+e.formatMessage({id:n.key},n.values),"")}),Oe("input",{ref:i.inputRef,className:U2.in,spellCheck:!1,value:i.value,onChange:t=>i.onChange(t.currentTarget.value),onKeyDown:t=>{t.key==="Enter"&&i.onEnter()}})]})},LTt="_divControlPanelWrapper_x2oa8_1",ETt="_divSide_x2oa8_11",DTt="_iconRun_x2oa8_17",ITt="_iconStep_x2oa8_21",kTt="_iconReset_x2oa8_25",TTt="_iconClear_x2oa8_29",E1={divControlPanelWrapper:LTt,divSide:ETt,iconRun:DTt,iconStep:ITt,iconReset:kTt,iconClear:TTt},NTt="_divIconWrapper_shrpr_1",RTt={divIconWrapper:NTt},j2=i=>kn("div",{className:xe(RTt.divIconWrapper,i.className),title:i.keyTooltip!==void 0?`${i.label} (${i.keyTooltip})`:i.label,onClick:e=>{e.stopPropagation(),i.onClick()},children:[i.icon,i.label!==void 0&&Oe("label",{children:i.label})]}),MTt=i=>{const e=Cc();return Oe("div",{className:E1.divControlPanelWrapper,children:kn("div",{className:E1.divSide,children:[Oe(j2,{className:E1.iconRun,icon:Oe(rft,{}),label:e.formatMessage({id:"RUN"}),keyTooltip:"F2",onClick:i.onRunClick}),Oe(j2,{className:E1.iconStep,icon:Oe(mht,{}),label:e.formatMessage({id:"RUN_STEP"}),keyTooltip:"F8",onClick:i.onRunStepClick}),Oe(j2,{className:E1.iconReset,icon:Oe(xft,{}),label:e.formatMessage({id:"RESET"}),keyTooltip:"F9",onClick:i.onResetClick}),Oe(j2,{className:E1.iconClear,icon:Oe(Fft,{}),label:e.formatMessage({id:"CLEAR_CONSOLE"}),keyTooltip:"F10",onClick:i.onClearClick})]})})},ATt="_divOutputBlocksWrapper_1nyc0_1",PTt="_divOutputBlockWrapper_1nyc0_6",OTt="_spanError_1nyc0_14",FTt="_spanWarning_1nyc0_18",BTt="_spanSuccess_1nyc0_22",WTt="_spanInput_1nyc0_26",$Tt="_spanOutput_1nyc0_30",HTt="_spanPrompt_1nyc0_34",VTt="_spanArrow_1nyc0_38",Sg={divOutputBlocksWrapper:ATt,divOutputBlockWrapper:PTt,spanError:OTt,spanWarning:FTt,spanSuccess:BTt,spanInput:WTt,spanOutput:$Tt,spanPrompt:HTt,spanArrow:VTt},zTt=C.memo(({messages:i})=>{const e=Cc();return Oe("div",{className:Sg.divOutputBlocksWrapper,children:i.map((t,n)=>Oe("div",{className:Sg.divOutputBlockWrapper,children:t.map((r,o)=>{const s=e.formatMessage({id:r.key},r.values);return Oe("span",{className:xe({[Sg.spanError]:r.type===Ql.ERROR,[Sg.spanWarning]:r.type===Ql.WARNING,[Sg.spanSuccess]:r.type===Ql.SUCCESS,[Sg.spanInput]:r.type===Ql.INPUT,[Sg.spanOutput]:r.type===Ql.OUTPUT,[Sg.spanPrompt]:r.type===Ql.PROMPT,[Sg.spanArrow]:r.type===Ql.ARROW}),children:s},o)})},n))})}),UTt=({vmIndex:i})=>{const e=yS(),[t,n]=C.useState(!1),r=Gr(_=>_.vm.vmPageStates[i].consoleInput),o=Gr(_=>_.vm.vmPageStates[i].consoleInputPrompt),s=Gr(_=>_.vm.vmPageStates[i].consoleOutputs),a=C.useRef(null),l=C.useRef({buffer:[],nextInputIndex:0}),c=()=>{l.current.buffer=[],l.current.nextInputIndex=0},u=C.useRef(null),d=C.useRef(null),h=C.useRef(!1),f=__.at(i);C.useEffect(()=>(f.setReadConsoleFn(_=>{var y;return h.current||e(H2(!0)),e(cp()),(y=d.current)==null||y.focus(),l.current.nextInputIndex({...S,type:Ql.PROMPT})),{key:"READ_INPUT",values:{value:r},type:Ql.INPUT}]])),Promise.resolve(l.current.buffer[l.current.nextInputIndex++])):(e(fkt(_)),new Promise(S=>{a.current=S}))}),()=>{a.current!==null&&(a.current(""),a.current=null)}),[]),C.useEffect(()=>{var _;(_=u.current)==null||_.scrollTo(0,u.current.scrollHeight)},[r,o,s]);const g=async()=>{var _;if(!f.canContinueExecution){f.state===Gi.WAIT_INPUT&&((_=d.current)==null||_.focus());return}h.current=!0,e(H2(!1)),await f.executeContinuously(),f.state!==Gi.CLOSED&&(c(),e(cp()))},p=async()=>{var _;if(!f.canContinueExecution){f.state===Gi.WAIT_INPUT&&((_=d.current)==null||_.focus());return}switch(h.current=!1,await f.executeSingleStep(),f.state){case Gi.FREE:e(H2(!0));break;case Gi.EXITED_NORMALLY:case Gi.EXITED_ABNORMALLY:c(),e(H2(!1));break;case Gi.CLOSED:return}e(cp())},v=()=>{e(mkt()),f.reset(),f.decodeInstructions(!0),a.current!==null&&(a.current(""),a.current=null),c(),e(cp())},m=()=>{var _;e(bkt()),f.state===Gi.WAIT_INPUT&&((_=d.current)==null||_.focus())};return kn("div",{className:z2.divVmConsoleWrapper,tabIndex:0,onKeyDown:_=>{if(!(_.key!=="F2"&&_.key!=="F8"&&_.key!=="F9"&&_.key!=="F10"))switch(_.preventDefault(),_.key){case"F2":g();break;case"F8":p();break;case"F9":v();break;case"F10":m();break}},children:[Oe(MTt,{onRunClick:g,onRunStepClick:p,onResetClick:v,onClearClick:m}),kn("div",{ref:u,className:xe(z2.divVmConsole,t&&z2.divVmConsoleBoxShadow),onScroll:_=>{_.currentTarget.scrollTop>0&&!t?n(!0):_.currentTarget.scrollTop<=0&&t&&n(!1)},children:[Oe(zTt,{messages:s}),Oe(xTt,{inputRef:d,prompt:o,value:r,onChange:_=>e(gkt(_)),onEnter:()=>{if(f.state===Gi.WAIT_INPUT||f.state===Gi.BUSY||f.state===Gi.FREE){const _=Tkt(r);l.current.buffer.push(..._),a.current!==null&&l.current.nextInputIndex({..._,type:Ql.PROMPT})),{key:"READ_INPUT",values:{value:r},type:Ql.INPUT}]])),e(_kt())}}),Oe("div",{className:z2.divConsoleBlankArea,onClick:()=>{var _;return(_=d.current)==null?void 0:_.focus()}})]})]})},jTt="_divVmInspectorWrapper_1lk9c_1",KTt="_divVmInspectorWrapperBoxShadow_1lk9c_34",GTt="_divStepStateCard_1lk9c_38",qTt="_divStepStateWrapper_1lk9c_49",XTt="_lblStepStateLabel_1lk9c_55",YTt="_divStepCount_1lk9c_62",ZTt="_divStateBase_1lk9c_68",QTt="_divStateExitedAbnormally_1lk9c_68",JTt="_divStateExitedNormally_1lk9c_68",eNt="_divStateMaxStepReached_1lk9c_68",tNt="_divStateRuntimeError_1lk9c_68",nNt="_divStateStaticCheckFailed_1lk9c_68",iNt="_divStateFree_1lk9c_68",rNt="_divStateWaitInput_1lk9c_68",oNt="_divStateBusy_1lk9c_68",sNt="_divStateInitial_1lk9c_68",aNt="_divOptionsCard_1lk9c_109",lNt="_divOptionWrapper_1lk9c_121",cNt="_lblOption_1lk9c_128",uNt="_iconOptionInfo_1lk9c_133",dNt="_inOptionValue_1lk9c_143",hNt="_divMemoryUsageCard_1lk9c_147",fNt="_divGlobalVariableTableCard_1lk9c_162",gNt="_divLocalVariableTableCard_1lk9c_178",pNt="_divLocalVariableTableWrapper_1lk9c_198",mNt="_divLocalVariableTable_1lk9c_178",vNt="_paginationLocalVariableTable_1lk9c_225",Wi={divVmInspectorWrapper:jTt,divVmInspectorWrapperBoxShadow:KTt,divStepStateCard:GTt,divStepStateWrapper:qTt,lblStepStateLabel:XTt,divStepCount:YTt,divStateBase:ZTt,divStateExitedAbnormally:QTt,divStateExitedNormally:JTt,divStateMaxStepReached:eNt,divStateRuntimeError:tNt,divStateStaticCheckFailed:nNt,divStateFree:iNt,divStateWaitInput:rNt,divStateBusy:oNt,divStateInitial:sNt,divOptionsCard:aNt,divOptionWrapper:lNt,lblOption:cNt,iconOptionInfo:uNt,inOptionValue:dNt,divMemoryUsageCard:hNt,divGlobalVariableTableCard:fNt,divLocalVariableTableCard:gNt,divLocalVariableTableWrapper:pNt,divLocalVariableTable:mNt,paginationLocalVariableTable:vNt},_Nt="_divMemoryUsageWrapper_1rsex_1",bNt="_divUsageBlock_1rsex_7",CNt="_progress_1rsex_25",pL={divMemoryUsageWrapper:_Nt,divUsageBlock:bNt,progress:CNt},G7=i=>{const e=Cc(),t=Rkt(i.usedBytes,i.totalBytes),n=Nkt(i.peakBytes);return kn("div",{className:pL.divMemoryUsageWrapper,children:[kn("div",{className:pL.divUsageBlock,children:[Oe(rde,{className:pL.progress,percent:i.usedBytes/i.totalBytes*100,showInfo:!1,status:"normal"}),kn("div",{children:[Oe("label",{children:i.title}),Oe("label",{className:"percentageUsage",children:i.totalBytes===0?"-.-":e.formatMessage({id:"PERCENTAGE_USAGE"},{percentage:i.usedBytes/i.totalBytes*100})})]}),Oe("span",{children:t.unit==="B"?e.formatMessage({id:"BYTE_USAGE"},{used:t.used,total:t.total}):e.formatMessage({id:"ARBITRARY_UNIT_MEMORY_USAGE"},{...t})})]}),kn("div",{className:pL.divUsageBlock,children:[Oe(rde,{className:pL.progress,percent:i.peakBytes/i.totalBytes*100,showInfo:!1,status:"exception"}),kn("div",{children:[Oe("label",{children:e.formatMessage({id:"PEAK_MEMORY_USAGE"})}),Oe("label",{className:"percentageUsage",children:i.totalBytes===0?"-.-":e.formatMessage({id:"PERCENTAGE_USAGE"},{percentage:i.peakBytes/i.totalBytes*100})})]}),Oe("span",{children:n.unit==="B"?e.formatMessage({id:"BYTE_SIZE"},{size:n.size}):e.formatMessage({id:"ARBITRARY_UNIT_SIZE"},{...n})})]})]})},yNt="_divVariableTableWrapper_1pgdz_1",wNt="_divValues_1pgdz_10",Yde={divVariableTableWrapper:yNt,divValues:wNt},Zde=C.memo(i=>{const e=Cc(),t=[{title:e.formatMessage({id:"VARIABLE_ID"}),dataIndex:"id",showSorterTooltip:!1,sorter:(n,r)=>Mkt(n.id,r.id)},{title:e.formatMessage({id:"ADDRESS"}),dataIndex:"address",showSorterTooltip:!1,sorter:(n,r)=>n.address-r.address},{title:e.formatMessage({id:"SIZE"}),dataIndex:"size",showSorterTooltip:!1,sorter:(n,r)=>n.size-r.size},{title:e.formatMessage({id:"VALUES"}),dataIndex:"values",render:n=>Oe("div",{className:Yde.divValues,children:n.map((r,o)=>Oe("div",{children:n.length===1?r:kn(oMe,{children:["[",o,"]: ",r]})},`${o}${r}`))})}];return Oe("div",{className:Yde.divVariableTableWrapper,children:i.variables.length===0?Oe("div",{className:"emptyHolder",children:e.formatMessage({id:"EMPTY_VATIABLE_TABLE"})}):Oe(gIt,{rowKey:"id",columns:t,dataSource:i.variables,size:"small",pagination:{defaultPageSize:20,pageSizeOptions:[10,20,30,50,100],showSizeChanger:!0,hideOnSinglePage:!0,size:"small"}})})});function SNt(i){switch(i){case Gi.BUSY:return"STATE_BUSY";case Gi.EXITED_ABNORMALLY:return"STATE_EXITED_ABNORMALLY";case Gi.EXITED_NORMALLY:return"STATE_EXITED_NORMALLY";case Gi.FREE:return"STATE_FREE";case Gi.INITIAL:return"STATE_INITIAL";case Gi.MAX_STEP_REACHED:return"STATE_MAX_STEP_REACHED";case Gi.RUNTIME_ERROR:return"STATE_RUNTIME_ERROR";case Gi.STATIC_CHECK_FAILED:return"STATE_STATIC_CHECK_FAILED";case Gi.WAIT_INPUT:return"STATE_WAIT_INPUT"}}const xNt=({vmIndex:i})=>{const e=Cc(),t=yS(),n=Gr(p=>p.vm.vmPageStates[i].state),r=Gr(p=>p.vm.vmPageStates[i].stepCount),o=Gr(p=>p.vm.vmPageStates[i].options),s=Gr(p=>p.vm.vmPageStates[i].memoryUsage),a=Gr(p=>p.vm.vmPageStates[i].peakMemoryUsage),l=Gr(p=>p.vm.vmPageStates[i].globalVariableDetails),c=Gr(p=>p.vm.vmPageStates[i].localVariableDetailsStack),u=Gr(p=>p.vm.vmPageStates[i].localVariableTablesPagination),[d,h]=C.useState(!1),f=C.useRef(null),g=__.at(i);return kn("div",{ref:f,className:xe(Wi.divVmInspectorWrapper,d&&Wi.divVmInspectorWrapperBoxShadow),onScroll:p=>{p.currentTarget.scrollTop>0&&!d?h(!0):p.currentTarget.scrollTop<=0&&d&&h(!1)},children:[kn("div",{className:Wi.divStepStateCard,children:[kn("div",{className:Wi.divStepStateWrapper,children:[Oe("label",{className:Wi.lblStepStateLabel,children:e.formatMessage({id:"STEP_COUNT"})}),Oe("div",{className:Wi.divStepCount,children:e.formatMessage({id:"STEP_COUNT_NUMBER"},{stepCount:r})})]}),kn("div",{className:Wi.divStepStateWrapper,children:[Oe("label",{className:Wi.lblStepStateLabel,children:e.formatMessage({id:"STATE"})}),Oe("div",{className:xe({[Wi.divStateInitial]:n===Gi.INITIAL,[Wi.divStateBusy]:n===Gi.BUSY,[Wi.divStateWaitInput]:n===Gi.WAIT_INPUT,[Wi.divStateFree]:n===Gi.FREE,[Wi.divStateStaticCheckFailed]:n===Gi.STATIC_CHECK_FAILED,[Wi.divStateRuntimeError]:n===Gi.RUNTIME_ERROR,[Wi.divStateMaxStepReached]:n===Gi.MAX_STEP_REACHED,[Wi.divStateExitedNormally]:n===Gi.EXITED_NORMALLY,[Wi.divStateExitedAbnormally]:n===Gi.EXITED_ABNORMALLY}),children:e.formatMessage({id:SNt(n)})})]})]}),kn("div",{className:Wi.divOptionsCard,children:[kn("div",{className:Wi.divOptionWrapper,children:[kn("label",{className:Wi.lblOption,children:[e.formatMessage({id:"MAX_EXECUTION_STEP_COUNT"}),Oe(NT,{title:e.formatMessage({id:"SET_0_MEANS_NO_STEP_LIMIT"}),children:Oe(dwe,{className:Wi.iconOptionInfo})})]}),Oe(O7,{className:Wi.inOptionValue,disabled:n!==Gi.INITIAL,min:zd.maxExecutionStepCount.min,max:zd.maxExecutionStepCount.max,value:o.maxExecutionStepCount,onChange:p=>{g.configure({maxExecutionStepCount:p??void 0}),t(cp())}})]}),kn("div",{className:Wi.divOptionWrapper,children:[Oe("label",{className:Wi.lblOption,children:e.formatMessage({id:"MEMORY_SIZE"})}),Oe(O7,{className:Wi.inOptionValue,disabled:n!==Gi.INITIAL,min:zd.memorySize.min,max:zd.memorySize.max,value:o.memorySize,onChange:p=>{g.configure({memorySize:p??void 0}),t(cp())}})]}),kn("div",{className:Wi.divOptionWrapper,children:[Oe("label",{className:Wi.lblOption,children:e.formatMessage({id:"STACK_SIZE"})}),Oe(O7,{className:Wi.inOptionValue,disabled:n!==Gi.INITIAL,min:zd.stackSize.min,max:zd.stackSize.max,value:o.stackSize,onChange:p=>{g.configure({stackSize:p??void 0}),t(cp())}})]})]}),kn("div",{className:Wi.divMemoryUsageCard,children:[Oe(G7,{title:e.formatMessage({id:"TOTAL_MEMORY_USAGE"}),usedBytes:s.used,totalBytes:s.total,peakBytes:a.total}),Oe(G7,{title:e.formatMessage({id:"STACK_MEMORY_USAGE"}),usedBytes:s.stackUsed,totalBytes:s.stackTotal,peakBytes:a.stack}),Oe(G7,{title:e.formatMessage({id:"GLOBAL_VARIABLE_MEMORY_USAGE"}),usedBytes:s.globalVariableUsed,totalBytes:s.globalVariableTotal,peakBytes:a.globalVariable})]}),kn("div",{className:Wi.divGlobalVariableTableCard,children:[Oe("label",{className:"title",children:e.formatMessage({id:"GLOBAL_VARIABLE_TABLE"})}),Oe(Zde,{variables:l})]}),kn("div",{className:Wi.divLocalVariableTableCard,children:[Oe("label",{className:"title",children:e.formatMessage({id:"LOCAL_VARIABLE_TABLE"})}),c.length===0?Oe("div",{className:"emptyHolder",children:e.formatMessage({id:"EMPTY_VATIABLE_TABLE"})}):kn("div",{className:Wi.divLocalVariableTableWrapper,children:[c.slice(u.size*(u.currentIndex-1),u.size*u.currentIndex).map(p=>kn("div",{className:Wi.divLocalVariableTable,children:[kn("div",{className:"titleWrapper",children:[Oe("label",{className:"functionName",children:p.functionName}),kn("label",{className:"callStackDepth",children:["(",e.formatMessage({id:"CALL_STACK_DEPTH"},{depth:p.stackDepth}),")"]})]}),Oe(Zde,{variables:p.details})]},`${p.functionName}${p.stackDepth}`)),Oe(kQ,{className:Wi.paginationLocalVariableTable,onChange:(p,v)=>t(pkt({currentIndex:p,size:v})),total:c.length,defaultCurrent:1,defaultPageSize:FQ,pageSizeOptions:[10,20,30,50,100],showSizeChanger:!0,hideOnSinglePage:!0,size:"small"})]})]})]})},LNt=()=>{const i=Cc(),e=yS(),t=Gr(l=>l.vm.vmPageStates.length),n=Gr(l=>l.vm.activeVmIndex),r=Gr(l=>l.vm.vmPageStates.map(c=>c.id),(l,c)=>l.length===c.length&&l.every((u,d)=>u===c[d])),o=Gr(l=>l.vm.vmPageStates.every(c=>!c.isIrChanged)),[s,a]=C.useState(window.innerWidth{window.onresize=()=>a(window.innerWidth{window.onbeforeunload=o?null:l=>(l.preventDefault(),l.returnValue="Your unsaved changes will be lost. Sure to leave?")},[o]),kn("main",{className:oL.main,onDragEnter:l=>l.preventDefault(),onDragOver:l=>l.preventDefault(),onDrop:l=>{for(const c of l.dataTransfer.files)HEe(e,i,c);l.preventDefault()},children:[Oe(Vkt,{vmIndex:n}),kn("div",{className:oL.divRight,children:[Oe(oTt,{}),Oe("div",{className:oL.divVmWrapper,children:t===0?Oe(hTt,{}):new Array(t).fill(null).map((l,c)=>kn("div",{className:xe({[oL.divVmContentHorizontal]:!s,[oL.divVmContentVertical]:s}),style:{display:c===n?"flex":"none"},children:[Oe("section",{className:"sectionIrEditor",children:Oe(mTt,{vmIndex:c})}),Oe("section",{className:"sectionVmConsole",children:Oe(UTt,{vmIndex:c})}),Oe("section",{className:"sectionVmInspector",children:Oe(xNt,{vmIndex:c})})]},r[c]))})]})]})};self.MonacoEnvironment={getWorker(i,e){return e==="json"?new adt:e==="css"||e==="scss"||e==="less"?new ldt:e==="html"||e==="handlebars"||e==="razor"?new cdt:e==="typescript"||e==="javascript"?new udt:new sdt}};n4.config({monaco:odt});n4.init();const ENt=()=>{const i=Gr(t=>t.locale.currentLocale),e=Gr(t=>t.theme.currentClassName);return C.useEffect(()=>{document.body.className=e},[e]),Oe(LFe,{messages:i,locale:"en",children:Oe(LNt,{})})},DNt=GIt({reducer:{locale:Bkt,theme:Hkt,vm:Ckt}});var GK={},INt={get exports(){return GK},set exports(i){GK=i}},nB={},vk={},kNt={get exports(){return vk},set exports(i){vk=i}};(function(i){function e(t){return t&&t.__esModule?t:{default:t}}i.exports=e,i.exports.__esModule=!0,i.exports.default=i.exports})(kNt);var iB={};Object.defineProperty(iB,"__esModule",{value:!0});iB.default=void 0;var TNt={items_per_page:"条/页",jump_to:"跳至",jump_to_confirm:"确定",page:"页",prev_page:"上一页",next_page:"下一页",prev_5:"向前 5 页",next_5:"向后 5 页",prev_3:"向前 3 页",next_3:"向后 3 页",page_size:"页码"};iB.default=TNt;var rB={},$T={},oB={};Object.defineProperty(oB,"__esModule",{value:!0});oB.default=void 0;var NNt={locale:"zh_CN",today:"今天",now:"此刻",backToToday:"返回今天",ok:"确定",timeSelect:"选择时间",dateSelect:"选择日期",weekSelect:"选择周",clear:"清除",month:"月",year:"年",previousMonth:"上个月 (翻页上键)",nextMonth:"下个月 (翻页下键)",monthSelect:"选择月份",yearSelect:"选择年份",decadeSelect:"选择年代",yearFormat:"YYYY年",dayFormat:"D日",dateFormat:"YYYY年M月D日",dateTimeFormat:"YYYY年M月D日 HH时mm分ss秒",previousYear:"上一年 (Control键加左方向键)",nextYear:"下一年 (Control键加右方向键)",previousDecade:"上一年代",nextDecade:"下一年代",previousCentury:"上一世纪",nextCentury:"下一世纪"},RNt=NNt;oB.default=RNt;var HT={};Object.defineProperty(HT,"__esModule",{value:!0});HT.default=void 0;const MNt={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]};var ANt=MNt;HT.default=ANt;var VEe=vk.default;Object.defineProperty($T,"__esModule",{value:!0});$T.default=void 0;var PNt=VEe(oB),ONt=VEe(HT);const zEe={lang:Object.assign({placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"]},PNt.default),timePickerLocale:Object.assign({},ONt.default)};zEe.lang.ok="确定";var FNt=zEe;$T.default=FNt;var BNt=vk.default;Object.defineProperty(rB,"__esModule",{value:!0});rB.default=void 0;var WNt=BNt($T),$Nt=WNt.default;rB.default=$Nt;var sB=vk.default;Object.defineProperty(nB,"__esModule",{value:!0});nB.default=void 0;var HNt=sB(iB),VNt=sB(rB),zNt=sB($T),UNt=sB(HT);const Fc="${label}不是一个有效的${type}",jNt={locale:"zh-cn",Pagination:HNt.default,DatePicker:zNt.default,TimePicker:UNt.default,Calendar:VNt.default,global:{placeholder:"请选择"},Table:{filterTitle:"筛选",filterConfirm:"确定",filterReset:"重置",filterEmptyText:"无筛选项",filterCheckall:"全选",filterSearchPlaceholder:"在筛选项中搜索",selectAll:"全选当页",selectInvert:"反选当页",selectNone:"清空所有",selectionAll:"全选所有",sortTitle:"排序",expand:"展开行",collapse:"关闭行",triggerDesc:"点击降序",triggerAsc:"点击升序",cancelSort:"取消排序"},Modal:{okText:"确定",cancelText:"取消",justOkText:"知道了"},Tour:{Next:"下一步",Previous:"上一步",Finish:"结束导览"},Popconfirm:{cancelText:"取消",okText:"确定"},Transfer:{titles:["",""],searchPlaceholder:"请输入搜索内容",itemUnit:"项",itemsUnit:"项",remove:"删除",selectCurrent:"全选当页",removeCurrent:"删除当页",selectAll:"全选所有",removeAll:"删除全部",selectInvert:"反选当页"},Upload:{uploading:"文件上传中",removeFile:"删除文件",uploadError:"上传错误",previewFile:"预览文件",downloadFile:"下载文件"},Empty:{description:"暂无数据"},Icon:{icon:"图标"},Text:{edit:"编辑",copy:"复制",copied:"复制成功",expand:"展开"},PageHeader:{back:"返回"},Form:{optional:"(可选)",defaultValidateMessages:{default:"字段验证错误${label}",required:"请输入${label}",enum:"${label}必须是其中一个[${enum}]",whitespace:"${label}不能为空字符",date:{format:"${label}日期格式无效",parse:"${label}不能转换为日期",invalid:"${label}是一个无效日期"},types:{string:Fc,method:Fc,array:Fc,object:Fc,number:Fc,date:Fc,boolean:Fc,integer:Fc,float:Fc,regexp:Fc,email:Fc,url:Fc,hex:Fc},string:{len:"${label}须为${len}个字符",min:"${label}最少${min}个字符",max:"${label}最多${max}个字符",range:"${label}须在${min}-${max}字符之间"},number:{len:"${label}必须等于${len}",min:"${label}最小值为${min}",max:"${label}最大值为${max}",range:"${label}须在${min}-${max}之间"},array:{len:"须为${len}个${label}",min:"最少${min}个${label}",max:"最多${max}个${label}",range:"${label}数量须在${min}-${max}之间"},pattern:{mismatch:"${label}与模式不匹配${pattern}"}}},Image:{preview:"预览"},QRCode:{expired:"二维码过期",refresh:"点击刷新"}};var KNt=jNt;nB.default=KNt;(function(i){i.exports=nB})(INt);const GNt=qK(GK);q7.createRoot(document.getElementById("root")).render(Oe($e.StrictMode,{children:Oe(eOe,{store:DNt,children:Oe(LT,{locale:GNt,children:Oe(ENt,{})})})}));export{w3 as m,Pbe as t}; + v-22c0-3.87-3.13-7-7-7h-33c-3.87,0-7,3.13-7,7V36.5z`})}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{})]}),iTt=i=>kn("svg",{...i,version:"1.1",id:"layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 50 50",enableBackground:"new 0 0 50 50",children:[Oe("circle",{cx:"25",cy:"25",r:"25"}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{})]}),rTt=i=>{const e=Cc(),[t,n]=C.useState(!1),[r,o]=C.useState(i.title);return C.useEffect(()=>{if(t){const s=document.getElementById("inVmRename");s!==null&&(s.focus(),s.select())}},[t]),kn("div",{className:xe({[jh.divTabBarItemWrapperActive]:i.isActive,[jh.divTabBarItemWrapperInactive]:!i.isActive}),onClick:s=>{s.stopPropagation(),i.onClick()},title:i.title,onDoubleClick:()=>{o(i.title),n(!0)},children:[kn("div",{className:jh.divIconTitleWrapper,children:[Oe(nTt,{className:jh.iconVm}),t?Oe("input",{id:"inVmRename",className:jh.inVmRename,value:r,onChange:s=>o(s.currentTarget.value),onKeyDown:s=>{s.key==="Enter"&&(i.onRename(r),n(!1))},onBlur:()=>{i.onRename(r),n(!1)}}):Oe("label",{className:jh.lblTitle,children:Ikt(i.title)})]}),kn("div",{className:xe({[jh.divCloseWrapperChanged]:i.isChanged,[jh.divCloseWrapper]:!i.isChanged}),title:e.formatMessage({id:"CLOSE"}),onClick:s=>{s.stopPropagation(),i.onCloseClick()},children:[i.isChanged&&Oe(iTt,{className:jh.iconDot}),Oe(CT,{className:jh.iconClose})]})]})},oTt=()=>{var l;const i=Cc(),e=Gr(c=>c.vm),t=yS(),[n,r]=C.useState(!1),[o,s]=C.useState(0),a=c=>{t(dkt(c)),v_.at(c).close(),v_.delete(c)};return kn("nav",{className:Ukt.navTabBarWrapper,children:[e.vmPageStates.map((c,u)=>Oe(rTt,{title:c.name,isActive:u===e.activeVmIndex,isChanged:c.isIrChanged,onClick:()=>t(ckt(u)),onCloseClick:()=>{if(!c.isIrChanged){a(u);return}s(u),r(!0)},onRename:d=>{d!==""&&t(ukt({index:u,newName:d}))}},c.id)),Oe(IK,{open:n,title:i.formatMessage({id:"CONFIRM_UNSAVED_CLOSE"},{name:(l=e.vmPageStates[o])==null?void 0:l.name}),onCancel:()=>r(!1),footer:[Oe(Ju,{onClick:()=>r(!1),children:i.formatMessage({id:"CANCEL"})}),Oe(Ju,{danger:!0,onClick:()=>{a(o),r(!1)},children:i.formatMessage({id:"UNSAVE_CLOSE"})}),Oe(Ju,{type:"primary",onClick:()=>{WEe(e.vmPageStates[e.activeVmIndex].name,e.vmPageStates[e.activeVmIndex].irString),a(o),r(!1)},children:i.formatMessage({id:"SAVE_CLOSE"})})]})]})},sTt="_divEmptyHolder_3r6f3_11",aTt="_imgLogo_3r6f3_25",lTt="_divEmptyHolderText_3r6f3_30",cTt="_spanDesc_3r6f3_39",uTt="_divEmptyHolderHintsWrapper_3r6f3_45",fL={divEmptyHolder:sTt,"empty-holder-in":"_empty-holder-in_3r6f3_1",imgLogo:aTt,divEmptyHolderText:lTt,spanDesc:cTt,divEmptyHolderHintsWrapper:uTt};function dTt(){const i=navigator.userAgent.toLowerCase();return i.includes("android")||i.includes("harmony")||i.includes("iphone")||i.includes("ipad")||i.includes("mobile")}const hTt=()=>{const i=Cc();return kn("div",{className:fL.divEmptyHolder,children:[Oe("img",{className:fL.imgLogo,src:"logo.svg",alt:"IR Virtual Machine"}),kn("div",{className:fL.divEmptyHolderText,children:[Oe("span",{className:fL.spanDesc,children:i.formatMessage({id:"EMPTY_PLACEHOLDER_DESC"})}),kn("div",{className:fL.divEmptyHolderHintsWrapper,children:[Oe("span",{className:"hint-title",children:i.formatMessage({id:"EMPTY_PLACEHOLDER_HINT_TITLE"})}),Oe("span",{children:i.formatMessage({id:"EMPTY_PLACEHOLDER_HINT_1"})}),!dTt()&&Oe("span",{children:i.formatMessage({id:"EMPTY_PLACEHOLDER_HINT_2"})}),Oe("span",{children:i.formatMessage({id:"EMPTY_PLACEHOLDER_HINT_3"})})]})]})]})};const fTt="_divMonacoEditorWrapper_1a3zn_1",gTt={divMonacoEditorWrapper:fTt};let Xde=!1;const gL="ir";function pTt(i){if(Xde)return;i.languages.register({id:gL}),i.editor.defineTheme("ir-theme",{base:"vs",inherit:!0,rules:[{token:"function",foreground:"#74531f"},{token:"number.size",foreground:"#0097ff"}],colors:{}});const e="[ \\t\\r\\n]+";i.languages.setMonarchTokensProvider(gL,{keywords:rA,identifier:Vd,whitespace:e,defaultToken:"source",tokenizer:{root:[[`#${jK}`,"number"],[AEe,"number.size"],[/(:=)|(\+)|(-)|(\*)|(\/)|(==)|(!=)|(<=)|(<)|(>=)|(>)|(&)/,"operators"],[/:/,"delimiter"],[/;.*/,"comment"],[/@whitespace/,"white"],[/(FUNCTION)(@whitespace)(@identifier)/,["keyword","white","function"]],[/(CALL)(@whitespace)(@identifier)/,["keyword","white","function"]],[/@identifier/,{cases:{"@keywords":"keyword","@default":"identifier"}}]]}});const t=["FUNCTION ${1:id} :","DEC ${1:id} ${2:size}","GLOBAL_DEC ${1:id} ${2:size}","LABEL ${1:id} :","GOTO ${1:label}","IF ${1:condition} GOTO ${2:label}","ARG ${1:value}","PARAM ${1:id}","CALL ${1:id}","RETURN ${1:value}","READ ${1:id}","WRITE ${1:value}"];i.languages.registerCompletionItemProvider(gL,{provideCompletionItems:(n,r)=>{const o=n.getWordUntilPosition(r),s={startLineNumber:r.lineNumber,endLineNumber:r.lineNumber,startColumn:o.startColumn,endColumn:o.endColumn};return{suggestions:[...rA.map(a=>({label:a,kind:i.languages.CompletionItemKind.Keyword,insertText:a,range:s})),...rA.map((a,l)=>({label:`${a} Snippet`,kind:i.languages.CompletionItemKind.Snippet,insertText:t[l],insertTextRules:i.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:s}))]}}}),i.languages.registerFoldingRangeProvider(gL,{provideFoldingRanges:n=>{const r=n.getLinesContent(),o=[];let s=-1,a=-1,l=-1;for(let c=0;c{const e=Cc(),t=Gr(v=>v.vm.vmPageStates[i].staticErrors),n=Gr(v=>v.vm.vmPageStates[i].runtimeErrors),r=Gr(v=>v.vm.vmPageStates[i].currentLineNumber),o=Gr(v=>v.vm.vmPageStates[i].shouldIndicateCurrentLineNumber),s=Gr(v=>v.vm.vmPageStates[i].irString),a=C.useRef(null),l=C.useRef(null),c=C.useRef(null),u=C.useRef(null),d=C.useRef(null),h=yS(),f=v_.at(i),g=()=>{a.current!==null&&l.current!==null&&l.current.getModel()!==null&&a.current.editor.setModelMarkers(l.current.getModel(),"IR Decoder",t.map(v=>({startLineNumber:v.startLineNumber,endLineNumber:v.endLineNumber,startColumn:v.startColumn,endColumn:v.endColumn+1,message:e.formatMessage({id:v.message.key},v.message.values),severity:a.current.MarkerSeverity.Error})))};C.useEffect(g,[t,e.messages]),C.useEffect(()=>{c.current!==null&&c.current.clear(),a.current!==null&&l.current!==null&&l.current.getModel()!==null&&(n.length>0&&l.current.revealLineInCenterIfOutsideViewport(r),c.current=l.current.createDecorationsCollection(n.map(v=>({range:new a.current.Range(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn),options:{isWholeLine:!0,className:"rangeError",marginClassName:"rangeError",hoverMessage:{value:e.formatMessage({id:v.message.key},v.message.values)}}}))))},[n,e.messages]),C.useEffect(()=>{u.current!==null&&u.current.clear(),!(!o||f.instructions[r-1]===void 0)&&a.current!==null&&l.current!==null&&(l.current.revealLineInCenterIfOutsideViewport(r),u.current=l.current.createDecorationsCollection([{range:new a.current.Range(r,1,r,f.instructions[r-1].length+1),options:{isWholeLine:!0,className:"rangeCurrentLine",marginClassName:"rangeCurrentLine"}}]))},[r,o]);const p=v=>{if(v===void 0)return;const m=new Date().getTime();(d.current===null||d.current.time{f.decodeInstructions(!0),h(cp())},Lde)}),f.loadNewInstructions(OEe(v)),h(vkt(v)),h(cp())};return Oe("div",{className:gTt.divMonacoEditorWrapper,children:Oe(T4e,{language:"ir",theme:"ir-theme",beforeMount:v=>{a.current=v,pTt(v)},onMount:v=>{l.current=v,v.setValue(s),g()},onChange:v=>p(v),options:{scrollbar:{verticalScrollbarSize:13,horizontalScrollbarSize:13},minimap:{enabled:!1}}})})},vTt="_divVmConsoleWrapper_107q9_1",_Tt="_divVmConsole_107q9_1",bTt="_divVmConsoleBoxShadow_107q9_42",CTt="_divConsoleBlankArea_107q9_46",z2={divVmConsoleWrapper:vTt,divVmConsole:_Tt,divVmConsoleBoxShadow:bTt,divConsoleBlankArea:CTt},yTt="_divInputBlockWrapper_a2tx0_1",wTt="_spanArrow_a2tx0_7",STt="_spanPrompt_a2tx0_11",U2={divInputBlockWrapper:yTt,spanArrow:wTt,spanPrompt:STt,in:"_in_a2tx0_16"},xTt=i=>{const e=Cc();return kn("div",{className:U2.divInputBlockWrapper,children:[Oe("span",{className:U2.spanArrow,children:e.formatMessage({id:"CONSOLE_ARROW"})}),Oe("span",{className:U2.spanPrompt,children:i.prompt.reduce((t,n)=>t+e.formatMessage({id:n.key},n.values),"")}),Oe("input",{ref:i.inputRef,className:U2.in,spellCheck:!1,value:i.value,onChange:t=>i.onChange(t.currentTarget.value),onKeyDown:t=>{t.key==="Enter"&&i.onEnter()}})]})},LTt="_divControlPanelWrapper_x2oa8_1",ETt="_divSide_x2oa8_11",DTt="_iconRun_x2oa8_17",ITt="_iconStep_x2oa8_21",kTt="_iconReset_x2oa8_25",TTt="_iconClear_x2oa8_29",E1={divControlPanelWrapper:LTt,divSide:ETt,iconRun:DTt,iconStep:ITt,iconReset:kTt,iconClear:TTt},NTt="_divIconWrapper_shrpr_1",RTt={divIconWrapper:NTt},j2=i=>kn("div",{className:xe(RTt.divIconWrapper,i.className),title:i.keyTooltip!==void 0?`${i.label} (${i.keyTooltip})`:i.label,onClick:e=>{e.stopPropagation(),i.onClick()},children:[i.icon,i.label!==void 0&&Oe("label",{children:i.label})]}),MTt=i=>{const e=Cc();return Oe("div",{className:E1.divControlPanelWrapper,children:kn("div",{className:E1.divSide,children:[Oe(j2,{className:E1.iconRun,icon:Oe(rft,{}),label:e.formatMessage({id:"RUN"}),keyTooltip:"F2",onClick:i.onRunClick}),Oe(j2,{className:E1.iconStep,icon:Oe(mht,{}),label:e.formatMessage({id:"RUN_STEP"}),keyTooltip:"F8",onClick:i.onRunStepClick}),Oe(j2,{className:E1.iconReset,icon:Oe(xft,{}),label:e.formatMessage({id:"RESET"}),keyTooltip:"F9",onClick:i.onResetClick}),Oe(j2,{className:E1.iconClear,icon:Oe(Fft,{}),label:e.formatMessage({id:"CLEAR_CONSOLE"}),keyTooltip:"F10",onClick:i.onClearClick})]})})},ATt="_divOutputBlocksWrapper_1nyc0_1",PTt="_divOutputBlockWrapper_1nyc0_6",OTt="_spanError_1nyc0_14",FTt="_spanWarning_1nyc0_18",BTt="_spanSuccess_1nyc0_22",WTt="_spanInput_1nyc0_26",$Tt="_spanOutput_1nyc0_30",HTt="_spanPrompt_1nyc0_34",VTt="_spanArrow_1nyc0_38",Sg={divOutputBlocksWrapper:ATt,divOutputBlockWrapper:PTt,spanError:OTt,spanWarning:FTt,spanSuccess:BTt,spanInput:WTt,spanOutput:$Tt,spanPrompt:HTt,spanArrow:VTt},zTt=C.memo(({messages:i})=>{const e=Cc();return Oe("div",{className:Sg.divOutputBlocksWrapper,children:i.map((t,n)=>Oe("div",{className:Sg.divOutputBlockWrapper,children:t.map((r,o)=>{const s=e.formatMessage({id:r.key},r.values);return Oe("span",{className:xe({[Sg.spanError]:r.type===Ql.ERROR,[Sg.spanWarning]:r.type===Ql.WARNING,[Sg.spanSuccess]:r.type===Ql.SUCCESS,[Sg.spanInput]:r.type===Ql.INPUT,[Sg.spanOutput]:r.type===Ql.OUTPUT,[Sg.spanPrompt]:r.type===Ql.PROMPT,[Sg.spanArrow]:r.type===Ql.ARROW}),children:s},o)})},n))})}),UTt=({vmIndex:i})=>{const e=yS(),[t,n]=C.useState(!1),r=Gr(_=>_.vm.vmPageStates[i].consoleInput),o=Gr(_=>_.vm.vmPageStates[i].consoleInputPrompt),s=Gr(_=>_.vm.vmPageStates[i].consoleOutputs),a=C.useRef(null),l=C.useRef({buffer:[],nextInputIndex:0}),c=()=>{l.current.buffer=[],l.current.nextInputIndex=0},u=C.useRef(null),d=C.useRef(null),h=C.useRef(!1),f=v_.at(i);C.useEffect(()=>(f.setReadConsoleFn(_=>{var y;return h.current||e(H2(!0)),e(cp()),(y=d.current)==null||y.focus(),l.current.nextInputIndex({...S,type:Ql.PROMPT})),{key:"READ_INPUT",values:{value:r},type:Ql.INPUT}]])),Promise.resolve(l.current.buffer[l.current.nextInputIndex++])):(e(fkt(_)),new Promise(S=>{a.current=S}))}),()=>{a.current!==null&&(a.current(""),a.current=null)}),[]),C.useEffect(()=>{var _;(_=u.current)==null||_.scrollTo(0,u.current.scrollHeight)},[r,o,s]);const g=async()=>{var _;if(!f.canContinueExecution){f.state===Gi.WAIT_INPUT&&((_=d.current)==null||_.focus());return}h.current=!0,e(H2(!1)),await f.executeContinuously(),f.state!==Gi.CLOSED&&(c(),e(cp()))},p=async()=>{var _;if(!f.canContinueExecution){f.state===Gi.WAIT_INPUT&&((_=d.current)==null||_.focus());return}switch(h.current=!1,await f.executeSingleStep(),f.state){case Gi.FREE:e(H2(!0));break;case Gi.EXITED_NORMALLY:case Gi.EXITED_ABNORMALLY:c(),e(H2(!1));break;case Gi.CLOSED:return}e(cp())},v=()=>{e(mkt()),f.reset(),f.decodeInstructions(!0),a.current!==null&&(a.current(""),a.current=null),c(),e(cp())},m=()=>{var _;e(bkt()),f.state===Gi.WAIT_INPUT&&((_=d.current)==null||_.focus())};return kn("div",{className:z2.divVmConsoleWrapper,tabIndex:0,onKeyDown:_=>{if(!(_.key!=="F2"&&_.key!=="F8"&&_.key!=="F9"&&_.key!=="F10"))switch(_.preventDefault(),_.key){case"F2":g();break;case"F8":p();break;case"F9":v();break;case"F10":m();break}},children:[Oe(MTt,{onRunClick:g,onRunStepClick:p,onResetClick:v,onClearClick:m}),kn("div",{ref:u,className:xe(z2.divVmConsole,t&&z2.divVmConsoleBoxShadow),onScroll:_=>{_.currentTarget.scrollTop>0&&!t?n(!0):_.currentTarget.scrollTop<=0&&t&&n(!1)},children:[Oe(zTt,{messages:s}),Oe(xTt,{inputRef:d,prompt:o,value:r,onChange:_=>e(gkt(_)),onEnter:()=>{if(f.state===Gi.WAIT_INPUT||f.state===Gi.BUSY||f.state===Gi.FREE){const _=Tkt(r);l.current.buffer.push(..._),a.current!==null&&l.current.nextInputIndex({..._,type:Ql.PROMPT})),{key:"READ_INPUT",values:{value:r},type:Ql.INPUT}]])),e(_kt())}}),Oe("div",{className:z2.divConsoleBlankArea,onClick:()=>{var _;return(_=d.current)==null?void 0:_.focus()}})]})]})},jTt="_divVmInspectorWrapper_1lk9c_1",KTt="_divVmInspectorWrapperBoxShadow_1lk9c_34",GTt="_divStepStateCard_1lk9c_38",qTt="_divStepStateWrapper_1lk9c_49",XTt="_lblStepStateLabel_1lk9c_55",YTt="_divStepCount_1lk9c_62",ZTt="_divStateBase_1lk9c_68",QTt="_divStateExitedAbnormally_1lk9c_68",JTt="_divStateExitedNormally_1lk9c_68",eNt="_divStateMaxStepReached_1lk9c_68",tNt="_divStateRuntimeError_1lk9c_68",nNt="_divStateStaticCheckFailed_1lk9c_68",iNt="_divStateFree_1lk9c_68",rNt="_divStateWaitInput_1lk9c_68",oNt="_divStateBusy_1lk9c_68",sNt="_divStateInitial_1lk9c_68",aNt="_divOptionsCard_1lk9c_109",lNt="_divOptionWrapper_1lk9c_121",cNt="_lblOption_1lk9c_128",uNt="_iconOptionInfo_1lk9c_133",dNt="_inOptionValue_1lk9c_143",hNt="_divMemoryUsageCard_1lk9c_147",fNt="_divGlobalVariableTableCard_1lk9c_162",gNt="_divLocalVariableTableCard_1lk9c_178",pNt="_divLocalVariableTableWrapper_1lk9c_198",mNt="_divLocalVariableTable_1lk9c_178",vNt="_paginationLocalVariableTable_1lk9c_225",Wi={divVmInspectorWrapper:jTt,divVmInspectorWrapperBoxShadow:KTt,divStepStateCard:GTt,divStepStateWrapper:qTt,lblStepStateLabel:XTt,divStepCount:YTt,divStateBase:ZTt,divStateExitedAbnormally:QTt,divStateExitedNormally:JTt,divStateMaxStepReached:eNt,divStateRuntimeError:tNt,divStateStaticCheckFailed:nNt,divStateFree:iNt,divStateWaitInput:rNt,divStateBusy:oNt,divStateInitial:sNt,divOptionsCard:aNt,divOptionWrapper:lNt,lblOption:cNt,iconOptionInfo:uNt,inOptionValue:dNt,divMemoryUsageCard:hNt,divGlobalVariableTableCard:fNt,divLocalVariableTableCard:gNt,divLocalVariableTableWrapper:pNt,divLocalVariableTable:mNt,paginationLocalVariableTable:vNt},_Nt="_divMemoryUsageWrapper_1rsex_1",bNt="_divUsageBlock_1rsex_7",CNt="_progress_1rsex_25",pL={divMemoryUsageWrapper:_Nt,divUsageBlock:bNt,progress:CNt},G7=i=>{const e=Cc(),t=Rkt(i.usedBytes,i.totalBytes),n=Nkt(i.peakBytes);return kn("div",{className:pL.divMemoryUsageWrapper,children:[kn("div",{className:pL.divUsageBlock,children:[Oe(rde,{className:pL.progress,percent:i.usedBytes/i.totalBytes*100,showInfo:!1,status:"normal"}),kn("div",{children:[Oe("label",{children:i.title}),Oe("label",{className:"percentageUsage",children:i.totalBytes===0?"-.-":e.formatMessage({id:"PERCENTAGE_USAGE"},{percentage:i.usedBytes/i.totalBytes*100})})]}),Oe("span",{children:t.unit==="B"?e.formatMessage({id:"BYTE_USAGE"},{used:t.used,total:t.total}):e.formatMessage({id:"ARBITRARY_UNIT_MEMORY_USAGE"},{...t})})]}),kn("div",{className:pL.divUsageBlock,children:[Oe(rde,{className:pL.progress,percent:i.peakBytes/i.totalBytes*100,showInfo:!1,status:"exception"}),kn("div",{children:[Oe("label",{children:e.formatMessage({id:"PEAK_MEMORY_USAGE"})}),Oe("label",{className:"percentageUsage",children:i.totalBytes===0?"-.-":e.formatMessage({id:"PERCENTAGE_USAGE"},{percentage:i.peakBytes/i.totalBytes*100})})]}),Oe("span",{children:n.unit==="B"?e.formatMessage({id:"BYTE_SIZE"},{size:n.size}):e.formatMessage({id:"ARBITRARY_UNIT_SIZE"},{...n})})]})]})},yNt="_divVariableTableWrapper_1pgdz_1",wNt="_divValues_1pgdz_10",Yde={divVariableTableWrapper:yNt,divValues:wNt},Zde=C.memo(i=>{const e=Cc(),t=[{title:e.formatMessage({id:"VARIABLE_ID"}),dataIndex:"id",showSorterTooltip:!1,sorter:(n,r)=>Mkt(n.id,r.id)},{title:e.formatMessage({id:"ADDRESS"}),dataIndex:"address",showSorterTooltip:!1,sorter:(n,r)=>n.address-r.address},{title:e.formatMessage({id:"SIZE"}),dataIndex:"size",showSorterTooltip:!1,sorter:(n,r)=>n.size-r.size},{title:e.formatMessage({id:"VALUES"}),dataIndex:"values",render:n=>Oe("div",{className:Yde.divValues,children:n.map((r,o)=>Oe("div",{children:n.length===1?r:kn(oMe,{children:["[",o,"]: ",r]})},`${o}${r}`))})}];return Oe("div",{className:Yde.divVariableTableWrapper,children:i.variables.length===0?Oe("div",{className:"emptyHolder",children:e.formatMessage({id:"EMPTY_VATIABLE_TABLE"})}):Oe(gIt,{rowKey:"id",columns:t,dataSource:i.variables,size:"small",pagination:{defaultPageSize:20,pageSizeOptions:[10,20,30,50,100],showSizeChanger:!0,hideOnSinglePage:!0,size:"small"}})})});function SNt(i){switch(i){case Gi.BUSY:return"STATE_BUSY";case Gi.EXITED_ABNORMALLY:return"STATE_EXITED_ABNORMALLY";case Gi.EXITED_NORMALLY:return"STATE_EXITED_NORMALLY";case Gi.FREE:return"STATE_FREE";case Gi.INITIAL:return"STATE_INITIAL";case Gi.MAX_STEP_REACHED:return"STATE_MAX_STEP_REACHED";case Gi.RUNTIME_ERROR:return"STATE_RUNTIME_ERROR";case Gi.STATIC_CHECK_FAILED:return"STATE_STATIC_CHECK_FAILED";case Gi.WAIT_INPUT:return"STATE_WAIT_INPUT"}}const xNt=({vmIndex:i})=>{const e=Cc(),t=yS(),n=Gr(p=>p.vm.vmPageStates[i].state),r=Gr(p=>p.vm.vmPageStates[i].stepCount),o=Gr(p=>p.vm.vmPageStates[i].options),s=Gr(p=>p.vm.vmPageStates[i].memoryUsage),a=Gr(p=>p.vm.vmPageStates[i].peakMemoryUsage),l=Gr(p=>p.vm.vmPageStates[i].globalVariableDetails),c=Gr(p=>p.vm.vmPageStates[i].localVariableDetailsStack),u=Gr(p=>p.vm.vmPageStates[i].localVariableTablesPagination),[d,h]=C.useState(!1),f=C.useRef(null),g=v_.at(i);return kn("div",{ref:f,className:xe(Wi.divVmInspectorWrapper,d&&Wi.divVmInspectorWrapperBoxShadow),onScroll:p=>{p.currentTarget.scrollTop>0&&!d?h(!0):p.currentTarget.scrollTop<=0&&d&&h(!1)},children:[kn("div",{className:Wi.divStepStateCard,children:[kn("div",{className:Wi.divStepStateWrapper,children:[Oe("label",{className:Wi.lblStepStateLabel,children:e.formatMessage({id:"STEP_COUNT"})}),Oe("div",{className:Wi.divStepCount,children:e.formatMessage({id:"STEP_COUNT_NUMBER"},{stepCount:r})})]}),kn("div",{className:Wi.divStepStateWrapper,children:[Oe("label",{className:Wi.lblStepStateLabel,children:e.formatMessage({id:"STATE"})}),Oe("div",{className:xe({[Wi.divStateInitial]:n===Gi.INITIAL,[Wi.divStateBusy]:n===Gi.BUSY,[Wi.divStateWaitInput]:n===Gi.WAIT_INPUT,[Wi.divStateFree]:n===Gi.FREE,[Wi.divStateStaticCheckFailed]:n===Gi.STATIC_CHECK_FAILED,[Wi.divStateRuntimeError]:n===Gi.RUNTIME_ERROR,[Wi.divStateMaxStepReached]:n===Gi.MAX_STEP_REACHED,[Wi.divStateExitedNormally]:n===Gi.EXITED_NORMALLY,[Wi.divStateExitedAbnormally]:n===Gi.EXITED_ABNORMALLY}),children:e.formatMessage({id:SNt(n)})})]})]}),kn("div",{className:Wi.divOptionsCard,children:[kn("div",{className:Wi.divOptionWrapper,children:[kn("label",{className:Wi.lblOption,children:[e.formatMessage({id:"MAX_EXECUTION_STEP_COUNT"}),Oe(NT,{title:e.formatMessage({id:"SET_0_MEANS_NO_STEP_LIMIT"}),children:Oe(dwe,{className:Wi.iconOptionInfo})})]}),Oe(O7,{className:Wi.inOptionValue,disabled:n!==Gi.INITIAL,min:zd.maxExecutionStepCount.min,max:zd.maxExecutionStepCount.max,value:o.maxExecutionStepCount,onChange:p=>{g.configure({maxExecutionStepCount:p??void 0}),t(cp())}})]}),kn("div",{className:Wi.divOptionWrapper,children:[Oe("label",{className:Wi.lblOption,children:e.formatMessage({id:"MEMORY_SIZE"})}),Oe(O7,{className:Wi.inOptionValue,disabled:n!==Gi.INITIAL,min:zd.memorySize.min,max:zd.memorySize.max,value:o.memorySize,onChange:p=>{g.configure({memorySize:p??void 0}),t(cp())}})]}),kn("div",{className:Wi.divOptionWrapper,children:[Oe("label",{className:Wi.lblOption,children:e.formatMessage({id:"STACK_SIZE"})}),Oe(O7,{className:Wi.inOptionValue,disabled:n!==Gi.INITIAL,min:zd.stackSize.min,max:zd.stackSize.max,value:o.stackSize,onChange:p=>{g.configure({stackSize:p??void 0}),t(cp())}})]})]}),kn("div",{className:Wi.divMemoryUsageCard,children:[Oe(G7,{title:e.formatMessage({id:"TOTAL_MEMORY_USAGE"}),usedBytes:s.used,totalBytes:s.total,peakBytes:a.total}),Oe(G7,{title:e.formatMessage({id:"STACK_MEMORY_USAGE"}),usedBytes:s.stackUsed,totalBytes:s.stackTotal,peakBytes:a.stack}),Oe(G7,{title:e.formatMessage({id:"GLOBAL_VARIABLE_MEMORY_USAGE"}),usedBytes:s.globalVariableUsed,totalBytes:s.globalVariableTotal,peakBytes:a.globalVariable})]}),kn("div",{className:Wi.divGlobalVariableTableCard,children:[Oe("label",{className:"title",children:e.formatMessage({id:"GLOBAL_VARIABLE_TABLE"})}),Oe(Zde,{variables:l})]}),kn("div",{className:Wi.divLocalVariableTableCard,children:[Oe("label",{className:"title",children:e.formatMessage({id:"LOCAL_VARIABLE_TABLE"})}),c.length===0?Oe("div",{className:"emptyHolder",children:e.formatMessage({id:"EMPTY_VATIABLE_TABLE"})}):kn("div",{className:Wi.divLocalVariableTableWrapper,children:[c.slice(u.size*(u.currentIndex-1),u.size*u.currentIndex).map(p=>kn("div",{className:Wi.divLocalVariableTable,children:[kn("div",{className:"titleWrapper",children:[Oe("label",{className:"functionName",children:p.functionName}),kn("label",{className:"callStackDepth",children:["(",e.formatMessage({id:"CALL_STACK_DEPTH"},{depth:p.stackDepth}),")"]})]}),Oe(Zde,{variables:p.details})]},`${p.functionName}${p.stackDepth}`)),Oe(kQ,{className:Wi.paginationLocalVariableTable,onChange:(p,v)=>t(pkt({currentIndex:p,size:v})),total:c.length,defaultCurrent:1,defaultPageSize:FQ,pageSizeOptions:[10,20,30,50,100],showSizeChanger:!0,hideOnSinglePage:!0,size:"small"})]})]})]})},LNt=()=>{const i=Cc(),e=yS(),t=Gr(l=>l.vm.vmPageStates.length),n=Gr(l=>l.vm.activeVmIndex),r=Gr(l=>l.vm.vmPageStates.map(c=>c.id),(l,c)=>l.length===c.length&&l.every((u,d)=>u===c[d])),o=Gr(l=>l.vm.vmPageStates.every(c=>!c.isIrChanged)),[s,a]=C.useState(window.innerWidth{window.onresize=()=>a(window.innerWidth{window.onbeforeunload=o?null:l=>(l.preventDefault(),l.returnValue="Your unsaved changes will be lost. Sure to leave?")},[o]),kn("main",{className:oL.main,onDragEnter:l=>l.preventDefault(),onDragOver:l=>l.preventDefault(),onDrop:l=>{for(const c of l.dataTransfer.files)HEe(e,i,c);l.preventDefault()},children:[Oe(Vkt,{vmIndex:n}),kn("div",{className:oL.divRight,children:[Oe(oTt,{}),Oe("div",{className:oL.divVmWrapper,children:t===0?Oe(hTt,{}):new Array(t).fill(null).map((l,c)=>kn("div",{className:xe({[oL.divVmContentHorizontal]:!s,[oL.divVmContentVertical]:s}),style:{display:c===n?"flex":"none"},children:[Oe("section",{className:"sectionIrEditor",children:Oe(mTt,{vmIndex:c})}),Oe("section",{className:"sectionVmConsole",children:Oe(UTt,{vmIndex:c})}),Oe("section",{className:"sectionVmInspector",children:Oe(xNt,{vmIndex:c})})]},r[c]))})]})]})};self.MonacoEnvironment={getWorker(i,e){return e==="json"?new adt:e==="css"||e==="scss"||e==="less"?new ldt:e==="html"||e==="handlebars"||e==="razor"?new cdt:e==="typescript"||e==="javascript"?new udt:new sdt}};n4.config({monaco:odt});n4.init();const ENt=()=>{const i=Gr(t=>t.locale.currentLocale),e=Gr(t=>t.theme.currentClassName);return C.useEffect(()=>{document.body.className=e},[e]),Oe(LFe,{messages:i,locale:"en",children:Oe(LNt,{})})},DNt=GIt({reducer:{locale:Bkt,theme:Hkt,vm:Ckt}});var GK={},INt={get exports(){return GK},set exports(i){GK=i}},nB={},vk={},kNt={get exports(){return vk},set exports(i){vk=i}};(function(i){function e(t){return t&&t.__esModule?t:{default:t}}i.exports=e,i.exports.__esModule=!0,i.exports.default=i.exports})(kNt);var iB={};Object.defineProperty(iB,"__esModule",{value:!0});iB.default=void 0;var TNt={items_per_page:"条/页",jump_to:"跳至",jump_to_confirm:"确定",page:"页",prev_page:"上一页",next_page:"下一页",prev_5:"向前 5 页",next_5:"向后 5 页",prev_3:"向前 3 页",next_3:"向后 3 页",page_size:"页码"};iB.default=TNt;var rB={},$T={},oB={};Object.defineProperty(oB,"__esModule",{value:!0});oB.default=void 0;var NNt={locale:"zh_CN",today:"今天",now:"此刻",backToToday:"返回今天",ok:"确定",timeSelect:"选择时间",dateSelect:"选择日期",weekSelect:"选择周",clear:"清除",month:"月",year:"年",previousMonth:"上个月 (翻页上键)",nextMonth:"下个月 (翻页下键)",monthSelect:"选择月份",yearSelect:"选择年份",decadeSelect:"选择年代",yearFormat:"YYYY年",dayFormat:"D日",dateFormat:"YYYY年M月D日",dateTimeFormat:"YYYY年M月D日 HH时mm分ss秒",previousYear:"上一年 (Control键加左方向键)",nextYear:"下一年 (Control键加右方向键)",previousDecade:"上一年代",nextDecade:"下一年代",previousCentury:"上一世纪",nextCentury:"下一世纪"},RNt=NNt;oB.default=RNt;var HT={};Object.defineProperty(HT,"__esModule",{value:!0});HT.default=void 0;const MNt={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]};var ANt=MNt;HT.default=ANt;var VEe=vk.default;Object.defineProperty($T,"__esModule",{value:!0});$T.default=void 0;var PNt=VEe(oB),ONt=VEe(HT);const zEe={lang:Object.assign({placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"]},PNt.default),timePickerLocale:Object.assign({},ONt.default)};zEe.lang.ok="确定";var FNt=zEe;$T.default=FNt;var BNt=vk.default;Object.defineProperty(rB,"__esModule",{value:!0});rB.default=void 0;var WNt=BNt($T),$Nt=WNt.default;rB.default=$Nt;var sB=vk.default;Object.defineProperty(nB,"__esModule",{value:!0});nB.default=void 0;var HNt=sB(iB),VNt=sB(rB),zNt=sB($T),UNt=sB(HT);const Fc="${label}不是一个有效的${type}",jNt={locale:"zh-cn",Pagination:HNt.default,DatePicker:zNt.default,TimePicker:UNt.default,Calendar:VNt.default,global:{placeholder:"请选择"},Table:{filterTitle:"筛选",filterConfirm:"确定",filterReset:"重置",filterEmptyText:"无筛选项",filterCheckall:"全选",filterSearchPlaceholder:"在筛选项中搜索",selectAll:"全选当页",selectInvert:"反选当页",selectNone:"清空所有",selectionAll:"全选所有",sortTitle:"排序",expand:"展开行",collapse:"关闭行",triggerDesc:"点击降序",triggerAsc:"点击升序",cancelSort:"取消排序"},Modal:{okText:"确定",cancelText:"取消",justOkText:"知道了"},Tour:{Next:"下一步",Previous:"上一步",Finish:"结束导览"},Popconfirm:{cancelText:"取消",okText:"确定"},Transfer:{titles:["",""],searchPlaceholder:"请输入搜索内容",itemUnit:"项",itemsUnit:"项",remove:"删除",selectCurrent:"全选当页",removeCurrent:"删除当页",selectAll:"全选所有",removeAll:"删除全部",selectInvert:"反选当页"},Upload:{uploading:"文件上传中",removeFile:"删除文件",uploadError:"上传错误",previewFile:"预览文件",downloadFile:"下载文件"},Empty:{description:"暂无数据"},Icon:{icon:"图标"},Text:{edit:"编辑",copy:"复制",copied:"复制成功",expand:"展开"},PageHeader:{back:"返回"},Form:{optional:"(可选)",defaultValidateMessages:{default:"字段验证错误${label}",required:"请输入${label}",enum:"${label}必须是其中一个[${enum}]",whitespace:"${label}不能为空字符",date:{format:"${label}日期格式无效",parse:"${label}不能转换为日期",invalid:"${label}是一个无效日期"},types:{string:Fc,method:Fc,array:Fc,object:Fc,number:Fc,date:Fc,boolean:Fc,integer:Fc,float:Fc,regexp:Fc,email:Fc,url:Fc,hex:Fc},string:{len:"${label}须为${len}个字符",min:"${label}最少${min}个字符",max:"${label}最多${max}个字符",range:"${label}须在${min}-${max}字符之间"},number:{len:"${label}必须等于${len}",min:"${label}最小值为${min}",max:"${label}最大值为${max}",range:"${label}须在${min}-${max}之间"},array:{len:"须为${len}个${label}",min:"最少${min}个${label}",max:"最多${max}个${label}",range:"${label}数量须在${min}-${max}之间"},pattern:{mismatch:"${label}与模式不匹配${pattern}"}}},Image:{preview:"预览"},QRCode:{expired:"二维码过期",refresh:"点击刷新"}};var KNt=jNt;nB.default=KNt;(function(i){i.exports=nB})(INt);const GNt=qK(GK);q7.createRoot(document.getElementById("root")).render(Oe($e.StrictMode,{children:Oe(eOe,{store:DNt,children:Oe(LT,{locale:GNt,children:Oe(ENt,{})})})}));export{w3 as m,Pbe as t}; diff --git a/docs/assets/javascript-4363171e.js b/docs/assets/javascript-608a8482.js similarity index 89% rename from docs/assets/javascript-4363171e.js rename to docs/assets/javascript-608a8482.js index 0e408e7..f7cefce 100644 --- a/docs/assets/javascript-4363171e.js +++ b/docs/assets/javascript-608a8482.js @@ -1,4 +1,4 @@ -import{conf as t,language as e}from"./typescript-8089b405.js";import"./index-e4c81506.js";/*!----------------------------------------------------------------------------- +import{conf as t,language as e}from"./typescript-4b89e88c.js";import"./index-7745a004.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/jsonMode-c06ea4cb.js b/docs/assets/jsonMode-b0407c2e.js similarity index 99% rename from docs/assets/jsonMode-c06ea4cb.js rename to docs/assets/jsonMode-b0407c2e.js index be74ae5..df1c8d1 100644 --- a/docs/assets/jsonMode-c06ea4cb.js +++ b/docs/assets/jsonMode-b0407c2e.js @@ -1,4 +1,4 @@ -import{m as et}from"./index-e4c81506.js";/*!----------------------------------------------------------------------------- +import{m as et}from"./index-7745a004.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/liquid-87315f86.js b/docs/assets/liquid-3fca3ef0.js similarity index 98% rename from docs/assets/liquid-87315f86.js rename to docs/assets/liquid-3fca3ef0.js index 7a575c9..493c741 100644 --- a/docs/assets/liquid-87315f86.js +++ b/docs/assets/liquid-3fca3ef0.js @@ -1,4 +1,4 @@ -import{m as d}from"./index-e4c81506.js";/*!----------------------------------------------------------------------------- +import{m as d}from"./index-7745a004.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/mdx-0ce00991.js b/docs/assets/mdx-f7a52d23.js similarity index 98% rename from docs/assets/mdx-0ce00991.js rename to docs/assets/mdx-f7a52d23.js index 07e977c..77fc178 100644 --- a/docs/assets/mdx-0ce00991.js +++ b/docs/assets/mdx-f7a52d23.js @@ -1,4 +1,4 @@ -import{m as d}from"./index-e4c81506.js";/*!----------------------------------------------------------------------------- +import{m as d}from"./index-7745a004.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/python-54b0304d.js b/docs/assets/python-b8459894.js similarity index 98% rename from docs/assets/python-54b0304d.js rename to docs/assets/python-b8459894.js index a555ce1..eb37200 100644 --- a/docs/assets/python-54b0304d.js +++ b/docs/assets/python-b8459894.js @@ -1,4 +1,4 @@ -import{m as a}from"./index-e4c81506.js";/*!----------------------------------------------------------------------------- +import{m as a}from"./index-7745a004.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/razor-93d55a7c.js b/docs/assets/razor-0763a92b.js similarity index 99% rename from docs/assets/razor-93d55a7c.js rename to docs/assets/razor-0763a92b.js index 8a12b65..55cea1b 100644 --- a/docs/assets/razor-93d55a7c.js +++ b/docs/assets/razor-0763a92b.js @@ -1,4 +1,4 @@ -import{m as s}from"./index-e4c81506.js";/*!----------------------------------------------------------------------------- +import{m as s}from"./index-7745a004.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/tsMode-15682ab2.js b/docs/assets/tsMode-74a44fcf.js similarity index 99% rename from docs/assets/tsMode-15682ab2.js rename to docs/assets/tsMode-74a44fcf.js index f61abe1..6cb703d 100644 --- a/docs/assets/tsMode-15682ab2.js +++ b/docs/assets/tsMode-74a44fcf.js @@ -1,4 +1,4 @@ -import{t as I,m as N}from"./index-e4c81506.js";/*!----------------------------------------------------------------------------- +import{t as I,m as N}from"./index-7745a004.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/typescript-8089b405.js b/docs/assets/typescript-4b89e88c.js similarity index 98% rename from docs/assets/typescript-8089b405.js rename to docs/assets/typescript-4b89e88c.js index a59ef47..8c58c47 100644 --- a/docs/assets/typescript-8089b405.js +++ b/docs/assets/typescript-4b89e88c.js @@ -1,4 +1,4 @@ -import{m as a}from"./index-e4c81506.js";/*!----------------------------------------------------------------------------- +import{m as a}from"./index-7745a004.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/xml-978d1915.js b/docs/assets/xml-968dcc32.js similarity index 97% rename from docs/assets/xml-978d1915.js rename to docs/assets/xml-968dcc32.js index a19ff6c..520d3b8 100644 --- a/docs/assets/xml-978d1915.js +++ b/docs/assets/xml-968dcc32.js @@ -1,4 +1,4 @@ -import{m}from"./index-e4c81506.js";/*!----------------------------------------------------------------------------- +import{m}from"./index-7745a004.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/yaml-74f5320e.js b/docs/assets/yaml-8a69e9dd.js similarity index 98% rename from docs/assets/yaml-74f5320e.js rename to docs/assets/yaml-8a69e9dd.js index 07df1f1..2ef1e1f 100644 --- a/docs/assets/yaml-74f5320e.js +++ b/docs/assets/yaml-8a69e9dd.js @@ -1,4 +1,4 @@ -import{m as i}from"./index-e4c81506.js";/*!----------------------------------------------------------------------------- +import{m as i}from"./index-7745a004.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/index.html b/docs/index.html index eb293e6..5beb833 100644 --- a/docs/index.html +++ b/docs/index.html @@ -10,7 +10,7 @@ rel="stylesheet" /> IR虚拟机 - +