diff --git a/.gitignore b/.gitignore index 16e0be15f8..5d7485c12b 100644 --- a/.gitignore +++ b/.gitignore @@ -61,3 +61,4 @@ spring-ai-alibaba-jmanus/ui-vue3/pnpm-lock.yaml # MCP configuration files modified_mcp_config.json +.cursorindexingignore diff --git a/spring-ai-alibaba-jmanus/pom.xml b/spring-ai-alibaba-jmanus/pom.xml index 902e39a92e..39b19cddb8 100644 --- a/spring-ai-alibaba-jmanus/pom.xml +++ b/spring-ai-alibaba-jmanus/pom.xml @@ -108,6 +108,19 @@ org.springframework.ai spring-ai-starter-mcp-client-webflux + + + + io.modelcontextprotocol.sdk + mcp + 0.11.0 + + + io.modelcontextprotocol.sdk + mcp-spring-webflux + 0.11.0 + + "),typeof _t!="string"&&!z0(_t))if(typeof _t.toString=="function"){if(_t=_t.toString(),typeof _t!="string")throw Wm("dirty is not a string, aborting")}else throw Wm("toString is not a function");if(!e.isSupported)return _t;if(mt||Jr(ie),e.removed=[],typeof _t=="string"&&(te=!1),te){if(_t.nodeName){const Ua=Ut(_t.nodeName);if(!V[Ua]||$e[Ua])throw Wm("root node is forbidden and cannot be sanitized in-place")}}else if(_t instanceof a)Fe=Fm(""),Qe=Fe.ownerDocument.importNode(_t,!0),Qe.nodeType===1&&Qe.nodeName==="BODY"||Qe.nodeName==="HTML"?Fe=Qe:Fe.appendChild(Qe);else{if(!Mt&&!ce&&!Ie&&_t.indexOf("<")===-1)return C&&yn?C.createHTML(_t):_t;if(Fe=Fm(_t),!Fe)return Mt?null:yn?w:""}Fe&&Ct&&$a(Fe.firstChild);const kr=H0(te?_t:Fe);for(;zi=kr.nextNode();)wP(zi)||(zi.content instanceof s&&Dz(zi.content),LP(zi));if(te)return _t;if(Mt){if(ci)for(gs=y.call(Fe.ownerDocument);Fe.firstChild;)gs.appendChild(Fe.firstChild);else gs=Fe;return(H.shadowroot||H.shadowrootmode)&&(gs=E.call(t,gs,!0)),gs}let vn=Ie?Fe.outerHTML:Fe.innerHTML;return Ie&&V["!doctype"]&&Fe.ownerDocument&&Fe.ownerDocument.doctype&&Fe.ownerDocument.doctype.name&&tr(P8,Fe.ownerDocument.doctype.name)&&(vn=" @@ -639,27 +639,27 @@ ${e.toString()}`}}class bS{constructor(e=new h0,t=!1,i,n=pge){var s;this._servic * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var Wme=Object.defineProperty,Vme=Object.getOwnPropertyDescriptor,Hme=Object.getOwnPropertyNames,zme=Object.prototype.hasOwnProperty,$me=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Hme(e))!zme.call(o,n)&&n!==t&&Wme(o,n,{get:()=>e[n],enumerable:!(i=Vme(e,n))||i.enumerable});return o},Ume=(o,e,t)=>($me(o,e,"default"),t),I_={};Ume(I_,k0);var TW={},tk={},MW=class{constructor(o){ri(this,"_languageId");ri(this,"_loadingTriggered");ri(this,"_lazyLoadPromise");ri(this,"_lazyLoadPromiseResolve");ri(this,"_lazyLoadPromiseReject");this._languageId=o,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}static getOrCreate(o){return tk[o]||(tk[o]=new MW(o)),tk[o]}load(){return this._loadingTriggered||(this._loadingTriggered=!0,TW[this._languageId].loader().then(o=>this._lazyLoadPromiseResolve(o),o=>this._lazyLoadPromiseReject(o))),this._lazyLoadPromise}};function Ve(o){const e=o.id;TW[e]=o,I_.languages.register(o);const t=MW.getOrCreate(e);I_.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),I_.languages.onLanguageEncountered(e,async()=>{const i=await t.load();I_.languages.setLanguageConfiguration(e,i.conf)})}Ve({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>Oe(()=>import("./abap-HeDQy6fh.js"),[])});Ve({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>Oe(()=>import("./apex-CbmXAvAW.js"),[])});Ve({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>Oe(()=>import("./azcli-BPy9tPO_.js"),[])});Ve({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>Oe(()=>import("./bat-C2kkMZXD.js"),[])});Ve({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>Oe(()=>import("./bicep-STK2XETz.js"),[])});Ve({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>Oe(()=>import("./cameligo-D88lnp7m.js"),[])});Ve({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>Oe(()=>import("./clojure-BVXjUq6W.js"),[])});Ve({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>Oe(()=>import("./coffee-BRG4GrUX.js"),[])});Ve({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>Oe(()=>import("./cpp-DeB58NaV.js"),[])});Ve({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>Oe(()=>import("./cpp-DeB58NaV.js"),[])});Ve({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>Oe(()=>import("./csharp-DWSjX1vK.js"),[])});Ve({id:"csp",extensions:[],aliases:["CSP","csp"],loader:()=>Oe(()=>import("./csp-C2dP3GFv.js"),[])});Ve({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>Oe(()=>import("./css-1NjUY7wv.js"),[])});Ve({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>Oe(()=>import("./cypher-CvujjWtm.js"),[])});Ve({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>Oe(()=>import("./dart-BE_rHeGz.js"),[])});Ve({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>Oe(()=>import("./dockerfile-DU9BjHlP.js"),[])});Ve({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>Oe(()=>import("./ecl-hUW-QHbE.js"),[])});Ve({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>Oe(()=>import("./elixir-BAkJxX25.js"),[])});Ve({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>Oe(()=>import("./flow9-C5jFnEuB.js"),[])});Ve({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>Oe(()=>import("./fsharp-CCzPE5Ie.js"),[])});Ve({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>Oe(()=>import("./freemarker2-CmSOYFZj.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(o=>o.TagAutoInterpolationDollar)});Ve({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>Oe(()=>import("./freemarker2-CmSOYFZj.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(o=>o.TagAngleInterpolationDollar)});Ve({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>Oe(()=>import("./freemarker2-CmSOYFZj.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(o=>o.TagBracketInterpolationDollar)});Ve({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>Oe(()=>import("./freemarker2-CmSOYFZj.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(o=>o.TagAngleInterpolationBracket)});Ve({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>Oe(()=>import("./freemarker2-CmSOYFZj.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(o=>o.TagBracketInterpolationBracket)});Ve({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>Oe(()=>import("./freemarker2-CmSOYFZj.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(o=>o.TagAutoInterpolationDollar)});Ve({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>Oe(()=>import("./freemarker2-CmSOYFZj.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(o=>o.TagAutoInterpolationBracket)});Ve({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>Oe(()=>import("./go-BJDrqb1l.js"),[])});Ve({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>Oe(()=>import("./graphql-DeqjH8oo.js"),[])});Ve({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>Oe(()=>import("./handlebars-BLXzbXZR.js"),__vite__mapDeps([9,1,2,3,4,5,6,7,8]))});Ve({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>Oe(()=>import("./hcl-fhYSe8Ik.js"),[])});Ve({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:()=>Oe(()=>import("./html-DO2OTq4R.js"),__vite__mapDeps([10,1,2,3,4,5,6,7,8]))});Ve({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>Oe(()=>import("./ini-bfKW7yAs.js"),[])});Ve({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>Oe(()=>import("./java-89tSEgoR.js"),[])});Ve({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>Oe(()=>import("./javascript-C0XxeR-n.js"),__vite__mapDeps([11,12,1,2,3,4,5,6,7,8]))});Ve({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>Oe(()=>import("./julia-CULLjdBi.js"),[])});Ve({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>Oe(()=>import("./kotlin-bF-WLz8W.js"),[])});Ve({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>Oe(()=>import("./less-BcX_owYs.js"),[])});Ve({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>Oe(()=>import("./lexon-Bgb1VazO.js"),[])});Ve({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>Oe(()=>import("./lua-D4wIloCQ.js"),[])});Ve({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>Oe(()=>import("./liquid-BFayS-os.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,8]))});Ve({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>Oe(()=>import("./m3-CIXVZ5K0.js"),[])});Ve({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>Oe(()=>import("./markdown-C2pIiAgT.js"),[])});Ve({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>Oe(()=>import("./mdx-DeQweMxo.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,8]))});Ve({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>Oe(()=>import("./mips-DDY3B9Me.js"),[])});Ve({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>Oe(()=>import("./msdax-BVGHujNV.js"),[])});Ve({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>Oe(()=>import("./mysql-wocE9kcw.js"),[])});Ve({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>Oe(()=>import("./objective-c-B7y1xvNi.js"),[])});Ve({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>Oe(()=>import("./pascal-6_Qmrcj5.js"),[])});Ve({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>Oe(()=>import("./pascaligo-Y4zGRFv3.js"),[])});Ve({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>Oe(()=>import("./perl-BvZxJ37z.js"),[])});Ve({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>Oe(()=>import("./pgsql-CHFmffvM.js"),[])});Ve({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>Oe(()=>import("./php-BIcBwoxY.js"),[])});Ve({id:"pla",extensions:[".pla"],loader:()=>Oe(()=>import("./pla-CjQQiOJm.js"),[])});Ve({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>Oe(()=>import("./postiats-B_GcsHt8.js"),[])});Ve({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>Oe(()=>import("./powerquery-y2EyZOlv.js"),[])});Ve({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>Oe(()=>import("./powershell-CIHf91ML.js"),[])});Ve({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>Oe(()=>import("./protobuf-COTbE6tN.js"),[])});Ve({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>Oe(()=>import("./pug-CIrW4JuG.js"),[])});Ve({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>Oe(()=>import("./python-a9hcFcOH.js"),__vite__mapDeps([15,1,2,3,4,5,6,7,8]))});Ve({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>Oe(()=>import("./qsharp-BCyDeG3W.js"),[])});Ve({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>Oe(()=>import("./r-D_s1dKTl.js"),[])});Ve({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>Oe(()=>import("./razor-1sBWwWa2.js"),__vite__mapDeps([16,1,2,3,4,5,6,7,8]))});Ve({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>Oe(()=>import("./redis-we8ROkDz.js"),[])});Ve({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>Oe(()=>import("./redshift-DQMg6JSq.js"),[])});Ve({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>Oe(()=>import("./restructuredtext-DoYentzJ.js"),[])});Ve({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>Oe(()=>import("./ruby-hSrJXfwP.js"),[])});Ve({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>Oe(()=>import("./rust-D5UdS7wL.js"),[])});Ve({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>Oe(()=>import("./sb-Bn2Vf2CV.js"),[])});Ve({id:"scala",extensions:[".scala",".sc",".sbt"],aliases:["Scala","scala","SBT","Sbt","sbt","Dotty","dotty"],mimetypes:["text/x-scala-source","text/x-scala","text/x-sbt","text/x-dotty"],loader:()=>Oe(()=>import("./scala-D-F3YBtN.js"),[])});Ve({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>Oe(()=>import("./scheme-CLt6TZUf.js"),[])});Ve({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>Oe(()=>import("./scss-Cn8qbFRi.js"),[])});Ve({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>Oe(()=>import("./shell-Bb53obFu.js"),[])});Ve({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>Oe(()=>import("./solidity-CNXlEMqq.js"),[])});Ve({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>Oe(()=>import("./sophia-BXWm5v_b.js"),[])});Ve({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>Oe(()=>import("./sparql-C3G7U7Rs.js"),[])});Ve({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>Oe(()=>import("./sql-D_PatrnJ.js"),[])});Ve({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>Oe(()=>import("./st-Brb-FAmL.js"),[])});Ve({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>Oe(()=>import("./swift-CEFhrl9k.js"),[])});Ve({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>Oe(()=>import("./systemverilog-BJexHUqq.js"),[])});Ve({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>Oe(()=>import("./systemverilog-BJexHUqq.js"),[])});Ve({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>Oe(()=>import("./tcl-Bf9L4G3H.js"),[])});Ve({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>Oe(()=>import("./twig-DdbCxuaz.js"),[])});Ve({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>Oe(()=>import("./typescript-Cfb9k-qV.js"),__vite__mapDeps([12,1,2,3,4,5,6,7,8]))});Ve({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>Oe(()=>import("./vb-CzTmPDQx.js"),[])});Ve({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>Oe(()=>import("./wgsl-Bt_avhfa.js"),[])});Ve({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\Oe(()=>import("./xml-CXoMhdUk.js"),__vite__mapDeps([17,1,2,3,4,5,6,7,8]))});Ve({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>Oe(()=>import("./yaml-D4773nTm.js"),__vite__mapDeps([18,1,2,3,4,5,6,7,8]))});/*!----------------------------------------------------------------------------- + *-----------------------------------------------------------------------------*/var Wme=Object.defineProperty,Vme=Object.getOwnPropertyDescriptor,Hme=Object.getOwnPropertyNames,zme=Object.prototype.hasOwnProperty,$me=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Hme(e))!zme.call(o,n)&&n!==t&&Wme(o,n,{get:()=>e[n],enumerable:!(i=Vme(e,n))||i.enumerable});return o},Ume=(o,e,t)=>($me(o,e,"default"),t),I_={};Ume(I_,k0);var TW={},tk={},MW=class{constructor(o){ri(this,"_languageId");ri(this,"_loadingTriggered");ri(this,"_lazyLoadPromise");ri(this,"_lazyLoadPromiseResolve");ri(this,"_lazyLoadPromiseReject");this._languageId=o,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}static getOrCreate(o){return tk[o]||(tk[o]=new MW(o)),tk[o]}load(){return this._loadingTriggered||(this._loadingTriggered=!0,TW[this._languageId].loader().then(o=>this._lazyLoadPromiseResolve(o),o=>this._lazyLoadPromiseReject(o))),this._lazyLoadPromise}};function Ve(o){const e=o.id;TW[e]=o,I_.languages.register(o);const t=MW.getOrCreate(e);I_.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),I_.languages.onLanguageEncountered(e,async()=>{const i=await t.load();I_.languages.setLanguageConfiguration(e,i.conf)})}Ve({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>Oe(()=>import("./abap-HeDQy6fh.js"),[])});Ve({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>Oe(()=>import("./apex-CbmXAvAW.js"),[])});Ve({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>Oe(()=>import("./azcli-BPy9tPO_.js"),[])});Ve({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>Oe(()=>import("./bat-C2kkMZXD.js"),[])});Ve({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>Oe(()=>import("./bicep-STK2XETz.js"),[])});Ve({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>Oe(()=>import("./cameligo-D88lnp7m.js"),[])});Ve({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>Oe(()=>import("./clojure-BVXjUq6W.js"),[])});Ve({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>Oe(()=>import("./coffee-BRG4GrUX.js"),[])});Ve({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>Oe(()=>import("./cpp-DeB58NaV.js"),[])});Ve({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>Oe(()=>import("./cpp-DeB58NaV.js"),[])});Ve({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>Oe(()=>import("./csharp-DWSjX1vK.js"),[])});Ve({id:"csp",extensions:[],aliases:["CSP","csp"],loader:()=>Oe(()=>import("./csp-C2dP3GFv.js"),[])});Ve({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>Oe(()=>import("./css-1NjUY7wv.js"),[])});Ve({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>Oe(()=>import("./cypher-CvujjWtm.js"),[])});Ve({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>Oe(()=>import("./dart-BE_rHeGz.js"),[])});Ve({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>Oe(()=>import("./dockerfile-DU9BjHlP.js"),[])});Ve({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>Oe(()=>import("./ecl-hUW-QHbE.js"),[])});Ve({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>Oe(()=>import("./elixir-BAkJxX25.js"),[])});Ve({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>Oe(()=>import("./flow9-C5jFnEuB.js"),[])});Ve({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>Oe(()=>import("./fsharp-CCzPE5Ie.js"),[])});Ve({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>Oe(()=>import("./freemarker2-Fqn3AWTa.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(o=>o.TagAutoInterpolationDollar)});Ve({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>Oe(()=>import("./freemarker2-Fqn3AWTa.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(o=>o.TagAngleInterpolationDollar)});Ve({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>Oe(()=>import("./freemarker2-Fqn3AWTa.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(o=>o.TagBracketInterpolationDollar)});Ve({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>Oe(()=>import("./freemarker2-Fqn3AWTa.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(o=>o.TagAngleInterpolationBracket)});Ve({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>Oe(()=>import("./freemarker2-Fqn3AWTa.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(o=>o.TagBracketInterpolationBracket)});Ve({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>Oe(()=>import("./freemarker2-Fqn3AWTa.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(o=>o.TagAutoInterpolationDollar)});Ve({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>Oe(()=>import("./freemarker2-Fqn3AWTa.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(o=>o.TagAutoInterpolationBracket)});Ve({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>Oe(()=>import("./go-BJDrqb1l.js"),[])});Ve({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>Oe(()=>import("./graphql-DeqjH8oo.js"),[])});Ve({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>Oe(()=>import("./handlebars-Bh8Xfrzy.js"),__vite__mapDeps([9,1,2,3,4,5,6,7,8]))});Ve({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>Oe(()=>import("./hcl-fhYSe8Ik.js"),[])});Ve({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:()=>Oe(()=>import("./html-CCilUiDy.js"),__vite__mapDeps([10,1,2,3,4,5,6,7,8]))});Ve({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>Oe(()=>import("./ini-bfKW7yAs.js"),[])});Ve({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>Oe(()=>import("./java-89tSEgoR.js"),[])});Ve({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>Oe(()=>import("./javascript-BJumLL0S.js"),__vite__mapDeps([11,12,1,2,3,4,5,6,7,8]))});Ve({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>Oe(()=>import("./julia-CULLjdBi.js"),[])});Ve({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>Oe(()=>import("./kotlin-bF-WLz8W.js"),[])});Ve({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>Oe(()=>import("./less-BcX_owYs.js"),[])});Ve({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>Oe(()=>import("./lexon-Bgb1VazO.js"),[])});Ve({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>Oe(()=>import("./lua-D4wIloCQ.js"),[])});Ve({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>Oe(()=>import("./liquid-DMSYRB3x.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,8]))});Ve({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>Oe(()=>import("./m3-CIXVZ5K0.js"),[])});Ve({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>Oe(()=>import("./markdown-C2pIiAgT.js"),[])});Ve({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>Oe(()=>import("./mdx-BJdIIkYZ.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,8]))});Ve({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>Oe(()=>import("./mips-DDY3B9Me.js"),[])});Ve({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>Oe(()=>import("./msdax-BVGHujNV.js"),[])});Ve({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>Oe(()=>import("./mysql-wocE9kcw.js"),[])});Ve({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>Oe(()=>import("./objective-c-B7y1xvNi.js"),[])});Ve({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>Oe(()=>import("./pascal-6_Qmrcj5.js"),[])});Ve({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>Oe(()=>import("./pascaligo-Y4zGRFv3.js"),[])});Ve({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>Oe(()=>import("./perl-BvZxJ37z.js"),[])});Ve({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>Oe(()=>import("./pgsql-CHFmffvM.js"),[])});Ve({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>Oe(()=>import("./php-BIcBwoxY.js"),[])});Ve({id:"pla",extensions:[".pla"],loader:()=>Oe(()=>import("./pla-CjQQiOJm.js"),[])});Ve({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>Oe(()=>import("./postiats-B_GcsHt8.js"),[])});Ve({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>Oe(()=>import("./powerquery-y2EyZOlv.js"),[])});Ve({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>Oe(()=>import("./powershell-CIHf91ML.js"),[])});Ve({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>Oe(()=>import("./protobuf-COTbE6tN.js"),[])});Ve({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>Oe(()=>import("./pug-CIrW4JuG.js"),[])});Ve({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>Oe(()=>import("./python-CV0R8G3r.js"),__vite__mapDeps([15,1,2,3,4,5,6,7,8]))});Ve({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>Oe(()=>import("./qsharp-BCyDeG3W.js"),[])});Ve({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>Oe(()=>import("./r-D_s1dKTl.js"),[])});Ve({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>Oe(()=>import("./razor-Bjnu6Wx0.js"),__vite__mapDeps([16,1,2,3,4,5,6,7,8]))});Ve({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>Oe(()=>import("./redis-we8ROkDz.js"),[])});Ve({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>Oe(()=>import("./redshift-DQMg6JSq.js"),[])});Ve({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>Oe(()=>import("./restructuredtext-DoYentzJ.js"),[])});Ve({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>Oe(()=>import("./ruby-hSrJXfwP.js"),[])});Ve({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>Oe(()=>import("./rust-D5UdS7wL.js"),[])});Ve({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>Oe(()=>import("./sb-Bn2Vf2CV.js"),[])});Ve({id:"scala",extensions:[".scala",".sc",".sbt"],aliases:["Scala","scala","SBT","Sbt","sbt","Dotty","dotty"],mimetypes:["text/x-scala-source","text/x-scala","text/x-sbt","text/x-dotty"],loader:()=>Oe(()=>import("./scala-D-F3YBtN.js"),[])});Ve({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>Oe(()=>import("./scheme-CLt6TZUf.js"),[])});Ve({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>Oe(()=>import("./scss-Cn8qbFRi.js"),[])});Ve({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>Oe(()=>import("./shell-Bb53obFu.js"),[])});Ve({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>Oe(()=>import("./solidity-CNXlEMqq.js"),[])});Ve({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>Oe(()=>import("./sophia-BXWm5v_b.js"),[])});Ve({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>Oe(()=>import("./sparql-C3G7U7Rs.js"),[])});Ve({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>Oe(()=>import("./sql-D_PatrnJ.js"),[])});Ve({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>Oe(()=>import("./st-Brb-FAmL.js"),[])});Ve({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>Oe(()=>import("./swift-CEFhrl9k.js"),[])});Ve({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>Oe(()=>import("./systemverilog-BJexHUqq.js"),[])});Ve({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>Oe(()=>import("./systemverilog-BJexHUqq.js"),[])});Ve({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>Oe(()=>import("./tcl-Bf9L4G3H.js"),[])});Ve({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>Oe(()=>import("./twig-DdbCxuaz.js"),[])});Ve({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>Oe(()=>import("./typescript-CCDjWNWW.js"),__vite__mapDeps([12,1,2,3,4,5,6,7,8]))});Ve({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>Oe(()=>import("./vb-CzTmPDQx.js"),[])});Ve({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>Oe(()=>import("./wgsl-Bt_avhfa.js"),[])});Ve({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\Oe(()=>import("./xml-Bd1t5VNd.js"),__vite__mapDeps([17,1,2,3,4,5,6,7,8]))});Ve({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>Oe(()=>import("./yaml-DW01YEKS.js"),__vite__mapDeps([18,1,2,3,4,5,6,7,8]))});/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var jme=Object.defineProperty,Kme=Object.getOwnPropertyDescriptor,qme=Object.getOwnPropertyNames,Gme=Object.prototype.hasOwnProperty,Zme=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of qme(e))!Gme.call(o,n)&&n!==t&&jme(o,n,{get:()=>e[n],enumerable:!(i=Kme(e,n))||i.enumerable});return o},Yme=(o,e,t)=>(Zme(o,e,"default"),t),xm={};Yme(xm,k0);var LR=class{constructor(e,t,i){ri(this,"_onDidChange",new xm.Emitter);ri(this,"_options");ri(this,"_modeConfiguration");ri(this,"_languageId");this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this.options}get options(){return this._options}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(e){this.setOptions(e)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},DR={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},xR={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},AW=new LR("css",DR,xR),RW=new LR("scss",DR,xR),PW=new LR("less",DR,xR);xm.languages.css={cssDefaults:AW,lessDefaults:PW,scssDefaults:RW};function kR(){return Oe(()=>import("./cssMode-CAKGNCPU.js"),__vite__mapDeps([19,1,2,3,4,5,6,7,8]))}xm.languages.onLanguage("less",()=>{kR().then(o=>o.setupMode(PW))});xm.languages.onLanguage("scss",()=>{kR().then(o=>o.setupMode(RW))});xm.languages.onLanguage("css",()=>{kR().then(o=>o.setupMode(AW))});/*!----------------------------------------------------------------------------- + *-----------------------------------------------------------------------------*/var jme=Object.defineProperty,Kme=Object.getOwnPropertyDescriptor,qme=Object.getOwnPropertyNames,Gme=Object.prototype.hasOwnProperty,Zme=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of qme(e))!Gme.call(o,n)&&n!==t&&jme(o,n,{get:()=>e[n],enumerable:!(i=Kme(e,n))||i.enumerable});return o},Yme=(o,e,t)=>(Zme(o,e,"default"),t),xm={};Yme(xm,k0);var LR=class{constructor(e,t,i){ri(this,"_onDidChange",new xm.Emitter);ri(this,"_options");ri(this,"_modeConfiguration");ri(this,"_languageId");this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this.options}get options(){return this._options}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(e){this.setOptions(e)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},DR={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},xR={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},AW=new LR("css",DR,xR),RW=new LR("scss",DR,xR),PW=new LR("less",DR,xR);xm.languages.css={cssDefaults:AW,lessDefaults:PW,scssDefaults:RW};function kR(){return Oe(()=>import("./cssMode-CyVr8zw9.js"),__vite__mapDeps([19,1,2,3,4,5,6,7,8]))}xm.languages.onLanguage("less",()=>{kR().then(o=>o.setupMode(PW))});xm.languages.onLanguage("scss",()=>{kR().then(o=>o.setupMode(RW))});xm.languages.onLanguage("css",()=>{kR().then(o=>o.setupMode(AW))});/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var Xme=Object.defineProperty,Qme=Object.getOwnPropertyDescriptor,Jme=Object.getOwnPropertyNames,e_e=Object.prototype.hasOwnProperty,t_e=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Jme(e))!e_e.call(o,n)&&n!==t&&Xme(o,n,{get:()=>e[n],enumerable:!(i=Qme(e,n))||i.enumerable});return o},i_e=(o,e,t)=>(t_e(o,e,"default"),t),LL={};i_e(LL,k0);var n_e=class{constructor(e,t,i){ri(this,"_onDidChange",new LL.Emitter);ri(this,"_options");ri(this,"_modeConfiguration");ri(this,"_languageId");this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},s_e={tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:void 0,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},DL={format:s_e,suggest:{},data:{useDefaultDataProvider:!0}};function xL(o){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:o===nv,documentFormattingEdits:o===nv,documentRangeFormattingEdits:o===nv}}var nv="html",J5="handlebars",e3="razor",OW=kL(nv,DL,xL(nv)),o_e=OW.defaults,FW=kL(J5,DL,xL(J5)),r_e=FW.defaults,BW=kL(e3,DL,xL(e3)),a_e=BW.defaults;LL.languages.html={htmlDefaults:o_e,razorDefaults:a_e,handlebarDefaults:r_e,htmlLanguageService:OW,handlebarLanguageService:FW,razorLanguageService:BW,registerHTMLLanguageService:kL};function l_e(){return Oe(()=>import("./htmlMode-BTRUnrkS.js"),__vite__mapDeps([20,1,2,3,4,5,6,7,8]))}function kL(o,e=DL,t=xL(o)){const i=new n_e(o,e,t);let n;const s=LL.languages.onLanguage(o,async()=>{n=(await l_e()).setupMode(i)});return{defaults:i,dispose(){s.dispose(),n==null||n.dispose(),n=void 0}}}/*!----------------------------------------------------------------------------- + *-----------------------------------------------------------------------------*/var Xme=Object.defineProperty,Qme=Object.getOwnPropertyDescriptor,Jme=Object.getOwnPropertyNames,e_e=Object.prototype.hasOwnProperty,t_e=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Jme(e))!e_e.call(o,n)&&n!==t&&Xme(o,n,{get:()=>e[n],enumerable:!(i=Qme(e,n))||i.enumerable});return o},i_e=(o,e,t)=>(t_e(o,e,"default"),t),LL={};i_e(LL,k0);var n_e=class{constructor(e,t,i){ri(this,"_onDidChange",new LL.Emitter);ri(this,"_options");ri(this,"_modeConfiguration");ri(this,"_languageId");this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},s_e={tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:void 0,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},DL={format:s_e,suggest:{},data:{useDefaultDataProvider:!0}};function xL(o){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:o===nv,documentFormattingEdits:o===nv,documentRangeFormattingEdits:o===nv}}var nv="html",J5="handlebars",e3="razor",OW=kL(nv,DL,xL(nv)),o_e=OW.defaults,FW=kL(J5,DL,xL(J5)),r_e=FW.defaults,BW=kL(e3,DL,xL(e3)),a_e=BW.defaults;LL.languages.html={htmlDefaults:o_e,razorDefaults:a_e,handlebarDefaults:r_e,htmlLanguageService:OW,handlebarLanguageService:FW,razorLanguageService:BW,registerHTMLLanguageService:kL};function l_e(){return Oe(()=>import("./htmlMode-QYjw8OOv.js"),__vite__mapDeps([20,1,2,3,4,5,6,7,8]))}function kL(o,e=DL,t=xL(o)){const i=new n_e(o,e,t);let n;const s=LL.languages.onLanguage(o,async()=>{n=(await l_e()).setupMode(i)});return{defaults:i,dispose(){s.dispose(),n==null||n.dispose(),n=void 0}}}/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var d_e=Object.defineProperty,c_e=Object.getOwnPropertyDescriptor,u_e=Object.getOwnPropertyNames,h_e=Object.prototype.hasOwnProperty,g_e=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of u_e(e))!h_e.call(o,n)&&n!==t&&d_e(o,n,{get:()=>e[n],enumerable:!(i=c_e(e,n))||i.enumerable});return o},f_e=(o,e,t)=>(g_e(o,e,"default"),t),I0={};f_e(I0,k0);var p_e=class{constructor(e,t,i){ri(this,"_onDidChange",new I0.Emitter);ri(this,"_diagnosticsOptions");ri(this,"_modeConfiguration");ri(this,"_languageId");this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},m_e={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},__e={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},WW=new p_e("json",m_e,__e);I0.languages.json={jsonDefaults:WW};function v_e(){return Oe(()=>import("./jsonMode-BNPGVg0I.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,8]))}I0.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});I0.languages.onLanguage("json",()=>{v_e().then(o=>o.setupMode(WW))});/*!----------------------------------------------------------------------------- + *-----------------------------------------------------------------------------*/var d_e=Object.defineProperty,c_e=Object.getOwnPropertyDescriptor,u_e=Object.getOwnPropertyNames,h_e=Object.prototype.hasOwnProperty,g_e=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of u_e(e))!h_e.call(o,n)&&n!==t&&d_e(o,n,{get:()=>e[n],enumerable:!(i=c_e(e,n))||i.enumerable});return o},f_e=(o,e,t)=>(g_e(o,e,"default"),t),I0={};f_e(I0,k0);var p_e=class{constructor(e,t,i){ri(this,"_onDidChange",new I0.Emitter);ri(this,"_diagnosticsOptions");ri(this,"_modeConfiguration");ri(this,"_languageId");this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},m_e={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},__e={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},WW=new p_e("json",m_e,__e);I0.languages.json={jsonDefaults:WW};function v_e(){return Oe(()=>import("./jsonMode-D895wvia.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,8]))}I0.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});I0.languages.onLanguage("json",()=>{v_e().then(o=>o.setupMode(WW))});/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var b_e=Object.defineProperty,C_e=Object.getOwnPropertyDescriptor,w_e=Object.getOwnPropertyNames,S_e=Object.prototype.hasOwnProperty,y_e=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of w_e(e))!S_e.call(o,n)&&n!==t&&b_e(o,n,{get:()=>e[n],enumerable:!(i=C_e(e,n))||i.enumerable});return o},L_e=(o,e,t)=>(y_e(o,e,"default"),t),D_e="5.0.2",Qp={};L_e(Qp,k0);var VW=(o=>(o[o.None=0]="None",o[o.CommonJS=1]="CommonJS",o[o.AMD=2]="AMD",o[o.UMD=3]="UMD",o[o.System=4]="System",o[o.ES2015=5]="ES2015",o[o.ESNext=99]="ESNext",o))(VW||{}),HW=(o=>(o[o.None=0]="None",o[o.Preserve=1]="Preserve",o[o.React=2]="React",o[o.ReactNative=3]="ReactNative",o[o.ReactJSX=4]="ReactJSX",o[o.ReactJSXDev=5]="ReactJSXDev",o))(HW||{}),zW=(o=>(o[o.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",o[o.LineFeed=1]="LineFeed",o))(zW||{}),$W=(o=>(o[o.ES3=0]="ES3",o[o.ES5=1]="ES5",o[o.ES2015=2]="ES2015",o[o.ES2016=3]="ES2016",o[o.ES2017=4]="ES2017",o[o.ES2018=5]="ES2018",o[o.ES2019=6]="ES2019",o[o.ES2020=7]="ES2020",o[o.ESNext=99]="ESNext",o[o.JSON=100]="JSON",o[o.Latest=99]="Latest",o))($W||{}),UW=(o=>(o[o.Classic=1]="Classic",o[o.NodeJs=2]="NodeJs",o))(UW||{}),jW=class{constructor(o,e,t,i,n){ri(this,"_onDidChange",new Qp.Emitter);ri(this,"_onDidExtraLibsChange",new Qp.Emitter);ri(this,"_extraLibs");ri(this,"_removedExtraLibs");ri(this,"_eagerModelSync");ri(this,"_compilerOptions");ri(this,"_diagnosticsOptions");ri(this,"_workerOptions");ri(this,"_onDidExtraLibsChangeTimeout");ri(this,"_inlayHintsOptions");ri(this,"_modeConfiguration");this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(o),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(n),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(o,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===o)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:o,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let n=this._extraLibs[t];n&&n.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(o){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),o&&o.length>0)for(const e of o){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let n=1;this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:n}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(o){this._compilerOptions=o||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(o){this._diagnosticsOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(o){this._workerOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(o){this._inlayHintsOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(o){}setEagerModelSync(o){this._eagerModelSync=o}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(o){this._modeConfiguration=o||Object.create(null),this._onDidChange.fire(void 0)}},x_e=D_e,KW={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},qW=new jW({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},KW),GW=new jW({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},KW),k_e=()=>IL().then(o=>o.getTypeScriptWorker()),I_e=()=>IL().then(o=>o.getJavaScriptWorker());Qp.languages.typescript={ModuleKind:VW,JsxEmit:HW,NewLineKind:zW,ScriptTarget:$W,ModuleResolutionKind:UW,typescriptVersion:x_e,typescriptDefaults:qW,javascriptDefaults:GW,getTypeScriptWorker:k_e,getJavaScriptWorker:I_e};function IL(){return Oe(()=>import("./tsMode-_F3d8JBS.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,8]))}Qp.languages.onLanguage("typescript",()=>IL().then(o=>o.setupTypeScript(qW)));Qp.languages.onLanguage("javascript",()=>IL().then(o=>o.setupJavaScript(GW)));class E_e extends Qo{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:{value:p("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),original:"Toggle Collapse Unchanged Regions"},icon:ve.map,toggled:ae.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:ae.has("isInDiffEditor"),menu:{when:ae.has("isInDiffEditor"),id:N.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Dt),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}mi(E_e);class ZW extends Qo{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:{value:p("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),original:"Toggle Show Moved Code Blocks"},precondition:ae.has("isInDiffEditor")})}run(e,...t){const i=e.get(Dt),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}mi(ZW);class YW extends Qo{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:ae.has("isInDiffEditor")})}run(e,...t){const i=e.get(Dt),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}mi(YW);zn.appendMenuItem(N.EditorTitle,{command:{id:new YW().desc.id,title:p("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:ae.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:ae.has("isInDiffEditor")},order:11,group:"1_diff",when:ae.and(T.diffEditorRenderSideBySideInlineBreakpointReached,ae.has("isInDiffEditor"))});zn.appendMenuItem(N.EditorTitle,{command:{id:new ZW().desc.id,title:p("showMoves","Show Moved Code Blocks"),icon:ve.move,toggled:gm.create("config.diffEditor.experimental.showMoves",!0),precondition:ae.has("isInDiffEditor")},order:10,group:"1_diff",when:ae.has("isInDiffEditor")});const EL={value:p("diffEditor","Diff Editor"),original:"Diff Editor"};class N_e extends Wa{constructor(){super({id:"diffEditor.switchSide",title:{value:p("switchSide","Switch Side"),original:"Switch Side"},icon:ve.arrowSwap,precondition:ae.has("isInDiffEditor"),f1:!0,category:EL})}runEditorCommand(e,t,i){const n=Im(e);if(n instanceof vu){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}mi(N_e);class T_e extends Wa{constructor(){super({id:"diffEditor.exitCompareMove",title:{value:p("exitCompareMove","Exit Compare Move"),original:"Exit Compare Move"},icon:ve.close,precondition:T.comparingMovedCode,f1:!1,category:EL,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=Im(e);n instanceof vu&&n.exitCompareMove()}}mi(T_e);class M_e extends Wa{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:{value:p("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),original:"Collapse All Unchanged Regions"},icon:ve.fold,precondition:ae.has("isInDiffEditor"),f1:!0,category:EL})}runEditorCommand(e,t,...i){const n=Im(e);n instanceof vu&&n.collapseAllUnchangedRegions()}}mi(M_e);class A_e extends Wa{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:{value:p("showAllUnchangedRegions","Show All Unchanged Regions"),original:"Show All Unchanged Regions"},icon:ve.unfold,precondition:ae.has("isInDiffEditor"),f1:!0,category:EL})}runEditorCommand(e,t,...i){const n=Im(e);n instanceof vu&&n.showAllUnchangedRegions()}}mi(A_e);const XW={value:p("accessibleDiffViewer","Accessible Diff Viewer"),original:"Accessible Diff Viewer"};class km extends Qo{constructor(){super({id:km.id,title:{value:p("editor.action.accessibleDiffViewer.next","Go to Next Difference"),original:"Go to Next Difference"},category:XW,precondition:ae.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=Im(e);t==null||t.accessibleDiffViewerNext()}}km.id="editor.action.accessibleDiffViewer.next";zn.appendMenuItem(N.EditorTitle,{command:{id:km.id,title:p("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:ae.has("isInDiffEditor")},order:10,group:"2_diff",when:ae.and(T.accessibleDiffViewerVisible.negate(),ae.has("isInDiffEditor"))});class E0 extends Qo{constructor(){super({id:E0.id,title:{value:p("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),original:"Go to Previous Difference"},category:XW,precondition:ae.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=Im(e);t==null||t.accessibleDiffViewerPrev()}}E0.id="editor.action.accessibleDiffViewer.prev";function Im(o){var e;const t=o.get(Ot),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=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},O_e=function(o,e){return function(t,i){e(t,i,o)}},oT;const NL=new De("selectionAnchorSet",!1);let $d=oT=class{static get(e){return e.getContribution(oT.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=NL.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(Ae.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new as().appendText(p("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),mo(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(Ae.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()}};$d.ID="editor.contrib.selectionAnchorController";$d=oT=P_e([O_e(1,Xe)],$d);class F_e extends Te{constructor(){super({id:"editor.action.setSelectionAnchor",label:p("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:T.editorTextFocus,primary:fn(2089,2080),weight:100}})}async run(e,t){var i;(i=$d.get(t))===null||i===void 0||i.setSelectionAnchor()}}class B_e extends Te{constructor(){super({id:"editor.action.goToSelectionAnchor",label:p("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:NL})}async run(e,t){var i;(i=$d.get(t))===null||i===void 0||i.goToSelectionAnchor()}}class W_e extends Te{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:p("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:NL,kbOpts:{kbExpr:T.editorTextFocus,primary:fn(2089,2089),weight:100}})}async run(e,t){var i;(i=$d.get(t))===null||i===void 0||i.selectFromAnchorToCursor()}}class V_e extends Te{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:p("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:NL,kbOpts:{kbExpr:T.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=$d.get(t))===null||i===void 0||i.cancelSelectionAnchor()}}At($d.ID,$d,4);_e(F_e);_e(B_e);_e(W_e);_e(V_e);const H_e=M("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},p("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class z_e extends Te{constructor(){super({id:"editor.action.jumpToBracket",label:p("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:T.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=$r.get(t))===null||i===void 0||i.jumpToBracket()}}class $_e extends Te{constructor(){super({id:"editor.action.selectToBracket",label:p("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:fG("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=$r.get(t))===null||n===void 0||n.selectToBracket(s)}}class U_e extends Te{constructor(){super({id:"editor.action.removeBrackets",label:p("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:T.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=$r.get(t))===null||i===void 0||i.removeBrackets(this.id)}}class j_e{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}class $r extends q{static get(e){return e.getContribution($r.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Yt(()=>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 Ae(r.lineNumber,r.column,r.lineNumber,r.column):new Ae(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 u=a;a=l,l=u}}a&&l&&i.push(new Ae(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 u=0,h=e.length;u1&&s.sort(z.compare);const a=[];let l=0,d=0;const c=n.length;for(let u=0,h=s.length;u0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}_e(Z_e);const pg="9_cutcopypaste",Y_e=Ml||document.queryCommandSupported("cut"),JW=Ml||document.queryCommandSupported("copy"),X_e=typeof navigator.clipboard>"u"||pr?document.queryCommandSupported("paste"):!0;function IR(o){return o.register(),o}const Q_e=Y_e?IR(new pm({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:Ml?{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:pg,title:p("actions.clipboard.cutLabel","Cut"),when:T.writable,order:1},{menuId:N.CommandPalette,group:"",title:p("actions.clipboard.cutLabel","Cut"),order:1},{menuId:N.SimpleEditorContext,group:pg,title:p("actions.clipboard.cutLabel","Cut"),when:T.writable,order:1}]})):void 0,J_e=JW?IR(new pm({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:Ml?{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:pg,title:p("actions.clipboard.copyLabel","Copy"),order:2},{menuId:N.CommandPalette,group:"",title:p("actions.clipboard.copyLabel","Copy"),order:1},{menuId:N.SimpleEditorContext,group:pg,title:p("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;zn.appendMenuItem(N.MenubarEditMenu,{submenu:N.MenubarCopy,title:{value:p("copy as","Copy As"),original:"Copy As"},group:"2_ccp",order:3});zn.appendMenuItem(N.EditorContext,{submenu:N.EditorContextCopy,title:{value:p("copy as","Copy As"),original:"Copy As"},group:pg,order:3});zn.appendMenuItem(N.EditorContext,{submenu:N.EditorContextShare,title:{value:p("share","Share"),original:"Share"},group:"11_share",order:-1,when:ae.and(ae.notEquals("resourceScheme","output"),T.editorTextFocus)});zn.appendMenuItem(N.EditorTitleContext,{submenu:N.EditorTitleContextShare,title:{value:p("share","Share"),original:"Share"},group:"11_share",order:-1});zn.appendMenuItem(N.ExplorerContext,{submenu:N.ExplorerContextShare,title:{value:p("share","Share"),original:"Share"},group:"11_share",order:-1});const ik=X_e?IR(new pm({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:Ml?{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:pg,title:p("actions.clipboard.pasteLabel","Paste"),when:T.writable,order:4},{menuId:N.CommandPalette,group:"",title:p("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:N.SimpleEditorContext,group:pg,title:p("actions.clipboard.pasteLabel","Paste"),when:T.writable,order:4}]})):void 0;class eve extends Te{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:T.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(37)&&t.getSelection().isEmpty()||(rE.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),rE.forceCopyWithSyntaxHighlighting=!1)}}function eV(o,e){o&&(o.addImplementation(1e4,"code-editor",(t,i)=>{const n=t.get(Ot).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)=>(fm().execCommand(e),!0)))}eV(Q_e,"cut");eV(J_e,"copy");ik&&(ik.addImplementation(1e4,"code-editor",(o,e)=>{const t=o.get(Ot),i=o.get(Xd),n=t.getFocusedCodeEditor();return n&&n.hasTextFocus()?!n.getContainerDomNode().ownerDocument.execCommand("paste")&&Tu?(async()=>{const r=await i.readText();if(r!==""){const a=$v.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}),ik.addImplementation(0,"generic-dom",(o,e)=>(fm().execCommand("paste"),!0)));JW&&_e(eve);class Ze{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+Ze.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new Ze(this.value+Ze.sep+e)}}Ze.sep=".";Ze.None=new Ze("@@none@@");Ze.Empty=new Ze("");Ze.QuickFix=new Ze("quickfix");Ze.Refactor=new Ze("refactor");Ze.RefactorExtract=Ze.Refactor.append("extract");Ze.RefactorInline=Ze.Refactor.append("inline");Ze.RefactorMove=Ze.Refactor.append("move");Ze.RefactorRewrite=Ze.Refactor.append("rewrite");Ze.Notebook=new Ze("notebook");Ze.Source=new Ze("source");Ze.SourceOrganizeImports=Ze.Source.append("organizeImports");Ze.SourceFixAll=Ze.Source.append("fixAll");Ze.SurroundWith=Ze.Refactor.append("surround");var _o;(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"})(_o||(_o={}));function tve(o,e){return!(o.include&&!o.include.intersects(e)||o.excludes&&o.excludes.some(t=>tV(e,t,o.include))||!o.includeSourceActions&&Ze.Source.contains(e))}function ive(o,e){const t=e.kind?new Ze(e.kind):void 0;return!(o.include&&(!t||!o.include.contains(t))||o.excludes&&t&&o.excludes.some(i=>tV(t,i,o.include))||!o.includeSourceActions&&t&&Ze.Source.contains(t)||o.onlyIncludePreferredActions&&!e.isPreferred)}function tV(o,e,t){return!(!e.contains(o)||t&&e.contains(t))}class gl{static fromUser(e,t){return!e||typeof e!="object"?new gl(t.kind,t.apply,!1):new gl(gl.getKindFromUser(e,t.kind),gl.getApplyFromUser(e,t.apply),gl.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 Ze(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 nve{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){en(n)}i&&(this.action.edit=i.edit)}return this}}const iV="editor.action.codeAction",ER="editor.action.quickFix",nV="editor.action.autoFix",sV="editor.action.refactor",oV="editor.action.sourceAction",NR="editor.action.organizeImports",TR="editor.action.fixAll";class sv extends q{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:ls(e.diagnostics)?ls(t.diagnostics)?sv.codeActionsPreferredComparator(e,t):-1:ls(t.diagnostics)?1:sv.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(sv.codeActionsComparator),this.validActions=this.allActions.filter(({action:n})=>!n.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&Ze.QuickFix.contains(new Ze(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 t3={actions:[],documentation:void 0};async function ov(o,e,t,i,n,s){var r;const a=i.filter||{},l={...a,excludes:[...a.excludes||[],Ze.Notebook]},d={only:(r=a.include)===null||r===void 0?void 0:r.value,trigger:i.type},c=new SR(e,s),u=i.type===2,h=sve(o,e,u?l:a),g=new de,f=h.map(async v=>{try{n.report(v);const _=await v.provideCodeActions(e,t,d,c.token);if(_&&g.add(_),c.token.isCancellationRequested)return t3;const b=((_==null?void 0:_.actions)||[]).filter(w=>w&&ive(a,w)),C=rve(v,b,a.include);return{actions:b.map(w=>new nve(w,v)),documentation:C}}catch(_){if(Fa(_))throw _;return en(_),t3}}),m=o.onDidChange(()=>{const v=o.all(e);Bi(v,h)||c.cancel()});try{const v=await Promise.all(f),_=v.map(C=>C.actions).flat(),b=[...Ia(v.map(C=>C.documentation)),...ove(o,e,i,_)];return new sv(_,b,g)}finally{m.dispose(),c.dispose()}}function sve(o,e,t){return o.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(n=>tve(t,new Ze(n))):!0)}function*ove(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 rve(o,e,t){if(!o.documentation)return;const i=o.documentation.map(n=>({kind:new Ze(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==null?void 0:n.command}for(const n of e)if(n.kind){for(const s of i)if(s.kind.contains(new Ze(n.kind)))return s.command}}var TS;(function(o){o.OnSave="onSave",o.FromProblemsView="fromProblemsView",o.FromCodeActions="fromCodeActions"})(TS||(TS={}));async function ave(o,e,t,i,n=vt.None){var s;const r=o.get(f0),a=o.get(Ri),l=o.get(vo),d=o.get(sn);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==null?void 0:i.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==TS.OnSave,showPreview:i==null?void 0:i.preview})).isApplied)&&e.action.command)try{await a.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(c){const u=lve(c);d.error(typeof u=="string"?u:p("applyCodeActionFailed","An unknown error occurred while applying the code action"))}}function lve(o){return typeof o=="string"?o:o instanceof Error&&typeof o.message=="string"?o.message:void 0}Et.registerCommand("_executeCodeActionProvider",async function(o,e,t,i,n){if(!(e instanceof ze))throw hr();const{codeActionProvider:s}=o.get(Me),r=o.get(Si).getModel(e);if(!r)throw hr();const a=Ae.isISelection(t)?Ae.liftSelection(t):k.isIRange(t)?r.validateRange(t):void 0;if(!a)throw hr();const l=typeof i=="string"?new Ze(i):void 0,d=await ov(s,r,a,{type:1,triggerAction:_o.Default,filter:{includeSourceActions:!0,include:l}},Fd.None,vt.None),c=[],u=Math.min(d.validActions.length,typeof n=="number"?n:0);for(let h=0;hh.action)}finally{setTimeout(()=>d.dispose(),100)}});var dve=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},cve=function(o,e){return function(t,i){e(t,i,o)}},rT;let MS=rT=class{constructor(e){this.keybindingService=e}getResolver(){const e=new Ru(()=>this.keybindingService.getKeybindings().filter(t=>rT.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===NR?i={kind:Ze.SourceOrganizeImports.value}:t.command===TR&&(i={kind:Ze.SourceFixAll.value}),{resolvedKeybinding:t.resolvedKeybinding,...gl.fromUser(i,{kind:Ze.None,apply:"never"})}}));return t=>{if(t.kind){const i=this.bestKeybindingForCodeAction(t,e.value);return i==null?void 0:i.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new Ze(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)}};MS.codeActionCommands=[sV,iV,oV,NR,TR];MS=rT=dve([cve(0,Xt)],MS);M("symbolIcon.arrayForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.booleanForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("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."));M("symbolIcon.colorForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.constantForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("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."));M("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."));M("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."));M("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."));M("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."));M("symbolIcon.fileForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.folderForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("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."));M("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."));M("symbolIcon.keyForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.keywordForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("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."));M("symbolIcon.moduleForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.namespaceForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.nullForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.numberForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.objectForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.operatorForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.packageForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.propertyForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.referenceForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.snippetForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.stringForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.structForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.textForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.typeParameterForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.unitForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("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 rV=Object.freeze({kind:Ze.Empty,title:p("codeAction.widget.id.more","More Actions...")}),uve=Object.freeze([{kind:Ze.QuickFix,title:p("codeAction.widget.id.quickfix","Quick Fix")},{kind:Ze.RefactorExtract,title:p("codeAction.widget.id.extract","Extract"),icon:ve.wrench},{kind:Ze.RefactorInline,title:p("codeAction.widget.id.inline","Inline"),icon:ve.wrench},{kind:Ze.RefactorRewrite,title:p("codeAction.widget.id.convert","Rewrite"),icon:ve.wrench},{kind:Ze.RefactorMove,title:p("codeAction.widget.id.move","Move"),icon:ve.wrench},{kind:Ze.SurroundWith,title:p("codeAction.widget.id.surround","Surround With"),icon:ve.symbolSnippet},{kind:Ze.Source,title:p("codeAction.widget.id.source","Source Action"),icon:ve.symbolFile},rV]);function hve(o,e,t){if(!e)return o.map(s=>{var r;return{kind:"action",item:s,group:rV,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=uve.map(s=>({group:s,actions:[]}));for(const s of o){const r=s.action.kind?new Ze(s.action.kind):Ze.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:ve.sparkle}:a,label:r.action.title,disabled:!!r.action.disabled,keybinding:t(r.action)})}}return n}var gve=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},i3=function(o,e){return function(t,i){e(t,i,o)}},aT,$f;(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})($f||($f={}));let mg=aT=class extends q{constructor(e,t,i){super(),this._editor=e,this._keybindingService=t,this._onClick=this._register(new W),this.onClick=this._onClick.event,this._state=$f.Hidden,this._iconClasses=[],this._domNode=pe("div.lightBulbWidget"),this._register(ei.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(VX(this._domNode,n=>{var s;if(this.state.type!==1)return;const r=this._editor.getOption(64).experimental.showAiIcon;if((r===so.On||r===so.OnCode)&&this.state.actions.allAIFixes&&this.state.actions.validActions.length===1){const u=this.state.actions.validActions[0].action;if(!((s=u.command)===null||s===void 0)&&s.id){i.executeCommand(u.command.id,...u.command.arguments||[]),n.preventDefault();return}}this._editor.focus(),n.preventDefault();const{top:a,height:l}=gn(this._domNode),d=this._editor.getOption(66);let c=Math.floor(d/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber{(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(ye.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{var n,s,r,a;this._preferredKbLabel=(s=(n=this._keybindingService.lookupKeybinding(nV))===null||n===void 0?void 0:n.getLabel())!==null&&s!==void 0?s:void 0,this._quickFixKbLabel=(a=(r=this._keybindingService.lookupKeybinding(ER))===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),u=jy(c,l),h=d.spaceWidth*u>22,g=m=>m>2&&this._editor.getTopForLineNumber(m)===this._editor.getTopForLineNumber(m-1);let f=r;if(!h){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 $f.Showing(e,t,i,{position:{lineNumber:f,column:s.getLineContent(f).match(/^\S\s*$/)?2:1},preference:aT._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state!==$f.Hidden&&(this.state=$f.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===so.On||a===so.OnCode)if(a===so.On&&this.state.actions.allAIFixes)if(r=ve.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=ve.lightbulbSparkleAutofix:r=ve.lightbulbAutofix,n()):this.state.actions.hasAIFix?(r=ve.lightbulbSparkle,s()):(r=ve.lightBulb,s());else this.state.actions.hasAutoFix?(r=ve.lightbulbAutofix,n()):(r=ve.lightBulb,s());this._iconClasses=Ue.asClassNameArray(r),this._domNode.classList.add(...this._iconClasses)}set title(e){this._domNode.title=e}};mg.ID="editor.contrib.lightbulbWidget";mg._posPref=[0];mg=aT=gve([i3(1,Xt),i3(2,Ri)],mg);var fve=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},n3=function(o,e){return function(t,i){e(t,i,o)}},lT;let Ud=lT=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 de,s=n.add(iL(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=Ko);const d=await lae(this._languageService,n,l),c=document.createElement("span");if(c.innerHTML=(a=(r=lT._ttpTokenizer)===null||r===void 0?void 0:r.createHTML(d))!==null&&a!==void 0?a:d,this._options.editor){const u=this._options.editor.getOption(50);Jn(c,u)}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=>aV(this._openerService,i,e.isTrusted),disposables:t}}}};Ud._ttpTokenizer=qd("tokenizeToString",{createHTML(o){return o}});Ud=lT=fve([n3(1,bi),n3(2,So)],Ud);async function aV(o,e,t){try{return await o.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:pve(t)})}catch(i){return nt(i),!1}}function pve(o){return o===!0?!0:o&&Array.isArray(o.enabledCommands)?o.enabledCommands:!1}var mve=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},s3=function(o,e){return function(t,i){e(t,i,o)}},W1;let ho=W1=class{static get(e){return e.getContribution(W1.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new An,this._messageListeners=new de,this._mouseOverMessage=!1,this._editor=e,this._visible=W1.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){mo(jc(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=jc(e)?iL(e,{actionHandler:{callback:n=>aV(this._openerService,n,jc(e)?e.isTrusted:void 0),disposables:this._messageListeners}}):void 0,this._messageWidget.value=new o3(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(ye.debounce(this._editor.onDidBlurEditorText,(n,s)=>s,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&Qn(jo(),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(J(this._messageWidget.value.getDomNode(),Se.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(J(this._messageWidget.value.getDomNode(),Se.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(o3.fadeOut(this._messageWidget.value))}};ho.ID="editor.contrib.messageController";ho.MESSAGE_VISIBLE=new De("messageVisible",!1,p("messageVisible","Whether the editor is currently showing an inline message"));ho=W1=mve([s3(1,Xe),s3(2,So)],ho);const _ve=Rn.bindToContribution(ho.get);we(new _ve({id:"leaveEditorMessage",precondition:ho.MESSAGE_VISIBLE,handler:o=>o.closeMessage(),kbOpts:{weight:130,primary:9}}));let o3=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)}};At(ho.ID,ho,4);var lV=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},dT=function(o,e){return function(t,i){e(t,i,o)}};const dV="acceptSelectedCodeAction",cV="previewSelectedCodeAction";class vve{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 cT=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 C0(e,Vo);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=Ue.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=Ee(e.group.icon.color.id))):(i.icon.className=Ue.asClassName(ve.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=uV(e.label),i.keybinding.set(e.keybinding),iQ(!!e.keybinding,i.keybinding.element);const a=(s=this._keybindingService.lookupKeybinding(dV))===null||s===void 0?void 0:s.getLabel(),l=(r=this._keybindingService.lookupKeybinding(cV))===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){}};cT=lV([dT(1,Xt)],cT);class bve extends UIEvent{constructor(){super("acceptSelectedAction")}}class r3 extends UIEvent{constructor(){super("previewSelectedAction")}}function Cve(o){if(o.kind==="action")return o.label}let uT=class extends q{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 tn),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 cT(t,this._keybindingService),new vve],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:Cve},accessibilityProvider:{getAriaLabel:l=>{if(l.kind==="action"){let d=l.label?uV(l==null?void 0: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(Fg),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 u=this.domNode.ownerDocument.getElementById(this._list.getElementID(c));if(u){u.style.width="auto";const h=u.getBoundingClientRect().width;return u.style.width="",h}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 r3:new bve;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 r3):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([])}};uT=lV([dT(4,Gd),dT(5,Xt)],uT);function uV(o){return o.replace(/\r\n|\r|\n/g," ")}var wve=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},nk=function(o,e){return function(t,i){e(t,i,o)}};M("actionBar.toggledBackground",{dark:Ih,light:Ih,hcDark:Ih,hcLight:Ih},p("actionBar.toggledBackground","Background color for toggled action items in action bar."));const _g={Visible:new De("codeActionMenuVisible",!1,p("codeActionMenuVisible","Whether the action widget list is visible"))},Hg=bt("actionWidgetService");let vg=class extends q{get isVisible(){return _g.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new An)}show(e,t,i,n,s,r,a){const l=_g.Visible.bindTo(this._contextKeyService),d=this._instantiationService.createInstance(uT,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 de,a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-block"),r.add(J(l,Se.MOUSE_DOWN,f=>f.stopPropagation()));const d=document.createElement("div"),c=e.appendChild(d);c.classList.add("context-view-pointerBlock"),r.add(J(c,Se.POINTER_MOVE,()=>c.remove())),r.add(J(c,Se.MOUSE_DOWN,()=>c.remove()));let u=0;if(i.length){const f=this._createActionBar(".action-widget-action-bar",i);f&&(s.appendChild(f.getContainer().parentElement),r.add(f),u=f.getContainer().offsetWidth)}const h=(n=this._list.value)===null||n===void 0?void 0:n.layout(u);s.style.width=`${h}px`;const g=r.add(Pl(e));return r.add(g.onDidBlur(()=>this.hide())),r}_createActionBar(e,t){if(!t.length)return;const i=pe(e),n=new Cr(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)}};vg=wve([nk(0,Gd),nk(1,Xe),nk(2,qe)],vg);xt(Hg,vg,1);const N0=1100;mi(class extends Qo{constructor(){super({id:"hideCodeActionWidget",title:{value:p("hideCodeActionWidget.title","Hide action widget"),original:"Hide action widget"},precondition:_g.Visible,keybinding:{weight:N0,primary:9,secondary:[1033]}})}run(o){o.get(Hg).hide()}});mi(class extends Qo{constructor(){super({id:"selectPrevCodeAction",title:{value:p("selectPrevCodeAction.title","Select previous action"),original:"Select previous action"},precondition:_g.Visible,keybinding:{weight:N0,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(o){const e=o.get(Hg);e instanceof vg&&e.focusPrevious()}});mi(class extends Qo{constructor(){super({id:"selectNextCodeAction",title:{value:p("selectNextCodeAction.title","Select next action"),original:"Select next action"},precondition:_g.Visible,keybinding:{weight:N0,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(o){const e=o.get(Hg);e instanceof vg&&e.focusNext()}});mi(class extends Qo{constructor(){super({id:dV,title:{value:p("acceptSelected.title","Accept selected action"),original:"Accept selected action"},precondition:_g.Visible,keybinding:{weight:N0,primary:3,secondary:[2137]}})}run(o){const e=o.get(Hg);e instanceof vg&&e.acceptSelected()}});mi(class extends Qo{constructor(){super({id:cV,title:{value:p("previewSelected.title","Preview selected action"),original:"Preview selected action"},precondition:_g.Visible,keybinding:{weight:N0,primary:2051}})}run(o){const e=o.get(Hg);e instanceof vg&&e.acceptSelected(!0)}});const hV=new De("supportedCodeAction","");class Sve extends q{constructor(e,t,i,n=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=n,this._autoTriggerTimer=this._register(new qr),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=>dA(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:_o.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)===so.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 Lh;(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(Fa(r))return gV;throw r})}cancel(){this._cancellablePromise.cancel()}}o.Triggered=e})(Lh||(Lh={}));const gV=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1});class yve extends q{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 An),this._state=Lh.Empty,this._onDidChangeState=this._register(new W),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=hV.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(Lh.Empty,!0))}_settingEnabledNearbyQuickfixes(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes",{resource:t==null?void 0:t.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(Lh.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 Sve(this._editor,this._markerService,i=>{var n;if(!i){this.setState(Lh.Empty);return}const s=i.selection.getStartPosition(),r=_n(async a=>{var l,d,c,u,h,g;if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===1&&(i.trigger.triggerAction===_o.QuickFix||!((d=(l=i.trigger.filter)===null||l===void 0?void 0:l.include)===null||d===void 0)&&d.contains(Ze.QuickFix))){const f=await ov(this._registry,e,i.selection,i.trigger,Fd.None,a),m=[...f.allActions];if(a.isCancellationRequested)return gV;if(!((c=f.validActions)===null||c===void 0?void 0:c.some(_=>_.action.kind?Ze.QuickFix.contains(new Ze(_.action.kind)):!1))){const _=this._markerService.read({resource:e.uri});if(_.length>0){const b=i.selection.getPosition();let C=b,w=Number.MAX_VALUE;const S=[...f.validActions];for(const y of _){const I=y.endColumn,E=y.endLineNumber,R=y.startLineNumber;if(E===b.lineNumber||R===b.lineNumber){C=new z(E,I);const j={type:i.trigger.type,triggerAction:i.trigger.triggerAction,filter:{include:!((u=i.trigger.filter)===null||u===void 0)&&u.include?(h=i.trigger.filter)===null||h===void 0?void 0:h.include:Ze.QuickFix},autoApply:i.trigger.autoApply,context:{notAvailableMessage:((g=i.trigger.context)===null||g===void 0?void 0:g.notAvailableMessage)||"",position:C}},O=new Ae(C.lineNumber,C.column,C.lineNumber,C.column),$=await ov(this._registry,e,O,j,Fd.None,a);if($.validActions.length!==0){for(const K of $.validActions)K.highlightRange=K.action.isPreferred;f.allActions.length===0&&m.push(...$.allActions),Math.abs(b.column-I)E.findIndex(R=>R.action.title===y.action.title)===I);return x.sort((y,I)=>y.action.isPreferred&&!I.action.isPreferred?-1:!y.action.isPreferred&&I.action.isPreferred||y.action.isAI&&!I.action.isAI?1:!y.action.isAI&&I.action.isAI?-1:0),{validActions:x,allActions:m,documentation:f.documentation,hasAutoFix:f.hasAutoFix,hasAIFix:f.hasAIFix,allAIFixes:f.allAIFixes,dispose:()=>{f.dispose()}}}}}return ov(this._registry,e,i.selection,i.trigger,Fd.None,a)});i.trigger.type===1&&((n=this._progressService)===null||n===void 0||n.showWhile(r,250)),this.setState(new Lh.Triggered(i.trigger,s,r))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:_o.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 Lve=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},id=function(o,e){return function(t,i){e(t,i,o)}},V1;const Dve="quickfix-edit-highlight";let Cu=V1=class extends q{static get(e){return e.getContribution(V1.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 An),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new yve(this._editor,s.codeActionProvider,t,i,r,l)),this._register(this._model.onDidChangeState(u=>this.update(u))),this._lightBulbWidget=new Ru(()=>{const u=this._editor.getContribution(mg.ID);return u&&this._register(u.onClick(h=>this.showCodeActionList(h.actions,h,{includeDisabledActions:!1,fromLightbulb:!0}))),u}),this._resolver=n.createInstance(MS),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=ho.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(ave,e,TS.FromCodeActions,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:_o.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){nt(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 u=this.tryGetValidActionToApply(e.trigger,d);if(u){try{(s=this._lightBulbWidget.value)===null||s===void 0||s.hide(),await this._applyCodeAction(u,!1,!1)}finally{d.dispose()}return}if(e.trigger.context){const h=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,d);if(h&&h.action.disabled){(r=ho.get(this._editor))===null||r===void 0||r.showMessage(h.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=ho.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=z.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 u;if(await d.resolve(c),!c.isCancellationRequested)return{canPreview:!!(!((u=d.action.edit)===null||u===void 0)&&u.edits.length)}},onFocus:d=>{var c,u;if(d&&d.highlightRange&&d.action.diagnostics){const h=[{range:d.action.diagnostics[0],options:V1.DECORATION}];n.set(h);const g=d.action.diagnostics[0],f=(u=(c=this._editor.getModel())===null||c===void 0?void 0:c.getWordAtPosition({lineNumber:g.startLineNumber,column:g.startColumn}))===null||u===void 0?void 0:u.word;hu(p("editingNewSelection","Context: {0} at line {1} and column {2}.",f,g.startLineNumber,g.startColumn))}else n.clear()}};this._actionWidgetService.show("codeActionWidget",!0,hve(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=gn(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==null?void 0: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}};Cu.ID="editor.contrib.codeActionController";Cu.DECORATION=st.register({description:"quickfix-highlight",className:Dve});Cu=V1=Lve([id(1,Yl),id(2,Xe),id(3,qe),id(4,Me),id(5,Bu),id(6,Ri),id(7,Dt),id(8,Hg),id(9,qe)],Cu);Zr((o,e)=>{((n,s)=>{s&&e.addRule(`.monaco-editor ${n} { background-color: ${s}; }`)})(".quickfix-edit-highlight",o.getColor(wl));const i=o.getColor(Ic);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${xa(o.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});function T0(o){return ae.regex(hV.keys()[0],new RegExp("(\\s|^)"+qo(o.value)+"\\b"))}const MR={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 zg(o,e,t,i,n=_o.Default){if(o.hasModel()){const s=Cu.get(o);s==null||s.manualTriggerAtCurrentPosition(e,n,t,i)}}class xve extends Te{constructor(){super({id:ER,label:p("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:ae.and(T.writable,T.hasCodeActionsProvider),kbOpts:{kbExpr:T.textInputFocus,primary:2137,weight:100}})}run(e,t){return zg(t,p("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0,_o.QuickFix)}}class kve extends Rn{constructor(){super({id:iV,precondition:ae.and(T.writable,T.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:MR}]}})}runEditorCommand(e,t,i){const n=gl.fromUser(i,{kind:Ze.Empty,apply:"ifSingle"});return zg(t,typeof(i==null?void 0: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 Ive extends Te{constructor(){super({id:sV,label:p("refactor.label","Refactor..."),alias:"Refactor...",precondition:ae.and(T.writable,T.hasCodeActionsProvider),kbOpts:{kbExpr:T.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:ae.and(T.writable,T0(Ze.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:MR}]}})}run(e,t,i){const n=gl.fromUser(i,{kind:Ze.Refactor,apply:"never"});return zg(t,typeof(i==null?void 0: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:Ze.Refactor.contains(n.kind)?n.kind:Ze.None,onlyIncludePreferredActions:n.preferred},n.apply,_o.Refactor)}}class Eve extends Te{constructor(){super({id:oV,label:p("source.label","Source Action..."),alias:"Source Action...",precondition:ae.and(T.writable,T.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:ae.and(T.writable,T0(Ze.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:MR}]}})}run(e,t,i){const n=gl.fromUser(i,{kind:Ze.Source,apply:"never"});return zg(t,typeof(i==null?void 0: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:Ze.Source.contains(n.kind)?n.kind:Ze.None,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply,_o.SourceAction)}}class Nve extends Te{constructor(){super({id:NR,label:p("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:ae.and(T.writable,T0(Ze.SourceOrganizeImports)),kbOpts:{kbExpr:T.textInputFocus,primary:1581,weight:100}})}run(e,t){return zg(t,p("editor.action.organize.noneMessage","No organize imports action available"),{include:Ze.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",_o.OrganizeImports)}}class Tve extends Te{constructor(){super({id:TR,label:p("fixAll.label","Fix All"),alias:"Fix All",precondition:ae.and(T.writable,T0(Ze.SourceFixAll))})}run(e,t){return zg(t,p("fixAll.noneMessage","No fix all action available"),{include:Ze.SourceFixAll,includeSourceActions:!0},"ifSingle",_o.FixAll)}}class Mve extends Te{constructor(){super({id:nV,label:p("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:ae.and(T.writable,T0(Ze.QuickFix)),kbOpts:{kbExpr:T.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return zg(t,p("editor.action.autoFix.noneMessage","No auto fixes available"),{include:Ze.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",_o.AutoFix)}}At(Cu.ID,Cu,3);At(mg.ID,mg,4);_e(xve);_e(Ive);_e(Eve);_e(Nve);_e(Mve);_e(Tve);we(new kve);xi.as(Va.Configuration).registerConfiguration({...Xy,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:p("showCodeActionHeaders","Enable/disable showing group headers in the Code Action menu."),default:!0}}});xi.as(Va.Configuration).registerConfiguration({...Xy,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 hT{constructor(){this.lenses=[],this._disposables=new de}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 fV(o,e,t){const i=o.ordered(e),n=new Map,s=new hT,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){en(d)}});return await Promise.all(r),s.lenses=s.lenses.sort((a,l)=>a.symbol.range.startLineNumberl.symbol.range.startLineNumber?1:n.get(a.provider)n.get(l.provider)?1:a.symbol.range.startColumnl.symbol.range.startColumn?1:0),s}Et.registerCommand("_executeCodeLensProvider",function(o,...e){let[t,i]=e;qt(ze.isUri(t)),qt(typeof i=="number"||!i);const{codeLensProvider:n}=o.get(Me),s=o.get(Si).getModel(t);if(!s)throw hr();const r=[],a=new de;return fV(n,s,vt.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,vt.None)).then(u=>r.push(u||c.symbol)));return Promise.all(d)}).then(()=>r).finally(()=>{setTimeout(()=>a.dispose(),100)})});var Ave=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},Rve=function(o,e){return function(t,i){e(t,i,o)}};const pV=bt("ICodeLensCache");class a3{constructor(e,t){this.lineCount=e,this.data=t}}let gT=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new Pu(20,.75);const t="codelens/cache";g_(Ai,()=>e.remove(t,1));const i="codelens/cache2",n=e.get(i,1,"{}");this._deserialize(n),ye.once(e.onWillSaveState)(s=>{s.reason===rb.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 hT;n.add({lenses:i,dispose:()=>{}},this._fakeProvider);const s=new a3(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 hT;r.add({lenses:s,dispose(){}},this._fakeProvider),this._cache.set(i,new a3(n.lineCount,r))}}catch{}}};gT=Ave([Rve(0,Xr)],gT);xt(pV,gT,1);class Pve{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 TL{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${TL._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{d.symbol.command&&l.push(d.symbol),i.addDecoration({range:d.symbol.range,options:l3},u=>this._decorationIds[c]=u),a?a=k.plusRange(a,d.symbol.range):a=k.lift(d.symbol.range)}),this._viewZone=new Pve(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 TL(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t==null||t.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{const 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:l3},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=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},i_=function(o,e){return function(t,i){e(t,i,o)}};let Jp=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 de,this._localToDispose=new de,this._lenses=[],this._oldCodeLensModels=new de,this._provideCodeLensDebounce=i.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=i.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new Yt(()=>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",co.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&&lu(()=>{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 Yt(()=>{var n;const s=Date.now();(n=this._getCodeLensModelPromise)===null||n===void 0||n.cancel(),this._getCodeLensModelPromise=_n(r=>fV(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()},nt)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(je(()=>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 sk;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(je(()=>{if(this._editor.getModel()){const n=Ra.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==null?void 0:s.tagName)==="SPAN"&&(s=s.parentElement),(s==null?void 0: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 sk;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=Ra.capture(this._editor),r=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const d=new sk;let c=0,u=0;for(;uthis._resolveCodeLensesInViewportSoon())),c++,u++)}for(;cthis._resolveCodeLensesInViewportSoon())),u++;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=_n(a=>{const l=i.map((d,c)=>{const u=new Array(d.length),h=d.map((g,f)=>!g.symbol.command&&typeof g.provider.resolveCodeLens=="function"?Promise.resolve(g.provider.resolveCodeLens(t,g.symbol,a)).then(m=>{u[f]=m},en):(u[f]=g.symbol,Promise.resolve(void 0)));return Promise.all(h).then(()=>{!a.isCancellationRequested&&!n[c].isDisposed()&&n[c].updateCommands(u)})});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=>{nt(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}};Jp.ID="css.editor.codeLens";Jp=Ove([i_(1,Me),i_(2,wr),i_(3,Ri),i_(4,sn),i_(5,pV)],Jp);At(Jp.ID,Jp,1);_e(class extends Te{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:T.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(Ha),n=e.get(Ri),s=e.get(sn),r=t.getSelection().positionLineNumber,a=t.getContribution(Jp.ID);if(!a)return;const l=await a.getModel();if(!l)return;const d=[];for(const h of l.lenses)h.symbol.command&&h.symbol.range.startLineNumber===r&&d.push({label:h.symbol.command.title,command:h.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 u=c.command;if(l.isDisposed){const h=await a.getModel(),g=h==null?void 0:h.lenses.find(f=>{var m;return f.symbol.range.startLineNumber===r&&((m=f.symbol.command)===null||m===void 0?void 0:m.title)===u.title});if(!g||!g.symbol.command)return;u=g.symbol.command}try{await n.executeCommand(u.id,...u.arguments||[])}catch(h){s.error(h)}}});var Fve=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},ok=function(o,e){return function(t,i){e(t,i,o)}};class AR{constructor(e,t){this._editorWorkerClient=new BM(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 Y(new kt(Math.round(255*s.red),Math.round(255*s.green),Math.round(255*s.blue),r)),l=r?Y.Format.CSS.formatRGB(a):Y.Format.CSS.formatRGBA(a),d=r?Y.Format.CSS.formatHSL(a):Y.Format.CSS.formatHSLA(a),c=r?Y.Format.CSS.formatHex(a):Y.Format.CSS.formatHexA(a),u=[];return u.push({label:l,textEdit:{range:n,text:l}}),u.push({label:d,textEdit:{range:n,text:d}}),u.push({label:c,textEdit:{range:n,text:c}}),u}}let fT=class extends q{constructor(e,t,i){super(),this._register(i.colorProvider.register("*",new AR(e,t)))}};fT=Fve([ok(0,Si),ok(1,si),ok(2,Me)],fT);_L(fT);async function mV(o,e,t,i=!0){return RR(new Bve,o,e,t,i)}function _V(o,e,t,i){return Promise.resolve(t.provideColorPresentations(o,e,i))}class Bve{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 Wve{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 Vve{constructor(e){this.colorInfo=e}async compute(e,t,i,n){const s=await e.provideColorPresentations(t,this.colorInfo,vt.None);return Array.isArray(s)&&n.push(...s),Array.isArray(s)}}async function RR(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 AR)r=c;else try{await o.compute(c,t,i,a)&&(s=!0)}catch(u){en(u)}}return s?a:r&&n?(await o.compute(r,t,i,a),a):[]}function vV(o,e){const{colorProvider:t}=o.get(Me),i=o.get(Si).getModel(e);if(!i)throw hr();const n=o.get(Dt).getValue("editor.defaultColorDecorators",{resource:e});return{model:i,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:n}}Et.registerCommand("_executeDocumentColorProvider",function(o,...e){const[t]=e;if(!(t instanceof ze))throw hr();const{model:i,colorProviderRegistry:n,isDefaultColorDecoratorsEnabled:s}=vV(o,t);return RR(new Wve,n,i,vt.None,s)});Et.registerCommand("_executeColorPresentationProvider",function(o,...e){const[t,i]=e,{uri:n,range:s}=i;if(!(n instanceof ze)||!Array.isArray(t)||t.length!==4||!k.isIRange(s))throw hr();const{model:r,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=vV(o,n),[d,c,u,h]=t;return RR(new Vve({range:s,color:{red:d,green:c,blue:u,alpha:h}}),a,r,vt.None,l)});var Hve=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},rk=function(o,e){return function(t,i){e(t,i,o)}},pT;const bV=Object.create({});let wu=pT=class extends q{constructor(e,t,i,n){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new de),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new o0(this._editor),this._decoratorLimitReporter=new zve,this._colorDecorationClassRefs=this._register(new de),this._debounceInformation=n.for(i.colorProvider,"Document Colors",{min:pT.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 qr,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=_n(async e=>{const t=this._editor.getModel();if(!t)return[];const i=new ds(!1),n=await mV(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){nt(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:st.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;sthis._colorDatas.has(n.id));return i.length===0?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};wu.ID="editor.contrib.colorDetector";wu.RECOMPUTE_TIME=1e3;wu=pT=Hve([rk(1,Dt),rk(2,Me),rk(3,wr)],wu);class zve{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())}}At(wu.ID,wu,1);class $ve{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.backgroundColor=r.getColor(xw)||Y.white})),this._register(J(this._pickedColorNode,Se.CLICK,()=>this.model.selectNextColorPresentation())),this._register(J(this._originalColorNode,Se.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=Y.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 jve(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=Y.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 jve extends q{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"),le(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),le(this._button,t),le(t,Bo(".button"+Ue.asCSSSelector(Zi("color-picker-close",ve.close,p("closeIcon","Icon to close the color picker"))))).classList.add("close-icon"),this._button.onclick=()=>{this._onClicked.fire()}}}class Kve extends q{constructor(e,t,i,n=!1){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=Bo(".colorpicker-body"),le(e,this._domNode),this._saturationBox=new qve(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 Gve(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 Zve(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 Yve(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 Y(new pl(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new Y(new pl(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=(1-e)*360;this.model.color=new Y(new pl(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 qve extends q{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=Bo(".saturation-wrap"),le(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",le(this._domNode,this._canvas),this.selection=Bo(".saturation-selection"),le(this._domNode,this.selection),this.layout(),this._register(J(this._domNode,Se.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 vm);const t=gn(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=J(e.target.ownerDocument,Se.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 Y(new pl(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=Y.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 CV extends q{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=le(e,Bo(".standalone-strip")),this.overlay=le(this.domNode,Bo(".standalone-overlay"))):(this.domNode=le(e,Bo(".strip")),this.overlay=le(this.domNode,Bo(".overlay"))),this.slider=le(this.domNode,Bo(".slider")),this.slider.style.top="0px",this._register(J(this.domNode,Se.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 vm),i=gn(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=J(e.target.ownerDocument,Se.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 Gve extends CV{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 Y(new kt(t,i,n,1)),r=new Y(new kt(t,i,n,0));this.overlay.style.background=`linear-gradient(to bottom, ${s} 0%, ${r} 100%)`}getValue(e){return e.hsva.a}}class Zve extends CV{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class Yve extends q{constructor(e){super(),this._onClicked=this._register(new W),this.onClicked=this._onClicked.event,this._button=le(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 Xve extends Gr{constructor(e,t,i,n,s=!1){super(),this.model=t,this.pixelRatio=i,this._register(yv.onDidChange(()=>this.layout()));const r=Bo(".colorpicker-widget");e.appendChild(r),this.header=this._register(new Uve(r,this.model,n,s)),this.body=this._register(new Kve(r,this.model,this.pixelRatio,s))}layout(){this.body.layout()}}var wV=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},SV=function(o,e){return function(t,i){e(t,i,o)}};class Qve{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 AS=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,i){return rn.fromPromise(this._computeAsync(e,t,i))}async _computeAsync(e,t,i){if(!this._editor.hasModel())return[];const n=wu.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 yV(this,this._editor.getModel(),r.colorInfo,r.provider)]}return[]}renderHoverParts(e,t){return LV(this,this._editor,this._themeService,t,e)}};AS=wV([SV(1,Sn)],AS);class Jve{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n}}let wb=class{constructor(e,t){this._editor=e,this._themeService=t,this._color=null}async createColorHover(e,t,i){if(!this._editor.hasModel()||!wu.get(this._editor))return null;const s=await mV(i,this._editor.getModel(),vt.None);let r=null,a=null;for(const u of s){const h=u.colorInfo;k.containsRange(h.range,e.range)&&(r=h,a=u.provider)}const l=r??e,d=a??t,c=!!r;return{colorHover:await yV(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 H1(this._editor.getModel(),t,this._color,i,e),i=DV(this._editor,i,t))}renderHoverParts(e,t){return LV(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};wb=wV([SV(1,Sn)],wb);async function yV(o,e,t,i){const n=e.getValueInRange(t.range),{red:s,green:r,blue:a,alpha:l}=t.color,d=new kt(Math.round(s*255),Math.round(r*255),Math.round(a*255),l),c=new Y(d),u=await _V(e,t,i,vt.None),h=new $ve(c,[],0);return h.colorPresentations=u||[],h.guessColorPresentation(c,n),o instanceof AS?new Qve(o,k.lift(t.range),h,i):new Jve(o,k.lift(t.range),h,i)}function LV(o,e,t,i,n){if(i.length===0||!e.hasModel())return q.None;if(n.setMinimumDimensions){const h=e.getOption(66)+8;n.setMinimumDimensions(new Rt(302,h))}const s=new de,r=i[0],a=e.getModel(),l=r.model,d=s.add(new Xve(n.fragment,l,e.getOption(141),t,o instanceof wb));n.setColorPicker(d);let c=!1,u=new k(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn);if(o instanceof wb){const h=i[0].model.color;o.color=h,H1(a,l,h,u,r),s.add(l.onColorFlushed(g=>{o.color=g}))}else s.add(l.onColorFlushed(async h=>{await H1(a,l,h,u,r),c=!0,u=DV(e,u,l,n)}));return s.add(l.onDidChangeColor(h=>{H1(a,l,h,u,r)})),s.add(e.onDidChangeModelContent(h=>{c?c=!1:(n.hide(),e.focus())})),s}function DV(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 H1(o,e,t,i,n){const s=await _V(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,vt.None);e.colorPresentations=s||[]}function mT(o,e){return!!o[e]}class ak{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=mT(e.event,t.triggerModifier),this.hasSideBySideModifier=mT(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class c3{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=mT(e,t.triggerModifier)}}class FC{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 u3(o){return o==="altKey"?It?new FC(57,"metaKey",6,"altKey"):new FC(5,"ctrlKey",6,"altKey"):It?new FC(6,"altKey",57,"metaKey"):new FC(6,"altKey",5,"ctrlKey")}class ML extends q{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==null?void 0:t.extractLineNumberFromMouseEvent)!==null&&i!==void 0?i:n=>n.target.position?n.target.position.lineNumber:0,this._opts=u3(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=u3(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 ak(n,this._opts)))),this._register(this._editor.onMouseDown(n=>this._onEditorMouseDown(new ak(n,this._opts)))),this._register(this._editor.onMouseUp(n=>this._onEditorMouseUp(new ak(n,this._opts)))),this._register(this._editor.onKeyDown(n=>this._onEditorKeyDown(new c3(n,this._opts)))),this._register(this._editor.onKeyUp(n=>this._onEditorKeyUp(new c3(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 ebe=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)}};let Su=class extends Vp{constructor(e,t,i,n,s,r,a,l,d,c,u,h,g){super(e,{...n.getRawOptions(),overflowWidgetsDomNode:n.getOverflowWidgetsDomNode()},i,s,r,a,l,d,c,u,h,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){ry(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};Su=ebe([nd(4,qe),nd(5,Ot),nd(6,Ri),nd(7,Xe),nd(8,Sn),nd(9,sn),nd(10,Zl),nd(11,si),nd(12,Me)],Su);const h3=new Y(new kt(0,122,204)),tbe={showArrow:!0,showFrame:!0,className:"",frameColor:h3,arrowColor:h3,keepEditorSelection:!1},ibe="vs.editor.contrib.zoneWidget";class nbe{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 sbe{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class AL{constructor(e){this._editor=e,this._ruleName=AL._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),VI(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(){VI(this._ruleName),pw(`.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()}}AL._IdGenerator=new BA(".arrow-decoration-");class obe{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new de,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=gd(t),ry(this.options,tbe,!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 AL(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:st.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 h=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,h)}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(h=>{this._viewZone&&h.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new nbe(r,i.lineNumber,i.column,t,g=>this._onViewZoneTop(g),g=>this._onViewZoneHeight(g),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=h.addZone(this._viewZone),this._overlayWidget=new sbe(ibe+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const h=this.options.frameWidth?this.options.frameWidth:d;this.container.style.borderTopWidth=h+"px",this.container.style.borderBottomWidth=h+"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 u=this.editor.getModel();if(u){const h=u.validateRange(new k(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(h,h.startLineNumber===u.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 ss(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 xV=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},kV=function(o,e){return function(t,i){e(t,i,o)}};const IV=bt("IPeekViewService");xt(IV,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 Zs;(function(o){o.inPeekEditor=new De("inReferenceSearchEditor",!0,p("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),o.notInPeekEditor=o.inPeekEditor.toNegated()})(Zs||(Zs={}));let Sb=class{constructor(e,t){e instanceof Su&&Zs.inPeekEditor.bindTo(t)}dispose(){}};Sb.ID="editor.contrib.referenceController";Sb=xV([kV(1,Xe)],Sb);At(Sb.ID,Sb,0);function rbe(o){const e=o.get(Ot).getFocusedCodeEditor();return e instanceof Su?e.getParentEditor():e}const abe={headerBackgroundColor:Y.white,primaryHeadingColor:Y.fromHex("#333333"),secondaryHeadingColor:Y.fromHex("#6c6c6cb3")};let RS=class extends obe{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new W,this.onDidClose=this._onDidClose.event,ry(this.options,abe,!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"),Wi(this._titleElement,"click",s=>this._onTitleClick(s))),le(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=pe("span.filename"),this._secondaryHeading=pe("span.dirname"),this._metaHeading=pe("span.meta"),le(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=pe(".peekview-actions");le(this._headElement,i);const n=this._getActionBarOptions();this._actionbarWidget=new Cr(i,n),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new Rs("peekview.close",p("label.close","Close"),Ue.asClassName(ve.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:qce.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:$n(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,oo(this._metaHeading)):xs(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`)}};RS=xV([kV(2,qe)],RS);const lbe=M("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:Y.black,hcLight:Y.white},p("peekViewTitleBackground","Background color of the peek view title area.")),EV=M("peekViewTitleLabel.foreground",{dark:Y.white,light:Y.black,hcDark:Y.white,hcLight:Fr},p("peekViewTitleForeground","Color of the peek view title.")),NV=M("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},p("peekViewTitleInfoForeground","Color of the peek view title info.")),dbe=M("peekView.border",{dark:Ks,light:Ks,hcDark:Lt,hcLight:Lt},p("peekViewBorder","Color of the peek view borders and arrow.")),cbe=M("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:Y.black,hcLight:Y.white},p("peekViewResultsBackground","Background color of the peek view result list."));M("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:Y.white,hcLight:Fr},p("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));M("peekViewResult.fileForeground",{dark:Y.white,light:"#1E1E1E",hcDark:Y.white,hcLight:Fr},p("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));M("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},p("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));M("peekViewResult.selectionForeground",{dark:Y.white,light:"#6C6C6C",hcDark:Y.white,hcLight:Fr},p("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const Pc=M("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:Y.black,hcLight:Y.white},p("peekViewEditorBackground","Background color of the peek view editor."));M("peekViewEditorGutter.background",{dark:Pc,light:Pc,hcDark:Pc,hcLight:Pc},p("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));M("peekViewEditorStickyScroll.background",{dark:Pc,light:Pc,hcDark:Pc,hcLight:Pc},p("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));M("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},p("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));M("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},p("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));M("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:fi,hcLight:fi},p("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));class yu{constructor(e,t,i,n){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=n,this.id=ZE.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,br(this.uri),this.range.startLineNumber,this.range.startColumn):p("aria.oneReference","in {0} on line {1} at column {2}",br(this.uri),this.range.startLineNumber,this.range.startColumn)}}class ube{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),u=i.getValueInRange(d).replace(/^\s+/,""),h=i.getValueInRange(e),g=i.getValueInRange(c).replace(/\s+$/,"");return{value:u+h+g,highlight:{start:u.length,end:u.length+h.length}}}}class yb{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new Gi}dispose(){jt(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}",br(this.uri),this.uri.fsPath):p("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,br(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 ube(i))}catch(i){nt(i)}return this}}class go{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(go._compareReferences);let n;for(const s of e)if((!n||!pi.isEqual(n.uri,s.uri,!0))&&(n=new yb(this,s.uri),this.groups.push(n)),n.children.length===0||go._compareReferences(s,n.children[n.children.length-1])!==0){const r=new yu(i===s,n,s,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(r),n.children.push(r)}}dispose(){jt(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new go(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+10?(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:Qh(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.prefixLens.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 pi.compare(e.uri,t.uri)||k.compareRangesUsingStarts(e.range,t.range)}}var RL=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},PL=function(o,e){return function(t,i){e(t,i,o)}},_T;let vT=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof go||e instanceof yb}getChildren(e){if(e instanceof go)return e.groups;if(e instanceof yb)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};vT=RL([PL(0,Xs)],vT);class hbe{getHeight(){return 23}getTemplateId(e){return e instanceof yb?Lb.id:M0.id}}let bT=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof yu){const i=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(i)return i.value}return br(e.uri)}};bT=RL([PL(0,Xt)],bT);class gbe{getId(e){return e instanceof yu?e.id:e.uri}}let CT=class extends q{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new _S(i,{supportHighlights:!0})),this.badge=new vN(le(i,pe(".count")),{},y6),e.appendChild(i)}set(e,t){const i=qy(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))}};CT=RL([PL(1,Hp)],CT);let Lb=_T=class{constructor(e){this._instantiationService=e,this.templateId=_T.id}renderTemplate(e){return this._instantiationService.createInstance(CT,e)}renderElement(e,t,i){i.set(e.element,p0(e.filterData))}disposeTemplate(e){e.dispose()}};Lb.id="FileReferencesRenderer";Lb=_T=RL([PL(0,qe)],Lb);class fbe{constructor(e){this.label=new Gc(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(`${br(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:s,highlight:r}=n;t&&!ka.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(s,p0(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(s,[r]))}}}class M0{constructor(){this.templateId=M0.id}renderTemplate(e){return new fbe(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(){}}M0.id="OneReferenceRenderer";class pbe{getWidgetAriaLabel(){return p("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var mbe=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)}};class OL{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new de,this._callOnModelChange=new de,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{const s=n.deltaDecorations([],t);for(let r=0;r{s.equals(9)&&(this._keybindingService.dispatchEvent(s,s.target),s.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(vbe,"ReferencesWidget",this._treeContainer,new hbe,[this._instantiationService.createInstance(Lb),this._instantiationService.createInstance(M0)],this._instantiationService.createInstance(vT),i),this._splitView.addView({onDidChange:ye.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:s=>{this._preview.layout({height:this._dim.height,width:s})}},cS.Distribute),this._splitView.addView({onDidChange:ye.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)}},cS.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 yu&&(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")}),xs(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new Rt(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"),oo(this._messageContainer),Promise.resolve(void 0)):(xs(this._messageContainer),this._decorationsManager=new OL(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"),oo(this._treeContainer),oo(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 yu)return e;if(e instanceof yb&&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!==ot.inMemory?this.setTitle(Ooe(e.uri),this._uriLabel.getUriLabel(qy(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}jt(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()}};wT=mbe([sd(3,Sn),sd(4,Xs),sd(5,qe),sd(6,IV),sd(7,Hp),sd(8,Gy),sd(9,Xt),sd(10,bi),sd(11,si)],wT);var bbe=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},of=function(o,e){return function(t,i){e(t,i,o)}},z1;const $g=new De("referenceSearchVisible",!1,p("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let Lu=z1=class{static get(e){return e.getContribution(z1.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 de,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=$g.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=_be.fromJSON(this._storageService.get(s,0,"{}"));this._widget=this._instantiationService.createInstance(wT,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,u=new z(e.startLineNumber,e.startColumn),h=this._model.nearestReference(c,u);if(h)return this._widget.setSelection(h).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=z1.get(s),l=this._model.clone();this.closeWidget(),s.focus(),a==null||a.toggleWidget(n,_n(d=>Promise.resolve(l)),(r=this._peekMode)!==null&&r!==void 0?r:!1)}},s=>{this._ignoreModelChangeEvent=!1,nt(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)}};Lu.ID="editor.contrib.referencesController";Lu=z1=bbe([of(2,Xe),of(3,Ot),of(4,sn),of(5,qe),of(6,Xr),of(7,Dt)],Lu);function Ug(o,e){const t=rbe(o);if(!t)return;const i=Lu.get(t);i&&e(i)}Gs.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:fn(2089,60),when:ae.or($g,Zs.inPeekEditor),handler(o){Ug(o,e=>{e.changeFocusBetweenPreviewAndReferences()})}});Gs.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:ae.or($g,Zs.inPeekEditor),handler(o){Ug(o,e=>{e.goToNextOrPreviousReference(!0)})}});Gs.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:ae.or($g,Zs.inPeekEditor),handler(o){Ug(o,e=>{e.goToNextOrPreviousReference(!1)})}});Et.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");Et.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");Et.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");Et.registerCommand("closeReferenceSearch",o=>Ug(o,e=>e.closeWidget()));Gs.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:ae.and(Zs.inPeekEditor,ae.not("config.editor.stablePeek"))});Gs.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:ae.and($g,ae.not("config.editor.stablePeek"))});Gs.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:ae.and($g,z6,tR.negate(),iR.negate()),handler(o){var e;const i=(e=o.get(Lr).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof yu&&Ug(o,n=>n.revealReference(i[0]))}});Gs.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:ae.and($g,z6,tR.negate(),iR.negate()),handler(o){var e;const i=(e=o.get(Lr).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof yu&&Ug(o,n=>n.openReference(i[0],!0,!0))}});Et.registerCommand("openReference",o=>{var e;const i=(e=o.get(Lr).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof yu&&Ug(o,n=>n.openReference(i[0],!1,!0))});var TV=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},E_=function(o,e){return function(t,i){e(t,i,o)}};const PR=new De("hasSymbols",!1,p("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),FL=bt("ISymbolNavigationService");let ST=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=PR.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 yT(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 u of t.references)if(dA(u.uri,a.uri))d=!0,c=c||k.containsPosition(u.range,l);else if(d)break;(!d||!c)&&this.reset()});this._currentState=Hr(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)}};ST=TV([E_(0,Xe),E_(1,Ot),E_(2,sn),E_(3,Xt)],ST);xt(FL,ST,1);we(new class extends Rn{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:PR,kbOpts:{weight:100,primary:70}})}runEditorCommand(o,e){return o.get(FL).revealNext(e)}});Gs.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:PR,primary:9,handler(o){o.get(FL).reset()}});let yT=class{constructor(e){this._listener=new Map,this._disposables=new de,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(),jt(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,Hr(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)}};yT=TV([E_(0,Ot)],yT);async function A0(o,e,t,i){const s=t.ordered(o).map(a=>Promise.resolve(i(a,o,e)).then(void 0,l=>{en(l)})),r=await Promise.all(s);return Ia(r.flat())}function BL(o,e,t,i){return A0(e,t,o,(n,s,r)=>n.provideDefinition(s,r,i))}function MV(o,e,t,i){return A0(e,t,o,(n,s,r)=>n.provideDeclaration(s,r,i))}function AV(o,e,t,i){return A0(e,t,o,(n,s,r)=>n.provideImplementation(s,r,i))}function RV(o,e,t,i){return A0(e,t,o,(n,s,r)=>n.provideTypeDefinition(s,r,i))}function WL(o,e,t,i,n){return A0(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 R0(o){const e=await o(),t=new go(e,""),i=t.references.map(n=>n.link);return t.dispose(),i}ql("_executeDefinitionProvider",(o,e,t)=>{const i=o.get(Me),n=BL(i.definitionProvider,e,t,vt.None);return R0(()=>n)});ql("_executeTypeDefinitionProvider",(o,e,t)=>{const i=o.get(Me),n=RV(i.typeDefinitionProvider,e,t,vt.None);return R0(()=>n)});ql("_executeDeclarationProvider",(o,e,t)=>{const i=o.get(Me),n=MV(i.declarationProvider,e,t,vt.None);return R0(()=>n)});ql("_executeReferenceProvider",(o,e,t)=>{const i=o.get(Me),n=WL(i.referenceProvider,e,t,!1,vt.None);return R0(()=>n)});ql("_executeImplementationProvider",(o,e,t)=>{const i=o.get(Me),n=AV(i.implementationProvider,e,t,vt.None);return R0(()=>n)});var n_,s_,o_,BC,WC,VC,HC,zC;zn.appendMenuItem(N.EditorContext,{submenu:N.EditorContextPeek,title:p("peek.submenu","Peek"),group:"navigation",order:100});class em{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof em||z.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}class bs extends Wa{static all(){return bs._allSymbolNavigationCommands.values()}static _patchConfig(e){const t={...e,f1:!0};if(t.menu)for(const i of wt.wrap(t.menu))(i.id===N.EditorContext||i.id===N.EditorContextPeek)&&(i.when=ae.and(e.precondition,i.when));return t}constructor(e,t){super(bs._patchConfig(t)),this.configuration=e,bs._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,n){if(!t.hasModel())return Promise.resolve(void 0);const s=e.get(sn),r=e.get(Ot),a=e.get(Bu),l=e.get(FL),d=e.get(Me),c=e.get(qe),u=t.getModel(),h=t.getPosition(),g=em.is(i)?i:new em(u,h),f=new bu(t,5),m=Cy(this._getLocationModel(d,g.model,g.position,f.token),f.token).then(async v=>{var _;if(!v||f.token.isCancellationRequested)return;mo(v.ariaMessage);let b;if(v.referenceAt(u.uri,h)){const w=this._getAlternativeCommand(t);!bs._activeAlternativeCommands.has(w)&&bs._allSymbolNavigationCommands.has(w)&&(b=bs._allSymbolNavigationCommands.get(w))}const C=v.references.length;if(C===0){if(!this.configuration.muteMessage){const w=u.getWordAtPosition(h);(_=ho.get(t))===null||_===void 0||_.showMessage(this._getNoResultFoundMessage(w),h)}}else if(C===1&&b)bs._activeAlternativeCommands.add(this.desc.id),c.invokeFunction(w=>b.runEditorCommand(w,t,i,n).finally(()=>{bs._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(r,l,t,v,n)},v=>{s.error(v)}).finally(()=>{f.dispose()});return a.showWhile(m,250),m}async _onResult(e,t,i,n,s){const r=this._getGoToPreference(i);if(!(i instanceof Su)&&(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=Lu.get(e);n&&e.hasModel()?n.toggleWidget(i??e.getSelection(),_n(s=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}bs._allSymbolNavigationCommands=new Map;bs._activeAlternativeCommands=new Set;class P0 extends bs{async _getLocationModel(e,t,i,n){return new go(await BL(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}}mi((n_=class extends P0{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:n_.id,title:{value:p("actions.goToDecl.label","Go to Definition"),original:"Go to Definition",mnemonicTitle:p({},"Go to &&Definition")},precondition:ae.and(T.hasDefinitionProvider,T.isInWalkThroughSnippet.toNegated()),keybinding:[{when:T.editorTextFocus,primary:70,weight:100},{when:ae.and(T.editorTextFocus,W6),primary:2118,weight:100}],menu:[{id:N.EditorContext,group:"navigation",order:1.1},{id:N.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),Et.registerCommandAlias("editor.action.goToDeclaration",n_.id)}},n_.id="editor.action.revealDefinition",n_));mi((s_=class extends P0{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:s_.id,title:{value:p("actions.goToDeclToSide.label","Open Definition to the Side"),original:"Open Definition to the Side"},precondition:ae.and(T.hasDefinitionProvider,T.isInWalkThroughSnippet.toNegated()),keybinding:[{when:T.editorTextFocus,primary:fn(2089,70),weight:100},{when:ae.and(T.editorTextFocus,W6),primary:fn(2089,2118),weight:100}]}),Et.registerCommandAlias("editor.action.openDeclarationToTheSide",s_.id)}},s_.id="editor.action.revealDefinitionAside",s_));mi((o_=class extends P0{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:o_.id,title:{value:p("actions.previewDecl.label","Peek Definition"),original:"Peek Definition"},precondition:ae.and(T.hasDefinitionProvider,Zs.notInPeekEditor,T.isInWalkThroughSnippet.toNegated()),keybinding:{when:T.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:N.EditorContextPeek,group:"peek",order:2}}),Et.registerCommandAlias("editor.action.previewDeclaration",o_.id)}},o_.id="editor.action.peekDefinition",o_));class PV extends bs{async _getLocationModel(e,t,i,n){return new go(await MV(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}}mi((BC=class extends PV{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:BC.id,title:{value:p("actions.goToDeclaration.label","Go to Declaration"),original:"Go to Declaration",mnemonicTitle:p({},"Go to &&Declaration")},precondition:ae.and(T.hasDeclarationProvider,T.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")}},BC.id="editor.action.revealDeclaration",BC));mi(class extends PV{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:{value:p("actions.peekDecl.label","Peek Declaration"),original:"Peek Declaration"},precondition:ae.and(T.hasDeclarationProvider,Zs.notInPeekEditor,T.isInWalkThroughSnippet.toNegated()),menu:{id:N.EditorContextPeek,group:"peek",order:3}})}});class OV extends bs{async _getLocationModel(e,t,i,n){return new go(await RV(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}}mi((WC=class extends OV{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:WC.ID,title:{value:p("actions.goToTypeDefinition.label","Go to Type Definition"),original:"Go to Type Definition",mnemonicTitle:p({},"Go to &&Type Definition")},precondition:ae.and(T.hasTypeDefinitionProvider,T.isInWalkThroughSnippet.toNegated()),keybinding:{when:T.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}]})}},WC.ID="editor.action.goToTypeDefinition",WC));mi((VC=class extends OV{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:VC.ID,title:{value:p("actions.peekTypeDefinition.label","Peek Type Definition"),original:"Peek Type Definition"},precondition:ae.and(T.hasTypeDefinitionProvider,Zs.notInPeekEditor,T.isInWalkThroughSnippet.toNegated()),menu:{id:N.EditorContextPeek,group:"peek",order:4}})}},VC.ID="editor.action.peekTypeDefinition",VC));class FV extends bs{async _getLocationModel(e,t,i,n){return new go(await AV(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}}mi((HC=class extends FV{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:HC.ID,title:{value:p("actions.goToImplementation.label","Go to Implementations"),original:"Go to Implementations",mnemonicTitle:p({},"Go to &&Implementations")},precondition:ae.and(T.hasImplementationProvider,T.isInWalkThroughSnippet.toNegated()),keybinding:{when:T.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}]})}},HC.ID="editor.action.goToImplementation",HC));mi((zC=class extends FV{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:zC.ID,title:{value:p("actions.peekImplementation.label","Peek Implementations"),original:"Peek Implementations"},precondition:ae.and(T.hasImplementationProvider,Zs.notInPeekEditor,T.isInWalkThroughSnippet.toNegated()),keybinding:{when:T.editorTextFocus,primary:3142,weight:100},menu:{id:N.EditorContextPeek,group:"peek",order:5}})}},zC.ID="editor.action.peekImplementation",zC));class BV extends bs{_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}}mi(class extends BV{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:ae.and(T.hasReferenceProvider,Zs.notInPeekEditor,T.isInWalkThroughSnippet.toNegated()),keybinding:{when:T.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 go(await WL(e.referenceProvider,t,i,!0,n),p("ref.title","References"))}});mi(class extends BV{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:ae.and(T.hasReferenceProvider,Zs.notInPeekEditor,T.isInWalkThroughSnippet.toNegated()),menu:{id:N.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(e,t,i,n){return new go(await WL(e.referenceProvider,t,i,!1,n),p("ref.title","References"))}});class Cbe extends bs{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:ae.and(Zs.notInPeekEditor,T.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}async _getLocationModel(e,t,i,n){return new go(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""}}Et.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:ze},{name:"position",description:"The position at which to start",constraint:z.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)=>{qt(ze.isUri(e)),qt(z.isIPosition(t)),qt(Array.isArray(i)),qt(typeof n>"u"||typeof n=="string"),qt(typeof r>"u"||typeof r=="boolean");const a=o.get(Ot),l=await a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if($l(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(d=>{const c=new class extends Cbe{_getNoResultFoundMessage(u){return s||super._getNoResultFoundMessage(u)}}({muteMessage:!s,openInPeek:!!r,openToSide:!1},i,n);d.get(qe).invokeFunction(c.run.bind(c),l)})}});Et.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:ze},{name:"position",description:"The position at which to start",constraint:z.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(Ri).executeCommand("editor.action.goToLocations",e,t,i,n,void 0,!0)}});Et.registerCommand({id:"editor.action.findReferences",handler:(o,e,t)=>{qt(ze.isUri(e)),qt(z.isIPosition(t));const i=o.get(Me),n=o.get(Ot);return n.openCodeEditor({resource:e},n.getFocusedCodeEditor()).then(s=>{if(!$l(s)||!s.hasModel())return;const r=Lu.get(s);if(!r)return;const a=_n(d=>WL(i.referenceProvider,s.getModel(),z.lift(t),!1,d).then(c=>new go(c,p("ref.title","References")))),l=new k(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(r.toggleWidget(l,a,!1))})}});Et.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");var wbe=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},lk=function(o,e){return function(t,i){e(t,i,o)}},N_;let bg=N_=class{constructor(e,t,i,n){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=n,this.toUnhook=new de,this.toUnhookForKeyboard=new de,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const s=new ML(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=>{nt(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(s.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(N_.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 xW(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=_n(a=>this.findDefinition(e,a));let s;try{s=await this.previousPromise}catch(a){nt(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 as().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 u=this.getPreviewValue(d,c,a),h=this.languageService.guessLanguageIdByFilepathOrFirstLine(d.uri);this.addDecoration(r,u?new as().appendCodeblock(h||"",u):void 0),l.dispose()})}}getPreviewValue(e,t,i){let n=i.range;return n.endLineNumber-n.startLineNumber>=N_.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{const n=!t&&this.editor.getOption(87)&&!this.isInPeekEditor(i);return new P0({openToSide:t,openInPeek:n,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(Xe);return Zs.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};bg.ID="editor.contrib.gotodefinitionatposition";bg.MAX_SOURCE_PREVIEW_LINES=8;bg=N_=wbe([lk(1,Xs),lk(2,bi),lk(3,Me)],bg);At(bg.ID,bg,2);const $C=pe;class WV extends q{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 a0(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class OR extends q{static render(e,t,i){return new OR(e,t,i)}constructor(e,t,i){super(),this.actionContainer=le(e,$C("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=le(this.actionContainer,$C("a.action")),this.action.setAttribute("role","button"),t.iconClass&&le(this.action,$C(`span.icon.${t.iconClass}`));const n=le(this.action,$C("span"));n.textContent=i?`${t.label} (${i})`:t.label,this._register(J(this.actionContainer,Se.CLICK,s=>{s.stopPropagation(),s.preventDefault(),t.run(this.actionContainer)})),this._register(J(this.actionContainer,Se.KEY_DOWN,s=>{const r=new gi(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 Sbe(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 ybe=class{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}};class VV extends q{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 Yt(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new Yt(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new Yt(()=>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=lX(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){nt(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 ybe(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 dk{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 $1{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 jg=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class FR{constructor(){this._onDidWillResize=new W,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new W,this.onDidResize=this._onDidResize.event,this._sashListener=new de,this._size=new Rt(0,0),this._minSize=new Rt(0,0),this._maxSize=new Rt(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new ss(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new ss(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new ss(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:lS.North}),this._southSash=new ss(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:lS.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(ye.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(ye.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(ye.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(ye.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 Rt(t,e);Rt.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 Lbe=30,Dbe=24;class xbe extends q{constructor(e,t=new Rt(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new FR),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=Rt.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 Rt(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?z.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);return!t||!i?void 0:gn(t).top+i.top-Lbe}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const n=gn(t),s=ng(t.ownerDocument.body),r=n.top+i.top+i.height;return s.height-r-Dbe}_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 BR=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},Oh=function(o,e){return function(t,i){e(t,i,o)}},U1,Xa;const g3=pe;let PS=U1=class extends q{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(Xc,this._editor)),this._participants=[];for(const n of jg.getAll())this._participants.push(this._instantiationService.createInstance(n,this._editor));this._participants.sort((n,s)=>n.hoverOrdinal-s.hoverOrdinal),this._computer=new FS(this._editor,this._participants),this._hoverOperation=this._register(new VV(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 HV(this._computer.anchor,s,n.isComplete))})),this._register(Wi(this._widget.getDomNode(),"keydown",n=>{n.equals(9)&&this.hide()})),this._register(Ei.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 dk(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.horizontalDistanceToTexts.priority-n.priority),this._startShowingOrUpdateHover(t[0],0,0,!1,e))}startShowingAtRange(e,t,i,n){this._startShowingOrUpdateHover(new dk(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}=U1.computeHoverRanges(this._editor,e.range,t),r=new de,a=r.add(new OS(this._keybindingService)),l=document.createDocumentFragment();let d=null;const c={fragment:l,statusBar:a,setColorPicker:h=>d=h,onContentsChanged:()=>this._widget.onContentsChanged(),setMinimumDimensions:h=>this._widget.setMinimumDimensions(h),hide:()=>this.hide()};for(const h of this._participants){const g=t.filter(f=>f.owner===h);g.length>0&&r.add(h.renderHoverParts(c,g))}const u=t.some(h=>h.isBeforeContent);if(a.hasContent&&l.appendChild(a.hoverElement),l.hasChildNodes()){if(s){const h=this._editor.createDecorationsCollection();h.set([{range:s,options:U1._DECORATION_OPTIONS}]),r.add(je(()=>{h.clear()}))}this._widget.showAt(l,new Ibe(d,i,n,this._editor.getOption(60).above,this._computer.shouldFocus,this._computer.source,u,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,u=c.convertModelRangeToViewRange(t),h=new z(u.startLineNumber,d.getLineMinColumn(u.startLineNumber));n=c.convertViewPositionToModelPosition(h).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 z(s,t.startColumn),showAtSecondaryPosition:l?l.getStartPosition():new z(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()}};PS._DECORATION_OPTIONS=st.register({description:"content-hover-highlight",className:"hoverHighlight"});PS=U1=BR([Oh(1,qe),Oh(2,Xt)],PS);class HV{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 kbe(this,this.anchor,t,this.isComplete)}}class kbe extends HV{constructor(e,t,i,n){super(t,i,n),this.original=e}filter(e){return this.original.filter(e)}}class Ibe{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 f3=30,ck=10,Ebe=6;let Xc=Xa=class extends xbe{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 Rt(a,r);super(e,l),this._configurationService=i,this._accessibilityService=n,this._keybindingService=s,this._hover=this._register(new WV),this._minimumSize=l,this._hoverVisibleKey=T.hoverVisible.bindTo(t),this._hoverFocusedKey=T.hoverFocused.bindTo(t),le(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(Pl(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 Xa.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 Xa._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return Xa._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){Xa._applyMaxDimensions(this._hover.contentsDomNode,e,t),Xa._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-ck))}_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 Rt(i,n),this._setHoverWidgetMaxDimensions(i,n)}_resize(e){var t,i;Xa._lastDimensions=new Rt(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=Ebe;return Array.from(this._hover.contentsDomNode.children).forEach(i=>{t+=i.clientHeight}),this._hasHorizontalScrollbar()&&(t+=ck),Math.min(e,t)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const e=Array.from(this._hover.contentsDomNode.children).some(t=>t.scrollWidth>t.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const e=this._isHoverTextOverflowing(),t=typeof this._contentWidth>"u"?0:this._contentWidth-2;return e||this._hover.containerDomNode.clientWidth"u"||typeof this._visibleData.initialMousePosY>"u")return this._visibleData.initialMousePosX=e,this._visibleData.initialMousePosY=t,!1;const i=gn(this.getDomNode());typeof this._visibleData.closestMouseDistance>"u"&&(this._visibleData.closestMouseDistance=p3(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,i.left,i.top,i.width,i.height));const n=p3(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,Xa._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,Xa._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=kh(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&&Sbe(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 Rt(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(zs(i),Math.min(s,e)),this._setContentsDomNodeDimensions(zs(n),Math.min(s,e-ck))}setMinimumDimensions(e){this._minimumSize=new Rt(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 Rt(e,this._minimumSize.height)}onContentsChanged(){var e;this._removeConstraintsRenderNormally();const t=this._hover.containerDomNode;let i=kh(t),n=zs(t);if(this._resizableNode.layout(i,n),this._setHoverWidgetDimensions(n,i),i=kh(t),n=zs(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=kh(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-f3})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+f3})}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})}};Xc.ID="editor.contrib.resizableContentHoverWidget";Xc._lastDimensions=new Rt(0,0);Xc=Xa=BR([Oh(1,Xe),Oh(2,Dt),Oh(3,Zl),Oh(4,Xt)],Xc);let OS=class extends q{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=g3("div.hover-row.status-bar"),this.actionsElement=le(this.hoverElement,g3("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;return this._hasContent=!0,this._register(OR.render(this.actionsElement,e,i))}append(e){const t=le(this.actionsElement,e);return this._hasContent=!0,t}};OS=BR([Oh(0,Xt)],OS);class FS{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 rn.EMPTY;const i=FS._getLineDecorations(this._editor,t);return rn.merge(this._participants.map(n=>n.computeAsync?n.computeAsync(t,i,e):rn.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=FS._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return Ia(t)}}function p3(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 m3=pe;class vp extends q{constructor(e,t,i){super(),this._renderDisposeables=this._register(new de),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new WV),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new Ud({editor:this._editor},t,i)),this._computer=new Nbe(this._editor),this._hoverOperation=this._register(new VV(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 vp.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=m3("div.hover-row.markdown-hover"),r=le(s,m3("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`}}vp.ID="editor.contrib.modesGlyphHoverWidget";class Nbe{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||Up(s)||i.push(...Z2(s).map(e))}return i}}class Tbe{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}async function Mbe(o,e,t,i,n){try{const s=await Promise.resolve(o.provideHover(t,i,n));if(s&&Rbe(s))return new Tbe(o,s,e)}catch(s){en(s)}}function WR(o,e,t,i){const s=o.ordered(e).map((r,a)=>Mbe(r,a,e,t,i));return rn.fromPromises(s).coalesce()}function Abe(o,e,t,i){return WR(o,e,t,i).map(n=>n.hover).toPromise()}ql("_executeHoverProvider",(o,e,t)=>{const i=o.get(Me);return Abe(i.hoverProvider,e,t,vt.None)});function Rbe(o){const e=typeof o.range<"u",t=typeof o.contents<"u"&&o.contents&&o.contents.length>0;return e&&t}var Pbe=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},UC=function(o,e){return function(t,i){e(t,i,o)}};const _3=pe;class ba{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 BS=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 ba(this,e.range,[new as().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),u=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:d});let h=!1;c>=0&&l>c&&e.range.startColumn>=c&&(h=!0,r.push(new ba(this,e.range,[{value:p("stopped rendering","Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!h&&typeof u=="number"&&l>=u&&r.push(new ba(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,v=f.range.endLineNumber===n?f.range.endColumn:s,_=f.options.hoverMessage;if(!_||Up(_))continue;f.options.beforeContentClassName&&(g=!0);const b=new k(e.range.startLineNumber,m,e.range.startLineNumber,v);r.push(new ba(this,b,Z2(_),g,a++))}return r}computeAsync(e,t,i){if(!this._editor.hasModel()||e.type!==1)return rn.EMPTY;const n=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(n))return rn.EMPTY;const s=new z(e.range.startLineNumber,e.range.startColumn);return WR(this._languageFeaturesService.hoverProvider,n,s,i).filter(r=>!Up(r.hover.contents)).map(r=>{const a=r.hover.range?k.lift(r.hover.range):e.range;return new ba(this,a,r.hover.contents,!1,r.ordinal)})}renderHoverParts(e,t){return zV(e,t,this._editor,this._languageService,this._openerService)}};BS=Pbe([UC(1,bi),UC(2,So),UC(3,Dt),UC(4,Me)],BS);function zV(o,e,t,i,n){e.sort((r,a)=>r.ordinal-a.ordinal);const s=new de;for(const r of e)for(const a of r.contents){if(Up(a))continue;const l=_3("div.hover-row.markdown-hover"),d=le(l,_3("div.hover-contents")),c=s.add(new Ud({editor:t},i,n));s.add(c.onDidRenderAsync(()=>{d.className="hover-contents code-hover-contents",o.onContentsChanged()}));const u=s.add(c.render(a));d.appendChild(u.element),o.fragment.appendChild(l)}return s}var $V=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},WS=function(o,e){return function(t,i){e(t,i,o)}};class v3{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let LT=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new W,this.onDidChange=this._onDidChange.event,this._dispoables=new de,this._markers=[],this._nextIdx=-1,ze.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=Sv(a.resource.toString(),l.resource.toString());return d===0&&(n==="position"?d=k.compareRangesUsingStarts(a,l)||Mi.compare(a.severity,l.severity):d=Mi.compare(a.severity,l.severity)||k.compareRangesUsingStarts(a,l)),d},r=()=>{this._markers=this._markerService.read({resource:ze.isUri(e)?e:void 0,severities:Mi.Error|Mi.Warning|Mi.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 v3(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=fv(this._markers,{resource:e.uri},(r,a)=>Sv(r.resource.toString(),a.resource.toString())),s<0&&(s=~s));for(let r=s;rn.resource.toString()===e.toString());if(!(i<0)){for(;i=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},rf=function(o,e){return function(t,i){e(t,i,o)}},kT;class Fbe{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 de,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(Wi(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new K7(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(){jt(this._disposables)}update(e){const{source:t,message:i,relatedInformation:n,code:s}=e;let r=((t==null?void 0:t.length)||0)+2;s&&(typeof s=="string"?r+=s.length:r+=s.value.length);const a=Rl(i);this._lines=a.length,this._longestLineLength=0;for(const h of a)this._longestLineLength=Math.max(h.length+r,this._longestLineLength);$n(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const h of a)l=document.createElement("div"),l.innerText=h,h===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||s){const h=document.createElement("span");if(h.classList.add("details"),l.appendChild(h),t){const g=document.createElement("span");g.innerText=t,g.classList.add("source"),h.appendChild(g)}if(s)if(typeof s=="string"){const g=document.createElement("span");g.innerText=`(${s})`,g.classList.add("code"),h.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=le(this._codeLink,pe("span"));g.innerText=s.value,h.appendChild(this._codeLink)}}if($n(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),ls(n)){const h=this._relatedBlock.appendChild(document.createElement("div"));h.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 v=document.createElement("span");v.innerText=g.message,f.appendChild(m),f.appendChild(v),this._lines+=1,h.appendChild(f)}}const d=this._editor.getOption(50),c=Math.ceil(d.typicalFullwidthCharacterWidth*this._longestLineLength*.75),u=d.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:c,scrollHeight:u})}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 Mi.Error:t=p("Error","Error");break;case Mi.Warning:t=p("Warning","Warning");break;case Mi.Info:t=p("Info","Info");break;case Mi.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 tm=kT=class extends RS{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 de,this._onDidSelectRelatedInformation=new W,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=Mi.Warning,this._backgroundColor=Y.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(Hbe);let t=IT,i=Bbe;this._severity===Mi.Warning?(t=j1,i=Wbe):this._severity===Mi.Info&&(t=ET,i=Vbe);const n=e.getColor(t),s=e.getColor(i);this.style({arrowColor:n,frameColor:n,headerBackgroundColor:s,primaryHeadingColor:e.getColor(EV),secondaryHeadingColor:e.getColor(NV)})}_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(kT.TitleMenu,this._contextKeyService);VA(i,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),i.dispose()}_fillTitleIcon(e){this._icon=le(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 Fbe(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(br(a.uri),l)}this._icon.className=`codicon ${xT.className(Mi.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()}};tm.TitleMenu=new N("gotoErrorTitleMenu");tm=kT=Obe([rf(1,Sn),rf(2,So),rf(3,Ba),rf(4,qe),rf(5,Xe),rf(6,Hp)],tm);const b3=Vv(vl,vte),C3=Vv(zo,Bv),w3=Vv(Ks,Wv),IT=M("editorMarkerNavigationError.background",{dark:b3,light:b3,hcDark:Lt,hcLight:Lt},p("editorMarkerNavigationError","Editor marker navigation widget error color.")),Bbe=M("editorMarkerNavigationError.headerBackground",{dark:We(IT,.1),light:We(IT,.1),hcDark:null,hcLight:null},p("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),j1=M("editorMarkerNavigationWarning.background",{dark:C3,light:C3,hcDark:Lt,hcLight:Lt},p("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),Wbe=M("editorMarkerNavigationWarning.headerBackground",{dark:We(j1,.1),light:We(j1,.1),hcDark:"#0C141F",hcLight:We(j1,.2)},p("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),ET=M("editorMarkerNavigationInfo.background",{dark:w3,light:w3,hcDark:Lt,hcLight:Lt},p("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),Vbe=M("editorMarkerNavigationInfo.headerBackground",{dark:We(ET,.1),light:We(ET,.1),hcDark:null,hcLight:null},p("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),Hbe=M("editorMarkerNavigation.background",{dark:wn,light:wn,hcDark:wn,hcLight:wn},p("editorMarkerNavigationBackground","Editor marker navigation widget background."));var zbe=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},jC=function(o,e){return function(t,i){e(t,i,o)}},T_;let Du=T_=class{static get(e){return e.getContribution(T_.ID)}constructor(e,t,i,n,s){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=n,this._instantiationService=s,this._sessionDispoables=new de,this._editor=e,this._widgetVisible=jV.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(tm,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 z(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=T_.get(r))===null||i===void 0||i.close(),(n=T_.get(r))===null||n===void 0||n.nagivate(e,t))}else this._widget.showAtMarker(s.selected.marker,s.selected.index,s.selected.total)}}};Du.ID="editor.contrib.markerController";Du=T_=zbe([jC(1,UV),jC(2,Xe),jC(3,Ot),jC(4,qe)],Du);class VL extends Te{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}async run(e,t){var i;t.hasModel()&&((i=Du.get(t))===null||i===void 0||i.nagivate(this._next,this._multiFile))}}class Qc extends VL{constructor(){super(!0,!1,{id:Qc.ID,label:Qc.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:T.focus,primary:578,weight:100},menuOpts:{menuId:tm.TitleMenu,title:Qc.LABEL,icon:Zi("marker-navigation-next",ve.arrowDown,p("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}Qc.ID="editor.action.marker.next";Qc.LABEL=p("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class Kh extends VL{constructor(){super(!1,!1,{id:Kh.ID,label:Kh.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:T.focus,primary:1602,weight:100},menuOpts:{menuId:tm.TitleMenu,title:Kh.LABEL,icon:Zi("marker-navigation-previous",ve.arrowUp,p("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}Kh.ID="editor.action.marker.prev";Kh.LABEL=p("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class $be extends VL{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:T.focus,primary:66,weight:100},menuOpts:{menuId:N.MenubarGoMenu,title:p({},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class Ube extends VL{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:T.focus,primary:1090,weight:100},menuOpts:{menuId:N.MenubarGoMenu,title:p({},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}At(Du.ID,Du,4);_e(Qc);_e(Kh);_e($be);_e(Ube);const jV=new De("markersNavigationVisible",!1),jbe=Rn.bindToContribution(Du.get);we(new jbe({id:"closeMarkersNavigation",precondition:jV,handler:o=>o.close(),kbOpts:{weight:150,kbExpr:T.focus,primary:9,secondary:[1033]}}));var Kbe=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},uk=function(o,e){return function(t,i){e(t,i,o)}};const Ir=pe;class qbe{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 S3={type:1,filter:{include:Ze.QuickFix},triggerAction:_o.QuickFixHover};let NT=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 u=new k(e.range.startLineNumber,l,e.range.startLineNumber,d);r.push(new qbe(this,u,c))}return r}renderHoverParts(e,t){if(!t.length)return q.None;const i=new de;t.forEach(s=>e.fragment.appendChild(this.renderMarkerHover(s,i)));const n=t.length===1?t[0]:t.sort((s,r)=>Mi.compare(s.marker.severity,r.marker.severity))[0];return this.renderMarkerStatusbar(e,n,i),i}renderMarkerHover(e,t){const i=Ir("div.hover-row"),n=le(i,Ir("div.marker.hover-contents")),{source:s,message:r,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(n);const d=le(n,Ir("span"));if(d.style.whiteSpace="pre-wrap",d.innerText=r,s||a)if(a&&typeof a!="string"){const c=Ir("span");if(s){const f=le(c,Ir("span"));f.innerText=s}const u=le(c,Ir("a.code-link"));u.setAttribute("href",a.target.toString()),t.add(J(u,"click",f=>{this._openerService.open(a.target,{allowCommands:!0}),f.preventDefault(),f.stopPropagation()}));const h=le(u,Ir("span"));h.innerText=a.value;const g=le(n,c);g.style.opacity="0.6",g.style.paddingLeft="6px"}else{const c=le(n,Ir("span"));c.style.opacity="0.6",c.style.paddingLeft="6px",c.innerText=s&&a?`${s}(${a})`:s||`(${a})`}if(ls(l))for(const{message:c,resource:u,startLineNumber:h,startColumn:g}of l){const f=le(n,Ir("div"));f.style.marginTop="8px";const m=le(f,Ir("a"));m.innerText=`${br(u)}(${h}, ${g}): `,m.style.cursor="pointer",t.add(J(m,"click",_=>{_.stopPropagation(),_.preventDefault(),this._openerService&&this._openerService.open(u,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:h,startColumn:g}}}).catch(nt)}));const v=le(f,Ir("span"));v.innerText=c,this._editor.applyFontInfo(v)}return i}renderMarkerStatusbar(e,t,i){if((t.marker.severity===Mi.Error||t.marker.severity===Mi.Warning||t.marker.severity===Mi.Info)&&e.statusBar.addAction({label:p("view problem","View Problem"),commandId:Qc.ID,run:()=>{var n;e.hide(),(n=Du.get(this._editor))===null||n===void 0||n.showAtMarker(t.marker),this._editor.focus()}}),!this._editor.getOption(90)){const n=e.statusBar.append(Ir("div"));this.recentMarkerCodeActionsInfo&&(rS.makeKey(this.recentMarkerCodeActionsInfo.marker)===rS.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?q.None:i.add(lu(()=>n.textContent=p("checkingForQuickFixes","Checking for quick fixes..."),200));n.textContent||(n.textContent=" ");const r=this.getCodeActions(t.marker);i.add(je(()=>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(je(()=>{l||a.dispose()})),e.statusBar.addAction({label:p("quick fixes","Quick Fix..."),commandId:ER,run:d=>{l=!0;const c=Cu.get(this._editor),u=gn(d);e.hide(),c==null||c.showCodeActions(S3,a,{x:u.left,y:u.top,width:u.width,height:u.height})}})},nt)}}getCodeActions(e){return _n(t=>ov(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new k(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),S3,Fd.None,t))}};NT=Kbe([uk(1,$M),uk(2,So),uk(3,Me)],NT);const KV="editor.action.inlineSuggest.commit",qV="editor.action.inlineSuggest.showPrevious",GV="editor.action.inlineSuggest.showNext";var VR=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},Ca=function(o,e){return function(t,i){e(t,i,o)}},K1;let TT=class extends q{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=Oi(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=rt(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 z(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(Qd((n,s)=>{const r=this.model.read(n);if(!r||!this.alwaysShowToolbar.read(n))return;const a=s.add(this.instantiationService.createInstance(xu,this.editor,!0,this.position,r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.selectedInlineCompletion.map(l=>{var d;return(d=l==null?void 0:l.inlineCompletion.source.inlineCompletions.commands)!==null&&d!==void 0?d:[]})));e.addContentWidget(a),s.add(je(()=>e.removeContentWidget(a))),s.add(zt(l=>{this.position.read(l)&&r.lastTriggerKind.read(l)!==Rd.Explicit&&r.triggerExplicitly()}))}))}};TT=VR([Ca(2,qe)],TT);const Gbe=Zi("inline-suggestion-hints-next",ve.chevronRight,p("parameterHintsNextIcon","Icon for show next parameter hint.")),Zbe=Zi("inline-suggestion-hints-previous",ve.chevronLeft,p("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let xu=K1=class extends q{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const n=new Rs(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,u){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=u,this.id=`InlineSuggestionHintsContentWidget${K1.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=vi("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[vi("div@toolBar")]),this.previousAction=this.createCommandAction(qV,p("previous","Previous"),Ue.asClassName(Zbe)),this.availableSuggestionCountAction=new Rs("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(GV,p("next","Next"),Ue.asClassName(Gbe)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(N.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new Yt(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new Yt(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.lastCommands=[],this.toolBar=this._register(l.createInstance(MT,this.nodes.toolBar,N.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:h=>h.startsWith("primary")},actionViewItemProvider:(h,g)=>{if(h instanceof Ur)return l.createInstance(Xbe,h,void 0);if(h===this.availableSuggestionCountAction){const f=new Ybe(void 0,h,{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(h=>{K1._dropDownVisible=h})),this._register(zt(h=>{this._position.read(h),this.editor.layoutContentWidget(this)})),this._register(zt(h=>{const g=this._suggestionCount.read(h),f=this._currentSuggestionIdx.read(h);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(zt(h=>{const g=this._extraCommands.read(h);if(Bi(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:v=>this._commandService.executeCommand(m.id)}));for(const[m,v]of this.inlineCompletionsActionsMenus.getActions())for(const _ of v)_ instanceof Ur&&f.push(_);f.length>0&&f.unshift(new Mn),this.toolBar.setAdditionalSecondaryActions(f)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};xu._dropDownVisible=!1;xu.id=0;xu=K1=VR([Ca(6,Ri),Ca(7,qe),Ca(8,Xt),Ca(9,Xe),Ca(10,Ba)],xu);class Ybe extends jp{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 Xbe=class extends dg{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=vi("div.keybinding").root;new C0(t,Vo,{disableTitle:!0,...whe}).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}},MT=class extends ES{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=[];VA(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){Bi(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){Bi(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};MT=VR([Ca(3,Ba),Ca(4,Xe),Ca(5,Sr),Ca(6,Xt),Ca(7,vo)],MT);var Qbe=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},KC=function(o,e){return function(t,i){e(t,i,o)}},AT;let Ys=AT=class extends q{static get(e){return e.getContribution(AT.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 de,this._hoverActivatedByColorDecoratorClick=!1,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._reactToEditorMouseMoveRunner=this._register(new Yt(()=>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===Xc.ID){this._hoverClicked=!0;return}i.type===12&&i.detail===vp.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===Xc.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===Xc.ID&&(!((r=this._contentWidget)===null||r===void 0)&&r.isColorPickerVisible)||this._isHoverSticky&&a.type===12&&a.detail===vp.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 vp(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)||xu.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(PS,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()}};Ys.ID="editor.contrib.hover";Ys=AT=Qbe([KC(1,qe),KC(2,So),KC(3,bi),KC(4,Xt)],Ys);var ra;(function(o){o.NoAutoFocus="noAutoFocus",o.FocusIfVisible="focusIfVisible",o.AutoFocusImmediately="autoFocusImmediately"})(ra||(ra={}));class Jbe extends Te{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:[ra.NoAutoFocus,ra.FocusIfVisible,ra.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:ra.FocusIfVisible}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:T.editorTextFocus,primary:fn(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const n=Ys.get(t);if(!n)return;const s=i==null?void 0:i.focus;let r=ra.FocusIfVisible;s in ra?r=s:typeof s=="boolean"&&s&&(r=ra.AutoFocusImmediately);const a=d=>{const c=t.getPosition(),u=new k(c.lineNumber,c.column,c.lineNumber,c.column);n.showContentHover(u,1,1,d)},l=t.getOption(2)===2;n.isHoverVisible?r!==ra.NoAutoFocus?n.focus():a(l):a(l||r===ra.AutoFocusImmediately)}}class e0e extends Te{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=Ys.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=bg.get(t);if(!r)return;r.startFindDefinitionFromCursor(n).then(()=>{i.showContentHover(s,1,1,!0)})}}class t0e extends Te{constructor(){super({id:"editor.action.scrollUpHover",label:p({},"Scroll Up Hover"),alias:"Scroll Up Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:16,weight:100}})}run(e,t){const i=Ys.get(t);i&&i.scrollUp()}}class i0e extends Te{constructor(){super({id:"editor.action.scrollDownHover",label:p({},"Scroll Down Hover"),alias:"Scroll Down Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:18,weight:100}})}run(e,t){const i=Ys.get(t);i&&i.scrollDown()}}class n0e extends Te{constructor(){super({id:"editor.action.scrollLeftHover",label:p({},"Scroll Left Hover"),alias:"Scroll Left Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:15,weight:100}})}run(e,t){const i=Ys.get(t);i&&i.scrollLeft()}}class s0e extends Te{constructor(){super({id:"editor.action.scrollRightHover",label:p({},"Scroll Right Hover"),alias:"Scroll Right Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:17,weight:100}})}run(e,t){const i=Ys.get(t);i&&i.scrollRight()}}class o0e extends Te{constructor(){super({id:"editor.action.pageUpHover",label:p({},"Page Up Hover"),alias:"Page Up Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){const i=Ys.get(t);i&&i.pageUp()}}class r0e extends Te{constructor(){super({id:"editor.action.pageDownHover",label:p({},"Page Down Hover"),alias:"Page Down Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){const i=Ys.get(t);i&&i.pageDown()}}class a0e extends Te{constructor(){super({id:"editor.action.goToTopHover",label:p({},"Go To Top Hover"),alias:"Go To Bottom Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){const i=Ys.get(t);i&&i.goToTop()}}class l0e extends Te{constructor(){super({id:"editor.action.goToBottomHover",label:p({},"Go To Bottom Hover"),alias:"Go To Bottom Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){const i=Ys.get(t);i&&i.goToBottom()}}At(Ys.ID,Ys,2);_e(Jbe);_e(e0e);_e(t0e);_e(i0e);_e(n0e);_e(s0e);_e(o0e);_e(r0e);_e(a0e);_e(l0e);jg.register(BS);jg.register(NT);Zr((o,e)=>{const t=o.getColor(Ate);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 RT extends q{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!==bV||!i.range)return;const n=this._editor.getContribution(Ys.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)}}}RT.ID="editor.contrib.colorContribution";At(RT.ID,RT,2);jg.register(AS);var ZV=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},pa=function(o,e){return function(t,i){e(t,i,o)}},PT,OT;let ku=PT=class extends q{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=T.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=T.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 VS(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(PT.ID)}};ku.ID="editor.contrib.standaloneColorPickerController";ku=PT=ZV([pa(1,Xe),pa(2,Si),pa(3,Xt),pa(4,qe),pa(5,Me),pa(6,si)],ku);At(ku.ID,ku,1);const y3=8,d0e=22;let VS=OT=class extends q{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(wb,this._editor),this._position=(d=this._editor._getViewModel())===null||d===void 0?void 0:d.getPrimaryCursorState().modelState.position;const c=this._editor.getSelection(),u=c?{startLineNumber:c.startLineNumber,startColumn:c.startColumn,endLineNumber:c.endLineNumber,endColumn:c.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},h=this._register(Pl(this._body));this._register(h.onDidBlur(g=>{this.hide()})),this._register(h.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(u),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return OT.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 c0e(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 AR(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 OS(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-d0e-y3,c=s.body.enterButton;c==null||c.onClicked(()=>{this.updateEditor(),this.hide()});const u=s.header,h=u.pickedColorNode;h.style.width=l+y3+"px";const g=u.originalColorNode;g.style.width=d+"px";const f=s.header.closeButton;f==null||f.onClicked(()=>{this.hide()}),t&&(c&&(c.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}};VS.ID="editor.contrib.standaloneColorPickerWidget";VS=OT=ZV([pa(3,qe),pa(4,Si),pa(5,Xt),pa(6,Me),pa(7,si)],VS);class c0e{constructor(e,t){this.value=e,this.foundInEditor=t}}class u0e extends Wa{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=ku.get(t))===null||i===void 0||i.showOrFocus()}}class h0e extends Te{constructor(){super({id:"editor.action.hideColorPicker",label:p({},"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:T.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100}})}run(e,t){var i;(i=ku.get(t))===null||i===void 0||i.hide()}}class g0e extends Te{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:p({},"Insert Color with Standalone Color Picker"),alias:"Insert Color with Standalone Color Picker",precondition:T.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100}})}run(e,t){var i;(i=ku.get(t))===null||i===void 0||i.insertColor()}}_e(h0e);_e(g0e);mi(u0e);class Oc{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=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,u=s.getLineContent(a),h=s.getLineContent(d);let g=u.lastIndexOf(t,l-1+t.length),f=h.indexOf(i,c-1-i.length);if(g!==-1&&f!==-1)if(a===d)u.substring(g+t.length,f).indexOf(i)>=0&&(g=-1,f=-1);else{const v=u.substring(g+t.length),_=h.substring(0,f);(v.indexOf(i)>=0||_.indexOf(i)>=0)&&(g=-1,f=-1)}let m;g!==-1&&f!==-1?(n&&g+t.length0&&h.charCodeAt(f-1)===32&&(i=" "+i,f-=1),m=Oc._createRemoveBlockCommentOperations(new k(a,g+t.length+1,d,f+1),t,i)):(m=Oc._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=m.length===1?i:null);for(const v of m)r.addTrackedEditOperation(v.range,v.text)}static _createRemoveBlockCommentOperations(e,t,i){const n=[];return k.isEmpty(e)?n.push(Li.delete(new k(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(n.push(Li.delete(new k(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),n.push(Li.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(Li.replace(new k(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(s.push(Li.insert(new z(e.startLineNumber,e.startColumn),t+(n?" ":""))),s.push(Li.insert(new z(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 Ae(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 Ae(n.endLineNumber,n.endColumn+s,n.endLineNumber,n.endColumn+s)}}}class hd{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{if(e&&typeof e=="object"||typeof e=="function")for(let n of w_e(e))!S_e.call(o,n)&&n!==t&&b_e(o,n,{get:()=>e[n],enumerable:!(i=C_e(e,n))||i.enumerable});return o},L_e=(o,e,t)=>(y_e(o,e,"default"),t),D_e="5.0.2",Qp={};L_e(Qp,k0);var VW=(o=>(o[o.None=0]="None",o[o.CommonJS=1]="CommonJS",o[o.AMD=2]="AMD",o[o.UMD=3]="UMD",o[o.System=4]="System",o[o.ES2015=5]="ES2015",o[o.ESNext=99]="ESNext",o))(VW||{}),HW=(o=>(o[o.None=0]="None",o[o.Preserve=1]="Preserve",o[o.React=2]="React",o[o.ReactNative=3]="ReactNative",o[o.ReactJSX=4]="ReactJSX",o[o.ReactJSXDev=5]="ReactJSXDev",o))(HW||{}),zW=(o=>(o[o.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",o[o.LineFeed=1]="LineFeed",o))(zW||{}),$W=(o=>(o[o.ES3=0]="ES3",o[o.ES5=1]="ES5",o[o.ES2015=2]="ES2015",o[o.ES2016=3]="ES2016",o[o.ES2017=4]="ES2017",o[o.ES2018=5]="ES2018",o[o.ES2019=6]="ES2019",o[o.ES2020=7]="ES2020",o[o.ESNext=99]="ESNext",o[o.JSON=100]="JSON",o[o.Latest=99]="Latest",o))($W||{}),UW=(o=>(o[o.Classic=1]="Classic",o[o.NodeJs=2]="NodeJs",o))(UW||{}),jW=class{constructor(o,e,t,i,n){ri(this,"_onDidChange",new Qp.Emitter);ri(this,"_onDidExtraLibsChange",new Qp.Emitter);ri(this,"_extraLibs");ri(this,"_removedExtraLibs");ri(this,"_eagerModelSync");ri(this,"_compilerOptions");ri(this,"_diagnosticsOptions");ri(this,"_workerOptions");ri(this,"_onDidExtraLibsChangeTimeout");ri(this,"_inlayHintsOptions");ri(this,"_modeConfiguration");this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(o),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(n),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(o,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===o)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:o,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let n=this._extraLibs[t];n&&n.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(o){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),o&&o.length>0)for(const e of o){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let n=1;this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:n}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(o){this._compilerOptions=o||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(o){this._diagnosticsOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(o){this._workerOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(o){this._inlayHintsOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(o){}setEagerModelSync(o){this._eagerModelSync=o}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(o){this._modeConfiguration=o||Object.create(null),this._onDidChange.fire(void 0)}},x_e=D_e,KW={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},qW=new jW({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},KW),GW=new jW({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},KW),k_e=()=>IL().then(o=>o.getTypeScriptWorker()),I_e=()=>IL().then(o=>o.getJavaScriptWorker());Qp.languages.typescript={ModuleKind:VW,JsxEmit:HW,NewLineKind:zW,ScriptTarget:$W,ModuleResolutionKind:UW,typescriptVersion:x_e,typescriptDefaults:qW,javascriptDefaults:GW,getTypeScriptWorker:k_e,getJavaScriptWorker:I_e};function IL(){return Oe(()=>import("./tsMode-Bxh83DIB.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,8]))}Qp.languages.onLanguage("typescript",()=>IL().then(o=>o.setupTypeScript(qW)));Qp.languages.onLanguage("javascript",()=>IL().then(o=>o.setupJavaScript(GW)));class E_e extends Qo{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:{value:p("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),original:"Toggle Collapse Unchanged Regions"},icon:ve.map,toggled:ae.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:ae.has("isInDiffEditor"),menu:{when:ae.has("isInDiffEditor"),id:N.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Dt),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}mi(E_e);class ZW extends Qo{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:{value:p("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),original:"Toggle Show Moved Code Blocks"},precondition:ae.has("isInDiffEditor")})}run(e,...t){const i=e.get(Dt),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}mi(ZW);class YW extends Qo{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:ae.has("isInDiffEditor")})}run(e,...t){const i=e.get(Dt),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}mi(YW);zn.appendMenuItem(N.EditorTitle,{command:{id:new YW().desc.id,title:p("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:ae.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:ae.has("isInDiffEditor")},order:11,group:"1_diff",when:ae.and(T.diffEditorRenderSideBySideInlineBreakpointReached,ae.has("isInDiffEditor"))});zn.appendMenuItem(N.EditorTitle,{command:{id:new ZW().desc.id,title:p("showMoves","Show Moved Code Blocks"),icon:ve.move,toggled:gm.create("config.diffEditor.experimental.showMoves",!0),precondition:ae.has("isInDiffEditor")},order:10,group:"1_diff",when:ae.has("isInDiffEditor")});const EL={value:p("diffEditor","Diff Editor"),original:"Diff Editor"};class N_e extends Wa{constructor(){super({id:"diffEditor.switchSide",title:{value:p("switchSide","Switch Side"),original:"Switch Side"},icon:ve.arrowSwap,precondition:ae.has("isInDiffEditor"),f1:!0,category:EL})}runEditorCommand(e,t,i){const n=Im(e);if(n instanceof vu){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}mi(N_e);class T_e extends Wa{constructor(){super({id:"diffEditor.exitCompareMove",title:{value:p("exitCompareMove","Exit Compare Move"),original:"Exit Compare Move"},icon:ve.close,precondition:T.comparingMovedCode,f1:!1,category:EL,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=Im(e);n instanceof vu&&n.exitCompareMove()}}mi(T_e);class M_e extends Wa{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:{value:p("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),original:"Collapse All Unchanged Regions"},icon:ve.fold,precondition:ae.has("isInDiffEditor"),f1:!0,category:EL})}runEditorCommand(e,t,...i){const n=Im(e);n instanceof vu&&n.collapseAllUnchangedRegions()}}mi(M_e);class A_e extends Wa{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:{value:p("showAllUnchangedRegions","Show All Unchanged Regions"),original:"Show All Unchanged Regions"},icon:ve.unfold,precondition:ae.has("isInDiffEditor"),f1:!0,category:EL})}runEditorCommand(e,t,...i){const n=Im(e);n instanceof vu&&n.showAllUnchangedRegions()}}mi(A_e);const XW={value:p("accessibleDiffViewer","Accessible Diff Viewer"),original:"Accessible Diff Viewer"};class km extends Qo{constructor(){super({id:km.id,title:{value:p("editor.action.accessibleDiffViewer.next","Go to Next Difference"),original:"Go to Next Difference"},category:XW,precondition:ae.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=Im(e);t==null||t.accessibleDiffViewerNext()}}km.id="editor.action.accessibleDiffViewer.next";zn.appendMenuItem(N.EditorTitle,{command:{id:km.id,title:p("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:ae.has("isInDiffEditor")},order:10,group:"2_diff",when:ae.and(T.accessibleDiffViewerVisible.negate(),ae.has("isInDiffEditor"))});class E0 extends Qo{constructor(){super({id:E0.id,title:{value:p("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),original:"Go to Previous Difference"},category:XW,precondition:ae.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=Im(e);t==null||t.accessibleDiffViewerPrev()}}E0.id="editor.action.accessibleDiffViewer.prev";function Im(o){var e;const t=o.get(Ot),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=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},O_e=function(o,e){return function(t,i){e(t,i,o)}},oT;const NL=new De("selectionAnchorSet",!1);let $d=oT=class{static get(e){return e.getContribution(oT.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=NL.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(Ae.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new as().appendText(p("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),mo(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(Ae.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()}};$d.ID="editor.contrib.selectionAnchorController";$d=oT=P_e([O_e(1,Xe)],$d);class F_e extends Te{constructor(){super({id:"editor.action.setSelectionAnchor",label:p("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:T.editorTextFocus,primary:fn(2089,2080),weight:100}})}async run(e,t){var i;(i=$d.get(t))===null||i===void 0||i.setSelectionAnchor()}}class B_e extends Te{constructor(){super({id:"editor.action.goToSelectionAnchor",label:p("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:NL})}async run(e,t){var i;(i=$d.get(t))===null||i===void 0||i.goToSelectionAnchor()}}class W_e extends Te{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:p("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:NL,kbOpts:{kbExpr:T.editorTextFocus,primary:fn(2089,2089),weight:100}})}async run(e,t){var i;(i=$d.get(t))===null||i===void 0||i.selectFromAnchorToCursor()}}class V_e extends Te{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:p("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:NL,kbOpts:{kbExpr:T.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=$d.get(t))===null||i===void 0||i.cancelSelectionAnchor()}}At($d.ID,$d,4);_e(F_e);_e(B_e);_e(W_e);_e(V_e);const H_e=M("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},p("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class z_e extends Te{constructor(){super({id:"editor.action.jumpToBracket",label:p("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:T.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=$r.get(t))===null||i===void 0||i.jumpToBracket()}}class $_e extends Te{constructor(){super({id:"editor.action.selectToBracket",label:p("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:fG("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=$r.get(t))===null||n===void 0||n.selectToBracket(s)}}class U_e extends Te{constructor(){super({id:"editor.action.removeBrackets",label:p("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:T.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=$r.get(t))===null||i===void 0||i.removeBrackets(this.id)}}class j_e{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}class $r extends q{static get(e){return e.getContribution($r.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Yt(()=>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 Ae(r.lineNumber,r.column,r.lineNumber,r.column):new Ae(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 u=a;a=l,l=u}}a&&l&&i.push(new Ae(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 u=0,h=e.length;u1&&s.sort(z.compare);const a=[];let l=0,d=0;const c=n.length;for(let u=0,h=s.length;u0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}_e(Z_e);const pg="9_cutcopypaste",Y_e=Ml||document.queryCommandSupported("cut"),JW=Ml||document.queryCommandSupported("copy"),X_e=typeof navigator.clipboard>"u"||pr?document.queryCommandSupported("paste"):!0;function IR(o){return o.register(),o}const Q_e=Y_e?IR(new pm({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:Ml?{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:pg,title:p("actions.clipboard.cutLabel","Cut"),when:T.writable,order:1},{menuId:N.CommandPalette,group:"",title:p("actions.clipboard.cutLabel","Cut"),order:1},{menuId:N.SimpleEditorContext,group:pg,title:p("actions.clipboard.cutLabel","Cut"),when:T.writable,order:1}]})):void 0,J_e=JW?IR(new pm({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:Ml?{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:pg,title:p("actions.clipboard.copyLabel","Copy"),order:2},{menuId:N.CommandPalette,group:"",title:p("actions.clipboard.copyLabel","Copy"),order:1},{menuId:N.SimpleEditorContext,group:pg,title:p("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;zn.appendMenuItem(N.MenubarEditMenu,{submenu:N.MenubarCopy,title:{value:p("copy as","Copy As"),original:"Copy As"},group:"2_ccp",order:3});zn.appendMenuItem(N.EditorContext,{submenu:N.EditorContextCopy,title:{value:p("copy as","Copy As"),original:"Copy As"},group:pg,order:3});zn.appendMenuItem(N.EditorContext,{submenu:N.EditorContextShare,title:{value:p("share","Share"),original:"Share"},group:"11_share",order:-1,when:ae.and(ae.notEquals("resourceScheme","output"),T.editorTextFocus)});zn.appendMenuItem(N.EditorTitleContext,{submenu:N.EditorTitleContextShare,title:{value:p("share","Share"),original:"Share"},group:"11_share",order:-1});zn.appendMenuItem(N.ExplorerContext,{submenu:N.ExplorerContextShare,title:{value:p("share","Share"),original:"Share"},group:"11_share",order:-1});const ik=X_e?IR(new pm({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:Ml?{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:pg,title:p("actions.clipboard.pasteLabel","Paste"),when:T.writable,order:4},{menuId:N.CommandPalette,group:"",title:p("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:N.SimpleEditorContext,group:pg,title:p("actions.clipboard.pasteLabel","Paste"),when:T.writable,order:4}]})):void 0;class eve extends Te{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:T.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(37)&&t.getSelection().isEmpty()||(rE.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),rE.forceCopyWithSyntaxHighlighting=!1)}}function eV(o,e){o&&(o.addImplementation(1e4,"code-editor",(t,i)=>{const n=t.get(Ot).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)=>(fm().execCommand(e),!0)))}eV(Q_e,"cut");eV(J_e,"copy");ik&&(ik.addImplementation(1e4,"code-editor",(o,e)=>{const t=o.get(Ot),i=o.get(Xd),n=t.getFocusedCodeEditor();return n&&n.hasTextFocus()?!n.getContainerDomNode().ownerDocument.execCommand("paste")&&Tu?(async()=>{const r=await i.readText();if(r!==""){const a=$v.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}),ik.addImplementation(0,"generic-dom",(o,e)=>(fm().execCommand("paste"),!0)));JW&&_e(eve);class Ze{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+Ze.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new Ze(this.value+Ze.sep+e)}}Ze.sep=".";Ze.None=new Ze("@@none@@");Ze.Empty=new Ze("");Ze.QuickFix=new Ze("quickfix");Ze.Refactor=new Ze("refactor");Ze.RefactorExtract=Ze.Refactor.append("extract");Ze.RefactorInline=Ze.Refactor.append("inline");Ze.RefactorMove=Ze.Refactor.append("move");Ze.RefactorRewrite=Ze.Refactor.append("rewrite");Ze.Notebook=new Ze("notebook");Ze.Source=new Ze("source");Ze.SourceOrganizeImports=Ze.Source.append("organizeImports");Ze.SourceFixAll=Ze.Source.append("fixAll");Ze.SurroundWith=Ze.Refactor.append("surround");var _o;(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"})(_o||(_o={}));function tve(o,e){return!(o.include&&!o.include.intersects(e)||o.excludes&&o.excludes.some(t=>tV(e,t,o.include))||!o.includeSourceActions&&Ze.Source.contains(e))}function ive(o,e){const t=e.kind?new Ze(e.kind):void 0;return!(o.include&&(!t||!o.include.contains(t))||o.excludes&&t&&o.excludes.some(i=>tV(t,i,o.include))||!o.includeSourceActions&&t&&Ze.Source.contains(t)||o.onlyIncludePreferredActions&&!e.isPreferred)}function tV(o,e,t){return!(!e.contains(o)||t&&e.contains(t))}class gl{static fromUser(e,t){return!e||typeof e!="object"?new gl(t.kind,t.apply,!1):new gl(gl.getKindFromUser(e,t.kind),gl.getApplyFromUser(e,t.apply),gl.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 Ze(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 nve{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){en(n)}i&&(this.action.edit=i.edit)}return this}}const iV="editor.action.codeAction",ER="editor.action.quickFix",nV="editor.action.autoFix",sV="editor.action.refactor",oV="editor.action.sourceAction",NR="editor.action.organizeImports",TR="editor.action.fixAll";class sv extends q{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:ls(e.diagnostics)?ls(t.diagnostics)?sv.codeActionsPreferredComparator(e,t):-1:ls(t.diagnostics)?1:sv.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(sv.codeActionsComparator),this.validActions=this.allActions.filter(({action:n})=>!n.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&Ze.QuickFix.contains(new Ze(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 t3={actions:[],documentation:void 0};async function ov(o,e,t,i,n,s){var r;const a=i.filter||{},l={...a,excludes:[...a.excludes||[],Ze.Notebook]},d={only:(r=a.include)===null||r===void 0?void 0:r.value,trigger:i.type},c=new SR(e,s),u=i.type===2,h=sve(o,e,u?l:a),g=new de,f=h.map(async v=>{try{n.report(v);const _=await v.provideCodeActions(e,t,d,c.token);if(_&&g.add(_),c.token.isCancellationRequested)return t3;const b=((_==null?void 0:_.actions)||[]).filter(w=>w&&ive(a,w)),C=rve(v,b,a.include);return{actions:b.map(w=>new nve(w,v)),documentation:C}}catch(_){if(Fa(_))throw _;return en(_),t3}}),m=o.onDidChange(()=>{const v=o.all(e);Bi(v,h)||c.cancel()});try{const v=await Promise.all(f),_=v.map(C=>C.actions).flat(),b=[...Ia(v.map(C=>C.documentation)),...ove(o,e,i,_)];return new sv(_,b,g)}finally{m.dispose(),c.dispose()}}function sve(o,e,t){return o.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(n=>tve(t,new Ze(n))):!0)}function*ove(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 rve(o,e,t){if(!o.documentation)return;const i=o.documentation.map(n=>({kind:new Ze(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==null?void 0:n.command}for(const n of e)if(n.kind){for(const s of i)if(s.kind.contains(new Ze(n.kind)))return s.command}}var TS;(function(o){o.OnSave="onSave",o.FromProblemsView="fromProblemsView",o.FromCodeActions="fromCodeActions"})(TS||(TS={}));async function ave(o,e,t,i,n=vt.None){var s;const r=o.get(f0),a=o.get(Ri),l=o.get(vo),d=o.get(sn);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==null?void 0:i.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==TS.OnSave,showPreview:i==null?void 0:i.preview})).isApplied)&&e.action.command)try{await a.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(c){const u=lve(c);d.error(typeof u=="string"?u:p("applyCodeActionFailed","An unknown error occurred while applying the code action"))}}function lve(o){return typeof o=="string"?o:o instanceof Error&&typeof o.message=="string"?o.message:void 0}Et.registerCommand("_executeCodeActionProvider",async function(o,e,t,i,n){if(!(e instanceof ze))throw hr();const{codeActionProvider:s}=o.get(Me),r=o.get(Si).getModel(e);if(!r)throw hr();const a=Ae.isISelection(t)?Ae.liftSelection(t):k.isIRange(t)?r.validateRange(t):void 0;if(!a)throw hr();const l=typeof i=="string"?new Ze(i):void 0,d=await ov(s,r,a,{type:1,triggerAction:_o.Default,filter:{includeSourceActions:!0,include:l}},Fd.None,vt.None),c=[],u=Math.min(d.validActions.length,typeof n=="number"?n:0);for(let h=0;hh.action)}finally{setTimeout(()=>d.dispose(),100)}});var dve=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},cve=function(o,e){return function(t,i){e(t,i,o)}},rT;let MS=rT=class{constructor(e){this.keybindingService=e}getResolver(){const e=new Ru(()=>this.keybindingService.getKeybindings().filter(t=>rT.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===NR?i={kind:Ze.SourceOrganizeImports.value}:t.command===TR&&(i={kind:Ze.SourceFixAll.value}),{resolvedKeybinding:t.resolvedKeybinding,...gl.fromUser(i,{kind:Ze.None,apply:"never"})}}));return t=>{if(t.kind){const i=this.bestKeybindingForCodeAction(t,e.value);return i==null?void 0:i.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new Ze(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)}};MS.codeActionCommands=[sV,iV,oV,NR,TR];MS=rT=dve([cve(0,Xt)],MS);M("symbolIcon.arrayForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.booleanForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("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."));M("symbolIcon.colorForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.constantForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("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."));M("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."));M("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."));M("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."));M("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."));M("symbolIcon.fileForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.folderForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("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."));M("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."));M("symbolIcon.keyForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.keywordForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("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."));M("symbolIcon.moduleForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.namespaceForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.nullForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.numberForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.objectForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.operatorForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.packageForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.propertyForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.referenceForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.snippetForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.stringForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.structForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.textForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.typeParameterForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("symbolIcon.unitForeground",{dark:be,light:be,hcDark:be,hcLight:be},p("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));M("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 rV=Object.freeze({kind:Ze.Empty,title:p("codeAction.widget.id.more","More Actions...")}),uve=Object.freeze([{kind:Ze.QuickFix,title:p("codeAction.widget.id.quickfix","Quick Fix")},{kind:Ze.RefactorExtract,title:p("codeAction.widget.id.extract","Extract"),icon:ve.wrench},{kind:Ze.RefactorInline,title:p("codeAction.widget.id.inline","Inline"),icon:ve.wrench},{kind:Ze.RefactorRewrite,title:p("codeAction.widget.id.convert","Rewrite"),icon:ve.wrench},{kind:Ze.RefactorMove,title:p("codeAction.widget.id.move","Move"),icon:ve.wrench},{kind:Ze.SurroundWith,title:p("codeAction.widget.id.surround","Surround With"),icon:ve.symbolSnippet},{kind:Ze.Source,title:p("codeAction.widget.id.source","Source Action"),icon:ve.symbolFile},rV]);function hve(o,e,t){if(!e)return o.map(s=>{var r;return{kind:"action",item:s,group:rV,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=uve.map(s=>({group:s,actions:[]}));for(const s of o){const r=s.action.kind?new Ze(s.action.kind):Ze.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:ve.sparkle}:a,label:r.action.title,disabled:!!r.action.disabled,keybinding:t(r.action)})}}return n}var gve=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},i3=function(o,e){return function(t,i){e(t,i,o)}},aT,$f;(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})($f||($f={}));let mg=aT=class extends q{constructor(e,t,i){super(),this._editor=e,this._keybindingService=t,this._onClick=this._register(new W),this.onClick=this._onClick.event,this._state=$f.Hidden,this._iconClasses=[],this._domNode=pe("div.lightBulbWidget"),this._register(ei.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(VX(this._domNode,n=>{var s;if(this.state.type!==1)return;const r=this._editor.getOption(64).experimental.showAiIcon;if((r===so.On||r===so.OnCode)&&this.state.actions.allAIFixes&&this.state.actions.validActions.length===1){const u=this.state.actions.validActions[0].action;if(!((s=u.command)===null||s===void 0)&&s.id){i.executeCommand(u.command.id,...u.command.arguments||[]),n.preventDefault();return}}this._editor.focus(),n.preventDefault();const{top:a,height:l}=gn(this._domNode),d=this._editor.getOption(66);let c=Math.floor(d/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber{(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(ye.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{var n,s,r,a;this._preferredKbLabel=(s=(n=this._keybindingService.lookupKeybinding(nV))===null||n===void 0?void 0:n.getLabel())!==null&&s!==void 0?s:void 0,this._quickFixKbLabel=(a=(r=this._keybindingService.lookupKeybinding(ER))===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),u=jy(c,l),h=d.spaceWidth*u>22,g=m=>m>2&&this._editor.getTopForLineNumber(m)===this._editor.getTopForLineNumber(m-1);let f=r;if(!h){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 $f.Showing(e,t,i,{position:{lineNumber:f,column:s.getLineContent(f).match(/^\S\s*$/)?2:1},preference:aT._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state!==$f.Hidden&&(this.state=$f.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===so.On||a===so.OnCode)if(a===so.On&&this.state.actions.allAIFixes)if(r=ve.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=ve.lightbulbSparkleAutofix:r=ve.lightbulbAutofix,n()):this.state.actions.hasAIFix?(r=ve.lightbulbSparkle,s()):(r=ve.lightBulb,s());else this.state.actions.hasAutoFix?(r=ve.lightbulbAutofix,n()):(r=ve.lightBulb,s());this._iconClasses=Ue.asClassNameArray(r),this._domNode.classList.add(...this._iconClasses)}set title(e){this._domNode.title=e}};mg.ID="editor.contrib.lightbulbWidget";mg._posPref=[0];mg=aT=gve([i3(1,Xt),i3(2,Ri)],mg);var fve=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},n3=function(o,e){return function(t,i){e(t,i,o)}},lT;let Ud=lT=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 de,s=n.add(iL(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=Ko);const d=await lae(this._languageService,n,l),c=document.createElement("span");if(c.innerHTML=(a=(r=lT._ttpTokenizer)===null||r===void 0?void 0:r.createHTML(d))!==null&&a!==void 0?a:d,this._options.editor){const u=this._options.editor.getOption(50);Jn(c,u)}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=>aV(this._openerService,i,e.isTrusted),disposables:t}}}};Ud._ttpTokenizer=qd("tokenizeToString",{createHTML(o){return o}});Ud=lT=fve([n3(1,bi),n3(2,So)],Ud);async function aV(o,e,t){try{return await o.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:pve(t)})}catch(i){return nt(i),!1}}function pve(o){return o===!0?!0:o&&Array.isArray(o.enabledCommands)?o.enabledCommands:!1}var mve=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},s3=function(o,e){return function(t,i){e(t,i,o)}},W1;let ho=W1=class{static get(e){return e.getContribution(W1.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new An,this._messageListeners=new de,this._mouseOverMessage=!1,this._editor=e,this._visible=W1.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){mo(jc(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=jc(e)?iL(e,{actionHandler:{callback:n=>aV(this._openerService,n,jc(e)?e.isTrusted:void 0),disposables:this._messageListeners}}):void 0,this._messageWidget.value=new o3(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(ye.debounce(this._editor.onDidBlurEditorText,(n,s)=>s,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&Qn(jo(),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(J(this._messageWidget.value.getDomNode(),Se.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(J(this._messageWidget.value.getDomNode(),Se.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(o3.fadeOut(this._messageWidget.value))}};ho.ID="editor.contrib.messageController";ho.MESSAGE_VISIBLE=new De("messageVisible",!1,p("messageVisible","Whether the editor is currently showing an inline message"));ho=W1=mve([s3(1,Xe),s3(2,So)],ho);const _ve=Rn.bindToContribution(ho.get);we(new _ve({id:"leaveEditorMessage",precondition:ho.MESSAGE_VISIBLE,handler:o=>o.closeMessage(),kbOpts:{weight:130,primary:9}}));let o3=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)}};At(ho.ID,ho,4);var lV=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},dT=function(o,e){return function(t,i){e(t,i,o)}};const dV="acceptSelectedCodeAction",cV="previewSelectedCodeAction";class vve{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 cT=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 C0(e,Vo);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=Ue.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=Ee(e.group.icon.color.id))):(i.icon.className=Ue.asClassName(ve.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=uV(e.label),i.keybinding.set(e.keybinding),iQ(!!e.keybinding,i.keybinding.element);const a=(s=this._keybindingService.lookupKeybinding(dV))===null||s===void 0?void 0:s.getLabel(),l=(r=this._keybindingService.lookupKeybinding(cV))===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){}};cT=lV([dT(1,Xt)],cT);class bve extends UIEvent{constructor(){super("acceptSelectedAction")}}class r3 extends UIEvent{constructor(){super("previewSelectedAction")}}function Cve(o){if(o.kind==="action")return o.label}let uT=class extends q{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 tn),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 cT(t,this._keybindingService),new vve],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:Cve},accessibilityProvider:{getAriaLabel:l=>{if(l.kind==="action"){let d=l.label?uV(l==null?void 0: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(Fg),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 u=this.domNode.ownerDocument.getElementById(this._list.getElementID(c));if(u){u.style.width="auto";const h=u.getBoundingClientRect().width;return u.style.width="",h}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 r3:new bve;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 r3):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([])}};uT=lV([dT(4,Gd),dT(5,Xt)],uT);function uV(o){return o.replace(/\r\n|\r|\n/g," ")}var wve=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},nk=function(o,e){return function(t,i){e(t,i,o)}};M("actionBar.toggledBackground",{dark:Ih,light:Ih,hcDark:Ih,hcLight:Ih},p("actionBar.toggledBackground","Background color for toggled action items in action bar."));const _g={Visible:new De("codeActionMenuVisible",!1,p("codeActionMenuVisible","Whether the action widget list is visible"))},Hg=bt("actionWidgetService");let vg=class extends q{get isVisible(){return _g.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new An)}show(e,t,i,n,s,r,a){const l=_g.Visible.bindTo(this._contextKeyService),d=this._instantiationService.createInstance(uT,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 de,a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-block"),r.add(J(l,Se.MOUSE_DOWN,f=>f.stopPropagation()));const d=document.createElement("div"),c=e.appendChild(d);c.classList.add("context-view-pointerBlock"),r.add(J(c,Se.POINTER_MOVE,()=>c.remove())),r.add(J(c,Se.MOUSE_DOWN,()=>c.remove()));let u=0;if(i.length){const f=this._createActionBar(".action-widget-action-bar",i);f&&(s.appendChild(f.getContainer().parentElement),r.add(f),u=f.getContainer().offsetWidth)}const h=(n=this._list.value)===null||n===void 0?void 0:n.layout(u);s.style.width=`${h}px`;const g=r.add(Pl(e));return r.add(g.onDidBlur(()=>this.hide())),r}_createActionBar(e,t){if(!t.length)return;const i=pe(e),n=new Cr(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)}};vg=wve([nk(0,Gd),nk(1,Xe),nk(2,qe)],vg);xt(Hg,vg,1);const N0=1100;mi(class extends Qo{constructor(){super({id:"hideCodeActionWidget",title:{value:p("hideCodeActionWidget.title","Hide action widget"),original:"Hide action widget"},precondition:_g.Visible,keybinding:{weight:N0,primary:9,secondary:[1033]}})}run(o){o.get(Hg).hide()}});mi(class extends Qo{constructor(){super({id:"selectPrevCodeAction",title:{value:p("selectPrevCodeAction.title","Select previous action"),original:"Select previous action"},precondition:_g.Visible,keybinding:{weight:N0,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(o){const e=o.get(Hg);e instanceof vg&&e.focusPrevious()}});mi(class extends Qo{constructor(){super({id:"selectNextCodeAction",title:{value:p("selectNextCodeAction.title","Select next action"),original:"Select next action"},precondition:_g.Visible,keybinding:{weight:N0,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(o){const e=o.get(Hg);e instanceof vg&&e.focusNext()}});mi(class extends Qo{constructor(){super({id:dV,title:{value:p("acceptSelected.title","Accept selected action"),original:"Accept selected action"},precondition:_g.Visible,keybinding:{weight:N0,primary:3,secondary:[2137]}})}run(o){const e=o.get(Hg);e instanceof vg&&e.acceptSelected()}});mi(class extends Qo{constructor(){super({id:cV,title:{value:p("previewSelected.title","Preview selected action"),original:"Preview selected action"},precondition:_g.Visible,keybinding:{weight:N0,primary:2051}})}run(o){const e=o.get(Hg);e instanceof vg&&e.acceptSelected(!0)}});const hV=new De("supportedCodeAction","");class Sve extends q{constructor(e,t,i,n=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=n,this._autoTriggerTimer=this._register(new qr),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=>dA(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:_o.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)===so.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 Lh;(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(Fa(r))return gV;throw r})}cancel(){this._cancellablePromise.cancel()}}o.Triggered=e})(Lh||(Lh={}));const gV=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1});class yve extends q{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 An),this._state=Lh.Empty,this._onDidChangeState=this._register(new W),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=hV.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(Lh.Empty,!0))}_settingEnabledNearbyQuickfixes(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes",{resource:t==null?void 0:t.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(Lh.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 Sve(this._editor,this._markerService,i=>{var n;if(!i){this.setState(Lh.Empty);return}const s=i.selection.getStartPosition(),r=_n(async a=>{var l,d,c,u,h,g;if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===1&&(i.trigger.triggerAction===_o.QuickFix||!((d=(l=i.trigger.filter)===null||l===void 0?void 0:l.include)===null||d===void 0)&&d.contains(Ze.QuickFix))){const f=await ov(this._registry,e,i.selection,i.trigger,Fd.None,a),m=[...f.allActions];if(a.isCancellationRequested)return gV;if(!((c=f.validActions)===null||c===void 0?void 0:c.some(_=>_.action.kind?Ze.QuickFix.contains(new Ze(_.action.kind)):!1))){const _=this._markerService.read({resource:e.uri});if(_.length>0){const b=i.selection.getPosition();let C=b,w=Number.MAX_VALUE;const S=[...f.validActions];for(const y of _){const I=y.endColumn,E=y.endLineNumber,R=y.startLineNumber;if(E===b.lineNumber||R===b.lineNumber){C=new z(E,I);const j={type:i.trigger.type,triggerAction:i.trigger.triggerAction,filter:{include:!((u=i.trigger.filter)===null||u===void 0)&&u.include?(h=i.trigger.filter)===null||h===void 0?void 0:h.include:Ze.QuickFix},autoApply:i.trigger.autoApply,context:{notAvailableMessage:((g=i.trigger.context)===null||g===void 0?void 0:g.notAvailableMessage)||"",position:C}},O=new Ae(C.lineNumber,C.column,C.lineNumber,C.column),$=await ov(this._registry,e,O,j,Fd.None,a);if($.validActions.length!==0){for(const K of $.validActions)K.highlightRange=K.action.isPreferred;f.allActions.length===0&&m.push(...$.allActions),Math.abs(b.column-I)E.findIndex(R=>R.action.title===y.action.title)===I);return x.sort((y,I)=>y.action.isPreferred&&!I.action.isPreferred?-1:!y.action.isPreferred&&I.action.isPreferred||y.action.isAI&&!I.action.isAI?1:!y.action.isAI&&I.action.isAI?-1:0),{validActions:x,allActions:m,documentation:f.documentation,hasAutoFix:f.hasAutoFix,hasAIFix:f.hasAIFix,allAIFixes:f.allAIFixes,dispose:()=>{f.dispose()}}}}}return ov(this._registry,e,i.selection,i.trigger,Fd.None,a)});i.trigger.type===1&&((n=this._progressService)===null||n===void 0||n.showWhile(r,250)),this.setState(new Lh.Triggered(i.trigger,s,r))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:_o.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 Lve=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},id=function(o,e){return function(t,i){e(t,i,o)}},V1;const Dve="quickfix-edit-highlight";let Cu=V1=class extends q{static get(e){return e.getContribution(V1.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 An),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new yve(this._editor,s.codeActionProvider,t,i,r,l)),this._register(this._model.onDidChangeState(u=>this.update(u))),this._lightBulbWidget=new Ru(()=>{const u=this._editor.getContribution(mg.ID);return u&&this._register(u.onClick(h=>this.showCodeActionList(h.actions,h,{includeDisabledActions:!1,fromLightbulb:!0}))),u}),this._resolver=n.createInstance(MS),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=ho.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(ave,e,TS.FromCodeActions,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:_o.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){nt(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 u=this.tryGetValidActionToApply(e.trigger,d);if(u){try{(s=this._lightBulbWidget.value)===null||s===void 0||s.hide(),await this._applyCodeAction(u,!1,!1)}finally{d.dispose()}return}if(e.trigger.context){const h=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,d);if(h&&h.action.disabled){(r=ho.get(this._editor))===null||r===void 0||r.showMessage(h.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=ho.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=z.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 u;if(await d.resolve(c),!c.isCancellationRequested)return{canPreview:!!(!((u=d.action.edit)===null||u===void 0)&&u.edits.length)}},onFocus:d=>{var c,u;if(d&&d.highlightRange&&d.action.diagnostics){const h=[{range:d.action.diagnostics[0],options:V1.DECORATION}];n.set(h);const g=d.action.diagnostics[0],f=(u=(c=this._editor.getModel())===null||c===void 0?void 0:c.getWordAtPosition({lineNumber:g.startLineNumber,column:g.startColumn}))===null||u===void 0?void 0:u.word;hu(p("editingNewSelection","Context: {0} at line {1} and column {2}.",f,g.startLineNumber,g.startColumn))}else n.clear()}};this._actionWidgetService.show("codeActionWidget",!0,hve(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=gn(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==null?void 0: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}};Cu.ID="editor.contrib.codeActionController";Cu.DECORATION=st.register({description:"quickfix-highlight",className:Dve});Cu=V1=Lve([id(1,Yl),id(2,Xe),id(3,qe),id(4,Me),id(5,Bu),id(6,Ri),id(7,Dt),id(8,Hg),id(9,qe)],Cu);Zr((o,e)=>{((n,s)=>{s&&e.addRule(`.monaco-editor ${n} { background-color: ${s}; }`)})(".quickfix-edit-highlight",o.getColor(wl));const i=o.getColor(Ic);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${xa(o.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});function T0(o){return ae.regex(hV.keys()[0],new RegExp("(\\s|^)"+qo(o.value)+"\\b"))}const MR={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 zg(o,e,t,i,n=_o.Default){if(o.hasModel()){const s=Cu.get(o);s==null||s.manualTriggerAtCurrentPosition(e,n,t,i)}}class xve extends Te{constructor(){super({id:ER,label:p("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:ae.and(T.writable,T.hasCodeActionsProvider),kbOpts:{kbExpr:T.textInputFocus,primary:2137,weight:100}})}run(e,t){return zg(t,p("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0,_o.QuickFix)}}class kve extends Rn{constructor(){super({id:iV,precondition:ae.and(T.writable,T.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:MR}]}})}runEditorCommand(e,t,i){const n=gl.fromUser(i,{kind:Ze.Empty,apply:"ifSingle"});return zg(t,typeof(i==null?void 0: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 Ive extends Te{constructor(){super({id:sV,label:p("refactor.label","Refactor..."),alias:"Refactor...",precondition:ae.and(T.writable,T.hasCodeActionsProvider),kbOpts:{kbExpr:T.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:ae.and(T.writable,T0(Ze.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:MR}]}})}run(e,t,i){const n=gl.fromUser(i,{kind:Ze.Refactor,apply:"never"});return zg(t,typeof(i==null?void 0: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:Ze.Refactor.contains(n.kind)?n.kind:Ze.None,onlyIncludePreferredActions:n.preferred},n.apply,_o.Refactor)}}class Eve extends Te{constructor(){super({id:oV,label:p("source.label","Source Action..."),alias:"Source Action...",precondition:ae.and(T.writable,T.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:ae.and(T.writable,T0(Ze.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:MR}]}})}run(e,t,i){const n=gl.fromUser(i,{kind:Ze.Source,apply:"never"});return zg(t,typeof(i==null?void 0: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:Ze.Source.contains(n.kind)?n.kind:Ze.None,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply,_o.SourceAction)}}class Nve extends Te{constructor(){super({id:NR,label:p("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:ae.and(T.writable,T0(Ze.SourceOrganizeImports)),kbOpts:{kbExpr:T.textInputFocus,primary:1581,weight:100}})}run(e,t){return zg(t,p("editor.action.organize.noneMessage","No organize imports action available"),{include:Ze.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",_o.OrganizeImports)}}class Tve extends Te{constructor(){super({id:TR,label:p("fixAll.label","Fix All"),alias:"Fix All",precondition:ae.and(T.writable,T0(Ze.SourceFixAll))})}run(e,t){return zg(t,p("fixAll.noneMessage","No fix all action available"),{include:Ze.SourceFixAll,includeSourceActions:!0},"ifSingle",_o.FixAll)}}class Mve extends Te{constructor(){super({id:nV,label:p("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:ae.and(T.writable,T0(Ze.QuickFix)),kbOpts:{kbExpr:T.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return zg(t,p("editor.action.autoFix.noneMessage","No auto fixes available"),{include:Ze.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",_o.AutoFix)}}At(Cu.ID,Cu,3);At(mg.ID,mg,4);_e(xve);_e(Ive);_e(Eve);_e(Nve);_e(Mve);_e(Tve);we(new kve);xi.as(Va.Configuration).registerConfiguration({...Xy,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:p("showCodeActionHeaders","Enable/disable showing group headers in the Code Action menu."),default:!0}}});xi.as(Va.Configuration).registerConfiguration({...Xy,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 hT{constructor(){this.lenses=[],this._disposables=new de}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 fV(o,e,t){const i=o.ordered(e),n=new Map,s=new hT,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){en(d)}});return await Promise.all(r),s.lenses=s.lenses.sort((a,l)=>a.symbol.range.startLineNumberl.symbol.range.startLineNumber?1:n.get(a.provider)n.get(l.provider)?1:a.symbol.range.startColumnl.symbol.range.startColumn?1:0),s}Et.registerCommand("_executeCodeLensProvider",function(o,...e){let[t,i]=e;qt(ze.isUri(t)),qt(typeof i=="number"||!i);const{codeLensProvider:n}=o.get(Me),s=o.get(Si).getModel(t);if(!s)throw hr();const r=[],a=new de;return fV(n,s,vt.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,vt.None)).then(u=>r.push(u||c.symbol)));return Promise.all(d)}).then(()=>r).finally(()=>{setTimeout(()=>a.dispose(),100)})});var Ave=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},Rve=function(o,e){return function(t,i){e(t,i,o)}};const pV=bt("ICodeLensCache");class a3{constructor(e,t){this.lineCount=e,this.data=t}}let gT=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new Pu(20,.75);const t="codelens/cache";g_(Ai,()=>e.remove(t,1));const i="codelens/cache2",n=e.get(i,1,"{}");this._deserialize(n),ye.once(e.onWillSaveState)(s=>{s.reason===rb.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 hT;n.add({lenses:i,dispose:()=>{}},this._fakeProvider);const s=new a3(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 hT;r.add({lenses:s,dispose(){}},this._fakeProvider),this._cache.set(i,new a3(n.lineCount,r))}}catch{}}};gT=Ave([Rve(0,Xr)],gT);xt(pV,gT,1);class Pve{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 TL{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${TL._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{d.symbol.command&&l.push(d.symbol),i.addDecoration({range:d.symbol.range,options:l3},u=>this._decorationIds[c]=u),a?a=k.plusRange(a,d.symbol.range):a=k.lift(d.symbol.range)}),this._viewZone=new Pve(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 TL(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t==null||t.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{const 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:l3},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=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},i_=function(o,e){return function(t,i){e(t,i,o)}};let Jp=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 de,this._localToDispose=new de,this._lenses=[],this._oldCodeLensModels=new de,this._provideCodeLensDebounce=i.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=i.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new Yt(()=>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",co.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&&lu(()=>{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 Yt(()=>{var n;const s=Date.now();(n=this._getCodeLensModelPromise)===null||n===void 0||n.cancel(),this._getCodeLensModelPromise=_n(r=>fV(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()},nt)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(je(()=>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 sk;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(je(()=>{if(this._editor.getModel()){const n=Ra.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==null?void 0:s.tagName)==="SPAN"&&(s=s.parentElement),(s==null?void 0: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 sk;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=Ra.capture(this._editor),r=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const d=new sk;let c=0,u=0;for(;uthis._resolveCodeLensesInViewportSoon())),c++,u++)}for(;cthis._resolveCodeLensesInViewportSoon())),u++;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=_n(a=>{const l=i.map((d,c)=>{const u=new Array(d.length),h=d.map((g,f)=>!g.symbol.command&&typeof g.provider.resolveCodeLens=="function"?Promise.resolve(g.provider.resolveCodeLens(t,g.symbol,a)).then(m=>{u[f]=m},en):(u[f]=g.symbol,Promise.resolve(void 0)));return Promise.all(h).then(()=>{!a.isCancellationRequested&&!n[c].isDisposed()&&n[c].updateCommands(u)})});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=>{nt(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}};Jp.ID="css.editor.codeLens";Jp=Ove([i_(1,Me),i_(2,wr),i_(3,Ri),i_(4,sn),i_(5,pV)],Jp);At(Jp.ID,Jp,1);_e(class extends Te{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:T.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(Ha),n=e.get(Ri),s=e.get(sn),r=t.getSelection().positionLineNumber,a=t.getContribution(Jp.ID);if(!a)return;const l=await a.getModel();if(!l)return;const d=[];for(const h of l.lenses)h.symbol.command&&h.symbol.range.startLineNumber===r&&d.push({label:h.symbol.command.title,command:h.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 u=c.command;if(l.isDisposed){const h=await a.getModel(),g=h==null?void 0:h.lenses.find(f=>{var m;return f.symbol.range.startLineNumber===r&&((m=f.symbol.command)===null||m===void 0?void 0:m.title)===u.title});if(!g||!g.symbol.command)return;u=g.symbol.command}try{await n.executeCommand(u.id,...u.arguments||[])}catch(h){s.error(h)}}});var Fve=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},ok=function(o,e){return function(t,i){e(t,i,o)}};class AR{constructor(e,t){this._editorWorkerClient=new BM(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 Y(new kt(Math.round(255*s.red),Math.round(255*s.green),Math.round(255*s.blue),r)),l=r?Y.Format.CSS.formatRGB(a):Y.Format.CSS.formatRGBA(a),d=r?Y.Format.CSS.formatHSL(a):Y.Format.CSS.formatHSLA(a),c=r?Y.Format.CSS.formatHex(a):Y.Format.CSS.formatHexA(a),u=[];return u.push({label:l,textEdit:{range:n,text:l}}),u.push({label:d,textEdit:{range:n,text:d}}),u.push({label:c,textEdit:{range:n,text:c}}),u}}let fT=class extends q{constructor(e,t,i){super(),this._register(i.colorProvider.register("*",new AR(e,t)))}};fT=Fve([ok(0,Si),ok(1,si),ok(2,Me)],fT);_L(fT);async function mV(o,e,t,i=!0){return RR(new Bve,o,e,t,i)}function _V(o,e,t,i){return Promise.resolve(t.provideColorPresentations(o,e,i))}class Bve{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 Wve{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 Vve{constructor(e){this.colorInfo=e}async compute(e,t,i,n){const s=await e.provideColorPresentations(t,this.colorInfo,vt.None);return Array.isArray(s)&&n.push(...s),Array.isArray(s)}}async function RR(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 AR)r=c;else try{await o.compute(c,t,i,a)&&(s=!0)}catch(u){en(u)}}return s?a:r&&n?(await o.compute(r,t,i,a),a):[]}function vV(o,e){const{colorProvider:t}=o.get(Me),i=o.get(Si).getModel(e);if(!i)throw hr();const n=o.get(Dt).getValue("editor.defaultColorDecorators",{resource:e});return{model:i,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:n}}Et.registerCommand("_executeDocumentColorProvider",function(o,...e){const[t]=e;if(!(t instanceof ze))throw hr();const{model:i,colorProviderRegistry:n,isDefaultColorDecoratorsEnabled:s}=vV(o,t);return RR(new Wve,n,i,vt.None,s)});Et.registerCommand("_executeColorPresentationProvider",function(o,...e){const[t,i]=e,{uri:n,range:s}=i;if(!(n instanceof ze)||!Array.isArray(t)||t.length!==4||!k.isIRange(s))throw hr();const{model:r,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=vV(o,n),[d,c,u,h]=t;return RR(new Vve({range:s,color:{red:d,green:c,blue:u,alpha:h}}),a,r,vt.None,l)});var Hve=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},rk=function(o,e){return function(t,i){e(t,i,o)}},pT;const bV=Object.create({});let wu=pT=class extends q{constructor(e,t,i,n){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new de),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new o0(this._editor),this._decoratorLimitReporter=new zve,this._colorDecorationClassRefs=this._register(new de),this._debounceInformation=n.for(i.colorProvider,"Document Colors",{min:pT.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 qr,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=_n(async e=>{const t=this._editor.getModel();if(!t)return[];const i=new ds(!1),n=await mV(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){nt(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:st.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;sthis._colorDatas.has(n.id));return i.length===0?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};wu.ID="editor.contrib.colorDetector";wu.RECOMPUTE_TIME=1e3;wu=pT=Hve([rk(1,Dt),rk(2,Me),rk(3,wr)],wu);class zve{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())}}At(wu.ID,wu,1);class $ve{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.backgroundColor=r.getColor(xw)||Y.white})),this._register(J(this._pickedColorNode,Se.CLICK,()=>this.model.selectNextColorPresentation())),this._register(J(this._originalColorNode,Se.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=Y.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 jve(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=Y.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 jve extends q{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"),le(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),le(this._button,t),le(t,Bo(".button"+Ue.asCSSSelector(Zi("color-picker-close",ve.close,p("closeIcon","Icon to close the color picker"))))).classList.add("close-icon"),this._button.onclick=()=>{this._onClicked.fire()}}}class Kve extends q{constructor(e,t,i,n=!1){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=Bo(".colorpicker-body"),le(e,this._domNode),this._saturationBox=new qve(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 Gve(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 Zve(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 Yve(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 Y(new pl(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new Y(new pl(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=(1-e)*360;this.model.color=new Y(new pl(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 qve extends q{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=Bo(".saturation-wrap"),le(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",le(this._domNode,this._canvas),this.selection=Bo(".saturation-selection"),le(this._domNode,this.selection),this.layout(),this._register(J(this._domNode,Se.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 vm);const t=gn(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=J(e.target.ownerDocument,Se.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 Y(new pl(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=Y.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 CV extends q{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=le(e,Bo(".standalone-strip")),this.overlay=le(this.domNode,Bo(".standalone-overlay"))):(this.domNode=le(e,Bo(".strip")),this.overlay=le(this.domNode,Bo(".overlay"))),this.slider=le(this.domNode,Bo(".slider")),this.slider.style.top="0px",this._register(J(this.domNode,Se.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 vm),i=gn(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=J(e.target.ownerDocument,Se.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 Gve extends CV{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 Y(new kt(t,i,n,1)),r=new Y(new kt(t,i,n,0));this.overlay.style.background=`linear-gradient(to bottom, ${s} 0%, ${r} 100%)`}getValue(e){return e.hsva.a}}class Zve extends CV{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class Yve extends q{constructor(e){super(),this._onClicked=this._register(new W),this.onClicked=this._onClicked.event,this._button=le(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 Xve extends Gr{constructor(e,t,i,n,s=!1){super(),this.model=t,this.pixelRatio=i,this._register(yv.onDidChange(()=>this.layout()));const r=Bo(".colorpicker-widget");e.appendChild(r),this.header=this._register(new Uve(r,this.model,n,s)),this.body=this._register(new Kve(r,this.model,this.pixelRatio,s))}layout(){this.body.layout()}}var wV=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},SV=function(o,e){return function(t,i){e(t,i,o)}};class Qve{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 AS=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,i){return rn.fromPromise(this._computeAsync(e,t,i))}async _computeAsync(e,t,i){if(!this._editor.hasModel())return[];const n=wu.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 yV(this,this._editor.getModel(),r.colorInfo,r.provider)]}return[]}renderHoverParts(e,t){return LV(this,this._editor,this._themeService,t,e)}};AS=wV([SV(1,Sn)],AS);class Jve{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n}}let wb=class{constructor(e,t){this._editor=e,this._themeService=t,this._color=null}async createColorHover(e,t,i){if(!this._editor.hasModel()||!wu.get(this._editor))return null;const s=await mV(i,this._editor.getModel(),vt.None);let r=null,a=null;for(const u of s){const h=u.colorInfo;k.containsRange(h.range,e.range)&&(r=h,a=u.provider)}const l=r??e,d=a??t,c=!!r;return{colorHover:await yV(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 H1(this._editor.getModel(),t,this._color,i,e),i=DV(this._editor,i,t))}renderHoverParts(e,t){return LV(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};wb=wV([SV(1,Sn)],wb);async function yV(o,e,t,i){const n=e.getValueInRange(t.range),{red:s,green:r,blue:a,alpha:l}=t.color,d=new kt(Math.round(s*255),Math.round(r*255),Math.round(a*255),l),c=new Y(d),u=await _V(e,t,i,vt.None),h=new $ve(c,[],0);return h.colorPresentations=u||[],h.guessColorPresentation(c,n),o instanceof AS?new Qve(o,k.lift(t.range),h,i):new Jve(o,k.lift(t.range),h,i)}function LV(o,e,t,i,n){if(i.length===0||!e.hasModel())return q.None;if(n.setMinimumDimensions){const h=e.getOption(66)+8;n.setMinimumDimensions(new Rt(302,h))}const s=new de,r=i[0],a=e.getModel(),l=r.model,d=s.add(new Xve(n.fragment,l,e.getOption(141),t,o instanceof wb));n.setColorPicker(d);let c=!1,u=new k(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn);if(o instanceof wb){const h=i[0].model.color;o.color=h,H1(a,l,h,u,r),s.add(l.onColorFlushed(g=>{o.color=g}))}else s.add(l.onColorFlushed(async h=>{await H1(a,l,h,u,r),c=!0,u=DV(e,u,l,n)}));return s.add(l.onDidChangeColor(h=>{H1(a,l,h,u,r)})),s.add(e.onDidChangeModelContent(h=>{c?c=!1:(n.hide(),e.focus())})),s}function DV(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 H1(o,e,t,i,n){const s=await _V(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,vt.None);e.colorPresentations=s||[]}function mT(o,e){return!!o[e]}class ak{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=mT(e.event,t.triggerModifier),this.hasSideBySideModifier=mT(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class c3{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=mT(e,t.triggerModifier)}}class FC{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 u3(o){return o==="altKey"?It?new FC(57,"metaKey",6,"altKey"):new FC(5,"ctrlKey",6,"altKey"):It?new FC(6,"altKey",57,"metaKey"):new FC(6,"altKey",5,"ctrlKey")}class ML extends q{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==null?void 0:t.extractLineNumberFromMouseEvent)!==null&&i!==void 0?i:n=>n.target.position?n.target.position.lineNumber:0,this._opts=u3(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=u3(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 ak(n,this._opts)))),this._register(this._editor.onMouseDown(n=>this._onEditorMouseDown(new ak(n,this._opts)))),this._register(this._editor.onMouseUp(n=>this._onEditorMouseUp(new ak(n,this._opts)))),this._register(this._editor.onKeyDown(n=>this._onEditorKeyDown(new c3(n,this._opts)))),this._register(this._editor.onKeyUp(n=>this._onEditorKeyUp(new c3(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 ebe=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)}};let Su=class extends Vp{constructor(e,t,i,n,s,r,a,l,d,c,u,h,g){super(e,{...n.getRawOptions(),overflowWidgetsDomNode:n.getOverflowWidgetsDomNode()},i,s,r,a,l,d,c,u,h,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){ry(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};Su=ebe([nd(4,qe),nd(5,Ot),nd(6,Ri),nd(7,Xe),nd(8,Sn),nd(9,sn),nd(10,Zl),nd(11,si),nd(12,Me)],Su);const h3=new Y(new kt(0,122,204)),tbe={showArrow:!0,showFrame:!0,className:"",frameColor:h3,arrowColor:h3,keepEditorSelection:!1},ibe="vs.editor.contrib.zoneWidget";class nbe{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 sbe{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class AL{constructor(e){this._editor=e,this._ruleName=AL._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),VI(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(){VI(this._ruleName),pw(`.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()}}AL._IdGenerator=new BA(".arrow-decoration-");class obe{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new de,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=gd(t),ry(this.options,tbe,!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 AL(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:st.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 h=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,h)}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(h=>{this._viewZone&&h.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new nbe(r,i.lineNumber,i.column,t,g=>this._onViewZoneTop(g),g=>this._onViewZoneHeight(g),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=h.addZone(this._viewZone),this._overlayWidget=new sbe(ibe+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const h=this.options.frameWidth?this.options.frameWidth:d;this.container.style.borderTopWidth=h+"px",this.container.style.borderBottomWidth=h+"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 u=this.editor.getModel();if(u){const h=u.validateRange(new k(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(h,h.startLineNumber===u.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 ss(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 xV=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},kV=function(o,e){return function(t,i){e(t,i,o)}};const IV=bt("IPeekViewService");xt(IV,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 Zs;(function(o){o.inPeekEditor=new De("inReferenceSearchEditor",!0,p("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),o.notInPeekEditor=o.inPeekEditor.toNegated()})(Zs||(Zs={}));let Sb=class{constructor(e,t){e instanceof Su&&Zs.inPeekEditor.bindTo(t)}dispose(){}};Sb.ID="editor.contrib.referenceController";Sb=xV([kV(1,Xe)],Sb);At(Sb.ID,Sb,0);function rbe(o){const e=o.get(Ot).getFocusedCodeEditor();return e instanceof Su?e.getParentEditor():e}const abe={headerBackgroundColor:Y.white,primaryHeadingColor:Y.fromHex("#333333"),secondaryHeadingColor:Y.fromHex("#6c6c6cb3")};let RS=class extends obe{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new W,this.onDidClose=this._onDidClose.event,ry(this.options,abe,!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"),Wi(this._titleElement,"click",s=>this._onTitleClick(s))),le(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=pe("span.filename"),this._secondaryHeading=pe("span.dirname"),this._metaHeading=pe("span.meta"),le(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=pe(".peekview-actions");le(this._headElement,i);const n=this._getActionBarOptions();this._actionbarWidget=new Cr(i,n),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new Rs("peekview.close",p("label.close","Close"),Ue.asClassName(ve.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:qce.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:$n(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,oo(this._metaHeading)):xs(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`)}};RS=xV([kV(2,qe)],RS);const lbe=M("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:Y.black,hcLight:Y.white},p("peekViewTitleBackground","Background color of the peek view title area.")),EV=M("peekViewTitleLabel.foreground",{dark:Y.white,light:Y.black,hcDark:Y.white,hcLight:Fr},p("peekViewTitleForeground","Color of the peek view title.")),NV=M("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},p("peekViewTitleInfoForeground","Color of the peek view title info.")),dbe=M("peekView.border",{dark:Ks,light:Ks,hcDark:Lt,hcLight:Lt},p("peekViewBorder","Color of the peek view borders and arrow.")),cbe=M("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:Y.black,hcLight:Y.white},p("peekViewResultsBackground","Background color of the peek view result list."));M("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:Y.white,hcLight:Fr},p("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));M("peekViewResult.fileForeground",{dark:Y.white,light:"#1E1E1E",hcDark:Y.white,hcLight:Fr},p("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));M("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},p("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));M("peekViewResult.selectionForeground",{dark:Y.white,light:"#6C6C6C",hcDark:Y.white,hcLight:Fr},p("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const Pc=M("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:Y.black,hcLight:Y.white},p("peekViewEditorBackground","Background color of the peek view editor."));M("peekViewEditorGutter.background",{dark:Pc,light:Pc,hcDark:Pc,hcLight:Pc},p("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));M("peekViewEditorStickyScroll.background",{dark:Pc,light:Pc,hcDark:Pc,hcLight:Pc},p("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));M("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},p("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));M("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},p("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));M("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:fi,hcLight:fi},p("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));class yu{constructor(e,t,i,n){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=n,this.id=ZE.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,br(this.uri),this.range.startLineNumber,this.range.startColumn):p("aria.oneReference","in {0} on line {1} at column {2}",br(this.uri),this.range.startLineNumber,this.range.startColumn)}}class ube{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),u=i.getValueInRange(d).replace(/^\s+/,""),h=i.getValueInRange(e),g=i.getValueInRange(c).replace(/\s+$/,"");return{value:u+h+g,highlight:{start:u.length,end:u.length+h.length}}}}class yb{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new Gi}dispose(){jt(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}",br(this.uri),this.uri.fsPath):p("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,br(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 ube(i))}catch(i){nt(i)}return this}}class go{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(go._compareReferences);let n;for(const s of e)if((!n||!pi.isEqual(n.uri,s.uri,!0))&&(n=new yb(this,s.uri),this.groups.push(n)),n.children.length===0||go._compareReferences(s,n.children[n.children.length-1])!==0){const r=new yu(i===s,n,s,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(r),n.children.push(r)}}dispose(){jt(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new go(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+10?(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:Qh(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.prefixLens.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 pi.compare(e.uri,t.uri)||k.compareRangesUsingStarts(e.range,t.range)}}var RL=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},PL=function(o,e){return function(t,i){e(t,i,o)}},_T;let vT=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof go||e instanceof yb}getChildren(e){if(e instanceof go)return e.groups;if(e instanceof yb)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};vT=RL([PL(0,Xs)],vT);class hbe{getHeight(){return 23}getTemplateId(e){return e instanceof yb?Lb.id:M0.id}}let bT=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof yu){const i=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(i)return i.value}return br(e.uri)}};bT=RL([PL(0,Xt)],bT);class gbe{getId(e){return e instanceof yu?e.id:e.uri}}let CT=class extends q{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new _S(i,{supportHighlights:!0})),this.badge=new vN(le(i,pe(".count")),{},y6),e.appendChild(i)}set(e,t){const i=qy(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))}};CT=RL([PL(1,Hp)],CT);let Lb=_T=class{constructor(e){this._instantiationService=e,this.templateId=_T.id}renderTemplate(e){return this._instantiationService.createInstance(CT,e)}renderElement(e,t,i){i.set(e.element,p0(e.filterData))}disposeTemplate(e){e.dispose()}};Lb.id="FileReferencesRenderer";Lb=_T=RL([PL(0,qe)],Lb);class fbe{constructor(e){this.label=new Gc(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(`${br(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:s,highlight:r}=n;t&&!ka.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(s,p0(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(s,[r]))}}}class M0{constructor(){this.templateId=M0.id}renderTemplate(e){return new fbe(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(){}}M0.id="OneReferenceRenderer";class pbe{getWidgetAriaLabel(){return p("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var mbe=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)}};class OL{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new de,this._callOnModelChange=new de,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{const s=n.deltaDecorations([],t);for(let r=0;r{s.equals(9)&&(this._keybindingService.dispatchEvent(s,s.target),s.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(vbe,"ReferencesWidget",this._treeContainer,new hbe,[this._instantiationService.createInstance(Lb),this._instantiationService.createInstance(M0)],this._instantiationService.createInstance(vT),i),this._splitView.addView({onDidChange:ye.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:s=>{this._preview.layout({height:this._dim.height,width:s})}},cS.Distribute),this._splitView.addView({onDidChange:ye.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)}},cS.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 yu&&(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")}),xs(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new Rt(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"),oo(this._messageContainer),Promise.resolve(void 0)):(xs(this._messageContainer),this._decorationsManager=new OL(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"),oo(this._treeContainer),oo(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 yu)return e;if(e instanceof yb&&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!==ot.inMemory?this.setTitle(Ooe(e.uri),this._uriLabel.getUriLabel(qy(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}jt(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()}};wT=mbe([sd(3,Sn),sd(4,Xs),sd(5,qe),sd(6,IV),sd(7,Hp),sd(8,Gy),sd(9,Xt),sd(10,bi),sd(11,si)],wT);var bbe=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},of=function(o,e){return function(t,i){e(t,i,o)}},z1;const $g=new De("referenceSearchVisible",!1,p("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let Lu=z1=class{static get(e){return e.getContribution(z1.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 de,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=$g.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=_be.fromJSON(this._storageService.get(s,0,"{}"));this._widget=this._instantiationService.createInstance(wT,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,u=new z(e.startLineNumber,e.startColumn),h=this._model.nearestReference(c,u);if(h)return this._widget.setSelection(h).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=z1.get(s),l=this._model.clone();this.closeWidget(),s.focus(),a==null||a.toggleWidget(n,_n(d=>Promise.resolve(l)),(r=this._peekMode)!==null&&r!==void 0?r:!1)}},s=>{this._ignoreModelChangeEvent=!1,nt(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)}};Lu.ID="editor.contrib.referencesController";Lu=z1=bbe([of(2,Xe),of(3,Ot),of(4,sn),of(5,qe),of(6,Xr),of(7,Dt)],Lu);function Ug(o,e){const t=rbe(o);if(!t)return;const i=Lu.get(t);i&&e(i)}Gs.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:fn(2089,60),when:ae.or($g,Zs.inPeekEditor),handler(o){Ug(o,e=>{e.changeFocusBetweenPreviewAndReferences()})}});Gs.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:ae.or($g,Zs.inPeekEditor),handler(o){Ug(o,e=>{e.goToNextOrPreviousReference(!0)})}});Gs.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:ae.or($g,Zs.inPeekEditor),handler(o){Ug(o,e=>{e.goToNextOrPreviousReference(!1)})}});Et.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");Et.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");Et.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");Et.registerCommand("closeReferenceSearch",o=>Ug(o,e=>e.closeWidget()));Gs.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:ae.and(Zs.inPeekEditor,ae.not("config.editor.stablePeek"))});Gs.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:ae.and($g,ae.not("config.editor.stablePeek"))});Gs.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:ae.and($g,z6,tR.negate(),iR.negate()),handler(o){var e;const i=(e=o.get(Lr).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof yu&&Ug(o,n=>n.revealReference(i[0]))}});Gs.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:ae.and($g,z6,tR.negate(),iR.negate()),handler(o){var e;const i=(e=o.get(Lr).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof yu&&Ug(o,n=>n.openReference(i[0],!0,!0))}});Et.registerCommand("openReference",o=>{var e;const i=(e=o.get(Lr).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof yu&&Ug(o,n=>n.openReference(i[0],!1,!0))});var TV=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},E_=function(o,e){return function(t,i){e(t,i,o)}};const PR=new De("hasSymbols",!1,p("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),FL=bt("ISymbolNavigationService");let ST=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=PR.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 yT(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 u of t.references)if(dA(u.uri,a.uri))d=!0,c=c||k.containsPosition(u.range,l);else if(d)break;(!d||!c)&&this.reset()});this._currentState=Hr(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)}};ST=TV([E_(0,Xe),E_(1,Ot),E_(2,sn),E_(3,Xt)],ST);xt(FL,ST,1);we(new class extends Rn{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:PR,kbOpts:{weight:100,primary:70}})}runEditorCommand(o,e){return o.get(FL).revealNext(e)}});Gs.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:PR,primary:9,handler(o){o.get(FL).reset()}});let yT=class{constructor(e){this._listener=new Map,this._disposables=new de,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(),jt(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,Hr(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)}};yT=TV([E_(0,Ot)],yT);async function A0(o,e,t,i){const s=t.ordered(o).map(a=>Promise.resolve(i(a,o,e)).then(void 0,l=>{en(l)})),r=await Promise.all(s);return Ia(r.flat())}function BL(o,e,t,i){return A0(e,t,o,(n,s,r)=>n.provideDefinition(s,r,i))}function MV(o,e,t,i){return A0(e,t,o,(n,s,r)=>n.provideDeclaration(s,r,i))}function AV(o,e,t,i){return A0(e,t,o,(n,s,r)=>n.provideImplementation(s,r,i))}function RV(o,e,t,i){return A0(e,t,o,(n,s,r)=>n.provideTypeDefinition(s,r,i))}function WL(o,e,t,i,n){return A0(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 R0(o){const e=await o(),t=new go(e,""),i=t.references.map(n=>n.link);return t.dispose(),i}ql("_executeDefinitionProvider",(o,e,t)=>{const i=o.get(Me),n=BL(i.definitionProvider,e,t,vt.None);return R0(()=>n)});ql("_executeTypeDefinitionProvider",(o,e,t)=>{const i=o.get(Me),n=RV(i.typeDefinitionProvider,e,t,vt.None);return R0(()=>n)});ql("_executeDeclarationProvider",(o,e,t)=>{const i=o.get(Me),n=MV(i.declarationProvider,e,t,vt.None);return R0(()=>n)});ql("_executeReferenceProvider",(o,e,t)=>{const i=o.get(Me),n=WL(i.referenceProvider,e,t,!1,vt.None);return R0(()=>n)});ql("_executeImplementationProvider",(o,e,t)=>{const i=o.get(Me),n=AV(i.implementationProvider,e,t,vt.None);return R0(()=>n)});var n_,s_,o_,BC,WC,VC,HC,zC;zn.appendMenuItem(N.EditorContext,{submenu:N.EditorContextPeek,title:p("peek.submenu","Peek"),group:"navigation",order:100});class em{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof em||z.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}class bs extends Wa{static all(){return bs._allSymbolNavigationCommands.values()}static _patchConfig(e){const t={...e,f1:!0};if(t.menu)for(const i of wt.wrap(t.menu))(i.id===N.EditorContext||i.id===N.EditorContextPeek)&&(i.when=ae.and(e.precondition,i.when));return t}constructor(e,t){super(bs._patchConfig(t)),this.configuration=e,bs._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,n){if(!t.hasModel())return Promise.resolve(void 0);const s=e.get(sn),r=e.get(Ot),a=e.get(Bu),l=e.get(FL),d=e.get(Me),c=e.get(qe),u=t.getModel(),h=t.getPosition(),g=em.is(i)?i:new em(u,h),f=new bu(t,5),m=Cy(this._getLocationModel(d,g.model,g.position,f.token),f.token).then(async v=>{var _;if(!v||f.token.isCancellationRequested)return;mo(v.ariaMessage);let b;if(v.referenceAt(u.uri,h)){const w=this._getAlternativeCommand(t);!bs._activeAlternativeCommands.has(w)&&bs._allSymbolNavigationCommands.has(w)&&(b=bs._allSymbolNavigationCommands.get(w))}const C=v.references.length;if(C===0){if(!this.configuration.muteMessage){const w=u.getWordAtPosition(h);(_=ho.get(t))===null||_===void 0||_.showMessage(this._getNoResultFoundMessage(w),h)}}else if(C===1&&b)bs._activeAlternativeCommands.add(this.desc.id),c.invokeFunction(w=>b.runEditorCommand(w,t,i,n).finally(()=>{bs._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(r,l,t,v,n)},v=>{s.error(v)}).finally(()=>{f.dispose()});return a.showWhile(m,250),m}async _onResult(e,t,i,n,s){const r=this._getGoToPreference(i);if(!(i instanceof Su)&&(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=Lu.get(e);n&&e.hasModel()?n.toggleWidget(i??e.getSelection(),_n(s=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}bs._allSymbolNavigationCommands=new Map;bs._activeAlternativeCommands=new Set;class P0 extends bs{async _getLocationModel(e,t,i,n){return new go(await BL(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}}mi((n_=class extends P0{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:n_.id,title:{value:p("actions.goToDecl.label","Go to Definition"),original:"Go to Definition",mnemonicTitle:p({},"Go to &&Definition")},precondition:ae.and(T.hasDefinitionProvider,T.isInWalkThroughSnippet.toNegated()),keybinding:[{when:T.editorTextFocus,primary:70,weight:100},{when:ae.and(T.editorTextFocus,W6),primary:2118,weight:100}],menu:[{id:N.EditorContext,group:"navigation",order:1.1},{id:N.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),Et.registerCommandAlias("editor.action.goToDeclaration",n_.id)}},n_.id="editor.action.revealDefinition",n_));mi((s_=class extends P0{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:s_.id,title:{value:p("actions.goToDeclToSide.label","Open Definition to the Side"),original:"Open Definition to the Side"},precondition:ae.and(T.hasDefinitionProvider,T.isInWalkThroughSnippet.toNegated()),keybinding:[{when:T.editorTextFocus,primary:fn(2089,70),weight:100},{when:ae.and(T.editorTextFocus,W6),primary:fn(2089,2118),weight:100}]}),Et.registerCommandAlias("editor.action.openDeclarationToTheSide",s_.id)}},s_.id="editor.action.revealDefinitionAside",s_));mi((o_=class extends P0{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:o_.id,title:{value:p("actions.previewDecl.label","Peek Definition"),original:"Peek Definition"},precondition:ae.and(T.hasDefinitionProvider,Zs.notInPeekEditor,T.isInWalkThroughSnippet.toNegated()),keybinding:{when:T.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:N.EditorContextPeek,group:"peek",order:2}}),Et.registerCommandAlias("editor.action.previewDeclaration",o_.id)}},o_.id="editor.action.peekDefinition",o_));class PV extends bs{async _getLocationModel(e,t,i,n){return new go(await MV(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}}mi((BC=class extends PV{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:BC.id,title:{value:p("actions.goToDeclaration.label","Go to Declaration"),original:"Go to Declaration",mnemonicTitle:p({},"Go to &&Declaration")},precondition:ae.and(T.hasDeclarationProvider,T.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")}},BC.id="editor.action.revealDeclaration",BC));mi(class extends PV{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:{value:p("actions.peekDecl.label","Peek Declaration"),original:"Peek Declaration"},precondition:ae.and(T.hasDeclarationProvider,Zs.notInPeekEditor,T.isInWalkThroughSnippet.toNegated()),menu:{id:N.EditorContextPeek,group:"peek",order:3}})}});class OV extends bs{async _getLocationModel(e,t,i,n){return new go(await RV(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}}mi((WC=class extends OV{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:WC.ID,title:{value:p("actions.goToTypeDefinition.label","Go to Type Definition"),original:"Go to Type Definition",mnemonicTitle:p({},"Go to &&Type Definition")},precondition:ae.and(T.hasTypeDefinitionProvider,T.isInWalkThroughSnippet.toNegated()),keybinding:{when:T.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}]})}},WC.ID="editor.action.goToTypeDefinition",WC));mi((VC=class extends OV{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:VC.ID,title:{value:p("actions.peekTypeDefinition.label","Peek Type Definition"),original:"Peek Type Definition"},precondition:ae.and(T.hasTypeDefinitionProvider,Zs.notInPeekEditor,T.isInWalkThroughSnippet.toNegated()),menu:{id:N.EditorContextPeek,group:"peek",order:4}})}},VC.ID="editor.action.peekTypeDefinition",VC));class FV extends bs{async _getLocationModel(e,t,i,n){return new go(await AV(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}}mi((HC=class extends FV{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:HC.ID,title:{value:p("actions.goToImplementation.label","Go to Implementations"),original:"Go to Implementations",mnemonicTitle:p({},"Go to &&Implementations")},precondition:ae.and(T.hasImplementationProvider,T.isInWalkThroughSnippet.toNegated()),keybinding:{when:T.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}]})}},HC.ID="editor.action.goToImplementation",HC));mi((zC=class extends FV{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:zC.ID,title:{value:p("actions.peekImplementation.label","Peek Implementations"),original:"Peek Implementations"},precondition:ae.and(T.hasImplementationProvider,Zs.notInPeekEditor,T.isInWalkThroughSnippet.toNegated()),keybinding:{when:T.editorTextFocus,primary:3142,weight:100},menu:{id:N.EditorContextPeek,group:"peek",order:5}})}},zC.ID="editor.action.peekImplementation",zC));class BV extends bs{_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}}mi(class extends BV{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:ae.and(T.hasReferenceProvider,Zs.notInPeekEditor,T.isInWalkThroughSnippet.toNegated()),keybinding:{when:T.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 go(await WL(e.referenceProvider,t,i,!0,n),p("ref.title","References"))}});mi(class extends BV{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:ae.and(T.hasReferenceProvider,Zs.notInPeekEditor,T.isInWalkThroughSnippet.toNegated()),menu:{id:N.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(e,t,i,n){return new go(await WL(e.referenceProvider,t,i,!1,n),p("ref.title","References"))}});class Cbe extends bs{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:ae.and(Zs.notInPeekEditor,T.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}async _getLocationModel(e,t,i,n){return new go(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""}}Et.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:ze},{name:"position",description:"The position at which to start",constraint:z.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)=>{qt(ze.isUri(e)),qt(z.isIPosition(t)),qt(Array.isArray(i)),qt(typeof n>"u"||typeof n=="string"),qt(typeof r>"u"||typeof r=="boolean");const a=o.get(Ot),l=await a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if($l(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(d=>{const c=new class extends Cbe{_getNoResultFoundMessage(u){return s||super._getNoResultFoundMessage(u)}}({muteMessage:!s,openInPeek:!!r,openToSide:!1},i,n);d.get(qe).invokeFunction(c.run.bind(c),l)})}});Et.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:ze},{name:"position",description:"The position at which to start",constraint:z.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(Ri).executeCommand("editor.action.goToLocations",e,t,i,n,void 0,!0)}});Et.registerCommand({id:"editor.action.findReferences",handler:(o,e,t)=>{qt(ze.isUri(e)),qt(z.isIPosition(t));const i=o.get(Me),n=o.get(Ot);return n.openCodeEditor({resource:e},n.getFocusedCodeEditor()).then(s=>{if(!$l(s)||!s.hasModel())return;const r=Lu.get(s);if(!r)return;const a=_n(d=>WL(i.referenceProvider,s.getModel(),z.lift(t),!1,d).then(c=>new go(c,p("ref.title","References")))),l=new k(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(r.toggleWidget(l,a,!1))})}});Et.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");var wbe=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},lk=function(o,e){return function(t,i){e(t,i,o)}},N_;let bg=N_=class{constructor(e,t,i,n){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=n,this.toUnhook=new de,this.toUnhookForKeyboard=new de,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const s=new ML(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=>{nt(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(s.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(N_.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 xW(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=_n(a=>this.findDefinition(e,a));let s;try{s=await this.previousPromise}catch(a){nt(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 as().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 u=this.getPreviewValue(d,c,a),h=this.languageService.guessLanguageIdByFilepathOrFirstLine(d.uri);this.addDecoration(r,u?new as().appendCodeblock(h||"",u):void 0),l.dispose()})}}getPreviewValue(e,t,i){let n=i.range;return n.endLineNumber-n.startLineNumber>=N_.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{const n=!t&&this.editor.getOption(87)&&!this.isInPeekEditor(i);return new P0({openToSide:t,openInPeek:n,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(Xe);return Zs.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};bg.ID="editor.contrib.gotodefinitionatposition";bg.MAX_SOURCE_PREVIEW_LINES=8;bg=N_=wbe([lk(1,Xs),lk(2,bi),lk(3,Me)],bg);At(bg.ID,bg,2);const $C=pe;class WV extends q{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 a0(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class OR extends q{static render(e,t,i){return new OR(e,t,i)}constructor(e,t,i){super(),this.actionContainer=le(e,$C("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=le(this.actionContainer,$C("a.action")),this.action.setAttribute("role","button"),t.iconClass&&le(this.action,$C(`span.icon.${t.iconClass}`));const n=le(this.action,$C("span"));n.textContent=i?`${t.label} (${i})`:t.label,this._register(J(this.actionContainer,Se.CLICK,s=>{s.stopPropagation(),s.preventDefault(),t.run(this.actionContainer)})),this._register(J(this.actionContainer,Se.KEY_DOWN,s=>{const r=new gi(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 Sbe(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 ybe=class{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}};class VV extends q{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 Yt(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new Yt(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new Yt(()=>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=lX(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){nt(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 ybe(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 dk{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 $1{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 jg=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class FR{constructor(){this._onDidWillResize=new W,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new W,this.onDidResize=this._onDidResize.event,this._sashListener=new de,this._size=new Rt(0,0),this._minSize=new Rt(0,0),this._maxSize=new Rt(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new ss(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new ss(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new ss(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:lS.North}),this._southSash=new ss(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:lS.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(ye.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(ye.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(ye.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(ye.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 Rt(t,e);Rt.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 Lbe=30,Dbe=24;class xbe extends q{constructor(e,t=new Rt(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new FR),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=Rt.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 Rt(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?z.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);return!t||!i?void 0:gn(t).top+i.top-Lbe}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const n=gn(t),s=ng(t.ownerDocument.body),r=n.top+i.top+i.height;return s.height-r-Dbe}_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 BR=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},Oh=function(o,e){return function(t,i){e(t,i,o)}},U1,Xa;const g3=pe;let PS=U1=class extends q{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(Xc,this._editor)),this._participants=[];for(const n of jg.getAll())this._participants.push(this._instantiationService.createInstance(n,this._editor));this._participants.sort((n,s)=>n.hoverOrdinal-s.hoverOrdinal),this._computer=new FS(this._editor,this._participants),this._hoverOperation=this._register(new VV(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 HV(this._computer.anchor,s,n.isComplete))})),this._register(Wi(this._widget.getDomNode(),"keydown",n=>{n.equals(9)&&this.hide()})),this._register(Ei.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 dk(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.horizontalDistanceToTexts.priority-n.priority),this._startShowingOrUpdateHover(t[0],0,0,!1,e))}startShowingAtRange(e,t,i,n){this._startShowingOrUpdateHover(new dk(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}=U1.computeHoverRanges(this._editor,e.range,t),r=new de,a=r.add(new OS(this._keybindingService)),l=document.createDocumentFragment();let d=null;const c={fragment:l,statusBar:a,setColorPicker:h=>d=h,onContentsChanged:()=>this._widget.onContentsChanged(),setMinimumDimensions:h=>this._widget.setMinimumDimensions(h),hide:()=>this.hide()};for(const h of this._participants){const g=t.filter(f=>f.owner===h);g.length>0&&r.add(h.renderHoverParts(c,g))}const u=t.some(h=>h.isBeforeContent);if(a.hasContent&&l.appendChild(a.hoverElement),l.hasChildNodes()){if(s){const h=this._editor.createDecorationsCollection();h.set([{range:s,options:U1._DECORATION_OPTIONS}]),r.add(je(()=>{h.clear()}))}this._widget.showAt(l,new Ibe(d,i,n,this._editor.getOption(60).above,this._computer.shouldFocus,this._computer.source,u,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,u=c.convertModelRangeToViewRange(t),h=new z(u.startLineNumber,d.getLineMinColumn(u.startLineNumber));n=c.convertViewPositionToModelPosition(h).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 z(s,t.startColumn),showAtSecondaryPosition:l?l.getStartPosition():new z(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()}};PS._DECORATION_OPTIONS=st.register({description:"content-hover-highlight",className:"hoverHighlight"});PS=U1=BR([Oh(1,qe),Oh(2,Xt)],PS);class HV{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 kbe(this,this.anchor,t,this.isComplete)}}class kbe extends HV{constructor(e,t,i,n){super(t,i,n),this.original=e}filter(e){return this.original.filter(e)}}class Ibe{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 f3=30,ck=10,Ebe=6;let Xc=Xa=class extends xbe{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 Rt(a,r);super(e,l),this._configurationService=i,this._accessibilityService=n,this._keybindingService=s,this._hover=this._register(new WV),this._minimumSize=l,this._hoverVisibleKey=T.hoverVisible.bindTo(t),this._hoverFocusedKey=T.hoverFocused.bindTo(t),le(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(Pl(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 Xa.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 Xa._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return Xa._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){Xa._applyMaxDimensions(this._hover.contentsDomNode,e,t),Xa._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-ck))}_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 Rt(i,n),this._setHoverWidgetMaxDimensions(i,n)}_resize(e){var t,i;Xa._lastDimensions=new Rt(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=Ebe;return Array.from(this._hover.contentsDomNode.children).forEach(i=>{t+=i.clientHeight}),this._hasHorizontalScrollbar()&&(t+=ck),Math.min(e,t)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const e=Array.from(this._hover.contentsDomNode.children).some(t=>t.scrollWidth>t.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const e=this._isHoverTextOverflowing(),t=typeof this._contentWidth>"u"?0:this._contentWidth-2;return e||this._hover.containerDomNode.clientWidth"u"||typeof this._visibleData.initialMousePosY>"u")return this._visibleData.initialMousePosX=e,this._visibleData.initialMousePosY=t,!1;const i=gn(this.getDomNode());typeof this._visibleData.closestMouseDistance>"u"&&(this._visibleData.closestMouseDistance=p3(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,i.left,i.top,i.width,i.height));const n=p3(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,Xa._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,Xa._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=kh(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&&Sbe(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 Rt(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(zs(i),Math.min(s,e)),this._setContentsDomNodeDimensions(zs(n),Math.min(s,e-ck))}setMinimumDimensions(e){this._minimumSize=new Rt(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 Rt(e,this._minimumSize.height)}onContentsChanged(){var e;this._removeConstraintsRenderNormally();const t=this._hover.containerDomNode;let i=kh(t),n=zs(t);if(this._resizableNode.layout(i,n),this._setHoverWidgetDimensions(n,i),i=kh(t),n=zs(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=kh(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-f3})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+f3})}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})}};Xc.ID="editor.contrib.resizableContentHoverWidget";Xc._lastDimensions=new Rt(0,0);Xc=Xa=BR([Oh(1,Xe),Oh(2,Dt),Oh(3,Zl),Oh(4,Xt)],Xc);let OS=class extends q{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=g3("div.hover-row.status-bar"),this.actionsElement=le(this.hoverElement,g3("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;return this._hasContent=!0,this._register(OR.render(this.actionsElement,e,i))}append(e){const t=le(this.actionsElement,e);return this._hasContent=!0,t}};OS=BR([Oh(0,Xt)],OS);class FS{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 rn.EMPTY;const i=FS._getLineDecorations(this._editor,t);return rn.merge(this._participants.map(n=>n.computeAsync?n.computeAsync(t,i,e):rn.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=FS._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return Ia(t)}}function p3(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 m3=pe;class vp extends q{constructor(e,t,i){super(),this._renderDisposeables=this._register(new de),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new WV),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new Ud({editor:this._editor},t,i)),this._computer=new Nbe(this._editor),this._hoverOperation=this._register(new VV(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 vp.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=m3("div.hover-row.markdown-hover"),r=le(s,m3("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`}}vp.ID="editor.contrib.modesGlyphHoverWidget";class Nbe{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||Up(s)||i.push(...Z2(s).map(e))}return i}}class Tbe{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}async function Mbe(o,e,t,i,n){try{const s=await Promise.resolve(o.provideHover(t,i,n));if(s&&Rbe(s))return new Tbe(o,s,e)}catch(s){en(s)}}function WR(o,e,t,i){const s=o.ordered(e).map((r,a)=>Mbe(r,a,e,t,i));return rn.fromPromises(s).coalesce()}function Abe(o,e,t,i){return WR(o,e,t,i).map(n=>n.hover).toPromise()}ql("_executeHoverProvider",(o,e,t)=>{const i=o.get(Me);return Abe(i.hoverProvider,e,t,vt.None)});function Rbe(o){const e=typeof o.range<"u",t=typeof o.contents<"u"&&o.contents&&o.contents.length>0;return e&&t}var Pbe=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},UC=function(o,e){return function(t,i){e(t,i,o)}};const _3=pe;class ba{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 BS=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 ba(this,e.range,[new as().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),u=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:d});let h=!1;c>=0&&l>c&&e.range.startColumn>=c&&(h=!0,r.push(new ba(this,e.range,[{value:p("stopped rendering","Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!h&&typeof u=="number"&&l>=u&&r.push(new ba(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,v=f.range.endLineNumber===n?f.range.endColumn:s,_=f.options.hoverMessage;if(!_||Up(_))continue;f.options.beforeContentClassName&&(g=!0);const b=new k(e.range.startLineNumber,m,e.range.startLineNumber,v);r.push(new ba(this,b,Z2(_),g,a++))}return r}computeAsync(e,t,i){if(!this._editor.hasModel()||e.type!==1)return rn.EMPTY;const n=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(n))return rn.EMPTY;const s=new z(e.range.startLineNumber,e.range.startColumn);return WR(this._languageFeaturesService.hoverProvider,n,s,i).filter(r=>!Up(r.hover.contents)).map(r=>{const a=r.hover.range?k.lift(r.hover.range):e.range;return new ba(this,a,r.hover.contents,!1,r.ordinal)})}renderHoverParts(e,t){return zV(e,t,this._editor,this._languageService,this._openerService)}};BS=Pbe([UC(1,bi),UC(2,So),UC(3,Dt),UC(4,Me)],BS);function zV(o,e,t,i,n){e.sort((r,a)=>r.ordinal-a.ordinal);const s=new de;for(const r of e)for(const a of r.contents){if(Up(a))continue;const l=_3("div.hover-row.markdown-hover"),d=le(l,_3("div.hover-contents")),c=s.add(new Ud({editor:t},i,n));s.add(c.onDidRenderAsync(()=>{d.className="hover-contents code-hover-contents",o.onContentsChanged()}));const u=s.add(c.render(a));d.appendChild(u.element),o.fragment.appendChild(l)}return s}var $V=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},WS=function(o,e){return function(t,i){e(t,i,o)}};class v3{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let LT=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new W,this.onDidChange=this._onDidChange.event,this._dispoables=new de,this._markers=[],this._nextIdx=-1,ze.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=Sv(a.resource.toString(),l.resource.toString());return d===0&&(n==="position"?d=k.compareRangesUsingStarts(a,l)||Mi.compare(a.severity,l.severity):d=Mi.compare(a.severity,l.severity)||k.compareRangesUsingStarts(a,l)),d},r=()=>{this._markers=this._markerService.read({resource:ze.isUri(e)?e:void 0,severities:Mi.Error|Mi.Warning|Mi.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 v3(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=fv(this._markers,{resource:e.uri},(r,a)=>Sv(r.resource.toString(),a.resource.toString())),s<0&&(s=~s));for(let r=s;rn.resource.toString()===e.toString());if(!(i<0)){for(;i=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},rf=function(o,e){return function(t,i){e(t,i,o)}},kT;class Fbe{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 de,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(Wi(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new K7(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(){jt(this._disposables)}update(e){const{source:t,message:i,relatedInformation:n,code:s}=e;let r=((t==null?void 0:t.length)||0)+2;s&&(typeof s=="string"?r+=s.length:r+=s.value.length);const a=Rl(i);this._lines=a.length,this._longestLineLength=0;for(const h of a)this._longestLineLength=Math.max(h.length+r,this._longestLineLength);$n(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const h of a)l=document.createElement("div"),l.innerText=h,h===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||s){const h=document.createElement("span");if(h.classList.add("details"),l.appendChild(h),t){const g=document.createElement("span");g.innerText=t,g.classList.add("source"),h.appendChild(g)}if(s)if(typeof s=="string"){const g=document.createElement("span");g.innerText=`(${s})`,g.classList.add("code"),h.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=le(this._codeLink,pe("span"));g.innerText=s.value,h.appendChild(this._codeLink)}}if($n(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),ls(n)){const h=this._relatedBlock.appendChild(document.createElement("div"));h.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 v=document.createElement("span");v.innerText=g.message,f.appendChild(m),f.appendChild(v),this._lines+=1,h.appendChild(f)}}const d=this._editor.getOption(50),c=Math.ceil(d.typicalFullwidthCharacterWidth*this._longestLineLength*.75),u=d.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:c,scrollHeight:u})}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 Mi.Error:t=p("Error","Error");break;case Mi.Warning:t=p("Warning","Warning");break;case Mi.Info:t=p("Info","Info");break;case Mi.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 tm=kT=class extends RS{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 de,this._onDidSelectRelatedInformation=new W,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=Mi.Warning,this._backgroundColor=Y.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(Hbe);let t=IT,i=Bbe;this._severity===Mi.Warning?(t=j1,i=Wbe):this._severity===Mi.Info&&(t=ET,i=Vbe);const n=e.getColor(t),s=e.getColor(i);this.style({arrowColor:n,frameColor:n,headerBackgroundColor:s,primaryHeadingColor:e.getColor(EV),secondaryHeadingColor:e.getColor(NV)})}_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(kT.TitleMenu,this._contextKeyService);VA(i,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),i.dispose()}_fillTitleIcon(e){this._icon=le(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 Fbe(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(br(a.uri),l)}this._icon.className=`codicon ${xT.className(Mi.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()}};tm.TitleMenu=new N("gotoErrorTitleMenu");tm=kT=Obe([rf(1,Sn),rf(2,So),rf(3,Ba),rf(4,qe),rf(5,Xe),rf(6,Hp)],tm);const b3=Vv(vl,vte),C3=Vv(zo,Bv),w3=Vv(Ks,Wv),IT=M("editorMarkerNavigationError.background",{dark:b3,light:b3,hcDark:Lt,hcLight:Lt},p("editorMarkerNavigationError","Editor marker navigation widget error color.")),Bbe=M("editorMarkerNavigationError.headerBackground",{dark:We(IT,.1),light:We(IT,.1),hcDark:null,hcLight:null},p("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),j1=M("editorMarkerNavigationWarning.background",{dark:C3,light:C3,hcDark:Lt,hcLight:Lt},p("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),Wbe=M("editorMarkerNavigationWarning.headerBackground",{dark:We(j1,.1),light:We(j1,.1),hcDark:"#0C141F",hcLight:We(j1,.2)},p("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),ET=M("editorMarkerNavigationInfo.background",{dark:w3,light:w3,hcDark:Lt,hcLight:Lt},p("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),Vbe=M("editorMarkerNavigationInfo.headerBackground",{dark:We(ET,.1),light:We(ET,.1),hcDark:null,hcLight:null},p("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),Hbe=M("editorMarkerNavigation.background",{dark:wn,light:wn,hcDark:wn,hcLight:wn},p("editorMarkerNavigationBackground","Editor marker navigation widget background."));var zbe=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},jC=function(o,e){return function(t,i){e(t,i,o)}},T_;let Du=T_=class{static get(e){return e.getContribution(T_.ID)}constructor(e,t,i,n,s){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=n,this._instantiationService=s,this._sessionDispoables=new de,this._editor=e,this._widgetVisible=jV.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(tm,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 z(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=T_.get(r))===null||i===void 0||i.close(),(n=T_.get(r))===null||n===void 0||n.nagivate(e,t))}else this._widget.showAtMarker(s.selected.marker,s.selected.index,s.selected.total)}}};Du.ID="editor.contrib.markerController";Du=T_=zbe([jC(1,UV),jC(2,Xe),jC(3,Ot),jC(4,qe)],Du);class VL extends Te{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}async run(e,t){var i;t.hasModel()&&((i=Du.get(t))===null||i===void 0||i.nagivate(this._next,this._multiFile))}}class Qc extends VL{constructor(){super(!0,!1,{id:Qc.ID,label:Qc.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:T.focus,primary:578,weight:100},menuOpts:{menuId:tm.TitleMenu,title:Qc.LABEL,icon:Zi("marker-navigation-next",ve.arrowDown,p("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}Qc.ID="editor.action.marker.next";Qc.LABEL=p("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class Kh extends VL{constructor(){super(!1,!1,{id:Kh.ID,label:Kh.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:T.focus,primary:1602,weight:100},menuOpts:{menuId:tm.TitleMenu,title:Kh.LABEL,icon:Zi("marker-navigation-previous",ve.arrowUp,p("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}Kh.ID="editor.action.marker.prev";Kh.LABEL=p("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class $be extends VL{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:T.focus,primary:66,weight:100},menuOpts:{menuId:N.MenubarGoMenu,title:p({},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class Ube extends VL{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:T.focus,primary:1090,weight:100},menuOpts:{menuId:N.MenubarGoMenu,title:p({},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}At(Du.ID,Du,4);_e(Qc);_e(Kh);_e($be);_e(Ube);const jV=new De("markersNavigationVisible",!1),jbe=Rn.bindToContribution(Du.get);we(new jbe({id:"closeMarkersNavigation",precondition:jV,handler:o=>o.close(),kbOpts:{weight:150,kbExpr:T.focus,primary:9,secondary:[1033]}}));var Kbe=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},uk=function(o,e){return function(t,i){e(t,i,o)}};const Ir=pe;class qbe{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 S3={type:1,filter:{include:Ze.QuickFix},triggerAction:_o.QuickFixHover};let NT=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 u=new k(e.range.startLineNumber,l,e.range.startLineNumber,d);r.push(new qbe(this,u,c))}return r}renderHoverParts(e,t){if(!t.length)return q.None;const i=new de;t.forEach(s=>e.fragment.appendChild(this.renderMarkerHover(s,i)));const n=t.length===1?t[0]:t.sort((s,r)=>Mi.compare(s.marker.severity,r.marker.severity))[0];return this.renderMarkerStatusbar(e,n,i),i}renderMarkerHover(e,t){const i=Ir("div.hover-row"),n=le(i,Ir("div.marker.hover-contents")),{source:s,message:r,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(n);const d=le(n,Ir("span"));if(d.style.whiteSpace="pre-wrap",d.innerText=r,s||a)if(a&&typeof a!="string"){const c=Ir("span");if(s){const f=le(c,Ir("span"));f.innerText=s}const u=le(c,Ir("a.code-link"));u.setAttribute("href",a.target.toString()),t.add(J(u,"click",f=>{this._openerService.open(a.target,{allowCommands:!0}),f.preventDefault(),f.stopPropagation()}));const h=le(u,Ir("span"));h.innerText=a.value;const g=le(n,c);g.style.opacity="0.6",g.style.paddingLeft="6px"}else{const c=le(n,Ir("span"));c.style.opacity="0.6",c.style.paddingLeft="6px",c.innerText=s&&a?`${s}(${a})`:s||`(${a})`}if(ls(l))for(const{message:c,resource:u,startLineNumber:h,startColumn:g}of l){const f=le(n,Ir("div"));f.style.marginTop="8px";const m=le(f,Ir("a"));m.innerText=`${br(u)}(${h}, ${g}): `,m.style.cursor="pointer",t.add(J(m,"click",_=>{_.stopPropagation(),_.preventDefault(),this._openerService&&this._openerService.open(u,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:h,startColumn:g}}}).catch(nt)}));const v=le(f,Ir("span"));v.innerText=c,this._editor.applyFontInfo(v)}return i}renderMarkerStatusbar(e,t,i){if((t.marker.severity===Mi.Error||t.marker.severity===Mi.Warning||t.marker.severity===Mi.Info)&&e.statusBar.addAction({label:p("view problem","View Problem"),commandId:Qc.ID,run:()=>{var n;e.hide(),(n=Du.get(this._editor))===null||n===void 0||n.showAtMarker(t.marker),this._editor.focus()}}),!this._editor.getOption(90)){const n=e.statusBar.append(Ir("div"));this.recentMarkerCodeActionsInfo&&(rS.makeKey(this.recentMarkerCodeActionsInfo.marker)===rS.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?q.None:i.add(lu(()=>n.textContent=p("checkingForQuickFixes","Checking for quick fixes..."),200));n.textContent||(n.textContent=" ");const r=this.getCodeActions(t.marker);i.add(je(()=>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(je(()=>{l||a.dispose()})),e.statusBar.addAction({label:p("quick fixes","Quick Fix..."),commandId:ER,run:d=>{l=!0;const c=Cu.get(this._editor),u=gn(d);e.hide(),c==null||c.showCodeActions(S3,a,{x:u.left,y:u.top,width:u.width,height:u.height})}})},nt)}}getCodeActions(e){return _n(t=>ov(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new k(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),S3,Fd.None,t))}};NT=Kbe([uk(1,$M),uk(2,So),uk(3,Me)],NT);const KV="editor.action.inlineSuggest.commit",qV="editor.action.inlineSuggest.showPrevious",GV="editor.action.inlineSuggest.showNext";var VR=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},Ca=function(o,e){return function(t,i){e(t,i,o)}},K1;let TT=class extends q{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=Oi(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=rt(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 z(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(Qd((n,s)=>{const r=this.model.read(n);if(!r||!this.alwaysShowToolbar.read(n))return;const a=s.add(this.instantiationService.createInstance(xu,this.editor,!0,this.position,r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.selectedInlineCompletion.map(l=>{var d;return(d=l==null?void 0:l.inlineCompletion.source.inlineCompletions.commands)!==null&&d!==void 0?d:[]})));e.addContentWidget(a),s.add(je(()=>e.removeContentWidget(a))),s.add(zt(l=>{this.position.read(l)&&r.lastTriggerKind.read(l)!==Rd.Explicit&&r.triggerExplicitly()}))}))}};TT=VR([Ca(2,qe)],TT);const Gbe=Zi("inline-suggestion-hints-next",ve.chevronRight,p("parameterHintsNextIcon","Icon for show next parameter hint.")),Zbe=Zi("inline-suggestion-hints-previous",ve.chevronLeft,p("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let xu=K1=class extends q{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const n=new Rs(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,u){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=u,this.id=`InlineSuggestionHintsContentWidget${K1.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=vi("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[vi("div@toolBar")]),this.previousAction=this.createCommandAction(qV,p("previous","Previous"),Ue.asClassName(Zbe)),this.availableSuggestionCountAction=new Rs("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(GV,p("next","Next"),Ue.asClassName(Gbe)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(N.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new Yt(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new Yt(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.lastCommands=[],this.toolBar=this._register(l.createInstance(MT,this.nodes.toolBar,N.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:h=>h.startsWith("primary")},actionViewItemProvider:(h,g)=>{if(h instanceof Ur)return l.createInstance(Xbe,h,void 0);if(h===this.availableSuggestionCountAction){const f=new Ybe(void 0,h,{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(h=>{K1._dropDownVisible=h})),this._register(zt(h=>{this._position.read(h),this.editor.layoutContentWidget(this)})),this._register(zt(h=>{const g=this._suggestionCount.read(h),f=this._currentSuggestionIdx.read(h);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(zt(h=>{const g=this._extraCommands.read(h);if(Bi(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:v=>this._commandService.executeCommand(m.id)}));for(const[m,v]of this.inlineCompletionsActionsMenus.getActions())for(const _ of v)_ instanceof Ur&&f.push(_);f.length>0&&f.unshift(new Mn),this.toolBar.setAdditionalSecondaryActions(f)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};xu._dropDownVisible=!1;xu.id=0;xu=K1=VR([Ca(6,Ri),Ca(7,qe),Ca(8,Xt),Ca(9,Xe),Ca(10,Ba)],xu);class Ybe extends jp{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 Xbe=class extends dg{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=vi("div.keybinding").root;new C0(t,Vo,{disableTitle:!0,...whe}).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}},MT=class extends ES{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=[];VA(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){Bi(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){Bi(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};MT=VR([Ca(3,Ba),Ca(4,Xe),Ca(5,Sr),Ca(6,Xt),Ca(7,vo)],MT);var Qbe=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},KC=function(o,e){return function(t,i){e(t,i,o)}},AT;let Ys=AT=class extends q{static get(e){return e.getContribution(AT.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 de,this._hoverActivatedByColorDecoratorClick=!1,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._reactToEditorMouseMoveRunner=this._register(new Yt(()=>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===Xc.ID){this._hoverClicked=!0;return}i.type===12&&i.detail===vp.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===Xc.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===Xc.ID&&(!((r=this._contentWidget)===null||r===void 0)&&r.isColorPickerVisible)||this._isHoverSticky&&a.type===12&&a.detail===vp.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 vp(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)||xu.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(PS,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()}};Ys.ID="editor.contrib.hover";Ys=AT=Qbe([KC(1,qe),KC(2,So),KC(3,bi),KC(4,Xt)],Ys);var ra;(function(o){o.NoAutoFocus="noAutoFocus",o.FocusIfVisible="focusIfVisible",o.AutoFocusImmediately="autoFocusImmediately"})(ra||(ra={}));class Jbe extends Te{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:[ra.NoAutoFocus,ra.FocusIfVisible,ra.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:ra.FocusIfVisible}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:T.editorTextFocus,primary:fn(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const n=Ys.get(t);if(!n)return;const s=i==null?void 0:i.focus;let r=ra.FocusIfVisible;s in ra?r=s:typeof s=="boolean"&&s&&(r=ra.AutoFocusImmediately);const a=d=>{const c=t.getPosition(),u=new k(c.lineNumber,c.column,c.lineNumber,c.column);n.showContentHover(u,1,1,d)},l=t.getOption(2)===2;n.isHoverVisible?r!==ra.NoAutoFocus?n.focus():a(l):a(l||r===ra.AutoFocusImmediately)}}class e0e extends Te{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=Ys.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=bg.get(t);if(!r)return;r.startFindDefinitionFromCursor(n).then(()=>{i.showContentHover(s,1,1,!0)})}}class t0e extends Te{constructor(){super({id:"editor.action.scrollUpHover",label:p({},"Scroll Up Hover"),alias:"Scroll Up Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:16,weight:100}})}run(e,t){const i=Ys.get(t);i&&i.scrollUp()}}class i0e extends Te{constructor(){super({id:"editor.action.scrollDownHover",label:p({},"Scroll Down Hover"),alias:"Scroll Down Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:18,weight:100}})}run(e,t){const i=Ys.get(t);i&&i.scrollDown()}}class n0e extends Te{constructor(){super({id:"editor.action.scrollLeftHover",label:p({},"Scroll Left Hover"),alias:"Scroll Left Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:15,weight:100}})}run(e,t){const i=Ys.get(t);i&&i.scrollLeft()}}class s0e extends Te{constructor(){super({id:"editor.action.scrollRightHover",label:p({},"Scroll Right Hover"),alias:"Scroll Right Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:17,weight:100}})}run(e,t){const i=Ys.get(t);i&&i.scrollRight()}}class o0e extends Te{constructor(){super({id:"editor.action.pageUpHover",label:p({},"Page Up Hover"),alias:"Page Up Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){const i=Ys.get(t);i&&i.pageUp()}}class r0e extends Te{constructor(){super({id:"editor.action.pageDownHover",label:p({},"Page Down Hover"),alias:"Page Down Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){const i=Ys.get(t);i&&i.pageDown()}}class a0e extends Te{constructor(){super({id:"editor.action.goToTopHover",label:p({},"Go To Top Hover"),alias:"Go To Bottom Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){const i=Ys.get(t);i&&i.goToTop()}}class l0e extends Te{constructor(){super({id:"editor.action.goToBottomHover",label:p({},"Go To Bottom Hover"),alias:"Go To Bottom Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){const i=Ys.get(t);i&&i.goToBottom()}}At(Ys.ID,Ys,2);_e(Jbe);_e(e0e);_e(t0e);_e(i0e);_e(n0e);_e(s0e);_e(o0e);_e(r0e);_e(a0e);_e(l0e);jg.register(BS);jg.register(NT);Zr((o,e)=>{const t=o.getColor(Ate);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 RT extends q{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!==bV||!i.range)return;const n=this._editor.getContribution(Ys.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)}}}RT.ID="editor.contrib.colorContribution";At(RT.ID,RT,2);jg.register(AS);var ZV=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},pa=function(o,e){return function(t,i){e(t,i,o)}},PT,OT;let ku=PT=class extends q{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=T.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=T.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 VS(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(PT.ID)}};ku.ID="editor.contrib.standaloneColorPickerController";ku=PT=ZV([pa(1,Xe),pa(2,Si),pa(3,Xt),pa(4,qe),pa(5,Me),pa(6,si)],ku);At(ku.ID,ku,1);const y3=8,d0e=22;let VS=OT=class extends q{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(wb,this._editor),this._position=(d=this._editor._getViewModel())===null||d===void 0?void 0:d.getPrimaryCursorState().modelState.position;const c=this._editor.getSelection(),u=c?{startLineNumber:c.startLineNumber,startColumn:c.startColumn,endLineNumber:c.endLineNumber,endColumn:c.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},h=this._register(Pl(this._body));this._register(h.onDidBlur(g=>{this.hide()})),this._register(h.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(u),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return OT.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 c0e(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 AR(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 OS(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-d0e-y3,c=s.body.enterButton;c==null||c.onClicked(()=>{this.updateEditor(),this.hide()});const u=s.header,h=u.pickedColorNode;h.style.width=l+y3+"px";const g=u.originalColorNode;g.style.width=d+"px";const f=s.header.closeButton;f==null||f.onClicked(()=>{this.hide()}),t&&(c&&(c.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}};VS.ID="editor.contrib.standaloneColorPickerWidget";VS=OT=ZV([pa(3,qe),pa(4,Si),pa(5,Xt),pa(6,Me),pa(7,si)],VS);class c0e{constructor(e,t){this.value=e,this.foundInEditor=t}}class u0e extends Wa{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=ku.get(t))===null||i===void 0||i.showOrFocus()}}class h0e extends Te{constructor(){super({id:"editor.action.hideColorPicker",label:p({},"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:T.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100}})}run(e,t){var i;(i=ku.get(t))===null||i===void 0||i.hide()}}class g0e extends Te{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:p({},"Insert Color with Standalone Color Picker"),alias:"Insert Color with Standalone Color Picker",precondition:T.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100}})}run(e,t){var i;(i=ku.get(t))===null||i===void 0||i.insertColor()}}_e(h0e);_e(g0e);mi(u0e);class Oc{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=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,u=s.getLineContent(a),h=s.getLineContent(d);let g=u.lastIndexOf(t,l-1+t.length),f=h.indexOf(i,c-1-i.length);if(g!==-1&&f!==-1)if(a===d)u.substring(g+t.length,f).indexOf(i)>=0&&(g=-1,f=-1);else{const v=u.substring(g+t.length),_=h.substring(0,f);(v.indexOf(i)>=0||_.indexOf(i)>=0)&&(g=-1,f=-1)}let m;g!==-1&&f!==-1?(n&&g+t.length0&&h.charCodeAt(f-1)===32&&(i=" "+i,f-=1),m=Oc._createRemoveBlockCommentOperations(new k(a,g+t.length+1,d,f+1),t,i)):(m=Oc._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=m.length===1?i:null);for(const v of m)r.addTrackedEditOperation(v.range,v.text)}static _createRemoveBlockCommentOperations(e,t,i){const n=[];return k.isEmpty(e)?n.push(Li.delete(new k(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(n.push(Li.delete(new k(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),n.push(Li.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(Li.replace(new k(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(s.push(Li.insert(new z(e.startLineNumber,e.startColumn),t+(n?" ":""))),s.push(Li.insert(new z(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 Ae(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 Ae(n.endLineNumber,n.endColumn+s,n.endLineNumber,n.endColumn+s)}}}class hd{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;ds?t[l].commentStrOffset=r-1:t[l].commentStrOffset=r}}}class HR extends Te{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(si);if(!t.hasModel())return;const n=t.getModel(),s=[],r=n.getOptions(),a=t.getOption(23),l=t.getSelections().map((c,u)=>({selection:c,index:u,ignoreFirstLine:!1}));l.sort((c,u)=>k.compareRangesUsingStarts(c.selection,u.selection));let d=l[0];for(let c=1;c=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},sh=function(o,e){return function(t,i){e(t,i,o)}},FT;let im=FT=class{static get(e){return e.getContribution(FT.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 de,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(),u=d.srcElement;u.shadowRoot&&sg(c)===u.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 xv){const c=this._getMenuActions(e,d.item.submenu);c.length>0&&(i.push(new xp(d.id,d.label,c)),l++)}else i.push(d),l++;l&&i.push(new Mn)}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=gn(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)&&!Ea;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 jp(r,r,{label:!0,keybinding:a.getLabel(),isMenu:!0});const l=r;return typeof l.getActionViewItem=="function"?l.getActionViewItem():new jp(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()||Kle(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 xp(`menu-action-${++i}`,d,c,void 0),r=(d,c,u,h,g)=>{if(!c)return n({label:d,enabled:c,run:()=>{}});const f=v=>()=>{this._configurationService.updateValue(u,v)},m=[];for(const v of g)m.push(n({label:v.label,checked:h===v.value,run:f(v.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 Mn),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)&&!Ea;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()}};im.ID="editor.contrib.contextmenu";im=FT=v0e([sh(1,Sr),sh(2,Gd),sh(3,Xe),sh(4,Xt),sh(5,Ba),sh(6,Dt),sh(7,ag)],im);class b0e extends Te{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:T.textInputFocus,primary:1092,weight:100}})}run(e,t){var i;(i=im.get(t))===null||i===void 0||i.showContextMenu()}}At(im.ID,im,2);_e(b0e);class hk{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{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 hk(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new gk(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 gk(new hk(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 gk(new hk(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}}Cg.ID="editor.contrib.cursorUndoRedoController";class C0e extends Te{constructor(){super({id:"cursorUndo",label:p("cursor.undo","Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:T.textInputFocus,primary:2099,weight:100}})}run(e,t,i){var n;(n=Cg.get(t))===null||n===void 0||n.cursorUndo()}}class w0e extends Te{constructor(){super({id:"cursorRedo",label:p("cursor.redo","Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,i){var n;(n=Cg.get(t))===null||n===void 0||n.cursorRedo()}}At(Cg.ID,Cg,0);_e(C0e);_e(w0e);class S0e{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 Ae(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 Ae(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumberthis._onEditorMouseDown(t))),this._register(this._editor.onMouseUp(t=>this._onEditorMouseUp(t))),this._register(this._editor.onMouseDrag(t=>this._onEditorMouseDrag(t))),this._register(this._editor.onMouseDrop(t=>this._onEditorMouseDrop(t))),this._register(this._editor.onMouseDropCanceled(()=>this._onEditorMouseDropCanceled())),this._register(this._editor.onKeyDown(t=>this.onEditorKeyDown(t))),this._register(this._editor.onKeyUp(t=>this.onEditorKeyUp(t))),this._register(this._editor.onDidBlurEditorWidget(()=>this.onEditorBlur())),this._register(this._editor.onDidBlurEditorText(()=>this.onEditorBlur())),this._mouseDown=!1,this._modifierPressed=!1,this._dragSelection=null}onEditorBlur(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1}onEditorKeyDown(e){!this._editor.getOption(35)||this._editor.getOption(22)||(af(e)&&(this._modifierPressed=!0),this._mouseDown&&af(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(35)||this._editor.getOption(22)||(af(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===Bd.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}af(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 z(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 Ae(s,r,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map(n=>n.containsPosition(t)?new Ae(t.lineNumber,t.column,t.lineNumber,t.column):n);this._editor.setSelections(i||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(af(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(Bd.ID,new S0e(this._dragSelection,t,af(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:Bd._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()}}Bd.ID="editor.contrib.dragAndDrop";Bd.TRIGGER_KEY_VALUE=It?6:5;Bd._DECORATION_OPTIONS=st.register({description:"dnd-target",className:"dnd-target"});At(Bd.ID,Bd,2);const HL=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;no,asFile:()=>{},value:typeof o=="string"?o:void 0}}function y0e(o,e,t){const i={id:HL(),name:o,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class YV{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 wt.some(this,([i,n])=>n.asFile())&&t.push("files"),QV(HS(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 HS(e)}}function HS(o){return o.toLowerCase()}function XV(o,e){return QV(HS(o),e.map(HS))}function QV(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 zL=Object.freeze({create:o=>iu(o.map(e=>e.toString())).join(`\r `),split:o=>o.split(`\r `),parse:o=>zL.split(o).filter(e=>!e.startsWith("#"))}),L3={EDITORS:"CodeEditors",FILES:"CodeFiles"};class L0e{}const D0e={DragAndDropContribution:"workbench.contributions.dragAndDrop"};xi.add(D0e.DragAndDropContribution,new L0e);class Db{constructor(){}static getInstance(){return Db.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}}Db.INSTANCE=new Db;function JV(o){const e=new YV;for(const t of o.items){const i=t.type;if(t.kind==="string"){const n=new Promise(s=>t.getAsString(s));e.append(i,zR(n))}else if(t.kind==="file"){const n=t.getAsFile();n&&e.append(i,x0e(n))}}return e}function x0e(o){const e=o.path?ze.parse(o.path):void 0;return y0e(o.name,e,async()=>new Uint8Array(await o.arrayBuffer()))}const k0e=Object.freeze([L3.EDITORS,L3.FILES,sb.RESOURCES,sb.INTERNAL_URI_LIST]);function eH(o,e=!1){const t=JV(o),i=t.get(sb.INTERNAL_URI_LIST);if(i)t.replace(qi.uriList,i);else if(e||!t.has(qi.uriList)){const n=[];for(const s of o.items){const r=s.getAsFile();if(r){const a=r.path;try{a?n.push(ze.file(a).toString()):n.push(ze.parse(r.name,!0).toString())}catch{}}}n.length&&t.replace(qi.uriList,zR(zL.create(n)))}for(const n of k0e)t.delete(n);return t}function I0e(o,e,t){var i,n;return{edits:[...e.map(s=>new Od(o,typeof t.insertText=="string"?{range:s,text:t.insertText,insertAsSnippet:!1}:{range:s,text:t.insertText.snippet,insertAsSnippet:!0})),...(n=(i=t.additionalEdit)===null||i===void 0?void 0:i.edits)!==null&&n!==void 0?n:[]]}}function tH(o){var e;function t(a,l){return"providerId"in a&&a.providerId===l.providerId||"mimeType"in a&&a.mimeType===l.handledMimeType}const i=new Map;for(const a of o)for(const l of(e=a.yieldTo)!==null&&e!==void 0?e:[])for(const d of o)if(d!==a&&t(l,d)){let c=i.get(a);c||(c=[],i.set(a,c)),c.push(d)}if(!i.size)return Array.from(o);const n=new Set,s=[];function r(a){if(!a.length)return[];const l=a[0];if(s.includes(l))return console.warn(`Yield to cycle detected for ${l.providerId}`),a;if(n.has(l))return r(a.slice(1));let d=[];const c=i.get(l);return c&&(s.push(l),d=r(c),s.pop()),n.add(l),[...d,l,...r(a.slice(1))]}return r(Array.from(o))}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},N0e=function(o,e){return function(t,i){e(t,i,o)}};const T0e=st.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:b8,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}});class $L extends q{constructor(e,t,i,n,s){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=s,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(n),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=pe(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=pe("span.icon");this.domNode.append(t),t.classList.add(...Ue.asClassNameArray(ve.loading),"codicon-modifier-spin");const i=()=>{const n=this.editor.getOption(66);this.domNode.style.height=`${n}px`,this.domNode.style.width=`${Math.ceil(.8*n)}px`};i(),this._register(this.editor.onDidChangeConfiguration(n=>{(n.hasChanged(52)||n.hasChanged(66))&&i()})),this._register(J(this.domNode,Se.CLICK,n=>{this.delegate.cancel()}))}getId(){return $L.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[0]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}}$L.baseId="editor.widget.inlineProgressWidget";let zS=class extends q{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new An),this._currentWidget=new An,this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}async showWhile(e,t,i){const n=this._operationIdPool++;this._currentOperation=n,this.clear(),this._showPromise.value=lu(()=>{const s=k.fromPositions(e);this._currentDecorations.set([{range:s,options:T0e}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance($L,this.id,this._editor,s,t,i))},this._showDelay);try{return await i}finally{this._currentOperation===n&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};zS=E0e([N0e(2,qe)],zS);var iH=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)}},BT;let $S=BT=class extends q{constructor(e,t,i,n,s,r,a,l,d,c){super(),this.typeId=e,this.editor=t,this.showCommand=n,this.range=s,this.edits=r,this.onSelectNewEdit=a,this._contextMenuService=l,this._keybindingService=c,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(d),this.visibleContext.set(!0),this._register(je(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(je(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(u=>{s.containsPosition(u.position)||this.dispose()})),this._register(ye.runAndSubscribe(c.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var e;const t=(e=this._keybindingService.lookupKeybinding(this.showCommand.id))===null||e===void 0?void 0:e.getLabel();this.button.element.title=this.showCommand.label+(t?` (${t})`:"")}create(){this.domNode=pe(".post-edit-widget"),this.button=this._register(new mS(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(J(this.domNode,Se.CLICK,()=>this.showSelector()))}getId(){return BT.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=gn(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>Qf({id:"",label:e.label,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}};$S.baseId="editor.widget.postEditWidget";$S=BT=iH([rv(7,Sr),rv(8,Xe),rv(9,Xt)],$S);let US=class extends q{constructor(e,t,i,n,s,r){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=n,this._instantiationService=s,this._bulkEditService=r,this._currentWidget=this._register(new An),this._register(ye.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,n){var s,r;const a=this._editor.getModel();if(!a||!e.length)return;const l=t.allEdits[t.activeEditIndex];if(!l)return;let d=[];(typeof l.insertText=="string"?l.insertText==="":l.insertText.snippet==="")?d=[]:d=e.map(v=>new Od(a.uri,typeof l.insertText=="string"?{range:v,text:l.insertText,insertAsSnippet:!1}:{range:v,text:l.insertText.snippet,insertAsSnippet:!0}));const u={edits:[...d,...(r=(s=l.additionalEdit)===null||s===void 0?void 0:s.edits)!==null&&r!==void 0?r:[]]},h=e[0],g=a.deltaDecorations([],[{range:h,options:{description:"paste-line-suffix",stickiness:0}}]);let f,m;try{f=await this._bulkEditService.apply(u,{editor:this._editor,token:n}),m=a.getDecorationRange(g[0])}finally{a.deltaDecorations(g,[])}i&&f.isApplied&&t.allEdits.length>1&&this.show(m??h,t,async v=>{const _=this._editor.getModel();_&&(await _.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:v,allEdits:t.allEdits},i,n))})}show(e,t,i){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance($S,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i))}clear(){this._currentWidget.clear()}tryShowSelector(){var e;(e=this._currentWidget.value)===null||e===void 0||e.showSelector()}};US=iH([rv(4,qe),rv(5,f0)],US);var M0e=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},lf=function(o,e){return function(t,i){e(t,i,o)}},WT;const nH="editor.changePasteType",sH=new De("pasteWidgetVisible",!1,p("pasteWidgetVisible","Whether the paste widget is showing")),fk="application/vnd.code.copyMetadata";let wg=WT=class extends q{static get(e){return e.getContribution(WT.ID)}constructor(e,t,i,n,s,r,a){super(),this._bulkEditService=i,this._clipboardService=n,this._languageFeaturesService=s,this._quickInputService=r,this._progressService=a,this._editor=e;const l=e.getContainerDomNode();this._register(J(l,"copy",d=>this.handleCopy(d))),this._register(J(l,"cut",d=>this.handleCopy(d))),this._register(J(l,"paste",d=>this.handlePaste(d),!0)),this._pasteProgressManager=this._register(new zS("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(US,"pasteIntoEditor",e,sH,{id:nH,label:p("postPasteWidgetTitle","Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferredId:e},fm().execCommand("paste")}finally{this._pasteAsActionContext=void 0}}isPasteAsEnabled(){return this._editor.getOption(84).enabled&&!this._editor.getOption(90)}handleCopy(e){var t,i;if(!this._editor.hasTextFocus()||(Tu&&this._clipboardService.writeResources([]),!e.clipboardData||!this.isPasteAsEnabled()))return;const n=this._editor.getModel(),s=this._editor.getSelections();if(!n||!(s!=null&&s.length))return;const r=this._editor.getOption(37);let a=s;const l=s.length===1&&s[0].isEmpty();if(l){if(!r)return;a=[new k(a[0].startLineNumber,1,a[0].startLineNumber,1+n.getLineLength(a[0].startLineNumber))]}const d=(t=this._editor._getViewModel())===null||t===void 0?void 0:t.getPlainTextToCopy(s,r,is),u={multicursorText:Array.isArray(d)?d:null,pasteOnNewLine:l,mode:null},h=this._languageFeaturesService.documentPasteEditProvider.ordered(n).filter(_=>!!_.prepareDocumentPaste);if(!h.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:u});return}const g=JV(e.clipboardData),f=h.flatMap(_=>{var b;return(b=_.copyMimeTypes)!==null&&b!==void 0?b:[]}),m=HL();this.setCopyMetadata(e.clipboardData,{id:m,providerCopyMimeTypes:f,defaultPastePayload:u});const v=_n(async _=>{const b=Ia(await Promise.all(h.map(async C=>{try{return await C.prepareDocumentPaste(n,a,g,_)}catch(w){console.error(w);return}})));b.reverse();for(const C of b)for(const[w,S]of C)g.replace(w,S);return g});(i=this._currentCopyOperation)===null||i===void 0||i.dataTransferPromise.cancel(),this._currentCopyOperation={handle:m,dataTransferPromise:v}}async handlePaste(e){var t,i;if(!e.clipboardData||!this._editor.hasTextFocus())return;(t=this._currentPasteOperation)===null||t===void 0||t.cancel(),this._currentPasteOperation=void 0;const n=this._editor.getModel(),s=this._editor.getSelections();if(!(s!=null&&s.length)||!n||!this.isPasteAsEnabled())return;const r=this.fetchCopyMetadata(e),a=eH(e.clipboardData);a.delete(fk);const l=[...e.clipboardData.types,...(i=r==null?void 0:r.providerCopyMimeTypes)!==null&&i!==void 0?i:[],qi.uriList],d=this._languageFeaturesService.documentPasteEditProvider.ordered(n).filter(c=>{var u;return(u=c.pasteMimeTypes)===null||u===void 0?void 0:u.some(h=>XV(h,l))});d.length&&(e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferredId,d,s,a,r):this.doPasteInline(d,s,a,r))}doPasteInline(e,t,i,n){const s=_n(async r=>{const a=this._editor;if(!a.hasModel())return;const l=a.getModel(),d=new bu(a,3,void 0,r);try{if(await this.mergeInDataFromCopy(i,n,d.token),d.token.isCancellationRequested)return;const c=e.filter(h=>D3(h,i));if(!c.length||c.length===1&&c[0].id==="text"){await this.applyDefaultPasteHandler(i,n,d.token);return}const u=await this.getPasteEdits(c,i,l,t,d.token);if(d.token.isCancellationRequested)return;if(u.length===1&&u[0].providerId==="text"){await this.applyDefaultPasteHandler(i,n,d.token);return}if(u.length){const h=a.getOption(84).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:0,allEdits:u},h,d.token)}await this.applyDefaultPasteHandler(i,n,d.token)}finally{d.dispose(),this._currentPasteOperation===s&&(this._currentPasteOperation=void 0)}});this._pasteProgressManager.showWhile(t[0].getEndPosition(),p("pasteIntoEditorProgress","Running paste handlers. Click to cancel"),s),this._currentPasteOperation=s}showPasteAsPick(e,t,i,n,s){const r=_n(async a=>{const l=this._editor;if(!l.hasModel())return;const d=l.getModel(),c=new bu(l,3,void 0,a);try{if(await this.mergeInDataFromCopy(n,s,c.token),c.token.isCancellationRequested)return;let u=t.filter(m=>D3(m,n));e&&(u=u.filter(m=>m.id===e));const h=await this.getPasteEdits(u,n,d,i,c.token);if(c.token.isCancellationRequested||!h.length)return;let g;if(e)g=h.at(0);else{const m=await this._quickInputService.pick(h.map(v=>({label:v.label,description:v.providerId,detail:v.detail,edit:v})),{placeHolder:p("pasteAsPickerPlaceholder","Select Paste Action")});g=m==null?void 0:m.edit}if(!g)return;const f=I0e(d.uri,i,g);await this._bulkEditService.apply(f,{editor:this._editor})}finally{c.dispose(),this._currentPasteOperation===r&&(this._currentPasteOperation=void 0)}});this._progressService.withProgress({location:10,title:p("pasteAsProgress","Running paste handlers")},()=>r)}setCopyMetadata(e,t){e.setData(fk,JSON.stringify(t))}fetchCopyMetadata(e){var t;if(!e.clipboardData)return;const i=e.clipboardData.getData(fk);if(i)try{return JSON.parse(i)}catch{return}const[n,s]=lE.getTextData(e.clipboardData);if(s)return{defaultPastePayload:{mode:s.mode,multicursorText:(t=s.multicursorText)!==null&&t!==void 0?t:null,pasteOnNewLine:!!s.isFromEmptySelection}}}async mergeInDataFromCopy(e,t,i){var n;if(t!=null&&t.id&&((n=this._currentCopyOperation)===null||n===void 0?void 0:n.handle)===t.id){const s=await this._currentCopyOperation.dataTransferPromise;if(i.isCancellationRequested)return;for(const[r,a]of s)e.replace(r,a)}if(!e.has(qi.uriList)){const s=await this._clipboardService.readResources();if(i.isCancellationRequested)return;s.length&&e.append(qi.uriList,zR(zL.create(s)))}}async getPasteEdits(e,t,i,n,s){const r=await Cy(Promise.all(e.map(async l=>{var d;try{const c=await((d=l.provideDocumentPasteEdits)===null||d===void 0?void 0:d.call(l,i,n,t,s));if(c)return{...c,providerId:l.id}}catch(c){console.error(c)}})),s),a=Ia(r??[]);return tH(a)}async applyDefaultPasteHandler(e,t,i){var n,s,r;const a=(n=e.get(qi.text))!==null&&n!==void 0?n:e.get("text");if(!a)return;const l=await a.asString();if(i.isCancellationRequested)return;const d={text:l,pasteOnNewLine:(s=t==null?void 0:t.defaultPastePayload.pasteOnNewLine)!==null&&s!==void 0?s:!1,multicursorText:(r=t==null?void 0:t.defaultPastePayload.multicursorText)!==null&&r!==void 0?r:null,mode:null};this._editor.trigger("keyboard","paste",d)}};wg.ID="editor.contrib.copyPasteActionController";wg=WT=M0e([lf(1,qe),lf(2,f0),lf(3,Xd),lf(4,Me),lf(5,Ha),lf(6,JB)],wg);function D3(o,e){var t;return!!(!((t=o.pasteMimeTypes)===null||t===void 0)&&t.some(i=>e.matches(i)))}var $R=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},xb=function(o,e){return function(t,i){e(t,i,o)}};const UR=p("builtIn","Built-in");class jR{async provideDocumentPasteEdits(e,t,i,n){const s=await this.getEdit(i,n);return s?{insertText:s.insertText,label:s.label,detail:s.detail,handledMimeType:s.handledMimeType,yieldTo:s.yieldTo}:void 0}async provideDocumentOnDropEdits(e,t,i,n){const s=await this.getEdit(i,n);return s?{insertText:s.insertText,label:s.label,handledMimeType:s.handledMimeType,yieldTo:s.yieldTo}:void 0}}class oH extends jR{constructor(){super(...arguments),this.id="text",this.dropMimeTypes=[qi.text],this.pasteMimeTypes=[qi.text]}async getEdit(e,t){const i=e.get(qi.text);if(!i||e.has(qi.uriList))return;const n=await i.asString();return{handledMimeType:qi.text,label:p("text.label","Insert Plain Text"),detail:UR,insertText:n}}}class rH extends jR{constructor(){super(...arguments),this.id="uri",this.dropMimeTypes=[qi.uriList],this.pasteMimeTypes=[qi.uriList]}async getEdit(e,t){const i=await aH(e);if(!i.length||t.isCancellationRequested)return;let n=0;const s=i.map(({uri:a,originalText:l})=>a.scheme===ot.file?a.fsPath:(n++,l)).join(" ");let r;return n>0?r=i.length>1?p("defaultDropProvider.uriList.uris","Insert Uris"):p("defaultDropProvider.uriList.uri","Insert Uri"):r=i.length>1?p("defaultDropProvider.uriList.paths","Insert Paths"):p("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:qi.uriList,insertText:s,label:r,detail:UR}}}let jS=class extends jR{constructor(e){super(),this._workspaceContextService=e,this.id="relativePath",this.dropMimeTypes=[qi.uriList],this.pasteMimeTypes=[qi.uriList]}async getEdit(e,t){const i=await aH(e);if(!i.length||t.isCancellationRequested)return;const n=Ia(i.map(({uri:s})=>{const r=this._workspaceContextService.getWorkspaceFolder(s);return r?Voe(r.uri,s):void 0}));if(n.length)return{handledMimeType:qi.uriList,insertText:n.join(" "),label:i.length>1?p("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):p("defaultDropProvider.uriList.relativePath","Insert Relative Path"),detail:UR}}};jS=$R([xb(0,ag)],jS);async function aH(o){const e=o.get(qi.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const n of zL.parse(t))try{i.push({uri:ze.parse(n),originalText:n})}catch{}return i}let VT=class extends q{constructor(e,t){super(),this._register(e.documentOnDropEditProvider.register("*",new oH)),this._register(e.documentOnDropEditProvider.register("*",new rH)),this._register(e.documentOnDropEditProvider.register("*",new jS(t)))}};VT=$R([xb(0,Me),xb(1,ag)],VT);let HT=class extends q{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new oH)),this._register(e.documentPasteEditProvider.register("*",new rH)),this._register(e.documentPasteEditProvider.register("*",new jS(t)))}};HT=$R([xb(0,Me),xb(1,ag)],HT);At(wg.ID,wg,0);_L(HT);we(new class extends Rn{constructor(){super({id:nH,precondition:sH,kbOpts:{weight:100,primary:2137}})}runEditorCommand(o,e,t){var i;return(i=wg.get(e))===null||i===void 0?void 0:i.changePasteType()}});_e(class extends Te{constructor(){super({id:"editor.action.pasteAs",label:p("pasteAs","Paste As..."),alias:"Paste As...",precondition:void 0,metadata:{description:"Paste as",args:[{name:"args",schema:{type:"object",properties:{id:{type:"string",description:p("pasteAs.id","The id of the paste edit to try applying. If not provided, the editor will show a picker.")}}}}]}})}run(o,e,t){var i;const n=typeof(t==null?void 0:t.id)=="string"?t.id:void 0;return(i=wg.get(e))===null||i===void 0?void 0:i.pasteAs(n)}});class A0e{constructor(){this._dragOperations=new Map}removeDragOperationTransfer(e){if(e&&this._dragOperations.has(e)){const t=this._dragOperations.get(e);return this._dragOperations.delete(e),t}}}class x3{constructor(e){this.identifier=e}}const lH=bt("treeViewsDndService");xt(lH,A0e,1);var R0e=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},qC=function(o,e){return function(t,i){e(t,i,o)}},zT;const dH="editor.experimental.dropIntoEditor.defaultProvider",cH="editor.changeDropType",uH=new De("dropWidgetVisible",!1,p("dropWidgetVisible","Whether the drop widget is showing"));let nm=zT=class extends q{static get(e){return e.getContribution(zT.ID)}constructor(e,t,i,n,s){super(),this._configService=i,this._languageFeaturesService=n,this._treeViewsDragAndDropService=s,this.treeItemsTransfer=Db.getInstance(),this._dropProgressManager=this._register(t.createInstance(zS,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(US,"dropIntoEditor",e,uH,{id:cH,label:p("postDropWidgetTitle","Show drop options...")})),this._register(e.onDropIntoEditor(r=>this.onDropIntoEditor(e,r.position,r.event)))}changeDropType(){this._postDropWidgetManager.tryShowSelector()}async onDropIntoEditor(e,t,i){var n;if(!i.dataTransfer||!e.hasModel())return;(n=this._currentOperation)===null||n===void 0||n.cancel(),e.focus(),e.setPosition(t);const s=_n(async r=>{const a=new bu(e,1,void 0,r);try{const l=await this.extractDataTransferData(i);if(l.size===0||a.token.isCancellationRequested)return;const d=e.getModel();if(!d)return;const c=this._languageFeaturesService.documentOnDropEditProvider.ordered(d).filter(h=>h.dropMimeTypes?h.dropMimeTypes.some(g=>l.matches(g)):!0),u=await this.getDropEdits(c,d,t,l,a);if(a.token.isCancellationRequested)return;if(u.length){const h=this.getInitialActiveEditIndex(d,u),g=e.getOption(36).showDropSelector==="afterDrop";await this._postDropWidgetManager.applyEditAndShowIfNeeded([k.fromPositions(t)],{activeEditIndex:h,allEdits:u},g,r)}}finally{a.dispose(),this._currentOperation===s&&(this._currentOperation=void 0)}});this._dropProgressManager.showWhile(t,p("dropIntoEditorProgress","Running drop handlers. Click to cancel"),s),this._currentOperation=s}async getDropEdits(e,t,i,n,s){const r=await Cy(Promise.all(e.map(async l=>{try{const d=await l.provideDocumentOnDropEdits(t,i,n,s.token);if(d)return{...d,providerId:l.id}}catch(d){console.error(d)}})),s.token),a=Ia(r??[]);return tH(a)}getInitialActiveEditIndex(e,t){const i=this._configService.getValue(dH,{resource:e.uri});for(const[n,s]of Object.entries(i)){const r=t.findIndex(a=>s===a.providerId&&a.handledMimeType&&XV(n,[a.handledMimeType]));if(r>=0)return r}return 0}async extractDataTransferData(e){if(!e.dataTransfer)return new YV;const t=eH(e.dataTransfer);if(this.treeItemsTransfer.hasData(x3.prototype)){const i=this.treeItemsTransfer.getData(x3.prototype);if(Array.isArray(i))for(const n of i){const s=await this._treeViewsDragAndDropService.removeDragOperationTransfer(n.identifier);if(s)for(const[r,a]of s)t.replace(r,a)}}return t}};nm.ID="editor.contrib.dropIntoEditorController";nm=zT=R0e([qC(1,qe),qC(2,Dt),qC(3,Me),qC(4,lH)],nm);At(nm.ID,nm,2);we(new class extends Rn{constructor(){super({id:cH,precondition:uH,kbOpts:{weight:100,primary:2137}})}runEditorCommand(o,e,t){var i;(i=nm.get(e))===null||i===void 0||i.changeDropType()}});_L(VT);xi.as(Va.Configuration).registerConfiguration({...Xy,properties:{[dH]:{type:"object",scope:5,description:p("defaultProviderDescription","Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}});class _s{constructor(e){this._editor=e,this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null,this._startPosition=this._editor.getPosition()}dispose(){this._editor.removeDecorations(this._allDecorations()),this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}reset(){this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}getCount(){return this._decorations.length}getFindScope(){return this._findScopeDecorationIds[0]?this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]):null}getFindScopes(){if(this._findScopeDecorationIds.length){const e=this._findScopeDecorationIds.map(t=>this._editor.getModel().getDecorationRange(t)).filter(t=>!!t);if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){const t=this._decorations.indexOf(e);return t>=0?t+1:1}getDecorationRangeAt(e){const t=e{if(this._highlightedDecorationId!==null&&(n.changeDecorationOptions(this._highlightedDecorationId,_s._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,n.changeDecorationOptions(this._highlightedDecorationId,_s._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(n.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let s=this._editor.getModel().getDecorationRange(t);if(s.startLineNumber!==s.endLineNumber&&s.endColumn===1){const r=s.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(r);s=new k(s.startLineNumber,s.startColumn,r,a)}this._rangeHighlightDecorationId=n.addDecoration(s,_s._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let n=_s._FIND_MATCH_DECORATION;const s=[];if(e.length>1e3){n=_s._FIND_MATCH_NO_OVERVIEW_DECORATION;const a=this._editor.getModel().getLineCount(),d=this._editor.getLayoutInfo().height/a,c=Math.max(2,Math.ceil(3/d));let u=e[0].range.startLineNumber,h=e[0].range.endLineNumber;for(let g=1,f=e.length;g=m.startLineNumber?m.endLineNumber>h&&(h=m.endLineNumber):(s.push({range:new k(u,1,h,1),options:_s._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),u=m.startLineNumber,h=m.endLineNumber)}s.push({range:new k(u,1,h,1),options:_s._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const r=new Array(e.length);for(let a=0,l=e.length;ai.removeDecoration(a)),this._findScopeDecorationIds=[]),t!=null&&t.length&&(this._findScopeDecorationIds=t.map(a=>i.addDecoration(a,_s._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){const i=this._decorations[t],n=this._editor.getModel().getDecorationRange(i);if(!(!n||n.endLineNumber>e.lineNumber)){if(n.endLineNumbere.column))return n}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,i=this._decorations.length;te.lineNumber)return s;if(!(s.startColumn0){const i=[];for(let r=0;rk.compareRangesUsingStarts(r.range,a.range));const n=[];let s=i[0];for(let r=1;r0?e[0].toUpperCase()+e.substr(1):o[0][0].toUpperCase()!==o[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function k3(o,e,t){return o[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&o[0].split(t).length===e.split(t).length}function I3(o,e,t){const i=e.split(t),n=o[0].split(t);let s="";return i.forEach((r,a)=>{s+=hH([n[a]],r)+t}),s.slice(0,-1)}class E3{constructor(e){this.staticValue=e,this.kind=0}}class O0e{constructor(e){this.pieces=e,this.kind=1}}class sm{static fromStaticValue(e){return new sm([qh.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new E3(""):e.length===1&&e[0].staticValue!==null?this._state=new E3(e[0].staticValue):this._state=new O0e(e)}buildReplaceString(e,t){if(this._state.kind===0)return t?hH(e,this._state.staticValue):this._state.staticValue;let i="";for(let n=0,s=this._state.pieces.length;n0){const l=[],d=r.caseOps.length;let c=0;for(let u=0,h=a.length;u=d){l.push(a.slice(u));break}switch(r.caseOps[c]){case"U":l.push(a[u].toUpperCase());break;case"u":l.push(a[u].toUpperCase()),c++;break;case"L":l.push(a[u].toLowerCase());break;case"l":l.push(a[u].toLowerCase()),c++;break;default:l.push(a[u])}}a=l.join("")}i+=a}return i}static _substitute(e,t){if(t===null)return"";if(e===0)return t[0];let i="";for(;e>0;){if(e=n)break;const r=o.charCodeAt(i);switch(r){case 92:t.emitUnchanged(i-1),t.emitStatic("\\",i+1);break;case 110:t.emitUnchanged(i-1),t.emitStatic(` diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-C3sb7NYv.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-IfhogCVC.js similarity index 96% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-C3sb7NYv.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-IfhogCVC.js index 9e85bf22de..010232599f 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-C3sb7NYv.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-IfhogCVC.js @@ -1 +1 @@ -import{d as I,a as u,b as m,q as $,s as j,f as C,x as q,e as s,t as c,r as T,u as M,c as _,o as L,g as f,w as O,j as V,F,l as K,p as R,y as H}from"./index-CNsQoPg8.js";import{_ as z}from"./Java-AI-BYpq8IxI.js";import{I as P}from"./iconify-B3l7reUz.js";import{_ as N}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{L as U}from"./index-rqS3tjXd.js";import{u as A,s as r}from"./sidebar-ON4PvQzg.js";import"./llm-check-BVkAKrj3.js";const G={key:1,class:"blur-card-content"},Q=I({__name:"index",props:{content:{},wrapperStyle:{}},emits:["clickCard"],setup(x,{emit:p}){const n=x,l=p,i=()=>{console.log("[BlurCard] handleClick called with content:",n.content),l("clickCard",n.content),console.log("[BlurCard] clickCard event emitted")};return(e,S)=>{var d,h,g,v,b;return m(),u("button",{class:"blur-card",onClick:i,style:$(e.wrapperStyle)},[(d=e.content)!=null&&d.icon?(m(),j(q(P),{key:0,icon:e.content.icon,class:"blur-card-icon"},null,8,["icon"])):C("",!0),(h=e.content)!=null&&h.title||(g=e.content)!=null&&g.description?(m(),u("div",G,[s("h3",null,c((v=e.content)==null?void 0:v.title),1),s("p",null,c((b=e.content)==null?void 0:b.description),1)])):C("",!0)],4)}}}),W=N(Q,[["__scopeId","data-v-48da0039"]]),X={class:"home-page"},Y={class:"welcome-container"},Z={class:"header"},ee={class:"header-top"},oe={class:"logo-container"},te={class:"tagline"},se={class:"main-content"},ae={class:"conversation-container"},ne={class:"welcome-section"},le={class:"welcome-title"},re={class:"welcome-subtitle"},ie={class:"input-section"},ce={class:"input-container"},pe=["placeholder"],me=["disabled"],de={class:"examples-section"},ue={class:"examples-grid"},he={class:"card-type"},ge=I({__name:"index",setup(x){const p=R(),n=A(),l=T(""),i=T(),{t:e}=M(),S=()=>{const t=Date.now().toString();p.push({name:"direct",params:{id:t}}).then(()=>{console.log("[Home] jump to direct page"+e("common.success"))}).catch(o=>{console.error("[Home] jump to direct page"+e("common.error"),o)})},d=_(()=>[{title:e("home.examples.stockPrice.title"),type:"message",description:e("home.examples.stockPrice.description"),icon:"carbon:chart-line-data",prompt:e("home.examples.stockPrice.prompt")},{title:e("home.examples.weather.title"),type:"message",description:e("home.examples.weather.description"),icon:"carbon:partly-cloudy",prompt:e("home.examples.weather.prompt")}]),h=_(()=>[{title:e("home.examples.queryplan.title"),type:"plan-act",description:e("home.examples.queryplan.description"),icon:"carbon:plan",prompt:e("home.examples.queryplan.prompt"),planJson:{planType:"simple",title:e("home.examples.queryplan.planTitle"),steps:[{stepRequirement:e("home.examples.queryplan.step1"),terminateColumns:e("home.examples.queryplan.step1Output")},{stepRequirement:e("home.examples.queryplan.step2"),terminateColumns:e("home.examples.queryplan.step2Output")}],planId:"planTemplate-1749200517403"}},{title:e("home.examples.ainovel.title"),type:"plan-act",description:e("home.examples.ainovel.description"),icon:"carbon:document-tasks",prompt:e("home.examples.ainovel.prompt"),planJson:{planType:"simple",title:e("home.examples.ainovel.planTitle"),steps:[{stepRequirement:e("home.examples.ainovel.step1"),terminateColumns:e("home.examples.ainovel.step1Output")},{stepRequirement:e("home.examples.ainovel.step2"),terminateColumns:e("home.examples.ainovel.step2Output")}],planId:"planTemplate-1753622676988"}}]),g=_(()=>[...d.value,...h.value]),v=t=>{t.type==="message"?E(t):t.type==="plan-act"&&J(t)};L(()=>{console.log("[Home] onMounted called"),console.log("[Home] taskStore:",n),console.log("[Home] examples:",d),n.markHomeVisited(),console.log("[Home] Home visited marked")});const b=async t=>{try{r.createNewTemplate(),r.jsonContent=JSON.stringify(t);const o=await r.saveTemplate();o!=null&&o.duplicate?console.log("[Sidebar] "+e("sidebar.saveCompleted",{message:o.message,versionCount:o.versionCount})):o!=null&&o.saved?console.log("[Sidebar] "+e("sidebar.saveSuccess",{message:o.message,versionCount:o.versionCount})):o!=null&&o.message&&console.log("[Sidebar] "+e("sidebar.saveStatus",{message:o.message}))}catch(o){console.error("[Sidebar] Failed to save the plan to the template library:",o),alert(o.message||e("sidebar.saveFailed"))}},B=()=>{H(()=>{i.value&&(i.value.style.height="auto",i.value.style.height=Math.min(i.value.scrollHeight,200)+"px")})},D=t=>{console.log("[Home] handleKeydown called, key:",t.key),t.key==="Enter"&&!t.shiftKey&&(t.preventDefault(),console.log("[Home] Enter key pressed, calling handleSend"),w())},w=()=>{if(console.log("[Home] handleSend called, userInput:",l.value),!l.value.trim()){console.log("[Home] handleSend aborted - empty input");return}const t=l.value.trim();console.log("[Home] Setting task to store:",t),n.setTask(t),console.log("[Home] Task set to store, current task:",n.currentTask);const o=Date.now().toString();console.log("[Home] Navigating to direct page with chatId:",o),p.push({name:"direct",params:{id:o}}).then(()=>{console.log("[Home] Navigation to direct page completed")}).catch(a=>{console.error("[Home] Navigation error:",a)})},E=t=>{console.log("[Home] selectExample called with example:",t),console.log("[Home] Example prompt:",t.prompt),n.setTask(t.prompt),console.log("[Home] Task set to store from example, current task:",n.currentTask);const o=Date.now().toString();console.log("[Home] Navigating to direct page with chatId:",o),p.push({name:"direct",params:{id:o}}).then(()=>{console.log("[Home] Navigation to direct page completed (from example)")}).catch(a=>{console.error("[Home] Navigation error (from example):",a)})},J=async t=>{console.log("[Home] selectPlan called with plan:",t);try{await b(t.planJson),console.log("[Home] Plan saved to templates");const o=Date.now().toString();await p.push({name:"direct",params:{id:o}}),H(async()=>{await new Promise(k=>setTimeout(k,300)),r.isCollapsed?(await r.toggleSidebar(),console.log("[Sidebar] Sidebar toggled")):console.log("[Sidebar] Sidebar is already open"),await r.loadPlanTemplateList(),console.log("[Sidebar] Template list loaded");const a=r.planTemplateList.find(k=>k.id===t.planJson.planId);if(!a){console.error("[Sidebar] Template not found");return}await r.selectTemplate(a),console.log("[Sidebar] Template selected:",a.title);const y=document.querySelector(".execute-btn");y.disabled?console.error("[Sidebar] Execute button not found or disabled"):(console.log("[Sidebar] Triggering execute button click"),y.click())})}catch(o){console.error("[Home] Error in selectPlan:",o)}};return(t,o)=>(m(),u("div",X,[s("div",Y,[o[2]||(o[2]=s("div",{class:"background-effects"},[s("div",{class:"gradient-orb orb-1"}),s("div",{class:"gradient-orb orb-2"}),s("div",{class:"gradient-orb orb-3"})],-1)),s("header",Z,[s("div",ee,[f(U)]),s("div",oe,[o[1]||(o[1]=s("div",{class:"logo"},[s("img",{src:z,alt:"JManus",class:"java-logo"}),s("h1",null,"JManus")],-1)),s("span",te,c(t.$t("home.tagline")),1)])]),s("main",se,[s("div",ae,[s("div",ne,[s("h2",le,c(t.$t("home.welcomeTitle")),1),s("p",re,c(t.$t("home.welcomeSubtitle")),1),s("button",{class:"direct-button",onClick:S},c(t.$t("home.directButton")),1)]),s("div",ie,[s("div",ce,[O(s("textarea",{"onUpdate:modelValue":o[0]||(o[0]=a=>l.value=a),ref_key:"textareaRef",ref:i,class:"main-input",placeholder:t.$t("home.inputPlaceholder"),onKeydown:D,onInput:B},null,40,pe),[[V,l.value]]),s("button",{class:"send-button",disabled:!l.value.trim(),onClick:w},[f(q(P),{icon:"carbon:send-alt"})],8,me)])]),s("div",de,[s("div",ue,[(m(!0),u(F,null,K(g.value,a=>(m(),u("div",{key:a.title,class:"card-with-type"},[f(W,{content:a,onClickCard:y=>v(a)},null,8,["content","onClickCard"]),s("span",he,c(a.type),1)]))),128))])])])])])]))}}),Se=N(ge,[["__scopeId","data-v-5aee9964"]]);export{Se as default}; +import{d as I,a as u,b as m,q as $,s as j,f as C,x as q,e as s,t as c,r as T,u as M,c as _,o as L,g as f,w as O,j as V,F,l as K,p as R,y as H}from"./index-4v3E7DlV.js";import{_ as z}from"./Java-AI-BYpq8IxI.js";import{I as P}from"./iconify-BLmmgPNH.js";import{_ as N}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{L as U}from"./index-qVolg4Ti.js";import{u as A,s as r}from"./sidebar-CmBcz3il.js";import"./llm-check-BVkAKrj3.js";const G={key:1,class:"blur-card-content"},Q=I({__name:"index",props:{content:{},wrapperStyle:{}},emits:["clickCard"],setup(x,{emit:p}){const n=x,l=p,i=()=>{console.log("[BlurCard] handleClick called with content:",n.content),l("clickCard",n.content),console.log("[BlurCard] clickCard event emitted")};return(e,S)=>{var d,h,g,v,b;return m(),u("button",{class:"blur-card",onClick:i,style:$(e.wrapperStyle)},[(d=e.content)!=null&&d.icon?(m(),j(q(P),{key:0,icon:e.content.icon,class:"blur-card-icon"},null,8,["icon"])):C("",!0),(h=e.content)!=null&&h.title||(g=e.content)!=null&&g.description?(m(),u("div",G,[s("h3",null,c((v=e.content)==null?void 0:v.title),1),s("p",null,c((b=e.content)==null?void 0:b.description),1)])):C("",!0)],4)}}}),W=N(Q,[["__scopeId","data-v-48da0039"]]),X={class:"home-page"},Y={class:"welcome-container"},Z={class:"header"},ee={class:"header-top"},oe={class:"logo-container"},te={class:"tagline"},se={class:"main-content"},ae={class:"conversation-container"},ne={class:"welcome-section"},le={class:"welcome-title"},re={class:"welcome-subtitle"},ie={class:"input-section"},ce={class:"input-container"},pe=["placeholder"],me=["disabled"],de={class:"examples-section"},ue={class:"examples-grid"},he={class:"card-type"},ge=I({__name:"index",setup(x){const p=R(),n=A(),l=T(""),i=T(),{t:e}=M(),S=()=>{const t=Date.now().toString();p.push({name:"direct",params:{id:t}}).then(()=>{console.log("[Home] jump to direct page"+e("common.success"))}).catch(o=>{console.error("[Home] jump to direct page"+e("common.error"),o)})},d=_(()=>[{title:e("home.examples.stockPrice.title"),type:"message",description:e("home.examples.stockPrice.description"),icon:"carbon:chart-line-data",prompt:e("home.examples.stockPrice.prompt")},{title:e("home.examples.weather.title"),type:"message",description:e("home.examples.weather.description"),icon:"carbon:partly-cloudy",prompt:e("home.examples.weather.prompt")}]),h=_(()=>[{title:e("home.examples.queryplan.title"),type:"plan-act",description:e("home.examples.queryplan.description"),icon:"carbon:plan",prompt:e("home.examples.queryplan.prompt"),planJson:{planType:"simple",title:e("home.examples.queryplan.planTitle"),steps:[{stepRequirement:e("home.examples.queryplan.step1"),terminateColumns:e("home.examples.queryplan.step1Output")},{stepRequirement:e("home.examples.queryplan.step2"),terminateColumns:e("home.examples.queryplan.step2Output")}],planId:"planTemplate-1749200517403"}},{title:e("home.examples.ainovel.title"),type:"plan-act",description:e("home.examples.ainovel.description"),icon:"carbon:document-tasks",prompt:e("home.examples.ainovel.prompt"),planJson:{planType:"simple",title:e("home.examples.ainovel.planTitle"),steps:[{stepRequirement:e("home.examples.ainovel.step1"),terminateColumns:e("home.examples.ainovel.step1Output")},{stepRequirement:e("home.examples.ainovel.step2"),terminateColumns:e("home.examples.ainovel.step2Output")}],planId:"planTemplate-1753622676988"}}]),g=_(()=>[...d.value,...h.value]),v=t=>{t.type==="message"?E(t):t.type==="plan-act"&&J(t)};L(()=>{console.log("[Home] onMounted called"),console.log("[Home] taskStore:",n),console.log("[Home] examples:",d),n.markHomeVisited(),console.log("[Home] Home visited marked")});const b=async t=>{try{r.createNewTemplate(),r.jsonContent=JSON.stringify(t);const o=await r.saveTemplate();o!=null&&o.duplicate?console.log("[Sidebar] "+e("sidebar.saveCompleted",{message:o.message,versionCount:o.versionCount})):o!=null&&o.saved?console.log("[Sidebar] "+e("sidebar.saveSuccess",{message:o.message,versionCount:o.versionCount})):o!=null&&o.message&&console.log("[Sidebar] "+e("sidebar.saveStatus",{message:o.message}))}catch(o){console.error("[Sidebar] Failed to save the plan to the template library:",o),alert(o.message||e("sidebar.saveFailed"))}},B=()=>{H(()=>{i.value&&(i.value.style.height="auto",i.value.style.height=Math.min(i.value.scrollHeight,200)+"px")})},D=t=>{console.log("[Home] handleKeydown called, key:",t.key),t.key==="Enter"&&!t.shiftKey&&(t.preventDefault(),console.log("[Home] Enter key pressed, calling handleSend"),w())},w=()=>{if(console.log("[Home] handleSend called, userInput:",l.value),!l.value.trim()){console.log("[Home] handleSend aborted - empty input");return}const t=l.value.trim();console.log("[Home] Setting task to store:",t),n.setTask(t),console.log("[Home] Task set to store, current task:",n.currentTask);const o=Date.now().toString();console.log("[Home] Navigating to direct page with chatId:",o),p.push({name:"direct",params:{id:o}}).then(()=>{console.log("[Home] Navigation to direct page completed")}).catch(a=>{console.error("[Home] Navigation error:",a)})},E=t=>{console.log("[Home] selectExample called with example:",t),console.log("[Home] Example prompt:",t.prompt),n.setTask(t.prompt),console.log("[Home] Task set to store from example, current task:",n.currentTask);const o=Date.now().toString();console.log("[Home] Navigating to direct page with chatId:",o),p.push({name:"direct",params:{id:o}}).then(()=>{console.log("[Home] Navigation to direct page completed (from example)")}).catch(a=>{console.error("[Home] Navigation error (from example):",a)})},J=async t=>{console.log("[Home] selectPlan called with plan:",t);try{await b(t.planJson),console.log("[Home] Plan saved to templates");const o=Date.now().toString();await p.push({name:"direct",params:{id:o}}),H(async()=>{await new Promise(k=>setTimeout(k,300)),r.isCollapsed?(await r.toggleSidebar(),console.log("[Sidebar] Sidebar toggled")):console.log("[Sidebar] Sidebar is already open"),await r.loadPlanTemplateList(),console.log("[Sidebar] Template list loaded");const a=r.planTemplateList.find(k=>k.id===t.planJson.planId);if(!a){console.error("[Sidebar] Template not found");return}await r.selectTemplate(a),console.log("[Sidebar] Template selected:",a.title);const y=document.querySelector(".execute-btn");y.disabled?console.error("[Sidebar] Execute button not found or disabled"):(console.log("[Sidebar] Triggering execute button click"),y.click())})}catch(o){console.error("[Home] Error in selectPlan:",o)}};return(t,o)=>(m(),u("div",X,[s("div",Y,[o[2]||(o[2]=s("div",{class:"background-effects"},[s("div",{class:"gradient-orb orb-1"}),s("div",{class:"gradient-orb orb-2"}),s("div",{class:"gradient-orb orb-3"})],-1)),s("header",Z,[s("div",ee,[f(U)]),s("div",oe,[o[1]||(o[1]=s("div",{class:"logo"},[s("img",{src:z,alt:"JManus",class:"java-logo"}),s("h1",null,"JManus")],-1)),s("span",te,c(t.$t("home.tagline")),1)])]),s("main",se,[s("div",ae,[s("div",ne,[s("h2",le,c(t.$t("home.welcomeTitle")),1),s("p",re,c(t.$t("home.welcomeSubtitle")),1),s("button",{class:"direct-button",onClick:S},c(t.$t("home.directButton")),1)]),s("div",ie,[s("div",ce,[O(s("textarea",{"onUpdate:modelValue":o[0]||(o[0]=a=>l.value=a),ref_key:"textareaRef",ref:i,class:"main-input",placeholder:t.$t("home.inputPlaceholder"),onKeydown:D,onInput:B},null,40,pe),[[V,l.value]]),s("button",{class:"send-button",disabled:!l.value.trim(),onClick:w},[f(q(P),{icon:"carbon:send-alt"})],8,me)])]),s("div",de,[s("div",ue,[(m(!0),u(F,null,K(g.value,a=>(m(),u("div",{key:a.title,class:"card-with-type"},[f(W,{content:a,onClickCard:y=>v(a)},null,8,["content","onClickCard"]),s("span",he,c(a.type),1)]))),128))])])])])])]))}}),Se=N(ge,[["__scopeId","data-v-5aee9964"]]);export{Se as default}; diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-rqS3tjXd.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-qVolg4Ti.js similarity index 94% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-rqS3tjXd.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-qVolg4Ti.js index acdbb4704a..31f3776829 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-rqS3tjXd.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/index-qVolg4Ti.js @@ -1 +1 @@ -import{d as L,u as E,r as p,c as v,P as $,o as B,A as I,a as r,b as l,e as t,f as g,g as h,x as u,t as d,h as x,F as D,l as F,n as N,s as w,Q as U}from"./index-CNsQoPg8.js";import{I as i}from"./iconify-B3l7reUz.js";import{_ as V}from"./_plugin-vue_export-helper-DlAUqK2U.js";const M={class:"language-switcher"},O=["title"],S={class:"current-lang"},z={class:"dropdown-header"},A={class:"language-options"},K=["disabled","onClick"],P={class:"lang-code"},Q={class:"lang-name"},j=L({__name:"index",setup(q){const{locale:_}=E(),a=p(!1),o=v(()=>_.value),f=v(()=>$.opts),b=v(()=>{const e=f.value.find(n=>n.value===o.value);return e?e.title:"Unknown"}),y=()=>{a.value=!a.value},c=p(!1),C=async e=>{if(!(c.value||o.value===e))try{c.value=!0,await U(e),a.value=!1}catch(n){console.error("Failed to change language:",n),a.value=!1}finally{c.value=!1}},k=e=>{e.target.closest(".language-switcher")||(a.value=!1)},m=e=>{e.key==="Escape"&&(a.value=!1)};return B(()=>{document.addEventListener("click",k),document.addEventListener("keydown",m)}),I(()=>{document.removeEventListener("click",k),document.removeEventListener("keydown",m)}),(e,n)=>(l(),r("div",M,[t("button",{class:"language-btn",onClick:y,title:e.$t("language.switch")},[h(u(i),{icon:"carbon:translate",width:"18"}),t("span",S,d(b.value),1),h(u(i),{icon:a.value?"carbon:chevron-up":"carbon:chevron-down",width:"14",class:"chevron"},null,8,["icon"])],8,O),a.value?(l(),r("div",{key:0,class:"language-dropdown",onClick:n[1]||(n[1]=x(()=>{},["stop"]))},[t("div",z,[t("span",null,d(e.$t("language.switch")),1),t("button",{class:"close-btn",onClick:n[0]||(n[0]=s=>a.value=!1)},[h(u(i),{icon:"carbon:close",width:"16"})])]),t("div",A,[(l(!0),r(D,null,F(f.value,s=>(l(),r("button",{key:s.value,class:N(["language-option",{active:o.value===s.value,loading:c.value&&o.value!==s.value}]),disabled:c.value,onClick:G=>C(s.value)},[t("span",P,d(s.value.toUpperCase()),1),t("span",Q,d(s.title),1),c.value&&o.value!==s.value?(l(),w(u(i),{key:0,icon:"carbon:circle-dash",width:"16",class:"loading-icon"})):o.value===s.value?(l(),w(u(i),{key:1,icon:"carbon:checkmark",width:"16",class:"check-icon"})):g("",!0)],10,K))),128))])])):g("",!0),a.value?(l(),r("div",{key:1,class:"backdrop",onClick:n[2]||(n[2]=s=>a.value=!1)})):g("",!0)]))}}),T=V(j,[["__scopeId","data-v-25f759dc"]]);export{T as L}; +import{d as L,u as E,r as p,c as v,P as $,o as B,A as I,a as r,b as l,e as t,f as g,g as h,x as u,t as d,h as x,F as D,l as F,n as N,s as w,Q as U}from"./index-4v3E7DlV.js";import{I as i}from"./iconify-BLmmgPNH.js";import{_ as V}from"./_plugin-vue_export-helper-DlAUqK2U.js";const M={class:"language-switcher"},O=["title"],S={class:"current-lang"},z={class:"dropdown-header"},A={class:"language-options"},K=["disabled","onClick"],P={class:"lang-code"},Q={class:"lang-name"},j=L({__name:"index",setup(q){const{locale:_}=E(),a=p(!1),o=v(()=>_.value),f=v(()=>$.opts),b=v(()=>{const e=f.value.find(n=>n.value===o.value);return e?e.title:"Unknown"}),y=()=>{a.value=!a.value},c=p(!1),C=async e=>{if(!(c.value||o.value===e))try{c.value=!0,await U(e),a.value=!1}catch(n){console.error("Failed to change language:",n),a.value=!1}finally{c.value=!1}},k=e=>{e.target.closest(".language-switcher")||(a.value=!1)},m=e=>{e.key==="Escape"&&(a.value=!1)};return B(()=>{document.addEventListener("click",k),document.addEventListener("keydown",m)}),I(()=>{document.removeEventListener("click",k),document.removeEventListener("keydown",m)}),(e,n)=>(l(),r("div",M,[t("button",{class:"language-btn",onClick:y,title:e.$t("language.switch")},[h(u(i),{icon:"carbon:translate",width:"18"}),t("span",S,d(b.value),1),h(u(i),{icon:a.value?"carbon:chevron-up":"carbon:chevron-down",width:"14",class:"chevron"},null,8,["icon"])],8,O),a.value?(l(),r("div",{key:0,class:"language-dropdown",onClick:n[1]||(n[1]=x(()=>{},["stop"]))},[t("div",z,[t("span",null,d(e.$t("language.switch")),1),t("button",{class:"close-btn",onClick:n[0]||(n[0]=s=>a.value=!1)},[h(u(i),{icon:"carbon:close",width:"16"})])]),t("div",A,[(l(!0),r(D,null,F(f.value,s=>(l(),r("button",{key:s.value,class:N(["language-option",{active:o.value===s.value,loading:c.value&&o.value!==s.value}]),disabled:c.value,onClick:G=>C(s.value)},[t("span",P,d(s.value.toUpperCase()),1),t("span",Q,d(s.title),1),c.value&&o.value!==s.value?(l(),w(u(i),{key:0,icon:"carbon:circle-dash",width:"16",class:"loading-icon"})):o.value===s.value?(l(),w(u(i),{key:1,icon:"carbon:checkmark",width:"16",class:"check-icon"})):g("",!0)],10,K))),128))])])):g("",!0),a.value?(l(),r("div",{key:1,class:"backdrop",onClick:n[2]||(n[2]=s=>a.value=!1)})):g("",!0)]))}}),T=V(j,[["__scopeId","data-v-25f759dc"]]);export{T as L}; diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/javascript-C0XxeR-n.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/javascript-BJumLL0S.js similarity index 81% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/javascript-C0XxeR-n.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/javascript-BJumLL0S.js index a3b6cd3ad6..a7026a7a7e 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/javascript-C0XxeR-n.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/javascript-BJumLL0S.js @@ -1,4 +1,4 @@ -import{conf as t,language as e}from"./typescript-Cfb9k-qV.js";import"./index-BGKqtLX6.js";import"./index-CNsQoPg8.js";import"./iconify-B3l7reUz.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-BR4qCw-P.js";import"./index-rqS3tjXd.js";/*!----------------------------------------------------------------------------- +import{conf as t,language as e}from"./typescript-CCDjWNWW.js";import"./index-DKKeqlAO.js";import"./index-4v3E7DlV.js";import"./iconify-BLmmgPNH.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-C57EfbNm.js";import"./index-qVolg4Ti.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/jsonMode-BNPGVg0I.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/jsonMode-D895wvia.js similarity index 99% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/jsonMode-BNPGVg0I.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/jsonMode-D895wvia.js index b5b40a88c5..54a897b85d 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/jsonMode-BNPGVg0I.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/jsonMode-D895wvia.js @@ -1,4 +1,4 @@ -var $e=Object.defineProperty;var Ge=(e,n,i)=>n in e?$e(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i;var C=(e,n,i)=>Ge(e,typeof n!="symbol"?n+"":n,i);import{m as Qe}from"./index-BGKqtLX6.js";import"./index-CNsQoPg8.js";import"./iconify-B3l7reUz.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-BR4qCw-P.js";import"./index-rqS3tjXd.js";/*!----------------------------------------------------------------------------- +var $e=Object.defineProperty;var Ge=(e,n,i)=>n in e?$e(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i;var C=(e,n,i)=>Ge(e,typeof n!="symbol"?n+"":n,i);import{m as Qe}from"./index-DKKeqlAO.js";import"./index-4v3E7DlV.js";import"./iconify-BLmmgPNH.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-C57EfbNm.js";import"./index-qVolg4Ti.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/liquid-BFayS-os.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/liquid-DMSYRB3x.js similarity index 94% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/liquid-BFayS-os.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/liquid-DMSYRB3x.js index 717b959387..f640ee06cd 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/liquid-BFayS-os.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/liquid-DMSYRB3x.js @@ -1,4 +1,4 @@ -import{m as l}from"./index-BGKqtLX6.js";import"./index-CNsQoPg8.js";import"./iconify-B3l7reUz.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-BR4qCw-P.js";import"./index-rqS3tjXd.js";/*!----------------------------------------------------------------------------- +import{m as l}from"./index-DKKeqlAO.js";import"./index-4v3E7DlV.js";import"./iconify-BLmmgPNH.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-C57EfbNm.js";import"./index-qVolg4Ti.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/mdx-DeQweMxo.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/mdx-BJdIIkYZ.js similarity index 95% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/mdx-DeQweMxo.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/mdx-BJdIIkYZ.js index 9f54af3306..9c1fd2770f 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/mdx-DeQweMxo.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/mdx-BJdIIkYZ.js @@ -1,4 +1,4 @@ -import{m as s}from"./index-BGKqtLX6.js";import"./index-CNsQoPg8.js";import"./iconify-B3l7reUz.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-BR4qCw-P.js";import"./index-rqS3tjXd.js";/*!----------------------------------------------------------------------------- +import{m as s}from"./index-DKKeqlAO.js";import"./index-4v3E7DlV.js";import"./iconify-BLmmgPNH.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-C57EfbNm.js";import"./index-qVolg4Ti.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/notFound-CVrU7YVW.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/notFound-DdQduqAa.js similarity index 84% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/notFound-CVrU7YVW.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/notFound-DdQduqAa.js index 389a5ec2c4..f36427ccb0 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/notFound-CVrU7YVW.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/notFound-DdQduqAa.js @@ -1 +1 @@ -import{_ as n}from"./Java-AI-BYpq8IxI.js";import{d as c,a as i,b as d,e as o,t as r,g as m,i as p,x as l,p as _}from"./index-CNsQoPg8.js";import{I as u}from"./iconify-B3l7reUz.js";import{_ as f}from"./_plugin-vue_export-helper-DlAUqK2U.js";const b={class:"not-found-page"},g={class:"error-container"},h={class:"error-message"},k=c({__name:"notFound",setup(v){const t=_(),a=()=>{t.push("/home")};return(e,s)=>(d(),i("div",b,[o("div",g,[s[0]||(s[0]=o("div",{class:"error-icon"},[o("img",{src:n,alt:"Java-AI",width:"96",height:"96",class:"java-logo"})],-1)),s[1]||(s[1]=o("h1",{class:"error-code"},"404",-1)),o("p",h,r(e.$t("error.notFound")),1),o("button",{class:"back-button",onClick:a},[m(l(u),{icon:"carbon:arrow-left"}),p(" "+r(e.$t("error.backToHome")),1)])])]))}}),N=f(k,[["__scopeId","data-v-57698550"]]);export{N as default}; +import{_ as n}from"./Java-AI-BYpq8IxI.js";import{d as c,a as i,b as d,e as o,t as r,g as m,i as p,x as l,p as _}from"./index-4v3E7DlV.js";import{I as u}from"./iconify-BLmmgPNH.js";import{_ as f}from"./_plugin-vue_export-helper-DlAUqK2U.js";const b={class:"not-found-page"},g={class:"error-container"},h={class:"error-message"},k=c({__name:"notFound",setup(v){const t=_(),a=()=>{t.push("/home")};return(e,s)=>(d(),i("div",b,[o("div",g,[s[0]||(s[0]=o("div",{class:"error-icon"},[o("img",{src:n,alt:"Java-AI",width:"96",height:"96",class:"java-logo"})],-1)),s[1]||(s[1]=o("h1",{class:"error-code"},"404",-1)),o("p",h,r(e.$t("error.notFound")),1),o("button",{class:"back-button",onClick:a},[m(l(u),{icon:"carbon:arrow-left"}),p(" "+r(e.$t("error.backToHome")),1)])])]))}}),N=f(k,[["__scopeId","data-v-57698550"]]);export{N as default}; diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/python-a9hcFcOH.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/python-CV0R8G3r.js similarity index 93% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/python-a9hcFcOH.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/python-CV0R8G3r.js index 3e51b60a37..b7aa63447c 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/python-a9hcFcOH.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/python-CV0R8G3r.js @@ -1,4 +1,4 @@ -import{m as i}from"./index-BGKqtLX6.js";import"./index-CNsQoPg8.js";import"./iconify-B3l7reUz.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-BR4qCw-P.js";import"./index-rqS3tjXd.js";/*!----------------------------------------------------------------------------- +import{m as i}from"./index-DKKeqlAO.js";import"./index-4v3E7DlV.js";import"./iconify-BLmmgPNH.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-C57EfbNm.js";import"./index-qVolg4Ti.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/razor-1sBWwWa2.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/razor-Bjnu6Wx0.js similarity index 97% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/razor-1sBWwWa2.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/razor-Bjnu6Wx0.js index 2d68bbfda8..0e35761df9 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/razor-1sBWwWa2.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/razor-Bjnu6Wx0.js @@ -1,4 +1,4 @@ -import{m}from"./index-BGKqtLX6.js";import"./index-CNsQoPg8.js";import"./iconify-B3l7reUz.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-BR4qCw-P.js";import"./index-rqS3tjXd.js";/*!----------------------------------------------------------------------------- +import{m}from"./index-DKKeqlAO.js";import"./index-4v3E7DlV.js";import"./iconify-BLmmgPNH.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-C57EfbNm.js";import"./index-qVolg4Ti.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/sidebar-ON4PvQzg.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/sidebar-CmBcz3il.js similarity index 99% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/sidebar-ON4PvQzg.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/sidebar-CmBcz3il.js index e4d7550940..6d59fdb06a 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/sidebar-ON4PvQzg.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/sidebar-CmBcz3il.js @@ -1,2 +1,2 @@ -var m=Object.defineProperty;var T=(n,e,t)=>e in n?m(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var r=(n,e,t)=>T(n,typeof e!="symbol"?e+"":e,t);import{H as g,r as h,z as P,I as p}from"./index-CNsQoPg8.js";import{L as d}from"./llm-check-BVkAKrj3.js";const V=g("task",()=>{const n=h(null),e=h(""),t=h(!1);return{currentTask:n,taskToInput:e,hasVisitedHome:t,setTask:o=>{console.log("[TaskStore] setTask called with prompt:",o);const u={prompt:o,timestamp:Date.now(),processed:!1};n.value=u,console.log("[TaskStore] Task set, currentTask.value:",n.value)},setTaskToInput:o=>{console.log("[TaskStore] setTaskToInput called with prompt:",o),e.value=o,console.log("[TaskStore] Task to input set:",e.value)},getAndClearTaskToInput:()=>{const o=e.value;return e.value="",console.log("[TaskStore] getAndClearTaskToInput returning:",o),o},markTaskAsProcessed:()=>{console.log("[TaskStore] markTaskAsProcessed called, current task:",n.value),n.value?(n.value.processed=!0,console.log("[TaskStore] Task marked as processed:",n.value)):console.log("[TaskStore] No current task to mark as processed")},clearTask:()=>{n.value=null},hasUnprocessedTask:()=>{const o=n.value&&!n.value.processed;return console.log("[TaskStore] hasUnprocessedTask check - currentTask:",n.value,"result:",o),o},markHomeVisited:()=>{t.value=!0,localStorage.setItem("hasVisitedHome","true")},checkHomeVisited:()=>{const o=localStorage.getItem("hasVisitedHome");return t.value=o==="true",t.value},resetHomeVisited:()=>{t.value=!1,localStorage.removeItem("hasVisitedHome")},emitPlanExecutionRequested:o=>{console.log("[TaskStore] emitPlanExecutionRequested called with payload:",o),window.dispatchEvent(new CustomEvent("plan-execution-requested",{detail:o}))}}});class c{static async generatePlan(e,t){return d.withLlmCheck(async()=>{const s={query:e};t&&(s.existingJson=t);const a=await fetch(`${this.PLAN_TEMPLATE_URL}/generate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!a.ok)throw new Error(`Failed to generate plan: ${a.status}`);const i=await a.json();if(i.planJson)try{i.plan=JSON.parse(i.planJson)}catch{i.plan={error:"Unable to parse plan data"}}return i})}static async executePlan(e,t){return d.withLlmCheck(async()=>{console.log("[PlanActApiService] executePlan called with:",{planTemplateId:e,rawParam:t});const s={planTemplateId:e};t&&(s.rawParam=t),console.log("[PlanActApiService] Making request to:",`${this.PLAN_TEMPLATE_URL}/executePlanByTemplateId`),console.log("[PlanActApiService] Request body:",s);const a=await fetch(`${this.PLAN_TEMPLATE_URL}/executePlanByTemplateId`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(console.log("[PlanActApiService] Response status:",a.status,a.ok),!a.ok){const l=await a.text();throw console.error("[PlanActApiService] Request failed:",l),new Error(`Failed to execute plan: ${a.status}`)}const i=await a.json();return console.log("[PlanActApiService] executePlan response:",i),i})}static async savePlanTemplate(e,t){const s=await fetch(`${this.PLAN_TEMPLATE_URL}/save`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,planJson:t})});if(!s.ok)throw new Error(`Failed to save plan: ${s.status}`);return await s.json()}static async getPlanVersions(e){const t=await fetch(`${this.PLAN_TEMPLATE_URL}/versions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})});if(!t.ok)throw new Error(`Failed to get plan versions: ${t.status}`);return await t.json()}static async getVersionPlan(e,t){const s=await fetch(`${this.PLAN_TEMPLATE_URL}/get-version`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,versionIndex:t.toString()})});if(!s.ok)throw new Error(`Failed to get specific version plan: ${s.status}`);return await s.json()}static async getAllPlanTemplates(){const e=await fetch(`${this.PLAN_TEMPLATE_URL}/list`);if(!e.ok)throw new Error(`Failed to get plan template list: ${e.status}`);return await e.json()}static async updatePlanTemplate(e,t,s){return d.withLlmCheck(async()=>{const a={planId:e,query:t};s&&(a.existingJson=s);const i=await fetch(`${this.PLAN_TEMPLATE_URL}/update`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!i.ok)throw new Error(`Failed to update plan template: ${i.status}`);const l=await i.json();if(l.planJson)try{l.plan=JSON.parse(l.planJson)}catch{l.plan={error:"Unable to parse plan data"}}return l})}static async deletePlanTemplate(e){const t=await fetch(`${this.PLAN_TEMPLATE_URL}/delete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})});if(!t.ok)throw new Error(`Failed to delete plan template: ${t.status}`);return await t.json()}static async createCronTask(e){const t=await fetch(this.CRON_TASK_URL,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)try{const s=await t.json();throw new Error(s.message||`Failed to create cron task: ${t.status}`)}catch{throw new Error(`Failed to create cron task: ${t.status}`)}return await t.json()}}r(c,"PLAN_TEMPLATE_URL","/api/plan-template"),r(c,"CRON_TASK_URL","/api/cron-tasks");class w{constructor(){r(this,"isCollapsed",!0);r(this,"currentTab","list");r(this,"currentPlanTemplateId",null);r(this,"planTemplateList",[]);r(this,"selectedTemplate",null);r(this,"isLoading",!1);r(this,"errorMessage","");r(this,"jsonContent","");r(this,"generatorPrompt","");r(this,"executionParams","");r(this,"isGenerating",!1);r(this,"isExecuting",!1);r(this,"planVersions",[]);r(this,"currentVersionIndex",-1)}parseDateTime(e){return e?Array.isArray(e)&&e.length>=6?new Date(e[0],e[1]-1,e[2],e[3],e[4],e[5],Math.floor(e[6]/1e6)):typeof e=="string"?new Date(e):new Date:new Date}get sortedTemplates(){return[...this.planTemplateList].sort((e,t)=>{const s=this.parseDateTime(e.updateTime??e.createTime);return this.parseDateTime(t.updateTime??t.createTime).getTime()-s.getTime()})}get canRollback(){return this.planVersions.length>1&&this.currentVersionIndex>0}get canRestore(){return this.planVersions.length>1&&this.currentVersionIndex0){const s=this.planVersions[this.planVersions.length-1];this.jsonContent=s,this.currentVersionIndex=this.planVersions.length-1;try{const a=JSON.parse(s);a.prompt&&(this.generatorPrompt=a.prompt),a.params&&(this.executionParams=a.params)}catch{console.warn("Unable to parse JSON content to get prompt information")}}else this.jsonContent="",this.generatorPrompt="",this.executionParams=""}catch(t){throw console.error("Failed to load template data:",t),t}}createNewTemplate(){const e={id:`new-${Date.now()}`,title:p.global.t("sidebar.newTemplateName"),description:p.global.t("sidebar.newTemplateDescription"),createTime:new Date().toISOString(),updateTime:new Date().toISOString()};this.selectedTemplate=e,this.currentPlanTemplateId=null,this.jsonContent="",this.generatorPrompt="",this.executionParams="",this.planVersions=[],this.currentVersionIndex=-1,this.currentTab="config",console.log("[SidebarStore] Created new empty plan template, switching to config tab")}async deleteTemplate(e){if(!e.id){console.warn("[SidebarStore] deleteTemplate: Invalid template object or ID");return}try{await c.deletePlanTemplate(e.id),this.currentPlanTemplateId===e.id&&this.clearSelection(),await this.loadPlanTemplateList(),console.log(`[SidebarStore] Plan template ${e.id} has been deleted`)}catch(t){throw console.error("Failed to delete plan template:",t),await this.loadPlanTemplateList(),t}}clearSelection(){this.currentPlanTemplateId=null,this.selectedTemplate=null,this.jsonContent="",this.generatorPrompt="",this.executionParams="",this.planVersions=[],this.currentVersionIndex=-1,this.currentTab="list"}clearExecutionParams(){this.executionParams=""}rollbackVersion(){this.canRollback&&(this.currentVersionIndex--,this.jsonContent=this.planVersions[this.currentVersionIndex])}restoreVersion(){this.canRestore&&(this.currentVersionIndex++,this.jsonContent=this.planVersions[this.currentVersionIndex])}async saveTemplate(){if(!this.selectedTemplate)return;const e=this.jsonContent.trim();if(!e)throw new Error("Content cannot be empty");try{JSON.parse(e)}catch(t){throw new Error(`Invalid format, please correct and save. +var m=Object.defineProperty;var T=(n,e,t)=>e in n?m(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var r=(n,e,t)=>T(n,typeof e!="symbol"?e+"":e,t);import{H as g,r as h,z as P,I as p}from"./index-4v3E7DlV.js";import{L as d}from"./llm-check-BVkAKrj3.js";const V=g("task",()=>{const n=h(null),e=h(""),t=h(!1);return{currentTask:n,taskToInput:e,hasVisitedHome:t,setTask:o=>{console.log("[TaskStore] setTask called with prompt:",o);const u={prompt:o,timestamp:Date.now(),processed:!1};n.value=u,console.log("[TaskStore] Task set, currentTask.value:",n.value)},setTaskToInput:o=>{console.log("[TaskStore] setTaskToInput called with prompt:",o),e.value=o,console.log("[TaskStore] Task to input set:",e.value)},getAndClearTaskToInput:()=>{const o=e.value;return e.value="",console.log("[TaskStore] getAndClearTaskToInput returning:",o),o},markTaskAsProcessed:()=>{console.log("[TaskStore] markTaskAsProcessed called, current task:",n.value),n.value?(n.value.processed=!0,console.log("[TaskStore] Task marked as processed:",n.value)):console.log("[TaskStore] No current task to mark as processed")},clearTask:()=>{n.value=null},hasUnprocessedTask:()=>{const o=n.value&&!n.value.processed;return console.log("[TaskStore] hasUnprocessedTask check - currentTask:",n.value,"result:",o),o},markHomeVisited:()=>{t.value=!0,localStorage.setItem("hasVisitedHome","true")},checkHomeVisited:()=>{const o=localStorage.getItem("hasVisitedHome");return t.value=o==="true",t.value},resetHomeVisited:()=>{t.value=!1,localStorage.removeItem("hasVisitedHome")},emitPlanExecutionRequested:o=>{console.log("[TaskStore] emitPlanExecutionRequested called with payload:",o),window.dispatchEvent(new CustomEvent("plan-execution-requested",{detail:o}))}}});class c{static async generatePlan(e,t){return d.withLlmCheck(async()=>{const s={query:e};t&&(s.existingJson=t);const a=await fetch(`${this.PLAN_TEMPLATE_URL}/generate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!a.ok)throw new Error(`Failed to generate plan: ${a.status}`);const i=await a.json();if(i.planJson)try{i.plan=JSON.parse(i.planJson)}catch{i.plan={error:"Unable to parse plan data"}}return i})}static async executePlan(e,t){return d.withLlmCheck(async()=>{console.log("[PlanActApiService] executePlan called with:",{planTemplateId:e,rawParam:t});const s={planTemplateId:e};t&&(s.rawParam=t),console.log("[PlanActApiService] Making request to:",`${this.PLAN_TEMPLATE_URL}/executePlanByTemplateId`),console.log("[PlanActApiService] Request body:",s);const a=await fetch(`${this.PLAN_TEMPLATE_URL}/executePlanByTemplateId`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(console.log("[PlanActApiService] Response status:",a.status,a.ok),!a.ok){const l=await a.text();throw console.error("[PlanActApiService] Request failed:",l),new Error(`Failed to execute plan: ${a.status}`)}const i=await a.json();return console.log("[PlanActApiService] executePlan response:",i),i})}static async savePlanTemplate(e,t){const s=await fetch(`${this.PLAN_TEMPLATE_URL}/save`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,planJson:t})});if(!s.ok)throw new Error(`Failed to save plan: ${s.status}`);return await s.json()}static async getPlanVersions(e){const t=await fetch(`${this.PLAN_TEMPLATE_URL}/versions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})});if(!t.ok)throw new Error(`Failed to get plan versions: ${t.status}`);return await t.json()}static async getVersionPlan(e,t){const s=await fetch(`${this.PLAN_TEMPLATE_URL}/get-version`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,versionIndex:t.toString()})});if(!s.ok)throw new Error(`Failed to get specific version plan: ${s.status}`);return await s.json()}static async getAllPlanTemplates(){const e=await fetch(`${this.PLAN_TEMPLATE_URL}/list`);if(!e.ok)throw new Error(`Failed to get plan template list: ${e.status}`);return await e.json()}static async updatePlanTemplate(e,t,s){return d.withLlmCheck(async()=>{const a={planId:e,query:t};s&&(a.existingJson=s);const i=await fetch(`${this.PLAN_TEMPLATE_URL}/update`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!i.ok)throw new Error(`Failed to update plan template: ${i.status}`);const l=await i.json();if(l.planJson)try{l.plan=JSON.parse(l.planJson)}catch{l.plan={error:"Unable to parse plan data"}}return l})}static async deletePlanTemplate(e){const t=await fetch(`${this.PLAN_TEMPLATE_URL}/delete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})});if(!t.ok)throw new Error(`Failed to delete plan template: ${t.status}`);return await t.json()}static async createCronTask(e){const t=await fetch(this.CRON_TASK_URL,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)try{const s=await t.json();throw new Error(s.message||`Failed to create cron task: ${t.status}`)}catch{throw new Error(`Failed to create cron task: ${t.status}`)}return await t.json()}}r(c,"PLAN_TEMPLATE_URL","/api/plan-template"),r(c,"CRON_TASK_URL","/api/cron-tasks");class w{constructor(){r(this,"isCollapsed",!0);r(this,"currentTab","list");r(this,"currentPlanTemplateId",null);r(this,"planTemplateList",[]);r(this,"selectedTemplate",null);r(this,"isLoading",!1);r(this,"errorMessage","");r(this,"jsonContent","");r(this,"generatorPrompt","");r(this,"executionParams","");r(this,"isGenerating",!1);r(this,"isExecuting",!1);r(this,"planVersions",[]);r(this,"currentVersionIndex",-1)}parseDateTime(e){return e?Array.isArray(e)&&e.length>=6?new Date(e[0],e[1]-1,e[2],e[3],e[4],e[5],Math.floor(e[6]/1e6)):typeof e=="string"?new Date(e):new Date:new Date}get sortedTemplates(){return[...this.planTemplateList].sort((e,t)=>{const s=this.parseDateTime(e.updateTime??e.createTime);return this.parseDateTime(t.updateTime??t.createTime).getTime()-s.getTime()})}get canRollback(){return this.planVersions.length>1&&this.currentVersionIndex>0}get canRestore(){return this.planVersions.length>1&&this.currentVersionIndex0){const s=this.planVersions[this.planVersions.length-1];this.jsonContent=s,this.currentVersionIndex=this.planVersions.length-1;try{const a=JSON.parse(s);a.prompt&&(this.generatorPrompt=a.prompt),a.params&&(this.executionParams=a.params)}catch{console.warn("Unable to parse JSON content to get prompt information")}}else this.jsonContent="",this.generatorPrompt="",this.executionParams=""}catch(t){throw console.error("Failed to load template data:",t),t}}createNewTemplate(){const e={id:`new-${Date.now()}`,title:p.global.t("sidebar.newTemplateName"),description:p.global.t("sidebar.newTemplateDescription"),createTime:new Date().toISOString(),updateTime:new Date().toISOString()};this.selectedTemplate=e,this.currentPlanTemplateId=null,this.jsonContent="",this.generatorPrompt="",this.executionParams="",this.planVersions=[],this.currentVersionIndex=-1,this.currentTab="config",console.log("[SidebarStore] Created new empty plan template, switching to config tab")}async deleteTemplate(e){if(!e.id){console.warn("[SidebarStore] deleteTemplate: Invalid template object or ID");return}try{await c.deletePlanTemplate(e.id),this.currentPlanTemplateId===e.id&&this.clearSelection(),await this.loadPlanTemplateList(),console.log(`[SidebarStore] Plan template ${e.id} has been deleted`)}catch(t){throw console.error("Failed to delete plan template:",t),await this.loadPlanTemplateList(),t}}clearSelection(){this.currentPlanTemplateId=null,this.selectedTemplate=null,this.jsonContent="",this.generatorPrompt="",this.executionParams="",this.planVersions=[],this.currentVersionIndex=-1,this.currentTab="list"}clearExecutionParams(){this.executionParams=""}rollbackVersion(){this.canRollback&&(this.currentVersionIndex--,this.jsonContent=this.planVersions[this.currentVersionIndex])}restoreVersion(){this.canRestore&&(this.currentVersionIndex++,this.jsonContent=this.planVersions[this.currentVersionIndex])}async saveTemplate(){if(!this.selectedTemplate)return;const e=this.jsonContent.trim();if(!e)throw new Error("Content cannot be empty");try{JSON.parse(e)}catch(t){throw new Error(`Invalid format, please correct and save. Error: `+t.message)}try{const t=await c.savePlanTemplate(this.selectedTemplate.id,e);return this.currentVersionIndext in e?N(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var _=(e,t,r)=>M(e,typeof t!="symbol"?t+"":t,r);import{t as R,m as K}from"./index-BGKqtLX6.js";import"./index-CNsQoPg8.js";import"./iconify-B3l7reUz.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-BR4qCw-P.js";import"./index-rqS3tjXd.js";/*!----------------------------------------------------------------------------- +var N=Object.defineProperty;var M=(e,t,r)=>t in e?N(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var _=(e,t,r)=>M(e,typeof t!="symbol"?t+"":t,r);import{t as R,m as K}from"./index-DKKeqlAO.js";import"./index-4v3E7DlV.js";import"./iconify-BLmmgPNH.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-C57EfbNm.js";import"./index-qVolg4Ti.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/typescript-Cfb9k-qV.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/typescript-CCDjWNWW.js similarity index 95% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/typescript-Cfb9k-qV.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/typescript-CCDjWNWW.js index ca9c0befa2..56400b3c66 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/typescript-Cfb9k-qV.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/typescript-CCDjWNWW.js @@ -1,4 +1,4 @@ -import{m as s}from"./index-BGKqtLX6.js";import"./index-CNsQoPg8.js";import"./iconify-B3l7reUz.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-BR4qCw-P.js";import"./index-rqS3tjXd.js";/*!----------------------------------------------------------------------------- +import{m as s}from"./index-DKKeqlAO.js";import"./index-4v3E7DlV.js";import"./iconify-BLmmgPNH.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-C57EfbNm.js";import"./index-qVolg4Ti.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/useMessage-BR4qCw-P.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/useMessage-C57EfbNm.js similarity index 95% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/useMessage-BR4qCw-P.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/useMessage-C57EfbNm.js index b06d7ad866..f528372a20 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/useMessage-BR4qCw-P.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/useMessage-C57EfbNm.js @@ -1 +1 @@ -import{d as v,r as n,s as g,b as m,g as d,k as _,a as w,f as k,e as T,x as b,t as x,n as y,T as C,C as M,O as B,z as $}from"./index-CNsQoPg8.js";import{I as N}from"./iconify-B3l7reUz.js";import{_ as V}from"./_plugin-vue_export-helper-DlAUqK2U.js";const z=v({__name:"Toast",setup(e,{expose:s}){const a=n(!1),c=n(""),t=n("success"),l=n("carbon:checkmark"),u=n(3e3),p=(i,r="success",h=3e3)=>{c.value=i,t.value=r,l.value=r==="success"?"carbon:checkmark":"carbon:error",u.value=h,a.value=!0,setTimeout(()=>{a.value=!1},u.value)},f=()=>{a.value=!1};return s({show:p}),(i,r)=>(m(),g(M,{to:"body"},[d(C,{name:"slide"},{default:_(()=>[a.value?(m(),w("div",{key:0,class:y(["toast",`toast--${t.value}`]),onClick:f},[d(b(N),{icon:l.value,class:"toast-icon"},null,8,["icon"]),T("span",null,x(c.value),1)],2)):k("",!0)]),_:1})]))}}),E=V(z,[["__scopeId","data-v-581895ae"]]);let o=null;const O=()=>{if(!o){const e=B(E),s=document.createElement("div");document.body.appendChild(s),o=e.mount(s)}return{success:(e,s)=>{o==null||o.show(e,"success",s)},error:(e,s)=>{o==null||o.show(e,"error",s)}}};function j(){const e=$({show:!1,text:"",type:"success"});return{message:e,showMessage:(a,c="success")=>{console.log(`Showing message: ${a}, Type: ${c}`),e.text=a,e.type=c,e.show=!0;const t=c==="error"?5e3:3e3;console.log(`Message will be automatically hidden after ${t}ms`),setTimeout(()=>{e.show=!1,console.log("Message hidden")},t)}}}export{j as a,O as u}; +import{d as v,r as n,s as g,b as m,g as d,k as _,a as w,f as k,e as T,x as b,t as x,n as y,T as C,C as M,O as B,z as $}from"./index-4v3E7DlV.js";import{I as N}from"./iconify-BLmmgPNH.js";import{_ as V}from"./_plugin-vue_export-helper-DlAUqK2U.js";const z=v({__name:"Toast",setup(e,{expose:s}){const a=n(!1),c=n(""),t=n("success"),l=n("carbon:checkmark"),u=n(3e3),p=(i,r="success",h=3e3)=>{c.value=i,t.value=r,l.value=r==="success"?"carbon:checkmark":"carbon:error",u.value=h,a.value=!0,setTimeout(()=>{a.value=!1},u.value)},f=()=>{a.value=!1};return s({show:p}),(i,r)=>(m(),g(M,{to:"body"},[d(C,{name:"slide"},{default:_(()=>[a.value?(m(),w("div",{key:0,class:y(["toast",`toast--${t.value}`]),onClick:f},[d(b(N),{icon:l.value,class:"toast-icon"},null,8,["icon"]),T("span",null,x(c.value),1)],2)):k("",!0)]),_:1})]))}}),E=V(z,[["__scopeId","data-v-581895ae"]]);let o=null;const O=()=>{if(!o){const e=B(E),s=document.createElement("div");document.body.appendChild(s),o=e.mount(s)}return{success:(e,s)=>{o==null||o.show(e,"success",s)},error:(e,s)=>{o==null||o.show(e,"error",s)}}};function j(){const e=$({show:!1,text:"",type:"success"});return{message:e,showMessage:(a,c="success")=>{console.log(`Showing message: ${a}, Type: ${c}`),e.text=a,e.type=c,e.show=!0;const t=c==="error"?5e3:3e3;console.log(`Message will be automatically hidden after ${t}ms`),setTimeout(()=>{e.show=!1,console.log("Message hidden")},t)}}}export{j as a,O as u}; diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/xml-CXoMhdUk.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/xml-Bd1t5VNd.js similarity index 90% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/xml-CXoMhdUk.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/xml-Bd1t5VNd.js index 938bc2887d..cee8791576 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/xml-CXoMhdUk.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/xml-Bd1t5VNd.js @@ -1,4 +1,4 @@ -import{m as r}from"./index-BGKqtLX6.js";import"./index-CNsQoPg8.js";import"./iconify-B3l7reUz.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-BR4qCw-P.js";import"./index-rqS3tjXd.js";/*!----------------------------------------------------------------------------- +import{m as r}from"./index-DKKeqlAO.js";import"./index-4v3E7DlV.js";import"./iconify-BLmmgPNH.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-C57EfbNm.js";import"./index-qVolg4Ti.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/yaml-D4773nTm.js b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/yaml-DW01YEKS.js similarity index 94% rename from spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/yaml-D4773nTm.js rename to spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/yaml-DW01YEKS.js index ef1b046768..b1b8c12709 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/yaml-D4773nTm.js +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/assets/yaml-DW01YEKS.js @@ -1,4 +1,4 @@ -import{m as i}from"./index-BGKqtLX6.js";import"./index-CNsQoPg8.js";import"./iconify-B3l7reUz.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-BR4qCw-P.js";import"./index-rqS3tjXd.js";/*!----------------------------------------------------------------------------- +import{m as i}from"./index-DKKeqlAO.js";import"./index-4v3E7DlV.js";import"./iconify-BLmmgPNH.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./useMessage-C57EfbNm.js";import"./index-qVolg4Ti.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56) * Released under the MIT license diff --git a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/index.html b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/index.html index caf055c6f7..d4ff198321 100644 --- a/spring-ai-alibaba-jmanus/src/main/resources/static/ui/index.html +++ b/spring-ai-alibaba-jmanus/src/main/resources/static/ui/index.html @@ -20,7 +20,7 @@ JTaskPoilt - + diff --git a/spring-ai-alibaba-jmanus/src/test/java/com/alibaba/cloud/ai/example/manus/dynamic/mcp/transport/StreamableHttpClientTransportTest.java b/spring-ai-alibaba-jmanus/src/test/java/com/alibaba/cloud/ai/example/manus/dynamic/mcp/transport/StreamableHttpClientTransportTest.java deleted file mode 100644 index f0c639b931..0000000000 --- a/spring-ai-alibaba-jmanus/src/test/java/com/alibaba/cloud/ai/example/manus/dynamic/mcp/transport/StreamableHttpClientTransportTest.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright 2025 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.alibaba.cloud.ai.example.manus.dynamic.mcp.transport; - -import com.fasterxml.jackson.databind.ObjectMapper; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; -import org.springframework.web.reactive.function.client.WebClient; - -import java.lang.reflect.Method; - -import static org.junit.jupiter.api.Assertions.*; - -/** - * Test class for StreamableHttpClientTransport to verify the fix for ClassCastException. - */ -@ExtendWith(MockitoExtension.class) -class StreamableHttpClientTransportTest { - - @Mock - private WebClient.Builder webClientBuilder; - - @Mock - private WebClient webClient; - - private ObjectMapper objectMapper; - - private StreamableHttpClientTransport transport; - - @BeforeEach - void setUp() { - objectMapper = new ObjectMapper(); - transport = new StreamableHttpClientTransport(webClientBuilder, objectMapper, "/test-endpoint"); - } - - @Test - void testHandleIncomingMessageWithIntegerId() { - // Test JSON response with integer ID (the case that was causing the - // ClassCastException) - String jsonResponse = "{\"jsonrpc\":\"2.0\",\"id\":0,\"result\":{\"protocolVersion\":\"\",\"capabilities\":{},\"serverInfo\":{\"name\":\"\",\"version\":\"\"}}}"; - - // Use reflection to access the private method - try { - Method handleIncomingMessageMethod = StreamableHttpClientTransport.class - .getDeclaredMethod("handleIncomingMessage", String.class); - handleIncomingMessageMethod.setAccessible(true); - - // This should not throw a ClassCastException anymore - assertDoesNotThrow(() -> { - handleIncomingMessageMethod.invoke(transport, jsonResponse); - }, "handleIncomingMessage should not throw ClassCastException when id is an integer"); - - } - catch (Exception e) { - fail("Test setup failed: " + e.getMessage()); - } - } - - @Test - void testHandleIncomingMessageWithStringId() { - // Test JSON response with string ID - String jsonResponse = "{\"jsonrpc\":\"2.0\",\"id\":\"123\",\"result\":{\"protocolVersion\":\"\",\"capabilities\":{},\"serverInfo\":{\"name\":\"\",\"version\":\"\"}}}"; - - try { - Method handleIncomingMessageMethod = StreamableHttpClientTransport.class - .getDeclaredMethod("handleIncomingMessage", String.class); - handleIncomingMessageMethod.setAccessible(true); - - // This should not throw any exception - assertDoesNotThrow(() -> { - handleIncomingMessageMethod.invoke(transport, jsonResponse); - }, "handleIncomingMessage should not throw exception when id is a string"); - - } - catch (Exception e) { - fail("Test setup failed: " + e.getMessage()); - } - } - - @Test - void testHandleIncomingMessageWithNullId() { - // Test JSON response with null ID - String jsonResponse = "{\"jsonrpc\":\"2.0\",\"id\":null,\"result\":{\"protocolVersion\":\"\",\"capabilities\":{},\"serverInfo\":{\"name\":\"\",\"version\":\"\"}}}"; - - try { - Method handleIncomingMessageMethod = StreamableHttpClientTransport.class - .getDeclaredMethod("handleIncomingMessage", String.class); - handleIncomingMessageMethod.setAccessible(true); - - // This should not throw any exception - assertDoesNotThrow(() -> { - handleIncomingMessageMethod.invoke(transport, jsonResponse); - }, "handleIncomingMessage should not throw exception when id is null"); - - } - catch (Exception e) { - fail("Test setup failed: " + e.getMessage()); - } - } - - @Test - void testHandleIncomingMessageWithMissingId() { - // Test JSON response without id field - String jsonResponse = "{\"jsonrpc\":\"2.0\",\"result\":{\"protocolVersion\":\"\",\"capabilities\":{},\"serverInfo\":{\"name\":\"\",\"version\":\"\"}}}"; - - try { - Method handleIncomingMessageMethod = StreamableHttpClientTransport.class - .getDeclaredMethod("handleIncomingMessage", String.class); - handleIncomingMessageMethod.setAccessible(true); - - // This should not throw any exception - assertDoesNotThrow(() -> { - handleIncomingMessageMethod.invoke(transport, jsonResponse); - }, "handleIncomingMessage should not throw exception when id field is missing"); - - } - catch (Exception e) { - fail("Test setup failed: " + e.getMessage()); - } - } - -}