@chillicream/nitro-embedded 31.0.0-insider.9 → 31.0.1
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/assets/context-providers.fa746e77.CXbaWQgS.js +4070 -0
- package/assets/{editor.worker.084a9f25.tAuf3ElJ.js → editor.worker.fa746e77.T3jfs7I_.js} +1 -1
- package/assets/{graphql-engine-scheduler.084a9f25.CrStG3-_.js → graphql-engine-scheduler.fa746e77.-g39bcA0.js} +3 -3
- package/assets/{graphql-indexer-scheduler.084a9f25.pRr9sR2w.js → graphql-indexer-scheduler.fa746e77.DvjugicW.js} +3 -3
- package/assets/{graphql.worker.084a9f25.BdylJnf4.js → graphql.worker.fa746e77.BHlWOXYy.js} +3 -3
- package/assets/index.fa746e77.CTj-pcce.js +32 -0
- package/assets/{json.worker.084a9f25.DEVuungC.js → json.worker.fa746e77.CxIAIyle.js} +1 -1
- package/assets/{jsonMode.084a9f25.B_uJlunI.js → jsonMode.fa746e77.DT27TKkD.js} +1 -1
- package/assets/{main.084a9f25.DAufo_uq.js → main.fa746e77.Cy14iHt3.js} +179 -180
- package/assets/{monaco.084a9f25.BBbaQf83.js → monaco.fa746e77.BD9eCg41.js} +4 -4
- package/assets/{monaco.084a9f25.C2s3cfsW.css → monaco.fa746e77.Bgr_ZGqO.css} +1 -1
- package/assets/{monaco.084a9f25.CrNKR78D.css → monaco.fa746e77.DSc437aS.css} +1 -1
- package/assets/{session-scheduler.084a9f25.CaLOp_9f.js → session-scheduler.fa746e77.CvMSHioz.js} +3 -3
- package/assets/{yaml.084a9f25.JJQ5jvvQ.js → yaml.fa746e77.CUpalURV.js} +1 -1
- package/assets/{yaml.worker.084a9f25.DyH8-fwy.js → yaml.worker.fa746e77.CY43AHj0.js} +1 -1
- package/favicon.ico +0 -0
- package/favicon.svg +4 -4
- package/index.html +4 -4
- package/package.json +2 -3
- package/service-worker.js +1 -1
- package/assets/context-providers.084a9f25.BKmArcBB.js +0 -3992
- package/assets/index.084a9f25.DTXLQ-vU.js +0 -32
- /package/assets/{FiraCode-Medium.084a9f25.-YTCSZkP.woff2 → FiraCode-Medium.fa746e77.-YTCSZkP.woff2} +0 -0
- /package/assets/{codicon.084a9f25.Hscy-R9e.ttf → codicon.fa746e77.Hscy-R9e.ttf} +0 -0
- /package/assets/{context-providers.084a9f25.3HkX5s82.css → context-providers.fa746e77.3HkX5s82.css} +0 -0
- /package/assets/{main.084a9f25.BdMtxJz7.css → main.fa746e77.BdMtxJz7.css} +0 -0
- /package/assets/{monaco.084a9f25.BlDt3VK5.js → monaco.fa746e77.Berr_lG6.js} +0 -0
- /package/assets/{monaco.084a9f25.DryBubT0.js → monaco.fa746e77.Br8woclc.js} +0 -0
- /package/assets/{monaco.084a9f25.NPd0By-o.js → monaco.fa746e77.C81nzcW9.js} +0 -0
- /package/assets/{monaco.084a9f25.BVNzLRbF.js → monaco.fa746e77.vcoSoN6S.js} +0 -0
- /package/assets/{monaco.084a9f25.CQQVOLe-.js → monaco.fa746e77.wPd_MMVI.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
function VV(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var l3={exports:{}},Sn=l3.exports={},Sa,ya;function DD(){throw new Error("setTimeout has not been defined")}function kD(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Sa=setTimeout:Sa=DD}catch{Sa=DD}try{typeof clearTimeout=="function"?ya=clearTimeout:ya=kD}catch{ya=kD}})();function d3(o){if(Sa===setTimeout)return setTimeout(o,0);if((Sa===DD||!Sa)&&setTimeout)return Sa=setTimeout,setTimeout(o,0);try{return Sa(o,0)}catch{try{return Sa.call(null,o,0)}catch{return Sa.call(this,o,0)}}}function HV(o){if(ya===clearTimeout)return clearTimeout(o);if((ya===kD||!ya)&&clearTimeout)return ya=clearTimeout,clearTimeout(o);try{return ya(o)}catch{try{return ya.call(null,o)}catch{return ya.call(this,o)}}}var Gl=[],pf=!1,Zh,wC=-1;function zV(){!pf||!Zh||(pf=!1,Zh.length?Gl=Zh.concat(Gl):wC=-1,Gl.length&&c3())}function c3(){if(!pf){var o=d3(zV);pf=!0;for(var e=Gl.length;e;){for(Zh=Gl,Gl=[];++wC<e;)Zh&&Zh[wC].run();wC=-1,e=Gl.length}Zh=null,pf=!1,HV(o)}}Sn.nextTick=function(o){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];Gl.push(new h3(o,e)),Gl.length===1&&!pf&&d3(c3)};function h3(o,e){this.fun=o,this.array=e}h3.prototype.run=function(){this.fun.apply(null,this.array)};Sn.title="browser";Sn.browser=!0;Sn.env={};Sn.argv=[];Sn.version="";Sn.versions={};function _d(){}Sn.on=_d;Sn.addListener=_d;Sn.once=_d;Sn.off=_d;Sn.removeListener=_d;Sn.removeAllListeners=_d;Sn.emit=_d;Sn.prependListener=_d;Sn.prependOnceListener=_d;Sn.listeners=function(o){return[]};Sn.binding=function(o){throw new Error("process.binding is not supported")};Sn.cwd=function(){return"/"};Sn.chdir=function(o){throw new Error("process.chdir is not supported")};Sn.umask=function(){return 0};var UV=l3.exports;const Hg=VV(UV),$V="modulepreload",KV=function(o,e){return new URL(o,e).href},hA={},u3=function(e,t,i){let n=Promise.resolve();if(t&&t.length>0){let d=function(c){return Promise.all(c.map(h=>Promise.resolve(h).then(u=>({status:"fulfilled",value:u}),u=>({status:"rejected",reason:u}))))};const r=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),l=a?.nonce||a?.getAttribute("nonce");n=d(t.map(c=>{if(c=KV(c,i),c in hA)return;hA[c]=!0;const h=c.endsWith(".css"),u=h?'[rel="stylesheet"]':"";if(!!i)for(let m=r.length-1;m>=0;m--){const _=r[m];if(_.href===c&&(!h||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${u}`))return;const f=document.createElement("link");if(f.rel=h?"stylesheet":$V,h||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),h)return new Promise((m,_)=>{f.addEventListener("load",m),f.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(r){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=r,window.dispatchEvent(a),!a.defaultPrevented)throw r}return n.then(r=>{for(const a of r||[])a.status==="rejected"&&s(a.reason);return e().catch(s)})};var PT={},dS={};dS.byteLength=GV;dS.toByteArray=YV;dS.fromByteArray=JV;var Ta=[],sr=[],jV=typeof Uint8Array<"u"?Uint8Array:Array,SL="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var pg=0,qV=SL.length;pg<qV;++pg)Ta[pg]=SL[pg],sr[SL.charCodeAt(pg)]=pg;sr[45]=62;sr[95]=63;function g3(o){var e=o.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=o.indexOf("=");t===-1&&(t=e);var i=t===e?0:4-t%4;return[t,i]}function GV(o){var e=g3(o),t=e[0],i=e[1];return(t+i)*3/4-i}function ZV(o,e,t){return(e+t)*3/4-t}function YV(o){var e,t=g3(o),i=t[0],n=t[1],s=new jV(ZV(o,i,n)),r=0,a=n>0?i-4:i,l;for(l=0;l<a;l+=4)e=sr[o.charCodeAt(l)]<<18|sr[o.charCodeAt(l+1)]<<12|sr[o.charCodeAt(l+2)]<<6|sr[o.charCodeAt(l+3)],s[r++]=e>>16&255,s[r++]=e>>8&255,s[r++]=e&255;return n===2&&(e=sr[o.charCodeAt(l)]<<2|sr[o.charCodeAt(l+1)]>>4,s[r++]=e&255),n===1&&(e=sr[o.charCodeAt(l)]<<10|sr[o.charCodeAt(l+1)]<<4|sr[o.charCodeAt(l+2)]>>2,s[r++]=e>>8&255,s[r++]=e&255),s}function XV(o){return Ta[o>>18&63]+Ta[o>>12&63]+Ta[o>>6&63]+Ta[o&63]}function QV(o,e,t){for(var i,n=[],s=e;s<t;s+=3)i=(o[s]<<16&16711680)+(o[s+1]<<8&65280)+(o[s+2]&255),n.push(XV(i));return n.join("")}function JV(o){for(var e,t=o.length,i=t%3,n=[],s=16383,r=0,a=t-i;r<a;r+=s)n.push(QV(o,r,r+s>a?a:r+s));return i===1?(e=o[t-1],n.push(Ta[e>>2]+Ta[e<<4&63]+"==")):i===2&&(e=(o[t-2]<<8)+o[t-1],n.push(Ta[e>>10]+Ta[e>>4&63]+Ta[e<<2&63]+"=")),n.join("")}var OT={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */OT.read=function(o,e,t,i,n){var s,r,a=n*8-i-1,l=(1<<a)-1,d=l>>1,c=-7,h=t?n-1:0,u=t?-1:1,g=o[e+h];for(h+=u,s=g&(1<<-c)-1,g>>=-c,c+=a;c>0;s=s*256+o[e+h],h+=u,c-=8);for(r=s&(1<<-c)-1,s>>=-c,c+=i;c>0;r=r*256+o[e+h],h+=u,c-=8);if(s===0)s=1-d;else{if(s===l)return r?NaN:(g?-1:1)*(1/0);r=r+Math.pow(2,i),s=s-d}return(g?-1:1)*r*Math.pow(2,s-i)};OT.write=function(o,e,t,i,n,s){var r,a,l,d=s*8-n-1,c=(1<<d)-1,h=c>>1,u=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=i?0:s-1,f=i?1:-1,m=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,r=c):(r=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-r))<1&&(r--,l*=2),r+h>=1?e+=u/l:e+=u*Math.pow(2,1-h),e*l>=2&&(r++,l/=2),r+h>=c?(a=0,r=c):r+h>=1?(a=(e*l-1)*Math.pow(2,n),r=r+h):(a=e*Math.pow(2,h-1)*Math.pow(2,n),r=0));n>=8;o[t+g]=a&255,g+=f,a/=256,n-=8);for(r=r<<n|a,d+=n;d>0;o[t+g]=r&255,g+=f,r/=256,d-=8);o[t+g-f]|=m*128};/*!
|
|
2
2
|
* The buffer module from node.js, for the browser.
|
|
3
3
|
*
|
|
4
4
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
@@ -643,12 +643,12 @@ ${e.toString()}`}}class Dw{constructor(e=new xv,t=!1,i,n=gre){var s;this._servic
|
|
|
643
643
|
* Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
|
|
644
644
|
* Released under the MIT license
|
|
645
645
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
646
|
-
*-----------------------------------------------------------------------------*/var Bde=Object.defineProperty,Wde=Object.getOwnPropertyDescriptor,Vde=Object.getOwnPropertyNames,Hde=Object.prototype.hasOwnProperty,zde=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Vde(e))!Hde.call(o,n)&&n!==t&&Bde(o,n,{get:()=>e[n],enumerable:!(i=Wde(e,n))||i.enumerable});return o},Ude=(o,e,t)=>(zde(o,e,"default"),t),qm={};Ude(qm,c6);var h6={},Jx={},u6=class{static getOrCreate(o){return Jx[o]||(Jx[o]=new u6(o)),Jx[o]}_languageId;_loadingTriggered;_lazyLoadPromise;_lazyLoadPromiseResolve;_lazyLoadPromiseReject;constructor(o){this._languageId=o,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,h6[this._languageId].loader().then(o=>this._lazyLoadPromiseResolve(o),o=>this._lazyLoadPromiseReject(o))),this._lazyLoadPromise}};function $de(o){const e=o.id;h6[e]=o,qm.languages.register(o);const t=u6.getOrCreate(e);qm.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),qm.languages.onLanguageEncountered(e,async()=>{const i=await t.load();qm.languages.setLanguageConfiguration(e,i.conf)})}$de({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>
|
|
646
|
+
*-----------------------------------------------------------------------------*/var Bde=Object.defineProperty,Wde=Object.getOwnPropertyDescriptor,Vde=Object.getOwnPropertyNames,Hde=Object.prototype.hasOwnProperty,zde=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Vde(e))!Hde.call(o,n)&&n!==t&&Bde(o,n,{get:()=>e[n],enumerable:!(i=Wde(e,n))||i.enumerable});return o},Ude=(o,e,t)=>(zde(o,e,"default"),t),qm={};Ude(qm,c6);var h6={},Jx={},u6=class{static getOrCreate(o){return Jx[o]||(Jx[o]=new u6(o)),Jx[o]}_languageId;_loadingTriggered;_lazyLoadPromise;_lazyLoadPromiseResolve;_lazyLoadPromiseReject;constructor(o){this._languageId=o,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,h6[this._languageId].loader().then(o=>this._lazyLoadPromiseResolve(o),o=>this._lazyLoadPromiseReject(o))),this._lazyLoadPromise}};function $de(o){const e=o.id;h6[e]=o,qm.languages.register(o);const t=u6.getOrCreate(e);qm.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),qm.languages.onLanguageEncountered(e,async()=>{const i=await t.load();qm.languages.setLanguageConfiguration(e,i.conf)})}$de({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>u3(()=>import("./yaml.fa746e77.CUpalURV.js"),[],import.meta.url)});/*!-----------------------------------------------------------------------------
|
|
647
647
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
648
648
|
* Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
|
|
649
649
|
* Released under the MIT license
|
|
650
650
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
651
|
-
*-----------------------------------------------------------------------------*/var Kde=Object.defineProperty,jde=Object.getOwnPropertyDescriptor,qde=Object.getOwnPropertyNames,Gde=Object.prototype.hasOwnProperty,Zde=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of qde(e))!Gde.call(o,n)&&n!==t&&Kde(o,n,{get:()=>e[n],enumerable:!(i=jde(e,n))||i.enumerable});return o},Yde=(o,e,t)=>(Zde(o,e,"default"),t),Wv={};Yde(Wv,c6);var Xde=class{_onDidChange=new Wv.Emitter;_diagnosticsOptions;_modeConfiguration;_languageId;constructor(o,e,t){this._languageId=o,this.setDiagnosticsOptions(e),this.setModeConfiguration(t)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(o){this._diagnosticsOptions=o||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(o){this._modeConfiguration=o||Object.create(null),this._onDidChange.fire(this)}},Qde={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},Jde={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},g6=new Xde("json",Qde,Jde);Wv.languages.json={jsonDefaults:g6};function ece(){return
|
|
651
|
+
*-----------------------------------------------------------------------------*/var Kde=Object.defineProperty,jde=Object.getOwnPropertyDescriptor,qde=Object.getOwnPropertyNames,Gde=Object.prototype.hasOwnProperty,Zde=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of qde(e))!Gde.call(o,n)&&n!==t&&Kde(o,n,{get:()=>e[n],enumerable:!(i=jde(e,n))||i.enumerable});return o},Yde=(o,e,t)=>(Zde(o,e,"default"),t),Wv={};Yde(Wv,c6);var Xde=class{_onDidChange=new Wv.Emitter;_diagnosticsOptions;_modeConfiguration;_languageId;constructor(o,e,t){this._languageId=o,this.setDiagnosticsOptions(e),this.setModeConfiguration(t)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(o){this._diagnosticsOptions=o||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(o){this._modeConfiguration=o||Object.create(null),this._onDidChange.fire(this)}},Qde={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},Jde={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},g6=new Xde("json",Qde,Jde);Wv.languages.json={jsonDefaults:g6};function ece(){return u3(()=>import("./jsonMode.fa746e77.DT27TKkD.js"),[],import.meta.url)}Wv.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});Wv.languages.onLanguage("json",()=>{ece().then(o=>o.setupMode(g6))});function eD(o,e){return e&&(o.stack||o.stacktrace)?p("stackTrace.format","{0}: {1}",UF(o),zF(o.stack)||zF(o.stacktrace)):UF(o)}function zF(o){return Array.isArray(o)?o.join(`
|
|
652
652
|
`):o}function UF(o){return o.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${o.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof o.code=="string"&&typeof o.errno=="number"&&typeof o.syscall=="string"?p("nodeExceptionMessage","A system error occurred ({0})",o.message):o.message||p("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function f6(o=null,e=!1){if(!o)return p("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(o)){const t=Qr(o),i=f6(t[0],e);return t.length>1?p("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(ds(o))return o;if(o.detail){const t=o.detail;if(t.error)return eD(t.error,e);if(t.exception)return eD(t.exception,e)}return o.stack?eD(o,e):o.message?o.message:p("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function tce(o){var e;const t=new Map;for(const i of o)t.set(i,((e=t.get(i))!==null&&e!==void 0?e:0)+1);return t}class S_{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),n=new Map,s=[];for(const[r,a]of this.documents){if(t.isCancellationRequested)return[];for(const l of a.chunks){const d=this.computeSimilarityScore(l,i,n);d>0&&s.push({key:r,score:d})}}return s}static termFrequencies(e){return tce(S_.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 s of n)s.length>2&&new RegExp("\\p{Letter}{3,}","gu").test(s)&&(yield t(s))}}updateDocuments(e){var t;for(const{key:i}of e)this.deleteDocument(i);for(const i of e){const n=[];for(const s of i.textChunks){const r=S_.termFrequencies(s);for(const a of r.keys())this.chunkOccurrences.set(a,((t=this.chunkOccurrences.get(a))!==null&&t!==void 0?t:0)+1);n.push({text:s,tf:r})}this.chunkCount+=n.length,this.documents.set(i.key,{chunks:n})}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 s=this.chunkOccurrences.get(n);if(typeof s=="number"){const r=s-1;r<=0?this.chunkOccurrences.delete(n):this.chunkOccurrences.set(n,r)}}}}computeSimilarityScore(e,t,i){let n=0;for(const[s,r]of Object.entries(t)){const a=e.tf.get(s);if(!a)continue;let l=i.get(s);typeof l!="number"&&(l=this.computeIdf(s),i.set(s,l));const d=a*l;n+=d*r}return n}computeEmbedding(e){const t=S_.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){var t;const i=(t=this.chunkOccurrences.get(e))!==null&&t!==void 0?t:0;return i>0?Math.log((this.chunkCount+1)/i):0}computeTfidf(e){const t=Object.create(null);for(const[i,n]of e){const s=this.computeIdf(i);s>0&&(t[i]=n*s)}return t}}function ice(o){var e,t;const i=o.slice(0);i.sort((s,r)=>r.score-s.score);const n=(t=(e=i[0])===null||e===void 0?void 0:e.score)!==null&&t!==void 0?t:0;if(n>0)for(const s of i)s.score/=n;return i}var hf;(function(o){o[o.NO_ACTION=0]="NO_ACTION",o[o.CLOSE_PICKER=1]="CLOSE_PICKER",o[o.REFRESH_PICKER=2]="REFRESH_PICKER",o[o.REMOVE_ITEM=3]="REMOVE_ITEM"})(hf||(hf={}));function tD(o){const e=o;return Array.isArray(e.items)}function $F(o){const e=o;return!!e.picks&&e.additionalPicks instanceof Promise}class nce extends K{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){var n;const s=new se;e.canAcceptInBackground=!!(!((n=this.options)===null||n===void 0)&&n.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let r;const a=s.add(new Cn),l=async()=>{const d=a.value=new se;r?.dispose(!0),e.busy=!1,r=new Wi(t);const c=r.token,h=e.value.substr(this.prefix.length).trim(),u=this._getPicks(h,d,c,i),g=(m,_)=>{var v;let b,C;if(tD(m)?(b=m.items,C=m.active):b=m,b.length===0){if(_)return!1;(h.length>0||e.hideInput)&&(!((v=this.options)===null||v===void 0)&&v.noResultsPick)&&(P_(this.options.noResultsPick)?b=[this.options.noResultsPick(h)]:b=[this.options.noResultsPick])}return e.items=b,C&&(e.activeItems=[C]),!0},f=async m=>{let _=!1,v=!1;await Promise.all([(async()=>{typeof m.mergeDelay=="number"&&(await Mc(m.mergeDelay),c.isCancellationRequested)||v||(_=g(m.picks,!0))})(),(async()=>{e.busy=!0;try{const b=await m.additionalPicks;if(c.isCancellationRequested)return;let C,w;tD(m.picks)?(C=m.picks.items,w=m.picks.active):C=m.picks;let y,I;if(tD(b)?(y=b.items,I=b.active):y=b,y.length>0||!_){let D;if(!w&&!I){const T=e.activeItems[0];T&&C.indexOf(T)!==-1&&(D=T)}g({items:[...C,...y],active:w||I||D})}}finally{c.isCancellationRequested||(e.busy=!1),v=!0}})()])};if(u!==null)if($F(u))await f(u);else if(!(u instanceof Promise))g(u);else{e.busy=!0;try{const m=await u;if(c.isCancellationRequested)return;$F(m)?await f(m):g(m)}finally{c.isCancellationRequested||(e.busy=!1)}}};return s.add(e.onDidChangeValue(()=>l())),l(),s.add(e.onDidAccept(d=>{const[c]=e.selectedItems;typeof c?.accept=="function"&&(d.inBackground||e.hide(),c.accept(e.keyMods,d))})),s.add(e.onDidTriggerItemButton(async({button:d,item:c})=>{var h,u;if(typeof c.trigger=="function"){const g=(u=(h=c.buttons)===null||h===void 0?void 0:h.indexOf(d))!==null&&u!==void 0?u:-1;if(g>=0){const f=c.trigger(g,e.keyMods),m=typeof f=="number"?f:await f;if(t.isCancellationRequested)return;switch(m){case hf.NO_ACTION:break;case hf.CLOSE_PICKER:e.hide();break;case hf.REFRESH_PICKER:l();break;case hf.REMOVE_ITEM:{const _=e.items.indexOf(c);if(_!==-1){const v=e.items.slice(),b=v.splice(_,1),C=e.activeItems.filter(y=>y!==b[0]),w=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=v,C&&(e.activeItems=C),e.keepScrollPosition=w}break}}}}})),s}}var p6=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},qh=function(o,e){return function(t,i){e(t,i,o)}},Fh,zi;let Ou=Fh=class extends nce{constructor(e,t,i,n,s,r){super(Fh.PREFIX,e),this.instantiationService=t,this.keybindingService=i,this.commandService=n,this.telemetryService=s,this.dialogService=r,this.commandsHistory=this._register(this.instantiationService.createInstance(Kc)),this.options=e}async _getPicks(e,t,i,n){var s,r,a,l;const d=await this.getCommandPicks(i);if(i.isCancellationRequested)return[];const c=_u(()=>{const v=new S_;v.updateDocuments(d.map(C=>({key:C.commandId,textChunks:[this.getTfIdfChunk(C)]})));const b=v.calculateScores(e,i);return ice(b).filter(C=>C.score>Fh.TFIDF_THRESHOLD).slice(0,Fh.TFIDF_MAX_RESULTS)}),h=[];for(const v of d){const b=(s=Fh.WORD_FILTER(e,v.label))!==null&&s!==void 0?s:void 0,C=v.commandAlias&&(r=Fh.WORD_FILTER(e,v.commandAlias))!==null&&r!==void 0?r:void 0;if(b||C)v.highlights={label:b,detail:this.options.showAlias?C:void 0},h.push(v);else if(e===v.commandId)h.push(v);else if(e.length>=3){const w=c();if(i.isCancellationRequested)return[];const y=w.find(I=>I.key===v.commandId);y&&(v.tfIdfScore=y.score,h.push(v))}}const u=new Map;for(const v of h){const b=u.get(v.label);b?(v.description=v.commandId,b.description=b.commandId):u.set(v.label,v)}h.sort((v,b)=>{if(v.tfIdfScore&&b.tfIdfScore)return v.tfIdfScore===b.tfIdfScore?v.label.localeCompare(b.label):b.tfIdfScore-v.tfIdfScore;if(v.tfIdfScore)return 1;if(b.tfIdfScore)return-1;const C=this.commandsHistory.peek(v.commandId),w=this.commandsHistory.peek(b.commandId);if(C&&w)return C>w?-1:1;if(C)return-1;if(w)return 1;if(this.options.suggestedCommandIds){const y=this.options.suggestedCommandIds.has(v.commandId),I=this.options.suggestedCommandIds.has(b.commandId);if(y&&I)return 0;if(y)return-1;if(I)return 1}return v.label.localeCompare(b.label)});const g=[];let f=!1,m=!0,_=!!this.options.suggestedCommandIds;for(let v=0;v<h.length;v++){const b=h[v];v===0&&this.commandsHistory.peek(b.commandId)&&(g.push({type:"separator",label:p("recentlyUsed","recently used")}),f=!0),m&&b.tfIdfScore!==void 0&&(g.push({type:"separator",label:p("suggested","similar commands")}),m=!1),_&&b.tfIdfScore===void 0&&!this.commandsHistory.peek(b.commandId)&&(!((a=this.options.suggestedCommandIds)===null||a===void 0)&&a.has(b.commandId))&&(g.push({type:"separator",label:p("commonlyUsed","commonly used")}),f=!0,_=!1),f&&b.tfIdfScore===void 0&&!this.commandsHistory.peek(b.commandId)&&!(!((l=this.options.suggestedCommandIds)===null||l===void 0)&&l.has(b.commandId))&&(g.push({type:"separator",label:p("morecCommands","other commands")}),f=!1),g.push(this.toCommandPick(b,n))}return this.hasAdditionalCommandPicks(e,i)?{picks:g,additionalPicks:(async()=>{var v;const b=await this.getAdditionalCommandPicks(d,h,e,i);if(i.isCancellationRequested)return[];const C=b.map(w=>this.toCommandPick(w,n));return m&&((v=C[0])===null||v===void 0?void 0:v.type)!=="separator"&&C.unshift({type:"separator",label:p("suggested","similar commands")}),C})()}:g}toCommandPick(e,t){if(e.type==="separator")return e;const i=this.keybindingService.lookupKeybinding(e.commandId),n=i?p("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 s,r;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:(s=t?.from)!==null&&s!==void 0?s:"quick open"});try{!((r=e.args)===null||r===void 0)&&r.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(a){oa(a)||this.dialogService.error(p("canNotRun","Command '{0}' resulted in an error",e.label),f6(a))}}}}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}};Ou.PREFIX=">";Ou.TFIDF_THRESHOLD=.5;Ou.TFIDF_MAX_RESULTS=5;Ou.WORD_FILTER=CM(S0,die,B7);Ou=Fh=p6([qh(1,Oe),qh(2,Pt),qh(3,ui),qh(4,Gs),qh(5,Dv)],Ou);let Kc=zi=class extends K{constructor(e,t){super(),this.storageService=e,this.configurationService=t,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e))),this._register(this.storageService.onWillSaveState(e=>{e.reason===y0.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=zi.getConfiguredCommandHistoryLength(this.configurationService),zi.cache&&zi.cache.limit!==this.configuredCommandsHistoryLength&&(zi.cache.limit=this.configuredCommandsHistoryLength,zi.hasChanges=!0))}load(){const e=this.storageService.get(zi.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch{}const i=zi.cache=new oh(this.configuredCommandsHistoryLength,1);if(t){let n;t.usesLRU?n=t.entries:n=t.entries.sort((s,r)=>s.value-r.value),n.forEach(s=>i.set(s.key,s.value))}zi.counter=this.storageService.getNumber(zi.PREF_KEY_COUNTER,0,zi.counter)}push(e){zi.cache&&(zi.cache.set(e,zi.counter++),zi.hasChanges=!0)}peek(e){var t;return(t=zi.cache)===null||t===void 0?void 0:t.peek(e)}saveState(){if(!zi.cache||!zi.hasChanges)return;const e={usesLRU:!0,entries:[]};zi.cache.forEach((t,i)=>e.entries.push({key:i,value:t})),this.storageService.store(zi.PREF_KEY_CACHE,JSON.stringify(e),0,0),this.storageService.store(zi.PREF_KEY_COUNTER,zi.counter,0,0),zi.hasChanges=!1}static getConfiguredCommandHistoryLength(e){var t,i;const s=(i=(t=e.getValue().workbench)===null||t===void 0?void 0:t.commandPalette)===null||i===void 0?void 0:i.history;return typeof s=="number"?s:zi.DEFAULT_COMMANDS_HISTORY_LENGTH}};Kc.DEFAULT_COMMANDS_HISTORY_LENGTH=50;Kc.PREF_KEY_CACHE="commandPalette.mru.cache";Kc.PREF_KEY_COUNTER="commandPalette.mru.counter";Kc.counter=1;Kc.hasChanges=!1;Kc=zi=p6([qh(0,da),qh(1,ft)],Kc);class sce extends Ou{constructor(e,t,i,n,s,r){super(e,t,i,n,s,r)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const i of e.getSupportedActions())t.push({commandId:i.id,commandAlias:i.alias,label:DM(i.label)||i.id});return t}}var oce=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Dg=function(o,e){return function(t,i){e(t,i,o)}};let B0=class extends sce{get activeTextEditorControl(){var e;return(e=this.codeEditorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}constructor(e,t,i,n,s,r){super({showAlias:!1},e,i,n,s,r),this.codeEditorService=t}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}};B0=oce([Dg(0,Oe),Dg(1,Dt),Dg(2,Pt),Dg(3,ui),Dg(4,Gs),Dg(5,Dv)],B0);class Vv extends we{constructor(){super({id:Vv.ID,label:iw.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:M.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(dh).quickAccess.show(B0.PREFIX)}}Vv.ID="editor.action.quickCommand";de(Vv);Ri.as(XM.Quickaccess).registerQuickAccessProvider({ctor:B0,prefix:B0.PREFIX,helpEntries:[{description:iw.quickCommandHelp,commandId:Vv.ID}]});class rce extends ko{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:{value:p("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),original:"Toggle Collapse Unchanged Regions"},icon:he.map,toggled:te.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:te.has("isInDiffEditor"),menu:{when:te.has("isInDiffEditor"),id:N.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(ft),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}Xt(rce);class m6 extends ko{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:{value:p("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),original:"Toggle Show Moved Code Blocks"},precondition:te.has("isInDiffEditor")})}run(e,...t){const i=e.get(ft),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}Xt(m6);class _6 extends ko{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:{value:p("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),original:"Toggle Use Inline View When Space Is Limited"},precondition:te.has("isInDiffEditor")})}run(e,...t){const i=e.get(ft),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}Xt(_6);vn.appendMenuItem(N.EditorTitle,{command:{id:new _6().desc.id,title:p("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:te.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:te.has("isInDiffEditor")},order:11,group:"1_diff",when:te.and(M.diffEditorRenderSideBySideInlineBreakpointReached,te.has("isInDiffEditor"))});vn.appendMenuItem(N.EditorTitle,{command:{id:new m6().desc.id,title:p("showMoves","Show Moved Code Blocks"),icon:he.move,toggled:Rp.create("config.diffEditor.experimental.showMoves",!0),precondition:te.has("isInDiffEditor")},order:10,group:"1_diff",when:te.has("isInDiffEditor")});const Ny={value:p("diffEditor","Diff Editor"),original:"Diff Editor"};class ace extends aa{constructor(){super({id:"diffEditor.switchSide",title:{value:p("switchSide","Switch Side"),original:"Switch Side"},icon:he.arrowSwap,precondition:te.has("isInDiffEditor"),f1:!0,category:Ny})}runEditorCommand(e,t,i){const n=qp(e);if(n instanceof zc){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}Xt(ace);class lce extends aa{constructor(){super({id:"diffEditor.exitCompareMove",title:{value:p("exitCompareMove","Exit Compare Move"),original:"Exit Compare Move"},icon:he.close,precondition:M.comparingMovedCode,f1:!1,category:Ny,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=qp(e);n instanceof zc&&n.exitCompareMove()}}Xt(lce);class dce extends aa{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:{value:p("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),original:"Collapse All Unchanged Regions"},icon:he.fold,precondition:te.has("isInDiffEditor"),f1:!0,category:Ny})}runEditorCommand(e,t,...i){const n=qp(e);n instanceof zc&&n.collapseAllUnchangedRegions()}}Xt(dce);class cce extends aa{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:{value:p("showAllUnchangedRegions","Show All Unchanged Regions"),original:"Show All Unchanged Regions"},icon:he.unfold,precondition:te.has("isInDiffEditor"),f1:!0,category:Ny})}runEditorCommand(e,t,...i){const n=qp(e);n instanceof zc&&n.showAllUnchangedRegions()}}Xt(cce);const v6={value:p("accessibleDiffViewer","Accessible Diff Viewer"),original:"Accessible Diff Viewer"};class jp extends ko{constructor(){super({id:jp.id,title:{value:p("editor.action.accessibleDiffViewer.next","Go to Next Difference"),original:"Go to Next Difference"},category:v6,precondition:te.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=qp(e);t?.accessibleDiffViewerNext()}}jp.id="editor.action.accessibleDiffViewer.next";vn.appendMenuItem(N.EditorTitle,{command:{id:jp.id,title:p("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:te.has("isInDiffEditor")},order:10,group:"2_diff",when:te.and(M.accessibleDiffViewerVisible.negate(),te.has("isInDiffEditor"))});class Hv extends ko{constructor(){super({id:Hv.id,title:{value:p("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),original:"Go to Previous Difference"},category:v6,precondition:te.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=qp(e);t?.accessibleDiffViewerPrev()}}Hv.id="editor.action.accessibleDiffViewer.prev";function qp(o){var e;const t=o.get(Dt),i=t.listDiffEditors(),n=(e=t.getFocusedCodeEditor())!==null&&e!==void 0?e:t.getActiveCodeEditor();if(!n)return null;for(let r=0,a=i.length;r<a;r++){const l=i[r];if(l.getModifiedEditor().getId()===n.getId()||l.getOriginalEditor().getId()===n.getId())return l}const s=wo();if(s)for(const r of i){const a=r.getContainerDomNode();if(hce(a,s))return r}return null}function hce(o,e){let t=e;for(;t;){if(t===o)return!0;t=t.parentElement}return!1}gt.registerCommandAlias("editor.action.diffReview.next",jp.id);Xt(jp);gt.registerCommandAlias("editor.action.diffReview.prev",Hv.id);Xt(Hv);var uce=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},gce=function(o,e){return function(t,i){e(t,i,o)}},JE;const Ty=new be("selectionAnchorSet",!1);let fd=JE=class{static get(e){return e.getContribution(JE.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=Ty.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(xe.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Fn().appendText(p("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),js(p("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(xe.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()}};fd.ID="editor.contrib.selectionAnchorController";fd=JE=uce([gce(1,We)],fd);class fce extends we{constructor(){super({id:"editor.action.setSelectionAnchor",label:p("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:M.editorTextFocus,primary:qi(2089,2080),weight:100}})}async run(e,t){var i;(i=fd.get(t))===null||i===void 0||i.setSelectionAnchor()}}class pce extends we{constructor(){super({id:"editor.action.goToSelectionAnchor",label:p("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:Ty})}async run(e,t){var i;(i=fd.get(t))===null||i===void 0||i.goToSelectionAnchor()}}class mce extends we{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:p("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:Ty,kbOpts:{kbExpr:M.editorTextFocus,primary:qi(2089,2089),weight:100}})}async run(e,t){var i;(i=fd.get(t))===null||i===void 0||i.selectFromAnchorToCursor()}}class _ce extends we{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:p("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:Ty,kbOpts:{kbExpr:M.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=fd.get(t))===null||i===void 0||i.cancelSelectionAnchor()}}yt(fd.ID,fd,4);de(fce);de(pce);de(mce);de(_ce);const vce=R("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},p("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class bce extends we{constructor(){super({id:"editor.action.jumpToBracket",label:p("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:M.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=mr.get(t))===null||i===void 0||i.jumpToBracket()}}class Cce extends we{constructor(){super({id:"editor.action.selectToBracket",label:p("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:fH("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 n;let s=!0;i&&i.selectBrackets===!1&&(s=!1),(n=mr.get(t))===null||n===void 0||n.selectToBracket(s)}}class wce extends we{constructor(){super({id:"editor.action.removeBrackets",label:p("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:M.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=mr.get(t))===null||i===void 0||i.removeBrackets(this.id)}}class Sce{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}class mr extends K{static get(e){return e.getContribution(mr.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Rt(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(71),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(71)&&(this._matchBrackets=this._editor.getOption(71),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(),s=e.bracketPairs.matchBracket(n);let r=null;if(s)s[0].containsPosition(n)&&!s[1].containsPosition(n)?r=s[1].getStartPosition():s[1].containsPosition(n)&&(r=s[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(n);if(a)r=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(n);l&&l.range&&(r=l.range.getStartPosition())}}return r?new xe(r.lineNumber,r.column,r.lineNumber,r.column):new xe(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 s=n.getStartPosition();let r=t.bracketPairs.matchBracket(s);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(s),!r)){const d=t.bracketPairs.findNextBracket(s);d&&d.range&&(r=t.bracketPairs.matchBracket(d.range.getStartPosition()))}let a=null,l=null;if(r){r.sort(k.compareRangesUsingStarts);const[d,c]=r;if(a=e?d.getStartPosition():d.getEndPosition(),l=e?c.getEndPosition():c.getStartPosition(),c.containsPosition(s)){const h=a;a=l,l=h}}a&&l&&i.push(new xe(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 s=t.bracketPairs.matchBracket(n);s||(s=t.bracketPairs.findEnclosingBrackets(n)),s&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:s[0],text:""},{range:s[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 s=[];let r=0;for(let h=0,u=e.length;h<u;h++){const g=e[h];g.isEmpty()&&(s[r++]=g.getStartPosition())}s.length>1&&s.sort(V.compare);const a=[];let l=0,d=0;const c=n.length;for(let h=0,u=s.length;h<u;h++){const g=s[h];for(;d<c&&n[d].position.isBefore(g);)d++;if(d<c&&n[d].position.equals(g))a[l++]=n[d];else{let f=t.bracketPairs.matchBracket(g,20),m=mr._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!f&&this._matchBrackets==="always"&&(f=t.bracketPairs.findEnclosingBrackets(g,20),m=mr._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[l++]=new Sce(g,f,m)}}this._lastBracketsData=a,this._lastVersionId=i}}mr.ID="editor.contrib.bracketMatchingController";mr._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Ze.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:fi(vce),position:Ko.Center}});mr._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Ze.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});yt(mr.ID,mr,1);de(Cce);de(bce);de(wce);vn.appendMenuItem(N.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:p({},"Go to &&Bracket")},order:2});class yce{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,s=this._selection.endColumn;if(!(this._isMovingLeft&&n===1)&&!(!this._isMovingLeft&&s===e.getLineMaxColumn(i)))if(this._isMovingLeft){const r=new k(i,n-1,i,n),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new k(i,s,i,s),a)}else{const r=new k(i,s,i,s+1),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new k(i,n,i,n),a)}}computeCursorState(e,t){return this._isMovingLeft?new xe(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new xe(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class b6 extends we{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],n=t.getSelections();for(const s of n)i.push(new yce(s,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class Lce extends b6{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:p("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:M.writable})}}class xce extends b6{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:p("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:M.writable})}}de(Lce);de(xce);class Dce extends we{constructor(){super({id:"editor.action.transposeLetters",label:p("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:M.writable,kbOpts:{kbExpr:M.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],s=t.getSelections();for(const r of s){if(!r.isEmpty())continue;const a=r.startLineNumber,l=r.startColumn,d=i.getLineMaxColumn(a);if(a===1&&(l===1||l===2&&d===2))continue;const c=l===d?r.getPosition():It.rightPosition(i,r.getPosition().lineNumber,r.getPosition().column),h=It.leftPosition(i,c),u=It.leftPosition(i,h),g=i.getValueInRange(k.fromPositions(u,h)),f=i.getValueInRange(k.fromPositions(h,c)),m=k.fromPositions(u,c);n.push(new kn(m,f+g))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}de(Dce);const Fu="9_cutcopypaste",kce=ol||document.queryCommandSupported("cut"),C6=ol||document.queryCommandSupported("copy"),Ice=typeof navigator.clipboard>"u"||zo?document.queryCommandSupported("paste"):!0;function fR(o){return o.register(),o}const Ece=kce?fR(new Pp({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:ol?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:N.MenubarEditMenu,group:"2_ccp",title:p({},"Cu&&t"),order:1},{menuId:N.EditorContext,group:Fu,title:p("actions.clipboard.cutLabel","Cut"),when:M.writable,order:1},{menuId:N.CommandPalette,group:"",title:p("actions.clipboard.cutLabel","Cut"),order:1},{menuId:N.SimpleEditorContext,group:Fu,title:p("actions.clipboard.cutLabel","Cut"),when:M.writable,order:1}]})):void 0,Nce=C6?fR(new Pp({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:ol?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:N.MenubarEditMenu,group:"2_ccp",title:p({},"&&Copy"),order:2},{menuId:N.EditorContext,group:Fu,title:p("actions.clipboard.copyLabel","Copy"),order:2},{menuId:N.CommandPalette,group:"",title:p("actions.clipboard.copyLabel","Copy"),order:1},{menuId:N.SimpleEditorContext,group:Fu,title:p("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;vn.appendMenuItem(N.MenubarEditMenu,{submenu:N.MenubarCopy,title:{value:p("copy as","Copy As"),original:"Copy As"},group:"2_ccp",order:3});vn.appendMenuItem(N.EditorContext,{submenu:N.EditorContextCopy,title:{value:p("copy as","Copy As"),original:"Copy As"},group:Fu,order:3});vn.appendMenuItem(N.EditorContext,{submenu:N.EditorContextShare,title:{value:p("share","Share"),original:"Share"},group:"11_share",order:-1,when:te.and(te.notEquals("resourceScheme","output"),M.editorTextFocus)});vn.appendMenuItem(N.EditorTitleContext,{submenu:N.EditorTitleContextShare,title:{value:p("share","Share"),original:"Share"},group:"11_share",order:-1});vn.appendMenuItem(N.ExplorerContext,{submenu:N.ExplorerContextShare,title:{value:p("share","Share"),original:"Share"},group:"11_share",order:-1});const iD=Ice?fR(new Pp({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:ol?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:N.MenubarEditMenu,group:"2_ccp",title:p({},"&&Paste"),order:4},{menuId:N.EditorContext,group:Fu,title:p("actions.clipboard.pasteLabel","Paste"),when:M.writable,order:4},{menuId:N.CommandPalette,group:"",title:p("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:N.SimpleEditorContext,group:Fu,title:p("actions.clipboard.pasteLabel","Paste"),when:M.writable,order:4}]})):void 0;class Tce extends we{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:p("actions.clipboard.copyWithSyntaxHighlightingLabel","Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:M.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(37)&&t.getSelection().isEmpty()||(sI.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),sI.forceCopyWithSyntaxHighlighting=!1)}}function w6(o,e){o&&(o.addImplementation(1e4,"code-editor",(t,i)=>{const n=t.get(Dt).getFocusedCodeEditor();if(n&&n.hasTextFocus()){const s=n.getOption(37),r=n.getSelection();return r&&r.isEmpty()&&!s||n.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),o.addImplementation(0,"generic-dom",(t,i)=>(Ap().execCommand(e),!0)))}w6(Ece,"cut");w6(Nce,"copy");iD&&(iD.addImplementation(1e4,"code-editor",(o,e)=>{const t=o.get(Dt),i=o.get(Sd),n=t.getFocusedCodeEditor();return n&&n.hasTextFocus()?!n.getContainerDomNode().ownerDocument.execCommand("paste")&&th?(async()=>{const r=await i.readText();if(r!==""){const a=a0.INSTANCE.get(r);let l=!1,d=null,c=null;a&&(l=n.getOption(37)&&!!a.isFromEmptySelection,d=typeof a.multicursorText<"u"?a.multicursorText:null,c=a.mode),n.trigger("keyboard","paste",{text:r,pasteOnNewLine:l,multicursorText:d,mode:c})}})():!0:!1}),iD.addImplementation(0,"generic-dom",(o,e)=>(Ap().execCommand("paste"),!0)));C6&&de(Tce);class Be{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+Be.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new Be(this.value+Be.sep+e)}}Be.sep=".";Be.None=new Be("@@none@@");Be.Empty=new Be("");Be.QuickFix=new Be("quickfix");Be.Refactor=new Be("refactor");Be.RefactorExtract=Be.Refactor.append("extract");Be.RefactorInline=Be.Refactor.append("inline");Be.RefactorMove=Be.Refactor.append("move");Be.RefactorRewrite=Be.Refactor.append("rewrite");Be.Notebook=new Be("notebook");Be.Source=new Be("source");Be.SourceOrganizeImports=Be.Source.append("organizeImports");Be.SourceFixAll=Be.Source.append("fixAll");Be.SurroundWith=Be.Refactor.append("surround");var qs;(function(o){o.Refactor="refactor",o.RefactorPreview="refactor preview",o.Lightbulb="lightbulb",o.Default="other (default)",o.SourceAction="source action",o.QuickFix="quick fix action",o.FixAll="fix all",o.OrganizeImports="organize imports",o.AutoFix="auto fix",o.QuickFixHover="quick fix hover window",o.OnSave="save participants",o.ProblemsView="problems view"})(qs||(qs={}));function Mce(o,e){return!(o.include&&!o.include.intersects(e)||o.excludes&&o.excludes.some(t=>S6(e,t,o.include))||!o.includeSourceActions&&Be.Source.contains(e))}function Rce(o,e){const t=e.kind?new Be(e.kind):void 0;return!(o.include&&(!t||!o.include.contains(t))||o.excludes&&t&&o.excludes.some(i=>S6(t,i,o.include))||!o.includeSourceActions&&t&&Be.Source.contains(t)||o.onlyIncludePreferredActions&&!e.isPreferred)}function S6(o,e,t){return!(!e.contains(o)||t&&e.contains(t))}class Va{static fromUser(e,t){return!e||typeof e!="object"?new Va(t.kind,t.apply,!1):new Va(Va.getKindFromUser(e,t.kind),Va.getApplyFromUser(e,t.apply),Va.getPreferredUser(e))}static getApplyFromUser(e,t){switch(typeof e.apply=="string"?e.apply.toLowerCase():""){case"first":return"first";case"never":return"never";case"ifsingle":return"ifSingle";default:return t}}static getKindFromUser(e,t){return typeof e.kind=="string"?new Be(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}}class Ace{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}async resolve(e){var t;if(!((t=this.provider)===null||t===void 0)&&t.resolveCodeAction&&!this.action.edit){let i;try{i=await this.provider.resolveCodeAction(this.action,e)}catch(n){Mi(n)}i&&(this.action.edit=i.edit)}return this}}const y6="editor.action.codeAction",pR="editor.action.quickFix",L6="editor.action.autoFix",x6="editor.action.refactor",D6="editor.action.sourceAction",mR="editor.action.organizeImports",_R="editor.action.fixAll";class y_ extends K{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return e.isAI&&!t.isAI?1:!e.isAI&&t.isAI?-1:Bn(e.diagnostics)?Bn(t.diagnostics)?y_.codeActionsPreferredComparator(e,t):-1:Bn(t.diagnostics)?1:y_.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(y_.codeActionsComparator),this.validActions=this.allActions.filter(({action:n})=>!n.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&Be.QuickFix.contains(new Be(e.kind))&&!!e.isPreferred)}get hasAIFix(){return this.validActions.some(({action:e})=>!!e.isAI)}get allAIFixes(){return this.validActions.every(({action:e})=>!!e.isAI)}}const KF={actions:[],documentation:void 0};async function L_(o,e,t,i,n,s){var r;const a=i.filter||{},l={...a,excludes:[...a.excludes||[],Be.Notebook]},d={only:(r=a.include)===null||r===void 0?void 0:r.value,trigger:i.type},c=new gR(e,s),h=i.type===2,u=Pce(o,e,h?l:a),g=new se,f=u.map(async _=>{try{n.report(_);const v=await _.provideCodeActions(e,t,d,c.token);if(v&&g.add(v),c.token.isCancellationRequested)return KF;const b=(v?.actions||[]).filter(w=>w&&Rce(a,w)),C=Fce(_,b,a.include);return{actions:b.map(w=>new Ace(w,_)),documentation:C}}catch(v){if(oa(v))throw v;return Mi(v),KF}}),m=o.onDidChange(()=>{const _=o.all(e);_i(_,u)||c.cancel()});try{const _=await Promise.all(f),v=_.map(C=>C.actions).flat(),b=[...Qr(_.map(C=>C.documentation)),...Oce(o,e,i,v)];return new y_(v,b,g)}finally{m.dispose(),c.dispose()}}function Pce(o,e,t){return o.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(n=>Mce(t,new Be(n))):!0)}function*Oce(o,e,t,i){var n,s,r;if(e&&i.length)for(const a of o.all(e))a._getAdditionalMenuItems&&(yield*(n=a._getAdditionalMenuItems)===null||n===void 0?void 0:n.call(a,{trigger:t.type,only:(r=(s=t.filter)===null||s===void 0?void 0:s.include)===null||r===void 0?void 0:r.value},i.map(l=>l.action)))}function Fce(o,e,t){if(!o.documentation)return;const i=o.documentation.map(n=>({kind:new Be(n.kind),command:n.command}));if(t){let n;for(const s of i)s.kind.contains(t)&&(n?n.kind.contains(s.kind)&&(n=s):n=s);if(n)return n?.command}for(const n of e)if(n.kind){for(const s of i)if(s.kind.contains(new Be(n.kind)))return s.command}}var Bw;(function(o){o.OnSave="onSave",o.FromProblemsView="fromProblemsView",o.FromCodeActions="fromCodeActions"})(Bw||(Bw={}));async function Bce(o,e,t,i,n=st.None){var s;const r=o.get(kv),a=o.get(ui),l=o.get(Gs),d=o.get(Vi);if(l.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),await e.resolve(n),!n.isCancellationRequested&&!(!((s=e.action.edit)===null||s===void 0)&&s.edits.length&&!(await r.apply(e.action.edit,{editor:i?.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==Bw.OnSave,showPreview:i?.preview})).isApplied)&&e.action.command)try{await a.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(c){const h=Wce(c);d.error(typeof h=="string"?h:p("applyCodeActionFailed","An unknown error occurred while applying the code action"))}}function Wce(o){return typeof o=="string"?o:o instanceof Error&&typeof o.message=="string"?o.message:void 0}gt.registerCommand("_executeCodeActionProvider",async function(o,e,t,i,n){if(!(e instanceof Me))throw Wo();const{codeActionProvider:s}=o.get(Se),r=o.get(ii).getModel(e);if(!r)throw Wo();const a=xe.isISelection(t)?xe.liftSelection(t):k.isIRange(t)?r.validateRange(t):void 0;if(!a)throw Wo();const l=typeof i=="string"?new Be(i):void 0,d=await L_(s,r,a,{type:1,triggerAction:qs.Default,filter:{includeSourceActions:!0,include:l}},ld.None,st.None),c=[],h=Math.min(d.validActions.length,typeof n=="number"?n:0);for(let u=0;u<h;u++)c.push(d.validActions[u].resolve(st.None));try{return await Promise.all(c),d.validActions.map(u=>u.action)}finally{setTimeout(()=>d.dispose(),100)}});var Vce=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Hce=function(o,e){return function(t,i){e(t,i,o)}},eN;let Ww=eN=class{constructor(e){this.keybindingService=e}getResolver(){const e=new sh(()=>this.keybindingService.getKeybindings().filter(t=>eN.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===mR?i={kind:Be.SourceOrganizeImports.value}:t.command===_R&&(i={kind:Be.SourceFixAll.value}),{resolvedKeybinding:t.resolvedKeybinding,...Va.fromUser(i,{kind:Be.None,apply:"never"})}}));return t=>{if(t.kind){const i=this.bestKeybindingForCodeAction(t,e.value);return i?.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new Be(e.kind);return t.filter(n=>n.kind.contains(i)).filter(n=>n.preferred?e.isPreferred:!0).reduceRight((n,s)=>n?n.kind.contains(s.kind)?s:n:s,void 0)}};Ww.codeActionCommands=[x6,y6,D6,mR,_R];Ww=eN=Vce([Hce(0,Pt)],Ww);R("symbolIcon.arrayForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.booleanForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},p("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.colorForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.constantForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},p("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},p("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},p("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},p("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},p("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.fileForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.folderForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},p("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},p("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.keyForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.keywordForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},p("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.moduleForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.namespaceForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.nullForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.numberForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.objectForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.operatorForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.packageForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.propertyForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.referenceForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.snippetForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.stringForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.structForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.textForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.typeParameterForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.unitForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},p("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const k6=Object.freeze({kind:Be.Empty,title:p("codeAction.widget.id.more","More Actions...")}),zce=Object.freeze([{kind:Be.QuickFix,title:p("codeAction.widget.id.quickfix","Quick Fix")},{kind:Be.RefactorExtract,title:p("codeAction.widget.id.extract","Extract"),icon:he.wrench},{kind:Be.RefactorInline,title:p("codeAction.widget.id.inline","Inline"),icon:he.wrench},{kind:Be.RefactorRewrite,title:p("codeAction.widget.id.convert","Rewrite"),icon:he.wrench},{kind:Be.RefactorMove,title:p("codeAction.widget.id.move","Move"),icon:he.wrench},{kind:Be.SurroundWith,title:p("codeAction.widget.id.surround","Surround With"),icon:he.symbolSnippet},{kind:Be.Source,title:p("codeAction.widget.id.source","Source Action"),icon:he.symbolFile},k6]);function Uce(o,e,t){if(!e)return o.map(s=>{var r;return{kind:"action",item:s,group:k6,disabled:!!s.action.disabled,label:s.action.disabled||s.action.title,canPreview:!!(!((r=s.action.edit)===null||r===void 0)&&r.edits.length)}});const i=zce.map(s=>({group:s,actions:[]}));for(const s of o){const r=s.action.kind?new Be(s.action.kind):Be.None;for(const a of i)if(a.group.kind.contains(r)){a.actions.push(s);break}}const n=[];for(const s of i)if(s.actions.length){n.push({kind:"header",group:s.group});for(const r of s.actions){const a=s.group;n.push({kind:"action",item:r,group:r.action.isAI?{title:a.title,kind:a.kind,icon:he.sparkle}:a,label:r.action.title,disabled:!!r.action.disabled,keybinding:t(r.action)})}}return n}var $ce=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},jF=function(o,e){return function(t,i){e(t,i,o)}},tN,uf;(function(o){o.Hidden={type:0};class e{constructor(i,n,s,r){this.actions=i,this.trigger=n,this.editorPosition=s,this.widgetPosition=r,this.type=1}}o.Showing=e})(uf||(uf={}));let Bu=tN=class extends K{constructor(e,t,i){super(),this._editor=e,this._keybindingService=t,this._onClick=this._register(new W),this.onClick=this._onClick.event,this._state=uf.Hidden,this._iconClasses=[],this._domNode=pe("div.lightBulbWidget"),this._register(Ot.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(n=>{const s=this._editor.getModel();(this.state.type!==1||!s||this.state.editorPosition.lineNumber>=s.getLineCount())&&this.hide()})),this._register(F$(this._domNode,n=>{var s;if(this.state.type!==1)return;const r=this._editor.getOption(64).experimental.showAiIcon;if((r===As.On||r===As.OnCode)&&this.state.actions.allAIFixes&&this.state.actions.validActions.length===1){const h=this.state.actions.validActions[0].action;if(!((s=h.command)===null||s===void 0)&&s.id){i.executeCommand(h.command.id,...h.command.arguments||[]),n.preventDefault();return}}this._editor.focus(),n.preventDefault();const{top:a,height:l}=ji(this._domNode),d=this._editor.getOption(66);let c=Math.floor(d/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber<this.state.editorPosition.lineNumber&&(c+=d),this._onClick.fire({x:n.posx,y:a+l+c,actions:this.state.actions,trigger:this.state.trigger})})),this._register(Q(this._domNode,"mouseenter",n=>{(n.buttons&1)===1&&this.hide()})),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(64)&&(this._editor.getOption(64).enabled||this.hide(),this._updateLightBulbTitleAndIcon())})),this._register(fe.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{var n,s,r,a;this._preferredKbLabel=(s=(n=this._keybindingService.lookupKeybinding(L6))===null||n===void 0?void 0:n.getLabel())!==null&&s!==void 0?s:void 0,this._quickFixKbLabel=(a=(r=this._keybindingService.lookupKeybinding(pR))===null||r===void 0?void 0:r.getLabel())!==null&&a!==void 0?a:void 0,this._updateLightBulbTitleAndIcon()}))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return this._state.type===1?this._state.widgetPosition:null}update(e,t,i){if(e.validActions.length<=0)return this.hide();const n=this._editor.getOptions();if(!n.get(64).enabled)return this.hide();const s=this._editor.getModel();if(!s)return this.hide();const{lineNumber:r,column:a}=s.validatePosition(i),l=s.getOptions().tabSize,d=n.get(50),c=s.getLineContent(r),h=YS(c,l),u=d.spaceWidth*h>22,g=m=>m>2&&this._editor.getTopForLineNumber(m)===this._editor.getTopForLineNumber(m-1);let f=r;if(!u){if(r>1&&!g(r-1))f-=1;else if(!g(r+1))f+=1;else if(a*d.spaceWidth<22)return this.hide()}this.state=new uf.Showing(e,t,i,{position:{lineNumber:f,column:s.getLineContent(f).match(/^\S\s*$/)?2:1},preference:tN._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state!==uf.Hidden&&(this.state=uf.Hidden,this._editor.layoutContentWidget(this))}get state(){return this._state}set state(e){this._state=e,this._updateLightBulbTitleAndIcon()}_updateLightBulbTitleAndIcon(){var e,t,i;if(this._domNode.classList.remove(...this._iconClasses),this._iconClasses=[],this.state.type!==1)return;const n=()=>{this._preferredKbLabel&&(this.title=p("preferredcodeActionWithKb","Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel))},s=()=>{this._quickFixKbLabel?this.title=p("codeActionWithKb","Show Code Actions ({0})",this._quickFixKbLabel):this.title=p("codeAction","Show Code Actions")};let r;const a=this._editor.getOption(64).experimental.showAiIcon;if(a===As.On||a===As.OnCode)if(a===As.On&&this.state.actions.allAIFixes)if(r=he.sparkleFilled,this.state.actions.allAIFixes&&this.state.actions.validActions.length===1)if(((e=this.state.actions.validActions[0].action.command)===null||e===void 0?void 0:e.id)==="inlineChat.start"){const l=(i=(t=this._keybindingService.lookupKeybinding("inlineChat.start"))===null||t===void 0?void 0:t.getLabel())!==null&&i!==void 0?i:void 0;this.title=l?p("codeActionStartInlineChatWithKb","Start Inline Chat ({0})",l):p("codeActionStartInlineChat","Start Inline Chat")}else this.title=p("codeActionTriggerAiAction","Trigger AI Action");else s();else this.state.actions.hasAutoFix?(this.state.actions.hasAIFix?r=he.lightbulbSparkleAutofix:r=he.lightbulbAutofix,n()):this.state.actions.hasAIFix?(r=he.lightbulbSparkle,s()):(r=he.lightBulb,s());else this.state.actions.hasAutoFix?(r=he.lightbulbAutofix,n()):(r=he.lightBulb,s());this._iconClasses=Re.asClassNameArray(r),this._domNode.classList.add(...this._iconClasses)}set title(e){this._domNode.title=e}};Bu.ID="editor.contrib.lightbulbWidget";Bu._posPref=[0];Bu=tN=$ce([jF(1,Pt),jF(2,ui)],Bu);var Kce=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},qF=function(o,e){return function(t,i){e(t,i,o)}},iN;let pd=iN=class{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new W,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const n=new se,s=n.add(ly(e,{...this._getRenderOptions(e,n),...t},i));return s.element.classList.add("rendered-markdown"),{element:s.element,dispose:()=>n.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:async(i,n)=>{var s,r,a;let l;i?l=this._languageService.getLanguageIdByLanguageName(i):this._options.editor&&(l=(s=this._options.editor.getModel())===null||s===void 0?void 0:s.getLanguageId()),l||(l=So);const d=await ree(this._languageService,n,l),c=document.createElement("span");if(c.innerHTML=(a=(r=iN._ttpTokenizer)===null||r===void 0?void 0:r.createHTML(d))!==null&&a!==void 0?a:d,this._options.editor){const h=this._options.editor.getOption(50);Tn(c,h)}else this._options.codeBlockFontFamily&&(c.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(c.style.fontSize=this._options.codeBlockFontSize),c},asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:i=>I6(this._openerService,i,e.isTrusted),disposables:t}}}};pd._ttpTokenizer=vd("tokenizeToString",{createHTML(o){return o}});pd=iN=Kce([qF(1,ni),qF(2,Qs)],pd);async function I6(o,e,t){try{return await o.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:jce(t)})}catch(i){return Ge(i),!1}}function jce(o){return o===!0?!0:o&&Array.isArray(o.enabledCommands)?o.enabledCommands:!1}var qce=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},GF=function(o,e){return function(t,i){e(t,i,o)}},ZC;let zs=ZC=class{static get(e){return e.getContribution(ZC.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new Cn,this._messageListeners=new se,this._mouseOverMessage=!1,this._editor=e,this._visible=ZC.MESSAGE_VISIBLE.bindTo(t)}dispose(){var e;(e=this._message)===null||e===void 0||e.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){js(_c(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=_c(e)?ly(e,{actionHandler:{callback:n=>I6(this._openerService,n,_c(e)?e.isTrusted:void 0),disposables:this._messageListeners}}):void 0,this._messageWidget.value=new ZF(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(fe.debounce(this._editor.onDidBlurEditorText,(n,s)=>s,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&Nn(wo(),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(Q(this._messageWidget.value.getDomNode(),ge.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(Q(this._messageWidget.value.getDomNode(),ge.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 k(t.lineNumber-3,1,n.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(ZF.fadeOut(this._messageWidget.value))}};zs.ID="editor.contrib.messageController";zs.MESSAGE_VISIBLE=new be("messageVisible",!1,p("messageVisible","Whether the editor is currently showing an inline message"));zs=ZC=qce([GF(1,We),GF(2,Qs)],zs);const Gce=cn.bindToContribution(zs.get);ue(new Gce({id:"leaveEditorMessage",precondition:zs.MESSAGE_VISIBLE,handler:o=>o.closeMessage(),kbOpts:{weight:130,primary:9}}));let ZF=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 s=document.createElement("div");s.classList.add("anchor","top"),this._domNode.appendChild(s);const r=document.createElement("div");typeof n=="string"?(r.classList.add("message"),r.textContent=n):(n.classList.add("message"),r.appendChild(n)),this._domNode.appendChild(r);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)}};yt(zs.ID,zs,4);var E6=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},nN=function(o,e){return function(t,i){e(t,i,o)}};const N6="acceptSelectedCodeAction",T6="previewSelectedCodeAction";class Zce{get templateId(){return"header"}renderTemplate(e){e.classList.add("group-header");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){var n,s;i.text.textContent=(s=(n=e.group)===null||n===void 0?void 0:n.title)!==null&&s!==void 0?s:""}disposeTemplate(e){}}let sN=class{get templateId(){return"action"}constructor(e,t){this._supportsPreview=e,this._keybindingService=t}renderTemplate(e){e.classList.add(this.templateId);const t=document.createElement("div");t.className="icon",e.append(t);const i=document.createElement("span");i.className="title",e.append(i);const n=new Mv(e,mo);return{container:e,icon:t,text:i,keybinding:n}}renderElement(e,t,i){var n,s,r;if(!((n=e.group)===null||n===void 0)&&n.icon?(i.icon.className=Re.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=Ce(e.group.icon.color.id))):(i.icon.className=Re.asClassName(he.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=M6(e.label),i.keybinding.set(e.keybinding),J$(!!e.keybinding,i.keybinding.element);const a=(s=this._keybindingService.lookupKeybinding(N6))===null||s===void 0?void 0:s.getLabel(),l=(r=this._keybindingService.lookupKeybinding(T6))===null||r===void 0?void 0:r.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.disabled?i.container.title=e.label:a&&l?this._supportsPreview&&e.canPreview?i.container.title=p({},"{0} to apply, {1} to preview",a,l):i.container.title=p({},"{0} to apply",a):i.container.title=""}disposeTemplate(e){}};sN=E6([nN(1,Pt)],sN);class Yce extends UIEvent{constructor(){super("acceptSelectedAction")}}class YF extends UIEvent{constructor(){super("previewSelectedAction")}}function Xce(o){if(o.kind==="action")return o.label}let oN=class extends K{constructor(e,t,i,n,s,r){super(),this._delegate=n,this._contextViewService=s,this._keybindingService=r,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new Wi),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const a={getHeight:l=>l.kind==="header"?this._headerLineHeight:this._actionLineHeight,getTemplateId:l=>l.kind};this._list=this._register(new yr(e,this.domNode,a,[new sN(t,this._keybindingService),new Zce],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:Xce},accessibilityProvider:{getAriaLabel:l=>{if(l.kind==="action"){let d=l.label?M6(l?.label):"";return l.disabled&&(d=p({},"{0}, Disabled Reason: {1}",d,l.disabled)),d}return null},getWidgetAriaLabel:()=>p({},"Action Widget"),getRole:l=>l.kind==="action"?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(sg),this._register(this._list.onMouseClick(l=>this.onListClick(l))),this._register(this._list.onMouseOver(l=>this.onListHover(l))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(l=>this.onListSelection(l))),this._allMenuItems=i,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(e){return!e.disabled&&e.kind==="action"}hide(e){this._delegate.onHide(e),this.cts.cancel(),this._contextViewService.hideContextView()}layout(e){const t=this._allMenuItems.filter(l=>l.kind==="header").length,n=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(n);let s=e;if(this._allMenuItems.length>=50)s=380;else{const l=this._allMenuItems.map((d,c)=>{const h=this.domNode.ownerDocument.getElementById(this._list.getElementID(c));if(h){h.style.width="auto";const u=h.getBoundingClientRect().width;return h.style.width="",u}return 0});s=Math.max(...l,e)}const a=Math.min(n,this.domNode.ownerDocument.body.clientHeight*.7);return this._list.layout(a,s),this.domNode.style.height=`${a}px`,this._list.domFocus(),s}focusPrevious(){this._list.focusPrevious(1,!0,void 0,this.focusCondition)}focusNext(){this._list.focusNext(1,!0,void 0,this.focusCondition)}acceptSelected(e){const t=this._list.getFocus();if(t.length===0)return;const i=t[0],n=this._list.element(i);if(!this.focusCondition(n))return;const s=e?new YF:new Yce;this._list.setSelection([i],s)}onListSelection(e){if(!e.elements.length)return;const t=e.elements[0];t.item&&this.focusCondition(t)?this._delegate.onSelect(t.item,e.browserEvent instanceof YF):this._list.setSelection([])}onFocus(){var e,t;this._list.domFocus();const i=this._list.getFocus();if(i.length===0)return;const n=i[0],s=this._list.element(n);(t=(e=this._delegate).onFocus)===null||t===void 0||t.call(e,s.item)}async onListHover(e){const t=e.element;if(t&&t.item&&this.focusCondition(t)){if(this._delegate.onHover&&!t.disabled&&t.kind==="action"){const i=await this._delegate.onHover(t.item,this.cts.token);t.canPreview=i?i.canPreview:void 0}e.index&&this._list.splice(e.index,1,[t])}this._list.setFocus(typeof e.index=="number"?[e.index]:[])}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};oN=E6([nN(4,bd),nN(5,Pt)],oN);function M6(o){return o.replace(/\r\n|\r|\n/g," ")}var Qce=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},nD=function(o,e){return function(t,i){e(t,i,o)}};R("actionBar.toggledBackground",{dark:Qh,light:Qh,hcDark:Qh,hcLight:Qh},p("actionBar.toggledBackground","Background color for toggled action items in action bar."));const Wu={Visible:new be("codeActionMenuVisible",!1,p("codeActionMenuVisible","Whether the action widget list is visible"))},ag=ot("actionWidgetService");let Vu=class extends K{get isVisible(){return Wu.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new Cn)}show(e,t,i,n,s,r,a){const l=Wu.Visible.bindTo(this._contextKeyService),d=this._instantiationService.createInstance(oN,e,t,i,n);this._contextViewService.showContextView({getAnchor:()=>s,render:c=>(l.set(!0),this._renderWidget(c,d,a??[])),onHide:c=>{l.reset(),this._onWidgetClosed(c)}},r,!1)}acceptSelected(e){var t;(t=this._list.value)===null||t===void 0||t.acceptSelected(e)}focusPrevious(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusPrevious()}focusNext(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusNext()}hide(){var e;(e=this._list.value)===null||e===void 0||e.hide(),this._list.clear()}_renderWidget(e,t,i){var n;const s=document.createElement("div");if(s.classList.add("action-widget"),e.appendChild(s),this._list.value=t,this._list.value)s.appendChild(this._list.value.domNode);else throw new Error("List has no value");const r=new se,a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-block"),r.add(Q(l,ge.MOUSE_DOWN,f=>f.stopPropagation()));const d=document.createElement("div"),c=e.appendChild(d);c.classList.add("context-view-pointerBlock"),r.add(Q(c,ge.POINTER_MOVE,()=>c.remove())),r.add(Q(c,ge.MOUSE_DOWN,()=>c.remove()));let h=0;if(i.length){const f=this._createActionBar(".action-widget-action-bar",i);f&&(s.appendChild(f.getContainer().parentElement),r.add(f),h=f.getContainer().offsetWidth)}const u=(n=this._list.value)===null||n===void 0?void 0:n.layout(h);s.style.width=`${u}px`;const g=r.add(dl(e));return r.add(g.onDidBlur(()=>this.hide())),r}_createActionBar(e,t){if(!t.length)return;const i=pe(e),n=new Go(i);return n.push(t,{icon:!1,label:!0}),n}_onWidgetClosed(e){var t;(t=this._list.value)===null||t===void 0||t.hide(e)}};Vu=Qce([nD(0,bd),nD(1,We),nD(2,Oe)],Vu);ct(ag,Vu,1);const zv=1100;Xt(class extends ko{constructor(){super({id:"hideCodeActionWidget",title:{value:p("hideCodeActionWidget.title","Hide action widget"),original:"Hide action widget"},precondition:Wu.Visible,keybinding:{weight:zv,primary:9,secondary:[1033]}})}run(o){o.get(ag).hide()}});Xt(class extends ko{constructor(){super({id:"selectPrevCodeAction",title:{value:p("selectPrevCodeAction.title","Select previous action"),original:"Select previous action"},precondition:Wu.Visible,keybinding:{weight:zv,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(o){const e=o.get(ag);e instanceof Vu&&e.focusPrevious()}});Xt(class extends ko{constructor(){super({id:"selectNextCodeAction",title:{value:p("selectNextCodeAction.title","Select next action"),original:"Select next action"},precondition:Wu.Visible,keybinding:{weight:zv,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(o){const e=o.get(ag);e instanceof Vu&&e.focusNext()}});Xt(class extends ko{constructor(){super({id:N6,title:{value:p("acceptSelected.title","Accept selected action"),original:"Accept selected action"},precondition:Wu.Visible,keybinding:{weight:zv,primary:3,secondary:[2137]}})}run(o){const e=o.get(ag);e instanceof Vu&&e.acceptSelected()}});Xt(class extends ko{constructor(){super({id:T6,title:{value:p("previewSelected.title","Preview selected action"),original:"Preview selected action"},precondition:Wu.Visible,keybinding:{weight:zv,primary:2051}})}run(o){const e=o.get(ag);e instanceof Vu&&e.acceptSelected(!0)}});const R6=new be("supportedCodeAction","");class Jce extends K{constructor(e,t,i,n=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=n,this._autoTriggerTimer=this._register(new Cr),this._register(this._markerService.onMarkerChanged(s=>this._onMarkerChanges(s))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some(i=>J2(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:qs.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){var t;if(!this._editor.hasModel())return;const i=this._editor.getModel(),n=this._editor.getSelection();if(n.isEmpty()&&e.type===2){const{lineNumber:s,column:r}=n.getPosition(),a=i.getLineContent(s);if(a.length===0){if(!(((t=this._editor.getOption(64).experimental)===null||t===void 0?void 0:t.showAiIcon)===As.On))return}else if(r===1){if(/\s/.test(a[0]))return}else if(r===i.getLineMaxColumn(s)){if(/\s/.test(a[a.length-1]))return}else if(/\s/.test(a[r-2])&&/\s/.test(a[r-1]))return}return n}}var Gh;(function(o){o.Empty={type:0};class e{constructor(i,n,s){this.trigger=i,this.position=n,this._cancellablePromise=s,this.type=1,this.actions=s.catch(r=>{if(oa(r))return A6;throw r})}cancel(){this._cancellablePromise.cancel()}}o.Triggered=e})(Gh||(Gh={}));const A6=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1});class ehe extends K{constructor(e,t,i,n,s,r){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=s,this._configurationService=r,this._codeActionOracle=this._register(new Cn),this._state=Gh.Empty,this._onDidChangeState=this._register(new W),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=R6.bindTo(n),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(Gh.Empty,!0))}_settingEnabledNearbyQuickfixes(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes",{resource:t?.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(Gh.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(90)){const t=this._registry.all(e).flatMap(i=>{var n;return(n=i.providedCodeActionKinds)!==null&&n!==void 0?n:[]});this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new Jce(this._editor,this._markerService,i=>{var n;if(!i){this.setState(Gh.Empty);return}const s=i.selection.getStartPosition(),r=Zi(async a=>{var l,d,c,h,u,g;if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===1&&(i.trigger.triggerAction===qs.QuickFix||!((d=(l=i.trigger.filter)===null||l===void 0?void 0:l.include)===null||d===void 0)&&d.contains(Be.QuickFix))){const f=await L_(this._registry,e,i.selection,i.trigger,ld.None,a),m=[...f.allActions];if(a.isCancellationRequested)return A6;if(!((c=f.validActions)===null||c===void 0?void 0:c.some(v=>v.action.kind?Be.QuickFix.contains(new Be(v.action.kind)):!1))){const v=this._markerService.read({resource:e.uri});if(v.length>0){const b=i.selection.getPosition();let C=b,w=Number.MAX_VALUE;const y=[...f.validActions];for(const D of v){const T=D.endColumn,P=D.endLineNumber,H=D.startLineNumber;if(P===b.lineNumber||H===b.lineNumber){C=new V(P,T);const Y={type:i.trigger.type,triggerAction:i.trigger.triggerAction,filter:{include:!((h=i.trigger.filter)===null||h===void 0)&&h.include?(u=i.trigger.filter)===null||u===void 0?void 0:u.include:Be.QuickFix},autoApply:i.trigger.autoApply,context:{notAvailableMessage:((g=i.trigger.context)===null||g===void 0?void 0:g.notAvailableMessage)||"",position:C}},B=new xe(C.lineNumber,C.column,C.lineNumber,C.column),U=await L_(this._registry,e,B,Y,ld.None,a);if(U.validActions.length!==0){for(const G of U.validActions)G.highlightRange=G.action.isPreferred;f.allActions.length===0&&m.push(...U.allActions),Math.abs(b.column-T)<w?y.unshift(...U.validActions):y.push(...U.validActions)}w=Math.abs(b.column-T)}}const I=y.filter((D,T,P)=>P.findIndex(H=>H.action.title===D.action.title)===T);return I.sort((D,T)=>D.action.isPreferred&&!T.action.isPreferred?-1:!D.action.isPreferred&&T.action.isPreferred||D.action.isAI&&!T.action.isAI?1:!D.action.isAI&&T.action.isAI?-1:0),{validActions:I,allActions:m,documentation:f.documentation,hasAutoFix:f.hasAutoFix,hasAIFix:f.hasAIFix,allAIFixes:f.allAIFixes,dispose:()=>{f.dispose()}}}}}return L_(this._registry,e,i.selection,i.trigger,ld.None,a)});i.trigger.type===1&&((n=this._progressService)===null||n===void 0||n.showWhile(r,250)),this.setState(new Gh.Triggered(i.trigger,s,r))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:qs.Default})}else this._supportedCodeActions.reset()}trigger(e){var t;(t=this._codeActionOracle.value)===null||t===void 0||t.trigger(e)}setState(e,t){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}}var the=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},El=function(o,e){return function(t,i){e(t,i,o)}},YC;const ihe="quickfix-edit-highlight";let jc=YC=class extends K{static get(e){return e.getContribution(YC.ID)}constructor(e,t,i,n,s,r,a,l,d,c){super(),this._commandService=a,this._configurationService=l,this._actionWidgetService=d,this._instantiationService=c,this._activeCodeActions=this._register(new Cn),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new ehe(this._editor,s.codeActionProvider,t,i,r,l)),this._register(this._model.onDidChangeState(h=>this.update(h))),this._lightBulbWidget=new sh(()=>{const h=this._editor.getContribution(Bu.ID);return h&&this._register(h.onClick(u=>this.showCodeActionList(u.actions,u,{includeDisabledActions:!1,fromLightbulb:!0}))),h}),this._resolver=n.createInstance(Ww),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}showCodeActions(e,t,i){return this.showCodeActionList(t,i,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,i,n){var s;if(!this._editor.hasModel())return;(s=zs.get(this._editor))===null||s===void 0||s.closeMessage();const r=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:i,autoApply:n,context:{notAvailableMessage:e,position:r}})}_trigger(e){return this._model.trigger(e)}async _applyCodeAction(e,t,i){try{await this._instantiationService.invokeFunction(Bce,e,Bw.FromCodeActions,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:qs.QuickFix,filter:{}})}}async update(e){var t,i,n,s,r,a,l;if(e.type!==1){(t=this._lightBulbWidget.rawValue)===null||t===void 0||t.hide();return}let d;try{d=await e.actions}catch(c){Ge(c);return}if(!this._disposed)if((i=this._lightBulbWidget.value)===null||i===void 0||i.update(d,e.trigger,e.position),e.trigger.type===1){if(!((n=e.trigger.filter)===null||n===void 0)&&n.include){const h=this.tryGetValidActionToApply(e.trigger,d);if(h){try{(s=this._lightBulbWidget.value)===null||s===void 0||s.hide(),await this._applyCodeAction(h,!1,!1)}finally{d.dispose()}return}if(e.trigger.context){const u=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,d);if(u&&u.action.disabled){(r=zs.get(this._editor))===null||r===void 0||r.showMessage(u.action.disabled,e.trigger.context.position),d.dispose();return}}}const c=!!(!((a=e.trigger.filter)===null||a===void 0)&&a.include);if(e.trigger.context&&(!d.allActions.length||!c&&!d.validActions.length)){(l=zs.get(this._editor))===null||l===void 0||l.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=d,d.dispose();return}this._activeCodeActions.value=d,this.showCodeActionList(d,this.toCoords(e.position),{includeDisabledActions:c,fromLightbulb:!1})}else this._actionWidgetService.isVisible?d.dispose():this._activeCodeActions.value=d}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length&&(e.autoApply==="first"&&t.validActions.length===0||e.autoApply==="ifSingle"&&t.allActions.length===1))return t.allActions.find(({action:i})=>i.disabled)}tryGetValidActionToApply(e,t){if(t.validActions.length&&(e.autoApply==="first"&&t.validActions.length>0||e.autoApply==="ifSingle"&&t.validActions.length===1))return t.validActions[0]}async showCodeActionList(e,t,i){const n=this._editor.createDecorationsCollection(),s=this._editor.getDomNode();if(!s)return;const r=i.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!r.length)return;const a=V.isIPosition(t)?this.toCoords(t):t,l={onSelect:async(d,c)=>{this._applyCodeAction(d,!0,!!c),this._actionWidgetService.hide(),n.clear()},onHide:()=>{var d;(d=this._editor)===null||d===void 0||d.focus(),n.clear()},onHover:async(d,c)=>{var h;if(await d.resolve(c),!c.isCancellationRequested)return{canPreview:!!(!((h=d.action.edit)===null||h===void 0)&&h.edits.length)}},onFocus:d=>{var c,h;if(d&&d.highlightRange&&d.action.diagnostics){const u=[{range:d.action.diagnostics[0],options:YC.DECORATION}];n.set(u);const g=d.action.diagnostics[0],f=(h=(c=this._editor.getModel())===null||c===void 0?void 0:c.getWordAtPosition({lineNumber:g.startLineNumber,column:g.startColumn}))===null||h===void 0?void 0:h.word;Du(p("editingNewSelection","Context: {0} at line {1} and column {2}.",f,g.startLineNumber,g.startColumn))}else n.clear()}};this._actionWidgetService.show("codeActionWidget",!0,Uce(r,this._shouldShowHeaders(),this._resolver.getResolver()),l,a,s,this._getActionBarActions(e,t,i))}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),i=ji(this._editor.getDomNode()),n=i.left+t.left,s=i.top+t.top+t.height;return{x:n,y:s}}_shouldShowHeaders(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:t?.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];const n=e.documentation.map(s=>{var r;return{id:s.id,label:s.title,tooltip:(r=s.tooltip)!==null&&r!==void 0?r:"",class:void 0,enabled:!0,run:()=>{var a;return this._commandService.executeCommand(s.id,...(a=s.arguments)!==null&&a!==void 0?a:[])}}});return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&n.push(this._showDisabled?{id:"hideMoreActions",label:p("hideMoreActions","Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:p("showMoreActions","Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),n}};jc.ID="editor.contrib.codeActionController";jc.DECORATION=Ze.register({description:"quickfix-highlight",className:ihe});jc=YC=the([El(1,yl),El(2,We),El(3,Oe),El(4,Se),El(5,lh),El(6,ui),El(7,ft),El(8,ag),El(9,Oe)],jc);Sr((o,e)=>{((n,s)=>{s&&e.addRule(`.monaco-editor ${n} { background-color: ${s}; }`)})(".quickfix-edit-highlight",o.getColor(Ga));const i=o.getColor(Jd);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${il(o.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});function Uv(o){return te.regex(R6.keys()[0],new RegExp("(\\s|^)"+yo(o.value)+"\\b"))}const vR={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:p("args.schema.kind","Kind of the code action to run.")},apply:{type:"string",description:p("args.schema.apply","Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[p("args.schema.apply.first","Always apply the first returned code action."),p("args.schema.apply.ifSingle","Apply the first returned code action if it is the only one."),p("args.schema.apply.never","Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:p("args.schema.preferred","Controls if only preferred code actions should be returned.")}}};function lg(o,e,t,i,n=qs.Default){if(o.hasModel()){const s=jc.get(o);s?.manualTriggerAtCurrentPosition(e,n,t,i)}}class nhe extends we{constructor(){super({id:pR,label:p("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:te.and(M.writable,M.hasCodeActionsProvider),kbOpts:{kbExpr:M.textInputFocus,primary:2137,weight:100}})}run(e,t){return lg(t,p("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0,qs.QuickFix)}}class she extends cn{constructor(){super({id:y6,precondition:te.and(M.writable,M.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:vR}]}})}runEditorCommand(e,t,i){const n=Va.fromUser(i,{kind:Be.Empty,apply:"ifSingle"});return lg(t,typeof i?.kind=="string"?n.preferred?p("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",i.kind):p("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",i.kind):n.preferred?p("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):p("editor.action.codeAction.noneMessage","No code actions available"),{include:n.kind,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply)}}class ohe extends we{constructor(){super({id:x6,label:p("refactor.label","Refactor..."),alias:"Refactor...",precondition:te.and(M.writable,M.hasCodeActionsProvider),kbOpts:{kbExpr:M.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:te.and(M.writable,Uv(Be.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:vR}]}})}run(e,t,i){const n=Va.fromUser(i,{kind:Be.Refactor,apply:"never"});return lg(t,typeof i?.kind=="string"?n.preferred?p("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",i.kind):p("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",i.kind):n.preferred?p("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):p("editor.action.refactor.noneMessage","No refactorings available"),{include:Be.Refactor.contains(n.kind)?n.kind:Be.None,onlyIncludePreferredActions:n.preferred},n.apply,qs.Refactor)}}class rhe extends we{constructor(){super({id:D6,label:p("source.label","Source Action..."),alias:"Source Action...",precondition:te.and(M.writable,M.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:te.and(M.writable,Uv(Be.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:vR}]}})}run(e,t,i){const n=Va.fromUser(i,{kind:Be.Source,apply:"never"});return lg(t,typeof i?.kind=="string"?n.preferred?p("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",i.kind):p("editor.action.source.noneMessage.kind","No source actions for '{0}' available",i.kind):n.preferred?p("editor.action.source.noneMessage.preferred","No preferred source actions available"):p("editor.action.source.noneMessage","No source actions available"),{include:Be.Source.contains(n.kind)?n.kind:Be.None,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply,qs.SourceAction)}}class ahe extends we{constructor(){super({id:mR,label:p("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:te.and(M.writable,Uv(Be.SourceOrganizeImports)),kbOpts:{kbExpr:M.textInputFocus,primary:1581,weight:100}})}run(e,t){return lg(t,p("editor.action.organize.noneMessage","No organize imports action available"),{include:Be.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",qs.OrganizeImports)}}class lhe extends we{constructor(){super({id:_R,label:p("fixAll.label","Fix All"),alias:"Fix All",precondition:te.and(M.writable,Uv(Be.SourceFixAll))})}run(e,t){return lg(t,p("fixAll.noneMessage","No fix all action available"),{include:Be.SourceFixAll,includeSourceActions:!0},"ifSingle",qs.FixAll)}}class dhe extends we{constructor(){super({id:L6,label:p("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:te.and(M.writable,Uv(Be.QuickFix)),kbOpts:{kbExpr:M.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return lg(t,p("editor.action.autoFix.noneMessage","No auto fixes available"),{include:Be.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",qs.AutoFix)}}yt(jc.ID,jc,3);yt(Bu.ID,Bu,4);de(nhe);de(ohe);de(rhe);de(ahe);de(dhe);de(lhe);ue(new she);Ri.as(la.Configuration).registerConfiguration({...iy,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:p("showCodeActionHeaders","Enable/disable showing group headers in the Code Action menu."),default:!0}}});Ri.as(la.Configuration).registerConfiguration({...iy,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:"boolean",scope:5,description:p("includeNearbyQuickFixes","Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),default:!0}}});class rN{constructor(){this.lenses=[],this._disposables=new se}dispose(){this._disposables.dispose()}get isDisposed(){return this._disposables.isDisposed}add(e,t){this._disposables.add(e);for(const i of e.lenses)this.lenses.push({symbol:i,provider:t})}}async function P6(o,e,t){const i=o.ordered(e),n=new Map,s=new rN,r=i.map(async(a,l)=>{n.set(a,l);try{const d=await Promise.resolve(a.provideCodeLenses(e,t));d&&s.add(d,a)}catch(d){Mi(d)}});return await Promise.all(r),s.lenses=s.lenses.sort((a,l)=>a.symbol.range.startLineNumber<l.symbol.range.startLineNumber?-1:a.symbol.range.startLineNumber>l.symbol.range.startLineNumber?1:n.get(a.provider)<n.get(l.provider)?-1:n.get(a.provider)>n.get(l.provider)?1:a.symbol.range.startColumn<l.symbol.range.startColumn?-1:a.symbol.range.startColumn>l.symbol.range.startColumn?1:0),s}gt.registerCommand("_executeCodeLensProvider",function(o,...e){let[t,i]=e;Tt(Me.isUri(t)),Tt(typeof i=="number"||!i);const{codeLensProvider:n}=o.get(Se),s=o.get(ii).getModel(t);if(!s)throw Wo();const r=[],a=new se;return P6(n,s,st.None).then(l=>{a.add(l);const d=[];for(const c of l.lenses)i==null||c.symbol.command?r.push(c.symbol):i-- >0&&c.provider.resolveCodeLens&&d.push(Promise.resolve(c.provider.resolveCodeLens(s,c.symbol,st.None)).then(h=>r.push(h||c.symbol)));return Promise.all(d)}).then(()=>r).finally(()=>{setTimeout(()=>a.dispose(),100)})});var che=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},hhe=function(o,e){return function(t,i){e(t,i,o)}};const O6=ot("ICodeLensCache");class XF{constructor(e,t){this.lineCount=e,this.data=t}}let aN=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new oh(20,.75);const t="codelens/cache";Mm(hi,()=>e.remove(t,1));const i="codelens/cache2",n=e.get(i,1,"{}");this._deserialize(n),fe.once(e.onWillSaveState)(s=>{s.reason===y0.SHUTDOWN&&e.store(i,this._serialize(),1,1)})}put(e,t){const i=t.lenses.map(r=>{var a;return{range:r.symbol.range,command:r.symbol.command&&{id:"",title:(a=r.symbol.command)===null||a===void 0?void 0:a.title}}}),n=new rN;n.add({lenses:i,dispose:()=>{}},this._fakeProvider);const s=new XF(e.getLineCount(),n);this._cache.set(e.uri.toString(),s)}get(e){const t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){const e=Object.create(null);for(const[t,i]of this._cache){const n=new Set;for(const s of i.data.lenses)n.add(s.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...n.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const i in t){const n=t[i],s=[];for(const a of n.lines)s.push({range:new k(a,1,a,11)});const r=new rN;r.add({lenses:s,dispose(){}},this._fakeProvider),this._cache.set(i,new XF(n.lineCount,r))}}catch{}}};aN=che([hhe(0,da)],aN);ct(O6,aN,1);class uhe{constructor(e,t,i){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=i,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}}class My{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${My._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const i=[];let n=!1;for(let s=0;s<e.length;s++){const r=e[s];if(r&&(n=!0,r.command)){const a=vc(r.command.title.trim());r.command.id?(i.push(pe("a",{id:String(s),title:r.command.tooltip,role:"button"},...a)),this._commands.set(String(s),r.command)):i.push(pe("span",{title:r.command.tooltip},...a)),s+1<e.length&&i.push(pe("span",void 0," | "))}}n?(Wn(this._domNode,...i),this._isEmpty&&t&&this._domNode.classList.add("fadein"),this._isEmpty=!1):Wn(this._domNode,pe("span",void 0,"no commands"))}getCommand(e){return e.parentElement===this._domNode?this._commands.get(e.id):void 0}getId(){return this._id}getDomNode(){return this._domNode}updatePosition(e){const t=this._editor.getModel().getLineFirstNonWhitespaceColumn(e);this._widgetPosition={position:{lineNumber:e,column:t},preference:[1]}}getPosition(){return this._widgetPosition||null}}My._idPool=0;class sD{constructor(){this._removeDecorations=[],this._addDecorations=[],this._addDecorationsCallbacks=[]}addDecoration(e,t){this._addDecorations.push(e),this._addDecorationsCallbacks.push(t)}removeDecoration(e){this._removeDecorations.push(e)}commit(e){const t=e.deltaDecorations(this._removeDecorations,this._addDecorations);for(let i=0,n=t.length;i<n;i++)this._addDecorationsCallbacks[i](t[i])}}const QF=Ze.register({collapseOnReplaceEdit:!0,description:"codelens"});class JF{constructor(e,t,i,n,s,r){this._isDisposed=!1,this._editor=t,this._data=e,this._decorationIds=[];let a;const l=[];this._data.forEach((d,c)=>{d.symbol.command&&l.push(d.symbol),i.addDecoration({range:d.symbol.range,options:QF},h=>this._decorationIds[c]=h),a?a=k.plusRange(a,d.symbol.range):a=k.lift(d.symbol.range)}),this._viewZone=new uhe(a.startLineNumber-1,s,r),this._viewZoneId=n.addZone(this._viewZone),l.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(l,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new My(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t?.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{const i=this._editor.getModel().getDecorationRange(e),n=this._data[t].symbol;return!!(i&&k.isEmpty(n.range)===i.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((i,n)=>{t.addDecoration({range:i.symbol.range,options:QF},s=>this._decorationIds[n]=s)})}updateHeight(e,t){this._viewZone.heightInPx=e,t.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.isVisible())return null;for(let t=0;t<this._decorationIds.length;t++){const i=e.getDecorationRange(this._decorationIds[t]);i&&(this._data[t].symbol.range=i)}return this._data}updateCommands(e){this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(e,!0);for(let t=0;t<this._data.length;t++){const i=e[t];if(i){const{symbol:n}=this._data[t];n.command=i.command||n.command}}}getCommand(e){var t;return(t=this._contentWidget)===null||t===void 0?void 0:t.getCommand(e)}getLineNumber(){const e=this._editor.getModel().getDecorationRange(this._decorationIds[0]);return e?e.startLineNumber:-1}update(e){if(this.isValid()){const t=this._editor.getModel().getDecorationRange(this._decorationIds[0]);t&&(this._viewZone.afterLineNumber=t.startLineNumber-1,e.layoutZone(this._viewZoneId),this._contentWidget&&(this._contentWidget.updatePosition(t.startLineNumber),this._editor.layoutContentWidget(this._contentWidget)))}}}var ghe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Sm=function(o,e){return function(t,i){e(t,i,o)}};let bp=class{constructor(e,t,i,n,s,r){this._editor=e,this._languageFeaturesService=t,this._commandService=n,this._notificationService=s,this._codeLensCache=r,this._disposables=new se,this._localToDispose=new se,this._lenses=[],this._oldCodeLensModels=new se,this._provideCodeLensDebounce=i.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=i.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new Rt(()=>this._resolveCodeLensesInViewport(),this._resolveCodeLensesDebounce.default()),this._disposables.add(this._editor.onDidChangeModel(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{(a.hasChanged(50)||a.hasChanged(19)||a.hasChanged(18))&&this._updateLensStyle(),a.hasChanged(17)&&this._onModelChange()})),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){var e;this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),(e=this._currentCodeLensModel)===null||e===void 0||e.dispose()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(66)/this._editor.getOption(52));let t=this._editor.getOption(19);return(!t||t<5)&&(t=this._editor.getOption(52)*.9|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),i=this._editor.getOption(18),n=this._editor.getOption(50),{style:s}=this._editor.getContainerDomNode();s.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),s.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),s.setProperty("--vscode-editorCodeLens-fontFeatureSettings",n.fontFeatureSettings),i&&(s.setProperty("--vscode-editorCodeLens-fontFamily",i),s.setProperty("--vscode-editorCodeLens-fontFamilyDefault",Vs.fontFamily)),this._editor.changeViewZones(r=>{for(const a of this._lenses)a.updateHeight(e,r)})}_localDispose(){var e,t,i;(e=this._getCodeLensModelPromise)===null||e===void 0||e.cancel(),this._getCodeLensModelPromise=void 0,(t=this._resolveCodeLensesPromise)===null||t===void 0||t.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),(i=this._currentCodeLensModel)===null||i===void 0||i.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e||!this._editor.getOption(17)||e.isTooLargeForTokenization())return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&Rc(()=>{const n=this._codeLensCache.get(e);t===n&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3,this._localToDispose);return}for(const n of this._languageFeaturesService.codeLensProvider.all(e))if(typeof n.onDidChange=="function"){const s=n.onDidChange(()=>i.schedule());this._localToDispose.add(s)}const i=new Rt(()=>{var n;const s=Date.now();(n=this._getCodeLensModelPromise)===null||n===void 0||n.cancel(),this._getCodeLensModelPromise=Zi(r=>P6(this._languageFeaturesService.codeLensProvider,e,r)),this._getCodeLensModelPromise.then(r=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=r,this._codeLensCache.put(e,r);const a=this._provideCodeLensDebounce.update(e,Date.now()-s);i.delay=a,this._renderCodeLensSymbols(r),this._resolveCodeLensesInViewportSoon()},Ge)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(Ae(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{var n;this._editor.changeDecorations(s=>{this._editor.changeViewZones(r=>{const a=[];let l=-1;this._lenses.forEach(c=>{!c.isValid()||l===c.getLineNumber()?a.push(c):(c.update(r),l=c.getLineNumber())});const d=new sD;a.forEach(c=>{c.dispose(d,r),this._lenses.splice(this._lenses.indexOf(c),1)}),d.commit(s)})}),i.schedule(),this._resolveCodeLensesScheduler.cancel(),(n=this._resolveCodeLensesPromise)===null||n===void 0||n.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorWidget(()=>{i.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{i.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(n=>{n.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(Ae(()=>{if(this._editor.getModel()){const n=na.capture(this._editor);this._editor.changeDecorations(s=>{this._editor.changeViewZones(r=>{this._disposeAllLenses(s,r)})}),n.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(n=>{if(n.target.type!==9)return;let s=n.target.element;if(s?.tagName==="SPAN"&&(s=s.parentElement),s?.tagName==="A")for(const r of this._lenses){const a=r.getCommand(s);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),i.schedule()}_disposeAllLenses(e,t){const i=new sD;for(const n of this._lenses)n.dispose(i,t);e&&i.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),i=[];let n;for(const a of e.lenses){const l=a.symbol.range.startLineNumber;l<1||l>t||(n&&n[n.length-1].symbol.range.startLineNumber===l?n.push(a):(n=[a],i.push(n)))}if(!i.length&&!this._lenses.length)return;const s=na.capture(this._editor),r=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const d=new sD;let c=0,h=0;for(;h<i.length&&c<this._lenses.length;){const u=i[h][0].symbol.range.startLineNumber,g=this._lenses[c].getLineNumber();g<u?(this._lenses[c].dispose(d,l),this._lenses.splice(c,1)):g===u?(this._lenses[c].updateCodeLensSymbols(i[h],d),h++,c++):(this._lenses.splice(c,0,new JF(i[h],this._editor,d,l,r.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),c++,h++)}for(;c<this._lenses.length;)this._lenses[c].dispose(d,l),this._lenses.splice(c,1);for(;h<i.length;)this._lenses.push(new JF(i[h],this._editor,d,l,r.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),h++;d.commit(a)})}),s.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var e;(e=this._resolveCodeLensesPromise)===null||e===void 0||e.cancel(),this._resolveCodeLensesPromise=void 0;const t=this._editor.getModel();if(!t)return;const i=[],n=[];if(this._lenses.forEach(a=>{const l=a.computeIfNecessary(t);l&&(i.push(l),n.push(a))}),i.length===0)return;const s=Date.now(),r=Zi(a=>{const l=i.map((d,c)=>{const h=new Array(d.length),u=d.map((g,f)=>!g.symbol.command&&typeof g.provider.resolveCodeLens=="function"?Promise.resolve(g.provider.resolveCodeLens(t,g.symbol,a)).then(m=>{h[f]=m},Mi):(h[f]=g.symbol,Promise.resolve(void 0)));return Promise.all(u).then(()=>{!a.isCancellationRequested&&!n[c].isDisposed()&&n[c].updateCommands(h)})});return Promise.all(l)});this._resolveCodeLensesPromise=r,this._resolveCodeLensesPromise.then(()=>{const a=this._resolveCodeLensesDebounce.update(t,Date.now()-s);this._resolveCodeLensesScheduler.delay=a,this._currentCodeLensModel&&this._codeLensCache.put(t,this._currentCodeLensModel),this._oldCodeLensModels.clear(),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},a=>{Ge(a),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){var e;return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,!((e=this._currentCodeLensModel)===null||e===void 0)&&e.isDisposed?void 0:this._currentCodeLensModel}};bp.ID="css.editor.codeLens";bp=ghe([Sm(1,Se),Sm(2,Zo),Sm(3,ui),Sm(4,Vi),Sm(5,O6)],bp);yt(bp.ID,bp,1);de(class extends we{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:M.hasCodeLensProvider,label:p("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}async run(e,t){if(!t.hasModel())return;const i=e.get(dh),n=e.get(ui),s=e.get(Vi),r=t.getSelection().positionLineNumber,a=t.getContribution(bp.ID);if(!a)return;const l=await a.getModel();if(!l)return;const d=[];for(const u of l.lenses)u.symbol.command&&u.symbol.range.startLineNumber===r&&d.push({label:u.symbol.command.title,command:u.symbol.command});if(d.length===0)return;const c=await i.pick(d,{canPickMany:!1,placeHolder:p("placeHolder","Select a command")});if(!c)return;let h=c.command;if(l.isDisposed){const u=await a.getModel(),g=u?.lenses.find(f=>{var m;return f.symbol.range.startLineNumber===r&&((m=f.symbol.command)===null||m===void 0?void 0:m.title)===h.title});if(!g||!g.symbol.command)return;h=g.symbol.command}try{await n.executeCommand(h.id,...h.arguments||[])}catch(u){s.error(u)}}});var fhe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},oD=function(o,e){return function(t,i){e(t,i,o)}};class bR{constructor(e,t){this._editorWorkerClient=new I2(e,!1,"editorWorkerService",t)}async provideDocumentColors(e,t){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,i){const n=t.range,s=t.color,r=s.alpha,a=new q(new ht(Math.round(255*s.red),Math.round(255*s.green),Math.round(255*s.blue),r)),l=r?q.Format.CSS.formatRGB(a):q.Format.CSS.formatRGBA(a),d=r?q.Format.CSS.formatHSL(a):q.Format.CSS.formatHSLA(a),c=r?q.Format.CSS.formatHex(a):q.Format.CSS.formatHexA(a),h=[];return h.push({label:l,textEdit:{range:n,text:l}}),h.push({label:d,textEdit:{range:n,text:d}}),h.push({label:c,textEdit:{range:n,text:c}}),h}}let lN=class extends K{constructor(e,t,i){super(),this._register(i.colorProvider.register("*",new bR(e,t)))}};lN=fhe([oD(0,ii),oD(1,Wt),oD(2,Se)],lN);yy(lN);async function F6(o,e,t,i=!0){return CR(new phe,o,e,t,i)}function B6(o,e,t,i){return Promise.resolve(t.provideColorPresentations(o,e,i))}class phe{constructor(){}async compute(e,t,i,n){const s=await e.provideDocumentColors(t,i);if(Array.isArray(s))for(const r of s)n.push({colorInfo:r,provider:e});return Array.isArray(s)}}class mhe{constructor(){}async compute(e,t,i,n){const s=await e.provideDocumentColors(t,i);if(Array.isArray(s))for(const r of s)n.push({range:r.range,color:[r.color.red,r.color.green,r.color.blue,r.color.alpha]});return Array.isArray(s)}}class _he{constructor(e){this.colorInfo=e}async compute(e,t,i,n){const s=await e.provideColorPresentations(t,this.colorInfo,st.None);return Array.isArray(s)&&n.push(...s),Array.isArray(s)}}async function CR(o,e,t,i,n){let s=!1,r;const a=[],l=e.ordered(t);for(let d=l.length-1;d>=0;d--){const c=l[d];if(c instanceof bR)r=c;else try{await o.compute(c,t,i,a)&&(s=!0)}catch(h){Mi(h)}}return s?a:r&&n?(await o.compute(r,t,i,a),a):[]}function W6(o,e){const{colorProvider:t}=o.get(Se),i=o.get(ii).getModel(e);if(!i)throw Wo();const n=o.get(ft).getValue("editor.defaultColorDecorators",{resource:e});return{model:i,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:n}}gt.registerCommand("_executeDocumentColorProvider",function(o,...e){const[t]=e;if(!(t instanceof Me))throw Wo();const{model:i,colorProviderRegistry:n,isDefaultColorDecoratorsEnabled:s}=W6(o,t);return CR(new mhe,n,i,st.None,s)});gt.registerCommand("_executeColorPresentationProvider",function(o,...e){const[t,i]=e,{uri:n,range:s}=i;if(!(n instanceof Me)||!Array.isArray(t)||t.length!==4||!k.isIRange(s))throw Wo();const{model:r,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=W6(o,n),[d,c,h,u]=t;return CR(new _he({range:s,color:{red:d,green:c,blue:h,alpha:u}}),a,r,st.None,l)});var vhe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},rD=function(o,e){return function(t,i){e(t,i,o)}},dN;const V6=Object.create({});let qc=dN=class extends K{constructor(e,t,i,n){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new se),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new vv(this._editor),this._decoratorLimitReporter=new bhe,this._colorDecorationClassRefs=this._register(new se),this._debounceInformation=n.for(i.colorProvider,"Document Colors",{min:dN.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(i.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(s=>{const r=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145);const a=r!==this._isColorDecoratorsEnabled||s.hasChanged(21),l=s.hasChanged(145);(a||l)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145),this.updateColors()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),i=this._configurationService.getValue(t);if(i&&typeof i=="object"){const n=i.colorDecorators;if(n&&n.enable!==void 0&&!n.enable)return n.enable}return this._editor.getOption(20)}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}updateColors(){if(this.stop(),!this._isColorDecoratorsEnabled)return;const e=this._editor.getModel();!e||!this._languageFeaturesService.colorProvider.has(e)||(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new Cr,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=Zi(async e=>{const t=this._editor.getModel();if(!t)return[];const i=new Hn(!1),n=await F6(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,i.elapsed()),n});try{const e=await this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){Ge(e)}}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(e){const t=e.map(i=>({range:{startLineNumber:i.colorInfo.range.startLineNumber,startColumn:i.colorInfo.range.startColumn,endLineNumber:i.colorInfo.range.endLineNumber,endColumn:i.colorInfo.range.endColumn},options:Ze.EMPTY}));this._editor.changeDecorations(i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((n,s)=>this._colorDatas.set(n,e[s]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],i=this._editor.getOption(21);for(let s=0;s<e.length&&t.length<i;s++){const{red:r,green:a,blue:l,alpha:d}=e[s].colorInfo.color,c=new ht(Math.round(r*255),Math.round(a*255),Math.round(l*255),d),h=`rgba(${c.r}, ${c.g}, ${c.b}, ${c.a})`,u=this._colorDecorationClassRefs.add(this._ruleFactory.createClassNameRef({backgroundColor:h}));t.push({range:{startLineNumber:e[s].colorInfo.range.startLineNumber,startColumn:e[s].colorInfo.range.startColumn,endLineNumber:e[s].colorInfo.range.endLineNumber,endColumn:e[s].colorInfo.range.endColumn},options:{description:"colorDetector",before:{content:J3,inlineClassName:`${u.className} colorpicker-color-decoration`,inlineClassNameAffectsLetterSpacing:!0,attachedData:V6}}})}const n=i<e.length?i:!1;this._decoratorLimitReporter.update(e.length,n),this._colorDecoratorIds.set(t)}removeAllDecorations(){this._editor.removeDecorations(this._decorationsIds),this._decorationsIds=[],this._colorDecoratorIds.clear(),this._colorDecorationClassRefs.clear()}getColorData(e){const t=this._editor.getModel();if(!t)return null;const i=t.getDecorationsInRange(k.fromPositions(e,e)).filter(n=>this._colorDatas.has(n.id));return i.length===0?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};qc.ID="editor.contrib.colorDetector";qc.RECOMPUTE_TIME=1e3;qc=dN=vhe([rD(1,ft),rD(2,Se),rD(3,Zo)],qc);class bhe{constructor(){this._onDidChange=new W,this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}yt(qc.ID,qc,1);class Che{get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}constructor(e,t,i){this.presentationIndex=i,this._onColorFlushed=new W,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new W,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new W,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){let i=-1;for(let n=0;n<this.colorPresentations.length;n++)if(t.toLowerCase()===this.colorPresentations[n].label){i=n;break}if(i===-1){const n=t.split("(")[0].toLowerCase();for(let s=0;s<this.colorPresentations.length;s++)if(this.colorPresentations[s].label.toLowerCase().startsWith(n)){i=s;break}}i!==-1&&i!==this.presentationIndex&&(this.presentationIndex=i,this._onDidChangePresentation.fire(this.presentation))}flushColor(){this._onColorFlushed.fire(this._color)}}const po=pe;class whe extends K{constructor(e,t,i,n=!1){super(),this.model=t,this.showingStandaloneColorPicker=n,this._closeButton=null,this._domNode=po(".colorpicker-header"),ie(e,this._domNode),this._pickedColorNode=ie(this._domNode,po(".picked-color")),ie(this._pickedColorNode,po("span.codicon.codicon-color-mode")),this._pickedColorPresentation=ie(this._pickedColorNode,document.createElement("span")),this._pickedColorPresentation.classList.add("picked-color-presentation");const s=p("clickToToggleColorOptions","Click to toggle color options (rgb/hsl/hex)");this._pickedColorNode.setAttribute("title",s),this._originalColorNode=ie(this._domNode,po(".original-color")),this._originalColorNode.style.backgroundColor=q.Format.CSS.format(this.model.originalColor)||"",this.backgroundColor=i.getColorTheme().getColor(A1)||q.white,this._register(i.onDidColorThemeChange(r=>{this.backgroundColor=r.getColor(A1)||q.white})),this._register(Q(this._pickedColorNode,ge.CLICK,()=>this.model.selectNextColorPresentation())),this._register(Q(this._originalColorNode,ge.CLICK,()=>{this.model.color=this.model.originalColor,this.model.flushColor()})),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this._register(t.onDidChangePresentation(this.onDidChangePresentation,this)),this._pickedColorNode.style.backgroundColor=q.Format.CSS.format(t.color)||"",this._pickedColorNode.classList.toggle("light",t.color.rgba.a<.5?this.backgroundColor.isLighter():t.color.isLighter()),this.onDidChangeColor(this.model.color),this.showingStandaloneColorPicker&&(this._domNode.classList.add("standalone-colorpicker"),this._closeButton=this._register(new She(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=q.Format.CSS.format(e)||"",this._pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this._pickedColorPresentation.textContent=this.model.presentation?this.model.presentation.label:""}}class She extends K{constructor(e){super(),this._onClicked=this._register(new W),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),ie(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),ie(this._button,t),ie(t,po(".button"+Re.asCSSSelector(Di("color-picker-close",he.close,p("closeIcon","Icon to close the color picker"))))).classList.add("close-icon"),this._button.onclick=()=>{this._onClicked.fire()}}}class yhe extends K{constructor(e,t,i,n=!1){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=po(".colorpicker-body"),ie(e,this._domNode),this._saturationBox=new Lhe(this._domNode,this.model,this.pixelRatio),this._register(this._saturationBox),this._register(this._saturationBox.onDidChange(this.onDidSaturationValueChange,this)),this._register(this._saturationBox.onColorFlushed(this.flushColor,this)),this._opacityStrip=new xhe(this._domNode,this.model,n),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new Dhe(this._domNode,this.model,n),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),n&&(this._insertButton=this._register(new khe(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const i=this.model.color.hsva;this.model.color=new q(new za(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new q(new za(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=(1-e)*360;this.model.color=new q(new za(i===360?0:i,t.s,t.v,t.a))}get domNode(){return this._domNode}get saturationBox(){return this._saturationBox}get enterButton(){return this._insertButton}layout(){this._saturationBox.layout(),this._opacityStrip.layout(),this._hueStrip.layout()}}class Lhe extends K{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new W,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new W,this.onColorFlushed=this._onColorFlushed.event,this._domNode=po(".saturation-wrap"),ie(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",ie(this._domNode,this._canvas),this.selection=po(".saturation-selection"),ie(this._domNode,this.selection),this.layout(),this._register(Q(this._domNode,ge.POINTER_DOWN,n=>this.onPointerDown(n))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}get domNode(){return this._domNode}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;this.monitor=this._register(new Bp);const t=ji(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>this.onDidChangePosition(n.pageX-t.left,n.pageY-t.top),()=>null);const i=Q(e.target.ownerDocument,ge.POINTER_UP,()=>{this._onColorFlushed.fire(),i.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const i=Math.max(0,Math.min(1,e/this.width)),n=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,n),this._onDidChange.fire({s:i,v:n})}layout(){this.width=this._domNode.offsetWidth,this.height=this._domNode.offsetHeight,this._canvas.width=this.width*this.pixelRatio,this._canvas.height=this.height*this.pixelRatio,this.paint();const e=this.model.color.hsva;this.paintSelection(e.s,e.v)}paint(){const e=this.model.color.hsva,t=new q(new za(e.h,1,1,1)),i=this._canvas.getContext("2d"),n=i.createLinearGradient(0,0,this._canvas.width,0);n.addColorStop(0,"rgba(255, 255, 255, 1)"),n.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),n.addColorStop(1,"rgba(255, 255, 255, 0)");const s=i.createLinearGradient(0,0,0,this._canvas.height);s.addColorStop(0,"rgba(0, 0, 0, 0)"),s.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this._canvas.width,this._canvas.height),i.fillStyle=q.Format.CSS.format(t),i.fill(),i.fillStyle=n,i.fill(),i.fillStyle=s,i.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${this.height-t*this.height}px`}onDidChangeColor(e){if(this.monitor&&this.monitor.isMonitoring())return;this.paint();const t=e.hsva;this.paintSelection(t.s,t.v)}}class H6 extends K{constructor(e,t,i=!1){super(),this.model=t,this._onDidChange=new W,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new W,this.onColorFlushed=this._onColorFlushed.event,i?(this.domNode=ie(e,po(".standalone-strip")),this.overlay=ie(this.domNode,po(".standalone-overlay"))):(this.domNode=ie(e,po(".strip")),this.overlay=ie(this.domNode,po(".overlay"))),this.slider=ie(this.domNode,po(".slider")),this.slider.style.top="0px",this._register(Q(this.domNode,ge.POINTER_DOWN,n=>this.onPointerDown(n))),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onDidChangeColor(e){const t=this.getValue(e);this.updateSliderPosition(t)}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._register(new Bp),i=ji(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,s=>this.onDidChangeTop(s.pageY-i.top),()=>null);const n=Q(e.target.ownerDocument,ge.POINTER_UP,()=>{this._onColorFlushed.fire(),n.dispose(),t.stopMonitoring(!0),this.domNode.classList.remove("grabbing")},!0)}onDidChangeTop(e){const t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top=`${(1-e)*this.height}px`}}class xhe extends H6{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);const{r:t,g:i,b:n}=e.rgba,s=new q(new ht(t,i,n,1)),r=new q(new ht(t,i,n,0));this.overlay.style.background=`linear-gradient(to bottom, ${s} 0%, ${r} 100%)`}getValue(e){return e.hsva.a}}class Dhe extends H6{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class khe extends K{constructor(e){super(),this._onClicked=this._register(new W),this.onClicked=this._onClicked.event,this._button=ie(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._button.onclick=t=>{this._onClicked.fire()}}get button(){return this._button}}class Ihe extends wr{constructor(e,t,i,n,s=!1){super(),this.model=t,this.pixelRatio=i,this._register(H_.onDidChange(()=>this.layout()));const r=po(".colorpicker-widget");e.appendChild(r),this.header=this._register(new whe(r,this.model,n,s)),this.body=this._register(new yhe(r,this.model,this.pixelRatio,s))}layout(){this.body.layout()}}var z6=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},U6=function(o,e){return function(t,i){e(t,i,o)}};class Ehe{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let Vw=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,i){return Fi.fromPromise(this._computeAsync(e,t,i))}async _computeAsync(e,t,i){if(!this._editor.hasModel())return[];const n=qc.get(this._editor);if(!n)return[];for(const s of t){if(!n.isColorDecoration(s))continue;const r=n.getColorData(s.range.getStartPosition());if(r)return[await $6(this,this._editor.getModel(),r.colorInfo,r.provider)]}return[]}renderHoverParts(e,t){return K6(this,this._editor,this._themeService,t,e)}};Vw=z6([U6(1,tn)],Vw);class Nhe{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n}}let W0=class{constructor(e,t){this._editor=e,this._themeService=t,this._color=null}async createColorHover(e,t,i){if(!this._editor.hasModel()||!qc.get(this._editor))return null;const s=await F6(i,this._editor.getModel(),st.None);let r=null,a=null;for(const h of s){const u=h.colorInfo;k.containsRange(u.range,e.range)&&(r=u,a=h.provider)}const l=r??e,d=a??t,c=!!r;return{colorHover:await $6(this,this._editor.getModel(),l,d),foundInEditor:c}}async updateEditorModel(e){if(!this._editor.hasModel())return;const t=e.model;let i=new k(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(await XC(this._editor.getModel(),t,this._color,i,e),i=j6(this._editor,i,t))}renderHoverParts(e,t){return K6(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};W0=z6([U6(1,tn)],W0);async function $6(o,e,t,i){const n=e.getValueInRange(t.range),{red:s,green:r,blue:a,alpha:l}=t.color,d=new ht(Math.round(s*255),Math.round(r*255),Math.round(a*255),l),c=new q(d),h=await B6(e,t,i,st.None),u=new Che(c,[],0);return u.colorPresentations=h||[],u.guessColorPresentation(c,n),o instanceof Vw?new Ehe(o,k.lift(t.range),u,i):new Nhe(o,k.lift(t.range),u,i)}function K6(o,e,t,i,n){if(i.length===0||!e.hasModel())return K.None;if(n.setMinimumDimensions){const u=e.getOption(66)+8;n.setMinimumDimensions(new bt(302,u))}const s=new se,r=i[0],a=e.getModel(),l=r.model,d=s.add(new Ihe(n.fragment,l,e.getOption(141),t,o instanceof W0));n.setColorPicker(d);let c=!1,h=new k(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn);if(o instanceof W0){const u=i[0].model.color;o.color=u,XC(a,l,u,h,r),s.add(l.onColorFlushed(g=>{o.color=g}))}else s.add(l.onColorFlushed(async u=>{await XC(a,l,u,h,r),c=!0,h=j6(e,h,l,n)}));return s.add(l.onDidChangeColor(u=>{XC(a,l,u,h,r)})),s.add(e.onDidChangeModelContent(u=>{c?c=!1:(n.hide(),e.focus())})),s}function j6(o,e,t,i){let n,s;if(t.presentation.textEdit){n=[t.presentation.textEdit],s=new k(t.presentation.textEdit.range.startLineNumber,t.presentation.textEdit.range.startColumn,t.presentation.textEdit.range.endLineNumber,t.presentation.textEdit.range.endColumn);const r=o.getModel()._setTrackedRange(null,s,3);o.pushUndoStop(),o.executeEdits("colorpicker",n),s=o.getModel()._getTrackedRange(r)||s}else n=[{range:e,text:t.presentation.label,forceMoveMarkers:!1}],s=e.setEndPosition(e.endLineNumber,e.startColumn+t.presentation.label.length),o.pushUndoStop(),o.executeEdits("colorpicker",n);return t.presentation.additionalTextEdits&&(n=[...t.presentation.additionalTextEdits],o.executeEdits("colorpicker",n),i&&i.hide()),o.pushUndoStop(),s}async function XC(o,e,t,i,n){const s=await B6(o,{range:i,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},n.provider,st.None);e.colorPresentations=s||[]}function cN(o,e){return!!o[e]}class aD{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=cN(e.event,t.triggerModifier),this.hasSideBySideModifier=cN(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class e5{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=cN(e,t.triggerModifier)}}class qb{constructor(e,t,i,n){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=n}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function t5(o){return o==="altKey"?ut?new qb(57,"metaKey",6,"altKey"):new qb(5,"ctrlKey",6,"altKey"):ut?new qb(6,"altKey",57,"metaKey"):new qb(6,"altKey",5,"ctrlKey")}class Ry extends K{constructor(e,t){var i;super(),this._onMouseMoveOrRelevantKeyDown=this._register(new W),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new W),this.onExecute=this._onExecute.event,this._onCancel=this._register(new W),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=(i=t?.extractLineNumberFromMouseEvent)!==null&&i!==void 0?i:n=>n.target.position?n.target.position.lineNumber:0,this._opts=t5(this._editor.getOption(77)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(n=>{if(n.hasChanged(77)){const s=t5(this._editor.getOption(77));if(this._opts.equals(s))return;this._opts=s,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(n=>this._onEditorMouseMove(new aD(n,this._opts)))),this._register(this._editor.onMouseDown(n=>this._onEditorMouseDown(new aD(n,this._opts)))),this._register(this._editor.onMouseUp(n=>this._onEditorMouseUp(new aD(n,this._opts)))),this._register(this._editor.onKeyDown(n=>this._onEditorKeyDown(new e5(n,this._opts)))),this._register(this._editor.onKeyUp(n=>this._onEditorKeyUp(new e5(n,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(n=>this._onDidChangeCursorSelection(n))),this._register(this._editor.onDidChangeModel(n=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(n=>{(n.scrollTopChanged||n.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=this._extractLineNumberFromMouseEvent(e)}_onEditorMouseUp(e){const t=this._extractLineNumberFromMouseEvent(e);this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}var The=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Nl=function(o,e){return function(t,i){e(t,i,o)}};let Gc=class extends rp{constructor(e,t,i,n,s,r,a,l,d,c,h,u,g){super(e,{...n.getRawOptions(),overflowWidgetsDomNode:n.getOverflowWidgetsDomNode()},i,s,r,a,l,d,c,h,u,g),this._parentEditor=n,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(n.onDidChangeConfiguration(f=>this._onParentConfigurationChanged(f)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){hS(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};Gc=The([Nl(4,Oe),Nl(5,Dt),Nl(6,ui),Nl(7,We),Nl(8,tn),Nl(9,Vi),Nl(10,Sl),Nl(11,Wt),Nl(12,Se)],Gc);const i5=new q(new ht(0,122,204)),Mhe={showArrow:!0,showFrame:!0,className:"",frameColor:i5,arrowColor:i5,keepEditorSelection:!1},Rhe="vs.editor.contrib.zoneWidget";class Ahe{constructor(e,t,i,n,s,r,a,l){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=n,this.showInHiddenAreas=a,this.ordinal=l,this._onDomNodeTop=s,this._onComputedHeight=r}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class Phe{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class Ay{constructor(e){this._editor=e,this._ruleName=Ay._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),Bk(this._ruleName)}set color(e){this._color!==e&&(this._color=e,this._updateStyle())}set height(e){this._height!==e&&(this._height=e,this._updateStyle())}_updateStyle(){Bk(this._ruleName),S1(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px; margin-left: -${this._height}px; `)}show(e){e.column===1&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:k.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}Ay._IdGenerator=new IM(".arrow-decoration-");class Ohe{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new se,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=Bl(t),hS(this.options,Mhe,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange(i=>{const n=this._getWidth(i);this.domNode.style.width=n+"px",this.domNode.style.left=this._getLeft(i)+"px",this._onWidth(n)}))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._viewZone=null}),this._positionMarkerId.clear(),this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new Ay(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){const e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){const e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){var t;if(this.domNode.style.height=`${e}px`,this.container){const i=e-this._decoratingElementsHeight();this.container.style.height=`${i}px`;const n=this.editor.getLayoutInfo();this._doLayout(i,this._getWidth(n))}(t=this._resizeSash)===null||t===void 0||t.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,t){const i=k.isIRange(e)?k.lift(e):k.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:Ze.EMPTY}])}hide(){var e;this._viewZone&&(this.editor.changeViewZones(t=>{this._viewZone&&t.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),(e=this._arrow)===null||e===void 0||e.hide(),this._positionMarkerId.clear()}_decoratingElementsHeight(){const e=this.editor.getOption(66);let t=0;if(this.options.showArrow){const i=Math.round(e/3);t+=2*i}if(this.options.showFrame){const i=Math.round(e/9);t+=2*i}return t}_showImpl(e,t){const i=e.getStartPosition(),n=this.editor.getLayoutInfo(),s=this._getWidth(n);this.domNode.style.width=`${s}px`,this.domNode.style.left=this._getLeft(n)+"px";const r=document.createElement("div");r.style.overflow="hidden";const a=this.editor.getOption(66);if(!this.options.allowUnlimitedHeight){const u=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,u)}let l=0,d=0;if(this._arrow&&this.options.showArrow&&(l=Math.round(a/3),this._arrow.height=l,this._arrow.show(i)),this.options.showFrame&&(d=Math.round(a/9)),this.editor.changeViewZones(u=>{this._viewZone&&u.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new Ahe(r,i.lineNumber,i.column,t,g=>this._onViewZoneTop(g),g=>this._onViewZoneHeight(g),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=u.addZone(this._viewZone),this._overlayWidget=new Phe(Rhe+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const u=this.options.frameWidth?this.options.frameWidth:d;this.container.style.borderTopWidth=u+"px",this.container.style.borderBottomWidth=u+"px"}const c=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=c+"px",this.container.style.overflow="hidden"),this._doLayout(c,s),this.options.keepEditorSelection||this.editor.setSelection(e);const h=this.editor.getModel();if(h){const u=h.validateRange(new k(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(u,u.startLineNumber===h.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,0):this.editor.revealRange(e,0)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e){this._viewZone&&this._viewZone.heightInLines!==e&&this.editor.changeViewZones(t=>{this._viewZone&&(this._viewZone.heightInLines=e,t.layoutZone(this._viewZone.id))})}_initSash(){if(this._resizeSash)return;this._resizeSash=this._disposables.add(new An(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0);let e;this._disposables.add(this._resizeSash.onDidStart(t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines})})),this._disposables.add(this._resizeSash.onDidEnd(()=>{e=void 0})),this._disposables.add(this._resizeSash.onDidChange(t=>{if(e){const i=(t.currentY-e.startY)/this.editor.getOption(66),n=i<0?Math.ceil(i):Math.floor(i),s=e.heightInLines+n;s>5&&s<35&&this._relayout(s)}}))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(this.domNode.style.height===null?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){const e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}}var q6=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},G6=function(o,e){return function(t,i){e(t,i,o)}};const Z6=ot("IPeekViewService");ct(Z6,class{constructor(){this._widgets=new Map}addExclusiveWidget(o,e){const t=this._widgets.get(o);t&&(t.listener.dispose(),t.widget.dispose());const i=()=>{const n=this._widgets.get(o);n&&n.widget===e&&(n.listener.dispose(),this._widgets.delete(o))};this._widgets.set(o,{widget:e,listener:e.onDidClose(i)})}},1);var xs;(function(o){o.inPeekEditor=new be("inReferenceSearchEditor",!0,p("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),o.notInPeekEditor=o.inPeekEditor.toNegated()})(xs||(xs={}));let V0=class{constructor(e,t){e instanceof Gc&&xs.inPeekEditor.bindTo(t)}dispose(){}};V0.ID="editor.contrib.referenceController";V0=q6([G6(1,We)],V0);yt(V0.ID,V0,0);function Fhe(o){const e=o.get(Dt).getFocusedCodeEditor();return e instanceof Gc?e.getParentEditor():e}const Bhe={headerBackgroundColor:q.white,primaryHeadingColor:q.fromHex("#333333"),secondaryHeadingColor:q.fromHex("#6c6c6cb3")};let Hw=class extends Ohe{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new W,this.onDidClose=this._onDidClose.event,hS(this.options,Bhe,!1)}dispose(){this.disposed||(this.disposed=!0,super.dispose(),this._onDidClose.fire(this))}style(e){const t=this.options;e.headerBackgroundColor&&(t.headerBackgroundColor=e.headerBackgroundColor),e.primaryHeadingColor&&(t.primaryHeadingColor=e.primaryHeadingColor),e.secondaryHeadingColor&&(t.secondaryHeadingColor=e.secondaryHeadingColor),super.style(e)}_applyStyles(){super._applyStyles();const e=this.options;this._headElement&&e.headerBackgroundColor&&(this._headElement.style.backgroundColor=e.headerBackgroundColor.toString()),this._primaryHeading&&e.primaryHeadingColor&&(this._primaryHeading.style.color=e.primaryHeadingColor.toString()),this._secondaryHeading&&e.secondaryHeadingColor&&(this._secondaryHeading.style.color=e.secondaryHeadingColor.toString()),this._bodyElement&&e.frameColor&&(this._bodyElement.style.borderColor=e.frameColor.toString())}_fillContainer(e){this.setCssClass("peekview-widget"),this._headElement=pe(".head"),this._bodyElement=pe(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=pe(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),vi(this._titleElement,"click",s=>this._onTitleClick(s))),ie(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=pe("span.filename"),this._secondaryHeading=pe("span.dirname"),this._metaHeading=pe("span.meta"),ie(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=pe(".peekview-actions");ie(this._headElement,i);const n=this._getActionBarOptions();this._actionbarWidget=new Go(i,n),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new cs("peekview.close",p("label.close","Close"),Re.asClassName(he.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:Kne.bind(void 0,this.instantiationService),orientation:0}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),t?this._secondaryHeading.innerText=t:bn(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,Os(this._metaHeading)):is(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const i=Math.ceil(this.editor.getOption(66)*1.2),n=Math.round(e-(i+2));this._doLayoutHead(i,t),this._doLayoutBody(n,t)}_doLayoutHead(e,t){this._headElement&&(this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height=`${e}px`)}};Hw=q6([G6(2,Oe)],Hw);const Whe=R("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:q.black,hcLight:q.white},p("peekViewTitleBackground","Background color of the peek view title area.")),Y6=R("peekViewTitleLabel.foreground",{dark:q.white,light:q.black,hcDark:q.white,hcLight:cr},p("peekViewTitleForeground","Color of the peek view title.")),X6=R("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},p("peekViewTitleInfoForeground","Color of the peek view title info.")),Vhe=R("peekView.border",{dark:Ss,light:Ss,hcDark:dt,hcLight:dt},p("peekViewBorder","Color of the peek view borders and arrow.")),Hhe=R("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:q.black,hcLight:q.white},p("peekViewResultsBackground","Background color of the peek view result list."));R("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:q.white,hcLight:cr},p("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));R("peekViewResult.fileForeground",{dark:q.white,light:"#1E1E1E",hcDark:q.white,hcLight:cr},p("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));R("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},p("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));R("peekViewResult.selectionForeground",{dark:q.white,light:"#6C6C6C",hcDark:q.white,hcLight:cr},p("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const rc=R("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:q.black,hcLight:q.white},p("peekViewEditorBackground","Background color of the peek view editor."));R("peekViewEditorGutter.background",{dark:rc,light:rc,hcDark:rc,hcLight:rc},p("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));R("peekViewEditorStickyScroll.background",{dark:rc,light:rc,hcDark:rc,hcLight:rc},p("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));R("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},p("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));R("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},p("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));R("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:Zt,hcLight:Zt},p("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));class Zc{constructor(e,t,i,n){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=n,this.id=$I.nextId()}get uri(){return this.link.uri}get range(){var e,t;return(t=(e=this._range)!==null&&e!==void 0?e:this.link.targetSelectionRange)!==null&&t!==void 0?t:this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){var e;const t=(e=this.parent.getPreview(this))===null||e===void 0?void 0:e.preview(this.range);return t?p({},"{0} in {1} on line {2} at column {3}",t.value,qo(this.uri),this.range.startLineNumber,this.range.startColumn):p("aria.oneReference","in {0} on line {1} at column {2}",qo(this.uri),this.range.startLineNumber,this.range.startColumn)}}class zhe{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:n,startColumn:s,endLineNumber:r,endColumn:a}=e,l=i.getWordUntilPosition({lineNumber:n,column:s-t}),d=new k(n,l.startColumn,n,s),c=new k(r,a,r,1073741824),h=i.getValueInRange(d).replace(/^\s+/,""),u=i.getValueInRange(e),g=i.getValueInRange(c).replace(/\s+$/,"");return{value:h+u+g,highlight:{start:h.length,end:h.length+u.length}}}}class H0{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new xi}dispose(){Et(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?p("aria.fileReferences.1","1 symbol in {0}, full path {1}",qo(this.uri),this.uri.fsPath):p("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,qo(this.uri),this.uri.fsPath)}async resolve(e){if(this._previews.size!==0)return this;for(const t of this.children)if(!this._previews.has(t.uri))try{const i=await e.createModelReference(t.uri);this._previews.set(t.uri,new zhe(i))}catch(i){Ge(i)}return this}}class Us{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new W,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;e.sort(Us._compareReferences);let n;for(const s of e)if((!n||!Yt.isEqual(n.uri,s.uri,!0))&&(n=new H0(this,s.uri),this.groups.push(n)),n.children.length===0||Us._compareReferences(s,n.children[n.children.length-1])!==0){const r=new Zc(i===s,n,s,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(r),n.children.push(r)}}dispose(){Et(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new Us(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?p("aria.result.0","No results found"):this.references.length===1?p("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?p("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):p("aria.result.nm","Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:i}=e;let n=i.children.indexOf(e);const s=i.children.length,r=i.parent.groups.length;return r===1||t&&n+1<s||!t&&n>0?(t?n=(n+1)%s:n=(n+s-1)%s,i.children[n]):(n=i.parent.groups.indexOf(i),t?(n=(n+1)%r,i.parent.groups[n].children[0]):(n=(n+r-1)%r,i.parent.groups[n].children[i.parent.groups[n].children.length-1]))}nearestReference(e,t){const i=this.references.map((n,s)=>({idx:s,prefixLen:bu(n.uri.toString(),e.toString()),offsetDist:Math.abs(n.range.startLineNumber-t.lineNumber)*100+Math.abs(n.range.startColumn-t.column)})).sort((n,s)=>n.prefixLen>s.prefixLen?-1:n.prefixLen<s.prefixLen?1:n.offsetDist<s.offsetDist?-1:n.offsetDist>s.offsetDist?1:0)[0];if(i)return this.references[i.idx]}referenceAt(e,t){for(const i of this.references)if(i.uri.toString()===e.toString()&&k.containsPosition(i.range,t))return i}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return Yt.compare(e.uri,t.uri)||k.compareRangesUsingStarts(e.range,t.range)}}var Py=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Oy=function(o,e){return function(t,i){e(t,i,o)}},hN;let uN=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof Us||e instanceof H0}getChildren(e){if(e instanceof Us)return e.groups;if(e instanceof H0)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};uN=Py([Oy(0,ks)],uN);class Uhe{getHeight(){return 23}getTemplateId(e){return e instanceof H0?z0.id:$v.id}}let gN=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof Zc){const i=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(i)return i.value}return qo(e.uri)}};gN=Py([Oy(0,Pt)],gN);class $he{getId(e){return e instanceof Zc?e.id:e.uri}}let fN=class extends K{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new Lw(i,{supportHighlights:!0})),this.badge=new gE(ie(i,pe(".count")),{},nB),e.appendChild(i)}set(e,t){const i=QS(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(i,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});const n=e.children.length;this.badge.setCount(n),n>1?this.badge.setTitleFormat(p("referencesCount","{0} references",n)):this.badge.setTitleFormat(p("referenceCount","{0} reference",n))}};fN=Py([Oy(1,ap)],fN);let z0=hN=class{constructor(e){this._instantiationService=e,this.templateId=hN.id}renderTemplate(e){return this._instantiationService.createInstance(fN,e)}renderElement(e,t,i){i.set(e.element,ry(e.filterData))}disposeTemplate(e){e.dispose()}};z0.id="FileReferencesRenderer";z0=hN=Py([Oy(0,Oe)],z0);class Khe{constructor(e){this.label=new Cc(e)}set(e,t){var i;const n=(i=e.parent.getPreview(e))===null||i===void 0?void 0:i.preview(e.range);if(!n||!n.value)this.label.set(`${qo(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:s,highlight:r}=n;t&&!Xr.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(s,ry(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(s,[r]))}}}class $v{constructor(){this.templateId=$v.id}renderTemplate(e){return new Khe(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(){}}$v.id="OneReferenceRenderer";class jhe{getWidgetAriaLabel(){return p("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var qhe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Tl=function(o,e){return function(t,i){e(t,i,o)}};class Fy{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new se,this._callOnModelChange=new se,this._callOnDispose.add(this._editor.onDidChangeModel(()=>this._onModelChanged())),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const e=this._editor.getModel();if(e){for(const t of this._model.references)if(t.uri.toString()===e.uri.toString()){this._addDecorations(t.parent);return}}}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));const t=[],i=[];for(let n=0,s=e.children.length;n<s;n++){const r=e.children[n];this._decorationIgnoreSet.has(r.id)||r.uri.toString()===this._editor.getModel().uri.toString()&&(t.push({range:r.range,options:Fy.DecorationOptions}),i.push(n))}this._editor.changeDecorations(n=>{const s=n.deltaDecorations([],t);for(let r=0;r<s.length;r++)this._decorations.set(s[r],e.children[i[r]])})}_onDecorationChanged(){const e=[],t=this._editor.getModel();if(t){for(const[i,n]of this._decorations){const s=t.getDecorationRange(i);if(!s)continue;let r=!1;if(!k.equalsRange(s,n.range)){if(k.spansMultipleLines(s))r=!0;else{const a=n.range.endColumn-n.range.startColumn,l=s.endColumn-s.startColumn;a!==l&&(r=!0)}r?(this._decorationIgnoreSet.add(n.id),e.push(i)):n.range=s}}for(let i=0,n=e.length;i<n;i++)this._decorations.delete(e[i]);this._editor.removeDecorations(e)}}removeDecorations(){this._editor.removeDecorations([...this._decorations.keys()]),this._decorations.clear()}}Fy.DecorationOptions=Ze.register({description:"reference-decoration",stickiness:1,className:"reference-decoration"});class Ghe{constructor(){this.ratio=.7,this.heightInLines=18}static fromJSON(e){let t,i;try{const n=JSON.parse(e);t=n.ratio,i=n.heightInLines}catch{}return{ratio:t||.7,heightInLines:i||18}}}class Zhe extends cE{}let pN=class extends Hw{constructor(e,t,i,n,s,r,a,l,d,c,h,u){super(e,{showFrame:!1,showArrow:!0,isResizeable:!0,isAccessible:!0,supportOnTitleClick:!0},r),this._defaultTreeKeyboardSupport=t,this.layoutData=i,this._textModelResolverService=s,this._instantiationService=r,this._peekViewService=a,this._uriLabel=l,this._undoRedoService=d,this._keybindingService=c,this._languageService=h,this._languageConfigurationService=u,this._disposeOnNewModel=new se,this._callOnDispose=new se,this._onDidSelectReference=new W,this.onDidSelectReference=this._onDidSelectReference.event,this._dim=new bt(0,0),this._applyTheme(n.getColorTheme()),this._callOnDispose.add(n.onDidColorThemeChange(this._applyTheme.bind(this))),this._peekViewService.addExclusiveWidget(e,this),this.create()}dispose(){this.setModel(void 0),this._callOnDispose.dispose(),this._disposeOnNewModel.dispose(),Et(this._preview),Et(this._previewNotAvailableMessage),Et(this._tree),Et(this._previewModelReference),this._splitView.dispose(),super.dispose()}_applyTheme(e){const t=e.getColor(Vhe)||q.transparent;this.style({arrowColor:t,frameColor:t,headerBackgroundColor:e.getColor(Whe)||q.transparent,primaryHeadingColor:e.getColor(Y6),secondaryHeadingColor:e.getColor(X6)})}show(e){super.show(e,this.layoutData.heightInLines||18)}focusOnReferenceTree(){this._tree.domFocus()}focusOnPreviewEditor(){this._preview.focus()}isPreviewEditorFocused(){return this._preview.hasTextFocus()}_onTitleClick(e){this._preview&&this._preview.getModel()&&this._onDidSelectReference.fire({element:this._getFocusedReference(),kind:e.ctrlKey||e.metaKey||e.altKey?"side":"open",source:"title"})}_fillBody(e){this.setCssClass("reference-zone-widget"),this._messageContainer=ie(e,pe("div.messages")),is(this._messageContainer),this._splitView=new aB(e,{orientation:1}),this._previewContainer=ie(e,pe("div.preview.inline"));const t={scrollBeyondLastLine:!1,scrollbar:{verticalScrollbarSize:14,horizontal:"auto",useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,alwaysConsumeMouseWheel:!0},overviewRulerLanes:2,fixedOverflowWidgets:!0,minimap:{enabled:!1}};this._preview=this._instantiationService.createInstance(Gc,this._previewContainer,t,{},this.editor),is(this._previewContainer),this._previewNotAvailableMessage=new gl(p("missingPreviewMessage","no preview available"),So,gl.DEFAULT_CREATION_OPTIONS,null,this._undoRedoService,this._languageService,this._languageConfigurationService),this._treeContainer=ie(e,pe("div.ref-tree.inline"));const i={keyboardSupport:this._defaultTreeKeyboardSupport,accessibilityProvider:new jhe,keyboardNavigationLabelProvider:this._instantiationService.createInstance(gN),identityProvider:new $he,openOnSingleClick:!0,selectionNavigation:!0,overrideStyles:{listBackground:Hhe}};this._defaultTreeKeyboardSupport&&this._callOnDispose.add(vi(this._treeContainer,"keydown",s=>{s.equals(9)&&(this._keybindingService.dispatchEvent(s,s.target),s.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(Zhe,"ReferencesWidget",this._treeContainer,new Uhe,[this._instantiationService.createInstance(z0),this._instantiationService.createInstance($v)],this._instantiationService.createInstance(uN),i),this._splitView.addView({onDidChange:fe.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:s=>{this._preview.layout({height:this._dim.height,width:s})}},_w.Distribute),this._splitView.addView({onDidChange:fe.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:s=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${s}px`,this._tree.layout(this._dim.height,s)}},_w.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const n=(s,r)=>{s instanceof Zc&&(r==="show"&&this._revealReference(s,!1),this._onDidSelectReference.fire({element:s,kind:r,source:"tree"}))};this._tree.onDidOpen(s=>{s.sideBySide?n(s.element,"side"):s.editorOptions.pinned?n(s.element,"goto"):n(s.element,"show")}),is(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new bt(t,e),this.layoutData.heightInLines=this._viewZone?this._viewZone.heightInLines:this.layoutData.heightInLines,this._splitView.layout(t),this._splitView.resizeView(0,t*this.layoutData.ratio)}setSelection(e){return this._revealReference(e,!0).then(()=>{this._model&&(this._tree.setSelection([e]),this._tree.setFocus([e]))})}setModel(e){return this._disposeOnNewModel.clear(),this._model=e,this._model?this._onNewModel():Promise.resolve()}_onNewModel(){return this._model?this._model.isEmpty?(this.setTitle(""),this._messageContainer.innerText=p("noResults","No results"),Os(this._messageContainer),Promise.resolve(void 0)):(is(this._messageContainer),this._decorationsManager=new Fy(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(e=>this._tree.rerender(e))),this._disposeOnNewModel.add(this._preview.onMouseDown(e=>{const{event:t,target:i}=e;if(t.detail!==2)return;const n=this._getFocusedReference();n&&this._onDidSelectReference.fire({element:{uri:n.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),Os(this._treeContainer),Os(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(this._model.groups.length===1?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){const[e]=this._tree.getFocus();if(e instanceof Zc)return e;if(e instanceof H0&&e.children.length>0)return e.children[0]}async revealReference(e){await this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})}async _revealReference(e,t){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==Ye.inMemory?this.setTitle(AQ(e.uri),this._uriLabel.getUriLabel(QS(e.uri))):this.setTitle(p("peekView.alternateTitle","References"));const i=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent?this._tree.reveal(e):(t&&this._tree.reveal(e.parent),await this._tree.expand(e.parent),this._tree.reveal(e));const n=await i;if(!this._model){n.dispose();return}Et(this._previewModelReference);const s=n.object;if(s){const r=this._preview.getModel()===s.textEditorModel?0:1,a=k.lift(e.range).collapseToStart();this._previewModelReference=n,this._preview.setModel(s.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,r)}else this._preview.setModel(this._previewNotAvailableMessage),n.dispose()}};pN=qhe([Tl(3,tn),Tl(4,ks),Tl(5,Oe),Tl(6,Z6),Tl(7,ap),Tl(8,JS),Tl(9,Pt),Tl(10,ni),Tl(11,Wt)],pN);var Yhe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},kg=function(o,e){return function(t,i){e(t,i,o)}},QC;const dg=new be("referenceSearchVisible",!1,p("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let Cp=QC=class{static get(e){return e.getContribution(QC.ID)}constructor(e,t,i,n,s,r,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=n,this._notificationService=s,this._instantiationService=r,this._storageService=a,this._configurationService=l,this._disposables=new se,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=dg.bindTo(i)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),(e=this._widget)===null||e===void 0||e.dispose(),(t=this._model)===null||t===void 0||t.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,i){let n;if(this._widget&&(n=this._widget.position),this.closeWidget(),n&&e.containsPosition(n))return;this._peekMode=i,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));const s="peekViewLayout",r=Ghe.fromJSON(this._storageService.get(s,0,"{}"));this._widget=this._instantiationService.createInstance(pN,this._editor,this._defaultTreeKeyboardSupport,r),this._widget.setTitle(p("labelLoading","Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store(s,JSON.stringify(this._widget.layoutData),0,1),this._widget=void 0),this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(l=>{const{element:d,kind:c}=l;if(d)switch(c){case"open":(l.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(d,!1,!1);break;case"side":this.openReference(d,!0,!1);break;case"goto":i?this._gotoReference(d,!0):this.openReference(d,!1,!0);break}}));const a=++this._requestIdPool;t.then(l=>{var d;if(a!==this._requestIdPool||!this._widget){l.dispose();return}return(d=this._model)===null||d===void 0||d.dispose(),this._model=l,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(p("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));const c=this._editor.getModel().uri,h=new V(e.startLineNumber,e.startColumn),u=this._model.nearestReference(c,h);if(u)return this._widget.setSelection(u).then(()=>{this._widget&&this._editor.getOption(86)==="editor"&&this._widget.focusOnPreviewEditor()})}})},l=>{this._notificationService.error(l)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}async goToNextOrPreviousReference(e){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const i=this._model.nearestReference(this._editor.getModel().uri,t);if(!i)return;const n=this._model.nextOrPreviousReference(i,e),s=this._editor.hasTextFocus(),r=this._widget.isPreviewEditorFocused();await this._widget.setSelection(n),await this._gotoReference(n,!1),s?this._editor.focus():this._widget&&r&&this._widget.focusOnPreviewEditor()}async revealReference(e){!this._editor.hasModel()||!this._model||!this._widget||await this._widget.revealReference(e)}closeWidget(e=!0){var t,i;(t=this._widget)===null||t===void 0||t.dispose(),(i=this._model)===null||i===void 0||i.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(e,t){var i;(i=this._widget)===null||i===void 0||i.hide(),this._ignoreModelChangeEvent=!0;const n=k.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:n,selectionSource:"code.jump",pinned:t}},this._editor).then(s=>{var r;if(this._ignoreModelChangeEvent=!1,!s||!this._widget){this.closeWidget();return}if(this._editor===s)this._widget.show(n),this._widget.focusOnReferenceTree();else{const a=QC.get(s),l=this._model.clone();this.closeWidget(),s.focus(),a?.toggleWidget(n,Zi(d=>Promise.resolve(l)),(r=this._peekMode)!==null&&r!==void 0?r:!1)}},s=>{this._ignoreModelChangeEvent=!1,Ge(s)})}openReference(e,t,i){t||this.closeWidget();const{uri:n,range:s}=e;this._editorService.openCodeEditor({resource:n,options:{selection:s,selectionSource:"code.jump",pinned:i}},this._editor,t)}};Cp.ID="editor.contrib.referencesController";Cp=QC=Yhe([kg(2,We),kg(3,Dt),kg(4,Vi),kg(5,Oe),kg(6,da),kg(7,ft)],Cp);function cg(o,e){const t=Fhe(o);if(!t)return;const i=Cp.get(t);i&&e(i)}Ls.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:qi(2089,60),when:te.or(dg,xs.inPeekEditor),handler(o){cg(o,e=>{e.changeFocusBetweenPreviewAndReferences()})}});Ls.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:te.or(dg,xs.inPeekEditor),handler(o){cg(o,e=>{e.goToNextOrPreviousReference(!0)})}});Ls.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:te.or(dg,xs.inPeekEditor),handler(o){cg(o,e=>{e.goToNextOrPreviousReference(!1)})}});gt.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");gt.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");gt.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");gt.registerCommand("closeReferenceSearch",o=>cg(o,e=>e.closeWidget()));Ls.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:te.and(xs.inPeekEditor,te.not("config.editor.stablePeek"))});Ls.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:te.and(dg,te.not("config.editor.stablePeek"))});Ls.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:te.and(dg,SB,KM.negate(),jM.negate()),handler(o){var e;const i=(e=o.get(Qo).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof Zc&&cg(o,n=>n.revealReference(i[0]))}});Ls.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:te.and(dg,SB,KM.negate(),jM.negate()),handler(o){var e;const i=(e=o.get(Qo).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof Zc&&cg(o,n=>n.openReference(i[0],!0,!0))}});gt.registerCommand("openReference",o=>{var e;const i=(e=o.get(Qo).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof Zc&&cg(o,n=>n.openReference(i[0],!1,!0))});var Q6=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Gm=function(o,e){return function(t,i){e(t,i,o)}};const wR=new be("hasSymbols",!1,p("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),By=ot("ISymbolNavigationService");let mN=class{constructor(e,t,i,n){this._editorService=t,this._notificationService=i,this._keybindingService=n,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=wR.bindTo(e)}reset(){var e,t;this._ctxHasSymbols.reset(),(e=this._currentState)===null||e===void 0||e.dispose(),(t=this._currentMessage)===null||t===void 0||t.dispose(),this._currentModel=void 0,this._currentIdx=-1}put(e){const t=e.parent.parent;if(t.references.length<=1){this.reset();return}this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const i=new _N(this._editorService),n=i.onDidChange(s=>{if(this._ignoreEditorChange)return;const r=this._editorService.getActiveCodeEditor();if(!r)return;const a=r.getModel(),l=r.getPosition();if(!a||!l)return;let d=!1,c=!1;for(const h of t.references)if(J2(h.uri,a.uri))d=!0,c=c||k.containsPosition(h.range,l);else if(d)break;(!d||!c)&&this.reset()});this._currentState=fr(i,n)}revealNext(e){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;const t=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:t.uri,options:{selection:k.collapseToStart(t.range),selectionRevealType:3}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){var e;(e=this._currentMessage)===null||e===void 0||e.dispose();const t=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),i=t?p("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):p("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(i)}};mN=Q6([Gm(0,We),Gm(1,Dt),Gm(2,Vi),Gm(3,Pt)],mN);ct(By,mN,1);ue(new class extends cn{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:wR,kbOpts:{weight:100,primary:70}})}runEditorCommand(o,e){return o.get(By).revealNext(e)}});Ls.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:wR,primary:9,handler(o){o.get(By).reset()}});let _N=class{constructor(e){this._listener=new Map,this._disposables=new se,this._onDidChange=new W,this.onDidChange=this._onDidChange.event,this._disposables.add(e.onCodeEditorRemove(this._onDidRemoveEditor,this)),this._disposables.add(e.onCodeEditorAdd(this._onDidAddEditor,this)),e.listCodeEditors().forEach(this._onDidAddEditor,this)}dispose(){this._disposables.dispose(),this._onDidChange.dispose(),Et(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,fr(e.onDidChangeCursorPosition(t=>this._onDidChange.fire({editor:e})),e.onDidChangeModelContent(t=>this._onDidChange.fire({editor:e}))))}_onDidRemoveEditor(e){var t;(t=this._listener.get(e))===null||t===void 0||t.dispose(),this._listener.delete(e)}};_N=Q6([Gm(0,Dt)],_N);async function Kv(o,e,t,i){const s=t.ordered(o).map(a=>Promise.resolve(i(a,o,e)).then(void 0,l=>{Mi(l)})),r=await Promise.all(s);return Qr(r.flat())}function Wy(o,e,t,i){return Kv(e,t,o,(n,s,r)=>n.provideDefinition(s,r,i))}function J6(o,e,t,i){return Kv(e,t,o,(n,s,r)=>n.provideDeclaration(s,r,i))}function eW(o,e,t,i){return Kv(e,t,o,(n,s,r)=>n.provideImplementation(s,r,i))}function tW(o,e,t,i){return Kv(e,t,o,(n,s,r)=>n.provideTypeDefinition(s,r,i))}function Vy(o,e,t,i,n){return Kv(e,t,o,async(s,r,a)=>{const l=await s.provideReferences(r,a,{includeDeclaration:!0},n);if(!i||!l||l.length!==2)return l;const d=await s.provideReferences(r,a,{includeDeclaration:!1},n);return d&&d.length===1?d:l})}async function jv(o){const e=await o(),t=new Us(e,""),i=t.references.map(n=>n.link);return t.dispose(),i}Cl("_executeDefinitionProvider",(o,e,t)=>{const i=o.get(Se),n=Wy(i.definitionProvider,e,t,st.None);return jv(()=>n)});Cl("_executeTypeDefinitionProvider",(o,e,t)=>{const i=o.get(Se),n=tW(i.typeDefinitionProvider,e,t,st.None);return jv(()=>n)});Cl("_executeDeclarationProvider",(o,e,t)=>{const i=o.get(Se),n=J6(i.declarationProvider,e,t,st.None);return jv(()=>n)});Cl("_executeReferenceProvider",(o,e,t)=>{const i=o.get(Se),n=Vy(i.referenceProvider,e,t,!1,st.None);return jv(()=>n)});Cl("_executeImplementationProvider",(o,e,t)=>{const i=o.get(Se),n=eW(i.implementationProvider,e,t,st.None);return jv(()=>n)});var ym,Lm,xm,Gb,Zb,Yb,Xb,Qb;vn.appendMenuItem(N.EditorContext,{submenu:N.EditorContextPeek,title:p("peek.submenu","Peek"),group:"navigation",order:100});class wp{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof wp||V.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}class Yn extends aa{static all(){return Yn._allSymbolNavigationCommands.values()}static _patchConfig(e){const t={...e,f1:!0};if(t.menu)for(const i of rt.wrap(t.menu))(i.id===N.EditorContext||i.id===N.EditorContextPeek)&&(i.when=te.and(e.precondition,i.when));return t}constructor(e,t){super(Yn._patchConfig(t)),this.configuration=e,Yn._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,n){if(!t.hasModel())return Promise.resolve(void 0);const s=e.get(Vi),r=e.get(Dt),a=e.get(lh),l=e.get(By),d=e.get(Se),c=e.get(Oe),h=t.getModel(),u=t.getPosition(),g=wp.is(i)?i:new wp(h,u),f=new Uc(t,5),m=DS(this._getLocationModel(d,g.model,g.position,f.token),f.token).then(async _=>{var v;if(!_||f.token.isCancellationRequested)return;js(_.ariaMessage);let b;if(_.referenceAt(h.uri,u)){const w=this._getAlternativeCommand(t);!Yn._activeAlternativeCommands.has(w)&&Yn._allSymbolNavigationCommands.has(w)&&(b=Yn._allSymbolNavigationCommands.get(w))}const C=_.references.length;if(C===0){if(!this.configuration.muteMessage){const w=h.getWordAtPosition(u);(v=zs.get(t))===null||v===void 0||v.showMessage(this._getNoResultFoundMessage(w),u)}}else if(C===1&&b)Yn._activeAlternativeCommands.add(this.desc.id),c.invokeFunction(w=>b.runEditorCommand(w,t,i,n).finally(()=>{Yn._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(r,l,t,_,n)},_=>{s.error(_)}).finally(()=>{f.dispose()});return a.showWhile(m,250),m}async _onResult(e,t,i,n,s){const r=this._getGoToPreference(i);if(!(i instanceof Gc)&&(this.configuration.openInPeek||r==="peek"&&n.references.length>1))this._openInPeek(i,n,s);else{const a=n.firstReference(),l=n.references.length>1&&r==="gotoAndPeek",d=await this._openReference(i,e,a,this.configuration.openToSide,!l);l&&d?this._openInPeek(d,n,s):n.dispose(),r==="goto"&&t.put(a)}}async _openReference(e,t,i,n,s){let r;if(Xz(i)&&(r=i.targetSelectionRange),r||(r=i.range),!r)return;const a=await t.openCodeEditor({resource:i.uri,options:{selection:k.collapseToStart(r),selectionRevealType:3,selectionSource:"code.jump"}},e,n);if(a){if(s){const l=a.getModel(),d=a.createDecorationsCollection([{range:r,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&d.clear()},350)}return a}}_openInPeek(e,t,i){const n=Cp.get(e);n&&e.hasModel()?n.toggleWidget(i??e.getSelection(),Zi(s=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}Yn._allSymbolNavigationCommands=new Map;Yn._activeAlternativeCommands=new Set;class qv extends Yn{async _getLocationModel(e,t,i,n){return new Us(await Wy(e.definitionProvider,t,i,n),p("def.title","Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?p("noResultWord","No definition found for '{0}'",e.word):p("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleDefinitions}}Xt((ym=class extends qv{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:ym.id,title:{value:p("actions.goToDecl.label","Go to Definition"),original:"Go to Definition",mnemonicTitle:p({},"Go to &&Definition")},precondition:te.and(M.hasDefinitionProvider,M.isInWalkThroughSnippet.toNegated()),keybinding:[{when:M.editorTextFocus,primary:70,weight:100},{when:te.and(M.editorTextFocus,bB),primary:2118,weight:100}],menu:[{id:N.EditorContext,group:"navigation",order:1.1},{id:N.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),gt.registerCommandAlias("editor.action.goToDeclaration",ym.id)}},ym.id="editor.action.revealDefinition",ym));Xt((Lm=class extends qv{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:Lm.id,title:{value:p("actions.goToDeclToSide.label","Open Definition to the Side"),original:"Open Definition to the Side"},precondition:te.and(M.hasDefinitionProvider,M.isInWalkThroughSnippet.toNegated()),keybinding:[{when:M.editorTextFocus,primary:qi(2089,70),weight:100},{when:te.and(M.editorTextFocus,bB),primary:qi(2089,2118),weight:100}]}),gt.registerCommandAlias("editor.action.openDeclarationToTheSide",Lm.id)}},Lm.id="editor.action.revealDefinitionAside",Lm));Xt((xm=class extends qv{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:xm.id,title:{value:p("actions.previewDecl.label","Peek Definition"),original:"Peek Definition"},precondition:te.and(M.hasDefinitionProvider,xs.notInPeekEditor,M.isInWalkThroughSnippet.toNegated()),keybinding:{when:M.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:N.EditorContextPeek,group:"peek",order:2}}),gt.registerCommandAlias("editor.action.previewDeclaration",xm.id)}},xm.id="editor.action.peekDefinition",xm));class iW extends Yn{async _getLocationModel(e,t,i,n){return new Us(await J6(e.declarationProvider,t,i,n),p("decl.title","Declarations"))}_getNoResultFoundMessage(e){return e&&e.word?p("decl.noResultWord","No declaration found for '{0}'",e.word):p("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(58).multipleDeclarations}}Xt((Gb=class extends iW{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:Gb.id,title:{value:p("actions.goToDeclaration.label","Go to Declaration"),original:"Go to Declaration",mnemonicTitle:p({},"Go to &&Declaration")},precondition:te.and(M.hasDeclarationProvider,M.isInWalkThroughSnippet.toNegated()),menu:[{id:N.EditorContext,group:"navigation",order:1.3},{id:N.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?p("decl.noResultWord","No declaration found for '{0}'",e.word):p("decl.generic.noResults","No declaration found")}},Gb.id="editor.action.revealDeclaration",Gb));Xt(class extends iW{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:{value:p("actions.peekDecl.label","Peek Declaration"),original:"Peek Declaration"},precondition:te.and(M.hasDeclarationProvider,xs.notInPeekEditor,M.isInWalkThroughSnippet.toNegated()),menu:{id:N.EditorContextPeek,group:"peek",order:3}})}});class nW extends Yn{async _getLocationModel(e,t,i,n){return new Us(await tW(e.typeDefinitionProvider,t,i,n),p("typedef.title","Type Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?p("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):p("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleTypeDefinitions}}Xt((Zb=class extends nW{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:Zb.ID,title:{value:p("actions.goToTypeDefinition.label","Go to Type Definition"),original:"Go to Type Definition",mnemonicTitle:p({},"Go to &&Type Definition")},precondition:te.and(M.hasTypeDefinitionProvider,M.isInWalkThroughSnippet.toNegated()),keybinding:{when:M.editorTextFocus,primary:0,weight:100},menu:[{id:N.EditorContext,group:"navigation",order:1.4},{id:N.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},Zb.ID="editor.action.goToTypeDefinition",Zb));Xt((Yb=class extends nW{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:Yb.ID,title:{value:p("actions.peekTypeDefinition.label","Peek Type Definition"),original:"Peek Type Definition"},precondition:te.and(M.hasTypeDefinitionProvider,xs.notInPeekEditor,M.isInWalkThroughSnippet.toNegated()),menu:{id:N.EditorContextPeek,group:"peek",order:4}})}},Yb.ID="editor.action.peekTypeDefinition",Yb));class sW extends Yn{async _getLocationModel(e,t,i,n){return new Us(await eW(e.implementationProvider,t,i,n),p("impl.title","Implementations"))}_getNoResultFoundMessage(e){return e&&e.word?p("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):p("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(58).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(58).multipleImplementations}}Xt((Xb=class extends sW{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:Xb.ID,title:{value:p("actions.goToImplementation.label","Go to Implementations"),original:"Go to Implementations",mnemonicTitle:p({},"Go to &&Implementations")},precondition:te.and(M.hasImplementationProvider,M.isInWalkThroughSnippet.toNegated()),keybinding:{when:M.editorTextFocus,primary:2118,weight:100},menu:[{id:N.EditorContext,group:"navigation",order:1.45},{id:N.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},Xb.ID="editor.action.goToImplementation",Xb));Xt((Qb=class extends sW{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:Qb.ID,title:{value:p("actions.peekImplementation.label","Peek Implementations"),original:"Peek Implementations"},precondition:te.and(M.hasImplementationProvider,xs.notInPeekEditor,M.isInWalkThroughSnippet.toNegated()),keybinding:{when:M.editorTextFocus,primary:3142,weight:100},menu:{id:N.EditorContextPeek,group:"peek",order:5}})}},Qb.ID="editor.action.peekImplementation",Qb));class oW extends Yn{_getNoResultFoundMessage(e){return e?p("references.no","No references found for '{0}'",e.word):p("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(58).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(58).multipleReferences}}Xt(class extends oW{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{value:p("goToReferences.label","Go to References"),original:"Go to References",mnemonicTitle:p({},"Go to &&References")},precondition:te.and(M.hasReferenceProvider,xs.notInPeekEditor,M.isInWalkThroughSnippet.toNegated()),keybinding:{when:M.editorTextFocus,primary:1094,weight:100},menu:[{id:N.EditorContext,group:"navigation",order:1.45},{id:N.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}async _getLocationModel(e,t,i,n){return new Us(await Vy(e.referenceProvider,t,i,!0,n),p("ref.title","References"))}});Xt(class extends oW{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:{value:p("references.action.label","Peek References"),original:"Peek References"},precondition:te.and(M.hasReferenceProvider,xs.notInPeekEditor,M.isInWalkThroughSnippet.toNegated()),menu:{id:N.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(e,t,i,n){return new Us(await Vy(e.referenceProvider,t,i,!1,n),p("ref.title","References"))}});class Xhe extends Yn{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:{value:p("label.generic","Go to Any Symbol"),original:"Go to Any Symbol"},precondition:te.and(xs.notInPeekEditor,M.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}async _getLocationModel(e,t,i,n){return new Us(this._references,p("generic.title","Locations"))}_getNoResultFoundMessage(e){return e&&p("generic.noResult","No results for '{0}'",e.word)||""}_getGoToPreference(e){var t;return(t=this._gotoMultipleBehaviour)!==null&&t!==void 0?t:e.getOption(58).multipleReferences}_getAlternativeCommand(){return""}}gt.registerCommand({id:"editor.action.goToLocations",metadata:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:Me},{name:"position",description:"The position at which to start",constraint:V.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:async(o,e,t,i,n,s,r)=>{Tt(Me.isUri(e)),Tt(V.isIPosition(t)),Tt(Array.isArray(i)),Tt(typeof n>"u"||typeof n=="string"),Tt(typeof r>"u"||typeof r=="boolean");const a=o.get(Dt),l=await a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if($c(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(d=>{const c=new class extends Xhe{_getNoResultFoundMessage(h){return s||super._getNoResultFoundMessage(h)}}({muteMessage:!s,openInPeek:!!r,openToSide:!1},i,n);d.get(Oe).invokeFunction(c.run.bind(c),l)})}});gt.registerCommand({id:"editor.action.peekLocations",metadata:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:Me},{name:"position",description:"The position at which to start",constraint:V.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"}]},handler:async(o,e,t,i,n)=>{o.get(ui).executeCommand("editor.action.goToLocations",e,t,i,n,void 0,!0)}});gt.registerCommand({id:"editor.action.findReferences",handler:(o,e,t)=>{Tt(Me.isUri(e)),Tt(V.isIPosition(t));const i=o.get(Se),n=o.get(Dt);return n.openCodeEditor({resource:e},n.getFocusedCodeEditor()).then(s=>{if(!$c(s)||!s.hasModel())return;const r=Cp.get(s);if(!r)return;const a=Zi(d=>Vy(i.referenceProvider,s.getModel(),V.lift(t),!1,d).then(c=>new Us(c,p("ref.title","References")))),l=new k(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(r.toggleWidget(l,a,!1))})}});gt.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");var Qhe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},lD=function(o,e){return function(t,i){e(t,i,o)}},Zm;let Hu=Zm=class{constructor(e,t,i,n){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=n,this.toUnhook=new se,this.toUnhookForKeyboard=new se,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const s=new Ry(e);this.toUnhook.add(s),this.toUnhook.add(s.onMouseMoveOrRelevantKeyDown(([r,a])=>{this.startFindDefinitionFromMouse(r,a??void 0)})),this.toUnhook.add(s.onExecute(r=>{this.isEnabled(r)&&this.gotoDefinition(r.target.position,r.hasSideBySideModifier).catch(a=>{Ge(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(s.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(Zm.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 t;this.toUnhookForKeyboard.clear();const i=e?(t=this.editor.getModel())===null||t===void 0?void 0:t.getWordAtPosition(e):null;if(!i){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===i.startColumn&&this.currentWordAtPosition.endColumn===i.endColumn&&this.currentWordAtPosition.word===i.word)return;this.currentWordAtPosition=i;const n=new r6(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=Zi(a=>this.findDefinition(e,a));let s;try{s=await this.previousPromise}catch(a){Ge(a);return}if(!s||!s.length||!n.validate(this.editor)){this.removeLinkDecorations();return}const r=s[0].originSelectionRange?k.lift(s[0].originSelectionRange):new k(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn);if(s.length>1){let a=r;for(const{originSelectionRange:l}of s)l&&(a=k.plusRange(a,l));this.addDecoration(a,new Fn().appendText(p("multipleResults","Click to show {0} definitions.",s.length)))}else{const a=s[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:c}=a.range;if(c<1||c>d.getLineCount()){l.dispose();return}const h=this.getPreviewValue(d,c,a),u=this.languageService.guessLanguageIdByFilepathOrFirstLine(d.uri);this.addDecoration(r,h?new Fn().appendCodeblock(u||"",h):void 0),l.dispose()})}}getPreviewValue(e,t,i){let n=i.range;return n.endLineNumber-n.startLineNumber>=Zm.MAX_SOURCE_PREVIEW_LINES&&(n=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,n)}stripIndentationFromPreviewRange(e,t,i){let s=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a<i.endLineNumber;a++){const l=e.getLineFirstNonWhitespaceColumn(a);s=Math.min(s,l)}return e.getValueInRange(i).replace(new RegExp(`^\\s{${s-1}}`,"gm"),"").trim()}getPreviewRangeBasedOnIndentation(e,t){const i=e.getLineFirstNonWhitespaceColumn(t),n=Math.min(e.getLineCount(),t+Zm.MAX_SOURCE_PREVIEW_LINES);let s=t+1;for(;s<n;s++){const r=e.getLineFirstNonWhitespaceColumn(s);if(i===r)break}return new k(t,1,s+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||i===void 0?void 0:i.options)instanceof Hc)&&(e.hasTriggerModifier||(t?t.keyCodeIsTriggerKey:!1))&&this.languageFeaturesService.definitionProvider.has(this.editor.getModel())}findDefinition(e,t){const i=this.editor.getModel();return i?Wy(this.languageFeaturesService.definitionProvider,i,e,t):Promise.resolve(null)}gotoDefinition(e,t){return this.editor.setPosition(e),this.editor.invokeWithinContext(i=>{const n=!t&&this.editor.getOption(87)&&!this.isInPeekEditor(i);return new qv({openToSide:t,openInPeek:n,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(We);return xs.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};Hu.ID="editor.contrib.gotodefinitionatposition";Hu.MAX_SOURCE_PREVIEW_LINES=8;Hu=Zm=Qhe([lD(1,ks),lD(2,ni),lD(3,Se)],Hu);yt(Hu.ID,Hu,2);const Jb=pe;class rW extends K{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 Cv(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class SR extends K{static render(e,t,i){return new SR(e,t,i)}constructor(e,t,i){super(),this.actionContainer=ie(e,Jb("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=ie(this.actionContainer,Jb("a.action")),this.action.setAttribute("role","button"),t.iconClass&&ie(this.action,Jb(`span.icon.${t.iconClass}`));const n=ie(this.action,Jb("span"));n.textContent=i?`${t.label} (${i})`:t.label,this._register(Q(this.actionContainer,ge.CLICK,s=>{s.stopPropagation(),s.preventDefault(),t.run(this.actionContainer)})),this._register(Q(this.actionContainer,ge.KEY_DOWN,s=>{const r=new Gt(s);(r.equals(3)||r.equals(10))&&(s.stopPropagation(),s.preventDefault(),t.run(this.actionContainer))})),this.setEnabled(!0)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}function Jhe(o,e){return o&&e?p("acessibleViewHint","Inspect this in the accessible view with {0}.",e):o?p("acessibleViewHintNoKbOpen","Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}let eue=class{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}};class aW extends K{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new W),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new Rt(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new Rt(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new Rt(()=>this._triggerLoadingMessage(),0)),this._state=0,this._asyncIterable=null,this._asyncIterableDone=!1,this._result=[]}dispose(){this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),super.dispose()}get _hoverTime(){return this._editor.getOption(60).delay}get _firstWaitTime(){return this._hoverTime/2}get _secondWaitTime(){return this._hoverTime-this._firstWaitTime}get _loadingMessageTime(){return 3*this._hoverTime}_setState(e,t=!0){this._state=e,t&&this._fireResult()}_triggerAsyncComputation(){this._setState(2),this._secondWaitScheduler.schedule(this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=o$(e=>this._computer.computeAsync(e)),(async()=>{try{for await(const e of this._asyncIterable)e&&(this._result.push(e),this._fireResult());this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0)}catch(e){Ge(e)}})()):this._asyncIterableDone=!0}_triggerSyncComputation(){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync())),this._setState(this._asyncIterableDone?0:3)}_triggerLoadingMessage(){this._state===3&&this._setState(4)}_fireResult(){if(this._state===1||this._state===2)return;const e=this._state===0,t=this._state===4;this._onResult.fire(new eue(this._result.slice(0),e,t))}start(e){if(e===0)this._state===0&&(this._setState(1),this._firstWaitScheduler.schedule(this._firstWaitTime),this._loadingMessageScheduler.schedule(this._loadingMessageTime));else switch(this._state){case 0:this._triggerAsyncComputation(),this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break;case 2:this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break}}cancel(){this._firstWaitScheduler.cancel(),this._secondWaitScheduler.cancel(),this._loadingMessageScheduler.cancel(),this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._result=[],this._setState(0,!1)}}class dD{constructor(e,t,i,n){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=n,this.type=1}equals(e){return e.type===1&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===1&&t.lineNumber===this.range.startLineNumber}}class JC{constructor(e,t,i,n,s,r){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=n,this.initialMousePosY=s,this.supportsMarkerHover=r,this.type=2}equals(e){return e.type===2&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===2&&this.owner===e.owner}}const hg=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class yR{constructor(){this._onDidWillResize=new W,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new W,this.onDidResize=this._onDidResize.event,this._sashListener=new se,this._size=new bt(0,0),this._minSize=new bt(0,0),this._maxSize=new bt(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new An(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new An(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new An(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:pw.North}),this._southSash=new An(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:pw.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let e,t=0,i=0;this._sashListener.add(fe.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,i=0)})),this._sashListener.add(fe.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,i=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(n=>{e&&(i=n.currentX-n.startX,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(n=>{e&&(i=-(n.currentX-n.startX),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(n=>{e&&(t=-(n.currentY-n.startY),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(n=>{e&&(t=n.currentY-n.startY,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(fe.any(this._eastSash.onDidReset,this._westSash.onDidReset)(n=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(fe.any(this._northSash.onDidReset,this._southSash.onDidReset)(n=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,i,n){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=i?3:0,this._westSash.state=n?3:0}layout(e=this.size.height,t=this.size.width){const{height:i,width:n}=this._minSize,{height:s,width:r}=this._maxSize;e=Math.max(i,Math.min(s,e)),t=Math.max(n,Math.min(r,t));const a=new bt(t,e);bt.equals(a,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=a,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}}const tue=30,iue=24;class nue extends K{constructor(e,t=new bt(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new yR),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=bt.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(i=>{this._resize(new bt(i.dimension.width,i.dimension.height)),i.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){var e;return!((e=this._contentPosition)===null||e===void 0)&&e.position?V.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);return!t||!i?void 0:ji(t).top+i.top-tue}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const n=ji(t),s=Lu(t.ownerDocument.body),r=n.top+i.top+i.height;return s.height-r-iue}_findPositionPreference(e,t){var i,n;const s=Math.min((i=this._availableVerticalSpaceBelow(t))!==null&&i!==void 0?i:1/0,e),r=Math.min((n=this._availableVerticalSpaceAbove(t))!==null&&n!==void 0?n:1/0,e),a=Math.min(Math.max(r,s),e),l=Math.min(e,a);let d;return this._editor.getOption(60).above?d=l<=r?1:2:d=l<=s?2:1,d===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),d}_resize(e){this._resizableNode.layout(e.height,e.width)}}var LR=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},ru=function(o,e){return function(t,i){e(t,i,o)}},e1,Ca;const n5=pe;let zw=e1=class extends K{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(yc,this._editor)),this._participants=[];for(const n of hg.getAll())this._participants.push(this._instantiationService.createInstance(n,this._editor));this._participants.sort((n,s)=>n.hoverOrdinal-s.hoverOrdinal),this._computer=new $w(this._editor,this._participants),this._hoverOperation=this._register(new aW(this._editor,this._computer)),this._register(this._hoverOperation.onResult(n=>{if(!this._computer.anchor)return;const s=n.hasLoadingMessage?this._addLoadingMessage(n.value):n.value;this._withResult(new lW(this._computer.anchor,s,n.isComplete))})),this._register(vi(this._widget.getDomNode(),"keydown",n=>{n.equals(9)&&this.hide()})),this._register(Ti.onDidChange(()=>{this._widget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))}get widget(){return this._widget}maybeShowAt(e){if(this._widget.isResizing)return!0;const t=[];for(const n of this._participants)if(n.suggestHoverAnchor){const s=n.suggestHoverAnchor(e);s&&t.push(s)}const i=e.target;if(i.type===6&&t.push(new dD(0,i.range,e.event.posx,e.event.posy)),i.type===7){const n=this._editor.getOption(50).typicalHalfwidthCharacterWidth/2;!i.detail.isAfterLines&&typeof i.detail.horizontalDistanceToText=="number"&&i.detail.horizontalDistanceToText<n&&t.push(new dD(0,i.range,e.event.posx,e.event.posy))}return t.length===0?this._startShowingOrUpdateHover(null,0,0,!1,e):(t.sort((n,s)=>s.priority-n.priority),this._startShowingOrUpdateHover(t[0],0,0,!1,e))}startShowingAtRange(e,t,i,n){this._startShowingOrUpdateHover(new dD(0,e,void 0,void 0),t,i,n,null)}_startShowingOrUpdateHover(e,t,i,n,s){return!this._widget.position||!this._currentResult?e?(this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):!1:this._editor.getOption(60).sticky&&s&&this._widget.isMouseGettingCloser(s.event.posx,s.event.posy)?(e&&this._startHoverOperationIfNecessary(e,t,i,n,!0),!0):e?e&&this._currentResult.anchor.equals(e)?!0:e.canAdoptVisibleHover(this._currentResult.anchor,this._widget.position)?(this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,i,n,s){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=n,this._computer.source=i,this._computer.insistOnKeepingHoverVisible=s,this._hoverOperation.start(t))}_setCurrentResult(e){this._currentResult!==e&&(e&&e.messages.length===0&&(e=null),this._currentResult=e,this._currentResult?this._renderMessages(this._currentResult.anchor,this._currentResult.messages):this._widget.hide())}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}get isColorPickerVisible(){return this._widget.isColorPickerVisible}get isVisibleFromKeyboard(){return this._widget.isVisibleFromKeyboard}get isVisible(){return this._widget.isVisible}get isFocused(){return this._widget.isFocused}get isResizing(){return this._widget.isResizing}containsNode(e){return e?this._widget.getDomNode().contains(e):!1}_addLoadingMessage(e){if(this._computer.anchor){for(const t of this._participants)if(t.createLoadingMessage){const i=t.createLoadingMessage(this._computer.anchor);if(i)return e.slice(0).concat([i])}}return e}_withResult(e){this._widget.position&&this._currentResult&&this._currentResult.isComplete&&(!e.isComplete||this._computer.insistOnKeepingHoverVisible&&e.messages.length===0)||this._setCurrentResult(e)}_renderMessages(e,t){const{showAtPosition:i,showAtSecondaryPosition:n,highlightRange:s}=e1.computeHoverRanges(this._editor,e.range,t),r=new se,a=r.add(new Uw(this._keybindingService)),l=document.createDocumentFragment();let d=null;const c={fragment:l,statusBar:a,setColorPicker:u=>d=u,onContentsChanged:()=>this._widget.onContentsChanged(),setMinimumDimensions:u=>this._widget.setMinimumDimensions(u),hide:()=>this.hide()};for(const u of this._participants){const g=t.filter(f=>f.owner===u);g.length>0&&r.add(u.renderHoverParts(c,g))}const h=t.some(u=>u.isBeforeContent);if(a.hasContent&&l.appendChild(a.hoverElement),l.hasChildNodes()){if(s){const u=this._editor.createDecorationsCollection();u.set([{range:s,options:e1._DECORATION_OPTIONS}]),r.add(Ae(()=>{u.clear()}))}this._widget.showAt(l,new oue(d,i,n,this._editor.getOption(60).above,this._computer.shouldFocus,this._computer.source,h,e.initialMousePosX,e.initialMousePosY,r))}else r.dispose()}static computeHoverRanges(e,t,i){let n=1;if(e.hasModel()){const d=e._getViewModel(),c=d.coordinatesConverter,h=c.convertModelRangeToViewRange(t),u=new V(h.startLineNumber,d.getLineMinColumn(h.startLineNumber));n=c.convertViewPositionToModelPosition(u).column}const s=t.startLineNumber;let r=t.startColumn,a=i[0].range,l=null;for(const d of i)a=k.plusRange(a,d.range),d.range.startLineNumber===s&&d.range.endLineNumber===s&&(r=Math.max(Math.min(r,d.range.startColumn),n)),d.forceShowAtRange&&(l=d.range);return{showAtPosition:l?l.getStartPosition():new V(s,t.startColumn),showAtSecondaryPosition:l?l.getStartPosition():new V(s,r),highlightRange:a}}focus(){this._widget.focus()}scrollUp(){this._widget.scrollUp()}scrollDown(){this._widget.scrollDown()}scrollLeft(){this._widget.scrollLeft()}scrollRight(){this._widget.scrollRight()}pageUp(){this._widget.pageUp()}pageDown(){this._widget.pageDown()}goToTop(){this._widget.goToTop()}goToBottom(){this._widget.goToBottom()}};zw._DECORATION_OPTIONS=Ze.register({description:"content-hover-highlight",className:"hoverHighlight"});zw=e1=LR([ru(1,Oe),ru(2,Pt)],zw);class lW{constructor(e,t,i){this.anchor=e,this.messages=t,this.isComplete=i}filter(e){const t=this.messages.filter(i=>i.isValidForHoverAnchor(e));return t.length===this.messages.length?this:new sue(this,this.anchor,t,this.isComplete)}}class sue extends lW{constructor(e,t,i,n){super(t,i,n),this.original=e}filter(e){return this.original.filter(e)}}class oue{constructor(e,t,i,n,s,r,a,l,d,c){this.colorPicker=e,this.showAtPosition=t,this.showAtSecondaryPosition=i,this.preferAbove=n,this.stoleFocus=s,this.source=r,this.isBeforeContent=a,this.initialMousePosX=l,this.initialMousePosY=d,this.disposables=c,this.closestMouseDistance=void 0}}const s5=30,cD=10,rue=6;let yc=Ca=class extends nue{get isColorPickerVisible(){var e;return!!(!((e=this._visibleData)===null||e===void 0)&&e.colorPicker)}get isVisibleFromKeyboard(){var e;return((e=this._visibleData)===null||e===void 0?void 0:e.source)===1}get isVisible(){var e;return(e=this._hoverVisibleKey.get())!==null&&e!==void 0?e:!1}get isFocused(){var e;return(e=this._hoverFocusedKey.get())!==null&&e!==void 0?e:!1}constructor(e,t,i,n,s){const r=e.getOption(66)+8,a=150,l=new bt(a,r);super(e,l),this._configurationService=i,this._accessibilityService=n,this._keybindingService=s,this._hover=this._register(new rW),this._minimumSize=l,this._hoverVisibleKey=M.hoverVisible.bindTo(t),this._hoverFocusedKey=M.hoverFocused.bindTo(t),ie(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._register(this._editor.onDidLayoutChange(()=>{this.isVisible&&this._updateMaxDimensions()})),this._register(this._editor.onDidChangeConfiguration(c=>{c.hasChanged(50)&&this._updateFont()}));const d=this._register(dl(this._resizableNode.domNode));this._register(d.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(d.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._setHoverData(void 0),this._editor.addContentWidget(this)}dispose(){var e;super.dispose(),(e=this._visibleData)===null||e===void 0||e.disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return Ca.ID}static _applyDimensions(e,t,i){const n=typeof t=="number"?`${t}px`:t,s=typeof i=="number"?`${i}px`:i;e.style.width=n,e.style.height=s}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return Ca._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return Ca._applyDimensions(i,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,i){const n=typeof t=="number"?`${t}px`:t,s=typeof i=="number"?`${i}px`:i;e.style.maxWidth=n,e.style.maxHeight=s}_setHoverWidgetMaxDimensions(e,t){Ca._applyMaxDimensions(this._hover.contentsDomNode,e,t),Ca._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?`${e}px`:e),this._layoutContentWidget()}_hasHorizontalScrollbar(){const e=this._hover.scrollbar.getScrollDimensions();return e.scrollWidth>e.width}_adjustContentsBottomPadding(){const e=this._hover.contentsDomNode,t=`${this._hover.scrollbar.options.horizontalScrollbarSize}px`;e.style.paddingBottom!==t&&(e.style.paddingBottom=t)}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none");const t=e.width,i=e.height;this._setHoverWidgetDimensions(t,i),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._setContentsDomNodeDimensions(t,i-cD))}_updateResizableNodeMaxDimensions(){var e,t;const i=(e=this._findMaximumRenderingWidth())!==null&&e!==void 0?e:1/0,n=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._resizableNode.maxSize=new bt(i,n),this._setHoverWidgetMaxDimensions(i,n)}_resize(e){var t,i;Ca._lastDimensions=new bt(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),(i=(t=this._visibleData)===null||t===void 0?void 0:t.colorPicker)===null||i===void 0||i.layout()}_findAvailableSpaceVertically(){var e;const t=(e=this._visibleData)===null||e===void 0?void 0:e.showAtPosition;if(t)return this._positionPreference===1?this._availableVerticalSpaceAbove(t):this._availableVerticalSpaceBelow(t)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let t=rue;return Array.from(this._hover.contentsDomNode.children).forEach(i=>{t+=i.clientHeight}),this._hasHorizontalScrollbar()&&(t+=cD),Math.min(e,t)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const e=Array.from(this._hover.contentsDomNode.children).some(t=>t.scrollWidth>t.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const e=this._isHoverTextOverflowing(),t=typeof this._contentWidth>"u"?0:this._contentWidth-2;return e||this._hover.containerDomNode.clientWidth<t?Lu(this._hover.containerDomNode.ownerDocument.body).width-14:this._hover.containerDomNode.clientWidth+2}isMouseGettingCloser(e,t){if(!this._visibleData)return!1;if(typeof this._visibleData.initialMousePosX>"u"||typeof this._visibleData.initialMousePosY>"u")return this._visibleData.initialMousePosX=e,this._visibleData.initialMousePosY=t,!1;const i=ji(this.getDomNode());typeof this._visibleData.closestMouseDistance>"u"&&(this._visibleData.closestMouseDistance=o5(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,i.left,i.top,i.width,i.height));const n=o5(e,t,i.left,i.top,i.width,i.height);return n>this._visibleData.closestMouseDistance+4?!1:(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,n),!0)}_setHoverData(e){var t;(t=this._visibleData)===null||t===void 0||t.disposables.dispose(),this._visibleData=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_updateFont(){const{fontSize:e,lineHeight:t}=this._editor.getOption(50),i=this._hover.contentsDomNode;i.style.fontSize=`${e}px`,i.style.lineHeight=`${t/e}`,Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(s=>this._editor.applyFontInfo(s))}_updateContent(e){const t=this._hover.contentsDomNode;t.style.paddingBottom="",t.textContent="",t.appendChild(e)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){const e=Math.max(this._editor.getLayoutInfo().height/4,250,Ca._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,Ca._lastDimensions.width);this._setHoverWidgetMaxDimensions(t,e)}_render(e,t){this._setHoverData(t),this._updateFont(),this._updateContent(e),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){var e;return this._visibleData?{position:this._visibleData.showAtPosition,secondaryPosition:this._visibleData.showAtSecondaryPosition,positionAffinity:this._visibleData.isBeforeContent?3:void 0,preference:[(e=this._positionPreference)!==null&&e!==void 0?e:1]}:null}showAt(e,t){var i,n,s,r;if(!this._editor||!this._editor.hasModel())return;this._render(e,t);const a=Xh(this._hover.containerDomNode),l=t.showAtPosition;this._positionPreference=(i=this._findPositionPreference(a,l))!==null&&i!==void 0?i:1,this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),(n=t.colorPicker)===null||n===void 0||n.layout();const c=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&Jhe(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(r=(s=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||s===void 0?void 0:s.getAriaLabel())!==null&&r!==void 0?r:"");c&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+c)}hide(){if(!this._visibleData)return;const e=this._visibleData.stoleFocus||this._hoverFocusedKey.get();this._setHoverData(void 0),this._resizableNode.maxSize=new bt(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){const e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions("auto","auto")}_adjustHoverHeightForScrollbar(e){var t;const i=this._hover.containerDomNode,n=this._hover.contentsDomNode,s=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._setContainerDomNodeDimensions(vs(i),Math.min(s,e)),this._setContentsDomNodeDimensions(vs(n),Math.min(s,e-cD))}setMinimumDimensions(e){this._minimumSize=new bt(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=typeof this._contentWidth>"u"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new bt(e,this._minimumSize.height)}onContentsChanged(){var e;this._removeConstraintsRenderNormally();const t=this._hover.containerDomNode;let i=Xh(t),n=vs(t);if(this._resizableNode.layout(i,n),this._setHoverWidgetDimensions(n,i),i=Xh(t),n=vs(t),this._contentWidth=n,this._updateMinimumWidth(),this._resizableNode.layout(i,n),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._adjustHoverHeightForScrollbar(i)),!((e=this._visibleData)===null||e===void 0)&&e.showAtPosition){const s=Xh(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(s,this._visibleData.showAtPosition)}this._layoutContentWidget()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-s5})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+s5})}pageUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e-t})}pageDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e+t})}goToTop(){this._hover.scrollbar.setScrollPosition({scrollTop:0})}goToBottom(){this._hover.scrollbar.setScrollPosition({scrollTop:this._hover.scrollbar.getScrollDimensions().scrollHeight})}};yc.ID="editor.contrib.resizableContentHoverWidget";yc._lastDimensions=new bt(0,0);yc=Ca=LR([ru(1,We),ru(2,ft),ru(3,Sl),ru(4,Pt)],yc);let Uw=class extends K{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=n5("div.hover-row.status-bar"),this.actionsElement=ie(this.hoverElement,n5("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;return this._hasContent=!0,this._register(SR.render(this.actionsElement,e,i))}append(e){const t=ie(this.actionsElement,e);return this._hasContent=!0,t}};Uw=LR([ru(0,Pt)],Uw);class $w{get anchor(){return this._anchor}set anchor(e){this._anchor=e}get shouldFocus(){return this._shouldFocus}set shouldFocus(e){this._shouldFocus=e}get source(){return this._source}set source(e){this._source=e}get insistOnKeepingHoverVisible(){return this._insistOnKeepingHoverVisible}set insistOnKeepingHoverVisible(e){this._insistOnKeepingHoverVisible=e}constructor(e,t){this._editor=e,this._participants=t,this._anchor=null,this._shouldFocus=!1,this._source=0,this._insistOnKeepingHoverVisible=!1}static _getLineDecorations(e,t){if(t.type!==1&&!t.supportsMarkerHover)return[];const i=e.getModel(),n=t.range.startLineNumber;if(n>i.getLineCount())return[];const s=i.getLineMaxColumn(n);return e.getLineDecorations(n).filter(r=>{if(r.options.isWholeLine)return!0;const a=r.range.startLineNumber===n?r.range.startColumn:1,l=r.range.endLineNumber===n?r.range.endColumn:s;if(r.options.showIfCollapsed){if(a>t.range.startColumn+1||t.range.endColumn-1>l)return!1}else if(a>t.range.startColumn||t.range.endColumn>l)return!1;return!0})}computeAsync(e){const t=this._anchor;if(!this._editor.hasModel()||!t)return Fi.EMPTY;const i=$w._getLineDecorations(this._editor,t);return Fi.merge(this._participants.map(n=>n.computeAsync?n.computeAsync(t,i,e):Fi.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=$w._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return Qr(t)}}function o5(o,e,t,i,n,s){const r=t+n/2,a=i+s/2,l=Math.max(Math.abs(o-r)-n/2,0),d=Math.max(Math.abs(e-a)-s/2,0);return Math.sqrt(l*l+d*d)}const r5=pe;class Vf extends K{constructor(e,t,i){super(),this._renderDisposeables=this._register(new se),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new rW),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new pd({editor:this._editor},t,i)),this._computer=new aue(this._editor),this._hoverOperation=this._register(new aW(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._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return Vf.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_onModelDecorationsChanged(){this._isVisible&&(this._hoverOperation.cancel(),this._hoverOperation.start(0))}startShowingAt(e){this._computer.lineNumber!==e&&(this._hoverOperation.cancel(),this.hide(),this._computer.lineNumber=e,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 s=r5("div.hover-row.markdown-hover"),r=ie(s,r5("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(n.value));r.appendChild(a.element),i.appendChild(s)}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(),s=this._editor.getOption(66),r=this._hover.containerDomNode.clientHeight,a=i-n-(r-s)/2;this._hover.containerDomNode.style.left=`${t.glyphMarginLeft+t.glyphMarginWidth}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(a),0)}px`}}Vf.ID="editor.contrib.modesGlyphHoverWidget";class aue{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}constructor(e){this._editor=e,this._lineNumber=-1}computeSync(){const e=n=>({value:n}),t=this._editor.getLineDecorations(this._lineNumber),i=[];if(!t)return i;for(const n of t){if(!n.options.glyphMarginClassName)continue;const s=n.options.glyphMarginHoverMessage;!s||hp(s)||i.push(...BT(s).map(e))}return i}}class lue{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}async function due(o,e,t,i,n){try{const s=await Promise.resolve(o.provideHover(t,i,n));if(s&&hue(s))return new lue(o,s,e)}catch(s){Mi(s)}}function xR(o,e,t,i){const s=o.ordered(e).map((r,a)=>due(r,a,e,t,i));return Fi.fromPromises(s).coalesce()}function cue(o,e,t,i){return xR(o,e,t,i).map(n=>n.hover).toPromise()}Cl("_executeHoverProvider",(o,e,t)=>{const i=o.get(Se);return cue(i.hoverProvider,e,t,st.None)});function hue(o){const e=typeof o.range<"u",t=typeof o.contents<"u"&&o.contents&&o.contents.length>0;return e&&t}var uue=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},eC=function(o,e){return function(t,i){e(t,i,o)}};const a5=pe;class Kr{constructor(e,t,i,n,s){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=n,this.ordinal=s}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let Kw=class{constructor(e,t,i,n,s){this._editor=e,this._languageService=t,this._openerService=i,this._configurationService=n,this._languageFeaturesService=s,this.hoverOrdinal=3}createLoadingMessage(e){return new Kr(this,e.range,[new Fn().appendText(p("modesContentHover.loading","Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,s=i.getLineMaxColumn(n),r=[];let a=1e3;const l=i.getLineLength(n),d=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),c=this._editor.getOption(116),h=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:d});let u=!1;c>=0&&l>c&&e.range.startColumn>=c&&(u=!0,r.push(new Kr(this,e.range,[{value:p("stopped rendering","Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!u&&typeof h=="number"&&l>=h&&r.push(new Kr(this,e.range,[{value:p("too many characters","Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,a++));let g=!1;for(const f of t){const m=f.range.startLineNumber===n?f.range.startColumn:1,_=f.range.endLineNumber===n?f.range.endColumn:s,v=f.options.hoverMessage;if(!v||hp(v))continue;f.options.beforeContentClassName&&(g=!0);const b=new k(e.range.startLineNumber,m,e.range.startLineNumber,_);r.push(new Kr(this,b,BT(v),g,a++))}return r}computeAsync(e,t,i){if(!this._editor.hasModel()||e.type!==1)return Fi.EMPTY;const n=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(n))return Fi.EMPTY;const s=new V(e.range.startLineNumber,e.range.startColumn);return xR(this._languageFeaturesService.hoverProvider,n,s,i).filter(r=>!hp(r.hover.contents)).map(r=>{const a=r.hover.range?k.lift(r.hover.range):e.range;return new Kr(this,a,r.hover.contents,!1,r.ordinal)})}renderHoverParts(e,t){return dW(e,t,this._editor,this._languageService,this._openerService)}};Kw=uue([eC(1,ni),eC(2,Qs),eC(3,ft),eC(4,Se)],Kw);function dW(o,e,t,i,n){e.sort((r,a)=>r.ordinal-a.ordinal);const s=new se;for(const r of e)for(const a of r.contents){if(hp(a))continue;const l=a5("div.hover-row.markdown-hover"),d=ie(l,a5("div.hover-contents")),c=s.add(new pd({editor:t},i,n));s.add(c.onDidRenderAsync(()=>{d.className="hover-contents code-hover-contents",o.onContentsChanged()}));const h=s.add(c.render(a));d.appendChild(h.element),o.fragment.appendChild(l)}return s}var cW=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},jw=function(o,e){return function(t,i){e(t,i,o)}};class l5{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let vN=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new W,this.onDidChange=this._onDidChange.event,this._dispoables=new se,this._markers=[],this._nextIdx=-1,Me.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const n=this._configService.getValue("problems.sortOrder"),s=(a,l)=>{let d=V_(a.resource.toString(),l.resource.toString());return d===0&&(n==="position"?d=k.compareRangesUsingStarts(a,l)||ci.compare(a.severity,l.severity):d=ci.compare(a.severity,l.severity)||k.compareRangesUsingStarts(a,l)),d},r=()=>{this._markers=this._markerService.read({resource:Me.isUri(e)?e:void 0,severities:ci.Error|ci.Warning|ci.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(s)};r(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(l=>this._resourceFilter(l)))&&(r(),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 l5(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let n=!1,s=this._markers.findIndex(r=>r.resource.toString()===e.uri.toString());s<0&&(s=M_(this._markers,{resource:e.uri},(r,a)=>V_(r.resource.toString(),a.resource.toString())),s<0&&(s=~s));for(let r=s;r<this._markers.length;r++){let a=k.lift(this._markers[r]);if(a.isEmpty()){const l=e.getWordAtPosition(a.getStartPosition());l&&(a=new k(a.startLineNumber,l.startColumn,a.startLineNumber,l.endColumn))}if(t&&(a.containsPosition(t)||t.isBeforeOrEqual(a.getStartPosition()))){this._nextIdx=r,n=!0;break}if(this._markers[r].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(k.containsPosition(this._markers[i],t))return new l5(this._markers[i],i+1,this._markers.length)}}};vN=cW([jw(1,yl),jw(2,ft)],vN);const hW=ot("IMarkerNavigationService");let bN=class{constructor(e,t){this._markerService=e,this._configService=t,this._provider=new rs}getMarkerList(e){for(const t of this._provider){const i=t.getMarkerList(e);if(i)return i}return new vN(e,this._markerService,this._configService)}};bN=cW([jw(0,yl),jw(1,ft)],bN);ct(hW,bN,1);var CN;(function(o){function e(t){switch(t){case Si.Ignore:return"severity-ignore "+Re.asClassName(he.info);case Si.Info:return Re.asClassName(he.info);case Si.Warning:return Re.asClassName(he.warning);case Si.Error:return Re.asClassName(he.error);default:return""}}o.className=e})(CN||(CN={}));var gue=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Ig=function(o,e){return function(t,i){e(t,i,o)}},wN;class fue{constructor(e,t,i,n,s){this._openerService=n,this._labelService=s,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new se,this._editor=t;const r=document.createElement("div");r.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),r.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),r.appendChild(this._relatedBlock),this._disposables.add(vi(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new k8(r,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{r.style.left=`-${a.scrollLeft}px`,r.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){Et(this._disposables)}update(e){const{source:t,message:i,relatedInformation:n,code:s}=e;let r=(t?.length||0)+2;s&&(typeof s=="string"?r+=s.length:r+=s.value.length);const a=ll(i);this._lines=a.length,this._longestLineLength=0;for(const u of a)this._longestLineLength=Math.max(u.length+r,this._longestLineLength);bn(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const u of a)l=document.createElement("div"),l.innerText=u,u===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||s){const u=document.createElement("span");if(u.classList.add("details"),l.appendChild(u),t){const g=document.createElement("span");g.innerText=t,g.classList.add("source"),u.appendChild(g)}if(s)if(typeof s=="string"){const g=document.createElement("span");g.innerText=`(${s})`,g.classList.add("code"),u.appendChild(g)}else{this._codeLink=pe("a.code-link"),this._codeLink.setAttribute("href",`${s.target.toString()}`),this._codeLink.onclick=f=>{this._openerService.open(s.target,{allowCommands:!0}),f.preventDefault(),f.stopPropagation()};const g=ie(this._codeLink,pe("span"));g.innerText=s.value,u.appendChild(this._codeLink)}}if(bn(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),Bn(n)){const u=this._relatedBlock.appendChild(document.createElement("div"));u.style.paddingTop=`${Math.floor(this._editor.getOption(66)*.66)}px`,this._lines+=1;for(const g of n){const f=document.createElement("div"),m=document.createElement("a");m.classList.add("filename"),m.innerText=`${this._labelService.getUriBasenameLabel(g.resource)}(${g.startLineNumber}, ${g.startColumn}): `,m.title=this._labelService.getUriLabel(g.resource),this._relatedDiagnostics.set(m,g);const _=document.createElement("span");_.innerText=g.message,f.appendChild(m),f.appendChild(_),this._lines+=1,u.appendChild(f)}}const d=this._editor.getOption(50),c=Math.ceil(d.typicalFullwidthCharacterWidth*this._longestLineLength*.75),h=d.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:c,scrollHeight:h})}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 ci.Error:t=p("Error","Error");break;case ci.Warning:t=p("Warning","Warning");break;case ci.Info:t=p("Info","Info");break;case ci.Hint:t=p("Hint","Hint");break}let i=p("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}}let Sp=wN=class extends Hw{constructor(e,t,i,n,s,r,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},s),this._themeService=t,this._openerService=i,this._menuService=n,this._contextKeyService=r,this._labelService=a,this._callOnDispose=new se,this._onDidSelectRelatedInformation=new W,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=ci.Warning,this._backgroundColor=q.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(vue);let t=SN,i=pue;this._severity===ci.Warning?(t=t1,i=mue):this._severity===ci.Info&&(t=yN,i=_ue);const n=e.getColor(t),s=e.getColor(i);this.style({arrowColor:n,frameColor:n,headerBackgroundColor:s,primaryHeadingColor:e.getColor(Y6),secondaryHeadingColor:e.getColor(X6)})}_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.createMenu(wN.TitleMenu,this._contextKeyService);NM(i,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),i.dispose()}_fillTitleIcon(e){this._icon=ie(e,pe(""))}_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 fue(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=k.lift(e),s=this.editor.getPosition(),r=s&&n.containsPosition(s)?s:n.getStartPosition();super.show(r,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=i>1?p("problems","{0} of {1} problems",t,i):p("change","{0} of {1} problem",t,i);this.setTitle(qo(a.uri),l)}this._icon.className=`codicon ${CN.className(ci.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(r,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()}};Sp.TitleMenu=new N("gotoErrorTitleMenu");Sp=wN=gue([Ig(1,tn),Ig(2,Qs),Ig(3,ra),Ig(4,Oe),Ig(5,We),Ig(6,ap)],Sp);const d5=s0(Ka,pG),c5=s0(vo,i0),h5=s0(Ss,n0),SN=R("editorMarkerNavigationError.background",{dark:d5,light:d5,hcDark:dt,hcLight:dt},p("editorMarkerNavigationError","Editor marker navigation widget error color.")),pue=R("editorMarkerNavigationError.headerBackground",{dark:Ee(SN,.1),light:Ee(SN,.1),hcDark:null,hcLight:null},p("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),t1=R("editorMarkerNavigationWarning.background",{dark:c5,light:c5,hcDark:dt,hcLight:dt},p("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),mue=R("editorMarkerNavigationWarning.headerBackground",{dark:Ee(t1,.1),light:Ee(t1,.1),hcDark:"#0C141F",hcLight:Ee(t1,.2)},p("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),yN=R("editorMarkerNavigationInfo.background",{dark:h5,light:h5,hcDark:dt,hcLight:dt},p("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),_ue=R("editorMarkerNavigationInfo.headerBackground",{dark:Ee(yN,.1),light:Ee(yN,.1),hcDark:null,hcLight:null},p("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),vue=R("editorMarkerNavigation.background",{dark:en,light:en,hcDark:en,hcLight:en},p("editorMarkerNavigationBackground","Editor marker navigation widget background."));var bue=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},tC=function(o,e){return function(t,i){e(t,i,o)}},Ym;let Yc=Ym=class{static get(e){return e.getContribution(Ym.ID)}constructor(e,t,i,n,s){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=n,this._instantiationService=s,this._sessionDispoables=new se,this._editor=e,this._widgetVisible=uW.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(Sp,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,s,r;(!(!((n=this._model)===null||n===void 0)&&n.selected)||!k.containsPosition((s=this._model)===null||s===void 0?void 0:s.selected.marker,i.position))&&((r=this._model)===null||r===void 0||r.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:k.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 V(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 s=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(s.move(e,this._editor.getModel(),this._editor.getPosition()),!s.selected)return;if(s.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const r=await this._editorService.openCodeEditor({resource:s.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:s.selected.marker}},this._editor);r&&((i=Ym.get(r))===null||i===void 0||i.close(),(n=Ym.get(r))===null||n===void 0||n.nagivate(e,t))}else this._widget.showAtMarker(s.selected.marker,s.selected.index,s.selected.total)}}};Yc.ID="editor.contrib.markerController";Yc=Ym=bue([tC(1,hW),tC(2,We),tC(3,Dt),tC(4,Oe)],Yc);class Hy extends we{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}async run(e,t){var i;t.hasModel()&&((i=Yc.get(t))===null||i===void 0||i.nagivate(this._next,this._multiFile))}}class Lc extends Hy{constructor(){super(!0,!1,{id:Lc.ID,label:Lc.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:M.focus,primary:578,weight:100},menuOpts:{menuId:Sp.TitleMenu,title:Lc.LABEL,icon:Di("marker-navigation-next",he.arrowDown,p("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}Lc.ID="editor.action.marker.next";Lc.LABEL=p("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class fu extends Hy{constructor(){super(!1,!1,{id:fu.ID,label:fu.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:M.focus,primary:1602,weight:100},menuOpts:{menuId:Sp.TitleMenu,title:fu.LABEL,icon:Di("marker-navigation-previous",he.arrowUp,p("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}fu.ID="editor.action.marker.prev";fu.LABEL=p("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class Cue extends Hy{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:p("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:M.focus,primary:66,weight:100},menuOpts:{menuId:N.MenubarGoMenu,title:p({},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class wue extends Hy{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:p("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:M.focus,primary:1090,weight:100},menuOpts:{menuId:N.MenubarGoMenu,title:p({},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}yt(Yc.ID,Yc,4);de(Lc);de(fu);de(Cue);de(wue);const uW=new be("markersNavigationVisible",!1),Sue=cn.bindToContribution(Yc.get);ue(new Sue({id:"closeMarkersNavigation",precondition:uW,handler:o=>o.close(),kbOpts:{weight:150,kbExpr:M.focus,primary:9,secondary:[1033]}}));var yue=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},hD=function(o,e){return function(t,i){e(t,i,o)}};const er=pe;class Lue{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 u5={type:1,filter:{include:Be.QuickFix},triggerAction:qs.QuickFixHover};let LN=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,s=i.getLineMaxColumn(n),r=[];for(const a of t){const l=a.range.startLineNumber===n?a.range.startColumn:1,d=a.range.endLineNumber===n?a.range.endColumn:s,c=this._markerDecorationsService.getMarker(i.uri,a);if(!c)continue;const h=new k(e.range.startLineNumber,l,e.range.startLineNumber,d);r.push(new Lue(this,h,c))}return r}renderHoverParts(e,t){if(!t.length)return K.None;const i=new se;t.forEach(s=>e.fragment.appendChild(this.renderMarkerHover(s,i)));const n=t.length===1?t[0]:t.sort((s,r)=>ci.compare(s.marker.severity,r.marker.severity))[0];return this.renderMarkerStatusbar(e,n,i),i}renderMarkerHover(e,t){const i=er("div.hover-row"),n=ie(i,er("div.marker.hover-contents")),{source:s,message:r,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(n);const d=ie(n,er("span"));if(d.style.whiteSpace="pre-wrap",d.innerText=r,s||a)if(a&&typeof a!="string"){const c=er("span");if(s){const f=ie(c,er("span"));f.innerText=s}const h=ie(c,er("a.code-link"));h.setAttribute("href",a.target.toString()),t.add(Q(h,"click",f=>{this._openerService.open(a.target,{allowCommands:!0}),f.preventDefault(),f.stopPropagation()}));const u=ie(h,er("span"));u.innerText=a.value;const g=ie(n,c);g.style.opacity="0.6",g.style.paddingLeft="6px"}else{const c=ie(n,er("span"));c.style.opacity="0.6",c.style.paddingLeft="6px",c.innerText=s&&a?`${s}(${a})`:s||`(${a})`}if(Bn(l))for(const{message:c,resource:h,startLineNumber:u,startColumn:g}of l){const f=ie(n,er("div"));f.style.marginTop="8px";const m=ie(f,er("a"));m.innerText=`${qo(h)}(${u}, ${g}): `,m.style.cursor="pointer",t.add(Q(m,"click",v=>{v.stopPropagation(),v.preventDefault(),this._openerService&&this._openerService.open(h,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:u,startColumn:g}}}).catch(Ge)}));const _=ie(f,er("span"));_.innerText=c,this._editor.applyFontInfo(_)}return i}renderMarkerStatusbar(e,t,i){if((t.marker.severity===ci.Error||t.marker.severity===ci.Warning||t.marker.severity===ci.Info)&&e.statusBar.addAction({label:p("view problem","View Problem"),commandId:Lc.ID,run:()=>{var n;e.hide(),(n=Yc.get(this._editor))===null||n===void 0||n.showAtMarker(t.marker),this._editor.focus()}}),!this._editor.getOption(90)){const n=e.statusBar.append(er("div"));this.recentMarkerCodeActionsInfo&&(gw.makeKey(this.recentMarkerCodeActionsInfo.marker)===gw.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(n.textContent=p("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const s=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?K.None:i.add(Rc(()=>n.textContent=p("checkingForQuickFixes","Checking for quick fixes..."),200));n.textContent||(n.textContent=" ");const r=this.getCodeActions(t.marker);i.add(Ae(()=>r.cancel())),r.then(a=>{if(s.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),n.textContent=p("noQuickFixes","No quick fixes available");return}n.style.display="none";let l=!1;i.add(Ae(()=>{l||a.dispose()})),e.statusBar.addAction({label:p("quick fixes","Quick Fix..."),commandId:pR,run:d=>{l=!0;const c=jc.get(this._editor),h=ji(d);e.hide(),c?.showCodeActions(u5,a,{x:h.left,y:h.top,width:h.width,height:h.height})}})},Ge)}}getCodeActions(e){return Zi(t=>L_(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new k(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),u5,ld.None,t))}};LN=yue([hD(1,R2),hD(2,Qs),hD(3,Se)],LN);const gW="editor.action.inlineSuggest.commit",fW="editor.action.inlineSuggest.showPrevious",pW="editor.action.inlineSuggest.showNext";var DR=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},jr=function(o,e){return function(t,i){e(t,i,o)}},i1;let xN=class extends K{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=pi(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=Xe(this,n=>{var s,r,a;const l=(s=this.model.read(n))===null||s===void 0?void 0:s.ghostText.read(n);if(!this.alwaysShowToolbar.read(n)||!l||l.parts.length===0)return this.sessionPosition=void 0,null;const d=l.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==l.lineNumber&&(this.sessionPosition=void 0);const c=new V(l.lineNumber,Math.min(d,(a=(r=this.sessionPosition)===null||r===void 0?void 0:r.column)!==null&&a!==void 0?a:Number.MAX_SAFE_INTEGER));return this.sessionPosition=c,c}),this._register(yd((n,s)=>{const r=this.model.read(n);if(!r||!this.alwaysShowToolbar.read(n))return;const a=s.add(this.instantiationService.createInstance(Xc,this.editor,!0,this.position,r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.selectedInlineCompletion.map(l=>{var d;return(d=l?.inlineCompletion.source.inlineCompletions.commands)!==null&&d!==void 0?d:[]})));e.addContentWidget(a),s.add(Ae(()=>e.removeContentWidget(a))),s.add(xt(l=>{this.position.read(l)&&r.lastTriggerKind.read(l)!==od.Explicit&&r.triggerExplicitly()}))}))}};xN=DR([jr(2,Oe)],xN);const xue=Di("inline-suggestion-hints-next",he.chevronRight,p("parameterHintsNextIcon","Icon for show next parameter hint.")),Due=Di("inline-suggestion-hints-previous",he.chevronLeft,p("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let Xc=i1=class extends K{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const n=new cs(e,t,i,!0,()=>this._commandService.executeCommand(e)),s=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let r=t;return s&&(r=p({},"{0} ({1})",t,s.getLabel())),n.tooltip=r,n}constructor(e,t,i,n,s,r,a,l,d,c,h){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=n,this._suggestionCount=s,this._extraCommands=r,this._commandService=a,this.keybindingService=d,this._contextKeyService=c,this._menuService=h,this.id=`InlineSuggestionHintsContentWidget${i1.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=Jt("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[Jt("div@toolBar")]),this.previousAction=this.createCommandAction(fW,p("previous","Previous"),Re.asClassName(Due)),this.availableSuggestionCountAction=new cs("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(pW,p("next","Next"),Re.asClassName(xue)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(N.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new Rt(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new Rt(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.lastCommands=[],this.toolBar=this._register(l.createInstance(DN,this.nodes.toolBar,N.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:u=>u.startsWith("primary")},actionViewItemProvider:(u,g)=>{if(u instanceof _r)return l.createInstance(Iue,u,void 0);if(u===this.availableSuggestionCountAction){const f=new kue(void 0,u,{label:!0,icon:!1});return f.setClass("availableSuggestionCount"),f}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(u=>{i1._dropDownVisible=u})),this._register(xt(u=>{this._position.read(u),this.editor.layoutContentWidget(this)})),this._register(xt(u=>{const g=this._suggestionCount.read(u),f=this._currentSuggestionIdx.read(u);g!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${f+1}/${g}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),g!==void 0&&g>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(xt(u=>{const g=this._extraCommands.read(u);if(_i(this.lastCommands,g))return;this.lastCommands=g;const f=g.map(m=>({class:void 0,id:m.id,enabled:!0,tooltip:m.tooltip||"",label:m.title,run:_=>this._commandService.executeCommand(m.id)}));for(const[m,_]of this.inlineCompletionsActionsMenus.getActions())for(const v of _)v instanceof _r&&f.push(v);f.length>0&&f.unshift(new dn),this.toolBar.setAdditionalSecondaryActions(f)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};Xc._dropDownVisible=!1;Xc.id=0;Xc=i1=DR([jr(6,ui),jr(7,Oe),jr(8,Pt),jr(9,We),jr(10,ra)],Xc);class kue extends up{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}}let Iue=class extends Nu{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=Jt("div.keybinding").root;new Mv(t,mo,{disableTitle:!0,...boe}).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}},DN=class extends Ow{constructor(e,t,i,n,s,r,a,l){super(e,{resetMenu:t,...i},n,s,r,a,l),this.menuId=t,this.options2=i,this.menuService=n,this.contextKeyService=s,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var e,t,i,n,s,r,a;const l=[],d=[];NM(this.menu,(e=this.options2)===null||e===void 0?void 0:e.menuOptions,{primary:l,secondary:d},(i=(t=this.options2)===null||t===void 0?void 0:t.toolbarOptions)===null||i===void 0?void 0:i.primaryGroup,(s=(n=this.options2)===null||n===void 0?void 0:n.toolbarOptions)===null||s===void 0?void 0:s.shouldInlineSubmenu,(a=(r=this.options2)===null||r===void 0?void 0:r.toolbarOptions)===null||a===void 0?void 0:a.useSeparatorsInPrimaryActions),d.push(...this.additionalActions),l.unshift(...this.prependedPrimaryActions),this.setActions(l,d)}setPrependedPrimaryActions(e){_i(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){_i(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};DN=DR([jr(3,ra),jr(4,We),jr(5,Yo),jr(6,Pt),jr(7,Gs)],DN);var Eue=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},iC=function(o,e){return function(t,i){e(t,i,o)}},kN;let Ds=kN=class extends K{static get(e){return e.getContribution(kN.ID)}constructor(e,t,i,n,s){super(),this._editor=e,this._instantiationService=t,this._openerService=i,this._languageService=n,this._keybindingService=s,this._toUnhook=new se,this._hoverActivatedByColorDecoratorClick=!1,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._reactToEditorMouseMoveRunner=this._register(new Rt(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookEvents(),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(60)&&(this._unhookEvents(),this._hookEvents())}))}_hookEvents(){const e=this._editor.getOption(60);this._isHoverEnabled=e.enabled,this._isHoverSticky=e.sticky,this._hidingDelay=e.hidingDelay,this._isHoverEnabled?(this._toUnhook.add(this._editor.onMouseDown(t=>this._onEditorMouseDown(t))),this._toUnhook.add(this._editor.onMouseUp(t=>this._onEditorMouseUp(t))),this._toUnhook.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._toUnhook.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))):(this._toUnhook.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._toUnhook.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))),this._toUnhook.add(this._editor.onMouseLeave(t=>this._onEditorMouseLeave(t))),this._toUnhook.add(this._editor.onDidChangeModel(()=>{this._cancelScheduler(),this._hideWidgets()})),this._toUnhook.add(this._editor.onDidChangeModelContent(()=>this._cancelScheduler())),this._toUnhook.add(this._editor.onDidScrollChange(t=>this._onEditorScrollChanged(t)))}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_unhookEvents(){this._toUnhook.clear()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){var t;this._isMouseDown=!0;const i=e.target;if(i.type===9&&i.detail===yc.ID){this._hoverClicked=!0;return}i.type===12&&i.detail===Vf.ID||(i.type!==12&&(this._hoverClicked=!1),!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing||this._hideWidgets())}_onEditorMouseUp(e){this._isMouseDown=!1}_onEditorMouseLeave(e){var t,i;this._cancelScheduler();const n=e.event.browserEvent.relatedTarget;!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing||!((i=this._contentWidget)===null||i===void 0)&&i.containsNode(n)||this._hideWidgets()}_isMouseOverWidget(e){var t,i,n,s,r;const a=e.target;return!!(this._isHoverSticky&&a.type===9&&a.detail===yc.ID||this._isHoverSticky&&(!((t=this._contentWidget)===null||t===void 0)&&t.containsNode((i=e.event.browserEvent.view)===null||i===void 0?void 0:i.document.activeElement))&&!(!((s=(n=e.event.browserEvent.view)===null||n===void 0?void 0:n.getSelection())===null||s===void 0)&&s.isCollapsed)||!this._isHoverSticky&&a.type===9&&a.detail===yc.ID&&(!((r=this._contentWidget)===null||r===void 0)&&r.isColorPickerVisible)||this._isHoverSticky&&a.type===12&&a.detail===Vf.ID)}_onEditorMouseMove(e){var t,i,n,s;if(this._mouseMoveEvent=e,!((t=this._contentWidget)===null||t===void 0)&&t.isFocused||!((i=this._contentWidget)===null||i===void 0)&&i.isResizing||this._isMouseDown&&this._hoverClicked||this._isHoverSticky&&(!((n=this._contentWidget)===null||n===void 0)&&n.isVisibleFromKeyboard))return;if(this._isMouseOverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}if(!((s=this._contentWidget)===null||s===void 0)&&s.isVisible&&this._isHoverSticky&&this._hidingDelay>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(this._hidingDelay);return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){var t,i,n;if(!e)return;const s=e.target,r=(t=s.element)===null||t===void 0?void 0:t.classList.contains("colorpicker-color-decoration"),a=this._editor.getOption(146);if(r&&(a==="click"&&!this._hoverActivatedByColorDecoratorClick||a==="hover"&&!this._isHoverEnabled||a==="clickAndHover"&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick)||!r&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick){this._hideWidgets();return}if(this._getOrCreateContentWidget().maybeShowAt(e)){(i=this._glyphWidget)===null||i===void 0||i.hide();return}if(s.type===2&&s.position){(n=this._contentWidget)===null||n===void 0||n.hide(),this._glyphWidget||(this._glyphWidget=new Vf(this._editor,this._languageService,this._openerService)),this._glyphWidget.startShowingAt(s.position.lineNumber);return}this._hideWidgets()}_onKeyDown(e){var t;if(!this._editor.hasModel())return;const i=this._keybindingService.softDispatch(e,this._editor.getDomNode()),n=i.kind===1||i.kind===2&&i.commandId==="editor.action.showHover"&&((t=this._contentWidget)===null||t===void 0?void 0:t.isVisible);e.keyCode!==5&&e.keyCode!==6&&e.keyCode!==57&&e.keyCode!==4&&!n&&this._hideWidgets()}_hideWidgets(){var e,t,i;this._isMouseDown&&this._hoverClicked&&(!((e=this._contentWidget)===null||e===void 0)&&e.isColorPickerVisible)||Xc.dropDownVisible||(this._hoverActivatedByColorDecoratorClick=!1,this._hoverClicked=!1,(t=this._glyphWidget)===null||t===void 0||t.hide(),(i=this._contentWidget)===null||i===void 0||i.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(zw,this._editor)),this._contentWidget}showContentHover(e,t,i,n,s=!1){this._hoverActivatedByColorDecoratorClick=s,this._getOrCreateContentWidget().startShowingAtRange(e,t,i,n)}focus(){var e;(e=this._contentWidget)===null||e===void 0||e.focus()}scrollUp(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollUp()}scrollDown(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollDown()}scrollLeft(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollLeft()}scrollRight(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollRight()}pageUp(){var e;(e=this._contentWidget)===null||e===void 0||e.pageUp()}pageDown(){var e;(e=this._contentWidget)===null||e===void 0||e.pageDown()}goToTop(){var e;(e=this._contentWidget)===null||e===void 0||e.goToTop()}goToBottom(){var e;(e=this._contentWidget)===null||e===void 0||e.goToBottom()}get isColorPickerVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isColorPickerVisible}get isHoverVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isVisible}dispose(){var e,t;super.dispose(),this._unhookEvents(),this._toUnhook.dispose(),(e=this._glyphWidget)===null||e===void 0||e.dispose(),(t=this._contentWidget)===null||t===void 0||t.dispose()}};Ds.ID="editor.contrib.hover";Ds=kN=Eue([iC(1,Oe),iC(2,Qs),iC(3,ni),iC(4,Pt)],Ds);var Rr;(function(o){o.NoAutoFocus="noAutoFocus",o.FocusIfVisible="focusIfVisible",o.AutoFocusImmediately="autoFocusImmediately"})(Rr||(Rr={}));class Nue extends we{constructor(){super({id:"editor.action.showHover",label:p({},"Show or Focus Hover"),metadata:{description:"Show or Focus Hover",args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if and when the hover should take focus upon being triggered by this action.",enum:[Rr.NoAutoFocus,Rr.FocusIfVisible,Rr.AutoFocusImmediately],enumDescriptions:[p("showOrFocusHover.focus.noAutoFocus","The hover will not automatically take focus."),p("showOrFocusHover.focus.focusIfVisible","The hover will take focus only if it is already visible."),p("showOrFocusHover.focus.autoFocusImmediately","The hover will automatically take focus when it appears.")],default:Rr.FocusIfVisible}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:M.editorTextFocus,primary:qi(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const n=Ds.get(t);if(!n)return;const s=i?.focus;let r=Rr.FocusIfVisible;s in Rr?r=s:typeof s=="boolean"&&s&&(r=Rr.AutoFocusImmediately);const a=d=>{const c=t.getPosition(),h=new k(c.lineNumber,c.column,c.lineNumber,c.column);n.showContentHover(h,1,1,d)},l=t.getOption(2)===2;n.isHoverVisible?r!==Rr.NoAutoFocus?n.focus():a(l):a(l||r===Rr.AutoFocusImmediately)}}class Tue extends we{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:p({},"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0})}run(e,t){const i=Ds.get(t);if(!i)return;const n=t.getPosition();if(!n)return;const s=new k(n.lineNumber,n.column,n.lineNumber,n.column),r=Hu.get(t);if(!r)return;r.startFindDefinitionFromCursor(n).then(()=>{i.showContentHover(s,1,1,!0)})}}class Mue extends we{constructor(){super({id:"editor.action.scrollUpHover",label:p({},"Scroll Up Hover"),alias:"Scroll Up Hover",precondition:M.hoverFocused,kbOpts:{kbExpr:M.hoverFocused,primary:16,weight:100}})}run(e,t){const i=Ds.get(t);i&&i.scrollUp()}}class Rue extends we{constructor(){super({id:"editor.action.scrollDownHover",label:p({},"Scroll Down Hover"),alias:"Scroll Down Hover",precondition:M.hoverFocused,kbOpts:{kbExpr:M.hoverFocused,primary:18,weight:100}})}run(e,t){const i=Ds.get(t);i&&i.scrollDown()}}class Aue extends we{constructor(){super({id:"editor.action.scrollLeftHover",label:p({},"Scroll Left Hover"),alias:"Scroll Left Hover",precondition:M.hoverFocused,kbOpts:{kbExpr:M.hoverFocused,primary:15,weight:100}})}run(e,t){const i=Ds.get(t);i&&i.scrollLeft()}}class Pue extends we{constructor(){super({id:"editor.action.scrollRightHover",label:p({},"Scroll Right Hover"),alias:"Scroll Right Hover",precondition:M.hoverFocused,kbOpts:{kbExpr:M.hoverFocused,primary:17,weight:100}})}run(e,t){const i=Ds.get(t);i&&i.scrollRight()}}class Oue extends we{constructor(){super({id:"editor.action.pageUpHover",label:p({},"Page Up Hover"),alias:"Page Up Hover",precondition:M.hoverFocused,kbOpts:{kbExpr:M.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){const i=Ds.get(t);i&&i.pageUp()}}class Fue extends we{constructor(){super({id:"editor.action.pageDownHover",label:p({},"Page Down Hover"),alias:"Page Down Hover",precondition:M.hoverFocused,kbOpts:{kbExpr:M.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){const i=Ds.get(t);i&&i.pageDown()}}class Bue extends we{constructor(){super({id:"editor.action.goToTopHover",label:p({},"Go To Top Hover"),alias:"Go To Bottom Hover",precondition:M.hoverFocused,kbOpts:{kbExpr:M.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){const i=Ds.get(t);i&&i.goToTop()}}class Wue extends we{constructor(){super({id:"editor.action.goToBottomHover",label:p({},"Go To Bottom Hover"),alias:"Go To Bottom Hover",precondition:M.hoverFocused,kbOpts:{kbExpr:M.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){const i=Ds.get(t);i&&i.goToBottom()}}yt(Ds.ID,Ds,2);de(Nue);de(Tue);de(Mue);de(Rue);de(Aue);de(Pue);de(Oue);de(Fue);de(Bue);de(Wue);hg.register(Kw);hg.register(LN);Sr((o,e)=>{const t=o.getColor(NG);t&&(e.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${t.transparent(.5)}; }`))});class IN extends K{constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){const t=this._editor.getOption(146);if(t!=="click"&&t!=="clickAndHover")return;const i=e.target;if(i.type!==6||!i.detail.injectedText||i.detail.injectedText.options.attachedData!==V6||!i.range)return;const n=this._editor.getContribution(Ds.ID);if(n&&!n.isColorPickerVisible){const s=new k(i.range.startLineNumber,i.range.startColumn+1,i.range.endLineNumber,i.range.endColumn+1);n.showContentHover(s,1,0,!1,!0)}}}IN.ID="editor.contrib.colorContribution";yt(IN.ID,IN,2);hg.register(Vw);var mW=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Hr=function(o,e){return function(t,i){e(t,i,o)}},EN,NN;let Qc=EN=class extends K{constructor(e,t,i,n,s,r,a){super(),this._editor=e,this._modelService=i,this._keybindingService=n,this._instantiationService=s,this._languageFeatureService=r,this._languageConfigurationService=a,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=M.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=M.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){var e;this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||(e=this._standaloneColorPickerWidget)===null||e===void 0||e.focus():this._standaloneColorPickerWidget=new qw(this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused,this._instantiationService,this._modelService,this._keybindingService,this._languageFeatureService,this._languageConfigurationService))}hide(){var e;this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),(e=this._standaloneColorPickerWidget)===null||e===void 0||e.hide(),this._editor.focus()}insertColor(){var e;(e=this._standaloneColorPickerWidget)===null||e===void 0||e.updateEditor(),this.hide()}static get(e){return e.getContribution(EN.ID)}};Qc.ID="editor.contrib.standaloneColorPickerController";Qc=EN=mW([Hr(1,We),Hr(2,ii),Hr(3,Pt),Hr(4,Oe),Hr(5,Se),Hr(6,Wt)],Qc);yt(Qc.ID,Qc,1);const g5=8,Vue=22;let qw=NN=class extends K{constructor(e,t,i,n,s,r,a,l){var d;super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=i,this._modelService=s,this._keybindingService=r,this._languageFeaturesService=a,this._languageConfigurationService=l,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new W),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=n.createInstance(W0,this._editor),this._position=(d=this._editor._getViewModel())===null||d===void 0?void 0:d.getPrimaryCursorState().modelState.position;const c=this._editor.getSelection(),h=c?{startLineNumber:c.startLineNumber,startColumn:c.startColumn,endLineNumber:c.endLineNumber,endColumn:c.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},u=this._register(dl(this._body));this._register(u.onDidBlur(g=>{this.hide()})),this._register(u.onDidFocus(g=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(g=>{var f;const m=(f=g.target.element)===null||f===void 0?void 0:f.classList;m&&m.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(g=>{this._render(g.value,g.foundInEditor)})),this._start(h),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return NN.ID}getDomNode(){return this._body}getPosition(){if(!this._position)return null;const e=this._editor.getOption(60).above;return{position:this._position,secondaryPosition:this._position,preference:e?[1,2]:[2,1],positionAffinity:2}}hide(){this.dispose(),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerFocused.set(!1),this._editor.removeContentWidget(this),this._editor.focus()}focus(){this._standaloneColorPickerFocused.set(!0),this._body.focus()}async _start(e){const t=await this._computeAsync(e);t&&this._onResult.fire(new Hue(t.result,t.foundInEditor))}async _computeAsync(e){if(!this._editor.hasModel())return null;const t={range:e,color:{red:0,green:0,blue:0,alpha:1}},i=await this._standaloneColorPickerParticipant.createColorHover(t,new bR(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return i?{result:i.colorHover,foundInEditor:i.foundInEditor}:null}_render(e,t){const i=document.createDocumentFragment(),n=this._register(new Uw(this._keybindingService));let s;const r={fragment:i,statusBar:n,setColorPicker:m=>s=m,onContentsChanged:()=>{},hide:()=>this.hide()};if(this._colorHover=e,this._register(this._standaloneColorPickerParticipant.renderHoverParts(r,[e])),s===void 0)return;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(this._editor.getLayoutInfo().width*.66,500)+"px",this._body.tabIndex=0,this._body.appendChild(i),s.layout();const a=s.body,l=a.saturationBox.domNode.clientWidth,d=a.domNode.clientWidth-l-Vue-g5,c=s.body.enterButton;c?.onClicked(()=>{this.updateEditor(),this.hide()});const h=s.header,u=h.pickedColorNode;u.style.width=l+g5+"px";const g=h.originalColorNode;g.style.width=d+"px";const f=s.header.closeButton;f?.onClicked(()=>{this.hide()}),t&&(c&&(c.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}};qw.ID="editor.contrib.standaloneColorPickerWidget";qw=NN=mW([Hr(3,Oe),Hr(4,ii),Hr(5,Pt),Hr(6,Se),Hr(7,Wt)],qw);class Hue{constructor(e,t){this.value=e,this.foundInEditor=t}}class zue extends aa{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{value:p("showOrFocusStandaloneColorPicker","Show or Focus Standalone Color Picker"),mnemonicTitle:p({},"&&Show or Focus Standalone Color Picker"),original:"Show or Focus Standalone Color Picker"},precondition:void 0,menu:[{id:N.CommandPalette}]})}runEditorCommand(e,t){var i;(i=Qc.get(t))===null||i===void 0||i.showOrFocus()}}class Uue extends we{constructor(){super({id:"editor.action.hideColorPicker",label:p({},"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:M.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100}})}run(e,t){var i;(i=Qc.get(t))===null||i===void 0||i.hide()}}class $ue extends we{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:p({},"Insert Color with Standalone Color Picker"),alias:"Insert Color with Standalone Color Picker",precondition:M.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100}})}run(e,t){var i;(i=Qc.get(t))===null||i===void 0||i.insertColor()}}de(Uue);de($ue);Xt(zue);class ac{constructor(e,t,i){this.languageConfigurationService=i,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,i){if(i<0)return!1;const n=t.length,s=e.length;if(i+n>s)return!1;for(let r=0;r<n;r++){const a=e.charCodeAt(i+r),l=t.charCodeAt(r);if(a!==l&&!(a>=65&&a<=90&&a+32===l)&&!(l>=65&&l<=90&&l+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,i,n,s,r){const a=e.startLineNumber,l=e.startColumn,d=e.endLineNumber,c=e.endColumn,h=s.getLineContent(a),u=s.getLineContent(d);let g=h.lastIndexOf(t,l-1+t.length),f=u.indexOf(i,c-1-i.length);if(g!==-1&&f!==-1)if(a===d)h.substring(g+t.length,f).indexOf(i)>=0&&(g=-1,f=-1);else{const _=h.substring(g+t.length),v=u.substring(0,f);(_.indexOf(i)>=0||v.indexOf(i)>=0)&&(g=-1,f=-1)}let m;g!==-1&&f!==-1?(n&&g+t.length<h.length&&h.charCodeAt(g+t.length)===32&&(t=t+" "),n&&f>0&&u.charCodeAt(f-1)===32&&(i=" "+i,f-=1),m=ac._createRemoveBlockCommentOperations(new k(a,g+t.length+1,d,f+1),t,i)):(m=ac._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=m.length===1?i:null);for(const _ of m)r.addTrackedEditOperation(_.range,_.text)}static _createRemoveBlockCommentOperations(e,t,i){const n=[];return k.isEmpty(e)?n.push(oi.delete(new k(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(n.push(oi.delete(new k(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),n.push(oi.delete(new k(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),n}static _createAddBlockCommentOperations(e,t,i,n){const s=[];return k.isEmpty(e)?s.push(oi.replace(new k(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(s.push(oi.insert(new V(e.startLineNumber,e.startColumn),t+(n?" ":""))),s.push(oi.insert(new V(e.endLineNumber,e.endColumn),(n?" ":"")+i))),s}getEditOperations(e,t){const i=this._selection.startLineNumber,n=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);const s=e.getLanguageIdAtPosition(i,n),r=this.languageConfigurationService.getLanguageConfiguration(s).comments;!r||!r.blockCommentStartToken||!r.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,r.blockCommentStartToken,r.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(i.length===2){const n=i[0],s=i[1];return new xe(n.range.endLineNumber,n.range.endColumn,s.range.startLineNumber,s.range.startColumn)}else{const n=i[0].range,s=this._usedEndToken?-this._usedEndToken.length-1:0;return new xe(n.endLineNumber,n.endColumn+s,n.endLineNumber,n.endColumn+s)}}}class Fl{constructor(e,t,i,n,s,r,a){this.languageConfigurationService=e,this._selection=t,this._tabSize=i,this._type=n,this._insertSpace=s,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=r,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,i,n){e.tokenization.tokenizeIfCheap(t);const s=e.getLanguageIdAtPosition(t,1),r=n.getLanguageConfiguration(s).comments,a=r?r.lineCommentToken:null;if(!a)return null;const l=[];for(let d=0,c=i-t+1;d<c;d++)l[d]={ignore:!1,commentStr:a,commentStrOffset:0,commentStrLength:a.length};return l}static _analyzeLines(e,t,i,n,s,r,a,l){let d=!0,c;e===0?c=!0:e===1?c=!1:c=!0;for(let h=0,u=n.length;h<u;h++){const g=n[h],f=s+h;if(f===s&&a){g.ignore=!0;continue}const m=i.getLineContent(f),_=Xn(m);if(_===-1){g.ignore=r,g.commentStrOffset=m.length;continue}if(d=!1,g.ignore=!1,g.commentStrOffset=_,c&&!ac._haystackHasNeedleAtOffset(m,g.commentStr,_)&&(e===0?c=!1:e===1||(g.ignore=!0)),c&&t){const v=_+g.commentStrLength;v<m.length&&m.charCodeAt(v)===32&&(g.commentStrLength+=1)}}if(e===0&&d){c=!1;for(let h=0,u=n.length;h<u;h++)n[h].ignore=!1}return{supported:!0,shouldRemoveComments:c,lines:n}}static _gatherPreflightData(e,t,i,n,s,r,a,l){const d=Fl._gatherPreflightCommentStrings(i,n,s,l);return d===null?{supported:!1}:Fl._analyzeLines(e,t,i,d,n,r,a,l)}_executeLineComments(e,t,i,n){let s;i.shouldRemoveComments?s=Fl._createRemoveLineCommentsOperations(i.lines,n.startLineNumber):(Fl._normalizeInsertionPoint(e,i.lines,n.startLineNumber,this._tabSize),s=this._createAddLineCommentsOperations(i.lines,n.startLineNumber));const r=new V(n.positionLineNumber,n.positionColumn);for(let a=0,l=s.length;a<l;a++)t.addEditOperation(s[a].range,s[a].text),k.isEmpty(s[a].range)&&k.getStartPosition(s[a].range).equals(r)&&e.getLineContent(r.lineNumber).length+1===r.column&&(this._deltaColumn=(s[a].text||"").length);this._selectionId=t.trackSelection(n)}_attemptRemoveBlockComment(e,t,i,n){let s=t.startLineNumber,r=t.endLineNumber;const a=n.length+Math.max(e.getLineFirstNonWhitespaceColumn(t.startLineNumber),t.startColumn);let l=e.getLineContent(s).lastIndexOf(i,a-1),d=e.getLineContent(r).indexOf(n,t.endColumn-1-i.length);return l!==-1&&d===-1&&(d=e.getLineContent(s).indexOf(n,l+i.length),r=s),l===-1&&d!==-1&&(l=e.getLineContent(r).lastIndexOf(i,d),s=r),t.isEmpty()&&(l===-1||d===-1)&&(l=e.getLineContent(s).indexOf(i),l!==-1&&(d=e.getLineContent(s).indexOf(n,l+i.length))),l!==-1&&e.getLineContent(s).charCodeAt(l+i.length)===32&&(i+=" "),d!==-1&&e.getLineContent(r).charCodeAt(d-1)===32&&(n=" "+n,d-=1),l!==-1&&d!==-1?ac._createRemoveBlockCommentOperations(new k(s,l+i.length+1,r,d+1),i,n):null}_executeBlockComment(e,t,i){e.tokenization.tokenizeIfCheap(i.startLineNumber);const n=e.getLanguageIdAtPosition(i.startLineNumber,1),s=this.languageConfigurationService.getLanguageConfiguration(n).comments;if(!s||!s.blockCommentStartToken||!s.blockCommentEndToken)return;const r=s.blockCommentStartToken,a=s.blockCommentEndToken;let l=this._attemptRemoveBlockComment(e,i,r,a);if(!l){if(i.isEmpty()){const d=e.getLineContent(i.startLineNumber);let c=Xn(d);c===-1&&(c=d.length),l=ac._createAddBlockCommentOperations(new k(i.startLineNumber,c+1,i.startLineNumber,d.length+1),r,a,this._insertSpace)}else l=ac._createAddBlockCommentOperations(new k(i.startLineNumber,e.getLineFirstNonWhitespaceColumn(i.startLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),r,a,this._insertSpace);l.length===1&&(this._deltaColumn=r.length+1)}this._selectionId=t.trackSelection(i);for(const d of l)t.addEditOperation(d.range,d.text)}getEditOperations(e,t){let i=this._selection;if(this._moveEndPositionDown=!1,i.startLineNumber===i.endLineNumber&&this._ignoreFirstLine){t.addEditOperation(new k(i.startLineNumber,e.getLineMaxColumn(i.startLineNumber),i.startLineNumber+1,1),i.startLineNumber===e.getLineCount()?"":`
|
|
653
653
|
`),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=Fl._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 xe(i.selectionStartLineNumber,i.selectionStartColumn+this._deltaColumn,i.positionLineNumber,i.positionColumn+this._deltaColumn)}static _createRemoveLineCommentsOperations(e,t){const i=[];for(let n=0,s=e.length;n<s;n++){const r=e[n];r.ignore||i.push(oi.delete(new k(t+n,r.commentStrOffset+1,t+n,r.commentStrOffset+r.commentStrLength+1)))}return i}_createAddLineCommentsOperations(e,t){const i=[],n=this._insertSpace?" ":"";for(let s=0,r=e.length;s<r;s++){const a=e[s];a.ignore||i.push(oi.insert(new V(t+s,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 s=1073741824,r,a;for(let l=0,d=t.length;l<d;l++){if(t[l].ignore)continue;const c=e.getLineContent(i+l);let h=0;for(let u=0,g=t[l].commentStrOffset;h<s&&u<g;u++)h=Fl.nextVisibleColumn(h,n,c.charCodeAt(u)===9,1);h<s&&(s=h)}s=Math.floor(s/n)*n;for(let l=0,d=t.length;l<d;l++){if(t[l].ignore)continue;const c=e.getLineContent(i+l);let h=0;for(r=0,a=t[l].commentStrOffset;h<s&&r<a;r++)h=Fl.nextVisibleColumn(h,n,c.charCodeAt(r)===9,1);h>s?t[l].commentStrOffset=r-1:t[l].commentStrOffset=r}}}class kR extends we{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(Wt);if(!t.hasModel())return;const n=t.getModel(),s=[],r=n.getOptions(),a=t.getOption(23),l=t.getSelections().map((c,h)=>({selection:c,index:h,ignoreFirstLine:!1}));l.sort((c,h)=>k.compareRangesUsingStarts(c.selection,h.selection));let d=l[0];for(let c=1;c<l.length;c++){const h=l[c];d.selection.endLineNumber===h.selection.startLineNumber&&(d.index<h.index?h.ignoreFirstLine=!0:(d.ignoreFirstLine=!0,d=h))}for(const c of l)s.push(new Fl(i,c.selection,r.tabSize,this._type,a.insertSpace,a.ignoreEmptyLines,c.ignoreFirstLine));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}class Kue extends kR{constructor(){super(0,{id:"editor.action.commentLine",label:p("comment.line","Toggle Line Comment"),alias:"Toggle Line Comment",precondition:M.writable,kbOpts:{kbExpr:M.editorTextFocus,primary:2138,weight:100},menuOpts:{menuId:N.MenubarEditMenu,group:"5_insert",title:p({},"&&Toggle Line Comment"),order:1}})}}class jue extends kR{constructor(){super(1,{id:"editor.action.addCommentLine",label:p("comment.line.add","Add Line Comment"),alias:"Add Line Comment",precondition:M.writable,kbOpts:{kbExpr:M.editorTextFocus,primary:qi(2089,2081),weight:100}})}}class que extends kR{constructor(){super(2,{id:"editor.action.removeCommentLine",label:p("comment.line.remove","Remove Line Comment"),alias:"Remove Line Comment",precondition:M.writable,kbOpts:{kbExpr:M.editorTextFocus,primary:qi(2089,2099),weight:100}})}}class Gue extends we{constructor(){super({id:"editor.action.blockComment",label:p("comment.block","Toggle Block Comment"),alias:"Toggle Block Comment",precondition:M.writable,kbOpts:{kbExpr:M.editorTextFocus,primary:1567,linux:{primary:3103},weight:100},menuOpts:{menuId:N.MenubarEditMenu,group:"5_insert",title:p({},"Toggle &&Block Comment"),order:2}})}run(e,t){const i=e.get(Wt);if(!t.hasModel())return;const n=t.getOption(23),s=[],r=t.getSelections();for(const a of r)s.push(new ac(a,n.insertSpace,i));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}de(Kue);de(jue);de(que);de(Gue);var Zue=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},kh=function(o,e){return function(t,i){e(t,i,o)}},TN;let yp=TN=class{static get(e){return e.getContribution(TN.ID)}constructor(e,t,i,n,s,r,a,l){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=n,this._keybindingService=s,this._menuService=r,this._configurationService=a,this._workspaceContextService=l,this._toDispose=new se,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 c=this._contextViewService.getContextViewElement(),h=d.srcElement;h.shadowRoot&&xu(c)===h.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.isSimpleWidget?N.SimpleEditorContext:N.EditorContext);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const i=[],n=this._menuService.createMenu(t,this._contextKeyService),s=n.getActions({arg:e.uri});n.dispose();for(const r of s){const[,a]=r;let l=0;for(const d of a)if(d instanceof $_){const c=this._getMenuActions(e,d.item.submenu);c.length>0&&(i.push(new Gf(d.id,d.label,c)),l++)}else i.push(d),l++;l&&i.push(new dn)}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 r=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),a=ji(this._editor.getDomNode()),l=a.left+r.left,d=a.top+r.top+r.height;n={x:l,y:d}}const s=this._editor.getOption(126)&&!rl;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:s?this._editor.getDomNode():void 0,getAnchor:()=>n,getActions:()=>e,getActionViewItem:r=>{const a=this._keybindingFor(r);if(a)return new up(r,r,{label:!0,keybinding:a.getLabel(),isMenu:!0});const l=r;return typeof l.getActionViewItem=="function"?l.getActionViewItem():new up(r,r,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:r=>this._keybindingFor(r),onHide:r=>{this._contextMenuIsBeingShownCount--,this._editor.updateOptions({hover:i})}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel()||$te(this._workspaceContextService.getWorkspace()))return;const t=this._editor.getOption(72);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}),s=(d,c)=>new Gf(`menu-action-${++i}`,d,c,void 0),r=(d,c,h,u,g)=>{if(!c)return n({label:d,enabled:c,run:()=>{}});const f=_=>()=>{this._configurationService.updateValue(h,_)},m=[];for(const _ of g)m.push(n({label:_.label,checked:u===_.value,run:f(_.value)}));return s(d,m)},a=[];a.push(n({label:p("context.minimap.minimap","Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new dn),a.push(n({label:p("context.minimap.renderCharacters","Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(r(p("context.minimap.size","Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:p("context.minimap.size.proportional","Proportional"),value:"proportional"},{label:p("context.minimap.size.fill","Fill"),value:"fill"},{label:p("context.minimap.size.fit","Fit"),value:"fit"}])),a.push(r(p("context.minimap.slider","Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:p("context.minimap.slider.mouseover","Mouse Over"),value:"mouseover"},{label:p("context.minimap.slider.always","Always"),value:"always"}]));const l=this._editor.getOption(126)&&!rl;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()}};yp.ID="editor.contrib.contextmenu";yp=TN=Zue([kh(1,Yo),kh(2,bd),kh(3,We),kh(4,Pt),kh(5,ra),kh(6,ft),kh(7,Eu)],yp);class Yue extends we{constructor(){super({id:"editor.action.showContextMenu",label:p("action.showContextMenu.label","Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:M.textInputFocus,primary:1092,weight:100}})}run(e,t){var i;(i=yp.get(t))===null||i===void 0||i.showContextMenu()}}yt(yp.ID,yp,2);de(Yue);class uD{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 gD{constructor(e,t,i){this.cursorState=e,this.scrollTop=t,this.scrollLeft=i}}class zu extends K{static get(e){return e.getContribution(zu.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 uD(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new gD(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 gD(new uD(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 gD(new uD(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}}zu.ID="editor.contrib.cursorUndoRedoController";class Xue extends we{constructor(){super({id:"cursorUndo",label:p("cursor.undo","Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:M.textInputFocus,primary:2099,weight:100}})}run(e,t,i){var n;(n=zu.get(t))===null||n===void 0||n.cursorUndo()}}class Que extends we{constructor(){super({id:"cursorRedo",label:p("cursor.redo","Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,i){var n;(n=zu.get(t))===null||n===void 0||n.cursorRedo()}}yt(zu.ID,zu,0);de(Xue);de(Que);class Jue{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 k(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 xe(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 xe(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 xe(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 xe(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 xe(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 Eg(o){return ut?o.altKey:o.ctrlKey}class dd extends K{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)||(Eg(e)&&(this._modifierPressed=!0),this._mouseDown&&Eg(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(35)||this._editor.getOption(22)||(Eg(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===dd.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(s=>t.position&&s.containsPosition(t.position));if(n.length===1)this._dragSelection=n[0];else return}Eg(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 V(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:s,selectionStartColumn:r}=n;i=[new xe(s,r,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map(n=>n.containsPosition(t)?new xe(t.lineNumber,t.column,t.lineNumber,t.column):n);this._editor.setSelections(i||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(Eg(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(dd.ID,new Jue(this._dragSelection,t,Eg(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 k(e.lineNumber,e.column,e.lineNumber,e.column),options:dd._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()}}dd.ID="editor.contrib.dragAndDrop";dd.TRIGGER_KEY_VALUE=ut?6:5;dd._DECORATION_OPTIONS=Ze.register({description:"dnd-target",className:"dnd-target"});yt(dd.ID,dd,2);const zy=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let o;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?o=crypto.getRandomValues.bind(crypto):o=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(){o(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let n=0,s="";return s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s}}();function IR(o){return{asString:async()=>o,asFile:()=>{},value:typeof o=="string"?o:void 0}}function ege(o,e,t){const i={id:zy(),name:o,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class _W{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 rt.some(this,([i,n])=>n.asFile())&&t.push("files"),bW(Gw(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))===null||t===void 0?void 0:t[0]}append(e,t){const 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 Gw(e)}}function Gw(o){return o.toLowerCase()}function vW(o,e){return bW(Gw(o),e.map(Gw))}function bW(o,e){if(o==="*/*")return e.length>0;if(e.includes(o))return!0;const t=o.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,n,s]=t;return s==="*"?e.some(r=>r.startsWith(n+"/")):!1}const Uy=Object.freeze({create:o=>Ic(o.map(e=>e.toString())).join(`\r
|
|
654
654
|
`),split:o=>o.split(`\r
|
|
@@ -711,4 +711,4 @@ The flag will not be saved for the future.
|
|
|
711
711
|
`);return new iv(e,t,n,d,s,r,c)}constructor(e,t,i,n,s,r,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=n,this.wholeWord=s,this.matchCase=r,this.currentMatch=a}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new CC(t.concat(e),e,0)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new CC(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const n=this.currentMatch;return this.currentMatch=null,n}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1);return i?new xe(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}addSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new CC(t.concat(e),e,0)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new CC(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const n=this.currentMatch;return this.currentMatch=null,n}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1);return i?new xe(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}selectAll(e){if(!this._editor.hasModel())return[];this.findController.highlightFindOptions();const t=this._editor.getModel();return e?t.findMatches(this.searchText,e,!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1,1073741824)}}class qu extends K{static get(e){return e.getContribution(qu.ID)}constructor(e){super(),this._sessionDispose=this._register(new se),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=iv.create(this._editor,e);if(!t)return;this._session=t;const i={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(i.wholeWordOverride=1,i.matchCaseOverride=1,i.isRegexOverride=2),e.getState().change(i,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(n=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(n=>{(n.matchCase||n.wholeWord)&&this._endSession()}))}}_endSession(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){const e={wholeWordOverride:0,matchCaseOverride:0,isRegexOverride:0};this._session.findController.getState().change(e,!1)}this._session=null}_setSelections(e){this._ignoreSelectionChange=!0,this._editor.setSelections(e),this._ignoreSelectionChange=!1}_expandEmptyToWord(e,t){if(!t.isEmpty())return t;const i=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return i?new xe(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):t}_applySessionResult(e){e&&(this._setSelections(e.selections),e.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange,e.revealScrollType))}getSession(e){return this._session}addSelectionToNextFindMatch(e){if(this._editor.hasModel()){if(!this._session){const t=this._editor.getSelections();if(t.length>1){const n=e.getState().matchCase;if(!pV(this._editor.getModel(),t,n)){const r=this._editor.getModel(),a=[];for(let l=0,d=t.length;l<d;l++)a[l]=this._expandEmptyToWord(r,t[l]);this._editor.setSelections(a);return}}}this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.addSelectionToNextFindMatch())}}addSelectionToPreviousFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.addSelectionToPreviousFindMatch())}moveSelectionToNextFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.moveSelectionToNextFindMatch())}moveSelectionToPreviousFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.moveSelectionToPreviousFindMatch())}selectAll(e){if(!this._editor.hasModel())return;let t=null;const i=e.getState();if(i.isRevealed&&i.searchString.length>0&&i.isRegex){const n=this._editor.getModel();i.searchScope?t=n.findMatches(i.searchString,i.searchScope,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(129):null,!1,1073741824):t=n.findMatches(i.searchString,!0,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(129):null,!1,1073741824)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(i.searchScope)}if(t.length>0){const n=this._editor.getSelection();for(let s=0,r=t.length;s<r;s++){const a=t[s];if(a.range.intersectRanges(n)){t[s]=t[0],t[0]=a;break}}this._setSelections(t.map(s=>new xe(s.range.startLineNumber,s.range.startColumn,s.range.endLineNumber,s.range.endColumn)))}}}qu.ID="editor.contrib.multiCursorController";class Qp extends we{run(e,t){const i=qu.get(t);if(!i)return;const n=t._getViewModel();if(n){const s=n.getCursorStates(),r=us.get(t);if(r)this._run(i,r);else{const a=e.get(Oe).createInstance(us,t);this._run(i,a),a.dispose()}uh(s,n.getCursorStates())}}}class D_e extends Qp{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:p("addSelectionToNextFindMatch","Add Selection To Next Find Match"),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:M.focus,primary:2082,weight:100},menuOpts:{menuId:N.MenubarSelectionMenu,group:"3_multi",title:p({},"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class k_e extends Qp{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:p("addSelectionToPreviousFindMatch","Add Selection To Previous Find Match"),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:N.MenubarSelectionMenu,group:"3_multi",title:p({},"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class I_e extends Qp{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:p("moveSelectionToNextFindMatch","Move Last Selection To Next Find Match"),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:M.focus,primary:qi(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class E_e extends Qp{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:p("moveSelectionToPreviousFindMatch","Move Last Selection To Previous Find Match"),alias:"Move Last Selection To Previous Find Match",precondition:void 0})}_run(e,t){e.moveSelectionToPreviousFindMatch(t)}}class N_e extends Qp{constructor(){super({id:"editor.action.selectHighlights",label:p("selectAllOccurrencesOfFindMatch","Select All Occurrences of Find Match"),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:M.focus,primary:3114,weight:100},menuOpts:{menuId:N.MenubarSelectionMenu,group:"3_multi",title:p({},"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class T_e extends Qp{constructor(){super({id:"editor.action.changeAll",label:p("changeAll.label","Change All Occurrences"),alias:"Change All Occurrences",precondition:te.and(M.writable,M.editorTextFocus),kbOpts:{kbExpr:M.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class M_e{constructor(e,t,i,n,s){this._model=e,this._searchText=t,this._matchCase=i,this._wordSeparators=n,this._modelVersionId=this._model.getVersionId(),this._cachedFindMatches=null,s&&this._model===s._model&&this._searchText===s._searchText&&this._matchCase===s._matchCase&&this._wordSeparators===s._wordSeparators&&this._modelVersionId===s._modelVersionId&&(this._cachedFindMatches=s._cachedFindMatches)}findMatches(){return this._cachedFindMatches===null&&(this._cachedFindMatches=this._model.findMatches(this._searchText,!0,!1,this._matchCase,this._wordSeparators,!1).map(e=>e.range),this._cachedFindMatches.sort(k.compareRangesUsingStarts)),this._cachedFindMatches}}let nv=hT=class extends K{constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(107),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new Rt(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(n=>{this._isEnabled=e.getOption(107)})),this._register(e.onDidChangeCursorSelection(n=>{this._isEnabled&&(n.selection.isEmpty()?n.reason===3?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())})),this._register(e.onDidChangeModel(n=>{this._setState(null)})),this._register(e.onDidChangeModelContent(n=>{this._isEnabled&&this.updateSoon.schedule()}));const i=us.get(e);i&&this._register(i.getState().onFindReplaceStateChange(n=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(hT._createState(this.state,this._isEnabled,this.editor))}static _createState(e,t,i){if(!t||!i.hasModel())return null;const n=i.getSelection();if(n.startLineNumber!==n.endLineNumber)return null;const s=qu.get(i);if(!s)return null;const r=us.get(i);if(!r)return null;let a=s.getSession(r);if(!a){const c=i.getSelections();if(c.length>1){const u=r.getState().matchCase;if(!pV(i.getModel(),c,u))return null}a=iv.create(i,r)}if(!a||a.currentMatch||/^[ \t]+$/.test(a.searchText)||a.searchText.length>200)return null;const l=r.getState(),d=l.matchCase;if(l.isRevealed){let c=l.searchString;d||(c=c.toLowerCase());let h=a.searchText;if(d||(h=h.toLowerCase()),c===h&&a.matchCase===l.matchCase&&a.wholeWord===l.wholeWord&&!l.isRegex)return null}return new M_e(i.getModel(),a.searchText,a.matchCase,a.wholeWord?i.getOption(129):null,e)}_setState(e){if(this.state=e,!this.state){this._decorations.clear();return}if(!this.editor.hasModel())return;const t=this.editor.getModel();if(t.isTooLargeForTokenization())return;const i=this.state.findMatches(),n=this.editor.getSelections();n.sort(k.compareRangesUsingStarts);const s=[];for(let d=0,c=0,h=i.length,u=n.length;d<h;){const g=i[d];if(c>=u)s.push(g),d++;else{const f=k.compareRangesUsingStarts(g,n[c]);f<0?((n[c].isEmpty()||!k.areIntersecting(g,n[c]))&&s.push(g),d++):(f>0||d++,c++)}}const r=this.editor.getOption(80)!=="off",a=this._languageFeaturesService.documentHighlightProvider.has(t)&&r,l=s.map(d=>({range:d,options:v_e(a)}));this._decorations.set(l)}dispose(){this._setState(null),super.dispose()}};nv.ID="editor.contrib.selectionHighlighter";nv=hT=b_e([C_e(1,Se)],nv);function pV(o,e,t){const i=e3(o,e[0],!t);for(let n=1,s=e.length;n<s;n++){const r=e[n];if(r.isEmpty())return!1;const a=e3(o,r,!t);if(i!==a)return!1}return!0}function e3(o,e,t){const i=o.getValueInRange(e);return t?i.toLowerCase():i}class R_e extends we{constructor(){super({id:"editor.action.focusNextCursor",label:p("mutlicursor.focusNextCursor","Focus Next Cursor"),metadata:{description:p("mutlicursor.focusNextCursor.description","Focuses the next cursor"),args:[]},alias:"Focus Next Cursor",precondition:void 0})}run(e,t,i){if(!t.hasModel())return;const n=t._getViewModel();if(n.cursorConfig.readOnly)return;n.model.pushStackElement();const s=Array.from(n.getCursorStates()),r=s.shift();r&&(s.push(r),n.setCursorStates(i.source,3,s),n.revealPrimaryCursor(i.source,!0),uh(s,n.getCursorStates()))}}class A_e extends we{constructor(){super({id:"editor.action.focusPreviousCursor",label:p("mutlicursor.focusPreviousCursor","Focus Previous Cursor"),metadata:{description:p("mutlicursor.focusPreviousCursor.description","Focuses the previous cursor"),args:[]},alias:"Focus Previous Cursor",precondition:void 0})}run(e,t,i){if(!t.hasModel())return;const n=t._getViewModel();if(n.cursorConfig.readOnly)return;n.model.pushStackElement();const s=Array.from(n.getCursorStates()),r=s.pop();r&&(s.unshift(r),n.setCursorStates(i.source,3,s),n.revealPrimaryCursor(i.source,!0),uh(s,n.getCursorStates()))}}yt(qu.ID,qu,4);yt(nv.ID,nv,1);de(w_e);de(S_e);de(y_e);de(D_e);de(k_e);de(I_e);de(E_e);de(N_e);de(T_e);de(L_e);de(x_e);de(R_e);de(A_e);const Gu={Visible:new be("parameterHintsVisible",!1),MultipleSignatures:new be("parameterHintsMultipleSignatures",!1)};async function mV(o,e,t,i,n){const s=o.ordered(e);for(const r of s)try{const a=await r.provideSignatureHelp(e,t,n,i);if(a)return a}catch(a){Mi(a)}}gt.registerCommand("_executeSignatureHelpProvider",async(o,...e)=>{const[t,i,n]=e;Tt(Me.isUri(t)),Tt(V.isIPosition(i)),Tt(typeof n=="string"||!n);const s=o.get(Se),r=await o.get(ks).createModelReference(t);try{const a=await mV(s.signatureHelpProvider,r.object.textEditorModel,V.lift(i),{triggerKind:Ja.Invoke,isRetrigger:!1,triggerCharacter:n},st.None);return a?(setTimeout(()=>a.dispose(),0),a.value):void 0}finally{r.dispose()}});var Hd;(function(o){o.Default={type:0};class e{constructor(n,s){this.request=n,this.previouslyActiveHints=s,this.type=2}}o.Pending=e;class t{constructor(n){this.hints=n,this.type=1}}o.Active=t})(Hd||(Hd={}));class hL extends K{constructor(e,t,i=hL.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new W),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=Hd.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new Cn),this.triggerChars=new k1,this.retriggerChars=new k1,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new vr(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=Hd.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(Ge)}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(85).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(85).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 Hd.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(P_e);this._pendingTriggers=[];const s={triggerKind:n.triggerKind,triggerCharacter:n.triggerCharacter,isRetrigger:t,activeSignatureHelp:i};if(!this.editor.hasModel())return!1;const r=this.editor.getModel(),a=this.editor.getPosition();this.state=new Hd.Pending(Zi(l=>mV(this.providers,r,a,s,l)),i);try{const l=await this.state.request;return e!==this.triggerId?(l?.dispose(),!1):!l||!l.value.signatures||l.value.signatures.length===0?(l?.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1):(this.state=new Hd.Active(l.value),this._lastSignatureHelpResult.value=l,this._onChangedHints.fire(this.state.hints),!0)}catch(l){return e===this.triggerId&&(this.state=Hd.Default),Ge(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:Ja.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:Ja.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:Ja.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(85).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}}hL.DEFAULT_DELAY=120;function P_e(o,e){switch(e.triggerKind){case Ja.Invoke:return e;case Ja.ContentChange:return o;case Ja.TriggerCharacter:default:return e}}var O_e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},SD=function(o,e){return function(t,i){e(t,i,o)}},uT;const to=pe,F_e=Di("parameter-hints-next",he.chevronDown,p("parameterHintsNextIcon","Icon for show next parameter hint.")),B_e=Di("parameter-hints-previous",he.chevronUp,p("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let oS=uT=class extends K{constructor(e,t,i,n,s){super(),this.editor=e,this.model=t,this.renderDisposeables=this._register(new se),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new pd({editor:e},s,n)),this.keyVisible=Gu.Visible.bindTo(i),this.keyMultipleSignatures=Gu.MultipleSignatures.bindTo(i)}createParameterHintDOMNodes(){const e=to(".editor-widget.parameter-hints-widget"),t=ie(e,to(".phwrapper"));t.tabIndex=-1;const i=ie(t,to(".controls")),n=ie(i,to(".button"+Re.asCSSSelector(B_e))),s=ie(i,to(".overloads")),r=ie(i,to(".button"+Re.asCSSSelector(F_e)));this._register(Q(n,"click",u=>{Je.stop(u),this.previous()})),this._register(Q(r,"click",u=>{Je.stop(u),this.next()}));const a=to(".body"),l=new Cv(a,{alwaysConsumeMouseWheel:!0});this._register(l),t.appendChild(l.getDomNode());const d=ie(a,to(".signature")),c=ie(a,to(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:d,overloads:s,docs:c,scrollbar:l},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(u=>{this.visible&&this.editor.layoutContentWidget(this)}));const h=()=>{if(!this.domNodes)return;const u=this.editor.getOption(50);this.domNodes.element.style.fontSize=`${u.fontSize}px`,this.domNodes.element.style.lineHeight=`${u.lineHeight/u.fontSize}`};h(),this._register(fe.chain(this.editor.onDidChangeConfiguration.bind(this.editor),u=>u.filter(g=>g.hasChanged(50)))(h)),this._register(this.editor.onDidLayoutChange(u=>this.updateMaxHeight())),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout(()=>{var e;(e=this.domNodes)===null||e===void 0||e.element.classList.add("visible")},100),this.editor.layoutContentWidget(this))}hide(){var e;this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,(e=this.domNodes)===null||e===void 0||e.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){var t;if(this.renderDisposeables.clear(),!this.domNodes)return;const i=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",i),this.keyMultipleSignatures.set(i),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const n=e.signatures[e.activeSignature];if(!n)return;const s=ie(this.domNodes.signature,to(".code")),r=this.editor.getOption(50);s.style.fontSize=`${r.fontSize}px`,s.style.fontFamily=r.fontFamily;const a=n.parameters.length>0,l=(t=n.activeParameter)!==null&&t!==void 0?t:e.activeParameter;if(a)this.renderParameters(s,n,l);else{const h=ie(s,to("span"));h.textContent=n.label}const d=n.parameters[l];if(d?.documentation){const h=to("span.documentation");if(typeof d.documentation=="string")h.textContent=d.documentation;else{const u=this.renderMarkdownDocs(d.documentation);h.appendChild(u.element)}ie(this.domNodes.docs,to("p",{},h))}if(n.documentation!==void 0)if(typeof n.documentation=="string")ie(this.domNodes.docs,to("p",{},n.documentation));else{const h=this.renderMarkdownDocs(n.documentation);ie(this.domNodes.docs,h.element)}const c=this.hasDocs(n,d);if(this.domNodes.signature.classList.toggle("has-docs",c),this.domNodes.docs.classList.toggle("empty",!c),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,d){let h="";const u=n.parameters[l];Array.isArray(u.label)?h=n.label.substring(u.label[0],u.label[1]):h=u.label,u.documentation&&(h+=typeof u.documentation=="string"?`, ${u.documentation}`:`, ${u.documentation.value}`),n.documentation&&(h+=typeof n.documentation=="string"?`, ${n.documentation}`:`, ${n.documentation.value}`),this.announcedLabel!==h&&(js(p("hint","{0}, hint",h)),this.announcedLabel=h)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=this.renderDisposeables.add(this.markdownRenderer.render(e,{asyncRenderCallback:()=>{var i;(i=this.domNodes)===null||i===void 0||i.scrollbar.scanDomNode()}}));return t.element.classList.add("markdown-docs"),t}hasDocs(e,t){return!!(t&&typeof t.documentation=="string"&&Zd(t.documentation).length>0||t&&typeof t.documentation=="object"&&Zd(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&Zd(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&Zd(e.documentation.value).length>0)}renderParameters(e,t,i){const[n,s]=this.getParameterLabelOffsets(t,i),r=document.createElement("span");r.textContent=t.label.substring(0,n);const a=document.createElement("span");a.textContent=t.label.substring(n,s),a.className="parameter active";const l=document.createElement("span");l.textContent=t.label.substring(s),ie(e,r,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|^)${yo(i.label)}(?=\\W|$)`,"g");n.test(e.label);const s=n.lastIndex-i.label.length;return s>=0?[s,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 uT.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)}};oS.ID="editor.widget.parameterHintsWidget";oS=uT=O_e([SD(2,We),SD(3,Qs),SD(4,ni)],oS);R("editorHoverWidget.highlightForeground",{dark:hr,light:hr,hcDark:hr,hcLight:hr},p("editorHoverWidgetHighlightForeground","Foreground color of the active item in the parameter hint."));var W_e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},t3=function(o,e){return function(t,i){e(t,i,o)}},gT;let Zu=gT=class extends K{static get(e){return e.getContribution(gT.ID)}constructor(e,t,i){super(),this.editor=e,this.model=this._register(new hL(e,i.signatureHelpProvider)),this._register(this.model.onChangedHints(n=>{var s;n?(this.widget.value.show(),this.widget.value.render(n)):(s=this.widget.rawValue)===null||s===void 0||s.hide()})),this.widget=new sh(()=>this._register(t.createInstance(oS,this.editor,this.model)))}cancel(){this.model.cancel()}previous(){var e;(e=this.widget.rawValue)===null||e===void 0||e.previous()}next(){var e;(e=this.widget.rawValue)===null||e===void 0||e.next()}trigger(e){this.model.trigger(e,0)}};Zu.ID="editor.controller.parameterHints";Zu=gT=W_e([t3(1,Oe),t3(2,Se)],Zu);class V_e extends we{constructor(){super({id:"editor.action.triggerParameterHints",label:p("parameterHints.trigger.label","Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:M.hasSignatureHelpProvider,kbOpts:{kbExpr:M.editorTextFocus,primary:3082,weight:100}})}run(e,t){const i=Zu.get(t);i?.trigger({triggerKind:Ja.Invoke})}}yt(Zu.ID,Zu,2);de(V_e);const GR=175,ZR=cn.bindToContribution(Zu.get);ue(new ZR({id:"closeParameterHints",precondition:Gu.Visible,handler:o=>o.cancel(),kbOpts:{weight:GR,kbExpr:M.focus,primary:9,secondary:[1033]}}));ue(new ZR({id:"showPrevParameterHint",precondition:te.and(Gu.Visible,Gu.MultipleSignatures),handler:o=>o.previous(),kbOpts:{weight:GR,kbExpr:M.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}}));ue(new ZR({id:"showNextParameterHint",precondition:te.and(Gu.Visible,Gu.MultipleSignatures),handler:o=>o.next(),kbOpts:{weight:GR,kbExpr:M.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));var H_e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},yD=function(o,e){return function(t,i){e(t,i,o)}};const uL=new be("renameInputVisible",!1,p("renameInputVisible","Whether the rename input widget is visible"));let fT=class{constructor(e,t,i,n,s){this._editor=e,this._acceptKeybindings=t,this._themeService=i,this._keybindingService=n,this._disposables=new se,this.allowEditorOverflow=!0,this._visibleContextKey=uL.bindTo(s),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(r=>{r.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._input=document.createElement("input"),this._input.className="rename-input",this._input.type="text",this._input.setAttribute("aria-label",p("renameAriaLabel","Rename input. Type new name and press Enter to commit.")),this._domNode.appendChild(this._input),this._label=document.createElement("div"),this._label.className="rename-label",this._domNode.appendChild(this._label),this._updateFont(),this._updateStyles(this._themeService.getColorTheme())),this._domNode}_updateStyles(e){var t,i,n,s;if(!this._input||!this._domNode)return;const r=e.getColor(Ua),a=e.getColor(P2);this._domNode.style.backgroundColor=String((t=e.getColor(mi))!==null&&t!==void 0?t:""),this._domNode.style.boxShadow=r?` 0 0 8px 2px ${r}`:"",this._domNode.style.border=a?`1px solid ${a}`:"",this._domNode.style.color=String((i=e.getColor(g8))!==null&&i!==void 0?i:""),this._input.style.backgroundColor=String((n=e.getColor(u8))!==null&&n!==void 0?n:"");const l=e.getColor(f8);this._input.style.borderWidth=l?"1px":"0px",this._input.style.borderStyle=l?"solid":"none",this._input.style.borderColor=(s=l?.toString())!==null&&s!==void 0?s:"none"}_updateFont(){if(!this._input||!this._label)return;const e=this._editor.getOption(50);this._input.style.fontFamily=e.fontFamily,this._input.style.fontWeight=e.fontWeight,this._input.style.fontSize=`${e.fontSize}px`,this._label.style.fontSize=`${e.fontSize*.8}px`}getPosition(){return this._visible?{position:this._position,preference:[2,1]}:null}beforeRender(){var e,t;const[i,n]=this._acceptKeybindings;return this._label.innerText=p({},"{0} to Rename, {1} to Preview",(e=this._keybindingService.lookupKeybinding(i))===null||e===void 0?void 0:e.getLabel(),(t=this._keybindingService.lookupKeybinding(n))===null||t===void 0?void 0:t.getLabel()),null}afterRender(e){e||this.cancelInput(!0)}acceptInput(e){var t;(t=this._currentAcceptInput)===null||t===void 0||t.call(this,e)}cancelInput(e){var t;(t=this._currentCancelInput)===null||t===void 0||t.call(this,e)}getInput(e,t,i,n,s,r){this._domNode.classList.toggle("preview",s),this._position=new V(e.startLineNumber,e.startColumn),this._input.value=t,this._input.setAttribute("selectionStart",i.toString()),this._input.setAttribute("selectionEnd",n.toString()),this._input.size=Math.max((e.endColumn-e.startColumn)*1.1,20);const a=new se;return new Promise(l=>{this._currentCancelInput=d=>(this._currentAcceptInput=void 0,this._currentCancelInput=void 0,l(d),!0),this._currentAcceptInput=d=>{if(this._input.value.trim().length===0||this._input.value===t){this.cancelInput(!0);return}this._currentAcceptInput=void 0,this._currentCancelInput=void 0,l({newName:this._input.value,wantsPreview:s&&d})},a.add(r.onCancellationRequested(()=>this.cancelInput(!0))),a.add(this._editor.onDidBlurEditorWidget(()=>{var d;return this.cancelInput(!(!((d=this._domNode)===null||d===void 0)&&d.ownerDocument.hasFocus()))})),this._show()}).finally(()=>{a.dispose(),this._hide()})}_show(){this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,0),this._visible=!0,this._visibleContextKey.set(!0),this._editor.layoutContentWidget(this),setTimeout(()=>{this._input.focus(),this._input.setSelectionRange(parseInt(this._input.getAttribute("selectionStart")),parseInt(this._input.getAttribute("selectionEnd")))},100)}_hide(){this._visible=!1,this._visibleContextKey.reset(),this._editor.layoutContentWidget(this)}};fT=H_e([yD(2,tn),yD(3,Pt),yD(4,We)],fT);var z_e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Eh=function(o,e){return function(t,i){e(t,i,o)}},pT;class YR{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 s=await n.resolveRenameLocation(this.model,this.position,e);if(s){if(s.rejectReason){t.push(s.rejectReason);continue}return s}}this._providerRenameIdx=0;const i=this.model.getWordAtPosition(this.position);return i?{range:new k(this.position.lineNumber,i.startColumn,this.position.lineNumber,i.endColumn),text:i.word,rejectReason:t.length>0?t.join(`
|
|
712
712
|
`):void 0}:{range:k.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join(`
|
|
713
713
|
`):void 0}}async provideRenameEdits(e,t){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)}async _provideRenameEdits(e,t,i,n){const s=this._providers[t];if(!s)return{edits:[],rejectReason:i.join(`
|
|
714
|
-
`)};const r=await s.provideRenameEdits(this.model,this.position,e,n);if(r){if(r.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(r.rejectReason),n)}else return this._provideRenameEdits(e,t+1,i.concat(p("no result","No result.")),n);return r}}async function U_e(o,e,t,i){const n=new YR(e,t,o),s=await n.resolveRenameLocation(st.None);return s?.rejectReason?{edits:[],rejectReason:s.rejectReason}:n.provideRenameEdits(i,st.None)}let Yu=pT=class{static get(e){return e.getContribution(pT.ID)}constructor(e,t,i,n,s,r,a,l){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=n,this._progressService=s,this._logService=r,this._configService=a,this._languageFeaturesService=l,this._disposableStore=new se,this._cts=new Wi,this._renameInputField=this._disposableStore.add(this._instaService.createInstance(fT,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){var e,t;if(this._cts.dispose(!0),this._cts=new Wi,!this.editor.hasModel())return;const i=this.editor.getPosition(),n=new YR(this.editor.getModel(),i,this._languageFeaturesService.renameProvider);if(!n.hasProvider())return;const s=new Uc(this.editor,5,void 0,this._cts.token);let r;try{const f=n.resolveRenameLocation(s.token);this._progressService.showWhile(f,250),r=await f}catch(f){(e=zs.get(this.editor))===null||e===void 0||e.showMessage(f||p("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),i);return}finally{s.dispose()}if(!r)return;if(r.rejectReason){(t=zs.get(this.editor))===null||t===void 0||t.showMessage(r.rejectReason,i);return}if(s.token.isCancellationRequested)return;const a=new Uc(this.editor,5,r.range,this._cts.token),l=this.editor.getSelection();let d=0,c=r.text.length;!k.isEmpty(l)&&!k.spansMultipleLines(l)&&k.containsRange(r.range,l)&&(d=Math.max(0,l.startColumn-r.range.startColumn),c=Math.min(r.range.endColumn,l.endColumn)-r.range.startColumn);const h=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),u=await this._renameInputField.getInput(r.range,r.text,d,c,h,a.token);if(typeof u=="boolean"){u&&this.editor.focus(),a.dispose();return}this.editor.focus();const g=DS(n.provideRenameEdits(u.newName,a.token),a.token).then(async f=>{if(!(!f||!this.editor.hasModel())){if(f.rejectReason){this._notificationService.info(f.rejectReason);return}this.editor.setSelection(k.fromPositions(this.editor.getSelection().getPosition())),this._bulkEditService.apply(f,{editor:this.editor,showPreview:u.wantsPreview,label:p("label","Renaming '{0}' to '{1}'",r?.text,u.newName),code:"undoredo.rename",quotableLabel:p("quotableLabel","Renaming {0} to {1}",r?.text,u.newName),respectAutoSaveConfig:!0}).then(m=>{m.ariaSummary&&js(p("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",r.text,u.newName,m.ariaSummary))}).catch(m=>{this._notificationService.error(p("rename.failedApply","Rename failed to apply edits")),this._logService.error(m)})}},f=>{this._notificationService.error(p("rename.failed","Rename failed to compute edits")),this._logService.error(f)}).finally(()=>{a.dispose()});return this._progressService.showWhile(g,250),g}acceptRenameInput(e){this._renameInputField.acceptInput(e)}cancelRenameInput(){this._renameInputField.cancelInput(!0)}};Yu.ID="editor.contrib.renameController";Yu=pT=z_e([Eh(1,Oe),Eh(2,Vi),Eh(3,kv),Eh(4,lh),Eh(5,Zs),Eh(6,k2),Eh(7,Se)],Yu);class $_e extends we{constructor(){super({id:"editor.action.rename",label:p("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:te.and(M.writable,M.hasRenameProvider),kbOpts:{kbExpr:M.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(Dt),[n,s]=Array.isArray(t)&&t||[void 0,void 0];return Me.isUri(n)&&V.isIPosition(s)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(s),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},Ge):super.runCommand(e,t)}run(e,t){const i=Yu.get(t);return i?i.run():Promise.resolve()}}yt(Yu.ID,Yu,4);de($_e);const XR=cn.bindToContribution(Yu.get);ue(new XR({id:"acceptRenameInput",precondition:uL,handler:o=>o.acceptRenameInput(!1),kbOpts:{weight:199,kbExpr:te.and(M.focus,te.not("isComposing")),primary:3}}));ue(new XR({id:"acceptRenameInputWithPreview",precondition:te.and(uL,te.has("config.editor.rename.enablePreview")),handler:o=>o.acceptRenameInput(!0),kbOpts:{weight:199,kbExpr:te.and(M.focus,te.not("isComposing")),primary:1027}}));ue(new XR({id:"cancelRenameInput",precondition:uL,handler:o=>o.cancelRenameInput(),kbOpts:{weight:199,kbExpr:M.focus,primary:9,secondary:[1033]}}));Cl("_executeDocumentRenameProvider",function(o,e,t,...i){const[n]=i;Tt(typeof n=="string");const{renameProvider:s}=o.get(Se);return U_e(s,e,t,n)});Cl("_executePrepareRename",async function(o,e,t){const{renameProvider:i}=o.get(Se),s=await new YR(e,t,i).resolveRenameLocation(st.None);if(s?.rejectReason)throw new Error(s.rejectReason);return s});Ri.as(la.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:p("enablePreview","Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});function K_e(o){for(let e=0,t=o.length;e<t;e+=4){const i=o[e+0],n=o[e+1],s=o[e+2],r=o[e+3];o[e+0]=r,o[e+1]=s,o[e+2]=n,o[e+3]=i}}function j_e(o){const e=new Uint8Array(o.buffer,o.byteOffset,o.length*4);return D3()||K_e(e),AS.wrap(e)}function _V(o){const e=new Uint32Array(q_e(o));let t=0;if(e[t++]=o.id,o.type==="full")e[t++]=1,e[t++]=o.data.length,e.set(o.data,t),t+=o.data.length;else{e[t++]=2,e[t++]=o.deltas.length;for(const i of o.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 j_e(e)}function q_e(o){let e=0;if(e+=2,o.type==="full")e+=1+o.data.length;else{e+=1,e+=3*o.deltas.length;for(const t of o.deltas)t.data&&(e+=t.data.length)}return e}function gL(o){return o&&!!o.data}function vV(o){return o&&Array.isArray(o.edits)}class G_e{constructor(e,t,i){this.provider=e,this.tokens=t,this.error=i}}function bV(o,e){return o.has(e)}function Z_e(o,e){const t=o.orderedGroups(e);return t.length>0?t[0]:[]}async function CV(o,e,t,i,n){const s=Z_e(o,e),r=await Promise.all(s.map(async a=>{let l,d=null;try{l=await a.provideDocumentSemanticTokens(e,a===t?i:null,n)}catch(c){d=c,l=null}return(!l||!gL(l)&&!vV(l))&&(l=null),new G_e(a,l,d)}));for(const a of r){if(a.error)throw a.error;if(a.tokens)return a}return r.length>0?r[0]:null}function Y_e(o,e){const t=o.orderedGroups(e);return t.length>0?t[0]:null}class X_e{constructor(e,t){this.provider=e,this.tokens=t}}function Q_e(o,e){return o.has(e)}function wV(o,e){const t=o.orderedGroups(e);return t.length>0?t[0]:[]}async function QR(o,e,t,i){const n=wV(o,e),s=await Promise.all(n.map(async r=>{let a;try{a=await r.provideDocumentRangeSemanticTokens(e,t,i)}catch(l){Mi(l),a=null}return(!a||!gL(a))&&(a=null),new X_e(r,a)}));for(const r of s)if(r.tokens)return r;return s.length>0?s[0]:null}gt.registerCommand("_provideDocumentSemanticTokensLegend",async(o,...e)=>{const[t]=e;Tt(t instanceof Me);const i=o.get(ii).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=o.get(Se),s=Y_e(n,i);return s?s[0].getLegend():o.get(ui).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)});gt.registerCommand("_provideDocumentSemanticTokens",async(o,...e)=>{const[t]=e;Tt(t instanceof Me);const i=o.get(ii).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=o.get(Se);if(!bV(n,i))return o.get(ui).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());const s=await CV(n,i,null,null,st.None);if(!s)return;const{provider:r,tokens:a}=s;if(!a||!gL(a))return;const l=_V({id:0,type:"full",data:a.data});return a.resultId&&r.releaseDocumentSemanticTokens(a.resultId),l});gt.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(o,...e)=>{const[t,i]=e;Tt(t instanceof Me);const n=o.get(ii).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:s}=o.get(Se),r=wV(s,n);if(r.length===0)return;if(r.length===1)return r[0].getLegend();if(!i||!k.isIRange(i))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),r[0].getLegend();const a=await QR(s,n,k.lift(i),st.None);if(a)return a.provider.getLegend()});gt.registerCommand("_provideDocumentRangeSemanticTokens",async(o,...e)=>{const[t,i]=e;Tt(t instanceof Me),Tt(k.isIRange(i));const n=o.get(ii).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:s}=o.get(Se),r=await QR(s,n,k.lift(i),st.None);if(!(!r||!r.tokens))return _V({id:0,type:"full",data:r.tokens.data})});const JR="editor.semanticHighlighting";function mT(o,e,t){var i;const n=(i=t.getValue(JR,{overrideIdentifier:o.getLanguageId(),resource:o.uri}))===null||i===void 0?void 0:i.enabled;return typeof n=="boolean"?n:e.getColorTheme().semanticHighlighting}var SV=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Na=function(o,e){return function(t,i){e(t,i,o)}},Wd;let _T=class extends K{constructor(e,t,i,n,s,r){super(),this._watchers=Object.create(null);const a=c=>{this._watchers[c.uri.toString()]=new sv(c,e,i,s,r)},l=(c,h)=>{h.dispose(),delete this._watchers[c.uri.toString()]},d=()=>{for(const c of t.getModels()){const h=this._watchers[c.uri.toString()];mT(c,i,n)?h||a(c):h&&l(c,h)}};this._register(t.onModelAdded(c=>{mT(c,i,n)&&a(c)})),this._register(t.onModelRemoved(c=>{const h=this._watchers[c.uri.toString()];h&&l(c,h)})),this._register(n.onDidChangeConfiguration(c=>{c.affectsConfiguration(JR)&&d()})),this._register(i.onDidColorThemeChange(d))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};_T=SV([Na(0,ty),Na(1,ii),Na(2,tn),Na(3,ft),Na(4,Zo),Na(5,Se)],_T);let sv=Wd=class extends K{constructor(e,t,i,n,s){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=s.documentSemanticTokensProvider,this._debounceInformation=n.for(this._provider,"DocumentSemanticTokens",{min:Wd.REQUEST_MIN_DELAY,max:Wd.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new Rt(()=>this._fetchDocumentSemanticTokensNow(),Wd.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 r=()=>{Et(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)}))};r(),this._register(this._provider.onDidChange(()=>{r(),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),Et(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!bV(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new Wi,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,n=CV(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const s=[],r=this._model.onDidChangeContent(l=>{s.push(l)}),a=new Hn(!1);n.then(l=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),!l)this._setDocumentSemanticTokens(null,null,null,s);else{const{provider:d,tokens:c}=l,h=this._semanticTokensStylingService.getStyling(d);this._setDocumentSemanticTokens(d,c||null,h,s)}},l=>{l&&(oa(l)||typeof l.message=="string"&&l.message.indexOf("busy")!==-1)||Ge(l),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),(s.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,i,n,s){s=Math.min(s,i.length-n,e.length-t);for(let r=0;r<s;r++)i[n+r]=e[t+r]}_setDocumentSemanticTokens(e,t,i,n){const s=this._currentDocumentResponse,r=()=>{(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),r();return}if(vV(t)){if(!s){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:s.data};else{let a=0;for(const u of t.edits)a+=(u.data?u.data.length:0)-u.deleteCount;const l=s.data,d=new Uint32Array(l.length+a);let c=l.length,h=d.length;for(let u=t.edits.length-1;u>=0;u--){const g=t.edits[u];if(g.start>l.length){i.warnInvalidEditStart(s.resultId,t.resultId,u,g.start,l.length),this._model.tokenization.setSemanticTokens(null,!0);return}const f=c-(g.start+g.deleteCount);f>0&&(Wd._copy(l,c-f,d,h-f,f),h-=f),g.data&&(Wd._copy(g.data,0,d,h-g.data.length,g.data.length),h-=g.data.length),c=g.start}c>0&&Wd._copy(l,0,d,0,c),t={resultId:t.resultId,data:d}}}if(gL(t)){this._currentDocumentResponse=new J_e(e,t.resultId,t.data);const a=k7(t,i,this._model.getLanguageId());if(n.length>0)for(const l of n)for(const d of a)for(const c of l.changes)d.applyEdit(c.range,c.text);this._model.tokenization.setSemanticTokens(a,!0)}else this._model.tokenization.setSemanticTokens(null,!0);r()}};sv.REQUEST_MIN_DELAY=300;sv.REQUEST_MAX_DELAY=2e3;sv=Wd=SV([Na(1,ty),Na(2,tn),Na(3,Zo),Na(4,Se)],sv);class J_e{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}yy(_T);var e0e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Nm=function(o,e){return function(t,i){e(t,i,o)}};let ov=class extends K{constructor(e,t,i,n,s,r){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=n,this._editor=e,this._provider=r.documentRangeSemanticTokensProvider,this._debounceInformation=s.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new Rt(()=>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(JR)&&(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(!mT(e,this._themeService,this._configurationService)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}if(!Q_e(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=Zi(r=>Promise.resolve(QR(this._provider,e,t,r))),s=new Hn(!1);return n.then(r=>{if(this._debounceInformation.update(e,s.elapsed()),!r||!r.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:a,tokens:l}=r,d=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,k7(l,d,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(n),()=>this._removeOutstandingRequest(n)),n}};ov.ID="editor.contrib.viewportSemanticTokens";ov=e0e([Nm(1,ty),Nm(2,tn),Nm(3,ft),Nm(4,Zo),Nm(5,Se)],ov);yt(ov.ID,ov,1);class t0e{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const n of t){const s=[];i.push(s),this.selectSubwords&&this._addInWordRanges(s,e,n),this._addWordRanges(s,e,n),this._addWhitespaceLine(s,e,n),s.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const n=t.getWordAtPosition(i);if(!n)return;const{word:s,startColumn:r}=n,a=i.column-r;let l=a,d=a,c=0;for(;l>=0;l--){const h=s.charCodeAt(l);if(l!==a&&(h===95||h===45))break;if(Yd(h)&&Da(c))break;c=h}for(l+=1;d<s.length;d++){const h=s.charCodeAt(d);if(Da(h)&&Yd(c))break;if(h===95||h===45)break;c=h}l<d&&e.push({range:new k(i.lineNumber,r+l,i.lineNumber,r+d)})}_addWordRanges(e,t,i){const n=t.getWordAtPosition(i);n&&e.push({range:new k(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 k(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var i0e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},n0e=function(o,e){return function(t,i){e(t,i,o)}},vT;class eA{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 eA(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}let Ep=vT=class{static get(e){return e.getContribution(vT.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){var e;(e=this._selectionListener)===null||e===void 0||e.dispose()}async run(e){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(this._state||await LV(this._languageFeaturesService.selectionRangeProvider,i,t.map(s=>s.getPosition()),this._editor.getOption(112),st.None).then(s=>{var r;if(!(!Bn(s)||s.length!==t.length)&&!(!this._editor.hasModel()||!_i(this._editor.getSelections(),t,(a,l)=>a.equalsSelection(l)))){for(let a=0;a<s.length;a++)s[a]=s[a].filter(l=>l.containsPosition(t[a].getStartPosition())&&l.containsPosition(t[a].getEndPosition())),s[a].unshift(t[a]);this._state=s.map(a=>new eA(0,a)),(r=this._selectionListener)===null||r===void 0||r.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{var a;this._ignoreSelection||((a=this._selectionListener)===null||a===void 0||a.dispose(),this._state=void 0)})}}),!this._state)return;this._state=this._state.map(s=>s.mov(e));const n=this._state.map(s=>xe.fromPositions(s.ranges[s.index].getStartPosition(),s.ranges[s.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(n)}finally{this._ignoreSelection=!1}}};Ep.ID="editor.contrib.smartSelectController";Ep=vT=i0e([n0e(1,Se)],Ep);class yV extends we{constructor(e,t){super(t),this._forward=e}async run(e,t){const i=Ep.get(t);i&&await i.run(this._forward)}}class s0e extends yV{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:p("smartSelect.expand","Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:M.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:N.MenubarSelectionMenu,group:"1_basic",title:p({},"&&Expand Selection"),order:2}})}}gt.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class o0e extends yV{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:p("smartSelect.shrink","Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:M.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:N.MenubarSelectionMenu,group:"1_basic",title:p({},"&&Shrink Selection"),order:3}})}}yt(Ep.ID,Ep,4);de(s0e);de(o0e);async function LV(o,e,t,i,n){const s=o.all(e).concat(new t0e(i.selectSubwords));s.length===1&&s.unshift(new ao);const r=[],a=[];for(const l of s)r.push(Promise.resolve(l.provideSelectionRanges(e,t,n)).then(d=>{if(Bn(d)&&d.length===t.length)for(let c=0;c<t.length;c++){a[c]||(a[c]=[]);for(const h of d[c])k.isIRange(h.range)&&k.containsPosition(h.range,t[c])&&a[c].push(k.lift(h.range))}},Mi));return await Promise.all(r),a.map(l=>{if(l.length===0)return[];l.sort((u,g)=>V.isBefore(u.getStartPosition(),g.getStartPosition())?1:V.isBefore(g.getStartPosition(),u.getStartPosition())||V.isBefore(u.getEndPosition(),g.getEndPosition())?-1:V.isBefore(g.getEndPosition(),u.getEndPosition())?1:0);const d=[];let c;for(const u of l)(!c||k.containsRange(u,c)&&!k.equalsRange(u,c))&&(d.push(u),c=u);if(!i.selectLeadingAndTrailingWhitespace)return d;const h=[d[0]];for(let u=1;u<d.length;u++){const g=d[u-1],f=d[u];if(f.startLineNumber!==g.startLineNumber||f.endLineNumber!==g.endLineNumber){const m=new k(g.startLineNumber,e.getLineFirstNonWhitespaceColumn(g.startLineNumber),g.endLineNumber,e.getLineLastNonWhitespaceColumn(g.endLineNumber));m.containsRange(g)&&!m.equalsRange(g)&&f.containsRange(m)&&!f.equalsRange(m)&&h.push(m);const _=new k(g.startLineNumber,1,g.endLineNumber,e.getLineMaxColumn(g.endLineNumber));_.containsRange(g)&&!_.equalsRange(m)&&f.containsRange(_)&&!f.equalsRange(_)&&h.push(_)}h.push(f)}return h})}gt.registerCommand("_executeSelectionRangeProvider",async function(o,...e){const[t,i]=e;Tt(Me.isUri(t));const n=o.get(Se).selectionRangeProvider,s=await o.get(ks).createModelReference(t);try{return LV(n,s.object.textEditorModel,i,{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},st.None)}finally{s.dispose()}});const r0e=Object.freeze({View:{value:p("view","View"),original:"View"},Help:{value:p("help","Help"),original:"Help"},Test:{value:p("test","Test"),original:"Test"},File:{value:p("file","File"),original:"File"},Preferences:{value:p("preferences","Preferences"),original:"Preferences"},Developer:{value:p({},"Developer"),original:"Developer"}});class i3{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&&_i(this.startLineNumbers,e.startLineNumbers)&&_i(this.endLineNumbers,e.endLineNumbers)}}const n3=vd("stickyScrollViewLayer",{createHTML:o=>o}),LD="data-sticky-line-index",s3="data-sticky-is-line",a0e="data-sticky-is-line-number",o3="data-sticky-is-folding-icon";class l0e extends K{constructor(e){super(),this._editor=e,this._foldingIconStore=new se,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(66),this._stickyLines=[],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 Gc),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(114).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(114)&&t(),i.hasChanged(66)&&(this._lineHeight=this._editor.getOption(66))})),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}getStickyLineForLine(e){return this._stickyLines.find(t=>t.lineNumber===e)}getCurrentLines(){return this._lineNumbers}setState(e,t,i=1/0){if((!this._previousState&&!e||this._previousState&&this._previousState.equals(e))&&i===1/0)return;this._previousState=e;const n=this._stickyLines;if(this._clearStickyWidget(),!e||!this._editor._getViewModel())return;if(e.startLineNumbers.length*this._lineHeight+e.lastLineRelativePosition>0){this._lastLineRelativePosition=e.lastLineRelativePosition;const r=[...e.startLineNumbers];e.showEndForLine!==null&&(r[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=r}else this._lastLineRelativePosition=0,this._lineNumbers=[];this._renderRootNode(n,t,i)}_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`}_clearStickyWidget(){this._stickyLines=[],this._foldingIconStore.clear(),bn(this._lineNumbersDomNode),bn(this._linesDomNode),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._stickyLines){const i=t.foldingIcon;i&&i.setVisible(e?!0:i.isCollapsed)}}async _renderRootNode(e,t,i=1/0){const n=this._editor.getLayoutInfo();for(const[r,a]of this._lineNumbers.entries()){const l=e[r],d=a>=i||l?.lineNumber!==a?this._renderChildNode(r,a,t,n):this._updateTopAndZIndexOfStickyLine(l);d&&(this._linesDomNode.appendChild(d.lineDomNode),this._lineNumbersDomNode.appendChild(d.lineNumberDomNode),this._stickyLines.push(d))}t&&(this._setFoldingHoverListeners(),this._useFoldingOpacityTransition(!this._isOnGlyphMargin));const s=this._lineNumbers.length*this._lineHeight+this._lastLineRelativePosition;if(s===0){this._clearStickyWidget();return}this._rootDomNode.style.display="block",this._lineNumbersDomNode.style.height=`${s}px`,this._linesDomNodeScrollable.style.height=`${s}px`,this._rootDomNode.style.height=`${s}px`,this._rootDomNode.style.marginLeft="0px",this._updateMinContentWidth(),this._editor.layoutOverlayWidget(this)}_setFoldingHoverListeners(){this._editor.getOption(109)==="mouseover"&&(this._foldingIconStore.add(Q(this._lineNumbersDomNode,ge.MOUSE_ENTER,t=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(Q(this._lineNumbersDomNode,ge.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,i,n){const s=this._editor._getViewModel();if(!s)return;const r=s.coordinatesConverter.convertModelPositionToViewPosition(new V(t,1)).lineNumber,a=s.getViewLineRenderingData(r),l=this._editor.getOption(67);let d;try{d=Ws.filter(a.inlineDecorations,r,a.minColumn,a.maxColumn)}catch{d=[]}const c=new rh(!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),h=new Op(2e3),u=mv(c,h);let g;n3?g=n3.createHTML(h.build()):g=h.build();const f=document.createElement("span");f.setAttribute(LD,String(e)),f.setAttribute(s3,""),f.setAttribute("role","listitem"),f.tabIndex=0,f.className="sticky-line-content",f.classList.add(`stickyLine${t}`),f.style.lineHeight=`${this._lineHeight}px`,f.innerHTML=g;const m=document.createElement("span");m.setAttribute(LD,String(e)),m.setAttribute(a0e,""),m.className="sticky-line-number",m.style.lineHeight=`${this._lineHeight}px`;const _=n.contentLeft;m.style.width=`${_}px`;const v=document.createElement("span");l.renderType===1||l.renderType===3&&t%10===0?v.innerText=t.toString():l.renderType===2&&(v.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),v.className="sticky-line-number-inner",v.style.lineHeight=`${this._lineHeight}px`,v.style.width=`${n.lineNumbersWidth}px`,v.style.paddingLeft=`${n.lineNumbersLeft}px`,m.appendChild(v);const b=this._renderFoldingIconForLine(i,t);b&&m.appendChild(b.domNode),this._editor.applyFontInfo(f),this._editor.applyFontInfo(v),m.style.lineHeight=`${this._lineHeight}px`,f.style.lineHeight=`${this._lineHeight}px`,m.style.height=`${this._lineHeight}px`,f.style.height=`${this._lineHeight}px`;const C=new d0e(e,t,f,m,b,u.characterMapping);return this._updateTopAndZIndexOfStickyLine(C)}_updateTopAndZIndexOfStickyLine(e){var t;const i=e.index,n=e.lineDomNode,s=e.lineNumberDomNode,r=i===this._lineNumbers.length-1,a="0",l="1";n.style.zIndex=r?a:l,s.style.zIndex=r?a:l;const d=`${i*this._lineHeight+this._lastLineRelativePosition+(!((t=e.foldingIcon)===null||t===void 0)&&t.isCollapsed?1:0)}px`,c=`${i*this._lineHeight}px`;return n.style.top=r?d:c,s.style.top=r?d:c,e}_renderFoldingIconForLine(e,t){const i=this._editor.getOption(109);if(!e||i==="never")return;const n=e.regions,s=n.findRange(t),r=n.getStartLineNumber(s);if(!(t===r))return;const l=n.isCollapsed(s),d=new c0e(l,r,n.getEndLineNumber(s),this._lineHeight);return d.setVisible(this._isOnGlyphMargin?!0:l||i==="always"),d.domNode.setAttribute(o3,""),d}_updateMinContentWidth(){this._minContentWidthInPx=0;for(const e of this._stickyLines)e.lineDomNode.scrollWidth>this._minContentWidthInPx&&(this._minContentWidthInPx=e.lineDomNode.scrollWidth);this._minContentWidthInPx+=this._editor.getLayoutInfo().verticalScrollbarWidth}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:null}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e<this._stickyLines.length&&this._stickyLines[e].lineDomNode.focus()}getEditorPositionFromNode(e){if(!e||e.children.length>0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const i=z2(t.characterMapping,e,0);return new V(t.lineNumber,i)}getLineNumberFromChildDomNode(e){var t,i;return(i=(t=this._getRenderedStickyLineFromChildDomNode(e))===null||t===void 0?void 0:t.lineNumber)!==null&&i!==void 0?i:null}_getRenderedStickyLineFromChildDomNode(e){const t=this.getLineIndexFromChildDomNode(e);return t===null||t<0||t>=this._stickyLines.length?null:this._stickyLines[t]}getLineIndexFromChildDomNode(e){const t=this._getAttributeValue(e,LD);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,s3)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,o3)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const i=e.getAttribute(t);if(i!==null)return i;e=e.parentElement}}}class d0e{constructor(e,t,i,n,s,r){this.index=e,this.lineNumber=t,this.lineDomNode=i,this.lineNumberDomNode=n,this.foldingIcon=s,this.characterMapping=r}}class c0e{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=Re.asClassName(e?Zy:Gy)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class N_{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class rS{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}}class xV{constructor(e,t,i,n){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=n}}var fL=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},rv=function(o,e){return function(t,i){e(t,i,o)}},T_;(function(o){o.OUTLINE_MODEL="outlineModel",o.FOLDING_PROVIDER_MODEL="foldingProviderModel",o.INDENTATION_MODEL="indentationModel"})(T_||(T_={}));var dc;(function(o){o[o.VALID=0]="VALID",o[o.INVALID=1]="INVALID",o[o.CANCELED=2]="CANCELED"})(dc||(dc={}));let bT=class extends K{constructor(e,t,i,n){super(),this._editor=e,this._languageConfigurationService=t,this._languageFeaturesService=i,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new vr(300)),this._updateOperation=this._register(new se);const s=new CT(i),r=new ST(this._editor,i),a=new wT(this._editor,t);switch(n){case T_.OUTLINE_MODEL:this._modelProviders.push(s),this._modelProviders.push(r),this._modelProviders.push(a);break;case T_.FOLDING_PROVIDER_MODEL:this._modelProviders.push(r),this._modelProviders.push(a);break;case T_.INDENTATION_MODEL:this._modelProviders.push(a);break}}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}async update(e,t,i){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),await this._updateScheduler.trigger(async()=>{for(const n of this._modelProviders){const{statusPromise:s,modelPromise:r}=n.computeStickyModel(e,t,i);this._modelPromise=r;const a=await s;if(this._modelPromise!==r)return null;switch(a){case dc.CANCELED:return this._updateOperation.clear(),null;case dc.VALID:return n.stickyModel}}return null}).catch(n=>(Ge(n),null))}};bT=fL([rv(1,Wt),rv(2,Se)],bT);class DV{constructor(){this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,dc.INVALID}computeStickyModel(e,t,i){if(i.isCancellationRequested||!this.isProviderValid(e))return{statusPromise:this._invalid(),modelPromise:null};const n=Zi(s=>this.createModelFromProvider(e,t,s));return{statusPromise:n.then(s=>this.isModelValid(s)?i.isCancellationRequested?dc.CANCELED:(this._stickyModel=this.createStickyModel(e,t,i,s),dc.VALID):this._invalid()).then(void 0,s=>(Ge(s),dc.CANCELED)),modelPromise:n}}isModelValid(e){return!0}isProviderValid(e){return!0}}let CT=class extends DV{constructor(e){super(),this._languageFeaturesService=e}createModelFromProvider(e,t,i){return zl.create(this._languageFeaturesService.documentSymbolProvider,e,i)}createStickyModel(e,t,i,n){var s;const{stickyOutlineElement:r,providerID:a}=this._stickyModelFromOutlineModel(n,(s=this._stickyModel)===null||s===void 0?void 0:s.outlineProviderId);return new xV(e.uri,t,r,a)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(rt.first(e.children.values())instanceof YW){const a=rt.find(e.children.values(),l=>l.id===t);if(a)i=a.children;else{let l="",d=-1,c;for(const[h,u]of e.children.entries()){const g=this._findSumOfRangesOfGroup(u);g>d&&(c=u,d=g,l=u.id)}t=l,i=c.children}}else i=e.children;const n=[],s=Array.from(i.values()).sort((a,l)=>{const d=new N_(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),c=new N_(l.symbol.range.startLineNumber,l.symbol.range.endLineNumber);return this._comparator(d,c)});for(const a of s)n.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new rS(void 0,n,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const i=[];for(const s of e.children.values())if(s.symbol.selectionRange.startLineNumber!==s.symbol.range.endLineNumber)if(s.symbol.selectionRange.startLineNumber!==t)i.push(this._stickyModelFromOutlineElement(s,s.symbol.selectionRange.startLineNumber));else for(const r of s.children.values())i.push(this._stickyModelFromOutlineElement(r,s.symbol.selectionRange.startLineNumber));i.sort((s,r)=>this._comparator(s.range,r.range));const n=new N_(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new rS(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 zN?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};CT=fL([rv(0,Se)],CT);class kV extends DV{constructor(e){super(),this._foldingLimitReporter=new qW(e)}createStickyModel(e,t,i,n){const s=this._fromFoldingRegions(n);return new xV(e.uri,t,s,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,i=[],n=new rS(void 0,[],void 0);for(let s=0;s<t;s++){const r=e.getParentIndex(s);let a;r!==-1?a=i[r]:a=n;const l=new rS(new N_(e.getStartLineNumber(s),e.getEndLineNumber(s)+1),[],a);a.children.push(l),i.push(l)}return n}}let wT=class extends kV{constructor(e,t){super(e),this._languageConfigurationService=t}createModelFromProvider(e,t,i){return new FR(e,this._languageConfigurationService,this._foldingLimitReporter).compute(i)}};wT=fL([rv(1,Wt)],wT);let ST=class extends kV{constructor(e,t){super(e),this._languageFeaturesService=t}isProviderValid(e){return _l.getFoldingRangeProviders(this._languageFeaturesService,e).length>0}createModelFromProvider(e,t,i){const n=_l.getFoldingRangeProviders(this._languageFeaturesService,e);return new WR(e,n,()=>this.createModelFromProvider(e,t,i),this._foldingLimitReporter,void 0).compute(i)}};ST=fL([rv(1,Se)],ST);var h0e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},r3=function(o,e){return function(t,i){e(t,i,o)}};class u0e{constructor(e,t,i){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=i}}let yT=class extends K{constructor(e,t,i){super(),this._languageFeaturesService=t,this._languageConfigurationService=i,this._onDidChangeStickyScroll=this._register(new W),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._options=null,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new se),this._updateSoon=this._register(new Rt(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(114)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._stickyModelProvider=null,this._sessionStore.clear(),this._options=this._editor.getOption(114),this._options.enabled&&(this._stickyModelProvider=this._sessionStore.add(new bT(this._editor,this._languageConfigurationService,this._languageFeaturesService,this._options.defaultModel)),this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,this._onDidChangeStickyScroll.fire(),this.update()})),this._sessionStore.add(this._editor.onDidChangeHiddenAreas(()=>this.update())),this._sessionStore.add(this._editor.onDidChangeModelContent(()=>this._updateSoon.schedule())),this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>this.update())),this.update())}getVersionId(){var e;return(e=this._model)===null||e===void 0?void 0:e.version}async update(){var e;(e=this._cts)===null||e===void 0||e.dispose(!0),this._cts=new Wi,await this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()}async updateStickyModel(e){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization()){this._model=null;return}const t=this._editor.getModel(),i=t.getVersionId(),n=await this._stickyModelProvider.update(t,i,e);e.isCancellationRequested||(this._model=n)}updateIndex(e){return e===-1?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,t,i,n,s){if(t.children.length===0)return;let r=s;const a=[];for(let c=0;c<t.children.length;c++){const h=t.children[c];h.range&&a.push(h.range.startLineNumber)}const l=this.updateIndex(M_(a,e.startLineNumber,(c,h)=>c-h)),d=this.updateIndex(M_(a,e.startLineNumber+n,(c,h)=>c-h));for(let c=l;c<=d;c++){const h=t.children[c];if(!h)return;if(h.range){const u=h.range.startLineNumber,g=h.range.endLineNumber;e.startLineNumber<=g+1&&u-1<=e.endLineNumber&&u!==r&&(r=u,i.push(new u0e(u,g-1,n+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,h,i,n+1,u))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,h,i,n,s)}}getCandidateStickyLinesIntersecting(e){var t,i;if(!(!((t=this._model)===null||t===void 0)&&t.element))return[];let n=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,n,0,-1);const s=(i=this._editor._getViewModel())===null||i===void 0?void 0:i.getHiddenAreas();if(s)for(const r of s)n=n.filter(a=>!(a.startLineNumber>=r.startLineNumber&&a.endLineNumber<=r.endLineNumber+1));return n}};yT=h0e([r3(1,Se),r3(2,Wt)],yT);var g0e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Ag=function(o,e){return function(t,i){e(t,i,o)}},LT;let vl=LT=class extends K{constructor(e,t,i,n,s,r,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=i,this._instaService=n,this._contextKeyService=a,this._sessionStore=new se,this._foldingModel=null,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._showEndForLine=null,this._stickyScrollWidget=new l0e(this._editor),this._stickyLineCandidateProvider=new yT(this._editor,i,s),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=new i3([],[],0),this._readConfiguration();const l=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration(c=>{(c.hasChanged(114)||c.hasChanged(72)||c.hasChanged(66)||c.hasChanged(109))&&this._readConfiguration()})),this._register(Q(l,ge.CONTEXT_MENU,async c=>{this._onContextMenu(Ue(l),c)})),this._stickyScrollFocusedContextKey=M.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=M.stickyScrollVisible.bindTo(this._contextKeyService);const d=this._register(dl(l));this._register(d.onDidBlur(c=>{this._positionRevealed===!1&&l.clientHeight===0?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()})),this._register(d.onDidFocus(c=>{this.focus()})),this._registerMouseListeners(),this._register(Q(l,ge.MOUSE_DOWN,c=>{this._onMouseDown=!0}))}static get(e){return e.getContribution(LT.ID)}_disposeFocusStickyScrollStore(){var e;this._stickyScrollFocusedContextKey.set(!1),(e=this._focusDisposableStore)===null||e===void 0||e.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}focus(){if(this._onMouseDown){this._onMouseDown=!1,this._editor.focus();return}this._stickyScrollFocusedContextKey.get()!==!0&&(this._focused=!0,this._focusDisposableStore=new se,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(k.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new se),t=this._register(new Ry(this._editor,{extractLineNumberFromMouseEvent:s=>{const r=this._stickyScrollWidget.getEditorPositionFromNode(s.target.element);return r?r.lineNumber:0}})),i=s=>{if(!this._editor.hasModel()||s.target.type!==12||s.target.detail!==this._stickyScrollWidget.getId())return null;const r=s.target.element;if(!r||r.innerText!==r.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(r);return a?{range:new k(a.lineNumber,a.column,a.lineNumber,a.column+r.innerText.length),textElement:r}:null},n=this._stickyScrollWidget.getDomNode();this._register(vi(n,ge.CLICK,s=>{if(s.ctrlKey||s.altKey||s.metaKey||!s.leftButton)return;if(s.shiftKey){const d=this._stickyScrollWidget.getLineIndexFromChildDomNode(s.target);if(d===null)return;const c=new V(this._endLineNumbers[d],1);this._revealLineInCenterIfOutsideViewport(c);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(s.target)){const d=this._stickyScrollWidget.getLineNumberFromChildDomNode(s.target);this._toggleFoldingRegionForLine(d);return}if(!this._stickyScrollWidget.isInStickyLine(s.target))return;let l=this._stickyScrollWidget.getEditorPositionFromNode(s.target);if(!l){const d=this._stickyScrollWidget.getLineNumberFromChildDomNode(s.target);if(d===null)return;l=new V(d,1)}this._revealPosition(l)})),this._register(vi(n,ge.MOUSE_MOVE,s=>{if(s.shiftKey){const r=this._stickyScrollWidget.getLineIndexFromChildDomNode(s.target);if(r===null||this._showEndForLine!==null&&this._showEndForLine===r)return;this._showEndForLine=r,this._renderStickyScroll();return}this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(Q(n,ge.MOUSE_LEAVE,s=>{this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([s,r])=>{const a=i(s);if(!a||!s.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 c=new Wi;e.add(Ae(()=>c.dispose(!0)));let h;Wy(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new V(l.startLineNumber,l.startColumn+1),c.token).then(u=>{if(!c.token.isCancellationRequested)if(u.length!==0){this._candidateDefinitionsLength=u.length;const g=d;h!==g?(e.clear(),h=g,h.style.textDecoration="underline",e.add(Ae(()=>{h.style.textDecoration="none"}))):h||(h=g,h.style.textDecoration="underline",e.add(Ae(()=>{h.style.textDecoration="none"})))}else e.clear()})})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(async s=>{if(s.target.type!==12||s.target.detail!==this._stickyScrollWidget.getId())return;const r=this._stickyScrollWidget.getEditorPositionFromNode(s.target.element);r&&(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:r.lineNumber,column:1})),this._instaService.invokeFunction(sV,s,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor}))}))}_onContextMenu(e,t){const i=new lr(e,t);this._contextMenuService.showContextMenu({menuId:N.StickyScrollContext,getAnchor:()=>i})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getStickyLineForLine(e),i=t?.foldingIcon;if(!i)return;zW(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(66)*t.index+1;this._editor.setScrollTop(n),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(114);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=null,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=null,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(67).renderType===2&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=null,this._renderStickyScroll(-1)}))}_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(-1)}_onDidResize(){const t=this._editor.getLayoutInfo().height/this._editor.getOption(66);this._maxStickyLines=Math.round(t*.25)}async _renderStickyScroll(e=1/0){var t,i;const n=this._editor.getModel();if(!n||n.isTooLargeForTokenization()){this._foldingModel=null,this._stickyScrollWidget.setState(void 0,null,e);return}const s=this._stickyLineCandidateProvider.getVersionId();if(s===void 0||s===n.getVersionId())if(this._foldingModel=(i=await((t=_l.get(this._editor))===null||t===void 0?void 0:t.getFoldingModel()))!==null&&i!==void 0?i:null,this._widgetState=this.findScrollWidgetState(),this._stickyScrollVisibleContextKey.set(this._widgetState.startLineNumbers.length!==0),!this._focused)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e);else if(this._focusedStickyElementIndex===-1)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const r=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(r)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}}findScrollWidgetState(){const e=this._editor.getOption(66),t=Math.min(this._maxStickyLines,this._editor.getOption(114).maxLineCount),i=this._editor.getScrollTop();let n=0;const s=[],r=[],a=this._editor.getVisibleRanges();if(a.length!==0){const l=new N_(a[0].startLineNumber,a[a.length-1].endLineNumber),d=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(l);for(const c of d){const h=c.startLineNumber,u=c.endLineNumber,g=c.nestingDepth;if(u-h>0){const f=(g-1)*e,m=g*e,_=this._editor.getBottomForLineNumber(h)-i,v=this._editor.getTopForLineNumber(u)-i,b=this._editor.getBottomForLineNumber(u)-i;if(f>v&&f<=b){s.push(h),r.push(u+1),n=b-m;break}else m>_&&m<=b&&(s.push(h),r.push(u+1));if(s.length===t)break}}}return this._endLineNumbers=r,new i3(s,r,n,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}};vl.ID="store.contrib.stickyScrollController";vl=LT=g0e([Ag(1,Yo),Ag(2,Se),Ag(3,Oe),Ag(4,Wt),Ag(5,Zo),Ag(6,We)],vl);class f0e extends ko{constructor(){super({id:"editor.action.toggleStickyScroll",title:{value:p("toggleStickyScroll","Toggle Sticky Scroll"),mnemonicTitle:p({},"&&Toggle Sticky Scroll"),original:"Toggle Sticky Scroll"},category:r0e.View,toggled:{condition:te.equals("config.editor.stickyScroll.enabled",!0),title:p("stickyScroll","Sticky Scroll"),mnemonicTitle:p({},"&&Sticky Scroll")},menu:[{id:N.CommandPalette},{id:N.MenubarAppearanceMenu,group:"4_editor",order:3},{id:N.StickyScrollContext}]})}async run(e){const t=e.get(ft),i=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",i)}}const pL=100;class p0e extends aa{constructor(){super({id:"editor.action.focusStickyScroll",title:{value:p("focusStickyScroll","Focus Sticky Scroll"),mnemonicTitle:p({},"&&Focus Sticky Scroll"),original:"Focus Sticky Scroll"},precondition:te.and(te.has("config.editor.stickyScroll.enabled"),M.stickyScrollVisible),menu:[{id:N.CommandPalette}]})}runEditorCommand(e,t){var i;(i=vl.get(t))===null||i===void 0||i.focus()}}class m0e extends aa{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:{value:p("selectNextStickyScrollLine.title","Select next sticky scroll line"),original:"Select next sticky scroll line"},precondition:M.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:pL,primary:18}})}runEditorCommand(e,t){var i;(i=vl.get(t))===null||i===void 0||i.focusNext()}}class _0e extends aa{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:{value:p("selectPreviousStickyScrollLine.title","Select previous sticky scroll line"),original:"Select previous sticky scroll line"},precondition:M.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:pL,primary:16}})}runEditorCommand(e,t){var i;(i=vl.get(t))===null||i===void 0||i.focusPrevious()}}class v0e extends aa{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:{value:p("goToFocusedStickyScrollLine.title","Go to focused sticky scroll line"),original:"Go to focused sticky scroll line"},precondition:M.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:pL,primary:3}})}runEditorCommand(e,t){var i;(i=vl.get(t))===null||i===void 0||i.goToFocused()}}class b0e extends aa{constructor(){super({id:"editor.action.selectEditor",title:{value:p("selectEditor.title","Select Editor"),original:"Select Editor"},precondition:M.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:pL,primary:9}})}runEditorCommand(e,t){var i;(i=vl.get(t))===null||i===void 0||i.selectEditor()}}yt(vl.ID,vl,1);Xt(f0e);Xt(p0e);Xt(_0e);Xt(m0e);Xt(v0e);Xt(b0e);var tA=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},mu=function(o,e){return function(t,i){e(t,i,o)}},Bh;class C0e{constructor(e,t,i,n,s,r){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=n,this.command=s,this.completion=r}}let xT=class extends bz{constructor(e,t,i,n,s,r){super(s.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=n,this._suggestMemoryService=r}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(){var e;const t=[],{items:i}=this.completionModel,n=this._suggestMemoryService.select(this.model,{lineNumber:this.line,column:this.word.endColumn+this.completionModel.lineContext.characterCountDelta},i),s=rt.slice(i,n),r=rt.slice(i,0,n);let a=5;for(const l of rt.concat(s,r)){if(l.score===Xr.Default)continue;const d=new k(l.editStart.lineNumber,l.editStart.column,l.editInsertEnd.lineNumber,l.editInsertEnd.column+this.completionModel.lineContext.characterCountDelta),c=l.completion.insertTextRules&&l.completion.insertTextRules&4?{snippet:l.completion.insertText}:l.completion.insertText;t.push(new C0e(d,c,(e=l.filterTextLow)!==null&&e!==void 0?e:l.labelLow,l.completion.additionalTextEdits,l.completion.command,l)),a-->=0&&l.resolve(st.None)}return t}};xT=tA([mu(5,Qy)],xT);let DT=class{constructor(e,t,i,n){this._getEditorOption=e,this._languageFeatureService=t,this._clipboardService=i,this._suggestMemoryService=n}async provideInlineCompletions(e,t,i,n){var s;if(i.selectedSuggestionInfo)return;const r=this._getEditorOption(88,e);if(ff.isAllOff(r))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(ff.valueFor(r,l)!=="inline")return;let d=e.getWordAtPosition(t),c;if(d?.word||(c=this._getTriggerCharacterInfo(e,t)),!d?.word&&!c||(d||(d=e.getWordUntilPosition(t)),d.endColumn!==t.column))return;let h;const u=e.getValueInRange(new k(t.lineNumber,1,t.lineNumber,t.column));if(!c&&(!((s=this._lastResult)===null||s===void 0)&&s.canBeReused(e,t.lineNumber,d))){const g=new X5(u,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=g,this._lastResult.acquire(),h=this._lastResult}else{const g=await HR(this._languageFeatureService.completionProvider,e,t,new G0(void 0,void 0,c?.providers),c&&{triggerKind:1,triggerCharacter:c.ch},n);let f;g.needsClipboard&&(f=await this._clipboardService.readText());const m=new Gd(g.items,t.column,new X5(u,0),zr.None,this._getEditorOption(117,e),this._getEditorOption(111,e),{boostFullMatch:!1,firstMatchCanBeWeak:!1},f);h=new xT(e,t.lineNumber,d,m,g,this._suggestMemoryService)}return this._lastResult=h,h}handleItemDidShow(e,t){t.completion.resolve(st.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var i;const n=e.getValueInRange(k.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),s=new Set;for(const r of this._languageFeatureService.completionProvider.all(e))!((i=r.triggerCharacters)===null||i===void 0)&&i.includes(n)&&s.add(r);if(s.size!==0)return{providers:s,ch:n}}};DT=tA([mu(1,Se),mu(2,Sd),mu(3,Qy)],DT);let aS=Bh=class{constructor(e,t,i,n){if(++Bh._counter===1){const s=n.createInstance(DT,(r,a)=>{var l;return((l=i.listCodeEditors().find(c=>c.getModel()===a))!==null&&l!==void 0?l:e).getOption(r)});Bh._disposable=t.inlineCompletionsProvider.register("*",s)}}dispose(){var e;--Bh._counter===0&&((e=Bh._disposable)===null||e===void 0||e.dispose(),Bh._disposable=void 0)}};aS._counter=0;aS=Bh=tA([mu(1,Se),mu(2,Dt),mu(3,Oe)],aS);yt("suggest.inlineCompletionsProvider",aS,0);class w0e extends we{constructor(){super({id:"editor.action.forceRetokenize",label:p("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 Hn;i.tokenization.forceTokenization(i.getLineCount()),n.stop(),console.log(`tokenization took ${n.elapsed()}`)}}de(w0e);class mL extends ko{constructor(){super({id:mL.ID,title:{value:p({},"Toggle Tab Key Moves Focus"),original:"Toggle Tab Key Moves Focus"},precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},f1:!0})}run(){const t=!Jf.getTabFocusMode();Jf.setTabFocusMode(t),js(t?p("toggle.tabMovesFocus.on","Pressing Tab will now move focus to the next focusable element"):p("toggle.tabMovesFocus.off","Pressing Tab will now insert the tab character"))}}mL.ID="editor.action.toggleTabFocusMode";Xt(mL);var S0e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},y0e=function(o,e){return function(t,i){e(t,i,o)}};let kT=class extends K{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){var s;super(),this._link=t,this._enabled=!0,this.el=ie(e,pe("a.monaco-link",{tabIndex:(s=t.tabIndex)!==null&&s!==void 0?s:0,href:t.href,title:t.title},t.label)),this.el.setAttribute("role","button");const r=this._register(new at(this.el,"click")),a=this._register(new at(this.el,"keypress")),l=fe.chain(a.event,h=>h.map(u=>new Gt(u)).filter(u=>u.keyCode===3)),d=this._register(new at(this.el,Bt.Tap)).event;this._register(Ot.addTarget(this.el));const c=fe.any(r.event,l,d);this._register(c(h=>{this.enabled&&(Je.stop(h,!0),i?.opener?i.opener(this._link.href):n.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}};kT=S0e([y0e(3,Qs)],kT);var IV=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},EV=function(o,e){return function(t,i){e(t,i,o)}};const L0e=26;let IT=class extends K{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(ET))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show({...e,onClose:()=>{var t;this.hide(),(t=e.onClose)===null||t===void 0||t.call(e)}}),this._editor.setBanner(this.banner.element,L0e)}};IT=IV([EV(1,Oe)],IT);let ET=class extends K{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(pd,{}),this.element=pe("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=pe("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){bn(this.element)}show(e){bn(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=ie(this.element,pe("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(pe(`div${Re.asCSSSelector(e.icon)}`));const n=ie(this.element,pe("div.message-container"));if(n.setAttribute("aria-hidden","true"),n.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=ie(this.element,pe("div.message-actions-container")),e.actions)for(const r of e.actions)this._register(this.instantiationService.createInstance(kT,this.messageActionsContainer,{...r,tabIndex:-1},{}));const s=ie(this.element,pe("div.action-container"));this.actionBar=this._register(new Go(s)),this.actionBar.push(this._register(new cs("banner.close","Close Banner",Re.asClassName(PB),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};ET=IV([EV(0,Oe)],ET);var iA=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},zf=function(o,e){return function(t,i){e(t,i,o)}};const x0e=Di("extensions-warning-message",he.warning,p("warningIcon","Icon shown with a warning message in the extensions editor."));let Np=class extends K{constructor(e,t,i,n){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=i,this._highlighter=null,this._bannerClosed=!1,this._updateState=s=>{if(s&&s.hasMore){if(this._bannerClosed)return;const r=Math.max(s.ambiguousCharacterCount,s.nonBasicAsciiCharacterCount,s.invisibleCharacterCount);let a;if(s.nonBasicAsciiCharacterCount>=r)a={message:p("unicodeHighlighting.thisDocumentHasManyNonBasicAsciiUnicodeCharacters","This document contains many non-basic ASCII unicode characters"),command:new em};else if(s.ambiguousCharacterCount>=r)a={message:p("unicodeHighlighting.thisDocumentHasManyAmbiguousUnicodeCharacters","This document contains many ambiguous unicode characters"),command:new gh};else if(s.invisibleCharacterCount>=r)a={message:p("unicodeHighlighting.thisDocumentHasManyInvisibleUnicodeCharacters","This document contains many invisible unicode characters"),command:new Jp};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:x0e,actions:[{label:a.command.shortLabel,href:`command:${a.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(n.createInstance(IT,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(124),this._register(i.onDidChangeTrust(s=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(s=>{s.hasChanged(124)&&(this._options=e.getOption(124),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=D0e(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"?wH:i)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new NT(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new k0e(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}};Np.ID="editor.contrib.unicodeHighlighter";Np=iA([zf(1,Lr),zf(2,P7),zf(3,Oe)],Np);function D0e(o,e){return{nonBasicASCII:e.nonBasicASCII===so?!o:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===so?!o:e.includeComments,includeStrings:e.includeStrings===so?!o:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let NT=class extends K{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 Rt(()=>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:lS.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!lM(t,e))return null;const i=t.getValueInRange(e.range);return{reason:NV(i,this._options),inComment:dM(t,e),inString:cM(t,e)}}};NT=iA([zf(3,Lr)],NT);class k0e extends K{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 Rt(()=>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 s=S2.computeUnicodeHighlights(this._model,this._options,n);for(const r of s.ranges)i.ranges.push(r);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||s.hasMore}if(!i.hasMore)for(const n of i.ranges)t.push({range:n,options:lS.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 lM(t,e)?{reason:NV(i,this._options),inComment:dM(t,e),inString:cM(t,e)}:null}}let TT=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(Np.ID);if(!n)return[];const s=[],r=new Set;let a=300;for(const l of t){const d=n.getDecorationInfo(l);if(!d)continue;const h=i.getValueInRange(l.range).codePointAt(0),u=xD(h);let g;switch(d.reason.kind){case 0:{uv(d.reason.confusableWith)?g=p("unicodeHighlight.characterIsAmbiguousASCII","The character {0} could be confused with the ASCII character {1}, which is more common in source code.",u,xD(d.reason.confusableWith.codePointAt(0))):g=p("unicodeHighlight.characterIsAmbiguous","The character {0} could be confused with the character {1}, which is more common in source code.",u,xD(d.reason.confusableWith.codePointAt(0)));break}case 1:g=p("unicodeHighlight.characterIsInvisible","The character {0} is invisible.",u);break;case 2:g=p("unicodeHighlight.characterIsNonBasicAscii","The character {0} is not a basic ASCII character.",u);break}if(r.has(g))continue;r.add(g);const f={codePoint:h,reason:d.reason,inComment:d.inComment,inString:d.inString},m=p("unicodeHighlight.adjustSettings","Adjust settings"),_=`command:${Yv.ID}?${encodeURIComponent(JSON.stringify(f))}`,v=new Fn("",!0).appendMarkdown(g).appendText(" ").appendLink(_,m);s.push(new Kr(this,l.range,[v],!1,a++))}return s}renderHoverParts(e,t){return dW(e,t,this._editor,this._languageService,this._openerService)}};TT=iA([zf(1,ni),zf(2,Qs)],TT);function MT(o){return`U+${o.toString(16).padStart(4,"0")}`}function xD(o){let e=`\`${MT(o)}\``;return tl.isInvisibleCharacter(o)||(e+=` "${`${I0e(o)}`}"`),e}function I0e(o){return o===96?"`` ` ``":"`"+String.fromCodePoint(o)+"`"}function NV(o,e){return S2.computeUnicodeHighlightReason(o,e)}class lS{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=Ze.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}}lS.instance=new lS;class E0e extends we{constructor(){super({id:gh.ID,label:p("action.unicodeHighlight.disableHighlightingInComments","Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=p("unicodeHighlight.disableHighlightingInComments.shortLabel","Disable Highlight In Comments")}async run(e,t,i){const n=e?.get(ft);n&&this.runAction(n)}async runAction(e){await e.updateValue(Cs.includeComments,!1,2)}}class N0e extends we{constructor(){super({id:gh.ID,label:p("action.unicodeHighlight.disableHighlightingInStrings","Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=p("unicodeHighlight.disableHighlightingInStrings.shortLabel","Disable Highlight In Strings")}async run(e,t,i){const n=e?.get(ft);n&&this.runAction(n)}async runAction(e){await e.updateValue(Cs.includeStrings,!1,2)}}class gh extends we{constructor(){super({id:gh.ID,label:p("action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters","Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=p("unicodeHighlight.disableHighlightingOfAmbiguousCharacters.shortLabel","Disable Ambiguous Highlight")}async run(e,t,i){const n=e?.get(ft);n&&this.runAction(n)}async runAction(e){await e.updateValue(Cs.ambiguousCharacters,!1,2)}}gh.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";class Jp extends we{constructor(){super({id:Jp.ID,label:p("action.unicodeHighlight.disableHighlightingOfInvisibleCharacters","Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=p("unicodeHighlight.disableHighlightingOfInvisibleCharacters.shortLabel","Disable Invisible Highlight")}async run(e,t,i){const n=e?.get(ft);n&&this.runAction(n)}async runAction(e){await e.updateValue(Cs.invisibleCharacters,!1,2)}}Jp.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";class em extends we{constructor(){super({id:em.ID,label:p("action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters","Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=p("unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters.shortLabel","Disable Non ASCII Highlight")}async run(e,t,i){const n=e?.get(ft);n&&this.runAction(n)}async runAction(e){await e.updateValue(Cs.nonBasicASCII,!1,2)}}em.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";class Yv extends we{constructor(){super({id:Yv.ID,label:p("action.unicodeHighlight.showExcludeOptions","Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}async run(e,t,i){const{codePoint:n,reason:s,inString:r,inComment:a}=i,l=String.fromCodePoint(n),d=e.get(dh),c=e.get(ft);function h(f){return tl.isInvisibleCharacter(f)?p("unicodeHighlight.excludeInvisibleCharFromBeingHighlighted","Exclude {0} (invisible character) from being highlighted",MT(f)):p("unicodeHighlight.excludeCharFromBeingHighlighted","Exclude {0} from being highlighted",`${MT(f)} "${l}"`)}const u=[];if(s.kind===0)for(const f of s.notAmbiguousInLocales)u.push({label:p("unicodeHighlight.allowCommonCharactersInLanguage",'Allow unicode characters that are more common in the language "{0}".',f),run:async()=>{M0e(c,[f])}});if(u.push({label:h(n),run:()=>T0e(c,[n])}),a){const f=new E0e;u.push({label:f.label,run:async()=>f.runAction(c)})}else if(r){const f=new N0e;u.push({label:f.label,run:async()=>f.runAction(c)})}if(s.kind===0){const f=new gh;u.push({label:f.label,run:async()=>f.runAction(c)})}else if(s.kind===1){const f=new Jp;u.push({label:f.label,run:async()=>f.runAction(c)})}else if(s.kind===2){const f=new em;u.push({label:f.label,run:async()=>f.runAction(c)})}else R0e(s);const g=await d.pick(u,{title:p("unicodeHighlight.configureUnicodeHighlightOptions","Configure Unicode Highlight Options")});g&&await g.run()}}Yv.ID="editor.action.unicodeHighlight.showExcludeOptions";async function T0e(o,e){const t=o.getValue(Cs.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const n of e)i[String.fromCodePoint(n)]=!0;await o.updateValue(Cs.allowedCharacters,i,2)}async function M0e(o,e){var t;const i=(t=o.inspect(Cs.allowedLocales).user)===null||t===void 0?void 0:t.value;let n;typeof i=="object"&&i?n=Object.assign({},i):n={};for(const s of e)n[s]=!0;await o.updateValue(Cs.allowedLocales,n,2)}function R0e(o){throw new Error(`Unexpected value: ${o}`)}de(gh);de(Jp);de(em);de(Yv);yt(Np.ID,Np,1);hg.register(TT);var A0e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},a3=function(o,e){return function(t,i){e(t,i,o)}};const TV="ignoreUnusualLineTerminators";function P0e(o,e,t){o.setModelProperty(e.uri,TV,t)}function O0e(o,e){return o.getModelProperty(e.uri,TV)}let av=class extends K{constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(125),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(125)&&(this._config=this._editor.getOption(125),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()||O0e(this._codeEditorService,e)===!0||this._editor.getOption(90))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:p("unusualLineTerminators.title","Unusual Line Terminators"),message:p("unusualLineTerminators.message","Detected unusual line terminators"),detail:p("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`.",qo(e.uri)),primaryButton:p({key:"unusualLineTerminators.fix",comment:["&& denotes a mnemonic"]},"&&Remove Unusual Line Terminators"),cancelButton:p("unusualLineTerminators.ignore","Ignore")})}finally{this._isPresentingDialog=!1}if(!i.confirmed){P0e(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}};av.ID="editor.contrib.unusualLineTerminatorsDetector";av=A0e([a3(1,Dv),a3(2,Dt)],av);yt(av.ID,av,1);var MV=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},r1=function(o,e){return function(t,i){e(t,i,o)}},Ei,RT;const _L=new be("hasWordHighlights",!1);function RV(o,e,t,i){const n=o.ordered(e);return c2(n.map(s=>()=>Promise.resolve(s.provideDocumentHighlights(e,t,i)).then(void 0,Mi)),Bn).then(s=>{if(s){const r=new xi;return r.set(e.uri,s),r}return new xi})}function F0e(o,e,t,i,n,s){const r=o.ordered(e);return c2(r.map(a=>()=>{const l=s.filter(d=>mM(a.selector,d.uri,d.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(a.provideMultiDocumentHighlights(e,t,l,n)).then(void 0,Mi)}),a=>a instanceof xi&&a.size>0)}class nA{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=Zi(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new k(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}isValid(e,t,i){const n=t.startLineNumber,s=t.startColumn,r=t.endColumn,a=this._getCurrentWordRange(e,t);let l=!!(this._wordRange&&this._wordRange.equalsRange(a));for(let d=0,c=i.length;!l&&d<c;d++){const h=i.getRange(d);h&&h.startLineNumber===n&&h.startColumn<=s&&h.endColumn>=r&&(l=!0)}return l}cancel(){this.result.cancel()}}class B0e extends nA{constructor(e,t,i,n){super(e,t,i),this._providers=n}_compute(e,t,i,n){return RV(this._providers,e,t.getPosition(),n).then(s=>s||new xi)}}class W0e extends nA{constructor(e,t,i,n,s){super(e,t,i),this._providers=n,this._otherModels=s}_compute(e,t,i,n){return F0e(this._providers,e,t.getPosition(),i,n,this._otherModels).then(s=>s||new xi)}}class AV extends nA{constructor(e,t,i,n,s){super(e,t,n),this._otherModels=s,this._selectionIsEmpty=t.isEmpty(),this._word=i}_compute(e,t,i,n){return Mc(250,n).then(()=>{const s=new xi;let r;if(this._word?r=this._word:r=e.getWordAtPosition(t.getPosition()),!r)return new xi;const a=[e,...this._otherModels];for(const l of a){if(l.isDisposed())continue;const c=l.findMatches(r.word,!0,!1,!0,i,!1).map(h=>({range:h.range,kind:W_.Text}));c&&s.set(l.uri,c)}return s})}isValid(e,t,i){const n=t.isEmpty();return this._selectionIsEmpty!==n?!1:super.isValid(e,t,i)}}function V0e(o,e,t,i,n){return o.has(e)?new B0e(e,t,n,o):new AV(e,t,i,n,[])}function H0e(o,e,t,i,n,s){return o.has(e)?new W0e(e,t,n,o,s):new AV(e,t,i,n,s)}Cl("_executeDocumentHighlights",async(o,e,t)=>{const i=o.get(Se),n=await RV(i.documentHighlightProvider,e,t,st.None);return n?.get(e.uri)});let lv=Ei=class{constructor(e,t,i,n,s){this.toUnhook=new se,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new xi,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this.providers=t,this.multiDocumentProviders=i,this.codeEditorService=s,this._hasWordHighlights=_L.bindTo(n),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(80),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(r=>{this._ignorePositionChangeEvent||this.occurrencesHighlight!=="off"&&this._onPositionChanged(r)})),this.toUnhook.add(e.onDidChangeModelContent(r=>{this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(r=>{!r.newModelUrl&&r.oldModelUrl?this._stopSingular():Ei.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(r=>{const a=this.editor.getOption(80);this.occurrencesHighlight!==a&&(this.occurrencesHighlight=a,this._stopAll())})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,Ei.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(){this.occurrencesHighlight!=="off"&&this._run()}_getSortedHighlights(){return this.decorations.getRanges().sort(k.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),i=(e.findIndex(s=>s.containsPosition(this.editor.getPosition()))+1)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const s=this._getWord();if(s){const r=this.editor.getModel().getLineContent(n.startLineNumber);js(`${r}, ${i+1} of ${e.length} for '${s.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),i=(e.findIndex(s=>s.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 s=this._getWord();if(s){const r=this.editor.getModel().getLineContent(n.startLineNumber);js(`${r}, ${i+1} of ${e.length} for '${s.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=Ei.storedDecorations.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),Ei.storedDecorations.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(){const e=this.codeEditorService.listCodeEditors();for(const t of e){if(!t.hasModel())continue;const i=Ei.storedDecorations.get(t.getModel().uri);if(!i)continue;t.removeDecorations(i),Ei.storedDecorations.delete(t.getModel().uri);const n=md.get(t);n?.wordHighlighter&&n.wordHighlighter.decorations.length>0&&(n.wordHighlighter.decorations.clear(),n.wordHighlighter._hasWordHighlights.set(!1))}}_stopSingular(){var e,t,i,n;this._removeSingleDecorations(),this.editor.hasWidgetFocus()&&(((e=this.editor.getModel())===null||e===void 0?void 0:e.uri.scheme)!==Ye.vscodeNotebookCell&&((i=(t=Ei.query)===null||t===void 0?void 0:t.modelInfo)===null||i===void 0?void 0:i.model.uri.scheme)!==Ye.vscodeNotebookCell?(Ei.query=null,this._run()):!((n=Ei.query)===null||n===void 0)&&n.modelInfo&&(Ei.query.modelInfo=null)),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_stopAll(){this._removeAllDecorations(),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){var t;if(this.occurrencesHighlight==="off"){this._stopAll();return}if(e.reason!==3&&((t=this.editor.getModel())===null||t===void 0?void 0:t.uri.scheme)!==Ye.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===Ye.vscodeNotebookCell){const s=[],r=this.codeEditorService.listCodeEditors();for(const a of r){const l=a.getModel();l&&l!==e&&l.uri.scheme===Ye.vscodeNotebookCell&&s.push(l)}return s}const i=[],n=this.codeEditorService.listCodeEditors();for(const s of n){if(!_de(s))continue;const r=s.getModel();r&&e===r.modified&&i.push(r.modified)}if(i.length)return i;if(this.occurrencesHighlight==="singleFile")return[];for(const s of n){const r=s.getModel();r&&r!==e&&i.push(r)}return i}_run(){var e,t;let i;if(this.editor.hasWidgetFocus()){const n=this.editor.getSelection();if(!n||n.startLineNumber!==n.endLineNumber){this._stopAll();return}const s=n.startColumn,r=n.endColumn,a=this._getWord();if(!a||a.startColumn>s||a.endColumn<r){Ei.query=null,this._stopAll();return}i=this.workerRequest&&this.workerRequest.isValid(this.model,n,this.decorations),Ei.query={modelInfo:{model:this.model,selection:n},word:a}}else if(Ei.query===null)return;if(this.lastCursorPositionChangeTime=new Date().getTime(),i)this.workerRequestCompleted&&this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1,this._beginRenderDecorations());else{this._stopAll();const n=++this.workerRequestTokenId;this.workerRequestCompleted=!1;const s=this.getOtherModelsToHighlight(this.editor.getModel()),r=!!(!Ei.query.modelInfo&&Ei.query.word||((e=Ei.query.modelInfo)===null||e===void 0?void 0:e.model.uri)!==this.model.uri);!Ei.query.modelInfo||Ei.query.modelInfo.model.uri!==this.model.uri?this.workerRequest=this.computeWithModel(this.model,this.editor.getSelection(),r?Ei.query.word:null,s):this.workerRequest=this.computeWithModel(Ei.query.modelInfo.model,Ei.query.modelInfo.selection,Ei.query.word,s),(t=this.workerRequest)===null||t===void 0||t.result.then(a=>{n===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=a||[],this._beginRenderDecorations())},Ge)}}computeWithModel(e,t,i,n){return n.length?H0e(this.multiDocumentProviders,e,t,i,this.editor.getOption(129),n):V0e(this.providers,e,t,i,this.editor.getOption(129))}_beginRenderDecorations(){const e=new Date().getTime(),t=this.lastCursorPositionChangeTime+250;e>=t?(this.renderDecorationsTimer=-1,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},t-e)}renderDecorations(){var e,t,i;this.renderDecorationsTimer=-1;const n=this.codeEditorService.listCodeEditors();for(const s of n){const r=md.get(s);if(!r)continue;const a=[],l=(e=s.getModel())===null||e===void 0?void 0:e.uri;if(l&&this.workerRequestValue.has(l)){const d=Ei.storedDecorations.get(l),c=this.workerRequestValue.get(l);if(c)for(const u of c)a.push({range:u.range,options:__e(u.kind)});let h=[];s.changeDecorations(u=>{h=u.deltaDecorations(d??[],a)}),Ei.storedDecorations=Ei.storedDecorations.set(l,h),a.length>0&&((t=r.wordHighlighter)===null||t===void 0||t.decorations.set(a),(i=r.wordHighlighter)===null||i===void 0||i._hasWordHighlights.set(!0))}}}dispose(){this._stopSingular(),this.toUnhook.dispose()}};lv.storedDecorations=new xi;lv.query=null;lv=Ei=MV([r1(4,Dt)],lv);let md=RT=class extends K{static get(e){return e.getContribution(RT.ID)}constructor(e,t,i,n){super(),this._wordHighlighter=null;const s=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this._wordHighlighter=new lv(e,i.documentHighlightProvider,i.multiDocumentHighlightProvider,t,n))};this._register(e.onDidChangeModel(r=>{this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),s()})),s()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){var e;(e=this._wordHighlighter)===null||e===void 0||e.moveNext()}moveBack(){var e;(e=this._wordHighlighter)===null||e===void 0||e.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore()}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}};md.ID="editor.contrib.wordHighlighter";md=RT=MV([r1(1,We),r1(2,Se),r1(3,Dt)],md);class PV extends we{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=md.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class z0e extends PV{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:p("wordHighlight.next.label","Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:_L,kbOpts:{kbExpr:M.editorTextFocus,primary:65,weight:100}})}}class U0e extends PV{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:p("wordHighlight.previous.label","Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:_L,kbOpts:{kbExpr:M.editorTextFocus,primary:1089,weight:100}})}}class $0e extends we{constructor(){super({id:"editor.action.wordHighlight.trigger",label:p("wordHighlight.trigger.label","Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:_L.toNegated(),kbOpts:{kbExpr:M.editorTextFocus,primary:0,weight:100}})}run(e,t,i){const n=md.get(t);n&&n.restoreViewState(!0)}}yt(md.ID,md,0);de(z0e);de(U0e);de($0e);class vL extends cn{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const n=$o(t.getOption(129)),s=t.getModel(),a=t.getSelections().map(l=>{const d=new V(l.positionLineNumber,l.positionColumn),c=this._move(n,s,d,this._wordNavigationType);return this._moveTo(l,c,this._inSelectionMode)});if(s.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,a.map(l=>mt.fromModelSelection(l))),a.length===1){const l=new V(a[0].positionLineNumber,a[0].positionColumn);t.revealPosition(l,0)}}_moveTo(e,t,i){return i?new xe(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new xe(t.lineNumber,t.column,t.lineNumber,t.column)}}class fh extends vL{_move(e,t,i,n){return St.moveWordLeft(e,t,i,n)}}class ph extends vL{_move(e,t,i,n){return St.moveWordRight(e,t,i,n)}}class K0e extends fh{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class j0e extends fh{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class q0e extends fh{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:te.and(M.textInputFocus,(e=te.and(_v,gy))===null||e===void 0?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class G0e extends fh{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class Z0e extends fh{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class Y0e extends fh{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:te.and(M.textInputFocus,(e=te.and(_v,gy))===null||e===void 0?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class X0e extends fh{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,n){return super._move($o(sa.wordSeparators.defaultValue),t,i,n)}}class Q0e extends fh{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,n){return super._move($o(sa.wordSeparators.defaultValue),t,i,n)}}class J0e extends ph{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class eve extends ph{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:te.and(M.textInputFocus,(e=te.and(_v,gy))===null||e===void 0?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class tve extends ph{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class ive extends ph{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class nve extends ph{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:te.and(M.textInputFocus,(e=te.and(_v,gy))===null||e===void 0?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class sve extends ph{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class ove extends ph{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,n){return super._move($o(sa.wordSeparators.defaultValue),t,i,n)}}class rve extends ph{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,n){return super._move($o(sa.wordSeparators.defaultValue),t,i,n)}}class bL extends cn{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const n=e.get(Wt);if(!t.hasModel())return;const s=$o(t.getOption(129)),r=t.getModel(),a=t.getSelections(),l=t.getOption(6),d=t.getOption(11),c=n.getLanguageConfiguration(r.getLanguageId()).getAutoClosingPairs(),h=t._getViewModel(),u=a.map(g=>{const f=this._delete({wordSeparators:s,model:r,selection:g,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(9),autoClosingBrackets:l,autoClosingQuotes:d,autoClosingPairs:c,autoClosedCharacters:h.getCursorAutoClosedCharacters()},this._wordNavigationType);return new kn(f,"")});t.pushUndoStop(),t.executeCommands(this.id,u),t.pushUndoStop()}}class sA extends bL{_delete(e,t){const i=St.deleteWordLeft(e,t);return i||new k(1,1,1,1)}}class oA extends bL{_delete(e,t){const i=St.deleteWordRight(e,t);if(i)return i;const n=e.model.getLineCount(),s=e.model.getLineMaxColumn(n);return new k(n,s,n,s)}}class ave extends sA{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:M.writable})}}class lve extends sA{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:M.writable})}}class dve extends sA{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:M.writable,kbOpts:{kbExpr:M.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class cve extends oA{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:M.writable})}}class hve extends oA{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:M.writable})}}class uve extends oA{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:M.writable,kbOpts:{kbExpr:M.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class gve extends we{constructor(){super({id:"deleteInsideWord",precondition:M.writable,label:p("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,t,i){if(!t.hasModel())return;const n=$o(t.getOption(129)),s=t.getModel(),a=t.getSelections().map(l=>{const d=St.deleteInsideWord(n,s,l);return new kn(d,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}ue(new K0e);ue(new j0e);ue(new q0e);ue(new G0e);ue(new Z0e);ue(new Y0e);ue(new J0e);ue(new eve);ue(new tve);ue(new ive);ue(new nve);ue(new sve);ue(new X0e);ue(new Q0e);ue(new ove);ue(new rve);ue(new ave);ue(new lve);ue(new dve);ue(new cve);ue(new hve);ue(new uve);de(gve);class fve extends bL{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:M.writable,kbOpts:{kbExpr:M.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const i=qS.deleteWordPartLeft(e);return i||new k(1,1,1,1)}}class pve extends bL{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:M.writable,kbOpts:{kbExpr:M.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const i=qS.deleteWordPartRight(e);if(i)return i;const n=e.model.getLineCount(),s=e.model.getLineMaxColumn(n);return new k(n,s,n,s)}}class OV extends vL{_move(e,t,i,n){return qS.moveWordPartLeft(e,t,i)}}class mve extends OV{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:M.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}gt.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class _ve extends OV{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:M.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}gt.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class FV extends vL{_move(e,t,i,n){return qS.moveWordPartRight(e,t,i)}}class vve extends FV{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:M.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class bve extends FV{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:M.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}ue(new fve);ue(new pve);ue(new mve);ue(new _ve);ue(new vve);ue(new bve);class AT extends K{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=zs.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(91);t||(this.editor.isSimpleWidget?t=new Fn(p("editor.simple.readonly","Cannot edit in read-only input")):t=new Fn(p("editor.readonly","Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}}AT.ID="editor.contrib.readOnlyMessageController";yt(AT.ID,AT,2);export{Sve as B,xde as E,Dde as K,Mde as M,Ide as P,Ede as R,Ade as U,l3 as _,ID as a,Ode as e,Fde as l,c6 as m,Hg as p};
|
|
714
|
+
`)};const r=await s.provideRenameEdits(this.model,this.position,e,n);if(r){if(r.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(r.rejectReason),n)}else return this._provideRenameEdits(e,t+1,i.concat(p("no result","No result.")),n);return r}}async function U_e(o,e,t,i){const n=new YR(e,t,o),s=await n.resolveRenameLocation(st.None);return s?.rejectReason?{edits:[],rejectReason:s.rejectReason}:n.provideRenameEdits(i,st.None)}let Yu=pT=class{static get(e){return e.getContribution(pT.ID)}constructor(e,t,i,n,s,r,a,l){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=n,this._progressService=s,this._logService=r,this._configService=a,this._languageFeaturesService=l,this._disposableStore=new se,this._cts=new Wi,this._renameInputField=this._disposableStore.add(this._instaService.createInstance(fT,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){var e,t;if(this._cts.dispose(!0),this._cts=new Wi,!this.editor.hasModel())return;const i=this.editor.getPosition(),n=new YR(this.editor.getModel(),i,this._languageFeaturesService.renameProvider);if(!n.hasProvider())return;const s=new Uc(this.editor,5,void 0,this._cts.token);let r;try{const f=n.resolveRenameLocation(s.token);this._progressService.showWhile(f,250),r=await f}catch(f){(e=zs.get(this.editor))===null||e===void 0||e.showMessage(f||p("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),i);return}finally{s.dispose()}if(!r)return;if(r.rejectReason){(t=zs.get(this.editor))===null||t===void 0||t.showMessage(r.rejectReason,i);return}if(s.token.isCancellationRequested)return;const a=new Uc(this.editor,5,r.range,this._cts.token),l=this.editor.getSelection();let d=0,c=r.text.length;!k.isEmpty(l)&&!k.spansMultipleLines(l)&&k.containsRange(r.range,l)&&(d=Math.max(0,l.startColumn-r.range.startColumn),c=Math.min(r.range.endColumn,l.endColumn)-r.range.startColumn);const h=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),u=await this._renameInputField.getInput(r.range,r.text,d,c,h,a.token);if(typeof u=="boolean"){u&&this.editor.focus(),a.dispose();return}this.editor.focus();const g=DS(n.provideRenameEdits(u.newName,a.token),a.token).then(async f=>{if(!(!f||!this.editor.hasModel())){if(f.rejectReason){this._notificationService.info(f.rejectReason);return}this.editor.setSelection(k.fromPositions(this.editor.getSelection().getPosition())),this._bulkEditService.apply(f,{editor:this.editor,showPreview:u.wantsPreview,label:p("label","Renaming '{0}' to '{1}'",r?.text,u.newName),code:"undoredo.rename",quotableLabel:p("quotableLabel","Renaming {0} to {1}",r?.text,u.newName),respectAutoSaveConfig:!0}).then(m=>{m.ariaSummary&&js(p("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",r.text,u.newName,m.ariaSummary))}).catch(m=>{this._notificationService.error(p("rename.failedApply","Rename failed to apply edits")),this._logService.error(m)})}},f=>{this._notificationService.error(p("rename.failed","Rename failed to compute edits")),this._logService.error(f)}).finally(()=>{a.dispose()});return this._progressService.showWhile(g,250),g}acceptRenameInput(e){this._renameInputField.acceptInput(e)}cancelRenameInput(){this._renameInputField.cancelInput(!0)}};Yu.ID="editor.contrib.renameController";Yu=pT=z_e([Eh(1,Oe),Eh(2,Vi),Eh(3,kv),Eh(4,lh),Eh(5,Zs),Eh(6,k2),Eh(7,Se)],Yu);class $_e extends we{constructor(){super({id:"editor.action.rename",label:p("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:te.and(M.writable,M.hasRenameProvider),kbOpts:{kbExpr:M.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(Dt),[n,s]=Array.isArray(t)&&t||[void 0,void 0];return Me.isUri(n)&&V.isIPosition(s)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(s),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},Ge):super.runCommand(e,t)}run(e,t){const i=Yu.get(t);return i?i.run():Promise.resolve()}}yt(Yu.ID,Yu,4);de($_e);const XR=cn.bindToContribution(Yu.get);ue(new XR({id:"acceptRenameInput",precondition:uL,handler:o=>o.acceptRenameInput(!1),kbOpts:{weight:199,kbExpr:te.and(M.focus,te.not("isComposing")),primary:3}}));ue(new XR({id:"acceptRenameInputWithPreview",precondition:te.and(uL,te.has("config.editor.rename.enablePreview")),handler:o=>o.acceptRenameInput(!0),kbOpts:{weight:199,kbExpr:te.and(M.focus,te.not("isComposing")),primary:1027}}));ue(new XR({id:"cancelRenameInput",precondition:uL,handler:o=>o.cancelRenameInput(),kbOpts:{weight:199,kbExpr:M.focus,primary:9,secondary:[1033]}}));Cl("_executeDocumentRenameProvider",function(o,e,t,...i){const[n]=i;Tt(typeof n=="string");const{renameProvider:s}=o.get(Se);return U_e(s,e,t,n)});Cl("_executePrepareRename",async function(o,e,t){const{renameProvider:i}=o.get(Se),s=await new YR(e,t,i).resolveRenameLocation(st.None);if(s?.rejectReason)throw new Error(s.rejectReason);return s});Ri.as(la.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:p("enablePreview","Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});function K_e(o){for(let e=0,t=o.length;e<t;e+=4){const i=o[e+0],n=o[e+1],s=o[e+2],r=o[e+3];o[e+0]=r,o[e+1]=s,o[e+2]=n,o[e+3]=i}}function j_e(o){const e=new Uint8Array(o.buffer,o.byteOffset,o.length*4);return D3()||K_e(e),AS.wrap(e)}function _V(o){const e=new Uint32Array(q_e(o));let t=0;if(e[t++]=o.id,o.type==="full")e[t++]=1,e[t++]=o.data.length,e.set(o.data,t),t+=o.data.length;else{e[t++]=2,e[t++]=o.deltas.length;for(const i of o.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 j_e(e)}function q_e(o){let e=0;if(e+=2,o.type==="full")e+=1+o.data.length;else{e+=1,e+=3*o.deltas.length;for(const t of o.deltas)t.data&&(e+=t.data.length)}return e}function gL(o){return o&&!!o.data}function vV(o){return o&&Array.isArray(o.edits)}class G_e{constructor(e,t,i){this.provider=e,this.tokens=t,this.error=i}}function bV(o,e){return o.has(e)}function Z_e(o,e){const t=o.orderedGroups(e);return t.length>0?t[0]:[]}async function CV(o,e,t,i,n){const s=Z_e(o,e),r=await Promise.all(s.map(async a=>{let l,d=null;try{l=await a.provideDocumentSemanticTokens(e,a===t?i:null,n)}catch(c){d=c,l=null}return(!l||!gL(l)&&!vV(l))&&(l=null),new G_e(a,l,d)}));for(const a of r){if(a.error)throw a.error;if(a.tokens)return a}return r.length>0?r[0]:null}function Y_e(o,e){const t=o.orderedGroups(e);return t.length>0?t[0]:null}class X_e{constructor(e,t){this.provider=e,this.tokens=t}}function Q_e(o,e){return o.has(e)}function wV(o,e){const t=o.orderedGroups(e);return t.length>0?t[0]:[]}async function QR(o,e,t,i){const n=wV(o,e),s=await Promise.all(n.map(async r=>{let a;try{a=await r.provideDocumentRangeSemanticTokens(e,t,i)}catch(l){Mi(l),a=null}return(!a||!gL(a))&&(a=null),new X_e(r,a)}));for(const r of s)if(r.tokens)return r;return s.length>0?s[0]:null}gt.registerCommand("_provideDocumentSemanticTokensLegend",async(o,...e)=>{const[t]=e;Tt(t instanceof Me);const i=o.get(ii).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=o.get(Se),s=Y_e(n,i);return s?s[0].getLegend():o.get(ui).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)});gt.registerCommand("_provideDocumentSemanticTokens",async(o,...e)=>{const[t]=e;Tt(t instanceof Me);const i=o.get(ii).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=o.get(Se);if(!bV(n,i))return o.get(ui).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());const s=await CV(n,i,null,null,st.None);if(!s)return;const{provider:r,tokens:a}=s;if(!a||!gL(a))return;const l=_V({id:0,type:"full",data:a.data});return a.resultId&&r.releaseDocumentSemanticTokens(a.resultId),l});gt.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(o,...e)=>{const[t,i]=e;Tt(t instanceof Me);const n=o.get(ii).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:s}=o.get(Se),r=wV(s,n);if(r.length===0)return;if(r.length===1)return r[0].getLegend();if(!i||!k.isIRange(i))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),r[0].getLegend();const a=await QR(s,n,k.lift(i),st.None);if(a)return a.provider.getLegend()});gt.registerCommand("_provideDocumentRangeSemanticTokens",async(o,...e)=>{const[t,i]=e;Tt(t instanceof Me),Tt(k.isIRange(i));const n=o.get(ii).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:s}=o.get(Se),r=await QR(s,n,k.lift(i),st.None);if(!(!r||!r.tokens))return _V({id:0,type:"full",data:r.tokens.data})});const JR="editor.semanticHighlighting";function mT(o,e,t){var i;const n=(i=t.getValue(JR,{overrideIdentifier:o.getLanguageId(),resource:o.uri}))===null||i===void 0?void 0:i.enabled;return typeof n=="boolean"?n:e.getColorTheme().semanticHighlighting}var SV=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Na=function(o,e){return function(t,i){e(t,i,o)}},Wd;let _T=class extends K{constructor(e,t,i,n,s,r){super(),this._watchers=Object.create(null);const a=c=>{this._watchers[c.uri.toString()]=new sv(c,e,i,s,r)},l=(c,h)=>{h.dispose(),delete this._watchers[c.uri.toString()]},d=()=>{for(const c of t.getModels()){const h=this._watchers[c.uri.toString()];mT(c,i,n)?h||a(c):h&&l(c,h)}};this._register(t.onModelAdded(c=>{mT(c,i,n)&&a(c)})),this._register(t.onModelRemoved(c=>{const h=this._watchers[c.uri.toString()];h&&l(c,h)})),this._register(n.onDidChangeConfiguration(c=>{c.affectsConfiguration(JR)&&d()})),this._register(i.onDidColorThemeChange(d))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};_T=SV([Na(0,ty),Na(1,ii),Na(2,tn),Na(3,ft),Na(4,Zo),Na(5,Se)],_T);let sv=Wd=class extends K{constructor(e,t,i,n,s){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=s.documentSemanticTokensProvider,this._debounceInformation=n.for(this._provider,"DocumentSemanticTokens",{min:Wd.REQUEST_MIN_DELAY,max:Wd.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new Rt(()=>this._fetchDocumentSemanticTokensNow(),Wd.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 r=()=>{Et(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)}))};r(),this._register(this._provider.onDidChange(()=>{r(),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),Et(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!bV(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new Wi,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,n=CV(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const s=[],r=this._model.onDidChangeContent(l=>{s.push(l)}),a=new Hn(!1);n.then(l=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),!l)this._setDocumentSemanticTokens(null,null,null,s);else{const{provider:d,tokens:c}=l,h=this._semanticTokensStylingService.getStyling(d);this._setDocumentSemanticTokens(d,c||null,h,s)}},l=>{l&&(oa(l)||typeof l.message=="string"&&l.message.indexOf("busy")!==-1)||Ge(l),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),(s.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,i,n,s){s=Math.min(s,i.length-n,e.length-t);for(let r=0;r<s;r++)i[n+r]=e[t+r]}_setDocumentSemanticTokens(e,t,i,n){const s=this._currentDocumentResponse,r=()=>{(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),r();return}if(vV(t)){if(!s){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:s.data};else{let a=0;for(const u of t.edits)a+=(u.data?u.data.length:0)-u.deleteCount;const l=s.data,d=new Uint32Array(l.length+a);let c=l.length,h=d.length;for(let u=t.edits.length-1;u>=0;u--){const g=t.edits[u];if(g.start>l.length){i.warnInvalidEditStart(s.resultId,t.resultId,u,g.start,l.length),this._model.tokenization.setSemanticTokens(null,!0);return}const f=c-(g.start+g.deleteCount);f>0&&(Wd._copy(l,c-f,d,h-f,f),h-=f),g.data&&(Wd._copy(g.data,0,d,h-g.data.length,g.data.length),h-=g.data.length),c=g.start}c>0&&Wd._copy(l,0,d,0,c),t={resultId:t.resultId,data:d}}}if(gL(t)){this._currentDocumentResponse=new J_e(e,t.resultId,t.data);const a=k7(t,i,this._model.getLanguageId());if(n.length>0)for(const l of n)for(const d of a)for(const c of l.changes)d.applyEdit(c.range,c.text);this._model.tokenization.setSemanticTokens(a,!0)}else this._model.tokenization.setSemanticTokens(null,!0);r()}};sv.REQUEST_MIN_DELAY=300;sv.REQUEST_MAX_DELAY=2e3;sv=Wd=SV([Na(1,ty),Na(2,tn),Na(3,Zo),Na(4,Se)],sv);class J_e{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}yy(_T);var e0e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Nm=function(o,e){return function(t,i){e(t,i,o)}};let ov=class extends K{constructor(e,t,i,n,s,r){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=n,this._editor=e,this._provider=r.documentRangeSemanticTokensProvider,this._debounceInformation=s.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new Rt(()=>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(JR)&&(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(!mT(e,this._themeService,this._configurationService)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}if(!Q_e(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=Zi(r=>Promise.resolve(QR(this._provider,e,t,r))),s=new Hn(!1);return n.then(r=>{if(this._debounceInformation.update(e,s.elapsed()),!r||!r.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:a,tokens:l}=r,d=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,k7(l,d,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(n),()=>this._removeOutstandingRequest(n)),n}};ov.ID="editor.contrib.viewportSemanticTokens";ov=e0e([Nm(1,ty),Nm(2,tn),Nm(3,ft),Nm(4,Zo),Nm(5,Se)],ov);yt(ov.ID,ov,1);class t0e{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const n of t){const s=[];i.push(s),this.selectSubwords&&this._addInWordRanges(s,e,n),this._addWordRanges(s,e,n),this._addWhitespaceLine(s,e,n),s.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const n=t.getWordAtPosition(i);if(!n)return;const{word:s,startColumn:r}=n,a=i.column-r;let l=a,d=a,c=0;for(;l>=0;l--){const h=s.charCodeAt(l);if(l!==a&&(h===95||h===45))break;if(Yd(h)&&Da(c))break;c=h}for(l+=1;d<s.length;d++){const h=s.charCodeAt(d);if(Da(h)&&Yd(c))break;if(h===95||h===45)break;c=h}l<d&&e.push({range:new k(i.lineNumber,r+l,i.lineNumber,r+d)})}_addWordRanges(e,t,i){const n=t.getWordAtPosition(i);n&&e.push({range:new k(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 k(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var i0e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},n0e=function(o,e){return function(t,i){e(t,i,o)}},vT;class eA{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 eA(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}let Ep=vT=class{static get(e){return e.getContribution(vT.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){var e;(e=this._selectionListener)===null||e===void 0||e.dispose()}async run(e){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(this._state||await LV(this._languageFeaturesService.selectionRangeProvider,i,t.map(s=>s.getPosition()),this._editor.getOption(112),st.None).then(s=>{var r;if(!(!Bn(s)||s.length!==t.length)&&!(!this._editor.hasModel()||!_i(this._editor.getSelections(),t,(a,l)=>a.equalsSelection(l)))){for(let a=0;a<s.length;a++)s[a]=s[a].filter(l=>l.containsPosition(t[a].getStartPosition())&&l.containsPosition(t[a].getEndPosition())),s[a].unshift(t[a]);this._state=s.map(a=>new eA(0,a)),(r=this._selectionListener)===null||r===void 0||r.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{var a;this._ignoreSelection||((a=this._selectionListener)===null||a===void 0||a.dispose(),this._state=void 0)})}}),!this._state)return;this._state=this._state.map(s=>s.mov(e));const n=this._state.map(s=>xe.fromPositions(s.ranges[s.index].getStartPosition(),s.ranges[s.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(n)}finally{this._ignoreSelection=!1}}};Ep.ID="editor.contrib.smartSelectController";Ep=vT=i0e([n0e(1,Se)],Ep);class yV extends we{constructor(e,t){super(t),this._forward=e}async run(e,t){const i=Ep.get(t);i&&await i.run(this._forward)}}class s0e extends yV{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:p("smartSelect.expand","Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:M.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:N.MenubarSelectionMenu,group:"1_basic",title:p({},"&&Expand Selection"),order:2}})}}gt.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class o0e extends yV{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:p("smartSelect.shrink","Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:M.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:N.MenubarSelectionMenu,group:"1_basic",title:p({},"&&Shrink Selection"),order:3}})}}yt(Ep.ID,Ep,4);de(s0e);de(o0e);async function LV(o,e,t,i,n){const s=o.all(e).concat(new t0e(i.selectSubwords));s.length===1&&s.unshift(new ao);const r=[],a=[];for(const l of s)r.push(Promise.resolve(l.provideSelectionRanges(e,t,n)).then(d=>{if(Bn(d)&&d.length===t.length)for(let c=0;c<t.length;c++){a[c]||(a[c]=[]);for(const h of d[c])k.isIRange(h.range)&&k.containsPosition(h.range,t[c])&&a[c].push(k.lift(h.range))}},Mi));return await Promise.all(r),a.map(l=>{if(l.length===0)return[];l.sort((u,g)=>V.isBefore(u.getStartPosition(),g.getStartPosition())?1:V.isBefore(g.getStartPosition(),u.getStartPosition())||V.isBefore(u.getEndPosition(),g.getEndPosition())?-1:V.isBefore(g.getEndPosition(),u.getEndPosition())?1:0);const d=[];let c;for(const u of l)(!c||k.containsRange(u,c)&&!k.equalsRange(u,c))&&(d.push(u),c=u);if(!i.selectLeadingAndTrailingWhitespace)return d;const h=[d[0]];for(let u=1;u<d.length;u++){const g=d[u-1],f=d[u];if(f.startLineNumber!==g.startLineNumber||f.endLineNumber!==g.endLineNumber){const m=new k(g.startLineNumber,e.getLineFirstNonWhitespaceColumn(g.startLineNumber),g.endLineNumber,e.getLineLastNonWhitespaceColumn(g.endLineNumber));m.containsRange(g)&&!m.equalsRange(g)&&f.containsRange(m)&&!f.equalsRange(m)&&h.push(m);const _=new k(g.startLineNumber,1,g.endLineNumber,e.getLineMaxColumn(g.endLineNumber));_.containsRange(g)&&!_.equalsRange(m)&&f.containsRange(_)&&!f.equalsRange(_)&&h.push(_)}h.push(f)}return h})}gt.registerCommand("_executeSelectionRangeProvider",async function(o,...e){const[t,i]=e;Tt(Me.isUri(t));const n=o.get(Se).selectionRangeProvider,s=await o.get(ks).createModelReference(t);try{return LV(n,s.object.textEditorModel,i,{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},st.None)}finally{s.dispose()}});const r0e=Object.freeze({View:{value:p("view","View"),original:"View"},Help:{value:p("help","Help"),original:"Help"},Test:{value:p("test","Test"),original:"Test"},File:{value:p("file","File"),original:"File"},Preferences:{value:p("preferences","Preferences"),original:"Preferences"},Developer:{value:p({},"Developer"),original:"Developer"}});class i3{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&&_i(this.startLineNumbers,e.startLineNumbers)&&_i(this.endLineNumbers,e.endLineNumbers)}}const n3=vd("stickyScrollViewLayer",{createHTML:o=>o}),LD="data-sticky-line-index",s3="data-sticky-is-line",a0e="data-sticky-is-line-number",o3="data-sticky-is-folding-icon";class l0e extends K{constructor(e){super(),this._editor=e,this._foldingIconStore=new se,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(66),this._stickyLines=[],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 Gc),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(114).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(114)&&t(),i.hasChanged(66)&&(this._lineHeight=this._editor.getOption(66))})),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}getStickyLineForLine(e){return this._stickyLines.find(t=>t.lineNumber===e)}getCurrentLines(){return this._lineNumbers}setState(e,t,i=1/0){if((!this._previousState&&!e||this._previousState&&this._previousState.equals(e))&&i===1/0)return;this._previousState=e;const n=this._stickyLines;if(this._clearStickyWidget(),!e||!this._editor._getViewModel())return;if(e.startLineNumbers.length*this._lineHeight+e.lastLineRelativePosition>0){this._lastLineRelativePosition=e.lastLineRelativePosition;const r=[...e.startLineNumbers];e.showEndForLine!==null&&(r[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=r}else this._lastLineRelativePosition=0,this._lineNumbers=[];this._renderRootNode(n,t,i)}_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`}_clearStickyWidget(){this._stickyLines=[],this._foldingIconStore.clear(),bn(this._lineNumbersDomNode),bn(this._linesDomNode),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._stickyLines){const i=t.foldingIcon;i&&i.setVisible(e?!0:i.isCollapsed)}}async _renderRootNode(e,t,i=1/0){const n=this._editor.getLayoutInfo();for(const[r,a]of this._lineNumbers.entries()){const l=e[r],d=a>=i||l?.lineNumber!==a?this._renderChildNode(r,a,t,n):this._updateTopAndZIndexOfStickyLine(l);d&&(this._linesDomNode.appendChild(d.lineDomNode),this._lineNumbersDomNode.appendChild(d.lineNumberDomNode),this._stickyLines.push(d))}t&&(this._setFoldingHoverListeners(),this._useFoldingOpacityTransition(!this._isOnGlyphMargin));const s=this._lineNumbers.length*this._lineHeight+this._lastLineRelativePosition;if(s===0){this._clearStickyWidget();return}this._rootDomNode.style.display="block",this._lineNumbersDomNode.style.height=`${s}px`,this._linesDomNodeScrollable.style.height=`${s}px`,this._rootDomNode.style.height=`${s}px`,this._rootDomNode.style.marginLeft="0px",this._updateMinContentWidth(),this._editor.layoutOverlayWidget(this)}_setFoldingHoverListeners(){this._editor.getOption(109)==="mouseover"&&(this._foldingIconStore.add(Q(this._lineNumbersDomNode,ge.MOUSE_ENTER,t=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(Q(this._lineNumbersDomNode,ge.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,i,n){const s=this._editor._getViewModel();if(!s)return;const r=s.coordinatesConverter.convertModelPositionToViewPosition(new V(t,1)).lineNumber,a=s.getViewLineRenderingData(r),l=this._editor.getOption(67);let d;try{d=Ws.filter(a.inlineDecorations,r,a.minColumn,a.maxColumn)}catch{d=[]}const c=new rh(!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),h=new Op(2e3),u=mv(c,h);let g;n3?g=n3.createHTML(h.build()):g=h.build();const f=document.createElement("span");f.setAttribute(LD,String(e)),f.setAttribute(s3,""),f.setAttribute("role","listitem"),f.tabIndex=0,f.className="sticky-line-content",f.classList.add(`stickyLine${t}`),f.style.lineHeight=`${this._lineHeight}px`,f.innerHTML=g;const m=document.createElement("span");m.setAttribute(LD,String(e)),m.setAttribute(a0e,""),m.className="sticky-line-number",m.style.lineHeight=`${this._lineHeight}px`;const _=n.contentLeft;m.style.width=`${_}px`;const v=document.createElement("span");l.renderType===1||l.renderType===3&&t%10===0?v.innerText=t.toString():l.renderType===2&&(v.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),v.className="sticky-line-number-inner",v.style.lineHeight=`${this._lineHeight}px`,v.style.width=`${n.lineNumbersWidth}px`,v.style.paddingLeft=`${n.lineNumbersLeft}px`,m.appendChild(v);const b=this._renderFoldingIconForLine(i,t);b&&m.appendChild(b.domNode),this._editor.applyFontInfo(f),this._editor.applyFontInfo(v),m.style.lineHeight=`${this._lineHeight}px`,f.style.lineHeight=`${this._lineHeight}px`,m.style.height=`${this._lineHeight}px`,f.style.height=`${this._lineHeight}px`;const C=new d0e(e,t,f,m,b,u.characterMapping);return this._updateTopAndZIndexOfStickyLine(C)}_updateTopAndZIndexOfStickyLine(e){var t;const i=e.index,n=e.lineDomNode,s=e.lineNumberDomNode,r=i===this._lineNumbers.length-1,a="0",l="1";n.style.zIndex=r?a:l,s.style.zIndex=r?a:l;const d=`${i*this._lineHeight+this._lastLineRelativePosition+(!((t=e.foldingIcon)===null||t===void 0)&&t.isCollapsed?1:0)}px`,c=`${i*this._lineHeight}px`;return n.style.top=r?d:c,s.style.top=r?d:c,e}_renderFoldingIconForLine(e,t){const i=this._editor.getOption(109);if(!e||i==="never")return;const n=e.regions,s=n.findRange(t),r=n.getStartLineNumber(s);if(!(t===r))return;const l=n.isCollapsed(s),d=new c0e(l,r,n.getEndLineNumber(s),this._lineHeight);return d.setVisible(this._isOnGlyphMargin?!0:l||i==="always"),d.domNode.setAttribute(o3,""),d}_updateMinContentWidth(){this._minContentWidthInPx=0;for(const e of this._stickyLines)e.lineDomNode.scrollWidth>this._minContentWidthInPx&&(this._minContentWidthInPx=e.lineDomNode.scrollWidth);this._minContentWidthInPx+=this._editor.getLayoutInfo().verticalScrollbarWidth}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:null}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e<this._stickyLines.length&&this._stickyLines[e].lineDomNode.focus()}getEditorPositionFromNode(e){if(!e||e.children.length>0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const i=z2(t.characterMapping,e,0);return new V(t.lineNumber,i)}getLineNumberFromChildDomNode(e){var t,i;return(i=(t=this._getRenderedStickyLineFromChildDomNode(e))===null||t===void 0?void 0:t.lineNumber)!==null&&i!==void 0?i:null}_getRenderedStickyLineFromChildDomNode(e){const t=this.getLineIndexFromChildDomNode(e);return t===null||t<0||t>=this._stickyLines.length?null:this._stickyLines[t]}getLineIndexFromChildDomNode(e){const t=this._getAttributeValue(e,LD);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,s3)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,o3)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const i=e.getAttribute(t);if(i!==null)return i;e=e.parentElement}}}class d0e{constructor(e,t,i,n,s,r){this.index=e,this.lineNumber=t,this.lineDomNode=i,this.lineNumberDomNode=n,this.foldingIcon=s,this.characterMapping=r}}class c0e{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=Re.asClassName(e?Zy:Gy)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class N_{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class rS{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}}class xV{constructor(e,t,i,n){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=n}}var fL=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},rv=function(o,e){return function(t,i){e(t,i,o)}},T_;(function(o){o.OUTLINE_MODEL="outlineModel",o.FOLDING_PROVIDER_MODEL="foldingProviderModel",o.INDENTATION_MODEL="indentationModel"})(T_||(T_={}));var dc;(function(o){o[o.VALID=0]="VALID",o[o.INVALID=1]="INVALID",o[o.CANCELED=2]="CANCELED"})(dc||(dc={}));let bT=class extends K{constructor(e,t,i,n){super(),this._editor=e,this._languageConfigurationService=t,this._languageFeaturesService=i,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new vr(300)),this._updateOperation=this._register(new se);const s=new CT(i),r=new ST(this._editor,i),a=new wT(this._editor,t);switch(n){case T_.OUTLINE_MODEL:this._modelProviders.push(s),this._modelProviders.push(r),this._modelProviders.push(a);break;case T_.FOLDING_PROVIDER_MODEL:this._modelProviders.push(r),this._modelProviders.push(a);break;case T_.INDENTATION_MODEL:this._modelProviders.push(a);break}}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}async update(e,t,i){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),await this._updateScheduler.trigger(async()=>{for(const n of this._modelProviders){const{statusPromise:s,modelPromise:r}=n.computeStickyModel(e,t,i);this._modelPromise=r;const a=await s;if(this._modelPromise!==r)return null;switch(a){case dc.CANCELED:return this._updateOperation.clear(),null;case dc.VALID:return n.stickyModel}}return null}).catch(n=>(Ge(n),null))}};bT=fL([rv(1,Wt),rv(2,Se)],bT);class DV{constructor(){this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,dc.INVALID}computeStickyModel(e,t,i){if(i.isCancellationRequested||!this.isProviderValid(e))return{statusPromise:this._invalid(),modelPromise:null};const n=Zi(s=>this.createModelFromProvider(e,t,s));return{statusPromise:n.then(s=>this.isModelValid(s)?i.isCancellationRequested?dc.CANCELED:(this._stickyModel=this.createStickyModel(e,t,i,s),dc.VALID):this._invalid()).then(void 0,s=>(Ge(s),dc.CANCELED)),modelPromise:n}}isModelValid(e){return!0}isProviderValid(e){return!0}}let CT=class extends DV{constructor(e){super(),this._languageFeaturesService=e}createModelFromProvider(e,t,i){return zl.create(this._languageFeaturesService.documentSymbolProvider,e,i)}createStickyModel(e,t,i,n){var s;const{stickyOutlineElement:r,providerID:a}=this._stickyModelFromOutlineModel(n,(s=this._stickyModel)===null||s===void 0?void 0:s.outlineProviderId);return new xV(e.uri,t,r,a)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(rt.first(e.children.values())instanceof YW){const a=rt.find(e.children.values(),l=>l.id===t);if(a)i=a.children;else{let l="",d=-1,c;for(const[h,u]of e.children.entries()){const g=this._findSumOfRangesOfGroup(u);g>d&&(c=u,d=g,l=u.id)}t=l,i=c.children}}else i=e.children;const n=[],s=Array.from(i.values()).sort((a,l)=>{const d=new N_(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),c=new N_(l.symbol.range.startLineNumber,l.symbol.range.endLineNumber);return this._comparator(d,c)});for(const a of s)n.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new rS(void 0,n,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const i=[];for(const s of e.children.values())if(s.symbol.selectionRange.startLineNumber!==s.symbol.range.endLineNumber)if(s.symbol.selectionRange.startLineNumber!==t)i.push(this._stickyModelFromOutlineElement(s,s.symbol.selectionRange.startLineNumber));else for(const r of s.children.values())i.push(this._stickyModelFromOutlineElement(r,s.symbol.selectionRange.startLineNumber));i.sort((s,r)=>this._comparator(s.range,r.range));const n=new N_(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new rS(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 zN?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};CT=fL([rv(0,Se)],CT);class kV extends DV{constructor(e){super(),this._foldingLimitReporter=new qW(e)}createStickyModel(e,t,i,n){const s=this._fromFoldingRegions(n);return new xV(e.uri,t,s,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,i=[],n=new rS(void 0,[],void 0);for(let s=0;s<t;s++){const r=e.getParentIndex(s);let a;r!==-1?a=i[r]:a=n;const l=new rS(new N_(e.getStartLineNumber(s),e.getEndLineNumber(s)+1),[],a);a.children.push(l),i.push(l)}return n}}let wT=class extends kV{constructor(e,t){super(e),this._languageConfigurationService=t}createModelFromProvider(e,t,i){return new FR(e,this._languageConfigurationService,this._foldingLimitReporter).compute(i)}};wT=fL([rv(1,Wt)],wT);let ST=class extends kV{constructor(e,t){super(e),this._languageFeaturesService=t}isProviderValid(e){return _l.getFoldingRangeProviders(this._languageFeaturesService,e).length>0}createModelFromProvider(e,t,i){const n=_l.getFoldingRangeProviders(this._languageFeaturesService,e);return new WR(e,n,()=>this.createModelFromProvider(e,t,i),this._foldingLimitReporter,void 0).compute(i)}};ST=fL([rv(1,Se)],ST);var h0e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},r3=function(o,e){return function(t,i){e(t,i,o)}};class u0e{constructor(e,t,i){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=i}}let yT=class extends K{constructor(e,t,i){super(),this._languageFeaturesService=t,this._languageConfigurationService=i,this._onDidChangeStickyScroll=this._register(new W),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._options=null,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new se),this._updateSoon=this._register(new Rt(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(114)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._stickyModelProvider=null,this._sessionStore.clear(),this._options=this._editor.getOption(114),this._options.enabled&&(this._stickyModelProvider=this._sessionStore.add(new bT(this._editor,this._languageConfigurationService,this._languageFeaturesService,this._options.defaultModel)),this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,this._onDidChangeStickyScroll.fire(),this.update()})),this._sessionStore.add(this._editor.onDidChangeHiddenAreas(()=>this.update())),this._sessionStore.add(this._editor.onDidChangeModelContent(()=>this._updateSoon.schedule())),this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>this.update())),this.update())}getVersionId(){var e;return(e=this._model)===null||e===void 0?void 0:e.version}async update(){var e;(e=this._cts)===null||e===void 0||e.dispose(!0),this._cts=new Wi,await this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()}async updateStickyModel(e){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization()){this._model=null;return}const t=this._editor.getModel(),i=t.getVersionId(),n=await this._stickyModelProvider.update(t,i,e);e.isCancellationRequested||(this._model=n)}updateIndex(e){return e===-1?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,t,i,n,s){if(t.children.length===0)return;let r=s;const a=[];for(let c=0;c<t.children.length;c++){const h=t.children[c];h.range&&a.push(h.range.startLineNumber)}const l=this.updateIndex(M_(a,e.startLineNumber,(c,h)=>c-h)),d=this.updateIndex(M_(a,e.startLineNumber+n,(c,h)=>c-h));for(let c=l;c<=d;c++){const h=t.children[c];if(!h)return;if(h.range){const u=h.range.startLineNumber,g=h.range.endLineNumber;e.startLineNumber<=g+1&&u-1<=e.endLineNumber&&u!==r&&(r=u,i.push(new u0e(u,g-1,n+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,h,i,n+1,u))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,h,i,n,s)}}getCandidateStickyLinesIntersecting(e){var t,i;if(!(!((t=this._model)===null||t===void 0)&&t.element))return[];let n=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,n,0,-1);const s=(i=this._editor._getViewModel())===null||i===void 0?void 0:i.getHiddenAreas();if(s)for(const r of s)n=n.filter(a=>!(a.startLineNumber>=r.startLineNumber&&a.endLineNumber<=r.endLineNumber+1));return n}};yT=h0e([r3(1,Se),r3(2,Wt)],yT);var g0e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Ag=function(o,e){return function(t,i){e(t,i,o)}},LT;let vl=LT=class extends K{constructor(e,t,i,n,s,r,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=i,this._instaService=n,this._contextKeyService=a,this._sessionStore=new se,this._foldingModel=null,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._showEndForLine=null,this._stickyScrollWidget=new l0e(this._editor),this._stickyLineCandidateProvider=new yT(this._editor,i,s),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=new i3([],[],0),this._readConfiguration();const l=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration(c=>{(c.hasChanged(114)||c.hasChanged(72)||c.hasChanged(66)||c.hasChanged(109))&&this._readConfiguration()})),this._register(Q(l,ge.CONTEXT_MENU,async c=>{this._onContextMenu(Ue(l),c)})),this._stickyScrollFocusedContextKey=M.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=M.stickyScrollVisible.bindTo(this._contextKeyService);const d=this._register(dl(l));this._register(d.onDidBlur(c=>{this._positionRevealed===!1&&l.clientHeight===0?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()})),this._register(d.onDidFocus(c=>{this.focus()})),this._registerMouseListeners(),this._register(Q(l,ge.MOUSE_DOWN,c=>{this._onMouseDown=!0}))}static get(e){return e.getContribution(LT.ID)}_disposeFocusStickyScrollStore(){var e;this._stickyScrollFocusedContextKey.set(!1),(e=this._focusDisposableStore)===null||e===void 0||e.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}focus(){if(this._onMouseDown){this._onMouseDown=!1,this._editor.focus();return}this._stickyScrollFocusedContextKey.get()!==!0&&(this._focused=!0,this._focusDisposableStore=new se,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(k.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new se),t=this._register(new Ry(this._editor,{extractLineNumberFromMouseEvent:s=>{const r=this._stickyScrollWidget.getEditorPositionFromNode(s.target.element);return r?r.lineNumber:0}})),i=s=>{if(!this._editor.hasModel()||s.target.type!==12||s.target.detail!==this._stickyScrollWidget.getId())return null;const r=s.target.element;if(!r||r.innerText!==r.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(r);return a?{range:new k(a.lineNumber,a.column,a.lineNumber,a.column+r.innerText.length),textElement:r}:null},n=this._stickyScrollWidget.getDomNode();this._register(vi(n,ge.CLICK,s=>{if(s.ctrlKey||s.altKey||s.metaKey||!s.leftButton)return;if(s.shiftKey){const d=this._stickyScrollWidget.getLineIndexFromChildDomNode(s.target);if(d===null)return;const c=new V(this._endLineNumbers[d],1);this._revealLineInCenterIfOutsideViewport(c);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(s.target)){const d=this._stickyScrollWidget.getLineNumberFromChildDomNode(s.target);this._toggleFoldingRegionForLine(d);return}if(!this._stickyScrollWidget.isInStickyLine(s.target))return;let l=this._stickyScrollWidget.getEditorPositionFromNode(s.target);if(!l){const d=this._stickyScrollWidget.getLineNumberFromChildDomNode(s.target);if(d===null)return;l=new V(d,1)}this._revealPosition(l)})),this._register(vi(n,ge.MOUSE_MOVE,s=>{if(s.shiftKey){const r=this._stickyScrollWidget.getLineIndexFromChildDomNode(s.target);if(r===null||this._showEndForLine!==null&&this._showEndForLine===r)return;this._showEndForLine=r,this._renderStickyScroll();return}this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(Q(n,ge.MOUSE_LEAVE,s=>{this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([s,r])=>{const a=i(s);if(!a||!s.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 c=new Wi;e.add(Ae(()=>c.dispose(!0)));let h;Wy(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new V(l.startLineNumber,l.startColumn+1),c.token).then(u=>{if(!c.token.isCancellationRequested)if(u.length!==0){this._candidateDefinitionsLength=u.length;const g=d;h!==g?(e.clear(),h=g,h.style.textDecoration="underline",e.add(Ae(()=>{h.style.textDecoration="none"}))):h||(h=g,h.style.textDecoration="underline",e.add(Ae(()=>{h.style.textDecoration="none"})))}else e.clear()})})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(async s=>{if(s.target.type!==12||s.target.detail!==this._stickyScrollWidget.getId())return;const r=this._stickyScrollWidget.getEditorPositionFromNode(s.target.element);r&&(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:r.lineNumber,column:1})),this._instaService.invokeFunction(sV,s,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor}))}))}_onContextMenu(e,t){const i=new lr(e,t);this._contextMenuService.showContextMenu({menuId:N.StickyScrollContext,getAnchor:()=>i})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getStickyLineForLine(e),i=t?.foldingIcon;if(!i)return;zW(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(66)*t.index+1;this._editor.setScrollTop(n),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(114);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=null,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=null,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(67).renderType===2&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=null,this._renderStickyScroll(-1)}))}_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(-1)}_onDidResize(){const t=this._editor.getLayoutInfo().height/this._editor.getOption(66);this._maxStickyLines=Math.round(t*.25)}async _renderStickyScroll(e=1/0){var t,i;const n=this._editor.getModel();if(!n||n.isTooLargeForTokenization()){this._foldingModel=null,this._stickyScrollWidget.setState(void 0,null,e);return}const s=this._stickyLineCandidateProvider.getVersionId();if(s===void 0||s===n.getVersionId())if(this._foldingModel=(i=await((t=_l.get(this._editor))===null||t===void 0?void 0:t.getFoldingModel()))!==null&&i!==void 0?i:null,this._widgetState=this.findScrollWidgetState(),this._stickyScrollVisibleContextKey.set(this._widgetState.startLineNumbers.length!==0),!this._focused)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e);else if(this._focusedStickyElementIndex===-1)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const r=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(r)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}}findScrollWidgetState(){const e=this._editor.getOption(66),t=Math.min(this._maxStickyLines,this._editor.getOption(114).maxLineCount),i=this._editor.getScrollTop();let n=0;const s=[],r=[],a=this._editor.getVisibleRanges();if(a.length!==0){const l=new N_(a[0].startLineNumber,a[a.length-1].endLineNumber),d=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(l);for(const c of d){const h=c.startLineNumber,u=c.endLineNumber,g=c.nestingDepth;if(u-h>0){const f=(g-1)*e,m=g*e,_=this._editor.getBottomForLineNumber(h)-i,v=this._editor.getTopForLineNumber(u)-i,b=this._editor.getBottomForLineNumber(u)-i;if(f>v&&f<=b){s.push(h),r.push(u+1),n=b-m;break}else m>_&&m<=b&&(s.push(h),r.push(u+1));if(s.length===t)break}}}return this._endLineNumbers=r,new i3(s,r,n,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}};vl.ID="store.contrib.stickyScrollController";vl=LT=g0e([Ag(1,Yo),Ag(2,Se),Ag(3,Oe),Ag(4,Wt),Ag(5,Zo),Ag(6,We)],vl);class f0e extends ko{constructor(){super({id:"editor.action.toggleStickyScroll",title:{value:p("toggleStickyScroll","Toggle Sticky Scroll"),mnemonicTitle:p({},"&&Toggle Sticky Scroll"),original:"Toggle Sticky Scroll"},category:r0e.View,toggled:{condition:te.equals("config.editor.stickyScroll.enabled",!0),title:p("stickyScroll","Sticky Scroll"),mnemonicTitle:p({},"&&Sticky Scroll")},menu:[{id:N.CommandPalette},{id:N.MenubarAppearanceMenu,group:"4_editor",order:3},{id:N.StickyScrollContext}]})}async run(e){const t=e.get(ft),i=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",i)}}const pL=100;class p0e extends aa{constructor(){super({id:"editor.action.focusStickyScroll",title:{value:p("focusStickyScroll","Focus Sticky Scroll"),mnemonicTitle:p({},"&&Focus Sticky Scroll"),original:"Focus Sticky Scroll"},precondition:te.and(te.has("config.editor.stickyScroll.enabled"),M.stickyScrollVisible),menu:[{id:N.CommandPalette}]})}runEditorCommand(e,t){var i;(i=vl.get(t))===null||i===void 0||i.focus()}}class m0e extends aa{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:{value:p("selectNextStickyScrollLine.title","Select next sticky scroll line"),original:"Select next sticky scroll line"},precondition:M.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:pL,primary:18}})}runEditorCommand(e,t){var i;(i=vl.get(t))===null||i===void 0||i.focusNext()}}class _0e extends aa{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:{value:p("selectPreviousStickyScrollLine.title","Select previous sticky scroll line"),original:"Select previous sticky scroll line"},precondition:M.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:pL,primary:16}})}runEditorCommand(e,t){var i;(i=vl.get(t))===null||i===void 0||i.focusPrevious()}}class v0e extends aa{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:{value:p("goToFocusedStickyScrollLine.title","Go to focused sticky scroll line"),original:"Go to focused sticky scroll line"},precondition:M.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:pL,primary:3}})}runEditorCommand(e,t){var i;(i=vl.get(t))===null||i===void 0||i.goToFocused()}}class b0e extends aa{constructor(){super({id:"editor.action.selectEditor",title:{value:p("selectEditor.title","Select Editor"),original:"Select Editor"},precondition:M.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:pL,primary:9}})}runEditorCommand(e,t){var i;(i=vl.get(t))===null||i===void 0||i.selectEditor()}}yt(vl.ID,vl,1);Xt(f0e);Xt(p0e);Xt(_0e);Xt(m0e);Xt(v0e);Xt(b0e);var tA=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},mu=function(o,e){return function(t,i){e(t,i,o)}},Bh;class C0e{constructor(e,t,i,n,s,r){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=n,this.command=s,this.completion=r}}let xT=class extends bz{constructor(e,t,i,n,s,r){super(s.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=n,this._suggestMemoryService=r}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(){var e;const t=[],{items:i}=this.completionModel,n=this._suggestMemoryService.select(this.model,{lineNumber:this.line,column:this.word.endColumn+this.completionModel.lineContext.characterCountDelta},i),s=rt.slice(i,n),r=rt.slice(i,0,n);let a=5;for(const l of rt.concat(s,r)){if(l.score===Xr.Default)continue;const d=new k(l.editStart.lineNumber,l.editStart.column,l.editInsertEnd.lineNumber,l.editInsertEnd.column+this.completionModel.lineContext.characterCountDelta),c=l.completion.insertTextRules&&l.completion.insertTextRules&4?{snippet:l.completion.insertText}:l.completion.insertText;t.push(new C0e(d,c,(e=l.filterTextLow)!==null&&e!==void 0?e:l.labelLow,l.completion.additionalTextEdits,l.completion.command,l)),a-->=0&&l.resolve(st.None)}return t}};xT=tA([mu(5,Qy)],xT);let DT=class{constructor(e,t,i,n){this._getEditorOption=e,this._languageFeatureService=t,this._clipboardService=i,this._suggestMemoryService=n}async provideInlineCompletions(e,t,i,n){var s;if(i.selectedSuggestionInfo)return;const r=this._getEditorOption(88,e);if(ff.isAllOff(r))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(ff.valueFor(r,l)!=="inline")return;let d=e.getWordAtPosition(t),c;if(d?.word||(c=this._getTriggerCharacterInfo(e,t)),!d?.word&&!c||(d||(d=e.getWordUntilPosition(t)),d.endColumn!==t.column))return;let h;const u=e.getValueInRange(new k(t.lineNumber,1,t.lineNumber,t.column));if(!c&&(!((s=this._lastResult)===null||s===void 0)&&s.canBeReused(e,t.lineNumber,d))){const g=new X5(u,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=g,this._lastResult.acquire(),h=this._lastResult}else{const g=await HR(this._languageFeatureService.completionProvider,e,t,new G0(void 0,void 0,c?.providers),c&&{triggerKind:1,triggerCharacter:c.ch},n);let f;g.needsClipboard&&(f=await this._clipboardService.readText());const m=new Gd(g.items,t.column,new X5(u,0),zr.None,this._getEditorOption(117,e),this._getEditorOption(111,e),{boostFullMatch:!1,firstMatchCanBeWeak:!1},f);h=new xT(e,t.lineNumber,d,m,g,this._suggestMemoryService)}return this._lastResult=h,h}handleItemDidShow(e,t){t.completion.resolve(st.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var i;const n=e.getValueInRange(k.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),s=new Set;for(const r of this._languageFeatureService.completionProvider.all(e))!((i=r.triggerCharacters)===null||i===void 0)&&i.includes(n)&&s.add(r);if(s.size!==0)return{providers:s,ch:n}}};DT=tA([mu(1,Se),mu(2,Sd),mu(3,Qy)],DT);let aS=Bh=class{constructor(e,t,i,n){if(++Bh._counter===1){const s=n.createInstance(DT,(r,a)=>{var l;return((l=i.listCodeEditors().find(c=>c.getModel()===a))!==null&&l!==void 0?l:e).getOption(r)});Bh._disposable=t.inlineCompletionsProvider.register("*",s)}}dispose(){var e;--Bh._counter===0&&((e=Bh._disposable)===null||e===void 0||e.dispose(),Bh._disposable=void 0)}};aS._counter=0;aS=Bh=tA([mu(1,Se),mu(2,Dt),mu(3,Oe)],aS);yt("suggest.inlineCompletionsProvider",aS,0);class w0e extends we{constructor(){super({id:"editor.action.forceRetokenize",label:p("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 Hn;i.tokenization.forceTokenization(i.getLineCount()),n.stop(),console.log(`tokenization took ${n.elapsed()}`)}}de(w0e);class mL extends ko{constructor(){super({id:mL.ID,title:{value:p({},"Toggle Tab Key Moves Focus"),original:"Toggle Tab Key Moves Focus"},precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},f1:!0})}run(){const t=!Jf.getTabFocusMode();Jf.setTabFocusMode(t),js(t?p("toggle.tabMovesFocus.on","Pressing Tab will now move focus to the next focusable element"):p("toggle.tabMovesFocus.off","Pressing Tab will now insert the tab character"))}}mL.ID="editor.action.toggleTabFocusMode";Xt(mL);var S0e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},y0e=function(o,e){return function(t,i){e(t,i,o)}};let kT=class extends K{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){var s;super(),this._link=t,this._enabled=!0,this.el=ie(e,pe("a.monaco-link",{tabIndex:(s=t.tabIndex)!==null&&s!==void 0?s:0,href:t.href,title:t.title},t.label)),this.el.setAttribute("role","button");const r=this._register(new at(this.el,"click")),a=this._register(new at(this.el,"keypress")),l=fe.chain(a.event,h=>h.map(u=>new Gt(u)).filter(u=>u.keyCode===3)),d=this._register(new at(this.el,Bt.Tap)).event;this._register(Ot.addTarget(this.el));const c=fe.any(r.event,l,d);this._register(c(h=>{this.enabled&&(Je.stop(h,!0),i?.opener?i.opener(this._link.href):n.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}};kT=S0e([y0e(3,Qs)],kT);var IV=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},EV=function(o,e){return function(t,i){e(t,i,o)}};const L0e=26;let IT=class extends K{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(ET))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show({...e,onClose:()=>{var t;this.hide(),(t=e.onClose)===null||t===void 0||t.call(e)}}),this._editor.setBanner(this.banner.element,L0e)}};IT=IV([EV(1,Oe)],IT);let ET=class extends K{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(pd,{}),this.element=pe("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=pe("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){bn(this.element)}show(e){bn(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=ie(this.element,pe("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(pe(`div${Re.asCSSSelector(e.icon)}`));const n=ie(this.element,pe("div.message-container"));if(n.setAttribute("aria-hidden","true"),n.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=ie(this.element,pe("div.message-actions-container")),e.actions)for(const r of e.actions)this._register(this.instantiationService.createInstance(kT,this.messageActionsContainer,{...r,tabIndex:-1},{}));const s=ie(this.element,pe("div.action-container"));this.actionBar=this._register(new Go(s)),this.actionBar.push(this._register(new cs("banner.close","Close Banner",Re.asClassName(PB),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};ET=IV([EV(0,Oe)],ET);var iA=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},zf=function(o,e){return function(t,i){e(t,i,o)}};const x0e=Di("extensions-warning-message",he.warning,p("warningIcon","Icon shown with a warning message in the extensions editor."));let Np=class extends K{constructor(e,t,i,n){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=i,this._highlighter=null,this._bannerClosed=!1,this._updateState=s=>{if(s&&s.hasMore){if(this._bannerClosed)return;const r=Math.max(s.ambiguousCharacterCount,s.nonBasicAsciiCharacterCount,s.invisibleCharacterCount);let a;if(s.nonBasicAsciiCharacterCount>=r)a={message:p("unicodeHighlighting.thisDocumentHasManyNonBasicAsciiUnicodeCharacters","This document contains many non-basic ASCII unicode characters"),command:new em};else if(s.ambiguousCharacterCount>=r)a={message:p("unicodeHighlighting.thisDocumentHasManyAmbiguousUnicodeCharacters","This document contains many ambiguous unicode characters"),command:new gh};else if(s.invisibleCharacterCount>=r)a={message:p("unicodeHighlighting.thisDocumentHasManyInvisibleUnicodeCharacters","This document contains many invisible unicode characters"),command:new Jp};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:x0e,actions:[{label:a.command.shortLabel,href:`command:${a.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(n.createInstance(IT,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(124),this._register(i.onDidChangeTrust(s=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(s=>{s.hasChanged(124)&&(this._options=e.getOption(124),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=D0e(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"?wH:i)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new NT(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new k0e(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}};Np.ID="editor.contrib.unicodeHighlighter";Np=iA([zf(1,Lr),zf(2,P7),zf(3,Oe)],Np);function D0e(o,e){return{nonBasicASCII:e.nonBasicASCII===so?!o:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===so?!o:e.includeComments,includeStrings:e.includeStrings===so?!o:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let NT=class extends K{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 Rt(()=>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:lS.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!lM(t,e))return null;const i=t.getValueInRange(e.range);return{reason:NV(i,this._options),inComment:dM(t,e),inString:cM(t,e)}}};NT=iA([zf(3,Lr)],NT);class k0e extends K{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 Rt(()=>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 s=S2.computeUnicodeHighlights(this._model,this._options,n);for(const r of s.ranges)i.ranges.push(r);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||s.hasMore}if(!i.hasMore)for(const n of i.ranges)t.push({range:n,options:lS.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 lM(t,e)?{reason:NV(i,this._options),inComment:dM(t,e),inString:cM(t,e)}:null}}let TT=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(Np.ID);if(!n)return[];const s=[],r=new Set;let a=300;for(const l of t){const d=n.getDecorationInfo(l);if(!d)continue;const h=i.getValueInRange(l.range).codePointAt(0),u=xD(h);let g;switch(d.reason.kind){case 0:{uv(d.reason.confusableWith)?g=p("unicodeHighlight.characterIsAmbiguousASCII","The character {0} could be confused with the ASCII character {1}, which is more common in source code.",u,xD(d.reason.confusableWith.codePointAt(0))):g=p("unicodeHighlight.characterIsAmbiguous","The character {0} could be confused with the character {1}, which is more common in source code.",u,xD(d.reason.confusableWith.codePointAt(0)));break}case 1:g=p("unicodeHighlight.characterIsInvisible","The character {0} is invisible.",u);break;case 2:g=p("unicodeHighlight.characterIsNonBasicAscii","The character {0} is not a basic ASCII character.",u);break}if(r.has(g))continue;r.add(g);const f={codePoint:h,reason:d.reason,inComment:d.inComment,inString:d.inString},m=p("unicodeHighlight.adjustSettings","Adjust settings"),_=`command:${Yv.ID}?${encodeURIComponent(JSON.stringify(f))}`,v=new Fn("",!0).appendMarkdown(g).appendText(" ").appendLink(_,m);s.push(new Kr(this,l.range,[v],!1,a++))}return s}renderHoverParts(e,t){return dW(e,t,this._editor,this._languageService,this._openerService)}};TT=iA([zf(1,ni),zf(2,Qs)],TT);function MT(o){return`U+${o.toString(16).padStart(4,"0")}`}function xD(o){let e=`\`${MT(o)}\``;return tl.isInvisibleCharacter(o)||(e+=` "${`${I0e(o)}`}"`),e}function I0e(o){return o===96?"`` ` ``":"`"+String.fromCodePoint(o)+"`"}function NV(o,e){return S2.computeUnicodeHighlightReason(o,e)}class lS{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=Ze.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}}lS.instance=new lS;class E0e extends we{constructor(){super({id:gh.ID,label:p("action.unicodeHighlight.disableHighlightingInComments","Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=p("unicodeHighlight.disableHighlightingInComments.shortLabel","Disable Highlight In Comments")}async run(e,t,i){const n=e?.get(ft);n&&this.runAction(n)}async runAction(e){await e.updateValue(Cs.includeComments,!1,2)}}class N0e extends we{constructor(){super({id:gh.ID,label:p("action.unicodeHighlight.disableHighlightingInStrings","Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=p("unicodeHighlight.disableHighlightingInStrings.shortLabel","Disable Highlight In Strings")}async run(e,t,i){const n=e?.get(ft);n&&this.runAction(n)}async runAction(e){await e.updateValue(Cs.includeStrings,!1,2)}}class gh extends we{constructor(){super({id:gh.ID,label:p("action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters","Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=p("unicodeHighlight.disableHighlightingOfAmbiguousCharacters.shortLabel","Disable Ambiguous Highlight")}async run(e,t,i){const n=e?.get(ft);n&&this.runAction(n)}async runAction(e){await e.updateValue(Cs.ambiguousCharacters,!1,2)}}gh.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";class Jp extends we{constructor(){super({id:Jp.ID,label:p("action.unicodeHighlight.disableHighlightingOfInvisibleCharacters","Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=p("unicodeHighlight.disableHighlightingOfInvisibleCharacters.shortLabel","Disable Invisible Highlight")}async run(e,t,i){const n=e?.get(ft);n&&this.runAction(n)}async runAction(e){await e.updateValue(Cs.invisibleCharacters,!1,2)}}Jp.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";class em extends we{constructor(){super({id:em.ID,label:p("action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters","Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=p("unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters.shortLabel","Disable Non ASCII Highlight")}async run(e,t,i){const n=e?.get(ft);n&&this.runAction(n)}async runAction(e){await e.updateValue(Cs.nonBasicASCII,!1,2)}}em.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";class Yv extends we{constructor(){super({id:Yv.ID,label:p("action.unicodeHighlight.showExcludeOptions","Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}async run(e,t,i){const{codePoint:n,reason:s,inString:r,inComment:a}=i,l=String.fromCodePoint(n),d=e.get(dh),c=e.get(ft);function h(f){return tl.isInvisibleCharacter(f)?p("unicodeHighlight.excludeInvisibleCharFromBeingHighlighted","Exclude {0} (invisible character) from being highlighted",MT(f)):p("unicodeHighlight.excludeCharFromBeingHighlighted","Exclude {0} from being highlighted",`${MT(f)} "${l}"`)}const u=[];if(s.kind===0)for(const f of s.notAmbiguousInLocales)u.push({label:p("unicodeHighlight.allowCommonCharactersInLanguage",'Allow unicode characters that are more common in the language "{0}".',f),run:async()=>{M0e(c,[f])}});if(u.push({label:h(n),run:()=>T0e(c,[n])}),a){const f=new E0e;u.push({label:f.label,run:async()=>f.runAction(c)})}else if(r){const f=new N0e;u.push({label:f.label,run:async()=>f.runAction(c)})}if(s.kind===0){const f=new gh;u.push({label:f.label,run:async()=>f.runAction(c)})}else if(s.kind===1){const f=new Jp;u.push({label:f.label,run:async()=>f.runAction(c)})}else if(s.kind===2){const f=new em;u.push({label:f.label,run:async()=>f.runAction(c)})}else R0e(s);const g=await d.pick(u,{title:p("unicodeHighlight.configureUnicodeHighlightOptions","Configure Unicode Highlight Options")});g&&await g.run()}}Yv.ID="editor.action.unicodeHighlight.showExcludeOptions";async function T0e(o,e){const t=o.getValue(Cs.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const n of e)i[String.fromCodePoint(n)]=!0;await o.updateValue(Cs.allowedCharacters,i,2)}async function M0e(o,e){var t;const i=(t=o.inspect(Cs.allowedLocales).user)===null||t===void 0?void 0:t.value;let n;typeof i=="object"&&i?n=Object.assign({},i):n={};for(const s of e)n[s]=!0;await o.updateValue(Cs.allowedLocales,n,2)}function R0e(o){throw new Error(`Unexpected value: ${o}`)}de(gh);de(Jp);de(em);de(Yv);yt(Np.ID,Np,1);hg.register(TT);var A0e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},a3=function(o,e){return function(t,i){e(t,i,o)}};const TV="ignoreUnusualLineTerminators";function P0e(o,e,t){o.setModelProperty(e.uri,TV,t)}function O0e(o,e){return o.getModelProperty(e.uri,TV)}let av=class extends K{constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(125),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(125)&&(this._config=this._editor.getOption(125),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()||O0e(this._codeEditorService,e)===!0||this._editor.getOption(90))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:p("unusualLineTerminators.title","Unusual Line Terminators"),message:p("unusualLineTerminators.message","Detected unusual line terminators"),detail:p("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`.",qo(e.uri)),primaryButton:p({key:"unusualLineTerminators.fix",comment:["&& denotes a mnemonic"]},"&&Remove Unusual Line Terminators"),cancelButton:p("unusualLineTerminators.ignore","Ignore")})}finally{this._isPresentingDialog=!1}if(!i.confirmed){P0e(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}};av.ID="editor.contrib.unusualLineTerminatorsDetector";av=A0e([a3(1,Dv),a3(2,Dt)],av);yt(av.ID,av,1);var MV=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},r1=function(o,e){return function(t,i){e(t,i,o)}},Ei,RT;const _L=new be("hasWordHighlights",!1);function RV(o,e,t,i){const n=o.ordered(e);return c2(n.map(s=>()=>Promise.resolve(s.provideDocumentHighlights(e,t,i)).then(void 0,Mi)),Bn).then(s=>{if(s){const r=new xi;return r.set(e.uri,s),r}return new xi})}function F0e(o,e,t,i,n,s){const r=o.ordered(e);return c2(r.map(a=>()=>{const l=s.filter(d=>mM(a.selector,d.uri,d.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(a.provideMultiDocumentHighlights(e,t,l,n)).then(void 0,Mi)}),a=>a instanceof xi&&a.size>0)}class nA{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=Zi(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new k(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}isValid(e,t,i){const n=t.startLineNumber,s=t.startColumn,r=t.endColumn,a=this._getCurrentWordRange(e,t);let l=!!(this._wordRange&&this._wordRange.equalsRange(a));for(let d=0,c=i.length;!l&&d<c;d++){const h=i.getRange(d);h&&h.startLineNumber===n&&h.startColumn<=s&&h.endColumn>=r&&(l=!0)}return l}cancel(){this.result.cancel()}}class B0e extends nA{constructor(e,t,i,n){super(e,t,i),this._providers=n}_compute(e,t,i,n){return RV(this._providers,e,t.getPosition(),n).then(s=>s||new xi)}}class W0e extends nA{constructor(e,t,i,n,s){super(e,t,i),this._providers=n,this._otherModels=s}_compute(e,t,i,n){return F0e(this._providers,e,t.getPosition(),i,n,this._otherModels).then(s=>s||new xi)}}class AV extends nA{constructor(e,t,i,n,s){super(e,t,n),this._otherModels=s,this._selectionIsEmpty=t.isEmpty(),this._word=i}_compute(e,t,i,n){return Mc(250,n).then(()=>{const s=new xi;let r;if(this._word?r=this._word:r=e.getWordAtPosition(t.getPosition()),!r)return new xi;const a=[e,...this._otherModels];for(const l of a){if(l.isDisposed())continue;const c=l.findMatches(r.word,!0,!1,!0,i,!1).map(h=>({range:h.range,kind:W_.Text}));c&&s.set(l.uri,c)}return s})}isValid(e,t,i){const n=t.isEmpty();return this._selectionIsEmpty!==n?!1:super.isValid(e,t,i)}}function V0e(o,e,t,i,n){return o.has(e)?new B0e(e,t,n,o):new AV(e,t,i,n,[])}function H0e(o,e,t,i,n,s){return o.has(e)?new W0e(e,t,n,o,s):new AV(e,t,i,n,s)}Cl("_executeDocumentHighlights",async(o,e,t)=>{const i=o.get(Se),n=await RV(i.documentHighlightProvider,e,t,st.None);return n?.get(e.uri)});let lv=Ei=class{constructor(e,t,i,n,s){this.toUnhook=new se,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new xi,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this.providers=t,this.multiDocumentProviders=i,this.codeEditorService=s,this._hasWordHighlights=_L.bindTo(n),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(80),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(r=>{this._ignorePositionChangeEvent||this.occurrencesHighlight!=="off"&&this._onPositionChanged(r)})),this.toUnhook.add(e.onDidChangeModelContent(r=>{this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(r=>{!r.newModelUrl&&r.oldModelUrl?this._stopSingular():Ei.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(r=>{const a=this.editor.getOption(80);this.occurrencesHighlight!==a&&(this.occurrencesHighlight=a,this._stopAll())})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,Ei.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(){this.occurrencesHighlight!=="off"&&this._run()}_getSortedHighlights(){return this.decorations.getRanges().sort(k.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),i=(e.findIndex(s=>s.containsPosition(this.editor.getPosition()))+1)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const s=this._getWord();if(s){const r=this.editor.getModel().getLineContent(n.startLineNumber);js(`${r}, ${i+1} of ${e.length} for '${s.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),i=(e.findIndex(s=>s.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 s=this._getWord();if(s){const r=this.editor.getModel().getLineContent(n.startLineNumber);js(`${r}, ${i+1} of ${e.length} for '${s.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=Ei.storedDecorations.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),Ei.storedDecorations.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(){const e=this.codeEditorService.listCodeEditors();for(const t of e){if(!t.hasModel())continue;const i=Ei.storedDecorations.get(t.getModel().uri);if(!i)continue;t.removeDecorations(i),Ei.storedDecorations.delete(t.getModel().uri);const n=md.get(t);n?.wordHighlighter&&n.wordHighlighter.decorations.length>0&&(n.wordHighlighter.decorations.clear(),n.wordHighlighter._hasWordHighlights.set(!1))}}_stopSingular(){var e,t,i,n;this._removeSingleDecorations(),this.editor.hasWidgetFocus()&&(((e=this.editor.getModel())===null||e===void 0?void 0:e.uri.scheme)!==Ye.vscodeNotebookCell&&((i=(t=Ei.query)===null||t===void 0?void 0:t.modelInfo)===null||i===void 0?void 0:i.model.uri.scheme)!==Ye.vscodeNotebookCell?(Ei.query=null,this._run()):!((n=Ei.query)===null||n===void 0)&&n.modelInfo&&(Ei.query.modelInfo=null)),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_stopAll(){this._removeAllDecorations(),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){var t;if(this.occurrencesHighlight==="off"){this._stopAll();return}if(e.reason!==3&&((t=this.editor.getModel())===null||t===void 0?void 0:t.uri.scheme)!==Ye.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===Ye.vscodeNotebookCell){const s=[],r=this.codeEditorService.listCodeEditors();for(const a of r){const l=a.getModel();l&&l!==e&&l.uri.scheme===Ye.vscodeNotebookCell&&s.push(l)}return s}const i=[],n=this.codeEditorService.listCodeEditors();for(const s of n){if(!_de(s))continue;const r=s.getModel();r&&e===r.modified&&i.push(r.modified)}if(i.length)return i;if(this.occurrencesHighlight==="singleFile")return[];for(const s of n){const r=s.getModel();r&&r!==e&&i.push(r)}return i}_run(){var e,t;let i;if(this.editor.hasWidgetFocus()){const n=this.editor.getSelection();if(!n||n.startLineNumber!==n.endLineNumber){this._stopAll();return}const s=n.startColumn,r=n.endColumn,a=this._getWord();if(!a||a.startColumn>s||a.endColumn<r){Ei.query=null,this._stopAll();return}i=this.workerRequest&&this.workerRequest.isValid(this.model,n,this.decorations),Ei.query={modelInfo:{model:this.model,selection:n},word:a}}else if(Ei.query===null)return;if(this.lastCursorPositionChangeTime=new Date().getTime(),i)this.workerRequestCompleted&&this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1,this._beginRenderDecorations());else{this._stopAll();const n=++this.workerRequestTokenId;this.workerRequestCompleted=!1;const s=this.getOtherModelsToHighlight(this.editor.getModel()),r=!!(!Ei.query.modelInfo&&Ei.query.word||((e=Ei.query.modelInfo)===null||e===void 0?void 0:e.model.uri)!==this.model.uri);!Ei.query.modelInfo||Ei.query.modelInfo.model.uri!==this.model.uri?this.workerRequest=this.computeWithModel(this.model,this.editor.getSelection(),r?Ei.query.word:null,s):this.workerRequest=this.computeWithModel(Ei.query.modelInfo.model,Ei.query.modelInfo.selection,Ei.query.word,s),(t=this.workerRequest)===null||t===void 0||t.result.then(a=>{n===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=a||[],this._beginRenderDecorations())},Ge)}}computeWithModel(e,t,i,n){return n.length?H0e(this.multiDocumentProviders,e,t,i,this.editor.getOption(129),n):V0e(this.providers,e,t,i,this.editor.getOption(129))}_beginRenderDecorations(){const e=new Date().getTime(),t=this.lastCursorPositionChangeTime+250;e>=t?(this.renderDecorationsTimer=-1,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},t-e)}renderDecorations(){var e,t,i;this.renderDecorationsTimer=-1;const n=this.codeEditorService.listCodeEditors();for(const s of n){const r=md.get(s);if(!r)continue;const a=[],l=(e=s.getModel())===null||e===void 0?void 0:e.uri;if(l&&this.workerRequestValue.has(l)){const d=Ei.storedDecorations.get(l),c=this.workerRequestValue.get(l);if(c)for(const u of c)a.push({range:u.range,options:__e(u.kind)});let h=[];s.changeDecorations(u=>{h=u.deltaDecorations(d??[],a)}),Ei.storedDecorations=Ei.storedDecorations.set(l,h),a.length>0&&((t=r.wordHighlighter)===null||t===void 0||t.decorations.set(a),(i=r.wordHighlighter)===null||i===void 0||i._hasWordHighlights.set(!0))}}}dispose(){this._stopSingular(),this.toUnhook.dispose()}};lv.storedDecorations=new xi;lv.query=null;lv=Ei=MV([r1(4,Dt)],lv);let md=RT=class extends K{static get(e){return e.getContribution(RT.ID)}constructor(e,t,i,n){super(),this._wordHighlighter=null;const s=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this._wordHighlighter=new lv(e,i.documentHighlightProvider,i.multiDocumentHighlightProvider,t,n))};this._register(e.onDidChangeModel(r=>{this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),s()})),s()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){var e;(e=this._wordHighlighter)===null||e===void 0||e.moveNext()}moveBack(){var e;(e=this._wordHighlighter)===null||e===void 0||e.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore()}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}};md.ID="editor.contrib.wordHighlighter";md=RT=MV([r1(1,We),r1(2,Se),r1(3,Dt)],md);class PV extends we{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=md.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class z0e extends PV{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:p("wordHighlight.next.label","Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:_L,kbOpts:{kbExpr:M.editorTextFocus,primary:65,weight:100}})}}class U0e extends PV{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:p("wordHighlight.previous.label","Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:_L,kbOpts:{kbExpr:M.editorTextFocus,primary:1089,weight:100}})}}class $0e extends we{constructor(){super({id:"editor.action.wordHighlight.trigger",label:p("wordHighlight.trigger.label","Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:_L.toNegated(),kbOpts:{kbExpr:M.editorTextFocus,primary:0,weight:100}})}run(e,t,i){const n=md.get(t);n&&n.restoreViewState(!0)}}yt(md.ID,md,0);de(z0e);de(U0e);de($0e);class vL extends cn{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const n=$o(t.getOption(129)),s=t.getModel(),a=t.getSelections().map(l=>{const d=new V(l.positionLineNumber,l.positionColumn),c=this._move(n,s,d,this._wordNavigationType);return this._moveTo(l,c,this._inSelectionMode)});if(s.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,a.map(l=>mt.fromModelSelection(l))),a.length===1){const l=new V(a[0].positionLineNumber,a[0].positionColumn);t.revealPosition(l,0)}}_moveTo(e,t,i){return i?new xe(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new xe(t.lineNumber,t.column,t.lineNumber,t.column)}}class fh extends vL{_move(e,t,i,n){return St.moveWordLeft(e,t,i,n)}}class ph extends vL{_move(e,t,i,n){return St.moveWordRight(e,t,i,n)}}class K0e extends fh{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class j0e extends fh{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class q0e extends fh{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:te.and(M.textInputFocus,(e=te.and(_v,gy))===null||e===void 0?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class G0e extends fh{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class Z0e extends fh{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class Y0e extends fh{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:te.and(M.textInputFocus,(e=te.and(_v,gy))===null||e===void 0?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class X0e extends fh{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,n){return super._move($o(sa.wordSeparators.defaultValue),t,i,n)}}class Q0e extends fh{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,n){return super._move($o(sa.wordSeparators.defaultValue),t,i,n)}}class J0e extends ph{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class eve extends ph{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:te.and(M.textInputFocus,(e=te.and(_v,gy))===null||e===void 0?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class tve extends ph{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class ive extends ph{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class nve extends ph{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:te.and(M.textInputFocus,(e=te.and(_v,gy))===null||e===void 0?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class sve extends ph{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class ove extends ph{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,n){return super._move($o(sa.wordSeparators.defaultValue),t,i,n)}}class rve extends ph{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,n){return super._move($o(sa.wordSeparators.defaultValue),t,i,n)}}class bL extends cn{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const n=e.get(Wt);if(!t.hasModel())return;const s=$o(t.getOption(129)),r=t.getModel(),a=t.getSelections(),l=t.getOption(6),d=t.getOption(11),c=n.getLanguageConfiguration(r.getLanguageId()).getAutoClosingPairs(),h=t._getViewModel(),u=a.map(g=>{const f=this._delete({wordSeparators:s,model:r,selection:g,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(9),autoClosingBrackets:l,autoClosingQuotes:d,autoClosingPairs:c,autoClosedCharacters:h.getCursorAutoClosedCharacters()},this._wordNavigationType);return new kn(f,"")});t.pushUndoStop(),t.executeCommands(this.id,u),t.pushUndoStop()}}class sA extends bL{_delete(e,t){const i=St.deleteWordLeft(e,t);return i||new k(1,1,1,1)}}class oA extends bL{_delete(e,t){const i=St.deleteWordRight(e,t);if(i)return i;const n=e.model.getLineCount(),s=e.model.getLineMaxColumn(n);return new k(n,s,n,s)}}class ave extends sA{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:M.writable})}}class lve extends sA{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:M.writable})}}class dve extends sA{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:M.writable,kbOpts:{kbExpr:M.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class cve extends oA{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:M.writable})}}class hve extends oA{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:M.writable})}}class uve extends oA{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:M.writable,kbOpts:{kbExpr:M.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class gve extends we{constructor(){super({id:"deleteInsideWord",precondition:M.writable,label:p("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,t,i){if(!t.hasModel())return;const n=$o(t.getOption(129)),s=t.getModel(),a=t.getSelections().map(l=>{const d=St.deleteInsideWord(n,s,l);return new kn(d,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}ue(new K0e);ue(new j0e);ue(new q0e);ue(new G0e);ue(new Z0e);ue(new Y0e);ue(new J0e);ue(new eve);ue(new tve);ue(new ive);ue(new nve);ue(new sve);ue(new X0e);ue(new Q0e);ue(new ove);ue(new rve);ue(new ave);ue(new lve);ue(new dve);ue(new cve);ue(new hve);ue(new uve);de(gve);class fve extends bL{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:M.writable,kbOpts:{kbExpr:M.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const i=qS.deleteWordPartLeft(e);return i||new k(1,1,1,1)}}class pve extends bL{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:M.writable,kbOpts:{kbExpr:M.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const i=qS.deleteWordPartRight(e);if(i)return i;const n=e.model.getLineCount(),s=e.model.getLineMaxColumn(n);return new k(n,s,n,s)}}class OV extends vL{_move(e,t,i,n){return qS.moveWordPartLeft(e,t,i)}}class mve extends OV{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:M.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}gt.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class _ve extends OV{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:M.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}gt.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class FV extends vL{_move(e,t,i,n){return qS.moveWordPartRight(e,t,i)}}class vve extends FV{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:M.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class bve extends FV{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:M.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}ue(new fve);ue(new pve);ue(new mve);ue(new _ve);ue(new vve);ue(new bve);class AT extends K{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=zs.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(91);t||(this.editor.isSimpleWidget?t=new Fn(p("editor.simple.readonly","Cannot edit in read-only input")):t=new Fn(p("editor.readonly","Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}}AT.ID="editor.contrib.readOnlyMessageController";yt(AT.ID,AT,2);export{Sve as B,xde as E,Dde as K,Mde as M,Ide as P,Ede as R,Ade as U,u3 as _,ID as a,Ode as e,Fde as l,c6 as m,Hg as p};
|