tianxincode 1.0.13 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/filesystem.routes.js +13 -4
- package/dist/api/filesystem.routes.js.map +1 -1
- package/dist/components/App.backup.d.ts +34 -0
- package/dist/components/App.backup.d.ts.map +1 -0
- package/dist/components/App.backup.js +692 -0
- package/dist/components/App.backup.js.map +1 -0
- package/dist/components/App.d.ts +33 -24
- package/dist/components/App.d.ts.map +1 -1
- package/dist/components/App.js +182 -718
- package/dist/components/App.js.map +1 -1
- package/dist/components/FileSelector.d.ts +47 -0
- package/dist/components/FileSelector.d.ts.map +1 -0
- package/dist/components/FileSelector.js +40 -0
- package/dist/components/FileSelector.js.map +1 -0
- package/dist/components/Header.d.ts +3 -0
- package/dist/components/Header.d.ts.map +1 -0
- package/dist/components/Header.js +17 -0
- package/dist/components/Header.js.map +1 -0
- package/dist/components/InputArea.d.ts +50 -0
- package/dist/components/InputArea.d.ts.map +1 -0
- package/dist/components/InputArea.js +52 -0
- package/dist/components/InputArea.js.map +1 -0
- package/dist/components/MainContent.d.ts +11 -0
- package/dist/components/MainContent.d.ts.map +1 -0
- package/dist/components/MainContent.js +118 -0
- package/dist/components/MainContent.js.map +1 -0
- package/dist/components/MessageList.d.ts +11 -0
- package/dist/components/MessageList.d.ts.map +1 -0
- package/dist/components/MessageList.js +129 -0
- package/dist/components/MessageList.js.map +1 -0
- package/dist/components/ModelSelector.d.ts +42 -0
- package/dist/components/ModelSelector.d.ts.map +1 -0
- package/dist/components/ModelSelector.js +36 -0
- package/dist/components/ModelSelector.js.map +1 -0
- package/dist/components/StatusBar.d.ts +14 -0
- package/dist/components/StatusBar.d.ts.map +1 -0
- package/dist/components/StatusBar.js +21 -0
- package/dist/components/StatusBar.js.map +1 -0
- package/dist/components/hooks/useChat.d.ts +69 -0
- package/dist/components/hooks/useChat.d.ts.map +1 -0
- package/dist/components/hooks/useChat.js +270 -0
- package/dist/components/hooks/useChat.js.map +1 -0
- package/dist/components/hooks/useFileSelect.d.ts +58 -0
- package/dist/components/hooks/useFileSelect.d.ts.map +1 -0
- package/dist/components/hooks/useFileSelect.js +182 -0
- package/dist/components/hooks/useFileSelect.js.map +1 -0
- package/dist/components/hooks/useModelSelect.d.ts +54 -0
- package/dist/components/hooks/useModelSelect.d.ts.map +1 -0
- package/dist/components/hooks/useModelSelect.js +137 -0
- package/dist/components/hooks/useModelSelect.js.map +1 -0
- package/dist/components/useInputHandler.d.ts +33 -0
- package/dist/components/useInputHandler.d.ts.map +1 -0
- package/dist/components/useInputHandler.js +130 -0
- package/dist/components/useInputHandler.js.map +1 -0
- package/dist/hooks/useAlternateBuffer.d.ts +14 -0
- package/dist/hooks/useAlternateBuffer.d.ts.map +1 -0
- package/dist/hooks/useAlternateBuffer.js +20 -0
- package/dist/hooks/useAlternateBuffer.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/package.json +7 -5
- package/scripts/ink-scroll-demo.tsx +147 -0
- package/web/dist/assets/{AiLogsView-D_SQ6qo4.js → AiLogsView-rdisKFSa.js} +1 -1
- package/web/dist/assets/{DevWorkflowView-iHAv9LC0.js → DevWorkflowView-CV7LEFE2.js} +5 -5
- package/web/dist/assets/DevWorkflowView-D_iXemzz.css +1 -0
- package/web/dist/assets/{Layout-CQhbIJxB.js → Layout-WWXhjQI7.js} +1 -1
- package/web/dist/assets/{TasksView-B9B2H3-S.js → TasksView-vUyC5Nlz.js} +1 -1
- package/web/dist/assets/{TerminalView-BKhdi5UF.js → TerminalView-qS_Sznel.js} +1 -1
- package/web/dist/assets/{cssMode-C_gwipb0.js → cssMode-CJFHsxhF.js} +1 -1
- package/web/dist/assets/{freemarker2-WCA_pR0J.js → freemarker2-GCZND4I7.js} +1 -1
- package/web/dist/assets/{handlebars-fzVGzXHj.js → handlebars-IPke9hyC.js} +1 -1
- package/web/dist/assets/{html-C4Rga6DD.js → html-Dl_nDKmC.js} +1 -1
- package/web/dist/assets/{htmlMode-BvrJ57rW.js → htmlMode-DpdrVNft.js} +1 -1
- package/web/dist/assets/{index-9RP8PAfk.js → index-TrZtH1m_.js} +13 -13
- package/web/dist/assets/{javascript-cXKyuP98.js → javascript-DHT2J-uS.js} +1 -1
- package/web/dist/assets/{jsonMode-Q4CMzwiX.js → jsonMode-BeJp-o3r.js} +1 -1
- package/web/dist/assets/{liquid-CrbU0gmK.js → liquid-C5FLdOvv.js} +1 -1
- package/web/dist/assets/{mdx-D72Dcs66.js → mdx-CZwiqZoo.js} +1 -1
- package/web/dist/assets/{python-DPqkZ_Xm.js → python-D5pMpjh7.js} +1 -1
- package/web/dist/assets/{razor-DknXaqXN.js → razor-Ba49D4hB.js} +1 -1
- package/web/dist/assets/{tsMode-DZAV3Wgo.js → tsMode-vBfGu0Qc.js} +1 -1
- package/web/dist/assets/{typescript-DenKTmW3.js → typescript-NOD0JyOl.js} +1 -1
- package/web/dist/assets/{xml-C_uqJta0.js → xml-CJKugy72.js} +1 -1
- package/web/dist/assets/{yaml-vwb3U7d7.js → yaml-CEjcQv6-.js} +1 -1
- package/web/dist/index.html +1 -1
- package/web/dist/assets/DevWorkflowView-C5VnPngb.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/javascript-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/javascript-DHT2J-uS.js","assets/typescript-NOD0JyOl.js","assets/TerminalView-qS_Sznel.js","assets/TerminalView-BU5wZZv4.css","assets/DevWorkflowView-CV7LEFE2.js","assets/DevWorkflowView-D_iXemzz.css"])))=>i.map(i=>d[i]);
|
|
2
2
|
var eDe=Object.defineProperty;var tDe=(s,e,t)=>e in s?eDe(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var di=(s,e,t)=>tDe(s,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))i(n);new MutationObserver(n=>{for(const r of n)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(n){const r={};return n.integrity&&(r.integrity=n.integrity),n.referrerPolicy&&(r.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?r.credentials="include":n.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(n){if(n.ep)return;n.ep=!0;const r=t(n);fetch(n.href,r)}})();var iDe={};/*!
|
|
3
3
|
* Vue.js v2.7.16
|
|
4
4
|
* (c) 2014-2023 Evan You
|
|
@@ -139,7 +139,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
139
139
|
* vue-router v3.6.5
|
|
140
140
|
* (c) 2022 Evan You
|
|
141
141
|
* @license MIT
|
|
142
|
-
*/function bu(s,e){for(var t in e)s[t]=e[t];return s}var sOe=/[!'()*]/g,rOe=function(s){return"%"+s.charCodeAt(0).toString(16)},oOe=/%2C/g,p1=function(s){return encodeURIComponent(s).replace(sOe,rOe).replace(oOe,",")};function uU(s){try{return decodeURIComponent(s)}catch{}return s}function aOe(s,e,t){e===void 0&&(e={});var i=t||lOe,n;try{n=i(s||"")}catch{n={}}for(var r in e){var o=e[r];n[r]=Array.isArray(o)?o.map(kle):kle(o)}return n}var kle=function(s){return s==null||typeof s=="object"?s:String(s)};function lOe(s){var e={};return s=s.trim().replace(/^(\?|#|&)/,""),s&&s.split("&").forEach(function(t){var i=t.replace(/\+/g," ").split("="),n=uU(i.shift()),r=i.length>0?uU(i.join("=")):null;e[n]===void 0?e[n]=r:Array.isArray(e[n])?e[n].push(r):e[n]=[e[n],r]}),e}function cOe(s){var e=s?Object.keys(s).map(function(t){var i=s[t];if(i===void 0)return"";if(i===null)return p1(t);if(Array.isArray(i)){var n=[];return i.forEach(function(r){r!==void 0&&(r===null?n.push(p1(t)):n.push(p1(t)+"="+p1(r)))}),n.join("&")}return p1(t)+"="+p1(i)}).filter(function(t){return t.length>0}).join("&"):null;return e?"?"+e:""}var UF=/\/?$/;function qF(s,e,t,i){var n=i&&i.options.stringifyQuery,r=e.query||{};try{r=hU(r)}catch{}var o={name:e.name||s&&s.name,meta:s&&s.meta||{},path:e.path||"/",hash:e.hash||"",query:r,params:e.params||{},fullPath:Lle(e,n),matched:s?dOe(s):[]};return t&&(o.redirectedFrom=Lle(t,n)),Object.freeze(o)}function hU(s){if(Array.isArray(s))return s.map(hU);if(s&&typeof s=="object"){var e={};for(var t in s)e[t]=hU(s[t]);return e}else return s}var S_=qF(null,{path:"/"});function dOe(s){for(var e=[];s;)e.unshift(s),s=s.parent;return e}function Lle(s,e){var t=s.path,i=s.query;i===void 0&&(i={});var n=s.hash;n===void 0&&(n="");var r=e||cOe;return(t||"/")+r(i)+n}function w_e(s,e,t){return e===S_?s===e:e?s.path&&e.path?s.path.replace(UF,"")===e.path.replace(UF,"")&&(t||s.hash===e.hash&&A2(s.query,e.query)):s.name&&e.name?s.name===e.name&&(t||s.hash===e.hash&&A2(s.query,e.query)&&A2(s.params,e.params)):!1:!1}function A2(s,e){if(s===void 0&&(s={}),e===void 0&&(e={}),!s||!e)return s===e;var t=Object.keys(s).sort(),i=Object.keys(e).sort();return t.length!==i.length?!1:t.every(function(n,r){var o=s[n],a=i[r];if(a!==n)return!1;var l=e[n];return o==null||l==null?o===l:typeof o=="object"&&typeof l=="object"?A2(o,l):String(o)===String(l)})}function uOe(s,e){return s.path.replace(UF,"/").indexOf(e.path.replace(UF,"/"))===0&&(!e.hash||s.hash===e.hash)&&hOe(s.query,e.query)}function hOe(s,e){for(var t in e)if(!(t in s))return!1;return!0}function S_e(s){for(var e=0;e<s.matched.length;e++){var t=s.matched[e];for(var i in t.instances){var n=t.instances[i],r=t.enteredCbs[i];if(!(!n||!r)){delete t.enteredCbs[i];for(var o=0;o<r.length;o++)n._isBeingDestroyed||r[o](n)}}}}var fOe={name:"RouterView",functional:!0,props:{name:{type:String,default:"default"}},render:function(e,t){var i=t.props,n=t.children,r=t.parent,o=t.data;o.routerView=!0;for(var a=r.$createElement,l=i.name,d=r.$route,h=r._routerViewCache||(r._routerViewCache={}),f=0,p=!1;r&&r._routerRoot!==r;){var m=r.$vnode?r.$vnode.data:{};m.routerView&&f++,m.keepAlive&&r._directInactive&&r._inactive&&(p=!0),r=r.$parent}if(o.routerViewDepth=f,p){var v=h[l],b=v&&v.component;return b?(v.configProps&&Dle(b,o,v.route,v.configProps),a(b,o,n)):a()}var y=d.matched[f],x=y&&y.components[l];if(!y||!x)return h[l]=null,a();h[l]={component:x},o.registerRouteInstance=function(S,E){var I=y.instances[l];(E&&I!==S||!E&&I===S)&&(y.instances[l]=E)},(o.hook||(o.hook={})).prepatch=function(S,E){y.instances[l]=E.componentInstance},o.hook.init=function(S){S.data.keepAlive&&S.componentInstance&&S.componentInstance!==y.instances[l]&&(y.instances[l]=S.componentInstance),S_e(d)};var D=y.props&&y.props[l];return D&&(bu(h[l],{route:d,configProps:D}),Dle(x,o,d,D)),a(x,o,n)}};function Dle(s,e,t,i){var n=e.props=gOe(t,i);if(n){n=e.props=bu({},n);var r=e.attrs=e.attrs||{};for(var o in n)(!s.props||!(o in s.props))&&(r[o]=n[o],delete n[o])}}function gOe(s,e){switch(typeof e){case"undefined":return;case"object":return e;case"function":return e(s);case"boolean":return e?s.params:void 0}}function x_e(s,e,t){var i=s.charAt(0);if(i==="/")return s;if(i==="?"||i==="#")return e+s;var n=e.split("/");(!t||!n[n.length-1])&&n.pop();for(var r=s.replace(/^\//,"").split("/"),o=0;o<r.length;o++){var a=r[o];a===".."?n.pop():a!=="."&&n.push(a)}return n[0]!==""&&n.unshift(""),n.join("/")}function pOe(s){var e="",t="",i=s.indexOf("#");i>=0&&(e=s.slice(i),s=s.slice(0,i));var n=s.indexOf("?");return n>=0&&(t=s.slice(n+1),s=s.slice(0,n)),{path:s,query:t,hash:e}}function ym(s){return s.replace(/\/(?:\s*\/)+/g,"/")}var KF=Array.isArray||function(s){return Object.prototype.toString.call(s)=="[object Array]"},yx=D_e,mOe=$J,_Oe=yOe,vOe=k_e,bOe=L_e,COe=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function $J(s,e){for(var t=[],i=0,n=0,r="",o=e&&e.delimiter||"/",a;(a=COe.exec(s))!=null;){var l=a[0],d=a[1],h=a.index;if(r+=s.slice(n,h),n=h+l.length,d){r+=d[1];continue}var f=s[n],p=a[2],m=a[3],v=a[4],b=a[5],y=a[6],x=a[7];r&&(t.push(r),r="");var D=p!=null&&f!=null&&f!==p,S=y==="+"||y==="*",E=y==="?"||y==="*",I=a[2]||o,R=v||b;t.push({name:m||i++,prefix:p||"",delimiter:I,optional:E,repeat:S,partial:D,asterisk:!!x,pattern:R?xOe(R):x?".*":"[^"+F2(I)+"]+?"})}return n<s.length&&(r+=s.substr(n)),r&&t.push(r),t}function yOe(s,e){return k_e($J(s,e),e)}function wOe(s){return encodeURI(s).replace(/[\/?#]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function SOe(s){return encodeURI(s).replace(/[?#]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function k_e(s,e){for(var t=new Array(s.length),i=0;i<s.length;i++)typeof s[i]=="object"&&(t[i]=new RegExp("^(?:"+s[i].pattern+")$",jJ(e)));return function(n,r){for(var o="",a=n||{},l=r||{},d=l.pretty?wOe:encodeURIComponent,h=0;h<s.length;h++){var f=s[h];if(typeof f=="string"){o+=f;continue}var p=a[f.name],m;if(p==null)if(f.optional){f.partial&&(o+=f.prefix);continue}else throw new TypeError('Expected "'+f.name+'" to be defined');if(KF(p)){if(!f.repeat)throw new TypeError('Expected "'+f.name+'" to not repeat, but received `'+JSON.stringify(p)+"`");if(p.length===0){if(f.optional)continue;throw new TypeError('Expected "'+f.name+'" to not be empty')}for(var v=0;v<p.length;v++){if(m=d(p[v]),!t[h].test(m))throw new TypeError('Expected all "'+f.name+'" to match "'+f.pattern+'", but received `'+JSON.stringify(m)+"`");o+=(v===0?f.prefix:f.delimiter)+m}continue}if(m=f.asterisk?SOe(p):d(p),!t[h].test(m))throw new TypeError('Expected "'+f.name+'" to match "'+f.pattern+'", but received "'+m+'"');o+=f.prefix+m}return o}}function F2(s){return s.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function xOe(s){return s.replace(/([=!:$\/()])/g,"\\$1")}function zJ(s,e){return s.keys=e,s}function jJ(s){return s&&s.sensitive?"":"i"}function kOe(s,e){var t=s.source.match(/\((?!\?)/g);if(t)for(var i=0;i<t.length;i++)e.push({name:i,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return zJ(s,e)}function LOe(s,e,t){for(var i=[],n=0;n<s.length;n++)i.push(D_e(s[n],e,t).source);var r=new RegExp("(?:"+i.join("|")+")",jJ(t));return zJ(r,e)}function DOe(s,e,t){return L_e($J(s,t),e,t)}function L_e(s,e,t){KF(e)||(t=e||t,e=[]),t=t||{};for(var i=t.strict,n=t.end!==!1,r="",o=0;o<s.length;o++){var a=s[o];if(typeof a=="string")r+=F2(a);else{var l=F2(a.prefix),d="(?:"+a.pattern+")";e.push(a),a.repeat&&(d+="(?:"+l+d+")*"),a.optional?a.partial?d=l+"("+d+")?":d="(?:"+l+"("+d+"))?":d=l+"("+d+")",r+=d}}var h=F2(t.delimiter||"/"),f=r.slice(-h.length)===h;return i||(r=(f?r.slice(0,-h.length):r)+"(?:"+h+"(?=$))?"),n?r+="$":r+=i&&f?"":"(?="+h+"|$)",zJ(new RegExp("^"+r,jJ(t)),e)}function D_e(s,e,t){return KF(e)||(t=e||t,e=[]),t=t||{},s instanceof RegExp?kOe(s,e):KF(s)?LOe(s,e,t):DOe(s,e,t)}yx.parse=mOe;yx.compile=_Oe;yx.tokensToFunction=vOe;yx.tokensToRegExp=bOe;var Ele=Object.create(null);function B2(s,e,t){e=e||{};try{var i=Ele[s]||(Ele[s]=yx.compile(s));return typeof e.pathMatch=="string"&&(e[0]=e.pathMatch),i(e,{pretty:!0})}catch{return""}finally{delete e[0]}}function UJ(s,e,t,i){var n=typeof s=="string"?{path:s}:s;if(n._normalized)return n;if(n.name){n=bu({},s);var r=n.params;return r&&typeof r=="object"&&(n.params=bu({},r)),n}if(!n.path&&n.params&&e){n=bu({},n),n._normalized=!0;var o=bu(bu({},e.params),n.params);if(e.name)n.name=e.name,n.params=o;else if(e.matched.length){var a=e.matched[e.matched.length-1].path;n.path=B2(a,o,"path "+e.path)}return n}var l=pOe(n.path||""),d=e&&e.path||"/",h=l.path?x_e(l.path,d,t||n.append):d,f=aOe(l.query,n.query,i&&i.options.parseQuery),p=n.hash||l.hash;return p&&p.charAt(0)!=="#"&&(p="#"+p),{_normalized:!0,path:h,query:f,hash:p}}var EOe=[String,Object],IOe=[String,Array],Ile=function(){},TOe={name:"RouterLink",props:{to:{type:EOe,required:!0},tag:{type:String,default:"a"},custom:Boolean,exact:Boolean,exactPath:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,ariaCurrentValue:{type:String,default:"page"},event:{type:IOe,default:"click"}},render:function(e){var t=this,i=this.$router,n=this.$route,r=i.resolve(this.to,n,this.append),o=r.location,a=r.route,l=r.href,d={},h=i.options.linkActiveClass,f=i.options.linkExactActiveClass,p=h??"router-link-active",m=f??"router-link-exact-active",v=this.activeClass==null?p:this.activeClass,b=this.exactActiveClass==null?m:this.exactActiveClass,y=a.redirectedFrom?qF(null,UJ(a.redirectedFrom),null,i):a;d[b]=w_e(n,y,this.exactPath),d[v]=this.exact||this.exactPath?d[b]:uOe(n,y);var x=d[b]?this.ariaCurrentValue:null,D=function(z){Tle(z)&&(t.replace?i.replace(o,Ile):i.push(o,Ile))},S={click:Tle};Array.isArray(this.event)?this.event.forEach(function(z){S[z]=D}):S[this.event]=D;var E={class:d},I=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:l,route:a,navigate:D,isActive:d[v],isExactActive:d[b]});if(I){if(I.length===1)return I[0];if(I.length>1||!I.length)return I.length===0?e():e("span",{},I)}if(this.tag==="a")E.on=S,E.attrs={href:l,"aria-current":x};else{var R=E_e(this.$slots.default);if(R){R.isStatic=!1;var M=R.data=bu({},R.data);M.on=M.on||{};for(var O in M.on){var H=M.on[O];O in S&&(M.on[O]=Array.isArray(H)?H:[H])}for(var te in S)te in M.on?M.on[te].push(S[te]):M.on[te]=D;var J=R.data.attrs=bu({},R.data.attrs);J.href=l,J["aria-current"]=x}else E.on=S}return e(this.tag,E,this.$slots.default)}};function Tle(s){if(!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)&&!s.defaultPrevented&&!(s.button!==void 0&&s.button!==0)){if(s.currentTarget&&s.currentTarget.getAttribute){var e=s.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return s.preventDefault&&s.preventDefault(),!0}}function E_e(s){if(s){for(var e,t=0;t<s.length;t++)if(e=s[t],e.tag==="a"||e.children&&(e=E_e(e.children)))return e}}var GF;function fU(s){if(!(fU.installed&&GF===s)){fU.installed=!0,GF=s;var e=function(n){return n!==void 0},t=function(n,r){var o=n.$options._parentVnode;e(o)&&e(o=o.data)&&e(o=o.registerRouteInstance)&&o(n,r)};s.mixin({beforeCreate:function(){e(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),s.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,t(this,this)},destroyed:function(){t(this)}}),Object.defineProperty(s.prototype,"$router",{get:function(){return this._routerRoot._router}}),Object.defineProperty(s.prototype,"$route",{get:function(){return this._routerRoot._route}}),s.component("RouterView",fOe),s.component("RouterLink",TOe);var i=s.config.optionMergeStrategies;i.beforeRouteEnter=i.beforeRouteLeave=i.beforeRouteUpdate=i.created}}var sN=typeof window<"u";function fA(s,e,t,i,n){var r=e||[],o=t||Object.create(null),a=i||Object.create(null);s.forEach(function(h){gU(r,o,a,h,n)});for(var l=0,d=r.length;l<d;l++)r[l]==="*"&&(r.push(r.splice(l,1)[0]),d--,l--);return{pathList:r,pathMap:o,nameMap:a}}function gU(s,e,t,i,n,r){var o=i.path,a=i.name,l=i.pathToRegexpOptions||{},d=MOe(o,n,l.strict);typeof i.caseSensitive=="boolean"&&(l.sensitive=i.caseSensitive);var h={path:d,regex:NOe(d,l),components:i.components||{default:i.component},alias:i.alias?typeof i.alias=="string"?[i.alias]:i.alias:[],instances:{},enteredCbs:{},name:a,parent:n,matchAs:r,redirect:i.redirect,beforeEnter:i.beforeEnter,meta:i.meta||{},props:i.props==null?{}:i.components?i.props:{default:i.props}};if(i.children&&i.children.forEach(function(b){var y=r?ym(r+"/"+b.path):void 0;gU(s,e,t,b,h,y)}),e[h.path]||(s.push(h.path),e[h.path]=h),i.alias!==void 0)for(var f=Array.isArray(i.alias)?i.alias:[i.alias],p=0;p<f.length;++p){var m=f[p],v={path:m,children:i.children};gU(s,e,t,v,n,h.path||"/")}a&&(t[a]||(t[a]=h))}function NOe(s,e){var t=yx(s,[],e);return t}function MOe(s,e,t){return t||(s=s.replace(/\/$/,"")),s[0]==="/"||e==null?s:ym(e.path+"/"+s)}function ROe(s,e){var t=fA(s),i=t.pathList,n=t.pathMap,r=t.nameMap;function o(m){fA(m,i,n,r)}function a(m,v){var b=typeof m!="object"?r[m]:void 0;fA([v||m],i,n,r,b),b&&b.alias.length&&fA(b.alias.map(function(y){return{path:y,children:[v]}}),i,n,r,b)}function l(){return i.map(function(m){return n[m]})}function d(m,v,b){var y=UJ(m,v,!1,e),x=y.name;if(x){var D=r[x];if(!D)return p(null,y);var S=D.regex.keys.filter(function(O){return!O.optional}).map(function(O){return O.name});if(typeof y.params!="object"&&(y.params={}),v&&typeof v.params=="object")for(var E in v.params)!(E in y.params)&&S.indexOf(E)>-1&&(y.params[E]=v.params[E]);return y.path=B2(D.path,y.params),p(D,y,b)}else if(y.path){y.params={};for(var I=0;I<i.length;I++){var R=i[I],M=n[R];if(POe(M.regex,y.path,y.params))return p(M,y,b)}}return p(null,y)}function h(m,v){var b=m.redirect,y=typeof b=="function"?b(qF(m,v,null,e)):b;if(typeof y=="string"&&(y={path:y}),!y||typeof y!="object")return p(null,v);var x=y,D=x.name,S=x.path,E=v.query,I=v.hash,R=v.params;if(E=x.hasOwnProperty("query")?x.query:E,I=x.hasOwnProperty("hash")?x.hash:I,R=x.hasOwnProperty("params")?x.params:R,D)return r[D],d({_normalized:!0,name:D,query:E,hash:I,params:R},void 0,v);if(S){var M=OOe(S,m),O=B2(M,R);return d({_normalized:!0,path:O,query:E,hash:I},void 0,v)}else return p(null,v)}function f(m,v,b){var y=B2(b,v.params),x=d({_normalized:!0,path:y});if(x){var D=x.matched,S=D[D.length-1];return v.params=x.params,p(S,v)}return p(null,v)}function p(m,v,b){return m&&m.redirect?h(m,b||v):m&&m.matchAs?f(m,v,m.matchAs):qF(m,v,b,e)}return{match:d,addRoute:a,getRoutes:l,addRoutes:o}}function POe(s,e,t){var i=e.match(s);if(i){if(!t)return!0}else return!1;for(var n=1,r=i.length;n<r;++n){var o=s.keys[n-1];o&&(t[o.name||"pathMatch"]=typeof i[n]=="string"?uU(i[n]):i[n])}return!0}function OOe(s,e){return x_e(s,e.parent?e.parent.path:"/",!0)}var AOe=sN&&window.performance&&window.performance.now?window.performance:Date;function I_e(){return AOe.now().toFixed(3)}var T_e=I_e();function nH(){return T_e}function N_e(s){return T_e=s}var M_e=Object.create(null);function R_e(){"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual");var s=window.location.protocol+"//"+window.location.host,e=window.location.href.replace(s,""),t=bu({},window.history.state);return t.key=nH(),window.history.replaceState(t,"",e),window.addEventListener("popstate",Nle),function(){window.removeEventListener("popstate",Nle)}}function wm(s,e,t,i){if(s.app){var n=s.options.scrollBehavior;n&&s.app.$nextTick(function(){var r=FOe(),o=n.call(s,e,t,i?r:null);o&&(typeof o.then=="function"?o.then(function(a){Ple(a,r)}).catch(function(a){}):Ple(o,r))})}}function P_e(){var s=nH();s&&(M_e[s]={x:window.pageXOffset,y:window.pageYOffset})}function Nle(s){P_e(),s.state&&s.state.key&&N_e(s.state.key)}function FOe(){var s=nH();if(s)return M_e[s]}function BOe(s,e){var t=document.documentElement,i=t.getBoundingClientRect(),n=s.getBoundingClientRect();return{x:n.left-i.left-e.x,y:n.top-i.top-e.y}}function Mle(s){return kS(s.x)||kS(s.y)}function Rle(s){return{x:kS(s.x)?s.x:window.pageXOffset,y:kS(s.y)?s.y:window.pageYOffset}}function WOe(s){return{x:kS(s.x)?s.x:0,y:kS(s.y)?s.y:0}}function kS(s){return typeof s=="number"}var HOe=/^#\d/;function Ple(s,e){var t=typeof s=="object";if(t&&typeof s.selector=="string"){var i=HOe.test(s.selector)?document.getElementById(s.selector.slice(1)):document.querySelector(s.selector);if(i){var n=s.offset&&typeof s.offset=="object"?s.offset:{};n=WOe(n),e=BOe(i,n)}else Mle(s)&&(e=Rle(s))}else t&&Mle(s)&&(e=Rle(s));e&&("scrollBehavior"in document.documentElement.style?window.scrollTo({left:e.x,top:e.y,behavior:s.behavior}):window.scrollTo(e.x,e.y))}var Sm=sN&&function(){var s=window.navigator.userAgent;return(s.indexOf("Android 2.")!==-1||s.indexOf("Android 4.0")!==-1)&&s.indexOf("Mobile Safari")!==-1&&s.indexOf("Chrome")===-1&&s.indexOf("Windows Phone")===-1?!1:window.history&&typeof window.history.pushState=="function"}();function YF(s,e){P_e();var t=window.history;try{if(e){var i=bu({},t.state);i.key=nH(),t.replaceState(i,"",s)}else t.pushState({key:N_e(I_e())},"",s)}catch{window.location[e?"replace":"assign"](s)}}function pU(s){YF(s,!0)}var Ly={redirected:2,aborted:4,cancelled:8,duplicated:16};function VOe(s,e){return sH(s,e,Ly.redirected,'Redirected when going from "'+s.fullPath+'" to "'+UOe(e)+'" via a navigation guard.')}function $Oe(s,e){var t=sH(s,e,Ly.duplicated,'Avoided redundant navigation to current location: "'+s.fullPath+'".');return t.name="NavigationDuplicated",t}function Ole(s,e){return sH(s,e,Ly.cancelled,'Navigation cancelled from "'+s.fullPath+'" to "'+e.fullPath+'" with a new navigation.')}function zOe(s,e){return sH(s,e,Ly.aborted,'Navigation aborted from "'+s.fullPath+'" to "'+e.fullPath+'" via a navigation guard.')}function sH(s,e,t,i){var n=new Error(i);return n._isRouter=!0,n.from=s,n.to=e,n.type=t,n}var jOe=["params","query","hash"];function UOe(s){if(typeof s=="string")return s;if("path"in s)return s.path;var e={};return jOe.forEach(function(t){t in s&&(e[t]=s[t])}),JSON.stringify(e,null,2)}function ZF(s){return Object.prototype.toString.call(s).indexOf("Error")>-1}function rH(s,e){return ZF(s)&&s._isRouter&&(e==null||s.type===e)}function Ale(s,e,t){var i=function(n){n>=s.length?t():s[n]?e(s[n],function(){i(n+1)}):i(n+1)};i(0)}function qOe(s){return function(e,t,i){var n=!1,r=0,o=null;O_e(s,function(a,l,d,h){if(typeof a=="function"&&a.cid===void 0){n=!0,r++;var f=Fle(function(b){GOe(b)&&(b=b.default),a.resolved=typeof b=="function"?b:GF.extend(b),d.components[h]=b,r--,r<=0&&i()}),p=Fle(function(b){var y="Failed to resolve async component "+h+": "+b;o||(o=ZF(b)?b:new Error(y),i(o))}),m;try{m=a(f,p)}catch(b){p(b)}if(m)if(typeof m.then=="function")m.then(f,p);else{var v=m.component;v&&typeof v.then=="function"&&v.then(f,p)}}}),n||i()}}function O_e(s,e){return A_e(s.map(function(t){return Object.keys(t.components).map(function(i){return e(t.components[i],t.instances[i],t,i)})}))}function A_e(s){return Array.prototype.concat.apply([],s)}var KOe=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function GOe(s){return s.__esModule||KOe&&s[Symbol.toStringTag]==="Module"}function Fle(s){var e=!1;return function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];if(!e)return e=!0,s.apply(this,t)}}var $u=function(e,t){this.router=e,this.base=YOe(t),this.current=S_,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};$u.prototype.listen=function(e){this.cb=e};$u.prototype.onReady=function(e,t){this.ready?e():(this.readyCbs.push(e),t&&this.readyErrorCbs.push(t))};$u.prototype.onError=function(e){this.errorCbs.push(e)};$u.prototype.transitionTo=function(e,t,i){var n=this,r;try{r=this.router.match(e,this.current)}catch(a){throw this.errorCbs.forEach(function(l){l(a)}),a}var o=this.current;this.confirmTransition(r,function(){n.updateRoute(r),t&&t(r),n.ensureURL(),n.router.afterHooks.forEach(function(a){a&&a(r,o)}),n.ready||(n.ready=!0,n.readyCbs.forEach(function(a){a(r)}))},function(a){i&&i(a),a&&!n.ready&&(!rH(a,Ly.redirected)||o!==S_)&&(n.ready=!0,n.readyErrorCbs.forEach(function(l){l(a)}))})};$u.prototype.confirmTransition=function(e,t,i){var n=this,r=this.current;this.pending=e;var o=function(b){!rH(b)&&ZF(b)&&(n.errorCbs.length?n.errorCbs.forEach(function(y){y(b)}):console.error(b)),i&&i(b)},a=e.matched.length-1,l=r.matched.length-1;if(w_e(e,r)&&a===l&&e.matched[a]===r.matched[l])return this.ensureURL(),e.hash&&wm(this.router,r,e,!1),o($Oe(r,e));var d=ZOe(this.current.matched,e.matched),h=d.updated,f=d.deactivated,p=d.activated,m=[].concat(QOe(f),this.router.beforeHooks,JOe(h),p.map(function(b){return b.beforeEnter}),qOe(p)),v=function(b,y){if(n.pending!==e)return o(Ole(r,e));try{b(e,r,function(x){x===!1?(n.ensureURL(!0),o(zOe(r,e))):ZF(x)?(n.ensureURL(!0),o(x)):typeof x=="string"||typeof x=="object"&&(typeof x.path=="string"||typeof x.name=="string")?(o(VOe(r,e)),typeof x=="object"&&x.replace?n.replace(x):n.push(x)):y(x)})}catch(x){o(x)}};Ale(m,v,function(){var b=eAe(p),y=b.concat(n.router.resolveHooks);Ale(y,v,function(){if(n.pending!==e)return o(Ole(r,e));n.pending=null,t(e),n.router.app&&n.router.app.$nextTick(function(){S_e(e)})})})};$u.prototype.updateRoute=function(e){this.current=e,this.cb&&this.cb(e)};$u.prototype.setupListeners=function(){};$u.prototype.teardown=function(){this.listeners.forEach(function(e){e()}),this.listeners=[],this.current=S_,this.pending=null};function YOe(s){if(!s)if(sN){var e=document.querySelector("base");s=e&&e.getAttribute("href")||"/",s=s.replace(/^https?:\/\/[^\/]+/,"")}else s="/";return s.charAt(0)!=="/"&&(s="/"+s),s.replace(/\/$/,"")}function ZOe(s,e){var t,i=Math.max(s.length,e.length);for(t=0;t<i&&s[t]===e[t];t++);return{updated:e.slice(0,t),activated:e.slice(t),deactivated:s.slice(t)}}function qJ(s,e,t,i){var n=O_e(s,function(r,o,a,l){var d=XOe(r,e);if(d)return Array.isArray(d)?d.map(function(h){return t(h,o,a,l)}):t(d,o,a,l)});return A_e(i?n.reverse():n)}function XOe(s,e){return typeof s!="function"&&(s=GF.extend(s)),s.options[e]}function QOe(s){return qJ(s,"beforeRouteLeave",F_e,!0)}function JOe(s){return qJ(s,"beforeRouteUpdate",F_e)}function F_e(s,e){if(e)return function(){return s.apply(e,arguments)}}function eAe(s){return qJ(s,"beforeRouteEnter",function(e,t,i,n){return tAe(e,i,n)})}function tAe(s,e,t){return function(n,r,o){return s(n,r,function(a){typeof a=="function"&&(e.enteredCbs[t]||(e.enteredCbs[t]=[]),e.enteredCbs[t].push(a)),o(a)})}}var B_e=function(s){function e(t,i){s.call(this,t,i),this._startLocation=DD(this.base)}return s&&(e.__proto__=s),e.prototype=Object.create(s&&s.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var i=this;if(!(this.listeners.length>0)){var n=this.router,r=n.options.scrollBehavior,o=Sm&&r;o&&this.listeners.push(R_e());var a=function(){var l=i.current,d=DD(i.base);i.current===S_&&d===i._startLocation||i.transitionTo(d,function(h){o&&wm(n,h,l,!0)})};window.addEventListener("popstate",a),this.listeners.push(function(){window.removeEventListener("popstate",a)})}},e.prototype.go=function(i){window.history.go(i)},e.prototype.push=function(i,n,r){var o=this,a=this,l=a.current;this.transitionTo(i,function(d){YF(ym(o.base+d.fullPath)),wm(o.router,d,l,!1),n&&n(d)},r)},e.prototype.replace=function(i,n,r){var o=this,a=this,l=a.current;this.transitionTo(i,function(d){pU(ym(o.base+d.fullPath)),wm(o.router,d,l,!1),n&&n(d)},r)},e.prototype.ensureURL=function(i){if(DD(this.base)!==this.current.fullPath){var n=ym(this.base+this.current.fullPath);i?YF(n):pU(n)}},e.prototype.getCurrentLocation=function(){return DD(this.base)},e}($u);function DD(s){var e=window.location.pathname,t=e.toLowerCase(),i=s.toLowerCase();return s&&(t===i||t.indexOf(ym(i+"/"))===0)&&(e=e.slice(s.length)),(e||"/")+window.location.search+window.location.hash}var W_e=function(s){function e(t,i,n){s.call(this,t,i),!(n&&iAe(this.base))&&Ble()}return s&&(e.__proto__=s),e.prototype=Object.create(s&&s.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var i=this;if(!(this.listeners.length>0)){var n=this.router,r=n.options.scrollBehavior,o=Sm&&r;o&&this.listeners.push(R_e());var a=function(){var d=i.current;Ble()&&i.transitionTo(W2(),function(h){o&&wm(i.router,h,d,!0),Sm||H2(h.fullPath)})},l=Sm?"popstate":"hashchange";window.addEventListener(l,a),this.listeners.push(function(){window.removeEventListener(l,a)})}},e.prototype.push=function(i,n,r){var o=this,a=this,l=a.current;this.transitionTo(i,function(d){Wle(d.fullPath),wm(o.router,d,l,!1),n&&n(d)},r)},e.prototype.replace=function(i,n,r){var o=this,a=this,l=a.current;this.transitionTo(i,function(d){H2(d.fullPath),wm(o.router,d,l,!1),n&&n(d)},r)},e.prototype.go=function(i){window.history.go(i)},e.prototype.ensureURL=function(i){var n=this.current.fullPath;W2()!==n&&(i?Wle(n):H2(n))},e.prototype.getCurrentLocation=function(){return W2()},e}($u);function iAe(s){var e=DD(s);if(!/^\/#/.test(e))return window.location.replace(ym(s+"/#"+e)),!0}function Ble(){var s=W2();return s.charAt(0)==="/"?!0:(H2("/"+s),!1)}function W2(){var s=window.location.href,e=s.indexOf("#");return e<0?"":(s=s.slice(e+1),s)}function mU(s){var e=window.location.href,t=e.indexOf("#"),i=t>=0?e.slice(0,t):e;return i+"#"+s}function Wle(s){Sm?YF(mU(s)):window.location.hash=s}function H2(s){Sm?pU(mU(s)):window.location.replace(mU(s))}var nAe=function(s){function e(t,i){s.call(this,t,i),this.stack=[],this.index=-1}return s&&(e.__proto__=s),e.prototype=Object.create(s&&s.prototype),e.prototype.constructor=e,e.prototype.push=function(i,n,r){var o=this;this.transitionTo(i,function(a){o.stack=o.stack.slice(0,o.index+1).concat(a),o.index++,n&&n(a)},r)},e.prototype.replace=function(i,n,r){var o=this;this.transitionTo(i,function(a){o.stack=o.stack.slice(0,o.index).concat(a),n&&n(a)},r)},e.prototype.go=function(i){var n=this,r=this.index+i;if(!(r<0||r>=this.stack.length)){var o=this.stack[r];this.confirmTransition(o,function(){var a=n.current;n.index=r,n.updateRoute(o),n.router.afterHooks.forEach(function(l){l&&l(o,a)})},function(a){rH(a,Ly.duplicated)&&(n.index=r)})}},e.prototype.getCurrentLocation=function(){var i=this.stack[this.stack.length-1];return i?i.fullPath:"/"},e.prototype.ensureURL=function(){},e}($u),Rs=function(e){e===void 0&&(e={}),this.app=null,this.apps=[],this.options=e,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=ROe(e.routes||[],this);var t=e.mode||"hash";switch(this.fallback=t==="history"&&!Sm&&e.fallback!==!1,this.fallback&&(t="hash"),sN||(t="abstract"),this.mode=t,t){case"history":this.history=new B_e(this,e.base);break;case"hash":this.history=new W_e(this,e.base,this.fallback);break;case"abstract":this.history=new nAe(this,e.base);break}},H_e={currentRoute:{configurable:!0}};Rs.prototype.match=function(e,t,i){return this.matcher.match(e,t,i)};H_e.currentRoute.get=function(){return this.history&&this.history.current};Rs.prototype.init=function(e){var t=this;if(this.apps.push(e),e.$once("hook:destroyed",function(){var o=t.apps.indexOf(e);o>-1&&t.apps.splice(o,1),t.app===e&&(t.app=t.apps[0]||null),t.app||t.history.teardown()}),!this.app){this.app=e;var i=this.history;if(i instanceof B_e||i instanceof W_e){var n=function(o){var a=i.current,l=t.options.scrollBehavior,d=Sm&&l;d&&"fullPath"in o&&wm(t,o,a,!1)},r=function(o){i.setupListeners(),n(o)};i.transitionTo(i.getCurrentLocation(),r,r)}i.listen(function(o){t.apps.forEach(function(a){a._route=o})})}};Rs.prototype.beforeEach=function(e){return KJ(this.beforeHooks,e)};Rs.prototype.beforeResolve=function(e){return KJ(this.resolveHooks,e)};Rs.prototype.afterEach=function(e){return KJ(this.afterHooks,e)};Rs.prototype.onReady=function(e,t){this.history.onReady(e,t)};Rs.prototype.onError=function(e){this.history.onError(e)};Rs.prototype.push=function(e,t,i){var n=this;if(!t&&!i&&typeof Promise<"u")return new Promise(function(r,o){n.history.push(e,r,o)});this.history.push(e,t,i)};Rs.prototype.replace=function(e,t,i){var n=this;if(!t&&!i&&typeof Promise<"u")return new Promise(function(r,o){n.history.replace(e,r,o)});this.history.replace(e,t,i)};Rs.prototype.go=function(e){this.history.go(e)};Rs.prototype.back=function(){this.go(-1)};Rs.prototype.forward=function(){this.go(1)};Rs.prototype.getMatchedComponents=function(e){var t=e?e.matched?e:this.resolve(e).route:this.currentRoute;return t?[].concat.apply([],t.matched.map(function(i){return Object.keys(i.components).map(function(n){return i.components[n]})})):[]};Rs.prototype.resolve=function(e,t,i){t=t||this.history.current;var n=UJ(e,t,i,this),r=this.match(n,t),o=r.redirectedFrom||r.fullPath,a=this.history.base,l=sAe(a,o,this.mode);return{location:n,route:r,href:l,normalizedTo:n,resolved:r}};Rs.prototype.getRoutes=function(){return this.matcher.getRoutes()};Rs.prototype.addRoute=function(e,t){this.matcher.addRoute(e,t),this.history.current!==S_&&this.history.transitionTo(this.history.getCurrentLocation())};Rs.prototype.addRoutes=function(e){this.matcher.addRoutes(e),this.history.current!==S_&&this.history.transitionTo(this.history.getCurrentLocation())};Object.defineProperties(Rs.prototype,H_e);var V_e=Rs;function KJ(s,e){return s.push(e),function(){var t=s.indexOf(e);t>-1&&s.splice(t,1)}}function sAe(s,e,t){var i=t==="hash"?"#"+e:e;return s?ym(s+"/"+i):i}Rs.install=fU;Rs.version="3.6.5";Rs.isNavigationFailure=rH;Rs.NavigationFailureType=Ly;Rs.START_LOCATION=S_;sN&&window.Vue&&window.Vue.use(Rs);const $_e="/api";let uo=null,m1=new Map,Dp=new Map,Ep=new Map;function Hle(s=null){const e=window.location.protocol==="https:"?"wss:":"ws:";return s?`${e}//${window.location.host}/ws/${s}`:`${e}//${window.location.host}/ws`}async function Ut(s,e,t=null){const i={method:s,headers:{"Content-Type":"application/json"}};t&&s!=="GET"&&(i.body=JSON.stringify(t));const r=await(await fetch(`${$_e}${e}`,i)).json();if(r.success===!1)throw new Error(r.error||r.message||"请求失败");return r}const zn={getSessions(s=20,e=0){return Ut("GET",`/sessions?limit=${s}&offset=${e}`)},createSession(s="新会话",e=null){return Ut("POST","/sessions",{title:s,projectPath:e})},getSession(s){return Ut("GET",`/sessions/${s}`)},updateSession(s,e){return Ut("PUT",`/sessions/${s}`,e)},deleteSession(s){return Ut("DELETE",`/sessions/${s}`)},getMessages(s){return Ut("GET",`/chat/history/${s}`)},getProviders(){return Ut("GET","/config/providers")},getProvider(s){return Ut("GET",`/config/providers/${s}`)},addProvider(s){return Ut("POST","/config/providers",s)},updateProvider(s,e){return Ut("PUT",`/config/providers/${s}`,e)},deleteProvider(s){return Ut("DELETE",`/config/providers/${s}`)},setDefaultProvider(s){return Ut("PUT",`/config/providers/${s}/default`)},getModels(){return Ut("GET","/config/models")},getModelsByProvider(s){return Ut("GET",`/config/models?providerId=${s}`)},addModel(s){return Ut("POST","/config/models",s)},updateModel(s,e){return Ut("PUT",`/config/models/${s}`,e)},deleteModel(s){return Ut("DELETE",`/config/models/${s}`)},chat(s){return Ut("POST","/chat",s)},chatCommand(s,e){return Ut("POST","/chat/command",{message:s,sessionId:e})},chatStream(s,e){return new Promise((t,i)=>{const n=new EventSource(`${$_e}/chat/stream?data=${encodeURIComponent(JSON.stringify(s))}`);n.onmessage=r=>{try{const o=JSON.parse(r.data);e(o),o.done&&(n.close(),t())}catch(o){console.error("Parse error:",o)}},n.onerror=r=>{n.close(),i(r)}})},getSkills(){return Ut("GET","/skills")},getConfig(s){return Ut("GET",`/config/${s}`)},setConfig(s,e){return Ut("PUT",`/config/${s}`,{value:e})},getFileTree(s="/"){return Ut("GET",`/files/tree?base_path=${encodeURIComponent(s)}`)},getFileContent(s){return Ut("GET",`/files/content?path=${encodeURIComponent(s)}`)},writeFile(s,e){return Ut("POST","/files/write",{path:s,content:e})},editFile(s,e,t){return Ut("POST",`/files/edit?path=${encodeURIComponent(s)}&old_string=${encodeURIComponent(e)}&new_string=${encodeURIComponent(t)}`)},deleteFile(s){return Ut("POST","/files/delete",{path:s})},createDirectory(s){return Ut("POST","/files/mkdir",{path:s})},renameFile(s,e){return Ut("POST","/files/rename",{path:s,newName:e})},browseFilesystem(s=""){return Ut("GET",`/filesystem/browse?path=${encodeURIComponent(s)}`)},getDbTables(){return Ut("GET","/db/tables")},getTableInfo(s){return Ut("GET",`/db/tables/${encodeURIComponent(s)}`)},getTableData(s,e=1,t=50){return Ut("GET",`/db/tables/${encodeURIComponent(s)}/data?page=${e}&page_size=${t}`)},getTableDataRaw(s,e=100){return Ut("GET",`/db/tables/${encodeURIComponent(s)}/data/raw?limit=${e}`)},executeSql(s){return Ut("POST","/db/execute",{query:s})},getAiCallLogs(s=1,e=50){return Ut("GET",`/ai-logs/logs?page=${s}&pageSize=${e}`)},getScheduledTasks(){return Ut("GET","/tasks")},getScheduledTask(s){return Ut("GET",`/tasks/${s}`)},createScheduledTask(s){return Ut("POST","/tasks",s)},updateScheduledTask(s,e){return Ut("PUT",`/tasks/${s}`,e)},deleteScheduledTask(s){return Ut("DELETE",`/tasks/${s}`)},startScheduledTask(s){return Ut("POST",`/tasks/${s}/start`)},stopScheduledTask(s){return Ut("POST",`/tasks/${s}/stop`)},runTaskNow(s){return Ut("POST",`/tasks/${s}/run`)},getTaskLogs(s,e=50){return Ut("GET",`/tasks/${s}/logs?limit=${e}`)},wsConnect(s,e,t,i){if(uo&&uo.readyState===WebSocket.OPEN)return uo;const n=Hle();return uo=new WebSocket(n),uo.onopen=()=>{console.log("WebSocket connected"),e&&e()},uo.onmessage=r=>{try{const o=JSON.parse(r.data);s&&s(o),(m1.get(o.type)||[]).forEach(l=>l(o.data))}catch(o){console.error("WebSocket parse error:",o)}},uo.onclose=()=>{console.log("WebSocket closed"),uo=null,t&&t()},uo.onerror=r=>{console.error("WebSocket error:",r),i&&i(r)},uo},wsDisconnect(){uo&&(uo.close(),uo=null),m1.clear()},wsOn(s,e){return m1.has(s)||m1.set(s,[]),m1.get(s).push(e),()=>{const t=m1.get(s)||[],i=t.indexOf(e);i>-1&&t.splice(i,1)}},wsSend(s,e){return uo&&uo.readyState===WebSocket.OPEN?(uo.send(JSON.stringify({type:s,data:e})),!0):!1},wsIsConnected(){return uo&&uo.readyState===WebSocket.OPEN},sessionWsConnect(s,e,t,i,n){if(Dp.has(s)){const a=Dp.get(s);if(a.readyState===WebSocket.OPEN)return a}const r=Hle(s),o=new WebSocket(r);return o.onopen=()=>{console.log(`WebSocket [${s}] connected`),t&&t()},o.onmessage=a=>{try{const l=JSON.parse(a.data);e&&e(l)}catch(l){console.error("WebSocket parse error:",l)}},o.onclose=()=>{console.log(`WebSocket [${s}] closed`),Dp.delete(s),i&&i()},o.onerror=a=>{console.error(`WebSocket [${s}] error:`,a),n&&n(a)},Dp.set(s,o),o},sessionWsDisconnect(s){const e=Dp.get(s);e&&(e.close(),Dp.delete(s))},sessionWsSend(s,e,t){const i=Dp.get(s);return i&&i.readyState===WebSocket.OPEN?(i.send(JSON.stringify({type:e,data:t})),!0):!1},sessionWsIsConnected(s){const e=Dp.get(s);return e&&e.readyState===WebSocket.OPEN},wsChat(s,e){const{onSession:t,onStep:i,onDone:n,onError:r}=e||{},o=this.wsOn("session",h=>{t&&t(h)}),a=this.wsOn("step",h=>{i&&i(h)}),l=this.wsOn("done",h=>{o(),a(),l(),d(),n&&n(h)}),d=this.wsOn("error",h=>{r&&r(h)});this.wsSend("chat",s)},getEmailConfigs(){return Ut("GET","/email/configs")},getEmailConfig(s){return Ut("GET",`/email/configs/${s}`)},createEmailConfig(s){return Ut("POST","/email/configs",s)},updateEmailConfig(s,e){return Ut("PUT",`/email/configs/${s}`,e)},deleteEmailConfig(s){return Ut("DELETE",`/email/configs/${s}`)},setDefaultEmailConfig(s){return Ut("PUT",`/email/configs/${s}/default`)},validateEmailConfig(s){return Ut("POST","/email/validate",{configId:s})},getDingtalkConfig(){return Ut("GET","/gateway/dingtalk/config")},updateDingtalkConfig(s){return Ut("PUT","/gateway/dingtalk/config",s)},startDingtalk(){return Ut("POST","/gateway/dingtalk/start")},stopDingtalk(){return Ut("POST","/gateway/dingtalk/stop")},getGatewayStatus(){return Ut("GET","/gateway/dingtalk/status")},getQueueStatus(){return Ut("GET","/gateway/queue/status")},getTerminalSessions(){return Ut("GET","/terminal/sessions")},createTerminalSession(){return Ut("POST","/terminal/sessions")},deleteTerminalSession(s){return Ut("DELETE",`/terminal/sessions/${s}`)},terminalWsConnect(s,e,t,i,n){if(Ep.has(s)){const l=Ep.get(s);if(l.readyState===WebSocket.OPEN)return l}const o=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal/${s}`,a=new WebSocket(o);return a.onopen=()=>{console.log(`Terminal WebSocket [${s}] connected`),t&&t()},a.onmessage=l=>{try{const d=JSON.parse(l.data);e&&e(d)}catch(d){console.error("Terminal WebSocket parse error:",d)}},a.onclose=()=>{console.log(`Terminal WebSocket [${s}] closed`),Ep.delete(s),i&&i()},a.onerror=l=>{console.error(`Terminal WebSocket [${s}] error:`,l),n&&n(l)},Ep.set(s,a),a},terminalWsDisconnect(s){const e=Ep.get(s);e&&(e.close(),Ep.delete(s))},terminalWsSend(s,e,t){const i=Ep.get(s);return i&&i.readyState===WebSocket.OPEN?(i.send(JSON.stringify({type:e,data:t})),!0):!1},terminalWsIsConnected(s){const e=Ep.get(s);return e&&e.readyState===WebSocket.OPEN}};function GJ(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Dy=GJ();function z_e(s){Dy=s}var Xv={exec:()=>null};function Cn(s,e=""){let t=typeof s=="string"?s:s.source,i={replace:(n,r)=>{let o=typeof r=="string"?r:r.source;return o=o.replace(tl.caret,"$1"),t=t.replace(n,o),i},getRegex:()=>new RegExp(t,e)};return i}var rAe=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),tl={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:s=>new RegExp(`^( {0,3}${s})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}#`),htmlBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}>`)},oAe=/^(?:[ \t]*(?:\n|$))+/,aAe=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,lAe=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,rN=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,cAe=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,YJ=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,j_e=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,U_e=Cn(j_e).replace(/bull/g,YJ).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),dAe=Cn(j_e).replace(/bull/g,YJ).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ZJ=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,uAe=/^[^\n]+/,XJ=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,hAe=Cn(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",XJ).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),fAe=Cn(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,YJ).getRegex(),oH="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",QJ=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,gAe=Cn("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",QJ).replace("tag",oH).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),q_e=Cn(ZJ).replace("hr",rN).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",oH).getRegex(),pAe=Cn(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",q_e).getRegex(),JJ={blockquote:pAe,code:aAe,def:hAe,fences:lAe,heading:cAe,hr:rN,html:gAe,lheading:U_e,list:fAe,newline:oAe,paragraph:q_e,table:Xv,text:uAe},Vle=Cn("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",rN).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",oH).getRegex(),mAe={...JJ,lheading:dAe,table:Vle,paragraph:Cn(ZJ).replace("hr",rN).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Vle).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",oH).getRegex()},_Ae={...JJ,html:Cn(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",QJ).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Xv,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Cn(ZJ).replace("hr",rN).replace("heading",` *#{1,6} *[^
|
|
142
|
+
*/function bu(s,e){for(var t in e)s[t]=e[t];return s}var sOe=/[!'()*]/g,rOe=function(s){return"%"+s.charCodeAt(0).toString(16)},oOe=/%2C/g,p1=function(s){return encodeURIComponent(s).replace(sOe,rOe).replace(oOe,",")};function uU(s){try{return decodeURIComponent(s)}catch{}return s}function aOe(s,e,t){e===void 0&&(e={});var i=t||lOe,n;try{n=i(s||"")}catch{n={}}for(var r in e){var o=e[r];n[r]=Array.isArray(o)?o.map(kle):kle(o)}return n}var kle=function(s){return s==null||typeof s=="object"?s:String(s)};function lOe(s){var e={};return s=s.trim().replace(/^(\?|#|&)/,""),s&&s.split("&").forEach(function(t){var i=t.replace(/\+/g," ").split("="),n=uU(i.shift()),r=i.length>0?uU(i.join("=")):null;e[n]===void 0?e[n]=r:Array.isArray(e[n])?e[n].push(r):e[n]=[e[n],r]}),e}function cOe(s){var e=s?Object.keys(s).map(function(t){var i=s[t];if(i===void 0)return"";if(i===null)return p1(t);if(Array.isArray(i)){var n=[];return i.forEach(function(r){r!==void 0&&(r===null?n.push(p1(t)):n.push(p1(t)+"="+p1(r)))}),n.join("&")}return p1(t)+"="+p1(i)}).filter(function(t){return t.length>0}).join("&"):null;return e?"?"+e:""}var UF=/\/?$/;function qF(s,e,t,i){var n=i&&i.options.stringifyQuery,r=e.query||{};try{r=hU(r)}catch{}var o={name:e.name||s&&s.name,meta:s&&s.meta||{},path:e.path||"/",hash:e.hash||"",query:r,params:e.params||{},fullPath:Lle(e,n),matched:s?dOe(s):[]};return t&&(o.redirectedFrom=Lle(t,n)),Object.freeze(o)}function hU(s){if(Array.isArray(s))return s.map(hU);if(s&&typeof s=="object"){var e={};for(var t in s)e[t]=hU(s[t]);return e}else return s}var S_=qF(null,{path:"/"});function dOe(s){for(var e=[];s;)e.unshift(s),s=s.parent;return e}function Lle(s,e){var t=s.path,i=s.query;i===void 0&&(i={});var n=s.hash;n===void 0&&(n="");var r=e||cOe;return(t||"/")+r(i)+n}function w_e(s,e,t){return e===S_?s===e:e?s.path&&e.path?s.path.replace(UF,"")===e.path.replace(UF,"")&&(t||s.hash===e.hash&&A2(s.query,e.query)):s.name&&e.name?s.name===e.name&&(t||s.hash===e.hash&&A2(s.query,e.query)&&A2(s.params,e.params)):!1:!1}function A2(s,e){if(s===void 0&&(s={}),e===void 0&&(e={}),!s||!e)return s===e;var t=Object.keys(s).sort(),i=Object.keys(e).sort();return t.length!==i.length?!1:t.every(function(n,r){var o=s[n],a=i[r];if(a!==n)return!1;var l=e[n];return o==null||l==null?o===l:typeof o=="object"&&typeof l=="object"?A2(o,l):String(o)===String(l)})}function uOe(s,e){return s.path.replace(UF,"/").indexOf(e.path.replace(UF,"/"))===0&&(!e.hash||s.hash===e.hash)&&hOe(s.query,e.query)}function hOe(s,e){for(var t in e)if(!(t in s))return!1;return!0}function S_e(s){for(var e=0;e<s.matched.length;e++){var t=s.matched[e];for(var i in t.instances){var n=t.instances[i],r=t.enteredCbs[i];if(!(!n||!r)){delete t.enteredCbs[i];for(var o=0;o<r.length;o++)n._isBeingDestroyed||r[o](n)}}}}var fOe={name:"RouterView",functional:!0,props:{name:{type:String,default:"default"}},render:function(e,t){var i=t.props,n=t.children,r=t.parent,o=t.data;o.routerView=!0;for(var a=r.$createElement,l=i.name,d=r.$route,h=r._routerViewCache||(r._routerViewCache={}),f=0,p=!1;r&&r._routerRoot!==r;){var m=r.$vnode?r.$vnode.data:{};m.routerView&&f++,m.keepAlive&&r._directInactive&&r._inactive&&(p=!0),r=r.$parent}if(o.routerViewDepth=f,p){var v=h[l],b=v&&v.component;return b?(v.configProps&&Dle(b,o,v.route,v.configProps),a(b,o,n)):a()}var y=d.matched[f],x=y&&y.components[l];if(!y||!x)return h[l]=null,a();h[l]={component:x},o.registerRouteInstance=function(S,E){var I=y.instances[l];(E&&I!==S||!E&&I===S)&&(y.instances[l]=E)},(o.hook||(o.hook={})).prepatch=function(S,E){y.instances[l]=E.componentInstance},o.hook.init=function(S){S.data.keepAlive&&S.componentInstance&&S.componentInstance!==y.instances[l]&&(y.instances[l]=S.componentInstance),S_e(d)};var D=y.props&&y.props[l];return D&&(bu(h[l],{route:d,configProps:D}),Dle(x,o,d,D)),a(x,o,n)}};function Dle(s,e,t,i){var n=e.props=gOe(t,i);if(n){n=e.props=bu({},n);var r=e.attrs=e.attrs||{};for(var o in n)(!s.props||!(o in s.props))&&(r[o]=n[o],delete n[o])}}function gOe(s,e){switch(typeof e){case"undefined":return;case"object":return e;case"function":return e(s);case"boolean":return e?s.params:void 0}}function x_e(s,e,t){var i=s.charAt(0);if(i==="/")return s;if(i==="?"||i==="#")return e+s;var n=e.split("/");(!t||!n[n.length-1])&&n.pop();for(var r=s.replace(/^\//,"").split("/"),o=0;o<r.length;o++){var a=r[o];a===".."?n.pop():a!=="."&&n.push(a)}return n[0]!==""&&n.unshift(""),n.join("/")}function pOe(s){var e="",t="",i=s.indexOf("#");i>=0&&(e=s.slice(i),s=s.slice(0,i));var n=s.indexOf("?");return n>=0&&(t=s.slice(n+1),s=s.slice(0,n)),{path:s,query:t,hash:e}}function ym(s){return s.replace(/\/(?:\s*\/)+/g,"/")}var KF=Array.isArray||function(s){return Object.prototype.toString.call(s)=="[object Array]"},yx=D_e,mOe=$J,_Oe=yOe,vOe=k_e,bOe=L_e,COe=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function $J(s,e){for(var t=[],i=0,n=0,r="",o=e&&e.delimiter||"/",a;(a=COe.exec(s))!=null;){var l=a[0],d=a[1],h=a.index;if(r+=s.slice(n,h),n=h+l.length,d){r+=d[1];continue}var f=s[n],p=a[2],m=a[3],v=a[4],b=a[5],y=a[6],x=a[7];r&&(t.push(r),r="");var D=p!=null&&f!=null&&f!==p,S=y==="+"||y==="*",E=y==="?"||y==="*",I=a[2]||o,R=v||b;t.push({name:m||i++,prefix:p||"",delimiter:I,optional:E,repeat:S,partial:D,asterisk:!!x,pattern:R?xOe(R):x?".*":"[^"+F2(I)+"]+?"})}return n<s.length&&(r+=s.substr(n)),r&&t.push(r),t}function yOe(s,e){return k_e($J(s,e),e)}function wOe(s){return encodeURI(s).replace(/[\/?#]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function SOe(s){return encodeURI(s).replace(/[?#]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function k_e(s,e){for(var t=new Array(s.length),i=0;i<s.length;i++)typeof s[i]=="object"&&(t[i]=new RegExp("^(?:"+s[i].pattern+")$",jJ(e)));return function(n,r){for(var o="",a=n||{},l=r||{},d=l.pretty?wOe:encodeURIComponent,h=0;h<s.length;h++){var f=s[h];if(typeof f=="string"){o+=f;continue}var p=a[f.name],m;if(p==null)if(f.optional){f.partial&&(o+=f.prefix);continue}else throw new TypeError('Expected "'+f.name+'" to be defined');if(KF(p)){if(!f.repeat)throw new TypeError('Expected "'+f.name+'" to not repeat, but received `'+JSON.stringify(p)+"`");if(p.length===0){if(f.optional)continue;throw new TypeError('Expected "'+f.name+'" to not be empty')}for(var v=0;v<p.length;v++){if(m=d(p[v]),!t[h].test(m))throw new TypeError('Expected all "'+f.name+'" to match "'+f.pattern+'", but received `'+JSON.stringify(m)+"`");o+=(v===0?f.prefix:f.delimiter)+m}continue}if(m=f.asterisk?SOe(p):d(p),!t[h].test(m))throw new TypeError('Expected "'+f.name+'" to match "'+f.pattern+'", but received "'+m+'"');o+=f.prefix+m}return o}}function F2(s){return s.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function xOe(s){return s.replace(/([=!:$\/()])/g,"\\$1")}function zJ(s,e){return s.keys=e,s}function jJ(s){return s&&s.sensitive?"":"i"}function kOe(s,e){var t=s.source.match(/\((?!\?)/g);if(t)for(var i=0;i<t.length;i++)e.push({name:i,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return zJ(s,e)}function LOe(s,e,t){for(var i=[],n=0;n<s.length;n++)i.push(D_e(s[n],e,t).source);var r=new RegExp("(?:"+i.join("|")+")",jJ(t));return zJ(r,e)}function DOe(s,e,t){return L_e($J(s,t),e,t)}function L_e(s,e,t){KF(e)||(t=e||t,e=[]),t=t||{};for(var i=t.strict,n=t.end!==!1,r="",o=0;o<s.length;o++){var a=s[o];if(typeof a=="string")r+=F2(a);else{var l=F2(a.prefix),d="(?:"+a.pattern+")";e.push(a),a.repeat&&(d+="(?:"+l+d+")*"),a.optional?a.partial?d=l+"("+d+")?":d="(?:"+l+"("+d+"))?":d=l+"("+d+")",r+=d}}var h=F2(t.delimiter||"/"),f=r.slice(-h.length)===h;return i||(r=(f?r.slice(0,-h.length):r)+"(?:"+h+"(?=$))?"),n?r+="$":r+=i&&f?"":"(?="+h+"|$)",zJ(new RegExp("^"+r,jJ(t)),e)}function D_e(s,e,t){return KF(e)||(t=e||t,e=[]),t=t||{},s instanceof RegExp?kOe(s,e):KF(s)?LOe(s,e,t):DOe(s,e,t)}yx.parse=mOe;yx.compile=_Oe;yx.tokensToFunction=vOe;yx.tokensToRegExp=bOe;var Ele=Object.create(null);function B2(s,e,t){e=e||{};try{var i=Ele[s]||(Ele[s]=yx.compile(s));return typeof e.pathMatch=="string"&&(e[0]=e.pathMatch),i(e,{pretty:!0})}catch{return""}finally{delete e[0]}}function UJ(s,e,t,i){var n=typeof s=="string"?{path:s}:s;if(n._normalized)return n;if(n.name){n=bu({},s);var r=n.params;return r&&typeof r=="object"&&(n.params=bu({},r)),n}if(!n.path&&n.params&&e){n=bu({},n),n._normalized=!0;var o=bu(bu({},e.params),n.params);if(e.name)n.name=e.name,n.params=o;else if(e.matched.length){var a=e.matched[e.matched.length-1].path;n.path=B2(a,o,"path "+e.path)}return n}var l=pOe(n.path||""),d=e&&e.path||"/",h=l.path?x_e(l.path,d,t||n.append):d,f=aOe(l.query,n.query,i&&i.options.parseQuery),p=n.hash||l.hash;return p&&p.charAt(0)!=="#"&&(p="#"+p),{_normalized:!0,path:h,query:f,hash:p}}var EOe=[String,Object],IOe=[String,Array],Ile=function(){},TOe={name:"RouterLink",props:{to:{type:EOe,required:!0},tag:{type:String,default:"a"},custom:Boolean,exact:Boolean,exactPath:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,ariaCurrentValue:{type:String,default:"page"},event:{type:IOe,default:"click"}},render:function(e){var t=this,i=this.$router,n=this.$route,r=i.resolve(this.to,n,this.append),o=r.location,a=r.route,l=r.href,d={},h=i.options.linkActiveClass,f=i.options.linkExactActiveClass,p=h??"router-link-active",m=f??"router-link-exact-active",v=this.activeClass==null?p:this.activeClass,b=this.exactActiveClass==null?m:this.exactActiveClass,y=a.redirectedFrom?qF(null,UJ(a.redirectedFrom),null,i):a;d[b]=w_e(n,y,this.exactPath),d[v]=this.exact||this.exactPath?d[b]:uOe(n,y);var x=d[b]?this.ariaCurrentValue:null,D=function(z){Tle(z)&&(t.replace?i.replace(o,Ile):i.push(o,Ile))},S={click:Tle};Array.isArray(this.event)?this.event.forEach(function(z){S[z]=D}):S[this.event]=D;var E={class:d},I=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:l,route:a,navigate:D,isActive:d[v],isExactActive:d[b]});if(I){if(I.length===1)return I[0];if(I.length>1||!I.length)return I.length===0?e():e("span",{},I)}if(this.tag==="a")E.on=S,E.attrs={href:l,"aria-current":x};else{var R=E_e(this.$slots.default);if(R){R.isStatic=!1;var M=R.data=bu({},R.data);M.on=M.on||{};for(var O in M.on){var H=M.on[O];O in S&&(M.on[O]=Array.isArray(H)?H:[H])}for(var te in S)te in M.on?M.on[te].push(S[te]):M.on[te]=D;var J=R.data.attrs=bu({},R.data.attrs);J.href=l,J["aria-current"]=x}else E.on=S}return e(this.tag,E,this.$slots.default)}};function Tle(s){if(!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)&&!s.defaultPrevented&&!(s.button!==void 0&&s.button!==0)){if(s.currentTarget&&s.currentTarget.getAttribute){var e=s.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return s.preventDefault&&s.preventDefault(),!0}}function E_e(s){if(s){for(var e,t=0;t<s.length;t++)if(e=s[t],e.tag==="a"||e.children&&(e=E_e(e.children)))return e}}var GF;function fU(s){if(!(fU.installed&&GF===s)){fU.installed=!0,GF=s;var e=function(n){return n!==void 0},t=function(n,r){var o=n.$options._parentVnode;e(o)&&e(o=o.data)&&e(o=o.registerRouteInstance)&&o(n,r)};s.mixin({beforeCreate:function(){e(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),s.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,t(this,this)},destroyed:function(){t(this)}}),Object.defineProperty(s.prototype,"$router",{get:function(){return this._routerRoot._router}}),Object.defineProperty(s.prototype,"$route",{get:function(){return this._routerRoot._route}}),s.component("RouterView",fOe),s.component("RouterLink",TOe);var i=s.config.optionMergeStrategies;i.beforeRouteEnter=i.beforeRouteLeave=i.beforeRouteUpdate=i.created}}var sN=typeof window<"u";function fA(s,e,t,i,n){var r=e||[],o=t||Object.create(null),a=i||Object.create(null);s.forEach(function(h){gU(r,o,a,h,n)});for(var l=0,d=r.length;l<d;l++)r[l]==="*"&&(r.push(r.splice(l,1)[0]),d--,l--);return{pathList:r,pathMap:o,nameMap:a}}function gU(s,e,t,i,n,r){var o=i.path,a=i.name,l=i.pathToRegexpOptions||{},d=MOe(o,n,l.strict);typeof i.caseSensitive=="boolean"&&(l.sensitive=i.caseSensitive);var h={path:d,regex:NOe(d,l),components:i.components||{default:i.component},alias:i.alias?typeof i.alias=="string"?[i.alias]:i.alias:[],instances:{},enteredCbs:{},name:a,parent:n,matchAs:r,redirect:i.redirect,beforeEnter:i.beforeEnter,meta:i.meta||{},props:i.props==null?{}:i.components?i.props:{default:i.props}};if(i.children&&i.children.forEach(function(b){var y=r?ym(r+"/"+b.path):void 0;gU(s,e,t,b,h,y)}),e[h.path]||(s.push(h.path),e[h.path]=h),i.alias!==void 0)for(var f=Array.isArray(i.alias)?i.alias:[i.alias],p=0;p<f.length;++p){var m=f[p],v={path:m,children:i.children};gU(s,e,t,v,n,h.path||"/")}a&&(t[a]||(t[a]=h))}function NOe(s,e){var t=yx(s,[],e);return t}function MOe(s,e,t){return t||(s=s.replace(/\/$/,"")),s[0]==="/"||e==null?s:ym(e.path+"/"+s)}function ROe(s,e){var t=fA(s),i=t.pathList,n=t.pathMap,r=t.nameMap;function o(m){fA(m,i,n,r)}function a(m,v){var b=typeof m!="object"?r[m]:void 0;fA([v||m],i,n,r,b),b&&b.alias.length&&fA(b.alias.map(function(y){return{path:y,children:[v]}}),i,n,r,b)}function l(){return i.map(function(m){return n[m]})}function d(m,v,b){var y=UJ(m,v,!1,e),x=y.name;if(x){var D=r[x];if(!D)return p(null,y);var S=D.regex.keys.filter(function(O){return!O.optional}).map(function(O){return O.name});if(typeof y.params!="object"&&(y.params={}),v&&typeof v.params=="object")for(var E in v.params)!(E in y.params)&&S.indexOf(E)>-1&&(y.params[E]=v.params[E]);return y.path=B2(D.path,y.params),p(D,y,b)}else if(y.path){y.params={};for(var I=0;I<i.length;I++){var R=i[I],M=n[R];if(POe(M.regex,y.path,y.params))return p(M,y,b)}}return p(null,y)}function h(m,v){var b=m.redirect,y=typeof b=="function"?b(qF(m,v,null,e)):b;if(typeof y=="string"&&(y={path:y}),!y||typeof y!="object")return p(null,v);var x=y,D=x.name,S=x.path,E=v.query,I=v.hash,R=v.params;if(E=x.hasOwnProperty("query")?x.query:E,I=x.hasOwnProperty("hash")?x.hash:I,R=x.hasOwnProperty("params")?x.params:R,D)return r[D],d({_normalized:!0,name:D,query:E,hash:I,params:R},void 0,v);if(S){var M=OOe(S,m),O=B2(M,R);return d({_normalized:!0,path:O,query:E,hash:I},void 0,v)}else return p(null,v)}function f(m,v,b){var y=B2(b,v.params),x=d({_normalized:!0,path:y});if(x){var D=x.matched,S=D[D.length-1];return v.params=x.params,p(S,v)}return p(null,v)}function p(m,v,b){return m&&m.redirect?h(m,b||v):m&&m.matchAs?f(m,v,m.matchAs):qF(m,v,b,e)}return{match:d,addRoute:a,getRoutes:l,addRoutes:o}}function POe(s,e,t){var i=e.match(s);if(i){if(!t)return!0}else return!1;for(var n=1,r=i.length;n<r;++n){var o=s.keys[n-1];o&&(t[o.name||"pathMatch"]=typeof i[n]=="string"?uU(i[n]):i[n])}return!0}function OOe(s,e){return x_e(s,e.parent?e.parent.path:"/",!0)}var AOe=sN&&window.performance&&window.performance.now?window.performance:Date;function I_e(){return AOe.now().toFixed(3)}var T_e=I_e();function nH(){return T_e}function N_e(s){return T_e=s}var M_e=Object.create(null);function R_e(){"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual");var s=window.location.protocol+"//"+window.location.host,e=window.location.href.replace(s,""),t=bu({},window.history.state);return t.key=nH(),window.history.replaceState(t,"",e),window.addEventListener("popstate",Nle),function(){window.removeEventListener("popstate",Nle)}}function wm(s,e,t,i){if(s.app){var n=s.options.scrollBehavior;n&&s.app.$nextTick(function(){var r=FOe(),o=n.call(s,e,t,i?r:null);o&&(typeof o.then=="function"?o.then(function(a){Ple(a,r)}).catch(function(a){}):Ple(o,r))})}}function P_e(){var s=nH();s&&(M_e[s]={x:window.pageXOffset,y:window.pageYOffset})}function Nle(s){P_e(),s.state&&s.state.key&&N_e(s.state.key)}function FOe(){var s=nH();if(s)return M_e[s]}function BOe(s,e){var t=document.documentElement,i=t.getBoundingClientRect(),n=s.getBoundingClientRect();return{x:n.left-i.left-e.x,y:n.top-i.top-e.y}}function Mle(s){return kS(s.x)||kS(s.y)}function Rle(s){return{x:kS(s.x)?s.x:window.pageXOffset,y:kS(s.y)?s.y:window.pageYOffset}}function WOe(s){return{x:kS(s.x)?s.x:0,y:kS(s.y)?s.y:0}}function kS(s){return typeof s=="number"}var HOe=/^#\d/;function Ple(s,e){var t=typeof s=="object";if(t&&typeof s.selector=="string"){var i=HOe.test(s.selector)?document.getElementById(s.selector.slice(1)):document.querySelector(s.selector);if(i){var n=s.offset&&typeof s.offset=="object"?s.offset:{};n=WOe(n),e=BOe(i,n)}else Mle(s)&&(e=Rle(s))}else t&&Mle(s)&&(e=Rle(s));e&&("scrollBehavior"in document.documentElement.style?window.scrollTo({left:e.x,top:e.y,behavior:s.behavior}):window.scrollTo(e.x,e.y))}var Sm=sN&&function(){var s=window.navigator.userAgent;return(s.indexOf("Android 2.")!==-1||s.indexOf("Android 4.0")!==-1)&&s.indexOf("Mobile Safari")!==-1&&s.indexOf("Chrome")===-1&&s.indexOf("Windows Phone")===-1?!1:window.history&&typeof window.history.pushState=="function"}();function YF(s,e){P_e();var t=window.history;try{if(e){var i=bu({},t.state);i.key=nH(),t.replaceState(i,"",s)}else t.pushState({key:N_e(I_e())},"",s)}catch{window.location[e?"replace":"assign"](s)}}function pU(s){YF(s,!0)}var Ly={redirected:2,aborted:4,cancelled:8,duplicated:16};function VOe(s,e){return sH(s,e,Ly.redirected,'Redirected when going from "'+s.fullPath+'" to "'+UOe(e)+'" via a navigation guard.')}function $Oe(s,e){var t=sH(s,e,Ly.duplicated,'Avoided redundant navigation to current location: "'+s.fullPath+'".');return t.name="NavigationDuplicated",t}function Ole(s,e){return sH(s,e,Ly.cancelled,'Navigation cancelled from "'+s.fullPath+'" to "'+e.fullPath+'" with a new navigation.')}function zOe(s,e){return sH(s,e,Ly.aborted,'Navigation aborted from "'+s.fullPath+'" to "'+e.fullPath+'" via a navigation guard.')}function sH(s,e,t,i){var n=new Error(i);return n._isRouter=!0,n.from=s,n.to=e,n.type=t,n}var jOe=["params","query","hash"];function UOe(s){if(typeof s=="string")return s;if("path"in s)return s.path;var e={};return jOe.forEach(function(t){t in s&&(e[t]=s[t])}),JSON.stringify(e,null,2)}function ZF(s){return Object.prototype.toString.call(s).indexOf("Error")>-1}function rH(s,e){return ZF(s)&&s._isRouter&&(e==null||s.type===e)}function Ale(s,e,t){var i=function(n){n>=s.length?t():s[n]?e(s[n],function(){i(n+1)}):i(n+1)};i(0)}function qOe(s){return function(e,t,i){var n=!1,r=0,o=null;O_e(s,function(a,l,d,h){if(typeof a=="function"&&a.cid===void 0){n=!0,r++;var f=Fle(function(b){GOe(b)&&(b=b.default),a.resolved=typeof b=="function"?b:GF.extend(b),d.components[h]=b,r--,r<=0&&i()}),p=Fle(function(b){var y="Failed to resolve async component "+h+": "+b;o||(o=ZF(b)?b:new Error(y),i(o))}),m;try{m=a(f,p)}catch(b){p(b)}if(m)if(typeof m.then=="function")m.then(f,p);else{var v=m.component;v&&typeof v.then=="function"&&v.then(f,p)}}}),n||i()}}function O_e(s,e){return A_e(s.map(function(t){return Object.keys(t.components).map(function(i){return e(t.components[i],t.instances[i],t,i)})}))}function A_e(s){return Array.prototype.concat.apply([],s)}var KOe=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function GOe(s){return s.__esModule||KOe&&s[Symbol.toStringTag]==="Module"}function Fle(s){var e=!1;return function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];if(!e)return e=!0,s.apply(this,t)}}var $u=function(e,t){this.router=e,this.base=YOe(t),this.current=S_,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};$u.prototype.listen=function(e){this.cb=e};$u.prototype.onReady=function(e,t){this.ready?e():(this.readyCbs.push(e),t&&this.readyErrorCbs.push(t))};$u.prototype.onError=function(e){this.errorCbs.push(e)};$u.prototype.transitionTo=function(e,t,i){var n=this,r;try{r=this.router.match(e,this.current)}catch(a){throw this.errorCbs.forEach(function(l){l(a)}),a}var o=this.current;this.confirmTransition(r,function(){n.updateRoute(r),t&&t(r),n.ensureURL(),n.router.afterHooks.forEach(function(a){a&&a(r,o)}),n.ready||(n.ready=!0,n.readyCbs.forEach(function(a){a(r)}))},function(a){i&&i(a),a&&!n.ready&&(!rH(a,Ly.redirected)||o!==S_)&&(n.ready=!0,n.readyErrorCbs.forEach(function(l){l(a)}))})};$u.prototype.confirmTransition=function(e,t,i){var n=this,r=this.current;this.pending=e;var o=function(b){!rH(b)&&ZF(b)&&(n.errorCbs.length?n.errorCbs.forEach(function(y){y(b)}):console.error(b)),i&&i(b)},a=e.matched.length-1,l=r.matched.length-1;if(w_e(e,r)&&a===l&&e.matched[a]===r.matched[l])return this.ensureURL(),e.hash&&wm(this.router,r,e,!1),o($Oe(r,e));var d=ZOe(this.current.matched,e.matched),h=d.updated,f=d.deactivated,p=d.activated,m=[].concat(QOe(f),this.router.beforeHooks,JOe(h),p.map(function(b){return b.beforeEnter}),qOe(p)),v=function(b,y){if(n.pending!==e)return o(Ole(r,e));try{b(e,r,function(x){x===!1?(n.ensureURL(!0),o(zOe(r,e))):ZF(x)?(n.ensureURL(!0),o(x)):typeof x=="string"||typeof x=="object"&&(typeof x.path=="string"||typeof x.name=="string")?(o(VOe(r,e)),typeof x=="object"&&x.replace?n.replace(x):n.push(x)):y(x)})}catch(x){o(x)}};Ale(m,v,function(){var b=eAe(p),y=b.concat(n.router.resolveHooks);Ale(y,v,function(){if(n.pending!==e)return o(Ole(r,e));n.pending=null,t(e),n.router.app&&n.router.app.$nextTick(function(){S_e(e)})})})};$u.prototype.updateRoute=function(e){this.current=e,this.cb&&this.cb(e)};$u.prototype.setupListeners=function(){};$u.prototype.teardown=function(){this.listeners.forEach(function(e){e()}),this.listeners=[],this.current=S_,this.pending=null};function YOe(s){if(!s)if(sN){var e=document.querySelector("base");s=e&&e.getAttribute("href")||"/",s=s.replace(/^https?:\/\/[^\/]+/,"")}else s="/";return s.charAt(0)!=="/"&&(s="/"+s),s.replace(/\/$/,"")}function ZOe(s,e){var t,i=Math.max(s.length,e.length);for(t=0;t<i&&s[t]===e[t];t++);return{updated:e.slice(0,t),activated:e.slice(t),deactivated:s.slice(t)}}function qJ(s,e,t,i){var n=O_e(s,function(r,o,a,l){var d=XOe(r,e);if(d)return Array.isArray(d)?d.map(function(h){return t(h,o,a,l)}):t(d,o,a,l)});return A_e(i?n.reverse():n)}function XOe(s,e){return typeof s!="function"&&(s=GF.extend(s)),s.options[e]}function QOe(s){return qJ(s,"beforeRouteLeave",F_e,!0)}function JOe(s){return qJ(s,"beforeRouteUpdate",F_e)}function F_e(s,e){if(e)return function(){return s.apply(e,arguments)}}function eAe(s){return qJ(s,"beforeRouteEnter",function(e,t,i,n){return tAe(e,i,n)})}function tAe(s,e,t){return function(n,r,o){return s(n,r,function(a){typeof a=="function"&&(e.enteredCbs[t]||(e.enteredCbs[t]=[]),e.enteredCbs[t].push(a)),o(a)})}}var B_e=function(s){function e(t,i){s.call(this,t,i),this._startLocation=DD(this.base)}return s&&(e.__proto__=s),e.prototype=Object.create(s&&s.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var i=this;if(!(this.listeners.length>0)){var n=this.router,r=n.options.scrollBehavior,o=Sm&&r;o&&this.listeners.push(R_e());var a=function(){var l=i.current,d=DD(i.base);i.current===S_&&d===i._startLocation||i.transitionTo(d,function(h){o&&wm(n,h,l,!0)})};window.addEventListener("popstate",a),this.listeners.push(function(){window.removeEventListener("popstate",a)})}},e.prototype.go=function(i){window.history.go(i)},e.prototype.push=function(i,n,r){var o=this,a=this,l=a.current;this.transitionTo(i,function(d){YF(ym(o.base+d.fullPath)),wm(o.router,d,l,!1),n&&n(d)},r)},e.prototype.replace=function(i,n,r){var o=this,a=this,l=a.current;this.transitionTo(i,function(d){pU(ym(o.base+d.fullPath)),wm(o.router,d,l,!1),n&&n(d)},r)},e.prototype.ensureURL=function(i){if(DD(this.base)!==this.current.fullPath){var n=ym(this.base+this.current.fullPath);i?YF(n):pU(n)}},e.prototype.getCurrentLocation=function(){return DD(this.base)},e}($u);function DD(s){var e=window.location.pathname,t=e.toLowerCase(),i=s.toLowerCase();return s&&(t===i||t.indexOf(ym(i+"/"))===0)&&(e=e.slice(s.length)),(e||"/")+window.location.search+window.location.hash}var W_e=function(s){function e(t,i,n){s.call(this,t,i),!(n&&iAe(this.base))&&Ble()}return s&&(e.__proto__=s),e.prototype=Object.create(s&&s.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var i=this;if(!(this.listeners.length>0)){var n=this.router,r=n.options.scrollBehavior,o=Sm&&r;o&&this.listeners.push(R_e());var a=function(){var d=i.current;Ble()&&i.transitionTo(W2(),function(h){o&&wm(i.router,h,d,!0),Sm||H2(h.fullPath)})},l=Sm?"popstate":"hashchange";window.addEventListener(l,a),this.listeners.push(function(){window.removeEventListener(l,a)})}},e.prototype.push=function(i,n,r){var o=this,a=this,l=a.current;this.transitionTo(i,function(d){Wle(d.fullPath),wm(o.router,d,l,!1),n&&n(d)},r)},e.prototype.replace=function(i,n,r){var o=this,a=this,l=a.current;this.transitionTo(i,function(d){H2(d.fullPath),wm(o.router,d,l,!1),n&&n(d)},r)},e.prototype.go=function(i){window.history.go(i)},e.prototype.ensureURL=function(i){var n=this.current.fullPath;W2()!==n&&(i?Wle(n):H2(n))},e.prototype.getCurrentLocation=function(){return W2()},e}($u);function iAe(s){var e=DD(s);if(!/^\/#/.test(e))return window.location.replace(ym(s+"/#"+e)),!0}function Ble(){var s=W2();return s.charAt(0)==="/"?!0:(H2("/"+s),!1)}function W2(){var s=window.location.href,e=s.indexOf("#");return e<0?"":(s=s.slice(e+1),s)}function mU(s){var e=window.location.href,t=e.indexOf("#"),i=t>=0?e.slice(0,t):e;return i+"#"+s}function Wle(s){Sm?YF(mU(s)):window.location.hash=s}function H2(s){Sm?pU(mU(s)):window.location.replace(mU(s))}var nAe=function(s){function e(t,i){s.call(this,t,i),this.stack=[],this.index=-1}return s&&(e.__proto__=s),e.prototype=Object.create(s&&s.prototype),e.prototype.constructor=e,e.prototype.push=function(i,n,r){var o=this;this.transitionTo(i,function(a){o.stack=o.stack.slice(0,o.index+1).concat(a),o.index++,n&&n(a)},r)},e.prototype.replace=function(i,n,r){var o=this;this.transitionTo(i,function(a){o.stack=o.stack.slice(0,o.index).concat(a),n&&n(a)},r)},e.prototype.go=function(i){var n=this,r=this.index+i;if(!(r<0||r>=this.stack.length)){var o=this.stack[r];this.confirmTransition(o,function(){var a=n.current;n.index=r,n.updateRoute(o),n.router.afterHooks.forEach(function(l){l&&l(o,a)})},function(a){rH(a,Ly.duplicated)&&(n.index=r)})}},e.prototype.getCurrentLocation=function(){var i=this.stack[this.stack.length-1];return i?i.fullPath:"/"},e.prototype.ensureURL=function(){},e}($u),Rs=function(e){e===void 0&&(e={}),this.app=null,this.apps=[],this.options=e,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=ROe(e.routes||[],this);var t=e.mode||"hash";switch(this.fallback=t==="history"&&!Sm&&e.fallback!==!1,this.fallback&&(t="hash"),sN||(t="abstract"),this.mode=t,t){case"history":this.history=new B_e(this,e.base);break;case"hash":this.history=new W_e(this,e.base,this.fallback);break;case"abstract":this.history=new nAe(this,e.base);break}},H_e={currentRoute:{configurable:!0}};Rs.prototype.match=function(e,t,i){return this.matcher.match(e,t,i)};H_e.currentRoute.get=function(){return this.history&&this.history.current};Rs.prototype.init=function(e){var t=this;if(this.apps.push(e),e.$once("hook:destroyed",function(){var o=t.apps.indexOf(e);o>-1&&t.apps.splice(o,1),t.app===e&&(t.app=t.apps[0]||null),t.app||t.history.teardown()}),!this.app){this.app=e;var i=this.history;if(i instanceof B_e||i instanceof W_e){var n=function(o){var a=i.current,l=t.options.scrollBehavior,d=Sm&&l;d&&"fullPath"in o&&wm(t,o,a,!1)},r=function(o){i.setupListeners(),n(o)};i.transitionTo(i.getCurrentLocation(),r,r)}i.listen(function(o){t.apps.forEach(function(a){a._route=o})})}};Rs.prototype.beforeEach=function(e){return KJ(this.beforeHooks,e)};Rs.prototype.beforeResolve=function(e){return KJ(this.resolveHooks,e)};Rs.prototype.afterEach=function(e){return KJ(this.afterHooks,e)};Rs.prototype.onReady=function(e,t){this.history.onReady(e,t)};Rs.prototype.onError=function(e){this.history.onError(e)};Rs.prototype.push=function(e,t,i){var n=this;if(!t&&!i&&typeof Promise<"u")return new Promise(function(r,o){n.history.push(e,r,o)});this.history.push(e,t,i)};Rs.prototype.replace=function(e,t,i){var n=this;if(!t&&!i&&typeof Promise<"u")return new Promise(function(r,o){n.history.replace(e,r,o)});this.history.replace(e,t,i)};Rs.prototype.go=function(e){this.history.go(e)};Rs.prototype.back=function(){this.go(-1)};Rs.prototype.forward=function(){this.go(1)};Rs.prototype.getMatchedComponents=function(e){var t=e?e.matched?e:this.resolve(e).route:this.currentRoute;return t?[].concat.apply([],t.matched.map(function(i){return Object.keys(i.components).map(function(n){return i.components[n]})})):[]};Rs.prototype.resolve=function(e,t,i){t=t||this.history.current;var n=UJ(e,t,i,this),r=this.match(n,t),o=r.redirectedFrom||r.fullPath,a=this.history.base,l=sAe(a,o,this.mode);return{location:n,route:r,href:l,normalizedTo:n,resolved:r}};Rs.prototype.getRoutes=function(){return this.matcher.getRoutes()};Rs.prototype.addRoute=function(e,t){this.matcher.addRoute(e,t),this.history.current!==S_&&this.history.transitionTo(this.history.getCurrentLocation())};Rs.prototype.addRoutes=function(e){this.matcher.addRoutes(e),this.history.current!==S_&&this.history.transitionTo(this.history.getCurrentLocation())};Object.defineProperties(Rs.prototype,H_e);var V_e=Rs;function KJ(s,e){return s.push(e),function(){var t=s.indexOf(e);t>-1&&s.splice(t,1)}}function sAe(s,e,t){var i=t==="hash"?"#"+e:e;return s?ym(s+"/"+i):i}Rs.install=fU;Rs.version="3.6.5";Rs.isNavigationFailure=rH;Rs.NavigationFailureType=Ly;Rs.START_LOCATION=S_;sN&&window.Vue&&window.Vue.use(Rs);const $_e="/api";let uo=null,m1=new Map,Dp=new Map,Ep=new Map;function Hle(s=null){const e=window.location.protocol==="https:"?"wss:":"ws:";return s?`${e}//${window.location.host}/ws/${s}`:`${e}//${window.location.host}/ws`}async function zt(s,e,t=null){const i={method:s,headers:{"Content-Type":"application/json"}};t&&s!=="GET"&&(i.body=JSON.stringify(t));const r=await(await fetch(`${$_e}${e}`,i)).json();if(r.success===!1)throw new Error(r.error||r.message||"请求失败");return r}const zn={getSessions(s=20,e=0){return zt("GET",`/sessions?limit=${s}&offset=${e}`)},createSession(s="新会话",e=null){return zt("POST","/sessions",{title:s,projectPath:e})},getSession(s){return zt("GET",`/sessions/${s}`)},updateSession(s,e){return zt("PUT",`/sessions/${s}`,e)},deleteSession(s){return zt("DELETE",`/sessions/${s}`)},getMessages(s){return zt("GET",`/chat/history/${s}`)},getProviders(){return zt("GET","/config/providers")},getProvider(s){return zt("GET",`/config/providers/${s}`)},addProvider(s){return zt("POST","/config/providers",s)},updateProvider(s,e){return zt("PUT",`/config/providers/${s}`,e)},deleteProvider(s){return zt("DELETE",`/config/providers/${s}`)},setDefaultProvider(s){return zt("PUT",`/config/providers/${s}/default`)},getModels(){return zt("GET","/config/models")},getModelsByProvider(s){return zt("GET",`/config/models?providerId=${s}`)},addModel(s){return zt("POST","/config/models",s)},updateModel(s,e){return zt("PUT",`/config/models/${s}`,e)},deleteModel(s){return zt("DELETE",`/config/models/${s}`)},chat(s){return zt("POST","/chat",s)},chatCommand(s,e){return zt("POST","/chat/command",{message:s,sessionId:e})},chatStream(s,e){return new Promise((t,i)=>{const n=new EventSource(`${$_e}/chat/stream?data=${encodeURIComponent(JSON.stringify(s))}`);n.onmessage=r=>{try{const o=JSON.parse(r.data);e(o),o.done&&(n.close(),t())}catch(o){console.error("Parse error:",o)}},n.onerror=r=>{n.close(),i(r)}})},getSkills(){return zt("GET","/skills")},getConfig(s){return zt("GET",`/config/${s}`)},setConfig(s,e){return zt("PUT",`/config/${s}`,{value:e})},getFileTree(s="/"){return zt("GET",`/files/tree?base_path=${encodeURIComponent(s)}`)},getFileContent(s){return zt("GET",`/files/content?path=${encodeURIComponent(s)}`)},writeFile(s,e){return zt("POST","/files/write",{path:s,content:e})},editFile(s,e,t){return zt("POST",`/files/edit?path=${encodeURIComponent(s)}&old_string=${encodeURIComponent(e)}&new_string=${encodeURIComponent(t)}`)},deleteFile(s){return zt("POST","/files/delete",{path:s})},createDirectory(s){return zt("POST","/files/mkdir",{path:s})},renameFile(s,e){return zt("POST","/files/rename",{path:s,newName:e})},browseFilesystem(s=""){return zt("GET",`/filesystem/browse?path=${encodeURIComponent(s)}`)},getCwd(){return zt("GET","/filesystem/cwd")},getDbTables(){return zt("GET","/db/tables")},getTableInfo(s){return zt("GET",`/db/tables/${encodeURIComponent(s)}`)},getTableData(s,e=1,t=50){return zt("GET",`/db/tables/${encodeURIComponent(s)}/data?page=${e}&page_size=${t}`)},getTableDataRaw(s,e=100){return zt("GET",`/db/tables/${encodeURIComponent(s)}/data/raw?limit=${e}`)},executeSql(s){return zt("POST","/db/execute",{query:s})},getAiCallLogs(s=1,e=50){return zt("GET",`/ai-logs/logs?page=${s}&pageSize=${e}`)},getScheduledTasks(){return zt("GET","/tasks")},getScheduledTask(s){return zt("GET",`/tasks/${s}`)},createScheduledTask(s){return zt("POST","/tasks",s)},updateScheduledTask(s,e){return zt("PUT",`/tasks/${s}`,e)},deleteScheduledTask(s){return zt("DELETE",`/tasks/${s}`)},startScheduledTask(s){return zt("POST",`/tasks/${s}/start`)},stopScheduledTask(s){return zt("POST",`/tasks/${s}/stop`)},runTaskNow(s){return zt("POST",`/tasks/${s}/run`)},getTaskLogs(s,e=50){return zt("GET",`/tasks/${s}/logs?limit=${e}`)},wsConnect(s,e,t,i){if(uo&&uo.readyState===WebSocket.OPEN)return uo;const n=Hle();return uo=new WebSocket(n),uo.onopen=()=>{console.log("WebSocket connected"),e&&e()},uo.onmessage=r=>{try{const o=JSON.parse(r.data);s&&s(o),(m1.get(o.type)||[]).forEach(l=>l(o.data))}catch(o){console.error("WebSocket parse error:",o)}},uo.onclose=()=>{console.log("WebSocket closed"),uo=null,t&&t()},uo.onerror=r=>{console.error("WebSocket error:",r),i&&i(r)},uo},wsDisconnect(){uo&&(uo.close(),uo=null),m1.clear()},wsOn(s,e){return m1.has(s)||m1.set(s,[]),m1.get(s).push(e),()=>{const t=m1.get(s)||[],i=t.indexOf(e);i>-1&&t.splice(i,1)}},wsSend(s,e){return uo&&uo.readyState===WebSocket.OPEN?(uo.send(JSON.stringify({type:s,data:e})),!0):!1},wsIsConnected(){return uo&&uo.readyState===WebSocket.OPEN},sessionWsConnect(s,e,t,i,n){if(Dp.has(s)){const a=Dp.get(s);if(a.readyState===WebSocket.OPEN)return a}const r=Hle(s),o=new WebSocket(r);return o.onopen=()=>{console.log(`WebSocket [${s}] connected`),t&&t()},o.onmessage=a=>{try{const l=JSON.parse(a.data);e&&e(l)}catch(l){console.error("WebSocket parse error:",l)}},o.onclose=()=>{console.log(`WebSocket [${s}] closed`),Dp.delete(s),i&&i()},o.onerror=a=>{console.error(`WebSocket [${s}] error:`,a),n&&n(a)},Dp.set(s,o),o},sessionWsDisconnect(s){const e=Dp.get(s);e&&(e.close(),Dp.delete(s))},sessionWsSend(s,e,t){const i=Dp.get(s);return i&&i.readyState===WebSocket.OPEN?(i.send(JSON.stringify({type:e,data:t})),!0):!1},sessionWsIsConnected(s){const e=Dp.get(s);return e&&e.readyState===WebSocket.OPEN},wsChat(s,e){const{onSession:t,onStep:i,onDone:n,onError:r}=e||{},o=this.wsOn("session",h=>{t&&t(h)}),a=this.wsOn("step",h=>{i&&i(h)}),l=this.wsOn("done",h=>{o(),a(),l(),d(),n&&n(h)}),d=this.wsOn("error",h=>{r&&r(h)});this.wsSend("chat",s)},getEmailConfigs(){return zt("GET","/email/configs")},getEmailConfig(s){return zt("GET",`/email/configs/${s}`)},createEmailConfig(s){return zt("POST","/email/configs",s)},updateEmailConfig(s,e){return zt("PUT",`/email/configs/${s}`,e)},deleteEmailConfig(s){return zt("DELETE",`/email/configs/${s}`)},setDefaultEmailConfig(s){return zt("PUT",`/email/configs/${s}/default`)},validateEmailConfig(s){return zt("POST","/email/validate",{configId:s})},getDingtalkConfig(){return zt("GET","/gateway/dingtalk/config")},updateDingtalkConfig(s){return zt("PUT","/gateway/dingtalk/config",s)},startDingtalk(){return zt("POST","/gateway/dingtalk/start")},stopDingtalk(){return zt("POST","/gateway/dingtalk/stop")},getGatewayStatus(){return zt("GET","/gateway/dingtalk/status")},getQueueStatus(){return zt("GET","/gateway/queue/status")},getTerminalSessions(){return zt("GET","/terminal/sessions")},createTerminalSession(){return zt("POST","/terminal/sessions")},deleteTerminalSession(s){return zt("DELETE",`/terminal/sessions/${s}`)},terminalWsConnect(s,e,t,i,n){if(Ep.has(s)){const l=Ep.get(s);if(l.readyState===WebSocket.OPEN)return l}const o=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal/${s}`,a=new WebSocket(o);return a.onopen=()=>{console.log(`Terminal WebSocket [${s}] connected`),t&&t()},a.onmessage=l=>{try{const d=JSON.parse(l.data);e&&e(d)}catch(d){console.error("Terminal WebSocket parse error:",d)}},a.onclose=()=>{console.log(`Terminal WebSocket [${s}] closed`),Ep.delete(s),i&&i()},a.onerror=l=>{console.error(`Terminal WebSocket [${s}] error:`,l),n&&n(l)},Ep.set(s,a),a},terminalWsDisconnect(s){const e=Ep.get(s);e&&(e.close(),Ep.delete(s))},terminalWsSend(s,e,t){const i=Ep.get(s);return i&&i.readyState===WebSocket.OPEN?(i.send(JSON.stringify({type:e,data:t})),!0):!1},terminalWsIsConnected(s){const e=Ep.get(s);return e&&e.readyState===WebSocket.OPEN}};function GJ(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Dy=GJ();function z_e(s){Dy=s}var Xv={exec:()=>null};function Cn(s,e=""){let t=typeof s=="string"?s:s.source,i={replace:(n,r)=>{let o=typeof r=="string"?r:r.source;return o=o.replace(tl.caret,"$1"),t=t.replace(n,o),i},getRegex:()=>new RegExp(t,e)};return i}var rAe=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),tl={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:s=>new RegExp(`^( {0,3}${s})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}#`),htmlBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}>`)},oAe=/^(?:[ \t]*(?:\n|$))+/,aAe=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,lAe=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,rN=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,cAe=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,YJ=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,j_e=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,U_e=Cn(j_e).replace(/bull/g,YJ).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),dAe=Cn(j_e).replace(/bull/g,YJ).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ZJ=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,uAe=/^[^\n]+/,XJ=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,hAe=Cn(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",XJ).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),fAe=Cn(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,YJ).getRegex(),oH="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",QJ=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,gAe=Cn("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",QJ).replace("tag",oH).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),q_e=Cn(ZJ).replace("hr",rN).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",oH).getRegex(),pAe=Cn(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",q_e).getRegex(),JJ={blockquote:pAe,code:aAe,def:hAe,fences:lAe,heading:cAe,hr:rN,html:gAe,lheading:U_e,list:fAe,newline:oAe,paragraph:q_e,table:Xv,text:uAe},Vle=Cn("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",rN).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",oH).getRegex(),mAe={...JJ,lheading:dAe,table:Vle,paragraph:Cn(ZJ).replace("hr",rN).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Vle).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",oH).getRegex()},_Ae={...JJ,html:Cn(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",QJ).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Xv,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Cn(ZJ).replace("hr",rN).replace("heading",` *#{1,6} *[^
|
|
143
143
|
]`).replace("lheading",U_e).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},vAe=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,bAe=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,K_e=/^( {2,}|\\)\n(?!\s*$)/,CAe=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,wx=/[\p{P}\p{S}]/u,aH=/[\s\p{P}\p{S}]/u,eee=/[^\s\p{P}\p{S}]/u,yAe=Cn(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,aH).getRegex(),G_e=/(?!~)[\p{P}\p{S}]/u,wAe=/(?!~)[\s\p{P}\p{S}]/u,SAe=/(?:[^\s\p{P}\p{S}]|~)/u,xAe=Cn(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",rAe?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Y_e=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,kAe=Cn(Y_e,"u").replace(/punct/g,wx).getRegex(),LAe=Cn(Y_e,"u").replace(/punct/g,G_e).getRegex(),Z_e="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",DAe=Cn(Z_e,"gu").replace(/notPunctSpace/g,eee).replace(/punctSpace/g,aH).replace(/punct/g,wx).getRegex(),EAe=Cn(Z_e,"gu").replace(/notPunctSpace/g,SAe).replace(/punctSpace/g,wAe).replace(/punct/g,G_e).getRegex(),IAe=Cn("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,eee).replace(/punctSpace/g,aH).replace(/punct/g,wx).getRegex(),TAe=Cn(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,wx).getRegex(),NAe="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",MAe=Cn(NAe,"gu").replace(/notPunctSpace/g,eee).replace(/punctSpace/g,aH).replace(/punct/g,wx).getRegex(),RAe=Cn(/\\(punct)/,"gu").replace(/punct/g,wx).getRegex(),PAe=Cn(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),OAe=Cn(QJ).replace("(?:-->|$)","-->").getRegex(),AAe=Cn("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",OAe).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),XF=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,FAe=Cn(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",XF).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),X_e=Cn(/^!?\[(label)\]\[(ref)\]/).replace("label",XF).replace("ref",XJ).getRegex(),Q_e=Cn(/^!?\[(ref)\](?:\[\])?/).replace("ref",XJ).getRegex(),BAe=Cn("reflink|nolink(?!\\()","g").replace("reflink",X_e).replace("nolink",Q_e).getRegex(),$le=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,tee={_backpedal:Xv,anyPunctuation:RAe,autolink:PAe,blockSkip:xAe,br:K_e,code:bAe,del:Xv,delLDelim:Xv,delRDelim:Xv,emStrongLDelim:kAe,emStrongRDelimAst:DAe,emStrongRDelimUnd:IAe,escape:vAe,link:FAe,nolink:Q_e,punctuation:yAe,reflink:X_e,reflinkSearch:BAe,tag:AAe,text:CAe,url:Xv},WAe={...tee,link:Cn(/^!?\[(label)\]\((.*?)\)/).replace("label",XF).getRegex(),reflink:Cn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",XF).getRegex()},_U={...tee,emStrongRDelimAst:EAe,emStrongLDelim:LAe,delLDelim:TAe,delRDelim:MAe,url:Cn(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",$le).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Cn(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",$le).getRegex()},HAe={..._U,br:Cn(K_e).replace("{2,}","*").getRegex(),text:Cn(_U.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},gA={normal:JJ,gfm:mAe,pedantic:_Ae},qL={normal:tee,gfm:_U,breaks:HAe,pedantic:WAe},VAe={"&":"&","<":"<",">":">",'"':""","'":"'"},zle=s=>VAe[s];function gh(s,e){if(e){if(tl.escapeTest.test(s))return s.replace(tl.escapeReplace,zle)}else if(tl.escapeTestNoEncode.test(s))return s.replace(tl.escapeReplaceNoEncode,zle);return s}function jle(s){try{s=encodeURI(s).replace(tl.percentDecode,"%")}catch{return null}return s}function Ule(s,e){var r;let t=s.replace(tl.findPipe,(o,a,l)=>{let d=!1,h=a;for(;--h>=0&&l[h]==="\\";)d=!d;return d?"|":" |"}),i=t.split(tl.splitPipe),n=0;if(i[0].trim()||i.shift(),i.length>0&&!((r=i.at(-1))!=null&&r.trim())&&i.pop(),e)if(i.length>e)i.splice(e);else for(;i.length<e;)i.push("");for(;n<i.length;n++)i[n]=i[n].trim().replace(tl.slashPipe,"|");return i}function KL(s,e,t){let i=s.length;if(i===0)return"";let n=0;for(;n<i&&s.charAt(i-n-1)===e;)n++;return s.slice(0,i-n)}function $Ae(s,e){if(s.indexOf(e[1])===-1)return-1;let t=0;for(let i=0;i<s.length;i++)if(s[i]==="\\")i++;else if(s[i]===e[0])t++;else if(s[i]===e[1]&&(t--,t<0))return i;return t>0?-2:-1}function zAe(s,e=0){let t=e,i="";for(let n of s)if(n===" "){let r=4-t%4;i+=" ".repeat(r),t+=r}else i+=n,t++;return i}function qle(s,e,t,i,n){let r=e.href,o=e.title||null,a=s[1].replace(n.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:s[0].charAt(0)==="!"?"image":"link",raw:t,href:r,title:o,text:a,tokens:i.inlineTokens(a)};return i.state.inLink=!1,l}function jAe(s,e,t){let i=s.match(t.other.indentCodeCompensation);if(i===null)return e;let n=i[1];return e.split(`
|
|
144
144
|
`).map(r=>{let o=r.match(t.other.beginningSpace);if(o===null)return r;let[a]=o;return a.length>=n.length?r.slice(n.length):r}).join(`
|
|
145
145
|
`)}var QF=class{constructor(s){di(this,"options");di(this,"rules");di(this,"lexer");this.options=s||Dy}space(s){let e=this.rules.block.newline.exec(s);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(s){let e=this.rules.block.code.exec(s);if(e){let t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:KL(t,`
|
|
@@ -225,7 +225,7 @@ Received: '{1}'.`,e,eD.getLexeme(t)),r=t.offset,o=eD.getLexeme(t);return this._p
|
|
|
225
225
|
`)}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 PHe{constructor(e,t,i,n,r,o,a){this.id=++Jbe,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=n,this.groupOrder=r,this.sourceId=o,this.sourceOrder=a,this.removedResources=null,this.invalidatedResources=null}canSplit(){return typeof this.actual.split=="function"}removeResource(e,t,i){this.removedResources||(this.removedResources=new bde),this.removedResources.has(t)||this.removedResources.set(t,new vde(e,i))}setValid(e,t,i){i?this.invalidatedResources&&(this.invalidatedResources.delete(t),this.invalidatedResources.size===0&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new bde),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new vde(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class eCe{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<this._past.length;t++)e.push(` * [UNDO] ${this._past[t]}`);for(let t=this._future.length-1;t>=0;t--)e.push(` * [REDO] ${this._future[t]}`);return e.join(`
|
|
226
226
|
`)}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){e.type===1?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const i of this._past)t(i.actual)&&this._setElementValidFlag(i,e);for(const i of this._future)t(i.actual)&&this._setElementValidFlag(i,e)}pushElement(e){for(const t of this._future)t.type===1&&t.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let i=0,n=this._past.length;i<n;i++)t.push(this._past[i].id);for(let i=this._future.length-1;i>=0;i--)t.push(this._future[i].id);return new Qbe(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,n=0,r=-1;for(let a=0,l=this._past.length;a<l;a++,n++){const d=this._past[a];i&&(n>=t||d.id!==e.elements[n])&&(i=!1,r=0),!i&&d.type===1&&d.removeResource(this.resourceLabel,this.strResource,0)}let o=-1;for(let a=this._future.length-1;a>=0;a--,n++){const l=this._future[a];i&&(n>=t||l.id!==e.elements[n])&&(i=!1,o=a),!i&&l.type===1&&l.removeResource(this.resourceLabel,this.strResource,0)}r!==-1&&(this._past=this._past.slice(0,r)),o!==-1&&(this._future=this._future.slice(o+1)),this.versionId++}getElements(){const e=[],t=[];for(const i of this._past)e.push(i.actual);for(const i of this._future)t.push(i.actual);return{past:e,future:t}}getClosestPastElement(){return this._past.length===0?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return this._future.length===0?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(e,t){for(let i=this._past.length-1;i>=0;i--)if(this._past[i]===e){t.has(this.strResource)?this._past[i]=t.get(this.strResource):this._past.splice(i,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let i=this._future.length-1;i>=0;i--)if(this._future[i]===e){t.has(this.strResource)?this._future[i]=t.get(this.strResource):this._future.splice(i,1);break}this.versionId++}moveBackward(e){this._past.pop(),this._future.push(e),this.versionId++}moveForward(e){this._future.pop(),this._past.push(e),this.versionId++}}class nz{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,i=this.editStacks.length;t<i;t++)this._versionIds[t]=this.editStacks[t].versionId}isValid(){for(let e=0,t=this.editStacks.length;e<t;e++)if(this._versionIds[e]!==this.editStacks[e].versionId)return!1;return!0}}const tCe=new eCe("","");tCe.locked=!0;let uK=class{constructor(e,t){this._dialogService=e,this._notificationService=t,this._editStacks=new Map,this._uriComparisonKeyComputers=[]}getUriComparisonKey(e){for(const t of this._uriComparisonKeyComputers)if(t[0]===e.scheme)return t[1].getComparisonKey(e);return e.toString()}_print(e){console.log("------------------------------------"),console.log(`AFTER ${e}: `);const t=[];for(const i of this._editStacks)t.push(i[1].toString());console.log(t.join(`
|
|
227
227
|
`))}pushElement(e,t=dK.None,i=ib.None){if(e.type===0){const n=LA(e.resource),r=this.getUriComparisonKey(e.resource);this._pushElement(new DA(e,n,r,t.id,t.nextOrder(),i.id,i.nextOrder()))}else{const n=new Set,r=[],o=[];for(const a of e.resources){const l=LA(a),d=this.getUriComparisonKey(a);n.has(d)||(n.add(d),r.push(l),o.push(d))}r.length===1?this._pushElement(new DA(e,r[0],o[0],t.id,t.nextOrder(),i.id,i.nextOrder())):this._pushElement(new PHe(e,r,o,t.id,t.nextOrder(),i.id,i.nextOrder()))}}_pushElement(e){for(let t=0,i=e.strResources.length;t<i;t++){const n=e.resourceLabels[t],r=e.strResources[t];let o;this._editStacks.has(r)?o=this._editStacks.get(r):(o=new eCe(n,r),this._editStacks.set(r,o)),o.pushElement(e)}}getLastElement(e){const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){const i=this._editStacks.get(t);if(i.hasFutureElements())return null;const n=i.getClosestPastElement();return n?n.actual:null}return null}_splitPastWorkspaceElement(e,t){const i=e.actual.split(),n=new Map;for(const r of i){const o=LA(r.resource),a=this.getUriComparisonKey(r.resource),l=new DA(r,o,a,0,0,0,0);n.set(l.strResource,l)}for(const r of e.strResources){if(t&&t.has(r))continue;this._editStacks.get(r).splitPastWorkspaceElement(e,n)}}_splitFutureWorkspaceElement(e,t){const i=e.actual.split(),n=new Map;for(const r of i){const o=LA(r.resource),a=this.getUriComparisonKey(r.resource),l=new DA(r,o,a,0,0,0,0);n.set(l.strResource,l)}for(const r of e.strResources){if(t&&t.has(r))continue;this._editStacks.get(r).splitFutureWorkspaceElement(e,n)}}removeElements(e){const t=typeof e=="string"?e:this.getUriComparisonKey(e);this._editStacks.has(t)&&(this._editStacks.get(t).dispose(),this._editStacks.delete(t))}setElementsValidFlag(e,t,i){const n=this.getUriComparisonKey(e);this._editStacks.has(n)&&this._editStacks.get(n).setElementsValidFlag(t,i)}createSnapshot(e){const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).createSnapshot(e):new Qbe(e,[])}restoreSnapshot(e){const t=this.getUriComparisonKey(e.resource);if(this._editStacks.has(t)){const i=this._editStacks.get(t);i.restoreSnapshot(e),!i.hasPastElements()&&!i.hasFutureElements()&&(i.dispose(),this._editStacks.delete(t))}}getElements(e){const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).getElements():{past:[],future:[]}}_findClosestUndoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[n,r]of this._editStacks){const o=r.getClosestPastElement();o&&o.sourceId===e&&(!t||o.sourceOrder>t.sourceOrder)&&(t=o,i=n)}return[t,i]}canUndo(e){if(e instanceof ib){const[,i]=this._findClosestUndoElementWithSource(e.id);return!!i}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasPastElements():!1}_onError(e,t){Tt(e);for(const i of t.strResources)this.removeElements(i);this._notificationService.error(e)}_acquireLocks(e){for(const t of e.editStacks)if(t.locked)throw new Error("Cannot acquire edit stack lock");for(const t of e.editStacks)t.locked=!0;return()=>{for(const t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,i,n,r){const o=this._acquireLocks(i);let a;try{a=t()}catch(l){return o(),n.dispose(),this._onError(l,e)}return a?a.then(()=>(o(),n.dispose(),r()),l=>(o(),n.dispose(),this._onError(l,e))):(o(),n.dispose(),r())}async _invokeWorkspacePrepare(e){if(typeof e.actual.prepareUndoRedo>"u")return re.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?re.None:t}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo>"u")return t(re.None);const i=e.actual.prepareUndoRedo();return i?uH(i)?t(i):i.then(n=>t(n)):t(re.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||tCe);return new nz(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(n),new EA(this._undo(e,0,!0));for(const r of t.strResources)this.removeElements(r);return this._notificationService.warn(n),new EA}_checkWorkspaceUndo(e,t,i,n){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(n&&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 r=[];for(const a of i.editStacks)a.getClosestPastElement()!==t&&r.push(a.resourceLabel);if(r.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,r.join(", ")));const o=[];for(const a of i.editStacks)a.locked&&o.push(a.resourceLabel);return o.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,o.join(", "))):i.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,i){const n=this._getAffectedEditStacks(t),r=this._checkWorkspaceUndo(e,t,n,!1);return r?r.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,n,i)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const i=t.getClosestPastElement();if(i){if(i===e){const n=t.getSecondClosestPastElement();if(n&&n.groupId===e.groupId)return!0}if(i.groupId===e.groupId)return!0}}return!1}async _confirmAndExecuteWorkspaceUndo(e,t,i,n){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){let a;(function(h){h[h.All=0]="All",h[h.This=1]="This",h[h.Cancel=2]="Cancel"})(a||(a={}));const{result:l}=await this._dialogService.prompt({type:fs.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",i.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 d=this._checkWorkspaceUndo(e,t,i,!1);if(d)return d.returnValue;n=!0}let r;try{r=await this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}const o=this._checkWorkspaceUndo(e,t,i,!0);if(o)return r.dispose(),o.returnValue;for(const a of i.editStacks)a.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),i,r,()=>this._continueUndoInGroup(t.groupId,n))}_resourceUndo(e,t,i){if(!t.isValid){e.flushAllElements();return}if(e.locked){const n=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(n);return}return this._invokeResourcePrepare(t,n=>(e.moveBackward(t),this._safeInvokeWithLocks(t,()=>t.actual.undo(),new nz([e]),n,()=>this._continueUndoInGroup(t.groupId,i))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,r]of this._editStacks){const o=r.getClosestPastElement();o&&o.groupId===e&&(!t||o.groupOrder>t.groupOrder)&&(t=o,i=n)}return[t,i]}_continueUndoInGroup(e,t){if(!e)return;const[,i]=this._findClosestUndoElementInGroup(e);if(i)return this._undo(i,0,t)}undo(e){if(e instanceof ib){const[,t]=this._findClosestUndoElementWithSource(e.id);return t?this._undo(t,e.id,!1):void 0}return typeof e=="string"?this._undo(e,0,!1):this._undo(this.getUriComparisonKey(e),0,!1)}_undo(e,t=0,i){if(!this._editStacks.has(e))return;const n=this._editStacks.get(e),r=n.getClosestPastElement();if(!r)return;if(r.groupId){const[a,l]=this._findClosestUndoElementInGroup(r.groupId);if(r!==a&&l)return this._undo(l,t,i)}if((r.sourceId!==t||r.confirmBeforeUndo)&&!i)return this._confirmAndContinueUndo(e,t,r);try{return r.type===1?this._workspaceUndo(e,r,i):this._resourceUndo(n,r,i)}finally{}}async _confirmAndContinueUndo(e,t,i){if((await this._dialogService.confirm({message:w("confirmDifferentSource","Would you like to undo '{0}'?",i.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,i=null;for(const[n,r]of this._editStacks){const o=r.getClosestFutureElement();o&&o.sourceId===e&&(!t||o.sourceOrder<t.sourceOrder)&&(t=o,i=n)}return[t,i]}canRedo(e){if(e instanceof ib){const[,i]=this._findClosestRedoElementWithSource(e.id);return!!i}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasFutureElements():!1}_tryToSplitAndRedo(e,t,i,n){if(t.canSplit())return this._splitFutureWorkspaceElement(t,i),this._notificationService.warn(n),new EA(this._redo(e));for(const r of t.strResources)this.removeElements(r);return this._notificationService.warn(n),new EA}_checkWorkspaceRedo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndRedo(e,t,t.removedResources,w({key:"cannotWorkspaceRedo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not redo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(n&&t.invalidatedResources)return this._tryToSplitAndRedo(e,t,t.invalidatedResources,w({key:"cannotWorkspaceRedo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not redo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const r=[];for(const a of i.editStacks)a.getClosestFutureElement()!==t&&r.push(a.resourceLabel);if(r.length>0)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,r.join(", ")));const o=[];for(const a of i.editStacks)a.locked&&o.push(a.resourceLabel);return o.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,o.join(", "))):i.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 i=this._getAffectedEditStacks(t),n=this._checkWorkspaceRedo(e,t,i,!1);return n?n.returnValue:this._executeWorkspaceRedo(e,t,i)}async _executeWorkspaceRedo(e,t,i){let n;try{n=await this._invokeWorkspacePrepare(t)}catch(o){return this._onError(o,t)}const r=this._checkWorkspaceRedo(e,t,i,!0);if(r)return n.dispose(),r.returnValue;for(const o of i.editStacks)o.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),i,n,()=>this._continueRedoInGroup(t.groupId))}_resourceRedo(e,t){if(!t.isValid){e.flushAllElements();return}if(e.locked){const i=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(i);return}return this._invokeResourcePrepare(t,i=>(e.moveForward(t),this._safeInvokeWithLocks(t,()=>t.actual.redo(),new nz([e]),i,()=>this._continueRedoInGroup(t.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,r]of this._editStacks){const o=r.getClosestFutureElement();o&&o.groupId===e&&(!t||o.groupOrder<t.groupOrder)&&(t=o,i=n)}return[t,i]}_continueRedoInGroup(e){if(!e)return;const[,t]=this._findClosestRedoElementInGroup(e);if(t)return this._redo(t)}redo(e){if(e instanceof ib){const[,t]=this._findClosestRedoElementWithSource(e.id);return t?this._redo(t):void 0}return typeof e=="string"?this._redo(e):this._redo(this.getUriComparisonKey(e))}_redo(e){if(!this._editStacks.has(e))return;const t=this._editStacks.get(e),i=t.getClosestFutureElement();if(i){if(i.groupId){const[n,r]=this._findClosestRedoElementInGroup(i.groupId);if(i!==n&&r)return this._redo(r)}try{return i.type===1?this._workspaceRedo(e,i):this._resourceRedo(t,i)}finally{}}}};uK=RHe([_de(0,pN),_de(1,gs)],uK);class EA{constructor(e){this.returnValue=e}}li(Uee,uK,1);function Fo(s,e,t){return Math.min(Math.max(s,e),t)}class iCe{constructor(){this._n=1,this._val=0}update(e){return this._val=this._val+(e-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}}class OHe{constructor(e){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=new Array(e),this._values.fill(0,0,e)}update(e){const t=this._values[this._index];return this._values[this._index]=e,this._index=(this._index+1)%this._values.length,this._sum-=t,this._sum+=e,this._n<this._values.length&&(this._n+=1),this._val=this._sum/this._n,this._val}get value(){return this._val}}const qee=ii("environmentService");var AHe=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Cde=function(s,e){return function(t,i){e(t,i,s)}};const sc=ii("ILanguageFeatureDebounceService");var P4;(function(s){const e=new WeakMap;let t=0;function i(n){let r=e.get(n);return r===void 0&&(r=++t,e.set(n,r)),r}s.of=i})(P4||(P4={}));class FHe{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}}class BHe{constructor(e,t,i,n,r,o){this._logService=e,this._name=t,this._registry=i,this._default=n,this._min=r,this._max=o,this._cache=new lf(50,.7)}_key(e){return e.id+this._registry.all(e).reduce((t,i)=>_H(P4.of(i),t),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?Fo(i.value,this._min,this._max):this.default()}update(e,t){const i=this._key(e);let n=this._cache.get(i);n||(n=new OHe(6),this._cache.set(i,n));const r=Fo(n.update(t),this._min,this._max);return gH(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${r}ms`),r}_overall(){const e=new iCe;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){const e=this._overall()|0||this._default;return Fo(e,this._min,this._max)}}let hK=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,i){const n=(i==null?void 0:i.min)??50,r=(i==null?void 0:i.max)??n**2,o=(i==null?void 0:i.key)??void 0,a=`${P4.of(e)},${n}${o?","+o:""}`;let l=this._data.get(a);return l||(this._isDev?(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),l=new FHe(n*1.5)):l=new BHe(this._logService,t,e,this._overallAverage()|0||n*1.5,n,r),this._data.set(a,l)),l}_overallAverage(){const e=new iCe;for(const t of this._data.values())e.update(t.default());return e.value}};hK=AHe([Cde(0,qr),Cde(1,qee)],hK);li(sc,hK,1);class pa{static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static getClassNameFromMetadata(e){let i="mtk"+this.getForeground(e);const n=this.getFontStyle(e);return n&1&&(i+=" mtki"),n&2&&(i+=" mtkb"),n&4&&(i+=" mtku"),n&8&&(i+=" mtks"),i}static getInlineStyleFromMetadata(e,t){const i=this.getForeground(e),n=this.getFontStyle(e);let r=`color: ${t[i]};`;n&1&&(r+="font-style: italic;"),n&2&&(r+="font-weight: bold;");let o="";return n&4&&(o+=" underline"),n&8&&(o+=" line-through"),o&&(r+=`text-decoration:${o};`),r}static getPresentationFromMetadata(e){const t=this.getForeground(e),i=this.getFontStyle(e);return{foreground:t,italic:!!(i&1),bold:!!(i&2),underline:!!(i&4),strikethrough:!!(i&8)}}}function l_(s){let e=0,t=0,i=0,n=0;for(let r=0,o=s.length;r<o;r++){const a=s.charCodeAt(r);a===13?(e===0&&(t=r),e++,r+1<o&&s.charCodeAt(r+1)===10?(n|=2,r++):n|=3,i=r+1):a===10&&(n|=1,e===0&&(t=r),e++,i=r+1)}return e===0&&(t=s.length),[e,t,s.length-i,n]}class sE{static create(e,t){return new sE(e,new O4(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 W(this._startLineNumber+e.startLineNumber,e.startColumn,this._startLineNumber+e.endLineNumber,e.endColumn)}removeTokens(e){const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;this._startLineNumber+=this._tokens.removeTokens(t,e.startColumn-1,i,e.endColumn-1),this._updateEndLineNumber()}split(e){const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber,[n,r,o]=this._tokens.split(t,e.startColumn-1,i,e.endColumn-1);return[new sE(this._startLineNumber,n),new sE(this._startLineNumber+o,r)]}applyEdit(e,t){const[i,n,r]=l_(t);this.acceptEdit(e,i,n,r,t.length>0?t.charCodeAt(0):0)}acceptEdit(e,t,i,n,r){this._acceptDeleteRange(e),this._acceptInsertText(new ie(e.startLineNumber,e.startColumn),t,i,n,r),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;if(i<0){const r=i-t;this._startLineNumber-=r;return}const n=this._tokens.getMaxDeltaLine();if(!(t>=n+1)){if(t<0&&i>=n+1){this._startLineNumber=0,this._tokens.clear();return}if(t<0){const r=-t;this._startLineNumber-=r,this._tokens.acceptDeleteRange(e.startColumn-1,0,0,i,e.endColumn-1)}else this._tokens.acceptDeleteRange(0,t,e.startColumn-1,i,e.endColumn-1)}}_acceptInsertText(e,t,i,n,r){if(t===0&&i===0)return;const o=e.lineNumber-this._startLineNumber;if(o<0){this._startLineNumber+=t;return}const a=this._tokens.getMaxDeltaLine();o>=a+1||this._tokens.acceptInsertText(o,e.column-1,t,i,n,r)}}class O4{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const t=[];for(let i=0;i<this._tokenCount;i++)t.push(`(${this._getDeltaLine(i)+e},${this._getStartCharacter(i)}-${this._getEndCharacter(i)})`);return`[${t.join(",")}]`}getMaxDeltaLine(){const e=this._getTokenCount();return e===0?-1:this._getDeltaLine(e-1)}getRange(){const e=this._getTokenCount();if(e===0)return null;const t=this._getStartCharacter(0),i=this._getDeltaLine(e-1),n=this._getEndCharacter(e-1);return new W(0,t+1,i,n+1)}_getTokenCount(){return this._tokenCount}_getDeltaLine(e){return this._tokens[4*e]}_getStartCharacter(e){return this._tokens[4*e+1]}_getEndCharacter(e){return this._tokens[4*e+2]}isEmpty(){return this._getTokenCount()===0}getLineTokens(e){let t=0,i=this._getTokenCount()-1;for(;t<i;){const n=t+Math.floor((i-t)/2),r=this._getDeltaLine(n);if(r<e)t=n+1;else if(r>e)i=n-1;else{let o=n;for(;o>t&&this._getDeltaLine(o-1)===e;)o--;let a=n;for(;a<i&&this._getDeltaLine(a+1)===e;)a++;return new yde(this._tokens.subarray(4*o,4*a+4))}}return this._getDeltaLine(t)===e?new yde(this._tokens.subarray(4*t,4*t+4)):null}clear(){this._tokenCount=0}removeTokens(e,t,i,n){const r=this._tokens,o=this._tokenCount;let a=0,l=!1,d=0;for(let h=0;h<o;h++){const f=4*h,p=r[f],m=r[f+1],v=r[f+2],b=r[f+3];if((p>e||p===e&&v>=t)&&(p<i||p===i&&m<=n))l=!0;else{if(a===0&&(d=p),l){const y=4*a;r[y]=p-d,r[y+1]=m,r[y+2]=v,r[y+3]=b}a++}}return this._tokenCount=a,d}split(e,t,i,n){const r=this._tokens,o=this._tokenCount,a=[],l=[];let d=a,h=0,f=0;for(let p=0;p<o;p++){const m=4*p,v=r[m],b=r[m+1],y=r[m+2],x=r[m+3];if(v>e||v===e&&y>=t){if(v<i||v===i&&b<=n)continue;d!==l&&(d=l,h=0,f=v)}d[h++]=v-f,d[h++]=b,d[h++]=y,d[h++]=x}return[new O4(new Uint32Array(a)),new O4(new Uint32Array(l)),f]}acceptDeleteRange(e,t,i,n,r){const o=this._tokens,a=this._tokenCount,l=n-t;let d=0,h=!1;for(let f=0;f<a;f++){const p=4*f;let m=o[p],v=o[p+1],b=o[p+2];const y=o[p+3];if(m<t||m===t&&b<=i){d++;continue}else if(m===t&&v<i)m===n&&b>r?b-=r-i:b=i;else if(m===t&&v===i)if(m===n&&b>r)b-=r-i;else{h=!0;continue}else if(m<n||m===n&&v<r)if(m===n&&b>r)m=t,v=i,b=v+(b-r);else{h=!0;continue}else if(m>n){if(l===0&&!h){d=a;break}m-=l}else if(m===n&&v>=r)e&&m===0&&(v+=e,b+=e),m-=l,v-=r-i,b-=r-i;else throw new Error("Not possible!");const x=4*d;o[x]=m,o[x+1]=v,o[x+2]=b,o[x+3]=y,d++}this._tokenCount=d}acceptInsertText(e,t,i,n,r,o){const a=i===0&&n===1&&(o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122),l=this._tokens,d=this._tokenCount;for(let h=0;h<d;h++){const f=4*h;let p=l[f],m=l[f+1],v=l[f+2];if(!(p<e||p===e&&v<t)){if(p===e&&v===t)if(a)v+=1;else continue;else if(p===e&&m<t&&t<v)i===0?v+=n:v=t;else{if(p===e&&m===t&&a)continue;if(p===e)if(p+=i,i===0)m+=n,v+=n;else{const b=v-m;m=r+(m-t),v=m+b}else p+=i}l[f]=p,l[f+1]=m,l[f+2]=v}}}}class yde{constructor(e){this._tokens=e}getCount(){return this._tokens.length/4}getStartCharacter(e){return this._tokens[4*e+1]}getEndCharacter(e){return this._tokens[4*e+2]}getMetadata(e){return this._tokens[4*e+3]}}var WHe=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},sz=function(s,e){return function(t,i){e(t,i,s)}};let fK=class{constructor(e,t,i,n){this._legend=e,this._themeService=t,this._languageService=i,this._logService=n,this._hasWarnedOverlappingTokens=!1,this._hasWarnedInvalidLengthTokens=!1,this._hasWarnedInvalidEditStart=!1,this._hashTable=new gK}getMetadata(e,t,i){const n=this._languageService.languageIdCodec.encodeLanguageId(i),r=this._hashTable.get(e,t,n);let o;if(r)o=r.metadata;else{let a=this._legend.tokenTypes[e];const l=[];if(a){let d=t;for(let f=0;d>0&&f<this._legend.tokenModifiers.length;f++)d&1&&l.push(this._legend.tokenModifiers[f]),d=d>>1;const h=this._themeService.getColorTheme().getTokenStyleMetadata(a,l,i);if(typeof h>"u")o=2147483647;else{if(o=0,typeof h.italic<"u"){const f=(h.italic?1:0)<<11;o|=f|1}if(typeof h.bold<"u"){const f=(h.bold?2:0)<<11;o|=f|2}if(typeof h.underline<"u"){const f=(h.underline?4:0)<<11;o|=f|4}if(typeof h.strikethrough<"u"){const f=(h.strikethrough?8:0)<<11;o|=f|8}if(h.foreground){const f=h.foreground<<15;o|=f|16}o===0&&(o=2147483647)}}else o=2147483647,a="not-in-legend";this._hashTable.add(e,t,n,o)}return o}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,this._logService.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}warnInvalidLengthSemanticTokens(e,t){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,this._logService.warn(`Semantic token with invalid length detected at lineNumber ${e}, column ${t}`))}warnInvalidEditStart(e,t,i,n,r){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,this._logService.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${i}: The provided start offset ${n} is outside the previous data (length ${r}).`))}};fK=WHe([sz(1,zs),sz(2,Nn),sz(3,qr)],fK);function nCe(s,e,t){const i=s.data,n=s.data.length/5|0,r=Math.max(Math.ceil(n/1024),400),o=[];let a=0,l=1,d=0;for(;a<n;){const h=a;let f=Math.min(h+r,n);if(f<n){let D=f;for(;D-1>h&&i[5*D]===0;)D--;if(D-1===h){let S=f;for(;S+1<n&&i[5*S]===0;)S++;f=S}else f=D}let p=new Uint32Array((f-h)*4),m=0,v=0,b=0,y=0;for(;a<f;){const D=5*a,S=i[D],E=i[D+1],I=l+S|0,R=S===0?d+E|0:E,M=i[D+2],O=R+M|0,H=i[D+3],te=i[D+4];if(O<=R)e.warnInvalidLengthSemanticTokens(I,R+1);else if(b===I&&y>R)e.warnOverlappingSemanticTokens(I,R+1);else{const J=e.getMetadata(H,te,t);J!==2147483647&&(v===0&&(v=I),p[m]=I-v,p[m+1]=R,p[m+2]=O,p[m+3]=J,m+=4,b=I,y=O)}l=I,d=R,a++}m!==p.length&&(p=p.subarray(0,m));const x=sE.create(v,p);o.push(x)}return o}class HHe{constructor(e,t,i,n){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=n,this.next=null}}const Uf=class Uf{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=Uf._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<Uf._SIZES.length?2/3*this._currentLength:0),this._elements=[],Uf._nullOutEntries(this._elements,this._currentLength)}static _nullOutEntries(e,t){for(let i=0;i<t;i++)e[i]=null}_hash2(e,t){return(e<<5)-e+t|0}_hashFunc(e,t,i){return this._hash2(this._hash2(e,t),i)%this._currentLength}get(e,t,i){const n=this._hashFunc(e,t,i);let r=this._elements[n];for(;r;){if(r.tokenTypeIndex===e&&r.tokenModifierSet===t&&r.languageId===i)return r;r=r.next}return null}add(e,t,i,n){if(this._elementsCount++,this._growCount!==0&&this._elementsCount>=this._growCount){const r=this._elements;this._currentLengthIndex++,this._currentLength=Uf._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<Uf._SIZES.length?2/3*this._currentLength:0),this._elements=[],Uf._nullOutEntries(this._elements,this._currentLength);for(const o of r){let a=o;for(;a;){const l=a.next;a.next=null,this._add(a),a=l}}}this._add(new HHe(e,t,i,n))}_add(e){const t=this._hashFunc(e.tokenTypeIndex,e.tokenModifierSet,e.languageId);e.next=this._elements[t],this._elements[t]=e}};Uf._SIZES=[3,7,13,31,61,127,251,509,1021,2039,4093,8191,16381,32749,65521,131071,262139,524287,1048573,2097143];let gK=Uf;const AH=ii("semanticTokensStylingService");var VHe=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},rz=function(s,e){return function(t,i){e(t,i,s)}};let pK=class extends re{constructor(e,t,i){super(),this._themeService=e,this._logService=t,this._languageService=i,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange(()=>{this._caches=new WeakMap}))}getStyling(e){return this._caches.has(e)||this._caches.set(e,new fK(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};pK=VHe([rz(0,zs),rz(1,qr),rz(2,Nn)],pK);li(AH,pK,1);function Np(s){return s===47||s===92}function sCe(s){return s.replace(/[\\/]/g,bs.sep)}function $He(s){return s.indexOf("/")===-1&&(s=sCe(s)),/^[a-zA-Z]:(\/|$)/.test(s)&&(s="/"+s),s}function wde(s,e=bs.sep){if(!s)return"";const t=s.length,i=s.charCodeAt(0);if(Np(i)){if(Np(s.charCodeAt(1))&&!Np(s.charCodeAt(2))){let r=3;const o=r;for(;r<t&&!Np(s.charCodeAt(r));r++);if(o!==r&&!Np(s.charCodeAt(r+1))){for(r+=1;r<t;r++)if(Np(s.charCodeAt(r)))return s.slice(0,r+1).replace(/[\\/]/g,e)}}return e}else if(rCe(i)&&s.charCodeAt(1)===58)return Np(s.charCodeAt(2))?s.slice(0,2)+e:s.slice(0,2);let n=s.indexOf("://");if(n!==-1){for(n+=3;n<t;n++)if(Np(s.charCodeAt(n)))return s.slice(0,n+1)}return""}function mK(s,e,t,i=ku){if(s===e)return!0;if(!s||!e||e.length>s.length)return!1;if(t){if(!vee(s,e))return!1;if(e.length===s.length)return!0;let r=e.length;return e.charAt(e.length-1)===i&&r--,s.charAt(r)===i}return e.charAt(e.length-1)!==i&&(e+=i),s.indexOf(e)===0}function rCe(s){return s>=65&&s<=90||s>=97&&s<=122}function zHe(s,e=Ur){return e?rCe(s.charCodeAt(0))&&s.charCodeAt(1)===58:!1}const IA="**",Sde="/",X2="[/\\\\]",Q2="[^/\\\\]",jHe=/\//g;function xde(s,e){switch(s){case 0:return"";case 1:return`${Q2}*?`;default:return`(?:${X2}|${Q2}+${X2}${e?`|${X2}${Q2}+`:""})*?`}}function kde(s,e){if(!s)return[];const t=[];let i=!1,n=!1,r="";for(const o of s){switch(o){case e:if(!i&&!n){t.push(r),r="";continue}break;case"{":i=!0;break;case"}":i=!1;break;case"[":n=!0;break;case"]":n=!1;break}r+=o}return r&&t.push(r),t}function oCe(s){if(!s)return"";let e="";const t=kde(s,Sde);if(t.every(i=>i===IA))e=".*";else{let i=!1;t.forEach((n,r)=>{if(n===IA){if(i)return;e+=xde(2,r===t.length-1)}else{let o=!1,a="",l=!1,d="";for(const h of n){if(h!=="}"&&o){a+=h;continue}if(l&&(h!=="]"||!d)){let f;h==="-"?f=h:(h==="^"||h==="!")&&!d?f="^":h===Sde?f="":f=Xl(h),d+=f;continue}switch(h){case"{":o=!0;continue;case"[":l=!0;continue;case"}":{const p=`(?:${kde(a,",").map(m=>oCe(m)).join("|")})`;e+=p,o=!1,a="";break}case"]":{e+="["+d+"]",l=!1,d="";break}case"?":e+=Q2;continue;case"*":e+=xde(1);continue;default:e+=Xl(h)}}r<t.length-1&&(t[r+1]!==IA||r+2<t.length)&&(e+=X2)}i=n===IA})}return e}const UHe=/^\*\*\/\*\.[\w\.-]+$/,qHe=/^\*\*\/([\w\.-]+)\/?$/,KHe=/^{\*\*\/\*?[\w\.-]+\/?(,\*\*\/\*?[\w\.-]+\/?)*}$/,GHe=/^{\*\*\/\*?[\w\.-]+(\/(\*\*)?)?(,\*\*\/\*?[\w\.-]+(\/(\*\*)?)?)*}$/,YHe=/^\*\*((\/[\w\.-]+)+)\/?$/,ZHe=/^([\w\.-]+(\/[\w\.-]+)*)\/?$/,Lde=new lf(1e4),Dde=function(){return!1},Uh=function(){return null};function Kee(s,e){if(!s)return Uh;let t;typeof s!="string"?t=s.pattern:t=s,t=t.trim();const i=`${t}_${!!e.trimForExclusions}`;let n=Lde.get(i);if(n)return Ede(n,s);let r;return UHe.test(t)?n=XHe(t.substr(4),t):(r=qHe.exec(oz(t,e)))?n=QHe(r[1],t):(e.trimForExclusions?GHe:KHe).test(t)?n=JHe(t,e):(r=YHe.exec(oz(t,e)))?n=Ide(r[1].substr(1),t,!0):(r=ZHe.exec(oz(t,e)))?n=Ide(r[1],t,!1):n=eVe(t),Lde.set(i,n),Ede(n,s)}function Ede(s,e){if(typeof e=="string")return s;const t=function(i,n){return mK(i,e.base,!Yo)?s(lN(i.substr(e.base.length),ku),n):null};return t.allBasenames=s.allBasenames,t.allPaths=s.allPaths,t.basenames=s.basenames,t.patterns=s.patterns,t}function oz(s,e){return e.trimForExclusions&&s.endsWith("/**")?s.substr(0,s.length-2):s}function XHe(s,e){return function(t,i){return typeof t=="string"&&t.endsWith(s)?e:null}}function QHe(s,e){const t=`/${s}`,i=`\\${s}`,n=function(o,a){return typeof o!="string"?null:a?a===s?e:null:o===s||o.endsWith(t)||o.endsWith(i)?e:null},r=[s];return n.basenames=r,n.patterns=[e],n.allBasenames=r,n}function JHe(s,e){const t=lCe(s.slice(1,-1).split(",").map(a=>Kee(a,e)).filter(a=>a!==Uh),s),i=t.length;if(!i)return Uh;if(i===1)return t[0];const n=function(a,l){for(let d=0,h=t.length;d<h;d++)if(t[d](a,l))return s;return null},r=t.find(a=>!!a.allBasenames);r&&(n.allBasenames=r.allBasenames);const o=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return o.length&&(n.allPaths=o),n}function Ide(s,e,t){const i=ku===bs.sep,n=i?s:s.replace(jHe,ku),r=ku+n,o=bs.sep+s;let a;return t?a=function(l,d){return typeof l=="string"&&(l===n||l.endsWith(r)||!i&&(l===s||l.endsWith(o)))?e:null}:a=function(l,d){return typeof l=="string"&&(l===n||!i&&l===s)?e:null},a.allPaths=[(t?"*/":"./")+s],a}function eVe(s){try{const e=new RegExp(`^${oCe(s)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?s:null}}catch{return Uh}}function tVe(s,e,t){return!s||typeof e!="string"?!1:aCe(s)(e,void 0,t)}function aCe(s,e={}){if(!s)return Dde;if(typeof s=="string"||iVe(s)){const t=Kee(s,e);if(t===Uh)return Dde;const i=function(n,r){return!!t(n,r)};return t.allBasenames&&(i.allBasenames=t.allBasenames),t.allPaths&&(i.allPaths=t.allPaths),i}return nVe(s,e)}function iVe(s){const e=s;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function nVe(s,e){const t=lCe(Object.getOwnPropertyNames(s).map(a=>sVe(a,s[a],e)).filter(a=>a!==Uh)),i=t.length;if(!i)return Uh;if(!t.some(a=>!!a.requiresSiblings)){if(i===1)return t[0];const a=function(h,f){let p;for(let m=0,v=t.length;m<v;m++){const b=t[m](h,f);if(typeof b=="string")return b;Mq(b)&&(p||(p=[]),p.push(b))}return p?(async()=>{for(const m of p){const v=await m;if(typeof v=="string")return v}return null})():null},l=t.find(h=>!!h.allBasenames);l&&(a.allBasenames=l.allBasenames);const d=t.reduce((h,f)=>f.allPaths?h.concat(f.allPaths):h,[]);return d.length&&(a.allPaths=d),a}const n=function(a,l,d){let h,f;for(let p=0,m=t.length;p<m;p++){const v=t[p];v.requiresSiblings&&d&&(l||(l=km(a)),h||(h=l.substr(0,l.length-$4e(a).length)));const b=v(a,l,h,d);if(typeof b=="string")return b;Mq(b)&&(f||(f=[]),f.push(b))}return f?(async()=>{for(const p of f){const m=await p;if(typeof m=="string")return m}return null})():null},r=t.find(a=>!!a.allBasenames);r&&(n.allBasenames=r.allBasenames);const o=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return o.length&&(n.allPaths=o),n}function sVe(s,e,t){if(e===!1)return Uh;const i=Kee(s,t);if(i===Uh)return Uh;if(typeof e=="boolean")return i;if(e){const n=e.when;if(typeof n=="string"){const r=(o,a,l,d)=>{if(!d||!i(o,a))return null;const h=n.replace("$(basename)",()=>l),f=d(h);return Mq(f)?f.then(p=>p?s:null):f?s:null};return r.requiresSiblings=!0,r}}return i}function lCe(s,e){const t=s.filter(a=>!!a.basenames);if(t.length<2)return s;const i=t.reduce((a,l)=>{const d=l.basenames;return d?a.concat(d):a},[]);let n;if(e){n=[];for(let a=0,l=i.length;a<l;a++)n.push(e)}else n=t.reduce((a,l)=>{const d=l.patterns;return d?a.concat(d):a},[]);const r=function(a,l){if(typeof a!="string")return null;if(!l){let h;for(h=a.length;h>0;h--){const f=a.charCodeAt(h-1);if(f===47||f===92)break}l=a.substr(h)}const d=i.indexOf(l);return d!==-1?n[d]:null};r.basenames=i,r.patterns=n,r.allBasenames=i;const o=s.filter(a=>!a.basenames);return o.push(r),o}function Gee(s,e,t,i,n,r){if(Array.isArray(s)){let o=0;for(const a of s){const l=Gee(a,e,t,i,n,r);if(l===10)return l;l>o&&(o=l)}return o}else{if(typeof s=="string")return i?s==="*"?5:s===t?10:0:0;if(s){const{language:o,pattern:a,scheme:l,hasAccessToAllModels:d,notebookType:h}=s;if(!i&&!d)return 0;h&&n&&(e=n);let f=0;if(l)if(l===e.scheme)f=10;else if(l==="*")f=5;else return 0;if(o)if(o===t)f=10;else if(o==="*")f=Math.max(f,5);else return 0;if(h)if(h===r)f=10;else if(h==="*"&&r!==void 0)f=Math.max(f,5);else return 0;if(a){let p;if(typeof a=="string"?p=a:p={...a,base:xve(a.base)},p===e.fsPath||tVe(p,e.fsPath))f=10;else return 0}return f}else return 0}}function cCe(s){return typeof s=="string"?!1:Array.isArray(s)?s.every(cCe):!!s.exclusive}class Tde{constructor(e,t,i,n,r){this.uri=e,this.languageId=t,this.notebookUri=i,this.notebookType=n,this.recursive=r}equals(e){var t,i;return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&((t=this.notebookUri)==null?void 0:t.toString())===((i=e.notebookUri)==null?void 0:i.toString())&&this.recursive===e.recursive}}class Rn{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new se,this.onDidChange=this._onDidChange.event}register(e,t){let i={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(i),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),dt(()=>{if(i){const n=this._entries.indexOf(i);n>=0&&(this._entries.splice(n,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),i=void 0)}})}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e,!1);const t=[];for(const i of this._entries)i._score>0&&t.push(i.provider);return t}ordered(e,t=!1){const i=[];return this._orderedForEach(e,t,n=>i.push(n.provider)),i}orderedGroups(e){const t=[];let i,n;return this._orderedForEach(e,!1,r=>{i&&n===r._score?i.push(r.provider):(n=r._score,i=[r.provider],t.push(i))}),t}_orderedForEach(e,t,i){this._updateScores(e,t);for(const n of this._entries)n._score>0&&i(n)}_updateScores(e,t){var r,o;const i=(r=this._notebookInfoResolver)==null?void 0:r.call(this,e.uri),n=i?new Tde(e.uri,e.getLanguageId(),i.uri,i.type,t):new Tde(e.uri,e.getLanguageId(),void 0,void 0,t);if(!((o=this._lastCandidate)!=null&&o.equals(n))){this._lastCandidate=n;for(const a of this._entries)if(a._score=Gee(a.selector,n.uri,n.languageId,Bbe(e),n.notebookUri,n.notebookType),cCe(a.selector)&&a._score>0)if(t)a._score=0;else{for(const l of this._entries)l._score=0;a._score=1e3;break}this._entries.sort(Rn._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._score<t._score?1:e._score>t._score?-1:ND(e.selector)&&!ND(t.selector)?1:!ND(e.selector)&&ND(t.selector)?-1:e._time<t._time?1:e._time>t._time?-1:0}}function ND(s){return typeof s=="string"?!1:Array.isArray(s)?s.some(ND):!!s.isBuiltin}class rVe{constructor(){this.referenceProvider=new Rn(this._score.bind(this)),this.renameProvider=new Rn(this._score.bind(this)),this.newSymbolNamesProvider=new Rn(this._score.bind(this)),this.codeActionProvider=new Rn(this._score.bind(this)),this.definitionProvider=new Rn(this._score.bind(this)),this.typeDefinitionProvider=new Rn(this._score.bind(this)),this.declarationProvider=new Rn(this._score.bind(this)),this.implementationProvider=new Rn(this._score.bind(this)),this.documentSymbolProvider=new Rn(this._score.bind(this)),this.inlayHintsProvider=new Rn(this._score.bind(this)),this.colorProvider=new Rn(this._score.bind(this)),this.codeLensProvider=new Rn(this._score.bind(this)),this.documentFormattingEditProvider=new Rn(this._score.bind(this)),this.documentRangeFormattingEditProvider=new Rn(this._score.bind(this)),this.onTypeFormattingEditProvider=new Rn(this._score.bind(this)),this.signatureHelpProvider=new Rn(this._score.bind(this)),this.hoverProvider=new Rn(this._score.bind(this)),this.documentHighlightProvider=new Rn(this._score.bind(this)),this.multiDocumentHighlightProvider=new Rn(this._score.bind(this)),this.selectionRangeProvider=new Rn(this._score.bind(this)),this.foldingRangeProvider=new Rn(this._score.bind(this)),this.linkProvider=new Rn(this._score.bind(this)),this.inlineCompletionsProvider=new Rn(this._score.bind(this)),this.inlineEditProvider=new Rn(this._score.bind(this)),this.completionProvider=new Rn(this._score.bind(this)),this.linkedEditingRangeProvider=new Rn(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new Rn(this._score.bind(this)),this.documentSemanticTokensProvider=new Rn(this._score.bind(this)),this.documentDropEditProvider=new Rn(this._score.bind(this)),this.documentPasteEditProvider=new Rn(this._score.bind(this))}_score(e){var t;return(t=this._notebookTypeResolver)==null?void 0:t.call(this,e)}}li(it,rVe,1);function Yee(s){return`--vscode-${s.replace(/\./g,"-")}`}function Ge(s){return`var(${Yee(s)})`}function oVe(s,e){return`var(${Yee(s)}, ${e})`}function aVe(s){return s!==null&&typeof s=="object"&&"light"in s&&"dark"in s}const dCe={ColorContribution:"base.contributions.colors"},lVe="default";class cVe{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,i,n=!1,r){const o={id:e,description:i,defaults:t,needsTransparency:n,deprecationMessage:r};this.colorsById[e]=o;const a={type:"string",format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return r&&(a.deprecationMessage=r),n&&(a.pattern="^#(?:(?<rgba>[0-9a-fA-f]{3}[0-9a-eA-E])|(?:[0-9a-fA-F]{6}(?:(?![fF]{2})(?:[0-9a-fA-F]{2}))))?$",a.patternErrorMessage=w("transparecyRequired","This color must be transparent or it will obscure content")),this.colorSchema.properties[e]={description:i,oneOf:[a,{type:"string",const:lVe,description:w("useDefault","Use the default color.")}]},this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(i),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map(e=>this.colorsById[e])}resolveDefaultColor(e,t){const i=this.colorsById[e];if(i!=null&&i.defaults){const n=aVe(i.defaults)?i.defaults[t.type]:i.defaults;return Qd(n,t)}}getColorSchema(){return this.colorSchema}toString(){const e=(t,i)=>{const n=t.indexOf(".")===-1?0:1,r=i.indexOf(".")===-1?0:1;return n!==r?n-r:t.localeCompare(i)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(`
|
|
228
|
-
`)}}const FH=new cVe;Fn.add(dCe.ColorContribution,FH);function q(s,e,t,i,n){return FH.registerColor(s,e,t,i,n)}function dVe(s,e){var t,i,n,r;switch(s.op){case 0:return(t=Qd(s.value,e))==null?void 0:t.darken(s.factor);case 1:return(i=Qd(s.value,e))==null?void 0:i.lighten(s.factor);case 2:return(n=Qd(s.value,e))==null?void 0:n.transparent(s.factor);case 3:{const o=Qd(s.background,e);return o?(r=Qd(s.value,e))==null?void 0:r.makeOpaque(o):Qd(s.value,e)}case 4:for(const o of s.values){const a=Qd(o,e);if(a)return a}return;case 6:return Qd(e.defines(s.if)?s.then:s.else,e);case 5:{const o=Qd(s.value,e);if(!o)return;const a=Qd(s.background,e);return a?o.isDarkerThan(a)?be.getLighterColor(o,a,s.factor).transparent(s.transparency):be.getDarkerColor(o,a,s.factor).transparent(s.transparency):o.transparent(s.factor*s.transparency)}default:throw IH()}}function My(s,e){return{op:0,value:s,factor:e}}function Iu(s,e){return{op:1,value:s,factor:e}}function jt(s,e){return{op:2,value:s,factor:e}}function MI(...s){return{op:4,values:s}}function uVe(s,e,t){return{op:6,if:s,then:e,else:t}}function Nde(s,e,t,i){return{op:5,value:s,background:e,factor:t,transparency:i}}function Qd(s,e){if(s!==null){if(typeof s=="string")return s[0]==="#"?be.fromHex(s):e.getColor(s);if(s instanceof be)return s;if(typeof s=="object")return dVe(s,e)}}const uCe="vscode://schemas/workbench-colors",hCe=Fn.as(RH.JSONContribution);hCe.registerSchema(uCe,FH.getColorSchema());const Mde=new ji(()=>hCe.notifySchemaChanged(uCe),200);FH.onDidChangeSchema(()=>{Mde.isScheduled()||Mde.schedule()});const Zt=q("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."));q("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."));q("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."));q("descriptionForeground",{light:"#717171",dark:jt(Zt,.7),hcDark:jt(Zt,.7),hcLight:jt(Zt,.7)},w("descriptionForeground","Foreground color for description text providing additional information, for example for a label."));const A4=q("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},w("iconForeground","The default color for icons in the workbench.")),Xh=q("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.")),fi=q("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},w("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),yn=q("contrastActiveBorder",{light:null,dark:null,hcDark:Xh,hcLight:Xh},w("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast."));q("selection.background",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."));const hVe=q("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},w("textLinkForeground","Foreground color for links in text."));q("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."));q("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:be.black,hcLight:"#292929"},w("textSeparatorForeground","Color for text separators."));q("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#000000",hcLight:"#FFFFFF"},w("textPreformatForeground","Foreground color for preformatted text segments."));q("textPreformat.background",{light:"#0000001A",dark:"#FFFFFF1A",hcDark:"#FFFFFF",hcLight:"#09345f"},w("textPreformatBackground","Background color for preformatted text segments."));q("textBlockQuote.background",{light:"#f2f2f2",dark:"#222222",hcDark:null,hcLight:"#F2F2F2"},w("textBlockQuoteBackground","Background color for block quotes in text."));q("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:be.white,hcLight:"#292929"},w("textBlockQuoteBorder","Border color for block quotes in text."));q("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:be.black,hcLight:"#F2F2F2"},w("textCodeBlockBackground","Background color for code blocks in text."));q("sash.hoverBorder",Xh,w("sashActiveBorder","Border color of active sashes."));const J2=q("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:be.black,hcLight:"#0F4A85"},w("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),fVe=q("badge.foreground",{dark:be.white,light:"#333",hcDark:be.white,hcLight:be.white},w("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),Zee=q("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},w("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),fCe=q("scrollbarSlider.background",{dark:be.fromHex("#797979").transparent(.4),light:be.fromHex("#646464").transparent(.4),hcDark:jt(fi,.6),hcLight:jt(fi,.4)},w("scrollbarSliderBackground","Scrollbar slider background color.")),gCe=q("scrollbarSlider.hoverBackground",{dark:be.fromHex("#646464").transparent(.7),light:be.fromHex("#646464").transparent(.7),hcDark:jt(fi,.8),hcLight:jt(fi,.8)},w("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),pCe=q("scrollbarSlider.activeBackground",{dark:be.fromHex("#BFBFBF").transparent(.4),light:be.fromHex("#000000").transparent(.6),hcDark:fi,hcLight:fi},w("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),gVe=q("progressBar.background",{dark:be.fromHex("#0E70C0"),light:be.fromHex("#0E70C0"),hcDark:fi,hcLight:fi},w("progressBarBackground","Background color of the progress bar that can show for long running operations.")),Md=q("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:be.black,hcLight:be.white},w("editorBackground","Editor background color.")),cf=q("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:be.white,hcLight:Zt},w("editorForeground","Editor default foreground color."));q("editorStickyScroll.background",Md,w("editorStickyScrollBackground","Background color of sticky scroll in the editor"));q("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:be.fromHex("#0F4A85").transparent(.1)},w("editorStickyScrollHoverBackground","Background color of sticky scroll on hover in the editor"));q("editorStickyScroll.border",{dark:null,light:null,hcDark:fi,hcLight:fi},w("editorStickyScrollBorder","Border color of sticky scroll in the editor"));q("editorStickyScroll.shadow",Zee,w("editorStickyScrollShadow"," Shadow color of sticky scroll in the editor"));const Ul=q("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:be.white},w("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),BH=q("editorWidget.foreground",Zt,w("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),Xee=q("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:fi,hcLight:fi},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."));q("editorWidget.resizeBorder",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."));q("editorError.background",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 WH=q("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},w("editorError.foreground","Foreground color of error squigglies in the editor.")),pVe=q("editorError.border",{dark:null,light:null,hcDark:be.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},w("errorBorder","If set, color of double underlines for errors in the editor.")),mVe=q("editorWarning.background",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),Og=q("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},w("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),RI=q("editorWarning.border",{dark:null,light:null,hcDark:be.fromHex("#FFCC00").transparent(.8),hcLight:be.fromHex("#FFCC00").transparent(.8)},w("warningBorder","If set, color of double underlines for warnings in the editor."));q("editorInfo.background",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 Qh=q("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},w("editorInfo.foreground","Foreground color of info squigglies in the editor.")),PI=q("editorInfo.border",{dark:null,light:null,hcDark:be.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},w("infoBorder","If set, color of double underlines for infos in the editor.")),_Ve=q("editorHint.foreground",{dark:be.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},w("editorHint.foreground","Foreground color of hint squigglies in the editor."));q("editorHint.border",{dark:null,light:null,hcDark:be.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},w("hintBorder","If set, color of double underlines for hints in the editor."));const vVe=q("editorLink.activeForeground",{dark:"#4E94CE",light:be.blue,hcDark:be.cyan,hcLight:"#292929"},w("activeLinkForeground","Color of active links.")),am=q("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},w("editorSelectionBackground","Color of the editor selection.")),bVe=q("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:be.white},w("editorSelectionForeground","Color of the selected text for high contrast.")),mCe=q("editor.inactiveSelectionBackground",{light:jt(am,.5),dark:jt(am,.5),hcDark:jt(am,.7),hcLight:jt(am,.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),Qee=q("editor.selectionHighlightBackground",{light:Nde(am,Md,.3,.6),dark:Nde(am,Md,.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);q("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:yn,hcLight:yn},w("editorSelectionHighlightBorder","Border color for regions with the same content as the selection."));q("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},w("editorFindMatch","Color of the current search match."));const CVe=q("editor.findMatchForeground",null,w("editorFindMatchForeground","Text color of the current search match.")),dg=q("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),yVe=q("editor.findMatchHighlightForeground",null,w("findMatchHighlightForeground","Foreground color of the other search matches."),!0);q("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);q("editor.findMatchBorder",{light:null,dark:null,hcDark:yn,hcLight:yn},w("editorFindMatchBorder","Border color of the current search match."));const lm=q("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:yn,hcLight:yn},w("findMatchHighlightBorder","Border color of the other search matches.")),wVe=q("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:jt(yn,.4),hcLight:jt(yn,.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);q("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 F4=q("editorHoverWidget.background",Ul,w("hoverBackground","Background color of the editor hover."));q("editorHoverWidget.foreground",BH,w("hoverForeground","Foreground color of the editor hover."));const _Ce=q("editorHoverWidget.border",Xee,w("hoverBorder","Border color of the editor hover."));q("editorHoverWidget.statusBarBackground",{dark:Iu(F4,.2),light:My(F4,.05),hcDark:Ul,hcLight:Ul},w("statusBarBackground","Background color of the editor hover status bar."));const Jee=q("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:be.white,hcLight:be.black},w("editorInlayHintForeground","Foreground color of inline hints")),ete=q("editorInlayHint.background",{dark:jt(J2,.1),light:jt(J2,.1),hcDark:jt(be.white,.1),hcLight:jt(J2,.1)},w("editorInlayHintBackground","Background color of inline hints")),SVe=q("editorInlayHint.typeForeground",Jee,w("editorInlayHintForegroundTypes","Foreground color of inline hints for types")),xVe=q("editorInlayHint.typeBackground",ete,w("editorInlayHintBackgroundTypes","Background color of inline hints for types")),kVe=q("editorInlayHint.parameterForeground",Jee,w("editorInlayHintForegroundParameter","Foreground color of inline hints for parameters")),LVe=q("editorInlayHint.parameterBackground",ete,w("editorInlayHintBackgroundParameter","Background color of inline hints for parameters")),DVe=q("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},w("editorLightBulbForeground","The color used for the lightbulb actions icon."));q("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon."));q("editorLightBulbAi.foreground",DVe,w("editorLightBulbAiForeground","The color used for the lightbulb AI icon."));q("editor.snippetTabstopHighlightBackground",{dark:new be(new mi(124,124,124,.3)),light:new be(new mi(10,50,100,.2)),hcDark:new be(new mi(124,124,124,.3)),hcLight:new be(new mi(10,50,100,.2))},w("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop."));q("editor.snippetTabstopHighlightBorder",null,w("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop."));q("editor.snippetFinalTabstopHighlightBackground",null,w("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet."));q("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new be(new mi(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},w("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet."));const _K=new be(new mi(155,185,85,.2)),vK=new be(new mi(255,0,0,.2)),EVe=q("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),IVe=q("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);q("diffEditor.insertedLineBackground",{dark:_K,light:_K,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);q("diffEditor.removedLineBackground",{dark:vK,light:vK,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);q("diffEditorGutter.insertedLineBackground",null,w("diffEditorInsertedLineGutter","Background color for the margin where lines got inserted."));q("diffEditorGutter.removedLineBackground",null,w("diffEditorRemovedLineGutter","Background color for the margin where lines got removed."));const TVe=q("diffEditorOverview.insertedForeground",null,w("diffEditorOverviewInserted","Diff overview ruler foreground for inserted content.")),NVe=q("diffEditorOverview.removedForeground",null,w("diffEditorOverviewRemoved","Diff overview ruler foreground for removed content."));q("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},w("diffEditorInsertedOutline","Outline color for the text that got inserted."));q("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},w("diffEditorRemovedOutline","Outline color for text that got removed."));q("diffEditor.border",{dark:null,light:null,hcDark:fi,hcLight:fi},w("diffEditorBorder","Border color between the two text editors."));q("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."));q("diffEditor.unchangedRegionBackground","sideBar.background",w("diffEditor.unchangedRegionBackground","The background color of unchanged blocks in the diff editor."));q("diffEditor.unchangedRegionForeground","foreground",w("diffEditor.unchangedRegionForeground","The foreground color of unchanged blocks in the diff editor."));q("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},w("diffEditor.unchangedCodeBackground","The background color of unchanged code in the diff editor."));const Nx=q("widget.shadow",{dark:jt(be.black,.36),light:jt(be.black,.16),hcDark:null,hcLight:null},w("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),vCe=q("widget.border",{dark:null,light:null,hcDark:fi,hcLight:fi},w("widgetBorder","Border color of widgets such as find/replace inside the editor.")),Rde=q("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},w("toolbarHoverBackground","Toolbar background when hovering over actions using the mouse"));q("toolbar.hoverOutline",{dark:null,light:null,hcDark:yn,hcLight:yn},w("toolbarHoverOutline","Toolbar outline when hovering over actions using the mouse"));q("toolbar.activeBackground",{dark:Iu(Rde,.1),light:My(Rde,.1),hcDark:null,hcLight:null},w("toolbarActiveBackground","Toolbar background when holding the mouse over actions"));const MVe=q("breadcrumb.foreground",jt(Zt,.8),w("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),RVe=q("breadcrumb.background",Md,w("breadcrumbsBackground","Background color of breadcrumb items.")),Pde=q("breadcrumb.focusForeground",{light:My(Zt,.2),dark:Iu(Zt,.1),hcDark:Iu(Zt,.1),hcLight:Iu(Zt,.1)},w("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),PVe=q("breadcrumb.activeSelectionForeground",{light:My(Zt,.2),dark:Iu(Zt,.1),hcDark:Iu(Zt,.1),hcLight:Iu(Zt,.1)},w("breadcrumbsSelectedForeground","Color of selected breadcrumb items."));q("breadcrumbPicker.background",Ul,w("breadcrumbsSelectedBackground","Background color of breadcrumb item picker."));const bCe=.5,Ode=be.fromHex("#40C8AE").transparent(bCe),Ade=be.fromHex("#40A6FF").transparent(bCe),Fde=be.fromHex("#606060").transparent(.4),tte=.4,RS=1,bK=q("merge.currentHeaderBackground",{dark:Ode,light:Ode,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);q("merge.currentContentBackground",jt(bK,tte),w("mergeCurrentContentBackground","Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const CK=q("merge.incomingHeaderBackground",{dark:Ade,light:Ade,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);q("merge.incomingContentBackground",jt(CK,tte),w("mergeIncomingContentBackground","Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const yK=q("merge.commonHeaderBackground",{dark:Fde,light:Fde,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);q("merge.commonContentBackground",jt(yK,tte),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 PS=q("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},w("mergeBorder","Border color on headers and the splitter in inline merge-conflicts."));q("editorOverviewRuler.currentContentForeground",{dark:jt(bK,RS),light:jt(bK,RS),hcDark:PS,hcLight:PS},w("overviewRulerCurrentContentForeground","Current overview ruler foreground for inline merge-conflicts."));q("editorOverviewRuler.incomingContentForeground",{dark:jt(CK,RS),light:jt(CK,RS),hcDark:PS,hcLight:PS},w("overviewRulerIncomingContentForeground","Incoming overview ruler foreground for inline merge-conflicts."));q("editorOverviewRuler.commonContentForeground",{dark:jt(yK,RS),light:jt(yK,RS),hcDark:PS,hcLight:PS},w("overviewRulerCommonContentForeground","Common ancestor overview ruler foreground for inline merge-conflicts."));const az=q("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:"#AB5A00"},w("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),CCe=q("editorOverviewRuler.selectionHighlightForeground","#A0A0A0CC",w("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),OVe=q("problemsErrorIcon.foreground",WH,w("problemsErrorIconForeground","The color used for the problems error icon.")),AVe=q("problemsWarningIcon.foreground",Og,w("problemsWarningIconForeground","The color used for the problems warning icon.")),FVe=q("problemsInfoIcon.foreground",Qh,w("problemsInfoIconForeground","The color used for the problems info icon.")),wK=q("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},w("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),HH=q("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},w("minimapSelectionOccurrenceHighlight","Minimap marker color for repeating editor selections."),!0),Bde=q("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},w("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0),BVe=q("minimap.infoHighlight",{dark:Qh,light:Qh,hcDark:PI,hcLight:PI},w("minimapInfo","Minimap marker color for infos.")),WVe=q("minimap.warningHighlight",{dark:Og,light:Og,hcDark:RI,hcLight:RI},w("overviewRuleWarning","Minimap marker color for warnings.")),HVe=q("minimap.errorHighlight",{dark:new be(new mi(255,18,18,.7)),light:new be(new mi(255,18,18,.7)),hcDark:new be(new mi(255,50,50,1)),hcLight:"#B5200D"},w("minimapError","Minimap marker color for errors.")),VVe=q("minimap.background",null,w("minimapBackground","Minimap background color.")),$Ve=q("minimap.foregroundOpacity",be.fromHex("#000f"),w("minimapForegroundOpacity",'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));q("minimapSlider.background",jt(fCe,.5),w("minimapSliderBackground","Minimap slider background color."));q("minimapSlider.hoverBackground",jt(gCe,.5),w("minimapSliderHoverBackground","Minimap slider background color when hovering."));q("minimapSlider.activeBackground",jt(pCe,.5),w("minimapSliderActiveBackground","Minimap slider background color when clicked on."));q("charts.foreground",Zt,w("chartsForeground","The foreground color used in charts."));q("charts.lines",jt(Zt,.5),w("chartsLines","The color used for horizontal lines in charts."));q("charts.red",WH,w("chartsRed","The red color used in chart visualizations."));q("charts.blue",Qh,w("chartsBlue","The blue color used in chart visualizations."));q("charts.yellow",Og,w("chartsYellow","The yellow color used in chart visualizations."));q("charts.orange",wK,w("chartsOrange","The orange color used in chart visualizations."));q("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},w("chartsGreen","The green color used in chart visualizations."));q("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},w("chartsPurple","The purple color used in chart visualizations."));const SK=q("input.background",{dark:"#3C3C3C",light:be.white,hcDark:be.black,hcLight:be.white},w("inputBoxBackground","Input box background.")),yCe=q("input.foreground",Zt,w("inputBoxForeground","Input box foreground.")),wCe=q("input.border",{dark:null,light:null,hcDark:fi,hcLight:fi},w("inputBoxBorder","Input box border.")),VH=q("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:fi,hcLight:fi},w("inputBoxActiveOptionBorder","Border color of activated options in input fields.")),zVe=q("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},w("inputOption.hoverBackground","Background color of activated options in input fields.")),mN=q("inputOption.activeBackground",{dark:jt(Xh,.4),light:jt(Xh,.2),hcDark:be.transparent,hcLight:be.transparent},w("inputOption.activeBackground","Background hover color of options in input fields.")),$H=q("inputOption.activeForeground",{dark:be.white,light:be.black,hcDark:Zt,hcLight:Zt},w("inputOption.activeForeground","Foreground color of activated options in input fields."));q("input.placeholderForeground",{light:jt(Zt,.5),dark:jt(Zt,.5),hcDark:jt(Zt,.7),hcLight:jt(Zt,.7)},w("inputPlaceholderForeground","Input box foreground color for placeholder text."));const jVe=q("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:be.black,hcLight:be.white},w("inputValidationInfoBackground","Input validation background color for information severity.")),UVe=q("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:Zt},w("inputValidationInfoForeground","Input validation foreground color for information severity.")),qVe=q("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:fi,hcLight:fi},w("inputValidationInfoBorder","Input validation border color for information severity.")),KVe=q("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:be.black,hcLight:be.white},w("inputValidationWarningBackground","Input validation background color for warning severity.")),GVe=q("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:Zt},w("inputValidationWarningForeground","Input validation foreground color for warning severity.")),YVe=q("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:fi,hcLight:fi},w("inputValidationWarningBorder","Input validation border color for warning severity.")),ZVe=q("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:be.black,hcLight:be.white},w("inputValidationErrorBackground","Input validation background color for error severity.")),XVe=q("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:Zt},w("inputValidationErrorForeground","Input validation foreground color for error severity.")),QVe=q("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:fi,hcLight:fi},w("inputValidationErrorBorder","Input validation border color for error severity.")),zH=q("dropdown.background",{dark:"#3C3C3C",light:be.white,hcDark:be.black,hcLight:be.white},w("dropdownBackground","Dropdown background.")),JVe=q("dropdown.listBackground",{dark:null,light:null,hcDark:be.black,hcLight:be.white},w("dropdownListBackground","Dropdown list background.")),ite=q("dropdown.foreground",{dark:"#F0F0F0",light:Zt,hcDark:be.white,hcLight:Zt},w("dropdownForeground","Dropdown foreground.")),nte=q("dropdown.border",{dark:zH,light:"#CECECE",hcDark:fi,hcLight:fi},w("dropdownBorder","Dropdown border.")),SCe=q("button.foreground",be.white,w("buttonForeground","Button foreground color.")),e7e=q("button.separator",jt(SCe,.4),w("buttonSeparator","Button separator color.")),MD=q("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},w("buttonBackground","Button background color.")),t7e=q("button.hoverBackground",{dark:Iu(MD,.2),light:My(MD,.2),hcDark:MD,hcLight:MD},w("buttonHoverBackground","Button background color when hovering.")),i7e=q("button.border",fi,w("buttonBorder","Button border color.")),n7e=q("button.secondaryForeground",{dark:be.white,light:be.white,hcDark:be.white,hcLight:Zt},w("buttonSecondaryForeground","Secondary button foreground color.")),xK=q("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:be.white},w("buttonSecondaryBackground","Secondary button background color.")),s7e=q("button.secondaryHoverBackground",{dark:Iu(xK,.2),light:My(xK,.2),hcDark:null,hcLight:null},w("buttonSecondaryHoverBackground","Secondary button background color when hovering.")),RD=q("radio.activeForeground",$H,w("radioActiveForeground","Foreground color of active radio option.")),r7e=q("radio.activeBackground",mN,w("radioBackground","Background color of active radio option.")),o7e=q("radio.activeBorder",VH,w("radioActiveBorder","Border color of the active radio option.")),a7e=q("radio.inactiveForeground",null,w("radioInactiveForeground","Foreground color of inactive radio option.")),l7e=q("radio.inactiveBackground",null,w("radioInactiveBackground","Background color of inactive radio option.")),c7e=q("radio.inactiveBorder",{light:jt(RD,.2),dark:jt(RD,.2),hcDark:jt(RD,.4),hcLight:jt(RD,.2)},w("radioInactiveBorder","Border color of the inactive radio option.")),d7e=q("radio.inactiveHoverBackground",zVe,w("radioHoverBackground","Background color of inactive active radio option when hovering.")),u7e=q("checkbox.background",zH,w("checkbox.background","Background color of checkbox widget."));q("checkbox.selectBackground",Ul,w("checkbox.select.background","Background color of checkbox widget when the element it's in is selected."));const h7e=q("checkbox.foreground",ite,w("checkbox.foreground","Foreground color of checkbox widget.")),f7e=q("checkbox.border",nte,w("checkbox.border","Border color of checkbox widget."));q("checkbox.selectBorder",A4,w("checkbox.select.border","Border color of checkbox widget when the element it's in is selected."));const g7e=q("keybindingLabel.background",{dark:new be(new mi(128,128,128,.17)),light:new be(new mi(221,221,221,.4)),hcDark:be.transparent,hcLight:be.transparent},w("keybindingLabelBackground","Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),p7e=q("keybindingLabel.foreground",{dark:be.fromHex("#CCCCCC"),light:be.fromHex("#555555"),hcDark:be.white,hcLight:Zt},w("keybindingLabelForeground","Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),m7e=q("keybindingLabel.border",{dark:new be(new mi(51,51,51,.6)),light:new be(new mi(204,204,204,.4)),hcDark:new be(new mi(111,195,223)),hcLight:fi},w("keybindingLabelBorder","Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),_7e=q("keybindingLabel.bottomBorder",{dark:new be(new mi(68,68,68,.6)),light:new be(new mi(187,187,187,.4)),hcDark:new be(new mi(111,195,223)),hcLight:Zt},w("keybindingLabelBottomBorder","Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),v7e=q("list.focusBackground",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.")),b7e=q("list.focusForeground",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.")),C7e=q("list.focusOutline",{dark:Xh,light:Xh,hcDark:yn,hcLight:yn},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.")),y7e=q("list.focusAndSelectionOutline",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.")),QC=q("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:be.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.")),OI=q("list.activeSelectionForeground",{dark:be.white,light:be.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.")),xCe=q("list.activeSelectionIconForeground",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.")),w7e=q("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:be.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.")),S7e=q("list.inactiveSelectionForeground",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.")),x7e=q("list.inactiveSelectionIconForeground",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.")),k7e=q("list.inactiveFocusBackground",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.")),L7e=q("list.inactiveFocusOutline",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.")),kCe=q("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:be.white.transparent(.1),hcLight:be.fromHex("#0F4A85").transparent(.1)},w("listHoverBackground","List/Tree background when hovering over items using the mouse.")),LCe=q("list.hoverForeground",null,w("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),D7e=q("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.")),E7e=q("list.dropBetweenBackground",{dark:A4,light:A4,hcDark:null,hcLight:null},w("listDropBetweenBackground","List/Tree drag and drop border color when moving items between items when using the mouse.")),n0=q("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:Xh,hcLight:Xh},w("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree.")),I7e=q("list.focusHighlightForeground",{dark:n0,light:uVe(QC,n0,"#BBE7FF"),hcDark:n0,hcLight:n0},w("listFocusHighlightForeground","List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));q("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."));q("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},w("listErrorForeground","Foreground color of list items containing errors."));q("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},w("listWarningForeground","Foreground color of list items containing warnings."));const T7e=q("listFilterWidget.background",{light:My(Ul,0),dark:Iu(Ul,0),hcDark:Ul,hcLight:Ul},w("listFilterWidgetBackground","Background color of the type filter widget in lists and trees.")),N7e=q("listFilterWidget.outline",{dark:be.transparent,light:be.transparent,hcDark:"#f38518",hcLight:"#007ACC"},w("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),M7e=q("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:fi,hcLight:fi},w("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),R7e=q("listFilterWidget.shadow",Nx,w("listFilterWidgetShadow","Shadow color of the type filter widget in lists and trees."));q("list.filterMatchBackground",{dark:dg,light:dg,hcDark:null,hcLight:null},w("listFilterMatchHighlight","Background color of the filtered match."));q("list.filterMatchBorder",{dark:lm,light:lm,hcDark:fi,hcLight:yn},w("listFilterMatchHighlightBorder","Border color of the filtered match."));q("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},w("listDeemphasizedForeground","List/Tree foreground color for items that are deemphasized."));const DCe=q("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},w("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),P7e=q("tree.inactiveIndentGuidesStroke",jt(DCe,.4),w("treeInactiveIndentGuidesStroke","Tree stroke color for the indentation guides that are not active.")),O7e=q("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},w("tableColumnsBorder","Table border color between columns.")),A7e=q("tree.tableOddRowsBackground",{dark:jt(Zt,.04),light:jt(Zt,.04),hcDark:null,hcLight:null},w("tableOddRowsBackgroundColor","Background color for odd table rows."));q("editorActionList.background",Ul,w("editorActionListBackground","Action List background color."));q("editorActionList.foreground",BH,w("editorActionListForeground","Action List foreground color."));q("editorActionList.focusForeground",OI,w("editorActionListFocusForeground","Action List foreground color for the focused item."));q("editorActionList.focusBackground",QC,w("editorActionListFocusBackground","Action List background color for the focused item."));const F7e=q("menu.border",{dark:null,light:null,hcDark:fi,hcLight:fi},w("menuBorder","Border color of menus.")),B7e=q("menu.foreground",ite,w("menuForeground","Foreground color of menu items.")),W7e=q("menu.background",zH,w("menuBackground","Background color of menu items.")),H7e=q("menu.selectionForeground",OI,w("menuSelectionForeground","Foreground color of the selected menu item in menus.")),V7e=q("menu.selectionBackground",QC,w("menuSelectionBackground","Background color of the selected menu item in menus.")),$7e=q("menu.selectionBorder",{dark:null,light:null,hcDark:yn,hcLight:yn},w("menuSelectionBorder","Border color of the selected menu item in menus.")),z7e=q("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:fi,hcLight:fi},w("menuSeparatorBackground","Color of a separator menu item in menus.")),Wde=q("quickInput.background",Ul,w("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),j7e=q("quickInput.foreground",BH,w("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),U7e=q("quickInputTitle.background",{dark:new be(new mi(255,255,255,.105)),light:new be(new mi(0,0,0,.06)),hcDark:"#000000",hcLight:be.white},w("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),ECe=q("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:be.white,hcLight:"#0F4A85"},w("pickerGroupForeground","Quick picker color for grouping labels.")),q7e=q("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:be.white,hcLight:"#0F4A85"},w("pickerGroupBorder","Quick picker color for grouping borders.")),Hde=q("quickInput.list.focusBackground",null,"",void 0,w("quickInput.list.focusBackground deprecation","Please use quickInputList.focusBackground instead")),AI=q("quickInputList.focusForeground",OI,w("quickInput.listFocusForeground","Quick picker foreground color for the focused item.")),ste=q("quickInputList.focusIconForeground",xCe,w("quickInput.listFocusIconForeground","Quick picker icon foreground color for the focused item.")),FI=q("quickInputList.focusBackground",{dark:MI(Hde,QC),light:MI(Hde,QC),hcDark:null,hcLight:null},w("quickInput.listFocusBackground","Quick picker background color for the focused item."));q("search.resultsInfoForeground",{light:Zt,dark:jt(Zt,.65),hcDark:Zt,hcLight:Zt},w("search.resultsInfoForeground","Color of the text in the search viewlet's completion message."));q("searchEditor.findMatchBackground",{light:jt(dg,.66),dark:jt(dg,.66),hcDark:dg,hcLight:dg},w("searchEditor.queryMatch","Color of the Search Editor query matches."));q("searchEditor.findMatchBorder",{light:jt(lm,.66),dark:jt(lm,.66),hcDark:lm,hcLight:lm},w("searchEditor.editorFindMatchBorder","Border color of the Search Editor query matches."));var K7e=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Vde=function(s,e){return function(t,i){e(t,i,s)}};const df=ii("hoverService");let OS=class extends re{get delay(){return this.isInstantlyHovering()?0:this._delay}constructor(e,t,i={},n,r){super(),this.placement=e,this.instantHover=t,this.overrideOptions=i,this.configurationService=n,this.hoverService=r,this.lastHoverHideTime=0,this.timeLimit=200,this.hoverDisposables=this._register(new me),this._delay=this.configurationService.getValue("workbench.hover.delay"),this._register(this.configurationService.onDidChangeConfiguration(o=>{o.affectsConfiguration("workbench.hover.delay")&&(this._delay=this.configurationService.getValue("workbench.hover.delay"))}))}showHover(e,t){const i=typeof this.overrideOptions=="function"?this.overrideOptions(e,t):this.overrideOptions;this.hoverDisposables.clear();const n=Xs(e.target)?[e.target]:e.target.targetElements;for(const o of n)this.hoverDisposables.add(Hn(o,"keydown",a=>{a.equals(9)&&this.hoverService.hideHover()}));const r=Xs(e.content)?void 0:e.content.toString();return this.hoverService.showHover({...e,...i,persistence:{hideOnKeyDown:!0,...i.persistence},id:r,appearance:{...e.appearance,compact:!0,skipFadeInAnimation:this.isInstantlyHovering(),...i.appearance}},t)}isInstantlyHovering(){return this.instantHover&&Date.now()-this.lastHoverHideTime<this.timeLimit}onDidHideHover(){this.hoverDisposables.clear(),this.instantHover&&(this.lastHoverHideTime=Date.now())}};OS=K7e([Vde(3,Gt),Vde(4,df)],OS);const qg=ii("contextViewService"),gl=ii("contextMenuService"),Mi=ii("keybindingService");class Mx{constructor(){this._hooks=new me,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;const i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,n,r){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=n,this._onStopCallback=r;let o=e;try{e.setPointerCapture(t),this._hooks.add(dt(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{o=mt(e)}this._hooks.add(ue(o,Ae.POINTER_MOVE,a=>{if(a.buttons!==i){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(ue(o,Ae.POINTER_UP,a=>this.stopMonitoring(!0)))}}function ps(s,e,t){let i=null,n=null;if(typeof t.value=="function"?(i="value",n=t.value,n.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof t.get=="function"&&(i="get",n=t.get),!n)throw new Error("not supported");const r=`$memoize$${e}`;t[i]=function(...o){return this.hasOwnProperty(r)||Object.defineProperty(this,r,{configurable:!1,enumerable:!1,writable:!1,value:n.apply(this,o)}),this[r]}}var G7e=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},rn;(function(s){s.Tap="-monaco-gesturetap",s.Change="-monaco-gesturechange",s.Start="-monaco-gesturestart",s.End="-monaco-gesturesend",s.Contextmenu="-monaco-gesturecontextmenu"})(rn||(rn={}));const Br=class Br extends re{constructor(){super(),this.dispatched=!1,this.targets=new Vo,this.ignoreTargets=new Vo,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(We.runAndSubscribe(vH,({window:e,disposables:t})=>{t.add(ue(e.document,"touchstart",i=>this.onTouchStart(i),{passive:!1})),t.add(ue(e.document,"touchend",i=>this.onTouchEnd(e,i))),t.add(ue(e.document,"touchmove",i=>this.onTouchMove(i),{passive:!1}))},{window:Qi,disposables:this._store}))}static addTarget(e){if(!Br.isTouchDevice())return re.None;Br.INSTANCE||(Br.INSTANCE=new Br);const t=Br.INSTANCE.targets.push(e);return dt(t)}static ignoreTarget(e){if(!Br.isTouchDevice())return re.None;Br.INSTANCE||(Br.INSTANCE=new Br);const t=Br.INSTANCE.ignoreTargets.push(e);return dt(t)}static isTouchDevice(){return"ontouchstart"in Qi||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){const t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,n=e.targetTouches.length;i<n;i++){const r=e.targetTouches.item(i);this.activeTouches[r.identifier]={id:r.identifier,initialTarget:r.target,initialTimeStamp:t,initialPageX:r.pageX,initialPageY:r.pageY,rollingTimestamps:[t],rollingPageX:[r.pageX],rollingPageY:[r.pageY]};const o=this.newGestureEvent(rn.Start,r.target);o.pageX=r.pageX,o.pageY=r.pageY,this.dispatchEvent(o)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}onTouchEnd(e,t){const i=Date.now(),n=Object.keys(this.activeTouches).length;for(let r=0,o=t.changedTouches.length;r<o;r++){const a=t.changedTouches.item(r);if(!this.activeTouches.hasOwnProperty(String(a.identifier))){console.warn("move of an UNKNOWN touch",a);continue}const l=this.activeTouches[a.identifier],d=Date.now()-l.initialTimeStamp;if(d<Br.HOLD_DELAY&&Math.abs(l.initialPageX-bc(l.rollingPageX))<30&&Math.abs(l.initialPageY-bc(l.rollingPageY))<30){const h=this.newGestureEvent(rn.Tap,l.initialTarget);h.pageX=bc(l.rollingPageX),h.pageY=bc(l.rollingPageY),this.dispatchEvent(h)}else if(d>=Br.HOLD_DELAY&&Math.abs(l.initialPageX-bc(l.rollingPageX))<30&&Math.abs(l.initialPageY-bc(l.rollingPageY))<30){const h=this.newGestureEvent(rn.Contextmenu,l.initialTarget);h.pageX=bc(l.rollingPageX),h.pageY=bc(l.rollingPageY),this.dispatchEvent(h)}else if(n===1){const h=bc(l.rollingPageX),f=bc(l.rollingPageY),p=bc(l.rollingTimestamps)-l.rollingTimestamps[0],m=h-l.rollingPageX[0],v=f-l.rollingPageY[0],b=[...this.targets].filter(y=>l.initialTarget instanceof Node&&y.contains(l.initialTarget));this.inertia(e,b,i,Math.abs(m)/p,m>0?1:-1,h,Math.abs(v)/p,v>0?1:-1,f)}this.dispatchEvent(this.newGestureEvent(rn.End,l.initialTarget)),delete this.activeTouches[a.identifier]}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){const i=document.createEvent("CustomEvent");return i.initEvent(e,!1,!0),i.initialTarget=t,i.tapCount=0,i}dispatchEvent(e){if(e.type===rn.Tap){const t=new Date().getTime();let i=0;t-this._lastSetTapCountTime>Br.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=t,e.tapCount=i}else(e.type===rn.Change||e.type===rn.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(const i of this.ignoreTargets)if(i.contains(e.initialTarget))return;const t=[];for(const i of this.targets)if(i.contains(e.initialTarget)){let n=0,r=e.initialTarget;for(;r&&r!==i;)n++,r=r.parentElement;t.push([n,i])}t.sort((i,n)=>i[0]-n[0]);for(const[i,n]of t)n.dispatchEvent(e),this.dispatched=!0}}inertia(e,t,i,n,r,o,a,l,d){this.handle=hl(e,()=>{const h=Date.now(),f=h-i;let p=0,m=0,v=!0;n+=Br.SCROLL_FRICTION*f,a+=Br.SCROLL_FRICTION*f,n>0&&(v=!1,p=r*n*f),a>0&&(v=!1,m=l*a*f);const b=this.newGestureEvent(rn.Change);b.translationX=p,b.translationY=m,t.forEach(y=>y.dispatchEvent(b)),v||this.inertia(e,t,h,n,r,o+p,a,l,d+m)})}onTouchMove(e){const t=Date.now();for(let i=0,n=e.changedTouches.length;i<n;i++){const r=e.changedTouches.item(i);if(!this.activeTouches.hasOwnProperty(String(r.identifier))){console.warn("end of an UNKNOWN touch",r);continue}const o=this.activeTouches[r.identifier],a=this.newGestureEvent(rn.Change,o.initialTarget);a.translationX=r.pageX-bc(o.rollingPageX),a.translationY=r.pageY-bc(o.rollingPageY),a.pageX=r.pageX,a.pageY=r.pageY,this.dispatchEvent(a),o.rollingPageX.length>3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(r.pageX),o.rollingPageY.push(r.pageY),o.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}};Br.SCROLL_FRICTION=-.005,Br.HOLD_DELAY=700,Br.CLEAR_TAP_COUNT_TIME=400;let io=Br;G7e([ps],io,"isTouchDevice",null);let rc=class extends re{onclick(e,t){this._register(ue(e,Ae.CLICK,i=>t(new Cd(mt(e),i))))}onmousedown(e,t){this._register(ue(e,Ae.MOUSE_DOWN,i=>t(new Cd(mt(e),i))))}onmouseover(e,t){this._register(ue(e,Ae.MOUSE_OVER,i=>t(new Cd(mt(e),i))))}onmouseleave(e,t){this._register(ue(e,Ae.MOUSE_LEAVE,i=>t(new Cd(mt(e),i))))}onkeydown(e,t){this._register(ue(e,Ae.KEY_DOWN,i=>t(new nn(i))))}onkeyup(e,t){this._register(ue(e,Ae.KEY_UP,i=>t(new nn(i))))}oninput(e,t){this._register(ue(e,Ae.INPUT,t))}onblur(e,t){this._register(ue(e,Ae.BLUR,t))}onfocus(e,t){this._register(ue(e,Ae.FOCUS,t))}ignoreGesture(e){return io.ignoreTarget(e)}};const AS=11;class Y7e extends rc{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(...bt.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=AS+"px",this.domNode.style.height=AS+"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 Mx),this._register(Hn(this.bgDomNode,Ae.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Hn(this.domNode,Ae.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new Eee),this._pointerdownScheduleRepeatTimer=this._register(new Ad)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,mt(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}}class Z7e extends re{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new Ad)}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.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)==null||t.setClassName(this._invisibleClassName+(e?" fade":"")))}}const X7e=140;class ICe extends rc{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 Z7e(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new Mx),this._shouldRender=!0,this.domNode=Ni(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(ue(this.domNode.domNode,Ae.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){const t=this._register(new Y7e(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,n){this.slider=Ni(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof n=="number"&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(ue(this.slider.domNode,Ae.POINTER_DOWN,r=>{r.button===0&&(r.preventDefault(),this._sliderPointerDown(r))})),this.onclick(this.slider.domNode,r=>{r.leftButton&&r.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){const t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),n=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),r=this._sliderPointerPosition(e);i<=r&&r<=n?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,i=e.offsetY;else{const r=ts(this.domNode.domNode);t=e.pageX-r.left,i=e.pageY-r.top}const n=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(n):this._scrollbarState.getDesiredScrollPositionFromOffset(n)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),n=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>{const o=this._sliderOrthogonalPointerPosition(r),a=Math.abs(o-i);if(Ur&&a>X7e){this._setDesiredScrollPositionNow(n.getScrollPosition());return}const d=this._sliderPointerPosition(r)-t;this._setDesiredScrollPositionNow(n.getDesiredScrollPositionFromDelta(d))},()=>{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 Q7e=20;class FS{constructor(e,t,i,n,r,o){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=n,this._scrollSize=r,this._scrollPosition=o,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new FS(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){const t=Math.round(e);return this._visibleSize!==t?(this._visibleSize=t,this._refreshComputedValues(),!0):!1}setScrollSize(e){const t=Math.round(e);return this._scrollSize!==t?(this._scrollSize=t,this._refreshComputedValues(),!0):!1}setScrollPosition(e){const t=Math.round(e);return this._scrollPosition!==t?(this._scrollPosition=t,this._refreshComputedValues(),!0):!1}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,i,n,r){const o=Math.max(0,i-e),a=Math.max(0,o-2*t),l=n>0&&n>i;if(!l)return{computedAvailableSize:Math.round(o),computedIsNeeded:l,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};const d=Math.round(Math.max(Q7e,Math.floor(i*a/n))),h=(a-d)/(n-i),f=r*h;return{computedAvailableSize:Math.round(o),computedIsNeeded:l,computedSliderSize:Math.round(d),computedSliderRatio:h,computedSliderPosition:Math.round(f)}}_refreshComputedValues(){const e=FS._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize;let i=this._scrollPosition;return t<this._computedSliderPosition?i-=this._visibleSize:i+=this._visibleSize,i}getDesiredScrollPositionFromDelta(e){if(!this._computedIsNeeded)return 0;const t=this._computedSliderPosition+e;return Math.round(t/this._computedSliderRatio)}}class J7e extends ICe{constructor(e,t,i){const n=e.getScrollDimensions(),r=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new FS(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,n.width,n.scrollWidth,r.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows){const o=(t.arrowSize-AS)/2,a=(t.horizontalScrollbarSize-AS)/2;this._createArrow({className:"scra",icon:Oe.scrollbarButtonLeft,top:a,left:o,bottom:void 0,right:void 0,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new GC(null,1,0))}),this._createArrow({className:"scra",icon:Oe.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:o,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new GC(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 e9e extends ICe{constructor(e,t,i){const n=e.getScrollDimensions(),r=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new FS(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,r.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const o=(t.arrowSize-AS)/2,a=(t.verticalScrollbarSize-AS)/2;this._createArrow({className:"scra",icon:Oe.scrollbarButtonUp,top:o,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new GC(null,0,1))}),this._createArrow({className:"scra",icon:Oe.scrollbarButtonDown,top:void 0,left:a,bottom:o,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new GC(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 B4{constructor(e,t,i,n,r,o,a){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t=t|0,i=i|0,n=n|0,r=r|0,o=o|0,a=a|0),this.rawScrollLeft=n,this.rawScrollTop=a,t<0&&(t=0),n+t>i&&(n=i-t),n<0&&(n=0),r<0&&(r=0),a+r>o&&(a=o-r),a<0&&(a=0),this.width=t,this.scrollWidth=i,this.scrollLeft=n,this.height=r,this.scrollHeight=o,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 B4(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 B4(this._forceIntegerValues,this.width,this.scrollWidth,typeof e.scrollLeft<"u"?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof e.scrollTop<"u"?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){const i=this.width!==e.width,n=this.scrollWidth!==e.scrollWidth,r=this.scrollLeft!==e.scrollLeft,o=this.height!==e.height,a=this.scrollHeight!==e.scrollHeight,l=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i,scrollWidthChanged:n,scrollLeftChanged:r,heightChanged:o,scrollHeightChanged:a,scrollTopChanged:l}}}class Rx extends re{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 B4(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 i=this._state.withScrollDimensions(e,t);this._setState(i,!!this._smoothScrolling),(n=this._smoothScrolling)==null||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 i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let n;t?n=new BI(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):n=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{const i=this._state.withScrollPosition(e);this._smoothScrolling=BI.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;const e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){const i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}}class $de{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function lz(s,e){const t=e-s;return function(i){return s+t*n9e(i)}}function t9e(s,e,t){return function(i){return i<t?s(i/t):e((i-t)/(1-t))}}class BI{constructor(e,t,i,n){this.from=e,this.to=t,this.duration=n,this.startTime=i,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,t,i){if(Math.abs(e-t)>2.5*i){let r,o;return e<t?(r=e+.75*i,o=t-.75*i):(r=e-.75*i,o=t+.75*i),t9e(lz(e,r),lz(o,t),.33)}return lz(e,t)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(e){this.to=e.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(e){const t=(e-this.startTime)/this.duration;if(t<1){const i=this.scrollLeft(t),n=this.scrollTop(t);return new $de(i,n,!1)}return new $de(this.to.scrollLeft,this.to.scrollTop,!0)}combine(e,t,i){return BI.start(e,t,i)}static start(e,t,i){i=i+10;const n=Date.now()-10;return new BI(e,t,n,i)}}function i9e(s){return Math.pow(s,3)}function n9e(s){return 1-i9e(1-s)}const s9e=500,zde=50;class r9e{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}}const gB=class gB{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let e=1,t=0,i=1,n=this._rear;do{const r=n===this._front?e:Math.pow(2,-i);if(e-=r,t+=this._memory[n].score*r,n===this._front)break;n=(this._capacity+n-1)%this._capacity,i++}while(!0);return t<=.5}acceptStandardWheelEvent(e){if(uN){const t=mt(e.browserEvent),i=x5e(t);this.accept(Date.now(),e.deltaX*i,e.deltaY*i)}else this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,t,i){let n=null;const r=new r9e(e,t,i);this._front===-1&&this._rear===-1?(this._memory[0]=r,this._front=0,this._rear=0):(n=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=r),r.score=this._computeScore(r,n)}_computeScore(e,t){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let i=.5;if((!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(i+=.25),t){const n=Math.abs(e.deltaX),r=Math.abs(e.deltaY),o=Math.abs(t.deltaX),a=Math.abs(t.deltaY),l=Math.max(Math.min(n,o),1),d=Math.max(Math.min(r,a),1),h=Math.max(n,o),f=Math.max(r,a);h%l===0&&f%d===0&&(i-=.5)}return Math.min(Math.max(i,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}};gB.INSTANCE=new gB;let W4=gB;class rte extends rc{get options(){return this._options}constructor(e,t,i){super(),this._onScroll=this._register(new se),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new se),e.style.overflow="hidden",this._options=o9e(t),this._scrollable=i,this._register(this._scrollable.onScroll(r=>{this._onWillScroll.fire(r),this._onDidScroll(r),this._onScroll.fire(r)}));const n={onMouseWheel:r=>this._onMouseWheel(r),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new e9e(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new J7e(this._scrollable,this._options,n)),this._domNode=document.createElement("div"),this._domNode.className="monaco-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.style.overflow="hidden",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=Ni(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Ni(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Ni(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,r=>this._onMouseOver(r)),this.onmouseleave(this._listenOnDomNode,r=>this._onMouseLeave(r)),this._hideTimeout=this._register(new Ad),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=Xi(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,ti&&(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 GC(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Xi(this._mouseWheelToDispose),e)){const i=n=>{this._onMouseWheel(new GC(n))};this._mouseWheelToDispose.push(ue(this._listenOnDomNode,Ae.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){var r;if((r=e.browserEvent)!=null&&r.defaultPrevented)return;const t=W4.INSTANCE;t.acceptStandardWheelEvent(e);let i=!1;if(e.deltaY||e.deltaX){let o=e.deltaY*this._options.mouseWheelScrollSensitivity,a=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&a+o===0?a=o=0:Math.abs(o)>=Math.abs(a)?a=0:o=0),this._options.flipAxes&&([o,a]=[a,o]);const l=!ti&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||l)&&!a&&(a=o,o=0),e.browserEvent&&e.browserEvent.altKey&&(a=a*this._options.fastScrollSensitivity,o=o*this._options.fastScrollSensitivity);const d=this._scrollable.getFutureScrollPosition();let h={};if(o){const f=zde*o,p=d.scrollTop-(f<0?Math.floor(f):Math.ceil(f));this._verticalScrollbar.writeScrollPosition(h,p)}if(a){const f=zde*a,p=d.scrollLeft-(f<0?Math.floor(f):Math.ceil(f));this._horizontalScrollbar.writeScrollPosition(h,p)}h=this._scrollable.validateScrollPosition(h),(d.scrollLeft!==h.scrollLeft||d.scrollTop!==h.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(h):this._scrollable.setScrollPositionNow(h),i=!0)}let n=i;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,n=i?" left":"",r=t?" top":"",o=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${r}`),this._topLeftShadowDomNode.setClassName(`shadow${o}${r}${n}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),s9e)}}class TCe extends rte{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new Rx({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:n=>hl(mt(e),n)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class jH extends rte{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class _N extends rte{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new Rx({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:n=>hl(mt(e),n)});super(e,t,i),this._register(i),this._element=e,this._register(this.onScroll(n=>{n.scrollTopChanged&&(this._element.scrollTop=n.scrollTop),n.scrollLeftChanged&&(this._element.scrollLeft=n.scrollLeft)})),this.scanDomNode()}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}}function o9e(s){const e={lazyRender:typeof s.lazyRender<"u"?s.lazyRender:!1,className:typeof s.className<"u"?s.className:"",useShadows:typeof s.useShadows<"u"?s.useShadows:!0,handleMouseWheel:typeof s.handleMouseWheel<"u"?s.handleMouseWheel:!0,flipAxes:typeof s.flipAxes<"u"?s.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof s.consumeMouseWheelIfScrollbarIsNeeded<"u"?s.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof s.alwaysConsumeMouseWheel<"u"?s.alwaysConsumeMouseWheel:!1,scrollYToX:typeof s.scrollYToX<"u"?s.scrollYToX:!1,mouseWheelScrollSensitivity:typeof s.mouseWheelScrollSensitivity<"u"?s.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof s.fastScrollSensitivity<"u"?s.fastScrollSensitivity:5,scrollPredominantAxis:typeof s.scrollPredominantAxis<"u"?s.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof s.mouseWheelSmoothScroll<"u"?s.mouseWheelSmoothScroll:!0,arrowSize:typeof s.arrowSize<"u"?s.arrowSize:11,listenOnDomNode:typeof s.listenOnDomNode<"u"?s.listenOnDomNode:null,horizontal:typeof s.horizontal<"u"?s.horizontal:1,horizontalScrollbarSize:typeof s.horizontalScrollbarSize<"u"?s.horizontalScrollbarSize:10,horizontalSliderSize:typeof s.horizontalSliderSize<"u"?s.horizontalSliderSize:0,horizontalHasArrows:typeof s.horizontalHasArrows<"u"?s.horizontalHasArrows:!1,vertical:typeof s.vertical<"u"?s.vertical:1,verticalScrollbarSize:typeof s.verticalScrollbarSize<"u"?s.verticalScrollbarSize:10,verticalHasArrows:typeof s.verticalHasArrows<"u"?s.verticalHasArrows:!1,verticalSliderSize:typeof s.verticalSliderSize<"u"?s.verticalSliderSize:0,scrollByPage:typeof s.scrollByPage<"u"?s.scrollByPage:!1};return e.horizontalSliderSize=typeof s.horizontalSliderSize<"u"?s.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof s.verticalSliderSize<"u"?s.verticalSliderSize:e.verticalScrollbarSize,ti&&(e.className+=" mac"),e}const TA=Fe;let ote=class extends re{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 _N(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}};class UH extends re{static render(e,t,i){return new UH(e,t,i)}constructor(e,t,i){super(),this.actionLabel=t.label,this.actionKeybindingLabel=i,this.actionContainer=Ee(e,TA("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=Ee(this.actionContainer,TA("a.action")),this.action.setAttribute("role","button"),t.iconClass&&Ee(this.action,TA(`span.icon.${t.iconClass}`));const n=Ee(this.action,TA("span"));n.textContent=i?`${t.label} (${i})`:t.label,this._store.add(new MCe(this.actionContainer,t.run)),this._store.add(new RCe(this.actionContainer,t.run,[3,10])),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 NCe(s,e){return s&&e?w("acessibleViewHint","Inspect this in the accessible view with {0}.",e):s?w("acessibleViewHintNoKbOpen","Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}class MCe extends re{constructor(e,t){super(),this._register(ue(e,Ae.CLICK,i=>{i.stopPropagation(),i.preventDefault(),t(e)}))}}class RCe extends re{constructor(e,t,i){super(),this._register(ue(e,Ae.KEY_DOWN,n=>{const r=new nn(n);i.some(o=>r.equals(o))&&(n.stopPropagation(),n.preventDefault(),t(e))}))}}const Ta=ii("openerService");function a9e(s){let e;const t=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(s.fragment);return t&&(e={startLineNumber:parseInt(t[1]),startColumn:t[2]?parseInt(t[2]):1,endLineNumber:t[4]?parseInt(t[4]):void 0,endColumn:t[4]?t[5]?parseInt(t[5]):1:void 0},s=s.with({fragment:""})),{selection:e,uri:s}}class si{get event(){return this.emitter.event}constructor(e,t,i){const n=r=>this.emitter.fire(r);this.emitter=new se({onWillAddFirstListener:()=>e.addEventListener(t,n,i),onDidRemoveLastListener:()=>e.removeEventListener(t,n,i)})}dispose(){this.emitter.dispose()}}function l9e(s,e={}){const t=ate(e);return t.textContent=s,t}function c9e(s,e={}){const t=ate(e);return PCe(t,u9e(s,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function ate(s){const e=s.inline?"span":"div",t=document.createElement(e);return s.className&&(t.className=s.className),t}class d9e{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 PCe(s,e,t,i){let n;if(e.type===2)n=document.createTextNode(e.content||"");else if(e.type===3)n=document.createElement("b");else if(e.type===4)n=document.createElement("i");else if(e.type===7&&i)n=document.createElement("code");else if(e.type===5&&t){const r=document.createElement("a");t.disposables.add(Hn(r,"click",o=>{t.callback(String(e.index),o)})),n=r}else e.type===8?n=document.createElement("br"):e.type===1&&(n=s);n&&s!==n&&s.appendChild(n),n&&Array.isArray(e.children)&&e.children.forEach(r=>{PCe(n,r,t,i)})}function u9e(s,e){const t={type:1,children:[]};let i=0,n=t;const r=[],o=new d9e(s);for(;!o.eos();){let a=o.next();const l=a==="\\"&&kK(o.peek(),e)!==0;if(l&&(a=o.next()),!l&&h9e(a,e)&&a===o.peek()){o.advance(),n.type===2&&(n=r.pop());const d=kK(a,e);if(n.type===d||n.type===5&&d===6)n=r.pop();else{const h={type:d,children:[]};d===5&&(h.index=i,i++),n.children.push(h),r.push(n),n=h}}else if(a===`
|
|
228
|
+
`)}}const FH=new cVe;Fn.add(dCe.ColorContribution,FH);function q(s,e,t,i,n){return FH.registerColor(s,e,t,i,n)}function dVe(s,e){var t,i,n,r;switch(s.op){case 0:return(t=Qd(s.value,e))==null?void 0:t.darken(s.factor);case 1:return(i=Qd(s.value,e))==null?void 0:i.lighten(s.factor);case 2:return(n=Qd(s.value,e))==null?void 0:n.transparent(s.factor);case 3:{const o=Qd(s.background,e);return o?(r=Qd(s.value,e))==null?void 0:r.makeOpaque(o):Qd(s.value,e)}case 4:for(const o of s.values){const a=Qd(o,e);if(a)return a}return;case 6:return Qd(e.defines(s.if)?s.then:s.else,e);case 5:{const o=Qd(s.value,e);if(!o)return;const a=Qd(s.background,e);return a?o.isDarkerThan(a)?be.getLighterColor(o,a,s.factor).transparent(s.transparency):be.getDarkerColor(o,a,s.factor).transparent(s.transparency):o.transparent(s.factor*s.transparency)}default:throw IH()}}function My(s,e){return{op:0,value:s,factor:e}}function Iu(s,e){return{op:1,value:s,factor:e}}function Ut(s,e){return{op:2,value:s,factor:e}}function MI(...s){return{op:4,values:s}}function uVe(s,e,t){return{op:6,if:s,then:e,else:t}}function Nde(s,e,t,i){return{op:5,value:s,background:e,factor:t,transparency:i}}function Qd(s,e){if(s!==null){if(typeof s=="string")return s[0]==="#"?be.fromHex(s):e.getColor(s);if(s instanceof be)return s;if(typeof s=="object")return dVe(s,e)}}const uCe="vscode://schemas/workbench-colors",hCe=Fn.as(RH.JSONContribution);hCe.registerSchema(uCe,FH.getColorSchema());const Mde=new ji(()=>hCe.notifySchemaChanged(uCe),200);FH.onDidChangeSchema(()=>{Mde.isScheduled()||Mde.schedule()});const Zt=q("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."));q("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."));q("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."));q("descriptionForeground",{light:"#717171",dark:Ut(Zt,.7),hcDark:Ut(Zt,.7),hcLight:Ut(Zt,.7)},w("descriptionForeground","Foreground color for description text providing additional information, for example for a label."));const A4=q("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},w("iconForeground","The default color for icons in the workbench.")),Xh=q("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.")),fi=q("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},w("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),yn=q("contrastActiveBorder",{light:null,dark:null,hcDark:Xh,hcLight:Xh},w("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast."));q("selection.background",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."));const hVe=q("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},w("textLinkForeground","Foreground color for links in text."));q("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."));q("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:be.black,hcLight:"#292929"},w("textSeparatorForeground","Color for text separators."));q("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#000000",hcLight:"#FFFFFF"},w("textPreformatForeground","Foreground color for preformatted text segments."));q("textPreformat.background",{light:"#0000001A",dark:"#FFFFFF1A",hcDark:"#FFFFFF",hcLight:"#09345f"},w("textPreformatBackground","Background color for preformatted text segments."));q("textBlockQuote.background",{light:"#f2f2f2",dark:"#222222",hcDark:null,hcLight:"#F2F2F2"},w("textBlockQuoteBackground","Background color for block quotes in text."));q("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:be.white,hcLight:"#292929"},w("textBlockQuoteBorder","Border color for block quotes in text."));q("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:be.black,hcLight:"#F2F2F2"},w("textCodeBlockBackground","Background color for code blocks in text."));q("sash.hoverBorder",Xh,w("sashActiveBorder","Border color of active sashes."));const J2=q("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:be.black,hcLight:"#0F4A85"},w("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),fVe=q("badge.foreground",{dark:be.white,light:"#333",hcDark:be.white,hcLight:be.white},w("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),Zee=q("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},w("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),fCe=q("scrollbarSlider.background",{dark:be.fromHex("#797979").transparent(.4),light:be.fromHex("#646464").transparent(.4),hcDark:Ut(fi,.6),hcLight:Ut(fi,.4)},w("scrollbarSliderBackground","Scrollbar slider background color.")),gCe=q("scrollbarSlider.hoverBackground",{dark:be.fromHex("#646464").transparent(.7),light:be.fromHex("#646464").transparent(.7),hcDark:Ut(fi,.8),hcLight:Ut(fi,.8)},w("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),pCe=q("scrollbarSlider.activeBackground",{dark:be.fromHex("#BFBFBF").transparent(.4),light:be.fromHex("#000000").transparent(.6),hcDark:fi,hcLight:fi},w("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),gVe=q("progressBar.background",{dark:be.fromHex("#0E70C0"),light:be.fromHex("#0E70C0"),hcDark:fi,hcLight:fi},w("progressBarBackground","Background color of the progress bar that can show for long running operations.")),Md=q("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:be.black,hcLight:be.white},w("editorBackground","Editor background color.")),cf=q("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:be.white,hcLight:Zt},w("editorForeground","Editor default foreground color."));q("editorStickyScroll.background",Md,w("editorStickyScrollBackground","Background color of sticky scroll in the editor"));q("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:be.fromHex("#0F4A85").transparent(.1)},w("editorStickyScrollHoverBackground","Background color of sticky scroll on hover in the editor"));q("editorStickyScroll.border",{dark:null,light:null,hcDark:fi,hcLight:fi},w("editorStickyScrollBorder","Border color of sticky scroll in the editor"));q("editorStickyScroll.shadow",Zee,w("editorStickyScrollShadow"," Shadow color of sticky scroll in the editor"));const Ul=q("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:be.white},w("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),BH=q("editorWidget.foreground",Zt,w("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),Xee=q("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:fi,hcLight:fi},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."));q("editorWidget.resizeBorder",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."));q("editorError.background",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 WH=q("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},w("editorError.foreground","Foreground color of error squigglies in the editor.")),pVe=q("editorError.border",{dark:null,light:null,hcDark:be.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},w("errorBorder","If set, color of double underlines for errors in the editor.")),mVe=q("editorWarning.background",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),Og=q("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},w("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),RI=q("editorWarning.border",{dark:null,light:null,hcDark:be.fromHex("#FFCC00").transparent(.8),hcLight:be.fromHex("#FFCC00").transparent(.8)},w("warningBorder","If set, color of double underlines for warnings in the editor."));q("editorInfo.background",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 Qh=q("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},w("editorInfo.foreground","Foreground color of info squigglies in the editor.")),PI=q("editorInfo.border",{dark:null,light:null,hcDark:be.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},w("infoBorder","If set, color of double underlines for infos in the editor.")),_Ve=q("editorHint.foreground",{dark:be.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},w("editorHint.foreground","Foreground color of hint squigglies in the editor."));q("editorHint.border",{dark:null,light:null,hcDark:be.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},w("hintBorder","If set, color of double underlines for hints in the editor."));const vVe=q("editorLink.activeForeground",{dark:"#4E94CE",light:be.blue,hcDark:be.cyan,hcLight:"#292929"},w("activeLinkForeground","Color of active links.")),am=q("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},w("editorSelectionBackground","Color of the editor selection.")),bVe=q("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:be.white},w("editorSelectionForeground","Color of the selected text for high contrast.")),mCe=q("editor.inactiveSelectionBackground",{light:Ut(am,.5),dark:Ut(am,.5),hcDark:Ut(am,.7),hcLight:Ut(am,.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),Qee=q("editor.selectionHighlightBackground",{light:Nde(am,Md,.3,.6),dark:Nde(am,Md,.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);q("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:yn,hcLight:yn},w("editorSelectionHighlightBorder","Border color for regions with the same content as the selection."));q("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},w("editorFindMatch","Color of the current search match."));const CVe=q("editor.findMatchForeground",null,w("editorFindMatchForeground","Text color of the current search match.")),dg=q("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),yVe=q("editor.findMatchHighlightForeground",null,w("findMatchHighlightForeground","Foreground color of the other search matches."),!0);q("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);q("editor.findMatchBorder",{light:null,dark:null,hcDark:yn,hcLight:yn},w("editorFindMatchBorder","Border color of the current search match."));const lm=q("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:yn,hcLight:yn},w("findMatchHighlightBorder","Border color of the other search matches.")),wVe=q("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:Ut(yn,.4),hcLight:Ut(yn,.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);q("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 F4=q("editorHoverWidget.background",Ul,w("hoverBackground","Background color of the editor hover."));q("editorHoverWidget.foreground",BH,w("hoverForeground","Foreground color of the editor hover."));const _Ce=q("editorHoverWidget.border",Xee,w("hoverBorder","Border color of the editor hover."));q("editorHoverWidget.statusBarBackground",{dark:Iu(F4,.2),light:My(F4,.05),hcDark:Ul,hcLight:Ul},w("statusBarBackground","Background color of the editor hover status bar."));const Jee=q("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:be.white,hcLight:be.black},w("editorInlayHintForeground","Foreground color of inline hints")),ete=q("editorInlayHint.background",{dark:Ut(J2,.1),light:Ut(J2,.1),hcDark:Ut(be.white,.1),hcLight:Ut(J2,.1)},w("editorInlayHintBackground","Background color of inline hints")),SVe=q("editorInlayHint.typeForeground",Jee,w("editorInlayHintForegroundTypes","Foreground color of inline hints for types")),xVe=q("editorInlayHint.typeBackground",ete,w("editorInlayHintBackgroundTypes","Background color of inline hints for types")),kVe=q("editorInlayHint.parameterForeground",Jee,w("editorInlayHintForegroundParameter","Foreground color of inline hints for parameters")),LVe=q("editorInlayHint.parameterBackground",ete,w("editorInlayHintBackgroundParameter","Background color of inline hints for parameters")),DVe=q("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},w("editorLightBulbForeground","The color used for the lightbulb actions icon."));q("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon."));q("editorLightBulbAi.foreground",DVe,w("editorLightBulbAiForeground","The color used for the lightbulb AI icon."));q("editor.snippetTabstopHighlightBackground",{dark:new be(new mi(124,124,124,.3)),light:new be(new mi(10,50,100,.2)),hcDark:new be(new mi(124,124,124,.3)),hcLight:new be(new mi(10,50,100,.2))},w("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop."));q("editor.snippetTabstopHighlightBorder",null,w("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop."));q("editor.snippetFinalTabstopHighlightBackground",null,w("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet."));q("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new be(new mi(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},w("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet."));const _K=new be(new mi(155,185,85,.2)),vK=new be(new mi(255,0,0,.2)),EVe=q("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),IVe=q("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);q("diffEditor.insertedLineBackground",{dark:_K,light:_K,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);q("diffEditor.removedLineBackground",{dark:vK,light:vK,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);q("diffEditorGutter.insertedLineBackground",null,w("diffEditorInsertedLineGutter","Background color for the margin where lines got inserted."));q("diffEditorGutter.removedLineBackground",null,w("diffEditorRemovedLineGutter","Background color for the margin where lines got removed."));const TVe=q("diffEditorOverview.insertedForeground",null,w("diffEditorOverviewInserted","Diff overview ruler foreground for inserted content.")),NVe=q("diffEditorOverview.removedForeground",null,w("diffEditorOverviewRemoved","Diff overview ruler foreground for removed content."));q("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},w("diffEditorInsertedOutline","Outline color for the text that got inserted."));q("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},w("diffEditorRemovedOutline","Outline color for text that got removed."));q("diffEditor.border",{dark:null,light:null,hcDark:fi,hcLight:fi},w("diffEditorBorder","Border color between the two text editors."));q("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."));q("diffEditor.unchangedRegionBackground","sideBar.background",w("diffEditor.unchangedRegionBackground","The background color of unchanged blocks in the diff editor."));q("diffEditor.unchangedRegionForeground","foreground",w("diffEditor.unchangedRegionForeground","The foreground color of unchanged blocks in the diff editor."));q("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},w("diffEditor.unchangedCodeBackground","The background color of unchanged code in the diff editor."));const Nx=q("widget.shadow",{dark:Ut(be.black,.36),light:Ut(be.black,.16),hcDark:null,hcLight:null},w("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),vCe=q("widget.border",{dark:null,light:null,hcDark:fi,hcLight:fi},w("widgetBorder","Border color of widgets such as find/replace inside the editor.")),Rde=q("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},w("toolbarHoverBackground","Toolbar background when hovering over actions using the mouse"));q("toolbar.hoverOutline",{dark:null,light:null,hcDark:yn,hcLight:yn},w("toolbarHoverOutline","Toolbar outline when hovering over actions using the mouse"));q("toolbar.activeBackground",{dark:Iu(Rde,.1),light:My(Rde,.1),hcDark:null,hcLight:null},w("toolbarActiveBackground","Toolbar background when holding the mouse over actions"));const MVe=q("breadcrumb.foreground",Ut(Zt,.8),w("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),RVe=q("breadcrumb.background",Md,w("breadcrumbsBackground","Background color of breadcrumb items.")),Pde=q("breadcrumb.focusForeground",{light:My(Zt,.2),dark:Iu(Zt,.1),hcDark:Iu(Zt,.1),hcLight:Iu(Zt,.1)},w("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),PVe=q("breadcrumb.activeSelectionForeground",{light:My(Zt,.2),dark:Iu(Zt,.1),hcDark:Iu(Zt,.1),hcLight:Iu(Zt,.1)},w("breadcrumbsSelectedForeground","Color of selected breadcrumb items."));q("breadcrumbPicker.background",Ul,w("breadcrumbsSelectedBackground","Background color of breadcrumb item picker."));const bCe=.5,Ode=be.fromHex("#40C8AE").transparent(bCe),Ade=be.fromHex("#40A6FF").transparent(bCe),Fde=be.fromHex("#606060").transparent(.4),tte=.4,RS=1,bK=q("merge.currentHeaderBackground",{dark:Ode,light:Ode,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);q("merge.currentContentBackground",Ut(bK,tte),w("mergeCurrentContentBackground","Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const CK=q("merge.incomingHeaderBackground",{dark:Ade,light:Ade,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);q("merge.incomingContentBackground",Ut(CK,tte),w("mergeIncomingContentBackground","Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const yK=q("merge.commonHeaderBackground",{dark:Fde,light:Fde,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);q("merge.commonContentBackground",Ut(yK,tte),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 PS=q("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},w("mergeBorder","Border color on headers and the splitter in inline merge-conflicts."));q("editorOverviewRuler.currentContentForeground",{dark:Ut(bK,RS),light:Ut(bK,RS),hcDark:PS,hcLight:PS},w("overviewRulerCurrentContentForeground","Current overview ruler foreground for inline merge-conflicts."));q("editorOverviewRuler.incomingContentForeground",{dark:Ut(CK,RS),light:Ut(CK,RS),hcDark:PS,hcLight:PS},w("overviewRulerIncomingContentForeground","Incoming overview ruler foreground for inline merge-conflicts."));q("editorOverviewRuler.commonContentForeground",{dark:Ut(yK,RS),light:Ut(yK,RS),hcDark:PS,hcLight:PS},w("overviewRulerCommonContentForeground","Common ancestor overview ruler foreground for inline merge-conflicts."));const az=q("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:"#AB5A00"},w("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),CCe=q("editorOverviewRuler.selectionHighlightForeground","#A0A0A0CC",w("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),OVe=q("problemsErrorIcon.foreground",WH,w("problemsErrorIconForeground","The color used for the problems error icon.")),AVe=q("problemsWarningIcon.foreground",Og,w("problemsWarningIconForeground","The color used for the problems warning icon.")),FVe=q("problemsInfoIcon.foreground",Qh,w("problemsInfoIconForeground","The color used for the problems info icon.")),wK=q("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},w("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),HH=q("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},w("minimapSelectionOccurrenceHighlight","Minimap marker color for repeating editor selections."),!0),Bde=q("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},w("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0),BVe=q("minimap.infoHighlight",{dark:Qh,light:Qh,hcDark:PI,hcLight:PI},w("minimapInfo","Minimap marker color for infos.")),WVe=q("minimap.warningHighlight",{dark:Og,light:Og,hcDark:RI,hcLight:RI},w("overviewRuleWarning","Minimap marker color for warnings.")),HVe=q("minimap.errorHighlight",{dark:new be(new mi(255,18,18,.7)),light:new be(new mi(255,18,18,.7)),hcDark:new be(new mi(255,50,50,1)),hcLight:"#B5200D"},w("minimapError","Minimap marker color for errors.")),VVe=q("minimap.background",null,w("minimapBackground","Minimap background color.")),$Ve=q("minimap.foregroundOpacity",be.fromHex("#000f"),w("minimapForegroundOpacity",'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));q("minimapSlider.background",Ut(fCe,.5),w("minimapSliderBackground","Minimap slider background color."));q("minimapSlider.hoverBackground",Ut(gCe,.5),w("minimapSliderHoverBackground","Minimap slider background color when hovering."));q("minimapSlider.activeBackground",Ut(pCe,.5),w("minimapSliderActiveBackground","Minimap slider background color when clicked on."));q("charts.foreground",Zt,w("chartsForeground","The foreground color used in charts."));q("charts.lines",Ut(Zt,.5),w("chartsLines","The color used for horizontal lines in charts."));q("charts.red",WH,w("chartsRed","The red color used in chart visualizations."));q("charts.blue",Qh,w("chartsBlue","The blue color used in chart visualizations."));q("charts.yellow",Og,w("chartsYellow","The yellow color used in chart visualizations."));q("charts.orange",wK,w("chartsOrange","The orange color used in chart visualizations."));q("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},w("chartsGreen","The green color used in chart visualizations."));q("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},w("chartsPurple","The purple color used in chart visualizations."));const SK=q("input.background",{dark:"#3C3C3C",light:be.white,hcDark:be.black,hcLight:be.white},w("inputBoxBackground","Input box background.")),yCe=q("input.foreground",Zt,w("inputBoxForeground","Input box foreground.")),wCe=q("input.border",{dark:null,light:null,hcDark:fi,hcLight:fi},w("inputBoxBorder","Input box border.")),VH=q("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:fi,hcLight:fi},w("inputBoxActiveOptionBorder","Border color of activated options in input fields.")),zVe=q("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},w("inputOption.hoverBackground","Background color of activated options in input fields.")),mN=q("inputOption.activeBackground",{dark:Ut(Xh,.4),light:Ut(Xh,.2),hcDark:be.transparent,hcLight:be.transparent},w("inputOption.activeBackground","Background hover color of options in input fields.")),$H=q("inputOption.activeForeground",{dark:be.white,light:be.black,hcDark:Zt,hcLight:Zt},w("inputOption.activeForeground","Foreground color of activated options in input fields."));q("input.placeholderForeground",{light:Ut(Zt,.5),dark:Ut(Zt,.5),hcDark:Ut(Zt,.7),hcLight:Ut(Zt,.7)},w("inputPlaceholderForeground","Input box foreground color for placeholder text."));const jVe=q("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:be.black,hcLight:be.white},w("inputValidationInfoBackground","Input validation background color for information severity.")),UVe=q("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:Zt},w("inputValidationInfoForeground","Input validation foreground color for information severity.")),qVe=q("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:fi,hcLight:fi},w("inputValidationInfoBorder","Input validation border color for information severity.")),KVe=q("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:be.black,hcLight:be.white},w("inputValidationWarningBackground","Input validation background color for warning severity.")),GVe=q("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:Zt},w("inputValidationWarningForeground","Input validation foreground color for warning severity.")),YVe=q("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:fi,hcLight:fi},w("inputValidationWarningBorder","Input validation border color for warning severity.")),ZVe=q("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:be.black,hcLight:be.white},w("inputValidationErrorBackground","Input validation background color for error severity.")),XVe=q("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:Zt},w("inputValidationErrorForeground","Input validation foreground color for error severity.")),QVe=q("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:fi,hcLight:fi},w("inputValidationErrorBorder","Input validation border color for error severity.")),zH=q("dropdown.background",{dark:"#3C3C3C",light:be.white,hcDark:be.black,hcLight:be.white},w("dropdownBackground","Dropdown background.")),JVe=q("dropdown.listBackground",{dark:null,light:null,hcDark:be.black,hcLight:be.white},w("dropdownListBackground","Dropdown list background.")),ite=q("dropdown.foreground",{dark:"#F0F0F0",light:Zt,hcDark:be.white,hcLight:Zt},w("dropdownForeground","Dropdown foreground.")),nte=q("dropdown.border",{dark:zH,light:"#CECECE",hcDark:fi,hcLight:fi},w("dropdownBorder","Dropdown border.")),SCe=q("button.foreground",be.white,w("buttonForeground","Button foreground color.")),e7e=q("button.separator",Ut(SCe,.4),w("buttonSeparator","Button separator color.")),MD=q("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},w("buttonBackground","Button background color.")),t7e=q("button.hoverBackground",{dark:Iu(MD,.2),light:My(MD,.2),hcDark:MD,hcLight:MD},w("buttonHoverBackground","Button background color when hovering.")),i7e=q("button.border",fi,w("buttonBorder","Button border color.")),n7e=q("button.secondaryForeground",{dark:be.white,light:be.white,hcDark:be.white,hcLight:Zt},w("buttonSecondaryForeground","Secondary button foreground color.")),xK=q("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:be.white},w("buttonSecondaryBackground","Secondary button background color.")),s7e=q("button.secondaryHoverBackground",{dark:Iu(xK,.2),light:My(xK,.2),hcDark:null,hcLight:null},w("buttonSecondaryHoverBackground","Secondary button background color when hovering.")),RD=q("radio.activeForeground",$H,w("radioActiveForeground","Foreground color of active radio option.")),r7e=q("radio.activeBackground",mN,w("radioBackground","Background color of active radio option.")),o7e=q("radio.activeBorder",VH,w("radioActiveBorder","Border color of the active radio option.")),a7e=q("radio.inactiveForeground",null,w("radioInactiveForeground","Foreground color of inactive radio option.")),l7e=q("radio.inactiveBackground",null,w("radioInactiveBackground","Background color of inactive radio option.")),c7e=q("radio.inactiveBorder",{light:Ut(RD,.2),dark:Ut(RD,.2),hcDark:Ut(RD,.4),hcLight:Ut(RD,.2)},w("radioInactiveBorder","Border color of the inactive radio option.")),d7e=q("radio.inactiveHoverBackground",zVe,w("radioHoverBackground","Background color of inactive active radio option when hovering.")),u7e=q("checkbox.background",zH,w("checkbox.background","Background color of checkbox widget."));q("checkbox.selectBackground",Ul,w("checkbox.select.background","Background color of checkbox widget when the element it's in is selected."));const h7e=q("checkbox.foreground",ite,w("checkbox.foreground","Foreground color of checkbox widget.")),f7e=q("checkbox.border",nte,w("checkbox.border","Border color of checkbox widget."));q("checkbox.selectBorder",A4,w("checkbox.select.border","Border color of checkbox widget when the element it's in is selected."));const g7e=q("keybindingLabel.background",{dark:new be(new mi(128,128,128,.17)),light:new be(new mi(221,221,221,.4)),hcDark:be.transparent,hcLight:be.transparent},w("keybindingLabelBackground","Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),p7e=q("keybindingLabel.foreground",{dark:be.fromHex("#CCCCCC"),light:be.fromHex("#555555"),hcDark:be.white,hcLight:Zt},w("keybindingLabelForeground","Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),m7e=q("keybindingLabel.border",{dark:new be(new mi(51,51,51,.6)),light:new be(new mi(204,204,204,.4)),hcDark:new be(new mi(111,195,223)),hcLight:fi},w("keybindingLabelBorder","Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),_7e=q("keybindingLabel.bottomBorder",{dark:new be(new mi(68,68,68,.6)),light:new be(new mi(187,187,187,.4)),hcDark:new be(new mi(111,195,223)),hcLight:Zt},w("keybindingLabelBottomBorder","Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),v7e=q("list.focusBackground",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.")),b7e=q("list.focusForeground",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.")),C7e=q("list.focusOutline",{dark:Xh,light:Xh,hcDark:yn,hcLight:yn},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.")),y7e=q("list.focusAndSelectionOutline",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.")),QC=q("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:be.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.")),OI=q("list.activeSelectionForeground",{dark:be.white,light:be.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.")),xCe=q("list.activeSelectionIconForeground",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.")),w7e=q("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:be.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.")),S7e=q("list.inactiveSelectionForeground",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.")),x7e=q("list.inactiveSelectionIconForeground",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.")),k7e=q("list.inactiveFocusBackground",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.")),L7e=q("list.inactiveFocusOutline",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.")),kCe=q("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:be.white.transparent(.1),hcLight:be.fromHex("#0F4A85").transparent(.1)},w("listHoverBackground","List/Tree background when hovering over items using the mouse.")),LCe=q("list.hoverForeground",null,w("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),D7e=q("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.")),E7e=q("list.dropBetweenBackground",{dark:A4,light:A4,hcDark:null,hcLight:null},w("listDropBetweenBackground","List/Tree drag and drop border color when moving items between items when using the mouse.")),n0=q("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:Xh,hcLight:Xh},w("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree.")),I7e=q("list.focusHighlightForeground",{dark:n0,light:uVe(QC,n0,"#BBE7FF"),hcDark:n0,hcLight:n0},w("listFocusHighlightForeground","List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));q("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."));q("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},w("listErrorForeground","Foreground color of list items containing errors."));q("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},w("listWarningForeground","Foreground color of list items containing warnings."));const T7e=q("listFilterWidget.background",{light:My(Ul,0),dark:Iu(Ul,0),hcDark:Ul,hcLight:Ul},w("listFilterWidgetBackground","Background color of the type filter widget in lists and trees.")),N7e=q("listFilterWidget.outline",{dark:be.transparent,light:be.transparent,hcDark:"#f38518",hcLight:"#007ACC"},w("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),M7e=q("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:fi,hcLight:fi},w("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),R7e=q("listFilterWidget.shadow",Nx,w("listFilterWidgetShadow","Shadow color of the type filter widget in lists and trees."));q("list.filterMatchBackground",{dark:dg,light:dg,hcDark:null,hcLight:null},w("listFilterMatchHighlight","Background color of the filtered match."));q("list.filterMatchBorder",{dark:lm,light:lm,hcDark:fi,hcLight:yn},w("listFilterMatchHighlightBorder","Border color of the filtered match."));q("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},w("listDeemphasizedForeground","List/Tree foreground color for items that are deemphasized."));const DCe=q("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},w("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),P7e=q("tree.inactiveIndentGuidesStroke",Ut(DCe,.4),w("treeInactiveIndentGuidesStroke","Tree stroke color for the indentation guides that are not active.")),O7e=q("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},w("tableColumnsBorder","Table border color between columns.")),A7e=q("tree.tableOddRowsBackground",{dark:Ut(Zt,.04),light:Ut(Zt,.04),hcDark:null,hcLight:null},w("tableOddRowsBackgroundColor","Background color for odd table rows."));q("editorActionList.background",Ul,w("editorActionListBackground","Action List background color."));q("editorActionList.foreground",BH,w("editorActionListForeground","Action List foreground color."));q("editorActionList.focusForeground",OI,w("editorActionListFocusForeground","Action List foreground color for the focused item."));q("editorActionList.focusBackground",QC,w("editorActionListFocusBackground","Action List background color for the focused item."));const F7e=q("menu.border",{dark:null,light:null,hcDark:fi,hcLight:fi},w("menuBorder","Border color of menus.")),B7e=q("menu.foreground",ite,w("menuForeground","Foreground color of menu items.")),W7e=q("menu.background",zH,w("menuBackground","Background color of menu items.")),H7e=q("menu.selectionForeground",OI,w("menuSelectionForeground","Foreground color of the selected menu item in menus.")),V7e=q("menu.selectionBackground",QC,w("menuSelectionBackground","Background color of the selected menu item in menus.")),$7e=q("menu.selectionBorder",{dark:null,light:null,hcDark:yn,hcLight:yn},w("menuSelectionBorder","Border color of the selected menu item in menus.")),z7e=q("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:fi,hcLight:fi},w("menuSeparatorBackground","Color of a separator menu item in menus.")),Wde=q("quickInput.background",Ul,w("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),j7e=q("quickInput.foreground",BH,w("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),U7e=q("quickInputTitle.background",{dark:new be(new mi(255,255,255,.105)),light:new be(new mi(0,0,0,.06)),hcDark:"#000000",hcLight:be.white},w("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),ECe=q("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:be.white,hcLight:"#0F4A85"},w("pickerGroupForeground","Quick picker color for grouping labels.")),q7e=q("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:be.white,hcLight:"#0F4A85"},w("pickerGroupBorder","Quick picker color for grouping borders.")),Hde=q("quickInput.list.focusBackground",null,"",void 0,w("quickInput.list.focusBackground deprecation","Please use quickInputList.focusBackground instead")),AI=q("quickInputList.focusForeground",OI,w("quickInput.listFocusForeground","Quick picker foreground color for the focused item.")),ste=q("quickInputList.focusIconForeground",xCe,w("quickInput.listFocusIconForeground","Quick picker icon foreground color for the focused item.")),FI=q("quickInputList.focusBackground",{dark:MI(Hde,QC),light:MI(Hde,QC),hcDark:null,hcLight:null},w("quickInput.listFocusBackground","Quick picker background color for the focused item."));q("search.resultsInfoForeground",{light:Zt,dark:Ut(Zt,.65),hcDark:Zt,hcLight:Zt},w("search.resultsInfoForeground","Color of the text in the search viewlet's completion message."));q("searchEditor.findMatchBackground",{light:Ut(dg,.66),dark:Ut(dg,.66),hcDark:dg,hcLight:dg},w("searchEditor.queryMatch","Color of the Search Editor query matches."));q("searchEditor.findMatchBorder",{light:Ut(lm,.66),dark:Ut(lm,.66),hcDark:lm,hcLight:lm},w("searchEditor.editorFindMatchBorder","Border color of the Search Editor query matches."));var K7e=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Vde=function(s,e){return function(t,i){e(t,i,s)}};const df=ii("hoverService");let OS=class extends re{get delay(){return this.isInstantlyHovering()?0:this._delay}constructor(e,t,i={},n,r){super(),this.placement=e,this.instantHover=t,this.overrideOptions=i,this.configurationService=n,this.hoverService=r,this.lastHoverHideTime=0,this.timeLimit=200,this.hoverDisposables=this._register(new me),this._delay=this.configurationService.getValue("workbench.hover.delay"),this._register(this.configurationService.onDidChangeConfiguration(o=>{o.affectsConfiguration("workbench.hover.delay")&&(this._delay=this.configurationService.getValue("workbench.hover.delay"))}))}showHover(e,t){const i=typeof this.overrideOptions=="function"?this.overrideOptions(e,t):this.overrideOptions;this.hoverDisposables.clear();const n=Xs(e.target)?[e.target]:e.target.targetElements;for(const o of n)this.hoverDisposables.add(Hn(o,"keydown",a=>{a.equals(9)&&this.hoverService.hideHover()}));const r=Xs(e.content)?void 0:e.content.toString();return this.hoverService.showHover({...e,...i,persistence:{hideOnKeyDown:!0,...i.persistence},id:r,appearance:{...e.appearance,compact:!0,skipFadeInAnimation:this.isInstantlyHovering(),...i.appearance}},t)}isInstantlyHovering(){return this.instantHover&&Date.now()-this.lastHoverHideTime<this.timeLimit}onDidHideHover(){this.hoverDisposables.clear(),this.instantHover&&(this.lastHoverHideTime=Date.now())}};OS=K7e([Vde(3,Gt),Vde(4,df)],OS);const qg=ii("contextViewService"),gl=ii("contextMenuService"),Mi=ii("keybindingService");class Mx{constructor(){this._hooks=new me,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;const i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,n,r){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=n,this._onStopCallback=r;let o=e;try{e.setPointerCapture(t),this._hooks.add(dt(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{o=mt(e)}this._hooks.add(ue(o,Ae.POINTER_MOVE,a=>{if(a.buttons!==i){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(ue(o,Ae.POINTER_UP,a=>this.stopMonitoring(!0)))}}function ps(s,e,t){let i=null,n=null;if(typeof t.value=="function"?(i="value",n=t.value,n.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof t.get=="function"&&(i="get",n=t.get),!n)throw new Error("not supported");const r=`$memoize$${e}`;t[i]=function(...o){return this.hasOwnProperty(r)||Object.defineProperty(this,r,{configurable:!1,enumerable:!1,writable:!1,value:n.apply(this,o)}),this[r]}}var G7e=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},rn;(function(s){s.Tap="-monaco-gesturetap",s.Change="-monaco-gesturechange",s.Start="-monaco-gesturestart",s.End="-monaco-gesturesend",s.Contextmenu="-monaco-gesturecontextmenu"})(rn||(rn={}));const Br=class Br extends re{constructor(){super(),this.dispatched=!1,this.targets=new Vo,this.ignoreTargets=new Vo,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(We.runAndSubscribe(vH,({window:e,disposables:t})=>{t.add(ue(e.document,"touchstart",i=>this.onTouchStart(i),{passive:!1})),t.add(ue(e.document,"touchend",i=>this.onTouchEnd(e,i))),t.add(ue(e.document,"touchmove",i=>this.onTouchMove(i),{passive:!1}))},{window:Qi,disposables:this._store}))}static addTarget(e){if(!Br.isTouchDevice())return re.None;Br.INSTANCE||(Br.INSTANCE=new Br);const t=Br.INSTANCE.targets.push(e);return dt(t)}static ignoreTarget(e){if(!Br.isTouchDevice())return re.None;Br.INSTANCE||(Br.INSTANCE=new Br);const t=Br.INSTANCE.ignoreTargets.push(e);return dt(t)}static isTouchDevice(){return"ontouchstart"in Qi||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){const t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,n=e.targetTouches.length;i<n;i++){const r=e.targetTouches.item(i);this.activeTouches[r.identifier]={id:r.identifier,initialTarget:r.target,initialTimeStamp:t,initialPageX:r.pageX,initialPageY:r.pageY,rollingTimestamps:[t],rollingPageX:[r.pageX],rollingPageY:[r.pageY]};const o=this.newGestureEvent(rn.Start,r.target);o.pageX=r.pageX,o.pageY=r.pageY,this.dispatchEvent(o)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}onTouchEnd(e,t){const i=Date.now(),n=Object.keys(this.activeTouches).length;for(let r=0,o=t.changedTouches.length;r<o;r++){const a=t.changedTouches.item(r);if(!this.activeTouches.hasOwnProperty(String(a.identifier))){console.warn("move of an UNKNOWN touch",a);continue}const l=this.activeTouches[a.identifier],d=Date.now()-l.initialTimeStamp;if(d<Br.HOLD_DELAY&&Math.abs(l.initialPageX-bc(l.rollingPageX))<30&&Math.abs(l.initialPageY-bc(l.rollingPageY))<30){const h=this.newGestureEvent(rn.Tap,l.initialTarget);h.pageX=bc(l.rollingPageX),h.pageY=bc(l.rollingPageY),this.dispatchEvent(h)}else if(d>=Br.HOLD_DELAY&&Math.abs(l.initialPageX-bc(l.rollingPageX))<30&&Math.abs(l.initialPageY-bc(l.rollingPageY))<30){const h=this.newGestureEvent(rn.Contextmenu,l.initialTarget);h.pageX=bc(l.rollingPageX),h.pageY=bc(l.rollingPageY),this.dispatchEvent(h)}else if(n===1){const h=bc(l.rollingPageX),f=bc(l.rollingPageY),p=bc(l.rollingTimestamps)-l.rollingTimestamps[0],m=h-l.rollingPageX[0],v=f-l.rollingPageY[0],b=[...this.targets].filter(y=>l.initialTarget instanceof Node&&y.contains(l.initialTarget));this.inertia(e,b,i,Math.abs(m)/p,m>0?1:-1,h,Math.abs(v)/p,v>0?1:-1,f)}this.dispatchEvent(this.newGestureEvent(rn.End,l.initialTarget)),delete this.activeTouches[a.identifier]}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){const i=document.createEvent("CustomEvent");return i.initEvent(e,!1,!0),i.initialTarget=t,i.tapCount=0,i}dispatchEvent(e){if(e.type===rn.Tap){const t=new Date().getTime();let i=0;t-this._lastSetTapCountTime>Br.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=t,e.tapCount=i}else(e.type===rn.Change||e.type===rn.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(const i of this.ignoreTargets)if(i.contains(e.initialTarget))return;const t=[];for(const i of this.targets)if(i.contains(e.initialTarget)){let n=0,r=e.initialTarget;for(;r&&r!==i;)n++,r=r.parentElement;t.push([n,i])}t.sort((i,n)=>i[0]-n[0]);for(const[i,n]of t)n.dispatchEvent(e),this.dispatched=!0}}inertia(e,t,i,n,r,o,a,l,d){this.handle=hl(e,()=>{const h=Date.now(),f=h-i;let p=0,m=0,v=!0;n+=Br.SCROLL_FRICTION*f,a+=Br.SCROLL_FRICTION*f,n>0&&(v=!1,p=r*n*f),a>0&&(v=!1,m=l*a*f);const b=this.newGestureEvent(rn.Change);b.translationX=p,b.translationY=m,t.forEach(y=>y.dispatchEvent(b)),v||this.inertia(e,t,h,n,r,o+p,a,l,d+m)})}onTouchMove(e){const t=Date.now();for(let i=0,n=e.changedTouches.length;i<n;i++){const r=e.changedTouches.item(i);if(!this.activeTouches.hasOwnProperty(String(r.identifier))){console.warn("end of an UNKNOWN touch",r);continue}const o=this.activeTouches[r.identifier],a=this.newGestureEvent(rn.Change,o.initialTarget);a.translationX=r.pageX-bc(o.rollingPageX),a.translationY=r.pageY-bc(o.rollingPageY),a.pageX=r.pageX,a.pageY=r.pageY,this.dispatchEvent(a),o.rollingPageX.length>3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(r.pageX),o.rollingPageY.push(r.pageY),o.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}};Br.SCROLL_FRICTION=-.005,Br.HOLD_DELAY=700,Br.CLEAR_TAP_COUNT_TIME=400;let io=Br;G7e([ps],io,"isTouchDevice",null);let rc=class extends re{onclick(e,t){this._register(ue(e,Ae.CLICK,i=>t(new Cd(mt(e),i))))}onmousedown(e,t){this._register(ue(e,Ae.MOUSE_DOWN,i=>t(new Cd(mt(e),i))))}onmouseover(e,t){this._register(ue(e,Ae.MOUSE_OVER,i=>t(new Cd(mt(e),i))))}onmouseleave(e,t){this._register(ue(e,Ae.MOUSE_LEAVE,i=>t(new Cd(mt(e),i))))}onkeydown(e,t){this._register(ue(e,Ae.KEY_DOWN,i=>t(new nn(i))))}onkeyup(e,t){this._register(ue(e,Ae.KEY_UP,i=>t(new nn(i))))}oninput(e,t){this._register(ue(e,Ae.INPUT,t))}onblur(e,t){this._register(ue(e,Ae.BLUR,t))}onfocus(e,t){this._register(ue(e,Ae.FOCUS,t))}ignoreGesture(e){return io.ignoreTarget(e)}};const AS=11;class Y7e extends rc{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(...bt.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=AS+"px",this.domNode.style.height=AS+"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 Mx),this._register(Hn(this.bgDomNode,Ae.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Hn(this.domNode,Ae.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new Eee),this._pointerdownScheduleRepeatTimer=this._register(new Ad)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,mt(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}}class Z7e extends re{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new Ad)}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.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)==null||t.setClassName(this._invisibleClassName+(e?" fade":"")))}}const X7e=140;class ICe extends rc{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 Z7e(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new Mx),this._shouldRender=!0,this.domNode=Ni(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(ue(this.domNode.domNode,Ae.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){const t=this._register(new Y7e(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,n){this.slider=Ni(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof n=="number"&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(ue(this.slider.domNode,Ae.POINTER_DOWN,r=>{r.button===0&&(r.preventDefault(),this._sliderPointerDown(r))})),this.onclick(this.slider.domNode,r=>{r.leftButton&&r.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){const t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),n=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),r=this._sliderPointerPosition(e);i<=r&&r<=n?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,i=e.offsetY;else{const r=ts(this.domNode.domNode);t=e.pageX-r.left,i=e.pageY-r.top}const n=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(n):this._scrollbarState.getDesiredScrollPositionFromOffset(n)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),n=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>{const o=this._sliderOrthogonalPointerPosition(r),a=Math.abs(o-i);if(Ur&&a>X7e){this._setDesiredScrollPositionNow(n.getScrollPosition());return}const d=this._sliderPointerPosition(r)-t;this._setDesiredScrollPositionNow(n.getDesiredScrollPositionFromDelta(d))},()=>{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 Q7e=20;class FS{constructor(e,t,i,n,r,o){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=n,this._scrollSize=r,this._scrollPosition=o,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new FS(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){const t=Math.round(e);return this._visibleSize!==t?(this._visibleSize=t,this._refreshComputedValues(),!0):!1}setScrollSize(e){const t=Math.round(e);return this._scrollSize!==t?(this._scrollSize=t,this._refreshComputedValues(),!0):!1}setScrollPosition(e){const t=Math.round(e);return this._scrollPosition!==t?(this._scrollPosition=t,this._refreshComputedValues(),!0):!1}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,i,n,r){const o=Math.max(0,i-e),a=Math.max(0,o-2*t),l=n>0&&n>i;if(!l)return{computedAvailableSize:Math.round(o),computedIsNeeded:l,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};const d=Math.round(Math.max(Q7e,Math.floor(i*a/n))),h=(a-d)/(n-i),f=r*h;return{computedAvailableSize:Math.round(o),computedIsNeeded:l,computedSliderSize:Math.round(d),computedSliderRatio:h,computedSliderPosition:Math.round(f)}}_refreshComputedValues(){const e=FS._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize;let i=this._scrollPosition;return t<this._computedSliderPosition?i-=this._visibleSize:i+=this._visibleSize,i}getDesiredScrollPositionFromDelta(e){if(!this._computedIsNeeded)return 0;const t=this._computedSliderPosition+e;return Math.round(t/this._computedSliderRatio)}}class J7e extends ICe{constructor(e,t,i){const n=e.getScrollDimensions(),r=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new FS(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,n.width,n.scrollWidth,r.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows){const o=(t.arrowSize-AS)/2,a=(t.horizontalScrollbarSize-AS)/2;this._createArrow({className:"scra",icon:Oe.scrollbarButtonLeft,top:a,left:o,bottom:void 0,right:void 0,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new GC(null,1,0))}),this._createArrow({className:"scra",icon:Oe.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:o,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new GC(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 e9e extends ICe{constructor(e,t,i){const n=e.getScrollDimensions(),r=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new FS(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,r.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const o=(t.arrowSize-AS)/2,a=(t.verticalScrollbarSize-AS)/2;this._createArrow({className:"scra",icon:Oe.scrollbarButtonUp,top:o,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new GC(null,0,1))}),this._createArrow({className:"scra",icon:Oe.scrollbarButtonDown,top:void 0,left:a,bottom:o,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new GC(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 B4{constructor(e,t,i,n,r,o,a){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t=t|0,i=i|0,n=n|0,r=r|0,o=o|0,a=a|0),this.rawScrollLeft=n,this.rawScrollTop=a,t<0&&(t=0),n+t>i&&(n=i-t),n<0&&(n=0),r<0&&(r=0),a+r>o&&(a=o-r),a<0&&(a=0),this.width=t,this.scrollWidth=i,this.scrollLeft=n,this.height=r,this.scrollHeight=o,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 B4(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 B4(this._forceIntegerValues,this.width,this.scrollWidth,typeof e.scrollLeft<"u"?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof e.scrollTop<"u"?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){const i=this.width!==e.width,n=this.scrollWidth!==e.scrollWidth,r=this.scrollLeft!==e.scrollLeft,o=this.height!==e.height,a=this.scrollHeight!==e.scrollHeight,l=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i,scrollWidthChanged:n,scrollLeftChanged:r,heightChanged:o,scrollHeightChanged:a,scrollTopChanged:l}}}class Rx extends re{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 B4(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 i=this._state.withScrollDimensions(e,t);this._setState(i,!!this._smoothScrolling),(n=this._smoothScrolling)==null||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 i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let n;t?n=new BI(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):n=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{const i=this._state.withScrollPosition(e);this._smoothScrolling=BI.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;const e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){const i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}}class $de{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function lz(s,e){const t=e-s;return function(i){return s+t*n9e(i)}}function t9e(s,e,t){return function(i){return i<t?s(i/t):e((i-t)/(1-t))}}class BI{constructor(e,t,i,n){this.from=e,this.to=t,this.duration=n,this.startTime=i,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,t,i){if(Math.abs(e-t)>2.5*i){let r,o;return e<t?(r=e+.75*i,o=t-.75*i):(r=e-.75*i,o=t+.75*i),t9e(lz(e,r),lz(o,t),.33)}return lz(e,t)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(e){this.to=e.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(e){const t=(e-this.startTime)/this.duration;if(t<1){const i=this.scrollLeft(t),n=this.scrollTop(t);return new $de(i,n,!1)}return new $de(this.to.scrollLeft,this.to.scrollTop,!0)}combine(e,t,i){return BI.start(e,t,i)}static start(e,t,i){i=i+10;const n=Date.now()-10;return new BI(e,t,n,i)}}function i9e(s){return Math.pow(s,3)}function n9e(s){return 1-i9e(1-s)}const s9e=500,zde=50;class r9e{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}}const gB=class gB{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let e=1,t=0,i=1,n=this._rear;do{const r=n===this._front?e:Math.pow(2,-i);if(e-=r,t+=this._memory[n].score*r,n===this._front)break;n=(this._capacity+n-1)%this._capacity,i++}while(!0);return t<=.5}acceptStandardWheelEvent(e){if(uN){const t=mt(e.browserEvent),i=x5e(t);this.accept(Date.now(),e.deltaX*i,e.deltaY*i)}else this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,t,i){let n=null;const r=new r9e(e,t,i);this._front===-1&&this._rear===-1?(this._memory[0]=r,this._front=0,this._rear=0):(n=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=r),r.score=this._computeScore(r,n)}_computeScore(e,t){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let i=.5;if((!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(i+=.25),t){const n=Math.abs(e.deltaX),r=Math.abs(e.deltaY),o=Math.abs(t.deltaX),a=Math.abs(t.deltaY),l=Math.max(Math.min(n,o),1),d=Math.max(Math.min(r,a),1),h=Math.max(n,o),f=Math.max(r,a);h%l===0&&f%d===0&&(i-=.5)}return Math.min(Math.max(i,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}};gB.INSTANCE=new gB;let W4=gB;class rte extends rc{get options(){return this._options}constructor(e,t,i){super(),this._onScroll=this._register(new se),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new se),e.style.overflow="hidden",this._options=o9e(t),this._scrollable=i,this._register(this._scrollable.onScroll(r=>{this._onWillScroll.fire(r),this._onDidScroll(r),this._onScroll.fire(r)}));const n={onMouseWheel:r=>this._onMouseWheel(r),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new e9e(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new J7e(this._scrollable,this._options,n)),this._domNode=document.createElement("div"),this._domNode.className="monaco-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.style.overflow="hidden",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=Ni(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Ni(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Ni(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,r=>this._onMouseOver(r)),this.onmouseleave(this._listenOnDomNode,r=>this._onMouseLeave(r)),this._hideTimeout=this._register(new Ad),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=Xi(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,ti&&(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 GC(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Xi(this._mouseWheelToDispose),e)){const i=n=>{this._onMouseWheel(new GC(n))};this._mouseWheelToDispose.push(ue(this._listenOnDomNode,Ae.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){var r;if((r=e.browserEvent)!=null&&r.defaultPrevented)return;const t=W4.INSTANCE;t.acceptStandardWheelEvent(e);let i=!1;if(e.deltaY||e.deltaX){let o=e.deltaY*this._options.mouseWheelScrollSensitivity,a=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&a+o===0?a=o=0:Math.abs(o)>=Math.abs(a)?a=0:o=0),this._options.flipAxes&&([o,a]=[a,o]);const l=!ti&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||l)&&!a&&(a=o,o=0),e.browserEvent&&e.browserEvent.altKey&&(a=a*this._options.fastScrollSensitivity,o=o*this._options.fastScrollSensitivity);const d=this._scrollable.getFutureScrollPosition();let h={};if(o){const f=zde*o,p=d.scrollTop-(f<0?Math.floor(f):Math.ceil(f));this._verticalScrollbar.writeScrollPosition(h,p)}if(a){const f=zde*a,p=d.scrollLeft-(f<0?Math.floor(f):Math.ceil(f));this._horizontalScrollbar.writeScrollPosition(h,p)}h=this._scrollable.validateScrollPosition(h),(d.scrollLeft!==h.scrollLeft||d.scrollTop!==h.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(h):this._scrollable.setScrollPositionNow(h),i=!0)}let n=i;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,n=i?" left":"",r=t?" top":"",o=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${r}`),this._topLeftShadowDomNode.setClassName(`shadow${o}${r}${n}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),s9e)}}class TCe extends rte{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new Rx({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:n=>hl(mt(e),n)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class jH extends rte{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class _N extends rte{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new Rx({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:n=>hl(mt(e),n)});super(e,t,i),this._register(i),this._element=e,this._register(this.onScroll(n=>{n.scrollTopChanged&&(this._element.scrollTop=n.scrollTop),n.scrollLeftChanged&&(this._element.scrollLeft=n.scrollLeft)})),this.scanDomNode()}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}}function o9e(s){const e={lazyRender:typeof s.lazyRender<"u"?s.lazyRender:!1,className:typeof s.className<"u"?s.className:"",useShadows:typeof s.useShadows<"u"?s.useShadows:!0,handleMouseWheel:typeof s.handleMouseWheel<"u"?s.handleMouseWheel:!0,flipAxes:typeof s.flipAxes<"u"?s.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof s.consumeMouseWheelIfScrollbarIsNeeded<"u"?s.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof s.alwaysConsumeMouseWheel<"u"?s.alwaysConsumeMouseWheel:!1,scrollYToX:typeof s.scrollYToX<"u"?s.scrollYToX:!1,mouseWheelScrollSensitivity:typeof s.mouseWheelScrollSensitivity<"u"?s.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof s.fastScrollSensitivity<"u"?s.fastScrollSensitivity:5,scrollPredominantAxis:typeof s.scrollPredominantAxis<"u"?s.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof s.mouseWheelSmoothScroll<"u"?s.mouseWheelSmoothScroll:!0,arrowSize:typeof s.arrowSize<"u"?s.arrowSize:11,listenOnDomNode:typeof s.listenOnDomNode<"u"?s.listenOnDomNode:null,horizontal:typeof s.horizontal<"u"?s.horizontal:1,horizontalScrollbarSize:typeof s.horizontalScrollbarSize<"u"?s.horizontalScrollbarSize:10,horizontalSliderSize:typeof s.horizontalSliderSize<"u"?s.horizontalSliderSize:0,horizontalHasArrows:typeof s.horizontalHasArrows<"u"?s.horizontalHasArrows:!1,vertical:typeof s.vertical<"u"?s.vertical:1,verticalScrollbarSize:typeof s.verticalScrollbarSize<"u"?s.verticalScrollbarSize:10,verticalHasArrows:typeof s.verticalHasArrows<"u"?s.verticalHasArrows:!1,verticalSliderSize:typeof s.verticalSliderSize<"u"?s.verticalSliderSize:0,scrollByPage:typeof s.scrollByPage<"u"?s.scrollByPage:!1};return e.horizontalSliderSize=typeof s.horizontalSliderSize<"u"?s.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof s.verticalSliderSize<"u"?s.verticalSliderSize:e.verticalScrollbarSize,ti&&(e.className+=" mac"),e}const TA=Fe;let ote=class extends re{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 _N(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}};class UH extends re{static render(e,t,i){return new UH(e,t,i)}constructor(e,t,i){super(),this.actionLabel=t.label,this.actionKeybindingLabel=i,this.actionContainer=Ee(e,TA("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=Ee(this.actionContainer,TA("a.action")),this.action.setAttribute("role","button"),t.iconClass&&Ee(this.action,TA(`span.icon.${t.iconClass}`));const n=Ee(this.action,TA("span"));n.textContent=i?`${t.label} (${i})`:t.label,this._store.add(new MCe(this.actionContainer,t.run)),this._store.add(new RCe(this.actionContainer,t.run,[3,10])),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 NCe(s,e){return s&&e?w("acessibleViewHint","Inspect this in the accessible view with {0}.",e):s?w("acessibleViewHintNoKbOpen","Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}class MCe extends re{constructor(e,t){super(),this._register(ue(e,Ae.CLICK,i=>{i.stopPropagation(),i.preventDefault(),t(e)}))}}class RCe extends re{constructor(e,t,i){super(),this._register(ue(e,Ae.KEY_DOWN,n=>{const r=new nn(n);i.some(o=>r.equals(o))&&(n.stopPropagation(),n.preventDefault(),t(e))}))}}const Ta=ii("openerService");function a9e(s){let e;const t=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(s.fragment);return t&&(e={startLineNumber:parseInt(t[1]),startColumn:t[2]?parseInt(t[2]):1,endLineNumber:t[4]?parseInt(t[4]):void 0,endColumn:t[4]?t[5]?parseInt(t[5]):1:void 0},s=s.with({fragment:""})),{selection:e,uri:s}}class si{get event(){return this.emitter.event}constructor(e,t,i){const n=r=>this.emitter.fire(r);this.emitter=new se({onWillAddFirstListener:()=>e.addEventListener(t,n,i),onDidRemoveLastListener:()=>e.removeEventListener(t,n,i)})}dispose(){this.emitter.dispose()}}function l9e(s,e={}){const t=ate(e);return t.textContent=s,t}function c9e(s,e={}){const t=ate(e);return PCe(t,u9e(s,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function ate(s){const e=s.inline?"span":"div",t=document.createElement(e);return s.className&&(t.className=s.className),t}class d9e{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 PCe(s,e,t,i){let n;if(e.type===2)n=document.createTextNode(e.content||"");else if(e.type===3)n=document.createElement("b");else if(e.type===4)n=document.createElement("i");else if(e.type===7&&i)n=document.createElement("code");else if(e.type===5&&t){const r=document.createElement("a");t.disposables.add(Hn(r,"click",o=>{t.callback(String(e.index),o)})),n=r}else e.type===8?n=document.createElement("br"):e.type===1&&(n=s);n&&s!==n&&s.appendChild(n),n&&Array.isArray(e.children)&&e.children.forEach(r=>{PCe(n,r,t,i)})}function u9e(s,e){const t={type:1,children:[]};let i=0,n=t;const r=[],o=new d9e(s);for(;!o.eos();){let a=o.next();const l=a==="\\"&&kK(o.peek(),e)!==0;if(l&&(a=o.next()),!l&&h9e(a,e)&&a===o.peek()){o.advance(),n.type===2&&(n=r.pop());const d=kK(a,e);if(n.type===d||n.type===5&&d===6)n=r.pop();else{const h={type:d,children:[]};d===5&&(h.index=i,i++),n.children.push(h),r.push(n),n=h}}else if(a===`
|
|
229
229
|
`)n.type===2&&(n=r.pop()),n.children.push({type:8});else if(n.type!==2){const d={type:2,content:a};n.children.push(d),r.push(n),n=d}else n.content+=a}return n.type===2&&(n=r.pop()),t}function h9e(s,e){return kK(s,e)!==0}function kK(s,e){switch(s){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return e?7:0;default:return 0}}const f9e=new RegExp(`(\\\\)?\\$\\((${bt.iconNameExpression}(?:${bt.iconModifierExpression})?)\\)`,"g");function Dm(s){const e=new Array;let t,i=0,n=0;for(;(t=f9e.exec(s))!==null;){n=t.index||0,i<n&&e.push(s.substring(i,n)),i=(t.index||0)+t[0].length;const[,r,o]=t;e.push(r?`$(${o})`:JC({id:o}))}return i<s.length&&e.push(s.substring(i)),e}function JC(s){const e=Fe("span");return e.classList.add(...bt.asClassNameArray(s)),e}function g9e(s){const e=p9e(s);if(e&&e.length>0)return new Uint32Array(e)}let Ml=0;const Gp=new Uint32Array(10);function p9e(s){if(Ml=0,ah(s,cz,4352),Ml>0||(ah(s,dz,4449),Ml>0)||(ah(s,uz,4520),Ml>0)||(ah(s,Lv,12593),Ml))return Gp.subarray(0,Ml);if(s>=44032&&s<=55203){const e=s-44032,t=e%588,i=Math.floor(e/588),n=Math.floor(t/28),r=t%28-1;if(i<cz.length?ah(i,cz,0):4352+i-12593<Lv.length&&ah(4352+i,Lv,12593),n<dz.length?ah(n,dz,0):4449+n-12593<Lv.length&&ah(4449+n-12593,Lv,12593),r>=0&&(r<uz.length?ah(r,uz,0):4520+r-12593<Lv.length&&ah(4520+r-12593,Lv,12593)),Ml>0)return Gp.subarray(0,Ml)}}function ah(s,e,t){s>=t&&s<t+e.length&&m9e(e[s-t])}function m9e(s){s!==0&&(Gp[Ml++]=s&255,s>>8&&(Gp[Ml++]=s>>8&255),s>>16&&(Gp[Ml++]=s>>16&255))}const cz=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),dz=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),uz=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]),Lv=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 lte(...s){return function(e,t){for(let i=0,n=s.length;i<n;i++){const r=s[i](e,t);if(r)return r}return null}}OCe.bind(void 0,!1);const WI=OCe.bind(void 0,!0);function OCe(s,e,t){if(!t||t.length<e.length)return null;let i;return s?i=vee(t,e):i=t.indexOf(e)===0,i?e.length>0?[{start:0,end:e.length}]:[]:null}function ACe(s,e){const t=e.toLowerCase().indexOf(s.toLowerCase());return t===-1?null:[{start:t,end:t+s.length}]}function FCe(s,e){return LK(s.toLowerCase(),e.toLowerCase(),0,0)}function LK(s,e,t,i){if(t===s.length)return[];if(i===e.length)return null;if(s[t]===e[i]){let n=null;return(n=LK(s,e,t+1,i+1))?ute({start:i,end:i+1},n):null}return LK(s,e,t,i+1)}function cte(s){return 97<=s&&s<=122}function qH(s){return 65<=s&&s<=90}function dte(s){return 48<=s&&s<=57}function BCe(s){return s===32||s===9||s===10||s===13}const WCe=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(s=>WCe.add(s.charCodeAt(0)));function H4(s){return BCe(s)||WCe.has(s)}function jde(s,e){return s===e||H4(s)&&H4(e)}const hz=new Map;function Ude(s){if(hz.has(s))return hz.get(s);let e;const t=g9e(s);return t&&(e=t),hz.set(s,e),e}function HCe(s){return cte(s)||qH(s)||dte(s)}function ute(s,e){return e.length===0?e=[s]:s.end===e[0].start?e[0].start=s.start:e.unshift(s),e}function VCe(s,e){for(let t=e;t<s.length;t++){const i=s.charCodeAt(t);if(qH(i)||dte(i)||t>0&&!HCe(s.charCodeAt(t-1)))return t}return s.length}function DK(s,e,t,i){if(t===s.length)return[];if(i===e.length)return null;if(s[t]!==e[i].toLowerCase())return null;{let n=null,r=i+1;for(n=DK(s,e,t+1,i+1);!n&&(r=VCe(e,r))<e.length;)n=DK(s,e,t+1,r),r++;return n===null?null:ute({start:i,end:i+1},n)}}function _9e(s){let e=0,t=0,i=0,n=0,r=0;for(let h=0;h<s.length;h++)r=s.charCodeAt(h),qH(r)&&e++,cte(r)&&t++,HCe(r)&&i++,dte(r)&&n++;const o=e/s.length,a=t/s.length,l=i/s.length,d=n/s.length;return{upperPercent:o,lowerPercent:a,alphaPercent:l,numericPercent:d}}function v9e(s){const{upperPercent:e,lowerPercent:t}=s;return t===0&&e>.6}function b9e(s){const{upperPercent:e,lowerPercent:t,alphaPercent:i,numericPercent:n}=s;return t>.2&&e<.8&&i>.6&&n<.2}function C9e(s){let e=0,t=0,i=0,n=0;for(let r=0;r<s.length;r++)i=s.charCodeAt(r),qH(i)&&e++,cte(i)&&t++,BCe(i)&&n++;return(e===0||t===0)&&n===0?s.length<=30:e<=5}function $Ce(s,e){if(!e||(e=e.trim(),e.length===0)||!C9e(s))return null;e.length>60&&(e=e.substring(0,60));const t=_9e(e);if(!b9e(t)){if(!v9e(t))return null;e=e.toLowerCase()}let i=null,n=0;for(s=s.toLowerCase();n<e.length&&(i=DK(s,e,0,n))===null;)n=VCe(e,n+1);return i}function y9e(s,e,t=!1){if(!e||e.length===0)return null;let i=null,n=0;for(s=s.toLowerCase(),e=e.toLowerCase();n<e.length&&(i=EK(s,e,0,n,t),i===null);)n=zCe(e,n+1);return i}function EK(s,e,t,i,n){let r=0;if(t===s.length)return[];if(i===e.length)return null;if(!jde(s.charCodeAt(t),e.charCodeAt(i))){const l=Ude(s.charCodeAt(t));if(!l)return null;for(let d=0;d<l.length;d++)if(!jde(l[d],e.charCodeAt(i+d)))return null;r+=l.length-1}let o=null,a=i+r+1;if(o=EK(s,e,t+1,a,n),!n)for(;!o&&(a=zCe(e,a))<e.length;)o=EK(s,e,t+1,a,n),a++;if(!o)return null;if(s.charCodeAt(t)!==e.charCodeAt(i)){const l=Ude(s.charCodeAt(t));if(!l)return o;for(let d=0;d<l.length;d++)if(l[d]!==e.charCodeAt(i+d))return o}return ute({start:i,end:i+r+1},o)}function zCe(s,e){for(let t=e;t<s.length;t++)if(H4(s.charCodeAt(t))||t>0&&H4(s.charCodeAt(t-1)))return t;return s.length}const w9e=lte(WI,$Ce,ACe),S9e=lte(WI,$Ce,FCe),qde=new lf(1e4);function Kde(s,e,t=!1){if(typeof s!="string"||typeof e!="string")return null;let i=qde.get(s);i||(i=new RegExp(d5e(s),"i"),qde.set(s,i));const n=i.exec(e);return n?[{start:n.index,end:n.index+n[0].length}]:t?S9e(s,e):w9e(s,e)}function x9e(s,e){const t=ey(s,s.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return t?vN(t):null}function k9e(s,e,t,i,n,r){const o=Math.min(13,s.length);for(;t<o;t++){const a=ey(s,e,t,i,n,r,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(a)return a}return[0,r]}function vN(s){if(typeof s>"u")return[];const e=[],t=s[1];for(let i=s.length-1;i>1;i--){const n=s[i]+t,r=e[e.length-1];r&&r.end===n?r.end=n+1:e.push({start:n,end:n+1})}return e}const cm=128;function hte(){const s=[],e=[];for(let t=0;t<=cm;t++)e[t]=0;for(let t=0;t<=cm;t++)s.push(e.slice(0));return s}function jCe(s){const e=[];for(let t=0;t<=s;t++)e[t]=0;return e}const UCe=jCe(2*cm),IK=jCe(2*cm),Nf=hte(),Dv=hte(),NA=hte();function MA(s,e){if(e<0||e>=s.length)return!1;const t=s.codePointAt(e);switch(t){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:return!!wee(t)}}function Gde(s,e){if(e<0||e>=s.length)return!1;switch(s.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}function eF(s,e,t){return e[s]!==t[s]}function L9e(s,e,t,i,n,r,o=!1){for(;e<t&&n<r;)s[e]===i[n]&&(o&&(UCe[e]=n),e+=1),n+=1;return e===t}var Tu;(function(s){s.Default=[-100,0];function e(t){return!t||t.length===2&&t[0]===-100&&t[1]===0}s.isDefault=e})(Tu||(Tu={}));const jne=class jne{constructor(e,t){this.firstMatchCanBeWeak=e,this.boostFullMatch=t}};jne.default={boostFullMatch:!0,firstMatchCanBeWeak:!1};let HI=jne;function ey(s,e,t,i,n,r,o=HI.default){const a=s.length>cm?cm:s.length,l=i.length>cm?cm:i.length;if(t>=a||r>=l||a-t>l-r||!L9e(e,t,a,n,r,l,!0))return;D9e(a,l,t,r,e,n);let d=1,h=1,f=t,p=r;const m=[!1];for(d=1,f=t;f<a;d++,f++){const D=UCe[f],S=IK[f],E=f+1<a?IK[f+1]:l;for(h=D-r+1,p=D;p<E;h++,p++){let I=Number.MIN_SAFE_INTEGER,R=!1;p<=S&&(I=E9e(s,e,f,t,i,n,p,l,r,Nf[d-1][h-1]===0,m));let M=0;I!==Number.MAX_SAFE_INTEGER&&(R=!0,M=I+Dv[d-1][h-1]);const O=p>D,H=O?Dv[d][h-1]+(Nf[d][h-1]>0?-5:0):0,te=p>D+1&&Nf[d][h-1]>0,J=te?Dv[d][h-2]+(Nf[d][h-2]>0?-5:0):0;if(te&&(!O||J>=H)&&(!R||J>=M))Dv[d][h]=J,NA[d][h]=3,Nf[d][h]=0;else if(O&&(!R||H>=M))Dv[d][h]=H,NA[d][h]=2,Nf[d][h]=0;else if(R)Dv[d][h]=M,NA[d][h]=1,Nf[d][h]=Nf[d-1][h-1]+1;else throw new Error("not possible")}}if(!m[0]&&!o.firstMatchCanBeWeak)return;d--,h--;const v=[Dv[d][h],r];let b=0,y=0;for(;d>=1;){let D=h;do{const S=NA[d][D];if(S===3)D=D-2;else if(S===2)D=D-1;else break}while(D>=1);b>1&&e[t+d-1]===n[r+h-1]&&!eF(D+r-1,i,n)&&b+1>Nf[d][D]&&(D=h),D===h?b++:b=1,y||(y=D),d--,h=D-1,v.push(h)}l-r===a&&o.boostFullMatch&&(v[0]+=2);const x=y-a;return v[0]-=x,v}function D9e(s,e,t,i,n,r){let o=s-1,a=e-1;for(;o>=t&&a>=i;)n[o]===r[a]&&(IK[o]=a,o--),a--}function E9e(s,e,t,i,n,r,o,a,l,d,h){if(e[t]!==r[o])return Number.MIN_SAFE_INTEGER;let f=1,p=!1;return o===t-i?f=s[t]===n[o]?7:5:eF(o,n,r)&&(o===0||!eF(o-1,n,r))?(f=s[t]===n[o]?7:5,p=!0):MA(r,o)&&(o===0||!MA(r,o-1))?f=5:(MA(r,o-1)||Gde(r,o-1))&&(f=5,p=!0),f>1&&t===i&&(h[0]=!0),p||(p=eF(o,n,r)||MA(r,o-1)||Gde(r,o-1)),t===i?o>l&&(f-=p?3:5):d?f+=p?2:0:f+=p?0:1,o+1===a&&(f-=p?3:5),f}function I9e(s,e,t,i,n,r,o){return T9e(s,e,t,i,n,r,!0,o)}function T9e(s,e,t,i,n,r,o,a){let l=ey(s,e,t,i,n,r,a);if(s.length>=3){const d=Math.min(7,s.length-1);for(let h=t+1;h<d;h++){const f=N9e(s,h);if(f){const p=ey(f,f.toLowerCase(),t,i,n,r,a);p&&(p[0]-=3,(!l||p[0]>l[0])&&(l=p))}}}return l}function N9e(s,e){if(e+1>=s.length)return;const t=s[e],i=s[e+1];if(t!==i)return s.slice(0,e)+i+t+s.slice(e+2)}const M9e="$(",fte=new RegExp(`\\$\\(${bt.iconNameExpression}(?:${bt.iconModifierExpression})?\\)`,"g"),R9e=new RegExp(`(\\\\)?${fte.source}`,"g");function P9e(s){return s.replace(R9e,(e,t)=>t?e:`\\${e}`)}const O9e=new RegExp(`\\\\${fte.source}`,"g");function A9e(s){return s.replace(O9e,e=>`\\${e}`)}const F9e=new RegExp(`(\\s)?(\\\\)?${fte.source}(\\s)?`,"g");function gte(s){return s.indexOf(M9e)===-1?s:s.replace(F9e,(e,t,i,n)=>i?e:t||n||"")}function B9e(s){return s?s.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}const fz=new RegExp(`\\$\\(${bt.iconNameCharacter}+\\)`,"g");function PD(s){fz.lastIndex=0;let e="";const t=[];let i=0;for(;;){const n=fz.lastIndex,r=fz.exec(s),o=s.substring(n,r==null?void 0:r.index);if(o.length>0){e+=o;for(let a=0;a<o.length;a++)t.push(i)}if(!r)break;i+=r[0].length}return{text:e,iconOffsets:t}}function gz(s,e,t=!1){const{text:i,iconOffsets:n}=e;if(!n||n.length===0)return Kde(s,i,t);const r=lN(i," "),o=i.length-r.length,a=Kde(s,r,t);if(a)for(const l of a){const d=n[l.start+o]+o;l.start+=d,l.end+=d}return a}function _h(s){return c4(s,!0)}class W9e{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:yI(this.getComparisonKey(e,i),this.getComparisonKey(t,i))}isEqual(e,t,i=!1){return e===t?!0:!e||!t?!1:this.getComparisonKey(e,i)===this.getComparisonKey(t,i)}getComparisonKey(e,t=!1){return e.with({path:this._ignorePathCasing(e)?e.path.toLowerCase():void 0,fragment:t?null:void 0}).toString()}isEqualOrParent(e,t,i=!1){if(e.scheme===t.scheme){if(e.scheme===Mt.file)return mK(_h(e),_h(t),this._ignorePathCasing(e))&&e.query===t.query&&(i||e.fragment===t.fragment);if(Zde(e.authority,t.authority))return mK(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(i||e.fragment===t.fragment)}return!1}joinPath(e,...t){return gt.joinPath(e,...t)}basenameOrAuthority(e){return Wc(e)||e.authority}basename(e){return bs.basename(e.path)}extname(e){return bs.extname(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===Mt.file?t=gt.file(kve(_h(e))).path:(t=bs.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===Mt.file?t=gt.file(xve(_h(e))).path:t=bs.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!Zde(e.authority,t.authority))return;if(e.scheme===Mt.file){const r=V4e(_h(e),_h(t));return Ur?sCe(r):r}let i=e.path||"/";const n=t.path||"/";if(this._ignorePathCasing(e)){let r=0;for(const o=Math.min(i.length,n.length);r<o&&!(i.charCodeAt(r)!==n.charCodeAt(r)&&i.charAt(r).toLowerCase()!==n.charAt(r).toLowerCase());r++);i=n.substr(0,r)+i.substr(r)}return bs.relative(i,n)}resolvePath(e,t){if(e.scheme===Mt.file){const i=gt.file(H4e(_h(e),t));return e.with({authority:i.authority,path:i.path})}return t=$He(t),e.with({path:bs.resolve(e.path,t)})}isAbsolutePath(e){return!!e.path&&e.path[0]==="/"}isEqualAuthority(e,t){return e===t||e!==void 0&&t!==void 0&&J1(e,t)}hasTrailingPathSeparator(e,t=ku){if(e.scheme===Mt.file){const i=_h(e);return i.length>wde(i).length&&i[i.length-1]===t}else{const i=e.path;return i.length>1&&i.charCodeAt(i.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=ku){return Xde(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=ku){let i=!1;if(e.scheme===Mt.file){const n=_h(e);i=n!==void 0&&n.length===wde(n).length&&n[n.length-1]===t}else{t="/";const n=e.path;i=n.length===1&&n.charCodeAt(n.length-1)===47}return!i&&!Xde(e,t)?e.with({path:e.path+"/"}):e}}const wn=new W9e(()=>!1),VI=wn.isEqual.bind(wn);wn.isEqualOrParent.bind(wn);wn.getComparisonKey.bind(wn);const H9e=wn.basenameOrAuthority.bind(wn),Wc=wn.basename.bind(wn),V9e=wn.extname.bind(wn),KH=wn.dirname.bind(wn),$9e=wn.joinPath.bind(wn),z9e=wn.normalizePath.bind(wn),j9e=wn.relativePath.bind(wn),Yde=wn.resolvePath.bind(wn);wn.isAbsolutePath.bind(wn);const Zde=wn.isEqualAuthority.bind(wn),Xde=wn.hasTrailingPathSeparator.bind(wn);wn.removeTrailingPathSeparator.bind(wn);wn.addTrailingPathSeparator.bind(wn);var c_;(function(s){s.META_DATA_LABEL="label",s.META_DATA_DESCRIPTION="description",s.META_DATA_SIZE="size",s.META_DATA_MIME="mime";function e(t){const i=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach(o=>{const[a,l]=o.split(":");a&&l&&i.set(a,l)});const r=t.path.substring(0,t.path.indexOf(";"));return r&&i.set(s.META_DATA_MIME,r),i}s.parseMetaData=e})(c_||(c_={}));class eo{constructor(e="",t=!1){if(this.value=e,typeof this.value!="string")throw Nc("value");typeof t=="boolean"?(this.isTrusted=t,this.supportThemeIcons=!1,this.supportHtml=!1):(this.isTrusted=t.isTrusted??void 0,this.supportThemeIcons=t.supportThemeIcons??!1,this.supportHtml=t.supportHtml??!1)}appendText(e,t=0){return this.value+=q9e(this.supportThemeIcons?P9e(e):e).replace(/([ \t]+)/g,(i,n)=>" ".repeat(n.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===1?`\\
|
|
230
230
|
`:`
|
|
231
231
|
|
|
@@ -861,27 +861,27 @@ ${e.toString()}`}}class L5{constructor(e=new Vx,t=!1,i,n=mKe){this._services=e,t
|
|
|
861
861
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
862
862
|
* Released under the MIT license
|
|
863
863
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
864
|
-
*-----------------------------------------------------------------------------*/var yet=Object.defineProperty,wet=Object.getOwnPropertyDescriptor,xet=Object.getOwnPropertyNames,ket=Object.prototype.hasOwnProperty,Let=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of xet(e))!ket.call(s,n)&&n!==t&&yet(s,n,{get:()=>e[n],enumerable:!(i=wet(e,n))||i.enumerable});return s},Det=(s,e,t)=>(Let(s,e,"default"),t),VD={};Det(VD,ON);var B1e={},tj={},Eet=class W1e{static getOrCreate(e){return tj[e]||(tj[e]=new W1e(e)),tj[e]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((t,i)=>{this._lazyLoadPromiseResolve=t,this._lazyLoadPromiseReject=i})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,B1e[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}};function _t(s){const e=s.id;B1e[e]=s,VD.languages.register(s);const t=Eet.getOrCreate(e);VD.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),VD.languages.onLanguageEncountered(e,async()=>{const i=await t.load();VD.languages.setLanguageConfiguration(e,i.conf)})}_t({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>at(()=>import("./abap-BrgZPUOV.js"),[])});_t({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>at(()=>import("./apex-DyP6w7ZV.js"),[])});_t({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>at(()=>import("./azcli-BaLxmfj-.js"),[])});_t({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>at(()=>import("./bat-CFOPXBzS.js"),[])});_t({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>at(()=>import("./bicep-BfEKNvv3.js"),[])});_t({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>at(()=>import("./cameligo-BFG1Mk7z.js"),[])});_t({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>at(()=>import("./clojure-DTECt2xU.js"),[])});_t({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>at(()=>import("./coffee-CDGzqUPQ.js"),[])});_t({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>at(()=>import("./cpp-CLLBncYj.js"),[])});_t({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>at(()=>import("./cpp-CLLBncYj.js"),[])});_t({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>at(()=>import("./csharp-dUCx_-0o.js"),[])});_t({id:"csp",extensions:[".csp"],aliases:["CSP","csp"],loader:()=>at(()=>import("./csp-5Rap-vPy.js"),[])});_t({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>at(()=>import("./css-D3h14YRZ.js"),[])});_t({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>at(()=>import("./cypher-DrQuvNYM.js"),[])});_t({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>at(()=>import("./dart-CFKIUWau.js"),[])});_t({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>at(()=>import("./dockerfile-Zznr-cwX.js"),[])});_t({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>at(()=>import("./ecl-Ce3n6wWz.js"),[])});_t({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>at(()=>import("./elixir-deUWdS0T.js"),[])});_t({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>at(()=>import("./flow9-i9-g7ZhI.js"),[])});_t({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>at(()=>import("./fsharp-CzKuDChf.js"),[])});_t({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>at(()=>import("./freemarker2-WCA_pR0J.js"),[]).then(s=>s.TagAutoInterpolationDollar)});_t({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>at(()=>import("./freemarker2-WCA_pR0J.js"),[]).then(s=>s.TagAngleInterpolationDollar)});_t({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>at(()=>import("./freemarker2-WCA_pR0J.js"),[]).then(s=>s.TagBracketInterpolationDollar)});_t({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>at(()=>import("./freemarker2-WCA_pR0J.js"),[]).then(s=>s.TagAngleInterpolationBracket)});_t({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>at(()=>import("./freemarker2-WCA_pR0J.js"),[]).then(s=>s.TagBracketInterpolationBracket)});_t({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>at(()=>import("./freemarker2-WCA_pR0J.js"),[]).then(s=>s.TagAutoInterpolationDollar)});_t({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>at(()=>import("./freemarker2-WCA_pR0J.js"),[]).then(s=>s.TagAutoInterpolationBracket)});_t({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>at(()=>import("./go-Cphgjts3.js"),[])});_t({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>at(()=>import("./graphql-Cg7bfA9N.js"),[])});_t({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>at(()=>import("./handlebars-fzVGzXHj.js"),[])});_t({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>at(()=>import("./hcl-0cvrggvQ.js"),[])});_t({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:()=>at(()=>import("./html-C4Rga6DD.js"),[])});_t({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>at(()=>import("./ini-Drc7WvVn.js"),[])});_t({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>at(()=>import("./java-B_fMsGYe.js"),[])});_t({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>at(()=>import("./javascript-cXKyuP98.js"),__vite__mapDeps([0,1]))});_t({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>at(()=>import("./julia-Bqgm2twL.js"),[])});_t({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>at(()=>import("./kotlin-BSkB5QuD.js"),[])});_t({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>at(()=>import("./less-BsTHnhdd.js"),[])});_t({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>at(()=>import("./lexon-YWi4-JPR.js"),[])});_t({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>at(()=>import("./lua-nf6ki56Z.js"),[])});_t({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>at(()=>import("./liquid-CrbU0gmK.js"),[])});_t({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>at(()=>import("./m3-Cpb6xl2v.js"),[])});_t({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>at(()=>import("./markdown-DSZPf7rp.js"),[])});_t({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>at(()=>import("./mdx-D72Dcs66.js"),[])});_t({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>at(()=>import("./mips-B_c3zf-v.js"),[])});_t({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>at(()=>import("./msdax-rUNN04Wq.js"),[])});_t({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>at(()=>import("./mysql-DDwshQtU.js"),[])});_t({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>at(()=>import("./objective-c-B5zXfXm9.js"),[])});_t({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>at(()=>import("./pascal-CXOwvkN_.js"),[])});_t({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>at(()=>import("./pascaligo-Bc-ZgV77.js"),[])});_t({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>at(()=>import("./perl-CwNk8-XU.js"),[])});_t({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>at(()=>import("./pgsql-tGk8EFnU.js"),[])});_t({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>at(()=>import("./php-CpIb_Oan.js"),[])});_t({id:"pla",extensions:[".pla"],loader:()=>at(()=>import("./pla-B03wrqEc.js"),[])});_t({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>at(()=>import("./postiats-BKlk5iyT.js"),[])});_t({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>at(()=>import("./powerquery-Bhzvs7bI.js"),[])});_t({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>at(()=>import("./powershell-Dd3NCNK9.js"),[])});_t({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>at(()=>import("./protobuf-COyEY5Pt.js"),[])});_t({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>at(()=>import("./pug-BaJupSGV.js"),[])});_t({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>at(()=>import("./python-DPqkZ_Xm.js"),[])});_t({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>at(()=>import("./qsharp-DXyYeYxl.js"),[])});_t({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>at(()=>import("./r-CdQndTaG.js"),[])});_t({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>at(()=>import("./razor-DknXaqXN.js"),[])});_t({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>at(()=>import("./redis-CVwtpugi.js"),[])});_t({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>at(()=>import("./redshift-25W9uPmb.js"),[])});_t({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>at(()=>import("./restructuredtext-DfzH4Xui.js"),[])});_t({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>at(()=>import("./ruby-Cp1zYvxS.js"),[])});_t({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>at(()=>import("./rust-D5C2fndG.js"),[])});_t({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>at(()=>import("./sb-CDntyWJ8.js"),[])});_t({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:()=>at(()=>import("./scala-BoFRg7Ot.js"),[])});_t({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>at(()=>import("./scheme-Bio4gycK.js"),[])});_t({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>at(()=>import("./scss-4Ik7cdeQ.js"),[])});_t({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>at(()=>import("./shell-CX-rkNHf.js"),[])});_t({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>at(()=>import("./solidity-Tw7wswEv.js"),[])});_t({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>at(()=>import("./sophia-C5WLch3f.js"),[])});_t({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>at(()=>import("./sparql-DHaeiCBh.js"),[])});_t({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>at(()=>import("./sql-CCSDG5nI.js"),[])});_t({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>at(()=>import("./st-pnP8ivHi.js"),[])});_t({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>at(()=>import("./swift-DwJ7jVG9.js"),[])});_t({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>at(()=>import("./systemverilog-B9Xyijhd.js"),[])});_t({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>at(()=>import("./systemverilog-B9Xyijhd.js"),[])});_t({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>at(()=>import("./tcl-DnHyzjbg.js"),[])});_t({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>at(()=>import("./twig-CPajHgWi.js"),[])});_t({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>at(()=>import("./typescript-DenKTmW3.js"),[])});_t({id:"typespec",extensions:[".tsp"],aliases:["TypeSpec"],loader:()=>at(()=>import("./typespec-D-MeaMDU.js"),[])});_t({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>at(()=>import("./vb-DgyLZaXg.js"),[])});_t({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>at(()=>import("./wgsl-BIv9DU6q.js"),[])});_t({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)",aliases:["XML","xml"],mimetypes:["text/xml","application/xml","application/xaml+xml","application/xml-dtd"],loader:()=>at(()=>import("./xml-C_uqJta0.js"),[])});_t({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>at(()=>import("./yaml-vwb3U7d7.js"),[])});/*!-----------------------------------------------------------------------------
|
|
864
|
+
*-----------------------------------------------------------------------------*/var yet=Object.defineProperty,wet=Object.getOwnPropertyDescriptor,xet=Object.getOwnPropertyNames,ket=Object.prototype.hasOwnProperty,Let=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of xet(e))!ket.call(s,n)&&n!==t&&yet(s,n,{get:()=>e[n],enumerable:!(i=wet(e,n))||i.enumerable});return s},Det=(s,e,t)=>(Let(s,e,"default"),t),VD={};Det(VD,ON);var B1e={},tj={},Eet=class W1e{static getOrCreate(e){return tj[e]||(tj[e]=new W1e(e)),tj[e]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((t,i)=>{this._lazyLoadPromiseResolve=t,this._lazyLoadPromiseReject=i})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,B1e[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}};function _t(s){const e=s.id;B1e[e]=s,VD.languages.register(s);const t=Eet.getOrCreate(e);VD.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),VD.languages.onLanguageEncountered(e,async()=>{const i=await t.load();VD.languages.setLanguageConfiguration(e,i.conf)})}_t({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>at(()=>import("./abap-BrgZPUOV.js"),[])});_t({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>at(()=>import("./apex-DyP6w7ZV.js"),[])});_t({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>at(()=>import("./azcli-BaLxmfj-.js"),[])});_t({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>at(()=>import("./bat-CFOPXBzS.js"),[])});_t({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>at(()=>import("./bicep-BfEKNvv3.js"),[])});_t({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>at(()=>import("./cameligo-BFG1Mk7z.js"),[])});_t({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>at(()=>import("./clojure-DTECt2xU.js"),[])});_t({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>at(()=>import("./coffee-CDGzqUPQ.js"),[])});_t({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>at(()=>import("./cpp-CLLBncYj.js"),[])});_t({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>at(()=>import("./cpp-CLLBncYj.js"),[])});_t({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>at(()=>import("./csharp-dUCx_-0o.js"),[])});_t({id:"csp",extensions:[".csp"],aliases:["CSP","csp"],loader:()=>at(()=>import("./csp-5Rap-vPy.js"),[])});_t({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>at(()=>import("./css-D3h14YRZ.js"),[])});_t({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>at(()=>import("./cypher-DrQuvNYM.js"),[])});_t({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>at(()=>import("./dart-CFKIUWau.js"),[])});_t({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>at(()=>import("./dockerfile-Zznr-cwX.js"),[])});_t({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>at(()=>import("./ecl-Ce3n6wWz.js"),[])});_t({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>at(()=>import("./elixir-deUWdS0T.js"),[])});_t({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>at(()=>import("./flow9-i9-g7ZhI.js"),[])});_t({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>at(()=>import("./fsharp-CzKuDChf.js"),[])});_t({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>at(()=>import("./freemarker2-GCZND4I7.js"),[]).then(s=>s.TagAutoInterpolationDollar)});_t({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>at(()=>import("./freemarker2-GCZND4I7.js"),[]).then(s=>s.TagAngleInterpolationDollar)});_t({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>at(()=>import("./freemarker2-GCZND4I7.js"),[]).then(s=>s.TagBracketInterpolationDollar)});_t({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>at(()=>import("./freemarker2-GCZND4I7.js"),[]).then(s=>s.TagAngleInterpolationBracket)});_t({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>at(()=>import("./freemarker2-GCZND4I7.js"),[]).then(s=>s.TagBracketInterpolationBracket)});_t({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>at(()=>import("./freemarker2-GCZND4I7.js"),[]).then(s=>s.TagAutoInterpolationDollar)});_t({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>at(()=>import("./freemarker2-GCZND4I7.js"),[]).then(s=>s.TagAutoInterpolationBracket)});_t({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>at(()=>import("./go-Cphgjts3.js"),[])});_t({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>at(()=>import("./graphql-Cg7bfA9N.js"),[])});_t({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>at(()=>import("./handlebars-IPke9hyC.js"),[])});_t({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>at(()=>import("./hcl-0cvrggvQ.js"),[])});_t({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:()=>at(()=>import("./html-Dl_nDKmC.js"),[])});_t({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>at(()=>import("./ini-Drc7WvVn.js"),[])});_t({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>at(()=>import("./java-B_fMsGYe.js"),[])});_t({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>at(()=>import("./javascript-DHT2J-uS.js"),__vite__mapDeps([0,1]))});_t({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>at(()=>import("./julia-Bqgm2twL.js"),[])});_t({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>at(()=>import("./kotlin-BSkB5QuD.js"),[])});_t({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>at(()=>import("./less-BsTHnhdd.js"),[])});_t({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>at(()=>import("./lexon-YWi4-JPR.js"),[])});_t({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>at(()=>import("./lua-nf6ki56Z.js"),[])});_t({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>at(()=>import("./liquid-C5FLdOvv.js"),[])});_t({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>at(()=>import("./m3-Cpb6xl2v.js"),[])});_t({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>at(()=>import("./markdown-DSZPf7rp.js"),[])});_t({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>at(()=>import("./mdx-CZwiqZoo.js"),[])});_t({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>at(()=>import("./mips-B_c3zf-v.js"),[])});_t({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>at(()=>import("./msdax-rUNN04Wq.js"),[])});_t({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>at(()=>import("./mysql-DDwshQtU.js"),[])});_t({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>at(()=>import("./objective-c-B5zXfXm9.js"),[])});_t({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>at(()=>import("./pascal-CXOwvkN_.js"),[])});_t({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>at(()=>import("./pascaligo-Bc-ZgV77.js"),[])});_t({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>at(()=>import("./perl-CwNk8-XU.js"),[])});_t({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>at(()=>import("./pgsql-tGk8EFnU.js"),[])});_t({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>at(()=>import("./php-CpIb_Oan.js"),[])});_t({id:"pla",extensions:[".pla"],loader:()=>at(()=>import("./pla-B03wrqEc.js"),[])});_t({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>at(()=>import("./postiats-BKlk5iyT.js"),[])});_t({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>at(()=>import("./powerquery-Bhzvs7bI.js"),[])});_t({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>at(()=>import("./powershell-Dd3NCNK9.js"),[])});_t({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>at(()=>import("./protobuf-COyEY5Pt.js"),[])});_t({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>at(()=>import("./pug-BaJupSGV.js"),[])});_t({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>at(()=>import("./python-D5pMpjh7.js"),[])});_t({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>at(()=>import("./qsharp-DXyYeYxl.js"),[])});_t({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>at(()=>import("./r-CdQndTaG.js"),[])});_t({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>at(()=>import("./razor-Ba49D4hB.js"),[])});_t({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>at(()=>import("./redis-CVwtpugi.js"),[])});_t({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>at(()=>import("./redshift-25W9uPmb.js"),[])});_t({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>at(()=>import("./restructuredtext-DfzH4Xui.js"),[])});_t({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>at(()=>import("./ruby-Cp1zYvxS.js"),[])});_t({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>at(()=>import("./rust-D5C2fndG.js"),[])});_t({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>at(()=>import("./sb-CDntyWJ8.js"),[])});_t({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:()=>at(()=>import("./scala-BoFRg7Ot.js"),[])});_t({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>at(()=>import("./scheme-Bio4gycK.js"),[])});_t({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>at(()=>import("./scss-4Ik7cdeQ.js"),[])});_t({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>at(()=>import("./shell-CX-rkNHf.js"),[])});_t({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>at(()=>import("./solidity-Tw7wswEv.js"),[])});_t({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>at(()=>import("./sophia-C5WLch3f.js"),[])});_t({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>at(()=>import("./sparql-DHaeiCBh.js"),[])});_t({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>at(()=>import("./sql-CCSDG5nI.js"),[])});_t({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>at(()=>import("./st-pnP8ivHi.js"),[])});_t({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>at(()=>import("./swift-DwJ7jVG9.js"),[])});_t({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>at(()=>import("./systemverilog-B9Xyijhd.js"),[])});_t({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>at(()=>import("./systemverilog-B9Xyijhd.js"),[])});_t({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>at(()=>import("./tcl-DnHyzjbg.js"),[])});_t({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>at(()=>import("./twig-CPajHgWi.js"),[])});_t({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>at(()=>import("./typescript-NOD0JyOl.js"),[])});_t({id:"typespec",extensions:[".tsp"],aliases:["TypeSpec"],loader:()=>at(()=>import("./typespec-D-MeaMDU.js"),[])});_t({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>at(()=>import("./vb-DgyLZaXg.js"),[])});_t({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>at(()=>import("./wgsl-BIv9DU6q.js"),[])});_t({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)",aliases:["XML","xml"],mimetypes:["text/xml","application/xml","application/xaml+xml","application/xml-dtd"],loader:()=>at(()=>import("./xml-CJKugy72.js"),[])});_t({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>at(()=>import("./yaml-CEjcQv6-.js"),[])});/*!-----------------------------------------------------------------------------
|
|
865
865
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
866
866
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
867
867
|
* Released under the MIT license
|
|
868
868
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
869
|
-
*-----------------------------------------------------------------------------*/var Iet=Object.defineProperty,Tet=Object.getOwnPropertyDescriptor,Net=Object.getOwnPropertyNames,Met=Object.prototype.hasOwnProperty,Ret=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Net(e))!Met.call(s,n)&&n!==t&&Iet(s,n,{get:()=>e[n],enumerable:!(i=Tet(e,n))||i.enumerable});return s},Pet=(s,e,t)=>(Ret(s,e,"default"),t),jx={};Pet(jx,ON);var qie=class{constructor(e,t,i){this._onDidChange=new jx.Emitter,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}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)}},Kie={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}},Gie={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},H1e=new qie("css",Kie,Gie),V1e=new qie("scss",Kie,Gie),$1e=new qie("less",Kie,Gie);jx.languages.css={cssDefaults:H1e,lessDefaults:$1e,scssDefaults:V1e};function Yie(){return at(()=>import("./cssMode-
|
|
869
|
+
*-----------------------------------------------------------------------------*/var Iet=Object.defineProperty,Tet=Object.getOwnPropertyDescriptor,Net=Object.getOwnPropertyNames,Met=Object.prototype.hasOwnProperty,Ret=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Net(e))!Met.call(s,n)&&n!==t&&Iet(s,n,{get:()=>e[n],enumerable:!(i=Tet(e,n))||i.enumerable});return s},Pet=(s,e,t)=>(Ret(s,e,"default"),t),jx={};Pet(jx,ON);var qie=class{constructor(e,t,i){this._onDidChange=new jx.Emitter,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}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)}},Kie={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}},Gie={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},H1e=new qie("css",Kie,Gie),V1e=new qie("scss",Kie,Gie),$1e=new qie("less",Kie,Gie);jx.languages.css={cssDefaults:H1e,lessDefaults:$1e,scssDefaults:V1e};function Yie(){return at(()=>import("./cssMode-CJFHsxhF.js"),[])}jx.languages.onLanguage("less",()=>{Yie().then(s=>s.setupMode($1e))});jx.languages.onLanguage("scss",()=>{Yie().then(s=>s.setupMode(V1e))});jx.languages.onLanguage("css",()=>{Yie().then(s=>s.setupMode(H1e))});/*!-----------------------------------------------------------------------------
|
|
870
870
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
871
871
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
872
872
|
* Released under the MIT license
|
|
873
873
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
874
|
-
*-----------------------------------------------------------------------------*/var Oet=Object.defineProperty,Aet=Object.getOwnPropertyDescriptor,Fet=Object.getOwnPropertyNames,Bet=Object.prototype.hasOwnProperty,Wet=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Fet(e))!Bet.call(s,n)&&n!==t&&Oet(s,n,{get:()=>e[n],enumerable:!(i=Aet(e,n))||i.enumerable});return s},Het=(s,e,t)=>(Wet(s,e,"default"),t),wV={};Het(wV,ON);var Vet=class{constructor(e,t,i){this._onDidChange=new wV.Emitter,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}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)}},$et={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"},SV={format:$et,suggest:{},data:{useDefaultDataProvider:!0}};function xV(s){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:s===EE,documentFormattingEdits:s===EE,documentRangeFormattingEdits:s===EE}}var EE="html",Nfe="handlebars",Mfe="razor",z1e=kV(EE,SV,xV(EE)),zet=z1e.defaults,j1e=kV(Nfe,SV,xV(Nfe)),jet=j1e.defaults,U1e=kV(Mfe,SV,xV(Mfe)),Uet=U1e.defaults;wV.languages.html={htmlDefaults:zet,razorDefaults:Uet,handlebarDefaults:jet,htmlLanguageService:z1e,handlebarLanguageService:j1e,razorLanguageService:U1e,registerHTMLLanguageService:kV};function qet(){return at(()=>import("./htmlMode-
|
|
874
|
+
*-----------------------------------------------------------------------------*/var Oet=Object.defineProperty,Aet=Object.getOwnPropertyDescriptor,Fet=Object.getOwnPropertyNames,Bet=Object.prototype.hasOwnProperty,Wet=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Fet(e))!Bet.call(s,n)&&n!==t&&Oet(s,n,{get:()=>e[n],enumerable:!(i=Aet(e,n))||i.enumerable});return s},Het=(s,e,t)=>(Wet(s,e,"default"),t),wV={};Het(wV,ON);var Vet=class{constructor(e,t,i){this._onDidChange=new wV.Emitter,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}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)}},$et={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"},SV={format:$et,suggest:{},data:{useDefaultDataProvider:!0}};function xV(s){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:s===EE,documentFormattingEdits:s===EE,documentRangeFormattingEdits:s===EE}}var EE="html",Nfe="handlebars",Mfe="razor",z1e=kV(EE,SV,xV(EE)),zet=z1e.defaults,j1e=kV(Nfe,SV,xV(Nfe)),jet=j1e.defaults,U1e=kV(Mfe,SV,xV(Mfe)),Uet=U1e.defaults;wV.languages.html={htmlDefaults:zet,razorDefaults:Uet,handlebarDefaults:jet,htmlLanguageService:z1e,handlebarLanguageService:j1e,razorLanguageService:U1e,registerHTMLLanguageService:kV};function qet(){return at(()=>import("./htmlMode-DpdrVNft.js"),[])}function kV(s,e=SV,t=xV(s)){const i=new Vet(s,e,t);let n;const r=wV.languages.onLanguage(s,async()=>{n=(await qet()).setupMode(i)});return{defaults:i,dispose(){r.dispose(),n==null||n.dispose(),n=void 0}}}/*!-----------------------------------------------------------------------------
|
|
875
875
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
876
876
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
877
877
|
* Released under the MIT license
|
|
878
878
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
879
|
-
*-----------------------------------------------------------------------------*/var Ket=Object.defineProperty,Get=Object.getOwnPropertyDescriptor,Yet=Object.getOwnPropertyNames,Zet=Object.prototype.hasOwnProperty,Xet=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Yet(e))!Zet.call(s,n)&&n!==t&&Ket(s,n,{get:()=>e[n],enumerable:!(i=Get(e,n))||i.enumerable});return s},Qet=(s,e,t)=>(Xet(s,e,"default"),t),AN={};Qet(AN,ON);var Jet=class{constructor(e,t,i){this._onDidChange=new AN.Emitter,this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(i)}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)}},ett={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},ttt={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},q1e=new Jet("json",ett,ttt),itt=()=>K1e().then(s=>s.getWorker());AN.languages.json={jsonDefaults:q1e,getWorker:itt};function K1e(){return at(()=>import("./jsonMode-
|
|
879
|
+
*-----------------------------------------------------------------------------*/var Ket=Object.defineProperty,Get=Object.getOwnPropertyDescriptor,Yet=Object.getOwnPropertyNames,Zet=Object.prototype.hasOwnProperty,Xet=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Yet(e))!Zet.call(s,n)&&n!==t&&Ket(s,n,{get:()=>e[n],enumerable:!(i=Get(e,n))||i.enumerable});return s},Qet=(s,e,t)=>(Xet(s,e,"default"),t),AN={};Qet(AN,ON);var Jet=class{constructor(e,t,i){this._onDidChange=new AN.Emitter,this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(i)}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)}},ett={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},ttt={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},q1e=new Jet("json",ett,ttt),itt=()=>K1e().then(s=>s.getWorker());AN.languages.json={jsonDefaults:q1e,getWorker:itt};function K1e(){return at(()=>import("./jsonMode-BeJp-o3r.js"),[])}AN.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});AN.languages.onLanguage("json",()=>{K1e().then(s=>s.setupMode(q1e))});/*!-----------------------------------------------------------------------------
|
|
880
880
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
881
881
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
882
882
|
* Released under the MIT license
|
|
883
883
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
884
|
-
*-----------------------------------------------------------------------------*/var ntt=Object.defineProperty,stt=Object.getOwnPropertyDescriptor,rtt=Object.getOwnPropertyNames,ott=Object.prototype.hasOwnProperty,att=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of rtt(e))!ott.call(s,n)&&n!==t&&ntt(s,n,{get:()=>e[n],enumerable:!(i=stt(e,n))||i.enumerable});return s},ltt=(s,e,t)=>(att(s,e,"default"),t),ctt="5.4.5",QS={};ltt(QS,ON);var G1e=(s=>(s[s.None=0]="None",s[s.CommonJS=1]="CommonJS",s[s.AMD=2]="AMD",s[s.UMD=3]="UMD",s[s.System=4]="System",s[s.ES2015=5]="ES2015",s[s.ESNext=99]="ESNext",s))(G1e||{}),Y1e=(s=>(s[s.None=0]="None",s[s.Preserve=1]="Preserve",s[s.React=2]="React",s[s.ReactNative=3]="ReactNative",s[s.ReactJSX=4]="ReactJSX",s[s.ReactJSXDev=5]="ReactJSXDev",s))(Y1e||{}),Z1e=(s=>(s[s.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",s[s.LineFeed=1]="LineFeed",s))(Z1e||{}),X1e=(s=>(s[s.ES3=0]="ES3",s[s.ES5=1]="ES5",s[s.ES2015=2]="ES2015",s[s.ES2016=3]="ES2016",s[s.ES2017=4]="ES2017",s[s.ES2018=5]="ES2018",s[s.ES2019=6]="ES2019",s[s.ES2020=7]="ES2020",s[s.ESNext=99]="ESNext",s[s.JSON=100]="JSON",s[s.Latest=99]="Latest",s))(X1e||{}),Q1e=(s=>(s[s.Classic=1]="Classic",s[s.NodeJs=2]="NodeJs",s))(Q1e||{}),J1e=class{constructor(s,e,t,i,n){this._onDidChange=new QS.Emitter,this._onDidExtraLibsChange=new QS.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(s),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(n),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(s,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===s)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:s,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let n=this._extraLibs[t];n&&n.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(s){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),s&&s.length>0)for(const e of s){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let n=1;this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:n}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(s){this._compilerOptions=s||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(s){this._diagnosticsOptions=s||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(s){this._workerOptions=s||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(s){this._inlayHintsOptions=s||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(s){}setEagerModelSync(s){this._eagerModelSync=s}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(s){this._modeConfiguration=s||Object.create(null),this._onDidChange.fire(void 0)}},dtt=ctt,e0e={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},t0e=new J1e({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},e0e),i0e=new J1e({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},e0e),utt=()=>LV().then(s=>s.getTypeScriptWorker()),htt=()=>LV().then(s=>s.getJavaScriptWorker());QS.languages.typescript={ModuleKind:G1e,JsxEmit:Y1e,NewLineKind:Z1e,ScriptTarget:X1e,ModuleResolutionKind:Q1e,typescriptVersion:dtt,typescriptDefaults:t0e,javascriptDefaults:i0e,getTypeScriptWorker:utt,getJavaScriptWorker:htt};function LV(){return at(()=>import("./tsMode-DZAV3Wgo.js"),[])}QS.languages.onLanguage("typescript",()=>LV().then(s=>s.setupTypeScript(t0e)));QS.languages.onLanguage("javascript",()=>LV().then(s=>s.setupJavaScript(i0e)));class ftt extends ea{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:kt("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:Oe.map,toggled:ve.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:ve.has("isInDiffEditor"),menu:{when:ve.has("isInDiffEditor"),id:st.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Gt),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class n0e extends ea{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:kt("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:ve.has("isInDiffEditor")})}run(e,...t){const i=e.get(Gt),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class s0e extends ea{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:kt("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:ve.has("isInDiffEditor")})}run(e,...t){const i=e.get(Gt),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const FN=kt("diffEditor","Diff Editor");class gtt extends ju{constructor(){super({id:"diffEditor.switchSide",title:kt("switchSide","Switch Side"),icon:Oe.arrowSwap,precondition:ve.has("isInDiffEditor"),f1:!0,category:FN})}runEditorCommand(e,t,i){const n=Ux(e);if(n instanceof Bg){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class ptt extends ju{constructor(){super({id:"diffEditor.exitCompareMove",title:kt("exitCompareMove","Exit Compare Move"),icon:Oe.close,precondition:U.comparingMovedCode,f1:!1,category:FN,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=Ux(e);n instanceof Bg&&n.exitCompareMove()}}class mtt extends ju{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:kt("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:Oe.fold,precondition:ve.has("isInDiffEditor"),f1:!0,category:FN})}runEditorCommand(e,t,...i){const n=Ux(e);n instanceof Bg&&n.collapseAllUnchangedRegions()}}class _tt extends ju{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:kt("showAllUnchangedRegions","Show All Unchanged Regions"),icon:Oe.unfold,precondition:ve.has("isInDiffEditor"),f1:!0,category:FN})}runEditorCommand(e,t,...i){const n=Ux(e);n instanceof Bg&&n.showAllUnchangedRegions()}}class rZ extends ea{constructor(){super({id:"diffEditor.revert",title:kt("revert","Revert"),f1:!1,category:FN})}run(e,t){const i=vtt(e,t.originalUri,t.modifiedUri);i instanceof Bg&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const r0e=kt("accessibleDiffViewer","Accessible Diff Viewer"),GB=class GB extends ea{constructor(){super({id:GB.id,title:kt("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:r0e,precondition:ve.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=Ux(e);t==null||t.accessibleDiffViewerNext()}};GB.id="editor.action.accessibleDiffViewer.next";let bT=GB;const YB=class YB extends ea{constructor(){super({id:YB.id,title:kt("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:r0e,precondition:ve.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=Ux(e);t==null||t.accessibleDiffViewerPrev()}};YB.id="editor.action.accessibleDiffViewer.prev";let t3=YB;function vtt(s,e,t){return s.get(yi).listDiffEditors().find(r=>{var l,d;const o=r.getModifiedEditor(),a=r.getOriginalEditor();return o&&((l=o.getModel())==null?void 0:l.uri.toString())===t.toString()&&a&&((d=a.getModel())==null?void 0:d.uri.toString())===e.toString()})||null}function Ux(s){const t=s.get(yi).listDiffEditors(),i=$r();if(i)for(const n of t){const r=n.getContainerDomNode();if(btt(r,i))return n}return null}function btt(s,e){let t=e;for(;t;){if(t===s)return!0;t=t.parentElement}return!1}sn(ftt);sn(n0e);sn(s0e);or.appendMenuItem(st.EditorTitle,{command:{id:new s0e().desc.id,title:w("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:ve.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:ve.has("isInDiffEditor")},order:11,group:"1_diff",when:ve.and(U.diffEditorRenderSideBySideInlineBreakpointReached,ve.has("isInDiffEditor"))});or.appendMenuItem(st.EditorTitle,{command:{id:new n0e().desc.id,title:w("showMoves","Show Moved Code Blocks"),icon:Oe.move,toggled:Dx.create("config.diffEditor.experimental.showMoves",!0),precondition:ve.has("isInDiffEditor")},order:10,group:"1_diff",when:ve.has("isInDiffEditor")});sn(rZ);for(const s of[{icon:Oe.arrowRight,key:U.diffEditorInlineMode.toNegated()},{icon:Oe.discard,key:U.diffEditorInlineMode}])or.appendMenuItem(st.DiffEditorHunkToolbar,{command:{id:new rZ().desc.id,title:w("revertHunk","Revert Block"),icon:s.icon},when:ve.and(U.diffEditorModifiedWritable,s.key),order:5,group:"primary"}),or.appendMenuItem(st.DiffEditorSelectionToolbar,{command:{id:new rZ().desc.id,title:w("revertSelection","Revert Selection"),icon:s.icon},when:ve.and(U.diffEditorModifiedWritable,s.key),order:5,group:"primary"});sn(gtt);sn(ptt);sn(mtt);sn(_tt);or.appendMenuItem(st.EditorTitle,{command:{id:bT.id,title:w("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:ve.has("isInDiffEditor")},order:10,group:"2_diff",when:ve.and(U.accessibleDiffViewerVisible.negate(),ve.has("isInDiffEditor"))});hi.registerCommandAlias("editor.action.diffReview.next",bT.id);sn(bT);hi.registerCommandAlias("editor.action.diffReview.prev",t3.id);sn(t3);var Ctt=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},ytt=function(s,e){return function(t,i){e(t,i,s)}},oZ;const DV=new qe("selectionAnchorSet",!1);var Qb;let m_=(Qb=class{static get(e){return e.getContribution(oZ.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=DV.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(ot.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new eo().appendText(w("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),Qo(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(ot.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()}},oZ=Qb,Qb.ID="editor.contrib.selectionAnchorController",Qb);m_=oZ=Ctt([ytt(1,yt)],m_);class wtt extends Ze{constructor(){super({id:"editor.action.setSelectionAnchor",label:w("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:Ls(2089,2080),weight:100}})}async run(e,t){var i;(i=m_.get(t))==null||i.setSelectionAnchor()}}class Stt extends Ze{constructor(){super({id:"editor.action.goToSelectionAnchor",label:w("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:DV})}async run(e,t){var i;(i=m_.get(t))==null||i.goToSelectionAnchor()}}class xtt extends Ze{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:w("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:DV,kbOpts:{kbExpr:U.editorTextFocus,primary:Ls(2089,2089),weight:100}})}async run(e,t){var i;(i=m_.get(t))==null||i.selectFromAnchorToCursor()}}class ktt extends Ze{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:w("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:DV,kbOpts:{kbExpr:U.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=m_.get(t))==null||i.cancelSelectionAnchor()}}gi(m_.ID,m_,4);Pe(wtt);Pe(Stt);Pe(xtt);Pe(ktt);const Ltt=q("editorOverviewRuler.bracketMatchForeground","#A0A0A0",w("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class Dtt extends Ze{constructor(){super({id:"editor.action.jumpToBracket",label:w("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=ay.get(t))==null||i.jumpToBracket()}}class Ett extends Ze{constructor(){super({id:"editor.action.selectToBracket",label:w("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:kt("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,i){var r;let n=!0;i&&i.selectBrackets===!1&&(n=!1),(r=ay.get(t))==null||r.selectToBracket(n)}}class Itt extends Ze{constructor(){super({id:"editor.action.removeBrackets",label:w("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=ay.get(t))==null||i.removeBrackets(this.id)}}class Ttt{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const jp=class jp extends re{static get(e){return e.getContribution(jp.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new ji(()=>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(i=>{const n=i.getStartPosition(),r=e.bracketPairs.matchBracket(n);let o=null;if(r)r[0].containsPosition(n)&&!r[1].containsPosition(n)?o=r[1].getStartPosition():r[1].containsPosition(n)&&(o=r[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(n);if(a)o=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(n);l&&l.range&&(o=l.range.getStartPosition())}}return o?new ot(o.lineNumber,o.column,o.lineNumber,o.column):new ot(n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(n=>{const r=n.getStartPosition();let o=t.bracketPairs.matchBracket(r);if(!o&&(o=t.bracketPairs.findEnclosingBrackets(r),!o)){const d=t.bracketPairs.findNextBracket(r);d&&d.range&&(o=t.bracketPairs.matchBracket(d.range.getStartPosition()))}let a=null,l=null;if(o){o.sort(W.compareRangesUsingStarts);const[d,h]=o;if(a=e?d.getStartPosition():d.getEndPosition(),l=e?h.getEndPosition():h.getStartPosition(),h.containsPosition(r)){const f=a;a=l,l=f}}a&&l&&i.push(new ot(a.lineNumber,a.column,l.lineNumber,l.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const n=i.getPosition();let r=t.bracketPairs.matchBracket(n);r||(r=t.bracketPairs.findEnclosingBrackets(n)),r&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:r[0],text:""},{range:r[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[1],options:i.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(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);const r=[];let o=0;for(let f=0,p=e.length;f<p;f++){const m=e[f];m.isEmpty()&&(r[o++]=m.getStartPosition())}r.length>1&&r.sort(ie.compare);const a=[];let l=0,d=0;const h=n.length;for(let f=0,p=r.length;f<p;f++){const m=r[f];for(;d<h&&n[d].position.isBefore(m);)d++;if(d<h&&n[d].position.equals(m))a[l++]=n[d];else{let v=t.bracketPairs.matchBracket(m,20),b=jp._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!v&&this._matchBrackets==="always"&&(v=t.bracketPairs.findEnclosingBrackets(m,20),b=jp._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[l++]=new Ttt(m,v,b)}}this._lastBracketsData=a,this._lastVersionId=i}};jp.ID="editor.contrib.bracketMatchingController",jp._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Ot.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:qn(Ltt),position:Gl.Center}}),jp._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Ot.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});let ay=jp;gi(ay.ID,ay,1);Pe(Ett);Pe(Dtt);Pe(Itt);or.appendMenuItem(st.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:w({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class Ntt{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,n=this._selection.startColumn,r=this._selection.endColumn;if(!(this._isMovingLeft&&n===1)&&!(!this._isMovingLeft&&r===e.getLineMaxColumn(i)))if(this._isMovingLeft){const o=new W(i,n-1,i,n),a=e.getValueInRange(o);t.addEditOperation(o,null),t.addEditOperation(new W(i,r,i,r),a)}else{const o=new W(i,r,i,r+1),a=e.getValueInRange(o);t.addEditOperation(o,null),t.addEditOperation(new W(i,n,i,n),a)}}computeCursorState(e,t){return this._isMovingLeft?new ot(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new ot(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class o0e extends Ze{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],n=t.getSelections();for(const r of n)i.push(new Ntt(r,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class Mtt extends o0e{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:w("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:U.writable})}}class Rtt extends o0e{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:w("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:U.writable})}}Pe(Mtt);Pe(Rtt);class Ptt extends Ze{constructor(){super({id:"editor.action.transposeLetters",label:w("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:U.writable,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],r=t.getSelections();for(const o of r){if(!o.isEmpty())continue;const a=o.startLineNumber,l=o.startColumn,d=i.getLineMaxColumn(a);if(a===1&&(l===1||l===2&&d===2))continue;const h=l===d?o.getPosition():Fi.rightPosition(i,o.getPosition().lineNumber,o.getPosition().column),f=Fi.leftPosition(i,h),p=Fi.leftPosition(i,f),m=i.getValueInRange(W.fromPositions(p,f)),v=i.getValueInRange(W.fromPositions(f,h)),b=W.fromPositions(p,h);n.push(new Vr(b,v+m))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}Pe(Ptt);const EV=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let s;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?s=crypto.getRandomValues.bind(crypto):s=function(i){for(let n=0;n<i.length;n++)i[n]=Math.floor(Math.random()*256);return i};const e=new Uint8Array(16),t=[];for(let i=0;i<256;i++)t.push(i.toString(16).padStart(2,"0"));return function(){s(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let n=0,r="";return r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+="-",r+=t[e[n++]],r+=t[e[n++]],r+="-",r+=t[e[n++]],r+=t[e[n++]],r+="-",r+=t[e[n++]],r+=t[e[n++]],r+="-",r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r}}();function Zie(s){return{asString:async()=>s,asFile:()=>{},value:typeof s=="string"?s:void 0}}function Ott(s,e,t){const i={id:EV(),name:s,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class a0e{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 ui.some(this,([i,n])=>n.asFile())&&t.push("files"),c0e(i3(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))==null?void 0:t[0]}append(e,t){const i=this._entries.get(e);i?i.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 i of t)yield[e,i]}toKey(e){return i3(e)}}function i3(s){return s.toLowerCase()}function l0e(s,e){return c0e(i3(s),e.map(i3))}function c0e(s,e){if(s==="*/*")return e.length>0;if(e.includes(s))return!0;const t=s.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,n,r]=t;return r==="*"?e.some(o=>o.startsWith(n+"/")):!1}const IV=Object.freeze({create:s=>Tg(s.map(e=>e.toString())).join(`\r
|
|
884
|
+
*-----------------------------------------------------------------------------*/var ntt=Object.defineProperty,stt=Object.getOwnPropertyDescriptor,rtt=Object.getOwnPropertyNames,ott=Object.prototype.hasOwnProperty,att=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of rtt(e))!ott.call(s,n)&&n!==t&&ntt(s,n,{get:()=>e[n],enumerable:!(i=stt(e,n))||i.enumerable});return s},ltt=(s,e,t)=>(att(s,e,"default"),t),ctt="5.4.5",QS={};ltt(QS,ON);var G1e=(s=>(s[s.None=0]="None",s[s.CommonJS=1]="CommonJS",s[s.AMD=2]="AMD",s[s.UMD=3]="UMD",s[s.System=4]="System",s[s.ES2015=5]="ES2015",s[s.ESNext=99]="ESNext",s))(G1e||{}),Y1e=(s=>(s[s.None=0]="None",s[s.Preserve=1]="Preserve",s[s.React=2]="React",s[s.ReactNative=3]="ReactNative",s[s.ReactJSX=4]="ReactJSX",s[s.ReactJSXDev=5]="ReactJSXDev",s))(Y1e||{}),Z1e=(s=>(s[s.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",s[s.LineFeed=1]="LineFeed",s))(Z1e||{}),X1e=(s=>(s[s.ES3=0]="ES3",s[s.ES5=1]="ES5",s[s.ES2015=2]="ES2015",s[s.ES2016=3]="ES2016",s[s.ES2017=4]="ES2017",s[s.ES2018=5]="ES2018",s[s.ES2019=6]="ES2019",s[s.ES2020=7]="ES2020",s[s.ESNext=99]="ESNext",s[s.JSON=100]="JSON",s[s.Latest=99]="Latest",s))(X1e||{}),Q1e=(s=>(s[s.Classic=1]="Classic",s[s.NodeJs=2]="NodeJs",s))(Q1e||{}),J1e=class{constructor(s,e,t,i,n){this._onDidChange=new QS.Emitter,this._onDidExtraLibsChange=new QS.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(s),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(n),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(s,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===s)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:s,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let n=this._extraLibs[t];n&&n.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(s){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),s&&s.length>0)for(const e of s){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let n=1;this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:n}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(s){this._compilerOptions=s||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(s){this._diagnosticsOptions=s||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(s){this._workerOptions=s||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(s){this._inlayHintsOptions=s||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(s){}setEagerModelSync(s){this._eagerModelSync=s}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(s){this._modeConfiguration=s||Object.create(null),this._onDidChange.fire(void 0)}},dtt=ctt,e0e={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},t0e=new J1e({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},e0e),i0e=new J1e({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},e0e),utt=()=>LV().then(s=>s.getTypeScriptWorker()),htt=()=>LV().then(s=>s.getJavaScriptWorker());QS.languages.typescript={ModuleKind:G1e,JsxEmit:Y1e,NewLineKind:Z1e,ScriptTarget:X1e,ModuleResolutionKind:Q1e,typescriptVersion:dtt,typescriptDefaults:t0e,javascriptDefaults:i0e,getTypeScriptWorker:utt,getJavaScriptWorker:htt};function LV(){return at(()=>import("./tsMode-vBfGu0Qc.js"),[])}QS.languages.onLanguage("typescript",()=>LV().then(s=>s.setupTypeScript(t0e)));QS.languages.onLanguage("javascript",()=>LV().then(s=>s.setupJavaScript(i0e)));class ftt extends ea{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:kt("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:Oe.map,toggled:ve.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:ve.has("isInDiffEditor"),menu:{when:ve.has("isInDiffEditor"),id:st.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Gt),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class n0e extends ea{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:kt("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:ve.has("isInDiffEditor")})}run(e,...t){const i=e.get(Gt),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class s0e extends ea{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:kt("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:ve.has("isInDiffEditor")})}run(e,...t){const i=e.get(Gt),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const FN=kt("diffEditor","Diff Editor");class gtt extends ju{constructor(){super({id:"diffEditor.switchSide",title:kt("switchSide","Switch Side"),icon:Oe.arrowSwap,precondition:ve.has("isInDiffEditor"),f1:!0,category:FN})}runEditorCommand(e,t,i){const n=Ux(e);if(n instanceof Bg){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class ptt extends ju{constructor(){super({id:"diffEditor.exitCompareMove",title:kt("exitCompareMove","Exit Compare Move"),icon:Oe.close,precondition:U.comparingMovedCode,f1:!1,category:FN,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=Ux(e);n instanceof Bg&&n.exitCompareMove()}}class mtt extends ju{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:kt("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:Oe.fold,precondition:ve.has("isInDiffEditor"),f1:!0,category:FN})}runEditorCommand(e,t,...i){const n=Ux(e);n instanceof Bg&&n.collapseAllUnchangedRegions()}}class _tt extends ju{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:kt("showAllUnchangedRegions","Show All Unchanged Regions"),icon:Oe.unfold,precondition:ve.has("isInDiffEditor"),f1:!0,category:FN})}runEditorCommand(e,t,...i){const n=Ux(e);n instanceof Bg&&n.showAllUnchangedRegions()}}class rZ extends ea{constructor(){super({id:"diffEditor.revert",title:kt("revert","Revert"),f1:!1,category:FN})}run(e,t){const i=vtt(e,t.originalUri,t.modifiedUri);i instanceof Bg&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const r0e=kt("accessibleDiffViewer","Accessible Diff Viewer"),GB=class GB extends ea{constructor(){super({id:GB.id,title:kt("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:r0e,precondition:ve.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=Ux(e);t==null||t.accessibleDiffViewerNext()}};GB.id="editor.action.accessibleDiffViewer.next";let bT=GB;const YB=class YB extends ea{constructor(){super({id:YB.id,title:kt("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:r0e,precondition:ve.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=Ux(e);t==null||t.accessibleDiffViewerPrev()}};YB.id="editor.action.accessibleDiffViewer.prev";let t3=YB;function vtt(s,e,t){return s.get(yi).listDiffEditors().find(r=>{var l,d;const o=r.getModifiedEditor(),a=r.getOriginalEditor();return o&&((l=o.getModel())==null?void 0:l.uri.toString())===t.toString()&&a&&((d=a.getModel())==null?void 0:d.uri.toString())===e.toString()})||null}function Ux(s){const t=s.get(yi).listDiffEditors(),i=$r();if(i)for(const n of t){const r=n.getContainerDomNode();if(btt(r,i))return n}return null}function btt(s,e){let t=e;for(;t;){if(t===s)return!0;t=t.parentElement}return!1}sn(ftt);sn(n0e);sn(s0e);or.appendMenuItem(st.EditorTitle,{command:{id:new s0e().desc.id,title:w("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:ve.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:ve.has("isInDiffEditor")},order:11,group:"1_diff",when:ve.and(U.diffEditorRenderSideBySideInlineBreakpointReached,ve.has("isInDiffEditor"))});or.appendMenuItem(st.EditorTitle,{command:{id:new n0e().desc.id,title:w("showMoves","Show Moved Code Blocks"),icon:Oe.move,toggled:Dx.create("config.diffEditor.experimental.showMoves",!0),precondition:ve.has("isInDiffEditor")},order:10,group:"1_diff",when:ve.has("isInDiffEditor")});sn(rZ);for(const s of[{icon:Oe.arrowRight,key:U.diffEditorInlineMode.toNegated()},{icon:Oe.discard,key:U.diffEditorInlineMode}])or.appendMenuItem(st.DiffEditorHunkToolbar,{command:{id:new rZ().desc.id,title:w("revertHunk","Revert Block"),icon:s.icon},when:ve.and(U.diffEditorModifiedWritable,s.key),order:5,group:"primary"}),or.appendMenuItem(st.DiffEditorSelectionToolbar,{command:{id:new rZ().desc.id,title:w("revertSelection","Revert Selection"),icon:s.icon},when:ve.and(U.diffEditorModifiedWritable,s.key),order:5,group:"primary"});sn(gtt);sn(ptt);sn(mtt);sn(_tt);or.appendMenuItem(st.EditorTitle,{command:{id:bT.id,title:w("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:ve.has("isInDiffEditor")},order:10,group:"2_diff",when:ve.and(U.accessibleDiffViewerVisible.negate(),ve.has("isInDiffEditor"))});hi.registerCommandAlias("editor.action.diffReview.next",bT.id);sn(bT);hi.registerCommandAlias("editor.action.diffReview.prev",t3.id);sn(t3);var Ctt=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},ytt=function(s,e){return function(t,i){e(t,i,s)}},oZ;const DV=new qe("selectionAnchorSet",!1);var Qb;let m_=(Qb=class{static get(e){return e.getContribution(oZ.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=DV.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(ot.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new eo().appendText(w("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),Qo(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(ot.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()}},oZ=Qb,Qb.ID="editor.contrib.selectionAnchorController",Qb);m_=oZ=Ctt([ytt(1,yt)],m_);class wtt extends Ze{constructor(){super({id:"editor.action.setSelectionAnchor",label:w("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:Ls(2089,2080),weight:100}})}async run(e,t){var i;(i=m_.get(t))==null||i.setSelectionAnchor()}}class Stt extends Ze{constructor(){super({id:"editor.action.goToSelectionAnchor",label:w("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:DV})}async run(e,t){var i;(i=m_.get(t))==null||i.goToSelectionAnchor()}}class xtt extends Ze{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:w("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:DV,kbOpts:{kbExpr:U.editorTextFocus,primary:Ls(2089,2089),weight:100}})}async run(e,t){var i;(i=m_.get(t))==null||i.selectFromAnchorToCursor()}}class ktt extends Ze{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:w("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:DV,kbOpts:{kbExpr:U.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=m_.get(t))==null||i.cancelSelectionAnchor()}}gi(m_.ID,m_,4);Pe(wtt);Pe(Stt);Pe(xtt);Pe(ktt);const Ltt=q("editorOverviewRuler.bracketMatchForeground","#A0A0A0",w("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class Dtt extends Ze{constructor(){super({id:"editor.action.jumpToBracket",label:w("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=ay.get(t))==null||i.jumpToBracket()}}class Ett extends Ze{constructor(){super({id:"editor.action.selectToBracket",label:w("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:kt("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,i){var r;let n=!0;i&&i.selectBrackets===!1&&(n=!1),(r=ay.get(t))==null||r.selectToBracket(n)}}class Itt extends Ze{constructor(){super({id:"editor.action.removeBrackets",label:w("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=ay.get(t))==null||i.removeBrackets(this.id)}}class Ttt{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const jp=class jp extends re{static get(e){return e.getContribution(jp.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new ji(()=>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(i=>{const n=i.getStartPosition(),r=e.bracketPairs.matchBracket(n);let o=null;if(r)r[0].containsPosition(n)&&!r[1].containsPosition(n)?o=r[1].getStartPosition():r[1].containsPosition(n)&&(o=r[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(n);if(a)o=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(n);l&&l.range&&(o=l.range.getStartPosition())}}return o?new ot(o.lineNumber,o.column,o.lineNumber,o.column):new ot(n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(n=>{const r=n.getStartPosition();let o=t.bracketPairs.matchBracket(r);if(!o&&(o=t.bracketPairs.findEnclosingBrackets(r),!o)){const d=t.bracketPairs.findNextBracket(r);d&&d.range&&(o=t.bracketPairs.matchBracket(d.range.getStartPosition()))}let a=null,l=null;if(o){o.sort(W.compareRangesUsingStarts);const[d,h]=o;if(a=e?d.getStartPosition():d.getEndPosition(),l=e?h.getEndPosition():h.getStartPosition(),h.containsPosition(r)){const f=a;a=l,l=f}}a&&l&&i.push(new ot(a.lineNumber,a.column,l.lineNumber,l.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const n=i.getPosition();let r=t.bracketPairs.matchBracket(n);r||(r=t.bracketPairs.findEnclosingBrackets(n)),r&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:r[0],text:""},{range:r[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[1],options:i.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(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);const r=[];let o=0;for(let f=0,p=e.length;f<p;f++){const m=e[f];m.isEmpty()&&(r[o++]=m.getStartPosition())}r.length>1&&r.sort(ie.compare);const a=[];let l=0,d=0;const h=n.length;for(let f=0,p=r.length;f<p;f++){const m=r[f];for(;d<h&&n[d].position.isBefore(m);)d++;if(d<h&&n[d].position.equals(m))a[l++]=n[d];else{let v=t.bracketPairs.matchBracket(m,20),b=jp._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!v&&this._matchBrackets==="always"&&(v=t.bracketPairs.findEnclosingBrackets(m,20),b=jp._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[l++]=new Ttt(m,v,b)}}this._lastBracketsData=a,this._lastVersionId=i}};jp.ID="editor.contrib.bracketMatchingController",jp._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Ot.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:qn(Ltt),position:Gl.Center}}),jp._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Ot.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});let ay=jp;gi(ay.ID,ay,1);Pe(Ett);Pe(Dtt);Pe(Itt);or.appendMenuItem(st.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:w({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class Ntt{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,n=this._selection.startColumn,r=this._selection.endColumn;if(!(this._isMovingLeft&&n===1)&&!(!this._isMovingLeft&&r===e.getLineMaxColumn(i)))if(this._isMovingLeft){const o=new W(i,n-1,i,n),a=e.getValueInRange(o);t.addEditOperation(o,null),t.addEditOperation(new W(i,r,i,r),a)}else{const o=new W(i,r,i,r+1),a=e.getValueInRange(o);t.addEditOperation(o,null),t.addEditOperation(new W(i,n,i,n),a)}}computeCursorState(e,t){return this._isMovingLeft?new ot(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new ot(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class o0e extends Ze{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],n=t.getSelections();for(const r of n)i.push(new Ntt(r,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class Mtt extends o0e{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:w("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:U.writable})}}class Rtt extends o0e{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:w("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:U.writable})}}Pe(Mtt);Pe(Rtt);class Ptt extends Ze{constructor(){super({id:"editor.action.transposeLetters",label:w("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:U.writable,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],r=t.getSelections();for(const o of r){if(!o.isEmpty())continue;const a=o.startLineNumber,l=o.startColumn,d=i.getLineMaxColumn(a);if(a===1&&(l===1||l===2&&d===2))continue;const h=l===d?o.getPosition():Fi.rightPosition(i,o.getPosition().lineNumber,o.getPosition().column),f=Fi.leftPosition(i,h),p=Fi.leftPosition(i,f),m=i.getValueInRange(W.fromPositions(p,f)),v=i.getValueInRange(W.fromPositions(f,h)),b=W.fromPositions(p,h);n.push(new Vr(b,v+m))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}Pe(Ptt);const EV=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let s;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?s=crypto.getRandomValues.bind(crypto):s=function(i){for(let n=0;n<i.length;n++)i[n]=Math.floor(Math.random()*256);return i};const e=new Uint8Array(16),t=[];for(let i=0;i<256;i++)t.push(i.toString(16).padStart(2,"0"));return function(){s(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let n=0,r="";return r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+="-",r+=t[e[n++]],r+=t[e[n++]],r+="-",r+=t[e[n++]],r+=t[e[n++]],r+="-",r+=t[e[n++]],r+=t[e[n++]],r+="-",r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r}}();function Zie(s){return{asString:async()=>s,asFile:()=>{},value:typeof s=="string"?s:void 0}}function Ott(s,e,t){const i={id:EV(),name:s,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class a0e{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 ui.some(this,([i,n])=>n.asFile())&&t.push("files"),c0e(i3(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))==null?void 0:t[0]}append(e,t){const i=this._entries.get(e);i?i.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 i of t)yield[e,i]}toKey(e){return i3(e)}}function i3(s){return s.toLowerCase()}function l0e(s,e){return c0e(i3(s),e.map(i3))}function c0e(s,e){if(s==="*/*")return e.length>0;if(e.includes(s))return!0;const t=s.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,n,r]=t;return r==="*"?e.some(o=>o.startsWith(n+"/")):!1}const IV=Object.freeze({create:s=>Tg(s.map(e=>e.toString())).join(`\r
|
|
885
885
|
`),split:s=>s.split(`\r
|
|
886
886
|
`),parse:s=>IV.split(s).filter(e=>!e.startsWith("#"))}),Sh=class Sh{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+Sh.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new Sh((this.value?[this.value,...e]:e).join(Sh.sep))}};Sh.sep=".",Sh.None=new Sh("@@none@@"),Sh.Empty=new Sh("");let In=Sh;const Rfe={EDITORS:"CodeEditors",FILES:"CodeFiles"};class Att{}const Ftt={DragAndDropContribution:"workbench.contributions.dragAndDrop"};Fn.add(Ftt.DragAndDropContribution,new Att);const JE=class JE{constructor(){}static getInstance(){return JE.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}};JE.INSTANCE=new JE;let aZ=JE;function d0e(s){const e=new a0e;for(const t of s.items){const i=t.type;if(t.kind==="string"){const n=new Promise(r=>t.getAsString(r));e.append(i,Zie(n))}else if(t.kind==="file"){const n=t.getAsFile();n&&e.append(i,Btt(n))}}return e}function Btt(s){const e=s.path?gt.parse(s.path):void 0;return Ott(s.name,e,async()=>new Uint8Array(await s.arrayBuffer()))}const Wtt=Object.freeze([Rfe.EDITORS,Rfe.FILES,UI.RESOURCES,UI.INTERNAL_URI_LIST]);function u0e(s,e=!1){const t=d0e(s),i=t.get(UI.INTERNAL_URI_LIST);if(i)t.replace(es.uriList,i);else if(e||!t.has(es.uriList)){const n=[];for(const r of s.items){const o=r.getAsFile();if(o){const a=o.path;try{a?n.push(gt.file(a).toString()):n.push(gt.parse(o.name,!0).toString())}catch{}}}n.length&&t.replace(es.uriList,Zie(IV.create(n)))}for(const n of Wtt)t.delete(n);return t}var Xie=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},CT=function(s,e){return function(t,i){e(t,i,s)}};class Qie{async provideDocumentPasteEdits(e,t,i,n,r){const o=await this.getEdit(i,r);if(o)return{edits:[{insertText:o.insertText,title:o.title,kind:o.kind,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,i,n){const r=await this.getEdit(i,n);if(r)return{edits:[{insertText:r.insertText,title:r.title,kind:r.kind,handledMimeType:r.handledMimeType,yieldTo:r.yieldTo}],dispose(){}}}}const eI=class eI extends Qie{constructor(){super(...arguments),this.kind=eI.kind,this.dropMimeTypes=[es.text],this.pasteMimeTypes=[es.text]}async getEdit(e,t){const i=e.get(es.text);if(!i||e.has(es.uriList))return;const n=await i.asString();return{handledMimeType:es.text,title:w("text.label","Insert Plain Text"),insertText:n,kind:this.kind}}};eI.id="text",eI.kind=new In("text.plain");let ly=eI;class h0e extends Qie{constructor(){super(...arguments),this.kind=new In("uri.absolute"),this.dropMimeTypes=[es.uriList],this.pasteMimeTypes=[es.uriList]}async getEdit(e,t){const i=await f0e(e);if(!i.length||t.isCancellationRequested)return;let n=0;const r=i.map(({uri:a,originalText:l})=>a.scheme===Mt.file?a.fsPath:(n++,l)).join(" ");let o;return n>0?o=i.length>1?w("defaultDropProvider.uriList.uris","Insert Uris"):w("defaultDropProvider.uriList.uri","Insert Uri"):o=i.length>1?w("defaultDropProvider.uriList.paths","Insert Paths"):w("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:es.uriList,insertText:r,title:o,kind:this.kind}}}let n3=class extends Qie{constructor(e){super(),this._workspaceContextService=e,this.kind=new In("uri.relative"),this.dropMimeTypes=[es.uriList],this.pasteMimeTypes=[es.uriList]}async getEdit(e,t){const i=await f0e(e);if(!i.length||t.isCancellationRequested)return;const n=Dd(i.map(({uri:r})=>{const o=this._workspaceContextService.getWorkspaceFolder(r);return o?j9e(o.uri,r):void 0}));if(n.length)return{handledMimeType:es.uriList,insertText:n.join(" "),title:i.length>1?w("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):w("defaultDropProvider.uriList.relativePath","Insert Relative Path"),kind:this.kind}}};n3=Xie([CT(0,ty)],n3);class Htt{constructor(){this.kind=new In("html"),this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:es.text}]}async provideDocumentPasteEdits(e,t,i,n,r){var l;if(n.triggerKind!==bI.PasteAs&&!((l=n.only)!=null&&l.contains(this.kind)))return;const o=i.get("text/html"),a=await(o==null?void 0:o.asString());if(!(!a||r.isCancellationRequested))return{dispose(){},edits:[{insertText:a,yieldTo:this._yieldTo,title:w("pasteHtmlLabel","Insert HTML"),kind:this.kind}]}}}async function f0e(s){const e=s.get(es.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const n of IV.parse(t))try{i.push({uri:gt.parse(n),originalText:n})}catch{}return i}let lZ=class extends re{constructor(e,t){super(),this._register(e.documentDropEditProvider.register("*",new ly)),this._register(e.documentDropEditProvider.register("*",new h0e)),this._register(e.documentDropEditProvider.register("*",new n3(t)))}};lZ=Xie([CT(0,it),CT(1,ty)],lZ);let cZ=class extends re{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new ly)),this._register(e.documentPasteEditProvider.register("*",new h0e)),this._register(e.documentPasteEditProvider.register("*",new n3(t))),this._register(e.documentPasteEditProvider.register("*",new Htt))}};cZ=Xie([CT(0,it),CT(1,ty)],cZ);const hd=class hd{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,i=this.value.charCodeAt(e),n;if(n=hd._table[i],typeof n=="number")return this.pos+=1,{type:n,pos:e,len:1};if(hd.isDigitCharacter(i)){n=8;do t+=1,i=this.value.charCodeAt(e+t);while(hd.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}if(hd.isVariableCharacter(i)){n=9;do i=this.value.charCodeAt(e+ ++t);while(hd.isVariableCharacter(i)||hd.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}n=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof hd._table[i]>"u"&&!hd.isDigitCharacter(i)&&!hd.isVariableCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}};hd._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};let dZ=hd;class qx{constructor(){this._children=[]}appendChild(e){return e instanceof Ho&&this._children[this._children.length-1]instanceof Ho?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,n=i.children.indexOf(e),r=i.children.slice(0);r.splice(n,1,...t),i._children=r,function o(a,l){for(const d of a)d.parent=l,o(d.children,d)}(t,i)}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 BN)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class Ho extends qx{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new Ho(this.value)}}class g0e extends qx{}class xc extends g0e{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.index<t.index?-1:e.index>t.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 Kx?this._children[0]:void 0}clone(){const e=new xc(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class Kx extends qx{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof Ho&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new Kx;return this.options.forEach(e.appendChild,e),e}}class Jie extends qx{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,n=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(r=>r instanceof cu&&!!r.elseValue)&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof cu){let n=e[i.index]||"";n=i.resolve(n),t+=n}else t+=i.toString();return t}toString(){return""}clone(){const e=new Jie;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 cu extends qx{constructor(e,t,i,n){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=n}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(i=>i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((i,n)=>n===0?i.charAt(0).toLowerCase()+i.substr(1):i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}clone(){return new cu(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class yT extends g0e{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 Ho(t)],!0):!1}clone(){const e=new yT(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function Pfe(s,e){const t=[...s];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class BN extends qx{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof xc&&(e.push(i),t=!t||t.index<i.index?i:t),!0}),this._placeholders={all:e,last:t}}return this._placeholders}get placeholders(){const{all:e}=this.placeholderInfo;return e}offset(e){let t=0,i=!1;return this.walk(n=>n===e?(i=!0,!1):(t+=n.len(),!0)),i?t:-1}fullLen(e){let t=0;return Pfe([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof xc&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof yT&&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 BN;return this._children=this.children.map(t=>t.clone()),e}walk(e){Pfe(this.children,e)}}class cy{constructor(){this._scanner=new dZ,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){const n=new BN;return this.parseFragment(e,n),this.ensureFinalTabstop(n,i??!1,t??!1),n}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const n=new Map,r=[];t.walk(l=>(l instanceof xc&&(l.isFinalTabstop?n.set(0,void 0):!n.has(l.index)&&l.children.length>0?n.set(l.index,l.children):r.push(l)),!0));const o=(l,d)=>{const h=n.get(l.index);if(!h)return;const f=new xc(l.index);f.transform=l.transform;for(const p of h){const m=p.clone();f.appendChild(m),m instanceof xc&&n.has(m.index)&&!d.has(m.index)&&(d.add(m.index),o(m,d),d.delete(m.index))}t.replace(l,[f])},a=new Set;for(const l of r)o(l,a);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(r=>r.index===0)||e.appendChild(new xc(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){const n=this._scanner.next();if(n.type!==0&&n.type!==4&&n.type!==5)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new Ho(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new xc(Number(t)):new yT(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const r=new xc(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new Ho("${"+t+":")),r.children.forEach(e.appendChild,e),!0}else if(r.index>0&&this._accept(7)){const o=new Kx;for(;;){if(this._parseChoiceElement(o)){if(this._accept(2))continue;if(this._accept(7)&&(r.appendChild(o),this._accept(4)))return e.appendChild(r),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(r),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===2||this._token.type===7);){let n;if((n=this._accept(5,!0))?n=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||n:n=this._accept(void 0,!0),!n)return this._backTo(t),!1;i.push(n)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new Ho(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const r=new yT(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new Ho("${"+t+":")),r.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(r),!0):this._backTo(i)}_parseTransform(e){const t=new Jie;let i="",n="";for(;!this._accept(6);){let r;if(r=this._accept(5,!0)){r=this._accept(6,!0)||r,i+=r;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let r;if(r=this._accept(5,!0)){r=this._accept(5,!0)||this._accept(6,!0)||r,t.appendChild(new Ho(r));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){n+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,n)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);const n=this._accept(8,!0);if(n)if(i){if(this._accept(4))return e.appendChild(new cu(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new cu(Number(n))),!0;else return this._backTo(t),!1;if(this._accept(6)){const r=this._accept(9,!0);return!r||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new cu(Number(n),r)),!0)}else if(this._accept(11)){const r=this._until(4);if(r)return e.appendChild(new cu(Number(n),void 0,r,void 0)),!0}else if(this._accept(12)){const r=this._until(4);if(r)return e.appendChild(new cu(Number(n),void 0,void 0,r)),!0}else if(this._accept(13)){const r=this._until(1);if(r){const o=this._until(4);if(o)return e.appendChild(new cu(Number(n),void 0,r,o)),!0}}else{const r=this._until(4);if(r)return e.appendChild(new cu(Number(n),void 0,void 0,r)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new Ho(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}function p0e(s,e,t){var i,n;return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:((i=t.additionalEdit)==null?void 0:i.edits)??[]}:{edits:[...e.map(r=>new Em(s,{range:r,text:typeof t.insertText=="string"?cy.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...((n=t.additionalEdit)==null?void 0:n.edits)??[]]}}function m0e(s){function e(o,a){return"mimeType"in o?o.mimeType===a.handledMimeType:!!a.kind&&o.kind.contains(a.kind)}const t=new Map;for(const o of s)for(const a of o.yieldTo??[])for(const l of s)if(l!==o&&e(a,l)){let d=t.get(o);d||(d=[],t.set(o,d)),d.push(l)}if(!t.size)return Array.from(s);const i=new Set,n=[];function r(o){if(!o.length)return[];const a=o[0];if(n.includes(a))return console.warn("Yield to cycle detected",a),o;if(i.has(a))return r(o.slice(1));let l=[];const d=t.get(a);return d&&(n.push(a),l=r(d),n.pop()),i.add(a),[...l,a,...r(o.slice(1))]}return r(Array.from(s))}var Vtt=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},$tt=function(s,e){return function(t,i){e(t,i,s)}};const ztt=Ot.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:Vve,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),ZB=class ZB extends re{constructor(e,t,i,n,r){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=r,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(n),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=Fe(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=Fe("span.icon");this.domNode.append(t),t.classList.add(...bt.asClassNameArray(Oe.loading),"codicon-modifier-spin");const i=()=>{const n=this.editor.getOption(67);this.domNode.style.height=`${n}px`,this.domNode.style.width=`${Math.ceil(.8*n)}px`};i(),this._register(this.editor.onDidChangeConfiguration(n=>{(n.hasChanged(52)||n.hasChanged(67))&&i()})),this._register(ue(this.domNode,Ae.CLICK,n=>{this.delegate.cancel()}))}getId(){return ZB.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)}};ZB.baseId="editor.widget.inlineProgressWidget";let uZ=ZB,s3=class extends re{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new Js),this._currentWidget=this._register(new Js),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,i,n,r){const o=this._operationIdPool++;this._currentOperation=o,this.clear(),this._showPromise.value=r_(()=>{const a=W.fromPositions(e);this._currentDecorations.set([{range:a,options:ztt}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(uZ,this.id,this._editor,a,t,n))},r??this._showDelay);try{return await i}finally{this._currentOperation===o&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};s3=Vtt([$tt(2,ut)],s3);var jtt=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Ofe=function(s,e){return function(t,i){e(t,i,s)}},_F,Rm;let al=(Rm=class{static get(e){return e.getContribution(_F.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new Js,this._messageListeners=new me,this._mouseOverMessage=!1,this._editor=e,this._visible=_F.MESSAGE_VISIBLE.bindTo(t)}dispose(){var e;(e=this._message)==null||e.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){Qo(Nu(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=Nu(e)?YH(e,{actionHandler:{callback:n=>{this.closeMessage(),vte(this._openerService,n,Nu(e)?e.isTrusted:void 0)},disposables:this._messageListeners}}):void 0,this._messageWidget.value=new Afe(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(We.debounce(this._editor.onDidBlurEditorText,(n,r)=>r,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&Ys($r(),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(ue(this._messageWidget.value.getDomNode(),Ae.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(ue(this._messageWidget.value.getDomNode(),Ae.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(n=>{n.target.position&&(i?i.containsPosition(n.target.position)||this.closeMessage():i=new W(t.lineNumber-3,1,n.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(Afe.fadeOut(this._messageWidget.value))}},_F=Rm,Rm.ID="editor.contrib.messageController",Rm.MESSAGE_VISIBLE=new qe("messageVisible",!1,w("messageVisible","Whether the editor is currently showing an inline message")),Rm);al=_F=jtt([Ofe(1,yt),Ofe(2,Ta)],al);const Utt=$s.bindToContribution(al.get);Ue(new Utt({id:"leaveEditorMessage",precondition:al.MESSAGE_VISIBLE,handler:s=>s.closeMessage(),kbOpts:{weight:130,primary:9}}));let Afe=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},n){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const r=document.createElement("div");r.classList.add("anchor","top"),this._domNode.appendChild(r);const o=document.createElement("div");typeof n=="string"?(o.classList.add("message"),o.textContent=n):(n.classList.add("message"),o.appendChild(n)),this._domNode.appendChild(o);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}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)}};gi(al.ID,al,4);function ij(s,e){return e&&(s.stack||s.stacktrace)?w("stackTrace.format","{0}: {1}",Bfe(s),Ffe(s.stack)||Ffe(s.stacktrace)):Bfe(s)}function Ffe(s){return Array.isArray(s)?s.join(`
|
|
887
887
|
`):s}function Bfe(s){return s.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${s.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof s.code=="string"&&typeof s.errno=="number"&&typeof s.syscall=="string"?w("nodeExceptionMessage","A system error occurred ({0})",s.message):s.message||w("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function r3(s=null,e=!1){if(!s)return w("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(s)){const t=Dd(s),i=r3(t[0],e);return t.length>1?w("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(Ca(s))return s;if(s.detail){const t=s.detail;if(t.error)return ij(t.error,e);if(t.exception)return ij(t.exception,e)}return s.stack?ij(s,e):s.message?s.message:w("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}var _0e=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},lS=function(s,e){return function(t,i){e(t,i,s)}},hZ,Jb;let fZ=(Jb=class extends re{constructor(e,t,i,n,r,o,a,l,d,h){super(),this.typeId=e,this.editor=t,this.showCommand=n,this.range=r,this.edits=o,this.onSelectNewEdit=a,this._contextMenuService=l,this._keybindingService=h,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(d),this.visibleContext.set(!0),this._register(dt(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(dt(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(f=>{r.containsPosition(f.position)||this.dispose()})),this._register(We.runAndSubscribe(h.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var t;const e=(t=this._keybindingService.lookupKeybinding(this.showCommand.id))==null?void 0:t.getLabel();this.button.element.title=this.showCommand.label+(e?` (${e})`:"")}create(){this.domNode=Fe(".post-edit-widget"),this.button=this._register(new u5(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(ue(this.domNode,Ae.CLICK,()=>this.showSelector()))}getId(){return hZ.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=ts(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>Mb({id:"",label:e.title,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}},hZ=Jb,Jb.baseId="editor.widget.postEditWidget",Jb);fZ=hZ=_0e([lS(7,gl),lS(8,yt),lS(9,Mi)],fZ);let o3=class extends re{constructor(e,t,i,n,r,o,a){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=n,this._instantiationService=r,this._bulkEditService=o,this._notificationService=a,this._currentWidget=this._register(new Js),this._register(We.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,n,r){const o=this._editor.getModel();if(!o||!e.length)return;const a=t.allEdits.at(t.activeEditIndex);if(!a)return;const l=async y=>{const x=this._editor.getModel();x&&(await x.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:y,allEdits:t.allEdits},i,n,r))},d=(y,x)=>{zc(y)||(this._notificationService.error(x),i&&this.show(e[0],t,l))};let h;try{h=await n(a,r)}catch(y){return d(y,w("resolveError",`Error resolving edit '{0}':
|
|
@@ -890,7 +890,7 @@ ${e.toString()}`}}class L5{constructor(e=new Vx,t=!1,i,n=mKe){this._services=e,t
|
|
|
890
890
|
`),this._selectionId=t.trackSelection(i);return}i.startLineNumber<i.endLineNumber&&i.endColumn===1&&(this._moveEndPositionDown=!0,i=i.setEndPosition(i.endLineNumber-1,e.getLineMaxColumn(i.endLineNumber-1)));const n=Vf._gatherPreflightData(this._type,this._insertSpace,e,i.startLineNumber,i.endLineNumber,this._ignoreEmptyLines,this._ignoreFirstLine,this.languageConfigurationService);return n.supported?this._executeLineComments(e,t,n,i):this._executeBlockComment(e,t,i)}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),new ot(i.selectionStartLineNumber,i.selectionStartColumn+this._deltaColumn,i.positionLineNumber,i.positionColumn+this._deltaColumn)}static _createRemoveLineCommentsOperations(e,t){const i=[];for(let n=0,r=e.length;n<r;n++){const o=e[n];o.ignore||i.push(Pn.delete(new W(t+n,o.commentStrOffset+1,t+n,o.commentStrOffset+o.commentStrLength+1)))}return i}_createAddLineCommentsOperations(e,t){const i=[],n=this._insertSpace?" ":"";for(let r=0,o=e.length;r<o;r++){const a=e[r];a.ignore||i.push(Pn.insert(new ie(t+r,a.commentStrOffset+1),a.commentStr+n))}return i}static nextVisibleColumn(e,t,i,n){return i?e+(t-e%t):e+n}static _normalizeInsertionPoint(e,t,i,n){let r=1073741824,o,a;for(let l=0,d=t.length;l<d;l++){if(t[l].ignore)continue;const h=e.getLineContent(i+l);let f=0;for(let p=0,m=t[l].commentStrOffset;f<r&&p<m;p++)f=Vf.nextVisibleColumn(f,n,h.charCodeAt(p)===9,1);f<r&&(r=f)}r=Math.floor(r/n)*n;for(let l=0,d=t.length;l<d;l++){if(t[l].ignore)continue;const h=e.getLineContent(i+l);let f=0;for(o=0,a=t[l].commentStrOffset;f<r&&o<a;o++)f=Vf.nextVisibleColumn(f,n,h.charCodeAt(o)===9,1);f>r?t[l].commentStrOffset=o-1:t[l].commentStrOffset=o}}}class gne extends Ze{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(Bn);if(!t.hasModel())return;const n=t.getModel(),r=[],o=n.getOptions(),a=t.getOption(23),l=t.getSelections().map((h,f)=>({selection:h,index:f,ignoreFirstLine:!1}));l.sort((h,f)=>W.compareRangesUsingStarts(h.selection,f.selection));let d=l[0];for(let h=1;h<l.length;h++){const f=l[h];d.selection.endLineNumber===f.selection.startLineNumber&&(d.index<f.index?f.ignoreFirstLine=!0:(d.ignoreFirstLine=!0,d=f))}for(const h of l)r.push(new Vf(i,h.selection,o.indentSize,this._type,a.insertSpace,a.ignoreEmptyLines,h.ignoreFirstLine));t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop()}}class ast extends gne{constructor(){super(0,{id:"editor.action.commentLine",label:w("comment.line","Toggle Line Comment"),alias:"Toggle Line Comment",precondition:U.writable,kbOpts:{kbExpr:U.editorTextFocus,primary:2138,weight:100},menuOpts:{menuId:st.MenubarEditMenu,group:"5_insert",title:w({key:"miToggleLineComment",comment:["&& denotes a mnemonic"]},"&&Toggle Line Comment"),order:1}})}}class lst extends gne{constructor(){super(1,{id:"editor.action.addCommentLine",label:w("comment.line.add","Add Line Comment"),alias:"Add Line Comment",precondition:U.writable,kbOpts:{kbExpr:U.editorTextFocus,primary:Ls(2089,2081),weight:100}})}}class cst extends gne{constructor(){super(2,{id:"editor.action.removeCommentLine",label:w("comment.line.remove","Remove Line Comment"),alias:"Remove Line Comment",precondition:U.writable,kbOpts:{kbExpr:U.editorTextFocus,primary:Ls(2089,2099),weight:100}})}}class dst extends Ze{constructor(){super({id:"editor.action.blockComment",label:w("comment.block","Toggle Block Comment"),alias:"Toggle Block Comment",precondition:U.writable,kbOpts:{kbExpr:U.editorTextFocus,primary:1567,linux:{primary:3103},weight:100},menuOpts:{menuId:st.MenubarEditMenu,group:"5_insert",title:w({key:"miToggleBlockComment",comment:["&& denotes a mnemonic"]},"Toggle &&Block Comment"),order:2}})}run(e,t){const i=e.get(Bn);if(!t.hasModel())return;const n=t.getOption(23),r=[],o=t.getSelections();for(const a of o)r.push(new mm(a,n.insertSpace,i));t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop()}}Pe(ast);Pe(lst);Pe(cst);Pe(dst);var ust=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Ov=function(s,e){return function(t,i){e(t,i,s)}},GZ,hC;let nx=(hC=class{static get(e){return e.getContribution(GZ.ID)}constructor(e,t,i,n,r,o,a,l){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=n,this._keybindingService=r,this._menuService=o,this._configurationService=a,this._workspaceContextService=l,this._toDispose=new me,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu(d=>this._onContextMenu(d))),this._toDispose.add(this._editor.onMouseWheel(d=>{if(this._contextMenuIsBeingShownCount>0){const h=this._contextViewService.getContextViewElement(),f=d.srcElement;f.shadowRoot&&YC(h)===f.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(d=>{this._editor.getOption(24)&&d.keyCode===58&&(d.preventDefault(),d.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 i=!1;for(const n of this._editor.getSelections())if(n.containsPosition(e.target.position)){i=!0;break}i||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.contextMenuId);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const i=[],n=this._menuService.getMenuActions(t,this._contextKeyService,{arg:e.uri});for(const r of n){const[,o]=r;let a=0;for(const l of o)if(l instanceof z0){const d=this._getMenuActions(e,l.item.submenu);d.length>0&&(i.push(new IS(l.id,l.label,d)),a++)}else i.push(l),a++;a&&i.push(new Qs)}return i.length&&i.pop(),i}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;const i=this._editor.getOption(60);this._editor.updateOptions({hover:{enabled:!1}});let n=t;if(!n){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const o=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),a=ts(this._editor.getDomNode()),l=a.left+o.left,d=a.top+o.top+o.height;n={x:l,y:d}}const r=this._editor.getOption(128)&&!Mu;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:r?this._editor.getOverflowWidgetsDomNode()??this._editor.getDomNode():void 0,getAnchor:()=>n,getActions:()=>e,getActionViewItem:o=>{const a=this._keybindingFor(o);if(a)return new zS(o,o,{label:!0,keybinding:a.getLabel(),isMenu:!0});const l=o;return typeof l.getActionViewItem=="function"?l.getActionViewItem():new zS(o,o,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:o=>this._keybindingFor(o),onHide:o=>{this._contextMenuIsBeingShownCount--,this._editor.updateOptions({hover:i})}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel()||d6e(this._workspaceContextService.getWorkspace()))return;const t=this._editor.getOption(73);let i=0;const n=d=>({id:`menu-action-${++i}`,label:d.label,tooltip:"",class:void 0,enabled:typeof d.enabled>"u"?!0:d.enabled,checked:d.checked,run:d.run}),r=(d,h)=>new IS(`menu-action-${++i}`,d,h,void 0),o=(d,h,f,p,m)=>{if(!h)return n({label:d,enabled:h,run:()=>{}});const v=y=>()=>{this._configurationService.updateValue(f,y)},b=[];for(const y of m)b.push(n({label:y.label,checked:p===y.value,run:v(y.value)}));return r(d,b)},a=[];a.push(n({label:w("context.minimap.minimap","Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new Qs),a.push(n({label:w("context.minimap.renderCharacters","Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(o(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(o(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(128)&&!Mu;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:l?this._editor.getDomNode():void 0,getAnchor:()=>e,getActions:()=>a,onHide:d=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}},GZ=hC,hC.ID="editor.contrib.contextmenu",hC);nx=GZ=ust([Ov(1,gl),Ov(2,qg),Ov(3,yt),Ov(4,Mi),Ov(5,nc),Ov(6,Gt),Ov(7,ty)],nx);class hst extends Ze{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:U.textInputFocus,primary:1092,weight:100}})}run(e,t){var i;(i=nx.get(t))==null||i.showContextMenu()}}gi(nx.ID,nx,2);Pe(hst);class dj{constructor(e){this.selections=e}equals(e){const t=this.selections.length,i=e.selections.length;if(t!==i)return!1;for(let n=0;n<t;n++)if(!this.selections[n].equalsSelection(e.selections[n]))return!1;return!0}}class uj{constructor(e,t,i){this.cursorState=e,this.scrollTop=t,this.scrollLeft=i}}const tW=class tW extends re{static get(e){return e.getContribution(tW.ID)}constructor(e){super(),this._editor=e,this._isCursorUndoRedo=!1,this._undoStack=[],this._redoStack=[],this._register(e.onDidChangeModel(t=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeModelContent(t=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeCursorSelection(t=>{if(this._isCursorUndoRedo||!t.oldSelections||t.oldModelVersionId!==t.modelVersionId)return;const i=new dj(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new uj(i,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 uj(new dj(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 uj(new dj(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}};tW.ID="editor.contrib.cursorUndoRedoController";let sx=tW;class fst extends Ze{constructor(){super({id:"cursorUndo",label:w("cursor.undo","Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:U.textInputFocus,primary:2099,weight:100}})}run(e,t,i){var n;(n=sx.get(t))==null||n.cursorUndo()}}class gst extends Ze{constructor(){super({id:"cursorRedo",label:w("cursor.redo","Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,i){var n;(n=sx.get(t))==null||n.cursorRedo()}}gi(sx.ID,sx,0);Pe(fst);Pe(gst);class pst{constructor(e,t,i){this.selection=e,this.targetPosition=t,this.copy=i,this.targetSelection=null}getEditOperations(e,t){const i=e.getValueInRange(this.selection);if(this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new W(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),i),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 ot(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 ot(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.lineNumber<this.selection.endLineNumber){this.targetSelection=new ot(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber+this.selection.endLineNumber-this.selection.startLineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}this.selection.endColumn<=this.targetPosition.column?this.targetSelection=new ot(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column-this.selection.endColumn+this.selection.startColumn:this.targetPosition.column-this.selection.endColumn+this.selection.startColumn,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column:this.selection.endColumn):this.targetSelection=new ot(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column+this.selection.endColumn-this.selection.startColumn)}computeCursorState(e,t){return this.targetSelection}}function M1(s){return ti?s.altKey:s.ctrlKey}const Up=class Up extends re{constructor(e){super(),this._editor=e,this._dndDecorationIds=this._editor.createDecorationsCollection(),this._register(this._editor.onMouseDown(t=>this._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)||(M1(e)&&(this._modifierPressed=!0),this._mouseDown&&M1(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(35)||this._editor.getOption(22)||(M1(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===Up.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 n=(this._editor.getSelections()||[]).filter(r=>t.position&&r.containsPosition(t.position));if(n.length===1)this._dragSelection=n[0];else return}M1(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 ie(e.target.position.lineNumber,e.target.position.column);if(this._dragSelection===null){let i=null;if(e.event.shiftKey){const n=this._editor.getSelection();if(n){const{selectionStartLineNumber:r,selectionStartColumn:o}=n;i=[new ot(r,o,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map(n=>n.containsPosition(t)?new ot(t.lineNumber,t.column,t.lineNumber,t.column):n);this._editor.setSelections(i||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(M1(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(Up.ID,new pst(this._dragSelection,t,M1(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 W(e.lineNumber,e.column,e.lineNumber,e.column),options:Up._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()}};Up.ID="editor.contrib.dragAndDrop",Up.TRIGGER_KEY_VALUE=ti?6:5,Up._DECORATION_OPTIONS=Ot.register({description:"dnd-target",className:"dnd-target"});let _3=Up;gi(_3.ID,_3,2);gi(Wg.ID,Wg,0);$x(cZ);Ue(new class extends $s{constructor(){super({id:v0e,precondition:ene,kbOpts:{weight:100,primary:2137}})}runEditorCommand(s,e){var t;return(t=Wg.get(e))==null?void 0:t.changePasteType()}});Ue(new class extends $s{constructor(){super({id:"editor.hidePasteWidget",precondition:ene,kbOpts:{weight:100,primary:9}})}runEditorCommand(s,e){var t;(t=Wg.get(e))==null||t.clearWidgets()}});var fC;Pe((fC=class extends Ze{constructor(){super({id:"editor.action.pasteAs",label:w("pasteAs","Paste As..."),alias:"Paste As...",precondition:U.writable,metadata:{description:"Paste as",args:[{name:"args",schema:fC.argsSchema}]}})}run(e,t,i){var r;let n=typeof(i==null?void 0:i.kind)=="string"?i.kind:void 0;return!n&&i&&(n=typeof i.id=="string"?i.id:void 0),(r=Wg.get(t))==null?void 0:r.pasteAs(n?new In(n):void 0)}},fC.argsSchema={type:"object",properties:{kind:{type:"string",description:w("pasteAs.kind","The kind of the paste edit to try applying. If not provided or there are multiple edits for this kind, the editor will show a picker.")}}},fC));Pe(class extends Ze{constructor(){super({id:"editor.action.pasteAsText",label:w("pasteAsText","Paste as Text"),alias:"Paste as Text",precondition:U.writable})}run(s,e){var t;return(t=Wg.get(e))==null?void 0:t.pasteAs({providerId:ly.id})}});class mst{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 oge{constructor(e){this.identifier=e}}const mSe=ii("treeViewsDndService");li(mSe,mst,1);var _st=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},c2=function(s,e){return function(t,i){e(t,i,s)}},YZ;const _Se="editor.experimental.dropIntoEditor.defaultProvider",vSe="editor.changeDropType",pne=new qe("dropWidgetVisible",!1,w("dropWidgetVisible","Whether the drop widget is showing"));var gC;let rx=(gC=class extends re{static get(e){return e.getContribution(YZ.ID)}constructor(e,t,i,n,r){super(),this._configService=i,this._languageFeaturesService=n,this._treeViewsDragAndDropService=r,this.treeItemsTransfer=aZ.getInstance(),this._dropProgressManager=this._register(t.createInstance(s3,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(o3,"dropIntoEditor",e,pne,{id:vSe,label:w("postDropWidgetTitle","Show drop options...")})),this._register(e.onDropIntoEditor(o=>this.onDropIntoEditor(e,o.position,o.event)))}clearWidgets(){this._postDropWidgetManager.clear()}changeDropType(){this._postDropWidgetManager.tryShowSelector()}async onDropIntoEditor(e,t,i){var r;if(!i.dataTransfer||!e.hasModel())return;(r=this._currentOperation)==null||r.cancel(),e.focus(),e.setPosition(t);const n=Zs(async o=>{const a=new me,l=a.add(new p_(e,1,void 0,o));try{const d=await this.extractDataTransferData(i);if(d.size===0||l.token.isCancellationRequested)return;const h=e.getModel();if(!h)return;const f=this._languageFeaturesService.documentDropEditProvider.ordered(h).filter(m=>m.dropMimeTypes?m.dropMimeTypes.some(v=>d.matches(v)):!0),p=a.add(await this.getDropEdits(f,h,t,d,l));if(l.token.isCancellationRequested)return;if(p.edits.length){const m=this.getInitialActiveEditIndex(h,p.edits),v=e.getOption(36).showDropSelector==="afterDrop";await this._postDropWidgetManager.applyEditAndShowIfNeeded([W.fromPositions(t)],{activeEditIndex:m,allEdits:p.edits},v,async b=>b,o)}}finally{a.dispose(),this._currentOperation===n&&(this._currentOperation=void 0)}});this._dropProgressManager.showWhile(t,w("dropIntoEditorProgress","Running drop handlers. Click to cancel"),n,{cancel:()=>n.cancel()}),this._currentOperation=n}async getDropEdits(e,t,i,n,r){const o=new me,a=await hN(Promise.all(e.map(async d=>{try{const h=await d.provideDocumentDropEdits(t,i,n,r.token);return h&&o.add(h),h==null?void 0:h.edits.map(f=>({...f,providerId:d.id}))}catch(h){console.error(h)}})),r.token),l=Dd(a??[]).flat();return{edits:m0e(l),dispose:()=>o.dispose()}}getInitialActiveEditIndex(e,t){const i=this._configService.getValue(_Se,{resource:e.uri});for(const[n,r]of Object.entries(i)){const o=new In(r),a=t.findIndex(l=>o.value===l.providerId&&l.handledMimeType&&l0e(n,[l.handledMimeType]));if(a>=0)return a}return 0}async extractDataTransferData(e){if(!e.dataTransfer)return new a0e;const t=u0e(e.dataTransfer);if(this.treeItemsTransfer.hasData(oge.prototype)){const i=this.treeItemsTransfer.getData(oge.prototype);if(Array.isArray(i))for(const n of i){const r=await this._treeViewsDragAndDropService.removeDragOperationTransfer(n.identifier);if(r)for(const[o,a]of r)t.replace(o,a)}}return t}},YZ=gC,gC.ID="editor.contrib.dropIntoEditorController",gC);rx=YZ=_st([c2(1,ut),c2(2,Gt),c2(3,it),c2(4,mSe)],rx);gi(rx.ID,rx,2);$x(lZ);Ue(new class extends $s{constructor(){super({id:vSe,precondition:pne,kbOpts:{weight:100,primary:2137}})}runEditorCommand(s,e,t){var i;(i=rx.get(e))==null||i.changeDropType()}});Ue(new class extends $s{constructor(){super({id:"editor.hideDropWidget",precondition:pne,kbOpts:{weight:100,primary:9}})}runEditorCommand(s,e,t){var i;(i=rx.get(e))==null||i.clearWidgets()}});Fn.as(Fd.Configuration).registerConfiguration({...yN,properties:{[_Se]:{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"}}}});const fo=class fo{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<this._decorations.length?this._decorations[e]:null;return t?this._editor.getModel().getDecorationRange(t):null}getCurrentMatchesPosition(e){const t=this._editor.getModel().getDecorationsInRange(e);for(const i of t){const n=i.options;if(n===fo._FIND_MATCH_DECORATION||n===fo._CURRENT_FIND_MATCH_DECORATION)return this._getDecorationIndex(i.id)}return 0}setCurrentFindMatch(e){let t=null,i=0;if(e)for(let n=0,r=this._decorations.length;n<r;n++){const o=this._editor.getModel().getDecorationRange(this._decorations[n]);if(e.equalsRange(o)){t=this._decorations[n],i=n+1;break}}return(this._highlightedDecorationId!==null||t!==null)&&this._editor.changeDecorations(n=>{if(this._highlightedDecorationId!==null&&(n.changeDecorationOptions(this._highlightedDecorationId,fo._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,n.changeDecorationOptions(this._highlightedDecorationId,fo._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(n.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let r=this._editor.getModel().getDecorationRange(t);if(r.startLineNumber!==r.endLineNumber&&r.endColumn===1){const o=r.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(o);r=new W(r.startLineNumber,r.startColumn,o,a)}this._rangeHighlightDecorationId=n.addDecoration(r,fo._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let n=fo._FIND_MATCH_DECORATION;const r=[];if(e.length>1e3){n=fo._FIND_MATCH_NO_OVERVIEW_DECORATION;const a=this._editor.getModel().getLineCount(),d=this._editor.getLayoutInfo().height/a,h=Math.max(2,Math.ceil(3/d));let f=e[0].range.startLineNumber,p=e[0].range.endLineNumber;for(let m=1,v=e.length;m<v;m++){const b=e[m].range;p+h>=b.startLineNumber?b.endLineNumber>p&&(p=b.endLineNumber):(r.push({range:new W(f,1,p,1),options:fo._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),f=b.startLineNumber,p=b.endLineNumber)}r.push({range:new W(f,1,p,1),options:fo._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const o=new Array(e.length);for(let a=0,l=e.length;a<l;a++)o[a]={range:e[a].range,options:n};this._decorations=i.deltaDecorations(this._decorations,o),this._overviewRulerApproximateDecorations=i.deltaDecorations(this._overviewRulerApproximateDecorations,r),this._rangeHighlightDecorationId&&(i.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),this._findScopeDecorationIds.length&&(this._findScopeDecorationIds.forEach(a=>i.removeDecoration(a)),this._findScopeDecorationIds=[]),t!=null&&t.length&&(this._findScopeDecorationIds=t.map(a=>i.addDecoration(a,fo._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){const i=this._decorations[t],n=this._editor.getModel().getDecorationRange(i);if(!(!n||n.endLineNumber>e.lineNumber)){if(n.endLineNumber<e.lineNumber)return n;if(!(n.endColumn>e.column))return n}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,i=this._decorations.length;t<i;t++){const n=this._decorations[t],r=this._editor.getModel().getDecorationRange(n);if(!(!r||r.startLineNumber<e.lineNumber)){if(r.startLineNumber>e.lineNumber)return r;if(!(r.startColumn<e.column))return r}}return this._editor.getModel().getDecorationRange(this._decorations[0])}_allDecorations(){let e=[];return e=e.concat(this._decorations),e=e.concat(this._overviewRulerApproximateDecorations),this._findScopeDecorationIds.length&&e.push(...this._findScopeDecorationIds),this._rangeHighlightDecorationId&&e.push(this._rangeHighlightDecorationId),e}};fo._CURRENT_FIND_MATCH_DECORATION=Ot.register({description:"current-find-match",stickiness:1,zIndex:13,className:"currentFindMatch",inlineClassName:"currentFindMatchInline",showIfCollapsed:!0,overviewRuler:{color:qn(az),position:Gl.Center},minimap:{color:qn(wK),position:1}}),fo._FIND_MATCH_DECORATION=Ot.register({description:"find-match",stickiness:1,zIndex:10,className:"findMatch",inlineClassName:"findMatchInline",showIfCollapsed:!0,overviewRuler:{color:qn(az),position:Gl.Center},minimap:{color:qn(wK),position:1}}),fo._FIND_MATCH_NO_OVERVIEW_DECORATION=Ot.register({description:"find-match-no-overview",stickiness:1,className:"findMatch",showIfCollapsed:!0}),fo._FIND_MATCH_ONLY_OVERVIEW_DECORATION=Ot.register({description:"find-match-only-overview",stickiness:1,overviewRuler:{color:qn(az),position:Gl.Center}}),fo._RANGE_HIGHLIGHT_DECORATION=Ot.register({description:"find-range-highlight",stickiness:1,className:"rangeHighlight",isWholeLine:!0}),fo._FIND_SCOPE_DECORATION=Ot.register({description:"find-scope",className:"findScope",isWholeLine:!0});let ZZ=fo;class vst{constructor(e,t,i){this._editorSelection=e,this._ranges=t,this._replaceStrings=i,this._trackedEditorSelectionId=null}getEditOperations(e,t){if(this._ranges.length>0){const i=[];for(let o=0;o<this._ranges.length;o++)i.push({range:this._ranges[o],text:this._replaceStrings[o]});i.sort((o,a)=>W.compareRangesUsingStarts(o.range,a.range));const n=[];let r=i[0];for(let o=1;o<i.length;o++)r.range.endLineNumber===i[o].range.startLineNumber&&r.range.endColumn===i[o].range.startColumn?(r.range=r.range.plusRange(i[o].range),r.text=r.text+i[o].text):(n.push(r),r=i[o]);n.push(r);for(const o of n)t.addEditOperation(o.range,o.text)}this._trackedEditorSelectionId=t.trackSelection(this._editorSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._trackedEditorSelectionId)}}function bSe(s,e){if(s&&s[0]!==""){const t=age(s,e,"-"),i=age(s,e,"_");return t&&!i?lge(s,e,"-"):!t&&i?lge(s,e,"_"):s[0].toUpperCase()===s[0]?e.toUpperCase():s[0].toLowerCase()===s[0]?e.toLowerCase():b5e(s[0][0])&&e.length>0?e[0].toUpperCase()+e.substr(1):s[0][0].toUpperCase()!==s[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function age(s,e,t){return s[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&s[0].split(t).length===e.split(t).length}function lge(s,e,t){const i=e.split(t),n=s[0].split(t);let r="";return i.forEach((o,a)=>{r+=bSe([n[a]],o)+t}),r.slice(0,-1)}class cge{constructor(e){this.staticValue=e,this.kind=0}}class bst{constructor(e){this.pieces=e,this.kind=1}}class ox{static fromStaticValue(e){return new ox([Hb.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new cge(""):e.length===1&&e[0].staticValue!==null?this._state=new cge(e[0].staticValue):this._state=new bst(e)}buildReplaceString(e,t){if(this._state.kind===0)return t?bSe(e,this._state.staticValue):this._state.staticValue;let i="";for(let n=0,r=this._state.pieces.length;n<r;n++){const o=this._state.pieces[n];if(o.staticValue!==null){i+=o.staticValue;continue}let a=ox._substitute(o.matchIndex,e);if(o.caseOps!==null&&o.caseOps.length>0){const l=[],d=o.caseOps.length;let h=0;for(let f=0,p=a.length;f<p;f++){if(h>=d){l.push(a.slice(f));break}switch(o.caseOps[h]){case"U":l.push(a[f].toUpperCase());break;case"u":l.push(a[f].toUpperCase()),h++;break;case"L":l.push(a[f].toLowerCase());break;case"l":l.push(a[f].toLowerCase()),h++;break;default:l.push(a[f])}}a=l.join("")}i+=a}return i}static _substitute(e,t){if(t===null)return"";if(e===0)return t[0];let i="";for(;e>0;){if(e<t.length)return(t[e]||"")+i;i=String(e%10)+i,e=Math.floor(e/10)}return"$"+i}}class Hb{static staticValue(e){return new Hb(e,-1,null)}static caseOps(e,t){return new Hb(null,e,t)}constructor(e,t,i){this.staticValue=e,this.matchIndex=t,!i||i.length===0?this.caseOps=null:this.caseOps=i.slice(0)}}class Cst{constructor(e){this._source=e,this._lastCharIndex=0,this._result=[],this._resultLen=0,this._currentStaticPiece=""}emitUnchanged(e){this._emitStatic(this._source.substring(this._lastCharIndex,e)),this._lastCharIndex=e}emitStatic(e,t){this._emitStatic(e),this._lastCharIndex=t}_emitStatic(e){e.length!==0&&(this._currentStaticPiece+=e)}emitMatchIndex(e,t,i){this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=Hb.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),this._result[this._resultLen++]=Hb.caseOps(e,i),this._lastCharIndex=t}finalize(){return this.emitUnchanged(this._source.length),this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=Hb.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),new ox(this._result)}}function yst(s){if(!s||s.length===0)return new ox(null);const e=[],t=new Cst(s);for(let i=0,n=s.length;i<n;i++){const r=s.charCodeAt(i);if(r===92){if(i++,i>=n)break;const o=s.charCodeAt(i);switch(o){case 92:t.emitUnchanged(i-1),t.emitStatic("\\",i+1);break;case 110:t.emitUnchanged(i-1),t.emitStatic(`
|
|
891
891
|
`,i+1);break;case 116:t.emitUnchanged(i-1),t.emitStatic(" ",i+1);break;case 117:case 85:case 108:case 76:t.emitUnchanged(i-1),t.emitStatic("",i+1),e.push(String.fromCharCode(o));break}continue}if(r===36){if(i++,i>=n)break;const o=s.charCodeAt(i);if(o===36){t.emitUnchanged(i-1),t.emitStatic("$",i+1);continue}if(o===48||o===38){t.emitUnchanged(i-1),t.emitMatchIndex(0,i+1,e),e.length=0;continue}if(49<=o&&o<=57){let a=o-48;if(i+1<n){const l=s.charCodeAt(i+1);if(48<=l&&l<=57){i++,a=a*10+(l-48),t.emitUnchanged(i-2),t.emitMatchIndex(a,i+1,e),e.length=0;continue}}t.emitUnchanged(i-1),t.emitMatchIndex(a,i+1,e),e.length=0;continue}}}return t.finalize()}const Zg=new qe("findWidgetVisible",!1);Zg.toNegated();const FV=new qe("findInputFocussed",!1),mne=new qe("replaceInputFocussed",!1),d2={primary:545,mac:{primary:2593}},u2={primary:565,mac:{primary:2613}},h2={primary:560,mac:{primary:2608}},f2={primary:554,mac:{primary:2602}},g2={primary:558,mac:{primary:2606}},un={StartFindAction:"actions.find",StartFindWithSelection:"actions.findWithSelection",StartFindWithArgs:"editor.actions.findWithArgs",NextMatchFindAction:"editor.action.nextMatchFindAction",PreviousMatchFindAction:"editor.action.previousMatchFindAction",GoToMatchFindAction:"editor.action.goToMatchFindAction",NextSelectionMatchFindAction:"editor.action.nextSelectionMatchFindAction",PreviousSelectionMatchFindAction:"editor.action.previousSelectionMatchFindAction",StartFindReplaceAction:"editor.action.startFindReplaceAction",CloseFindWidgetCommand:"closeFindWidget",ToggleCaseSensitiveCommand:"toggleFindCaseSensitive",ToggleWholeWordCommand:"toggleFindWholeWord",ToggleRegexCommand:"toggleFindRegex",ToggleSearchScopeCommand:"toggleFindInSelection",TogglePreserveCaseCommand:"togglePreserveCase",ReplaceOneAction:"editor.action.replaceOne",ReplaceAllAction:"editor.action.replaceAll",SelectAllMatchesAction:"editor.action.selectAllMatches"},_m=19999,wst=240;class TE{constructor(e,t){this._toDispose=new me,this._editor=e,this._state=t,this._isDisposed=!1,this._startSearchingTimer=new Ad,this._decorations=new ZZ(e),this._toDispose.add(this._decorations),this._updateDecorationsScheduler=new ji(()=>{if(this._editor.hasModel())return this.research(!1)},100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(i=>{(i.reason===3||i.reason===5||i.reason===6)&&this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(i=>{this._ignoreModelContentChanged||(i.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(i=>this._onStateChanged(i))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,Xi(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)},wst)):e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor))}static _getSearchRange(e,t){return t||e.getFullModelRange()}research(e,t){let i=null;typeof t<"u"?t!==null&&(Array.isArray(t)?i=t:i=[t]):i=this._decorations.getFindScopes(),i!==null&&(i=i.map(a=>{if(a.startLineNumber!==a.endLineNumber){let l=a.endLineNumber;return a.endColumn===1&&(l=l-1),new W(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));const n=this._findMatches(i,!1,_m);this._decorations.set(n,i);const r=this._editor.getSelection();let o=this._decorations.getCurrentMatchesPosition(r);if(o===0&&n.length>0){const a=II(n.map(l=>l.range),l=>W.compareRangesUsingStarts(l,r)>=0);o=a>0?a-1+1:o}this._state.changeMatchInfo(o,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:i,column:n}=e;const r=this._editor.getModel();return t||n===1?(i===1?i=r.getLineCount():i--,n=r.getLineMaxColumn(i)):n--,new ie(i,n)}_moveToPrevMatch(e,t=!1){if(!this._state.canNavigateBack()){const h=this._decorations.matchAfterPosition(e);h&&this._setCurrentFindMatch(h);return}if(this._decorations.getCount()<_m){let h=this._decorations.matchBeforePosition(e);h&&h.isEmpty()&&h.getStartPosition().equals(e)&&(e=this._prevSearchPosition(e),h=this._decorations.matchBeforePosition(e)),h&&this._setCurrentFindMatch(h);return}if(this._cannotFind())return;const i=this._decorations.getFindScope(),n=TE._getSearchRange(this._editor.getModel(),i);n.getEndPosition().isBefore(e)&&(e=n.getEndPosition()),e.isBefore(n.getStartPosition())&&(e=n.getEndPosition());const{lineNumber:r,column:o}=e,a=this._editor.getModel();let l=new ie(r,o),d=a.findPreviousMatch(this._state.searchString,l,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(132):null,!1);if(d&&d.range.isEmpty()&&d.range.getStartPosition().equals(l)&&(l=this._prevSearchPosition(l),d=a.findPreviousMatch(this._state.searchString,l,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(132):null,!1)),!!d){if(!t&&!n.containsRange(d.range))return this._moveToPrevMatch(d.range.getStartPosition(),!0);this._setCurrentFindMatch(d.range)}}moveToPrevMatch(){this._moveToPrevMatch(this._editor.getSelection().getStartPosition())}_nextSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:n}=e;const r=this._editor.getModel();return t||n===r.getLineMaxColumn(i)?(i===r.getLineCount()?i=1:i++,n=1):n++,new ie(i,n)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const i=this._decorations.matchBeforePosition(e);i&&this._setCurrentFindMatch(i);return}if(this._decorations.getCount()<_m){let i=this._decorations.matchAfterPosition(e);i&&i.isEmpty()&&i.getStartPosition().equals(e)&&(e=this._nextSearchPosition(e),i=this._decorations.matchAfterPosition(e)),i&&this._setCurrentFindMatch(i);return}const t=this._getNextMatch(e,!1,!0);t&&this._setCurrentFindMatch(t.range)}_getNextMatch(e,t,i,n=!1){if(this._cannotFind())return null;const r=this._decorations.getFindScope(),o=TE._getSearchRange(this._editor.getModel(),r);o.getEndPosition().isBefore(e)&&(e=o.getStartPosition()),e.isBefore(o.getStartPosition())&&(e=o.getStartPosition());const{lineNumber:a,column:l}=e,d=this._editor.getModel();let h=new ie(a,l),f=d.findNextMatch(this._state.searchString,h,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(132):null,t);return i&&f&&f.range.isEmpty()&&f.range.getStartPosition().equals(h)&&(h=this._nextSearchPosition(h),f=d.findNextMatch(this._state.searchString,h,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(132):null,t)),f?!n&&!o.containsRange(f.range)?this._getNextMatch(f.range.getEndPosition(),t,i,!0):f:null}moveToNextMatch(){this._moveToNextMatch(this._editor.getSelection().getEndPosition())}_moveToMatch(e){const t=this._decorations.getDecorationRangeAt(e);t&&this._setCurrentFindMatch(t)}moveToMatch(e){this._moveToMatch(e)}_getReplacePattern(){return this._state.isRegex?yst(this._state.replaceString):ox.fromStaticValue(this._state.replaceString)}replace(){if(!this._hasMatches())return;const e=this._getReplacePattern(),t=this._editor.getSelection(),i=this._getNextMatch(t.getStartPosition(),!0,!1);if(i)if(t.equalsRange(i.range)){const n=e.buildReplaceString(i.matches,this._state.preserveCase),r=new Vr(t,n);this._executeEditorCommand("replace",r),this._decorations.setStartPosition(new ie(t.startLineNumber,t.startColumn+n.length)),this.research(!0)}else this._decorations.setStartPosition(this._editor.getPosition()),this._setCurrentFindMatch(i.range)}_findMatches(e,t,i){const n=(e||[null]).map(r=>TE._getSearchRange(this._editor.getModel(),r));return this._editor.getModel().findMatches(this._state.searchString,n,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(132):null,t,i)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();e===null&&this._state.matchesCount>=_m?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new Vv(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(132):null).parseSearchRequest();if(!t)return;let i=t.regex;if(!i.multiline){let f="mu";i.ignoreCase&&(f+="i"),i.global&&(f+="g"),i=new RegExp(i.source,f)}const n=this._editor.getModel(),r=n.getValue(1),o=n.getFullModelRange(),a=this._getReplacePattern();let l;const d=this._state.preserveCase;a.hasReplacementPatterns||d?l=r.replace(i,function(){return a.buildReplaceString(arguments,d)}):l=r.replace(i,a.buildReplaceString(null,d));const h=new fie(o,l,this._editor.getSelection());this._executeEditorCommand("replaceAll",h)}_regularReplaceAll(e){const t=this._getReplacePattern(),i=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),n=[];for(let o=0,a=i.length;o<a;o++)n[o]=t.buildReplaceString(i[o].matches,this._state.preserveCase);const r=new vst(this._editor.getSelection(),i.map(o=>o.range),n);this._executeEditorCommand("replaceAll",r)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let i=this._findMatches(e,!1,1073741824).map(r=>new ot(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn));const n=this._editor.getSelection();for(let r=0,o=i.length;r<o;r++)if(i[r].equalsRange(n)){i=[n].concat(i.slice(0,r)).concat(i.slice(r+1));break}this._editor.setSelections(i)}_executeEditorCommand(e,t){try{this._ignoreModelContentChanged=!0,this._editor.pushUndoStop(),this._editor.executeCommand(e,t),this._editor.pushUndoStop()}finally{this._ignoreModelContentChanged=!1}}}const iW=class iW extends rc{constructor(e,t,i){super(),this._hideSoon=this._register(new ji(()=>this._hide(),2e3)),this._isVisible=!1,this._editor=e,this._state=t,this._keybindingService=i,this._domNode=document.createElement("div"),this._domNode.className="findOptionsWidget",this._domNode.style.display="none",this._domNode.style.top="10px",this._domNode.style.zIndex="12",this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true");const n={inputActiveOptionBorder:Ge(VH),inputActiveOptionForeground:Ge($H),inputActiveOptionBackground:Ge(mN)},r=this._register($S());this.caseSensitive=this._register(new iwe({appendTitle:this._keybindingLabelFor(un.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase,hoverDelegate:r,...n})),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new nwe({appendTitle:this._keybindingLabelFor(un.ToggleWholeWordCommand),isChecked:this._state.wholeWord,hoverDelegate:r,...n})),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new swe({appendTitle:this._keybindingLabelFor(un.ToggleRegexCommand),isChecked:this._state.isRegex,hoverDelegate:r,...n})),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 a=!1;o.isRegex&&(this.regex.checked=this._state.isRegex,a=!0),o.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,a=!0),o.matchCase&&(this.caseSensitive.checked=this._state.matchCase,a=!0),!this._state.isRevealed&&a&&this._revealTemporarily()})),this._register(ue(this._domNode,Ae.MOUSE_LEAVE,o=>this._onMouseLeave())),this._register(ue(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 iW.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")}};iW.ID="editor.contrib.findOptionsWidget";let XZ=iW;function p2(s,e){return s===1?!0:s===2?!1:e}class Sst extends re{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return p2(this._isRegexOverride,this._isRegex)}get wholeWord(){return p2(this._wholeWordOverride,this._wholeWord)}get matchCase(){return p2(this._matchCaseOverride,this._matchCase)}get preserveCase(){return p2(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,i){const n={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 r=!1;t===0&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,n.matchesPosition=!0,r=!0),this._matchesCount!==t&&(this._matchesCount=t,n.matchesCount=!0,r=!0),typeof i<"u"&&(W.equalsRange(this._currentMatch,i)||(this._currentMatch=i,n.currentMatch=!0,r=!0)),r&&this._onFindReplaceStateChange.fire(n)}change(e,t,i=!0){var h;const n={moveCursor:t,updateHistory:i,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let r=!1;const o=this.isRegex,a=this.wholeWord,l=this.matchCase,d=this.preserveCase;typeof e.searchString<"u"&&this._searchString!==e.searchString&&(this._searchString=e.searchString,n.searchString=!0,r=!0),typeof e.replaceString<"u"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,n.replaceString=!0,r=!0),typeof e.isRevealed<"u"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,n.isRevealed=!0,r=!0),typeof e.isReplaceRevealed<"u"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,n.isReplaceRevealed=!0,r=!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"&&((h=e.searchScope)!=null&&h.every(f=>{var p;return(p=this._searchScope)==null?void 0:p.some(m=>!W.equalsRange(m,f))})||(this._searchScope=e.searchScope,n.searchScope=!0,r=!0)),typeof e.loop<"u"&&this._loop!==e.loop&&(this._loop=e.loop,n.loop=!0,r=!0),typeof e.isSearching<"u"&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,n.isSearching=!0,r=!0),typeof e.filters<"u"&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,n.filters=!0,r=!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,o!==this.isRegex&&(r=!0,n.isRegex=!0),a!==this.wholeWord&&(r=!0,n.wholeWord=!0),l!==this.matchCase&&(r=!0,n.matchCase=!0),d!==this.preserveCase&&(r=!0,n.preserveCase=!0),r&&this._onFindReplaceStateChange.fire(n)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition<this.matchesCount}canNavigateInLoop(){return this._loop||this.matchesCount>=_m}}const xst=w("defaultLabel","input"),kst=w("label.preserveCaseToggle","Preserve Case");class Lst extends Bx{constructor(e){super({icon:Oe.preserveCase,title:kst+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??ta("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Dst extends rc{constructor(e,t,i,n){super(),this._showOptionButtons=i,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=n.placeholder||"",this.validation=n.validation,this.label=n.label||xst;const r=n.appendPreserveCaseLabel||"",o=n.history||[],a=!!n.flexibleHeight,l=!!n.flexibleWidth,d=n.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new rwe(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:o,showHistoryHint:n.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:d,inputBoxStyles:n.inputBoxStyles})),this.preserveCase=this._register(new Lst({appendTitle:r,isChecked:!1,...n.toggleStyles})),this._register(this.preserveCase.onChange(p=>{this._onDidOptionChange.fire(p),!p&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(p=>{this._onPreserveCaseKeyDown.fire(p)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;const h=[this.preserveCase.domNode];this.onkeydown(this.domNode,p=>{if(p.equals(15)||p.equals(17)||p.equals(9)){const m=h.indexOf(this.domNode.ownerDocument.activeElement);if(m>=0){let v=-1;p.equals(17)?v=(m+1)%h.length:p.equals(15)&&(m===0?v=h.length-1:v=m-1),p.equals(9)?(h[m].blur(),this.inputBox.focus()):v>=0&&h[v].focus(),ai.stop(p,!0)}}});const f=document.createElement("div");f.className="controls",f.style.display=this._showOptionButtons?"block":"none",f.appendChild(this.preserveCase.domNode),this.domNode.appendChild(f),e==null||e.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,p=>this._onKeyDown.fire(p)),this.onkeyup(this.inputBox.inputElement,p=>this._onKeyUp.fire(p)),this.oninput(this.inputBox.inputElement,p=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,p=>this._onMouseDown.fire(p))}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.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}var CSe=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},ySe=function(s,e){return function(t,i){e(t,i,s)}};const _ne=new qe("suggestWidgetVisible",!1,w("suggestWidgetVisible","Whether suggestion are visible")),vne="historyNavigationWidgetFocus",wSe="historyNavigationForwardsEnabled",SSe="historyNavigationBackwardsEnabled";let kg;const m2=[];function xSe(s,e){if(m2.includes(e))throw new Error("Cannot register the same widget multiple times");m2.push(e);const t=new me,i=new qe(vne,!1).bindTo(s),n=new qe(wSe,!0).bindTo(s),r=new qe(SSe,!0).bindTo(s),o=()=>{i.set(!0),kg=e},a=()=>{i.set(!1),kg===e&&(kg=void 0)};return CH(e.element)&&o(),t.add(e.onDidFocus(()=>o())),t.add(e.onDidBlur(()=>a())),t.add(dt(()=>{m2.splice(m2.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:n,historyNavigationBackwardsEnablement:r,dispose(){t.dispose()}}}let QZ=class extends owe{constructor(e,t,i,n){super(e,t,i);const r=this._register(n.createScoped(this.inputBox.element));this._register(xSe(r,this.inputBox))}};QZ=CSe([ySe(3,yt)],QZ);let JZ=class extends Dst{constructor(e,t,i,n,r=!1){super(e,t,r,i);const o=this._register(n.createScoped(this.inputBox.element));this._register(xSe(o,this.inputBox))}};JZ=CSe([ySe(3,yt)],JZ);Xo.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:ve.and(ve.has(vne),ve.equals(SSe,!0),ve.not("isComposing"),_ne.isEqualTo(!1)),primary:16,secondary:[528],handler:s=>{kg==null||kg.showPreviousValue()}});Xo.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:ve.and(ve.has(vne),ve.equals(wSe,!0),ve.not("isComposing"),_ne.isEqualTo(!1)),primary:18,secondary:[530],handler:s=>{kg==null||kg.showNextValue()}});function dge(s){var e,t;return((e=s.lookupKeybinding("history.showPrevious"))==null?void 0:e.getElectronAccelerator())==="Up"&&((t=s.lookupKeybinding("history.showNext"))==null?void 0:t.getElectronAccelerator())==="Down"}const uge=mn("find-collapsed",Oe.chevronRight,w("findCollapsedIcon","Icon to indicate that the editor find widget is collapsed.")),hge=mn("find-expanded",Oe.chevronDown,w("findExpandedIcon","Icon to indicate that the editor find widget is expanded.")),Est=mn("find-selection",Oe.selection,w("findSelectionIcon","Icon for 'Find in Selection' in the editor find widget.")),Ist=mn("find-replace",Oe.replace,w("findReplaceIcon","Icon for 'Replace' in the editor find widget.")),Tst=mn("find-replace-all",Oe.replaceAll,w("findReplaceAllIcon","Icon for 'Replace All' in the editor find widget.")),Nst=mn("find-previous-match",Oe.arrowUp,w("findPreviousMatchIcon","Icon for 'Find Previous' in the editor find widget.")),Mst=mn("find-next-match",Oe.arrowDown,w("findNextMatchIcon","Icon for 'Find Next' in the editor find widget.")),Rst=w("label.findDialog","Find / Replace"),Pst=w("label.find","Find"),Ost=w("placeholder.find","Find"),Ast=w("label.previousMatchButton","Previous Match"),Fst=w("label.nextMatchButton","Next Match"),Bst=w("label.toggleSelectionFind","Find in Selection"),Wst=w("label.closeButton","Close"),Hst=w("label.replace","Replace"),Vst=w("placeholder.replace","Replace"),$st=w("label.replaceButton","Replace"),zst=w("label.replaceAllButton","Replace All"),jst=w("label.toggleReplaceButton","Toggle Replace"),Ust=w("title.matchesCountLimit","Only the first {0} results are highlighted, but all find operations work on the entire text.",_m),qst=w("label.matchesLocation","{0} of {1}"),fge=w("label.noResults","No results"),hh=419,Kst=275,Gst=Kst-54;let vD=69;const Yst=33,gge="ctrlEnterReplaceAll.windows.donotask",pge=ti?256:2048;class hj{constructor(e){this.afterLineNumber=e,this.heightInPx=Yst,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function mge(s,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionStart>0){s.stopPropagation();return}}function _ge(s,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionEnd<t.value.length){s.stopPropagation();return}}const nW=class nW extends rc{constructor(e,t,i,n,r,o,a,l,d,h){super(),this._hoverService=h,this._cachedHeight=null,this._revealTimeouts=[],this._codeEditor=e,this._controller=t,this._state=i,this._contextViewProvider=n,this._keybindingService=r,this._contextKeyService=o,this._storageService=l,this._notificationService=d,this._ctrlEnterReplaceAllWarningPrompted=!!l.getBoolean(gge,0),this._isVisible=!1,this._isReplaceVisible=!1,this._ignoreChangeEvent=!1,this._updateHistoryDelayer=new Ac(500),this._register(dt(()=>this._updateHistoryDelayer.cancel())),this._register(this._state.onFindReplaceStateChange(f=>this._onStateChanged(f))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration(f=>{if(f.hasChanged(92)&&(this._codeEditor.getOption(92)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),f.hasChanged(146)&&this._tryUpdateWidgetWidth(),f.hasChanged(2)&&this.updateAccessibilitySupport(),f.hasChanged(41)){const p=this._codeEditor.getOption(41).loop;this._state.change({loop:p},!1);const m=this._codeEditor.getOption(41).addExtraSpaceOnTop;m&&!this._viewZone&&(this._viewZone=new hj(0),this._showViewZone()),!m&&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 f=await this._controller.getGlobalBufferTerm();f&&f!==this._state.searchString&&(this._state.change({searchString:f},!1),this._findInput.select())}})),this._findInputFocused=FV.bindTo(o),this._findFocusTracker=this._register(Pu(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=mne.bindTo(o),this._replaceFocusTracker=this._register(Pu(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 hj(0)),this._register(this._codeEditor.onDidChangeModel(()=>{this._isVisible&&(this._viewZoneId=void 0)})),this._register(this._codeEditor.onDidScrollChange(f=>{if(f.scrollTopChanged){this._layoutViewZone();return}setTimeout(()=>{this._layoutViewZone()},0)}))}getId(){return nW.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(92)&&!this._isReplaceVisible&&(this._isReplaceVisible=!0,this._replaceInput.width=Ga(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,Tt)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){var t;this._matchesCount.style.minWidth=vD+"px",this._state.matchesCount>=_m?this._matchesCount.title=Ust:this._matchesCount.title="",(t=this._matchesCount.firstChild)==null||t.remove();let e;if(this._state.matchesCount>0){let i=String(this._state.matchesCount);this._state.matchesCount>=_m&&(i+="+");let n=String(this._state.matchesPosition);n==="0"&&(n="?"),e=qC(qst,n,i)}else e=fge;this._matchesCount.appendChild(document.createTextNode(e)),Qo(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),vD=Math.max(vD,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===fge)return i===""?w("ariaSearchNoResultEmpty","{0} found",e):w("ariaSearchNoResult","{0} found for '{1}'",e,i);if(t){const n=w("ariaSearchNoResultWithLineNum","{0} found for '{1}', at {2}",e,i,t.startLineNumber+":"+t.startColumn),r=this._codeEditor.getModel();return r&&t.startLineNumber<=r.getLineCount()&&t.startLineNumber>=1?`${r.getLineContent(t.startLineNumber)}, ${n}`:n}return w("ariaSearchNoResultWithLineNumNoCurrentMatch","{0} found for '{1}'",e,i)}_updateToggleSelectionFindButton(){const e=this._codeEditor.getSelection(),t=e?e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn:!1,i=this._toggleSelectionFind.checked;this._isVisible&&(i||t)?this._toggleSelectionFind.enable():this._toggleSelectionFind.disable()}_updateButtons(){this._findInput.setEnabled(this._isVisible),this._replaceInput.setEnabled(this._isVisible&&this._isReplaceVisible),this._updateToggleSelectionFindButton(),this._closeBtn.setEnabled(this._isVisible);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 i=!this._codeEditor.getOption(92);this._toggleReplaceBtn.setEnabled(this._isVisible&&i)}_reveal(){if(this._revealTimeouts.forEach(e=>{clearTimeout(e)}),this._revealTimeouts=[],!this._isVisible){this._isVisible=!0;const e=this._codeEditor.getSelection();switch(this._codeEditor.getOption(41).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":{const i=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=i;break}}this._tryUpdateWidgetWidth(),this._updateButtons(),this._revealTimeouts.push(setTimeout(()=>{this._domNode.classList.add("visible"),this._domNode.setAttribute("aria-hidden","false")},0)),this._revealTimeouts.push(setTimeout(()=>{this._findInput.validate()},200)),this._codeEditor.layoutOverlayWidget(this);let t=!0;if(this._codeEditor.getOption(41).seedSearchStringFromSelection&&e){const i=this._codeEditor.getDomNode();if(i){const n=ts(i),r=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),o=n.left+(r?r.left:0),a=r?r.top:0;if(this._viewZone&&a<this._viewZone.heightInPx){e.endLineNumber>e.startLineNumber&&(t=!1);const l=rbe(this._domNode).left;o>l&&(t=!1);const d=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());n.left+(d?d.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 i=this._viewZone;this._viewZoneId!==void 0||!i||this._codeEditor.changeViewZones(n=>{i.heightInPx=this._getHeight(),this._viewZoneId=n.addZone(i),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+i.heightInPx)})}_showViewZone(e=!0){if(!this._isVisible||!this._codeEditor.getOption(41).addExtraSpaceOnTop)return;this._viewZone===void 0&&(this._viewZone=new hj(0));const i=this._viewZone;this._codeEditor.changeViewZones(n=>{if(this._viewZoneId!==void 0){const r=this._getHeight();if(r===i.heightInPx)return;const o=r-i.heightInPx;i.heightInPx=r,n.layoutZone(this._viewZoneId),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+o);return}else{let r=this._getHeight();if(r-=this._codeEditor.getOption(84).top,r<=0)return;i.heightInPx=r,this._viewZoneId=n.addZone(i),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+r)}})}_removeViewZone(){this._codeEditor.changeViewZones(e=>{this._viewZoneId!==void 0&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0,this._viewZone&&(this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()-this._viewZone.heightInPx),this._viewZone=void 0))})}_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 i=e.width,n=e.minimap.minimapWidth;let r=!1,o=!1,a=!1;if(this._resized&&Ga(this._domNode)>hh){this._domNode.style.maxWidth=`${i-28-n-15}px`,this._replaceInput.width=Ga(this._findInput.domNode);return}if(hh+28+n>=i&&(o=!0),hh+28+n-vD>=i&&(a=!0),hh+28+n-vD>=i+50&&(r=!0),this._domNode.classList.toggle("collapsed-find-widget",r),this._domNode.classList.toggle("narrow-find-widget",a),this._domNode.classList.toggle("reduced-find-widget",o),!a&&!r&&(this._domNode.style.maxWidth=`${i-28-n-15}px`),this._findInput.layout({collapsedFindWidget:r,narrowFindWidget:a,reducedFindWidget:o}),this._resized){const l=this._findInput.inputBox.element.clientWidth;l>0&&(this._replaceInput.width=l)}else this._isReplaceVisible&&(this._replaceInput.width=Ga(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 i=this._state.currentMatch;return t.startLineNumber!==t.endLineNumber&&!W.equalsRange(t,i)?t:null}).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){if(e.equals(pge|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._findInput.inputBox.insertAtCursor(`
|
|
892
892
|
`),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 mge(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return _ge(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(pge|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{Ur&&Gh&&!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(gge,!0,0,0)),this._replaceInput.inputBox.insertAtCursor(`
|
|
893
|
-
`),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 mge(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return _ge(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 QZ(null,this._contextViewProvider,{width:Gst,label:Pst,placeholder:Ost,appendCaseSensitiveLabel:this._keybindingLabelFor(un.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(un.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(un.ToggleRegexCommand),validation:h=>{if(h.length===0||!this._findInput.getRegex())return null;try{return new RegExp(h,"gu"),null}catch(f){return{content:f.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>dge(this._keybindingService),inputBoxStyles:J4,toggleStyles:Q4},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(h=>this._onFindInputKeyDown(h))),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(h=>{h.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),h.preventDefault())})),this._register(this._findInput.onRegexKeyDown(h=>{h.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),h.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(h=>{this._tryUpdateHeight()&&this._showViewZone()})),Yo&&this._register(this._findInput.onMouseDown(h=>this._onFindInputMouseDown(h))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount();const i=this._register($S());this._prevBtn=this._register(new R1({label:Ast+this._keybindingLabelFor(un.PreviousMatchFindAction),icon:Nst,hoverDelegate:i,onTrigger:()=>{rm(this._codeEditor.getAction(un.PreviousMatchFindAction)).run().then(void 0,Tt)}},this._hoverService)),this._nextBtn=this._register(new R1({label:Fst+this._keybindingLabelFor(un.NextMatchFindAction),icon:Mst,hoverDelegate:i,onTrigger:()=>{rm(this._codeEditor.getAction(un.NextMatchFindAction)).run().then(void 0,Tt)}},this._hoverService));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 Bx({icon:Est,title:Bst+this._keybindingLabelFor(un.ToggleSearchScopeCommand),isChecked:!1,hoverDelegate:i,inputActiveOptionBackground:Ge(mN),inputActiveOptionBorder:Ge(VH),inputActiveOptionForeground:Ge($H)})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){let h=this._codeEditor.getSelections();h=h.map(f=>(f.endColumn===1&&f.endLineNumber>f.startLineNumber&&(f=f.setEndPosition(f.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(f.endLineNumber-1))),f.isEmpty()?null:f)).filter(f=>!!f),h.length&&this._state.change({searchScope:h},!0)}}else this._state.change({searchScope:null},!0)})),r.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new R1({label:Wst+this._keybindingLabelFor(un.CloseFindWidgetCommand),icon:Awe,hoverDelegate:i,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:h=>{h.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),h.preventDefault())}},this._hoverService)),this._replaceInput=this._register(new JZ(null,void 0,{label:Hst,placeholder:Vst,appendPreserveCaseLabel:this._keybindingLabelFor(un.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>dge(this._keybindingService),inputBoxStyles:J4,toggleStyles:Q4},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown(h=>this._onReplaceInputKeyDown(h))),this._register(this._replaceInput.inputBox.onDidChange(()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)})),this._register(this._replaceInput.inputBox.onDidHeightChange(h=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()})),this._register(this._replaceInput.onDidOptionChange(()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)})),this._register(this._replaceInput.onPreserveCaseKeyDown(h=>{h.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(),h.preventDefault())}));const o=this._register($S());this._replaceBtn=this._register(new R1({label:$st+this._keybindingLabelFor(un.ReplaceOneAction),icon:Ist,hoverDelegate:o,onTrigger:()=>{this._controller.replace()},onKeyDown:h=>{h.equals(1026)&&(this._closeBtn.focus(),h.preventDefault())}},this._hoverService)),this._replaceAllBtn=this._register(new R1({label:zst+this._keybindingLabelFor(un.ReplaceAllAction),icon:Tst,hoverDelegate:o,onTrigger:()=>{this._controller.replaceAll()}},this._hoverService));const a=document.createElement("div");a.className="replace-part",a.appendChild(this._replaceInput.domNode);const l=document.createElement("div");l.className="replace-actions",a.appendChild(l),l.appendChild(this._replaceBtn.domNode),l.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new R1({label:jst,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=Ga(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}},this._hoverService)),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=Rst,this._domNode.role="dialog",this._domNode.style.width=`${hh}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(n),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(a),this._resizeSash=this._register(new Qr(this._domNode,this,{orientation:0,size:2})),this._resized=!1;let d=hh;this._register(this._resizeSash.onDidStart(()=>{d=Ga(this._domNode)})),this._register(this._resizeSash.onDidChange(h=>{this._resized=!0;const f=d+h.startX-h.currentX;if(f<hh)return;const p=parseFloat(bH(this._domNode).maxWidth)||0;f>p||(this._domNode.style.width=`${f}px`,this._isReplaceVisible&&(this._replaceInput.width=Ga(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const h=Ga(this._domNode);if(h<hh)return;let f=hh;if(!this._resized||h===hh){const p=this._codeEditor.getLayoutInfo();f=p.width-28-p.minimap.minimapWidth-15,this._resized=!0}this._domNode.style.width=`${f}px`,this._isReplaceVisible&&(this._replaceInput.width=Ga(this._findInput.domNode)),this._findInput.inputBox.layout()}))}updateAccessibilitySupport(){const e=this._codeEditor.getOption(2);this._findInput.setFocusInputOnOptionClick(e!==2)}};nW.ID="editor.contrib.findWidget";let eX=nW;class R1 extends rc{constructor(e,t){super(),this._opts=e;let i="button";this._opts.className&&(i=i+" "+this._opts.className),this._opts.icon&&(i=i+" "+bt.asClassName(this._opts.icon)),this._domNode=document.createElement("div"),this._domNode.tabIndex=0,this._domNode.className=i,this._domNode.setAttribute("role","button"),this._domNode.setAttribute("aria-label",this._opts.label),this._register(t.setupManagedHover(e.hoverDelegate??ta("element"),this._domNode,this._opts.label)),this.onclick(this._domNode,n=>{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.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(...bt.asClassNameArray(uge)),this._domNode.classList.add(...bt.asClassNameArray(hge))):(this._domNode.classList.remove(...bt.asClassNameArray(hge)),this._domNode.classList.add(...bt.asClassNameArray(uge)))}}jc((s,e)=>{const t=s.getColor(lm);t&&e.addRule(`.monaco-editor .findMatch { border: 1px ${Eu(s.type)?"dotted":"solid"} ${t}; box-sizing: border-box; }`);const i=s.getColor(wVe);i&&e.addRule(`.monaco-editor .findScope { border: 1px ${Eu(s.type)?"dashed":"solid"} ${i}; }`);const n=s.getColor(fi);n&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${n}; }`);const r=s.getColor(CVe);r&&e.addRule(`.monaco-editor .findMatchInline { color: ${r}; }`);const o=s.getColor(yVe);o&&e.addRule(`.monaco-editor .currentFindMatchInline { color: ${o}; }`)});var kSe=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},wc=function(s,e){return function(t,i){e(t,i,s)}},tX;const Zst=524288;function iX(s,e="single",t=!1){if(!s.hasModel())return null;const i=s.getSelection();if(e==="single"&&i.startLineNumber===i.endLineNumber||e==="multiple"){if(i.isEmpty()){const n=s.getConfiguredWordAtPosition(i.getStartPosition());if(n&&t===!1)return n.word}else if(s.getModel().getValueLengthInRange(i)<Zst)return s.getModel().getValueInRange(i)}return null}var pC;let La=(pC=class extends re{get editor(){return this._editor}static get(e){return e.getContribution(tX.ID)}constructor(e,t,i,n,r,o){super(),this._editor=e,this._findWidgetVisible=Zg.bindTo(t),this._contextKeyService=t,this._storageService=i,this._clipboardService=n,this._notificationService=r,this._hoverService=o,this._updateHistoryDelayer=new Ac(500),this._state=this._register(new Sst),this.loadQueryState(),this._register(this._state.onFindReplaceStateChange(a=>this._onStateChanged(a))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{const a=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),a&&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!!FV.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=Xl(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}async _start(e,t){if(this.disposeModel(),!this._editor.hasModel())return;const i={...t,isRevealed:!0};if(e.seedSearchStringFromSelection==="single"){const n=iX(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);n&&(this._state.isRegex?i.searchString=Xl(n):i.searchString=n)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const n=iX(this._editor,e.seedSearchStringFromSelection);n&&(i.searchString=n)}if(!i.searchString&&e.seedSearchStringFromGlobalClipboard){const n=await this.getGlobalBufferTerm();if(!this._editor.hasModel())return;n&&(i.searchString=n)}if(e.forceRevealReplace||i.isReplaceRevealed?i.isReplaceRevealed=!0:this._findWidgetVisible.get()||(i.isReplaceRevealed=!1),e.updateSearchScope){const n=this._editor.getSelections();n.some(r=>!r.isEmpty())&&(i.searchScope=n)}i.loop=e.loop,this._state.change(i,!1),this._model||(this._model=new TE(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.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)}},tX=pC,pC.ID="editor.contrib.findController",pC);La=tX=kSe([wc(1,yt),wc(2,Bd),wc(3,Yg),wc(4,gs),wc(5,df)],La);let nX=class extends La{constructor(e,t,i,n,r,o,a,l,d){super(e,i,a,l,o,d),this._contextViewService=t,this._keybindingService=n,this._themeService=r,this._widget=null,this._findOptionsWidget=null}async _start(e,t){this._widget||this._createFindWidget();const i=this._editor.getSelection();let n=!1;switch(this._editor.getOption(41).autoFindInSelection){case"always":n=!0;break;case"never":n=!1;break;case"multiline":{n=!!i&&i.startLineNumber!==i.endLineNumber;break}}e.updateSearchScope=e.updateSearchScope||n,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 eX(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService,this._hoverService)),this._findOptionsWidget=this._register(new XZ(this._editor,this._state,this._keybindingService))}};nX=kSe([wc(1,qg),wc(2,yt),wc(3,Mi),wc(4,zs),wc(5,gs),wc(6,Bd),wc(7,Yg),wc(8,df)],nX);const Xst=wbe(new ybe({id:un.StartFindAction,label:w("startFindAction","Find"),alias:"Find",precondition:ve.or(U.focus,ve.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:st.MenubarEditMenu,group:"3_find",title:w({key:"miFind",comment:["&& denotes a mnemonic"]},"&&Find"),order:1}}));Xst.addImplementation(0,(s,e,t)=>{const i=La.get(e);return i?i.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 Qst={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 Jst extends Ze{constructor(){super({id:un.StartFindWithArgs,label:w("startFindWithArgsAction","Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},metadata:Qst})}async run(e,t,i){const n=La.get(t);if(n){const r=i?{searchString:i.searchString,replaceString:i.replaceString,isReplaceRevealed:i.replaceString!==void 0,isRegex:i.isRegex,wholeWord:i.matchWholeWord,matchCase:i.isCaseSensitive,preserveCase:i.preserveCase}:{};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:1,shouldAnimate:!0,updateSearchScope:(i==null?void 0:i.findInSelection)||!1,loop:t.getOption(41).loop},r),n.setGlobalBufferTerm(n.getState().searchString)}}}class ert extends Ze{constructor(){super({id:un.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 i=La.get(t);i&&(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),i.setGlobalBufferTerm(i.getState().searchString))}}class LSe extends Ze{async run(e,t){const i=La.get(t);i&&!this._run(i)&&(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:i.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(i))}}class trt extends LSe{constructor(){super({id:un.NextMatchFindAction,label:w("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:U.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:ve.and(U.focus,FV),primary:3,weight:100}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class irt extends LSe{constructor(){super({id:un.PreviousMatchFindAction,label:w("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:U.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:ve.and(U.focus,FV),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}class nrt extends Ze{constructor(){super({id:un.GoToMatchFindAction,label:w("findMatchAction.goToMatch","Go to Match..."),alias:"Go to Match...",precondition:Zg}),this._highlightDecorations=[]}run(e,t,i){const n=La.get(t);if(!n)return;const r=n.getState().matchesCount;if(r<1){e.get(gs).notify({severity:OH.Warning,message:w("findMatchAction.noResults","No matches. Try searching for something else.")});return}const o=e.get(Uc),a=new me,l=a.add(o.createInputBox());l.placeholder=w("findMatchAction.inputPlaceHolder","Type a number to go to a specific match (between 1 and {0})",r);const d=f=>{const p=parseInt(f);if(isNaN(p))return;const m=n.getState().matchesCount;if(p>0&&p<=m)return p-1;if(p<0&&p>=-m)return m+p},h=f=>{const p=d(f);if(typeof p=="number"){l.validationMessage=void 0,n.goToMatch(p);const m=n.getState().currentMatch;m&&this.addDecorations(t,m)}else l.validationMessage=w("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",n.getState().matchesCount),this.clearDecorations(t)};a.add(l.onDidChangeValue(f=>{h(f)})),a.add(l.onDidAccept(()=>{const f=d(l.value);typeof f=="number"?(n.goToMatch(f),l.hide()):l.validationMessage=w("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",n.getState().matchesCount)})),a.add(l.onDidHide(()=>{this.clearDecorations(t),a.dispose()})),l.show()}clearDecorations(e){e.changeDecorations(t=>{this._highlightDecorations=t.deltaDecorations(this._highlightDecorations,[])})}addDecorations(e,t){e.changeDecorations(i=>{this._highlightDecorations=i.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:qn(Sye),position:Gl.Full}}}])})}}class DSe extends Ze{async run(e,t){const i=La.get(t);if(!i)return;const n=iX(t,"single",!1);n&&i.setSearchString(n),this._run(i)||(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(i))}}class srt extends DSe{constructor(){super({id:un.NextSelectionMatchFindAction,label:w("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:U.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class rrt extends DSe{constructor(){super({id:un.PreviousSelectionMatchFindAction,label:w("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:U.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const ort=wbe(new ybe({id:un.StartFindReplaceAction,label:w("startReplace","Replace"),alias:"Replace",precondition:ve.or(U.focus,ve.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:st.MenubarEditMenu,group:"3_find",title:w({key:"miReplace",comment:["&& denotes a mnemonic"]},"&&Replace"),order:2}}));ort.addImplementation(0,(s,e,t)=>{if(!e.hasModel()||e.getOption(92))return!1;const i=La.get(e);if(!i)return!1;const n=e.getSelection(),r=i.isFindInputFocused(),o=!n.isEmpty()&&n.startLineNumber===n.endLineNumber&&e.getOption(41).seedSearchStringFromSelection!=="never"&&!r,a=r||o?2:1;return i.start({forceRevealReplace:!0,seedSearchStringFromSelection:o?"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})});gi(La.ID,nX,0);Pe(Jst);Pe(ert);Pe(trt);Pe(irt);Pe(nrt);Pe(srt);Pe(rrt);const Ku=$s.bindToContribution(La.get);Ue(new Ku({id:un.CloseFindWidgetCommand,precondition:Zg,handler:s=>s.closeFindWidget(),kbOpts:{weight:105,kbExpr:ve.and(U.focus,ve.not("isComposing")),primary:9,secondary:[1033]}}));Ue(new Ku({id:un.ToggleCaseSensitiveCommand,precondition:void 0,handler:s=>s.toggleCaseSensitive(),kbOpts:{weight:105,kbExpr:U.focus,primary:d2.primary,mac:d2.mac,win:d2.win,linux:d2.linux}}));Ue(new Ku({id:un.ToggleWholeWordCommand,precondition:void 0,handler:s=>s.toggleWholeWords(),kbOpts:{weight:105,kbExpr:U.focus,primary:u2.primary,mac:u2.mac,win:u2.win,linux:u2.linux}}));Ue(new Ku({id:un.ToggleRegexCommand,precondition:void 0,handler:s=>s.toggleRegex(),kbOpts:{weight:105,kbExpr:U.focus,primary:h2.primary,mac:h2.mac,win:h2.win,linux:h2.linux}}));Ue(new Ku({id:un.ToggleSearchScopeCommand,precondition:void 0,handler:s=>s.toggleSearchScope(),kbOpts:{weight:105,kbExpr:U.focus,primary:f2.primary,mac:f2.mac,win:f2.win,linux:f2.linux}}));Ue(new Ku({id:un.TogglePreserveCaseCommand,precondition:void 0,handler:s=>s.togglePreserveCase(),kbOpts:{weight:105,kbExpr:U.focus,primary:g2.primary,mac:g2.mac,win:g2.win,linux:g2.linux}}));Ue(new Ku({id:un.ReplaceOneAction,precondition:Zg,handler:s=>s.replace(),kbOpts:{weight:105,kbExpr:U.focus,primary:3094}}));Ue(new Ku({id:un.ReplaceOneAction,precondition:Zg,handler:s=>s.replace(),kbOpts:{weight:105,kbExpr:ve.and(U.focus,mne),primary:3}}));Ue(new Ku({id:un.ReplaceAllAction,precondition:Zg,handler:s=>s.replaceAll(),kbOpts:{weight:105,kbExpr:U.focus,primary:2563}}));Ue(new Ku({id:un.ReplaceAllAction,precondition:Zg,handler:s=>s.replaceAll(),kbOpts:{weight:105,kbExpr:ve.and(U.focus,mne),primary:void 0,mac:{primary:2051}}}));Ue(new Ku({id:un.SelectAllMatchesAction,precondition:Zg,handler:s=>s.selectAllMatches(),kbOpts:{weight:105,kbExpr:U.focus,primary:515}}));const art={0:" ",1:"u",2:"r"},vge=65535,du=16777215,bge=4278190080;class fj{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,i=e%32;return(this._states[t]&1<<i)!==0}set(e,t){const i=e/32|0,n=e%32,r=this._states[i];t?this._states[i]=r|1<<n:this._states[i]=r&~(1<<n)}}class Bl{constructor(e,t,i){if(e.length!==t.length||e.length>vge)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new fj(e.length),this._userDefinedStates=new fj(e.length),this._recoveredStates=new fj(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(i,n)=>{const r=e[e.length-1];return this.getStartLineNumber(r)<=i&&this.getEndLineNumber(r)>=n};for(let i=0,n=this._startIndexes.length;i<n;i++){const r=this._startIndexes[i],o=this._endIndexes[i];if(r>du||o>du)throw new Error("startLineNumber or endLineNumber must not exceed "+du);for(;e.length>0&&!t(r,o);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=r+((a&255)<<24),this._endIndexes[i]=o+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&du}getEndLineNumber(e){return this._endIndexes[e]&du}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 i=!1;if(this._types)for(let n=0;n<this._types.length;n++)this._types[n]===e&&(this.setCollapsed(n,t),i=!0);return i}toRegion(e){return new lrt(this,e)}getParentIndex(e){this.ensureParentIndices();const t=((this._startIndexes[e]&bge)>>>24)+((this._endIndexes[e]&bge)>>>16);return t===vge?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,i=this._startIndexes.length;if(i===0)return-1;for(;t<i;){const n=Math.floor((t+i)/2);e<this.getStartLineNumber(n)?i=n:t=n+1}return t-1}findRange(e){let t=this.findIndex(e);if(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;t<this.length;t++)e[t]=`[${art[this.getSource(t)]}${this.isCollapsed(t)?"+":"-"}] ${this.getStartLineNumber(t)}/${this.getEndLineNumber(t)}`;return e.join(", ")}toFoldRange(e){return{startLineNumber:this._startIndexes[e]&du,endLineNumber:this._endIndexes[e]&du,type:this._types?this._types[e]:void 0,isCollapsed:this.isCollapsed(e),source:this.getSource(e)}}static fromFoldRanges(e){const t=e.length,i=new Uint32Array(t),n=new Uint32Array(t);let r=[],o=!1;for(let l=0;l<t;l++){const d=e[l];i[l]=d.startLineNumber,n[l]=d.endLineNumber,r.push(d.type),d.type&&(o=!0)}o||(r=void 0);const a=new Bl(i,n,r);for(let l=0;l<t;l++)e[l].isCollapsed&&a.setCollapsed(l,!0),a.setSource(l,e[l].source);return a}static sanitizeAndMerge(e,t,i,n){i=i??Number.MAX_VALUE;const r=(y,x)=>Array.isArray(y)?D=>D<x?y[D]:void 0:D=>D<x?y.toFoldRange(D):void 0,o=r(e,e.length),a=r(t,t.length);let l=0,d=0,h=o(0),f=a(0);const p=[];let m,v=0;const b=[];for(;h||f;){let y;if(f&&(!h||h.startLineNumber>=f.startLineNumber))h&&h.startLineNumber===f.startLineNumber?(f.source===1?y=f:(y=h,y.isCollapsed=f.isCollapsed&&(h.endLineNumber===f.endLineNumber||!(n!=null&&n.startsInside(h.startLineNumber+1,h.endLineNumber+1))),y.source=0),h=o(++l)):(y=f,f.isCollapsed&&f.source===0&&(y.source=2)),f=a(++d);else{let x=d,D=f;for(;;){if(!D||D.startLineNumber>h.endLineNumber){y=h;break}if(D.source===1&&D.endLineNumber>h.endLineNumber)break;D=a(++x)}h=o(++l)}if(y){for(;m&&m.endLineNumber<y.startLineNumber;)m=p.pop();y.endLineNumber>y.startLineNumber&&y.startLineNumber>v&&y.endLineNumber<=i&&(!m||m.endLineNumber>=y.endLineNumber)&&(b.push(y),v=y.startLineNumber,m&&p.push(m),m=y)}}return b}}class lrt{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 crt{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 Bl(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(e){if(!e.length)return;e=e.sort((i,n)=>i.regionIndex-n.regionIndex);const t={};this._decorationProvider.changeDecorations(i=>{let n=0,r=-1,o=-1;const a=l=>{for(;n<l;){const d=this._regions.getEndLineNumber(n),h=this._regions.isCollapsed(n);if(d<=r){const f=this.regions.getSource(n)!==0;i.changeDecorationOptions(this._editorDecorationIds[n],this._decorationProvider.getDecorationOption(h,d<=o,f))}h&&d>o&&(o=d),n++}};for(const l of e){const d=l.regionIndex,h=this._editorDecorationIds[d];if(h&&!t[h]){t[h]=!0,a(d);const f=!this._regions.isCollapsed(d);this._regions.setCollapsed(d,f),r=Math.max(r,this._regions.getEndLineNumber(d))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,i=n=>{for(const r of e)if(!(r.startLineNumber>n.endLineNumber||n.startLineNumber>r.endLineNumber))return!0;return!1};for(let n=0;n<this._regions.length;n++){const r=this._regions.toFoldRange(n);(r.source===0||!i(r))&&t.push(r)}this.updatePost(Bl.fromFoldRanges(t))}update(e,t){const i=this._currentFoldedOrManualRanges(t),n=Bl.sanitizeAndMerge(e,i,this._textModel.getLineCount(),t);this.updatePost(Bl.fromFoldRanges(n))}updatePost(e){const t=[];let i=-1;for(let n=0,r=e.length;n<r;n++){const o=e.getStartLineNumber(n),a=e.getEndLineNumber(n),l=e.isCollapsed(n),d=e.getSource(n)!==0,h={startLineNumber:o,startColumn:this._textModel.getLineMaxColumn(o),endLineNumber:a,endColumn:this._textModel.getLineMaxColumn(a)+1};t.push({range:h,options:this._decorationProvider.getDecorationOption(l,a<=i,d)}),l&&a>i&&(i=a)}this._decorationProvider.changeDecorations(n=>this._editorDecorationIds=n.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e){const t=[];for(let i=0,n=this._regions.length;i<n;i++){let r=this.regions.isCollapsed(i);const o=this.regions.getSource(i);if(r||o!==0){const a=this._regions.toFoldRange(i),l=this._textModel.getDecorationRange(this._editorDecorationIds[i]);l&&(r&&(e!=null&&e.startsInside(l.startLineNumber+1,l.endLineNumber))&&(r=!1),t.push({startLineNumber:l.startLineNumber,endLineNumber:l.endLineNumber,type:a.type,isCollapsed:r,source:o}))}}return t}getMemento(){const e=this._currentFoldedOrManualRanges(),t=[],i=this._textModel.getLineCount();for(let n=0,r=e.length;n<r;n++){const o=e[n];if(o.startLineNumber>=o.endLineNumber||o.startLineNumber<1||o.endLineNumber>i)continue;const a=this._getLinesChecksum(o.startLineNumber+1,o.endLineNumber);t.push({startLineNumber:o.startLineNumber,endLineNumber:o.endLineNumber,isCollapsed:o.isCollapsed,source:o.source,checksum:a})}return t.length>0?t:void 0}applyMemento(e){if(!Array.isArray(e))return;const t=[],i=this._textModel.getLineCount();for(const r of e){if(r.startLineNumber>=r.endLineNumber||r.startLineNumber<1||r.endLineNumber>i)continue;const o=this._getLinesChecksum(r.startLineNumber+1,r.endLineNumber);(!r.checksum||o===r.checksum)&&t.push({startLineNumber:r.startLineNumber,endLineNumber:r.endLineNumber,type:void 0,isCollapsed:r.isCollapsed??!0,source:r.source??0})}const n=Bl.sanitizeAndMerge(this._regions,t,i);this.updatePost(Bl.fromFoldRanges(n))}_getLinesChecksum(e,t){return mH(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const i=[];if(this._regions){let n=this._regions.findRange(e),r=1;for(;n>=0;){const o=this._regions.toRegion(n);(!t||t(o,r))&&i.push(o),r++,n=o.parentIndex}}return i}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 i=[],n=e?e.regionIndex+1:0,r=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const o=[];for(let a=n,l=this._regions.length;a<l;a++){const d=this._regions.toRegion(a);if(this._regions.getStartLineNumber(a)<r){for(;o.length>0&&!d.containedBy(o[o.length-1]);)o.pop();o.push(d),t(d,o.length)&&i.push(d)}else break}}else for(let o=n,a=this._regions.length;o<a;o++){const l=this._regions.toRegion(o);if(this._regions.getStartLineNumber(o)<r)(!t||t(l))&&i.push(l);else break}return i}}function bne(s,e,t){const i=[];for(const n of t){const r=s.getRegionAtLine(n);if(r){const o=!r.isCollapsed;if(i.push(r),e>1){const a=s.getRegionsInside(r,(l,d)=>l.isCollapsed!==o&&d<e);i.push(...a)}}}s.toggleCollapseState(i)}function Gx(s,e,t=Number.MAX_VALUE,i){const n=[];if(i&&i.length>0)for(const r of i){const o=s.getRegionAtLine(r);if(o&&(o.isCollapsed!==e&&n.push(o),t>1)){const a=s.getRegionsInside(o,(l,d)=>l.isCollapsed!==e&&d<t);n.push(...a)}}else{const r=s.getRegionsInside(null,(o,a)=>o.isCollapsed!==e&&a<t);n.push(...r)}s.toggleCollapseState(n)}function ESe(s,e,t,i){const n=[];for(const r of i){const o=s.getAllRegionsAtLine(r,(a,l)=>a.isCollapsed!==e&&l<=t);n.push(...o)}s.toggleCollapseState(n)}function drt(s,e,t){const i=[];for(const n of t){const r=s.getAllRegionsAtLine(n,o=>o.isCollapsed!==e);r.length>0&&i.push(r[0])}s.toggleCollapseState(i)}function urt(s,e,t,i){const n=(o,a)=>a===e&&o.isCollapsed!==t&&!i.some(l=>o.containsLine(l)),r=s.getRegionsInside(null,n);s.toggleCollapseState(r)}function ISe(s,e,t){const i=[];for(const o of t){const a=s.getAllRegionsAtLine(o,void 0);a.length>0&&i.push(a[0])}const n=o=>i.every(a=>!a.containedBy(o)&&!o.containedBy(a))&&o.isCollapsed!==e,r=s.getRegionsInside(null,n);s.toggleCollapseState(r)}function Cne(s,e,t){const i=s.textModel,n=s.regions,r=[];for(let o=n.length-1;o>=0;o--)if(t!==n.isCollapsed(o)){const a=n.getStartLineNumber(o);e.test(i.getLineContent(a))&&r.push(n.toRegion(o))}s.toggleCollapseState(r)}function yne(s,e,t){const i=s.regions,n=[];for(let r=i.length-1;r>=0;r--)t!==i.isCollapsed(r)&&e===i.getType(r)&&n.push(i.toRegion(r));s.toggleCollapseState(n)}function hrt(s,e){let t=null;const i=e.getRegionAtLine(s);if(i!==null&&(t=i.startLineNumber,s===t)){const n=i.parentIndex;n!==-1?t=e.regions.getStartLineNumber(n):t=null}return t}function frt(s,e){let t=e.getRegionAtLine(s);if(t!==null&&t.startLineNumber===s){if(s!==t.startLineNumber)return t.startLineNumber;{const i=t.parentIndex;let n=0;for(i!==-1&&(n=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=n)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}}else if(e.regions.length>0)for(t=e.regions.toRegion(e.regions.length-1);t!==null;){if(t.startLineNumber<s)return t.startLineNumber;t.regionIndex>0?t=e.regions.toRegion(t.regionIndex-1):t=null}return null}function grt(s,e){let t=e.getRegionAtLine(s);if(t!==null&&t.startLineNumber===s){const i=t.parentIndex;let n=0;if(i!==-1)n=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;n=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex<e.regions.length){if(t=e.regions.toRegion(t.regionIndex+1),t.startLineNumber>=n)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}else if(e.regions.length>0)for(t=e.regions.toRegion(0);t!==null;){if(t.startLineNumber>s)return t.startLineNumber;t.regionIndex<e.regions.length?t=e.regions.toRegion(t.regionIndex+1):t=null}return null}class prt{get onDidChange(){return this._updateEventEmitter.event}get hiddenRanges(){return this._hiddenRanges}constructor(e){this._updateEventEmitter=new se,this._hasLineChanges=!1,this._foldingModel=e,this._foldingModelListener=e.onDidChange(t=>this.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||l_(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let i=0,n=0,r=Number.MAX_VALUE,o=-1;const a=this._foldingModel.regions;for(;i<a.length;i++){if(!a.isCollapsed(i))continue;const l=a.getStartLineNumber(i)+1,d=a.getEndLineNumber(i);r<=l&&d<=o||(!e&&n<this._hiddenRanges.length&&this._hiddenRanges[n].startLineNumber===l&&this._hiddenRanges[n].endLineNumber===d?(t.push(this._hiddenRanges[n]),n++):(e=!0,t.push(new W(l,1,d,1))),r=l,o=d)}(this._hasLineChanges||e||n<this._hiddenRanges.length)&&this.applyHiddenRanges(t)}applyHiddenRanges(e){this._hiddenRanges=e,this._hasLineChanges=!1,this._updateEventEmitter.fire(e)}hasRanges(){return this._hiddenRanges.length>0}isHidden(e){return Cge(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let n=null;const r=o=>((!n||!mrt(o,n))&&(n=Cge(this._hiddenRanges,o)),n?n.startLineNumber-1:null);for(let o=0,a=e.length;o<a;o++){let l=e[o];const d=r(l.startLineNumber);d&&(l=l.setStartPosition(d,i.getLineMaxColumn(d)),t=!0);const h=r(l.endLineNumber);h&&(l=l.setEndPosition(h,i.getLineMaxColumn(h)),t=!0),e[o]=l}return t}dispose(){this.hiddenRanges.length>0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function mrt(s,e){return s>=e.startLineNumber&&s<=e.endLineNumber}function Cge(s,e){const t=II(s,i=>e<i.startLineNumber)-1;return t>=0&&s[t].endLineNumber>=e?s[t]:null}const _rt=5e3,vrt="indent";class wne{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id=vrt}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,n=t&&t.markers;return Promise.resolve(yrt(this.editorModel,i,n,this.foldingRangesLimit))}}let brt=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>du||t>du)return;const n=this._length;this._startIndexes[n]=e,this._endIndexes[n]=t,this._length++,i<1e3&&(this._indentOccurrences[i]=(this._indentOccurrences[i]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const i=new Uint32Array(this._length),n=new Uint32Array(this._length);for(let r=this._length-1,o=0;r>=0;r--,o++)i[o]=this._startIndexes[r],n[o]=this._endIndexes[r];return new Bl(i,n)}else{this._foldingRangesLimit.update(this._length,t);let i=0,n=this._indentOccurrences.length;for(let l=0;l<this._indentOccurrences.length;l++){const d=this._indentOccurrences[l];if(d){if(d+i>t){n=l;break}i+=d}}const r=e.getOptions().tabSize,o=new Uint32Array(t),a=new Uint32Array(t);for(let l=this._length-1,d=0;l>=0;l--){const h=this._startIndexes[l],f=e.getLineContent(h),p=rV(f,r);(p<n||p===n&&i++<t)&&(o[d]=h,a[d]=this._endIndexes[l],d++)}return new Bl(o,a)}}};const Crt={limit:_rt,update:()=>{}};function yrt(s,e,t,i=Crt){const n=s.getOptions().tabSize,r=new brt(i);let o;t&&(o=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],l=s.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let d=s.getLineCount();d>0;d--){const h=s.getLineContent(d),f=rV(h,n);let p=a[a.length-1];if(f===-1){e&&(p.endAbove=d);continue}let m;if(o&&(m=h.match(o)))if(m[1]){let v=a.length-1;for(;v>0&&a[v].indent!==-2;)v--;if(v>0){a.length=v+1,p=a[v],r.insertFirst(d,p.line,f),p.line=d,p.indent=f,p.endAbove=d;continue}}else{a.push({indent:-2,endAbove:d,line:d});continue}if(p.indent>f){do a.pop(),p=a[a.length-1];while(p.indent>f);const v=p.endAbove-1;v-d>=1&&r.insertFirst(d,v,f)}p.indent===f?p.endAbove=d:a.push({indent:f,endAbove:d,line:d})}return r.toIndentRanges(s)}const wrt=q("editor.foldBackground",{light:jt(am,.3),dark:jt(am,.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);q("editor.foldPlaceholderForeground",{light:"#808080",dark:"#808080",hcDark:null,hcLight:null},w("collapsedTextColor","Color of the collapsed text after the first line of a folded range."));q("editorGutter.foldingControlForeground",A4,w("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));const v3=mn("folding-expanded",Oe.chevronDown,w("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),b3=mn("folding-collapsed",Oe.chevronRight,w("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin.")),yge=mn("folding-manual-collapsed",b3,w("foldingManualCollapedIcon","Icon for manually collapsed ranges in the editor glyph margin.")),wge=mn("folding-manual-expanded",v3,w("foldingManualExpandedIcon","Icon for manually expanded ranges in the editor glyph margin.")),gj={color:qn(wrt),position:1},P1=w("linesCollapsed","Click to expand the range."),_2=w("linesExpanded","Click to collapse the range."),Ss=class Ss{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?Ss.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?Ss.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:Ss.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:Ss.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?Ss.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ss.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?Ss.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ss.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?i?Ss.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:Ss.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?Ss.MANUALLY_EXPANDED_VISUAL_DECORATION:Ss.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}};Ss.COLLAPSED_VISUAL_DECORATION=Ot.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:P1,firstLineDecorationClassName:bt.asClassName(b3)}),Ss.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Ot.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:gj,isWholeLine:!0,linesDecorationsTooltip:P1,firstLineDecorationClassName:bt.asClassName(b3)}),Ss.MANUALLY_COLLAPSED_VISUAL_DECORATION=Ot.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:P1,firstLineDecorationClassName:bt.asClassName(yge)}),Ss.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Ot.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:gj,isWholeLine:!0,linesDecorationsTooltip:P1,firstLineDecorationClassName:bt.asClassName(yge)}),Ss.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=Ot.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:P1}),Ss.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=Ot.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:gj,isWholeLine:!0,linesDecorationsTooltip:P1}),Ss.EXPANDED_VISUAL_DECORATION=Ot.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+bt.asClassName(v3),linesDecorationsTooltip:_2}),Ss.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Ot.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:bt.asClassName(v3),linesDecorationsTooltip:_2}),Ss.MANUALLY_EXPANDED_VISUAL_DECORATION=Ot.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+bt.asClassName(wge),linesDecorationsTooltip:_2}),Ss.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Ot.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:bt.asClassName(wge),linesDecorationsTooltip:_2}),Ss.NO_CONTROLS_EXPANDED_RANGE_DECORATION=Ot.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0}),Ss.HIDDEN_RANGE_DECORATION=Ot.register({description:"folding-hidden-range-decoration",stickiness:1});let sX=Ss;const Srt={},xrt="syntax";class Sne{constructor(e,t,i,n,r){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=n,this.fallbackRangeProvider=r,this.id=xrt,this.disposables=new me,r&&this.disposables.add(r);for(const o of t)typeof o.onDidChange=="function"&&this.disposables.add(o.onDidChange(i))}compute(e){return krt(this.providers,this.editorModel,e).then(t=>{var i;return t?Drt(t,this.foldingRangesLimit):((i=this.fallbackRangeProvider)==null?void 0:i.compute(e))??null})}dispose(){this.disposables.dispose()}}function krt(s,e,t){let i=null;const n=s.map((r,o)=>Promise.resolve(r.provideFoldingRanges(e,Srt,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(i)||(i=[]);const l=e.getLineCount();for(const d of a)d.start>0&&d.end>d.start&&d.end<=l&&i.push({start:d.start,end:d.end,rank:o,kind:d.kind})}},is));return Promise.all(n).then(r=>i)}class Lrt{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,n){if(e>du||t>du)return;const r=this._length;this._startIndexes[r]=e,this._endIndexes[r]=t,this._nestingLevels[r]=n,this._types[r]=i,this._length++,n<30&&(this._nestingLevelCounts[n]=(this._nestingLevelCounts[n]||0)+1)}toIndentRanges(){const e=this._foldingRangesLimit.limit;if(this._length<=e){this._foldingRangesLimit.update(this._length,!1);const t=new Uint32Array(this._length),i=new Uint32Array(this._length);for(let n=0;n<this._length;n++)t[n]=this._startIndexes[n],i[n]=this._endIndexes[n];return new Bl(t,i,this._types)}else{this._foldingRangesLimit.update(this._length,e);let t=0,i=this._nestingLevelCounts.length;for(let a=0;a<this._nestingLevelCounts.length;a++){const l=this._nestingLevelCounts[a];if(l){if(l+t>e){i=a;break}t+=l}}const n=new Uint32Array(e),r=new Uint32Array(e),o=[];for(let a=0,l=0;a<this._length;a++){const d=this._nestingLevels[a];(d<i||d===i&&t++<e)&&(n[l]=this._startIndexes[a],r[l]=this._endIndexes[a],o[l]=this._types[a],l++)}return new Bl(n,r,o)}}}function Drt(s,e){const t=s.sort((o,a)=>{let l=o.start-a.start;return l===0&&(l=o.rank-a.rank),l}),i=new Lrt(e);let n;const r=[];for(const o of t)if(!n)n=o,i.add(o.start,o.end,o.kind&&o.kind.value,r.length);else if(o.start>n.start)if(o.end<=n.end)r.push(n),n=o,i.add(o.start,o.end,o.kind&&o.kind.value,r.length);else{if(o.start>n.end){do n=r.pop();while(n&&o.start>n.end);n&&r.push(n),n=o}i.add(o.start,o.end,o.kind&&o.kind.value,r.length)}return i.toIndentRanges()}var Ert=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},bD=function(s,e){return function(t,i){e(t,i,s)}},Gv;const Kr=new qe("foldingEnabled",!1);var mC;let v_=(mC=class extends re{static get(e){return e.getContribution(Gv.ID)}static getFoldingRangeProviders(e,t){var n;const i=e.foldingRangeProvider.ordered(t);return((n=Gv._foldingRangeSelector)==null?void 0:n.call(Gv,i,t))??i}constructor(e,t,i,n,r,o){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=o,this.localToDispose=this._register(new me),this.editor=e,this._foldingLimitReporter=new TSe(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=r.for(o.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 sX(e),this.foldingDecorationProvider.showFoldingControls=a.get(111),this.foldingDecorationProvider.showFoldingHighlights=a.get(45),this.foldingEnabled=Kr.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(111)||l.hasChanged(45)){const d=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=d.get(111),this.foldingDecorationProvider.showFoldingHighlights=d.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(),i=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:i,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 crt(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new prt(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new Ac(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new ji(()=>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,i;this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),(t=this.updateScheduler)==null||t.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,(i=this.rangeProvider)==null||i.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){var e;(e=this.rangeProvider)==null||e.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new wne(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=Gv.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new Sne(e,i,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){var t;(t=this.hiddenRangeModel)==null||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 cr,i=this.getRangeProvider(e.textModel),n=this.foldingRegionPromise=Zs(r=>i.compute(r));return n.then(r=>{if(r&&n===this.foldingRegionPromise){let o;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const d=r.setCollapsedAllOfType(t_.Imports.value,!0);d&&(o=Wu.capture(this.editor),this._currentModelHasFoldedImports=d)}const a=this.editor.getSelections();e.update(r,Irt(a)),o==null||o.restore(this.editor);const l=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=l)}return e})}).then(void 0,e=>(Tt(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 i=this.editor.getSelections();if(i&&i.length>0){const n=[];for(const r of i){const o=r.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(o)&&n.push(...t.getAllRegionsAtLine(o,a=>a.isCollapsed&&o>a.startLineNumber))}n.length&&(t.toggleCollapseState(n),this.reveal(i[0].getPosition()))}}}).then(void 0,Tt)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range||!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let i=!1;switch(e.target.type){case 4:{const n=e.target.detail,r=e.target.element.offsetLeft;if(n.offsetX-r<4)return;i=!0;break}case 7:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case 6:{if(this.hiddenRangeModel.hasRanges()){const n=this.editor.getModel();if(n&&t.startColumn===n.getLineMaxColumn(t.startLineNumber))break}return}default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:i}}onEditorMouseUp(e){const t=this.foldingModel;if(!t||!this.mouseDownInfo||!e.target)return;const i=this.mouseDownInfo.lineNumber,n=this.mouseDownInfo.iconClicked,r=e.target.range;if(!r||r.startLineNumber!==i)return;if(n){if(e.target.type!==4)return}else{const a=this.editor.getModel();if(!a||r.startColumn!==a.getLineMaxColumn(i))return}const o=t.getRegionAtLine(i);if(o&&o.startLineNumber===i){const a=o.isCollapsed;if(n||a){const l=e.event.altKey;let d=[];if(l){const h=p=>!p.containedBy(o)&&!o.containedBy(p),f=t.getRegionsInside(null,h);for(const p of f)p.isCollapsed&&d.push(p);d.length===0&&(d=f)}else{const h=e.event.middleButton||e.event.shiftKey;if(h)for(const f of t.getRegionsInside(o))f.isCollapsed===a&&d.push(f);(a||!h||d.length===0)&&d.push(o)}t.toggleCollapseState(d),this.reveal({lineNumber:i,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}},Gv=mC,mC.ID="editor.contrib.folding",mC);v_=Gv=Ert([bD(1,yt),bD(2,Bn),bD(3,gs),bD(4,sc),bD(5,it)],v_);class TSe{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 oo extends Ze{runEditorCommand(e,t,i){const n=e.get(Bn),r=v_.get(t);if(!r)return;const o=r.getFoldingModel();if(o)return this.reportTelemetry(e,t),o.then(a=>{if(a){this.invoke(r,a,t,i,n);const l=t.getSelection();l&&r.reveal(l.getStartPosition())}})}getSelectedLines(e){const t=e.getSelections();return t?t.map(i=>i.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(i=>i+1):this.getSelectedLines(t)}run(e,t){}}function Irt(s){return!s||s.length===0?{startsInside:()=>!1}:{startsInside(e,t){for(const i of s){const n=i.startLineNumber;if(n>=e&&n<=t)return!0}return!1}}}function NSe(s){if(!wo(s)){if(!rr(s))return!1;const e=s;if(!wo(e.levels)&&!Qm(e.levels)||!wo(e.direction)&&!Ca(e.direction)||!wo(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(Qm)))return!1}return!0}class Trt extends oo{constructor(){super({id:"editor.unfold",label:w("unfoldAction.label","Unfold"),alias:"Unfold",precondition:Kr,kbOpts:{kbExpr:U.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:
|
|
893
|
+
`),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 mge(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return _ge(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 QZ(null,this._contextViewProvider,{width:Gst,label:Pst,placeholder:Ost,appendCaseSensitiveLabel:this._keybindingLabelFor(un.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(un.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(un.ToggleRegexCommand),validation:h=>{if(h.length===0||!this._findInput.getRegex())return null;try{return new RegExp(h,"gu"),null}catch(f){return{content:f.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>dge(this._keybindingService),inputBoxStyles:J4,toggleStyles:Q4},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(h=>this._onFindInputKeyDown(h))),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(h=>{h.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),h.preventDefault())})),this._register(this._findInput.onRegexKeyDown(h=>{h.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),h.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(h=>{this._tryUpdateHeight()&&this._showViewZone()})),Yo&&this._register(this._findInput.onMouseDown(h=>this._onFindInputMouseDown(h))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount();const i=this._register($S());this._prevBtn=this._register(new R1({label:Ast+this._keybindingLabelFor(un.PreviousMatchFindAction),icon:Nst,hoverDelegate:i,onTrigger:()=>{rm(this._codeEditor.getAction(un.PreviousMatchFindAction)).run().then(void 0,Tt)}},this._hoverService)),this._nextBtn=this._register(new R1({label:Fst+this._keybindingLabelFor(un.NextMatchFindAction),icon:Mst,hoverDelegate:i,onTrigger:()=>{rm(this._codeEditor.getAction(un.NextMatchFindAction)).run().then(void 0,Tt)}},this._hoverService));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 Bx({icon:Est,title:Bst+this._keybindingLabelFor(un.ToggleSearchScopeCommand),isChecked:!1,hoverDelegate:i,inputActiveOptionBackground:Ge(mN),inputActiveOptionBorder:Ge(VH),inputActiveOptionForeground:Ge($H)})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){let h=this._codeEditor.getSelections();h=h.map(f=>(f.endColumn===1&&f.endLineNumber>f.startLineNumber&&(f=f.setEndPosition(f.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(f.endLineNumber-1))),f.isEmpty()?null:f)).filter(f=>!!f),h.length&&this._state.change({searchScope:h},!0)}}else this._state.change({searchScope:null},!0)})),r.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new R1({label:Wst+this._keybindingLabelFor(un.CloseFindWidgetCommand),icon:Awe,hoverDelegate:i,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:h=>{h.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),h.preventDefault())}},this._hoverService)),this._replaceInput=this._register(new JZ(null,void 0,{label:Hst,placeholder:Vst,appendPreserveCaseLabel:this._keybindingLabelFor(un.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>dge(this._keybindingService),inputBoxStyles:J4,toggleStyles:Q4},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown(h=>this._onReplaceInputKeyDown(h))),this._register(this._replaceInput.inputBox.onDidChange(()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)})),this._register(this._replaceInput.inputBox.onDidHeightChange(h=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()})),this._register(this._replaceInput.onDidOptionChange(()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)})),this._register(this._replaceInput.onPreserveCaseKeyDown(h=>{h.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(),h.preventDefault())}));const o=this._register($S());this._replaceBtn=this._register(new R1({label:$st+this._keybindingLabelFor(un.ReplaceOneAction),icon:Ist,hoverDelegate:o,onTrigger:()=>{this._controller.replace()},onKeyDown:h=>{h.equals(1026)&&(this._closeBtn.focus(),h.preventDefault())}},this._hoverService)),this._replaceAllBtn=this._register(new R1({label:zst+this._keybindingLabelFor(un.ReplaceAllAction),icon:Tst,hoverDelegate:o,onTrigger:()=>{this._controller.replaceAll()}},this._hoverService));const a=document.createElement("div");a.className="replace-part",a.appendChild(this._replaceInput.domNode);const l=document.createElement("div");l.className="replace-actions",a.appendChild(l),l.appendChild(this._replaceBtn.domNode),l.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new R1({label:jst,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=Ga(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}},this._hoverService)),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=Rst,this._domNode.role="dialog",this._domNode.style.width=`${hh}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(n),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(a),this._resizeSash=this._register(new Qr(this._domNode,this,{orientation:0,size:2})),this._resized=!1;let d=hh;this._register(this._resizeSash.onDidStart(()=>{d=Ga(this._domNode)})),this._register(this._resizeSash.onDidChange(h=>{this._resized=!0;const f=d+h.startX-h.currentX;if(f<hh)return;const p=parseFloat(bH(this._domNode).maxWidth)||0;f>p||(this._domNode.style.width=`${f}px`,this._isReplaceVisible&&(this._replaceInput.width=Ga(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const h=Ga(this._domNode);if(h<hh)return;let f=hh;if(!this._resized||h===hh){const p=this._codeEditor.getLayoutInfo();f=p.width-28-p.minimap.minimapWidth-15,this._resized=!0}this._domNode.style.width=`${f}px`,this._isReplaceVisible&&(this._replaceInput.width=Ga(this._findInput.domNode)),this._findInput.inputBox.layout()}))}updateAccessibilitySupport(){const e=this._codeEditor.getOption(2);this._findInput.setFocusInputOnOptionClick(e!==2)}};nW.ID="editor.contrib.findWidget";let eX=nW;class R1 extends rc{constructor(e,t){super(),this._opts=e;let i="button";this._opts.className&&(i=i+" "+this._opts.className),this._opts.icon&&(i=i+" "+bt.asClassName(this._opts.icon)),this._domNode=document.createElement("div"),this._domNode.tabIndex=0,this._domNode.className=i,this._domNode.setAttribute("role","button"),this._domNode.setAttribute("aria-label",this._opts.label),this._register(t.setupManagedHover(e.hoverDelegate??ta("element"),this._domNode,this._opts.label)),this.onclick(this._domNode,n=>{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.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(...bt.asClassNameArray(uge)),this._domNode.classList.add(...bt.asClassNameArray(hge))):(this._domNode.classList.remove(...bt.asClassNameArray(hge)),this._domNode.classList.add(...bt.asClassNameArray(uge)))}}jc((s,e)=>{const t=s.getColor(lm);t&&e.addRule(`.monaco-editor .findMatch { border: 1px ${Eu(s.type)?"dotted":"solid"} ${t}; box-sizing: border-box; }`);const i=s.getColor(wVe);i&&e.addRule(`.monaco-editor .findScope { border: 1px ${Eu(s.type)?"dashed":"solid"} ${i}; }`);const n=s.getColor(fi);n&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${n}; }`);const r=s.getColor(CVe);r&&e.addRule(`.monaco-editor .findMatchInline { color: ${r}; }`);const o=s.getColor(yVe);o&&e.addRule(`.monaco-editor .currentFindMatchInline { color: ${o}; }`)});var kSe=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},wc=function(s,e){return function(t,i){e(t,i,s)}},tX;const Zst=524288;function iX(s,e="single",t=!1){if(!s.hasModel())return null;const i=s.getSelection();if(e==="single"&&i.startLineNumber===i.endLineNumber||e==="multiple"){if(i.isEmpty()){const n=s.getConfiguredWordAtPosition(i.getStartPosition());if(n&&t===!1)return n.word}else if(s.getModel().getValueLengthInRange(i)<Zst)return s.getModel().getValueInRange(i)}return null}var pC;let La=(pC=class extends re{get editor(){return this._editor}static get(e){return e.getContribution(tX.ID)}constructor(e,t,i,n,r,o){super(),this._editor=e,this._findWidgetVisible=Zg.bindTo(t),this._contextKeyService=t,this._storageService=i,this._clipboardService=n,this._notificationService=r,this._hoverService=o,this._updateHistoryDelayer=new Ac(500),this._state=this._register(new Sst),this.loadQueryState(),this._register(this._state.onFindReplaceStateChange(a=>this._onStateChanged(a))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{const a=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),a&&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!!FV.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=Xl(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}async _start(e,t){if(this.disposeModel(),!this._editor.hasModel())return;const i={...t,isRevealed:!0};if(e.seedSearchStringFromSelection==="single"){const n=iX(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);n&&(this._state.isRegex?i.searchString=Xl(n):i.searchString=n)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const n=iX(this._editor,e.seedSearchStringFromSelection);n&&(i.searchString=n)}if(!i.searchString&&e.seedSearchStringFromGlobalClipboard){const n=await this.getGlobalBufferTerm();if(!this._editor.hasModel())return;n&&(i.searchString=n)}if(e.forceRevealReplace||i.isReplaceRevealed?i.isReplaceRevealed=!0:this._findWidgetVisible.get()||(i.isReplaceRevealed=!1),e.updateSearchScope){const n=this._editor.getSelections();n.some(r=>!r.isEmpty())&&(i.searchScope=n)}i.loop=e.loop,this._state.change(i,!1),this._model||(this._model=new TE(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.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)}},tX=pC,pC.ID="editor.contrib.findController",pC);La=tX=kSe([wc(1,yt),wc(2,Bd),wc(3,Yg),wc(4,gs),wc(5,df)],La);let nX=class extends La{constructor(e,t,i,n,r,o,a,l,d){super(e,i,a,l,o,d),this._contextViewService=t,this._keybindingService=n,this._themeService=r,this._widget=null,this._findOptionsWidget=null}async _start(e,t){this._widget||this._createFindWidget();const i=this._editor.getSelection();let n=!1;switch(this._editor.getOption(41).autoFindInSelection){case"always":n=!0;break;case"never":n=!1;break;case"multiline":{n=!!i&&i.startLineNumber!==i.endLineNumber;break}}e.updateSearchScope=e.updateSearchScope||n,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 eX(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService,this._hoverService)),this._findOptionsWidget=this._register(new XZ(this._editor,this._state,this._keybindingService))}};nX=kSe([wc(1,qg),wc(2,yt),wc(3,Mi),wc(4,zs),wc(5,gs),wc(6,Bd),wc(7,Yg),wc(8,df)],nX);const Xst=wbe(new ybe({id:un.StartFindAction,label:w("startFindAction","Find"),alias:"Find",precondition:ve.or(U.focus,ve.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:st.MenubarEditMenu,group:"3_find",title:w({key:"miFind",comment:["&& denotes a mnemonic"]},"&&Find"),order:1}}));Xst.addImplementation(0,(s,e,t)=>{const i=La.get(e);return i?i.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 Qst={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 Jst extends Ze{constructor(){super({id:un.StartFindWithArgs,label:w("startFindWithArgsAction","Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},metadata:Qst})}async run(e,t,i){const n=La.get(t);if(n){const r=i?{searchString:i.searchString,replaceString:i.replaceString,isReplaceRevealed:i.replaceString!==void 0,isRegex:i.isRegex,wholeWord:i.matchWholeWord,matchCase:i.isCaseSensitive,preserveCase:i.preserveCase}:{};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:1,shouldAnimate:!0,updateSearchScope:(i==null?void 0:i.findInSelection)||!1,loop:t.getOption(41).loop},r),n.setGlobalBufferTerm(n.getState().searchString)}}}class ert extends Ze{constructor(){super({id:un.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 i=La.get(t);i&&(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),i.setGlobalBufferTerm(i.getState().searchString))}}class LSe extends Ze{async run(e,t){const i=La.get(t);i&&!this._run(i)&&(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:i.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(i))}}class trt extends LSe{constructor(){super({id:un.NextMatchFindAction,label:w("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:U.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:ve.and(U.focus,FV),primary:3,weight:100}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class irt extends LSe{constructor(){super({id:un.PreviousMatchFindAction,label:w("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:U.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:ve.and(U.focus,FV),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}class nrt extends Ze{constructor(){super({id:un.GoToMatchFindAction,label:w("findMatchAction.goToMatch","Go to Match..."),alias:"Go to Match...",precondition:Zg}),this._highlightDecorations=[]}run(e,t,i){const n=La.get(t);if(!n)return;const r=n.getState().matchesCount;if(r<1){e.get(gs).notify({severity:OH.Warning,message:w("findMatchAction.noResults","No matches. Try searching for something else.")});return}const o=e.get(Uc),a=new me,l=a.add(o.createInputBox());l.placeholder=w("findMatchAction.inputPlaceHolder","Type a number to go to a specific match (between 1 and {0})",r);const d=f=>{const p=parseInt(f);if(isNaN(p))return;const m=n.getState().matchesCount;if(p>0&&p<=m)return p-1;if(p<0&&p>=-m)return m+p},h=f=>{const p=d(f);if(typeof p=="number"){l.validationMessage=void 0,n.goToMatch(p);const m=n.getState().currentMatch;m&&this.addDecorations(t,m)}else l.validationMessage=w("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",n.getState().matchesCount),this.clearDecorations(t)};a.add(l.onDidChangeValue(f=>{h(f)})),a.add(l.onDidAccept(()=>{const f=d(l.value);typeof f=="number"?(n.goToMatch(f),l.hide()):l.validationMessage=w("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",n.getState().matchesCount)})),a.add(l.onDidHide(()=>{this.clearDecorations(t),a.dispose()})),l.show()}clearDecorations(e){e.changeDecorations(t=>{this._highlightDecorations=t.deltaDecorations(this._highlightDecorations,[])})}addDecorations(e,t){e.changeDecorations(i=>{this._highlightDecorations=i.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:qn(Sye),position:Gl.Full}}}])})}}class DSe extends Ze{async run(e,t){const i=La.get(t);if(!i)return;const n=iX(t,"single",!1);n&&i.setSearchString(n),this._run(i)||(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(i))}}class srt extends DSe{constructor(){super({id:un.NextSelectionMatchFindAction,label:w("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:U.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class rrt extends DSe{constructor(){super({id:un.PreviousSelectionMatchFindAction,label:w("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:U.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const ort=wbe(new ybe({id:un.StartFindReplaceAction,label:w("startReplace","Replace"),alias:"Replace",precondition:ve.or(U.focus,ve.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:st.MenubarEditMenu,group:"3_find",title:w({key:"miReplace",comment:["&& denotes a mnemonic"]},"&&Replace"),order:2}}));ort.addImplementation(0,(s,e,t)=>{if(!e.hasModel()||e.getOption(92))return!1;const i=La.get(e);if(!i)return!1;const n=e.getSelection(),r=i.isFindInputFocused(),o=!n.isEmpty()&&n.startLineNumber===n.endLineNumber&&e.getOption(41).seedSearchStringFromSelection!=="never"&&!r,a=r||o?2:1;return i.start({forceRevealReplace:!0,seedSearchStringFromSelection:o?"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})});gi(La.ID,nX,0);Pe(Jst);Pe(ert);Pe(trt);Pe(irt);Pe(nrt);Pe(srt);Pe(rrt);const Ku=$s.bindToContribution(La.get);Ue(new Ku({id:un.CloseFindWidgetCommand,precondition:Zg,handler:s=>s.closeFindWidget(),kbOpts:{weight:105,kbExpr:ve.and(U.focus,ve.not("isComposing")),primary:9,secondary:[1033]}}));Ue(new Ku({id:un.ToggleCaseSensitiveCommand,precondition:void 0,handler:s=>s.toggleCaseSensitive(),kbOpts:{weight:105,kbExpr:U.focus,primary:d2.primary,mac:d2.mac,win:d2.win,linux:d2.linux}}));Ue(new Ku({id:un.ToggleWholeWordCommand,precondition:void 0,handler:s=>s.toggleWholeWords(),kbOpts:{weight:105,kbExpr:U.focus,primary:u2.primary,mac:u2.mac,win:u2.win,linux:u2.linux}}));Ue(new Ku({id:un.ToggleRegexCommand,precondition:void 0,handler:s=>s.toggleRegex(),kbOpts:{weight:105,kbExpr:U.focus,primary:h2.primary,mac:h2.mac,win:h2.win,linux:h2.linux}}));Ue(new Ku({id:un.ToggleSearchScopeCommand,precondition:void 0,handler:s=>s.toggleSearchScope(),kbOpts:{weight:105,kbExpr:U.focus,primary:f2.primary,mac:f2.mac,win:f2.win,linux:f2.linux}}));Ue(new Ku({id:un.TogglePreserveCaseCommand,precondition:void 0,handler:s=>s.togglePreserveCase(),kbOpts:{weight:105,kbExpr:U.focus,primary:g2.primary,mac:g2.mac,win:g2.win,linux:g2.linux}}));Ue(new Ku({id:un.ReplaceOneAction,precondition:Zg,handler:s=>s.replace(),kbOpts:{weight:105,kbExpr:U.focus,primary:3094}}));Ue(new Ku({id:un.ReplaceOneAction,precondition:Zg,handler:s=>s.replace(),kbOpts:{weight:105,kbExpr:ve.and(U.focus,mne),primary:3}}));Ue(new Ku({id:un.ReplaceAllAction,precondition:Zg,handler:s=>s.replaceAll(),kbOpts:{weight:105,kbExpr:U.focus,primary:2563}}));Ue(new Ku({id:un.ReplaceAllAction,precondition:Zg,handler:s=>s.replaceAll(),kbOpts:{weight:105,kbExpr:ve.and(U.focus,mne),primary:void 0,mac:{primary:2051}}}));Ue(new Ku({id:un.SelectAllMatchesAction,precondition:Zg,handler:s=>s.selectAllMatches(),kbOpts:{weight:105,kbExpr:U.focus,primary:515}}));const art={0:" ",1:"u",2:"r"},vge=65535,du=16777215,bge=4278190080;class fj{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,i=e%32;return(this._states[t]&1<<i)!==0}set(e,t){const i=e/32|0,n=e%32,r=this._states[i];t?this._states[i]=r|1<<n:this._states[i]=r&~(1<<n)}}class Bl{constructor(e,t,i){if(e.length!==t.length||e.length>vge)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new fj(e.length),this._userDefinedStates=new fj(e.length),this._recoveredStates=new fj(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(i,n)=>{const r=e[e.length-1];return this.getStartLineNumber(r)<=i&&this.getEndLineNumber(r)>=n};for(let i=0,n=this._startIndexes.length;i<n;i++){const r=this._startIndexes[i],o=this._endIndexes[i];if(r>du||o>du)throw new Error("startLineNumber or endLineNumber must not exceed "+du);for(;e.length>0&&!t(r,o);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=r+((a&255)<<24),this._endIndexes[i]=o+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&du}getEndLineNumber(e){return this._endIndexes[e]&du}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 i=!1;if(this._types)for(let n=0;n<this._types.length;n++)this._types[n]===e&&(this.setCollapsed(n,t),i=!0);return i}toRegion(e){return new lrt(this,e)}getParentIndex(e){this.ensureParentIndices();const t=((this._startIndexes[e]&bge)>>>24)+((this._endIndexes[e]&bge)>>>16);return t===vge?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,i=this._startIndexes.length;if(i===0)return-1;for(;t<i;){const n=Math.floor((t+i)/2);e<this.getStartLineNumber(n)?i=n:t=n+1}return t-1}findRange(e){let t=this.findIndex(e);if(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;t<this.length;t++)e[t]=`[${art[this.getSource(t)]}${this.isCollapsed(t)?"+":"-"}] ${this.getStartLineNumber(t)}/${this.getEndLineNumber(t)}`;return e.join(", ")}toFoldRange(e){return{startLineNumber:this._startIndexes[e]&du,endLineNumber:this._endIndexes[e]&du,type:this._types?this._types[e]:void 0,isCollapsed:this.isCollapsed(e),source:this.getSource(e)}}static fromFoldRanges(e){const t=e.length,i=new Uint32Array(t),n=new Uint32Array(t);let r=[],o=!1;for(let l=0;l<t;l++){const d=e[l];i[l]=d.startLineNumber,n[l]=d.endLineNumber,r.push(d.type),d.type&&(o=!0)}o||(r=void 0);const a=new Bl(i,n,r);for(let l=0;l<t;l++)e[l].isCollapsed&&a.setCollapsed(l,!0),a.setSource(l,e[l].source);return a}static sanitizeAndMerge(e,t,i,n){i=i??Number.MAX_VALUE;const r=(y,x)=>Array.isArray(y)?D=>D<x?y[D]:void 0:D=>D<x?y.toFoldRange(D):void 0,o=r(e,e.length),a=r(t,t.length);let l=0,d=0,h=o(0),f=a(0);const p=[];let m,v=0;const b=[];for(;h||f;){let y;if(f&&(!h||h.startLineNumber>=f.startLineNumber))h&&h.startLineNumber===f.startLineNumber?(f.source===1?y=f:(y=h,y.isCollapsed=f.isCollapsed&&(h.endLineNumber===f.endLineNumber||!(n!=null&&n.startsInside(h.startLineNumber+1,h.endLineNumber+1))),y.source=0),h=o(++l)):(y=f,f.isCollapsed&&f.source===0&&(y.source=2)),f=a(++d);else{let x=d,D=f;for(;;){if(!D||D.startLineNumber>h.endLineNumber){y=h;break}if(D.source===1&&D.endLineNumber>h.endLineNumber)break;D=a(++x)}h=o(++l)}if(y){for(;m&&m.endLineNumber<y.startLineNumber;)m=p.pop();y.endLineNumber>y.startLineNumber&&y.startLineNumber>v&&y.endLineNumber<=i&&(!m||m.endLineNumber>=y.endLineNumber)&&(b.push(y),v=y.startLineNumber,m&&p.push(m),m=y)}}return b}}class lrt{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 crt{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 Bl(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(e){if(!e.length)return;e=e.sort((i,n)=>i.regionIndex-n.regionIndex);const t={};this._decorationProvider.changeDecorations(i=>{let n=0,r=-1,o=-1;const a=l=>{for(;n<l;){const d=this._regions.getEndLineNumber(n),h=this._regions.isCollapsed(n);if(d<=r){const f=this.regions.getSource(n)!==0;i.changeDecorationOptions(this._editorDecorationIds[n],this._decorationProvider.getDecorationOption(h,d<=o,f))}h&&d>o&&(o=d),n++}};for(const l of e){const d=l.regionIndex,h=this._editorDecorationIds[d];if(h&&!t[h]){t[h]=!0,a(d);const f=!this._regions.isCollapsed(d);this._regions.setCollapsed(d,f),r=Math.max(r,this._regions.getEndLineNumber(d))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,i=n=>{for(const r of e)if(!(r.startLineNumber>n.endLineNumber||n.startLineNumber>r.endLineNumber))return!0;return!1};for(let n=0;n<this._regions.length;n++){const r=this._regions.toFoldRange(n);(r.source===0||!i(r))&&t.push(r)}this.updatePost(Bl.fromFoldRanges(t))}update(e,t){const i=this._currentFoldedOrManualRanges(t),n=Bl.sanitizeAndMerge(e,i,this._textModel.getLineCount(),t);this.updatePost(Bl.fromFoldRanges(n))}updatePost(e){const t=[];let i=-1;for(let n=0,r=e.length;n<r;n++){const o=e.getStartLineNumber(n),a=e.getEndLineNumber(n),l=e.isCollapsed(n),d=e.getSource(n)!==0,h={startLineNumber:o,startColumn:this._textModel.getLineMaxColumn(o),endLineNumber:a,endColumn:this._textModel.getLineMaxColumn(a)+1};t.push({range:h,options:this._decorationProvider.getDecorationOption(l,a<=i,d)}),l&&a>i&&(i=a)}this._decorationProvider.changeDecorations(n=>this._editorDecorationIds=n.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e){const t=[];for(let i=0,n=this._regions.length;i<n;i++){let r=this.regions.isCollapsed(i);const o=this.regions.getSource(i);if(r||o!==0){const a=this._regions.toFoldRange(i),l=this._textModel.getDecorationRange(this._editorDecorationIds[i]);l&&(r&&(e!=null&&e.startsInside(l.startLineNumber+1,l.endLineNumber))&&(r=!1),t.push({startLineNumber:l.startLineNumber,endLineNumber:l.endLineNumber,type:a.type,isCollapsed:r,source:o}))}}return t}getMemento(){const e=this._currentFoldedOrManualRanges(),t=[],i=this._textModel.getLineCount();for(let n=0,r=e.length;n<r;n++){const o=e[n];if(o.startLineNumber>=o.endLineNumber||o.startLineNumber<1||o.endLineNumber>i)continue;const a=this._getLinesChecksum(o.startLineNumber+1,o.endLineNumber);t.push({startLineNumber:o.startLineNumber,endLineNumber:o.endLineNumber,isCollapsed:o.isCollapsed,source:o.source,checksum:a})}return t.length>0?t:void 0}applyMemento(e){if(!Array.isArray(e))return;const t=[],i=this._textModel.getLineCount();for(const r of e){if(r.startLineNumber>=r.endLineNumber||r.startLineNumber<1||r.endLineNumber>i)continue;const o=this._getLinesChecksum(r.startLineNumber+1,r.endLineNumber);(!r.checksum||o===r.checksum)&&t.push({startLineNumber:r.startLineNumber,endLineNumber:r.endLineNumber,type:void 0,isCollapsed:r.isCollapsed??!0,source:r.source??0})}const n=Bl.sanitizeAndMerge(this._regions,t,i);this.updatePost(Bl.fromFoldRanges(n))}_getLinesChecksum(e,t){return mH(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const i=[];if(this._regions){let n=this._regions.findRange(e),r=1;for(;n>=0;){const o=this._regions.toRegion(n);(!t||t(o,r))&&i.push(o),r++,n=o.parentIndex}}return i}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 i=[],n=e?e.regionIndex+1:0,r=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const o=[];for(let a=n,l=this._regions.length;a<l;a++){const d=this._regions.toRegion(a);if(this._regions.getStartLineNumber(a)<r){for(;o.length>0&&!d.containedBy(o[o.length-1]);)o.pop();o.push(d),t(d,o.length)&&i.push(d)}else break}}else for(let o=n,a=this._regions.length;o<a;o++){const l=this._regions.toRegion(o);if(this._regions.getStartLineNumber(o)<r)(!t||t(l))&&i.push(l);else break}return i}}function bne(s,e,t){const i=[];for(const n of t){const r=s.getRegionAtLine(n);if(r){const o=!r.isCollapsed;if(i.push(r),e>1){const a=s.getRegionsInside(r,(l,d)=>l.isCollapsed!==o&&d<e);i.push(...a)}}}s.toggleCollapseState(i)}function Gx(s,e,t=Number.MAX_VALUE,i){const n=[];if(i&&i.length>0)for(const r of i){const o=s.getRegionAtLine(r);if(o&&(o.isCollapsed!==e&&n.push(o),t>1)){const a=s.getRegionsInside(o,(l,d)=>l.isCollapsed!==e&&d<t);n.push(...a)}}else{const r=s.getRegionsInside(null,(o,a)=>o.isCollapsed!==e&&a<t);n.push(...r)}s.toggleCollapseState(n)}function ESe(s,e,t,i){const n=[];for(const r of i){const o=s.getAllRegionsAtLine(r,(a,l)=>a.isCollapsed!==e&&l<=t);n.push(...o)}s.toggleCollapseState(n)}function drt(s,e,t){const i=[];for(const n of t){const r=s.getAllRegionsAtLine(n,o=>o.isCollapsed!==e);r.length>0&&i.push(r[0])}s.toggleCollapseState(i)}function urt(s,e,t,i){const n=(o,a)=>a===e&&o.isCollapsed!==t&&!i.some(l=>o.containsLine(l)),r=s.getRegionsInside(null,n);s.toggleCollapseState(r)}function ISe(s,e,t){const i=[];for(const o of t){const a=s.getAllRegionsAtLine(o,void 0);a.length>0&&i.push(a[0])}const n=o=>i.every(a=>!a.containedBy(o)&&!o.containedBy(a))&&o.isCollapsed!==e,r=s.getRegionsInside(null,n);s.toggleCollapseState(r)}function Cne(s,e,t){const i=s.textModel,n=s.regions,r=[];for(let o=n.length-1;o>=0;o--)if(t!==n.isCollapsed(o)){const a=n.getStartLineNumber(o);e.test(i.getLineContent(a))&&r.push(n.toRegion(o))}s.toggleCollapseState(r)}function yne(s,e,t){const i=s.regions,n=[];for(let r=i.length-1;r>=0;r--)t!==i.isCollapsed(r)&&e===i.getType(r)&&n.push(i.toRegion(r));s.toggleCollapseState(n)}function hrt(s,e){let t=null;const i=e.getRegionAtLine(s);if(i!==null&&(t=i.startLineNumber,s===t)){const n=i.parentIndex;n!==-1?t=e.regions.getStartLineNumber(n):t=null}return t}function frt(s,e){let t=e.getRegionAtLine(s);if(t!==null&&t.startLineNumber===s){if(s!==t.startLineNumber)return t.startLineNumber;{const i=t.parentIndex;let n=0;for(i!==-1&&(n=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=n)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}}else if(e.regions.length>0)for(t=e.regions.toRegion(e.regions.length-1);t!==null;){if(t.startLineNumber<s)return t.startLineNumber;t.regionIndex>0?t=e.regions.toRegion(t.regionIndex-1):t=null}return null}function grt(s,e){let t=e.getRegionAtLine(s);if(t!==null&&t.startLineNumber===s){const i=t.parentIndex;let n=0;if(i!==-1)n=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;n=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex<e.regions.length){if(t=e.regions.toRegion(t.regionIndex+1),t.startLineNumber>=n)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}else if(e.regions.length>0)for(t=e.regions.toRegion(0);t!==null;){if(t.startLineNumber>s)return t.startLineNumber;t.regionIndex<e.regions.length?t=e.regions.toRegion(t.regionIndex+1):t=null}return null}class prt{get onDidChange(){return this._updateEventEmitter.event}get hiddenRanges(){return this._hiddenRanges}constructor(e){this._updateEventEmitter=new se,this._hasLineChanges=!1,this._foldingModel=e,this._foldingModelListener=e.onDidChange(t=>this.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||l_(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let i=0,n=0,r=Number.MAX_VALUE,o=-1;const a=this._foldingModel.regions;for(;i<a.length;i++){if(!a.isCollapsed(i))continue;const l=a.getStartLineNumber(i)+1,d=a.getEndLineNumber(i);r<=l&&d<=o||(!e&&n<this._hiddenRanges.length&&this._hiddenRanges[n].startLineNumber===l&&this._hiddenRanges[n].endLineNumber===d?(t.push(this._hiddenRanges[n]),n++):(e=!0,t.push(new W(l,1,d,1))),r=l,o=d)}(this._hasLineChanges||e||n<this._hiddenRanges.length)&&this.applyHiddenRanges(t)}applyHiddenRanges(e){this._hiddenRanges=e,this._hasLineChanges=!1,this._updateEventEmitter.fire(e)}hasRanges(){return this._hiddenRanges.length>0}isHidden(e){return Cge(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let n=null;const r=o=>((!n||!mrt(o,n))&&(n=Cge(this._hiddenRanges,o)),n?n.startLineNumber-1:null);for(let o=0,a=e.length;o<a;o++){let l=e[o];const d=r(l.startLineNumber);d&&(l=l.setStartPosition(d,i.getLineMaxColumn(d)),t=!0);const h=r(l.endLineNumber);h&&(l=l.setEndPosition(h,i.getLineMaxColumn(h)),t=!0),e[o]=l}return t}dispose(){this.hiddenRanges.length>0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function mrt(s,e){return s>=e.startLineNumber&&s<=e.endLineNumber}function Cge(s,e){const t=II(s,i=>e<i.startLineNumber)-1;return t>=0&&s[t].endLineNumber>=e?s[t]:null}const _rt=5e3,vrt="indent";class wne{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id=vrt}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,n=t&&t.markers;return Promise.resolve(yrt(this.editorModel,i,n,this.foldingRangesLimit))}}let brt=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>du||t>du)return;const n=this._length;this._startIndexes[n]=e,this._endIndexes[n]=t,this._length++,i<1e3&&(this._indentOccurrences[i]=(this._indentOccurrences[i]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const i=new Uint32Array(this._length),n=new Uint32Array(this._length);for(let r=this._length-1,o=0;r>=0;r--,o++)i[o]=this._startIndexes[r],n[o]=this._endIndexes[r];return new Bl(i,n)}else{this._foldingRangesLimit.update(this._length,t);let i=0,n=this._indentOccurrences.length;for(let l=0;l<this._indentOccurrences.length;l++){const d=this._indentOccurrences[l];if(d){if(d+i>t){n=l;break}i+=d}}const r=e.getOptions().tabSize,o=new Uint32Array(t),a=new Uint32Array(t);for(let l=this._length-1,d=0;l>=0;l--){const h=this._startIndexes[l],f=e.getLineContent(h),p=rV(f,r);(p<n||p===n&&i++<t)&&(o[d]=h,a[d]=this._endIndexes[l],d++)}return new Bl(o,a)}}};const Crt={limit:_rt,update:()=>{}};function yrt(s,e,t,i=Crt){const n=s.getOptions().tabSize,r=new brt(i);let o;t&&(o=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],l=s.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let d=s.getLineCount();d>0;d--){const h=s.getLineContent(d),f=rV(h,n);let p=a[a.length-1];if(f===-1){e&&(p.endAbove=d);continue}let m;if(o&&(m=h.match(o)))if(m[1]){let v=a.length-1;for(;v>0&&a[v].indent!==-2;)v--;if(v>0){a.length=v+1,p=a[v],r.insertFirst(d,p.line,f),p.line=d,p.indent=f,p.endAbove=d;continue}}else{a.push({indent:-2,endAbove:d,line:d});continue}if(p.indent>f){do a.pop(),p=a[a.length-1];while(p.indent>f);const v=p.endAbove-1;v-d>=1&&r.insertFirst(d,v,f)}p.indent===f?p.endAbove=d:a.push({indent:f,endAbove:d,line:d})}return r.toIndentRanges(s)}const wrt=q("editor.foldBackground",{light:Ut(am,.3),dark:Ut(am,.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);q("editor.foldPlaceholderForeground",{light:"#808080",dark:"#808080",hcDark:null,hcLight:null},w("collapsedTextColor","Color of the collapsed text after the first line of a folded range."));q("editorGutter.foldingControlForeground",A4,w("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));const v3=mn("folding-expanded",Oe.chevronDown,w("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),b3=mn("folding-collapsed",Oe.chevronRight,w("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin.")),yge=mn("folding-manual-collapsed",b3,w("foldingManualCollapedIcon","Icon for manually collapsed ranges in the editor glyph margin.")),wge=mn("folding-manual-expanded",v3,w("foldingManualExpandedIcon","Icon for manually expanded ranges in the editor glyph margin.")),gj={color:qn(wrt),position:1},P1=w("linesCollapsed","Click to expand the range."),_2=w("linesExpanded","Click to collapse the range."),Ss=class Ss{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?Ss.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?Ss.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:Ss.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:Ss.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?Ss.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ss.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?Ss.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ss.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?i?Ss.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:Ss.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?Ss.MANUALLY_EXPANDED_VISUAL_DECORATION:Ss.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}};Ss.COLLAPSED_VISUAL_DECORATION=Ot.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:P1,firstLineDecorationClassName:bt.asClassName(b3)}),Ss.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Ot.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:gj,isWholeLine:!0,linesDecorationsTooltip:P1,firstLineDecorationClassName:bt.asClassName(b3)}),Ss.MANUALLY_COLLAPSED_VISUAL_DECORATION=Ot.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:P1,firstLineDecorationClassName:bt.asClassName(yge)}),Ss.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Ot.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:gj,isWholeLine:!0,linesDecorationsTooltip:P1,firstLineDecorationClassName:bt.asClassName(yge)}),Ss.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=Ot.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:P1}),Ss.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=Ot.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:gj,isWholeLine:!0,linesDecorationsTooltip:P1}),Ss.EXPANDED_VISUAL_DECORATION=Ot.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+bt.asClassName(v3),linesDecorationsTooltip:_2}),Ss.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Ot.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:bt.asClassName(v3),linesDecorationsTooltip:_2}),Ss.MANUALLY_EXPANDED_VISUAL_DECORATION=Ot.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+bt.asClassName(wge),linesDecorationsTooltip:_2}),Ss.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Ot.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:bt.asClassName(wge),linesDecorationsTooltip:_2}),Ss.NO_CONTROLS_EXPANDED_RANGE_DECORATION=Ot.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0}),Ss.HIDDEN_RANGE_DECORATION=Ot.register({description:"folding-hidden-range-decoration",stickiness:1});let sX=Ss;const Srt={},xrt="syntax";class Sne{constructor(e,t,i,n,r){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=n,this.fallbackRangeProvider=r,this.id=xrt,this.disposables=new me,r&&this.disposables.add(r);for(const o of t)typeof o.onDidChange=="function"&&this.disposables.add(o.onDidChange(i))}compute(e){return krt(this.providers,this.editorModel,e).then(t=>{var i;return t?Drt(t,this.foldingRangesLimit):((i=this.fallbackRangeProvider)==null?void 0:i.compute(e))??null})}dispose(){this.disposables.dispose()}}function krt(s,e,t){let i=null;const n=s.map((r,o)=>Promise.resolve(r.provideFoldingRanges(e,Srt,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(i)||(i=[]);const l=e.getLineCount();for(const d of a)d.start>0&&d.end>d.start&&d.end<=l&&i.push({start:d.start,end:d.end,rank:o,kind:d.kind})}},is));return Promise.all(n).then(r=>i)}class Lrt{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,n){if(e>du||t>du)return;const r=this._length;this._startIndexes[r]=e,this._endIndexes[r]=t,this._nestingLevels[r]=n,this._types[r]=i,this._length++,n<30&&(this._nestingLevelCounts[n]=(this._nestingLevelCounts[n]||0)+1)}toIndentRanges(){const e=this._foldingRangesLimit.limit;if(this._length<=e){this._foldingRangesLimit.update(this._length,!1);const t=new Uint32Array(this._length),i=new Uint32Array(this._length);for(let n=0;n<this._length;n++)t[n]=this._startIndexes[n],i[n]=this._endIndexes[n];return new Bl(t,i,this._types)}else{this._foldingRangesLimit.update(this._length,e);let t=0,i=this._nestingLevelCounts.length;for(let a=0;a<this._nestingLevelCounts.length;a++){const l=this._nestingLevelCounts[a];if(l){if(l+t>e){i=a;break}t+=l}}const n=new Uint32Array(e),r=new Uint32Array(e),o=[];for(let a=0,l=0;a<this._length;a++){const d=this._nestingLevels[a];(d<i||d===i&&t++<e)&&(n[l]=this._startIndexes[a],r[l]=this._endIndexes[a],o[l]=this._types[a],l++)}return new Bl(n,r,o)}}}function Drt(s,e){const t=s.sort((o,a)=>{let l=o.start-a.start;return l===0&&(l=o.rank-a.rank),l}),i=new Lrt(e);let n;const r=[];for(const o of t)if(!n)n=o,i.add(o.start,o.end,o.kind&&o.kind.value,r.length);else if(o.start>n.start)if(o.end<=n.end)r.push(n),n=o,i.add(o.start,o.end,o.kind&&o.kind.value,r.length);else{if(o.start>n.end){do n=r.pop();while(n&&o.start>n.end);n&&r.push(n),n=o}i.add(o.start,o.end,o.kind&&o.kind.value,r.length)}return i.toIndentRanges()}var Ert=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},bD=function(s,e){return function(t,i){e(t,i,s)}},Gv;const Kr=new qe("foldingEnabled",!1);var mC;let v_=(mC=class extends re{static get(e){return e.getContribution(Gv.ID)}static getFoldingRangeProviders(e,t){var n;const i=e.foldingRangeProvider.ordered(t);return((n=Gv._foldingRangeSelector)==null?void 0:n.call(Gv,i,t))??i}constructor(e,t,i,n,r,o){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=o,this.localToDispose=this._register(new me),this.editor=e,this._foldingLimitReporter=new TSe(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=r.for(o.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 sX(e),this.foldingDecorationProvider.showFoldingControls=a.get(111),this.foldingDecorationProvider.showFoldingHighlights=a.get(45),this.foldingEnabled=Kr.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(111)||l.hasChanged(45)){const d=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=d.get(111),this.foldingDecorationProvider.showFoldingHighlights=d.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(),i=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:i,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 crt(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new prt(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new Ac(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new ji(()=>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,i;this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),(t=this.updateScheduler)==null||t.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,(i=this.rangeProvider)==null||i.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){var e;(e=this.rangeProvider)==null||e.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new wne(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=Gv.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new Sne(e,i,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){var t;(t=this.hiddenRangeModel)==null||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 cr,i=this.getRangeProvider(e.textModel),n=this.foldingRegionPromise=Zs(r=>i.compute(r));return n.then(r=>{if(r&&n===this.foldingRegionPromise){let o;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const d=r.setCollapsedAllOfType(t_.Imports.value,!0);d&&(o=Wu.capture(this.editor),this._currentModelHasFoldedImports=d)}const a=this.editor.getSelections();e.update(r,Irt(a)),o==null||o.restore(this.editor);const l=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=l)}return e})}).then(void 0,e=>(Tt(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 i=this.editor.getSelections();if(i&&i.length>0){const n=[];for(const r of i){const o=r.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(o)&&n.push(...t.getAllRegionsAtLine(o,a=>a.isCollapsed&&o>a.startLineNumber))}n.length&&(t.toggleCollapseState(n),this.reveal(i[0].getPosition()))}}}).then(void 0,Tt)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range||!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let i=!1;switch(e.target.type){case 4:{const n=e.target.detail,r=e.target.element.offsetLeft;if(n.offsetX-r<4)return;i=!0;break}case 7:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case 6:{if(this.hiddenRangeModel.hasRanges()){const n=this.editor.getModel();if(n&&t.startColumn===n.getLineMaxColumn(t.startLineNumber))break}return}default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:i}}onEditorMouseUp(e){const t=this.foldingModel;if(!t||!this.mouseDownInfo||!e.target)return;const i=this.mouseDownInfo.lineNumber,n=this.mouseDownInfo.iconClicked,r=e.target.range;if(!r||r.startLineNumber!==i)return;if(n){if(e.target.type!==4)return}else{const a=this.editor.getModel();if(!a||r.startColumn!==a.getLineMaxColumn(i))return}const o=t.getRegionAtLine(i);if(o&&o.startLineNumber===i){const a=o.isCollapsed;if(n||a){const l=e.event.altKey;let d=[];if(l){const h=p=>!p.containedBy(o)&&!o.containedBy(p),f=t.getRegionsInside(null,h);for(const p of f)p.isCollapsed&&d.push(p);d.length===0&&(d=f)}else{const h=e.event.middleButton||e.event.shiftKey;if(h)for(const f of t.getRegionsInside(o))f.isCollapsed===a&&d.push(f);(a||!h||d.length===0)&&d.push(o)}t.toggleCollapseState(d),this.reveal({lineNumber:i,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}},Gv=mC,mC.ID="editor.contrib.folding",mC);v_=Gv=Ert([bD(1,yt),bD(2,Bn),bD(3,gs),bD(4,sc),bD(5,it)],v_);class TSe{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 oo extends Ze{runEditorCommand(e,t,i){const n=e.get(Bn),r=v_.get(t);if(!r)return;const o=r.getFoldingModel();if(o)return this.reportTelemetry(e,t),o.then(a=>{if(a){this.invoke(r,a,t,i,n);const l=t.getSelection();l&&r.reveal(l.getStartPosition())}})}getSelectedLines(e){const t=e.getSelections();return t?t.map(i=>i.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(i=>i+1):this.getSelectedLines(t)}run(e,t){}}function Irt(s){return!s||s.length===0?{startsInside:()=>!1}:{startsInside(e,t){for(const i of s){const n=i.startLineNumber;if(n>=e&&n<=t)return!0}return!1}}}function NSe(s){if(!wo(s)){if(!rr(s))return!1;const e=s;if(!wo(e.levels)&&!Qm(e.levels)||!wo(e.direction)&&!Ca(e.direction)||!wo(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(Qm)))return!1}return!0}class Trt extends oo{constructor(){super({id:"editor.unfold",label:w("unfoldAction.label","Unfold"),alias:"Unfold",precondition:Kr,kbOpts:{kbExpr:U.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:
|
|
894
894
|
* 'levels': Number of levels to unfold. If not set, defaults to 1.
|
|
895
895
|
* 'direction': If 'up', unfold given number of levels up otherwise unfolds down.
|
|
896
896
|
* '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.
|
|
@@ -903,19 +903,19 @@ ${e.toString()}`}}class L5{constructor(e=new Vx,t=!1,i,n=mKe){this._services=e,t
|
|
|
903
903
|
`)))]).applyToString(i).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 S3{constructor(e,t,i){this.column=e,this.text=t,this.preview=i,this.lines=of(this.text)}equals(e){return this.column===e.column&&this.lines.length===e.lines.length&&this.lines.every((t,i)=>t===e.lines[i])}}class aX{constructor(e,t,i,n=0){this.lineNumber=e,this.columnRange=t,this.text=i,this.additionalReservedLineCount=n,this.parts=[new S3(this.columnRange.endColumnExclusive,this.text,!1)],this.newLines=of(this.text)}renderForScreenReader(e){return this.newLines.join(`
|
|
904
904
|
`)}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,i)=>t===e.newLines[i])&&this.additionalReservedLineCount===e.additionalReservedLineCount}}function Sge(s,e){return Tn(s,e,PSe)}function PSe(s,e){return s===e?!0:!s||!e?!1:s instanceof TT&&e instanceof TT||s instanceof aX&&e instanceof aX?s.equals(e):!1}const tot=[];function iot(){return tot}class OSe{constructor(e,t){if(this.startColumn=e,this.endColumnExclusive=t,e>t)throw new ki(`startColumn ${e} cannot be after endColumnExclusive ${t}`)}toRange(e){return new W(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}}function ASe(s,e){const t=new me,i=s.createDecorationsCollection();return t.add(SN({debugName:()=>`Apply decorations from ${e.debugName}`},n=>{const r=e.read(n);i.set(r)})),t.add({dispose:()=>{i.clear()}}),t}function not(s,e){return new ie(s.lineNumber+e.lineNumber-1,e.lineNumber===1?s.column+e.column-1:e.column)}function xge(s,e){return new ie(s.lineNumber-e.lineNumber+1,s.lineNumber-e.lineNumber===0?s.column-e.column+1:s.column)}var sot=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},rot=function(s,e){return function(t,i){e(t,i,s)}};const kge="ghost-text";let lX=class extends re{constructor(e,t,i){super(),this.editor=e,this.model=t,this.languageService=i,this.isDisposed=Kt(this,!1),this.currentTextModel=Bi(this,this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=lt(this,n=>{if(this.isDisposed.read(n))return;const r=this.currentTextModel.read(n);if(r!==this.model.targetTextModel.read(n))return;const o=this.model.ghostText.read(n);if(!o)return;const a=o instanceof aX?o.columnRange:void 0,l=[],d=[];function h(b,y){if(d.length>0){const x=d[d.length-1];y&&x.decorations.push(new zo(x.content.length+1,x.content.length+1+b[0].length,y,0)),x.content+=b[0],b=b.slice(1)}for(const x of b)d.push({content:x,decorations:y?[new zo(1,x.length+1,y,0)]:[]})}const f=r.getLineContent(o.lineNumber);let p,m=0;for(const b of o.parts){let y=b.lines;p===void 0?(l.push({column:b.column,text:y[0],preview:b.preview}),y=y.slice(1)):h([f.substring(m,b.column-1)],void 0),y.length>0&&(h(y,kge),p===void 0&&b.column<=f.length&&(p=b.column)),m=b.column-1}p!==void 0&&h([f.substring(m)],void 0);const v=p!==void 0?new OSe(p,f.length+1):void 0;return{replacedRange:a,inlineTexts:l,additionalLines:d,hiddenRange:v,lineNumber:o.lineNumber,additionalReservedLineCount:this.model.minReservedLineCount.read(n),targetTextModel:r}}),this.decorations=lt(this,n=>{const r=this.uiState.read(n);if(!r)return[];const o=[];r.replacedRange&&o.push({range:r.replacedRange.toRange(r.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace",description:"GhostTextReplacement"}}),r.hiddenRange&&o.push({range:r.hiddenRange.toRange(r.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const a of r.inlineTexts)o.push({range:W.fromPositions(new ie(r.lineNumber,a.column)),options:{description:kge,after:{content:a.text,inlineClassName:a.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:yd.Left},showIfCollapsed:!0}});return o}),this.additionalLinesWidget=this._register(new oot(this.editor,this.languageService.languageIdCodec,lt(n=>{const r=this.uiState.read(n);return r?{lineNumber:r.lineNumber,additionalLines:r.additionalLines,minReservedLineCount:r.additionalReservedLineCount,targetTextModel:r.targetTextModel}:void 0}))),this._register(dt(()=>{this.isDisposed.set(!0,void 0)})),this._register(ASe(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};lX=sot([rot(2,Nn)],lX);class oot extends re{get viewZoneId(){return this._viewZoneId}constructor(e,t,i){super(),this.editor=e,this.languageIdCodec=t,this.lines=i,this._viewZoneId=void 0,this.editorOptionsChanged=Hr("editorOptionChanged",We.filter(this.editor.onDidChangeConfiguration,n=>n.hasChanged(33)||n.hasChanged(118)||n.hasChanged(100)||n.hasChanged(95)||n.hasChanged(51)||n.hasChanged(50)||n.hasChanged(67))),this._register(Et(n=>{const r=this.lines.read(n);this.editorOptionsChanged.read(n),r?this.updateLines(r.lineNumber,r.additionalLines,r.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,i){const n=this.editor.getModel();if(!n)return;const{tabSize:r}=n.getOptions();this.editor.changeViewZones(o=>{this._viewZoneId&&(o.removeZone(this._viewZoneId),this._viewZoneId=void 0);const a=Math.max(t.length,i);if(a>0){const l=document.createElement("div");aot(l,r,t,this.editor.getOptions(),this.languageIdCodec),this._viewZoneId=o.addZone({afterLineNumber:e,heightInLines:a,domNode:l,afterColumnAffinity:1})}})}}function aot(s,e,t,i,n){const r=i.get(33),o=i.get(118),a="none",l=i.get(95),d=i.get(51),h=i.get(50),f=i.get(67),p=new Ix(1e4);p.appendString('<div class="suggest-preview-text">');for(let b=0,y=t.length;b<y;b++){const x=t[b],D=x.content;p.appendString('<div class="view-line'),p.appendString('" style="top:'),p.appendString(String(b*f)),p.appendString('px;width:1000000px;">');const S=dN(D),E=ES(D),I=dr.createEmpty(D,n);MN(new T_(h.isMonospace&&!r,h.canUseHalfwidthRightwardsArrow,D,!1,S,E,0,I,x.decorations,e,0,h.spaceWidth,h.middotWidth,h.wsmiddotWidth,o,a,l,d!==Jm.OFF,null),p),p.appendString("</div>")}p.appendString("</div>"),kr(s,h);const m=p.build(),v=Lge?Lge.createHTML(m):m;s.innerHTML=v}const Lge=Ug("editorGhostText",{createHTML:s=>s});function lot(s,e){const t=new Nye,i=new Rye(t,d=>e.getLanguageConfiguration(d)),n=new Mye(new cot([s]),i),r=pG(n,[],void 0,!0);let o="";const a=s.getLineContent();function l(d,h){if(d.kind===2)if(l(d.openingBracket,h),h=Gn(h,d.openingBracket.length),d.child&&(l(d.child,h),h=Gn(h,d.child.length)),d.closingBracket)l(d.closingBracket,h),h=Gn(h,d.closingBracket.length);else{const p=i.getSingleLanguageBracketTokens(d.openingBracket.languageId).findClosingTokenText(d.openingBracket.bracketIds);o+=p}else if(d.kind!==3){if(d.kind===0||d.kind===1)o+=a.substring(h,Gn(h,d.length));else if(d.kind===4)for(const f of d.children)l(f,h),h=Gn(h,f.length)}}return l(r,$o),o}class cot{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 FSe(s,e,t,i,n=$t.None,r){const o=e instanceof ie?hot(e,t):e,a=s.all(t),l=new Fee;for(const x of a)x.groupId&&l.add(x.groupId,x);function d(x){if(!x.yieldsToGroupIds)return[];const D=[];for(const S of x.yieldsToGroupIds||[]){const E=l.get(S);for(const I of E)D.push(I)}return D}const h=new Map,f=new Set;function p(x,D){if(D=[...D,x],f.has(x))return D;f.add(x);try{const S=d(x);for(const E of S){const I=p(E,D);if(I)return I}}finally{f.delete(x)}}function m(x){const D=h.get(x);if(D)return D;const S=p(x,[]);S&&is(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${S.map(I=>I.toString?I.toString():""+I).join(" -> ")}`));const E=new kx;return h.set(x,E.p),(async()=>{var I;if(!S){const R=d(x);for(const M of R){const O=await m(M);if(O&&O.items.length>0)return}}try{return e instanceof ie?await x.provideInlineCompletions(t,e,i,n):await((I=x.provideInlineEdits)==null?void 0:I.call(x,t,e,i,n))}catch(R){is(R);return}})().then(I=>E.complete(I),I=>E.error(I)),E.p}const v=await Promise.all(a.map(async x=>({provider:x,completions:await m(x)}))),b=new Map,y=[];for(const x of v){const D=x.completions;if(!D)continue;const S=new uot(D,x.provider);y.push(S);for(const E of D.items){const I=x3.from(E,S,o,t,r);b.set(I.hash(),I)}}return new dot(Array.from(b.values()),new Set(b.keys()),y)}class dot{constructor(e,t,i){this.completions=e,this.hashs=t,this.providerResults=i}has(e){return this.hashs.has(e.hash())}dispose(){for(const e of this.providerResults)e.removeRef()}}class uot{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 x3{static from(e,t,i,n,r){let o,a,l=e.range?W.lift(e.range):i;if(typeof e.insertText=="string"){if(o=e.insertText,r&&e.completeBracketPairs){o=Dge(o,l.getStartPosition(),n,r);const d=o.length-e.insertText.length;d!==0&&(l=new W(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn+d))}a=void 0}else if("snippet"in e.insertText){const d=e.insertText.snippet.length;if(r&&e.completeBracketPairs){e.insertText.snippet=Dge(e.insertText.snippet,l.getStartPosition(),n,r);const f=e.insertText.snippet.length-d;f!==0&&(l=new W(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn+f))}const h=new cy().parse(e.insertText.snippet);h.children.length===1&&h.children[0]instanceof Ho?(o=h.children[0].value,a=void 0):(o=h.toString(),a={snippet:e.insertText.snippet,range:l})}else IH(e.insertText);return new x3(o,e.command,l,o,a,e.additionalTextEdits||iot(),e,t)}constructor(e,t,i,n,r,o,a,l){this.filterText=e,this.command=t,this.range=i,this.insertText=n,this.snippetInfo=r,this.additionalTextEdits=o,this.sourceInlineCompletion=a,this.source=l,e=e.replace(/\r\n|\r/g,`
|
|
905
905
|
`),n=e.replace(/\r\n|\r/g,`
|
|
906
|
-
`)}withRange(e){return new x3(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()})}toSingleTextEdit(){return new Zh(this.range,this.insertText)}}function hot(s,e){const t=e.getWordAtPosition(s),i=e.getLineMaxColumn(s.lineNumber);return t?new W(s.lineNumber,t.startColumn,s.lineNumber,i):W.fromPositions(s,s.with(void 0,i))}function Dge(s,e,t,i){const r=t.getLineContent(e.lineNumber).substring(0,e.column-1)+s,o=t.tokenization.tokenizeLineWithEdit(e,r.length-(e.column-1),s),a=o==null?void 0:o.sliceAndInflate(e.column-1,r.length,0);return a?lot(a,i):s}function Vb(s,e,t){const i=t?s.range.intersectRanges(t):s.range;if(!i)return s;const n=e.getValueInRange(i,1),r=i_(n,s.text),o=Nd.ofText(n.substring(0,r)).addToPosition(s.range.getStartPosition()),a=s.text.substring(r),l=W.fromPositions(o,s.range.getEndPosition());return new Zh(l,a)}function BSe(s,e){return s.text.startsWith(e.text)&&fot(s.range,e.range)}function Ege(s,e,t,i,n=0){let r=Vb(s,e);if(r.range.endLineNumber!==r.range.startLineNumber)return;const o=e.getLineContent(r.range.startLineNumber),a=Zi(o).length;if(r.range.startColumn-1<=a){const v=Zi(r.text).length,b=o.substring(r.range.startColumn-1,a),[y,x]=[r.range.getStartPosition(),r.range.getEndPosition()],D=y.column+b.length<=x.column?y.delta(0,b.length):x,S=W.fromPositions(D,x),E=r.text.startsWith(b)?r.text.substring(b.length):r.text.substring(v);r=new Zh(S,E)}const d=e.getValueInRange(r.range),h=got(d,r.text);if(!h)return;const f=r.range.startLineNumber,p=new Array;if(t==="prefix"){const v=h.filter(b=>b.originalLength===0);if(v.length>1||v.length===1&&v[0].originalStart!==d.length)return}const m=r.text.length-n;for(const v of h){const b=r.range.startColumn+v.originalStart+v.originalLength;if(t==="subwordSmart"&&i&&i.lineNumber===r.range.startLineNumber&&b<i.column||v.originalLength>0)return;if(v.modifiedLength===0)continue;const y=v.modifiedStart+v.modifiedLength,x=Math.max(v.modifiedStart,Math.min(y,m)),D=r.text.substring(v.modifiedStart,x),S=r.text.substring(x,Math.max(v.modifiedStart,y));D.length>0&&p.push(new S3(b,D,!1)),S.length>0&&p.push(new S3(b,S,!0))}return new TT(f,p)}function fot(s,e){return e.getStartPosition().equals(s.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(s.getEndPosition())}let fh;function got(s,e){if((fh==null?void 0:fh.originalValue)===s&&(fh==null?void 0:fh.newValue)===e)return fh==null?void 0:fh.changes;{let t=Tge(s,e,!0);if(t){const i=Ige(t);if(i>0){const n=Tge(s,e,!1);n&&Ige(n)<i&&(t=n)}}return fh={originalValue:s,newValue:e,changes:t},t}}function Ige(s){let e=0;for(const t of s)e+=t.originalLength;return e}function Tge(s,e,t){if(s.length>5e3||e.length>5e3)return;function i(d){let h=0;for(let f=0,p=d.length;f<p;f++){const m=d.charCodeAt(f);m>h&&(h=m)}return h}const n=Math.max(i(s),i(e));function r(d){if(d<0)throw new Error("unexpected");return n+d+1}function o(d){let h=0,f=0;const p=new Int32Array(d.length);for(let m=0,v=d.length;m<v;m++)if(t&&d[m]==="("){const b=f*100+h;p[m]=r(2*b),h++}else if(t&&d[m]===")"){h=Math.max(h-1,0);const b=f*100+h;p[m]=r(2*b+1),h===0&&f++}else p[m]=d.charCodeAt(m);return p}const a=o(s),l=o(e);return new Ph({getElements:()=>a},{getElements:()=>l}).ComputeDiff(!1).changes}var pot=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Nge=function(s,e){return function(t,i){e(t,i,s)}};let cX=class extends re{constructor(e,t,i,n,r){super(),this.textModel=e,this.versionId=t,this._debounceValue=i,this.languageFeaturesService=n,this.languageConfigurationService=r,this._updateOperation=this._register(new Js),this.inlineCompletions=jI("inlineCompletions",void 0),this.suggestWidgetInlineCompletions=jI("suggestWidgetInlineCompletions",void 0),this._register(this.textModel.onDidChangeContent(()=>{this._updateOperation.clear()}))}fetch(e,t,i){var h,f;const n=new _ot(e,t,this.textModel.getVersionId()),r=t.selectedSuggestionInfo?this.suggestWidgetInlineCompletions:this.inlineCompletions;if((h=this._updateOperation.value)!=null&&h.request.satisfies(n))return this._updateOperation.value.promise;if((f=r.get())!=null&&f.request.satisfies(n))return Promise.resolve(!0);const o=!!this._updateOperation.value;this._updateOperation.clear();const a=new An,l=(async()=>{if((o||t.triggerKind===Lu.Automatic)&&await mot(this._debounceValue.get(this.textModel),a.token),a.token.isCancellationRequested||this._store.isDisposed||this.textModel.getVersionId()!==n.versionId)return!1;const m=new Date,v=await FSe(this.languageFeaturesService.inlineCompletionsProvider,e,this.textModel,t,a.token,this.languageConfigurationService);if(a.token.isCancellationRequested||this._store.isDisposed||this.textModel.getVersionId()!==n.versionId)return!1;const b=new Date;this._debounceValue.update(this.textModel,b.getTime()-m.getTime());const y=new bot(v,n,this.textModel,this.versionId);if(i){const x=i.toInlineCompletion(void 0);i.canBeReused(this.textModel,e)&&!v.has(x)&&y.prepend(i.inlineCompletion,x.range,!0)}return this._updateOperation.clear(),On(x=>{r.set(y,x)}),!0})(),d=new vot(n,a,l);return this._updateOperation.value=d,l}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.request.context.selectedSuggestionInfo&&this._updateOperation.clear(),this.suggestWidgetInlineCompletions.set(void 0,e)}cancelUpdate(){this._updateOperation.clear()}};cX=pot([Nge(3,it),Nge(4,Bn)],cX);function mot(s,e){return new Promise(t=>{let i;const n=setTimeout(()=>{i&&i.dispose(),t()},s);e&&(i=e.onCancellationRequested(()=>{clearTimeout(n),i&&i.dispose(),t()}))})}class _ot{constructor(e,t,i){this.position=e,this.context=t,this.versionId=i}satisfies(e){return this.position.equals(e.position)&&YK(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,v6e())&&(e.context.triggerKind===Lu.Automatic||this.context.triggerKind===Lu.Explicit)&&this.versionId===e.versionId}}class vot{constructor(e,t,i){this.request=e,this.cancellationTokenSource=t,this.promise=i}dispose(){this.cancellationTokenSource.cancel()}}class bot{get inlineCompletions(){return this._inlineCompletions}constructor(e,t,i,n){this.inlineCompletionProviderResult=e,this.request=t,this._textModel=i,this._versionId=n,this._refCount=1,this._prependedInlineCompletionItems=[];const r=i.deltaDecorations([],e.completions.map(o=>({range:o.range,options:{description:"inline-completion-tracking-range"}})));this._inlineCompletions=e.completions.map((o,a)=>new Mge(o,r[a],this._textModel,this._versionId))}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,i){i&&e.source.addRef();const n=this._textModel.deltaDecorations([],[{range:t,options:{description:"inline-completion-tracking-range"}}])[0];this._inlineCompletions.unshift(new Mge(e,n,this._textModel,this._versionId)),this._prependedInlineCompletionItems.push(e)}}class Mge{get forwardStable(){return this.inlineCompletion.source.inlineCompletions.enableForwardStability??!1}constructor(e,t,i,n){this.inlineCompletion=e,this.decorationId=t,this._textModel=i,this._modelVersion=n,this.semanticId=JSON.stringify([this.inlineCompletion.filterText,this.inlineCompletion.insertText,this.inlineCompletion.range.getStartPosition().toString()]),this._updatedRange=Hl({owner:this,equalsFn:W.equalsRange},r=>(this._modelVersion.read(r),this._textModel.getDecorationRange(this.decorationId)))}toInlineCompletion(e){return this.inlineCompletion.withRange(this._updatedRange.read(e)??mj)}toSingleTextEdit(e){return new Zh(this._updatedRange.read(e)??mj,this.inlineCompletion.insertText)}isVisible(e,t,i){const n=Vb(this._toFilterTextReplacement(i),e),r=this._updatedRange.read(i);if(!r||!this.inlineCompletion.range.getStartPosition().equals(r.getStartPosition())||t.lineNumber!==n.range.startLineNumber)return!1;const o=e.getValueInRange(n.range,1),a=n.text,l=Math.max(0,t.column-n.range.startColumn);let d=a.substring(0,l),h=a.substring(l),f=o.substring(0,l),p=o.substring(l);const m=e.getLineIndentColumn(n.range.startLineNumber);return n.range.startColumn<=m&&(f=f.trimStart(),f.length===0&&(p=p.trimStart()),d=d.trimStart(),d.length===0&&(h=h.trimStart())),d.startsWith(f)&&!!FCe(p,h)}canBeReused(e,t){const i=this._updatedRange.read(void 0);return!!i&&i.containsPosition(t)&&this.isVisible(e,t,void 0)&&Nd.ofRange(i).isGreaterThanOrEqualTo(Nd.ofRange(this.inlineCompletion.range))}_toFilterTextReplacement(e){return new Zh(this._updatedRange.read(e)??mj,this.inlineCompletion.filterText)}}const mj=new W(1,1,1,1),zt={Visible:_ne,HasFocusedSuggestion:new qe("suggestWidgetHasFocusedSuggestion",!1,w("suggestWidgetHasSelection","Whether any suggestion is focused")),DetailsVisible:new qe("suggestWidgetDetailsVisible",!1,w("suggestWidgetDetailsVisible","Whether suggestion details are visible")),MultipleSuggestions:new qe("suggestWidgetMultipleSuggestions",!1,w("suggestWidgetMultipleSuggestions","Whether there are multiple suggestions to pick from")),MakesTextEdit:new qe("suggestionMakesTextEdit",!0,w("suggestionMakesTextEdit","Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new qe("acceptSuggestionOnEnter",!0,w("acceptSuggestionOnEnter","Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new qe("suggestionHasInsertAndReplaceRange",!1,w("suggestionHasInsertAndReplaceRange","Whether the current suggestion has insert and replace behaviour")),InsertMode:new qe("suggestionInsertMode",void 0,{type:"string",description:w("suggestionInsertMode","Whether the default behaviour is to insert or replace")}),CanResolve:new qe("suggestionCanResolve",!1,w("suggestionCanResolve","Whether the current suggestion supports to resolve further details"))},Nm=new st("suggestWidgetStatusBar");class Cot{constructor(e,t,i,n){var r;this.position=e,this.completion=t,this.container=i,this.provider=n,this.isInvalid=!1,this.score=Tu.Default,this.distance=0,this.textLabel=typeof t.label=="string"?t.label:(r=t.label)==null?void 0:r.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,W.isIRange(t.range)?(this.editStart=new ie(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new ie(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new ie(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||W.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new ie(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new ie(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new ie(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||W.spansMultipleLines(t.range.insert)||W.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 n.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}),i=new cr(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(n=>{Object.assign(this.completion,n),this._resolveDuration=i.elapsed()},n=>{zc(n)&&(this._resolveCache=void 0,this._resolveDuration=void 0)}).finally(()=>{t.dispose()})}return this._resolveCache}}const sW=class sW{constructor(e=2,t=new Set,i=new Set,n=new Map,r=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.providerItemsToReuse=n,this.showDeprecated=r}};sW.default=new sW;let NT=sW;class yot{constructor(e,t,i,n){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=n}}async function xne(s,e,t,i=NT.default,n={triggerKind:0},r=$t.None){const o=new cr;t=t.clone();const a=e.getWordAtPosition(t),l=a?new W(t.lineNumber,a.startColumn,t.lineNumber,a.endColumn):W.fromPositions(t),d={replace:l,insert:l.setEndPosition(t.lineNumber,t.column)},h=[],f=new me,p=[];let m=!1;const v=(y,x,D)=>{var E;let S=!1;if(!x)return S;for(const I of x.suggestions)if(!i.kindFilter.has(I.kind)){if(!i.showDeprecated&&((E=I==null?void 0:I.tags)!=null&&E.includes(1)))continue;I.range||(I.range=d),I.sortText||(I.sortText=typeof I.label=="string"?I.label:I.label.label),!m&&I.insertTextRules&&I.insertTextRules&4&&(m=cy.guessNeedsClipboard(I.insertText)),h.push(new Cot(t,I,x,y)),S=!0}return uH(x)&&f.add(x),p.push({providerName:y._debugDisplayName??"unknown_provider",elapsedProvider:x.duration??-1,elapsedOverall:D.elapsed()}),S},b=(async()=>{})();for(const y of s.orderedGroups(e)){let x=!1;if(await Promise.all(y.map(async D=>{if(i.providerItemsToReuse.has(D)){const S=i.providerItemsToReuse.get(D);S.forEach(E=>h.push(E)),x=x||S.length>0;return}if(!(i.providerFilter.size>0&&!i.providerFilter.has(D)))try{const S=new cr,E=await D.provideCompletionItems(e,t,n,r);x=v(D,E,S)||x}catch(S){is(S)}})),x||r.isCancellationRequested)break}return await b,r.isCancellationRequested?(f.dispose(),Promise.reject(new Ed)):new yot(h.sort(xot(i.snippetSortOrder)),m,{entries:p,elapsed:o.elapsed()},f)}function kne(s,e){if(s.sortTextLow&&e.sortTextLow){if(s.sortTextLow<e.sortTextLow)return-1;if(s.sortTextLow>e.sortTextLow)return 1}return s.textLabel<e.textLabel?-1:s.textLabel>e.textLabel?1:s.completion.kind-e.completion.kind}function wot(s,e){if(s.completion.kind!==e.completion.kind){if(s.completion.kind===27)return-1;if(e.completion.kind===27)return 1}return kne(s,e)}function Sot(s,e){if(s.completion.kind!==e.completion.kind){if(s.completion.kind===27)return 1;if(e.completion.kind===27)return-1}return kne(s,e)}const BV=new Map;BV.set(0,wot);BV.set(2,Sot);BV.set(1,kne);function xot(s){return BV.get(s)}hi.registerCommand("_executeCompletionItemProvider",async(s,...e)=>{const[t,i,n,r]=e;Ci(gt.isUri(t)),Ci(ie.isIPosition(i)),Ci(typeof n=="string"||!n),Ci(typeof r=="number"||!r);const{completionProvider:o}=s.get(it),a=await s.get(Ea).createModelReference(t);try{const l={incomplete:!1,suggestions:[]},d=[],h=a.object.textEditorModel.validatePosition(i),f=await xne(o,a.object.textEditorModel,h,void 0,{triggerCharacter:n??void 0,triggerKind:n?1:0});for(const p of f.items)d.length<(r??0)&&d.push(p.resolve($t.None)),l.incomplete=l.incomplete||p.container.incomplete,l.suggestions.push(p.completion);try{return await Promise.all(d),l}finally{setTimeout(()=>f.disposable.dispose(),100)}}finally{a.dispose()}});function kot(s,e){var t;(t=s.getContribution("editor.contrib.suggestController"))==null||t.triggerSuggest(new Set().add(e),void 0,!0)}class b0{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 Rge(s,e=Ur){return zHe(s,e)?s.charAt(0).toUpperCase()+s.slice(1):s}var Lot=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Dot=function(s,e){return function(t,i){e(t,i,s)}};class Pge{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){const i=t.resolve(e);if(i!==void 0)return i}}}class Oge{constructor(e,t,i,n){this._model=e,this._selection=t,this._selectionIdx=i,this._overtypingCapturer=n}resolve(e){const{name:t}=e;if(t==="SELECTION"||t==="TM_SELECTED_TEXT"){let i=this._model.getValueInRange(this._selection)||void 0,n=this._selection.startLineNumber!==this._selection.endLineNumber;if(!i&&this._overtypingCapturer){const r=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);r&&(i=r.value,n=r.multiline)}if(i&&n&&e.snippet){const r=this._model.getLineContent(this._selection.startLineNumber),o=Zi(r,0,this._selection.startColumn-1);let a=o;e.snippet.walk(d=>d===e?!1:(d instanceof Ho&&(a=Zi(of(d.value).pop())),!0));const l=i_(a,o);i=i.replace(/(\r\n|\r|\n)(.*)/g,(d,h,f)=>`${h}${a.substr(l)}${f}`)}return i}else{if(t==="TM_CURRENT_LINE")return this._model.getLineContent(this._selection.positionLineNumber);if(t==="TM_CURRENT_WORD"){const i=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return i&&i.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 Age{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return km(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const i=km(this._model.uri.fsPath),n=i.lastIndexOf(".");return n<=0?i:i.slice(0,n)}else{if(t==="TM_DIRECTORY")return kve(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(KH(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 Fge{constructor(e,t,i,n){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=i,this._spread=n}resolve(e){if(e.name!=="CLIPBOARD")return;const t=this._readClipboardText();if(t){if(this._spread){const i=t.split(/\r\n|\n|\r/).filter(n=>!Pve(n));if(i.length===this._selectionCount)return i[this._selectionIdx]}return t}}}let k3=class{constructor(e,t,i){this._model=e,this._selection=t,this._languageConfigurationService=i}resolve(e){const{name:t}=e,i=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),n=this._languageConfigurationService.getLanguageConfiguration(i).comments;if(n){if(t==="LINE_COMMENT")return n.lineCommentToken||void 0;if(t==="BLOCK_COMMENT_START")return n.blockCommentStartToken||void 0;if(t==="BLOCK_COMMENT_END")return n.blockCommentEndToken||void 0}}};k3=Lot([Dot(2,Bn)],k3);const kh=class kh{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 kh.dayNames[this._date.getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return kh.dayNamesShort[this._date.getDay()];if(t==="CURRENT_MONTH_NAME")return kh.monthNames[this._date.getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return kh.monthNamesShort[this._date.getMonth()];if(t==="CURRENT_SECONDS_UNIX")return String(Math.floor(this._date.getTime()/1e3));if(t==="CURRENT_TIMEZONE_OFFSET"){const i=this._date.getTimezoneOffset(),n=i>0?"-":"+",r=Math.trunc(Math.abs(i/60)),o=r<10?"0"+r:r,a=Math.abs(i)-r*60,l=a<10?"0"+a:a;return n+o+":"+l}}};kh.dayNames=[w("Sunday","Sunday"),w("Monday","Monday"),w("Tuesday","Tuesday"),w("Wednesday","Wednesday"),w("Thursday","Thursday"),w("Friday","Friday"),w("Saturday","Saturday")],kh.dayNamesShort=[w("SundayShort","Sun"),w("MondayShort","Mon"),w("TuesdayShort","Tue"),w("WednesdayShort","Wed"),w("ThursdayShort","Thu"),w("FridayShort","Fri"),w("SaturdayShort","Sat")],kh.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")],kh.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")];let L3=kh;class Bge{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=a6e(this._workspaceService.getWorkspace());if(!r6e(t)){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(t);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(t)}}_resolveWorkspaceName(e){if(VK(e))return km(e.uri.path);let t=km(e.configPath.path);return t.endsWith($K)&&(t=t.substr(0,t.length-$K.length-1)),t}_resoveWorkspacePath(e){if(VK(e))return Rge(e.uri.fsPath);const t=km(e.configPath.path);let i=e.configPath.fsPath;return i.endsWith(t)&&(i=i.substr(0,i.length-t.length-1)),i?Rge(i):"/"}}class Wge{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 EV()}}var Eot=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Iot=function(s,e){return function(t,i){e(t,i,s)}},tu;const gd=class gd{constructor(e,t,i){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=i,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=Gle(t.placeholders,xc.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 i of this._snippet.placeholders){const n=this._snippet.offset(i),r=this._snippet.fullLen(i),o=W.fromPositions(e.getPositionAt(this._offset+n),e.getPositionAt(this._offset+n+r)),a=i.isFinalTabstop?gd._decor.inactiveFinal:gd._decor.inactive,l=t.addDecoration(o,a);this._placeholderDecorations.set(i,l)}})}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const n=[];for(const r of this._placeholderGroups[this._placeholderGroupsIdx])if(r.transform){const o=this._placeholderDecorations.get(r),a=this._editor.getModel().getDecorationRange(o),l=this._editor.getModel().getValueInRange(a),d=r.transform.resolve(l).split(/\r\n|\r|\n/);for(let h=1;h<d.length;h++)d[h]=this._editor.getModel().normalizeIndentation(this._snippetLineLeadingWhitespace+d[h]);n.push(Pn.replace(a,d.join(this._editor.getModel().getEOL())))}n.length>0&&this._editor.executeEdits("snippet.placeholderTransform",n)}let t=!1;e===!0&&this._placeholderGroupsIdx<this._placeholderGroups.length-1?(this._placeholderGroupsIdx+=1,t=!0):e===!1&&this._placeholderGroupsIdx>0&&(this._placeholderGroupsIdx-=1,t=!0);const i=this._editor.getModel().changeDecorations(n=>{const r=new Set,o=[];for(const a of this._placeholderGroups[this._placeholderGroupsIdx]){const l=this._placeholderDecorations.get(a),d=this._editor.getModel().getDecorationRange(l);o.push(new ot(d.startLineNumber,d.startColumn,d.endLineNumber,d.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),n.changeDecorationOptions(l,a.isFinalTabstop?gd._decor.activeFinal:gd._decor.active),r.add(a);for(const h of this._snippet.enclosingPlaceholders(a)){const f=this._placeholderDecorations.get(h);n.changeDecorationOptions(f,h.isFinalTabstop?gd._decor.activeFinal:gd._decor.active),r.add(h)}}for(const[a,l]of this._placeholderDecorations)r.has(a)||n.changeDecorationOptions(l,a.isFinalTabstop?gd._decor.inactiveFinal:gd._decor.inactive);return o});return t?this.move(e):i??[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof xc){const i=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(i).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 i;for(const n of t){if(n.isFinalTabstop)break;i||(i=[],e.set(n.index,i));const r=this._placeholderDecorations.get(n),o=this._editor.getModel().getDecorationRange(r);if(!o){e.delete(n.index);break}i.push(o)}}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 i=this._editor.getModel().getDecorationRange(t);if(i)return{range:i,choice:e.choice}}get hasChoice(){let e=!1;return this._snippet.walk(t=>(e=t instanceof Kx,!e)),e}merge(e){const t=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations(i=>{for(const n of this._placeholderGroups[this._placeholderGroupsIdx]){const r=e.shift();console.assert(r._offset!==-1),console.assert(!r._placeholderDecorations);const o=r._snippet.placeholderInfo.last.index;for(const l of r._snippet.placeholderInfo.all)l.isFinalTabstop?l.index=n.index+(o+1)/this._nestingLevel:l.index=n.index+l.index/this._nestingLevel;this._snippet.replace(n,r._snippet.children);const a=this._placeholderDecorations.get(n);i.removeDecoration(a),this._placeholderDecorations.delete(n);for(const l of r._snippet.placeholders){const d=r._snippet.offset(l),h=r._snippet.fullLen(l),f=W.fromPositions(t.getPositionAt(r._offset+d),t.getPositionAt(r._offset+d+h)),p=i.addDecoration(f,gd._decor.inactive);this._placeholderDecorations.set(l,p)}}this._placeholderGroups=Gle(this._snippet.placeholders,xc.compareByIndex)})}};gd._decor={active:Ot.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:Ot.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:Ot.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:Ot.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})};let D3=gd;const Hge={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let E3=tu=class{static adjustWhitespace(e,t,i,n,r){const o=e.getLineContent(t.lineNumber),a=Zi(o,0,t.column-1);let l;return n.walk(d=>{if(!(d instanceof Ho)||d.parent instanceof Kx||r&&!r.has(d))return!0;const h=d.value.split(/\r\n|\r|\n/);if(i){const p=n.offset(d);if(p===0)h[0]=e.normalizeIndentation(h[0]);else{l=l??n.toString();const m=l.charCodeAt(p-1);(m===10||m===13)&&(h[0]=e.normalizeIndentation(a+h[0]))}for(let m=1;m<h.length;m++)h[m]=e.normalizeIndentation(a+h[m])}const f=h.join(e.getEOL());return f!==d.value&&(d.parent.replace(d,[new Ho(f)]),l=void 0),!0}),a}static adjustSelection(e,t,i,n){if(i!==0||n!==0){const{positionLineNumber:r,positionColumn:o}=t,a=o-i,l=o+n,d=e.validateRange({startLineNumber:r,startColumn:a,endLineNumber:r,endColumn:l});t=ot.createWithDirection(d.startLineNumber,d.startColumn,d.endLineNumber,d.endColumn,t.getDirection())}return t}static createEditsAndSnippetsFromSelections(e,t,i,n,r,o,a,l,d){const h=[],f=[];if(!e.hasModel())return{edits:h,snippets:f};const p=e.getModel(),m=e.invokeWithinContext(E=>E.get(ty)),v=e.invokeWithinContext(E=>new Age(E.get(HS),p)),b=()=>a,y=p.getValueInRange(tu.adjustSelection(p,e.getSelection(),i,0)),x=p.getValueInRange(tu.adjustSelection(p,e.getSelection(),0,n)),D=p.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),S=e.getSelections().map((E,I)=>({selection:E,idx:I})).sort((E,I)=>W.compareRangesUsingStarts(E.selection,I.selection));for(const{selection:E,idx:I}of S){let R=tu.adjustSelection(p,E,i,0),M=tu.adjustSelection(p,E,0,n);y!==p.getValueInRange(R)&&(R=E),x!==p.getValueInRange(M)&&(M=E);const O=E.setStartPosition(R.startLineNumber,R.startColumn).setEndPosition(M.endLineNumber,M.endColumn),H=new cy().parse(t,!0,r),te=O.getStartPosition(),J=tu.adjustWhitespace(p,te,o||I>0&&D!==p.getLineFirstNonWhitespaceColumn(E.positionLineNumber),H);H.resolveVariables(new Pge([v,new Fge(b,I,S.length,e.getOption(79)==="spread"),new Oge(p,E,I,l),new k3(p,E,d),new L3,new Bge(m),new Wge])),h[I]=Pn.replace(O,H.toString()),h[I].identifier={major:I,minor:0},h[I]._isTracked=!0,f[I]=new D3(e,H,J)}return{edits:h,snippets:f}}static createEditsAndSnippetsFromEdits(e,t,i,n,r,o,a){if(!e.hasModel()||t.length===0)return{edits:[],snippets:[]};const l=[],d=e.getModel(),h=new cy,f=new BN,p=new Pge([e.invokeWithinContext(v=>new Age(v.get(HS),d)),new Fge(()=>r,0,e.getSelections().length,e.getOption(79)==="spread"),new Oge(d,e.getSelection(),0,o),new k3(d,e.getSelection(),a),new L3,new Bge(e.invokeWithinContext(v=>v.get(ty))),new Wge]);t=t.sort((v,b)=>W.compareRangesUsingStarts(v.range,b.range));let m=0;for(let v=0;v<t.length;v++){const{range:b,template:y}=t[v];if(v>0){const I=t[v-1].range,R=W.fromPositions(I.getEndPosition(),b.getStartPosition()),M=new Ho(d.getValueInRange(R));f.appendChild(M),m+=M.value.length}const x=h.parseFragment(y,f);tu.adjustWhitespace(d,b.getStartPosition(),!0,f,new Set(x)),f.resolveVariables(p);const D=f.toString(),S=D.slice(m);m=D.length;const E=Pn.replace(b,S);E.identifier={major:v,minor:0},E._isTracked=!0,l.push(E)}return h.ensureFinalTabstop(f,i,!0),{edits:l,snippets:[new D3(e,f,"")]}}constructor(e,t,i=Hge,n){this._editor=e,this._template=t,this._options=i,this._languageConfigurationService=n,this._templateMerges=[],this._snippets=[]}dispose(){Xi(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"?tu.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):tu.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,i=>{const n=i.filter(r=>!!r.identifier);for(let r=0;r<t.length;r++)t[r].initialize(n[r].textChange);return this._snippets[0].hasPlaceholder?this._move(!0):n.map(r=>ot.fromPositions(r.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=Hge){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:i,snippets:n}=tu.createEditsAndSnippetsFromSelections(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",i,r=>{const o=r.filter(l=>!!l.identifier);for(let l=0;l<n.length;l++)n[l].initialize(o[l].textChange);const a=n[0].isTrivialSnippet;if(!a){for(const l of this._snippets)l.merge(n);console.assert(n.length===0)}return this._snippets[0].hasPlaceholder&&!a?this._move(void 0):o.map(l=>ot.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 i of this._snippets){const n=i.move(e);t.push(...n)}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<this._snippets.length)return!1;const t=new Map;for(const i of this._snippets){const n=i.computePossibleSelections();if(t.size===0)for(const[r,o]of n){o.sort(W.compareRangesUsingStarts);for(const a of e)if(o[0].containsRange(a)){t.set(r,[]);break}}if(t.size===0)return!1;t.forEach((r,o)=>{r.push(...n.get(o))})}e.sort(W.compareRangesUsingStarts);for(const[i,n]of t){if(n.length!==e.length){t.delete(i);continue}n.sort(W.compareRangesUsingStarts);for(let r=0;r<n.length;r++)if(!n[r].containsRange(e[r])){t.delete(i);continue}}return t.size>0}};E3=tu=Eot([Iot(3,Bn)],E3);var Tot=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},v2=function(s,e){return function(t,i){e(t,i,s)}},q1;const Vge={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};var Bh;let Jo=(Bh=class{static get(e){return e.getContribution(q1.ID)}constructor(e,t,i,n,r){this._editor=e,this._logService=t,this._languageFeaturesService=i,this._languageConfigurationService=r,this._snippetListener=new me,this._modelVersionId=-1,this._inSnippet=q1.InSnippetMode.bindTo(n),this._hasNextTabstop=q1.HasNextTabstop.bindTo(n),this._hasPrevTabstop=q1.HasPrevTabstop.bindTo(n)}dispose(){var e;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),(e=this._session)==null||e.dispose(),this._snippetListener.dispose()}insert(e,t){try{this._doInsert(e,typeof t>"u"?Vge:{...Vge,...t})}catch(i){this.cancel(),this._logService.error(i),this._logService.error("snippet_error"),this._logService.error("insert_template=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"<no_session>")}}_doInsert(e,t){var i;if(this._editor.hasModel()){if(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session&&typeof e!="string"&&this.cancel(),this._session?(Ci(typeof e=="string"),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new E3(this._editor,e,t,this._languageConfigurationService),this._session.insert()),t.undoStopAfter&&this._editor.getModel().pushStackElement(),(i=this._session)!=null&&i.hasChoice){const n={_debugDisplayName:"snippetChoiceCompletions",provideCompletionItems:(h,f)=>{if(!this._session||h!==this._editor.getModel()||!ie.equals(this._editor.getPosition(),f))return;const{activeChoice:p}=this._session;if(!p||p.choice.options.length===0)return;const m=h.getValueInRange(p.range),v=!!p.choice.options.find(y=>y.value===m),b=[];for(let y=0;y<p.choice.options.length;y++){const x=p.choice.options[y];b.push({kind:13,label:x.value,insertText:x.value,sortText:"a".repeat(y+1),range:p.range,filterText:v?`${m}_${x.value}`:void 0,command:{id:"jumpToNextSnippetPlaceholder",title:w("next","Go to next placeholder...")}})}return{suggestions:b}}},r=this._editor.getModel();let o,a=!1;const l=()=>{o==null||o.dispose(),a=!1},d=()=>{a||(o=this._languageFeaturesService.completionProvider.register({language:r.getLanguageId(),pattern:r.uri.fsPath,scheme:r.uri.scheme,exclusive:!0},n),this._snippetListener.add(o),a=!0)};this._choiceCompletions={provider:n,enable:d,disable:l}}this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent(n=>n.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 t;if(!this._session||!this._editor.hasModel()){this._currentChoice=void 0;return}const{activeChoice:e}=this._session;if(!e||!this._choiceCompletions){(t=this._choiceCompletions)==null||t.disable(),this._currentChoice=void 0;return}this._currentChoice!==e.choice&&(this._currentChoice=e.choice,this._choiceCompletions.enable(),queueMicrotask(()=>{kot(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.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){var e;(e=this._session)==null||e.prev(),this._updateState()}next(){var e;(e=this._session)==null||e.next(),this._updateState()}isInSnippet(){return!!this._inSnippet.get()}},q1=Bh,Bh.ID="snippetController2",Bh.InSnippetMode=new qe("inSnippetMode",!1,w("inSnippetMode","Whether the editor in current in snippet mode")),Bh.HasNextTabstop=new qe("hasNextTabstop",!1,w("hasNextTabstop","Whether there is a next tab stop when in snippet mode")),Bh.HasPrevTabstop=new qe("hasPrevTabstop",!1,w("hasPrevTabstop","Whether there is a previous tab stop when in snippet mode")),Bh);Jo=q1=Tot([v2(1,qr),v2(2,it),v2(3,yt),v2(4,Bn)],Jo);gi(Jo.ID,Jo,4);const WV=$s.bindToContribution(Jo.get);Ue(new WV({id:"jumpToNextSnippetPlaceholder",precondition:ve.and(Jo.InSnippetMode,Jo.HasNextTabstop),handler:s=>s.next(),kbOpts:{weight:130,kbExpr:U.textInputFocus,primary:2}}));Ue(new WV({id:"jumpToPrevSnippetPlaceholder",precondition:ve.and(Jo.InSnippetMode,Jo.HasPrevTabstop),handler:s=>s.prev(),kbOpts:{weight:130,kbExpr:U.textInputFocus,primary:1026}}));Ue(new WV({id:"leaveSnippet",precondition:Jo.InSnippetMode,handler:s=>s.cancel(!0),kbOpts:{weight:130,kbExpr:U.textInputFocus,primary:9,secondary:[1033]}}));Ue(new WV({id:"acceptSnippet",precondition:Jo.InSnippetMode,handler:s=>s.finish()}));var Not=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},_j=function(s,e){return function(t,i){e(t,i,s)}};let dX=class extends re{get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,i,n,r,o,a,l,d,h,f,p){super(),this.textModel=e,this.selectedSuggestItem=t,this._textModelVersionId=i,this._positions=n,this._debounceValue=r,this._suggestPreviewEnabled=o,this._suggestPreviewMode=a,this._inlineSuggestMode=l,this._enabled=d,this._instantiationService=h,this._commandService=f,this._languageConfigurationService=p,this._source=this._register(this._instantiationService.createInstance(cX,this.textModel,this._textModelVersionId,this._debounceValue)),this._isActive=Kt(this,!1),this._forceUpdateExplicitlySignal=Ax(this),this._selectedInlineCompletionId=Kt(this,void 0),this._primaryPosition=lt(this,v=>this._positions.read(v)[0]??new ie(1,1)),this._isAcceptingPartially=!1,this._preserveCurrentCompletionReasons=new Set([$f.Redo,$f.Undo,$f.AcceptWord]),this._fetchInlineCompletionsPromise=rye({owner:this,createEmptyChangeSummary:()=>({preserveCurrentCompletion:!1,inlineCompletionTriggerKind:Lu.Automatic}),handleChange:(v,b)=>(v.didChange(this._textModelVersionId)&&this._preserveCurrentCompletionReasons.has(this._getReason(v.change))?b.preserveCurrentCompletion=!0:v.didChange(this._forceUpdateExplicitlySignal)&&(b.inlineCompletionTriggerKind=Lu.Explicit),!0)},(v,b)=>{if(this._forceUpdateExplicitlySignal.read(v),!(this._enabled.read(v)&&this.selectedSuggestItem.read(v)||this._isActive.read(v))){this._source.cancelUpdate();return}this._textModelVersionId.read(v);const x=this._source.suggestWidgetInlineCompletions.get(),D=this.selectedSuggestItem.read(v);if(x&&!D){const M=this._source.inlineCompletions.get();On(O=>{(!M||x.request.versionId>M.request.versionId)&&this._source.inlineCompletions.set(x.clone(),O),this._source.clearSuggestWidgetInlineCompletions(O)})}const S=this._primaryPosition.read(v),E={triggerKind:b.inlineCompletionTriggerKind,selectedSuggestionInfo:D==null?void 0:D.toSelectedSuggestionInfo()},I=this.selectedInlineCompletion.get(),R=b.preserveCurrentCompletion||I!=null&&I.forwardStable?I:void 0;return this._source.fetch(S,E,R)}),this._filteredInlineCompletionItems=Hl({owner:this,equalsFn:G4()},v=>{const b=this._source.inlineCompletions.read(v);if(!b)return[];const y=this._primaryPosition.read(v);return b.inlineCompletions.filter(D=>D.isVisible(this.textModel,y,v))}),this.selectedInlineCompletionIndex=lt(this,v=>{const b=this._selectedInlineCompletionId.read(v),y=this._filteredInlineCompletionItems.read(v),x=this._selectedInlineCompletionId===void 0?-1:y.findIndex(D=>D.semanticId===b);return x===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):x}),this.selectedInlineCompletion=lt(this,v=>{const b=this._filteredInlineCompletionItems.read(v),y=this.selectedInlineCompletionIndex.read(v);return b[y]}),this.activeCommands=Hl({owner:this,equalsFn:G4()},v=>{var b;return((b=this.selectedInlineCompletion.read(v))==null?void 0:b.inlineCompletion.source.inlineCompletions.commands)??[]}),this.lastTriggerKind=this._source.inlineCompletions.map(this,v=>v==null?void 0:v.request.context.triggerKind),this.inlineCompletionsCount=lt(this,v=>{if(this.lastTriggerKind.read(v)===Lu.Explicit)return this._filteredInlineCompletionItems.read(v).length}),this.state=Hl({owner:this,equalsFn:(v,b)=>!v||!b?v===b:Sge(v.ghostTexts,b.ghostTexts)&&v.inlineCompletion===b.inlineCompletion&&v.suggestItem===b.suggestItem},v=>{const b=this.textModel,y=this.selectedSuggestItem.read(v);if(y){const x=Vb(y.toSingleTextEdit(),b),D=this._computeAugmentation(x,v);if(!this._suggestPreviewEnabled.read(v)&&!D)return;const E=(D==null?void 0:D.edit)??x,I=D?D.edit.text.length-x.text.length:0,R=this._suggestPreviewMode.read(v),M=this._positions.read(v),O=[E,...vj(this.textModel,M,E)],H=O.map((J,z)=>Ege(J,b,R,M[z],I)).filter(zh),te=H[0]??new TT(E.range.endLineNumber,[]);return{edits:O,primaryGhostText:te,ghostTexts:H,inlineCompletion:D==null?void 0:D.completion,suggestItem:y}}else{if(!this._isActive.read(v))return;const x=this.selectedInlineCompletion.read(v);if(!x)return;const D=x.toSingleTextEdit(v),S=this._inlineSuggestMode.read(v),E=this._positions.read(v),I=[D,...vj(this.textModel,E,D)],R=I.map((M,O)=>Ege(M,b,S,E[O],0)).filter(zh);return R[0]?{edits:I,primaryGhostText:R[0],ghostTexts:R,inlineCompletion:x,suggestItem:void 0}:void 0}}),this.ghostTexts=Hl({owner:this,equalsFn:Sge},v=>{const b=this.state.read(v);if(b)return b.ghostTexts}),this.primaryGhostText=Hl({owner:this,equalsFn:PSe},v=>{const b=this.state.read(v);if(b)return b==null?void 0:b.primaryGhostText}),this._register(Fx(this._fetchInlineCompletionsPromise));let m;this._register(Et(v=>{var x,D;const b=this.state.read(v),y=b==null?void 0:b.inlineCompletion;if((y==null?void 0:y.semanticId)!==(m==null?void 0:m.semanticId)&&(m=y,y)){const S=y.inlineCompletion,E=S.source;(D=(x=E.provider).handleItemDidShow)==null||D.call(x,E.inlineCompletions,S.sourceInlineCompletion,S.insertText)}}))}_getReason(e){return e!=null&&e.isUndoing?$f.Undo:e!=null&&e.isRedoing?$f.Redo:this.isAcceptingPartially?$f.AcceptWord:$f.Other}async trigger(e){this._isActive.set(!0,e),await this._fetchInlineCompletionsPromise.get()}async triggerExplicitly(e){iy(e,t=>{this._isActive.set(!0,t),this._forceUpdateExplicitlySignal.trigger(t)}),await this._fetchInlineCompletionsPromise.get()}stop(e){iy(e,t=>{this._isActive.set(!1,t),this._source.clear(t)})}_computeAugmentation(e,t){const i=this.textModel,n=this._source.suggestWidgetInlineCompletions.read(t),r=n?n.inlineCompletions:[this.selectedInlineCompletion.read(t)].filter(zh);return BWe(r,a=>{let l=a.toSingleTextEdit(t);return l=Vb(l,i,W.fromPositions(l.range.getStartPosition(),e.range.getEndPosition())),BSe(l,e)?{completion:a,edit:l}:void 0})}async _deltaSelectedInlineCompletionIndex(e){await this.triggerExplicitly();const t=this._filteredInlineCompletionItems.get()||[];if(t.length>0){const i=(this.selectedInlineCompletionIndex.get()+e+t.length)%t.length;this._selectedInlineCompletionId.set(t[i].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 n;if(e.getModel()!==this.textModel)throw new ki;const t=this.state.get();if(!t||t.primaryGhostText.isEmpty()||!t.inlineCompletion)return;const i=t.inlineCompletion.toInlineCompletion(void 0);if(i.command&&i.source.addRef(),e.pushUndoStop(),i.snippetInfo)e.executeEdits("inlineSuggestion.accept",[Pn.replace(i.range,""),...i.additionalTextEdits]),e.setPosition(i.snippetInfo.range.getStartPosition(),"inlineCompletionAccept"),(n=Jo.get(e))==null||n.insert(i.snippetInfo.snippet,{undoStopBefore:!1});else{const r=t.edits,o=$ge(r).map(a=>ot.fromPositions(a));e.executeEdits("inlineSuggestion.accept",[...r.map(a=>Pn.replace(a.range,a.text)),...i.additionalTextEdits]),e.setSelections(o,"inlineCompletionAccept")}this.stop(),i.command&&(await this._commandService.executeCommand(i.command.id,...i.command.arguments||[]).then(void 0,is),i.source.removeRef())}async acceptNextWord(e){await this._acceptNext(e,(t,i)=>{const n=this.textModel.getLanguageIdAtPosition(t.lineNumber,t.column),r=this._languageConfigurationService.getLanguageConfiguration(n),o=new RegExp(r.wordDefinition.source,r.wordDefinition.flags.replace("g","")),a=i.match(o);let l=0;a&&a.index!==void 0?a.index===0?l=a[0].length:l=a.index:l=i.length;const h=/\s+/g.exec(i);return h&&h.index!==void 0&&h.index+h[0].length<l&&(l=h.index+h[0].length),l},0)}async acceptNextLine(e){await this._acceptNext(e,(t,i)=>{const n=i.match(/\n/);return n&&n.index!==void 0?n.index+1:i.length},1)}async _acceptNext(e,t,i){if(e.getModel()!==this.textModel)throw new ki;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 a=r.parts[0],l=new ie(r.lineNumber,a.column),d=a.text,h=t(l,d);if(h===d.length&&r.parts.length===1){this.accept(e);return}const f=d.substring(0,h),p=this._positions.get(),m=p[0];o.source.addRef();try{this._isAcceptingPartially=!0;try{e.pushUndoStop();const v=W.fromPositions(m,l),b=e.getModel().getValueInRange(v)+f,y=new Zh(v,b),x=[y,...vj(this.textModel,p,y)],D=$ge(x).map(S=>ot.fromPositions(S));e.executeEdits("inlineSuggestion.accept",x.map(S=>Pn.replace(S.range,S.text))),e.setSelections(D,"inlineCompletionPartialAccept"),e.revealPositionInCenterIfOutsideViewport(e.getPosition(),1)}finally{this._isAcceptingPartially=!1}if(o.source.provider.handlePartialAccept){const v=W.fromPositions(o.range.getStartPosition(),Nd.ofText(f).addToPosition(l)),b=e.getModel().getValueInRange(v,1);o.source.provider.handlePartialAccept(o.source.inlineCompletions,o.sourceInlineCompletion,b.length,{kind:i})}}finally{o.source.removeRef()}}handleSuggestAccepted(e){var r,o;const t=Vb(e.toSingleTextEdit(),this.textModel),i=this._computeAugmentation(t,void 0);if(!i)return;const n=i.completion.inlineCompletion;(o=(r=n.source.provider).handlePartialAccept)==null||o.call(r,n.source.inlineCompletions,n.sourceInlineCompletion,t.text.length,{kind:2})}};dX=Not([_j(9,ut),_j(10,on),_j(11,Bn)],dX);var $f;(function(s){s[s.Undo=0]="Undo",s[s.Redo=1]="Redo",s[s.AcceptWord=2]="AcceptWord",s[s.Other=3]="Other"})($f||($f={}));function vj(s,e,t){if(e.length===1)return[];const i=e[0],n=e.slice(1),r=t.range.getStartPosition(),o=t.range.getEndPosition(),a=s.getValueInRange(W.fromPositions(i,o)),l=xge(i,r);if(l.lineNumber<1)return Tt(new ki(`positionWithinTextEdit line number should be bigger than 0.
|
|
906
|
+
`)}withRange(e){return new x3(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()})}toSingleTextEdit(){return new Zh(this.range,this.insertText)}}function hot(s,e){const t=e.getWordAtPosition(s),i=e.getLineMaxColumn(s.lineNumber);return t?new W(s.lineNumber,t.startColumn,s.lineNumber,i):W.fromPositions(s,s.with(void 0,i))}function Dge(s,e,t,i){const r=t.getLineContent(e.lineNumber).substring(0,e.column-1)+s,o=t.tokenization.tokenizeLineWithEdit(e,r.length-(e.column-1),s),a=o==null?void 0:o.sliceAndInflate(e.column-1,r.length,0);return a?lot(a,i):s}function Vb(s,e,t){const i=t?s.range.intersectRanges(t):s.range;if(!i)return s;const n=e.getValueInRange(i,1),r=i_(n,s.text),o=Nd.ofText(n.substring(0,r)).addToPosition(s.range.getStartPosition()),a=s.text.substring(r),l=W.fromPositions(o,s.range.getEndPosition());return new Zh(l,a)}function BSe(s,e){return s.text.startsWith(e.text)&&fot(s.range,e.range)}function Ege(s,e,t,i,n=0){let r=Vb(s,e);if(r.range.endLineNumber!==r.range.startLineNumber)return;const o=e.getLineContent(r.range.startLineNumber),a=Zi(o).length;if(r.range.startColumn-1<=a){const v=Zi(r.text).length,b=o.substring(r.range.startColumn-1,a),[y,x]=[r.range.getStartPosition(),r.range.getEndPosition()],D=y.column+b.length<=x.column?y.delta(0,b.length):x,S=W.fromPositions(D,x),E=r.text.startsWith(b)?r.text.substring(b.length):r.text.substring(v);r=new Zh(S,E)}const d=e.getValueInRange(r.range),h=got(d,r.text);if(!h)return;const f=r.range.startLineNumber,p=new Array;if(t==="prefix"){const v=h.filter(b=>b.originalLength===0);if(v.length>1||v.length===1&&v[0].originalStart!==d.length)return}const m=r.text.length-n;for(const v of h){const b=r.range.startColumn+v.originalStart+v.originalLength;if(t==="subwordSmart"&&i&&i.lineNumber===r.range.startLineNumber&&b<i.column||v.originalLength>0)return;if(v.modifiedLength===0)continue;const y=v.modifiedStart+v.modifiedLength,x=Math.max(v.modifiedStart,Math.min(y,m)),D=r.text.substring(v.modifiedStart,x),S=r.text.substring(x,Math.max(v.modifiedStart,y));D.length>0&&p.push(new S3(b,D,!1)),S.length>0&&p.push(new S3(b,S,!0))}return new TT(f,p)}function fot(s,e){return e.getStartPosition().equals(s.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(s.getEndPosition())}let fh;function got(s,e){if((fh==null?void 0:fh.originalValue)===s&&(fh==null?void 0:fh.newValue)===e)return fh==null?void 0:fh.changes;{let t=Tge(s,e,!0);if(t){const i=Ige(t);if(i>0){const n=Tge(s,e,!1);n&&Ige(n)<i&&(t=n)}}return fh={originalValue:s,newValue:e,changes:t},t}}function Ige(s){let e=0;for(const t of s)e+=t.originalLength;return e}function Tge(s,e,t){if(s.length>5e3||e.length>5e3)return;function i(d){let h=0;for(let f=0,p=d.length;f<p;f++){const m=d.charCodeAt(f);m>h&&(h=m)}return h}const n=Math.max(i(s),i(e));function r(d){if(d<0)throw new Error("unexpected");return n+d+1}function o(d){let h=0,f=0;const p=new Int32Array(d.length);for(let m=0,v=d.length;m<v;m++)if(t&&d[m]==="("){const b=f*100+h;p[m]=r(2*b),h++}else if(t&&d[m]===")"){h=Math.max(h-1,0);const b=f*100+h;p[m]=r(2*b+1),h===0&&f++}else p[m]=d.charCodeAt(m);return p}const a=o(s),l=o(e);return new Ph({getElements:()=>a},{getElements:()=>l}).ComputeDiff(!1).changes}var pot=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Nge=function(s,e){return function(t,i){e(t,i,s)}};let cX=class extends re{constructor(e,t,i,n,r){super(),this.textModel=e,this.versionId=t,this._debounceValue=i,this.languageFeaturesService=n,this.languageConfigurationService=r,this._updateOperation=this._register(new Js),this.inlineCompletions=jI("inlineCompletions",void 0),this.suggestWidgetInlineCompletions=jI("suggestWidgetInlineCompletions",void 0),this._register(this.textModel.onDidChangeContent(()=>{this._updateOperation.clear()}))}fetch(e,t,i){var h,f;const n=new _ot(e,t,this.textModel.getVersionId()),r=t.selectedSuggestionInfo?this.suggestWidgetInlineCompletions:this.inlineCompletions;if((h=this._updateOperation.value)!=null&&h.request.satisfies(n))return this._updateOperation.value.promise;if((f=r.get())!=null&&f.request.satisfies(n))return Promise.resolve(!0);const o=!!this._updateOperation.value;this._updateOperation.clear();const a=new An,l=(async()=>{if((o||t.triggerKind===Lu.Automatic)&&await mot(this._debounceValue.get(this.textModel),a.token),a.token.isCancellationRequested||this._store.isDisposed||this.textModel.getVersionId()!==n.versionId)return!1;const m=new Date,v=await FSe(this.languageFeaturesService.inlineCompletionsProvider,e,this.textModel,t,a.token,this.languageConfigurationService);if(a.token.isCancellationRequested||this._store.isDisposed||this.textModel.getVersionId()!==n.versionId)return!1;const b=new Date;this._debounceValue.update(this.textModel,b.getTime()-m.getTime());const y=new bot(v,n,this.textModel,this.versionId);if(i){const x=i.toInlineCompletion(void 0);i.canBeReused(this.textModel,e)&&!v.has(x)&&y.prepend(i.inlineCompletion,x.range,!0)}return this._updateOperation.clear(),On(x=>{r.set(y,x)}),!0})(),d=new vot(n,a,l);return this._updateOperation.value=d,l}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.request.context.selectedSuggestionInfo&&this._updateOperation.clear(),this.suggestWidgetInlineCompletions.set(void 0,e)}cancelUpdate(){this._updateOperation.clear()}};cX=pot([Nge(3,it),Nge(4,Bn)],cX);function mot(s,e){return new Promise(t=>{let i;const n=setTimeout(()=>{i&&i.dispose(),t()},s);e&&(i=e.onCancellationRequested(()=>{clearTimeout(n),i&&i.dispose(),t()}))})}class _ot{constructor(e,t,i){this.position=e,this.context=t,this.versionId=i}satisfies(e){return this.position.equals(e.position)&&YK(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,v6e())&&(e.context.triggerKind===Lu.Automatic||this.context.triggerKind===Lu.Explicit)&&this.versionId===e.versionId}}class vot{constructor(e,t,i){this.request=e,this.cancellationTokenSource=t,this.promise=i}dispose(){this.cancellationTokenSource.cancel()}}class bot{get inlineCompletions(){return this._inlineCompletions}constructor(e,t,i,n){this.inlineCompletionProviderResult=e,this.request=t,this._textModel=i,this._versionId=n,this._refCount=1,this._prependedInlineCompletionItems=[];const r=i.deltaDecorations([],e.completions.map(o=>({range:o.range,options:{description:"inline-completion-tracking-range"}})));this._inlineCompletions=e.completions.map((o,a)=>new Mge(o,r[a],this._textModel,this._versionId))}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,i){i&&e.source.addRef();const n=this._textModel.deltaDecorations([],[{range:t,options:{description:"inline-completion-tracking-range"}}])[0];this._inlineCompletions.unshift(new Mge(e,n,this._textModel,this._versionId)),this._prependedInlineCompletionItems.push(e)}}class Mge{get forwardStable(){return this.inlineCompletion.source.inlineCompletions.enableForwardStability??!1}constructor(e,t,i,n){this.inlineCompletion=e,this.decorationId=t,this._textModel=i,this._modelVersion=n,this.semanticId=JSON.stringify([this.inlineCompletion.filterText,this.inlineCompletion.insertText,this.inlineCompletion.range.getStartPosition().toString()]),this._updatedRange=Hl({owner:this,equalsFn:W.equalsRange},r=>(this._modelVersion.read(r),this._textModel.getDecorationRange(this.decorationId)))}toInlineCompletion(e){return this.inlineCompletion.withRange(this._updatedRange.read(e)??mj)}toSingleTextEdit(e){return new Zh(this._updatedRange.read(e)??mj,this.inlineCompletion.insertText)}isVisible(e,t,i){const n=Vb(this._toFilterTextReplacement(i),e),r=this._updatedRange.read(i);if(!r||!this.inlineCompletion.range.getStartPosition().equals(r.getStartPosition())||t.lineNumber!==n.range.startLineNumber)return!1;const o=e.getValueInRange(n.range,1),a=n.text,l=Math.max(0,t.column-n.range.startColumn);let d=a.substring(0,l),h=a.substring(l),f=o.substring(0,l),p=o.substring(l);const m=e.getLineIndentColumn(n.range.startLineNumber);return n.range.startColumn<=m&&(f=f.trimStart(),f.length===0&&(p=p.trimStart()),d=d.trimStart(),d.length===0&&(h=h.trimStart())),d.startsWith(f)&&!!FCe(p,h)}canBeReused(e,t){const i=this._updatedRange.read(void 0);return!!i&&i.containsPosition(t)&&this.isVisible(e,t,void 0)&&Nd.ofRange(i).isGreaterThanOrEqualTo(Nd.ofRange(this.inlineCompletion.range))}_toFilterTextReplacement(e){return new Zh(this._updatedRange.read(e)??mj,this.inlineCompletion.filterText)}}const mj=new W(1,1,1,1),jt={Visible:_ne,HasFocusedSuggestion:new qe("suggestWidgetHasFocusedSuggestion",!1,w("suggestWidgetHasSelection","Whether any suggestion is focused")),DetailsVisible:new qe("suggestWidgetDetailsVisible",!1,w("suggestWidgetDetailsVisible","Whether suggestion details are visible")),MultipleSuggestions:new qe("suggestWidgetMultipleSuggestions",!1,w("suggestWidgetMultipleSuggestions","Whether there are multiple suggestions to pick from")),MakesTextEdit:new qe("suggestionMakesTextEdit",!0,w("suggestionMakesTextEdit","Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new qe("acceptSuggestionOnEnter",!0,w("acceptSuggestionOnEnter","Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new qe("suggestionHasInsertAndReplaceRange",!1,w("suggestionHasInsertAndReplaceRange","Whether the current suggestion has insert and replace behaviour")),InsertMode:new qe("suggestionInsertMode",void 0,{type:"string",description:w("suggestionInsertMode","Whether the default behaviour is to insert or replace")}),CanResolve:new qe("suggestionCanResolve",!1,w("suggestionCanResolve","Whether the current suggestion supports to resolve further details"))},Nm=new st("suggestWidgetStatusBar");class Cot{constructor(e,t,i,n){var r;this.position=e,this.completion=t,this.container=i,this.provider=n,this.isInvalid=!1,this.score=Tu.Default,this.distance=0,this.textLabel=typeof t.label=="string"?t.label:(r=t.label)==null?void 0:r.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,W.isIRange(t.range)?(this.editStart=new ie(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new ie(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new ie(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||W.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new ie(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new ie(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new ie(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||W.spansMultipleLines(t.range.insert)||W.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 n.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}),i=new cr(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(n=>{Object.assign(this.completion,n),this._resolveDuration=i.elapsed()},n=>{zc(n)&&(this._resolveCache=void 0,this._resolveDuration=void 0)}).finally(()=>{t.dispose()})}return this._resolveCache}}const sW=class sW{constructor(e=2,t=new Set,i=new Set,n=new Map,r=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.providerItemsToReuse=n,this.showDeprecated=r}};sW.default=new sW;let NT=sW;class yot{constructor(e,t,i,n){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=n}}async function xne(s,e,t,i=NT.default,n={triggerKind:0},r=$t.None){const o=new cr;t=t.clone();const a=e.getWordAtPosition(t),l=a?new W(t.lineNumber,a.startColumn,t.lineNumber,a.endColumn):W.fromPositions(t),d={replace:l,insert:l.setEndPosition(t.lineNumber,t.column)},h=[],f=new me,p=[];let m=!1;const v=(y,x,D)=>{var E;let S=!1;if(!x)return S;for(const I of x.suggestions)if(!i.kindFilter.has(I.kind)){if(!i.showDeprecated&&((E=I==null?void 0:I.tags)!=null&&E.includes(1)))continue;I.range||(I.range=d),I.sortText||(I.sortText=typeof I.label=="string"?I.label:I.label.label),!m&&I.insertTextRules&&I.insertTextRules&4&&(m=cy.guessNeedsClipboard(I.insertText)),h.push(new Cot(t,I,x,y)),S=!0}return uH(x)&&f.add(x),p.push({providerName:y._debugDisplayName??"unknown_provider",elapsedProvider:x.duration??-1,elapsedOverall:D.elapsed()}),S},b=(async()=>{})();for(const y of s.orderedGroups(e)){let x=!1;if(await Promise.all(y.map(async D=>{if(i.providerItemsToReuse.has(D)){const S=i.providerItemsToReuse.get(D);S.forEach(E=>h.push(E)),x=x||S.length>0;return}if(!(i.providerFilter.size>0&&!i.providerFilter.has(D)))try{const S=new cr,E=await D.provideCompletionItems(e,t,n,r);x=v(D,E,S)||x}catch(S){is(S)}})),x||r.isCancellationRequested)break}return await b,r.isCancellationRequested?(f.dispose(),Promise.reject(new Ed)):new yot(h.sort(xot(i.snippetSortOrder)),m,{entries:p,elapsed:o.elapsed()},f)}function kne(s,e){if(s.sortTextLow&&e.sortTextLow){if(s.sortTextLow<e.sortTextLow)return-1;if(s.sortTextLow>e.sortTextLow)return 1}return s.textLabel<e.textLabel?-1:s.textLabel>e.textLabel?1:s.completion.kind-e.completion.kind}function wot(s,e){if(s.completion.kind!==e.completion.kind){if(s.completion.kind===27)return-1;if(e.completion.kind===27)return 1}return kne(s,e)}function Sot(s,e){if(s.completion.kind!==e.completion.kind){if(s.completion.kind===27)return 1;if(e.completion.kind===27)return-1}return kne(s,e)}const BV=new Map;BV.set(0,wot);BV.set(2,Sot);BV.set(1,kne);function xot(s){return BV.get(s)}hi.registerCommand("_executeCompletionItemProvider",async(s,...e)=>{const[t,i,n,r]=e;Ci(gt.isUri(t)),Ci(ie.isIPosition(i)),Ci(typeof n=="string"||!n),Ci(typeof r=="number"||!r);const{completionProvider:o}=s.get(it),a=await s.get(Ea).createModelReference(t);try{const l={incomplete:!1,suggestions:[]},d=[],h=a.object.textEditorModel.validatePosition(i),f=await xne(o,a.object.textEditorModel,h,void 0,{triggerCharacter:n??void 0,triggerKind:n?1:0});for(const p of f.items)d.length<(r??0)&&d.push(p.resolve($t.None)),l.incomplete=l.incomplete||p.container.incomplete,l.suggestions.push(p.completion);try{return await Promise.all(d),l}finally{setTimeout(()=>f.disposable.dispose(),100)}}finally{a.dispose()}});function kot(s,e){var t;(t=s.getContribution("editor.contrib.suggestController"))==null||t.triggerSuggest(new Set().add(e),void 0,!0)}class b0{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 Rge(s,e=Ur){return zHe(s,e)?s.charAt(0).toUpperCase()+s.slice(1):s}var Lot=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Dot=function(s,e){return function(t,i){e(t,i,s)}};class Pge{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){const i=t.resolve(e);if(i!==void 0)return i}}}class Oge{constructor(e,t,i,n){this._model=e,this._selection=t,this._selectionIdx=i,this._overtypingCapturer=n}resolve(e){const{name:t}=e;if(t==="SELECTION"||t==="TM_SELECTED_TEXT"){let i=this._model.getValueInRange(this._selection)||void 0,n=this._selection.startLineNumber!==this._selection.endLineNumber;if(!i&&this._overtypingCapturer){const r=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);r&&(i=r.value,n=r.multiline)}if(i&&n&&e.snippet){const r=this._model.getLineContent(this._selection.startLineNumber),o=Zi(r,0,this._selection.startColumn-1);let a=o;e.snippet.walk(d=>d===e?!1:(d instanceof Ho&&(a=Zi(of(d.value).pop())),!0));const l=i_(a,o);i=i.replace(/(\r\n|\r|\n)(.*)/g,(d,h,f)=>`${h}${a.substr(l)}${f}`)}return i}else{if(t==="TM_CURRENT_LINE")return this._model.getLineContent(this._selection.positionLineNumber);if(t==="TM_CURRENT_WORD"){const i=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return i&&i.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 Age{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return km(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const i=km(this._model.uri.fsPath),n=i.lastIndexOf(".");return n<=0?i:i.slice(0,n)}else{if(t==="TM_DIRECTORY")return kve(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(KH(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 Fge{constructor(e,t,i,n){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=i,this._spread=n}resolve(e){if(e.name!=="CLIPBOARD")return;const t=this._readClipboardText();if(t){if(this._spread){const i=t.split(/\r\n|\n|\r/).filter(n=>!Pve(n));if(i.length===this._selectionCount)return i[this._selectionIdx]}return t}}}let k3=class{constructor(e,t,i){this._model=e,this._selection=t,this._languageConfigurationService=i}resolve(e){const{name:t}=e,i=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),n=this._languageConfigurationService.getLanguageConfiguration(i).comments;if(n){if(t==="LINE_COMMENT")return n.lineCommentToken||void 0;if(t==="BLOCK_COMMENT_START")return n.blockCommentStartToken||void 0;if(t==="BLOCK_COMMENT_END")return n.blockCommentEndToken||void 0}}};k3=Lot([Dot(2,Bn)],k3);const kh=class kh{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 kh.dayNames[this._date.getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return kh.dayNamesShort[this._date.getDay()];if(t==="CURRENT_MONTH_NAME")return kh.monthNames[this._date.getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return kh.monthNamesShort[this._date.getMonth()];if(t==="CURRENT_SECONDS_UNIX")return String(Math.floor(this._date.getTime()/1e3));if(t==="CURRENT_TIMEZONE_OFFSET"){const i=this._date.getTimezoneOffset(),n=i>0?"-":"+",r=Math.trunc(Math.abs(i/60)),o=r<10?"0"+r:r,a=Math.abs(i)-r*60,l=a<10?"0"+a:a;return n+o+":"+l}}};kh.dayNames=[w("Sunday","Sunday"),w("Monday","Monday"),w("Tuesday","Tuesday"),w("Wednesday","Wednesday"),w("Thursday","Thursday"),w("Friday","Friday"),w("Saturday","Saturday")],kh.dayNamesShort=[w("SundayShort","Sun"),w("MondayShort","Mon"),w("TuesdayShort","Tue"),w("WednesdayShort","Wed"),w("ThursdayShort","Thu"),w("FridayShort","Fri"),w("SaturdayShort","Sat")],kh.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")],kh.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")];let L3=kh;class Bge{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=a6e(this._workspaceService.getWorkspace());if(!r6e(t)){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(t);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(t)}}_resolveWorkspaceName(e){if(VK(e))return km(e.uri.path);let t=km(e.configPath.path);return t.endsWith($K)&&(t=t.substr(0,t.length-$K.length-1)),t}_resoveWorkspacePath(e){if(VK(e))return Rge(e.uri.fsPath);const t=km(e.configPath.path);let i=e.configPath.fsPath;return i.endsWith(t)&&(i=i.substr(0,i.length-t.length-1)),i?Rge(i):"/"}}class Wge{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 EV()}}var Eot=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Iot=function(s,e){return function(t,i){e(t,i,s)}},tu;const gd=class gd{constructor(e,t,i){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=i,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=Gle(t.placeholders,xc.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 i of this._snippet.placeholders){const n=this._snippet.offset(i),r=this._snippet.fullLen(i),o=W.fromPositions(e.getPositionAt(this._offset+n),e.getPositionAt(this._offset+n+r)),a=i.isFinalTabstop?gd._decor.inactiveFinal:gd._decor.inactive,l=t.addDecoration(o,a);this._placeholderDecorations.set(i,l)}})}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const n=[];for(const r of this._placeholderGroups[this._placeholderGroupsIdx])if(r.transform){const o=this._placeholderDecorations.get(r),a=this._editor.getModel().getDecorationRange(o),l=this._editor.getModel().getValueInRange(a),d=r.transform.resolve(l).split(/\r\n|\r|\n/);for(let h=1;h<d.length;h++)d[h]=this._editor.getModel().normalizeIndentation(this._snippetLineLeadingWhitespace+d[h]);n.push(Pn.replace(a,d.join(this._editor.getModel().getEOL())))}n.length>0&&this._editor.executeEdits("snippet.placeholderTransform",n)}let t=!1;e===!0&&this._placeholderGroupsIdx<this._placeholderGroups.length-1?(this._placeholderGroupsIdx+=1,t=!0):e===!1&&this._placeholderGroupsIdx>0&&(this._placeholderGroupsIdx-=1,t=!0);const i=this._editor.getModel().changeDecorations(n=>{const r=new Set,o=[];for(const a of this._placeholderGroups[this._placeholderGroupsIdx]){const l=this._placeholderDecorations.get(a),d=this._editor.getModel().getDecorationRange(l);o.push(new ot(d.startLineNumber,d.startColumn,d.endLineNumber,d.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),n.changeDecorationOptions(l,a.isFinalTabstop?gd._decor.activeFinal:gd._decor.active),r.add(a);for(const h of this._snippet.enclosingPlaceholders(a)){const f=this._placeholderDecorations.get(h);n.changeDecorationOptions(f,h.isFinalTabstop?gd._decor.activeFinal:gd._decor.active),r.add(h)}}for(const[a,l]of this._placeholderDecorations)r.has(a)||n.changeDecorationOptions(l,a.isFinalTabstop?gd._decor.inactiveFinal:gd._decor.inactive);return o});return t?this.move(e):i??[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof xc){const i=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(i).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 i;for(const n of t){if(n.isFinalTabstop)break;i||(i=[],e.set(n.index,i));const r=this._placeholderDecorations.get(n),o=this._editor.getModel().getDecorationRange(r);if(!o){e.delete(n.index);break}i.push(o)}}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 i=this._editor.getModel().getDecorationRange(t);if(i)return{range:i,choice:e.choice}}get hasChoice(){let e=!1;return this._snippet.walk(t=>(e=t instanceof Kx,!e)),e}merge(e){const t=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations(i=>{for(const n of this._placeholderGroups[this._placeholderGroupsIdx]){const r=e.shift();console.assert(r._offset!==-1),console.assert(!r._placeholderDecorations);const o=r._snippet.placeholderInfo.last.index;for(const l of r._snippet.placeholderInfo.all)l.isFinalTabstop?l.index=n.index+(o+1)/this._nestingLevel:l.index=n.index+l.index/this._nestingLevel;this._snippet.replace(n,r._snippet.children);const a=this._placeholderDecorations.get(n);i.removeDecoration(a),this._placeholderDecorations.delete(n);for(const l of r._snippet.placeholders){const d=r._snippet.offset(l),h=r._snippet.fullLen(l),f=W.fromPositions(t.getPositionAt(r._offset+d),t.getPositionAt(r._offset+d+h)),p=i.addDecoration(f,gd._decor.inactive);this._placeholderDecorations.set(l,p)}}this._placeholderGroups=Gle(this._snippet.placeholders,xc.compareByIndex)})}};gd._decor={active:Ot.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:Ot.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:Ot.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:Ot.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})};let D3=gd;const Hge={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let E3=tu=class{static adjustWhitespace(e,t,i,n,r){const o=e.getLineContent(t.lineNumber),a=Zi(o,0,t.column-1);let l;return n.walk(d=>{if(!(d instanceof Ho)||d.parent instanceof Kx||r&&!r.has(d))return!0;const h=d.value.split(/\r\n|\r|\n/);if(i){const p=n.offset(d);if(p===0)h[0]=e.normalizeIndentation(h[0]);else{l=l??n.toString();const m=l.charCodeAt(p-1);(m===10||m===13)&&(h[0]=e.normalizeIndentation(a+h[0]))}for(let m=1;m<h.length;m++)h[m]=e.normalizeIndentation(a+h[m])}const f=h.join(e.getEOL());return f!==d.value&&(d.parent.replace(d,[new Ho(f)]),l=void 0),!0}),a}static adjustSelection(e,t,i,n){if(i!==0||n!==0){const{positionLineNumber:r,positionColumn:o}=t,a=o-i,l=o+n,d=e.validateRange({startLineNumber:r,startColumn:a,endLineNumber:r,endColumn:l});t=ot.createWithDirection(d.startLineNumber,d.startColumn,d.endLineNumber,d.endColumn,t.getDirection())}return t}static createEditsAndSnippetsFromSelections(e,t,i,n,r,o,a,l,d){const h=[],f=[];if(!e.hasModel())return{edits:h,snippets:f};const p=e.getModel(),m=e.invokeWithinContext(E=>E.get(ty)),v=e.invokeWithinContext(E=>new Age(E.get(HS),p)),b=()=>a,y=p.getValueInRange(tu.adjustSelection(p,e.getSelection(),i,0)),x=p.getValueInRange(tu.adjustSelection(p,e.getSelection(),0,n)),D=p.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),S=e.getSelections().map((E,I)=>({selection:E,idx:I})).sort((E,I)=>W.compareRangesUsingStarts(E.selection,I.selection));for(const{selection:E,idx:I}of S){let R=tu.adjustSelection(p,E,i,0),M=tu.adjustSelection(p,E,0,n);y!==p.getValueInRange(R)&&(R=E),x!==p.getValueInRange(M)&&(M=E);const O=E.setStartPosition(R.startLineNumber,R.startColumn).setEndPosition(M.endLineNumber,M.endColumn),H=new cy().parse(t,!0,r),te=O.getStartPosition(),J=tu.adjustWhitespace(p,te,o||I>0&&D!==p.getLineFirstNonWhitespaceColumn(E.positionLineNumber),H);H.resolveVariables(new Pge([v,new Fge(b,I,S.length,e.getOption(79)==="spread"),new Oge(p,E,I,l),new k3(p,E,d),new L3,new Bge(m),new Wge])),h[I]=Pn.replace(O,H.toString()),h[I].identifier={major:I,minor:0},h[I]._isTracked=!0,f[I]=new D3(e,H,J)}return{edits:h,snippets:f}}static createEditsAndSnippetsFromEdits(e,t,i,n,r,o,a){if(!e.hasModel()||t.length===0)return{edits:[],snippets:[]};const l=[],d=e.getModel(),h=new cy,f=new BN,p=new Pge([e.invokeWithinContext(v=>new Age(v.get(HS),d)),new Fge(()=>r,0,e.getSelections().length,e.getOption(79)==="spread"),new Oge(d,e.getSelection(),0,o),new k3(d,e.getSelection(),a),new L3,new Bge(e.invokeWithinContext(v=>v.get(ty))),new Wge]);t=t.sort((v,b)=>W.compareRangesUsingStarts(v.range,b.range));let m=0;for(let v=0;v<t.length;v++){const{range:b,template:y}=t[v];if(v>0){const I=t[v-1].range,R=W.fromPositions(I.getEndPosition(),b.getStartPosition()),M=new Ho(d.getValueInRange(R));f.appendChild(M),m+=M.value.length}const x=h.parseFragment(y,f);tu.adjustWhitespace(d,b.getStartPosition(),!0,f,new Set(x)),f.resolveVariables(p);const D=f.toString(),S=D.slice(m);m=D.length;const E=Pn.replace(b,S);E.identifier={major:v,minor:0},E._isTracked=!0,l.push(E)}return h.ensureFinalTabstop(f,i,!0),{edits:l,snippets:[new D3(e,f,"")]}}constructor(e,t,i=Hge,n){this._editor=e,this._template=t,this._options=i,this._languageConfigurationService=n,this._templateMerges=[],this._snippets=[]}dispose(){Xi(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"?tu.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):tu.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,i=>{const n=i.filter(r=>!!r.identifier);for(let r=0;r<t.length;r++)t[r].initialize(n[r].textChange);return this._snippets[0].hasPlaceholder?this._move(!0):n.map(r=>ot.fromPositions(r.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=Hge){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:i,snippets:n}=tu.createEditsAndSnippetsFromSelections(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",i,r=>{const o=r.filter(l=>!!l.identifier);for(let l=0;l<n.length;l++)n[l].initialize(o[l].textChange);const a=n[0].isTrivialSnippet;if(!a){for(const l of this._snippets)l.merge(n);console.assert(n.length===0)}return this._snippets[0].hasPlaceholder&&!a?this._move(void 0):o.map(l=>ot.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 i of this._snippets){const n=i.move(e);t.push(...n)}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<this._snippets.length)return!1;const t=new Map;for(const i of this._snippets){const n=i.computePossibleSelections();if(t.size===0)for(const[r,o]of n){o.sort(W.compareRangesUsingStarts);for(const a of e)if(o[0].containsRange(a)){t.set(r,[]);break}}if(t.size===0)return!1;t.forEach((r,o)=>{r.push(...n.get(o))})}e.sort(W.compareRangesUsingStarts);for(const[i,n]of t){if(n.length!==e.length){t.delete(i);continue}n.sort(W.compareRangesUsingStarts);for(let r=0;r<n.length;r++)if(!n[r].containsRange(e[r])){t.delete(i);continue}}return t.size>0}};E3=tu=Eot([Iot(3,Bn)],E3);var Tot=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},v2=function(s,e){return function(t,i){e(t,i,s)}},q1;const Vge={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};var Bh;let Jo=(Bh=class{static get(e){return e.getContribution(q1.ID)}constructor(e,t,i,n,r){this._editor=e,this._logService=t,this._languageFeaturesService=i,this._languageConfigurationService=r,this._snippetListener=new me,this._modelVersionId=-1,this._inSnippet=q1.InSnippetMode.bindTo(n),this._hasNextTabstop=q1.HasNextTabstop.bindTo(n),this._hasPrevTabstop=q1.HasPrevTabstop.bindTo(n)}dispose(){var e;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),(e=this._session)==null||e.dispose(),this._snippetListener.dispose()}insert(e,t){try{this._doInsert(e,typeof t>"u"?Vge:{...Vge,...t})}catch(i){this.cancel(),this._logService.error(i),this._logService.error("snippet_error"),this._logService.error("insert_template=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"<no_session>")}}_doInsert(e,t){var i;if(this._editor.hasModel()){if(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session&&typeof e!="string"&&this.cancel(),this._session?(Ci(typeof e=="string"),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new E3(this._editor,e,t,this._languageConfigurationService),this._session.insert()),t.undoStopAfter&&this._editor.getModel().pushStackElement(),(i=this._session)!=null&&i.hasChoice){const n={_debugDisplayName:"snippetChoiceCompletions",provideCompletionItems:(h,f)=>{if(!this._session||h!==this._editor.getModel()||!ie.equals(this._editor.getPosition(),f))return;const{activeChoice:p}=this._session;if(!p||p.choice.options.length===0)return;const m=h.getValueInRange(p.range),v=!!p.choice.options.find(y=>y.value===m),b=[];for(let y=0;y<p.choice.options.length;y++){const x=p.choice.options[y];b.push({kind:13,label:x.value,insertText:x.value,sortText:"a".repeat(y+1),range:p.range,filterText:v?`${m}_${x.value}`:void 0,command:{id:"jumpToNextSnippetPlaceholder",title:w("next","Go to next placeholder...")}})}return{suggestions:b}}},r=this._editor.getModel();let o,a=!1;const l=()=>{o==null||o.dispose(),a=!1},d=()=>{a||(o=this._languageFeaturesService.completionProvider.register({language:r.getLanguageId(),pattern:r.uri.fsPath,scheme:r.uri.scheme,exclusive:!0},n),this._snippetListener.add(o),a=!0)};this._choiceCompletions={provider:n,enable:d,disable:l}}this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent(n=>n.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 t;if(!this._session||!this._editor.hasModel()){this._currentChoice=void 0;return}const{activeChoice:e}=this._session;if(!e||!this._choiceCompletions){(t=this._choiceCompletions)==null||t.disable(),this._currentChoice=void 0;return}this._currentChoice!==e.choice&&(this._currentChoice=e.choice,this._choiceCompletions.enable(),queueMicrotask(()=>{kot(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.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){var e;(e=this._session)==null||e.prev(),this._updateState()}next(){var e;(e=this._session)==null||e.next(),this._updateState()}isInSnippet(){return!!this._inSnippet.get()}},q1=Bh,Bh.ID="snippetController2",Bh.InSnippetMode=new qe("inSnippetMode",!1,w("inSnippetMode","Whether the editor in current in snippet mode")),Bh.HasNextTabstop=new qe("hasNextTabstop",!1,w("hasNextTabstop","Whether there is a next tab stop when in snippet mode")),Bh.HasPrevTabstop=new qe("hasPrevTabstop",!1,w("hasPrevTabstop","Whether there is a previous tab stop when in snippet mode")),Bh);Jo=q1=Tot([v2(1,qr),v2(2,it),v2(3,yt),v2(4,Bn)],Jo);gi(Jo.ID,Jo,4);const WV=$s.bindToContribution(Jo.get);Ue(new WV({id:"jumpToNextSnippetPlaceholder",precondition:ve.and(Jo.InSnippetMode,Jo.HasNextTabstop),handler:s=>s.next(),kbOpts:{weight:130,kbExpr:U.textInputFocus,primary:2}}));Ue(new WV({id:"jumpToPrevSnippetPlaceholder",precondition:ve.and(Jo.InSnippetMode,Jo.HasPrevTabstop),handler:s=>s.prev(),kbOpts:{weight:130,kbExpr:U.textInputFocus,primary:1026}}));Ue(new WV({id:"leaveSnippet",precondition:Jo.InSnippetMode,handler:s=>s.cancel(!0),kbOpts:{weight:130,kbExpr:U.textInputFocus,primary:9,secondary:[1033]}}));Ue(new WV({id:"acceptSnippet",precondition:Jo.InSnippetMode,handler:s=>s.finish()}));var Not=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},_j=function(s,e){return function(t,i){e(t,i,s)}};let dX=class extends re{get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,i,n,r,o,a,l,d,h,f,p){super(),this.textModel=e,this.selectedSuggestItem=t,this._textModelVersionId=i,this._positions=n,this._debounceValue=r,this._suggestPreviewEnabled=o,this._suggestPreviewMode=a,this._inlineSuggestMode=l,this._enabled=d,this._instantiationService=h,this._commandService=f,this._languageConfigurationService=p,this._source=this._register(this._instantiationService.createInstance(cX,this.textModel,this._textModelVersionId,this._debounceValue)),this._isActive=Kt(this,!1),this._forceUpdateExplicitlySignal=Ax(this),this._selectedInlineCompletionId=Kt(this,void 0),this._primaryPosition=lt(this,v=>this._positions.read(v)[0]??new ie(1,1)),this._isAcceptingPartially=!1,this._preserveCurrentCompletionReasons=new Set([$f.Redo,$f.Undo,$f.AcceptWord]),this._fetchInlineCompletionsPromise=rye({owner:this,createEmptyChangeSummary:()=>({preserveCurrentCompletion:!1,inlineCompletionTriggerKind:Lu.Automatic}),handleChange:(v,b)=>(v.didChange(this._textModelVersionId)&&this._preserveCurrentCompletionReasons.has(this._getReason(v.change))?b.preserveCurrentCompletion=!0:v.didChange(this._forceUpdateExplicitlySignal)&&(b.inlineCompletionTriggerKind=Lu.Explicit),!0)},(v,b)=>{if(this._forceUpdateExplicitlySignal.read(v),!(this._enabled.read(v)&&this.selectedSuggestItem.read(v)||this._isActive.read(v))){this._source.cancelUpdate();return}this._textModelVersionId.read(v);const x=this._source.suggestWidgetInlineCompletions.get(),D=this.selectedSuggestItem.read(v);if(x&&!D){const M=this._source.inlineCompletions.get();On(O=>{(!M||x.request.versionId>M.request.versionId)&&this._source.inlineCompletions.set(x.clone(),O),this._source.clearSuggestWidgetInlineCompletions(O)})}const S=this._primaryPosition.read(v),E={triggerKind:b.inlineCompletionTriggerKind,selectedSuggestionInfo:D==null?void 0:D.toSelectedSuggestionInfo()},I=this.selectedInlineCompletion.get(),R=b.preserveCurrentCompletion||I!=null&&I.forwardStable?I:void 0;return this._source.fetch(S,E,R)}),this._filteredInlineCompletionItems=Hl({owner:this,equalsFn:G4()},v=>{const b=this._source.inlineCompletions.read(v);if(!b)return[];const y=this._primaryPosition.read(v);return b.inlineCompletions.filter(D=>D.isVisible(this.textModel,y,v))}),this.selectedInlineCompletionIndex=lt(this,v=>{const b=this._selectedInlineCompletionId.read(v),y=this._filteredInlineCompletionItems.read(v),x=this._selectedInlineCompletionId===void 0?-1:y.findIndex(D=>D.semanticId===b);return x===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):x}),this.selectedInlineCompletion=lt(this,v=>{const b=this._filteredInlineCompletionItems.read(v),y=this.selectedInlineCompletionIndex.read(v);return b[y]}),this.activeCommands=Hl({owner:this,equalsFn:G4()},v=>{var b;return((b=this.selectedInlineCompletion.read(v))==null?void 0:b.inlineCompletion.source.inlineCompletions.commands)??[]}),this.lastTriggerKind=this._source.inlineCompletions.map(this,v=>v==null?void 0:v.request.context.triggerKind),this.inlineCompletionsCount=lt(this,v=>{if(this.lastTriggerKind.read(v)===Lu.Explicit)return this._filteredInlineCompletionItems.read(v).length}),this.state=Hl({owner:this,equalsFn:(v,b)=>!v||!b?v===b:Sge(v.ghostTexts,b.ghostTexts)&&v.inlineCompletion===b.inlineCompletion&&v.suggestItem===b.suggestItem},v=>{const b=this.textModel,y=this.selectedSuggestItem.read(v);if(y){const x=Vb(y.toSingleTextEdit(),b),D=this._computeAugmentation(x,v);if(!this._suggestPreviewEnabled.read(v)&&!D)return;const E=(D==null?void 0:D.edit)??x,I=D?D.edit.text.length-x.text.length:0,R=this._suggestPreviewMode.read(v),M=this._positions.read(v),O=[E,...vj(this.textModel,M,E)],H=O.map((J,z)=>Ege(J,b,R,M[z],I)).filter(zh),te=H[0]??new TT(E.range.endLineNumber,[]);return{edits:O,primaryGhostText:te,ghostTexts:H,inlineCompletion:D==null?void 0:D.completion,suggestItem:y}}else{if(!this._isActive.read(v))return;const x=this.selectedInlineCompletion.read(v);if(!x)return;const D=x.toSingleTextEdit(v),S=this._inlineSuggestMode.read(v),E=this._positions.read(v),I=[D,...vj(this.textModel,E,D)],R=I.map((M,O)=>Ege(M,b,S,E[O],0)).filter(zh);return R[0]?{edits:I,primaryGhostText:R[0],ghostTexts:R,inlineCompletion:x,suggestItem:void 0}:void 0}}),this.ghostTexts=Hl({owner:this,equalsFn:Sge},v=>{const b=this.state.read(v);if(b)return b.ghostTexts}),this.primaryGhostText=Hl({owner:this,equalsFn:PSe},v=>{const b=this.state.read(v);if(b)return b==null?void 0:b.primaryGhostText}),this._register(Fx(this._fetchInlineCompletionsPromise));let m;this._register(Et(v=>{var x,D;const b=this.state.read(v),y=b==null?void 0:b.inlineCompletion;if((y==null?void 0:y.semanticId)!==(m==null?void 0:m.semanticId)&&(m=y,y)){const S=y.inlineCompletion,E=S.source;(D=(x=E.provider).handleItemDidShow)==null||D.call(x,E.inlineCompletions,S.sourceInlineCompletion,S.insertText)}}))}_getReason(e){return e!=null&&e.isUndoing?$f.Undo:e!=null&&e.isRedoing?$f.Redo:this.isAcceptingPartially?$f.AcceptWord:$f.Other}async trigger(e){this._isActive.set(!0,e),await this._fetchInlineCompletionsPromise.get()}async triggerExplicitly(e){iy(e,t=>{this._isActive.set(!0,t),this._forceUpdateExplicitlySignal.trigger(t)}),await this._fetchInlineCompletionsPromise.get()}stop(e){iy(e,t=>{this._isActive.set(!1,t),this._source.clear(t)})}_computeAugmentation(e,t){const i=this.textModel,n=this._source.suggestWidgetInlineCompletions.read(t),r=n?n.inlineCompletions:[this.selectedInlineCompletion.read(t)].filter(zh);return BWe(r,a=>{let l=a.toSingleTextEdit(t);return l=Vb(l,i,W.fromPositions(l.range.getStartPosition(),e.range.getEndPosition())),BSe(l,e)?{completion:a,edit:l}:void 0})}async _deltaSelectedInlineCompletionIndex(e){await this.triggerExplicitly();const t=this._filteredInlineCompletionItems.get()||[];if(t.length>0){const i=(this.selectedInlineCompletionIndex.get()+e+t.length)%t.length;this._selectedInlineCompletionId.set(t[i].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 n;if(e.getModel()!==this.textModel)throw new ki;const t=this.state.get();if(!t||t.primaryGhostText.isEmpty()||!t.inlineCompletion)return;const i=t.inlineCompletion.toInlineCompletion(void 0);if(i.command&&i.source.addRef(),e.pushUndoStop(),i.snippetInfo)e.executeEdits("inlineSuggestion.accept",[Pn.replace(i.range,""),...i.additionalTextEdits]),e.setPosition(i.snippetInfo.range.getStartPosition(),"inlineCompletionAccept"),(n=Jo.get(e))==null||n.insert(i.snippetInfo.snippet,{undoStopBefore:!1});else{const r=t.edits,o=$ge(r).map(a=>ot.fromPositions(a));e.executeEdits("inlineSuggestion.accept",[...r.map(a=>Pn.replace(a.range,a.text)),...i.additionalTextEdits]),e.setSelections(o,"inlineCompletionAccept")}this.stop(),i.command&&(await this._commandService.executeCommand(i.command.id,...i.command.arguments||[]).then(void 0,is),i.source.removeRef())}async acceptNextWord(e){await this._acceptNext(e,(t,i)=>{const n=this.textModel.getLanguageIdAtPosition(t.lineNumber,t.column),r=this._languageConfigurationService.getLanguageConfiguration(n),o=new RegExp(r.wordDefinition.source,r.wordDefinition.flags.replace("g","")),a=i.match(o);let l=0;a&&a.index!==void 0?a.index===0?l=a[0].length:l=a.index:l=i.length;const h=/\s+/g.exec(i);return h&&h.index!==void 0&&h.index+h[0].length<l&&(l=h.index+h[0].length),l},0)}async acceptNextLine(e){await this._acceptNext(e,(t,i)=>{const n=i.match(/\n/);return n&&n.index!==void 0?n.index+1:i.length},1)}async _acceptNext(e,t,i){if(e.getModel()!==this.textModel)throw new ki;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 a=r.parts[0],l=new ie(r.lineNumber,a.column),d=a.text,h=t(l,d);if(h===d.length&&r.parts.length===1){this.accept(e);return}const f=d.substring(0,h),p=this._positions.get(),m=p[0];o.source.addRef();try{this._isAcceptingPartially=!0;try{e.pushUndoStop();const v=W.fromPositions(m,l),b=e.getModel().getValueInRange(v)+f,y=new Zh(v,b),x=[y,...vj(this.textModel,p,y)],D=$ge(x).map(S=>ot.fromPositions(S));e.executeEdits("inlineSuggestion.accept",x.map(S=>Pn.replace(S.range,S.text))),e.setSelections(D,"inlineCompletionPartialAccept"),e.revealPositionInCenterIfOutsideViewport(e.getPosition(),1)}finally{this._isAcceptingPartially=!1}if(o.source.provider.handlePartialAccept){const v=W.fromPositions(o.range.getStartPosition(),Nd.ofText(f).addToPosition(l)),b=e.getModel().getValueInRange(v,1);o.source.provider.handlePartialAccept(o.source.inlineCompletions,o.sourceInlineCompletion,b.length,{kind:i})}}finally{o.source.removeRef()}}handleSuggestAccepted(e){var r,o;const t=Vb(e.toSingleTextEdit(),this.textModel),i=this._computeAugmentation(t,void 0);if(!i)return;const n=i.completion.inlineCompletion;(o=(r=n.source.provider).handlePartialAccept)==null||o.call(r,n.source.inlineCompletions,n.sourceInlineCompletion,t.text.length,{kind:2})}};dX=Not([_j(9,ut),_j(10,on),_j(11,Bn)],dX);var $f;(function(s){s[s.Undo=0]="Undo",s[s.Redo=1]="Redo",s[s.AcceptWord=2]="AcceptWord",s[s.Other=3]="Other"})($f||($f={}));function vj(s,e,t){if(e.length===1)return[];const i=e[0],n=e.slice(1),r=t.range.getStartPosition(),o=t.range.getEndPosition(),a=s.getValueInRange(W.fromPositions(i,o)),l=xge(i,r);if(l.lineNumber<1)return Tt(new ki(`positionWithinTextEdit line number should be bigger than 0.
|
|
907
907
|
Invalid subtraction between ${i.toString()} and ${r.toString()}`)),[];const d=Mot(t.text,l);return n.map(h=>{const f=not(xge(h,r),o),p=s.getValueInRange(W.fromPositions(h,f)),m=i_(a,p),v=W.fromPositions(h,h.delta(0,m));return new Zh(v,d)})}function Mot(s,e){let t="";const i=f5e(s);for(let n=e.lineNumber-1;n<i.length;n++)t+=i[n].substring(n===e.lineNumber-1?e.column-1:0);return t}function $ge(s){const e=e4.createSortPermutation(s,qo(r=>r.range,W.compareRangesUsingStarts)),i=new $ee(e.apply(s)).getNewRanges();return e.inverse().apply(i).map(r=>r.getEndPosition())}var Rot=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},zge=function(s,e){return function(t,i){e(t,i,s)}},zD;class Lne{constructor(e){this.name=e}select(e,t,i){if(i.length===0)return 0;const n=i[0].score[0];for(let r=0;r<i.length;r++){const{score:o,completion:a}=i[r];if(o[0]!==n)break;if(a.preselect)return r}return 0}}class jge extends Lne{constructor(){super("first")}memorize(e,t,i){}toJSON(){}fromJSON(){}}class Pot extends Lne{constructor(){super("recentlyUsed"),this._cache=new lf(300,.66),this._seq=0}memorize(e,t,i){const n=`${e.getLanguageId()}/${i.textLabel}`;this._cache.set(n,{touch:this._seq++,type:i.completion.kind,insertText:i.completion.insertText})}select(e,t,i){if(i.length===0)return 0;const n=e.getLineContent(t.lineNumber).substr(t.column-10,t.column-1);if(/\s$/.test(n))return super.select(e,t,i);const r=i[0].score[0];let o=-1,a=-1,l=-1;for(let d=0;d<i.length&&i[d].score[0]===r;d++){const h=`${e.getLanguageId()}/${i[d].textLabel}`,f=this._cache.peek(h);if(f&&f.touch>l&&f.type===i[d].completion.kind&&f.insertText===i[d].completion.insertText&&(l=f.touch,a=d),i[d].completion.preselect&&o===-1)return o=d}return a!==-1?a:o!==-1?o:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();const t=0;for(const[i,n]of e)n.touch=t,n.type=typeof n.type=="number"?n.type:vI.fromString(n.type),this._cache.set(i,n);this._seq=this._cache.size}}class Oot extends Lne{constructor(){super("recentlyUsedByPrefix"),this._trie=K0.forStrings(),this._seq=0}memorize(e,t,i){const{word:n}=e.getWordUntilPosition(t),r=`${e.getLanguageId()}/${n}`;this._trie.set(r,{type:i.completion.kind,insertText:i.completion.insertText,touch:this._seq++})}select(e,t,i){const{word:n}=e.getWordUntilPosition(t);if(!n)return super.select(e,t,i);const r=`${e.getLanguageId()}/${n}`;let o=this._trie.get(r);if(o||(o=this._trie.findSubstr(r)),o)for(let a=0;a<i.length;a++){const{kind:l,insertText:d}=i[a].completion;if(l===o.type&&d===o.insertText)return a}return super.select(e,t,i)}toJSON(){const e=[];return this._trie.forEach((t,i)=>e.push([i,t])),e.sort((t,i)=>-(t[1].touch-i[1].touch)).forEach((t,i)=>t[1].touch=i),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,i]of e)i.type=typeof i.type=="number"?i.type:vI.fromString(i.type),this._trie.set(t,i)}}}var Vm;let uX=(Vm=class{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new me,this._persistSoon=new ji(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(i=>{i.reason===KI.SHUTDOWN&&this._saveState()}))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,i){this._withStrategy(e,t).memorize(e,t,i),this._persistSoon.schedule()}select(e,t,i){return this._withStrategy(e,t).select(e,t,i)}_withStrategy(e,t){var n;const i=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if(((n=this._strategy)==null?void 0:n.name)!==i){this._saveState();const r=zD._strategyCtors.get(i)||jge;this._strategy=new r;try{const a=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,l=this._storageService.get(`${zD._storagePrefix}/${i}`,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,i=JSON.stringify(this._strategy);this._storageService.store(`${zD._storagePrefix}/${this._strategy.name}`,i,t,1)}}},zD=Vm,Vm._strategyCtors=new Map([["recentlyUsedByPrefix",Oot],["recentlyUsed",Pot],["first",jge]]),Vm._storagePrefix="suggest/memories",Vm);uX=zD=Rot([zge(0,Bd),zge(1,Gt)],uX);const HV=ii("ISuggestMemories");li(HV,uX,1);var Aot=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Fot=function(s,e){return function(t,i){e(t,i,s)}},hX,_C;let I3=(_C=class{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=hX.AtEnd.bindTo(t),this._configListener=this._editor.onDidChangeConfiguration(i=>i.hasChanged(124)&&this._update()),this._update()}dispose(){var e;this._configListener.dispose(),(e=this._selectionListener)==null||e.dispose(),this._ckAtEnd.reset()}_update(){const e=this._editor.getOption(124)==="on";if(this._enabled!==e)if(this._enabled=e,this._enabled){const t=()=>{if(!this._editor.hasModel()){this._ckAtEnd.set(!1);return}const i=this._editor.getModel(),n=this._editor.getSelection(),r=i.getWordAtPosition(n.getStartPosition());if(!r){this._ckAtEnd.set(!1);return}this._ckAtEnd.set(r.endColumn===n.getStartPosition().column)};this._selectionListener=this._editor.onDidChangeCursorSelection(t),t()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}},hX=_C,_C.AtEnd=new qe("atEndOfWord",!1),_C);I3=hX=Aot([Fot(1,yt)],I3);var Bot=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Wot=function(s,e){return function(t,i){e(t,i,s)}},jD,vC;let ax=(vC=class{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=jD.OtherSuggestions.bindTo(t)}dispose(){this.reset()}reset(){var e;this._ckOtherSuggestions.reset(),(e=this._listener)==null||e.dispose(),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:e,index:t},i){if(e.items.length===0){this.reset();return}if(jD._moveIndex(!0,e,t)===t){this.reset();return}this._acceptNext=i,this._model=e,this._index=t,this._listener=this._editor.onDidChangeCursorPosition(()=>{this._ignore||this.reset()}),this._ckOtherSuggestions.set(!0)}static _moveIndex(e,t,i){let n=i;for(let r=t.items.length;r>0&&(n=(n+t.items.length+(e?1:-1))%t.items.length,!(n===i||!t.items[n].completion.additionalTextEdits));r--);return n}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(this._model)try{this._ignore=!0,this._index=jD._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}},jD=vC,vC.OtherSuggestions=new qe("hasOtherSuggestions",!1),vC);ax=jD=Bot([Wot(1,yt)],ax);class Hot{constructor(e,t,i,n){this._disposables=new me,this._disposables.add(i.onDidSuggest(r=>{r.completionModel.items.length===0&&this.reset()})),this._disposables.add(i.onDidCancel(r=>{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(r=>{if(this._active&&!t.isFrozen()&&i.state!==0){const o=r.charCodeAt(r.length-1);this._active.acceptCharacters.has(o)&&e.getOption(0)&&n(this._active.item)}}))}_onItem(e){if(!e||!So(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const t=new L4;for(const i of e.item.completion.commitCharacters)i.length>0&&t.add(i.charCodeAt(0));this._active={acceptCharacters:t,item:e}}reset(){this._active=void 0}dispose(){this._disposables.dispose()}}const yc=class yc{async provideSelectionRanges(e,t){const i=[];for(const n of t){const r=[];i.push(r);const o=new Map;await new Promise(a=>yc._bracketsRightYield(a,0,e,n,o)),await new Promise(a=>yc._bracketsLeftYield(a,0,e,n,o,r))}return i}static _bracketsRightYield(e,t,i,n,r){const o=new Map,a=Date.now();for(;;){if(t>=yc._maxRounds){e();break}if(!n){e();break}const l=i.bracketPairs.findNextBracket(n);if(!l){e();break}if(Date.now()-a>yc._maxDuration){setTimeout(()=>yc._bracketsRightYield(e,t+1,i,n,r));break}if(l.bracketInfo.isOpeningBracket){const h=l.bracketInfo.bracketText,f=o.has(h)?o.get(h):0;o.set(h,f+1)}else{const h=l.bracketInfo.getOpeningBrackets()[0].bracketText;let f=o.has(h)?o.get(h):0;if(f-=1,o.set(h,Math.max(0,f)),f<0){let p=r.get(h);p||(p=new Vo,r.set(h,p)),p.push(l.range)}}n=l.range.getEndPosition()}}static _bracketsLeftYield(e,t,i,n,r,o){const a=new Map,l=Date.now();for(;;){if(t>=yc._maxRounds&&r.size===0){e();break}if(!n){e();break}const d=i.bracketPairs.findPrevBracket(n);if(!d){e();break}if(Date.now()-l>yc._maxDuration){setTimeout(()=>yc._bracketsLeftYield(e,t+1,i,n,r,o));break}if(d.bracketInfo.isOpeningBracket){const f=d.bracketInfo.bracketText;let p=a.has(f)?a.get(f):0;if(p-=1,a.set(f,Math.max(0,p)),p<0){const m=r.get(f);if(m){const v=m.shift();m.size===0&&r.delete(f);const b=W.fromPositions(d.range.getEndPosition(),v.getStartPosition()),y=W.fromPositions(d.range.getStartPosition(),v.getEndPosition());o.push({range:b}),o.push({range:y}),yc._addBracketLeading(i,y,o)}}}else{const f=d.bracketInfo.getOpeningBrackets()[0].bracketText,p=a.has(f)?a.get(f):0;a.set(f,p+1)}n=d.range.getStartPosition()}}static _addBracketLeading(e,t,i){if(t.startLineNumber===t.endLineNumber)return;const n=t.startLineNumber,r=e.getLineFirstNonWhitespaceColumn(n);r!==0&&r!==t.startColumn&&(i.push({range:W.fromPositions(new ie(n,r),t.getEndPosition())}),i.push({range:W.fromPositions(new ie(n,1),t.getEndPosition())}));const o=n-1;if(o>0){const a=e.getLineFirstNonWhitespaceColumn(o);a===t.startColumn&&a!==e.getLineLastNonWhitespaceColumn(o)&&(i.push({range:W.fromPositions(new ie(o,a),t.getEndPosition())}),i.push({range:W.fromPositions(new ie(o,1),t.getEndPosition())}))}}};yc._maxDuration=30,yc._maxRounds=2;let T3=yc;const Lh=class Lh{static async create(e,t){if(!t.getOption(119).localityBonus||!t.hasModel())return Lh.None;const i=t.getModel(),n=t.getPosition();if(!e.canComputeWordRanges(i.uri))return Lh.None;const[r]=await new T3().provideSelectionRanges(i,[n]);if(r.length===0)return Lh.None;const o=await e.computeWordRanges(i.uri,r[0].range);if(!o)return Lh.None;const a=i.getWordUntilPosition(n);return delete o[a.word],new class extends Lh{distance(l,d){if(!n.equals(t.getPosition()))return 0;if(d.kind===17)return 2<<20;const h=typeof d.label=="string"?d.label:d.label.label,f=o[h];if(eve(f))return 2<<20;const p=hI(f,W.fromPositions(l),W.compareRangesUsingStarts),m=p>=0?f[p]:f[Math.max(0,~p-1)];let v=r.length;for(const b of r){if(!W.containsRange(b.range,m))break;v-=1}return v}}}};Lh.None=new class extends Lh{distance(){return 0}};let N3=Lh,Uge=class{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}};class em{constructor(e,t,i,n,r,o,a=HI.default,l=void 0){this.clipboardText=l,this._snippetCompareFn=em._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=n,this._options=r,this._refilterKind=1,this._lineContext=i,this._fuzzyScoreOptions=a,o==="top"?this._snippetCompareFn=em._compareCompletionItemsSnippetsUp:o==="bottom"&&(this._snippetCompareFn=em._compareCompletionItemsSnippetsDown)}get lineContext(){return this._lineContext}set lineContext(e){(this._lineContext.leadingLineContent!==e.leadingLineContent||this._lineContext.characterCountDelta!==e.characterCountDelta)&&(this._refilterKind=this._lineContext.characterCountDelta<e.characterCountDelta&&this._filteredItems?2:1,this._lineContext=e)}get items(){return this._ensureCachedState(),this._filteredItems}getItemsByProvider(){return this._ensureCachedState(),this._itemsByProvider}getIncompleteProvider(){this._ensureCachedState();const e=new Set;for(const[t,i]of this.getItemsByProvider())i.length>0&&i[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:i}=this._lineContext;let n="",r="";const o=this._refilterKind===1?this._items:this._filteredItems,a=[],l=!this._options.filterGraceful||o.length>2e3?ey:I9e;for(let d=0;d<o.length;d++){const h=o[d];if(h.isInvalid)continue;const f=this._itemsByProvider.get(h.provider);f?f.push(h):this._itemsByProvider.set(h.provider,[h]);const p=h.position.column-h.editStart.column,m=p+i-(h.position.column-this._column);if(n.length!==m&&(n=m===0?"":t.slice(-m),r=n.toLowerCase()),h.word=n,m===0)h.score=Tu.Default;else{let v=0;for(;v<p;){const b=n.charCodeAt(v);if(b===32||b===9)v+=1;else break}if(v>=m)h.score=Tu.Default;else if(typeof h.completion.filterText=="string"){const b=l(n,r,v,h.completion.filterText,h.filterTextLow,0,this._fuzzyScoreOptions);if(!b)continue;Iq(h.completion.filterText,h.textLabel)===0?h.score=b:(h.score=k9e(n,r,v,h.textLabel,h.labelLow,0),h.score[0]=b[0])}else{const b=l(n,r,v,h.textLabel,h.labelLow,0,this._fuzzyScoreOptions);if(!b)continue;h.score=b}}h.idx=d,h.distance=this._wordDistance.distance(h.position,h.completion),a.push(h),e.push(h.textLabel.length)}this._filteredItems=a.sort(this._snippetCompareFn),this._refilterKind=0,this._stats={pLabelLen:e.length?CU(e.length-.85,e,(d,h)=>d-h):0}}static _compareCompletionItems(e,t){return e.score[0]>t.score[0]?-1:e.score[0]<t.score[0]?1:e.distance<t.distance?-1:e.distance>t.distance?1:e.idx<t.idx?-1:e.idx>t.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 em._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 em._compareCompletionItems(e,t)}}var Vot=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Rp=function(s,e){return function(t,i){e(t,i,s)}},fX;class Av{static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),i=e.getPosition();t.tokenization.tokenizeIfCheap(i.lineNumber);const n=t.getWordAtPosition(i);return!(!n||n.endColumn!==i.column&&n.startColumn+1!==i.column||!isNaN(Number(n.word)))}constructor(e,t,i){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=i}}function $ot(s,e,t){if(!e.getContextKeyValue(cl.inlineSuggestionVisible.key))return!0;const i=e.getContextKeyValue(cl.suppressSuggestions.key);return i!==void 0?!i:!s.getOption(62).suppressSuggestions}function zot(s,e,t){if(!e.getContextKeyValue("inlineSuggestionVisible"))return!0;const i=e.getContextKeyValue(cl.suppressSuggestions.key);return i!==void 0?!i:!s.getOption(62).suppressSuggestions}let M3=fX=class{constructor(e,t,i,n,r,o,a,l,d){this._editor=e,this._editorWorkerService=t,this._clipboardService=i,this._telemetryService=n,this._logService=r,this._contextKeyService=o,this._configurationService=a,this._languageFeaturesService=l,this._envService=d,this._toDispose=new me,this._triggerCharacterListener=new me,this._triggerQuickSuggest=new Ad,this._triggerState=void 0,this._completionDisposables=new me,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 ot(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 h=!1;this._toDispose.add(this._editor.onDidCompositionStart(()=>{h=!0})),this._toDispose.add(this._editor.onDidCompositionEnd(()=>{h=!1,this._onCompositionEnd()})),this._toDispose.add(this._editor.onDidChangeCursorSelection(f=>{h||this._onCursorChange(f)})),this._toDispose.add(this._editor.onDidChangeModelContent(()=>{!h&&this._triggerState!==void 0&&this._refilterCompletionItems()})),this._updateTriggerCharacters()}dispose(){Xi(this._triggerCharacterListener),Xi([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(92)||!this._editor.hasModel()||!this._editor.getOption(122))return;const e=new Map;for(const i of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const n of i.triggerCharacters||[]){let r=e.get(n);r||(r=new Set,e.set(n,r)),r.add(i)}const t=i=>{var o;if(!zot(this._editor,this._contextKeyService,this._configurationService)||Av.shouldAutoTrigger(this._editor))return;if(!i){const a=this._editor.getPosition();i=this._editor.getModel().getLineContent(a.lineNumber).substr(0,a.column-1)}let n="";KC(i.charCodeAt(i.length-1))?Gs(i.charCodeAt(i.length-2))&&(n=i.substr(i.length-2)):n=i.charAt(i.length-1);const r=e.get(n);if(r){const a=new Map;if(this._completionModel)for(const[l,d]of this._completionModel.getItemsByProvider())r.has(l)||a.set(l,d);this.trigger({auto:!0,triggerKind:1,triggerCharacter:n,retrigger:!!this._completionModel,clipboardText:(o=this._completionModel)==null?void 0:o.clipboardText,completionOptions:{providerFilter:r,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.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;b0.isAllOff(this._editor.getOption(90))||this._editor.getOption(119).snippetsPreventQuickSuggestions&&((e=Jo.get(this._editor))!=null&&e.isInSnippet())||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._triggerState!==void 0||!Av.shouldAutoTrigger(this._editor)||!this._editor.hasModel()||!this._editor.hasWidgetFocus())return;const t=this._editor.getModel(),i=this._editor.getPosition(),n=this._editor.getOption(90);if(!b0.isAllOff(n)){if(!b0.isAllOn(n)){t.tokenization.tokenizeIfCheap(i.lineNumber);const r=t.tokenization.getLineTokens(i.lineNumber),o=r.getStandardTokenType(r.findTokenIndexAtOffset(Math.max(i.column-1-1,0)));if(b0.valueFor(n,o)!=="on")return}$ot(this._editor,this._contextKeyService,this._configurationService)&&this._languageFeaturesService.completionProvider.has(t)&&this.trigger({auto:!0})}},this._editor.getOption(91)))}_refilterCompletionItems(){Ci(this._editor.hasModel()),Ci(this._triggerState!==void 0);const e=this._editor.getModel(),t=this._editor.getPosition(),i=new Av(e,t,{...this._triggerState,refilter:!0});this._onNewContext(i)}trigger(e){var p,m,v;if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=new Av(t,this._editor.getPosition(),e);this.cancel(e.retrigger),this._triggerState=e,this._onDidTrigger.fire({auto:e.auto,shy:e.shy??!1,position:this._editor.getPosition()}),this._context=i;let n={triggerKind:e.triggerKind??0};e.triggerCharacter&&(n={triggerKind:1,triggerCharacter:e.triggerCharacter}),this._requestToken=new An;const r=this._editor.getOption(113);let o=1;switch(r){case"top":o=0;break;case"bottom":o=2;break}const{itemKind:a,showDeprecated:l}=fX.createSuggestFilter(this._editor),d=new NT(o,((p=e.completionOptions)==null?void 0:p.kindFilter)??a,(m=e.completionOptions)==null?void 0:m.providerFilter,(v=e.completionOptions)==null?void 0:v.providerItemsToReuse,l),h=N3.create(this._editorWorkerService,this._editor),f=xne(this._languageFeaturesService.completionProvider,t,this._editor.getPosition(),d,n,this._requestToken.token);Promise.all([f,h]).then(async([b,y])=>{var I;if((I=this._requestToken)==null||I.dispose(),!this._editor.hasModel())return;let x=e==null?void 0:e.clipboardText;if(!x&&b.needsClipboard&&(x=await this._clipboardService.readText()),this._triggerState===void 0)return;const D=this._editor.getModel(),S=new Av(D,this._editor.getPosition(),e),E={...HI.default,firstMatchCanBeWeak:!this._editor.getOption(119).matchOnWordStartOnly};if(this._completionModel=new em(b.items,this._context.column,{leadingLineContent:S.leadingLineContent,characterCountDelta:S.column-this._context.column},y,this._editor.getOption(119),this._editor.getOption(113),E,x),this._completionDisposables.add(b.disposable),this._onNewContext(S),this._reportDurationsTelemetry(b.durations),!this._envService.isBuilt||this._envService.isExtensionDevelopment)for(const R of b.items)R.isInvalid&&this._logService.warn(`[suggest] did IGNORE invalid completion item from ${R.provider._debugDisplayName}`,R.completion)}).catch(Tt)}_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(113)==="none"&&t.add(27);const n=e.getOption(119);return n.showMethods||t.add(0),n.showFunctions||t.add(1),n.showConstructors||t.add(2),n.showFields||t.add(3),n.showVariables||t.add(4),n.showClasses||t.add(5),n.showStructs||t.add(6),n.showInterfaces||t.add(7),n.showModules||t.add(8),n.showProperties||t.add(9),n.showEvents||t.add(10),n.showOperators||t.add(11),n.showUnits||t.add(12),n.showValues||t.add(13),n.showConstants||t.add(14),n.showEnums||t.add(15),n.showEnumMembers||t.add(16),n.showKeywords||t.add(17),n.showWords||t.add(18),n.showColors||t.add(19),n.showFiles||t.add(20),n.showReferences||t.add(21),n.showColors||t.add(22),n.showFolders||t.add(23),n.showTypeParameters||t.add(24),n.showSnippets||t.add(27),n.showUsers||t.add(25),n.showIssues||t.add(26),{itemKind:t,showDeprecated:n.showDeprecated}}_onNewContext(e){if(this._context){if(e.lineNumber!==this._context.lineNumber){this.cancel();return}if(Zi(e.leadingLineContent)!==Zi(this._context.leadingLineContent)){this.cancel();return}if(e.column<this._context.column){e.leadingWord.word?this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0}):this.cancel();return}if(this._completionModel){if(e.leadingWord.word.length!==0&&e.leadingWord.startColumn>this._context.leadingWord.startColumn){if(Av.shouldAutoTrigger(this._editor)&&this._context){const i=this._completionModel.getItemsByProvider();this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerItemsToReuse:i}})}return}if(e.column>this._context.column&&this._completionModel.getIncompleteProvider().size>0&&e.leadingWord.word.length!==0){const t=new Map,i=new Set;for(const[n,r]of this._completionModel.getItemsByProvider())r.length>0&&r[0].container.incomplete?i.add(n):t.set(n,r);this.trigger({auto:this._context.triggerOptions.auto,triggerKind:2,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerFilter:i,providerItemsToReuse:t}})}else{const t=this._completionModel.lineContext;let i=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},this._completionModel.items.length===0){const n=Av.shouldAutoTrigger(this._editor);if(!this._context){this.cancel();return}if(n&&this._context.leadingWord.endColumn<e.leadingWord.startColumn){this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0});return}if(this._context.triggerOptions.auto){this.cancel();return}else if(this._completionModel.lineContext=t,i=this._completionModel.items.length>0,i&&e.leadingWord.word.length===0){this.cancel();return}}this._onDidSuggest.fire({completionModel:this._completionModel,triggerOptions:e.triggerOptions,isFrozen:i})}}}}};M3=fX=Vot([Rp(1,Na),Rp(2,Yg),Rp(3,so),Rp(4,qr),Rp(5,yt),Rp(6,Gt),Rp(7,it),Rp(8,qee)],M3);const rW=class rW{constructor(e,t){this._disposables=new me,this._lastOvertyped=[],this._locked=!1,this._disposables.add(e.onWillType(()=>{if(this._locked||!e.hasModel())return;const i=e.getSelections(),n=i.length;let r=!1;for(let a=0;a<n;a++)if(!i[a].isEmpty()){r=!0;break}if(!r){this._lastOvertyped.length!==0&&(this._lastOvertyped.length=0);return}this._lastOvertyped=[];const o=e.getModel();for(let a=0;a<n;a++){const l=i[a];if(o.getValueLengthInRange(l)>rW._maxSelectionLength)return;this._lastOvertyped[a]={value:o.getValueInRange(l),multiline:l.startLineNumber!==l.endLineNumber}}})),this._disposables.add(t.onDidTrigger(i=>{this._locked=!0})),this._disposables.add(t.onDidCancel(i=>{this._locked=!1}))}getLastOvertypedInfo(e){if(e>=0&&e<this._lastOvertyped.length)return this._lastOvertyped[e]}dispose(){this._disposables.dispose()}};rW._maxSelectionLength=51200;let gX=rW;var jot=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},bj=function(s,e){return function(t,i){e(t,i,s)}};let pX=class{constructor(e,t,i,n,r){this._menuId=t,this._menuService=n,this._contextKeyService=r,this._menuDisposables=new me,this.element=Ee(e,Fe(".suggest-status-bar"));const o=a=>a instanceof ol?i.createInstance(xte,a,{useComma:!0}):void 0;this._leftActions=new Zl(this.element,{actionViewItemProvider:o}),this._rightActions=new Zl(this.element,{actionViewItemProvider:o}),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 i=[],n=[];for(const[r,o]of e.getActions())r==="left"?i.push(...o):n.push(...o);this._leftActions.clear(),this._leftActions.push(i),this._rightActions.clear(),this._rightActions.push(n)};this._menuDisposables.add(e.onDidChange(()=>t())),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};pX=jot([bj(2,ut),bj(3,nc),bj(4,yt)],pX);var Uot=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},qot=function(s,e){return function(t,i){e(t,i,s)}};function Dne(s){return!!s&&!!(s.completion.documentation||s.completion.detail&&s.completion.detail!==s.completion.label)}let mX=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 me,this._renderDisposeable=new me,this._borderWidth=1,this._size=new Wi(330,0),this.domNode=Fe(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(Ag,{editor:e}),this._body=Fe(".body"),this._scrollbar=new _N(this._body,{alwaysConsumeMouseWheel:!0}),Ee(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=Ee(this._body,Fe(".header")),this._close=Ee(this._header,Fe("span"+bt.asCSSSelector(Oe.close))),this._close.title=w("details.close","Close"),this._type=Ee(this._header,Fe("p.type")),this._docs=Ee(this._body,Fe("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(50)&&this._configureFont()}))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(50),i=t.getMassagedFontFamily(),n=e.get(120)||t.fontSize,r=e.get(121)||t.lineHeight,o=t.fontWeight,a=`${n}px`,l=`${r}px`;this.domNode.style.fontSize=a,this.domNode.style.lineHeight=`${r/n}`,this.domNode.style.fontWeight=o,this.domNode.style.fontFeatureSettings=t.fontFeatureSettings,this._type.style.fontFamily=i,this._close.style.height=l,this._close.style.width=l}getLayoutInfo(){const e=this._editor.getOption(121)||this._editor.getOption(50).lineHeight,t=this._borderWidth,i=t*2;return{lineHeight:e,borderWidth:t,borderHeight:i,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 r;this._renderDisposeable.clear();let{detail:i,documentation:n}=e.completion;if(t){let o="";o+=`score: ${e.score[0]}
|
|
908
908
|
`,o+=`prefix: ${e.word??"(no prefix)"}
|
|
909
909
|
`,o+=`word: ${e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel}
|
|
910
910
|
`,o+=`distance: ${e.distance} (localityBonus-setting)
|
|
911
911
|
`,o+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"}
|
|
912
912
|
`,o+=`commit_chars: ${(r=e.completion.commitCharacters)==null?void 0:r.join("")}
|
|
913
|
-
`,n=new eo().appendCodeblock("empty",o),i=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!Dne(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),i){const o=i.length>1e5?`${i.substr(0,1e5)}…`:i;this._type.textContent=o,this._type.title=o,Qa(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(o))}else Sr(this._type),this._type.title="",Bo(this._type),this.domNode.classList.add("no-type");if(Sr(this._docs),typeof n=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=n;else if(n){this._docs.classList.add("markdown-docs"),Sr(this._docs);const o=this._markdownRenderer.render(n);this._docs.appendChild(o.element),this._renderDisposeable.add(o),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=o=>{o.preventDefault(),o.stopPropagation()},this._close.onclick=o=>{o.preventDefault(),o.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 i=new Wi(e,t);Wi.equals(i,this._size)||(this._size=i,b3e(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}};mX=Uot([qot(1,ut)],mX);class Kot{constructor(e,t){this.widget=e,this._editor=t,this.allowEditorOverflow=!0,this._disposables=new me,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new one,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let i,n,r=0,o=0;this._disposables.add(this._resizable.onDidWillResize(()=>{i=this._topLeft,n=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(a=>{if(i&&n){this.widget.layout(a.dimension.width,a.dimension.height);let l=!1;a.west&&(o=n.width-a.dimension.width,l=!0),a.north&&(r=n.height-a.dimension.height,l=!0),l&&this._applyTopLeft({top:i.top+r,left:i.left+o})}a.done&&(i=void 0,n=void 0,r=0,o=0,this._userSize=a.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{this._anchorBox&&this._placeAtAnchor(this._anchorBox,this._userSize??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){const i=e.getBoundingClientRect();this._anchorBox=i,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,this._userSize??this.widget.size,t)}_placeAtAnchor(e,t,i){const n=o_(this.getDomNode().ownerDocument.body),r=this.widget.getLayoutInfo(),o=new Wi(220,2*r.lineHeight),a=e.top,l=function(){const I=n.width-(e.left+e.width+r.borderWidth+r.horizontalPadding),R=-r.borderWidth+e.left+e.width,M=new Wi(I,n.height-e.top-r.borderHeight-r.verticalPadding),O=M.with(void 0,e.top+e.height-r.borderHeight-r.verticalPadding);return{top:a,left:R,fit:I-t.width,maxSizeTop:M,maxSizeBottom:O,minSize:o.with(Math.min(I,o.width))}}(),d=function(){const I=e.left-r.borderWidth-r.horizontalPadding,R=Math.max(r.horizontalPadding,e.left-t.width-r.borderWidth),M=new Wi(I,n.height-e.top-r.borderHeight-r.verticalPadding),O=M.with(void 0,e.top+e.height-r.borderHeight-r.verticalPadding);return{top:a,left:R,fit:I-t.width,maxSizeTop:M,maxSizeBottom:O,minSize:o.with(Math.min(I,o.width))}}(),h=function(){const I=e.left,R=-r.borderWidth+e.top+e.height,M=new Wi(e.width-r.borderHeight,n.height-e.top-e.height-r.verticalPadding);return{top:R,left:I,fit:M.height-t.height,maxSizeBottom:M,maxSizeTop:M,minSize:o.with(M.width)}}(),f=[l,d,h],p=f.find(I=>I.fit>=0)??f.sort((I,R)=>R.fit-I.fit)[0],m=e.top+e.height-r.borderHeight;let v,b=t.height;const y=Math.max(p.maxSizeTop.height,p.maxSizeBottom.height);b>y&&(b=y);let x;i?b<=p.maxSizeTop.height?(v=!0,x=p.maxSizeTop):(v=!1,x=p.maxSizeBottom):b<=p.maxSizeBottom.height?(v=!1,x=p.maxSizeBottom):(v=!0,x=p.maxSizeTop);let{top:D,left:S}=p;!v&&b>e.height&&(D=m-b);const E=this._editor.getDomNode();if(E){const I=E.getBoundingClientRect();D-=I.top,S-=I.left}this._applyTopLeft({left:S,top:D}),this._resizable.enableSashes(!v,p===l,v,p!==l),this._resizable.minSize=p.minSize,this._resizable.maxSize=x,this._resizable.layout(b,Math.min(x.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this._editor.layoutOverlayWidget(this)}}var $h;(function(s){s[s.FILE=0]="FILE",s[s.FOLDER=1]="FOLDER",s[s.ROOT_FOLDER=2]="ROOT_FOLDER"})($h||($h={}));const Got=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function b2(s,e,t,i,n){if(bt.isThemeIcon(n))return[`codicon-${n.id}`,"predefined-file-icon"];if(gt.isUri(n))return[];const r=i===$h.ROOT_FOLDER?["rootfolder-icon"]:i===$h.FOLDER?["folder-icon"]:["file-icon"];if(t){let o;if(t.scheme===Mt.data)o=c_.parseMetaData(t).get(c_.META_DATA_LABEL);else{const a=t.path.match(Got);a?(o=C2(a[2].toLowerCase()),a[1]&&r.push(`${C2(a[1].toLowerCase())}-name-dir-icon`)):o=C2(t.authority.toLowerCase())}if(i===$h.ROOT_FOLDER)r.push(`${o}-root-name-folder-icon`);else if(i===$h.FOLDER)r.push(`${o}-name-folder-icon`);else{if(o){if(r.push(`${o}-name-file-icon`),r.push("name-file-icon"),o.length<=255){const l=o.split(".");for(let d=1;d<l.length;d++)r.push(`${l.slice(d).join(".")}-ext-file-icon`)}r.push("ext-file-icon")}const a=Yot(s,e,t);a&&r.push(`${C2(a)}-lang-file-icon`)}}return r}function Yot(s,e,t){if(!t)return null;let i=null;if(t.scheme===Mt.data){const r=c_.parseMetaData(t).get(c_.META_DATA_MIME);r&&(i=e.getLanguageIdByMimeType(r))}else{const n=s.getModel(t);n&&(i=n.getLanguageId())}return i&&i!==Go?i:e.guessLanguageIdByFilepathOrFirstLine(t)}function C2(s){return s.replace(/[\s]/g,"/")}var Zot=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Cj=function(s,e){return function(t,i){e(t,i,s)}};function WSe(s){return`suggest-aria-id:${s}`}const Xot=mn("suggest-more-info",Oe.chevronRight,w("suggestMoreInfoIcon","Icon for more information in the suggest widget."));var mu;const Qot=new(mu=class{extract(e,t){if(e.textLabel.match(mu._regexStrict))return t[0]=e.textLabel,!0;if(e.completion.detail&&e.completion.detail.match(mu._regexStrict))return t[0]=e.completion.detail,!0;if(e.completion.documentation){const i=typeof e.completion.documentation=="string"?e.completion.documentation:e.completion.documentation.value,n=mu._regexRelaxed.exec(i);if(n&&(n.index===0||n.index+n[0].length===i.length))return t[0]=n[0],!0}return!1}},mu._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*\))/,mu._regexStrict=new RegExp(`^${mu._regexRelaxed.source}$`,"i"),mu);let _X=class{constructor(e,t,i,n){this._editor=e,this._modelService=t,this._languageService=i,this._themeService=n,this._onDidToggleDetails=new se,this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(e){const t=new me,i=e;i.classList.add("show-file-icons");const n=Ee(e,Fe(".icon")),r=Ee(n,Fe("span.colorspan")),o=Ee(e,Fe(".contents")),a=Ee(o,Fe(".main")),l=Ee(a,Fe(".icon-label.codicon")),d=Ee(a,Fe("span.left")),h=Ee(a,Fe("span.right")),f=new y5(d,{supportHighlights:!0,supportIcons:!0});t.add(f);const p=Ee(d,Fe("span.signature-label")),m=Ee(d,Fe("span.qualifier-label")),v=Ee(h,Fe("span.details-label")),b=Ee(h,Fe("span.readMore"+bt.asCSSSelector(Xot)));return b.title=w("readMore","Read More"),{root:i,left:d,right:h,icon:n,colorspan:r,iconLabel:f,iconContainer:l,parametersLabel:p,qualifierLabel:m,detailsLabel:v,readMore:b,disposables:t,configureFont:()=>{const x=this._editor.getOptions(),D=x.get(50),S=D.getMassagedFontFamily(),E=D.fontFeatureSettings,I=x.get(120)||D.fontSize,R=x.get(121)||D.lineHeight,M=D.fontWeight,O=D.letterSpacing,H=`${I}px`,te=`${R}px`,J=`${O}px`;i.style.fontSize=H,i.style.fontWeight=M,i.style.letterSpacing=J,a.style.fontFamily=S,a.style.fontFeatureSettings=E,a.style.lineHeight=te,n.style.height=te,n.style.width=te,b.style.height=te,b.style.width=te}}}renderElement(e,t,i){i.configureFont();const{completion:n}=e;i.root.id=WSe(t),i.colorspan.style.backgroundColor="";const r={labelEscapeNewLines:!0,matches:vN(e.score)},o=[];if(n.kind===19&&Qot.extract(e,o))i.icon.className="icon customcolor",i.iconContainer.className="icon hide",i.colorspan.style.backgroundColor=o[0];else if(n.kind===20&&this._themeService.getFileIconTheme().hasFileIcons){i.icon.className="icon hide",i.iconContainer.className="icon hide";const a=b2(this._modelService,this._languageService,gt.from({scheme:"fake",path:e.textLabel}),$h.FILE),l=b2(this._modelService,this._languageService,gt.from({scheme:"fake",path:n.detail}),$h.FILE);r.extraClasses=a.length>l.length?a:l}else n.kind===23&&this._themeService.getFileIconTheme().hasFolderIcons?(i.icon.className="icon hide",i.iconContainer.className="icon hide",r.extraClasses=[b2(this._modelService,this._languageService,gt.from({scheme:"fake",path:e.textLabel}),$h.FOLDER),b2(this._modelService,this._languageService,gt.from({scheme:"fake",path:n.detail}),$h.FOLDER)].flat()):(i.icon.className="icon hide",i.iconContainer.className="",i.iconContainer.classList.add("suggest-icon",...bt.asClassNameArray(vI.toIcon(n.kind))));n.tags&&n.tags.indexOf(1)>=0&&(r.extraClasses=(r.extraClasses||[]).concat(["deprecated"]),r.matches=[]),i.iconLabel.setLabel(e.textLabel,void 0,r),typeof n.label=="string"?(i.parametersLabel.textContent="",i.detailsLabel.textContent=yj(n.detail||""),i.root.classList.add("string-label")):(i.parametersLabel.textContent=yj(n.label.detail||""),i.detailsLabel.textContent=yj(n.label.description||""),i.root.classList.remove("string-label")),this._editor.getOption(119).showInlineDetails?Qa(i.detailsLabel):Bo(i.detailsLabel),Dne(e)?(i.right.classList.add("can-expand-details"),Qa(i.readMore),i.readMore.onmousedown=a=>{a.stopPropagation(),a.preventDefault()},i.readMore.onclick=a=>{a.stopPropagation(),a.preventDefault(),this._onDidToggleDetails.fire()}):(i.right.classList.remove("can-expand-details"),Bo(i.readMore),i.readMore.onmousedown=null,i.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};_X=Zot([Cj(1,pn),Cj(2,Nn),Cj(3,zs)],_X);function yj(s){return s.replace(/\r\n|\r|\n/g,"")}var Jot=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},y2=function(s,e){return function(t,i){e(t,i,s)}},K1;q("editorSuggestWidget.background",Ul,w("editorSuggestWidgetBackground","Background color of the suggest widget."));q("editorSuggestWidget.border",Xee,w("editorSuggestWidgetBorder","Border color of the suggest widget."));const eat=q("editorSuggestWidget.foreground",cf,w("editorSuggestWidgetForeground","Foreground color of the suggest widget."));q("editorSuggestWidget.selectedForeground",AI,w("editorSuggestWidgetSelectedForeground","Foreground color of the selected entry in the suggest widget."));q("editorSuggestWidget.selectedIconForeground",ste,w("editorSuggestWidgetSelectedIconForeground","Icon foreground color of the selected entry in the suggest widget."));const tat=q("editorSuggestWidget.selectedBackground",FI,w("editorSuggestWidgetSelectedBackground","Background color of the selected entry in the suggest widget."));q("editorSuggestWidget.highlightForeground",n0,w("editorSuggestWidgetHighlightForeground","Color of the match highlights in the suggest widget."));q("editorSuggestWidget.focusHighlightForeground",I7e,w("editorSuggestWidgetFocusHighlightForeground","Color of the match highlights in the suggest widget when an item is focused."));q("editorSuggestWidgetStatus.foreground",jt(eat,.5),w("editorSuggestWidgetStatusForeground","Foreground color of the suggest widget status."));class iat{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof Pd}`}restore(){const e=this._service.get(this._key,0)??"";try{const t=JSON.parse(e);if(Wi.is(t))return Wi.lift(t)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}var $m;let vX=($m=class{constructor(e,t,i,n,r){this.editor=e,this._storageService=t,this._state=0,this._isAuto=!1,this._pendingLayout=new Js,this._pendingShowDetails=new Js,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new Ad,this._disposables=new me,this._onDidSelect=new UC,this._onDidFocus=new UC,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 one,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new nat(this,e),this._persistedSize=new iat(t,e);class o{constructor(m,v,b=!1,y=!1){this.persistedSize=m,this.currentSize=v,this.persistHeight=b,this.persistWidth=y}}let a;this._disposables.add(this.element.onDidWillResize(()=>{this._contentWidget.lockPreference(),a=new o(this._persistedSize.restore(),this.element.size)})),this._disposables.add(this.element.onDidResize(p=>{var m,v;if(this._resize(p.dimension.width,p.dimension.height),a&&(a.persistHeight=a.persistHeight||!!p.north||!!p.south,a.persistWidth=a.persistWidth||!!p.east||!!p.west),!!p.done){if(a){const{itemHeight:b,defaultSize:y}=this.getLayoutInfo(),x=Math.round(b/2);let{width:D,height:S}=this.element.size;(!a.persistHeight||Math.abs(a.currentSize.height-S)<=x)&&(S=((m=a.persistedSize)==null?void 0:m.height)??y.height),(!a.persistWidth||Math.abs(a.currentSize.width-D)<=x)&&(D=((v=a.persistedSize)==null?void 0:v.width)??y.width),this._persistedSize.store(new Wi(D,S))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=Ee(this.element.domNode,Fe(".message")),this._listElement=Ee(this.element.domNode,Fe(".tree"));const l=this._disposables.add(r.createInstance(mX,this.editor));l.onDidClose(this.toggleDetails,this,this._disposables),this._details=new Kot(l,this.editor);const d=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(119).showIcons);d();const h=r.createInstance(_X,this.editor);this._disposables.add(h),this._disposables.add(h.onDidToggleDetails(()=>this.toggleDetails())),this._list=new oc("SuggestWidget",this._listElement,{getHeight:p=>this.getLayoutInfo().itemHeight,getTemplateId:p=>"suggestion"},[h],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>"option",getWidgetAriaLabel:()=>w("suggest","Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:p=>{let m=p.textLabel;if(typeof p.completion.label!="string"){const{detail:x,description:D}=p.completion.label;x&&D?m=w("label.full","{0} {1}, {2}",m,x,D):x?m=w("label.detail","{0} {1}",m,x):D&&(m=w("label.desc","{0}, {1}",m,D))}if(!p.isResolved||!this._isDetailsVisible())return m;const{documentation:v,detail:b}=p.completion,y=qC("{0}{1}",b||"",v?typeof v=="string"?v:v.value:"");return w("ariaCurrenttSuggestionReadDetails","{0}, docs: {1}",m,y)}}}),this._list.style(Py({listInactiveFocusBackground:tat,listInactiveFocusOutline:yn})),this._status=r.createInstance(pX,this.element.domNode,Nm);const f=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(119).showStatusBar);f(),this._disposables.add(n.onDidColorThemeChange(p=>this._onThemeChange(p))),this._onThemeChange(n.getColorTheme()),this._disposables.add(this._list.onMouseDown(p=>this._onListMouseDownOrTap(p))),this._disposables.add(this._list.onTap(p=>this._onListMouseDownOrTap(p))),this._disposables.add(this._list.onDidChangeSelection(p=>this._onListSelection(p))),this._disposables.add(this._list.onDidChangeFocus(p=>this._onListFocus(p))),this._disposables.add(this.editor.onDidChangeCursorSelection(()=>this._onCursorSelectionChanged())),this._disposables.add(this.editor.onDidChangeConfiguration(p=>{p.hasChanged(119)&&(f(),d()),this._completionModel&&(p.hasChanged(50)||p.hasChanged(120)||p.hasChanged(121))&&this._list.splice(0,this._list.length,this._completionModel.items)})),this._ctxSuggestWidgetVisible=zt.Visible.bindTo(i),this._ctxSuggestWidgetDetailsVisible=zt.DetailsVisible.bindTo(i),this._ctxSuggestWidgetMultipleSuggestions=zt.MultipleSuggestions.bindTo(i),this._ctxSuggestWidgetHasFocusedSuggestion=zt.HasFocusedSuggestion.bindTo(i),this._disposables.add(Hn(this._details.widget.domNode,"keydown",p=>{this._onDetailsKeydown.fire(p)})),this._disposables.add(this.editor.onMouseDown(p=>this._onEditorMouseDown(p)))}dispose(){var e;this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),(e=this._loadingTimeout)==null||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 i=this._completionModel;i&&(this._onDidSelect.fire({item:e,index:t,model:i}),this.editor.focus())}_onThemeChange(e){this._details.widget.borderWidth=Eu(e.type)?2:1}_onListFocus(e){var n;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 t=e.elements[0],i=e.indexes[0];t!==this._focusedItem&&((n=this._currentSuggestionDetails)==null||n.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=t,this._list.reveal(i),this._currentSuggestionDetails=Zs(async r=>{const o=r_(()=>{this._isDetailsVisible()&&this.showDetails(!0)},250),a=r.onCancellationRequested(()=>o.dispose());try{return await t.resolve(r)}finally{o.dispose(),a.dispose()}}),this._currentSuggestionDetails.then(()=>{i>=this._list.length||t!==this._list.element(i)||(this._ignoreFocusEvents=!0,this._list.splice(i,1,[t]),this._list.setFocus([i]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this.showDetails(!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:WSe(i)}))}).catch(Tt)),this._onDidFocus.fire({item:t,index:i,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:Bo(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=K1.LOADING_MESSAGE,Bo(this._listElement,this._status.element),Qa(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Jh(K1.LOADING_MESSAGE);break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=K1.NO_SUGGESTIONS_MESSAGE,Bo(this._listElement,this._status.element),Qa(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Jh(K1.NO_SUGGESTIONS_MESSAGE);break;case 3:Bo(this._messageElement),Qa(this._listElement,this._status.element),this._show();break;case 4:Bo(this._messageElement),Qa(this._listElement,this._status.element),this._show();break;case 5:Bo(this._messageElement),Qa(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=r_(()=>this._setState(1),t)))}showSuggestions(e,t,i,n,r){var l,d;if(this._contentWidget.setPosition(this.editor.getPosition()),(l=this._loadingTimeout)==null||l.dispose(),(d=this._currentSuggestionDetails)==null||d.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),i&&this._state!==2&&this._state!==0){this._setState(4);return}const o=this._completionModel.items.length,a=o===0;if(this._ctxSuggestWidgetMultipleSuggestions.set(o>1),a){this._setState(n?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(i?4:3),this._list.reveal(t,0),this._list.setFocus(r?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=v4(mt(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")):(Dne(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=v4(mt(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 i;this._pendingLayout.clear(),this._pendingShowDetails.clear(),(i=this._loadingTimeout)==null||i.dispose(),this._setState(0),this._onDidHide.fire(this),this.element.clearSashHoverState();const e=this._persistedSize.restore(),t=Math.ceil(this.getLayoutInfo().itemHeight*4.3);e&&e.height<t&&this._persistedSize.store(e.with(void 0,t))}isFrozen(){return this._state===4}_afterRender(e){if(e===null){this._isDetailsVisible()&&this._details.hide();return}this._state===2||this._state===1||(this._isDetailsVisible()&&!this._details.widget.isEmpty&&this._details.show(),this._positionDetails())}_layout(e){var o,a;if(!this.editor.hasModel()||!this.editor.getDomNode())return;const t=o_(this.element.domNode.ownerDocument.body),i=this.getLayoutInfo();e||(e=i.defaultSize);let n=e.height,r=e.width;if(this._status.element.style.height=`${i.itemHeight}px`,this._state===2||this._state===1)n=i.itemHeight+i.borderHeight,r=i.defaultSize.width/2,this.element.enableSashes(!1,!1,!1,!1),this.element.minSize=this.element.maxSize=new Wi(r,n),this._contentWidget.setPreference(2);else{const l=t.width-i.borderHeight-2*i.horizontalPadding;r>l&&(r=l);const d=this._completionModel?this._completionModel.stats.pLabelLen*i.typicalHalfwidthCharacterWidth:r,h=i.statusBarHeight+this._list.contentHeight+i.borderHeight,f=i.itemHeight+i.statusBarHeight,p=ts(this.editor.getDomNode()),m=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),v=p.top+m.top+m.height,b=Math.min(t.height-v-i.verticalPadding,h),y=p.top+m.top-i.verticalPadding,x=Math.min(y,h);let D=Math.min(Math.max(x,b)+i.borderHeight,h);n===((o=this._cappedHeight)==null?void 0:o.capped)&&(n=this._cappedHeight.wanted),n<f&&(n=f),n>D&&(n=D),n>b||this._forceRenderingAbove&&y>150?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),D=x):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),D=b),this.element.preferredSize=new Wi(d,i.defaultSize.height),this.element.maxSize=new Wi(l,D),this.element.minSize=new Wi(220,f),this._cappedHeight=n===h?{wanted:((a=this._cappedHeight)==null?void 0:a.wanted)??e.height,capped:n}:void 0}this._resize(r,n)}_resize(e,t){const{width:i,height:n}=this.element.maxSize;e=Math.min(i,e),t=Math.min(n,t);const{statusBarHeight:r}=this.getLayoutInfo();this._list.layout(t-r,e),this._listElement.style.height=`${t-r}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?void 0:e.preference[0])===2)}getLayoutInfo(){const e=this.editor.getOption(50),t=Fo(this.editor.getOption(121)||e.lineHeight,8,1e3),i=!this.editor.getOption(119).showStatusBar||this._state===2||this._state===1?0:t,n=this._details.widget.borderWidth,r=2*n;return{itemHeight:t,statusBarHeight:i,borderWidth:n,borderHeight:r,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new Wi(430,i+12*t+r)}}_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}},K1=$m,$m.LOADING_MESSAGE=w("suggestWidget.loading","Loading..."),$m.NO_SUGGESTIONS_MESSAGE=w("suggestWidget.noSuggestions","No suggestions."),$m);vX=K1=Jot([y2(1,Bd),y2(2,yt),y2(3,zs),y2(4,ut)],vX);class nat{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:i,horizontalPadding:n}=this._widget.getLayoutInfo();return new Wi(t+2*i+n,e+2*i)}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 sat=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},O1=function(s,e){return function(t,i){e(t,i,s)}},bX;class rat{constructor(e,t){if(this._model=e,this._position=t,this._decorationOptions=Ot.register({description:"suggest-line-suffix",stickiness:1}),e.getLineMaxColumn(t.lineNumber)!==t.column){const n=e.getOffsetAt(t),r=e.getPositionAt(n+1);e.changeDecorations(o=>{this._marker&&o.removeDecoration(this._marker),this._marker=o.addDecoration(W.fromPositions(t,r),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}}var bC;let wd=(bC=class{static get(e){return e.getContribution(bX.ID)}constructor(e,t,i,n,r,o,a){this._memoryService=t,this._commandService=i,this._contextKeyService=n,this._instantiationService=r,this._logService=o,this._telemetryService=a,this._lineSuffix=new Js,this._toDispose=new me,this._selectors=new oat(f=>f.priority),this._onWillInsertSuggestItem=new se,this.onWillInsertSuggestItem=this._onWillInsertSuggestItem.event,this.editor=e,this.model=r.createInstance(M3,this.editor),this._selectors.register({priority:0,select:(f,p,m)=>this._memoryService.select(f,p,m)});const l=zt.InsertMode.bindTo(n);l.set(e.getOption(119).insertMode),this._toDispose.add(this.model.onDidTrigger(()=>l.set(e.getOption(119).insertMode))),this.widget=this._toDispose.add(new B$(mt(e.getDomNode()),()=>{const f=this._instantiationService.createInstance(vX,this.editor);this._toDispose.add(f),this._toDispose.add(f.onDidSelect(y=>this._insertSuggestion(y,0),this));const p=new Hot(this.editor,f,this.model,y=>this._insertSuggestion(y,2));this._toDispose.add(p);const m=zt.MakesTextEdit.bindTo(this._contextKeyService),v=zt.HasInsertAndReplaceRange.bindTo(this._contextKeyService),b=zt.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(dt(()=>{m.reset(),v.reset(),b.reset()})),this._toDispose.add(f.onDidFocus(({item:y})=>{const x=this.editor.getPosition(),D=y.editStart.column,S=x.column;let E=!0;this.editor.getOption(1)==="smart"&&this.model.state===2&&!y.completion.additionalTextEdits&&!(y.completion.insertTextRules&4)&&S-D===y.completion.insertText.length&&(E=this.editor.getModel().getValueInRange({startLineNumber:x.lineNumber,startColumn:D,endLineNumber:x.lineNumber,endColumn:S})!==y.completion.insertText),m.set(E),v.set(!ie.equals(y.editInsertEnd,y.editReplaceEnd)),b.set(!!y.provider.resolveCompletionItem||!!y.completion.documentation||y.completion.detail!==y.completion.label)})),this._toDispose.add(f.onDetailsKeyDown(y=>{if(y.toKeyCodeChord().equals(new Mg(!0,!1,!1,!1,33))||ti&&y.toKeyCodeChord().equals(new Mg(!1,!1,!1,!0,33))){y.stopPropagation();return}y.toKeyCodeChord().isModifierKey()||this.editor.focus()})),f})),this._overtypingCapturer=this._toDispose.add(new B$(mt(e.getDomNode()),()=>this._toDispose.add(new gX(this.editor,this.model)))),this._alternatives=this._toDispose.add(new B$(mt(e.getDomNode()),()=>this._toDispose.add(new ax(this.editor,this._contextKeyService)))),this._toDispose.add(r.createInstance(I3,e)),this._toDispose.add(this.model.onDidTrigger(f=>{this.widget.value.showTriggered(f.auto,f.shy?250:50),this._lineSuffix.value=new rat(this.editor.getModel(),f.position)})),this._toDispose.add(this.model.onDidSuggest(f=>{if(f.triggerOptions.shy)return;let p=-1;for(const v of this._selectors.itemsOrderedByPriorityDesc)if(p=v.select(this.editor.getModel(),this.editor.getPosition(),f.completionModel.items),p!==-1)break;if(p===-1&&(p=0),this.model.state===0)return;let m=!1;if(f.triggerOptions.auto){const v=this.editor.getOption(119);v.selectionMode==="never"||v.selectionMode==="always"?m=v.selectionMode==="never":v.selectionMode==="whenTriggerCharacter"?m=f.triggerOptions.triggerKind!==1:v.selectionMode==="whenQuickSuggestion"&&(m=f.triggerOptions.triggerKind===1&&!f.triggerOptions.refilter)}this.widget.value.showSuggestions(f.completionModel,p,f.isFrozen,f.triggerOptions.auto,m)})),this._toDispose.add(this.model.onDidCancel(f=>{f.retrigger||this.widget.value.hideWidget()})),this._toDispose.add(this.editor.onDidBlurEditorWidget(()=>{this.model.cancel(),this.model.clear()}));const d=zt.AcceptSuggestionsOnEnter.bindTo(n),h=()=>{const f=this.editor.getOption(1);d.set(f==="on"||f==="smart")};this._toDispose.add(this.editor.onDidChangeConfiguration(()=>h())),h()}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 i=Jo.get(this.editor);if(!i)return;this._onWillInsertSuggestItem.fire({item:e.item});const n=this.editor.getModel(),r=n.getAlternativeVersionId(),{item:o}=e,a=[],l=new An;t&1||this.editor.pushUndoStop();const d=this.getOverwriteInfo(o,!!(t&8));this._memoryService.memorize(n,this.editor.getPosition(),o);const h=o.isResolved;let f=-1,p=-1;if(Array.isArray(o.completion.additionalTextEdits)){this.model.cancel();const v=Wu.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",o.completion.additionalTextEdits.map(b=>{let y=W.lift(b.range);if(y.startLineNumber===o.position.lineNumber&&y.startColumn>o.position.column){const x=this.editor.getPosition().column-o.position.column,D=x,S=W.spansMultipleLines(y)?0:x;y=new W(y.startLineNumber,y.startColumn+D,y.endLineNumber,y.endColumn+S)}return Pn.replaceMove(y,b.text)})),v.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!h){const v=new cr;let b;const y=n.onDidChangeContent(E=>{if(E.isFlush){l.cancel(),y.dispose();return}for(const I of E.changes){const R=W.getEndPosition(I.range);(!b||ie.isBefore(R,b))&&(b=R)}}),x=t;t|=2;let D=!1;const S=this.editor.onWillType(()=>{S.dispose(),D=!0,x&2||this.editor.pushUndoStop()});a.push(o.resolve(l.token).then(()=>{if(!o.completion.additionalTextEdits||l.token.isCancellationRequested)return;if(b&&o.completion.additionalTextEdits.some(I=>ie.isBefore(b,W.getStartPosition(I.range))))return!1;D&&this.editor.pushUndoStop();const E=Wu.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",o.completion.additionalTextEdits.map(I=>Pn.replaceMove(W.lift(I.range),I.text))),E.restoreRelativeVerticalPositionOfCursor(this.editor),(D||!(x&2))&&this.editor.pushUndoStop(),!0}).then(E=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",v.elapsed(),E),p=E===!0?1:E===!1?0:-2}).finally(()=>{y.dispose(),S.dispose()}))}let{insertText:m}=o.completion;if(o.completion.insertTextRules&4||(m=cy.escape(m)),this.model.cancel(),i.insert(m,{overwriteBefore:d.overwriteBefore,overwriteAfter:d.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(o.completion.insertTextRules&1),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),t&2||this.editor.pushUndoStop(),o.completion.command)if(o.completion.command.id===R3.id)this.model.trigger({auto:!0,retrigger:!0});else{const v=new cr;a.push(this._commandService.executeCommand(o.completion.command.id,...o.completion.command.arguments?[...o.completion.command.arguments]:[]).catch(b=>{o.completion.extensionId?is(b):Tt(b)}).finally(()=>{f=v.elapsed()}))}t&4&&this._alternatives.value.set(e,v=>{for(l.cancel();n.canUndo();){r!==n.getAlternativeVersionId()&&n.undo(),this._insertSuggestion(v,3|(t&8?8:0));break}}),this._alertCompletionItem(o),Promise.all(a).finally(()=>{this._reportSuggestionAcceptedTelemetry(o,n,h,f,p,e.index,e.model.items),this.model.clear(),l.dispose()})}_reportSuggestionAcceptedTelemetry(e,t,i,n,r,o,a){var p;if(Math.floor(Math.random()*100)===0)return;const l=new Map;for(let m=0;m<Math.min(30,a.length);m++){const v=a[m].textLabel;l.has(v)?l.get(v).push(m):l.set(v,[m])}const d=l.get(e.textLabel),f=d&&d.length>1?d[0]:-1;this._telemetryService.publicLog2("suggest.acceptedSuggestion",{extensionId:((p=e.extensionId)==null?void 0:p.value)??"unknown",providerId:e.provider._debugDisplayName??"unknown",kind:e.completion.kind,basenameHash:mH(Wc(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:V9e(t.uri),resolveInfo:e.provider.resolveCompletionItem?i?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:n,additionalEditsAsync:r,index:o,firstIndex:f})}getOverwriteInfo(e,t){Ci(this.editor.hasModel());let i=this.editor.getOption(119).insertMode==="replace";t&&(i=!i);const n=e.position.column-e.editStart.column,r=(i?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column,o=this.editor.getPosition().column-e.position.column,a=this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0;return{overwriteBefore:n+o,overwriteAfter:r+a}}_alertCompletionItem(e){if(So(e.completion.additionalTextEdits)){const t=w("aria.alert.snippet","Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);Qo(t)}}triggerSuggest(e,t,i){this.editor.hasModel()&&(this.model.trigger({auto:t??!1,completionOptions:{providerFilter:e,kindFilter:i?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(),i=()=>{t.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},n=r=>{if(r.completion.insertTextRules&4||r.completion.additionalTextEdits)return!0;const o=this.editor.getPosition(),a=r.editStart.column,l=o.column;return l-a!==r.completion.insertText.length?!0:this.editor.getModel().getValueInRange({startLineNumber:o.lineNumber,startColumn:a,endLineNumber:o.lineNumber,endColumn:l})!==r.completion.insertText};We.once(this.model.onDidTrigger)(r=>{const o=[];We.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{Xi(o),i()},void 0,o),this.model.onDidSuggest(({completionModel:a})=>{if(Xi(o),a.items.length===0){i();return}const l=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),a.items),d=a.items[l];if(!n(d)){i();return}this.editor.pushUndoStop(),this._insertSuggestion({index:l,item:d,model:a},7)},void 0,o)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,0),this.editor.focus()}acceptSelectedSuggestion(e,t){const i=this.widget.value.getFocusedItem();let n=0;e&&(n|=4),t&&(n|=8),this._insertSuggestion(i,n)}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)}},bX=bC,bC.ID="editor.contrib.suggestController",bC);wd=bX=sat([O1(1,HV),O1(2,on),O1(3,yt),O1(4,ut),O1(5,qr),O1(6,so)],wd);class oat{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,i)=>this.prioritySelector(i)-this.prioritySelector(t)),{dispose:()=>{const t=this._items.indexOf(e);t>=0&&this._items.splice(t,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}const oW=class oW extends Ze{constructor(){super({id:oW.id,label:w("suggest.trigger.label","Trigger Suggest"),alias:"Trigger Suggest",precondition:ve.and(U.writable,U.hasCompletionItemProvider,zt.Visible.toNegated()),kbOpts:{kbExpr:U.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t,i){const n=wd.get(t);if(!n)return;let r;i&&typeof i=="object"&&i.auto===!0&&(r=!0),n.triggerSuggest(void 0,r,void 0)}};oW.id="editor.action.triggerSuggest";let R3=oW;gi(wd.ID,wd,2);Pe(R3);const tc=190,na=$s.bindToContribution(wd.get);Ue(new na({id:"acceptSelectedSuggestion",precondition:ve.and(zt.Visible,zt.HasFocusedSuggestion),handler(s){s.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:2,kbExpr:ve.and(zt.Visible,U.textInputFocus),weight:tc},{primary:3,kbExpr:ve.and(zt.Visible,U.textInputFocus,zt.AcceptSuggestionsOnEnter,zt.MakesTextEdit),weight:tc}],menuOpts:[{menuId:Nm,title:w("accept.insert","Insert"),group:"left",order:1,when:zt.HasInsertAndReplaceRange.toNegated()},{menuId:Nm,title:w("accept.insert","Insert"),group:"left",order:1,when:ve.and(zt.HasInsertAndReplaceRange,zt.InsertMode.isEqualTo("insert"))},{menuId:Nm,title:w("accept.replace","Replace"),group:"left",order:1,when:ve.and(zt.HasInsertAndReplaceRange,zt.InsertMode.isEqualTo("replace"))}]}));Ue(new na({id:"acceptAlternativeSelectedSuggestion",precondition:ve.and(zt.Visible,U.textInputFocus,zt.HasFocusedSuggestion),kbOpts:{weight:tc,kbExpr:U.textInputFocus,primary:1027,secondary:[1026]},handler(s){s.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:Nm,group:"left",order:2,when:ve.and(zt.HasInsertAndReplaceRange,zt.InsertMode.isEqualTo("insert")),title:w("accept.replace","Replace")},{menuId:Nm,group:"left",order:2,when:ve.and(zt.HasInsertAndReplaceRange,zt.InsertMode.isEqualTo("replace")),title:w("accept.insert","Insert")}]}));hi.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");Ue(new na({id:"hideSuggestWidget",precondition:zt.Visible,handler:s=>s.cancelSuggestWidget(),kbOpts:{weight:tc,kbExpr:U.textInputFocus,primary:9,secondary:[1033]}}));Ue(new na({id:"selectNextSuggestion",precondition:ve.and(zt.Visible,ve.or(zt.MultipleSuggestions,zt.HasFocusedSuggestion.negate())),handler:s=>s.selectNextSuggestion(),kbOpts:{weight:tc,kbExpr:U.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}}));Ue(new na({id:"selectNextPageSuggestion",precondition:ve.and(zt.Visible,ve.or(zt.MultipleSuggestions,zt.HasFocusedSuggestion.negate())),handler:s=>s.selectNextPageSuggestion(),kbOpts:{weight:tc,kbExpr:U.textInputFocus,primary:12,secondary:[2060]}}));Ue(new na({id:"selectLastSuggestion",precondition:ve.and(zt.Visible,ve.or(zt.MultipleSuggestions,zt.HasFocusedSuggestion.negate())),handler:s=>s.selectLastSuggestion()}));Ue(new na({id:"selectPrevSuggestion",precondition:ve.and(zt.Visible,ve.or(zt.MultipleSuggestions,zt.HasFocusedSuggestion.negate())),handler:s=>s.selectPrevSuggestion(),kbOpts:{weight:tc,kbExpr:U.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}}));Ue(new na({id:"selectPrevPageSuggestion",precondition:ve.and(zt.Visible,ve.or(zt.MultipleSuggestions,zt.HasFocusedSuggestion.negate())),handler:s=>s.selectPrevPageSuggestion(),kbOpts:{weight:tc,kbExpr:U.textInputFocus,primary:11,secondary:[2059]}}));Ue(new na({id:"selectFirstSuggestion",precondition:ve.and(zt.Visible,ve.or(zt.MultipleSuggestions,zt.HasFocusedSuggestion.negate())),handler:s=>s.selectFirstSuggestion()}));Ue(new na({id:"focusSuggestion",precondition:ve.and(zt.Visible,zt.HasFocusedSuggestion.negate()),handler:s=>s.focusSuggestion(),kbOpts:{weight:tc,kbExpr:U.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}}}));Ue(new na({id:"focusAndAcceptSuggestion",precondition:ve.and(zt.Visible,zt.HasFocusedSuggestion.negate()),handler:s=>{s.focusSuggestion(),s.acceptSelectedSuggestion(!0,!1)}}));Ue(new na({id:"toggleSuggestionDetails",precondition:ve.and(zt.Visible,zt.HasFocusedSuggestion),handler:s=>s.toggleSuggestionDetails(),kbOpts:{weight:tc,kbExpr:U.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:Nm,group:"right",order:1,when:ve.and(zt.DetailsVisible,zt.CanResolve),title:w("detail.more","Show Less")},{menuId:Nm,group:"right",order:1,when:ve.and(zt.DetailsVisible.toNegated(),zt.CanResolve),title:w("detail.less","Show More")}]}));Ue(new na({id:"toggleExplainMode",precondition:zt.Visible,handler:s=>s.toggleExplainMode(),kbOpts:{weight:100,primary:2138}}));Ue(new na({id:"toggleSuggestionFocus",precondition:zt.Visible,handler:s=>s.toggleSuggestionFocus(),kbOpts:{weight:tc,kbExpr:U.textInputFocus,primary:2570,mac:{primary:778}}}));Ue(new na({id:"insertBestCompletion",precondition:ve.and(U.textInputFocus,ve.equals("config.editor.tabCompletion","on"),I3.AtEnd,zt.Visible.toNegated(),ax.OtherSuggestions.toNegated(),Jo.InSnippetMode.toNegated()),handler:(s,e)=>{s.triggerSuggestAndAcceptBest(rr(e)?{fallback:"tab",...e}:{fallback:"tab"})},kbOpts:{weight:tc,primary:2}}));Ue(new na({id:"insertNextSuggestion",precondition:ve.and(U.textInputFocus,ve.equals("config.editor.tabCompletion","on"),ax.OtherSuggestions,zt.Visible.toNegated(),Jo.InSnippetMode.toNegated()),handler:s=>s.acceptNextSuggestion(),kbOpts:{weight:tc,kbExpr:U.textInputFocus,primary:2}}));Ue(new na({id:"insertPrevSuggestion",precondition:ve.and(U.textInputFocus,ve.equals("config.editor.tabCompletion","on"),ax.OtherSuggestions,zt.Visible.toNegated(),Jo.InSnippetMode.toNegated()),handler:s=>s.acceptPrevSuggestion(),kbOpts:{weight:tc,kbExpr:U.textInputFocus,primary:1026}}));Pe(class extends Ze{constructor(){super({id:"editor.action.resetSuggestSize",label:w("suggest.reset.label","Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(s,e){var t;(t=wd.get(e))==null||t.resetWidgetSize()}});class aat extends re{get selectedItem(){return this._currentSuggestItemInfo}constructor(e,t,i){super(),this.editor=e,this.suggestControllerPreselector=t,this.onWillAccept=i,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._onDidSelectedItemChange=this._register(new se),this.onDidSelectedItemChange=this._onDidSelectedItemChange.event,this._register(e.onKeyDown(r=>{r.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))})),this._register(e.onKeyUp(r=>{r.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))}));const n=wd.get(this.editor);if(n){this._register(n.registerSelector({priority:100,select:(a,l,d)=>{const h=this.editor.getModel();if(!h)return-1;const f=this.suggestControllerPreselector(),p=f?Vb(f,h):void 0;if(!p)return-1;const m=ie.lift(l),v=d.map((y,x)=>{const D=ME.fromSuggestion(n,h,m,y,this.isShiftKeyPressed),S=Vb(D.toSingleTextEdit(),h),E=BSe(p,S);return{index:x,valid:E,prefixLength:S.text.length,suggestItem:y}}).filter(y=>y&&y.valid&&y.prefixLength>0),b=Vee(v,qo(y=>y.prefixLength,xd));return b?b.index:-1}}));let r=!1;const o=()=>{r||(r=!0,this._register(n.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})),this._register(n.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.update(!1)})),this._register(n.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})))};this._register(We.once(n.model.onDidTrigger)(a=>{o()})),this._register(n.onWillInsertSuggestItem(a=>{const l=this.editor.getPosition(),d=this.editor.getModel();if(!l||!d)return;const h=ME.fromSuggestion(n,d,l,a.item,this.isShiftKeyPressed);this.onWillAccept(h)}))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();(this._isActive!==e||!lat(this._currentSuggestItemInfo,t))&&(this._isActive=e,this._currentSuggestItemInfo=t,this._onDidSelectedItemChange.fire())}getSuggestItemInfo(){const e=wd.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem(),i=this.editor.getPosition(),n=this.editor.getModel();if(!(!t||!i||!n))return ME.fromSuggestion(e,n,i,t.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){const e=wd.get(this.editor);e==null||e.stopForceRenderingAbove()}forceRenderingAbove(){const e=wd.get(this.editor);e==null||e.forceRenderingAbove()}}class ME{static fromSuggestion(e,t,i,n,r){let{insertText:o}=n.completion,a=!1;if(n.completion.insertTextRules&4){const d=new cy().parse(o);d.children.length<100&&E3.adjustWhitespace(t,i,!0,d),o=d.toString(),a=!0}const l=e.getOverwriteInfo(n,r);return new ME(W.fromPositions(i.delta(0,-l.overwriteBefore),i.delta(0,Math.max(l.overwriteAfter,0))),o,n.completion.kind,a)}constructor(e,t,i,n){this.range=e,this.insertText=t,this.completionItemKind=i,this.isSnippetText=n}equals(e){return this.range.equalsRange(e.range)&&this.insertText===e.insertText&&this.completionItemKind===e.completionItemKind&&this.isSnippetText===e.isSnippetText}toSelectedSuggestionInfo(){return new Nve(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}toSingleTextEdit(){return new Zh(this.range,this.insertText)}}function lat(s,e){return s===e?!0:!s||!e?!1:s.equals(e)}var cat=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Of=function(s,e){return function(t,i){e(t,i,s)}},CX,CC;let Vc=(CC=class extends re{static get(e){return e.getContribution(CX.ID)}constructor(e,t,i,n,r,o,a,l,d,h){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=i,this._configurationService=n,this._commandService=r,this._debounceService=o,this._languageFeaturesService=a,this._accessibilitySignalService=l,this._keybindingService=d,this._accessibilityService=h,this._editorObs=el(this.editor),this._positions=lt(this,p=>{var m;return((m=this._editorObs.selections.read(p))==null?void 0:m.map(v=>v.getEndPosition()))??[new ie(1,1)]}),this._suggestWidgetAdaptor=this._register(new aat(this.editor,()=>{var p,m;return this._editorObs.forceUpdate(),(m=(p=this.model.get())==null?void 0:p.selectedInlineCompletion.get())==null?void 0:m.toSingleTextEdit(void 0)},p=>this._editorObs.forceUpdate(m=>{var v;(v=this.model.get())==null||v.handleSuggestAccepted(p)}))),this._suggestWidgetSelectedItem=Bi(this,p=>this._suggestWidgetAdaptor.onDidSelectedItemChange(()=>{this._editorObs.forceUpdate(m=>p(void 0))}),()=>this._suggestWidgetAdaptor.selectedItem),this._enabledInConfig=Bi(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).enabled),this._isScreenReaderEnabled=Bi(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this._editorDictationInProgress=Bi(this,this._contextKeyService.onDidChangeContext,()=>this._contextKeyService.getContext(this.editor.getDomNode()).getValue("editorDictation.inProgress")===!0),this._enabled=lt(this,p=>this._enabledInConfig.read(p)&&(!this._isScreenReaderEnabled.read(p)||!this._editorDictationInProgress.read(p))),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this.model=vo(this,p=>{if(this._editorObs.isReadonly.read(p))return;const m=this._editorObs.model.read(p);return m?this._instantiationService.createInstance(dX,m,this._suggestWidgetSelectedItem,this._editorObs.versionId,this._positions,this._debounceValue,Bi(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(119).preview),Bi(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(119).previewMode),Bi(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).mode),this._enabled):void 0}).recomputeInitiallyAndOnChange(this._store),this._ghostTexts=lt(this,p=>{const m=this.model.read(p);return(m==null?void 0:m.ghostTexts.read(p))??[]}),this._stablizedGhostTexts=dat(this._ghostTexts,this._store),this._ghostTextWidgets=O6e(this,this._stablizedGhostTexts,(p,m)=>m.add(this._instantiationService.createInstance(lX,this.editor,{ghostText:p,minReservedLineCount:Tc(0),targetTextModel:this.model.map(v=>v==null?void 0:v.textModel)}))).recomputeInitiallyAndOnChange(this._store),this._playAccessibilitySignal=Ax(this),this._fontFamily=Bi(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).fontFamily),this._register(new cl(this._contextKeyService,this.model)),this._register(GY(this._editorObs.onDidType,(p,m)=>{var v;this._enabled.get()&&((v=this.model.get())==null||v.trigger())})),this._register(this._commandService.onDidExecuteCommand(p=>{new Set([rS.Tab.id,rS.DeleteLeft.id,rS.DeleteRight.id,K0e,"acceptSelectedSuggestion"]).has(p.commandId)&&e.hasTextFocus()&&this._enabled.get()&&this._editorObs.forceUpdate(v=>{var b;(b=this.model.get())==null||b.trigger(v)})})),this._register(GY(this._editorObs.selections,(p,m)=>{var v;m.some(b=>b.reason===3||b.source==="api")&&((v=this.model.get())==null||v.stop())})),this._register(this.editor.onDidBlurEditorWidget(()=>{this._contextKeyService.getContextKeyValue("accessibleViewIsShown")||this._configurationService.getValue("editor.inlineSuggest.keepOnBlur")||e.getOption(62).keepOnBlur||tx.dropDownVisible||On(p=>{var m;(m=this.model.get())==null||m.stop(p)})})),this._register(Et(p=>{var v;const m=(v=this.model.read(p))==null?void 0:v.state.read(p);m!=null&&m.suggestItem?m.primaryGhostText.lineCount>=2&&this._suggestWidgetAdaptor.forceRenderingAbove():this._suggestWidgetAdaptor.stopForceRenderingAbove()})),this._register(dt(()=>{this._suggestWidgetAdaptor.stopForceRenderingAbove()}));const f=kN(this,(p,m)=>{var y;const v=this.model.read(p),b=v==null?void 0:v.state.read(p);return this._suggestWidgetSelectedItem.get()?m:(y=b==null?void 0:b.inlineCompletion)==null?void 0:y.semanticId});this._register(oQe(lt(p=>(this._playAccessibilitySignal.read(p),f.read(p),{})),async(p,m,v)=>{const b=this.model.get(),y=b==null?void 0:b.state.get();if(!y||!b)return;const x=b.textModel.getLineContent(y.primaryGhostText.lineNumber);await Rg(50,DU(v)),await aye(this._suggestWidgetSelectedItem,wo,()=>!1,DU(v)),await this._accessibilitySignalService.playSignal(Fl.inlineSuggestion),this.editor.getOption(8)&&this._provideScreenReaderUpdate(y.primaryGhostText.renderForScreenReader(x))})),this._register(new DZ(this.editor,this.model,this._instantiationService)),this._register(eot(lt(p=>{const m=this._fontFamily.read(p);return m===""||m==="default"?"":`
|
|
913
|
+
`,n=new eo().appendCodeblock("empty",o),i=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!Dne(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),i){const o=i.length>1e5?`${i.substr(0,1e5)}…`:i;this._type.textContent=o,this._type.title=o,Qa(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(o))}else Sr(this._type),this._type.title="",Bo(this._type),this.domNode.classList.add("no-type");if(Sr(this._docs),typeof n=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=n;else if(n){this._docs.classList.add("markdown-docs"),Sr(this._docs);const o=this._markdownRenderer.render(n);this._docs.appendChild(o.element),this._renderDisposeable.add(o),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=o=>{o.preventDefault(),o.stopPropagation()},this._close.onclick=o=>{o.preventDefault(),o.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 i=new Wi(e,t);Wi.equals(i,this._size)||(this._size=i,b3e(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}};mX=Uot([qot(1,ut)],mX);class Kot{constructor(e,t){this.widget=e,this._editor=t,this.allowEditorOverflow=!0,this._disposables=new me,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new one,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let i,n,r=0,o=0;this._disposables.add(this._resizable.onDidWillResize(()=>{i=this._topLeft,n=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(a=>{if(i&&n){this.widget.layout(a.dimension.width,a.dimension.height);let l=!1;a.west&&(o=n.width-a.dimension.width,l=!0),a.north&&(r=n.height-a.dimension.height,l=!0),l&&this._applyTopLeft({top:i.top+r,left:i.left+o})}a.done&&(i=void 0,n=void 0,r=0,o=0,this._userSize=a.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{this._anchorBox&&this._placeAtAnchor(this._anchorBox,this._userSize??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){const i=e.getBoundingClientRect();this._anchorBox=i,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,this._userSize??this.widget.size,t)}_placeAtAnchor(e,t,i){const n=o_(this.getDomNode().ownerDocument.body),r=this.widget.getLayoutInfo(),o=new Wi(220,2*r.lineHeight),a=e.top,l=function(){const I=n.width-(e.left+e.width+r.borderWidth+r.horizontalPadding),R=-r.borderWidth+e.left+e.width,M=new Wi(I,n.height-e.top-r.borderHeight-r.verticalPadding),O=M.with(void 0,e.top+e.height-r.borderHeight-r.verticalPadding);return{top:a,left:R,fit:I-t.width,maxSizeTop:M,maxSizeBottom:O,minSize:o.with(Math.min(I,o.width))}}(),d=function(){const I=e.left-r.borderWidth-r.horizontalPadding,R=Math.max(r.horizontalPadding,e.left-t.width-r.borderWidth),M=new Wi(I,n.height-e.top-r.borderHeight-r.verticalPadding),O=M.with(void 0,e.top+e.height-r.borderHeight-r.verticalPadding);return{top:a,left:R,fit:I-t.width,maxSizeTop:M,maxSizeBottom:O,minSize:o.with(Math.min(I,o.width))}}(),h=function(){const I=e.left,R=-r.borderWidth+e.top+e.height,M=new Wi(e.width-r.borderHeight,n.height-e.top-e.height-r.verticalPadding);return{top:R,left:I,fit:M.height-t.height,maxSizeBottom:M,maxSizeTop:M,minSize:o.with(M.width)}}(),f=[l,d,h],p=f.find(I=>I.fit>=0)??f.sort((I,R)=>R.fit-I.fit)[0],m=e.top+e.height-r.borderHeight;let v,b=t.height;const y=Math.max(p.maxSizeTop.height,p.maxSizeBottom.height);b>y&&(b=y);let x;i?b<=p.maxSizeTop.height?(v=!0,x=p.maxSizeTop):(v=!1,x=p.maxSizeBottom):b<=p.maxSizeBottom.height?(v=!1,x=p.maxSizeBottom):(v=!0,x=p.maxSizeTop);let{top:D,left:S}=p;!v&&b>e.height&&(D=m-b);const E=this._editor.getDomNode();if(E){const I=E.getBoundingClientRect();D-=I.top,S-=I.left}this._applyTopLeft({left:S,top:D}),this._resizable.enableSashes(!v,p===l,v,p!==l),this._resizable.minSize=p.minSize,this._resizable.maxSize=x,this._resizable.layout(b,Math.min(x.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this._editor.layoutOverlayWidget(this)}}var $h;(function(s){s[s.FILE=0]="FILE",s[s.FOLDER=1]="FOLDER",s[s.ROOT_FOLDER=2]="ROOT_FOLDER"})($h||($h={}));const Got=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function b2(s,e,t,i,n){if(bt.isThemeIcon(n))return[`codicon-${n.id}`,"predefined-file-icon"];if(gt.isUri(n))return[];const r=i===$h.ROOT_FOLDER?["rootfolder-icon"]:i===$h.FOLDER?["folder-icon"]:["file-icon"];if(t){let o;if(t.scheme===Mt.data)o=c_.parseMetaData(t).get(c_.META_DATA_LABEL);else{const a=t.path.match(Got);a?(o=C2(a[2].toLowerCase()),a[1]&&r.push(`${C2(a[1].toLowerCase())}-name-dir-icon`)):o=C2(t.authority.toLowerCase())}if(i===$h.ROOT_FOLDER)r.push(`${o}-root-name-folder-icon`);else if(i===$h.FOLDER)r.push(`${o}-name-folder-icon`);else{if(o){if(r.push(`${o}-name-file-icon`),r.push("name-file-icon"),o.length<=255){const l=o.split(".");for(let d=1;d<l.length;d++)r.push(`${l.slice(d).join(".")}-ext-file-icon`)}r.push("ext-file-icon")}const a=Yot(s,e,t);a&&r.push(`${C2(a)}-lang-file-icon`)}}return r}function Yot(s,e,t){if(!t)return null;let i=null;if(t.scheme===Mt.data){const r=c_.parseMetaData(t).get(c_.META_DATA_MIME);r&&(i=e.getLanguageIdByMimeType(r))}else{const n=s.getModel(t);n&&(i=n.getLanguageId())}return i&&i!==Go?i:e.guessLanguageIdByFilepathOrFirstLine(t)}function C2(s){return s.replace(/[\s]/g,"/")}var Zot=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Cj=function(s,e){return function(t,i){e(t,i,s)}};function WSe(s){return`suggest-aria-id:${s}`}const Xot=mn("suggest-more-info",Oe.chevronRight,w("suggestMoreInfoIcon","Icon for more information in the suggest widget."));var mu;const Qot=new(mu=class{extract(e,t){if(e.textLabel.match(mu._regexStrict))return t[0]=e.textLabel,!0;if(e.completion.detail&&e.completion.detail.match(mu._regexStrict))return t[0]=e.completion.detail,!0;if(e.completion.documentation){const i=typeof e.completion.documentation=="string"?e.completion.documentation:e.completion.documentation.value,n=mu._regexRelaxed.exec(i);if(n&&(n.index===0||n.index+n[0].length===i.length))return t[0]=n[0],!0}return!1}},mu._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*\))/,mu._regexStrict=new RegExp(`^${mu._regexRelaxed.source}$`,"i"),mu);let _X=class{constructor(e,t,i,n){this._editor=e,this._modelService=t,this._languageService=i,this._themeService=n,this._onDidToggleDetails=new se,this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(e){const t=new me,i=e;i.classList.add("show-file-icons");const n=Ee(e,Fe(".icon")),r=Ee(n,Fe("span.colorspan")),o=Ee(e,Fe(".contents")),a=Ee(o,Fe(".main")),l=Ee(a,Fe(".icon-label.codicon")),d=Ee(a,Fe("span.left")),h=Ee(a,Fe("span.right")),f=new y5(d,{supportHighlights:!0,supportIcons:!0});t.add(f);const p=Ee(d,Fe("span.signature-label")),m=Ee(d,Fe("span.qualifier-label")),v=Ee(h,Fe("span.details-label")),b=Ee(h,Fe("span.readMore"+bt.asCSSSelector(Xot)));return b.title=w("readMore","Read More"),{root:i,left:d,right:h,icon:n,colorspan:r,iconLabel:f,iconContainer:l,parametersLabel:p,qualifierLabel:m,detailsLabel:v,readMore:b,disposables:t,configureFont:()=>{const x=this._editor.getOptions(),D=x.get(50),S=D.getMassagedFontFamily(),E=D.fontFeatureSettings,I=x.get(120)||D.fontSize,R=x.get(121)||D.lineHeight,M=D.fontWeight,O=D.letterSpacing,H=`${I}px`,te=`${R}px`,J=`${O}px`;i.style.fontSize=H,i.style.fontWeight=M,i.style.letterSpacing=J,a.style.fontFamily=S,a.style.fontFeatureSettings=E,a.style.lineHeight=te,n.style.height=te,n.style.width=te,b.style.height=te,b.style.width=te}}}renderElement(e,t,i){i.configureFont();const{completion:n}=e;i.root.id=WSe(t),i.colorspan.style.backgroundColor="";const r={labelEscapeNewLines:!0,matches:vN(e.score)},o=[];if(n.kind===19&&Qot.extract(e,o))i.icon.className="icon customcolor",i.iconContainer.className="icon hide",i.colorspan.style.backgroundColor=o[0];else if(n.kind===20&&this._themeService.getFileIconTheme().hasFileIcons){i.icon.className="icon hide",i.iconContainer.className="icon hide";const a=b2(this._modelService,this._languageService,gt.from({scheme:"fake",path:e.textLabel}),$h.FILE),l=b2(this._modelService,this._languageService,gt.from({scheme:"fake",path:n.detail}),$h.FILE);r.extraClasses=a.length>l.length?a:l}else n.kind===23&&this._themeService.getFileIconTheme().hasFolderIcons?(i.icon.className="icon hide",i.iconContainer.className="icon hide",r.extraClasses=[b2(this._modelService,this._languageService,gt.from({scheme:"fake",path:e.textLabel}),$h.FOLDER),b2(this._modelService,this._languageService,gt.from({scheme:"fake",path:n.detail}),$h.FOLDER)].flat()):(i.icon.className="icon hide",i.iconContainer.className="",i.iconContainer.classList.add("suggest-icon",...bt.asClassNameArray(vI.toIcon(n.kind))));n.tags&&n.tags.indexOf(1)>=0&&(r.extraClasses=(r.extraClasses||[]).concat(["deprecated"]),r.matches=[]),i.iconLabel.setLabel(e.textLabel,void 0,r),typeof n.label=="string"?(i.parametersLabel.textContent="",i.detailsLabel.textContent=yj(n.detail||""),i.root.classList.add("string-label")):(i.parametersLabel.textContent=yj(n.label.detail||""),i.detailsLabel.textContent=yj(n.label.description||""),i.root.classList.remove("string-label")),this._editor.getOption(119).showInlineDetails?Qa(i.detailsLabel):Bo(i.detailsLabel),Dne(e)?(i.right.classList.add("can-expand-details"),Qa(i.readMore),i.readMore.onmousedown=a=>{a.stopPropagation(),a.preventDefault()},i.readMore.onclick=a=>{a.stopPropagation(),a.preventDefault(),this._onDidToggleDetails.fire()}):(i.right.classList.remove("can-expand-details"),Bo(i.readMore),i.readMore.onmousedown=null,i.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};_X=Zot([Cj(1,pn),Cj(2,Nn),Cj(3,zs)],_X);function yj(s){return s.replace(/\r\n|\r|\n/g,"")}var Jot=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},y2=function(s,e){return function(t,i){e(t,i,s)}},K1;q("editorSuggestWidget.background",Ul,w("editorSuggestWidgetBackground","Background color of the suggest widget."));q("editorSuggestWidget.border",Xee,w("editorSuggestWidgetBorder","Border color of the suggest widget."));const eat=q("editorSuggestWidget.foreground",cf,w("editorSuggestWidgetForeground","Foreground color of the suggest widget."));q("editorSuggestWidget.selectedForeground",AI,w("editorSuggestWidgetSelectedForeground","Foreground color of the selected entry in the suggest widget."));q("editorSuggestWidget.selectedIconForeground",ste,w("editorSuggestWidgetSelectedIconForeground","Icon foreground color of the selected entry in the suggest widget."));const tat=q("editorSuggestWidget.selectedBackground",FI,w("editorSuggestWidgetSelectedBackground","Background color of the selected entry in the suggest widget."));q("editorSuggestWidget.highlightForeground",n0,w("editorSuggestWidgetHighlightForeground","Color of the match highlights in the suggest widget."));q("editorSuggestWidget.focusHighlightForeground",I7e,w("editorSuggestWidgetFocusHighlightForeground","Color of the match highlights in the suggest widget when an item is focused."));q("editorSuggestWidgetStatus.foreground",Ut(eat,.5),w("editorSuggestWidgetStatusForeground","Foreground color of the suggest widget status."));class iat{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof Pd}`}restore(){const e=this._service.get(this._key,0)??"";try{const t=JSON.parse(e);if(Wi.is(t))return Wi.lift(t)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}var $m;let vX=($m=class{constructor(e,t,i,n,r){this.editor=e,this._storageService=t,this._state=0,this._isAuto=!1,this._pendingLayout=new Js,this._pendingShowDetails=new Js,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new Ad,this._disposables=new me,this._onDidSelect=new UC,this._onDidFocus=new UC,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 one,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new nat(this,e),this._persistedSize=new iat(t,e);class o{constructor(m,v,b=!1,y=!1){this.persistedSize=m,this.currentSize=v,this.persistHeight=b,this.persistWidth=y}}let a;this._disposables.add(this.element.onDidWillResize(()=>{this._contentWidget.lockPreference(),a=new o(this._persistedSize.restore(),this.element.size)})),this._disposables.add(this.element.onDidResize(p=>{var m,v;if(this._resize(p.dimension.width,p.dimension.height),a&&(a.persistHeight=a.persistHeight||!!p.north||!!p.south,a.persistWidth=a.persistWidth||!!p.east||!!p.west),!!p.done){if(a){const{itemHeight:b,defaultSize:y}=this.getLayoutInfo(),x=Math.round(b/2);let{width:D,height:S}=this.element.size;(!a.persistHeight||Math.abs(a.currentSize.height-S)<=x)&&(S=((m=a.persistedSize)==null?void 0:m.height)??y.height),(!a.persistWidth||Math.abs(a.currentSize.width-D)<=x)&&(D=((v=a.persistedSize)==null?void 0:v.width)??y.width),this._persistedSize.store(new Wi(D,S))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=Ee(this.element.domNode,Fe(".message")),this._listElement=Ee(this.element.domNode,Fe(".tree"));const l=this._disposables.add(r.createInstance(mX,this.editor));l.onDidClose(this.toggleDetails,this,this._disposables),this._details=new Kot(l,this.editor);const d=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(119).showIcons);d();const h=r.createInstance(_X,this.editor);this._disposables.add(h),this._disposables.add(h.onDidToggleDetails(()=>this.toggleDetails())),this._list=new oc("SuggestWidget",this._listElement,{getHeight:p=>this.getLayoutInfo().itemHeight,getTemplateId:p=>"suggestion"},[h],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>"option",getWidgetAriaLabel:()=>w("suggest","Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:p=>{let m=p.textLabel;if(typeof p.completion.label!="string"){const{detail:x,description:D}=p.completion.label;x&&D?m=w("label.full","{0} {1}, {2}",m,x,D):x?m=w("label.detail","{0} {1}",m,x):D&&(m=w("label.desc","{0}, {1}",m,D))}if(!p.isResolved||!this._isDetailsVisible())return m;const{documentation:v,detail:b}=p.completion,y=qC("{0}{1}",b||"",v?typeof v=="string"?v:v.value:"");return w("ariaCurrenttSuggestionReadDetails","{0}, docs: {1}",m,y)}}}),this._list.style(Py({listInactiveFocusBackground:tat,listInactiveFocusOutline:yn})),this._status=r.createInstance(pX,this.element.domNode,Nm);const f=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(119).showStatusBar);f(),this._disposables.add(n.onDidColorThemeChange(p=>this._onThemeChange(p))),this._onThemeChange(n.getColorTheme()),this._disposables.add(this._list.onMouseDown(p=>this._onListMouseDownOrTap(p))),this._disposables.add(this._list.onTap(p=>this._onListMouseDownOrTap(p))),this._disposables.add(this._list.onDidChangeSelection(p=>this._onListSelection(p))),this._disposables.add(this._list.onDidChangeFocus(p=>this._onListFocus(p))),this._disposables.add(this.editor.onDidChangeCursorSelection(()=>this._onCursorSelectionChanged())),this._disposables.add(this.editor.onDidChangeConfiguration(p=>{p.hasChanged(119)&&(f(),d()),this._completionModel&&(p.hasChanged(50)||p.hasChanged(120)||p.hasChanged(121))&&this._list.splice(0,this._list.length,this._completionModel.items)})),this._ctxSuggestWidgetVisible=jt.Visible.bindTo(i),this._ctxSuggestWidgetDetailsVisible=jt.DetailsVisible.bindTo(i),this._ctxSuggestWidgetMultipleSuggestions=jt.MultipleSuggestions.bindTo(i),this._ctxSuggestWidgetHasFocusedSuggestion=jt.HasFocusedSuggestion.bindTo(i),this._disposables.add(Hn(this._details.widget.domNode,"keydown",p=>{this._onDetailsKeydown.fire(p)})),this._disposables.add(this.editor.onMouseDown(p=>this._onEditorMouseDown(p)))}dispose(){var e;this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),(e=this._loadingTimeout)==null||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 i=this._completionModel;i&&(this._onDidSelect.fire({item:e,index:t,model:i}),this.editor.focus())}_onThemeChange(e){this._details.widget.borderWidth=Eu(e.type)?2:1}_onListFocus(e){var n;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 t=e.elements[0],i=e.indexes[0];t!==this._focusedItem&&((n=this._currentSuggestionDetails)==null||n.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=t,this._list.reveal(i),this._currentSuggestionDetails=Zs(async r=>{const o=r_(()=>{this._isDetailsVisible()&&this.showDetails(!0)},250),a=r.onCancellationRequested(()=>o.dispose());try{return await t.resolve(r)}finally{o.dispose(),a.dispose()}}),this._currentSuggestionDetails.then(()=>{i>=this._list.length||t!==this._list.element(i)||(this._ignoreFocusEvents=!0,this._list.splice(i,1,[t]),this._list.setFocus([i]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this.showDetails(!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:WSe(i)}))}).catch(Tt)),this._onDidFocus.fire({item:t,index:i,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:Bo(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=K1.LOADING_MESSAGE,Bo(this._listElement,this._status.element),Qa(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Jh(K1.LOADING_MESSAGE);break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=K1.NO_SUGGESTIONS_MESSAGE,Bo(this._listElement,this._status.element),Qa(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Jh(K1.NO_SUGGESTIONS_MESSAGE);break;case 3:Bo(this._messageElement),Qa(this._listElement,this._status.element),this._show();break;case 4:Bo(this._messageElement),Qa(this._listElement,this._status.element),this._show();break;case 5:Bo(this._messageElement),Qa(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=r_(()=>this._setState(1),t)))}showSuggestions(e,t,i,n,r){var l,d;if(this._contentWidget.setPosition(this.editor.getPosition()),(l=this._loadingTimeout)==null||l.dispose(),(d=this._currentSuggestionDetails)==null||d.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),i&&this._state!==2&&this._state!==0){this._setState(4);return}const o=this._completionModel.items.length,a=o===0;if(this._ctxSuggestWidgetMultipleSuggestions.set(o>1),a){this._setState(n?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(i?4:3),this._list.reveal(t,0),this._list.setFocus(r?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=v4(mt(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")):(Dne(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=v4(mt(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 i;this._pendingLayout.clear(),this._pendingShowDetails.clear(),(i=this._loadingTimeout)==null||i.dispose(),this._setState(0),this._onDidHide.fire(this),this.element.clearSashHoverState();const e=this._persistedSize.restore(),t=Math.ceil(this.getLayoutInfo().itemHeight*4.3);e&&e.height<t&&this._persistedSize.store(e.with(void 0,t))}isFrozen(){return this._state===4}_afterRender(e){if(e===null){this._isDetailsVisible()&&this._details.hide();return}this._state===2||this._state===1||(this._isDetailsVisible()&&!this._details.widget.isEmpty&&this._details.show(),this._positionDetails())}_layout(e){var o,a;if(!this.editor.hasModel()||!this.editor.getDomNode())return;const t=o_(this.element.domNode.ownerDocument.body),i=this.getLayoutInfo();e||(e=i.defaultSize);let n=e.height,r=e.width;if(this._status.element.style.height=`${i.itemHeight}px`,this._state===2||this._state===1)n=i.itemHeight+i.borderHeight,r=i.defaultSize.width/2,this.element.enableSashes(!1,!1,!1,!1),this.element.minSize=this.element.maxSize=new Wi(r,n),this._contentWidget.setPreference(2);else{const l=t.width-i.borderHeight-2*i.horizontalPadding;r>l&&(r=l);const d=this._completionModel?this._completionModel.stats.pLabelLen*i.typicalHalfwidthCharacterWidth:r,h=i.statusBarHeight+this._list.contentHeight+i.borderHeight,f=i.itemHeight+i.statusBarHeight,p=ts(this.editor.getDomNode()),m=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),v=p.top+m.top+m.height,b=Math.min(t.height-v-i.verticalPadding,h),y=p.top+m.top-i.verticalPadding,x=Math.min(y,h);let D=Math.min(Math.max(x,b)+i.borderHeight,h);n===((o=this._cappedHeight)==null?void 0:o.capped)&&(n=this._cappedHeight.wanted),n<f&&(n=f),n>D&&(n=D),n>b||this._forceRenderingAbove&&y>150?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),D=x):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),D=b),this.element.preferredSize=new Wi(d,i.defaultSize.height),this.element.maxSize=new Wi(l,D),this.element.minSize=new Wi(220,f),this._cappedHeight=n===h?{wanted:((a=this._cappedHeight)==null?void 0:a.wanted)??e.height,capped:n}:void 0}this._resize(r,n)}_resize(e,t){const{width:i,height:n}=this.element.maxSize;e=Math.min(i,e),t=Math.min(n,t);const{statusBarHeight:r}=this.getLayoutInfo();this._list.layout(t-r,e),this._listElement.style.height=`${t-r}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?void 0:e.preference[0])===2)}getLayoutInfo(){const e=this.editor.getOption(50),t=Fo(this.editor.getOption(121)||e.lineHeight,8,1e3),i=!this.editor.getOption(119).showStatusBar||this._state===2||this._state===1?0:t,n=this._details.widget.borderWidth,r=2*n;return{itemHeight:t,statusBarHeight:i,borderWidth:n,borderHeight:r,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new Wi(430,i+12*t+r)}}_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}},K1=$m,$m.LOADING_MESSAGE=w("suggestWidget.loading","Loading..."),$m.NO_SUGGESTIONS_MESSAGE=w("suggestWidget.noSuggestions","No suggestions."),$m);vX=K1=Jot([y2(1,Bd),y2(2,yt),y2(3,zs),y2(4,ut)],vX);class nat{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:i,horizontalPadding:n}=this._widget.getLayoutInfo();return new Wi(t+2*i+n,e+2*i)}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 sat=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},O1=function(s,e){return function(t,i){e(t,i,s)}},bX;class rat{constructor(e,t){if(this._model=e,this._position=t,this._decorationOptions=Ot.register({description:"suggest-line-suffix",stickiness:1}),e.getLineMaxColumn(t.lineNumber)!==t.column){const n=e.getOffsetAt(t),r=e.getPositionAt(n+1);e.changeDecorations(o=>{this._marker&&o.removeDecoration(this._marker),this._marker=o.addDecoration(W.fromPositions(t,r),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}}var bC;let wd=(bC=class{static get(e){return e.getContribution(bX.ID)}constructor(e,t,i,n,r,o,a){this._memoryService=t,this._commandService=i,this._contextKeyService=n,this._instantiationService=r,this._logService=o,this._telemetryService=a,this._lineSuffix=new Js,this._toDispose=new me,this._selectors=new oat(f=>f.priority),this._onWillInsertSuggestItem=new se,this.onWillInsertSuggestItem=this._onWillInsertSuggestItem.event,this.editor=e,this.model=r.createInstance(M3,this.editor),this._selectors.register({priority:0,select:(f,p,m)=>this._memoryService.select(f,p,m)});const l=jt.InsertMode.bindTo(n);l.set(e.getOption(119).insertMode),this._toDispose.add(this.model.onDidTrigger(()=>l.set(e.getOption(119).insertMode))),this.widget=this._toDispose.add(new B$(mt(e.getDomNode()),()=>{const f=this._instantiationService.createInstance(vX,this.editor);this._toDispose.add(f),this._toDispose.add(f.onDidSelect(y=>this._insertSuggestion(y,0),this));const p=new Hot(this.editor,f,this.model,y=>this._insertSuggestion(y,2));this._toDispose.add(p);const m=jt.MakesTextEdit.bindTo(this._contextKeyService),v=jt.HasInsertAndReplaceRange.bindTo(this._contextKeyService),b=jt.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(dt(()=>{m.reset(),v.reset(),b.reset()})),this._toDispose.add(f.onDidFocus(({item:y})=>{const x=this.editor.getPosition(),D=y.editStart.column,S=x.column;let E=!0;this.editor.getOption(1)==="smart"&&this.model.state===2&&!y.completion.additionalTextEdits&&!(y.completion.insertTextRules&4)&&S-D===y.completion.insertText.length&&(E=this.editor.getModel().getValueInRange({startLineNumber:x.lineNumber,startColumn:D,endLineNumber:x.lineNumber,endColumn:S})!==y.completion.insertText),m.set(E),v.set(!ie.equals(y.editInsertEnd,y.editReplaceEnd)),b.set(!!y.provider.resolveCompletionItem||!!y.completion.documentation||y.completion.detail!==y.completion.label)})),this._toDispose.add(f.onDetailsKeyDown(y=>{if(y.toKeyCodeChord().equals(new Mg(!0,!1,!1,!1,33))||ti&&y.toKeyCodeChord().equals(new Mg(!1,!1,!1,!0,33))){y.stopPropagation();return}y.toKeyCodeChord().isModifierKey()||this.editor.focus()})),f})),this._overtypingCapturer=this._toDispose.add(new B$(mt(e.getDomNode()),()=>this._toDispose.add(new gX(this.editor,this.model)))),this._alternatives=this._toDispose.add(new B$(mt(e.getDomNode()),()=>this._toDispose.add(new ax(this.editor,this._contextKeyService)))),this._toDispose.add(r.createInstance(I3,e)),this._toDispose.add(this.model.onDidTrigger(f=>{this.widget.value.showTriggered(f.auto,f.shy?250:50),this._lineSuffix.value=new rat(this.editor.getModel(),f.position)})),this._toDispose.add(this.model.onDidSuggest(f=>{if(f.triggerOptions.shy)return;let p=-1;for(const v of this._selectors.itemsOrderedByPriorityDesc)if(p=v.select(this.editor.getModel(),this.editor.getPosition(),f.completionModel.items),p!==-1)break;if(p===-1&&(p=0),this.model.state===0)return;let m=!1;if(f.triggerOptions.auto){const v=this.editor.getOption(119);v.selectionMode==="never"||v.selectionMode==="always"?m=v.selectionMode==="never":v.selectionMode==="whenTriggerCharacter"?m=f.triggerOptions.triggerKind!==1:v.selectionMode==="whenQuickSuggestion"&&(m=f.triggerOptions.triggerKind===1&&!f.triggerOptions.refilter)}this.widget.value.showSuggestions(f.completionModel,p,f.isFrozen,f.triggerOptions.auto,m)})),this._toDispose.add(this.model.onDidCancel(f=>{f.retrigger||this.widget.value.hideWidget()})),this._toDispose.add(this.editor.onDidBlurEditorWidget(()=>{this.model.cancel(),this.model.clear()}));const d=jt.AcceptSuggestionsOnEnter.bindTo(n),h=()=>{const f=this.editor.getOption(1);d.set(f==="on"||f==="smart")};this._toDispose.add(this.editor.onDidChangeConfiguration(()=>h())),h()}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 i=Jo.get(this.editor);if(!i)return;this._onWillInsertSuggestItem.fire({item:e.item});const n=this.editor.getModel(),r=n.getAlternativeVersionId(),{item:o}=e,a=[],l=new An;t&1||this.editor.pushUndoStop();const d=this.getOverwriteInfo(o,!!(t&8));this._memoryService.memorize(n,this.editor.getPosition(),o);const h=o.isResolved;let f=-1,p=-1;if(Array.isArray(o.completion.additionalTextEdits)){this.model.cancel();const v=Wu.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",o.completion.additionalTextEdits.map(b=>{let y=W.lift(b.range);if(y.startLineNumber===o.position.lineNumber&&y.startColumn>o.position.column){const x=this.editor.getPosition().column-o.position.column,D=x,S=W.spansMultipleLines(y)?0:x;y=new W(y.startLineNumber,y.startColumn+D,y.endLineNumber,y.endColumn+S)}return Pn.replaceMove(y,b.text)})),v.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!h){const v=new cr;let b;const y=n.onDidChangeContent(E=>{if(E.isFlush){l.cancel(),y.dispose();return}for(const I of E.changes){const R=W.getEndPosition(I.range);(!b||ie.isBefore(R,b))&&(b=R)}}),x=t;t|=2;let D=!1;const S=this.editor.onWillType(()=>{S.dispose(),D=!0,x&2||this.editor.pushUndoStop()});a.push(o.resolve(l.token).then(()=>{if(!o.completion.additionalTextEdits||l.token.isCancellationRequested)return;if(b&&o.completion.additionalTextEdits.some(I=>ie.isBefore(b,W.getStartPosition(I.range))))return!1;D&&this.editor.pushUndoStop();const E=Wu.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",o.completion.additionalTextEdits.map(I=>Pn.replaceMove(W.lift(I.range),I.text))),E.restoreRelativeVerticalPositionOfCursor(this.editor),(D||!(x&2))&&this.editor.pushUndoStop(),!0}).then(E=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",v.elapsed(),E),p=E===!0?1:E===!1?0:-2}).finally(()=>{y.dispose(),S.dispose()}))}let{insertText:m}=o.completion;if(o.completion.insertTextRules&4||(m=cy.escape(m)),this.model.cancel(),i.insert(m,{overwriteBefore:d.overwriteBefore,overwriteAfter:d.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(o.completion.insertTextRules&1),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),t&2||this.editor.pushUndoStop(),o.completion.command)if(o.completion.command.id===R3.id)this.model.trigger({auto:!0,retrigger:!0});else{const v=new cr;a.push(this._commandService.executeCommand(o.completion.command.id,...o.completion.command.arguments?[...o.completion.command.arguments]:[]).catch(b=>{o.completion.extensionId?is(b):Tt(b)}).finally(()=>{f=v.elapsed()}))}t&4&&this._alternatives.value.set(e,v=>{for(l.cancel();n.canUndo();){r!==n.getAlternativeVersionId()&&n.undo(),this._insertSuggestion(v,3|(t&8?8:0));break}}),this._alertCompletionItem(o),Promise.all(a).finally(()=>{this._reportSuggestionAcceptedTelemetry(o,n,h,f,p,e.index,e.model.items),this.model.clear(),l.dispose()})}_reportSuggestionAcceptedTelemetry(e,t,i,n,r,o,a){var p;if(Math.floor(Math.random()*100)===0)return;const l=new Map;for(let m=0;m<Math.min(30,a.length);m++){const v=a[m].textLabel;l.has(v)?l.get(v).push(m):l.set(v,[m])}const d=l.get(e.textLabel),f=d&&d.length>1?d[0]:-1;this._telemetryService.publicLog2("suggest.acceptedSuggestion",{extensionId:((p=e.extensionId)==null?void 0:p.value)??"unknown",providerId:e.provider._debugDisplayName??"unknown",kind:e.completion.kind,basenameHash:mH(Wc(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:V9e(t.uri),resolveInfo:e.provider.resolveCompletionItem?i?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:n,additionalEditsAsync:r,index:o,firstIndex:f})}getOverwriteInfo(e,t){Ci(this.editor.hasModel());let i=this.editor.getOption(119).insertMode==="replace";t&&(i=!i);const n=e.position.column-e.editStart.column,r=(i?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column,o=this.editor.getPosition().column-e.position.column,a=this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0;return{overwriteBefore:n+o,overwriteAfter:r+a}}_alertCompletionItem(e){if(So(e.completion.additionalTextEdits)){const t=w("aria.alert.snippet","Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);Qo(t)}}triggerSuggest(e,t,i){this.editor.hasModel()&&(this.model.trigger({auto:t??!1,completionOptions:{providerFilter:e,kindFilter:i?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(),i=()=>{t.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},n=r=>{if(r.completion.insertTextRules&4||r.completion.additionalTextEdits)return!0;const o=this.editor.getPosition(),a=r.editStart.column,l=o.column;return l-a!==r.completion.insertText.length?!0:this.editor.getModel().getValueInRange({startLineNumber:o.lineNumber,startColumn:a,endLineNumber:o.lineNumber,endColumn:l})!==r.completion.insertText};We.once(this.model.onDidTrigger)(r=>{const o=[];We.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{Xi(o),i()},void 0,o),this.model.onDidSuggest(({completionModel:a})=>{if(Xi(o),a.items.length===0){i();return}const l=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),a.items),d=a.items[l];if(!n(d)){i();return}this.editor.pushUndoStop(),this._insertSuggestion({index:l,item:d,model:a},7)},void 0,o)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,0),this.editor.focus()}acceptSelectedSuggestion(e,t){const i=this.widget.value.getFocusedItem();let n=0;e&&(n|=4),t&&(n|=8),this._insertSuggestion(i,n)}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)}},bX=bC,bC.ID="editor.contrib.suggestController",bC);wd=bX=sat([O1(1,HV),O1(2,on),O1(3,yt),O1(4,ut),O1(5,qr),O1(6,so)],wd);class oat{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,i)=>this.prioritySelector(i)-this.prioritySelector(t)),{dispose:()=>{const t=this._items.indexOf(e);t>=0&&this._items.splice(t,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}const oW=class oW extends Ze{constructor(){super({id:oW.id,label:w("suggest.trigger.label","Trigger Suggest"),alias:"Trigger Suggest",precondition:ve.and(U.writable,U.hasCompletionItemProvider,jt.Visible.toNegated()),kbOpts:{kbExpr:U.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t,i){const n=wd.get(t);if(!n)return;let r;i&&typeof i=="object"&&i.auto===!0&&(r=!0),n.triggerSuggest(void 0,r,void 0)}};oW.id="editor.action.triggerSuggest";let R3=oW;gi(wd.ID,wd,2);Pe(R3);const tc=190,na=$s.bindToContribution(wd.get);Ue(new na({id:"acceptSelectedSuggestion",precondition:ve.and(jt.Visible,jt.HasFocusedSuggestion),handler(s){s.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:2,kbExpr:ve.and(jt.Visible,U.textInputFocus),weight:tc},{primary:3,kbExpr:ve.and(jt.Visible,U.textInputFocus,jt.AcceptSuggestionsOnEnter,jt.MakesTextEdit),weight:tc}],menuOpts:[{menuId:Nm,title:w("accept.insert","Insert"),group:"left",order:1,when:jt.HasInsertAndReplaceRange.toNegated()},{menuId:Nm,title:w("accept.insert","Insert"),group:"left",order:1,when:ve.and(jt.HasInsertAndReplaceRange,jt.InsertMode.isEqualTo("insert"))},{menuId:Nm,title:w("accept.replace","Replace"),group:"left",order:1,when:ve.and(jt.HasInsertAndReplaceRange,jt.InsertMode.isEqualTo("replace"))}]}));Ue(new na({id:"acceptAlternativeSelectedSuggestion",precondition:ve.and(jt.Visible,U.textInputFocus,jt.HasFocusedSuggestion),kbOpts:{weight:tc,kbExpr:U.textInputFocus,primary:1027,secondary:[1026]},handler(s){s.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:Nm,group:"left",order:2,when:ve.and(jt.HasInsertAndReplaceRange,jt.InsertMode.isEqualTo("insert")),title:w("accept.replace","Replace")},{menuId:Nm,group:"left",order:2,when:ve.and(jt.HasInsertAndReplaceRange,jt.InsertMode.isEqualTo("replace")),title:w("accept.insert","Insert")}]}));hi.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");Ue(new na({id:"hideSuggestWidget",precondition:jt.Visible,handler:s=>s.cancelSuggestWidget(),kbOpts:{weight:tc,kbExpr:U.textInputFocus,primary:9,secondary:[1033]}}));Ue(new na({id:"selectNextSuggestion",precondition:ve.and(jt.Visible,ve.or(jt.MultipleSuggestions,jt.HasFocusedSuggestion.negate())),handler:s=>s.selectNextSuggestion(),kbOpts:{weight:tc,kbExpr:U.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}}));Ue(new na({id:"selectNextPageSuggestion",precondition:ve.and(jt.Visible,ve.or(jt.MultipleSuggestions,jt.HasFocusedSuggestion.negate())),handler:s=>s.selectNextPageSuggestion(),kbOpts:{weight:tc,kbExpr:U.textInputFocus,primary:12,secondary:[2060]}}));Ue(new na({id:"selectLastSuggestion",precondition:ve.and(jt.Visible,ve.or(jt.MultipleSuggestions,jt.HasFocusedSuggestion.negate())),handler:s=>s.selectLastSuggestion()}));Ue(new na({id:"selectPrevSuggestion",precondition:ve.and(jt.Visible,ve.or(jt.MultipleSuggestions,jt.HasFocusedSuggestion.negate())),handler:s=>s.selectPrevSuggestion(),kbOpts:{weight:tc,kbExpr:U.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}}));Ue(new na({id:"selectPrevPageSuggestion",precondition:ve.and(jt.Visible,ve.or(jt.MultipleSuggestions,jt.HasFocusedSuggestion.negate())),handler:s=>s.selectPrevPageSuggestion(),kbOpts:{weight:tc,kbExpr:U.textInputFocus,primary:11,secondary:[2059]}}));Ue(new na({id:"selectFirstSuggestion",precondition:ve.and(jt.Visible,ve.or(jt.MultipleSuggestions,jt.HasFocusedSuggestion.negate())),handler:s=>s.selectFirstSuggestion()}));Ue(new na({id:"focusSuggestion",precondition:ve.and(jt.Visible,jt.HasFocusedSuggestion.negate()),handler:s=>s.focusSuggestion(),kbOpts:{weight:tc,kbExpr:U.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}}}));Ue(new na({id:"focusAndAcceptSuggestion",precondition:ve.and(jt.Visible,jt.HasFocusedSuggestion.negate()),handler:s=>{s.focusSuggestion(),s.acceptSelectedSuggestion(!0,!1)}}));Ue(new na({id:"toggleSuggestionDetails",precondition:ve.and(jt.Visible,jt.HasFocusedSuggestion),handler:s=>s.toggleSuggestionDetails(),kbOpts:{weight:tc,kbExpr:U.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:Nm,group:"right",order:1,when:ve.and(jt.DetailsVisible,jt.CanResolve),title:w("detail.more","Show Less")},{menuId:Nm,group:"right",order:1,when:ve.and(jt.DetailsVisible.toNegated(),jt.CanResolve),title:w("detail.less","Show More")}]}));Ue(new na({id:"toggleExplainMode",precondition:jt.Visible,handler:s=>s.toggleExplainMode(),kbOpts:{weight:100,primary:2138}}));Ue(new na({id:"toggleSuggestionFocus",precondition:jt.Visible,handler:s=>s.toggleSuggestionFocus(),kbOpts:{weight:tc,kbExpr:U.textInputFocus,primary:2570,mac:{primary:778}}}));Ue(new na({id:"insertBestCompletion",precondition:ve.and(U.textInputFocus,ve.equals("config.editor.tabCompletion","on"),I3.AtEnd,jt.Visible.toNegated(),ax.OtherSuggestions.toNegated(),Jo.InSnippetMode.toNegated()),handler:(s,e)=>{s.triggerSuggestAndAcceptBest(rr(e)?{fallback:"tab",...e}:{fallback:"tab"})},kbOpts:{weight:tc,primary:2}}));Ue(new na({id:"insertNextSuggestion",precondition:ve.and(U.textInputFocus,ve.equals("config.editor.tabCompletion","on"),ax.OtherSuggestions,jt.Visible.toNegated(),Jo.InSnippetMode.toNegated()),handler:s=>s.acceptNextSuggestion(),kbOpts:{weight:tc,kbExpr:U.textInputFocus,primary:2}}));Ue(new na({id:"insertPrevSuggestion",precondition:ve.and(U.textInputFocus,ve.equals("config.editor.tabCompletion","on"),ax.OtherSuggestions,jt.Visible.toNegated(),Jo.InSnippetMode.toNegated()),handler:s=>s.acceptPrevSuggestion(),kbOpts:{weight:tc,kbExpr:U.textInputFocus,primary:1026}}));Pe(class extends Ze{constructor(){super({id:"editor.action.resetSuggestSize",label:w("suggest.reset.label","Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(s,e){var t;(t=wd.get(e))==null||t.resetWidgetSize()}});class aat extends re{get selectedItem(){return this._currentSuggestItemInfo}constructor(e,t,i){super(),this.editor=e,this.suggestControllerPreselector=t,this.onWillAccept=i,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._onDidSelectedItemChange=this._register(new se),this.onDidSelectedItemChange=this._onDidSelectedItemChange.event,this._register(e.onKeyDown(r=>{r.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))})),this._register(e.onKeyUp(r=>{r.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))}));const n=wd.get(this.editor);if(n){this._register(n.registerSelector({priority:100,select:(a,l,d)=>{const h=this.editor.getModel();if(!h)return-1;const f=this.suggestControllerPreselector(),p=f?Vb(f,h):void 0;if(!p)return-1;const m=ie.lift(l),v=d.map((y,x)=>{const D=ME.fromSuggestion(n,h,m,y,this.isShiftKeyPressed),S=Vb(D.toSingleTextEdit(),h),E=BSe(p,S);return{index:x,valid:E,prefixLength:S.text.length,suggestItem:y}}).filter(y=>y&&y.valid&&y.prefixLength>0),b=Vee(v,qo(y=>y.prefixLength,xd));return b?b.index:-1}}));let r=!1;const o=()=>{r||(r=!0,this._register(n.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})),this._register(n.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.update(!1)})),this._register(n.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})))};this._register(We.once(n.model.onDidTrigger)(a=>{o()})),this._register(n.onWillInsertSuggestItem(a=>{const l=this.editor.getPosition(),d=this.editor.getModel();if(!l||!d)return;const h=ME.fromSuggestion(n,d,l,a.item,this.isShiftKeyPressed);this.onWillAccept(h)}))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();(this._isActive!==e||!lat(this._currentSuggestItemInfo,t))&&(this._isActive=e,this._currentSuggestItemInfo=t,this._onDidSelectedItemChange.fire())}getSuggestItemInfo(){const e=wd.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem(),i=this.editor.getPosition(),n=this.editor.getModel();if(!(!t||!i||!n))return ME.fromSuggestion(e,n,i,t.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){const e=wd.get(this.editor);e==null||e.stopForceRenderingAbove()}forceRenderingAbove(){const e=wd.get(this.editor);e==null||e.forceRenderingAbove()}}class ME{static fromSuggestion(e,t,i,n,r){let{insertText:o}=n.completion,a=!1;if(n.completion.insertTextRules&4){const d=new cy().parse(o);d.children.length<100&&E3.adjustWhitespace(t,i,!0,d),o=d.toString(),a=!0}const l=e.getOverwriteInfo(n,r);return new ME(W.fromPositions(i.delta(0,-l.overwriteBefore),i.delta(0,Math.max(l.overwriteAfter,0))),o,n.completion.kind,a)}constructor(e,t,i,n){this.range=e,this.insertText=t,this.completionItemKind=i,this.isSnippetText=n}equals(e){return this.range.equalsRange(e.range)&&this.insertText===e.insertText&&this.completionItemKind===e.completionItemKind&&this.isSnippetText===e.isSnippetText}toSelectedSuggestionInfo(){return new Nve(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}toSingleTextEdit(){return new Zh(this.range,this.insertText)}}function lat(s,e){return s===e?!0:!s||!e?!1:s.equals(e)}var cat=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Of=function(s,e){return function(t,i){e(t,i,s)}},CX,CC;let Vc=(CC=class extends re{static get(e){return e.getContribution(CX.ID)}constructor(e,t,i,n,r,o,a,l,d,h){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=i,this._configurationService=n,this._commandService=r,this._debounceService=o,this._languageFeaturesService=a,this._accessibilitySignalService=l,this._keybindingService=d,this._accessibilityService=h,this._editorObs=el(this.editor),this._positions=lt(this,p=>{var m;return((m=this._editorObs.selections.read(p))==null?void 0:m.map(v=>v.getEndPosition()))??[new ie(1,1)]}),this._suggestWidgetAdaptor=this._register(new aat(this.editor,()=>{var p,m;return this._editorObs.forceUpdate(),(m=(p=this.model.get())==null?void 0:p.selectedInlineCompletion.get())==null?void 0:m.toSingleTextEdit(void 0)},p=>this._editorObs.forceUpdate(m=>{var v;(v=this.model.get())==null||v.handleSuggestAccepted(p)}))),this._suggestWidgetSelectedItem=Bi(this,p=>this._suggestWidgetAdaptor.onDidSelectedItemChange(()=>{this._editorObs.forceUpdate(m=>p(void 0))}),()=>this._suggestWidgetAdaptor.selectedItem),this._enabledInConfig=Bi(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).enabled),this._isScreenReaderEnabled=Bi(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this._editorDictationInProgress=Bi(this,this._contextKeyService.onDidChangeContext,()=>this._contextKeyService.getContext(this.editor.getDomNode()).getValue("editorDictation.inProgress")===!0),this._enabled=lt(this,p=>this._enabledInConfig.read(p)&&(!this._isScreenReaderEnabled.read(p)||!this._editorDictationInProgress.read(p))),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this.model=vo(this,p=>{if(this._editorObs.isReadonly.read(p))return;const m=this._editorObs.model.read(p);return m?this._instantiationService.createInstance(dX,m,this._suggestWidgetSelectedItem,this._editorObs.versionId,this._positions,this._debounceValue,Bi(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(119).preview),Bi(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(119).previewMode),Bi(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).mode),this._enabled):void 0}).recomputeInitiallyAndOnChange(this._store),this._ghostTexts=lt(this,p=>{const m=this.model.read(p);return(m==null?void 0:m.ghostTexts.read(p))??[]}),this._stablizedGhostTexts=dat(this._ghostTexts,this._store),this._ghostTextWidgets=O6e(this,this._stablizedGhostTexts,(p,m)=>m.add(this._instantiationService.createInstance(lX,this.editor,{ghostText:p,minReservedLineCount:Tc(0),targetTextModel:this.model.map(v=>v==null?void 0:v.textModel)}))).recomputeInitiallyAndOnChange(this._store),this._playAccessibilitySignal=Ax(this),this._fontFamily=Bi(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).fontFamily),this._register(new cl(this._contextKeyService,this.model)),this._register(GY(this._editorObs.onDidType,(p,m)=>{var v;this._enabled.get()&&((v=this.model.get())==null||v.trigger())})),this._register(this._commandService.onDidExecuteCommand(p=>{new Set([rS.Tab.id,rS.DeleteLeft.id,rS.DeleteRight.id,K0e,"acceptSelectedSuggestion"]).has(p.commandId)&&e.hasTextFocus()&&this._enabled.get()&&this._editorObs.forceUpdate(v=>{var b;(b=this.model.get())==null||b.trigger(v)})})),this._register(GY(this._editorObs.selections,(p,m)=>{var v;m.some(b=>b.reason===3||b.source==="api")&&((v=this.model.get())==null||v.stop())})),this._register(this.editor.onDidBlurEditorWidget(()=>{this._contextKeyService.getContextKeyValue("accessibleViewIsShown")||this._configurationService.getValue("editor.inlineSuggest.keepOnBlur")||e.getOption(62).keepOnBlur||tx.dropDownVisible||On(p=>{var m;(m=this.model.get())==null||m.stop(p)})})),this._register(Et(p=>{var v;const m=(v=this.model.read(p))==null?void 0:v.state.read(p);m!=null&&m.suggestItem?m.primaryGhostText.lineCount>=2&&this._suggestWidgetAdaptor.forceRenderingAbove():this._suggestWidgetAdaptor.stopForceRenderingAbove()})),this._register(dt(()=>{this._suggestWidgetAdaptor.stopForceRenderingAbove()}));const f=kN(this,(p,m)=>{var y;const v=this.model.read(p),b=v==null?void 0:v.state.read(p);return this._suggestWidgetSelectedItem.get()?m:(y=b==null?void 0:b.inlineCompletion)==null?void 0:y.semanticId});this._register(oQe(lt(p=>(this._playAccessibilitySignal.read(p),f.read(p),{})),async(p,m,v)=>{const b=this.model.get(),y=b==null?void 0:b.state.get();if(!y||!b)return;const x=b.textModel.getLineContent(y.primaryGhostText.lineNumber);await Rg(50,DU(v)),await aye(this._suggestWidgetSelectedItem,wo,()=>!1,DU(v)),await this._accessibilitySignalService.playSignal(Fl.inlineSuggestion),this.editor.getOption(8)&&this._provideScreenReaderUpdate(y.primaryGhostText.renderForScreenReader(x))})),this._register(new DZ(this.editor,this.model,this._instantiationService)),this._register(eot(lt(p=>{const m=this._fontFamily.read(p);return m===""||m==="default"?"":`
|
|
914
914
|
.monaco-editor .ghost-text-decoration,
|
|
915
915
|
.monaco-editor .ghost-text-decoration-preview,
|
|
916
916
|
.monaco-editor .ghost-text {
|
|
917
917
|
font-family: ${m};
|
|
918
|
-
}`}))),this._register(this._configurationService.onDidChangeConfiguration(p=>{p.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"),i=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let n;!t&&i&&this.editor.getOption(150)&&(n=w("showAccessibleViewHint","Inspect this in the accessible view ({0})",i.getAriaLabel())),Qo(n?e+", "+n:e)}shouldShowHoverAt(e){var i;const t=(i=this.model.get())==null?void 0:i.primaryGhostText.get();return t?t.parts.some(n=>e.containsPosition(new ie(t.lineNumber,n.column))):!1}shouldShowHoverAtViewZone(e){var t;return((t=this._ghostTextWidgets.get()[0])==null?void 0:t.ownsViewZone(e))??!1}},CX=CC,CC.ID="editor.contrib.inlineCompletionsController",CC);Vc=CX=cat([Of(1,ut),Of(2,yt),Of(3,Gt),Of(4,on),Of(5,sc),Of(6,it),Of(7,I_),Of(8,Mi),Of(9,pl)],Vc);function dat(s,e){const t=Kt("result",[]),i=[];return e.add(Et(n=>{const r=s.read(n);On(o=>{if(r.length!==i.length){i.length=r.length;for(let a=0;a<i.length;a++)i[a]||(i[a]=Kt("item",r[a]));t.set([...i],o)}i.forEach((a,l)=>a.set(r[l],o))})})),t}const aW=class aW extends Ze{constructor(){super({id:aW.ID,label:w("action.inlineSuggest.showNext","Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:ve.and(U.writable,cl.inlineSuggestionVisible),kbOpts:{weight:100,primary:606}})}async run(e,t){var n;const i=Vc.get(t);(n=i==null?void 0:i.model.get())==null||n.next()}};aW.ID=Y0e;let yX=aW;const lW=class lW extends Ze{constructor(){super({id:lW.ID,label:w("action.inlineSuggest.showPrevious","Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:ve.and(U.writable,cl.inlineSuggestionVisible),kbOpts:{weight:100,primary:604}})}async run(e,t){var n;const i=Vc.get(t);(n=i==null?void 0:i.model.get())==null||n.previous()}};lW.ID=G0e;let wX=lW;class uat extends Ze{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:w("action.inlineSuggest.trigger","Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:U.writable})}async run(e,t){const i=Vc.get(t);await sye(async n=>{var r;await((r=i==null?void 0:i.model.get())==null?void 0:r.triggerExplicitly(n)),i==null||i.playAccessibilitySignal(n)})}}class hat extends Ze{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:ve.and(U.writable,cl.inlineSuggestionVisible),kbOpts:{weight:101,primary:2065,kbExpr:ve.and(U.writable,cl.inlineSuggestionVisible)},menuOpts:[{menuId:st.InlineSuggestionToolbar,title:w("acceptWord","Accept Word"),group:"primary",order:2}]})}async run(e,t){var n;const i=Vc.get(t);await((n=i==null?void 0:i.model.get())==null?void 0:n.acceptNextWord(i.editor))}}class fat extends Ze{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:ve.and(U.writable,cl.inlineSuggestionVisible),kbOpts:{weight:101},menuOpts:[{menuId:st.InlineSuggestionToolbar,title:w("acceptLine","Accept Line"),group:"secondary",order:2}]})}async run(e,t){var n;const i=Vc.get(t);await((n=i==null?void 0:i.model.get())==null?void 0:n.acceptNextLine(i.editor))}}class gat extends Ze{constructor(){super({id:K0e,label:w("action.inlineSuggest.accept","Accept Inline Suggestion"),alias:"Accept Inline Suggestion",precondition:cl.inlineSuggestionVisible,menuOpts:[{menuId:st.InlineSuggestionToolbar,title:w("accept","Accept"),group:"primary",order:1}],kbOpts:{primary:2,weight:200,kbExpr:ve.and(cl.inlineSuggestionVisible,U.tabMovesFocus.toNegated(),cl.inlineSuggestionHasIndentationLessThanTabSize,zt.Visible.toNegated(),U.hoverFocused.toNegated())}})}async run(e,t){var n;const i=Vc.get(t);i&&((n=i.model.get())==null||n.accept(i.editor),i.editor.focus())}}const cW=class cW extends Ze{constructor(){super({id:cW.ID,label:w("action.inlineSuggest.hide","Hide Inline Suggestion"),alias:"Hide Inline Suggestion",precondition:cl.inlineSuggestionVisible,kbOpts:{weight:100,primary:9}})}async run(e,t){const i=Vc.get(t);On(n=>{var r;(r=i==null?void 0:i.model.get())==null||r.stop(n)})}};cW.ID="editor.action.inlineSuggest.hide";let SX=cW;const dW=class dW extends ea{constructor(){super({id:dW.ID,title:w("action.inlineSuggest.alwaysShowToolbar","Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:st.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:ve.equals("config.editor.inlineSuggest.showToolbar","always")})}async run(e,t){const i=e.get(Gt),r=i.getValue("editor.inlineSuggest.showToolbar")==="always"?"onHover":"always";i.updateValue("editor.inlineSuggest.showToolbar",r)}};dW.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar";let xX=dW;var pat=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},CD=function(s,e){return function(t,i){e(t,i,s)}};class mat{constructor(e,t,i){this.owner=e,this.range=t,this.controller=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let kX=class{constructor(e,t,i,n,r,o){this._editor=e,this._languageService=t,this._openerService=i,this.accessibilityService=n,this._instantiationService=r,this._telemetryService=o,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=Vc.get(this._editor);if(!t)return null;const i=e.target;if(i.type===8){const n=i.detail;if(t.shouldShowHoverAtViewZone(n.viewZoneId))return new vF(1e3,this,W.fromPositions(this._editor.getModel().validatePosition(n.positionBefore||n.position)),e.event.posx,e.event.posy,!1)}return i.type===7&&t.shouldShowHoverAt(i.range)?new vF(1e3,this,i.range,e.event.posx,e.event.posy,!1):i.type===6&&i.detail.mightBeForeignElement&&t.shouldShowHoverAt(i.range)?new vF(1e3,this,i.range,e.event.posx,e.event.posy,!1):null}computeSync(e,t){if(this._editor.getOption(62).showToolbar!=="onHover")return[];const i=Vc.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new mat(this,e.range,i)]:[]}renderHoverParts(e,t){const i=new me,n=t[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(8)&&i.add(this.renderScreenReaderText(e,n));const r=n.controller.model.get(),o=this._instantiationService.createInstance(tx,this._editor,!1,Tc(null),r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.activeCommands),a=o.getDomNode();e.fragment.appendChild(a),r.triggerExplicitly(),i.add(o);const l={hoverPart:n,hoverElement:a,dispose(){i.dispose()}};return new fy([l])}renderScreenReaderText(e,t){const i=new me,n=Fe,r=n("div.hover-row.markdown-hover"),o=Ee(r,n("div.hover-contents",{"aria-live":"assertive"})),a=i.add(new Ag({editor:this._editor},this._languageService,this._openerService)),l=d=>{i.add(a.onDidRenderAsync(()=>{o.className="hover-contents code-hover-contents",e.onContentsChanged()}));const h=w("inlineSuggestionFollows","Suggestion:"),f=i.add(a.render(new eo().appendText(h).appendCodeblock("text",d)));o.replaceChildren(f.element)};return i.add(Et(d=>{var f;const h=(f=t.controller.model.read(d))==null?void 0:f.primaryGhostText.read(d);if(h){const p=this._editor.getModel().getLineContent(h.lineNumber);l(h.renderForScreenReader(p))}else xr(o)})),e.fragment.appendChild(r),i}};kX=pat([CD(1,Nn),CD(2,Ta),CD(3,pl),CD(4,ut),CD(5,so)],kX);class _at{}const VV=new class{constructor(){this._implementations=[]}register(e){return this._implementations.push(e),{dispose:()=>{const t=this._implementations.indexOf(e);t!==-1&&this._implementations.splice(t,1)}}}getImplementations(){return this._implementations}};gi(Vc.ID,Vc,3);Pe(uat);Pe(yX);Pe(wX);Pe(hat);Pe(fat);Pe(gat);Pe(SX);sn(xX);$y.register(kX);VV.register(new _at);var vat=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},wj=function(s,e){return function(t,i){e(t,i,s)}},UD,zm;let MT=(zm=class{constructor(e,t,i,n){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=n,this.toUnhook=new me,this.toUnhookForKeyboard=new me,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const r=new RV(e);this.toUnhook.add(r),this.toUnhook.add(r.onMouseMoveOrRelevantKeyDown(([o,a])=>{this.startFindDefinitionFromMouse(o,a??void 0)})),this.toUnhook.add(r.onExecute(o=>{this.isEnabled(o)&&this.gotoDefinition(o.target.position,o.hasSideBySideModifier).catch(a=>{Tt(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(r.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(UD.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 i=e.target.position;this.startFindDefinition(i)}async startFindDefinition(e){var o;this.toUnhookForKeyboard.clear();const t=e?(o=this.editor.getModel())==null?void 0:o.getWordAtPosition(e):null;if(!t){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===t.startColumn&&this.currentWordAtPosition.endColumn===t.endColumn&&this.currentWordAtPosition.word===t.word)return;this.currentWordAtPosition=t;const i=new N1e(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=Zs(a=>this.findDefinition(e,a));let n;try{n=await this.previousPromise}catch(a){Tt(a);return}if(!n||!n.length||!i.validate(this.editor)){this.removeLinkDecorations();return}const r=n[0].originSelectionRange?W.lift(n[0].originSelectionRange):new W(e.lineNumber,t.startColumn,e.lineNumber,t.endColumn);if(n.length>1){let a=r;for(const{originSelectionRange:l}of n)l&&(a=W.plusRange(a,l));this.addDecoration(a,new eo().appendText(w("multipleResults","Click to show {0} definitions.",n.length)))}else{const a=n[0];if(!a.uri)return;this.textModelResolverService.createModelReference(a.uri).then(l=>{if(!l.object||!l.object.textEditorModel){l.dispose();return}const{object:{textEditorModel:d}}=l,{startLineNumber:h}=a.range;if(h<1||h>d.getLineCount()){l.dispose();return}const f=this.getPreviewValue(d,h,a),p=this.languageService.guessLanguageIdByFilepathOrFirstLine(d.uri);this.addDecoration(r,f?new eo().appendCodeblock(p||"",f):void 0),l.dispose()})}}getPreviewValue(e,t,i){let n=i.range;return n.endLineNumber-n.startLineNumber>=UD.MAX_SOURCE_PREVIEW_LINES&&(n=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,n)}stripIndentationFromPreviewRange(e,t,i){let r=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a<i.endLineNumber;a++){const l=e.getLineFirstNonWhitespaceColumn(a);r=Math.min(r,l)}return e.getValueInRange(i).replace(new RegExp(`^\\s{${r-1}}`,"gm"),"").trim()}getPreviewRangeBasedOnIndentation(e,t){const i=e.getLineFirstNonWhitespaceColumn(t),n=Math.min(e.getLineCount(),t+UD.MAX_SOURCE_PREVIEW_LINES);let r=t+1;for(;r<n;r++){const o=e.getLineFirstNonWhitespaceColumn(r);if(i===o)break}return new W(t,1,r+1,1)}addDecoration(e,t){const i={range:e,options:{description:"goto-definition-link",inlineClassName:"goto-definition-link",hoverMessage:t}};this.linkDecorations.set([i])}removeLinkDecorations(){this.linkDecorations.clear()}isEnabled(e,t){var i;return this.editor.hasModel()&&e.isLeftClick&&e.isNoneOrSingleMouseDown&&e.target.type===6&&!(((i=e.target.detail.injectedText)==null?void 0:i.options)instanceof h_)&&(e.hasTriggerModifier||(t?t.keyCodeIsTriggerKey:!1))&&this.languageFeaturesService.definitionProvider.has(this.editor.getModel())}findDefinition(e,t){const i=this.editor.getModel();return i?$N(this.languageFeaturesService.definitionProvider,i,e,!1,t):Promise.resolve(null)}gotoDefinition(e,t){return this.editor.setPosition(e),this.editor.invokeWithinContext(i=>{const n=!t&&this.editor.getOption(89)&&!this.isInPeekEditor(i);return new jN({openToSide:t,openInPeek:n,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(yt);return ka.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}},UD=zm,zm.ID="editor.contrib.gotodefinitionatposition",zm.MAX_SOURCE_PREVIEW_LINES=8,zm);MT=UD=vat([wj(1,Ea),wj(2,Nn),wj(3,it)],MT);gi(MT.ID,MT,2);var HSe=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},P3=function(s,e){return function(t,i){e(t,i,s)}};class qge{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let LX=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new se,this.onDidChange=this._onDidChange.event,this._dispoables=new me,this._markers=[],this._nextIdx=-1,gt.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const n=this._configService.getValue("problems.sortOrder"),r=(a,l)=>{let d=yI(a.resource.toString(),l.resource.toString());return d===0&&(n==="position"?d=W.compareRangesUsingStarts(a,l)||Kn.compare(a.severity,l.severity):d=Kn.compare(a.severity,l.severity)||W.compareRangesUsingStarts(a,l)),d},o=()=>{this._markers=this._markerService.read({resource:gt.isUri(e)?e:void 0,severities:Kn.Error|Kn.Warning|Kn.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(r)};o(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(l=>this._resourceFilter(l)))&&(o(),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 qge(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let n=!1,r=this._markers.findIndex(o=>o.resource.toString()===e.uri.toString());r<0&&(r=hI(this._markers,{resource:e.uri},(o,a)=>yI(o.resource.toString(),a.resource.toString())),r<0&&(r=~r));for(let o=r;o<this._markers.length;o++){let a=W.lift(this._markers[o]);if(a.isEmpty()){const l=e.getWordAtPosition(a.getStartPosition());l&&(a=new W(a.startLineNumber,l.startColumn,a.startLineNumber,l.endColumn))}if(t&&(a.containsPosition(t)||t.isBeforeOrEqual(a.getStartPosition()))){this._nextIdx=o,n=!0;break}if(this._markers[o].resource.toString()!==e.uri.toString())break}n||(this._nextIdx=i?0:this._markers.length-1),this._nextIdx<0&&(this._nextIdx=this._markers.length-1)}resetIndex(){this._nextIdx=-1}move(e,t,i){if(this._markers.length===0)return!1;const n=this._nextIdx;return this._nextIdx===-1?this._initIdx(t,i,e):e?this._nextIdx=(this._nextIdx+1)%this._markers.length:e||(this._nextIdx=(this._nextIdx-1+this._markers.length)%this._markers.length),n!==this._nextIdx}find(e,t){let i=this._markers.findIndex(n=>n.resource.toString()===e.toString());if(!(i<0)){for(;i<this._markers.length;i++)if(W.containsPosition(this._markers[i],t))return new qge(this._markers[i],i+1,this._markers.length)}}};LX=HSe([P3(1,uf),P3(2,Gt)],LX);const VSe=ii("IMarkerNavigationService");let DX=class{constructor(e,t){this._markerService=e,this._configService=t,this._provider=new Vo}getMarkerList(e){for(const t of this._provider){const i=t.getMarkerList(e);if(i)return i}return new LX(e,this._markerService,this._configService)}};DX=HSe([P3(0,uf),P3(1,Gt)],DX);li(VSe,DX,1);var EX;(function(s){function e(t){switch(t){case fs.Ignore:return"severity-ignore "+bt.asClassName(Oe.info);case fs.Info:return bt.asClassName(Oe.info);case fs.Warning:return bt.asClassName(Oe.warning);case fs.Error:return bt.asClassName(Oe.error);default:return""}}s.className=e})(EX||(EX={}));var bat=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},A1=function(s,e){return function(t,i){e(t,i,s)}},IX;class Cat{constructor(e,t,i,n,r){this._openerService=n,this._labelService=r,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new me,this._editor=t;const o=document.createElement("div");o.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),o.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),o.appendChild(this._relatedBlock),this._disposables.add(Hn(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new TCe(o,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{o.style.left=`-${a.scrollLeft}px`,o.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){Xi(this._disposables)}update(e){const{source:t,message:i,relatedInformation:n,code:r}=e;let o=((t==null?void 0:t.length)||0)+2;r&&(typeof r=="string"?o+=r.length:o+=r.value.length);const a=of(i);this._lines=a.length,this._longestLineLength=0;for(const p of a)this._longestLineLength=Math.max(p.length+o,this._longestLineLength);Sr(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const p of a)l=document.createElement("div"),l.innerText=p,p===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||r){const p=document.createElement("span");if(p.classList.add("details"),l.appendChild(p),t){const m=document.createElement("span");m.innerText=t,m.classList.add("source"),p.appendChild(m)}if(r)if(typeof r=="string"){const m=document.createElement("span");m.innerText=`(${r})`,m.classList.add("code"),p.appendChild(m)}else{this._codeLink=Fe("a.code-link"),this._codeLink.setAttribute("href",`${r.target.toString()}`),this._codeLink.onclick=v=>{this._openerService.open(r.target,{allowCommands:!0}),v.preventDefault(),v.stopPropagation()};const m=Ee(this._codeLink,Fe("span"));m.innerText=r.value,p.appendChild(this._codeLink)}}if(Sr(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),So(n)){const p=this._relatedBlock.appendChild(document.createElement("div"));p.style.paddingTop=`${Math.floor(this._editor.getOption(67)*.66)}px`,this._lines+=1;for(const m of n){const v=document.createElement("div"),b=document.createElement("a");b.classList.add("filename"),b.innerText=`${this._labelService.getUriBasenameLabel(m.resource)}(${m.startLineNumber}, ${m.startColumn}): `,b.title=this._labelService.getUriLabel(m.resource),this._relatedDiagnostics.set(b,m);const y=document.createElement("span");y.innerText=m.message,v.appendChild(b),v.appendChild(y),this._lines+=1,p.appendChild(v)}}const d=this._editor.getOption(50),h=Math.ceil(d.typicalFullwidthCharacterWidth*this._longestLineLength*.75),f=d.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:h,scrollHeight:f})}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 Kn.Error:t=w("Error","Error");break;case Kn.Warning:t=w("Warning","Warning");break;case Kn.Info:t=w("Info","Info");break;case Kn.Hint:t=w("Hint","Hint");break}let i=w("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const n=this._editor.getModel();return n&&e.startLineNumber<=n.getLineCount()&&e.startLineNumber>=1&&(i=`${n.getLineContent(e.startLineNumber)}, ${i}`),i}}var yC;let RT=(yC=class extends u3{constructor(e,t,i,n,r,o,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},r),this._themeService=t,this._openerService=i,this._menuService=n,this._contextKeyService=o,this._labelService=a,this._callOnDispose=new me,this._onDidSelectRelatedInformation=new se,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=Kn.Warning,this._backgroundColor=be.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(xat);let t=TX,i=yat;this._severity===Kn.Warning?(t=wF,i=wat):this._severity===Kn.Info&&(t=NX,i=Sat);const n=e.getColor(t),r=e.getColor(i);this.style({arrowColor:n,frameColor:n,headerBackgroundColor:r,primaryHeadingColor:e.getColor(rSe),secondaryHeadingColor:e.getColor(oSe)})}_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(n=>this.editor.focus()));const t=[],i=this._menuService.getMenuActions(IX.TitleMenu,this._contextKeyService);nV(i,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0})}_fillTitleIcon(e){this._icon=Ee(e,Fe(""))}_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 Cat(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,i){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const n=W.lift(e),r=this.editor.getPosition(),o=r&&n.containsPosition(r)?r:n.getStartPosition();super.show(o,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=i>1?w("problems","{0} of {1} problems",t,i):w("change","{0} of {1} problem",t,i);this.setTitle(Wc(a.uri),l)}this._icon.className=`codicon ${EX.className(Kn.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(o,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()}},IX=yC,yC.TitleMenu=new st("gotoErrorTitleMenu"),yC);RT=IX=bat([A1(1,zs),A1(2,Ta),A1(3,nc),A1(4,ut),A1(5,yt),A1(6,HS)],RT);const Kge=MI(WH,pVe),Gge=MI(Og,RI),Yge=MI(Qh,PI),TX=q("editorMarkerNavigationError.background",{dark:Kge,light:Kge,hcDark:fi,hcLight:fi},w("editorMarkerNavigationError","Editor marker navigation widget error color.")),yat=q("editorMarkerNavigationError.headerBackground",{dark:jt(TX,.1),light:jt(TX,.1),hcDark:null,hcLight:null},w("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),wF=q("editorMarkerNavigationWarning.background",{dark:Gge,light:Gge,hcDark:fi,hcLight:fi},w("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),wat=q("editorMarkerNavigationWarning.headerBackground",{dark:jt(wF,.1),light:jt(wF,.1),hcDark:"#0C141F",hcLight:jt(wF,.2)},w("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),NX=q("editorMarkerNavigationInfo.background",{dark:Yge,light:Yge,hcDark:fi,hcLight:fi},w("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),Sat=q("editorMarkerNavigationInfo.headerBackground",{dark:jt(NX,.1),light:jt(NX,.1),hcDark:null,hcLight:null},w("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),xat=q("editorMarkerNavigation.background",Md,w("editorMarkerNavigationBackground","Editor marker navigation widget background."));var kat=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},w2=function(s,e){return function(t,i){e(t,i,s)}},qD,wC;let my=(wC=class{static get(e){return e.getContribution(qD.ID)}constructor(e,t,i,n,r){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=n,this._instantiationService=r,this._sessionDispoables=new me,this._editor=e,this._widgetVisible=$Se.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(RT,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(i=>{var n,r,o;(!((n=this._model)!=null&&n.selected)||!W.containsPosition((r=this._model)==null?void 0:r.selected.marker,i.position))&&((o=this._model)==null||o.resetIndex())})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const i=this._model.find(this._editor.getModel().uri,this._widget.position);i?this._widget.updateMarker(i.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(i=>{this._editorService.openCodeEditor({resource:i.resource,options:{pinned:!0,revealIfOpened:!0,selection:W.lift(i).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 ie(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}async nagivate(e,t){var i,n;if(this._editor.hasModel()){const r=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(r.move(e,this._editor.getModel(),this._editor.getPosition()),!r.selected)return;if(r.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const o=await this._editorService.openCodeEditor({resource:r.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:r.selected.marker}},this._editor);o&&((i=qD.get(o))==null||i.close(),(n=qD.get(o))==null||n.nagivate(e,t))}else this._widget.showAtMarker(r.selected.marker,r.selected.index,r.selected.total)}}},qD=wC,wC.ID="editor.contrib.markerController",wC);my=qD=kat([w2(1,VSe),w2(2,yt),w2(3,yi),w2(4,ut)],my);class $V extends Ze{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}async run(e,t){var i;t.hasModel()&&((i=my.get(t))==null||i.nagivate(this._next,this._multiFile))}}const mb=class mb extends $V{constructor(){super(!0,!1,{id:mb.ID,label:mb.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:U.focus,primary:578,weight:100},menuOpts:{menuId:RT.TitleMenu,title:mb.LABEL,icon:mn("marker-navigation-next",Oe.arrowDown,w("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}};mb.ID="editor.action.marker.next",mb.LABEL=w("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");let O3=mb;const _b=class _b extends $V{constructor(){super(!1,!1,{id:_b.ID,label:_b.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:U.focus,primary:1602,weight:100},menuOpts:{menuId:RT.TitleMenu,title:_b.LABEL,icon:mn("marker-navigation-previous",Oe.arrowUp,w("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}};_b.ID="editor.action.marker.prev",_b.LABEL=w("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");let MX=_b;class Lat extends $V{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:U.focus,primary:66,weight:100},menuOpts:{menuId:st.MenubarGoMenu,title:w({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class Dat extends $V{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:U.focus,primary:1090,weight:100},menuOpts:{menuId:st.MenubarGoMenu,title:w({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}gi(my.ID,my,4);Pe(O3);Pe(MX);Pe(Lat);Pe(Dat);const $Se=new qe("markersNavigationVisible",!1),Eat=$s.bindToContribution(my.get);Ue(new Eat({id:"closeMarkersNavigation",precondition:$Se,handler:s=>s.close(),kbOpts:{weight:150,kbExpr:U.focus,primary:9,secondary:[1033]}}));var ru;(function(s){s.NoAutoFocus="noAutoFocus",s.FocusIfVisible="focusIfVisible",s.AutoFocusImmediately="autoFocusImmediately"})(ru||(ru={}));class Iat extends Ze{constructor(){super({id:q0e,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:kt("showOrFocusHoverDescription","Show or focus the editor hover which shows documentation, references, and other content for a symbol at the current cursor position."),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:[ru.NoAutoFocus,ru.FocusIfVisible,ru.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:ru.FocusIfVisible}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:Ls(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const n=ko.get(t);if(!n)return;const r=i==null?void 0:i.focus;let o=ru.FocusIfVisible;Object.values(ru).includes(r)?o=r:typeof r=="boolean"&&r&&(o=ru.AutoFocusImmediately);const a=d=>{const h=t.getPosition(),f=new W(h.lineNumber,h.column,h.lineNumber,h.column);n.showContentHover(f,1,1,d)},l=t.getOption(2)===2;n.isHoverVisible?o!==ru.NoAutoFocus?n.focus():a(l):a(l||o===ru.AutoFocusImmediately)}}class Tat extends Ze{constructor(){super({id:Kit,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,metadata:{description:kt("showDefinitionPreviewHoverDescription","Show the definition preview hover in the editor.")}})}run(e,t){const i=ko.get(t);if(!i)return;const n=t.getPosition();if(!n)return;const r=new W(n.lineNumber,n.column,n.lineNumber,n.column),o=MT.get(t);if(!o)return;o.startFindDefinitionFromCursor(n).then(()=>{i.showContentHover(r,1,1,!0)})}}class Nat extends Ze{constructor(){super({id:Git,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:U.hoverFocused,kbOpts:{kbExpr:U.hoverFocused,primary:16,weight:100},metadata:{description:kt("scrollUpHoverDescription","Scroll up the editor hover.")}})}run(e,t){const i=ko.get(t);i&&i.scrollUp()}}class Mat extends Ze{constructor(){super({id:Yit,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:U.hoverFocused,kbOpts:{kbExpr:U.hoverFocused,primary:18,weight:100},metadata:{description:kt("scrollDownHoverDescription","Scroll down the editor hover.")}})}run(e,t){const i=ko.get(t);i&&i.scrollDown()}}class Rat extends Ze{constructor(){super({id:Zit,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:U.hoverFocused,kbOpts:{kbExpr:U.hoverFocused,primary:15,weight:100},metadata:{description:kt("scrollLeftHoverDescription","Scroll left the editor hover.")}})}run(e,t){const i=ko.get(t);i&&i.scrollLeft()}}class Pat extends Ze{constructor(){super({id:Xit,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:U.hoverFocused,kbOpts:{kbExpr:U.hoverFocused,primary:17,weight:100},metadata:{description:kt("scrollRightHoverDescription","Scroll right the editor hover.")}})}run(e,t){const i=ko.get(t);i&&i.scrollRight()}}class Oat extends Ze{constructor(){super({id:Qit,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:U.hoverFocused,kbOpts:{kbExpr:U.hoverFocused,primary:11,secondary:[528],weight:100},metadata:{description:kt("pageUpHoverDescription","Page up the editor hover.")}})}run(e,t){const i=ko.get(t);i&&i.pageUp()}}class Aat extends Ze{constructor(){super({id:Jit,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:U.hoverFocused,kbOpts:{kbExpr:U.hoverFocused,primary:12,secondary:[530],weight:100},metadata:{description:kt("pageDownHoverDescription","Page down the editor hover.")}})}run(e,t){const i=ko.get(t);i&&i.pageDown()}}class Fat extends Ze{constructor(){super({id:ent,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:U.hoverFocused,kbOpts:{kbExpr:U.hoverFocused,primary:14,secondary:[2064],weight:100},metadata:{description:kt("goToTopHoverDescription","Go to the top of the editor hover.")}})}run(e,t){const i=ko.get(t);i&&i.goToTop()}}class Bat extends Ze{constructor(){super({id:tnt,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:U.hoverFocused,kbOpts:{kbExpr:U.hoverFocused,primary:13,secondary:[2066],weight:100},metadata:{description:kt("goToBottomHoverDescription","Go to the bottom of the editor hover.")}})}run(e,t){const i=ko.get(t);i&&i.goToBottom()}}class Wat extends Ze{constructor(){super({id:TV,label:int,alias:"Increase Hover Verbosity Level",precondition:U.hoverVisible})}run(e,t,i){const n=ko.get(t);if(!n)return;const r=(i==null?void 0:i.index)!==void 0?i.index:n.focusedHoverPartIndex();n.updateHoverVerbosityLevel(Xa.Increase,r,i==null?void 0:i.focus)}}class Hat extends Ze{constructor(){super({id:NV,label:nnt,alias:"Decrease Hover Verbosity Level",precondition:U.hoverVisible})}run(e,t,i){var o;const n=ko.get(t);if(!n)return;const r=(i==null?void 0:i.index)!==void 0?i.index:n.focusedHoverPartIndex();(o=ko.get(t))==null||o.updateHoverVerbosityLevel(Xa.Decrease,r,i==null?void 0:i.focus)}}var Vat=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Sj=function(s,e){return function(t,i){e(t,i,s)}};const ld=Fe;class $at{constructor(e,t,i){this.owner=e,this.range=t,this.marker=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const Zge={type:1,filter:{include:bn.QuickFix},triggerAction:fl.QuickFixHover};let RX=class{constructor(e,t,i,n){this._editor=e,this._markerDecorationsService=t,this._openerService=i,this._languageFeaturesService=n,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1&&!e.supportsMarkerHover)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,r=i.getLineMaxColumn(n),o=[];for(const a of t){const l=a.range.startLineNumber===n?a.range.startColumn:1,d=a.range.endLineNumber===n?a.range.endColumn:r,h=this._markerDecorationsService.getMarker(i.uri,a);if(!h)continue;const f=new W(e.range.startLineNumber,l,e.range.startLineNumber,d);o.push(new $at(this,f,h))}return o}renderHoverParts(e,t){if(!t.length)return new fy([]);const i=new me,n=[];t.forEach(o=>{const a=this._renderMarkerHover(o);e.fragment.appendChild(a.hoverElement),n.push(a)});const r=t.length===1?t[0]:t.sort((o,a)=>Kn.compare(o.marker.severity,a.marker.severity))[0];return this.renderMarkerStatusbar(e,r,i),new fy(n)}_renderMarkerHover(e){const t=new me,i=ld("div.hover-row"),n=Ee(i,ld("div.marker.hover-contents")),{source:r,message:o,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(n);const d=Ee(n,ld("span"));if(d.style.whiteSpace="pre-wrap",d.innerText=o,r||a)if(a&&typeof a!="string"){const f=ld("span");if(r){const b=Ee(f,ld("span"));b.innerText=r}const p=Ee(f,ld("a.code-link"));p.setAttribute("href",a.target.toString()),t.add(ue(p,"click",b=>{this._openerService.open(a.target,{allowCommands:!0}),b.preventDefault(),b.stopPropagation()}));const m=Ee(p,ld("span"));m.innerText=a.value;const v=Ee(n,f);v.style.opacity="0.6",v.style.paddingLeft="6px"}else{const f=Ee(n,ld("span"));f.style.opacity="0.6",f.style.paddingLeft="6px",f.innerText=r&&a?`${r}(${a})`:r||`(${a})`}if(So(l))for(const{message:f,resource:p,startLineNumber:m,startColumn:v}of l){const b=Ee(n,ld("div"));b.style.marginTop="8px";const y=Ee(b,ld("a"));y.innerText=`${Wc(p)}(${m}, ${v}): `,y.style.cursor="pointer",t.add(ue(y,"click",D=>{if(D.stopPropagation(),D.preventDefault(),this._openerService){const S={selection:{startLineNumber:m,startColumn:v}};this._openerService.open(p,{fromUserGesture:!0,editorOptions:S}).catch(Tt)}}));const x=Ee(b,ld("span"));x.innerText=f,this._editor.applyFontInfo(x)}return{hoverPart:e,hoverElement:i,dispose:()=>t.dispose()}}renderMarkerStatusbar(e,t,i){if(t.marker.severity===Kn.Error||t.marker.severity===Kn.Warning||t.marker.severity===Kn.Info){const n=my.get(this._editor);n&&e.statusBar.addAction({label:w("view problem","View Problem"),commandId:O3.ID,run:()=>{e.hide(),n.showAtMarker(t.marker),this._editor.focus()}})}if(!this._editor.getOption(92)){const n=e.statusBar.append(ld("div"));this.recentMarkerCodeActionsInfo&&(n5.makeKey(this.recentMarkerCodeActionsInfo.marker)===n5.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(n.textContent=w("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const r=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?re.None:r_(()=>n.textContent=w("checkingForQuickFixes","Checking for quick fixes..."),200,i);n.textContent||(n.textContent=" ");const o=this.getCodeActions(t.marker);i.add(dt(()=>o.cancel())),o.then(a=>{if(r.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),n.textContent=w("noQuickFixes","No quick fixes available");return}n.style.display="none";let l=!1;i.add(dt(()=>{l||a.dispose()})),e.statusBar.addAction({label:w("quick fixes","Quick Fix..."),commandId:ine,run:d=>{l=!0;const h=JS.get(this._editor),f=ts(d);e.hide(),h==null||h.showCodeActions(Zge,a,{x:f.left,y:f.top,width:f.width,height:f.height})}})},Tt)}}getCodeActions(e){return Zs(t=>p0(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new W(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),Zge,wu.None,t))}};RX=Vat([Sj(1,Ete),Sj(2,Ta),Sj(3,it)],RX);class zat{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=Td.Center}computeSync(){var r;const e=o=>({value:o}),t=this._editor.getLineDecorations(this._lineNumber),i=[],n=this._laneOrLine==="lineNo";if(!t)return i;for(const o of t){const a=((r=o.options.glyphMargin)==null?void 0:r.position)??Td.Center;if(!n&&a!==this._laneOrLine)continue;const l=n?o.options.lineNumberHoverMessage:o.options.glyphMarginHoverMessage;!l||BS(l)||i.push(...ree(l).map(e))}return i}}var jat=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Xge=function(s,e){return function(t,i){e(t,i,s)}},PX;const Qge=Fe;var SC;let OX=(SC=class extends re{constructor(e,t,i){super(),this._renderDisposeables=this._register(new me),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new ote),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new Ag({editor:this._editor},t,i)),this._computer=new zat(this._editor),this._hoverOperation=this._register(new Z0e(this._editor,this._computer)),this._register(this._hoverOperation.onResult(n=>{this._withResult(n.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(50)&&this._updateFont()})),this._register(Hn(this._hover.containerDomNode,"mouseleave",n=>{this._onMouseLeave(n)})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return PX.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))}showsOrWillShow(e){const t=e.target;return t.type===2&&t.detail.glyphMarginLane?(this._startShowingAt(t.position.lineNumber,t.detail.glyphMarginLane),!0):t.type===3?(this._startShowingAt(t.position.lineNumber,"lineNo"),!0):!1}_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 i=document.createDocumentFragment();for(const n of t){const r=Qge("div.hover-row.markdown-hover"),o=Ee(r,Qge("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(n.value));o.appendChild(a.element),i.appendChild(r)}this._updateContents(i),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(),i=this._editor.getTopForLineNumber(e),n=this._editor.getScrollTop(),r=this._editor.getOption(67),o=this._hover.containerDomNode.clientHeight,a=i-n-(o-r)/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`}_onMouseLeave(e){const t=this._editor.getDomNode();(!t||!MV(t,e.x,e.y))&&this.hide()}},PX=SC,SC.ID="editor.contrib.modesGlyphHoverWidget",SC);OX=PX=jat([Xge(1,Nn),Xge(2,Ta)],OX);var Uat=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},qat=function(s,e){return function(t,i){e(t,i,s)}},_S;let A3=(_S=class extends re{constructor(e,t){super(),this._editor=e,this._instantiationService=t,this.shouldKeepOpenOnEditorMouseMoveOrLeave=!1,this._listenersStore=new me,this._hoverState={mouseDown:!1},this._reactToEditorMouseMoveRunner=this._register(new ji(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookListeners(),this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(60)&&(this._unhookListeners(),this._hookListeners())}))}_hookListeners(){const e=this._editor.getOption(60);this._hoverSettings={enabled:e.enabled,sticky:e.sticky,hidingDelay:e.hidingDelay},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){this._hoverState.mouseDown=!0,!this._isMouseOnMarginHoverWidget(e)&&this._hideWidgets()}_isMouseOnMarginHoverWidget(e){var i;const t=(i=this._glyphWidget)==null?void 0:i.getDomNode();return t?MV(t,e.event.posx,e.event.posy):!1}_onEditorMouseUp(){this._hoverState.mouseDown=!1}_onEditorMouseLeave(e){this.shouldKeepOpenOnEditorMouseMoveOrLeave||(this._cancelScheduler(),this._isMouseOnMarginHoverWidget(e))||this._hideWidgets()}_shouldNotRecomputeCurrentHoverWidget(e){const t=this._hoverSettings.sticky,i=this._isMouseOnMarginHoverWidget(e);return t&&i}_onEditorMouseMove(e){if(this.shouldKeepOpenOnEditorMouseMoveOrLeave)return;if(this._mouseMoveEvent=e,this._shouldNotRecomputeCurrentHoverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){!e||this._tryShowHoverWidget(e)||this._hideWidgets()}_tryShowHoverWidget(e){return this._getOrCreateGlyphWidget().showsOrWillShow(e)}_onKeyDown(e){this._editor.hasModel()&&(e.keyCode===5||e.keyCode===6||e.keyCode===57||e.keyCode===4||this._hideWidgets())}_hideWidgets(){var e;(e=this._glyphWidget)==null||e.hide()}_getOrCreateGlyphWidget(){return this._glyphWidget||(this._glyphWidget=this._instantiationService.createInstance(OX,this._editor)),this._glyphWidget}dispose(){var e;super.dispose(),this._unhookListeners(),this._listenersStore.dispose(),(e=this._glyphWidget)==null||e.dispose()}},_S.ID="editor.contrib.marginHover",_S);A3=Uat([qat(1,ut)],A3);class Kat{}class Gat{}class Yat{}gi(ko.ID,ko,2);gi(A3.ID,A3,2);Pe(Iat);Pe(Tat);Pe(Nat);Pe(Mat);Pe(Rat);Pe(Pat);Pe(Oat);Pe(Aat);Pe(Fat);Pe(Bat);Pe(Wat);Pe(Hat);$y.register(DT);$y.register(RX);jc((s,e)=>{const t=s.getColor(_Ce);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)}; }`))});VV.register(new Kat);VV.register(new Gat);VV.register(new Yat);function Ka(s,e){let t=0;for(let i=0;i<s.length;i++)s.charAt(i)===" "?t+=e:t++;return t}function RE(s,e,t){s=s<0?0:s;let i="";if(!t){const n=Math.floor(s/e);s=s%e;for(let r=0;r<n;r++)i+=" "}for(let n=0;n<s;n++)i+=" ";return i}function zSe(s,e,t,i){if(s.getLineCount()===1&&s.getLineMaxColumn(1)===1)return[];const n=e.getLanguageConfiguration(s.getLanguageId()).indentRulesSupport;if(!n)return[];const r=new gie(s,n,e);for(i=Math.min(i,s.getLineCount());t<=i&&r.shouldIgnore(t);)t++;if(t>i-1)return[];const{tabSize:o,indentSize:a,insertSpaces:l}=s.getOptions(),d=(b,y)=>(y=y||1,Hc.shiftIndent(b,b.length+y,o,a,l)),h=(b,y)=>(y=y||1,Hc.unshiftIndent(b,b.length+y,o,a,l)),f=[],p=s.getLineContent(t);let m=Zi(p),v=m;r.shouldIncrease(t)?(v=d(v),m=d(m)):r.shouldIndentNextLine(t)&&(v=d(v)),t++;for(let b=t;b<=i;b++){if(Zat(s,b))continue;const y=s.getLineContent(b),x=Zi(y),D=v;r.shouldDecrease(b,D)&&(v=h(v),m=h(m)),x!==v&&f.push(Pn.replaceMove(new ot(b,1,b,x.length+1),Ite(v,a,l))),!r.shouldIgnore(b)&&(r.shouldIncrease(b,D)?(m=d(m),v=m):r.shouldIndentNextLine(b,D)?v=d(v):v=m)}return f}function Zat(s,e){return s.tokenization.isCheapToTokenize(e)?s.tokenization.getLineTokens(e).getStandardTokenType(0)===2:!1}var Xat=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Qat=function(s,e){return function(t,i){e(t,i,s)}};const uW=class uW extends Ze{constructor(){super({id:uW.ID,label:w("indentationToSpaces","Convert Indentation to Spaces"),alias:"Convert Indentation to Spaces",precondition:U.writable,metadata:{description:kt("indentationToSpacesDescription","Convert the tab indentation to spaces.")}})}run(e,t){const i=t.getModel();if(!i)return;const n=i.getOptions(),r=t.getSelection();if(!r)return;const o=new nlt(r,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[o]),t.pushUndoStop(),i.updateOptions({insertSpaces:!0})}};uW.ID="editor.action.indentationToSpaces";let AX=uW;const hW=class hW extends Ze{constructor(){super({id:hW.ID,label:w("indentationToTabs","Convert Indentation to Tabs"),alias:"Convert Indentation to Tabs",precondition:U.writable,metadata:{description:kt("indentationToTabsDescription","Convert the spaces indentation to tabs.")}})}run(e,t){const i=t.getModel();if(!i)return;const n=i.getOptions(),r=t.getSelection();if(!r)return;const o=new slt(r,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[o]),t.pushUndoStop(),i.updateOptions({insertSpaces:!1})}};hW.ID="editor.action.indentationToTabs";let FX=hW;class Ene extends Ze{constructor(e,t,i){super(i),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const i=e.get(Uc),n=e.get(pn),r=t.getModel();if(!r)return;const o=n.getCreationOptions(r.getLanguageId(),r.uri,r.isForSimpleWidget),a=r.getOptions(),l=[1,2,3,4,5,6,7,8].map(h=>({id:h.toString(),label:h.toString(),description:h===o.tabSize&&h===a.tabSize?w("configuredTabSize","Configured Tab Size"):h===o.tabSize?w("defaultTabSize","Default Tab Size"):h===a.tabSize?w("currentTabSize","Current Tab Size"):void 0})),d=Math.min(r.getOptions().tabSize-1,7);setTimeout(()=>{i.pick(l,{placeHolder:w({key:"selectTabWidth",comment:["Tab corresponds to the tab key"]},"Select Tab Size for Current File"),activeItem:l[d]}).then(h=>{if(h&&r&&!r.isDisposed()){const f=parseInt(h.label,10);this.displaySizeOnly?r.updateOptions({tabSize:f}):r.updateOptions({tabSize:f,indentSize:f,insertSpaces:this.insertSpaces})}})},50)}}const fW=class fW extends Ene{constructor(){super(!1,!1,{id:fW.ID,label:w("indentUsingTabs","Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0,metadata:{description:kt("indentUsingTabsDescription","Use indentation with tabs.")}})}};fW.ID="editor.action.indentUsingTabs";let BX=fW;const gW=class gW extends Ene{constructor(){super(!0,!1,{id:gW.ID,label:w("indentUsingSpaces","Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0,metadata:{description:kt("indentUsingSpacesDescription","Use indentation with spaces.")}})}};gW.ID="editor.action.indentUsingSpaces";let WX=gW;const pW=class pW extends Ene{constructor(){super(!0,!0,{id:pW.ID,label:w("changeTabDisplaySize","Change Tab Display Size"),alias:"Change Tab Display Size",precondition:void 0,metadata:{description:kt("changeTabDisplaySizeDescription","Change the space size equivalent of the tab.")}})}};pW.ID="editor.action.changeTabDisplaySize";let HX=pW;const mW=class mW extends Ze{constructor(){super({id:mW.ID,label:w("detectIndentation","Detect Indentation from Content"),alias:"Detect Indentation from Content",precondition:void 0,metadata:{description:kt("detectIndentationDescription","Detect the indentation from content.")}})}run(e,t){const i=e.get(pn),n=t.getModel();if(!n)return;const r=i.getCreationOptions(n.getLanguageId(),n.uri,n.isForSimpleWidget);n.detectIndentation(r.insertSpaces,r.tabSize)}};mW.ID="editor.action.detectIndentation";let VX=mW;class Jat extends Ze{constructor(){super({id:"editor.action.reindentlines",label:w("editor.reindentlines","Reindent Lines"),alias:"Reindent Lines",precondition:U.writable,metadata:{description:kt("editor.reindentlinesDescription","Reindent the lines of the editor.")}})}run(e,t){const i=e.get(Bn),n=t.getModel();if(!n)return;const r=zSe(n,i,1,n.getLineCount());r.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop())}}class elt extends Ze{constructor(){super({id:"editor.action.reindentselectedlines",label:w("editor.reindentselectedlines","Reindent Selected Lines"),alias:"Reindent Selected Lines",precondition:U.writable,metadata:{description:kt("editor.reindentselectedlinesDescription","Reindent the selected lines of the editor.")}})}run(e,t){const i=e.get(Bn),n=t.getModel();if(!n)return;const r=t.getSelections();if(r===null)return;const o=[];for(const a of r){let l=a.startLineNumber,d=a.endLineNumber;if(l!==d&&a.endColumn===1&&d--,l===1){if(l===d)continue}else l--;const h=zSe(n,i,l,d);o.push(...h)}o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}}class tlt{constructor(e,t){this._initialSelection=t,this._edits=[],this._selectionId=null;for(const i of e)i.range&&typeof i.text=="string"&&this._edits.push(i)}getEditOperations(e,t){for(const n of this._edits)t.addEditOperation(W.lift(n.range),n.text);let i=!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?(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!0)):this._edits[0].range.endColumn===this._initialSelection.startColumn&&this._edits[0].range.endLineNumber===this._initialSelection.startLineNumber&&(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!1))),i||(this._selectionId=t.trackSelection(this._initialSelection))}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}var vS;let F3=(vS=class{constructor(e,t){this.editor=e,this._languageConfigurationService=t,this.callOnDispose=new me,this.callOnModel=new me,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 i=this.editor.getModel();if(!i||this.rangeContainsOnlyWhitespaceCharacters(i,e)||ilt(i,e)||!i.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const r=this.editor.getOption(12),{tabSize:o,indentSize:a,insertSpaces:l}=i.getOptions(),d=[],h={shiftIndent:v=>Hc.shiftIndent(v,v.length+1,o,a,l),unshiftIndent:v=>Hc.unshiftIndent(v,v.length+1,o,a,l)};let f=e.startLineNumber;for(;f<=e.endLineNumber;){if(this.shouldIgnoreLine(i,f)){f++;continue}break}if(f>e.endLineNumber)return;let p=i.getLineContent(f);if(!/\S/.test(p.substring(0,e.startColumn-1))){const v=CE(r,i,i.getLanguageId(),f,h,this._languageConfigurationService);if(v!==null){const b=Zi(p),y=Ka(v,o),x=Ka(b,o);if(y!==x){const D=RE(y,o,l);d.push({range:new W(f,1,f,b.length+1),text:D}),p=D+p.substring(b.length)}else{const D=i1e(i,f,this._languageConfigurationService);if(D===0||D===8)return}}}const m=f;for(;f<e.endLineNumber;){if(!/\S/.test(i.getLineContent(f+1))){f++;continue}break}if(f!==e.endLineNumber){const b=CE(r,{tokenization:{getLineTokens:y=>i.tokenization.getLineTokens(y),getLanguageId:()=>i.getLanguageId(),getLanguageIdAtPosition:(y,x)=>i.getLanguageIdAtPosition(y,x)},getLineContent:y=>y===m?p:i.getLineContent(y)},i.getLanguageId(),f+1,h,this._languageConfigurationService);if(b!==null){const y=Ka(b,o),x=Ka(Zi(i.getLineContent(f+1)),o);if(y!==x){const D=y-x;for(let S=f+1;S<=e.endLineNumber;S++){const E=i.getLineContent(S),I=Zi(E),M=Ka(I,o)+D,O=RE(M,o,l);O!==I&&d.push({range:new W(S,1,S,I.length+1),text:O})}}}}if(d.length>0){this.editor.pushUndoStop();const v=new tlt(d,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",v),this.editor.pushUndoStop()}}rangeContainsOnlyWhitespaceCharacters(e,t){const i=r=>r.trim().length===0;let n=!0;if(t.startLineNumber===t.endLineNumber){const o=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);n=i(o)}else for(let r=t.startLineNumber;r<=t.endLineNumber;r++){const o=e.getLineContent(r);if(r===t.startLineNumber){const a=o.substring(t.startColumn-1);n=i(a)}else if(r===t.endLineNumber){const a=o.substring(0,t.endColumn-1);n=i(a)}else n=e.getLineFirstNonWhitespaceColumn(r)===0;if(!n)break}return n}shouldIgnoreLine(e,t){e.tokenization.forceTokenization(t);const i=e.getLineFirstNonWhitespaceColumn(t);if(i===0)return!0;const n=e.tokenization.getLineTokens(t);if(n.getCount()>0){const r=n.findTokenIndexAtOffset(i);if(r>=0&&n.getStandardTokenType(r)===1)return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}},vS.ID="editor.contrib.autoIndentOnPaste",vS);F3=Xat([Qat(1,Bn)],F3);function ilt(s,e){const t=i=>w8e(s,i)===2;return t(e.getStartPosition())||t(e.getEndPosition())}function jSe(s,e,t,i){if(s.getLineCount()===1&&s.getLineMaxColumn(1)===1)return;let n="";for(let o=0;o<t;o++)n+=" ";const r=new RegExp(n,"gi");for(let o=1,a=s.getLineCount();o<=a;o++){let l=s.getLineFirstNonWhitespaceColumn(o);if(l===0&&(l=s.getLineMaxColumn(o)),l===1)continue;const d=new W(o,1,o,l),h=s.getValueInRange(d),f=i?h.replace(/\t/ig,n):h.replace(r," ");e.addEditOperation(d,f)}}class nlt{constructor(e,t){this.selection=e,this.tabSize=t,this.selectionId=null}getEditOperations(e,t){this.selectionId=t.trackSelection(this.selection),jSe(e,t,this.tabSize,!0)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}}class slt{constructor(e,t){this.selection=e,this.tabSize=t,this.selectionId=null}getEditOperations(e,t){this.selectionId=t.trackSelection(this.selection),jSe(e,t,this.tabSize,!1)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}}gi(F3.ID,F3,2);Pe(AX);Pe(FX);Pe(BX);Pe(WX);Pe(HX);Pe(VX);Pe(Jat);Pe(elt);gi(IT.ID,IT,1);$y.register(p3);class rlt{constructor(e,t,i){this._editRange=e,this._originalSelection=t,this._text=i}getEditOperations(e,t){t.addTrackedEditOperation(this._editRange,this._text)}computeCursorState(e,t){const n=t.getInverseEditOperations()[0].range;return this._originalSelection.isEmpty()?new ot(n.endLineNumber,Math.min(this._originalSelection.positionColumn,n.endColumn),n.endLineNumber,Math.min(this._originalSelection.positionColumn,n.endColumn)):new ot(n.endLineNumber,n.endColumn-this._text.length,n.endLineNumber,n.endColumn)}}var olt=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},alt=function(s,e){return function(t,i){e(t,i,s)}},SF,jm;let lx=(jm=class{static get(e){return e.getContribution(SF.ID)}constructor(e,t){this.editor=e,this.editorWorkerService=t,this.decorations=this.editor.createDecorationsCollection()}dispose(){}run(e,t){var l;(l=this.currentRequest)==null||l.cancel();const i=this.editor.getSelection(),n=this.editor.getModel();if(!n||!i)return;let r=i;if(r.startLineNumber!==r.endLineNumber)return;const o=new N1e(this.editor,5),a=n.uri;return this.editorWorkerService.canNavigateValueSet(a)?(this.currentRequest=Zs(d=>this.editorWorkerService.navigateValueSet(a,r,t)),this.currentRequest.then(d=>{var v;if(!d||!d.range||!d.value||!o.validate(this.editor))return;const h=W.lift(d.range);let f=d.range;const p=d.value.length-(r.endColumn-r.startColumn);f={startLineNumber:f.startLineNumber,startColumn:f.startColumn,endLineNumber:f.endLineNumber,endColumn:f.startColumn+d.value.length},p>1&&(r=new ot(r.startLineNumber,r.startColumn,r.endLineNumber,r.endColumn+p-1));const m=new rlt(h,r,d.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,m),this.editor.pushUndoStop(),this.decorations.set([{range:f,options:SF.DECORATION}]),(v=this.decorationRemover)==null||v.cancel(),this.decorationRemover=Rg(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(Tt)}).catch(Tt)):Promise.resolve(void 0)}},SF=jm,jm.ID="editor.contrib.inPlaceReplaceController",jm.DECORATION=Ot.register({description:"in-place-replace",className:"valueSetReplacement"}),jm);lx=SF=olt([alt(1,Na)],lx);class llt extends Ze{constructor(){super({id:"editor.action.inPlaceReplace.up",label:w("InPlaceReplaceAction.previous.label","Replace with Previous Value"),alias:"Replace with Previous Value",precondition:U.writable,kbOpts:{kbExpr:U.editorTextFocus,primary:3159,weight:100}})}run(e,t){const i=lx.get(t);return i?i.run(this.id,!1):Promise.resolve(void 0)}}class clt extends Ze{constructor(){super({id:"editor.action.inPlaceReplace.down",label:w("InPlaceReplaceAction.next.label","Replace with Next Value"),alias:"Replace with Next Value",precondition:U.writable,kbOpts:{kbExpr:U.editorTextFocus,primary:3161,weight:100}})}run(e,t){const i=lx.get(t);return i?i.run(this.id,!0):Promise.resolve(void 0)}}gi(lx.ID,lx,4);Pe(llt);Pe(clt);class dlt extends Ze{constructor(){super({id:"expandLineSelection",label:w("expandLineSelection","Expand Line Selection"),alias:"Expand Line Selection",precondition:void 0,kbOpts:{weight:0,kbExpr:U.textInputFocus,primary:2090}})}run(e,t,i){if(i=i||{},!t.hasModel())return;const n=t._getViewModel();n.model.pushStackElement(),n.setCursorStates(i.source,3,vr.expandLineSelection(n,n.getCursorStates())),n.revealAllCursors(i.source,!0)}}Pe(dlt);class ult{constructor(e,t,i){this._selection=e,this._cursors=t,this._selectionId=null,this._trimInRegexesAndStrings=i}getEditOperations(e,t){const i=hlt(e,this._cursors,this._trimInRegexesAndStrings);for(let n=0,r=i.length;n<r;n++){const o=i[n];t.addEditOperation(o.range,o.text)}this._selectionId=t.trackSelection(this._selection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}function hlt(s,e,t){e.sort((a,l)=>a.lineNumber===l.lineNumber?a.column-l.column:a.lineNumber-l.lineNumber);for(let a=e.length-2;a>=0;a--)e[a].lineNumber===e[a+1].lineNumber&&e.splice(a,1);const i=[];let n=0,r=0;const o=e.length;for(let a=1,l=s.getLineCount();a<=l;a++){const d=s.getLineContent(a),h=d.length+1;let f=0;if(r<o&&e[r].lineNumber===a&&(f=e[r].column,r++,f===h)||d.length===0)continue;const p=Du(d);let m=0;if(p===-1)m=1;else if(p!==d.length-1)m=p+2;else continue;if(!t){if(!s.tokenization.hasAccurateTokensForLine(a))continue;const v=s.tokenization.getLineTokens(a),b=v.getStandardTokenType(v.findTokenIndexAtOffset(m));if(b===2||b===3)continue}m=Math.max(f,m),i[n++]=Pn.delete(new W(a,m,a,h))}return i}class USe{constructor(e,t,i){this._selection=e,this._isCopyingDown=t,this._noop=i||!1,this._selectionDirection=0,this._selectionId=null,this._startLineNumberDelta=0,this._endLineNumberDelta=0}getEditOperations(e,t){let i=this._selection;this._startLineNumberDelta=0,this._endLineNumberDelta=0,i.startLineNumber<i.endLineNumber&&i.endColumn===1&&(this._endLineNumberDelta=1,i=i.setEndPosition(i.endLineNumber-1,e.getLineMaxColumn(i.endLineNumber-1)));const n=[];for(let o=i.startLineNumber;o<=i.endLineNumber;o++)n.push(e.getLineContent(o));const r=n.join(`
|
|
918
|
+
}`}))),this._register(this._configurationService.onDidChangeConfiguration(p=>{p.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"),i=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let n;!t&&i&&this.editor.getOption(150)&&(n=w("showAccessibleViewHint","Inspect this in the accessible view ({0})",i.getAriaLabel())),Qo(n?e+", "+n:e)}shouldShowHoverAt(e){var i;const t=(i=this.model.get())==null?void 0:i.primaryGhostText.get();return t?t.parts.some(n=>e.containsPosition(new ie(t.lineNumber,n.column))):!1}shouldShowHoverAtViewZone(e){var t;return((t=this._ghostTextWidgets.get()[0])==null?void 0:t.ownsViewZone(e))??!1}},CX=CC,CC.ID="editor.contrib.inlineCompletionsController",CC);Vc=CX=cat([Of(1,ut),Of(2,yt),Of(3,Gt),Of(4,on),Of(5,sc),Of(6,it),Of(7,I_),Of(8,Mi),Of(9,pl)],Vc);function dat(s,e){const t=Kt("result",[]),i=[];return e.add(Et(n=>{const r=s.read(n);On(o=>{if(r.length!==i.length){i.length=r.length;for(let a=0;a<i.length;a++)i[a]||(i[a]=Kt("item",r[a]));t.set([...i],o)}i.forEach((a,l)=>a.set(r[l],o))})})),t}const aW=class aW extends Ze{constructor(){super({id:aW.ID,label:w("action.inlineSuggest.showNext","Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:ve.and(U.writable,cl.inlineSuggestionVisible),kbOpts:{weight:100,primary:606}})}async run(e,t){var n;const i=Vc.get(t);(n=i==null?void 0:i.model.get())==null||n.next()}};aW.ID=Y0e;let yX=aW;const lW=class lW extends Ze{constructor(){super({id:lW.ID,label:w("action.inlineSuggest.showPrevious","Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:ve.and(U.writable,cl.inlineSuggestionVisible),kbOpts:{weight:100,primary:604}})}async run(e,t){var n;const i=Vc.get(t);(n=i==null?void 0:i.model.get())==null||n.previous()}};lW.ID=G0e;let wX=lW;class uat extends Ze{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:w("action.inlineSuggest.trigger","Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:U.writable})}async run(e,t){const i=Vc.get(t);await sye(async n=>{var r;await((r=i==null?void 0:i.model.get())==null?void 0:r.triggerExplicitly(n)),i==null||i.playAccessibilitySignal(n)})}}class hat extends Ze{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:ve.and(U.writable,cl.inlineSuggestionVisible),kbOpts:{weight:101,primary:2065,kbExpr:ve.and(U.writable,cl.inlineSuggestionVisible)},menuOpts:[{menuId:st.InlineSuggestionToolbar,title:w("acceptWord","Accept Word"),group:"primary",order:2}]})}async run(e,t){var n;const i=Vc.get(t);await((n=i==null?void 0:i.model.get())==null?void 0:n.acceptNextWord(i.editor))}}class fat extends Ze{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:ve.and(U.writable,cl.inlineSuggestionVisible),kbOpts:{weight:101},menuOpts:[{menuId:st.InlineSuggestionToolbar,title:w("acceptLine","Accept Line"),group:"secondary",order:2}]})}async run(e,t){var n;const i=Vc.get(t);await((n=i==null?void 0:i.model.get())==null?void 0:n.acceptNextLine(i.editor))}}class gat extends Ze{constructor(){super({id:K0e,label:w("action.inlineSuggest.accept","Accept Inline Suggestion"),alias:"Accept Inline Suggestion",precondition:cl.inlineSuggestionVisible,menuOpts:[{menuId:st.InlineSuggestionToolbar,title:w("accept","Accept"),group:"primary",order:1}],kbOpts:{primary:2,weight:200,kbExpr:ve.and(cl.inlineSuggestionVisible,U.tabMovesFocus.toNegated(),cl.inlineSuggestionHasIndentationLessThanTabSize,jt.Visible.toNegated(),U.hoverFocused.toNegated())}})}async run(e,t){var n;const i=Vc.get(t);i&&((n=i.model.get())==null||n.accept(i.editor),i.editor.focus())}}const cW=class cW extends Ze{constructor(){super({id:cW.ID,label:w("action.inlineSuggest.hide","Hide Inline Suggestion"),alias:"Hide Inline Suggestion",precondition:cl.inlineSuggestionVisible,kbOpts:{weight:100,primary:9}})}async run(e,t){const i=Vc.get(t);On(n=>{var r;(r=i==null?void 0:i.model.get())==null||r.stop(n)})}};cW.ID="editor.action.inlineSuggest.hide";let SX=cW;const dW=class dW extends ea{constructor(){super({id:dW.ID,title:w("action.inlineSuggest.alwaysShowToolbar","Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:st.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:ve.equals("config.editor.inlineSuggest.showToolbar","always")})}async run(e,t){const i=e.get(Gt),r=i.getValue("editor.inlineSuggest.showToolbar")==="always"?"onHover":"always";i.updateValue("editor.inlineSuggest.showToolbar",r)}};dW.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar";let xX=dW;var pat=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},CD=function(s,e){return function(t,i){e(t,i,s)}};class mat{constructor(e,t,i){this.owner=e,this.range=t,this.controller=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let kX=class{constructor(e,t,i,n,r,o){this._editor=e,this._languageService=t,this._openerService=i,this.accessibilityService=n,this._instantiationService=r,this._telemetryService=o,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=Vc.get(this._editor);if(!t)return null;const i=e.target;if(i.type===8){const n=i.detail;if(t.shouldShowHoverAtViewZone(n.viewZoneId))return new vF(1e3,this,W.fromPositions(this._editor.getModel().validatePosition(n.positionBefore||n.position)),e.event.posx,e.event.posy,!1)}return i.type===7&&t.shouldShowHoverAt(i.range)?new vF(1e3,this,i.range,e.event.posx,e.event.posy,!1):i.type===6&&i.detail.mightBeForeignElement&&t.shouldShowHoverAt(i.range)?new vF(1e3,this,i.range,e.event.posx,e.event.posy,!1):null}computeSync(e,t){if(this._editor.getOption(62).showToolbar!=="onHover")return[];const i=Vc.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new mat(this,e.range,i)]:[]}renderHoverParts(e,t){const i=new me,n=t[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(8)&&i.add(this.renderScreenReaderText(e,n));const r=n.controller.model.get(),o=this._instantiationService.createInstance(tx,this._editor,!1,Tc(null),r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.activeCommands),a=o.getDomNode();e.fragment.appendChild(a),r.triggerExplicitly(),i.add(o);const l={hoverPart:n,hoverElement:a,dispose(){i.dispose()}};return new fy([l])}renderScreenReaderText(e,t){const i=new me,n=Fe,r=n("div.hover-row.markdown-hover"),o=Ee(r,n("div.hover-contents",{"aria-live":"assertive"})),a=i.add(new Ag({editor:this._editor},this._languageService,this._openerService)),l=d=>{i.add(a.onDidRenderAsync(()=>{o.className="hover-contents code-hover-contents",e.onContentsChanged()}));const h=w("inlineSuggestionFollows","Suggestion:"),f=i.add(a.render(new eo().appendText(h).appendCodeblock("text",d)));o.replaceChildren(f.element)};return i.add(Et(d=>{var f;const h=(f=t.controller.model.read(d))==null?void 0:f.primaryGhostText.read(d);if(h){const p=this._editor.getModel().getLineContent(h.lineNumber);l(h.renderForScreenReader(p))}else xr(o)})),e.fragment.appendChild(r),i}};kX=pat([CD(1,Nn),CD(2,Ta),CD(3,pl),CD(4,ut),CD(5,so)],kX);class _at{}const VV=new class{constructor(){this._implementations=[]}register(e){return this._implementations.push(e),{dispose:()=>{const t=this._implementations.indexOf(e);t!==-1&&this._implementations.splice(t,1)}}}getImplementations(){return this._implementations}};gi(Vc.ID,Vc,3);Pe(uat);Pe(yX);Pe(wX);Pe(hat);Pe(fat);Pe(gat);Pe(SX);sn(xX);$y.register(kX);VV.register(new _at);var vat=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},wj=function(s,e){return function(t,i){e(t,i,s)}},UD,zm;let MT=(zm=class{constructor(e,t,i,n){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=n,this.toUnhook=new me,this.toUnhookForKeyboard=new me,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const r=new RV(e);this.toUnhook.add(r),this.toUnhook.add(r.onMouseMoveOrRelevantKeyDown(([o,a])=>{this.startFindDefinitionFromMouse(o,a??void 0)})),this.toUnhook.add(r.onExecute(o=>{this.isEnabled(o)&&this.gotoDefinition(o.target.position,o.hasSideBySideModifier).catch(a=>{Tt(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(r.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(UD.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 i=e.target.position;this.startFindDefinition(i)}async startFindDefinition(e){var o;this.toUnhookForKeyboard.clear();const t=e?(o=this.editor.getModel())==null?void 0:o.getWordAtPosition(e):null;if(!t){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===t.startColumn&&this.currentWordAtPosition.endColumn===t.endColumn&&this.currentWordAtPosition.word===t.word)return;this.currentWordAtPosition=t;const i=new N1e(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=Zs(a=>this.findDefinition(e,a));let n;try{n=await this.previousPromise}catch(a){Tt(a);return}if(!n||!n.length||!i.validate(this.editor)){this.removeLinkDecorations();return}const r=n[0].originSelectionRange?W.lift(n[0].originSelectionRange):new W(e.lineNumber,t.startColumn,e.lineNumber,t.endColumn);if(n.length>1){let a=r;for(const{originSelectionRange:l}of n)l&&(a=W.plusRange(a,l));this.addDecoration(a,new eo().appendText(w("multipleResults","Click to show {0} definitions.",n.length)))}else{const a=n[0];if(!a.uri)return;this.textModelResolverService.createModelReference(a.uri).then(l=>{if(!l.object||!l.object.textEditorModel){l.dispose();return}const{object:{textEditorModel:d}}=l,{startLineNumber:h}=a.range;if(h<1||h>d.getLineCount()){l.dispose();return}const f=this.getPreviewValue(d,h,a),p=this.languageService.guessLanguageIdByFilepathOrFirstLine(d.uri);this.addDecoration(r,f?new eo().appendCodeblock(p||"",f):void 0),l.dispose()})}}getPreviewValue(e,t,i){let n=i.range;return n.endLineNumber-n.startLineNumber>=UD.MAX_SOURCE_PREVIEW_LINES&&(n=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,n)}stripIndentationFromPreviewRange(e,t,i){let r=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a<i.endLineNumber;a++){const l=e.getLineFirstNonWhitespaceColumn(a);r=Math.min(r,l)}return e.getValueInRange(i).replace(new RegExp(`^\\s{${r-1}}`,"gm"),"").trim()}getPreviewRangeBasedOnIndentation(e,t){const i=e.getLineFirstNonWhitespaceColumn(t),n=Math.min(e.getLineCount(),t+UD.MAX_SOURCE_PREVIEW_LINES);let r=t+1;for(;r<n;r++){const o=e.getLineFirstNonWhitespaceColumn(r);if(i===o)break}return new W(t,1,r+1,1)}addDecoration(e,t){const i={range:e,options:{description:"goto-definition-link",inlineClassName:"goto-definition-link",hoverMessage:t}};this.linkDecorations.set([i])}removeLinkDecorations(){this.linkDecorations.clear()}isEnabled(e,t){var i;return this.editor.hasModel()&&e.isLeftClick&&e.isNoneOrSingleMouseDown&&e.target.type===6&&!(((i=e.target.detail.injectedText)==null?void 0:i.options)instanceof h_)&&(e.hasTriggerModifier||(t?t.keyCodeIsTriggerKey:!1))&&this.languageFeaturesService.definitionProvider.has(this.editor.getModel())}findDefinition(e,t){const i=this.editor.getModel();return i?$N(this.languageFeaturesService.definitionProvider,i,e,!1,t):Promise.resolve(null)}gotoDefinition(e,t){return this.editor.setPosition(e),this.editor.invokeWithinContext(i=>{const n=!t&&this.editor.getOption(89)&&!this.isInPeekEditor(i);return new jN({openToSide:t,openInPeek:n,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(yt);return ka.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}},UD=zm,zm.ID="editor.contrib.gotodefinitionatposition",zm.MAX_SOURCE_PREVIEW_LINES=8,zm);MT=UD=vat([wj(1,Ea),wj(2,Nn),wj(3,it)],MT);gi(MT.ID,MT,2);var HSe=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},P3=function(s,e){return function(t,i){e(t,i,s)}};class qge{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let LX=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new se,this.onDidChange=this._onDidChange.event,this._dispoables=new me,this._markers=[],this._nextIdx=-1,gt.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const n=this._configService.getValue("problems.sortOrder"),r=(a,l)=>{let d=yI(a.resource.toString(),l.resource.toString());return d===0&&(n==="position"?d=W.compareRangesUsingStarts(a,l)||Kn.compare(a.severity,l.severity):d=Kn.compare(a.severity,l.severity)||W.compareRangesUsingStarts(a,l)),d},o=()=>{this._markers=this._markerService.read({resource:gt.isUri(e)?e:void 0,severities:Kn.Error|Kn.Warning|Kn.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(r)};o(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(l=>this._resourceFilter(l)))&&(o(),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 qge(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let n=!1,r=this._markers.findIndex(o=>o.resource.toString()===e.uri.toString());r<0&&(r=hI(this._markers,{resource:e.uri},(o,a)=>yI(o.resource.toString(),a.resource.toString())),r<0&&(r=~r));for(let o=r;o<this._markers.length;o++){let a=W.lift(this._markers[o]);if(a.isEmpty()){const l=e.getWordAtPosition(a.getStartPosition());l&&(a=new W(a.startLineNumber,l.startColumn,a.startLineNumber,l.endColumn))}if(t&&(a.containsPosition(t)||t.isBeforeOrEqual(a.getStartPosition()))){this._nextIdx=o,n=!0;break}if(this._markers[o].resource.toString()!==e.uri.toString())break}n||(this._nextIdx=i?0:this._markers.length-1),this._nextIdx<0&&(this._nextIdx=this._markers.length-1)}resetIndex(){this._nextIdx=-1}move(e,t,i){if(this._markers.length===0)return!1;const n=this._nextIdx;return this._nextIdx===-1?this._initIdx(t,i,e):e?this._nextIdx=(this._nextIdx+1)%this._markers.length:e||(this._nextIdx=(this._nextIdx-1+this._markers.length)%this._markers.length),n!==this._nextIdx}find(e,t){let i=this._markers.findIndex(n=>n.resource.toString()===e.toString());if(!(i<0)){for(;i<this._markers.length;i++)if(W.containsPosition(this._markers[i],t))return new qge(this._markers[i],i+1,this._markers.length)}}};LX=HSe([P3(1,uf),P3(2,Gt)],LX);const VSe=ii("IMarkerNavigationService");let DX=class{constructor(e,t){this._markerService=e,this._configService=t,this._provider=new Vo}getMarkerList(e){for(const t of this._provider){const i=t.getMarkerList(e);if(i)return i}return new LX(e,this._markerService,this._configService)}};DX=HSe([P3(0,uf),P3(1,Gt)],DX);li(VSe,DX,1);var EX;(function(s){function e(t){switch(t){case fs.Ignore:return"severity-ignore "+bt.asClassName(Oe.info);case fs.Info:return bt.asClassName(Oe.info);case fs.Warning:return bt.asClassName(Oe.warning);case fs.Error:return bt.asClassName(Oe.error);default:return""}}s.className=e})(EX||(EX={}));var bat=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},A1=function(s,e){return function(t,i){e(t,i,s)}},IX;class Cat{constructor(e,t,i,n,r){this._openerService=n,this._labelService=r,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new me,this._editor=t;const o=document.createElement("div");o.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),o.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),o.appendChild(this._relatedBlock),this._disposables.add(Hn(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new TCe(o,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{o.style.left=`-${a.scrollLeft}px`,o.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){Xi(this._disposables)}update(e){const{source:t,message:i,relatedInformation:n,code:r}=e;let o=((t==null?void 0:t.length)||0)+2;r&&(typeof r=="string"?o+=r.length:o+=r.value.length);const a=of(i);this._lines=a.length,this._longestLineLength=0;for(const p of a)this._longestLineLength=Math.max(p.length+o,this._longestLineLength);Sr(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const p of a)l=document.createElement("div"),l.innerText=p,p===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||r){const p=document.createElement("span");if(p.classList.add("details"),l.appendChild(p),t){const m=document.createElement("span");m.innerText=t,m.classList.add("source"),p.appendChild(m)}if(r)if(typeof r=="string"){const m=document.createElement("span");m.innerText=`(${r})`,m.classList.add("code"),p.appendChild(m)}else{this._codeLink=Fe("a.code-link"),this._codeLink.setAttribute("href",`${r.target.toString()}`),this._codeLink.onclick=v=>{this._openerService.open(r.target,{allowCommands:!0}),v.preventDefault(),v.stopPropagation()};const m=Ee(this._codeLink,Fe("span"));m.innerText=r.value,p.appendChild(this._codeLink)}}if(Sr(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),So(n)){const p=this._relatedBlock.appendChild(document.createElement("div"));p.style.paddingTop=`${Math.floor(this._editor.getOption(67)*.66)}px`,this._lines+=1;for(const m of n){const v=document.createElement("div"),b=document.createElement("a");b.classList.add("filename"),b.innerText=`${this._labelService.getUriBasenameLabel(m.resource)}(${m.startLineNumber}, ${m.startColumn}): `,b.title=this._labelService.getUriLabel(m.resource),this._relatedDiagnostics.set(b,m);const y=document.createElement("span");y.innerText=m.message,v.appendChild(b),v.appendChild(y),this._lines+=1,p.appendChild(v)}}const d=this._editor.getOption(50),h=Math.ceil(d.typicalFullwidthCharacterWidth*this._longestLineLength*.75),f=d.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:h,scrollHeight:f})}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 Kn.Error:t=w("Error","Error");break;case Kn.Warning:t=w("Warning","Warning");break;case Kn.Info:t=w("Info","Info");break;case Kn.Hint:t=w("Hint","Hint");break}let i=w("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const n=this._editor.getModel();return n&&e.startLineNumber<=n.getLineCount()&&e.startLineNumber>=1&&(i=`${n.getLineContent(e.startLineNumber)}, ${i}`),i}}var yC;let RT=(yC=class extends u3{constructor(e,t,i,n,r,o,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},r),this._themeService=t,this._openerService=i,this._menuService=n,this._contextKeyService=o,this._labelService=a,this._callOnDispose=new me,this._onDidSelectRelatedInformation=new se,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=Kn.Warning,this._backgroundColor=be.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(xat);let t=TX,i=yat;this._severity===Kn.Warning?(t=wF,i=wat):this._severity===Kn.Info&&(t=NX,i=Sat);const n=e.getColor(t),r=e.getColor(i);this.style({arrowColor:n,frameColor:n,headerBackgroundColor:r,primaryHeadingColor:e.getColor(rSe),secondaryHeadingColor:e.getColor(oSe)})}_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(n=>this.editor.focus()));const t=[],i=this._menuService.getMenuActions(IX.TitleMenu,this._contextKeyService);nV(i,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0})}_fillTitleIcon(e){this._icon=Ee(e,Fe(""))}_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 Cat(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,i){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const n=W.lift(e),r=this.editor.getPosition(),o=r&&n.containsPosition(r)?r:n.getStartPosition();super.show(o,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=i>1?w("problems","{0} of {1} problems",t,i):w("change","{0} of {1} problem",t,i);this.setTitle(Wc(a.uri),l)}this._icon.className=`codicon ${EX.className(Kn.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(o,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()}},IX=yC,yC.TitleMenu=new st("gotoErrorTitleMenu"),yC);RT=IX=bat([A1(1,zs),A1(2,Ta),A1(3,nc),A1(4,ut),A1(5,yt),A1(6,HS)],RT);const Kge=MI(WH,pVe),Gge=MI(Og,RI),Yge=MI(Qh,PI),TX=q("editorMarkerNavigationError.background",{dark:Kge,light:Kge,hcDark:fi,hcLight:fi},w("editorMarkerNavigationError","Editor marker navigation widget error color.")),yat=q("editorMarkerNavigationError.headerBackground",{dark:Ut(TX,.1),light:Ut(TX,.1),hcDark:null,hcLight:null},w("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),wF=q("editorMarkerNavigationWarning.background",{dark:Gge,light:Gge,hcDark:fi,hcLight:fi},w("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),wat=q("editorMarkerNavigationWarning.headerBackground",{dark:Ut(wF,.1),light:Ut(wF,.1),hcDark:"#0C141F",hcLight:Ut(wF,.2)},w("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),NX=q("editorMarkerNavigationInfo.background",{dark:Yge,light:Yge,hcDark:fi,hcLight:fi},w("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),Sat=q("editorMarkerNavigationInfo.headerBackground",{dark:Ut(NX,.1),light:Ut(NX,.1),hcDark:null,hcLight:null},w("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),xat=q("editorMarkerNavigation.background",Md,w("editorMarkerNavigationBackground","Editor marker navigation widget background."));var kat=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},w2=function(s,e){return function(t,i){e(t,i,s)}},qD,wC;let my=(wC=class{static get(e){return e.getContribution(qD.ID)}constructor(e,t,i,n,r){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=n,this._instantiationService=r,this._sessionDispoables=new me,this._editor=e,this._widgetVisible=$Se.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(RT,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(i=>{var n,r,o;(!((n=this._model)!=null&&n.selected)||!W.containsPosition((r=this._model)==null?void 0:r.selected.marker,i.position))&&((o=this._model)==null||o.resetIndex())})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const i=this._model.find(this._editor.getModel().uri,this._widget.position);i?this._widget.updateMarker(i.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(i=>{this._editorService.openCodeEditor({resource:i.resource,options:{pinned:!0,revealIfOpened:!0,selection:W.lift(i).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 ie(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}async nagivate(e,t){var i,n;if(this._editor.hasModel()){const r=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(r.move(e,this._editor.getModel(),this._editor.getPosition()),!r.selected)return;if(r.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const o=await this._editorService.openCodeEditor({resource:r.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:r.selected.marker}},this._editor);o&&((i=qD.get(o))==null||i.close(),(n=qD.get(o))==null||n.nagivate(e,t))}else this._widget.showAtMarker(r.selected.marker,r.selected.index,r.selected.total)}}},qD=wC,wC.ID="editor.contrib.markerController",wC);my=qD=kat([w2(1,VSe),w2(2,yt),w2(3,yi),w2(4,ut)],my);class $V extends Ze{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}async run(e,t){var i;t.hasModel()&&((i=my.get(t))==null||i.nagivate(this._next,this._multiFile))}}const mb=class mb extends $V{constructor(){super(!0,!1,{id:mb.ID,label:mb.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:U.focus,primary:578,weight:100},menuOpts:{menuId:RT.TitleMenu,title:mb.LABEL,icon:mn("marker-navigation-next",Oe.arrowDown,w("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}};mb.ID="editor.action.marker.next",mb.LABEL=w("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");let O3=mb;const _b=class _b extends $V{constructor(){super(!1,!1,{id:_b.ID,label:_b.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:U.focus,primary:1602,weight:100},menuOpts:{menuId:RT.TitleMenu,title:_b.LABEL,icon:mn("marker-navigation-previous",Oe.arrowUp,w("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}};_b.ID="editor.action.marker.prev",_b.LABEL=w("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");let MX=_b;class Lat extends $V{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:U.focus,primary:66,weight:100},menuOpts:{menuId:st.MenubarGoMenu,title:w({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class Dat extends $V{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:U.focus,primary:1090,weight:100},menuOpts:{menuId:st.MenubarGoMenu,title:w({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}gi(my.ID,my,4);Pe(O3);Pe(MX);Pe(Lat);Pe(Dat);const $Se=new qe("markersNavigationVisible",!1),Eat=$s.bindToContribution(my.get);Ue(new Eat({id:"closeMarkersNavigation",precondition:$Se,handler:s=>s.close(),kbOpts:{weight:150,kbExpr:U.focus,primary:9,secondary:[1033]}}));var ru;(function(s){s.NoAutoFocus="noAutoFocus",s.FocusIfVisible="focusIfVisible",s.AutoFocusImmediately="autoFocusImmediately"})(ru||(ru={}));class Iat extends Ze{constructor(){super({id:q0e,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:kt("showOrFocusHoverDescription","Show or focus the editor hover which shows documentation, references, and other content for a symbol at the current cursor position."),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:[ru.NoAutoFocus,ru.FocusIfVisible,ru.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:ru.FocusIfVisible}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:Ls(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const n=ko.get(t);if(!n)return;const r=i==null?void 0:i.focus;let o=ru.FocusIfVisible;Object.values(ru).includes(r)?o=r:typeof r=="boolean"&&r&&(o=ru.AutoFocusImmediately);const a=d=>{const h=t.getPosition(),f=new W(h.lineNumber,h.column,h.lineNumber,h.column);n.showContentHover(f,1,1,d)},l=t.getOption(2)===2;n.isHoverVisible?o!==ru.NoAutoFocus?n.focus():a(l):a(l||o===ru.AutoFocusImmediately)}}class Tat extends Ze{constructor(){super({id:Kit,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,metadata:{description:kt("showDefinitionPreviewHoverDescription","Show the definition preview hover in the editor.")}})}run(e,t){const i=ko.get(t);if(!i)return;const n=t.getPosition();if(!n)return;const r=new W(n.lineNumber,n.column,n.lineNumber,n.column),o=MT.get(t);if(!o)return;o.startFindDefinitionFromCursor(n).then(()=>{i.showContentHover(r,1,1,!0)})}}class Nat extends Ze{constructor(){super({id:Git,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:U.hoverFocused,kbOpts:{kbExpr:U.hoverFocused,primary:16,weight:100},metadata:{description:kt("scrollUpHoverDescription","Scroll up the editor hover.")}})}run(e,t){const i=ko.get(t);i&&i.scrollUp()}}class Mat extends Ze{constructor(){super({id:Yit,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:U.hoverFocused,kbOpts:{kbExpr:U.hoverFocused,primary:18,weight:100},metadata:{description:kt("scrollDownHoverDescription","Scroll down the editor hover.")}})}run(e,t){const i=ko.get(t);i&&i.scrollDown()}}class Rat extends Ze{constructor(){super({id:Zit,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:U.hoverFocused,kbOpts:{kbExpr:U.hoverFocused,primary:15,weight:100},metadata:{description:kt("scrollLeftHoverDescription","Scroll left the editor hover.")}})}run(e,t){const i=ko.get(t);i&&i.scrollLeft()}}class Pat extends Ze{constructor(){super({id:Xit,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:U.hoverFocused,kbOpts:{kbExpr:U.hoverFocused,primary:17,weight:100},metadata:{description:kt("scrollRightHoverDescription","Scroll right the editor hover.")}})}run(e,t){const i=ko.get(t);i&&i.scrollRight()}}class Oat extends Ze{constructor(){super({id:Qit,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:U.hoverFocused,kbOpts:{kbExpr:U.hoverFocused,primary:11,secondary:[528],weight:100},metadata:{description:kt("pageUpHoverDescription","Page up the editor hover.")}})}run(e,t){const i=ko.get(t);i&&i.pageUp()}}class Aat extends Ze{constructor(){super({id:Jit,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:U.hoverFocused,kbOpts:{kbExpr:U.hoverFocused,primary:12,secondary:[530],weight:100},metadata:{description:kt("pageDownHoverDescription","Page down the editor hover.")}})}run(e,t){const i=ko.get(t);i&&i.pageDown()}}class Fat extends Ze{constructor(){super({id:ent,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:U.hoverFocused,kbOpts:{kbExpr:U.hoverFocused,primary:14,secondary:[2064],weight:100},metadata:{description:kt("goToTopHoverDescription","Go to the top of the editor hover.")}})}run(e,t){const i=ko.get(t);i&&i.goToTop()}}class Bat extends Ze{constructor(){super({id:tnt,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:U.hoverFocused,kbOpts:{kbExpr:U.hoverFocused,primary:13,secondary:[2066],weight:100},metadata:{description:kt("goToBottomHoverDescription","Go to the bottom of the editor hover.")}})}run(e,t){const i=ko.get(t);i&&i.goToBottom()}}class Wat extends Ze{constructor(){super({id:TV,label:int,alias:"Increase Hover Verbosity Level",precondition:U.hoverVisible})}run(e,t,i){const n=ko.get(t);if(!n)return;const r=(i==null?void 0:i.index)!==void 0?i.index:n.focusedHoverPartIndex();n.updateHoverVerbosityLevel(Xa.Increase,r,i==null?void 0:i.focus)}}class Hat extends Ze{constructor(){super({id:NV,label:nnt,alias:"Decrease Hover Verbosity Level",precondition:U.hoverVisible})}run(e,t,i){var o;const n=ko.get(t);if(!n)return;const r=(i==null?void 0:i.index)!==void 0?i.index:n.focusedHoverPartIndex();(o=ko.get(t))==null||o.updateHoverVerbosityLevel(Xa.Decrease,r,i==null?void 0:i.focus)}}var Vat=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Sj=function(s,e){return function(t,i){e(t,i,s)}};const ld=Fe;class $at{constructor(e,t,i){this.owner=e,this.range=t,this.marker=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const Zge={type:1,filter:{include:bn.QuickFix},triggerAction:fl.QuickFixHover};let RX=class{constructor(e,t,i,n){this._editor=e,this._markerDecorationsService=t,this._openerService=i,this._languageFeaturesService=n,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1&&!e.supportsMarkerHover)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,r=i.getLineMaxColumn(n),o=[];for(const a of t){const l=a.range.startLineNumber===n?a.range.startColumn:1,d=a.range.endLineNumber===n?a.range.endColumn:r,h=this._markerDecorationsService.getMarker(i.uri,a);if(!h)continue;const f=new W(e.range.startLineNumber,l,e.range.startLineNumber,d);o.push(new $at(this,f,h))}return o}renderHoverParts(e,t){if(!t.length)return new fy([]);const i=new me,n=[];t.forEach(o=>{const a=this._renderMarkerHover(o);e.fragment.appendChild(a.hoverElement),n.push(a)});const r=t.length===1?t[0]:t.sort((o,a)=>Kn.compare(o.marker.severity,a.marker.severity))[0];return this.renderMarkerStatusbar(e,r,i),new fy(n)}_renderMarkerHover(e){const t=new me,i=ld("div.hover-row"),n=Ee(i,ld("div.marker.hover-contents")),{source:r,message:o,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(n);const d=Ee(n,ld("span"));if(d.style.whiteSpace="pre-wrap",d.innerText=o,r||a)if(a&&typeof a!="string"){const f=ld("span");if(r){const b=Ee(f,ld("span"));b.innerText=r}const p=Ee(f,ld("a.code-link"));p.setAttribute("href",a.target.toString()),t.add(ue(p,"click",b=>{this._openerService.open(a.target,{allowCommands:!0}),b.preventDefault(),b.stopPropagation()}));const m=Ee(p,ld("span"));m.innerText=a.value;const v=Ee(n,f);v.style.opacity="0.6",v.style.paddingLeft="6px"}else{const f=Ee(n,ld("span"));f.style.opacity="0.6",f.style.paddingLeft="6px",f.innerText=r&&a?`${r}(${a})`:r||`(${a})`}if(So(l))for(const{message:f,resource:p,startLineNumber:m,startColumn:v}of l){const b=Ee(n,ld("div"));b.style.marginTop="8px";const y=Ee(b,ld("a"));y.innerText=`${Wc(p)}(${m}, ${v}): `,y.style.cursor="pointer",t.add(ue(y,"click",D=>{if(D.stopPropagation(),D.preventDefault(),this._openerService){const S={selection:{startLineNumber:m,startColumn:v}};this._openerService.open(p,{fromUserGesture:!0,editorOptions:S}).catch(Tt)}}));const x=Ee(b,ld("span"));x.innerText=f,this._editor.applyFontInfo(x)}return{hoverPart:e,hoverElement:i,dispose:()=>t.dispose()}}renderMarkerStatusbar(e,t,i){if(t.marker.severity===Kn.Error||t.marker.severity===Kn.Warning||t.marker.severity===Kn.Info){const n=my.get(this._editor);n&&e.statusBar.addAction({label:w("view problem","View Problem"),commandId:O3.ID,run:()=>{e.hide(),n.showAtMarker(t.marker),this._editor.focus()}})}if(!this._editor.getOption(92)){const n=e.statusBar.append(ld("div"));this.recentMarkerCodeActionsInfo&&(n5.makeKey(this.recentMarkerCodeActionsInfo.marker)===n5.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(n.textContent=w("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const r=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?re.None:r_(()=>n.textContent=w("checkingForQuickFixes","Checking for quick fixes..."),200,i);n.textContent||(n.textContent=" ");const o=this.getCodeActions(t.marker);i.add(dt(()=>o.cancel())),o.then(a=>{if(r.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),n.textContent=w("noQuickFixes","No quick fixes available");return}n.style.display="none";let l=!1;i.add(dt(()=>{l||a.dispose()})),e.statusBar.addAction({label:w("quick fixes","Quick Fix..."),commandId:ine,run:d=>{l=!0;const h=JS.get(this._editor),f=ts(d);e.hide(),h==null||h.showCodeActions(Zge,a,{x:f.left,y:f.top,width:f.width,height:f.height})}})},Tt)}}getCodeActions(e){return Zs(t=>p0(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new W(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),Zge,wu.None,t))}};RX=Vat([Sj(1,Ete),Sj(2,Ta),Sj(3,it)],RX);class zat{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=Td.Center}computeSync(){var r;const e=o=>({value:o}),t=this._editor.getLineDecorations(this._lineNumber),i=[],n=this._laneOrLine==="lineNo";if(!t)return i;for(const o of t){const a=((r=o.options.glyphMargin)==null?void 0:r.position)??Td.Center;if(!n&&a!==this._laneOrLine)continue;const l=n?o.options.lineNumberHoverMessage:o.options.glyphMarginHoverMessage;!l||BS(l)||i.push(...ree(l).map(e))}return i}}var jat=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Xge=function(s,e){return function(t,i){e(t,i,s)}},PX;const Qge=Fe;var SC;let OX=(SC=class extends re{constructor(e,t,i){super(),this._renderDisposeables=this._register(new me),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new ote),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new Ag({editor:this._editor},t,i)),this._computer=new zat(this._editor),this._hoverOperation=this._register(new Z0e(this._editor,this._computer)),this._register(this._hoverOperation.onResult(n=>{this._withResult(n.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(50)&&this._updateFont()})),this._register(Hn(this._hover.containerDomNode,"mouseleave",n=>{this._onMouseLeave(n)})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return PX.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))}showsOrWillShow(e){const t=e.target;return t.type===2&&t.detail.glyphMarginLane?(this._startShowingAt(t.position.lineNumber,t.detail.glyphMarginLane),!0):t.type===3?(this._startShowingAt(t.position.lineNumber,"lineNo"),!0):!1}_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 i=document.createDocumentFragment();for(const n of t){const r=Qge("div.hover-row.markdown-hover"),o=Ee(r,Qge("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(n.value));o.appendChild(a.element),i.appendChild(r)}this._updateContents(i),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(),i=this._editor.getTopForLineNumber(e),n=this._editor.getScrollTop(),r=this._editor.getOption(67),o=this._hover.containerDomNode.clientHeight,a=i-n-(o-r)/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`}_onMouseLeave(e){const t=this._editor.getDomNode();(!t||!MV(t,e.x,e.y))&&this.hide()}},PX=SC,SC.ID="editor.contrib.modesGlyphHoverWidget",SC);OX=PX=jat([Xge(1,Nn),Xge(2,Ta)],OX);var Uat=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},qat=function(s,e){return function(t,i){e(t,i,s)}},_S;let A3=(_S=class extends re{constructor(e,t){super(),this._editor=e,this._instantiationService=t,this.shouldKeepOpenOnEditorMouseMoveOrLeave=!1,this._listenersStore=new me,this._hoverState={mouseDown:!1},this._reactToEditorMouseMoveRunner=this._register(new ji(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookListeners(),this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(60)&&(this._unhookListeners(),this._hookListeners())}))}_hookListeners(){const e=this._editor.getOption(60);this._hoverSettings={enabled:e.enabled,sticky:e.sticky,hidingDelay:e.hidingDelay},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){this._hoverState.mouseDown=!0,!this._isMouseOnMarginHoverWidget(e)&&this._hideWidgets()}_isMouseOnMarginHoverWidget(e){var i;const t=(i=this._glyphWidget)==null?void 0:i.getDomNode();return t?MV(t,e.event.posx,e.event.posy):!1}_onEditorMouseUp(){this._hoverState.mouseDown=!1}_onEditorMouseLeave(e){this.shouldKeepOpenOnEditorMouseMoveOrLeave||(this._cancelScheduler(),this._isMouseOnMarginHoverWidget(e))||this._hideWidgets()}_shouldNotRecomputeCurrentHoverWidget(e){const t=this._hoverSettings.sticky,i=this._isMouseOnMarginHoverWidget(e);return t&&i}_onEditorMouseMove(e){if(this.shouldKeepOpenOnEditorMouseMoveOrLeave)return;if(this._mouseMoveEvent=e,this._shouldNotRecomputeCurrentHoverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){!e||this._tryShowHoverWidget(e)||this._hideWidgets()}_tryShowHoverWidget(e){return this._getOrCreateGlyphWidget().showsOrWillShow(e)}_onKeyDown(e){this._editor.hasModel()&&(e.keyCode===5||e.keyCode===6||e.keyCode===57||e.keyCode===4||this._hideWidgets())}_hideWidgets(){var e;(e=this._glyphWidget)==null||e.hide()}_getOrCreateGlyphWidget(){return this._glyphWidget||(this._glyphWidget=this._instantiationService.createInstance(OX,this._editor)),this._glyphWidget}dispose(){var e;super.dispose(),this._unhookListeners(),this._listenersStore.dispose(),(e=this._glyphWidget)==null||e.dispose()}},_S.ID="editor.contrib.marginHover",_S);A3=Uat([qat(1,ut)],A3);class Kat{}class Gat{}class Yat{}gi(ko.ID,ko,2);gi(A3.ID,A3,2);Pe(Iat);Pe(Tat);Pe(Nat);Pe(Mat);Pe(Rat);Pe(Pat);Pe(Oat);Pe(Aat);Pe(Fat);Pe(Bat);Pe(Wat);Pe(Hat);$y.register(DT);$y.register(RX);jc((s,e)=>{const t=s.getColor(_Ce);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)}; }`))});VV.register(new Kat);VV.register(new Gat);VV.register(new Yat);function Ka(s,e){let t=0;for(let i=0;i<s.length;i++)s.charAt(i)===" "?t+=e:t++;return t}function RE(s,e,t){s=s<0?0:s;let i="";if(!t){const n=Math.floor(s/e);s=s%e;for(let r=0;r<n;r++)i+=" "}for(let n=0;n<s;n++)i+=" ";return i}function zSe(s,e,t,i){if(s.getLineCount()===1&&s.getLineMaxColumn(1)===1)return[];const n=e.getLanguageConfiguration(s.getLanguageId()).indentRulesSupport;if(!n)return[];const r=new gie(s,n,e);for(i=Math.min(i,s.getLineCount());t<=i&&r.shouldIgnore(t);)t++;if(t>i-1)return[];const{tabSize:o,indentSize:a,insertSpaces:l}=s.getOptions(),d=(b,y)=>(y=y||1,Hc.shiftIndent(b,b.length+y,o,a,l)),h=(b,y)=>(y=y||1,Hc.unshiftIndent(b,b.length+y,o,a,l)),f=[],p=s.getLineContent(t);let m=Zi(p),v=m;r.shouldIncrease(t)?(v=d(v),m=d(m)):r.shouldIndentNextLine(t)&&(v=d(v)),t++;for(let b=t;b<=i;b++){if(Zat(s,b))continue;const y=s.getLineContent(b),x=Zi(y),D=v;r.shouldDecrease(b,D)&&(v=h(v),m=h(m)),x!==v&&f.push(Pn.replaceMove(new ot(b,1,b,x.length+1),Ite(v,a,l))),!r.shouldIgnore(b)&&(r.shouldIncrease(b,D)?(m=d(m),v=m):r.shouldIndentNextLine(b,D)?v=d(v):v=m)}return f}function Zat(s,e){return s.tokenization.isCheapToTokenize(e)?s.tokenization.getLineTokens(e).getStandardTokenType(0)===2:!1}var Xat=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Qat=function(s,e){return function(t,i){e(t,i,s)}};const uW=class uW extends Ze{constructor(){super({id:uW.ID,label:w("indentationToSpaces","Convert Indentation to Spaces"),alias:"Convert Indentation to Spaces",precondition:U.writable,metadata:{description:kt("indentationToSpacesDescription","Convert the tab indentation to spaces.")}})}run(e,t){const i=t.getModel();if(!i)return;const n=i.getOptions(),r=t.getSelection();if(!r)return;const o=new nlt(r,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[o]),t.pushUndoStop(),i.updateOptions({insertSpaces:!0})}};uW.ID="editor.action.indentationToSpaces";let AX=uW;const hW=class hW extends Ze{constructor(){super({id:hW.ID,label:w("indentationToTabs","Convert Indentation to Tabs"),alias:"Convert Indentation to Tabs",precondition:U.writable,metadata:{description:kt("indentationToTabsDescription","Convert the spaces indentation to tabs.")}})}run(e,t){const i=t.getModel();if(!i)return;const n=i.getOptions(),r=t.getSelection();if(!r)return;const o=new slt(r,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[o]),t.pushUndoStop(),i.updateOptions({insertSpaces:!1})}};hW.ID="editor.action.indentationToTabs";let FX=hW;class Ene extends Ze{constructor(e,t,i){super(i),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const i=e.get(Uc),n=e.get(pn),r=t.getModel();if(!r)return;const o=n.getCreationOptions(r.getLanguageId(),r.uri,r.isForSimpleWidget),a=r.getOptions(),l=[1,2,3,4,5,6,7,8].map(h=>({id:h.toString(),label:h.toString(),description:h===o.tabSize&&h===a.tabSize?w("configuredTabSize","Configured Tab Size"):h===o.tabSize?w("defaultTabSize","Default Tab Size"):h===a.tabSize?w("currentTabSize","Current Tab Size"):void 0})),d=Math.min(r.getOptions().tabSize-1,7);setTimeout(()=>{i.pick(l,{placeHolder:w({key:"selectTabWidth",comment:["Tab corresponds to the tab key"]},"Select Tab Size for Current File"),activeItem:l[d]}).then(h=>{if(h&&r&&!r.isDisposed()){const f=parseInt(h.label,10);this.displaySizeOnly?r.updateOptions({tabSize:f}):r.updateOptions({tabSize:f,indentSize:f,insertSpaces:this.insertSpaces})}})},50)}}const fW=class fW extends Ene{constructor(){super(!1,!1,{id:fW.ID,label:w("indentUsingTabs","Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0,metadata:{description:kt("indentUsingTabsDescription","Use indentation with tabs.")}})}};fW.ID="editor.action.indentUsingTabs";let BX=fW;const gW=class gW extends Ene{constructor(){super(!0,!1,{id:gW.ID,label:w("indentUsingSpaces","Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0,metadata:{description:kt("indentUsingSpacesDescription","Use indentation with spaces.")}})}};gW.ID="editor.action.indentUsingSpaces";let WX=gW;const pW=class pW extends Ene{constructor(){super(!0,!0,{id:pW.ID,label:w("changeTabDisplaySize","Change Tab Display Size"),alias:"Change Tab Display Size",precondition:void 0,metadata:{description:kt("changeTabDisplaySizeDescription","Change the space size equivalent of the tab.")}})}};pW.ID="editor.action.changeTabDisplaySize";let HX=pW;const mW=class mW extends Ze{constructor(){super({id:mW.ID,label:w("detectIndentation","Detect Indentation from Content"),alias:"Detect Indentation from Content",precondition:void 0,metadata:{description:kt("detectIndentationDescription","Detect the indentation from content.")}})}run(e,t){const i=e.get(pn),n=t.getModel();if(!n)return;const r=i.getCreationOptions(n.getLanguageId(),n.uri,n.isForSimpleWidget);n.detectIndentation(r.insertSpaces,r.tabSize)}};mW.ID="editor.action.detectIndentation";let VX=mW;class Jat extends Ze{constructor(){super({id:"editor.action.reindentlines",label:w("editor.reindentlines","Reindent Lines"),alias:"Reindent Lines",precondition:U.writable,metadata:{description:kt("editor.reindentlinesDescription","Reindent the lines of the editor.")}})}run(e,t){const i=e.get(Bn),n=t.getModel();if(!n)return;const r=zSe(n,i,1,n.getLineCount());r.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop())}}class elt extends Ze{constructor(){super({id:"editor.action.reindentselectedlines",label:w("editor.reindentselectedlines","Reindent Selected Lines"),alias:"Reindent Selected Lines",precondition:U.writable,metadata:{description:kt("editor.reindentselectedlinesDescription","Reindent the selected lines of the editor.")}})}run(e,t){const i=e.get(Bn),n=t.getModel();if(!n)return;const r=t.getSelections();if(r===null)return;const o=[];for(const a of r){let l=a.startLineNumber,d=a.endLineNumber;if(l!==d&&a.endColumn===1&&d--,l===1){if(l===d)continue}else l--;const h=zSe(n,i,l,d);o.push(...h)}o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}}class tlt{constructor(e,t){this._initialSelection=t,this._edits=[],this._selectionId=null;for(const i of e)i.range&&typeof i.text=="string"&&this._edits.push(i)}getEditOperations(e,t){for(const n of this._edits)t.addEditOperation(W.lift(n.range),n.text);let i=!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?(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!0)):this._edits[0].range.endColumn===this._initialSelection.startColumn&&this._edits[0].range.endLineNumber===this._initialSelection.startLineNumber&&(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!1))),i||(this._selectionId=t.trackSelection(this._initialSelection))}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}var vS;let F3=(vS=class{constructor(e,t){this.editor=e,this._languageConfigurationService=t,this.callOnDispose=new me,this.callOnModel=new me,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 i=this.editor.getModel();if(!i||this.rangeContainsOnlyWhitespaceCharacters(i,e)||ilt(i,e)||!i.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const r=this.editor.getOption(12),{tabSize:o,indentSize:a,insertSpaces:l}=i.getOptions(),d=[],h={shiftIndent:v=>Hc.shiftIndent(v,v.length+1,o,a,l),unshiftIndent:v=>Hc.unshiftIndent(v,v.length+1,o,a,l)};let f=e.startLineNumber;for(;f<=e.endLineNumber;){if(this.shouldIgnoreLine(i,f)){f++;continue}break}if(f>e.endLineNumber)return;let p=i.getLineContent(f);if(!/\S/.test(p.substring(0,e.startColumn-1))){const v=CE(r,i,i.getLanguageId(),f,h,this._languageConfigurationService);if(v!==null){const b=Zi(p),y=Ka(v,o),x=Ka(b,o);if(y!==x){const D=RE(y,o,l);d.push({range:new W(f,1,f,b.length+1),text:D}),p=D+p.substring(b.length)}else{const D=i1e(i,f,this._languageConfigurationService);if(D===0||D===8)return}}}const m=f;for(;f<e.endLineNumber;){if(!/\S/.test(i.getLineContent(f+1))){f++;continue}break}if(f!==e.endLineNumber){const b=CE(r,{tokenization:{getLineTokens:y=>i.tokenization.getLineTokens(y),getLanguageId:()=>i.getLanguageId(),getLanguageIdAtPosition:(y,x)=>i.getLanguageIdAtPosition(y,x)},getLineContent:y=>y===m?p:i.getLineContent(y)},i.getLanguageId(),f+1,h,this._languageConfigurationService);if(b!==null){const y=Ka(b,o),x=Ka(Zi(i.getLineContent(f+1)),o);if(y!==x){const D=y-x;for(let S=f+1;S<=e.endLineNumber;S++){const E=i.getLineContent(S),I=Zi(E),M=Ka(I,o)+D,O=RE(M,o,l);O!==I&&d.push({range:new W(S,1,S,I.length+1),text:O})}}}}if(d.length>0){this.editor.pushUndoStop();const v=new tlt(d,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",v),this.editor.pushUndoStop()}}rangeContainsOnlyWhitespaceCharacters(e,t){const i=r=>r.trim().length===0;let n=!0;if(t.startLineNumber===t.endLineNumber){const o=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);n=i(o)}else for(let r=t.startLineNumber;r<=t.endLineNumber;r++){const o=e.getLineContent(r);if(r===t.startLineNumber){const a=o.substring(t.startColumn-1);n=i(a)}else if(r===t.endLineNumber){const a=o.substring(0,t.endColumn-1);n=i(a)}else n=e.getLineFirstNonWhitespaceColumn(r)===0;if(!n)break}return n}shouldIgnoreLine(e,t){e.tokenization.forceTokenization(t);const i=e.getLineFirstNonWhitespaceColumn(t);if(i===0)return!0;const n=e.tokenization.getLineTokens(t);if(n.getCount()>0){const r=n.findTokenIndexAtOffset(i);if(r>=0&&n.getStandardTokenType(r)===1)return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}},vS.ID="editor.contrib.autoIndentOnPaste",vS);F3=Xat([Qat(1,Bn)],F3);function ilt(s,e){const t=i=>w8e(s,i)===2;return t(e.getStartPosition())||t(e.getEndPosition())}function jSe(s,e,t,i){if(s.getLineCount()===1&&s.getLineMaxColumn(1)===1)return;let n="";for(let o=0;o<t;o++)n+=" ";const r=new RegExp(n,"gi");for(let o=1,a=s.getLineCount();o<=a;o++){let l=s.getLineFirstNonWhitespaceColumn(o);if(l===0&&(l=s.getLineMaxColumn(o)),l===1)continue;const d=new W(o,1,o,l),h=s.getValueInRange(d),f=i?h.replace(/\t/ig,n):h.replace(r," ");e.addEditOperation(d,f)}}class nlt{constructor(e,t){this.selection=e,this.tabSize=t,this.selectionId=null}getEditOperations(e,t){this.selectionId=t.trackSelection(this.selection),jSe(e,t,this.tabSize,!0)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}}class slt{constructor(e,t){this.selection=e,this.tabSize=t,this.selectionId=null}getEditOperations(e,t){this.selectionId=t.trackSelection(this.selection),jSe(e,t,this.tabSize,!1)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}}gi(F3.ID,F3,2);Pe(AX);Pe(FX);Pe(BX);Pe(WX);Pe(HX);Pe(VX);Pe(Jat);Pe(elt);gi(IT.ID,IT,1);$y.register(p3);class rlt{constructor(e,t,i){this._editRange=e,this._originalSelection=t,this._text=i}getEditOperations(e,t){t.addTrackedEditOperation(this._editRange,this._text)}computeCursorState(e,t){const n=t.getInverseEditOperations()[0].range;return this._originalSelection.isEmpty()?new ot(n.endLineNumber,Math.min(this._originalSelection.positionColumn,n.endColumn),n.endLineNumber,Math.min(this._originalSelection.positionColumn,n.endColumn)):new ot(n.endLineNumber,n.endColumn-this._text.length,n.endLineNumber,n.endColumn)}}var olt=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},alt=function(s,e){return function(t,i){e(t,i,s)}},SF,jm;let lx=(jm=class{static get(e){return e.getContribution(SF.ID)}constructor(e,t){this.editor=e,this.editorWorkerService=t,this.decorations=this.editor.createDecorationsCollection()}dispose(){}run(e,t){var l;(l=this.currentRequest)==null||l.cancel();const i=this.editor.getSelection(),n=this.editor.getModel();if(!n||!i)return;let r=i;if(r.startLineNumber!==r.endLineNumber)return;const o=new N1e(this.editor,5),a=n.uri;return this.editorWorkerService.canNavigateValueSet(a)?(this.currentRequest=Zs(d=>this.editorWorkerService.navigateValueSet(a,r,t)),this.currentRequest.then(d=>{var v;if(!d||!d.range||!d.value||!o.validate(this.editor))return;const h=W.lift(d.range);let f=d.range;const p=d.value.length-(r.endColumn-r.startColumn);f={startLineNumber:f.startLineNumber,startColumn:f.startColumn,endLineNumber:f.endLineNumber,endColumn:f.startColumn+d.value.length},p>1&&(r=new ot(r.startLineNumber,r.startColumn,r.endLineNumber,r.endColumn+p-1));const m=new rlt(h,r,d.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,m),this.editor.pushUndoStop(),this.decorations.set([{range:f,options:SF.DECORATION}]),(v=this.decorationRemover)==null||v.cancel(),this.decorationRemover=Rg(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(Tt)}).catch(Tt)):Promise.resolve(void 0)}},SF=jm,jm.ID="editor.contrib.inPlaceReplaceController",jm.DECORATION=Ot.register({description:"in-place-replace",className:"valueSetReplacement"}),jm);lx=SF=olt([alt(1,Na)],lx);class llt extends Ze{constructor(){super({id:"editor.action.inPlaceReplace.up",label:w("InPlaceReplaceAction.previous.label","Replace with Previous Value"),alias:"Replace with Previous Value",precondition:U.writable,kbOpts:{kbExpr:U.editorTextFocus,primary:3159,weight:100}})}run(e,t){const i=lx.get(t);return i?i.run(this.id,!1):Promise.resolve(void 0)}}class clt extends Ze{constructor(){super({id:"editor.action.inPlaceReplace.down",label:w("InPlaceReplaceAction.next.label","Replace with Next Value"),alias:"Replace with Next Value",precondition:U.writable,kbOpts:{kbExpr:U.editorTextFocus,primary:3161,weight:100}})}run(e,t){const i=lx.get(t);return i?i.run(this.id,!0):Promise.resolve(void 0)}}gi(lx.ID,lx,4);Pe(llt);Pe(clt);class dlt extends Ze{constructor(){super({id:"expandLineSelection",label:w("expandLineSelection","Expand Line Selection"),alias:"Expand Line Selection",precondition:void 0,kbOpts:{weight:0,kbExpr:U.textInputFocus,primary:2090}})}run(e,t,i){if(i=i||{},!t.hasModel())return;const n=t._getViewModel();n.model.pushStackElement(),n.setCursorStates(i.source,3,vr.expandLineSelection(n,n.getCursorStates())),n.revealAllCursors(i.source,!0)}}Pe(dlt);class ult{constructor(e,t,i){this._selection=e,this._cursors=t,this._selectionId=null,this._trimInRegexesAndStrings=i}getEditOperations(e,t){const i=hlt(e,this._cursors,this._trimInRegexesAndStrings);for(let n=0,r=i.length;n<r;n++){const o=i[n];t.addEditOperation(o.range,o.text)}this._selectionId=t.trackSelection(this._selection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}function hlt(s,e,t){e.sort((a,l)=>a.lineNumber===l.lineNumber?a.column-l.column:a.lineNumber-l.lineNumber);for(let a=e.length-2;a>=0;a--)e[a].lineNumber===e[a+1].lineNumber&&e.splice(a,1);const i=[];let n=0,r=0;const o=e.length;for(let a=1,l=s.getLineCount();a<=l;a++){const d=s.getLineContent(a),h=d.length+1;let f=0;if(r<o&&e[r].lineNumber===a&&(f=e[r].column,r++,f===h)||d.length===0)continue;const p=Du(d);let m=0;if(p===-1)m=1;else if(p!==d.length-1)m=p+2;else continue;if(!t){if(!s.tokenization.hasAccurateTokensForLine(a))continue;const v=s.tokenization.getLineTokens(a),b=v.getStandardTokenType(v.findTokenIndexAtOffset(m));if(b===2||b===3)continue}m=Math.max(f,m),i[n++]=Pn.delete(new W(a,m,a,h))}return i}class USe{constructor(e,t,i){this._selection=e,this._isCopyingDown=t,this._noop=i||!1,this._selectionDirection=0,this._selectionId=null,this._startLineNumberDelta=0,this._endLineNumberDelta=0}getEditOperations(e,t){let i=this._selection;this._startLineNumberDelta=0,this._endLineNumberDelta=0,i.startLineNumber<i.endLineNumber&&i.endColumn===1&&(this._endLineNumberDelta=1,i=i.setEndPosition(i.endLineNumber-1,e.getLineMaxColumn(i.endLineNumber-1)));const n=[];for(let o=i.startLineNumber;o<=i.endLineNumber;o++)n.push(e.getLineContent(o));const r=n.join(`
|
|
919
919
|
`);r===""&&this._isCopyingDown&&(this._startLineNumberDelta++,this._endLineNumberDelta++),this._noop?t.addEditOperation(new W(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber+1,1),i.endLineNumber===e.getLineCount()?"":`
|
|
920
920
|
`):this._isCopyingDown?t.addEditOperation(new W(i.startLineNumber,1,i.startLineNumber,1),r+`
|
|
921
921
|
`):t.addEditOperation(new W(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),`
|
|
@@ -946,4 +946,4 @@ ${e.toString()}`}}class L5{constructor(e=new Vx,t=!1,i,n=mKe){this._services=e,t
|
|
|
946
946
|
`));const b=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:"advanced"});return eV.fromFn(async()=>{const y=await b.computeDiff(this._originalModel.get(),this._modifiedModel.get(),{computeMoves:!1,ignoreTrimWhitespace:!1,maxComputationTimeMs:1e3},$t.None);if(!y.identical)return new Wct(Bt.fromRangeInclusive(h),p(f),y.changes)})}),this._fetchStore=this._register(new me),this._inlineEditsFetchResult=jI(this,void 0),this._inlineEdits=Hl({owner:this,equalsFn:Y4},l=>{var d;return((d=this._inlineEditsFetchResult.read(l))==null?void 0:d.completions.map(h=>new jct(h)))??[]}),this._fetchInlineEditsPromise=rye({owner:this,createEmptyChangeSummary:()=>({inlineCompletionTriggerKind:Lu.Automatic}),handleChange:(l,d)=>(l.didChange(this._forceUpdateExplicitlySignal)&&(d.inlineCompletionTriggerKind=Lu.Explicit),!0)},async(l,d)=>{this._fetchStore.clear(),this._forceUpdateExplicitlySignal.read(l),this._textModelVersionId.read(l);function h(b,y){return y(b)}const f=this._pinnedRange.range.read(l)??h(this._selection.read(l),b=>b.isEmpty()?void 0:b);if(!f){this._inlineEditsFetchResult.set(void 0,void 0),this.userPrompt.set(void 0,void 0);return}const p={triggerKind:d.inlineCompletionTriggerKind,selectedSuggestionInfo:void 0,userPrompt:this.userPrompt.read(l)},m=DU(this._fetchStore);await Rg(200,m);const v=await FSe(this.languageFeaturesService.inlineCompletionsProvider,f,this.textModel,p,m);m.isCancellationRequested||this._inlineEditsFetchResult.set(v,void 0)}),this._filteredInlineEditItems=Hl({owner:this,equalsFn:G4()},l=>this._inlineEdits.read(l)),this.selectedInlineCompletionIndex=lt(this,l=>{const d=this._selectedInlineCompletionId.read(l),h=this._filteredInlineEditItems.read(l),f=this._selectedInlineCompletionId===void 0?-1:h.findIndex(p=>p.semanticId===d);return f===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):f}),this.selectedInlineEdit=lt(this,l=>{const d=this._filteredInlineEditItems.read(l),h=this.selectedInlineCompletionIndex.read(l);return d[h]}),this._register(Fx(this._fetchInlineEditsPromise))}async triggerExplicitly(e){iy(e,t=>{this._isActive.set(!0,t),this._forceUpdateExplicitlySignal.trigger(t)}),await this._fetchInlineEditsPromise.get()}stop(e){iy(e,t=>{this.userPrompt.set(void 0,t),this._isActive.set(!1,t),this._inlineEditsFetchResult.set(void 0,t),this._pinnedRange.setRange(void 0,t)})}async _deltaSelectedInlineCompletionIndex(e){await this.triggerExplicitly();const t=this._filteredInlineEditItems.get()||[];if(t.length>0){const i=(this.selectedInlineCompletionIndex.get()+e+t.length)%t.length;this._selectedInlineCompletionId.set(t[i].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){if(e.getModel()!==this.textModel)throw new ki;const t=this.selectedInlineEdit.get();t&&(e.pushUndoStop(),e.executeEdits("inlineSuggestion.accept",[t.inlineCompletion.toSingleTextEdit().toSingleEditOperation()]),this.stop())}},YD=EC,EC._modelId=0,EC);eQ=YD=zct([Lj(4,it),Lj(5,PN),Lj(6,pn)],eQ);class jct{constructor(e){this.inlineCompletion=e,this.semanticId=this.inlineCompletion.hash()}}class Uct extends re{constructor(e,t){super(),this._textModel=e,this._versionId=t,this._decorations=Kt(this,[]),this.range=lt(this,i=>{this._versionId.read(i);const n=this._decorations.read(i)[0];return n?this._textModel.getDecorationRange(n)??null:null}),this._register(dt(()=>{this._textModel.deltaDecorations(this._decorations.get(),[])}))}setRange(e,t){this._decorations.set(this._textModel.deltaDecorations(this._decorations.get(),e?[{range:e,options:{description:"trackedRange"}}]:[]),t)}}var qct=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},yD=function(s,e){return function(t,i){e(t,i,s)}},tQ,IC;let Vg=(IC=class extends re{static get(e){return e.getContribution(tQ.ID)}constructor(e,t,i,n,r,o){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=i,this._debounceService=n,this._languageFeaturesService=r,this._configurationService=o,this._enabled=hQe("editor.inlineEdits.enabled",!1,this._configurationService),this._editorObs=el(this.editor),this._selection=lt(this,a=>this._editorObs.cursorSelection.read(a)??new ot(1,1,1,1)),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineEditsDebounce",{min:50,max:50}),this.model=vo(this,a=>{if(!this._enabled.read(a)||this._editorObs.isReadonly.read(a))return;const l=this._editorObs.model.read(a);return l?this._instantiationService.createInstance(Za(eQ,a),l,this._editorObs.versionId,this._selection,this._debounceValue):void 0}),this._hadInlineEdit=kN(this,(a,l)=>{var d;return l||((d=this.model.read(a))==null?void 0:d.inlineEdit.read(a))!==void 0}),this._widget=vo(this,a=>{if(this._hadInlineEdit.read(a))return this._instantiationService.createInstance(Za(JX,a),this.editor,this.model.map((l,d)=>l==null?void 0:l.inlineEdit.read(d)),Kct(l=>{var d;return((d=this.model.read(l))==null?void 0:d.userPrompt)??Kt("empty","")}))}),this._register(nu(ux,this._contextKeyService,a=>{var l;return!!((l=this.model.read(a))!=null&&l.inlineEdit.read(a))})),this._register(nu(Oct,this._contextKeyService,a=>{var l;return!!((l=this.model.read(a))!=null&&l.isPinned.read(a))})),this.model.recomputeInitiallyAndOnChange(this._store),this._widget.recomputeInitiallyAndOnChange(this._store)}},tQ=IC,IC.ID="editor.contrib.inlineEditsController",IC);Vg=tQ=qct([yD(1,ut),yD(2,yt),yD(3,sc),yD(4,it),yD(5,Gt)],Vg);function Kct(s){return wN(void 0,e=>s(e).read(e),(e,t)=>{s(void 0).set(e,t)})}function qN(s){return{label:s.value,alias:s.original}}const yW=class yW extends Ze{constructor(){super({id:yW.ID,...qN(kt("action.inlineEdits.showNext","Show Next Inline Edit")),precondition:ve.and(U.writable,ux),kbOpts:{weight:100,primary:606}})}async run(e,t){var n;const i=Vg.get(t);(n=i==null?void 0:i.model.get())==null||n.next()}};yW.ID=Pct;let iQ=yW;const wW=class wW extends Ze{constructor(){super({id:wW.ID,...qN(kt("action.inlineEdits.showPrevious","Show Previous Inline Edit")),precondition:ve.and(U.writable,ux),kbOpts:{weight:100,primary:604}})}async run(e,t){var n;const i=Vg.get(t);(n=i==null?void 0:i.model.get())==null||n.previous()}};wW.ID=Rct;let nQ=wW;class Gct extends Ze{constructor(){super({id:"editor.action.inlineEdits.trigger",...qN(kt("action.inlineEdits.trigger","Trigger Inline Edit")),precondition:U.writable})}async run(e,t){const i=Vg.get(t);await sye(async n=>{var r;await((r=i==null?void 0:i.model.get())==null?void 0:r.triggerExplicitly(n))})}}class Yct extends Ze{constructor(){super({id:Mct,...qN(kt("action.inlineEdits.accept","Accept Inline Edit")),precondition:ux,menuOpts:{menuId:st.InlineEditsActions,title:w("inlineEditsActions","Accept Inline Edit"),group:"primary",order:1,icon:Oe.check},kbOpts:{primary:2058,weight:2e4,kbExpr:ux}})}async run(e,t){var n;t instanceof Pd&&(t=t.getParentEditor());const i=Vg.get(t);i&&((n=i.model.get())==null||n.accept(i.editor),i.editor.focus())}}const SW=class SW extends Ze{constructor(){super({id:SW.ID,...qN(kt("action.inlineEdits.hide","Hide Inline Edit")),precondition:ux,kbOpts:{weight:100,primary:9}})}async run(e,t){const i=Vg.get(t);On(n=>{var r;(r=i==null?void 0:i.model.get())==null||r.stop(n)})}};SW.ID="editor.action.inlineEdits.hide";let sQ=SW;gi(Vg.ID,Vg,3);Pe(Gct);Pe(iQ);Pe(nQ);Pe(Yct);Pe(sQ);const _y={Visible:new qe("parameterHintsVisible",!1),MultipleSignatures:new qe("parameterHintsMultipleSignatures",!1)};async function ixe(s,e,t,i,n){const r=s.ordered(e);for(const o of r)try{const a=await o.provideSignatureHelp(e,t,n,i);if(a)return a}catch(a){is(a)}}hi.registerCommand("_executeSignatureHelpProvider",async(s,...e)=>{const[t,i,n]=e;Ci(gt.isUri(t)),Ci(ie.isIPosition(i)),Ci(typeof n=="string"||!n);const r=s.get(it),o=await s.get(Ea).createModelReference(t);try{const a=await ixe(r.signatureHelpProvider,o.object.textEditorModel,ie.lift(i),{triggerKind:jh.Invoke,isRetrigger:!1,triggerCharacter:n},$t.None);return a?(setTimeout(()=>a.dispose(),0),a.value):void 0}finally{o.dispose()}});var Hp;(function(s){s.Default={type:0};class e{constructor(n,r){this.request=n,this.previouslyActiveHints=r,this.type=2}}s.Pending=e;class t{constructor(n){this.hints=n,this.type=1}}s.Active=t})(Hp||(Hp={}));const xW=class xW extends re{constructor(e,t,i=xW.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new se),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=Hp.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new Js),this.triggerChars=new L4,this.retriggerChars=new L4,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new Ac(i),this._register(this.editor.onDidBlurEditorWidget(()=>this.cancel())),this._register(this.editor.onDidChangeConfiguration(()=>this.onEditorConfigurationChange())),this._register(this.editor.onDidChangeModel(n=>this.onModelChanged())),this._register(this.editor.onDidChangeModelLanguage(n=>this.onModelChanged())),this._register(this.editor.onDidChangeCursorSelection(n=>this.onCursorChange(n))),this._register(this.editor.onDidChangeModelContent(n=>this.onModelContentChange())),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType(n=>this.onDidType(n))),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=Hp.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){const i=this.editor.getModel();if(!i||!this.providers.has(i))return;const n=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(n),t).catch(Tt)}next(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t%e===e-1,n=this.editor.getOption(86).cycle;if((e<2||i)&&!n){this.cancel();return}this.updateActiveSignature(i&&n?0:t+1)}previous(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t===0,n=this.editor.getOption(86).cycle;if((e<2||i)&&!n){this.cancel();return}this.updateActiveSignature(i&&n?e-1:t-1)}updateActiveSignature(e){this.state.type===1&&(this.state=new Hp.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,i=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;const n=this._pendingTriggers.reduce(Zct);this._pendingTriggers=[];const r={triggerKind:n.triggerKind,triggerCharacter:n.triggerCharacter,isRetrigger:t,activeSignatureHelp:i};if(!this.editor.hasModel())return!1;const o=this.editor.getModel(),a=this.editor.getPosition();this.state=new Hp.Pending(Zs(l=>ixe(this.providers,o,a,r,l)),i);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 Hp.Active(l.value),this._lastSignatureHelpResult.value=l,this._onChangedHints.fire(this.state.hints),!0)}catch(l){return e===this.triggerId&&(this.state=Hp.Default),Tt(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 i of t.signatureHelpTriggerCharacters||[])if(i.length){const n=i.charCodeAt(0);this.triggerChars.add(n),this.retriggerChars.add(n)}for(const i of t.signatureHelpRetriggerCharacters||[])i.length&&this.retriggerChars.add(i.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const t=e.length-1,i=e.charCodeAt(t);(this.triggerChars.has(i)||this.isTriggered&&this.retriggerChars.has(i))&&this.trigger({triggerKind:jh.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:jh.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:jh.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(86).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}};xW.DEFAULT_DELAY=120;let rQ=xW;function Zct(s,e){switch(e.triggerKind){case jh.Invoke:return e;case jh.ContentChange:return s;case jh.TriggerCharacter:default:return e}}var Xct=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},L2=function(s,e){return function(t,i){e(t,i,s)}},oQ;const El=Fe,Qct=mn("parameter-hints-next",Oe.chevronDown,w("parameterHintsNextIcon","Icon for show next parameter hint.")),Jct=mn("parameter-hints-previous",Oe.chevronUp,w("parameterHintsPreviousIcon","Icon for show previous parameter hint."));var TC;let aQ=(TC=class extends re{constructor(e,t,i,n,r,o){super(),this.editor=e,this.model=t,this.telemetryService=o,this.renderDisposeables=this._register(new me),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new Ag({editor:e},r,n)),this.keyVisible=_y.Visible.bindTo(i),this.keyMultipleSignatures=_y.MultipleSignatures.bindTo(i)}createParameterHintDOMNodes(){const e=El(".editor-widget.parameter-hints-widget"),t=Ee(e,El(".phwrapper"));t.tabIndex=-1;const i=Ee(t,El(".controls")),n=Ee(i,El(".button"+bt.asCSSSelector(Jct))),r=Ee(i,El(".overloads")),o=Ee(i,El(".button"+bt.asCSSSelector(Qct)));this._register(ue(n,"click",p=>{ai.stop(p),this.previous()})),this._register(ue(o,"click",p=>{ai.stop(p),this.next()}));const a=El(".body"),l=new _N(a,{alwaysConsumeMouseWheel:!0});this._register(l),t.appendChild(l.getDomNode());const d=Ee(a,El(".signature")),h=Ee(a,El(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:d,overloads:r,docs:h,scrollbar:l},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(p=>{this.visible&&this.editor.layoutContentWidget(this)}));const f=()=>{if(!this.domNodes)return;const p=this.editor.getOption(50),m=this.domNodes.element;m.style.fontSize=`${p.fontSize}px`,m.style.lineHeight=`${p.lineHeight/p.fontSize}`,m.style.setProperty("--vscode-parameterHintsWidget-editorFontFamily",p.fontFamily),m.style.setProperty("--vscode-parameterHintsWidget-editorFontFamilyDefault",Ko.fontFamily)};f(),this._register(We.chain(this.editor.onDidChangeConfiguration.bind(this.editor),p=>p.filter(m=>m.hasChanged(50)))(f)),this._register(this.editor.onDidLayoutChange(p=>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.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.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){if(this.renderDisposeables.clear(),!this.domNodes)return;const t=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",t),this.keyMultipleSignatures.set(t),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const i=e.signatures[e.activeSignature];if(!i)return;const n=Ee(this.domNodes.signature,El(".code")),r=i.parameters.length>0,o=i.activeParameter??e.activeParameter;if(r)this.renderParameters(n,i,o);else{const d=Ee(n,El("span"));d.textContent=i.label}const a=i.parameters[o];if(a!=null&&a.documentation){const d=El("span.documentation");if(typeof a.documentation=="string")d.textContent=a.documentation;else{const h=this.renderMarkdownDocs(a.documentation);d.appendChild(h.element)}Ee(this.domNodes.docs,El("p",{},d))}if(i.documentation!==void 0)if(typeof i.documentation=="string")Ee(this.domNodes.docs,El("p",{},i.documentation));else{const d=this.renderMarkdownDocs(i.documentation);Ee(this.domNodes.docs,d.element)}const l=this.hasDocs(i,a);if(this.domNodes.signature.classList.toggle("has-docs",l),this.domNodes.docs.classList.toggle("empty",!l),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,a){let d="";const h=i.parameters[o];Array.isArray(h.label)?d=i.label.substring(h.label[0],h.label[1]):d=h.label,h.documentation&&(d+=typeof h.documentation=="string"?`, ${h.documentation}`:`, ${h.documentation.value}`),i.documentation&&(d+=typeof i.documentation=="string"?`, ${i.documentation}`:`, ${i.documentation.value}`),this.announcedLabel!==d&&(Qo(w("hint","{0}, hint",d)),this.announcedLabel=d)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=new cr,i=this.renderDisposeables.add(this.markdownRenderer.render(e,{asyncRenderCallback:()=>{var r;(r=this.domNodes)==null||r.scrollbar.scanDomNode()}}));i.element.classList.add("markdown-docs");const n=t.elapsed();return n>300&&this.telemetryService.publicLog2("parameterHints.parseMarkdown",{renderDuration:n}),i}hasDocs(e,t){return!!(t&&typeof t.documentation=="string"&&rm(t.documentation).length>0||t&&typeof t.documentation=="object"&&rm(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&rm(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&rm(e.documentation.value).length>0)}renderParameters(e,t,i){const[n,r]=this.getParameterLabelOffsets(t,i),o=document.createElement("span");o.textContent=t.label.substring(0,n);const a=document.createElement("span");a.textContent=t.label.substring(n,r),a.className="parameter active";const l=document.createElement("span");l.textContent=t.label.substring(r),Ee(e,o,a,l)}getParameterLabelOffsets(e,t){const i=e.parameters[t];if(i){if(Array.isArray(i.label))return i.label;if(i.label.length){const n=new RegExp(`(\\W|^)${Xl(i.label)}(?=\\W|$)`,"g");n.test(e.label);const r=n.lastIndex-i.label.length;return r>=0?[r,n.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 oQ.ID}updateMaxHeight(){if(!this.domNodes)return;const t=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=t;const i=this.domNodes.element.getElementsByClassName("phwrapper");i.length&&(i[0].style.maxHeight=t)}},oQ=TC,TC.ID="editor.widget.parameterHintsWidget",TC);aQ=oQ=Xct([L2(2,yt),L2(3,Ta),L2(4,Nn),L2(5,so)],aQ);q("editorHoverWidget.highlightForeground",n0,w("editorHoverWidgetHighlightForeground","Foreground color of the active item in the parameter hint."));var edt=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},tpe=function(s,e){return function(t,i){e(t,i,s)}},lQ,NC;let hx=(NC=class extends re{static get(e){return e.getContribution(lQ.ID)}constructor(e,t,i){super(),this.editor=e,this.model=this._register(new rQ(e,i.signatureHelpProvider)),this._register(this.model.onChangedHints(n=>{var r;n?(this.widget.value.show(),this.widget.value.render(n)):(r=this.widget.rawValue)==null||r.hide()})),this.widget=new Ru(()=>this._register(t.createInstance(aQ,this.editor,this.model)))}cancel(){this.model.cancel()}previous(){var e;(e=this.widget.rawValue)==null||e.previous()}next(){var e;(e=this.widget.rawValue)==null||e.next()}trigger(e){this.model.trigger(e,0)}},lQ=NC,NC.ID="editor.controller.parameterHints",NC);hx=lQ=edt([tpe(1,ut),tpe(2,it)],hx);class tdt extends Ze{constructor(){super({id:"editor.action.triggerParameterHints",label:w("parameterHints.trigger.label","Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:U.hasSignatureHelpProvider,kbOpts:{kbExpr:U.editorTextFocus,primary:3082,weight:100}})}run(e,t){const i=hx.get(t);i==null||i.trigger({triggerKind:jh.Invoke})}}gi(hx.ID,hx,2);Pe(tdt);const Tne=175,Nne=$s.bindToContribution(hx.get);Ue(new Nne({id:"closeParameterHints",precondition:_y.Visible,handler:s=>s.cancel(),kbOpts:{weight:Tne,kbExpr:U.focus,primary:9,secondary:[1033]}}));Ue(new Nne({id:"showPrevParameterHint",precondition:ve.and(_y.Visible,_y.MultipleSignatures),handler:s=>s.previous(),kbOpts:{weight:Tne,kbExpr:U.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}}));Ue(new Nne({id:"showNextParameterHint",precondition:ve.and(_y.Visible,_y.MultipleSignatures),handler:s=>s.next(),kbOpts:{weight:Tne,kbExpr:U.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));var idt=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},ndt=function(s,e){return function(t,i){e(t,i,s)}};class sdt{constructor(e){this.instantiationService=e}init(...e){}}function rdt(s,e){return class extends e{constructor(){super(...arguments),this._autorun=void 0}init(...i){this._autorun=ya((n,r)=>{const o=Za(s(),n);r.add(this.instantiationService.createInstance(o,...i))})}dispose(){var i;(i=this._autorun)==null||i.dispose()}}}function odt(s){return yV()?rdt(s,cQ):s()}let cQ=class extends sdt{constructor(e,t){super(t),this.init(e)}};cQ=idt([ndt(1,ut)],cQ);gi(FT.ID,odt(()=>FT),0);q("editor.placeholder.foreground",tze,w("placeholderForeground","Foreground color of the placeholder text in the editor."));var adt=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},D2=function(s,e){return function(t,i){e(t,i,s)}};const Zx=new qe("renameInputVisible",!1,w("renameInputVisible","Whether the rename input widget is visible"));new qe("renameInputFocused",!1,w("renameInputFocused","Whether the rename input widget is focused"));let dQ=class{constructor(e,t,i,n,r,o){this._editor=e,this._acceptKeybindings=t,this._themeService=i,this._keybindingService=n,this._logService=o,this.allowEditorOverflow=!0,this._disposables=new me,this._visibleContextKey=Zx.bindTo(r),this._isEditingRenameCandidate=!1,this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,this._candidates=new Set,this._beforeFirstInputFieldEditSW=new cr,this._inputWithButton=new ldt,this._disposables.add(this._inputWithButton),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{a.hasChanged(50)&&this._updateFont()})),this._disposables.add(i.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._domNode.appendChild(this._inputWithButton.domNode),this._renameCandidateListView=this._disposables.add(new Mne(this._domNode,{fontInfo:this._editor.getOption(50),onFocusChange:e=>{this._inputWithButton.input.value=e,this._isEditingRenameCandidate=!1},onSelectionChange:()=>{this._isEditingRenameCandidate=!1,this.acceptInput(!1)}})),this._disposables.add(this._inputWithButton.onDidInputChange(()=>{var e,t,i;((e=this._renameCandidateListView)==null?void 0:e.focusedCandidate)!==void 0&&(this._isEditingRenameCandidate=!0),this._timeBeforeFirstInputFieldEdit??(this._timeBeforeFirstInputFieldEdit=this._beforeFirstInputFieldEditSW.elapsed()),((t=this._renameCandidateProvidersCts)==null?void 0:t.token.isCancellationRequested)===!1&&this._renameCandidateProvidersCts.cancel(),(i=this._renameCandidateListView)==null||i.clearFocus()})),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){if(!this._domNode)return;const t=e.getColor(Nx),i=e.getColor(vCe);this._domNode.style.backgroundColor=String(e.getColor(Ul)??""),this._domNode.style.boxShadow=t?` 0 0 8px 2px ${t}`:"",this._domNode.style.border=i?`1px solid ${i}`:"",this._domNode.style.color=String(e.getColor(yCe)??"");const n=e.getColor(wCe);this._inputWithButton.domNode.style.backgroundColor=String(e.getColor(SK)??""),this._inputWithButton.input.style.backgroundColor=String(e.getColor(SK)??""),this._inputWithButton.domNode.style.borderWidth=n?"1px":"0px",this._inputWithButton.domNode.style.borderStyle=n?"solid":"none",this._inputWithButton.domNode.style.borderColor=(n==null?void 0:n.toString())??"none"}_updateFont(){if(this._domNode===void 0)return;Ci(this._label!==void 0,"RenameWidget#_updateFont: _label must not be undefined given _domNode is defined"),this._editor.applyFontInfo(this._inputWithButton.input);const e=this._editor.getOption(50);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=o_(this.getDomNode().ownerDocument.body),t=ts(this._editor.getDomNode()),i=this._getTopForPosition();this._nPxAvailableAbove=i+t.top,this._nPxAvailableBelow=e.height-this._nPxAvailableAbove;const n=this._editor.getOption(67),{totalHeight:r}=BT.getLayoutInfo({lineHeight:n}),o=this._nPxAvailableBelow>r*6?[2,1]:[1,2];return{position:this._position,preference:o}}beforeRender(){var i,n;const[e,t]=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",(i=this._keybindingService.lookupKeybinding(e))==null?void 0:i.getLabel(),(n=this._keybindingService.lookupKeybinding(t))==null?void 0:n.getLabel()),this._domNode.style.minWidth="200px",null}afterRender(e){if(e===null){this.cancelInput(!0,"afterRender (because position is null)");return}if(!this._editor.hasModel()||!this._editor.getDomNode())return;Ci(this._renameCandidateListView),Ci(this._nPxAvailableAbove!==void 0),Ci(this._nPxAvailableBelow!==void 0);const t=ag(this._inputWithButton.domNode),i=ag(this._label);let n;e===2?n=this._nPxAvailableBelow:n=this._nPxAvailableAbove,this._renameCandidateListView.layout({height:n-i-t,width:Ga(this._inputWithButton.domNode)})}acceptInput(e){var t;this._trace("invoking acceptInput"),(t=this._currentAcceptInput)==null||t.call(this,e)}cancelInput(e,t){var i;(i=this._currentCancelInput)==null||i.call(this,e)}focusNextRenameSuggestion(){var e;(e=this._renameCandidateListView)!=null&&e.focusNext()||(this._inputWithButton.input.value=this._currentName)}focusPreviousRenameSuggestion(){var e;(e=this._renameCandidateListView)!=null&&e.focusPrevious()||(this._inputWithButton.input.value=this._currentName)}getInput(e,t,i,n,r){const{start:o,end:a}=this._getSelection(e,t);this._renameCts=r;const l=new me;this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,n===void 0?this._inputWithButton.button.style.display="none":(this._inputWithButton.button.style.display="flex",this._requestRenameCandidatesOnce=n,this._requestRenameCandidates(t,!1),l.add(ue(this._inputWithButton.button,"click",()=>this._requestRenameCandidates(t,!0))),l.add(ue(this._inputWithButton.button,Ae.KEY_DOWN,h=>{const f=new nn(h);(f.equals(3)||f.equals(10))&&(f.stopPropagation(),f.preventDefault(),this._requestRenameCandidates(t,!0))}))),this._isEditingRenameCandidate=!1,this._domNode.classList.toggle("preview",i),this._position=new ie(e.startLineNumber,e.startColumn),this._currentName=t,this._inputWithButton.input.value=t,this._inputWithButton.input.setAttribute("selectionStart",o.toString()),this._inputWithButton.input.setAttribute("selectionEnd",a.toString()),this._inputWithButton.input.size=Math.max((e.endColumn-e.startColumn)*1.1,20),this._beforeFirstInputFieldEditSW.reset(),l.add(dt(()=>{this._renameCts=void 0,r.dispose(!0)})),l.add(dt(()=>{this._renameCandidateProvidersCts!==void 0&&(this._renameCandidateProvidersCts.dispose(!0),this._renameCandidateProvidersCts=void 0)})),l.add(dt(()=>this._candidates.clear()));const d=new kx;return d.p.finally(()=>{l.dispose(),this._hide()}),this._currentCancelInput=h=>{var f;return this._trace("invoking _currentCancelInput"),this._currentAcceptInput=void 0,this._currentCancelInput=void 0,(f=this._renameCandidateListView)==null||f.clearCandidates(),d.complete(h),!0},this._currentAcceptInput=h=>{this._trace("invoking _currentAcceptInput"),Ci(this._renameCandidateListView!==void 0);const f=this._renameCandidateListView.nCandidates;let p,m;const v=this._renameCandidateListView.focusedCandidate;if(v!==void 0?(this._trace("using new name from renameSuggestion"),p=v,m={k:"renameSuggestion"}):(this._trace("using new name from inputField"),p=this._inputWithButton.input.value,m=this._isEditingRenameCandidate?{k:"userEditedRenameSuggestion"}:{k:"inputField"}),p===t||p.trim().length===0){this.cancelInput(!0,"_currentAcceptInput (because newName === value || newName.trim().length === 0)");return}this._currentAcceptInput=void 0,this._currentCancelInput=void 0,this._renameCandidateListView.clearCandidates(),d.complete({newName:p,wantsPreview:i&&h,stats:{source:m,nRenameSuggestions:f,timeBeforeFirstInputFieldEdit:this._timeBeforeFirstInputFieldEdit,nRenameSuggestionsInvocations:this._nRenameSuggestionsInvocations,hadAutomaticRenameSuggestionsInvocation:this._hadAutomaticRenameSuggestionsInvocation}})},l.add(r.token.onCancellationRequested(()=>this.cancelInput(!0,"cts.token.onCancellationRequested"))),l.add(this._editor.onDidBlurEditorWidget(()=>{var h;return this.cancelInput(!((h=this._domNode)!=null&&h.ownerDocument.hasFocus()),"editor.onDidBlurEditorWidget")})),this._show(),d.p}_requestRenameCandidates(e,t){if(this._requestRenameCandidatesOnce!==void 0&&(this._renameCandidateProvidersCts!==void 0&&this._renameCandidateProvidersCts.dispose(!0),Ci(this._renameCts),this._inputWithButton.buttonState!=="stop")){this._renameCandidateProvidersCts=new An;const i=t?CI.Invoke:CI.Automatic,n=this._requestRenameCandidatesOnce(i,this._renameCandidateProvidersCts.token);if(n.length===0){this._inputWithButton.setSparkleButton();return}t||(this._hadAutomaticRenameSuggestionsInvocation=!0),this._nRenameSuggestionsInvocations+=1,this._inputWithButton.setStopButton(),this._updateRenameCandidates(n,e,this._renameCts.token)}}_getSelection(e,t){Ci(this._editor.hasModel());const i=this._editor.getSelection();let n=0,r=t.length;return!W.isEmpty(i)&&!W.spansMultipleLines(i)&&W.containsRange(e,i)&&(n=Math.max(0,i.startColumn-e.startColumn),r=Math.min(e.endColumn,i.endColumn)-e.startColumn),{start:n,end:r}}_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._inputWithButton.input.focus(),this._inputWithButton.input.setSelectionRange(parseInt(this._inputWithButton.input.getAttribute("selectionStart")),parseInt(this._inputWithButton.input.getAttribute("selectionEnd")))},100)}async _updateRenameCandidates(e,t,i){const n=(...d)=>this._trace("_updateRenameCandidates",...d);n("start");const r=await hN(Promise.allSettled(e),i);if(this._inputWithButton.setSparkleButton(),r===void 0){n("returning early - received updateRenameCandidates results - undefined");return}const o=r.flatMap(d=>d.status==="fulfilled"&&zh(d.value)?d.value:[]);n(`received updateRenameCandidates results - total (unfiltered) ${o.length} candidates.`);const a=Tg(o,d=>d.newSymbolName);n(`distinct candidates - ${a.length} candidates.`);const l=a.filter(({newSymbolName:d})=>d.trim().length>0&&d!==this._inputWithButton.input.value&&d!==t&&!this._candidates.has(d));if(n(`valid distinct candidates - ${o.length} candidates.`),l.forEach(d=>this._candidates.add(d.newSymbolName)),l.length<1){n("returning early - no valid distinct candidates");return}n("setting candidates"),this._renameCandidateListView.setCandidates(l),n("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("RenameWidget#_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("RenameWidget",...e)}};dQ=adt([D2(2,zs),D2(3,Mi),D2(4,yt),D2(5,qr)],dQ);class Mne{constructor(e,t){this._disposables=new me,this._availableHeight=0,this._minimumWidth=0,this._lineHeight=t.fontInfo.lineHeight,this._typicalHalfwidthCharacterWidth=t.fontInfo.typicalHalfwidthCharacterWidth,this._listContainer=document.createElement("div"),this._listContainer.className="rename-box rename-candidate-list-container",e.appendChild(this._listContainer),this._listWidget=Mne._createListWidget(this._listContainer,this._candidateViewHeight,t.fontInfo),this._listWidget.onDidChangeFocus(i=>{i.elements.length===1&&t.onFocusChange(i.elements[0].newSymbolName)},this._disposables),this._listWidget.onDidChangeSelection(i=>{i.elements.length===1&&t.onSelectionChange()},this._disposables),this._disposables.add(this._listWidget.onDidBlur(i=>{this._listWidget.setFocus([])})),this._listWidget.style(Py({listInactiveFocusForeground:AI,listInactiveFocusBackground:FI}))}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(this._listWidget.length),i=this._pickListWidth(e);this._listWidget.layout(t,i),this._listContainer.style.height=`${t}px`,this._listContainer.style.width=`${i}px`,Jh(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}focusNext(){if(this._listWidget.length===0)return!1;const e=this._listWidget.getFocus();if(e.length===0)return this._listWidget.focusFirst(),this._listWidget.reveal(0),!0;if(e[0]===this._listWidget.length-1)return this._listWidget.setFocus([]),this._listWidget.reveal(0),!1;{this._listWidget.focusNext();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}}focusPrevious(){if(this._listWidget.length===0)return!1;const e=this._listWidget.getFocus();if(e.length===0){this._listWidget.focusLast();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}else{if(e[0]===0)return this._listWidget.setFocus([]),!1;{this._listWidget.focusPrevious();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}}}clearFocus(){this._listWidget.setFocus([])}get _candidateViewHeight(){const{totalHeight:e}=BT.getLayoutInfo({lineHeight:this._lineHeight});return e}_pickListHeight(e){const t=this._candidateViewHeight*e;return Math.min(t,this._availableHeight,this._candidateViewHeight*7)}_pickListWidth(e){const t=Math.ceil(Math.max(...e.map(n=>n.newSymbolName.length))*this._typicalHalfwidthCharacterWidth);return Math.max(this._minimumWidth,25+t+10)}static _createListWidget(e,t,i){const n=new class{getTemplateId(o){return"candidate"}getHeight(o){return t}},r=new class{constructor(){this.templateId="candidate"}renderTemplate(o){return new BT(o,i)}renderElement(o,a,l){l.populate(o)}disposeTemplate(o){o.dispose()}};return new oc("NewSymbolNameCandidates",e,n,[r],{keyboardSupport:!1,mouseSupport:!0,multipleSelectionSupport:!1})}}class ldt{constructor(){this._onDidInputChange=new se,this.onDidInputChange=this._onDidInputChange.event,this._disposables=new me}get domNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="rename-input-with-button",this._domNode.style.display="flex",this._domNode.style.flexDirection="row",this._domNode.style.alignItems="center",this._inputNode=document.createElement("input"),this._inputNode.className="rename-input",this._inputNode.type="text",this._inputNode.style.border="none",this._inputNode.setAttribute("aria-label",w("renameAriaLabel","Rename input. Type new name and press Enter to commit.")),this._domNode.appendChild(this._inputNode),this._buttonNode=document.createElement("div"),this._buttonNode.className="rename-suggestions-button",this._buttonNode.setAttribute("tabindex","0"),this._buttonGenHoverText=w("generateRenameSuggestionsButton","Generate new name suggestions"),this._buttonCancelHoverText=w("cancelRenameSuggestionsButton","Cancel"),this._buttonHover=Uu().setupManagedHover(ta("element"),this._buttonNode,this._buttonGenHoverText),this._disposables.add(this._buttonHover),this._domNode.appendChild(this._buttonNode),this._disposables.add(ue(this.input,Ae.INPUT,()=>this._onDidInputChange.fire())),this._disposables.add(ue(this.input,Ae.KEY_DOWN,e=>{const t=new nn(e);(t.keyCode===15||t.keyCode===17)&&this._onDidInputChange.fire()})),this._disposables.add(ue(this.input,Ae.CLICK,()=>this._onDidInputChange.fire())),this._disposables.add(ue(this.input,Ae.FOCUS,()=>{this.domNode.style.outlineWidth="1px",this.domNode.style.outlineStyle="solid",this.domNode.style.outlineOffset="-1px",this.domNode.style.outlineColor="var(--vscode-focusBorder)"})),this._disposables.add(ue(this.input,Ae.BLUR,()=>{this.domNode.style.outline="none"}))),this._domNode}get input(){return Ci(this._inputNode),this._inputNode}get button(){return Ci(this._buttonNode),this._buttonNode}get buttonState(){return this._buttonState}setSparkleButton(){var e;this._buttonState="sparkle",this._sparkleIcon??(this._sparkleIcon=JC(Oe.sparkle)),Sr(this.button),this.button.appendChild(this._sparkleIcon),this.button.setAttribute("aria-label","Generating new name suggestions"),(e=this._buttonHover)==null||e.update(this._buttonGenHoverText),this.input.focus()}setStopButton(){var e;this._buttonState="stop",this._stopIcon??(this._stopIcon=JC(Oe.primitiveSquare)),Sr(this.button),this.button.appendChild(this._stopIcon),this.button.setAttribute("aria-label","Cancel generating new name suggestions"),(e=this._buttonHover)==null||e.update(this._buttonCancelHoverText),this.input.focus()}dispose(){this._disposables.dispose()}}const iI=class iI{constructor(e,t){this._domNode=document.createElement("div"),this._domNode.className="rename-box rename-candidate",this._domNode.style.display="flex",this._domNode.style.columnGap="5px",this._domNode.style.alignItems="center",this._domNode.style.height=`${t.lineHeight}px`,this._domNode.style.padding=`${iI._PADDING}px`;const i=document.createElement("div");i.style.display="flex",i.style.alignItems="center",i.style.width=i.style.height=`${t.lineHeight*.8}px`,this._domNode.appendChild(i),this._icon=JC(Oe.sparkle),this._icon.style.display="none",i.appendChild(this._icon),this._label=document.createElement("div"),kr(this._label,t),this._domNode.appendChild(this._label),e.appendChild(this._domNode)}populate(e){this._updateIcon(e),this._updateLabel(e)}_updateIcon(e){var i;const t=!!((i=e.tags)!=null&&i.includes(PU.AIGenerated));this._icon.style.display=t?"inherit":"none"}_updateLabel(e){this._label.innerText=e.newSymbolName}static getLayoutInfo({lineHeight:e}){return{totalHeight:e+iI._PADDING*2}}dispose(){}};iI._PADDING=2;let BT=iI;var cdt=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Pp=function(s,e){return function(t,i){e(t,i,s)}},uQ;class Rne{constructor(e,t,i){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=i.ordered(e)}hasProvider(){return this._providers.length>0}async resolveRenameLocation(e){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx<this._providers.length;this._providerRenameIdx++){const n=this._providers[this._providerRenameIdx];if(!n.resolveRenameLocation)break;const r=await n.resolveRenameLocation(this.model,this.position,e);if(r){if(r.rejectReason){t.push(r.rejectReason);continue}return r}}this._providerRenameIdx=0;const i=this.model.getWordAtPosition(this.position);return i?{range:new W(this.position.lineNumber,i.startColumn,this.position.lineNumber,i.endColumn),text:i.word,rejectReason:t.length>0?t.join(`
|
|
947
947
|
`):void 0}:{range:W.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join(`
|
|
948
948
|
`):void 0}}async provideRenameEdits(e,t){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)}async _provideRenameEdits(e,t,i,n){const r=this._providers[t];if(!r)return{edits:[],rejectReason:i.join(`
|
|
949
|
-
`)};const o=await r.provideRenameEdits(this.model,this.position,e,n);if(o){if(o.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(o.rejectReason),n)}else return this._provideRenameEdits(e,t+1,i.concat(w("no result","No result.")),n);return o}}async function ddt(s,e,t,i){const n=new Rne(e,t,s),r=await n.resolveRenameLocation($t.None);return r!=null&&r.rejectReason?{edits:[],rejectReason:r.rejectReason}:n.provideRenameEdits(i,$t.None)}var MC;let b_=(MC=class{static get(e){return e.getContribution(uQ.ID)}constructor(e,t,i,n,r,o,a,l,d){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=n,this._progressService=r,this._logService=o,this._configService=a,this._languageFeaturesService=l,this._telemetryService=d,this._disposableStore=new me,this._cts=new An,this._renameWidget=this._disposableStore.add(this._instaService.createInstance(dQ,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){var v,b;const e=this._logService.trace.bind(this._logService,"[rename]");if(this._cts.dispose(!0),this._cts=new An,!this.editor.hasModel()){e("editor has no model");return}const t=this.editor.getPosition(),i=new Rne(this.editor.getModel(),t,this._languageFeaturesService.renameProvider);if(!i.hasProvider()){e("skeleton has no provider");return}const n=new p_(this.editor,5,void 0,this._cts.token);let r;try{e("resolving rename location");const y=i.resolveRenameLocation(n.token);this._progressService.showWhile(y,250),r=await y,e("resolved rename location")}catch(y){y instanceof Ed?e("resolve rename location cancelled",JSON.stringify(y,null," ")):(e("resolve rename location failed",y instanceof Error?y:JSON.stringify(y,null," ")),(typeof y=="string"||Nu(y))&&((v=al.get(this.editor))==null||v.showMessage(y||w("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),t)));return}finally{n.dispose()}if(!r){e("returning early - no loc");return}if(r.rejectReason){e(`returning early - rejected with reason: ${r.rejectReason}`,r.rejectReason),(b=al.get(this.editor))==null||b.showMessage(r.rejectReason,t);return}if(n.token.isCancellationRequested){e("returning early - cts1 cancelled");return}const o=new p_(this.editor,5,r.range,this._cts.token),a=this.editor.getModel(),l=this._languageFeaturesService.newSymbolNamesProvider.all(a),d=await Promise.all(l.map(async y=>[y,await y.supportsAutomaticNewSymbolNamesTriggerKind??!1])),h=(y,x)=>{let D=d.slice();return y===CI.Automatic&&(D=D.filter(([S,E])=>E)),D.map(([S])=>S.provideNewSymbolNames(a,r.range,y,x))};e("creating rename input field and awaiting its result");const f=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),p=await this._renameWidget.getInput(r.range,r.text,f,l.length>0?h:void 0,o);if(e("received response from rename input field"),l.length>0&&this._reportTelemetry(l.length,a.getLanguageId(),p),typeof p=="boolean"){e(`returning early - rename input field response - ${p}`),p&&this.editor.focus(),o.dispose();return}this.editor.focus(),e("requesting rename edits");const m=hN(i.provideRenameEdits(p.newName,o.token),o.token).then(async y=>{if(!y){e("returning early - no rename edits result");return}if(!this.editor.hasModel()){e("returning early - no model after rename edits are provided");return}if(y.rejectReason){e(`returning early - rejected with reason: ${y.rejectReason}`),this._notificationService.info(y.rejectReason);return}this.editor.setSelection(W.fromPositions(this.editor.getSelection().getPosition())),e("applying edits"),this._bulkEditService.apply(y,{editor:this.editor,showPreview:p.wantsPreview,label:w("label","Renaming '{0}' to '{1}'",r==null?void 0:r.text,p.newName),code:"undoredo.rename",quotableLabel:w("quotableLabel","Renaming {0} to {1}",r==null?void 0:r.text,p.newName),respectAutoSaveConfig:!0}).then(x=>{e("edits applied"),x.ariaSummary&&Qo(w("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",r.text,p.newName,x.ariaSummary))}).catch(x=>{e(`error when applying edits ${JSON.stringify(x,null," ")}`),this._notificationService.error(w("rename.failedApply","Rename failed to apply edits")),this._logService.error(x)})},y=>{e("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(()=>{o.dispose()});return e("returning rename operation"),this._progressService.showWhile(m,250),m}acceptRenameInput(e){this._renameWidget.acceptInput(e)}cancelRenameInput(){this._renameWidget.cancelInput(!0,"cancelRenameInput command")}focusNextRenameSuggestion(){this._renameWidget.focusNextRenameSuggestion()}focusPreviousRenameSuggestion(){this._renameWidget.focusPreviousRenameSuggestion()}_reportTelemetry(e,t,i){const n=typeof i=="boolean"?{kind:"cancelled",languageId:t,nRenameSuggestionProviders:e}:{kind:"accepted",languageId:t,nRenameSuggestionProviders:e,source:i.stats.source.k,nRenameSuggestions:i.stats.nRenameSuggestions,timeBeforeFirstInputFieldEdit:i.stats.timeBeforeFirstInputFieldEdit,wantsPreview:i.wantsPreview,nRenameSuggestionsInvocations:i.stats.nRenameSuggestionsInvocations,hadAutomaticRenameSuggestionsInvocation:i.stats.hadAutomaticRenameSuggestionsInvocation};this._telemetryService.publicLog2("renameInvokedEvent",n)}},uQ=MC,MC.ID="editor.contrib.renameController",MC);b_=uQ=cdt([Pp(1,ut),Pp(2,gs),Pp(3,CN),Pp(4,L_),Pp(5,qr),Pp(6,PH),Pp(7,it),Pp(8,so)],b_);class udt extends Ze{constructor(){super({id:"editor.action.rename",label:w("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:ve.and(U.writable,U.hasRenameProvider),kbOpts:{kbExpr:U.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(yi),[n,r]=Array.isArray(t)&&t||[void 0,void 0];return gt.isUri(n)&&ie.isIPosition(r)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(o=>{o&&(o.setPosition(r),o.invokeWithinContext(a=>(this.reportTelemetry(a,o),this.run(a,o))))},Tt):super.runCommand(e,t)}run(e,t){const i=e.get(qr),n=b_.get(t);return n?(i.trace("[RenameAction] got controller, running..."),n.run()):(i.trace("[RenameAction] returning early - controller missing"),Promise.resolve())}}gi(b_.ID,b_,4);Pe(udt);const Pne=$s.bindToContribution(b_.get);Ue(new Pne({id:"acceptRenameInput",precondition:Zx,handler:s=>s.acceptRenameInput(!1),kbOpts:{weight:199,kbExpr:ve.and(U.focus,ve.not("isComposing")),primary:3}}));Ue(new Pne({id:"acceptRenameInputWithPreview",precondition:ve.and(Zx,ve.has("config.editor.rename.enablePreview")),handler:s=>s.acceptRenameInput(!0),kbOpts:{weight:199,kbExpr:ve.and(U.focus,ve.not("isComposing")),primary:2051}}));Ue(new Pne({id:"cancelRenameInput",precondition:Zx,handler:s=>s.cancelRenameInput(),kbOpts:{weight:199,kbExpr:U.focus,primary:9,secondary:[1033]}}));sn(class extends ea{constructor(){super({id:"focusNextRenameSuggestion",title:{...kt("focusNextRenameSuggestion","Focus Next Rename Suggestion")},precondition:Zx,keybinding:[{primary:18,weight:199}]})}run(e){const t=e.get(yi).getFocusedCodeEditor();if(!t)return;const i=b_.get(t);i&&i.focusNextRenameSuggestion()}});sn(class extends ea{constructor(){super({id:"focusPreviousRenameSuggestion",title:{...kt("focusPreviousRenameSuggestion","Focus Previous Rename Suggestion")},precondition:Zx,keybinding:[{primary:16,weight:199}]})}run(e){const t=e.get(yi).getFocusedCodeEditor();if(!t)return;const i=b_.get(t);i&&i.focusPreviousRenameSuggestion()}});Ia("_executeDocumentRenameProvider",function(s,e,t,...i){const[n]=i;Ci(typeof n=="string");const{renameProvider:r}=s.get(it);return ddt(r,e,t,n)});Ia("_executePrepareRename",async function(s,e,t){const{renameProvider:i}=s.get(it),r=await new Rne(e,t,i).resolveRenameLocation($t.None);if(r!=null&&r.rejectReason)throw new Error(r.rejectReason);return r});Fn.as(Fd.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"}}});var hdt=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},ipe=function(s,e){return function(t,i){e(t,i,s)}},bS;let U3=(bS=class extends re{constructor(e,t,i){super(),this.editor=e,this.languageConfigurationService=t,this.editorWorkerService=i,this.decorations=this.editor.createDecorationsCollection(),this.options=this.createOptions(e.getOption(73)),this.computePromise=null,this.currentOccurrences={},this._register(e.onDidChangeModel(n=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(73)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(e.onDidChangeModelLanguage(n=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(73)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(t.onDidChange(n=>{var o;const r=(o=this.editor.getModel())==null?void 0:o.getLanguageId();r&&n.affects(r)&&(this.currentOccurrences={},this.options=this.createOptions(e.getOption(73)),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(e.onDidChangeConfiguration(n=>{this.options&&!n.hasChanged(73)||(this.options=this.createOptions(e.getOption(73)),this.updateDecorations([]),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(this.editor.onDidChangeModelContent(n=>{this.computeSectionHeaders.schedule()})),this._register(e.onDidChangeModelTokens(n=>{this.computeSectionHeaders.isScheduled()||this.computeSectionHeaders.schedule(1e3)})),this.computeSectionHeaders=this._register(new ji(()=>{this.findSectionHeaders()},250)),this.computeSectionHeaders.schedule(0)}createOptions(e){if(!e||!this.editor.hasModel())return;const t=this.editor.getModel().getLanguageId();if(!t)return;const i=this.languageConfigurationService.getLanguageConfiguration(t).comments,n=this.languageConfigurationService.getLanguageConfiguration(t).foldingRules;if(!(!i&&!(n!=null&&n.markers)))return{foldingRules:n,findMarkSectionHeaders:e.showMarkSectionHeaders,findRegionSectionHeaders:e.showRegionSectionHeaders}}findSectionHeaders(){var i,n;if(!this.editor.hasModel()||!((i=this.options)!=null&&i.findMarkSectionHeaders)&&!((n=this.options)!=null&&n.findRegionSectionHeaders))return;const e=this.editor.getModel();if(e.isDisposed()||e.isTooLargeForSyncing())return;const t=e.getVersionId();this.editorWorkerService.findSectionHeaders(e.uri,this.options).then(r=>{e.isDisposed()||e.getVersionId()!==t||this.updateDecorations(r)})}updateDecorations(e){const t=this.editor.getModel();t&&(e=e.filter(r=>{if(!r.shouldBeInComments)return!0;const o=t.validateRange(r.range),a=t.tokenization.getLineTokens(o.startLineNumber),l=a.findTokenIndexAtOffset(o.startColumn-1),d=a.getStandardTokenType(l);return a.getLanguageId(l)===t.getLanguageId()&&d===1}));const i=Object.values(this.currentOccurrences).map(r=>r.decorationId),n=e.map(r=>fdt(r));this.editor.changeDecorations(r=>{const o=r.deltaDecorations(i,n);this.currentOccurrences={};for(let a=0,l=o.length;a<l;a++){const d={sectionHeader:e[a],decorationId:o[a]};this.currentOccurrences[d.decorationId]=d}})}stop(){this.computeSectionHeaders.cancel(),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop(),this.decorations.clear()}},bS.ID="editor.sectionHeaderDetector",bS);U3=hdt([ipe(1,Bn),ipe(2,Na)],U3);function fdt(s){return{range:s.range,options:Ot.createDynamic({description:"section-header",stickiness:3,collapseOnReplaceEdit:!0,minimap:{color:void 0,position:1,sectionHeaderStyle:s.hasSeparatorLine?2:1,sectionHeaderText:s.text}})}}gi(U3.ID,U3,1);function gdt(s){for(let e=0,t=s.length;e<t;e+=4){const i=s[e+0],n=s[e+1],r=s[e+2],o=s[e+3];s[e+0]=o,s[e+1]=r,s[e+2]=n,s[e+3]=i}}function pdt(s){const e=new Uint8Array(s.buffer,s.byteOffset,s.length*4);return hve()||gdt(e),NH.wrap(e)}function nxe(s){const e=new Uint32Array(mdt(s));let t=0;if(e[t++]=s.id,s.type==="full")e[t++]=1,e[t++]=s.data.length,e.set(s.data,t),t+=s.data.length;else{e[t++]=2,e[t++]=s.deltas.length;for(const i of s.deltas)e[t++]=i.start,e[t++]=i.deleteCount,i.data?(e[t++]=i.data.length,e.set(i.data,t),t+=i.data.length):e[t++]=0}return pdt(e)}function mdt(s){let e=0;if(e+=2,s.type==="full")e+=1+s.data.length;else{e+=1,e+=3*s.deltas.length;for(const t of s.deltas)t.data&&(e+=t.data.length)}return e}function zV(s){return s&&!!s.data}function sxe(s){return s&&Array.isArray(s.edits)}class _dt{constructor(e,t,i){this.provider=e,this.tokens=t,this.error=i}}function rxe(s,e){return s.has(e)}function vdt(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:[]}async function oxe(s,e,t,i,n){const r=vdt(s,e),o=await Promise.all(r.map(async a=>{let l,d=null;try{l=await a.provideDocumentSemanticTokens(e,a===t?i:null,n)}catch(h){d=h,l=null}return(!l||!zV(l)&&!sxe(l))&&(l=null),new _dt(a,l,d)}));for(const a of o){if(a.error)throw a.error;if(a.tokens)return a}return o.length>0?o[0]:null}function bdt(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:null}class Cdt{constructor(e,t){this.provider=e,this.tokens=t}}function ydt(s,e){return s.has(e)}function axe(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:[]}async function One(s,e,t,i){const n=axe(s,e),r=await Promise.all(n.map(async o=>{let a;try{a=await o.provideDocumentRangeSemanticTokens(e,t,i)}catch(l){is(l),a=null}return(!a||!zV(a))&&(a=null),new Cdt(o,a)}));for(const o of r)if(o.tokens)return o;return r.length>0?r[0]:null}hi.registerCommand("_provideDocumentSemanticTokensLegend",async(s,...e)=>{const[t]=e;Ci(t instanceof gt);const i=s.get(pn).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=s.get(it),r=bdt(n,i);return r?r[0].getLegend():s.get(on).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)});hi.registerCommand("_provideDocumentSemanticTokens",async(s,...e)=>{const[t]=e;Ci(t instanceof gt);const i=s.get(pn).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=s.get(it);if(!rxe(n,i))return s.get(on).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());const r=await oxe(n,i,null,null,$t.None);if(!r)return;const{provider:o,tokens:a}=r;if(!a||!zV(a))return;const l=nxe({id:0,type:"full",data:a.data});return a.resultId&&o.releaseDocumentSemanticTokens(a.resultId),l});hi.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(s,...e)=>{const[t,i]=e;Ci(t instanceof gt);const n=s.get(pn).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:r}=s.get(it),o=axe(r,n);if(o.length===0)return;if(o.length===1)return o[0].getLegend();if(!i||!W.isIRange(i))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),o[0].getLegend();const a=await One(r,n,W.lift(i),$t.None);if(a)return a.provider.getLegend()});hi.registerCommand("_provideDocumentRangeSemanticTokens",async(s,...e)=>{const[t,i]=e;Ci(t instanceof gt),Ci(W.isIRange(i));const n=s.get(pn).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:r}=s.get(it),o=await One(r,n,W.lift(i),$t.None);if(!(!o||!o.tokens))return nxe({id:0,type:"full",data:o.tokens.data})});const Ane="editor.semanticHighlighting";function DF(s,e,t){var n;const i=(n=t.getValue(Ane,{overrideIdentifier:s.getLanguageId(),resource:s.uri}))==null?void 0:n.enabled;return typeof i=="boolean"?i:e.getColorTheme().semanticHighlighting}var lxe=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Rh=function(s,e){return function(t,i){e(t,i,s)}},Bp;let hQ=class extends re{constructor(e,t,i,n,r,o){super(),this._watchers=Object.create(null);const a=h=>{this._watchers[h.uri.toString()]=new fQ(h,e,i,r,o)},l=(h,f)=>{f.dispose(),delete this._watchers[h.uri.toString()]},d=()=>{for(const h of t.getModels()){const f=this._watchers[h.uri.toString()];DF(h,i,n)?f||a(h):f&&l(h,f)}};t.getModels().forEach(h=>{DF(h,i,n)&&a(h)}),this._register(t.onModelAdded(h=>{DF(h,i,n)&&a(h)})),this._register(t.onModelRemoved(h=>{const f=this._watchers[h.uri.toString()];f&&l(h,f)})),this._register(n.onDidChangeConfiguration(h=>{h.affectsConfiguration(Ane)&&d()})),this._register(i.onDidColorThemeChange(d))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};hQ=lxe([Rh(0,AH),Rh(1,pn),Rh(2,zs),Rh(3,Gt),Rh(4,sc),Rh(5,it)],hQ);var Km;let fQ=(Km=class extends re{constructor(e,t,i,n,r){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=r.documentSemanticTokensProvider,this._debounceInformation=n.for(this._provider,"DocumentSemanticTokens",{min:Bp.REQUEST_MIN_DELAY,max:Bp.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new ji(()=>this._fetchDocumentSemanticTokensNow(),Bp.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 o=()=>{Xi(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)}))};o(),this._register(this._provider.onDidChange(()=>{o(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(i.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),Xi(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!rxe(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new An,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,n=oxe(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const r=[],o=this._model.onDidChangeContent(l=>{r.push(l)}),a=new cr(!1);n.then(l=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,o.dispose(),!l)this._setDocumentSemanticTokens(null,null,null,r);else{const{provider:d,tokens:h}=l,f=this._semanticTokensStylingService.getStyling(d);this._setDocumentSemanticTokens(d,h||null,f,r)}},l=>{l&&(zc(l)||typeof l.message=="string"&&l.message.indexOf("busy")!==-1)||Tt(l),this._currentDocumentRequestCancellationTokenSource=null,o.dispose(),(r.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,i,n,r){r=Math.min(r,i.length-n,e.length-t);for(let o=0;o<r;o++)i[n+o]=e[t+o]}_setDocumentSemanticTokens(e,t,i,n){const r=this._currentDocumentResponse,o=()=>{(n.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||!i){this._model.tokenization.setSemanticTokens(null,!1);return}if(!t){this._model.tokenization.setSemanticTokens(null,!0),o();return}if(sxe(t)){if(!r){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:r.data};else{let a=0;for(const p of t.edits)a+=(p.data?p.data.length:0)-p.deleteCount;const l=r.data,d=new Uint32Array(l.length+a);let h=l.length,f=d.length;for(let p=t.edits.length-1;p>=0;p--){const m=t.edits[p];if(m.start>l.length){i.warnInvalidEditStart(r.resultId,t.resultId,p,m.start,l.length),this._model.tokenization.setSemanticTokens(null,!0);return}const v=h-(m.start+m.deleteCount);v>0&&(Bp._copy(l,h-v,d,f-v,v),f-=v),m.data&&(Bp._copy(m.data,0,d,f-m.data.length,m.data.length),f-=m.data.length),h=m.start}h>0&&Bp._copy(l,0,d,0,h),t={resultId:t.resultId,data:d}}}if(zV(t)){this._currentDocumentResponse=new wdt(e,t.resultId,t.data);const a=nCe(t,i,this._model.getLanguageId());if(n.length>0)for(const l of n)for(const d of a)for(const h of l.changes)d.applyEdit(h.range,h.text);this._model.tokenization.setSemanticTokens(a,!0)}else this._model.tokenization.setSemanticTokens(null,!0);o()}},Bp=Km,Km.REQUEST_MIN_DELAY=300,Km.REQUEST_MAX_DELAY=2e3,Km);fQ=Bp=lxe([Rh(1,AH),Rh(2,zs),Rh(3,sc),Rh(4,it)],fQ);class wdt{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}$x(hQ);var Sdt=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},wD=function(s,e){return function(t,i){e(t,i,s)}},CS;let q3=(CS=class extends re{constructor(e,t,i,n,r,o){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=n,this._editor=e,this._provider=o.documentRangeSemanticTokensProvider,this._debounceInformation=r.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new ji(()=>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(Ane)&&(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,i=this._outstandingRequests.length;t<i;t++)if(this._outstandingRequests[t]===e){this._outstandingRequests.splice(t,1);return}}_tokenizeViewportNow(){if(!this._editor.hasModel())return;const e=this._editor.getModel();if(e.tokenization.hasCompleteSemanticTokens())return;if(!DF(e,this._themeService,this._configurationService)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}if(!ydt(this._provider,e)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}const t=this._editor.getVisibleRangesPlusViewportAboveBelow();this._outstandingRequests=this._outstandingRequests.concat(t.map(i=>this._requestRange(e,i)))}_requestRange(e,t){const i=e.getVersionId(),n=Zs(o=>Promise.resolve(One(this._provider,e,t,o))),r=new cr(!1);return n.then(o=>{if(this._debounceInformation.update(e,r.elapsed()),!o||!o.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:a,tokens:l}=o,d=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,nCe(l,d,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(n),()=>this._removeOutstandingRequest(n)),n}},CS.ID="editor.contrib.viewportSemanticTokens",CS);q3=Sdt([wD(1,AH),wD(2,zs),wD(3,Gt),wD(4,sc),wD(5,it)],q3);gi(q3.ID,q3,1);class xdt{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const n of t){const r=[];i.push(r),this.selectSubwords&&this._addInWordRanges(r,e,n),this._addWordRanges(r,e,n),this._addWhitespaceLine(r,e,n),r.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const n=t.getWordAtPosition(i);if(!n)return;const{word:r,startColumn:o}=n,a=i.column-o;let l=a,d=a,h=0;for(;l>=0;l--){const f=r.charCodeAt(l);if(l!==a&&(f===95||f===45))break;if(om(f)&&Ih(h))break;h=f}for(l+=1;d<r.length;d++){const f=r.charCodeAt(d);if(Ih(f)&&om(h))break;if(f===95||f===45)break;h=f}l<d&&e.push({range:new W(i.lineNumber,o+l,i.lineNumber,o+d)})}_addWordRanges(e,t,i){const n=t.getWordAtPosition(i);n&&e.push({range:new W(i.lineNumber,n.startColumn,i.lineNumber,n.endColumn)})}_addWhitespaceLine(e,t,i){t.getLineLength(i.lineNumber)>0&&t.getLineFirstNonWhitespaceColumn(i.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(i.lineNumber)===0&&e.push({range:new W(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var kdt=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Ldt=function(s,e){return function(t,i){e(t,i,s)}},gQ;class Fne{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 i=new Fne(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}var RC;let WT=(RC=class{static get(e){return e.getContribution(gQ.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){var e;(e=this._selectionListener)==null||e.dispose()}async run(e){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(this._state||await dxe(this._languageFeaturesService.selectionRangeProvider,i,t.map(r=>r.getPosition()),this._editor.getOption(114),$t.None).then(r=>{var o;if(!(!So(r)||r.length!==t.length)&&!(!this._editor.hasModel()||!Tn(this._editor.getSelections(),t,(a,l)=>a.equalsSelection(l)))){for(let a=0;a<r.length;a++)r[a]=r[a].filter(l=>l.containsPosition(t[a].getStartPosition())&&l.containsPosition(t[a].getEndPosition())),r[a].unshift(t[a]);this._state=r.map(a=>new Fne(0,a)),(o=this._selectionListener)==null||o.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{var a;this._ignoreSelection||((a=this._selectionListener)==null||a.dispose(),this._state=void 0)})}}),!this._state)return;this._state=this._state.map(r=>r.mov(e));const n=this._state.map(r=>ot.fromPositions(r.ranges[r.index].getStartPosition(),r.ranges[r.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(n)}finally{this._ignoreSelection=!1}}},gQ=RC,RC.ID="editor.contrib.smartSelectController",RC);WT=gQ=kdt([Ldt(1,it)],WT);class cxe extends Ze{constructor(e,t){super(t),this._forward=e}async run(e,t){const i=WT.get(t);i&&await i.run(this._forward)}}class Ddt extends cxe{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:w("smartSelect.expand","Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:st.MenubarSelectionMenu,group:"1_basic",title:w({key:"miSmartSelectGrow",comment:["&& denotes a mnemonic"]},"&&Expand Selection"),order:2}})}}hi.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class Edt extends cxe{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:w("smartSelect.shrink","Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:st.MenubarSelectionMenu,group:"1_basic",title:w({key:"miSmartSelectShrink",comment:["&& denotes a mnemonic"]},"&&Shrink Selection"),order:3}})}}gi(WT.ID,WT,4);Pe(Ddt);Pe(Edt);async function dxe(s,e,t,i,n){const r=s.all(e).concat(new xdt(i.selectSubwords));r.length===1&&r.unshift(new T3);const o=[],a=[];for(const l of r)o.push(Promise.resolve(l.provideSelectionRanges(e,t,n)).then(d=>{if(So(d)&&d.length===t.length)for(let h=0;h<t.length;h++){a[h]||(a[h]=[]);for(const f of d[h])W.isIRange(f.range)&&W.containsPosition(f.range,t[h])&&a[h].push(W.lift(f.range))}},is));return await Promise.all(o),a.map(l=>{if(l.length===0)return[];l.sort((p,m)=>ie.isBefore(p.getStartPosition(),m.getStartPosition())?1:ie.isBefore(m.getStartPosition(),p.getStartPosition())||ie.isBefore(p.getEndPosition(),m.getEndPosition())?-1:ie.isBefore(m.getEndPosition(),p.getEndPosition())?1:0);const d=[];let h;for(const p of l)(!h||W.containsRange(p,h)&&!W.equalsRange(p,h))&&(d.push(p),h=p);if(!i.selectLeadingAndTrailingWhitespace)return d;const f=[d[0]];for(let p=1;p<d.length;p++){const m=d[p-1],v=d[p];if(v.startLineNumber!==m.startLineNumber||v.endLineNumber!==m.endLineNumber){const b=new W(m.startLineNumber,e.getLineFirstNonWhitespaceColumn(m.startLineNumber),m.endLineNumber,e.getLineLastNonWhitespaceColumn(m.endLineNumber));b.containsRange(m)&&!b.equalsRange(m)&&v.containsRange(b)&&!v.equalsRange(b)&&f.push(b);const y=new W(m.startLineNumber,1,m.endLineNumber,e.getLineMaxColumn(m.endLineNumber));y.containsRange(m)&&!y.equalsRange(b)&&v.containsRange(y)&&!v.equalsRange(y)&&f.push(y)}f.push(v)}return f})}hi.registerCommand("_executeSelectionRangeProvider",async function(s,...e){const[t,i]=e;Ci(gt.isUri(t));const n=s.get(it).selectionRangeProvider,r=await s.get(Ea).createModelReference(t);try{return dxe(n,r.object.textEditorModel,i,{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},$t.None)}finally{r.dispose()}});const Idt=Object.freeze({View:kt("view","View"),Help:kt("help","Help"),Test:kt("test","Test"),File:kt("file","File"),Preferences:kt("preferences","Preferences"),Developer:kt({key:"developer",comment:["A developer on Code itself or someone diagnosing issues in Code"]},"Developer")});class OE{constructor(e,t,i,n=null){this.startLineNumbers=e,this.endLineNumbers=t,this.lastLineRelativePosition=i,this.showEndForLine=n}equals(e){return!!e&&this.lastLineRelativePosition===e.lastLineRelativePosition&&this.showEndForLine===e.showEndForLine&&Tn(this.startLineNumbers,e.startLineNumbers)&&Tn(this.endLineNumbers,e.endLineNumbers)}static get Empty(){return new OE([],[],0)}}const npe=Ug("stickyScrollViewLayer",{createHTML:s=>s}),Dj="data-sticky-line-index",spe="data-sticky-is-line",Tdt="data-sticky-is-line-number",rpe="data-sticky-is-folding-icon";class Ndt extends re{constructor(e){super(),this._editor=e,this._foldingIconStore=new me,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 Pd),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(116).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(116)&&t(),i.hasChanged(67)&&(this._lineHeight=this._editor.getOption(67))})),this._register(this._editor.onDidScrollChange(i=>{i.scrollLeftChanged&&t(),i.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{t(),this._updateWidgetWidth()})),this._register(this._foldingIconStore),t(),this._register(this._editor.onDidLayoutChange(i=>{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,i){if(i===void 0&&(!this._previousState&&!e||this._previousState&&this._previousState.equals(e)))return;const n=this._isWidgetHeightZero(e),r=n?void 0:e,o=n?0:this._findLineToRebuildWidgetFrom(e,i);this._renderRootNode(r,t,o),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 i=[...e.startLineNumbers];e.showEndForLine!==null&&(i[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=i}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 i=this._previousState,n=e.startLineNumbers.findIndex(r=>!i.startLineNumbers.includes(r));return n===-1?0:n}_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;t<this._renderedStickyLines.length;t++){const i=this._renderedStickyLines[t];i.lineNumberDomNode.remove(),i.lineDomNode.remove()}this._renderedStickyLines=this._renderedStickyLines.slice(0,e),this._rootDomNode.style.display="none"}_useFoldingOpacityTransition(e){this._lineNumbersDomNode.style.setProperty("--vscode-editorStickyScroll-foldingOpacityTransition",`opacity ${e?.5:0}s`)}_setFoldingIconsVisibility(e){for(const t of this._renderedStickyLines){const i=t.foldingIcon;i&&i.setVisible(e?!0:i.isCollapsed)}}async _renderRootNode(e,t,i){if(this._clearStickyLinesFromLine(i),!e)return;for(const a of this._renderedStickyLines)this._updateTopAndZIndexOfStickyLine(a);const n=this._editor.getLayoutInfo(),r=this._lineNumbers.slice(i);for(const[a,l]of r.entries()){const d=this._renderChildNode(a+i,l,t,n);d&&(this._linesDomNode.appendChild(d.lineDomNode),this._lineNumbersDomNode.appendChild(d.lineNumberDomNode),this._renderedStickyLines.push(d))}t&&(this._setFoldingHoverListeners(),this._useFoldingOpacityTransition(!this._isOnGlyphMargin));const o=this._lineNumbers.length*this._lineHeight+this._lastLineRelativePosition;this._rootDomNode.style.display="block",this._lineNumbersDomNode.style.height=`${o}px`,this._linesDomNodeScrollable.style.height=`${o}px`,this._rootDomNode.style.height=`${o}px`,this._rootDomNode.style.marginLeft="0px",this._minContentWidthInPx=Math.max(...this._renderedStickyLines.map(a=>a.scrollWidth))+n.verticalScrollbarWidth,this._editor.layoutOverlayWidget(this)}_setFoldingHoverListeners(){this._editor.getOption(111)==="mouseover"&&(this._foldingIconStore.add(ue(this._lineNumbersDomNode,Ae.MOUSE_ENTER,()=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(ue(this._lineNumbersDomNode,Ae.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,i,n){const r=this._editor._getViewModel();if(!r)return;const o=r.coordinatesConverter.convertModelPositionToViewPosition(new ie(t,1)).lineNumber,a=r.getViewLineRenderingData(o),l=this._editor.getOption(68);let d;try{d=zo.filter(a.inlineDecorations,o,a.minColumn,a.maxColumn)}catch{d=[]}const h=new T_(!0,!0,a.content,a.continuesWithWrappedLine,a.isBasicASCII,a.containsRTL,0,a.tokens,d,a.tabSize,a.startVisibleColumn,1,1,1,500,"none",!0,!0,null),f=new Ix(2e3),p=MN(h,f);let m;npe?m=npe.createHTML(f.build()):m=f.build();const v=document.createElement("span");v.setAttribute(Dj,String(e)),v.setAttribute(spe,""),v.setAttribute("role","listitem"),v.tabIndex=0,v.className="sticky-line-content",v.classList.add(`stickyLine${t}`),v.style.lineHeight=`${this._lineHeight}px`,v.innerHTML=m;const b=document.createElement("span");b.setAttribute(Dj,String(e)),b.setAttribute(Tdt,""),b.className="sticky-line-number",b.style.lineHeight=`${this._lineHeight}px`;const y=n.contentLeft;b.style.width=`${y}px`;const x=document.createElement("span");l.renderType===1||l.renderType===3&&t%10===0?x.innerText=t.toString():l.renderType===2&&(x.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),x.className="sticky-line-number-inner",x.style.lineHeight=`${this._lineHeight}px`,x.style.width=`${n.lineNumbersWidth}px`,x.style.paddingLeft=`${n.lineNumbersLeft}px`,b.appendChild(x);const D=this._renderFoldingIconForLine(i,t);D&&b.appendChild(D.domNode),this._editor.applyFontInfo(v),this._editor.applyFontInfo(x),b.style.lineHeight=`${this._lineHeight}px`,v.style.lineHeight=`${this._lineHeight}px`,b.style.height=`${this._lineHeight}px`,v.style.height=`${this._lineHeight}px`;const S=new Mdt(e,t,v,b,D,p.characterMapping,v.scrollWidth);return this._updateTopAndZIndexOfStickyLine(S)}_updateTopAndZIndexOfStickyLine(e){var h;const t=e.index,i=e.lineDomNode,n=e.lineNumberDomNode,r=t===this._lineNumbers.length-1,o="0",a="1";i.style.zIndex=r?o:a,n.style.zIndex=r?o:a;const l=`${t*this._lineHeight+this._lastLineRelativePosition+((h=e.foldingIcon)!=null&&h.isCollapsed?1:0)}px`,d=`${t*this._lineHeight}px`;return i.style.top=r?l:d,n.style.top=r?l:d,e}_renderFoldingIconForLine(e,t){const i=this._editor.getOption(111);if(!e||i==="never")return;const n=e.regions,r=n.findRange(t),o=n.getStartLineNumber(r);if(!(t===o))return;const l=n.isCollapsed(r),d=new Rdt(l,o,n.getEndLineNumber(r),this._lineHeight);return d.setVisible(this._isOnGlyphMargin?!0:l||i==="always"),d.domNode.setAttribute(rpe,""),d}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:2,stackOridinal:10}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e<this._renderedStickyLines.length&&this._renderedStickyLines[e].lineDomNode.focus()}getEditorPositionFromNode(e){if(!e||e.children.length>0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const i=uie(t.characterMapping,e,0);return new ie(t.lineNumber,i)}getLineNumberFromChildDomNode(e){var t;return((t=this._getRenderedStickyLineFromChildDomNode(e))==null?void 0:t.lineNumber)??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,Dj);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,spe)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,rpe)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const i=e.getAttribute(t);if(i!==null)return i;e=e.parentElement}}}class Mdt{constructor(e,t,i,n,r,o,a){this.index=e,this.lineNumber=t,this.lineDomNode=i,this.lineNumberDomNode=n,this.foldingIcon=r,this.characterMapping=o,this.scrollWidth=a}}class Rdt{constructor(e,t,i,n){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=i,this.dimension=n,this.domNode=document.createElement("div"),this.domNode.style.width=`${n}px`,this.domNode.style.height=`${n}px`,this.domNode.className=bt.asClassName(e?b3:v3)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class AE{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class K3{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}}class uxe{constructor(e,t,i,n){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=n}}var jV=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},HT=function(s,e){return function(t,i){e(t,i,s)}},FE;(function(s){s.OUTLINE_MODEL="outlineModel",s.FOLDING_PROVIDER_MODEL="foldingProviderModel",s.INDENTATION_MODEL="indentationModel"})(FE||(FE={}));var vm;(function(s){s[s.VALID=0]="VALID",s[s.INVALID=1]="INVALID",s[s.CANCELED=2]="CANCELED"})(vm||(vm={}));let pQ=class extends re{constructor(e,t,i,n){switch(super(),this._editor=e,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new Ac(300)),this._updateOperation=this._register(new me),this._editor.getOption(116).defaultModel){case FE.OUTLINE_MODEL:this._modelProviders.push(new mQ(this._editor,n));case FE.FOLDING_PROVIDER_MODEL:this._modelProviders.push(new vQ(this._editor,t,n));case FE.INDENTATION_MODEL:this._modelProviders.push(new _Q(this._editor,i));break}}dispose(){this._modelProviders.forEach(e=>e.dispose()),this._updateOperation.clear(),this._cancelModelPromise(),super.dispose()}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}async update(e){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),await this._updateScheduler.trigger(async()=>{for(const t of this._modelProviders){const{statusPromise:i,modelPromise:n}=t.computeStickyModel(e);this._modelPromise=n;const r=await i;if(this._modelPromise!==n)return null;switch(r){case vm.CANCELED:return this._updateOperation.clear(),null;case vm.VALID:return t.stickyModel}}return null}).catch(t=>(Tt(t),null))}};pQ=jV([HT(2,ut),HT(3,it)],pQ);class hxe extends re{constructor(e){super(),this._editor=e,this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,vm.INVALID}computeStickyModel(e){if(e.isCancellationRequested||!this.isProviderValid())return{statusPromise:this._invalid(),modelPromise:null};const t=Zs(i=>this.createModelFromProvider(i));return{statusPromise:t.then(i=>this.isModelValid(i)?e.isCancellationRequested?vm.CANCELED:(this._stickyModel=this.createStickyModel(e,i),vm.VALID):this._invalid()).then(void 0,i=>(Tt(i),vm.CANCELED)),modelPromise:t}}isModelValid(e){return!0}isProviderValid(){return!0}}let mQ=class extends hxe{constructor(e,t){super(e),this._languageFeaturesService=t}createModelFromProvider(e){return Qf.create(this._languageFeaturesService.documentSymbolProvider,this._editor.getModel(),e)}createStickyModel(e,t){var o;const{stickyOutlineElement:i,providerID:n}=this._stickyModelFromOutlineModel(t,(o=this._stickyModel)==null?void 0:o.outlineProviderId),r=this._editor.getModel();return new uxe(r.uri,r.getVersionId(),i,n)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(ui.first(e.children.values())instanceof RSe){const a=ui.find(e.children.values(),l=>l.id===t);if(a)i=a.children;else{let l="",d=-1,h;for(const[f,p]of e.children.entries()){const m=this._findSumOfRangesOfGroup(p);m>d&&(h=p,d=m,l=p.id)}t=l,i=h.children}}else i=e.children;const n=[],r=Array.from(i.values()).sort((a,l)=>{const d=new AE(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),h=new AE(l.symbol.range.startLineNumber,l.symbol.range.endLineNumber);return this._comparator(d,h)});for(const a of r)n.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new K3(void 0,n,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const i=[];for(const r of e.children.values())if(r.symbol.selectionRange.startLineNumber!==r.symbol.range.endLineNumber)if(r.symbol.selectionRange.startLineNumber!==t)i.push(this._stickyModelFromOutlineElement(r,r.symbol.selectionRange.startLineNumber));else for(const o of r.children.values())i.push(this._stickyModelFromOutlineElement(o,r.symbol.selectionRange.startLineNumber));i.sort((r,o)=>this._comparator(r.range,o.range));const n=new AE(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new K3(n,i,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 i of e.children.values())t+=this._findSumOfRangesOfGroup(i);return e instanceof rX?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};mQ=jV([HT(1,it)],mQ);class fxe extends hxe{constructor(e){super(e),this._foldingLimitReporter=new TSe(e)}createStickyModel(e,t){const i=this._fromFoldingRegions(t),n=this._editor.getModel();return new uxe(n.uri,n.getVersionId(),i,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,i=[],n=new K3(void 0,[],void 0);for(let r=0;r<t;r++){const o=e.getParentIndex(r);let a;o!==-1?a=i[o]:a=n;const l=new K3(new AE(e.getStartLineNumber(r),e.getEndLineNumber(r)+1),[],a);a.children.push(l),i.push(l)}return n}}let _Q=class extends fxe{constructor(e,t){super(e),this._languageConfigurationService=t,this.provider=this._register(new wne(e.getModel(),this._languageConfigurationService,this._foldingLimitReporter))}async createModelFromProvider(e){return this.provider.compute(e)}};_Q=jV([HT(1,Bn)],_Q);let vQ=class extends fxe{constructor(e,t,i){super(e),this._languageFeaturesService=i;const n=v_.getFoldingRangeProviders(this._languageFeaturesService,e.getModel());n.length>0&&(this.provider=this._register(new Sne(e.getModel(),n,t,this._foldingLimitReporter,void 0)))}isProviderValid(){return this.provider!==void 0}async createModelFromProvider(e){var t;return((t=this.provider)==null?void 0:t.compute(e))??null}};vQ=jV([HT(2,it)],vQ);var Pdt=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},ope=function(s,e){return function(t,i){e(t,i,s)}};class Odt{constructor(e,t,i){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=i}}let bQ=class extends re{constructor(e,t,i){super(),this._languageFeaturesService=t,this._languageConfigurationService=i,this._onDidChangeStickyScroll=this._register(new se),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new me),this._updateSoon=this._register(new ji(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(116)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._sessionStore.clear(),this._editor.getOption(116).enabled&&(this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,this.updateStickyModelProvider(),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._sessionStore.add(dt(()=>{var t;(t=this._stickyModelProvider)==null||t.dispose(),this._stickyModelProvider=null})),this.updateStickyModelProvider(),this.update())}getVersionId(){var e;return(e=this._model)==null?void 0:e.version}updateStickyModelProvider(){var t;(t=this._stickyModelProvider)==null||t.dispose(),this._stickyModelProvider=null;const e=this._editor;e.hasModel()&&(this._stickyModelProvider=new pQ(e,()=>this._updateSoon.schedule(),this._languageConfigurationService,this._languageFeaturesService))}async update(){var e;(e=this._cts)==null||e.dispose(!0),this._cts=new An,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=await this._stickyModelProvider.update(e);e.isCancellationRequested||(this._model=t)}updateIndex(e){return e===-1?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,t,i,n,r){if(t.children.length===0)return;let o=r;const a=[];for(let h=0;h<t.children.length;h++){const f=t.children[h];f.range&&a.push(f.range.startLineNumber)}const l=this.updateIndex(hI(a,e.startLineNumber,(h,f)=>h-f)),d=this.updateIndex(hI(a,e.startLineNumber+n,(h,f)=>h-f));for(let h=l;h<=d;h++){const f=t.children[h];if(!f)return;if(f.range){const p=f.range.startLineNumber,m=f.range.endLineNumber;e.startLineNumber<=m+1&&p-1<=e.endLineNumber&&p!==o&&(o=p,i.push(new Odt(p,m-1,n+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,f,i,n+1,p))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,f,i,n,r)}}getCandidateStickyLinesIntersecting(e){var n,r;if(!((n=this._model)!=null&&n.element))return[];let t=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,t,0,-1);const i=(r=this._editor._getViewModel())==null?void 0:r.getHiddenAreas();if(i)for(const o of i)t=t.filter(a=>!(a.startLineNumber>=o.startLineNumber&&a.endLineNumber<=o.endLineNumber+1));return t}};bQ=Pdt([ope(1,it),ope(2,Bn)],bQ);var Adt=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},F1=function(s,e){return function(t,i){e(t,i,s)}},CQ,PC;let $g=(PC=class extends re{constructor(e,t,i,n,r,o,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=i,this._instaService=n,this._contextKeyService=a,this._sessionStore=new me,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._stickyScrollWidget=new Ndt(this._editor),this._stickyLineCandidateProvider=new bQ(this._editor,i,r),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=OE.Empty,this._onDidResize(),this._readConfiguration();const l=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration(h=>{this._readConfigurationChange(h)})),this._register(ue(l,Ae.CONTEXT_MENU,async h=>{this._onContextMenu(mt(l),h)})),this._stickyScrollFocusedContextKey=U.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=U.stickyScrollVisible.bindTo(this._contextKeyService);const d=this._register(Pu(l));this._register(d.onDidBlur(h=>{this._positionRevealed===!1&&l.clientHeight===0?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()})),this._register(d.onDidFocus(h=>{this.focus()})),this._registerMouseListeners(),this._register(ue(l,Ae.MOUSE_DOWN,h=>{this._onMouseDown=!0}))}static get(e){return e.getContribution(CQ.ID)}_disposeFocusStickyScrollStore(){var e;this._stickyScrollFocusedContextKey.set(!1),(e=this._focusDisposableStore)==null||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 me,this._stickyScrollFocusedContextKey.set(!0),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumbers.length-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}focusNext(){this._focusedStickyElementIndex<this._stickyScrollWidget.lineNumberCount-1&&this._focusNav(!0)}focusPrevious(){this._focusedStickyElementIndex>0&&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(W.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new me),t=this._register(new RV(this._editor,{extractLineNumberFromMouseEvent:r=>{const o=this._stickyScrollWidget.getEditorPositionFromNode(r.target.element);return o?o.lineNumber:0}})),i=r=>{if(!this._editor.hasModel()||r.target.type!==12||r.target.detail!==this._stickyScrollWidget.getId())return null;const o=r.target.element;if(!o||o.innerText!==o.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(o);return a?{range:new W(a.lineNumber,a.column,a.lineNumber,a.column+o.innerText.length),textElement:o}:null},n=this._stickyScrollWidget.getDomNode();this._register(Hn(n,Ae.CLICK,r=>{if(r.ctrlKey||r.altKey||r.metaKey||!r.leftButton)return;if(r.shiftKey){const d=this._stickyScrollWidget.getLineIndexFromChildDomNode(r.target);if(d===null)return;const h=new ie(this._endLineNumbers[d],1);this._revealLineInCenterIfOutsideViewport(h);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(r.target)){const d=this._stickyScrollWidget.getLineNumberFromChildDomNode(r.target);this._toggleFoldingRegionForLine(d);return}if(!this._stickyScrollWidget.isInStickyLine(r.target))return;let l=this._stickyScrollWidget.getEditorPositionFromNode(r.target);if(!l){const d=this._stickyScrollWidget.getLineNumberFromChildDomNode(r.target);if(d===null)return;l=new ie(d,1)}this._revealPosition(l)})),this._register(Hn(n,Ae.MOUSE_MOVE,r=>{if(r.shiftKey){const o=this._stickyScrollWidget.getLineIndexFromChildDomNode(r.target);if(o===null||this._showEndForLine!==null&&this._showEndForLine===o)return;this._showEndForLine=o,this._renderStickyScroll();return}this._showEndForLine!==void 0&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(ue(n,Ae.MOUSE_LEAVE,r=>{this._showEndForLine!==void 0&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([r,o])=>{const a=i(r);if(!a||!r.hasTriggerModifier||!this._editor.hasModel()){e.clear();return}const{range:l,textElement:d}=a;if(!l.equalsRange(this._stickyRangeProjectedOnEditor))this._stickyRangeProjectedOnEditor=l,e.clear();else if(d.style.textDecoration==="underline")return;const h=new An;e.add(dt(()=>h.dispose(!0)));let f;$N(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new ie(l.startLineNumber,l.startColumn+1),!1,h.token).then(p=>{if(!h.token.isCancellationRequested)if(p.length!==0){this._candidateDefinitionsLength=p.length;const m=d;f!==m?(e.clear(),f=m,f.style.textDecoration="underline",e.add(dt(()=>{f.style.textDecoration="none"}))):f||(f=m,f.style.textDecoration="underline",e.add(dt(()=>{f.style.textDecoration="none"})))}else e.clear()})})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(async r=>{if(r.target.type!==12||r.target.detail!==this._stickyScrollWidget.getId())return;const o=this._stickyScrollWidget.getEditorPositionFromNode(r.target.element);o&&(!this._editor.hasModel()||!this._stickyRangeProjectedOnEditor||(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:o.lineNumber,column:1})),this._instaService.invokeFunction(fSe,r,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor})))}))}_onContextMenu(e,t){const i=new Cd(e,t);this._contextMenuService.showContextMenu({menuId:st.StickyScrollContext,getAnchor:()=>i})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getRenderedStickyLine(e),i=t==null?void 0:t.foldingIcon;if(!i)return;bne(this._foldingModel,Number.MAX_VALUE,[e]),i.isCollapsed=!i.isCollapsed;const n=(i.isCollapsed?this._editor.getTopForLineNumber(i.foldingEndLine):this._editor.getTopForLineNumber(i.foldingStartLine))-this._editor.getOption(67)*t.index+1;this._editor.setScrollTop(n),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(116);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(i=>{i.scrollTopChanged&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._sessionStore.add(this._editor.onDidLayoutChange(()=>this._onDidResize())),this._sessionStore.add(this._editor.onDidChangeModelTokens(i=>this._onTokensChange(i))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(()=>{this._showEndForLine=void 0,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(68).renderType===2&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=void 0,this._renderStickyScroll(0)}))}_readConfigurationChange(e){(e.hasChanged(116)||e.hasChanged(73)||e.hasChanged(67)||e.hasChanged(111)||e.hasChanged(68))&&this._readConfiguration(),e.hasChanged(68)&&this._renderStickyScroll(0)}_needsUpdate(e){const t=this._stickyScrollWidget.getCurrentLines();for(const i of t)for(const n of e.ranges)if(i>=n.fromLineNumber&&i<=n.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){const t=this._editor.getModel();if(!t||t.isTooLargeForTokenization()){this._resetState();return}const i=this._updateAndGetMinRebuildFromLine(e),n=this._stickyLineCandidateProvider.getVersionId();if(n===void 0||n===t.getVersionId())if(!this._focused)await this._updateState(i);else if(this._focusedStickyElementIndex===-1)await this._updateState(i),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const o=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];await this._updateState(i),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(o)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}}_updateAndGetMinRebuildFromLine(e){if(e!==void 0){const t=this._minRebuildFromLine!==void 0?this._minRebuildFromLine:1/0;this._minRebuildFromLine=Math.min(e,t)}return this._minRebuildFromLine}async _updateState(e){var i;this._minRebuildFromLine=void 0,this._foldingModel=await((i=v_.get(this._editor))==null?void 0:i.getFoldingModel())??void 0,this._widgetState=this.findScrollWidgetState();const t=this._widgetState.startLineNumbers.length>0;this._stickyScrollVisibleContextKey.set(t),this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e)}async _resetState(){this._minRebuildFromLine=void 0,this._foldingModel=void 0,this._widgetState=OE.Empty,this._stickyScrollVisibleContextKey.set(!1),this._stickyScrollWidget.setState(void 0,void 0)}findScrollWidgetState(){const e=this._editor.getOption(67),t=Math.min(this._maxStickyLines,this._editor.getOption(116).maxLineCount),i=this._editor.getScrollTop();let n=0;const r=[],o=[],a=this._editor.getVisibleRanges();if(a.length!==0){const l=new AE(a[0].startLineNumber,a[a.length-1].endLineNumber),d=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(l);for(const h of d){const f=h.startLineNumber,p=h.endLineNumber,m=h.nestingDepth;if(p-f>0){const v=(m-1)*e,b=m*e,y=this._editor.getBottomForLineNumber(f)-i,x=this._editor.getTopForLineNumber(p)-i,D=this._editor.getBottomForLineNumber(p)-i;if(v>x&&v<=D){r.push(f),o.push(p+1),n=D-b;break}else b>y&&b<=D&&(r.push(f),o.push(p+1));if(r.length===t)break}}}return this._endLineNumbers=o,new OE(r,o,n,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}},CQ=PC,PC.ID="store.contrib.stickyScrollController",PC);$g=CQ=Adt([F1(1,gl),F1(2,it),F1(3,ut),F1(4,Bn),F1(5,sc),F1(6,yt)],$g);class Fdt extends ea{constructor(){super({id:"editor.action.toggleStickyScroll",title:{...kt("toggleEditorStickyScroll","Toggle Editor Sticky Scroll"),mnemonicTitle:w({key:"mitoggleStickyScroll",comment:["&& denotes a mnemonic"]},"&&Toggle Editor Sticky Scroll")},metadata:{description:kt("toggleEditorStickyScroll.description","Toggle/enable the editor sticky scroll which shows the nested scopes at the top of the viewport")},category:Idt.View,toggled:{condition:ve.equals("config.editor.stickyScroll.enabled",!0),title:w("stickyScroll","Sticky Scroll"),mnemonicTitle:w({key:"miStickyScroll",comment:["&& denotes a mnemonic"]},"&&Sticky Scroll")},menu:[{id:st.CommandPalette},{id:st.MenubarAppearanceMenu,group:"4_editor",order:3},{id:st.StickyScrollContext}]})}async run(e){const t=e.get(Gt),i=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",i)}}const UV=100;class Bdt extends ju{constructor(){super({id:"editor.action.focusStickyScroll",title:{...kt("focusStickyScroll","Focus on the editor sticky scroll"),mnemonicTitle:w({key:"mifocusStickyScroll",comment:["&& denotes a mnemonic"]},"&&Focus Sticky Scroll")},precondition:ve.and(ve.has("config.editor.stickyScroll.enabled"),U.stickyScrollVisible),menu:[{id:st.CommandPalette}]})}runEditorCommand(e,t){var i;(i=$g.get(t))==null||i.focus()}}class Wdt extends ju{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:kt("selectNextStickyScrollLine.title","Select the next editor sticky scroll line"),precondition:U.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:UV,primary:18}})}runEditorCommand(e,t){var i;(i=$g.get(t))==null||i.focusNext()}}class Hdt extends ju{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:kt("selectPreviousStickyScrollLine.title","Select the previous sticky scroll line"),precondition:U.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:UV,primary:16}})}runEditorCommand(e,t){var i;(i=$g.get(t))==null||i.focusPrevious()}}class Vdt extends ju{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:kt("goToFocusedStickyScrollLine.title","Go to the focused sticky scroll line"),precondition:U.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:UV,primary:3}})}runEditorCommand(e,t){var i;(i=$g.get(t))==null||i.goToFocused()}}class $dt extends ju{constructor(){super({id:"editor.action.selectEditor",title:kt("selectEditor.title","Select Editor"),precondition:U.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:UV,primary:9}})}runEditorCommand(e,t){var i;(i=$g.get(t))==null||i.selectEditor()}}gi($g.ID,$g,1);sn(Fdt);sn(Bdt);sn(Hdt);sn(Wdt);sn(Vdt);sn($dt);var gxe=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},ZD=function(s,e){return function(t,i){e(t,i,s)}};class zdt{constructor(e,t,i,n,r,o){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=n,this.command=r,this.completion=o}}let yQ=class extends v4e{constructor(e,t,i,n,r,o){super(r.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=n,this._suggestMemoryService=o}canBeReused(e,t,i){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===i.startColumn&&this.word.endColumn<i.endColumn&&this.completionModel.getIncompleteProvider().size===0}get items(){const e=[],{items:t}=this.completionModel,i=this._suggestMemoryService.select(this.model,{lineNumber:this.line,column:this.word.endColumn+this.completionModel.lineContext.characterCountDelta},t),n=ui.slice(t,i),r=ui.slice(t,0,i);let o=5;for(const a of ui.concat(n,r)){if(a.score===Tu.Default)continue;const l=new W(a.editStart.lineNumber,a.editStart.column,a.editInsertEnd.lineNumber,a.editInsertEnd.column+this.completionModel.lineContext.characterCountDelta),d=a.completion.insertTextRules&&a.completion.insertTextRules&4?{snippet:a.completion.insertText}:a.completion.insertText;e.push(new zdt(l,d,a.filterTextLow??a.labelLow,a.completion.additionalTextEdits,a.completion.command,a)),o-->=0&&a.resolve($t.None)}return e}};yQ=gxe([ZD(5,HV)],yQ);let wQ=class extends re{constructor(e,t,i,n){super(),this._languageFeatureService=e,this._clipboardService=t,this._suggestMemoryService=i,this._editorService=n,this._store.add(e.inlineCompletionsProvider.register("*",this))}async provideInlineCompletions(e,t,i,n){var m;if(i.selectedSuggestionInfo)return;let r;for(const v of this._editorService.listCodeEditors())if(v.getModel()===e){r=v;break}if(!r)return;const o=r.getOption(90);if(b0.isAllOff(o))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const a=e.tokenization.getLineTokens(t.lineNumber),l=a.getStandardTokenType(a.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(b0.valueFor(o,l)!=="inline")return;let d=e.getWordAtPosition(t),h;if(d!=null&&d.word||(h=this._getTriggerCharacterInfo(e,t)),!(d!=null&&d.word)&&!h||(d||(d=e.getWordUntilPosition(t)),d.endColumn!==t.column))return;let f;const p=e.getValueInRange(new W(t.lineNumber,1,t.lineNumber,t.column));if(!h&&((m=this._lastResult)!=null&&m.canBeReused(e,t.lineNumber,d))){const v=new Uge(p,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=v,this._lastResult.acquire(),f=this._lastResult}else{const v=await xne(this._languageFeatureService.completionProvider,e,t,new NT(void 0,M3.createSuggestFilter(r).itemKind,h==null?void 0:h.providers),h&&{triggerKind:1,triggerCharacter:h.ch},n);let b;v.needsClipboard&&(b=await this._clipboardService.readText());const y=new em(v.items,t.column,new Uge(p,0),N3.None,r.getOption(119),r.getOption(113),{boostFullMatch:!1,firstMatchCanBeWeak:!1},b);f=new yQ(e,t.lineNumber,d,y,v,this._suggestMemoryService)}return this._lastResult=f,f}handleItemDidShow(e,t){t.completion.resolve($t.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var r;const i=e.getValueInRange(W.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),n=new Set;for(const o of this._languageFeatureService.completionProvider.all(e))(r=o.triggerCharacters)!=null&&r.includes(i)&&n.add(o);if(n.size!==0)return{providers:n,ch:i}}};wQ=gxe([ZD(0,it),ZD(1,Yg),ZD(2,HV),ZD(3,yi)],wQ);$x(wQ);class jdt extends Ze{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 i=t.getModel();i.tokenization.resetTokenization();const n=new cr;i.tokenization.forceTokenization(i.getLineCount()),n.stop(),console.log(`tokenization took ${n.elapsed()}`)}}Pe(jdt);const kW=class kW extends ea{constructor(){super({id:kW.ID,title:kt({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},metadata:{description:kt("tabMovesFocusDescriptions","Determines whether the tab key moves focus around the workbench or inserts the tab character in the current editor. This is also called tab trapping, tab navigation, or tab focus mode.")},f1:!0})}run(){const t=!GS.getTabFocusMode();GS.setTabFocusMode(t),Qo(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"))}};kW.ID="editor.action.toggleTabFocusMode";let SQ=kW;sn(SQ);var Udt=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},ape=function(s,e){return function(t,i){e(t,i,s)}};let xQ=class extends re{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,i={},n,r){super(),this._link=t,this._hoverService=n,this._enabled=!0,this.el=Ee(e,Fe("a.monaco-link",{tabIndex:t.tabIndex??0,href:t.href},t.label)),this.hoverDelegate=i.hoverDelegate??ta("mouse"),this.setTooltip(t.title),this.el.setAttribute("role","button");const o=this._register(new si(this.el,"click")),a=this._register(new si(this.el,"keypress")),l=We.chain(a.event,f=>f.map(p=>new nn(p)).filter(p=>p.keyCode===3)),d=this._register(new si(this.el,rn.Tap)).event;this._register(io.addTarget(this.el));const h=We.any(o.event,l,d);this._register(h(f=>{this.enabled&&(ai.stop(f,!0),i!=null&&i.opener?i.opener(this._link.href):r.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}setTooltip(e){this.hoverDelegate.showNativeHover?this.el.title=e??"":!this.hover&&e?this.hover=this._register(this._hoverService.setupManagedHover(this.hoverDelegate,this.el,e)):this.hover&&this.hover.update(e)}};xQ=Udt([ape(3,df),ape(4,Ta)],xQ);var pxe=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},mxe=function(s,e){return function(t,i){e(t,i,s)}};const qdt=26;let kQ=class extends re{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(LQ))}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.call(e)}}),this._editor.setBanner(this.banner.element,qdt)}};kQ=pxe([mxe(1,ut)],kQ);let LQ=class extends re{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(Ag,{}),this.element=Fe("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=Fe("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){Sr(this.element)}show(e){Sr(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=Ee(this.element,Fe("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(Fe(`div${bt.asCSSSelector(e.icon)}`));const n=Ee(this.element,Fe("div.message-container"));if(n.setAttribute("aria-hidden","true"),n.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=Ee(this.element,Fe("div.message-actions-container")),e.actions)for(const o of e.actions)this._register(this.instantiationService.createInstance(xQ,this.messageActionsContainer,{...o,tabIndex:-1},{}));const r=Ee(this.element,Fe("div.action-container"));this.actionBar=this._register(new Zl(r)),this.actionBar.push(this._register(new rl("banner.close","Close Banner",bt.asClassName(Awe),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};LQ=pxe([mxe(0,ut)],LQ);var Bne=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},dS=function(s,e){return function(t,i){e(t,i,s)}};const Kdt=mn("extensions-warning-message",Oe.warning,w("warningIcon","Icon shown with a warning message in the extensions editor."));var yS;let VT=(yS=class extends re{constructor(e,t,i,n){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=i,this._highlighter=null,this._bannerClosed=!1,this._updateState=r=>{if(r&&r.hasMore){if(this._bannerClosed)return;const o=Math.max(r.ambiguousCharacterCount,r.nonBasicAsciiCharacterCount,r.invisibleCharacterCount);let a;if(r.nonBasicAsciiCharacterCount>=o)a={message:w("unicodeHighlighting.thisDocumentHasManyNonBasicAsciiUnicodeCharacters","This document contains many non-basic ASCII unicode characters"),command:new zT};else if(r.ambiguousCharacterCount>=o)a={message:w("unicodeHighlighting.thisDocumentHasManyAmbiguousUnicodeCharacters","This document contains many ambiguous unicode characters"),command:new vy};else if(r.invisibleCharacterCount>=o)a={message:w("unicodeHighlighting.thisDocumentHasManyInvisibleUnicodeCharacters","This document contains many invisible unicode characters"),command:new $T};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:Kdt,actions:[{label:a.command.shortLabel,href:`command:${a.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(n.createInstance(kQ,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(126),this._register(i.onDidChangeTrust(r=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(r=>{r.hasChanged(126)&&(this._options=e.getOption(126),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=Gdt(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(i=>i===!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(i=>i.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(i=>i==="_os"?new Intl.NumberFormat().resolvedOptions().locale:i==="_vscode"?mFe:i)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new DQ(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new Ydt(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}},yS.ID="editor.contrib.unicodeHighlighter",yS);VT=Bne([dS(1,Na),dS(2,QCe),dS(3,ut)],VT);function Gdt(s,e){return{nonBasicASCII:e.nonBasicASCII===Nl?!s:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===Nl?!s:e.includeComments,includeStrings:e.includeStrings===Nl?!s:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let DQ=class extends re{constructor(e,t,i,n){super(),this._editor=e,this._options=t,this._updateState=i,this._editorWorkerService=n,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new ji(()=>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 i=[];if(!t.hasMore)for(const n of t.ranges)i.push({range:n,options:G3.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!Lie(t,e))return null;const i=t.getValueInRange(e.range);return{reason:vxe(i,this._options),inComment:Die(t,e),inString:Eie(t,e)}}};DQ=Bne([dS(3,Na)],DQ);class Ydt extends re{constructor(e,t,i){super(),this._editor=e,this._options=t,this._updateState=i,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new ji(()=>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=[],i={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const n of e){const r=Wee.computeUnicodeHighlights(this._model,this._options,n);for(const o of r.ranges)i.ranges.push(o);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||r.hasMore}if(!i.hasMore)for(const n of i.ranges)t.push({range:n,options:G3.instance.getDecorationFromOptions(this._options)});this._updateState(i),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),i=t.getValueInRange(e.range);return Lie(t,e)?{reason:vxe(i,this._options),inComment:Die(t,e),inString:Eie(t,e)}:null}}const _xe=w("unicodeHighlight.configureUnicodeHighlightOptions","Configure Unicode Highlight Options");let EQ=class{constructor(e,t,i){this._editor=e,this._languageService=t,this._openerService=i,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),n=this._editor.getContribution(VT.ID);if(!n)return[];const r=[],o=new Set;let a=300;for(const l of t){const d=n.getDecorationInfo(l);if(!d)continue;const f=i.getValueInRange(l.range).codePointAt(0),p=Ej(f);let m;switch(d.reason.kind){case 0:{dN(d.reason.confusableWith)?m=w("unicodeHighlight.characterIsAmbiguousASCII","The character {0} could be confused with the ASCII character {1}, which is more common in source code.",p,Ej(d.reason.confusableWith.codePointAt(0))):m=w("unicodeHighlight.characterIsAmbiguous","The character {0} could be confused with the character {1}, which is more common in source code.",p,Ej(d.reason.confusableWith.codePointAt(0)));break}case 1:m=w("unicodeHighlight.characterIsInvisible","The character {0} is invisible.",p);break;case 2:m=w("unicodeHighlight.characterIsNonBasicAscii","The character {0} is not a basic ASCII character.",p);break}if(o.has(m))continue;o.add(m);const v={codePoint:f,reason:d.reason,inComment:d.inComment,inString:d.inString},b=w("unicodeHighlight.adjustSettings","Adjust settings"),y=`command:${Y3.ID}?${encodeURIComponent(JSON.stringify(v))}`,x=new eo("",!0).appendMarkdown(m).appendText(" ").appendLink(y,b,_xe);r.push(new bd(this,l.range,[x],!1,a++))}return r}renderHoverParts(e,t){return xnt(e,t,this._editor,this._languageService,this._openerService)}};EQ=Bne([dS(1,Nn),dS(2,Ta)],EQ);function IQ(s){return`U+${s.toString(16).padStart(4,"0")}`}function Ej(s){let e=`\`${IQ(s)}\``;return Tb.isInvisibleCharacter(s)||(e+=` "${`${Zdt(s)}`}"`),e}function Zdt(s){return s===96?"`` ` ``":"`"+String.fromCodePoint(s)+"`"}function vxe(s,e){return Wee.computeUnicodeHighlightReason(s,e)}const LW=class LW{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const i=`${e}${t}`;let n=this.map.get(i);return n||(n=Ot.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,n)),n}};LW.instance=new LW;let G3=LW;class Xdt extends Ze{constructor(){super({id:vy.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,i){const n=e==null?void 0:e.get(Gt);n&&this.runAction(n)}async runAction(e){await e.updateValue(fa.includeComments,!1,2)}}class Qdt extends Ze{constructor(){super({id:vy.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,i){const n=e==null?void 0:e.get(Gt);n&&this.runAction(n)}async runAction(e){await e.updateValue(fa.includeStrings,!1,2)}}const DW=class DW extends Ze{constructor(){super({id:DW.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,i){const n=e==null?void 0:e.get(Gt);n&&this.runAction(n)}async runAction(e){await e.updateValue(fa.ambiguousCharacters,!1,2)}};DW.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";let vy=DW;const EW=class EW extends Ze{constructor(){super({id:EW.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,i){const n=e==null?void 0:e.get(Gt);n&&this.runAction(n)}async runAction(e){await e.updateValue(fa.invisibleCharacters,!1,2)}};EW.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";let $T=EW;const IW=class IW extends Ze{constructor(){super({id:IW.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,i){const n=e==null?void 0:e.get(Gt);n&&this.runAction(n)}async runAction(e){await e.updateValue(fa.nonBasicASCII,!1,2)}};IW.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";let zT=IW;const TW=class TW extends Ze{constructor(){super({id:TW.ID,label:w("action.unicodeHighlight.showExcludeOptions","Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}async run(e,t,i){const{codePoint:n,reason:r,inString:o,inComment:a}=i,l=String.fromCodePoint(n),d=e.get(Uc),h=e.get(Gt);function f(v){return Tb.isInvisibleCharacter(v)?w("unicodeHighlight.excludeInvisibleCharFromBeingHighlighted","Exclude {0} (invisible character) from being highlighted",IQ(v)):w("unicodeHighlight.excludeCharFromBeingHighlighted","Exclude {0} from being highlighted",`${IQ(v)} "${l}"`)}const p=[];if(r.kind===0)for(const v of r.notAmbiguousInLocales)p.push({label:w("unicodeHighlight.allowCommonCharactersInLanguage",'Allow unicode characters that are more common in the language "{0}".',v),run:async()=>{eut(h,[v])}});if(p.push({label:f(n),run:()=>Jdt(h,[n])}),a){const v=new Xdt;p.push({label:v.label,run:async()=>v.runAction(h)})}else if(o){const v=new Qdt;p.push({label:v.label,run:async()=>v.runAction(h)})}if(r.kind===0){const v=new vy;p.push({label:v.label,run:async()=>v.runAction(h)})}else if(r.kind===1){const v=new $T;p.push({label:v.label,run:async()=>v.runAction(h)})}else if(r.kind===2){const v=new zT;p.push({label:v.label,run:async()=>v.runAction(h)})}else tut(r);const m=await d.pick(p,{title:_xe});m&&await m.run()}};TW.ID="editor.action.unicodeHighlight.showExcludeOptions";let Y3=TW;async function Jdt(s,e){const t=s.getValue(fa.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const n of e)i[String.fromCodePoint(n)]=!0;await s.updateValue(fa.allowedCharacters,i,2)}async function eut(s,e){var n;const t=(n=s.inspect(fa.allowedLocales).user)==null?void 0:n.value;let i;typeof t=="object"&&t?i=Object.assign({},t):i={};for(const r of e)i[r]=!0;await s.updateValue(fa.allowedLocales,i,2)}function tut(s){throw new Error(`Unexpected value: ${s}`)}Pe(vy);Pe($T);Pe(zT);Pe(Y3);gi(VT.ID,VT,1);$y.register(EQ);var iut=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},lpe=function(s,e){return function(t,i){e(t,i,s)}};const bxe="ignoreUnusualLineTerminators";function nut(s,e,t){s.setModelProperty(e.uri,bxe,t)}function sut(s,e){return s.getModelProperty(e.uri,bxe)}var wS;let Z3=(wS=class extends re{constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(127),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(127)&&(this._config=this._editor.getOption(127),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(n=>{n.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||sut(this._codeEditorService,e)===!0||this._editor.getOption(92))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let i;try{this._isPresentingDialog=!0,i=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`.",Wc(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(!i.confirmed){nut(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}},wS.ID="editor.contrib.unusualLineTerminatorsDetector",wS);Z3=iut([lpe(1,pN),lpe(2,yi)],Z3);gi(Z3.ID,Z3,1);var rut=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},out=function(s,e){return function(t,i){e(t,i,s)}};class cpe{constructor(){this.selector={language:"*"}}provideDocumentHighlights(e,t,i){const n=[],r=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});return r?e.isDisposed()?void 0:e.findMatches(r.word,!0,!1,!0,s4,!1).map(a=>({range:a.range,kind:DS.Text})):Promise.resolve(n)}provideMultiDocumentHighlights(e,t,i,n){const r=new lr,o=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});if(!o)return Promise.resolve(r);for(const a of[e,...i]){if(a.isDisposed())continue;const d=a.findMatches(o.word,!0,!1,!0,s4,!1).map(h=>({range:h.range,kind:DS.Text}));d&&r.set(a.uri,d)}return r}}let TQ=class extends re{constructor(e){super(),this._register(e.documentHighlightProvider.register("*",new cpe)),this._register(e.multiDocumentHighlightProvider.register("*",new cpe))}};TQ=rut([out(0,it)],TQ);var Cxe=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},EF=function(s,e){return function(t,i){e(t,i,s)}},ds,NQ;const Wne=new qe("hasWordHighlights",!1);function yxe(s,e,t,i){const n=s.ordered(e);return kee(n.map(r=>()=>Promise.resolve(r.provideDocumentHighlights(e,t,i)).then(void 0,is)),r=>r!=null).then(r=>{if(r){const o=new lr;return o.set(e.uri,r),o}return new lr})}function aut(s,e,t,i,n,r){const o=s.ordered(e);return kee(o.map(a=>()=>{const l=r.filter(d=>Bbe(d)).filter(d=>Gee(a.selector,d.uri,d.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(a.provideMultiDocumentHighlights(e,t,l,n)).then(void 0,is)}),a=>a!=null)}class wxe{constructor(e,t,i){this._model=e,this._selection=t,this._wordSeparators=i,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=Zs(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new W(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}isValid(e,t,i){const n=t.startLineNumber,r=t.startColumn,o=t.endColumn,a=this._getCurrentWordRange(e,t);let l=!!(this._wordRange&&this._wordRange.equalsRange(a));for(let d=0,h=i.length;!l&&d<h;d++){const f=i.getRange(d);f&&f.startLineNumber===n&&f.startColumn<=r&&f.endColumn>=o&&(l=!0)}return l}cancel(){this.result.cancel()}}class lut extends wxe{constructor(e,t,i,n){super(e,t,i),this._providers=n}_compute(e,t,i,n){return yxe(this._providers,e,t.getPosition(),n).then(r=>r||new lr)}}class cut extends wxe{constructor(e,t,i,n,r){super(e,t,i),this._providers=n,this._otherModels=r}_compute(e,t,i,n){return aut(this._providers,e,t.getPosition(),i,n,this._otherModels).then(r=>r||new lr)}}function dut(s,e,t,i,n){return new lut(e,t,n,s)}function uut(s,e,t,i,n,r){return new cut(e,t,n,s,r)}Ia("_executeDocumentHighlights",async(s,e,t)=>{const i=s.get(it),n=await yxe(i.documentHighlightProvider,e,t,$t.None);return n==null?void 0:n.get(e.uri)});var Gm;let MQ=(Gm=class{constructor(e,t,i,n,r){this.toUnhook=new me,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new lr,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.runDelayer=this.toUnhook.add(new Ac(50)),this.editor=e,this.providers=t,this.multiDocumentProviders=i,this.codeEditorService=r,this._hasWordHighlights=Wne.bindTo(n),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(81),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(o=>{this._ignorePositionChangeEvent||this.occurrencesHighlight!=="off"&&this.runDelayer.trigger(()=>{this._onPositionChanged(o)})})),this.toUnhook.add(e.onDidFocusEditorText(o=>{this.occurrencesHighlight!=="off"&&(this.workerRequest||this.runDelayer.trigger(()=>{this._run()}))})),this.toUnhook.add(e.onDidChangeModelContent(o=>{gH(this.model.uri,"output")||this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(o=>{!o.newModelUrl&&o.oldModelUrl?this._stopSingular():ds.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(o=>{var l,d;const a=this.editor.getOption(81);if(this.occurrencesHighlight!==a)switch(this.occurrencesHighlight=a,a){case"off":this._stopAll();break;case"singleFile":this._stopAll((d=(l=ds.query)==null?void 0:l.modelInfo)==null?void 0:d.model);break;case"multiFile":ds.query&&this._run(!0);break;default:console.warn("Unknown occurrencesHighlight setting value:",a);break}})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,ds.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(){this.occurrencesHighlight!=="off"&&(this.runDelayer.cancel(),this._run())}_getSortedHighlights(){return this.decorations.getRanges().sort(W.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),i=(e.findIndex(r=>r.containsPosition(this.editor.getPosition()))+1)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const r=this._getWord();if(r){const o=this.editor.getModel().getLineContent(n.startLineNumber);Qo(`${o}, ${i+1} of ${e.length} for '${r.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),i=(e.findIndex(r=>r.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const r=this._getWord();if(r){const o=this.editor.getModel().getLineContent(n.startLineNumber);Qo(`${o}, ${i+1} of ${e.length} for '${r.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=ds.storedDecorationIDs.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),ds.storedDecorationIDs.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(e){const t=this.codeEditorService.listCodeEditors(),i=[];for(const n of t){if(!n.hasModel()||VI(n.getModel().uri,e==null?void 0:e.uri))continue;const r=ds.storedDecorationIDs.get(n.getModel().uri);if(!r)continue;n.removeDecorations(r),i.push(n.getModel().uri);const o=C_.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 i)ds.storedDecorationIDs.delete(n)}_stopSingular(){var e,t,i,n;this._removeSingleDecorations(),this.editor.hasTextFocus()&&(((e=this.editor.getModel())==null?void 0:e.uri.scheme)!==Mt.vscodeNotebookCell&&((i=(t=ds.query)==null?void 0:t.modelInfo)==null?void 0:i.model.uri.scheme)!==Mt.vscodeNotebookCell?(ds.query=null,this._run()):(n=ds.query)!=null&&n.modelInfo&&(ds.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(e){this._removeAllDecorations(e),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?void 0:t.uri.scheme)!==Mt.vscodeNotebookCell){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:i})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===Mt.vscodeNotebookCell){const r=[],o=this.codeEditorService.listCodeEditors();for(const a of o){const l=a.getModel();l&&l!==e&&l.uri.scheme===Mt.vscodeNotebookCell&&r.push(l)}return r}const i=[],n=this.codeEditorService.listCodeEditors();for(const r of n){if(!Uie(r))continue;const o=r.getModel();o&&e===o.modified&&i.push(o.modified)}if(i.length)return i;if(this.occurrencesHighlight==="singleFile")return[];for(const r of n){const o=r.getModel();o&&o!==e&&i.push(o)}return i}_run(e){var n,r;let t;if(this.editor.hasTextFocus()){const o=this.editor.getSelection();if(!o||o.startLineNumber!==o.endLineNumber){ds.query=null,this._stopAll();return}const a=o.startColumn,l=o.endColumn,d=this._getWord();if(!d||d.startColumn>a||d.endColumn<l){ds.query=null,this._stopAll();return}t=this.workerRequest&&this.workerRequest.isValid(this.model,o,this.decorations),ds.query={modelInfo:{model:this.model,selection:o},word:d}}else if(!ds.query){this._stopAll();return}if(this.lastCursorPositionChangeTime=new Date().getTime(),t)this.workerRequestCompleted&&this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1,this._beginRenderDecorations());else if(VI(this.editor.getModel().uri,(n=ds.query.modelInfo)==null?void 0:n.model.uri)){if(!e){const l=this.decorations.getRanges();for(const d of l)if(d.containsPosition(this.editor.getPosition()))return}this._stopAll(e?this.model:void 0);const o=++this.workerRequestTokenId;this.workerRequestCompleted=!1;const a=this.getOtherModelsToHighlight(this.editor.getModel());if(!ds.query||!ds.query.modelInfo||ds.query.modelInfo.model.isDisposed())return;this.workerRequest=this.computeWithModel(ds.query.modelInfo.model,ds.query.modelInfo.selection,ds.query.word,a),(r=this.workerRequest)==null||r.result.then(l=>{o===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=l||[],this._beginRenderDecorations())},Tt)}}computeWithModel(e,t,i,n){return n.length?uut(this.multiDocumentProviders,e,t,i,this.editor.getOption(132),n):dut(this.providers,e,t,i,this.editor.getOption(132))}_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 t,i,n;this.renderDecorationsTimer=-1;const e=this.codeEditorService.listCodeEditors();for(const r of e){const o=C_.get(r);if(!o)continue;const a=[],l=(t=r.getModel())==null?void 0:t.uri;if(l&&this.workerRequestValue.has(l)){const d=ds.storedDecorationIDs.get(l),h=this.workerRequestValue.get(l);if(h)for(const p of h)p.range&&a.push({range:p.range,options:Jlt(p.kind)});let f=[];r.changeDecorations(p=>{f=p.deltaDecorations(d??[],a)}),ds.storedDecorationIDs=ds.storedDecorationIDs.set(l,f),a.length>0&&((i=o.wordHighlighter)==null||i.decorations.set(a),(n=o.wordHighlighter)==null||n._hasWordHighlights.set(!0))}}}dispose(){this._stopSingular(),this.toUnhook.dispose()}},ds=Gm,Gm.storedDecorationIDs=new lr,Gm.query=null,Gm);MQ=ds=Cxe([EF(4,yi)],MQ);var OC;let C_=(OC=class extends re{static get(e){return e.getContribution(NQ.ID)}constructor(e,t,i,n){super(),this._wordHighlighter=null;const r=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this._wordHighlighter=new MQ(e,i.documentHighlightProvider,i.multiDocumentHighlightProvider,t,n))};this._register(e.onDidChangeModel(o=>{this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),r()})),r()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){var e;(e=this._wordHighlighter)==null||e.moveNext()}moveBack(){var e;(e=this._wordHighlighter)==null||e.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore()}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}},NQ=OC,OC.ID="editor.contrib.wordHighlighter",OC);C_=NQ=Cxe([EF(1,yt),EF(2,it),EF(3,yi)],C_);class Sxe extends Ze{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=C_.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class hut extends Sxe{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:Wne,kbOpts:{kbExpr:U.editorTextFocus,primary:65,weight:100}})}}class fut extends Sxe{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:Wne,kbOpts:{kbExpr:U.editorTextFocus,primary:1089,weight:100}})}}class gut extends Ze{constructor(){super({id:"editor.action.wordHighlight.trigger",label:w("wordHighlight.trigger.label","Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:0,weight:100}})}run(e,t,i){const n=C_.get(t);n&&n.restoreViewState(!0)}}gi(C_.ID,C_,0);Pe(hut);Pe(fut);Pe(gut);$x(TQ);class qV extends $s{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const n=Bc(t.getOption(132),t.getOption(131)),r=t.getModel(),o=t.getSelections(),a=o.length>1,l=o.map(d=>{const h=new ie(d.positionLineNumber,d.positionColumn),f=this._move(n,r,h,this._wordNavigationType,a);return this._moveTo(d,f,this._inSelectionMode)});if(r.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,l.map(d=>bi.fromModelSelection(d))),l.length===1){const d=new ie(l[0].positionLineNumber,l[0].positionColumn);t.revealPosition(d,0)}}_moveTo(e,t,i){return i?new ot(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new ot(t.lineNumber,t.column,t.lineNumber,t.column)}}class M_ extends qV{_move(e,t,i,n,r){return Ti.moveWordLeft(e,t,i,n,r)}}class R_ extends qV{_move(e,t,i,n,r){return Ti.moveWordRight(e,t,i,n)}}class put extends M_{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class mut extends M_{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class _ut extends M_{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:ve.and(U.textInputFocus,(e=ve.and(bN,oV))==null?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class vut extends M_{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class but extends M_{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class Cut extends M_{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:ve.and(U.textInputFocus,(e=ve.and(bN,oV))==null?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class yut extends M_{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,n,r){return super._move(Bc(zu.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,r)}}class wut extends M_{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,n,r){return super._move(Bc(zu.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,r)}}class Sut extends R_{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class xut extends R_{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:ve.and(U.textInputFocus,(e=ve.and(bN,oV))==null?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class kut extends R_{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class Lut extends R_{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class Dut extends R_{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:ve.and(U.textInputFocus,(e=ve.and(bN,oV))==null?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class Eut extends R_{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class Iut extends R_{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,n,r){return super._move(Bc(zu.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,r)}}class Tut extends R_{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,n,r){return super._move(Bc(zu.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,r)}}class KV extends $s{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const n=e.get(Bn);if(!t.hasModel())return;const r=Bc(t.getOption(132),t.getOption(131)),o=t.getModel(),a=t.getSelections(),l=t.getOption(6),d=t.getOption(11),h=n.getLanguageConfiguration(o.getLanguageId()).getAutoClosingPairs(),f=t._getViewModel(),p=a.map(m=>{const v=this._delete({wordSeparators:r,model:o,selection:m,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(9),autoClosingBrackets:l,autoClosingQuotes:d,autoClosingPairs:h,autoClosedCharacters:f.getCursorAutoClosedCharacters()},this._wordNavigationType);return new Vr(v,"")});t.pushUndoStop(),t.executeCommands(this.id,p),t.pushUndoStop()}}class Hne extends KV{_delete(e,t){const i=Ti.deleteWordLeft(e,t);return i||new W(1,1,1,1)}}class Vne extends KV{_delete(e,t){const i=Ti.deleteWordRight(e,t);if(i)return i;const n=e.model.getLineCount(),r=e.model.getLineMaxColumn(n);return new W(n,r,n,r)}}class Nut extends Hne{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:U.writable})}}class Mut extends Hne{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:U.writable})}}class Rut extends Hne{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:U.writable,kbOpts:{kbExpr:U.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class Put extends Vne{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:U.writable})}}class Out extends Vne{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:U.writable})}}class Aut extends Vne{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:U.writable,kbOpts:{kbExpr:U.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class Fut extends Ze{constructor(){super({id:"deleteInsideWord",precondition:U.writable,label:w("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,t,i){if(!t.hasModel())return;const n=Bc(t.getOption(132),t.getOption(131)),r=t.getModel(),a=t.getSelections().map(l=>{const d=Ti.deleteInsideWord(n,r,l);return new Vr(d,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}Ue(new put);Ue(new mut);Ue(new _ut);Ue(new vut);Ue(new but);Ue(new Cut);Ue(new Sut);Ue(new xut);Ue(new kut);Ue(new Lut);Ue(new Dut);Ue(new Eut);Ue(new yut);Ue(new wut);Ue(new Iut);Ue(new Tut);Ue(new Nut);Ue(new Mut);Ue(new Rut);Ue(new Put);Ue(new Out);Ue(new Aut);Pe(Fut);class But extends KV{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:U.writable,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const i=_V.deleteWordPartLeft(e);return i||new W(1,1,1,1)}}class Wut extends KV{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:U.writable,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const i=_V.deleteWordPartRight(e);if(i)return i;const n=e.model.getLineCount(),r=e.model.getLineMaxColumn(n);return new W(n,r,n,r)}}class xxe extends qV{_move(e,t,i,n,r){return _V.moveWordPartLeft(e,t,i,r)}}class Hut extends xxe{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}hi.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class Vut extends xxe{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}hi.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class kxe extends qV{_move(e,t,i,n,r){return _V.moveWordPartRight(e,t,i)}}class $ut extends kxe{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class zut extends kxe{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}Ue(new But);Ue(new Wut);Ue(new Hut);Ue(new Vut);Ue(new $ut);Ue(new zut);const Yne=class Yne extends re{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=al.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(93);t||(this.editor.isSimpleWidget?t=new eo(w("editor.simple.readonly","Cannot edit in read-only input")):t=new eo(w("editor.readonly","Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}};Yne.ID="editor.contrib.readOnlyMessageController";let X3=Yne;gi(X3.ID,X3,2);var jut=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},dpe=function(s,e){return function(t,i){e(t,i,s)}};let RQ=class extends re{constructor(e,t,i){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=i,this._currentModel=Kt(this,void 0);const n=Hr("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),r=Hr("_textModel.onDidChangeContent",We.debounce(o=>this._textModel.onDidChangeContent(o),()=>{},100));this._register(ya(async(o,a)=>{n.read(o),r.read(o);const l=a.add(new TXe),d=await this._outlineModelService.getOrCreate(this._textModel,l.token);a.isDisposed||this._currentModel.set(d,void 0)}))}getBreadcrumbItems(e,t){const i=this._currentModel.read(t);if(!i)return[];const n=i.asListOfDocumentSymbols().filter(r=>e.contains(r.range.startLineNumber)&&!e.contains(r.range.endLineNumber));return n.sort(ive(qo(r=>r.range.endLineNumber-r.range.startLineNumber,xd))),n.map(r=>({name:r.name,kind:r.kind,startLineNumber:r.range.startLineNumber}))}};RQ=jut([dpe(1,it),dpe(2,UN)],RQ);X5.setBreadcrumbsSourceFactory((s,e)=>e.createInstance(RQ,s));const Zne=class Zne extends re{constructor(e){super(),this.editor=e,this.widget=null,Mu&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(92);!this.widget&&e?this.widget=new PQ(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}};Zne.ID="editor.contrib.iPadShowKeyboard";let Q3=Zne;const NW=class NW extends re{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(ue(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(ue(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return NW.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}};NW.ID="editor.contrib.ShowKeyboardWidget";let PQ=NW;gi(Q3.ID,Q3,3);var Uut=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},upe=function(s,e){return function(t,i){e(t,i,s)}},OQ,AC;let jT=(AC=class extends re{static get(e){return e.getContribution(OQ.ID)}constructor(e,t,i){super(),this._editor=e,this._languageService=i,this._widget=null,this._register(this._editor.onDidChangeModel(n=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(n=>this.stop())),this._register(Un.onDidChange(n=>this.stop())),this._register(this._editor.onKeyUp(n=>n.keyCode===9&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new AQ(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}},OQ=AC,AC.ID="editor.contrib.inspectTokens",AC);jT=OQ=Uut([upe(1,ac),upe(2,Nn)],jT);class qut extends Ze{constructor(){super({id:"editor.action.inspectTokens",label:zK.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){const i=jT.get(t);i==null||i.launch()}}function Kut(s){let e="";for(let t=0,i=s.length;t<i;t++){const n=s.charCodeAt(t);switch(n){case 9:e+="→";break;case 32:e+="·";break;default:e+=String.fromCharCode(n)}}return e}function Gut(s,e){const t=Un.get(e);if(t)return t;const i=s.encodeLanguageId(e);return{getInitialState:()=>WS,tokenize:(n,r,o)=>_te(e,o),tokenizeEncoded:(n,r,o)=>ZH(i,o)}}const MW=class MW extends re{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=Gut(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(i=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return MW._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let i=0;for(let l=t.tokens1.length-1;l>=0;l--){const d=t.tokens1[l];if(e.column-1>=d.offset){i=l;break}}let n=0;for(let l=t.tokens2.length>>>1;l>=0;l--)if(e.column-1>=t.tokens2[l<<1]){n=l;break}const r=this._model.getLineContent(e.lineNumber);let o="";if(i<t.tokens1.length){const l=t.tokens1[i].offset,d=i+1<t.tokens1.length?t.tokens1[i+1].offset:r.length;o=r.substring(l,d)}xr(this._domNode,Fe("h2.tm-token",void 0,Kut(o),Fe("span.tm-token-length",void 0,`${o.length} ${o.length===1?"char":"chars"}`))),Ee(this._domNode,Fe("hr.tokens-inspect-separator",{style:"clear:both"}));const a=(n<<1)+1<t.tokens2.length?this._decodeMetadata(t.tokens2[(n<<1)+1]):null;Ee(this._domNode,Fe("table.tm-metadata-table",void 0,Fe("tbody",void 0,Fe("tr",void 0,Fe("td.tm-metadata-key",void 0,"language"),Fe("td.tm-metadata-value",void 0,`${a?a.languageId:"-?-"}`)),Fe("tr",void 0,Fe("td.tm-metadata-key",void 0,"token type"),Fe("td.tm-metadata-value",void 0,`${a?this._tokenTypeToString(a.tokenType):"-?-"}`)),Fe("tr",void 0,Fe("td.tm-metadata-key",void 0,"font style"),Fe("td.tm-metadata-value",void 0,`${a?this._fontStyleToString(a.fontStyle):"-?-"}`)),Fe("tr",void 0,Fe("td.tm-metadata-key",void 0,"foreground"),Fe("td.tm-metadata-value",void 0,`${a?be.Format.CSS.formatHex(a.foreground):"-?-"}`)),Fe("tr",void 0,Fe("td.tm-metadata-key",void 0,"background"),Fe("td.tm-metadata-value",void 0,`${a?be.Format.CSS.formatHex(a.background):"-?-"}`))))),Ee(this._domNode,Fe("hr.tokens-inspect-separator")),i<t.tokens1.length&&Ee(this._domNode,Fe("span.tm-token-type",void 0,t.tokens1[i].type)),this._editor.layoutContentWidget(this)}_decodeMetadata(e){const t=Un.getColorMap(),i=pa.getLanguageId(e),n=pa.getTokenType(e),r=pa.getFontStyle(e),o=pa.getForeground(e),a=pa.getBackground(e);return{languageId:this._languageService.languageIdCodec.decodeLanguageId(i),tokenType:n,fontStyle:r,foreground:t[o],background:t[a]}}_tokenTypeToString(e){switch(e){case 0:return"Other";case 1:return"Comment";case 2:return"String";case 3:return"RegEx";default:return"??"}}_fontStyleToString(e){let t="";return e&1&&(t+="italic "),e&2&&(t+="bold "),e&4&&(t+="underline "),e&8&&(t+="strikethrough "),t.length===0&&(t="---"),t}_getTokensAtLine(e){const t=this._getStateBeforeLine(e),i=this._tokenizationSupport.tokenize(this._model.getLineContent(e),!0,t),n=this._tokenizationSupport.tokenizeEncoded(this._model.getLineContent(e),!0,t);return{startState:t,tokens1:i.tokens,tokens2:n.tokens,endState:i.endState}}_getStateBeforeLine(e){let t=this._tokenizationSupport.getInitialState();for(let i=1;i<e;i++)t=this._tokenizationSupport.tokenize(this._model.getLineContent(i),!0,t).endState;return t}getDomNode(){return this._domNode}getPosition(){return{position:this._editor.getPosition(),preference:[2,1]}}};MW._ID="editor.contrib.inspectTokensWidget";let AQ=MW;gi(jT.ID,jT,4);Pe(qut);var Yut=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},hpe=function(s,e){return function(t,i){e(t,i,s)}},XD,FC;let FQ=(FC=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=Fn.as(Oy.Quickaccess)}provide(e){const t=new me;return t.add(e.onDidAccept(()=>{const[i]=e.selectedItems;i&&this.quickInputService.quickAccess.show(i.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(i=>{const n=this.registry.getQuickAccessProvider(i.substr(XD.PREFIX.length));n&&n.prefix&&n.prefix!==XD.PREFIX&&this.quickInputService.quickAccess.show(n.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(i=>i.prefix!==XD.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,i)=>t.prefix.localeCompare(i.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const i=t.prefix||e.prefix,n=i||"…";return{prefix:i,label:n,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:w("helpPickAriaLabel","{0}, {1}",n,t.description),description:t.description}})}},XD=FC,FC.PREFIX="?",FC);FQ=XD=Yut([hpe(0,Uc),hpe(1,Mi)],FQ);Fn.as(Oy.Quickaccess).registerQuickAccessProvider({ctor:FQ,prefix:"",helpEntries:[{description:jK.helpQuickAccessActionLabel}]});class Lxe{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t,i){var o;const n=new me;e.canAcceptInBackground=!!((o=this.options)!=null&&o.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const r=n.add(new Js);return r.value=this.doProvide(e,t,i),n.add(this.onDidActiveTextEditorControlChange(()=>{r.value=void 0,r.value=this.doProvide(e,t)})),n}doProvide(e,t,i){const n=new me,r=this.activeTextEditorControl;if(r&&this.canProvideWithTextEditor(r)){const o={editor:r},a=M1e(r);if(a){let l=r.saveViewState()??void 0;n.add(a.onDidChangeCursorPosition(()=>{l=r.saveViewState()??void 0})),o.restoreViewState=()=>{l&&r===this.activeTextEditorControl&&r.restoreViewState(l)},n.add(e_(t.onCancellationRequested)(()=>{var d;return(d=o.restoreViewState)==null?void 0:d.call(o)}))}n.add(dt(()=>this.clearDecorations(r))),n.add(this.provideWithTextEditor(o,e,t,i))}else n.add(this.provideWithoutTextEditor(e,t));return n}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range,"code.jump"),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const i=e.getModel();i&&"getLineContent"in i&&Jh(`${i.getLineContent(t.range.startLineNumber)}`)}getModel(e){var t;return Uie(e)?(t=e.getModel())==null?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(i=>{const n=[];this.rangeHighlightDecorationId&&(n.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),n.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const r=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:qn(Sye),position:Gl.Full}}}],[o,a]=i.deltaDecorations(n,r);this.rangeHighlightDecorationId={rangeHighlightId:o,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(i=>{i.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}const RW=class RW extends Lxe{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,re.None}provideWithTextEditor(e,t,i){const n=e.editor,r=new me;r.add(t.onDidAccept(l=>{const[d]=t.selectedItems;if(d){if(!this.isValidLineNumber(n,d.lineNumber))return;this.gotoLocation(e,{range:this.toRange(d.lineNumber,d.column),keyMods:t.keyMods,preserveFocus:l.inBackground}),l.inBackground||t.hide()}}));const o=()=>{const l=this.parsePosition(n,t.value.trim().substr(RW.PREFIX.length)),d=this.getPickLabel(n,l.lineNumber,l.column);if(t.items=[{lineNumber:l.lineNumber,column:l.column,label:d}],t.ariaLabel=d,!this.isValidLineNumber(n,l.lineNumber)){this.clearDecorations(n);return}const h=this.toRange(l.lineNumber,l.column);n.revealRangeInCenter(h,0),this.addDecorations(n,h)};o(),r.add(t.onDidChangeValue(()=>o()));const a=M1e(n);return a&&a.getOptions().get(68).renderType===2&&(a.updateOptions({lineNumbers:"on"}),r.add(dt(()=>a.updateOptions({lineNumbers:"relative"})))),r}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const i=t.split(/,|:|#/).map(r=>parseInt(r,10)).filter(r=>!isNaN(r)),n=this.lineCount(e)+1;return{lineNumber:i[0]>0?i[0]:n+i[0],column:i[1]}}getPickLabel(e,t,i){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,i)?w("gotoLineColumnLabel","Go to line {0} and character {1}.",t,i):w("gotoLineLabel","Go to line {0}.",t);const n=e.getPosition()||{lineNumber:1,column:1},r=this.lineCount(e);return r>1?w("gotoLineLabelEmptyWithLimit","Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",n.lineNumber,n.column,r):w("gotoLineLabelEmpty","Current Line: {0}, Character: {1}. Type a line number to navigate to.",n.lineNumber,n.column)}isValidLineNumber(e,t){return!t||typeof t!="number"?!1:t>0&&t<=this.lineCount(e)}isValidColumn(e,t,i){if(!i||typeof i!="number")return!1;const n=this.getModel(e);if(!n)return!1;const r={lineNumber:t,column:i};return n.validatePosition(r).equals(r)}lineCount(e){var t;return((t=this.getModel(e))==null?void 0:t.getLineCount())??0}};RW.PREFIX=":";let BQ=RW;var Zut=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Xut=function(s,e){return function(t,i){e(t,i,s)}};let UT=class extends BQ{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=We.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};UT=Zut([Xut(0,yi)],UT);var BC;let Dxe=(BC=class extends Ze{constructor(){super({id:BC.ID,label:q4.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:U.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(Uc).quickAccess.show(UT.PREFIX)}},BC.ID="editor.action.gotoLine",BC);Pe(Dxe);Fn.as(Oy.Quickaccess).registerQuickAccessProvider({ctor:UT,prefix:UT.PREFIX,helpEntries:[{description:q4.gotoLineActionLabel,commandId:Dxe.ID}]});const Exe=[void 0,[]];function Ij(s,e,t=0,i=0){const n=e;return n.values&&n.values.length>1?Qut(s,n.values,t,i):Ixe(s,e,t,i)}function Qut(s,e,t,i){let n=0;const r=[];for(const o of e){const[a,l]=Ixe(s,o,t,i);if(typeof a!="number")return Exe;n+=a,r.push(...l)}return[n,Jut(r)]}function Ixe(s,e,t,i){const n=ey(e.original,e.originalLowercase,t,s,s.toLowerCase(),i,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return n?[n[0],vN(n)]:Exe}function Jut(s){const e=s.sort((n,r)=>n.start-r.start),t=[];let i;for(const n of e)!i||!eht(i,n)?(i=n,t.push(n)):(i.start=Math.min(i.start,n.start),i.end=Math.max(i.end,n.end));return t}function eht(s,e){return!(s.end<e.start||e.end<s.start)}function fpe(s){return s.startsWith('"')&&s.endsWith('"')}const Txe=" ";function WQ(s){typeof s!="string"&&(s="");const e=s.toLowerCase(),{pathNormalized:t,normalized:i,normalizedLowercase:n}=gpe(s),r=t.indexOf(ku)>=0,o=fpe(s);let a;const l=s.split(Txe);if(l.length>1)for(const d of l){const h=fpe(d),{pathNormalized:f,normalized:p,normalizedLowercase:m}=gpe(d);p&&(a||(a=[]),a.push({original:d,originalLowercase:d.toLowerCase(),pathNormalized:f,normalized:p,normalizedLowercase:m,expectContiguousMatch:h}))}return{original:s,originalLowercase:e,pathNormalized:t,normalized:i,normalizedLowercase:n,values:a,containsPathSeparator:r,expectContiguousMatch:o}}function gpe(s){let e;Ur?e=s.replace(/\//g,ku):e=s.replace(/\\/g,ku);const t=u5e(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function ppe(s){return Array.isArray(s)?WQ(s.map(e=>e.original).join(Txe)):WQ(s.original)}var tht=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},mpe=function(s,e){return function(t,i){e(t,i,s)}},IF,_u;let $b=(_u=class extends Lxe{constructor(e,t,i=Object.create(null)){super(i),this._languageFeaturesService=e,this._outlineModelService=t,this.options=i,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.")),re.None}provideWithTextEditor(e,t,i,n){const r=e.editor,o=this.getModel(r);return o?this._languageFeaturesService.documentSymbolProvider.has(o)?this.doProvideWithEditorSymbols(e,o,t,i,n):this.doProvideWithoutEditorSymbols(e,o,t,i):re.None}doProvideWithoutEditorSymbols(e,t,i,n){const r=new me;return this.provideLabelPick(i,w("cannotRunGotoSymbolWithoutSymbolProvider","The active text editor does not provide symbol information.")),(async()=>!await this.waitForLanguageSymbolRegistry(t,r)||n.isCancellationRequested||r.add(this.doProvideWithEditorSymbols(e,t,i,n)))(),r}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 i=new kx,n=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(n.dispose(),i.complete(!0))}));return t.add(dt(()=>i.complete(!1))),i.p}doProvideWithEditorSymbols(e,t,i,n,r){var f;const o=e.editor,a=new me;a.add(i.onDidAccept(p=>{var v;const[m]=i.selectedItems;m&&m.range&&(this.gotoLocation(e,{range:m.range.selection,keyMods:i.keyMods,preserveFocus:p.inBackground}),(v=r==null?void 0:r.handleAccept)==null||v.call(r,m),p.inBackground||i.hide())})),a.add(i.onDidTriggerItemButton(({item:p})=>{p&&p.range&&(this.gotoLocation(e,{range:p.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())}));const l=this.getDocumentSymbols(t,n);let d;const h=async p=>{d==null||d.dispose(!0),i.busy=!1,d=new An(n),i.busy=!0;try{const m=WQ(i.value.substr(IF.PREFIX.length).trim()),v=await this.doGetSymbolPicks(l,m,void 0,d.token,t);if(n.isCancellationRequested)return;if(v.length>0){if(i.items=v,p&&m.original.length===0){const b=DI(v,y=>!!(y.type!=="separator"&&y.range&&W.containsPosition(y.range.decoration,p)));b&&(i.activeItems=[b])}}else m.original.length>0?this.provideLabelPick(i,w("noMatchingSymbolResults","No matching editor symbols")):this.provideLabelPick(i,w("noSymbolResults","No editor symbols"))}finally{n.isCancellationRequested||(i.busy=!1)}};return a.add(i.onDidChangeValue(()=>h(void 0))),h((f=o.getSelection())==null?void 0:f.getPosition()),a.add(i.onDidChangeActive(()=>{const[p]=i.activeItems;p&&p.range&&(o.revealRangeInCenter(p.range.selection,0),this.addDecorations(o,p.range.decoration))})),a}async doGetSymbolPicks(e,t,i,n,r){var y,x;const o=await e;if(n.isCancellationRequested)return[];const a=t.original.indexOf(IF.SCOPE_PREFIX)===0,l=a?1:0;let d,h;t.values&&t.values.length>1?(d=ppe(t.values[0]),h=ppe(t.values.slice(1))):d=t;let f;const p=(x=(y=this.options)==null?void 0:y.openSideBySideDirection)==null?void 0:x.call(y);p&&(f=[{iconClass:p==="right"?bt.asClassName(Oe.splitHorizontal):bt.asClassName(Oe.splitVertical),tooltip:p==="right"?w("openToSide","Open to the Side"):w("openToBottom","Open to the Bottom")}]);const m=[];for(let D=0;D<o.length;D++){const S=o[D],E=c5e(S.name),I=`$(${d4.toIcon(S.kind).id}) ${E}`,R=I.length-E.length;let M=S.containerName;i!=null&&i.extraContainerLabel&&(M?M=`${i.extraContainerLabel} • ${M}`:M=i.extraContainerLabel);let O,H,te,J;if(t.original.length>l){let V=!1;if(d!==t&&([O,H]=Ij(I,{...t,values:void 0},l,R),typeof O=="number"&&(V=!0)),typeof O!="number"&&([O,H]=Ij(I,d,l,R),typeof O!="number"))continue;if(!V&&h){if(M&&h.original.length>0&&([te,J]=Ij(M,h)),typeof te!="number")continue;typeof O=="number"&&(O+=te)}}const z=S.tags&&S.tags.indexOf(1)>=0;m.push({index:D,kind:S.kind,score:O,label:I,ariaLabel:i5e(S.name,S.kind),description:M,highlights:z?void 0:{label:H,description:J},range:{selection:W.collapseToStart(S.selectionRange),decoration:S.range},uri:r.uri,symbolName:E,strikethrough:z,buttons:f})}const v=m.sort((D,S)=>a?this.compareByKindAndScore(D,S):this.compareByScore(D,S));let b=[];if(a){let I=function(){S&&typeof D=="number"&&E>0&&(S.label=qC(Nj[D]||Tj,E))},D,S,E=0;for(const R of v)D!==R.kind?(I(),D=R.kind,E=1,S={type:"separator"},b.push(S)):E++,b.push(R);I()}else v.length>0&&(b=[{label:w("symbols","symbols ({0})",m.length),type:"separator"},...v]);return b}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.score<t.score)return 1}return e.index<t.index?-1:e.index>t.index?1:0}compareByKindAndScore(e,t){const i=Nj[e.kind]||Tj,n=Nj[t.kind]||Tj,r=i.localeCompare(n);return r===0?this.compareByScore(e,t):r}async getDocumentSymbols(e,t){const i=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()}},IF=_u,_u.PREFIX="@",_u.SCOPE_PREFIX=":",_u.PREFIX_BY_CATEGORY=`${_u.PREFIX}${_u.SCOPE_PREFIX}`,_u);$b=IF=tht([mpe(0,it),mpe(1,UN)],$b);const Tj=w("property","properties ({0})"),Nj={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 iht=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Mj=function(s,e){return function(t,i){e(t,i,s)}};let HQ=class extends $b{constructor(e,t,i){super(t,i),this.editorService=e,this.onDidActiveTextEditorControlChange=We.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};HQ=iht([Mj(0,yi),Mj(1,it),Mj(2,UN)],HQ);const PW=class PW extends Ze{constructor(){super({id:PW.ID,label:zI.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:U.hasDocumentSymbolProvider,kbOpts:{kbExpr:U.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(Uc).quickAccess.show($b.PREFIX,{itemActivation:lu.NONE})}};PW.ID="editor.action.quickOutline";let J3=PW;Pe(J3);Fn.as(Oy.Quickaccess).registerQuickAccessProvider({ctor:HQ,prefix:$b.PREFIX,helpEntries:[{description:zI.quickOutlineActionLabel,prefix:$b.PREFIX,commandId:J3.ID},{description:zI.quickOutlineByCategoryActionLabel,prefix:$b.PREFIX_BY_CATEGORY}]});function nht(s){const e=new Map;for(const t of s)e.set(t,(e.get(t)??0)+1);return e}class BE{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),n=new Map,r=[];for(const[o,a]of this.documents){if(t.isCancellationRequested)return[];for(const l of a.chunks){const d=this.computeSimilarityScore(l,i,n);d>0&&r.push({key:o,score:d})}}return r}static termFrequencies(e){return nht(BE.splitTerms(e))}static*splitTerms(e){const t=i=>i.toLowerCase();for(const[i]of e.matchAll(new RegExp("\\b\\p{Letter}[\\p{Letter}\\d]{2,}\\b","gu"))){yield t(i);const n=i.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(n.length>1)for(const r of n)r.length>2&&new RegExp("\\p{Letter}{3,}","gu").test(r)&&(yield t(r))}}updateDocuments(e){for(const{key:t}of e)this.deleteDocument(t);for(const t of e){const i=[];for(const n of t.textChunks){const r=BE.termFrequencies(n);for(const o of r.keys())this.chunkOccurrences.set(o,(this.chunkOccurrences.get(o)??0)+1);i.push({text:n,tf:r})}this.chunkCount+=i.length,this.documents.set(t.key,{chunks:i})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const i of t.chunks)for(const n of i.tf.keys()){const r=this.chunkOccurrences.get(n);if(typeof r=="number"){const o=r-1;o<=0?this.chunkOccurrences.delete(n):this.chunkOccurrences.set(n,o)}}}}computeSimilarityScore(e,t,i){let n=0;for(const[r,o]of Object.entries(t)){const a=e.tf.get(r);if(!a)continue;let l=i.get(r);typeof l!="number"&&(l=this.computeIdf(r),i.set(r,l));const d=a*l;n+=d*o}return n}computeEmbedding(e){const t=BE.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){const t=this.chunkOccurrences.get(e)??0;return t>0?Math.log((this.chunkCount+1)/t):0}computeTfidf(e){const t=Object.create(null);for(const[i,n]of e){const r=this.computeIdf(i);r>0&&(t[i]=n*r)}return t}}function sht(s){var i;const e=s.slice(0);e.sort((n,r)=>r.score-n.score);const t=((i=e[0])==null?void 0:i.score)??0;if(t>0)for(const n of e)n.score/=t;return e}var y0;(function(s){s[s.NO_ACTION=0]="NO_ACTION",s[s.CLOSE_PICKER=1]="CLOSE_PICKER",s[s.REFRESH_PICKER=2]="REFRESH_PICKER",s[s.REMOVE_ITEM=3]="REMOVE_ITEM"})(y0||(y0={}));function Rj(s){const e=s;return Array.isArray(e.items)}function _pe(s){const e=s;return!!e.picks&&e.additionalPicks instanceof Promise}class rht extends re{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){var d;const n=new me;e.canAcceptInBackground=!!((d=this.options)!=null&&d.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let r;const o=n.add(new Js),a=async()=>{var y;const h=o.value=new me;r==null||r.dispose(!0),e.busy=!1,r=new An(t);const f=r.token;let p=e.value.substring(this.prefix.length);(y=this.options)!=null&&y.shouldSkipTrimPickFilter||(p=p.trim());const m=this._getPicks(p,h,f,i),v=(x,D)=>{var I;let S,E;if(Rj(x)?(S=x.items,E=x.active):S=x,S.length===0){if(D)return!1;(p.length>0||e.hideInput)&&((I=this.options)!=null&&I.noResultsPick)&&(gI(this.options.noResultsPick)?S=[this.options.noResultsPick(p)]:S=[this.options.noResultsPick])}return e.items=S,E&&(e.activeItems=[E]),!0},b=async x=>{let D=!1,S=!1;await Promise.all([(async()=>{typeof x.mergeDelay=="number"&&(await Rg(x.mergeDelay),f.isCancellationRequested)||S||(D=v(x.picks,!0))})(),(async()=>{e.busy=!0;try{const E=await x.additionalPicks;if(f.isCancellationRequested)return;let I,R;Rj(x.picks)?(I=x.picks.items,R=x.picks.active):I=x.picks;let M,O;if(Rj(E)?(M=E.items,O=E.active):M=E,M.length>0||!D){let H;if(!R&&!O){const te=e.activeItems[0];te&&I.indexOf(te)!==-1&&(H=te)}v({items:[...I,...M],active:R||O||H})}}finally{f.isCancellationRequested||(e.busy=!1),S=!0}})()])};if(m!==null)if(_pe(m))await b(m);else if(!(m instanceof Promise))v(m);else{e.busy=!0;try{const x=await m;if(f.isCancellationRequested)return;_pe(x)?await b(x):v(x)}finally{f.isCancellationRequested||(e.busy=!1)}}};n.add(e.onDidChangeValue(()=>a())),a(),n.add(e.onDidAccept(h=>{var p;if(i!=null&&i.handleAccept){h.inBackground||e.hide(),(p=i.handleAccept)==null||p.call(i,e.activeItems[0]);return}const[f]=e.selectedItems;typeof(f==null?void 0:f.accept)=="function"&&(h.inBackground||e.hide(),f.accept(e.keyMods,h))}));const l=async(h,f)=>{var m;if(typeof f.trigger!="function")return;const p=((m=f.buttons)==null?void 0:m.indexOf(h))??-1;if(p>=0){const v=f.trigger(p,e.keyMods),b=typeof v=="number"?v:await v;if(t.isCancellationRequested)return;switch(b){case y0.NO_ACTION:break;case y0.CLOSE_PICKER:e.hide();break;case y0.REFRESH_PICKER:a();break;case y0.REMOVE_ITEM:{const y=e.items.indexOf(f);if(y!==-1){const x=e.items.slice(),D=x.splice(y,1),S=e.activeItems.filter(I=>I!==D[0]),E=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=x,S&&(e.activeItems=S),e.keepScrollPosition=E}break}}}};return n.add(e.onDidTriggerItemButton(({button:h,item:f})=>l(h,f))),n.add(e.onDidTriggerSeparatorButton(({button:h,separator:f})=>l(h,f))),n}}var Nxe=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},tm=function(s,e){return function(t,i){e(t,i,s)}},Yv,Ms,Wh;let VQ=(Wh=class extends rht{constructor(e,t,i,n,r,o){super(Yv.PREFIX,e),this.instantiationService=t,this.keybindingService=i,this.commandService=n,this.telemetryService=r,this.dialogService=o,this.commandsHistory=this._register(this.instantiationService.createInstance($Q)),this.options=e}async _getPicks(e,t,i,n){var m,v;const r=await this.getCommandPicks(i);if(i.isCancellationRequested)return[];const o=e_(()=>{const b=new BE;b.updateDocuments(r.map(x=>({key:x.commandId,textChunks:[this.getTfIdfChunk(x)]})));const y=b.calculateScores(e,i);return sht(y).filter(x=>x.score>Yv.TFIDF_THRESHOLD).slice(0,Yv.TFIDF_MAX_RESULTS)}),a=[];for(const b of r){const y=Yv.WORD_FILTER(e,b.label)??void 0,x=b.commandAlias?Yv.WORD_FILTER(e,b.commandAlias)??void 0:void 0;if(y||x)b.highlights={label:y,detail:this.options.showAlias?x:void 0},a.push(b);else if(e===b.commandId)a.push(b);else if(e.length>=3){const D=o();if(i.isCancellationRequested)return[];const S=D.find(E=>E.key===b.commandId);S&&(b.tfIdfScore=S.score,a.push(b))}}const l=new Map;for(const b of a){const y=l.get(b.label);y?(b.description=b.commandId,y.description=y.commandId):l.set(b.label,b)}a.sort((b,y)=>{if(b.tfIdfScore&&y.tfIdfScore)return b.tfIdfScore===y.tfIdfScore?b.label.localeCompare(y.label):y.tfIdfScore-b.tfIdfScore;if(b.tfIdfScore)return 1;if(y.tfIdfScore)return-1;const x=this.commandsHistory.peek(b.commandId),D=this.commandsHistory.peek(y.commandId);if(x&&D)return x>D?-1:1;if(x)return-1;if(D)return 1;if(this.options.suggestedCommandIds){const S=this.options.suggestedCommandIds.has(b.commandId),E=this.options.suggestedCommandIds.has(y.commandId);if(S&&E)return 0;if(S)return-1;if(E)return 1}return b.label.localeCompare(y.label)});const d=[];let h=!1,f=!0,p=!!this.options.suggestedCommandIds;for(let b=0;b<a.length;b++){const y=a[b];b===0&&this.commandsHistory.peek(y.commandId)&&(d.push({type:"separator",label:w("recentlyUsed","recently used")}),h=!0),f&&y.tfIdfScore!==void 0&&(d.push({type:"separator",label:w("suggested","similar commands")}),f=!1),p&&y.tfIdfScore===void 0&&!this.commandsHistory.peek(y.commandId)&&((m=this.options.suggestedCommandIds)!=null&&m.has(y.commandId))&&(d.push({type:"separator",label:w("commonlyUsed","commonly used")}),h=!0,p=!1),h&&y.tfIdfScore===void 0&&!this.commandsHistory.peek(y.commandId)&&!((v=this.options.suggestedCommandIds)!=null&&v.has(y.commandId))&&(d.push({type:"separator",label:w("morecCommands","other commands")}),h=!1),d.push(this.toCommandPick(y,n))}return this.hasAdditionalCommandPicks(e,i)?{picks:d,additionalPicks:(async()=>{var x;const b=await this.getAdditionalCommandPicks(r,a,e,i);if(i.isCancellationRequested)return[];const y=b.map(D=>this.toCommandPick(D,n));return f&&((x=y[0])==null?void 0:x.type)!=="separator"&&y.unshift({type:"separator",label:w("suggested","similar commands")}),y})()}:d}toCommandPick(e,t){if(e.type==="separator")return e;const i=this.keybindingService.lookupKeybinding(e.commandId),n=i?w("commandPickAriaLabelWithKeybinding","{0}, {1}",e.label,i.getAriaLabel()):e.label;return{...e,ariaLabel:n,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,accept:async()=>{var r;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:(t==null?void 0:t.from)??"quick open"});try{(r=e.args)!=null&&r.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(o){zc(o)||this.dialogService.error(w("canNotRun","Command '{0}' resulted in an error",e.label),r3(o))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:i}){let n=e;return t&&t!==e&&(n+=` - ${t}`),i&&i.value!==e&&(n+=` - ${i.value===i.original?i.value:`${i.value} (${i.original})`}`),n}},Yv=Wh,Wh.PREFIX=">",Wh.TFIDF_THRESHOLD=.5,Wh.TFIDF_MAX_RESULTS=5,Wh.WORD_FILTER=lte(WI,y9e,ACe),Wh);VQ=Yv=Nxe([tm(1,ut),tm(2,Mi),tm(3,on),tm(4,so),tm(5,pN)],VQ);var vu;let $Q=(vu=class extends re{constructor(e,t,i){super(),this.storageService=e,this.configurationService=t,this.logService=i,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===KI.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=Ms.getConfiguredCommandHistoryLength(this.configurationService),Ms.cache&&Ms.cache.limit!==this.configuredCommandsHistoryLength&&(Ms.cache.limit=this.configuredCommandsHistoryLength,Ms.hasChanges=!0))}load(){const e=this.storageService.get(Ms.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch(n){this.logService.error(`[CommandsHistory] invalid data: ${n}`)}const i=Ms.cache=new lf(this.configuredCommandsHistoryLength,1);if(t){let n;t.usesLRU?n=t.entries:n=t.entries.sort((r,o)=>r.value-o.value),n.forEach(r=>i.set(r.key,r.value))}Ms.counter=this.storageService.getNumber(Ms.PREF_KEY_COUNTER,0,Ms.counter)}push(e){Ms.cache&&(Ms.cache.set(e,Ms.counter++),Ms.hasChanges=!0)}peek(e){var t;return(t=Ms.cache)==null?void 0:t.peek(e)}saveState(){if(!Ms.cache||!Ms.hasChanges)return;const e={usesLRU:!0,entries:[]};Ms.cache.forEach((t,i)=>e.entries.push({key:i,value:t})),this.storageService.store(Ms.PREF_KEY_CACHE,JSON.stringify(e),0,0),this.storageService.store(Ms.PREF_KEY_COUNTER,Ms.counter,0,0),Ms.hasChanges=!1}static getConfiguredCommandHistoryLength(e){var n,r;const i=(r=(n=e.getValue().workbench)==null?void 0:n.commandPalette)==null?void 0:r.history;return typeof i=="number"?i:Ms.DEFAULT_COMMANDS_HISTORY_LENGTH}},Ms=vu,vu.DEFAULT_COMMANDS_HISTORY_LENGTH=50,vu.PREF_KEY_CACHE="commandPalette.mru.cache",vu.PREF_KEY_COUNTER="commandPalette.mru.counter",vu.counter=1,vu.hasChanges=!1,vu);$Q=Ms=Nxe([tm(0,Bd),tm(1,Gt),tm(2,qr)],$Q);class oht extends VQ{constructor(e,t,i,n,r,o){super(e,t,i,n,r,o)}getCodeEditorCommandPicks(){var i;const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const n of e.getSupportedActions()){let r;(i=n.metadata)!=null&&i.description&&(b$e(n.metadata.description)?r=n.metadata.description:r={original:n.metadata.description,value:n.metadata.description}),t.push({commandId:n.id,commandAlias:n.alias,commandDescription:r,label:gte(n.label)||n.id})}return t}}var aht=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},B1=function(s,e){return function(t,i){e(t,i,s)}};let qT=class extends oht{get activeTextEditorControl(){return this.codeEditorService.getFocusedCodeEditor()??void 0}constructor(e,t,i,n,r,o){super({showAlias:!1},e,i,n,r,o),this.codeEditorService=t}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}};qT=aht([B1(0,ut),B1(1,yi),B1(2,Mi),B1(3,on),B1(4,so),B1(5,pN)],qT);const OW=class OW extends Ze{constructor(){super({id:OW.ID,label:K4.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:U.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(Uc).quickAccess.show(qT.PREFIX)}};OW.ID="editor.action.quickCommand";let eB=OW;Pe(eB);Fn.as(Oy.Quickaccess).registerQuickAccessProvider({ctor:qT,prefix:qT.PREFIX,helpEntries:[{description:K4.quickCommandHelp,commandId:eB.ID}]});var lht=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},W1=function(s,e){return function(t,i){e(t,i,s)}};let zQ=class extends gy{constructor(e,t,i,n,r,o,a){super(!0,e,t,i,n,r,o,a)}};zQ=lht([W1(1,yt),W1(2,yi),W1(3,gs),W1(4,ut),W1(5,Bd),W1(6,Gt)],zQ);gi(gy.ID,zQ,4);class cht extends Ze{constructor(){super({id:"editor.action.toggleHighContrast",label:qK.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(ac),n=i.getColorTheme();Eu(n.type)?(i.setTheme(this._originalThemeName||(MS(n.type)?eS:ig)),this._originalThemeName=null):(i.setTheme(MS(n.type)?Fb:Bb),this._originalThemeName=n.themeName)}}Pe(cht);const dht={name:"Files",components:{FileTreeNode:Z2e},data(){return{browseResult:{current_path:"",parent_path:null,items:[]},selectedPath:"",selectedItem:null,fileContent:null,loading:!1,expandedPaths:new Set,openFiles:[],activeFile:null,fileLoading:!1,saving:!1,editor:null,originalContent:"",sidebarWidth:260,isResizing:!1,contextMenu:{visible:!1,x:0,y:0,target:null},inputDialog:{visible:!1,title:"",value:"",placeholder:"",type:"",target:null},fileIcons:{js:"fa-brands fa-js text-yellow-400",ts:"fa-brands fa-js text-blue-400",html:"fa-brands fa-html5 text-orange-500",css:"fa-brands fa-css3 text-blue-400",scss:"fa-brands fa-sass text-pink-400",json:"fa-solid fa-file-code text-yellow-300",yaml:"fa-solid fa-file-code text-blue-300",yml:"fa-solid fa-file-code text-blue-300",md:"fa-solid fa-file-lines text-gray-400",py:"fa-brands fa-python text-blue-500",vue:"fa-brands fa-vuejs text-green-400",sh:"fa-solid fa-terminal text-green-400",go:"fa-brands fa-golang text-cyan-400",rs:"fa-brands fa-rust text-orange-400"}}},computed:{fileTreeData(){return this.browseResult.items.map(e=>this.transformNode(e)).sort((e,t)=>e.is_directory===t.is_directory?e.name.localeCompare(t.name):e.is_directory?-1:1)},hasChanges(){return this.editor?this.editor.getValue()!==this.originalContent:!1},isBinaryFile(){var s;return(s=this.activeFile)==null?void 0:s.is_binary}},watch:{activeFile:{immediate:!0,handler(s){this.$nextTick(()=>{!this.editor&&this.$refs.editorContainer&&this.initEditor(),s&&this.editor?this.loadFileContent(s.path).then(e=>{const t=this.getLanguageFromFilename(s.name),i=mF.createModel(e,t);this.editor.setModel(i),this.originalContent=e}):this.editor&&(this.editor.setModel(mF.createModel("","plaintext")),this.originalContent="")})}}},async created(){await this.browse(""),document.addEventListener("click",this.hideContextMenu),document.addEventListener("mousemove",this.handleResize),document.addEventListener("mouseup",this.stopResize)},activated(){!this.editor&&this.$refs.editorContainer&&this.initEditor()},beforeDestroy(){document.removeEventListener("click",this.hideContextMenu),document.removeEventListener("mousemove",this.handleResize),document.removeEventListener("mouseup",this.stopResize),this.editor&&(this.editor.dispose(),this.editor=null)},methods:{async browse(s){this.loading=!0;try{const e=await zn.browseFilesystem(s);this.browseResult=e.data}catch(e){console.error("Browse failed:",e)}finally{this.loading=!1}},transformNode(s){return{name:s.name,path:s.path,is_directory:s.is_directory,is_drive:s.is_drive||!1,size:s.size,has_children:s.is_directory,expanded:!1,children:[]}},handleSelect(s){this.selectedPath=s.path,this.selectedItem=s},async openFile(s){var t;if(s.is_directory)return;const e=this.openFiles.find(i=>i.path===s.path);if(e){this.activeFile=e;return}this.fileLoading=!0;try{const i=await this.loadFileContent(s.path),n={name:s.name,path:s.path,is_binary:((t=this.fileContent)==null?void 0:t.is_binary)||!1};this.openFiles.push(n),this.activeFile=n}catch(i){console.error("Open file failed:",i)}finally{this.fileLoading=!1}},closeFile(s){var t;const e=this.openFiles.findIndex(i=>i.path===s.path);if(this.openFiles=this.openFiles.filter(i=>i.path!==s.path),((t=this.activeFile)==null?void 0:t.path)===s.path){const i=e>0?e-1:0;this.activeFile=this.openFiles.length>0?this.openFiles[Math.min(i,this.openFiles.length-1)]:null}},async saveFile(){if(!(!this.activeFile||!this.hasChanges)){this.saving=!0;try{const s=this.editor.getValue();await zn.writeFile(this.activeFile.path,s),this.originalContent=s,this.$message.success("文件已保存")}catch(s){console.error("Save file failed:",s),this.$message.error("保存文件失败")}finally{this.saving=!1}}},async handleLoadChildren({path:s,callback:e}){try{const n=((await zn.browseFilesystem(s)).data.items||[]).map(r=>this.transformNode(r)).sort((r,o)=>r.is_directory===o.is_directory?r.name.localeCompare(o.name):r.is_directory?-1:1);e(n)}catch(t){console.error("Load children failed:",t),e([])}},goUp(){this.browseResult.parent_path!==null&&this.browse(this.browseResult.parent_path===""?"":this.browseResult.parent_path)},goHome(){this.browse("")},refresh(){this.browse(this.browseResult.current_path||"")},async loadFileContent(s){try{const e=await zn.getFileContent(s);return this.fileContent=e,e.content||""}catch(e){return console.error("Load file content failed:",e),this.fileContent={content:"加载失败",is_binary:!1,size:0},""}},startResize(s){this.isResizing=!0,document.body.style.cursor="col-resize",document.body.style.userSelect="none"},handleResize(s){if(!this.isResizing)return;const e=s.clientX;e>=150&&e<=500&&(this.sidebarWidth=e)},stopResize(){this.isResizing=!1,document.body.style.cursor="",document.body.style.userSelect=""},showContextMenu(s,e){e&&(s.preventDefault(),this.contextMenu={visible:!0,x:s.pageX,y:s.pageY,target:e},this.selectedItem=e,this.selectedPath=e.path)},hideContextMenu(){this.contextMenu.visible=!1},async createNewFile(){this.hideContextMenu(),this.inputDialog={visible:!0,title:"新建文件",value:"",placeholder:"输入文件名",type:"file",target:this.contextMenu.target},this.$nextTick(()=>{var s;(s=this.$refs.renameInput)==null||s.focus()})},async createNewFolder(){this.hideContextMenu(),this.inputDialog={visible:!0,title:"新建文件夹",value:"",placeholder:"输入文件夹名",type:"folder",target:this.contextMenu.target},this.$nextTick(()=>{var s;(s=this.$refs.renameInput)==null||s.focus()})},copyPath(){this.hideContextMenu(),navigator.clipboard.writeText(this.contextMenu.target.path),this.$message.success("路径已复制")},renameItem(){this.hideContextMenu(),this.inputDialog={visible:!0,title:"重命名",value:this.contextMenu.target.name,placeholder:"输入新名称",type:"rename",target:this.contextMenu.target},this.$nextTick(()=>{var s,e;(s=this.$refs.renameInput)==null||s.focus(),(e=this.$refs.renameInput)==null||e.select()})},async confirmInput(){const{type:s,value:e,target:t}=this.inputDialog;if(!e.trim()){this.cancelInput();return}try{if(s==="file"){const i=t.path+"\\"+e.trim();await zn.writeFile(i,"")}else if(s==="folder"){const i=t.path+"\\"+e.trim();await zn.createDirectory(i)}else s==="rename"&&await zn.renameFile(t.path,e.trim());this.refresh()}catch(i){console.error("Operation failed:",i),this.$message.error("操作失败")}this.inputDialog.visible=!1},cancelInput(){this.inputDialog.visible=!1},async deleteItem(){this.hideContextMenu();try{await this.$confirm(`确定要删除 "${this.contextMenu.target.name}" 吗?`,"确认删除",{confirmButtonText:"删除",cancelButtonText:"取消",type:"warning"}),await zn.deleteFile(this.contextMenu.target.path),this.$message.success("删除成功"),this.refresh()}catch(s){s!=="cancel"&&(console.error("Delete failed:",s),this.$message.error("删除失败"))}},initEditor(){this.editor||this.$refs.editorContainer&&(this.editor=mF.create(this.$refs.editorContainer,{value:"",language:"plaintext",theme:"vs-dark",automaticLayout:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:14,fontFamily:'Consolas, Monaco, "Courier New", monospace',lineNumbers:"on",roundedSelection:!1,scrollbar:{useShadows:!1,verticalHasArrows:!1,horizontalHasArrows:!1,vertical:"auto",horizontal:"auto"}}),this.editor.onDidChangeModelContent(()=>{this.$forceUpdate()}),this.editor.addCommand(F1e.CtrlCmd|A1e.KeyS,()=>{this.saveFile()}))},getFileIcon(s){const e=s.split(".").pop().toLowerCase(),t=s.toLowerCase();return t==="dockerfile"?"fa-brands fa-docker text-blue-400":t===".gitignore"?"fa-brands fa-git text-red-400":t.startsWith("readme")?this.fileIcons.md:this.fileIcons[e]||"fa-solid fa-file text-gray-400"},getLanguageFromFilename(s){const e=s.split(".").pop().toLowerCase();return{js:"javascript",ts:"typescript",html:"html",css:"css",scss:"scss",vue:"html",py:"python",md:"markdown",json:"json",yaml:"yaml",yml:"yaml",xml:"xml",sql:"sql",sh:"shell",go:"go",rs:"rust"}[e]||"plaintext"}}};var uht=function(){var i;var e=this,t=e._self._c;return t("div",{staticClass:"flex-1 flex overflow-hidden"},[t("aside",{staticClass:"bg-sidebar border-r border-border flex flex-col shrink-0",style:{width:e.sidebarWidth+"px"}},[e._m(0),t("div",{staticClass:"flex items-center gap-1 px-2 py-2 border-b border-border"},[t("button",{staticClass:"p-1 text-textMuted hover:text-white disabled:opacity-30 disabled:cursor-not-allowed",attrs:{disabled:!e.browseResult.parent_path&&e.browseResult.parent_path!=="",title:"上级目录"},on:{click:e.goUp}},[t("i",{staticClass:"fa-solid fa-arrow-up"})]),t("button",{staticClass:"p-1 text-textMuted hover:text-white",attrs:{title:"刷新"},on:{click:e.refresh}},[t("i",{staticClass:"fa-solid fa-refresh"})]),t("button",{staticClass:"p-1 text-textMuted hover:text-white",attrs:{title:"我的电脑"},on:{click:e.goHome}},[t("i",{staticClass:"fa-solid fa-home"})])]),t("div",{staticClass:"flex-1 overflow-y-auto py-1 sidebar-scroll"},[e.loading?t("div",{staticClass:"flex items-center justify-center py-8 text-textMuted"},[t("i",{staticClass:"fa-solid fa-spinner fa-spin mr-2"}),e._v(" 加载中... ")]):e.fileTreeData.length===0?t("div",{staticClass:"flex items-center justify-center py-8 text-textMuted text-sm"},[e._v(" 此目录为空 ")]):e._l(e.fileTreeData,function(n){return t("file-tree-node",{key:n.path,attrs:{node:n,level:0,"selected-path":e.selectedPath},on:{select:e.handleSelect,"open-file":e.openFile,"load-children":e.handleLoadChildren,contextmenu:e.showContextMenu}})})],2),t("div",{directives:[{name:"show",rawName:"v-show",value:e.contextMenu.visible,expression:"contextMenu.visible"}],staticClass:"fixed bg-sidebar border border-border rounded shadow-lg py-1 z-50 min-w-[160px]",style:{left:e.contextMenu.x+"px",top:e.contextMenu.y+"px"}},[(i=e.contextMenu.target)!=null&&i.is_directory?[t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.copyPath}},[t("i",{staticClass:"fa-solid fa-copy text-xs"}),e._v(" 复制路径 ")]),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.createNewFile}},[t("i",{staticClass:"fa-solid fa-file-lines text-xs"}),e._v(" 新建文件 ")]),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.createNewFolder}},[t("i",{staticClass:"fa-solid fa-folder-plus text-xs"}),e._v(" 新建文件夹 ")]),t("div",{staticClass:"border-t border-border my-1"}),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.renameItem}},[t("i",{staticClass:"fa-solid fa-pen text-xs"}),e._v(" 重命名 ")]),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-red-400 hover:bg-active flex items-center gap-2",on:{click:e.deleteItem}},[t("i",{staticClass:"fa-solid fa-trash text-xs"}),e._v(" 删除 ")])]:[t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.copyPath}},[t("i",{staticClass:"fa-solid fa-copy text-xs"}),e._v(" 复制路径 ")]),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.renameItem}},[t("i",{staticClass:"fa-solid fa-pen text-xs"}),e._v(" 重命名 ")]),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-red-400 hover:bg-active flex items-center gap-2",on:{click:e.deleteItem}},[t("i",{staticClass:"fa-solid fa-trash text-xs"}),e._v(" 删除 ")])]],2),t("div",{directives:[{name:"show",rawName:"v-show",value:e.inputDialog.visible,expression:"inputDialog.visible"}],staticClass:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",on:{click:function(n){return n.target!==n.currentTarget?null:e.cancelInput.apply(null,arguments)}}},[t("div",{staticClass:"bg-sidebar border border-border rounded p-4 w-80"},[t("p",{staticClass:"text-white text-sm mb-3"},[e._v(e._s(e.inputDialog.title))]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.inputDialog.value,expression:"inputDialog.value"}],ref:"renameInput",staticClass:"w-full px-3 py-2 bg-[#1e1e1e] border border-border rounded text-white text-sm focus:outline-none focus:border-accent",attrs:{placeholder:e.inputDialog.placeholder},domProps:{value:e.inputDialog.value},on:{keyup:[function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"enter",13,n.key,"Enter")?null:e.confirmInput.apply(null,arguments)},function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"escape",void 0,n.key,void 0)?null:e.cancelInput.apply(null,arguments)}],input:function(n){n.target.composing||e.$set(e.inputDialog,"value",n.target.value)}}}),t("div",{staticClass:"flex justify-end gap-2 mt-4"},[t("button",{staticClass:"px-3 py-1 text-xs text-textMuted hover:text-white",on:{click:e.cancelInput}},[e._v("取消")]),t("button",{staticClass:"px-3 py-1 text-xs bg-accent text-white rounded hover:bg-blue-600",on:{click:e.confirmInput}},[e._v("确定")])])])])]),t("div",{staticClass:"w-1 bg-border hover:bg-accent cursor-col-resize transition-colors",on:{mousedown:e.startResize}}),t("main",{staticClass:"flex-1 flex flex-col min-w-0 bg-[#1e1e1e]"},[t("div",{staticClass:"flex border-b border-border bg-sidebar overflow-x-auto"},e._l(e.openFiles,function(n){var r;return t("div",{key:n.path,staticClass:"flex items-center gap-2 px-3 py-2 cursor-pointer border-r border-border",class:((r=e.activeFile)==null?void 0:r.path)===n.path?"bg-[#1e1e1e] text-white border-t-2 border-t-accent":"text-textMuted hover:bg-[#2a2a2a]",on:{click:function(o){e.activeFile=n}}},[t("i",{staticClass:"text-xs",class:e.getFileIcon(n.name)}),t("span",{staticClass:"text-xs"},[e._v(e._s(n.name))]),t("button",{staticClass:"ml-2 hover:text-white text-textMuted",on:{click:function(o){return o.stopPropagation(),e.closeFile(n)}}},[t("i",{staticClass:"fa-solid fa-times text-[10px]"})])])}),0),t("div",{staticClass:"flex-1 overflow-hidden"},[e.activeFile?e.fileLoading?t("div",{staticClass:"flex items-center justify-center h-full text-textMuted"},[t("i",{staticClass:"fa-solid fa-spinner fa-spin mr-2"}),e._v(" 加载中... ")]):e.isBinaryFile?t("div",{staticClass:"flex items-center justify-center h-full text-textMuted"},[e._m(1)]):e._e():t("div",{staticClass:"text-textMuted text-center mt-20"},[t("i",{staticClass:"fa-solid fa-file-code text-6xl mb-4 opacity-20"}),t("p",[e._v("双击左侧文件打开编辑器")])]),t("div",{directives:[{name:"show",rawName:"v-show",value:e.activeFile&&!e.isBinaryFile,expression:"activeFile && !isBinaryFile"}],ref:"editorContainer",staticClass:"monaco-editor-container"})]),e.activeFile&&!e.isBinaryFile?t("div",{staticClass:"h-8 bg-sidebar border-t border-border flex items-center justify-between px-3"},[t("div",{staticClass:"flex items-center gap-4 text-xs text-textMuted"},[t("span",[e._v(e._s(e.activeFile.path))]),e.hasChanges?t("span",{staticClass:"text-yellow-500"},[e._v("已修改")]):e._e()]),t("div",{staticClass:"flex items-center gap-2"},[t("button",{staticClass:"px-3 py-1 text-xs bg-primary hover:bg-blue-600 disabled:opacity-50 disabled:cursor-not-allowed text-white rounded",attrs:{disabled:!e.hasChanges||e.saving},on:{click:e.saveFile}},[e.saving?t("i",{staticClass:"fa-solid fa-spinner fa-spin mr-1"}):t("i",{staticClass:"fa-solid fa-save mr-1"}),e._v(" 保存 ")])])]):e._e()])])},hht=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"flex border-b border-border text-xs uppercase font-bold text-textMuted"},[e("div",{staticClass:"px-4 py-2 border-b-2 border-accent text-white flex items-center gap-2"},[e("i",{staticClass:"fa-solid fa-folder-open"}),s._v(" Explorer ")])])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"text-center"},[e("i",{staticClass:"fa-solid fa-file text-4xl mb-4 opacity-30"}),e("p",[s._v("二进制文件无法预览")])])}],fht=Da(dht,uht,hht,!1,null,"5dac233a");const ght=fht.exports,pht={name:"Skills",data(){return{subTab:"project",skills:[],systemSkills:[]}},async created(){await this.loadSkills()},methods:{async loadSkills(){try{const s=await zn.getSkills();this.skills=s.data||[],this.systemSkills=[]}catch(s){console.error("加载技能失败:",s),this.skills=[],this.systemSkills=[]}}}};var mht=function(){var e=this,t=e._self._c;return t("div",{staticClass:"flex-1 flex overflow-hidden"},[t("aside",{staticClass:"w-[220px] bg-sidebar border-r border-border flex flex-col shrink-0 py-4"},[e._m(0),t("div",{staticClass:"flex-1 overflow-y-auto"},[t("div",{staticClass:"px-4 py-1 text-xs font-bold text-textMuted uppercase mt-2"},[e._v("Configuration")]),t("button",{staticClass:"w-full text-left px-4 py-2 flex items-center gap-2",class:e.subTab==="project"?"bg-active text-white border-l-2 border-accent":"text-textMuted hover:text-white hover:bg-white/5 border-l-2 border-transparent",on:{click:function(i){e.subTab="project"}}},[t("i",{staticClass:"fa-solid fa-folder-tree w-4 text-center"}),e._v(" Project Skills ")]),t("button",{staticClass:"w-full text-left px-4 py-2 flex items-center gap-2",class:e.subTab==="system"?"bg-active text-white border-l-2 border-accent":"text-textMuted hover:text-white hover:bg-white/5 border-l-2 border-transparent",on:{click:function(i){e.subTab="system"}}},[t("i",{staticClass:"fa-solid fa-globe w-4 text-center"}),e._v(" System Skills ")])])]),t("main",{staticClass:"flex-1 flex flex-col bg-[#1e1e1e] min-w-0"},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.subTab==="project",expression:"subTab === 'project'"}],staticClass:"flex-1 p-6 overflow-y-auto"},[t("div",{staticClass:"max-w-4xl mx-auto"},[e._m(1),e.skills.length===0?t("div",{staticClass:"text-center text-textMuted py-10"},[t("i",{staticClass:"fa-solid fa-shapes text-4xl mb-4 opacity-30"}),t("p",[e._v("暂无项目 Skills")])]):t("div",{staticClass:"space-y-3"},e._l(e.skills,function(i){return t("div",{key:i.name,staticClass:"bg-sidebar border border-border p-4 rounded flex justify-between items-start hover:border-accent group"},[t("div",{staticClass:"flex gap-4"},[e._m(2,!0),t("div",[t("h4",{staticClass:"text-white font-bold text-sm"},[e._v(e._s(i.name))]),t("p",{staticClass:"text-textMuted text-xs h-10 overflow-hidden mt-1"},[e._v(e._s(i.description))])])])])}),0)])]),t("div",{directives:[{name:"show",rawName:"v-show",value:e.subTab==="system",expression:"subTab === 'system'"}],staticClass:"flex-1 p-6 overflow-y-auto"},[t("h3",{staticClass:"text-2xl text-white font-light mb-6"},[e._v("System Skills")]),e.systemSkills.length===0?t("div",{staticClass:"text-center text-textMuted py-10"},[t("i",{staticClass:"fa-solid fa-shapes text-4xl mb-4 opacity-30"}),t("p",[e._v("暂无系统 Skills")])]):t("div",{staticClass:"grid grid-cols-2 lg:grid-cols-3 gap-3"},e._l(e.systemSkills,function(i){return t("label",{key:i.name,staticClass:"bg-sidebar border border-border p-3 rounded flex items-center gap-3 cursor-pointer hover:bg-active"},[t("input",{staticClass:"accent-accent",attrs:{type:"checkbox"},domProps:{checked:i.enabled}}),t("span",{staticClass:"text-sm text-textMain"},[e._v(e._s(i.name))])])}),0)])])])},_ht=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"px-4 mb-4"},[e("h2",{staticClass:"text-white font-bold text-lg mb-1"},[s._v("Skills")]),e("input",{staticClass:"w-full bg-black/20 border border-border rounded px-2 py-1 text-xs",attrs:{type:"text",placeholder:"Filter..."}})])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"flex justify-between items-center mb-6"},[e("div",[e("h3",{staticClass:"text-2xl text-white font-light"},[s._v("Project Skills")]),e("p",{staticClass:"text-textMuted text-xs mt-1"},[s._v(" Skills specific to your project ")])])])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"w-10 h-10 rounded flex items-center justify-center text-xl bg-purple-900/30 text-purple-400"},[e("i",{staticClass:"fa-solid fa-shapes"})])}],vht=Da(pht,mht,_ht,!1,null,null);const bht=vht.exports,Cht={name:"DbView",data(){return{tables:[],selectedTable:null,tableInfo:{},tableData:{columns:[],rows:[]},page:1,pageSize:50,totalPages:1,loading:!1}},async created(){await this.loadTables()},methods:{async loadTables(){this.loading=!0;try{const s=await zn.getDbTables();this.tables=s.tables||[]}catch(s){console.error("Load tables failed:",s),this.tables=[]}finally{this.loading=!1}},async selectTable(s){this.selectedTable=s,this.page=1,await this.loadTableInfo(),await this.loadTableData()},async loadTableInfo(){if(this.selectedTable)try{this.tableInfo=await zn.getTableInfo(this.selectedTable),this.totalPages=Math.max(1,Math.ceil((this.tableInfo.row_count||0)/this.pageSize))}catch(s){console.error("Load table info failed:",s),this.tableInfo={}}},async loadTableData(){if(this.selectedTable)try{this.tableData=await zn.getTableData(this.selectedTable,this.page,this.pageSize)}catch(s){console.error("Load table data failed:",s),this.tableData={columns:[],rows:[]}}},async prevPage(){this.page>1&&(this.page--,await this.loadTableData())},async nextPage(){this.page<this.totalPages&&(this.page++,await this.loadTableData())},formatCell(s){return s===null?"<null>":s===void 0?"":typeof s=="boolean"?s?"true":"false":typeof s=="object"?JSON.stringify(s):String(s)}}};var yht=function(){var e=this,t=e._self._c;return t("div",{staticClass:"flex-1 flex overflow-hidden"},[t("aside",{staticClass:"w-[260px] bg-sidebar border-r border-border flex flex-col shrink-0"},[e._m(0),t("div",{staticClass:"flex items-center gap-1 px-2 py-2 border-b border-border"},[t("button",{staticClass:"p-1 text-textMuted hover:text-white",attrs:{title:"刷新"},on:{click:e.loadTables}},[t("i",{staticClass:"fa-solid fa-refresh"})])]),t("div",{staticClass:"flex-1 overflow-y-auto py-1"},[e.loading?t("div",{staticClass:"flex items-center justify-center py-8 text-textMuted"},[t("i",{staticClass:"fa-solid fa-spinner fa-spin mr-2"}),e._v(" 加载中... ")]):e.tables.length===0?t("div",{staticClass:"flex items-center justify-center py-8 text-textMuted text-sm"},[e._v(" 暂无表 ")]):t("div",e._l(e.tables,function(i){return t("div",{key:i,staticClass:"flex items-center gap-2 px-3 py-1.5 cursor-pointer text-sm",class:e.selectedTable===i?"bg-active text-white border-l-2 border-accent":"text-textMuted hover:text-white hover:bg-white/5 border-l-2 border-transparent",on:{click:function(n){return e.selectTable(i)}}},[t("i",{staticClass:"fa-solid fa-table text-textMuted text-xs"}),t("span",{staticClass:"truncate"},[e._v(e._s(i))])])}),0)])]),t("main",{staticClass:"flex-1 flex flex-col min-w-0 bg-[#1e1e1e]"},[e.selectedTable?t("div",{staticClass:"flex-1 flex flex-col overflow-hidden"},[t("div",{staticClass:"flex items-center justify-between px-4 py-2 border-b border-border bg-sidebar"},[t("div",{staticClass:"flex items-center gap-2"},[t("i",{staticClass:"fa-solid fa-table text-textMuted"}),t("span",{staticClass:"text-sm text-white"},[e._v(e._s(e.selectedTable))]),t("span",{staticClass:"text-xs text-textMuted"},[e._v("("+e._s(e.tableInfo.row_count||0)+" 行)")])]),t("div",{staticClass:"flex items-center gap-2"},[t("button",{staticClass:"px-2 py-1 text-xs text-textMuted hover:text-white disabled:opacity-30 disabled:cursor-not-allowed",attrs:{disabled:e.page<=1},on:{click:e.prevPage}},[t("i",{staticClass:"fa-solid fa-chevron-left"})]),t("span",{staticClass:"text-xs text-textMuted"},[e._v(e._s(e.page)+" / "+e._s(e.totalPages||1))]),t("button",{staticClass:"px-2 py-1 text-xs text-textMuted hover:text-white disabled:opacity-30 disabled:cursor-not-allowed",attrs:{disabled:e.page>=e.totalPages},on:{click:e.nextPage}},[t("i",{staticClass:"fa-solid fa-chevron-right"})])])]),t("div",{staticClass:"flex-1 overflow-auto"},[t("table",{staticClass:"w-full text-sm"},[t("thead",{staticClass:"bg-sidebar sticky top-0"},[t("tr",e._l(e.tableInfo.columns,function(i){return t("th",{key:i.name,staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[e._v(" "+e._s(i.name)+" "),t("span",{staticClass:"text-xs font-normal text-textMuted opacity-60 ml-1"},[e._v(e._s(i.type))])])}),0)]),t("tbody",[e._l(e.tableData.rows,function(i,n){return t("tr",{key:n,staticClass:"hover:bg-white/5"},e._l(e.tableInfo.columns,function(r){return t("td",{key:r.name,staticClass:"px-3 py-1.5 text-gray-300 border-b border-border/30"},[e._v(" "+e._s(e.formatCell(i[r.name]))+" ")])}),0)}),e.tableData.rows&&e.tableData.rows.length===0?t("tr",[t("td",{staticClass:"px-3 py-8 text-center text-textMuted",attrs:{colspan:e.tableInfo.columns?e.tableInfo.columns.length:0}},[e._v(" 表中无数据 ")])]):e._e()],2)])])]):t("div",{staticClass:"flex-1 flex items-center justify-center text-textMuted"},[e._m(1)])])])},wht=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"flex border-b border-border text-xs uppercase font-bold text-textMuted"},[e("div",{staticClass:"px-4 py-2 border-b-2 border-accent text-white flex items-center gap-2"},[e("i",{staticClass:"fa-solid fa-database"}),s._v(" Tables ")])])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"text-center"},[e("i",{staticClass:"fa-solid fa-database text-6xl mb-4 opacity-20"}),e("p",[s._v("选择表查看数据")])])}],Sht=Da(Cht,yht,wht,!1,null,null);const xht=Sht.exports;Ds.use(V_e);const kht=[{path:"/",component:()=>at(()=>import("./Layout-CQhbIJxB.js"),[]),redirect:"/codeView",children:[{path:"codeView",name:"codeView",component:Kle},{path:"codeView/:id",name:"codeView-session",component:Kle},{path:"files",name:"files",component:ght},{path:"skills",name:"skills",component:bht},{path:"terminal",name:"terminal",component:()=>at(()=>import("./TerminalView-BKhdi5UF.js"),__vite__mapDeps([2,3]))},{path:"terminal/:id",name:"terminal-session",component:()=>at(()=>import("./TerminalView-BKhdi5UF.js"),__vite__mapDeps([2,3]))},{path:"db",name:"db",component:xht},{path:"aiLogs",name:"aiLogs",component:()=>at(()=>import("./AiLogsView-D_SQ6qo4.js"),[])},{path:"tasks",name:"tasks",component:()=>at(()=>import("./TasksView-B9B2H3-S.js"),[])},{path:"devWorkflow",name:"devWorkflow",component:()=>at(()=>import("./DevWorkflowView-iHAv9LC0.js"),__vite__mapDeps([4,5]))},{path:"settings",name:"settings",component:U2e}]}],Lht=new V_e({mode:"history",routes:kht});Ds.use(ZPe);Ds.prototype.$api=zn;Ds.config.productionTip=!1;new Ds({router:Lht,render:s=>s(tOe)}).$mount("#app");export{m2e as C,o2e as F,u2e as M,zn as a,Jn as g,ON as m,Da as n,t0e as t};
|
|
949
|
+
`)};const o=await r.provideRenameEdits(this.model,this.position,e,n);if(o){if(o.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(o.rejectReason),n)}else return this._provideRenameEdits(e,t+1,i.concat(w("no result","No result.")),n);return o}}async function ddt(s,e,t,i){const n=new Rne(e,t,s),r=await n.resolveRenameLocation($t.None);return r!=null&&r.rejectReason?{edits:[],rejectReason:r.rejectReason}:n.provideRenameEdits(i,$t.None)}var MC;let b_=(MC=class{static get(e){return e.getContribution(uQ.ID)}constructor(e,t,i,n,r,o,a,l,d){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=n,this._progressService=r,this._logService=o,this._configService=a,this._languageFeaturesService=l,this._telemetryService=d,this._disposableStore=new me,this._cts=new An,this._renameWidget=this._disposableStore.add(this._instaService.createInstance(dQ,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){var v,b;const e=this._logService.trace.bind(this._logService,"[rename]");if(this._cts.dispose(!0),this._cts=new An,!this.editor.hasModel()){e("editor has no model");return}const t=this.editor.getPosition(),i=new Rne(this.editor.getModel(),t,this._languageFeaturesService.renameProvider);if(!i.hasProvider()){e("skeleton has no provider");return}const n=new p_(this.editor,5,void 0,this._cts.token);let r;try{e("resolving rename location");const y=i.resolveRenameLocation(n.token);this._progressService.showWhile(y,250),r=await y,e("resolved rename location")}catch(y){y instanceof Ed?e("resolve rename location cancelled",JSON.stringify(y,null," ")):(e("resolve rename location failed",y instanceof Error?y:JSON.stringify(y,null," ")),(typeof y=="string"||Nu(y))&&((v=al.get(this.editor))==null||v.showMessage(y||w("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),t)));return}finally{n.dispose()}if(!r){e("returning early - no loc");return}if(r.rejectReason){e(`returning early - rejected with reason: ${r.rejectReason}`,r.rejectReason),(b=al.get(this.editor))==null||b.showMessage(r.rejectReason,t);return}if(n.token.isCancellationRequested){e("returning early - cts1 cancelled");return}const o=new p_(this.editor,5,r.range,this._cts.token),a=this.editor.getModel(),l=this._languageFeaturesService.newSymbolNamesProvider.all(a),d=await Promise.all(l.map(async y=>[y,await y.supportsAutomaticNewSymbolNamesTriggerKind??!1])),h=(y,x)=>{let D=d.slice();return y===CI.Automatic&&(D=D.filter(([S,E])=>E)),D.map(([S])=>S.provideNewSymbolNames(a,r.range,y,x))};e("creating rename input field and awaiting its result");const f=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),p=await this._renameWidget.getInput(r.range,r.text,f,l.length>0?h:void 0,o);if(e("received response from rename input field"),l.length>0&&this._reportTelemetry(l.length,a.getLanguageId(),p),typeof p=="boolean"){e(`returning early - rename input field response - ${p}`),p&&this.editor.focus(),o.dispose();return}this.editor.focus(),e("requesting rename edits");const m=hN(i.provideRenameEdits(p.newName,o.token),o.token).then(async y=>{if(!y){e("returning early - no rename edits result");return}if(!this.editor.hasModel()){e("returning early - no model after rename edits are provided");return}if(y.rejectReason){e(`returning early - rejected with reason: ${y.rejectReason}`),this._notificationService.info(y.rejectReason);return}this.editor.setSelection(W.fromPositions(this.editor.getSelection().getPosition())),e("applying edits"),this._bulkEditService.apply(y,{editor:this.editor,showPreview:p.wantsPreview,label:w("label","Renaming '{0}' to '{1}'",r==null?void 0:r.text,p.newName),code:"undoredo.rename",quotableLabel:w("quotableLabel","Renaming {0} to {1}",r==null?void 0:r.text,p.newName),respectAutoSaveConfig:!0}).then(x=>{e("edits applied"),x.ariaSummary&&Qo(w("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",r.text,p.newName,x.ariaSummary))}).catch(x=>{e(`error when applying edits ${JSON.stringify(x,null," ")}`),this._notificationService.error(w("rename.failedApply","Rename failed to apply edits")),this._logService.error(x)})},y=>{e("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(()=>{o.dispose()});return e("returning rename operation"),this._progressService.showWhile(m,250),m}acceptRenameInput(e){this._renameWidget.acceptInput(e)}cancelRenameInput(){this._renameWidget.cancelInput(!0,"cancelRenameInput command")}focusNextRenameSuggestion(){this._renameWidget.focusNextRenameSuggestion()}focusPreviousRenameSuggestion(){this._renameWidget.focusPreviousRenameSuggestion()}_reportTelemetry(e,t,i){const n=typeof i=="boolean"?{kind:"cancelled",languageId:t,nRenameSuggestionProviders:e}:{kind:"accepted",languageId:t,nRenameSuggestionProviders:e,source:i.stats.source.k,nRenameSuggestions:i.stats.nRenameSuggestions,timeBeforeFirstInputFieldEdit:i.stats.timeBeforeFirstInputFieldEdit,wantsPreview:i.wantsPreview,nRenameSuggestionsInvocations:i.stats.nRenameSuggestionsInvocations,hadAutomaticRenameSuggestionsInvocation:i.stats.hadAutomaticRenameSuggestionsInvocation};this._telemetryService.publicLog2("renameInvokedEvent",n)}},uQ=MC,MC.ID="editor.contrib.renameController",MC);b_=uQ=cdt([Pp(1,ut),Pp(2,gs),Pp(3,CN),Pp(4,L_),Pp(5,qr),Pp(6,PH),Pp(7,it),Pp(8,so)],b_);class udt extends Ze{constructor(){super({id:"editor.action.rename",label:w("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:ve.and(U.writable,U.hasRenameProvider),kbOpts:{kbExpr:U.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(yi),[n,r]=Array.isArray(t)&&t||[void 0,void 0];return gt.isUri(n)&&ie.isIPosition(r)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(o=>{o&&(o.setPosition(r),o.invokeWithinContext(a=>(this.reportTelemetry(a,o),this.run(a,o))))},Tt):super.runCommand(e,t)}run(e,t){const i=e.get(qr),n=b_.get(t);return n?(i.trace("[RenameAction] got controller, running..."),n.run()):(i.trace("[RenameAction] returning early - controller missing"),Promise.resolve())}}gi(b_.ID,b_,4);Pe(udt);const Pne=$s.bindToContribution(b_.get);Ue(new Pne({id:"acceptRenameInput",precondition:Zx,handler:s=>s.acceptRenameInput(!1),kbOpts:{weight:199,kbExpr:ve.and(U.focus,ve.not("isComposing")),primary:3}}));Ue(new Pne({id:"acceptRenameInputWithPreview",precondition:ve.and(Zx,ve.has("config.editor.rename.enablePreview")),handler:s=>s.acceptRenameInput(!0),kbOpts:{weight:199,kbExpr:ve.and(U.focus,ve.not("isComposing")),primary:2051}}));Ue(new Pne({id:"cancelRenameInput",precondition:Zx,handler:s=>s.cancelRenameInput(),kbOpts:{weight:199,kbExpr:U.focus,primary:9,secondary:[1033]}}));sn(class extends ea{constructor(){super({id:"focusNextRenameSuggestion",title:{...kt("focusNextRenameSuggestion","Focus Next Rename Suggestion")},precondition:Zx,keybinding:[{primary:18,weight:199}]})}run(e){const t=e.get(yi).getFocusedCodeEditor();if(!t)return;const i=b_.get(t);i&&i.focusNextRenameSuggestion()}});sn(class extends ea{constructor(){super({id:"focusPreviousRenameSuggestion",title:{...kt("focusPreviousRenameSuggestion","Focus Previous Rename Suggestion")},precondition:Zx,keybinding:[{primary:16,weight:199}]})}run(e){const t=e.get(yi).getFocusedCodeEditor();if(!t)return;const i=b_.get(t);i&&i.focusPreviousRenameSuggestion()}});Ia("_executeDocumentRenameProvider",function(s,e,t,...i){const[n]=i;Ci(typeof n=="string");const{renameProvider:r}=s.get(it);return ddt(r,e,t,n)});Ia("_executePrepareRename",async function(s,e,t){const{renameProvider:i}=s.get(it),r=await new Rne(e,t,i).resolveRenameLocation($t.None);if(r!=null&&r.rejectReason)throw new Error(r.rejectReason);return r});Fn.as(Fd.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"}}});var hdt=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},ipe=function(s,e){return function(t,i){e(t,i,s)}},bS;let U3=(bS=class extends re{constructor(e,t,i){super(),this.editor=e,this.languageConfigurationService=t,this.editorWorkerService=i,this.decorations=this.editor.createDecorationsCollection(),this.options=this.createOptions(e.getOption(73)),this.computePromise=null,this.currentOccurrences={},this._register(e.onDidChangeModel(n=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(73)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(e.onDidChangeModelLanguage(n=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(73)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(t.onDidChange(n=>{var o;const r=(o=this.editor.getModel())==null?void 0:o.getLanguageId();r&&n.affects(r)&&(this.currentOccurrences={},this.options=this.createOptions(e.getOption(73)),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(e.onDidChangeConfiguration(n=>{this.options&&!n.hasChanged(73)||(this.options=this.createOptions(e.getOption(73)),this.updateDecorations([]),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(this.editor.onDidChangeModelContent(n=>{this.computeSectionHeaders.schedule()})),this._register(e.onDidChangeModelTokens(n=>{this.computeSectionHeaders.isScheduled()||this.computeSectionHeaders.schedule(1e3)})),this.computeSectionHeaders=this._register(new ji(()=>{this.findSectionHeaders()},250)),this.computeSectionHeaders.schedule(0)}createOptions(e){if(!e||!this.editor.hasModel())return;const t=this.editor.getModel().getLanguageId();if(!t)return;const i=this.languageConfigurationService.getLanguageConfiguration(t).comments,n=this.languageConfigurationService.getLanguageConfiguration(t).foldingRules;if(!(!i&&!(n!=null&&n.markers)))return{foldingRules:n,findMarkSectionHeaders:e.showMarkSectionHeaders,findRegionSectionHeaders:e.showRegionSectionHeaders}}findSectionHeaders(){var i,n;if(!this.editor.hasModel()||!((i=this.options)!=null&&i.findMarkSectionHeaders)&&!((n=this.options)!=null&&n.findRegionSectionHeaders))return;const e=this.editor.getModel();if(e.isDisposed()||e.isTooLargeForSyncing())return;const t=e.getVersionId();this.editorWorkerService.findSectionHeaders(e.uri,this.options).then(r=>{e.isDisposed()||e.getVersionId()!==t||this.updateDecorations(r)})}updateDecorations(e){const t=this.editor.getModel();t&&(e=e.filter(r=>{if(!r.shouldBeInComments)return!0;const o=t.validateRange(r.range),a=t.tokenization.getLineTokens(o.startLineNumber),l=a.findTokenIndexAtOffset(o.startColumn-1),d=a.getStandardTokenType(l);return a.getLanguageId(l)===t.getLanguageId()&&d===1}));const i=Object.values(this.currentOccurrences).map(r=>r.decorationId),n=e.map(r=>fdt(r));this.editor.changeDecorations(r=>{const o=r.deltaDecorations(i,n);this.currentOccurrences={};for(let a=0,l=o.length;a<l;a++){const d={sectionHeader:e[a],decorationId:o[a]};this.currentOccurrences[d.decorationId]=d}})}stop(){this.computeSectionHeaders.cancel(),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop(),this.decorations.clear()}},bS.ID="editor.sectionHeaderDetector",bS);U3=hdt([ipe(1,Bn),ipe(2,Na)],U3);function fdt(s){return{range:s.range,options:Ot.createDynamic({description:"section-header",stickiness:3,collapseOnReplaceEdit:!0,minimap:{color:void 0,position:1,sectionHeaderStyle:s.hasSeparatorLine?2:1,sectionHeaderText:s.text}})}}gi(U3.ID,U3,1);function gdt(s){for(let e=0,t=s.length;e<t;e+=4){const i=s[e+0],n=s[e+1],r=s[e+2],o=s[e+3];s[e+0]=o,s[e+1]=r,s[e+2]=n,s[e+3]=i}}function pdt(s){const e=new Uint8Array(s.buffer,s.byteOffset,s.length*4);return hve()||gdt(e),NH.wrap(e)}function nxe(s){const e=new Uint32Array(mdt(s));let t=0;if(e[t++]=s.id,s.type==="full")e[t++]=1,e[t++]=s.data.length,e.set(s.data,t),t+=s.data.length;else{e[t++]=2,e[t++]=s.deltas.length;for(const i of s.deltas)e[t++]=i.start,e[t++]=i.deleteCount,i.data?(e[t++]=i.data.length,e.set(i.data,t),t+=i.data.length):e[t++]=0}return pdt(e)}function mdt(s){let e=0;if(e+=2,s.type==="full")e+=1+s.data.length;else{e+=1,e+=3*s.deltas.length;for(const t of s.deltas)t.data&&(e+=t.data.length)}return e}function zV(s){return s&&!!s.data}function sxe(s){return s&&Array.isArray(s.edits)}class _dt{constructor(e,t,i){this.provider=e,this.tokens=t,this.error=i}}function rxe(s,e){return s.has(e)}function vdt(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:[]}async function oxe(s,e,t,i,n){const r=vdt(s,e),o=await Promise.all(r.map(async a=>{let l,d=null;try{l=await a.provideDocumentSemanticTokens(e,a===t?i:null,n)}catch(h){d=h,l=null}return(!l||!zV(l)&&!sxe(l))&&(l=null),new _dt(a,l,d)}));for(const a of o){if(a.error)throw a.error;if(a.tokens)return a}return o.length>0?o[0]:null}function bdt(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:null}class Cdt{constructor(e,t){this.provider=e,this.tokens=t}}function ydt(s,e){return s.has(e)}function axe(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:[]}async function One(s,e,t,i){const n=axe(s,e),r=await Promise.all(n.map(async o=>{let a;try{a=await o.provideDocumentRangeSemanticTokens(e,t,i)}catch(l){is(l),a=null}return(!a||!zV(a))&&(a=null),new Cdt(o,a)}));for(const o of r)if(o.tokens)return o;return r.length>0?r[0]:null}hi.registerCommand("_provideDocumentSemanticTokensLegend",async(s,...e)=>{const[t]=e;Ci(t instanceof gt);const i=s.get(pn).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=s.get(it),r=bdt(n,i);return r?r[0].getLegend():s.get(on).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)});hi.registerCommand("_provideDocumentSemanticTokens",async(s,...e)=>{const[t]=e;Ci(t instanceof gt);const i=s.get(pn).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=s.get(it);if(!rxe(n,i))return s.get(on).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());const r=await oxe(n,i,null,null,$t.None);if(!r)return;const{provider:o,tokens:a}=r;if(!a||!zV(a))return;const l=nxe({id:0,type:"full",data:a.data});return a.resultId&&o.releaseDocumentSemanticTokens(a.resultId),l});hi.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(s,...e)=>{const[t,i]=e;Ci(t instanceof gt);const n=s.get(pn).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:r}=s.get(it),o=axe(r,n);if(o.length===0)return;if(o.length===1)return o[0].getLegend();if(!i||!W.isIRange(i))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),o[0].getLegend();const a=await One(r,n,W.lift(i),$t.None);if(a)return a.provider.getLegend()});hi.registerCommand("_provideDocumentRangeSemanticTokens",async(s,...e)=>{const[t,i]=e;Ci(t instanceof gt),Ci(W.isIRange(i));const n=s.get(pn).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:r}=s.get(it),o=await One(r,n,W.lift(i),$t.None);if(!(!o||!o.tokens))return nxe({id:0,type:"full",data:o.tokens.data})});const Ane="editor.semanticHighlighting";function DF(s,e,t){var n;const i=(n=t.getValue(Ane,{overrideIdentifier:s.getLanguageId(),resource:s.uri}))==null?void 0:n.enabled;return typeof i=="boolean"?i:e.getColorTheme().semanticHighlighting}var lxe=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Rh=function(s,e){return function(t,i){e(t,i,s)}},Bp;let hQ=class extends re{constructor(e,t,i,n,r,o){super(),this._watchers=Object.create(null);const a=h=>{this._watchers[h.uri.toString()]=new fQ(h,e,i,r,o)},l=(h,f)=>{f.dispose(),delete this._watchers[h.uri.toString()]},d=()=>{for(const h of t.getModels()){const f=this._watchers[h.uri.toString()];DF(h,i,n)?f||a(h):f&&l(h,f)}};t.getModels().forEach(h=>{DF(h,i,n)&&a(h)}),this._register(t.onModelAdded(h=>{DF(h,i,n)&&a(h)})),this._register(t.onModelRemoved(h=>{const f=this._watchers[h.uri.toString()];f&&l(h,f)})),this._register(n.onDidChangeConfiguration(h=>{h.affectsConfiguration(Ane)&&d()})),this._register(i.onDidColorThemeChange(d))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};hQ=lxe([Rh(0,AH),Rh(1,pn),Rh(2,zs),Rh(3,Gt),Rh(4,sc),Rh(5,it)],hQ);var Km;let fQ=(Km=class extends re{constructor(e,t,i,n,r){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=r.documentSemanticTokensProvider,this._debounceInformation=n.for(this._provider,"DocumentSemanticTokens",{min:Bp.REQUEST_MIN_DELAY,max:Bp.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new ji(()=>this._fetchDocumentSemanticTokensNow(),Bp.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 o=()=>{Xi(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)}))};o(),this._register(this._provider.onDidChange(()=>{o(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(i.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),Xi(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!rxe(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new An,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,n=oxe(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const r=[],o=this._model.onDidChangeContent(l=>{r.push(l)}),a=new cr(!1);n.then(l=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,o.dispose(),!l)this._setDocumentSemanticTokens(null,null,null,r);else{const{provider:d,tokens:h}=l,f=this._semanticTokensStylingService.getStyling(d);this._setDocumentSemanticTokens(d,h||null,f,r)}},l=>{l&&(zc(l)||typeof l.message=="string"&&l.message.indexOf("busy")!==-1)||Tt(l),this._currentDocumentRequestCancellationTokenSource=null,o.dispose(),(r.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,i,n,r){r=Math.min(r,i.length-n,e.length-t);for(let o=0;o<r;o++)i[n+o]=e[t+o]}_setDocumentSemanticTokens(e,t,i,n){const r=this._currentDocumentResponse,o=()=>{(n.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||!i){this._model.tokenization.setSemanticTokens(null,!1);return}if(!t){this._model.tokenization.setSemanticTokens(null,!0),o();return}if(sxe(t)){if(!r){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:r.data};else{let a=0;for(const p of t.edits)a+=(p.data?p.data.length:0)-p.deleteCount;const l=r.data,d=new Uint32Array(l.length+a);let h=l.length,f=d.length;for(let p=t.edits.length-1;p>=0;p--){const m=t.edits[p];if(m.start>l.length){i.warnInvalidEditStart(r.resultId,t.resultId,p,m.start,l.length),this._model.tokenization.setSemanticTokens(null,!0);return}const v=h-(m.start+m.deleteCount);v>0&&(Bp._copy(l,h-v,d,f-v,v),f-=v),m.data&&(Bp._copy(m.data,0,d,f-m.data.length,m.data.length),f-=m.data.length),h=m.start}h>0&&Bp._copy(l,0,d,0,h),t={resultId:t.resultId,data:d}}}if(zV(t)){this._currentDocumentResponse=new wdt(e,t.resultId,t.data);const a=nCe(t,i,this._model.getLanguageId());if(n.length>0)for(const l of n)for(const d of a)for(const h of l.changes)d.applyEdit(h.range,h.text);this._model.tokenization.setSemanticTokens(a,!0)}else this._model.tokenization.setSemanticTokens(null,!0);o()}},Bp=Km,Km.REQUEST_MIN_DELAY=300,Km.REQUEST_MAX_DELAY=2e3,Km);fQ=Bp=lxe([Rh(1,AH),Rh(2,zs),Rh(3,sc),Rh(4,it)],fQ);class wdt{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}$x(hQ);var Sdt=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},wD=function(s,e){return function(t,i){e(t,i,s)}},CS;let q3=(CS=class extends re{constructor(e,t,i,n,r,o){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=n,this._editor=e,this._provider=o.documentRangeSemanticTokensProvider,this._debounceInformation=r.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new ji(()=>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(Ane)&&(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,i=this._outstandingRequests.length;t<i;t++)if(this._outstandingRequests[t]===e){this._outstandingRequests.splice(t,1);return}}_tokenizeViewportNow(){if(!this._editor.hasModel())return;const e=this._editor.getModel();if(e.tokenization.hasCompleteSemanticTokens())return;if(!DF(e,this._themeService,this._configurationService)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}if(!ydt(this._provider,e)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}const t=this._editor.getVisibleRangesPlusViewportAboveBelow();this._outstandingRequests=this._outstandingRequests.concat(t.map(i=>this._requestRange(e,i)))}_requestRange(e,t){const i=e.getVersionId(),n=Zs(o=>Promise.resolve(One(this._provider,e,t,o))),r=new cr(!1);return n.then(o=>{if(this._debounceInformation.update(e,r.elapsed()),!o||!o.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:a,tokens:l}=o,d=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,nCe(l,d,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(n),()=>this._removeOutstandingRequest(n)),n}},CS.ID="editor.contrib.viewportSemanticTokens",CS);q3=Sdt([wD(1,AH),wD(2,zs),wD(3,Gt),wD(4,sc),wD(5,it)],q3);gi(q3.ID,q3,1);class xdt{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const n of t){const r=[];i.push(r),this.selectSubwords&&this._addInWordRanges(r,e,n),this._addWordRanges(r,e,n),this._addWhitespaceLine(r,e,n),r.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const n=t.getWordAtPosition(i);if(!n)return;const{word:r,startColumn:o}=n,a=i.column-o;let l=a,d=a,h=0;for(;l>=0;l--){const f=r.charCodeAt(l);if(l!==a&&(f===95||f===45))break;if(om(f)&&Ih(h))break;h=f}for(l+=1;d<r.length;d++){const f=r.charCodeAt(d);if(Ih(f)&&om(h))break;if(f===95||f===45)break;h=f}l<d&&e.push({range:new W(i.lineNumber,o+l,i.lineNumber,o+d)})}_addWordRanges(e,t,i){const n=t.getWordAtPosition(i);n&&e.push({range:new W(i.lineNumber,n.startColumn,i.lineNumber,n.endColumn)})}_addWhitespaceLine(e,t,i){t.getLineLength(i.lineNumber)>0&&t.getLineFirstNonWhitespaceColumn(i.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(i.lineNumber)===0&&e.push({range:new W(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var kdt=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Ldt=function(s,e){return function(t,i){e(t,i,s)}},gQ;class Fne{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 i=new Fne(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}var RC;let WT=(RC=class{static get(e){return e.getContribution(gQ.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){var e;(e=this._selectionListener)==null||e.dispose()}async run(e){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(this._state||await dxe(this._languageFeaturesService.selectionRangeProvider,i,t.map(r=>r.getPosition()),this._editor.getOption(114),$t.None).then(r=>{var o;if(!(!So(r)||r.length!==t.length)&&!(!this._editor.hasModel()||!Tn(this._editor.getSelections(),t,(a,l)=>a.equalsSelection(l)))){for(let a=0;a<r.length;a++)r[a]=r[a].filter(l=>l.containsPosition(t[a].getStartPosition())&&l.containsPosition(t[a].getEndPosition())),r[a].unshift(t[a]);this._state=r.map(a=>new Fne(0,a)),(o=this._selectionListener)==null||o.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{var a;this._ignoreSelection||((a=this._selectionListener)==null||a.dispose(),this._state=void 0)})}}),!this._state)return;this._state=this._state.map(r=>r.mov(e));const n=this._state.map(r=>ot.fromPositions(r.ranges[r.index].getStartPosition(),r.ranges[r.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(n)}finally{this._ignoreSelection=!1}}},gQ=RC,RC.ID="editor.contrib.smartSelectController",RC);WT=gQ=kdt([Ldt(1,it)],WT);class cxe extends Ze{constructor(e,t){super(t),this._forward=e}async run(e,t){const i=WT.get(t);i&&await i.run(this._forward)}}class Ddt extends cxe{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:w("smartSelect.expand","Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:st.MenubarSelectionMenu,group:"1_basic",title:w({key:"miSmartSelectGrow",comment:["&& denotes a mnemonic"]},"&&Expand Selection"),order:2}})}}hi.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class Edt extends cxe{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:w("smartSelect.shrink","Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:st.MenubarSelectionMenu,group:"1_basic",title:w({key:"miSmartSelectShrink",comment:["&& denotes a mnemonic"]},"&&Shrink Selection"),order:3}})}}gi(WT.ID,WT,4);Pe(Ddt);Pe(Edt);async function dxe(s,e,t,i,n){const r=s.all(e).concat(new xdt(i.selectSubwords));r.length===1&&r.unshift(new T3);const o=[],a=[];for(const l of r)o.push(Promise.resolve(l.provideSelectionRanges(e,t,n)).then(d=>{if(So(d)&&d.length===t.length)for(let h=0;h<t.length;h++){a[h]||(a[h]=[]);for(const f of d[h])W.isIRange(f.range)&&W.containsPosition(f.range,t[h])&&a[h].push(W.lift(f.range))}},is));return await Promise.all(o),a.map(l=>{if(l.length===0)return[];l.sort((p,m)=>ie.isBefore(p.getStartPosition(),m.getStartPosition())?1:ie.isBefore(m.getStartPosition(),p.getStartPosition())||ie.isBefore(p.getEndPosition(),m.getEndPosition())?-1:ie.isBefore(m.getEndPosition(),p.getEndPosition())?1:0);const d=[];let h;for(const p of l)(!h||W.containsRange(p,h)&&!W.equalsRange(p,h))&&(d.push(p),h=p);if(!i.selectLeadingAndTrailingWhitespace)return d;const f=[d[0]];for(let p=1;p<d.length;p++){const m=d[p-1],v=d[p];if(v.startLineNumber!==m.startLineNumber||v.endLineNumber!==m.endLineNumber){const b=new W(m.startLineNumber,e.getLineFirstNonWhitespaceColumn(m.startLineNumber),m.endLineNumber,e.getLineLastNonWhitespaceColumn(m.endLineNumber));b.containsRange(m)&&!b.equalsRange(m)&&v.containsRange(b)&&!v.equalsRange(b)&&f.push(b);const y=new W(m.startLineNumber,1,m.endLineNumber,e.getLineMaxColumn(m.endLineNumber));y.containsRange(m)&&!y.equalsRange(b)&&v.containsRange(y)&&!v.equalsRange(y)&&f.push(y)}f.push(v)}return f})}hi.registerCommand("_executeSelectionRangeProvider",async function(s,...e){const[t,i]=e;Ci(gt.isUri(t));const n=s.get(it).selectionRangeProvider,r=await s.get(Ea).createModelReference(t);try{return dxe(n,r.object.textEditorModel,i,{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},$t.None)}finally{r.dispose()}});const Idt=Object.freeze({View:kt("view","View"),Help:kt("help","Help"),Test:kt("test","Test"),File:kt("file","File"),Preferences:kt("preferences","Preferences"),Developer:kt({key:"developer",comment:["A developer on Code itself or someone diagnosing issues in Code"]},"Developer")});class OE{constructor(e,t,i,n=null){this.startLineNumbers=e,this.endLineNumbers=t,this.lastLineRelativePosition=i,this.showEndForLine=n}equals(e){return!!e&&this.lastLineRelativePosition===e.lastLineRelativePosition&&this.showEndForLine===e.showEndForLine&&Tn(this.startLineNumbers,e.startLineNumbers)&&Tn(this.endLineNumbers,e.endLineNumbers)}static get Empty(){return new OE([],[],0)}}const npe=Ug("stickyScrollViewLayer",{createHTML:s=>s}),Dj="data-sticky-line-index",spe="data-sticky-is-line",Tdt="data-sticky-is-line-number",rpe="data-sticky-is-folding-icon";class Ndt extends re{constructor(e){super(),this._editor=e,this._foldingIconStore=new me,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 Pd),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(116).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(116)&&t(),i.hasChanged(67)&&(this._lineHeight=this._editor.getOption(67))})),this._register(this._editor.onDidScrollChange(i=>{i.scrollLeftChanged&&t(),i.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{t(),this._updateWidgetWidth()})),this._register(this._foldingIconStore),t(),this._register(this._editor.onDidLayoutChange(i=>{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,i){if(i===void 0&&(!this._previousState&&!e||this._previousState&&this._previousState.equals(e)))return;const n=this._isWidgetHeightZero(e),r=n?void 0:e,o=n?0:this._findLineToRebuildWidgetFrom(e,i);this._renderRootNode(r,t,o),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 i=[...e.startLineNumbers];e.showEndForLine!==null&&(i[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=i}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 i=this._previousState,n=e.startLineNumbers.findIndex(r=>!i.startLineNumbers.includes(r));return n===-1?0:n}_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;t<this._renderedStickyLines.length;t++){const i=this._renderedStickyLines[t];i.lineNumberDomNode.remove(),i.lineDomNode.remove()}this._renderedStickyLines=this._renderedStickyLines.slice(0,e),this._rootDomNode.style.display="none"}_useFoldingOpacityTransition(e){this._lineNumbersDomNode.style.setProperty("--vscode-editorStickyScroll-foldingOpacityTransition",`opacity ${e?.5:0}s`)}_setFoldingIconsVisibility(e){for(const t of this._renderedStickyLines){const i=t.foldingIcon;i&&i.setVisible(e?!0:i.isCollapsed)}}async _renderRootNode(e,t,i){if(this._clearStickyLinesFromLine(i),!e)return;for(const a of this._renderedStickyLines)this._updateTopAndZIndexOfStickyLine(a);const n=this._editor.getLayoutInfo(),r=this._lineNumbers.slice(i);for(const[a,l]of r.entries()){const d=this._renderChildNode(a+i,l,t,n);d&&(this._linesDomNode.appendChild(d.lineDomNode),this._lineNumbersDomNode.appendChild(d.lineNumberDomNode),this._renderedStickyLines.push(d))}t&&(this._setFoldingHoverListeners(),this._useFoldingOpacityTransition(!this._isOnGlyphMargin));const o=this._lineNumbers.length*this._lineHeight+this._lastLineRelativePosition;this._rootDomNode.style.display="block",this._lineNumbersDomNode.style.height=`${o}px`,this._linesDomNodeScrollable.style.height=`${o}px`,this._rootDomNode.style.height=`${o}px`,this._rootDomNode.style.marginLeft="0px",this._minContentWidthInPx=Math.max(...this._renderedStickyLines.map(a=>a.scrollWidth))+n.verticalScrollbarWidth,this._editor.layoutOverlayWidget(this)}_setFoldingHoverListeners(){this._editor.getOption(111)==="mouseover"&&(this._foldingIconStore.add(ue(this._lineNumbersDomNode,Ae.MOUSE_ENTER,()=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(ue(this._lineNumbersDomNode,Ae.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,i,n){const r=this._editor._getViewModel();if(!r)return;const o=r.coordinatesConverter.convertModelPositionToViewPosition(new ie(t,1)).lineNumber,a=r.getViewLineRenderingData(o),l=this._editor.getOption(68);let d;try{d=zo.filter(a.inlineDecorations,o,a.minColumn,a.maxColumn)}catch{d=[]}const h=new T_(!0,!0,a.content,a.continuesWithWrappedLine,a.isBasicASCII,a.containsRTL,0,a.tokens,d,a.tabSize,a.startVisibleColumn,1,1,1,500,"none",!0,!0,null),f=new Ix(2e3),p=MN(h,f);let m;npe?m=npe.createHTML(f.build()):m=f.build();const v=document.createElement("span");v.setAttribute(Dj,String(e)),v.setAttribute(spe,""),v.setAttribute("role","listitem"),v.tabIndex=0,v.className="sticky-line-content",v.classList.add(`stickyLine${t}`),v.style.lineHeight=`${this._lineHeight}px`,v.innerHTML=m;const b=document.createElement("span");b.setAttribute(Dj,String(e)),b.setAttribute(Tdt,""),b.className="sticky-line-number",b.style.lineHeight=`${this._lineHeight}px`;const y=n.contentLeft;b.style.width=`${y}px`;const x=document.createElement("span");l.renderType===1||l.renderType===3&&t%10===0?x.innerText=t.toString():l.renderType===2&&(x.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),x.className="sticky-line-number-inner",x.style.lineHeight=`${this._lineHeight}px`,x.style.width=`${n.lineNumbersWidth}px`,x.style.paddingLeft=`${n.lineNumbersLeft}px`,b.appendChild(x);const D=this._renderFoldingIconForLine(i,t);D&&b.appendChild(D.domNode),this._editor.applyFontInfo(v),this._editor.applyFontInfo(x),b.style.lineHeight=`${this._lineHeight}px`,v.style.lineHeight=`${this._lineHeight}px`,b.style.height=`${this._lineHeight}px`,v.style.height=`${this._lineHeight}px`;const S=new Mdt(e,t,v,b,D,p.characterMapping,v.scrollWidth);return this._updateTopAndZIndexOfStickyLine(S)}_updateTopAndZIndexOfStickyLine(e){var h;const t=e.index,i=e.lineDomNode,n=e.lineNumberDomNode,r=t===this._lineNumbers.length-1,o="0",a="1";i.style.zIndex=r?o:a,n.style.zIndex=r?o:a;const l=`${t*this._lineHeight+this._lastLineRelativePosition+((h=e.foldingIcon)!=null&&h.isCollapsed?1:0)}px`,d=`${t*this._lineHeight}px`;return i.style.top=r?l:d,n.style.top=r?l:d,e}_renderFoldingIconForLine(e,t){const i=this._editor.getOption(111);if(!e||i==="never")return;const n=e.regions,r=n.findRange(t),o=n.getStartLineNumber(r);if(!(t===o))return;const l=n.isCollapsed(r),d=new Rdt(l,o,n.getEndLineNumber(r),this._lineHeight);return d.setVisible(this._isOnGlyphMargin?!0:l||i==="always"),d.domNode.setAttribute(rpe,""),d}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:2,stackOridinal:10}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e<this._renderedStickyLines.length&&this._renderedStickyLines[e].lineDomNode.focus()}getEditorPositionFromNode(e){if(!e||e.children.length>0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const i=uie(t.characterMapping,e,0);return new ie(t.lineNumber,i)}getLineNumberFromChildDomNode(e){var t;return((t=this._getRenderedStickyLineFromChildDomNode(e))==null?void 0:t.lineNumber)??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,Dj);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,spe)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,rpe)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const i=e.getAttribute(t);if(i!==null)return i;e=e.parentElement}}}class Mdt{constructor(e,t,i,n,r,o,a){this.index=e,this.lineNumber=t,this.lineDomNode=i,this.lineNumberDomNode=n,this.foldingIcon=r,this.characterMapping=o,this.scrollWidth=a}}class Rdt{constructor(e,t,i,n){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=i,this.dimension=n,this.domNode=document.createElement("div"),this.domNode.style.width=`${n}px`,this.domNode.style.height=`${n}px`,this.domNode.className=bt.asClassName(e?b3:v3)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class AE{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class K3{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}}class uxe{constructor(e,t,i,n){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=n}}var jV=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},HT=function(s,e){return function(t,i){e(t,i,s)}},FE;(function(s){s.OUTLINE_MODEL="outlineModel",s.FOLDING_PROVIDER_MODEL="foldingProviderModel",s.INDENTATION_MODEL="indentationModel"})(FE||(FE={}));var vm;(function(s){s[s.VALID=0]="VALID",s[s.INVALID=1]="INVALID",s[s.CANCELED=2]="CANCELED"})(vm||(vm={}));let pQ=class extends re{constructor(e,t,i,n){switch(super(),this._editor=e,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new Ac(300)),this._updateOperation=this._register(new me),this._editor.getOption(116).defaultModel){case FE.OUTLINE_MODEL:this._modelProviders.push(new mQ(this._editor,n));case FE.FOLDING_PROVIDER_MODEL:this._modelProviders.push(new vQ(this._editor,t,n));case FE.INDENTATION_MODEL:this._modelProviders.push(new _Q(this._editor,i));break}}dispose(){this._modelProviders.forEach(e=>e.dispose()),this._updateOperation.clear(),this._cancelModelPromise(),super.dispose()}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}async update(e){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),await this._updateScheduler.trigger(async()=>{for(const t of this._modelProviders){const{statusPromise:i,modelPromise:n}=t.computeStickyModel(e);this._modelPromise=n;const r=await i;if(this._modelPromise!==n)return null;switch(r){case vm.CANCELED:return this._updateOperation.clear(),null;case vm.VALID:return t.stickyModel}}return null}).catch(t=>(Tt(t),null))}};pQ=jV([HT(2,ut),HT(3,it)],pQ);class hxe extends re{constructor(e){super(),this._editor=e,this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,vm.INVALID}computeStickyModel(e){if(e.isCancellationRequested||!this.isProviderValid())return{statusPromise:this._invalid(),modelPromise:null};const t=Zs(i=>this.createModelFromProvider(i));return{statusPromise:t.then(i=>this.isModelValid(i)?e.isCancellationRequested?vm.CANCELED:(this._stickyModel=this.createStickyModel(e,i),vm.VALID):this._invalid()).then(void 0,i=>(Tt(i),vm.CANCELED)),modelPromise:t}}isModelValid(e){return!0}isProviderValid(){return!0}}let mQ=class extends hxe{constructor(e,t){super(e),this._languageFeaturesService=t}createModelFromProvider(e){return Qf.create(this._languageFeaturesService.documentSymbolProvider,this._editor.getModel(),e)}createStickyModel(e,t){var o;const{stickyOutlineElement:i,providerID:n}=this._stickyModelFromOutlineModel(t,(o=this._stickyModel)==null?void 0:o.outlineProviderId),r=this._editor.getModel();return new uxe(r.uri,r.getVersionId(),i,n)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(ui.first(e.children.values())instanceof RSe){const a=ui.find(e.children.values(),l=>l.id===t);if(a)i=a.children;else{let l="",d=-1,h;for(const[f,p]of e.children.entries()){const m=this._findSumOfRangesOfGroup(p);m>d&&(h=p,d=m,l=p.id)}t=l,i=h.children}}else i=e.children;const n=[],r=Array.from(i.values()).sort((a,l)=>{const d=new AE(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),h=new AE(l.symbol.range.startLineNumber,l.symbol.range.endLineNumber);return this._comparator(d,h)});for(const a of r)n.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new K3(void 0,n,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const i=[];for(const r of e.children.values())if(r.symbol.selectionRange.startLineNumber!==r.symbol.range.endLineNumber)if(r.symbol.selectionRange.startLineNumber!==t)i.push(this._stickyModelFromOutlineElement(r,r.symbol.selectionRange.startLineNumber));else for(const o of r.children.values())i.push(this._stickyModelFromOutlineElement(o,r.symbol.selectionRange.startLineNumber));i.sort((r,o)=>this._comparator(r.range,o.range));const n=new AE(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new K3(n,i,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 i of e.children.values())t+=this._findSumOfRangesOfGroup(i);return e instanceof rX?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};mQ=jV([HT(1,it)],mQ);class fxe extends hxe{constructor(e){super(e),this._foldingLimitReporter=new TSe(e)}createStickyModel(e,t){const i=this._fromFoldingRegions(t),n=this._editor.getModel();return new uxe(n.uri,n.getVersionId(),i,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,i=[],n=new K3(void 0,[],void 0);for(let r=0;r<t;r++){const o=e.getParentIndex(r);let a;o!==-1?a=i[o]:a=n;const l=new K3(new AE(e.getStartLineNumber(r),e.getEndLineNumber(r)+1),[],a);a.children.push(l),i.push(l)}return n}}let _Q=class extends fxe{constructor(e,t){super(e),this._languageConfigurationService=t,this.provider=this._register(new wne(e.getModel(),this._languageConfigurationService,this._foldingLimitReporter))}async createModelFromProvider(e){return this.provider.compute(e)}};_Q=jV([HT(1,Bn)],_Q);let vQ=class extends fxe{constructor(e,t,i){super(e),this._languageFeaturesService=i;const n=v_.getFoldingRangeProviders(this._languageFeaturesService,e.getModel());n.length>0&&(this.provider=this._register(new Sne(e.getModel(),n,t,this._foldingLimitReporter,void 0)))}isProviderValid(){return this.provider!==void 0}async createModelFromProvider(e){var t;return((t=this.provider)==null?void 0:t.compute(e))??null}};vQ=jV([HT(2,it)],vQ);var Pdt=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},ope=function(s,e){return function(t,i){e(t,i,s)}};class Odt{constructor(e,t,i){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=i}}let bQ=class extends re{constructor(e,t,i){super(),this._languageFeaturesService=t,this._languageConfigurationService=i,this._onDidChangeStickyScroll=this._register(new se),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new me),this._updateSoon=this._register(new ji(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(116)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._sessionStore.clear(),this._editor.getOption(116).enabled&&(this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,this.updateStickyModelProvider(),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._sessionStore.add(dt(()=>{var t;(t=this._stickyModelProvider)==null||t.dispose(),this._stickyModelProvider=null})),this.updateStickyModelProvider(),this.update())}getVersionId(){var e;return(e=this._model)==null?void 0:e.version}updateStickyModelProvider(){var t;(t=this._stickyModelProvider)==null||t.dispose(),this._stickyModelProvider=null;const e=this._editor;e.hasModel()&&(this._stickyModelProvider=new pQ(e,()=>this._updateSoon.schedule(),this._languageConfigurationService,this._languageFeaturesService))}async update(){var e;(e=this._cts)==null||e.dispose(!0),this._cts=new An,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=await this._stickyModelProvider.update(e);e.isCancellationRequested||(this._model=t)}updateIndex(e){return e===-1?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,t,i,n,r){if(t.children.length===0)return;let o=r;const a=[];for(let h=0;h<t.children.length;h++){const f=t.children[h];f.range&&a.push(f.range.startLineNumber)}const l=this.updateIndex(hI(a,e.startLineNumber,(h,f)=>h-f)),d=this.updateIndex(hI(a,e.startLineNumber+n,(h,f)=>h-f));for(let h=l;h<=d;h++){const f=t.children[h];if(!f)return;if(f.range){const p=f.range.startLineNumber,m=f.range.endLineNumber;e.startLineNumber<=m+1&&p-1<=e.endLineNumber&&p!==o&&(o=p,i.push(new Odt(p,m-1,n+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,f,i,n+1,p))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,f,i,n,r)}}getCandidateStickyLinesIntersecting(e){var n,r;if(!((n=this._model)!=null&&n.element))return[];let t=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,t,0,-1);const i=(r=this._editor._getViewModel())==null?void 0:r.getHiddenAreas();if(i)for(const o of i)t=t.filter(a=>!(a.startLineNumber>=o.startLineNumber&&a.endLineNumber<=o.endLineNumber+1));return t}};bQ=Pdt([ope(1,it),ope(2,Bn)],bQ);var Adt=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},F1=function(s,e){return function(t,i){e(t,i,s)}},CQ,PC;let $g=(PC=class extends re{constructor(e,t,i,n,r,o,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=i,this._instaService=n,this._contextKeyService=a,this._sessionStore=new me,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._stickyScrollWidget=new Ndt(this._editor),this._stickyLineCandidateProvider=new bQ(this._editor,i,r),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=OE.Empty,this._onDidResize(),this._readConfiguration();const l=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration(h=>{this._readConfigurationChange(h)})),this._register(ue(l,Ae.CONTEXT_MENU,async h=>{this._onContextMenu(mt(l),h)})),this._stickyScrollFocusedContextKey=U.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=U.stickyScrollVisible.bindTo(this._contextKeyService);const d=this._register(Pu(l));this._register(d.onDidBlur(h=>{this._positionRevealed===!1&&l.clientHeight===0?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()})),this._register(d.onDidFocus(h=>{this.focus()})),this._registerMouseListeners(),this._register(ue(l,Ae.MOUSE_DOWN,h=>{this._onMouseDown=!0}))}static get(e){return e.getContribution(CQ.ID)}_disposeFocusStickyScrollStore(){var e;this._stickyScrollFocusedContextKey.set(!1),(e=this._focusDisposableStore)==null||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 me,this._stickyScrollFocusedContextKey.set(!0),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumbers.length-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}focusNext(){this._focusedStickyElementIndex<this._stickyScrollWidget.lineNumberCount-1&&this._focusNav(!0)}focusPrevious(){this._focusedStickyElementIndex>0&&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(W.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new me),t=this._register(new RV(this._editor,{extractLineNumberFromMouseEvent:r=>{const o=this._stickyScrollWidget.getEditorPositionFromNode(r.target.element);return o?o.lineNumber:0}})),i=r=>{if(!this._editor.hasModel()||r.target.type!==12||r.target.detail!==this._stickyScrollWidget.getId())return null;const o=r.target.element;if(!o||o.innerText!==o.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(o);return a?{range:new W(a.lineNumber,a.column,a.lineNumber,a.column+o.innerText.length),textElement:o}:null},n=this._stickyScrollWidget.getDomNode();this._register(Hn(n,Ae.CLICK,r=>{if(r.ctrlKey||r.altKey||r.metaKey||!r.leftButton)return;if(r.shiftKey){const d=this._stickyScrollWidget.getLineIndexFromChildDomNode(r.target);if(d===null)return;const h=new ie(this._endLineNumbers[d],1);this._revealLineInCenterIfOutsideViewport(h);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(r.target)){const d=this._stickyScrollWidget.getLineNumberFromChildDomNode(r.target);this._toggleFoldingRegionForLine(d);return}if(!this._stickyScrollWidget.isInStickyLine(r.target))return;let l=this._stickyScrollWidget.getEditorPositionFromNode(r.target);if(!l){const d=this._stickyScrollWidget.getLineNumberFromChildDomNode(r.target);if(d===null)return;l=new ie(d,1)}this._revealPosition(l)})),this._register(Hn(n,Ae.MOUSE_MOVE,r=>{if(r.shiftKey){const o=this._stickyScrollWidget.getLineIndexFromChildDomNode(r.target);if(o===null||this._showEndForLine!==null&&this._showEndForLine===o)return;this._showEndForLine=o,this._renderStickyScroll();return}this._showEndForLine!==void 0&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(ue(n,Ae.MOUSE_LEAVE,r=>{this._showEndForLine!==void 0&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([r,o])=>{const a=i(r);if(!a||!r.hasTriggerModifier||!this._editor.hasModel()){e.clear();return}const{range:l,textElement:d}=a;if(!l.equalsRange(this._stickyRangeProjectedOnEditor))this._stickyRangeProjectedOnEditor=l,e.clear();else if(d.style.textDecoration==="underline")return;const h=new An;e.add(dt(()=>h.dispose(!0)));let f;$N(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new ie(l.startLineNumber,l.startColumn+1),!1,h.token).then(p=>{if(!h.token.isCancellationRequested)if(p.length!==0){this._candidateDefinitionsLength=p.length;const m=d;f!==m?(e.clear(),f=m,f.style.textDecoration="underline",e.add(dt(()=>{f.style.textDecoration="none"}))):f||(f=m,f.style.textDecoration="underline",e.add(dt(()=>{f.style.textDecoration="none"})))}else e.clear()})})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(async r=>{if(r.target.type!==12||r.target.detail!==this._stickyScrollWidget.getId())return;const o=this._stickyScrollWidget.getEditorPositionFromNode(r.target.element);o&&(!this._editor.hasModel()||!this._stickyRangeProjectedOnEditor||(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:o.lineNumber,column:1})),this._instaService.invokeFunction(fSe,r,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor})))}))}_onContextMenu(e,t){const i=new Cd(e,t);this._contextMenuService.showContextMenu({menuId:st.StickyScrollContext,getAnchor:()=>i})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getRenderedStickyLine(e),i=t==null?void 0:t.foldingIcon;if(!i)return;bne(this._foldingModel,Number.MAX_VALUE,[e]),i.isCollapsed=!i.isCollapsed;const n=(i.isCollapsed?this._editor.getTopForLineNumber(i.foldingEndLine):this._editor.getTopForLineNumber(i.foldingStartLine))-this._editor.getOption(67)*t.index+1;this._editor.setScrollTop(n),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(116);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(i=>{i.scrollTopChanged&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._sessionStore.add(this._editor.onDidLayoutChange(()=>this._onDidResize())),this._sessionStore.add(this._editor.onDidChangeModelTokens(i=>this._onTokensChange(i))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(()=>{this._showEndForLine=void 0,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(68).renderType===2&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=void 0,this._renderStickyScroll(0)}))}_readConfigurationChange(e){(e.hasChanged(116)||e.hasChanged(73)||e.hasChanged(67)||e.hasChanged(111)||e.hasChanged(68))&&this._readConfiguration(),e.hasChanged(68)&&this._renderStickyScroll(0)}_needsUpdate(e){const t=this._stickyScrollWidget.getCurrentLines();for(const i of t)for(const n of e.ranges)if(i>=n.fromLineNumber&&i<=n.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){const t=this._editor.getModel();if(!t||t.isTooLargeForTokenization()){this._resetState();return}const i=this._updateAndGetMinRebuildFromLine(e),n=this._stickyLineCandidateProvider.getVersionId();if(n===void 0||n===t.getVersionId())if(!this._focused)await this._updateState(i);else if(this._focusedStickyElementIndex===-1)await this._updateState(i),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const o=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];await this._updateState(i),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(o)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}}_updateAndGetMinRebuildFromLine(e){if(e!==void 0){const t=this._minRebuildFromLine!==void 0?this._minRebuildFromLine:1/0;this._minRebuildFromLine=Math.min(e,t)}return this._minRebuildFromLine}async _updateState(e){var i;this._minRebuildFromLine=void 0,this._foldingModel=await((i=v_.get(this._editor))==null?void 0:i.getFoldingModel())??void 0,this._widgetState=this.findScrollWidgetState();const t=this._widgetState.startLineNumbers.length>0;this._stickyScrollVisibleContextKey.set(t),this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e)}async _resetState(){this._minRebuildFromLine=void 0,this._foldingModel=void 0,this._widgetState=OE.Empty,this._stickyScrollVisibleContextKey.set(!1),this._stickyScrollWidget.setState(void 0,void 0)}findScrollWidgetState(){const e=this._editor.getOption(67),t=Math.min(this._maxStickyLines,this._editor.getOption(116).maxLineCount),i=this._editor.getScrollTop();let n=0;const r=[],o=[],a=this._editor.getVisibleRanges();if(a.length!==0){const l=new AE(a[0].startLineNumber,a[a.length-1].endLineNumber),d=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(l);for(const h of d){const f=h.startLineNumber,p=h.endLineNumber,m=h.nestingDepth;if(p-f>0){const v=(m-1)*e,b=m*e,y=this._editor.getBottomForLineNumber(f)-i,x=this._editor.getTopForLineNumber(p)-i,D=this._editor.getBottomForLineNumber(p)-i;if(v>x&&v<=D){r.push(f),o.push(p+1),n=D-b;break}else b>y&&b<=D&&(r.push(f),o.push(p+1));if(r.length===t)break}}}return this._endLineNumbers=o,new OE(r,o,n,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}},CQ=PC,PC.ID="store.contrib.stickyScrollController",PC);$g=CQ=Adt([F1(1,gl),F1(2,it),F1(3,ut),F1(4,Bn),F1(5,sc),F1(6,yt)],$g);class Fdt extends ea{constructor(){super({id:"editor.action.toggleStickyScroll",title:{...kt("toggleEditorStickyScroll","Toggle Editor Sticky Scroll"),mnemonicTitle:w({key:"mitoggleStickyScroll",comment:["&& denotes a mnemonic"]},"&&Toggle Editor Sticky Scroll")},metadata:{description:kt("toggleEditorStickyScroll.description","Toggle/enable the editor sticky scroll which shows the nested scopes at the top of the viewport")},category:Idt.View,toggled:{condition:ve.equals("config.editor.stickyScroll.enabled",!0),title:w("stickyScroll","Sticky Scroll"),mnemonicTitle:w({key:"miStickyScroll",comment:["&& denotes a mnemonic"]},"&&Sticky Scroll")},menu:[{id:st.CommandPalette},{id:st.MenubarAppearanceMenu,group:"4_editor",order:3},{id:st.StickyScrollContext}]})}async run(e){const t=e.get(Gt),i=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",i)}}const UV=100;class Bdt extends ju{constructor(){super({id:"editor.action.focusStickyScroll",title:{...kt("focusStickyScroll","Focus on the editor sticky scroll"),mnemonicTitle:w({key:"mifocusStickyScroll",comment:["&& denotes a mnemonic"]},"&&Focus Sticky Scroll")},precondition:ve.and(ve.has("config.editor.stickyScroll.enabled"),U.stickyScrollVisible),menu:[{id:st.CommandPalette}]})}runEditorCommand(e,t){var i;(i=$g.get(t))==null||i.focus()}}class Wdt extends ju{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:kt("selectNextStickyScrollLine.title","Select the next editor sticky scroll line"),precondition:U.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:UV,primary:18}})}runEditorCommand(e,t){var i;(i=$g.get(t))==null||i.focusNext()}}class Hdt extends ju{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:kt("selectPreviousStickyScrollLine.title","Select the previous sticky scroll line"),precondition:U.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:UV,primary:16}})}runEditorCommand(e,t){var i;(i=$g.get(t))==null||i.focusPrevious()}}class Vdt extends ju{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:kt("goToFocusedStickyScrollLine.title","Go to the focused sticky scroll line"),precondition:U.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:UV,primary:3}})}runEditorCommand(e,t){var i;(i=$g.get(t))==null||i.goToFocused()}}class $dt extends ju{constructor(){super({id:"editor.action.selectEditor",title:kt("selectEditor.title","Select Editor"),precondition:U.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:UV,primary:9}})}runEditorCommand(e,t){var i;(i=$g.get(t))==null||i.selectEditor()}}gi($g.ID,$g,1);sn(Fdt);sn(Bdt);sn(Hdt);sn(Wdt);sn(Vdt);sn($dt);var gxe=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},ZD=function(s,e){return function(t,i){e(t,i,s)}};class zdt{constructor(e,t,i,n,r,o){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=n,this.command=r,this.completion=o}}let yQ=class extends v4e{constructor(e,t,i,n,r,o){super(r.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=n,this._suggestMemoryService=o}canBeReused(e,t,i){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===i.startColumn&&this.word.endColumn<i.endColumn&&this.completionModel.getIncompleteProvider().size===0}get items(){const e=[],{items:t}=this.completionModel,i=this._suggestMemoryService.select(this.model,{lineNumber:this.line,column:this.word.endColumn+this.completionModel.lineContext.characterCountDelta},t),n=ui.slice(t,i),r=ui.slice(t,0,i);let o=5;for(const a of ui.concat(n,r)){if(a.score===Tu.Default)continue;const l=new W(a.editStart.lineNumber,a.editStart.column,a.editInsertEnd.lineNumber,a.editInsertEnd.column+this.completionModel.lineContext.characterCountDelta),d=a.completion.insertTextRules&&a.completion.insertTextRules&4?{snippet:a.completion.insertText}:a.completion.insertText;e.push(new zdt(l,d,a.filterTextLow??a.labelLow,a.completion.additionalTextEdits,a.completion.command,a)),o-->=0&&a.resolve($t.None)}return e}};yQ=gxe([ZD(5,HV)],yQ);let wQ=class extends re{constructor(e,t,i,n){super(),this._languageFeatureService=e,this._clipboardService=t,this._suggestMemoryService=i,this._editorService=n,this._store.add(e.inlineCompletionsProvider.register("*",this))}async provideInlineCompletions(e,t,i,n){var m;if(i.selectedSuggestionInfo)return;let r;for(const v of this._editorService.listCodeEditors())if(v.getModel()===e){r=v;break}if(!r)return;const o=r.getOption(90);if(b0.isAllOff(o))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const a=e.tokenization.getLineTokens(t.lineNumber),l=a.getStandardTokenType(a.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(b0.valueFor(o,l)!=="inline")return;let d=e.getWordAtPosition(t),h;if(d!=null&&d.word||(h=this._getTriggerCharacterInfo(e,t)),!(d!=null&&d.word)&&!h||(d||(d=e.getWordUntilPosition(t)),d.endColumn!==t.column))return;let f;const p=e.getValueInRange(new W(t.lineNumber,1,t.lineNumber,t.column));if(!h&&((m=this._lastResult)!=null&&m.canBeReused(e,t.lineNumber,d))){const v=new Uge(p,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=v,this._lastResult.acquire(),f=this._lastResult}else{const v=await xne(this._languageFeatureService.completionProvider,e,t,new NT(void 0,M3.createSuggestFilter(r).itemKind,h==null?void 0:h.providers),h&&{triggerKind:1,triggerCharacter:h.ch},n);let b;v.needsClipboard&&(b=await this._clipboardService.readText());const y=new em(v.items,t.column,new Uge(p,0),N3.None,r.getOption(119),r.getOption(113),{boostFullMatch:!1,firstMatchCanBeWeak:!1},b);f=new yQ(e,t.lineNumber,d,y,v,this._suggestMemoryService)}return this._lastResult=f,f}handleItemDidShow(e,t){t.completion.resolve($t.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var r;const i=e.getValueInRange(W.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),n=new Set;for(const o of this._languageFeatureService.completionProvider.all(e))(r=o.triggerCharacters)!=null&&r.includes(i)&&n.add(o);if(n.size!==0)return{providers:n,ch:i}}};wQ=gxe([ZD(0,it),ZD(1,Yg),ZD(2,HV),ZD(3,yi)],wQ);$x(wQ);class jdt extends Ze{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 i=t.getModel();i.tokenization.resetTokenization();const n=new cr;i.tokenization.forceTokenization(i.getLineCount()),n.stop(),console.log(`tokenization took ${n.elapsed()}`)}}Pe(jdt);const kW=class kW extends ea{constructor(){super({id:kW.ID,title:kt({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},metadata:{description:kt("tabMovesFocusDescriptions","Determines whether the tab key moves focus around the workbench or inserts the tab character in the current editor. This is also called tab trapping, tab navigation, or tab focus mode.")},f1:!0})}run(){const t=!GS.getTabFocusMode();GS.setTabFocusMode(t),Qo(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"))}};kW.ID="editor.action.toggleTabFocusMode";let SQ=kW;sn(SQ);var Udt=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},ape=function(s,e){return function(t,i){e(t,i,s)}};let xQ=class extends re{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,i={},n,r){super(),this._link=t,this._hoverService=n,this._enabled=!0,this.el=Ee(e,Fe("a.monaco-link",{tabIndex:t.tabIndex??0,href:t.href},t.label)),this.hoverDelegate=i.hoverDelegate??ta("mouse"),this.setTooltip(t.title),this.el.setAttribute("role","button");const o=this._register(new si(this.el,"click")),a=this._register(new si(this.el,"keypress")),l=We.chain(a.event,f=>f.map(p=>new nn(p)).filter(p=>p.keyCode===3)),d=this._register(new si(this.el,rn.Tap)).event;this._register(io.addTarget(this.el));const h=We.any(o.event,l,d);this._register(h(f=>{this.enabled&&(ai.stop(f,!0),i!=null&&i.opener?i.opener(this._link.href):r.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}setTooltip(e){this.hoverDelegate.showNativeHover?this.el.title=e??"":!this.hover&&e?this.hover=this._register(this._hoverService.setupManagedHover(this.hoverDelegate,this.el,e)):this.hover&&this.hover.update(e)}};xQ=Udt([ape(3,df),ape(4,Ta)],xQ);var pxe=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},mxe=function(s,e){return function(t,i){e(t,i,s)}};const qdt=26;let kQ=class extends re{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(LQ))}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.call(e)}}),this._editor.setBanner(this.banner.element,qdt)}};kQ=pxe([mxe(1,ut)],kQ);let LQ=class extends re{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(Ag,{}),this.element=Fe("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=Fe("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){Sr(this.element)}show(e){Sr(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=Ee(this.element,Fe("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(Fe(`div${bt.asCSSSelector(e.icon)}`));const n=Ee(this.element,Fe("div.message-container"));if(n.setAttribute("aria-hidden","true"),n.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=Ee(this.element,Fe("div.message-actions-container")),e.actions)for(const o of e.actions)this._register(this.instantiationService.createInstance(xQ,this.messageActionsContainer,{...o,tabIndex:-1},{}));const r=Ee(this.element,Fe("div.action-container"));this.actionBar=this._register(new Zl(r)),this.actionBar.push(this._register(new rl("banner.close","Close Banner",bt.asClassName(Awe),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};LQ=pxe([mxe(0,ut)],LQ);var Bne=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},dS=function(s,e){return function(t,i){e(t,i,s)}};const Kdt=mn("extensions-warning-message",Oe.warning,w("warningIcon","Icon shown with a warning message in the extensions editor."));var yS;let VT=(yS=class extends re{constructor(e,t,i,n){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=i,this._highlighter=null,this._bannerClosed=!1,this._updateState=r=>{if(r&&r.hasMore){if(this._bannerClosed)return;const o=Math.max(r.ambiguousCharacterCount,r.nonBasicAsciiCharacterCount,r.invisibleCharacterCount);let a;if(r.nonBasicAsciiCharacterCount>=o)a={message:w("unicodeHighlighting.thisDocumentHasManyNonBasicAsciiUnicodeCharacters","This document contains many non-basic ASCII unicode characters"),command:new zT};else if(r.ambiguousCharacterCount>=o)a={message:w("unicodeHighlighting.thisDocumentHasManyAmbiguousUnicodeCharacters","This document contains many ambiguous unicode characters"),command:new vy};else if(r.invisibleCharacterCount>=o)a={message:w("unicodeHighlighting.thisDocumentHasManyInvisibleUnicodeCharacters","This document contains many invisible unicode characters"),command:new $T};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:Kdt,actions:[{label:a.command.shortLabel,href:`command:${a.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(n.createInstance(kQ,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(126),this._register(i.onDidChangeTrust(r=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(r=>{r.hasChanged(126)&&(this._options=e.getOption(126),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=Gdt(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(i=>i===!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(i=>i.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(i=>i==="_os"?new Intl.NumberFormat().resolvedOptions().locale:i==="_vscode"?mFe:i)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new DQ(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new Ydt(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}},yS.ID="editor.contrib.unicodeHighlighter",yS);VT=Bne([dS(1,Na),dS(2,QCe),dS(3,ut)],VT);function Gdt(s,e){return{nonBasicASCII:e.nonBasicASCII===Nl?!s:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===Nl?!s:e.includeComments,includeStrings:e.includeStrings===Nl?!s:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let DQ=class extends re{constructor(e,t,i,n){super(),this._editor=e,this._options=t,this._updateState=i,this._editorWorkerService=n,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new ji(()=>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 i=[];if(!t.hasMore)for(const n of t.ranges)i.push({range:n,options:G3.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!Lie(t,e))return null;const i=t.getValueInRange(e.range);return{reason:vxe(i,this._options),inComment:Die(t,e),inString:Eie(t,e)}}};DQ=Bne([dS(3,Na)],DQ);class Ydt extends re{constructor(e,t,i){super(),this._editor=e,this._options=t,this._updateState=i,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new ji(()=>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=[],i={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const n of e){const r=Wee.computeUnicodeHighlights(this._model,this._options,n);for(const o of r.ranges)i.ranges.push(o);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||r.hasMore}if(!i.hasMore)for(const n of i.ranges)t.push({range:n,options:G3.instance.getDecorationFromOptions(this._options)});this._updateState(i),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),i=t.getValueInRange(e.range);return Lie(t,e)?{reason:vxe(i,this._options),inComment:Die(t,e),inString:Eie(t,e)}:null}}const _xe=w("unicodeHighlight.configureUnicodeHighlightOptions","Configure Unicode Highlight Options");let EQ=class{constructor(e,t,i){this._editor=e,this._languageService=t,this._openerService=i,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),n=this._editor.getContribution(VT.ID);if(!n)return[];const r=[],o=new Set;let a=300;for(const l of t){const d=n.getDecorationInfo(l);if(!d)continue;const f=i.getValueInRange(l.range).codePointAt(0),p=Ej(f);let m;switch(d.reason.kind){case 0:{dN(d.reason.confusableWith)?m=w("unicodeHighlight.characterIsAmbiguousASCII","The character {0} could be confused with the ASCII character {1}, which is more common in source code.",p,Ej(d.reason.confusableWith.codePointAt(0))):m=w("unicodeHighlight.characterIsAmbiguous","The character {0} could be confused with the character {1}, which is more common in source code.",p,Ej(d.reason.confusableWith.codePointAt(0)));break}case 1:m=w("unicodeHighlight.characterIsInvisible","The character {0} is invisible.",p);break;case 2:m=w("unicodeHighlight.characterIsNonBasicAscii","The character {0} is not a basic ASCII character.",p);break}if(o.has(m))continue;o.add(m);const v={codePoint:f,reason:d.reason,inComment:d.inComment,inString:d.inString},b=w("unicodeHighlight.adjustSettings","Adjust settings"),y=`command:${Y3.ID}?${encodeURIComponent(JSON.stringify(v))}`,x=new eo("",!0).appendMarkdown(m).appendText(" ").appendLink(y,b,_xe);r.push(new bd(this,l.range,[x],!1,a++))}return r}renderHoverParts(e,t){return xnt(e,t,this._editor,this._languageService,this._openerService)}};EQ=Bne([dS(1,Nn),dS(2,Ta)],EQ);function IQ(s){return`U+${s.toString(16).padStart(4,"0")}`}function Ej(s){let e=`\`${IQ(s)}\``;return Tb.isInvisibleCharacter(s)||(e+=` "${`${Zdt(s)}`}"`),e}function Zdt(s){return s===96?"`` ` ``":"`"+String.fromCodePoint(s)+"`"}function vxe(s,e){return Wee.computeUnicodeHighlightReason(s,e)}const LW=class LW{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const i=`${e}${t}`;let n=this.map.get(i);return n||(n=Ot.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,n)),n}};LW.instance=new LW;let G3=LW;class Xdt extends Ze{constructor(){super({id:vy.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,i){const n=e==null?void 0:e.get(Gt);n&&this.runAction(n)}async runAction(e){await e.updateValue(fa.includeComments,!1,2)}}class Qdt extends Ze{constructor(){super({id:vy.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,i){const n=e==null?void 0:e.get(Gt);n&&this.runAction(n)}async runAction(e){await e.updateValue(fa.includeStrings,!1,2)}}const DW=class DW extends Ze{constructor(){super({id:DW.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,i){const n=e==null?void 0:e.get(Gt);n&&this.runAction(n)}async runAction(e){await e.updateValue(fa.ambiguousCharacters,!1,2)}};DW.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";let vy=DW;const EW=class EW extends Ze{constructor(){super({id:EW.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,i){const n=e==null?void 0:e.get(Gt);n&&this.runAction(n)}async runAction(e){await e.updateValue(fa.invisibleCharacters,!1,2)}};EW.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";let $T=EW;const IW=class IW extends Ze{constructor(){super({id:IW.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,i){const n=e==null?void 0:e.get(Gt);n&&this.runAction(n)}async runAction(e){await e.updateValue(fa.nonBasicASCII,!1,2)}};IW.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";let zT=IW;const TW=class TW extends Ze{constructor(){super({id:TW.ID,label:w("action.unicodeHighlight.showExcludeOptions","Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}async run(e,t,i){const{codePoint:n,reason:r,inString:o,inComment:a}=i,l=String.fromCodePoint(n),d=e.get(Uc),h=e.get(Gt);function f(v){return Tb.isInvisibleCharacter(v)?w("unicodeHighlight.excludeInvisibleCharFromBeingHighlighted","Exclude {0} (invisible character) from being highlighted",IQ(v)):w("unicodeHighlight.excludeCharFromBeingHighlighted","Exclude {0} from being highlighted",`${IQ(v)} "${l}"`)}const p=[];if(r.kind===0)for(const v of r.notAmbiguousInLocales)p.push({label:w("unicodeHighlight.allowCommonCharactersInLanguage",'Allow unicode characters that are more common in the language "{0}".',v),run:async()=>{eut(h,[v])}});if(p.push({label:f(n),run:()=>Jdt(h,[n])}),a){const v=new Xdt;p.push({label:v.label,run:async()=>v.runAction(h)})}else if(o){const v=new Qdt;p.push({label:v.label,run:async()=>v.runAction(h)})}if(r.kind===0){const v=new vy;p.push({label:v.label,run:async()=>v.runAction(h)})}else if(r.kind===1){const v=new $T;p.push({label:v.label,run:async()=>v.runAction(h)})}else if(r.kind===2){const v=new zT;p.push({label:v.label,run:async()=>v.runAction(h)})}else tut(r);const m=await d.pick(p,{title:_xe});m&&await m.run()}};TW.ID="editor.action.unicodeHighlight.showExcludeOptions";let Y3=TW;async function Jdt(s,e){const t=s.getValue(fa.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const n of e)i[String.fromCodePoint(n)]=!0;await s.updateValue(fa.allowedCharacters,i,2)}async function eut(s,e){var n;const t=(n=s.inspect(fa.allowedLocales).user)==null?void 0:n.value;let i;typeof t=="object"&&t?i=Object.assign({},t):i={};for(const r of e)i[r]=!0;await s.updateValue(fa.allowedLocales,i,2)}function tut(s){throw new Error(`Unexpected value: ${s}`)}Pe(vy);Pe($T);Pe(zT);Pe(Y3);gi(VT.ID,VT,1);$y.register(EQ);var iut=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},lpe=function(s,e){return function(t,i){e(t,i,s)}};const bxe="ignoreUnusualLineTerminators";function nut(s,e,t){s.setModelProperty(e.uri,bxe,t)}function sut(s,e){return s.getModelProperty(e.uri,bxe)}var wS;let Z3=(wS=class extends re{constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(127),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(127)&&(this._config=this._editor.getOption(127),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(n=>{n.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||sut(this._codeEditorService,e)===!0||this._editor.getOption(92))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let i;try{this._isPresentingDialog=!0,i=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`.",Wc(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(!i.confirmed){nut(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}},wS.ID="editor.contrib.unusualLineTerminatorsDetector",wS);Z3=iut([lpe(1,pN),lpe(2,yi)],Z3);gi(Z3.ID,Z3,1);var rut=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},out=function(s,e){return function(t,i){e(t,i,s)}};class cpe{constructor(){this.selector={language:"*"}}provideDocumentHighlights(e,t,i){const n=[],r=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});return r?e.isDisposed()?void 0:e.findMatches(r.word,!0,!1,!0,s4,!1).map(a=>({range:a.range,kind:DS.Text})):Promise.resolve(n)}provideMultiDocumentHighlights(e,t,i,n){const r=new lr,o=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});if(!o)return Promise.resolve(r);for(const a of[e,...i]){if(a.isDisposed())continue;const d=a.findMatches(o.word,!0,!1,!0,s4,!1).map(h=>({range:h.range,kind:DS.Text}));d&&r.set(a.uri,d)}return r}}let TQ=class extends re{constructor(e){super(),this._register(e.documentHighlightProvider.register("*",new cpe)),this._register(e.multiDocumentHighlightProvider.register("*",new cpe))}};TQ=rut([out(0,it)],TQ);var Cxe=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},EF=function(s,e){return function(t,i){e(t,i,s)}},ds,NQ;const Wne=new qe("hasWordHighlights",!1);function yxe(s,e,t,i){const n=s.ordered(e);return kee(n.map(r=>()=>Promise.resolve(r.provideDocumentHighlights(e,t,i)).then(void 0,is)),r=>r!=null).then(r=>{if(r){const o=new lr;return o.set(e.uri,r),o}return new lr})}function aut(s,e,t,i,n,r){const o=s.ordered(e);return kee(o.map(a=>()=>{const l=r.filter(d=>Bbe(d)).filter(d=>Gee(a.selector,d.uri,d.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(a.provideMultiDocumentHighlights(e,t,l,n)).then(void 0,is)}),a=>a!=null)}class wxe{constructor(e,t,i){this._model=e,this._selection=t,this._wordSeparators=i,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=Zs(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new W(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}isValid(e,t,i){const n=t.startLineNumber,r=t.startColumn,o=t.endColumn,a=this._getCurrentWordRange(e,t);let l=!!(this._wordRange&&this._wordRange.equalsRange(a));for(let d=0,h=i.length;!l&&d<h;d++){const f=i.getRange(d);f&&f.startLineNumber===n&&f.startColumn<=r&&f.endColumn>=o&&(l=!0)}return l}cancel(){this.result.cancel()}}class lut extends wxe{constructor(e,t,i,n){super(e,t,i),this._providers=n}_compute(e,t,i,n){return yxe(this._providers,e,t.getPosition(),n).then(r=>r||new lr)}}class cut extends wxe{constructor(e,t,i,n,r){super(e,t,i),this._providers=n,this._otherModels=r}_compute(e,t,i,n){return aut(this._providers,e,t.getPosition(),i,n,this._otherModels).then(r=>r||new lr)}}function dut(s,e,t,i,n){return new lut(e,t,n,s)}function uut(s,e,t,i,n,r){return new cut(e,t,n,s,r)}Ia("_executeDocumentHighlights",async(s,e,t)=>{const i=s.get(it),n=await yxe(i.documentHighlightProvider,e,t,$t.None);return n==null?void 0:n.get(e.uri)});var Gm;let MQ=(Gm=class{constructor(e,t,i,n,r){this.toUnhook=new me,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new lr,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.runDelayer=this.toUnhook.add(new Ac(50)),this.editor=e,this.providers=t,this.multiDocumentProviders=i,this.codeEditorService=r,this._hasWordHighlights=Wne.bindTo(n),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(81),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(o=>{this._ignorePositionChangeEvent||this.occurrencesHighlight!=="off"&&this.runDelayer.trigger(()=>{this._onPositionChanged(o)})})),this.toUnhook.add(e.onDidFocusEditorText(o=>{this.occurrencesHighlight!=="off"&&(this.workerRequest||this.runDelayer.trigger(()=>{this._run()}))})),this.toUnhook.add(e.onDidChangeModelContent(o=>{gH(this.model.uri,"output")||this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(o=>{!o.newModelUrl&&o.oldModelUrl?this._stopSingular():ds.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(o=>{var l,d;const a=this.editor.getOption(81);if(this.occurrencesHighlight!==a)switch(this.occurrencesHighlight=a,a){case"off":this._stopAll();break;case"singleFile":this._stopAll((d=(l=ds.query)==null?void 0:l.modelInfo)==null?void 0:d.model);break;case"multiFile":ds.query&&this._run(!0);break;default:console.warn("Unknown occurrencesHighlight setting value:",a);break}})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,ds.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(){this.occurrencesHighlight!=="off"&&(this.runDelayer.cancel(),this._run())}_getSortedHighlights(){return this.decorations.getRanges().sort(W.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),i=(e.findIndex(r=>r.containsPosition(this.editor.getPosition()))+1)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const r=this._getWord();if(r){const o=this.editor.getModel().getLineContent(n.startLineNumber);Qo(`${o}, ${i+1} of ${e.length} for '${r.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),i=(e.findIndex(r=>r.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const r=this._getWord();if(r){const o=this.editor.getModel().getLineContent(n.startLineNumber);Qo(`${o}, ${i+1} of ${e.length} for '${r.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=ds.storedDecorationIDs.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),ds.storedDecorationIDs.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(e){const t=this.codeEditorService.listCodeEditors(),i=[];for(const n of t){if(!n.hasModel()||VI(n.getModel().uri,e==null?void 0:e.uri))continue;const r=ds.storedDecorationIDs.get(n.getModel().uri);if(!r)continue;n.removeDecorations(r),i.push(n.getModel().uri);const o=C_.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 i)ds.storedDecorationIDs.delete(n)}_stopSingular(){var e,t,i,n;this._removeSingleDecorations(),this.editor.hasTextFocus()&&(((e=this.editor.getModel())==null?void 0:e.uri.scheme)!==Mt.vscodeNotebookCell&&((i=(t=ds.query)==null?void 0:t.modelInfo)==null?void 0:i.model.uri.scheme)!==Mt.vscodeNotebookCell?(ds.query=null,this._run()):(n=ds.query)!=null&&n.modelInfo&&(ds.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(e){this._removeAllDecorations(e),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?void 0:t.uri.scheme)!==Mt.vscodeNotebookCell){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:i})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===Mt.vscodeNotebookCell){const r=[],o=this.codeEditorService.listCodeEditors();for(const a of o){const l=a.getModel();l&&l!==e&&l.uri.scheme===Mt.vscodeNotebookCell&&r.push(l)}return r}const i=[],n=this.codeEditorService.listCodeEditors();for(const r of n){if(!Uie(r))continue;const o=r.getModel();o&&e===o.modified&&i.push(o.modified)}if(i.length)return i;if(this.occurrencesHighlight==="singleFile")return[];for(const r of n){const o=r.getModel();o&&o!==e&&i.push(o)}return i}_run(e){var n,r;let t;if(this.editor.hasTextFocus()){const o=this.editor.getSelection();if(!o||o.startLineNumber!==o.endLineNumber){ds.query=null,this._stopAll();return}const a=o.startColumn,l=o.endColumn,d=this._getWord();if(!d||d.startColumn>a||d.endColumn<l){ds.query=null,this._stopAll();return}t=this.workerRequest&&this.workerRequest.isValid(this.model,o,this.decorations),ds.query={modelInfo:{model:this.model,selection:o},word:d}}else if(!ds.query){this._stopAll();return}if(this.lastCursorPositionChangeTime=new Date().getTime(),t)this.workerRequestCompleted&&this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1,this._beginRenderDecorations());else if(VI(this.editor.getModel().uri,(n=ds.query.modelInfo)==null?void 0:n.model.uri)){if(!e){const l=this.decorations.getRanges();for(const d of l)if(d.containsPosition(this.editor.getPosition()))return}this._stopAll(e?this.model:void 0);const o=++this.workerRequestTokenId;this.workerRequestCompleted=!1;const a=this.getOtherModelsToHighlight(this.editor.getModel());if(!ds.query||!ds.query.modelInfo||ds.query.modelInfo.model.isDisposed())return;this.workerRequest=this.computeWithModel(ds.query.modelInfo.model,ds.query.modelInfo.selection,ds.query.word,a),(r=this.workerRequest)==null||r.result.then(l=>{o===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=l||[],this._beginRenderDecorations())},Tt)}}computeWithModel(e,t,i,n){return n.length?uut(this.multiDocumentProviders,e,t,i,this.editor.getOption(132),n):dut(this.providers,e,t,i,this.editor.getOption(132))}_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 t,i,n;this.renderDecorationsTimer=-1;const e=this.codeEditorService.listCodeEditors();for(const r of e){const o=C_.get(r);if(!o)continue;const a=[],l=(t=r.getModel())==null?void 0:t.uri;if(l&&this.workerRequestValue.has(l)){const d=ds.storedDecorationIDs.get(l),h=this.workerRequestValue.get(l);if(h)for(const p of h)p.range&&a.push({range:p.range,options:Jlt(p.kind)});let f=[];r.changeDecorations(p=>{f=p.deltaDecorations(d??[],a)}),ds.storedDecorationIDs=ds.storedDecorationIDs.set(l,f),a.length>0&&((i=o.wordHighlighter)==null||i.decorations.set(a),(n=o.wordHighlighter)==null||n._hasWordHighlights.set(!0))}}}dispose(){this._stopSingular(),this.toUnhook.dispose()}},ds=Gm,Gm.storedDecorationIDs=new lr,Gm.query=null,Gm);MQ=ds=Cxe([EF(4,yi)],MQ);var OC;let C_=(OC=class extends re{static get(e){return e.getContribution(NQ.ID)}constructor(e,t,i,n){super(),this._wordHighlighter=null;const r=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this._wordHighlighter=new MQ(e,i.documentHighlightProvider,i.multiDocumentHighlightProvider,t,n))};this._register(e.onDidChangeModel(o=>{this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),r()})),r()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){var e;(e=this._wordHighlighter)==null||e.moveNext()}moveBack(){var e;(e=this._wordHighlighter)==null||e.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore()}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}},NQ=OC,OC.ID="editor.contrib.wordHighlighter",OC);C_=NQ=Cxe([EF(1,yt),EF(2,it),EF(3,yi)],C_);class Sxe extends Ze{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=C_.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class hut extends Sxe{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:Wne,kbOpts:{kbExpr:U.editorTextFocus,primary:65,weight:100}})}}class fut extends Sxe{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:Wne,kbOpts:{kbExpr:U.editorTextFocus,primary:1089,weight:100}})}}class gut extends Ze{constructor(){super({id:"editor.action.wordHighlight.trigger",label:w("wordHighlight.trigger.label","Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:0,weight:100}})}run(e,t,i){const n=C_.get(t);n&&n.restoreViewState(!0)}}gi(C_.ID,C_,0);Pe(hut);Pe(fut);Pe(gut);$x(TQ);class qV extends $s{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const n=Bc(t.getOption(132),t.getOption(131)),r=t.getModel(),o=t.getSelections(),a=o.length>1,l=o.map(d=>{const h=new ie(d.positionLineNumber,d.positionColumn),f=this._move(n,r,h,this._wordNavigationType,a);return this._moveTo(d,f,this._inSelectionMode)});if(r.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,l.map(d=>bi.fromModelSelection(d))),l.length===1){const d=new ie(l[0].positionLineNumber,l[0].positionColumn);t.revealPosition(d,0)}}_moveTo(e,t,i){return i?new ot(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new ot(t.lineNumber,t.column,t.lineNumber,t.column)}}class M_ extends qV{_move(e,t,i,n,r){return Ti.moveWordLeft(e,t,i,n,r)}}class R_ extends qV{_move(e,t,i,n,r){return Ti.moveWordRight(e,t,i,n)}}class put extends M_{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class mut extends M_{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class _ut extends M_{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:ve.and(U.textInputFocus,(e=ve.and(bN,oV))==null?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class vut extends M_{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class but extends M_{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class Cut extends M_{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:ve.and(U.textInputFocus,(e=ve.and(bN,oV))==null?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class yut extends M_{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,n,r){return super._move(Bc(zu.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,r)}}class wut extends M_{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,n,r){return super._move(Bc(zu.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,r)}}class Sut extends R_{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class xut extends R_{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:ve.and(U.textInputFocus,(e=ve.and(bN,oV))==null?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class kut extends R_{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class Lut extends R_{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class Dut extends R_{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:ve.and(U.textInputFocus,(e=ve.and(bN,oV))==null?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class Eut extends R_{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class Iut extends R_{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,n,r){return super._move(Bc(zu.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,r)}}class Tut extends R_{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,n,r){return super._move(Bc(zu.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,r)}}class KV extends $s{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const n=e.get(Bn);if(!t.hasModel())return;const r=Bc(t.getOption(132),t.getOption(131)),o=t.getModel(),a=t.getSelections(),l=t.getOption(6),d=t.getOption(11),h=n.getLanguageConfiguration(o.getLanguageId()).getAutoClosingPairs(),f=t._getViewModel(),p=a.map(m=>{const v=this._delete({wordSeparators:r,model:o,selection:m,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(9),autoClosingBrackets:l,autoClosingQuotes:d,autoClosingPairs:h,autoClosedCharacters:f.getCursorAutoClosedCharacters()},this._wordNavigationType);return new Vr(v,"")});t.pushUndoStop(),t.executeCommands(this.id,p),t.pushUndoStop()}}class Hne extends KV{_delete(e,t){const i=Ti.deleteWordLeft(e,t);return i||new W(1,1,1,1)}}class Vne extends KV{_delete(e,t){const i=Ti.deleteWordRight(e,t);if(i)return i;const n=e.model.getLineCount(),r=e.model.getLineMaxColumn(n);return new W(n,r,n,r)}}class Nut extends Hne{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:U.writable})}}class Mut extends Hne{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:U.writable})}}class Rut extends Hne{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:U.writable,kbOpts:{kbExpr:U.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class Put extends Vne{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:U.writable})}}class Out extends Vne{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:U.writable})}}class Aut extends Vne{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:U.writable,kbOpts:{kbExpr:U.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class Fut extends Ze{constructor(){super({id:"deleteInsideWord",precondition:U.writable,label:w("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,t,i){if(!t.hasModel())return;const n=Bc(t.getOption(132),t.getOption(131)),r=t.getModel(),a=t.getSelections().map(l=>{const d=Ti.deleteInsideWord(n,r,l);return new Vr(d,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}Ue(new put);Ue(new mut);Ue(new _ut);Ue(new vut);Ue(new but);Ue(new Cut);Ue(new Sut);Ue(new xut);Ue(new kut);Ue(new Lut);Ue(new Dut);Ue(new Eut);Ue(new yut);Ue(new wut);Ue(new Iut);Ue(new Tut);Ue(new Nut);Ue(new Mut);Ue(new Rut);Ue(new Put);Ue(new Out);Ue(new Aut);Pe(Fut);class But extends KV{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:U.writable,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const i=_V.deleteWordPartLeft(e);return i||new W(1,1,1,1)}}class Wut extends KV{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:U.writable,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const i=_V.deleteWordPartRight(e);if(i)return i;const n=e.model.getLineCount(),r=e.model.getLineMaxColumn(n);return new W(n,r,n,r)}}class xxe extends qV{_move(e,t,i,n,r){return _V.moveWordPartLeft(e,t,i,r)}}class Hut extends xxe{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}hi.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class Vut extends xxe{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}hi.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class kxe extends qV{_move(e,t,i,n,r){return _V.moveWordPartRight(e,t,i)}}class $ut extends kxe{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class zut extends kxe{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}Ue(new But);Ue(new Wut);Ue(new Hut);Ue(new Vut);Ue(new $ut);Ue(new zut);const Yne=class Yne extends re{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=al.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(93);t||(this.editor.isSimpleWidget?t=new eo(w("editor.simple.readonly","Cannot edit in read-only input")):t=new eo(w("editor.readonly","Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}};Yne.ID="editor.contrib.readOnlyMessageController";let X3=Yne;gi(X3.ID,X3,2);var jut=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},dpe=function(s,e){return function(t,i){e(t,i,s)}};let RQ=class extends re{constructor(e,t,i){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=i,this._currentModel=Kt(this,void 0);const n=Hr("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),r=Hr("_textModel.onDidChangeContent",We.debounce(o=>this._textModel.onDidChangeContent(o),()=>{},100));this._register(ya(async(o,a)=>{n.read(o),r.read(o);const l=a.add(new TXe),d=await this._outlineModelService.getOrCreate(this._textModel,l.token);a.isDisposed||this._currentModel.set(d,void 0)}))}getBreadcrumbItems(e,t){const i=this._currentModel.read(t);if(!i)return[];const n=i.asListOfDocumentSymbols().filter(r=>e.contains(r.range.startLineNumber)&&!e.contains(r.range.endLineNumber));return n.sort(ive(qo(r=>r.range.endLineNumber-r.range.startLineNumber,xd))),n.map(r=>({name:r.name,kind:r.kind,startLineNumber:r.range.startLineNumber}))}};RQ=jut([dpe(1,it),dpe(2,UN)],RQ);X5.setBreadcrumbsSourceFactory((s,e)=>e.createInstance(RQ,s));const Zne=class Zne extends re{constructor(e){super(),this.editor=e,this.widget=null,Mu&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(92);!this.widget&&e?this.widget=new PQ(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}};Zne.ID="editor.contrib.iPadShowKeyboard";let Q3=Zne;const NW=class NW extends re{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(ue(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(ue(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return NW.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}};NW.ID="editor.contrib.ShowKeyboardWidget";let PQ=NW;gi(Q3.ID,Q3,3);var Uut=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},upe=function(s,e){return function(t,i){e(t,i,s)}},OQ,AC;let jT=(AC=class extends re{static get(e){return e.getContribution(OQ.ID)}constructor(e,t,i){super(),this._editor=e,this._languageService=i,this._widget=null,this._register(this._editor.onDidChangeModel(n=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(n=>this.stop())),this._register(Un.onDidChange(n=>this.stop())),this._register(this._editor.onKeyUp(n=>n.keyCode===9&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new AQ(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}},OQ=AC,AC.ID="editor.contrib.inspectTokens",AC);jT=OQ=Uut([upe(1,ac),upe(2,Nn)],jT);class qut extends Ze{constructor(){super({id:"editor.action.inspectTokens",label:zK.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){const i=jT.get(t);i==null||i.launch()}}function Kut(s){let e="";for(let t=0,i=s.length;t<i;t++){const n=s.charCodeAt(t);switch(n){case 9:e+="→";break;case 32:e+="·";break;default:e+=String.fromCharCode(n)}}return e}function Gut(s,e){const t=Un.get(e);if(t)return t;const i=s.encodeLanguageId(e);return{getInitialState:()=>WS,tokenize:(n,r,o)=>_te(e,o),tokenizeEncoded:(n,r,o)=>ZH(i,o)}}const MW=class MW extends re{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=Gut(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(i=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return MW._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let i=0;for(let l=t.tokens1.length-1;l>=0;l--){const d=t.tokens1[l];if(e.column-1>=d.offset){i=l;break}}let n=0;for(let l=t.tokens2.length>>>1;l>=0;l--)if(e.column-1>=t.tokens2[l<<1]){n=l;break}const r=this._model.getLineContent(e.lineNumber);let o="";if(i<t.tokens1.length){const l=t.tokens1[i].offset,d=i+1<t.tokens1.length?t.tokens1[i+1].offset:r.length;o=r.substring(l,d)}xr(this._domNode,Fe("h2.tm-token",void 0,Kut(o),Fe("span.tm-token-length",void 0,`${o.length} ${o.length===1?"char":"chars"}`))),Ee(this._domNode,Fe("hr.tokens-inspect-separator",{style:"clear:both"}));const a=(n<<1)+1<t.tokens2.length?this._decodeMetadata(t.tokens2[(n<<1)+1]):null;Ee(this._domNode,Fe("table.tm-metadata-table",void 0,Fe("tbody",void 0,Fe("tr",void 0,Fe("td.tm-metadata-key",void 0,"language"),Fe("td.tm-metadata-value",void 0,`${a?a.languageId:"-?-"}`)),Fe("tr",void 0,Fe("td.tm-metadata-key",void 0,"token type"),Fe("td.tm-metadata-value",void 0,`${a?this._tokenTypeToString(a.tokenType):"-?-"}`)),Fe("tr",void 0,Fe("td.tm-metadata-key",void 0,"font style"),Fe("td.tm-metadata-value",void 0,`${a?this._fontStyleToString(a.fontStyle):"-?-"}`)),Fe("tr",void 0,Fe("td.tm-metadata-key",void 0,"foreground"),Fe("td.tm-metadata-value",void 0,`${a?be.Format.CSS.formatHex(a.foreground):"-?-"}`)),Fe("tr",void 0,Fe("td.tm-metadata-key",void 0,"background"),Fe("td.tm-metadata-value",void 0,`${a?be.Format.CSS.formatHex(a.background):"-?-"}`))))),Ee(this._domNode,Fe("hr.tokens-inspect-separator")),i<t.tokens1.length&&Ee(this._domNode,Fe("span.tm-token-type",void 0,t.tokens1[i].type)),this._editor.layoutContentWidget(this)}_decodeMetadata(e){const t=Un.getColorMap(),i=pa.getLanguageId(e),n=pa.getTokenType(e),r=pa.getFontStyle(e),o=pa.getForeground(e),a=pa.getBackground(e);return{languageId:this._languageService.languageIdCodec.decodeLanguageId(i),tokenType:n,fontStyle:r,foreground:t[o],background:t[a]}}_tokenTypeToString(e){switch(e){case 0:return"Other";case 1:return"Comment";case 2:return"String";case 3:return"RegEx";default:return"??"}}_fontStyleToString(e){let t="";return e&1&&(t+="italic "),e&2&&(t+="bold "),e&4&&(t+="underline "),e&8&&(t+="strikethrough "),t.length===0&&(t="---"),t}_getTokensAtLine(e){const t=this._getStateBeforeLine(e),i=this._tokenizationSupport.tokenize(this._model.getLineContent(e),!0,t),n=this._tokenizationSupport.tokenizeEncoded(this._model.getLineContent(e),!0,t);return{startState:t,tokens1:i.tokens,tokens2:n.tokens,endState:i.endState}}_getStateBeforeLine(e){let t=this._tokenizationSupport.getInitialState();for(let i=1;i<e;i++)t=this._tokenizationSupport.tokenize(this._model.getLineContent(i),!0,t).endState;return t}getDomNode(){return this._domNode}getPosition(){return{position:this._editor.getPosition(),preference:[2,1]}}};MW._ID="editor.contrib.inspectTokensWidget";let AQ=MW;gi(jT.ID,jT,4);Pe(qut);var Yut=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},hpe=function(s,e){return function(t,i){e(t,i,s)}},XD,FC;let FQ=(FC=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=Fn.as(Oy.Quickaccess)}provide(e){const t=new me;return t.add(e.onDidAccept(()=>{const[i]=e.selectedItems;i&&this.quickInputService.quickAccess.show(i.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(i=>{const n=this.registry.getQuickAccessProvider(i.substr(XD.PREFIX.length));n&&n.prefix&&n.prefix!==XD.PREFIX&&this.quickInputService.quickAccess.show(n.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(i=>i.prefix!==XD.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,i)=>t.prefix.localeCompare(i.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const i=t.prefix||e.prefix,n=i||"…";return{prefix:i,label:n,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:w("helpPickAriaLabel","{0}, {1}",n,t.description),description:t.description}})}},XD=FC,FC.PREFIX="?",FC);FQ=XD=Yut([hpe(0,Uc),hpe(1,Mi)],FQ);Fn.as(Oy.Quickaccess).registerQuickAccessProvider({ctor:FQ,prefix:"",helpEntries:[{description:jK.helpQuickAccessActionLabel}]});class Lxe{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t,i){var o;const n=new me;e.canAcceptInBackground=!!((o=this.options)!=null&&o.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const r=n.add(new Js);return r.value=this.doProvide(e,t,i),n.add(this.onDidActiveTextEditorControlChange(()=>{r.value=void 0,r.value=this.doProvide(e,t)})),n}doProvide(e,t,i){const n=new me,r=this.activeTextEditorControl;if(r&&this.canProvideWithTextEditor(r)){const o={editor:r},a=M1e(r);if(a){let l=r.saveViewState()??void 0;n.add(a.onDidChangeCursorPosition(()=>{l=r.saveViewState()??void 0})),o.restoreViewState=()=>{l&&r===this.activeTextEditorControl&&r.restoreViewState(l)},n.add(e_(t.onCancellationRequested)(()=>{var d;return(d=o.restoreViewState)==null?void 0:d.call(o)}))}n.add(dt(()=>this.clearDecorations(r))),n.add(this.provideWithTextEditor(o,e,t,i))}else n.add(this.provideWithoutTextEditor(e,t));return n}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range,"code.jump"),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const i=e.getModel();i&&"getLineContent"in i&&Jh(`${i.getLineContent(t.range.startLineNumber)}`)}getModel(e){var t;return Uie(e)?(t=e.getModel())==null?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(i=>{const n=[];this.rangeHighlightDecorationId&&(n.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),n.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const r=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:qn(Sye),position:Gl.Full}}}],[o,a]=i.deltaDecorations(n,r);this.rangeHighlightDecorationId={rangeHighlightId:o,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(i=>{i.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}const RW=class RW extends Lxe{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,re.None}provideWithTextEditor(e,t,i){const n=e.editor,r=new me;r.add(t.onDidAccept(l=>{const[d]=t.selectedItems;if(d){if(!this.isValidLineNumber(n,d.lineNumber))return;this.gotoLocation(e,{range:this.toRange(d.lineNumber,d.column),keyMods:t.keyMods,preserveFocus:l.inBackground}),l.inBackground||t.hide()}}));const o=()=>{const l=this.parsePosition(n,t.value.trim().substr(RW.PREFIX.length)),d=this.getPickLabel(n,l.lineNumber,l.column);if(t.items=[{lineNumber:l.lineNumber,column:l.column,label:d}],t.ariaLabel=d,!this.isValidLineNumber(n,l.lineNumber)){this.clearDecorations(n);return}const h=this.toRange(l.lineNumber,l.column);n.revealRangeInCenter(h,0),this.addDecorations(n,h)};o(),r.add(t.onDidChangeValue(()=>o()));const a=M1e(n);return a&&a.getOptions().get(68).renderType===2&&(a.updateOptions({lineNumbers:"on"}),r.add(dt(()=>a.updateOptions({lineNumbers:"relative"})))),r}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const i=t.split(/,|:|#/).map(r=>parseInt(r,10)).filter(r=>!isNaN(r)),n=this.lineCount(e)+1;return{lineNumber:i[0]>0?i[0]:n+i[0],column:i[1]}}getPickLabel(e,t,i){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,i)?w("gotoLineColumnLabel","Go to line {0} and character {1}.",t,i):w("gotoLineLabel","Go to line {0}.",t);const n=e.getPosition()||{lineNumber:1,column:1},r=this.lineCount(e);return r>1?w("gotoLineLabelEmptyWithLimit","Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",n.lineNumber,n.column,r):w("gotoLineLabelEmpty","Current Line: {0}, Character: {1}. Type a line number to navigate to.",n.lineNumber,n.column)}isValidLineNumber(e,t){return!t||typeof t!="number"?!1:t>0&&t<=this.lineCount(e)}isValidColumn(e,t,i){if(!i||typeof i!="number")return!1;const n=this.getModel(e);if(!n)return!1;const r={lineNumber:t,column:i};return n.validatePosition(r).equals(r)}lineCount(e){var t;return((t=this.getModel(e))==null?void 0:t.getLineCount())??0}};RW.PREFIX=":";let BQ=RW;var Zut=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Xut=function(s,e){return function(t,i){e(t,i,s)}};let UT=class extends BQ{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=We.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};UT=Zut([Xut(0,yi)],UT);var BC;let Dxe=(BC=class extends Ze{constructor(){super({id:BC.ID,label:q4.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:U.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(Uc).quickAccess.show(UT.PREFIX)}},BC.ID="editor.action.gotoLine",BC);Pe(Dxe);Fn.as(Oy.Quickaccess).registerQuickAccessProvider({ctor:UT,prefix:UT.PREFIX,helpEntries:[{description:q4.gotoLineActionLabel,commandId:Dxe.ID}]});const Exe=[void 0,[]];function Ij(s,e,t=0,i=0){const n=e;return n.values&&n.values.length>1?Qut(s,n.values,t,i):Ixe(s,e,t,i)}function Qut(s,e,t,i){let n=0;const r=[];for(const o of e){const[a,l]=Ixe(s,o,t,i);if(typeof a!="number")return Exe;n+=a,r.push(...l)}return[n,Jut(r)]}function Ixe(s,e,t,i){const n=ey(e.original,e.originalLowercase,t,s,s.toLowerCase(),i,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return n?[n[0],vN(n)]:Exe}function Jut(s){const e=s.sort((n,r)=>n.start-r.start),t=[];let i;for(const n of e)!i||!eht(i,n)?(i=n,t.push(n)):(i.start=Math.min(i.start,n.start),i.end=Math.max(i.end,n.end));return t}function eht(s,e){return!(s.end<e.start||e.end<s.start)}function fpe(s){return s.startsWith('"')&&s.endsWith('"')}const Txe=" ";function WQ(s){typeof s!="string"&&(s="");const e=s.toLowerCase(),{pathNormalized:t,normalized:i,normalizedLowercase:n}=gpe(s),r=t.indexOf(ku)>=0,o=fpe(s);let a;const l=s.split(Txe);if(l.length>1)for(const d of l){const h=fpe(d),{pathNormalized:f,normalized:p,normalizedLowercase:m}=gpe(d);p&&(a||(a=[]),a.push({original:d,originalLowercase:d.toLowerCase(),pathNormalized:f,normalized:p,normalizedLowercase:m,expectContiguousMatch:h}))}return{original:s,originalLowercase:e,pathNormalized:t,normalized:i,normalizedLowercase:n,values:a,containsPathSeparator:r,expectContiguousMatch:o}}function gpe(s){let e;Ur?e=s.replace(/\//g,ku):e=s.replace(/\\/g,ku);const t=u5e(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function ppe(s){return Array.isArray(s)?WQ(s.map(e=>e.original).join(Txe)):WQ(s.original)}var tht=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},mpe=function(s,e){return function(t,i){e(t,i,s)}},IF,_u;let $b=(_u=class extends Lxe{constructor(e,t,i=Object.create(null)){super(i),this._languageFeaturesService=e,this._outlineModelService=t,this.options=i,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.")),re.None}provideWithTextEditor(e,t,i,n){const r=e.editor,o=this.getModel(r);return o?this._languageFeaturesService.documentSymbolProvider.has(o)?this.doProvideWithEditorSymbols(e,o,t,i,n):this.doProvideWithoutEditorSymbols(e,o,t,i):re.None}doProvideWithoutEditorSymbols(e,t,i,n){const r=new me;return this.provideLabelPick(i,w("cannotRunGotoSymbolWithoutSymbolProvider","The active text editor does not provide symbol information.")),(async()=>!await this.waitForLanguageSymbolRegistry(t,r)||n.isCancellationRequested||r.add(this.doProvideWithEditorSymbols(e,t,i,n)))(),r}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 i=new kx,n=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(n.dispose(),i.complete(!0))}));return t.add(dt(()=>i.complete(!1))),i.p}doProvideWithEditorSymbols(e,t,i,n,r){var f;const o=e.editor,a=new me;a.add(i.onDidAccept(p=>{var v;const[m]=i.selectedItems;m&&m.range&&(this.gotoLocation(e,{range:m.range.selection,keyMods:i.keyMods,preserveFocus:p.inBackground}),(v=r==null?void 0:r.handleAccept)==null||v.call(r,m),p.inBackground||i.hide())})),a.add(i.onDidTriggerItemButton(({item:p})=>{p&&p.range&&(this.gotoLocation(e,{range:p.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())}));const l=this.getDocumentSymbols(t,n);let d;const h=async p=>{d==null||d.dispose(!0),i.busy=!1,d=new An(n),i.busy=!0;try{const m=WQ(i.value.substr(IF.PREFIX.length).trim()),v=await this.doGetSymbolPicks(l,m,void 0,d.token,t);if(n.isCancellationRequested)return;if(v.length>0){if(i.items=v,p&&m.original.length===0){const b=DI(v,y=>!!(y.type!=="separator"&&y.range&&W.containsPosition(y.range.decoration,p)));b&&(i.activeItems=[b])}}else m.original.length>0?this.provideLabelPick(i,w("noMatchingSymbolResults","No matching editor symbols")):this.provideLabelPick(i,w("noSymbolResults","No editor symbols"))}finally{n.isCancellationRequested||(i.busy=!1)}};return a.add(i.onDidChangeValue(()=>h(void 0))),h((f=o.getSelection())==null?void 0:f.getPosition()),a.add(i.onDidChangeActive(()=>{const[p]=i.activeItems;p&&p.range&&(o.revealRangeInCenter(p.range.selection,0),this.addDecorations(o,p.range.decoration))})),a}async doGetSymbolPicks(e,t,i,n,r){var y,x;const o=await e;if(n.isCancellationRequested)return[];const a=t.original.indexOf(IF.SCOPE_PREFIX)===0,l=a?1:0;let d,h;t.values&&t.values.length>1?(d=ppe(t.values[0]),h=ppe(t.values.slice(1))):d=t;let f;const p=(x=(y=this.options)==null?void 0:y.openSideBySideDirection)==null?void 0:x.call(y);p&&(f=[{iconClass:p==="right"?bt.asClassName(Oe.splitHorizontal):bt.asClassName(Oe.splitVertical),tooltip:p==="right"?w("openToSide","Open to the Side"):w("openToBottom","Open to the Bottom")}]);const m=[];for(let D=0;D<o.length;D++){const S=o[D],E=c5e(S.name),I=`$(${d4.toIcon(S.kind).id}) ${E}`,R=I.length-E.length;let M=S.containerName;i!=null&&i.extraContainerLabel&&(M?M=`${i.extraContainerLabel} • ${M}`:M=i.extraContainerLabel);let O,H,te,J;if(t.original.length>l){let V=!1;if(d!==t&&([O,H]=Ij(I,{...t,values:void 0},l,R),typeof O=="number"&&(V=!0)),typeof O!="number"&&([O,H]=Ij(I,d,l,R),typeof O!="number"))continue;if(!V&&h){if(M&&h.original.length>0&&([te,J]=Ij(M,h)),typeof te!="number")continue;typeof O=="number"&&(O+=te)}}const z=S.tags&&S.tags.indexOf(1)>=0;m.push({index:D,kind:S.kind,score:O,label:I,ariaLabel:i5e(S.name,S.kind),description:M,highlights:z?void 0:{label:H,description:J},range:{selection:W.collapseToStart(S.selectionRange),decoration:S.range},uri:r.uri,symbolName:E,strikethrough:z,buttons:f})}const v=m.sort((D,S)=>a?this.compareByKindAndScore(D,S):this.compareByScore(D,S));let b=[];if(a){let I=function(){S&&typeof D=="number"&&E>0&&(S.label=qC(Nj[D]||Tj,E))},D,S,E=0;for(const R of v)D!==R.kind?(I(),D=R.kind,E=1,S={type:"separator"},b.push(S)):E++,b.push(R);I()}else v.length>0&&(b=[{label:w("symbols","symbols ({0})",m.length),type:"separator"},...v]);return b}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.score<t.score)return 1}return e.index<t.index?-1:e.index>t.index?1:0}compareByKindAndScore(e,t){const i=Nj[e.kind]||Tj,n=Nj[t.kind]||Tj,r=i.localeCompare(n);return r===0?this.compareByScore(e,t):r}async getDocumentSymbols(e,t){const i=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()}},IF=_u,_u.PREFIX="@",_u.SCOPE_PREFIX=":",_u.PREFIX_BY_CATEGORY=`${_u.PREFIX}${_u.SCOPE_PREFIX}`,_u);$b=IF=tht([mpe(0,it),mpe(1,UN)],$b);const Tj=w("property","properties ({0})"),Nj={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 iht=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Mj=function(s,e){return function(t,i){e(t,i,s)}};let HQ=class extends $b{constructor(e,t,i){super(t,i),this.editorService=e,this.onDidActiveTextEditorControlChange=We.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};HQ=iht([Mj(0,yi),Mj(1,it),Mj(2,UN)],HQ);const PW=class PW extends Ze{constructor(){super({id:PW.ID,label:zI.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:U.hasDocumentSymbolProvider,kbOpts:{kbExpr:U.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(Uc).quickAccess.show($b.PREFIX,{itemActivation:lu.NONE})}};PW.ID="editor.action.quickOutline";let J3=PW;Pe(J3);Fn.as(Oy.Quickaccess).registerQuickAccessProvider({ctor:HQ,prefix:$b.PREFIX,helpEntries:[{description:zI.quickOutlineActionLabel,prefix:$b.PREFIX,commandId:J3.ID},{description:zI.quickOutlineByCategoryActionLabel,prefix:$b.PREFIX_BY_CATEGORY}]});function nht(s){const e=new Map;for(const t of s)e.set(t,(e.get(t)??0)+1);return e}class BE{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),n=new Map,r=[];for(const[o,a]of this.documents){if(t.isCancellationRequested)return[];for(const l of a.chunks){const d=this.computeSimilarityScore(l,i,n);d>0&&r.push({key:o,score:d})}}return r}static termFrequencies(e){return nht(BE.splitTerms(e))}static*splitTerms(e){const t=i=>i.toLowerCase();for(const[i]of e.matchAll(new RegExp("\\b\\p{Letter}[\\p{Letter}\\d]{2,}\\b","gu"))){yield t(i);const n=i.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(n.length>1)for(const r of n)r.length>2&&new RegExp("\\p{Letter}{3,}","gu").test(r)&&(yield t(r))}}updateDocuments(e){for(const{key:t}of e)this.deleteDocument(t);for(const t of e){const i=[];for(const n of t.textChunks){const r=BE.termFrequencies(n);for(const o of r.keys())this.chunkOccurrences.set(o,(this.chunkOccurrences.get(o)??0)+1);i.push({text:n,tf:r})}this.chunkCount+=i.length,this.documents.set(t.key,{chunks:i})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const i of t.chunks)for(const n of i.tf.keys()){const r=this.chunkOccurrences.get(n);if(typeof r=="number"){const o=r-1;o<=0?this.chunkOccurrences.delete(n):this.chunkOccurrences.set(n,o)}}}}computeSimilarityScore(e,t,i){let n=0;for(const[r,o]of Object.entries(t)){const a=e.tf.get(r);if(!a)continue;let l=i.get(r);typeof l!="number"&&(l=this.computeIdf(r),i.set(r,l));const d=a*l;n+=d*o}return n}computeEmbedding(e){const t=BE.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){const t=this.chunkOccurrences.get(e)??0;return t>0?Math.log((this.chunkCount+1)/t):0}computeTfidf(e){const t=Object.create(null);for(const[i,n]of e){const r=this.computeIdf(i);r>0&&(t[i]=n*r)}return t}}function sht(s){var i;const e=s.slice(0);e.sort((n,r)=>r.score-n.score);const t=((i=e[0])==null?void 0:i.score)??0;if(t>0)for(const n of e)n.score/=t;return e}var y0;(function(s){s[s.NO_ACTION=0]="NO_ACTION",s[s.CLOSE_PICKER=1]="CLOSE_PICKER",s[s.REFRESH_PICKER=2]="REFRESH_PICKER",s[s.REMOVE_ITEM=3]="REMOVE_ITEM"})(y0||(y0={}));function Rj(s){const e=s;return Array.isArray(e.items)}function _pe(s){const e=s;return!!e.picks&&e.additionalPicks instanceof Promise}class rht extends re{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){var d;const n=new me;e.canAcceptInBackground=!!((d=this.options)!=null&&d.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let r;const o=n.add(new Js),a=async()=>{var y;const h=o.value=new me;r==null||r.dispose(!0),e.busy=!1,r=new An(t);const f=r.token;let p=e.value.substring(this.prefix.length);(y=this.options)!=null&&y.shouldSkipTrimPickFilter||(p=p.trim());const m=this._getPicks(p,h,f,i),v=(x,D)=>{var I;let S,E;if(Rj(x)?(S=x.items,E=x.active):S=x,S.length===0){if(D)return!1;(p.length>0||e.hideInput)&&((I=this.options)!=null&&I.noResultsPick)&&(gI(this.options.noResultsPick)?S=[this.options.noResultsPick(p)]:S=[this.options.noResultsPick])}return e.items=S,E&&(e.activeItems=[E]),!0},b=async x=>{let D=!1,S=!1;await Promise.all([(async()=>{typeof x.mergeDelay=="number"&&(await Rg(x.mergeDelay),f.isCancellationRequested)||S||(D=v(x.picks,!0))})(),(async()=>{e.busy=!0;try{const E=await x.additionalPicks;if(f.isCancellationRequested)return;let I,R;Rj(x.picks)?(I=x.picks.items,R=x.picks.active):I=x.picks;let M,O;if(Rj(E)?(M=E.items,O=E.active):M=E,M.length>0||!D){let H;if(!R&&!O){const te=e.activeItems[0];te&&I.indexOf(te)!==-1&&(H=te)}v({items:[...I,...M],active:R||O||H})}}finally{f.isCancellationRequested||(e.busy=!1),S=!0}})()])};if(m!==null)if(_pe(m))await b(m);else if(!(m instanceof Promise))v(m);else{e.busy=!0;try{const x=await m;if(f.isCancellationRequested)return;_pe(x)?await b(x):v(x)}finally{f.isCancellationRequested||(e.busy=!1)}}};n.add(e.onDidChangeValue(()=>a())),a(),n.add(e.onDidAccept(h=>{var p;if(i!=null&&i.handleAccept){h.inBackground||e.hide(),(p=i.handleAccept)==null||p.call(i,e.activeItems[0]);return}const[f]=e.selectedItems;typeof(f==null?void 0:f.accept)=="function"&&(h.inBackground||e.hide(),f.accept(e.keyMods,h))}));const l=async(h,f)=>{var m;if(typeof f.trigger!="function")return;const p=((m=f.buttons)==null?void 0:m.indexOf(h))??-1;if(p>=0){const v=f.trigger(p,e.keyMods),b=typeof v=="number"?v:await v;if(t.isCancellationRequested)return;switch(b){case y0.NO_ACTION:break;case y0.CLOSE_PICKER:e.hide();break;case y0.REFRESH_PICKER:a();break;case y0.REMOVE_ITEM:{const y=e.items.indexOf(f);if(y!==-1){const x=e.items.slice(),D=x.splice(y,1),S=e.activeItems.filter(I=>I!==D[0]),E=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=x,S&&(e.activeItems=S),e.keepScrollPosition=E}break}}}};return n.add(e.onDidTriggerItemButton(({button:h,item:f})=>l(h,f))),n.add(e.onDidTriggerSeparatorButton(({button:h,separator:f})=>l(h,f))),n}}var Nxe=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},tm=function(s,e){return function(t,i){e(t,i,s)}},Yv,Ms,Wh;let VQ=(Wh=class extends rht{constructor(e,t,i,n,r,o){super(Yv.PREFIX,e),this.instantiationService=t,this.keybindingService=i,this.commandService=n,this.telemetryService=r,this.dialogService=o,this.commandsHistory=this._register(this.instantiationService.createInstance($Q)),this.options=e}async _getPicks(e,t,i,n){var m,v;const r=await this.getCommandPicks(i);if(i.isCancellationRequested)return[];const o=e_(()=>{const b=new BE;b.updateDocuments(r.map(x=>({key:x.commandId,textChunks:[this.getTfIdfChunk(x)]})));const y=b.calculateScores(e,i);return sht(y).filter(x=>x.score>Yv.TFIDF_THRESHOLD).slice(0,Yv.TFIDF_MAX_RESULTS)}),a=[];for(const b of r){const y=Yv.WORD_FILTER(e,b.label)??void 0,x=b.commandAlias?Yv.WORD_FILTER(e,b.commandAlias)??void 0:void 0;if(y||x)b.highlights={label:y,detail:this.options.showAlias?x:void 0},a.push(b);else if(e===b.commandId)a.push(b);else if(e.length>=3){const D=o();if(i.isCancellationRequested)return[];const S=D.find(E=>E.key===b.commandId);S&&(b.tfIdfScore=S.score,a.push(b))}}const l=new Map;for(const b of a){const y=l.get(b.label);y?(b.description=b.commandId,y.description=y.commandId):l.set(b.label,b)}a.sort((b,y)=>{if(b.tfIdfScore&&y.tfIdfScore)return b.tfIdfScore===y.tfIdfScore?b.label.localeCompare(y.label):y.tfIdfScore-b.tfIdfScore;if(b.tfIdfScore)return 1;if(y.tfIdfScore)return-1;const x=this.commandsHistory.peek(b.commandId),D=this.commandsHistory.peek(y.commandId);if(x&&D)return x>D?-1:1;if(x)return-1;if(D)return 1;if(this.options.suggestedCommandIds){const S=this.options.suggestedCommandIds.has(b.commandId),E=this.options.suggestedCommandIds.has(y.commandId);if(S&&E)return 0;if(S)return-1;if(E)return 1}return b.label.localeCompare(y.label)});const d=[];let h=!1,f=!0,p=!!this.options.suggestedCommandIds;for(let b=0;b<a.length;b++){const y=a[b];b===0&&this.commandsHistory.peek(y.commandId)&&(d.push({type:"separator",label:w("recentlyUsed","recently used")}),h=!0),f&&y.tfIdfScore!==void 0&&(d.push({type:"separator",label:w("suggested","similar commands")}),f=!1),p&&y.tfIdfScore===void 0&&!this.commandsHistory.peek(y.commandId)&&((m=this.options.suggestedCommandIds)!=null&&m.has(y.commandId))&&(d.push({type:"separator",label:w("commonlyUsed","commonly used")}),h=!0,p=!1),h&&y.tfIdfScore===void 0&&!this.commandsHistory.peek(y.commandId)&&!((v=this.options.suggestedCommandIds)!=null&&v.has(y.commandId))&&(d.push({type:"separator",label:w("morecCommands","other commands")}),h=!1),d.push(this.toCommandPick(y,n))}return this.hasAdditionalCommandPicks(e,i)?{picks:d,additionalPicks:(async()=>{var x;const b=await this.getAdditionalCommandPicks(r,a,e,i);if(i.isCancellationRequested)return[];const y=b.map(D=>this.toCommandPick(D,n));return f&&((x=y[0])==null?void 0:x.type)!=="separator"&&y.unshift({type:"separator",label:w("suggested","similar commands")}),y})()}:d}toCommandPick(e,t){if(e.type==="separator")return e;const i=this.keybindingService.lookupKeybinding(e.commandId),n=i?w("commandPickAriaLabelWithKeybinding","{0}, {1}",e.label,i.getAriaLabel()):e.label;return{...e,ariaLabel:n,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,accept:async()=>{var r;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:(t==null?void 0:t.from)??"quick open"});try{(r=e.args)!=null&&r.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(o){zc(o)||this.dialogService.error(w("canNotRun","Command '{0}' resulted in an error",e.label),r3(o))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:i}){let n=e;return t&&t!==e&&(n+=` - ${t}`),i&&i.value!==e&&(n+=` - ${i.value===i.original?i.value:`${i.value} (${i.original})`}`),n}},Yv=Wh,Wh.PREFIX=">",Wh.TFIDF_THRESHOLD=.5,Wh.TFIDF_MAX_RESULTS=5,Wh.WORD_FILTER=lte(WI,y9e,ACe),Wh);VQ=Yv=Nxe([tm(1,ut),tm(2,Mi),tm(3,on),tm(4,so),tm(5,pN)],VQ);var vu;let $Q=(vu=class extends re{constructor(e,t,i){super(),this.storageService=e,this.configurationService=t,this.logService=i,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===KI.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=Ms.getConfiguredCommandHistoryLength(this.configurationService),Ms.cache&&Ms.cache.limit!==this.configuredCommandsHistoryLength&&(Ms.cache.limit=this.configuredCommandsHistoryLength,Ms.hasChanges=!0))}load(){const e=this.storageService.get(Ms.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch(n){this.logService.error(`[CommandsHistory] invalid data: ${n}`)}const i=Ms.cache=new lf(this.configuredCommandsHistoryLength,1);if(t){let n;t.usesLRU?n=t.entries:n=t.entries.sort((r,o)=>r.value-o.value),n.forEach(r=>i.set(r.key,r.value))}Ms.counter=this.storageService.getNumber(Ms.PREF_KEY_COUNTER,0,Ms.counter)}push(e){Ms.cache&&(Ms.cache.set(e,Ms.counter++),Ms.hasChanges=!0)}peek(e){var t;return(t=Ms.cache)==null?void 0:t.peek(e)}saveState(){if(!Ms.cache||!Ms.hasChanges)return;const e={usesLRU:!0,entries:[]};Ms.cache.forEach((t,i)=>e.entries.push({key:i,value:t})),this.storageService.store(Ms.PREF_KEY_CACHE,JSON.stringify(e),0,0),this.storageService.store(Ms.PREF_KEY_COUNTER,Ms.counter,0,0),Ms.hasChanges=!1}static getConfiguredCommandHistoryLength(e){var n,r;const i=(r=(n=e.getValue().workbench)==null?void 0:n.commandPalette)==null?void 0:r.history;return typeof i=="number"?i:Ms.DEFAULT_COMMANDS_HISTORY_LENGTH}},Ms=vu,vu.DEFAULT_COMMANDS_HISTORY_LENGTH=50,vu.PREF_KEY_CACHE="commandPalette.mru.cache",vu.PREF_KEY_COUNTER="commandPalette.mru.counter",vu.counter=1,vu.hasChanges=!1,vu);$Q=Ms=Nxe([tm(0,Bd),tm(1,Gt),tm(2,qr)],$Q);class oht extends VQ{constructor(e,t,i,n,r,o){super(e,t,i,n,r,o)}getCodeEditorCommandPicks(){var i;const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const n of e.getSupportedActions()){let r;(i=n.metadata)!=null&&i.description&&(b$e(n.metadata.description)?r=n.metadata.description:r={original:n.metadata.description,value:n.metadata.description}),t.push({commandId:n.id,commandAlias:n.alias,commandDescription:r,label:gte(n.label)||n.id})}return t}}var aht=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},B1=function(s,e){return function(t,i){e(t,i,s)}};let qT=class extends oht{get activeTextEditorControl(){return this.codeEditorService.getFocusedCodeEditor()??void 0}constructor(e,t,i,n,r,o){super({showAlias:!1},e,i,n,r,o),this.codeEditorService=t}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}};qT=aht([B1(0,ut),B1(1,yi),B1(2,Mi),B1(3,on),B1(4,so),B1(5,pN)],qT);const OW=class OW extends Ze{constructor(){super({id:OW.ID,label:K4.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:U.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(Uc).quickAccess.show(qT.PREFIX)}};OW.ID="editor.action.quickCommand";let eB=OW;Pe(eB);Fn.as(Oy.Quickaccess).registerQuickAccessProvider({ctor:qT,prefix:qT.PREFIX,helpEntries:[{description:K4.quickCommandHelp,commandId:eB.ID}]});var lht=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},W1=function(s,e){return function(t,i){e(t,i,s)}};let zQ=class extends gy{constructor(e,t,i,n,r,o,a){super(!0,e,t,i,n,r,o,a)}};zQ=lht([W1(1,yt),W1(2,yi),W1(3,gs),W1(4,ut),W1(5,Bd),W1(6,Gt)],zQ);gi(gy.ID,zQ,4);class cht extends Ze{constructor(){super({id:"editor.action.toggleHighContrast",label:qK.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(ac),n=i.getColorTheme();Eu(n.type)?(i.setTheme(this._originalThemeName||(MS(n.type)?eS:ig)),this._originalThemeName=null):(i.setTheme(MS(n.type)?Fb:Bb),this._originalThemeName=n.themeName)}}Pe(cht);const dht={name:"Files",components:{FileTreeNode:Z2e},data(){return{browseResult:{current_path:"",parent_path:null,items:[]},selectedPath:"",selectedItem:null,fileContent:null,loading:!1,expandedPaths:new Set,openFiles:[],activeFile:null,fileLoading:!1,saving:!1,editor:null,originalContent:"",sidebarWidth:260,isResizing:!1,contextMenu:{visible:!1,x:0,y:0,target:null},inputDialog:{visible:!1,title:"",value:"",placeholder:"",type:"",target:null},fileIcons:{js:"fa-brands fa-js text-yellow-400",ts:"fa-brands fa-js text-blue-400",html:"fa-brands fa-html5 text-orange-500",css:"fa-brands fa-css3 text-blue-400",scss:"fa-brands fa-sass text-pink-400",json:"fa-solid fa-file-code text-yellow-300",yaml:"fa-solid fa-file-code text-blue-300",yml:"fa-solid fa-file-code text-blue-300",md:"fa-solid fa-file-lines text-gray-400",py:"fa-brands fa-python text-blue-500",vue:"fa-brands fa-vuejs text-green-400",sh:"fa-solid fa-terminal text-green-400",go:"fa-brands fa-golang text-cyan-400",rs:"fa-brands fa-rust text-orange-400"}}},computed:{fileTreeData(){return this.browseResult.items.map(e=>this.transformNode(e)).sort((e,t)=>e.is_directory===t.is_directory?e.name.localeCompare(t.name):e.is_directory?-1:1)},hasChanges(){return this.editor?this.editor.getValue()!==this.originalContent:!1},isBinaryFile(){var s;return(s=this.activeFile)==null?void 0:s.is_binary}},watch:{activeFile:{immediate:!0,handler(s){this.$nextTick(()=>{!this.editor&&this.$refs.editorContainer&&this.initEditor(),s&&this.editor?this.loadFileContent(s.path).then(e=>{const t=this.getLanguageFromFilename(s.name),i=mF.createModel(e,t);this.editor.setModel(i),this.originalContent=e}):this.editor&&(this.editor.setModel(mF.createModel("","plaintext")),this.originalContent="")})}}},async created(){await this.browse(""),document.addEventListener("click",this.hideContextMenu),document.addEventListener("mousemove",this.handleResize),document.addEventListener("mouseup",this.stopResize)},activated(){!this.editor&&this.$refs.editorContainer&&this.initEditor()},beforeDestroy(){document.removeEventListener("click",this.hideContextMenu),document.removeEventListener("mousemove",this.handleResize),document.removeEventListener("mouseup",this.stopResize),this.editor&&(this.editor.dispose(),this.editor=null)},methods:{async browse(s){this.loading=!0;try{const e=await zn.browseFilesystem(s);this.browseResult=e.data}catch(e){console.error("Browse failed:",e)}finally{this.loading=!1}},transformNode(s){return{name:s.name,path:s.path,is_directory:s.is_directory,is_drive:s.is_drive||!1,size:s.size,has_children:s.is_directory,expanded:!1,children:[]}},handleSelect(s){this.selectedPath=s.path,this.selectedItem=s},async openFile(s){var t;if(s.is_directory)return;const e=this.openFiles.find(i=>i.path===s.path);if(e){this.activeFile=e;return}this.fileLoading=!0;try{const i=await this.loadFileContent(s.path),n={name:s.name,path:s.path,is_binary:((t=this.fileContent)==null?void 0:t.is_binary)||!1};this.openFiles.push(n),this.activeFile=n}catch(i){console.error("Open file failed:",i)}finally{this.fileLoading=!1}},closeFile(s){var t;const e=this.openFiles.findIndex(i=>i.path===s.path);if(this.openFiles=this.openFiles.filter(i=>i.path!==s.path),((t=this.activeFile)==null?void 0:t.path)===s.path){const i=e>0?e-1:0;this.activeFile=this.openFiles.length>0?this.openFiles[Math.min(i,this.openFiles.length-1)]:null}},async saveFile(){if(!(!this.activeFile||!this.hasChanges)){this.saving=!0;try{const s=this.editor.getValue();await zn.writeFile(this.activeFile.path,s),this.originalContent=s,this.$message.success("文件已保存")}catch(s){console.error("Save file failed:",s),this.$message.error("保存文件失败")}finally{this.saving=!1}}},async handleLoadChildren({path:s,callback:e}){try{const n=((await zn.browseFilesystem(s)).data.items||[]).map(r=>this.transformNode(r)).sort((r,o)=>r.is_directory===o.is_directory?r.name.localeCompare(o.name):r.is_directory?-1:1);e(n)}catch(t){console.error("Load children failed:",t),e([])}},goUp(){this.browseResult.parent_path!==null&&this.browse(this.browseResult.parent_path===""?"":this.browseResult.parent_path)},goHome(){this.browse("")},refresh(){this.browse(this.browseResult.current_path||"")},async loadFileContent(s){try{const e=await zn.getFileContent(s);return this.fileContent=e,e.content||""}catch(e){return console.error("Load file content failed:",e),this.fileContent={content:"加载失败",is_binary:!1,size:0},""}},startResize(s){this.isResizing=!0,document.body.style.cursor="col-resize",document.body.style.userSelect="none"},handleResize(s){if(!this.isResizing)return;const e=s.clientX;e>=150&&e<=500&&(this.sidebarWidth=e)},stopResize(){this.isResizing=!1,document.body.style.cursor="",document.body.style.userSelect=""},showContextMenu(s,e){e&&(s.preventDefault(),this.contextMenu={visible:!0,x:s.pageX,y:s.pageY,target:e},this.selectedItem=e,this.selectedPath=e.path)},hideContextMenu(){this.contextMenu.visible=!1},async createNewFile(){this.hideContextMenu(),this.inputDialog={visible:!0,title:"新建文件",value:"",placeholder:"输入文件名",type:"file",target:this.contextMenu.target},this.$nextTick(()=>{var s;(s=this.$refs.renameInput)==null||s.focus()})},async createNewFolder(){this.hideContextMenu(),this.inputDialog={visible:!0,title:"新建文件夹",value:"",placeholder:"输入文件夹名",type:"folder",target:this.contextMenu.target},this.$nextTick(()=>{var s;(s=this.$refs.renameInput)==null||s.focus()})},copyPath(){this.hideContextMenu(),navigator.clipboard.writeText(this.contextMenu.target.path),this.$message.success("路径已复制")},renameItem(){this.hideContextMenu(),this.inputDialog={visible:!0,title:"重命名",value:this.contextMenu.target.name,placeholder:"输入新名称",type:"rename",target:this.contextMenu.target},this.$nextTick(()=>{var s,e;(s=this.$refs.renameInput)==null||s.focus(),(e=this.$refs.renameInput)==null||e.select()})},async confirmInput(){const{type:s,value:e,target:t}=this.inputDialog;if(!e.trim()){this.cancelInput();return}try{if(s==="file"){const i=t.path+"\\"+e.trim();await zn.writeFile(i,"")}else if(s==="folder"){const i=t.path+"\\"+e.trim();await zn.createDirectory(i)}else s==="rename"&&await zn.renameFile(t.path,e.trim());this.refresh()}catch(i){console.error("Operation failed:",i),this.$message.error("操作失败")}this.inputDialog.visible=!1},cancelInput(){this.inputDialog.visible=!1},async deleteItem(){this.hideContextMenu();try{await this.$confirm(`确定要删除 "${this.contextMenu.target.name}" 吗?`,"确认删除",{confirmButtonText:"删除",cancelButtonText:"取消",type:"warning"}),await zn.deleteFile(this.contextMenu.target.path),this.$message.success("删除成功"),this.refresh()}catch(s){s!=="cancel"&&(console.error("Delete failed:",s),this.$message.error("删除失败"))}},initEditor(){this.editor||this.$refs.editorContainer&&(this.editor=mF.create(this.$refs.editorContainer,{value:"",language:"plaintext",theme:"vs-dark",automaticLayout:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:14,fontFamily:'Consolas, Monaco, "Courier New", monospace',lineNumbers:"on",roundedSelection:!1,scrollbar:{useShadows:!1,verticalHasArrows:!1,horizontalHasArrows:!1,vertical:"auto",horizontal:"auto"}}),this.editor.onDidChangeModelContent(()=>{this.$forceUpdate()}),this.editor.addCommand(F1e.CtrlCmd|A1e.KeyS,()=>{this.saveFile()}))},getFileIcon(s){const e=s.split(".").pop().toLowerCase(),t=s.toLowerCase();return t==="dockerfile"?"fa-brands fa-docker text-blue-400":t===".gitignore"?"fa-brands fa-git text-red-400":t.startsWith("readme")?this.fileIcons.md:this.fileIcons[e]||"fa-solid fa-file text-gray-400"},getLanguageFromFilename(s){const e=s.split(".").pop().toLowerCase();return{js:"javascript",ts:"typescript",html:"html",css:"css",scss:"scss",vue:"html",py:"python",md:"markdown",json:"json",yaml:"yaml",yml:"yaml",xml:"xml",sql:"sql",sh:"shell",go:"go",rs:"rust"}[e]||"plaintext"}}};var uht=function(){var i;var e=this,t=e._self._c;return t("div",{staticClass:"flex-1 flex overflow-hidden"},[t("aside",{staticClass:"bg-sidebar border-r border-border flex flex-col shrink-0",style:{width:e.sidebarWidth+"px"}},[e._m(0),t("div",{staticClass:"flex items-center gap-1 px-2 py-2 border-b border-border"},[t("button",{staticClass:"p-1 text-textMuted hover:text-white disabled:opacity-30 disabled:cursor-not-allowed",attrs:{disabled:!e.browseResult.parent_path&&e.browseResult.parent_path!=="",title:"上级目录"},on:{click:e.goUp}},[t("i",{staticClass:"fa-solid fa-arrow-up"})]),t("button",{staticClass:"p-1 text-textMuted hover:text-white",attrs:{title:"刷新"},on:{click:e.refresh}},[t("i",{staticClass:"fa-solid fa-refresh"})]),t("button",{staticClass:"p-1 text-textMuted hover:text-white",attrs:{title:"我的电脑"},on:{click:e.goHome}},[t("i",{staticClass:"fa-solid fa-home"})])]),t("div",{staticClass:"flex-1 overflow-y-auto py-1 sidebar-scroll"},[e.loading?t("div",{staticClass:"flex items-center justify-center py-8 text-textMuted"},[t("i",{staticClass:"fa-solid fa-spinner fa-spin mr-2"}),e._v(" 加载中... ")]):e.fileTreeData.length===0?t("div",{staticClass:"flex items-center justify-center py-8 text-textMuted text-sm"},[e._v(" 此目录为空 ")]):e._l(e.fileTreeData,function(n){return t("file-tree-node",{key:n.path,attrs:{node:n,level:0,"selected-path":e.selectedPath},on:{select:e.handleSelect,"open-file":e.openFile,"load-children":e.handleLoadChildren,contextmenu:e.showContextMenu}})})],2),t("div",{directives:[{name:"show",rawName:"v-show",value:e.contextMenu.visible,expression:"contextMenu.visible"}],staticClass:"fixed bg-sidebar border border-border rounded shadow-lg py-1 z-50 min-w-[160px]",style:{left:e.contextMenu.x+"px",top:e.contextMenu.y+"px"}},[(i=e.contextMenu.target)!=null&&i.is_directory?[t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.copyPath}},[t("i",{staticClass:"fa-solid fa-copy text-xs"}),e._v(" 复制路径 ")]),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.createNewFile}},[t("i",{staticClass:"fa-solid fa-file-lines text-xs"}),e._v(" 新建文件 ")]),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.createNewFolder}},[t("i",{staticClass:"fa-solid fa-folder-plus text-xs"}),e._v(" 新建文件夹 ")]),t("div",{staticClass:"border-t border-border my-1"}),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.renameItem}},[t("i",{staticClass:"fa-solid fa-pen text-xs"}),e._v(" 重命名 ")]),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-red-400 hover:bg-active flex items-center gap-2",on:{click:e.deleteItem}},[t("i",{staticClass:"fa-solid fa-trash text-xs"}),e._v(" 删除 ")])]:[t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.copyPath}},[t("i",{staticClass:"fa-solid fa-copy text-xs"}),e._v(" 复制路径 ")]),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.renameItem}},[t("i",{staticClass:"fa-solid fa-pen text-xs"}),e._v(" 重命名 ")]),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-red-400 hover:bg-active flex items-center gap-2",on:{click:e.deleteItem}},[t("i",{staticClass:"fa-solid fa-trash text-xs"}),e._v(" 删除 ")])]],2),t("div",{directives:[{name:"show",rawName:"v-show",value:e.inputDialog.visible,expression:"inputDialog.visible"}],staticClass:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",on:{click:function(n){return n.target!==n.currentTarget?null:e.cancelInput.apply(null,arguments)}}},[t("div",{staticClass:"bg-sidebar border border-border rounded p-4 w-80"},[t("p",{staticClass:"text-white text-sm mb-3"},[e._v(e._s(e.inputDialog.title))]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.inputDialog.value,expression:"inputDialog.value"}],ref:"renameInput",staticClass:"w-full px-3 py-2 bg-[#1e1e1e] border border-border rounded text-white text-sm focus:outline-none focus:border-accent",attrs:{placeholder:e.inputDialog.placeholder},domProps:{value:e.inputDialog.value},on:{keyup:[function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"enter",13,n.key,"Enter")?null:e.confirmInput.apply(null,arguments)},function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"escape",void 0,n.key,void 0)?null:e.cancelInput.apply(null,arguments)}],input:function(n){n.target.composing||e.$set(e.inputDialog,"value",n.target.value)}}}),t("div",{staticClass:"flex justify-end gap-2 mt-4"},[t("button",{staticClass:"px-3 py-1 text-xs text-textMuted hover:text-white",on:{click:e.cancelInput}},[e._v("取消")]),t("button",{staticClass:"px-3 py-1 text-xs bg-accent text-white rounded hover:bg-blue-600",on:{click:e.confirmInput}},[e._v("确定")])])])])]),t("div",{staticClass:"w-1 bg-border hover:bg-accent cursor-col-resize transition-colors",on:{mousedown:e.startResize}}),t("main",{staticClass:"flex-1 flex flex-col min-w-0 bg-[#1e1e1e]"},[t("div",{staticClass:"flex border-b border-border bg-sidebar overflow-x-auto"},e._l(e.openFiles,function(n){var r;return t("div",{key:n.path,staticClass:"flex items-center gap-2 px-3 py-2 cursor-pointer border-r border-border",class:((r=e.activeFile)==null?void 0:r.path)===n.path?"bg-[#1e1e1e] text-white border-t-2 border-t-accent":"text-textMuted hover:bg-[#2a2a2a]",on:{click:function(o){e.activeFile=n}}},[t("i",{staticClass:"text-xs",class:e.getFileIcon(n.name)}),t("span",{staticClass:"text-xs"},[e._v(e._s(n.name))]),t("button",{staticClass:"ml-2 hover:text-white text-textMuted",on:{click:function(o){return o.stopPropagation(),e.closeFile(n)}}},[t("i",{staticClass:"fa-solid fa-times text-[10px]"})])])}),0),t("div",{staticClass:"flex-1 overflow-hidden"},[e.activeFile?e.fileLoading?t("div",{staticClass:"flex items-center justify-center h-full text-textMuted"},[t("i",{staticClass:"fa-solid fa-spinner fa-spin mr-2"}),e._v(" 加载中... ")]):e.isBinaryFile?t("div",{staticClass:"flex items-center justify-center h-full text-textMuted"},[e._m(1)]):e._e():t("div",{staticClass:"text-textMuted text-center mt-20"},[t("i",{staticClass:"fa-solid fa-file-code text-6xl mb-4 opacity-20"}),t("p",[e._v("双击左侧文件打开编辑器")])]),t("div",{directives:[{name:"show",rawName:"v-show",value:e.activeFile&&!e.isBinaryFile,expression:"activeFile && !isBinaryFile"}],ref:"editorContainer",staticClass:"monaco-editor-container"})]),e.activeFile&&!e.isBinaryFile?t("div",{staticClass:"h-8 bg-sidebar border-t border-border flex items-center justify-between px-3"},[t("div",{staticClass:"flex items-center gap-4 text-xs text-textMuted"},[t("span",[e._v(e._s(e.activeFile.path))]),e.hasChanges?t("span",{staticClass:"text-yellow-500"},[e._v("已修改")]):e._e()]),t("div",{staticClass:"flex items-center gap-2"},[t("button",{staticClass:"px-3 py-1 text-xs bg-primary hover:bg-blue-600 disabled:opacity-50 disabled:cursor-not-allowed text-white rounded",attrs:{disabled:!e.hasChanges||e.saving},on:{click:e.saveFile}},[e.saving?t("i",{staticClass:"fa-solid fa-spinner fa-spin mr-1"}):t("i",{staticClass:"fa-solid fa-save mr-1"}),e._v(" 保存 ")])])]):e._e()])])},hht=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"flex border-b border-border text-xs uppercase font-bold text-textMuted"},[e("div",{staticClass:"px-4 py-2 border-b-2 border-accent text-white flex items-center gap-2"},[e("i",{staticClass:"fa-solid fa-folder-open"}),s._v(" Explorer ")])])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"text-center"},[e("i",{staticClass:"fa-solid fa-file text-4xl mb-4 opacity-30"}),e("p",[s._v("二进制文件无法预览")])])}],fht=Da(dht,uht,hht,!1,null,"5dac233a");const ght=fht.exports,pht={name:"Skills",data(){return{subTab:"project",skills:[],systemSkills:[]}},async created(){await this.loadSkills()},methods:{async loadSkills(){try{const s=await zn.getSkills();this.skills=s.data||[],this.systemSkills=[]}catch(s){console.error("加载技能失败:",s),this.skills=[],this.systemSkills=[]}}}};var mht=function(){var e=this,t=e._self._c;return t("div",{staticClass:"flex-1 flex overflow-hidden"},[t("aside",{staticClass:"w-[220px] bg-sidebar border-r border-border flex flex-col shrink-0 py-4"},[e._m(0),t("div",{staticClass:"flex-1 overflow-y-auto"},[t("div",{staticClass:"px-4 py-1 text-xs font-bold text-textMuted uppercase mt-2"},[e._v("Configuration")]),t("button",{staticClass:"w-full text-left px-4 py-2 flex items-center gap-2",class:e.subTab==="project"?"bg-active text-white border-l-2 border-accent":"text-textMuted hover:text-white hover:bg-white/5 border-l-2 border-transparent",on:{click:function(i){e.subTab="project"}}},[t("i",{staticClass:"fa-solid fa-folder-tree w-4 text-center"}),e._v(" Project Skills ")]),t("button",{staticClass:"w-full text-left px-4 py-2 flex items-center gap-2",class:e.subTab==="system"?"bg-active text-white border-l-2 border-accent":"text-textMuted hover:text-white hover:bg-white/5 border-l-2 border-transparent",on:{click:function(i){e.subTab="system"}}},[t("i",{staticClass:"fa-solid fa-globe w-4 text-center"}),e._v(" System Skills ")])])]),t("main",{staticClass:"flex-1 flex flex-col bg-[#1e1e1e] min-w-0"},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.subTab==="project",expression:"subTab === 'project'"}],staticClass:"flex-1 p-6 overflow-y-auto"},[t("div",{staticClass:"max-w-4xl mx-auto"},[e._m(1),e.skills.length===0?t("div",{staticClass:"text-center text-textMuted py-10"},[t("i",{staticClass:"fa-solid fa-shapes text-4xl mb-4 opacity-30"}),t("p",[e._v("暂无项目 Skills")])]):t("div",{staticClass:"space-y-3"},e._l(e.skills,function(i){return t("div",{key:i.name,staticClass:"bg-sidebar border border-border p-4 rounded flex justify-between items-start hover:border-accent group"},[t("div",{staticClass:"flex gap-4"},[e._m(2,!0),t("div",[t("h4",{staticClass:"text-white font-bold text-sm"},[e._v(e._s(i.name))]),t("p",{staticClass:"text-textMuted text-xs h-10 overflow-hidden mt-1"},[e._v(e._s(i.description))])])])])}),0)])]),t("div",{directives:[{name:"show",rawName:"v-show",value:e.subTab==="system",expression:"subTab === 'system'"}],staticClass:"flex-1 p-6 overflow-y-auto"},[t("h3",{staticClass:"text-2xl text-white font-light mb-6"},[e._v("System Skills")]),e.systemSkills.length===0?t("div",{staticClass:"text-center text-textMuted py-10"},[t("i",{staticClass:"fa-solid fa-shapes text-4xl mb-4 opacity-30"}),t("p",[e._v("暂无系统 Skills")])]):t("div",{staticClass:"grid grid-cols-2 lg:grid-cols-3 gap-3"},e._l(e.systemSkills,function(i){return t("label",{key:i.name,staticClass:"bg-sidebar border border-border p-3 rounded flex items-center gap-3 cursor-pointer hover:bg-active"},[t("input",{staticClass:"accent-accent",attrs:{type:"checkbox"},domProps:{checked:i.enabled}}),t("span",{staticClass:"text-sm text-textMain"},[e._v(e._s(i.name))])])}),0)])])])},_ht=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"px-4 mb-4"},[e("h2",{staticClass:"text-white font-bold text-lg mb-1"},[s._v("Skills")]),e("input",{staticClass:"w-full bg-black/20 border border-border rounded px-2 py-1 text-xs",attrs:{type:"text",placeholder:"Filter..."}})])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"flex justify-between items-center mb-6"},[e("div",[e("h3",{staticClass:"text-2xl text-white font-light"},[s._v("Project Skills")]),e("p",{staticClass:"text-textMuted text-xs mt-1"},[s._v(" Skills specific to your project ")])])])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"w-10 h-10 rounded flex items-center justify-center text-xl bg-purple-900/30 text-purple-400"},[e("i",{staticClass:"fa-solid fa-shapes"})])}],vht=Da(pht,mht,_ht,!1,null,null);const bht=vht.exports,Cht={name:"DbView",data(){return{tables:[],selectedTable:null,tableInfo:{},tableData:{columns:[],rows:[]},page:1,pageSize:50,totalPages:1,loading:!1}},async created(){await this.loadTables()},methods:{async loadTables(){this.loading=!0;try{const s=await zn.getDbTables();this.tables=s.tables||[]}catch(s){console.error("Load tables failed:",s),this.tables=[]}finally{this.loading=!1}},async selectTable(s){this.selectedTable=s,this.page=1,await this.loadTableInfo(),await this.loadTableData()},async loadTableInfo(){if(this.selectedTable)try{this.tableInfo=await zn.getTableInfo(this.selectedTable),this.totalPages=Math.max(1,Math.ceil((this.tableInfo.row_count||0)/this.pageSize))}catch(s){console.error("Load table info failed:",s),this.tableInfo={}}},async loadTableData(){if(this.selectedTable)try{this.tableData=await zn.getTableData(this.selectedTable,this.page,this.pageSize)}catch(s){console.error("Load table data failed:",s),this.tableData={columns:[],rows:[]}}},async prevPage(){this.page>1&&(this.page--,await this.loadTableData())},async nextPage(){this.page<this.totalPages&&(this.page++,await this.loadTableData())},formatCell(s){return s===null?"<null>":s===void 0?"":typeof s=="boolean"?s?"true":"false":typeof s=="object"?JSON.stringify(s):String(s)}}};var yht=function(){var e=this,t=e._self._c;return t("div",{staticClass:"flex-1 flex overflow-hidden"},[t("aside",{staticClass:"w-[260px] bg-sidebar border-r border-border flex flex-col shrink-0"},[e._m(0),t("div",{staticClass:"flex items-center gap-1 px-2 py-2 border-b border-border"},[t("button",{staticClass:"p-1 text-textMuted hover:text-white",attrs:{title:"刷新"},on:{click:e.loadTables}},[t("i",{staticClass:"fa-solid fa-refresh"})])]),t("div",{staticClass:"flex-1 overflow-y-auto py-1"},[e.loading?t("div",{staticClass:"flex items-center justify-center py-8 text-textMuted"},[t("i",{staticClass:"fa-solid fa-spinner fa-spin mr-2"}),e._v(" 加载中... ")]):e.tables.length===0?t("div",{staticClass:"flex items-center justify-center py-8 text-textMuted text-sm"},[e._v(" 暂无表 ")]):t("div",e._l(e.tables,function(i){return t("div",{key:i,staticClass:"flex items-center gap-2 px-3 py-1.5 cursor-pointer text-sm",class:e.selectedTable===i?"bg-active text-white border-l-2 border-accent":"text-textMuted hover:text-white hover:bg-white/5 border-l-2 border-transparent",on:{click:function(n){return e.selectTable(i)}}},[t("i",{staticClass:"fa-solid fa-table text-textMuted text-xs"}),t("span",{staticClass:"truncate"},[e._v(e._s(i))])])}),0)])]),t("main",{staticClass:"flex-1 flex flex-col min-w-0 bg-[#1e1e1e]"},[e.selectedTable?t("div",{staticClass:"flex-1 flex flex-col overflow-hidden"},[t("div",{staticClass:"flex items-center justify-between px-4 py-2 border-b border-border bg-sidebar"},[t("div",{staticClass:"flex items-center gap-2"},[t("i",{staticClass:"fa-solid fa-table text-textMuted"}),t("span",{staticClass:"text-sm text-white"},[e._v(e._s(e.selectedTable))]),t("span",{staticClass:"text-xs text-textMuted"},[e._v("("+e._s(e.tableInfo.row_count||0)+" 行)")])]),t("div",{staticClass:"flex items-center gap-2"},[t("button",{staticClass:"px-2 py-1 text-xs text-textMuted hover:text-white disabled:opacity-30 disabled:cursor-not-allowed",attrs:{disabled:e.page<=1},on:{click:e.prevPage}},[t("i",{staticClass:"fa-solid fa-chevron-left"})]),t("span",{staticClass:"text-xs text-textMuted"},[e._v(e._s(e.page)+" / "+e._s(e.totalPages||1))]),t("button",{staticClass:"px-2 py-1 text-xs text-textMuted hover:text-white disabled:opacity-30 disabled:cursor-not-allowed",attrs:{disabled:e.page>=e.totalPages},on:{click:e.nextPage}},[t("i",{staticClass:"fa-solid fa-chevron-right"})])])]),t("div",{staticClass:"flex-1 overflow-auto"},[t("table",{staticClass:"w-full text-sm"},[t("thead",{staticClass:"bg-sidebar sticky top-0"},[t("tr",e._l(e.tableInfo.columns,function(i){return t("th",{key:i.name,staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[e._v(" "+e._s(i.name)+" "),t("span",{staticClass:"text-xs font-normal text-textMuted opacity-60 ml-1"},[e._v(e._s(i.type))])])}),0)]),t("tbody",[e._l(e.tableData.rows,function(i,n){return t("tr",{key:n,staticClass:"hover:bg-white/5"},e._l(e.tableInfo.columns,function(r){return t("td",{key:r.name,staticClass:"px-3 py-1.5 text-gray-300 border-b border-border/30"},[e._v(" "+e._s(e.formatCell(i[r.name]))+" ")])}),0)}),e.tableData.rows&&e.tableData.rows.length===0?t("tr",[t("td",{staticClass:"px-3 py-8 text-center text-textMuted",attrs:{colspan:e.tableInfo.columns?e.tableInfo.columns.length:0}},[e._v(" 表中无数据 ")])]):e._e()],2)])])]):t("div",{staticClass:"flex-1 flex items-center justify-center text-textMuted"},[e._m(1)])])])},wht=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"flex border-b border-border text-xs uppercase font-bold text-textMuted"},[e("div",{staticClass:"px-4 py-2 border-b-2 border-accent text-white flex items-center gap-2"},[e("i",{staticClass:"fa-solid fa-database"}),s._v(" Tables ")])])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"text-center"},[e("i",{staticClass:"fa-solid fa-database text-6xl mb-4 opacity-20"}),e("p",[s._v("选择表查看数据")])])}],Sht=Da(Cht,yht,wht,!1,null,null);const xht=Sht.exports;Ds.use(V_e);const kht=[{path:"/",component:()=>at(()=>import("./Layout-WWXhjQI7.js"),[]),redirect:"/codeView",children:[{path:"codeView",name:"codeView",component:Kle},{path:"codeView/:id",name:"codeView-session",component:Kle},{path:"files",name:"files",component:ght},{path:"skills",name:"skills",component:bht},{path:"terminal",name:"terminal",component:()=>at(()=>import("./TerminalView-qS_Sznel.js"),__vite__mapDeps([2,3]))},{path:"terminal/:id",name:"terminal-session",component:()=>at(()=>import("./TerminalView-qS_Sznel.js"),__vite__mapDeps([2,3]))},{path:"db",name:"db",component:xht},{path:"aiLogs",name:"aiLogs",component:()=>at(()=>import("./AiLogsView-rdisKFSa.js"),[])},{path:"tasks",name:"tasks",component:()=>at(()=>import("./TasksView-vUyC5Nlz.js"),[])},{path:"devWorkflow",name:"devWorkflow",component:()=>at(()=>import("./DevWorkflowView-CV7LEFE2.js"),__vite__mapDeps([4,5]))},{path:"settings",name:"settings",component:U2e}]}],Lht=new V_e({mode:"history",routes:kht});Ds.use(ZPe);Ds.prototype.$api=zn;Ds.config.productionTip=!1;new Ds({router:Lht,render:s=>s(tOe)}).$mount("#app");export{m2e as C,o2e as F,u2e as M,zn as a,Jn as g,ON as m,Da as n,t0e as t};
|