"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[8477],{10858:(xm,fr,f)=>{f.r(fr),f.d(fr,{CancellationTokenSource:()=>Pe.CancellationTokenSource,Emitter:()=>Pe.Emitter,KeyCode:()=>Pe.KeyCode,KeyMod:()=>Pe.KeyMod,MarkerSeverity:()=>Pe.MarkerSeverity,MarkerTag:()=>Pe.MarkerTag,Position:()=>Pe.Position,Range:()=>Pe.Range,Selection:()=>Pe.Selection,SelectionDirection:()=>Pe.SelectionDirection,Token:()=>Pe.Token,Uri:()=>Pe.Uri,editor:()=>Pe.editor,languages:()=>Pe.languages});var Pe=f(97396);/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/var xl=Object.defineProperty,Ll=Object.getOwnPropertyDescriptor,kl=Object.getOwnPropertyNames,Il=Object.prototype.hasOwnProperty,Uo=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of kl(e))!Il.call(r,n)&&n!==t&&xl(r,n,{get:()=>e[n],enumerable:!(i=Ll(e,n))||i.enumerable});return r},Rl=(r,e,t)=>(Uo(r,e,"default"),t&&Uo(t,e,"default")),Ci={};Rl(Ci,Pe);var ti={},Wn={},Bn=class{static getOrCreate(r){return Wn[r]||(Wn[r]=new Bn(r)),Wn[r]}_languageId;_loadingTriggered;_lazyLoadPromise;_lazyLoadPromiseResolve;_lazyLoadPromiseReject;constructor(r){this._languageId=r,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,ti[this._languageId].loader().then(r=>this._lazyLoadPromiseResolve(r),r=>this._lazyLoadPromiseReject(r))),this._lazyLoadPromise}};async function El(r){await Bn.getOrCreate(r).load(),Ci.editor.createModel("",r).dispose()}function H(r){const e=r.id;ti[e]=r,Ci.languages.register(r);const t=Bn.getOrCreate(e);Ci.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),Ci.languages.onLanguage(e,async()=>{const i=await t.load();Ci.languages.setLanguageConfiguration(e,i.conf)})}/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>f.e(1420).then(f.bind(f,21420))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>f.e(7048).then(f.bind(f,67048))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>f.e(3622).then(f.bind(f,3622))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>f.e(6185).then(f.bind(f,88566))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>f.e(9510).then(f.bind(f,29510))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>f.e(4334).then(f.bind(f,94334))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>f.e(9150).then(f.bind(f,89150))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>f.e(968).then(f.bind(f,10968))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>f.e(6018).then(f.bind(f,26018))}),H({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>f.e(6018).then(f.bind(f,26018))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>f.e(9038).then(f.bind(f,69038))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"csp",extensions:[],aliases:["CSP","csp"],loader:()=>f.e(1446).then(f.bind(f,21446))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>f.e(4958).then(f.bind(f,12577))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>f.e(494).then(f.bind(f,10494))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>f.e(3062).then(f.bind(f,53062))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>f.e(2692).then(f.bind(f,82692))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>f.e(2278).then(f.bind(f,2278))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>f.e(1710).then(f.bind(f,91710))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>f.e(3726).then(f.bind(f,13726))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>f.e(2244).then(f.bind(f,12244))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>f.e(2094).then(f.bind(f,22094)).then(r=>r.TagAutoInterpolationDollar)}),H({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>f.e(2094).then(f.bind(f,22094)).then(r=>r.TagAngleInterpolationDollar)}),H({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>f.e(2094).then(f.bind(f,22094)).then(r=>r.TagBracketInterpolationDollar)}),H({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>f.e(2094).then(f.bind(f,22094)).then(r=>r.TagAngleInterpolationBracket)}),H({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>f.e(2094).then(f.bind(f,22094)).then(r=>r.TagBracketInterpolationBracket)}),H({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>f.e(2094).then(f.bind(f,22094)).then(r=>r.TagAutoInterpolationDollar)}),H({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>f.e(2094).then(f.bind(f,22094)).then(r=>r.TagAutoInterpolationBracket)});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>f.e(5364).then(f.bind(f,25364))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>f.e(8902).then(f.bind(f,78902))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>f.e(5455).then(f.bind(f,97836))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>f.e(7457).then(f.bind(f,89838))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({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:()=>f.e(2658).then(f.bind(f,92658))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>f.e(8542).then(f.bind(f,68542))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>f.e(7200).then(f.bind(f,77200))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>f.e(5550).then(f.bind(f,65550))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>f.e(2962).then(f.bind(f,42962))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"kotlin",extensions:[".kt"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>f.e(8566).then(f.bind(f,28566))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>f.e(1122).then(f.bind(f,1122))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>f.e(5130).then(f.bind(f,82749))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>f.e(4114).then(f.bind(f,64114))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>f.e(3096).then(f.bind(f,83096))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>f.e(4120).then(f.bind(f,4120))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>f.e(9390).then(f.bind(f,7009))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>f.e(398).then(f.bind(f,70398))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>f.e(5786).then(f.bind(f,25786))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>f.e(7466).then(f.bind(f,77466))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>f.e(2686).then(f.bind(f,32686))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>f.e(6940).then(f.bind(f,56940))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>f.e(8230).then(f.bind(f,28230))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"perl",extensions:[".pl"],aliases:["Perl","pl"],loader:()=>f.e(7886).then(f.bind(f,57886))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>f.e(3182).then(f.bind(f,43182))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>f.e(6302).then(f.bind(f,56302))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"pla",extensions:[".pla"],loader:()=>f.e(8390).then(f.bind(f,98390))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>f.e(198).then(f.bind(f,70198))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>f.e(4209).then(f.bind(f,26590))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>f.e(4698).then(f.bind(f,24698))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>f.e(1118).then(f.bind(f,21118))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>f.e(970).then(f.bind(f,30970))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>f.e(5196).then(f.bind(f,45196))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>f.e(5618).then(f.bind(f,25618))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>f.e(205).then(f.bind(f,92586))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>f.e(946).then(f.bind(f,80946))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>f.e(8990).then(f.bind(f,88990))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>f.e(8177).then(f.bind(f,70558))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>f.e(7246).then(f.bind(f,67246))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>f.e(1560).then(f.bind(f,1560))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>f.e(4680).then(f.bind(f,44680))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>f.e(4962).then(f.bind(f,44962))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({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:()=>f.e(6446).then(f.bind(f,66446))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>f.e(8494).then(f.bind(f,78494))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>f.e(1888).then(f.bind(f,11888))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>f.e(9034).then(f.bind(f,89034))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>f.e(3042).then(f.bind(f,83042))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>f.e(8332).then(f.bind(f,68332))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>f.e(1282).then(f.bind(f,61282))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>f.e(1914).then(f.bind(f,21914))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib"],aliases:["StructuredText","scl","stl"],loader:()=>f.e(8334).then(f.bind(f,38334))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>f.e(4630).then(f.bind(f,24630))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>f.e(2398).then(f.bind(f,62398))}),H({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>f.e(2398).then(f.bind(f,62398))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>f.e(6414).then(f.bind(f,26414))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>f.e(2586).then(f.bind(f,22586))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"typescript",extensions:[".ts",".tsx"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>f.e(6830).then(f.bind(f,86830))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>f.e(1740).then(f.bind(f,41740))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"xml",extensions:[".xml",".dtd",".ascx",".csproj",".config",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xsl"],firstLine:"(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)",aliases:["XML","xml"],mimetypes:["text/xml","application/xml","application/xaml+xml","application/xml-dtd"],loader:()=>f.e(1438).then(f.bind(f,1438))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/H({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>f.e(6990).then(f.bind(f,26990))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*//*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/var pr=Object.defineProperty,mr=Object.getOwnPropertyDescriptor,Al=Object.getOwnPropertyNames,zo=Object.prototype.hasOwnProperty,$o=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Al(e))!zo.call(r,n)&&n!==t&&pr(r,n,{get:()=>e[n],enumerable:!(i=mr(e,n))||i.enumerable});return r},Nl=(r,e,t)=>($o(r,e,"default"),t&&$o(t,e,"default")),bi={};Nl(bi,Pe);var Si=class{_onDidChange=new bi.Emitter;_options;_modeConfiguration;_languageId;constructor(r,e,t){this._languageId=r,this.setOptions(e),this.setModeConfiguration(t)}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(r){this._options=r||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(r){this.setOptions(r)}setModeConfiguration(r){this._modeConfiguration=r||Object.create(null),this._onDidChange.fire(this)}},W={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}},Ie={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},ke=new Si("css",W,Ie),at=new Si("scss",W,Ie),gt=new Si("less",W,Ie);bi.languages.css={cssDefaults:ke,lessDefaults:gt,scssDefaults:at};function Ml(){return f.e(2745).then(f.bind(f,52745))}bi.languages.onLanguage("less",()=>{Ml().then(r=>r.setupMode(gt))}),bi.languages.onLanguage("scss",()=>{Ml().then(r=>r.setupMode(at))}),bi.languages.onLanguage("css",()=>{Ml().then(r=>r.setupMode(ke))});/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/var Lm=Object.defineProperty,km=Object.getOwnPropertyDescriptor,Im=Object.getOwnPropertyNames,Rm=Object.prototype.hasOwnProperty,$u=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Im(e))!Rm.call(r,n)&&n!==t&&Lm(r,n,{get:()=>e[n],enumerable:!(i=km(e,n))||i.enumerable});return r},Em=(r,e,t)=>($u(r,e,"default"),t&&$u(t,e,"default")),_r={};Em(_r,Pe);var Am=class{_onDidChange=new _r.Emitter;_options;_modeConfiguration;_languageId;constructor(r,e,t){this._languageId=r,this.setOptions(e),this.setModeConfiguration(t)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(r){this._options=r||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(r){this._modeConfiguration=r||Object.create(null),this._onDidChange.fire(this)}},Nm={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"},vr={format:Nm,suggest:{},data:{useDefaultDataProvider:!0}};function Cr(r){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:r===jo,documentFormattingEdits:r===jo,documentRangeFormattingEdits:r===jo}}var jo="html",ju="handlebars",Gu="razor",Ku=br(jo,vr,Cr(jo)),Mm=Ku.defaults,Qu=br(ju,vr,Cr(ju)),Tm=Qu.defaults,Zu=br(Gu,vr,Cr(Gu)),Om=Zu.defaults;_r.languages.html={htmlDefaults:Mm,razorDefaults:Om,handlebarDefaults:Tm,htmlLanguageService:Ku,handlebarLanguageService:Qu,razorLanguageService:Zu,registerHTMLLanguageService:br};function Fm(){return f.e(2077).then(f.bind(f,72077))}function br(r,e=vr,t=Cr(r)){const i=new Am(r,e,t);let n;const o=_r.languages.onLanguage(r,async()=>{n=(await Fm()).setupMode(i)});return{defaults:i,dispose(){o.dispose(),n?.dispose(),n=void 0}}}/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/var Pm=Object.defineProperty,Wm=Object.getOwnPropertyDescriptor,Bm=Object.getOwnPropertyNames,Hm=Object.prototype.hasOwnProperty,Yu=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Bm(e))!Hm.call(r,n)&&n!==t&&Pm(r,n,{get:()=>e[n],enumerable:!(i=Wm(e,n))||i.enumerable});return r},Vm=(r,e,t)=>(Yu(r,e,"default"),t&&Yu(t,e,"default")),Go={};Vm(Go,Pe);var Um=class{_onDidChange=new Go.Emitter;_diagnosticsOptions;_modeConfiguration;_languageId;constructor(r,e,t){this._languageId=r,this.setDiagnosticsOptions(e),this.setModeConfiguration(t)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(r){this._diagnosticsOptions=r||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(r){this._modeConfiguration=r||Object.create(null),this._onDidChange.fire(this)}},zm={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},$m={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},Xu=new Um("json",zm,$m);Go.languages.json={jsonDefaults:Xu};function jm(){return f.e(4839).then(f.bind(f,44839))}Go.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]}),Go.languages.onLanguage("json",()=>{jm().then(r=>r.setupMode(Xu))});var gL=f(19664),Sr=f(72521),Gm=f(76680),fL=f(648),pL=f(16878),ft=f(59407),xe=f(90028),Ee=f(68387),_=f(50946),q=f(93702),D=f(38122),g=f(3765),A=f(96655),Km=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Qm=function(r,e){return function(t,i){e(t,i,r)}},yr=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};const wr=new A.N1("selectionAnchorSet",!1);let ii=class Yp{constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=wr.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}static get(e){return e.getContribution(Yp.ID)}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(q.L.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new xe.Bc().appendText((0,g.kg)("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),(0,ft.xE)((0,g.kg)("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(q.L.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()}};ii.ID="editor.contrib.selectionAnchorController",ii=Km([Qm(1,A.fN)],ii);class Zm extends _.ks{constructor(){super({id:"editor.action.setSelectionAnchor",label:(0,g.kg)("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:D.R.editorTextFocus,primary:(0,Ee.m5)(2089,2080),weight:100}})}run(e,t){var i;return yr(this,void 0,void 0,function*(){(i=ii.get(t))===null||i===void 0||i.setSelectionAnchor()})}}class Ym extends _.ks{constructor(){super({id:"editor.action.goToSelectionAnchor",label:(0,g.kg)("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:wr})}run(e,t){var i;return yr(this,void 0,void 0,function*(){(i=ii.get(t))===null||i===void 0||i.goToSelectionAnchor()})}}class Xm extends _.ks{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:(0,g.kg)("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:wr,kbOpts:{kbExpr:D.R.editorTextFocus,primary:(0,Ee.m5)(2089,2089),weight:100}})}run(e,t){var i;return yr(this,void 0,void 0,function*(){(i=ii.get(t))===null||i===void 0||i.selectFromAnchorToCursor()})}}class Jm extends _.ks{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:(0,g.kg)("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:wr,kbOpts:{kbExpr:D.R.editorTextFocus,primary:9,weight:100}})}run(e,t){var i;return yr(this,void 0,void 0,function*(){(i=ii.get(t))===null||i===void 0||i.cancelSelectionAnchor()})}}(0,_.HW)(ii.ID,ii),(0,_.Fl)(Zm),(0,_.Fl)(Ym),(0,_.Fl)(Xm),(0,_.Fl)(Jm);var V=f(65958),I=f(10998),ee=f(15365),L=f(50442),We=f(66055),ge=f(59922),Qi=f(48295),z=f(58067),C=f(4874),U=f(89044);const qm=(0,C.x1A)("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},g.kg("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class e_ extends _.ks{constructor(){super({id:"editor.action.jumpToBracket",label:g.kg("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:D.R.editorTextFocus,primary:3160,weight:100}})}run(e,t){var i;(i=Mt.get(t))===null||i===void 0||i.jumpToBracket()}}class t_ extends _.ks{constructor(){super({id:"editor.action.selectToBracket",label:g.kg("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,description:{description:"Select to Bracket",args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){var n;let o=!0;i&&i.selectBrackets===!1&&(o=!1),(n=Mt.get(t))===null||n===void 0||n.selectToBracket(o)}}class i_{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}class Mt extends I.jG{constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new V.uC(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(66),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(66)&&(this._matchBrackets=this._editor.getOption(66),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()}))}static get(e){return e.getContribution(Mt.ID)}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const n=i.getStartPosition(),o=e.bracketPairs.matchBracket(n);let s=null;if(o)o[0].containsPosition(n)&&!o[1].containsPosition(n)?s=o[1].getStartPosition():o[1].containsPosition(n)&&(s=o[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(n);if(a)s=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(n);l&&l.range&&(s=l.range.getStartPosition())}}return s?new q.L(s.lineNumber,s.column,s.lineNumber,s.column):new q.L(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 o=n.getStartPosition();let s=t.bracketPairs.matchBracket(o);if(!s&&(s=t.bracketPairs.findEnclosingBrackets(o),!s)){const c=t.bracketPairs.findNextBracket(o);c&&c.range&&(s=t.bracketPairs.matchBracket(c.range.getStartPosition()))}let a=null,l=null;if(s){s.sort(L.Q.compareRangesUsingStarts);const[c,d]=s;if(a=e?c.getStartPosition():c.getEndPosition(),l=e?d.getEndPosition():d.getStartPosition(),d.containsPosition(o)){const u=a;a=l,l=u}}a&&l&&i.push(new q.L(a.lineNumber,a.column,l.lineNumber,l.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}_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 o=[];let s=0;for(let u=0,h=e.length;u<h;u++){const p=e[u];p.isEmpty()&&(o[s++]=p.getStartPosition())}o.length>1&&o.sort(ee.y.compare);const a=[];let l=0,c=0;const d=n.length;for(let u=0,h=o.length;u<h;u++){const p=o[u];for(;c<d&&n[c].position.isBefore(p);)c++;if(c<d&&n[c].position.equals(p))a[l++]=n[c];else{let m=t.bracketPairs.matchBracket(p,20),v=Mt._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!m&&this._matchBrackets==="always"&&(m=t.bracketPairs.findEnclosingBrackets(p,20),v=Mt._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[l++]=new i_(p,m,v)}}this._lastBracketsData=a,this._lastVersionId=i}}Mt.ID="editor.contrib.bracketMatchingController",Mt._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=ge.kI.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:(0,U.Yf)(qm),position:We.A5.Center}}),Mt._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=ge.kI.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"}),(0,_.HW)(Mt.ID,Mt),(0,_.Fl)(t_),(0,_.Fl)(e_),(0,U.zy)((r,e)=>{const t=r.getColor(Qi.RU);t&&e.addRule(`.monaco-editor .bracket-match { background-color: ${t}; }`);const i=r.getColor(Qi.$u);i&&e.addRule(`.monaco-editor .bracket-match { border: 1px solid ${i}; }`)}),z.ZG.appendMenuItem(z.D8.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:g.kg({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class n_{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,n=this._selection.startColumn,o=this._selection.endColumn;if(!(this._isMovingLeft&&n===1)&&!(!this._isMovingLeft&&o===e.getLineMaxColumn(i)))if(this._isMovingLeft){const s=new L.Q(i,n-1,i,n),a=e.getValueInRange(s);t.addEditOperation(s,null),t.addEditOperation(new L.Q(i,o,i,o),a)}else{const s=new L.Q(i,o,i,o+1),a=e.getValueInRange(s);t.addEditOperation(s,null),t.addEditOperation(new L.Q(i,n,i,n),a)}}computeCursorState(e,t){return this._isMovingLeft?new q.L(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new q.L(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class Ju extends _.ks{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],n=t.getSelections();for(const o of n)i.push(new n_(o,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class o_ extends Ju{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:g.kg("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:D.R.writable})}}class s_ extends Ju{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:g.kg("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:D.R.writable})}}(0,_.Fl)(o_),(0,_.Fl)(s_);var yi=f(66316),Tl=f(50572);class r_ extends _.ks{constructor(){super({id:"editor.action.transposeLetters",label:g.kg("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:D.R.writable,kbOpts:{kbExpr:D.R.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],o=t.getSelections();for(const s of o){if(!s.isEmpty())continue;const a=s.startLineNumber,l=s.startColumn,c=i.getLineMaxColumn(a);if(a===1&&(l===1||l===2&&c===2))continue;const d=l===c?s.getPosition():Tl.I.rightPosition(i,s.getPosition().lineNumber,s.getPosition().column),u=Tl.I.leftPosition(i,d),h=Tl.I.leftPosition(i,u),p=i.getValueInRange(L.Q.fromPositions(h,u)),m=i.getValueInRange(L.Q.fromPositions(u,d)),v=L.Q.fromPositions(h,d);n.push(new yi.iu(v,m+p))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}(0,_.Fl)(r_);var Ol=f(55893),Se=f(63339),Fl=f(93344),Be=f(87301),Hn=f(3338),a_=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};const Zi="9_cutcopypaste",l_=Se.ib||document.queryCommandSupported("cut"),qu=Se.ib||document.queryCommandSupported("copy"),d_=typeof navigator.clipboard>"u"||Ol.isFirefox?document.queryCommandSupported("paste"):!0;function Pl(r){return r.register(),r}const c_=l_?Pl(new _.fE({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:Se.ib?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:z.D8.MenubarEditMenu,group:"2_ccp",title:g.kg({key:"miCut",comment:["&& denotes a mnemonic"]},"Cu&&t"),order:1},{menuId:z.D8.EditorContext,group:Zi,title:g.kg("actions.clipboard.cutLabel","Cut"),when:D.R.writable,order:1},{menuId:z.D8.CommandPalette,group:"",title:g.kg("actions.clipboard.cutLabel","Cut"),order:1},{menuId:z.D8.SimpleEditorContext,group:Zi,title:g.kg("actions.clipboard.cutLabel","Cut"),when:D.R.writable,order:1}]})):void 0,u_=qu?Pl(new _.fE({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:Se.ib?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:z.D8.MenubarEditMenu,group:"2_ccp",title:g.kg({key:"miCopy",comment:["&& denotes a mnemonic"]},"&&Copy"),order:2},{menuId:z.D8.EditorContext,group:Zi,title:g.kg("actions.clipboard.copyLabel","Copy"),order:2},{menuId:z.D8.CommandPalette,group:"",title:g.kg("actions.clipboard.copyLabel","Copy"),order:1},{menuId:z.D8.SimpleEditorContext,group:Zi,title:g.kg("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;z.ZG.appendMenuItem(z.D8.MenubarEditMenu,{submenu:z.D8.MenubarCopy,title:{value:g.kg("copy as","Copy As"),original:"Copy As"},group:"2_ccp",order:3}),z.ZG.appendMenuItem(z.D8.EditorContext,{submenu:z.D8.EditorContextCopy,title:{value:g.kg("copy as","Copy As"),original:"Copy As"},group:Zi,order:3}),z.ZG.appendMenuItem(z.D8.EditorContext,{submenu:z.D8.EditorContextShare,title:{value:g.kg("share","Share"),original:"Share"},group:"11_share",order:-1});const Wl=d_?Pl(new _.fE({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:Se.ib?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:z.D8.MenubarEditMenu,group:"2_ccp",title:g.kg({key:"miPaste",comment:["&& denotes a mnemonic"]},"&&Paste"),order:4},{menuId:z.D8.EditorContext,group:Zi,title:g.kg("actions.clipboard.pasteLabel","Paste"),when:D.R.writable,order:4},{menuId:z.D8.CommandPalette,group:"",title:g.kg("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:z.D8.SimpleEditorContext,group:Zi,title:g.kg("actions.clipboard.pasteLabel","Paste"),when:D.R.writable,order:4}]})):void 0;class h_ extends _.ks{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:g.kg("actions.clipboard.copyWithSyntaxHighlightingLabel","Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:D.R.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(33)&&t.getSelection().isEmpty()||(Fl.Eq.forceCopyWithSyntaxHighlighting=!0,t.focus(),document.execCommand("copy"),Fl.Eq.forceCopyWithSyntaxHighlighting=!1)}}function eh(r,e){r&&(r.addImplementation(1e4,"code-editor",(t,i)=>{const n=t.get(Be.T).getFocusedCodeEditor();if(n&&n.hasTextFocus()){const o=n.getOption(33),s=n.getSelection();return s&&s.isEmpty()&&!o||document.execCommand(e),!0}return!1}),r.addImplementation(0,"generic-dom",(t,i)=>(document.execCommand(e),!0)))}eh(c_,"cut"),eh(u_,"copy"),Wl&&(Wl.addImplementation(1e4,"code-editor",(r,e)=>{const t=r.get(Be.T),i=r.get(Hn.h),n=t.getFocusedCodeEditor();return n&&n.hasTextFocus()?!document.execCommand("paste")&&Se.HZ?a_(void 0,void 0,void 0,function*(){const s=yield i.readText();if(s!==""){const a=Fl.bs.INSTANCE.get(s);let l=!1,c=null,d=null;a&&(l=n.getOption(33)&&!!a.isFromEmptySelection,c=typeof a.multicursorText<"u"?a.multicursorText:null,d=a.mode),n.trigger("keyboard","paste",{text:s,pasteOnNewLine:l,multicursorText:c,mode:d})}}):!0:!1}),Wl.addImplementation(0,"generic-dom",(r,e)=>(document.execCommand("paste"),!0))),qu&&(0,_.Fl)(h_);var re=f(78903),Dr=f(63946),G=f(16844),wi=f(98769),te=f(52230),pe=f(13338),K=f(94327),me=f(37264),Di=f(62105),$t=f(64830),fe=f(59715),Dt=f(44023);class ae{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+ae.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new ae(this.value+ae.sep+e)}}ae.sep=".",ae.None=new ae("@@none@@"),ae.Empty=new ae(""),ae.QuickFix=new ae("quickfix"),ae.Refactor=new ae("refactor"),ae.Source=new ae("source"),ae.SourceOrganizeImports=ae.Source.append("organizeImports"),ae.SourceFixAll=ae.Source.append("fixAll");var Ze;(function(r){r.Refactor="refactor",r.RefactorPreview="refactor preview",r.Lightbulb="lightbulb",r.Default="other (default)",r.SourceAction="source action",r.QuickFix="quick fix action",r.FixAll="fix all",r.OrganizeImports="organize imports",r.AutoFix="auto fix",r.QuickFixHover="quick fix hover window",r.OnSave="save participants",r.ProblemsView="problems view"})(Ze||(Ze={}));function g_(r,e){return!(r.include&&!r.include.intersects(e)||r.excludes&&r.excludes.some(t=>th(e,t,r.include))||!r.includeSourceActions&&ae.Source.contains(e))}function f_(r,e){const t=e.kind?new ae(e.kind):void 0;return!(r.include&&(!t||!r.include.contains(t))||r.excludes&&t&&r.excludes.some(i=>th(t,i,r.include))||!r.includeSourceActions&&t&&ae.Source.contains(t)||r.onlyIncludePreferredActions&&!e.isPreferred)}function th(r,e,t){return!(!e.contains(r)||t&&e.contains(t))}class jt{constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}static fromUser(e,t){return!e||typeof e!="object"?new jt(t.kind,t.apply,!1):new jt(jt.getKindFromUser(e,t.kind),jt.getApplyFromUser(e,t.apply),jt.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 ae(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}}var Bl=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};const ih="editor.action.codeAction",nh="editor.action.refactor",p_="editor.action.refactor.preview",oh="editor.action.sourceAction",Hl="editor.action.organizeImports",Vl="editor.action.fixAll";class sh{constructor(e,t){this.action=e,this.provider=t}resolve(e){var t;return Bl(this,void 0,void 0,function*(){if(!((t=this.provider)===null||t===void 0)&&t.resolveCodeAction&&!this.action.edit){let i;try{i=yield this.provider.resolveCodeAction(this.action,e)}catch(n){(0,K.M_)(n)}i&&(this.action.edit=i.edit)}return this})}}class Ul extends I.jG{constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(Ul.codeActionsComparator),this.validActions=this.allActions.filter(({action:n})=>!n.disabled)}static codeActionsComparator({action:e},{action:t}){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:(0,pe.EI)(e.diagnostics)?(0,pe.EI)(t.diagnostics)?e.diagnostics[0].message.localeCompare(t.diagnostics[0].message):-1:(0,pe.EI)(t.diagnostics)?1:0}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&ae.QuickFix.contains(new ae(e.kind))&&!!e.isPreferred)}}const rh={actions:[],documentation:void 0};function zl(r,e,t,i,n,o){var s;const a=i.filter||{},l={only:(s=a.include)===null||s===void 0?void 0:s.value,trigger:i.type},c=new Di.ER(e,o),d=m_(r,e,a),u=new I.Cm,h=d.map(m=>Bl(this,void 0,void 0,function*(){try{n.report(m);const v=yield m.provideCodeActions(e,t,l,c.token);if(v&&u.add(v),c.token.isCancellationRequested)return rh;const w=(v?.actions||[]).filter(T=>T&&f_(a,T)),R=__(m,w,a.include);return{actions:w.map(T=>new sh(T,m)),documentation:R}}catch(v){if((0,K.MB)(v))throw v;return(0,K.M_)(v),rh}})),p=r.onDidChange(()=>{const m=r.all(e);(0,pe.aI)(m,d)||c.cancel()});return Promise.all(h).then(m=>{const v=m.map(R=>R.actions).flat(),w=(0,pe.Yc)(m.map(R=>R.documentation));return new Ul(v,w,u)}).finally(()=>{p.dispose(),c.dispose()})}function m_(r,e,t){return r.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(n=>g_(t,new ae(n))):!0)}function __(r,e,t){if(!r.documentation)return;const i=r.documentation.map(n=>({kind:new ae(n.kind),command:n.command}));if(t){let n;for(const o of i)o.kind.contains(t)&&(n?n.kind.contains(o.kind)&&(n=o):n=o);if(n)return n?.command}for(const n of e)if(n.kind){for(const o of i)if(o.kind.contains(new ae(n.kind)))return o.command}}fe.wb.registerCommand("_executeCodeActionProvider",function(r,e,t,i,n){return Bl(this,void 0,void 0,function*(){if(!(e instanceof me.r))throw(0,K.Qg)();const{codeActionProvider:o}=r.get(te.u),s=r.get($t.S).getModel(e);if(!s)throw(0,K.Qg)();const a=q.L.isISelection(t)?q.L.liftSelection(t):L.Q.isIRange(t)?s.validateRange(t):void 0;if(!a)throw(0,K.Qg)();const l=typeof i=="string"?new ae(i):void 0,c=yield zl(o,s,a,{type:1,triggerAction:Ze.Default,filter:{includeSourceActions:!0,include:l}},Dt.ke.None,re.X.None),d=[],u=Math.min(c.validActions.length,typeof n=="number"?n:0);for(let h=0;h<u;h++)d.push(c.validActions[h].resolve(re.X.None));try{return yield Promise.all(d),c.validActions.map(h=>h.action)}finally{setTimeout(()=>c.dispose(),100)}})});var v_=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},C_=function(r,e){return function(t,i){e(t,i,r)}};let lt=class Nu{constructor(e,t){this._messageWidget=new I.HE,this._messageListeners=new I.Cm,this._editor=e,this._visible=Nu.MESSAGE_VISIBLE.bindTo(t)}static get(e){return e.getContribution(Nu.ID)}dispose(){this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){(0,ft.xE)(e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._messageWidget.value=new ah(this._editor,t,e),this._messageListeners.add(this._editor.onDidBlurEditorText(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(new V.pc(()=>this.closeMessage(),3e3));let i;this._messageListeners.add(this._editor.onMouseMove(n=>{n.target.position&&(i?i.containsPosition(n.target.position)||this.closeMessage():i=new L.Q(t.lineNumber-3,1,n.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(ah.fadeOut(this._messageWidget.value))}};lt.ID="editor.contrib.messageController",lt.MESSAGE_VISIBLE=new A.N1("messageVisible",!1,g.kg("messageVisible","Whether the editor is currently showing an inline message")),lt=v_([C_(1,A.fN)],lt);const b_=_.DX.bindToContribution(lt.get);(0,_.E_)(new b_({id:"leaveEditorMessage",precondition:lt.MESSAGE_VISIBLE,handler:r=>r.closeMessage(),kbOpts:{weight:130,primary:9}}));class ah{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 o=document.createElement("div");o.classList.add("anchor","top"),this._domNode.appendChild(o);const s=document.createElement("div");s.classList.add("message"),s.textContent=n,this._domNode.appendChild(s);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}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}}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)}}(0,_.HW)(lt.ID,lt);var he=f(82399),S=f(14333),lh=f(67954),He=f(27969),Fe=f(85753),ni=f(52348),tt=f(56071),Vn=f(76243),dh=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},oi=function(r,e){return function(t,i){e(t,i,r)}},S_=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};const Un={Visible:new A.N1("CodeActionMenuVisible",!1,(0,g.kg)("CodeActionMenuVisible","Whether the code action list widget is visible"))};class $l extends He.rc{constructor(e,t){super(e.command?e.command.id:e.title,y_(e.title),void 0,!e.disabled,t),this.action=e}}function y_(r){return r.replace(/\r\n|\r|\n/g," ")}const w_="codeActionWidget",jl=26;let Gl=class{constructor(e,t){this.acceptKeybindings=e,this.keybindingService=t}get templateId(){return w_}renderTemplate(e){const t=Object.create(null);return t.disposables=[],t.root=e,t.text=document.createElement("span"),e.append(t.text),t}renderElement(e,t,i){const n=i,o=e.title,s=e.isEnabled,a=e.isSeparator,l=e.isDocumentation;n.text.textContent=o,s?n.root.classList.remove("option-disabled"):(n.root.classList.add("option-disabled"),n.root.style.backgroundColor="transparent !important"),a&&(n.root.classList.add("separator"),n.root.style.height="10px"),l||(()=>{var d,u;const[h,p]=this.acceptKeybindings;n.root.title=(0,g.kg)({key:"label",comment:['placeholders are keybindings, e.g "F2 to Refactor, Shift+F2 to Preview"']},"{0} to Refactor, {1} to Preview",(d=this.keybindingService.lookupKeybinding(h))===null||d===void 0?void 0:d.getLabel(),(u=this.keybindingService.lookupKeybinding(p))===null||u===void 0?void 0:u.getLabel())})()}disposeTemplate(e){e.disposables=(0,I.AS)(e.disposables)}};Gl=dh([oi(1,tt.b)],Gl);let xr=class Mu extends I.jG{constructor(e,t,i,n,o,s,a,l,c,d){super(),this._editor=e,this._delegate=t,this._contextMenuService=i,this._languageFeaturesService=o,this._telemetryService=s,this._configurationService=l,this._contextViewService=c,this._contextKeyService=d,this._showingActions=this._register(new I.HE),this.codeActionList=this._register(new I.HE),this.options=[],this._visible=!1,this.viewItems=[],this.hasSeperator=!1,this._keybindingResolver=new Lr({getKeybindings:()=>n.getKeybindings()}),this._ctxMenuWidgetVisible=Un.Visible.bindTo(this._contextKeyService),this.listRenderer=new Gl(["onEnterSelectCodeAction","onEnterSelectCodeActionWithPreview"],n)}get isVisible(){return this._visible}isCodeActionWidgetEnabled(e){return this._configurationService.getValue("editor.experimental.useCustomCodeActionMenu",{resource:e.uri})}_onListSelection(e){e.elements.length&&e.elements.forEach(t=>{t.isEnabled&&(t.action.run(),this.hideCodeActionWidget())})}_onListHover(e){var t,i,n,o;e.element?!((i=e.element)===null||i===void 0)&&i.isEnabled?((n=this.codeActionList.value)===null||n===void 0||n.setFocus([e.element.index]),this.focusedEnabledItem=this.viewItems.indexOf(e.element),this.currSelectedItem=e.element.index):(this.currSelectedItem=void 0,(o=this.codeActionList.value)===null||o===void 0||o.setFocus([e.element.index])):(this.currSelectedItem=void 0,(t=this.codeActionList.value)===null||t===void 0||t.setFocus([]))}renderCodeActionMenuList(e,t){var i;const n=new I.Cm,o=document.createElement("div"),s=document.createElement("div");this.block=e.appendChild(s),this.block.classList.add("context-view-block"),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0",this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",n.add(S.ko(this.block,S.Bx.MOUSE_DOWN,h=>h.stopPropagation())),o.id="codeActionMenuWidget",o.classList.add("codeActionMenuWidget"),e.appendChild(o),this.codeActionList.value=new lh.B8("codeActionWidget",o,{getHeight(h){return h.isSeparator?10:jl},getTemplateId(h){return"codeActionWidget"}},[this.listRenderer],{keyboardSupport:!1}),n.add(this.codeActionList.value.onMouseOver(h=>this._onListHover(h))),n.add(this.codeActionList.value.onDidChangeFocus(h=>{var p;return(p=this.codeActionList.value)===null||p===void 0?void 0:p.domFocus()})),n.add(this.codeActionList.value.onDidChangeSelection(h=>this._onListSelection(h))),n.add(this._editor.onDidLayoutChange(h=>this.hideCodeActionWidget())),t.forEach((h,p)=>{const m=h.class==="separator";let v=!1;h instanceof $l&&(v=h.action.kind===Mu.documentationID),m&&(this.hasSeperator=!0);const w={title:h.label,detail:h.tooltip,action:t[p],isEnabled:h.enabled,isSeparator:m,index:p,isDocumentation:v};h.enabled&&this.viewItems.push(w),this.options.push(w)}),this.codeActionList.value.splice(0,this.codeActionList.value.length,this.options);const a=this.hasSeperator?(t.length-1)*jl+10:t.length*jl;o.style.height=String(a)+"px",this.codeActionList.value.layout(a);const l=[];this.options.forEach((h,p)=>{var m,v;if(!this.codeActionList.value)return;const w=(v=document.getElementById((m=this.codeActionList.value)===null||m===void 0?void 0:m.getElementID(p)))===null||v===void 0?void 0:v.getElementsByTagName("span")[0].offsetWidth;l.push(Number(w))});const c=Math.max(...l);o.style.width=c+52+"px",(i=this.codeActionList.value)===null||i===void 0||i.layout(a,c),this.viewItems.length<1||this.viewItems.every(h=>h.isDocumentation)?this.currSelectedItem=void 0:(this.focusedEnabledItem=0,this.currSelectedItem=this.viewItems[0].index,this.codeActionList.value.setFocus([this.currSelectedItem])),this.codeActionList.value.domFocus();const d=S.w5(e),u=d.onDidBlur(()=>{this.hideCodeActionWidget()});return n.add(u),n.add(d),this._ctxMenuWidgetVisible.set(!0),n}focusPrevious(){var e;if(typeof this.focusedEnabledItem>"u")this.focusedEnabledItem=this.viewItems[0].index;else if(this.viewItems.length<1)return!1;const t=this.focusedEnabledItem;let i;do this.focusedEnabledItem=this.focusedEnabledItem-1,this.focusedEnabledItem<0&&(this.focusedEnabledItem=this.viewItems.length-1),i=this.viewItems[this.focusedEnabledItem],(e=this.codeActionList.value)===null||e===void 0||e.setFocus([i.index]),this.currSelectedItem=i.index;while(this.focusedEnabledItem!==t&&(!i.isEnabled||i.action.id===He.wv.ID));return!0}focusNext(){var e;if(typeof this.focusedEnabledItem>"u")this.focusedEnabledItem=this.viewItems.length-1;else if(this.viewItems.length<1)return!1;const t=this.focusedEnabledItem;let i;do this.focusedEnabledItem=(this.focusedEnabledItem+1)%this.viewItems.length,i=this.viewItems[this.focusedEnabledItem],(e=this.codeActionList.value)===null||e===void 0||e.setFocus([i.index]),this.currSelectedItem=i.index;while(this.focusedEnabledItem!==t&&(!i.isEnabled||i.action.id===He.wv.ID));return!0}navigateListWithKeysUp(){this.focusPrevious()}navigateListWithKeysDown(){this.focusNext()}onEnterSet(){var e;typeof this.currSelectedItem=="number"&&((e=this.codeActionList.value)===null||e===void 0||e.setSelection([this.currSelectedItem]))}dispose(){super.dispose()}hideCodeActionWidget(){this._ctxMenuWidgetVisible.reset(),this.options=[],this.viewItems=[],this.focusedEnabledItem=0,this.currSelectedItem=void 0,this.hasSeperator=!1,this._contextViewService.hideContextView({source:this})}codeActionTelemetry(e,t,i){this._telemetryService.publicLog2("codeAction.applyCodeAction",{codeActionFrom:e,validCodeActions:i.validActions.length,cancelled:t})}show(e,t,i,n){return S_(this,void 0,void 0,function*(){const o=this._editor.getModel();if(!o)return;const s=n.includeDisabledActions?t.allActions:t.validActions;if(!s.length){this._visible=!1;return}if(!this._editor.getDomNode())throw this._visible=!1,(0,K.aD)();this._visible=!0,this._showingActions.value=t;const a=this.getMenuActions(e,s,t.documentation),l=ee.y.isIPosition(i)?this._toCoords(i):i||{x:0,y:0},c=this._keybindingResolver.getResolver(),d=this._editor.getOption(117);this.isCodeActionWidgetEnabled(o)?this._contextViewService.showContextView({getAnchor:()=>l,render:u=>this.renderCodeActionMenuList(u,a),onHide:u=>{const h=n.fromLightbulb?Ze.Lightbulb:e.triggerAction;this.codeActionTelemetry(h,u,t),this._visible=!1,this._editor.focus()}},this._editor.getDomNode(),!1):this._contextMenuService.showContextMenu({domForShadowRoot:d?this._editor.getDomNode():void 0,getAnchor:()=>l,getActions:()=>a,onHide:u=>{const h=n.fromLightbulb?Ze.Lightbulb:e.triggerAction;this.codeActionTelemetry(h,u,t),this._visible=!1,this._editor.focus()},autoSelectFirstItem:!0,getKeyBinding:u=>u instanceof $l?c(u.action):void 0})})}getMenuActions(e,t,i){var n,o;const s=d=>new $l(d.action,()=>this._delegate.onSelectCodeAction(d,e)),a=t.map(s),l=[...i],c=this._editor.getModel();if(c&&a.length)for(const d of this._languageFeaturesService.codeActionProvider.all(c))d._getAdditionalMenuItems&&l.push(...d._getAdditionalMenuItems({trigger:e.type,only:(o=(n=e.filter)===null||n===void 0?void 0:n.include)===null||o===void 0?void 0:o.value},t.map(u=>u.action)));return l.length&&a.push(new He.wv,...l.map(d=>s(new sh({title:d.title,command:d,kind:Mu.documentationID},void 0)))),a}_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=S.BK(this._editor.getDomNode()),n=i.left+t.left,o=i.top+t.top+t.height;return{x:n,y:o}}};xr.documentationID="_documentation",xr=dh([oi(2,ni.Z),oi(3,tt.b),oi(4,te.u),oi(5,Vn.k),oi(6,U.Gy),oi(7,Fe.pG),oi(8,ni.l),oi(9,A.fN)],xr);class Lr{constructor(e){this._keybindingProvider=e}getResolver(){const e=new Dr.d(()=>this._keybindingProvider.getKeybindings().filter(t=>Lr.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===Hl?i={kind:ae.SourceOrganizeImports.value}:t.command===Vl&&(i={kind:ae.SourceFixAll.value}),Object.assign({resolvedKeybinding:t.resolvedKeybinding},jt.fromUser(i,{kind:ae.None,apply:"never"}))}));return t=>{if(t.kind){const i=this.bestKeybindingForCodeAction(t,e.getValue());return i?.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new ae(e.kind);return t.filter(n=>n.kind.contains(i)).filter(n=>n.preferred?e.isPreferred:!0).reduceRight((n,o)=>n?n.kind.contains(o.kind)?o:n:o,void 0)}}Lr.codeActionCommands=[nh,ih,oh,Hl,Vl];var zn=f(30474),Q=f(26048),Z=f(2106),Kl=f(50969),D_=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},x_=function(r,e){return function(t,i){e(t,i,r)}},Ko;(function(r){r.Hidden={type:0};class e{constructor(i,n,o,s){this.actions=i,this.trigger=n,this.editorPosition=o,this.widgetPosition=s,this.type=1}}r.Showing=e})(Ko||(Ko={}));let kr=class Xp extends I.jG{constructor(e,t,i,n){super(),this._editor=e,this._quickFixActionId=t,this._preferredFixActionId=i,this._keybindingService=n,this._onClick=this._register(new Z.vl),this.onClick=this._onClick.event,this._state=Ko.Hidden,this._domNode=document.createElement("div"),this._domNode.className=Q.W6.lightBulb.classNames,this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(o=>{const s=this._editor.getModel();(this.state.type!==1||!s||this.state.editorPosition.lineNumber>=s.getLineCount())&&this.hide()})),zn.q.ignoreTarget(this._domNode),this._register(S.Xc(this._domNode,o=>{if(this.state.type!==1)return;this._editor.focus(),o.preventDefault();const{top:s,height:a}=S.BK(this._domNode),l=this._editor.getOption(61);let c=Math.floor(l/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber<this.state.editorPosition.lineNumber&&(c+=l),this._onClick.fire({x:o.posx,y:s+a+c,actions:this.state.actions,trigger:this.state.trigger})})),this._register(S.ko(this._domNode,"mouseenter",o=>{(o.buttons&1)===1&&this.hide()})),this._register(this._editor.onDidChangeConfiguration(o=>{o.hasChanged(59)&&!this._editor.getOption(59).enabled&&this.hide()})),this._updateLightBulbTitleAndIcon(),this._register(this._keybindingService.onDidUpdateKeybindings(this._updateLightBulbTitleAndIcon,this))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return 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(59).enabled)return this.hide();const o=this._editor.getModel();if(!o)return this.hide();const{lineNumber:s,column:a}=o.validatePosition(i),l=o.getOptions().tabSize,c=n.get(46),d=o.getLineContent(s),u=(0,Kl.G)(d,l),h=c.spaceWidth*u>22,p=v=>v>2&&this._editor.getTopForLineNumber(v)===this._editor.getTopForLineNumber(v-1);let m=s;if(!h){if(s>1&&!p(s-1))m-=1;else if(!p(s+1))m+=1;else if(a*c.spaceWidth<22)return this.hide()}this.state=new Ko.Showing(e,t,i,{position:{lineNumber:m,column:1},preference:Xp._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state=Ko.Hidden,this._editor.layoutContentWidget(this)}get state(){return this._state}set state(e){this._state=e,this._updateLightBulbTitleAndIcon()}_updateLightBulbTitleAndIcon(){if(this.state.type===1&&this.state.actions.hasAutoFix){this._domNode.classList.remove(...Q.W6.lightBulb.classNamesArray),this._domNode.classList.add(...Q.W6.lightbulbAutofix.classNamesArray);const t=this._keybindingService.lookupKeybinding(this._preferredFixActionId);if(t){this.title=g.kg("preferredcodeActionWithKb","Show Code Actions. Preferred Quick Fix Available ({0})",t.getLabel());return}}this._domNode.classList.remove(...Q.W6.lightbulbAutofix.classNamesArray),this._domNode.classList.add(...Q.W6.lightBulb.classNamesArray);const e=this._keybindingService.lookupKeybinding(this._quickFixActionId);e?this.title=g.kg("codeActionWithKb","Show Code Actions ({0})",e.getLabel()):this.title=g.kg("codeAction","Show Code Actions")}set title(e){this._domNode.title=e}};kr._posPref=[0],kr=D_([x_(3,tt.b)],kr),(0,U.zy)((r,e)=>{var t;const i=(t=r.getColor(C.YtV))===null||t===void 0?void 0:t.transparent(.7),n=r.getColor(C.yHf);n&&e.addRule(`
		.monaco-editor .contentWidgets ${Q.W6.lightBulb.cssSelector} {
			color: ${n};
			background-color: ${i};
		}`);const o=r.getColor(C.qTN);o&&e.addRule(`
		.monaco-editor .contentWidgets ${Q.W6.lightbulbAutofix.cssSelector} {
			color: ${o};
			background-color: ${i};
		}`)});var L_=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},k_=function(r,e){return function(t,i){e(t,i,r)}},Ql=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})},I_=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},R_=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Ir;let Zl=class extends I.jG{constructor(e,t,i,n,o){super(),this._editor=e,this.delegate=n,this._activeCodeActions=this._register(new I.HE),this.previewOn=!1,Ir.set(this,!1),this._codeActionWidget=new Dr.d(()=>this._register(o.createInstance(xr,this._editor,{onSelectCodeAction:(s,a)=>Ql(this,void 0,void 0,function*(){this.previewOn?this.delegate.applyCodeAction(s,!0,!!this.previewOn):this.delegate.applyCodeAction(s,!0,!!a.preview),this.previewOn=!1})}))),this._lightBulbWidget=new Dr.d(()=>{const s=this._register(o.createInstance(kr,this._editor,t,i));return this._register(s.onClick(a=>this.showCodeActionList(a.trigger,a.actions,a,{includeDisabledActions:!1,fromLightbulb:!0}))),s})}dispose(){I_(this,Ir,!0,"f"),super.dispose()}hideCodeActionWidget(){this._codeActionWidget.hasValue()&&this._codeActionWidget.getValue().hideCodeActionWidget()}onEnter(){this._codeActionWidget.hasValue()&&this._codeActionWidget.getValue().onEnterSet()}onPreviewEnter(){this.previewOn=!0,this.onEnter()}navigateList(e){this._codeActionWidget.hasValue()&&(e?this._codeActionWidget.getValue().navigateListWithKeysUp():this._codeActionWidget.getValue().navigateListWithKeysDown())}update(e){var t,i,n,o,s;return Ql(this,void 0,void 0,function*(){if(e.type!==1){(t=this._lightBulbWidget.rawValue)===null||t===void 0||t.hide();return}let a;try{a=yield e.actions}catch(l){(0,K.dz)(l);return}if(!R_(this,Ir,"f"))if(this._lightBulbWidget.getValue().update(a,e.trigger,e.position),e.trigger.type===1){if(!((i=e.trigger.filter)===null||i===void 0)&&i.include){const c=this.tryGetValidActionToApply(e.trigger,a);if(c){try{this._lightBulbWidget.getValue().hide(),yield this.delegate.applyCodeAction(c,!1,!1)}finally{a.dispose()}return}if(e.trigger.context){const d=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,a);if(d&&d.action.disabled){(n=lt.get(this._editor))===null||n===void 0||n.showMessage(d.action.disabled,e.trigger.context.position),a.dispose();return}}}const l=!!(!((o=e.trigger.filter)===null||o===void 0)&&o.include);if(e.trigger.context&&(!a.allActions.length||!l&&!a.validActions.length)){(s=lt.get(this._editor))===null||s===void 0||s.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=a,a.dispose();return}this._activeCodeActions.value=a,this._codeActionWidget.getValue().show(e.trigger,a,e.position,{includeDisabledActions:l,fromLightbulb:!1})}else this._codeActionWidget.getValue().isVisible?a.dispose():this._activeCodeActions.value=a})}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]}showCodeActionList(e,t,i,n){return Ql(this,void 0,void 0,function*(){this._codeActionWidget.getValue().show(e,t,i,n)})}};Ir=new WeakMap,Zl=L_([k_(4,he._Y)],Zl);var Ne=f(27619),Ye=f(29879),De=f(22467),Yl=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},E_=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},$n;const ch=new A.N1("supportedCodeAction","");class A_ extends I.jG{constructor(e,t,i,n=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=n,this._autoTriggerTimer=this._register(new V.pc),this._register(this._markerService.onMarkerChanged(o=>this._onMarkerChanges(o))),this._register(this._editor.onDidChangeCursorPosition(()=>this._onCursorChange()))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);return this._createEventAndSignalChange(e,t)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some(i=>(0,De.n4)(i,t.uri))&&this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:Ze.Default})},this._delay)}_onCursorChange(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:Ze.Default})},this._delay)}_getRangeOfMarker(e){const t=this._editor.getModel();if(t)for(const i of this._markerService.read({resource:t.uri})){const n=t.validateRange(i);if(L.Q.intersectRanges(n,e))return L.Q.lift(n)}}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=this._editor.getSelection();if(i.isEmpty()&&e.type===2){const{lineNumber:n,column:o}=i.getPosition(),s=t.getLineContent(n);if(s.length===0)return;if(o===1){if(/\s/.test(s[0]))return}else if(o===t.getLineMaxColumn(n)){if(/\s/.test(s[s.length-1]))return}else if(/\s/.test(s[o-2])&&/\s/.test(s[o-1]))return}return i}_createEventAndSignalChange(e,t){const i=this._editor.getModel();if(!t||!i){this._signalChange(void 0);return}const n=this._getRangeOfMarker(t),o=n?n.getStartPosition():t.getStartPosition(),s={trigger:e,selection:t,position:o};return this._signalChange(s),s}}var Yi;(function(r){r.Empty={type:0};class e{constructor(i,n,o,s){this.trigger=i,this.rangeOrSelection=n,this.position=o,this._cancellablePromise=s,this.type=1,this.actions=s.catch(a=>{if((0,K.MB)(a))return N_;throw a})}cancel(){this._cancellablePromise.cancel()}}r.Triggered=e})(Yi||(Yi={}));const N_={allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1};class M_ extends I.jG{constructor(e,t,i,n,o){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=o,this._codeActionOracle=this._register(new I.HE),this._state=Yi.Empty,this._onDidChangeState=this._register(new Z.vl),this.onDidChangeState=this._onDidChangeState.event,$n.set(this,!1),this._supportedCodeActions=ch.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(){Yl(this,$n,"f")||(E_(this,$n,!0,"f"),super.dispose(),this.setState(Yi.Empty,!0))}_update(){if(Yl(this,$n,"f"))return;this._codeActionOracle.value=void 0,this.setState(Yi.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(83)){const t=[];for(const i of this._registry.all(e))Array.isArray(i.providedCodeActionKinds)&&t.push(...i.providedCodeActionKinds);this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new A_(this._editor,this._markerService,i=>{var n;if(!i){this.setState(Yi.Empty);return}const o=(0,V.SS)(s=>zl(this._registry,e,i.selection,i.trigger,Dt.ke.None,s));i.trigger.type===1&&((n=this._progressService)===null||n===void 0||n.showWhile(o,250)),this.setState(new Yi.Triggered(i.trigger,i.selection,i.position,o))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:Ze.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&&!Yl(this,$n,"f")&&this._onDidChangeState.fire(e))}}$n=new WeakMap;var T_=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Qo=function(r,e){return function(t,i){e(t,i,r)}},uh=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};function Zo(r){return A.M$.regex(ch.keys()[0],new RegExp("(\\s|^)"+(0,G.bm)(r.value)+"\\b"))}function hh(r,e,t,i){const n=jt.fromUser(e,{kind:ae.Refactor,apply:"never"});return Xi(r,typeof e?.kind=="string"?n.preferred?g.kg("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",e.kind):g.kg("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",e.kind):n.preferred?g.kg("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):g.kg("editor.action.refactor.noneMessage","No refactorings available"),{include:ae.Refactor.contains(n.kind)?n.kind:ae.None,onlyIncludePreferredActions:n.preferred},n.apply,t,i)}const Rr={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:g.kg("args.schema.kind","Kind of the code action to run.")},apply:{type:"string",description:g.kg("args.schema.apply","Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[g.kg("args.schema.apply.first","Always apply the first returned code action."),g.kg("args.schema.apply.ifSingle","Apply the first returned code action if it is the only one."),g.kg("args.schema.apply.never","Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:g.kg("args.schema.preferred","Controls if only preferred code actions should be returned.")}}};let xi=class Jp extends I.jG{constructor(e,t,i,n,o,s){super(),this._instantiationService=o,this._editor=e,this._model=this._register(new M_(this._editor,s.codeActionProvider,t,i,n)),this._register(this._model.onDidChangeState(a=>this.update(a))),this._ui=new Dr.d(()=>this._register(new Zl(e,jn.Id,Yo.Id,{applyCodeAction:(a,l,c)=>uh(this,void 0,void 0,function*(){try{yield this._applyCodeAction(a,c)}finally{l&&this._trigger({type:2,triggerAction:Ze.QuickFix,filter:{}})}})},this._instantiationService)))}static get(e){return e.getContribution(Jp.ID)}update(e){this._ui.getValue().update(e)}hideCodeActionMenu(){this._ui.hasValue()&&this._ui.getValue().hideCodeActionWidget()}navigateCodeActionList(e){this._ui.hasValue()&&this._ui.getValue().navigateList(e)}selectedOption(){this._ui.hasValue()&&this._ui.getValue().onEnter()}selectedOptionWithPreview(){this._ui.hasValue()&&this._ui.getValue().onPreviewEnter()}showCodeActions(e,t,i){return this._ui.getValue().showCodeActionList(e,t,i,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,i,n,o){var s;if(!this._editor.hasModel())return;(s=lt.get(this._editor))===null||s===void 0||s.closeMessage();const a=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:i,autoApply:n,context:{notAvailableMessage:e,position:a},preview:o})}_trigger(e){return this._model.trigger(e)}_applyCodeAction(e,t){return this._instantiationService.invokeFunction(O_,e,Xl.FromCodeActions,{preview:t,editor:this._editor})}};xi.ID="editor.contrib.quickFixController",xi=T_([Qo(1,Ne.DR),Qo(2,A.fN),Qo(3,Dt.N8),Qo(4,he._Y),Qo(5,te.u)],xi);var Xl;(function(r){r.OnSave="onSave",r.FromProblemsView="fromProblemsView",r.FromCodeActions="fromCodeActions"})(Xl||(Xl={}));function O_(r,e,t,i){return uh(this,void 0,void 0,function*(){const n=r.get(wi.nu),o=r.get(fe.wT),s=r.get(Vn.k),a=r.get(Ye.Ot);if(s.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),yield e.resolve(re.X.None),e.action.edit&&(yield n.apply(wi.jN.convert(e.action.edit),{editor:i?.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:!0,showPreview:i?.preview})),e.action.command)try{yield o.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(l){const c=F_(l);a.error(typeof c=="string"?c:g.kg("applyCodeActionFailed","An unknown error occurred while applying the code action"))}})}function F_(r){return typeof r=="string"?r:r instanceof Error&&typeof r.message=="string"?r.message:void 0}function Xi(r,e,t,i,n=!1,o=Ze.Default){if(r.hasModel()){const s=xi.get(r);s?.manualTriggerAtCurrentPosition(e,o,t,i,n)}}class jn extends _.ks{constructor(){super({id:jn.Id,label:g.kg("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:A.M$.and(D.R.writable,D.R.hasCodeActionsProvider),kbOpts:{kbExpr:D.R.editorTextFocus,primary:2132,weight:100}})}run(e,t){return Xi(t,g.kg("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0,!1,Ze.QuickFix)}}jn.Id="editor.action.quickFix";class P_ extends _.DX{constructor(){super({id:ih,precondition:A.M$.and(D.R.writable,D.R.hasCodeActionsProvider),description:{description:"Trigger a code action",args:[{name:"args",schema:Rr}]}})}runEditorCommand(e,t,i){const n=jt.fromUser(i,{kind:ae.Empty,apply:"ifSingle"});return Xi(t,typeof i?.kind=="string"?n.preferred?g.kg("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",i.kind):g.kg("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",i.kind):n.preferred?g.kg("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):g.kg("editor.action.codeAction.noneMessage","No code actions available"),{include:n.kind,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply)}}class W_ extends _.ks{constructor(){super({id:nh,label:g.kg("refactor.label","Refactor..."),alias:"Refactor...",precondition:A.M$.and(D.R.writable,D.R.hasCodeActionsProvider),kbOpts:{kbExpr:D.R.editorTextFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:A.M$.and(D.R.writable,Zo(ae.Refactor))},description:{description:"Refactor...",args:[{name:"args",schema:Rr}]}})}run(e,t,i){return hh(t,i,!1,Ze.Refactor)}}class B_ extends _.ks{constructor(){super({id:p_,label:g.kg("refactor.preview.label","Refactor with Preview..."),alias:"Refactor Preview...",precondition:A.M$.and(D.R.writable,D.R.hasCodeActionsProvider),description:{description:"Refactor Preview...",args:[{name:"args",schema:Rr}]}})}run(e,t,i){return hh(t,i,!0,Ze.RefactorPreview)}}class H_ extends _.ks{constructor(){super({id:oh,label:g.kg("source.label","Source Action..."),alias:"Source Action...",precondition:A.M$.and(D.R.writable,D.R.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:A.M$.and(D.R.writable,Zo(ae.Source))},description:{description:"Source Action...",args:[{name:"args",schema:Rr}]}})}run(e,t,i){const n=jt.fromUser(i,{kind:ae.Source,apply:"never"});return Xi(t,typeof i?.kind=="string"?n.preferred?g.kg("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",i.kind):g.kg("editor.action.source.noneMessage.kind","No source actions for '{0}' available",i.kind):n.preferred?g.kg("editor.action.source.noneMessage.preferred","No preferred source actions available"):g.kg("editor.action.source.noneMessage","No source actions available"),{include:ae.Source.contains(n.kind)?n.kind:ae.None,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply,void 0,Ze.SourceAction)}}class V_ extends _.ks{constructor(){super({id:Hl,label:g.kg("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:A.M$.and(D.R.writable,Zo(ae.SourceOrganizeImports)),kbOpts:{kbExpr:D.R.editorTextFocus,primary:1581,weight:100}})}run(e,t){return Xi(t,g.kg("editor.action.organize.noneMessage","No organize imports action available"),{include:ae.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",void 0,Ze.OrganizeImports)}}class U_ extends _.ks{constructor(){super({id:Vl,label:g.kg("fixAll.label","Fix All"),alias:"Fix All",precondition:A.M$.and(D.R.writable,Zo(ae.SourceFixAll))})}run(e,t){return Xi(t,g.kg("fixAll.noneMessage","No fix all action available"),{include:ae.SourceFixAll,includeSourceActions:!0},"ifSingle",void 0,Ze.FixAll)}}class Yo extends _.ks{constructor(){super({id:Yo.Id,label:g.kg("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:A.M$.and(D.R.writable,Zo(ae.QuickFix)),kbOpts:{kbExpr:D.R.editorTextFocus,primary:1620,mac:{primary:2644},weight:100}})}run(e,t){return Xi(t,g.kg("editor.action.autoFix.noneMessage","No auto fixes available"),{include:ae.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",void 0,Ze.AutoFix)}}Yo.Id="editor.action.autoFix";const Xo=_.DX.bindToContribution(xi.get),Jo=190;(0,_.E_)(new Xo({id:"hideCodeActionMenuWidget",precondition:Un.Visible,handler(r){r.hideCodeActionMenu()},kbOpts:{weight:Jo,primary:9,secondary:[1033]}})),(0,_.E_)(new Xo({id:"focusPreviousCodeAction",precondition:Un.Visible,handler(r){r.navigateCodeActionList(!0)},kbOpts:{weight:Jo+1e5,primary:16,secondary:[2064]}})),(0,_.E_)(new Xo({id:"focusNextCodeAction",precondition:Un.Visible,handler(r){r.navigateCodeActionList(!1)},kbOpts:{weight:Jo+1e5,primary:18,secondary:[2066]}})),(0,_.E_)(new Xo({id:"onEnterSelectCodeAction",precondition:Un.Visible,handler(r){r.selectedOption()},kbOpts:{weight:Jo+1e5,primary:3,secondary:[1026]}})),(0,_.E_)(new Xo({id:"onEnterSelectCodeActionWithPreview",precondition:Un.Visible,handler(r){r.selectedOptionWithPreview()},kbOpts:{weight:Jo+1e5,primary:2051}}));var gh=f(85003),Jl=f(27142),Gt=f(67167);Gt.O.as(Jl.Fd.Configuration).registerConfiguration(Object.assign(Object.assign({},gh.JJ),{properties:{"editor.experimental.useCustomCodeActionMenu":{type:"boolean",tags:["experimental"],scope:5,description:g.kg("codeActionWidget","Enabling this adjusts how the code action menu is rendered."),default:!1}}})),(0,_.HW)(xi.ID,xi),(0,_.Fl)(jn),(0,_.Fl)(W_),(0,_.Fl)(B_),(0,_.Fl)(H_),(0,_.Fl)(V_),(0,_.Fl)(Yo),(0,_.Fl)(U_),(0,_.E_)(new P_);var ql=f(22344),qo=f(80878),$e=f(66476),le=f(79359),fh=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};class ed{constructor(){this.lenses=[],this._disposables=new I.Cm}dispose(){this._disposables.dispose()}get isDisposed(){return this._disposables.isDisposed}add(e,t){this._disposables.add(e);for(const i of e.lenses)this.lenses.push({symbol:i,provider:t})}}function ph(r,e,t){return fh(this,void 0,void 0,function*(){const i=r.ordered(e),n=new Map,o=new ed,s=i.map((a,l)=>fh(this,void 0,void 0,function*(){n.set(a,l);try{const c=yield Promise.resolve(a.provideCodeLenses(e,t));c&&o.add(c,a)}catch(c){(0,K.M_)(c)}}));return yield Promise.all(s),o.lenses=o.lenses.sort((a,l)=>a.symbol.range.startLineNumber<l.symbol.range.startLineNumber?-1:a.symbol.range.startLineNumber>l.symbol.range.startLineNumber?1:n.get(a.provider)<n.get(l.provider)?-1:n.get(a.provider)>n.get(l.provider)?1:a.symbol.range.startColumn<l.symbol.range.startColumn?-1:a.symbol.range.startColumn>l.symbol.range.startColumn?1:0),o})}fe.wb.registerCommand("_executeCodeLensProvider",function(r,...e){let[t,i]=e;(0,le.j)(me.r.isUri(t)),(0,le.j)(typeof i=="number"||!i);const{codeLensProvider:n}=r.get(te.u),o=r.get($t.S).getModel(t);if(!o)throw(0,K.Qg)();const s=[],a=new I.Cm;return ph(n,o,re.X.None).then(l=>{a.add(l);const c=[];for(const d of l.lenses)i==null||d.symbol.command?s.push(d.symbol):i-- >0&&d.provider.resolveCodeLens&&c.push(Promise.resolve(d.provider.resolveCodeLens(o,d.symbol,re.X.None)).then(u=>s.push(u||d.symbol)));return Promise.all(c)}).then(()=>s).finally(()=>{setTimeout(()=>a.dispose(),100)})});var mh=f(48289),Ji=f(27992),qi=f(66726),Tt=f(90840),z_=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},$_=function(r,e){return function(t,i){e(t,i,r)}};const _h=(0,he.u1)("ICodeLensCache");class vh{constructor(e,t){this.lineCount=e,this.data=t}}let td=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new Ji.qK(20,.75);const t="codelens/cache";(0,V.cx)(()=>e.remove(t,1));const i="codelens/cache2",n=e.get(i,1,"{}");this._deserialize(n),(0,mh.O)(e.onWillSaveState)(o=>{o.reason===Tt.LP.SHUTDOWN&&e.store(i,this._serialize(),1,1)})}put(e,t){const i=t.lenses.map(s=>{var a;return{range:s.symbol.range,command:s.symbol.command&&{id:"",title:(a=s.symbol.command)===null||a===void 0?void 0:a.title}}}),n=new ed;n.add({lenses:i,dispose:()=>{}},this._fakeProvider);const o=new vh(e.getLineCount(),n);this._cache.set(e.uri.toString(),o)}get(e){const t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){const e=Object.create(null);for(const[t,i]of this._cache){const n=new Set;for(const o of i.data.lenses)n.add(o.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],o=[];for(const a of n.lines)o.push({range:new L.Q(a,1,a,11)});const s=new ed;s.add({lenses:o,dispose(){}},this._fakeProvider),this._cache.set(i,new vh(n.lineCount,s))}}catch{}}};td=z_([$_(0,Tt.CS)],td),(0,qi.v)(_h,td);var Ch=f(91818);class j_{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 Er{constructor(e,t,i){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${Er._idPool++}`,this.updatePosition(i),this._domNode=document.createElement("span"),this._domNode.className=`codelens-decoration ${t}`}withCommands(e,t){this._commands.clear();const i=[];let n=!1;for(let o=0;o<e.length;o++){const s=e[o];if(s&&(n=!0,s.command)){const a=(0,Ch.n)(s.command.title.trim());s.command.id?(i.push(S.$("a",{id:String(o),title:s.command.tooltip,role:"button"},...a)),this._commands.set(String(o),s.command)):i.push(S.$("span",{title:s.command.tooltip},...a)),o+1<e.length&&i.push(S.$("span",void 0,"\xA0|\xA0"))}}n?(S.Ln(this._domNode,...i),this._isEmpty&&t&&this._domNode.classList.add("fadein"),this._isEmpty=!1):S.Ln(this._domNode,S.$("span",void 0,"no commands"))}getCommand(e){return e.parentElement===this._domNode?this._commands.get(e.id):void 0}getId(){return this._id}getDomNode(){return this._domNode}updatePosition(e){const t=this._editor.getModel().getLineFirstNonWhitespaceColumn(e);this._widgetPosition={position:{lineNumber:e,column:t},preference:[1]}}getPosition(){return this._widgetPosition||null}}Er._idPool=0;class id{constructor(){this._removeDecorations=[],this._addDecorations=[],this._addDecorationsCallbacks=[]}addDecoration(e,t){this._addDecorations.push(e),this._addDecorationsCallbacks.push(t)}removeDecoration(e){this._removeDecorations.push(e)}commit(e){const t=e.deltaDecorations(this._removeDecorations,this._addDecorations);for(let i=0,n=t.length;i<n;i++)this._addDecorationsCallbacks[i](t[i])}}class bh{constructor(e,t,i,n,o,s,a){this._isDisposed=!1,this._editor=t,this._className=i,this._data=e,this._decorationIds=[];let l;const c=[];this._data.forEach((d,u)=>{d.symbol.command&&c.push(d.symbol),n.addDecoration({range:d.symbol.range,options:ge.kI.EMPTY},h=>this._decorationIds[u]=h),l?l=L.Q.plusRange(l,d.symbol.range):l=L.Q.lift(d.symbol.range)}),this._viewZone=new j_(l.startLineNumber-1,s,a),this._viewZoneId=o.addZone(this._viewZone),c.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(c,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new Er(this._editor,this._className,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t?.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&&L.Q.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:ge.kI.EMPTY},o=>this._decorationIds[n]=o)})}updateHeight(e,t){this._viewZone.heightInPx=e,t.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.isVisible())return null;for(let t=0;t<this._decorationIds.length;t++){const i=e.getDecorationRange(this._decorationIds[t]);i&&(this._data[t].symbol.range=i)}return this._data}updateCommands(e){this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(e,!0);for(let t=0;t<this._data.length;t++){const i=e[t];if(i){const{symbol:n}=this._data[t];n.command=i.command||n.command}}}getCommand(e){var t;return(t=this._contentWidget)===null||t===void 0?void 0:t.getCommand(e)}getLineNumber(){const e=this._editor.getModel().getDecorationRange(this._decorationIds[0]);return e?e.startLineNumber:-1}update(e){if(this.isValid()){const t=this._editor.getModel().getDecorationRange(this._decorationIds[0]);t&&(this._viewZone.afterLineNumber=t.startLineNumber-1,e.layoutZone(this._viewZoneId),this._contentWidget&&(this._contentWidget.updatePosition(t.startLineNumber),this._editor.layoutContentWidget(this._contentWidget)))}}}var en=f(73027),si=f(12060),G_=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},es=function(r,e){return function(t,i){e(t,i,r)}},K_=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};let Gn=class{constructor(e,t,i,n,o,s){this._editor=e,this._languageFeaturesService=t,this._commandService=n,this._notificationService=o,this._codeLensCache=s,this._disposables=new I.Cm,this._localToDispose=new I.Cm,this._lenses=[],this._oldCodeLensModels=new I.Cm,this._provideCodeLensDebounce=i.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=i.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new V.uC(()=>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(46)||a.hasChanged(16)||a.hasChanged(15))&&this._updateLensStyle(),a.hasChanged(14)&&this._onModelChange()})),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._styleClassName="_"+(0,ql.tW)(this._editor.getId()).toString(16),this._styleElement=S.li(S.Cl(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0),this._updateLensStyle()}dispose(){var e;this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),(e=this._currentCodeLensModel)===null||e===void 0||e.dispose(),this._styleElement.remove()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(61)/this._editor.getOption(48));let t=this._editor.getOption(16);return(!t||t<5)&&(t=this._editor.getOption(48)*.9|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),i=this._editor.getOption(15),n=this._editor.getOption(46),o=`--codelens-font-family${this._styleClassName}`,s=`--codelens-font-features${this._styleClassName}`;let a=`
		.monaco-editor .codelens-decoration.${this._styleClassName} { line-height: ${e}px; font-size: ${t}px; padding-right: ${Math.round(t*.5)}px; font-feature-settings: var(${s}) }
		.monaco-editor .codelens-decoration.${this._styleClassName} span.codicon { line-height: ${e}px; font-size: ${t}px; }
		`;i&&(a+=`.monaco-editor .codelens-decoration.${this._styleClassName} { font-family: var(${o}), ${$e.jU.fontFamily}}`),this._styleElement.textContent=a,this._editor.getContainerDomNode().style.setProperty(o,i??"inherit"),this._editor.getContainerDomNode().style.setProperty(s,n.fontFeatureSettings),this._editor.changeViewZones(l=>{for(const c of this._lenses)c.updateHeight(e,l)})}_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(14))return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&this._localToDispose.add((0,V.EQ)(()=>{const n=this._codeLensCache.get(e);t===n&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3));return}for(const n of this._languageFeaturesService.codeLensProvider.all(e))if(typeof n.onDidChange=="function"){const o=n.onDidChange(()=>i.schedule());this._localToDispose.add(o)}const i=new V.uC(()=>{var n;const o=Date.now();(n=this._getCodeLensModelPromise)===null||n===void 0||n.cancel(),this._getCodeLensModelPromise=(0,V.SS)(s=>ph(this._languageFeaturesService.codeLensProvider,e,s)),this._getCodeLensModelPromise.then(s=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=s,this._codeLensCache.put(e,s);const a=this._provideCodeLensDebounce.update(e,Date.now()-o);i.delay=a,this._renderCodeLensSymbols(s),this._resolveCodeLensesInViewportSoon()},K.dz)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add((0,I.s)(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._editor.changeDecorations(n=>{this._editor.changeViewZones(o=>{const s=[];let a=-1;this._lenses.forEach(c=>{!c.isValid()||a===c.getLineNumber()?s.push(c):(c.update(o),a=c.getLineNumber())});const l=new id;s.forEach(c=>{c.dispose(l,o),this._lenses.splice(this._lenses.indexOf(c),1)}),l.commit(n)})}),i.schedule()})),this._localToDispose.add(this._editor.onDidFocusEditorWidget(()=>{i.schedule()})),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((0,I.s)(()=>{if(this._editor.getModel()){const n=qo.D.capture(this._editor);this._editor.changeDecorations(o=>{this._editor.changeViewZones(s=>{this._disposeAllLenses(o,s)})}),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 o=n.target.element;if(o?.tagName==="SPAN"&&(o=o.parentElement),o?.tagName==="A")for(const s of this._lenses){const a=s.getCommand(o);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),i.schedule()}_disposeAllLenses(e,t){const i=new id;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)))}const o=qo.D.capture(this._editor),s=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const c=new id;let d=0,u=0;for(;u<i.length&&d<this._lenses.length;){const h=i[u][0].symbol.range.startLineNumber,p=this._lenses[d].getLineNumber();p<h?(this._lenses[d].dispose(c,l),this._lenses.splice(d,1)):p===h?(this._lenses[d].updateCodeLensSymbols(i[u],c),u++,d++):(this._lenses.splice(d,0,new bh(i[u],this._editor,this._styleClassName,c,l,s.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),d++,u++)}for(;d<this._lenses.length;)this._lenses[d].dispose(c,l),this._lenses.splice(d,1);for(;u<i.length;)this._lenses.push(new bh(i[u],this._editor,this._styleClassName,c,l,s.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),u++;c.commit(a)})}),o.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var e;(e=this._resolveCodeLensesPromise)===null||e===void 0||e.cancel(),this._resolveCodeLensesPromise=void 0;const t=this._editor.getModel();if(!t)return;const i=[],n=[];if(this._lenses.forEach(a=>{const l=a.computeIfNecessary(t);l&&(i.push(l),n.push(a))}),i.length===0)return;const o=Date.now(),s=(0,V.SS)(a=>{const l=i.map((c,d)=>{const u=new Array(c.length),h=c.map((p,m)=>!p.symbol.command&&typeof p.provider.resolveCodeLens=="function"?Promise.resolve(p.provider.resolveCodeLens(t,p.symbol,a)).then(v=>{u[m]=v},K.M_):(u[m]=p.symbol,Promise.resolve(void 0)));return Promise.all(h).then(()=>{!a.isCancellationRequested&&!n[d].isDisposed()&&n[d].updateCommands(u)})});return Promise.all(l)});this._resolveCodeLensesPromise=s,this._resolveCodeLensesPromise.then(()=>{const a=this._resolveCodeLensesDebounce.update(t,Date.now()-o);this._resolveCodeLensesScheduler.delay=a,this._currentCodeLensModel&&this._codeLensCache.put(t,this._currentCodeLensModel),this._oldCodeLensModels.clear(),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},a=>{(0,K.dz)(a),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}getModel(){return this._currentCodeLensModel}};Gn.ID="css.editor.codeLens",Gn=G_([es(1,te.u),es(2,si.U),es(3,fe.wT),es(4,Ye.Ot),es(5,_h)],Gn),(0,_.HW)(Gn.ID,Gn),(0,_.Fl)(class extends _.ks{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:D.R.hasCodeLensProvider,label:(0,g.kg)("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}run(e,t){return K_(this,void 0,void 0,function*(){if(!t.hasModel())return;const i=e.get(en.GK),n=e.get(fe.wT),o=e.get(Ye.Ot),s=t.getSelection().positionLineNumber,a=t.getContribution(Gn.ID);if(!a)return;const l=a.getModel();if(!l)return;const c=[];for(const u of l.lenses)u.symbol.command&&u.symbol.range.startLineNumber===s&&c.push({label:u.symbol.command.title,command:u.symbol.command});if(c.length===0)return;const d=yield i.pick(c,{canPickMany:!1});if(d){if(l.isDisposed)return yield n.executeCommand(this.id);try{yield n.executeCommand(d.command.id,...d.command.arguments||[])}catch(u){o.error(u)}}})}});var ce=f(94901),Kt=f(23013),Sh=f(58574);function Q_(r,e,t){const i=[],o=r.ordered(e).reverse().map(s=>Promise.resolve(s.provideDocumentColors(e,t)).then(a=>{if(Array.isArray(a))for(const l of a)i.push({colorInfo:l,provider:s})}));return Promise.all(o).then(()=>i)}function yh(r,e,t,i){return Promise.resolve(t.provideColorPresentations(r,e,i))}fe.wb.registerCommand("_executeDocumentColorProvider",function(r,...e){const[t]=e;if(!(t instanceof me.r))throw(0,K.Qg)();const{colorProvider:i}=r.get(te.u),n=r.get($t.S).getModel(t);if(!n)throw(0,K.Qg)();const o=[],a=i.ordered(n).reverse().map(l=>Promise.resolve(l.provideDocumentColors(n,re.X.None)).then(c=>{if(Array.isArray(c))for(const d of c)o.push({range:d.range,color:[d.color.red,d.color.green,d.color.blue,d.color.alpha]})}));return Promise.all(a).then(()=>o)}),fe.wb.registerCommand("_executeColorPresentationProvider",function(r,...e){const[t,i]=e,{uri:n,range:o}=i;if(!(n instanceof me.r)||!Array.isArray(t)||t.length!==4||!L.Q.isIRange(o))throw(0,K.Qg)();const[s,a,l,c]=t,{colorProvider:d}=r.get(te.u),u=r.get($t.S).getModel(n);if(!u)throw(0,K.Qg)();const h={range:o,color:{red:s,green:a,blue:l,alpha:c}},p=[],v=d.ordered(u).reverse().map(w=>Promise.resolve(w.provideColorPresentations(u,h,re.X.None)).then(R=>{Array.isArray(R)&&p.push(...R)}));return Promise.all(v).then(()=>p)});var Z_=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},nd=function(r,e){return function(t,i){e(t,i,r)}},Y_=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};const wh=Object.create({}),X_=500;let tn=class qp extends I.jG{constructor(e,t,i,n){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new I.Cm),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new Sh.Qn(this._editor),this._colorDecorationClassRefs=this._register(new I.Cm),this._debounceInformation=n.for(i.colorProvider,"Document Colors",{min:qp.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isEnabled=this.isEnabled(),this.onModelChanged()})),this._register(e.onDidChangeModelLanguage(()=>this.onModelChanged())),this._register(i.colorProvider.onDidChange(()=>this.onModelChanged())),this._register(e.onDidChangeConfiguration(()=>{const o=this._isEnabled;this._isEnabled=this.isEnabled(),o!==this._isEnabled&&(this._isEnabled?this.onModelChanged():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isEnabled=this.isEnabled(),this.onModelChanged()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),i=this._configurationService.getValue(t);if(i&&typeof i=="object"){const n=i.colorDecorators;if(n&&n.enable!==void 0&&!n.enable)return n.enable}return this._editor.getOption(17)}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}onModelChanged(){if(this.stop(),!this._isEnabled)return;const e=this._editor.getModel();!e||!this._languageFeaturesService.colorProvider.has(e)||(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new V.pc,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}beginCompute(){this._computePromise=(0,V.SS)(e=>Y_(this,void 0,void 0,function*(){const t=this._editor.getModel();if(!t)return Promise.resolve([]);const i=new Kt.W(!1),n=yield Q_(this._languageFeaturesService.colorProvider,t,e);return this._debounceInformation.update(t,i.elapsed()),n})),this._computePromise.then(e=>{this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null},K.dz)}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:ge.kI.EMPTY}));this._editor.changeDecorations(i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((n,o)=>this._colorDatas.set(n,e[o]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[];for(let i=0;i<e.length&&t.length<X_;i++){const{red:n,green:o,blue:s,alpha:a}=e[i].colorInfo.color,l=new ce.bU(Math.round(n*255),Math.round(o*255),Math.round(s*255),a),c=`rgba(${l.r}, ${l.g}, ${l.b}, ${l.a})`,d=this._colorDecorationClassRefs.add(this._ruleFactory.createClassNameRef({backgroundColor:c}));t.push({range:{startLineNumber:e[i].colorInfo.range.startLineNumber,startColumn:e[i].colorInfo.range.startColumn,endLineNumber:e[i].colorInfo.range.endLineNumber,endColumn:e[i].colorInfo.range.endColumn},options:{description:"colorDetector",before:{content:G.S8,inlineClassName:`${d.className} colorpicker-color-decoration`,inlineClassNameAffectsLetterSpacing:!0,attachedData:wh}}})}this._colorDecoratorIds.set(t)}removeAllDecorations(){this._editor.removeDecorations(this._decorationsIds),this._decorationsIds=[],this._colorDecoratorIds.clear(),this._colorDecorationClassRefs.clear()}getColorData(e){const t=this._editor.getModel();if(!t)return null;const i=t.getDecorationsInRange(L.Q.fromPositions(e,e)).filter(n=>this._colorDatas.has(n.id));return i.length===0?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};tn.ID="editor.contrib.colorDetector",tn.RECOMPUTE_TIME=1e3,tn=Z_([nd(1,Fe.pG),nd(2,te.u),nd(3,si.U)],tn),(0,_.HW)(tn.ID,tn);class J_{constructor(e,t,i){this.presentationIndex=i,this._onColorFlushed=new Z.vl,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new Z.vl,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new Z.vl,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){for(let i=0;i<this.colorPresentations.length;i++)if(t.toLowerCase()===this.colorPresentations[i].label){this.presentationIndex=i,this._onDidChangePresentation.fire(this.presentation);break}}flushColor(){this._onColorFlushed.fire(this._color)}}var Dh=f(10176),Kn=f(45222);const Ot=S.$;class q_ extends I.jG{constructor(e,t,i){super(),this.model=t,this.domNode=Ot(".colorpicker-header"),S.BC(e,this.domNode),this.pickedColorNode=S.BC(this.domNode,Ot(".picked-color"));const n=(0,g.kg)("clickToToggleColorOptions","Click to toggle color options (rgb/hsl/hex)");this.pickedColorNode.setAttribute("title",n);const o=S.BC(this.domNode,Ot(".original-color"));o.style.backgroundColor=ce.Q1.Format.CSS.format(this.model.originalColor)||"",this.backgroundColor=i.getColorTheme().getColor(C.WfR)||ce.Q1.white,this._register((0,U.zy)((s,a)=>{this.backgroundColor=s.getColor(C.WfR)||ce.Q1.white})),this._register(S.ko(this.pickedColorNode,S.Bx.CLICK,()=>this.model.selectNextColorPresentation())),this._register(S.ko(o,S.Bx.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=ce.Q1.Format.CSS.format(t.color)||"",this.pickedColorNode.classList.toggle("light",t.color.rgba.a<.5?this.backgroundColor.isLighter():t.color.isLighter()),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){this.pickedColorNode.style.backgroundColor=ce.Q1.Format.CSS.format(e)||"",this.pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this.pickedColorNode.textContent=this.model.presentation?this.model.presentation.label:"",this.pickedColorNode.prepend(Ot(".codicon.codicon-color-mode"))}}class ev extends I.jG{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this.domNode=Ot(".colorpicker-body"),S.BC(e,this.domNode),this.saturationBox=new tv(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 iv(this.domNode,this.model),this._register(this.opacityStrip),this._register(this.opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this.opacityStrip.onColorFlushed(this.flushColor,this)),this.hueStrip=new nv(this.domNode,this.model),this._register(this.hueStrip),this._register(this.hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this.hueStrip.onColorFlushed(this.flushColor,this))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const i=this.model.color.hsva;this.model.color=new ce.Q1(new ce.$J(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new ce.Q1(new ce.$J(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=(1-e)*360;this.model.color=new ce.Q1(new ce.$J(i===360?0:i,t.s,t.v,t.a))}layout(){this.saturationBox.layout(),this.opacityStrip.layout(),this.hueStrip.layout()}}class tv extends I.jG{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new Z.vl,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new Z.vl,this.onColorFlushed=this._onColorFlushed.event,this.domNode=Ot(".saturation-wrap"),S.BC(e,this.domNode),this.canvas=document.createElement("canvas"),this.canvas.className="saturation-box",S.BC(this.domNode,this.canvas),this.selection=Ot(".saturation-selection"),S.BC(this.domNode,this.selection),this.layout(),this._register(S.ko(this.domNode,S.Bx.POINTER_DOWN,n=>this.onPointerDown(n))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;this.monitor=this._register(new Dh._);const t=S.BK(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=S.ko(document,S.Bx.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 ce.Q1(new ce.$J(e.h,1,1,1)),i=this.canvas.getContext("2d"),n=i.createLinearGradient(0,0,this.canvas.width,0);n.addColorStop(0,"rgba(255, 255, 255, 1)"),n.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),n.addColorStop(1,"rgba(255, 255, 255, 0)");const o=i.createLinearGradient(0,0,0,this.canvas.height);o.addColorStop(0,"rgba(0, 0, 0, 0)"),o.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this.canvas.width,this.canvas.height),i.fillStyle=ce.Q1.Format.CSS.format(t),i.fill(),i.fillStyle=n,i.fill(),i.fillStyle=o,i.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${this.height-t*this.height}px`}onDidChangeColor(){this.monitor&&this.monitor.isMonitoring()||this.paint()}}class xh extends I.jG{constructor(e,t){super(),this.model=t,this._onDidChange=new Z.vl,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new Z.vl,this.onColorFlushed=this._onColorFlushed.event,this.domNode=S.BC(e,Ot(".strip")),this.overlay=S.BC(this.domNode,Ot(".overlay")),this.slider=S.BC(this.domNode,Ot(".slider")),this.slider.style.top="0px",this._register(S.ko(this.domNode,S.Bx.POINTER_DOWN,i=>this.onPointerDown(i))),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._register(new Dh._),i=S.BK(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,o=>this.onDidChangeTop(o.pageY-i.top),()=>null);const n=S.ko(document,S.Bx.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 iv extends xh{constructor(e,t){super(e,t),this.domNode.classList.add("opacity-strip"),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){const{r:t,g:i,b:n}=e.rgba,o=new ce.Q1(new ce.bU(t,i,n,1)),s=new ce.Q1(new ce.bU(t,i,n,0));this.overlay.style.background=`linear-gradient(to bottom, ${o} 0%, ${s} 100%)`}getValue(e){return e.hsva.a}}class nv extends xh{constructor(e,t){super(e,t),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class ov extends Kn.x{constructor(e,t,i,n){super(),this.model=t,this.pixelRatio=i,this._register(Ol.PixelRatio.onDidChange(()=>this.layout()));const o=Ot(".colorpicker-widget");e.appendChild(o);const s=new q_(o,this.model,n);this.body=new ev(o,this.model,this.pixelRatio),this._register(s),this._register(this.body)}layout(){this.body.layout()}}var sv=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},rv=function(r,e){return function(t,i){e(t,i,r)}},Lh=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};class av{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 od=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=1}computeSync(e,t){return[]}computeAsync(e,t,i){return V.AE.fromPromise(this._computeAsync(e,t,i))}_computeAsync(e,t,i){return Lh(this,void 0,void 0,function*(){if(!this._editor.hasModel())return[];const n=tn.get(this._editor);if(!n)return[];for(const o of t){if(!n.isColorDecoration(o))continue;const s=n.getColorData(o.range.getStartPosition());if(s)return[yield this._createColorHover(this._editor.getModel(),s.colorInfo,s.provider)]}return[]})}_createColorHover(e,t,i){return Lh(this,void 0,void 0,function*(){const n=e.getValueInRange(t.range),{red:o,green:s,blue:a,alpha:l}=t.color,c=new ce.bU(Math.round(o*255),Math.round(s*255),Math.round(a*255),l),d=new ce.Q1(c),u=yield yh(e,t,i,re.X.None),h=new J_(d,[],0);return h.colorPresentations=u||[],h.guessColorPresentation(d,n),new av(this,L.Q.lift(t.range),h,i)})}renderHoverParts(e,t){if(t.length===0||!this._editor.hasModel())return I.jG.None;const i=new I.Cm,n=t[0],o=this._editor.getModel(),s=n.model,a=i.add(new ov(e.fragment,s,this._editor.getOption(131),this._themeService));e.setColorPicker(a);let l=new L.Q(n.range.startLineNumber,n.range.startColumn,n.range.endLineNumber,n.range.endColumn);const c=()=>{let u,h;if(s.presentation.textEdit){u=[s.presentation.textEdit],h=new L.Q(s.presentation.textEdit.range.startLineNumber,s.presentation.textEdit.range.startColumn,s.presentation.textEdit.range.endLineNumber,s.presentation.textEdit.range.endColumn);const p=this._editor.getModel()._setTrackedRange(null,h,3);this._editor.pushUndoStop(),this._editor.executeEdits("colorpicker",u),h=this._editor.getModel()._getTrackedRange(p)||h}else u=[{range:l,text:s.presentation.label,forceMoveMarkers:!1}],h=l.setEndPosition(l.endLineNumber,l.startColumn+s.presentation.label.length),this._editor.pushUndoStop(),this._editor.executeEdits("colorpicker",u);s.presentation.additionalTextEdits&&(u=[...s.presentation.additionalTextEdits],this._editor.executeEdits("colorpicker",u),e.hide()),this._editor.pushUndoStop(),l=h},d=u=>yh(o,{range:l,color:{red:u.rgba.r/255,green:u.rgba.g/255,blue:u.rgba.b/255,alpha:u.rgba.a}},n.provider,re.X.None).then(h=>{s.colorPresentations=h||[]});return i.add(s.onColorFlushed(u=>{d(u).then(c)})),i.add(s.onDidChangeColor(d)),i}};od=sv([rv(1,U.Gy)],od);var xt=f(77922),Ft=f(37042);function sd(r,e){return!!r[e]}class rd{constructor(e,t){this.target=e.target,this.hasTriggerModifier=sd(e.event,t.triggerModifier),this.hasSideBySideModifier=sd(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class kh{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=sd(e,t.triggerModifier)}}class Ar{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 Ih(r){return r==="altKey"?Se.zx?new Ar(57,"metaKey",6,"altKey"):new Ar(5,"ctrlKey",6,"altKey"):Se.zx?new Ar(6,"altKey",57,"metaKey"):new Ar(6,"altKey",5,"ctrlKey")}class ad extends I.jG{constructor(e){super(),this._onMouseMoveOrRelevantKeyDown=this._register(new Z.vl),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new Z.vl),this.onExecute=this._onExecute.event,this._onCancel=this._register(new Z.vl),this.onCancel=this._onCancel.event,this._editor=e,this._opts=Ih(this._editor.getOption(72)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(t=>{if(t.hasChanged(72)){const i=Ih(this._editor.getOption(72));if(this._opts.equals(i))return;this._opts=i,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(t=>this._onEditorMouseMove(new rd(t,this._opts)))),this._register(this._editor.onMouseDown(t=>this._onEditorMouseDown(new rd(t,this._opts)))),this._register(this._editor.onMouseUp(t=>this._onEditorMouseUp(new rd(t,this._opts)))),this._register(this._editor.onKeyDown(t=>this._onEditorKeyDown(new kh(t,this._opts)))),this._register(this._editor.onKeyUp(t=>this._onEditorKeyUp(new kh(t,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(t=>this._onDidChangeCursorSelection(t))),this._register(this._editor.onDidChangeModel(t=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(t=>{(t.scrollTopChanged||t.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=e.target.position?e.target.position.lineNumber:0}_onEditorMouseUp(e){const t=e.target.position?e.target.position.lineNumber:0;this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}var Nr=f(77439),ts=f(71386),Qn=f(53909),it=f(52394),lv=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},ri=function(r,e){return function(t,i){e(t,i,r)}};let nn=class extends Gm.x{constructor(e,t,i,n,o,s,a,l,c,d,u,h){super(e,Object.assign(Object.assign({},i.getRawOptions()),{overflowWidgetsDomNode:i.getOverflowWidgetsDomNode()}),{},n,o,s,a,l,c,d,u,h),this._parentEditor=i,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(i.onDidChangeConfiguration(p=>this._onParentConfigurationChanged(p)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){ts.co(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};nn=lv([ri(3,he._Y),ri(4,Be.T),ri(5,fe.wT),ri(6,A.fN),ri(7,U.Gy),ri(8,Ye.Ot),ri(9,Qn.j),ri(10,it.JZ),ri(11,te.u)],nn);var Li=f(9224),ld=f(94664);const Rh=new ce.Q1(new ce.bU(0,122,204)),dv={showArrow:!0,showFrame:!0,className:"",frameColor:Rh,arrowColor:Rh,keepEditorSelection:!1},cv="vs.editor.contrib.zoneWidget";class uv{constructor(e,t,i,n,o,s){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=n,this._onDomNodeTop=o,this._onComputedHeight=s}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class hv{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class Mr{constructor(e){this._editor=e,this._ruleName=Mr._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),S.U2(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(){S.U2(this._ruleName),S.Wt(`.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:L.Q.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}Mr._IdGenerator=new ld.n(".arrow-decoration-");class gv{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new I.Cm,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=ts.Go(t),ts.co(this.options,dv,!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 Mr(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){if(this.domNode.style.height=`${e}px`,this.container){const t=e-this._decoratingElementsHeight();this.container.style.height=`${t}px`;const i=this.editor.getLayoutInfo();this._doLayout(t,this._getWidth(i))}this._resizeSash&&this._resizeSash.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,t){const i=L.Q.isIRange(e)?L.Q.lift(e):L.Q.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:ge.kI.EMPTY}])}hide(){this._viewZone&&(this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._arrow&&this._arrow.hide()}_decoratingElementsHeight(){const e=this.editor.getOption(61);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(),o=this._getWidth(n);this.domNode.style.width=`${o}px`,this.domNode.style.left=this._getLeft(n)+"px";const s=document.createElement("div");s.style.overflow="hidden";const a=this.editor.getOption(61),l=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,l);let c=0,d=0;if(this._arrow&&this.options.showArrow&&(c=Math.round(a/3),this._arrow.height=c,this._arrow.show(i)),this.options.showFrame&&(d=Math.round(a/9)),this.editor.changeViewZones(p=>{this._viewZone&&p.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new uv(s,i.lineNumber,i.column,t,m=>this._onViewZoneTop(m),m=>this._onViewZoneHeight(m)),this._viewZone.id=p.addZone(this._viewZone),this._overlayWidget=new hv(cv+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const p=this.options.frameWidth?this.options.frameWidth:d;this.container.style.borderTopWidth=p+"px",this.container.style.borderBottomWidth=p+"px"}const u=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=c+"px",this.container.style.height=u+"px",this.container.style.overflow="hidden"),this._doLayout(u,o),this.options.keepEditorSelection||this.editor.setSelection(e);const h=this.editor.getModel();if(h){const p=e.endLineNumber+1;p<=h.getLineCount()?this.revealLine(p,!1):this.revealLine(h.getLineCount(),!0)}}revealLine(e,t){t?this.editor.revealLineInCenter(e,0):this.editor.revealLine(e,0)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e){this._viewZone&&this._viewZone.heightInLines!==e&&this.editor.changeViewZones(t=>{this._viewZone&&(this._viewZone.heightInLines=e,t.layoutZone(this._viewZone.id))})}_initSash(){if(this._resizeSash)return;this._resizeSash=this._disposables.add(new Li.m(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(61),n=i<0?Math.ceil(i):Math.floor(i),o=e.heightInLines+n;o>5&&o<35&&this._relayout(o)}}))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(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 is=f(87594),ns=f(45854);class fv extends He.LN{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new Z.vl),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=(0,S.BC)(e,(0,S.$)(".monaco-dropdown")),this._label=(0,S.BC)(this._element,(0,S.$)(".dropdown-label"));let i=t.labelRenderer;i||(i=o=>(o.textContent=t.label||"",null));for(const o of[S.Bx.CLICK,S.Bx.MOUSE_DOWN,zn.B.Tap])this._register((0,S.ko)(this.element,o,s=>S.fs.stop(s,!0)));for(const o of[S.Bx.MOUSE_DOWN,zn.B.Tap])this._register((0,S.ko)(this._label,o,s=>{s instanceof MouseEvent&&(s.detail>1||s.button!==0)||(this.visible?this.hide():this.show())}));this._register((0,S.ko)(this._label,S.Bx.KEY_UP,o=>{const s=new is.Z(o);(s.equals(3)||s.equals(10))&&(S.fs.stop(o,!0),this.visible?this.hide():this.show())}));const n=i(this._label);n&&this._register(n),this._register(zn.q.addTarget(this._label))}get element(){return this._element}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}dispose(){super.dispose(),this.hide(),this.boxContainer&&(this.boxContainer.remove(),this.boxContainer=void 0),this.contents&&(this.contents.remove(),this.contents=void 0),this._label&&(this._label.remove(),this._label=void 0)}}class pv extends fv{constructor(e,t){super(e,t),this._actions=[],this._contextMenuProvider=t.contextMenuProvider,this.actions=t.actions||[],this.actionProvider=t.actionProvider,this.menuClassName=t.menuClassName||"",this.menuAsChild=!!t.menuAsChild}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this.actionProvider?this.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:e=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this.menuClassName,onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this.menuAsChild?this.element:void 0})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class Eh extends ns.E{constructor(e,t,i,n=Object.create(null)){super(null,e,n),this.actionItem=null,this._onDidChangeVisibility=this._register(new Z.vl),this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=n,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=o=>{this.element=(0,S.BC)(o,(0,S.$)("a.action-label"));let s=[];return typeof this.options.classNames=="string"?s=this.options.classNames.split(/\s+/g).filter(a=>!!a):this.options.classNames&&(s=this.options.classNames),s.find(a=>a==="icon")||s.push("codicon"),this.element.classList.add(...s),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this.element.title=this._action.label||"",this.element.ariaLabel=this._action.label||"",null},i=Array.isArray(this.menuActionsOrProvider),n={contextMenuProvider:this.contextMenuProvider,labelRenderer:t,menuAsChild:this.options.menuAsChild,actions:i?this.menuActionsOrProvider:void 0,actionProvider:i?void 0:this.menuActionsOrProvider};if(this.dropdownMenu=this._register(new pv(e,n)),this._register(this.dropdownMenu.onDidChangeVisibility(o=>{var s;(s=this.element)===null||s===void 0||s.setAttribute("aria-expanded",`${o}`),this._onDidChangeVisibility.fire(o)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const o=this;this.dropdownMenu.menuOptions=Object.assign(Object.assign({},this.dropdownMenu.menuOptions),{get anchorAlignment(){return o.options.anchorAlignmentProvider()}})}this.updateTooltip(),this.updateEnabled()}getTooltip(){let e=null;return this.getAction().tooltip?e=this.getAction().tooltip:this.getAction().label&&(e=this.getAction().label),e??void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}updateEnabled(){var e,t;const i=!this.getAction().enabled;(e=this.actionItem)===null||e===void 0||e.classList.toggle("disabled",i),(t=this.element)===null||t===void 0||t.classList.toggle("disabled",i)}}var mv=f(98315),bt=f(89563),dd=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},St=function(r,e){return function(t,i){e(t,i,r)}},Ah=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};function _v(r,e,t,i,n,o,s){const a=r.getActions(e);return Cv(a,t,!1,typeof i=="string"?c=>c===i:i,n,o,s),vv(a)}function vv(r){const e=new I.Cm;for(const[,t]of r)for(const i of t)e.add(i);return e}function Cv(r,e,t,i=a=>a==="navigation",n=Number.MAX_SAFE_INTEGER,o=()=>!1,s=!1){let a,l;Array.isArray(e)?(a=e,l=e):(a=e.primary,l=e.secondary);const c=new Set;for(const[d,u]of r){let h;i(d)?(h=a,h.length>0&&s&&h.push(new He.wv)):(h=l,h.length>0&&h.push(new He.wv));for(let p of u){t&&(p=p instanceof z.Xe&&p.alt?p.alt:p);const m=h.push(p);p instanceof He.YH&&c.add({group:d,action:p,index:m-1})}}for(const{group:d,action:u,index:h}of c){const p=i(d)?a:l,m=u.actions;(m.length<=1||p.length+m.length-2<=n)&&o(u,d,p.length)&&p.splice(h,1,...m)}if(a!==l&&a.length>n){const d=a.splice(n,a.length-n);l.unshift(...d,new He.wv)}}let Zn=class extends ns.Z{constructor(e,t,i,n,o,s,a){super(void 0,e,{icon:!!(e.class||e.item.icon),label:!e.class&&!e.item.icon,draggable:t?.draggable,keybinding:t?.keybinding,hoverDelegate:t?.hoverDelegate}),this._keybindingService=i,this._notificationService=n,this._contextKeyService=o,this._themeService=s,this._contextMenuService=a,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new I.HE),this._altKey=S.Di.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}onClick(e){return Ah(this,void 0,void 0,function*(){e.preventDefault(),e.stopPropagation();try{yield this.actionRunner.run(this._commandAction,this._context)}catch(t){this._notificationService.error(t)}})}render(e){super.render(e),e.classList.add("menu-entry"),this._updateItemClass(this._menuItemAction.item);let t=!1,i=this._altKey.keyStatus.altKey||(Se.uF||Se.j9)&&this._altKey.keyStatus.shiftKey;const n=()=>{var o;const s=t&&i&&!!(!((o=this._commandAction.alt)===null||o===void 0)&&o.enabled);s!==this._wantsAltCommand&&(this._wantsAltCommand=s,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._menuItemAction.alt&&this._register(this._altKey.event(o=>{i=o.altKey||(Se.uF||Se.j9)&&o.shiftKey,n()})),this._register((0,S.ko)(e,"mouseleave",o=>{t=!1,n()})),this._register((0,S.ko)(e,"mouseenter",o=>{t=!0,n()}))}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){var e;const t=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),i=t&&t.getLabel(),n=this._commandAction.tooltip||this._commandAction.label;let o=i?(0,g.kg)("titleAndKb","{0} ({1})",n,i):n;if(!this._wantsAltCommand&&(!((e=this._menuItemAction.alt)===null||e===void 0)&&e.enabled)){const s=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,a=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),l=a&&a.getLabel(),c=l?(0,g.kg)("titleAndKb","{0} ({1})",s,l):s;o=(0,g.kg)("titleAndKbAndAlt",`{0}
[{1}] {2}`,o,mv.Of.modifierLabels[Se.OS].altKey,c)}return o}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){var t;this._itemClassDispose.value=void 0;const{element:i,label:n}=this;if(!i||!n)return;const o=this._commandAction.checked&&(!((t=e.toggled)===null||t===void 0)&&t.icon)?e.toggled.icon:e.icon;if(o)if(U.L0.isThemeIcon(o)){const s=U.L0.asClassNameArray(o);n.classList.add(...s),this._itemClassDispose.value=(0,I.s)(()=>{n.classList.remove(...s)})}else n.style.backgroundImage=(0,bt.HD)(this._themeService.getColorTheme().type)?(0,S.Tf)(o.dark):(0,S.Tf)(o.light),n.classList.add("icon"),this._itemClassDispose.value=(0,I.qE)((0,I.s)(()=>{n.style.backgroundImage="",n.classList.remove("icon")}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}};Zn=dd([St(2,tt.b),St(3,Ye.Ot),St(4,A.fN),St(5,U.Gy),St(6,ni.Z)],Zn);let cd=class extends Eh{constructor(e,t,i,n){var o,s;const a=Object.assign({},t??Object.create(null),{menuAsChild:(o=t?.menuAsChild)!==null&&o!==void 0?o:!1,classNames:(s=t?.classNames)!==null&&s!==void 0?s:U.L0.isThemeIcon(e.item.icon)?U.L0.asClassName(e.item.icon):void 0});super(e,{getActions:()=>e.actions},i,a),this._contextMenuService=i,this._themeService=n}render(e){super.render(e),(0,le.j)(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!U.L0.isThemeIcon(i)){this.element.classList.add("icon");const n=()=>{this.element&&(this.element.style.backgroundImage=(0,bt.HD)(this._themeService.getColorTheme().type)?(0,S.Tf)(i.dark):(0,S.Tf)(i.light))};n(),this._register(this._themeService.onDidColorThemeChange(()=>{n()}))}}};cd=dd([St(2,ni.Z),St(3,U.Gy)],cd);let ud=class extends ns.E{constructor(e,t,i,n,o,s,a,l){var c,d,u;super(null,e),this._keybindingService=i,this._notificationService=n,this._contextMenuService=o,this._menuService=s,this._instaService=a,this._storageService=l,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let h;const p=l.get(this._storageKey,1);p&&(h=e.actions.find(v=>p===v.id)),h||(h=e.actions[0]),this._defaultAction=this._instaService.createInstance(Zn,h,{keybinding:this._getDefaultActionKeybindingLabel(h)});const m=Object.assign({},t??Object.create(null),{menuAsChild:(c=t?.menuAsChild)!==null&&c!==void 0?c:!0,classNames:(d=t?.classNames)!==null&&d!==void 0?d:["codicon","codicon-chevron-down"],actionRunner:(u=t?.actionRunner)!==null&&u!==void 0?u:new He.LN});this._dropdown=new Eh(e,e.actions,this._contextMenuService,m),this._dropdown.actionRunner.onDidRun(v=>{v.action instanceof z.Xe&&this.update(v.action)})}update(e){this._storageService.store(this._storageKey,e.id,1,0),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(Zn,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends He.LN{runAction(t,i){return Ah(this,void 0,void 0,function*(){yield t.run(void 0)})}},this._container&&this._defaultAction.render((0,S.Hs)(this._container,(0,S.$)(".action-container")))}_getDefaultActionKeybindingLabel(e){var t;let i;if(!((t=this._options)===null||t===void 0)&&t.renderKeybindingWithDefaultActionLabel){const n=this._keybindingService.lookupKeybinding(e.id);n&&(i=`(${n.getLabel()})`)}return i}setActionContext(e){super.setActionContext(e),this._defaultAction.setActionContext(e),this._dropdown.setActionContext(e)}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-default");const t=(0,S.$)(".action-container");this._defaultAction.render((0,S.BC)(this._container,t)),this._register((0,S.ko)(t,S.Bx.KEY_DOWN,n=>{const o=new is.Z(n);o.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),o.stopPropagation())}));const i=(0,S.$)(".dropdown-action-container");this._dropdown.render((0,S.BC)(this._container,i)),this._register((0,S.ko)(i,S.Bx.KEY_DOWN,n=>{var o;const s=new is.Z(n);s.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),(o=this._defaultAction.element)===null||o===void 0||o.focus(),s.stopPropagation())}))}focus(e){e?this._dropdown.focus():(this._defaultAction.element.tabIndex=0,this._defaultAction.element.focus())}blur(){this._defaultAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._defaultAction.element.tabIndex=0:(this._defaultAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}dispose(){this._defaultAction.dispose(),this._dropdown.dispose(),super.dispose()}};ud=dd([St(2,tt.b),St(3,Ye.Ot),St(4,ni.Z),St(5,z.ez),St(6,he._Y),St(7,Tt.CS)],ud);function bv(r,e,t){return e instanceof z.Xe?r.createInstance(Zn,e,t):e instanceof z.nI?e.item.rememberDefaultAction?r.createInstance(ud,e,t):r.createInstance(cd,e,t):void 0}var Nh=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Mh=function(r,e){return function(t,i){e(t,i,r)}};const Th=(0,he.u1)("IPeekViewService");(0,qi.v)(Th,class{constructor(){this._widgets=new Map}addExclusiveWidget(r,e){const t=this._widgets.get(r);t&&(t.listener.dispose(),t.widget.dispose());const i=()=>{const n=this._widgets.get(r);n&&n.widget===e&&(n.listener.dispose(),this._widgets.delete(r))};this._widgets.set(r,{widget:e,listener:e.onDidClose(i)})}});var ot;(function(r){r.inPeekEditor=new A.N1("inReferenceSearchEditor",!0,g.kg("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),r.notInPeekEditor=r.inPeekEditor.toNegated()})(ot||(ot={}));let os=class{constructor(e,t){e instanceof nn&&ot.inPeekEditor.bindTo(t)}dispose(){}};os.ID="editor.contrib.referenceController",os=Nh([Mh(1,A.fN)],os),(0,_.HW)(os.ID,os);function Sv(r){const e=r.get(Be.T).getFocusedCodeEditor();return e instanceof nn?e.getParentEditor():e}const yv={headerBackgroundColor:ce.Q1.white,primaryHeadingColor:ce.Q1.fromHex("#333333"),secondaryHeadingColor:ce.Q1.fromHex("#6c6c6cb3")};let Tr=class extends gv{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new Z.vl,this.onDidClose=this._onDidClose.event,ts.co(this.options,yv,!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=S.$(".head"),this._bodyElement=S.$(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){const i=S.$(".peekview-title");this.options.supportOnTitleClick&&(i.classList.add("clickable"),S.b2(i,"click",s=>this._onTitleClick(s))),S.BC(this._headElement,i),this._fillTitleIcon(i),this._primaryHeading=S.$("span.filename"),this._secondaryHeading=S.$("span.dirname"),this._metaHeading=S.$("span.meta"),S.BC(i,this._primaryHeading,this._secondaryHeading,this._metaHeading);const n=S.$(".peekview-actions");S.BC(this._headElement,n);const o=this._getActionBarOptions();this._actionbarWidget=new Nr.E(n,o),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new He.rc("peekview.close",g.kg("label.close","Close"),Q.W6.close.classNames,!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:bv.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:S.w_(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,S.WU(this._metaHeading)):S.jD(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const i=Math.ceil(this.editor.getOption(61)*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`)}};Tr=Nh([Mh(2,he._Y)],Tr);const wv=(0,C.x1A)("peekViewTitle.background",{dark:(0,C.JO0)(C.pOz,.1),light:(0,C.JO0)(C.pOz,.1),hcDark:null,hcLight:null},g.kg("peekViewTitleBackground","Background color of the peek view title area.")),Oh=(0,C.x1A)("peekViewTitleLabel.foreground",{dark:ce.Q1.white,light:ce.Q1.black,hcDark:ce.Q1.white,hcLight:C.By2},g.kg("peekViewTitleForeground","Color of the peek view title.")),Fh=(0,C.x1A)("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},g.kg("peekViewTitleInfoForeground","Color of the peek view title info.")),Dv=(0,C.x1A)("peekView.border",{dark:C.pOz,light:C.pOz,hcDark:C.b1q,hcLight:C.b1q},g.kg("peekViewBorder","Color of the peek view borders and arrow.")),xv=(0,C.x1A)("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:ce.Q1.black,hcLight:ce.Q1.white},g.kg("peekViewResultsBackground","Background color of the peek view result list.")),mL=(0,C.x1A)("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:ce.Q1.white,hcLight:C.By2},g.kg("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list.")),_L=(0,C.x1A)("peekViewResult.fileForeground",{dark:ce.Q1.white,light:"#1E1E1E",hcDark:ce.Q1.white,hcLight:C.By2},g.kg("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list.")),vL=(0,C.x1A)("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},g.kg("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list.")),CL=(0,C.x1A)("peekViewResult.selectionForeground",{dark:ce.Q1.white,light:"#6C6C6C",hcDark:ce.Q1.white,hcLight:C.By2},g.kg("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list.")),Or=(0,C.x1A)("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:ce.Q1.black,hcLight:ce.Q1.white},g.kg("peekViewEditorBackground","Background color of the peek view editor.")),bL=(0,C.x1A)("peekViewEditorGutter.background",{dark:Or,light:Or,hcDark:Or,hcLight:Or},g.kg("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor.")),SL=(0,C.x1A)("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},g.kg("peekViewResultsMatchHighlight","Match highlight color in the peek view result list.")),yL=(0,C.x1A)("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},g.kg("peekViewEditorMatchHighlight","Match highlight color in the peek view editor.")),wL=(0,C.x1A)("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:C.buw,hcLight:C.buw},g.kg("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));var ss=f(66638),_e=f(47317),Pt=f(48421),Qt=f(4169),Lv=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};class ki{constructor(e,t,i,n){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=n,this.id=ld.r.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?(0,g.kg)({key:"aria.oneReference.preview",comment:["Placeholders are: 0: filename, 1:line number, 2: column number, 3: preview snippet of source code"]},"symbol in {0} on line {1} at column {2}, {3}",(0,De.P8)(this.uri),this.range.startLineNumber,this.range.startColumn,t.value):(0,g.kg)("aria.oneReference","symbol in {0} on line {1} at column {2}",(0,De.P8)(this.uri),this.range.startLineNumber,this.range.startColumn)}}class kv{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:n,startColumn:o,endLineNumber:s,endColumn:a}=e,l=i.getWordUntilPosition({lineNumber:n,column:o-t}),c=new L.Q(n,l.startColumn,n,o),d=new L.Q(s,a,s,1073741824),u=i.getValueInRange(c).replace(/^\s+/,""),h=i.getValueInRange(e),p=i.getValueInRange(d).replace(/\s+$/,"");return{value:u+h+p,highlight:{start:u.length,end:u.length+h.length}}}}class rs{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new Ji.fT}dispose(){(0,I.AS)(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?(0,g.kg)("aria.fileReferences.1","1 symbol in {0}, full path {1}",(0,De.P8)(this.uri),this.uri.fsPath):(0,g.kg)("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,(0,De.P8)(this.uri),this.uri.fsPath)}resolve(e){return Lv(this,void 0,void 0,function*(){if(this._previews.size!==0)return this;for(const t of this.children)if(!this._previews.has(t.uri))try{const i=yield e.createModelReference(t.uri);this._previews.set(t.uri,new kv(i))}catch(i){(0,K.dz)(i)}return this})}}class dt{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new Z.vl,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;e.sort(dt._compareReferences);let n;for(const o of e)if((!n||!De.er.isEqual(n.uri,o.uri,!0))&&(n=new rs(this,o.uri),this.groups.push(n)),n.children.length===0||dt._compareReferences(o,n.children[n.children.length-1])!==0){const s=new ki(i===o,n,o,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(s),n.children.push(s)}}dispose(){(0,I.AS)(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new dt(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?(0,g.kg)("aria.result.0","No results found"):this.references.length===1?(0,g.kg)("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?(0,g.kg)("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):(0,g.kg)("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 o=i.children.length,s=i.parent.groups.length;return s===1||t&&n+1<o||!t&&n>0?(t?n=(n+1)%o:n=(n+o-1)%o,i.children[n]):(n=i.parent.groups.indexOf(i),t?(n=(n+1)%s,i.parent.groups[n].children[0]):(n=(n+s-1)%s,i.parent.groups[n].children[i.parent.groups[n].children.length-1]))}nearestReference(e,t){const i=this.references.map((n,o)=>({idx:o,prefixLen:G.Qp(n.uri.toString(),e.toString()),offsetDist:Math.abs(n.range.startLineNumber-t.lineNumber)*100+Math.abs(n.range.startColumn-t.column)})).sort((n,o)=>n.prefixLen>o.prefixLen?-1:n.prefixLen<o.prefixLen?1:n.offsetDist<o.offsetDist?-1:n.offsetDist>o.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()&&L.Q.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 De.er.compare(e.uri,t.uri)||L.Q.compareRangesUsingStarts(e.range,t.range)}}var hd=f(67003),Xe=f(13072),gd=f(54957),Iv=f(49233),Rv=f(8431),Ph=f(84431),je=f(97669),as=f(8377),Wh=f(1597),Fr=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},ls=function(r,e){return function(t,i){e(t,i,r)}};let fd=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof dt||e instanceof rs}getChildren(e){if(e instanceof dt)return e.groups;if(e instanceof rs)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};fd=Fr([ls(0,Ft.b)],fd);class Ev{getHeight(){return 23}getTemplateId(e){return e instanceof rs?ds.id:cs.id}}let pd=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof ki){const i=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(i)return i.value}return(0,De.P8)(e.uri)}};pd=Fr([ls(0,tt.b)],pd);class Av{getId(e){return e instanceof ki?e.id:e.uri}}let md=class extends I.jG{constructor(e,t,i){super(),this._labelService=t;const n=document.createElement("div");n.classList.add("reference-file"),this.file=this._register(new Ph.s(n,{supportHighlights:!0})),this.badge=new Iv.x(S.BC(n,S.$(".count"))),this._register((0,Wh.Gd)(this.badge,i)),e.appendChild(n)}set(e,t){const i=(0,De.pD)(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((0,g.kg)("referencesCount","{0} references",n)):this.badge.setTitleFormat((0,g.kg)("referenceCount","{0} reference",n))}};md=Fr([ls(1,as.L),ls(2,U.Gy)],md);let ds=class em{constructor(e){this._instantiationService=e,this.templateId=em.id}renderTemplate(e){return this._instantiationService.createInstance(md,e)}renderElement(e,t,i){i.set(e.element,(0,je.WJ)(e.filterData))}disposeTemplate(e){e.dispose()}};ds.id="FileReferencesRenderer",ds=Fr([ls(0,he._Y)],ds);class Nv{constructor(e){this.label=new Rv._(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(`${(0,De.P8)(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:o,highlight:s}=n;t&&!je.ne.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(o,(0,je.WJ)(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(o,[s]))}}}class cs{constructor(){this.templateId=cs.id}renderTemplate(e){return new Nv(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(){}}cs.id="OneReferenceRenderer";class Mv{getWidgetAriaLabel(){return(0,g.kg)("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var Tv=f(38803),Ov=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},ai=function(r,e){return function(t,i){e(t,i,r)}},Bh=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};class Pr{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new I.Cm,this._callOnModelChange=new I.Cm,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,o=e.children.length;n<o;n++){const s=e.children[n];this._decorationIgnoreSet.has(s.id)||s.uri.toString()===this._editor.getModel().uri.toString()&&(t.push({range:s.range,options:Pr.DecorationOptions}),i.push(n))}this._editor.changeDecorations(n=>{const o=n.deltaDecorations([],t);for(let s=0;s<o.length;s++)this._decorations.set(o[s],e.children[i[s]])})}_onDecorationChanged(){const e=[],t=this._editor.getModel();if(t){for(const[i,n]of this._decorations){const o=t.getDecorationRange(i);if(!o)continue;let s=!1;if(!L.Q.equalsRange(o,n.range)){if(L.Q.spansMultipleLines(o))s=!0;else{const a=n.range.endColumn-n.range.startColumn,l=o.endColumn-o.startColumn;a!==l&&(s=!0)}s?(this._decorationIgnoreSet.add(n.id),e.push(i)):n.range=o}}for(let i=0,n=e.length;i<n;i++)this._decorations.delete(e[i]);this._editor.removeDecorations(e)}}removeDecorations(){this._editor.removeDecorations([...this._decorations.keys()]),this._decorations.clear()}}Pr.DecorationOptions=ge.kI.register({description:"reference-decoration",stickiness:1,className:"reference-decoration"});class Fv{constructor(){this.ratio=.7,this.heightInLines=18}static fromJSON(e){let t,i;try{const n=JSON.parse(e);t=n.ratio,i=n.heightInLines}catch{}return{ratio:t||.7,heightInLines:i||18}}}class Pv extends Qt.er{}let _d=class extends Tr{constructor(e,t,i,n,o,s,a,l,c,d,u,h){super(e,{showFrame:!1,showArrow:!0,isResizeable:!0,isAccessible:!0,supportOnTitleClick:!0},s),this._defaultTreeKeyboardSupport=t,this.layoutData=i,this._textModelResolverService=o,this._instantiationService=s,this._peekViewService=a,this._uriLabel=l,this._undoRedoService=c,this._keybindingService=d,this._languageService=u,this._languageConfigurationService=h,this._disposeOnNewModel=new I.Cm,this._callOnDispose=new I.Cm,this._onDidSelectReference=new Z.vl,this.onDidSelectReference=this._onDidSelectReference.event,this._dim=new S.fg(0,0),this._applyTheme(n.getColorTheme()),this._callOnDispose.add(n.onDidColorThemeChange(this._applyTheme.bind(this))),this._peekViewService.addExclusiveWidget(e,this),this.create()}dispose(){this.setModel(void 0),this._callOnDispose.dispose(),this._disposeOnNewModel.dispose(),(0,I.AS)(this._preview),(0,I.AS)(this._previewNotAvailableMessage),(0,I.AS)(this._tree),(0,I.AS)(this._previewModelReference),this._splitView.dispose(),super.dispose()}_applyTheme(e){const t=e.getColor(Dv)||ce.Q1.transparent;this.style({arrowColor:t,frameColor:t,headerBackgroundColor:e.getColor(wv)||ce.Q1.transparent,primaryHeadingColor:e.getColor(Oh),secondaryHeadingColor:e.getColor(Fh)})}show(e){super.show(e,this.layoutData.heightInLines||18)}focusOnReferenceTree(){this._tree.domFocus()}focusOnPreviewEditor(){this._preview.focus()}isPreviewEditorFocused(){return this._preview.hasTextFocus()}_onTitleClick(e){this._preview&&this._preview.getModel()&&this._onDidSelectReference.fire({element:this._getFocusedReference(),kind:e.ctrlKey||e.metaKey||e.altKey?"side":"open",source:"title"})}_fillBody(e){this.setCssClass("reference-zone-widget"),this._messageContainer=S.BC(e,S.$("div.messages")),S.jD(this._messageContainer),this._splitView=new hd.U(e,{orientation:1}),this._previewContainer=S.BC(e,S.$("div.preview.inline"));const t={scrollBeyondLastLine:!1,scrollbar:{verticalScrollbarSize:14,horizontal:"auto",useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,alwaysConsumeMouseWheel:!1},overviewRulerLanes:2,fixedOverflowWidgets:!0,minimap:{enabled:!1}};this._preview=this._instantiationService.createInstance(nn,this._previewContainer,t,this.editor),S.jD(this._previewContainer),this._previewNotAvailableMessage=new ge.Bz(g.kg("missingPreviewMessage","no preview available"),gd.vH,ge.Bz.DEFAULT_CREATION_OPTIONS,null,this._undoRedoService,this._languageService,this._languageConfigurationService),this._treeContainer=S.BC(e,S.$("div.ref-tree.inline"));const i={keyboardSupport:this._defaultTreeKeyboardSupport,accessibilityProvider:new Mv,keyboardNavigationLabelProvider:this._instantiationService.createInstance(pd),identityProvider:new Av,openOnSingleClick:!0,selectionNavigation:!0,overrideStyles:{listBackground:xv}};this._defaultTreeKeyboardSupport&&this._callOnDispose.add(S.b2(this._treeContainer,"keydown",o=>{o.equals(9)&&(this._keybindingService.dispatchEvent(o,o.target),o.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(Pv,"ReferencesWidget",this._treeContainer,new Ev,[this._instantiationService.createInstance(ds),this._instantiationService.createInstance(cs)],this._instantiationService.createInstance(fd),i),this._splitView.addView({onDidChange:Z.Jh.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:o=>{this._preview.layout({height:this._dim.height,width:o})}},hd.X.Distribute),this._splitView.addView({onDidChange:Z.Jh.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:o=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${o}px`,this._tree.layout(this._dim.height,o)}},hd.X.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const n=(o,s)=>{o instanceof ki&&(s==="show"&&this._revealReference(o,!1),this._onDidSelectReference.fire({element:o,kind:s,source:"tree"}))};this._tree.onDidOpen(o=>{o.sideBySide?n(o.element,"side"):o.editorOptions.pinned?n(o.element,"goto"):n(o.element,"show")}),S.jD(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new S.fg(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=g.kg("noResults","No results"),S.WU(this._messageContainer),Promise.resolve(void 0)):(S.jD(this._messageContainer),this._decorationsManager=new Pr(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"),S.WU(this._treeContainer),S.WU(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 ki)return e;if(e instanceof rs&&e.children.length>0)return e.children[0]}revealReference(e){return Bh(this,void 0,void 0,function*(){yield this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})})}_revealReference(e,t){return Bh(this,void 0,void 0,function*(){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==Xe.ny.inMemory?this.setTitle((0,De.Pi)(e.uri),this._uriLabel.getUriLabel((0,De.pD)(e.uri))):this.setTitle(g.kg("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),yield this._tree.expand(e.parent),this._tree.reveal(e));const n=yield i;if(!this._model){n.dispose();return}(0,I.AS)(this._previewModelReference);const o=n.object;if(o){const s=this._preview.getModel()===o.textEditorModel?0:1,a=L.Q.lift(e.range).collapseToStart();this._previewModelReference=n,this._preview.setModel(o.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,s)}else this._preview.setModel(this._previewNotAvailableMessage),n.dispose()})}};_d=Ov([ai(3,U.Gy),ai(4,Ft.b),ai(5,he._Y),ai(6,Th),ai(7,as.L),ai(8,Tv.$D),ai(9,tt.b),ai(10,xt.L),ai(11,it.JZ)],_d);var Wv=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Yn=function(r,e){return function(t,i){e(t,i,r)}},Hh=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};const on=new A.N1("referenceSearchVisible",!1,g.kg("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let Ii=class Tu{constructor(e,t,i,n,o,s,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=n,this._notificationService=o,this._instantiationService=s,this._storageService=a,this._configurationService=l,this._disposables=new I.Cm,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=on.bindTo(i)}static get(e){return e.getContribution(Tu.ID)}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 o="peekViewLayout",s=Fv.fromJSON(this._storageService.get(o,0,"{}"));this._widget=this._instantiationService.createInstance(_d,this._editor,this._defaultTreeKeyboardSupport,s),this._widget.setTitle(g.kg("labelLoading","Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store(o,JSON.stringify(this._widget.layoutData),0,1),this._widget=void 0),this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(l=>{const{element:c,kind:d}=l;if(c)switch(d){case"open":(l.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(c,!1,!1);break;case"side":this.openReference(c,!0,!1);break;case"goto":i?this._gotoReference(c):this.openReference(c,!1,!0);break}}));const a=++this._requestIdPool;t.then(l=>{var c;if(a!==this._requestIdPool||!this._widget){l.dispose();return}return(c=this._model)===null||c===void 0||c.dispose(),this._model=l,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(g.kg("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));const d=this._editor.getModel().uri,u=new ee.y(e.startLineNumber,e.startColumn),h=this._model.nearestReference(d,u);if(h)return this._widget.setSelection(h).then(()=>{this._widget&&this._editor.getOption(79)==="editor"&&this._widget.focusOnPreviewEditor()})}})},l=>{this._notificationService.error(l)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}goToNextOrPreviousReference(e){return Hh(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const i=this._model.nearestReference(this._editor.getModel().uri,t);if(!i)return;const n=this._model.nextOrPreviousReference(i,e),o=this._editor.hasTextFocus(),s=this._widget.isPreviewEditorFocused();yield this._widget.setSelection(n),yield this._gotoReference(n),o?this._editor.focus():this._widget&&s&&this._widget.focusOnPreviewEditor()})}revealReference(e){return Hh(this,void 0,void 0,function*(){!this._editor.hasModel()||!this._model||!this._widget||(yield 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){this._widget&&this._widget.hide(),this._ignoreModelChangeEvent=!0;const t=L.Q.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:t,selectionSource:"code.jump"}},this._editor).then(i=>{var n;if(this._ignoreModelChangeEvent=!1,!i||!this._widget){this.closeWidget();return}if(this._editor===i)this._widget.show(t),this._widget.focusOnReferenceTree();else{const o=Tu.get(i),s=this._model.clone();this.closeWidget(),i.focus(),o?.toggleWidget(t,(0,V.SS)(a=>Promise.resolve(s)),(n=this._peekMode)!==null&&n!==void 0?n:!1)}},i=>{this._ignoreModelChangeEvent=!1,(0,K.dz)(i)})}openReference(e,t,i){t||this.closeWidget();const{uri:n,range:o}=e;this._editorService.openCodeEditor({resource:n,options:{selection:o,selectionSource:"code.jump",pinned:i}},this._editor,t)}};Ii.ID="editor.contrib.referencesController",Ii=Wv([Yn(2,A.fN),Yn(3,Be.T),Yn(4,Ye.Ot),Yn(5,he._Y),Yn(6,Tt.CS),Yn(7,Fe.pG)],Ii);function sn(r,e){const t=Sv(r);if(!t)return;const i=Ii.get(t);i&&e(i)}Pt.f.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:(0,Ee.m5)(2089,60),when:A.M$.or(on,ot.inPeekEditor),handler(r){sn(r,e=>{e.changeFocusBetweenPreviewAndReferences()})}}),Pt.f.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:A.M$.or(on,ot.inPeekEditor),handler(r){sn(r,e=>{e.goToNextOrPreviousReference(!0)})}}),Pt.f.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:A.M$.or(on,ot.inPeekEditor),handler(r){sn(r,e=>{e.goToNextOrPreviousReference(!1)})}}),fe.wb.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference"),fe.wb.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference"),fe.wb.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch"),fe.wb.registerCommand("closeReferenceSearch",r=>sn(r,e=>e.closeWidget())),Pt.f.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:A.M$.and(ot.inPeekEditor,A.M$.not("config.editor.stablePeek"))}),Pt.f.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:A.M$.and(on,A.M$.not("config.editor.stablePeek"))}),Pt.f.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:A.M$.and(on,Qt.YD,Qt.Nf.negate(),Qt.cH.negate()),handler(r){var e;const i=(e=r.get(Qt.PE).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof ki&&sn(r,n=>n.revealReference(i[0]))}}),Pt.f.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:A.M$.and(on,Qt.YD,Qt.Nf.negate(),Qt.cH.negate()),handler(r){var e;const i=(e=r.get(Qt.PE).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof ki&&sn(r,n=>n.openReference(i[0],!0,!0))}}),fe.wb.registerCommand("openReference",r=>{var e;const i=(e=r.get(Qt.PE).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof ki&&sn(r,n=>n.openReference(i[0],!1,!0))});var Vh=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},us=function(r,e){return function(t,i){e(t,i,r)}};const vd=new A.N1("hasSymbols",!1,(0,g.kg)("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),Wr=(0,he.u1)("ISymbolNavigationService");let Cd=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=vd.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 bd(this._editorService),n=i.onDidChange(o=>{if(this._ignoreEditorChange)return;const s=this._editorService.getActiveCodeEditor();if(!s)return;const a=s.getModel(),l=s.getPosition();if(!a||!l)return;let c=!1,d=!1;for(const u of t.references)if((0,De.n4)(u.uri,a.uri))c=!0,d=d||L.Q.containsPosition(u.range,l);else if(c)break;(!c||!d)&&this.reset()});this._currentState=(0,I.qE)(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:L.Q.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?(0,g.kg)("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):(0,g.kg)("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(i)}};Cd=Vh([us(0,A.fN),us(1,Be.T),us(2,Ye.Ot),us(3,tt.b)],Cd),(0,qi.v)(Wr,Cd,!0),(0,_.E_)(new class extends _.DX{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:vd,kbOpts:{weight:100,primary:70}})}runEditorCommand(r,e){return r.get(Wr).revealNext(e)}}),Pt.f.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:vd,primary:9,handler(r){r.get(Wr).reset()}});let bd=class{constructor(e){this._listener=new Map,this._disposables=new I.Cm,this._onDidChange=new Z.vl,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(),(0,I.AS)(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,(0,I.qE)(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)}};bd=Vh([us(0,Be.T)],bd);var Uh=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};function hs(r,e,t,i){const o=t.ordered(r).map(s=>Promise.resolve(i(s,r,e)).then(void 0,a=>{(0,K.M_)(a)}));return Promise.all(o).then(s=>{const a=[];for(const l of s)Array.isArray(l)?a.push(...l):l&&a.push(l);return a})}function Sd(r,e,t,i){return hs(e,t,r,(n,o,s)=>n.provideDefinition(o,s,i))}function zh(r,e,t,i){return hs(e,t,r,(n,o,s)=>n.provideDeclaration(o,s,i))}function $h(r,e,t,i){return hs(e,t,r,(n,o,s)=>n.provideImplementation(o,s,i))}function jh(r,e,t,i){return hs(e,t,r,(n,o,s)=>n.provideTypeDefinition(o,s,i))}function Br(r,e,t,i,n){return hs(e,t,r,(o,s,a)=>Uh(this,void 0,void 0,function*(){const l=yield o.provideReferences(s,a,{includeDeclaration:!0},n);if(!i||!l||l.length!==2)return l;const c=yield o.provideReferences(s,a,{includeDeclaration:!1},n);return c&&c.length===1?c:l}))}function gs(r){return Uh(this,void 0,void 0,function*(){const e=yield r(),t=new dt(e,""),i=t.references.map(n=>n.link);return t.dispose(),i})}(0,_.ke)("_executeDefinitionProvider",(r,e,t)=>{const i=r.get(te.u),n=Sd(i.definitionProvider,e,t,re.X.None);return gs(()=>n)}),(0,_.ke)("_executeTypeDefinitionProvider",(r,e,t)=>{const i=r.get(te.u),n=jh(i.typeDefinitionProvider,e,t,re.X.None);return gs(()=>n)}),(0,_.ke)("_executeDeclarationProvider",(r,e,t)=>{const i=r.get(te.u),n=zh(i.declarationProvider,e,t,re.X.None);return gs(()=>n)}),(0,_.ke)("_executeReferenceProvider",(r,e,t)=>{const i=r.get(te.u),n=Br(i.referenceProvider,e,t,!1,re.X.None);return gs(()=>n)}),(0,_.ke)("_executeImplementationProvider",(r,e,t)=>{const i=r.get(te.u),n=$h(i.implementationProvider,e,t,re.X.None);return gs(()=>n)});var Lt=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})},yd,wd,Dd,xd,Ld,kd,Id,Rd;z.ZG.appendMenuItem(z.D8.EditorContext,{submenu:z.D8.EditorContextPeek,title:g.kg("peek.submenu","Peek"),group:"navigation",order:100});const Gh=new Set;function Wt(r){const e=new r;return(0,_.xX)(e),Gh.add(e.id),e}class fs{constructor(e,t){this.model=e,this.position=t}static is(e){return!e||typeof e!="object"?!1:!!(e instanceof fs||ee.y.isIPosition(e.position)&&e.model)}}class kt extends _.ks{constructor(e,t){super(t),this.configuration=e}run(e,t,i){if(!t.hasModel())return Promise.resolve(void 0);const n=e.get(Ye.Ot),o=e.get(Be.T),s=e.get(Dt.N8),a=e.get(Wr),l=e.get(te.u),c=t.getModel(),d=t.getPosition(),u=fs.is(i)?i:new fs(c,d),h=new Di.gI(t,5),p=(0,V.PK)(this._getLocationModel(l,u.model,u.position,h.token),h.token).then(m=>Lt(this,void 0,void 0,function*(){var v;if(!m||h.token.isCancellationRequested)return;(0,ft.xE)(m.ariaMessage);let w;if(m.referenceAt(c.uri,d)){const T=this._getAlternativeCommand(t);!kt._activeAlternativeCommands.has(T)&&Gh.has(T)&&(w=t.getAction(T))}const R=m.references.length;if(R===0){if(!this.configuration.muteMessage){const T=c.getWordAtPosition(d);(v=lt.get(t))===null||v===void 0||v.showMessage(this._getNoResultFoundMessage(T),d)}}else if(R===1&&w)kt._activeAlternativeCommands.add(this.id),w.run().finally(()=>{kt._activeAlternativeCommands.delete(this.id)});else return this._onResult(o,a,t,m)}),m=>{n.error(m)}).finally(()=>{h.dispose()});return s.showWhile(p,250),p}_onResult(e,t,i,n){return Lt(this,void 0,void 0,function*(){const o=this._getGoToPreference(i);if(!(i instanceof nn)&&(this.configuration.openInPeek||o==="peek"&&n.references.length>1))this._openInPeek(i,n);else{const s=n.firstReference(),a=n.references.length>1&&o==="gotoAndPeek",l=yield this._openReference(i,e,s,this.configuration.openToSide,!a);a&&l?this._openInPeek(l,n):n.dispose(),o==="goto"&&t.put(s)}})}_openReference(e,t,i,n,o){return Lt(this,void 0,void 0,function*(){let s;if((0,_e.Iu)(i)&&(s=i.targetSelectionRange),s||(s=i.range),!s)return;const a=yield t.openCodeEditor({resource:i.uri,options:{selection:L.Q.collapseToStart(s),selectionRevealType:3,selectionSource:"code.jump"}},e,n);if(a){if(o){const l=a.getModel(),c=a.createDecorationsCollection([{range:s,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&c.clear()},350)}return a}})}_openInPeek(e,t){const i=Ii.get(e);i&&e.hasModel()?i.toggleWidget(e.getSelection(),(0,V.SS)(n=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}kt._activeAlternativeCommands=new Set;class ps extends kt{_getLocationModel(e,t,i,n){return Lt(this,void 0,void 0,function*(){return new dt(yield Sd(e.definitionProvider,t,i,n),g.kg("def.title","Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?g.kg("noResultWord","No definition found for '{0}'",e.word):g.kg("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(53).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(53).multipleDefinitions}}const Kh=Se.HZ&&!(0,Ol.isStandalone)()?2118:70;Wt((yd=class Ou extends ps{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:Ou.id,label:g.kg("actions.goToDecl.label","Go to Definition"),alias:"Go to Definition",precondition:A.M$.and(D.R.hasDefinitionProvider,D.R.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:D.R.editorTextFocus,primary:Kh,weight:100},contextMenuOpts:{group:"navigation",order:1.1}}),fe.wb.registerCommandAlias("editor.action.goToDeclaration",Ou.id)}},yd.id="editor.action.revealDefinition",yd)),Wt((wd=class Fu extends ps{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:Fu.id,label:g.kg("actions.goToDeclToSide.label","Open Definition to the Side"),alias:"Open Definition to the Side",precondition:A.M$.and(D.R.hasDefinitionProvider,D.R.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:D.R.editorTextFocus,primary:(0,Ee.m5)(2089,Kh),weight:100}}),fe.wb.registerCommandAlias("editor.action.openDeclarationToTheSide",Fu.id)}},wd.id="editor.action.revealDefinitionAside",wd)),Wt((Dd=class Pu extends ps{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:Pu.id,label:g.kg("actions.previewDecl.label","Peek Definition"),alias:"Peek Definition",precondition:A.M$.and(D.R.hasDefinitionProvider,ot.notInPeekEditor,D.R.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:D.R.editorTextFocus,primary:582,linux:{primary:3140},weight:100},contextMenuOpts:{menuId:z.D8.EditorContextPeek,group:"peek",order:2}}),fe.wb.registerCommandAlias("editor.action.previewDeclaration",Pu.id)}},Dd.id="editor.action.peekDefinition",Dd));class Qh extends kt{_getLocationModel(e,t,i,n){return Lt(this,void 0,void 0,function*(){return new dt(yield zh(e.declarationProvider,t,i,n),g.kg("decl.title","Declarations"))})}_getNoResultFoundMessage(e){return e&&e.word?g.kg("decl.noResultWord","No declaration found for '{0}'",e.word):g.kg("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(53).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(53).multipleDeclarations}}Wt((xd=class tm extends Qh{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:tm.id,label:g.kg("actions.goToDeclaration.label","Go to Declaration"),alias:"Go to Declaration",precondition:A.M$.and(D.R.hasDeclarationProvider,D.R.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{group:"navigation",order:1.3}})}_getNoResultFoundMessage(e){return e&&e.word?g.kg("decl.noResultWord","No declaration found for '{0}'",e.word):g.kg("decl.generic.noResults","No declaration found")}},xd.id="editor.action.revealDeclaration",xd)),Wt(class extends Qh{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",label:g.kg("actions.peekDecl.label","Peek Declaration"),alias:"Peek Declaration",precondition:A.M$.and(D.R.hasDeclarationProvider,ot.notInPeekEditor,D.R.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{menuId:z.D8.EditorContextPeek,group:"peek",order:3}})}});class Zh extends kt{_getLocationModel(e,t,i,n){return Lt(this,void 0,void 0,function*(){return new dt(yield jh(e.typeDefinitionProvider,t,i,n),g.kg("typedef.title","Type Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?g.kg("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):g.kg("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(53).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(53).multipleTypeDefinitions}}Wt((Ld=class im extends Zh{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:im.ID,label:g.kg("actions.goToTypeDefinition.label","Go to Type Definition"),alias:"Go to Type Definition",precondition:A.M$.and(D.R.hasTypeDefinitionProvider,D.R.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:D.R.editorTextFocus,primary:0,weight:100},contextMenuOpts:{group:"navigation",order:1.4}})}},Ld.ID="editor.action.goToTypeDefinition",Ld)),Wt((kd=class nm extends Zh{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:nm.ID,label:g.kg("actions.peekTypeDefinition.label","Peek Type Definition"),alias:"Peek Type Definition",precondition:A.M$.and(D.R.hasTypeDefinitionProvider,ot.notInPeekEditor,D.R.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{menuId:z.D8.EditorContextPeek,group:"peek",order:4}})}},kd.ID="editor.action.peekTypeDefinition",kd));class Yh extends kt{_getLocationModel(e,t,i,n){return Lt(this,void 0,void 0,function*(){return new dt(yield $h(e.implementationProvider,t,i,n),g.kg("impl.title","Implementations"))})}_getNoResultFoundMessage(e){return e&&e.word?g.kg("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):g.kg("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(53).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(53).multipleImplementations}}Wt((Id=class om extends Yh{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:om.ID,label:g.kg("actions.goToImplementation.label","Go to Implementations"),alias:"Go to Implementations",precondition:A.M$.and(D.R.hasImplementationProvider,D.R.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:D.R.editorTextFocus,primary:2118,weight:100},contextMenuOpts:{group:"navigation",order:1.45}})}},Id.ID="editor.action.goToImplementation",Id)),Wt((Rd=class sm extends Yh{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:sm.ID,label:g.kg("actions.peekImplementation.label","Peek Implementations"),alias:"Peek Implementations",precondition:A.M$.and(D.R.hasImplementationProvider,ot.notInPeekEditor,D.R.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:D.R.editorTextFocus,primary:3142,weight:100},contextMenuOpts:{menuId:z.D8.EditorContextPeek,group:"peek",order:5}})}},Rd.ID="editor.action.peekImplementation",Rd));class Xh extends kt{_getNoResultFoundMessage(e){return e?g.kg("references.no","No references found for '{0}'",e.word):g.kg("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(53).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(53).multipleReferences}}Wt(class extends Xh{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",label:g.kg("goToReferences.label","Go to References"),alias:"Go to References",precondition:A.M$.and(D.R.hasReferenceProvider,ot.notInPeekEditor,D.R.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:D.R.editorTextFocus,primary:1094,weight:100},contextMenuOpts:{group:"navigation",order:1.45}})}_getLocationModel(e,t,i,n){return Lt(this,void 0,void 0,function*(){return new dt(yield Br(e.referenceProvider,t,i,!0,n),g.kg("ref.title","References"))})}}),Wt(class extends Xh{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",label:g.kg("references.action.label","Peek References"),alias:"Peek References",precondition:A.M$.and(D.R.hasReferenceProvider,ot.notInPeekEditor,D.R.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{menuId:z.D8.EditorContextPeek,group:"peek",order:6}})}_getLocationModel(e,t,i,n){return Lt(this,void 0,void 0,function*(){return new dt(yield Br(e.referenceProvider,t,i,!1,n),g.kg("ref.title","References"))})}});class Bv extends kt{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",label:g.kg("label.generic","Go to Any Symbol"),alias:"Go to Any Symbol",precondition:A.M$.and(ot.notInPeekEditor,D.R.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}_getLocationModel(e,t,i,n){return Lt(this,void 0,void 0,function*(){return new dt(this._references,g.kg("generic.title","Locations"))})}_getNoResultFoundMessage(e){return e&&g.kg("generic.noResult","No results for '{0}'",e.word)||""}_getGoToPreference(e){var t;return(t=this._gotoMultipleBehaviour)!==null&&t!==void 0?t:e.getOption(53).multipleReferences}_getAlternativeCommand(){return""}}fe.wb.registerCommand({id:"editor.action.goToLocations",description:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:me.r},{name:"position",description:"The position at which to start",constraint:ee.y.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:(r,e,t,i,n,o,s)=>Lt(void 0,void 0,void 0,function*(){(0,le.j)(me.r.isUri(e)),(0,le.j)(ee.y.isIPosition(t)),(0,le.j)(Array.isArray(i)),(0,le.j)(typeof n>"u"||typeof n=="string"),(0,le.j)(typeof s>"u"||typeof s=="boolean");const a=r.get(Be.T),l=yield a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if((0,ss.z9)(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(c=>{const d=new class extends Bv{_getNoResultFoundMessage(u){return o||super._getNoResultFoundMessage(u)}}({muteMessage:!o,openInPeek:!!s,openToSide:!1},i,n);c.get(he._Y).invokeFunction(d.run.bind(d),l)})})}),fe.wb.registerCommand({id:"editor.action.peekLocations",description:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:me.r},{name:"position",description:"The position at which to start",constraint:ee.y.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:(r,e,t,i,n)=>Lt(void 0,void 0,void 0,function*(){r.get(fe.wT).executeCommand("editor.action.goToLocations",e,t,i,n,void 0,!0)})}),fe.wb.registerCommand({id:"editor.action.findReferences",handler:(r,e,t)=>{(0,le.j)(me.r.isUri(e)),(0,le.j)(ee.y.isIPosition(t));const i=r.get(te.u),n=r.get(Be.T);return n.openCodeEditor({resource:e},n.getFocusedCodeEditor()).then(o=>{if(!(0,ss.z9)(o)||!o.hasModel())return;const s=Ii.get(o);if(!s)return;const a=(0,V.SS)(c=>Br(i.referenceProvider,o.getModel(),ee.y.lift(t),!1,c).then(d=>new dt(d,g.kg("ref.title","References")))),l=new L.Q(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(s.toggleWidget(l,a,!1))})}}),fe.wb.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations"),z.ZG.appendMenuItems([{id:z.D8.MenubarGoMenu,item:{command:{id:"editor.action.revealDefinition",title:g.kg({key:"miGotoDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Definition")},group:"4_symbol_nav",order:2}},{id:z.D8.MenubarGoMenu,item:{command:{id:"editor.action.revealDeclaration",title:g.kg({key:"miGotoDeclaration",comment:["&& denotes a mnemonic"]},"Go to &&Declaration")},group:"4_symbol_nav",order:3}},{id:z.D8.MenubarGoMenu,item:{command:{id:"editor.action.goToTypeDefinition",title:g.kg({key:"miGotoTypeDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Type Definition")},group:"4_symbol_nav",order:3}},{id:z.D8.MenubarGoMenu,item:{command:{id:"editor.action.goToImplementation",title:g.kg({key:"miGotoImplementation",comment:["&& denotes a mnemonic"]},"Go to &&Implementations")},group:"4_symbol_nav",order:4}},{id:z.D8.MenubarGoMenu,item:{command:{id:"editor.action.goToReferences",title:g.kg({key:"miGotoReference",comment:["&& denotes a mnemonic"]},"Go to &&References")},group:"4_symbol_nav",order:5}}]);var Hv=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Ed=function(r,e){return function(t,i){e(t,i,r)}};let rn=class ml{constructor(e,t,i,n){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=n,this.toUnhook=new I.Cm,this.toUnhookForKeyboard=new I.Cm,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const o=new ad(e);this.toUnhook.add(o),this.toUnhook.add(o.onMouseMoveOrRelevantKeyDown(([s,a])=>{this.startFindDefinitionFromMouse(s,(0,le.UH)(a))})),this.toUnhook.add(o.onExecute(s=>{this.isEnabled(s)&&this.gotoDefinition(s.target.position,s.hasSideBySideModifier).then(()=>{this.removeLinkDecorations()},a=>{this.removeLinkDecorations(),(0,K.dz)(a)})})),this.toUnhook.add(o.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(ml.ID)}startFindDefinitionFromCursor(e){return this.startFindDefinition(e).then(()=>{this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()})),this.toUnhookForKeyboard.add(this.editor.onKeyDown(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)}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)return this.currentWordAtPosition=null,this.removeLinkDecorations(),Promise.resolve(0);if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===i.startColumn&&this.currentWordAtPosition.endColumn===i.endColumn&&this.currentWordAtPosition.word===i.word)return Promise.resolve(0);this.currentWordAtPosition=i;const n=new Di.$t(this.editor,15);return this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=(0,V.SS)(o=>this.findDefinition(e,o)),this.previousPromise.then(o=>{if(!o||!o.length||!n.validate(this.editor)){this.removeLinkDecorations();return}if(o.length>1)this.addDecoration(new L.Q(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn),new xe.Bc().appendText(g.kg("multipleResults","Click to show {0} definitions.",o.length)));else{const s=o[0];if(!s.uri)return;this.textModelResolverService.createModelReference(s.uri).then(a=>{if(!a.object||!a.object.textEditorModel){a.dispose();return}const{object:{textEditorModel:l}}=a,{startLineNumber:c}=s.range;if(c<1||c>l.getLineCount()){a.dispose();return}const d=this.getPreviewValue(l,c,s);let u;s.originSelectionRange?u=L.Q.lift(s.originSelectionRange):u=new L.Q(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn);const h=this.languageService.guessLanguageIdByFilepathOrFirstLine(l.uri);this.addDecoration(u,new xe.Bc().appendCodeblock(h||"",d)),a.dispose()})}}).then(void 0,K.dz)}getPreviewValue(e,t,i){let n=i.range;return n.endLineNumber-n.startLineNumber>=ml.MAX_SOURCE_PREVIEW_LINES&&(n=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,n)}stripIndentationFromPreviewRange(e,t,i){let o=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a<i.endLineNumber;a++){const l=e.getLineFirstNonWhitespaceColumn(a);o=Math.min(o,l)}return e.getValueInRange(i).replace(new RegExp(`^\\s{${o-1}}`,"gm"),"").trim()}getPreviewRangeBasedOnIndentation(e,t){const i=e.getLineFirstNonWhitespaceColumn(t),n=Math.min(e.getLineCount(),t+ml.MAX_SOURCE_PREVIEW_LINES);let o=t+1;for(;o<n;o++){const s=e.getLineFirstNonWhitespaceColumn(o);if(i===s)break}return new L.Q(t,1,o+1,1)}addDecoration(e,t){const i={range:e,options:{description:"goto-definition-link",inlineClassName:"goto-definition-link",hoverMessage:t}};this.linkDecorations.set([i])}removeLinkDecorations(){this.linkDecorations.clear()}isEnabled(e,t){return this.editor.hasModel()&&e.isNoneOrSingleMouseDown&&e.target.type===6&&(e.hasTriggerModifier||(t?t.keyCodeIsTriggerKey:!1))&&this.languageFeaturesService.definitionProvider.has(this.editor.getModel())}findDefinition(e,t){const i=this.editor.getModel();return i?Sd(this.languageFeaturesService.definitionProvider,i,e,t):Promise.resolve(null)}gotoDefinition(e,t){return this.editor.setPosition(e),this.editor.invokeWithinContext(i=>{const n=!t&&this.editor.getOption(80)&&!this.isInPeekEditor(i);return new ps({openToSide:t,openInPeek:n,muteMessage:!0},{alias:"",label:"",id:"",precondition:void 0}).run(i,this.editor)})}isInPeekEditor(e){const t=e.get(A.fN);return ot.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose()}};rn.ID="editor.contrib.gotodefinitionatposition",rn.MAX_SOURCE_PREVIEW_LINES=8,rn=Hv([Ed(1,Ft.b),Ed(2,xt.L),Ed(3,te.u)],rn),(0,_.HW)(rn.ID,rn),(0,U.zy)((r,e)=>{const t=r.getColor(C.Ztu);t&&e.addRule(`.monaco-editor .goto-definition-link { color: ${t} !important; }`)});var Hr=f(63781);const Vr=S.$;class Jh extends I.jG{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 Hr.MU(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class Ad extends I.jG{constructor(e,t,i){super(),this.actionContainer=S.BC(e,Vr("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=S.BC(this.actionContainer,Vr("a.action")),this.action.setAttribute("role","button"),t.iconClass&&S.BC(this.action,Vr(`span.icon.${t.iconClass}`));const n=S.BC(this.action,Vr("span"));n.textContent=i?`${t.label} (${i})`:t.label,this._register(S.ko(this.actionContainer,S.Bx.CLICK,o=>{o.stopPropagation(),o.preventDefault(),t.run(this.actionContainer)})),this._register(S.ko(this.actionContainer,S.Bx.KEY_UP,o=>{new is.Z(o).equals(3)&&(o.stopPropagation(),o.preventDefault(),t.run(this.actionContainer))})),this.setEnabled(!0)}static render(e,t,i){return new Ad(e,t,i)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}var Vv=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})},Uv=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof __values=="function"?__values(r):r[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(o){t[o]=r[o]&&function(s){return new Promise(function(a,l){s=r[o](s),n(a,l,s.done,s.value)})}}function n(o,s,a,l){Promise.resolve(l).then(function(c){o({value:c,done:a})},s)}};class zv{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}}class qh extends I.jG{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new Z.vl),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new V.uC(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new V.uC(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new V.uC(()=>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(55).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=(0,V.bI)(e=>this._computer.computeAsync(e)),Vv(this,void 0,void 0,function*(){var e,t;try{try{for(var i=Uv(this._asyncIterable),n;n=yield i.next(),!n.done;){const o=n.value;o&&(this._result.push(o),this._fireResult())}}catch(o){e={error:o}}finally{try{n&&!n.done&&(t=i.return)&&(yield t.call(i))}finally{if(e)throw e.error}}this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0)}catch(o){(0,K.dz)(o)}})):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 zv(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 Nd{constructor(e,t){this.priority=e,this.range=t,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 Ur{constructor(e,t,i){this.priority=e,this.owner=t,this.range=i,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 an=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class It{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};const e=this.pos;let t=0,i=this.value.charCodeAt(e),n;if(n=It._table[i],typeof n=="number")return this.pos+=1,{type:n,pos:e,len:1};if(It.isDigitCharacter(i)){n=8;do t+=1,i=this.value.charCodeAt(e+t);while(It.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}if(It.isVariableCharacter(i)){n=9;do i=this.value.charCodeAt(e+ ++t);while(It.isVariableCharacter(i)||It.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}n=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof It._table[i]>"u"&&!It.isDigitCharacter(i)&&!It.isVariableCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}}It._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};class Xn{constructor(){this._children=[]}appendChild(e){return e instanceof st&&this._children[this._children.length-1]instanceof st?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,n=i.children.indexOf(e),o=i.children.slice(0);o.splice(n,1,...t),i._children=o,function s(a,l){for(const c of a)c.parent=l,s(c.children,c)}(t,i)}get children(){return this._children}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof _s)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class st extends Xn{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new st(this.value)}}class eg extends Xn{}class Rt extends eg{constructor(e){super(),this.index=e}static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.index<t.index?-1:e.index>t.index?1:0}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof Jn?this._children[0]:void 0}clone(){const e=new Rt(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class Jn extends Xn{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof st&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new Jn;return this.options.forEach(e.appendChild,e),e}}class Md extends Xn{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,n=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(o=>o instanceof Bt&&!!o.elseValue)&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof Bt){let n=e[i.index]||"";n=i.resolve(n),t+=n}else t+=i.toString();return t}toString(){return""}clone(){const e=new Md;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}}class Bt extends Xn{constructor(e,t,i,n){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=n}resolve(e){return this.shorthandName==="upcase"?e?e.toLocaleUpperCase():"":this.shorthandName==="downcase"?e?e.toLocaleLowerCase():"":this.shorthandName==="capitalize"?e?e[0].toLocaleUpperCase()+e.substr(1):"":this.shorthandName==="pascalcase"?e?this._toPascalCase(e):"":this.shorthandName==="camelcase"?e?this._toCamelCase(e):"":e&&typeof this.ifValue=="string"?this.ifValue:!e&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(i=>i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((i,n)=>n===0?i.charAt(0).toLowerCase()+i.substr(1):i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}clone(){return new Bt(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class ms extends eg{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),t!==void 0?(this._children=[new st(t)],!0):!1}clone(){const e=new ms(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function tg(r,e){const t=[...r];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class _s extends Xn{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof Rt&&(e.push(i),t=!t||t.index<i.index?i:t),!0}),this._placeholders={all:e,last:t}}return this._placeholders}get placeholders(){const{all:e}=this.placeholderInfo;return e}offset(e){let t=0,i=!1;return this.walk(n=>n===e?(i=!0,!1):(t+=n.len(),!0)),i?t:-1}fullLen(e){let t=0;return tg([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof Rt&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof ms&&t.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){const e=new _s;return this._children=this.children.map(t=>t.clone()),e}walk(e){tg(this.children,e)}}class Ri{constructor(){this._scanner=new It,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){const n=new _s;return this.parseFragment(e,n),this.ensureFinalTabstop(n,i??!1,t??!1),n}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const n=new Map,o=[];t.walk(s=>(s instanceof Rt&&(s.isFinalTabstop?n.set(0,void 0):!n.has(s.index)&&s.children.length>0?n.set(s.index,s.children):o.push(s)),!0));for(const s of o){const a=n.get(s.index);if(a){const l=new Rt(s.index);l.transform=s.transform;for(const c of a)l.appendChild(c.clone());t.replace(s,[l])}}return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(o=>o.index===0)||e.appendChild(new Rt(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){const n=this._scanner.next();if(n.type!==0&&n.type!==4&&n.type!==5)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new st(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new Rt(Number(t)):new ms(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const o=new Rt(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new st("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else if(o.index>0&&this._accept(7)){const s=new Jn;for(;;){if(this._parseChoiceElement(s)){if(this._accept(2))continue;if(this._accept(7)&&(o.appendChild(s),this._accept(4)))return e.appendChild(o),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===2||this._token.type===7);){let n;if((n=this._accept(5,!0))?n=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||n:n=this._accept(void 0,!0),!n)return this._backTo(t),!1;i.push(n)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new st(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const o=new ms(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new st("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(i)}_parseTransform(e){const t=new Md;let i="",n="";for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(6,!0)||o,i+=o;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(5,!0)||this._accept(6,!0)||o,t.appendChild(new st(o));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){n+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,n)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);const n=this._accept(8,!0);if(n)if(i){if(this._accept(4))return e.appendChild(new Bt(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new Bt(Number(n))),!0;else return this._backTo(t),!1;if(this._accept(6)){const o=this._accept(9,!0);return!o||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new Bt(Number(n),o)),!0)}else if(this._accept(11)){const o=this._until(4);if(o)return e.appendChild(new Bt(Number(n),void 0,o,void 0)),!0}else if(this._accept(12)){const o=this._until(4);if(o)return e.appendChild(new Bt(Number(n),void 0,void 0,o)),!0}else if(this._accept(13)){const o=this._until(1);if(o){const s=this._until(4);if(s)return e.appendChild(new Bt(Number(n),void 0,o,s)),!0}}else{const o=this._until(4);if(o)return e.appendChild(new Bt(Number(n),void 0,void 0,o)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new st(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}var $v=f(6595),ig=f(72966),jv=f(29004);const Gv=g.kg("defaultLabel","input"),Kv=g.kg("label.preserveCaseToggle","Preserve Case");class Qv extends ig.l{constructor(e){super({icon:Q.W6.preserveCase,title:Kv+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Zv extends Kn.x{constructor(e,t,i,n){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new Z.vl),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new Z.vl),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new Z.vl),this._onInput=this._register(new Z.vl),this._onKeyUp=this._register(new Z.vl),this._onPreserveCaseKeyDown=this._register(new Z.vl),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=n.placeholder||"",this.validation=n.validation,this.label=n.label||Gv,this.inputActiveOptionBorder=n.inputActiveOptionBorder,this.inputActiveOptionForeground=n.inputActiveOptionForeground,this.inputActiveOptionBackground=n.inputActiveOptionBackground,this.inputBackground=n.inputBackground,this.inputForeground=n.inputForeground,this.inputBorder=n.inputBorder,this.inputValidationInfoBorder=n.inputValidationInfoBorder,this.inputValidationInfoBackground=n.inputValidationInfoBackground,this.inputValidationInfoForeground=n.inputValidationInfoForeground,this.inputValidationWarningBorder=n.inputValidationWarningBorder,this.inputValidationWarningBackground=n.inputValidationWarningBackground,this.inputValidationWarningForeground=n.inputValidationWarningForeground,this.inputValidationErrorBorder=n.inputValidationErrorBorder,this.inputValidationErrorBackground=n.inputValidationErrorBackground,this.inputValidationErrorForeground=n.inputValidationErrorForeground;const o=n.appendPreserveCaseLabel||"",s=n.history||[],a=!!n.flexibleHeight,l=!!n.flexibleWidth,c=n.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new jv.m(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder,history:s,showHistoryHint:n.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:c})),this.preserveCase=this._register(new Qv({appendTitle:o,isChecked:!1,inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground})),this._register(this.preserveCase.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(h=>{this._onPreserveCaseKeyDown.fire(h)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;const d=[this.preserveCase.domNode];this.onkeydown(this.domNode,h=>{if(h.equals(15)||h.equals(17)||h.equals(9)){const p=d.indexOf(document.activeElement);if(p>=0){let m=-1;h.equals(17)?m=(p+1)%d.length:h.equals(15)&&(p===0?m=d.length-1:m=p-1),h.equals(9)?(d[p].blur(),this.inputBox.focus()):m>=0&&d[m].focus(),S.fs.stop(h,!0)}}});const u=document.createElement("div");u.className="controls",u.style.display=this._showOptionButtons?"block":"none",u.appendChild(this.preserveCase.domNode),this.domNode.appendChild(u),e?.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,h=>this._onKeyDown.fire(h)),this.onkeyup(this.inputBox.inputElement,h=>this._onKeyUp.fire(h)),this.oninput(this.inputBox.inputElement,h=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,h=>this._onMouseDown.fire(h))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.preserveCase.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.preserveCase.disable()}setEnabled(e){e?this.enable():this.disable()}style(e){this.inputActiveOptionBorder=e.inputActiveOptionBorder,this.inputActiveOptionForeground=e.inputActiveOptionForeground,this.inputActiveOptionBackground=e.inputActiveOptionBackground,this.inputBackground=e.inputBackground,this.inputForeground=e.inputForeground,this.inputBorder=e.inputBorder,this.inputValidationInfoBackground=e.inputValidationInfoBackground,this.inputValidationInfoForeground=e.inputValidationInfoForeground,this.inputValidationInfoBorder=e.inputValidationInfoBorder,this.inputValidationWarningBackground=e.inputValidationWarningBackground,this.inputValidationWarningForeground=e.inputValidationWarningForeground,this.inputValidationWarningBorder=e.inputValidationWarningBorder,this.inputValidationErrorBackground=e.inputValidationErrorBackground,this.inputValidationErrorForeground=e.inputValidationErrorForeground,this.inputValidationErrorBorder=e.inputValidationErrorBorder,this.applyStyles()}applyStyles(){if(this.domNode){const e={inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground};this.preserveCase.style(e);const t={inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder};this.inputBox.style(t)}}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}validate(){this.inputBox&&this.inputBox.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.inputBox.width=e,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}var ng=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},og=function(r,e){return function(t,i){e(t,i,r)}};const Td=new A.N1("suggestWidgetVisible",!1,(0,g.kg)("suggestWidgetVisible","Whether suggestion are visible")),Od="historyNavigationWidgetFocus",sg="historyNavigationForwardsEnabled",rg="historyNavigationBackwardsEnabled";let ln;const zr=[];function ag(r,e){if(zr.includes(e))throw new Error("Cannot register the same widget multiple times");zr.push(e);const t=new I.Cm,i=t.add(r.createScoped(e.element)),n=new A.N1(Od,!1).bindTo(i),o=new A.N1(sg,!0).bindTo(i),s=new A.N1(rg,!0).bindTo(i),a=()=>{n.set(!0),ln=e},l=()=>{n.set(!1),ln===e&&(ln=void 0)};return e.element===document.activeElement&&a(),t.add(e.onDidFocus(()=>a())),t.add(e.onDidBlur(()=>l())),t.add((0,I.s)(()=>{zr.splice(zr.indexOf(e),1),l()})),{scopedContextKeyService:i,historyNavigationForwardsEnablement:o,historyNavigationBackwardsEnablement:s,dispose(){t.dispose()}}}let Fd=class extends $v.c{constructor(e,t,i,n,o=!1){super(e,t,o,i),this._register(ag(n,this.inputBox))}};Fd=ng([og(3,A.fN)],Fd);let Pd=class extends Zv{constructor(e,t,i,n,o=!1){super(e,t,o,i),this._register(ag(n,this.inputBox))}};Pd=ng([og(3,A.fN)],Pd),Pt.f.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:A.M$.and(A.M$.has(Od),A.M$.equals(rg,!0),Td.isEqualTo(!1)),primary:16,secondary:[528],handler:r=>{ln&&ln.showPreviousValue()}}),Pt.f.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:A.M$.and(A.M$.has(Od),A.M$.equals(sg,!0),Td.isEqualTo(!1)),primary:18,secondary:[530],handler:r=>{ln&&ln.showNextValue()}});var vs=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};const oe={Visible:Td,HasFocusedSuggestion:new A.N1("suggestWidgetHasFocusedSuggestion",!1,(0,g.kg)("suggestWidgetHasSelection","Whether any suggestion is focused")),DetailsVisible:new A.N1("suggestWidgetDetailsVisible",!1,(0,g.kg)("suggestWidgetDetailsVisible","Whether suggestion details are visible")),MultipleSuggestions:new A.N1("suggestWidgetMultipleSuggestions",!1,(0,g.kg)("suggestWidgetMultipleSuggestions","Whether there are multiple suggestions to pick from")),MakesTextEdit:new A.N1("suggestionMakesTextEdit",!0,(0,g.kg)("suggestionMakesTextEdit","Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new A.N1("acceptSuggestionOnEnter",!0,(0,g.kg)("acceptSuggestionOnEnter","Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new A.N1("suggestionHasInsertAndReplaceRange",!1,(0,g.kg)("suggestionHasInsertAndReplaceRange","Whether the current suggestion has insert and replace behaviour")),InsertMode:new A.N1("suggestionInsertMode",void 0,{type:"string",description:(0,g.kg)("suggestionInsertMode","Whether the default behaviour is to insert or replace")}),CanResolve:new A.N1("suggestionCanResolve",!1,(0,g.kg)("suggestionCanResolve","Whether the current suggestion supports to resolve further details"))},Ei=new z.D8("suggestWidgetStatusBar");class Yv{constructor(e,t,i,n){this.position=e,this.completion=t,this.container=i,this.provider=n,this.isInvalid=!1,this.score=je.ne.Default,this.distance=0,this.textLabel=typeof t.label=="string"?t.label:t.label.label,this.labelLow=this.textLabel.toLowerCase(),this.isInvalid=!this.textLabel,this.sortTextLow=t.sortText&&t.sortText.toLowerCase(),this.filterTextLow=t.filterText&&t.filterText.toLowerCase(),this.extensionId=t.extensionId,L.Q.isIRange(t.range)?(this.editStart=new ee.y(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new ee.y(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new ee.y(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||L.Q.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new ee.y(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new ee.y(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new ee.y(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||L.Q.spansMultipleLines(t.range.insert)||L.Q.spansMultipleLines(t.range.replace)||t.range.insert.startLineNumber!==e.lineNumber||t.range.replace.startLineNumber!==e.lineNumber||t.range.insert.startColumn!==t.range.replace.startColumn),typeof n.resolveCompletionItem!="function"&&(this._resolveCache=Promise.resolve(),this._isResolved=!0)}get isResolved(){return!!this._isResolved}resolve(e){return vs(this,void 0,void 0,function*(){if(!this._resolveCache){const t=e.onCancellationRequested(()=>{this._resolveCache=void 0,this._isResolved=!1});this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(i=>{Object.assign(this.completion,i),this._isResolved=!0,t.dispose()},i=>{(0,K.MB)(i)&&(this._resolveCache=void 0,this._isResolved=!1)})}return this._resolveCache})}}class Cs{constructor(e=2,t=new Set,i=new Set,n=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.showDeprecated=n}}Cs.default=new Cs;let bs;function Xv(){return bs}class Jv{constructor(e,t,i,n){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=n}}function Wd(r,e,t,i=Cs.default,n={triggerKind:0},o=re.X.None){return vs(this,void 0,void 0,function*(){const s=new Kt.W(!0);t=t.clone();const a=e.getWordAtPosition(t),l=a?new L.Q(t.lineNumber,a.startColumn,t.lineNumber,a.endColumn):L.Q.fromPositions(t),c={replace:l,insert:l.setEndPosition(t.lineNumber,t.column)},d=[],u=new I.Cm,h=[];let p=!1;const m=(w,R,T)=>{var F,B,j;let ve=!1;if(!R)return ve;for(const ie of R.suggestions)if(!i.kindFilter.has(ie.kind)){if(!i.showDeprecated&&(!((F=ie?.tags)===null||F===void 0)&&F.includes(1)))continue;ie.range||(ie.range=c),ie.sortText||(ie.sortText=typeof ie.label=="string"?ie.label:ie.label.label),!p&&ie.insertTextRules&&ie.insertTextRules&4&&(p=Ri.guessNeedsClipboard(ie.insertText)),d.push(new Yv(t,ie,R,w)),ve=!0}return(0,I.Xm)(R)&&u.add(R),h.push({providerName:(B=w._debugDisplayName)!==null&&B!==void 0?B:"unknown_provider",elapsedProvider:(j=R.duration)!==null&&j!==void 0?j:-1,elapsedOverall:T.elapsed()}),ve},v=vs(this,void 0,void 0,function*(){if(!bs||i.kindFilter.has(27)||i.providerFilter.size>0&&!i.providerFilter.has(bs))return;const w=new Kt.W(!0),R=yield bs.provideCompletionItems(e,t,n,o);m(bs,R,w)});for(const w of r.orderedGroups(e)){let R=!1;if(yield Promise.all(w.map(T=>vs(this,void 0,void 0,function*(){if(!(i.providerFilter.size>0&&!i.providerFilter.has(T)))try{const F=new Kt.W(!0),B=yield T.provideCompletionItems(e,t,n,o);R=m(T,B,F)||R}catch(F){(0,K.M_)(F)}}))),R||o.isCancellationRequested)break}return yield v,o.isCancellationRequested?(u.dispose(),Promise.reject(new K.AL)):new Jv(d.sort(lg(i.snippetSortOrder)),p,{entries:h,elapsed:s.elapsed()},u)})}function Bd(r,e){if(r.sortTextLow&&e.sortTextLow){if(r.sortTextLow<e.sortTextLow)return-1;if(r.sortTextLow>e.sortTextLow)return 1}return r.textLabel<e.textLabel?-1:r.textLabel>e.textLabel?1:r.completion.kind-e.completion.kind}function qv(r,e){if(r.completion.kind!==e.completion.kind){if(r.completion.kind===27)return-1;if(e.completion.kind===27)return 1}return Bd(r,e)}function eC(r,e){if(r.completion.kind!==e.completion.kind){if(r.completion.kind===27)return 1;if(e.completion.kind===27)return-1}return Bd(r,e)}const $r=new Map;$r.set(0,qv),$r.set(2,eC),$r.set(1,Bd);function lg(r){return $r.get(r)}fe.wb.registerCommand("_executeCompletionItemProvider",(r,...e)=>vs(void 0,void 0,void 0,function*(){const[t,i,n,o]=e;(0,le.j)(me.r.isUri(t)),(0,le.j)(ee.y.isIPosition(i)),(0,le.j)(typeof n=="string"||!n),(0,le.j)(typeof o=="number"||!o);const{completionProvider:s}=r.get(te.u),a=yield r.get(Ft.b).createModelReference(t);try{const l={incomplete:!1,suggestions:[]},c=[],d=yield Wd(s,a.object.textEditorModel,ee.y.lift(i),void 0,{triggerCharacter:n,triggerKind:n?1:0});for(const u of d.items)c.length<(o??0)&&c.push(u.resolve(re.X.None)),l.incomplete=l.incomplete||u.container.incomplete,l.suggestions.push(u.completion);try{return yield Promise.all(c),l}finally{setTimeout(()=>d.disposable.dispose(),100)}}finally{a.dispose()}}));function tC(r,e){var t;(t=r.getContribution("editor.contrib.suggestController"))===null||t===void 0||t.triggerSuggest(new Set().add(e),void 0,!0)}class qn{static isAllOff(e){return e.other==="off"&&e.comments==="off"&&e.strings==="off"}static isAllOn(e){return e.other==="on"&&e.comments==="on"&&e.strings==="on"}static valueFor(e,t){switch(t){case 1:return e.comments;case 2:return e.strings;default:return e.other}}}var Hd=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},jr=function(r,e){return function(t,i){e(t,i,r)}};const dg=S.$;let Gr=class Wu extends I.jG{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._widget=this._register(this._instantiationService.createInstance(dn,this._editor)),this._isChangingDecorations=!1,this._messages=[],this._messagesAreComplete=!1,this._participants=[];for(const n of an.getAll())this._participants.push(this._instantiationService.createInstance(n,this._editor));this._participants.sort((n,o)=>n.hoverOrdinal-o.hoverOrdinal),this._computer=new Kr(this._editor,this._participants),this._hoverOperation=this._register(new qh(this._editor,this._computer)),this._register(this._hoverOperation.onResult(n=>{this._withResult(n.value,n.isComplete,n.hasLoadingMessage)})),this._register(this._editor.onDidChangeModelDecorations(()=>{this._isChangingDecorations||this._onModelDecorationsChanged()})),this._register(S.b2(this._widget.getDomNode(),"keydown",n=>{n.equals(9)&&this.hide()})),this._register(_e.dG.onDidChange(()=>{this._widget.position&&this._computer.anchor&&this._messages.length>0&&(this._widget.clear(),this._renderMessages(this._computer.anchor,this._messages))}))}_onModelDecorationsChanged(){this._widget.position&&(this._hoverOperation.cancel(),this._widget.isColorPickerVisible||this._hoverOperation.start(0))}maybeShowAt(e){const t=[];for(const n of this._participants)if(n.suggestHoverAnchor){const o=n.suggestHoverAnchor(e);o&&t.push(o)}const i=e.target;if(i.type===6&&t.push(new Nd(0,i.range)),i.type===7){const n=this._editor.getOption(46).typicalHalfwidthCharacterWidth/2;!i.detail.isAfterLines&&typeof i.detail.horizontalDistanceToText=="number"&&i.detail.horizontalDistanceToText<n&&t.push(new Nd(0,i.range))}return t.length===0?!1:(t.sort((n,o)=>o.priority-n.priority),this._startShowingAt(t[0],0,!1),!0)}startShowingAtRange(e,t,i){this._startShowingAt(new Nd(0,e),t,i)}_startShowingAt(e,t,i){if(!(this._computer.anchor&&this._computer.anchor.equals(e))){if(this._hoverOperation.cancel(),this._widget.position)if(!this._computer.anchor||!e.canAdoptVisibleHover(this._computer.anchor,this._widget.position))this.hide();else{const n=this._messages.filter(o=>o.isValidForHoverAnchor(e));if(n.length===0)this.hide();else{if(n.length===this._messages.length&&this._messagesAreComplete)return;this._renderMessages(e,n)}}this._computer.anchor=e,this._computer.shouldFocus=i,this._hoverOperation.start(t)}}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._widget.hide()}isColorPickerVisible(){return this._widget.isColorPickerVisible}containsNode(e){return this._widget.getDomNode().contains(e)}_addLoadingMessage(e){if(this._computer.anchor){for(const t of this._participants)if(t.createLoadingMessage){const i=t.createLoadingMessage(this._computer.anchor);if(i)return e.slice(0).concat([i])}}return e}_withResult(e,t,i){this._messages=i?this._addLoadingMessage(e):e,this._messagesAreComplete=t,this._computer.anchor&&this._messages.length>0?this._renderMessages(this._computer.anchor,this._messages):t&&this.hide()}_renderMessages(e,t){const{showAtPosition:i,showAtRange:n,highlightRange:o}=Wu.computeHoverRanges(e.range,t),s=new I.Cm,a=s.add(new Vd(this._keybindingService)),l=document.createDocumentFragment();let c=null;const d={fragment:l,statusBar:a,setColorPicker:u=>c=u,onContentsChanged:()=>this._widget.onContentsChanged(),hide:()=>this.hide()};for(const u of this._participants){const h=t.filter(p=>p.owner===u);h.length>0&&s.add(u.renderHoverParts(d,h))}if(a.hasContent&&l.appendChild(a.hoverElement),l.hasChildNodes()){if(o){const u=this._editor.createDecorationsCollection();try{this._isChangingDecorations=!0,u.set([{range:o,options:Wu._DECORATION_OPTIONS}])}finally{this._isChangingDecorations=!1}s.add((0,I.s)(()=>{try{this._isChangingDecorations=!0,u.clear()}finally{this._isChangingDecorations=!1}}))}this._widget.showAt(l,new iC(c,i,n,this._editor.getOption(55).above,this._computer.shouldFocus,s))}else s.dispose()}static computeHoverRanges(e,t){const i=e.startLineNumber;let n=e.startColumn,o=e.endColumn,s=t[0].range,a=null;for(const l of t)s=L.Q.plusRange(s,l.range),l.range.startLineNumber===i&&l.range.endLineNumber===i&&(n=Math.min(n,l.range.startColumn),o=Math.max(o,l.range.endColumn)),l.forceShowAtRange&&(a=l.range);return{showAtPosition:a?a.getStartPosition():new ee.y(e.startLineNumber,n),showAtRange:a||new L.Q(i,n,i,o),highlightRange:s}}};Gr._DECORATION_OPTIONS=ge.kI.register({description:"content-hover-highlight",className:"hoverHighlight"}),Gr=Hd([jr(1,he._Y),jr(2,tt.b)],Gr);class iC{constructor(e,t,i,n,o,s){this.colorPicker=e,this.showAtPosition=t,this.showAtRange=i,this.preferAbove=n,this.stoleFocus=o,this.disposables=s}}let dn=class rm extends I.jG{constructor(e,t){super(),this._editor=e,this._contextKeyService=t,this.allowEditorOverflow=!0,this._hoverVisibleKey=D.R.hoverVisible.bindTo(this._contextKeyService),this._hover=this._register(new Jh),this._visibleData=null,this._register(this._editor.onDidLayoutChange(()=>this._layout())),this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(46)&&this._updateFont()})),this._setVisibleData(null),this._layout(),this._editor.addContentWidget(this)}get position(){var e,t;return(t=(e=this._visibleData)===null||e===void 0?void 0:e.showAtPosition)!==null&&t!==void 0?t:null}get isColorPickerVisible(){var e;return!!(!((e=this._visibleData)===null||e===void 0)&&e.colorPicker)}dispose(){this._editor.removeContentWidget(this),this._visibleData&&this._visibleData.disposables.dispose(),super.dispose()}getId(){return rm.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){if(!this._visibleData)return null;let e=this._visibleData.preferAbove;return!e&&this._contextKeyService.getContextKeyValue(oe.Visible.key)&&(e=!0),{position:this._visibleData.showAtPosition,range:this._visibleData.showAtRange,preference:e?[1,2]:[2,1]}}_setVisibleData(e){this._visibleData&&this._visibleData.disposables.dispose(),this._visibleData=e,this._hoverVisibleKey.set(!!this._visibleData),this._hover.containerDomNode.classList.toggle("hidden",!this._visibleData)}_layout(){const e=Math.max(this._editor.getLayoutInfo().height/4,250),{fontSize:t,lineHeight:i}=this._editor.getOption(46);this._hover.contentsDomNode.style.fontSize=`${t}px`,this._hover.contentsDomNode.style.lineHeight=`${i/t}`,this._hover.contentsDomNode.style.maxHeight=`${e}px`,this._hover.contentsDomNode.style.maxWidth=`${Math.max(this._editor.getLayoutInfo().width*.66,500)}px`}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}showAt(e,t){this._setVisibleData(t),this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._hover.contentsDomNode.style.paddingBottom="",this._updateFont(),this.onContentsChanged(),this._editor.render(),this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),t.colorPicker&&t.colorPicker.layout()}hide(){if(this._visibleData){const e=this._visibleData.stoleFocus;this._setVisibleData(null),this._editor.layoutContentWidget(this),e&&this._editor.focus()}}onContentsChanged(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged();const e=this._hover.scrollbar.getScrollDimensions();if(e.scrollWidth>e.width){const i=`${this._hover.scrollbar.options.horizontalScrollbarSize}px`;this._hover.contentsDomNode.style.paddingBottom!==i&&(this._hover.contentsDomNode.style.paddingBottom=i,this._editor.layoutContentWidget(this),this._hover.onContentsChanged())}}clear(){this._hover.contentsDomNode.textContent=""}};dn.ID="editor.contrib.contentHoverWidget",dn=Hd([jr(1,A.fN)],dn);let Vd=class extends I.jG{constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=dg("div.hover-row.status-bar"),this.actionsElement=S.BC(this.hoverElement,dg("div.actions"))}get hasContent(){return this._hasContent}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;return this._hasContent=!0,this._register(Ad.render(this.actionsElement,e,i))}append(e){const t=S.BC(this.actionsElement,e);return this._hasContent=!0,t}};Vd=Hd([jr(0,tt.b)],Vd);class Kr{constructor(e,t){this._editor=e,this._participants=t,this._anchor=null,this._shouldFocus=!1}get anchor(){return this._anchor}set anchor(e){this._anchor=e}get shouldFocus(){return this._shouldFocus}set shouldFocus(e){this._shouldFocus=e}static _getLineDecorations(e,t){if(t.type!==1)return[];const i=e.getModel(),n=t.range.startLineNumber;if(n>i.getLineCount())return[];const o=i.getLineMaxColumn(n);return e.getLineDecorations(n).filter(s=>{if(s.options.isWholeLine)return!0;const a=s.range.startLineNumber===n?s.range.startColumn:1,l=s.range.endLineNumber===n?s.range.endColumn:o;if(s.options.showIfCollapsed){if(a>t.range.startColumn+1||t.range.endColumn-1>l)return!1}else if(a>t.range.startColumn||t.range.endColumn>l)return!1;return!0})}computeAsync(e){const t=this._anchor;if(!this._editor.hasModel()||!t)return V.AE.EMPTY;const i=Kr._getLineDecorations(this._editor,t);return V.AE.merge(this._participants.map(n=>n.computeAsync?n.computeAsync(t,i,e):V.AE.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=Kr._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return(0,pe.Yc)(t)}}var Ud=f(92542),Ss=f(34061),cg=f(88213),nC=f(9715),ug=f(24594);let hg={};(function(){function r(e,t){t(hg)}r.amd=!0,function(e,t){typeof exports=="object"?t(exports):typeof r=="function"&&r.amd?r(["exports"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.marked={}))}(this,function(e){"use strict";function t(M,E){for(var N=0;N<E.length;N++){var b=E[N];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(M,b.key,b)}}function i(M,E,N){return E&&t(M.prototype,E),N&&t(M,N),Object.defineProperty(M,"prototype",{writable:!1}),M}function n(M,E){if(M){if(typeof M=="string")return o(M,E);var N=Object.prototype.toString.call(M).slice(8,-1);if(N==="Object"&&M.constructor&&(N=M.constructor.name),N==="Map"||N==="Set")return Array.from(M);if(N==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(N))return o(M,E)}}function o(M,E){(E==null||E>M.length)&&(E=M.length);for(var N=0,b=new Array(E);N<E;N++)b[N]=M[N];return b}function s(M,E){var N=typeof Symbol<"u"&&M[Symbol.iterator]||M["@@iterator"];if(N)return(N=N.call(M)).next.bind(N);if(Array.isArray(M)||(N=n(M))||E&&M&&typeof M.length=="number"){N&&(M=N);var b=0;return function(){return b>=M.length?{done:!0}:{done:!1,value:M[b++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}e.defaults=a();function l(M){e.defaults=M}var c=/[&<>"']/,d=/[&<>"']/g,u=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,p={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},m=function(E){return p[E]};function v(M,E){if(E){if(c.test(M))return M.replace(d,m)}else if(u.test(M))return M.replace(h,m);return M}var w=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function R(M){return M.replace(w,function(E,N){return N=N.toLowerCase(),N==="colon"?":":N.charAt(0)==="#"?N.charAt(1)==="x"?String.fromCharCode(parseInt(N.substring(2),16)):String.fromCharCode(+N.substring(1)):""})}var T=/(^|[^\[])\^/g;function F(M,E){M=typeof M=="string"?M:M.source,E=E||"";var N={replace:function(y,k){return k=k.source||k,k=k.replace(T,"$1"),M=M.replace(y,k),N},getRegex:function(){return new RegExp(M,E)}};return N}var B=/[^\w:]/g,j=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function ve(M,E,N){if(M){var b;try{b=decodeURIComponent(R(N)).replace(B,"").toLowerCase()}catch{return null}if(b.indexOf("javascript:")===0||b.indexOf("vbscript:")===0||b.indexOf("data:")===0)return null}E&&!j.test(N)&&(N=qt(E,N));try{N=encodeURI(N).replace(/%25/g,"%")}catch{return null}return N}var ie={},Ue=/^[^:]+:\/*[^/]*$/,et=/^([^:]+:)[\s\S]*$/,rt=/^([^:]+:\/*[^/]*)[\s\S]*$/;function qt(M,E){ie[" "+M]||(Ue.test(M)?ie[" "+M]=M+"/":ie[" "+M]=Tn(M,"/",!0)),M=ie[" "+M];var N=M.indexOf(":")===-1;return E.substring(0,2)==="//"?N?E:M.replace(et,"$1")+E:E.charAt(0)==="/"?N?E:M.replace(rt,"$1")+E:M+E}var Mn={exec:function(){}};function Ct(M){for(var E=1,N,b;E<arguments.length;E++){N=arguments[E];for(b in N)Object.prototype.hasOwnProperty.call(N,b)&&(M[b]=N[b])}return M}function dr(M,E){var N=M.replace(/\|/g,function(k,x,O){for(var P=!1,X=x;--X>=0&&O[X]==="\\";)P=!P;return P?"|":" |"}),b=N.split(/ \|/),y=0;if(b[0].trim()||b.shift(),b.length>0&&!b[b.length-1].trim()&&b.pop(),b.length>E)b.splice(E);else for(;b.length<E;)b.push("");for(;y<b.length;y++)b[y]=b[y].trim().replace(/\\\|/g,"|");return b}function Tn(M,E,N){var b=M.length;if(b===0)return"";for(var y=0;y<b;){var k=M.charAt(b-y-1);if(k===E&&!N)y++;else if(k!==E&&N)y++;else break}return M.slice(0,b-y)}function ul(M,E){if(M.indexOf(E[1])===-1)return-1;for(var N=M.length,b=0,y=0;y<N;y++)if(M[y]==="\\")y++;else if(M[y]===E[0])b++;else if(M[y]===E[1]&&(b--,b<0))return y;return-1}function cr(M){M&&M.sanitize&&!M.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function ur(M,E){if(E<1)return"";for(var N="";E>1;)E&1&&(N+=M),E>>=1,M+=M;return N+M}function Gp(M,E,N,b){var y=E.href,k=E.title?v(E.title):null,x=M[1].replace(/\\([\[\]])/g,"$1");if(M[0].charAt(0)!=="!"){b.state.inLink=!0;var O={type:"link",raw:N,href:y,title:k,text:x,tokens:b.inlineTokens(x,[])};return b.state.inLink=!1,O}return{type:"image",raw:N,href:y,title:k,text:v(x)}}function eL(M,E){var N=M.match(/^(\s+)(?:```)/);if(N===null)return E;var b=N[1];return E.split(`
`).map(function(y){var k=y.match(/^\s+/);if(k===null)return y;var x=k[0];return x.length>=b.length?y.slice(b.length):y}).join(`
`)}var hl=function(){function M(N){this.options=N||e.defaults}var E=M.prototype;return E.space=function(b){var y=this.rules.block.newline.exec(b);if(y&&y[0].length>0)return{type:"space",raw:y[0]}},E.code=function(b){var y=this.rules.block.code.exec(b);if(y){var k=y[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:y[0],codeBlockStyle:"indented",text:this.options.pedantic?k:Tn(k,`
`)}}},E.fences=function(b){var y=this.rules.block.fences.exec(b);if(y){var k=y[0],x=eL(k,y[3]||"");return{type:"code",raw:k,lang:y[2]?y[2].trim():y[2],text:x}}},E.heading=function(b){var y=this.rules.block.heading.exec(b);if(y){var k=y[2].trim();if(/#$/.test(k)){var x=Tn(k,"#");(this.options.pedantic||!x||/ $/.test(x))&&(k=x.trim())}var O={type:"heading",raw:y[0],depth:y[1].length,text:k,tokens:[]};return this.lexer.inline(O.text,O.tokens),O}},E.hr=function(b){var y=this.rules.block.hr.exec(b);if(y)return{type:"hr",raw:y[0]}},E.blockquote=function(b){var y=this.rules.block.blockquote.exec(b);if(y){var k=y[0].replace(/^ *>[ \t]?/gm,"");return{type:"blockquote",raw:y[0],tokens:this.lexer.blockTokens(k,[]),text:k}}},E.list=function(b){var y=this.rules.block.list.exec(b);if(y){var k,x,O,P,X,$,ue,se,we,be,J,ze,Re=y[1].trim(),ei=Re.length>1,Ae={type:"list",raw:"",ordered:ei,start:ei?+Re.slice(0,-1):"",loose:!1,items:[]};Re=ei?"\\d{1,9}\\"+Re.slice(-1):"\\"+Re,this.options.pedantic&&(Re=ei?Re:"[*+-]");for(var nt=new RegExp("^( {0,3}"+Re+")((?:[	 ][^\\n]*)?(?:\\n|$))");b&&(ze=!1,!(!(y=nt.exec(b))||this.rules.block.hr.test(b)));){if(k=y[0],b=b.substring(k.length),se=y[2].split(`
`,1)[0],we=b.split(`
`,1)[0],this.options.pedantic?(P=2,J=se.trimLeft()):(P=y[2].search(/[^ ]/),P=P>4?1:P,J=se.slice(P),P+=y[1].length),$=!1,!se&&/^ *$/.test(we)&&(k+=we+`
`,b=b.substring(we.length+1),ze=!0),!ze)for(var hr=new RegExp("^ {0,"+Math.min(3,P-1)+"}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))"),fl=new RegExp("^ {0,"+Math.min(3,P-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)");b&&(be=b.split(`
`,1)[0],se=be,this.options.pedantic&&(se=se.replace(/^ {1,4}(?=( {4})*[^ ])/g,"  ")),!(hr.test(se)||fl.test(b)));){if(se.search(/[^ ]/)>=P||!se.trim())J+=`
`+se.slice(P);else if(!$)J+=`
`+se;else break;!$&&!se.trim()&&($=!0),k+=be+`
`,b=b.substring(be.length+1)}Ae.loose||(ue?Ae.loose=!0:/\n *\n *$/.test(k)&&(ue=!0)),this.options.gfm&&(x=/^\[[ xX]\] /.exec(J),x&&(O=x[0]!=="[ ] ",J=J.replace(/^\[[ xX]\] +/,""))),Ae.items.push({type:"list_item",raw:k,task:!!x,checked:O,loose:!1,text:J}),Ae.raw+=k}Ae.items[Ae.items.length-1].raw=k.trimRight(),Ae.items[Ae.items.length-1].text=J.trimRight(),Ae.raw=Ae.raw.trimRight();var Pn=Ae.items.length;for(X=0;X<Pn;X++){this.lexer.state.top=!1,Ae.items[X].tokens=this.lexer.blockTokens(Ae.items[X].text,[]);var Bo=Ae.items[X].tokens.filter(function(Ho){return Ho.type==="space"}),pl=Bo.every(function(Ho){for(var cL=Ho.raw.split(""),Qp=0,uL=s(cL),Zp;!(Zp=uL()).done;){var hL=Zp.value;if(hL===`
`&&(Qp+=1),Qp>1)return!0}return!1});!Ae.loose&&Bo.length&&pl&&(Ae.loose=!0,Ae.items[X].loose=!0)}return Ae}},E.html=function(b){var y=this.rules.block.html.exec(b);if(y){var k={type:"html",raw:y[0],pre:!this.options.sanitizer&&(y[1]==="pre"||y[1]==="script"||y[1]==="style"),text:y[0]};return this.options.sanitize&&(k.type="paragraph",k.text=this.options.sanitizer?this.options.sanitizer(y[0]):v(y[0]),k.tokens=[],this.lexer.inline(k.text,k.tokens)),k}},E.def=function(b){var y=this.rules.block.def.exec(b);if(y){y[3]&&(y[3]=y[3].substring(1,y[3].length-1));var k=y[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:k,raw:y[0],href:y[2],title:y[3]}}},E.table=function(b){var y=this.rules.block.table.exec(b);if(y){var k={type:"table",header:dr(y[1]).map(function(ue){return{text:ue}}),align:y[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:y[3]&&y[3].trim()?y[3].replace(/\n[ \t]*$/,"").split(`
`):[]};if(k.header.length===k.align.length){k.raw=y[0];var x=k.align.length,O,P,X,$;for(O=0;O<x;O++)/^ *-+: *$/.test(k.align[O])?k.align[O]="right":/^ *:-+: *$/.test(k.align[O])?k.align[O]="center":/^ *:-+ *$/.test(k.align[O])?k.align[O]="left":k.align[O]=null;for(x=k.rows.length,O=0;O<x;O++)k.rows[O]=dr(k.rows[O],k.header.length).map(function(ue){return{text:ue}});for(x=k.header.length,P=0;P<x;P++)k.header[P].tokens=[],this.lexer.inline(k.header[P].text,k.header[P].tokens);for(x=k.rows.length,P=0;P<x;P++)for($=k.rows[P],X=0;X<$.length;X++)$[X].tokens=[],this.lexer.inline($[X].text,$[X].tokens);return k}}},E.lheading=function(b){var y=this.rules.block.lheading.exec(b);if(y){var k={type:"heading",raw:y[0],depth:y[2].charAt(0)==="="?1:2,text:y[1],tokens:[]};return this.lexer.inline(k.text,k.tokens),k}},E.paragraph=function(b){var y=this.rules.block.paragraph.exec(b);if(y){var k={type:"paragraph",raw:y[0],text:y[1].charAt(y[1].length-1)===`
`?y[1].slice(0,-1):y[1],tokens:[]};return this.lexer.inline(k.text,k.tokens),k}},E.text=function(b){var y=this.rules.block.text.exec(b);if(y){var k={type:"text",raw:y[0],text:y[0],tokens:[]};return this.lexer.inline(k.text,k.tokens),k}},E.escape=function(b){var y=this.rules.inline.escape.exec(b);if(y)return{type:"escape",raw:y[0],text:v(y[1])}},E.tag=function(b){var y=this.rules.inline.tag.exec(b);if(y)return!this.lexer.state.inLink&&/^<a /i.test(y[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(y[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(y[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(y[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:y[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(y[0]):v(y[0]):y[0]}},E.link=function(b){var y=this.rules.inline.link.exec(b);if(y){var k=y[2].trim();if(!this.options.pedantic&&/^</.test(k)){if(!/>$/.test(k))return;var x=Tn(k.slice(0,-1),"\\");if((k.length-x.length)%2===0)return}else{var O=ul(y[2],"()");if(O>-1){var P=y[0].indexOf("!")===0?5:4,X=P+y[1].length+O;y[2]=y[2].substring(0,O),y[0]=y[0].substring(0,X).trim(),y[3]=""}}var $=y[2],ue="";if(this.options.pedantic){var se=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec($);se&&($=se[1],ue=se[3])}else ue=y[3]?y[3].slice(1,-1):"";return $=$.trim(),/^</.test($)&&(this.options.pedantic&&!/>$/.test(k)?$=$.slice(1):$=$.slice(1,-1)),Gp(y,{href:$&&$.replace(this.rules.inline._escapes,"$1"),title:ue&&ue.replace(this.rules.inline._escapes,"$1")},y[0],this.lexer)}},E.reflink=function(b,y){var k;if((k=this.rules.inline.reflink.exec(b))||(k=this.rules.inline.nolink.exec(b))){var x=(k[2]||k[1]).replace(/\s+/g," ");if(x=y[x.toLowerCase()],!x||!x.href){var O=k[0].charAt(0);return{type:"text",raw:O,text:O}}return Gp(k,x,k[0],this.lexer)}},E.emStrong=function(b,y,k){k===void 0&&(k="");var x=this.rules.inline.emStrong.lDelim.exec(b);if(x&&!(x[3]&&k.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var O=x[1]||x[2]||"";if(!O||O&&(k===""||this.rules.inline.punctuation.exec(k))){var P=x[0].length-1,X,$,ue=P,se=0,we=x[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(we.lastIndex=0,y=y.slice(-1*b.length+P);(x=we.exec(y))!=null;)if(X=x[1]||x[2]||x[3]||x[4]||x[5]||x[6],!!X){if($=X.length,x[3]||x[4]){ue+=$;continue}else if((x[5]||x[6])&&P%3&&!((P+$)%3)){se+=$;continue}if(ue-=$,!(ue>0)){if($=Math.min($,$+ue+se),Math.min(P,$)%2){var be=b.slice(1,P+x.index+$);return{type:"em",raw:b.slice(0,P+x.index+$+1),text:be,tokens:this.lexer.inlineTokens(be,[])}}var J=b.slice(2,P+x.index+$-1);return{type:"strong",raw:b.slice(0,P+x.index+$+1),text:J,tokens:this.lexer.inlineTokens(J,[])}}}}}},E.codespan=function(b){var y=this.rules.inline.code.exec(b);if(y){var k=y[2].replace(/\n/g," "),x=/[^ ]/.test(k),O=/^ /.test(k)&&/ $/.test(k);return x&&O&&(k=k.substring(1,k.length-1)),k=v(k,!0),{type:"codespan",raw:y[0],text:k}}},E.br=function(b){var y=this.rules.inline.br.exec(b);if(y)return{type:"br",raw:y[0]}},E.del=function(b){var y=this.rules.inline.del.exec(b);if(y)return{type:"del",raw:y[0],text:y[2],tokens:this.lexer.inlineTokens(y[2],[])}},E.autolink=function(b,y){var k=this.rules.inline.autolink.exec(b);if(k){var x,O;return k[2]==="@"?(x=v(this.options.mangle?y(k[1]):k[1]),O="mailto:"+x):(x=v(k[1]),O=x),{type:"link",raw:k[0],text:x,href:O,tokens:[{type:"text",raw:x,text:x}]}}},E.url=function(b,y){var k;if(k=this.rules.inline.url.exec(b)){var x,O;if(k[2]==="@")x=v(this.options.mangle?y(k[0]):k[0]),O="mailto:"+x;else{var P;do P=k[0],k[0]=this.rules.inline._backpedal.exec(k[0])[0];while(P!==k[0]);x=v(k[0]),k[1]==="www."?O="http://"+x:O=x}return{type:"link",raw:k[0],text:x,href:O,tokens:[{type:"text",raw:x,text:x}]}}},E.inlineText=function(b,y){var k=this.rules.inline.text.exec(b);if(k){var x;return this.lexer.state.inRawBlock?x=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(k[0]):v(k[0]):k[0]:x=v(this.options.smartypants?y(k[0]):k[0]),{type:"text",raw:k[0],text:x}}},M}(),ne={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?<?([^\s>]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Mn,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};ne._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/,ne._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ne.def=F(ne.def).replace("label",ne._label).replace("title",ne._title).getRegex(),ne.bullet=/(?:[*+-]|\d{1,9}[.)])/,ne.listItemStart=F(/^( *)(bull) */).replace("bull",ne.bullet).getRegex(),ne.list=F(ne.list).replace(/bull/g,ne.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ne.def.source+")").getRegex(),ne._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ne._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,ne.html=F(ne.html,"i").replace("comment",ne._comment).replace("tag",ne._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ne.paragraph=F(ne._paragraph).replace("hr",ne.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ne._tag).getRegex(),ne.blockquote=F(ne.blockquote).replace("paragraph",ne.paragraph).getRegex(),ne.normal=Ct({},ne),ne.gfm=Ct({},ne.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),ne.gfm.table=F(ne.gfm.table).replace("hr",ne.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ne._tag).getRegex(),ne.gfm.paragraph=F(ne._paragraph).replace("hr",ne.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",ne.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ne._tag).getRegex(),ne.pedantic=Ct({},ne.normal,{html:F(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ne._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Mn,paragraph:F(ne.normal._paragraph).replace("hr",ne.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",ne.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Y={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Mn,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[^*]+(?=[^*])|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Mn,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};Y._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Y.punctuation=F(Y.punctuation).replace(/punctuation/g,Y._punctuation).getRegex(),Y.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Y.escapedEmSt=/\\\*|\\_/g,Y._comment=F(ne._comment).replace("(?:-->|$)","-->").getRegex(),Y.emStrong.lDelim=F(Y.emStrong.lDelim).replace(/punct/g,Y._punctuation).getRegex(),Y.emStrong.rDelimAst=F(Y.emStrong.rDelimAst,"g").replace(/punct/g,Y._punctuation).getRegex(),Y.emStrong.rDelimUnd=F(Y.emStrong.rDelimUnd,"g").replace(/punct/g,Y._punctuation).getRegex(),Y._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Y._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Y._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Y.autolink=F(Y.autolink).replace("scheme",Y._scheme).replace("email",Y._email).getRegex(),Y._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Y.tag=F(Y.tag).replace("comment",Y._comment).replace("attribute",Y._attribute).getRegex(),Y._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Y._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Y._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Y.link=F(Y.link).replace("label",Y._label).replace("href",Y._href).replace("title",Y._title).getRegex(),Y.reflink=F(Y.reflink).replace("label",Y._label).replace("ref",ne._label).getRegex(),Y.nolink=F(Y.nolink).replace("ref",ne._label).getRegex(),Y.reflinkSearch=F(Y.reflinkSearch,"g").replace("reflink",Y.reflink).replace("nolink",Y.nolink).getRegex(),Y.normal=Ct({},Y),Y.pedantic=Ct({},Y.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:F(/^!?\[(label)\]\((.*?)\)/).replace("label",Y._label).getRegex(),reflink:F(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Y._label).getRegex()}),Y.gfm=Ct({},Y.normal,{escape:F(Y.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),Y.gfm.url=F(Y.gfm.url,"i").replace("email",Y.gfm._extended_email).getRegex(),Y.breaks=Ct({},Y.gfm,{br:F(Y.br).replace("{2,}","*").getRegex(),text:F(Y.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});function tL(M){return M.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function Kp(M){var E="",N,b,y=M.length;for(N=0;N<y;N++)b=M.charCodeAt(N),Math.random()>.5&&(b="x"+b.toString(16)),E+="&#"+b+";";return E}var On=function(){function M(N){this.tokens=[],this.tokens.links=Object.create(null),this.options=N||e.defaults,this.options.tokenizer=this.options.tokenizer||new hl,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};var b={block:ne.normal,inline:Y.normal};this.options.pedantic?(b.block=ne.pedantic,b.inline=Y.pedantic):this.options.gfm&&(b.block=ne.gfm,this.options.breaks?b.inline=Y.breaks:b.inline=Y.gfm),this.tokenizer.rules=b}M.lex=function(b,y){var k=new M(y);return k.lex(b)},M.lexInline=function(b,y){var k=new M(y);return k.inlineTokens(b)};var E=M.prototype;return E.lex=function(b){b=b.replace(/\r\n|\r/g,`
`),this.blockTokens(b,this.tokens);for(var y;y=this.inlineQueue.shift();)this.inlineTokens(y.src,y.tokens);return this.tokens},E.blockTokens=function(b,y){var k=this;y===void 0&&(y=[]),this.options.pedantic?b=b.replace(/\t/g,"    ").replace(/^ +$/gm,""):b=b.replace(/^( *)(\t+)/gm,function(ue,se,we){return se+"    ".repeat(we.length)});for(var x,O,P,X;b;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(ue){return(x=ue.call({lexer:k},b,y))?(b=b.substring(x.raw.length),y.push(x),!0):!1}))){if(x=this.tokenizer.space(b)){b=b.substring(x.raw.length),x.raw.length===1&&y.length>0?y[y.length-1].raw+=`
`:y.push(x);continue}if(x=this.tokenizer.code(b)){b=b.substring(x.raw.length),O=y[y.length-1],O&&(O.type==="paragraph"||O.type==="text")?(O.raw+=`
`+x.raw,O.text+=`
`+x.text,this.inlineQueue[this.inlineQueue.length-1].src=O.text):y.push(x);continue}if(x=this.tokenizer.fences(b)){b=b.substring(x.raw.length),y.push(x);continue}if(x=this.tokenizer.heading(b)){b=b.substring(x.raw.length),y.push(x);continue}if(x=this.tokenizer.hr(b)){b=b.substring(x.raw.length),y.push(x);continue}if(x=this.tokenizer.blockquote(b)){b=b.substring(x.raw.length),y.push(x);continue}if(x=this.tokenizer.list(b)){b=b.substring(x.raw.length),y.push(x);continue}if(x=this.tokenizer.html(b)){b=b.substring(x.raw.length),y.push(x);continue}if(x=this.tokenizer.def(b)){b=b.substring(x.raw.length),O=y[y.length-1],O&&(O.type==="paragraph"||O.type==="text")?(O.raw+=`
`+x.raw,O.text+=`
`+x.raw,this.inlineQueue[this.inlineQueue.length-1].src=O.text):this.tokens.links[x.tag]||(this.tokens.links[x.tag]={href:x.href,title:x.title});continue}if(x=this.tokenizer.table(b)){b=b.substring(x.raw.length),y.push(x);continue}if(x=this.tokenizer.lheading(b)){b=b.substring(x.raw.length),y.push(x);continue}if(P=b,this.options.extensions&&this.options.extensions.startBlock&&function(){var ue=1/0,se=b.slice(1),we=void 0;k.options.extensions.startBlock.forEach(function(be){we=be.call({lexer:this},se),typeof we=="number"&&we>=0&&(ue=Math.min(ue,we))}),ue<1/0&&ue>=0&&(P=b.substring(0,ue+1))}(),this.state.top&&(x=this.tokenizer.paragraph(P))){O=y[y.length-1],X&&O.type==="paragraph"?(O.raw+=`
`+x.raw,O.text+=`
`+x.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=O.text):y.push(x),X=P.length!==b.length,b=b.substring(x.raw.length);continue}if(x=this.tokenizer.text(b)){b=b.substring(x.raw.length),O=y[y.length-1],O&&O.type==="text"?(O.raw+=`
`+x.raw,O.text+=`
`+x.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=O.text):y.push(x);continue}if(b){var $="Infinite loop on byte: "+b.charCodeAt(0);if(this.options.silent){console.error($);break}else throw new Error($)}}return this.state.top=!0,y},E.inline=function(b,y){this.inlineQueue.push({src:b,tokens:y})},E.inlineTokens=function(b,y){var k=this;y===void 0&&(y=[]);var x,O,P,X=b,$,ue,se;if(this.tokens.links){var we=Object.keys(this.tokens.links);if(we.length>0)for(;($=this.tokenizer.rules.inline.reflinkSearch.exec(X))!=null;)we.includes($[0].slice($[0].lastIndexOf("[")+1,-1))&&(X=X.slice(0,$.index)+"["+ur("a",$[0].length-2)+"]"+X.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;($=this.tokenizer.rules.inline.blockSkip.exec(X))!=null;)X=X.slice(0,$.index)+"["+ur("a",$[0].length-2)+"]"+X.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;($=this.tokenizer.rules.inline.escapedEmSt.exec(X))!=null;)X=X.slice(0,$.index)+"++"+X.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;b;)if(ue||(se=""),ue=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(J){return(x=J.call({lexer:k},b,y))?(b=b.substring(x.raw.length),y.push(x),!0):!1}))){if(x=this.tokenizer.escape(b)){b=b.substring(x.raw.length),y.push(x);continue}if(x=this.tokenizer.tag(b)){b=b.substring(x.raw.length),O=y[y.length-1],O&&x.type==="text"&&O.type==="text"?(O.raw+=x.raw,O.text+=x.text):y.push(x);continue}if(x=this.tokenizer.link(b)){b=b.substring(x.raw.length),y.push(x);continue}if(x=this.tokenizer.reflink(b,this.tokens.links)){b=b.substring(x.raw.length),O=y[y.length-1],O&&x.type==="text"&&O.type==="text"?(O.raw+=x.raw,O.text+=x.text):y.push(x);continue}if(x=this.tokenizer.emStrong(b,X,se)){b=b.substring(x.raw.length),y.push(x);continue}if(x=this.tokenizer.codespan(b)){b=b.substring(x.raw.length),y.push(x);continue}if(x=this.tokenizer.br(b)){b=b.substring(x.raw.length),y.push(x);continue}if(x=this.tokenizer.del(b)){b=b.substring(x.raw.length),y.push(x);continue}if(x=this.tokenizer.autolink(b,Kp)){b=b.substring(x.raw.length),y.push(x);continue}if(!this.state.inLink&&(x=this.tokenizer.url(b,Kp))){b=b.substring(x.raw.length),y.push(x);continue}if(P=b,this.options.extensions&&this.options.extensions.startInline&&function(){var J=1/0,ze=b.slice(1),Re=void 0;k.options.extensions.startInline.forEach(function(ei){Re=ei.call({lexer:this},ze),typeof Re=="number"&&Re>=0&&(J=Math.min(J,Re))}),J<1/0&&J>=0&&(P=b.substring(0,J+1))}(),x=this.tokenizer.inlineText(P,tL)){b=b.substring(x.raw.length),x.raw.slice(-1)!=="_"&&(se=x.raw.slice(-1)),ue=!0,O=y[y.length-1],O&&O.type==="text"?(O.raw+=x.raw,O.text+=x.text):y.push(x);continue}if(b){var be="Infinite loop on byte: "+b.charCodeAt(0);if(this.options.silent){console.error(be);break}else throw new Error(be)}}return y},i(M,null,[{key:"rules",get:function(){return{block:ne,inline:Y}}}]),M}(),gl=function(){function M(N){this.options=N||e.defaults}var E=M.prototype;return E.code=function(b,y,k){var x=(y||"").match(/\S*/)[0];if(this.options.highlight){var O=this.options.highlight(b,x);O!=null&&O!==b&&(k=!0,b=O)}return b=b.replace(/\n$/,"")+`
`,x?'<pre><code class="'+this.options.langPrefix+v(x,!0)+'">'+(k?b:v(b,!0))+`</code></pre>
`:"<pre><code>"+(k?b:v(b,!0))+`</code></pre>
`},E.blockquote=function(b){return`<blockquote>
`+b+`</blockquote>
`},E.html=function(b){return b},E.heading=function(b,y,k,x){if(this.options.headerIds){var O=this.options.headerPrefix+x.slug(k);return"<h"+y+' id="'+O+'">'+b+"</h"+y+`>
`}return"<h"+y+">"+b+"</h"+y+`>
`},E.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},E.list=function(b,y,k){var x=y?"ol":"ul",O=y&&k!==1?' start="'+k+'"':"";return"<"+x+O+`>
`+b+"</"+x+`>
`},E.listitem=function(b){return"<li>"+b+`</li>
`},E.checkbox=function(b){return"<input "+(b?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},E.paragraph=function(b){return"<p>"+b+`</p>
`},E.table=function(b,y){return y&&(y="<tbody>"+y+"</tbody>"),`<table>
<thead>
`+b+`</thead>
`+y+`</table>
`},E.tablerow=function(b){return`<tr>
`+b+`</tr>
`},E.tablecell=function(b,y){var k=y.header?"th":"td",x=y.align?"<"+k+' align="'+y.align+'">':"<"+k+">";return x+b+("</"+k+`>
`)},E.strong=function(b){return"<strong>"+b+"</strong>"},E.em=function(b){return"<em>"+b+"</em>"},E.codespan=function(b){return"<code>"+b+"</code>"},E.br=function(){return this.options.xhtml?"<br/>":"<br>"},E.del=function(b){return"<del>"+b+"</del>"},E.link=function(b,y,k){if(b=ve(this.options.sanitize,this.options.baseUrl,b),b===null)return k;var x='<a href="'+v(b)+'"';return y&&(x+=' title="'+y+'"'),x+=">"+k+"</a>",x},E.image=function(b,y,k){if(b=ve(this.options.sanitize,this.options.baseUrl,b),b===null)return k;var x='<img src="'+b+'" alt="'+k+'"';return y&&(x+=' title="'+y+'"'),x+=this.options.xhtml?"/>":">",x},E.text=function(b){return b},M}(),Eu=function(){function M(){}var E=M.prototype;return E.strong=function(b){return b},E.em=function(b){return b},E.codespan=function(b){return b},E.del=function(b){return b},E.html=function(b){return b},E.text=function(b){return b},E.link=function(b,y,k){return""+k},E.image=function(b,y,k){return""+k},E.br=function(){return""},M}(),Au=function(){function M(){this.seen={}}var E=M.prototype;return E.serialize=function(b){return b.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},E.getNextSafeSlug=function(b,y){var k=b,x=0;if(this.seen.hasOwnProperty(k)){x=this.seen[b];do x++,k=b+"-"+x;while(this.seen.hasOwnProperty(k))}return y||(this.seen[b]=x,this.seen[k]=0),k},E.slug=function(b,y){y===void 0&&(y={});var k=this.serialize(b);return this.getNextSafeSlug(k,y.dryrun)},M}(),Fn=function(){function M(N){this.options=N||e.defaults,this.options.renderer=this.options.renderer||new gl,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Eu,this.slugger=new Au}M.parse=function(b,y){var k=new M(y);return k.parse(b)},M.parseInline=function(b,y){var k=new M(y);return k.parseInline(b)};var E=M.prototype;return E.parse=function(b,y){y===void 0&&(y=!0);var k="",x,O,P,X,$,ue,se,we,be,J,ze,Re,ei,Ae,nt,hr,fl,Pn,Bo,pl=b.length;for(x=0;x<pl;x++){if(J=b[x],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[J.type]&&(Bo=this.options.extensions.renderers[J.type].call({parser:this},J),Bo!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(J.type))){k+=Bo||"";continue}switch(J.type){case"space":continue;case"hr":{k+=this.renderer.hr();continue}case"heading":{k+=this.renderer.heading(this.parseInline(J.tokens),J.depth,R(this.parseInline(J.tokens,this.textRenderer)),this.slugger);continue}case"code":{k+=this.renderer.code(J.text,J.lang,J.escaped);continue}case"table":{for(we="",se="",X=J.header.length,O=0;O<X;O++)se+=this.renderer.tablecell(this.parseInline(J.header[O].tokens),{header:!0,align:J.align[O]});for(we+=this.renderer.tablerow(se),be="",X=J.rows.length,O=0;O<X;O++){for(ue=J.rows[O],se="",$=ue.length,P=0;P<$;P++)se+=this.renderer.tablecell(this.parseInline(ue[P].tokens),{header:!1,align:J.align[P]});be+=this.renderer.tablerow(se)}k+=this.renderer.table(we,be);continue}case"blockquote":{be=this.parse(J.tokens),k+=this.renderer.blockquote(be);continue}case"list":{for(ze=J.ordered,Re=J.start,ei=J.loose,X=J.items.length,be="",O=0;O<X;O++)nt=J.items[O],hr=nt.checked,fl=nt.task,Ae="",nt.task&&(Pn=this.renderer.checkbox(hr),ei?nt.tokens.length>0&&nt.tokens[0].type==="paragraph"?(nt.tokens[0].text=Pn+" "+nt.tokens[0].text,nt.tokens[0].tokens&&nt.tokens[0].tokens.length>0&&nt.tokens[0].tokens[0].type==="text"&&(nt.tokens[0].tokens[0].text=Pn+" "+nt.tokens[0].tokens[0].text)):nt.tokens.unshift({type:"text",text:Pn}):Ae+=Pn),Ae+=this.parse(nt.tokens,ei),be+=this.renderer.listitem(Ae,fl,hr);k+=this.renderer.list(be,ze,Re);continue}case"html":{k+=this.renderer.html(J.text);continue}case"paragraph":{k+=this.renderer.paragraph(this.parseInline(J.tokens));continue}case"text":{for(be=J.tokens?this.parseInline(J.tokens):J.text;x+1<pl&&b[x+1].type==="text";)J=b[++x],be+=`
`+(J.tokens?this.parseInline(J.tokens):J.text);k+=y?this.renderer.paragraph(be):be;continue}default:{var Ho='Token with "'+J.type+'" type was not found.';if(this.options.silent){console.error(Ho);return}else throw new Error(Ho)}}}return k},E.parseInline=function(b,y){y=y||this.renderer;var k="",x,O,P,X=b.length;for(x=0;x<X;x++){if(O=b[x],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[O.type]&&(P=this.options.extensions.renderers[O.type].call({parser:this},O),P!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(O.type))){k+=P||"";continue}switch(O.type){case"escape":{k+=y.text(O.text);break}case"html":{k+=y.html(O.text);break}case"link":{k+=y.link(O.href,O.title,this.parseInline(O.tokens,y));break}case"image":{k+=y.image(O.href,O.title,O.text);break}case"strong":{k+=y.strong(this.parseInline(O.tokens,y));break}case"em":{k+=y.em(this.parseInline(O.tokens,y));break}case"codespan":{k+=y.codespan(O.text);break}case"br":{k+=y.br();break}case"del":{k+=y.del(this.parseInline(O.tokens,y));break}case"text":{k+=y.text(O.text);break}default:{var $='Token with "'+O.type+'" type was not found.';if(this.options.silent){console.error($);return}else throw new Error($)}}}return k},M}();function de(M,E,N){if(typeof M>"u"||M===null)throw new Error("marked(): input parameter is undefined or null");if(typeof M!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(M)+", string expected");if(typeof E=="function"&&(N=E,E=null),E=Ct({},de.defaults,E||{}),cr(E),N){var b=E.highlight,y;try{y=On.lex(M,E)}catch(P){return N(P)}var k=function(X){var $;if(!X)try{E.walkTokens&&de.walkTokens(y,E.walkTokens),$=Fn.parse(y,E)}catch(ue){X=ue}return E.highlight=b,X?N(X):N(null,$)};if(!b||b.length<3||(delete E.highlight,!y.length))return k();var x=0;de.walkTokens(y,function(P){P.type==="code"&&(x++,setTimeout(function(){b(P.text,P.lang,function(X,$){if(X)return k(X);$!=null&&$!==P.text&&(P.text=$,P.escaped=!0),x--,x===0&&k()})},0))}),x===0&&k();return}try{var O=On.lex(M,E);return E.walkTokens&&de.walkTokens(O,E.walkTokens),Fn.parse(O,E)}catch(P){if(P.message+=`
Please report this to https://github.com/markedjs/marked.`,E.silent)return"<p>An error occurred:</p><pre>"+v(P.message+"",!0)+"</pre>";throw P}}de.options=de.setOptions=function(M){return Ct(de.defaults,M),l(de.defaults),de},de.getDefaults=a,de.defaults=e.defaults,de.use=function(){for(var M=arguments.length,E=new Array(M),N=0;N<M;N++)E[N]=arguments[N];var b=Ct.apply(void 0,[{}].concat(E)),y=de.defaults.extensions||{renderers:{},childTokens:{}},k;E.forEach(function(x){if(x.extensions&&(k=!0,x.extensions.forEach(function(P){if(!P.name)throw new Error("extension name required");if(P.renderer){var X=y.renderers?y.renderers[P.name]:null;X?y.renderers[P.name]=function(){for(var $=arguments.length,ue=new Array($),se=0;se<$;se++)ue[se]=arguments[se];var we=P.renderer.apply(this,ue);return we===!1&&(we=X.apply(this,ue)),we}:y.renderers[P.name]=P.renderer}if(P.tokenizer){if(!P.level||P.level!=="block"&&P.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");y[P.level]?y[P.level].unshift(P.tokenizer):y[P.level]=[P.tokenizer],P.start&&(P.level==="block"?y.startBlock?y.startBlock.push(P.start):y.startBlock=[P.start]:P.level==="inline"&&(y.startInline?y.startInline.push(P.start):y.startInline=[P.start]))}P.childTokens&&(y.childTokens[P.name]=P.childTokens)})),x.renderer&&function(){var P=de.defaults.renderer||new gl,X=function(se){var we=P[se];P[se]=function(){for(var be=arguments.length,J=new Array(be),ze=0;ze<be;ze++)J[ze]=arguments[ze];var Re=x.renderer[se].apply(P,J);return Re===!1&&(Re=we.apply(P,J)),Re}};for(var $ in x.renderer)X($);b.renderer=P}(),x.tokenizer&&function(){var P=de.defaults.tokenizer||new hl,X=function(se){var we=P[se];P[se]=function(){for(var be=arguments.length,J=new Array(be),ze=0;ze<be;ze++)J[ze]=arguments[ze];var Re=x.tokenizer[se].apply(P,J);return Re===!1&&(Re=we.apply(P,J)),Re}};for(var $ in x.tokenizer)X($);b.tokenizer=P}(),x.walkTokens){var O=de.defaults.walkTokens;b.walkTokens=function(P){x.walkTokens.call(this,P),O&&O.call(this,P)}}k&&(b.extensions=y),de.setOptions(b)})},de.walkTokens=function(M,E){for(var N=function(){var x=y.value;switch(E.call(de,x),x.type){case"table":{for(var O=s(x.header),P;!(P=O()).done;){var X=P.value;de.walkTokens(X.tokens,E)}for(var $=s(x.rows),ue;!(ue=$()).done;)for(var se=ue.value,we=s(se),be;!(be=we()).done;){var J=be.value;de.walkTokens(J.tokens,E)}break}case"list":{de.walkTokens(x.items,E);break}default:de.defaults.extensions&&de.defaults.extensions.childTokens&&de.defaults.extensions.childTokens[x.type]?de.defaults.extensions.childTokens[x.type].forEach(function(ze){de.walkTokens(x[ze],E)}):x.tokens&&de.walkTokens(x.tokens,E)}},b=s(M),y;!(y=b()).done;)N()},de.parseInline=function(M,E){if(typeof M>"u"||M===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof M!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(M)+", string expected");E=Ct({},de.defaults,E||{}),cr(E);try{var N=On.lexInline(M,E);return E.walkTokens&&de.walkTokens(N,E.walkTokens),Fn.parseInline(N,E)}catch(b){if(b.message+=`
Please report this to https://github.com/markedjs/marked.`,E.silent)return"<p>An error occurred:</p><pre>"+v(b.message+"",!0)+"</pre>";throw b}},de.Parser=Fn,de.parser=Fn.parse,de.Renderer=gl,de.TextRenderer=Eu,de.Lexer=On,de.lexer=On.lex,de.Tokenizer=hl,de.Slugger=Au,de.parse=de;var iL=de.options,nL=de.setOptions,oL=de.use,sL=de.walkTokens,rL=de.parseInline,aL=de,lL=Fn.parse,dL=On.lex;e.Lexer=On,e.Parser=Fn,e.Renderer=gl,e.Slugger=Au,e.TextRenderer=Eu,e.Tokenizer=hl,e.getDefaults=a,e.lexer=dL,e.marked=de,e.options=iL,e.parse=aL,e.parseInline=rL,e.parser=lL,e.setOptions=nL,e.use=oL,e.walkTokens=sL,Object.defineProperty(e,"__esModule",{value:!0})})})();var gg=hg||exports,fg=f(50180);function oC(r,e={},t={}){var i;const n=new I.Cm;let o=!1;const s=(0,cg.n)(e),a=function(v){let w;try{w=(0,fg.q)(decodeURIComponent(v))}catch{}return w?(w=(0,ts.PI)(w,R=>{if(r.uris&&r.uris[R])return me.r.revive(r.uris[R])}),encodeURIComponent(JSON.stringify(w))):v},l=function(v,w){const R=r.uris&&r.uris[v];let T=me.r.revive(R);return w?v.startsWith(Xe.ny.data+":")?v:(T||(T=me.r.parse(v)),Xe.zl.asBrowserUri(T).toString(!0)):!T||me.r.parse(v).toString()===T.toString()?v:(T.query&&(T=T.with({query:a(T.query)})),T.toString())},c=new gg.Renderer;c.image=(v,w,R)=>{let T=[],F=[];return v&&({href:v,dimensions:T}=(0,xe.nI)(v),F.push(`src="${(0,xe.oO)(v)}"`)),R&&F.push(`alt="${(0,xe.oO)(R)}"`),w&&F.push(`title="${(0,xe.oO)(w)}"`),T.length&&(F=F.concat(T)),"<img "+F.join(" ")+">"},c.link=(v,w,R)=>typeof v!="string"?"":(v===R&&(R=(0,xe._W)(R)),w=typeof w=="string"?(0,xe.oO)((0,xe._W)(w)):"",v=(0,xe._W)(v),v=v.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),`<a href="${v}" title="${w||v}">${R}</a>`),c.paragraph=v=>`<p>${v}</p>`;const d=[];if(e.codeBlockRenderer&&(c.code=(v,w)=>{const R=ld.r.nextId(),T=e.codeBlockRenderer(w??"",v);return d.push(T.then(F=>[R,F])),`<div class="code" data-code="${R}">${(0,G.ih)(v)}</div>`}),e.actionHandler){const v=e.actionHandler.disposables.add(new Ss.f(s,"click")),w=e.actionHandler.disposables.add(new Ss.f(s,"auxclick"));e.actionHandler.disposables.add(Z.Jh.any(v.event,w.event)(R=>{const T=new nC.P(R);if(!T.leftButton&&!T.middleButton)return;let F=T.target;if(!(F.tagName!=="A"&&(F=F.parentElement,!F||F.tagName!=="A")))try{let B=F.dataset.href;B&&(r.baseUri&&(B=zd(me.r.from(r.baseUri),B)),e.actionHandler.callback(B,T))}catch(B){(0,K.dz)(B)}finally{T.preventDefault()}}))}r.supportHtml||(t.sanitizer=v=>(r.isTrusted?v.match(/^(<span[^>]+>)|(<\/\s*span>)$/):void 0)?v:"",t.sanitize=!0,t.silent=!0),t.renderer=c;let u=(i=r.value)!==null&&i!==void 0?i:"";u.length>1e5&&(u=`${u.substr(0,1e5)}\u2026`),r.supportThemeIcons&&(u=(0,ug.sA)(u));let h=gg.parse(u,t);r.supportThemeIcons&&(h=(0,Ch.n)(h).map(w=>typeof w=="string"?w:w.outerHTML).join(""));const m=new DOMParser().parseFromString(pg(r,h),"text/html");if(m.body.querySelectorAll("img").forEach(v=>{const w=v.getAttribute("src");if(w){let R=w;try{r.baseUri&&(R=zd(me.r.from(r.baseUri),R))}catch{}v.src=l(R,!0)}}),m.body.querySelectorAll("a").forEach(v=>{const w=v.getAttribute("href");if(v.setAttribute("href",""),!w||/^data:|javascript:/i.test(w)||/^command:/i.test(w)&&!r.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(w))v.replaceWith(...v.childNodes);else{let R=l(w,!1);r.baseUri&&(R=zd(me.r.from(r.baseUri),w)),v.dataset.href=R}}),s.innerHTML=pg(r,m.body.innerHTML),d.length>0&&Promise.all(d).then(v=>{var w,R;if(o)return;const T=new Map(v),F=s.querySelectorAll("div[data-code]");for(const B of F){const j=T.get((w=B.dataset.code)!==null&&w!==void 0?w:"");j&&S.Ln(B,j)}(R=e.asyncRenderCallback)===null||R===void 0||R.call(e)}),e.asyncRenderCallback)for(const v of s.getElementsByTagName("img")){const w=n.add(S.ko(v,"load",()=>{w.dispose(),e.asyncRenderCallback()}))}return{element:s,dispose:()=>{o=!0,n.dispose()}}}function zd(r,e){return/^\w[\w\d+.-]*:/.test(e)?e:r.path.endsWith("/")?(0,De.o1)(r,e).toString():(0,De.o1)((0,De.pD)(r),e).toString()}function pg(r,e){const{config:t,allowedSchemes:i}=sC(r);Ud.$w("uponSanitizeAttribute",(o,s)=>{if(s.attrName==="style"||s.attrName==="class"){if(o.tagName==="SPAN"){if(s.attrName==="style"){s.keepAttr=/^(color\:#[0-9a-fA-F]+;)?(background-color\:#[0-9a-fA-F]+;)?$/.test(s.attrValue);return}else if(s.attrName==="class"){s.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(s.attrValue);return}}s.keepAttr=!1;return}});const n=S.a4(i);try{return Ud.aj(e,Object.assign(Object.assign({},t),{RETURN_TRUSTED_TYPE:!0}))}finally{Ud.SV("uponSanitizeAttribute"),n.dispose()}}function sC(r){const e=[Xe.ny.http,Xe.ny.https,Xe.ny.mailto,Xe.ny.data,Xe.ny.file,Xe.ny.vscodeFileResource,Xe.ny.vscodeRemote,Xe.ny.vscodeRemoteResource];return r.isTrusted&&e.push(Xe.ny.command),{config:{ALLOWED_TAGS:["ul","li","p","b","i","code","blockquote","ol","h1","h2","h3","h4","h5","h6","hr","em","pre","table","thead","tbody","tr","th","td","div","del","a","strong","br","img","span"],ALLOWED_ATTR:["href","data-href","target","title","src","alt","class","style","data-code","width","height","align"],ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:e}}var pt=f(54435),rC=f(1458),$d=f(25837),aC=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},mg=function(r,e){return function(t,i){e(t,i,r)}},lC=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})},jd;let li=class am{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new Z.vl,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const n=new I.Cm;return{element:n.add(oC(e,Object.assign(Object.assign({},this._getRenderOptions(e,n)),t),i)).element,dispose:()=>n.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:(i,n)=>lC(this,void 0,void 0,function*(){var o,s,a;let l;i?l=this._languageService.getLanguageIdByLanguageName(i):this._options.editor&&(l=(o=this._options.editor.getModel())===null||o===void 0?void 0:o.getLanguageId()),l||(l=gd.vH);const c=yield(0,rC.Yj)(this._languageService,n,l),d=document.createElement("span");if(d.innerHTML=(a=(s=am._ttpTokenizer)===null||s===void 0?void 0:s.createHTML(c))!==null&&a!==void 0?a:c,this._options.editor){const u=this._options.editor.getOption(46);(0,$d.M)(d,u)}else this._options.codeBlockFontFamily&&(d.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(d.style.fontSize=this._options.codeBlockFontSize),d}),asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:i=>this._openerService.open(i,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:e.isTrusted}).catch(K.dz),disposables:t}}}};li._ttpTokenizer=(jd=window.trustedTypes)===null||jd===void 0?void 0:jd.createPolicy("tokenizeToString",{createHTML(r){return r}}),li=aC([mg(1,xt.L),mg(2,pt.Cr)],li);const _g=S.$;class eo extends I.jG{constructor(e,t,i=pt.m5){super(),this._renderDisposeables=this._register(new I.Cm),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new Jh),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new li({editor:this._editor},t,i)),this._computer=new dC(this._editor),this._hoverOperation=this._register(new qh(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(46)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return eo.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 o=_g("div.hover-row.markdown-hover"),s=S.BC(o,_g("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(n.value));s.appendChild(a.element),i.appendChild(o)}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(),o=this._editor.getOption(61),s=this._hover.containerDomNode.clientHeight,a=i-n-(s-o)/2;this._hover.containerDomNode.style.left=`${t.glyphMarginLeft+t.glyphMarginWidth}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(a),0)}px`}}eo.ID="editor.contrib.modesGlyphHoverWidget";class dC{constructor(e){this._editor=e,this._lineNumber=-1}get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}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 o=n.options.glyphMarginHoverMessage;!o||(0,xe.it)(o)||i.push(...(0,pe._j)(o).map(e))}return i}}var cC=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};class uC{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}function hC(r,e,t,i,n){return cC(this,void 0,void 0,function*(){try{const o=yield Promise.resolve(r.provideHover(t,i,n));if(o&&fC(o))return new uC(r,o,e)}catch(o){(0,K.M_)(o)}})}function Gd(r,e,t,i){const o=r.ordered(e).map((s,a)=>hC(s,a,e,t,i));return V.AE.fromPromises(o).coalesce()}function gC(r,e,t,i){return Gd(r,e,t,i).map(n=>n.hover).toPromise()}(0,_.ke)("_executeHoverProvider",(r,e,t)=>{const i=r.get(te.u);return gC(i.hoverProvider,e,t,re.X.None)});function fC(r){const e=typeof r.range<"u",t=typeof r.contents<"u"&&r.contents&&r.contents.length>0;return e&&t}var pC=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Qr=function(r,e){return function(t,i){e(t,i,r)}};const vg=S.$;class Zt{constructor(e,t,i,n){this.owner=e,this.range=t,this.contents=i,this.ordinal=n}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let Zr=class{constructor(e,t,i,n,o){this._editor=e,this._languageService=t,this._openerService=i,this._configurationService=n,this._languageFeaturesService=o,this.hoverOrdinal=2}createLoadingMessage(e){return new Zt(this,e.range,[new xe.Bc().appendText(g.kg("modesContentHover.loading","Loading..."))],2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,o=i.getLineMaxColumn(n),s=[];let a=1e3;const l=i.getLineLength(n),c=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),d=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:c});typeof d=="number"&&l>=d&&s.push(new Zt(this,e.range,[{value:g.kg("too many characters","Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],a++));for(const u of t){const h=u.range.startLineNumber===n?u.range.startColumn:1,p=u.range.endLineNumber===n?u.range.endColumn:o,m=u.options.hoverMessage;if(!m||(0,xe.it)(m))continue;const v=new L.Q(e.range.startLineNumber,h,e.range.startLineNumber,p);s.push(new Zt(this,v,(0,pe._j)(m),a++))}return s}computeAsync(e,t,i){if(!this._editor.hasModel()||e.type!==1)return V.AE.EMPTY;const n=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(n))return V.AE.EMPTY;const o=new ee.y(e.range.startLineNumber,e.range.startColumn);return Gd(this._languageFeaturesService.hoverProvider,n,o,i).filter(s=>!(0,xe.it)(s.hover.contents)).map(s=>{const a=s.hover.range?L.Q.lift(s.hover.range):e.range;return new Zt(this,a,s.hover.contents,s.ordinal)})}renderHoverParts(e,t){return Cg(e,t,this._editor,this._languageService,this._openerService)}};Zr=pC([Qr(1,xt.L),Qr(2,pt.Cr),Qr(3,Fe.pG),Qr(4,te.u)],Zr);function Cg(r,e,t,i,n){e.sort((s,a)=>s.ordinal-a.ordinal);const o=new I.Cm;for(const s of e)for(const a of s.contents){if((0,xe.it)(a))continue;const l=vg("div.hover-row.markdown-hover"),c=S.BC(l,vg("div.hover-contents")),d=o.add(new li({editor:t},i,n));o.add(d.onDidRenderAsync(()=>{c.className="hover-contents code-hover-contents",r.onContentsChanged()}));const u=o.add(d.render(a));c.appendChild(u.element),r.fragment.appendChild(l)}return o}var mC=f(80886),bg=f(85525),Sg=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Yr=function(r,e){return function(t,i){e(t,i,r)}};class yg{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let Kd=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new Z.vl,this.onDidChange=this._onDidChange.event,this._dispoables=new I.Cm,this._markers=[],this._nextIdx=-1,me.r.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const n=this._configService.getValue("problems.sortOrder"),o=(a,l)=>{let c=(0,G.UD)(a.resource.toString(),l.resource.toString());return c===0&&(n==="position"?c=L.Q.compareRangesUsingStarts(a,l)||Ne.cj.compare(a.severity,l.severity):c=Ne.cj.compare(a.severity,l.severity)||L.Q.compareRangesUsingStarts(a,l)),c},s=()=>{this._markers=this._markerService.read({resource:me.r.isUri(e)?e:void 0,severities:Ne.cj.Error|Ne.cj.Warning|Ne.cj.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(o)};s(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(l=>this._resourceFilter(l)))&&(s(),this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e?!0:!this._resourceFilter||!e?!1:this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new yg(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let n=!1,o=this._markers.findIndex(s=>s.resource.toString()===e.uri.toString());o<0&&(o=(0,pe.El)(this._markers,{resource:e.uri},(s,a)=>(0,G.UD)(s.resource.toString(),a.resource.toString())),o<0&&(o=~o));for(let s=o;s<this._markers.length;s++){let a=L.Q.lift(this._markers[s]);if(a.isEmpty()){const l=e.getWordAtPosition(a.getStartPosition());l&&(a=new L.Q(a.startLineNumber,l.startColumn,a.startLineNumber,l.endColumn))}if(t&&(a.containsPosition(t)||t.isBeforeOrEqual(a.getStartPosition()))){this._nextIdx=s,n=!0;break}if(this._markers[s].resource.toString()!==e.uri.toString())break}n||(this._nextIdx=i?0:this._markers.length-1),this._nextIdx<0&&(this._nextIdx=this._markers.length-1)}resetIndex(){this._nextIdx=-1}move(e,t,i){if(this._markers.length===0)return!1;const n=this._nextIdx;return this._nextIdx===-1?this._initIdx(t,i,e):e?this._nextIdx=(this._nextIdx+1)%this._markers.length:e||(this._nextIdx=(this._nextIdx-1+this._markers.length)%this._markers.length),n!==this._nextIdx}find(e,t){let i=this._markers.findIndex(n=>n.resource.toString()===e.toString());if(!(i<0)){for(;i<this._markers.length;i++)if(L.Q.containsPosition(this._markers[i],t))return new yg(this._markers[i],i+1,this._markers.length)}}};Kd=Sg([Yr(1,Ne.DR),Yr(2,Fe.pG)],Kd);const wg=(0,he.u1)("IMarkerNavigationService");let Qd=class{constructor(e,t){this._markerService=e,this._configService=t,this._provider=new bg.w}getMarkerList(e){for(const t of this._provider){const i=t.getMarkerList(e);if(i)return i}return new Kd(e,this._markerService,this._configService)}};Qd=Sg([Yr(0,Ne.DR),Yr(1,Fe.pG)],Qd),(0,qi.v)(wg,Qd,!0);var Ge=f(11210),to=f(66459),Zd;(function(r){function e(t){switch(t){case to.A.Ignore:return"severity-ignore "+Q.W6.info.classNames;case to.A.Info:return Q.W6.info.classNames;case to.A.Warning:return Q.W6.warning.classNames;case to.A.Error:return Q.W6.error.classNames;default:return""}}r.className=e})(Zd||(Zd={})),(0,U.zy)((r,e)=>{const t=r.getColor(C.tYX);if(t){const o=Q.W6.error.cssSelector;e.addRule(`
			.monaco-editor .zone-widget ${o},
			.markers-panel .marker-icon${o},
			.text-search-provider-messages .providerMessage ${o},
			.extensions-viewlet > .extensions ${o} {
				color: ${t};
			}
		`)}const i=r.getColor(C.JPj);if(i){const o=Q.W6.warning.cssSelector;e.addRule(`
			.monaco-editor .zone-widget ${o},
			.markers-panel .marker-icon${o},
			.extensions-viewlet > .extensions ${o},
			.extension-editor ${o},
			.text-search-provider-messages .providerMessage ${o},
			.preferences-editor ${o} {
				color: ${i};
			}
		`)}const n=r.getColor(C.bNw);if(n){const o=Q.W6.info.cssSelector;e.addRule(`
			.monaco-editor .zone-widget ${o},
			.markers-panel .marker-icon${o},
			.extensions-viewlet > .extensions ${o},
			.text-search-provider-messages .providerMessage ${o},
			.extension-editor ${o} {
				color: ${n};
			}
		`)}});var _C=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},io=function(r,e){return function(t,i){e(t,i,r)}};class vC{constructor(e,t,i,n,o){this._openerService=n,this._labelService=o,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new I.Cm,this._editor=t;const s=document.createElement("div");s.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),s.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),s.appendChild(this._relatedBlock),this._disposables.add(S.b2(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new Hr.Se(s,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{s.style.left=`-${a.scrollLeft}px`,s.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){(0,I.AS)(this._disposables)}update(e){const{source:t,message:i,relatedInformation:n,code:o}=e;let s=(t?.length||0)+2;o&&(typeof o=="string"?s+=o.length:s+=o.value.length);const a=(0,G.uz)(i);this._lines=a.length,this._longestLineLength=0;for(const h of a)this._longestLineLength=Math.max(h.length+s,this._longestLineLength);S.w_(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const h of a)l=document.createElement("div"),l.innerText=h,h===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||o){const h=document.createElement("span");if(h.classList.add("details"),l.appendChild(h),t){const p=document.createElement("span");p.innerText=t,p.classList.add("source"),h.appendChild(p)}if(o)if(typeof o=="string"){const p=document.createElement("span");p.innerText=`(${o})`,p.classList.add("code"),h.appendChild(p)}else{this._codeLink=S.$("a.code-link"),this._codeLink.setAttribute("href",`${o.target.toString()}`),this._codeLink.onclick=m=>{this._openerService.open(o.target,{allowCommands:!0}),m.preventDefault(),m.stopPropagation()};const p=S.BC(this._codeLink,S.$("span"));p.innerText=o.value,h.appendChild(this._codeLink)}}if(S.w_(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),(0,pe.EI)(n)){const h=this._relatedBlock.appendChild(document.createElement("div"));h.style.paddingTop=`${Math.floor(this._editor.getOption(61)*.66)}px`,this._lines+=1;for(const p of n){const m=document.createElement("div"),v=document.createElement("a");v.classList.add("filename"),v.innerText=`${this._labelService.getUriBasenameLabel(p.resource)}(${p.startLineNumber}, ${p.startColumn}): `,v.title=this._labelService.getUriLabel(p.resource),this._relatedDiagnostics.set(v,p);const w=document.createElement("span");w.innerText=p.message,m.appendChild(v),m.appendChild(w),this._lines+=1,h.appendChild(m)}}const c=this._editor.getOption(46),d=Math.ceil(c.typicalFullwidthCharacterWidth*this._longestLineLength*.75),u=c.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:d,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 Ne.cj.Error:t=g.kg("Error","Error");break;case Ne.cj.Warning:t=g.kg("Warning","Warning");break;case Ne.cj.Info:t=g.kg("Info","Info");break;case Ne.cj.Hint:t=g.kg("Hint","Hint");break}let i=g.kg("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 no=class lm extends Tr{constructor(e,t,i,n,o,s,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},o),this._themeService=t,this._openerService=i,this._menuService=n,this._contextKeyService=s,this._labelService=a,this._callOnDispose=new I.Cm,this._onDidSelectRelatedInformation=new Z.vl,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=Ne.cj.Warning,this._backgroundColor=ce.Q1.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(yC);let t=Yd,i=CC;this._severity===Ne.cj.Warning?(t=Xr,i=bC):this._severity===Ne.cj.Info&&(t=Xd,i=SC);const n=e.getColor(t),o=e.getColor(i);this.style({arrowColor:n,frameColor:n,headerBackgroundColor:o,primaryHeadingColor:e.getColor(Oh),secondaryHeadingColor:e.getColor(Fh)})}_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.onBeforeRun(n=>this.editor.focus()));const t=[],i=this._menuService.createMenu(lm.TitleMenu,this._contextKeyService);_v(i,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),i.dispose()}_fillTitleIcon(e){this._icon=S.BC(e,S.$(""))}_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 vC(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=L.Q.lift(e),o=this.editor.getPosition(),s=o&&n.containsPosition(o)?o:n.getStartPosition();super.show(s,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=i>1?g.kg("problems","{0} of {1} problems",t,i):g.kg("change","{0} of {1} problem",t,i);this.setTitle((0,De.P8)(a.uri),l)}this._icon.className=`codicon ${Zd.className(Ne.cj.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(s,0),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}};no.TitleMenu=new z.D8("gotoErrorTitleMenu"),no=_C([io(1,U.Gy),io(2,pt.Cr),io(3,z.ez),io(4,he._Y),io(5,A.fN),io(6,as.L)],no);const Dg=(0,C.yLr)(C.Rbi,C.AN$),xg=(0,C.yLr)(C.Hng,C.Stt),Lg=(0,C.yLr)(C.pOz,C.IIb),Yd=(0,C.x1A)("editorMarkerNavigationError.background",{dark:Dg,light:Dg,hcDark:C.b1q,hcLight:C.b1q},g.kg("editorMarkerNavigationError","Editor marker navigation widget error color.")),CC=(0,C.x1A)("editorMarkerNavigationError.headerBackground",{dark:(0,C.JO0)(Yd,.1),light:(0,C.JO0)(Yd,.1),hcDark:null,hcLight:null},g.kg("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),Xr=(0,C.x1A)("editorMarkerNavigationWarning.background",{dark:xg,light:xg,hcDark:C.b1q,hcLight:C.b1q},g.kg("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),bC=(0,C.x1A)("editorMarkerNavigationWarning.headerBackground",{dark:(0,C.JO0)(Xr,.1),light:(0,C.JO0)(Xr,.1),hcDark:"#0C141F",hcLight:(0,C.JO0)(Xr,.2)},g.kg("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),Xd=(0,C.x1A)("editorMarkerNavigationInfo.background",{dark:Lg,light:Lg,hcDark:C.b1q,hcLight:C.b1q},g.kg("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),SC=(0,C.x1A)("editorMarkerNavigationInfo.headerBackground",{dark:(0,C.JO0)(Xd,.1),light:(0,C.JO0)(Xd,.1),hcDark:null,hcLight:null},g.kg("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),yC=(0,C.x1A)("editorMarkerNavigation.background",{dark:C.YtV,light:C.YtV,hcDark:C.YtV,hcLight:C.YtV},g.kg("editorMarkerNavigationBackground","Editor marker navigation widget background."));var wC=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Jr=function(r,e){return function(t,i){e(t,i,r)}},kg=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};let Ai=class _l{constructor(e,t,i,n,o){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=n,this._instantiationService=o,this._sessionDispoables=new I.Cm,this._editor=e,this._widgetVisible=Ig.bindTo(this._contextKeyService)}static get(e){return e.getContribution(_l.ID)}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(no,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,o,s;(!(!((n=this._model)===null||n===void 0)&&n.selected)||!L.Q.containsPosition((o=this._model)===null||o===void 0?void 0:o.selected.marker,i.position))&&((s=this._model)===null||s===void 0||s.resetIndex())})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const 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:L.Q.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 ee.y(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}nagivate(e,t){var i,n;return kg(this,void 0,void 0,function*(){if(this._editor.hasModel()){const o=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(o.move(e,this._editor.getModel(),this._editor.getPosition()),!o.selected)return;if(o.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const s=yield this._editorService.openCodeEditor({resource:o.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:o.selected.marker}},this._editor);s&&((i=_l.get(s))===null||i===void 0||i.close(),(n=_l.get(s))===null||n===void 0||n.nagivate(e,t))}else this._widget.showAtMarker(o.selected.marker,o.selected.index,o.selected.total)}})}};Ai.ID="editor.contrib.markerController",Ai=wC([Jr(1,wg),Jr(2,A.fN),Jr(3,Be.T),Jr(4,he._Y)],Ai);class qr extends _.ks{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}run(e,t){var i;return kg(this,void 0,void 0,function*(){t.hasModel()&&((i=Ai.get(t))===null||i===void 0||i.nagivate(this._next,this._multiFile))})}}class Ni extends qr{constructor(){super(!0,!1,{id:Ni.ID,label:Ni.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:D.R.focus,primary:578,weight:100},menuOpts:{menuId:no.TitleMenu,title:Ni.LABEL,icon:(0,Ge.pU)("marker-navigation-next",Q.W6.arrowDown,g.kg("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}Ni.ID="editor.action.marker.next",Ni.LABEL=g.kg("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class cn extends qr{constructor(){super(!1,!1,{id:cn.ID,label:cn.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:D.R.focus,primary:1602,weight:100},menuOpts:{menuId:no.TitleMenu,title:cn.LABEL,icon:(0,Ge.pU)("marker-navigation-previous",Q.W6.arrowUp,g.kg("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}cn.ID="editor.action.marker.prev",cn.LABEL=g.kg("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class DC extends qr{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:g.kg("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:D.R.focus,primary:66,weight:100},menuOpts:{menuId:z.D8.MenubarGoMenu,title:g.kg({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class xC extends qr{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:g.kg("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:D.R.focus,primary:1090,weight:100},menuOpts:{menuId:z.D8.MenubarGoMenu,title:g.kg({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}(0,_.HW)(Ai.ID,Ai),(0,_.Fl)(Ni),(0,_.Fl)(cn),(0,_.Fl)(DC),(0,_.Fl)(xC);const Ig=new A.N1("markersNavigationVisible",!1),LC=_.DX.bindToContribution(Ai.get);(0,_.E_)(new LC({id:"closeMarkersNavigation",precondition:Ig,handler:r=>r.close(),kbOpts:{weight:150,kbExpr:D.R.focus,primary:9,secondary:[1033]}}));var kC=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Jd=function(r,e){return function(t,i){e(t,i,r)}};const Et=S.$;class IC{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 Rg={type:1,filter:{include:ae.QuickFix},triggerAction:Ze.QuickFixHover};let qd=class{constructor(e,t,i,n){this._editor=e,this._markerDecorationsService=t,this._openerService=i,this._languageFeaturesService=n,this.hoverOrdinal=5,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,o=i.getLineMaxColumn(n),s=[];for(const a of t){const l=a.range.startLineNumber===n?a.range.startColumn:1,c=a.range.endLineNumber===n?a.range.endColumn:o,d=this._markerDecorationsService.getMarker(i.uri,a);if(!d)continue;const u=new L.Q(e.range.startLineNumber,l,e.range.startLineNumber,c);s.push(new IC(this,u,d))}return s}renderHoverParts(e,t){if(!t.length)return I.jG.None;const i=new I.Cm;t.forEach(o=>e.fragment.appendChild(this.renderMarkerHover(o,i)));const n=t.length===1?t[0]:t.sort((o,s)=>Ne.cj.compare(o.marker.severity,s.marker.severity))[0];return this.renderMarkerStatusbar(e,n,i),i}renderMarkerHover(e,t){const i=Et("div.hover-row"),n=S.BC(i,Et("div.marker.hover-contents")),{source:o,message:s,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(n);const c=S.BC(n,Et("span"));if(c.style.whiteSpace="pre-wrap",c.innerText=s,o||a)if(a&&typeof a!="string"){const d=Et("span");if(o){const m=S.BC(d,Et("span"));m.innerText=o}const u=S.BC(d,Et("a.code-link"));u.setAttribute("href",a.target.toString()),t.add(S.ko(u,"click",m=>{this._openerService.open(a.target,{allowCommands:!0}),m.preventDefault(),m.stopPropagation()}));const h=S.BC(u,Et("span"));h.innerText=a.value;const p=S.BC(n,d);p.style.opacity="0.6",p.style.paddingLeft="6px"}else{const d=S.BC(n,Et("span"));d.style.opacity="0.6",d.style.paddingLeft="6px",d.innerText=o&&a?`${o}(${a})`:o||`(${a})`}if((0,pe.EI)(l))for(const{message:d,resource:u,startLineNumber:h,startColumn:p}of l){const m=S.BC(n,Et("div"));m.style.marginTop="8px";const v=S.BC(m,Et("a"));v.innerText=`${(0,De.P8)(u)}(${h}, ${p}): `,v.style.cursor="pointer",t.add(S.ko(v,"click",R=>{R.stopPropagation(),R.preventDefault(),this._openerService&&this._openerService.open(u,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:h,startColumn:p}}}).catch(K.dz)}));const w=S.BC(m,Et("span"));w.innerText=d,this._editor.applyFontInfo(w)}return i}renderMarkerStatusbar(e,t,i){if((t.marker.severity===Ne.cj.Error||t.marker.severity===Ne.cj.Warning||t.marker.severity===Ne.cj.Info)&&e.statusBar.addAction({label:g.kg("view problem","View Problem"),commandId:Ni.ID,run:()=>{var n;e.hide(),(n=Ai.get(this._editor))===null||n===void 0||n.showAtMarker(t.marker),this._editor.focus()}}),!this._editor.getOption(83)){const n=e.statusBar.append(Et("div"));this.recentMarkerCodeActionsInfo&&(Ne.oc.makeKey(this.recentMarkerCodeActionsInfo.marker)===Ne.oc.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(n.textContent=g.kg("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?I.jG.None:i.add((0,V.EQ)(()=>n.textContent=g.kg("checkingForQuickFixes","Checking for quick fixes..."),200));n.textContent||(n.textContent="\xA0");const s=this.getCodeActions(t.marker);i.add((0,I.s)(()=>s.cancel())),s.then(a=>{if(o.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),n.textContent=g.kg("noQuickFixes","No quick fixes available");return}n.style.display="none";let l=!1;i.add((0,I.s)(()=>{l||a.dispose()})),e.statusBar.addAction({label:g.kg("quick fixes","Quick Fix..."),commandId:jn.Id,run:c=>{l=!0;const d=xi.get(this._editor),u=S.BK(c);e.hide(),d?.showCodeActions(Rg,a,{x:u.left+6,y:u.top+u.height+6,width:u.width,height:u.height})}})},K.dz)}}getCodeActions(e){return(0,V.SS)(t=>zl(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new L.Q(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),Rg,Dt.ke.None,t))}};qd=kC([Jd(1,mC.A),Jd(2,pt.Cr),Jd(3,te.u)],qd),(0,U.zy)((r,e)=>{const t=r.getColor(C.vwp);t&&e.addRule(`.monaco-hover .hover-contents a.code-link span { color: ${t}; }`);const i=r.getColor(C.FEE);i&&e.addRule(`.monaco-hover .hover-contents a.code-link span:hover { color: ${i}; }`)});var RC=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},ea=function(r,e){return function(t,i){e(t,i,r)}};let Mi=class dm{constructor(e,t,i,n,o){this._editor=e,this._instantiationService=t,this._openerService=i,this._languageService=n,this._toUnhook=new I.Cm,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._hookEvents(),this._didChangeConfigurationHandler=this._editor.onDidChangeConfiguration(s=>{s.hasChanged(55)&&(this._unhookEvents(),this._hookEvents())})}static get(e){return e.getContribution(dm.ID)}_hookEvents(){const e=()=>this._hideWidgets(),t=this._editor.getOption(55);this._isHoverEnabled=t.enabled,this._isHoverSticky=t.sticky,this._isHoverEnabled?(this._toUnhook.add(this._editor.onMouseDown(i=>this._onEditorMouseDown(i))),this._toUnhook.add(this._editor.onMouseUp(i=>this._onEditorMouseUp(i))),this._toUnhook.add(this._editor.onMouseMove(i=>this._onEditorMouseMove(i))),this._toUnhook.add(this._editor.onKeyDown(i=>this._onKeyDown(i)))):(this._toUnhook.add(this._editor.onMouseMove(i=>this._onEditorMouseMove(i))),this._toUnhook.add(this._editor.onKeyDown(i=>this._onKeyDown(i)))),this._toUnhook.add(this._editor.onMouseLeave(i=>this._onEditorMouseLeave(i))),this._toUnhook.add(this._editor.onDidChangeModel(e)),this._toUnhook.add(this._editor.onDidScrollChange(i=>this._onEditorScrollChanged(i)))}_unhookEvents(){this._toUnhook.clear()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){this._isMouseDown=!0;const t=e.target;if(t.type===9&&t.detail===dn.ID){this._hoverClicked=!0;return}t.type===12&&t.detail===eo.ID||(t.type!==12&&(this._hoverClicked=!1),this._hideWidgets())}_onEditorMouseUp(e){this._isMouseDown=!1}_onEditorMouseLeave(e){var t;const i=e.event.browserEvent.relatedTarget;!((t=this._contentWidget)===null||t===void 0)&&t.containsNode(i)||this._hideWidgets()}_onEditorMouseMove(e){var t,i,n,o,s;const a=e.target;if(this._isMouseDown&&this._hoverClicked||this._isHoverSticky&&a.type===9&&a.detail===dn.ID||this._isHoverSticky&&!(!((i=(t=e.event.browserEvent.view)===null||t===void 0?void 0:t.getSelection())===null||i===void 0)&&i.isCollapsed)||!this._isHoverSticky&&a.type===9&&a.detail===dn.ID&&(!((n=this._contentWidget)===null||n===void 0)&&n.isColorPickerVisible())||this._isHoverSticky&&a.type===12&&a.detail===eo.ID)return;if(!this._isHoverEnabled){this._hideWidgets();return}if(this._getOrCreateContentWidget().maybeShowAt(e)){(o=this._glyphWidget)===null||o===void 0||o.hide();return}if(a.type===2&&a.position){(s=this._contentWidget)===null||s===void 0||s.hide(),this._glyphWidget||(this._glyphWidget=new eo(this._editor,this._languageService,this._openerService)),this._glyphWidget.startShowingAt(a.position.lineNumber);return}this._hideWidgets()}_onKeyDown(e){e.keyCode!==5&&e.keyCode!==6&&e.keyCode!==57&&e.keyCode!==4&&this._hideWidgets()}_hideWidgets(){var e,t,i;this._isMouseDown&&this._hoverClicked&&(!((e=this._contentWidget)===null||e===void 0)&&e.isColorPickerVisible())||(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(Gr,this._editor)),this._contentWidget}isColorPickerVisible(){var e;return((e=this._contentWidget)===null||e===void 0?void 0:e.isColorPickerVisible())||!1}showContentHover(e,t,i){this._getOrCreateContentWidget().startShowingAtRange(e,t,i)}dispose(){var e,t;this._unhookEvents(),this._toUnhook.dispose(),this._didChangeConfigurationHandler.dispose(),(e=this._glyphWidget)===null||e===void 0||e.dispose(),(t=this._contentWidget)===null||t===void 0||t.dispose()}};Mi.ID="editor.contrib.hover",Mi=RC([ea(1,he._Y),ea(2,pt.Cr),ea(3,xt.L),ea(4,A.fN)],Mi);class EC extends _.ks{constructor(){super({id:"editor.action.showHover",label:g.kg({key:"showHover",comment:["Label for action that will trigger the showing of a hover in the editor.","This allows for users to show the hover without using the mouse."]},"Show Hover"),alias:"Show Hover",precondition:void 0,kbOpts:{kbExpr:D.R.editorTextFocus,primary:(0,Ee.m5)(2089,2087),weight:100}})}run(e,t){if(!t.hasModel())return;const i=Mi.get(t);if(!i)return;const n=t.getPosition(),o=new L.Q(n.lineNumber,n.column,n.lineNumber,n.column),s=t.getOption(2)===2;i.showContentHover(o,1,s)}}class AC extends _.ks{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:g.kg({key:"showDefinitionPreviewHover",comment:["Label for action that will trigger the showing of definition preview hover in the editor.","This allows for users to show the definition preview hover without using the mouse."]},"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0})}run(e,t){const i=Mi.get(t);if(!i)return;const n=t.getPosition();if(!n)return;const o=new L.Q(n.lineNumber,n.column,n.lineNumber,n.column),s=rn.get(t);if(!s)return;s.startFindDefinitionFromCursor(n).then(()=>{i.showContentHover(o,1,!0)})}}(0,_.HW)(Mi.ID,Mi),(0,_.Fl)(EC),(0,_.Fl)(AC),an.register(Zr),an.register(qd),(0,U.zy)((r,e)=>{const t=r.getColor(C.mH6);t&&e.addRule(`.monaco-editor .hoverHighlight { background-color: ${t}; }`);const i=r.getColor(C.WfR);i&&e.addRule(`.monaco-editor .monaco-hover { background-color: ${i}; }`);const n=r.getColor(C.oZ8);n&&(e.addRule(`.monaco-editor .monaco-hover { border: 1px solid ${n}; }`),e.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${n.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${n.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${n.transparent(.5)}; }`));const o=r.getColor(C.vwp);o&&e.addRule(`.monaco-editor .monaco-hover a { color: ${o}; }`);const s=r.getColor(C.FEE);s&&e.addRule(`.monaco-editor .monaco-hover a:hover { color: ${s}; }`);const a=r.getColor(C.Xo2);a&&e.addRule(`.monaco-editor .monaco-hover { color: ${a}; }`);const l=r.getColor(C.rRi);l&&e.addRule(`.monaco-editor .monaco-hover .hover-row .actions { background-color: ${l}; }`);const c=r.getColor(C.S6W);c&&e.addRule(`.monaco-editor .monaco-hover code { background-color: ${c}; }`)});class ec extends I.jG{constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){const t=e.target;if(t.type!==6||!t.detail.injectedText||t.detail.injectedText.options.attachedData!==wh||!t.range)return;const i=this._editor.getContribution(Mi.ID);if(i&&!i.isColorPickerVisible()){const n=new L.Q(t.range.startLineNumber,t.range.startColumn+1,t.range.endLineNumber,t.range.endColumn+1);i.showContentHover(n,1,!1)}}}ec.ID="editor.contrib.colorContribution",(0,_.HW)(ec.ID,ec),an.register(od);var tc=f(39587),Eg=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};function ic(r){return{asString:()=>Eg(this,void 0,void 0,function*(){return r}),asFile:()=>{},value:typeof r=="string"?r:void 0}}function NC(r,e,t){return{asString:()=>Eg(this,void 0,void 0,function*(){return""}),asFile:()=>({name:r,uri:e,data:t}),value:void 0}}class Ag{constructor(){this._entries=new Map}get size(){return this._entries.size}has(e){return this._entries.has(this.toKey(e))}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))}*entries(){for(const[e,t]of this._entries.entries())for(const i of t)yield[e,i]}values(){return Array.from(this._entries.values()).flat()}forEach(e){for(const[t,i]of this.entries())e(i,t)}toKey(e){return e.toLowerCase()}}var un=f(53720);const Ng=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let r;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?r=crypto.getRandomValues.bind(crypto):r=function(i){for(let n=0;n<i.length;n++)i[n]=Math.floor(Math.random()*256);return i};const e=new Uint8Array(16),t=[];for(let i=0;i<256;i++)t.push(i.toString(16).padStart(2,"0"));return function(){r(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let n=0,o="";return o+=t[e[n++]],o+=t[e[n++]],o+=t[e[n++]],o+=t[e[n++]],o+="-",o+=t[e[n++]],o+=t[e[n++]],o+="-",o+=t[e[n++]],o+=t[e[n++]],o+="-",o+=t[e[n++]],o+=t[e[n++]],o+="-",o+=t[e[n++]],o+=t[e[n++]],o+=t[e[n++]],o+=t[e[n++]],o+=t[e[n++]],o+=t[e[n++]],o}}(),ta={EDITORS:"CodeEditors",FILES:"CodeFiles"};function MC(r){var e;const t=[];if(r.dataTransfer&&r.dataTransfer.types.length>0){const i=r.dataTransfer.getData(ta.EDITORS);if(i)try{t.push(...(0,fg.q)(i))}catch{}else try{const s=r.dataTransfer.getData(tc.t.RESOURCES);t.push(...TC(s))}catch{}if(!((e=r.dataTransfer)===null||e===void 0)&&e.files)for(let s=0;s<r.dataTransfer.files.length;s++){const a=r.dataTransfer.files[s];if(a&&a.path)try{t.push({resource:me.r.file(a.path),isExternal:!0,allowWorkspaceOpen:!0})}catch{}}const n=r.dataTransfer.getData(ta.FILES);if(n)try{const s=JSON.parse(n);for(const a of s)t.push({resource:me.r.file(a),isExternal:!0,allowWorkspaceOpen:!0})}catch{}const o=Gt.O.as(Mg.DragAndDropContribution).getAll();for(const s of o){const a=r.dataTransfer.getData(s.dataFormatKey);if(a)try{t.push(...s.getEditorInputs(a))}catch{}}}return t}function TC(r){const e=[];if(r){const t=JSON.parse(r);for(const i of t)if(i.indexOf(":")>0){const{selection:n,uri:o}=(0,pt.ew)(me.r.parse(i));e.push({resource:o,options:{selection:n}})}}return e}class OC{constructor(){this._contributions=new Map}getAll(){return this._contributions.values()}}const Mg={DragAndDropContribution:"workbench.contributions.dragAndDrop"};Gt.O.add(Mg.DragAndDropContribution,new OC);var FC=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};function nc(r){const e=new Ag;for(const t of r.items){const i=t.type;if(t.kind==="string"){const n=new Promise(o=>t.getAsString(o));e.append(i,ic(n))}else if(t.kind==="file"){const n=t.getAsFile();n&&e.append(i,PC(n))}}return e}function PC(r){const e=r.path?me.r.parse(r.path):void 0;return NC(r.name,e,()=>FC(this,void 0,void 0,function*(){return new Uint8Array(yield r.arrayBuffer())}))}const WC=Object.freeze([ta.EDITORS,ta.FILES,tc.t.RESOURCES]);function BC(r,e,t=!1){var i;if(e.dataTransfer&&(t||!r.has(un.K.uriList))){const n=MC(e).filter(o=>o.resource).map(o=>o.resource.toString());for(const o of(i=e.dataTransfer)===null||i===void 0?void 0:i.items){const s=o.getAsFile();s&&n.push(s.path?me.r.file(s.path).toString():s.name)}n.length&&r.replace(un.K.uriList,ic(oc.create(n)))}for(const n of WC)r.delete(n)}const oc=Object.freeze({create:r=>(0,pe.dM)(r.map(e=>e.toString())).join(`\r
`),parse:r=>r.split(`\r
`).filter(e=>!e.startsWith("#"))});var ia=f(46441),Le=f(23877),di=f(26851),HC=f(78518);function Tg(r,e=Se.uF){return(0,HC.No)(r,e)?r.charAt(0).toUpperCase()+r.slice(1):r}let DL=Object.create(null);var ci=f(18019),VC=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},UC=function(r,e){return function(t,i){e(t,i,r)}};const xL=Object.freeze({CURRENT_YEAR:!0,CURRENT_YEAR_SHORT:!0,CURRENT_MONTH:!0,CURRENT_DATE:!0,CURRENT_HOUR:!0,CURRENT_MINUTE:!0,CURRENT_SECOND:!0,CURRENT_DAY_NAME:!0,CURRENT_DAY_NAME_SHORT:!0,CURRENT_MONTH_NAME:!0,CURRENT_MONTH_NAME_SHORT:!0,CURRENT_SECONDS_UNIX:!0,SELECTION:!0,CLIPBOARD:!0,TM_SELECTED_TEXT:!0,TM_CURRENT_LINE:!0,TM_CURRENT_WORD:!0,TM_LINE_INDEX:!0,TM_LINE_NUMBER:!0,TM_FILENAME:!0,TM_FILENAME_BASE:!0,TM_DIRECTORY:!0,TM_FILEPATH:!0,CURSOR_INDEX:!0,CURSOR_NUMBER:!0,RELATIVE_FILEPATH:!0,BLOCK_COMMENT_START:!0,BLOCK_COMMENT_END:!0,LINE_COMMENT:!0,WORKSPACE_NAME:!0,WORKSPACE_FOLDER:!0,RANDOM:!0,RANDOM_HEX:!0,UUID:!0});class Og{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){const i=t.resolve(e);if(i!==void 0)return i}}}class Fg{constructor(e,t,i,n){this._model=e,this._selection=t,this._selectionIdx=i,this._overtypingCapturer=n}resolve(e){const{name:t}=e;if(t==="SELECTION"||t==="TM_SELECTED_TEXT"){let i=this._model.getValueInRange(this._selection)||void 0,n=this._selection.startLineNumber!==this._selection.endLineNumber;if(!i&&this._overtypingCapturer){const o=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);o&&(i=o.value,n=o.multiline)}if(i&&n&&e.snippet){const o=this._model.getLineContent(this._selection.startLineNumber),s=(0,G.UU)(o,0,this._selection.startColumn-1);let a=s;e.snippet.walk(c=>c===e?!1:(c instanceof st&&(a=(0,G.UU)((0,G.uz)(c.value).pop())),!0));const l=(0,G.Qp)(a,s);i=i.replace(/(\r\n|\r|\n)(.*)/g,(c,d,u)=>`${d}${a.substr(l)}${u}`)}return i}else{if(t==="TM_CURRENT_LINE")return this._model.getLineContent(this._selection.positionLineNumber);if(t==="TM_CURRENT_WORD"){const i=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return i&&i.word||void 0}else{if(t==="TM_LINE_INDEX")return String(this._selection.positionLineNumber-1);if(t==="TM_LINE_NUMBER")return String(this._selection.positionLineNumber);if(t==="CURSOR_INDEX")return String(this._selectionIdx);if(t==="CURSOR_NUMBER")return String(this._selectionIdx+1)}}}}class Pg{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return ci.P8(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const i=ci.P8(this._model.uri.fsPath),n=i.lastIndexOf(".");return n<=0?i:i.slice(0,n)}else{if(t==="TM_DIRECTORY")return ci.pD(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel((0,De.pD)(this._model.uri));if(t==="TM_FILEPATH")return this._labelService.getUriLabel(this._model.uri);if(t==="RELATIVE_FILEPATH")return this._labelService.getUriLabel(this._model.uri,{relative:!0,noPrefix:!0})}}}class Wg{constructor(e,t,i,n){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=i,this._spread=n}resolve(e){if(e.name!=="CLIPBOARD")return;const t=this._readClipboardText();if(t){if(this._spread){const i=t.split(/\r\n|\n|\r/).filter(n=>!(0,G.AV)(n));if(i.length===this._selectionCount)return i[this._selectionIdx]}return t}}}let na=class{constructor(e,t,i){this._model=e,this._selection=t,this._languageConfigurationService=i}resolve(e){const{name:t}=e,i=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),n=this._languageConfigurationService.getLanguageConfiguration(i).comments;if(n){if(t==="LINE_COMMENT")return n.lineCommentToken||void 0;if(t==="BLOCK_COMMENT_START")return n.blockCommentStartToken||void 0;if(t==="BLOCK_COMMENT_END")return n.blockCommentEndToken||void 0}}};na=VC([UC(2,it.JZ)],na);class Ht{constructor(){this._date=new Date}resolve(e){const{name:t}=e;if(t==="CURRENT_YEAR")return String(this._date.getFullYear());if(t==="CURRENT_YEAR_SHORT")return String(this._date.getFullYear()).slice(-2);if(t==="CURRENT_MONTH")return String(this._date.getMonth().valueOf()+1).padStart(2,"0");if(t==="CURRENT_DATE")return String(this._date.getDate().valueOf()).padStart(2,"0");if(t==="CURRENT_HOUR")return String(this._date.getHours().valueOf()).padStart(2,"0");if(t==="CURRENT_MINUTE")return String(this._date.getMinutes().valueOf()).padStart(2,"0");if(t==="CURRENT_SECOND")return String(this._date.getSeconds().valueOf()).padStart(2,"0");if(t==="CURRENT_DAY_NAME")return Ht.dayNames[this._date.getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return Ht.dayNamesShort[this._date.getDay()];if(t==="CURRENT_MONTH_NAME")return Ht.monthNames[this._date.getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return Ht.monthNamesShort[this._date.getMonth()];if(t==="CURRENT_SECONDS_UNIX")return String(Math.floor(this._date.getTime()/1e3))}}Ht.dayNames=[g.kg("Sunday","Sunday"),g.kg("Monday","Monday"),g.kg("Tuesday","Tuesday"),g.kg("Wednesday","Wednesday"),g.kg("Thursday","Thursday"),g.kg("Friday","Friday"),g.kg("Saturday","Saturday")],Ht.dayNamesShort=[g.kg("SundayShort","Sun"),g.kg("MondayShort","Mon"),g.kg("TuesdayShort","Tue"),g.kg("WednesdayShort","Wed"),g.kg("ThursdayShort","Thu"),g.kg("FridayShort","Fri"),g.kg("SaturdayShort","Sat")],Ht.monthNames=[g.kg("January","January"),g.kg("February","February"),g.kg("March","March"),g.kg("April","April"),g.kg("May","May"),g.kg("June","June"),g.kg("July","July"),g.kg("August","August"),g.kg("September","September"),g.kg("October","October"),g.kg("November","November"),g.kg("December","December")],Ht.monthNamesShort=[g.kg("JanuaryShort","Jan"),g.kg("FebruaryShort","Feb"),g.kg("MarchShort","Mar"),g.kg("AprilShort","Apr"),g.kg("MayShort","May"),g.kg("JuneShort","Jun"),g.kg("JulyShort","Jul"),g.kg("AugustShort","Aug"),g.kg("SeptemberShort","Sep"),g.kg("OctoberShort","Oct"),g.kg("NovemberShort","Nov"),g.kg("DecemberShort","Dec")];class Bg{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=(0,di.Q_)(this._workspaceService.getWorkspace());if(t){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(t);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(t)}}_resolveWorkspaceName(e){if((0,di.jB)(e))return ci.P8(e.uri.path);let t=ci.P8(e.configPath.path);return t.endsWith(di.kF)&&(t=t.substr(0,t.length-di.kF.length-1)),t}_resoveWorkspacePath(e){if((0,di.jB)(e))return Tg(e.uri.fsPath);const t=ci.P8(e.configPath.path);let i=e.configPath.fsPath;return i.endsWith(t)&&(i=i.substr(0,i.length-t.length-1)),i?Tg(i):"/"}}class Hg{resolve(e){const{name:t}=e;if(t==="RANDOM")return Math.random().toString().slice(-6);if(t==="RANDOM_HEX")return Math.random().toString(16).slice(-6);if(t==="UUID")return Ng()}}var zC=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},$C=function(r,e){return function(t,i){e(t,i,r)}};class yt{constructor(e,t,i){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=i,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=(0,pe.$z)(t.placeholders,Rt.compareByIndex),this._placeholderGroupsIdx=-1}initialize(e){this._offset=e.newPosition}dispose(){this._placeholderDecorations&&this._editor.removeDecorations([...this._placeholderDecorations.values()]),this._placeholderGroups.length=0}_initDecorations(){if(this._offset===-1)throw new Error("Snippet not initialized!");if(this._placeholderDecorations)return;this._placeholderDecorations=new Map;const e=this._editor.getModel();this._editor.changeDecorations(t=>{for(const i of this._snippet.placeholders){const n=this._snippet.offset(i),o=this._snippet.fullLen(i),s=L.Q.fromPositions(e.getPositionAt(this._offset+n),e.getPositionAt(this._offset+n+o)),a=i.isFinalTabstop?yt._decor.inactiveFinal:yt._decor.inactive,l=t.addDecoration(s,a);this._placeholderDecorations.set(i,l)}})}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const n=[];for(const o of this._placeholderGroups[this._placeholderGroupsIdx])if(o.transform){const s=this._placeholderDecorations.get(o),a=this._editor.getModel().getDecorationRange(s),l=this._editor.getModel().getValueInRange(a),c=o.transform.resolve(l).split(/\r\n|\r|\n/);for(let d=1;d<c.length;d++)c[d]=this._editor.getModel().normalizeIndentation(this._snippetLineLeadingWhitespace+c[d]);n.push(Le.k.replace(a,c.join(this._editor.getModel().getEOL())))}n.length>0&&this._editor.executeEdits("snippet.placeholderTransform",n)}let t=!1;e===!0&&this._placeholderGroupsIdx<this._placeholderGroups.length-1?(this._placeholderGroupsIdx+=1,t=!0):e===!1&&this._placeholderGroupsIdx>0&&(this._placeholderGroupsIdx-=1,t=!0);const i=this._editor.getModel().changeDecorations(n=>{const o=new Set,s=[];for(const a of this._placeholderGroups[this._placeholderGroupsIdx]){const l=this._placeholderDecorations.get(a),c=this._editor.getModel().getDecorationRange(l);s.push(new q.L(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),n.changeDecorationOptions(l,a.isFinalTabstop?yt._decor.activeFinal:yt._decor.active),o.add(a);for(const d of this._snippet.enclosingPlaceholders(a)){const u=this._placeholderDecorations.get(d);n.changeDecorationOptions(u,d.isFinalTabstop?yt._decor.activeFinal:yt._decor.active),o.add(d)}}for(const[a,l]of this._placeholderDecorations)o.has(a)||n.changeDecorationOptions(l,a.isFinalTabstop?yt._decor.inactiveFinal:yt._decor.inactive);return s});return t?this.move(e):i??[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof Rt){const i=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(i).isEmpty()&&t.toString().length>0)return!0}t=t.parent}return!1}get isAtFirstPlaceholder(){return this._placeholderGroupsIdx<=0||this._placeholderGroups.length===0}get isAtLastPlaceholder(){return this._placeholderGroupsIdx===this._placeholderGroups.length-1}get hasPlaceholder(){return this._snippet.placeholders.length>0}get isTrivialSnippet(){return this._snippet.placeholders.length===0||this._snippet.placeholders.length===1&&this._snippet.placeholders[0].isFinalTabstop}computePossibleSelections(){const e=new Map;for(const t of this._placeholderGroups){let i;for(const n of t){if(n.isFinalTabstop)break;i||(i=[],e.set(n.index,i));const o=this._placeholderDecorations.get(n),s=this._editor.getModel().getDecorationRange(o);if(!s){e.delete(n.index);break}i.push(s)}}return e}get activeChoice(){if(!this._placeholderDecorations)return;const e=this._placeholderGroups[this._placeholderGroupsIdx][0];if(!e?.choice)return;const t=this._placeholderDecorations.get(e);if(!t)return;const i=this._editor.getModel().getDecorationRange(t);if(i)return{range:i,choice:e.choice}}get hasChoice(){let e=!1;return this._snippet.walk(t=>(e=t instanceof Jn,!e)),e}merge(e){const t=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations(i=>{for(const n of this._placeholderGroups[this._placeholderGroupsIdx]){const o=e.shift();console.assert(o._offset!==-1),console.assert(!o._placeholderDecorations);const s=o._snippet.placeholderInfo.last.index;for(const l of o._snippet.placeholderInfo.all)l.isFinalTabstop?l.index=n.index+(s+1)/this._nestingLevel:l.index=n.index+l.index/this._nestingLevel;this._snippet.replace(n,o._snippet.children);const a=this._placeholderDecorations.get(n);i.removeDecoration(a),this._placeholderDecorations.delete(n);for(const l of o._snippet.placeholders){const c=o._snippet.offset(l),d=o._snippet.fullLen(l),u=L.Q.fromPositions(t.getPositionAt(o._offset+c),t.getPositionAt(o._offset+c+d)),h=i.addDecoration(u,yt._decor.inactive);this._placeholderDecorations.set(l,h)}}this._placeholderGroups=(0,pe.$z)(this._snippet.placeholders,Rt.compareByIndex)})}}yt._decor={active:ge.kI.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:ge.kI.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:ge.kI.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:ge.kI.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})};const Vg={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let oa=class vi{constructor(e,t,i=Vg,n){this._editor=e,this._template=t,this._options=i,this._languageConfigurationService=n,this._templateMerges=[],this._snippets=[]}static adjustWhitespace(e,t,i,n,o){const s=e.getLineContent(t.lineNumber),a=(0,G.UU)(s,0,t.column-1);let l;return i.walk(c=>{if(!(c instanceof st)||c.parent instanceof Jn)return!0;const d=c.value.split(/\r\n|\r|\n/);if(n){const h=i.offset(c);if(h===0)d[0]=e.normalizeIndentation(d[0]);else{l=l??i.toString();const p=l.charCodeAt(h-1);(p===10||p===13)&&(d[0]=e.normalizeIndentation(a+d[0]))}for(let p=1;p<d.length;p++)d[p]=e.normalizeIndentation(a+d[p])}const u=d.join(e.getEOL());return u!==c.value&&(c.parent.replace(c,[new st(u)]),l=void 0),!0}),a}static adjustSelection(e,t,i,n){if(i!==0||n!==0){const{positionLineNumber:o,positionColumn:s}=t,a=s-i,l=s+n,c=e.validateRange({startLineNumber:o,startColumn:a,endLineNumber:o,endColumn:l});t=q.L.createWithDirection(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn,t.getDirection())}return t}static createEditsAndSnippetsFromSelections(e,t,i,n,o,s,a,l,c){const d=[],u=[];if(!e.hasModel())return{edits:d,snippets:u};const h=e.getModel(),p=e.invokeWithinContext(B=>B.get(di.VR)),m=e.invokeWithinContext(B=>new Pg(B.get(as.L),h)),v=()=>a,w=h.getValueInRange(vi.adjustSelection(h,e.getSelection(),i,0)),R=h.getValueInRange(vi.adjustSelection(h,e.getSelection(),0,n)),T=h.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),F=e.getSelections().map((B,j)=>({selection:B,idx:j})).sort((B,j)=>L.Q.compareRangesUsingStarts(B.selection,j.selection));for(const{selection:B,idx:j}of F){let ve=vi.adjustSelection(h,B,i,0),ie=vi.adjustSelection(h,B,0,n);w!==h.getValueInRange(ve)&&(ve=B),R!==h.getValueInRange(ie)&&(ie=B);const Ue=B.setStartPosition(ve.startLineNumber,ve.startColumn).setEndPosition(ie.endLineNumber,ie.endColumn),et=new Ri().parse(t,!0,o),rt=Ue.getStartPosition(),qt=vi.adjustWhitespace(h,rt,et,s||j>0&&T!==h.getLineFirstNonWhitespaceColumn(B.positionLineNumber),!0);et.resolveVariables(new Og([m,new Wg(v,j,F.length,e.getOption(73)==="spread"),new Fg(h,B,j,l),new na(h,B,c),new Ht,new Bg(p),new Hg])),d[j]=Le.k.replace(Ue,et.toString()),d[j].identifier={major:j,minor:0},d[j]._isTracked=!0,u[j]=new yt(e,et,qt)}return{edits:d,snippets:u}}static createEditsAndSnippetsFromEdits(e,t,i,n,o,s,a){if(!e.hasModel()||t.length===0)return{edits:[],snippets:[]};const l=[],c=e.getModel(),d=new Ri,u=new _s,h=new Og([e.invokeWithinContext(m=>new Pg(m.get(as.L),c)),new Wg(()=>o,0,e.getSelections().length,e.getOption(73)==="spread"),new Fg(c,e.getSelection(),0,s),new na(c,e.getSelection(),a),new Ht,new Bg(e.invokeWithinContext(m=>m.get(di.VR))),new Hg]);t=t.sort((m,v)=>L.Q.compareRangesUsingStarts(m.range,v.range));let p=0;for(let m=0;m<t.length;m++){const{range:v,template:w}=t[m];if(m>0){const B=t[m-1].range,j=L.Q.fromPositions(B.getEndPosition(),v.getStartPosition()),ve=new st(c.getValueInRange(j));u.appendChild(ve),p+=ve.value.length}d.parseFragment(w,u),u.resolveVariables(h);const R=u.toString(),T=R.slice(p);p=R.length;const F=Le.k.replace(v,T);F.identifier={major:m,minor:0},F._isTracked=!0,l.push(F)}return d.ensureFinalTabstop(u,i,!0),{edits:l,snippets:[new yt(e,u,"")]}}dispose(){(0,I.AS)(this._snippets)}_logInfo(){return`template="${this._template}", merged_templates="${this._templateMerges.join(" -> ")}"`}insert(){if(!this._editor.hasModel())return;const{edits:e,snippets:t}=typeof this._template=="string"?vi.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):vi.createEditsAndSnippetsFromEdits(this._editor,this._template,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService);this._snippets=t,this._editor.executeEdits("snippet",e,i=>{const n=i.filter(o=>!!o.identifier);for(let o=0;o<t.length;o++)t[o].initialize(n[o].textChange);return this._snippets[0].hasPlaceholder?this._move(!0):n.map(o=>q.L.fromPositions(o.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=Vg){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:i,snippets:n}=vi.createEditsAndSnippetsFromSelections(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",i,o=>{const s=o.filter(l=>!!l.identifier);for(let l=0;l<n.length;l++)n[l].initialize(s[l].textChange);const a=n[0].isTrivialSnippet;if(!a){for(const l of this._snippets)l.merge(n);console.assert(n.length===0)}return this._snippets[0].hasPlaceholder&&!a?this._move(void 0):s.map(l=>q.L.fromPositions(l.range.getEndPosition()))})}next(){const e=this._move(!0);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}prev(){const e=this._move(!1);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}_move(e){const t=[];for(const i of this._snippets){const n=i.move(e);t.push(...n)}return t}get isAtFirstPlaceholder(){return this._snippets[0].isAtFirstPlaceholder}get isAtLastPlaceholder(){return this._snippets[0].isAtLastPlaceholder}get hasPlaceholder(){return this._snippets[0].hasPlaceholder}get hasChoice(){return this._snippets[0].hasChoice}get activeChoice(){return this._snippets[0].activeChoice}isSelectionWithinPlaceholders(){if(!this.hasPlaceholder)return!1;const e=this._editor.getSelections();if(e.length<this._snippets.length)return!1;const t=new Map;for(const i of this._snippets){const n=i.computePossibleSelections();if(t.size===0)for(const[o,s]of n){s.sort(L.Q.compareRangesUsingStarts);for(const a of e)if(s[0].containsRange(a)){t.set(o,[]);break}}if(t.size===0)return!1;t.forEach((o,s)=>{o.push(...n.get(s))})}e.sort(L.Q.compareRangesUsingStarts);for(const[i,n]of t){if(n.length!==e.length){t.delete(i);continue}n.sort(L.Q.compareRangesUsingStarts);for(let o=0;o<n.length;o++)if(!n[o].containsRange(e[o])){t.delete(i);continue}}return t.size>0}};oa=zC([$C(3,it.JZ)],oa);var jC=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},sa=function(r,e){return function(t,i){e(t,i,r)}};const ra={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let Me=class gr{constructor(e,t,i,n,o){this._editor=e,this._logService=t,this._languageFeaturesService=i,this._languageConfigurationService=o,this._snippetListener=new I.Cm,this._modelVersionId=-1,this._inSnippet=gr.InSnippetMode.bindTo(n),this._hasNextTabstop=gr.HasNextTabstop.bindTo(n),this._hasPrevTabstop=gr.HasPrevTabstop.bindTo(n)}static get(e){return e.getContribution(gr.ID)}dispose(){var e;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),(e=this._session)===null||e===void 0||e.dispose(),this._snippetListener.dispose()}apply(e,t){try{this._doInsert(e,typeof t>"u"?ra:Object.assign(Object.assign({},ra),t))}catch(i){this.cancel(),this._logService.error(i),this._logService.error("snippet_error"),this._logService.error("insert_edits=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"<no_session>")}}insert(e,t){try{this._doInsert(e,typeof t>"u"?ra:Object.assign(Object.assign({},ra),t))}catch(i){this.cancel(),this._logService.error(i),this._logService.error("snippet_error"),this._logService.error("insert_template=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"<no_session>")}}_doInsert(e,t){var i;if(this._editor.hasModel()){if(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session&&typeof e!="string"&&this.cancel(),this._session?((0,le.j)(typeof e=="string"),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new oa(this._editor,e,t,this._languageConfigurationService),this._session.insert()),t.undoStopAfter&&this._editor.getModel().pushStackElement(),!((i=this._session)===null||i===void 0)&&i.hasChoice){this._choiceCompletionItemProvider={provideCompletionItems:(o,s)=>{if(!this._session||o!==this._editor.getModel()||!ee.y.equals(this._editor.getPosition(),s))return;const{activeChoice:a}=this._session;if(!a||a.choice.options.length===0)return;const l=o.getValueInRange(a.range),c=!!a.choice.options.find(u=>u.value===l),d=[];for(let u=0;u<a.choice.options.length;u++){const h=a.choice.options[u];d.push({kind:13,label:h.value,insertText:h.value,sortText:"a".repeat(u+1),range:a.range,filterText:c?`${l}_${h.value}`:void 0,command:{id:"jumpToNextSnippetPlaceholder",title:(0,g.kg)("next","Go to next placeholder...")}})}return{suggestions:d}}};const n=this._languageFeaturesService.completionProvider.register({language:this._editor.getModel().getLanguageId(),pattern:this._editor.getModel().uri.fsPath,scheme:this._editor.getModel().uri.scheme},this._choiceCompletionItemProvider);this._snippetListener.add(n)}this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent(n=>n.isFlush&&this.cancel())),this._snippetListener.add(this._editor.onDidChangeModel(()=>this.cancel())),this._snippetListener.add(this._editor.onDidChangeCursorSelection(()=>this._updateState()))}}_updateState(){if(!(!this._session||!this._editor.hasModel())){if(this._modelVersionId===this._editor.getModel().getAlternativeVersionId())return this.cancel();if(!this._session.hasPlaceholder)return this.cancel();if(this._session.isAtLastPlaceholder||!this._session.isSelectionWithinPlaceholders())return this._editor.getModel().pushStackElement(),this.cancel();this._inSnippet.set(!0),this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder),this._hasNextTabstop.set(!this._session.isAtLastPlaceholder),this._handleChoice()}}_handleChoice(){if(!this._session||!this._editor.hasModel()){this._currentChoice=void 0;return}const{activeChoice:e}=this._session;if(!e||!this._choiceCompletionItemProvider){this._currentChoice=void 0;return}this._currentChoice!==e.choice&&(this._currentChoice=e.choice,queueMicrotask(()=>{tC(this._editor,this._choiceCompletionItemProvider)}))}finish(){for(;this._inSnippet.get();)this.next()}cancel(e=!1){var t;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),this._currentChoice=void 0,(t=this._session)===null||t===void 0||t.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){this._session&&this._session.prev(),this._updateState()}next(){this._session&&this._session.next(),this._updateState()}isInSnippet(){return!!this._inSnippet.get()}};Me.ID="snippetController2",Me.InSnippetMode=new A.N1("inSnippetMode",!1,(0,g.kg)("inSnippetMode","Whether the editor in current in snippet mode")),Me.HasNextTabstop=new A.N1("hasNextTabstop",!1,(0,g.kg)("hasNextTabstop","Whether there is a next tab stop when in snippet mode")),Me.HasPrevTabstop=new A.N1("hasPrevTabstop",!1,(0,g.kg)("hasPrevTabstop","Whether there is a previous tab stop when in snippet mode")),Me=jC([sa(1,ia.rr),sa(2,te.u),sa(3,A.fN),sa(4,it.JZ)],Me),(0,_.HW)(Me.ID,Me);const aa=_.DX.bindToContribution(Me.get);(0,_.E_)(new aa({id:"jumpToNextSnippetPlaceholder",precondition:A.M$.and(Me.InSnippetMode,Me.HasNextTabstop),handler:r=>r.next(),kbOpts:{weight:130,kbExpr:D.R.editorTextFocus,primary:2}})),(0,_.E_)(new aa({id:"jumpToPrevSnippetPlaceholder",precondition:A.M$.and(Me.InSnippetMode,Me.HasPrevTabstop),handler:r=>r.prev(),kbOpts:{weight:130,kbExpr:D.R.editorTextFocus,primary:1026}})),(0,_.E_)(new aa({id:"leaveSnippet",precondition:Me.InSnippetMode,handler:r=>r.cancel(!0),kbOpts:{weight:130,kbExpr:D.R.editorTextFocus,primary:9,secondary:[1033]}})),(0,_.E_)(new aa({id:"acceptSnippet",precondition:Me.InSnippetMode,handler:r=>r.finish()}));function Ug(r,e,t){const i=Me.get(r);return i?(r.focus(),i.apply(t.map(n=>({range:q.L.liftSelection(n),template:e}))),i.isInSnippet()):!1}var GC=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},la=function(r,e){return function(t,i){e(t,i,r)}},zg=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};const sc="application/vnd.code.copyMetadata";let ys=class extends I.jG{constructor(e,t,i,n,o){super(),this._bulkEditService=t,this._clipboardService=i,this._configurationService=n,this._languageFeaturesService=o,this._editor=e;const s=e.getContainerDomNode();this._register((0,S.ko)(s,"copy",a=>this.handleCopy(a))),this._register((0,S.ko)(s,"cut",a=>this.handleCopy(a))),this._register((0,S.ko)(s,"paste",a=>this.handlePaste(a),!0))}arePasteActionsEnabled(e){return this._configurationService.getValue("editor.experimental.pasteActions.enabled",{resource:e.uri})}handleCopy(e){var t;if(!e.clipboardData||!this._editor.hasTextFocus())return;const i=this._editor.getModel(),n=this._editor.getSelections();if(!i||!n?.length||!this.arePasteActionsEnabled(i))return;const o=[...n],s=n[0],a=s.isEmpty();if(a){if(!this._editor.getOption(33))return;o[0]=new L.Q(s.startLineNumber,0,s.startLineNumber,i.getLineLength(s.startLineNumber))}const l=this._languageFeaturesService.documentPasteEditProvider.ordered(i).filter(h=>!!h.prepareDocumentPaste);if(!l.length){this.setCopyMetadata(e.clipboardData,{wasFromEmptySelection:a});return}const c=nc(e.clipboardData),d=Ng();this.setCopyMetadata(e.clipboardData,{id:d,wasFromEmptySelection:a});const u=(0,V.SS)(h=>zg(this,void 0,void 0,function*(){const p=yield Promise.all(l.map(m=>m.prepareDocumentPaste(i,o,c,h)));for(const m of p)m?.forEach((v,w)=>{c.replace(w,v)});return c}));(t=this._currentClipboardItem)===null||t===void 0||t.dataTransferPromise.cancel(),this._currentClipboardItem={handle:d,dataTransferPromise:u}}setCopyMetadata(e,t){e.setData(sc,JSON.stringify(t))}handlePaste(e){var t,i,n;return zg(this,void 0,void 0,function*(){if(!e.clipboardData||!this._editor.hasTextFocus())return;const o=this._editor.getSelections();if(!o?.length||!this._editor.hasModel())return;const s=this._editor.getModel();if(!this.arePasteActionsEnabled(s))return;let a;const l=(t=e.clipboardData)===null||t===void 0?void 0:t.getData(sc);l&&typeof l=="string"&&(a=JSON.parse(l));const c=this._languageFeaturesService.documentPasteEditProvider.ordered(s);if(!c.length)return;e.preventDefault(),e.stopImmediatePropagation();const d=s.getVersionId(),u=new Di.gI(this._editor,3);try{const h=nc(e.clipboardData);if(a?.id&&((i=this._currentClipboardItem)===null||i===void 0?void 0:i.handle)===a.id&&(yield this._currentClipboardItem.dataTransferPromise).forEach((w,R)=>{h.replace(R,w)}),!h.has(un.K.uriList)){const v=yield this._clipboardService.readResources();v.length&&h.append(un.K.uriList,ic(oc.create(v)))}h.delete(sc);for(const v of c){if(!v.pasteMimeTypes.some(R=>R.toLowerCase()===tc.t.FILES.toLowerCase()?[...h.values()].some(T=>T.asFile()):h.has(R)))continue;const w=yield v.provideDocumentPasteEdits(s,o,h,u.token);if(d!==s.getVersionId())return;if(w){Ug(this._editor,typeof w.insertText=="string"?Ri.escape(w.insertText):w.insertText.snippet,o),w.additionalEdit&&(yield this._bulkEditService.apply(wi.jN.convert(w.additionalEdit),{editor:this._editor}));return}}const p=(n=h.get(un.K.text))!==null&&n!==void 0?n:h.get("text");if(!p)return;const m=yield p.asString();if(d!==s.getVersionId())return;this._editor.trigger("keyboard","paste",{text:m,pasteOnNewLine:a?.wasFromEmptySelection,multicursorText:null})}finally{u.dispose()}})}};ys.ID="editor.contrib.copyPasteActionController",ys=GC([la(1,wi.nu),la(2,Hn.h),la(3,Fe.pG),la(4,te.u)],ys),(0,_.HW)(ys.ID,ys),Gt.O.as(Jl.Fd.Configuration).registerConfiguration(Object.assign(Object.assign({},gh.JJ),{properties:{"editor.experimental.pasteActions.enabled":{type:"boolean",scope:5,description:g.kg("pasteActions","Enable/disable running edits from extensions on paste."),default:!1}}}));class Ti{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,o=e.length;if(i+n>o)return!1;for(let s=0;s<n;s++){const a=e.charCodeAt(i+s),l=t.charCodeAt(s);if(a!==l&&!(a>=65&&a<=90&&a+32===l)&&!(l>=65&&l<=90&&l+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,i,n,o,s){const a=e.startLineNumber,l=e.startColumn,c=e.endLineNumber,d=e.endColumn,u=o.getLineContent(a),h=o.getLineContent(c);let p=u.lastIndexOf(t,l-1+t.length),m=h.indexOf(i,d-1-i.length);if(p!==-1&&m!==-1)if(a===c)u.substring(p+t.length,m).indexOf(i)>=0&&(p=-1,m=-1);else{const w=u.substring(p+t.length),R=h.substring(0,m);(w.indexOf(i)>=0||R.indexOf(i)>=0)&&(p=-1,m=-1)}let v;p!==-1&&m!==-1?(n&&p+t.length<u.length&&u.charCodeAt(p+t.length)===32&&(t=t+" "),n&&m>0&&h.charCodeAt(m-1)===32&&(i=" "+i,m-=1),v=Ti._createRemoveBlockCommentOperations(new L.Q(a,p+t.length+1,c,m+1),t,i)):(v=Ti._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=v.length===1?i:null);for(const w of v)s.addTrackedEditOperation(w.range,w.text)}static _createRemoveBlockCommentOperations(e,t,i){const n=[];return L.Q.isEmpty(e)?n.push(Le.k.delete(new L.Q(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(n.push(Le.k.delete(new L.Q(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),n.push(Le.k.delete(new L.Q(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),n}static _createAddBlockCommentOperations(e,t,i,n){const o=[];return L.Q.isEmpty(e)?o.push(Le.k.replace(new L.Q(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+"  "+i)):(o.push(Le.k.insert(new ee.y(e.startLineNumber,e.startColumn),t+(n?" ":""))),o.push(Le.k.insert(new ee.y(e.endLineNumber,e.endColumn),(n?" ":"")+i))),o}getEditOperations(e,t){const i=this._selection.startLineNumber,n=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);const o=e.getLanguageIdAtPosition(i,n),s=this.languageConfigurationService.getLanguageConfiguration(o).comments;!s||!s.blockCommentStartToken||!s.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,s.blockCommentStartToken,s.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(i.length===2){const n=i[0],o=i[1];return new q.L(n.range.endLineNumber,n.range.endColumn,o.range.startLineNumber,o.range.startColumn)}else{const n=i[0].range,o=this._usedEndToken?-this._usedEndToken.length-1:0;return new q.L(n.endLineNumber,n.endColumn+o,n.endLineNumber,n.endColumn+o)}}}class ui{constructor(e,t,i,n,o,s,a){this.languageConfigurationService=e,this._selection=t,this._tabSize=i,this._type=n,this._insertSpace=o,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=s,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,i,n){e.tokenization.tokenizeIfCheap(t);const o=e.getLanguageIdAtPosition(t,1),s=n.getLanguageConfiguration(o).comments,a=s?s.lineCommentToken:null;if(!a)return null;const l=[];for(let c=0,d=i-t+1;c<d;c++)l[c]={ignore:!1,commentStr:a,commentStrOffset:0,commentStrLength:a.length};return l}static _analyzeLines(e,t,i,n,o,s,a,l){let c=!0,d;e===0?d=!0:e===1?d=!1:d=!0;for(let u=0,h=n.length;u<h;u++){const p=n[u],m=o+u;if(m===o&&a){p.ignore=!0;continue}const v=i.getLineContent(m),w=G.HG(v);if(w===-1){p.ignore=s,p.commentStrOffset=v.length;continue}if(c=!1,p.ignore=!1,p.commentStrOffset=w,d&&!Ti._haystackHasNeedleAtOffset(v,p.commentStr,w)&&(e===0?d=!1:e===1||(p.ignore=!0)),d&&t){const R=w+p.commentStrLength;R<v.length&&v.charCodeAt(R)===32&&(p.commentStrLength+=1)}}if(e===0&&c){d=!1;for(let u=0,h=n.length;u<h;u++)n[u].ignore=!1}return{supported:!0,shouldRemoveComments:d,lines:n}}static _gatherPreflightData(e,t,i,n,o,s,a,l){const c=ui._gatherPreflightCommentStrings(i,n,o,l);return c===null?{supported:!1}:ui._analyzeLines(e,t,i,c,n,s,a,l)}_executeLineComments(e,t,i,n){let o;i.shouldRemoveComments?o=ui._createRemoveLineCommentsOperations(i.lines,n.startLineNumber):(ui._normalizeInsertionPoint(e,i.lines,n.startLineNumber,this._tabSize),o=this._createAddLineCommentsOperations(i.lines,n.startLineNumber));const s=new ee.y(n.positionLineNumber,n.positionColumn);for(let a=0,l=o.length;a<l;a++)t.addEditOperation(o[a].range,o[a].text),L.Q.isEmpty(o[a].range)&&L.Q.getStartPosition(o[a].range).equals(s)&&e.getLineContent(s.lineNumber).length+1===s.column&&(this._deltaColumn=(o[a].text||"").length);this._selectionId=t.trackSelection(n)}_attemptRemoveBlockComment(e,t,i,n){let o=t.startLineNumber,s=t.endLineNumber;const a=n.length+Math.max(e.getLineFirstNonWhitespaceColumn(t.startLineNumber),t.startColumn);let l=e.getLineContent(o).lastIndexOf(i,a-1),c=e.getLineContent(s).indexOf(n,t.endColumn-1-i.length);return l!==-1&&c===-1&&(c=e.getLineContent(o).indexOf(n,l+i.length),s=o),l===-1&&c!==-1&&(l=e.getLineContent(s).lastIndexOf(i,c),o=s),t.isEmpty()&&(l===-1||c===-1)&&(l=e.getLineContent(o).indexOf(i),l!==-1&&(c=e.getLineContent(o).indexOf(n,l+i.length))),l!==-1&&e.getLineContent(o).charCodeAt(l+i.length)===32&&(i+=" "),c!==-1&&e.getLineContent(s).charCodeAt(c-1)===32&&(n=" "+n,c-=1),l!==-1&&c!==-1?Ti._createRemoveBlockCommentOperations(new L.Q(o,l+i.length+1,s,c+1),i,n):null}_executeBlockComment(e,t,i){e.tokenization.tokenizeIfCheap(i.startLineNumber);const n=e.getLanguageIdAtPosition(i.startLineNumber,1),o=this.languageConfigurationService.getLanguageConfiguration(n).comments;if(!o||!o.blockCommentStartToken||!o.blockCommentEndToken)return;const s=o.blockCommentStartToken,a=o.blockCommentEndToken;let l=this._attemptRemoveBlockComment(e,i,s,a);if(!l){if(i.isEmpty()){const c=e.getLineContent(i.startLineNumber);let d=G.HG(c);d===-1&&(d=c.length),l=Ti._createAddBlockCommentOperations(new L.Q(i.startLineNumber,d+1,i.startLineNumber,c.length+1),s,a,this._insertSpace)}else l=Ti._createAddBlockCommentOperations(new L.Q(i.startLineNumber,e.getLineFirstNonWhitespaceColumn(i.startLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),s,a,this._insertSpace);l.length===1&&(this._deltaColumn=s.length+1)}this._selectionId=t.trackSelection(i);for(const c of l)t.addEditOperation(c.range,c.text)}getEditOperations(e,t){let i=this._selection;if(this._moveEndPositionDown=!1,i.startLineNumber===i.endLineNumber&&this._ignoreFirstLine){t.addEditOperation(new L.Q(i.startLineNumber,e.getLineMaxColumn(i.startLineNumber),i.startLineNumber+1,1),i.startLineNumber===e.getLineCount()?"":`
`),this._selectionId=t.trackSelection(i);return}i.startLineNumber<i.endLineNumber&&i.endColumn===1&&(this._moveEndPositionDown=!0,i=i.setEndPosition(i.endLineNumber-1,e.getLineMaxColumn(i.endLineNumber-1)));const n=ui._gatherPreflightData(this._type,this._insertSpace,e,i.startLineNumber,i.endLineNumber,this._ignoreEmptyLines,this._ignoreFirstLine,this.languageConfigurationService);return n.supported?this._executeLineComments(e,t,n,i):this._executeBlockComment(e,t,i)}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),new q.L(i.selectionStartLineNumber,i.selectionStartColumn+this._deltaColumn,i.positionLineNumber,i.positionColumn+this._deltaColumn)}static _createRemoveLineCommentsOperations(e,t){const i=[];for(let n=0,o=e.length;n<o;n++){const s=e[n];s.ignore||i.push(Le.k.delete(new L.Q(t+n,s.commentStrOffset+1,t+n,s.commentStrOffset+s.commentStrLength+1)))}return i}_createAddLineCommentsOperations(e,t){const i=[],n=this._insertSpace?" ":"";for(let o=0,s=e.length;o<s;o++){const a=e[o];a.ignore||i.push(Le.k.insert(new ee.y(t+o,a.commentStrOffset+1),a.commentStr+n))}return i}static nextVisibleColumn(e,t,i,n){return i?e+(t-e%t):e+n}static _normalizeInsertionPoint(e,t,i,n){let o=1073741824,s,a;for(let l=0,c=t.length;l<c;l++){if(t[l].ignore)continue;const d=e.getLineContent(i+l);let u=0;for(let h=0,p=t[l].commentStrOffset;u<o&&h<p;h++)u=ui.nextVisibleColumn(u,n,d.charCodeAt(h)===9,1);u<o&&(o=u)}o=Math.floor(o/n)*n;for(let l=0,c=t.length;l<c;l++){if(t[l].ignore)continue;const d=e.getLineContent(i+l);let u=0;for(s=0,a=t[l].commentStrOffset;u<o&&s<a;s++)u=ui.nextVisibleColumn(u,n,d.charCodeAt(s)===9,1);u>o?t[l].commentStrOffset=s-1:t[l].commentStrOffset=s}}}class rc extends _.ks{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(it.JZ);if(!t.hasModel())return;const n=t.getModel(),o=[],s=n.getOptions(),a=t.getOption(19),l=t.getSelections().map((d,u)=>({selection:d,index:u,ignoreFirstLine:!1}));l.sort((d,u)=>L.Q.compareRangesUsingStarts(d.selection,u.selection));let c=l[0];for(let d=1;d<l.length;d++){const u=l[d];c.selection.endLineNumber===u.selection.startLineNumber&&(c.index<u.index?u.ignoreFirstLine=!0:(c.ignoreFirstLine=!0,c=u))}for(const d of l)o.push(new ui(i,d.selection,s.tabSize,this._type,a.insertSpace,a.ignoreEmptyLines,d.ignoreFirstLine));t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class KC extends rc{constructor(){super(0,{id:"editor.action.commentLine",label:g.kg("comment.line","Toggle Line Comment"),alias:"Toggle Line Comment",precondition:D.R.writable,kbOpts:{kbExpr:D.R.editorTextFocus,primary:2133,weight:100},menuOpts:{menuId:z.D8.MenubarEditMenu,group:"5_insert",title:g.kg({key:"miToggleLineComment",comment:["&& denotes a mnemonic"]},"&&Toggle Line Comment"),order:1}})}}class QC extends rc{constructor(){super(1,{id:"editor.action.addCommentLine",label:g.kg("comment.line.add","Add Line Comment"),alias:"Add Line Comment",precondition:D.R.writable,kbOpts:{kbExpr:D.R.editorTextFocus,primary:(0,Ee.m5)(2089,2081),weight:100}})}}class ZC extends rc{constructor(){super(2,{id:"editor.action.removeCommentLine",label:g.kg("comment.line.remove","Remove Line Comment"),alias:"Remove Line Comment",precondition:D.R.writable,kbOpts:{kbExpr:D.R.editorTextFocus,primary:(0,Ee.m5)(2089,2099),weight:100}})}}class YC extends _.ks{constructor(){super({id:"editor.action.blockComment",label:g.kg("comment.block","Toggle Block Comment"),alias:"Toggle Block Comment",precondition:D.R.writable,kbOpts:{kbExpr:D.R.editorTextFocus,primary:1567,linux:{primary:3103},weight:100},menuOpts:{menuId:z.D8.MenubarEditMenu,group:"5_insert",title:g.kg({key:"miToggleBlockComment",comment:["&& denotes a mnemonic"]},"Toggle &&Block Comment"),order:2}})}run(e,t){const i=e.get(it.JZ);if(!t.hasModel())return;const n=t.getOption(19),o=[],s=t.getSelections();for(const a of s)o.push(new Ti(a,n.insertSpace,i));t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}(0,_.Fl)(KC),(0,_.Fl)(QC),(0,_.Fl)(ZC),(0,_.Fl)(YC);var XC=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},oo=function(r,e){return function(t,i){e(t,i,r)}};let so=class cm{constructor(e,t,i,n,o,s,a){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=n,this._keybindingService=o,this._menuService=s,this._configurationService=a,this._toDispose=new I.Cm,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu(l=>this._onContextMenu(l))),this._toDispose.add(this._editor.onMouseWheel(l=>{if(this._contextMenuIsBeingShownCount>0){const c=this._contextViewService.getContextViewElement(),d=l.srcElement;d.shadowRoot&&S.jG(c)===d.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(l=>{this._editor.getOption(20)&&l.keyCode===58&&(l.preventDefault(),l.stopPropagation(),this.showContextMenu())}))}static get(e){return e.getContribution(cm.ID)}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(20)){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({x:e.event.posx-1,width:2,y:e.event.posy-1,height:2});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={x:e.event.posx-1,width:2,y:e.event.posy-1,height:2}),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(20)||!this._editor.hasModel())return;const t=this._getMenuActions(this._editor.getModel(),this._editor.isSimpleWidget?z.D8.SimpleEditorContext:z.D8.EditorContext);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const i=[],n=this._menuService.createMenu(t,this._contextKeyService),o=n.getActions({arg:e.uri});n.dispose();for(const s of o){const[,a]=s;let l=0;for(const c of a)if(c instanceof z.nI){const d=this._getMenuActions(e,c.item.submenu);d.length>0&&(i.push(new He.YH(c.id,c.label,d)),l++)}else i.push(c),l++;l&&i.push(new He.wv)}return i.length&&i.pop(),i}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;const i=this._editor.getOption(55);if(this._editor.updateOptions({hover:{enabled:!1}}),!t){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const o=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),s=S.BK(this._editor.getDomNode()),a=s.left+o.left,l=s.top+o.top+o.height;t={x:a,y:l}}const n=this._editor.getOption(117)&&!Se.un;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:n?this._editor.getDomNode():void 0,getAnchor:()=>t,getActions:()=>e,getActionViewItem:o=>{const s=this._keybindingFor(o);if(s)return new ns.Z(o,o,{label:!0,keybinding:s.getLabel(),isMenu:!0});const a=o;return typeof a.getActionViewItem=="function"?a.getActionViewItem():new ns.Z(o,o,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:o=>this._keybindingFor(o),onHide:o=>{this._contextMenuIsBeingShownCount--,this._editor.focus(),this._editor.updateOptions({hover:i})}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel())return;const t=this._editor.getOption(67);let i=0;const n=c=>({id:`menu-action-${++i}`,label:c.label,tooltip:"",class:void 0,enabled:typeof c.enabled>"u"?!0:c.enabled,checked:c.checked,run:c.run,dispose:()=>null}),o=(c,d)=>new He.YH(`menu-action-${++i}`,c,d,void 0),s=(c,d,u,h,p)=>{if(!d)return n({label:c,enabled:d,run:()=>{}});const m=w=>()=>{this._configurationService.updateValue(u,w)},v=[];for(const w of p)v.push(n({label:w.label,checked:h===w.value,run:m(w.value)}));return o(c,v)},a=[];a.push(n({label:g.kg("context.minimap.minimap","Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new He.wv),a.push(n({label:g.kg("context.minimap.renderCharacters","Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(s(g.kg("context.minimap.size","Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:g.kg("context.minimap.size.proportional","Proportional"),value:"proportional"},{label:g.kg("context.minimap.size.fill","Fill"),value:"fill"},{label:g.kg("context.minimap.size.fit","Fit"),value:"fit"}])),a.push(s(g.kg("context.minimap.slider","Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:g.kg("context.minimap.slider.mouseover","Mouse Over"),value:"mouseover"},{label:g.kg("context.minimap.slider.always","Always"),value:"always"}]));const l=this._editor.getOption(117)&&!Se.un;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:l?this._editor.getDomNode():void 0,getAnchor:()=>e,getActions:()=>a,onHide:c=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}};so.ID="editor.contrib.contextmenu",so=XC([oo(1,ni.Z),oo(2,ni.l),oo(3,A.fN),oo(4,tt.b),oo(5,z.ez),oo(6,Fe.pG)],so);class JC extends _.ks{constructor(){super({id:"editor.action.showContextMenu",label:g.kg("action.showContextMenu.label","Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:D.R.textInputFocus,primary:1092,weight:100}})}run(e,t){var i;(i=so.get(t))===null||i===void 0||i.showContextMenu()}}(0,_.HW)(so.ID,so),(0,_.Fl)(JC);class ac{constructor(e){this.selections=e}equals(e){const t=this.selections.length,i=e.selections.length;if(t!==i)return!1;for(let n=0;n<t;n++)if(!this.selections[n].equalsSelection(e.selections[n]))return!1;return!0}}class lc{constructor(e,t,i){this.cursorState=e,this.scrollTop=t,this.scrollLeft=i}}class hn extends I.jG{constructor(e){super(),this._editor=e,this._isCursorUndoRedo=!1,this._undoStack=[],this._redoStack=[],this._register(e.onDidChangeModel(t=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeModelContent(t=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeCursorSelection(t=>{if(this._isCursorUndoRedo||!t.oldSelections||t.oldModelVersionId!==t.modelVersionId)return;const i=new ac(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new lc(i,e.getScrollTop(),e.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())}))}static get(e){return e.getContribution(hn.ID)}cursorUndo(){!this._editor.hasModel()||this._undoStack.length===0||(this._redoStack.push(new lc(new ac(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 lc(new ac(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}}hn.ID="editor.contrib.cursorUndoRedoController";class qC extends _.ks{constructor(){super({id:"cursorUndo",label:g.kg("cursor.undo","Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:D.R.textInputFocus,primary:2099,weight:100}})}run(e,t,i){var n;(n=hn.get(t))===null||n===void 0||n.cursorUndo()}}class e0 extends _.ks{constructor(){super({id:"cursorRedo",label:g.kg("cursor.redo","Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,i){var n;(n=hn.get(t))===null||n===void 0||n.cursorRedo()}}(0,_.HW)(hn.ID,hn),(0,_.Fl)(qC),(0,_.Fl)(e0);class t0{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 L.Q(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 q.L(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 q.L(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumber<this.selection.endLineNumber){this.targetSelection=new q.L(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber+this.selection.endLineNumber-this.selection.startLineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}this.selection.endColumn<=this.targetPosition.column?this.targetSelection=new q.L(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column-this.selection.endColumn+this.selection.startColumn:this.targetPosition.column-this.selection.endColumn+this.selection.startColumn,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column:this.selection.endColumn):this.targetSelection=new q.L(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column+this.selection.endColumn-this.selection.startColumn)}computeCursorState(e,t){return this.targetSelection}}function ro(r){return Se.zx?r.altKey:r.ctrlKey}class hi extends I.jG{constructor(e){super(),this._editor=e,this._dndDecorationIds=this._editor.createDecorationsCollection(),this._register(this._editor.onMouseDown(t=>this._onEditorMouseDown(t))),this._register(this._editor.onMouseUp(t=>this._onEditorMouseUp(t))),this._register(this._editor.onMouseDrag(t=>this._onEditorMouseDrag(t))),this._register(this._editor.onMouseDrop(t=>this._onEditorMouseDrop(t))),this._register(this._editor.onMouseDropCanceled(()=>this._onEditorMouseDropCanceled())),this._register(this._editor.onKeyDown(t=>this.onEditorKeyDown(t))),this._register(this._editor.onKeyUp(t=>this.onEditorKeyUp(t))),this._register(this._editor.onDidBlurEditorWidget(()=>this.onEditorBlur())),this._register(this._editor.onDidBlurEditorText(()=>this.onEditorBlur())),this._mouseDown=!1,this._modifierPressed=!1,this._dragSelection=null}onEditorBlur(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1}onEditorKeyDown(e){!this._editor.getOption(31)||this._editor.getOption(18)||(ro(e)&&(this._modifierPressed=!0),this._mouseDown&&ro(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(31)||this._editor.getOption(18)||(ro(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===hi.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(o=>t.position&&o.containsPosition(t.position));if(n.length===1)this._dragSelection=n[0];else return}ro(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 ee.y(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:o,selectionStartColumn:s}=n;i=[new q.L(o,s,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map(n=>n.containsPosition(t)?new q.L(t.lineNumber,t.column,t.lineNumber,t.column):n);this._editor.setSelections(i||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(ro(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(hi.ID,new t0(this._dragSelection,t,ro(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 L.Q(e.lineNumber,e.column,e.lineNumber,e.column),options:hi._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()}}hi.ID="editor.contrib.dragAndDrop",hi.TRIGGER_KEY_VALUE=Se.zx?6:5,hi._DECORATION_OPTIONS=ge.kI.register({description:"dnd-target",className:"dnd-target"}),(0,_.HW)(hi.ID,hi);var $g=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},ws=function(r,e){return function(t,i){e(t,i,r)}},da=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};let Ds=class extends I.jG{constructor(e,t,i,n,o){super(),this._bulkEditService=t,this._languageFeaturesService=i,this._progressService=n,this._register(e.onDropIntoEditor(s=>this.onDropIntoEditor(e,s.position,s.event))),this._languageFeaturesService.documentOnDropEditProvider.register("*",new dc(o))}onDropIntoEditor(e,t,i){return da(this,void 0,void 0,function*(){if(!i.dataTransfer||!e.hasModel())return;const n=e.getModel(),o=n.getVersionId(),s=yield this.extractDataTransferData(i);if(s.size===0||e.getModel().getVersionId()!==o)return;const a=new Di.gI(e,1);try{const l=this._languageFeaturesService.documentOnDropEditProvider.ordered(n),c=yield this._progressService.withProgress({location:15,delay:750,title:(0,g.kg)("dropProgressTitle","Running drop handlers..."),cancellable:!0},()=>(0,V.PK)(da(this,void 0,void 0,function*(){for(const d of l){const u=yield d.provideDocumentOnDropEdits(n,t,s,a.token);if(a.token.isCancellationRequested)return;if(u)return u}}),a.token),()=>{a.cancel()});if(a.token.isCancellationRequested||e.getModel().getVersionId()!==o)return;if(c){const d=new L.Q(t.lineNumber,t.column,t.lineNumber,t.column);Ug(e,typeof c.insertText=="string"?Ri.escape(c.insertText):c.insertText.snippet,[q.L.fromRange(d,0)]),c.additionalEdit&&(yield this._bulkEditService.apply(wi.jN.convert(c.additionalEdit),{editor:e}));return}}finally{a.dispose()}})}extractDataTransferData(e){return da(this,void 0,void 0,function*(){if(!e.dataTransfer)return new Ag;const t=nc(e.dataTransfer);return BC(t,e),t})}};Ds.ID="editor.contrib.dropIntoEditorController",Ds=$g([ws(1,wi.nu),ws(2,te.u),ws(3,Dt.G5),ws(4,di.VR)],Ds);let dc=class{constructor(e){this._workspaceContextService=e}provideDocumentOnDropEdits(e,t,i,n){var o;return da(this,void 0,void 0,function*(){const s=i.get(un.K.uriList);if(s){const l=yield s.asString(),c=this.getUriListInsertText(l);if(c)return{insertText:c}}const a=(o=i.get("text"))!==null&&o!==void 0?o:i.get(un.K.text);if(a)return{insertText:yield a.asString()}})}getUriListInsertText(e){const t=[];for(const i of oc.parse(e))try{t.push(me.r.parse(i))}catch{}if(t.length)return t.map(i=>{const n=this._workspaceContextService.getWorkspaceFolder(i);if(n){const o=(0,De.iZ)(n.uri,i);if(o)return o}return i.fsPath}).join(" ")}};dc=$g([ws(0,di.VR)],dc),(0,_.HW)(Ds.ID,Ds);var i0=f(104);class Je{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}getCurrentMatchesPosition(e){const t=this._editor.getModel().getDecorationsInRange(e);for(const i of t){const n=i.options;if(n===Je._FIND_MATCH_DECORATION||n===Je._CURRENT_FIND_MATCH_DECORATION)return this._getDecorationIndex(i.id)}return 0}setCurrentFindMatch(e){let t=null,i=0;if(e)for(let n=0,o=this._decorations.length;n<o;n++){const s=this._editor.getModel().getDecorationRange(this._decorations[n]);if(e.equalsRange(s)){t=this._decorations[n],i=n+1;break}}return(this._highlightedDecorationId!==null||t!==null)&&this._editor.changeDecorations(n=>{if(this._highlightedDecorationId!==null&&(n.changeDecorationOptions(this._highlightedDecorationId,Je._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,n.changeDecorationOptions(this._highlightedDecorationId,Je._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(n.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let o=this._editor.getModel().getDecorationRange(t);if(o.startLineNumber!==o.endLineNumber&&o.endColumn===1){const s=o.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(s);o=new L.Q(o.startLineNumber,o.startColumn,s,a)}this._rangeHighlightDecorationId=n.addDecoration(o,Je._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let n=Je._FIND_MATCH_DECORATION;const o=[];if(e.length>1e3){n=Je._FIND_MATCH_NO_OVERVIEW_DECORATION;const a=this._editor.getModel().getLineCount(),c=this._editor.getLayoutInfo().height/a,d=Math.max(2,Math.ceil(3/c));let u=e[0].range.startLineNumber,h=e[0].range.endLineNumber;for(let p=1,m=e.length;p<m;p++){const v=e[p].range;h+d>=v.startLineNumber?v.endLineNumber>h&&(h=v.endLineNumber):(o.push({range:new L.Q(u,1,h,1),options:Je._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),u=v.startLineNumber,h=v.endLineNumber)}o.push({range:new L.Q(u,1,h,1),options:Je._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const s=new Array(e.length);for(let a=0,l=e.length;a<l;a++)s[a]={range:e[a].range,options:n};this._decorations=i.deltaDecorations(this._decorations,s),this._overviewRulerApproximateDecorations=i.deltaDecorations(this._overviewRulerApproximateDecorations,o),this._rangeHighlightDecorationId&&(i.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),this._findScopeDecorationIds.length&&(this._findScopeDecorationIds.forEach(a=>i.removeDecoration(a)),this._findScopeDecorationIds=[]),t?.length&&(this._findScopeDecorationIds=t.map(a=>i.addDecoration(a,Je._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){const i=this._decorations[t],n=this._editor.getModel().getDecorationRange(i);if(!(!n||n.endLineNumber>e.lineNumber)){if(n.endLineNumber<e.lineNumber)return n;if(!(n.endColumn>e.column))return n}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,i=this._decorations.length;t<i;t++){const n=this._decorations[t],o=this._editor.getModel().getDecorationRange(n);if(!(!o||o.startLineNumber<e.lineNumber)){if(o.startLineNumber>e.lineNumber)return o;if(!(o.startColumn<e.column))return o}}return this._editor.getModel().getDecorationRange(this._decorations[0])}_allDecorations(){let e=[];return e=e.concat(this._decorations),e=e.concat(this._overviewRulerApproximateDecorations),this._findScopeDecorationIds.length&&e.push(...this._findScopeDecorationIds),this._rangeHighlightDecorationId&&e.push(this._rangeHighlightDecorationId),e}}Je._CURRENT_FIND_MATCH_DECORATION=ge.kI.register({description:"current-find-match",stickiness:1,zIndex:13,className:"currentFindMatch",showIfCollapsed:!0,overviewRuler:{color:(0,U.Yf)(C.fAP),position:We.A5.Center},minimap:{color:(0,U.Yf)(C.AjU),position:We.R3.Inline}}),Je._FIND_MATCH_DECORATION=ge.kI.register({description:"find-match",stickiness:1,zIndex:10,className:"findMatch",showIfCollapsed:!0,overviewRuler:{color:(0,U.Yf)(C.fAP),position:We.A5.Center},minimap:{color:(0,U.Yf)(C.AjU),position:We.R3.Inline}}),Je._FIND_MATCH_NO_OVERVIEW_DECORATION=ge.kI.register({description:"find-match-no-overview",stickiness:1,className:"findMatch",showIfCollapsed:!0}),Je._FIND_MATCH_ONLY_OVERVIEW_DECORATION=ge.kI.register({description:"find-match-only-overview",stickiness:1,overviewRuler:{color:(0,U.Yf)(C.fAP),position:We.A5.Center}}),Je._RANGE_HIGHLIGHT_DECORATION=ge.kI.register({description:"find-range-highlight",stickiness:1,className:"rangeHighlight",isWholeLine:!0}),Je._FIND_SCOPE_DECORATION=ge.kI.register({description:"find-scope",className:"findScope",isWholeLine:!0});class n0{constructor(e,t,i){this._editorSelection=e,this._ranges=t,this._replaceStrings=i,this._trackedEditorSelectionId=null}getEditOperations(e,t){if(this._ranges.length>0){const i=[];for(let s=0;s<this._ranges.length;s++)i.push({range:this._ranges[s],text:this._replaceStrings[s]});i.sort((s,a)=>L.Q.compareRangesUsingStarts(s.range,a.range));const n=[];let o=i[0];for(let s=1;s<i.length;s++)o.range.endLineNumber===i[s].range.startLineNumber&&o.range.endColumn===i[s].range.startColumn?(o.range=o.range.plusRange(i[s].range),o.text=o.text+i[s].text):(n.push(o),o=i[s]);n.push(o);for(const s of n)t.addEditOperation(s.range,s.text)}this._trackedEditorSelectionId=t.trackSelection(this._editorSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._trackedEditorSelectionId)}}function jg(r,e){if(r&&r[0]!==""){const t=Gg(r,e,"-"),i=Gg(r,e,"_");return t&&!i?Kg(r,e,"-"):!t&&i?Kg(r,e,"_"):r[0].toUpperCase()===r[0]?e.toUpperCase():r[0].toLowerCase()===r[0]?e.toLowerCase():G.zY(r[0][0])&&e.length>0?e[0].toUpperCase()+e.substr(1):r[0][0].toUpperCase()!==r[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function Gg(r,e,t){return r[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&r[0].split(t).length===e.split(t).length}function Kg(r,e,t){const i=e.split(t),n=r[0].split(t);let o="";return i.forEach((s,a)=>{o+=jg([n[a]],s)+t}),o.slice(0,-1)}class Qg{constructor(e){this.staticValue=e,this.kind=0}}class o0{constructor(e){this.pieces=e,this.kind=1}}class ao{constructor(e){!e||e.length===0?this._state=new Qg(""):e.length===1&&e[0].staticValue!==null?this._state=new Qg(e[0].staticValue):this._state=new o0(e)}static fromStaticValue(e){return new ao([gn.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}buildReplaceString(e,t){if(this._state.kind===0)return t?jg(e,this._state.staticValue):this._state.staticValue;let i="";for(let n=0,o=this._state.pieces.length;n<o;n++){const s=this._state.pieces[n];if(s.staticValue!==null){i+=s.staticValue;continue}let a=ao._substitute(s.matchIndex,e);if(s.caseOps!==null&&s.caseOps.length>0){const l=[],c=s.caseOps.length;let d=0;for(let u=0,h=a.length;u<h;u++){if(d>=c){l.push(a.slice(u));break}switch(s.caseOps[d]){case"U":l.push(a[u].toUpperCase());break;case"u":l.push(a[u].toUpperCase()),d++;break;case"L":l.push(a[u].toLowerCase());break;case"l":l.push(a[u].toLowerCase()),d++;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<t.length)return(t[e]||"")+i;i=String(e%10)+i,e=Math.floor(e/10)}return"$"+i}}class gn{constructor(e,t,i){this.staticValue=e,this.matchIndex=t,!i||i.length===0?this.caseOps=null:this.caseOps=i.slice(0)}static staticValue(e){return new gn(e,-1,null)}static caseOps(e,t){return new gn(null,e,t)}}class s0{constructor(e){this._source=e,this._lastCharIndex=0,this._result=[],this._resultLen=0,this._currentStaticPiece=""}emitUnchanged(e){this._emitStatic(this._source.substring(this._lastCharIndex,e)),this._lastCharIndex=e}emitStatic(e,t){this._emitStatic(e),this._lastCharIndex=t}_emitStatic(e){e.length!==0&&(this._currentStaticPiece+=e)}emitMatchIndex(e,t,i){this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=gn.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),this._result[this._resultLen++]=gn.caseOps(e,i),this._lastCharIndex=t}finalize(){return this.emitUnchanged(this._source.length),this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=gn.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),new ao(this._result)}}function r0(r){if(!r||r.length===0)return new ao(null);const e=[],t=new s0(r);for(let i=0,n=r.length;i<n;i++){const o=r.charCodeAt(i);if(o===92){if(i++,i>=n)break;const s=r.charCodeAt(i);switch(s){case 92:t.emitUnchanged(i-1),t.emitStatic("\\",i+1);break;case 110:t.emitUnchanged(i-1),t.emitStatic(`
`,i+1);break;case 116:t.emitUnchanged(i-1),t.emitStatic("	",i+1);break;case 117:case 85:case 108:case 76:t.emitUnchanged(i-1),t.emitStatic("",i+1),e.push(String.fromCharCode(s));break}continue}if(o===36){if(i++,i>=n)break;const s=r.charCodeAt(i);if(s===36){t.emitUnchanged(i-1),t.emitStatic("$",i+1);continue}if(s===48||s===38){t.emitUnchanged(i-1),t.emitMatchIndex(0,i+1,e),e.length=0;continue}if(49<=s&&s<=57){let a=s-48;if(i+1<n){const l=r.charCodeAt(i+1);if(48<=l&&l<=57){i++,a=a*10+(l-48),t.emitUnchanged(i-2),t.emitMatchIndex(a,i+1,e),e.length=0;continue}}t.emitUnchanged(i-1),t.emitMatchIndex(a,i+1,e),e.length=0;continue}}}return t.finalize()}const Oi=new A.N1("findWidgetVisible",!1),LL=Oi.toNegated(),ca=new A.N1("findInputFocussed",!1),cc=new A.N1("replaceInputFocussed",!1),ua={primary:545,mac:{primary:2593}},ha={primary:565,mac:{primary:2613}},ga={primary:560,mac:{primary:2608}},fa={primary:554,mac:{primary:2602}},pa={primary:558,mac:{primary:2606}},Ce={StartFindAction:"actions.find",StartFindWithSelection:"actions.findWithSelection",StartFindWithArgs:"editor.actions.findWithArgs",NextMatchFindAction:"editor.action.nextMatchFindAction",PreviousMatchFindAction:"editor.action.previousMatchFindAction",NextSelectionMatchFindAction:"editor.action.nextSelectionMatchFindAction",PreviousSelectionMatchFindAction:"editor.action.previousSelectionMatchFindAction",StartFindReplaceAction:"editor.action.startFindReplaceAction",CloseFindWidgetCommand:"closeFindWidget",ToggleCaseSensitiveCommand:"toggleFindCaseSensitive",ToggleWholeWordCommand:"toggleFindWholeWord",ToggleRegexCommand:"toggleFindRegex",ToggleSearchScopeCommand:"toggleFindInSelection",TogglePreserveCaseCommand:"togglePreserveCase",ReplaceOneAction:"editor.action.replaceOne",ReplaceAllAction:"editor.action.replaceAll",SelectAllMatchesAction:"editor.action.selectAllMatches"},Fi=19999,a0=240;class xs{constructor(e,t){this._toDispose=new I.Cm,this._editor=e,this._state=t,this._isDisposed=!1,this._startSearchingTimer=new V.pc,this._decorations=new Je(e),this._toDispose.add(this._decorations),this._updateDecorationsScheduler=new V.uC(()=>this.research(!1),100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(i=>{(i.reason===3||i.reason===5||i.reason===6)&&this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(i=>{this._ignoreModelContentChanged||(i.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(i=>this._onStateChanged(i))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,(0,I.AS)(this._startSearchingTimer),this._toDispose.dispose()}_onStateChanged(e){this._isDisposed||this._editor.hasModel()&&(e.searchString||e.isReplaceRevealed||e.isRegex||e.wholeWord||e.matchCase||e.searchScope)&&(this._editor.getModel().isTooLargeForSyncing()?(this._startSearchingTimer.cancel(),this._startSearchingTimer.setIfNotSet(()=>{e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor)},a0)):e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor))}static _getSearchRange(e,t){return t||e.getFullModelRange()}research(e,t){let i=null;typeof t<"u"?t!==null&&(Array.isArray(t)?i=t:i=[t]):i=this._decorations.getFindScopes(),i!==null&&(i=i.map(a=>{if(a.startLineNumber!==a.endLineNumber){let l=a.endLineNumber;return a.endColumn===1&&(l=l-1),new L.Q(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));const n=this._findMatches(i,!1,Fi);this._decorations.set(n,i);const o=this._editor.getSelection();let s=this._decorations.getCurrentMatchesPosition(o);if(s===0&&n.length>0){const a=(0,pe.aB)(n.map(l=>l.range),l=>L.Q.compareRangesUsingStarts(l,o)>=0);s=a>0?a-1+1:s}this._state.changeMatchInfo(s,this._decorations.getCount(),void 0),e&&this._editor.getOption(37).cursorMoveOnType&&this._moveToNextMatch(this._decorations.getStartPosition())}_hasMatches(){return this._state.matchesCount>0}_cannotFind(){if(!this._hasMatches()){const e=this._decorations.getFindScope();return e&&this._editor.revealRangeInCenterIfOutsideViewport(e,0),!0}return!1}_setCurrentFindMatch(e){const t=this._decorations.setCurrentFindMatch(e);this._state.changeMatchInfo(t,this._decorations.getCount(),e),this._editor.setSelection(e),this._editor.revealRangeInCenterIfOutsideViewport(e,0)}_prevSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:n}=e;const o=this._editor.getModel();return t||n===1?(i===1?i=o.getLineCount():i--,n=o.getLineMaxColumn(i)):n--,new ee.y(i,n)}_moveToPrevMatch(e,t=!1){if(!this._state.canNavigateBack()){const d=this._decorations.matchAfterPosition(e);d&&this._setCurrentFindMatch(d);return}if(this._decorations.getCount()<Fi){let d=this._decorations.matchBeforePosition(e);d&&d.isEmpty()&&d.getStartPosition().equals(e)&&(e=this._prevSearchPosition(e),d=this._decorations.matchBeforePosition(e)),d&&this._setCurrentFindMatch(d);return}if(this._cannotFind())return;const i=this._decorations.getFindScope(),n=xs._getSearchRange(this._editor.getModel(),i);n.getEndPosition().isBefore(e)&&(e=n.getEndPosition()),e.isBefore(n.getStartPosition())&&(e=n.getEndPosition());const{lineNumber:o,column:s}=e,a=this._editor.getModel();let l=new ee.y(o,s),c=a.findPreviousMatch(this._state.searchString,l,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(119):null,!1);if(c&&c.range.isEmpty()&&c.range.getStartPosition().equals(l)&&(l=this._prevSearchPosition(l),c=a.findPreviousMatch(this._state.searchString,l,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(119):null,!1)),!!c){if(!t&&!n.containsRange(c.range))return this._moveToPrevMatch(c.range.getStartPosition(),!0);this._setCurrentFindMatch(c.range)}}moveToPrevMatch(){this._moveToPrevMatch(this._editor.getSelection().getStartPosition())}_nextSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:n}=e;const o=this._editor.getModel();return t||n===o.getLineMaxColumn(i)?(i===o.getLineCount()?i=1:i++,n=1):n++,new ee.y(i,n)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const i=this._decorations.matchBeforePosition(e);i&&this._setCurrentFindMatch(i);return}if(this._decorations.getCount()<Fi){let i=this._decorations.matchAfterPosition(e);i&&i.isEmpty()&&i.getStartPosition().equals(e)&&(e=this._nextSearchPosition(e),i=this._decorations.matchAfterPosition(e)),i&&this._setCurrentFindMatch(i);return}const t=this._getNextMatch(e,!1,!0);t&&this._setCurrentFindMatch(t.range)}_getNextMatch(e,t,i,n=!1){if(this._cannotFind())return null;const o=this._decorations.getFindScope(),s=xs._getSearchRange(this._editor.getModel(),o);s.getEndPosition().isBefore(e)&&(e=s.getStartPosition()),e.isBefore(s.getStartPosition())&&(e=s.getStartPosition());const{lineNumber:a,column:l}=e,c=this._editor.getModel();let d=new ee.y(a,l),u=c.findNextMatch(this._state.searchString,d,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(119):null,t);return i&&u&&u.range.isEmpty()&&u.range.getStartPosition().equals(d)&&(d=this._nextSearchPosition(d),u=c.findNextMatch(this._state.searchString,d,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(119):null,t)),u?!n&&!s.containsRange(u.range)?this._getNextMatch(u.range.getEndPosition(),t,i,!0):u:null}moveToNextMatch(){this._moveToNextMatch(this._editor.getSelection().getEndPosition())}_getReplacePattern(){return this._state.isRegex?r0(this._state.replaceString):ao.fromStaticValue(this._state.replaceString)}replace(){if(!this._hasMatches())return;const e=this._getReplacePattern(),t=this._editor.getSelection(),i=this._getNextMatch(t.getStartPosition(),!0,!1);if(i)if(t.equalsRange(i.range)){const n=e.buildReplaceString(i.matches,this._state.preserveCase),o=new yi.iu(t,n);this._executeEditorCommand("replace",o),this._decorations.setStartPosition(new ee.y(t.startLineNumber,t.startColumn+n.length)),this.research(!0)}else this._decorations.setStartPosition(this._editor.getPosition()),this._setCurrentFindMatch(i.range)}_findMatches(e,t,i){const n=(e||[null]).map(o=>xs._getSearchRange(this._editor.getModel(),o));return this._editor.getModel().findMatches(this._state.searchString,n,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(119):null,t,i)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();e===null&&this._state.matchesCount>=Fi?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new i0.lt(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(119):null).parseSearchRequest();if(!t)return;let i=t.regex;if(!i.multiline){let u="mu";i.ignoreCase&&(u+="i"),i.global&&(u+="g"),i=new RegExp(i.source,u)}const n=this._editor.getModel(),o=n.getValue(1),s=n.getFullModelRange(),a=this._getReplacePattern();let l;const c=this._state.preserveCase;a.hasReplacementPatterns||c?l=o.replace(i,function(){return a.buildReplaceString(arguments,c)}):l=o.replace(i,a.buildReplaceString(null,c));const d=new yi.ui(s,l,this._editor.getSelection());this._executeEditorCommand("replaceAll",d)}_regularReplaceAll(e){const t=this._getReplacePattern(),i=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),n=[];for(let s=0,a=i.length;s<a;s++)n[s]=t.buildReplaceString(i[s].matches,this._state.preserveCase);const o=new n0(this._editor.getSelection(),i.map(s=>s.range),n);this._executeEditorCommand("replaceAll",o)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let i=this._findMatches(e,!1,1073741824).map(o=>new q.L(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn));const n=this._editor.getSelection();for(let o=0,s=i.length;o<s;o++)if(i[o].equalsRange(n)){i=[n].concat(i.slice(0,o)).concat(i.slice(o+1));break}this._editor.setSelections(i)}_executeEditorCommand(e,t){try{this._ignoreModelContentChanged=!0,this._editor.pushUndoStop(),this._editor.executeCommand(e,t),this._editor.pushUndoStop()}finally{this._ignoreModelContentChanged=!1}}}var uc=f(5906);class ma extends Kn.x{constructor(e,t,i,n){super(),this._hideSoon=this._register(new V.uC(()=>this._hide(),2e3)),this._isVisible=!1,this._editor=e,this._state=t,this._keybindingService=i,this._domNode=document.createElement("div"),this._domNode.className="findOptionsWidget",this._domNode.style.display="none",this._domNode.style.top="10px",this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true");const o=n.getColorTheme().getColor(C.uNK),s=n.getColorTheme().getColor(C.$$0),a=n.getColorTheme().getColor(C.c1f);this.caseSensitive=this._register(new uc.bc({appendTitle:this._keybindingLabelFor(Ce.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase,inputActiveOptionBorder:o,inputActiveOptionForeground:s,inputActiveOptionBackground:a})),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new uc.nV({appendTitle:this._keybindingLabelFor(Ce.ToggleWholeWordCommand),isChecked:this._state.wholeWord,inputActiveOptionBorder:o,inputActiveOptionForeground:s,inputActiveOptionBackground:a})),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new uc.Ix({appendTitle:this._keybindingLabelFor(Ce.ToggleRegexCommand),isChecked:this._state.isRegex,inputActiveOptionBorder:o,inputActiveOptionForeground:s,inputActiveOptionBackground:a})),this._domNode.appendChild(this.regex.domNode),this._register(this.regex.onChange(()=>{this._state.change({isRegex:this.regex.checked},!1)})),this._editor.addOverlayWidget(this),this._register(this._state.onFindReplaceStateChange(l=>{let c=!1;l.isRegex&&(this.regex.checked=this._state.isRegex,c=!0),l.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,c=!0),l.matchCase&&(this.caseSensitive.checked=this._state.matchCase,c=!0),!this._state.isRevealed&&c&&this._revealTemporarily()})),this._register(S.ko(this._domNode,S.Bx.MOUSE_LEAVE,l=>this._onMouseLeave())),this._register(S.ko(this._domNode,"mouseover",l=>this._onMouseOver())),this._applyTheme(n.getColorTheme()),this._register(n.onDidColorThemeChange(this._applyTheme.bind(this)))}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return ma.ID}getDomNode(){return this._domNode}getPosition(){return{preference:0}}highlightFindOptions(){this._revealTemporarily()}_revealTemporarily(){this._show(),this._hideSoon.schedule()}_onMouseLeave(){this._hideSoon.schedule()}_onMouseOver(){this._hideSoon.cancel()}_show(){this._isVisible||(this._isVisible=!0,this._domNode.style.display="block")}_hide(){this._isVisible&&(this._isVisible=!1,this._domNode.style.display="none")}_applyTheme(e){const t={inputActiveOptionBorder:e.getColor(C.uNK),inputActiveOptionForeground:e.getColor(C.$$0),inputActiveOptionBackground:e.getColor(C.c1f)};this.caseSensitive.style(t),this.wholeWords.style(t),this.regex.style(t)}}ma.ID="editor.contrib.findOptionsWidget",(0,U.zy)((r,e)=>{const t=r.getColor(C.CgL);t&&e.addRule(`.monaco-editor .findOptionsWidget { background-color: ${t}; }`);const i=r.getColor(C.FiB);i&&e.addRule(`.monaco-editor .findOptionsWidget { color: ${i}; }`);const n=r.getColor(C.f9l);n&&e.addRule(`.monaco-editor .findOptionsWidget { box-shadow: 0 0 8px 2px ${n}; }`);const o=r.getColor(C.b1q);o&&e.addRule(`.monaco-editor .findOptionsWidget { border: 2px solid ${o}; }`)});function _a(r,e){return r===1?!0:r===2?!1:e}class l0 extends I.jG{constructor(){super(),this._onFindReplaceStateChange=this._register(new Z.vl),this.onFindReplaceStateChange=this._onFindReplaceStateChange.event,this._searchString="",this._replaceString="",this._isRevealed=!1,this._isReplaceRevealed=!1,this._isRegex=!1,this._isRegexOverride=0,this._wholeWord=!1,this._wholeWordOverride=0,this._matchCase=!1,this._matchCaseOverride=0,this._preserveCase=!1,this._preserveCaseOverride=0,this._searchScope=null,this._matchesPosition=0,this._matchesCount=0,this._currentMatch=null,this._loop=!0,this._isSearching=!1,this._filters=null}get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return _a(this._isRegexOverride,this._isRegex)}get wholeWord(){return _a(this._wholeWordOverride,this._wholeWord)}get matchCase(){return _a(this._matchCaseOverride,this._matchCase)}get preserveCase(){return _a(this._preserveCaseOverride,this._preserveCase)}get actualIsRegex(){return this._isRegex}get actualWholeWord(){return this._wholeWord}get actualMatchCase(){return this._matchCase}get actualPreserveCase(){return this._preserveCase}get searchScope(){return this._searchScope}get matchesPosition(){return this._matchesPosition}get matchesCount(){return this._matchesCount}get currentMatch(){return this._currentMatch}changeMatchInfo(e,t,i){const n={moveCursor:!1,updateHistory:!1,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let o=!1;t===0&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,n.matchesPosition=!0,o=!0),this._matchesCount!==t&&(this._matchesCount=t,n.matchesCount=!0,o=!0),typeof i<"u"&&(L.Q.equalsRange(this._currentMatch,i)||(this._currentMatch=i,n.currentMatch=!0,o=!0)),o&&this._onFindReplaceStateChange.fire(n)}change(e,t,i=!0){var n;const o={moveCursor:t,updateHistory:i,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let s=!1;const a=this.isRegex,l=this.wholeWord,c=this.matchCase,d=this.preserveCase;typeof e.searchString<"u"&&this._searchString!==e.searchString&&(this._searchString=e.searchString,o.searchString=!0,s=!0),typeof e.replaceString<"u"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,o.replaceString=!0,s=!0),typeof e.isRevealed<"u"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,o.isRevealed=!0,s=!0),typeof e.isReplaceRevealed<"u"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,o.isReplaceRevealed=!0,s=!0),typeof e.isRegex<"u"&&(this._isRegex=e.isRegex),typeof e.wholeWord<"u"&&(this._wholeWord=e.wholeWord),typeof e.matchCase<"u"&&(this._matchCase=e.matchCase),typeof e.preserveCase<"u"&&(this._preserveCase=e.preserveCase),typeof e.searchScope<"u"&&(!((n=e.searchScope)===null||n===void 0)&&n.every(u=>{var h;return(h=this._searchScope)===null||h===void 0?void 0:h.some(p=>!L.Q.equalsRange(p,u))})||(this._searchScope=e.searchScope,o.searchScope=!0,s=!0)),typeof e.loop<"u"&&this._loop!==e.loop&&(this._loop=e.loop,o.loop=!0,s=!0),typeof e.isSearching<"u"&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,o.isSearching=!0,s=!0),typeof e.filters<"u"&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,o.filters=!0,s=!0),this._isRegexOverride=typeof e.isRegexOverride<"u"?e.isRegexOverride:0,this._wholeWordOverride=typeof e.wholeWordOverride<"u"?e.wholeWordOverride:0,this._matchCaseOverride=typeof e.matchCaseOverride<"u"?e.matchCaseOverride:0,this._preserveCaseOverride=typeof e.preserveCaseOverride<"u"?e.preserveCaseOverride:0,a!==this.isRegex&&(s=!0,o.isRegex=!0),l!==this.wholeWord&&(s=!0,o.wholeWord=!0),c!==this.matchCase&&(s=!0,o.matchCase=!0),d!==this.preserveCase&&(s=!0,o.preserveCase=!0),s&&this._onFindReplaceStateChange.fire(o)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition<this.matchesCount}canNavigateInLoop(){return this._loop||this.matchesCount>=Fi}}function Zg(r){var e,t;return((e=r.lookupKeybinding("history.showPrevious"))===null||e===void 0?void 0:e.getElectronAccelerator())==="Up"&&((t=r.lookupKeybinding("history.showNext"))===null||t===void 0?void 0:t.getElectronAccelerator())==="Down"}var d0=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};const c0=(0,Ge.pU)("find-selection",Q.W6.selection,g.kg("findSelectionIcon","Icon for 'Find in Selection' in the editor find widget.")),Yg=(0,Ge.pU)("find-collapsed",Q.W6.chevronRight,g.kg("findCollapsedIcon","Icon to indicate that the editor find widget is collapsed.")),Xg=(0,Ge.pU)("find-expanded",Q.W6.chevronDown,g.kg("findExpandedIcon","Icon to indicate that the editor find widget is expanded.")),u0=(0,Ge.pU)("find-replace",Q.W6.replace,g.kg("findReplaceIcon","Icon for 'Replace' in the editor find widget.")),h0=(0,Ge.pU)("find-replace-all",Q.W6.replaceAll,g.kg("findReplaceAllIcon","Icon for 'Replace All' in the editor find widget.")),g0=(0,Ge.pU)("find-previous-match",Q.W6.arrowUp,g.kg("findPreviousMatchIcon","Icon for 'Find Previous' in the editor find widget.")),f0=(0,Ge.pU)("find-next-match",Q.W6.arrowDown,g.kg("findNextMatchIcon","Icon for 'Find Next' in the editor find widget.")),p0=g.kg("label.find","Find"),m0=g.kg("placeholder.find","Find"),_0=g.kg("label.previousMatchButton","Previous Match"),v0=g.kg("label.nextMatchButton","Next Match"),C0=g.kg("label.toggleSelectionFind","Find in Selection"),b0=g.kg("label.closeButton","Close"),S0=g.kg("label.replace","Replace"),y0=g.kg("placeholder.replace","Replace"),w0=g.kg("label.replaceButton","Replace"),D0=g.kg("label.replaceAllButton","Replace All"),x0=g.kg("label.toggleReplaceButton","Toggle Replace"),L0=g.kg("title.matchesCountLimit","Only the first {0} results are highlighted, but all find operations work on the entire text.",Fi),k0=g.kg("label.matchesLocation","{0} of {1}"),Jg=g.kg("label.noResults","No results"),Yt=419,I0=275-54;let Ls=69;const R0=33,qg="ctrlEnterReplaceAll.windows.donotask",ef=Se.zx?256:2048;class hc{constructor(e){this.afterLineNumber=e,this.heightInPx=R0,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function tf(r,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionStart>0){r.stopPropagation();return}}function nf(r,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionEnd<t.value.length){r.stopPropagation();return}}class va extends Kn.x{constructor(e,t,i,n,o,s,a,l,c){super(),this._cachedHeight=null,this._revealTimeouts=[],this._codeEditor=e,this._controller=t,this._state=i,this._contextViewProvider=n,this._keybindingService=o,this._contextKeyService=s,this._storageService=l,this._notificationService=c,this._ctrlEnterReplaceAllWarningPrompted=!!l.getBoolean(qg,0),this._isVisible=!1,this._isReplaceVisible=!1,this._ignoreChangeEvent=!1,this._updateHistoryDelayer=new V.ve(500),this._register((0,I.s)(()=>this._updateHistoryDelayer.cancel())),this._register(this._state.onFindReplaceStateChange(d=>this._onStateChanged(d))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration(d=>{if(d.hasChanged(83)&&(this._codeEditor.getOption(83)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),d.hasChanged(133)&&this._tryUpdateWidgetWidth(),d.hasChanged(2)&&this.updateAccessibilitySupport(),d.hasChanged(37)){const u=this._codeEditor.getOption(37).addExtraSpaceOnTop;u&&!this._viewZone&&(this._viewZone=new hc(0),this._showViewZone()),!u&&this._viewZone&&this._removeViewZone()}})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(()=>d0(this,void 0,void 0,function*(){if(this._isVisible){const d=yield this._controller.getGlobalBufferTerm();d&&d!==this._state.searchString&&(this._state.change({searchString:d},!1),this._findInput.select())}}))),this._findInputFocused=ca.bindTo(s),this._findFocusTracker=this._register(S.w5(this._findInput.inputBox.inputElement)),this._register(this._findFocusTracker.onDidFocus(()=>{this._findInputFocused.set(!0),this._updateSearchScope()})),this._register(this._findFocusTracker.onDidBlur(()=>{this._findInputFocused.set(!1)})),this._replaceInputFocused=cc.bindTo(s),this._replaceFocusTracker=this._register(S.w5(this._replaceInput.inputBox.inputElement)),this._register(this._replaceFocusTracker.onDidFocus(()=>{this._replaceInputFocused.set(!0),this._updateSearchScope()})),this._register(this._replaceFocusTracker.onDidBlur(()=>{this._replaceInputFocused.set(!1)})),this._codeEditor.addOverlayWidget(this),this._codeEditor.getOption(37).addExtraSpaceOnTop&&(this._viewZone=new hc(0)),this._applyTheme(a.getColorTheme()),this._register(a.onDidColorThemeChange(this._applyTheme.bind(this))),this._register(this._codeEditor.onDidChangeModel(()=>{this._isVisible&&(this._viewZoneId=void 0)})),this._register(this._codeEditor.onDidScrollChange(d=>{if(d.scrollTopChanged){this._layoutViewZone();return}setTimeout(()=>{this._layoutViewZone()},0)}))}getId(){return va.ID}getDomNode(){return this._domNode}getPosition(){return this._isVisible?{preference:0}:null}_onStateChanged(e){if(e.searchString){try{this._ignoreChangeEvent=!0,this._findInput.setValue(this._state.searchString)}finally{this._ignoreChangeEvent=!1}this._updateButtons()}if(e.replaceString&&(this._replaceInput.inputBox.value=this._state.replaceString),e.isRevealed&&(this._state.isRevealed?this._reveal():this._hide(!0)),e.isReplaceRevealed&&(this._state.isReplaceRevealed?!this._codeEditor.getOption(83)&&!this._isReplaceVisible&&(this._isReplaceVisible=!0,this._replaceInput.width=S.Tr(this._findInput.domNode),this._updateButtons(),this._replaceInput.inputBox.layout()):this._isReplaceVisible&&(this._isReplaceVisible=!1,this._updateButtons())),(e.isRevealed||e.isReplaceRevealed)&&(this._state.isRevealed||this._state.isReplaceRevealed)&&this._tryUpdateHeight()&&this._showViewZone(),e.isRegex&&this._findInput.setRegex(this._state.isRegex),e.wholeWord&&this._findInput.setWholeWords(this._state.wholeWord),e.matchCase&&this._findInput.setCaseSensitive(this._state.matchCase),e.preserveCase&&this._replaceInput.setPreserveCase(this._state.preserveCase),e.searchScope&&(this._state.searchScope?this._toggleSelectionFind.checked=!0:this._toggleSelectionFind.checked=!1,this._updateToggleSelectionFindButton()),e.searchString||e.matchesCount||e.matchesPosition){const t=this._state.searchString.length>0&&this._state.matchesCount===0;this._domNode.classList.toggle("no-results",t),this._updateMatchesCount(),this._updateButtons()}(e.searchString||e.currentMatch)&&this._layoutViewZone(),e.updateHistory&&this._delayedUpdateHistory(),e.loop&&this._updateButtons()}_delayedUpdateHistory(){this._updateHistoryDelayer.trigger(this._updateHistory.bind(this)).then(void 0,K.dz)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){this._matchesCount.style.minWidth=Ls+"px",this._state.matchesCount>=Fi?this._matchesCount.title=L0:this._matchesCount.title="",this._matchesCount.firstChild&&this._matchesCount.removeChild(this._matchesCount.firstChild);let e;if(this._state.matchesCount>0){let t=String(this._state.matchesCount);this._state.matchesCount>=Fi&&(t+="+");let i=String(this._state.matchesPosition);i==="0"&&(i="?"),e=G.GP(k0,i,t)}else e=Jg;this._matchesCount.appendChild(document.createTextNode(e)),(0,ft.xE)(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),Ls=Math.max(Ls,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===Jg)return i===""?g.kg("ariaSearchNoResultEmpty","{0} found",e):g.kg("ariaSearchNoResult","{0} found for '{1}'",e,i);if(t){const n=g.kg("ariaSearchNoResultWithLineNum","{0} found for '{1}', at {2}",e,i,t.startLineNumber+":"+t.startColumn),o=this._codeEditor.getModel();return o&&t.startLineNumber<=o.getLineCount()&&t.startLineNumber>=1?`${o.getLineContent(t.startLineNumber)}, ${n}`:n}return g.kg("ariaSearchNoResultWithLineNumNoCurrentMatch","{0} found for '{1}'",e,i)}_updateToggleSelectionFindButton(){const e=this._codeEditor.getSelection(),t=e?e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn:!1,i=this._toggleSelectionFind.checked;this._isVisible&&(i||t)?this._toggleSelectionFind.enable():this._toggleSelectionFind.disable()}_updateButtons(){this._findInput.setEnabled(this._isVisible),this._replaceInput.setEnabled(this._isVisible&&this._isReplaceVisible),this._updateToggleSelectionFindButton(),this._closeBtn.setEnabled(this._isVisible);const e=this._state.searchString.length>0,t=!!this._state.matchesCount;this._prevBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateBack()),this._nextBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateForward()),this._replaceBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._replaceAllBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._domNode.classList.toggle("replaceToggled",this._isReplaceVisible),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);const i=!this._codeEditor.getOption(83);this._toggleReplaceBtn.setEnabled(this._isVisible&&i)}_reveal(){if(this._revealTimeouts.forEach(e=>{clearTimeout(e)}),this._revealTimeouts=[],!this._isVisible){this._isVisible=!0;const e=this._codeEditor.getSelection();switch(this._codeEditor.getOption(37).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":{const i=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=i;break}default:break}this._tryUpdateWidgetWidth(),this._updateButtons(),this._revealTimeouts.push(setTimeout(()=>{this._domNode.classList.add("visible"),this._domNode.setAttribute("aria-hidden","false")},0)),this._revealTimeouts.push(setTimeout(()=>{this._findInput.validate()},200)),this._codeEditor.layoutOverlayWidget(this);let t=!0;if(this._codeEditor.getOption(37).seedSearchStringFromSelection&&e){const i=this._codeEditor.getDomNode();if(i){const n=S.BK(i),o=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),s=n.left+(o?o.left:0),a=o?o.top:0;if(this._viewZone&&a<this._viewZone.heightInPx){e.endLineNumber>e.startLineNumber&&(t=!1);const l=S.cL(this._domNode).left;s>l&&(t=!1);const c=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());n.left+(c?c.left:0)>l&&(t=!1)}}}this._showViewZone(t)}}_hide(e){this._revealTimeouts.forEach(t=>{clearTimeout(t)}),this._revealTimeouts=[],this._isVisible&&(this._isVisible=!1,this._updateButtons(),this._domNode.classList.remove("visible"),this._domNode.setAttribute("aria-hidden","true"),this._findInput.clearMessage(),e&&this._codeEditor.focus(),this._codeEditor.layoutOverlayWidget(this),this._removeViewZone())}_layoutViewZone(e){if(!this._codeEditor.getOption(37).addExtraSpaceOnTop){this._removeViewZone();return}if(!this._isVisible)return;const i=this._viewZone;this._viewZoneId!==void 0||!i||this._codeEditor.changeViewZones(n=>{i.heightInPx=this._getHeight(),this._viewZoneId=n.addZone(i),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+i.heightInPx)})}_showViewZone(e=!0){if(!this._isVisible||!this._codeEditor.getOption(37).addExtraSpaceOnTop)return;this._viewZone===void 0&&(this._viewZone=new hc(0));const i=this._viewZone;this._codeEditor.changeViewZones(n=>{if(this._viewZoneId!==void 0){const o=this._getHeight();if(o===i.heightInPx)return;const s=o-i.heightInPx;i.heightInPx=o,n.layoutZone(this._viewZoneId),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+s);return}else{let o=this._getHeight();if(o-=this._codeEditor.getOption(77).top,o<=0)return;i.heightInPx=o,this._viewZoneId=n.addZone(i),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+o)}})}_removeViewZone(){this._codeEditor.changeViewZones(e=>{this._viewZoneId!==void 0&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0,this._viewZone&&(this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()-this._viewZone.heightInPx),this._viewZone=void 0))})}_applyTheme(e){const t={inputActiveOptionBorder:e.getColor(C.uNK),inputActiveOptionBackground:e.getColor(C.c1f),inputActiveOptionForeground:e.getColor(C.$$0),inputBackground:e.getColor(C.L4c),inputForeground:e.getColor(C.cws),inputBorder:e.getColor(C.Zgs),inputValidationInfoBackground:e.getColor(C.I$A),inputValidationInfoForeground:e.getColor(C.L9Z),inputValidationInfoBorder:e.getColor(C.YSW),inputValidationWarningBackground:e.getColor(C.ULt),inputValidationWarningForeground:e.getColor(C.T5N),inputValidationWarningBorder:e.getColor(C.C1n),inputValidationErrorBackground:e.getColor(C._$n),inputValidationErrorForeground:e.getColor(C.h9z),inputValidationErrorBorder:e.getColor(C.eYZ)};this._findInput.style(t),this._replaceInput.style(t),this._toggleSelectionFind.style(t)}_tryUpdateWidgetWidth(){if(!this._isVisible||!S.qD(this._domNode))return;const e=this._codeEditor.getLayoutInfo();if(e.contentWidth<=0){this._domNode.classList.add("hiddenEditor");return}else this._domNode.classList.contains("hiddenEditor")&&this._domNode.classList.remove("hiddenEditor");const i=e.width,n=e.minimap.minimapWidth;let o=!1,s=!1,a=!1;if(this._resized&&S.Tr(this._domNode)>Yt){this._domNode.style.maxWidth=`${i-28-n-15}px`,this._replaceInput.width=S.Tr(this._findInput.domNode);return}if(Yt+28+n>=i&&(s=!0),Yt+28+n-Ls>=i&&(a=!0),Yt+28+n-Ls>=i+50&&(o=!0),this._domNode.classList.toggle("collapsed-find-widget",o),this._domNode.classList.toggle("narrow-find-widget",a),this._domNode.classList.toggle("reduced-find-widget",s),!a&&!o&&(this._domNode.style.maxWidth=`${i-28-n-15}px`),this._resized){this._findInput.inputBox.layout();const l=this._findInput.inputBox.element.clientWidth;l>0&&(this._replaceInput.width=l)}else this._isReplaceVisible&&(this._replaceInput.width=S.Tr(this._findInput.domNode))}_getHeight(){let e=0;return e+=4,e+=this._findInput.inputBox.height+2,this._isReplaceVisible&&(e+=4,e+=this._replaceInput.inputBox.height+2),e+=4,e}_tryUpdateHeight(){const e=this._getHeight();return this._cachedHeight!==null&&this._cachedHeight===e?!1:(this._cachedHeight=e,this._domNode.style.height=`${e}px`,!0)}focusFindInput(){this._findInput.select(),this._findInput.focus()}focusReplaceInput(){this._replaceInput.select(),this._replaceInput.focus()}highlightFindOptions(){this._findInput.highlightFindOptions()}_updateSearchScope(){if(this._codeEditor.hasModel()&&this._toggleSelectionFind.checked){const e=this._codeEditor.getSelections();e.map(t=>{t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(t.endLineNumber-1)));const i=this._state.currentMatch;return t.startLineNumber!==t.endLineNumber&&!L.Q.equalsRange(t,i)?t:null}).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){if(e.equals(ef|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._findInput.inputBox.insertAtCursor(`
`),e.preventDefault();return}if(e.equals(2)){this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return tf(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return nf(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(ef|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{Se.uF&&Se.ib&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(g.kg("ctrlEnter.keybindingChanged","Ctrl+Enter now inserts line break instead of replacing all. You can modify the keybinding for editor.action.replaceAll to override this behavior.")),this._ctrlEnterReplaceAllWarningPrompted=!0,this._storageService.store(qg,!0,0,0)),this._replaceInput.inputBox.insertAtCursor(`
`),e.preventDefault();return}if(e.equals(2)){this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(1026)){this._findInput.focus(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return tf(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return nf(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"))}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}_buildDomNode(){this._findInput=this._register(new Fd(null,this._contextViewProvider,{width:I0,label:p0,placeholder:m0,appendCaseSensitiveLabel:this._keybindingLabelFor(Ce.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(Ce.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(Ce.ToggleRegexCommand),validation:l=>{if(l.length===0||!this._findInput.getRegex())return null;try{return new RegExp(l,"gu"),null}catch(c){return{content:c.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>Zg(this._keybindingService)},this._contextKeyService,!0)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown(l=>this._onFindInputKeyDown(l))),this._register(this._findInput.inputBox.onDidChange(()=>{this._ignoreChangeEvent||this._state.change({searchString:this._findInput.getValue()},!0)})),this._register(this._findInput.onDidOptionChange(()=>{this._state.change({isRegex:this._findInput.getRegex(),wholeWord:this._findInput.getWholeWords(),matchCase:this._findInput.getCaseSensitive()},!0)})),this._register(this._findInput.onCaseSensitiveKeyDown(l=>{l.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),l.preventDefault())})),this._register(this._findInput.onRegexKeyDown(l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),l.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(l=>{this._tryUpdateHeight()&&this._showViewZone()})),Se.j9&&this._register(this._findInput.onMouseDown(l=>this._onFindInputMouseDown(l))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount(),this._prevBtn=this._register(new lo({label:_0+this._keybindingLabelFor(Ce.PreviousMatchFindAction),icon:g0,onTrigger:()=>{this._codeEditor.getAction(Ce.PreviousMatchFindAction).run().then(void 0,K.dz)}})),this._nextBtn=this._register(new lo({label:v0+this._keybindingLabelFor(Ce.NextMatchFindAction),icon:f0,onTrigger:()=>{this._codeEditor.getAction(Ce.NextMatchFindAction).run().then(void 0,K.dz)}}));const i=document.createElement("div");i.className="find-part",i.appendChild(this._findInput.domNode);const n=document.createElement("div");n.className="find-actions",i.appendChild(n),n.appendChild(this._matchesCount),n.appendChild(this._prevBtn.domNode),n.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new ig.l({icon:c0,title:C0+this._keybindingLabelFor(Ce.ToggleSearchScopeCommand),isChecked:!1})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){const l=this._codeEditor.getSelections();l.map(c=>(c.endColumn===1&&c.endLineNumber>c.startLineNumber&&(c=c.setEndPosition(c.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(c.endLineNumber-1))),c.isEmpty()?null:c)).filter(c=>!!c),l.length&&this._state.change({searchScope:l},!0)}}else this._state.change({searchScope:null},!0)})),n.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new lo({label:b0+this._keybindingLabelFor(Ce.CloseFindWidgetCommand),icon:Ge.$_,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),l.preventDefault())}})),n.appendChild(this._closeBtn.domNode),this._replaceInput=this._register(new Pd(null,void 0,{label:S0,placeholder:y0,appendPreserveCaseLabel:this._keybindingLabelFor(Ce.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>Zg(this._keybindingService)},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown(l=>this._onReplaceInputKeyDown(l))),this._register(this._replaceInput.inputBox.onDidChange(()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)})),this._register(this._replaceInput.inputBox.onDidHeightChange(l=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()})),this._register(this._replaceInput.onDidOptionChange(()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)})),this._register(this._replaceInput.onPreserveCaseKeyDown(l=>{l.equals(2)&&(this._prevBtn.isEnabled()?this._prevBtn.focus():this._nextBtn.isEnabled()?this._nextBtn.focus():this._toggleSelectionFind.enabled?this._toggleSelectionFind.focus():this._closeBtn.isEnabled()&&this._closeBtn.focus(),l.preventDefault())})),this._replaceBtn=this._register(new lo({label:w0+this._keybindingLabelFor(Ce.ReplaceOneAction),icon:u0,onTrigger:()=>{this._controller.replace()},onKeyDown:l=>{l.equals(1026)&&(this._closeBtn.focus(),l.preventDefault())}})),this._replaceAllBtn=this._register(new lo({label:D0+this._keybindingLabelFor(Ce.ReplaceAllAction),icon:h0,onTrigger:()=>{this._controller.replaceAll()}}));const o=document.createElement("div");o.className="replace-part",o.appendChild(this._replaceInput.domNode);const s=document.createElement("div");s.className="replace-actions",o.appendChild(s),s.appendChild(this._replaceBtn.domNode),s.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new lo({label:x0,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=S.Tr(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}})),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible),this._domNode=document.createElement("div"),this._domNode.className="editor-widget find-widget",this._domNode.setAttribute("aria-hidden","true"),this._domNode.style.width=`${Yt}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(i),this._domNode.appendChild(o),this._resizeSash=new Li.m(this._domNode,this,{orientation:0,size:2}),this._resized=!1;let a=Yt;this._register(this._resizeSash.onDidStart(()=>{a=S.Tr(this._domNode)})),this._register(this._resizeSash.onDidChange(l=>{this._resized=!0;const c=a+l.startX-l.currentX;if(c<Yt)return;const d=parseFloat(S.L9(this._domNode).maxWidth)||0;c>d||(this._domNode.style.width=`${c}px`,this._isReplaceVisible&&(this._replaceInput.width=S.Tr(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const l=S.Tr(this._domNode);if(l<Yt)return;let c=Yt;if(!this._resized||l===Yt){const d=this._codeEditor.getLayoutInfo();c=d.width-28-d.minimap.minimapWidth-15,this._resized=!0}this._domNode.style.width=`${c}px`,this._isReplaceVisible&&(this._replaceInput.width=S.Tr(this._findInput.domNode)),this._findInput.inputBox.layout()}))}updateAccessibilitySupport(){const e=this._codeEditor.getOption(2);this._findInput.setFocusInputOnOptionClick(e!==2)}}va.ID="editor.contrib.findWidget";class lo extends Kn.x{constructor(e){super(),this._opts=e;let t="button";this._opts.className&&(t=t+" "+this._opts.className),this._opts.icon&&(t=t+" "+U.L0.asClassName(this._opts.icon)),this._domNode=document.createElement("div"),this._domNode.title=this._opts.label,this._domNode.tabIndex=0,this._domNode.className=t,this._domNode.setAttribute("role","button"),this._domNode.setAttribute("aria-label",this._opts.label),this.onclick(this._domNode,i=>{this._opts.onTrigger(),i.preventDefault()}),this.onkeydown(this._domNode,i=>{var n,o;if(i.equals(10)||i.equals(3)){this._opts.onTrigger(),i.preventDefault();return}(o=(n=this._opts).onKeyDown)===null||o===void 0||o.call(n,i)})}get domNode(){return this._domNode}isEnabled(){return this._domNode.tabIndex>=0}focus(){this._domNode.focus()}setEnabled(e){this._domNode.classList.toggle("disabled",!e),this._domNode.setAttribute("aria-disabled",String(!e)),this._domNode.tabIndex=e?0:-1}setExpanded(e){this._domNode.setAttribute("aria-expanded",String(!!e)),e?(this._domNode.classList.remove(...U.L0.asClassNameArray(Yg)),this._domNode.classList.add(...U.L0.asClassNameArray(Xg))):(this._domNode.classList.remove(...U.L0.asClassNameArray(Xg)),this._domNode.classList.add(...U.L0.asClassNameArray(Yg)))}}(0,U.zy)((r,e)=>{const t=(m,v)=>{v&&e.addRule(`.monaco-editor ${m} { background-color: ${v}; }`)};t(".findMatch",r.getColor(C.Ubg)),t(".currentFindMatch",r.getColor(C.Syz)),t(".findScope",r.getColor(C.Q96));const i=r.getColor(C.CgL);t(".find-widget",i);const n=r.getColor(C.f9l);n&&e.addRule(`.monaco-editor .find-widget { box-shadow: 0 0 8px 2px ${n}; }`);const o=r.getColor(C.ECk);o&&e.addRule(`.monaco-editor .findMatch { border: 1px ${(0,bt.Bb)(r.type)?"dotted":"solid"} ${o}; box-sizing: border-box; }`);const s=r.getColor(C._NC);s&&e.addRule(`.monaco-editor .currentFindMatch { border: 2px solid ${s}; padding: 1px; box-sizing: border-box; }`);const a=r.getColor(C.S5J);a&&e.addRule(`.monaco-editor .findScope { border: 1px ${(0,bt.Bb)(r.type)?"dashed":"solid"} ${a}; }`);const l=r.getColor(C.b1q);l&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${l}; }`);const c=r.getColor(C.FiB);c&&e.addRule(`.monaco-editor .find-widget { color: ${c}; }`);const d=r.getColor(C.UPX);d&&e.addRule(`.monaco-editor .find-widget.no-results .matchesCount { color: ${d}; }`);const u=r.getColor(C.US);if(u)e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${u}; }`);else{const m=r.getColor(C.sIe);m&&e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${m}; }`)}const h=r.getColor(C.ObF);h&&e.addRule(`
		.monaco-editor .find-widget .button:not(.disabled):hover,
		.monaco-editor .find-widget .codicon-find-selection:hover {
			background-color: ${h} !important;
		}
	`);const p=r.getColor(C.tAP);p&&e.addRule(`.monaco-editor .find-widget .monaco-inputbox.synthetic-focus { outline-color: ${p}; }`)});var of=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Xt=function(r,e){return function(t,i){e(t,i,r)}},fn=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};const E0=524288;function gc(r,e="single",t=!1){if(!r.hasModel())return null;const i=r.getSelection();if(e==="single"&&i.startLineNumber===i.endLineNumber||e==="multiple"){if(i.isEmpty()){const n=r.getConfiguredWordAtPosition(i.getStartPosition());if(n&&t===!1)return n.word}else if(r.getModel().getValueLengthInRange(i)<E0)return r.getModel().getValueInRange(i)}return null}let ct=class um extends I.jG{constructor(e,t,i,n){super(),this._editor=e,this._findWidgetVisible=Oi.bindTo(t),this._contextKeyService=t,this._storageService=i,this._clipboardService=n,this._updateHistoryDelayer=new V.ve(500),this._state=this._register(new l0),this.loadQueryState(),this._register(this._state.onFindReplaceStateChange(o=>this._onStateChanged(o))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{const o=this._editor.getModel()&&this._state.isRevealed;this.disposeModel(),this._state.change({searchScope:null,matchCase:this._storageService.getBoolean("editor.matchCase",1,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,!1),isRegex:this._storageService.getBoolean("editor.isRegex",1,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,!1)},!1),o&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(37).loop})}))}get editor(){return this._editor}static get(e){return e.getContribution(um.ID)}dispose(){this.disposeModel(),super.dispose()}disposeModel(){this._model&&(this._model.dispose(),this._model=null)}_onStateChanged(e){this.saveQueryState(e),e.isRevealed&&(this._state.isRevealed?this._findWidgetVisible.set(!0):(this._findWidgetVisible.reset(),this.disposeModel())),e.searchString&&this.setGlobalBufferTerm(this._state.searchString)}saveQueryState(e){e.isRegex&&this._storageService.store("editor.isRegex",this._state.actualIsRegex,1,0),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,1,0),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,1,0),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,1,0)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",1,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",1,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,this._state.preserveCase)},!1)}isFindInputFocused(){return!!ca.getValue(this._contextKeyService)}getState(){return this._state}closeFindWidget(){this._state.change({isRevealed:!1,searchScope:null},!1),this._editor.focus()}toggleCaseSensitive(){this._state.change({matchCase:!this._state.matchCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleWholeWords(){this._state.change({wholeWord:!this._state.wholeWord},!1),this._state.isRevealed||this.highlightFindOptions()}toggleRegex(){this._state.change({isRegex:!this._state.isRegex},!1),this._state.isRevealed||this.highlightFindOptions()}togglePreserveCase(){this._state.change({preserveCase:!this._state.preserveCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleSearchScope(){if(this._state.searchScope)this._state.change({searchScope:null},!0);else if(this._editor.hasModel()){const e=this._editor.getSelections();e.map(t=>(t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._editor.getModel().getLineMaxColumn(t.endLineNumber-1))),t.isEmpty()?null:t)).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}setSearchString(e){this._state.isRegex&&(e=G.bm(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}_start(e,t){return fn(this,void 0,void 0,function*(){if(this.disposeModel(),!this._editor.hasModel())return;const i=Object.assign(Object.assign({},t),{isRevealed:!0});if(e.seedSearchStringFromSelection==="single"){const n=gc(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);n&&(this._state.isRegex?i.searchString=G.bm(n):i.searchString=n)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const n=gc(this._editor,e.seedSearchStringFromSelection);n&&(i.searchString=n)}if(!i.searchString&&e.seedSearchStringFromGlobalClipboard){const n=yield this.getGlobalBufferTerm();if(!this._editor.hasModel())return;n&&(i.searchString=n)}if(e.forceRevealReplace||i.isReplaceRevealed?i.isReplaceRevealed=!0:this._findWidgetVisible.get()||(i.isReplaceRevealed=!1),e.updateSearchScope){const n=this._editor.getSelections();n.some(o=>!o.isEmpty())&&(i.searchScope=n)}i.loop=e.loop,this._state.change(i,!1),this._model||(this._model=new xs(this._editor,this._state))})}start(e,t){return this._start(e,t)}moveToNextMatch(){return this._model?(this._model.moveToNextMatch(),!0):!1}moveToPrevMatch(){return this._model?(this._model.moveToPrevMatch(),!0):!1}replace(){return this._model?(this._model.replace(),!0):!1}replaceAll(){return this._model?(this._model.replaceAll(),!0):!1}selectAllMatches(){return this._model?(this._model.selectAllMatches(),this._editor.focus(),!0):!1}getGlobalBufferTerm(){return fn(this,void 0,void 0,function*(){return this._editor.getOption(37).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""})}setGlobalBufferTerm(e){this._editor.getOption(37).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)}};ct.ID="editor.contrib.findController",ct=of([Xt(1,A.fN),Xt(2,Tt.CS),Xt(3,Hn.h)],ct);let fc=class extends ct{constructor(e,t,i,n,o,s,a,l){super(e,i,a,l),this._contextViewService=t,this._keybindingService=n,this._themeService=o,this._notificationService=s,this._widget=null,this._findOptionsWidget=null}_start(e,t){const i=Object.create(null,{_start:{get:()=>super._start}});return fn(this,void 0,void 0,function*(){this._widget||this._createFindWidget();const n=this._editor.getSelection();let o=!1;switch(this._editor.getOption(37).autoFindInSelection){case"always":o=!0;break;case"never":o=!1;break;case"multiline":{o=!!n&&n.startLineNumber!==n.endLineNumber;break}default:break}e.updateSearchScope=e.updateSearchScope||o,yield i._start.call(this,e,t),this._widget&&(e.shouldFocus===2?this._widget.focusReplaceInput():e.shouldFocus===1&&this._widget.focusFindInput())})}highlightFindOptions(e=!1){this._widget||this._createFindWidget(),this._state.isRevealed&&!e?this._widget.highlightFindOptions():this._findOptionsWidget.highlightFindOptions()}_createFindWidget(){this._widget=this._register(new va(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService)),this._findOptionsWidget=this._register(new ma(this._editor,this._state,this._keybindingService,this._themeService))}};fc=of([Xt(1,ni.l),Xt(2,A.fN),Xt(3,tt.b),Xt(4,U.Gy),Xt(5,Ye.Ot),Xt(6,Tt.CS),Xt(7,Hn.h)],fc),(0,_.gW)(new _.PF({id:Ce.StartFindAction,label:g.kg("startFindAction","Find"),alias:"Find",precondition:A.M$.or(D.R.focus,A.M$.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:z.D8.MenubarEditMenu,group:"3_find",title:g.kg({key:"miFind",comment:["&& denotes a mnemonic"]},"&&Find"),order:1}})).addImplementation(0,(r,e,t)=>{const i=ct.get(e);return i?i.start({forceRevealReplace:!1,seedSearchStringFromSelection:e.getOption(37).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(37).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(37).globalFindClipboard,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(37).loop}):!1});const A0={description:"Open a new In-Editor Find Widget.",args:[{name:"Open a new In-Editor Find Widget args",schema:{properties:{searchString:{type:"string"},replaceString:{type:"string"},regex:{type:"boolean"},regexOverride:{type:"number",description:g.kg("actions.find.isRegexOverride",`Overrides "Use Regular Expression" flag.
The flag will not be saved for the future.
0: Do Nothing
1: True
2: False`)},wholeWord:{type:"boolean"},wholeWordOverride:{type:"number",description:g.kg("actions.find.wholeWordOverride",`Overrides "Match Whole Word" flag.
The flag will not be saved for the future.
0: Do Nothing
1: True
2: False`)},matchCase:{type:"boolean"},matchCaseOverride:{type:"number",description:g.kg("actions.find.matchCaseOverride",`Overrides "Math Case" flag.
The flag will not be saved for the future.
0: Do Nothing
1: True
2: False`)},preserveCase:{type:"boolean"},preserveCaseOverride:{type:"number",description:g.kg("actions.find.preserveCaseOverride",`Overrides "Preserve Case" flag.
The flag will not be saved for the future.
0: Do Nothing
1: True
2: False`)},findInSelection:{type:"boolean"}}}}]};class N0 extends _.ks{constructor(){super({id:Ce.StartFindWithArgs,label:g.kg("startFindWithArgsAction","Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},description:A0})}run(e,t,i){return fn(this,void 0,void 0,function*(){const n=ct.get(t);if(n){const o=i?{searchString:i.searchString,replaceString:i.replaceString,isReplaceRevealed:i.replaceString!==void 0,isRegex:i.isRegex,wholeWord:i.matchWholeWord,matchCase:i.isCaseSensitive,preserveCase:i.preserveCase}:{};yield n.start({forceRevealReplace:!1,seedSearchStringFromSelection:n.getState().searchString.length===0&&t.getOption(37).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(37).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:1,shouldAnimate:!0,updateSearchScope:i?.findInSelection||!1,loop:t.getOption(37).loop},o),n.setGlobalBufferTerm(n.getState().searchString)}})}}class M0 extends _.ks{constructor(){super({id:Ce.StartFindWithSelection,label:g.kg("startFindWithSelectionAction","Find With Selection"),alias:"Find With Selection",precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:2083},weight:100}})}run(e,t){return fn(this,void 0,void 0,function*(){const i=ct.get(t);i&&(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(37).loop}),i.setGlobalBufferTerm(i.getState().searchString))})}}class sf extends _.ks{run(e,t){return fn(this,void 0,void 0,function*(){const i=ct.get(t);i&&!this._run(i)&&(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:i.getState().searchString.length===0&&t.getOption(37).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(37).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(37).loop}),this._run(i))})}}class T0 extends sf{constructor(){super({id:Ce.NextMatchFindAction,label:g.kg("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:D.R.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:A.M$.and(D.R.focus,ca),primary:3,weight:100}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class O0 extends sf{constructor(){super({id:Ce.PreviousMatchFindAction,label:g.kg("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:D.R.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:A.M$.and(D.R.focus,ca),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}class rf extends _.ks{run(e,t){return fn(this,void 0,void 0,function*(){const i=ct.get(t);if(!i)return;const n=t.getOption(37).seedSearchStringFromSelection==="selection";let o=null;t.getOption(37).seedSearchStringFromSelection!=="never"&&(o=gc(t,"single",n)),o&&i.setSearchString(o),this._run(i)||(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:t.getOption(37).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:n,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(37).loop}),this._run(i))})}}class F0 extends rf{constructor(){super({id:Ce.NextSelectionMatchFindAction,label:g.kg("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:D.R.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class P0 extends rf{constructor(){super({id:Ce.PreviousSelectionMatchFindAction,label:g.kg("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:D.R.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}(0,_.gW)(new _.PF({id:Ce.StartFindReplaceAction,label:g.kg("startReplace","Replace"),alias:"Replace",precondition:A.M$.or(D.R.focus,A.M$.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:z.D8.MenubarEditMenu,group:"3_find",title:g.kg({key:"miReplace",comment:["&& denotes a mnemonic"]},"&&Replace"),order:2}})).addImplementation(0,(r,e,t)=>{if(!e.hasModel()||e.getOption(83))return!1;const i=ct.get(e);if(!i)return!1;const n=e.getSelection(),o=i.isFindInputFocused(),s=!n.isEmpty()&&n.startLineNumber===n.endLineNumber&&e.getOption(37).seedSearchStringFromSelection!=="never"&&!o,a=o||s?2:1;return i.start({forceRevealReplace:!0,seedSearchStringFromSelection:s?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(37).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(37).seedSearchStringFromSelection!=="never",shouldFocus:a,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(37).loop})}),(0,_.HW)(ct.ID,fc),(0,_.Fl)(N0),(0,_.Fl)(M0),(0,_.Fl)(T0),(0,_.Fl)(O0),(0,_.Fl)(F0),(0,_.Fl)(P0);const Vt=_.DX.bindToContribution(ct.get);(0,_.E_)(new Vt({id:Ce.CloseFindWidgetCommand,precondition:Oi,handler:r=>r.closeFindWidget(),kbOpts:{weight:105,kbExpr:A.M$.and(D.R.focus,A.M$.not("isComposing")),primary:9,secondary:[1033]}})),(0,_.E_)(new Vt({id:Ce.ToggleCaseSensitiveCommand,precondition:void 0,handler:r=>r.toggleCaseSensitive(),kbOpts:{weight:105,kbExpr:D.R.focus,primary:ua.primary,mac:ua.mac,win:ua.win,linux:ua.linux}})),(0,_.E_)(new Vt({id:Ce.ToggleWholeWordCommand,precondition:void 0,handler:r=>r.toggleWholeWords(),kbOpts:{weight:105,kbExpr:D.R.focus,primary:ha.primary,mac:ha.mac,win:ha.win,linux:ha.linux}})),(0,_.E_)(new Vt({id:Ce.ToggleRegexCommand,precondition:void 0,handler:r=>r.toggleRegex(),kbOpts:{weight:105,kbExpr:D.R.focus,primary:ga.primary,mac:ga.mac,win:ga.win,linux:ga.linux}})),(0,_.E_)(new Vt({id:Ce.ToggleSearchScopeCommand,precondition:void 0,handler:r=>r.toggleSearchScope(),kbOpts:{weight:105,kbExpr:D.R.focus,primary:fa.primary,mac:fa.mac,win:fa.win,linux:fa.linux}})),(0,_.E_)(new Vt({id:Ce.TogglePreserveCaseCommand,precondition:void 0,handler:r=>r.togglePreserveCase(),kbOpts:{weight:105,kbExpr:D.R.focus,primary:pa.primary,mac:pa.mac,win:pa.win,linux:pa.linux}})),(0,_.E_)(new Vt({id:Ce.ReplaceOneAction,precondition:Oi,handler:r=>r.replace(),kbOpts:{weight:105,kbExpr:D.R.focus,primary:3094}})),(0,_.E_)(new Vt({id:Ce.ReplaceOneAction,precondition:Oi,handler:r=>r.replace(),kbOpts:{weight:105,kbExpr:A.M$.and(D.R.focus,cc),primary:3}})),(0,_.E_)(new Vt({id:Ce.ReplaceAllAction,precondition:Oi,handler:r=>r.replaceAll(),kbOpts:{weight:105,kbExpr:D.R.focus,primary:2563}})),(0,_.E_)(new Vt({id:Ce.ReplaceAllAction,precondition:Oi,handler:r=>r.replaceAll(),kbOpts:{weight:105,kbExpr:A.M$.and(D.R.focus,cc),primary:void 0,mac:{primary:2051}}})),(0,_.E_)(new Vt({id:Ce.SelectAllMatchesAction,precondition:Oi,handler:r=>r.selectAllMatches(),kbOpts:{weight:105,kbExpr:D.R.focus,primary:515}}));const af=65535,Ut=16777215,lf=4278190080;class pc{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,i=e%32;return(this._states[t]&1<<i)!==0}set(e,t){const i=e/32|0,n=e%32,o=this._states[i];t?this._states[i]=o|1<<n:this._states[i]=o&~(1<<n)}}class mt{constructor(e,t,i){if(this.sourceAbbr={0:" ",1:"u",2:"r"},e.length!==t.length||e.length>af)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new pc(e.length),this._userDefinedStates=new pc(e.length),this._recoveredStates=new pc(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(i,n)=>{const o=e[e.length-1];return this.getStartLineNumber(o)<=i&&this.getEndLineNumber(o)>=n};for(let i=0,n=this._startIndexes.length;i<n;i++){const o=this._startIndexes[i],s=this._endIndexes[i];if(o>Ut||s>Ut)throw new Error("startLineNumber or endLineNumber must not exceed "+Ut);for(;e.length>0&&!t(o,s);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=o+((a&255)<<24),this._endIndexes[i]=s+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&Ut}getEndLineNumber(e){return this._endIndexes[e]&Ut}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){return this._collapseStates.get(e)}setCollapsed(e,t){this._collapseStates.set(e,t)}isUserDefined(e){return this._userDefinedStates.get(e)}setUserDefined(e,t){return this._userDefinedStates.set(e,t)}isRecovered(e){return this._recoveredStates.get(e)}setRecovered(e,t){return this._recoveredStates.set(e,t)}getSource(e){return this.isUserDefined(e)?1:this.isRecovered(e)?2:0}setSource(e,t){t===1?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):t===2?(this.setUserDefined(e,!1),this.setRecovered(e,!0)):(this.setUserDefined(e,!1),this.setRecovered(e,!1))}setCollapsedAllOfType(e,t){let i=!1;if(this._types)for(let n=0;n<this._types.length;n++)this._types[n]===e&&(this.setCollapsed(n,t),i=!0);return i}toRegion(e){return new W0(this,e)}getParentIndex(e){this.ensureParentIndices();const t=((this._startIndexes[e]&lf)>>>24)+((this._endIndexes[e]&lf)>>>16);return t===af?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,i=this._startIndexes.length;if(i===0)return-1;for(;t<i;){const n=Math.floor((t+i)/2);e<this.getStartLineNumber(n)?i=n:t=n+1}return t-1}findRange(e){let t=this.findIndex(e);if(t>=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);t!==-1;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){const e=[];for(let t=0;t<this.length;t++)e[t]=`[${this.sourceAbbr[this.getSource(t)]}${this.isCollapsed(t)?"+":"-"}] ${this.getStartLineNumber(t)}/${this.getEndLineNumber(t)}`;return e.join(", ")}toFoldRange(e){return{startLineNumber:this._startIndexes[e]&Ut,endLineNumber:this._endIndexes[e]&Ut,type:this._types?this._types[e]:void 0,isCollapsed:this.isCollapsed(e),source:this.getSource(e)}}static fromFoldRanges(e){const t=e.length,i=new Uint32Array(t),n=new Uint32Array(t);let o=[],s=!1;for(let l=0;l<t;l++){const c=e[l];i[l]=c.startLineNumber,n[l]=c.endLineNumber,o.push(c.type),c.type&&(s=!0)}s||(o=void 0);const a=new mt(i,n,o);for(let l=0;l<t;l++)e[l].isCollapsed&&a.setCollapsed(l,!0),a.setSource(l,e[l].source);return a}static sanitizeAndMerge(e,t,i){i=i??Number.MAX_VALUE;const n=(v,w)=>Array.isArray(v)?R=>R<w?v[R]:void 0:R=>R<w?v.toFoldRange(R):void 0,o=n(e,e.length),s=n(t,t.length);let a=0,l=0,c=o(0),d=s(0);const u=[];let h,p=0;const m=[];for(;c||d;){let v;if(d&&(!c||c.startLineNumber>=d.startLineNumber))c&&c.startLineNumber===d.startLineNumber?(d.source===1?v=d:(v=c,v.isCollapsed=d.isCollapsed&&c.endLineNumber===d.endLineNumber,v.source=0),c=o(++a)):(v=d,d.isCollapsed&&d.source===0&&(v.source=2)),d=s(++l);else{let w=l,R=d;for(;;){if(!R||R.startLineNumber>c.endLineNumber){v=c;break}if(R.source===1&&R.endLineNumber>c.endLineNumber)break;R=s(++w)}c=o(++a)}if(v){for(;h&&h.endLineNumber<v.startLineNumber;)h=u.pop();v.endLineNumber>v.startLineNumber&&v.startLineNumber>p&&v.endLineNumber<=i&&(!h||h.endLineNumber>=v.endLineNumber)&&(m.push(v),p=v.startLineNumber,h&&u.push(h),h=v)}}return m}}class W0{constructor(e,t){this.ranges=e,this.index=t}get startLineNumber(){return this.ranges.getStartLineNumber(this.index)}get endLineNumber(){return this.ranges.getEndLineNumber(this.index)}get regionIndex(){return this.index}get parentIndex(){return this.ranges.getParentIndex(this.index)}get isCollapsed(){return this.ranges.isCollapsed(this.index)}containedBy(e){return e.startLineNumber<=this.startLineNumber&&e.endLineNumber>=this.endLineNumber}containsLine(e){return this.startLineNumber<=e&&e<=this.endLineNumber}}class B0{constructor(e,t){this._updateEventEmitter=new Z.vl,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new mt(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}get regions(){return this._regions}get textModel(){return this._textModel}toggleCollapseState(e){if(!e.length)return;e=e.sort((i,n)=>i.regionIndex-n.regionIndex);const t={};this._decorationProvider.changeDecorations(i=>{let n=0,o=-1,s=-1;const a=l=>{for(;n<l;){const c=this._regions.getEndLineNumber(n),d=this._regions.isCollapsed(n);if(c<=o){const u=this.regions.getSource(n)!==0;i.changeDecorationOptions(this._editorDecorationIds[n],this._decorationProvider.getDecorationOption(d,c<=s,u))}d&&c>s&&(s=c),n++}};for(const l of e){const c=l.regionIndex,d=this._editorDecorationIds[c];if(d&&!t[d]){t[d]=!0,a(c);const u=!this._regions.isCollapsed(c);this._regions.setCollapsed(c,u),o=Math.max(o,this._regions.getEndLineNumber(c))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,i=n=>{for(const o of e)if(!(o.startLineNumber>n.endLineNumber||n.startLineNumber>o.endLineNumber))return!0;return!1};for(let n=0;n<this._regions.length;n++){const o=this._regions.toFoldRange(n);(o.source===0||!i(o))&&t.push(o)}this.updatePost(mt.fromFoldRanges(t))}update(e,t=[]){const i=this._currentFoldedOrManualRanges(t),n=mt.sanitizeAndMerge(e,i,this._textModel.getLineCount());this.updatePost(mt.fromFoldRanges(n))}updatePost(e){const t=[];let i=-1;for(let n=0,o=e.length;n<o;n++){const s=e.getStartLineNumber(n),a=e.getEndLineNumber(n),l=e.isCollapsed(n),c=e.getSource(n)!==0,d={startLineNumber:s,startColumn:this._textModel.getLineMaxColumn(s),endLineNumber:a,endColumn:this._textModel.getLineMaxColumn(a)+1};t.push({range:d,options:this._decorationProvider.getDecorationOption(l,a<=i,c)}),l&&a>i&&(i=a)}this._decorationProvider.changeDecorations(n=>this._editorDecorationIds=n.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e=[]){const t=(n,o)=>{for(const s of e)if(n<s&&s<=o)return!0;return!1},i=[];for(let n=0,o=this._regions.length;n<o;n++){let s=this.regions.isCollapsed(n);const a=this.regions.getSource(n);if(s||a!==0){const l=this._regions.toFoldRange(n),c=this._textModel.getDecorationRange(this._editorDecorationIds[n]);c&&(s&&(t(c.startLineNumber,c.endLineNumber)||c.endLineNumber-c.startLineNumber!==l.endLineNumber-l.startLineNumber)&&(s=!1),i.push({startLineNumber:c.startLineNumber,endLineNumber:c.endLineNumber,type:l.type,isCollapsed:s,source:a}))}}return i}getMemento(){const e=this._currentFoldedOrManualRanges(),t=[];for(let i=0,n=e.length;i<n;i++){const o=e[i],s=this._getLinesChecksum(o.startLineNumber+1,o.endLineNumber);t.push({startLineNumber:o.startLineNumber,endLineNumber:o.endLineNumber,isCollapsed:o.isCollapsed,source:o.source,checksum:s})}return t.length>0?t:void 0}applyMemento(e){var t,i;if(!Array.isArray(e))return;const n=[],o=this._textModel.getLineCount();for(const a of e){if(a.startLineNumber>=a.endLineNumber||a.startLineNumber<1||a.endLineNumber>o)continue;const l=this._getLinesChecksum(a.startLineNumber+1,a.endLineNumber);(!a.checksum||l===a.checksum)&&n.push({startLineNumber:a.startLineNumber,endLineNumber:a.endLineNumber,type:void 0,isCollapsed:(t=a.isCollapsed)!==null&&t!==void 0?t:!0,source:(i=a.source)!==null&&i!==void 0?i:0})}const s=mt.sanitizeAndMerge(this._regions,n,o);this.updatePost(mt.fromFoldRanges(s))}_getLinesChecksum(e,t){return(0,ql.tW)(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const i=[];if(this._regions){let n=this._regions.findRange(e),o=1;for(;n>=0;){const s=this._regions.toRegion(n);(!t||t(s,o))&&i.push(s),o++,n=s.parentIndex}}return i}getRegionAtLine(e){if(this._regions){const t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null}getRegionsInside(e,t){const i=[],n=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const s=[];for(let a=n,l=this._regions.length;a<l;a++){const c=this._regions.toRegion(a);if(this._regions.getStartLineNumber(a)<o){for(;s.length>0&&!c.containedBy(s[s.length-1]);)s.pop();s.push(c),t(c,s.length)&&i.push(c)}else break}}else for(let s=n,a=this._regions.length;s<a;s++){const l=this._regions.toRegion(s);if(this._regions.getStartLineNumber(s)<o)(!t||t(l))&&i.push(l);else break}return i}}function H0(r,e,t){const i=[];for(const n of t){const o=r.getRegionAtLine(n);if(o){const s=!o.isCollapsed;if(i.push(o),e>1){const a=r.getRegionsInside(o,(l,c)=>l.isCollapsed!==s&&c<e);i.push(...a)}}}r.toggleCollapseState(i)}function co(r,e,t=Number.MAX_VALUE,i){const n=[];if(i&&i.length>0)for(const o of i){const s=r.getRegionAtLine(o);if(s&&(s.isCollapsed!==e&&n.push(s),t>1)){const a=r.getRegionsInside(s,(l,c)=>l.isCollapsed!==e&&c<t);n.push(...a)}}else{const o=r.getRegionsInside(null,(s,a)=>s.isCollapsed!==e&&a<t);n.push(...o)}r.toggleCollapseState(n)}function df(r,e,t,i){const n=[];for(const o of i){const s=r.getAllRegionsAtLine(o,(a,l)=>a.isCollapsed!==e&&l<=t);n.push(...s)}r.toggleCollapseState(n)}function V0(r,e,t){const i=[];for(const n of t){const o=r.getAllRegionsAtLine(n,s=>s.isCollapsed!==e);o.length>0&&i.push(o[0])}r.toggleCollapseState(i)}function U0(r,e,t,i){const n=(s,a)=>a===e&&s.isCollapsed!==t&&!i.some(l=>s.containsLine(l)),o=r.getRegionsInside(null,n);r.toggleCollapseState(o)}function cf(r,e,t){const i=[];for(const s of t){const a=r.getAllRegionsAtLine(s,void 0);a.length>0&&i.push(a[0])}const n=s=>i.every(a=>!a.containedBy(s)&&!s.containedBy(a))&&s.isCollapsed!==e,o=r.getRegionsInside(null,n);r.toggleCollapseState(o)}function mc(r,e,t){const i=r.textModel,n=r.regions,o=[];for(let s=n.length-1;s>=0;s--)if(t!==n.isCollapsed(s)){const a=n.getStartLineNumber(s);e.test(i.getLineContent(a))&&o.push(n.toRegion(s))}r.toggleCollapseState(o)}function _c(r,e,t){const i=r.regions,n=[];for(let o=i.length-1;o>=0;o--)t!==i.isCollapsed(o)&&e===i.getType(o)&&n.push(i.toRegion(o));r.toggleCollapseState(n)}function z0(r,e){let t=null;const i=e.getRegionAtLine(r);if(i!==null&&(t=i.startLineNumber,r===t)){const n=i.parentIndex;n!==-1?t=e.regions.getStartLineNumber(n):t=null}return t}function $0(r,e){let t=e.getRegionAtLine(r);if(t!==null&&t.startLineNumber===r){if(r!==t.startLineNumber)return t.startLineNumber;{const i=t.parentIndex;let n=0;for(i!==-1&&(n=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=n)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}}else if(e.regions.length>0)for(t=e.regions.toRegion(e.regions.length-1);t!==null;){if(t.startLineNumber<r)return t.startLineNumber;t.regionIndex>0?t=e.regions.toRegion(t.regionIndex-1):t=null}return null}function j0(r,e){let t=e.getRegionAtLine(r);if(t!==null&&t.startLineNumber===r){const i=t.parentIndex;let n=0;if(i!==-1)n=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;n=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex<e.regions.length){if(t=e.regions.toRegion(t.regionIndex+1),t.startLineNumber>=n)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}else if(e.regions.length>0)for(t=e.regions.toRegion(0);t!==null;){if(t.startLineNumber>r)return t.startLineNumber;t.regionIndex<e.regions.length?t=e.regions.toRegion(t.regionIndex+1):t=null}return null}var G0=f(3902);class K0{constructor(e){this._updateEventEmitter=new Z.vl,this._hasLineChanges=!1,this._foldingModel=e,this._foldingModelListener=e.onDidChange(t=>this.updateHiddenRanges()),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}get onDidChange(){return this._updateEventEmitter.event}get hiddenRanges(){return this._hiddenRanges}notifyChangeModelContent(e){this._hiddenRanges.length&&!this._hasLineChanges&&(this._hasLineChanges=e.changes.some(t=>t.range.endLineNumber!==t.range.startLineNumber||(0,G0.W)(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let i=0,n=0,o=Number.MAX_VALUE,s=-1;const a=this._foldingModel.regions;for(;i<a.length;i++){if(!a.isCollapsed(i))continue;const l=a.getStartLineNumber(i)+1,c=a.getEndLineNumber(i);o<=l&&c<=s||(!e&&n<this._hiddenRanges.length&&this._hiddenRanges[n].startLineNumber===l&&this._hiddenRanges[n].endLineNumber===c?(t.push(this._hiddenRanges[n]),n++):(e=!0,t.push(new L.Q(l,1,c,1))),o=l,s=c)}(this._hasLineChanges||e||n<this._hiddenRanges.length)&&this.applyHiddenRanges(t)}applyHiddenRanges(e){this._hiddenRanges=e,this._hasLineChanges=!1,this._updateEventEmitter.fire(e)}hasRanges(){return this._hiddenRanges.length>0}isHidden(e){return uf(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let n=null;const o=s=>((!n||!Q0(s,n))&&(n=uf(this._hiddenRanges,s)),n?n.startLineNumber-1:null);for(let s=0,a=e.length;s<a;s++){let l=e[s];const c=o(l.startLineNumber);c&&(l=l.setStartPosition(c,i.getLineMaxColumn(c)),t=!0);const d=o(l.endLineNumber);d&&(l=l.setEndPosition(d,i.getLineMaxColumn(d)),t=!0),e[s]=l}return t}dispose(){this.hiddenRanges.length>0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function Q0(r,e){return r>=e.startLineNumber&&r<=e.endLineNumber}function uf(r,e){const t=(0,pe.aB)(r,i=>e<i.startLineNumber)-1;return t>=0&&r[t].endLineNumber>=e?r[t]:null}const Z0=5e3,Y0="indent";class X0{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.maxFoldingRegions=i,this.id=Y0}dispose(){}compute(e,t){const i=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,n=i&&!!i.offSide,o=i&&i.markers;return Promise.resolve(q0(this.editorModel,n,o,this.maxFoldingRegions,t))}}class J0{constructor(e,t){this._notifyTooManyRegions=t,this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>Ut||t>Ut)return;const n=this._length;this._startIndexes[n]=e,this._endIndexes[n]=t,this._length++,i<1e3&&(this._indentOccurrences[i]=(this._indentOccurrences[i]||0)+1)}toIndentRanges(e){var t;if(this._length<=this._foldingRangesLimit){const i=new Uint32Array(this._length),n=new Uint32Array(this._length);for(let o=this._length-1,s=0;o>=0;o--,s++)i[s]=this._startIndexes[o],n[s]=this._endIndexes[o];return new mt(i,n)}else{(t=this._notifyTooManyRegions)===null||t===void 0||t.call(this,this._foldingRangesLimit);let i=0,n=this._indentOccurrences.length;for(let l=0;l<this._indentOccurrences.length;l++){const c=this._indentOccurrences[l];if(c){if(c+i>this._foldingRangesLimit){n=l;break}i+=c}}const o=e.getOptions().tabSize,s=new Uint32Array(this._foldingRangesLimit),a=new Uint32Array(this._foldingRangesLimit);for(let l=this._length-1,c=0;l>=0;l--){const d=this._startIndexes[l],u=e.getLineContent(d),h=(0,Kl.G)(u,o);(h<n||h===n&&i++<this._foldingRangesLimit)&&(s[c]=d,a[c]=this._endIndexes[l],c++)}return new mt(s,a)}}}function q0(r,e,t,i,n){const o=r.getOptions().tabSize;i=i??Z0;const s=new J0(i,n);let a;t&&(a=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const l=[],c=r.getLineCount()+1;l.push({indent:-1,endAbove:c,line:c});for(let d=r.getLineCount();d>0;d--){const u=r.getLineContent(d),h=(0,Kl.G)(u,o);let p=l[l.length-1];if(h===-1){e&&(p.endAbove=d);continue}let m;if(a&&(m=u.match(a)))if(m[1]){let v=l.length-1;for(;v>0&&l[v].indent!==-2;)v--;if(v>0){l.length=v+1,p=l[v],s.insertFirst(d,p.line,h),p.line=d,p.indent=h,p.endAbove=d;continue}}else{l.push({indent:-2,endAbove:d,line:d});continue}if(p.indent>h){do l.pop(),p=l[l.length-1];while(p.indent>h);const v=p.endAbove-1;v-d>=1&&s.insertFirst(d,v,h)}p.indent===h?p.endAbove=d:l.push({indent:h,endAbove:d,line:d})}return s.toIndentRanges(r)}const ks=(0,Ge.pU)("folding-expanded",Q.W6.chevronDown,(0,g.kg)("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),Ca=(0,Ge.pU)("folding-collapsed",Q.W6.chevronRight,(0,g.kg)("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin.")),hf=(0,Ge.pU)("folding-manual-collapsed",Ca,(0,g.kg)("foldingManualCollapedIcon","Icon for manually collapsed ranges in the editor glyph margin.")),vc=(0,Ge.pU)("folding-manual-expanded",ks,(0,g.kg)("foldingManualExpandedIcon","Icon for manually expanded ranges in the editor glyph margin."));class Ve{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t||this.showFoldingControls==="never"?Ve.HIDDEN_RANGE_DECORATION:e?i?this.showFoldingHighlights?Ve.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ve.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?Ve.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ve.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?i?Ve.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:Ve.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?Ve.MANUALLY_EXPANDED_VISUAL_DECORATION:Ve.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}}Ve.COLLAPSED_VISUAL_DECORATION=ge.kI.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:U.L0.asClassName(Ca)}),Ve.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=ge.kI.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",isWholeLine:!0,firstLineDecorationClassName:U.L0.asClassName(Ca)}),Ve.MANUALLY_COLLAPSED_VISUAL_DECORATION=ge.kI.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+U.L0.asClassName(ks)}),Ve.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=ge.kI.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",isWholeLine:!0,firstLineDecorationClassName:U.L0.asClassName(hf)}),Ve.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=ge.kI.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:U.L0.asClassName(ks)}),Ve.EXPANDED_VISUAL_DECORATION=ge.kI.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+U.L0.asClassName(ks)}),Ve.MANUALLY_EXPANDED_VISUAL_DECORATION=ge.kI.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+U.L0.asClassName(vc)}),Ve.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=ge.kI.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:U.L0.asClassName(vc)}),Ve.HIDDEN_RANGE_DECORATION=ge.kI.register({description:"folding-hidden-range-decoration",stickiness:1});const eb={},tb="syntax";class ib{constructor(e,t,i,n){this.editorModel=e,this.providers=t,this.limit=n,this.id=tb;for(const o of t)typeof o.onDidChange=="function"&&(this.disposables||(this.disposables=new I.Cm),this.disposables.add(o.onDidChange(i)))}compute(e,t){return nb(this.providers,this.editorModel,e).then(i=>i?sb(i,this.limit,t):null)}dispose(){var e;(e=this.disposables)===null||e===void 0||e.dispose()}}function nb(r,e,t){let i=null;const n=r.map((o,s)=>Promise.resolve(o.provideFoldingRanges(e,eb,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(i)||(i=[]);const l=e.getLineCount();for(const c of a)c.start>0&&c.end>c.start&&c.end<=l&&i.push({start:c.start,end:c.end,rank:s,kind:c.kind})}},K.M_));return Promise.all(n).then(o=>i)}class ob{constructor(e,t){this._notifyTooManyRegions=t,this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,n){if(e>Ut||t>Ut)return;const o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._nestingLevels[o]=n,this._types[o]=i,this._length++,n<30&&(this._nestingLevelCounts[n]=(this._nestingLevelCounts[n]||0)+1)}toIndentRanges(){var e;if(this._length<=this._foldingRangesLimit){const t=new Uint32Array(this._length),i=new Uint32Array(this._length);for(let n=0;n<this._length;n++)t[n]=this._startIndexes[n],i[n]=this._endIndexes[n];return new mt(t,i,this._types)}else{(e=this._notifyTooManyRegions)===null||e===void 0||e.call(this,this._foldingRangesLimit);let t=0,i=this._nestingLevelCounts.length;for(let a=0;a<this._nestingLevelCounts.length;a++){const l=this._nestingLevelCounts[a];if(l){if(l+t>this._foldingRangesLimit){i=a;break}t+=l}}const n=new Uint32Array(this._foldingRangesLimit),o=new Uint32Array(this._foldingRangesLimit),s=[];for(let a=0,l=0;a<this._length;a++){const c=this._nestingLevels[a];(c<i||c===i&&t++<this._foldingRangesLimit)&&(n[l]=this._startIndexes[a],o[l]=this._endIndexes[a],s[l]=this._types[a],l++)}return new mt(n,o,s)}}}function sb(r,e,t){const i=r.sort((a,l)=>{let c=a.start-l.start;return c===0&&(c=a.rank-l.rank),c}),n=new ob(e,t);let o;const s=[];for(const a of i)if(!o)o=a,n.add(a.start,a.end,a.kind&&a.kind.value,s.length);else if(a.start>o.start)if(a.end<=o.end)s.push(o),o=a,n.add(a.start,a.end,a.kind&&a.kind.value,s.length);else{if(a.start>o.end){do o=s.pop();while(o&&a.start>o.end);o&&s.push(o),o=a}n.add(a.start,a.end,a.kind&&a.kind.value,s.length)}return n.toIndentRanges()}var rb=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Is=function(r,e){return function(t,i){e(t,i,r)}};const Ke=new A.N1("foldingEnabled",!1);let uo=class hm extends I.jG{constructor(e,t,i,n,o,s){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=s,this._tooManyRegionsNotified=!1,this.localToDispose=this._register(new I.Cm),this.editor=e;const a=this.editor.getOptions();this._isEnabled=a.get(39),this._useFoldingProviders=a.get(40)!=="indentation",this._unfoldOnClickAfterEndOfLine=a.get(44),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=a.get(42),this._maxFoldingRegions=a.get(43),this.updateDebounceInfo=o.for(s.foldingRangeProvider,"Folding",{min:200}),this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new Ve(e),this.foldingDecorationProvider.showFoldingControls=a.get(101),this.foldingDecorationProvider.showFoldingHighlights=a.get(41),this.foldingEnabled=Ke.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._notifyTooManyRegions=l=>{this._tooManyRegionsNotified||(n.notify({severity:to.A.Warning,sticky:!0,message:g.kg("maximum fold ranges",`The number of foldable regions is limited to a maximum of {0}. Increase configuration option ['Folding Maximum Regions'](command:workbench.action.openSettings?["editor.foldingMaximumRegions"]) to enable more.`,l)}),this._tooManyRegionsNotified=!0)},this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(l=>{if(l.hasChanged(39)&&(this._isEnabled=this.editor.getOptions().get(39),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),l.hasChanged(43)&&(this._maxFoldingRegions=this.editor.getOptions().get(43),this._tooManyRegionsNotified=!1,this.onModelChanged()),l.hasChanged(101)||l.hasChanged(41)){const c=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=c.get(101),this.foldingDecorationProvider.showFoldingHighlights=c.get(41),this.triggerFoldingModelChanged()}l.hasChanged(40)&&(this._useFoldingProviders=this.editor.getOptions().get(40)!=="indentation",this.onFoldingStrategyChanged()),l.hasChanged(44)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(44)),l.hasChanged(42)&&(this._foldingImportsByDefault=this.editor.getOptions().get(42))})),this.onModelChanged()}static get(e){return e.getContribution(hm.ID)}saveViewState(){const e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){const t=this.foldingModel.getMemento(),i=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:i,foldedImports:this._currentModelHasFoldedImports}}}restoreViewState(e){const t=this.editor.getModel();if(!(!t||!this._isEnabled||t.isTooLargeForTokenization()||!this.hiddenRangeModel)&&!(!e||e.lineCount!==t.getLineCount())&&(this._currentModelHasFoldedImports=!!e.foldedImports,e.collapsedRegions&&e.collapsedRegions.length>0&&this.foldingModel)){this._restoringViewState=!0;try{this.foldingModel.applyMemento(e.collapsedRegions)}finally{this._restoringViewState=!1}}}onModelChanged(){this.localToDispose.clear();const e=this.editor.getModel();!this._isEnabled||!e||e.isTooLargeForTokenization()||(this._currentModelHasFoldedImports=!1,this.foldingModel=new B0(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new K0(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new V.ve(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new V.uC(()=>this.revealCursor(),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(this.languageFeaturesService.foldingRangeProvider.onDidChange(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelContent(t=>this.onDidChangeModelContent(t))),this.localToDispose.add(this.editor.onDidChangeCursorPosition(()=>this.onCursorPositionChanged())),this.localToDispose.add(this.editor.onMouseDown(t=>this.onEditorMouseDown(t))),this.localToDispose.add(this.editor.onMouseUp(t=>this.onEditorMouseUp(t))),this.localToDispose.add({dispose:()=>{this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.updateScheduler&&this.updateScheduler.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,this.rangeProvider&&this.rangeProvider.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){this.rangeProvider&&this.rangeProvider.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;if(this.rangeProvider=new X0(e,this.languageConfigurationService,this._maxFoldingRegions),this._useFoldingProviders&&this.foldingModel){const t=this.languageFeaturesService.foldingRangeProvider.ordered(this.foldingModel.textModel);t.length>0&&(this.rangeProvider=new ib(e,t,()=>this.triggerFoldingModelChanged(),this._maxFoldingRegions))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){var t;(t=this.hiddenRangeModel)===null||t===void 0||t.notifyChangeModelContent(e),this.triggerFoldingModelChanged()}triggerFoldingModelChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger(()=>{const e=this.foldingModel;if(!e)return null;const t=new Kt.W(!0),i=this.getRangeProvider(e.textModel),n=this.foldingRegionPromise=(0,V.SS)(o=>i.compute(o,this._notifyTooManyRegions));return n.then(o=>{if(o&&n===this.foldingRegionPromise){let s;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const d=o.setCollapsedAllOfType(_e.lO.Imports.value,!0);d&&(s=qo.D.capture(this.editor),this._currentModelHasFoldedImports=d)}const a=this.editor.getSelections(),l=a?a.map(d=>d.startLineNumber):[];e.update(o,l),s?.restore(this.editor);const c=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=c)}return e})}).then(void 0,e=>((0,K.dz)(e),null)))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){const t=this.editor.getSelections();t&&this.hiddenRangeModel.adjustSelections(t)&&this.editor.setSelections(t)}this.editor.setHiddenAreas(e)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then(t=>{if(t){const i=this.editor.getSelections();if(i&&i.length>0){const n=[];for(const o of i){const s=o.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(s)&&n.push(...t.getAllRegionsAtLine(s,a=>a.isCollapsed&&s>a.startLineNumber))}n.length&&(t.toggleCollapseState(n),this.reveal(i[0].getPosition()))}}}).then(void 0,K.dz)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range||!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let i=!1;switch(e.target.type){case 4:{const n=e.target.detail,o=e.target.element.offsetLeft;if(n.offsetX-o<5)return;i=!0;break}case 7:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case 6:{if(this.hiddenRangeModel.hasRanges()){const n=this.editor.getModel();if(n&&t.startColumn===n.getLineMaxColumn(t.startLineNumber))break}return}default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:i}}onEditorMouseUp(e){const t=this.foldingModel;if(!t||!this.mouseDownInfo||!e.target)return;const i=this.mouseDownInfo.lineNumber,n=this.mouseDownInfo.iconClicked,o=e.target.range;if(!o||o.startLineNumber!==i)return;if(n){if(e.target.type!==4)return}else{const a=this.editor.getModel();if(!a||o.startColumn!==a.getLineMaxColumn(i))return}const s=t.getRegionAtLine(i);if(s&&s.startLineNumber===i){const a=s.isCollapsed;if(n||a){const l=e.event.altKey;let c=[];if(l){const d=h=>!h.containedBy(s)&&!s.containedBy(h),u=t.getRegionsInside(null,d);for(const h of u)h.isCollapsed&&c.push(h);c.length===0&&(c=u)}else{const d=e.event.middleButton||e.event.shiftKey;if(d)for(const u of t.getRegionsInside(s))u.isCollapsed===a&&c.push(u);(a||!d||c.length===0)&&c.push(s)}t.toggleCollapseState(c),this.reveal({lineNumber:i,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};uo.ID="editor.contrib.folding",uo=rb([Is(1,A.fN),Is(2,it.JZ),Is(3,Ye.Ot),Is(4,si.U),Is(5,te.u)],uo);class qe extends _.ks{runEditorCommand(e,t,i){const n=e.get(it.JZ),o=uo.get(t);if(!o)return;const s=o.getFoldingModel();if(s)return this.reportTelemetry(e,t),s.then(a=>{if(a){this.invoke(o,a,t,i,n);const l=t.getSelection();l&&o.reveal(l.getStartPosition())}})}getSelectedLines(e){const t=e.getSelections();return t?t.map(i=>i.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(i=>i+1):this.getSelectedLines(t)}run(e,t){}}function gf(r){if(!le.b0(r)){if(!le.Gv(r))return!1;const e=r;if(!le.b0(e.levels)&&!le.Et(e.levels)||!le.b0(e.direction)&&!le.Kg(e.direction)||!le.b0(e.selectionLines)&&(!le.cy(e.selectionLines)||!e.selectionLines.every(le.Et)))return!1}return!0}class ab extends qe{constructor(){super({id:"editor.unfold",label:g.kg("unfoldAction.label","Unfold"),alias:"Unfold",precondition:Ke,kbOpts:{kbExpr:D.R.editorTextFocus,primary:3161,mac:{primary:2649},weight:100},description:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:`Property-value pairs that can be passed through this argument:
						* 'levels': Number of levels to unfold. If not set, defaults to 1.
						* 'direction': If 'up', unfold given number of levels up otherwise unfolds down.
						* 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the unfold action to. If not set, the active selection(s) will be used.
						`,constraint:gf,schema:{type:"object",properties:{levels:{type:"number",default:1},direction:{type:"string",enum:["up","down"],default:"down"},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){const o=n&&n.levels||1,s=this.getLineNumbers(n,i);n&&n.direction==="up"?df(t,!1,o,s):co(t,!1,o,s)}}class lb extends qe{constructor(){super({id:"editor.unfoldRecursively",label:g.kg("unFoldRecursivelyAction.label","Unfold Recursively"),alias:"Unfold Recursively",precondition:Ke,kbOpts:{kbExpr:D.R.editorTextFocus,primary:(0,Ee.m5)(2089,2137),weight:100}})}invoke(e,t,i,n){co(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}class db extends qe{constructor(){super({id:"editor.fold",label:g.kg("foldAction.label","Fold"),alias:"Fold",precondition:Ke,kbOpts:{kbExpr:D.R.editorTextFocus,primary:3159,mac:{primary:2647},weight:100},description:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description:`Property-value pairs that can be passed through this argument:
							* 'levels': Number of levels to fold.
							* 'direction': If 'up', folds given number of levels up otherwise folds down.
							* 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the fold action to. If not set, the active selection(s) will be used.
							If no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead.
						`,constraint:gf,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){const o=this.getLineNumbers(n,i),s=n&&n.levels,a=n&&n.direction;typeof s!="number"&&typeof a!="string"?V0(t,!0,o):a==="up"?df(t,!0,s||1,o):co(t,!0,s||1,o)}}class cb extends qe{constructor(){super({id:"editor.toggleFold",label:g.kg("toggleFoldAction.label","Toggle Fold"),alias:"Toggle Fold",precondition:Ke,kbOpts:{kbExpr:D.R.editorTextFocus,primary:(0,Ee.m5)(2089,2090),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);H0(t,1,n)}}class ub extends qe{constructor(){super({id:"editor.foldRecursively",label:g.kg("foldRecursivelyAction.label","Fold Recursively"),alias:"Fold Recursively",precondition:Ke,kbOpts:{kbExpr:D.R.editorTextFocus,primary:(0,Ee.m5)(2089,2135),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);co(t,!0,Number.MAX_VALUE,n)}}class hb extends qe{constructor(){super({id:"editor.foldAllBlockComments",label:g.kg("foldAllBlockComments.label","Fold All Block Comments"),alias:"Fold All Block Comments",precondition:Ke,kbOpts:{kbExpr:D.R.editorTextFocus,primary:(0,Ee.m5)(2089,2133),weight:100}})}invoke(e,t,i,n,o){if(t.regions.hasTypes())_c(t,_e.lO.Comment.value,!0);else{const s=i.getModel();if(!s)return;const a=o.getLanguageConfiguration(s.getLanguageId()).comments;if(a&&a.blockCommentStartToken){const l=new RegExp("^\\s*"+(0,G.bm)(a.blockCommentStartToken));mc(t,l,!0)}}}}class gb extends qe{constructor(){super({id:"editor.foldAllMarkerRegions",label:g.kg("foldAllMarkerRegions.label","Fold All Regions"),alias:"Fold All Regions",precondition:Ke,kbOpts:{kbExpr:D.R.editorTextFocus,primary:(0,Ee.m5)(2089,2077),weight:100}})}invoke(e,t,i,n,o){if(t.regions.hasTypes())_c(t,_e.lO.Region.value,!0);else{const s=i.getModel();if(!s)return;const a=o.getLanguageConfiguration(s.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);mc(t,l,!0)}}}}class fb extends qe{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:g.kg("unfoldAllMarkerRegions.label","Unfold All Regions"),alias:"Unfold All Regions",precondition:Ke,kbOpts:{kbExpr:D.R.editorTextFocus,primary:(0,Ee.m5)(2089,2078),weight:100}})}invoke(e,t,i,n,o){if(t.regions.hasTypes())_c(t,_e.lO.Region.value,!1);else{const s=i.getModel();if(!s)return;const a=o.getLanguageConfiguration(s.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);mc(t,l,!1)}}}}class pb extends qe{constructor(){super({id:"editor.foldAllExcept",label:g.kg("foldAllExcept.label","Fold All Regions Except Selected"),alias:"Fold All Regions Except Selected",precondition:Ke,kbOpts:{kbExpr:D.R.editorTextFocus,primary:(0,Ee.m5)(2089,2131),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);cf(t,!0,n)}}class mb extends qe{constructor(){super({id:"editor.unfoldAllExcept",label:g.kg("unfoldAllExcept.label","Unfold All Regions Except Selected"),alias:"Unfold All Regions Except Selected",precondition:Ke,kbOpts:{kbExpr:D.R.editorTextFocus,primary:(0,Ee.m5)(2089,2129),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);cf(t,!1,n)}}class _b extends qe{constructor(){super({id:"editor.foldAll",label:g.kg("foldAllAction.label","Fold All"),alias:"Fold All",precondition:Ke,kbOpts:{kbExpr:D.R.editorTextFocus,primary:(0,Ee.m5)(2089,2069),weight:100}})}invoke(e,t,i){co(t,!0)}}class vb extends qe{constructor(){super({id:"editor.unfoldAll",label:g.kg("unfoldAllAction.label","Unfold All"),alias:"Unfold All",precondition:Ke,kbOpts:{kbExpr:D.R.editorTextFocus,primary:(0,Ee.m5)(2089,2088),weight:100}})}invoke(e,t,i){co(t,!1)}}class pn extends qe{getFoldingLevel(){return parseInt(this.id.substr(pn.ID_PREFIX.length))}invoke(e,t,i){U0(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}}pn.ID_PREFIX="editor.foldLevel",pn.ID=r=>pn.ID_PREFIX+r;class Cb extends qe{constructor(){super({id:"editor.gotoParentFold",label:g.kg("gotoParentFold.label","Go to Parent Fold"),alias:"Go to Parent Fold",precondition:Ke,kbOpts:{kbExpr:D.R.editorTextFocus,weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const o=z0(n[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class bb extends qe{constructor(){super({id:"editor.gotoPreviousFold",label:g.kg("gotoPreviousFold.label","Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:Ke,kbOpts:{kbExpr:D.R.editorTextFocus,weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const o=$0(n[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class Sb extends qe{constructor(){super({id:"editor.gotoNextFold",label:g.kg("gotoNextFold.label","Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:Ke,kbOpts:{kbExpr:D.R.editorTextFocus,weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const o=j0(n[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class yb extends qe{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:g.kg("createManualFoldRange.label","Create Manual Folding Range from Selection"),alias:"Create Folding Range from Selection",precondition:Ke,kbOpts:{kbExpr:D.R.editorTextFocus,primary:(0,Ee.m5)(2089,2130),weight:100}})}invoke(e,t,i){var n;const o=[],s=i.getSelections();if(s){for(const a of s){let l=a.endLineNumber;a.endColumn===1&&--l,l>a.startLineNumber&&(o.push({startLineNumber:a.startLineNumber,endLineNumber:l,type:void 0,isCollapsed:!0,source:1}),i.setSelection({startLineNumber:a.startLineNumber,startColumn:1,endLineNumber:a.startLineNumber,endColumn:1}))}if(o.length>0){o.sort((l,c)=>l.startLineNumber-c.startLineNumber);const a=mt.sanitizeAndMerge(t.regions,o,(n=i.getModel())===null||n===void 0?void 0:n.getLineCount());t.updatePost(mt.fromFoldRanges(a))}}}}class wb extends qe{constructor(){super({id:"editor.removeManualFoldingRanges",label:g.kg("removeManualFoldingRanges.label","Remove Manual Folding Ranges"),alias:"Remove Manual Folding Ranges",precondition:Ke,kbOpts:{kbExpr:D.R.editorTextFocus,primary:(0,Ee.m5)(2089,2132),weight:100}})}invoke(e,t,i){const n=i.getSelections();if(n){const o=[];for(const s of n){const{startLineNumber:a,endLineNumber:l}=s;o.push(l>=a?{startLineNumber:a,endLineNumber:l}:{endLineNumber:l,startLineNumber:a})}t.removeManualRanges(o),e.triggerFoldingModelChanged()}}}(0,_.HW)(uo.ID,uo),(0,_.Fl)(ab),(0,_.Fl)(lb),(0,_.Fl)(db),(0,_.Fl)(ub),(0,_.Fl)(_b),(0,_.Fl)(vb),(0,_.Fl)(hb),(0,_.Fl)(gb),(0,_.Fl)(fb),(0,_.Fl)(pb),(0,_.Fl)(mb),(0,_.Fl)(cb),(0,_.Fl)(Cb),(0,_.Fl)(bb),(0,_.Fl)(Sb),(0,_.Fl)(yb),(0,_.Fl)(wb);for(let r=1;r<=7;r++)(0,_.xX)(new pn({id:pn.ID(r),label:g.kg("foldLevelAction.label","Fold Level {0}",r),alias:`Fold Level ${r}`,precondition:Ke,kbOpts:{kbExpr:D.R.editorTextFocus,primary:(0,Ee.m5)(2089,2048|21+r),weight:100}}));const Db=(0,C.x1A)("editor.foldBackground",{light:(0,C.JO0)(C.seu,.3),dark:(0,C.JO0)(C.seu,.3),hcDark:null,hcLight:null},g.kg("foldBackgroundBackground","Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0),xb=(0,C.x1A)("editorGutter.foldingControlForeground",{dark:C.t4B,light:C.t4B,hcDark:C.t4B,hcLight:C.t4B},g.kg("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));(0,U.zy)((r,e)=>{const t=r.getColor(Db);t&&e.addRule(`.monaco-editor .folded-background { background-color: ${t}; }`);const i=r.getColor(xb);i&&e.addRule(`
		.monaco-editor .cldr${U.L0.asCSSSelector(ks)},
		.monaco-editor .cldr${U.L0.asCSSSelector(Ca)},
		.monaco-editor .cldr${U.L0.asCSSSelector(vc)},
		.monaco-editor .cldr${U.L0.asCSSSelector(hf)} {
			color: ${i} !important;
		}
		`)});var Rs=f(84587);class Lb extends _.ks{constructor(){super({id:"editor.action.fontZoomIn",label:g.kg("EditorFontZoomIn.label","Editor Font Zoom In"),alias:"Editor Font Zoom In",precondition:void 0})}run(e,t){Rs.D.setZoomLevel(Rs.D.getZoomLevel()+1)}}class kb extends _.ks{constructor(){super({id:"editor.action.fontZoomOut",label:g.kg("EditorFontZoomOut.label","Editor Font Zoom Out"),alias:"Editor Font Zoom Out",precondition:void 0})}run(e,t){Rs.D.setZoomLevel(Rs.D.getZoomLevel()-1)}}class Ib extends _.ks{constructor(){super({id:"editor.action.fontZoomReset",label:g.kg("EditorFontZoomReset.label","Editor Font Zoom Reset"),alias:"Editor Font Zoom Reset",precondition:void 0})}run(e,t){Rs.D.setZoomLevel(0)}}(0,_.Fl)(Lb),(0,_.Fl)(kb),(0,_.Fl)(Ib);var ho=f(27454),Es=f(90304),As=f(38801),Rb=f(55406),ff=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},ba=function(r,e){return function(t,i){e(t,i,r)}},Cc=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};let Ns=class{constructor(e,t,i){this._editor=e,this._languageFeaturesService=t,this._workerService=i,this._disposables=new I.Cm,this._sessionDisposables=new I.Cm,this._disposables.add(t.onTypeFormattingEditProvider.onDidChange(this._update,this)),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(n=>{n.hasChanged(51)&&this._update()}))}dispose(){this._disposables.dispose(),this._sessionDisposables.dispose()}_update(){if(this._sessionDisposables.clear(),!this._editor.getOption(51)||!this._editor.hasModel())return;const e=this._editor.getModel(),[t]=this._languageFeaturesService.onTypeFormattingEditProvider.ordered(e);if(!t||!t.autoFormatTriggerCharacters)return;const i=new ho.y;for(const n of t.autoFormatTriggerCharacters)i.add(n.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType(n=>{const o=n.charCodeAt(n.length-1);i.has(o)&&this._trigger(String.fromCharCode(o))}))}_trigger(e){if(!this._editor.hasModel()||this._editor.getSelections().length>1||!this._editor.getSelection().isEmpty())return;const t=this._editor.getModel(),i=this._editor.getPosition(),n=new re.Q,o=this._editor.onDidChangeModelContent(s=>{if(s.isFlush){n.cancel(),o.dispose();return}for(let a=0,l=s.changes.length;a<l;a++)if(s.changes[a].range.endLineNumber<=i.lineNumber){n.cancel(),o.dispose();return}});(0,As._V)(this._workerService,this._languageFeaturesService,t,i,e,t.getFormattingOptions(),n.token).then(s=>{n.token.isCancellationRequested||(0,pe.EI)(s)&&(Rb.c.execute(this._editor,s,!0),(0,As.pD)(s))}).finally(()=>{o.dispose()})}};Ns.ID="editor.contrib.autoFormat",Ns=ff([ba(1,te.u),ba(2,Es.w)],Ns);let Ms=class{constructor(e,t,i){this.editor=e,this._languageFeaturesService=t,this._instantiationService=i,this._callOnDispose=new I.Cm,this._callOnModel=new I.Cm,this._callOnDispose.add(e.onDidChangeConfiguration(()=>this._update())),this._callOnDispose.add(e.onDidChangeModel(()=>this._update())),this._callOnDispose.add(e.onDidChangeModelLanguage(()=>this._update())),this._callOnDispose.add(t.documentRangeFormattingEditProvider.onDidChange(this._update,this))}dispose(){this._callOnDispose.dispose(),this._callOnModel.dispose()}_update(){this._callOnModel.clear(),this.editor.getOption(50)&&this.editor.hasModel()&&this._languageFeaturesService.documentRangeFormattingEditProvider.has(this.editor.getModel())&&this._callOnModel.add(this.editor.onDidPaste(({range:e})=>this._trigger(e)))}_trigger(e){this.editor.hasModel()&&(this.editor.getSelections().length>1||this._instantiationService.invokeFunction(As.jX,this.editor,e,2,Dt.ke.None,re.X.None).catch(K.dz))}};Ms.ID="editor.contrib.formatOnPaste",Ms=ff([ba(1,te.u),ba(2,he._Y)],Ms);class Eb extends _.ks{constructor(){super({id:"editor.action.formatDocument",label:g.kg("formatDocument.label","Format Document"),alias:"Format Document",precondition:A.M$.and(D.R.notInCompositeEditor,D.R.writable,D.R.hasDocumentFormattingProvider),kbOpts:{kbExpr:D.R.editorTextFocus,primary:1572,linux:{primary:3111},weight:100},contextMenuOpts:{group:"1_modification",order:1.3}})}run(e,t){return Cc(this,void 0,void 0,function*(){if(t.hasModel()){const i=e.get(he._Y);yield e.get(Dt.N8).showWhile(i.invokeFunction(As.vg,t,1,Dt.ke.None,re.X.None),250)}})}}class Ab extends _.ks{constructor(){super({id:"editor.action.formatSelection",label:g.kg("formatSelection.label","Format Selection"),alias:"Format Selection",precondition:A.M$.and(D.R.writable,D.R.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:D.R.editorTextFocus,primary:(0,Ee.m5)(2089,2084),weight:100},contextMenuOpts:{when:D.R.hasNonEmptySelection,group:"1_modification",order:1.31}})}run(e,t){return Cc(this,void 0,void 0,function*(){if(!t.hasModel())return;const i=e.get(he._Y),n=t.getModel(),o=t.getSelections().map(a=>a.isEmpty()?new L.Q(a.startLineNumber,1,a.startLineNumber,n.getLineMaxColumn(a.startLineNumber)):a);yield e.get(Dt.N8).showWhile(i.invokeFunction(As.jX,t,o,1,Dt.ke.None,re.X.None),250)})}}(0,_.HW)(Ns.ID,Ns),(0,_.HW)(Ms.ID,Ms),(0,_.Fl)(Eb),(0,_.Fl)(Ab),fe.wb.registerCommand("editor.action.format",r=>Cc(void 0,void 0,void 0,function*(){const e=r.get(Be.T).getFocusedCodeEditor();if(!e||!e.hasModel())return;const t=r.get(fe.wT);e.getSelection().isEmpty()?yield t.executeCommand("editor.action.formatDocument"):yield t.executeCommand("editor.action.formatSelection")}));var Ts=f(17954),Nb=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},bc=function(r,e){return function(t,i){e(t,i,r)}},Mb=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};class go{remove(){var e;(e=this.parent)===null||e===void 0||e.children.delete(this.id)}static findId(e,t){let i;typeof e=="string"?i=`${t.id}/${e}`:(i=`${t.id}/${e.name}`,t.children.get(i)!==void 0&&(i=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let n=i;for(let o=0;t.children.get(n)!==void 0;o++)n=`${i}_${o}`;return n}static empty(e){return e.children.size===0}}class Sa extends go{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}}class Tb extends go{constructor(e,t,i,n){super(),this.id=e,this.parent=t,this.label=i,this.order=n,this.children=new Map}}class gi extends go{constructor(e){super(),this.uri=e,this.id="root",this.parent=void 0,this._groups=new Map,this.children=new Map,this.id="root",this.parent=void 0}static create(e,t,i){const n=new re.Q(i),o=new gi(t.uri),s=e.ordered(t),a=s.map((c,d)=>{var u;const h=go.findId(`provider_${d}`,o),p=new Tb(h,o,(u=c.displayName)!==null&&u!==void 0?u:"Unknown Outline Provider",d);return Promise.resolve(c.provideDocumentSymbols(t,n.token)).then(m=>{for(const v of m||[])gi._makeOutlineElement(v,p);return p},m=>((0,K.M_)(m),p)).then(m=>{go.empty(m)?m.remove():o._groups.set(h,m)})}),l=e.onDidChange(()=>{const c=e.ordered(t);(0,pe.aI)(c,s)||n.cancel()});return Promise.all(a).then(()=>n.token.isCancellationRequested&&!i.isCancellationRequested?gi.create(e,t,i):o._compact()).finally(()=>{l.dispose()})}static _makeOutlineElement(e,t){const i=go.findId(e,t),n=new Sa(i,t,e);if(e.children)for(const o of e.children)gi._makeOutlineElement(o,n);t.children.set(n.id,n)}_compact(){let e=0;for(const[t,i]of this._groups)i.children.size===0?this._groups.delete(t):e+=1;if(e!==1)this.children=this._groups;else{const t=Ts.f.first(this._groups.values());for(const[,i]of t.children)i.parent=this,this.children.set(i.id,i)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof Sa?e.push(t.symbol):e.push(...Ts.f.map(t.children.values(),i=>i.symbol));return e.sort((t,i)=>L.Q.compareRangesUsingStarts(t.range,i.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return gi._flattenDocumentSymbols(t,e,""),t.sort((i,n)=>ee.y.compare(L.Q.getStartPosition(i.range),L.Q.getStartPosition(n.range))||ee.y.compare(L.Q.getEndPosition(n.range),L.Q.getEndPosition(i.range)))}static _flattenDocumentSymbols(e,t,i){for(const n of t)e.push({kind:n.kind,tags:n.tags,name:n.name,detail:n.detail,containerName:n.containerName||i,range:n.range,selectionRange:n.selectionRange,children:void 0}),n.children&&gi._flattenDocumentSymbols(e,n.children,n.name)}}const ya=(0,he.u1)("IOutlineModelService");let Sc=class{constructor(e,t,i){this._languageFeaturesService=e,this._disposables=new I.Cm,this._cache=new Ji.qK(10,.7),this._debounceInformation=t.for(e.documentSymbolProvider,"DocumentSymbols",{min:350}),this._disposables.add(i.onModelRemoved(n=>{this._cache.delete(n.id)}))}dispose(){this._disposables.dispose()}getOrCreate(e,t){return Mb(this,void 0,void 0,function*(){const i=this._languageFeaturesService.documentSymbolProvider,n=i.ordered(e);let o=this._cache.get(e.id);if(!o||o.versionId!==e.getVersionId()||!(0,pe.aI)(o.provider,n)){const a=new re.Q;o={versionId:e.getVersionId(),provider:n,promiseCnt:0,source:a,promise:gi.create(i,e,a.token),model:void 0},this._cache.set(e.id,o);const l=Date.now();o.promise.then(c=>{o.model=c,this._debounceInformation.update(e,Date.now()-l)}).catch(c=>{this._cache.delete(e.id)})}if(o.model)return o.model;o.promiseCnt+=1;const s=t.onCancellationRequested(()=>{--o.promiseCnt===0&&(o.source.cancel(),this._cache.delete(e.id))});try{return yield o.promise}finally{s.dispose()}})}};Sc=Nb([bc(0,te.u),bc(1,si.U),bc(2,$t.S)],Sc),(0,qi.v)(ya,Sc,!0);var Ob=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};fe.wb.registerCommand("_executeDocumentSymbolProvider",function(r,...e){return Ob(this,void 0,void 0,function*(){const[t]=e;(0,le.j)(me.r.isUri(t));const i=r.get(ya),o=yield r.get(Ft.b).createModelReference(t);try{return(yield i.getOrCreate(o.object.textEditorModel,re.X.None)).getTopLevelSymbols()}finally{o.dispose()}})});const wa="editor.action.inlineSuggest.commit";var Fb=f(62549);function Pb(r,e){return{object:r,dispose:()=>e?.dispose()}}function Wb(r,e){const t=new Bb(r),i=e.map(n=>{const o=L.Q.lift(n.range);return{startOffset:t.getOffset(o.getStartPosition()),endOffset:t.getOffset(o.getEndPosition()),text:n.text}});i.sort((n,o)=>o.startOffset-n.startOffset);for(const n of i)r=r.substring(0,n.startOffset)+n.text+r.substring(n.endOffset);return r}class Bb{constructor(e){this.lineStartOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;t<e.length;t++)e.charAt(t)===`
`&&this.lineStartOffsetByLineIdx.push(t+1)}getOffset(e){return this.lineStartOffsetByLineIdx[e.lineNumber-1]+e.column-1}}const Hb=[];function Vb(){return Hb}class pf{constructor(e,t,i=0){this.lineNumber=e,this.parts=t,this.additionalReservedLineCount=i}renderForScreenReader(e){if(this.parts.length===0)return"";const t=this.parts[this.parts.length-1],i=e.substr(0,t.column-1);return Wb(i,this.parts.map(o=>({range:{startLineNumber:1,endLineNumber:1,startColumn:o.column,endColumn:o.column},text:o.lines.join(`
`)}))).substring(this.parts[0].column-1)}isEmpty(){return this.parts.every(e=>e.lines.length===0)}}class yc{constructor(e,t,i){this.column=e,this.lines=t,this.preview=i}}class mf{constructor(e,t,i,n,o=0){this.lineNumber=e,this.columnStart=t,this.length=i,this.newLines=n,this.additionalReservedLineCount=o,this.parts=[new yc(this.columnStart+this.length,this.newLines,!1)]}renderForScreenReader(e){return this.newLines.join(`
`)}}class _f extends I.jG{constructor(e){super(),this.editor=e,this._expanded=void 0,this.onDidChangeEmitter=new Z.vl,this.onDidChange=this.onDidChangeEmitter.event,this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(108)&&this._expanded===void 0&&this.onDidChangeEmitter.fire()}))}setExpanded(e){this._expanded=!0,this.onDidChangeEmitter.fire()}}var Ub=f(6341);function Da(r,e){if(!e)return e;const t=r.getValueInRange(e.range),i=G.Qp(t,e.insertText),n=r.getOffsetAt(e.range.getStartPosition())+i,o=r.getPositionAt(n),s=t.substr(i),a=G.Vi(s,e.insertText),l=r.getPositionAt(Math.max(n,r.getOffsetAt(e.range.getEndPosition())-a));return{range:L.Q.fromPositions(o,l),insertText:e.insertText.substr(i,e.insertText.length-i-a),snippetInfo:e.snippetInfo,filterText:e.filterText,additionalTextEdits:e.additionalTextEdits}}function zb(r,e){return r===e?!0:!r||!e?!1:r.range.equalsRange(e.range)&&r.insertText===e.insertText&&r.command===e.command}function vf(r,e,t,i,n=0){if(r.range.startLineNumber!==r.range.endLineNumber)return;const o=e.getLineContent(r.range.startLineNumber),s=G.UU(o).length;if(r.range.startColumn-1<=s){const p=G.UU(r.insertText).length,m=o.substring(r.range.startColumn-1,s),v=L.Q.fromPositions(r.range.getStartPosition().delta(0,m.length),r.range.getEndPosition()),w=r.insertText.startsWith(m)?r.insertText.substring(m.length):r.insertText.substring(p);r={range:v,insertText:w,command:r.command,snippetInfo:void 0,filterText:r.filterText,additionalTextEdits:r.additionalTextEdits}}const l=e.getValueInRange(r.range),c=$b(l,r.insertText);if(!c)return;const d=r.range.startLineNumber,u=new Array;if(t==="prefix"){const p=c.filter(m=>m.originalLength===0);if(p.length>1||p.length===1&&p[0].originalStart!==l.length)return}const h=r.insertText.length-n;for(const p of c){const m=r.range.startColumn+p.originalStart+p.originalLength;if(t==="subwordSmart"&&i&&i.lineNumber===r.range.startLineNumber&&m<i.column||p.originalLength>0)return;if(p.modifiedLength===0)continue;const v=p.modifiedStart+p.modifiedLength,w=Math.max(p.modifiedStart,Math.min(v,h)),R=r.insertText.substring(p.modifiedStart,w),T=r.insertText.substring(w,Math.max(p.modifiedStart,v));if(R.length>0){const F=G.uz(R);u.push(new yc(m,F,!1))}if(T.length>0){const F=G.uz(T);u.push(new yc(m,F,!0))}}return new pf(d,u,0)}let Jt;function $b(r,e){if(Jt?.originalValue===r&&Jt?.newValue===e)return Jt?.changes;{let t=bf(r,e,!0);if(t){const i=Cf(t);if(i>0){const n=bf(r,e,!1);n&&Cf(n)<i&&(t=n)}}return Jt={originalValue:r,newValue:e,changes:t},t}}function Cf(r){let e=0;for(const t of r)e+=Math.max(t.originalLength-t.modifiedLength,0);return e}function bf(r,e,t){if(r.length>5e3||e.length>5e3)return;function i(c){let d=0;for(let u=0,h=c.length;u<h;u++){const p=c.charCodeAt(u);p>d&&(d=p)}return d}const n=Math.max(i(r),i(e));function o(c){if(c<0)throw new Error("unexpected");return n+c+1}function s(c){let d=0,u=0;const h=new Int32Array(c.length);for(let p=0,m=c.length;p<m;p++)if(t&&c[p]==="("){const v=u*100+d;h[p]=o(2*v),d++}else if(t&&c[p]===")"){d=Math.max(d-1,0);const v=u*100+d;h[p]=o(2*v+1),d===0&&u++}else h[p]=c.charCodeAt(p);return h}const a=s(r),l=s(e);return new Ub.uP({getElements:()=>a},{getElements:()=>l}).ComputeDiff(!1).changes}var jb=f(85702),Pi=f(34883),Gb=f(68302),Kb=f(60756),Qb=f(33206);function Zb(r,e){const t=new Kb.Mg,i=new jb.Z(t,c=>e.getLanguageConfiguration(c)),n=new Qb.tk(new Yb([r]),i),o=(0,Gb.T)(n,[],void 0,!0);let s="";const a=r.getLineContent();function l(c,d){if(c.kind===2)if(l(c.openingBracket,d),d=(0,Pi.QB)(d,c.openingBracket.length),c.child&&(l(c.child,d),d=(0,Pi.QB)(d,c.child.length)),c.closingBracket)l(c.closingBracket,d),d=(0,Pi.QB)(d,c.closingBracket.length);else{const h=i.getSingleLanguageBracketTokens(c.openingBracket.languageId).findClosingTokenText(c.openingBracket.bracketIds);s+=h}else if(c.kind!==3){if(c.kind===0||c.kind===1)s+=a.substring((0,Pi.sS)(d),(0,Pi.sS)((0,Pi.QB)(d,c.length)));else if(c.kind===4)for(const u of c.children)l(u,d),d=(0,Pi.QB)(d,u.length)}}return l(o,Pi.Vp),s}class Yb{constructor(e){this.lines=e,this.tokenization={getLineTokens:t=>this.lines[t-1]}}getLineCount(){return this.lines.length}getLineLength(e){return this.lines[e-1].getLineContent().length}}var Xb=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Os=function(r,e){return function(t,i){e(t,i,r)}},fi=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};let wc=class extends I.jG{constructor(e,t,i,n,o,s,a){super(),this.editor=e,this.cache=t,this.commandService=i,this.languageConfigurationService=n,this.languageFeaturesService=o,this.debounceService=s,this.onDidChangeEmitter=new Z.vl,this.onDidChange=this.onDidChangeEmitter.event,this.completionSession=this._register(new I.HE),this.active=!1,this.disposed=!1,this.debounceValue=this.debounceService.for(this.languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this._register(i.onDidExecuteCommand(l=>{new Set([Sr.Yh.Tab.id,Sr.Yh.DeleteLeft.id,Sr.Yh.DeleteRight.id,wa,"acceptSelectedSuggestion"]).has(l.commandId)&&e.hasTextFocus()&&this.handleUserInput()})),this._register(this.editor.onDidType(l=>{this.handleUserInput()})),this._register(this.editor.onDidChangeCursorPosition(l=>{(l.reason===3||this.session&&!this.session.isValid)&&this.hide()})),this._register((0,I.s)(()=>{this.disposed=!0})),this._register(this.editor.onDidBlurEditorWidget(()=>{a.getValue("editor.inlineSuggest.hideOnBlur")||this.hide()}))}handleUserInput(){this.session&&!this.session.isValid&&this.hide(),setTimeout(()=>{this.disposed||this.startSessionIfTriggered()},0)}get session(){return this.completionSession.value}get ghostText(){var e;return(e=this.session)===null||e===void 0?void 0:e.ghostText}get minReservedLineCount(){return this.session?this.session.minReservedLineCount:0}setExpanded(e){var t;(t=this.session)===null||t===void 0||t.setExpanded(e)}setActive(e){var t;this.active=e,e&&((t=this.session)===null||t===void 0||t.scheduleAutomaticUpdate())}startSessionIfTriggered(){this.editor.getOption(57).enabled&&(this.session&&this.session.isValid||this.trigger(_e.qw.Automatic))}trigger(e){if(this.completionSession.value){e===_e.qw.Explicit&&this.completionSession.value.ensureUpdateWithExplicitContext();return}this.completionSession.value=new Jb(this.editor,this.editor.getPosition(),()=>this.active,this.commandService,this.cache,e,this.languageConfigurationService,this.languageFeaturesService.inlineCompletionsProvider,this.debounceValue),this.completionSession.value.takeOwnership(this.completionSession.value.onDidChange(()=>{this.onDidChangeEmitter.fire()}))}hide(){this.completionSession.clear(),this.onDidChangeEmitter.fire()}commitCurrentSuggestion(){var e;(e=this.session)===null||e===void 0||e.commitCurrentCompletion()}showNext(){var e;(e=this.session)===null||e===void 0||e.showNextInlineCompletion()}showPrevious(){var e;(e=this.session)===null||e===void 0||e.showPreviousInlineCompletion()}hasMultipleInlineCompletions(){var e;return fi(this,void 0,void 0,function*(){const t=yield(e=this.session)===null||e===void 0?void 0:e.hasMultipleInlineCompletions();return t!==void 0?t:!1})}};wc=Xb([Os(2,fe.wT),Os(3,it.JZ),Os(4,te.u),Os(5,si.U),Os(6,Fe.pG)],wc);class Jb extends _f{constructor(e,t,i,n,o,s,a,l,c){super(e),this.triggerPosition=t,this.shouldUpdate=i,this.commandService=n,this.cache=o,this.initialTriggerKind=s,this.languageConfigurationService=a,this.registry=l,this.debounce=c,this.minReservedLineCount=0,this.updateOperation=this._register(new I.HE),this.updateSoon=this._register(new V.uC(()=>{const u=this.initialTriggerKind;return this.initialTriggerKind=_e.qw.Automatic,this.update(u)},50)),this.filteredCompletions=[],this.currentlySelectedCompletionId=void 0;let d;this._register(this.onDidChange(()=>{var u;const h=this.currentCompletion;if(h&&h.sourceInlineCompletion!==d){d=h.sourceInlineCompletion;const p=h.sourceProvider;(u=p.handleItemDidShow)===null||u===void 0||u.call(p,h.sourceInlineCompletions,d)}})),this._register((0,I.s)(()=>{this.cache.clear()})),this._register(this.editor.onDidChangeCursorPosition(u=>{var h;u.reason!==3&&((h=this.cache.value)===null||h===void 0||h.updateRanges(),this.cache.value&&(this.updateFilteredInlineCompletions(),this.onDidChangeEmitter.fire()))})),this._register(this.editor.onDidChangeModelContent(u=>{var h;(h=this.cache.value)===null||h===void 0||h.updateRanges(),this.updateFilteredInlineCompletions(),this.scheduleAutomaticUpdate()})),this._register(this.registry.onDidChange(()=>{this.updateSoon.schedule(this.debounce.get(this.editor.getModel()))})),this.scheduleAutomaticUpdate()}updateFilteredInlineCompletions(){if(!this.cache.value){this.filteredCompletions=[];return}const e=this.editor.getModel(),t=e.validatePosition(this.editor.getPosition());this.filteredCompletions=this.cache.value.completions.filter(i=>{const n=e.getValueInRange(i.synchronizedRange).toLowerCase(),o=i.inlineCompletion.filterText.toLowerCase(),s=e.getLineIndentColumn(i.synchronizedRange.startLineNumber),a=Math.max(0,t.column-i.synchronizedRange.startColumn);let l=o.substring(0,a),c=o.substring(a),d=n.substring(0,a),u=n.substring(a);return i.synchronizedRange.startColumn<=s&&(d=d.trimStart(),d.length===0&&(u=u.trimStart()),l=l.trimStart(),l.length===0&&(c=c.trimStart())),l.startsWith(d)&&(0,je.dE)(u,c)})}fixAndGetIndexOfCurrentSelection(){if(!this.currentlySelectedCompletionId||!this.cache.value||this.cache.value.completions.length===0)return 0;const e=this.filteredCompletions.findIndex(t=>t.semanticId===this.currentlySelectedCompletionId);return e===-1?(this.currentlySelectedCompletionId=void 0,0):e}get currentCachedCompletion(){if(this.cache.value)return this.filteredCompletions[this.fixAndGetIndexOfCurrentSelection()]}showNextInlineCompletion(){return fi(this,void 0,void 0,function*(){yield this.ensureUpdateWithExplicitContext();const e=this.filteredCompletions||[];if(e.length>0){const t=(this.fixAndGetIndexOfCurrentSelection()+1)%e.length;this.currentlySelectedCompletionId=e[t].semanticId}else this.currentlySelectedCompletionId=void 0;this.onDidChangeEmitter.fire()})}showPreviousInlineCompletion(){return fi(this,void 0,void 0,function*(){yield this.ensureUpdateWithExplicitContext();const e=this.filteredCompletions||[];if(e.length>0){const t=(this.fixAndGetIndexOfCurrentSelection()+e.length-1)%e.length;this.currentlySelectedCompletionId=e[t].semanticId}else this.currentlySelectedCompletionId=void 0;this.onDidChangeEmitter.fire()})}ensureUpdateWithExplicitContext(){var e;return fi(this,void 0,void 0,function*(){this.updateOperation.value?this.updateOperation.value.triggerKind===_e.qw.Explicit?yield this.updateOperation.value.promise:yield this.update(_e.qw.Explicit):((e=this.cache.value)===null||e===void 0?void 0:e.triggerKind)!==_e.qw.Explicit&&(yield this.update(_e.qw.Explicit))})}hasMultipleInlineCompletions(){var e;return fi(this,void 0,void 0,function*(){return yield this.ensureUpdateWithExplicitContext(),(((e=this.cache.value)===null||e===void 0?void 0:e.completions.length)||0)>1})}get ghostText(){const e=this.currentCompletion;if(!e)return;const t=this.editor.getPosition();if(e.range.getEndPosition().isBefore(t))return;const i=this.editor.getOptions().get(57).mode,n=vf(e,this.editor.getModel(),i,t);return n?n.isEmpty()?void 0:n:new mf(e.range.startLineNumber,e.range.startColumn,e.range.endColumn-e.range.startColumn,e.insertText.split(`
`),0)}get currentCompletion(){const e=this.currentCachedCompletion;if(e)return e.toLiveInlineCompletion()}get isValid(){return this.editor.getPosition().lineNumber===this.triggerPosition.lineNumber}scheduleAutomaticUpdate(){this.updateOperation.clear(),this.updateSoon.schedule(this.debounce.get(this.editor.getModel()))}update(e){return fi(this,void 0,void 0,function*(){if(!this.shouldUpdate())return;const t=this.editor.getPosition(),i=new Date,n=(0,V.SS)(s=>fi(this,void 0,void 0,function*(){let a;try{a=yield yf(this.registry,t,this.editor.getModel(),{triggerKind:e,selectedSuggestionInfo:void 0},s,this.languageConfigurationService);const l=new Date;this.debounce.update(this.editor.getModel(),l.getTime()-i.getTime())}catch(l){(0,K.dz)(l);return}s.isCancellationRequested||(this.cache.setValue(this.editor,a,e),this.updateFilteredInlineCompletions(),this.onDidChangeEmitter.fire())})),o=new Sf(n,e);this.updateOperation.value=o,yield n,this.updateOperation.value===o&&this.updateOperation.clear()})}takeOwnership(e){this._register(e)}commitCurrentCompletion(){if(!this.ghostText)return;const t=this.currentCompletion;t&&this.commit(t)}commit(e){var t;const i=this.cache.clearAndLeak();e.snippetInfo?(this.editor.executeEdits("inlineSuggestion.accept",[Le.k.replaceMove(e.range,""),...e.additionalTextEdits]),this.editor.setPosition(e.snippetInfo.range.getStartPosition()),(t=Me.get(this.editor))===null||t===void 0||t.insert(e.snippetInfo.snippet)):this.editor.executeEdits("inlineSuggestion.accept",[Le.k.replaceMove(e.range,e.insertText),...e.additionalTextEdits]),e.command?this.commandService.executeCommand(e.command.id,...e.command.arguments||[]).finally(()=>{i?.dispose()}).then(void 0,K.M_):i?.dispose(),this.onDidChangeEmitter.fire()}get commands(){var e;return[...new Set(((e=this.cache.value)===null||e===void 0?void 0:e.completions.map(i=>i.inlineCompletion.sourceInlineCompletions))||[])].flatMap(i=>i.commands||[])}}class Sf{constructor(e,t){this.promise=e,this.triggerKind=t}dispose(){this.promise.cancel()}}class qb extends I.jG{constructor(e,t,i,n){super(),this.editor=t,this.onChange=i,this.triggerKind=n,this.isDisposing=!1;const o=t.changeDecorations(s=>s.deltaDecorations([],e.items.map(a=>({range:a.range,options:{description:"inline-completion-tracking-range"}}))));this._register((0,I.s)(()=>{this.isDisposing=!0,t.removeDecorations(o)})),this.completions=e.items.map((s,a)=>new eS(s,o[a])),this._register(t.onDidChangeModelContent(()=>{this.updateRanges()})),this._register(e)}updateRanges(){if(this.isDisposing)return;let e=!1;const t=this.editor.getModel();for(const i of this.completions){const n=t.getDecorationRange(i.decorationId);if(!n){(0,K.dz)(new Error("Decoration has no range"));continue}i.synchronizedRange.equalsRange(n)||(e=!0,i.synchronizedRange=n)}e&&this.onChange()}}class eS{constructor(e,t){this.inlineCompletion=e,this.decorationId=t,this.semanticId=JSON.stringify({text:this.inlineCompletion.insertText,abbreviation:this.inlineCompletion.filterText,startLine:this.inlineCompletion.range.startLineNumber,startColumn:this.inlineCompletion.range.startColumn,command:this.inlineCompletion.command}),this.synchronizedRange=e.range}toLiveInlineCompletion(){return{insertText:this.inlineCompletion.insertText,range:this.synchronizedRange,command:this.inlineCompletion.command,sourceProvider:this.inlineCompletion.sourceProvider,sourceInlineCompletions:this.inlineCompletion.sourceInlineCompletions,sourceInlineCompletion:this.inlineCompletion.sourceInlineCompletion,snippetInfo:this.inlineCompletion.snippetInfo,filterText:this.inlineCompletion.filterText,additionalTextEdits:this.inlineCompletion.additionalTextEdits}}}function yf(r,e,t,i,n=re.X.None,o){return fi(this,void 0,void 0,function*(){const s=tS(e,t),a=r.all(t),l=yield Promise.all(a.map(d=>fi(this,void 0,void 0,function*(){const u=yield Promise.resolve(d.provideInlineCompletions(t,e,i,n)).catch(K.M_);return{completions:u,provider:d,dispose:()=>{u&&d.freeInlineCompletions(u)}}}))),c=new Map;for(const d of l){const u=d.completions;if(u)for(const h of u.items){let p=h.range?L.Q.lift(h.range):s;if(p.startLineNumber!==p.endLineNumber)continue;let m,v;if(typeof h.insertText=="string"){if(m=h.insertText,o&&h.completeBracketPairs){m=iS(m,p.getStartPosition(),t,o);const R=m.length-h.insertText.length;R!==0&&(p=new L.Q(p.startLineNumber,p.startColumn,p.endLineNumber,p.endColumn+R))}v=void 0}else"snippet"in h.insertText?(m=new Ri().parse(h.insertText.snippet).toString(),v={snippet:h.insertText.snippet,range:p}):(0,le.xb)(h.insertText);const w={insertText:m,snippetInfo:v,range:p,command:h.command,sourceProvider:d.provider,sourceInlineCompletions:u,sourceInlineCompletion:h,filterText:h.filterText||m,additionalTextEdits:h.additionalTextEdits||Vb()};c.set(JSON.stringify({insertText:m,range:h.range}),w)}}return{items:[...c.values()],dispose:()=>{for(const d of l)d.dispose()}}})}function tS(r,e){const t=e.getWordAtPosition(r),i=e.getLineMaxColumn(r.lineNumber);return t?new L.Q(r.lineNumber,t.startColumn,r.lineNumber,i):L.Q.fromPositions(r,r.with(void 0,i))}function iS(r,e,t,i){const o=t.getLineContent(e.lineNumber).substring(0,e.column-1)+r,s=t.tokenization.tokenizeLineWithEdit(e,o.length-(e.column-1),r),a=s?.sliceAndInflate(e.column-1,o.length,0);return a?Zb(a,i):r}var wf=f(39619),nS=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Df=function(r,e){return function(t,i){e(t,i,r)}};class Dc{constructor(e){this.name=e}select(e,t,i){if(i.length===0)return 0;const n=i[0].score[0];for(let o=0;o<i.length;o++){const{score:s,completion:a}=i[o];if(s[0]!==n)break;if(a.preselect)return o}return 0}}class xf extends Dc{constructor(){super("first")}memorize(e,t,i){}toJSON(){}fromJSON(){}}class oS extends Dc{constructor(){super("recentlyUsed"),this._cache=new Ji.qK(300,.66),this._seq=0}memorize(e,t,i){const n=`${e.getLanguageId()}/${i.textLabel}`;this._cache.set(n,{touch:this._seq++,type:i.completion.kind,insertText:i.completion.insertText})}select(e,t,i){if(i.length===0)return 0;const n=e.getLineContent(t.lineNumber).substr(t.column-10,t.column-1);if(/\s$/.test(n))return super.select(e,t,i);const o=i[0].score[0];let s=-1,a=-1,l=-1;for(let c=0;c<i.length&&i[c].score[0]===o;c++){const d=`${e.getLanguageId()}/${i[c].textLabel}`,u=this._cache.peek(d);if(u&&u.touch>l&&u.type===i[c].completion.kind&&u.insertText===i[c].completion.insertText&&(l=u.touch,a=c),i[c].completion.preselect&&s===-1)return s=c}return a!==-1?a:s!==-1?s:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();const t=0;for(const[i,n]of e)n.touch=t,n.type=typeof n.type=="number"?n.type:_e.HC.fromString(n.type),this._cache.set(i,n);this._seq=this._cache.size}}class sS extends Dc{constructor(){super("recentlyUsedByPrefix"),this._trie=Ji.cB.forStrings(),this._seq=0}memorize(e,t,i){const{word:n}=e.getWordUntilPosition(t),o=`${e.getLanguageId()}/${n}`;this._trie.set(o,{type:i.completion.kind,insertText:i.completion.insertText,touch:this._seq++})}select(e,t,i){const{word:n}=e.getWordUntilPosition(t);if(!n)return super.select(e,t,i);const o=`${e.getLanguageId()}/${n}`;let s=this._trie.get(o);if(s||(s=this._trie.findSubstr(o)),s)for(let a=0;a<i.length;a++){const{kind:l,insertText:c}=i[a].completion;if(l===s.type&&c===s.insertText)return a}return super.select(e,t,i)}toJSON(){const e=[];return this._trie.forEach((t,i)=>e.push([i,t])),e.sort((t,i)=>-(t[1].touch-i[1].touch)).forEach((t,i)=>t[1].touch=i),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,i]of e)i.type=typeof i.type=="number"?i.type:_e.HC.fromString(i.type),this._trie.set(t,i)}}}let Fs=class vl{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new I.Cm,this._persistSoon=new V.uC(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(i=>{i.reason===Tt.LP.SHUTDOWN&&this._saveState()}))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,i){this._withStrategy(e,t).memorize(e,t,i),this._persistSoon.schedule()}select(e,t,i){return this._withStrategy(e,t).select(e,t,i)}_withStrategy(e,t){var i;const n=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if(((i=this._strategy)===null||i===void 0?void 0:i.name)!==n){this._saveState();const o=vl._strategyCtors.get(n)||xf;this._strategy=new o;try{const a=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,l=this._storageService.get(`${vl._storagePrefix}/${n}`,a);l&&this._strategy.fromJSON(JSON.parse(l))}catch{}}return this._strategy}_saveState(){if(this._strategy){const t=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,i=JSON.stringify(this._strategy);this._storageService.store(`${vl._storagePrefix}/${this._strategy.name}`,i,t,1)}}};Fs._strategyCtors=new Map([["recentlyUsedByPrefix",sS],["recentlyUsed",oS],["first",xf]]),Fs._storagePrefix="suggest/memories",Fs=nS([Df(0,Tt.CS),Df(1,Fe.pG)],Fs);const xa=(0,he.u1)("ISuggestMemories");(0,qi.v)(xa,Fs,!0);var rS=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},aS=function(r,e){return function(t,i){e(t,i,r)}};let Ps=class gm{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=gm.AtEnd.bindTo(t),this._configListener=this._editor.onDidChangeConfiguration(i=>i.hasChanged(113)&&this._update()),this._update()}dispose(){var e;this._configListener.dispose(),(e=this._selectionListener)===null||e===void 0||e.dispose(),this._ckAtEnd.reset()}_update(){const e=this._editor.getOption(113)==="on";if(this._enabled!==e)if(this._enabled=e,this._enabled){const t=()=>{if(!this._editor.hasModel()){this._ckAtEnd.set(!1);return}const i=this._editor.getModel(),n=this._editor.getSelection(),o=i.getWordAtPosition(n.getStartPosition());if(!o){this._ckAtEnd.set(!1);return}this._ckAtEnd.set(o.endColumn===n.getStartPosition().column)};this._selectionListener=this._editor.onDidChangeCursorSelection(t),t()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}};Ps.AtEnd=new A.N1("atEndOfWord",!1),Ps=rS([aS(1,A.fN)],Ps);var lS=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},dS=function(r,e){return function(t,i){e(t,i,r)}};let mn=class Cl{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=Cl.OtherSuggestions.bindTo(t)}dispose(){this.reset()}reset(){var e;this._ckOtherSuggestions.reset(),(e=this._listener)===null||e===void 0||e.dispose(),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:e,index:t},i){if(e.items.length===0){this.reset();return}if(Cl._moveIndex(!0,e,t)===t){this.reset();return}this._acceptNext=i,this._model=e,this._index=t,this._listener=this._editor.onDidChangeCursorPosition(()=>{this._ignore||this.reset()}),this._ckOtherSuggestions.set(!0)}static _moveIndex(e,t,i){let n=i;for(;n=(n+t.items.length+(e?1:-1))%t.items.length,!(n===i||!t.items[n].completion.additionalTextEdits););return n}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(this._model)try{this._ignore=!0,this._index=Cl._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}};mn.OtherSuggestions=new A.N1("hasOtherSuggestions",!1),mn=lS([dS(1,A.fN)],mn);class cS{constructor(e,t,i){this._disposables=new I.Cm,this._disposables.add(t.onDidShow(()=>this._onItem(t.getFocusedItem()))),this._disposables.add(t.onDidFocus(this._onItem,this)),this._disposables.add(t.onDidHide(this.reset,this)),this._disposables.add(e.onWillType(n=>{if(this._active&&!t.isFrozen()){const o=n.charCodeAt(n.length-1);this._active.acceptCharacters.has(o)&&e.getOption(0)&&i(this._active.item)}}))}_onItem(e){if(!e||!(0,pe.EI)(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const t=new ho.y;for(const i of e.item.completion.commitCharacters)i.length>0&&t.add(i.charCodeAt(0));this._active={acceptCharacters:t,item:e}}reset(){this._active=void 0}dispose(){this._disposables.dispose()}}var uS=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};class _t{provideSelectionRanges(e,t){return uS(this,void 0,void 0,function*(){const i=[];for(const n of t){const o=[];i.push(o);const s=new Map;yield new Promise(a=>_t._bracketsRightYield(a,0,e,n,s)),yield new Promise(a=>_t._bracketsLeftYield(a,0,e,n,s,o))}return i})}static _bracketsRightYield(e,t,i,n,o){const s=new Map,a=Date.now();for(;;){if(t>=_t._maxRounds){e();break}if(!n){e();break}const l=i.bracketPairs.findNextBracket(n);if(!l){e();break}if(Date.now()-a>_t._maxDuration){setTimeout(()=>_t._bracketsRightYield(e,t+1,i,n,o));break}if(l.bracketInfo.isOpeningBracket){const d=l.bracketInfo.bracketText,u=s.has(d)?s.get(d):0;s.set(d,u+1)}else{const d=l.bracketInfo.getClosedBrackets()[0].bracketText;let u=s.has(d)?s.get(d):0;if(u-=1,s.set(d,Math.max(0,u)),u<0){let h=o.get(d);h||(h=new bg.w,o.set(d,h)),h.push(l.range)}}n=l.range.getEndPosition()}}static _bracketsLeftYield(e,t,i,n,o,s){const a=new Map,l=Date.now();for(;;){if(t>=_t._maxRounds&&o.size===0){e();break}if(!n){e();break}const c=i.bracketPairs.findPrevBracket(n);if(!c){e();break}if(Date.now()-l>_t._maxDuration){setTimeout(()=>_t._bracketsLeftYield(e,t+1,i,n,o,s));break}if(c.bracketInfo.isOpeningBracket){const u=c.bracketInfo.bracketText;let h=a.has(u)?a.get(u):0;if(h-=1,a.set(u,Math.max(0,h)),h<0){const p=o.get(u);if(p){const m=p.shift();p.size===0&&o.delete(u);const v=L.Q.fromPositions(c.range.getEndPosition(),m.getStartPosition()),w=L.Q.fromPositions(c.range.getStartPosition(),m.getEndPosition());s.push({range:v}),s.push({range:w}),_t._addBracketLeading(i,w,s)}}}else{const u=c.bracketInfo.getClosedBrackets()[0].bracketText,h=a.has(u)?a.get(u):0;a.set(u,h+1)}n=c.range.getStartPosition()}}static _addBracketLeading(e,t,i){if(t.startLineNumber===t.endLineNumber)return;const n=t.startLineNumber,o=e.getLineFirstNonWhitespaceColumn(n);o!==0&&o!==t.startColumn&&(i.push({range:L.Q.fromPositions(new ee.y(n,o),t.getEndPosition())}),i.push({range:L.Q.fromPositions(new ee.y(n,1),t.getEndPosition())}));const s=n-1;if(s>0){const a=e.getLineFirstNonWhitespaceColumn(s);a===t.startColumn&&a!==e.getLineLastNonWhitespaceColumn(s)&&(i.push({range:L.Q.fromPositions(new ee.y(s,a),t.getEndPosition())}),i.push({range:L.Q.fromPositions(new ee.y(s,1),t.getEndPosition())}))}}}_t._maxDuration=30,_t._maxRounds=2;var hS=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};class zt{static create(e,t){return hS(this,void 0,void 0,function*(){if(!t.getOption(108).localityBonus||!t.hasModel())return zt.None;const i=t.getModel(),n=t.getPosition();if(!e.canComputeWordRanges(i.uri))return zt.None;const[o]=yield new _t().provideSelectionRanges(i,[n]);if(o.length===0)return zt.None;const s=yield e.computeWordRanges(i.uri,o[0].range);if(!s)return zt.None;const a=i.getWordUntilPosition(n);return delete s[a.word],new class extends zt{distance(l,c){if(!n.equals(t.getPosition()))return 0;if(c.kind===17)return 2<<20;const d=typeof c.label=="string"?c.label:c.label.label,u=s[d];if((0,pe.Ct)(u))return 2<<20;const h=(0,pe.El)(u,L.Q.fromPositions(l),L.Q.compareRangesUsingStarts),p=h>=0?u[h]:u[Math.max(0,~h-1)];let m=o.length;for(const v of o){if(!L.Q.containsRange(v.range,p))break;m-=1}return m}}})}}zt.None=new class extends zt{distance(){return 0}};class Lf{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}}class Wi{constructor(e,t,i,n,o,s,a=je.Nd.default,l=void 0){this.clipboardText=l,this._snippetCompareFn=Wi._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=n,this._options=o,this._refilterKind=1,this._lineContext=i,this._fuzzyScoreOptions=a,s==="top"?this._snippetCompareFn=Wi._compareCompletionItemsSnippetsUp:s==="bottom"&&(this._snippetCompareFn=Wi._compareCompletionItemsSnippetsDown)}get lineContext(){return this._lineContext}set lineContext(e){(this._lineContext.leadingLineContent!==e.leadingLineContent||this._lineContext.characterCountDelta!==e.characterCountDelta)&&(this._refilterKind=this._lineContext.characterCountDelta<e.characterCountDelta&&this._filteredItems?2:1,this._lineContext=e)}get items(){return this._ensureCachedState(),this._filteredItems}get allProvider(){return this._ensureCachedState(),this._providerInfo.keys()}get incomplete(){this._ensureCachedState();const e=new Set;for(const[t,i]of this._providerInfo)i&&e.add(t);return e}adopt(e){const t=[];for(let i=0;i<this._items.length;)e.has(this._items[i].provider)?i++:(t.push(this._items[i]),this._items[i]=this._items[this._items.length-1],this._items.pop());return this._refilterKind=1,t}get stats(){return this._ensureCachedState(),this._stats}_ensureCachedState(){this._refilterKind!==0&&this._createCachedState()}_createCachedState(){this._providerInfo=new Map;const e=[],{leadingLineContent:t,characterCountDelta:i}=this._lineContext;let n="",o="";const s=this._refilterKind===1?this._items:this._filteredItems,a=[],l=!this._options.filterGraceful||s.length>2e3?je.dt:je.uU;for(let c=0;c<s.length;c++){const d=s[c];if(d.isInvalid)continue;this._providerInfo.set(d.provider,!!d.container.incomplete);const u=d.position.column-d.editStart.column,h=u+i-(d.position.column-this._column);if(n.length!==h&&(n=h===0?"":t.slice(-h),o=n.toLowerCase()),d.word=n,h===0)d.score=je.ne.Default;else{let p=0;for(;p<u;){const m=n.charCodeAt(p);if(m===32||m===9)p+=1;else break}if(p>=h)d.score=je.ne.Default;else if(typeof d.completion.filterText=="string"){const m=l(n,o,p,d.completion.filterText,d.filterTextLow,0,this._fuzzyScoreOptions);if(!m)continue;(0,G.W1)(d.completion.filterText,d.textLabel)===0?d.score=m:(d.score=(0,je.Jo)(n,o,p,d.textLabel,d.labelLow,0),d.score[0]=m[0])}else{const m=l(n,o,p,d.textLabel,d.labelLow,0,this._fuzzyScoreOptions);if(!m)continue;d.score=m}}d.idx=c,d.distance=this._wordDistance.distance(d.position,d.completion),a.push(d),e.push(d.textLabel.length)}this._filteredItems=a.sort(this._snippetCompareFn),this._refilterKind=0,this._stats={pLabelLen:e.length?(0,pe.SO)(e.length-.85,e,(c,d)=>c-d):0}}static _compareCompletionItems(e,t){return e.score[0]>t.score[0]?-1:e.score[0]<t.score[0]?1:e.distance<t.distance?-1:e.distance>t.distance?1:e.idx<t.idx?-1:e.idx>t.idx?1:0}static _compareCompletionItemsSnippetsDown(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===27)return 1;if(t.completion.kind===27)return-1}return Wi._compareCompletionItems(e,t)}static _compareCompletionItemsSnippetsUp(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===27)return-1;if(t.completion.kind===27)return 1}return Wi._compareCompletionItems(e,t)}}var gS=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},_n=function(r,e){return function(t,i){e(t,i,r)}},fS=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};class fo{constructor(e,t,i,n,o){this.leadingLineContent=e.getLineContent(t.lineNumber).substr(0,t.column-1),this.leadingWord=e.getWordUntilPosition(t),this.lineNumber=t.lineNumber,this.column=t.column,this.auto=i,this.shy=n,this.noSelect=o}static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),i=e.getPosition();t.tokenization.tokenizeIfCheap(i.lineNumber);const n=t.getWordAtPosition(i);return!(!n||n.endColumn!==i.column||!isNaN(Number(n.word)))}}function EL(r){return r.getOption(108).preview}function pS(r,e,t){if(!e.getContextKeyValue("inlineSuggestionVisible"))return!0;const i=t.getValue("editor.inlineSuggest.allowQuickSuggestions");return i!==void 0?!!i:!1}function mS(r,e,t){if(!e.getContextKeyValue("inlineSuggestionVisible"))return!0;const i=t.getValue("editor.inlineSuggest.allowSuggestOnTriggerCharacters");return i!==void 0?!!i:!1}let xc=class fm{constructor(e,t,i,n,o,s,a,l){this._editor=e,this._editorWorkerService=t,this._clipboardService=i,this._telemetryService=n,this._logService=o,this._contextKeyService=s,this._configurationService=a,this._languageFeaturesService=l,this._toDispose=new I.Cm,this._triggerCharacterListener=new I.Cm,this._triggerQuickSuggest=new V.pc,this._state=0,this._completionDisposables=new I.Cm,this._onDidCancel=new Z.vl,this._onDidTrigger=new Z.vl,this._onDidSuggest=new Z.vl,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._telemetryGate=0,this._currentSelection=this._editor.getSelection()||new q.L(1,1,1,1),this._toDispose.add(this._editor.onDidChangeModel(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeModelLanguage(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeConfiguration(()=>{this._updateTriggerCharacters()})),this._toDispose.add(this._languageFeaturesService.completionProvider.onDidChange(()=>{this._updateTriggerCharacters(),this._updateActiveSuggestSession()}));let c=!1;this._toDispose.add(this._editor.onDidCompositionStart(()=>{c=!0})),this._toDispose.add(this._editor.onDidCompositionEnd(()=>{c=!1,this._onCompositionEnd()})),this._toDispose.add(this._editor.onDidChangeCursorSelection(d=>{c||this._onCursorChange(d)})),this._toDispose.add(this._editor.onDidChangeModelContent(()=>{c||this._refilterCompletionItems()})),this._updateTriggerCharacters()}dispose(){(0,I.AS)(this._triggerCharacterListener),(0,I.AS)([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(83)||!this._editor.hasModel()||!this._editor.getOption(111))return;const e=new Map;for(const i of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const n of i.triggerCharacters||[]){let o=e.get(n);o||(o=new Set,o.add(Xv()),e.set(n,o)),o.add(i)}const t=i=>{if(!mS(this._editor,this._contextKeyService,this._configurationService)||fo.shouldAutoTrigger(this._editor))return;if(!i){const s=this._editor.getPosition();i=this._editor.getModel().getLineContent(s.lineNumber).substr(0,s.column-1)}let n="";(0,G.LJ)(i.charCodeAt(i.length-1))?(0,G.pc)(i.charCodeAt(i.length-2))&&(n=i.substr(i.length-2)):n=i.charAt(i.length-1);const o=e.get(n);if(o){const s=this._completionModel?{items:this._completionModel.adopt(o),clipboardText:this._completionModel.clipboardText}:void 0;this.trigger({auto:!0,shy:!1,noSelect:!1,triggerCharacter:n},!!this._completionModel,o,s)}};this._triggerCharacterListener.add(this._editor.onDidType(t)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(()=>t()))}get state(){return this._state}cancel(e=!1){var t;this._state!==0&&(this._triggerQuickSuggest.cancel(),(t=this._requestToken)===null||t===void 0||t.cancel(),this._requestToken=void 0,this._state=0,this._completionModel=void 0,this._context=void 0,this._onDidCancel.fire({retrigger:e}))}clear(){this._completionDisposables.clear()}_updateActiveSuggestSession(){this._state!==0&&(!this._editor.hasModel()||!this._languageFeaturesService.completionProvider.has(this._editor.getModel())?this.cancel():this.trigger({auto:this._state===2,shy:!1,noSelect:!1},!0))}_onCursorChange(e){if(!this._editor.hasModel())return;const t=this._currentSelection;if(this._currentSelection=this._editor.getSelection(),!e.selection.isEmpty()||e.reason!==0&&e.reason!==3||e.source!=="keyboard"&&e.source!=="deleteLeft"){this.cancel();return}this._state===0&&e.reason===0?(t.containsRange(this._currentSelection)||t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():this._state!==0&&e.reason===3&&this._refilterCompletionItems()}_onCompositionEnd(){this._state===0?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){var e;qn.isAllOff(this._editor.getOption(81))||this._editor.getOption(108).snippetsPreventQuickSuggestions&&(!((e=Me.get(this._editor))===null||e===void 0)&&e.isInSnippet())||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._state!==0||!fo.shouldAutoTrigger(this._editor)||!this._editor.hasModel()||!this._editor.hasWidgetFocus())return;const t=this._editor.getModel(),i=this._editor.getPosition(),n=this._editor.getOption(81);if(!qn.isAllOff(n)){if(!qn.isAllOn(n)){t.tokenization.tokenizeIfCheap(i.lineNumber);const o=t.tokenization.getLineTokens(i.lineNumber),s=o.getStandardTokenType(o.findTokenIndexAtOffset(Math.max(i.column-1-1,0)));if(qn.valueFor(n,s)!=="on")return}pS(this._editor,this._contextKeyService,this._configurationService)&&this._languageFeaturesService.completionProvider.has(t)&&this.trigger({auto:!0,shy:!1,noSelect:!1})}},this._editor.getOption(82)))}_refilterCompletionItems(){Promise.resolve().then(()=>{if(this._state===0||!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getPosition(),i=new fo(e,t,this._state===2,!1,!1);this._onNewContext(i)})}trigger(e,t=!1,i,n,o){var s;if(!this._editor.hasModel())return;const a=this._editor.getModel(),l=e.auto,c=new fo(a,this._editor.getPosition(),l,e.shy,e.noSelect);this.cancel(t),this._state=l?2:1,this._onDidTrigger.fire({auto:l,shy:e.shy,position:this._editor.getPosition()}),this._context=c;let d={triggerKind:(s=e.triggerKind)!==null&&s!==void 0?s:0};e.triggerCharacter&&(d={triggerKind:1,triggerCharacter:e.triggerCharacter}),this._requestToken=new re.Q;const u=this._editor.getOption(103);let h=1;switch(u){case"top":h=0;break;case"bottom":h=2;break}const{itemKind:p,showDeprecated:m}=fm._createSuggestFilter(this._editor),v=new Cs(h,o?new Set:p,i,m),w=zt.create(this._editorWorkerService,this._editor),R=Wd(this._languageFeaturesService.completionProvider,a,this._editor.getPosition(),v,d,this._requestToken.token);Promise.all([R,w]).then(([T,F])=>fS(this,void 0,void 0,function*(){var B;if((B=this._requestToken)===null||B===void 0||B.dispose(),!this._editor.hasModel())return;let j=n?.clipboardText;if(!j&&T.needsClipboard&&(j=yield this._clipboardService.readText()),this._state===0)return;const ve=this._editor.getModel();let ie=T.items;if(n){const et=lg(h);ie=ie.concat(n.items).sort(et)}const Ue=new fo(ve,this._editor.getPosition(),l,e.shy,e.noSelect);this._completionModel=new Wi(ie,this._context.column,{leadingLineContent:Ue.leadingLineContent,characterCountDelta:Ue.column-this._context.column},F,this._editor.getOption(108),this._editor.getOption(103),void 0,j),this._completionDisposables.add(T.disposable),this._onNewContext(Ue),this._reportDurationsTelemetry(T.durations)})).catch(K.dz)}_reportDurationsTelemetry(e){this._telemetryGate++%230===0&&setTimeout(()=>{this._telemetryService.publicLog2("suggest.durations.json",{data:JSON.stringify(e)}),this._logService.debug("suggest.durations.json",e)})}static _createSuggestFilter(e){const t=new Set;e.getOption(103)==="none"&&t.add(27);const n=e.getOption(108);return n.showMethods||t.add(0),n.showFunctions||t.add(1),n.showConstructors||t.add(2),n.showFields||t.add(3),n.showVariables||t.add(4),n.showClasses||t.add(5),n.showStructs||t.add(6),n.showInterfaces||t.add(7),n.showModules||t.add(8),n.showProperties||t.add(9),n.showEvents||t.add(10),n.showOperators||t.add(11),n.showUnits||t.add(12),n.showValues||t.add(13),n.showConstants||t.add(14),n.showEnums||t.add(15),n.showEnumMembers||t.add(16),n.showKeywords||t.add(17),n.showWords||t.add(18),n.showColors||t.add(19),n.showFiles||t.add(20),n.showReferences||t.add(21),n.showColors||t.add(22),n.showFolders||t.add(23),n.showTypeParameters||t.add(24),n.showSnippets||t.add(27),n.showUsers||t.add(25),n.showIssues||t.add(26),{itemKind:t,showDeprecated:n.showDeprecated}}_onNewContext(e){if(this._context){if(e.lineNumber!==this._context.lineNumber){this.cancel();return}if((0,G.UU)(e.leadingLineContent)!==(0,G.UU)(this._context.leadingLineContent)){this.cancel();return}if(e.column<this._context.column){e.leadingWord.word?this.trigger({auto:this._context.auto,shy:!1,noSelect:!1},!0):this.cancel();return}if(this._completionModel){if(e.leadingWord.word.length!==0&&e.leadingWord.startColumn>this._context.leadingWord.startColumn){const t=new Set(this._languageFeaturesService.completionProvider.all(this._editor.getModel()));for(const n of this._completionModel.allProvider)t.delete(n);const i=this._completionModel.adopt(new Set);this.trigger({auto:this._context.auto,shy:!1,noSelect:!1},!0,t,{items:i,clipboardText:this._completionModel.clipboardText});return}if(e.column>this._context.column&&this._completionModel.incomplete.size>0&&e.leadingWord.word.length!==0){const{incomplete:t}=this._completionModel,i=this._completionModel.adopt(t);this.trigger({auto:this._state===2,shy:!1,noSelect:!1,triggerKind:2},!0,t,{items:i,clipboardText:this._completionModel.clipboardText})}else{const t=this._completionModel.lineContext;let i=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},this._completionModel.items.length===0){if(fo.shouldAutoTrigger(this._editor)&&this._context.leadingWord.endColumn<e.leadingWord.startColumn){this.trigger({auto:this._context.auto,shy:!1,noSelect:!1},!0);return}if(this._context.auto){this.cancel();return}else if(this._completionModel.lineContext=t,i=this._completionModel.items.length>0,i&&e.leadingWord.word.length===0){this.cancel();return}}this._onDidSuggest.fire({completionModel:this._completionModel,auto:this._context.auto,shy:this._context.shy,noSelect:this._context.noSelect,isFrozen:i})}}}}};xc=gS([_n(1,Es.w),_n(2,Hn.h),_n(3,Vn.k),_n(4,ia.rr),_n(5,A.fN),_n(6,Fe.pG),_n(7,te.u)],xc);class La{constructor(e,t){this._disposables=new I.Cm,this._lastOvertyped=[],this._empty=!0,this._disposables.add(e.onWillType(()=>{if(!this._empty||!e.hasModel())return;const i=e.getSelections(),n=i.length;let o=!1;for(let a=0;a<n;a++)if(!i[a].isEmpty()){o=!0;break}if(!o)return;this._lastOvertyped=[];const s=e.getModel();for(let a=0;a<n;a++){const l=i[a];if(s.getValueLengthInRange(l)>La._maxSelectionLength)return;this._lastOvertyped[a]={value:s.getValueInRange(l),multiline:l.startLineNumber!==l.endLineNumber}}this._empty=!1})),this._disposables.add(t.onDidCancel(i=>{!this._empty&&!i.retrigger&&(this._empty=!0)}))}getLastOvertypedInfo(e){if(!this._empty&&e>=0&&e<this._lastOvertyped.length)return this._lastOvertyped[e]}dispose(){this._disposables.dispose()}}La._maxSelectionLength=51200;var AL=f(96852),_S=f(62992),vS=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Lc=function(r,e){return function(t,i){e(t,i,r)}};class kc extends Zn{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();this.label&&(this.label.textContent=(0,g.kg)("ddd","{0} ({1})",this._action.label,kc.symbolPrintEnter(e)))}static symbolPrintEnter(e){var t;return(t=e.getLabel())===null||t===void 0?void 0:t.replace(/\benter\b/gi,"\u23CE")}}let Ic=class{constructor(e,t,i,n){this._menuService=i,this._contextKeyService=n,this._menuDisposables=new I.Cm,this.element=S.BC(e,S.$(".suggest-status-bar"));const o=s=>s instanceof z.Xe?t.createInstance(kc,s,void 0):void 0;this._leftActions=new Nr.E(this.element,{actionViewItemProvider:o}),this._rightActions=new Nr.E(this.element,{actionViewItemProvider:o}),this._leftActions.domNode.classList.add("left"),this._rightActions.domNode.classList.add("right")}dispose(){this._menuDisposables.dispose(),this.element.remove()}show(){const e=this._menuService.createMenu(Ei,this._contextKeyService),t=()=>{const i=[],n=[];for(const[o,s]of e.getActions())o==="left"?i.push(...s):n.push(...s);this._leftActions.clear(),this._leftActions.push(i),this._rightActions.clear(),this._rightActions.push(n)};this._menuDisposables.add(e.onDidChange(()=>t())),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};Ic=vS([Lc(1,he._Y),Lc(2,z.ez),Lc(3,A.fN)],Ic);const CS=(0,C.x1A)("symbolIcon.arrayForeground",{dark:C.CU6,light:C.CU6,hcDark:C.CU6,hcLight:C.CU6},(0,g.kg)("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),bS=(0,C.x1A)("symbolIcon.booleanForeground",{dark:C.CU6,light:C.CU6,hcDark:C.CU6,hcLight:C.CU6},(0,g.kg)("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SS=(0,C.x1A)("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},(0,g.kg)("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),yS=(0,C.x1A)("symbolIcon.colorForeground",{dark:C.CU6,light:C.CU6,hcDark:C.CU6,hcLight:C.CU6},(0,g.kg)("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),wS=(0,C.x1A)("symbolIcon.constantForeground",{dark:C.CU6,light:C.CU6,hcDark:C.CU6,hcLight:C.CU6},(0,g.kg)("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),DS=(0,C.x1A)("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},(0,g.kg)("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),xS=(0,C.x1A)("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},(0,g.kg)("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),LS=(0,C.x1A)("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},(0,g.kg)("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),kS=(0,C.x1A)("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},(0,g.kg)("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),IS=(0,C.x1A)("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},(0,g.kg)("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),RS=(0,C.x1A)("symbolIcon.fileForeground",{dark:C.CU6,light:C.CU6,hcDark:C.CU6,hcLight:C.CU6},(0,g.kg)("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),ES=(0,C.x1A)("symbolIcon.folderForeground",{dark:C.CU6,light:C.CU6,hcDark:C.CU6,hcLight:C.CU6},(0,g.kg)("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),AS=(0,C.x1A)("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},(0,g.kg)("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),NS=(0,C.x1A)("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},(0,g.kg)("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),MS=(0,C.x1A)("symbolIcon.keyForeground",{dark:C.CU6,light:C.CU6,hcDark:C.CU6,hcLight:C.CU6},(0,g.kg)("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),TS=(0,C.x1A)("symbolIcon.keywordForeground",{dark:C.CU6,light:C.CU6,hcDark:C.CU6,hcLight:C.CU6},(0,g.kg)("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),OS=(0,C.x1A)("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},(0,g.kg)("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),FS=(0,C.x1A)("symbolIcon.moduleForeground",{dark:C.CU6,light:C.CU6,hcDark:C.CU6,hcLight:C.CU6},(0,g.kg)("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),PS=(0,C.x1A)("symbolIcon.namespaceForeground",{dark:C.CU6,light:C.CU6,hcDark:C.CU6,hcLight:C.CU6},(0,g.kg)("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),WS=(0,C.x1A)("symbolIcon.nullForeground",{dark:C.CU6,light:C.CU6,hcDark:C.CU6,hcLight:C.CU6},(0,g.kg)("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),BS=(0,C.x1A)("symbolIcon.numberForeground",{dark:C.CU6,light:C.CU6,hcDark:C.CU6,hcLight:C.CU6},(0,g.kg)("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),HS=(0,C.x1A)("symbolIcon.objectForeground",{dark:C.CU6,light:C.CU6,hcDark:C.CU6,hcLight:C.CU6},(0,g.kg)("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),VS=(0,C.x1A)("symbolIcon.operatorForeground",{dark:C.CU6,light:C.CU6,hcDark:C.CU6,hcLight:C.CU6},(0,g.kg)("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),US=(0,C.x1A)("symbolIcon.packageForeground",{dark:C.CU6,light:C.CU6,hcDark:C.CU6,hcLight:C.CU6},(0,g.kg)("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),zS=(0,C.x1A)("symbolIcon.propertyForeground",{dark:C.CU6,light:C.CU6,hcDark:C.CU6,hcLight:C.CU6},(0,g.kg)("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),$S=(0,C.x1A)("symbolIcon.referenceForeground",{dark:C.CU6,light:C.CU6,hcDark:C.CU6,hcLight:C.CU6},(0,g.kg)("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),jS=(0,C.x1A)("symbolIcon.snippetForeground",{dark:C.CU6,light:C.CU6,hcDark:C.CU6,hcLight:C.CU6},(0,g.kg)("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),GS=(0,C.x1A)("symbolIcon.stringForeground",{dark:C.CU6,light:C.CU6,hcDark:C.CU6,hcLight:C.CU6},(0,g.kg)("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),KS=(0,C.x1A)("symbolIcon.structForeground",{dark:C.CU6,light:C.CU6,hcDark:C.CU6,hcLight:C.CU6},(0,g.kg)("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),QS=(0,C.x1A)("symbolIcon.textForeground",{dark:C.CU6,light:C.CU6,hcDark:C.CU6,hcLight:C.CU6},(0,g.kg)("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),ZS=(0,C.x1A)("symbolIcon.typeParameterForeground",{dark:C.CU6,light:C.CU6,hcDark:C.CU6,hcLight:C.CU6},(0,g.kg)("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),YS=(0,C.x1A)("symbolIcon.unitForeground",{dark:C.CU6,light:C.CU6,hcDark:C.CU6,hcLight:C.CU6},(0,g.kg)("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),XS=(0,C.x1A)("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},(0,g.kg)("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));(0,U.zy)((r,e)=>{const t=r.getColor(CS);t&&e.addRule(`${Q.W6.symbolArray.cssSelector} { color: ${t}; }`);const i=r.getColor(bS);i&&e.addRule(`${Q.W6.symbolBoolean.cssSelector} { color: ${i}; }`);const n=r.getColor(SS);n&&e.addRule(`${Q.W6.symbolClass.cssSelector} { color: ${n}; }`);const o=r.getColor(OS);o&&e.addRule(`${Q.W6.symbolMethod.cssSelector} { color: ${o}; }`);const s=r.getColor(yS);s&&e.addRule(`${Q.W6.symbolColor.cssSelector} { color: ${s}; }`);const a=r.getColor(wS);a&&e.addRule(`${Q.W6.symbolConstant.cssSelector} { color: ${a}; }`);const l=r.getColor(DS);l&&e.addRule(`${Q.W6.symbolConstructor.cssSelector} { color: ${l}; }`);const c=r.getColor(xS);c&&e.addRule(`
			${Q.W6.symbolValue.cssSelector},${Q.W6.symbolEnum.cssSelector} { color: ${c}; }`);const d=r.getColor(LS);d&&e.addRule(`${Q.W6.symbolEnumMember.cssSelector} { color: ${d}; }`);const u=r.getColor(kS);u&&e.addRule(`${Q.W6.symbolEvent.cssSelector} { color: ${u}; }`);const h=r.getColor(IS);h&&e.addRule(`${Q.W6.symbolField.cssSelector} { color: ${h}; }`);const p=r.getColor(RS);p&&e.addRule(`${Q.W6.symbolFile.cssSelector} { color: ${p}; }`);const m=r.getColor(ES);m&&e.addRule(`${Q.W6.symbolFolder.cssSelector} { color: ${m}; }`);const v=r.getColor(AS);v&&e.addRule(`${Q.W6.symbolFunction.cssSelector} { color: ${v}; }`);const w=r.getColor(NS);w&&e.addRule(`${Q.W6.symbolInterface.cssSelector} { color: ${w}; }`);const R=r.getColor(MS);R&&e.addRule(`${Q.W6.symbolKey.cssSelector} { color: ${R}; }`);const T=r.getColor(TS);T&&e.addRule(`${Q.W6.symbolKeyword.cssSelector} { color: ${T}; }`);const F=r.getColor(FS);F&&e.addRule(`${Q.W6.symbolModule.cssSelector} { color: ${F}; }`);const B=r.getColor(PS);B&&e.addRule(`${Q.W6.symbolNamespace.cssSelector} { color: ${B}; }`);const j=r.getColor(WS);j&&e.addRule(`${Q.W6.symbolNull.cssSelector} { color: ${j}; }`);const ve=r.getColor(BS);ve&&e.addRule(`${Q.W6.symbolNumber.cssSelector} { color: ${ve}; }`);const ie=r.getColor(HS);ie&&e.addRule(`${Q.W6.symbolObject.cssSelector} { color: ${ie}; }`);const Ue=r.getColor(VS);Ue&&e.addRule(`${Q.W6.symbolOperator.cssSelector} { color: ${Ue}; }`);const et=r.getColor(US);et&&e.addRule(`${Q.W6.symbolPackage.cssSelector} { color: ${et}; }`);const rt=r.getColor(zS);rt&&e.addRule(`${Q.W6.symbolProperty.cssSelector} { color: ${rt}; }`);const qt=r.getColor($S);qt&&e.addRule(`${Q.W6.symbolReference.cssSelector} { color: ${qt}; }`);const Mn=r.getColor(jS);Mn&&e.addRule(`${Q.W6.symbolSnippet.cssSelector} { color: ${Mn}; }`);const Ct=r.getColor(GS);Ct&&e.addRule(`${Q.W6.symbolString.cssSelector} { color: ${Ct}; }`);const dr=r.getColor(KS);dr&&e.addRule(`${Q.W6.symbolStruct.cssSelector} { color: ${dr}; }`);const Tn=r.getColor(QS);Tn&&e.addRule(`${Q.W6.symbolText.cssSelector} { color: ${Tn}; }`);const ul=r.getColor(ZS);ul&&e.addRule(`${Q.W6.symbolTypeParameter.cssSelector} { color: ${ul}; }`);const cr=r.getColor(YS);cr&&e.addRule(`${Q.W6.symbolUnit.cssSelector} { color: ${cr}; }`);const ur=r.getColor(XS);ur&&e.addRule(`${Q.W6.symbolVariable.cssSelector} { color: ${ur}; }`)});class kf{constructor(){this._onDidWillResize=new Z.vl,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new Z.vl,this.onDidResize=this._onDidResize.event,this._sashListener=new I.Cm,this._size=new S.fg(0,0),this._minSize=new S.fg(0,0),this._maxSize=new S.fg(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new Li.m(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new Li.m(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new Li.m(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:Li.B.North}),this._southSash=new Li.m(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:Li.B.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(Z.Jh.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(Z.Jh.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(Z.Jh.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(Z.Jh.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:o,width:s}=this._maxSize;e=Math.max(i,Math.min(o,e)),t=Math.max(n,Math.min(s,t));const a=new S.fg(t,e);S.fg.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}}var JS=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},qS=function(r,e){return function(t,i){e(t,i,r)}};function Rc(r){return!!r&&!!(r.completion.documentation||r.completion.detail&&r.completion.detail!==r.completion.label)}let Ec=class{constructor(e,t){this._editor=e,this._onDidClose=new Z.vl,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new Z.vl,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new I.Cm,this._renderDisposeable=new I.Cm,this._borderWidth=1,this._size=new S.fg(330,0),this.domNode=S.$(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(li,{editor:e}),this._body=S.$(".body"),this._scrollbar=new Hr.MU(this._body,{alwaysConsumeMouseWheel:!0}),S.BC(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=S.BC(this._body,S.$(".header")),this._close=S.BC(this._header,S.$("span"+Q.W6.close.cssSelector)),this._close.title=g.kg("details.close","Close"),this._type=S.BC(this._header,S.$("p.type")),this._docs=S.BC(this._body,S.$("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(46)&&this._configureFont()}))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(46),i=t.getMassagedFontFamily(),n=e.get(109)||t.fontSize,o=e.get(110)||t.lineHeight,s=t.fontWeight,a=`${n}px`,l=`${o}px`;this.domNode.style.fontSize=a,this.domNode.style.lineHeight=`${o/n}`,this.domNode.style.fontWeight=s,this.domNode.style.fontFeatureSettings=t.fontFeatureSettings,this._type.style.fontFamily=i,this._close.style.height=l,this._close.style.width=l}getLayoutInfo(){const e=this._editor.getOption(110)||this._editor.getOption(46).lineHeight,t=this._borderWidth,i=t*2;return{lineHeight:e,borderWidth:t,borderHeight:i,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=g.kg("loading","Loading..."),this._docs.textContent="",this.domNode.classList.remove("no-docs","no-type"),this.layout(this.size.width,this.getLayoutInfo().lineHeight*2),this._onDidChangeContents.fire(this)}renderItem(e,t){var i,n;this._renderDisposeable.clear();let{detail:o,documentation:s}=e.completion;if(t){let a="";a+=`score: ${e.score[0]}
`,a+=`prefix: ${(i=e.word)!==null&&i!==void 0?i:"(no prefix)"}
`,a+=`word: ${e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel}
`,a+=`distance: ${e.distance} (localityBonus-setting)
`,a+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"}
`,a+=`commit_chars: ${(n=e.completion.commitCharacters)===null||n===void 0?void 0:n.join("")}
`,s=new xe.Bc().appendCodeblock("empty",a),o=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!Rc(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),o){const a=o.length>1e5?`${o.substr(0,1e5)}\u2026`:o;this._type.textContent=a,this._type.title=a,S.WU(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(a))}else S.w_(this._type),this._type.title="",S.jD(this._type),this.domNode.classList.add("no-type");if(S.w_(this._docs),typeof s=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=s;else if(s){this._docs.classList.add("markdown-docs"),S.w_(this._docs);const a=this._markdownRenderer.render(s);this._docs.appendChild(a.element),this._renderDisposeable.add(a),this._renderDisposeable.add(this._markdownRenderer.onDidRenderAsync(()=>{this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}))}this.domNode.style.userSelect="text",this.domNode.tabIndex=-1,this._close.onmousedown=a=>{a.preventDefault(),a.stopPropagation()},this._close.onclick=a=>{a.preventDefault(),a.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get size(){return this._size}layout(e,t){const i=new S.fg(e,t);S.fg.equals(i,this._size)||(this._size=i,S.Ej(this.domNode,e,t)),this._scrollbar.scanDomNode()}scrollDown(e=8){this._body.scrollTop+=e}scrollUp(e=8){this._body.scrollTop-=e}scrollTop(){this._body.scrollTop=0}scrollBottom(){this._body.scrollTop=this._body.scrollHeight}pageDown(){this.scrollDown(80)}pageUp(){this.scrollUp(80)}set borderWidth(e){this._borderWidth=e}get borderWidth(){return this._borderWidth}};Ec=JS([qS(1,he._Y)],Ec);class ey{constructor(e,t){this.widget=e,this._editor=t,this._disposables=new I.Cm,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new kf,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let i,n,o=0,s=0;this._disposables.add(this._resizable.onDidWillResize(()=>{i=this._topLeft,n=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(a=>{if(i&&n){this.widget.layout(a.dimension.width,a.dimension.height);let l=!1;a.west&&(s=n.width-a.dimension.width,l=!0),a.north&&(o=n.height-a.dimension.height,l=!0),l&&this._applyTopLeft({top:i.top+o,left:i.left+s})}a.done&&(i=void 0,n=void 0,o=0,s=0,this._userSize=a.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{var a;this._anchorBox&&this._placeAtAnchor(this._anchorBox,(a=this._userSize)!==null&&a!==void 0?a:this.widget.size,this._preferAlignAtTop)}))}dispose(){this._resizable.dispose(),this._disposables.dispose(),this.hide()}getId(){return"suggest.details"}getDomNode(){return this._resizable.domNode}getPosition(){return null}show(){this._added||(this._editor.addOverlayWidget(this),this.getDomNode().style.position="fixed",this._added=!0)}hide(e=!1){this._resizable.clearSashHoverState(),this._added&&(this._editor.removeOverlayWidget(this),this._added=!1,this._anchorBox=void 0,this._topLeft=void 0),e&&(this._userSize=void 0,this.widget.clearContents())}placeAtAnchor(e,t){var i;const n=e.getBoundingClientRect();this._anchorBox=n,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,(i=this._userSize)!==null&&i!==void 0?i:this.widget.size,t)}_placeAtAnchor(e,t,i){var n;const o=S.tG(document.body),s=this.widget.getLayoutInfo(),a=new S.fg(220,2*s.lineHeight),l=e.top,c=function(){const F=o.width-(e.left+e.width+s.borderWidth+s.horizontalPadding),B=-s.borderWidth+e.left+e.width,j=new S.fg(F,o.height-e.top-s.borderHeight-s.verticalPadding),ve=j.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:l,left:B,fit:F-t.width,maxSizeTop:j,maxSizeBottom:ve,minSize:a.with(Math.min(F,a.width))}}(),d=function(){const F=e.left-s.borderWidth-s.horizontalPadding,B=Math.max(s.horizontalPadding,e.left-t.width-s.borderWidth),j=new S.fg(F,o.height-e.top-s.borderHeight-s.verticalPadding),ve=j.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:l,left:B,fit:F-t.width,maxSizeTop:j,maxSizeBottom:ve,minSize:a.with(Math.min(F,a.width))}}(),u=function(){const F=e.left,B=-s.borderWidth+e.top+e.height,j=new S.fg(e.width-s.borderHeight,o.height-e.top-e.height-s.verticalPadding);return{top:B,left:F,fit:j.height-t.height,maxSizeBottom:j,maxSizeTop:j,minSize:a.with(j.width)}}(),h=[c,d,u],p=(n=h.find(F=>F.fit>=0))!==null&&n!==void 0?n:h.sort((F,B)=>B.fit-F.fit)[0],m=e.top+e.height-s.borderHeight;let v,w=t.height;const R=Math.max(p.maxSizeTop.height,p.maxSizeBottom.height);w>R&&(w=R);let T;i?w<=p.maxSizeTop.height?(v=!0,T=p.maxSizeTop):(v=!1,T=p.maxSizeBottom):w<=p.maxSizeBottom.height?(v=!1,T=p.maxSizeBottom):(v=!0,T=p.maxSizeTop),this._applyTopLeft({left:p.left,top:v?p.top:m-w}),this.getDomNode().style.position="fixed",this._resizable.enableSashes(!v,p===c,v,p!==c),this._resizable.minSize=p.minSize,this._resizable.maxSize=T,this._resizable.layout(w,Math.min(T.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this.getDomNode().style.left=`${this._topLeft.left}px`,this.getDomNode().style.top=`${this._topLeft.top}px`}}var pi;(function(r){r[r.FILE=0]="FILE",r[r.FOLDER=1]="FOLDER",r[r.ROOT_FOLDER=2]="ROOT_FOLDER"})(pi||(pi={}));const ty=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function ka(r,e,t,i){const n=i===pi.ROOT_FOLDER?["rootfolder-icon"]:i===pi.FOLDER?["folder-icon"]:["file-icon"];if(t){let o;if(t.scheme===Xe.ny.data)o=De.B6.parseMetaData(t).get(De.B6.META_DATA_LABEL);else{const s=t.path.match(ty);s?(o=Ia(s[2].toLowerCase()),s[1]&&n.push(`${Ia(s[1].toLowerCase())}-name-dir-icon`)):o=Ia(t.authority.toLowerCase())}if(i===pi.FOLDER)n.push(`${o}-name-folder-icon`);else{if(o){if(n.push(`${o}-name-file-icon`),n.push("name-file-icon"),o.length<=255){const a=o.split(".");for(let l=1;l<a.length;l++)n.push(`${a.slice(l).join(".")}-ext-file-icon`)}n.push("ext-file-icon")}const s=iy(r,e,t);s&&n.push(`${Ia(s)}-lang-file-icon`)}}return n}function iy(r,e,t){if(!t)return null;let i=null;if(t.scheme===Xe.ny.data){const o=De.B6.parseMetaData(t).get(De.B6.META_DATA_MIME);o&&(i=e.getLanguageIdByMimeType(o))}else{const n=r.getModel(t);n&&(i=n.getLanguageId())}return i&&i!==gd.vH?i:e.guessLanguageIdByFilepathOrFirstLine(t)}function Ia(r){return r.replace(/[\11\12\14\15\40]/g,"/")}var ny=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Ac=function(r,e){return function(t,i){e(t,i,r)}},Ws;function If(r){return`suggest-aria-id:${r}`}const oy=(0,Ge.pU)("suggest-more-info",Q.W6.chevronRight,g.kg("suggestMoreInfoIcon","Icon for more information in the suggest widget.")),sy=new(Ws=class bl{extract(e,t){if(e.textLabel.match(bl._regexStrict))return t[0]=e.textLabel,!0;if(e.completion.detail&&e.completion.detail.match(bl._regexStrict))return t[0]=e.completion.detail,!0;if(typeof e.completion.documentation=="string"){const i=bl._regexRelaxed.exec(e.completion.documentation);if(i&&(i.index===0||i.index+i[0].length===e.completion.documentation.length))return t[0]=i[0],!0}return!1}},Ws._regexRelaxed=/(#([\da-fA-F]{3}){1,2}|(rgb|hsl)a\(\s*(\d{1,3}%?\s*,\s*){3}(1|0?\.\d+)\)|(rgb|hsl)\(\s*\d{1,3}%?(\s*,\s*\d{1,3}%?){2}\s*\))/,Ws._regexStrict=new RegExp(`^${Ws._regexRelaxed.source}$`,"i"),Ws);let Nc=class{constructor(e,t,i,n){this._editor=e,this._modelService=t,this._languageService=i,this._themeService=n,this._onDidToggleDetails=new Z.vl,this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(e){const t=Object.create(null);t.disposables=new I.Cm,t.root=e,t.root.classList.add("show-file-icons"),t.icon=(0,S.BC)(e,(0,S.$)(".icon")),t.colorspan=(0,S.BC)(t.icon,(0,S.$)("span.colorspan"));const i=(0,S.BC)(e,(0,S.$)(".contents")),n=(0,S.BC)(i,(0,S.$)(".main"));t.iconContainer=(0,S.BC)(n,(0,S.$)(".icon-label.codicon")),t.left=(0,S.BC)(n,(0,S.$)("span.left")),t.right=(0,S.BC)(n,(0,S.$)("span.right")),t.iconLabel=new Ph.s(t.left,{supportHighlights:!0,supportIcons:!0}),t.disposables.add(t.iconLabel),t.parametersLabel=(0,S.BC)(t.left,(0,S.$)("span.signature-label")),t.qualifierLabel=(0,S.BC)(t.left,(0,S.$)("span.qualifier-label")),t.detailsLabel=(0,S.BC)(t.right,(0,S.$)("span.details-label")),t.readMore=(0,S.BC)(t.right,(0,S.$)("span.readMore"+U.L0.asCSSSelector(oy))),t.readMore.title=g.kg("readMore","Read More");const o=()=>{const s=this._editor.getOptions(),a=s.get(46),l=a.getMassagedFontFamily(),c=a.fontFeatureSettings,d=s.get(109)||a.fontSize,u=s.get(110)||a.lineHeight,h=a.fontWeight,p=a.letterSpacing,m=`${d}px`,v=`${u}px`,w=`${p}px`;t.root.style.fontSize=m,t.root.style.fontWeight=h,t.root.style.letterSpacing=w,n.style.fontFamily=l,n.style.fontFeatureSettings=c,n.style.lineHeight=v,t.icon.style.height=v,t.icon.style.width=v,t.readMore.style.height=v,t.readMore.style.width=v};return o(),t.disposables.add(this._editor.onDidChangeConfiguration(s=>{(s.hasChanged(46)||s.hasChanged(109)||s.hasChanged(110))&&o()})),t}renderElement(e,t,i){const{completion:n}=e;i.root.id=If(t),i.colorspan.style.backgroundColor="";const o={labelEscapeNewLines:!0,matches:(0,je.WJ)(e.score)},s=[];if(n.kind===19&&sy.extract(e,s))i.icon.className="icon customcolor",i.iconContainer.className="icon hide",i.colorspan.style.backgroundColor=s[0];else if(n.kind===20&&this._themeService.getFileIconTheme().hasFileIcons){i.icon.className="icon hide",i.iconContainer.className="icon hide";const a=ka(this._modelService,this._languageService,me.r.from({scheme:"fake",path:e.textLabel}),pi.FILE),l=ka(this._modelService,this._languageService,me.r.from({scheme:"fake",path:n.detail}),pi.FILE);o.extraClasses=a.length>l.length?a:l}else n.kind===23&&this._themeService.getFileIconTheme().hasFolderIcons?(i.icon.className="icon hide",i.iconContainer.className="icon hide",o.extraClasses=[ka(this._modelService,this._languageService,me.r.from({scheme:"fake",path:e.textLabel}),pi.FOLDER),ka(this._modelService,this._languageService,me.r.from({scheme:"fake",path:n.detail}),pi.FOLDER)].flat()):(i.icon.className="icon hide",i.iconContainer.className="",i.iconContainer.classList.add("suggest-icon",...Q.j3.asClassNameArray(_e.HC.toIcon(n.kind))));n.tags&&n.tags.indexOf(1)>=0&&(o.extraClasses=(o.extraClasses||[]).concat(["deprecated"]),o.matches=[]),i.iconLabel.setLabel(e.textLabel,void 0,o),typeof n.label=="string"?(i.parametersLabel.textContent="",i.detailsLabel.textContent=Mc(n.detail||""),i.root.classList.add("string-label")):(i.parametersLabel.textContent=Mc(n.label.detail||""),i.detailsLabel.textContent=Mc(n.label.description||""),i.root.classList.remove("string-label")),this._editor.getOption(108).showInlineDetails?(0,S.WU)(i.detailsLabel):(0,S.jD)(i.detailsLabel),Rc(e)?(i.right.classList.add("can-expand-details"),(0,S.WU)(i.readMore),i.readMore.onmousedown=a=>{a.stopPropagation(),a.preventDefault()},i.readMore.onclick=a=>{a.stopPropagation(),a.preventDefault(),this._onDidToggleDetails.fire()}):(i.right.classList.remove("can-expand-details"),(0,S.jD)(i.readMore),i.readMore.onmousedown=null,i.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};Nc=ny([Ac(1,$t.S),Ac(2,xt.L),Ac(3,U.Gy)],Nc);function Mc(r){return r.replace(/\r\n|\r|\n/g,"")}var ry=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Ra=function(r,e){return function(t,i){e(t,i,r)}},ay=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};const NL=(0,C.x1A)("editorSuggestWidget.background",{dark:C.CgL,light:C.CgL,hcDark:C.CgL,hcLight:C.CgL},g.kg("editorSuggestWidgetBackground","Background color of the suggest widget.")),ML=(0,C.x1A)("editorSuggestWidget.border",{dark:C.sIe,light:C.sIe,hcDark:C.sIe,hcLight:C.sIe},g.kg("editorSuggestWidgetBorder","Border color of the suggest widget.")),Ea=(0,C.x1A)("editorSuggestWidget.foreground",{dark:C.By2,light:C.By2,hcDark:C.By2,hcLight:C.By2},g.kg("editorSuggestWidgetForeground","Foreground color of the suggest widget.")),TL=(0,C.x1A)("editorSuggestWidget.selectedForeground",{dark:C.nH,light:C.nH,hcDark:C.nH,hcLight:C.nH},g.kg("editorSuggestWidgetSelectedForeground","Foreground color of the selected entry in the suggest widget.")),OL=(0,C.x1A)("editorSuggestWidget.selectedIconForeground",{dark:C.c7i,light:C.c7i,hcDark:C.c7i,hcLight:C.c7i},g.kg("editorSuggestWidgetSelectedIconForeground","Icon foreground color of the selected entry in the suggest widget.")),ly=(0,C.x1A)("editorSuggestWidget.selectedBackground",{dark:C.AlL,light:C.AlL,hcDark:C.AlL,hcLight:C.AlL},g.kg("editorSuggestWidgetSelectedBackground","Background color of the selected entry in the suggest widget.")),FL=(0,C.x1A)("editorSuggestWidget.highlightForeground",{dark:C.QI5,light:C.QI5,hcDark:C.QI5,hcLight:C.QI5},g.kg("editorSuggestWidgetHighlightForeground","Color of the match highlights in the suggest widget.")),PL=(0,C.x1A)("editorSuggestWidget.focusHighlightForeground",{dark:C.eMz,light:C.eMz,hcDark:C.eMz,hcLight:C.eMz},g.kg("editorSuggestWidgetFocusHighlightForeground","Color of the match highlights in the suggest widget when an item is focused.")),WL=(0,C.x1A)("editorSuggestWidgetStatus.foreground",{dark:(0,C.JO0)(Ea,.5),light:(0,C.JO0)(Ea,.5),hcDark:(0,C.JO0)(Ea,.5),hcLight:(0,C.JO0)(Ea,.5)},g.kg("editorSuggestWidgetStatusForeground","Foreground color of the suggest widget status."));class dy{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof nn}`}restore(){var e;const t=(e=this._service.get(this._key,0))!==null&&e!==void 0?e:"";try{const i=JSON.parse(t);if(S.fg.is(i))return S.fg.lift(i)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}let Bs=class Bu{constructor(e,t,i,n,o){this.editor=e,this._storageService=t,this._state=0,this._isAuto=!1,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new V.pc,this._disposables=new I.Cm,this._onDidSelect=new Z.vl,this._onDidFocus=new Z.vl,this._onDidHide=new Z.vl,this._onDidShow=new Z.vl,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new Z.vl,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new kf,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new cy(this,e),this._persistedSize=new dy(t,e);class s{constructor(p,m,v=!1,w=!1){this.persistedSize=p,this.currentSize=m,this.persistHeight=v,this.persistWidth=w}}let a;this._disposables.add(this.element.onDidWillResize(()=>{this._contentWidget.lockPreference(),a=new s(this._persistedSize.restore(),this.element.size)})),this._disposables.add(this.element.onDidResize(h=>{var p,m,v,w;if(this._resize(h.dimension.width,h.dimension.height),a&&(a.persistHeight=a.persistHeight||!!h.north||!!h.south,a.persistWidth=a.persistWidth||!!h.east||!!h.west),!!h.done){if(a){const{itemHeight:R,defaultSize:T}=this.getLayoutInfo(),F=Math.round(R/2);let{width:B,height:j}=this.element.size;(!a.persistHeight||Math.abs(a.currentSize.height-j)<=F)&&(j=(m=(p=a.persistedSize)===null||p===void 0?void 0:p.height)!==null&&m!==void 0?m:T.height),(!a.persistWidth||Math.abs(a.currentSize.width-B)<=F)&&(B=(w=(v=a.persistedSize)===null||v===void 0?void 0:v.width)!==null&&w!==void 0?w:T.width),this._persistedSize.store(new S.fg(B,j))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=S.BC(this.element.domNode,S.$(".message")),this._listElement=S.BC(this.element.domNode,S.$(".tree"));const l=o.createInstance(Ec,this.editor);l.onDidClose(this.toggleDetails,this,this._disposables),this._details=new ey(l,this.editor);const c=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(108).showIcons);c();const d=o.createInstance(Nc,this.editor);this._disposables.add(d),this._disposables.add(d.onDidToggleDetails(()=>this.toggleDetails())),this._list=new lh.B8("SuggestWidget",this._listElement,{getHeight:h=>this.getLayoutInfo().itemHeight,getTemplateId:h=>"suggestion"},[d],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>"option",getWidgetAriaLabel:()=>g.kg("suggest","Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:h=>{let p=h.textLabel;if(typeof h.completion.label!="string"){const{detail:R,description:T}=h.completion.label;R&&T?p=g.kg("label.full","{0}{1}, {2}",p,R,T):R?p=g.kg("label.detail","{0}{1}",p,R):T&&(p=g.kg("label.desc","{0}, {1}",p,T))}if(!h.isResolved||!this._isDetailsVisible())return p;const{documentation:m,detail:v}=h.completion,w=G.GP("{0}{1}",v||"",m?typeof m=="string"?m:m.value:"");return g.kg("ariaCurrenttSuggestionReadDetails","{0}, docs: {1}",p,w)}}}),this._status=o.createInstance(Ic,this.element.domNode);const u=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(108).showStatusBar);u(),this._disposables.add((0,Wh.DD)(this._list,n,{listInactiveFocusBackground:ly,listInactiveFocusOutline:C.buw})),this._disposables.add(n.onDidColorThemeChange(h=>this._onThemeChange(h))),this._onThemeChange(n.getColorTheme()),this._disposables.add(this._list.onMouseDown(h=>this._onListMouseDownOrTap(h))),this._disposables.add(this._list.onTap(h=>this._onListMouseDownOrTap(h))),this._disposables.add(this._list.onDidChangeSelection(h=>this._onListSelection(h))),this._disposables.add(this._list.onDidChangeFocus(h=>this._onListFocus(h))),this._disposables.add(this.editor.onDidChangeCursorSelection(()=>this._onCursorSelectionChanged())),this._disposables.add(this.editor.onDidChangeConfiguration(h=>{h.hasChanged(108)&&(u(),c())})),this._ctxSuggestWidgetVisible=oe.Visible.bindTo(i),this._ctxSuggestWidgetDetailsVisible=oe.DetailsVisible.bindTo(i),this._ctxSuggestWidgetMultipleSuggestions=oe.MultipleSuggestions.bindTo(i),this._ctxSuggestWidgetHasFocusedSuggestion=oe.HasFocusedSuggestion.bindTo(i),this._disposables.add(S.b2(this._details.widget.domNode,"keydown",h=>{this._onDetailsKeydown.fire(h)})),this._disposables.add(this.editor.onMouseDown(h=>this._onEditorMouseDown(h)))}dispose(){var e;this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),(e=this._loadingTimeout)===null||e===void 0||e.dispose(),this._showTimeout.dispose(),this._contentWidget.dispose(),this.element.dispose()}_onEditorMouseDown(e){this._details.widget.domNode.contains(e.target.element)?this._details.widget.domNode.focus():this.element.domNode.contains(e.target.element)&&this.editor.focus()}_onCursorSelectionChanged(){this._state!==0&&this._contentWidget.layout()}_onListMouseDownOrTap(e){typeof e.element>"u"||typeof e.index>"u"||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation(),this._select(e.element,e.index))}_onListSelection(e){e.elements.length&&this._select(e.elements[0],e.indexes[0])}_select(e,t){const i=this._completionModel;i&&(this._onDidSelect.fire({item:e,index:t,model:i}),this.editor.focus())}_onThemeChange(e){this._details.widget.borderWidth=(0,bt.Bb)(e.type)?2:1}_onListFocus(e){var t;if(this._ignoreFocusEvents)return;if(!e.elements.length){this._currentSuggestionDetails&&(this._currentSuggestionDetails.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=void 0),this.editor.setAriaOptions({activeDescendant:void 0}),this._ctxSuggestWidgetHasFocusedSuggestion.set(!1);return}if(!this._completionModel)return;this._ctxSuggestWidgetHasFocusedSuggestion.set(!0);const i=e.elements[0],n=e.indexes[0];i!==this._focusedItem&&((t=this._currentSuggestionDetails)===null||t===void 0||t.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=i,this._list.reveal(n),this._currentSuggestionDetails=(0,V.SS)(o=>ay(this,void 0,void 0,function*(){const s=(0,V.EQ)(()=>{this._isDetailsVisible()&&this.showDetails(!0)},250),a=o.onCancellationRequested(()=>s.dispose()),l=yield i.resolve(o);return s.dispose(),a.dispose(),l})),this._currentSuggestionDetails.then(()=>{n>=this._list.length||i!==this._list.element(n)||(this._ignoreFocusEvents=!0,this._list.splice(n,1,[i]),this._list.setFocus([n]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this.showDetails(!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:If(n)}))}).catch(K.dz)),this._onDidFocus.fire({item:i,index:n,model:this._completionModel})}_setState(e){if(this._state!==e)switch(this._state=e,this.element.domNode.classList.toggle("frozen",e===4),this.element.domNode.classList.remove("message"),e){case 0:S.jD(this._messageElement,this._listElement,this._status.element),this._details.hide(!0),this._status.hide(),this._contentWidget.hide(),this._ctxSuggestWidgetVisible.reset(),this._ctxSuggestWidgetMultipleSuggestions.reset(),this._ctxSuggestWidgetHasFocusedSuggestion.reset(),this._showTimeout.cancel(),this.element.domNode.classList.remove("visible"),this._list.splice(0,this._list.length),this._focusedItem=void 0,this._cappedHeight=void 0,this._explainMode=!1;break;case 1:this.element.domNode.classList.add("message"),this._messageElement.textContent=Bu.LOADING_MESSAGE,S.jD(this._listElement,this._status.element),S.WU(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0;break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=Bu.NO_SUGGESTIONS_MESSAGE,S.jD(this._listElement,this._status.element),S.WU(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0;break;case 3:S.jD(this._messageElement),S.WU(this._listElement,this._status.element),this._show();break;case 4:S.jD(this._messageElement),S.WU(this._listElement,this._status.element),this._show();break;case 5:S.jD(this._messageElement),S.WU(this._listElement,this._status.element),this._details.show(),this._show();break}}_show(){this._status.show(),this._contentWidget.show(),this._layout(this._persistedSize.restore()),this._ctxSuggestWidgetVisible.set(!0),this._showTimeout.cancelAndSet(()=>{this.element.domNode.classList.add("visible"),this._onDidShow.fire(this)},100)}showTriggered(e,t){this._state===0&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!e,this._isAuto||(this._loadingTimeout=(0,V.EQ)(()=>this._setState(1),t)))}showSuggestions(e,t,i,n){var o,s;if(this._contentWidget.setPosition(this.editor.getPosition()),(o=this._loadingTimeout)===null||o===void 0||o.dispose(),(s=this._currentSuggestionDetails)===null||s===void 0||s.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),i&&this._state!==2&&this._state!==0){this._setState(4);return}const a=this._completionModel.items.length,l=a===0;if(this._ctxSuggestWidgetMultipleSuggestions.set(a>1),l){this._setState(n?0:2),this._completionModel=void 0;return}this._focusedItem=void 0,this._list.splice(0,this._list.length,this._completionModel.items),this._setState(i?4:3),t>=0&&(this._list.reveal(t,0),this._list.setFocus([t])),this._layout(this.element.size),this._details.widget.domNode.classList.remove("focused")}selectNextPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageDown(),!0;case 1:return!this._isAuto;default:return this._list.focusNextPage(),!0}}selectNext(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusNext(1,!0),!0}}selectLast(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollBottom(),!0;case 1:return!this._isAuto;default:return this._list.focusLast(),!0}}selectPreviousPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageUp(),!0;case 1:return!this._isAuto;default:return this._list.focusPreviousPage(),!0}}selectPrevious(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusPrevious(1,!0),!1}}selectFirst(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollTop(),!0;case 1:return!this._isAuto;default:return this._list.focusFirst(),!0}}getFocusedItem(){if(this._state!==0&&this._state!==2&&this._state!==1&&this._completionModel)return{item:this._list.getFocusedElements()[0],index:this._list.getFocus()[0],model:this._completionModel}}toggleDetailsFocus(){this._state===5?(this._setState(3),this._details.widget.domNode.classList.remove("focused")):this._state===3&&this._isDetailsVisible()&&(this._setState(5),this._details.widget.domNode.classList.add("focused"))}toggleDetails(){this._isDetailsVisible()?(this._ctxSuggestWidgetDetailsVisible.set(!1),this._setDetailsVisible(!1),this._details.hide(),this.element.domNode.classList.remove("shows-details")):(Rc(this._list.getFocusedElements()[0])||this._explainMode)&&(this._state===3||this._state===5||this._state===4)&&(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this.showDetails(!1))}showDetails(e){this._details.show(),e?this._details.widget.renderLoading():this._details.widget.renderItem(this._list.getFocusedElements()[0],this._explainMode),this._positionDetails(),this.editor.focus(),this.element.domNode.classList.add("shows-details")}toggleExplainMode(){this._list.getFocusedElements()[0]&&(this._explainMode=!this._explainMode,this._isDetailsVisible()?this.showDetails(!1):this.toggleDetails())}resetPersistedSize(){this._persistedSize.reset()}hideWidget(){var e;(e=this._loadingTimeout)===null||e===void 0||e.dispose(),this._setState(0),this._onDidHide.fire(this),this.element.clearSashHoverState();const t=this._persistedSize.restore(),i=Math.ceil(this.getLayoutInfo().itemHeight*4.3);t&&t.height<i&&this._persistedSize.store(t.with(void 0,i))}isFrozen(){return this._state===4}_afterRender(e){if(e===null){this._isDetailsVisible()&&this._details.hide();return}this._state===2||this._state===1||(this._isDetailsVisible()&&this._details.show(),this._positionDetails())}_layout(e){var t,i,n;if(!this.editor.hasModel()||!this.editor.getDomNode())return;const o=S.tG(document.body),s=this.getLayoutInfo();e||(e=s.defaultSize);let a=e.height,l=e.width;if(this._status.element.style.lineHeight=`${s.itemHeight}px`,this._state===2||this._state===1)a=s.itemHeight+s.borderHeight,l=s.defaultSize.width/2,this.element.enableSashes(!1,!1,!1,!1),this.element.minSize=this.element.maxSize=new S.fg(l,a),this._contentWidget.setPreference(2);else{const c=o.width-s.borderHeight-2*s.horizontalPadding;l>c&&(l=c);const d=this._completionModel?this._completionModel.stats.pLabelLen*s.typicalHalfwidthCharacterWidth:l,u=s.statusBarHeight+this._list.contentHeight+s.borderHeight,h=s.itemHeight+s.statusBarHeight,p=S.BK(this.editor.getDomNode()),m=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),v=p.top+m.top+m.height,w=Math.min(o.height-v-s.verticalPadding,u),R=p.top+m.top-s.verticalPadding,T=Math.min(R,u);let F=Math.min(Math.max(T,w)+s.borderHeight,u);a===((t=this._cappedHeight)===null||t===void 0?void 0:t.capped)&&(a=this._cappedHeight.wanted),a<h&&(a=h),a>F&&(a=F),a>w||this._forceRenderingAbove&&R>150?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),F=T):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),F=w),this.element.preferredSize=new S.fg(d,s.defaultSize.height),this.element.maxSize=new S.fg(c,F),this.element.minSize=new S.fg(220,h),this._cappedHeight=a===u?{wanted:(n=(i=this._cappedHeight)===null||i===void 0?void 0:i.wanted)!==null&&n!==void 0?n:e.height,capped:a}:void 0}this._resize(l,a)}_resize(e,t){const{width:i,height:n}=this.element.maxSize;e=Math.min(i,e),t=Math.min(n,t);const{statusBarHeight:o}=this.getLayoutInfo();this._list.layout(t-o,e),this._listElement.style.height=`${t-o}px`,this.element.layout(t,e),this._contentWidget.layout(),this._positionDetails()}_positionDetails(){var e;this._isDetailsVisible()&&this._details.placeAtAnchor(this.element.domNode,((e=this._contentWidget.getPosition())===null||e===void 0?void 0:e.preference[0])===2)}getLayoutInfo(){const e=this.editor.getOption(46),t=(0,_S.qE)(this.editor.getOption(110)||e.lineHeight,8,1e3),i=!this.editor.getOption(108).showStatusBar||this._state===2||this._state===1?0:t,n=this._details.widget.borderWidth,o=2*n;return{itemHeight:t,statusBarHeight:i,borderWidth:n,borderHeight:o,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new S.fg(430,i+12*t+o)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",0,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,0,0)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}};Bs.LOADING_MESSAGE=g.kg("suggestWidget.loading","Loading..."),Bs.NO_SUGGESTIONS_MESSAGE=g.kg("suggestWidget.noSuggestions","No suggestions."),Bs=ry([Ra(1,Tt.CS),Ra(2,A.fN),Ra(3,U.Gy),Ra(4,he._Y)],Bs);class cy{constructor(e,t){this._widget=e,this._editor=t,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._preferenceLocked=!1,this._added=!1,this._hidden=!1}dispose(){this._added&&(this._added=!1,this._editor.removeContentWidget(this))}getId(){return"editor.widget.suggestWidget"}getDomNode(){return this._widget.element.domNode}show(){this._hidden=!1,this._added||(this._added=!0,this._editor.addContentWidget(this))}hide(){this._hidden||(this._hidden=!0,this.layout())}layout(){this._editor.layoutContentWidget(this)}getPosition(){return this._hidden||!this._position||!this._preference?null:{position:this._position,preference:[this._preference]}}beforeRender(){const{height:e,width:t}=this._widget.element.size,{borderWidth:i,horizontalPadding:n}=this._widget.getLayoutInfo();return new S.fg(t+2*i+n,e+2*i)}afterRender(e){this._widget._afterRender(e)}setPreference(e){this._preferenceLocked||(this._preference=e)}lockPreference(){this._preferenceLocked=!0}unlockPreference(){this._preferenceLocked=!1}setPosition(e){this._position=e}}var uy=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},po=function(r,e){return function(t,i){e(t,i,r)}};const hy=!1;class gy{constructor(e,t){if(this._model=e,this._position=t,e.getLineMaxColumn(t.lineNumber)!==t.column){const n=e.getOffsetAt(t),o=e.getPositionAt(n+1);this._marker=e.deltaDecorations([],[{range:L.Q.fromPositions(t,o),options:{description:"suggest-line-suffix",stickiness:1}}])}}dispose(){this._marker&&!this._model.isDisposed()&&this._model.deltaDecorations(this._marker,[])}delta(e){if(this._model.isDisposed()||this._position.lineNumber!==e.lineNumber)return 0;if(this._marker){const t=this._model.getDecorationRange(this._marker[0]);return this._model.getOffsetAt(t.getStartPosition())-this._model.getOffsetAt(e)}else return this._model.getLineMaxColumn(e.lineNumber)-e.column}}let At=class pm{constructor(e,t,i,n,o,s,a){this._memoryService=t,this._commandService=i,this._contextKeyService=n,this._instantiationService=o,this._logService=s,this._telemetryService=a,this._lineSuffix=new I.HE,this._toDispose=new I.Cm,this._selectors=new fy(u=>u.priority),this._telemetryGate=0,this.editor=e,this.model=o.createInstance(xc,this.editor);const l=oe.InsertMode.bindTo(n);l.set(e.getOption(108).insertMode),this.model.onDidTrigger(()=>l.set(e.getOption(108).insertMode)),this.widget=this._toDispose.add(new V.kb(()=>{const u=this._instantiationService.createInstance(Bs,this.editor);this._toDispose.add(u),this._toDispose.add(u.onDidSelect(w=>this._insertSuggestion(w,0),this));const h=new cS(this.editor,u,w=>this._insertSuggestion(w,2));this._toDispose.add(h),this._toDispose.add(this.model.onDidSuggest(w=>{w.completionModel.items.length===0&&h.reset()}));const p=oe.MakesTextEdit.bindTo(this._contextKeyService),m=oe.HasInsertAndReplaceRange.bindTo(this._contextKeyService),v=oe.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add((0,I.s)(()=>{p.reset(),m.reset(),v.reset()})),this._toDispose.add(u.onDidFocus(({item:w})=>{const R=this.editor.getPosition(),T=w.editStart.column,F=R.column;let B=!0;this.editor.getOption(1)==="smart"&&this.model.state===2&&!w.completion.additionalTextEdits&&!(w.completion.insertTextRules&4)&&F-T===w.completion.insertText.length&&(B=this.editor.getModel().getValueInRange({startLineNumber:R.lineNumber,startColumn:T,endLineNumber:R.lineNumber,endColumn:F})!==w.completion.insertText),p.set(B),m.set(!ee.y.equals(w.editInsertEnd,w.editReplaceEnd)),v.set(!!w.provider.resolveCompletionItem||!!w.completion.documentation||w.completion.detail!==w.completion.label)})),this._toDispose.add(u.onDetailsKeyDown(w=>{if(w.toKeybinding().equals(new wf.h$(!0,!1,!1,!1,33))||Se.zx&&w.toKeybinding().equals(new wf.h$(!1,!1,!1,!0,33))){w.stopPropagation();return}w.toKeybinding().isModifierKey()||this.editor.focus()})),u})),this._overtypingCapturer=this._toDispose.add(new V.kb(()=>this._toDispose.add(new La(this.editor,this.model)))),this._alternatives=this._toDispose.add(new V.kb(()=>this._toDispose.add(new mn(this.editor,this._contextKeyService)))),this._toDispose.add(o.createInstance(Ps,e)),this._toDispose.add(this.model.onDidTrigger(u=>{this.widget.value.showTriggered(u.auto,u.shy?250:50),this._lineSuffix.value=new gy(this.editor.getModel(),u.position)})),this._toDispose.add(this.model.onDidSuggest(u=>{if(u.shy)return;let h=-1;if(!u.noSelect){for(const p of this._selectors.itemsOrderedByPriorityDesc)if(h=p.select(this.editor.getModel(),this.editor.getPosition(),u.completionModel.items),h!==-1)break;h===-1&&(h=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),u.completionModel.items))}this.widget.value.showSuggestions(u.completionModel,h,u.isFrozen,u.auto)})),this._toDispose.add(this.model.onDidCancel(u=>{u.retrigger||this.widget.value.hideWidget()})),this._toDispose.add(this.editor.onDidBlurEditorWidget(()=>{hy||(this.model.cancel(),this.model.clear())}));const c=oe.AcceptSuggestionsOnEnter.bindTo(n),d=()=>{const u=this.editor.getOption(1);c.set(u==="on"||u==="smart")};this._toDispose.add(this.editor.onDidChangeConfiguration(()=>d())),d()}static get(e){return e.getContribution(pm.ID)}dispose(){this._alternatives.dispose(),this._toDispose.dispose(),this.widget.dispose(),this.model.dispose(),this._lineSuffix.dispose()}_insertSuggestion(e,t){if(!e||!e.item){this._alternatives.value.reset(),this.model.cancel(),this.model.clear();return}if(!this.editor.hasModel())return;const i=Me.get(this.editor);if(!i)return;const n=this.editor.getModel(),o=n.getAlternativeVersionId(),{item:s}=e,a=[],l=new re.Q;t&1||this.editor.pushUndoStop();const c=this.getOverwriteInfo(s,!!(t&8));if(this._memoryService.memorize(n,this.editor.getPosition(),s),Array.isArray(s.completion.additionalTextEdits)){const u=qo.D.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",s.completion.additionalTextEdits.map(h=>Le.k.replaceMove(L.Q.lift(h.range),h.text))),u.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!s.isResolved){const u=new Kt.W(!0);let h;const p=n.onDidChangeContent(R=>{if(R.isFlush){l.cancel(),p.dispose();return}for(const T of R.changes){const F=L.Q.getEndPosition(T.range);(!h||ee.y.isBefore(F,h))&&(h=F)}}),m=t;t|=2;let v=!1;const w=this.editor.onWillType(()=>{w.dispose(),v=!0,m&2||this.editor.pushUndoStop()});a.push(s.resolve(l.token).then(()=>{if(!s.completion.additionalTextEdits||l.token.isCancellationRequested||h&&s.completion.additionalTextEdits.some(T=>ee.y.isBefore(h,L.Q.getStartPosition(T.range))))return!1;v&&this.editor.pushUndoStop();const R=qo.D.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",s.completion.additionalTextEdits.map(T=>Le.k.replaceMove(L.Q.lift(T.range),T.text))),R.restoreRelativeVerticalPositionOfCursor(this.editor),(v||!(m&2))&&this.editor.pushUndoStop(),!0}).then(R=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",u.elapsed(),R),p.dispose(),w.dispose()}))}let{insertText:d}=s.completion;s.completion.insertTextRules&4||(d=Ri.escape(d)),i.insert(d,{overwriteBefore:c.overwriteBefore,overwriteAfter:c.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(s.completion.insertTextRules&1),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),t&2||this.editor.pushUndoStop(),s.completion.command?s.completion.command.id===Hs.id?this.model.trigger({auto:!0,shy:!1,noSelect:!1},!0):(a.push(this._commandService.executeCommand(s.completion.command.id,...s.completion.command.arguments?[...s.completion.command.arguments]:[]).catch(K.dz)),this.model.cancel()):this.model.cancel(),t&4&&this._alternatives.value.set(e,u=>{for(l.cancel();n.canUndo();){o!==n.getAlternativeVersionId()&&n.undo(),this._insertSuggestion(u,3|(t&8?8:0));break}}),this._alertCompletionItem(s),Promise.all(a).finally(()=>{this._reportSuggestionAcceptedTelemetry(s,n,e),this.model.clear(),l.dispose()})}_reportSuggestionAcceptedTelemetry(e,t,i){var n;if(this._telemetryGate++%100!==0)return;const o=e.extensionId?e.extensionId.value:((n=i.item.provider._debugDisplayName)!==null&&n!==void 0?n:"unknown").split("(",1)[0].toLowerCase();this._telemetryService.publicLog2("suggest.acceptedSuggestion",{providerId:o,kind:e.completion.kind,basenameHash:(0,ql.tW)((0,De.P8)(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:(0,De.LC)(t.uri)})}getOverwriteInfo(e,t){(0,le.j)(this.editor.hasModel());let i=this.editor.getOption(108).insertMode==="replace";t&&(i=!i);const n=e.position.column-e.editStart.column,o=(i?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column,s=this.editor.getPosition().column-e.position.column,a=this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0;return{overwriteBefore:n+s,overwriteAfter:o+a}}_alertCompletionItem(e){if((0,pe.EI)(e.completion.additionalTextEdits)){const t=g.kg("aria.alert.snippet","Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);(0,ft.xE)(t)}}triggerSuggest(e,t,i,n){this.editor.hasModel()&&(this.model.trigger({auto:t??!1,shy:!1,noSelect:n??!1},!1,e,void 0,i),this.editor.revealPosition(this.editor.getPosition(),0),this.editor.focus())}triggerSuggestAndAcceptBest(e){if(!this.editor.hasModel())return;const t=this.editor.getPosition(),i=()=>{t.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},n=o=>{if(o.completion.insertTextRules&4||o.completion.additionalTextEdits)return!0;const s=this.editor.getPosition(),a=o.editStart.column,l=s.column;return l-a!==o.completion.insertText.length?!0:this.editor.getModel().getValueInRange({startLineNumber:s.lineNumber,startColumn:a,endLineNumber:s.lineNumber,endColumn:l})!==o.completion.insertText};Z.Jh.once(this.model.onDidTrigger)(o=>{const s=[];Z.Jh.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{(0,I.AS)(s),i()},void 0,s),this.model.onDidSuggest(({completionModel:a})=>{if((0,I.AS)(s),a.items.length===0){i();return}const l=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),a.items),c=a.items[l];if(!n(c)){i();return}this.editor.pushUndoStop(),this._insertSuggestion({index:l,item:c,model:a},7)},void 0,s)}),this.model.trigger({auto:!1,shy:!0,noSelect:!1}),this.editor.revealPosition(t,0),this.editor.focus()}acceptSelectedSuggestion(e,t){const i=this.widget.value.getFocusedItem();let n=0;e&&(n|=4),t&&(n|=8),this._insertSuggestion(i,n)}acceptNextSuggestion(){this._alternatives.value.next()}acceptPrevSuggestion(){this._alternatives.value.prev()}cancelSuggestWidget(){this.model.cancel(),this.model.clear(),this.widget.value.hideWidget()}selectNextSuggestion(){this.widget.value.selectNext()}selectNextPageSuggestion(){this.widget.value.selectNextPage()}selectLastSuggestion(){this.widget.value.selectLast()}selectPrevSuggestion(){this.widget.value.selectPrevious()}selectPrevPageSuggestion(){this.widget.value.selectPreviousPage()}selectFirstSuggestion(){this.widget.value.selectFirst()}toggleSuggestionDetails(){this.widget.value.toggleDetails()}toggleExplainMode(){this.widget.value.toggleExplainMode()}toggleSuggestionFocus(){this.widget.value.toggleDetailsFocus()}resetWidgetSize(){this.widget.value.resetPersistedSize()}forceRenderingAbove(){this.widget.value.forceRenderingAbove()}stopForceRenderingAbove(){this.widget.isInitialized&&this.widget.value.stopForceRenderingAbove()}registerSelector(e){return this._selectors.register(e)}};At.ID="editor.contrib.suggestController",At=uy([po(1,xa),po(2,fe.wT),po(3,A.fN),po(4,he._Y),po(5,ia.rr),po(6,Vn.k)],At);class fy{constructor(e){this.prioritySelector=e,this._items=new Array}register(e){if(this._items.indexOf(e)!==-1)throw new Error("Value is already registered");return this._items.push(e),this._items.sort((t,i)=>this.prioritySelector(i)-this.prioritySelector(t)),{dispose:()=>{const t=this._items.indexOf(e);t>=0&&this._items.splice(t,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}class Hs extends _.ks{constructor(){super({id:Hs.id,label:g.kg("suggest.trigger.label","Trigger Suggest"),alias:"Trigger Suggest",precondition:A.M$.and(D.R.writable,D.R.hasCompletionItemProvider),kbOpts:{kbExpr:D.R.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t,i){const n=At.get(t);if(!n)return;let o,s;i&&typeof i=="object"&&(i.auto===!0&&(o=!0),i.noSelection===!0&&(s=!0)),n.triggerSuggest(void 0,o,void 0,s)}}Hs.id="editor.action.triggerSuggest",(0,_.HW)(At.ID,At),(0,_.Fl)(Hs);const wt=190,ut=_.DX.bindToContribution(At.get);(0,_.E_)(new ut({id:"acceptSelectedSuggestion",precondition:A.M$.and(oe.Visible,oe.HasFocusedSuggestion),handler(r){r.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:2,kbExpr:A.M$.and(oe.Visible,D.R.textInputFocus),weight:wt},{primary:3,kbExpr:A.M$.and(oe.Visible,D.R.textInputFocus,oe.AcceptSuggestionsOnEnter,oe.MakesTextEdit),weight:wt}],menuOpts:[{menuId:Ei,title:g.kg("accept.insert","Insert"),group:"left",order:1,when:oe.HasInsertAndReplaceRange.toNegated()},{menuId:Ei,title:g.kg("accept.insert","Insert"),group:"left",order:1,when:A.M$.and(oe.HasInsertAndReplaceRange,oe.InsertMode.isEqualTo("insert"))},{menuId:Ei,title:g.kg("accept.replace","Replace"),group:"left",order:1,when:A.M$.and(oe.HasInsertAndReplaceRange,oe.InsertMode.isEqualTo("replace"))}]})),(0,_.E_)(new ut({id:"acceptAlternativeSelectedSuggestion",precondition:A.M$.and(oe.Visible,D.R.textInputFocus,oe.HasFocusedSuggestion),kbOpts:{weight:wt,kbExpr:D.R.textInputFocus,primary:1027,secondary:[1026]},handler(r){r.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:Ei,group:"left",order:2,when:A.M$.and(oe.HasInsertAndReplaceRange,oe.InsertMode.isEqualTo("insert")),title:g.kg("accept.replace","Replace")},{menuId:Ei,group:"left",order:2,when:A.M$.and(oe.HasInsertAndReplaceRange,oe.InsertMode.isEqualTo("replace")),title:g.kg("accept.insert","Insert")}]})),fe.wb.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion"),(0,_.E_)(new ut({id:"hideSuggestWidget",precondition:oe.Visible,handler:r=>r.cancelSuggestWidget(),kbOpts:{weight:wt,kbExpr:D.R.textInputFocus,primary:9,secondary:[1033]}})),(0,_.E_)(new ut({id:"selectNextSuggestion",precondition:A.M$.and(oe.Visible,oe.MultipleSuggestions),handler:r=>r.selectNextSuggestion(),kbOpts:{weight:wt,kbExpr:D.R.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})),(0,_.E_)(new ut({id:"selectNextPageSuggestion",precondition:A.M$.and(oe.Visible,oe.MultipleSuggestions),handler:r=>r.selectNextPageSuggestion(),kbOpts:{weight:wt,kbExpr:D.R.textInputFocus,primary:12,secondary:[2060]}})),(0,_.E_)(new ut({id:"selectLastSuggestion",precondition:A.M$.and(oe.Visible,oe.MultipleSuggestions),handler:r=>r.selectLastSuggestion()})),(0,_.E_)(new ut({id:"selectPrevSuggestion",precondition:A.M$.and(oe.Visible,oe.MultipleSuggestions),handler:r=>r.selectPrevSuggestion(),kbOpts:{weight:wt,kbExpr:D.R.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})),(0,_.E_)(new ut({id:"selectPrevPageSuggestion",precondition:A.M$.and(oe.Visible,oe.MultipleSuggestions),handler:r=>r.selectPrevPageSuggestion(),kbOpts:{weight:wt,kbExpr:D.R.textInputFocus,primary:11,secondary:[2059]}})),(0,_.E_)(new ut({id:"selectFirstSuggestion",precondition:A.M$.and(oe.Visible,oe.MultipleSuggestions),handler:r=>r.selectFirstSuggestion()})),(0,_.E_)(new ut({id:"toggleSuggestionDetails",precondition:oe.Visible,handler:r=>r.toggleSuggestionDetails(),kbOpts:{weight:wt,kbExpr:D.R.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:Ei,group:"right",order:1,when:A.M$.and(oe.DetailsVisible,oe.CanResolve),title:g.kg("detail.more","show less")},{menuId:Ei,group:"right",order:1,when:A.M$.and(oe.DetailsVisible.toNegated(),oe.CanResolve),title:g.kg("detail.less","show more")}]})),(0,_.E_)(new ut({id:"toggleExplainMode",precondition:oe.Visible,handler:r=>r.toggleExplainMode(),kbOpts:{weight:100,primary:2133}})),(0,_.E_)(new ut({id:"toggleSuggestionFocus",precondition:oe.Visible,handler:r=>r.toggleSuggestionFocus(),kbOpts:{weight:wt,kbExpr:D.R.textInputFocus,primary:2570,mac:{primary:778}}})),(0,_.E_)(new ut({id:"insertBestCompletion",precondition:A.M$.and(D.R.textInputFocus,A.M$.equals("config.editor.tabCompletion","on"),Ps.AtEnd,oe.Visible.toNegated(),mn.OtherSuggestions.toNegated(),Me.InSnippetMode.toNegated()),handler:(r,e)=>{r.triggerSuggestAndAcceptBest((0,le.Gv)(e)?Object.assign({fallback:"tab"},e):{fallback:"tab"})},kbOpts:{weight:wt,primary:2}})),(0,_.E_)(new ut({id:"insertNextSuggestion",precondition:A.M$.and(D.R.textInputFocus,A.M$.equals("config.editor.tabCompletion","on"),mn.OtherSuggestions,oe.Visible.toNegated(),Me.InSnippetMode.toNegated()),handler:r=>r.acceptNextSuggestion(),kbOpts:{weight:wt,kbExpr:D.R.textInputFocus,primary:2}})),(0,_.E_)(new ut({id:"insertPrevSuggestion",precondition:A.M$.and(D.R.textInputFocus,A.M$.equals("config.editor.tabCompletion","on"),mn.OtherSuggestions,oe.Visible.toNegated(),Me.InSnippetMode.toNegated()),handler:r=>r.acceptPrevSuggestion(),kbOpts:{weight:wt,kbExpr:D.R.textInputFocus,primary:1026}})),(0,_.Fl)(class extends _.ks{constructor(){super({id:"editor.action.resetSuggestSize",label:g.kg("suggest.reset.label","Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(r,e){var t;(t=At.get(e))===null||t===void 0||t.resetWidgetSize()}});class py extends I.jG{constructor(e,t){super(),this.editor=e,this.suggestControllerPreselector=t,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this.onDidChangeEmitter=new Z.vl,this.onDidChange=this.onDidChangeEmitter.event,this.setInactiveDelayed=this._register(new V.uC(()=>{this.isSuggestWidgetVisible||this._isActive&&(this._isActive=!1,this.onDidChangeEmitter.fire())},100)),this._register(e.onKeyDown(n=>{n.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))})),this._register(e.onKeyUp(n=>{n.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))}));const i=At.get(this.editor);if(i){this._register(i.registerSelector({priority:100,select:(s,a,l)=>{const c=this.editor.getModel(),d=Da(c,this.suggestControllerPreselector());if(!d)return-1;const u=ee.y.lift(a),h=l.map((m,v)=>{const w=Rf(i,u,m,this.isShiftKeyPressed),R=Da(c,w?.normalizedInlineCompletion);if(!R)return;const T=my(d.range,R.range)&&d.insertText.startsWith(R.insertText);return{index:v,valid:T,prefixLength:R.insertText.length,suggestItem:m}}).filter(m=>m&&m.valid),p=(0,pe.vj)(h,(0,pe.VE)(m=>m.prefixLength,pe.U9));return p?p.index:-1}}));let n=!1;const o=()=>{n||(n=!0,this._register(i.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})),this._register(i.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.setInactiveDelayed.schedule(),this.update(this._isActive)})),this._register(i.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})))};this._register(Z.Jh.once(i.model.onDidTrigger)(s=>{o()}))}this.update(this._isActive)}get state(){if(this._isActive)return{selectedItem:this._currentSuggestItemInfo}}update(e){const t=this.getSuggestItemInfo();let i=!1;_y(this._currentSuggestItemInfo,t)||(this._currentSuggestItemInfo=t,i=!0),this._isActive!==e&&(this._isActive=e,i=!0),i&&this.onDidChangeEmitter.fire()}getSuggestItemInfo(){const e=At.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem();if(t)return Rf(e,this.editor.getPosition(),t.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){const e=At.get(this.editor);e&&e.stopForceRenderingAbove()}forceRenderingAbove(){const e=At.get(this.editor);e&&e.forceRenderingAbove()}}function my(r,e){return e.startLineNumber===r.startLineNumber&&e.startColumn===r.startColumn&&(e.endLineNumber<r.endLineNumber||e.endLineNumber===r.endLineNumber&&e.endColumn<=r.endColumn)}function _y(r,e){return r===e?!0:!r||!e?!1:r.completionItemKind===e.completionItemKind&&r.isSnippetText===e.isSnippetText&&zb(r.normalizedInlineCompletion,e.normalizedInlineCompletion)}function Rf(r,e,t,i){if(Array.isArray(t.completion.additionalTextEdits)&&t.completion.additionalTextEdits.length>0)return{completionItemKind:t.completion.kind,isSnippetText:!1,normalizedInlineCompletion:{range:L.Q.fromPositions(e,e),insertText:"",filterText:"",snippetInfo:void 0,additionalTextEdits:[]}};let{insertText:n}=t.completion,o=!1;if(t.completion.insertTextRules&4){const a=new Ri().parse(n),l=r.editor.getModel();if(a.children.length>100)return;oa.adjustWhitespace(l,e,a,!0,!0),n=a.toString(),o=!0}const s=r.getOverwriteInfo(t,i);return{isSnippetText:o,completionItemKind:t.completion.kind,normalizedInlineCompletion:{insertText:n,filterText:n,range:L.Q.fromPositions(e.delta(0,-s.overwriteBefore),e.delta(0,Math.max(s.overwriteAfter,0))),snippetInfo:void 0,additionalTextEdits:[]}}}var vy=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Cy=function(r,e){return function(t,i){e(t,i,r)}},Ef=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};let Tc=class extends _f{constructor(e,t,i){super(e),this.cache=t,this.languageFeaturesService=i,this.suggestionInlineCompletionSource=this._register(new py(this.editor,()=>{var n,o;return(o=(n=this.cache.value)===null||n===void 0?void 0:n.completions[0])===null||o===void 0?void 0:o.toLiveInlineCompletion()})),this.updateOperation=this._register(new I.HE),this.updateCacheSoon=this._register(new V.uC(()=>this.updateCache(),50)),this.minReservedLineCount=0,this._register(this.suggestionInlineCompletionSource.onDidChange(()=>{if(!this.editor.hasModel())return;this.updateCacheSoon.schedule(),this.suggestionInlineCompletionSource.state||(this.minReservedLineCount=0);const o=this.ghostText;o&&(this.minReservedLineCount=Math.max(this.minReservedLineCount,by(o.parts.map(s=>s.lines.length-1)))),this.minReservedLineCount>=1?this.suggestionInlineCompletionSource.forceRenderingAbove():this.suggestionInlineCompletionSource.stopForceRenderingAbove(),this.onDidChangeEmitter.fire()})),this._register(this.cache.onDidChange(()=>{this.onDidChangeEmitter.fire()})),this._register(this.editor.onDidChangeCursorPosition(n=>{this.minReservedLineCount=0,this.updateCacheSoon.schedule(),this.onDidChangeEmitter.fire()})),this._register((0,I.s)(()=>this.suggestionInlineCompletionSource.stopForceRenderingAbove()))}get isActive(){return this.suggestionInlineCompletionSource.state!==void 0}isSuggestionPreviewEnabled(){return this.editor.getOption(108).preview}updateCache(){return Ef(this,void 0,void 0,function*(){const e=this.suggestionInlineCompletionSource.state;if(!e||!e.selectedItem)return;const t={text:e.selectedItem.normalizedInlineCompletion.insertText,range:e.selectedItem.normalizedInlineCompletion.range,isSnippetText:e.selectedItem.isSnippetText,completionKind:e.selectedItem.completionItemKind},i=this.editor.getPosition();if(e.selectedItem.isSnippetText||e.selectedItem.completionItemKind===27||e.selectedItem.completionItemKind===20||e.selectedItem.completionItemKind===23){this.cache.clear();return}const n=(0,V.SS)(s=>Ef(this,void 0,void 0,function*(){let a;try{a=yield yf(this.languageFeaturesService.inlineCompletionsProvider,i,this.editor.getModel(),{triggerKind:_e.qw.Automatic,selectedSuggestionInfo:t},s)}catch(l){(0,K.dz)(l);return}if(s.isCancellationRequested){a.dispose();return}this.cache.setValue(this.editor,a,_e.qw.Automatic),this.onDidChangeEmitter.fire()})),o=new Sf(n,_e.qw.Automatic);this.updateOperation.value=o,yield n,this.updateOperation.value===o&&this.updateOperation.clear()})}get ghostText(){var e,t,i;const n=this.isSuggestionPreviewEnabled(),o=this.editor.getModel(),s=Da(o,(t=(e=this.cache.value)===null||e===void 0?void 0:e.completions[0])===null||t===void 0?void 0:t.toLiveInlineCompletion()),a=this.suggestionInlineCompletionSource.state,l=Da(o,(i=a?.selectedItem)===null||i===void 0?void 0:i.normalizedInlineCompletion),c=s&&l&&s.insertText.startsWith(l.insertText)&&s.range.equalsRange(l.range);if(!n&&!c)return;const d=c?s:l||s,u=c?d.insertText.length-l.insertText.length:0;return this.toGhostText(d,u)}toGhostText(e,t){const i=this.editor.getOptions().get(108).previewMode;return e?vf(e,this.editor.getModel(),i,this.editor.getPosition(),t)||new pf(e.range.endLineNumber,[],this.minReservedLineCount):void 0}};Tc=vy([Cy(2,te.u)],Tc);function by(r){return r.reduce((e,t)=>e+t,0)}var Sy=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},yy=function(r,e){return function(t,i){e(t,i,r)}},wy=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};class Dy extends I.jG{constructor(){super(...arguments),this.onDidChangeEmitter=new Z.vl,this.onDidChange=this.onDidChangeEmitter.event,this.hasCachedGhostText=!1,this.currentModelRef=this._register(new I.HE)}get targetModel(){var e;return(e=this.currentModelRef.value)===null||e===void 0?void 0:e.object}setTargetModel(e){var t;((t=this.currentModelRef.value)===null||t===void 0?void 0:t.object)!==e&&(this.currentModelRef.clear(),this.currentModelRef.value=e?Pb(e,e.onDidChange(()=>{this.hasCachedGhostText=!1,this.onDidChangeEmitter.fire()})):void 0,this.hasCachedGhostText=!1,this.onDidChangeEmitter.fire())}get ghostText(){var e,t;return this.hasCachedGhostText||(this.cachedGhostText=(t=(e=this.currentModelRef.value)===null||e===void 0?void 0:e.object)===null||t===void 0?void 0:t.ghostText,this.hasCachedGhostText=!0),this.cachedGhostText}setExpanded(e){var t;(t=this.targetModel)===null||t===void 0||t.setExpanded(e)}get minReservedLineCount(){return this.targetModel?this.targetModel.minReservedLineCount:0}}let Oc=class extends Dy{constructor(e,t){super(),this.editor=e,this.instantiationService=t,this.sharedCache=this._register(new xy),this.suggestWidgetAdapterModel=this._register(this.instantiationService.createInstance(Tc,this.editor,this.sharedCache)),this.inlineCompletionsModel=this._register(this.instantiationService.createInstance(wc,this.editor,this.sharedCache)),this._register(this.suggestWidgetAdapterModel.onDidChange(()=>{this.updateModel()})),this.updateModel()}get activeInlineCompletionsModel(){if(this.targetModel===this.inlineCompletionsModel)return this.inlineCompletionsModel}updateModel(){this.setTargetModel(this.suggestWidgetAdapterModel.isActive?this.suggestWidgetAdapterModel:this.inlineCompletionsModel),this.inlineCompletionsModel.setActive(this.targetModel===this.inlineCompletionsModel)}shouldShowHoverAt(e){var t;const i=(t=this.activeInlineCompletionsModel)===null||t===void 0?void 0:t.ghostText;return i?i.parts.some(n=>e.containsPosition(new ee.y(i.lineNumber,n.column))):!1}triggerInlineCompletion(){var e;(e=this.activeInlineCompletionsModel)===null||e===void 0||e.trigger(_e.qw.Explicit)}commitInlineCompletion(){var e;(e=this.activeInlineCompletionsModel)===null||e===void 0||e.commitCurrentSuggestion()}hideInlineCompletion(){var e;(e=this.activeInlineCompletionsModel)===null||e===void 0||e.hide()}showNextInlineCompletion(){var e;(e=this.activeInlineCompletionsModel)===null||e===void 0||e.showNext()}showPreviousInlineCompletion(){var e;(e=this.activeInlineCompletionsModel)===null||e===void 0||e.showPrevious()}hasMultipleInlineCompletions(){var e;return wy(this,void 0,void 0,function*(){const t=yield(e=this.activeInlineCompletionsModel)===null||e===void 0?void 0:e.hasMultipleInlineCompletions();return t!==void 0?t:!1})}};Oc=Sy([yy(1,he._Y)],Oc);class xy extends I.jG{constructor(){super(...arguments),this.onDidChangeEmitter=new Z.vl,this.onDidChange=this.onDidChangeEmitter.event,this.cache=this._register(new I.HE)}get value(){return this.cache.value}setValue(e,t,i){this.cache.value=new qb(t,e,()=>this.onDidChangeEmitter.fire(),i)}clearAndLeak(){return this.cache.clearAndLeak()}clear(){this.cache.clear()}}var Ly=f(57445),Af=f(54324),Fc=f(45561),Aa=f(39723),ky=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Nf=function(r,e){return function(t,i){e(t,i,r)}},Pc;const Mf=(Pc=window.trustedTypes)===null||Pc===void 0?void 0:Pc.createPolicy("editorGhostText",{createHTML:r=>r});let Wc=class extends I.jG{constructor(e,t,i,n){super(),this.editor=e,this.model=t,this.instantiationService=i,this.languageService=n,this.disposed=!1,this.partsWidget=this._register(this.instantiationService.createInstance(Ry,this.editor)),this.additionalLinesWidget=this._register(new Ey(this.editor,this.languageService.languageIdCodec)),this.viewMoreContentWidget=void 0,this.replacementDecoration=this._register(new Iy(this.editor)),this._register(this.editor.onDidChangeConfiguration(o=>{(o.hasChanged(29)||o.hasChanged(107)||o.hasChanged(90)||o.hasChanged(85)||o.hasChanged(47)||o.hasChanged(46)||o.hasChanged(61))&&this.update()})),this._register((0,I.s)(()=>{var o;this.disposed=!0,this.update(),(o=this.viewMoreContentWidget)===null||o===void 0||o.dispose(),this.viewMoreContentWidget=void 0})),this._register(t.onDidChange(()=>{this.update()})),this.update()}shouldShowHoverAtViewZone(e){return this.additionalLinesWidget.viewZoneId===e}update(){var e;const t=this.model.ghostText;if(!this.editor.hasModel()||!t||this.disposed){this.partsWidget.clear(),this.additionalLinesWidget.clear(),this.replacementDecoration.clear();return}const i=new Array,n=new Array;function o(c,d){if(n.length>0){const u=n[n.length-1];d&&u.decorations.push(new Fc.d(u.content.length+1,u.content.length+1+c[0].length,d,0)),u.content+=c[0],c=c.slice(1)}for(const u of c)n.push({content:u,decorations:d?[new Fc.d(1,u.length+1,d,0)]:[]})}t instanceof mf?this.replacementDecoration.setDecorations([{range:new L.Q(t.lineNumber,t.columnStart,t.lineNumber,t.columnStart+t.length),options:{inlineClassName:"inline-completion-text-to-replace",description:"GhostTextReplacement"}}]):this.replacementDecoration.setDecorations([]);const s=this.editor.getModel().getLineContent(t.lineNumber);let a,l=0;for(const c of t.parts){let d=c.lines;a===void 0?(i.push({column:c.column,text:d[0],preview:c.preview}),d=d.slice(1)):o([s.substring(l,c.column-1)],void 0),d.length>0&&(o(d,"ghost-text"),a===void 0&&c.column<=s.length&&(a=c.column)),l=c.column-1}a!==void 0&&o([s.substring(l)],void 0),this.partsWidget.setParts(t.lineNumber,i,a!==void 0?{column:a,length:s.length+1-a}:void 0),this.additionalLinesWidget.updateLines(t.lineNumber,n,t.additionalReservedLineCount),(e=this.viewMoreContentWidget)===null||e===void 0||e.dispose(),this.viewMoreContentWidget=void 0}renderViewMoreLines(e,t,i){const n=this.editor.getOption(46),o=document.createElement("div");o.className="suggest-preview-additional-widget",(0,$d.M)(o,n);const s=document.createElement("span");s.className="content-spacer",s.append(t),o.append(s);const a=document.createElement("span");a.className="content-newline suggest-preview-text",a.append("\u23CE  "),o.append(a);const l=new I.Cm,c=document.createElement("div");return c.className="button suggest-preview-text",c.append(`+${i} lines\u2026`),l.add(S.b2(c,"mousedown",d=>{var u;(u=this.model)===null||u===void 0||u.setExpanded(!0),d.preventDefault(),this.editor.focus()})),o.append(c),new Ny(this.editor,e,o,l)}};Wc=ky([Nf(2,he._Y),Nf(3,xt.L)],Wc);class Iy{constructor(e){this.editor=e,this.decorationIds=[]}setDecorations(e){this.editor.changeDecorations(t=>{this.decorationIds=t.deltaDecorations(this.decorationIds,e)})}clear(){this.setDecorations([])}dispose(){this.clear()}}class Ry{constructor(e){this.editor=e,this.decorationIds=[]}dispose(){this.clear()}clear(){this.editor.changeDecorations(e=>{this.decorationIds=e.deltaDecorations(this.decorationIds,[])})}setParts(e,t,i){if(!this.editor.getModel())return;const o=new Array;i&&o.push({range:L.Q.fromPositions(new ee.y(e,i.column),new ee.y(e,i.column+i.length)),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}}),this.editor.changeDecorations(s=>{this.decorationIds=s.deltaDecorations(this.decorationIds,t.map(a=>({range:L.Q.fromPositions(new ee.y(e,a.column)),options:{description:"ghost-text",after:{content:a.text,inlineClassName:a.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:We.VW.Left},showIfCollapsed:!0}})).concat(o))})}}class Ey{constructor(e,t){this.editor=e,this.languageIdCodec=t,this._viewZoneId=void 0}get viewZoneId(){return this._viewZoneId}dispose(){this.clear()}clear(){this.editor.changeViewZones(e=>{this._viewZoneId&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0)})}updateLines(e,t,i){const n=this.editor.getModel();if(!n)return;const{tabSize:o}=n.getOptions();this.editor.changeViewZones(s=>{this._viewZoneId&&(s.removeZone(this._viewZoneId),this._viewZoneId=void 0);const a=Math.max(t.length,i);if(a>0){const l=document.createElement("div");Ay(l,o,t,this.editor.getOptions(),this.languageIdCodec),this._viewZoneId=s.addZone({afterLineNumber:e,heightInLines:a,domNode:l,afterColumnAffinity:1})}})}}function Ay(r,e,t,i,n){const o=i.get(29),s=i.get(107),a="none",l=i.get(85),c=i.get(47),d=i.get(46),u=i.get(61),h=(0,Af.Du)(1e4);h.appendASCIIString('<div class="suggest-preview-text">');for(let v=0,w=t.length;v<w;v++){const R=t[v],T=R.content;h.appendASCIIString('<div class="view-line'),h.appendASCIIString('" style="top:'),h.appendASCIIString(String(v*u)),h.appendASCIIString('px;width:1000000px;">');const F=G.aC(T),B=G.E_(T),j=Ly.f.createEmpty(T,n);(0,Aa.UW)(new Aa.zL(d.isMonospace&&!o,d.canUseHalfwidthRightwardsArrow,T,!1,F,B,0,j,R.decorations,e,0,d.spaceWidth,d.middotWidth,d.wsmiddotWidth,s,a,l,c!==$e.Bc.OFF,null),h),h.appendASCIIString("</div>")}h.appendASCIIString("</div>"),(0,$d.M)(r,d);const p=h.build(),m=Mf?Mf.createHTML(p):p;r.innerHTML=m}class Ny extends I.jG{constructor(e,t,i,n){super(),this.editor=e,this.position=t,this.domNode=i,this.allowEditorOverflow=!1,this.suppressMouseDown=!1,this._register(n),this._register((0,I.s)(()=>{this.editor.removeContentWidget(this)})),this.editor.addContentWidget(this)}getId(){return"editor.widget.viewMoreLinesWidget"}getDomNode(){return this.domNode}getPosition(){return{position:this.position,preference:[0]}}}(0,U.zy)((r,e)=>{const t=r.getColor(Qi.Ek);t&&(e.addRule(`.monaco-editor .ghost-text-decoration { color: ${t.toString()} !important; }`),e.addRule(`.monaco-editor .ghost-text-decoration-preview { color: ${t.toString()} !important; }`),e.addRule(`.monaco-editor .suggest-preview-text .ghost-text { color: ${t.toString()} !important; }`));const i=r.getColor(Qi.RH);i&&(e.addRule(`.monaco-editor .ghost-text-decoration { background-color: ${i.toString()}; }`),e.addRule(`.monaco-editor .ghost-text-decoration-preview { background-color: ${i.toString()}; }`),e.addRule(`.monaco-editor .suggest-preview-text .ghost-text { background-color: ${i.toString()}; }`));const n=r.getColor(Qi.DH);n&&(e.addRule(`.monaco-editor .suggest-preview-text .ghost-text { border: 1px solid ${n}; }`),e.addRule(`.monaco-editor .ghost-text-decoration { border: 1px solid ${n}; }`),e.addRule(`.monaco-editor .ghost-text-decoration-preview { border: 1px solid ${n}; }`))});var Tf=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Bc=function(r,e){return function(t,i){e(t,i,r)}},Na=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};let Te=class mm extends I.jG{constructor(e,t){super(),this.editor=e,this.instantiationService=t,this.triggeredExplicitly=!1,this.activeController=this._register(new I.HE),this.activeModelDidChangeEmitter=this._register(new Z.vl),this._register(this.editor.onDidChangeModel(()=>{this.updateModelController()})),this._register(this.editor.onDidChangeConfiguration(i=>{i.hasChanged(108)&&this.updateModelController(),i.hasChanged(57)&&this.updateModelController()})),this.updateModelController()}static get(e){return e.getContribution(mm.ID)}get activeModel(){var e;return(e=this.activeController.value)===null||e===void 0?void 0:e.model}updateModelController(){const e=this.editor.getOption(108),t=this.editor.getOption(57);this.activeController.value=void 0,this.activeController.value=this.editor.hasModel()&&(e.preview||t.enabled||this.triggeredExplicitly)?this.instantiationService.createInstance(Hc,this.editor):void 0,this.activeModelDidChangeEmitter.fire()}shouldShowHoverAt(e){var t;return((t=this.activeModel)===null||t===void 0?void 0:t.shouldShowHoverAt(e))||!1}shouldShowHoverAtViewZone(e){var t,i;return((i=(t=this.activeController.value)===null||t===void 0?void 0:t.widget)===null||i===void 0?void 0:i.shouldShowHoverAtViewZone(e))||!1}trigger(){var e;this.triggeredExplicitly=!0,this.activeController.value||this.updateModelController(),(e=this.activeModel)===null||e===void 0||e.triggerInlineCompletion()}commit(){var e;(e=this.activeModel)===null||e===void 0||e.commitInlineCompletion()}hide(){var e;(e=this.activeModel)===null||e===void 0||e.hideInlineCompletion()}showNextInlineCompletion(){var e;(e=this.activeModel)===null||e===void 0||e.showNextInlineCompletion()}showPreviousInlineCompletion(){var e;(e=this.activeModel)===null||e===void 0||e.showPreviousInlineCompletion()}hasMultipleInlineCompletions(){var e;return Na(this,void 0,void 0,function*(){const t=yield(e=this.activeModel)===null||e===void 0?void 0:e.hasMultipleInlineCompletions();return t!==void 0?t:!1})}};Te.inlineSuggestionVisible=new A.N1("inlineSuggestionVisible",!1,g.kg("inlineSuggestionVisible","Whether an inline suggestion is visible")),Te.inlineSuggestionHasIndentation=new A.N1("inlineSuggestionHasIndentation",!1,g.kg("inlineSuggestionHasIndentation","Whether the inline suggestion starts with whitespace")),Te.inlineSuggestionHasIndentationLessThanTabSize=new A.N1("inlineSuggestionHasIndentationLessThanTabSize",!0,g.kg("inlineSuggestionHasIndentationLessThanTabSize","Whether the inline suggestion starts with whitespace that is less than what would be inserted by tab")),Te.ID="editor.contrib.ghostTextController",Te=Tf([Bc(1,he._Y)],Te);class My{constructor(e){this.contextKeyService=e,this.inlineCompletionVisible=Te.inlineSuggestionVisible.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentation=Te.inlineSuggestionHasIndentation.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentationLessThanTabSize=Te.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService)}}let Hc=class extends I.jG{constructor(e,t,i){super(),this.editor=e,this.instantiationService=t,this.contextKeyService=i,this.contextKeys=new My(this.contextKeyService),this.model=this._register(this.instantiationService.createInstance(Oc,this.editor)),this.widget=this._register(this.instantiationService.createInstance(Wc,this.editor,this.model)),this._register((0,I.s)(()=>{this.contextKeys.inlineCompletionVisible.set(!1),this.contextKeys.inlineCompletionSuggestsIndentation.set(!1),this.contextKeys.inlineCompletionSuggestsIndentationLessThanTabSize.set(!0)})),this._register(this.model.onDidChange(()=>{this.updateContextKeys()})),this.updateContextKeys()}updateContextKeys(){var e;this.contextKeys.inlineCompletionVisible.set(((e=this.model.activeInlineCompletionsModel)===null||e===void 0?void 0:e.ghostText)!==void 0);let t=!1,i=!0;const n=this.model.inlineCompletionsModel.ghostText;if(this.model.activeInlineCompletionsModel&&n&&n.parts.length>0){const{column:o,lines:s}=n.parts[0],a=s[0],l=this.editor.getModel().getLineIndentColumn(n.lineNumber);if(o<=l){let d=(0,G.HG)(a);d===-1&&(d=a.length-1),t=d>0;const u=this.editor.getModel().getOptions().tabSize;i=Fb.A.visibleColumnFromColumn(a,d+1,u)<u}}this.contextKeys.inlineCompletionSuggestsIndentation.set(t),this.contextKeys.inlineCompletionSuggestsIndentationLessThanTabSize.set(i)}};Hc=Tf([Bc(1,he._Y),Bc(2,A.fN)],Hc);class mo extends _.ks{constructor(){super({id:mo.ID,label:g.kg("action.inlineSuggest.showNext","Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:A.M$.and(D.R.writable,Te.inlineSuggestionVisible),kbOpts:{weight:100,primary:601}})}run(e,t){return Na(this,void 0,void 0,function*(){const i=Te.get(t);i&&(i.showNextInlineCompletion(),t.focus())})}}mo.ID="editor.action.inlineSuggest.showNext";class _o extends _.ks{constructor(){super({id:_o.ID,label:g.kg("action.inlineSuggest.showPrevious","Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:A.M$.and(D.R.writable,Te.inlineSuggestionVisible),kbOpts:{weight:100,primary:599}})}run(e,t){return Na(this,void 0,void 0,function*(){const i=Te.get(t);i&&(i.showPreviousInlineCompletion(),t.focus())})}}_o.ID="editor.action.inlineSuggest.showPrevious";class Ty extends _.ks{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:g.kg("action.inlineSuggest.trigger","Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:D.R.writable})}run(e,t){return Na(this,void 0,void 0,function*(){const i=Te.get(t);i&&i.trigger()})}}var Oy=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},vo=function(r,e){return function(t,i){e(t,i,r)}};class Fy{constructor(e,t,i){this.owner=e,this.range=t,this.controller=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}hasMultipleSuggestions(){return this.controller.hasMultipleInlineCompletions()}get commands(){var e,t,i;return((i=(t=(e=this.controller.activeModel)===null||e===void 0?void 0:e.activeInlineCompletionsModel)===null||t===void 0?void 0:t.completionSession.value)===null||i===void 0?void 0:i.commands)||[]}}let Vc=class{constructor(e,t,i,n,o,s,a){this._editor=e,this._commandService=t,this._menuService=i,this._contextKeyService=n,this._languageService=o,this._openerService=s,this.accessibilityService=a,this.hoverOrdinal=3}suggestHoverAnchor(e){const t=Te.get(this._editor);if(!t)return null;const i=e.target;if(i.type===8){const n=i.detail;if(t.shouldShowHoverAtViewZone(n.viewZoneId))return new Ur(1e3,this,L.Q.fromPositions(n.positionBefore||n.position,n.positionBefore||n.position))}return i.type===7&&t.shouldShowHoverAt(i.range)?new Ur(1e3,this,i.range):i.type===6&&i.detail.mightBeForeignElement&&t.shouldShowHoverAt(i.range)?new Ur(1e3,this,i.range):null}computeSync(e,t){const i=Te.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new Fy(this,e.range,i)]:[]}renderHoverParts(e,t){const i=new I.Cm,n=t[0];this.accessibilityService.isScreenReaderOptimized()&&this.renderScreenReaderText(e,n,i);const o=i.add(this._menuService.createMenu(z.D8.InlineCompletionsActions,this._contextKeyService)),s=e.statusBar.addAction({label:g.kg("showNextInlineSuggestion","Next"),commandId:mo.ID,run:()=>this._commandService.executeCommand(mo.ID)}),a=e.statusBar.addAction({label:g.kg("showPreviousInlineSuggestion","Previous"),commandId:_o.ID,run:()=>this._commandService.executeCommand(_o.ID)});e.statusBar.addAction({label:g.kg("acceptInlineSuggestion","Accept"),commandId:wa,run:()=>this._commandService.executeCommand(wa)});const l=[s,a];for(const c of l)c.setEnabled(!1);n.hasMultipleSuggestions().then(c=>{for(const d of l)d.setEnabled(c)});for(const c of n.commands)e.statusBar.addAction({label:c.title,commandId:c.id,run:()=>this._commandService.executeCommand(c.id,...c.arguments||[])});for(const[c,d]of o.getActions())for(const u of d)u instanceof z.Xe&&e.statusBar.addAction({label:u.label,commandId:u.item.id,run:()=>this._commandService.executeCommand(u.item.id)});return i}renderScreenReaderText(e,t,i){var n,o;const s=S.$,a=s("div.hover-row.markdown-hover"),l=S.BC(a,s("div.hover-contents")),c=i.add(new li({editor:this._editor},this._languageService,this._openerService)),d=h=>{i.add(c.onDidRenderAsync(()=>{l.className="hover-contents code-hover-contents",e.onContentsChanged()}));const p=g.kg("inlineSuggestionFollows","Suggestion:"),m=i.add(c.render(new xe.Bc().appendText(p).appendCodeblock("text",h)));l.replaceChildren(m.element)},u=(o=(n=t.controller.activeModel)===null||n===void 0?void 0:n.inlineCompletionsModel)===null||o===void 0?void 0:o.ghostText;if(u){const h=this._editor.getModel().getLineContent(u.lineNumber);d(u.renderForScreenReader(h))}e.fragment.appendChild(a)}};Vc=Oy([vo(1,fe.wT),vo(2,z.ez),vo(3,A.fN),vo(4,xt.L),vo(5,pt.Cr),vo(6,Qn.j)],Vc),(0,_.HW)(Te.ID,Te),(0,_.Fl)(Ty),(0,_.Fl)(mo),(0,_.Fl)(_o),an.register(Vc);const Of=_.DX.bindToContribution(Te.get),Uc=new Of({id:wa,precondition:Te.inlineSuggestionVisible,handler(r){r.commit(),r.editor.focus()}});(0,_.E_)(Uc),Pt.f.registerKeybindingRule({primary:2,weight:200,id:Uc.id,when:A.M$.and(Uc.precondition,D.R.tabMovesFocus.toNegated(),Te.inlineSuggestionHasIndentationLessThanTabSize)}),(0,_.E_)(new Of({id:"editor.action.inlineSuggest.hide",precondition:Te.inlineSuggestionVisible,kbOpts:{weight:100,primary:9},handler(r){r.hide()}}));var Co=f(41672);function ht(r,e){let t=0;for(let i=0;i<r.length;i++)r.charAt(i)==="	"?t+=e:t++;return t}function Vs(r,e,t){r=r<0?0:r;let i="";if(!t){const n=Math.floor(r/e);r=r%e;for(let o=0;o<n;o++)i+="	"}for(let n=0;n<r;n++)i+=" ";return i}var Ff=f(57999),vn=f(70645),Py=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Wy=function(r,e){return function(t,i){e(t,i,r)}};function Pf(r,e,t,i,n){if(r.getLineCount()===1&&r.getLineMaxColumn(1)===1)return[];const o=e.getLanguageConfiguration(r.getLanguageId()).indentationRules;if(!o)return[];for(i=Math.min(i,r.getLineCount());t<=i&&o.unIndentedLinePattern;){const w=r.getLineContent(t);if(!o.unIndentedLinePattern.test(w))break;t++}if(t>i-1)return[];const{tabSize:s,indentSize:a,insertSpaces:l}=r.getOptions(),c=(w,R)=>(R=R||1,Co.Y.shiftIndent(w,w.length+R,s,a,l)),d=(w,R)=>(R=R||1,Co.Y.unshiftIndent(w,w.length+R,s,a,l)),u=[];let h;const p=r.getLineContent(t);let m=p;if(n!=null){h=n;const w=G.UU(p);m=h+p.substring(w.length),o.decreaseIndentPattern&&o.decreaseIndentPattern.test(m)&&(h=d(h),m=h+p.substring(w.length)),p!==m&&u.push(Le.k.replaceMove(new q.L(t,1,t,w.length+1),(0,Ff.P)(h,a,l)))}else h=G.UU(p);let v=h;o.increaseIndentPattern&&o.increaseIndentPattern.test(m)?(v=c(v),h=c(h)):o.indentNextLinePattern&&o.indentNextLinePattern.test(m)&&(v=c(v)),t++;for(let w=t;w<=i;w++){const R=r.getLineContent(w),T=G.UU(R),F=v+R.substring(T.length);o.decreaseIndentPattern&&o.decreaseIndentPattern.test(F)&&(v=d(v),h=d(h)),T!==v&&u.push(Le.k.replaceMove(new q.L(w,1,w,T.length+1),(0,Ff.P)(v,a,l))),!(o.unIndentedLinePattern&&o.unIndentedLinePattern.test(R))&&(o.increaseIndentPattern&&o.increaseIndentPattern.test(F)?(h=c(h),v=h):o.indentNextLinePattern&&o.indentNextLinePattern.test(F)?v=c(v):v=h)}return u}class Ma extends _.ks{constructor(){super({id:Ma.ID,label:g.kg("indentationToSpaces","Convert Indentation to Spaces"),alias:"Convert Indentation to Spaces",precondition:D.R.writable})}run(e,t){const i=t.getModel();if(!i)return;const n=i.getOptions(),o=t.getSelection();if(!o)return;const s=new Uy(o,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop(),i.updateOptions({insertSpaces:!0})}}Ma.ID="editor.action.indentationToSpaces";class Ta extends _.ks{constructor(){super({id:Ta.ID,label:g.kg("indentationToTabs","Convert Indentation to Tabs"),alias:"Convert Indentation to Tabs",precondition:D.R.writable})}run(e,t){const i=t.getModel();if(!i)return;const n=i.getOptions(),o=t.getSelection();if(!o)return;const s=new zy(o,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop(),i.updateOptions({insertSpaces:!1})}}Ta.ID="editor.action.indentationToTabs";class Wf extends _.ks{constructor(e,t){super(t),this.insertSpaces=e}run(e,t){const i=e.get(en.GK),n=e.get($t.S),o=t.getModel();if(!o)return;const s=n.getCreationOptions(o.getLanguageId(),o.uri,o.isForSimpleWidget),a=[1,2,3,4,5,6,7,8].map(c=>({id:c.toString(),label:c.toString(),description:c===s.tabSize?g.kg("configuredTabSize","Configured Tab Size"):void 0})),l=Math.min(o.getOptions().tabSize-1,7);setTimeout(()=>{i.pick(a,{placeHolder:g.kg({key:"selectTabWidth",comment:["Tab corresponds to the tab key"]},"Select Tab Size for Current File"),activeItem:a[l]}).then(c=>{c&&o&&!o.isDisposed()&&o.updateOptions({tabSize:parseInt(c.label,10),insertSpaces:this.insertSpaces})})},50)}}class Oa extends Wf{constructor(){super(!1,{id:Oa.ID,label:g.kg("indentUsingTabs","Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0})}}Oa.ID="editor.action.indentUsingTabs";class Fa extends Wf{constructor(){super(!0,{id:Fa.ID,label:g.kg("indentUsingSpaces","Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0})}}Fa.ID="editor.action.indentUsingSpaces";class Pa extends _.ks{constructor(){super({id:Pa.ID,label:g.kg("detectIndentation","Detect Indentation from Content"),alias:"Detect Indentation from Content",precondition:void 0})}run(e,t){const i=e.get($t.S),n=t.getModel();if(!n)return;const o=i.getCreationOptions(n.getLanguageId(),n.uri,n.isForSimpleWidget);n.detectIndentation(o.insertSpaces,o.tabSize)}}Pa.ID="editor.action.detectIndentation";class By extends _.ks{constructor(){super({id:"editor.action.reindentlines",label:g.kg("editor.reindentlines","Reindent Lines"),alias:"Reindent Lines",precondition:D.R.writable})}run(e,t){const i=e.get(it.JZ),n=t.getModel();if(!n)return;const o=Pf(n,i,1,n.getLineCount());o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}}class Hy extends _.ks{constructor(){super({id:"editor.action.reindentselectedlines",label:g.kg("editor.reindentselectedlines","Reindent Selected Lines"),alias:"Reindent Selected Lines",precondition:D.R.writable})}run(e,t){const i=e.get(it.JZ),n=t.getModel();if(!n)return;const o=t.getSelections();if(o===null)return;const s=[];for(const a of o){let l=a.startLineNumber,c=a.endLineNumber;if(l!==c&&a.endColumn===1&&c--,l===1){if(l===c)continue}else l--;const d=Pf(n,i,l,c);s.push(...d)}s.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop())}}class Vy{constructor(e,t){this._initialSelection=t,this._edits=[],this._selectionId=null;for(const i of e)i.range&&typeof i.text=="string"&&this._edits.push(i)}getEditOperations(e,t){for(const n of this._edits)t.addEditOperation(L.Q.lift(n.range),n.text);let i=!1;Array.isArray(this._edits)&&this._edits.length===1&&this._initialSelection.isEmpty()&&(this._edits[0].range.startColumn===this._initialSelection.endColumn&&this._edits[0].range.startLineNumber===this._initialSelection.endLineNumber?(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!0)):this._edits[0].range.endColumn===this._initialSelection.startColumn&&this._edits[0].range.endLineNumber===this._initialSelection.startLineNumber&&(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!1))),i||(this._selectionId=t.trackSelection(this._initialSelection))}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}let Us=class{constructor(e,t){this.editor=e,this._languageConfigurationService=t,this.callOnDispose=new I.Cm,this.callOnModel=new I.Cm,this.callOnDispose.add(e.onDidChangeConfiguration(()=>this.update())),this.callOnDispose.add(e.onDidChangeModel(()=>this.update())),this.callOnDispose.add(e.onDidChangeModelLanguage(()=>this.update()))}update(){this.callOnModel.clear(),!(this.editor.getOption(9)<4||this.editor.getOption(50))&&this.editor.hasModel()&&this.callOnModel.add(this.editor.onDidPaste(({range:e})=>{this.trigger(e)}))}trigger(e){const t=this.editor.getSelections();if(t===null||t.length>1)return;const i=this.editor.getModel();if(!i||!i.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const n=this.editor.getOption(9),{tabSize:o,indentSize:s,insertSpaces:a}=i.getOptions(),l=[],c={shiftIndent:p=>Co.Y.shiftIndent(p,p.length+1,o,s,a),unshiftIndent:p=>Co.Y.unshiftIndent(p,p.length+1,o,s,a)};let d=e.startLineNumber;for(;d<=e.endLineNumber;){if(this.shouldIgnoreLine(i,d)){d++;continue}break}if(d>e.endLineNumber)return;let u=i.getLineContent(d);if(!/\S/.test(u.substring(0,e.startColumn-1))){const p=(0,vn.$f)(n,i,i.getLanguageId(),d,c,this._languageConfigurationService);if(p!==null){const m=G.UU(u),v=ht(p,o),w=ht(m,o);if(v!==w){const R=Vs(v,o,a);l.push({range:new L.Q(d,1,d,m.length+1),text:R}),u=R+u.substr(m.length)}else{const R=(0,vn.Yb)(i,d,this._languageConfigurationService);if(R===0||R===8)return}}}const h=d;for(;d<e.endLineNumber;){if(!/\S/.test(i.getLineContent(d+1))){d++;continue}break}if(d!==e.endLineNumber){const p={tokenization:{getLineTokens:v=>i.tokenization.getLineTokens(v),getLanguageId:()=>i.getLanguageId(),getLanguageIdAtPosition:(v,w)=>i.getLanguageIdAtPosition(v,w)},getLineContent:v=>v===h?u:i.getLineContent(v)},m=(0,vn.$f)(n,p,i.getLanguageId(),d+1,c,this._languageConfigurationService);if(m!==null){const v=ht(m,o),w=ht(G.UU(i.getLineContent(d+1)),o);if(v!==w){const R=v-w;for(let T=d+1;T<=e.endLineNumber;T++){const F=i.getLineContent(T),B=G.UU(F),ve=ht(B,o)+R,ie=Vs(ve,o,a);ie!==B&&l.push({range:new L.Q(T,1,T,B.length+1),text:ie})}}}}if(l.length>0){this.editor.pushUndoStop();const p=new Vy(l,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",p),this.editor.pushUndoStop()}}shouldIgnoreLine(e,t){e.tokenization.forceTokenization(t);const i=e.getLineFirstNonWhitespaceColumn(t);if(i===0)return!0;const n=e.tokenization.getLineTokens(t);if(n.getCount()>0){const o=n.findTokenIndexAtOffset(i);if(o>=0&&n.getStandardTokenType(o)===1)return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}};Us.ID="editor.contrib.autoIndentOnPaste",Us=Py([Wy(1,it.JZ)],Us);function Bf(r,e,t,i){if(r.getLineCount()===1&&r.getLineMaxColumn(1)===1)return;let n="";for(let s=0;s<t;s++)n+=" ";const o=new RegExp(n,"gi");for(let s=1,a=r.getLineCount();s<=a;s++){let l=r.getLineFirstNonWhitespaceColumn(s);if(l===0&&(l=r.getLineMaxColumn(s)),l===1)continue;const c=new L.Q(s,1,s,l),d=r.getValueInRange(c),u=i?d.replace(/\t/ig,n):d.replace(o,"	");e.addEditOperation(c,u)}}class Uy{constructor(e,t){this.selection=e,this.tabSize=t,this.selectionId=null}getEditOperations(e,t){this.selectionId=t.trackSelection(this.selection),Bf(e,t,this.tabSize,!0)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}}class zy{constructor(e,t){this.selection=e,this.tabSize=t,this.selectionId=null}getEditOperations(e,t){this.selectionId=t.trackSelection(this.selection),Bf(e,t,this.tabSize,!1)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}}(0,_.HW)(Us.ID,Us),(0,_.Fl)(Ma),(0,_.Fl)(Ta),(0,_.Fl)(Oa),(0,_.Fl)(Fa),(0,_.Fl)(Pa),(0,_.Fl)(By),(0,_.Fl)(Hy);var Wa=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};class Hf{constructor(e,t){this.range=e,this.direction=t}}class zc{constructor(e,t,i){this.hint=e,this.anchor=t,this.provider=i,this._isResolved=!1}with(e){const t=new zc(this.hint,e.anchor,this.provider);return t._isResolved=this._isResolved,t._currentResolve=this._currentResolve,t}resolve(e){return Wa(this,void 0,void 0,function*(){if(typeof this.provider.resolveInlayHint=="function"){if(this._currentResolve)return yield this._currentResolve,e.isCancellationRequested?void 0:this.resolve(e);this._isResolved||(this._currentResolve=this._doResolve(e).finally(()=>this._currentResolve=void 0)),yield this._currentResolve}})}_doResolve(e){var t,i;return Wa(this,void 0,void 0,function*(){try{const n=yield Promise.resolve(this.provider.resolveInlayHint(this.hint,e));this.hint.tooltip=(t=n?.tooltip)!==null&&t!==void 0?t:this.hint.tooltip,this.hint.label=(i=n?.label)!==null&&i!==void 0?i:this.hint.label,this._isResolved=!0}catch(n){(0,K.M_)(n),this._isResolved=!1}})}}class zs{constructor(e,t,i){this._disposables=new I.Cm,this.ranges=e,this.provider=new Set;const n=[];for(const[o,s]of t){this._disposables.add(o),this.provider.add(s);for(const a of o.hints){const l=i.validatePosition(a.position);let c="before";const d=zs._getRangeAtPosition(i,l);let u;d.getStartPosition().isBefore(l)?(u=L.Q.fromPositions(d.getStartPosition(),l),c="after"):(u=L.Q.fromPositions(l,d.getEndPosition()),c="before"),n.push(new zc(a,new Hf(u,c),s))}}this.items=n.sort((o,s)=>ee.y.compare(o.hint.position,s.hint.position))}static create(e,t,i,n){return Wa(this,void 0,void 0,function*(){const o=[],s=e.ordered(t).reverse().map(a=>i.map(l=>Wa(this,void 0,void 0,function*(){try{const c=yield a.provideInlayHints(t,l,n);c?.hints.length&&o.push([c,a])}catch(c){(0,K.M_)(c)}})));if(yield Promise.all(s.flat()),n.isCancellationRequested||t.isDisposed())throw new K.AL;return new zs(i,o,t)})}dispose(){this._disposables.dispose()}static _getRangeAtPosition(e,t){const i=t.lineNumber,n=e.getWordAtPosition(t);if(n)return new L.Q(i,n.startColumn,i,n.endColumn);e.tokenization.tokenizeIfCheap(i);const o=e.tokenization.getLineTokens(i),s=t.column-1,a=o.findTokenIndexAtOffset(s);let l=o.getStartOffset(a),c=o.getEndOffset(a);return c-l===1&&(l===s&&a>1?(l=o.getStartOffset(a-1),c=o.getEndOffset(a-1)):c===s&&a<o.getCount()-1&&(l=o.getStartOffset(a+1),c=o.getEndOffset(a+1))),new L.Q(i,l+1,i,c+1)}}function $y(r){return me.r.from({scheme:Xe.ny.command,path:r.id,query:r.arguments&&encodeURIComponent(JSON.stringify(r.arguments))}).toString()}var $s=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};function jy(r,e,t,i){var n;return $s(this,void 0,void 0,function*(){const o=r.get(Ft.b),s=r.get(ni.Z),a=r.get(fe.wT),l=r.get(he._Y),c=r.get(Ye.Ot);if(yield i.item.resolve(re.X.None),!i.part.location)return;const d=i.part.location,u=[],h=new Set(z.ZG.getMenuItems(z.D8.EditorContext).map(m=>(0,z.is)(m)?m.command.id:""));for(const m of _.dS.getEditorActions())m instanceof kt&&h.has(m.id)&&u.push(new He.rc(m.id,m.label,void 0,!0,()=>$s(this,void 0,void 0,function*(){const v=yield o.createModelReference(d.uri);try{yield l.invokeFunction(m.run.bind(m),e,new fs(v.object.textEditorModel,L.Q.getStartPosition(d.range)))}finally{v.dispose()}})));if(i.part.command){const{command:m}=i.part;u.push(new He.wv),u.push(new He.rc(m.id,m.title,void 0,!0,()=>$s(this,void 0,void 0,function*(){var v;try{yield a.executeCommand(m.id,...(v=m.arguments)!==null&&v!==void 0?v:[])}catch(w){c.notify({severity:Ye.AI.Error,source:i.item.provider.displayName,message:w})}})))}const p=e.getOption(117);s.showContextMenu({domForShadowRoot:p&&(n=e.getDomNode())!==null&&n!==void 0?n:void 0,getAnchor:()=>{const m=S.BK(t);return{x:m.left,y:m.top+m.height+8}},getActions:()=>u,onHide:()=>{e.focus()},autoSelectFirstItem:!0})})}function Gy(r,e,t,i){return $s(this,void 0,void 0,function*(){const o=yield r.get(Ft.b).createModelReference(i.uri);yield t.invokeWithinContext(s=>$s(this,void 0,void 0,function*(){const a=e.hasSideBySideModifier,l=s.get(A.fN),c=ot.inPeekEditor.getValue(l),d=!a&&t.getOption(80)&&!c;return new ps({openToSide:a,openInPeek:d,muteMessage:!0},{alias:"",label:"",id:"",precondition:void 0}).run(s,t,{model:o.object.textEditorModel,position:L.Q.getStartPosition(i.range)})})),o.dispose()})}var Ky=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},bo=function(r,e){return function(t,i){e(t,i,r)}},So=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};class Ba{constructor(){this._entries=new Ji.qK(50)}get(e){const t=Ba._key(e);return this._entries.get(t)}set(e,t){const i=Ba._key(e);this._entries.set(i,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}const Vf=(0,he.u1)("IInlayHintsCache");(0,qi.v)(Vf,Ba,!0);class $c{constructor(e,t){this.item=e,this.index=t}get part(){const e=this.item.hint.label;return typeof e=="string"?{label:e}:e[this.index]}}class Qy{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}let Cn=class Hu{constructor(e,t,i,n,o,s,a){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=n,this._commandService=o,this._notificationService=s,this._instaService=a,this._disposables=new I.Cm,this._sessionDisposables=new I.Cm,this._decorationsMetadata=new Map,this._ruleFactory=new Sh.Qn(this._editor),this._activeRenderMode=0,this._debounceInfo=i.for(t.inlayHintsProvider,"InlayHint",{min:25}),this._disposables.add(t.inlayHintsProvider.onDidChange(()=>this._update())),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(l=>{l.hasChanged(129)&&this._update()})),this._update()}static get(e){var t;return(t=e.getContribution(Hu.ID))!==null&&t!==void 0?t:void 0}dispose(){this._sessionDisposables.dispose(),this._removeAllDecorations(),this._disposables.dispose()}_update(){this._sessionDisposables.clear(),this._removeAllDecorations();const e=this._editor.getOption(129);if(e.enabled==="off")return;const t=this._editor.getModel();if(!t||!this._languageFeaturesService.inlayHintsProvider.has(t))return;const i=this._inlayHintsCache.get(t);i&&this._updateHintsDecorators([t.getFullModelRange()],i),this._sessionDisposables.add((0,I.s)(()=>{t.isDisposed()||this._cacheHintsForFastRestore(t)}));let n;const o=new Set,s=new V.uC(()=>So(this,void 0,void 0,function*(){const a=Date.now();n?.dispose(!0),n=new re.Q;const l=t.onWillDispose(()=>n?.cancel());try{const c=n.token,d=yield zs.create(this._languageFeaturesService.inlayHintsProvider,t,this._getHintsRanges(),c);if(s.delay=this._debounceInfo.update(t,Date.now()-a),c.isCancellationRequested){d.dispose();return}for(const u of d.provider)typeof u.onDidChangeInlayHints=="function"&&!o.has(u)&&(o.add(u),this._sessionDisposables.add(u.onDidChangeInlayHints(()=>{s.isScheduled()||s.schedule()})));this._sessionDisposables.add(d),this._updateHintsDecorators(d.ranges,d.items),this._cacheHintsForFastRestore(t)}catch(c){(0,K.dz)(c)}finally{n.dispose(),l.dispose()}}),this._debounceInfo.get(t));if(this._sessionDisposables.add(s),this._sessionDisposables.add((0,I.s)(()=>n?.dispose(!0))),s.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange(a=>{(a.scrollTopChanged||!s.isScheduled())&&s.schedule()})),this._sessionDisposables.add(this._editor.onDidChangeModelContent(a=>{const l=Math.max(s.delay,1250);s.schedule(l)})),e.enabled==="on")this._activeRenderMode=0;else{let a,l;e.enabled==="onUnlessPressed"?(a=0,l=1):(a=1,l=0),this._activeRenderMode=a,this._sessionDisposables.add(S.Di.getInstance().event(c=>{if(!this._editor.hasModel())return;const d=c.altKey&&c.ctrlKey?l:a;if(d!==this._activeRenderMode){this._activeRenderMode=d;const u=this._editor.getModel(),h=this._copyInlayHintsWithCurrentAnchor(u);this._updateHintsDecorators([u.getFullModelRange()],h),s.schedule(0)}}))}this._sessionDisposables.add(this._installDblClickGesture(()=>s.schedule(0))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const e=new I.Cm,t=e.add(new ad(this._editor)),i=new I.Cm;return e.add(i),e.add(t.onMouseMoveOrRelevantKeyDown(n=>{const[o]=n,s=this._getInlayHintLabelPart(o),a=this._editor.getModel();if(!s||!a){i.clear();return}const l=new re.Q;i.add((0,I.s)(()=>l.dispose(!0))),s.item.resolve(l.token),this._activeInlayHintPart=s.part.command||s.part.location?new Qy(s,o.hasTriggerModifier):void 0;const c=s.item.hint.position.lineNumber,d=new L.Q(c,1,c,a.getLineMaxColumn(c)),u=this._getInlineHintsForRange(d);this._updateHintsDecorators([d],u),i.add((0,I.s)(()=>{this._activeInlayHintPart=void 0,this._updateHintsDecorators([d],u)}))})),e.add(t.onCancel(()=>i.clear())),e.add(t.onExecute(n=>So(this,void 0,void 0,function*(){const o=this._getInlayHintLabelPart(n);if(o){const s=o.part;s.location?this._instaService.invokeFunction(Gy,n,this._editor,s.location):_e.uB.is(s.command)&&(yield this._invokeCommand(s.command,o.item))}}))),e}_getInlineHintsForRange(e){const t=new Set;for(const i of this._decorationsMetadata.values())e.containsRange(i.item.anchor.range)&&t.add(i.item);return Array.from(t)}_installDblClickGesture(e){return this._editor.onMouseUp(t=>So(this,void 0,void 0,function*(){if(t.event.detail!==2)return;const i=this._getInlayHintLabelPart(t);if(i&&(t.event.preventDefault(),yield i.item.resolve(re.X.None),(0,pe.EI)(i.item.hint.textEdits))){const n=i.item.hint.textEdits.map(o=>Le.k.replace(L.Q.lift(o.range),o.text));this._editor.executeEdits("inlayHint.default",n),e()}}))}_installContextMenu(){return this._editor.onContextMenu(e=>So(this,void 0,void 0,function*(){if(!(e.event.target instanceof HTMLElement))return;const t=this._getInlayHintLabelPart(e);t&&(yield this._instaService.invokeFunction(jy,this._editor,e.event.target,t))}))}_getInlayHintLabelPart(e){var t;if(e.target.type!==6)return;const i=(t=e.target.detail.injectedText)===null||t===void 0?void 0:t.options;if(i instanceof ge.Ho&&i?.attachedData instanceof $c)return i.attachedData}_invokeCommand(e,t){var i;return So(this,void 0,void 0,function*(){try{yield this._commandService.executeCommand(e.id,...(i=e.arguments)!==null&&i!==void 0?i:[])}catch(n){this._notificationService.notify({severity:Ye.AI.Error,source:t.provider.displayName,message:n})}})}_cacheHintsForFastRestore(e){const t=this._copyInlayHintsWithCurrentAnchor(e);this._inlayHintsCache.set(e,t)}_copyInlayHintsWithCurrentAnchor(e){const t=new Map;for(const[i,n]of this._decorationsMetadata){if(t.has(n.item))continue;const o=e.getDecorationRange(i);if(o){const s=new Hf(o,n.item.anchor.direction),a=n.item.with({anchor:s});t.set(n.item,a)}}return Array.from(t.values())}_getHintsRanges(){const t=this._editor.getModel(),i=this._editor.getVisibleRangesPlusViewportAboveBelow(),n=[];for(const o of i.sort(L.Q.compareRangesUsingStarts)){const s=t.validateRange(new L.Q(o.startLineNumber-30,o.startColumn,o.endLineNumber+30,o.endColumn));n.length===0||!L.Q.areIntersectingOrTouching(n[n.length-1],s)?n.push(s):n[n.length-1]=L.Q.plusRange(n[n.length-1],s)}return n}_updateHintsDecorators(e,t){var i,n;const o=[],s=(m,v,w,R,T)=>{const F={content:w,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:v.className,cursorStops:R,attachedData:T};o.push({item:m,classNameRef:v,decoration:{range:m.anchor.range,options:{description:"InlayHint",showIfCollapsed:m.anchor.range.isEmpty(),collapseOnReplaceEdit:!m.anchor.range.isEmpty(),stickiness:0,[m.anchor.direction]:this._activeRenderMode===0?F:void 0}}})},a=(m,v)=>{const w=this._ruleFactory.createClassNameRef({width:`${l/3|0}px`,display:"inline-block"});s(m,w,"\u200A",v?We.VW.Right:We.VW.None)},{fontSize:l,fontFamily:c,padding:d,isUniform:u}=this._getLayoutInfo(),h="--code-editorInlayHintsFontFamily";this._editor.getContainerDomNode().style.setProperty(h,c);for(const m of t){m.hint.paddingLeft&&a(m,!1);const v=typeof m.hint.label=="string"?[{label:m.hint.label}]:m.hint.label;for(let w=0;w<v.length;w++){const R=v[w],T=w===0,F=w===v.length-1,B={fontSize:`${l}px`,fontFamily:`var(${h}), ${$e.jU.fontFamily}`,verticalAlign:u?"baseline":"middle"};(0,pe.EI)(m.hint.textEdits)&&(B.cursor="default"),this._fillInColors(B,m.hint),(R.command||R.location)&&((i=this._activeInlayHintPart)===null||i===void 0?void 0:i.part.item)===m&&this._activeInlayHintPart.part.index===w&&(B.textDecoration="underline",this._activeInlayHintPart.hasTriggerModifier&&(B.color=(0,U.Yf)(C.Ztu),B.cursor="pointer")),d&&(T&&F?(B.padding=`1px ${Math.max(1,l/4)|0}px`,B.borderRadius=`${l/4|0}px`):T?(B.padding=`1px 0 1px ${Math.max(1,l/4)|0}px`,B.borderRadius=`${l/4|0}px 0 0 ${l/4|0}px`):F?(B.padding=`1px ${Math.max(1,l/4)|0}px 1px 0`,B.borderRadius=`0 ${l/4|0}px ${l/4|0}px 0`):B.padding="1px 0 1px 0"),s(m,this._ruleFactory.createClassNameRef(B),Zy(R.label),F&&!m.hint.paddingRight?We.VW.Right:We.VW.None,new $c(m,w))}if(m.hint.paddingRight&&a(m,!0),o.length>Hu._MAX_DECORATORS)break}const p=[];for(const m of e)for(const{id:v}of(n=this._editor.getDecorationsInRange(m))!==null&&n!==void 0?n:[]){const w=this._decorationsMetadata.get(v);w&&(p.push(v),w.classNameRef.dispose(),this._decorationsMetadata.delete(v))}this._editor.changeDecorations(m=>{const v=m.deltaDecorations(p,o.map(w=>w.decoration));for(let w=0;w<v.length;w++){const R=o[w];this._decorationsMetadata.set(v[w],R)}})}_fillInColors(e,t){t.kind===_e.r4.Parameter?(e.backgroundColor=(0,U.Yf)(C.B2L),e.color=(0,U.Yf)(C.sjA)):t.kind===_e.r4.Type?(e.backgroundColor=(0,U.Yf)(C._pU),e.color=(0,U.Yf)(C.HwT)):(e.backgroundColor=(0,U.Yf)(C.WL6),e.color=(0,U.Yf)(C.P6i))}_getLayoutInfo(){const e=this._editor.getOption(129),t=e.padding,i=this._editor.getOption(48),n=this._editor.getOption(45);let o=e.fontSize;(!o||o<5||o>i)&&(o=i);const s=e.fontFamily||n;return{fontSize:o,fontFamily:s,padding:t,isUniform:!t&&s===n&&o===i}}_removeAllDecorations(){this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));for(const e of this._decorationsMetadata.values())e.classNameRef.dispose();this._decorationsMetadata.clear()}};Cn.ID="editor.contrib.InlayHints",Cn._MAX_DECORATORS=1500,Cn=Ky([bo(1,te.u),bo(2,si.U),bo(3,Vf),bo(4,fe.wT),bo(5,Ye.Ot),bo(6,he._Y)],Cn);function Zy(r){return r.replace(/[ \t]/g,"\xA0")}fe.wb.registerCommand("_executeInlayHintProvider",(r,...e)=>So(void 0,void 0,void 0,function*(){const[t,i]=e;(0,le.j)(me.r.isUri(t)),(0,le.j)(L.Q.isIRange(i));const{inlayHintsProvider:n}=r.get(te.u),o=yield r.get(Ft.b).createModelReference(t);try{const s=yield zs.create(n,o.object.textEditorModel,[L.Q.lift(i)],re.X.None),a=s.items.map(l=>l.hint);return setTimeout(()=>s.dispose(),0),a}finally{o.dispose()}}));var Yy=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},js=function(r,e){return function(t,i){e(t,i,r)}},Uf=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})},Xy=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof __values=="function"?__values(r):r[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(o){t[o]=r[o]&&function(s){return new Promise(function(a,l){s=r[o](s),n(a,l,s.done,s.value)})}}function n(o,s,a,l){Promise.resolve(l).then(function(c){o({value:c,done:a})},s)}};class zf extends Ur{constructor(e,t){super(10,t,e.item.anchor.range),this.part=e}}let jc=class extends Zr{constructor(e,t,i,n,o,s){super(e,t,i,n,s),this._resolverService=o,this.hoverOrdinal=6}suggestHoverAnchor(e){var t;if(!Cn.get(this._editor)||e.target.type!==6)return null;const n=(t=e.target.detail.injectedText)===null||t===void 0?void 0:t.options;return n instanceof ge.Ho&&n.attachedData instanceof $c?new zf(n.attachedData,this):null}computeSync(){return[]}computeAsync(e,t,i){return e instanceof zf?new V.AE(n=>Uf(this,void 0,void 0,function*(){var o,s;const{part:a}=e;if(yield a.item.resolve(i),i.isCancellationRequested)return;let l;typeof a.item.hint.tooltip=="string"?l=new xe.Bc().appendText(a.item.hint.tooltip):a.item.hint.tooltip&&(l=a.item.hint.tooltip),l&&n.emitOne(new Zt(this,e.range,[l],0)),(0,pe.EI)(a.item.hint.textEdits)&&n.emitOne(new Zt(this,e.range,[new xe.Bc().appendText((0,g.kg)("hint.dbl","Double click to insert"))],10001));let c;if(typeof a.part.tooltip=="string"?c=new xe.Bc().appendText(a.part.tooltip):a.part.tooltip&&(c=a.part.tooltip),c&&n.emitOne(new Zt(this,e.range,[c],1)),a.part.location||a.part.command){let p;const v=this._editor.getOption(72)==="altKey"?Se.zx?(0,g.kg)("links.navigate.kb.meta.mac","cmd + click"):(0,g.kg)("links.navigate.kb.meta","ctrl + click"):Se.zx?(0,g.kg)("links.navigate.kb.alt.mac","option + click"):(0,g.kg)("links.navigate.kb.alt","alt + click");a.part.location&&a.part.command?p=new xe.Bc().appendText((0,g.kg)("hint.defAndCommand","Go to Definition ({0}), right click for more",v)):a.part.location?p=new xe.Bc().appendText((0,g.kg)("hint.def","Go to Definition ({0})",v)):a.part.command&&(p=new xe.Bc(`[${(0,g.kg)("hint.cmd","Execute Command")}](${$y(a.part.command)} "${a.part.command.title}") (${v})`,{isTrusted:!0})),p&&n.emitOne(new Zt(this,e.range,[p],1e4))}const d=yield this._resolveInlayHintLabelPartHover(a,i);try{for(var u=Xy(d),h;h=yield u.next(),!h.done;){const p=h.value;n.emitOne(p)}}catch(p){o={error:p}}finally{try{h&&!h.done&&(s=u.return)&&(yield s.call(u))}finally{if(o)throw o.error}}})):V.AE.EMPTY}_resolveInlayHintLabelPartHover(e,t){return Uf(this,void 0,void 0,function*(){if(!e.part.location)return V.AE.EMPTY;const{uri:i,range:n}=e.part.location,o=yield this._resolverService.createModelReference(i);try{const s=o.object.textEditorModel;return this._languageFeaturesService.hoverProvider.has(s)?Gd(this._languageFeaturesService.hoverProvider,s,new ee.y(n.startLineNumber,n.startColumn),t).filter(a=>!(0,xe.it)(a.hover.contents)).map(a=>new Zt(this,e.item.anchor.range,a.hover.contents,2+a.ordinal)):V.AE.EMPTY}finally{o.dispose()}})}};jc=Yy([js(1,xt.L),js(2,pt.Cr),js(3,Fe.pG),js(4,Ft.b),js(5,te.u)],jc),(0,_.HW)(Cn.ID,Cn),an.register(jc);class Jy{constructor(e,t,i){this._editRange=e,this._originalSelection=t,this._text=i}getEditOperations(e,t){t.addTrackedEditOperation(this._editRange,this._text)}computeCursorState(e,t){const n=t.getInverseEditOperations()[0].range;return this._originalSelection.isEmpty()?new q.L(n.endLineNumber,Math.min(this._originalSelection.positionColumn,n.endColumn),n.endLineNumber,Math.min(this._originalSelection.positionColumn,n.endColumn)):new q.L(n.endLineNumber,n.endColumn-this._text.length,n.endLineNumber,n.endColumn)}}var qy=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},ew=function(r,e){return function(t,i){e(t,i,r)}};let Bi=class Vu{constructor(e,t){this.editor=e,this.editorWorkerService=t,this.decorations=this.editor.createDecorationsCollection()}static get(e){return e.getContribution(Vu.ID)}dispose(){}run(e,t){this.currentRequest&&this.currentRequest.cancel();const i=this.editor.getSelection(),n=this.editor.getModel();if(!n||!i)return;let o=i;if(o.startLineNumber!==o.endLineNumber)return;const s=new Di.$t(this.editor,5),a=n.uri;return this.editorWorkerService.canNavigateValueSet(a)?(this.currentRequest=(0,V.SS)(l=>this.editorWorkerService.navigateValueSet(a,o,t)),this.currentRequest.then(l=>{if(!l||!l.range||!l.value||!s.validate(this.editor))return;const c=L.Q.lift(l.range);let d=l.range;const u=l.value.length-(o.endColumn-o.startColumn);d={startLineNumber:d.startLineNumber,startColumn:d.startColumn,endLineNumber:d.endLineNumber,endColumn:d.startColumn+l.value.length},u>1&&(o=new q.L(o.startLineNumber,o.startColumn,o.endLineNumber,o.endColumn+u-1));const h=new Jy(c,o,l.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,h),this.editor.pushUndoStop(),this.decorations.set([{range:d,options:Vu.DECORATION}]),this.decorationRemover&&this.decorationRemover.cancel(),this.decorationRemover=(0,V.wR)(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(K.dz)}).catch(K.dz)):Promise.resolve(void 0)}};Bi.ID="editor.contrib.inPlaceReplaceController",Bi.DECORATION=ge.kI.register({description:"in-place-replace",className:"valueSetReplacement"}),Bi=qy([ew(1,Es.w)],Bi);class tw extends _.ks{constructor(){super({id:"editor.action.inPlaceReplace.up",label:g.kg("InPlaceReplaceAction.previous.label","Replace with Previous Value"),alias:"Replace with Previous Value",precondition:D.R.writable,kbOpts:{kbExpr:D.R.editorTextFocus,primary:3154,weight:100}})}run(e,t){const i=Bi.get(t);return i?i.run(this.id,!0):Promise.resolve(void 0)}}class iw extends _.ks{constructor(){super({id:"editor.action.inPlaceReplace.down",label:g.kg("InPlaceReplaceAction.next.label","Replace with Next Value"),alias:"Replace with Next Value",precondition:D.R.writable,kbOpts:{kbExpr:D.R.editorTextFocus,primary:3156,weight:100}})}run(e,t){const i=Bi.get(t);return i?i.run(this.id,!1):Promise.resolve(void 0)}}(0,_.HW)(Bi.ID,Bi),(0,_.Fl)(tw),(0,_.Fl)(iw),(0,U.zy)((r,e)=>{const t=r.getColor(Qi.$u);t&&e.addRule(`.monaco-editor.vs .valueSetReplacement { outline: solid 2px ${t}; }`)});var Gc=f(27064);class nw extends _.ks{constructor(){super({id:"expandLineSelection",label:g.kg("expandLineSelection","Expand Line Selection"),alias:"Expand Line Selection",precondition:void 0,kbOpts:{weight:0,kbExpr:D.R.textInputFocus,primary:2090}})}run(e,t,i){if(i=i||{},!t.hasModel())return;const n=t._getViewModel();n.model.pushStackElement(),n.setCursorStates(i.source,3,Gc.c.expandLineSelection(n,n.getCursorStates())),n.revealPrimaryCursor(i.source,!0)}}(0,_.Fl)(nw);class ow{constructor(e,t){this._selection=e,this._cursors=t,this._selectionId=null}getEditOperations(e,t){const i=sw(e,this._cursors);for(let n=0,o=i.length;n<o;n++){const s=i[n];t.addEditOperation(s.range,s.text)}this._selectionId=t.trackSelection(this._selection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}function sw(r,e){e.sort((s,a)=>s.lineNumber===a.lineNumber?s.column-a.column:s.lineNumber-a.lineNumber);for(let s=e.length-2;s>=0;s--)e[s].lineNumber===e[s+1].lineNumber&&e.splice(s,1);const t=[];let i=0,n=0;const o=e.length;for(let s=1,a=r.getLineCount();s<=a;s++){const l=r.getLineContent(s),c=l.length+1;let d=0;if(n<o&&e[n].lineNumber===s&&(d=e[n].column,n++,d===c)||l.length===0)continue;const u=G.lT(l);let h=0;if(u===-1)h=1;else if(u!==l.length-1)h=u+2;else continue;h=Math.max(d,h),t[i++]=Le.k.delete(new L.Q(s,h,s,c))}return t}var Kc=f(61710);class $f{constructor(e,t,i){this._selection=e,this._isCopyingDown=t,this._noop=i||!1,this._selectionDirection=0,this._selectionId=null,this._startLineNumberDelta=0,this._endLineNumberDelta=0}getEditOperations(e,t){let i=this._selection;this._startLineNumberDelta=0,this._endLineNumberDelta=0,i.startLineNumber<i.endLineNumber&&i.endColumn===1&&(this._endLineNumberDelta=1,i=i.setEndPosition(i.endLineNumber-1,e.getLineMaxColumn(i.endLineNumber-1)));const n=[];for(let s=i.startLineNumber;s<=i.endLineNumber;s++)n.push(e.getLineContent(s));const o=n.join(`
`);o===""&&this._isCopyingDown&&(this._startLineNumberDelta++,this._endLineNumberDelta++),this._noop?t.addEditOperation(new L.Q(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber+1,1),i.endLineNumber===e.getLineCount()?"":`
`):this._isCopyingDown?t.addEditOperation(new L.Q(i.startLineNumber,1,i.startLineNumber,1),o+`
`):t.addEditOperation(new L.Q(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),`
`+o),this._selectionId=t.trackSelection(i),this._selectionDirection=this._selection.getDirection()}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);if(this._startLineNumberDelta!==0||this._endLineNumberDelta!==0){let n=i.startLineNumber,o=i.startColumn,s=i.endLineNumber,a=i.endColumn;this._startLineNumberDelta!==0&&(n=n+this._startLineNumberDelta,o=1),this._endLineNumberDelta!==0&&(s=s+this._endLineNumberDelta,a=1),i=q.L.createWithDirection(n,o,s,a,this._selectionDirection)}return i}}var Ha=f(49550),Qc=f(80794),rw=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},aw=function(r,e){return function(t,i){e(t,i,r)}};let Zc=class{constructor(e,t,i,n){this._languageConfigurationService=n,this._selection=e,this._isMovingDown=t,this._autoIndent=i,this._selectionId=null,this._moveEndLineSelectionShrink=!1}getEditOperations(e,t){const i=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===i){this._selectionId=t.trackSelection(this._selection);return}if(!this._isMovingDown&&this._selection.startLineNumber===1){this._selectionId=t.trackSelection(this._selection);return}this._moveEndPositionDown=!1;let n=this._selection;n.startLineNumber<n.endLineNumber&&n.endColumn===1&&(this._moveEndPositionDown=!0,n=n.setEndPosition(n.endLineNumber-1,e.getLineMaxColumn(n.endLineNumber-1)));const{tabSize:o,indentSize:s,insertSpaces:a}=e.getOptions(),l=this.buildIndentConverter(o,s,a),c={tokenization:{getLineTokens:d=>e.tokenization.getLineTokens(d),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(d,u)=>e.getLanguageIdAtPosition(d,u)},getLineContent:null};if(n.startLineNumber===n.endLineNumber&&e.getLineMaxColumn(n.startLineNumber)===1){const d=n.startLineNumber,u=this._isMovingDown?d+1:d-1;e.getLineMaxColumn(u)===1?t.addEditOperation(new L.Q(1,1,1,1),null):(t.addEditOperation(new L.Q(d,1,d,1),e.getLineContent(u)),t.addEditOperation(new L.Q(u,1,u,e.getLineMaxColumn(u)),null)),n=new q.L(u,1,u,1)}else{let d,u;if(this._isMovingDown){d=n.endLineNumber+1,u=e.getLineContent(d),t.addEditOperation(new L.Q(d-1,e.getLineMaxColumn(d-1),d,e.getLineMaxColumn(d)),null);let h=u;if(this.shouldAutoIndent(e,n)){const p=this.matchEnterRule(e,l,o,d,n.startLineNumber-1);if(p!==null){const v=G.UU(e.getLineContent(d)),w=p+ht(v,o);h=Vs(w,o,a)+this.trimLeft(u)}else{c.getLineContent=w=>w===n.startLineNumber?e.getLineContent(d):e.getLineContent(w);const v=(0,vn.$f)(this._autoIndent,c,e.getLanguageIdAtPosition(d,1),n.startLineNumber,l,this._languageConfigurationService);if(v!==null){const w=G.UU(e.getLineContent(d)),R=ht(v,o),T=ht(w,o);R!==T&&(h=Vs(R,o,a)+this.trimLeft(u))}}t.addEditOperation(new L.Q(n.startLineNumber,1,n.startLineNumber,1),h+`
`);const m=this.matchEnterRuleMovingDown(e,l,o,n.startLineNumber,d,h);if(m!==null)m!==0&&this.getIndentEditsOfMovingBlock(e,t,n,o,a,m);else{c.getLineContent=w=>w===n.startLineNumber?h:w>=n.startLineNumber+1&&w<=n.endLineNumber+1?e.getLineContent(w-1):e.getLineContent(w);const v=(0,vn.$f)(this._autoIndent,c,e.getLanguageIdAtPosition(d,1),n.startLineNumber+1,l,this._languageConfigurationService);if(v!==null){const w=G.UU(e.getLineContent(n.startLineNumber)),R=ht(v,o),T=ht(w,o);if(R!==T){const F=R-T;this.getIndentEditsOfMovingBlock(e,t,n,o,a,F)}}}}else t.addEditOperation(new L.Q(n.startLineNumber,1,n.startLineNumber,1),h+`
`)}else if(d=n.startLineNumber-1,u=e.getLineContent(d),t.addEditOperation(new L.Q(d,1,d+1,1),null),t.addEditOperation(new L.Q(n.endLineNumber,e.getLineMaxColumn(n.endLineNumber),n.endLineNumber,e.getLineMaxColumn(n.endLineNumber)),`
`+u),this.shouldAutoIndent(e,n)){c.getLineContent=p=>p===d?e.getLineContent(n.startLineNumber):e.getLineContent(p);const h=this.matchEnterRule(e,l,o,n.startLineNumber,n.startLineNumber-2);if(h!==null)h!==0&&this.getIndentEditsOfMovingBlock(e,t,n,o,a,h);else{const p=(0,vn.$f)(this._autoIndent,c,e.getLanguageIdAtPosition(n.startLineNumber,1),d,l,this._languageConfigurationService);if(p!==null){const m=G.UU(e.getLineContent(n.startLineNumber)),v=ht(p,o),w=ht(m,o);if(v!==w){const R=v-w;this.getIndentEditsOfMovingBlock(e,t,n,o,a,R)}}}}}this._selectionId=t.trackSelection(n)}buildIndentConverter(e,t,i){return{shiftIndent:n=>Co.Y.shiftIndent(n,n.length+1,e,t,i),unshiftIndent:n=>Co.Y.unshiftIndent(n,n.length+1,e,t,i)}}parseEnterResult(e,t,i,n,o){if(o){let s=o.indentation;o.indentAction===Ha.l.None||o.indentAction===Ha.l.Indent?s=o.indentation+o.appendText:o.indentAction===Ha.l.IndentOutdent?s=o.indentation:o.indentAction===Ha.l.Outdent&&(s=t.unshiftIndent(o.indentation)+o.appendText);const a=e.getLineContent(n);if(this.trimLeft(a).indexOf(this.trimLeft(s))>=0){const l=G.UU(e.getLineContent(n));let c=G.UU(s);const d=(0,vn.Yb)(e,n,this._languageConfigurationService);d!==null&&d&2&&(c=t.unshiftIndent(c));const u=ht(c,i),h=ht(l,i);return u-h}}return null}matchEnterRuleMovingDown(e,t,i,n,o,s){if(G.lT(s)>=0){const a=e.getLineMaxColumn(o),l=(0,Qc.h)(this._autoIndent,e,new L.Q(o,a,o,a),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,l)}else{let a=n-1;for(;a>=1;){const d=e.getLineContent(a);if(G.lT(d)>=0)break;a--}if(a<1||n>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=(0,Qc.h)(this._autoIndent,e,new L.Q(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,c)}}matchEnterRule(e,t,i,n,o,s){let a=o;for(;a>=1;){let d;if(a===o&&s!==void 0?d=s:d=e.getLineContent(a),G.lT(d)>=0)break;a--}if(a<1||n>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=(0,Qc.h)(this._autoIndent,e,new L.Q(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,c)}trimLeft(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4||!e.tokenization.isCheapToTokenize(t.startLineNumber))return!1;const i=e.getLanguageIdAtPosition(t.startLineNumber,1),n=e.getLanguageIdAtPosition(t.endLineNumber,1);return!(i!==n||this._languageConfigurationService.getLanguageConfiguration(i).indentRulesSupport===null)}getIndentEditsOfMovingBlock(e,t,i,n,o,s){for(let a=i.startLineNumber;a<=i.endLineNumber;a++){const l=e.getLineContent(a),c=G.UU(l),u=ht(c,n)+s,h=Vs(u,n,o);h!==c&&(t.addEditOperation(new L.Q(a,1,a,c.length+1),h),a===i.endLineNumber&&i.endColumn<=c.length+1&&h===""&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&i.startLineNumber<i.endLineNumber&&(i=i.setEndPosition(i.endLineNumber,2)),i}};Zc=rw([aw(3,it.JZ)],Zc);class Hi{constructor(e,t){this.selection=e,this.descending=t,this.selectionId=null}static getCollator(){return Hi._COLLATOR||(Hi._COLLATOR=new Intl.Collator),Hi._COLLATOR}getEditOperations(e,t){const i=lw(e,this.selection,this.descending);i&&t.addEditOperation(i.range,i.text),this.selectionId=t.trackSelection(this.selection)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}static canRun(e,t,i){if(e===null)return!1;const n=jf(e,t,i);if(!n)return!1;for(let o=0,s=n.before.length;o<s;o++)if(n.before[o]!==n.after[o])return!0;return!1}}Hi._COLLATOR=null;function jf(r,e,t){const i=e.startLineNumber;let n=e.endLineNumber;if(e.endColumn===1&&n--,i>=n)return null;const o=[];for(let a=i;a<=n;a++)o.push(r.getLineContent(a));let s=o.slice(0);return s.sort(Hi.getCollator().compare),t===!0&&(s=s.reverse()),{startLineNumber:i,endLineNumber:n,before:o,after:s}}function lw(r,e,t){const i=jf(r,e,t);return i?Le.k.replace(new L.Q(i.startLineNumber,1,i.endLineNumber,r.getLineMaxColumn(i.endLineNumber)),i.after.join(`
`)):null}class Gf extends _.ks{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const i=t.getSelections().map((s,a)=>({selection:s,index:a,ignore:!1}));i.sort((s,a)=>L.Q.compareRangesUsingStarts(s.selection,a.selection));let n=i[0];for(let s=1;s<i.length;s++){const a=i[s];n.selection.endLineNumber===a.selection.startLineNumber&&(n.index<a.index?a.ignore=!0:(n.ignore=!0,n=a))}const o=[];for(const s of i)o.push(new $f(s.selection,this.down,s.ignore));t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class dw extends Gf{constructor(){super(!1,{id:"editor.action.copyLinesUpAction",label:g.kg("lines.copyUp","Copy Line Up"),alias:"Copy Line Up",precondition:D.R.writable,kbOpts:{kbExpr:D.R.editorTextFocus,primary:1552,linux:{primary:3600},weight:100},menuOpts:{menuId:z.D8.MenubarSelectionMenu,group:"2_line",title:g.kg({key:"miCopyLinesUp",comment:["&& denotes a mnemonic"]},"&&Copy Line Up"),order:1}})}}class cw extends Gf{constructor(){super(!0,{id:"editor.action.copyLinesDownAction",label:g.kg("lines.copyDown","Copy Line Down"),alias:"Copy Line Down",precondition:D.R.writable,kbOpts:{kbExpr:D.R.editorTextFocus,primary:1554,linux:{primary:3602},weight:100},menuOpts:{menuId:z.D8.MenubarSelectionMenu,group:"2_line",title:g.kg({key:"miCopyLinesDown",comment:["&& denotes a mnemonic"]},"Co&&py Line Down"),order:2}})}}class uw extends _.ks{constructor(){super({id:"editor.action.duplicateSelection",label:g.kg("duplicateSelection","Duplicate Selection"),alias:"Duplicate Selection",precondition:D.R.writable,menuOpts:{menuId:z.D8.MenubarSelectionMenu,group:"2_line",title:g.kg({key:"miDuplicateSelection",comment:["&& denotes a mnemonic"]},"&&Duplicate Selection"),order:5}})}run(e,t,i){if(!t.hasModel())return;const n=[],o=t.getSelections(),s=t.getModel();for(const a of o)if(a.isEmpty())n.push(new $f(a,!0));else{const l=new q.L(a.endLineNumber,a.endColumn,a.endLineNumber,a.endColumn);n.push(new yi.tA(l,s.getValueInRange(a)))}t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}class Kf extends _.ks{constructor(e,t){super(t),this.down=e}run(e,t){const i=e.get(it.JZ),n=[],o=t.getSelections()||[],s=t.getOption(9);for(const a of o)n.push(new Zc(a,this.down,s,i));t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}class hw extends Kf{constructor(){super(!1,{id:"editor.action.moveLinesUpAction",label:g.kg("lines.moveUp","Move Line Up"),alias:"Move Line Up",precondition:D.R.writable,kbOpts:{kbExpr:D.R.editorTextFocus,primary:528,linux:{primary:528},weight:100},menuOpts:{menuId:z.D8.MenubarSelectionMenu,group:"2_line",title:g.kg({key:"miMoveLinesUp",comment:["&& denotes a mnemonic"]},"Mo&&ve Line Up"),order:3}})}}class gw extends Kf{constructor(){super(!0,{id:"editor.action.moveLinesDownAction",label:g.kg("lines.moveDown","Move Line Down"),alias:"Move Line Down",precondition:D.R.writable,kbOpts:{kbExpr:D.R.editorTextFocus,primary:530,linux:{primary:530},weight:100},menuOpts:{menuId:z.D8.MenubarSelectionMenu,group:"2_line",title:g.kg({key:"miMoveLinesDown",comment:["&& denotes a mnemonic"]},"Move &&Line Down"),order:4}})}}class Qf extends _.ks{constructor(e,t){super(t),this.descending=e}run(e,t){const i=t.getSelections()||[];for(const o of i)if(!Hi.canRun(t.getModel(),o,this.descending))return;const n=[];for(let o=0,s=i.length;o<s;o++)n[o]=new Hi(i[o],this.descending);t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}class fw extends Qf{constructor(){super(!1,{id:"editor.action.sortLinesAscending",label:g.kg("lines.sortAscending","Sort Lines Ascending"),alias:"Sort Lines Ascending",precondition:D.R.writable})}}class pw extends Qf{constructor(){super(!0,{id:"editor.action.sortLinesDescending",label:g.kg("lines.sortDescending","Sort Lines Descending"),alias:"Sort Lines Descending",precondition:D.R.writable})}}class mw extends _.ks{constructor(){super({id:"editor.action.removeDuplicateLines",label:g.kg("lines.deleteDuplicates","Delete Duplicate Lines"),alias:"Delete Duplicate Lines",precondition:D.R.writable})}run(e,t){if(!t.hasModel())return;const i=t.getModel();if(i.getLineCount()===1&&i.getLineMaxColumn(1)===1)return;const n=[],o=[];let s=0;for(const a of t.getSelections()){const l=new Set,c=[];for(let p=a.startLineNumber;p<=a.endLineNumber;p++){const m=i.getLineContent(p);l.has(m)||(c.push(m),l.add(m))}const d=new q.L(a.startLineNumber,1,a.endLineNumber,i.getLineMaxColumn(a.endLineNumber)),u=a.startLineNumber-s,h=new q.L(u,1,u+c.length-1,c[c.length-1].length);n.push(Le.k.replace(d,c.join(`
`))),o.push(h),s+=a.endLineNumber-a.startLineNumber+1-c.length}t.pushUndoStop(),t.executeEdits(this.id,n,o),t.pushUndoStop()}}class Va extends _.ks{constructor(){super({id:Va.ID,label:g.kg("lines.trimTrailingWhitespace","Trim Trailing Whitespace"),alias:"Trim Trailing Whitespace",precondition:D.R.writable,kbOpts:{kbExpr:D.R.editorTextFocus,primary:(0,Ee.m5)(2089,2102),weight:100}})}run(e,t,i){let n=[];i.reason==="auto-save"&&(n=(t.getSelections()||[]).map(a=>new ee.y(a.positionLineNumber,a.positionColumn)));const o=t.getSelection();if(o===null)return;const s=new ow(o,n);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop()}}Va.ID="editor.action.trimTrailingWhitespace";class _w extends _.ks{constructor(){super({id:"editor.action.deleteLines",label:g.kg("lines.delete","Delete Line"),alias:"Delete Line",precondition:D.R.writable,kbOpts:{kbExpr:D.R.textInputFocus,primary:3113,weight:100}})}run(e,t){if(!t.hasModel())return;const i=this._getLinesToRemove(t),n=t.getModel();if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return;let o=0;const s=[],a=[];for(let l=0,c=i.length;l<c;l++){const d=i[l];let u=d.startLineNumber,h=d.endLineNumber,p=1,m=n.getLineMaxColumn(h);h<n.getLineCount()?(h+=1,m=1):u>1&&(u-=1,p=n.getLineMaxColumn(u)),s.push(Le.k.replace(new q.L(u,p,h,m),"")),a.push(new q.L(u-o,d.positionColumn,u-o,d.positionColumn)),o+=d.endLineNumber-d.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,s,a),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map(o=>{let s=o.endLineNumber;return o.startLineNumber<o.endLineNumber&&o.endColumn===1&&(s-=1),{startLineNumber:o.startLineNumber,selectionStartColumn:o.selectionStartColumn,endLineNumber:s,positionColumn:o.positionColumn}});t.sort((o,s)=>o.startLineNumber===s.startLineNumber?o.endLineNumber-s.endLineNumber:o.startLineNumber-s.startLineNumber);const i=[];let n=t[0];for(let o=1;o<t.length;o++)n.endLineNumber+1>=t[o].startLineNumber?n.endLineNumber=t[o].endLineNumber:(i.push(n),n=t[o]);return i.push(n),i}}class vw extends _.ks{constructor(){super({id:"editor.action.indentLines",label:g.kg("lines.indent","Indent Line"),alias:"Indent Line",precondition:D.R.writable,kbOpts:{kbExpr:D.R.editorTextFocus,primary:2137,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Kc.TK.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class Cw extends _.ks{constructor(){super({id:"editor.action.outdentLines",label:g.kg("lines.outdent","Outdent Line"),alias:"Outdent Line",precondition:D.R.writable,kbOpts:{kbExpr:D.R.editorTextFocus,primary:2135,weight:100}})}run(e,t){Sr.Yh.Outdent.runEditorCommand(e,t,null)}}class bw extends _.ks{constructor(){super({id:"editor.action.insertLineBefore",label:g.kg("lines.insertBefore","Insert Line Above"),alias:"Insert Line Above",precondition:D.R.writable,kbOpts:{kbExpr:D.R.editorTextFocus,primary:3075,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Kc.TK.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}class Sw extends _.ks{constructor(){super({id:"editor.action.insertLineAfter",label:g.kg("lines.insertAfter","Insert Line Below"),alias:"Insert Line Below",precondition:D.R.writable,kbOpts:{kbExpr:D.R.editorTextFocus,primary:2051,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Kc.TK.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}class Zf extends _.ks{run(e,t){if(!t.hasModel())return;const i=t.getSelection(),n=this._getRangesToDelete(t),o=[];for(let l=0,c=n.length-1;l<c;l++){const d=n[l],u=n[l+1];L.Q.intersectRanges(d,u)===null?o.push(d):n[l+1]=L.Q.plusRange(d,u)}o.push(n[n.length-1]);const s=this._getEndCursorState(i,o),a=o.map(l=>Le.k.replace(l,""));t.pushUndoStop(),t.executeEdits(this.id,a,s),t.pushUndoStop()}}class yw extends Zf{constructor(){super({id:"deleteAllLeft",label:g.kg("lines.deleteAllLeft","Delete All Left"),alias:"Delete All Left",precondition:D.R.writable,kbOpts:{kbExpr:D.R.textInputFocus,primary:0,mac:{primary:2049},weight:100}})}_getEndCursorState(e,t){let i=null;const n=[];let o=0;return t.forEach(s=>{let a;if(s.endColumn===1&&o>0){const l=s.startLineNumber-o;a=new q.L(l,s.startColumn,l,s.startColumn)}else a=new q.L(s.startLineNumber,s.startColumn,s.startLineNumber,s.startColumn);o+=s.endLineNumber-s.startLineNumber,s.intersectRanges(e)?i=a:n.push(a)}),i&&n.unshift(i),n}_getRangesToDelete(e){const t=e.getSelections();if(t===null)return[];let i=t;const n=e.getModel();return n===null?[]:(i.sort(L.Q.compareRangesUsingStarts),i=i.map(o=>{if(o.isEmpty())if(o.startColumn===1){const s=Math.max(1,o.startLineNumber-1),a=o.startLineNumber===1?1:n.getLineContent(s).length+1;return new L.Q(s,a,o.startLineNumber,1)}else return new L.Q(o.startLineNumber,1,o.startLineNumber,o.startColumn);else return new L.Q(o.startLineNumber,1,o.endLineNumber,o.endColumn)}),i)}}class ww extends Zf{constructor(){super({id:"deleteAllRight",label:g.kg("lines.deleteAllRight","Delete All Right"),alias:"Delete All Right",precondition:D.R.writable,kbOpts:{kbExpr:D.R.textInputFocus,primary:0,mac:{primary:297,secondary:[2068]},weight:100}})}_getEndCursorState(e,t){let i=null;const n=[];for(let o=0,s=t.length,a=0;o<s;o++){const l=t[o],c=new q.L(l.startLineNumber-a,l.startColumn,l.startLineNumber-a,l.startColumn);l.intersectRanges(e)?i=c:n.push(c)}return i&&n.unshift(i),n}_getRangesToDelete(e){const t=e.getModel();if(t===null)return[];const i=e.getSelections();if(i===null)return[];const n=i.map(o=>{if(o.isEmpty()){const s=t.getLineMaxColumn(o.startLineNumber);return o.startColumn===s?new L.Q(o.startLineNumber,o.startColumn,o.startLineNumber+1,1):new L.Q(o.startLineNumber,o.startColumn,o.startLineNumber,s)}return o});return n.sort(L.Q.compareRangesUsingStarts),n}}class Dw extends _.ks{constructor(){super({id:"editor.action.joinLines",label:g.kg("lines.joinLines","Join Lines"),alias:"Join Lines",precondition:D.R.writable,kbOpts:{kbExpr:D.R.editorTextFocus,primary:0,mac:{primary:296},weight:100}})}run(e,t){const i=t.getSelections();if(i===null)return;let n=t.getSelection();if(n===null)return;i.sort(L.Q.compareRangesUsingStarts);const o=[],s=i.reduce((h,p)=>h.isEmpty()?h.endLineNumber===p.startLineNumber?(n.equalsSelection(h)&&(n=p),p):p.startLineNumber>h.endLineNumber+1?(o.push(h),p):new q.L(h.startLineNumber,h.startColumn,p.endLineNumber,p.endColumn):p.startLineNumber>h.endLineNumber?(o.push(h),p):new q.L(h.startLineNumber,h.startColumn,p.endLineNumber,p.endColumn));o.push(s);const a=t.getModel();if(a===null)return;const l=[],c=[];let d=n,u=0;for(let h=0,p=o.length;h<p;h++){const m=o[h],v=m.startLineNumber,w=1;let R=0,T,F;const B=a.getLineContent(m.endLineNumber).length-m.endColumn;if(m.isEmpty()||m.startLineNumber===m.endLineNumber){const ie=m.getStartPosition();ie.lineNumber<a.getLineCount()?(T=v+1,F=a.getLineMaxColumn(T)):(T=ie.lineNumber,F=a.getLineMaxColumn(ie.lineNumber))}else T=m.endLineNumber,F=a.getLineMaxColumn(T);let j=a.getLineContent(v);for(let ie=v+1;ie<=T;ie++){const Ue=a.getLineContent(ie),et=a.getLineFirstNonWhitespaceColumn(ie);if(et>=1){let rt=!0;j===""&&(rt=!1),rt&&(j.charAt(j.length-1)===" "||j.charAt(j.length-1)==="	")&&(rt=!1,j=j.replace(/[\s\uFEFF\xA0]+$/g," "));const qt=Ue.substr(et-1);j+=(rt?" ":"")+qt,rt?R=qt.length+1:R=qt.length}else R=0}const ve=new L.Q(v,w,T,F);if(!ve.isEmpty()){let ie;m.isEmpty()?(l.push(Le.k.replace(ve,j)),ie=new q.L(ve.startLineNumber-u,j.length-R+1,v-u,j.length-R+1)):m.startLineNumber===m.endLineNumber?(l.push(Le.k.replace(ve,j)),ie=new q.L(m.startLineNumber-u,m.startColumn,m.endLineNumber-u,m.endColumn)):(l.push(Le.k.replace(ve,j)),ie=new q.L(m.startLineNumber-u,m.startColumn,m.startLineNumber-u,j.length-B)),L.Q.intersectRanges(ve,n)!==null?d=ie:c.push(ie)}u+=ve.endLineNumber-ve.startLineNumber}c.unshift(d),t.pushUndoStop(),t.executeEdits(this.id,l,c),t.pushUndoStop()}}class xw extends _.ks{constructor(){super({id:"editor.action.transpose",label:g.kg("editor.transpose","Transpose characters around the cursor"),alias:"Transpose characters around the cursor",precondition:D.R.writable})}run(e,t){const i=t.getSelections();if(i===null)return;const n=t.getModel();if(n===null)return;const o=[];for(let s=0,a=i.length;s<a;s++){const l=i[s];if(!l.isEmpty())continue;const c=l.getStartPosition(),d=n.getLineMaxColumn(c.lineNumber);if(c.column>=d){if(c.lineNumber===n.getLineCount())continue;const u=new L.Q(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),h=n.getValueInRange(u).split("").reverse().join("");o.push(new yi.iu(new q.L(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),h))}else{const u=new L.Q(c.lineNumber,Math.max(1,c.column-1),c.lineNumber,c.column+1),h=n.getValueInRange(u).split("").reverse().join("");o.push(new yi.ui(u,h,new q.L(c.lineNumber,c.column+1,c.lineNumber,c.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class Gs extends _.ks{run(e,t){const i=t.getSelections();if(i===null)return;const n=t.getModel();if(n===null)return;const o=t.getOption(119),s=[];for(const a of i)if(a.isEmpty()){const l=a.getStartPosition(),c=t.getConfiguredWordAtPosition(l);if(!c)continue;const d=new L.Q(l.lineNumber,c.startColumn,l.lineNumber,c.endColumn),u=n.getValueInRange(d);s.push(Le.k.replace(d,this._modifyText(u,o)))}else{const l=n.getValueInRange(a);s.push(Le.k.replace(a,this._modifyText(l,o)))}t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop()}}class Lw extends Gs{constructor(){super({id:"editor.action.transformToUppercase",label:g.kg("editor.transformToUppercase","Transform to Uppercase"),alias:"Transform to Uppercase",precondition:D.R.writable})}_modifyText(e,t){return e.toLocaleUpperCase()}}class kw extends Gs{constructor(){super({id:"editor.action.transformToLowercase",label:g.kg("editor.transformToLowercase","Transform to Lowercase"),alias:"Transform to Lowercase",precondition:D.R.writable})}_modifyText(e,t){return e.toLocaleLowerCase()}}class yo{constructor(e,t){this._pattern=e,this._flags=t,this._actual=null,this._evaluated=!1}get(){if(!this._evaluated){this._evaluated=!0;try{this._actual=new RegExp(this._pattern,this._flags)}catch{}}return this._actual}isSupported(){return this.get()!==null}}class Ks extends Gs{constructor(){super({id:"editor.action.transformToTitlecase",label:g.kg("editor.transformToTitlecase","Transform to Title Case"),alias:"Transform to Title Case",precondition:D.R.writable})}_modifyText(e,t){const i=Ks.titleBoundary.get();return i?e.toLocaleLowerCase().replace(i,n=>n.toLocaleUpperCase()):e}}Ks.titleBoundary=new yo("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");class Vi extends Gs{constructor(){super({id:"editor.action.transformToSnakecase",label:g.kg("editor.transformToSnakecase","Transform to Snake Case"),alias:"Transform to Snake Case",precondition:D.R.writable})}_modifyText(e,t){const i=Vi.caseBoundary.get(),n=Vi.singleLetters.get();return!i||!n?e:e.replace(i,"$1_$2").replace(n,"$1_$2$3").toLocaleLowerCase()}}Vi.caseBoundary=new yo("(\\p{Ll})(\\p{Lu})","gmu"),Vi.singleLetters=new yo("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");class mi extends Gs{constructor(){super({id:"editor.action.transformToKebabcase",label:g.kg("editor.transformToKebabcase","Transform to Kebab Case"),alias:"Transform to Kebab Case",precondition:D.R.writable})}static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every(t=>t.isSupported())}_modifyText(e,t){const i=mi.caseBoundary.get(),n=mi.singleLetters.get(),o=mi.underscoreBoundary.get();return!i||!n||!o?e:e.replace(o,"$1-$3").replace(i,"$1-$2").replace(n,"$1-$2").toLocaleLowerCase()}}mi.caseBoundary=new yo("(\\p{Ll})(\\p{Lu})","gmu"),mi.singleLetters=new yo("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu"),mi.underscoreBoundary=new yo("(\\S)(_)(\\S)","gm"),(0,_.Fl)(dw),(0,_.Fl)(cw),(0,_.Fl)(uw),(0,_.Fl)(hw),(0,_.Fl)(gw),(0,_.Fl)(fw),(0,_.Fl)(pw),(0,_.Fl)(mw),(0,_.Fl)(Va),(0,_.Fl)(_w),(0,_.Fl)(vw),(0,_.Fl)(Cw),(0,_.Fl)(bw),(0,_.Fl)(Sw),(0,_.Fl)(yw),(0,_.Fl)(ww),(0,_.Fl)(Dw),(0,_.Fl)(xw),(0,_.Fl)(Lw),(0,_.Fl)(kw),Vi.caseBoundary.isSupported()&&Vi.singleLetters.isSupported()&&(0,_.Fl)(Vi),Ks.titleBoundary.isSupported()&&(0,_.Fl)(Ks),mi.isSupported()&&(0,_.Fl)(mi);var Iw=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Ua=function(r,e){return function(t,i){e(t,i,r)}},Yc=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};const Yf=new A.N1("LinkedEditingInputVisible",!1),Xf="linked-editing-decoration";let Ui=class Uu extends I.jG{constructor(e,t,i,n,o){super(),this.languageConfigurationService=n,this._syncRangesToken=0,this._localToDispose=this._register(new I.Cm),this._editor=e,this._providers=i.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=Yf.bindTo(t),this._debounceInformation=o.for(this._providers,"Linked Editing",{min:200}),this._currentDecorations=this._editor.createDecorationsCollection(),this._languageWordPattern=null,this._currentWordPattern=null,this._ignoreChangeEvent=!1,this._localToDispose=this._register(new I.Cm),this._rangeUpdateTriggerPromise=null,this._rangeSyncTriggerPromise=null,this._currentRequest=null,this._currentRequestPosition=null,this._currentRequestModelVersion=null,this._register(this._editor.onDidChangeModel(()=>this.reinitialize(!0))),this._register(this._editor.onDidChangeConfiguration(s=>{(s.hasChanged(64)||s.hasChanged(84))&&this.reinitialize(!1)})),this._register(this._providers.onDidChange(()=>this.reinitialize(!1))),this._register(this._editor.onDidChangeModelLanguage(()=>this.reinitialize(!0))),this.reinitialize(!0)}static get(e){return e.getContribution(Uu.ID)}reinitialize(e){const t=this._editor.getModel(),i=t!==null&&(this._editor.getOption(64)||this._editor.getOption(84))&&this._providers.has(t);if(i===this._enabled&&!e||(this._enabled=i,this.clearRanges(),this._localToDispose.clear(),!i||t===null))return;this._localToDispose.add(Z.Jh.runAndSubscribe(t.onDidChangeLanguageConfiguration,()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition()}));const n=new V.ve(this._debounceInformation.get(t)),o=()=>{var l;this._rangeUpdateTriggerPromise=n.trigger(()=>this.updateRanges(),(l=this._debounceDuration)!==null&&l!==void 0?l:this._debounceInformation.get(t))},s=new V.ve(0),a=l=>{this._rangeSyncTriggerPromise=s.trigger(()=>this._syncRanges(l))};this._localToDispose.add(this._editor.onDidChangeCursorPosition(()=>{o()})),this._localToDispose.add(this._editor.onDidChangeModelContent(l=>{if(!this._ignoreChangeEvent&&this._currentDecorations.length>0){const c=this._currentDecorations.getRange(0);if(c&&l.changes.every(d=>c.intersectRanges(d.range))){a(this._syncRangesToken);return}}o()})),this._localToDispose.add({dispose:()=>{n.dispose(),s.dispose()}}),this.updateRanges()}_syncRanges(e){if(!this._editor.hasModel()||e!==this._syncRangesToken||this._currentDecorations.length===0)return;const t=this._editor.getModel(),i=this._currentDecorations.getRange(0);if(!i||i.startLineNumber!==i.endLineNumber)return this.clearRanges();const n=t.getValueInRange(i);if(this._currentWordPattern){const s=n.match(this._currentWordPattern);if((s?s[0].length:0)!==n.length)return this.clearRanges()}const o=[];for(let s=1,a=this._currentDecorations.length;s<a;s++){const l=this._currentDecorations.getRange(s);if(l)if(l.startLineNumber!==l.endLineNumber)o.push({range:l,text:n});else{let c=t.getValueInRange(l),d=n,u=l.startColumn,h=l.endColumn;const p=G.Qp(c,d);u+=p,c=c.substr(p),d=d.substr(p);const m=G.Vi(c,d);h-=m,c=c.substr(0,c.length-m),d=d.substr(0,d.length-m),(u!==h||d.length!==0)&&o.push({range:new L.Q(l.startLineNumber,u,l.endLineNumber,h),text:d})}}if(o.length!==0)try{this._editor.popUndoStop(),this._ignoreChangeEvent=!0;const s=this._editor._getViewModel().getPrevEditOperationType();this._editor.executeEdits("linkedEditing",o),this._editor._getViewModel().setPrevEditOperationType(s)}finally{this._ignoreChangeEvent=!1}}dispose(){this.clearRanges(),super.dispose()}clearRanges(){this._visibleContextKey.set(!1),this._currentDecorations.clear(),this._currentRequest&&(this._currentRequest.cancel(),this._currentRequest=null,this._currentRequestPosition=null)}updateRanges(e=!1){return Yc(this,void 0,void 0,function*(){if(!this._editor.hasModel()){this.clearRanges();return}const t=this._editor.getPosition();if(!this._enabled&&!e||this._editor.getSelections().length>1){this.clearRanges();return}const i=this._editor.getModel(),n=i.getVersionId();if(this._currentRequestPosition&&this._currentRequestModelVersion===n){if(t.equals(this._currentRequestPosition))return;if(this._currentDecorations.length>0){const s=this._currentDecorations.getRange(0);if(s&&s.containsPosition(t))return}}this._currentRequestPosition=t,this._currentRequestModelVersion=n;const o=(0,V.SS)(s=>Yc(this,void 0,void 0,function*(){try{const a=new Kt.W(!1),l=yield Jf(this._providers,i,t,s);if(this._debounceInformation.update(i,a.elapsed()),o!==this._currentRequest||(this._currentRequest=null,n!==i.getVersionId()))return;let c=[];l?.ranges&&(c=l.ranges),this._currentWordPattern=l?.wordPattern||this._languageWordPattern;let d=!1;for(let h=0,p=c.length;h<p;h++)if(L.Q.containsPosition(c[h],t)){if(d=!0,h!==0){const m=c[h];c.splice(h,1),c.unshift(m)}break}if(!d){this.clearRanges();return}const u=c.map(h=>({range:h,options:Uu.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations.set(u),this._syncRangesToken++}catch(a){(0,K.MB)(a)||(0,K.dz)(a),(this._currentRequest===o||!this._currentRequest)&&this.clearRanges()}}));return this._currentRequest=o,o})}};Ui.ID="editor.contrib.linkedEditing",Ui.DECORATION=ge.kI.register({description:"linked-editing",stickiness:0,className:Xf}),Ui=Iw([Ua(1,A.fN),Ua(2,te.u),Ua(3,it.JZ),Ua(4,si.U)],Ui);class Rw extends _.ks{constructor(){super({id:"editor.action.linkedEditing",label:g.kg("linkedEditing.label","Start Linked Editing"),alias:"Start Linked Editing",precondition:A.M$.and(D.R.writable,D.R.hasRenameProvider),kbOpts:{kbExpr:D.R.editorTextFocus,primary:3132,weight:100}})}runCommand(e,t){const i=e.get(Be.T),[n,o]=Array.isArray(t)&&t||[void 0,void 0];return me.r.isUri(n)&&ee.y.isIPosition(o)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(s=>{s&&(s.setPosition(o),s.invokeWithinContext(a=>(this.reportTelemetry(a,s),this.run(a,s))))},K.dz):super.runCommand(e,t)}run(e,t){const i=Ui.get(t);return i?Promise.resolve(i.updateRanges(!0)):Promise.resolve()}}const Ew=_.DX.bindToContribution(Ui.get);(0,_.E_)(new Ew({id:"cancelLinkedEditingInput",precondition:Yf,handler:r=>r.clearRanges(),kbOpts:{kbExpr:D.R.editorTextFocus,weight:199,primary:9,secondary:[1033]}}));function Jf(r,e,t,i){const n=r.ordered(e);return(0,V.$1)(n.map(o=>()=>Yc(this,void 0,void 0,function*(){try{return yield o.provideLinkedEditingRanges(e,t,i)}catch(s){(0,K.M_)(s);return}})),o=>!!o&&pe.EI(o?.ranges))}const Aw=(0,C.x1A)("editor.linkedEditingBackground",{dark:ce.Q1.fromHex("#f00").transparent(.3),light:ce.Q1.fromHex("#f00").transparent(.3),hcDark:ce.Q1.fromHex("#f00").transparent(.3),hcLight:ce.Q1.white},g.kg("editorLinkedEditingBackground","Background color when the editor auto renames on type."));(0,U.zy)((r,e)=>{const t=r.getColor(Aw);t&&e.addRule(`.monaco-editor .${Xf} { background: ${t}; border-left-color: ${t}; }`)}),(0,_.ke)("_executeLinkedEditingProvider",(r,e,t)=>{const{linkedEditingRangeProvider:i}=r.get(te.u);return Jf(i,e,t,re.X.None)}),(0,_.HW)(Ui.ID,Ui),(0,_.Fl)(Rw);var qf=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};class Nw{constructor(e,t){this._link=e,this._provider=t}toJSON(){return{range:this.range,url:this.url,tooltip:this.tooltip}}get range(){return this._link.range}get url(){return this._link.url}get tooltip(){return this._link.tooltip}resolve(e){return qf(this,void 0,void 0,function*(){return this._link.url?this._link.url:typeof this._provider.resolveLink=="function"?Promise.resolve(this._provider.resolveLink(this._link,e)).then(t=>(this._link=t||this._link,this._link.url?this.resolve(e):Promise.reject(new Error("missing")))):Promise.reject(new Error("missing"))})}}class za{constructor(e){this._disposables=new I.Cm;let t=[];for(const[i,n]of e){const o=i.links.map(s=>new Nw(s,n));t=za._union(t,o),(0,I.Xm)(i)&&this._disposables.add(i)}this.links=t}dispose(){this._disposables.dispose(),this.links.length=0}static _union(e,t){const i=[];let n,o,s,a;for(n=0,s=0,o=e.length,a=t.length;n<o&&s<a;){const l=e[n],c=t[s];if(L.Q.areIntersectingOrTouching(l.range,c.range)){n++;continue}L.Q.compareRangesUsingStarts(l.range,c.range)<0?(i.push(l),n++):(i.push(c),s++)}for(;n<o;n++)i.push(e[n]);for(;s<a;s++)i.push(t[s]);return i}}function ep(r,e,t){const i=[],n=r.ordered(e).reverse().map((o,s)=>Promise.resolve(o.provideLinks(e,t)).then(a=>{a&&(i[s]=[a,o])},K.M_));return Promise.all(n).then(()=>{const o=new za((0,pe.Yc)(i));return t.isCancellationRequested?(o.dispose(),new za([])):o})}fe.wb.registerCommand("_executeLinkProvider",(r,...e)=>qf(void 0,void 0,void 0,function*(){let[t,i]=e;(0,le.j)(t instanceof me.r),typeof i!="number"&&(i=0);const{linkProvider:n}=r.get(te.u),o=r.get($t.S).getModel(t);if(!o)return[];const s=yield ep(n,o,re.X.None);if(!s)return[];for(let l=0;l<Math.min(i,s.links.length);l++)yield s.links[l].resolve(re.X.None);const a=s.links.slice(0);return s.dispose(),a}));var Mw=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},$a=function(r,e){return function(t,i){e(t,i,r)}},Tw=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};let wo=class _m extends I.jG{constructor(e,t,i,n,o){super(),this.editor=e,this.openerService=t,this.notificationService=i,this.languageFeaturesService=n,this.providers=this.languageFeaturesService.linkProvider,this.debounceInformation=o.for(this.providers,"Links",{min:1e3,max:4e3}),this.computeLinks=this._register(new V.uC(()=>this.computeLinksNow(),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const s=this._register(new ad(e));this._register(s.onMouseMoveOrRelevantKeyDown(([a,l])=>{this._onEditorMouseMove(a,l)})),this._register(s.onExecute(a=>{this.onEditorMouseUp(a)})),this._register(s.onCancel(a=>{this.cleanUpActiveLinkDecoration()})),this._register(e.onDidChangeConfiguration(a=>{a.hasChanged(65)&&(this.updateDecorations([]),this.stop(),this.computeLinks.schedule(0))})),this._register(e.onDidChangeModelContent(a=>{this.editor.hasModel()&&this.computeLinks.schedule(this.debounceInformation.get(this.editor.getModel()))})),this._register(e.onDidChangeModel(a=>{this.currentOccurrences={},this.activeLinkDecorationId=null,this.stop(),this.computeLinks.schedule(0)})),this._register(e.onDidChangeModelLanguage(a=>{this.stop(),this.computeLinks.schedule(0)})),this._register(this.providers.onDidChange(a=>{this.stop(),this.computeLinks.schedule(0)})),this.computeLinks.schedule(0)}static get(e){return e.getContribution(_m.ID)}computeLinksNow(){return Tw(this,void 0,void 0,function*(){if(!this.editor.hasModel()||!this.editor.getOption(65))return;const e=this.editor.getModel();if(this.providers.has(e)){this.activeLinksList&&(this.activeLinksList.dispose(),this.activeLinksList=null),this.computePromise=(0,V.SS)(t=>ep(this.providers,e,t));try{const t=new Kt.W(!1);if(this.activeLinksList=yield this.computePromise,this.debounceInformation.update(e,t.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(t){(0,K.dz)(t)}finally{this.computePromise=null}}})}updateDecorations(e){const t=this.editor.getOption(72)==="altKey",i=[],n=Object.keys(this.currentOccurrences);for(const s of n){const a=this.currentOccurrences[s];i.push(a.decorationId)}const o=[];if(e)for(const s of e)o.push(Do.decoration(s,t));this.editor.changeDecorations(s=>{const a=s.deltaDecorations(i,o);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let l=0,c=a.length;l<c;l++){const d=new Do(e[l],a[l]);this.currentOccurrences[d.decorationId]=d}})}_onEditorMouseMove(e,t){const i=this.editor.getOption(72)==="altKey";if(this.isEnabled(e,t)){this.cleanUpActiveLinkDecoration();const n=this.getLinkOccurrence(e.target.position);n&&this.editor.changeDecorations(o=>{n.activate(o,i),this.activeLinkDecorationId=n.decorationId})}else this.cleanUpActiveLinkDecoration()}cleanUpActiveLinkDecoration(){const e=this.editor.getOption(72)==="altKey";if(this.activeLinkDecorationId){const t=this.currentOccurrences[this.activeLinkDecorationId];t&&this.editor.changeDecorations(i=>{t.deactivate(i,e)}),this.activeLinkDecorationId=null}}onEditorMouseUp(e){if(!this.isEnabled(e))return;const t=this.getLinkOccurrence(e.target.position);t&&this.openLinkOccurrence(t,e.hasSideBySideModifier,!0)}openLinkOccurrence(e,t,i=!1){if(!this.openerService)return;const{link:n}=e;n.resolve(re.X.None).then(o=>{if(typeof o=="string"&&this.editor.hasModel()){const s=this.editor.getModel().uri;if(s.scheme===Xe.ny.file&&o.startsWith(`${Xe.ny.file}:`)){const a=me.r.parse(o);if(a.scheme===Xe.ny.file){const l=De.su(a);let c=null;l.startsWith("/./")?c=`.${l.substr(1)}`:l.startsWith("//./")&&(c=`.${l.substr(2)}`),c&&(o=De.uJ(s,c))}}}return this.openerService.open(o,{openToSide:t,fromUserGesture:i,allowContributedOpeners:!0,allowCommands:!0,fromWorkspace:!0})},o=>{const s=o instanceof Error?o.message:o;s==="invalid"?this.notificationService.warn(g.kg("invalid.url","Failed to open this link because it is not well-formed: {0}",n.url.toString())):s==="missing"?this.notificationService.warn(g.kg("missing.url","Failed to open this link because its target is missing.")):(0,K.dz)(o)})}getLinkOccurrence(e){if(!this.editor.hasModel()||!e)return null;const t=this.editor.getModel().getDecorationsInRange({startLineNumber:e.lineNumber,startColumn:e.column,endLineNumber:e.lineNumber,endColumn:e.column},0,!0);for(const i of t){const n=this.currentOccurrences[i.id];if(n)return n}return null}isEnabled(e,t){return!!(e.target.type===6&&(e.hasTriggerModifier||t&&t.keyCodeIsTriggerKey))}stop(){var e;this.computeLinks.cancel(),this.activeLinksList&&((e=this.activeLinksList)===null||e===void 0||e.dispose(),this.activeLinksList=null),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop()}};wo.ID="editor.linkDetector",wo=Mw([$a(1,pt.Cr),$a(2,Ye.Ot),$a(3,te.u),$a(4,si.U)],wo);const tp={general:ge.kI.register({description:"detected-link",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:ge.kI.register({description:"detected-link-active",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class Do{constructor(e,t){this.link=e,this.decorationId=t}static decoration(e,t){return{range:e.range,options:Do._getOptions(e,t,!1)}}static _getOptions(e,t,i){const n=Object.assign({},i?tp.active:tp.general);return n.hoverMessage=Ow(e,t),n}activate(e,t){e.changeDecorationOptions(this.decorationId,Do._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,Do._getOptions(this.link,t,!1))}}function Ow(r,e){const t=r.url&&/^command:/i.test(r.url.toString()),i=r.tooltip?r.tooltip:t?g.kg("links.navigate.executeCmd","Execute command"):g.kg("links.navigate.follow","Follow link"),n=e?Se.zx?g.kg("links.navigate.kb.meta.mac","cmd + click"):g.kg("links.navigate.kb.meta","ctrl + click"):Se.zx?g.kg("links.navigate.kb.alt.mac","option + click"):g.kg("links.navigate.kb.alt","alt + click");if(r.url){let o="";if(/^command:/i.test(r.url.toString())){const a=r.url.toString().match(/^command:([^?#]+)/);if(a){const l=a[1];o=g.kg("tooltip.explanation","Execute command {0}",l)}}return new xe.Bc("",!0).appendLink(r.url.toString(!0).replace(/ /g,"%20"),i,o).appendMarkdown(` (${n})`)}else return new xe.Bc().appendText(`${i} (${n})`)}class Fw extends _.ks{constructor(){super({id:"editor.action.openLink",label:g.kg("label","Open Link"),alias:"Open Link",precondition:void 0})}run(e,t){const i=wo.get(t);if(!i||!t.hasModel())return;const n=t.getSelections();for(const o of n){const s=i.getLinkOccurrence(o.getEndPosition());s&&i.openLinkOccurrence(s,!1)}}}(0,_.HW)(wo.ID,wo),(0,_.Fl)(Fw),(0,U.zy)((r,e)=>{const t=r.getColor(C.Ztu);t&&e.addRule(`.monaco-editor .detected-link-active { color: ${t} !important; }`)});var Pw=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Ww=function(r,e){return function(t,i){e(t,i,r)}};function zi(r,e){const t=e.filter(i=>!r.find(n=>n.equals(i)));if(t.length>=1){const i=t.map(o=>`line ${o.viewState.position.lineNumber} column ${o.viewState.position.column}`).join(", "),n=t.length===1?g.kg("cursorAdded","Cursor added: {0}",i):g.kg("cursorsAdded","Cursors added: {0}",i);(0,ft.h5)(n)}}class Bw extends _.ks{constructor(){super({id:"editor.action.insertCursorAbove",label:g.kg("mutlicursor.insertAbove","Add Cursor Above"),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:D.R.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:z.D8.MenubarSelectionMenu,group:"3_multi",title:g.kg({key:"miInsertCursorAbove",comment:["&& denotes a mnemonic"]},"&&Add Cursor Above"),order:2}})}run(e,t,i){if(!t.hasModel())return;let n=!0;i&&i.logicalLine===!1&&(n=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const s=o.getCursorStates();o.setCursorStates(i.source,3,Gc.c.addCursorUp(o,s,n)),o.revealTopMostCursor(i.source),zi(s,o.getCursorStates())}}class Hw extends _.ks{constructor(){super({id:"editor.action.insertCursorBelow",label:g.kg("mutlicursor.insertBelow","Add Cursor Below"),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:D.R.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:z.D8.MenubarSelectionMenu,group:"3_multi",title:g.kg({key:"miInsertCursorBelow",comment:["&& denotes a mnemonic"]},"A&&dd Cursor Below"),order:3}})}run(e,t,i){if(!t.hasModel())return;let n=!0;i&&i.logicalLine===!1&&(n=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const s=o.getCursorStates();o.setCursorStates(i.source,3,Gc.c.addCursorDown(o,s,n)),o.revealBottomMostCursor(i.source),zi(s,o.getCursorStates())}}class Vw extends _.ks{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:g.kg("mutlicursor.insertAtEndOfEachLineSelected","Add Cursors to Line Ends"),alias:"Add Cursors to Line Ends",precondition:void 0,kbOpts:{kbExpr:D.R.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:z.D8.MenubarSelectionMenu,group:"3_multi",title:g.kg({key:"miInsertCursorAtEndOfEachLineSelected",comment:["&& denotes a mnemonic"]},"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,t,i){if(!e.isEmpty()){for(let n=e.startLineNumber;n<e.endLineNumber;n++){const o=t.getLineMaxColumn(n);i.push(new q.L(n,o,n,o))}e.endColumn>1&&i.push(new q.L(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=t.getSelections(),o=t._getViewModel(),s=o.getCursorStates(),a=[];n.forEach(l=>this.getCursorsForSelection(l,i,a)),a.length>0&&t.setSelections(a),zi(s,o.getCursorStates())}}class Uw extends _.ks{constructor(){super({id:"editor.action.addCursorsToBottom",label:g.kg("mutlicursor.addCursorsToBottom","Add Cursors To Bottom"),alias:"Add Cursors To Bottom",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),n=t.getModel().getLineCount(),o=[];for(let l=i[0].startLineNumber;l<=n;l++)o.push(new q.L(l,i[0].startColumn,l,i[0].endColumn));const s=t._getViewModel(),a=s.getCursorStates();o.length>0&&t.setSelections(o),zi(a,s.getCursorStates())}}class zw extends _.ks{constructor(){super({id:"editor.action.addCursorsToTop",label:g.kg("mutlicursor.addCursorsToTop","Add Cursors To Top"),alias:"Add Cursors To Top",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),n=[];for(let a=i[0].startLineNumber;a>=1;a--)n.push(new q.L(a,i[0].startColumn,a,i[0].endColumn));const o=t._getViewModel(),s=o.getCursorStates();n.length>0&&t.setSelections(n),zi(s,o.getCursorStates())}}class ja{constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}}class Qs{constructor(e,t,i,n,o,s,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=n,this.wholeWord=o,this.matchCase=s,this.currentMatch=a}static create(e,t){if(!e.hasModel())return null;const i=t.getState();if(!e.hasTextFocus()&&i.isRevealed&&i.searchString.length>0)return new Qs(e,t,!1,i.searchString,i.wholeWord,i.matchCase,null);let n=!1,o,s;const a=e.getSelections();a.length===1&&a[0].isEmpty()?(n=!0,o=!0,s=!0):(o=i.wholeWord,s=i.matchCase);const l=e.getSelection();let c,d=null;if(l.isEmpty()){const u=e.getConfiguredWordAtPosition(l.getStartPosition());if(!u)return null;c=u.word,d=new q.L(l.startLineNumber,u.startColumn,l.startLineNumber,u.endColumn)}else c=e.getModel().getValueInRange(l).replace(/\r\n/g,`
`);return new Qs(e,t,n,c,o,s,d)}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new ja(t.concat(e),e,0)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new ja(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const n=this.currentMatch;return this.currentMatch=null,n}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(119):null,!1);return i?new q.L(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}addSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new ja(t.concat(e),e,0)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new ja(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const n=this.currentMatch;return this.currentMatch=null,n}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(119):null,!1);return i?new q.L(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}selectAll(e){if(!this._editor.hasModel())return[];this.findController.highlightFindOptions();const t=this._editor.getModel();return e?t.findMatches(this.searchText,e,!1,this.matchCase,this.wholeWord?this._editor.getOption(119):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(119):null,!1,1073741824)}}class bn extends I.jG{constructor(e){super(),this._sessionDispose=this._register(new I.Cm),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}static get(e){return e.getContribution(bn.ID)}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=Qs.create(this._editor,e);if(!t)return;this._session=t;const i={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(i.wholeWordOverride=1,i.matchCaseOverride=1,i.isRegexOverride=2),e.getState().change(i,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(n=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(n=>{(n.matchCase||n.wholeWord)&&this._endSession()}))}}_endSession(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){const e={wholeWordOverride:0,matchCaseOverride:0,isRegexOverride:0};this._session.findController.getState().change(e,!1)}this._session=null}_setSelections(e){this._ignoreSelectionChange=!0,this._editor.setSelections(e),this._ignoreSelectionChange=!1}_expandEmptyToWord(e,t){if(!t.isEmpty())return t;const i=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return i?new q.L(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):t}_applySessionResult(e){e&&(this._setSelections(e.selections),e.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange,e.revealScrollType))}getSession(e){return this._session}addSelectionToNextFindMatch(e){if(this._editor.hasModel()){if(!this._session){const t=this._editor.getSelections();if(t.length>1){const n=e.getState().matchCase;if(!ip(this._editor.getModel(),t,n)){const s=this._editor.getModel(),a=[];for(let l=0,c=t.length;l<c;l++)a[l]=this._expandEmptyToWord(s,t[l]);this._editor.setSelections(a);return}}}this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.addSelectionToNextFindMatch())}}addSelectionToPreviousFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.addSelectionToPreviousFindMatch())}moveSelectionToNextFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.moveSelectionToNextFindMatch())}moveSelectionToPreviousFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.moveSelectionToPreviousFindMatch())}selectAll(e){if(!this._editor.hasModel())return;let t=null;const i=e.getState();if(i.isRevealed&&i.searchString.length>0&&i.isRegex){const n=this._editor.getModel();i.searchScope?t=n.findMatches(i.searchString,i.searchScope,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(119):null,!1,1073741824):t=n.findMatches(i.searchString,!0,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(119):null,!1,1073741824)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(i.searchScope)}if(t.length>0){const n=this._editor.getSelection();for(let o=0,s=t.length;o<s;o++){const a=t[o];if(a.range.intersectRanges(n)){t[o]=t[0],t[0]=a;break}}this._setSelections(t.map(o=>new q.L(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn)))}}}bn.ID="editor.contrib.multiCursorController";class xo extends _.ks{run(e,t){const i=bn.get(t);if(!i)return;const n=ct.get(t);if(!n)return;const o=t._getViewModel();if(o){const s=o.getCursorStates();this._run(i,n),zi(s,o.getCursorStates())}}}class $w extends xo{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:g.kg("addSelectionToNextFindMatch","Add Selection To Next Find Match"),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:D.R.focus,primary:2082,weight:100},menuOpts:{menuId:z.D8.MenubarSelectionMenu,group:"3_multi",title:g.kg({key:"miAddSelectionToNextFindMatch",comment:["&& denotes a mnemonic"]},"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class jw extends xo{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:g.kg("addSelectionToPreviousFindMatch","Add Selection To Previous Find Match"),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:z.D8.MenubarSelectionMenu,group:"3_multi",title:g.kg({key:"miAddSelectionToPreviousFindMatch",comment:["&& denotes a mnemonic"]},"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class Gw extends xo{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:g.kg("moveSelectionToNextFindMatch","Move Last Selection To Next Find Match"),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:D.R.focus,primary:(0,Ee.m5)(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class Kw extends xo{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:g.kg("moveSelectionToPreviousFindMatch","Move Last Selection To Previous Find Match"),alias:"Move Last Selection To Previous Find Match",precondition:void 0})}_run(e,t){e.moveSelectionToPreviousFindMatch(t)}}class Qw extends xo{constructor(){super({id:"editor.action.selectHighlights",label:g.kg("selectAllOccurrencesOfFindMatch","Select All Occurrences of Find Match"),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:D.R.focus,primary:3114,weight:100},menuOpts:{menuId:z.D8.MenubarSelectionMenu,group:"3_multi",title:g.kg({key:"miSelectHighlights",comment:["&& denotes a mnemonic"]},"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class Zw extends xo{constructor(){super({id:"editor.action.changeAll",label:g.kg("changeAll.label","Change All Occurrences"),alias:"Change All Occurrences",precondition:A.M$.and(D.R.writable,D.R.editorTextFocus),kbOpts:{kbExpr:D.R.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class Yw{constructor(e,t,i,n,o){this._model=e,this._searchText=t,this._matchCase=i,this._wordSeparators=n,this._modelVersionId=this._model.getVersionId(),this._cachedFindMatches=null,o&&this._model===o._model&&this._searchText===o._searchText&&this._matchCase===o._matchCase&&this._wordSeparators===o._wordSeparators&&this._modelVersionId===o._modelVersionId&&(this._cachedFindMatches=o._cachedFindMatches)}findMatches(){return this._cachedFindMatches===null&&(this._cachedFindMatches=this._model.findMatches(this._searchText,!0,!1,this._matchCase,this._wordSeparators,!1).map(e=>e.range),this._cachedFindMatches.sort(L.Q.compareRangesUsingStarts)),this._cachedFindMatches}}let Sn=class Sl extends I.jG{constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(99),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new V.uC(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(n=>{this._isEnabled=e.getOption(99)})),this._register(e.onDidChangeCursorSelection(n=>{this._isEnabled&&(n.selection.isEmpty()?n.reason===3?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())})),this._register(e.onDidChangeModel(n=>{this._setState(null)})),this._register(e.onDidChangeModelContent(n=>{this._isEnabled&&this.updateSoon.schedule()}));const i=ct.get(e);i&&this._register(i.getState().onFindReplaceStateChange(n=>{this._update()}))}_update(){this._setState(Sl._createState(this.state,this._isEnabled,this.editor))}static _createState(e,t,i){if(!t||!i.hasModel())return null;const n=i.getSelection();if(n.startLineNumber!==n.endLineNumber)return null;const o=bn.get(i);if(!o)return null;const s=ct.get(i);if(!s)return null;let a=o.getSession(s);if(!a){const d=i.getSelections();if(d.length>1){const h=s.getState().matchCase;if(!ip(i.getModel(),d,h))return null}a=Qs.create(i,s)}if(!a||a.currentMatch||/^[ \t]+$/.test(a.searchText)||a.searchText.length>200)return null;const l=s.getState(),c=l.matchCase;if(l.isRevealed){let d=l.searchString;c||(d=d.toLowerCase());let u=a.searchText;if(c||(u=u.toLowerCase()),d===u&&a.matchCase===l.matchCase&&a.wholeWord===l.wholeWord&&!l.isRegex)return null}return new Yw(i.getModel(),a.searchText,a.matchCase,a.wholeWord?i.getOption(119):null,e)}_setState(e){if(this.state=e,!this.state){this._decorations.clear();return}if(!this.editor.hasModel())return;const t=this.editor.getModel();if(t.isTooLargeForTokenization())return;const i=this.state.findMatches(),n=this.editor.getSelections();n.sort(L.Q.compareRangesUsingStarts);const o=[];for(let l=0,c=0,d=i.length,u=n.length;l<d;){const h=i[l];if(c>=u)o.push(h),l++;else{const p=L.Q.compareRangesUsingStarts(h,n[c]);p<0?((n[c].isEmpty()||!L.Q.areIntersecting(h,n[c]))&&o.push(h),l++):(p>0||l++,c++)}}const s=this._languageFeaturesService.documentHighlightProvider.has(t)&&this.editor.getOption(74),a=o.map(l=>({range:l,options:s?Sl._SELECTION_HIGHLIGHT:Sl._SELECTION_HIGHLIGHT_OVERVIEW}));this._decorations.set(a)}dispose(){this._setState(null),super.dispose()}};Sn.ID="editor.contrib.selectionHighlighter",Sn._SELECTION_HIGHLIGHT_OVERVIEW=ge.kI.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",minimap:{color:(0,U.Yf)(C.Xp1),position:We.R3.Inline},overviewRuler:{color:(0,U.Yf)(C.z5H),position:We.A5.Center}}),Sn._SELECTION_HIGHLIGHT=ge.kI.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"}),Sn=Pw([Ww(1,te.u)],Sn);function ip(r,e,t){const i=np(r,e[0],!t);for(let n=1,o=e.length;n<o;n++){const s=e[n];if(s.isEmpty())return!1;const a=np(r,s,!t);if(i!==a)return!1}return!0}function np(r,e,t){const i=r.getValueInRange(e);return t?i.toLowerCase():i}class Xw extends _.ks{constructor(){super({id:"editor.action.focusNextCursor",label:g.kg("mutlicursor.focusNextCursor","Focus Next Cursor"),description:{description:g.kg("mutlicursor.focusNextCursor.description","Focuses the next cursor"),args:[]},alias:"Focus Next Cursor",precondition:void 0})}run(e,t,i){if(!t.hasModel())return;const n=t._getViewModel();if(n.cursorConfig.readOnly)return;n.model.pushStackElement();const o=Array.from(n.getCursorStates()),s=o.shift();s&&(o.push(s),n.setCursorStates(i.source,3,o),n.revealPrimaryCursor(i.source,!0),zi(o,n.getCursorStates()))}}class Jw extends _.ks{constructor(){super({id:"editor.action.focusPreviousCursor",label:g.kg("mutlicursor.focusPreviousCursor","Focus Previous Cursor"),description:{description:g.kg("mutlicursor.focusPreviousCursor.description","Focuses the previous cursor"),args:[]},alias:"Focus Previous Cursor",precondition:void 0})}run(e,t,i){if(!t.hasModel())return;const n=t._getViewModel();if(n.cursorConfig.readOnly)return;n.model.pushStackElement();const o=Array.from(n.getCursorStates()),s=o.pop();s&&(o.unshift(s),n.setCursorStates(i.source,3,o),n.revealPrimaryCursor(i.source,!0),zi(o,n.getCursorStates()))}}(0,_.HW)(bn.ID,bn),(0,_.HW)(Sn.ID,Sn),(0,_.Fl)(Bw),(0,_.Fl)(Hw),(0,_.Fl)(Vw),(0,_.Fl)($w),(0,_.Fl)(jw),(0,_.Fl)(Gw),(0,_.Fl)(Kw),(0,_.Fl)(Qw),(0,_.Fl)(Zw),(0,_.Fl)(Uw),(0,_.Fl)(zw),(0,_.Fl)(Xw),(0,_.Fl)(Jw);var op=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};const yn={Visible:new A.N1("parameterHintsVisible",!1),MultipleSignatures:new A.N1("parameterHintsMultipleSignatures",!1)};function sp(r,e,t,i,n){return op(this,void 0,void 0,function*(){const o=r.ordered(e);for(const s of o)try{const a=yield s.provideSignatureHelp(e,t,n,i);if(a)return a}catch(a){(0,K.M_)(a)}})}fe.wb.registerCommand("_executeSignatureHelpProvider",(r,...e)=>op(void 0,void 0,void 0,function*(){const[t,i,n]=e;(0,le.j)(me.r.isUri(t)),(0,le.j)(ee.y.isIPosition(i)),(0,le.j)(typeof n=="string"||!n);const o=r.get(te.u),s=yield r.get(Ft.b).createModelReference(t);try{const a=yield sp(o.signatureHelpProvider,s.object.textEditorModel,ee.y.lift(i),{triggerKind:_e.WA.Invoke,isRetrigger:!1,triggerCharacter:n},re.X.None);return a?(setTimeout(()=>a.dispose(),0),a.value):void 0}finally{s.dispose()}}));var qw=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})},$i;(function(r){r.Default={type:0};class e{constructor(n,o){this.request=n,this.previouslyActiveHints=o,this.type=2}}r.Pending=e;class t{constructor(n){this.hints=n,this.type=1}}r.Active=t})($i||($i={}));class Ga extends I.jG{constructor(e,t,i=Ga.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new Z.vl),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=$i.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new I.HE),this.triggerChars=new ho.y,this.retriggerChars=new ho.y,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new V.ve(i),this._register(this.editor.onDidBlurEditorWidget(()=>this.cancel())),this._register(this.editor.onDidChangeConfiguration(()=>this.onEditorConfigurationChange())),this._register(this.editor.onDidChangeModel(n=>this.onModelChanged())),this._register(this.editor.onDidChangeModelLanguage(n=>this.onModelChanged())),this._register(this.editor.onDidChangeCursorSelection(n=>this.onCursorChange(n))),this._register(this.editor.onDidChangeModelContent(n=>this.onModelContentChange())),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType(n=>this.onDidType(n))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){this._state.type===2&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=$i.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){const i=this.editor.getModel();if(!i||!this.providers.has(i))return;const n=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(n),t).catch(K.dz)}next(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t%e===e-1,n=this.editor.getOption(78).cycle;if((e<2||i)&&!n){this.cancel();return}this.updateActiveSignature(i&&n?0:t+1)}previous(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t===0,n=this.editor.getOption(78).cycle;if((e<2||i)&&!n){this.cancel();return}this.updateActiveSignature(i&&n?e-1:t-1)}updateActiveSignature(e){this.state.type===1&&(this.state=new $i.Active(Object.assign(Object.assign({},this.state.hints),{activeSignature:e})),this._onChangedHints.fire(this.state.hints))}doTrigger(e){return qw(this,void 0,void 0,function*(){const t=this.state.type===1||this.state.type===2,i=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;const n=this._pendingTriggers.reduce(eD);this._pendingTriggers=[];const o={triggerKind:n.triggerKind,triggerCharacter:n.triggerCharacter,isRetrigger:t,activeSignatureHelp:i};if(!this.editor.hasModel())return!1;const s=this.editor.getModel(),a=this.editor.getPosition();this.state=new $i.Pending((0,V.SS)(l=>sp(this.providers,s,a,o,l)),i);try{const l=yield this.state.request;return e!==this.triggerId?(l?.dispose(),!1):!l||!l.value.signatures||l.value.signatures.length===0?(l?.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1):(this.state=new $i.Active(l.value),this._lastSignatureHelpResult.value=l,this._onChangedHints.fire(this.state.hints),!0)}catch(l){return e===this.triggerId&&(this.state=$i.Default),(0,K.dz)(l),!1}})}getLastActiveHints(){switch(this.state.type){case 1:return this.state.hints;case 2:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return this.state.type===1||this.state.type===2||this.throttledDelayer.isTriggered()}onModelChanged(){this.cancel(),this.triggerChars=new ho.y,this.retriggerChars=new ho.y;const e=this.editor.getModel();if(e)for(const t of this.providers.ordered(e)){for(const i of t.signatureHelpTriggerCharacters||[])this.triggerChars.add(i.charCodeAt(0)),this.retriggerChars.add(i.charCodeAt(0));for(const i of t.signatureHelpRetriggerCharacters||[])this.retriggerChars.add(i.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const t=e.length-1,i=e.charCodeAt(t);(this.triggerChars.has(i)||this.isTriggered&&this.retriggerChars.has(i))&&this.trigger({triggerKind:_e.WA.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:_e.WA.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:_e.WA.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(78).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}}Ga.DEFAULT_DELAY=120;function eD(r,e){switch(e.triggerKind){case _e.WA.Invoke:return e;case _e.WA.ContentChange:return r;case _e.WA.TriggerCharacter:default:return e}}var tD=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Ka=function(r,e){return function(t,i){e(t,i,r)}};const vt=S.$,iD=(0,Ge.pU)("parameter-hints-next",Q.W6.chevronDown,g.kg("parameterHintsNextIcon","Icon for show next parameter hint.")),nD=(0,Ge.pU)("parameter-hints-previous",Q.W6.chevronUp,g.kg("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let Qa=class vm extends I.jG{constructor(e,t,i,n,o){super(),this.editor=e,this.renderDisposeables=this._register(new I.Cm),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new li({editor:e},n,i)),this.model=this._register(new Ga(e,o.signatureHelpProvider)),this.keyVisible=yn.Visible.bindTo(t),this.keyMultipleSignatures=yn.MultipleSignatures.bindTo(t),this._register(this.model.onChangedHints(s=>{s?(this.show(),this.render(s)):this.hide()}))}createParameterHintDOMNodes(){const e=vt(".editor-widget.parameter-hints-widget"),t=S.BC(e,vt(".phwrapper"));t.tabIndex=-1;const i=S.BC(t,vt(".controls")),n=S.BC(i,vt(".button"+U.L0.asCSSSelector(nD))),o=S.BC(i,vt(".overloads")),s=S.BC(i,vt(".button"+U.L0.asCSSSelector(iD)));this._register(S.ko(n,"click",h=>{S.fs.stop(h),this.previous()})),this._register(S.ko(s,"click",h=>{S.fs.stop(h),this.next()}));const a=vt(".body"),l=new Hr.MU(a,{alwaysConsumeMouseWheel:!0});this._register(l),t.appendChild(l.getDomNode());const c=S.BC(a,vt(".signature")),d=S.BC(a,vt(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:c,overloads:o,docs:d,scrollbar:l},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(h=>{this.visible&&this.editor.layoutContentWidget(this)}));const u=()=>{if(!this.domNodes)return;const h=this.editor.getOption(46);this.domNodes.element.style.fontSize=`${h.fontSize}px`,this.domNodes.element.style.lineHeight=`${h.lineHeight/h.fontSize}`};u(),this._register(Z.Jh.chain(this.editor.onDidChangeConfiguration.bind(this.editor)).filter(h=>h.hasChanged(46)).on(u,null)),this._register(this.editor.onDidLayoutChange(h=>this.updateMaxHeight())),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout(()=>{var e;(e=this.domNodes)===null||e===void 0||e.element.classList.add("visible")},100),this.editor.layoutContentWidget(this))}hide(){var e;this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,(e=this.domNodes)===null||e===void 0||e.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){var t;if(this.renderDisposeables.clear(),!this.domNodes)return;const i=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",i),this.keyMultipleSignatures.set(i),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const n=e.signatures[e.activeSignature];if(!n)return;const o=S.BC(this.domNodes.signature,vt(".code")),s=this.editor.getOption(46);o.style.fontSize=`${s.fontSize}px`,o.style.fontFamily=s.fontFamily;const a=n.parameters.length>0,l=(t=n.activeParameter)!==null&&t!==void 0?t:e.activeParameter;if(a)this.renderParameters(o,n,l);else{const u=S.BC(o,vt("span"));u.textContent=n.label}const c=n.parameters[l];if(c?.documentation){const u=vt("span.documentation");if(typeof c.documentation=="string")u.textContent=c.documentation;else{const h=this.renderMarkdownDocs(c.documentation);u.appendChild(h.element)}S.BC(this.domNodes.docs,vt("p",{},u))}if(n.documentation!==void 0)if(typeof n.documentation=="string")S.BC(this.domNodes.docs,vt("p",{},n.documentation));else{const u=this.renderMarkdownDocs(n.documentation);S.BC(this.domNodes.docs,u.element)}const d=this.hasDocs(n,c);if(this.domNodes.signature.classList.toggle("has-docs",d),this.domNodes.docs.classList.toggle("empty",!d),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,c){let u="";const h=n.parameters[l];Array.isArray(h.label)?u=n.label.substring(h.label[0],h.label[1]):u=h.label,h.documentation&&(u+=typeof h.documentation=="string"?`, ${h.documentation}`:`, ${h.documentation.value}`),n.documentation&&(u+=typeof n.documentation=="string"?`, ${n.documentation}`:`, ${n.documentation.value}`),this.announcedLabel!==u&&(ft.xE(g.kg("hint","{0}, hint",u)),this.announcedLabel=u)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=this.renderDisposeables.add(this.markdownRenderer.render(e,{asyncRenderCallback:()=>{var i;(i=this.domNodes)===null||i===void 0||i.scrollbar.scanDomNode()}}));return t.element.classList.add("markdown-docs"),t}hasDocs(e,t){return!!(t&&typeof t.documentation=="string"&&(0,le.eU)(t.documentation).length>0||t&&typeof t.documentation=="object"&&(0,le.eU)(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&(0,le.eU)(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&(0,le.eU)(e.documentation.value).length>0)}renderParameters(e,t,i){const[n,o]=this.getParameterLabelOffsets(t,i),s=document.createElement("span");s.textContent=t.label.substring(0,n);const a=document.createElement("span");a.textContent=t.label.substring(n,o),a.className="parameter active";const l=document.createElement("span");l.textContent=t.label.substring(o),S.BC(e,s,a,l)}getParameterLabelOffsets(e,t){const i=e.parameters[t];if(i){if(Array.isArray(i.label))return i.label;if(i.label.length){const n=new RegExp(`(\\W|^)${(0,G.bm)(i.label)}(?=\\W|$)`,"g");n.test(e.label);const o=n.lastIndex-i.label.length;return o>=0?[o,n.lastIndex]:[0,0]}else return[0,0]}else return[0,0]}next(){this.editor.focus(),this.model.next()}previous(){this.editor.focus(),this.model.previous()}cancel(){this.model.cancel()}getDomNode(){return this.domNodes||this.createParameterHintDOMNodes(),this.domNodes.element}getId(){return vm.ID}trigger(e){this.model.trigger(e,0)}updateMaxHeight(){if(!this.domNodes)return;const t=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=t;const i=this.domNodes.element.getElementsByClassName("phwrapper");i.length&&(i[0].style.maxHeight=t)}};Qa.ID="editor.widget.parameterHintsWidget",Qa=tD([Ka(1,A.fN),Ka(2,pt.Cr),Ka(3,xt.L),Ka(4,te.u)],Qa);const oD=(0,C.x1A)("editorHoverWidget.highlightForeground",{dark:C.QI5,light:C.QI5,hcDark:C.QI5,hcLight:C.QI5},g.kg("editorHoverWidgetHighlightForeground","Foreground color of the active item in the parameter hint."));(0,U.zy)((r,e)=>{const t=r.getColor(C.oZ8);if(t){const c=(0,bt.Bb)(r.type)?2:1;e.addRule(`.monaco-editor .parameter-hints-widget { border: ${c}px solid ${t}; }`),e.addRule(`.monaco-editor .parameter-hints-widget.multiple .body { border-left: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .parameter-hints-widget .signature.has-docs { border-bottom: 1px solid ${t.transparent(.5)}; }`)}const i=r.getColor(C.WfR);i&&e.addRule(`.monaco-editor .parameter-hints-widget { background-color: ${i}; }`);const n=r.getColor(C.vwp);n&&e.addRule(`.monaco-editor .parameter-hints-widget a { color: ${n}; }`);const o=r.getColor(C.FEE);o&&e.addRule(`.monaco-editor .parameter-hints-widget a:hover { color: ${o}; }`);const s=r.getColor(C.Xo2);s&&e.addRule(`.monaco-editor .parameter-hints-widget { color: ${s}; }`);const a=r.getColor(C.S6W);a&&e.addRule(`.monaco-editor .parameter-hints-widget code { background-color: ${a}; }`);const l=r.getColor(oD);l&&e.addRule(`.monaco-editor .parameter-hints-widget .parameter.active { color: ${l}}`)});var sD=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},rD=function(r,e){return function(t,i){e(t,i,r)}};let wn=class Cm extends I.jG{constructor(e,t){super(),this.editor=e,this.widget=this._register(t.createInstance(Qa,this.editor))}static get(e){return e.getContribution(Cm.ID)}cancel(){this.widget.cancel()}previous(){this.widget.previous()}next(){this.widget.next()}trigger(e){this.widget.trigger(e)}};wn.ID="editor.controller.parameterHints",wn=sD([rD(1,he._Y)],wn);class aD extends _.ks{constructor(){super({id:"editor.action.triggerParameterHints",label:g.kg("parameterHints.trigger.label","Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:D.R.hasSignatureHelpProvider,kbOpts:{kbExpr:D.R.editorTextFocus,primary:3082,weight:100}})}run(e,t){const i=wn.get(t);i&&i.trigger({triggerKind:_e.WA.Invoke})}}(0,_.HW)(wn.ID,wn),(0,_.Fl)(aD);const Xc=175,Jc=_.DX.bindToContribution(wn.get);(0,_.E_)(new Jc({id:"closeParameterHints",precondition:yn.Visible,handler:r=>r.cancel(),kbOpts:{weight:Xc,kbExpr:D.R.focus,primary:9,secondary:[1033]}})),(0,_.E_)(new Jc({id:"showPrevParameterHint",precondition:A.M$.and(yn.Visible,yn.MultipleSignatures),handler:r=>r.previous(),kbOpts:{weight:Xc,kbExpr:D.R.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}})),(0,_.E_)(new Jc({id:"showNextParameterHint",precondition:A.M$.and(yn.Visible,yn.MultipleSignatures),handler:r=>r.next(),kbOpts:{weight:Xc,kbExpr:D.R.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));var lD=f(41504),dD=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},qc=function(r,e){return function(t,i){e(t,i,r)}};const Za=new A.N1("renameInputVisible",!1,(0,g.kg)("renameInputVisible","Whether the rename input widget is visible"));let eu=class{constructor(e,t,i,n,o){this._editor=e,this._acceptKeybindings=t,this._themeService=i,this._keybindingService=n,this._disposables=new I.Cm,this.allowEditorOverflow=!0,this._visibleContextKey=Za.bindTo(o),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(46)&&this._updateFont()})),this._disposables.add(i.onDidColorThemeChange(this._updateStyles,this))}dispose(){this._disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return"__renameInputWidget"}getDomNode(){if(!this._domNode){this._domNode=document.createElement("div"),this._domNode.className="monaco-editor rename-box",this._input=document.createElement("input"),this._input.className="rename-input",this._input.type="text",this._input.setAttribute("aria-label",(0,g.kg)("renameAriaLabel","Rename input. Type new name and press Enter to commit.")),this._domNode.appendChild(this._input),this._label=document.createElement("div"),this._label.className="rename-label",this._domNode.appendChild(this._label);const e=()=>{var t,i;const[n,o]=this._acceptKeybindings;this._keybindingService.lookupKeybinding(n),this._label.innerText=(0,g.kg)({key:"label",comment:['placeholders are keybindings, e.g "F2 to Rename, Shift+F2 to Preview"']},"{0} to Rename, {1} to Preview",(t=this._keybindingService.lookupKeybinding(n))===null||t===void 0?void 0:t.getLabel(),(i=this._keybindingService.lookupKeybinding(o))===null||i===void 0?void 0:i.getLabel())};e(),this._disposables.add(this._keybindingService.onDidUpdateKeybindings(e)),this._updateFont(),this._updateStyles(this._themeService.getColorTheme())}return this._domNode}_updateStyles(e){var t,i,n,o;if(!this._input||!this._domNode)return;const s=e.getColor(C.f9l);this._domNode.style.backgroundColor=String((t=e.getColor(C.CgL))!==null&&t!==void 0?t:""),this._domNode.style.boxShadow=s?` 0 0 8px 2px ${s}`:"",this._domNode.style.color=String((i=e.getColor(C.cws))!==null&&i!==void 0?i:""),this._input.style.backgroundColor=String((n=e.getColor(C.L4c))!==null&&n!==void 0?n:"");const a=e.getColor(C.Zgs);this._input.style.borderWidth=a?"1px":"0px",this._input.style.borderStyle=a?"solid":"none",this._input.style.borderColor=(o=a?.toString())!==null&&o!==void 0?o:"none"}_updateFont(){if(!this._input||!this._label)return;const e=this._editor.getOption(46);this._input.style.fontFamily=e.fontFamily,this._input.style.fontWeight=e.fontWeight,this._input.style.fontSize=`${e.fontSize}px`,this._label.style.fontSize=`${e.fontSize*.8}px`}getPosition(){return this._visible?{position:this._position,preference:[2,1]}:null}afterRender(e){e||this.cancelInput(!0)}acceptInput(e){var t;(t=this._currentAcceptInput)===null||t===void 0||t.call(this,e)}cancelInput(e){var t;(t=this._currentCancelInput)===null||t===void 0||t.call(this,e)}getInput(e,t,i,n,o,s){this._domNode.classList.toggle("preview",o),this._position=new ee.y(e.startLineNumber,e.startColumn),this._input.value=t,this._input.setAttribute("selectionStart",i.toString()),this._input.setAttribute("selectionEnd",n.toString()),this._input.size=Math.max((e.endColumn-e.startColumn)*1.1,20);const a=new I.Cm;return new Promise(l=>{this._currentCancelInput=c=>(this._currentAcceptInput=void 0,this._currentCancelInput=void 0,l(c),!0),this._currentAcceptInput=c=>{if(this._input.value.trim().length===0||this._input.value===t){this.cancelInput(!0);return}this._currentAcceptInput=void 0,this._currentCancelInput=void 0,l({newName:this._input.value,wantsPreview:o&&c})},a.add(s.onCancellationRequested(()=>this.cancelInput(!0))),a.add(this._editor.onDidBlurEditorWidget(()=>this.cancelInput(!1))),this._show()}).finally(()=>{a.dispose(),this._hide()})}_show(){this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,0),this._visible=!0,this._visibleContextKey.set(!0),this._editor.layoutContentWidget(this),setTimeout(()=>{this._input.focus(),this._input.setSelectionRange(parseInt(this._input.getAttribute("selectionStart")),parseInt(this._input.getAttribute("selectionEnd")))},100)}_hide(){this._visible=!1,this._visibleContextKey.reset(),this._editor.layoutContentWidget(this)}};eu=dD([qc(2,U.Gy),qc(3,tt.b),qc(4,A.fN)],eu);var cD=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Dn=function(r,e){return function(t,i){e(t,i,r)}},xn=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};class tu{constructor(e,t,i){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=i.ordered(e)}hasProvider(){return this._providers.length>0}resolveRenameLocation(e){return xn(this,void 0,void 0,function*(){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx<this._providers.length;this._providerRenameIdx++){const n=this._providers[this._providerRenameIdx];if(!n.resolveRenameLocation)break;const o=yield n.resolveRenameLocation(this.model,this.position,e);if(o){if(o.rejectReason){t.push(o.rejectReason);continue}return o}}const i=this.model.getWordAtPosition(this.position);return i?{range:new L.Q(this.position.lineNumber,i.startColumn,this.position.lineNumber,i.endColumn),text:i.word,rejectReason:t.length>0?t.join(`
`):void 0}:{range:L.Q.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join(`
`):void 0}})}provideRenameEdits(e,t){return xn(this,void 0,void 0,function*(){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)})}_provideRenameEdits(e,t,i,n){return xn(this,void 0,void 0,function*(){const o=this._providers[t];if(!o)return{edits:[],rejectReason:i.join(`
`)};const s=yield o.provideRenameEdits(this.model,this.position,e,n);if(s){if(s.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(s.rejectReason),n)}else return this._provideRenameEdits(e,t+1,i.concat(g.kg("no result","No result.")),n);return s})}}function uD(r,e,t,i){return xn(this,void 0,void 0,function*(){const n=new tu(e,t,r),o=yield n.resolveRenameLocation(re.X.None);return o?.rejectReason?{edits:[],rejectReason:o.rejectReason}:n.provideRenameEdits(i,re.X.None)})}let Ln=class bm{constructor(e,t,i,n,o,s,a,l){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=n,this._progressService=o,this._logService=s,this._configService=a,this._languageFeaturesService=l,this._disposableStore=new I.Cm,this._cts=new re.Q,this._renameInputField=this._disposableStore.add(new V.kb(()=>this._disposableStore.add(this._instaService.createInstance(eu,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))))}static get(e){return e.getContribution(bm.ID)}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}run(){var e,t;return xn(this,void 0,void 0,function*(){if(this._cts.dispose(!0),!this.editor.hasModel())return;const i=this.editor.getPosition(),n=new tu(this.editor.getModel(),i,this._languageFeaturesService.renameProvider);if(!n.hasProvider())return;this._cts=new Di.gI(this.editor,5);let o;try{const h=n.resolveRenameLocation(this._cts.token);this._progressService.showWhile(h,250),o=yield h}catch(h){(e=lt.get(this.editor))===null||e===void 0||e.showMessage(h||g.kg("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),i);return}if(!o)return;if(o.rejectReason){(t=lt.get(this.editor))===null||t===void 0||t.showMessage(o.rejectReason,i);return}if(this._cts.token.isCancellationRequested)return;this._cts.dispose(),this._cts=new Di.gI(this.editor,5,o.range);const s=this.editor.getSelection();let a=0,l=o.text.length;!L.Q.isEmpty(s)&&!L.Q.spansMultipleLines(s)&&L.Q.containsRange(o.range,s)&&(a=Math.max(0,s.startColumn-o.range.startColumn),l=Math.min(o.range.endColumn,s.endColumn)-o.range.startColumn);const c=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),d=yield this._renameInputField.value.getInput(o.range,o.text,a,l,c,this._cts.token);if(typeof d=="boolean"){d&&this.editor.focus();return}this.editor.focus();const u=(0,V.PK)(n.provideRenameEdits(d.newName,this._cts.token),this._cts.token).then(h=>xn(this,void 0,void 0,function*(){if(!(!h||!this.editor.hasModel())){if(h.rejectReason){this._notificationService.info(h.rejectReason);return}this.editor.setSelection(L.Q.fromPositions(this.editor.getSelection().getPosition())),this._bulkEditService.apply(wi.jN.convert(h),{editor:this.editor,showPreview:d.wantsPreview,label:g.kg("label","Renaming '{0}' to '{1}'",o?.text,d.newName),code:"undoredo.rename",quotableLabel:g.kg("quotableLabel","Renaming {0} to {1}",o?.text,d.newName),respectAutoSaveConfig:!0}).then(p=>{p.ariaSummary&&(0,ft.xE)(g.kg("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",o.text,d.newName,p.ariaSummary))}).catch(p=>{this._notificationService.error(g.kg("rename.failedApply","Rename failed to apply edits")),this._logService.error(p)})}}),h=>{this._notificationService.error(g.kg("rename.failed","Rename failed to compute edits")),this._logService.error(h)});return this._progressService.showWhile(u,250),u})}acceptRenameInput(e){this._renameInputField.value.acceptInput(e)}cancelRenameInput(){this._renameInputField.value.cancelInput(!0)}};Ln.ID="editor.contrib.renameController",Ln=cD([Dn(1,he._Y),Dn(2,Ye.Ot),Dn(3,wi.nu),Dn(4,Dt.N8),Dn(5,ia.rr),Dn(6,lD.U),Dn(7,te.u)],Ln);class hD extends _.ks{constructor(){super({id:"editor.action.rename",label:g.kg("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:A.M$.and(D.R.writable,D.R.hasRenameProvider),kbOpts:{kbExpr:D.R.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(Be.T),[n,o]=Array.isArray(t)&&t||[void 0,void 0];return me.r.isUri(n)&&ee.y.isIPosition(o)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(s=>{s&&(s.setPosition(o),s.invokeWithinContext(a=>(this.reportTelemetry(a,s),this.run(a,s))))},K.dz):super.runCommand(e,t)}run(e,t){const i=Ln.get(t);return i?i.run():Promise.resolve()}}(0,_.HW)(Ln.ID,Ln),(0,_.Fl)(hD);const iu=_.DX.bindToContribution(Ln.get);(0,_.E_)(new iu({id:"acceptRenameInput",precondition:Za,handler:r=>r.acceptRenameInput(!1),kbOpts:{weight:199,kbExpr:D.R.focus,primary:3}})),(0,_.E_)(new iu({id:"acceptRenameInputWithPreview",precondition:A.M$.and(Za,A.M$.has("config.editor.rename.enablePreview")),handler:r=>r.acceptRenameInput(!0),kbOpts:{weight:199,kbExpr:D.R.focus,primary:1027}})),(0,_.E_)(new iu({id:"cancelRenameInput",precondition:Za,handler:r=>r.cancelRenameInput(),kbOpts:{weight:199,kbExpr:D.R.focus,primary:9,secondary:[1033]}})),(0,_.ke)("_executeDocumentRenameProvider",function(r,e,t,...i){const[n]=i;(0,le.j)(typeof n=="string");const{renameProvider:o}=r.get(te.u);return uD(o,e,t,n)}),(0,_.ke)("_executePrepareRename",function(r,e,t){return xn(this,void 0,void 0,function*(){const{renameProvider:i}=r.get(te.u),o=yield new tu(e,t,i).resolveRenameLocation(re.X.None);if(o?.rejectReason)throw new Error(o.rejectReason);return o})}),Gt.O.as(Jl.Fd.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:g.kg("enablePreview","Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});var gD=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},fD=function(r,e){return function(t,i){e(t,i,r)}},rp=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})},nu;let Zs=class extends I.jG{constructor(e,t){super(),this._sessionStore=new I.Cm,this._ranges=[],this._rangesVersionId=0,this._editor=e,this._languageFeaturesService=t,this.stickyScrollWidget=new pD(this._editor),this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(34)&&this.onConfigurationChange()})),this._updateSoon=this._register(new V.uC(()=>this._update(!0),50)),this.onConfigurationChange()}onConfigurationChange(){if(this._editor.getOption(34).stickyScroll.enabled===!1){this.stickyScrollWidget.emptyRootNode(),this._editor.removeOverlayWidget(this.stickyScrollWidget),this._sessionStore.clear();return}else this._editor.addOverlayWidget(this.stickyScrollWidget),this._sessionStore.add(this._editor.onDidChangeModel(()=>this._update(!0))),this._sessionStore.add(this._editor.onDidScrollChange(()=>this._update(!1))),this._sessionStore.add(this._editor.onDidChangeHiddenAreas(()=>this._update(!0))),this._sessionStore.add(this._editor.onDidChangeModelTokens(t=>this._onTokensChange(t))),this._sessionStore.add(this._editor.onDidChangeModelContent(()=>this._updateSoon.schedule())),this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>this._update(!0))),this._update(!0)}_needsUpdate(e){const t=this.stickyScrollWidget.getCurrentLines();for(const i of t)for(const n of e.ranges)if(i>=n.fromLineNumber&&i<=n.toLineNumber)return!0;return!1}_onTokensChange(e){this._needsUpdate(e)&&this._update(!1)}_update(e=!1){var t,i;return rp(this,void 0,void 0,function*(){e&&((t=this._cts)===null||t===void 0||t.dispose(!0),this._cts=new re.Q,yield this._updateOutlineModel(this._cts.token));const n=(i=this._editor._getViewModel())===null||i===void 0?void 0:i.getHiddenAreas();if(n)for(const o of n)this._ranges=this._ranges.filter(s=>!(s[0]>=o.startLineNumber&&s[1]<=o.endLineNumber+1));this._renderStickyScroll()})}_findLineRanges(e,t){if(e?.children.size){let i=!1;for(const n of e?.children.values()){const o=n.symbol.kind;(o===4||o===8||o===11||o===10||o===5||o===1)&&(i=!0,this._findLineRanges(n,t+1))}i||this._addOutlineRanges(e,t)}else this._addOutlineRanges(e,t)}_addOutlineRanges(e,t){let i=0,n=0;for(;e;){const o=e.symbol.kind;if((o===4||o===8||o===11||o===10||o===5||o===1)&&(i=e?.symbol.range.startLineNumber,n=e?.symbol.range.endLineNumber,this._ranges.push([i,n,t]),t--),e.parent instanceof Sa)e=e.parent;else break}}_updateOutlineModel(e){return rp(this,void 0,void 0,function*(){if(this._editor.hasModel()){const t=this._editor.getModel(),i=t.getVersionId(),n=yield gi.create(this._languageFeaturesService.documentSymbolProvider,t,e);if(e.isCancellationRequested)return;this._ranges=[],this._rangesVersionId=i;for(const o of n.children.values()){if(o instanceof Sa){const a=o.symbol.kind;a===4||a===8||a===11||a===10||a===5||a===1?this._findLineRanges(o,1):this._findLineRanges(o,0)}this._ranges=this._ranges.sort(function(a,l){return a[0]!==l[0]?a[0]-l[0]:a[1]!==l[1]?l[1]-a[1]:a[2]-l[2]});let s=[];for(const[a,l]of this._ranges.entries()){const[c,d,u]=l;s[0]===c&&s[1]===d?this._ranges.splice(a,1):s=l}}}})}_renderStickyScroll(){if(!this._editor.hasModel())return;const e=this._editor.getOption(61),t=this._editor.getModel();if(this._rangesVersionId!==t.getVersionId())return;const i=this._editor.getScrollTop();this.stickyScrollWidget.emptyRootNode();const n=new Set;for(const[o,s]of this._ranges.entries()){const[a,l,c]=s;if(l-a>0&&t.getLineContent(a)!==""){const d=(c-1)*e,u=c*e,h=this._editor.getBottomForLineNumber(a)-i,p=this._editor.getTopForLineNumber(l)-i,m=this._editor.getBottomForLineNumber(l)-i;if(n.has(a))this._ranges.splice(o,1);else if(d>=p-1&&d<m-2){n.add(a),this.stickyScrollWidget.pushCodeLine(new lp(a,c,this._editor,-1,m-u));break}else u>h&&u<m-1&&(n.add(a),this.stickyScrollWidget.pushCodeLine(new lp(a,c,this._editor,0,0)))}}this.stickyScrollWidget.updateRootNode()}dispose(){super.dispose(),this._sessionStore.dispose()}};Zs.ID="store.contrib.stickyScrollController",Zs=gD([fD(1,te.u)],Zs);const ap=(nu=window.trustedTypes)===null||nu===void 0?void 0:nu.createPolicy("stickyScrollViewLayer",{createHTML:r=>r});class lp{constructor(e,t,i,n,o){this._lineNumber=e,this._depth=t,this._editor=i,this._zIndex=n,this._relativePosition=o,this.effectiveLineHeight=0,this.effectiveLineHeight=this._editor.getOption(61)+this._relativePosition}get lineNumber(){return this._lineNumber}getDomNode(){const e=document.createElement("div"),t=this._editor._getViewModel(),i=t.coordinatesConverter.convertModelPositionToViewPosition(new ee.y(this._lineNumber,1)).lineNumber,n=t.getViewLineRenderingData(i);let o;try{o=Fc.d.filter(n.inlineDecorations,i,n.minColumn,n.maxColumn)}catch{o=[]}const s=new Aa.zL(!0,!0,n.content,n.continuesWithWrappedLine,n.isBasicASCII,n.containsRTL,0,n.tokens,o,n.tabSize,n.startVisibleColumn,1,1,1,100,"none",!0,!0,null),a=(0,Af.Du)(400);(0,Aa.UW)(s,a);let l;ap?l=ap.createHTML(a.build()):l=a.build();const c=document.createElement("span");c.style.backgroundColor="var(--vscode-editorStickyScroll-background)",c.style.overflow="hidden",c.style.whiteSpace="nowrap",c.style.display="inline-block",c.style.lineHeight=this._editor.getOption(61).toString()+"px",c.innerHTML=l;const d=document.createElement("span");d.style.width=this._editor.getLayoutInfo().contentLeft.toString()+"px",d.style.backgroundColor="var(--vscode-editorStickyScroll-background)",d.style.color="var(--vscode-editorLineNumber-foreground)",d.style.display="inline-block",d.style.lineHeight=this._editor.getOption(61).toString()+"px";const u=document.createElement("span");return u.innerText=this._lineNumber.toString(),u.style.paddingLeft=this._editor.getLayoutInfo().lineNumbersLeft.toString()+"px",u.style.width=this._editor.getLayoutInfo().lineNumbersWidth.toString()+"px",u.style.backgroundColor="var(--vscode-editorStickyScroll-background)",u.style.textAlign="right",u.style.float="left",u.style.lineHeight=this._editor.getOption(61).toString()+"px",d.appendChild(u),e.onclick=h=>{h.stopPropagation(),h.preventDefault(),this._editor.revealPosition({lineNumber:this._lineNumber-this._depth+1,column:1})},e.onmouseover=h=>{u.style.background="var(--vscode-editorStickyScrollHover-background)",c.style.backgroundColor="var(--vscode-editorStickyScrollHover-background)",d.style.backgroundColor="var(--vscode-editorStickyScrollHover-background)",e.style.backgroundColor="var(--vscode-editorStickyScrollHover-background)",u.style.cursor="pointer",c.style.cursor="pointer",e.style.cursor="pointer",d.style.cursor="pointer"},e.onmouseleave=h=>{u.style.background="var(--vscode-editorStickyScroll-background)",c.style.backgroundColor="var(--vscode-editorStickyScroll-background)",d.style.backgroundColor="var(--vscode-editorStickyScroll-background)",e.style.backgroundColor="var(--vscode-editorStickyScroll-background)"},this._editor.applyFontInfo(c),this._editor.applyFontInfo(u),e.appendChild(d),e.appendChild(c),e.style.zIndex=this._zIndex.toString(),e.style.backgroundColor="var(--vscode-editorStickyScroll-background)",e.style.overflow="hidden",e.style.whiteSpace="nowrap",e.style.width="100%",e.style.lineHeight=this._editor.getOption(61).toString()+"px",e.style.height=this._editor.getOption(61).toString()+"px",this._relativePosition&&(e.style.position="relative",e.style.top=this._relativePosition+"px",e.style.width="100%"),e}}class pD{constructor(e){this._editor=e,this.arrayOfCodeLines=[],this.rootDomNode=document.createElement("div"),this.rootDomNode=document.createElement("div"),this.rootDomNode.style.width="100%",this.rootDomNode.style.boxShadow="var(--vscode-scrollbar-shadow) 0 6px 6px -6px"}getCurrentLines(){const e=[];for(const t of this.arrayOfCodeLines)e.push(t.lineNumber);return e}pushCodeLine(e){this.arrayOfCodeLines.push(e)}updateRootNode(){let e=0;for(const t of this.arrayOfCodeLines)e+=t.effectiveLineHeight,this.rootDomNode.appendChild(t.getDomNode());this.rootDomNode.style.height=e.toString()+"px"}emptyRootNode(){this.arrayOfCodeLines.length=0,S.w_(this.rootDomNode)}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this.rootDomNode.style.zIndex="2",this.rootDomNode.style.backgroundColor="var(--vscode-editorStickyScroll-background)",this.rootDomNode}getPosition(){return{preference:null}}}(0,_.HW)(Zs.ID,Zs);class mD{provideSelectionRanges(e,t){const i=[];for(const n of t){const o=[];i.push(o),this._addInWordRanges(o,e,n),this._addWordRanges(o,e,n),this._addWhitespaceLine(o,e,n),o.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const n=t.getWordAtPosition(i);if(!n)return;const{word:o,startColumn:s}=n,a=i.column-s;let l=a,c=a,d=0;for(;l>=0;l--){const u=o.charCodeAt(l);if(l!==a&&(u===95||u===45))break;if((0,G.Lv)(u)&&(0,G.Wv)(d))break;d=u}for(l+=1;c<o.length;c++){const u=o.charCodeAt(c);if((0,G.Wv)(u)&&(0,G.Lv)(d))break;if(u===95||u===45)break;d=u}l<c&&e.push({range:new L.Q(i.lineNumber,s+l,i.lineNumber,s+c)})}_addWordRanges(e,t,i){const n=t.getWordAtPosition(i);n&&e.push({range:new L.Q(i.lineNumber,n.startColumn,i.lineNumber,n.endColumn)})}_addWhitespaceLine(e,t,i){t.getLineLength(i.lineNumber)>0&&t.getLineFirstNonWhitespaceColumn(i.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(i.lineNumber)===0&&e.push({range:new L.Q(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var _D=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},vD=function(r,e){return function(t,i){e(t,i,r)}},Ya=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};class ou{constructor(e,t){this.index=e,this.ranges=t}mov(e){const t=this.index+(e?1:-1);if(t<0||t>=this.ranges.length)return this;const i=new ou(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}let Lo=class Sm{constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}static get(e){return e.getContribution(Sm.ID)}dispose(){var e;(e=this._selectionListener)===null||e===void 0||e.dispose()}run(e){return Ya(this,void 0,void 0,function*(){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(this._state||(yield cp(this._languageFeaturesService.selectionRangeProvider,i,t.map(o=>o.getPosition()),this._editor.getOption(104),re.X.None).then(o=>{var s;if(!(!pe.EI(o)||o.length!==t.length)&&!(!this._editor.hasModel()||!pe.aI(this._editor.getSelections(),t,(a,l)=>a.equalsSelection(l)))){for(let a=0;a<o.length;a++)o[a]=o[a].filter(l=>l.containsPosition(t[a].getStartPosition())&&l.containsPosition(t[a].getEndPosition())),o[a].unshift(t[a]);this._state=o.map(a=>new ou(0,a)),(s=this._selectionListener)===null||s===void 0||s.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{var a;this._ignoreSelection||((a=this._selectionListener)===null||a===void 0||a.dispose(),this._state=void 0)})}})),!this._state)return;this._state=this._state.map(o=>o.mov(e));const n=this._state.map(o=>q.L.fromPositions(o.ranges[o.index].getStartPosition(),o.ranges[o.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(n)}finally{this._ignoreSelection=!1}})}};Lo.ID="editor.contrib.smartSelectController",Lo=_D([vD(1,te.u)],Lo);class dp extends _.ks{constructor(e,t){super(t),this._forward=e}run(e,t){return Ya(this,void 0,void 0,function*(){const i=Lo.get(t);i&&(yield i.run(this._forward))})}}class CD extends dp{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:g.kg("smartSelect.expand","Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:D.R.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:z.D8.MenubarSelectionMenu,group:"1_basic",title:g.kg({key:"miSmartSelectGrow",comment:["&& denotes a mnemonic"]},"&&Expand Selection"),order:2}})}}fe.wb.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class bD extends dp{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:g.kg("smartSelect.shrink","Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:D.R.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:z.D8.MenubarSelectionMenu,group:"1_basic",title:g.kg({key:"miSmartSelectShrink",comment:["&& denotes a mnemonic"]},"&&Shrink Selection"),order:3}})}}(0,_.HW)(Lo.ID,Lo),(0,_.Fl)(CD),(0,_.Fl)(bD);function cp(r,e,t,i,n){return Ya(this,void 0,void 0,function*(){const o=r.all(e).concat(new mD);o.length===1&&o.unshift(new _t);const s=[],a=[];for(const l of o)s.push(Promise.resolve(l.provideSelectionRanges(e,t,n)).then(c=>{if(pe.EI(c)&&c.length===t.length)for(let d=0;d<t.length;d++){a[d]||(a[d]=[]);for(const u of c[d])L.Q.isIRange(u.range)&&L.Q.containsPosition(u.range,t[d])&&a[d].push(L.Q.lift(u.range))}},K.M_));return yield Promise.all(s),a.map(l=>{if(l.length===0)return[];l.sort((h,p)=>ee.y.isBefore(h.getStartPosition(),p.getStartPosition())?1:ee.y.isBefore(p.getStartPosition(),h.getStartPosition())||ee.y.isBefore(h.getEndPosition(),p.getEndPosition())?-1:ee.y.isBefore(p.getEndPosition(),h.getEndPosition())?1:0);const c=[];let d;for(const h of l)(!d||L.Q.containsRange(h,d)&&!L.Q.equalsRange(h,d))&&(c.push(h),d=h);if(!i.selectLeadingAndTrailingWhitespace)return c;const u=[c[0]];for(let h=1;h<c.length;h++){const p=c[h-1],m=c[h];if(m.startLineNumber!==p.startLineNumber||m.endLineNumber!==p.endLineNumber){const v=new L.Q(p.startLineNumber,e.getLineFirstNonWhitespaceColumn(p.startLineNumber),p.endLineNumber,e.getLineLastNonWhitespaceColumn(p.endLineNumber));v.containsRange(p)&&!v.equalsRange(p)&&m.containsRange(v)&&!m.equalsRange(v)&&u.push(v);const w=new L.Q(p.startLineNumber,1,p.endLineNumber,e.getLineMaxColumn(p.endLineNumber));w.containsRange(p)&&!w.equalsRange(v)&&m.containsRange(w)&&!m.equalsRange(w)&&u.push(w)}u.push(m)}return u})})}fe.wb.registerCommand("_executeSelectionRangeProvider",function(r,...e){return Ya(this,void 0,void 0,function*(){const[t,i]=e;(0,le.j)(me.r.isUri(t));const n=r.get(te.u).selectionRangeProvider,o=yield r.get(Ft.b).createModelReference(t);try{return cp(n,o.object.textEditorModel,i,{selectLeadingAndTrailingWhitespace:!0},re.X.None)}finally{o.dispose()}})});var SD=f(42783),su=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},kn=function(r,e){return function(t,i){e(t,i,r)}},yD=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};class wD{constructor(e,t,i,n,o,s){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=n,this.command=o,this.completion=s}}let ru=class extends I.mp{constructor(e,t,i,n,o,s){super(o.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=n,this._suggestMemoryService=s}canBeReused(e,t,i){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===i.startColumn&&this.word.endColumn<i.endColumn&&this.completionModel.incomplete.size===0}get items(){var e;const t=[],{items:i}=this.completionModel,n=this._suggestMemoryService.select(this.model,{lineNumber:this.line,column:this.word.endColumn+this.completionModel.lineContext.characterCountDelta},i),o=Ts.f.slice(i,n),s=Ts.f.slice(i,0,n);let a=5;for(const l of Ts.f.concat(o,s)){if(l.score===je.ne.Default)continue;const c=new L.Q(l.editStart.lineNumber,l.editStart.column,l.editInsertEnd.lineNumber,l.editInsertEnd.column+this.completionModel.lineContext.characterCountDelta),d=l.completion.insertTextRules&&l.completion.insertTextRules&SD._E.InsertAsSnippet?{snippet:l.completion.insertText}:l.completion.insertText;t.push(new wD(c,d,(e=l.filterTextLow)!==null&&e!==void 0?e:l.labelLow,l.completion.additionalTextEdits,l.completion.command,l)),a-->=0&&l.resolve(re.X.None)}return t}};ru=su([kn(5,xa)],ru);let au=class{constructor(e,t,i,n){this._getEditorOption=e,this._languageFeatureService=t,this._clipboardService=i,this._suggestMemoryService=n}provideInlineCompletions(e,t,i,n){var o;return yD(this,void 0,void 0,function*(){if(i.selectedSuggestionInfo)return;const s=this._getEditorOption(81,e);if(qn.isAllOff(s))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const a=e.tokenization.getLineTokens(t.lineNumber),l=a.getStandardTokenType(a.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(qn.valueFor(s,l)!=="inline")return;let c=e.getWordAtPosition(t),d;if(c?.word||(d=this._getTriggerCharacterInfo(e,t)),!c?.word&&!d||(c||(c=e.getWordUntilPosition(t)),c.endColumn!==t.column))return;let u;const h=e.getValueInRange(new L.Q(t.lineNumber,1,t.lineNumber,t.column));if(!d&&(!((o=this._lastResult)===null||o===void 0)&&o.canBeReused(e,t.lineNumber,c))){const p=new Lf(h,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=p,this._lastResult.acquire(),u=this._lastResult}else{const p=yield Wd(this._languageFeatureService.completionProvider,e,t,new Cs(void 0,void 0,d?.providers),d&&{triggerKind:1,triggerCharacter:d.ch},n);let m;p.needsClipboard&&(m=yield this._clipboardService.readText());const v=new Wi(p.items,t.column,new Lf(h,0),zt.None,this._getEditorOption(108,e),this._getEditorOption(103,e),{boostFullMatch:!1,firstMatchCanBeWeak:!1},m);u=new ru(e,t.lineNumber,c,v,p,this._suggestMemoryService)}return this._lastResult=u,u})}handleItemDidShow(e,t){t.completion.resolve(re.X.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var i;const n=e.getValueInRange(L.Q.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),o=new Set;for(const s of this._languageFeatureService.completionProvider.all(e))!((i=s.triggerCharacters)===null||i===void 0)&&i.includes(n)&&o.add(s);if(o.size!==0)return{providers:o,ch:n}}};au=su([kn(1,te.u),kn(2,Hn.h),kn(3,xa)],au);let Xa=class Vo{constructor(e,t,i,n){if(++Vo._counter===1){const o=n.createInstance(au,(s,a)=>{var l;return((l=i.listCodeEditors().find(d=>d.getModel()===a))!==null&&l!==void 0?l:e).getOption(s)});Vo._disposable=t.inlineCompletionsProvider.register("*",o)}}dispose(){var e;--Vo._counter===0&&((e=Vo._disposable)===null||e===void 0||e.dispose(),Vo._disposable=void 0)}};Xa._counter=0,Xa=su([kn(1,te.u),kn(2,Be.T),kn(3,he._Y)],Xa),(0,_.HW)("suggest.inlineCompletionsProvider",Xa);class DD extends _.ks{constructor(){super({id:"editor.action.forceRetokenize",label:g.kg("forceRetokenize","Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getModel();i.tokenization.resetTokenization();const n=new Kt.W(!0);i.tokenization.forceTokenization(i.getLineCount()),n.stop(),console.log(`tokenization took ${n.elapsed()}`)}}(0,_.Fl)(DD);var up=f(25155);class ko extends _.ks{constructor(){super({id:ko.ID,label:g.kg({key:"toggle.tabMovesFocus",comment:["Turn on/off use of tab key for moving focus around VS Code"]},"Toggle Tab Key Moves Focus"),alias:"Toggle Tab Key Moves Focus",precondition:void 0,kbOpts:{kbExpr:null,primary:2091,mac:{primary:1323},weight:100}})}run(e,t){const n=!up.M.getTabFocusMode();up.M.setTabFocusMode(n),n?(0,ft.xE)(g.kg("toggle.tabMovesFocus.on","Pressing Tab will now move focus to the next focusable element")):(0,ft.xE)(g.kg("toggle.tabMovesFocus.off","Pressing Tab will now insert the tab character"))}}ko.ID="editor.action.toggleTabFocusMode",(0,_.Fl)(ko);var hp=f(49887),Io=f(31430),xD=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},LD=function(r,e){return function(t,i){e(t,i,r)}};let lu=class extends I.jG{constructor(e,t,i={},n){var o;super(),this._link=t,this._enabled=!0,this.el=(0,S.BC)(e,(0,S.$)("a.monaco-link",{tabIndex:(o=t.tabIndex)!==null&&o!==void 0?o:0,href:t.href,title:t.title},t.label)),this.el.setAttribute("role","button");const s=this._register(new Ss.f(this.el,"click")),a=this._register(new Ss.f(this.el,"keypress")),l=Z.Jh.chain(a.event).map(u=>new is.Z(u)).filter(u=>u.keyCode===3).event,c=this._register(new Ss.f(this.el,zn.B.Tap)).event;this._register(zn.q.addTarget(this.el));const d=Z.Jh.any(s.event,l,c);this._register(d(u=>{this.enabled&&(S.fs.stop(u,!0),i?.opener?i.opener(this._link.href):n.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute("aria-disabled","false"),this.el.tabIndex=0,this.el.style.pointerEvents="auto",this.el.style.opacity="1",this.el.style.cursor="pointer",this._enabled=!1):(this.el.setAttribute("aria-disabled","true"),this.el.tabIndex=-1,this.el.style.pointerEvents="none",this.el.style.opacity="0.4",this.el.style.cursor="default",this._enabled=!0),this._enabled=e}};lu=xD([LD(3,pt.Cr)],lu),(0,U.zy)((r,e)=>{const t=r.getColor(C.vwp);t&&e.addRule(`.monaco-link { color: ${t}; }`);const i=r.getColor(C.FEE);i&&e.addRule(`.monaco-link:hover { color: ${i}; }`)});var gp=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},fp=function(r,e){return function(t,i){e(t,i,r)}};const kD=26;let du=class extends I.jG{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(cu))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show(Object.assign(Object.assign({},e),{onClose:()=>{var t;this.hide(),(t=e.onClose)===null||t===void 0||t.call(e)}})),this._editor.setBanner(this.banner.element,kD)}};du=gp([fp(1,he._Y)],du);let cu=class extends I.jG{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(li,{}),this.element=(0,S.$)("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(e){if(e.ariaLabel)return e.ariaLabel;if(typeof e.message=="string")return e.message}getBannerMessage(e){if(typeof e=="string"){const t=(0,S.$)("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){(0,S.w_)(this.element)}show(e){(0,S.w_)(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=(0,S.BC)(this.element,(0,S.$)("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild((0,S.$)(`div${U.L0.asCSSSelector(e.icon)}`));const n=(0,S.BC)(this.element,(0,S.$)("div.message-container"));if(n.setAttribute("aria-hidden","true"),n.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=(0,S.BC)(this.element,(0,S.$)("div.message-actions-container")),e.actions)for(const s of e.actions)this._register(this.instantiationService.createInstance(lu,this.messageActionsContainer,Object.assign(Object.assign({},s),{tabIndex:-1}),{}));const o=(0,S.BC)(this.element,(0,S.$)("div.action-container"));this.actionBar=this._register(new Nr.E(o)),this.actionBar.push(this._register(new He.rc("banner.close","Close Banner",U.L0.asClassName(Ge.$_),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};cu=gp([fp(0,he._Y)],cu);var ID=f(7038),uu=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Ro=function(r,e){return function(t,i){e(t,i,r)}},Qe=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};const RD=(0,Ge.pU)("extensions-warning-message",Q.W6.warning,g.kg("warningIcon","Icon shown with a warning message in the extensions editor."));let Eo=class extends I.jG{constructor(e,t,i,n){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=i,this._highlighter=null,this._bannerClosed=!1,this._updateState=o=>{if(o&&o.hasMore){if(this._bannerClosed)return;const s=Math.max(o.ambiguousCharacterCount,o.nonBasicAsciiCharacterCount,o.invisibleCharacterCount);let a;if(o.nonBasicAsciiCharacterCount>=s)a={message:g.kg("unicodeHighlighting.thisDocumentHasManyNonBasicAsciiUnicodeCharacters","This document contains many non-basic ASCII unicode characters"),command:new No};else if(o.ambiguousCharacterCount>=s)a={message:g.kg("unicodeHighlighting.thisDocumentHasManyAmbiguousUnicodeCharacters","This document contains many ambiguous unicode characters"),command:new ji};else if(o.invisibleCharacterCount>=s)a={message:g.kg("unicodeHighlighting.thisDocumentHasManyInvisibleUnicodeCharacters","This document contains many invisible unicode characters"),command:new Ao};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:RD,actions:[{label:a.command.shortLabel,href:`command:${a.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(n.createInstance(du,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(115),this._register(i.onDidChangeTrust(o=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(o=>{o.hasChanged(115)&&(this._options=e.getOption(115),this._updateHighlighter())})),this._updateHighlighter()}dispose(){this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),super.dispose()}_updateHighlighter(){if(this._updateState(null),this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),!this._editor.hasModel())return;const e=ED(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(i=>i===!1))return;const t={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map(i=>i.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(i=>i==="_os"?new Intl.NumberFormat().resolvedOptions().locale:i==="_vscode"?Se.BH:i)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new hu(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new AD(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}};Eo.ID="editor.contrib.unicodeHighlighter",Eo=uu([Ro(1,Es.w),Ro(2,ID.L),Ro(3,he._Y)],Eo);function ED(r,e){return{nonBasicASCII:e.nonBasicASCII===$e.XR?!r:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===$e.XR?!r:e.includeComments,includeStrings:e.includeStrings===$e.XR?!r:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let hu=class extends I.jG{constructor(e,t,i,n){super(),this._editor=e,this._options=t,this._updateState=i,this._editorWorkerService=n,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new V.uC(()=>this._update(),250)),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then(t=>{if(this._model.isDisposed()||this._model.getVersionId()!==e)return;this._updateState(t);const i=[];if(!t.hasMore)for(const n of t.ranges)i.push({range:n,options:Ja.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!(0,Io.GN)(t,e))return null;const i=t.getValueInRange(e.range);return{reason:mp(i,this._options),inComment:(0,Io.a6)(t,e),inString:(0,Io.wc)(t,e)}}};hu=uu([Ro(3,Es.w)],hu);class AD extends I.jG{constructor(e,t,i){super(),this._editor=e,this._options=t,this._updateState=i,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new V.uC(()=>this._update(),250)),this._register(this._editor.onDidLayoutChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidScrollChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeHiddenAreas(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._editor.getVisibleRanges(),t=[],i={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const n of e){const o=hp.P.computeUnicodeHighlights(this._model,this._options,n);for(const s of o.ranges)i.ranges.push(s);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||o.hasMore}if(!i.hasMore)for(const n of i.ranges)t.push({range:n,options:Ja.instance.getDecorationFromOptions(this._options)});this._updateState(i),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),i=t.getValueInRange(e.range);return(0,Io.GN)(t,e)?{reason:mp(i,this._options),inComment:(0,Io.a6)(t,e),inString:(0,Io.wc)(t,e)}:null}}let gu=class{constructor(e,t,i){this._editor=e,this._languageService=t,this._openerService=i,this.hoverOrdinal=4}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),n=this._editor.getContribution(Eo.ID);if(!n)return[];const o=[];let s=300;for(const a of t){const l=n.getDecorationInfo(a);if(!l)continue;const d=i.getValueInRange(a.range).codePointAt(0),u=pp(d);let h;switch(l.reason.kind){case 0:h=g.kg("unicodeHighlight.characterIsAmbiguous","The character {0} could be confused with the character {1}, which is more common in source code.",u,pp(l.reason.confusableWith.codePointAt(0)));break;case 1:h=g.kg("unicodeHighlight.characterIsInvisible","The character {0} is invisible.",u);break;case 2:h=g.kg("unicodeHighlight.characterIsNonBasicAscii","The character {0} is not a basic ASCII character.",u);break}const p={codePoint:d,reason:l.reason,inComment:l.inComment,inString:l.inString},m=g.kg("unicodeHighlight.adjustSettings","Adjust settings"),v=`command:${Ys.ID}?${encodeURIComponent(JSON.stringify(p))}`,w=new xe.Bc("",!0).appendMarkdown(h).appendText(" ").appendLink(v,m);o.push(new Zt(this,a.range,[w],s++))}return o}renderHoverParts(e,t){return Cg(e,t,this._editor,this._languageService,this._openerService)}};gu=uu([Ro(1,xt.L),Ro(2,pt.Cr)],gu);function fu(r){return`U+${r.toString(16).padStart(4,"0")}`}function pp(r){let e=`\`${fu(r)}\``;return G.y_.isInvisibleCharacter(r)||(e+=` "${`${ND(r)}`}"`),e}function ND(r){return r===96?"`` ` ``":"`"+String.fromCodePoint(r)+"`"}function mp(r,e){return hp.P.computeUnicodeHighlightReason(r,e)}class Ja{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const i=`${e}${t}`;let n=this.map.get(i);return n||(n=ge.kI.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,n)),n}}Ja.instance=new Ja;class MD extends _.ks{constructor(){super({id:ji.ID,label:g.kg("action.unicodeHighlight.disableHighlightingInComments","Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=g.kg("unicodeHighlight.disableHighlightingInComments.shortLabel","Disable Highlight In Comments")}run(e,t,i){return Qe(this,void 0,void 0,function*(){const n=e?.get(Fe.pG);n&&this.runAction(n)})}runAction(e){return Qe(this,void 0,void 0,function*(){yield e.updateValue($e.Of.includeComments,!1,2)})}}class TD extends _.ks{constructor(){super({id:ji.ID,label:g.kg("action.unicodeHighlight.disableHighlightingInStrings","Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=g.kg("unicodeHighlight.disableHighlightingInStrings.shortLabel","Disable Highlight In Strings")}run(e,t,i){return Qe(this,void 0,void 0,function*(){const n=e?.get(Fe.pG);n&&this.runAction(n)})}runAction(e){return Qe(this,void 0,void 0,function*(){yield e.updateValue($e.Of.includeStrings,!1,2)})}}class ji extends _.ks{constructor(){super({id:ji.ID,label:g.kg("action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters","Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=g.kg("unicodeHighlight.disableHighlightingOfAmbiguousCharacters.shortLabel","Disable Ambiguous Highlight")}run(e,t,i){return Qe(this,void 0,void 0,function*(){const n=e?.get(Fe.pG);n&&this.runAction(n)})}runAction(e){return Qe(this,void 0,void 0,function*(){yield e.updateValue($e.Of.ambiguousCharacters,!1,2)})}}ji.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";class Ao extends _.ks{constructor(){super({id:Ao.ID,label:g.kg("action.unicodeHighlight.disableHighlightingOfInvisibleCharacters","Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=g.kg("unicodeHighlight.disableHighlightingOfInvisibleCharacters.shortLabel","Disable Invisible Highlight")}run(e,t,i){return Qe(this,void 0,void 0,function*(){const n=e?.get(Fe.pG);n&&this.runAction(n)})}runAction(e){return Qe(this,void 0,void 0,function*(){yield e.updateValue($e.Of.invisibleCharacters,!1,2)})}}Ao.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";class No extends _.ks{constructor(){super({id:No.ID,label:g.kg("action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters","Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=g.kg("unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters.shortLabel","Disable Non ASCII Highlight")}run(e,t,i){return Qe(this,void 0,void 0,function*(){const n=e?.get(Fe.pG);n&&this.runAction(n)})}runAction(e){return Qe(this,void 0,void 0,function*(){yield e.updateValue($e.Of.nonBasicASCII,!1,2)})}}No.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";class Ys extends _.ks{constructor(){super({id:Ys.ID,label:g.kg("action.unicodeHighlight.showExcludeOptions","Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}run(e,t,i){return Qe(this,void 0,void 0,function*(){const{codePoint:n,reason:o,inString:s,inComment:a}=i,l=String.fromCodePoint(n),c=e.get(en.GK),d=e.get(Fe.pG);function u(m){return G.y_.isInvisibleCharacter(m)?g.kg("unicodeHighlight.excludeInvisibleCharFromBeingHighlighted","Exclude {0} (invisible character) from being highlighted",fu(m)):g.kg("unicodeHighlight.excludeCharFromBeingHighlighted","Exclude {0} from being highlighted",`${fu(m)} "${l}"`)}const h=[];if(o.kind===0)for(const m of o.notAmbiguousInLocales)h.push({label:g.kg("unicodeHighlight.allowCommonCharactersInLanguage",'Allow unicode characters that are more common in the language "{0}".',m),run:()=>Qe(this,void 0,void 0,function*(){FD(d,[m])})});if(h.push({label:u(n),run:()=>OD(d,[n])}),a){const m=new MD;h.push({label:m.label,run:()=>Qe(this,void 0,void 0,function*(){return m.runAction(d)})})}else if(s){const m=new TD;h.push({label:m.label,run:()=>Qe(this,void 0,void 0,function*(){return m.runAction(d)})})}if(o.kind===0){const m=new ji;h.push({label:m.label,run:()=>Qe(this,void 0,void 0,function*(){return m.runAction(d)})})}else if(o.kind===1){const m=new Ao;h.push({label:m.label,run:()=>Qe(this,void 0,void 0,function*(){return m.runAction(d)})})}else if(o.kind===2){const m=new No;h.push({label:m.label,run:()=>Qe(this,void 0,void 0,function*(){return m.runAction(d)})})}else PD(o);const p=yield c.pick(h,{title:g.kg("unicodeHighlight.configureUnicodeHighlightOptions","Configure Unicode Highlight Options")});p&&(yield p.run())})}}Ys.ID="editor.action.unicodeHighlight.showExcludeOptions";function OD(r,e){return Qe(this,void 0,void 0,function*(){const t=r.getValue($e.Of.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const n of e)i[String.fromCodePoint(n)]=!0;yield r.updateValue($e.Of.allowedCharacters,i,2)})}function FD(r,e){var t;return Qe(this,void 0,void 0,function*(){const i=(t=r.inspect($e.Of.allowedLocales).user)===null||t===void 0?void 0:t.value;let n;typeof i=="object"&&i?n=Object.assign({},i):n={};for(const o of e)n[o]=!0;yield r.updateValue($e.Of.allowedLocales,n,2)})}function PD(r){throw new Error(`Unexpected value: ${r}`)}(0,_.Fl)(ji),(0,_.Fl)(Ao),(0,_.Fl)(No),(0,_.Fl)(Ys),(0,_.HW)(Eo.ID,Eo),an.register(gu);var pu=f(94535),WD=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},_p=function(r,e){return function(t,i){e(t,i,r)}},BD=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};const vp="ignoreUnusualLineTerminators";function HD(r,e,t){r.setModelProperty(e.uri,vp,t)}function VD(r,e){return r.getModelProperty(e.uri,vp)}let Xs=class extends I.jG{constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._config=this._editor.getOption(116),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(116)&&(this._config=this._editor.getOption(116),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(n=>{n.isUndoing||this._checkForUnusualLineTerminators()}))}_checkForUnusualLineTerminators(){return BD(this,void 0,void 0,function*(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||VD(this._codeEditorService,e)===!0||this._editor.getOption(83))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(!(yield this._dialogService.confirm({title:g.kg("unusualLineTerminators.title","Unusual Line Terminators"),message:g.kg("unusualLineTerminators.message","Detected unusual line terminators"),detail:g.kg("unusualLineTerminators.detail","The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",(0,De.P8)(e.uri)),primaryButton:g.kg("unusualLineTerminators.fix","Remove Unusual Line Terminators"),secondaryButton:g.kg("unusualLineTerminators.ignore","Ignore")})).confirmed){HD(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())})}};Xs.ID="editor.contrib.unusualLineTerminatorsDetector",Xs=WD([_p(1,pu.X),_p(2,Be.T)],Xs),(0,_.HW)(Xs.ID,Xs);var Cp=f(52677),bp=f(40931),UD=f(9520),zD=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Js=function(r,e){return function(t,i){e(t,i,r)}};let qs=class extends I.jG{constructor(e,t,i,n,o,s){super(),this._modelService=t,this._themeService=i,this._configurationService=n,this._editor=e,this._provider=s.documentRangeSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new V.uC(()=>this._tokenizeViewportNow(),100)),this._outstandingRequests=[];const a=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))};this._register(this._editor.onDidScrollChange(()=>{a()})),this._register(this._editor.onDidChangeModel(()=>{this._cancelAll(),a()})),this._register(this._editor.onDidChangeModelContent(l=>{this._cancelAll(),a()})),this._register(this._provider.onDidChange(()=>{this._cancelAll(),a()})),this._register(this._configurationService.onDidChangeConfiguration(l=>{l.affectsConfiguration(bp.r8)&&(this._cancelAll(),a())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),a()}))}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,i=this._outstandingRequests.length;t<i;t++)if(this._outstandingRequests[t]===e){this._outstandingRequests.splice(t,1);return}}_tokenizeViewportNow(){if(!this._editor.hasModel())return;const e=this._editor.getModel();if(e.tokenization.hasCompleteSemanticTokens())return;if(!(0,bp.rT)(e,this._themeService,this._configurationService)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}if(!(0,Cp.WG)(this._provider,e)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}const t=this._editor.getVisibleRangesPlusViewportAboveBelow();this._outstandingRequests=this._outstandingRequests.concat(t.map(i=>this._requestRange(e,i)))}_requestRange(e,t){const i=e.getVersionId(),n=(0,V.SS)(s=>Promise.resolve((0,Cp.nZ)(this._provider,e,t,s))),o=new Kt.W(!1);return n.then(s=>{if(this._debounceInformation.update(e,o.elapsed()),!s||!s.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:a,tokens:l}=s,c=this._modelService.getSemanticTokensProviderStyling(a);e.tokenization.setPartialSemanticTokens(t,(0,UD.b)(l,c,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(n),()=>this._removeOutstandingRequest(n)),n}};qs.ID="editor.contrib.viewportSemanticTokens",qs=zD([Js(1,$t.S),Js(2,U.Gy),Js(3,Fe.pG),Js(4,si.U),Js(5,te.u)],qs),(0,_.HW)(qs.ID,qs);var $D=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Sp=function(r,e){return function(t,i){e(t,i,r)}};const jD=(0,C.x1A)("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},g.kg("wordHighlight","Background color of a symbol during read-access, like reading a variable. The color must not be opaque so as not to hide underlying decorations."),!0),GD=(0,C.x1A)("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},g.kg("wordHighlightStrong","Background color of a symbol during write-access, like writing to a variable. The color must not be opaque so as not to hide underlying decorations."),!0),KD=(0,C.x1A)("editor.wordHighlightBorder",{light:null,dark:null,hcDark:C.buw,hcLight:C.buw},g.kg("wordHighlightBorder","Border color of a symbol during read-access, like reading a variable.")),QD=(0,C.x1A)("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:C.buw,hcLight:C.buw},g.kg("wordHighlightStrongBorder","Border color of a symbol during write-access, like writing to a variable.")),ZD=(0,C.x1A)("editorOverviewRuler.wordHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},g.kg("overviewRulerWordHighlightForeground","Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),YD=(0,C.x1A)("editorOverviewRuler.wordHighlightStrongForeground",{dark:"#C0A0C0CC",light:"#C0A0C0CC",hcDark:"#C0A0C0CC",hcLight:"#C0A0C0CC"},g.kg("overviewRulerWordHighlightStrongForeground","Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),qa=new A.N1("hasWordHighlights",!1);function yp(r,e,t,i){const n=r.ordered(e);return(0,V.$1)(n.map(o=>()=>Promise.resolve(o.provideDocumentHighlights(e,t,i)).then(void 0,K.M_)),pe.EI)}class wp{constructor(e,t,i){this._model=e,this._selection=t,this._wordSeparators=i,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=(0,V.SS)(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new L.Q(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}isValid(e,t,i){const n=t.startLineNumber,o=t.startColumn,s=t.endColumn,a=this._getCurrentWordRange(e,t);let l=!!(this._wordRange&&this._wordRange.equalsRange(a));for(let c=0,d=i.length;!l&&c<d;c++){const u=i.getRange(c);u&&u.startLineNumber===n&&u.startColumn<=o&&u.endColumn>=s&&(l=!0)}return l}cancel(){this.result.cancel()}}class XD extends wp{constructor(e,t,i,n){super(e,t,i),this._providers=n}_compute(e,t,i,n){return yp(this._providers,e,t.getPosition(),n).then(o=>o||[])}}class JD extends wp{constructor(e,t,i){super(e,t,i),this._selectionIsEmpty=t.isEmpty()}_compute(e,t,i,n){return(0,V.wR)(250,n).then(()=>{if(!t.isEmpty())return[];const o=e.getWordAtPosition(t.getPosition());return!o||o.word.length>1e3?[]:e.findMatches(o.word,!0,!1,!0,i,!1).map(a=>({range:a.range,kind:_e.Kb.Text}))})}isValid(e,t,i){const n=t.isEmpty();return this._selectionIsEmpty!==n?!1:super.isValid(e,t,i)}}function qD(r,e,t,i){return r.has(e)?new XD(e,t,i,r):new JD(e,t,i)}(0,_.ke)("_executeDocumentHighlights",(r,e,t)=>{const i=r.get(te.u);return yp(i.documentHighlightProvider,e,t,re.X.None)});class Mo{constructor(e,t,i){this.toUnhook=new I.Cm,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=[],this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this.providers=t,this._hasWordHighlights=qa.bindTo(i),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(74),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(n=>{this._ignorePositionChangeEvent||this.occurrencesHighlight&&this._onPositionChanged(n)})),this.toUnhook.add(e.onDidChangeModelContent(n=>{this._stopAll()})),this.toUnhook.add(e.onDidChangeConfiguration(n=>{const o=this.editor.getOption(74);this.occurrencesHighlight!==o&&(this.occurrencesHighlight=o,this._stopAll())})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1}hasDecorations(){return this.decorations.length>0}restore(){this.occurrencesHighlight&&this._run()}_getSortedHighlights(){return this.decorations.getRanges().sort(L.Q.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))+1)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const o=this._getWord();if(o){const s=this.editor.getModel().getLineContent(n.startLineNumber);(0,ft.xE)(`${s}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const o=this._getWord();if(o){const s=this.editor.getModel().getLineContent(n.startLineNumber);(0,ft.xE)(`${s}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeDecorations(){this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1))}_stopAll(){this._removeDecorations(),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){if(!this.occurrencesHighlight){this._stopAll();return}if(e.reason!==3){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.getWordAtPosition({lineNumber:t,column:i})}_run(){const e=this.editor.getSelection();if(e.startLineNumber!==e.endLineNumber){this._stopAll();return}const t=e.startColumn,i=e.endColumn,n=this._getWord();if(!n||n.startColumn>t||n.endColumn<i){this._stopAll();return}const o=this.workerRequest&&this.workerRequest.isValid(this.model,e,this.decorations);if(this.lastCursorPositionChangeTime=new Date().getTime(),o)this.workerRequestCompleted&&this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1,this._beginRenderDecorations());else{this._stopAll();const s=++this.workerRequestTokenId;this.workerRequestCompleted=!1,this.workerRequest=qD(this.providers,this.model,this.editor.getSelection(),this.editor.getOption(119)),this.workerRequest.result.then(a=>{s===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=a||[],this._beginRenderDecorations())},K.dz)}}_beginRenderDecorations(){const e=new Date().getTime(),t=this.lastCursorPositionChangeTime+250;e>=t?(this.renderDecorationsTimer=-1,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},t-e)}renderDecorations(){this.renderDecorationsTimer=-1;const e=[];for(const t of this.workerRequestValue)t.range&&e.push({range:t.range,options:Mo._getDecorationOptions(t.kind)});this.decorations.set(e),this._hasWordHighlights.set(this.hasDecorations())}static _getDecorationOptions(e){return e===_e.Kb.Write?this._WRITE_OPTIONS:e===_e.Kb.Text?this._TEXT_OPTIONS:this._REGULAR_OPTIONS}dispose(){this._stopAll(),this.toUnhook.dispose()}}Mo._WRITE_OPTIONS=ge.kI.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:(0,U.Yf)(YD),position:We.A5.Center},minimap:{color:(0,U.Yf)(C.Xp1),position:We.R3.Inline}}),Mo._TEXT_OPTIONS=ge.kI.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight",overviewRuler:{color:(0,U.Yf)(C.z5H),position:We.A5.Center},minimap:{color:(0,U.Yf)(C.Xp1),position:We.R3.Inline}}),Mo._REGULAR_OPTIONS=ge.kI.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:(0,U.Yf)(ZD),position:We.A5.Center},minimap:{color:(0,U.Yf)(C.Xp1),position:We.R3.Inline}});let In=class ym extends I.jG{constructor(e,t,i){super(),this.wordHighlighter=null;const n=()=>{e.hasModel()&&(this.wordHighlighter=new Mo(e,i.documentHighlightProvider,t))};this._register(e.onDidChangeModel(o=>{this.wordHighlighter&&(this.wordHighlighter.dispose(),this.wordHighlighter=null),n()})),n()}static get(e){return e.getContribution(ym.ID)}saveViewState(){return!!(this.wordHighlighter&&this.wordHighlighter.hasDecorations())}moveNext(){this.wordHighlighter&&this.wordHighlighter.moveNext()}moveBack(){this.wordHighlighter&&this.wordHighlighter.moveBack()}restoreViewState(e){this.wordHighlighter&&e&&this.wordHighlighter.restore()}dispose(){this.wordHighlighter&&(this.wordHighlighter.dispose(),this.wordHighlighter=null),super.dispose()}};In.ID="editor.contrib.wordHighlighter",In=$D([Sp(1,A.fN),Sp(2,te.u)],In);class Dp extends _.ks{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=In.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class ex extends Dp{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:g.kg("wordHighlight.next.label","Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:qa,kbOpts:{kbExpr:D.R.editorTextFocus,primary:65,weight:100}})}}class tx extends Dp{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:g.kg("wordHighlight.previous.label","Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:qa,kbOpts:{kbExpr:D.R.editorTextFocus,primary:1089,weight:100}})}}class ix extends _.ks{constructor(){super({id:"editor.action.wordHighlight.trigger",label:g.kg("wordHighlight.trigger.label","Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:qa.toNegated(),kbOpts:{kbExpr:D.R.editorTextFocus,primary:0,weight:100}})}run(e,t,i){const n=In.get(t);n&&n.restoreViewState(!0)}}(0,_.HW)(In.ID,In),(0,_.Fl)(ex),(0,_.Fl)(tx),(0,_.Fl)(ix),(0,U.zy)((r,e)=>{const t=r.getColor(C.QwA);t&&(e.addRule(`.monaco-editor .focused .selectionHighlight { background-color: ${t}; }`),e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`));const i=r.getColor(jD);i&&e.addRule(`.monaco-editor .wordHighlight { background-color: ${i}; }`);const n=r.getColor(GD);n&&e.addRule(`.monaco-editor .wordHighlightStrong { background-color: ${n}; }`);const o=r.getColor(C.CMg);o&&e.addRule(`.monaco-editor .selectionHighlight { border: 1px ${(0,bt.Bb)(r.type)?"dotted":"solid"} ${o}; box-sizing: border-box; }`);const s=r.getColor(KD);s&&e.addRule(`.monaco-editor .wordHighlight { border: 1px ${(0,bt.Bb)(r.type)?"dashed":"solid"} ${s}; box-sizing: border-box; }`);const a=r.getColor(QD);a&&e.addRule(`.monaco-editor .wordHighlightStrong { border: 1px ${(0,bt.Bb)(r.type)?"dashed":"solid"} ${a}; box-sizing: border-box; }`)});var nx=f(29895),_i=f(89673),Rn=f(82862),el=f(13034);class tl extends _.DX{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const n=(0,Rn.i)(t.getOption(119)),o=t.getModel(),a=t.getSelections().map(l=>{const c=new ee.y(l.positionLineNumber,l.positionColumn),d=this._move(n,o,c,this._wordNavigationType);return this._moveTo(l,d,this._inSelectionMode)});if(o.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,a.map(l=>nx.MF.fromModelSelection(l))),a.length===1){const l=new ee.y(a[0].positionLineNumber,a[0].positionColumn);t.revealPosition(l,0)}}_moveTo(e,t,i){return i?new q.L(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new q.L(t.lineNumber,t.column,t.lineNumber,t.column)}}class Gi extends tl{_move(e,t,i,n){return _i.z.moveWordLeft(e,t,i,n)}}class Ki extends tl{_move(e,t,i,n){return _i.z.moveWordRight(e,t,i,n)}}class ox extends Gi{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class sx extends Gi{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class rx extends Gi{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:A.M$.and(D.R.textInputFocus,(e=A.M$.and(Qn.f,el.nd))===null||e===void 0?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class ax extends Gi{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class lx extends Gi{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class dx extends Gi{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:A.M$.and(D.R.textInputFocus,(e=A.M$.and(Qn.f,el.nd))===null||e===void 0?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class cx extends Gi{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,n){return super._move((0,Rn.i)($e.qB.wordSeparators.defaultValue),t,i,n)}}class ux extends Gi{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,n){return super._move((0,Rn.i)($e.qB.wordSeparators.defaultValue),t,i,n)}}class hx extends Ki{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class gx extends Ki{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:A.M$.and(D.R.textInputFocus,(e=A.M$.and(Qn.f,el.nd))===null||e===void 0?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class fx extends Ki{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class px extends Ki{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class mx extends Ki{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:A.M$.and(D.R.textInputFocus,(e=A.M$.and(Qn.f,el.nd))===null||e===void 0?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class _x extends Ki{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class vx extends Ki{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,n){return super._move((0,Rn.i)($e.qB.wordSeparators.defaultValue),t,i,n)}}class Cx extends Ki{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,n){return super._move((0,Rn.i)($e.qB.wordSeparators.defaultValue),t,i,n)}}class il extends _.DX{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const n=e.get(it.JZ);if(!t.hasModel())return;const o=(0,Rn.i)(t.getOption(119)),s=t.getModel(),a=t.getSelections(),l=t.getOption(5),c=t.getOption(8),d=n.getLanguageConfiguration(s.getLanguageId()).getAutoClosingPairs(),u=t._getViewModel(),h=a.map(p=>{const m=this._delete({wordSeparators:o,model:s,selection:p,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(6),autoClosingBrackets:l,autoClosingQuotes:c,autoClosingPairs:d,autoClosedCharacters:u.getCursorAutoClosedCharacters()},this._wordNavigationType);return new yi.iu(m,"")});t.pushUndoStop(),t.executeCommands(this.id,h),t.pushUndoStop()}}class mu extends il{_delete(e,t){const i=_i.z.deleteWordLeft(e,t);return i||new L.Q(1,1,1,1)}}class _u extends il{_delete(e,t){const i=_i.z.deleteWordRight(e,t);if(i)return i;const n=e.model.getLineCount(),o=e.model.getLineMaxColumn(n);return new L.Q(n,o,n,o)}}class bx extends mu{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:D.R.writable})}}class Sx extends mu{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:D.R.writable})}}class yx extends mu{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:D.R.writable,kbOpts:{kbExpr:D.R.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class wx extends _u{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:D.R.writable})}}class Dx extends _u{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:D.R.writable})}}class xx extends _u{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:D.R.writable,kbOpts:{kbExpr:D.R.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class Lx extends _.ks{constructor(){super({id:"deleteInsideWord",precondition:D.R.writable,label:g.kg("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,t,i){if(!t.hasModel())return;const n=(0,Rn.i)(t.getOption(119)),o=t.getModel(),a=t.getSelections().map(l=>{const c=_i.z.deleteInsideWord(n,o,l);return new yi.iu(c,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}(0,_.E_)(new ox),(0,_.E_)(new sx),(0,_.E_)(new rx),(0,_.E_)(new ax),(0,_.E_)(new lx),(0,_.E_)(new dx),(0,_.E_)(new hx),(0,_.E_)(new gx),(0,_.E_)(new fx),(0,_.E_)(new px),(0,_.E_)(new mx),(0,_.E_)(new _x),(0,_.E_)(new cx),(0,_.E_)(new ux),(0,_.E_)(new vx),(0,_.E_)(new Cx),(0,_.E_)(new bx),(0,_.E_)(new Sx),(0,_.E_)(new yx),(0,_.E_)(new wx),(0,_.E_)(new Dx),(0,_.E_)(new xx),(0,_.Fl)(Lx);class kx extends il{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:D.R.writable,kbOpts:{kbExpr:D.R.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const i=_i.c.deleteWordPartLeft(e);return i||new L.Q(1,1,1,1)}}class Ix extends il{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:D.R.writable,kbOpts:{kbExpr:D.R.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const i=_i.c.deleteWordPartRight(e);if(i)return i;const n=e.model.getLineCount(),o=e.model.getLineMaxColumn(n);return new L.Q(n,o,n,o)}}class xp extends tl{_move(e,t,i,n){return _i.c.moveWordPartLeft(e,t,i)}}class Rx extends xp{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:D.R.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}fe.wb.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class Ex extends xp{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:D.R.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}fe.wb.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class Lp extends tl{_move(e,t,i,n){return _i.c.moveWordPartRight(e,t,i)}}class Ax extends Lp{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:D.R.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class Nx extends Lp{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:D.R.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}(0,_.E_)(new kx),(0,_.E_)(new Ix),(0,_.E_)(new Rx),(0,_.E_)(new Ex),(0,_.E_)(new Ax),(0,_.E_)(new Nx);class vu extends I.jG{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=lt.get(this.editor);e&&this.editor.hasModel()&&(this.editor.isSimpleWidget?e.showMessage(g.kg("editor.simple.readonly","Cannot edit in read-only input"),this.editor.getPosition()):e.showMessage(g.kg("editor.readonly","Cannot edit in read-only editor"),this.editor.getPosition()))}}vu.ID="editor.contrib.readOnlyMessageController",(0,_.HW)(vu.ID,vu);var ye=f(45933),kp=f(5043),Ip=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},nl=function(r,e){return function(t,i){e(t,i,r)}};const Rp=new A.N1("accessibilityHelpWidgetVisible",!1);let En=class wm extends I.jG{constructor(e,t){super(),this._editor=e,this._widget=this._register(t.createInstance(To,this._editor))}static get(e){return e.getContribution(wm.ID)}show(){this._widget.show()}hide(){this._widget.hide()}};En.ID="editor.contrib.accessibilityHelpController",En=Ip([nl(1,he._Y)],En);function Mx(r,e){return!r||r.length===0?ye.b2.noSelection:r.length===1?e?G.GP(ye.b2.singleSelectionRange,r[0].positionLineNumber,r[0].positionColumn,e):G.GP(ye.b2.singleSelection,r[0].positionLineNumber,r[0].positionColumn):e?G.GP(ye.b2.multiSelectionRange,r.length,e):r.length>0?G.GP(ye.b2.multiSelection,r.length):""}let To=class yl extends Kn.x{constructor(e,t,i,n){super(),this._contextKeyService=t,this._keybindingService=i,this._openerService=n,this._editor=e,this._isVisibleKey=Rp.bindTo(this._contextKeyService),this._domNode=(0,kp.Z)(document.createElement("div")),this._domNode.setClassName("accessibilityHelpWidget"),this._domNode.setDisplay("none"),this._domNode.setAttribute("role","dialog"),this._domNode.setAttribute("aria-hidden","true"),this._contentDomNode=(0,kp.Z)(document.createElement("div")),this._contentDomNode.setAttribute("role","document"),this._domNode.appendChild(this._contentDomNode),this._isVisible=!1,this._register(this._editor.onDidLayoutChange(()=>{this._isVisible&&this._layout()})),this._register(S.b2(this._contentDomNode.domNode,"keydown",o=>{if(this._isVisible&&(o.equals(2083)&&((0,ft.xE)(ye.b2.emergencyConfOn),this._editor.updateOptions({accessibilitySupport:"on"}),S.w_(this._contentDomNode.domNode),this._buildContent(),this._contentDomNode.domNode.focus(),o.preventDefault(),o.stopPropagation()),o.equals(2086))){(0,ft.xE)(ye.b2.openingDocs);let s=this._editor.getRawOptions().accessibilityHelpUrl;typeof s>"u"&&(s="https://go.microsoft.com/fwlink/?linkid=852450"),this._openerService.open(me.r.parse(s)),o.preventDefault(),o.stopPropagation()}})),this.onblur(this._contentDomNode.domNode,()=>{this.hide()}),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return yl.ID}getDomNode(){return this._domNode.domNode}getPosition(){return{preference:null}}show(){this._isVisible||(this._isVisible=!0,this._isVisibleKey.set(!0),this._layout(),this._domNode.setDisplay("block"),this._domNode.setAttribute("aria-hidden","false"),this._contentDomNode.domNode.tabIndex=0,this._buildContent(),this._contentDomNode.domNode.focus())}_descriptionForCommand(e,t,i){const n=this._keybindingService.lookupKeybinding(e);return n?G.GP(t,n.getAriaLabel()):G.GP(i,e)}_buildContent(){const e=this._editor.getOptions(),t=this._editor.getSelections();let i=0;if(t){const a=this._editor.getModel();a&&t.forEach(l=>{i+=a.getValueLengthInRange(l)})}let n=Mx(t,i);e.get(56)?e.get(83)?n+=ye.b2.readonlyDiffEditor:n+=ye.b2.editableDiffEditor:e.get(83)?n+=ye.b2.readonlyEditor:n+=ye.b2.editableEditor;const o=Se.zx?ye.b2.changeConfigToOnMac:ye.b2.changeConfigToOnWinLinux;switch(e.get(2)){case 0:n+=`

 - `+o;break;case 2:n+=`

 - `+ye.b2.auto_on;break;case 1:n+=`

 - `+ye.b2.auto_off,n+=" "+o;break}e.get(132)?n+=`

 - `+this._descriptionForCommand(ko.ID,ye.b2.tabFocusModeOnMsg,ye.b2.tabFocusModeOnMsgNoKb):n+=`

 - `+this._descriptionForCommand(ko.ID,ye.b2.tabFocusModeOffMsg,ye.b2.tabFocusModeOffMsgNoKb);const s=Se.zx?ye.b2.openDocMac:ye.b2.openDocWinLinux;n+=`

 - `+s,n+=`

`+ye.b2.outroMsg,this._contentDomNode.domNode.appendChild((0,cg.yk)(n)),this._contentDomNode.domNode.setAttribute("aria-label",n)}hide(){this._isVisible&&(this._isVisible=!1,this._isVisibleKey.reset(),this._domNode.setDisplay("none"),this._domNode.setAttribute("aria-hidden","true"),this._contentDomNode.domNode.tabIndex=-1,S.w_(this._contentDomNode.domNode),this._editor.focus())}_layout(){const e=this._editor.getLayoutInfo(),t=Math.max(5,Math.min(yl.WIDTH,e.width-40)),i=Math.max(5,Math.min(yl.HEIGHT,e.height-40));this._domNode.setWidth(t),this._domNode.setHeight(i);const n=Math.round((e.height-i)/2);this._domNode.setTop(n);const o=Math.round((e.width-t)/2);this._domNode.setLeft(o)}};To.ID="editor.contrib.accessibilityHelpWidget",To.WIDTH=500,To.HEIGHT=300,To=Ip([nl(1,A.fN),nl(2,tt.b),nl(3,pt.Cr)],To);class Tx extends _.ks{constructor(){super({id:"editor.action.showAccessibilityHelp",label:ye.b2.showAccessibilityHelpAction,alias:"Show Accessibility Help",precondition:void 0,kbOpts:{primary:571,weight:100,linux:{primary:1595,secondary:[571]}}})}run(e,t){const i=En.get(t);i&&i.show()}}(0,_.HW)(En.ID,En),(0,_.Fl)(Tx);const Ox=_.DX.bindToContribution(En.get);(0,_.E_)(new Ox({id:"closeAccessibilityHelp",precondition:Rp,handler:r=>r.hide(),kbOpts:{weight:200,kbExpr:D.R.focus,primary:9,secondary:[1033]}})),(0,U.zy)((r,e)=>{const t=r.getColor(C.CgL);t&&e.addRule(`.monaco-editor .accessibilityHelpWidget { background-color: ${t}; }`);const i=r.getColor(C.FiB);i&&e.addRule(`.monaco-editor .accessibilityHelpWidget { color: ${i}; }`);const n=r.getColor(C.f9l);n&&e.addRule(`.monaco-editor .accessibilityHelpWidget { box-shadow: 0 2px 8px ${n}; }`);const o=r.getColor(C.b1q);o&&e.addRule(`.monaco-editor .accessibilityHelpWidget { border: 2px solid ${o}; }`)});class Cu extends I.jG{constructor(e){super(),this.editor=e,this.widget=null,Se.un&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(83);!this.widget&&e?this.widget=new ol(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}}Cu.ID="editor.contrib.iPadShowKeyboard";class ol extends I.jG{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(S.ko(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(S.ko(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return ol.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}}ol.ID="editor.contrib.ShowKeyboardWidget",(0,_.HW)(Cu.ID,Cu);var er=f(15910),bu=f(97036),Ep=f(83616),Fx=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Ap=function(r,e){return function(t,i){e(t,i,r)}};let Oo=class Dm extends I.jG{constructor(e,t,i){super(),this._editor=e,this._languageService=i,this._widget=null,this._register(this._editor.onDidChangeModel(n=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(n=>this.stop())),this._register(_e.dG.onDidChange(n=>this.stop())),this._register(this._editor.onKeyUp(n=>n.keyCode===9&&this.stop()))}static get(e){return e.getContribution(Dm.ID)}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new sl(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}};Oo.ID="editor.contrib.inspectTokens",Oo=Fx([Ap(1,Ep.L),Ap(2,xt.L)],Oo);class Px extends _.ks{constructor(){super({id:"editor.action.inspectTokens",label:ye.YN.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){const i=Oo.get(t);i&&i.launch()}}function Wx(r){let e="";for(let t=0,i=r.length;t<i;t++){const n=r.charCodeAt(t);switch(n){case 9:e+="\u2192";break;case 32:e+="\xB7";break;default:e+=String.fromCharCode(n)}}return e}function Bx(r,e){const t=_e.dG.get(e);if(t)return t;const i=r.encodeLanguageId(e);return{getInitialState:()=>bu.r3,tokenize:(n,o,s)=>(0,bu.$H)(e,s),tokenizeEncoded:(n,o,s)=>(0,bu.Lh)(i,s)}}class sl extends I.jG{constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=Bx(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(i=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return sl._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let i=0;for(let l=t.tokens1.length-1;l>=0;l--){const c=t.tokens1[l];if(e.column-1>=c.offset){i=l;break}}let n=0;for(let l=t.tokens2.length>>>1;l>=0;l--)if(e.column-1>=t.tokens2[l<<1]){n=l;break}const o=this._model.getLineContent(e.lineNumber);let s="";if(i<t.tokens1.length){const l=t.tokens1[i].offset,c=i+1<t.tokens1.length?t.tokens1[i+1].offset:o.length;s=o.substring(l,c)}(0,S.Ln)(this._domNode,(0,S.$)("h2.tm-token",void 0,Wx(s),(0,S.$)("span.tm-token-length",void 0,`${s.length} ${s.length===1?"char":"chars"}`))),(0,S.BC)(this._domNode,(0,S.$)("hr.tokens-inspect-separator",{style:"clear:both"}));const a=(n<<1)+1<t.tokens2.length?this._decodeMetadata(t.tokens2[(n<<1)+1]):null;(0,S.BC)(this._domNode,(0,S.$)("table.tm-metadata-table",void 0,(0,S.$)("tbody",void 0,(0,S.$)("tr",void 0,(0,S.$)("td.tm-metadata-key",void 0,"language"),(0,S.$)("td.tm-metadata-value",void 0,`${a?a.languageId:"-?-"}`)),(0,S.$)("tr",void 0,(0,S.$)("td.tm-metadata-key",void 0,"token type"),(0,S.$)("td.tm-metadata-value",void 0,`${a?this._tokenTypeToString(a.tokenType):"-?-"}`)),(0,S.$)("tr",void 0,(0,S.$)("td.tm-metadata-key",void 0,"font style"),(0,S.$)("td.tm-metadata-value",void 0,`${a?this._fontStyleToString(a.fontStyle):"-?-"}`)),(0,S.$)("tr",void 0,(0,S.$)("td.tm-metadata-key",void 0,"foreground"),(0,S.$)("td.tm-metadata-value",void 0,`${a?ce.Q1.Format.CSS.formatHex(a.foreground):"-?-"}`)),(0,S.$)("tr",void 0,(0,S.$)("td.tm-metadata-key",void 0,"background"),(0,S.$)("td.tm-metadata-value",void 0,`${a?ce.Q1.Format.CSS.formatHex(a.background):"-?-"}`))))),(0,S.BC)(this._domNode,(0,S.$)("hr.tokens-inspect-separator")),i<t.tokens1.length&&(0,S.BC)(this._domNode,(0,S.$)("span.tm-token-type",void 0,t.tokens1[i].type)),this._editor.layoutContentWidget(this)}_decodeMetadata(e){const t=_e.dG.getColorMap(),i=er.x.getLanguageId(e),n=er.x.getTokenType(e),o=er.x.getFontStyle(e),s=er.x.getForeground(e),a=er.x.getBackground(e);return{languageId:this._languageService.languageIdCodec.decodeLanguageId(i),tokenType:n,fontStyle:o,foreground:t[s],background:t[a]}}_tokenTypeToString(e){switch(e){case 0:return"Other";case 1:return"Comment";case 2:return"String";case 3:return"RegEx";default:return"??"}}_fontStyleToString(e){let t="";return e&1&&(t+="italic "),e&2&&(t+="bold "),e&4&&(t+="underline "),e&8&&(t+="strikethrough "),t.length===0&&(t="---"),t}_getTokensAtLine(e){const t=this._getStateBeforeLine(e),i=this._tokenizationSupport.tokenize(this._model.getLineContent(e),!0,t),n=this._tokenizationSupport.tokenizeEncoded(this._model.getLineContent(e),!0,t);return{startState:t,tokens1:i.tokens,tokens2:n.tokens,endState:i.endState}}_getStateBeforeLine(e){let t=this._tokenizationSupport.getInitialState();for(let i=1;i<e;i++)t=this._tokenizationSupport.tokenize(this._model.getLineContent(i),!0,t).endState;return t}getDomNode(){return this._domNode}getPosition(){return{position:this._editor.getPosition(),preference:[2,1]}}}sl._ID="editor.contrib.inspectTokensWidget",(0,_.HW)(Oo.ID,Oo),(0,_.Fl)(Px),(0,U.zy)((r,e)=>{const t=r.getColor(C.oZ8);if(t){const o=(0,bt.Bb)(r.type)?2:1;e.addRule(`.monaco-editor .tokens-inspect-widget { border: ${o}px solid ${t}; }`),e.addRule(`.monaco-editor .tokens-inspect-widget .tokens-inspect-separator { background-color: ${t}; }`)}const i=r.getColor(C.WfR);i&&e.addRule(`.monaco-editor .tokens-inspect-widget { background-color: ${i}; }`);const n=r.getColor(C.Xo2);n&&e.addRule(`.monaco-editor .tokens-inspect-widget { color: ${n}; }`)});var tr=f(19381),Hx=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Np=function(r,e){return function(t,i){e(t,i,r)}};let rl=class wl{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=Gt.O.as(tr.Fd.Quickaccess)}provide(e){const t=new I.Cm;return t.add(e.onDidAccept(()=>{const[i]=e.selectedItems;i&&this.quickInputService.quickAccess.show(i.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(i=>{const n=this.registry.getQuickAccessProvider(i.substr(wl.PREFIX.length));n&&n.prefix&&n.prefix!==wl.PREFIX&&this.quickInputService.quickAccess.show(n.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders(),t}getQuickAccessProviders(){const e=[];for(const t of this.registry.getQuickAccessProviders().sort((i,n)=>i.prefix.localeCompare(n.prefix)))if(t.prefix!==wl.PREFIX)for(const i of t.helpEntries){const n=i.prefix||t.prefix,o=n||"\u2026";e.push({prefix:n,label:o,keybinding:i.commandId?this.keybindingService.lookupKeybinding(i.commandId):void 0,ariaLabel:(0,g.kg)("helpPickAriaLabel","{0}, {1}",o,i.description),description:i.description})}return e}};rl.PREFIX="?",rl=Hx([Np(0,en.GK),Np(1,tt.b)],rl),Gt.O.as(tr.Fd.Quickaccess).registerQuickAccessProvider({ctor:rl,prefix:"",helpEntries:[{description:ye.oq.helpQuickAccessActionLabel}]});class Mp{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t){var i;const n=new I.Cm;e.canAcceptInBackground=!!(!((i=this.options)===null||i===void 0)&&i.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const o=n.add(new I.HE);return o.value=this.doProvide(e,t),n.add(this.onDidActiveTextEditorControlChange(()=>{o.value=void 0,o.value=this.doProvide(e,t)})),n}doProvide(e,t){const i=new I.Cm,n=this.activeTextEditorControl;if(n&&this.canProvideWithTextEditor(n)){const o={editor:n},s=(0,ss.jA)(n);if(s){let a=(0,le.UH)(n.saveViewState());i.add(s.onDidChangeCursorPosition(()=>{a=(0,le.UH)(n.saveViewState())})),o.restoreViewState=()=>{a&&n===this.activeTextEditorControl&&n.restoreViewState(a)},i.add((0,mh.O)(t.onCancellationRequested)(()=>{var l;return(l=o.restoreViewState)===null||l===void 0?void 0:l.call(o)}))}i.add((0,I.s)(()=>this.clearDecorations(n))),i.add(this.provideWithTextEditor(o,e,t))}else i.add(this.provideWithoutTextEditor(e,t));return i}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus()}getModel(e){var t;return(0,ss.Np)(e)?(t=e.getModel())===null||t===void 0?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(i=>{const n=[];this.rangeHighlightDecorationId&&(n.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),n.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const o=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:(0,U.Yf)(Qi.vp),position:We.A5.Full}}}],[s,a]=i.deltaDecorations(n,o);this.rangeHighlightDecorationId={rangeHighlightId:s,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(i=>{i.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}class al extends Mp{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=(0,g.kg)("cannotRunGotoLine","Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,I.jG.None}provideWithTextEditor(e,t,i){const n=e.editor,o=new I.Cm;o.add(t.onDidAccept(l=>{const[c]=t.selectedItems;if(c){if(!this.isValidLineNumber(n,c.lineNumber))return;this.gotoLocation(e,{range:this.toRange(c.lineNumber,c.column),keyMods:t.keyMods,preserveFocus:l.inBackground}),l.inBackground||t.hide()}}));const s=()=>{const l=this.parsePosition(n,t.value.trim().substr(al.PREFIX.length)),c=this.getPickLabel(n,l.lineNumber,l.column);if(t.items=[{lineNumber:l.lineNumber,column:l.column,label:c}],t.ariaLabel=c,!this.isValidLineNumber(n,l.lineNumber)){this.clearDecorations(n);return}const d=this.toRange(l.lineNumber,l.column);n.revealRangeInCenter(d,0),this.addDecorations(n,d)};s(),o.add(t.onDidChangeValue(()=>s()));const a=(0,ss.jA)(n);return a&&a.getOptions().get(62).renderType===2&&(a.updateOptions({lineNumbers:"on"}),o.add((0,I.s)(()=>a.updateOptions({lineNumbers:"relative"})))),o}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const i=t.split(/,|:|#/).map(o=>parseInt(o,10)).filter(o=>!isNaN(o)),n=this.lineCount(e)+1;return{lineNumber:i[0]>0?i[0]:n+i[0],column:i[1]}}getPickLabel(e,t,i){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,i)?(0,g.kg)("gotoLineColumnLabel","Go to line {0} and character {1}.",t,i):(0,g.kg)("gotoLineLabel","Go to line {0}.",t);const n=e.getPosition()||{lineNumber:1,column:1},o=this.lineCount(e);return o>1?(0,g.kg)("gotoLineLabelEmptyWithLimit","Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",n.lineNumber,n.column,o):(0,g.kg)("gotoLineLabelEmpty","Current Line: {0}, Character: {1}. Type a line number to navigate to.",n.lineNumber,n.column)}isValidLineNumber(e,t){return!t||typeof t!="number"?!1:t>0&&t<=this.lineCount(e)}isValidColumn(e,t,i){if(!i||typeof i!="number")return!1;const n=this.getModel(e);if(!n)return!1;const o={lineNumber:t,column:i};return n.validatePosition(o).equals(o)}lineCount(e){var t,i;return(i=(t=this.getModel(e))===null||t===void 0?void 0:t.getLineCount())!==null&&i!==void 0?i:0}}al.PREFIX=":";var Vx=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Ux=function(r,e){return function(t,i){e(t,i,r)}};let ir=class extends al{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=Z.Jh.None}get activeTextEditorControl(){return(0,le.UH)(this.editorService.getFocusedCodeEditor())}};ir=Vx([Ux(0,Be.T)],ir);class nr extends _.ks{constructor(){super({id:nr.ID,label:ye.Hw.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:D.R.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(en.GK).quickAccess.show(ir.PREFIX)}}nr.ID="editor.action.gotoLine",(0,_.Fl)(nr),Gt.O.as(tr.Fd.Quickaccess).registerQuickAccessProvider({ctor:ir,prefix:ir.PREFIX,helpEntries:[{description:ye.Hw.gotoLineActionLabel,commandId:nr.ID}]});const Tp=[void 0,[]];function Su(r,e,t=0,i=0){const n=e;return n.values&&n.values.length>1?zx(r,n.values,t,i):Op(r,e,t,i)}function zx(r,e,t,i){let n=0;const o=[];for(const s of e){const[a,l]=Op(r,s,t,i);if(typeof a!="number")return Tp;n+=a,o.push(...l)}return[n,$x(o)]}function Op(r,e,t,i){const n=(0,je.dt)(e.original,e.originalLowercase,t,r,r.toLowerCase(),i,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return n?[n[0],(0,je.WJ)(n)]:Tp}const BL=Object.freeze({score:0});function $x(r){const e=r.sort((n,o)=>n.start-o.start),t=[];let i;for(const n of e)!i||!jx(i,n)?(i=n,t.push(n)):(i.start=Math.min(i.start,n.start),i.end=Math.max(i.end,n.end));return t}function jx(r,e){return!(r.end<e.start||e.end<r.start)}function Fp(r){return r.startsWith('"')&&r.endsWith('"')}const Pp=" ";function yu(r){typeof r!="string"&&(r="");const e=r.toLowerCase(),{pathNormalized:t,normalized:i,normalizedLowercase:n}=Wp(r),o=t.indexOf(ci.Vn)>=0,s=Fp(r);let a;const l=r.split(Pp);if(l.length>1)for(const c of l){const d=Fp(c),{pathNormalized:u,normalized:h,normalizedLowercase:p}=Wp(c);h&&(a||(a=[]),a.push({original:c,originalLowercase:c.toLowerCase(),pathNormalized:u,normalized:h,normalizedLowercase:p,expectContiguousMatch:d}))}return{original:r,originalLowercase:e,pathNormalized:t,normalized:i,normalizedLowercase:n,values:a,containsPathSeparator:o,expectContiguousMatch:s}}function Wp(r){let e;Se.uF?e=r.replace(/\//g,ci.Vn):e=r.replace(/\\/g,ci.Vn);const t=(0,G.wB)(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function Bp(r){return Array.isArray(r)?yu(r.map(e=>e.original).join(Pp)):yu(r.original)}var Gx=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Hp=function(r,e){return function(t,i){e(t,i,r)}},or=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};let Nt=class zu extends Mp{constructor(e,t,i=Object.create(null)){super(i),this._languageFeaturesService=e,this._outlineModelService=t,this.options=i,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,(0,g.kg)("cannotRunGotoSymbolWithoutEditor","To go to a symbol, first open a text editor with symbol information.")),I.jG.None}provideWithTextEditor(e,t,i){const n=e.editor,o=this.getModel(n);return o?this._languageFeaturesService.documentSymbolProvider.has(o)?this.doProvideWithEditorSymbols(e,o,t,i):this.doProvideWithoutEditorSymbols(e,o,t,i):I.jG.None}doProvideWithoutEditorSymbols(e,t,i,n){const o=new I.Cm;return this.provideLabelPick(i,(0,g.kg)("cannotRunGotoSymbolWithoutSymbolProvider","The active text editor does not provide symbol information.")),or(this,void 0,void 0,function*(){!(yield this.waitForLanguageSymbolRegistry(t,o))||n.isCancellationRequested||o.add(this.doProvideWithEditorSymbols(e,t,i,n))}),o}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}waitForLanguageSymbolRegistry(e,t){return or(this,void 0,void 0,function*(){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const i=new V.Zv,n=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(n.dispose(),i.complete(!0))}));return t.add((0,I.s)(()=>i.complete(!1))),i.p})}doProvideWithEditorSymbols(e,t,i,n){var o;const s=e.editor,a=new I.Cm;a.add(i.onDidAccept(h=>{const[p]=i.selectedItems;p&&p.range&&(this.gotoLocation(e,{range:p.range.selection,keyMods:i.keyMods,preserveFocus:h.inBackground}),h.inBackground||i.hide())})),a.add(i.onDidTriggerItemButton(({item:h})=>{h&&h.range&&(this.gotoLocation(e,{range:h.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())}));const l=this.getDocumentSymbols(t,n);let c;const d=h=>or(this,void 0,void 0,function*(){c?.dispose(!0),i.busy=!1,c=new re.Q(n),i.busy=!0;try{const p=yu(i.value.substr(zu.PREFIX.length).trim()),m=yield this.doGetSymbolPicks(l,p,void 0,c.token);if(n.isCancellationRequested)return;if(m.length>0){if(i.items=m,h&&p.original.length===0){const v=(0,pe.Uk)(m,w=>!!(w.type!=="separator"&&w.range&&L.Q.containsPosition(w.range.decoration,h)));v&&(i.activeItems=[v])}}else p.original.length>0?this.provideLabelPick(i,(0,g.kg)("noMatchingSymbolResults","No matching editor symbols")):this.provideLabelPick(i,(0,g.kg)("noSymbolResults","No editor symbols"))}finally{n.isCancellationRequested||(i.busy=!1)}});a.add(i.onDidChangeValue(()=>d(void 0))),d((o=s.getSelection())===null||o===void 0?void 0:o.getPosition());let u=2;return a.add(i.onDidChangeActive(()=>{const[h]=i.activeItems;if(h&&h.range){if(u-- >0)return;s.revealRangeInCenter(h.range.selection,0),this.addDecorations(s,h.range.decoration)}})),a}doGetSymbolPicks(e,t,i,n){return or(this,void 0,void 0,function*(){const o=yield e;if(n.isCancellationRequested)return[];const s=t.original.indexOf(zu.SCOPE_PREFIX)===0,a=s?1:0;let l,c;t.values&&t.values.length>1?(l=Bp(t.values[0]),c=Bp(t.values.slice(1))):l=t;const d=[];for(let p=0;p<o.length;p++){const m=o[p],v=(0,G.Bq)(m.name),w=`$(${_e.gP.toIcon(m.kind).id}) ${v}`,R=w.length-v.length;let T=m.containerName;i?.extraContainerLabel&&(T?T=`${i.extraContainerLabel} \u2022 ${T}`:T=i.extraContainerLabel);let F,B,j,ve;if(t.original.length>a){let Ue=!1;if(l!==t&&([F,B]=Su(w,Object.assign(Object.assign({},t),{values:void 0}),a,R),typeof F=="number"&&(Ue=!0)),typeof F!="number"&&([F,B]=Su(w,l,a,R),typeof F!="number"))continue;if(!Ue&&c){if(T&&c.original.length>0&&([j,ve]=Su(T,c)),typeof j!="number")continue;typeof F=="number"&&(F+=j)}}const ie=m.tags&&m.tags.indexOf(1)>=0;d.push({index:p,kind:m.kind,score:F,label:w,ariaLabel:v,description:T,highlights:ie?void 0:{label:B,description:ve},range:{selection:L.Q.collapseToStart(m.selectionRange),decoration:m.range},strikethrough:ie,buttons:(()=>{var Ue,et;const rt=!((Ue=this.options)===null||Ue===void 0)&&Ue.openSideBySideDirection?(et=this.options)===null||et===void 0?void 0:et.openSideBySideDirection():void 0;if(rt)return[{iconClass:rt==="right"?Q.W6.splitHorizontal.classNames:Q.W6.splitVertical.classNames,tooltip:rt==="right"?(0,g.kg)("openToSide","Open to the Side"):(0,g.kg)("openToBottom","Open to the Bottom")}]})()})}const u=d.sort((p,m)=>s?this.compareByKindAndScore(p,m):this.compareByScore(p,m));let h=[];if(s){let w=function(){m&&typeof p=="number"&&v>0&&(m.label=(0,G.GP)(Du[p]||wu,v))},p,m,v=0;for(const R of u)p!==R.kind?(w(),p=R.kind,v=1,m={type:"separator"},h.push(m)):v++,h.push(R);w()}else u.length>0&&(h=[{label:(0,g.kg)("symbols","symbols ({0})",d.length),type:"separator"},...u]);return h})}compareByScore(e,t){if(typeof e.score!="number"&&typeof t.score=="number")return 1;if(typeof e.score=="number"&&typeof t.score!="number")return-1;if(typeof e.score=="number"&&typeof t.score=="number"){if(e.score>t.score)return-1;if(e.score<t.score)return 1}return e.index<t.index?-1:e.index>t.index?1:0}compareByKindAndScore(e,t){const i=Du[e.kind]||wu,n=Du[t.kind]||wu,o=i.localeCompare(n);return o===0?this.compareByScore(e,t):o}getDocumentSymbols(e,t){return or(this,void 0,void 0,function*(){const i=yield this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()})}};Nt.PREFIX="@",Nt.SCOPE_PREFIX=":",Nt.PREFIX_BY_CATEGORY=`${Nt.PREFIX}${Nt.SCOPE_PREFIX}`,Nt=Gx([Hp(0,te.u),Hp(1,ya)],Nt);const wu=(0,g.kg)("property","properties ({0})"),Du={5:(0,g.kg)("method","methods ({0})"),11:(0,g.kg)("function","functions ({0})"),8:(0,g.kg)("_constructor","constructors ({0})"),12:(0,g.kg)("variable","variables ({0})"),4:(0,g.kg)("class","classes ({0})"),22:(0,g.kg)("struct","structs ({0})"),23:(0,g.kg)("event","events ({0})"),24:(0,g.kg)("operator","operators ({0})"),10:(0,g.kg)("interface","interfaces ({0})"),2:(0,g.kg)("namespace","namespaces ({0})"),3:(0,g.kg)("package","packages ({0})"),25:(0,g.kg)("typeParameter","type parameters ({0})"),1:(0,g.kg)("modules","modules ({0})"),6:(0,g.kg)("property","properties ({0})"),9:(0,g.kg)("enum","enumerations ({0})"),21:(0,g.kg)("enumMember","enumeration members ({0})"),14:(0,g.kg)("string","strings ({0})"),0:(0,g.kg)("file","files ({0})"),17:(0,g.kg)("array","arrays ({0})"),15:(0,g.kg)("number","numbers ({0})"),16:(0,g.kg)("boolean","booleans ({0})"),18:(0,g.kg)("object","objects ({0})"),19:(0,g.kg)("key","keys ({0})"),7:(0,g.kg)("field","fields ({0})"),13:(0,g.kg)("constant","constants ({0})")};var Kx=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},xu=function(r,e){return function(t,i){e(t,i,r)}};let Lu=class extends Nt{constructor(e,t,i){super(t,i),this.editorService=e,this.onDidActiveTextEditorControlChange=Z.Jh.None}get activeTextEditorControl(){return(0,le.UH)(this.editorService.getFocusedCodeEditor())}};Lu=Kx([xu(0,Be.T),xu(1,te.u),xu(2,ya)],Lu);class sr extends _.ks{constructor(){super({id:sr.ID,label:ye.n9.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:D.R.hasDocumentSymbolProvider,kbOpts:{kbExpr:D.R.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(en.GK).quickAccess.show(Nt.PREFIX)}}sr.ID="editor.action.quickOutline",(0,_.Fl)(sr),Gt.O.as(tr.Fd.Quickaccess).registerQuickAccessProvider({ctor:Lu,prefix:Nt.PREFIX,helpEntries:[{description:ye.n9.quickOutlineActionLabel,prefix:Nt.PREFIX,commandId:sr.ID},{description:ye.n9.quickOutlineByCategoryActionLabel,prefix:Nt.PREFIX_BY_CATEGORY}]});function ku(r,e){return e&&(r.stack||r.stacktrace)?g.kg("stackTrace.format","{0}: {1}",Up(r),Vp(r.stack)||Vp(r.stacktrace)):Up(r)}function Vp(r){return Array.isArray(r)?r.join(`
`):r}function Up(r){return typeof r.code=="string"&&typeof r.errno=="number"&&typeof r.syscall=="string"?g.kg("nodeExceptionMessage","A system error occurred ({0})",r.message):r.message||g.kg("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function zp(r=null,e=!1){if(!r)return g.kg("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(r)){const t=pe.Yc(r),i=zp(t[0],e);return t.length>1?g.kg("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(le.Kg(r))return r;if(r.detail){const t=r.detail;if(t.error)return ku(t.error,e);if(t.exception)return ku(t.exception,e)}return r.stack?ku(r,e):r.message?r.message:g.kg("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}var ll=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})},Fo;(function(r){r[r.NO_ACTION=0]="NO_ACTION",r[r.CLOSE_PICKER=1]="CLOSE_PICKER",r[r.REFRESH_PICKER=2]="REFRESH_PICKER",r[r.REMOVE_ITEM=3]="REMOVE_ITEM"})(Fo||(Fo={}));function Iu(r){const e=r;return Array.isArray(e.items)}function Qx(r){const e=r;return!!e.picks&&e.additionalPicks instanceof Promise}class dl extends I.jG{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t){var i;const n=new I.Cm;e.canAcceptInBackground=!!(!((i=this.options)===null||i===void 0)&&i.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let o;const s=n.add(new I.HE),a=()=>ll(this,void 0,void 0,function*(){const l=s.value=new I.Cm;o?.dispose(!0),e.busy=!1,o=new re.Q(t);const c=o.token,d=e.value.substr(this.prefix.length).trim(),u=this._getPicks(d,l,c),h=(p,m)=>{var v;let w,R;if(Iu(p)?(w=p.items,R=p.active):w=p,w.length===0){if(m)return!1;d.length>0&&(!((v=this.options)===null||v===void 0)&&v.noResultsPick)&&(w=[this.options.noResultsPick])}return e.items=w,R&&(e.activeItems=[R]),!0};if(u!==null)if(Qx(u)){let p=!1,m=!1;yield Promise.all([ll(this,void 0,void 0,function*(){yield(0,V.wR)(dl.FAST_PICKS_RACE_DELAY),!c.isCancellationRequested&&(m||(p=h(u.picks,!0)))}),ll(this,void 0,void 0,function*(){e.busy=!0;try{const v=yield u.additionalPicks;if(c.isCancellationRequested)return;let w,R;Iu(u.picks)?(w=u.picks.items,R=u.picks.active):w=u.picks;let T,F;if(Iu(v)?(T=v.items,F=v.active):T=v,T.length>0||!p){let B;if(!R&&!F){const j=e.activeItems[0];j&&w.indexOf(j)!==-1&&(B=j)}h({items:[...w,...T],active:R||F||B})}}finally{c.isCancellationRequested||(e.busy=!1),m=!0}})])}else if(!(u instanceof Promise))h(u);else{e.busy=!0;try{const p=yield u;if(c.isCancellationRequested)return;h(p)}finally{c.isCancellationRequested||(e.busy=!1)}}});return n.add(e.onDidChangeValue(()=>a())),a(),n.add(e.onDidAccept(l=>{const[c]=e.selectedItems;typeof c?.accept=="function"&&(l.inBackground||e.hide(),c.accept(e.keyMods,l))})),n.add(e.onDidTriggerItemButton(({button:l,item:c})=>ll(this,void 0,void 0,function*(){var d,u;if(typeof c.trigger=="function"){const h=(u=(d=c.buttons)===null||d===void 0?void 0:d.indexOf(l))!==null&&u!==void 0?u:-1;if(h>=0){const p=c.trigger(h,e.keyMods),m=typeof p=="number"?p:yield p;if(t.isCancellationRequested)return;switch(m){case Fo.NO_ACTION:break;case Fo.CLOSE_PICKER:e.hide();break;case Fo.REFRESH_PICKER:a();break;case Fo.REMOVE_ITEM:{const v=e.items.indexOf(c);if(v!==-1){const w=e.items.slice(),R=w.splice(v,1),T=e.activeItems.filter(B=>B!==R[0]),F=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=w,T&&(e.activeItems=T),e.keepScrollPosition=F}break}}}}}))),n}}dl.FAST_PICKS_RACE_DELAY=200;var $p=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},An=function(r,e){return function(t,i){e(t,i,r)}},jp=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};let rr=class Dl extends dl{constructor(e,t,i,n,o,s){super(Dl.PREFIX,e),this.instantiationService=t,this.keybindingService=i,this.commandService=n,this.telemetryService=o,this.dialogService=s,this.commandsHistory=this._register(this.instantiationService.createInstance(Nn)),this.options=e}_getPicks(e,t,i){return jp(this,void 0,void 0,function*(){const n=yield this.getCommandPicks(t,i);if(i.isCancellationRequested)return[];const o=[];for(const c of n){const d=(0,le.UH)(Dl.WORD_FILTER(e,c.label)),u=c.commandAlias?(0,le.UH)(Dl.WORD_FILTER(e,c.commandAlias)):void 0;d||u?(c.highlights={label:d,detail:this.options.showAlias?u:void 0},o.push(c)):e===c.commandId&&o.push(c)}const s=new Map;for(const c of o){const d=s.get(c.label);d?(c.description=c.commandId,d.description=d.commandId):s.set(c.label,c)}o.sort((c,d)=>{const u=this.commandsHistory.peek(c.commandId),h=this.commandsHistory.peek(d.commandId);return u&&h?u>h?-1:1:u?-1:h?1:c.label.localeCompare(d.label)});const a=[];let l=!1;for(let c=0;c<o.length;c++){const d=o[c],u=this.keybindingService.lookupKeybinding(d.commandId),h=u?(0,g.kg)("commandPickAriaLabelWithKeybinding","{0}, {1}",d.label,u.getAriaLabel()):d.label;c===0&&this.commandsHistory.peek(d.commandId)&&(a.push({type:"separator",label:(0,g.kg)("recentlyUsed","recently used")}),l=!0),c!==0&&l&&!this.commandsHistory.peek(d.commandId)&&(a.push({type:"separator",label:(0,g.kg)("morecCommands","other commands")}),l=!1),a.push(Object.assign(Object.assign({},d),{ariaLabel:h,detail:this.options.showAlias&&d.commandAlias!==d.label?d.commandAlias:void 0,keybinding:u,accept:()=>jp(this,void 0,void 0,function*(){this.commandsHistory.push(d.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:d.commandId,from:"quick open"});try{yield this.commandService.executeCommand(d.commandId)}catch(p){(0,K.MB)(p)||this.dialogService.show(to.A.Error,(0,g.kg)("canNotRun","Command '{0}' resulted in an error ({1})",d.label,zp(p)))}})}))}return a})}};rr.PREFIX=">",rr.WORD_FILTER=(0,je.or)(je.WP,je.J1,je.Tt),rr=$p([An(1,he._Y),An(2,tt.b),An(3,fe.wT),An(4,Vn.k),An(5,pu.X)],rr);let Nn=class Oe extends I.jG{constructor(e,t){super(),this.storageService=e,this.configurationService=t,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(()=>this.updateConfiguration()))}updateConfiguration(){this.configuredCommandsHistoryLength=Oe.getConfiguredCommandHistoryLength(this.configurationService),Oe.cache&&Oe.cache.limit!==this.configuredCommandsHistoryLength&&(Oe.cache.limit=this.configuredCommandsHistoryLength,Oe.saveState(this.storageService))}load(){const e=this.storageService.get(Oe.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch{}const i=Oe.cache=new Ji.qK(this.configuredCommandsHistoryLength,1);if(t){let n;t.usesLRU?n=t.entries:n=t.entries.sort((o,s)=>o.value-s.value),n.forEach(o=>i.set(o.key,o.value))}Oe.counter=this.storageService.getNumber(Oe.PREF_KEY_COUNTER,0,Oe.counter)}push(e){Oe.cache&&(Oe.cache.set(e,Oe.counter++),Oe.saveState(this.storageService))}peek(e){var t;return(t=Oe.cache)===null||t===void 0?void 0:t.peek(e)}static saveState(e){if(!Oe.cache)return;const t={usesLRU:!0,entries:[]};Oe.cache.forEach((i,n)=>t.entries.push({key:n,value:i})),e.store(Oe.PREF_KEY_CACHE,JSON.stringify(t),0,0),e.store(Oe.PREF_KEY_COUNTER,Oe.counter,0,0)}static getConfiguredCommandHistoryLength(e){var t,i;const o=(i=(t=e.getValue().workbench)===null||t===void 0?void 0:t.commandPalette)===null||i===void 0?void 0:i.history;return typeof o=="number"?o:Oe.DEFAULT_COMMANDS_HISTORY_LENGTH}};Nn.DEFAULT_COMMANDS_HISTORY_LENGTH=50,Nn.PREF_KEY_CACHE="commandPalette.mru.cache",Nn.PREF_KEY_COUNTER="commandPalette.mru.counter",Nn.counter=1,Nn=$p([An(0,Tt.CS),An(1,Fe.pG)],Nn);class Zx extends rr{constructor(e,t,i,n,o,s){super(e,t,i,n,o,s)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const i of e.getSupportedActions())t.push({commandId:i.id,commandAlias:i.alias,label:(0,ug.pS)(i.label)||i.id});return t}}var Yx=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Po=function(r,e){return function(t,i){e(t,i,r)}},Xx=function(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{c(i.next(d))}catch(u){s(u)}}function l(d){try{c(i.throw(d))}catch(u){s(u)}}function c(d){d.done?o(d.value):n(d.value).then(a,l)}c((i=i.apply(r,e||[])).next())})};let ar=class extends Zx{constructor(e,t,i,n,o,s){super({showAlias:!1},e,i,n,o,s),this.codeEditorService=t}get activeTextEditorControl(){return(0,le.UH)(this.codeEditorService.getFocusedCodeEditor())}getCommandPicks(){return Xx(this,void 0,void 0,function*(){return this.getCodeEditorCommandPicks()})}};ar=Yx([Po(0,he._Y),Po(1,Be.T),Po(2,tt.b),Po(3,fe.wT),Po(4,Vn.k),Po(5,pu.X)],ar);class lr extends _.ks{constructor(){super({id:lr.ID,label:ye.gf.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:D.R.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(en.GK).quickAccess.show(ar.PREFIX)}}lr.ID="editor.action.quickCommand",(0,_.Fl)(lr),Gt.O.as(tr.Fd.Quickaccess).registerQuickAccessProvider({ctor:ar,prefix:ar.PREFIX,helpEntries:[{description:ye.gf.quickCommandHelp,commandId:lr.ID}]});var Jx=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Wo=function(r,e){return function(t,i){e(t,i,r)}};let Ru=class extends Ii{constructor(e,t,i,n,o,s,a){super(!0,e,t,i,n,o,s,a)}};Ru=Jx([Wo(1,A.fN),Wo(2,Be.T),Wo(3,Ye.Ot),Wo(4,he._Y),Wo(5,Tt.CS),Wo(6,Fe.pG)],Ru),(0,_.HW)(Ii.ID,Ru);var cl=f(93582);class qx extends _.ks{constructor(){super({id:"editor.action.toggleHighContrast",label:ye.E6.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(Ep.L),n=i.getColorTheme();(0,bt.Bb)(n.type)?(i.setTheme(this._originalThemeName||((0,bt.HD)(n.type)?cl.po:cl.tj)),this._originalThemeName=null):(i.setTheme((0,bt.HD)(n.type)?cl.aQ:cl.nr),this._originalThemeName=n.themeName)}}(0,_.Fl)(qx)},19664:(xm,fr,f)=>{f.d(fr,{IF:()=>zo});var Pe=f(97396);/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/var xl=Object.defineProperty,Ll=Object.getOwnPropertyDescriptor,kl=Object.getOwnPropertyNames,Il=Object.prototype.hasOwnProperty,Uo=(W,Ie,ke,at)=>{if(Ie&&typeof Ie=="object"||typeof Ie=="function")for(let gt of kl(Ie))!Il.call(W,gt)&&gt!==ke&&xl(W,gt,{get:()=>Ie[gt],enumerable:!(at=Ll(Ie,gt))||at.enumerable});return W},Rl=(W,Ie,ke)=>(Uo(W,Ie,"default"),ke&&Uo(ke,Ie,"default")),Ci="4.5.5",ti={};Rl(ti,Pe);var Wn=(W=>(W[W.None=0]="None",W[W.CommonJS=1]="CommonJS",W[W.AMD=2]="AMD",W[W.UMD=3]="UMD",W[W.System=4]="System",W[W.ES2015=5]="ES2015",W[W.ESNext=99]="ESNext",W))(Wn||{}),Bn=(W=>(W[W.None=0]="None",W[W.Preserve=1]="Preserve",W[W.React=2]="React",W[W.ReactNative=3]="ReactNative",W[W.ReactJSX=4]="ReactJSX",W[W.ReactJSXDev=5]="ReactJSXDev",W))(Bn||{}),El=(W=>(W[W.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",W[W.LineFeed=1]="LineFeed",W))(El||{}),H=(W=>(W[W.ES3=0]="ES3",W[W.ES5=1]="ES5",W[W.ES2015=2]="ES2015",W[W.ES2016=3]="ES2016",W[W.ES2017=4]="ES2017",W[W.ES2018=5]="ES2018",W[W.ES2019=6]="ES2019",W[W.ES2020=7]="ES2020",W[W.ESNext=99]="ESNext",W[W.JSON=100]="JSON",W[W.Latest=99]="Latest",W))(H||{}),pr=(W=>(W[W.Classic=1]="Classic",W[W.NodeJs=2]="NodeJs",W))(pr||{}),mr=class{_onDidChange=new ti.Emitter;_onDidExtraLibsChange=new ti.Emitter;_extraLibs;_removedExtraLibs;_eagerModelSync;_compilerOptions;_diagnosticsOptions;_workerOptions;_onDidExtraLibsChangeTimeout;_inlayHintsOptions;constructor(W,Ie,ke,at){this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(W),this.setDiagnosticsOptions(Ie),this.setWorkerOptions(ke),this.setInlayHintsOptions(at),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(W,Ie){let ke;if(typeof Ie>"u"?ke=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:ke=Ie,this._extraLibs[ke]&&this._extraLibs[ke].content===W)return{dispose:()=>{}};let at=1;return this._removedExtraLibs[ke]&&(at=this._removedExtraLibs[ke]+1),this._extraLibs[ke]&&(at=this._extraLibs[ke].version+1),this._extraLibs[ke]={content:W,version:at},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let gt=this._extraLibs[ke];gt&&gt.version===at&&(delete this._extraLibs[ke],this._removedExtraLibs[ke]=at,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(W){for(const Ie in this._extraLibs)this._removedExtraLibs[Ie]=this._extraLibs[Ie].version;if(this._extraLibs=Object.create(null),W&&W.length>0)for(const Ie of W){const ke=Ie.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,at=Ie.content;let gt=1;this._removedExtraLibs[ke]&&(gt=this._removedExtraLibs[ke]+1),this._extraLibs[ke]={content:at,version:gt}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(W){this._compilerOptions=W||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(W){this._diagnosticsOptions=W||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(W){this._workerOptions=W||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(W){this._inlayHintsOptions=W||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(W){}setEagerModelSync(W){this._eagerModelSync=W}getEagerModelSync(){return this._eagerModelSync}},Al=Ci,zo=new mr({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{}),$o=new mr({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{}),Nl=()=>Si().then(W=>W.getTypeScriptWorker()),bi=()=>Si().then(W=>W.getJavaScriptWorker());ti.languages.typescript={ModuleKind:Wn,JsxEmit:Bn,NewLineKind:El,ScriptTarget:H,ModuleResolutionKind:pr,typescriptVersion:Al,typescriptDefaults:zo,javascriptDefaults:$o,getTypeScriptWorker:Nl,getJavaScriptWorker:bi};function Si(){return f.e(9355).then(f.bind(f,59355))}ti.languages.onLanguage("typescript",()=>Si().then(W=>W.setupTypeScript(zo))),ti.languages.onLanguage("javascript",()=>Si().then(W=>W.setupJavaScript($o)))}}]);

//# sourceMappingURL=8477.e51a71aaaba035ba2657.js.map